From a2e93075f2ec86dad367a8aafadc20f6386f9b0e Mon Sep 17 00:00:00 2001 From: "Frank.Willmore" Date: Fri, 30 Sep 2016 11:50:14 -0500 Subject: added test file --- this_is_a_test | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 this_is_a_test diff --git a/this_is_a_test b/this_is_a_test new file mode 100644 index 0000000..e69de29 -- cgit v0.12 From a3605cbdeb5f79c5753b848dfef1706988ba10e7 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 13 Jan 2017 08:14:38 -0600 Subject: Switch working branch from master to develop --- src/H5Dchunk.c | 5 +- src/H5Dint.c | 4 - src/H5Dio.c | 5 - src/H5Dmpio.c | 1400 ++++++++++++++++++++++++++++++++++++++++++++++++++++- src/H5Dpkg.h | 5 + src/H5Dscatgath.c | 7 +- 6 files changed, 1391 insertions(+), 35 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 7a646af..8623325 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -297,9 +297,6 @@ static herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info, static herr_t H5D__chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, size_t size); static herr_t H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk); -static herr_t H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, - const H5F_block_t *old_chunk, H5F_block_t *new_chunk, hbool_t *need_insert, - hsize_t scaled[]); #ifdef H5_HAVE_PARALLEL static herr_t H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, H5D_chunk_coll_info_t *chunk_info, size_t chunk_size, const void *fill_buf); @@ -6240,7 +6237,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old_chunk, H5F_block_t *new_chunk, hbool_t *need_insert, hsize_t scaled[]) { diff --git a/src/H5Dint.c b/src/H5Dint.c index 5a11581..dac12df 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1210,10 +1210,6 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, /* Don't allow compact datasets to allocate space later */ if(layout->type == H5D_COMPACT && fill->alloc_time != H5D_ALLOC_TIME_EARLY) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "compact dataset must have early space allocation") - - /* If MPI VFD is used, no filter support yet. */ - if(H5F_HAS_FEATURE(file, H5FD_FEAT_HAS_MPI) && pline->nused > 0) - HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "Parallel I/O does not support filters yet") } /* end if */ /* Set the latest version of the layout, pline & fill messages, if requested */ diff --git a/src/H5Dio.c b/src/H5Dio.c index f5087da..6a4e6ec 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -666,11 +666,6 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if(H5T_get_class(type_info.mem_type, TRUE) == H5T_REFERENCE && H5T_get_ref_type(type_info.mem_type) == H5R_DATASET_REGION) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "Parallel IO does not support writing region reference datatypes yet") - - /* Can't write to chunked datasets with filters, in parallel */ - if(dataset->shared->layout.type == H5D_CHUNKED && - dataset->shared->dcpl_cache.pline.nused > 0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot write to chunked storage with filters in parallel") } /* end if */ else { /* Collective access is not permissible without a MPI based VFD */ diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 441cc96..cfcc5c4 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -86,6 +86,11 @@ #define H5D_CHUNK_SELECT_IRREG 2 #define H5D_CHUNK_SELECT_NONE 0 +#define PARALLEL_COMPRESS_DEBUG + +#ifdef PARALLEL_COMPRESS_DEBUG +FILE *debug_file; +#endif /******************/ /* Local Typedefs */ @@ -96,6 +101,14 @@ typedef struct H5D_chunk_addr_info_t { H5D_chunk_info_t chunk_info; } H5D_chunk_addr_info_t; +typedef struct H5D_filtered_collective_io_info_t { + H5D_chunk_info_t chunk_info; + H5F_block_t old_chunk; + H5F_block_t new_chunk; + int num_writers; + int owner; + void *buf; +} H5D_filtered_collective_io_info_t; /********************/ /* Local Prototypes */ @@ -105,9 +118,15 @@ static herr_t H5D__chunk_collective_io(H5D_io_info_t *io_info, static herr_t H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist); +static herr_t H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, + H5P_genplist_t *dx_plist); static herr_t H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, int sum_chunk, H5P_genplist_t *dx_plist); +static herr_t H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, + H5P_genplist_t *dx_plist); static herr_t H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, const H5S_t *file_space, const H5S_t *mem_space); @@ -126,6 +145,21 @@ static herr_t H5D__mpio_get_min_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int *min_chunkf); static herr_t H5D__mpio_get_sum_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int *sum_chunkf); +static herr_t H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm, + H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries, + size_t **_num_chunks_selected_array); +static herr_t H5D__mpio_array_gather(H5D_io_info_t *io_info, void *local_array, + size_t array_num_entries, size_t array_entry_size, + void **gathered_array, size_t *gathered_array_num_entries, + int (*sort_func)(const void *, const void *)); +static herr_t H5D__mpio_filtered_collective_write_type( + H5D_filtered_collective_io_info_t *chunk_list, size_t num_entries, + MPI_Datatype *new_mem_type, hbool_t *mem_type_derived, + MPI_Datatype *new_file_type, hbool_t *file_type_derived); +static int H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2); +static int H5D__cmp_filtered_collective_io_entry(const void *filtered_collective_io_entry1, + const void *filtered_collective_io_entry2); /*********************/ @@ -208,11 +242,6 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, * use collective IO will defer until each chunk IO is reached. */ - /* Don't allow collective operations if filters need to be applied */ - if(io_info->dset->shared->layout.type == H5D_CHUNKED && - io_info->dset->shared->dcpl_cache.pline.nused > 0) - local_cause |= H5D_MPIO_FILTERS; - /* Check for independent I/O */ if(local_cause & H5D_MPIO_SET_INDEPENDENT) global_cause = local_cause; @@ -302,6 +331,105 @@ done: /*------------------------------------------------------------------------- + * Function: H5D__mpio_array_gather + * + * Purpose: Given arrays by MPI ranks, gathers them into a single large + * array which is then distributed back to all ranks. If the + * sort_func argument is specified, the list is sorted before + * being returned. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jordan Henderson + * Friday, January 6th, 2016 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D__mpio_array_gather(H5D_io_info_t *io_info, void *local_array, + size_t array_num_entries, size_t array_entry_size, + void **_gathered_array, size_t *_gathered_array_num_entries, + int (*sort_func)(const void *, const void *)) +{ + size_t gathered_array_num_entries = 0; + size_t i; + void *gathered_array = NULL; + int *receive_counts_array = NULL; + int *displacements_array = NULL; + int mpi_code, mpi_size; + int sendcount; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + HDassert(io_info); + HDassert(local_array); + HDassert(_gathered_array); + HDassert(_gathered_array_num_entries); + + if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") + + if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&array_num_entries, &gathered_array_num_entries, 1, MPI_INT, MPI_SUM, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) + + if (NULL == (gathered_array = H5MM_malloc(gathered_array_num_entries * array_entry_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate total gathered array") + + if (NULL == (receive_counts_array = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*receive_counts_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate receive counts array") + + if (NULL == (displacements_array = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*displacements_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate displacements array") + + if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&array_num_entries, 1, MPI_INT, receive_counts_array, 1, MPI_INT, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) + + /* Multiply each receive count by the size of the array entry, + * since the data is sent in a count of bytes */ + /* XXX: Check to make sure array_entry_size doesn't overflow an int */ + for (i = 0; i < (size_t) mpi_size; i++) + receive_counts_array[i] *= array_entry_size; + + /* Set receive buffer offsets for MPI_Allgatherv */ + displacements_array[0] = 0; + for (i = 1; i < (size_t) mpi_size; i++) + displacements_array[i] = displacements_array[i - 1] + receive_counts_array[i - 1]; + + H5_CHECKED_ASSIGN(sendcount, int, array_num_entries * array_entry_size, size_t); + if (MPI_SUCCESS != (mpi_code = MPI_Allgatherv(local_array, sendcount, MPI_BYTE, + gathered_array, receive_counts_array, displacements_array, MPI_BYTE, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Allgatherv failed", mpi_code) + + if (sort_func) HDqsort(gathered_array, gathered_array_num_entries, array_entry_size, sort_func); + + *_gathered_array = gathered_array; + *_gathered_array_num_entries = gathered_array_num_entries; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, " Contents of gathered array:\n"); + HDfprintf(debug_file, "------------------------------\n"); + for (size_t j = 0; j < (size_t) gathered_array_num_entries; j++) { + HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); + HDfprintf(debug_file, "| - Chunk Address: %a\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].old_chunk.offset); + HDfprintf(debug_file, "| - Chunk Length: %zd\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].old_chunk.length); + HDfprintf(debug_file, "| - Chunk Owner: %d\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].owner); + HDfprintf(debug_file, "| - Address of mspace: %x\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].chunk_info.mspace); + } + HDfprintf(debug_file, "------------------------------\n\n"); +#endif + +done: + if (receive_counts_array) + H5MM_free(receive_counts_array); + if (displacements_array) + H5MM_free(displacements_array); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__filtered_collective_io_info_arraygather() */ + + +/*------------------------------------------------------------------------- * Function: H5D__ioinfo_xfer_mode * * Purpose: Switch to between collective & independent MPI I/O @@ -441,6 +569,9 @@ H5D__mpio_get_sum_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, H5_CHECKED_ASSIGN(num_chunkf, int, ori_num_chunkf, size_t); /* Determine the summation of number of chunks for all processes */ + /* XXX: In the case that more than one process is writing to the + * same chunk, the summation of H5SL_count calls is incorrect. - JTH + */ if(MPI_SUCCESS != (mpi_code = MPI_Allreduce(&num_chunkf, sum_chunkf, 1, MPI_INT, MPI_SUM, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) @@ -683,19 +814,31 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf #endif /* step 2: Go ahead to do IO.*/ - if(H5D_ONE_LINK_CHUNK_IO == io_option || H5D_ONE_LINK_CHUNK_IO_MORE_OPT == io_option) { - if(H5D__link_chunk_collective_io(io_info, type_info, fm, sum_chunk, dx_plist) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish linked chunk MPI-IO") - } /* end if */ - /* direct request to multi-chunk-io */ - else if(H5D_MULTI_CHUNK_IO == io_option) { - if(H5D__multi_chunk_collective_io(io_info, type_info, fm, dx_plist) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple chunk MPI-IO") - } /* end if */ - else { /* multiple chunk IO via threshold */ - if(H5D__multi_chunk_collective_io(io_info, type_info, fm, dx_plist) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple chunk MPI-IO") - } /* end else */ + switch (io_option) { + case H5D_ONE_LINK_CHUNK_IO: + case H5D_ONE_LINK_CHUNK_IO_MORE_OPT: + if(io_info->dset->shared->dcpl_cache.pline.nused > 0) { + if(H5D__link_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish filtered linked chunk MPI-IO") + } + else { + if(H5D__link_chunk_collective_io(io_info, type_info, fm, sum_chunk, dx_plist) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish linked chunk MPI-IO") + } + break; + + case H5D_MULTI_CHUNK_IO: /* direct request to do multi-chunk IO */ + default: /* multiple chunk IO via threshold */ + if(io_info->dset->shared->dcpl_cache.pline.nused > 0) { + if(H5D__multi_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple filtered chunk MPI-IO") + } + else { + if(H5D__multi_chunk_collective_io(io_info, type_info, fm, dx_plist) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple chunk MPI-IO") + } + break; + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -755,6 +898,14 @@ H5D__chunk_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_ FUNC_ENTER_PACKAGE +#ifdef PARALLEL_COMPRESS_DEBUG + char name[10]; + + snprintf(name, 10, "out - %d", H5F_mpi_get_rank(io_info->dset->oloc.file)); + + debug_file = fopen(name, "w"); +#endif + /* Call generic selection operation */ if(H5D__chunk_collective_io(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") @@ -1095,6 +1246,408 @@ if(H5DEBUG(D)) /*------------------------------------------------------------------------- + * Function: H5D__link_chunk_filtered_collective_io + * + * Purpose: Routine for one collective IO with one MPI derived datatype + * to link with all filtered chunks + * + * 1. Construct a list of selected chunks in the collective IO + * operation + * A. If any chunk is being written to by more than 1 + * process, the process writing the most data to the + * chunk will take ownership of the chunk (ties are + * broken randomly) + * 2. If the operation is a write operation + * A. Loop through each chunk in the operation + * I. Determine if this is a full overwrite of the chunk + * a) If it is not, read the chunk from file and + * pass the chunk through the filter pipeline in + * reverse order (Unfilter the chunk) + * b) Else copy the owning process' modification + * data into a buffer of size large enough to + * completely overwrite the chunk + * II. Receive any modification data from other + * processes and update the chunk data with these + * modifications + * III. Filter the chunk + * B. Contribute the modified chunks to an array gathered + * by all processes which contains the new sizes of + * every chunk modified in the collective IO operation + * C. All processes collectively re-allocate each chunk + * from the gathered array with their new sizes after + * the filter operation + * D. Create an MPI derived type for memory and file to + * write out the process' selected chunks to the file + * 3. If the operation is a read operation + * A. Loop through each chunk in the operation + * I. + * 3. Proceeed with the collective IO operation + * 4. If the collective operation was a write operation, + * all processes collectively re-insert each modified + * chunk from the gathered array into the chunk index + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jordan Henderson + * Friday, Nov. 4th, 2016 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) +{ + H5D_filtered_collective_io_info_t *chunk_list = NULL; + H5D_filtered_collective_io_info_t *total_array = NULL; + H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode = H5D_MPIO_LINK_CHUNK; + H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CHUNK_COLLECTIVE; + H5D_chk_idx_info_t index_info; + H5S_sel_iter_t *mem_iter = NULL; + H5D_storage_t ctg_store; + MPI_Datatype mem_type; + MPI_Datatype file_type; + hbool_t mem_type_is_derived = FALSE; + hbool_t file_type_is_derived = FALSE; + hbool_t mem_iter_init = FALSE; + hsize_t mpi_buf_count; /* Number of MPI types */ + haddr_t *total_chunk_addr_array = NULL; + size_t chunk_list_num_entries; + size_t total_array_num_entries; + size_t *num_chunks_selected_array = NULL; + size_t i; + int mpi_rank, mpi_size, mpi_code; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + /* Obtain the current rank of the process and the number of processes */ + if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") + if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") + + /* Set the actual-chunk-opt-mode property. */ + if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") + + /* Set the actual-io-mode property. + * Link chunk I/O does not break to independent, so can set right away */ + if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") + + /* Construct chunked index info */ + index_info.f = io_info->dset->oloc.file; + index_info.dxpl_id = io_info->md_dxpl_id; + index_info.pline = &(io_info->dset->shared->dcpl_cache.pline); + index_info.layout = &(io_info->dset->shared->layout.u.chunk); + index_info.storage = &(io_info->dset->shared->layout.storage.u.chunk); + + /* Build a list of selected chunks in the collective io operation */ + /* XXX: Not sure about correct minor error code */ + if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries, &num_chunks_selected_array) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't construct filtered I/O info list") + + /* If this process has any selection at all in the dataspace, create + * a MPI type for the I/O operation. Otherwise, the process contributes + * with a none type. */ + /* XXX: Processes with no selection will have to be re-worked, as they + * still have to do the re-allocation in the file. Get rid of else case + * and instead change mpi_buf_count to 0 if they have no selection + */ + if (H5SL_count(fm->sel_chunks)) { +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Incoming messages from other processes:\n"); + HDfprintf(debug_file, "-----------------------------------------\n"); + for (size_t j = 0; j < chunk_list_num_entries; j++) { + HDfprintf(debug_file, "| Owner of chunk at address %a is expecting messages from %d other processes.\n", + chunk_list[j].old_chunk.offset, chunk_list[j].num_writers); + } + HDfprintf(debug_file, "-----------------------------------------\n\n"); +#endif + + if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") + + if (io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Processing chunks:\n"); + HDfprintf(debug_file, "---------------------------------------------------\n"); +#endif + + /* Iterate through all the chunks in the collective write operation, + * updating each chunk with the data modifications from other processes, + * then re-filtering the chunk. */ + for (i = 0; i < chunk_list_num_entries; i++) { + unsigned filter_mask = 0; + hbool_t full_overwrite = TRUE; + size_t buf_size; + hssize_t iter_nelmts; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Chunk at address %a:\n", chunk_list[i].old_chunk.offset); +#endif + + /* If this is a full overwrite of this chunk, enough memory must be allocated for + * the size of the unfiltered chunk. Otherwise, enough memory must be allocated + * to read the filtered chunk from the file. */ + /* XXX: Return value of macro should be checked instead */ + buf_size = (full_overwrite) ? (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_list[i].chunk_info.fspace) * type_info->src_type_size + : chunk_list[i].old_chunk.length; + chunk_list[i].new_chunk.length = buf_size; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Allocing %zd bytes for %s chunk overwrite buffer.\n", buf_size, + full_overwrite ? "full" : "non-full"); +#endif + + if (NULL == (chunk_list[i].buf = H5MM_malloc(buf_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification buffer") + + /* Initialize iterator for memory selection */ + if (H5S_select_iter_init(mem_iter, chunk_list[i].chunk_info.mspace, type_info->dst_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") + mem_iter_init = TRUE; + + /* Owner of this chunk, receive modification data from other processes */ + + if (!full_overwrite) { + /* Read the chunk from the file */ + if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_list[i].old_chunk.offset, + buf_size, H5AC_rawdata_dxpl_id, chunk_list[i].buf) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") + + /* Unfilter the chunk before modifying it */ + if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, + io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, + (size_t *) &chunk_list[i].new_chunk.length, &buf_size, &chunk_list[i].buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "couldn't unfilter chunk for modifying") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - After decompression: Nbytes=%zd; Buf_size=%zd.\n", chunk_list[i].new_chunk.length, buf_size); + + HDfprintf(debug_file, "| - Read buf:\n| - ["); + for (size_t j = 0; j < chunk_list[i].new_chunk.length / type_info->src_type_size; j++) { + if (j > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) chunk_list[i].buf)[j]); + } + HDfprintf(debug_file, "]\n|\n"); +#endif + } /* end if */ + + /* Update the chunk data with the modifications from the current (owning) process */ + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_list[i].chunk_info.mspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + + if (!H5D__gather_mem(io_info->u.wbuf, chunk_list[i].chunk_info.mspace, mem_iter, + (size_t) iter_nelmts, io_info->dxpl_cache, chunk_list[i].buf)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather from write buffer") + + /* Update the chunk data with any modifications from other processes */ + + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Write Buffer:\n"); + HDfprintf(debug_file, "| - ["); + for (size_t j = 0; j < chunk_list[i].new_chunk.length / type_info->src_type_size; j++) { + if (j > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) chunk_list[i].buf)[j]); + } + HDfprintf(debug_file, "]\n|\n"); + + HDfprintf(debug_file, "| - Write buf is at address %a.\n|\n", chunk_list[i].buf); + + HDfprintf(debug_file, "| - About to filter %zd bytes in buffer of size %zd.\n|\n", chunk_list[i].new_chunk.length, buf_size); +#endif + + /* Filter the chunk */ + if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, + io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, + (size_t *) &chunk_list[i].new_chunk.length, &buf_size, &chunk_list[i].buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") + +#if H5_SIZEOF_SIZE_T > 4 + /* Check for the chunk expanding too much to encode in a 32-bit value */ + if (chunk_list[i].new_chunk.length > ((size_t) 0xffffffff)) + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") +#endif + + if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + } /* end for */ + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "---------------------------------------------------\n\n"); +#endif + + /* Gather the new chunk sizes to all processes for a collective reallocation + * of the chunks in the file */ + if (H5D__mpio_array_gather(io_info, chunk_list, chunk_list_num_entries, sizeof(*chunk_list), + (void **) &total_array, &total_array_num_entries, NULL) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Reallocing chunks:\n"); + HDfprintf(debug_file, "------------------------------\n"); +#endif + + /* Collectively re-allocate the modified chunks (from each process) in the file */ + for (i = 0; i < total_array_num_entries; i++) { + hbool_t insert; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Reallocing chunk at address %a with new length of %zd.\n", total_array[i].new_chunk.offset, total_array[i].new_chunk.length); +#endif + + if (H5D__chunk_file_alloc(&index_info, &total_array[i].old_chunk, &total_array[i].new_chunk, + &insert, total_array[i].chunk_info.scaled) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Chunk now at address %a.\n|\n", total_array[i].new_chunk); +#endif + } /* end for */ + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "------------------------------\n\n"); +#endif + + /* XXX: During the collective re-allocation of chunks in the file, the record for each + * chunk is only update in the total array, not in the local copy of chunks on each + * process. However, each process needs the updated chunk records so that they can create + * a MPI type for the collective write that will write to the chunk's new locations instead + * of the old ones. This ugly hack seems to be the best solution to copy the information + * back to the local array and avoid having to modify the collective write type function + * in an ugly way so that it will accept the total array instead of the local array. + * This works correctly because the array gather function guarantees that the chunk + * data in the total array is ordered in blocks by rank. + */ + { + size_t offset; + + offset = 0; + for (i = 0; i < (size_t) mpi_rank; i++) + offset += num_chunks_selected_array[i] * sizeof(H5D_filtered_collective_io_info_t); + + HDmemcpy(chunk_list, &((char *) total_array)[offset], num_chunks_selected_array[mpi_rank] * sizeof(H5D_filtered_collective_io_info_t)); + } + + /* Create single MPI type encompassing each selection in the dataspace */ + if (H5D__mpio_filtered_collective_write_type(chunk_list, chunk_list_num_entries, + &mem_type, &mem_type_is_derived, &file_type, &file_type_is_derived) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't create MPI link chunk I/O type") + + /* Override the write buffer to point to the address of the first + * chunk data buffer */ + io_info->u.wbuf = chunk_list[0].buf; + } /* end if */ + else { /* Filtered collective read */ + + } /* end else */ + + /* We have a single, complicated MPI datatype for both memory & file */ + mpi_buf_count = (hsize_t) 1; + } + else { /* No selection at all for this process, contribute none type */ + size_t dataset_num_chunks; + + /* Retrieve total # of chunks in dataset */ + H5_CHECKED_ASSIGN(dataset_num_chunks, size_t, fm->layout->u.chunk.nchunks, hsize_t); + + /* Allocate chunking information */ + if (NULL == (total_chunk_addr_array = (haddr_t *) H5MM_malloc(sizeof(haddr_t) * dataset_num_chunks))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate total chunk address arraybuffer") + + /* Retrieve chunk address map */ + if (H5D__chunk_addrmap(io_info, total_chunk_addr_array) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") + + /* Get chunk with lowest address */ + ctg_store.contig.dset_addr = HADDR_MAX; + for (i = 0; i < dataset_num_chunks; i++) + if (total_chunk_addr_array[i] < ctg_store.contig.dset_addr) + ctg_store.contig.dset_addr = total_chunk_addr_array[i]; + HDassert(ctg_store.contig.dset_addr != HADDR_MAX); + + /* Set the MPI datatype */ + file_type = MPI_BYTE; + mem_type = MPI_BYTE; + + /* No chunks selected for this process */ + mpi_buf_count = (hsize_t) 0; + } /* end else */ + + /* Set up the base storage address for this operation */ + ctg_store.contig.dset_addr = 0; + io_info->store = &ctg_store; + + /* Perform I/O */ + if (H5D__final_collective_io(io_info, type_info, mpi_buf_count, &file_type, &mem_type) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") + + /* Collectively insert each chunk into the chunk index if this + * is a filtered collective write */ + if (io_info->op_type == H5D_IO_OP_WRITE) { + H5D_chunk_ud_t udata; + + /* Set up chunk information for insertion to chunk index */ + udata.common.layout = index_info.layout; + udata.common.storage = index_info.storage; + udata.filter_mask = 0; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Reinserting chunks into chunk index.\n"); + HDfprintf(debug_file, "---------------------------------------\n"); +#endif + + for (i = 0; i < total_array_num_entries; i++) { + udata.chunk_block = total_array[i].new_chunk; + udata.common.scaled = total_array[i].chunk_info.scaled; + + if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Successfully inserted chunk at address %a into the chunk index.\n", udata.chunk_block.offset); +#endif + } /* end for */ + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "---------------------------------------\n"); +#endif + } /* end if */ + +done: + /* Free resources used by a process which had no selection at all */ + if (total_chunk_addr_array) + H5MM_free(total_chunk_addr_array); + + /* Free resources used by a process which had some selection */ + if (chunk_list) { + for (i = 0; i < chunk_list_num_entries; i++) + if (chunk_list[i].buf) + H5MM_free(chunk_list[i].buf); + + H5MM_free(chunk_list); + } + + if (num_chunks_selected_array) + H5MM_free(num_chunks_selected_array); + if (total_array) + H5MM_free(total_array); + if (mem_iter) + H5MM_free(mem_iter); + + /* Free the MPI buf and file types, if they were derived */ + if (mem_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + if (file_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__link_chunk_filtered_collective_io() */ + + +/*------------------------------------------------------------------------- * Function: H5D__multi_chunk_collective_io * * Purpose: To do IO per chunk according to IO mode(collective/independent/none) @@ -1308,6 +1861,543 @@ done: /*------------------------------------------------------------------------- + * Function: H5D__multi_chunk_filtered_collective_io + * + * Purpose: To do filtered collective IO per chunk to save on memory, + * as opposed to collective IO of every chunk at once + * + * XXX: Add read operation description + * + * 1. Construct a list of selected chunks in the collective IO + * operation + * A. If any chunk is being written to by more than 1 + * process, the process writing the most data to the + * chunk will take ownership of the chunk (ties are + * broken randomly) + * 2. Loop through each chunk in the operation + * A. If the operation is a write operation + * I. Determine if this is a full overwrite of the chunk + * a) If it is not, read the chunk from file and + * pass the chunk through the filter pipeline in + * reverse order (Unfilter the chunk) + * b) Else copy the owning process' modification + * data into a buffer of size large enough to + * completely overwrite the chunk + * II. Receive any modification data from other + * processes and update the chunk data with these + * modifications + * III. Filter the chunk + * IV. Contribute the chunk to an array gathered by + * all processes which contains every chunk + * modified in this iteration (up to one chunk + * per process, some processes may not have a + * selection/may have less chunks to work on than + * other processes) + * II. All processes collectively re-allocate each + * chunk from the gathered array with their new + * sizes after the filter operation + * IV. Proceed with the collective write operation + * V. All processes collectively re-insert each + * chunk from the gathered array into the chunk + * index + * B. If the operation is a read operation + * I. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jordan Henderson + * Friday, Dec. 2nd, 2016 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) +{ + H5D_filtered_collective_io_info_t *chunk_list = NULL; + H5D_filtered_collective_io_info_t *gathered_array = NULL; + H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode = H5D_MPIO_MULTI_CHUNK; /* actual chunk optimization mode */ + H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_NO_COLLECTIVE; /* Local variable for tracking the I/O mode used. */ + H5FD_mpio_collective_opt_t last_coll_opt_mode = H5FD_MPIO_COLLECTIVE_IO; /* Last parallel transfer with independent IO or collective IO with this mode */ + H5FD_mpio_xfer_t last_xfer_mode = H5FD_MPIO_COLLECTIVE; /* Last parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */ + H5D_chk_idx_info_t index_info; + H5S_sel_iter_t *mem_iter = NULL; + H5D_storage_t store; /* union of EFL and chunk pointer in file space */ + H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ + H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ + MPI_Datatype file_type; + MPI_Datatype mem_type; + uint8_t *chunk_io_option = NULL; + haddr_t *chunk_addr = NULL; + hbool_t file_type_is_derived = FALSE; + hbool_t mem_type_is_derived = FALSE; + hbool_t mem_iter_init = FALSE; + hsize_t mpi_buf_count; + size_t total_chunk; /* Total # of chunks in dataset */ + size_t chunk_list_num_entries; + size_t gathered_array_num_entries; + size_t *num_chunks_selected_array = NULL; + size_t i, j; /* Local index variable */ + int mpi_rank, mpi_size, mpi_code; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + /* Obtain the current rank of the process and the number of processes */ + if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") + if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") + + /* Set the actual chunk opt mode property */ + if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") + + /* Construct chunked index info */ + index_info.f = io_info->dset->oloc.file; + index_info.dxpl_id = io_info->md_dxpl_id; + index_info.pline = &(io_info->dset->shared->dcpl_cache.pline); + index_info.layout = &(io_info->dset->shared->layout.u.chunk); + index_info.storage = &(io_info->dset->shared->layout.storage.u.chunk); + + + /* Build a list of selected chunks in the collective IO operation */ + if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries, &num_chunks_selected_array) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't construct filtered I/O info list") + + /* Allocate memories */ + /* chunk_io_option = (uint8_t *) H5MM_calloc(total_chunk); + chunk_addr = (haddr_t *) H5MM_calloc(total_chunk * sizeof(haddr_t)); */ +#ifdef H5D_DEBUG +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D), "total_chunk %Zu\n", total_chunk); +#endif + + /* Obtain IO option for each chunk */ + /* if (H5D__obtain_mpio_mode(io_info, fm, dx_plist, chunk_io_option, chunk_addr) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "unable to obtain MPIO mode") */ + + /* Set up contiguous I/O info object */ + HDmemcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); + ctg_io_info.store = &ctg_store; + ctg_io_info.layout_ops = *H5D_LOPS_CONTIG; + + /* Initialize temporary contiguous storage info */ + ctg_store.contig.dset_size = (hsize_t) io_info->dset->shared->layout.u.chunk.size; + + /* Set dataset storage for I/O info */ + io_info->store = &store; + + if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") + + /* Loop over all the chunks in the collective IO operation */ + /* XXX: Multi-chunk needs to loop over all chunks and check for write/read inside + * loop, not the other way around */ + if (io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ + H5D_chunk_ud_t udata; + + /* Set up chunk information for insertion to chunk index */ + udata.common.layout = index_info.layout; + udata.common.storage = index_info.storage; + udata.filter_mask = 0; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Incoming messages from other processes:\n"); + HDfprintf(debug_file, "-----------------------------------------\n"); + for (size_t k = 0; k < chunk_list_num_entries; k++) { + HDfprintf(debug_file, "| Owner of chunk at address %a is expecting messages from %d other processes.\n", + chunk_list[k].old_chunk.offset, chunk_list[k].num_writers); + } + HDfprintf(debug_file, "-----------------------------------------\n\n"); + + HDfprintf(debug_file, "Processing chunks:\n"); + HDfprintf(debug_file, "---------------------------------------------------\n"); +#endif + + for (i = 0; i < chunk_list_num_entries; i++) { + unsigned filter_mask = 0; + hbool_t full_overwrite = TRUE; + size_t buf_size; + hssize_t iter_nelmts; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Chunk at address %a:\n", chunk_list[i].old_chunk.offset); +#endif + + /* XXX: Determine if a chunk is being fully overwritten by looking at the total selection + * in the dataspace */ + + /* If this is a full overwrite of this chunk, enough memory must be allocated for + * the size of the unfiltered chunk. Otherwise, enough memory must be allocated + * to read the filtered chunk from the file. */ + /* XXX: Return value of macro should be checked instead */ + buf_size = (full_overwrite) ? (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_list[i].chunk_info.fspace) * type_info->src_type_size + : chunk_list[i].old_chunk.length; + chunk_list[i].new_chunk.length = buf_size; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Allocing %zd bytes for %s chunk overwrite buffer.\n", buf_size, + full_overwrite ? "full" : "non-full"); +#endif + + if (NULL == (chunk_list[i].buf = H5MM_malloc(buf_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification buffer") + + /* Initialize iterator for memory selection */ + if (H5S_select_iter_init(mem_iter, chunk_list[i].chunk_info.mspace, type_info->dst_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") + mem_iter_init = TRUE; + + /* Owner of this chunk, receive modification data from other processes */ + + if (!full_overwrite) { + /* Read the chunk from the file */ + if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_list[i].old_chunk.offset, + buf_size, H5AC_rawdata_dxpl_id, chunk_list[i].buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't read raw data chunk") + + /* Unfilter the chunk before modifying it */ + if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, + io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, + (size_t *) &chunk_list[i].new_chunk.length, &buf_size, &chunk_list[i].buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "couldn't unfilter chunk for modifying") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - After decompression: Nbytes=%zd; Buf_size=%zd.\n", chunk_list[i].new_chunk.length, buf_size); + + HDfprintf(debug_file, "| - Read buf:\n| - ["); + for (size_t k = 0; k < chunk_list[i].new_chunk.length / type_info->src_type_size; k++) { + if (k > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) chunk_list[i].buf)[k]); + } + HDfprintf(debug_file, "]\n|\n"); +#endif + } /* end if */ + + /* Update the chunk data with the modifications from the current (owning) process */ + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_list[i].chunk_info.mspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + + if (!H5D__gather_mem(io_info->u.wbuf, chunk_list[i].chunk_info.mspace, mem_iter, + (size_t) iter_nelmts, io_info->dxpl_cache, chunk_list[i].buf)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather from write buffer") + + /* Update the chunk data with any modifications from other processes */ + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Write Buffer:\n"); + HDfprintf(debug_file, "| - ["); + for (size_t k = 0; k < chunk_list[i].new_chunk.length / type_info->src_type_size; k++) { + if (k > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) chunk_list[i].buf)[k]); + } + HDfprintf(debug_file, "]\n|\n"); + + HDfprintf(debug_file, "| - Write buf is at address %a.\n|\n", chunk_list[i].buf); + + HDfprintf(debug_file, "| - About to filter %zd bytes in buffer of size %zd.\n|\n", chunk_list[i].new_chunk.length, buf_size); +#endif + + /* Filter the chunk */ + if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, + io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, + (size_t *) &chunk_list[i].new_chunk.length, &buf_size, &chunk_list[i].buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") + +#if H5_SIZEOF_SIZE_T > 4 + /* Check for the chunk expanding too much to encode in a 32-bit value */ + if (chunk_list[i].new_chunk.length > ((size_t) 0xffffffff)) + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") +#endif + + /* Gather the new chunk sizes to all processes for a collective reallocation + * of the chunks in the file */ + if (H5D__mpio_array_gather(io_info, &chunk_list[i], 1, sizeof(*chunk_list), + (void **) &gathered_array, &gathered_array_num_entries, NULL) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Reallocing chunks:\n"); + HDfprintf(debug_file, "------------------------------\n"); +#endif + + /* Collectively re-allocate the modified chunks (from each process) in the file */ + for (j = 0; j < gathered_array_num_entries; j++) { + hbool_t insert = FALSE; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Re-allocing chunk at address %a with new length of %llu bytes.\n", + gathered_array[j].new_chunk.offset, gathered_array[j].new_chunk.length); +#endif + + /* Collectively re-allocate the chunk in the file */ + if (H5D__chunk_file_alloc(&index_info, &gathered_array[j].old_chunk, &gathered_array[j].new_chunk, + &insert, chunk_list[j].chunk_info.scaled) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Chunk now at address %a.\n|\n", gathered_array[j].new_chunk); +#endif + } /* end for */ + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "------------------------------\n\n"); +#endif + + /* Collect the new chunk info back to the local copy */ + /* XXX: This may encounter a problem if there is a process with no selection */ + HDmemcpy(&chunk_list[i].new_chunk, &gathered_array[mpi_rank].new_chunk, sizeof(chunk_list[i].new_chunk)); + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "New chunk record after memcpy back to local:\n"); + HDfprintf(debug_file, " - Chunk offset: %a, Chunk length: %lld\n", chunk_list[i].new_chunk.offset, chunk_list[i].new_chunk.length); +#endif + + { + int count; + + H5_CHECKED_ASSIGN(count, int, chunk_list[i].new_chunk.length, hsize_t); + + /* Create MPI memory type for writing to chunk */ + if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(count, MPI_BYTE, &mem_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&mem_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + mem_type_is_derived = TRUE; + + /* Create MPI file type for writing to chunk */ + if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(count, MPI_BYTE, &file_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&file_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + file_type_is_derived = TRUE; + + mpi_buf_count = 1; + } + + + /* Set up the base storage address for this operation */ + ctg_store.contig.dset_addr = chunk_list[i].new_chunk.offset; + + /* Override the write buffer to point to the address of the + * chunk data buffer */ + ctg_io_info.u.wbuf = chunk_list[i].buf; + + /* Perform the I/O */ + if (H5D__final_collective_io(&ctg_io_info, type_info, mpi_buf_count, &file_type, &mem_type) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Reinserting chunks into chunk index.\n"); + HDfprintf(debug_file, "---------------------------------------\n"); +#endif + + /* Re-insert the modified chunks (from each process) into the chunk index */ + for (j = 0; j < gathered_array_num_entries; j++) { + udata.chunk_block = gathered_array[j].new_chunk; + udata.common.scaled = gathered_array[j].chunk_info.scaled; + + if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Successfully inserted chunk at address %a into the chunk index.\n", udata.chunk_block.offset); +#endif + } /* end for */ + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "---------------------------------------\n"); +#endif + + /* Free the MPI memory and file type, if they were derived */ + /* XXX: For performance, collect each type into an array and free at end */ + if (mem_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + if (file_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + + mem_type_is_derived = FALSE; + file_type_is_derived = FALSE; + + if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + + if (gathered_array) + gathered_array = (H5D_filtered_collective_io_info_t *) H5MM_free(gathered_array); + } /* end for */ + } /* end if */ + else { /* Filtered collective read */ + unsigned filter_mask = 0; + size_t buf_size; + + for (i = 0; i < chunk_list_num_entries; i++) { + buf_size = chunk_list[i].old_chunk.length; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Allocing %zd bytes for chunk read buffer.\n", buf_size); +#endif + + if (NULL == (chunk_list[i].buf = H5MM_malloc(buf_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk read buffer") + + /* Read the chunk from the file */ + if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_list[i].old_chunk.offset, + buf_size, H5AC_rawdata_dxpl_id, chunk_list[i].buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't read raw data chunk") + + /* Unfilter the chunk before modifying it */ + if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, + io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, + (size_t *) &chunk_list[i].old_chunk.length, &buf_size, &chunk_list[i].buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "couldn't unfilter chunk for modifying") + +#ifdef PARALLEL_COMPRESS_DEBUG + for (size_t k = 0; k < chunk_list[i].old_chunk.length / type_info->src_type_size; k++) + HDfprintf(debug_file, "Read buf entry %d is %lld.\n", k, ((long *) chunk_list[i].buf)[k]); +#endif + + /* Scatter the unfiltered chunk data into the user's read buffer */ + + } /* end for */ + } /* end else */ + +#if 0 + /* Loop over _all_ the chunks */ + for (u = 0; u < total_chunk; u++) { + H5D_chunk_info_t *chunk_info; /* Chunk info for current chunk */ + H5S_t *fspace; /* Dataspace describing chunk & selection in it */ + H5S_t *mspace; /* Dataspace describing selection in memory corresponding to this chunk */ + hbool_t insert = FALSE; + + /* Initialize temporary contiguous storage address */ + ctg_store.contig.dset_addr = chunk_addr[u]; + +#ifdef H5D_DEBUG +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D),"mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u); +#endif + /* Get the chunk info for this chunk, if there are elements selected */ + chunk_info = &filtered_io_info_array[u].chunk_info; + + /* Set the storage information for chunks with selections */ + if (chunk_info) { + /* HDassert(chunk_info->index == u); */ + + /* Pass in chunk's coordinates in a union. */ + store.chunk.scaled = chunk_info->scaled; + } /* end if */ + + /* Collective IO for this chunk, + * Note: even there is no selection for this process, the process still + * needs to contribute MPI NONE TYPE. + */ + if (chunk_io_option[u] == H5D_CHUNK_IO_MODE_COL) { +#ifdef H5D_DEBUG +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D),"inside collective chunk IO mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u); +#endif + + /* Set the file & memory dataspaces */ + if (chunk_info) { + fspace = chunk_info->fspace; + mspace = chunk_info->mspace; + + /* Update the local variable tracking the dxpl's actual io mode property. + * + * Note: H5D_MPIO_COLLECTIVE_MULTI | H5D_MPIO_INDEPENDENT = H5D_MPIO_MIXED + * to ease switching between to mixed I/O without checking the current + * value of the property. You can see the definition in H5Ppublic.h + */ + actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_COLLECTIVE; + + } /* end if */ + else { + fspace = mspace = NULL; + } /* end else */ + + /* Switch back to collective I/O */ + if (last_xfer_mode != H5FD_MPIO_COLLECTIVE) { + if (H5D__ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to collective I/O") + last_xfer_mode = H5FD_MPIO_COLLECTIVE; + } /* end if */ + if (last_coll_opt_mode != H5FD_MPIO_COLLECTIVE_IO) { + if (H5D__ioinfo_coll_opt_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE_IO) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to collective I/O") + last_coll_opt_mode = H5FD_MPIO_COLLECTIVE_IO; + } /* end if */ + } /* end if */ + else { /* possible independent IO for this chunk */ +#ifdef H5D_DEBUG +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D),"inside independent IO mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u); +#endif + + HDassert(chunk_io_option[u] == 0); + + /* Set the file & memory dataspaces */ + if (chunk_info) { + fspace = chunk_info->fspace; + mspace = chunk_info->mspace; + + /* Update the local variable tracking the dxpl's actual io mode. */ + actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_INDEPENDENT; + } /* end if */ + else { + fspace = mspace = NULL; + } /* end else */ + + /* Using independent I/O with file setview.*/ + if (last_coll_opt_mode != H5FD_MPIO_INDIVIDUAL_IO) { + if (H5D__ioinfo_coll_opt_mode(io_info, dx_plist, H5FD_MPIO_INDIVIDUAL_IO) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to individual I/O") + last_coll_opt_mode = H5FD_MPIO_INDIVIDUAL_IO; + } /* end if */ + } /* end else */ + +#ifdef H5D_DEBUG + if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D),"after inter collective IO\n"); +#endif + } /* end for */ +#endif + + /* Write the local value of actual io mode to the DXPL. */ + if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") + +done: + if (chunk_io_option) + H5MM_free(chunk_io_option); + if (chunk_addr) + H5MM_free(chunk_addr); + + if (mem_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + if (file_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + + if (chunk_list) { + for (i = 0; i < chunk_list_num_entries; i++) + if (chunk_list[i].buf) + H5MM_free(chunk_list[i].buf); + + H5MM_free(chunk_list); + } + + if (num_chunks_selected_array) + H5MM_free(num_chunks_selected_array); + if (gathered_array) + H5MM_free(gathered_array); + if (mem_iter) + H5MM_free(mem_iter); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__multi_chunk_filtered_collective_io() */ + + +/*------------------------------------------------------------------------- * Function: H5D__inter_collective_io * * Purpose: Routine for the shared part of collective IO between multiple chunk @@ -1486,6 +2576,36 @@ H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2) /*------------------------------------------------------------------------- + * Function: H5D__cmp_filtered_collective_io_entry + * + * Purpose: Routine to compare filtered collective chunk io info + * entries + * + * Description: Callback for qsort() to compare filtered collective chunk + * io info entries + * + * Return: -1, 0, 1 + * + * Programmer: Jordan Henderson + * Wednesday, Nov. 30th, 2016 + * + *------------------------------------------------------------------------- + */ +static int +H5D__cmp_filtered_collective_io_entry(const void *filtered_collective_io_entry1, const void *filtered_collective_io_entry2) +{ + haddr_t addr1, addr2; + + FUNC_ENTER_STATIC_NOERR + + addr1 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_entry1)->new_chunk.offset; + addr2 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_entry2)->new_chunk.offset; + + FUNC_LEAVE_NOAPI(H5F_addr_cmp(addr1, addr2)) +} /* end H5D__cmp_filtered_collective_io_entry() */ + + +/*------------------------------------------------------------------------- * Function: H5D__sort_chunk * * Purpose: Routine to sort chunks in increasing order of chunk address @@ -1837,5 +2957,249 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__obtain_mpio_mode() */ + + +/*------------------------------------------------------------------------- + * Function: H5D__construct_filtered_io_info_list + * + * XXX: Revise description + * Purpose: Constructs a list of entries which contain the necessary + * information for inter-process communication when performing + * collective io on filtered chunks. This list is used by + * every process in operations that must be collectively done + * on every chunk, such as chunk re-allocation, insertion of + * chunks into the chunk index, etc. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jordan Henderson + * Tuesday, January 10th, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + const H5D_chunk_map_t *fm, H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries, + size_t **_num_chunks_selected_array) +{ + H5D_filtered_collective_io_info_t *local_info_array = NULL; + H5SL_node_t *chunk_node; + hbool_t no_overlap = FALSE; + size_t i; + size_t num_chunks_selected; + size_t *num_chunks_selected_array = NULL; + int mpi_rank, mpi_size, mpi_code; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + HDassert(io_info); + HDassert(type_info); + HDassert(fm); + HDassert(chunk_list); + + if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") + if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") + + /* Get the no overlap property */ + + + num_chunks_selected = H5SL_count(fm->sel_chunks); + + if (!no_overlap) { + /* Redistribute chunks so that no more than 1 process is writing to a given chunk */ + } + + if (NULL == (local_info_array = (H5D_filtered_collective_io_info_t *) H5MM_malloc(num_chunks_selected * sizeof(*local_info_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate local io info array buffer") + + chunk_node = H5SL_first(fm->sel_chunks); + for (i = 0; chunk_node; i++) { + H5D_chunk_info_t *chunk_info = (H5D_chunk_info_t *) H5SL_item(chunk_node); + H5D_chunk_ud_t udata; + + /* Obtain this chunk's address */ + if (H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") + +#ifdef PARALLEL_COMPRESS_DEBUG + local_info_array[i].owner = mpi_rank; + local_info_array[i].num_writers = 0; +#endif + + local_info_array[i].old_chunk = local_info_array[i].new_chunk = udata.chunk_block; + local_info_array[i].chunk_info = *chunk_info; + local_info_array[i].buf = NULL; + + chunk_node = H5SL_next(chunk_node); + } /* end for */ + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, " Contents of local info array\n"); + HDfprintf(debug_file, "------------------------------\n"); + for (size_t j = 0; j < (size_t) num_chunks_selected; j++) { + HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); + HDfprintf(debug_file, "| - Chunk Address: %a\n", local_info_array[j].old_chunk.offset); + HDfprintf(debug_file, "| - Chunk Length: %zd\n", local_info_array[j].old_chunk.length); + HDfprintf(debug_file, "| - Chunk Owner: %d\n", local_info_array[j].owner); + HDfprintf(debug_file, "| - Address of mspace: %x\n", local_info_array[j].chunk_info.mspace); + HDfprintf(debug_file, "| - Chunk Selection Type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.mspace)); + HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); + } + HDfprintf(debug_file, "------------------------------\n\n"); +#endif + + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Testing mem/file space addresses:\n"); + HDfprintf(debug_file, "-----------------------------------\n"); + + for (size_t j = 0; j < num_chunks_selected; j++) { + HDfprintf(debug_file, "| Testing chunk at address %a.\n", local_info_array[j].old_chunk.offset); + HDfprintf(debug_file, "| Mem Space:\n"); + HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(local_info_array[j].chunk_info.mspace)); + HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(local_info_array[j].chunk_info.mspace)); + HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); + HDfprintf(debug_file, "| - Selection type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.mspace)); + HDfprintf(debug_file, "| File Space:\n"); + HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(local_info_array[j].chunk_info.fspace)); + HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(local_info_array[j].chunk_info.fspace)); + HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.fspace)); + HDfprintf(debug_file, "| - Selection type: %d\n|\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.fspace)); + } + + HDfprintf(debug_file, "-----------------------------------\n\n"); +#endif + + /* Gather the number of chunks each process is writing to all processes */ + if (NULL == (num_chunks_selected_array = (size_t *) H5MM_malloc((size_t) mpi_size * sizeof(*num_chunks_selected_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate num chunks selected array") + + if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&num_chunks_selected, 1, MPI_UNSIGNED_LONG_LONG, num_chunks_selected_array, 1, MPI_UNSIGNED_LONG_LONG, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Allgather of num chunks selected array failed", mpi_code) + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, " Num Chunks Selected Array\n"); + HDfprintf(debug_file, "------------------------------------\n"); + for (size_t j = 0; j < (size_t) mpi_size; j++) { + HDfprintf(debug_file, "| Process %d has %zd chunks selected.\n", j, num_chunks_selected_array[j]); + } + HDfprintf(debug_file, "------------------------------------\n\n"); +#endif + + *chunk_list = local_info_array; + *num_entries = num_chunks_selected; + *_num_chunks_selected_array = num_chunks_selected_array; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__construct_filtered_io_info_list() */ + + +/*------------------------------------------------------------------------- + * Function: H5D__mpio_filtered_collective_write_type + * + * Purpose: Constructs a MPI derived datatype for both the memory and + * the file for a collective write of filtered chunks. The + * datatype contains the offsets in the file and the locations + * of the filtered chunk data buffers + * + * XXX: Same type may be reusable for filtered collective read + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jordan Henderson + * Tuesday, November 22, 2016 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chunk_list, + size_t num_entries, MPI_Datatype *new_mem_type, hbool_t *mem_type_created, + MPI_Datatype *new_file_type, hbool_t *file_type_created) +{ + MPI_Aint *write_buf_array = NULL; /* Relative displacements of filtered chunk data buffers */ + MPI_Aint *file_offset_array = NULL; /* Chunk offsets in the file */ + int *length_array = NULL; /* Filtered Chunk lengths */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + HDassert(chunk_list); + HDassert(new_mem_type); + HDassert(mem_type_created); + HDassert(new_file_type); + HDassert(file_type_created); + + if (num_entries > 0) { + size_t i; + int mpi_code; + void *base_buf; + + H5_CHECK_OVERFLOW(num_entries, size_t, int); + + /* Allocate arrays */ + if (NULL == (length_array = (int *) H5MM_malloc((size_t) num_entries * sizeof(int)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for filtered collective write length array") + if (NULL == (write_buf_array = (MPI_Aint *) H5MM_malloc((size_t) num_entries * sizeof(MPI_Aint)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for filtered collective write buf length array") + if (NULL == (file_offset_array = (MPI_Aint *) H5MM_malloc((size_t) num_entries * sizeof(MPI_Aint)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective write offset array") + + /* Ensure the list is sorted in ascending order of offset in the file */ + HDqsort(chunk_list, num_entries, sizeof(*chunk_list), H5D__cmp_filtered_collective_io_entry); + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "MPI Write type entries:\n"); + HDfprintf(debug_file, "---------------------------------\n"); +#endif + + base_buf = chunk_list[0].buf; + for (i = 0; i < num_entries; i++) { + /* XXX: Revise description */ + /* Set up array position */ + file_offset_array[i] = (MPI_Aint) chunk_list[i].new_chunk.offset; + length_array[i] = (int) chunk_list[i].new_chunk.length; + write_buf_array[i] = (MPI_Aint) chunk_list[i].buf - (MPI_Aint) base_buf; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Type Entry %zd:\n", i); + HDfprintf(debug_file, "| - Offset: %a; Length: %zd\n", file_offset_array[i], length_array[i]); + HDfprintf(debug_file, "| - Write buffer:\n| ["); + for (size_t j = 0; j < (size_t) length_array[i]; j++) { + HDfprintf(debug_file, "%c, ", ((char *) chunk_list[i].buf)[j]); + } + HDfprintf(debug_file, "]\n|\n"); +#endif + } /* end while */ + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "---------------------------------\n\n"); +#endif + + /* Create memory MPI type */ + if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int) num_entries, length_array, write_buf_array, MPI_BYTE, new_mem_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) + *mem_type_created = TRUE; + if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_mem_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + + /* Create file MPI type */ + if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int) num_entries, length_array, file_offset_array, MPI_BYTE, new_file_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) + *file_type_created = TRUE; + if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_file_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + } /* end if */ + +done: + length_array = (int *) H5MM_free(length_array); + write_buf_array = (MPI_Aint *) H5MM_free(write_buf_array); + file_offset_array = (MPI_Aint *) H5MM_free(file_offset_array); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__mpio_filtered_collective_write_type() */ #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index f54a9f2..bd58d38 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -618,6 +618,9 @@ H5_DLL herr_t H5D__select_write(const H5D_io_info_t *io_info, H5_DLL herr_t H5D__scatter_mem(const void *_tscat_buf, const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, const H5D_dxpl_cache_t *dxpl_cache, void *_buf); +H5_DLL size_t H5D__gather_mem(const void *_buf, + const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, + const H5D_dxpl_cache_t *dxpl_cache, void *_tgath_buf/*out*/); H5_DLL herr_t H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); @@ -667,6 +670,8 @@ H5_DLL herr_t H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *scaled, H5D_chunk_ud_t *udata); H5_DLL herr_t H5D__chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes); H5_DLL herr_t H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]); +H5_DLL herr_t H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old_chunk, + H5F_block_t *new_chunk, hbool_t *need_insert, hsize_t scaled[]); H5_DLL herr_t H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[]); H5_DLL herr_t H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 55111f0..929feb7 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -49,9 +49,6 @@ static herr_t H5D__scatter_file(const H5D_io_info_t *io_info, static size_t H5D__gather_file(const H5D_io_info_t *io_info, const H5S_t *file_space, H5S_sel_iter_t *file_iter, size_t nelmts, void *buf); -static size_t H5D__gather_mem(const void *_buf, - const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, - const H5D_dxpl_cache_t *dxpl_cache, void *_tgath_buf/*out*/); static herr_t H5D__compound_opt_read(size_t nelmts, const H5S_t *mem_space, H5S_sel_iter_t *iter, const H5D_dxpl_cache_t *dxpl_cache, const H5D_type_info_t *type_info, void *user_buf/*out*/); @@ -305,6 +302,7 @@ H5D__scatter_mem (const void *_tscat_buf, const H5S_t *space, HDassert(space); HDassert(iter); HDassert(nelmts > 0); + HDassert(dxpl_cache); HDassert(buf); /* Allocate the vector I/O arrays */ @@ -366,7 +364,7 @@ done: * *------------------------------------------------------------------------- */ -static size_t +size_t H5D__gather_mem(const void *_buf, const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, const H5D_dxpl_cache_t *dxpl_cache, void *_tgath_buf/*out*/) @@ -389,6 +387,7 @@ H5D__gather_mem(const void *_buf, const H5S_t *space, HDassert(space); HDassert(iter); HDassert(nelmts > 0); + HDassert(dxpl_cache); HDassert(tgath_buf); /* Allocate the vector I/O arrays */ -- cgit v0.12 From 2292a8520df0738826e22e2e097495761f3e5d28 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 13 Jan 2017 14:21:59 -0600 Subject: Eliminate owner field Work on redistributing shared chunks --- src/H5Dmpio.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index cfcc5c4..6ae4ef8 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -106,7 +106,6 @@ typedef struct H5D_filtered_collective_io_info_t { H5F_block_t old_chunk; H5F_block_t new_chunk; int num_writers; - int owner; void *buf; } H5D_filtered_collective_io_info_t; @@ -413,7 +412,6 @@ H5D__mpio_array_gather(H5D_io_info_t *io_info, void *local_array, HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); HDfprintf(debug_file, "| - Chunk Address: %a\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].old_chunk.offset); HDfprintf(debug_file, "| - Chunk Length: %zd\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].old_chunk.length); - HDfprintf(debug_file, "| - Chunk Owner: %d\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].owner); HDfprintf(debug_file, "| - Address of mspace: %x\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].chunk_info.mspace); } HDfprintf(debug_file, "------------------------------\n\n"); @@ -2985,7 +2983,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ H5D_filtered_collective_io_info_t *local_info_array = NULL; H5SL_node_t *chunk_node; hbool_t no_overlap = FALSE; - size_t i; size_t num_chunks_selected; size_t *num_chunks_selected_array = NULL; int mpi_rank, mpi_size, mpi_code; @@ -3006,17 +3003,17 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Get the no overlap property */ - num_chunks_selected = H5SL_count(fm->sel_chunks); - + /* Redistribute chunks to new owners as necessary */ if (!no_overlap) { - /* Redistribute chunks so that no more than 1 process is writing to a given chunk */ + } - if (NULL == (local_info_array = (H5D_filtered_collective_io_info_t *) H5MM_malloc(num_chunks_selected * sizeof(*local_info_array)))) + if (NULL == (local_info_array = (H5D_filtered_collective_io_info_t *) H5MM_malloc(H5SL_count(fm->sel_chunks) * sizeof(*local_info_array)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate local io info array buffer") + num_chunks_selected = 0; chunk_node = H5SL_first(fm->sel_chunks); - for (i = 0; chunk_node; i++) { + while (chunk_node) { H5D_chunk_info_t *chunk_info = (H5D_chunk_info_t *) H5SL_item(chunk_node); H5D_chunk_ud_t udata; @@ -3025,16 +3022,16 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") #ifdef PARALLEL_COMPRESS_DEBUG - local_info_array[i].owner = mpi_rank; - local_info_array[i].num_writers = 0; + local_info_array[num_chunks_selected].num_writers = 0; #endif - local_info_array[i].old_chunk = local_info_array[i].new_chunk = udata.chunk_block; - local_info_array[i].chunk_info = *chunk_info; - local_info_array[i].buf = NULL; + local_info_array[num_chunks_selected].old_chunk = local_info_array[num_chunks_selected].new_chunk = udata.chunk_block; + local_info_array[num_chunks_selected].chunk_info = *chunk_info; + local_info_array[num_chunks_selected].buf = NULL; + num_chunks_selected++; chunk_node = H5SL_next(chunk_node); - } /* end for */ + } /* end while */ #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, " Contents of local info array\n"); @@ -3043,7 +3040,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); HDfprintf(debug_file, "| - Chunk Address: %a\n", local_info_array[j].old_chunk.offset); HDfprintf(debug_file, "| - Chunk Length: %zd\n", local_info_array[j].old_chunk.length); - HDfprintf(debug_file, "| - Chunk Owner: %d\n", local_info_array[j].owner); HDfprintf(debug_file, "| - Address of mspace: %x\n", local_info_array[j].chunk_info.mspace); HDfprintf(debug_file, "| - Chunk Selection Type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.mspace)); HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); -- cgit v0.12 From 349b3634f73954eb17fd8f2ee730e43606959467 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Tue, 17 Jan 2017 14:39:41 -0600 Subject: Add chunk redistribution for shared chunks Remove check for process having a selection as this needs to be reworked --- src/H5Dmpio.c | 438 +++++++++++++++++++++++++++++++++------------------------- 1 file changed, 248 insertions(+), 190 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 6ae4ef8..49f25ae 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -105,7 +105,9 @@ typedef struct H5D_filtered_collective_io_info_t { H5D_chunk_info_t chunk_info; H5F_block_t old_chunk; H5F_block_t new_chunk; - int num_writers; + size_t io_size; + size_t num_writers; + int owner; void *buf; } H5D_filtered_collective_io_info_t; @@ -424,7 +426,7 @@ done: H5MM_free(displacements_array); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__filtered_collective_io_info_arraygather() */ +} /* end H5D__mpio_array_gather() */ /*------------------------------------------------------------------------- @@ -1302,8 +1304,8 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in H5D_chk_idx_info_t index_info; H5S_sel_iter_t *mem_iter = NULL; H5D_storage_t ctg_store; - MPI_Datatype mem_type; - MPI_Datatype file_type; + MPI_Datatype mem_type = MPI_BYTE; + MPI_Datatype file_type = MPI_BYTE; hbool_t mem_type_is_derived = FALSE; hbool_t file_type_is_derived = FALSE; hbool_t mem_iter_init = FALSE; @@ -1352,228 +1354,208 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in * still have to do the re-allocation in the file. Get rid of else case * and instead change mpi_buf_count to 0 if they have no selection */ - if (H5SL_count(fm->sel_chunks)) { #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Incoming messages from other processes:\n"); - HDfprintf(debug_file, "-----------------------------------------\n"); - for (size_t j = 0; j < chunk_list_num_entries; j++) { - HDfprintf(debug_file, "| Owner of chunk at address %a is expecting messages from %d other processes.\n", - chunk_list[j].old_chunk.offset, chunk_list[j].num_writers); - } - HDfprintf(debug_file, "-----------------------------------------\n\n"); + HDfprintf(debug_file, "Incoming messages from other processes:\n"); + HDfprintf(debug_file, "-----------------------------------------\n"); + for (size_t j = 0; j < chunk_list_num_entries; j++) { + HDfprintf(debug_file, "| Owner of chunk at address %a is expecting messages from %d other processes.\n", + chunk_list[j].old_chunk.offset, chunk_list[j].num_writers - 1); + } + HDfprintf(debug_file, "-----------------------------------------\n\n"); #endif - if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") + if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") - if (io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ + if (io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Processing chunks:\n"); - HDfprintf(debug_file, "---------------------------------------------------\n"); + HDfprintf(debug_file, "Processing chunks:\n"); + HDfprintf(debug_file, "---------------------------------------------------\n"); #endif - /* Iterate through all the chunks in the collective write operation, - * updating each chunk with the data modifications from other processes, - * then re-filtering the chunk. */ - for (i = 0; i < chunk_list_num_entries; i++) { - unsigned filter_mask = 0; - hbool_t full_overwrite = TRUE; - size_t buf_size; - hssize_t iter_nelmts; + /* Iterate through all the chunks in the collective write operation, + * updating each chunk with the data modifications from other processes, + * then re-filtering the chunk. */ + for (i = 0; i < chunk_list_num_entries; i++) { + unsigned filter_mask = 0; + hbool_t full_overwrite = TRUE; + size_t buf_size; + hssize_t iter_nelmts; #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Chunk at address %a:\n", chunk_list[i].old_chunk.offset); + HDfprintf(debug_file, "| Chunk at address %a:\n", chunk_list[i].old_chunk.offset); #endif - /* If this is a full overwrite of this chunk, enough memory must be allocated for - * the size of the unfiltered chunk. Otherwise, enough memory must be allocated - * to read the filtered chunk from the file. */ - /* XXX: Return value of macro should be checked instead */ - buf_size = (full_overwrite) ? (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_list[i].chunk_info.fspace) * type_info->src_type_size - : chunk_list[i].old_chunk.length; - chunk_list[i].new_chunk.length = buf_size; + /* XXX: Determine if a chunk is being fully overwritten by looking at the total selection + * in the dataspace */ + + /* If this is a full overwrite of this chunk, enough memory must be allocated for + * the size of the unfiltered chunk. Otherwise, enough memory must be allocated + * to read the filtered chunk from the file. */ + /* XXX: Return value of macro should be checked instead */ + buf_size = (full_overwrite) ? (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_list[i].chunk_info.fspace) * type_info->src_type_size + : chunk_list[i].old_chunk.length; + chunk_list[i].new_chunk.length = buf_size; #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Allocing %zd bytes for %s chunk overwrite buffer.\n", buf_size, - full_overwrite ? "full" : "non-full"); + HDfprintf(debug_file, "| - Allocing %zd bytes for %s chunk overwrite buffer.\n", buf_size, + full_overwrite ? "full" : "non-full"); #endif - if (NULL == (chunk_list[i].buf = H5MM_malloc(buf_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification buffer") - - /* Initialize iterator for memory selection */ - if (H5S_select_iter_init(mem_iter, chunk_list[i].chunk_info.mspace, type_info->dst_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") - mem_iter_init = TRUE; + if (NULL == (chunk_list[i].buf = H5MM_malloc(buf_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification buffer") - /* Owner of this chunk, receive modification data from other processes */ + /* Owner of this chunk, receive modification data from other processes */ - if (!full_overwrite) { - /* Read the chunk from the file */ - if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_list[i].old_chunk.offset, - buf_size, H5AC_rawdata_dxpl_id, chunk_list[i].buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") + if (!full_overwrite) { + /* Read the chunk from the file */ + if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_list[i].old_chunk.offset, + buf_size, H5AC_rawdata_dxpl_id, chunk_list[i].buf) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") - /* Unfilter the chunk before modifying it */ - if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, - io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, - (size_t *) &chunk_list[i].new_chunk.length, &buf_size, &chunk_list[i].buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "couldn't unfilter chunk for modifying") + /* Unfilter the chunk before modifying it */ + if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, + io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, + (size_t *) &chunk_list[i].new_chunk.length, &buf_size, &chunk_list[i].buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "couldn't unfilter chunk for modifying") #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - After decompression: Nbytes=%zd; Buf_size=%zd.\n", chunk_list[i].new_chunk.length, buf_size); + HDfprintf(debug_file, "| - After decompression: Nbytes=%zd; Buf_size=%zd.\n", chunk_list[i].new_chunk.length, buf_size); - HDfprintf(debug_file, "| - Read buf:\n| - ["); - for (size_t j = 0; j < chunk_list[i].new_chunk.length / type_info->src_type_size; j++) { - if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) chunk_list[i].buf)[j]); - } - HDfprintf(debug_file, "]\n|\n"); + HDfprintf(debug_file, "| - Read buf:\n| - ["); + for (size_t j = 0; j < chunk_list[i].new_chunk.length / type_info->src_type_size; j++) { + if (j > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) chunk_list[i].buf)[j]); + } + HDfprintf(debug_file, "]\n|\n"); #endif - } /* end if */ + } /* end if */ - /* Update the chunk data with the modifications from the current (owning) process */ - if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_list[i].chunk_info.mspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + /* Update the chunk data with the modifications from the current (owning) process */ + + /* Initialize iterator for memory selection */ + if (H5S_select_iter_init(mem_iter, chunk_list[i].chunk_info.mspace, type_info->dst_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") + mem_iter_init = TRUE; - if (!H5D__gather_mem(io_info->u.wbuf, chunk_list[i].chunk_info.mspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, chunk_list[i].buf)) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather from write buffer") + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_list[i].chunk_info.mspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + + if (!H5D__gather_mem(io_info->u.wbuf, chunk_list[i].chunk_info.mspace, mem_iter, + (size_t) iter_nelmts, io_info->dxpl_cache, chunk_list[i].buf)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather from write buffer") - /* Update the chunk data with any modifications from other processes */ + /* Update the chunk data with any modifications from other processes */ #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Write Buffer:\n"); - HDfprintf(debug_file, "| - ["); - for (size_t j = 0; j < chunk_list[i].new_chunk.length / type_info->src_type_size; j++) { - if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) chunk_list[i].buf)[j]); - } - HDfprintf(debug_file, "]\n|\n"); + HDfprintf(debug_file, "| - Write Buffer:\n"); + HDfprintf(debug_file, "| - ["); + for (size_t j = 0; j < chunk_list[i].new_chunk.length / type_info->src_type_size; j++) { + if (j > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) chunk_list[i].buf)[j]); + } + HDfprintf(debug_file, "]\n|\n"); - HDfprintf(debug_file, "| - Write buf is at address %a.\n|\n", chunk_list[i].buf); + HDfprintf(debug_file, "| - Write buf is at address %a.\n|\n", chunk_list[i].buf); - HDfprintf(debug_file, "| - About to filter %zd bytes in buffer of size %zd.\n|\n", chunk_list[i].new_chunk.length, buf_size); + HDfprintf(debug_file, "| - About to filter %zd bytes in buffer of size %zd.\n|\n", chunk_list[i].new_chunk.length, buf_size); #endif - /* Filter the chunk */ - if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, - io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, - (size_t *) &chunk_list[i].new_chunk.length, &buf_size, &chunk_list[i].buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") + /* Filter the chunk */ + if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, + io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, + (size_t *) &chunk_list[i].new_chunk.length, &buf_size, &chunk_list[i].buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 - /* Check for the chunk expanding too much to encode in a 32-bit value */ - if (chunk_list[i].new_chunk.length > ((size_t) 0xffffffff)) - HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") + /* Check for the chunk expanding too much to encode in a 32-bit value */ + if (chunk_list[i].new_chunk.length > ((size_t) 0xffffffff)) + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") #endif - if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") - } /* end for */ + if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + } /* end for */ #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "---------------------------------------------------\n\n"); + HDfprintf(debug_file, "---------------------------------------------------\n\n"); #endif - /* Gather the new chunk sizes to all processes for a collective reallocation - * of the chunks in the file */ - if (H5D__mpio_array_gather(io_info, chunk_list, chunk_list_num_entries, sizeof(*chunk_list), - (void **) &total_array, &total_array_num_entries, NULL) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") + /* Gather the new chunk sizes to all processes for a collective reallocation + * of the chunks in the file */ + if (H5D__mpio_array_gather(io_info, chunk_list, chunk_list_num_entries, sizeof(*chunk_list), + (void **) &total_array, &total_array_num_entries, NULL) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Reallocing chunks:\n"); - HDfprintf(debug_file, "------------------------------\n"); + HDfprintf(debug_file, "Reallocing chunks:\n"); + HDfprintf(debug_file, "------------------------------\n"); #endif - /* Collectively re-allocate the modified chunks (from each process) in the file */ - for (i = 0; i < total_array_num_entries; i++) { - hbool_t insert; + /* Collectively re-allocate the modified chunks (from each process) in the file */ + for (i = 0; i < total_array_num_entries; i++) { + hbool_t insert; #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Reallocing chunk at address %a with new length of %zd.\n", total_array[i].new_chunk.offset, total_array[i].new_chunk.length); + HDfprintf(debug_file, "| Reallocing chunk at address %a with new length of %zd.\n", total_array[i].new_chunk.offset, total_array[i].new_chunk.length); #endif - if (H5D__chunk_file_alloc(&index_info, &total_array[i].old_chunk, &total_array[i].new_chunk, - &insert, total_array[i].chunk_info.scaled) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") + if (H5D__chunk_file_alloc(&index_info, &total_array[i].old_chunk, &total_array[i].new_chunk, + &insert, total_array[i].chunk_info.scaled) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Chunk now at address %a.\n|\n", total_array[i].new_chunk); + HDfprintf(debug_file, "| - Chunk now at address %a.\n|\n", total_array[i].new_chunk); #endif - } /* end for */ + } /* end for */ #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "------------------------------\n\n"); -#endif + HDfprintf(debug_file, "------------------------------\n\n"); +#endif + + /* XXX: During the collective re-allocation of chunks in the file, the record for each + * chunk is only update in the total array, not in the local copy of chunks on each + * process. However, each process needs the updated chunk records so that they can create + * a MPI type for the collective write that will write to the chunk's new locations instead + * of the old ones. This ugly hack seems to be the best solution to copy the information + * back to the local array and avoid having to modify the collective write type function + * in an ugly way so that it will accept the total array instead of the local array. + * This works correctly because the array gather function guarantees that the chunk + * data in the total array is ordered in blocks by rank. + */ + { + size_t offset; - /* XXX: During the collective re-allocation of chunks in the file, the record for each - * chunk is only update in the total array, not in the local copy of chunks on each - * process. However, each process needs the updated chunk records so that they can create - * a MPI type for the collective write that will write to the chunk's new locations instead - * of the old ones. This ugly hack seems to be the best solution to copy the information - * back to the local array and avoid having to modify the collective write type function - * in an ugly way so that it will accept the total array instead of the local array. - * This works correctly because the array gather function guarantees that the chunk - * data in the total array is ordered in blocks by rank. - */ - { - size_t offset; + /* XXX: No need to use bytes here, should be able to simply find offset in + * terms of H5D_filtered_collective_io_info_t's */ - offset = 0; - for (i = 0; i < (size_t) mpi_rank; i++) - offset += num_chunks_selected_array[i] * sizeof(H5D_filtered_collective_io_info_t); + offset = 0; + for (i = 0; i < (size_t) mpi_rank; i++) + offset += num_chunks_selected_array[i] * sizeof(H5D_filtered_collective_io_info_t); - HDmemcpy(chunk_list, &((char *) total_array)[offset], num_chunks_selected_array[mpi_rank] * sizeof(H5D_filtered_collective_io_info_t)); - } + HDmemcpy(chunk_list, &((char *) total_array)[offset], num_chunks_selected_array[mpi_rank] * sizeof(H5D_filtered_collective_io_info_t)); + } - /* Create single MPI type encompassing each selection in the dataspace */ - if (H5D__mpio_filtered_collective_write_type(chunk_list, chunk_list_num_entries, - &mem_type, &mem_type_is_derived, &file_type, &file_type_is_derived) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't create MPI link chunk I/O type") + /* Create single MPI type encompassing each selection in the dataspace */ + if (H5D__mpio_filtered_collective_write_type(chunk_list, chunk_list_num_entries, + &mem_type, &mem_type_is_derived, &file_type, &file_type_is_derived) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't create MPI link chunk I/O type") - /* Override the write buffer to point to the address of the first - * chunk data buffer */ + /* Override the write buffer to point to the address of the first + * chunk data buffer */ + /* XXX: Find a better solution, but processes with no chunks on them + * are a special case so they have a NULL buf */ + if (mem_type_is_derived && file_type_is_derived) io_info->u.wbuf = chunk_list[0].buf; - } /* end if */ - else { /* Filtered collective read */ - - } /* end else */ - - /* We have a single, complicated MPI datatype for both memory & file */ - mpi_buf_count = (hsize_t) 1; - } - else { /* No selection at all for this process, contribute none type */ - size_t dataset_num_chunks; - - /* Retrieve total # of chunks in dataset */ - H5_CHECKED_ASSIGN(dataset_num_chunks, size_t, fm->layout->u.chunk.nchunks, hsize_t); - - /* Allocate chunking information */ - if (NULL == (total_chunk_addr_array = (haddr_t *) H5MM_malloc(sizeof(haddr_t) * dataset_num_chunks))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate total chunk address arraybuffer") - - /* Retrieve chunk address map */ - if (H5D__chunk_addrmap(io_info, total_chunk_addr_array) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") - - /* Get chunk with lowest address */ - ctg_store.contig.dset_addr = HADDR_MAX; - for (i = 0; i < dataset_num_chunks; i++) - if (total_chunk_addr_array[i] < ctg_store.contig.dset_addr) - ctg_store.contig.dset_addr = total_chunk_addr_array[i]; - HDassert(ctg_store.contig.dset_addr != HADDR_MAX); - - /* Set the MPI datatype */ - file_type = MPI_BYTE; - mem_type = MPI_BYTE; + } /* end if */ + else { /* Filtered collective read */ - /* No chunks selected for this process */ - mpi_buf_count = (hsize_t) 0; } /* end else */ + /* We have a single, complicated MPI datatype for both memory & file */ + mpi_buf_count = (mem_type_is_derived && file_type_is_derived) ? (hsize_t) 1 : (hsize_t) 0; + /* Set up the base storage address for this operation */ ctg_store.contig.dset_addr = 0; io_info->store = &ctg_store; @@ -2005,7 +1987,7 @@ if(H5DEBUG(D)) HDfprintf(debug_file, "-----------------------------------------\n"); for (size_t k = 0; k < chunk_list_num_entries; k++) { HDfprintf(debug_file, "| Owner of chunk at address %a is expecting messages from %d other processes.\n", - chunk_list[k].old_chunk.offset, chunk_list[k].num_writers); + chunk_list[k].old_chunk.offset, chunk_list[k].num_writers - 1); } HDfprintf(debug_file, "-----------------------------------------\n\n"); @@ -2013,6 +1995,8 @@ if(H5DEBUG(D)) HDfprintf(debug_file, "---------------------------------------------------\n"); #endif + /* XXX: Iteration should be for the max number among processes, since a process could + * have no chunks assigned to it */ for (i = 0; i < chunk_list_num_entries; i++) { unsigned filter_mask = 0; hbool_t full_overwrite = TRUE; @@ -2042,11 +2026,6 @@ if(H5DEBUG(D)) if (NULL == (chunk_list[i].buf = H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification buffer") - /* Initialize iterator for memory selection */ - if (H5S_select_iter_init(mem_iter, chunk_list[i].chunk_info.mspace, type_info->dst_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") - mem_iter_init = TRUE; - /* Owner of this chunk, receive modification data from other processes */ if (!full_overwrite) { @@ -2074,6 +2053,12 @@ if(H5DEBUG(D)) } /* end if */ /* Update the chunk data with the modifications from the current (owning) process */ + + /* Initialize iterator for memory selection */ + if (H5S_select_iter_init(mem_iter, chunk_list[i].chunk_info.mspace, type_info->dst_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") + mem_iter_init = TRUE; + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_list[i].chunk_info.mspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") @@ -2981,9 +2966,11 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ size_t **_num_chunks_selected_array) { H5D_filtered_collective_io_info_t *local_info_array = NULL; + H5D_filtered_collective_io_info_t *overlap_array = NULL; H5SL_node_t *chunk_node; hbool_t no_overlap = FALSE; size_t num_chunks_selected; + size_t overlap_array_num_entries; size_t *num_chunks_selected_array = NULL; int mpi_rank, mpi_size, mpi_code; herr_t ret_value = SUCCEED; @@ -3003,17 +2990,11 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Get the no overlap property */ - /* Redistribute chunks to new owners as necessary */ - if (!no_overlap) { - - } - if (NULL == (local_info_array = (H5D_filtered_collective_io_info_t *) H5MM_malloc(H5SL_count(fm->sel_chunks) * sizeof(*local_info_array)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate local io info array buffer") - num_chunks_selected = 0; chunk_node = H5SL_first(fm->sel_chunks); - while (chunk_node) { + for (num_chunks_selected = 0; chunk_node; num_chunks_selected++) { H5D_chunk_info_t *chunk_info = (H5D_chunk_info_t *) H5SL_item(chunk_node); H5D_chunk_ud_t udata; @@ -3021,17 +3002,15 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") -#ifdef PARALLEL_COMPRESS_DEBUG - local_info_array[num_chunks_selected].num_writers = 0; -#endif - - local_info_array[num_chunks_selected].old_chunk = local_info_array[num_chunks_selected].new_chunk = udata.chunk_block; local_info_array[num_chunks_selected].chunk_info = *chunk_info; + local_info_array[num_chunks_selected].old_chunk = local_info_array[num_chunks_selected].new_chunk = udata.chunk_block; + local_info_array[num_chunks_selected].io_size = H5S_GET_SELECT_NPOINTS(chunk_info->mspace) * type_info->src_type_size; + local_info_array[num_chunks_selected].num_writers = 0; + local_info_array[num_chunks_selected].owner = mpi_rank; local_info_array[num_chunks_selected].buf = NULL; - num_chunks_selected++; chunk_node = H5SL_next(chunk_node); - } /* end while */ + } /* end for */ #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, " Contents of local info array\n"); @@ -3069,6 +3048,85 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HDfprintf(debug_file, "-----------------------------------\n\n"); #endif + /* Redistribute chunks to new owners as necessary */ + if (!no_overlap && (io_info->op_type == H5D_IO_OP_WRITE)) { + size_t i; + + if (H5D__mpio_array_gather(io_info, local_info_array, num_chunks_selected, + sizeof(*local_info_array), &overlap_array, &overlap_array_num_entries, + H5D__cmp_filtered_collective_io_entry) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't ") + + for (i = 0, num_chunks_selected = 0; i < overlap_array_num_entries;) { + H5D_filtered_collective_io_info_t chunk_entry; + haddr_t chunk_addr = overlap_array[i].old_chunk.offset; + size_t num_writers = 0; + size_t max_bytes = 0; + int new_owner = 0; + + /* Process duplicate entries caused by another process writing + * to the same chunk */ + do { + /* Store the correct chunk entry information in case this process + * become's the new chunk's owner */ + if (mpi_rank == overlap_array[i].owner) + chunk_entry = overlap_array[i]; + + /* New owner of the chunk is determined by the process + * which is writing the most data to the chunk */ + if (overlap_array[i].io_size > max_bytes) { + max_bytes = overlap_array[i].io_size; + new_owner = overlap_array[i].owner; + } + + num_writers++; + i++; + + if (i == overlap_array_num_entries) break; + } while (overlap_array[i].old_chunk.offset == chunk_addr); + + if (mpi_rank == new_owner) { + /* Make sure the new owner will know how many other processes will + * be sending chunk modification data to it */ + chunk_entry.num_writers = num_writers; + + /* New owner takes possession of the chunk */ + overlap_array[num_chunks_selected++] = chunk_entry; + } + else { + /* Send modification data to new owner */ + + } + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Chunk at address %a re-assigned to process %d.\n", chunk_addr, new_owner); +#endif + } + + /* Release old list */ + if (local_info_array) + H5MM_free(local_info_array); + + /* Local info list becomes modified (redistributed) chunk list */ + local_info_array = overlap_array; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "This process now has %d chunks selected after redistribution.\n\n", num_chunks_selected); + + HDfprintf(debug_file, " Contents of local info array (after redistribution)\n"); + HDfprintf(debug_file, "------------------------------\n"); + for (size_t j = 0; j < (size_t) num_chunks_selected; j++) { + HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); + HDfprintf(debug_file, "| - Chunk Address: %a\n", local_info_array[j].old_chunk.offset); + HDfprintf(debug_file, "| - Chunk Length: %zd\n", local_info_array[j].old_chunk.length); + HDfprintf(debug_file, "| - Address of mspace: %x\n", local_info_array[j].chunk_info.mspace); + HDfprintf(debug_file, "| - Chunk Selection Type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.mspace)); + HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); + } + HDfprintf(debug_file, "------------------------------\n\n"); +#endif + } + /* Gather the number of chunks each process is writing to all processes */ if (NULL == (num_chunks_selected_array = (size_t *) H5MM_malloc((size_t) mpi_size * sizeof(*num_chunks_selected_array)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate num chunks selected array") @@ -3113,8 +3171,8 @@ done: */ static herr_t H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chunk_list, - size_t num_entries, MPI_Datatype *new_mem_type, hbool_t *mem_type_created, - MPI_Datatype *new_file_type, hbool_t *file_type_created) + size_t num_entries, MPI_Datatype *new_mem_type, hbool_t *mem_type_derived, + MPI_Datatype *new_file_type, hbool_t *file_type_derived) { MPI_Aint *write_buf_array = NULL; /* Relative displacements of filtered chunk data buffers */ MPI_Aint *file_offset_array = NULL; /* Chunk offsets in the file */ @@ -3125,9 +3183,9 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun HDassert(chunk_list); HDassert(new_mem_type); - HDassert(mem_type_created); + HDassert(mem_type_derived); HDassert(new_file_type); - HDassert(file_type_created); + HDassert(file_type_derived); if (num_entries > 0) { size_t i; @@ -3178,14 +3236,14 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun /* Create memory MPI type */ if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int) num_entries, length_array, write_buf_array, MPI_BYTE, new_mem_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) - *mem_type_created = TRUE; + *mem_type_derived = TRUE; if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_mem_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) /* Create file MPI type */ if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int) num_entries, length_array, file_offset_array, MPI_BYTE, new_file_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) - *file_type_created = TRUE; + *file_type_derived = TRUE; if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_file_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) } /* end if */ -- cgit v0.12 From 4a83ceaf7d7ec17779589864645d39436c0f5227 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 18 Jan 2017 16:48:27 -0600 Subject: Major cleanup Separate update phase for chunk entry into its own function, since code for multi-chunk IO and link-chunk IO is exactly the same Remove last IO mode code from multi-chunk IO, since filtered collective writes cannot break to independent IO mode Fix collective overlapping IO for multi-chunk IO by iterating equal to the max number of chunks on any process Make hard separation between collective read and write since trying to mix the two into one loop becomes messy Add preliminary code for asynchronous sending of chunk modification data to new owning process when redistributing chunks --- src/H5Dmpio.c | 778 +++++++++++++++++++++++----------------------------------- 1 file changed, 303 insertions(+), 475 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 49f25ae..aa95a3a 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -158,6 +158,9 @@ static herr_t H5D__mpio_filtered_collective_write_type( H5D_filtered_collective_io_info_t *chunk_list, size_t num_entries, MPI_Datatype *new_mem_type, hbool_t *mem_type_derived, MPI_Datatype *new_file_type, hbool_t *file_type_derived); +static herr_t H5D__update_filtered_collective_chunk_entry( + H5D_filtered_collective_io_info_t *chunk_entry, H5D_io_info_t *io_info, + H5D_type_info_t *type_info); static int H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2); static int H5D__cmp_filtered_collective_io_entry(const void *filtered_collective_io_entry1, const void *filtered_collective_io_entry2); @@ -1251,6 +1254,8 @@ if(H5DEBUG(D)) * Purpose: Routine for one collective IO with one MPI derived datatype * to link with all filtered chunks * + * XXX: Update later to reflect changes in structure + * * 1. Construct a list of selected chunks in the collective IO * operation * A. If any chunk is being written to by more than 1 @@ -1297,22 +1302,17 @@ static herr_t H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) { - H5D_filtered_collective_io_info_t *chunk_list = NULL; - H5D_filtered_collective_io_info_t *total_array = NULL; + H5D_filtered_collective_io_info_t *chunk_list = NULL; /* The list of chunks being read/written */ + H5D_filtered_collective_io_info_t *collective_chunk_list = NULL; H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode = H5D_MPIO_LINK_CHUNK; H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CHUNK_COLLECTIVE; - H5D_chk_idx_info_t index_info; - H5S_sel_iter_t *mem_iter = NULL; H5D_storage_t ctg_store; MPI_Datatype mem_type = MPI_BYTE; MPI_Datatype file_type = MPI_BYTE; hbool_t mem_type_is_derived = FALSE; hbool_t file_type_is_derived = FALSE; - hbool_t mem_iter_init = FALSE; - hsize_t mpi_buf_count; /* Number of MPI types */ - haddr_t *total_chunk_addr_array = NULL; size_t chunk_list_num_entries; - size_t total_array_num_entries; + size_t collective_chunk_list_num_entries; size_t *num_chunks_selected_array = NULL; size_t i; int mpi_rank, mpi_size, mpi_code; @@ -1335,13 +1335,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") - /* Construct chunked index info */ - index_info.f = io_info->dset->oloc.file; - index_info.dxpl_id = io_info->md_dxpl_id; - index_info.pline = &(io_info->dset->shared->dcpl_cache.pline); - index_info.layout = &(io_info->dset->shared->layout.u.chunk); - index_info.storage = &(io_info->dset->shared->layout.storage.u.chunk); - /* Build a list of selected chunks in the collective io operation */ /* XXX: Not sure about correct minor error code */ if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries, &num_chunks_selected_array) < 0) @@ -1364,10 +1357,24 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HDfprintf(debug_file, "-----------------------------------------\n\n"); #endif - if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") - if (io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ + H5D_chk_idx_info_t index_info; + H5D_chunk_ud_t udata; + hsize_t mpi_buf_count; + + /* Construct chunked index info */ + index_info.f = io_info->dset->oloc.file; + index_info.dxpl_id = io_info->md_dxpl_id; + index_info.pline = &(io_info->dset->shared->dcpl_cache.pline); + index_info.layout = &(io_info->dset->shared->layout.u.chunk); + index_info.storage = &(io_info->dset->shared->layout.storage.u.chunk); + + /* Set up chunk information for insertion to chunk index */ + udata.common.layout = index_info.layout; + udata.common.storage = index_info.storage; + udata.filter_mask = 0; + + #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "Processing chunks:\n"); HDfprintf(debug_file, "---------------------------------------------------\n"); @@ -1376,107 +1383,10 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* Iterate through all the chunks in the collective write operation, * updating each chunk with the data modifications from other processes, * then re-filtering the chunk. */ - for (i = 0; i < chunk_list_num_entries; i++) { - unsigned filter_mask = 0; - hbool_t full_overwrite = TRUE; - size_t buf_size; - hssize_t iter_nelmts; - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Chunk at address %a:\n", chunk_list[i].old_chunk.offset); -#endif - - /* XXX: Determine if a chunk is being fully overwritten by looking at the total selection - * in the dataspace */ - - /* If this is a full overwrite of this chunk, enough memory must be allocated for - * the size of the unfiltered chunk. Otherwise, enough memory must be allocated - * to read the filtered chunk from the file. */ - /* XXX: Return value of macro should be checked instead */ - buf_size = (full_overwrite) ? (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_list[i].chunk_info.fspace) * type_info->src_type_size - : chunk_list[i].old_chunk.length; - chunk_list[i].new_chunk.length = buf_size; - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Allocing %zd bytes for %s chunk overwrite buffer.\n", buf_size, - full_overwrite ? "full" : "non-full"); -#endif - - if (NULL == (chunk_list[i].buf = H5MM_malloc(buf_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification buffer") - - /* Owner of this chunk, receive modification data from other processes */ - - if (!full_overwrite) { - /* Read the chunk from the file */ - if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_list[i].old_chunk.offset, - buf_size, H5AC_rawdata_dxpl_id, chunk_list[i].buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") - - /* Unfilter the chunk before modifying it */ - if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, - io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, - (size_t *) &chunk_list[i].new_chunk.length, &buf_size, &chunk_list[i].buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "couldn't unfilter chunk for modifying") - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - After decompression: Nbytes=%zd; Buf_size=%zd.\n", chunk_list[i].new_chunk.length, buf_size); - - HDfprintf(debug_file, "| - Read buf:\n| - ["); - for (size_t j = 0; j < chunk_list[i].new_chunk.length / type_info->src_type_size; j++) { - if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) chunk_list[i].buf)[j]); - } - HDfprintf(debug_file, "]\n|\n"); -#endif - } /* end if */ - - /* Update the chunk data with the modifications from the current (owning) process */ - - /* Initialize iterator for memory selection */ - if (H5S_select_iter_init(mem_iter, chunk_list[i].chunk_info.mspace, type_info->dst_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") - mem_iter_init = TRUE; - - if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_list[i].chunk_info.mspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - - if (!H5D__gather_mem(io_info->u.wbuf, chunk_list[i].chunk_info.mspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, chunk_list[i].buf)) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather from write buffer") - - /* Update the chunk data with any modifications from other processes */ - - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Write Buffer:\n"); - HDfprintf(debug_file, "| - ["); - for (size_t j = 0; j < chunk_list[i].new_chunk.length / type_info->src_type_size; j++) { - if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) chunk_list[i].buf)[j]); - } - HDfprintf(debug_file, "]\n|\n"); - - HDfprintf(debug_file, "| - Write buf is at address %a.\n|\n", chunk_list[i].buf); - - HDfprintf(debug_file, "| - About to filter %zd bytes in buffer of size %zd.\n|\n", chunk_list[i].new_chunk.length, buf_size); -#endif - - /* Filter the chunk */ - if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, - io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, - (size_t *) &chunk_list[i].new_chunk.length, &buf_size, &chunk_list[i].buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") - -#if H5_SIZEOF_SIZE_T > 4 - /* Check for the chunk expanding too much to encode in a 32-bit value */ - if (chunk_list[i].new_chunk.length > ((size_t) 0xffffffff)) - HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") -#endif - - if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") - } /* end for */ + /* XXX: Not sure about minor error code */ + for (i = 0; i < chunk_list_num_entries; i++) + if (H5D__update_filtered_collective_chunk_entry(&chunk_list[i], io_info, type_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't update filtered chunk entry") #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "---------------------------------------------------\n\n"); @@ -1485,7 +1395,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* Gather the new chunk sizes to all processes for a collective reallocation * of the chunks in the file */ if (H5D__mpio_array_gather(io_info, chunk_list, chunk_list_num_entries, sizeof(*chunk_list), - (void **) &total_array, &total_array_num_entries, NULL) < 0) + (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") #ifdef PARALLEL_COMPRESS_DEBUG @@ -1494,19 +1404,19 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in #endif /* Collectively re-allocate the modified chunks (from each process) in the file */ - for (i = 0; i < total_array_num_entries; i++) { + for (i = 0; i < collective_chunk_list_num_entries; i++) { hbool_t insert; #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Reallocing chunk at address %a with new length of %zd.\n", total_array[i].new_chunk.offset, total_array[i].new_chunk.length); + HDfprintf(debug_file, "| Reallocing chunk at address %a with new length of %zd.\n", collective_chunk_list[i].new_chunk.offset, collective_chunk_list[i].new_chunk.length); #endif - if (H5D__chunk_file_alloc(&index_info, &total_array[i].old_chunk, &total_array[i].new_chunk, - &insert, total_array[i].chunk_info.scaled) < 0) + if (H5D__chunk_file_alloc(&index_info, &collective_chunk_list[i].old_chunk, &collective_chunk_list[i].new_chunk, + &insert, collective_chunk_list[i].chunk_info.scaled) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Chunk now at address %a.\n|\n", total_array[i].new_chunk); + HDfprintf(debug_file, "| - Chunk now at address %a.\n|\n", collective_chunk_list[i].new_chunk); #endif } /* end for */ @@ -1514,74 +1424,61 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HDfprintf(debug_file, "------------------------------\n\n"); #endif - /* XXX: During the collective re-allocation of chunks in the file, the record for each - * chunk is only update in the total array, not in the local copy of chunks on each - * process. However, each process needs the updated chunk records so that they can create - * a MPI type for the collective write that will write to the chunk's new locations instead - * of the old ones. This ugly hack seems to be the best solution to copy the information - * back to the local array and avoid having to modify the collective write type function - * in an ugly way so that it will accept the total array instead of the local array. - * This works correctly because the array gather function guarantees that the chunk - * data in the total array is ordered in blocks by rank. - */ - { + /* If this process has any chunks selected, create a MPI type for collectively + * writing out the chunks to file. Otherwise, the process contributes to the + * collective write with a none type. */ + if (chunk_list_num_entries) { size_t offset; + /* XXX: During the collective re-allocation of chunks in the file, the record for each + * chunk is only update in the total array, not in the local copy of chunks on each + * process. However, each process needs the updated chunk records so that they can create + * a MPI type for the collective write that will write to the chunk's new locations instead + * of the old ones. This ugly hack seems to be the best solution to copy the information + * back to the local array and avoid having to modify the collective write type function + * in an ugly way so that it will accept the total array instead of the local array. + * This works correctly because the array gather function guarantees that the chunk + * data in the total array is ordered in blocks by rank. + */ /* XXX: No need to use bytes here, should be able to simply find offset in * terms of H5D_filtered_collective_io_info_t's */ - offset = 0; for (i = 0; i < (size_t) mpi_rank; i++) offset += num_chunks_selected_array[i] * sizeof(H5D_filtered_collective_io_info_t); - HDmemcpy(chunk_list, &((char *) total_array)[offset], num_chunks_selected_array[mpi_rank] * sizeof(H5D_filtered_collective_io_info_t)); - } + HDmemcpy(chunk_list, &((char *) collective_chunk_list)[offset], num_chunks_selected_array[mpi_rank] * sizeof(H5D_filtered_collective_io_info_t)); - /* Create single MPI type encompassing each selection in the dataspace */ - if (H5D__mpio_filtered_collective_write_type(chunk_list, chunk_list_num_entries, - &mem_type, &mem_type_is_derived, &file_type, &file_type_is_derived) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't create MPI link chunk I/O type") + /* Create single MPI type encompassing each selection in the dataspace */ + if (H5D__mpio_filtered_collective_write_type(chunk_list, chunk_list_num_entries, + &mem_type, &mem_type_is_derived, &file_type, &file_type_is_derived) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't create MPI link chunk I/O type") - /* Override the write buffer to point to the address of the first - * chunk data buffer */ - /* XXX: Find a better solution, but processes with no chunks on them - * are a special case so they have a NULL buf */ - if (mem_type_is_derived && file_type_is_derived) + /* Override the write buffer to point to the address of the first + * chunk data buffer */ io_info->u.wbuf = chunk_list[0].buf; - } /* end if */ - else { /* Filtered collective read */ - - } /* end else */ - - /* We have a single, complicated MPI datatype for both memory & file */ - mpi_buf_count = (mem_type_is_derived && file_type_is_derived) ? (hsize_t) 1 : (hsize_t) 0; - - /* Set up the base storage address for this operation */ - ctg_store.contig.dset_addr = 0; - io_info->store = &ctg_store; + } /* end if */ - /* Perform I/O */ - if (H5D__final_collective_io(io_info, type_info, mpi_buf_count, &file_type, &mem_type) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") + /* We have a single, complicated MPI datatype for both memory & file */ + mpi_buf_count = (mem_type_is_derived && file_type_is_derived) ? (hsize_t) 1 : (hsize_t) 0; - /* Collectively insert each chunk into the chunk index if this - * is a filtered collective write */ - if (io_info->op_type == H5D_IO_OP_WRITE) { - H5D_chunk_ud_t udata; + /* Set up the base storage address for this operation */ + ctg_store.contig.dset_addr = 0; + io_info->store = &ctg_store; - /* Set up chunk information for insertion to chunk index */ - udata.common.layout = index_info.layout; - udata.common.storage = index_info.storage; - udata.filter_mask = 0; + /* Perform I/O */ + if (H5D__final_collective_io(io_info, type_info, mpi_buf_count, &file_type, &mem_type) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") + /* Participate in the collective re-insertion of all chunks modified + * in this iteration into the chunk index */ #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "Reinserting chunks into chunk index.\n"); HDfprintf(debug_file, "---------------------------------------\n"); #endif - for (i = 0; i < total_array_num_entries; i++) { - udata.chunk_block = total_array[i].new_chunk; - udata.common.scaled = total_array[i].chunk_info.scaled; + for (i = 0; i < collective_chunk_list_num_entries; i++) { + udata.chunk_block = collective_chunk_list[i].new_chunk; + udata.common.scaled = collective_chunk_list[i].chunk_info.scaled; if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") @@ -1595,12 +1492,11 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HDfprintf(debug_file, "---------------------------------------\n"); #endif } /* end if */ + else { /* Filtered collective read */ -done: - /* Free resources used by a process which had no selection at all */ - if (total_chunk_addr_array) - H5MM_free(total_chunk_addr_array); + } /* end else */ +done: /* Free resources used by a process which had some selection */ if (chunk_list) { for (i = 0; i < chunk_list_num_entries; i++) @@ -1612,10 +1508,8 @@ done: if (num_chunks_selected_array) H5MM_free(num_chunks_selected_array); - if (total_array) - H5MM_free(total_array); - if (mem_iter) - H5MM_free(mem_iter); + if (collective_chunk_list) + H5MM_free(collective_chunk_list); /* Free the MPI buf and file types, if they were derived */ if (mem_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) @@ -1846,6 +1740,7 @@ done: * Purpose: To do filtered collective IO per chunk to save on memory, * as opposed to collective IO of every chunk at once * + * XXX: Update later to reflect changes in structure * XXX: Add read operation description * * 1. Construct a list of selected chunks in the collective IO @@ -1894,28 +1789,19 @@ static herr_t H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) { - H5D_filtered_collective_io_info_t *chunk_list = NULL; - H5D_filtered_collective_io_info_t *gathered_array = NULL; + H5D_filtered_collective_io_info_t *chunk_list = NULL; /* The list of chunks being read/written */ + H5D_filtered_collective_io_info_t *collective_chunk_list = NULL; H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode = H5D_MPIO_MULTI_CHUNK; /* actual chunk optimization mode */ - H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_NO_COLLECTIVE; /* Local variable for tracking the I/O mode used. */ - H5FD_mpio_collective_opt_t last_coll_opt_mode = H5FD_MPIO_COLLECTIVE_IO; /* Last parallel transfer with independent IO or collective IO with this mode */ - H5FD_mpio_xfer_t last_xfer_mode = H5FD_MPIO_COLLECTIVE; /* Last parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */ - H5D_chk_idx_info_t index_info; - H5S_sel_iter_t *mem_iter = NULL; + H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CHUNK_COLLECTIVE; /* Local variable for tracking the I/O mode used. */ H5D_storage_t store; /* union of EFL and chunk pointer in file space */ H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ - MPI_Datatype file_type; - MPI_Datatype mem_type; - uint8_t *chunk_io_option = NULL; - haddr_t *chunk_addr = NULL; + MPI_Datatype file_type = MPI_BYTE; + MPI_Datatype mem_type = MPI_BYTE; hbool_t file_type_is_derived = FALSE; hbool_t mem_type_is_derived = FALSE; - hbool_t mem_iter_init = FALSE; - hsize_t mpi_buf_count; - size_t total_chunk; /* Total # of chunks in dataset */ size_t chunk_list_num_entries; - size_t gathered_array_num_entries; + size_t collective_chunk_list_num_entries; size_t *num_chunks_selected_array = NULL; size_t i, j; /* Local index variable */ int mpi_rank, mpi_size, mpi_code; @@ -1933,30 +1819,15 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") - /* Construct chunked index info */ - index_info.f = io_info->dset->oloc.file; - index_info.dxpl_id = io_info->md_dxpl_id; - index_info.pline = &(io_info->dset->shared->dcpl_cache.pline); - index_info.layout = &(io_info->dset->shared->layout.u.chunk); - index_info.storage = &(io_info->dset->shared->layout.storage.u.chunk); - + /* Set the actual_io_mode property. Filtered collective writes can't break + * to independent, so set actual_io_mode right away */ + if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk io mode property") /* Build a list of selected chunks in the collective IO operation */ if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries, &num_chunks_selected_array) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't construct filtered I/O info list") - /* Allocate memories */ - /* chunk_io_option = (uint8_t *) H5MM_calloc(total_chunk); - chunk_addr = (haddr_t *) H5MM_calloc(total_chunk * sizeof(haddr_t)); */ -#ifdef H5D_DEBUG -if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D), "total_chunk %Zu\n", total_chunk); -#endif - - /* Obtain IO option for each chunk */ - /* if (H5D__obtain_mpio_mode(io_info, fm, dx_plist, chunk_io_option, chunk_addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "unable to obtain MPIO mode") */ - /* Set up contiguous I/O info object */ HDmemcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); ctg_io_info.store = &ctg_store; @@ -1964,18 +1835,23 @@ if(H5DEBUG(D)) /* Initialize temporary contiguous storage info */ ctg_store.contig.dset_size = (hsize_t) io_info->dset->shared->layout.u.chunk.size; + ctg_store.contig.dset_addr = 0; /* Set dataset storage for I/O info */ io_info->store = &store; - if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") - - /* Loop over all the chunks in the collective IO operation */ - /* XXX: Multi-chunk needs to loop over all chunks and check for write/read inside - * loop, not the other way around */ if (io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ - H5D_chunk_ud_t udata; + H5D_chk_idx_info_t index_info; + H5D_chunk_ud_t udata; + size_t max_num_chunks; + hsize_t mpi_buf_count; + + /* Construct chunked index info */ + index_info.f = io_info->dset->oloc.file; + index_info.dxpl_id = io_info->md_dxpl_id; + index_info.pline = &(io_info->dset->shared->dcpl_cache.pline); + index_info.layout = &(io_info->dset->shared->layout.u.chunk); + index_info.storage = &(io_info->dset->shared->layout.storage.u.chunk); /* Set up chunk information for insertion to chunk index */ udata.common.layout = index_info.layout; @@ -1995,109 +1871,27 @@ if(H5DEBUG(D)) HDfprintf(debug_file, "---------------------------------------------------\n"); #endif + if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&chunk_list_num_entries, &max_num_chunks, + 1, MPI_UNSIGNED_LONG_LONG, MPI_MAX, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) + /* XXX: Iteration should be for the max number among processes, since a process could * have no chunks assigned to it */ - for (i = 0; i < chunk_list_num_entries; i++) { - unsigned filter_mask = 0; - hbool_t full_overwrite = TRUE; - size_t buf_size; - hssize_t iter_nelmts; - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Chunk at address %a:\n", chunk_list[i].old_chunk.offset); -#endif - - /* XXX: Determine if a chunk is being fully overwritten by looking at the total selection - * in the dataspace */ - - /* If this is a full overwrite of this chunk, enough memory must be allocated for - * the size of the unfiltered chunk. Otherwise, enough memory must be allocated - * to read the filtered chunk from the file. */ - /* XXX: Return value of macro should be checked instead */ - buf_size = (full_overwrite) ? (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_list[i].chunk_info.fspace) * type_info->src_type_size - : chunk_list[i].old_chunk.length; - chunk_list[i].new_chunk.length = buf_size; - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Allocing %zd bytes for %s chunk overwrite buffer.\n", buf_size, - full_overwrite ? "full" : "non-full"); -#endif - - if (NULL == (chunk_list[i].buf = H5MM_malloc(buf_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification buffer") - - /* Owner of this chunk, receive modification data from other processes */ - - if (!full_overwrite) { - /* Read the chunk from the file */ - if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_list[i].old_chunk.offset, - buf_size, H5AC_rawdata_dxpl_id, chunk_list[i].buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't read raw data chunk") - - /* Unfilter the chunk before modifying it */ - if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, - io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, - (size_t *) &chunk_list[i].new_chunk.length, &buf_size, &chunk_list[i].buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "couldn't unfilter chunk for modifying") - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - After decompression: Nbytes=%zd; Buf_size=%zd.\n", chunk_list[i].new_chunk.length, buf_size); - - HDfprintf(debug_file, "| - Read buf:\n| - ["); - for (size_t k = 0; k < chunk_list[i].new_chunk.length / type_info->src_type_size; k++) { - if (k > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) chunk_list[i].buf)[k]); - } - HDfprintf(debug_file, "]\n|\n"); -#endif - } /* end if */ - - /* Update the chunk data with the modifications from the current (owning) process */ - - /* Initialize iterator for memory selection */ - if (H5S_select_iter_init(mem_iter, chunk_list[i].chunk_info.mspace, type_info->dst_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") - mem_iter_init = TRUE; - - if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_list[i].chunk_info.mspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - - if (!H5D__gather_mem(io_info->u.wbuf, chunk_list[i].chunk_info.mspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, chunk_list[i].buf)) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather from write buffer") - - /* Update the chunk data with any modifications from other processes */ - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Write Buffer:\n"); - HDfprintf(debug_file, "| - ["); - for (size_t k = 0; k < chunk_list[i].new_chunk.length / type_info->src_type_size; k++) { - if (k > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) chunk_list[i].buf)[k]); - } - HDfprintf(debug_file, "]\n|\n"); - - HDfprintf(debug_file, "| - Write buf is at address %a.\n|\n", chunk_list[i].buf); - - HDfprintf(debug_file, "| - About to filter %zd bytes in buffer of size %zd.\n|\n", chunk_list[i].new_chunk.length, buf_size); -#endif - - /* Filter the chunk */ - if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, - io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, - (size_t *) &chunk_list[i].new_chunk.length, &buf_size, &chunk_list[i].buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") - -#if H5_SIZEOF_SIZE_T > 4 - /* Check for the chunk expanding too much to encode in a 32-bit value */ - if (chunk_list[i].new_chunk.length > ((size_t) 0xffffffff)) - HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") -#endif - - /* Gather the new chunk sizes to all processes for a collective reallocation - * of the chunks in the file */ - if (H5D__mpio_array_gather(io_info, &chunk_list[i], 1, sizeof(*chunk_list), - (void **) &gathered_array, &gathered_array_num_entries, NULL) < 0) + for (i = 0; i < max_num_chunks; i++) { + /* Check if this process has a chunk to work on for this iteration */ + hbool_t have_chunk_to_process = i < chunk_list_num_entries; + + /* XXX: Not sure about minor error code */ + if (have_chunk_to_process) + if (H5D__update_filtered_collective_chunk_entry(&chunk_list[i], io_info, type_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't update filtered chunk entry") + + /* Participate in the collective re-allocation of all chunks modified + * in this iteration. Gather the new chunk sizes to all processes for + * the collective re-allocation. */ + /* XXX: May access unavailable memory on processes with no selection */ + if (H5D__mpio_array_gather(io_info, &chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(*chunk_list), + (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") #ifdef PARALLEL_COMPRESS_DEBUG @@ -2106,21 +1900,21 @@ if(H5DEBUG(D)) #endif /* Collectively re-allocate the modified chunks (from each process) in the file */ - for (j = 0; j < gathered_array_num_entries; j++) { + for (j = 0; j < collective_chunk_list_num_entries; j++) { hbool_t insert = FALSE; #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "| Re-allocing chunk at address %a with new length of %llu bytes.\n", - gathered_array[j].new_chunk.offset, gathered_array[j].new_chunk.length); + collective_chunk_list[j].new_chunk.offset, collective_chunk_list[j].new_chunk.length); #endif /* Collectively re-allocate the chunk in the file */ - if (H5D__chunk_file_alloc(&index_info, &gathered_array[j].old_chunk, &gathered_array[j].new_chunk, + if (H5D__chunk_file_alloc(&index_info, &collective_chunk_list[j].old_chunk, &collective_chunk_list[j].new_chunk, &insert, chunk_list[j].chunk_info.scaled) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Chunk now at address %a.\n|\n", gathered_array[j].new_chunk); + HDfprintf(debug_file, "| Chunk now at address %a.\n|\n", collective_chunk_list[j].new_chunk); #endif } /* end for */ @@ -2128,58 +1922,59 @@ if(H5DEBUG(D)) HDfprintf(debug_file, "------------------------------\n\n"); #endif - /* Collect the new chunk info back to the local copy */ - /* XXX: This may encounter a problem if there is a process with no selection */ - HDmemcpy(&chunk_list[i].new_chunk, &gathered_array[mpi_rank].new_chunk, sizeof(chunk_list[i].new_chunk)); + /* If this process has a chunk to work on, create a MPI type for the + * memory and file for writing out the chunk */ + if (have_chunk_to_process) { + int mpi_type_count; + + /* Collect the new chunk info back to the local copy */ + HDmemcpy(&chunk_list[i].new_chunk, &collective_chunk_list[mpi_rank].new_chunk, sizeof(chunk_list[i].new_chunk)); #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "New chunk record after memcpy back to local:\n"); - HDfprintf(debug_file, " - Chunk offset: %a, Chunk length: %lld\n", chunk_list[i].new_chunk.offset, chunk_list[i].new_chunk.length); + HDfprintf(debug_file, "New chunk record after memcpy back to local:\n"); + HDfprintf(debug_file, " - Chunk offset: %a, Chunk length: %lld\n", chunk_list[i].new_chunk.offset, chunk_list[i].new_chunk.length); #endif - { - int count; - - H5_CHECKED_ASSIGN(count, int, chunk_list[i].new_chunk.length, hsize_t); + H5_CHECKED_ASSIGN(mpi_type_count, int, chunk_list[i].new_chunk.length, hsize_t); /* Create MPI memory type for writing to chunk */ - if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(count, MPI_BYTE, &mem_type))) + if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(mpi_type_count, MPI_BYTE, &mem_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&mem_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) mem_type_is_derived = TRUE; /* Create MPI file type for writing to chunk */ - if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(count, MPI_BYTE, &file_type))) + if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(mpi_type_count, MPI_BYTE, &file_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&file_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) file_type_is_derived = TRUE; - mpi_buf_count = 1; - } - + /* Set up the base storage address for this operation */ + ctg_store.contig.dset_addr = chunk_list[i].new_chunk.offset; - /* Set up the base storage address for this operation */ - ctg_store.contig.dset_addr = chunk_list[i].new_chunk.offset; + /* Override the write buffer to point to the address of the + * chunk data buffer */ + ctg_io_info.u.wbuf = chunk_list[i].buf; + } /* end if */ - /* Override the write buffer to point to the address of the - * chunk data buffer */ - ctg_io_info.u.wbuf = chunk_list[i].buf; + mpi_buf_count = (mem_type_is_derived && file_type_is_derived) ? 1 : 0; /* Perform the I/O */ if (H5D__final_collective_io(&ctg_io_info, type_info, mpi_buf_count, &file_type, &mem_type) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") + /* Participate in the collective re-insertion of all chunks modified + * in this iteration into the chunk index */ #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "Reinserting chunks into chunk index.\n"); HDfprintf(debug_file, "---------------------------------------\n"); #endif - /* Re-insert the modified chunks (from each process) into the chunk index */ - for (j = 0; j < gathered_array_num_entries; j++) { - udata.chunk_block = gathered_array[j].new_chunk; - udata.common.scaled = gathered_array[j].chunk_info.scaled; + for (j = 0; j < collective_chunk_list_num_entries; j++) { + udata.chunk_block = collective_chunk_list[j].new_chunk; + udata.common.scaled = collective_chunk_list[j].chunk_info.scaled; if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") @@ -2203,11 +1998,8 @@ if(H5DEBUG(D)) mem_type_is_derived = FALSE; file_type_is_derived = FALSE; - if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") - - if (gathered_array) - gathered_array = (H5D_filtered_collective_io_info_t *) H5MM_free(gathered_array); + if (collective_chunk_list) + collective_chunk_list = (H5D_filtered_collective_io_info_t *) H5MM_free(collective_chunk_list); } /* end for */ } /* end if */ else { /* Filtered collective read */ @@ -2245,117 +2037,7 @@ if(H5DEBUG(D)) } /* end for */ } /* end else */ -#if 0 - /* Loop over _all_ the chunks */ - for (u = 0; u < total_chunk; u++) { - H5D_chunk_info_t *chunk_info; /* Chunk info for current chunk */ - H5S_t *fspace; /* Dataspace describing chunk & selection in it */ - H5S_t *mspace; /* Dataspace describing selection in memory corresponding to this chunk */ - hbool_t insert = FALSE; - - /* Initialize temporary contiguous storage address */ - ctg_store.contig.dset_addr = chunk_addr[u]; - -#ifdef H5D_DEBUG -if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u); -#endif - /* Get the chunk info for this chunk, if there are elements selected */ - chunk_info = &filtered_io_info_array[u].chunk_info; - - /* Set the storage information for chunks with selections */ - if (chunk_info) { - /* HDassert(chunk_info->index == u); */ - - /* Pass in chunk's coordinates in a union. */ - store.chunk.scaled = chunk_info->scaled; - } /* end if */ - - /* Collective IO for this chunk, - * Note: even there is no selection for this process, the process still - * needs to contribute MPI NONE TYPE. - */ - if (chunk_io_option[u] == H5D_CHUNK_IO_MODE_COL) { -#ifdef H5D_DEBUG -if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"inside collective chunk IO mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u); -#endif - - /* Set the file & memory dataspaces */ - if (chunk_info) { - fspace = chunk_info->fspace; - mspace = chunk_info->mspace; - - /* Update the local variable tracking the dxpl's actual io mode property. - * - * Note: H5D_MPIO_COLLECTIVE_MULTI | H5D_MPIO_INDEPENDENT = H5D_MPIO_MIXED - * to ease switching between to mixed I/O without checking the current - * value of the property. You can see the definition in H5Ppublic.h - */ - actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_COLLECTIVE; - - } /* end if */ - else { - fspace = mspace = NULL; - } /* end else */ - - /* Switch back to collective I/O */ - if (last_xfer_mode != H5FD_MPIO_COLLECTIVE) { - if (H5D__ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to collective I/O") - last_xfer_mode = H5FD_MPIO_COLLECTIVE; - } /* end if */ - if (last_coll_opt_mode != H5FD_MPIO_COLLECTIVE_IO) { - if (H5D__ioinfo_coll_opt_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE_IO) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to collective I/O") - last_coll_opt_mode = H5FD_MPIO_COLLECTIVE_IO; - } /* end if */ - } /* end if */ - else { /* possible independent IO for this chunk */ -#ifdef H5D_DEBUG -if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"inside independent IO mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u); -#endif - - HDassert(chunk_io_option[u] == 0); - - /* Set the file & memory dataspaces */ - if (chunk_info) { - fspace = chunk_info->fspace; - mspace = chunk_info->mspace; - - /* Update the local variable tracking the dxpl's actual io mode. */ - actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_INDEPENDENT; - } /* end if */ - else { - fspace = mspace = NULL; - } /* end else */ - - /* Using independent I/O with file setview.*/ - if (last_coll_opt_mode != H5FD_MPIO_INDIVIDUAL_IO) { - if (H5D__ioinfo_coll_opt_mode(io_info, dx_plist, H5FD_MPIO_INDIVIDUAL_IO) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to individual I/O") - last_coll_opt_mode = H5FD_MPIO_INDIVIDUAL_IO; - } /* end if */ - } /* end else */ - -#ifdef H5D_DEBUG - if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"after inter collective IO\n"); -#endif - } /* end for */ -#endif - - /* Write the local value of actual io mode to the DXPL. */ - if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") - done: - if (chunk_io_option) - H5MM_free(chunk_io_option); - if (chunk_addr) - H5MM_free(chunk_addr); - if (mem_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) if (file_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) @@ -2371,10 +2053,8 @@ done: if (num_chunks_selected_array) H5MM_free(num_chunks_selected_array); - if (gathered_array) - H5MM_free(gathered_array); - if (mem_iter) - H5MM_free(mem_iter); + if (collective_chunk_list) + H5MM_free(collective_chunk_list); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__multi_chunk_filtered_collective_io() */ @@ -2968,7 +2648,10 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ H5D_filtered_collective_io_info_t *local_info_array = NULL; H5D_filtered_collective_io_info_t *overlap_array = NULL; H5SL_node_t *chunk_node; + MPI_Request *send_requests = NULL; + MPI_Status *send_statuses = NULL; hbool_t no_overlap = FALSE; + size_t num_send_requests; size_t num_chunks_selected; size_t overlap_array_num_entries; size_t *num_chunks_selected_array = NULL; @@ -3050,14 +2733,17 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Redistribute chunks to new owners as necessary */ if (!no_overlap && (io_info->op_type == H5D_IO_OP_WRITE)) { - size_t i; + size_t i; + + if (NULL == (send_requests = H5MM_malloc(num_chunks_selected * sizeof(*send_requests)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send requests buffer") if (H5D__mpio_array_gather(io_info, local_info_array, num_chunks_selected, sizeof(*local_info_array), &overlap_array, &overlap_array_num_entries, H5D__cmp_filtered_collective_io_entry) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't ") - for (i = 0, num_chunks_selected = 0; i < overlap_array_num_entries;) { + for (i = 0, num_chunks_selected = 0, num_send_requests = 0; i < overlap_array_num_entries;) { H5D_filtered_collective_io_info_t chunk_entry; haddr_t chunk_addr = overlap_array[i].old_chunk.offset; size_t num_writers = 0; @@ -3068,7 +2754,9 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ * to the same chunk */ do { /* Store the correct chunk entry information in case this process - * become's the new chunk's owner */ + * becomes the new chunk's owner. The chunk entry that this process + * contributed will be the only one with a valid dataspace selection + * on this particular process */ if (mpi_rank == overlap_array[i].owner) chunk_entry = overlap_array[i]; @@ -3092,16 +2780,19 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* New owner takes possession of the chunk */ overlap_array[num_chunks_selected++] = chunk_entry; - } + } /* end if */ else { /* Send modification data to new owner */ - } + /* if (MPI_SUCCESS != (mpi_code= MPI_Isend(, , , new_owner, + chunk_entry.old_chunk.offset, io_info->comm, &send_requests[num_send_requests++]))) + HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) */ + } /* end else */ #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "Chunk at address %a re-assigned to process %d.\n", chunk_addr, new_owner); #endif - } + } /* end for */ /* Release old list */ if (local_info_array) @@ -3147,7 +2838,22 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ *num_entries = num_chunks_selected; *_num_chunks_selected_array = num_chunks_selected_array; + /* Wait for all async send requests to complete before returning */ + if (!no_overlap && num_send_requests) { + if (NULL == (send_statuses = (MPI_Status *) H5MM_malloc(num_send_requests * sizeof(*send_statuses)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send statuses buffer") + + if (MPI_SUCCESS != (mpi_code = MPI_Waitall(num_send_requests, send_requests, send_statuses))) + HMPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code) + } + + done: + if (send_requests) + H5MM_free(send_requests); + if (send_statuses) + H5MM_free(send_statuses); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__construct_filtered_io_info_list() */ @@ -3255,5 +2961,127 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__mpio_filtered_collective_write_type() */ + + +static herr_t +H5D__update_filtered_collective_chunk_entry(H5D_filtered_collective_io_info_t *chunk_entry, + H5D_io_info_t *io_info, H5D_type_info_t *type_info) +{ + H5S_sel_iter_t *mem_iter = NULL; + unsigned filter_mask; + hssize_t iter_nelmts; + hbool_t full_overwrite = TRUE; + hbool_t mem_iter_init = FALSE; + size_t buf_size; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + HDassert(chunk_entry); + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Chunk at address %a:\n", chunk_entry->old_chunk.offset); +#endif + + /* XXX: Determine if a chunk is being fully overwritten by looking at the total selection + * in the dataspace */ + + /* If this is a full overwrite of this chunk, enough memory must be allocated for + * the size of the unfiltered chunk. Otherwise, enough memory must be allocated + * to read the filtered chunk from the file. */ + /* XXX: Return value of macro should be checked instead */ + buf_size = (full_overwrite) ? (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_entry->chunk_info.fspace) * type_info->src_type_size + : chunk_entry->old_chunk.length; + chunk_entry->new_chunk.length = buf_size; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Allocing %zd bytes for %s chunk overwrite buffer.\n", buf_size, + full_overwrite ? "full" : "non-full"); +#endif + + if (NULL == (chunk_entry->buf = H5MM_malloc(buf_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification buffer") + + if (!full_overwrite) { + /* Read the chunk from the file */ + if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_entry->old_chunk.offset, + buf_size, H5AC_rawdata_dxpl_id, chunk_entry->buf) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") + + /* Unfilter the chunk before modifying it */ + if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, + io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, + (size_t *) &chunk_entry->new_chunk.length, &buf_size, &chunk_entry->buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "couldn't unfilter chunk for modifying") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - After decompression: Nbytes=%zd; Buf_size=%zd.\n", chunk_entry->new_chunk.length, buf_size); + + HDfprintf(debug_file, "| - Read buf:\n| - ["); + for (size_t j = 0; j < chunk_entry->new_chunk.length / type_info->src_type_size; j++) { + if (j > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) chunk_entry->buf)[j]); + } + HDfprintf(debug_file, "]\n|\n"); +#endif + } /* end if */ + + /* Owner of this chunk, receive modification data from other processes */ + + /* Update the chunk data with the modifications from the current (owning) process */ + + if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") + + /* Initialize iterator for memory selection */ + if (H5S_select_iter_init(mem_iter, chunk_entry->chunk_info.mspace, type_info->dst_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") + mem_iter_init = TRUE; + + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_entry->chunk_info.mspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + + if (!H5D__gather_mem(io_info->u.wbuf, chunk_entry->chunk_info.mspace, mem_iter, + (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather from write buffer") + + /* Update the chunk data with any modifications from other processes */ + + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Write Buffer:\n"); + HDfprintf(debug_file, "| - ["); + for (size_t j = 0; j < chunk_entry->new_chunk.length / type_info->src_type_size; j++) { + if (j > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) chunk_entry->buf)[j]); + } + HDfprintf(debug_file, "]\n|\n"); + + HDfprintf(debug_file, "| - Write buf is at address %a.\n|\n", chunk_entry->buf); + + HDfprintf(debug_file, "| - About to filter %zd bytes in buffer of size %zd.\n|\n", chunk_entry->new_chunk.length, buf_size); +#endif + + /* Filter the chunk */ + filter_mask = 0; + if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, + io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, + (size_t *) &chunk_entry->new_chunk.length, &buf_size, &chunk_entry->buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") + +#if H5_SIZEOF_SIZE_T > 4 + /* Check for the chunk expanding too much to encode in a 32-bit value */ + if (chunk_entry->new_chunk.length > ((size_t) 0xffffffff)) + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") +#endif + +done: + if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + if (mem_iter) + H5MM_free(mem_iter) + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__update_filtered_collective_chunk_entry() */ #endif /* H5_HAVE_PARALLEL */ -- cgit v0.12 From 9bb49c6b0568a5e5d87c63e28ebfea147a35b80f Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 18 Jan 2017 17:09:17 -0600 Subject: Update documentation for link and multi chunk IO --- src/H5Dmpio.c | 89 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 46 insertions(+), 43 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index aa95a3a..ae68789 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1260,36 +1260,38 @@ if(H5DEBUG(D)) * operation * A. If any chunk is being written to by more than 1 * process, the process writing the most data to the - * chunk will take ownership of the chunk (ties are - * broken randomly) + * chunk will take ownership of the chunk (the first + * process seen that is writing the most data becomes + * the new owner in the case of ties) * 2. If the operation is a write operation * A. Loop through each chunk in the operation - * I. Determine if this is a full overwrite of the chunk - * a) If it is not, read the chunk from file and - * pass the chunk through the filter pipeline in - * reverse order (Unfilter the chunk) - * b) Else copy the owning process' modification - * data into a buffer of size large enough to - * completely overwrite the chunk - * II. Receive any modification data from other + * I. If this is not a full overwrite of the chunk + * a) Read the chunk from file and pass the chunk + * through the filter pipeline in reverse order + * (Unfilter the chunk) + * II. Update the chunk data with the modifications from + * the owning process + * III. Receive any modification data from other * processes and update the chunk data with these * modifications - * III. Filter the chunk + * IV. Filter the chunk * B. Contribute the modified chunks to an array gathered * by all processes which contains the new sizes of * every chunk modified in the collective IO operation * C. All processes collectively re-allocate each chunk * from the gathered array with their new sizes after * the filter operation - * D. Create an MPI derived type for memory and file to - * write out the process' selected chunks to the file + * D. If this process has any chunks selected in the IO + * operation, create an MPI derived type for memory and + * file to write out the process' selected chunks to the + * file + * E. Perform the collective write + * F. All processes collectively re-insert each modified + * chunk from the gathered array into the chunk index * 3. If the operation is a read operation * A. Loop through each chunk in the operation * I. - * 3. Proceeed with the collective IO operation - * 4. If the collective operation was a write operation, - * all processes collectively re-insert each modified - * chunk from the gathered array into the chunk index + * * * Return: Non-negative on success/Negative on failure * @@ -1747,35 +1749,36 @@ done: * operation * A. If any chunk is being written to by more than 1 * process, the process writing the most data to the - * chunk will take ownership of the chunk (ties are - * broken randomly) - * 2. Loop through each chunk in the operation - * A. If the operation is a write operation - * I. Determine if this is a full overwrite of the chunk - * a) If it is not, read the chunk from file and - * pass the chunk through the filter pipeline in - * reverse order (Unfilter the chunk) - * b) Else copy the owning process' modification - * data into a buffer of size large enough to - * completely overwrite the chunk - * II. Receive any modification data from other + * chunk will take ownership of the chunk (the first + * process seen that is writing the most data becomes + * the new owner in the case of ties) + * 2. If the operation is a write operation + * A. Loop through each chunk in the operation + * I. If this is not a full overwrite of the chunk + * a) Read the chunk from file and pass the chunk + * through the filter pipeline in reverse order + * (Unfilter the chunk) + * II. Update the chunk data with the modifications from + * the owning process + * III. Receive any modification data from other * processes and update the chunk data with these * modifications * III. Filter the chunk - * IV. Contribute the chunk to an array gathered by - * all processes which contains every chunk - * modified in this iteration (up to one chunk - * per process, some processes may not have a - * selection/may have less chunks to work on than - * other processes) - * II. All processes collectively re-allocate each - * chunk from the gathered array with their new - * sizes after the filter operation - * IV. Proceed with the collective write operation - * V. All processes collectively re-insert each - * chunk from the gathered array into the chunk - * index - * B. If the operation is a read operation + * IV. Contribute the chunk to an array gathered by + * all processes which contains every chunk + * modified in this iteration (up to one chunk + * per process, some processes may not have a + * selection/may have less chunks to work on than + * other processes) + * II. All processes collectively re-allocate each + * chunk from the gathered array with their new + * sizes after the filter operation + * IV. Proceed with the collective write operation + * for the chunks modified on this iteration + * V. All processes collectively re-insert each + * chunk from the gathered array into the chunk + * index + * 3. If the operation is a read operation * I. * * Return: Non-negative on success/Negative on failure -- cgit v0.12 From 2c8bddb4ab08427baafd2d205e6157a163da1fd5 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 18 Jan 2017 17:36:07 -0600 Subject: Clean up const and other warnings Add notes about need for another minor error code --- src/H5Dmpio.c | 58 ++++++++++++++++++++++++++++------------------------------ 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index ae68789..b223203 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -150,7 +150,7 @@ static herr_t H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm, H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries, size_t **_num_chunks_selected_array); -static herr_t H5D__mpio_array_gather(H5D_io_info_t *io_info, void *local_array, +static herr_t H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, size_t array_num_entries, size_t array_entry_size, void **gathered_array, size_t *gathered_array_num_entries, int (*sort_func)(const void *, const void *)); @@ -159,8 +159,8 @@ static herr_t H5D__mpio_filtered_collective_write_type( MPI_Datatype *new_mem_type, hbool_t *mem_type_derived, MPI_Datatype *new_file_type, hbool_t *file_type_derived); static herr_t H5D__update_filtered_collective_chunk_entry( - H5D_filtered_collective_io_info_t *chunk_entry, H5D_io_info_t *io_info, - H5D_type_info_t *type_info); + H5D_filtered_collective_io_info_t *chunk_entry, const H5D_io_info_t *io_info, + const H5D_type_info_t *type_info); static int H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2); static int H5D__cmp_filtered_collective_io_entry(const void *filtered_collective_io_entry1, const void *filtered_collective_io_entry2); @@ -350,7 +350,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__mpio_array_gather(H5D_io_info_t *io_info, void *local_array, +H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, size_t array_num_entries, size_t array_entry_size, void **_gathered_array, size_t *_gathered_array_num_entries, int (*sort_func)(const void *, const void *)) @@ -1342,13 +1342,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries, &num_chunks_selected_array) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't construct filtered I/O info list") - /* If this process has any selection at all in the dataspace, create - * a MPI type for the I/O operation. Otherwise, the process contributes - * with a none type. */ - /* XXX: Processes with no selection will have to be re-worked, as they - * still have to do the re-allocation in the file. Get rid of else case - * and instead change mpi_buf_count to 0 if they have no selection - */ #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "Incoming messages from other processes:\n"); HDfprintf(debug_file, "-----------------------------------------\n"); @@ -1396,6 +1389,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* Gather the new chunk sizes to all processes for a collective reallocation * of the chunks in the file */ + /* XXX: change minor error code */ if (H5D__mpio_array_gather(io_info, chunk_list, chunk_list_num_entries, sizeof(*chunk_list), (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") @@ -1451,6 +1445,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HDmemcpy(chunk_list, &((char *) collective_chunk_list)[offset], num_chunks_selected_array[mpi_rank] * sizeof(H5D_filtered_collective_io_info_t)); /* Create single MPI type encompassing each selection in the dataspace */ + /* XXX: change minor error code */ if (H5D__mpio_filtered_collective_write_type(chunk_list, chunk_list_num_entries, &mem_type, &mem_type_is_derived, &file_type, &file_type_is_derived) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't create MPI link chunk I/O type") @@ -1828,6 +1823,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk io mode property") /* Build a list of selected chunks in the collective IO operation */ + /* XXX: change minor error code */ if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries, &num_chunks_selected_array) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't construct filtered I/O info list") @@ -1893,6 +1889,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i * in this iteration. Gather the new chunk sizes to all processes for * the collective re-allocation. */ /* XXX: May access unavailable memory on processes with no selection */ + /* XXX: change minor error code */ if (H5D__mpio_array_gather(io_info, &chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(*chunk_list), (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") @@ -2649,14 +2646,14 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ size_t **_num_chunks_selected_array) { H5D_filtered_collective_io_info_t *local_info_array = NULL; - H5D_filtered_collective_io_info_t *overlap_array = NULL; + H5D_filtered_collective_io_info_t *overlap_info_array = NULL; H5SL_node_t *chunk_node; MPI_Request *send_requests = NULL; MPI_Status *send_statuses = NULL; hbool_t no_overlap = FALSE; size_t num_send_requests; size_t num_chunks_selected; - size_t overlap_array_num_entries; + size_t overlap_info_array_num_entries; size_t *num_chunks_selected_array = NULL; int mpi_rank, mpi_size, mpi_code; herr_t ret_value = SUCCEED; @@ -2738,17 +2735,18 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (!no_overlap && (io_info->op_type == H5D_IO_OP_WRITE)) { size_t i; - if (NULL == (send_requests = H5MM_malloc(num_chunks_selected * sizeof(*send_requests)))) + if (NULL == (send_requests = (MPI_Request *) H5MM_malloc(num_chunks_selected * sizeof(*send_requests)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send requests buffer") + /* XXX: Change minor error code */ if (H5D__mpio_array_gather(io_info, local_info_array, num_chunks_selected, - sizeof(*local_info_array), &overlap_array, &overlap_array_num_entries, + sizeof(*local_info_array), (void **) &overlap_info_array, &overlap_info_array_num_entries, H5D__cmp_filtered_collective_io_entry) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't ") - for (i = 0, num_chunks_selected = 0, num_send_requests = 0; i < overlap_array_num_entries;) { + for (i = 0, num_chunks_selected = 0, num_send_requests = 0; i < overlap_info_array_num_entries;) { H5D_filtered_collective_io_info_t chunk_entry; - haddr_t chunk_addr = overlap_array[i].old_chunk.offset; + haddr_t chunk_addr = overlap_info_array[i].old_chunk.offset; size_t num_writers = 0; size_t max_bytes = 0; int new_owner = 0; @@ -2760,21 +2758,21 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ * becomes the new chunk's owner. The chunk entry that this process * contributed will be the only one with a valid dataspace selection * on this particular process */ - if (mpi_rank == overlap_array[i].owner) - chunk_entry = overlap_array[i]; + if (mpi_rank == overlap_info_array[i].owner) + chunk_entry = overlap_info_array[i]; /* New owner of the chunk is determined by the process * which is writing the most data to the chunk */ - if (overlap_array[i].io_size > max_bytes) { - max_bytes = overlap_array[i].io_size; - new_owner = overlap_array[i].owner; + if (overlap_info_array[i].io_size > max_bytes) { + max_bytes = overlap_info_array[i].io_size; + new_owner = overlap_info_array[i].owner; } num_writers++; i++; - if (i == overlap_array_num_entries) break; - } while (overlap_array[i].old_chunk.offset == chunk_addr); + if (i == overlap_info_array_num_entries) break; + } while (overlap_info_array[i].old_chunk.offset == chunk_addr); if (mpi_rank == new_owner) { /* Make sure the new owner will know how many other processes will @@ -2782,7 +2780,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ chunk_entry.num_writers = num_writers; /* New owner takes possession of the chunk */ - overlap_array[num_chunks_selected++] = chunk_entry; + overlap_info_array[num_chunks_selected++] = chunk_entry; } /* end if */ else { /* Send modification data to new owner */ @@ -2802,7 +2800,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ H5MM_free(local_info_array); /* Local info list becomes modified (redistributed) chunk list */ - local_info_array = overlap_array; + local_info_array = overlap_info_array; #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "This process now has %d chunks selected after redistribution.\n\n", num_chunks_selected); @@ -2819,14 +2817,14 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ } HDfprintf(debug_file, "------------------------------\n\n"); #endif - } + } /* end if */ /* Gather the number of chunks each process is writing to all processes */ if (NULL == (num_chunks_selected_array = (size_t *) H5MM_malloc((size_t) mpi_size * sizeof(*num_chunks_selected_array)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate num chunks selected array") if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&num_chunks_selected, 1, MPI_UNSIGNED_LONG_LONG, num_chunks_selected_array, 1, MPI_UNSIGNED_LONG_LONG, io_info->comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Allgather of num chunks selected array failed", mpi_code) + HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, " Num Chunks Selected Array\n"); @@ -2968,7 +2966,7 @@ done: static herr_t H5D__update_filtered_collective_chunk_entry(H5D_filtered_collective_io_info_t *chunk_entry, - H5D_io_info_t *io_info, H5D_type_info_t *type_info) + const H5D_io_info_t *io_info, const H5D_type_info_t *type_info) { H5S_sel_iter_t *mem_iter = NULL; unsigned filter_mask; @@ -3046,7 +3044,7 @@ H5D__update_filtered_collective_chunk_entry(H5D_filtered_collective_io_info_t *c if (!H5D__gather_mem(io_info->u.wbuf, chunk_entry->chunk_info.mspace, mem_iter, (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf)) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather from write buffer") + HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't gather from write buffer") /* Update the chunk data with any modifications from other processes */ -- cgit v0.12 From 740e85a82dc01ce6ea62d86bef557e31012a0695 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 19 Jan 2017 11:54:07 -0600 Subject: Code refactoring Modify single chunk entry function to handle both read and write cases Store array of MPI derived types in Multi-chunk IO so that all freeing can be done at end instead of during processing Add read support for Multi-chunk IO only currently --- src/H5Dmpio.c | 354 ++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 197 insertions(+), 157 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index b223203..6d97cb1 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -158,9 +158,8 @@ static herr_t H5D__mpio_filtered_collective_write_type( H5D_filtered_collective_io_info_t *chunk_list, size_t num_entries, MPI_Datatype *new_mem_type, hbool_t *mem_type_derived, MPI_Datatype *new_file_type, hbool_t *file_type_derived); -static herr_t H5D__update_filtered_collective_chunk_entry( - H5D_filtered_collective_io_info_t *chunk_entry, const H5D_io_info_t *io_info, - const H5D_type_info_t *type_info); +static herr_t H5D__filtered_collective_chunk_io(H5D_filtered_collective_io_info_t *chunk_entry, + const H5D_io_info_t *io_info, const H5D_type_info_t *type_info); static int H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2); static int H5D__cmp_filtered_collective_io_entry(const void *filtered_collective_io_entry1, const void *filtered_collective_io_entry2); @@ -390,10 +389,10 @@ H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) /* Multiply each receive count by the size of the array entry, - * since the data is sent in a count of bytes */ - /* XXX: Check to make sure array_entry_size doesn't overflow an int */ + * since the data is sent in a count of bytes + */ for (i = 0; i < (size_t) mpi_size; i++) - receive_counts_array[i] *= array_entry_size; + H5_CHECKED_ASSIGN(receive_counts_array[i], int, (size_t) receive_counts_array[i] * array_entry_size, size_t); /* Set receive buffer offsets for MPI_Allgatherv */ displacements_array[0] = 0; @@ -572,9 +571,6 @@ H5D__mpio_get_sum_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, H5_CHECKED_ASSIGN(num_chunkf, int, ori_num_chunkf, size_t); /* Determine the summation of number of chunks for all processes */ - /* XXX: In the case that more than one process is writing to the - * same chunk, the summation of H5SL_count calls is incorrect. - JTH - */ if(MPI_SUCCESS != (mpi_code = MPI_Allreduce(&num_chunkf, sum_chunkf, 1, MPI_INT, MPI_SUM, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) @@ -1305,18 +1301,18 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) { H5D_filtered_collective_io_info_t *chunk_list = NULL; /* The list of chunks being read/written */ - H5D_filtered_collective_io_info_t *collective_chunk_list = NULL; - H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode = H5D_MPIO_LINK_CHUNK; - H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CHUNK_COLLECTIVE; - H5D_storage_t ctg_store; + H5D_filtered_collective_io_info_t *collective_chunk_list = NULL; /* The list of chunks used during collective operations */ + H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode = H5D_MPIO_LINK_CHUNK; /* The actual chunk IO optimization mode */ + H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CHUNK_COLLECTIVE; /* The chunk IO mode used (Independent vs Collective) */ + H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ MPI_Datatype mem_type = MPI_BYTE; MPI_Datatype file_type = MPI_BYTE; hbool_t mem_type_is_derived = FALSE; hbool_t file_type_is_derived = FALSE; size_t chunk_list_num_entries; size_t collective_chunk_list_num_entries; - size_t *num_chunks_selected_array = NULL; - size_t i; + size_t *num_chunks_selected_array = NULL; /* Array of number of chunks selected on each process */ + size_t i; /* Local index variable */ int mpi_rank, mpi_size, mpi_code; herr_t ret_value = SUCCEED; @@ -1333,7 +1329,8 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") /* Set the actual-io-mode property. - * Link chunk I/O does not break to independent, so can set right away */ + * Link chunk filtered I/O does not break to independent, so can set right away + */ if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") @@ -1377,18 +1374,20 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* Iterate through all the chunks in the collective write operation, * updating each chunk with the data modifications from other processes, - * then re-filtering the chunk. */ + * then re-filtering the chunk. + */ /* XXX: Not sure about minor error code */ for (i = 0; i < chunk_list_num_entries; i++) - if (H5D__update_filtered_collective_chunk_entry(&chunk_list[i], io_info, type_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't update filtered chunk entry") + if (H5D__filtered_collective_chunk_io(&chunk_list[i], io_info, type_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't process chunk entry") #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "---------------------------------------------------\n\n"); #endif /* Gather the new chunk sizes to all processes for a collective reallocation - * of the chunks in the file */ + * of the chunks in the file. + */ /* XXX: change minor error code */ if (H5D__mpio_array_gather(io_info, chunk_list, chunk_list_num_entries, sizeof(*chunk_list), (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) @@ -1422,7 +1421,8 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* If this process has any chunks selected, create a MPI type for collectively * writing out the chunks to file. Otherwise, the process contributes to the - * collective write with a none type. */ + * collective write with a none type. + */ if (chunk_list_num_entries) { size_t offset; @@ -1436,13 +1436,10 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in * This works correctly because the array gather function guarantees that the chunk * data in the total array is ordered in blocks by rank. */ - /* XXX: No need to use bytes here, should be able to simply find offset in - * terms of H5D_filtered_collective_io_info_t's */ - offset = 0; - for (i = 0; i < (size_t) mpi_rank; i++) - offset += num_chunks_selected_array[i] * sizeof(H5D_filtered_collective_io_info_t); + for (i = 0, offset = 0; i < (size_t) mpi_rank; i++) + offset += num_chunks_selected_array[i]; - HDmemcpy(chunk_list, &((char *) collective_chunk_list)[offset], num_chunks_selected_array[mpi_rank] * sizeof(H5D_filtered_collective_io_info_t)); + HDmemcpy(chunk_list, &collective_chunk_list[offset], num_chunks_selected_array[mpi_rank] * sizeof(H5D_filtered_collective_io_info_t)); /* Create single MPI type encompassing each selection in the dataspace */ /* XXX: change minor error code */ @@ -1451,7 +1448,8 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't create MPI link chunk I/O type") /* Override the write buffer to point to the address of the first - * chunk data buffer */ + * chunk data buffer + */ io_info->u.wbuf = chunk_list[0].buf; } /* end if */ @@ -1467,7 +1465,8 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") /* Participate in the collective re-insertion of all chunks modified - * in this iteration into the chunk index */ + * in this iteration into the chunk index + */ #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "Reinserting chunks into chunk index.\n"); HDfprintf(debug_file, "---------------------------------------\n"); @@ -1747,7 +1746,9 @@ done: * chunk will take ownership of the chunk (the first * process seen that is writing the most data becomes * the new owner in the case of ties) - * 2. If the operation is a write operation + * 2. If the operation is a read operation + * A. + * 3. If the operation is a write operation * A. Loop through each chunk in the operation * I. If this is not a full overwrite of the chunk * a) Read the chunk from file and pass the chunk @@ -1773,8 +1774,6 @@ done: * V. All processes collectively re-insert each * chunk from the gathered array into the chunk * index - * 3. If the operation is a read operation - * I. * * Return: Non-negative on success/Negative on failure * @@ -1788,19 +1787,19 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) { H5D_filtered_collective_io_info_t *chunk_list = NULL; /* The list of chunks being read/written */ - H5D_filtered_collective_io_info_t *collective_chunk_list = NULL; - H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode = H5D_MPIO_MULTI_CHUNK; /* actual chunk optimization mode */ - H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CHUNK_COLLECTIVE; /* Local variable for tracking the I/O mode used. */ + H5D_filtered_collective_io_info_t *collective_chunk_list = NULL; /* The list of chunks used during collective operations */ + H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode = H5D_MPIO_MULTI_CHUNK; /* The actual chunk IO optimization mode */ + H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CHUNK_COLLECTIVE; /* The chunk IO mode used (Independent vs Collective) */ H5D_storage_t store; /* union of EFL and chunk pointer in file space */ H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ - MPI_Datatype file_type = MPI_BYTE; - MPI_Datatype mem_type = MPI_BYTE; - hbool_t file_type_is_derived = FALSE; - hbool_t mem_type_is_derived = FALSE; + MPI_Datatype *file_type_array = NULL; + MPI_Datatype *mem_type_array = NULL; + hbool_t *file_type_is_derived_array = NULL; + hbool_t *mem_type_is_derived_array = NULL; size_t chunk_list_num_entries; size_t collective_chunk_list_num_entries; - size_t *num_chunks_selected_array = NULL; + size_t *num_chunks_selected_array = NULL; /* Array of number of chunks selected on each process */ size_t i, j; /* Local index variable */ int mpi_rank, mpi_size, mpi_code; herr_t ret_value = SUCCEED; @@ -1817,8 +1816,9 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") - /* Set the actual_io_mode property. Filtered collective writes can't break - * to independent, so set actual_io_mode right away */ + /* Set the actual_io_mode property. + * Multi chunk I/O does not break to independent, so can set right away + */ if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk io mode property") @@ -1839,7 +1839,13 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Set dataset storage for I/O info */ io_info->store = &store; - if (io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ + if (io_info->op_type == H5D_IO_OP_READ) { /* Filtered collective read */ + /* XXX: Change minor error code */ + for (i = 0; i < chunk_list_num_entries; i++) + if (H5D__filtered_collective_chunk_io(&chunk_list[i], io_info, type_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't process chunk entry") + } /* end if */ + else { /* Filtered collective write */ H5D_chk_idx_info_t index_info; H5D_chunk_ud_t udata; size_t max_num_chunks; @@ -1870,24 +1876,42 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i HDfprintf(debug_file, "---------------------------------------------------\n"); #endif + /* Retrieve the maximum number of chunks being written among all processes */ if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&chunk_list_num_entries, &max_num_chunks, 1, MPI_UNSIGNED_LONG_LONG, MPI_MAX, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) - /* XXX: Iteration should be for the max number among processes, since a process could - * have no chunks assigned to it */ + /* Allocate arrays for storing MPI file and mem types and whether or not the + * types were derived. + */ + if (NULL == (file_type_array = (MPI_Datatype *) H5MM_malloc(max_num_chunks * sizeof(*file_type_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate file type array") + + if (NULL == (file_type_is_derived_array = (hbool_t *) H5MM_calloc(max_num_chunks * sizeof(*file_type_is_derived_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate file type is derived array") + + if (NULL == (mem_type_array = (MPI_Datatype *) H5MM_malloc(max_num_chunks * sizeof(*mem_type_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate mem type array") + + if (NULL == (mem_type_is_derived_array = (hbool_t *) H5MM_calloc(max_num_chunks * sizeof(*mem_type_is_derived_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate mem type is derived array") + + /* Iterate over the max number of chunks among all processes, as this process could + * have no chunks left to work on, but it still needs to participate in the collective + * re-allocation and re-insertion of chunks modified by other processes. + */ for (i = 0; i < max_num_chunks; i++) { /* Check if this process has a chunk to work on for this iteration */ hbool_t have_chunk_to_process = i < chunk_list_num_entries; /* XXX: Not sure about minor error code */ if (have_chunk_to_process) - if (H5D__update_filtered_collective_chunk_entry(&chunk_list[i], io_info, type_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't update filtered chunk entry") + if (H5D__filtered_collective_chunk_io(&chunk_list[i], io_info, type_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't process chunk entry") - /* Participate in the collective re-allocation of all chunks modified - * in this iteration. Gather the new chunk sizes to all processes for - * the collective re-allocation. */ + /* Gather the new chunk sizes to all processes for a collective re-allocation + * of the chunks in the file + */ /* XXX: May access unavailable memory on processes with no selection */ /* XXX: change minor error code */ if (H5D__mpio_array_gather(io_info, &chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(*chunk_list), @@ -1899,16 +1923,17 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i HDfprintf(debug_file, "------------------------------\n"); #endif - /* Collectively re-allocate the modified chunks (from each process) in the file */ + /* Participate in the collective re-allocation of all chunks modified + * in this iteration. + */ for (j = 0; j < collective_chunk_list_num_entries; j++) { hbool_t insert = FALSE; #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "| Re-allocing chunk at address %a with new length of %llu bytes.\n", - collective_chunk_list[j].new_chunk.offset, collective_chunk_list[j].new_chunk.length); + collective_chunk_list[j].new_chunk.offset, collective_chunk_list[j].new_chunk.length); #endif - /* Collectively re-allocate the chunk in the file */ if (H5D__chunk_file_alloc(&index_info, &collective_chunk_list[j].old_chunk, &collective_chunk_list[j].new_chunk, &insert, chunk_list[j].chunk_info.scaled) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") @@ -1923,7 +1948,8 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i #endif /* If this process has a chunk to work on, create a MPI type for the - * memory and file for writing out the chunk */ + * memory and file for writing out the chunk + */ if (have_chunk_to_process) { int mpi_type_count; @@ -1938,35 +1964,37 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i H5_CHECKED_ASSIGN(mpi_type_count, int, chunk_list[i].new_chunk.length, hsize_t); /* Create MPI memory type for writing to chunk */ - if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(mpi_type_count, MPI_BYTE, &mem_type))) + if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(mpi_type_count, MPI_BYTE, &mem_type_array[i]))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&mem_type))) + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&mem_type_array[i]))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) - mem_type_is_derived = TRUE; + mem_type_is_derived_array[i] = TRUE; /* Create MPI file type for writing to chunk */ - if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(mpi_type_count, MPI_BYTE, &file_type))) + if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(mpi_type_count, MPI_BYTE, &file_type_array[i]))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&file_type))) + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&file_type_array[i]))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) - file_type_is_derived = TRUE; + file_type_is_derived_array[i] = TRUE; /* Set up the base storage address for this operation */ ctg_store.contig.dset_addr = chunk_list[i].new_chunk.offset; /* Override the write buffer to point to the address of the - * chunk data buffer */ + * chunk data buffer + */ ctg_io_info.u.wbuf = chunk_list[i].buf; } /* end if */ - mpi_buf_count = (mem_type_is_derived && file_type_is_derived) ? 1 : 0; + mpi_buf_count = (mem_type_is_derived_array[i] && file_type_is_derived_array[i]) ? 1 : 0; /* Perform the I/O */ - if (H5D__final_collective_io(&ctg_io_info, type_info, mpi_buf_count, &file_type, &mem_type) < 0) + if (H5D__final_collective_io(&ctg_io_info, type_info, mpi_buf_count, &file_type_array[i], &mem_type_array[i]) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") /* Participate in the collective re-insertion of all chunks modified - * in this iteration into the chunk index */ + * in this iteration into the chunk index + */ #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "Reinserting chunks into chunk index.\n"); HDfprintf(debug_file, "---------------------------------------\n"); @@ -1988,61 +2016,23 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i HDfprintf(debug_file, "---------------------------------------\n"); #endif - /* Free the MPI memory and file type, if they were derived */ - /* XXX: For performance, collect each type into an array and free at end */ - if (mem_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - if (file_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - - mem_type_is_derived = FALSE; - file_type_is_derived = FALSE; - if (collective_chunk_list) collective_chunk_list = (H5D_filtered_collective_io_info_t *) H5MM_free(collective_chunk_list); } /* end for */ - } /* end if */ - else { /* Filtered collective read */ - unsigned filter_mask = 0; - size_t buf_size; - - for (i = 0; i < chunk_list_num_entries; i++) { - buf_size = chunk_list[i].old_chunk.length; - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Allocing %zd bytes for chunk read buffer.\n", buf_size); -#endif - - if (NULL == (chunk_list[i].buf = H5MM_malloc(buf_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk read buffer") - - /* Read the chunk from the file */ - if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_list[i].old_chunk.offset, - buf_size, H5AC_rawdata_dxpl_id, chunk_list[i].buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't read raw data chunk") - /* Unfilter the chunk before modifying it */ - if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, - io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, - (size_t *) &chunk_list[i].old_chunk.length, &buf_size, &chunk_list[i].buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "couldn't unfilter chunk for modifying") - -#ifdef PARALLEL_COMPRESS_DEBUG - for (size_t k = 0; k < chunk_list[i].old_chunk.length / type_info->src_type_size; k++) - HDfprintf(debug_file, "Read buf entry %d is %lld.\n", k, ((long *) chunk_list[i].buf)[k]); -#endif - - /* Scatter the unfiltered chunk data into the user's read buffer */ + /* Free the MPI file and memory types, if they were derived */ + for (i = 0; i < max_num_chunks; i++) { + if (file_type_is_derived_array[i]) + if (MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type_array[i]))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + if (mem_type_is_derived_array[i]) + if (MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type_array[i]))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) } /* end for */ } /* end else */ done: - if (mem_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - if (file_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - if (chunk_list) { for (i = 0; i < chunk_list_num_entries; i++) if (chunk_list[i].buf) @@ -2051,10 +2041,18 @@ done: H5MM_free(chunk_list); } - if (num_chunks_selected_array) - H5MM_free(num_chunks_selected_array); if (collective_chunk_list) H5MM_free(collective_chunk_list); + if (file_type_array) + H5MM_free(file_type_array); + if (mem_type_array) + H5MM_free(mem_type_array); + if (file_type_is_derived_array) + H5MM_free(file_type_is_derived_array); + if (mem_type_is_derived_array) + H5MM_free(mem_type_is_derived_array); + if (num_chunks_selected_array) + H5MM_free(num_chunks_selected_array); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__multi_chunk_filtered_collective_io() */ @@ -2752,17 +2750,20 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ int new_owner = 0; /* Process duplicate entries caused by another process writing - * to the same chunk */ + * to the same chunk + */ do { /* Store the correct chunk entry information in case this process * becomes the new chunk's owner. The chunk entry that this process * contributed will be the only one with a valid dataspace selection - * on this particular process */ + * on this particular process + */ if (mpi_rank == overlap_info_array[i].owner) chunk_entry = overlap_info_array[i]; /* New owner of the chunk is determined by the process - * which is writing the most data to the chunk */ + * which is writing the most data to the chunk + */ if (overlap_info_array[i].io_size > max_bytes) { max_bytes = overlap_info_array[i].io_size; new_owner = overlap_info_array[i].owner; @@ -2776,7 +2777,8 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (mpi_rank == new_owner) { /* Make sure the new owner will know how many other processes will - * be sending chunk modification data to it */ + * be sending chunk modification data to it + */ chunk_entry.num_writers = num_writers; /* New owner takes possession of the chunk */ @@ -2844,7 +2846,8 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (NULL == (send_statuses = (MPI_Status *) H5MM_malloc(num_send_requests * sizeof(*send_statuses)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send statuses buffer") - if (MPI_SUCCESS != (mpi_code = MPI_Waitall(num_send_requests, send_requests, send_statuses))) + H5_CHECK_OVERFLOW(num_send_requests, size_t, int); + if (MPI_SUCCESS != (mpi_code = MPI_Waitall((int) num_send_requests, send_requests, send_statuses))) HMPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code) } @@ -2964,12 +2967,24 @@ done: } /* end H5D__mpio_filtered_collective_write_type() */ +/*------------------------------------------------------------------------- + * Function: H5D__filtered_collective_chunk_io + * + * Purpose: XXX: description + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jordan Henderson + * Wednesday, January 18, 2017 + * + *------------------------------------------------------------------------- + */ static herr_t -H5D__update_filtered_collective_chunk_entry(H5D_filtered_collective_io_info_t *chunk_entry, +H5D__filtered_collective_chunk_io(H5D_filtered_collective_io_info_t *chunk_entry, const H5D_io_info_t *io_info, const H5D_type_info_t *type_info) { H5S_sel_iter_t *mem_iter = NULL; - unsigned filter_mask; + unsigned filter_mask = 0; hssize_t iter_nelmts; hbool_t full_overwrite = TRUE; hbool_t mem_iter_init = FALSE; @@ -2979,37 +2994,44 @@ H5D__update_filtered_collective_chunk_entry(H5D_filtered_collective_io_info_t *c FUNC_ENTER_STATIC HDassert(chunk_entry); + HDassert(io_info); + HDassert(type_info); #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "| Chunk at address %a:\n", chunk_entry->old_chunk.offset); #endif /* XXX: Determine if a chunk is being fully overwritten by looking at the total selection - * in the dataspace */ + * in the dataspace + */ - /* If this is a full overwrite of this chunk, enough memory must be allocated for - * the size of the unfiltered chunk. Otherwise, enough memory must be allocated - * to read the filtered chunk from the file. */ + /* If this is a read operation or a write operation where the chunk is not being fully + * overwritten, enough memory must be allocated to read the filtered chunk from the file. + * If this is a write operation where the chunk is being fully overwritten, enough memory + * must be allocated for the size of the unfiltered chunk. + */ /* XXX: Return value of macro should be checked instead */ - buf_size = (full_overwrite) ? (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_entry->chunk_info.fspace) * type_info->src_type_size - : chunk_entry->old_chunk.length; + buf_size = (!full_overwrite || io_info->op_type == H5D_IO_OP_READ) ? chunk_entry->old_chunk.length + : (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_entry->chunk_info.fspace) * type_info->src_type_size; chunk_entry->new_chunk.length = buf_size; #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Allocing %zd bytes for %s chunk overwrite buffer.\n", buf_size, - full_overwrite ? "full" : "non-full"); + HDfprintf(debug_file, "| - Allocing %zd bytes for chunk data buffer.\n", buf_size); + if (io_info->op_type == H5D_IO_OP_WRITE) + HDfprintf(debug_file, "| - Write type is: %s.\n", (full_overwrite) ? "overwrite" : "non-overwrite"); #endif if (NULL == (chunk_entry->buf = H5MM_malloc(buf_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification buffer") + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk data buffer") - if (!full_overwrite) { - /* Read the chunk from the file */ + /* If this is not a full chunk overwrite or this is a read operation, the chunk must be + * read from the file and unfiltered. + */ + if (!full_overwrite || io_info->op_type == H5D_IO_OP_READ) { if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_entry->old_chunk.offset, buf_size, H5AC_rawdata_dxpl_id, chunk_entry->buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") - /* Unfilter the chunk before modifying it */ if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, (size_t *) &chunk_entry->new_chunk.length, &buf_size, &chunk_entry->buf) < 0) @@ -3029,12 +3051,11 @@ H5D__update_filtered_collective_chunk_entry(H5D_filtered_collective_io_info_t *c /* Owner of this chunk, receive modification data from other processes */ - /* Update the chunk data with the modifications from the current (owning) process */ - if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") /* Initialize iterator for memory selection */ + /* XXX: dst_type_size may need to be src_type_size depending on operation */ if (H5S_select_iter_init(mem_iter, chunk_entry->chunk_info.mspace, type_info->dst_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") mem_iter_init = TRUE; @@ -3042,40 +3063,59 @@ H5D__update_filtered_collective_chunk_entry(H5D_filtered_collective_io_info_t *c if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_entry->chunk_info.mspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - if (!H5D__gather_mem(io_info->u.wbuf, chunk_entry->chunk_info.mspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf)) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't gather from write buffer") + /* If this is a read operation, scatter the read chunk data to the user's buffer. + * + * If this is a write operation, update the chunk data buffer with the modifications + * from the current process, then apply any modifications from other processes. Finally, + * filter the newly-update chunk. + */ + switch (io_info->op_type) { + case H5D_IO_OP_READ: + if (H5D__scatter_mem(chunk_entry->buf, chunk_entry->chunk_info.mspace, mem_iter, + (size_t) iter_nelmts, io_info->dxpl_cache, io_info->u.rbuf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't scatter to read buffer") + break; - /* Update the chunk data with any modifications from other processes */ + case H5D_IO_OP_WRITE: + /* Update the chunk data with the modifications from the current (owning) process */ + if (!H5D__gather_mem(io_info->u.wbuf, chunk_entry->chunk_info.mspace, mem_iter, + (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf)) + HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't gather from write buffer") + /* Update the chunk data with any modifications from other processes */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Write Buffer:\n"); - HDfprintf(debug_file, "| - ["); - for (size_t j = 0; j < chunk_entry->new_chunk.length / type_info->src_type_size; j++) { - if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) chunk_entry->buf)[j]); - } - HDfprintf(debug_file, "]\n|\n"); - HDfprintf(debug_file, "| - Write buf is at address %a.\n|\n", chunk_entry->buf); - HDfprintf(debug_file, "| - About to filter %zd bytes in buffer of size %zd.\n|\n", chunk_entry->new_chunk.length, buf_size); +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Chunk Data Buffer:\n"); + HDfprintf(debug_file, "| - ["); + for (size_t j = 0; j < chunk_entry->new_chunk.length / type_info->src_type_size; j++) { + if (j > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) chunk_entry->buf)[j]); + } + HDfprintf(debug_file, "]\n|\n"); + + HDfprintf(debug_file, "| - About to filter %zd bytes in buffer of size %zd.\n|\n", chunk_entry->new_chunk.length, buf_size); #endif - /* Filter the chunk */ - filter_mask = 0; - if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, - io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, - (size_t *) &chunk_entry->new_chunk.length, &buf_size, &chunk_entry->buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") + /* Filter the chunk */ + filter_mask = 0; + if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, + io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, + (size_t *) &chunk_entry->new_chunk.length, &buf_size, &chunk_entry->buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 - /* Check for the chunk expanding too much to encode in a 32-bit value */ - if (chunk_entry->new_chunk.length > ((size_t) 0xffffffff)) - HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") + /* Check for the chunk expanding too much to encode in a 32-bit value */ + if (chunk_entry->new_chunk.length > ((size_t) 0xffffffff)) + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") #endif + break; + default: + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unknown I/O operation") + } + done: if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") @@ -3083,6 +3123,6 @@ done: H5MM_free(mem_iter) FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__update_filtered_collective_chunk_entry() */ +} /* end H5D__filtered_collective_chunk_io() */ #endif /* H5_HAVE_PARALLEL */ -- cgit v0.12 From 5426599c91d22028c1afd0200e6319cdc54ffe0c Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 19 Jan 2017 14:32:17 -0600 Subject: For sake of complexity, force multi chunk IO for parallel filtered read --- src/H5Dmpio.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 6d97cb1..f4b6c4a 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -817,8 +817,19 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf case H5D_ONE_LINK_CHUNK_IO: case H5D_ONE_LINK_CHUNK_IO_MORE_OPT: if(io_info->dset->shared->dcpl_cache.pline.nused > 0) { - if(H5D__link_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish filtered linked chunk MPI-IO") + if (io_info->op_type == H5D_IO_OP_READ) { + /* XXX: For now, Multi-chunk IO must be forced for parallel filtered read, + * so that data can be unfiltered as it is received. There is complexity + * in unfiltering the data when it is read all at once into a single + * buffer. + */ + if(H5D__multi_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple filtered chunk MPI-IO") + } + else { + if(H5D__link_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish filtered linked chunk MPI-IO") + } } else { if(H5D__link_chunk_collective_io(io_info, type_info, fm, sum_chunk, dx_plist) < 0) -- cgit v0.12 From b19b0ea67d5636504e4b7ebd6241d52a5a4f09df Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 20 Jan 2017 14:09:20 -0600 Subject: Clean up H5Dmpio.c warnings --- src/H5Dmpio.c | 64 +++++++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index f4b6c4a..68d2752 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -158,7 +158,7 @@ static herr_t H5D__mpio_filtered_collective_write_type( H5D_filtered_collective_io_info_t *chunk_list, size_t num_entries, MPI_Datatype *new_mem_type, hbool_t *mem_type_derived, MPI_Datatype *new_file_type, hbool_t *file_type_derived); -static herr_t H5D__filtered_collective_chunk_io(H5D_filtered_collective_io_info_t *chunk_entry, +static herr_t H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk_entry, const H5D_io_info_t *io_info, const H5D_type_info_t *type_info); static int H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2); static int H5D__cmp_filtered_collective_io_entry(const void *filtered_collective_io_entry1, @@ -181,7 +181,7 @@ static int H5D__cmp_filtered_collective_io_entry(const void *filtered_collective * Purpose: Checks if an direct I/O transfer is possible between memory and * the file. * - * Return: Sauccess: Non-negative: TRUE or FALSE + * Return: Success: Non-negative: TRUE or FALSE * Failure: Negative * * Programmer: Quincey Koziol @@ -192,11 +192,11 @@ static int H5D__cmp_filtered_collective_io_entry(const void *filtered_collective htri_t H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, const H5S_t *mem_space, const H5D_type_info_t *type_info, - const H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) + const H5D_chunk_map_t H5_ATTR_UNUSED *fm, H5P_genplist_t *dx_plist) { int local_cause = 0; /* Local reason(s) for breaking collective mode */ int global_cause = 0; /* Global reason(s) for breaking collective mode */ - htri_t ret_value; /* Return value */ + htri_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -530,7 +530,7 @@ H5D__mpio_get_min_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, FUNC_ENTER_STATIC /* Get the number of chunks to perform I/O on */ - num_chunkf = H5SL_count(fm->sel_chunks); + H5_CHECKED_ASSIGN(num_chunkf, int, H5SL_count(fm->sel_chunks), size_t) /* Determine the minimum # of chunks for all processes */ if(MPI_SUCCESS != (mpi_code = MPI_Allreduce(&num_chunkf, min_chunkf, 1, MPI_INT, MPI_MIN, io_info->comm))) @@ -612,7 +612,7 @@ H5D__contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "couldn't finish shared collective MPI-IO") /* Obtain the data transfer properties */ - if(NULL == (dx_plist = H5I_object(io_info->raw_dxpl_id))) + if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") /* Set the actual I/O mode property. internal_collective_io will not break to @@ -659,7 +659,7 @@ H5D__contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't finish shared collective MPI-IO") /* Obtain the data transfer properties */ - if(NULL == (dx_plist = H5I_object(io_info->raw_dxpl_id))) + if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") /* Set the actual I/O mode property. internal_collective_io will not break to @@ -731,7 +731,7 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf HDassert(fm); /* Obtain the data transfer properties */ - if(NULL == (dx_plist = H5I_object(io_info->raw_dxpl_id))) + if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") /* Check the optional property list on what to do with collective chunk IO. */ @@ -1389,7 +1389,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in */ /* XXX: Not sure about minor error code */ for (i = 0; i < chunk_list_num_entries; i++) - if (H5D__filtered_collective_chunk_io(&chunk_list[i], io_info, type_info) < 0) + if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't process chunk entry") #ifdef PARALLEL_COMPRESS_DEBUG @@ -1661,7 +1661,7 @@ if(H5DEBUG(D)) * to ease switching between to mixed I/O without checking the current * value of the property. You can see the definition in H5Ppublic.h */ - actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_COLLECTIVE; + actual_io_mode = (H5D_mpio_actual_io_mode_t) (actual_io_mode | H5D_MPIO_CHUNK_COLLECTIVE); } /* end if */ else { @@ -1701,7 +1701,7 @@ if(H5DEBUG(D)) mspace = chunk_info->mspace; /* Update the local variable tracking the dxpl's actual io mode. */ - actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_INDEPENDENT; + actual_io_mode = (H5D_mpio_actual_io_mode_t) (actual_io_mode | H5D_MPIO_CHUNK_INDEPENDENT); } /* end if */ else { fspace = mspace = NULL; @@ -1853,7 +1853,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i if (io_info->op_type == H5D_IO_OP_READ) { /* Filtered collective read */ /* XXX: Change minor error code */ for (i = 0; i < chunk_list_num_entries; i++) - if (H5D__filtered_collective_chunk_io(&chunk_list[i], io_info, type_info) < 0) + if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't process chunk entry") } /* end if */ else { /* Filtered collective write */ @@ -1917,7 +1917,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* XXX: Not sure about minor error code */ if (have_chunk_to_process) - if (H5D__filtered_collective_chunk_io(&chunk_list[i], io_info, type_info) < 0) + if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't process chunk entry") /* Gather the new chunk sizes to all processes for a collective re-allocation @@ -2351,7 +2351,7 @@ if(H5DEBUG(D)) HDfprintf(H5DEBUG(D), "Coming inside H5D_OBTAIN_ALL_CHUNK_ADDR_COL\n"); #endif /* Allocate array for chunk addresses */ - if(NULL == (total_chunk_addr_array = H5MM_malloc(sizeof(haddr_t) * (size_t)fm->layout->u.chunk.nchunks))) + if(NULL == (total_chunk_addr_array = (haddr_t *)H5MM_malloc(sizeof(haddr_t) * (size_t)fm->layout->u.chunk.nchunks))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory chunk address array") /* Retrieve all the chunk addresses with process 0 */ @@ -2375,7 +2375,7 @@ if(H5DEBUG(D)) /* Iterate over all chunks for this process */ while(chunk_node) { - if(NULL == (chunk_info = H5SL_item(chunk_node))) + if(NULL == (chunk_info = (H5D_chunk_info_t *)H5SL_item(chunk_node))) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk info from skipped list") if(many_chunk_opt == H5D_OBTAIN_ONE_CHUNK_ADDR_IND) { @@ -2460,7 +2460,7 @@ static herr_t H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist, uint8_t assign_io_mode[], haddr_t chunk_addr[]) { - int total_chunks; + size_t total_chunks; unsigned percent_nproc_per_chunk, threshold_nproc_per_chunk; uint8_t* io_mode_info = NULL; uint8_t* recv_io_mode_info = NULL; @@ -2470,7 +2470,8 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, H5D_chunk_info_t* chunk_info; int mpi_size, mpi_rank; MPI_Comm comm; - int ic, root; + int root; + size_t ic; int mpi_code; #ifdef H5_HAVE_INSTRUMENTED_LIBRARY int new_value; @@ -2491,7 +2492,7 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") /* Setup parameters */ - H5_CHECKED_ASSIGN(total_chunks, int, fm->layout->u.chunk.nchunks, hsize_t); + H5_CHECKED_ASSIGN(total_chunks, size_t, fm->layout->u.chunk.nchunks, hsize_t); if(H5P_get(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, &percent_nproc_per_chunk) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't get percent nproc per chunk") /* if ratio is 0, perform collective io */ @@ -2503,39 +2504,42 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, HGOTO_DONE(SUCCEED) } /* end if */ - threshold_nproc_per_chunk = mpi_size * percent_nproc_per_chunk/100; + + threshold_nproc_per_chunk = (unsigned)mpi_size * percent_nproc_per_chunk/100; /* Allocate memory */ if(NULL == (io_mode_info = (uint8_t *)H5MM_calloc(total_chunks))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate I/O mode info buffer") - if(NULL == (mergebuf = H5MM_malloc((sizeof(haddr_t) + 1) * total_chunks))) + if(NULL == (mergebuf = (uint8_t *)H5MM_malloc((sizeof(haddr_t) + 1) * total_chunks))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate mergebuf buffer") tempbuf = mergebuf + total_chunks; if(mpi_rank == root) - if(NULL == (recv_io_mode_info = (uint8_t *)H5MM_malloc(total_chunks * mpi_size))) + if(NULL == (recv_io_mode_info = (uint8_t *)H5MM_malloc(total_chunks * (size_t)mpi_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate recv I/O mode info buffer") /* Obtain the regularity and selection information for all chunks in this process. */ chunk_node = H5SL_first(fm->sel_chunks); while(chunk_node) { - chunk_info = H5SL_item(chunk_node); + chunk_info = (H5D_chunk_info_t *)H5SL_item(chunk_node); - io_mode_info[chunk_info->index] = H5D_CHUNK_SELECT_REG; /* this chunk is selected and is "regular" */ + io_mode_info[chunk_info->index] = H5D_CHUNK_SELECT_REG; /* this chunk is selected and is "regular" */ chunk_node = H5SL_next(chunk_node); } /* end while */ /* Gather all the information */ - if(MPI_SUCCESS != (mpi_code = MPI_Gather(io_mode_info, total_chunks, MPI_BYTE, recv_io_mode_info, total_chunks, MPI_BYTE, root, comm))) + H5_CHECK_OVERFLOW(total_chunks, size_t, int) + if(MPI_SUCCESS != (mpi_code = MPI_Gather(io_mode_info, (int)total_chunks, MPI_BYTE, + recv_io_mode_info, (int)total_chunks, MPI_BYTE, root, comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Gather failed", mpi_code) /* Calculate the mode for IO(collective, independent or none) at root process */ if(mpi_rank == root) { - int nproc; - int* nproc_per_chunk; + size_t nproc; + unsigned* nproc_per_chunk; /* pre-computing: calculate number of processes and regularity of the selection occupied in each chunk */ - if(NULL == (nproc_per_chunk = (int*)H5MM_calloc(total_chunks * sizeof(int)))) + if(NULL == (nproc_per_chunk = (unsigned*)H5MM_calloc(total_chunks * sizeof(*nproc_per_chunk)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate nproc_per_chunk buffer") /* calculating the chunk address */ @@ -2545,7 +2549,7 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, } /* end if */ /* checking for number of process per chunk and regularity of the selection*/ - for(nproc = 0; nproc < mpi_size; nproc++) { + for(nproc = 0; nproc < (size_t)mpi_size; nproc++) { uint8_t *tmp_recv_io_mode_info = recv_io_mode_info + (nproc * total_chunks); /* Calculate the number of process per chunk and adding irregular selection option */ @@ -2991,7 +2995,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__filtered_collective_chunk_io(H5D_filtered_collective_io_info_t *chunk_entry, +H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk_entry, const H5D_io_info_t *io_info, const H5D_type_info_t *type_info) { H5S_sel_iter_t *mem_iter = NULL; @@ -3134,6 +3138,6 @@ done: H5MM_free(mem_iter) FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__filtered_collective_chunk_io() */ +} /* end H5D__filtered_collective_chunk_entry_io() */ #endif /* H5_HAVE_PARALLEL */ -- cgit v0.12 From aab742c9a2faa5d2136245b1370b250022804861 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Tue, 24 Jan 2017 15:01:31 -0600 Subject: Test code for sending chunk modification data around --- src/H5Dmpio.c | 200 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 190 insertions(+), 10 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 68d2752..70a859e 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -758,7 +758,7 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf /* step 1: choose an IO option */ /* If the average number of chunk per process is greater than a threshold, we will do one link chunked IO. */ - if((unsigned)sum_chunk / mpi_size >= one_link_chunk_io_threshold) + if((unsigned)sum_chunk / (unsigned)mpi_size >= one_link_chunk_io_threshold) io_option = H5D_ONE_LINK_CHUNK_IO_MORE_OPT; #ifdef H5_HAVE_INSTRUMENTED_LIBRARY else @@ -2660,10 +2660,13 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ { H5D_filtered_collective_io_info_t *local_info_array = NULL; H5D_filtered_collective_io_info_t *overlap_info_array = NULL; + H5S_sel_iter_t *mem_iter = NULL; H5SL_node_t *chunk_node; MPI_Request *send_requests = NULL; MPI_Status *send_statuses = NULL; hbool_t no_overlap = FALSE; + hbool_t mem_iter_init = FALSE; + uint8_t *mod_data = NULL; size_t num_send_requests; size_t num_chunks_selected; size_t overlap_info_array_num_entries; @@ -2751,6 +2754,9 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (NULL == (send_requests = (MPI_Request *) H5MM_malloc(num_chunks_selected * sizeof(*send_requests)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send requests buffer") + if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(H5S_sel_iter_t)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") + /* XXX: Change minor error code */ if (H5D__mpio_array_gather(io_info, local_info_array, num_chunks_selected, sizeof(*local_info_array), (void **) &overlap_info_array, &overlap_info_array_num_entries, @@ -2771,7 +2777,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Store the correct chunk entry information in case this process * becomes the new chunk's owner. The chunk entry that this process * contributed will be the only one with a valid dataspace selection - * on this particular process + * on that particular process */ if (mpi_rank == overlap_info_array[i].owner) chunk_entry = overlap_info_array[i]; @@ -2785,9 +2791,8 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ } num_writers++; - i++; - if (i == overlap_info_array_num_entries) break; + if (++i == overlap_info_array_num_entries) break; } while (overlap_info_array[i].old_chunk.offset == chunk_addr); if (mpi_rank == new_owner) { @@ -2800,11 +2805,80 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ overlap_info_array[num_chunks_selected++] = chunk_entry; } /* end if */ else { + hssize_t iter_nelmts; + hssize_t mod_data_size; + uint8_t *mod_data_p = NULL; + + /* XXX: Need some way of checking chunk entry to validate that this process + * is actually contributing some data for this chunk update + */ + + /* Determine size of serialized chunk selection plus the size + * of the data being written + */ + if ((mod_data_size = H5S_SELECT_SERIAL_SIZE(chunk_entry.chunk_info.mspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") + + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_entry.chunk_info.mspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + + /* XXX: For now, make sure enough memory is allocated by just adding the chunk + * size + */ + mod_data_size += iter_nelmts * type_info->src_type_size; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Allocing %zd bytes for mod. data buffer.\n", (size_t) mod_data_size); +#endif + + if (NULL == (mod_data = (uint8_t *) H5MM_malloc(mod_data_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification send buffer") + + /* Serialize the current selection into the buffer */ + mod_data_p = mod_data; + if (H5S_SELECT_SERIALIZE(chunk_entry.chunk_info.mspace, &mod_data_p) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to serialize dataspace selection") + + /* Initialize iterator for memory selection */ + if (H5S_select_iter_init(mem_iter, chunk_entry.chunk_info.mspace, type_info->src_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") + mem_iter_init = TRUE; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Iterating over %lld elements.\n", iter_nelmts); +#endif + + /* Collect the modification data into the buffer */ + if (!H5D__gather_mem(io_info->u.wbuf, chunk_entry.chunk_info.mspace, mem_iter, + (size_t) iter_nelmts, io_info->dxpl_cache, mod_data_p)) + HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't gather from write buffer") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Mod. Data Buffer:\n"); + HDfprintf(debug_file, "| - ["); + for (size_t j = 0; j < (size_t) iter_nelmts; j++) { + if (j > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) mod_data_p)[j]); + } + HDfprintf(debug_file, "]\n|\n"); + + HDfprintf(debug_file, "Sending modification data for chunk at address %a to process %d.\n", chunk_entry.old_chunk.offset, new_owner); +#endif + /* Send modification data to new owner */ + H5_CHECK_OVERFLOW(mod_data_size, hssize_t, int) + if (MPI_SUCCESS != (mpi_code = MPI_Isend(mod_data, (int) mod_data_size, MPI_BYTE, new_owner, + chunk_entry.chunk_info.index, io_info->comm, &send_requests[num_send_requests++]))) + HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) - /* if (MPI_SUCCESS != (mpi_code= MPI_Isend(, , , new_owner, - chunk_entry.old_chunk.offset, io_info->comm, &send_requests[num_send_requests++]))) - HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) */ +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Mod. data sent.\n"); +#endif + + if (mod_data) + mod_data = (uint8_t *) H5MM_free(mod_data); + if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") } /* end else */ #ifdef PARALLEL_COMPRESS_DEBUG @@ -2866,12 +2940,15 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HMPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code) } - done: if (send_requests) H5MM_free(send_requests); if (send_statuses) H5MM_free(send_statuses); + if (mod_data) + H5MM_free(mod_data); + if (mem_iter) + H5MM_free(mem_iter); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__construct_filtered_io_info_list() */ @@ -3001,7 +3078,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk H5S_sel_iter_t *mem_iter = NULL; unsigned filter_mask = 0; hssize_t iter_nelmts; - hbool_t full_overwrite = TRUE; + hbool_t full_overwrite = FALSE; hbool_t mem_iter_init = FALSE; size_t buf_size; herr_t ret_value = SUCCEED; @@ -3066,10 +3143,10 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk /* Owner of this chunk, receive modification data from other processes */ + /* Initialize iterator for memory selection */ if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") - /* Initialize iterator for memory selection */ /* XXX: dst_type_size may need to be src_type_size depending on operation */ if (H5S_select_iter_init(mem_iter, chunk_entry->chunk_info.mspace, type_info->dst_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") @@ -3097,8 +3174,111 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf)) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't gather from write buffer") + if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + /* Update the chunk data with any modifications from other processes */ + while (chunk_entry->num_writers > 1) { + MPI_Status status; + uint8_t *buf = NULL; + uint8_t *buf_p = NULL; + H5S_t *selection = NULL; + int count; + int mpi_code; + + /* XXX: Since the receive tag needs to be an int, it is possible that a chunk's index + * may fall outside the range of an int and cause an overflow problem when casting down + * here + */ + H5_CHECK_OVERFLOW(chunk_entry->chunk_info.index, hsize_t, int) + if (MPI_SUCCESS != (mpi_code = MPI_Probe(MPI_ANY_SOURCE, (int) chunk_entry->chunk_info.index, + io_info->comm, &status))) + HMPI_GOTO_ERROR(FAIL, "MPI_Probe failed", mpi_code) + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Found message from source %d with tag %d.\n", status.MPI_SOURCE, status.MPI_TAG); +#endif + + /* Retrieve the message size */ + if (MPI_SUCCESS != (mpi_code = MPI_Get_count(&status, MPI_BYTE, &count))) + HMPI_GOTO_ERROR(FAIL, "MPI_Get_count failed", mpi_code) + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Message size is %d bytes.\n", count); +#endif + if (NULL == (buf = (uint8_t *) H5MM_malloc(count))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate modification data receive buffer") + buf_p = buf; + + if (MPI_SUCCESS != (mpi_code = MPI_Recv(buf, count, MPI_BYTE, MPI_ANY_SOURCE, + chunk_entry->chunk_info.index, io_info->comm, &status))) + HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mpi_code) + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Received the message.\n"); +#endif + + /* Deserialize the selection in the chunk's dataspace */ + if (H5S_SELECT_DESERIALIZE(&selection, &buf_p) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTDECODE, FAIL, "unable to deserialize dataspace selection") + + /* H5S_extent_copy(selection, chunk_entry->chunk_info.mspace); */ + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Deserialized selection info:\n"); + HDfprintf(debug_file, "| Mem Space:\n"); + HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(selection)); + HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(selection)); + HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(selection)); + HDfprintf(debug_file, "| - Selection type: %d\n", H5S_GET_SELECT_TYPE(selection)); +#endif + + /* XXX: After receiving the selection information, the extent is not + * set/valid. Possibly copy the selection information directly into + * chunk entry mem space, or copy extent into received selection H5S type + */ + + + if (H5S_select_iter_init(mem_iter, selection, type_info->dst_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") + mem_iter_init = TRUE; + + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(selection)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Contents of message:\n["); + for (size_t j = 0; j < iter_nelmts; j++) { + if (j > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) buf_p)[j]); + } + HDfprintf(debug_file, "]\n"); +#endif + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Iter nelmts=%lld.\n", iter_nelmts); + HDfprintf(debug_file, "Mem space selected points: %zd.\n", H5S_GET_SELECT_NPOINTS(selection)); +#endif + + /* Update the chunk data with the received modification data */ + /* if (!H5D__gather_mem(buf_p, selection, mem_iter, (size_t) iter_nelmts, + io_info->dxpl_cache, chunk_entry->buf)) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't gather to write buffer") */ + if (H5D__scatter_mem(buf_p, selection, mem_iter, (size_t) iter_nelmts, + io_info->dxpl_cache, chunk_entry->buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't scatter to write buffer") + + chunk_entry->num_writers--; + + if (buf) + H5MM_free(buf); + if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + if (selection) + if (H5S_close(selection) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace") + } #ifdef PARALLEL_COMPRESS_DEBUG -- cgit v0.12 From 0b6016a3fc6f7cf5b60160e638e3ae7280952106 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 25 Jan 2017 19:34:10 -0600 Subject: Fix bug with chunk data updating --- src/H5Dmpio.c | 135 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 68 insertions(+), 67 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 70a859e..39a5e15 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -2661,12 +2661,12 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ H5D_filtered_collective_io_info_t *local_info_array = NULL; H5D_filtered_collective_io_info_t *overlap_info_array = NULL; H5S_sel_iter_t *mem_iter = NULL; + unsigned char *mod_data = NULL; H5SL_node_t *chunk_node; MPI_Request *send_requests = NULL; MPI_Status *send_statuses = NULL; hbool_t no_overlap = FALSE; hbool_t mem_iter_init = FALSE; - uint8_t *mod_data = NULL; size_t num_send_requests; size_t num_chunks_selected; size_t overlap_info_array_num_entries; @@ -2680,6 +2680,8 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HDassert(type_info); HDassert(fm); HDassert(chunk_list); + HDassert(num_entries); + HDassert(_num_chunks_selected_array); if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") @@ -2723,10 +2725,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); } HDfprintf(debug_file, "------------------------------\n\n"); -#endif - -#ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "Testing mem/file space addresses:\n"); HDfprintf(debug_file, "-----------------------------------\n"); @@ -2805,19 +2804,23 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ overlap_info_array[num_chunks_selected++] = chunk_entry; } /* end if */ else { + unsigned char *mod_data_p = NULL; hssize_t iter_nelmts; - hssize_t mod_data_size; - uint8_t *mod_data_p = NULL; + size_t mod_data_size; /* XXX: Need some way of checking chunk entry to validate that this process * is actually contributing some data for this chunk update */ - /* Determine size of serialized chunk selection plus the size + /* Determine size of serialized chunk memory dataspace plus the size * of the data being written */ - if ((mod_data_size = H5S_SELECT_SERIAL_SIZE(chunk_entry.chunk_info.mspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") + /* XXX: Using the file dataspace seems to work here, presumably because the file + * space reflects how the data is actually stored in the file, not in memory. e.g. + * it reflects the chunking setup + */ + if (H5S_encode(chunk_entry.chunk_info.fspace, &mod_data, &mod_data_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to get encoded dataspace size") if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_entry.chunk_info.mspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") @@ -2828,16 +2831,16 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ mod_data_size += iter_nelmts * type_info->src_type_size; #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Allocing %zd bytes for mod. data buffer.\n", (size_t) mod_data_size); + HDfprintf(debug_file, "| Allocing %zd bytes for mod. data buffer.\n", (size_t) mod_data_size); #endif - if (NULL == (mod_data = (uint8_t *) H5MM_malloc(mod_data_size))) + if (NULL == (mod_data = (unsigned char *) H5MM_malloc(mod_data_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification send buffer") - /* Serialize the current selection into the buffer */ + /* Serialize the chunk's file dataspace into the buffer */ mod_data_p = mod_data; - if (H5S_SELECT_SERIALIZE(chunk_entry.chunk_info.mspace, &mod_data_p) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to serialize dataspace selection") + if (H5S_encode(chunk_entry.chunk_info.fspace, &mod_data_p, &mod_data_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to encode dataspace") /* Initialize iterator for memory selection */ if (H5S_select_iter_init(mem_iter, chunk_entry.chunk_info.mspace, type_info->src_type_size) < 0) @@ -2845,7 +2848,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ mem_iter_init = TRUE; #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Iterating over %lld elements.\n", iter_nelmts); + HDfprintf(debug_file, "| Iterating over %lld elements.\n", iter_nelmts); #endif /* Collect the modification data into the buffer */ @@ -2862,27 +2865,28 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ } HDfprintf(debug_file, "]\n|\n"); - HDfprintf(debug_file, "Sending modification data for chunk at address %a to process %d.\n", chunk_entry.old_chunk.offset, new_owner); + HDfprintf(debug_file, "| Sending modification data for chunk at address %a to process %d.\n", chunk_entry.old_chunk.offset, new_owner); #endif /* Send modification data to new owner */ - H5_CHECK_OVERFLOW(mod_data_size, hssize_t, int) + H5_CHECK_OVERFLOW(mod_data_size, size_t, int) if (MPI_SUCCESS != (mpi_code = MPI_Isend(mod_data, (int) mod_data_size, MPI_BYTE, new_owner, chunk_entry.chunk_info.index, io_info->comm, &send_requests[num_send_requests++]))) HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Mod. data sent.\n"); + HDfprintf(debug_file, "| Mod. data sent.\n|\n"); #endif if (mod_data) - mod_data = (uint8_t *) H5MM_free(mod_data); + mod_data = (unsigned char *) H5MM_free(mod_data); if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + mem_iter_init = FALSE; } /* end else */ #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Chunk at address %a re-assigned to process %d.\n", chunk_addr, new_owner); + HDfprintf(debug_file, "| Chunk at address %a re-assigned to process %d.\n|\n", chunk_addr, new_owner); #endif } /* end for */ @@ -2902,9 +2906,9 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); HDfprintf(debug_file, "| - Chunk Address: %a\n", local_info_array[j].old_chunk.offset); HDfprintf(debug_file, "| - Chunk Length: %zd\n", local_info_array[j].old_chunk.length); - HDfprintf(debug_file, "| - Address of mspace: %x\n", local_info_array[j].chunk_info.mspace); - HDfprintf(debug_file, "| - Chunk Selection Type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.mspace)); - HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); + HDfprintf(debug_file, "| - Address of mspace: %x\n", local_info_array[j].chunk_info.fspace); + HDfprintf(debug_file, "| - Chunk Selection Type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.fspace)); + HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.fspace)); } HDfprintf(debug_file, "------------------------------\n\n"); #endif @@ -2947,6 +2951,8 @@ done: H5MM_free(send_statuses); if (mod_data) H5MM_free(mod_data); + if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") if (mem_iter) H5MM_free(mem_iter); @@ -3076,11 +3082,13 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk const H5D_io_info_t *io_info, const H5D_type_info_t *type_info) { H5S_sel_iter_t *mem_iter = NULL; + unsigned char *mod_data = NULL; unsigned filter_mask = 0; hssize_t iter_nelmts; hbool_t full_overwrite = FALSE; hbool_t mem_iter_init = FALSE; size_t buf_size; + H5S_t *dataspace = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -3179,12 +3187,10 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk /* Update the chunk data with any modifications from other processes */ while (chunk_entry->num_writers > 1) { - MPI_Status status; - uint8_t *buf = NULL; - uint8_t *buf_p = NULL; - H5S_t *selection = NULL; - int count; - int mpi_code; + unsigned char *mod_data_p = NULL; + MPI_Status status; + int count; + int mpi_code; /* XXX: Since the receive tag needs to be an int, it is possible that a chunk's index * may fall outside the range of an int and cause an overflow problem when casting down @@ -3196,7 +3202,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HMPI_GOTO_ERROR(FAIL, "MPI_Probe failed", mpi_code) #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Found message from source %d with tag %d.\n", status.MPI_SOURCE, status.MPI_TAG); + HDfprintf(debug_file, "| - Found message from source %d with tag %d.\n", status.MPI_SOURCE, status.MPI_TAG); #endif /* Retrieve the message size */ @@ -3204,81 +3210,73 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HMPI_GOTO_ERROR(FAIL, "MPI_Get_count failed", mpi_code) #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Message size is %d bytes.\n", count); + HDfprintf(debug_file, "| - Message size is %d bytes.\n", count); #endif - if (NULL == (buf = (uint8_t *) H5MM_malloc(count))) + if (NULL == (mod_data = (unsigned char *) H5MM_malloc(count))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate modification data receive buffer") - buf_p = buf; + mod_data_p = mod_data; - if (MPI_SUCCESS != (mpi_code = MPI_Recv(buf, count, MPI_BYTE, MPI_ANY_SOURCE, + if (MPI_SUCCESS != (mpi_code = MPI_Recv(mod_data, count, MPI_BYTE, MPI_ANY_SOURCE, chunk_entry->chunk_info.index, io_info->comm, &status))) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mpi_code) #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Received the message.\n"); + HDfprintf(debug_file, "| - Received the message.\n"); #endif - /* Deserialize the selection in the chunk's dataspace */ - if (H5S_SELECT_DESERIALIZE(&selection, &buf_p) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTDECODE, FAIL, "unable to deserialize dataspace selection") - - /* H5S_extent_copy(selection, chunk_entry->chunk_info.mspace); */ + /* Decode the chunk's memory dataspace */ + if (NULL == (dataspace = H5S_decode(&mod_data_p))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTDECODE, FAIL, "unable to decode dataspace") #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Deserialized selection info:\n"); + HDfprintf(debug_file, "| Deserialized selection info:\n"); HDfprintf(debug_file, "| Mem Space:\n"); - HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(selection)); - HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(selection)); - HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(selection)); - HDfprintf(debug_file, "| - Selection type: %d\n", H5S_GET_SELECT_TYPE(selection)); + HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(dataspace)); + HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(dataspace)); + HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(dataspace)); + HDfprintf(debug_file, "| - Selection type: %d\n", H5S_GET_SELECT_TYPE(dataspace)); #endif - /* XXX: After receiving the selection information, the extent is not - * set/valid. Possibly copy the selection information directly into - * chunk entry mem space, or copy extent into received selection H5S type - */ - - - if (H5S_select_iter_init(mem_iter, selection, type_info->dst_type_size) < 0) + if (H5S_select_iter_init(mem_iter, dataspace, type_info->dst_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") mem_iter_init = TRUE; - if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(selection)) < 0) + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(dataspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Contents of message:\n["); + HDfprintf(debug_file, "| Contents of message:\n| ["); for (size_t j = 0; j < iter_nelmts; j++) { if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) buf_p)[j]); + HDfprintf(debug_file, "%lld", ((long *) mod_data_p)[j]); } HDfprintf(debug_file, "]\n"); #endif #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Iter nelmts=%lld.\n", iter_nelmts); - HDfprintf(debug_file, "Mem space selected points: %zd.\n", H5S_GET_SELECT_NPOINTS(selection)); + HDfprintf(debug_file, "| Iter nelmts=%lld.\n", iter_nelmts); + HDfprintf(debug_file, "| Mem space selected points: %zd.\n| \n", H5S_GET_SELECT_NPOINTS(dataspace)); #endif /* Update the chunk data with the received modification data */ - /* if (!H5D__gather_mem(buf_p, selection, mem_iter, (size_t) iter_nelmts, - io_info->dxpl_cache, chunk_entry->buf)) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't gather to write buffer") */ - if (H5D__scatter_mem(buf_p, selection, mem_iter, (size_t) iter_nelmts, + if (H5D__scatter_mem(mod_data_p, dataspace, mem_iter, (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't scatter to write buffer") chunk_entry->num_writers--; - if (buf) - H5MM_free(buf); - if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + if (mod_data) + H5MM_free(mod_data); + if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") - if (selection) - if (H5S_close(selection) < 0) + if (dataspace) { + if (H5S_close(dataspace) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace") - } + dataspace = NULL; + } + mem_iter_init = FALSE; + } /* end while */ #ifdef PARALLEL_COMPRESS_DEBUG @@ -3314,6 +3312,9 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk done: if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + if (dataspace) + if (H5S_close(dataspace) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace") if (mem_iter) H5MM_free(mem_iter) -- cgit v0.12 From 344781f17d983bd38aac8c687461c0bcfcf7dacf Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 26 Jan 2017 14:03:36 -0600 Subject: Multiple Bug Fixes Add comments explaining different variables Check more overflow/conversion sign change issues --- src/H5Dmpio.c | 223 +++++++++++++++++++++++++++++++--------------------------- 1 file changed, 121 insertions(+), 102 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 39a5e15..453e420 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -101,6 +101,7 @@ typedef struct H5D_chunk_addr_info_t { H5D_chunk_info_t chunk_info; } H5D_chunk_addr_info_t; +/* Information about a chunk when performing collective filtered IO */ typedef struct H5D_filtered_collective_io_info_t { H5D_chunk_info_t chunk_info; H5F_block_t old_chunk; @@ -151,7 +152,7 @@ static herr_t H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries, size_t **_num_chunks_selected_array); static herr_t H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, - size_t array_num_entries, size_t array_entry_size, + size_t local_array_num_entries, size_t array_entry_size, void **gathered_array, size_t *gathered_array_num_entries, int (*sort_func)(const void *, const void *)); static herr_t H5D__mpio_filtered_collective_write_type( @@ -161,8 +162,8 @@ static herr_t H5D__mpio_filtered_collective_write_type( static herr_t H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk_entry, const H5D_io_info_t *io_info, const H5D_type_info_t *type_info); static int H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2); -static int H5D__cmp_filtered_collective_io_entry(const void *filtered_collective_io_entry1, - const void *filtered_collective_io_entry2); +static int H5D__cmp_filtered_collective_io_info_entry(const void *filtered_collective_io_info_entry1, + const void *filtered_collective_io_info_entry2); /*********************/ @@ -350,15 +351,15 @@ done: */ static herr_t H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, - size_t array_num_entries, size_t array_entry_size, + size_t local_array_num_entries, size_t array_entry_size, void **_gathered_array, size_t *_gathered_array_num_entries, int (*sort_func)(const void *, const void *)) { size_t gathered_array_num_entries = 0; size_t i; void *gathered_array = NULL; - int *receive_counts_array = NULL; - int *displacements_array = NULL; + int *receive_counts_array = NULL; /* Array containing number of entries each process contributes */ + int *displacements_array = NULL; /* Array of displacements where each process places its data in the final array */ int mpi_code, mpi_size; int sendcount; herr_t ret_value = SUCCEED; @@ -373,24 +374,24 @@ H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") - if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&array_num_entries, &gathered_array_num_entries, 1, MPI_INT, MPI_SUM, io_info->comm))) + /* Determine the size of the end result array */ + if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&local_array_num_entries, &gathered_array_num_entries, 1, MPI_INT, MPI_SUM, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) if (NULL == (gathered_array = H5MM_malloc(gathered_array_num_entries * array_entry_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate total gathered array") + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate gathered array") if (NULL == (receive_counts_array = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*receive_counts_array)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate receive counts array") if (NULL == (displacements_array = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*displacements_array)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate displacements array") + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate receive displacements array") - if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&array_num_entries, 1, MPI_INT, receive_counts_array, 1, MPI_INT, io_info->comm))) + /* Inform each process of how many entries each other process is contributing to the resulting array */ + if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&local_array_num_entries, 1, MPI_INT, receive_counts_array, 1, MPI_INT, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) - /* Multiply each receive count by the size of the array entry, - * since the data is sent in a count of bytes - */ + /* Multiply each receive count by the size of the array entry, since the data is sent as bytes */ for (i = 0; i < (size_t) mpi_size; i++) H5_CHECKED_ASSIGN(receive_counts_array[i], int, (size_t) receive_counts_array[i] * array_entry_size, size_t); @@ -399,7 +400,7 @@ H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, for (i = 1; i < (size_t) mpi_size; i++) displacements_array[i] = displacements_array[i - 1] + receive_counts_array[i - 1]; - H5_CHECKED_ASSIGN(sendcount, int, array_num_entries * array_entry_size, size_t); + H5_CHECKED_ASSIGN(sendcount, int, local_array_num_entries * array_entry_size, size_t); if (MPI_SUCCESS != (mpi_code = MPI_Allgatherv(local_array, sendcount, MPI_BYTE, gathered_array, receive_counts_array, displacements_array, MPI_BYTE, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allgatherv failed", mpi_code) @@ -734,9 +735,10 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - /* Check the optional property list on what to do with collective chunk IO. */ + /* Check the optional property list for the collective chunk IO optimization option */ if(H5P_get(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, &chunk_opt_mode) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't get chunk optimization option") + if(H5FD_MPIO_CHUNK_ONE_IO == chunk_opt_mode) io_option = H5D_ONE_LINK_CHUNK_IO; /*no opt*/ /* direct request to multi-chunk-io */ @@ -816,13 +818,14 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf switch (io_option) { case H5D_ONE_LINK_CHUNK_IO: case H5D_ONE_LINK_CHUNK_IO_MORE_OPT: + /* Check if there are any filters in the pipeline */ if(io_info->dset->shared->dcpl_cache.pline.nused > 0) { + /* For now, Multi-chunk IO must be forced for parallel filtered read, + * so that data can be unfiltered as it is received. There is significant + * complexity in unfiltering the data when it is read all at once into a + * single buffer. + */ if (io_info->op_type == H5D_IO_OP_READ) { - /* XXX: For now, Multi-chunk IO must be forced for parallel filtered read, - * so that data can be unfiltered as it is received. There is complexity - * in unfiltering the data when it is read all at once into a single - * buffer. - */ if(H5D__multi_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple filtered chunk MPI-IO") } @@ -832,6 +835,7 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf } } else { + /* Perform unfiltered link chunk collective IO */ if(H5D__link_chunk_collective_io(io_info, type_info, fm, sum_chunk, dx_plist) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish linked chunk MPI-IO") } @@ -839,11 +843,13 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf case H5D_MULTI_CHUNK_IO: /* direct request to do multi-chunk IO */ default: /* multiple chunk IO via threshold */ + /* Check if there are any filters in the pipeline */ if(io_info->dset->shared->dcpl_cache.pline.nused > 0) { if(H5D__multi_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple filtered chunk MPI-IO") } else { + /* Perform unfiltered multi chunk collective IO */ if(H5D__multi_chunk_collective_io(io_info, type_info, fm, dx_plist) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple chunk MPI-IO") } @@ -1437,15 +1443,15 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in if (chunk_list_num_entries) { size_t offset; - /* XXX: During the collective re-allocation of chunks in the file, the record for each - * chunk is only update in the total array, not in the local copy of chunks on each + /* During the collective re-allocation of chunks in the file, the record for each + * chunk is only updated in the collective array, not in the local copy of chunks on each * process. However, each process needs the updated chunk records so that they can create - * a MPI type for the collective write that will write to the chunk's new locations instead - * of the old ones. This ugly hack seems to be the best solution to copy the information - * back to the local array and avoid having to modify the collective write type function - * in an ugly way so that it will accept the total array instead of the local array. - * This works correctly because the array gather function guarantees that the chunk - * data in the total array is ordered in blocks by rank. + * a MPI type for the collective write that will write to the chunk's possible new locations + * in the file instead of the old ones. This ugly hack seems to be the best solution to + * copy the information back to the local array and avoid having to modify the collective + * write type function in an ugly way so that it will accept the collective array instead + * of the local array. This works correctly because the array gather function guarantees + * that the chunk data in the collective array is ordered in blocks by rank. */ for (i = 0, offset = 0; i < (size_t) mpi_rank; i++) offset += num_chunks_selected_array[i]; @@ -1499,9 +1505,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HDfprintf(debug_file, "---------------------------------------\n"); #endif } /* end if */ - else { /* Filtered collective read */ - - } /* end else */ done: /* Free resources used by a process which had some selection */ @@ -1748,7 +1751,6 @@ done: * as opposed to collective IO of every chunk at once * * XXX: Update later to reflect changes in structure - * XXX: Add read operation description * * 1. Construct a list of selected chunks in the collective IO * operation @@ -1758,7 +1760,10 @@ done: * process seen that is writing the most data becomes * the new owner in the case of ties) * 2. If the operation is a read operation - * A. + * A. Loop through each chunk in the operation + * I. Read the chunk from the file + * II. Unfilter the chunk + * III. Scatter the read chunk data to the user's buffer * 3. If the operation is a write operation * A. Loop through each chunk in the operation * I. If this is not a full overwrite of the chunk @@ -1964,7 +1969,9 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i if (have_chunk_to_process) { int mpi_type_count; - /* Collect the new chunk info back to the local copy */ + /* Collect the new chunk info back to the local copy, since only the record in the + * collective array gets updated by the chunk re-allocation */ + /* XXX: offset could be wrong if a process runs out of chunks */ HDmemcpy(&chunk_list[i].new_chunk, &collective_chunk_list[mpi_rank].new_chunk, sizeof(chunk_list[i].new_chunk)); #ifdef PARALLEL_COMPRESS_DEBUG @@ -1988,6 +1995,8 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) file_type_is_derived_array[i] = TRUE; + mpi_buf_count = 1; + /* Set up the base storage address for this operation */ ctg_store.contig.dset_addr = chunk_list[i].new_chunk.offset; @@ -1996,8 +2005,10 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i */ ctg_io_info.u.wbuf = chunk_list[i].buf; } /* end if */ - - mpi_buf_count = (mem_type_is_derived_array[i] && file_type_is_derived_array[i]) ? 1 : 0; + else { + mem_type_array[i] = file_type_array[i] = MPI_BYTE; + mpi_buf_count = 0; + } /* end else */ /* Perform the I/O */ if (H5D__final_collective_io(&ctg_io_info, type_info, mpi_buf_count, &file_type_array[i], &mem_type_array[i]) < 0) @@ -2248,7 +2259,7 @@ H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2) /*------------------------------------------------------------------------- - * Function: H5D__cmp_filtered_collective_io_entry + * Function: H5D__cmp_filtered_collective_io_info_entry * * Purpose: Routine to compare filtered collective chunk io info * entries @@ -2264,17 +2275,17 @@ H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2) *------------------------------------------------------------------------- */ static int -H5D__cmp_filtered_collective_io_entry(const void *filtered_collective_io_entry1, const void *filtered_collective_io_entry2) +H5D__cmp_filtered_collective_io_info_entry(const void *filtered_collective_io_info_entry1, const void *filtered_collective_io_info_entry2) { haddr_t addr1, addr2; FUNC_ENTER_STATIC_NOERR - addr1 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_entry1)->new_chunk.offset; - addr2 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_entry2)->new_chunk.offset; + addr1 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_info_entry1)->new_chunk.offset; + addr2 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_info_entry2)->new_chunk.offset; FUNC_LEAVE_NOAPI(H5F_addr_cmp(addr1, addr2)) -} /* end H5D__cmp_filtered_collective_io_entry() */ +} /* end H5D__cmp_filtered_collective_io_info_entry() */ /*------------------------------------------------------------------------- @@ -2638,7 +2649,6 @@ done: /*------------------------------------------------------------------------- * Function: H5D__construct_filtered_io_info_list * - * XXX: Revise description * Purpose: Constructs a list of entries which contain the necessary * information for inter-process communication when performing * collective io on filtered chunks. This list is used by @@ -2658,19 +2668,19 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ const H5D_chunk_map_t *fm, H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries, size_t **_num_chunks_selected_array) { - H5D_filtered_collective_io_info_t *local_info_array = NULL; - H5D_filtered_collective_io_info_t *overlap_info_array = NULL; - H5S_sel_iter_t *mem_iter = NULL; - unsigned char *mod_data = NULL; + H5D_filtered_collective_io_info_t *local_info_array = NULL; /* The list of initially select chunks for this process */ + H5D_filtered_collective_io_info_t *overlap_info_array = NULL; /* The list of all chunks selected in the operation by all processes */ + H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__gather_mem */ + unsigned char *mod_data = NULL; /* Chunk modification data sent by a process to a chunk's owner */ H5SL_node_t *chunk_node; - MPI_Request *send_requests = NULL; - MPI_Status *send_statuses = NULL; - hbool_t no_overlap = FALSE; + MPI_Request *send_requests = NULL; /* Array of MPI_Isend chunk modification data send requests */ + MPI_Status *send_statuses = NULL; /* Array of MPI_Isend chunk modification send statuses */ + hbool_t no_overlap = FALSE; /* Whether or not the user guarantees a one-process-only-per-chunk write style */ hbool_t mem_iter_init = FALSE; - size_t num_send_requests; + size_t num_send_requests = 0; size_t num_chunks_selected; size_t overlap_info_array_num_entries; - size_t *num_chunks_selected_array = NULL; + size_t *num_chunks_selected_array = NULL; /* Array of number of chunks selected on each process */ int mpi_rank, mpi_size, mpi_code; herr_t ret_value = SUCCEED; @@ -2698,6 +2708,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ for (num_chunks_selected = 0; chunk_node; num_chunks_selected++) { H5D_chunk_info_t *chunk_info = (H5D_chunk_info_t *) H5SL_item(chunk_node); H5D_chunk_ud_t udata; + hssize_t select_npoints; /* Obtain this chunk's address */ if (H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) @@ -2705,11 +2716,14 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ local_info_array[num_chunks_selected].chunk_info = *chunk_info; local_info_array[num_chunks_selected].old_chunk = local_info_array[num_chunks_selected].new_chunk = udata.chunk_block; - local_info_array[num_chunks_selected].io_size = H5S_GET_SELECT_NPOINTS(chunk_info->mspace) * type_info->src_type_size; local_info_array[num_chunks_selected].num_writers = 0; local_info_array[num_chunks_selected].owner = mpi_rank; local_info_array[num_chunks_selected].buf = NULL; + if ((select_npoints = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + local_info_array[num_chunks_selected].io_size = (size_t) select_npoints * type_info->src_type_size; + chunk_node = H5SL_next(chunk_node); } /* end for */ @@ -2746,7 +2760,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HDfprintf(debug_file, "-----------------------------------\n\n"); #endif - /* Redistribute chunks to new owners as necessary */ + /* Redistribute shared chunks to new owners as necessary */ if (!no_overlap && (io_info->op_type == H5D_IO_OP_WRITE)) { size_t i; @@ -2759,8 +2773,8 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* XXX: Change minor error code */ if (H5D__mpio_array_gather(io_info, local_info_array, num_chunks_selected, sizeof(*local_info_array), (void **) &overlap_info_array, &overlap_info_array_num_entries, - H5D__cmp_filtered_collective_io_entry) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't ") + H5D__cmp_filtered_collective_io_info_entry) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather array") for (i = 0, num_chunks_selected = 0, num_send_requests = 0; i < overlap_info_array_num_entries;) { H5D_filtered_collective_io_info_t chunk_entry; @@ -2769,6 +2783,15 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ size_t max_bytes = 0; int new_owner = 0; + /* Set the chunk entry's file dataspace to NULL as a sentinel value. + * Any process which is contributing modifications to this chunk will + * obtain a valid file space while processing duplicates below. Any + * process which still has a NULL file space after processing all of + * the duplicate entries for a shared chunk are assumed to not be + * contributing to the chunk and so will not try to access an invalid + * dataspace when processes are sending chunk data to new owners */ + chunk_entry.chunk_info.fspace = NULL; + /* Process duplicate entries caused by another process writing * to the same chunk */ @@ -2803,14 +2826,13 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* New owner takes possession of the chunk */ overlap_info_array[num_chunks_selected++] = chunk_entry; } /* end if */ - else { - unsigned char *mod_data_p = NULL; - hssize_t iter_nelmts; + else if (chunk_entry.chunk_info.fspace) { + unsigned char *mod_data_p = NULL; /* Use second pointer since H5S_encode advances pointer */ + hssize_t iter_nelmts; /* Number of points to iterate over for the send operation */ size_t mod_data_size; - /* XXX: Need some way of checking chunk entry to validate that this process - * is actually contributing some data for this chunk update - */ + /* Not the new owner of this chunk, encode the file space selection and + * modification data into a buffer and send it to the new chunk owner */ /* Determine size of serialized chunk memory dataspace plus the size * of the data being written @@ -2825,10 +2847,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_entry.chunk_info.mspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - /* XXX: For now, make sure enough memory is allocated by just adding the chunk - * size - */ - mod_data_size += iter_nelmts * type_info->src_type_size; + mod_data_size += (size_t) iter_nelmts * type_info->src_type_size; #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "| Allocing %zd bytes for mod. data buffer.\n", (size_t) mod_data_size); @@ -2870,14 +2889,14 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Send modification data to new owner */ H5_CHECK_OVERFLOW(mod_data_size, size_t, int) + H5_CHECK_OVERFLOW(chunk_entry.chunk_info.index, hsize_t, int) if (MPI_SUCCESS != (mpi_code = MPI_Isend(mod_data, (int) mod_data_size, MPI_BYTE, new_owner, - chunk_entry.chunk_info.index, io_info->comm, &send_requests[num_send_requests++]))) + (int) chunk_entry.chunk_info.index, io_info->comm, &send_requests[num_send_requests++]))) HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "| Mod. data sent.\n|\n"); #endif - if (mod_data) mod_data = (unsigned char *) H5MM_free(mod_data); if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) @@ -2918,7 +2937,8 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (NULL == (num_chunks_selected_array = (size_t *) H5MM_malloc((size_t) mpi_size * sizeof(*num_chunks_selected_array)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate num chunks selected array") - if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&num_chunks_selected, 1, MPI_UNSIGNED_LONG_LONG, num_chunks_selected_array, 1, MPI_UNSIGNED_LONG_LONG, io_info->comm))) + if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&num_chunks_selected, 1, MPI_UNSIGNED_LONG_LONG, num_chunks_selected_array, + 1, MPI_UNSIGNED_LONG_LONG, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) #ifdef PARALLEL_COMPRESS_DEBUG @@ -2966,9 +2986,7 @@ done: * Purpose: Constructs a MPI derived datatype for both the memory and * the file for a collective write of filtered chunks. The * datatype contains the offsets in the file and the locations - * of the filtered chunk data buffers - * - * XXX: Same type may be reusable for filtered collective read + * of the filtered chunk data buffers. * * Return: Non-negative on success/Negative on failure * @@ -3011,7 +3029,7 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective write offset array") /* Ensure the list is sorted in ascending order of offset in the file */ - HDqsort(chunk_list, num_entries, sizeof(*chunk_list), H5D__cmp_filtered_collective_io_entry); + HDqsort(chunk_list, num_entries, sizeof(*chunk_list), H5D__cmp_filtered_collective_io_info_entry); #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "MPI Write type entries:\n"); @@ -3020,8 +3038,9 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun base_buf = chunk_list[0].buf; for (i = 0; i < num_entries; i++) { - /* XXX: Revise description */ - /* Set up array position */ + /* Set up the offset in the file, the length of the chunk data, and the relative + * displacement of the chunk data write buffer + */ file_offset_array[i] = (MPI_Aint) chunk_list[i].new_chunk.offset; length_array[i] = (int) chunk_list[i].new_chunk.length; write_buf_array[i] = (MPI_Aint) chunk_list[i].buf - (MPI_Aint) base_buf; @@ -3035,7 +3054,7 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun } HDfprintf(debug_file, "]\n|\n"); #endif - } /* end while */ + } /* end for */ #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "---------------------------------\n\n"); @@ -3057,18 +3076,24 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun } /* end if */ done: - length_array = (int *) H5MM_free(length_array); - write_buf_array = (MPI_Aint *) H5MM_free(write_buf_array); - file_offset_array = (MPI_Aint *) H5MM_free(file_offset_array); + if (write_buf_array) + H5MM_free(write_buf_array); + if (file_offset_array) + H5MM_free(file_offset_array); + if (length_array) + H5MM_free(length_array); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__mpio_filtered_collective_write_type() */ /*------------------------------------------------------------------------- - * Function: H5D__filtered_collective_chunk_io + * Function: H5D__filtered_collective_chunk_entry_io * - * Purpose: XXX: description + * Purpose: Given an entry for a filtered chunk, performs the necessary + * steps for updating the chunk data during a collective + * write, or for reading the chunk from file during a + * collective read. * * Return: Non-negative on success/Negative on failure * @@ -3081,14 +3106,14 @@ static herr_t H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk_entry, const H5D_io_info_t *io_info, const H5D_type_info_t *type_info) { - H5S_sel_iter_t *mem_iter = NULL; - unsigned char *mod_data = NULL; + H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__scatter_mem/H5D__gather_mem */ + unsigned char *mod_data = NULL; /* Chunk modification data sent by a process to a chunk's owner */ unsigned filter_mask = 0; - hssize_t iter_nelmts; - hbool_t full_overwrite = FALSE; + hssize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */ + hbool_t full_overwrite = FALSE; /* Whether this is a full overwrite of this chunk */ hbool_t mem_iter_init = FALSE; size_t buf_size; - H5S_t *dataspace = NULL; + H5S_t *dataspace = NULL; /* Other process' dataspace for the chunk */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -3110,7 +3135,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk * If this is a write operation where the chunk is being fully overwritten, enough memory * must be allocated for the size of the unfiltered chunk. */ - /* XXX: Return value of macro should be checked instead */ + /* XXX: Return value of macro should be checked */ buf_size = (!full_overwrite || io_info->op_type == H5D_IO_OP_READ) ? chunk_entry->old_chunk.length : (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_entry->chunk_info.fspace) * type_info->src_type_size; chunk_entry->new_chunk.length = buf_size; @@ -3149,8 +3174,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk #endif } /* end if */ - /* Owner of this chunk, receive modification data from other processes */ - /* Initialize iterator for memory selection */ if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") @@ -3167,7 +3190,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk * * If this is a write operation, update the chunk data buffer with the modifications * from the current process, then apply any modifications from other processes. Finally, - * filter the newly-update chunk. + * filter the newly-updated chunk. */ switch (io_info->op_type) { case H5D_IO_OP_READ: @@ -3187,15 +3210,12 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk /* Update the chunk data with any modifications from other processes */ while (chunk_entry->num_writers > 1) { - unsigned char *mod_data_p = NULL; - MPI_Status status; - int count; - int mpi_code; - - /* XXX: Since the receive tag needs to be an int, it is possible that a chunk's index - * may fall outside the range of an int and cause an overflow problem when casting down - * here - */ + const unsigned char *mod_data_p; /* Use second pointer since H5S_decode advances pointer */ + MPI_Status status; + int count; + int mpi_code; + + /* Probe for the incoming message from another process */ H5_CHECK_OVERFLOW(chunk_entry->chunk_info.index, hsize_t, int) if (MPI_SUCCESS != (mpi_code = MPI_Probe(MPI_ANY_SOURCE, (int) chunk_entry->chunk_info.index, io_info->comm, &status))) @@ -3213,19 +3233,19 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HDfprintf(debug_file, "| - Message size is %d bytes.\n", count); #endif - if (NULL == (mod_data = (unsigned char *) H5MM_malloc(count))) + if (NULL == (mod_data = (unsigned char *) H5MM_malloc((size_t) count))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate modification data receive buffer") mod_data_p = mod_data; if (MPI_SUCCESS != (mpi_code = MPI_Recv(mod_data, count, MPI_BYTE, MPI_ANY_SOURCE, - chunk_entry->chunk_info.index, io_info->comm, &status))) + (int) chunk_entry->chunk_info.index, io_info->comm, &status))) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mpi_code) #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "| - Received the message.\n"); #endif - /* Decode the chunk's memory dataspace */ + /* Decode the process' chunk file dataspace */ if (NULL == (dataspace = H5S_decode(&mod_data_p))) HGOTO_ERROR(H5E_DATASET, H5E_CANTDECODE, FAIL, "unable to decode dataspace") @@ -3292,7 +3312,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk #endif /* Filter the chunk */ - filter_mask = 0; if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, (size_t *) &chunk_entry->new_chunk.length, &buf_size, &chunk_entry->buf) < 0) -- cgit v0.12 From 0a93759774152869a123c12fe766f6c13530217a Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 27 Jan 2017 09:06:56 -0600 Subject: Remove unnecessary num_chunks_selected_array from H5D__construct_filtered_io_info_list --- src/H5Dmpio.c | 49 ++++++++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 453e420..72f880b 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -149,8 +149,7 @@ static herr_t H5D__mpio_get_sum_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int *sum_chunkf); static herr_t H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm, - H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries, - size_t **_num_chunks_selected_array); + H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries); static herr_t H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, size_t local_array_num_entries, size_t array_entry_size, void **gathered_array, size_t *gathered_array_num_entries, @@ -1353,7 +1352,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* Build a list of selected chunks in the collective io operation */ /* XXX: Not sure about correct minor error code */ - if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries, &num_chunks_selected_array) < 0) + if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't construct filtered I/O info list") #ifdef PARALLEL_COMPRESS_DEBUG @@ -1436,6 +1435,22 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HDfprintf(debug_file, "------------------------------\n\n"); #endif + if (NULL == (num_chunks_selected_array = (size_t *) H5MM_malloc((size_t) mpi_size * sizeof(*num_chunks_selected_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate num chunks selected array") + + if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&chunk_list_num_entries, 1, MPI_UNSIGNED_LONG_LONG, num_chunks_selected_array, + 1, MPI_UNSIGNED_LONG_LONG, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, " Num Chunks Selected Array\n"); + HDfprintf(debug_file, "------------------------------------\n"); + for (size_t j = 0; j < (size_t) mpi_size; j++) { + HDfprintf(debug_file, "| Process %d has %zd chunks selected.\n", j, num_chunks_selected_array[j]); + } + HDfprintf(debug_file, "------------------------------------\n\n"); +#endif + /* If this process has any chunks selected, create a MPI type for collectively * writing out the chunks to file. Otherwise, the process contributes to the * collective write with a none type. @@ -1815,7 +1830,6 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i hbool_t *mem_type_is_derived_array = NULL; size_t chunk_list_num_entries; size_t collective_chunk_list_num_entries; - size_t *num_chunks_selected_array = NULL; /* Array of number of chunks selected on each process */ size_t i, j; /* Local index variable */ int mpi_rank, mpi_size, mpi_code; herr_t ret_value = SUCCEED; @@ -1840,7 +1854,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Build a list of selected chunks in the collective IO operation */ /* XXX: change minor error code */ - if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries, &num_chunks_selected_array) < 0) + if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't construct filtered I/O info list") /* Set up contiguous I/O info object */ @@ -2073,8 +2087,6 @@ done: H5MM_free(file_type_is_derived_array); if (mem_type_is_derived_array) H5MM_free(mem_type_is_derived_array); - if (num_chunks_selected_array) - H5MM_free(num_chunks_selected_array); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__multi_chunk_filtered_collective_io() */ @@ -2665,8 +2677,7 @@ done: */ static herr_t H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - const H5D_chunk_map_t *fm, H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries, - size_t **_num_chunks_selected_array) + const H5D_chunk_map_t *fm, H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries) { H5D_filtered_collective_io_info_t *local_info_array = NULL; /* The list of initially select chunks for this process */ H5D_filtered_collective_io_info_t *overlap_info_array = NULL; /* The list of all chunks selected in the operation by all processes */ @@ -2680,7 +2691,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ size_t num_send_requests = 0; size_t num_chunks_selected; size_t overlap_info_array_num_entries; - size_t *num_chunks_selected_array = NULL; /* Array of number of chunks selected on each process */ int mpi_rank, mpi_size, mpi_code; herr_t ret_value = SUCCEED; @@ -2691,7 +2701,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HDassert(fm); HDassert(chunk_list); HDassert(num_entries); - HDassert(_num_chunks_selected_array); if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") @@ -2933,26 +2942,8 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ #endif } /* end if */ - /* Gather the number of chunks each process is writing to all processes */ - if (NULL == (num_chunks_selected_array = (size_t *) H5MM_malloc((size_t) mpi_size * sizeof(*num_chunks_selected_array)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate num chunks selected array") - - if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&num_chunks_selected, 1, MPI_UNSIGNED_LONG_LONG, num_chunks_selected_array, - 1, MPI_UNSIGNED_LONG_LONG, io_info->comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, " Num Chunks Selected Array\n"); - HDfprintf(debug_file, "------------------------------------\n"); - for (size_t j = 0; j < (size_t) mpi_size; j++) { - HDfprintf(debug_file, "| Process %d has %zd chunks selected.\n", j, num_chunks_selected_array[j]); - } - HDfprintf(debug_file, "------------------------------------\n\n"); -#endif - *chunk_list = local_info_array; *num_entries = num_chunks_selected; - *_num_chunks_selected_array = num_chunks_selected_array; /* Wait for all async send requests to complete before returning */ if (!no_overlap && num_send_requests) { -- cgit v0.12 From 5ed72c3d4138bc0b42123abc9735767e3dfc3e22 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 27 Jan 2017 10:52:17 -0600 Subject: Remove Debugging Statements for Code Review --- src/H5Dmpio.c | 315 +--------------------------------------------------------- 1 file changed, 5 insertions(+), 310 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 72f880b..c5a3fae 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -86,12 +86,6 @@ #define H5D_CHUNK_SELECT_IRREG 2 #define H5D_CHUNK_SELECT_NONE 0 -#define PARALLEL_COMPRESS_DEBUG - -#ifdef PARALLEL_COMPRESS_DEBUG -FILE *debug_file; -#endif - /******************/ /* Local Typedefs */ /******************/ @@ -409,18 +403,6 @@ H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, *_gathered_array = gathered_array; *_gathered_array_num_entries = gathered_array_num_entries; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, " Contents of gathered array:\n"); - HDfprintf(debug_file, "------------------------------\n"); - for (size_t j = 0; j < (size_t) gathered_array_num_entries; j++) { - HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); - HDfprintf(debug_file, "| - Chunk Address: %a\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].old_chunk.offset); - HDfprintf(debug_file, "| - Chunk Length: %zd\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].old_chunk.length); - HDfprintf(debug_file, "| - Address of mspace: %x\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].chunk_info.mspace); - } - HDfprintf(debug_file, "------------------------------\n\n"); -#endif - done: if (receive_counts_array) H5MM_free(receive_counts_array); @@ -913,14 +895,6 @@ H5D__chunk_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_ FUNC_ENTER_PACKAGE -#ifdef PARALLEL_COMPRESS_DEBUG - char name[10]; - - snprintf(name, 10, "out - %d", H5F_mpi_get_rank(io_info->dset->oloc.file)); - - debug_file = fopen(name, "w"); -#endif - /* Call generic selection operation */ if(H5D__chunk_collective_io(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") @@ -1266,8 +1240,6 @@ if(H5DEBUG(D)) * Purpose: Routine for one collective IO with one MPI derived datatype * to link with all filtered chunks * - * XXX: Update later to reflect changes in structure - * * 1. Construct a list of selected chunks in the collective IO * operation * A. If any chunk is being written to by more than 1 @@ -1355,16 +1327,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't construct filtered I/O info list") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Incoming messages from other processes:\n"); - HDfprintf(debug_file, "-----------------------------------------\n"); - for (size_t j = 0; j < chunk_list_num_entries; j++) { - HDfprintf(debug_file, "| Owner of chunk at address %a is expecting messages from %d other processes.\n", - chunk_list[j].old_chunk.offset, chunk_list[j].num_writers - 1); - } - HDfprintf(debug_file, "-----------------------------------------\n\n"); -#endif - if (io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ H5D_chk_idx_info_t index_info; H5D_chunk_ud_t udata; @@ -1382,12 +1344,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in udata.common.storage = index_info.storage; udata.filter_mask = 0; - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Processing chunks:\n"); - HDfprintf(debug_file, "---------------------------------------------------\n"); -#endif - /* Iterate through all the chunks in the collective write operation, * updating each chunk with the data modifications from other processes, * then re-filtering the chunk. @@ -1397,10 +1353,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't process chunk entry") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "---------------------------------------------------\n\n"); -#endif - /* Gather the new chunk sizes to all processes for a collective reallocation * of the chunks in the file. */ @@ -1409,32 +1361,15 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Reallocing chunks:\n"); - HDfprintf(debug_file, "------------------------------\n"); -#endif - /* Collectively re-allocate the modified chunks (from each process) in the file */ for (i = 0; i < collective_chunk_list_num_entries; i++) { hbool_t insert; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Reallocing chunk at address %a with new length of %zd.\n", collective_chunk_list[i].new_chunk.offset, collective_chunk_list[i].new_chunk.length); -#endif - if (H5D__chunk_file_alloc(&index_info, &collective_chunk_list[i].old_chunk, &collective_chunk_list[i].new_chunk, &insert, collective_chunk_list[i].chunk_info.scaled) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Chunk now at address %a.\n|\n", collective_chunk_list[i].new_chunk); -#endif } /* end for */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "------------------------------\n\n"); -#endif - if (NULL == (num_chunks_selected_array = (size_t *) H5MM_malloc((size_t) mpi_size * sizeof(*num_chunks_selected_array)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate num chunks selected array") @@ -1442,15 +1377,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in 1, MPI_UNSIGNED_LONG_LONG, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, " Num Chunks Selected Array\n"); - HDfprintf(debug_file, "------------------------------------\n"); - for (size_t j = 0; j < (size_t) mpi_size; j++) { - HDfprintf(debug_file, "| Process %d has %zd chunks selected.\n", j, num_chunks_selected_array[j]); - } - HDfprintf(debug_file, "------------------------------------\n\n"); -#endif - /* If this process has any chunks selected, create a MPI type for collectively * writing out the chunks to file. Otherwise, the process contributes to the * collective write with a none type. @@ -1499,10 +1425,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* Participate in the collective re-insertion of all chunks modified * in this iteration into the chunk index */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Reinserting chunks into chunk index.\n"); - HDfprintf(debug_file, "---------------------------------------\n"); -#endif for (i = 0; i < collective_chunk_list_num_entries; i++) { udata.chunk_block = collective_chunk_list[i].new_chunk; @@ -1510,15 +1432,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Successfully inserted chunk at address %a into the chunk index.\n", udata.chunk_block.offset); -#endif } /* end for */ - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "---------------------------------------\n"); -#endif } /* end if */ done: @@ -1765,8 +1679,6 @@ done: * Purpose: To do filtered collective IO per chunk to save on memory, * as opposed to collective IO of every chunk at once * - * XXX: Update later to reflect changes in structure - * * 1. Construct a list of selected chunks in the collective IO * operation * A. If any chunk is being written to by more than 1 @@ -1790,19 +1702,19 @@ done: * III. Receive any modification data from other * processes and update the chunk data with these * modifications - * III. Filter the chunk - * IV. Contribute the chunk to an array gathered by + * IV. Filter the chunk + * V. Contribute the chunk to an array gathered by * all processes which contains every chunk * modified in this iteration (up to one chunk * per process, some processes may not have a * selection/may have less chunks to work on than * other processes) - * II. All processes collectively re-allocate each + * VI. All processes collectively re-allocate each * chunk from the gathered array with their new * sizes after the filter operation - * IV. Proceed with the collective write operation + * VII. Proceed with the collective write operation * for the chunks modified on this iteration - * V. All processes collectively re-insert each + * VIII. All processes collectively re-insert each * chunk from the gathered array into the chunk * index * @@ -1893,19 +1805,6 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i udata.common.storage = index_info.storage; udata.filter_mask = 0; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Incoming messages from other processes:\n"); - HDfprintf(debug_file, "-----------------------------------------\n"); - for (size_t k = 0; k < chunk_list_num_entries; k++) { - HDfprintf(debug_file, "| Owner of chunk at address %a is expecting messages from %d other processes.\n", - chunk_list[k].old_chunk.offset, chunk_list[k].num_writers - 1); - } - HDfprintf(debug_file, "-----------------------------------------\n\n"); - - HDfprintf(debug_file, "Processing chunks:\n"); - HDfprintf(debug_file, "---------------------------------------------------\n"); -#endif - /* Retrieve the maximum number of chunks being written among all processes */ if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&chunk_list_num_entries, &max_num_chunks, 1, MPI_UNSIGNED_LONG_LONG, MPI_MAX, io_info->comm))) @@ -1948,35 +1847,17 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Reallocing chunks:\n"); - HDfprintf(debug_file, "------------------------------\n"); -#endif - /* Participate in the collective re-allocation of all chunks modified * in this iteration. */ for (j = 0; j < collective_chunk_list_num_entries; j++) { hbool_t insert = FALSE; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Re-allocing chunk at address %a with new length of %llu bytes.\n", - collective_chunk_list[j].new_chunk.offset, collective_chunk_list[j].new_chunk.length); -#endif - if (H5D__chunk_file_alloc(&index_info, &collective_chunk_list[j].old_chunk, &collective_chunk_list[j].new_chunk, &insert, chunk_list[j].chunk_info.scaled) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Chunk now at address %a.\n|\n", collective_chunk_list[j].new_chunk); -#endif } /* end for */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "------------------------------\n\n"); -#endif - /* If this process has a chunk to work on, create a MPI type for the * memory and file for writing out the chunk */ @@ -1988,11 +1869,6 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* XXX: offset could be wrong if a process runs out of chunks */ HDmemcpy(&chunk_list[i].new_chunk, &collective_chunk_list[mpi_rank].new_chunk, sizeof(chunk_list[i].new_chunk)); -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "New chunk record after memcpy back to local:\n"); - HDfprintf(debug_file, " - Chunk offset: %a, Chunk length: %lld\n", chunk_list[i].new_chunk.offset, chunk_list[i].new_chunk.length); -#endif - H5_CHECKED_ASSIGN(mpi_type_count, int, chunk_list[i].new_chunk.length, hsize_t); /* Create MPI memory type for writing to chunk */ @@ -2031,27 +1907,14 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Participate in the collective re-insertion of all chunks modified * in this iteration into the chunk index */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Reinserting chunks into chunk index.\n"); - HDfprintf(debug_file, "---------------------------------------\n"); -#endif - for (j = 0; j < collective_chunk_list_num_entries; j++) { udata.chunk_block = collective_chunk_list[j].new_chunk; udata.common.scaled = collective_chunk_list[j].chunk_info.scaled; if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Successfully inserted chunk at address %a into the chunk index.\n", udata.chunk_block.offset); -#endif } /* end for */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "---------------------------------------\n"); -#endif - if (collective_chunk_list) collective_chunk_list = (H5D_filtered_collective_io_info_t *) H5MM_free(collective_chunk_list); } /* end for */ @@ -2736,39 +2599,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ chunk_node = H5SL_next(chunk_node); } /* end for */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, " Contents of local info array\n"); - HDfprintf(debug_file, "------------------------------\n"); - for (size_t j = 0; j < (size_t) num_chunks_selected; j++) { - HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); - HDfprintf(debug_file, "| - Chunk Address: %a\n", local_info_array[j].old_chunk.offset); - HDfprintf(debug_file, "| - Chunk Length: %zd\n", local_info_array[j].old_chunk.length); - HDfprintf(debug_file, "| - Address of mspace: %x\n", local_info_array[j].chunk_info.mspace); - HDfprintf(debug_file, "| - Chunk Selection Type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.mspace)); - HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); - } - HDfprintf(debug_file, "------------------------------\n\n"); - - HDfprintf(debug_file, "Testing mem/file space addresses:\n"); - HDfprintf(debug_file, "-----------------------------------\n"); - - for (size_t j = 0; j < num_chunks_selected; j++) { - HDfprintf(debug_file, "| Testing chunk at address %a.\n", local_info_array[j].old_chunk.offset); - HDfprintf(debug_file, "| Mem Space:\n"); - HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(local_info_array[j].chunk_info.mspace)); - HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(local_info_array[j].chunk_info.mspace)); - HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); - HDfprintf(debug_file, "| - Selection type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.mspace)); - HDfprintf(debug_file, "| File Space:\n"); - HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(local_info_array[j].chunk_info.fspace)); - HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(local_info_array[j].chunk_info.fspace)); - HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.fspace)); - HDfprintf(debug_file, "| - Selection type: %d\n|\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.fspace)); - } - - HDfprintf(debug_file, "-----------------------------------\n\n"); -#endif - /* Redistribute shared chunks to new owners as necessary */ if (!no_overlap && (io_info->op_type == H5D_IO_OP_WRITE)) { size_t i; @@ -2846,10 +2676,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Determine size of serialized chunk memory dataspace plus the size * of the data being written */ - /* XXX: Using the file dataspace seems to work here, presumably because the file - * space reflects how the data is actually stored in the file, not in memory. e.g. - * it reflects the chunking setup - */ if (H5S_encode(chunk_entry.chunk_info.fspace, &mod_data, &mod_data_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to get encoded dataspace size") @@ -2858,10 +2684,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ mod_data_size += (size_t) iter_nelmts * type_info->src_type_size; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Allocing %zd bytes for mod. data buffer.\n", (size_t) mod_data_size); -#endif - if (NULL == (mod_data = (unsigned char *) H5MM_malloc(mod_data_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification send buffer") @@ -2875,27 +2697,11 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") mem_iter_init = TRUE; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Iterating over %lld elements.\n", iter_nelmts); -#endif - /* Collect the modification data into the buffer */ if (!H5D__gather_mem(io_info->u.wbuf, chunk_entry.chunk_info.mspace, mem_iter, (size_t) iter_nelmts, io_info->dxpl_cache, mod_data_p)) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't gather from write buffer") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Mod. Data Buffer:\n"); - HDfprintf(debug_file, "| - ["); - for (size_t j = 0; j < (size_t) iter_nelmts; j++) { - if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) mod_data_p)[j]); - } - HDfprintf(debug_file, "]\n|\n"); - - HDfprintf(debug_file, "| Sending modification data for chunk at address %a to process %d.\n", chunk_entry.old_chunk.offset, new_owner); -#endif - /* Send modification data to new owner */ H5_CHECK_OVERFLOW(mod_data_size, size_t, int) H5_CHECK_OVERFLOW(chunk_entry.chunk_info.index, hsize_t, int) @@ -2903,19 +2709,12 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ (int) chunk_entry.chunk_info.index, io_info->comm, &send_requests[num_send_requests++]))) HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Mod. data sent.\n|\n"); -#endif if (mod_data) mod_data = (unsigned char *) H5MM_free(mod_data); if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") mem_iter_init = FALSE; } /* end else */ - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Chunk at address %a re-assigned to process %d.\n|\n", chunk_addr, new_owner); -#endif } /* end for */ /* Release old list */ @@ -2924,22 +2723,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Local info list becomes modified (redistributed) chunk list */ local_info_array = overlap_info_array; - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "This process now has %d chunks selected after redistribution.\n\n", num_chunks_selected); - - HDfprintf(debug_file, " Contents of local info array (after redistribution)\n"); - HDfprintf(debug_file, "------------------------------\n"); - for (size_t j = 0; j < (size_t) num_chunks_selected; j++) { - HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); - HDfprintf(debug_file, "| - Chunk Address: %a\n", local_info_array[j].old_chunk.offset); - HDfprintf(debug_file, "| - Chunk Length: %zd\n", local_info_array[j].old_chunk.length); - HDfprintf(debug_file, "| - Address of mspace: %x\n", local_info_array[j].chunk_info.fspace); - HDfprintf(debug_file, "| - Chunk Selection Type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.fspace)); - HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.fspace)); - } - HDfprintf(debug_file, "------------------------------\n\n"); -#endif } /* end if */ *chunk_list = local_info_array; @@ -3022,11 +2805,6 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun /* Ensure the list is sorted in ascending order of offset in the file */ HDqsort(chunk_list, num_entries, sizeof(*chunk_list), H5D__cmp_filtered_collective_io_info_entry); -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "MPI Write type entries:\n"); - HDfprintf(debug_file, "---------------------------------\n"); -#endif - base_buf = chunk_list[0].buf; for (i = 0; i < num_entries; i++) { /* Set up the offset in the file, the length of the chunk data, and the relative @@ -3035,22 +2813,8 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun file_offset_array[i] = (MPI_Aint) chunk_list[i].new_chunk.offset; length_array[i] = (int) chunk_list[i].new_chunk.length; write_buf_array[i] = (MPI_Aint) chunk_list[i].buf - (MPI_Aint) base_buf; - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Type Entry %zd:\n", i); - HDfprintf(debug_file, "| - Offset: %a; Length: %zd\n", file_offset_array[i], length_array[i]); - HDfprintf(debug_file, "| - Write buffer:\n| ["); - for (size_t j = 0; j < (size_t) length_array[i]; j++) { - HDfprintf(debug_file, "%c, ", ((char *) chunk_list[i].buf)[j]); - } - HDfprintf(debug_file, "]\n|\n"); -#endif } /* end for */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "---------------------------------\n\n"); -#endif - /* Create memory MPI type */ if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int) num_entries, length_array, write_buf_array, MPI_BYTE, new_mem_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) @@ -3113,10 +2877,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HDassert(io_info); HDassert(type_info); -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Chunk at address %a:\n", chunk_entry->old_chunk.offset); -#endif - /* XXX: Determine if a chunk is being fully overwritten by looking at the total selection * in the dataspace */ @@ -3131,12 +2891,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk : (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_entry->chunk_info.fspace) * type_info->src_type_size; chunk_entry->new_chunk.length = buf_size; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Allocing %zd bytes for chunk data buffer.\n", buf_size); - if (io_info->op_type == H5D_IO_OP_WRITE) - HDfprintf(debug_file, "| - Write type is: %s.\n", (full_overwrite) ? "overwrite" : "non-overwrite"); -#endif - if (NULL == (chunk_entry->buf = H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk data buffer") @@ -3152,17 +2906,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, (size_t *) &chunk_entry->new_chunk.length, &buf_size, &chunk_entry->buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "couldn't unfilter chunk for modifying") - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - After decompression: Nbytes=%zd; Buf_size=%zd.\n", chunk_entry->new_chunk.length, buf_size); - - HDfprintf(debug_file, "| - Read buf:\n| - ["); - for (size_t j = 0; j < chunk_entry->new_chunk.length / type_info->src_type_size; j++) { - if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) chunk_entry->buf)[j]); - } - HDfprintf(debug_file, "]\n|\n"); -#endif } /* end if */ /* Initialize iterator for memory selection */ @@ -3212,18 +2955,10 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk io_info->comm, &status))) HMPI_GOTO_ERROR(FAIL, "MPI_Probe failed", mpi_code) -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Found message from source %d with tag %d.\n", status.MPI_SOURCE, status.MPI_TAG); -#endif - /* Retrieve the message size */ if (MPI_SUCCESS != (mpi_code = MPI_Get_count(&status, MPI_BYTE, &count))) HMPI_GOTO_ERROR(FAIL, "MPI_Get_count failed", mpi_code) -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Message size is %d bytes.\n", count); -#endif - if (NULL == (mod_data = (unsigned char *) H5MM_malloc((size_t) count))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate modification data receive buffer") mod_data_p = mod_data; @@ -3232,23 +2967,10 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk (int) chunk_entry->chunk_info.index, io_info->comm, &status))) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mpi_code) -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Received the message.\n"); -#endif - /* Decode the process' chunk file dataspace */ if (NULL == (dataspace = H5S_decode(&mod_data_p))) HGOTO_ERROR(H5E_DATASET, H5E_CANTDECODE, FAIL, "unable to decode dataspace") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Deserialized selection info:\n"); - HDfprintf(debug_file, "| Mem Space:\n"); - HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(dataspace)); - HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(dataspace)); - HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(dataspace)); - HDfprintf(debug_file, "| - Selection type: %d\n", H5S_GET_SELECT_TYPE(dataspace)); -#endif - if (H5S_select_iter_init(mem_iter, dataspace, type_info->dst_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") mem_iter_init = TRUE; @@ -3256,20 +2978,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(dataspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Contents of message:\n| ["); - for (size_t j = 0; j < iter_nelmts; j++) { - if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) mod_data_p)[j]); - } - HDfprintf(debug_file, "]\n"); -#endif - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Iter nelmts=%lld.\n", iter_nelmts); - HDfprintf(debug_file, "| Mem space selected points: %zd.\n| \n", H5S_GET_SELECT_NPOINTS(dataspace)); -#endif - /* Update the chunk data with the received modification data */ if (H5D__scatter_mem(mod_data_p, dataspace, mem_iter, (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf) < 0) @@ -3289,19 +2997,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk mem_iter_init = FALSE; } /* end while */ - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Chunk Data Buffer:\n"); - HDfprintf(debug_file, "| - ["); - for (size_t j = 0; j < chunk_entry->new_chunk.length / type_info->src_type_size; j++) { - if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) chunk_entry->buf)[j]); - } - HDfprintf(debug_file, "]\n|\n"); - - HDfprintf(debug_file, "| - About to filter %zd bytes in buffer of size %zd.\n|\n", chunk_entry->new_chunk.length, buf_size); -#endif - /* Filter the chunk */ if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, -- cgit v0.12 From 79220e9665a57f2bc2216e718fc3aa38017bdded Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Mon, 30 Jan 2017 08:20:15 -0600 Subject: Add back debugging statements Move conditional check inside while loop in construct_filtered_io_info_list --- src/H5Dmpio.c | 304 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 300 insertions(+), 4 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index c5a3fae..9239b21 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -86,6 +86,12 @@ #define H5D_CHUNK_SELECT_IRREG 2 #define H5D_CHUNK_SELECT_NONE 0 +#define PARALLEL_COMPRESS_DEBUG + +#ifdef PARALLEL_COMPRESS_DEBUG +FILE *debug_file; +#endif + /******************/ /* Local Typedefs */ /******************/ @@ -403,6 +409,18 @@ H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, *_gathered_array = gathered_array; *_gathered_array_num_entries = gathered_array_num_entries; +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, " Contents of gathered array:\n"); + HDfprintf(debug_file, "------------------------------\n"); + for (size_t j = 0; j < (size_t) gathered_array_num_entries; j++) { + HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); + HDfprintf(debug_file, "| - Chunk Address: %a\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].old_chunk.offset); + HDfprintf(debug_file, "| - Chunk Length: %zd\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].old_chunk.length); + HDfprintf(debug_file, "| - Address of mspace: %x\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].chunk_info.mspace); + } + HDfprintf(debug_file, "------------------------------\n\n"); +#endif + done: if (receive_counts_array) H5MM_free(receive_counts_array); @@ -895,6 +913,14 @@ H5D__chunk_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_ FUNC_ENTER_PACKAGE +#ifdef PARALLEL_COMPRESS_DEBUG + char name[10]; + + snprintf(name, 10, "out - %d", H5F_mpi_get_rank(io_info->dset->oloc.file)); + + debug_file = fopen(name, "w"); +#endif + /* Call generic selection operation */ if(H5D__chunk_collective_io(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") @@ -1327,6 +1353,16 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't construct filtered I/O info list") +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Incoming messages from other processes:\n"); + HDfprintf(debug_file, "-----------------------------------------\n"); + for (size_t j = 0; j < chunk_list_num_entries; j++) { + HDfprintf(debug_file, "| Owner of chunk at address %a is expecting messages from %d other processes.\n", + chunk_list[j].old_chunk.offset, chunk_list[j].num_writers - 1); + } + HDfprintf(debug_file, "-----------------------------------------\n\n"); +#endif + if (io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ H5D_chk_idx_info_t index_info; H5D_chunk_ud_t udata; @@ -1344,6 +1380,12 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in udata.common.storage = index_info.storage; udata.filter_mask = 0; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Processing chunks:\n"); + HDfprintf(debug_file, "---------------------------------------------------\n"); +#endif + /* Iterate through all the chunks in the collective write operation, * updating each chunk with the data modifications from other processes, * then re-filtering the chunk. @@ -1353,6 +1395,10 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't process chunk entry") +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "---------------------------------------------------\n\n"); +#endif + /* Gather the new chunk sizes to all processes for a collective reallocation * of the chunks in the file. */ @@ -1361,15 +1407,32 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Reallocing chunks:\n"); + HDfprintf(debug_file, "------------------------------\n"); +#endif + /* Collectively re-allocate the modified chunks (from each process) in the file */ for (i = 0; i < collective_chunk_list_num_entries; i++) { hbool_t insert; +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Reallocing chunk at address %a with new length of %zd.\n", collective_chunk_list[i].new_chunk.offset, collective_chunk_list[i].new_chunk.length); +#endif + if (H5D__chunk_file_alloc(&index_info, &collective_chunk_list[i].old_chunk, &collective_chunk_list[i].new_chunk, &insert, collective_chunk_list[i].chunk_info.scaled) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Chunk now at address %a.\n|\n", collective_chunk_list[i].new_chunk); +#endif } /* end for */ +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "------------------------------\n\n"); +#endif + if (NULL == (num_chunks_selected_array = (size_t *) H5MM_malloc((size_t) mpi_size * sizeof(*num_chunks_selected_array)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate num chunks selected array") @@ -1377,6 +1440,15 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in 1, MPI_UNSIGNED_LONG_LONG, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, " Num Chunks Selected Array\n"); + HDfprintf(debug_file, "------------------------------------\n"); + for (size_t j = 0; j < (size_t) mpi_size; j++) { + HDfprintf(debug_file, "| Process %d has %zd chunks selected.\n", j, num_chunks_selected_array[j]); + } + HDfprintf(debug_file, "------------------------------------\n\n"); +#endif + /* If this process has any chunks selected, create a MPI type for collectively * writing out the chunks to file. Otherwise, the process contributes to the * collective write with a none type. @@ -1425,6 +1497,10 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* Participate in the collective re-insertion of all chunks modified * in this iteration into the chunk index */ +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Reinserting chunks into chunk index.\n"); + HDfprintf(debug_file, "---------------------------------------\n"); +#endif for (i = 0; i < collective_chunk_list_num_entries; i++) { udata.chunk_block = collective_chunk_list[i].new_chunk; @@ -1432,7 +1508,15 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Successfully inserted chunk at address %a into the chunk index.\n", udata.chunk_block.offset); +#endif } /* end for */ + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "---------------------------------------\n"); +#endif } /* end if */ done: @@ -1805,6 +1889,19 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i udata.common.storage = index_info.storage; udata.filter_mask = 0; +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Incoming messages from other processes:\n"); + HDfprintf(debug_file, "-----------------------------------------\n"); + for (size_t k = 0; k < chunk_list_num_entries; k++) { + HDfprintf(debug_file, "| Owner of chunk at address %a is expecting messages from %d other processes.\n", + chunk_list[k].old_chunk.offset, chunk_list[k].num_writers - 1); + } + HDfprintf(debug_file, "-----------------------------------------\n\n"); + + HDfprintf(debug_file, "Processing chunks:\n"); + HDfprintf(debug_file, "---------------------------------------------------\n"); +#endif + /* Retrieve the maximum number of chunks being written among all processes */ if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&chunk_list_num_entries, &max_num_chunks, 1, MPI_UNSIGNED_LONG_LONG, MPI_MAX, io_info->comm))) @@ -1847,17 +1944,35 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Reallocing chunks:\n"); + HDfprintf(debug_file, "------------------------------\n"); +#endif + /* Participate in the collective re-allocation of all chunks modified * in this iteration. */ for (j = 0; j < collective_chunk_list_num_entries; j++) { hbool_t insert = FALSE; +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Re-allocing chunk at address %a with new length of %llu bytes.\n", + collective_chunk_list[j].new_chunk.offset, collective_chunk_list[j].new_chunk.length); +#endif + if (H5D__chunk_file_alloc(&index_info, &collective_chunk_list[j].old_chunk, &collective_chunk_list[j].new_chunk, &insert, chunk_list[j].chunk_info.scaled) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Chunk now at address %a.\n|\n", collective_chunk_list[j].new_chunk); +#endif } /* end for */ +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "------------------------------\n\n"); +#endif + /* If this process has a chunk to work on, create a MPI type for the * memory and file for writing out the chunk */ @@ -1869,6 +1984,11 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* XXX: offset could be wrong if a process runs out of chunks */ HDmemcpy(&chunk_list[i].new_chunk, &collective_chunk_list[mpi_rank].new_chunk, sizeof(chunk_list[i].new_chunk)); +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "New chunk record after memcpy back to local:\n"); + HDfprintf(debug_file, " - Chunk offset: %a, Chunk length: %lld\n", chunk_list[i].new_chunk.offset, chunk_list[i].new_chunk.length); +#endif + H5_CHECKED_ASSIGN(mpi_type_count, int, chunk_list[i].new_chunk.length, hsize_t); /* Create MPI memory type for writing to chunk */ @@ -1907,14 +2027,27 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Participate in the collective re-insertion of all chunks modified * in this iteration into the chunk index */ +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "Reinserting chunks into chunk index.\n"); + HDfprintf(debug_file, "---------------------------------------\n"); +#endif + for (j = 0; j < collective_chunk_list_num_entries; j++) { udata.chunk_block = collective_chunk_list[j].new_chunk; udata.common.scaled = collective_chunk_list[j].chunk_info.scaled; if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Successfully inserted chunk at address %a into the chunk index.\n", udata.chunk_block.offset); +#endif } /* end for */ +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "---------------------------------------\n"); +#endif + if (collective_chunk_list) collective_chunk_list = (H5D_filtered_collective_io_info_t *) H5MM_free(collective_chunk_list); } /* end for */ @@ -2599,6 +2732,39 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ chunk_node = H5SL_next(chunk_node); } /* end for */ +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, " Contents of local info array\n"); + HDfprintf(debug_file, "------------------------------\n"); + for (size_t j = 0; j < (size_t) num_chunks_selected; j++) { + HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); + HDfprintf(debug_file, "| - Chunk Address: %a\n", local_info_array[j].old_chunk.offset); + HDfprintf(debug_file, "| - Chunk Length: %zd\n", local_info_array[j].old_chunk.length); + HDfprintf(debug_file, "| - Address of mspace: %x\n", local_info_array[j].chunk_info.mspace); + HDfprintf(debug_file, "| - Chunk Selection Type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.mspace)); + HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); + } + HDfprintf(debug_file, "------------------------------\n\n"); + + HDfprintf(debug_file, "Testing mem/file space addresses:\n"); + HDfprintf(debug_file, "-----------------------------------\n"); + + for (size_t j = 0; j < num_chunks_selected; j++) { + HDfprintf(debug_file, "| Testing chunk at address %a.\n", local_info_array[j].old_chunk.offset); + HDfprintf(debug_file, "| Mem Space:\n"); + HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(local_info_array[j].chunk_info.mspace)); + HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(local_info_array[j].chunk_info.mspace)); + HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); + HDfprintf(debug_file, "| - Selection type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.mspace)); + HDfprintf(debug_file, "| File Space:\n"); + HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(local_info_array[j].chunk_info.fspace)); + HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(local_info_array[j].chunk_info.fspace)); + HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.fspace)); + HDfprintf(debug_file, "| - Selection type: %d\n|\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.fspace)); + } + + HDfprintf(debug_file, "-----------------------------------\n\n"); +#endif + /* Redistribute shared chunks to new owners as necessary */ if (!no_overlap && (io_info->op_type == H5D_IO_OP_WRITE)) { size_t i; @@ -2652,9 +2818,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ } num_writers++; - - if (++i == overlap_info_array_num_entries) break; - } while (overlap_info_array[i].old_chunk.offset == chunk_addr); + } while (++i < overlap_info_array_num_entries && overlap_info_array[i].old_chunk.offset == chunk_addr); if (mpi_rank == new_owner) { /* Make sure the new owner will know how many other processes will @@ -2684,6 +2848,10 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ mod_data_size += (size_t) iter_nelmts * type_info->src_type_size; +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Allocing %zd bytes for mod. data buffer.\n", (size_t) mod_data_size); +#endif + if (NULL == (mod_data = (unsigned char *) H5MM_malloc(mod_data_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification send buffer") @@ -2697,11 +2865,27 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") mem_iter_init = TRUE; +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Iterating over %lld elements.\n", iter_nelmts); +#endif + /* Collect the modification data into the buffer */ if (!H5D__gather_mem(io_info->u.wbuf, chunk_entry.chunk_info.mspace, mem_iter, (size_t) iter_nelmts, io_info->dxpl_cache, mod_data_p)) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't gather from write buffer") +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Mod. Data Buffer:\n"); + HDfprintf(debug_file, "| - ["); + for (size_t j = 0; j < (size_t) iter_nelmts; j++) { + if (j > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) mod_data_p)[j]); + } + HDfprintf(debug_file, "]\n|\n"); + + HDfprintf(debug_file, "| Sending modification data for chunk at address %a to process %d.\n", chunk_entry.old_chunk.offset, new_owner); +#endif + /* Send modification data to new owner */ H5_CHECK_OVERFLOW(mod_data_size, size_t, int) H5_CHECK_OVERFLOW(chunk_entry.chunk_info.index, hsize_t, int) @@ -2709,12 +2893,19 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ (int) chunk_entry.chunk_info.index, io_info->comm, &send_requests[num_send_requests++]))) HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Mod. data sent.\n|\n"); +#endif if (mod_data) mod_data = (unsigned char *) H5MM_free(mod_data); if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") mem_iter_init = FALSE; } /* end else */ + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Chunk at address %a re-assigned to process %d.\n|\n", chunk_addr, new_owner); +#endif } /* end for */ /* Release old list */ @@ -2723,6 +2914,22 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Local info list becomes modified (redistributed) chunk list */ local_info_array = overlap_info_array; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "This process now has %d chunks selected after redistribution.\n\n", num_chunks_selected); + + HDfprintf(debug_file, " Contents of local info array (after redistribution)\n"); + HDfprintf(debug_file, "------------------------------\n"); + for (size_t j = 0; j < (size_t) num_chunks_selected; j++) { + HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); + HDfprintf(debug_file, "| - Chunk Address: %a\n", local_info_array[j].old_chunk.offset); + HDfprintf(debug_file, "| - Chunk Length: %zd\n", local_info_array[j].old_chunk.length); + HDfprintf(debug_file, "| - Address of mspace: %x\n", local_info_array[j].chunk_info.fspace); + HDfprintf(debug_file, "| - Chunk Selection Type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.fspace)); + HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.fspace)); + } + HDfprintf(debug_file, "------------------------------\n\n"); +#endif } /* end if */ *chunk_list = local_info_array; @@ -2805,6 +3012,11 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun /* Ensure the list is sorted in ascending order of offset in the file */ HDqsort(chunk_list, num_entries, sizeof(*chunk_list), H5D__cmp_filtered_collective_io_info_entry); +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "MPI Write type entries:\n"); + HDfprintf(debug_file, "---------------------------------\n"); +#endif + base_buf = chunk_list[0].buf; for (i = 0; i < num_entries; i++) { /* Set up the offset in the file, the length of the chunk data, and the relative @@ -2813,8 +3025,22 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun file_offset_array[i] = (MPI_Aint) chunk_list[i].new_chunk.offset; length_array[i] = (int) chunk_list[i].new_chunk.length; write_buf_array[i] = (MPI_Aint) chunk_list[i].buf - (MPI_Aint) base_buf; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Type Entry %zd:\n", i); + HDfprintf(debug_file, "| - Offset: %a; Length: %zd\n", file_offset_array[i], length_array[i]); + HDfprintf(debug_file, "| - Write buffer:\n| ["); + for (size_t j = 0; j < (size_t) length_array[i]; j++) { + HDfprintf(debug_file, "%c, ", ((char *) chunk_list[i].buf)[j]); + } + HDfprintf(debug_file, "]\n|\n"); +#endif } /* end for */ +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "---------------------------------\n\n"); +#endif + /* Create memory MPI type */ if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int) num_entries, length_array, write_buf_array, MPI_BYTE, new_mem_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) @@ -2877,8 +3103,13 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HDassert(io_info); HDassert(type_info); +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Chunk at address %a:\n", chunk_entry->old_chunk.offset); +#endif + /* XXX: Determine if a chunk is being fully overwritten by looking at the total selection - * in the dataspace + * in the dataspace. Possibly receive all data ahead of time so that the dataspaces can + * be ORed? */ /* If this is a read operation or a write operation where the chunk is not being fully @@ -2891,6 +3122,12 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk : (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_entry->chunk_info.fspace) * type_info->src_type_size; chunk_entry->new_chunk.length = buf_size; +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Allocing %zd bytes for chunk data buffer.\n", buf_size); + if (io_info->op_type == H5D_IO_OP_WRITE) + HDfprintf(debug_file, "| - Write type is: %s.\n", (full_overwrite) ? "overwrite" : "non-overwrite"); +#endif + if (NULL == (chunk_entry->buf = H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk data buffer") @@ -2906,6 +3143,17 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, (size_t *) &chunk_entry->new_chunk.length, &buf_size, &chunk_entry->buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "couldn't unfilter chunk for modifying") + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - After decompression: Nbytes=%zd; Buf_size=%zd.\n", chunk_entry->new_chunk.length, buf_size); + + HDfprintf(debug_file, "| - Read buf:\n| - ["); + for (size_t j = 0; j < chunk_entry->new_chunk.length / type_info->src_type_size; j++) { + if (j > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) chunk_entry->buf)[j]); + } + HDfprintf(debug_file, "]\n|\n"); +#endif } /* end if */ /* Initialize iterator for memory selection */ @@ -2955,10 +3203,18 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk io_info->comm, &status))) HMPI_GOTO_ERROR(FAIL, "MPI_Probe failed", mpi_code) +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Found message from source %d with tag %d.\n", status.MPI_SOURCE, status.MPI_TAG); +#endif + /* Retrieve the message size */ if (MPI_SUCCESS != (mpi_code = MPI_Get_count(&status, MPI_BYTE, &count))) HMPI_GOTO_ERROR(FAIL, "MPI_Get_count failed", mpi_code) +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Message size is %d bytes.\n", count); +#endif + if (NULL == (mod_data = (unsigned char *) H5MM_malloc((size_t) count))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate modification data receive buffer") mod_data_p = mod_data; @@ -2967,10 +3223,23 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk (int) chunk_entry->chunk_info.index, io_info->comm, &status))) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mpi_code) +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Received the message.\n"); +#endif + /* Decode the process' chunk file dataspace */ if (NULL == (dataspace = H5S_decode(&mod_data_p))) HGOTO_ERROR(H5E_DATASET, H5E_CANTDECODE, FAIL, "unable to decode dataspace") +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Deserialized selection info:\n"); + HDfprintf(debug_file, "| Mem Space:\n"); + HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(dataspace)); + HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(dataspace)); + HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(dataspace)); + HDfprintf(debug_file, "| - Selection type: %d\n", H5S_GET_SELECT_TYPE(dataspace)); +#endif + if (H5S_select_iter_init(mem_iter, dataspace, type_info->dst_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") mem_iter_init = TRUE; @@ -2978,6 +3247,20 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(dataspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Contents of message:\n| ["); + for (size_t j = 0; j < iter_nelmts; j++) { + if (j > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) mod_data_p)[j]); + } + HDfprintf(debug_file, "]\n"); +#endif + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Iter nelmts=%lld.\n", iter_nelmts); + HDfprintf(debug_file, "| Mem space selected points: %zd.\n| \n", H5S_GET_SELECT_NPOINTS(dataspace)); +#endif + /* Update the chunk data with the received modification data */ if (H5D__scatter_mem(mod_data_p, dataspace, mem_iter, (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf) < 0) @@ -2997,6 +3280,19 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk mem_iter_init = FALSE; } /* end while */ + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Chunk Data Buffer:\n"); + HDfprintf(debug_file, "| - ["); + for (size_t j = 0; j < chunk_entry->new_chunk.length / type_info->src_type_size; j++) { + if (j > 0) HDfprintf(debug_file, ", "); + HDfprintf(debug_file, "%lld", ((long *) chunk_entry->buf)[j]); + } + HDfprintf(debug_file, "]\n|\n"); + + HDfprintf(debug_file, "| - About to filter %zd bytes in buffer of size %zd.\n|\n", chunk_entry->new_chunk.length, buf_size); +#endif + /* Filter the chunk */ if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, -- cgit v0.12 From 16507a763af9b4c0f81d6fefb4e9d66e3090835f Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Mon, 30 Jan 2017 12:22:16 -0600 Subject: Add mechanism for determining if a chunk is being fully overwritten --- src/H5Dmpio.c | 96 +++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 36 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 9239b21..60865c2 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -106,6 +106,7 @@ typedef struct H5D_filtered_collective_io_info_t { H5D_chunk_info_t chunk_info; H5F_block_t old_chunk; H5F_block_t new_chunk; + hbool_t full_overwrite; size_t io_size; size_t num_writers; int owner; @@ -366,7 +367,6 @@ H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, FUNC_ENTER_STATIC HDassert(io_info); - HDassert(local_array); HDassert(_gathered_array); HDassert(_gathered_array_num_entries); @@ -414,8 +414,8 @@ H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, HDfprintf(debug_file, "------------------------------\n"); for (size_t j = 0; j < (size_t) gathered_array_num_entries; j++) { HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); - HDfprintf(debug_file, "| - Chunk Address: %a\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].old_chunk.offset); - HDfprintf(debug_file, "| - Chunk Length: %zd\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].old_chunk.length); + HDfprintf(debug_file, "| - Chunk Address: %a\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].new_chunk.offset); + HDfprintf(debug_file, "| - Chunk Length: %zd\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].new_chunk.length); HDfprintf(debug_file, "| - Address of mspace: %x\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].chunk_info.mspace); } HDfprintf(debug_file, "------------------------------\n\n"); @@ -2687,6 +2687,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ size_t num_send_requests = 0; size_t num_chunks_selected; size_t overlap_info_array_num_entries; + size_t i; int mpi_rank, mpi_size, mpi_code; herr_t ret_value = SUCCEED; @@ -2705,32 +2706,41 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Get the no overlap property */ - - if (NULL == (local_info_array = (H5D_filtered_collective_io_info_t *) H5MM_malloc(H5SL_count(fm->sel_chunks) * sizeof(*local_info_array)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate local io info array buffer") - - chunk_node = H5SL_first(fm->sel_chunks); - for (num_chunks_selected = 0; chunk_node; num_chunks_selected++) { - H5D_chunk_info_t *chunk_info = (H5D_chunk_info_t *) H5SL_item(chunk_node); + if ((num_chunks_selected = H5SL_count(fm->sel_chunks))) { + H5D_chunk_info_t *chunk_info; H5D_chunk_ud_t udata; hssize_t select_npoints; + hssize_t chunk_npoints; + + if (NULL == (local_info_array = (H5D_filtered_collective_io_info_t *) H5MM_malloc(num_chunks_selected * sizeof(*local_info_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate local io info array buffer") - /* Obtain this chunk's address */ - if (H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") + chunk_node = H5SL_first(fm->sel_chunks); + for (i = 0; chunk_node; i++) { + chunk_info = (H5D_chunk_info_t *) H5SL_item(chunk_node); - local_info_array[num_chunks_selected].chunk_info = *chunk_info; - local_info_array[num_chunks_selected].old_chunk = local_info_array[num_chunks_selected].new_chunk = udata.chunk_block; - local_info_array[num_chunks_selected].num_writers = 0; - local_info_array[num_chunks_selected].owner = mpi_rank; - local_info_array[num_chunks_selected].buf = NULL; + /* Obtain this chunk's address */ + if (H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") - if ((select_npoints = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - local_info_array[num_chunks_selected].io_size = (size_t) select_npoints * type_info->src_type_size; + local_info_array[i].chunk_info = *chunk_info; + local_info_array[i].old_chunk = local_info_array[i].new_chunk = udata.chunk_block; + local_info_array[i].num_writers = 0; + local_info_array[i].owner = mpi_rank; + local_info_array[i].buf = NULL; - chunk_node = H5SL_next(chunk_node); - } /* end for */ + if ((select_npoints = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + local_info_array[i].io_size = (size_t) select_npoints * type_info->src_type_size; + + if ((chunk_npoints = H5S_GET_EXTENT_NPOINTS(chunk_info->fspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + local_info_array[i].full_overwrite = + (local_info_array[i].io_size == (hsize_t) chunk_npoints * type_info->dst_type_size) ? TRUE : FALSE; + + chunk_node = H5SL_next(chunk_node); + } /* end for */ + } /* end if */ #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, " Contents of local info array\n"); @@ -2742,6 +2752,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HDfprintf(debug_file, "| - Address of mspace: %x\n", local_info_array[j].chunk_info.mspace); HDfprintf(debug_file, "| - Chunk Selection Type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.mspace)); HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); + HDfprintf(debug_file, "| - Chunk write status: %s\n", (local_info_array[i].full_overwrite) ? "overwrite" : "update"); } HDfprintf(debug_file, "------------------------------\n\n"); @@ -2767,10 +2778,9 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Redistribute shared chunks to new owners as necessary */ if (!no_overlap && (io_info->op_type == H5D_IO_OP_WRITE)) { - size_t i; - - if (NULL == (send_requests = (MPI_Request *) H5MM_malloc(num_chunks_selected * sizeof(*send_requests)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send requests buffer") + if (num_chunks_selected) + if (NULL == (send_requests = (MPI_Request *) H5MM_malloc(num_chunks_selected * sizeof(*send_requests)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send requests buffer") if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(H5S_sel_iter_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") @@ -2784,6 +2794,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ for (i = 0, num_chunks_selected = 0, num_send_requests = 0; i < overlap_info_array_num_entries;) { H5D_filtered_collective_io_info_t chunk_entry; haddr_t chunk_addr = overlap_info_array[i].old_chunk.offset; + size_t total_io_size = 0; size_t num_writers = 0; size_t max_bytes = 0; int new_owner = 0; @@ -2796,6 +2807,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ * contributing to the chunk and so will not try to access an invalid * dataspace when processes are sending chunk data to new owners */ chunk_entry.chunk_info.fspace = NULL; + chunk_entry.io_size = 0; /* Process duplicate entries caused by another process writing * to the same chunk @@ -2820,12 +2832,28 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ num_writers++; } while (++i < overlap_info_array_num_entries && overlap_info_array[i].old_chunk.offset == chunk_addr); + /* Determine the total IO size to the chunk by all processes combined */ + if (MPI_SUCCESS != (mpi_code = MPI_Reduce(&chunk_entry.io_size, &total_io_size, + 1, MPI_UNSIGNED_LONG_LONG, MPI_SUM, new_owner, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_reduce failed", mpi_code) + if (mpi_rank == new_owner) { + hssize_t chunk_npoints; + /* Make sure the new owner will know how many other processes will * be sending chunk modification data to it */ chunk_entry.num_writers = num_writers; + /* Set the full chunk overwrite status. For simplicity, assume that this is + * a full overwrite of the chunk if the total IO size is equal to the size + * of the chunk and regard overlapping writes as an error. + */ + if ((chunk_npoints = H5S_GET_EXTENT_NPOINTS(chunk_entry.chunk_info.fspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + + chunk_entry.full_overwrite = (total_io_size == (hsize_t) chunk_npoints * type_info->dst_type_size) ? TRUE : FALSE; + /* New owner takes possession of the chunk */ overlap_info_array[num_chunks_selected++] = chunk_entry; } /* end if */ @@ -3091,7 +3119,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk unsigned char *mod_data = NULL; /* Chunk modification data sent by a process to a chunk's owner */ unsigned filter_mask = 0; hssize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */ - hbool_t full_overwrite = FALSE; /* Whether this is a full overwrite of this chunk */ hbool_t mem_iter_init = FALSE; size_t buf_size; H5S_t *dataspace = NULL; /* Other process' dataspace for the chunk */ @@ -3107,25 +3134,20 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HDfprintf(debug_file, "| Chunk at address %a:\n", chunk_entry->old_chunk.offset); #endif - /* XXX: Determine if a chunk is being fully overwritten by looking at the total selection - * in the dataspace. Possibly receive all data ahead of time so that the dataspaces can - * be ORed? - */ - /* If this is a read operation or a write operation where the chunk is not being fully * overwritten, enough memory must be allocated to read the filtered chunk from the file. * If this is a write operation where the chunk is being fully overwritten, enough memory * must be allocated for the size of the unfiltered chunk. */ /* XXX: Return value of macro should be checked */ - buf_size = (!full_overwrite || io_info->op_type == H5D_IO_OP_READ) ? chunk_entry->old_chunk.length + buf_size = (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) ? chunk_entry->old_chunk.length : (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_entry->chunk_info.fspace) * type_info->src_type_size; chunk_entry->new_chunk.length = buf_size; #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "| - Allocing %zd bytes for chunk data buffer.\n", buf_size); if (io_info->op_type == H5D_IO_OP_WRITE) - HDfprintf(debug_file, "| - Write type is: %s.\n", (full_overwrite) ? "overwrite" : "non-overwrite"); + HDfprintf(debug_file, "| - Write type is: %s.\n", (chunk_entry->full_overwrite) ? "overwrite" : "update"); #endif if (NULL == (chunk_entry->buf = H5MM_malloc(buf_size))) @@ -3134,7 +3156,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk /* If this is not a full chunk overwrite or this is a read operation, the chunk must be * read from the file and unfiltered. */ - if (!full_overwrite || io_info->op_type == H5D_IO_OP_READ) { + if (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) { if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_entry->old_chunk.offset, buf_size, H5AC_rawdata_dxpl_id, chunk_entry->buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") @@ -3145,6 +3167,8 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "couldn't unfilter chunk for modifying") #ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Read chunk from file.\n"); + HDfprintf(debug_file, "| - After decompression: Nbytes=%zd; Buf_size=%zd.\n", chunk_entry->new_chunk.length, buf_size); HDfprintf(debug_file, "| - Read buf:\n| - ["); -- cgit v0.12 From 4e6eb3ffe9da72c2a6d65893d227a949befd602a Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Mon, 30 Jan 2017 13:47:41 -0600 Subject: Add minor error code for H5D__mpio_array_gather failures Catch case where total IO size is greater than chunk size (Overlapping write) Update full chunk overwrite code to not need MPI calls --- src/H5Dmpio.c | 47 ++++++++++++++++++++++------------------------- src/H5err.txt | 1 + 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 60865c2..63e0417 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1393,7 +1393,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* XXX: Not sure about minor error code */ for (i = 0; i < chunk_list_num_entries; i++) if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't process chunk entry") + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry") #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "---------------------------------------------------\n\n"); @@ -1402,10 +1402,9 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* Gather the new chunk sizes to all processes for a collective reallocation * of the chunks in the file. */ - /* XXX: change minor error code */ if (H5D__mpio_array_gather(io_info, chunk_list, chunk_list_num_entries, sizeof(*chunk_list), (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "Reallocing chunks:\n"); @@ -1866,10 +1865,10 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i io_info->store = &store; if (io_info->op_type == H5D_IO_OP_READ) { /* Filtered collective read */ - /* XXX: Change minor error code */ + /* XXX: Test with MPI types and collective read to improve performance */ for (i = 0; i < chunk_list_num_entries; i++) if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't process chunk entry") + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't process chunk entry") } /* end if */ else { /* Filtered collective write */ H5D_chk_idx_info_t index_info; @@ -1930,19 +1929,17 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Check if this process has a chunk to work on for this iteration */ hbool_t have_chunk_to_process = i < chunk_list_num_entries; - /* XXX: Not sure about minor error code */ if (have_chunk_to_process) if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't process chunk entry") + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry") /* Gather the new chunk sizes to all processes for a collective re-allocation * of the chunks in the file */ /* XXX: May access unavailable memory on processes with no selection */ - /* XXX: change minor error code */ if (H5D__mpio_array_gather(io_info, &chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(*chunk_list), (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather new chunk sizes") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "Reallocing chunks:\n"); @@ -2736,7 +2733,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if ((chunk_npoints = H5S_GET_EXTENT_NPOINTS(chunk_info->fspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") local_info_array[i].full_overwrite = - (local_info_array[i].io_size == (hsize_t) chunk_npoints * type_info->dst_type_size) ? TRUE : FALSE; + (local_info_array[i].io_size >= (hsize_t) chunk_npoints * type_info->dst_type_size) ? TRUE : FALSE; chunk_node = H5SL_next(chunk_node); } /* end for */ @@ -2752,7 +2749,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HDfprintf(debug_file, "| - Address of mspace: %x\n", local_info_array[j].chunk_info.mspace); HDfprintf(debug_file, "| - Chunk Selection Type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.mspace)); HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); - HDfprintf(debug_file, "| - Chunk write status: %s\n", (local_info_array[i].full_overwrite) ? "overwrite" : "update"); + HDfprintf(debug_file, "| - Chunk write status: %s\n", (local_info_array[j].full_overwrite) ? "overwrite" : "update"); } HDfprintf(debug_file, "------------------------------\n\n"); @@ -2785,11 +2782,10 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(H5S_sel_iter_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") - /* XXX: Change minor error code */ if (H5D__mpio_array_gather(io_info, local_info_array, num_chunks_selected, sizeof(*local_info_array), (void **) &overlap_info_array, &overlap_info_array_num_entries, H5D__cmp_filtered_collective_io_info_entry) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't gather array") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather array") for (i = 0, num_chunks_selected = 0, num_send_requests = 0; i < overlap_info_array_num_entries;) { H5D_filtered_collective_io_info_t chunk_entry; @@ -2807,7 +2803,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ * contributing to the chunk and so will not try to access an invalid * dataspace when processes are sending chunk data to new owners */ chunk_entry.chunk_info.fspace = NULL; - chunk_entry.io_size = 0; /* Process duplicate entries caused by another process writing * to the same chunk @@ -2821,6 +2816,9 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (mpi_rank == overlap_info_array[i].owner) chunk_entry = overlap_info_array[i]; + /* Add this chunk entry's IO size to the running total */ + total_io_size += overlap_info_array[i].io_size; + /* New owner of the chunk is determined by the process * which is writing the most data to the chunk */ @@ -2832,11 +2830,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ num_writers++; } while (++i < overlap_info_array_num_entries && overlap_info_array[i].old_chunk.offset == chunk_addr); - /* Determine the total IO size to the chunk by all processes combined */ - if (MPI_SUCCESS != (mpi_code = MPI_Reduce(&chunk_entry.io_size, &total_io_size, - 1, MPI_UNSIGNED_LONG_LONG, MPI_SUM, new_owner, io_info->comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_reduce failed", mpi_code) - if (mpi_rank == new_owner) { hssize_t chunk_npoints; @@ -2845,14 +2838,17 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ */ chunk_entry.num_writers = num_writers; - /* Set the full chunk overwrite status. For simplicity, assume that this is - * a full overwrite of the chunk if the total IO size is equal to the size - * of the chunk and regard overlapping writes as an error. + /* Set the full chunk overwrite status. It is assumed that this is a full + * overwrite of the chunk if the total IO size is equal to the size of the + * chunk. If the IO size is greater than the size of the chunk, there is an + * overlapping write between processes, meaning there is no guarantee on + * the integrity of data in the write operation. However, this still + * represents a full overwrite of the chunk. */ if ((chunk_npoints = H5S_GET_EXTENT_NPOINTS(chunk_entry.chunk_info.fspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - chunk_entry.full_overwrite = (total_io_size == (hsize_t) chunk_npoints * type_info->dst_type_size) ? TRUE : FALSE; + chunk_entry.full_overwrite = (total_io_size >= (hsize_t) chunk_npoints * type_info->dst_type_size) ? TRUE : FALSE; /* New owner takes possession of the chunk */ overlap_info_array[num_chunks_selected++] = chunk_entry; @@ -3159,12 +3155,12 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk if (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) { if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_entry->old_chunk.offset, buf_size, H5AC_rawdata_dxpl_id, chunk_entry->buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, (size_t *) &chunk_entry->new_chunk.length, &buf_size, &chunk_entry->buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "couldn't unfilter chunk for modifying") + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "couldn't unfilter chunk for modifying") #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "| - Read chunk from file.\n"); @@ -3214,6 +3210,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + /* XXX: Implement re-alloc strategy too avoid too many malloc/frees */ /* Update the chunk data with any modifications from other processes */ while (chunk_entry->num_writers > 1) { const unsigned char *mod_data_p; /* Use second pointer since H5S_decode advances pointer */ diff --git a/src/H5err.txt b/src/H5err.txt index 44c5a93..9aa2e6b 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -244,6 +244,7 @@ MINOR, LINK, H5E_CANTSORT, Can't sort objects MINOR, MPI, H5E_MPI, Some MPI function failed MINOR, MPI, H5E_MPIERRSTR, MPI Error String MINOR, MPI, H5E_CANTRECV, Can't receive data +MINOR, MPI, H5E_CANTGATHER, Can't gather data # Heap errors MINOR, HEAP, H5E_CANTRESTORE, Can't restore condition -- cgit v0.12 From f7cef1b7684d4f64b5d2d1eb8a0528bc3046f4f4 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Tue, 31 Jan 2017 08:11:11 -0600 Subject: Implement realloc strategy when receiving data modification messages --- src/H5Dmpio.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 63e0417..1fc477b 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1390,7 +1390,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in * updating each chunk with the data modifications from other processes, * then re-filtering the chunk. */ - /* XXX: Not sure about minor error code */ for (i = 0; i < chunk_list_num_entries; i++) if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry") @@ -3117,9 +3116,10 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk hssize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */ hbool_t mem_iter_init = FALSE; size_t buf_size; + size_t mod_data_alloced_bytes = 0; H5S_t *dataspace = NULL; /* Other process' dataspace for the chunk */ herr_t ret_value = SUCCEED; - + FUNC_ENTER_STATIC HDassert(chunk_entry); @@ -3236,9 +3236,17 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HDfprintf(debug_file, "| - Message size is %d bytes.\n", count); #endif - if (NULL == (mod_data = (unsigned char *) H5MM_malloc((size_t) count))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate modification data receive buffer") - mod_data_p = mod_data; + if ((size_t) count > mod_data_alloced_bytes) { + if (NULL == (mod_data = (unsigned char *) H5MM_realloc(mod_data, (size_t) count))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate modification data receive buffer") + + mod_data_alloced_bytes = (size_t) count; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| - Re-alloced buffer.\n"); + HDfprintf(debug_file, "| - New size is: %zu.\n", mod_data_alloced_bytes); +#endif + } if (MPI_SUCCESS != (mpi_code = MPI_Recv(mod_data, count, MPI_BYTE, MPI_ANY_SOURCE, (int) chunk_entry->chunk_info.index, io_info->comm, &status))) @@ -3249,6 +3257,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk #endif /* Decode the process' chunk file dataspace */ + mod_data_p = mod_data; if (NULL == (dataspace = H5S_decode(&mod_data_p))) HGOTO_ERROR(H5E_DATASET, H5E_CANTDECODE, FAIL, "unable to decode dataspace") @@ -3289,8 +3298,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk chunk_entry->num_writers--; - if (mod_data) - H5MM_free(mod_data); if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") if (dataspace) { @@ -3328,17 +3335,19 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk break; default: - HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unknown I/O operation") + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "invalid I/O operation") } done: + if (mod_data) + H5MM_free(mod_data); if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + if (mem_iter) + H5MM_free(mem_iter); if (dataspace) if (H5S_close(dataspace) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace") - if (mem_iter) - H5MM_free(mem_iter) FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__filtered_collective_chunk_entry_io() */ -- cgit v0.12 From 3f44709578758948bf6d3381f4fe9af26e049fa8 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Tue, 31 Jan 2017 14:21:30 -0600 Subject: Test code for user passing one-chunk-per-process hint to library --- src/H5Dmpio.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 1fc477b..434517d 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -2673,12 +2673,13 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ { H5D_filtered_collective_io_info_t *local_info_array = NULL; /* The list of initially select chunks for this process */ H5D_filtered_collective_io_info_t *overlap_info_array = NULL; /* The list of all chunks selected in the operation by all processes */ + /* H5D_mpio_filtered_write_mode_t filtered_write_mode = H5D_MPIO_UNSAFE_FILTERED_WRITE; */ + /* H5P_genplist_t *dx_plist; */ H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__gather_mem */ unsigned char *mod_data = NULL; /* Chunk modification data sent by a process to a chunk's owner */ H5SL_node_t *chunk_node; MPI_Request *send_requests = NULL; /* Array of MPI_Isend chunk modification data send requests */ MPI_Status *send_statuses = NULL; /* Array of MPI_Isend chunk modification send statuses */ - hbool_t no_overlap = FALSE; /* Whether or not the user guarantees a one-process-only-per-chunk write style */ hbool_t mem_iter_init = FALSE; size_t num_send_requests = 0; size_t num_chunks_selected; @@ -2694,14 +2695,13 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HDassert(fm); HDassert(chunk_list); HDassert(num_entries); + HDassert(TRUE == H5P_isa_class(io_info->raw_dxpl_id, H5P_DATASET_XFER)); if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") - /* Get the no overlap property */ - if ((num_chunks_selected = H5SL_count(fm->sel_chunks))) { H5D_chunk_info_t *chunk_info; H5D_chunk_ud_t udata; @@ -2772,8 +2772,16 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HDfprintf(debug_file, "-----------------------------------\n\n"); #endif + /* XXX: Add SAFE_FILTERED_CHUNK_WRITE to property lists */ + /* Get the no overlap property */ + /* if (NULL == (dx_plist = (H5P_genplist_t *) H5I_object(io_info->raw_dxpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") + + if (H5P_get(dx_plist, H5D_MPIO_FILTERED_WRITE_MODE, &filtered_write_mode)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "couldn't get filtered chunk write mode property") */ + /* Redistribute shared chunks to new owners as necessary */ - if (!no_overlap && (io_info->op_type == H5D_IO_OP_WRITE)) { + if (io_info->op_type == H5D_IO_OP_WRITE /* && (filtered_write_mode != H5D_MPIO_SAFE_FILTERED_WRITE) */) { if (num_chunks_selected) if (NULL == (send_requests = (MPI_Request *) H5MM_malloc(num_chunks_selected * sizeof(*send_requests)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send requests buffer") @@ -2959,7 +2967,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ *num_entries = num_chunks_selected; /* Wait for all async send requests to complete before returning */ - if (!no_overlap && num_send_requests) { + if (/* (filtered_write_mode != H5D_MPIO_SAFE_FILTERED_WRITE) && */ num_send_requests) { if (NULL == (send_statuses = (MPI_Status *) H5MM_malloc(num_send_requests * sizeof(*send_statuses)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send statuses buffer") @@ -3279,9 +3287,9 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "| Contents of message:\n| ["); - for (size_t j = 0; j < iter_nelmts; j++) { + for (size_t j = 0; j < (size_t) iter_nelmts; j++) { if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) mod_data_p)[j]); + HDfprintf(debug_file, "%lld", ((const long *) mod_data_p)[j]); } HDfprintf(debug_file, "]\n"); #endif -- cgit v0.12 From 3ccc4f7ab3d31715d9df3bcd994fdddaf32ac149 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 2 Feb 2017 10:24:00 -0600 Subject: Fix macro complaint in H5Dmpio.c Fix debugging file output for test suite --- src/H5Dmpio.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 434517d..b475eaf 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -918,7 +918,11 @@ H5D__chunk_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_ snprintf(name, 10, "out - %d", H5F_mpi_get_rank(io_info->dset->oloc.file)); - debug_file = fopen(name, "w"); + debug_file = fopen(name, "a"); + + HDfprintf(debug_file, "**************************\n"); + HDfprintf(debug_file, "* Starting write\n"); + HDfprintf(debug_file, "**************************\n\n"); #endif /* Call generic selection operation */ @@ -926,6 +930,14 @@ H5D__chunk_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_ HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") done: +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "**************************\n"); + HDfprintf(debug_file, "* Finished write\n"); + HDfprintf(debug_file, "**************************\n\n"); + + fclose(debug_file); +#endif + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_collective_write() */ @@ -2251,7 +2263,7 @@ if(H5DEBUG(D)) static int H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2) { - haddr_t addr1, addr2; + haddr_t addr1 = HADDR_UNDEF, addr2 = HADDR_UNDEF; FUNC_ENTER_STATIC_NOERR @@ -2281,7 +2293,7 @@ H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2) static int H5D__cmp_filtered_collective_io_info_entry(const void *filtered_collective_io_info_entry1, const void *filtered_collective_io_info_entry2) { - haddr_t addr1, addr2; + haddr_t addr1 = HADDR_UNDEF, addr2 = HADDR_UNDEF; FUNC_ENTER_STATIC_NOERR -- cgit v0.12 From af3227fe4ea83a42f3d35b26a86898943107bf6f Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 2 Feb 2017 13:18:06 -0600 Subject: Check return value of H5S_GET_EXTENT_NPOINTS macro Fix bug where a process with no selection during Multi-chunk IO could cause other processes to copy back incorrect chunk information after chunk re-allocation --- src/H5Dmpio.c | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index b475eaf..c1d044f 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1361,9 +1361,8 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") /* Build a list of selected chunks in the collective io operation */ - /* XXX: Not sure about correct minor error code */ if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't construct filtered I/O info list") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't construct filtered I/O info list") #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "Incoming messages from other processes:\n"); @@ -1482,10 +1481,9 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HDmemcpy(chunk_list, &collective_chunk_list[offset], num_chunks_selected_array[mpi_rank] * sizeof(H5D_filtered_collective_io_info_t)); /* Create single MPI type encompassing each selection in the dataspace */ - /* XXX: change minor error code */ if (H5D__mpio_filtered_collective_write_type(chunk_list, chunk_list_num_entries, &mem_type, &mem_type_is_derived, &file_type, &file_type_is_derived) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't create MPI link chunk I/O type") + HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "couldn't create MPI link chunk I/O type") /* Override the write buffer to point to the address of the first * chunk data buffer @@ -1834,6 +1832,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i MPI_Datatype *mem_type_array = NULL; hbool_t *file_type_is_derived_array = NULL; hbool_t *mem_type_is_derived_array = NULL; + hbool_t *has_chunk_selected_array = NULL; /* Array of whether or not each process is contributing a chunk to each iteration */ size_t chunk_list_num_entries; size_t collective_chunk_list_num_entries; size_t i, j; /* Local index variable */ @@ -1859,9 +1858,8 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk io mode property") /* Build a list of selected chunks in the collective IO operation */ - /* XXX: change minor error code */ if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "couldn't construct filtered I/O info list") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't construct filtered I/O info list") /* Set up contiguous I/O info object */ HDmemcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); @@ -1981,16 +1979,26 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i HDfprintf(debug_file, "------------------------------\n\n"); #endif + if (NULL == (has_chunk_selected_array = (hbool_t *) H5MM_malloc((size_t) mpi_size * sizeof(*has_chunk_selected_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate num chunks selected array") + + if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&have_chunk_to_process, 1, MPI_C_BOOL, has_chunk_selected_array, + 1, MPI_C_BOOL, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) + /* If this process has a chunk to work on, create a MPI type for the * memory and file for writing out the chunk */ if (have_chunk_to_process) { - int mpi_type_count; + size_t offset; + int mpi_type_count; + + for (j = 0, offset = 0; j < (size_t) mpi_rank; j++) + offset += has_chunk_selected_array[j]; /* Collect the new chunk info back to the local copy, since only the record in the * collective array gets updated by the chunk re-allocation */ - /* XXX: offset could be wrong if a process runs out of chunks */ - HDmemcpy(&chunk_list[i].new_chunk, &collective_chunk_list[mpi_rank].new_chunk, sizeof(chunk_list[i].new_chunk)); + HDmemcpy(&chunk_list[i].new_chunk, &collective_chunk_list[offset].new_chunk, sizeof(chunk_list[i].new_chunk)); #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "New chunk record after memcpy back to local:\n"); @@ -2058,6 +2066,8 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i if (collective_chunk_list) collective_chunk_list = (H5D_filtered_collective_io_info_t *) H5MM_free(collective_chunk_list); + if (has_chunk_selected_array) + has_chunk_selected_array = (hbool_t *) H5MM_free(has_chunk_selected_array); } /* end for */ /* Free the MPI file and memory types, if they were derived */ @@ -3155,9 +3165,18 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk * If this is a write operation where the chunk is being fully overwritten, enough memory * must be allocated for the size of the unfiltered chunk. */ - /* XXX: Return value of macro should be checked */ - buf_size = (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) ? chunk_entry->old_chunk.length - : (hsize_t) H5S_GET_EXTENT_NPOINTS(chunk_entry->chunk_info.fspace) * type_info->src_type_size; + if (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) { + buf_size = chunk_entry->old_chunk.length; + } + else { + hssize_t extent_npoints; + + if ((extent_npoints = H5S_GET_EXTENT_NPOINTS(chunk_entry->chunk_info.fspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + + buf_size = (hsize_t) extent_npoints * type_info->src_type_size; + } + chunk_entry->new_chunk.length = buf_size; #ifdef PARALLEL_COMPRESS_DEBUG @@ -3230,7 +3249,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") - /* XXX: Implement re-alloc strategy too avoid too many malloc/frees */ /* Update the chunk data with any modifications from other processes */ while (chunk_entry->num_writers > 1) { const unsigned char *mod_data_p; /* Use second pointer since H5S_decode advances pointer */ -- cgit v0.12 From b458565918a878d84d619ecbfce917102945ead0 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 3 Feb 2017 13:21:10 -0600 Subject: Fix bug where data doesn't write correctly when MEMSPACE isnt the same as FILESPACE --- src/H5Dmpio.c | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index c1d044f..20b6d08 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1945,7 +1945,6 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Gather the new chunk sizes to all processes for a collective re-allocation * of the chunks in the file */ - /* XXX: May access unavailable memory on processes with no selection */ if (H5D__mpio_array_gather(io_info, &chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(*chunk_list), (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") @@ -3148,6 +3147,8 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk size_t buf_size; size_t mod_data_alloced_bytes = 0; H5S_t *dataspace = NULL; /* Other process' dataspace for the chunk */ + void *tmp_gath_buf = NULL; /* Temporary gather buffer for owner of the chunk to gather into from + application write buffer before scattering out to the chunk data buffer */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -3241,13 +3242,36 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk break; case H5D_IO_OP_WRITE: - /* Update the chunk data with the modifications from the current (owning) process */ + if (NULL == (tmp_gath_buf = H5MM_malloc((hsize_t) iter_nelmts * type_info->src_type_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate temporary gather buffer") + + /* Gather modification data from the application write buffer into a temporary buffer */ if (!H5D__gather_mem(io_info->u.wbuf, chunk_entry->chunk_info.mspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf)) + (size_t) iter_nelmts, io_info->dxpl_cache, tmp_gath_buf)) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't gather from write buffer") - if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + mem_iter_init = FALSE; + + /* Initialize iterator for file selection */ + if (H5S_select_iter_init(mem_iter, chunk_entry->chunk_info.fspace, type_info->dst_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information") + mem_iter_init = TRUE; + + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_entry->chunk_info.fspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + + /* Scatter the owner's modification data into the chunk data buffer according to + * the file space. + */ + if (H5D__scatter_mem(tmp_gath_buf, chunk_entry->chunk_info.fspace, mem_iter, + (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't scatter to chunk data buffer") + + if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + mem_iter_init = FALSE; /* Update the chunk data with any modifications from other processes */ while (chunk_entry->num_writers > 1) { @@ -3336,14 +3360,14 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk chunk_entry->num_writers--; - if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + mem_iter_init = FALSE; if (dataspace) { if (H5S_close(dataspace) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace") dataspace = NULL; } - mem_iter_init = FALSE; } /* end while */ @@ -3374,11 +3398,13 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk break; default: HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "invalid I/O operation") - } + } /* end switch */ done: if (mod_data) H5MM_free(mod_data); + if (tmp_gath_buf) + H5MM_free(tmp_gath_buf); if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") if (mem_iter) -- cgit v0.12 From 09469dfd55cacb0242e1d7a181500ef08c83743e Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 3 Feb 2017 13:42:49 -0600 Subject: Iterator for initial chunk entry IO operation should use source datatype size --- src/H5Dmpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 20b6d08..9cb69d9 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -3221,7 +3221,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") /* XXX: dst_type_size may need to be src_type_size depending on operation */ - if (H5S_select_iter_init(mem_iter, chunk_entry->chunk_info.mspace, type_info->dst_type_size) < 0) + if (H5S_select_iter_init(mem_iter, chunk_entry->chunk_info.mspace, type_info->src_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") mem_iter_init = TRUE; -- cgit v0.12 From ce5e3030502f2ed0f09aad12168635f635444d70 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 3 Feb 2017 14:50:37 -0600 Subject: Fix issue in H5D__mpio_array_gather when no one contributes anything Fix issue in Multi-chunk IO where IO would crash if no one has a selection --- src/H5Dmpio.c | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 9cb69d9..20bc873 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -377,34 +377,37 @@ H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&local_array_num_entries, &gathered_array_num_entries, 1, MPI_INT, MPI_SUM, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) - if (NULL == (gathered_array = H5MM_malloc(gathered_array_num_entries * array_entry_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate gathered array") + /* If 0 entries resulted from the collective operation, no one is writing anything */ + if (gathered_array_num_entries > 0) { + if (NULL == (gathered_array = H5MM_malloc(gathered_array_num_entries * array_entry_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate gathered array") - if (NULL == (receive_counts_array = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*receive_counts_array)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate receive counts array") + if (NULL == (receive_counts_array = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*receive_counts_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate receive counts array") - if (NULL == (displacements_array = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*displacements_array)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate receive displacements array") + if (NULL == (displacements_array = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*displacements_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate receive displacements array") - /* Inform each process of how many entries each other process is contributing to the resulting array */ - if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&local_array_num_entries, 1, MPI_INT, receive_counts_array, 1, MPI_INT, io_info->comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) + /* Inform each process of how many entries each other process is contributing to the resulting array */ + if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&local_array_num_entries, 1, MPI_INT, receive_counts_array, 1, MPI_INT, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) - /* Multiply each receive count by the size of the array entry, since the data is sent as bytes */ - for (i = 0; i < (size_t) mpi_size; i++) - H5_CHECKED_ASSIGN(receive_counts_array[i], int, (size_t) receive_counts_array[i] * array_entry_size, size_t); + /* Multiply each receive count by the size of the array entry, since the data is sent as bytes */ + for (i = 0; i < (size_t) mpi_size; i++) + H5_CHECKED_ASSIGN(receive_counts_array[i], int, (size_t) receive_counts_array[i] * array_entry_size, size_t); - /* Set receive buffer offsets for MPI_Allgatherv */ - displacements_array[0] = 0; - for (i = 1; i < (size_t) mpi_size; i++) - displacements_array[i] = displacements_array[i - 1] + receive_counts_array[i - 1]; + /* Set receive buffer offsets for MPI_Allgatherv */ + displacements_array[0] = 0; + for (i = 1; i < (size_t) mpi_size; i++) + displacements_array[i] = displacements_array[i - 1] + receive_counts_array[i - 1]; - H5_CHECKED_ASSIGN(sendcount, int, local_array_num_entries * array_entry_size, size_t); - if (MPI_SUCCESS != (mpi_code = MPI_Allgatherv(local_array, sendcount, MPI_BYTE, - gathered_array, receive_counts_array, displacements_array, MPI_BYTE, io_info->comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Allgatherv failed", mpi_code) + H5_CHECKED_ASSIGN(sendcount, int, local_array_num_entries * array_entry_size, size_t); + if (MPI_SUCCESS != (mpi_code = MPI_Allgatherv(local_array, sendcount, MPI_BYTE, + gathered_array, receive_counts_array, displacements_array, MPI_BYTE, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Allgatherv failed", mpi_code) - if (sort_func) HDqsort(gathered_array, gathered_array_num_entries, array_entry_size, sort_func); + if (sort_func) HDqsort(gathered_array, gathered_array_num_entries, array_entry_size, sort_func); + } /* end if */ *_gathered_array = gathered_array; *_gathered_array_num_entries = gathered_array_num_entries; @@ -853,7 +856,7 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple chunk MPI-IO") } break; - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1915,6 +1918,9 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i 1, MPI_UNSIGNED_LONG_LONG, MPI_MAX, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) + /* If no one is writing anything at all, end the operation */ + if (!(max_num_chunks > 0)) HGOTO_DONE(SUCCEED); + /* Allocate arrays for storing MPI file and mem types and whether or not the * types were derived. */ -- cgit v0.12 From 5610256c7202ae4c0001d439db3c295b2e1d6a1c Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 8 Feb 2017 11:40:57 -0600 Subject: Trigger error if library tries to break to independent I/O with filters in the pipeline --- src/H5Dio.c | 7 +++++++ src/H5err.txt | 1 + 2 files changed, 8 insertions(+) diff --git a/src/H5Dio.c b/src/H5Dio.c index 6a4e6ec..2122cb0 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -1154,6 +1154,13 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, io_info->io_ops.single_write = H5D__mpio_select_write; } /* end if */ else { + /* Check if there are any filters in the pipeline. If there are, + * we cannot break to independent I/O if this is a write operation; + * otherwise there will be metadata inconsistencies in the file. + */ + if (io_info->op_type == H5D_IO_OP_WRITE && io_info->dset->shared->dcpl_cache.pline.nused > 0) + HGOTO_ERROR(H5E_IO, H5E_NO_INDEPENDENT, FAIL, "can't perform independent write with filters in pipeline") + /* If we won't be doing collective I/O, but the user asked for * collective I/O, change the request to use independent I/O, but * mark it so that we remember to revert the change. diff --git a/src/H5err.txt b/src/H5err.txt index 9aa2e6b..48069a5 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -245,6 +245,7 @@ MINOR, MPI, H5E_MPI, Some MPI function failed MINOR, MPI, H5E_MPIERRSTR, MPI Error String MINOR, MPI, H5E_CANTRECV, Can't receive data MINOR, MPI, H5E_CANTGATHER, Can't gather data +MINOR, MPI, H5E_NO_INDEPENDENT, Can't perform independent IO # Heap errors MINOR, HEAP, H5E_CANTRESTORE, Can't restore condition -- cgit v0.12 From 2de2112cf6dd2557d81e1a71cea0b61e2ced57aa Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 9 Feb 2017 08:26:57 -0600 Subject: Remove note about src_type_size vs dst_type_size --- src/H5Dmpio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 20bc873..785853d 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -3226,7 +3226,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") - /* XXX: dst_type_size may need to be src_type_size depending on operation */ if (H5S_select_iter_init(mem_iter, chunk_entry->chunk_info.mspace, type_info->src_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") mem_iter_init = TRUE; -- cgit v0.12 From 77f155da5d001bee33a63f0199431b8d6bdc4170 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 10 Feb 2017 10:58:48 -0600 Subject: Remove potential infinite loops caused by goto in error label region --- src/H5Dmpio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 785853d..210163a 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -3011,7 +3011,7 @@ done: if (mod_data) H5MM_free(mod_data); if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") if (mem_iter) H5MM_free(mem_iter); @@ -3411,12 +3411,12 @@ done: if (tmp_gath_buf) H5MM_free(tmp_gath_buf); if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") if (mem_iter) H5MM_free(mem_iter); if (dataspace) if (H5S_close(dataspace) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace") + HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace") FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__filtered_collective_chunk_entry_io() */ -- cgit v0.12 From 973594f6ae445978697eb2333d14009ddb2ab103 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Mon, 20 Feb 2017 09:03:45 -0600 Subject: Fix issue with uninitialized chunk index during chunk re-insertion into index --- src/H5Dmpio.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 210163a..f3c8cb9 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1516,12 +1516,17 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in for (i = 0; i < collective_chunk_list_num_entries; i++) { udata.chunk_block = collective_chunk_list[i].new_chunk; udata.common.scaled = collective_chunk_list[i].chunk_info.scaled; + udata.chunk_idx = collective_chunk_list[i].chunk_info.index; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Reinserting chunk at index %llu.\n", udata.chunk_idx); +#endif if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Successfully inserted chunk at address %a into the chunk index.\n", udata.chunk_block.offset); + HDfprintf(debug_file, "| Successfully inserted chunk at address %a into the chunk index at index %llu.\n", udata.chunk_block.offset, udata.chunk_idx); #endif } /* end for */ @@ -2056,12 +2061,17 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i for (j = 0; j < collective_chunk_list_num_entries; j++) { udata.chunk_block = collective_chunk_list[j].new_chunk; udata.common.scaled = collective_chunk_list[j].chunk_info.scaled; + udata.chunk_idx = collective_chunk_list[j].chunk_info.index; + +#ifdef PARALLEL_COMPRESS_DEBUG + HDfprintf(debug_file, "| Reinserting chunk at index %llu.\n", udata.chunk_idx); +#endif if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") #ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Successfully inserted chunk at address %a into the chunk index.\n", udata.chunk_block.offset); + HDfprintf(debug_file, "| Successfully inserted chunk at address %a into the chunk index at index %llu.\n", udata.chunk_block.offset, udata.chunk_idx); #endif } /* end for */ -- cgit v0.12 From fb7cbe8acb05c9a74378efb66cd60ed3a9c6061f Mon Sep 17 00:00:00 2001 From: Frank T Willmore Date: Tue, 21 Feb 2017 15:13:03 -0600 Subject: removed erroneous casts from non-rvalue H5MM_free() calls. Replaced assignment of void return values with explicit value of NULL --- src/H5Dmpio.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index f3c8cb9..100aa97 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -2079,10 +2079,14 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i HDfprintf(debug_file, "---------------------------------------\n"); #endif - if (collective_chunk_list) - collective_chunk_list = (H5D_filtered_collective_io_info_t *) H5MM_free(collective_chunk_list); - if (has_chunk_selected_array) - has_chunk_selected_array = (hbool_t *) H5MM_free(has_chunk_selected_array); + if (collective_chunk_list){ + H5MM_free(collective_chunk_list); + collective_chunk_list = NULL; + } + if (has_chunk_selected_array){ + H5MM_free(has_chunk_selected_array); + has_chunk_selected_array = NULL; + } } /* end for */ /* Free the MPI file and memory types, if they were derived */ @@ -2964,8 +2968,10 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ #ifdef PARALLEL_COMPRESS_DEBUG HDfprintf(debug_file, "| Mod. data sent.\n|\n"); #endif - if (mod_data) - mod_data = (unsigned char *) H5MM_free(mod_data); + if (mod_data) { + H5MM_free(mod_data); + mod_data = NULL; + } if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") mem_iter_init = FALSE; -- cgit v0.12 From 104d63f25a8cb6e156bc901eb85aafc0b67775ee Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 10 Mar 2017 08:32:24 -0600 Subject: Merge latest changes from develop --- CMakeFilters.cmake | 54 +- CMakeInstallation.cmake | 146 +- CMakeLists.txt | 330 +++-- CTestConfig.cmake | 4 +- MANIFEST | 59 +- UserMacros.cmake | 7 +- c++/CMakeLists.txt | 8 +- c++/examples/CMakeLists.txt | 12 +- c++/examples/CMakeTests.cmake | 49 +- c++/src/CMakeLists.txt | 9 +- c++/src/H5AbstractDs.cpp | 436 +++--- c++/src/H5AbstractDs.h | 68 +- c++/src/H5ArrayType.cpp | 142 +- c++/src/H5ArrayType.h | 48 +- c++/src/H5AtomType.cpp | 360 ++--- c++/src/H5AtomType.h | 60 +- c++/src/H5Attribute.cpp | 500 +++---- c++/src/H5Attribute.h | 94 +- c++/src/H5Classes.h | 52 +- c++/src/H5CommonFG.cpp | 413 +++--- c++/src/H5CommonFG.h | 68 +- c++/src/H5CompType.cpp | 582 ++++---- c++/src/H5CompType.h | 126 +- c++/src/H5CppDoc.h | 18 +- c++/src/H5DataSet.cpp | 820 +++++----- c++/src/H5DataSet.h | 120 +- c++/src/H5DataSpace.cpp | 793 +++++----- c++/src/H5DataSpace.h | 152 +- c++/src/H5DataType.cpp | 928 ++++++------ c++/src/H5DataType.h | 156 +- c++/src/H5DcreatProp.cpp | 902 +++++------ c++/src/H5DcreatProp.h | 199 ++- c++/src/H5DxferProp.cpp | 578 ++++---- c++/src/H5DxferProp.h | 126 +- c++/src/H5EnumType.cpp | 354 ++--- c++/src/H5EnumType.h | 72 +- c++/src/H5Exception.cpp | 650 ++++---- c++/src/H5Exception.h | 154 +- c++/src/H5FaccProp.cpp | 862 +++++------ c++/src/H5FaccProp.h | 164 +- c++/src/H5FcreatProp.cpp | 365 +++-- c++/src/H5FcreatProp.h | 89 +- c++/src/H5File.cpp | 661 +++++---- c++/src/H5File.h | 125 +- c++/src/H5FloatType.cpp | 402 ++--- c++/src/H5FloatType.h | 66 +- c++/src/H5Group.cpp | 146 +- c++/src/H5Group.h | 58 +- c++/src/H5IdComponent.cpp | 392 +++-- c++/src/H5IdComponent.h | 110 +- c++/src/H5Include.h | 4 +- c++/src/H5IntType.cpp | 168 +-- c++/src/H5IntType.h | 42 +- c++/src/H5LaccProp.cpp | 34 +- c++/src/H5LaccProp.h | 26 +- c++/src/H5Library.cpp | 200 +-- c++/src/H5Library.h | 36 +- c++/src/H5Location.cpp | 1921 ++++++++++++------------ c++/src/H5Location.h | 298 ++-- c++/src/H5Object.cpp | 419 +++--- c++/src/H5Object.h | 136 +- c++/src/H5OcreatProp.cpp | 124 +- c++/src/H5OcreatProp.h | 42 +- c++/src/H5PredType.cpp | 453 +++--- c++/src/H5PredType.h | 328 ++-- c++/src/H5PropList.cpp | 769 +++++----- c++/src/H5PropList.h | 142 +- c++/src/H5StrType.cpp | 326 ++-- c++/src/H5StrType.h | 56 +- c++/src/H5VarLenType.cpp | 96 +- c++/src/H5VarLenType.h | 32 +- c++/test/CMakeLists.txt | 2 +- c++/test/CMakeTests.cmake | 27 +- c++/test/dsets.cpp | 1668 ++++++++++----------- c++/test/h5cpputil.cpp | 142 +- c++/test/h5cpputil.h | 70 +- c++/test/tarray.cpp | 486 +++--- c++/test/tattr.cpp | 2062 +++++++++++++------------- c++/test/tcompound.cpp | 958 ++++++------ c++/test/tdspl.cpp | 124 +- c++/test/testhdf5.cpp | 88 +- c++/test/tfile.cpp | 844 ++++++----- c++/test/tfilter.cpp | 90 +- c++/test/th5s.cpp | 575 ++++--- c++/test/titerate.cpp | 370 ++--- c++/test/tlinks.cpp | 312 ++-- c++/test/tobject.cpp | 500 +++---- c++/test/trefer.cpp | 1062 ++++++------- c++/test/ttypes.cpp | 622 ++++---- c++/test/tvlstr.cpp | 1022 ++++++------- config/cmake/CMakeFindJavaCommon.cmake | 14 +- config/cmake/ConfigureChecks.cmake | 102 +- config/cmake/FindHDFJAVA.cmake.in | 12 +- config/cmake/FindJNI.cmake | 2 - config/cmake/HDF518_Examples.cmake.in | 80 +- config/cmake/HDF5Macros.cmake | 24 +- config/cmake/HDF5UseFortran.cmake | 285 ++-- config/cmake/HDF5_Examples.cmake.in | 264 ++-- config/cmake/HDF5_Process_Flex_Files.cmake | 4 +- config/cmake/HDFCompilerFlags.cmake | 200 +-- config/cmake/README.txt.cmake.in | 2 +- config/cmake/UseJava.cmake | 2 +- config/cmake/UserMacros/Windows_MT.cmake | 19 +- config/cmake/cacheinit.cmake | 2 + config/cmake/hdf5-config-version.cmake.in | 30 +- config/cmake/hdf5-config.cmake.in | 2 +- config/cmake/jrunTest.cmake | 154 +- config/cmake/scripts/CTestScript.cmake | 379 +++-- config/cmake/scripts/HDF5config.cmake | 209 ++- config/cmake/userblockTest.cmake | 34 +- config/cmake/vfdTest.cmake | 45 +- config/cmake_ext_mod/CheckTypeSize.cmake | 24 +- config/cmake_ext_mod/ConfigureChecks.cmake | 208 +-- config/cmake_ext_mod/FindMPI.cmake | 37 +- config/cmake_ext_mod/FindSZIP.cmake | 44 +- config/cmake_ext_mod/HDFLibMacros.cmake | 43 +- config/cmake_ext_mod/HDFMacros.cmake | 160 +- config/cmake_ext_mod/HDFUseFortran.cmake | 23 +- config/cmake_ext_mod/grepTest.cmake | 20 +- config/cmake_ext_mod/prunTest.cmake | 145 -- config/cmake_ext_mod/runTest.cmake | 80 +- configure.ac | 14 +- examples/CMakeLists.txt | 12 +- examples/CMakeTests.cmake | 92 +- fortran/CMakeLists.txt | 12 +- fortran/examples/CMakeLists.txt | 16 +- fortran/examples/CMakeTests.cmake | 88 +- fortran/src/CMakeLists.txt | 58 +- fortran/src/Makefile.am | 4 +- fortran/test/CMakeLists.txt | 60 +- fortran/test/CMakeTests.cmake | 124 +- fortran/testpar/CMakeLists.txt | 10 +- hl/CMakeLists.txt | 10 +- hl/c++/CMakeLists.txt | 6 +- hl/c++/examples/CMakeLists.txt | 4 +- hl/c++/examples/CMakeTests.cmake | 17 +- hl/c++/src/CMakeLists.txt | 9 +- hl/c++/test/CMakeLists.txt | 2 +- hl/c++/test/CMakeTests.cmake | 15 +- hl/examples/CMakeLists.txt | 6 +- hl/examples/CMakeTests.cmake | 27 +- hl/fortran/CMakeLists.txt | 6 +- hl/fortran/examples/CMakeLists.txt | 8 +- hl/fortran/examples/CMakeTests.cmake | 17 +- hl/fortran/src/CMakeLists.txt | 44 +- hl/fortran/test/CMakeLists.txt | 10 +- hl/fortran/test/CMakeTests.cmake | 122 +- hl/src/CMakeLists.txt | 9 +- hl/test/CMakeLists.txt | 8 +- hl/test/CMakeTests.cmake | 23 +- hl/tools/CMakeLists.txt | 2 +- hl/tools/gif2h5/CMakeLists.txt | 24 +- hl/tools/h5watch/CMakeLists.txt | 18 +- hl/tools/h5watch/CMakeTests.cmake | 66 +- java/CMakeLists.txt | 12 +- java/examples/CMakeLists.txt | 2 +- java/examples/datasets/CMakeLists.txt | 40 +- java/examples/datasets/H5Ex_D_Chunk.java | 5 +- java/examples/datasets/H5Ex_D_Compact.java | 5 +- java/examples/datasets/runExample.sh.in | 2 + java/examples/datatypes/CMakeLists.txt | 28 +- java/examples/datatypes/runExample.sh.in | 1 + java/examples/groups/CMakeLists.txt | 38 +- java/examples/groups/runExample.sh.in | 8 + java/examples/intro/CMakeLists.txt | 30 +- java/examples/intro/runExample.sh.in | 1 + java/src/CMakeLists.txt | 2 +- java/src/Makefile.am | 1 + java/src/hdf/CMakeLists.txt | 2 +- java/src/hdf/hdf5lib/CMakeLists.txt | 4 +- java/src/hdf/hdf5lib/H5.java | 6 +- java/src/jni/CMakeLists.txt | 10 +- java/src/jni/h5Constants.c | 1222 +++++++-------- java/src/jni/h5dImp.h | 4 +- java/src/jni/h5fImp.h | 8 +- java/src/jni/h5gImp.h | 4 +- java/src/jni/h5oImp.h | 4 +- java/src/jni/h5tImp.h | 4 +- java/test/CMakeLists.txt | 16 +- java/test/JUnit-interface.txt | 3 +- java/test/TestH5Ocopy.java | 1 + java/test/TestH5Pvirtual.java | 5 +- java/test/junit.sh.in | 9 + release_docs/INSTALL_CMake.txt | 308 ++-- release_docs/RELEASE.txt | 1475 ++---------------- release_docs/USING_CMake_Examples.txt | 4 +- release_docs/USING_HDF5_CMake.txt | 232 +-- src/CMakeLists.txt | 40 +- src/H5AC.c | 308 ++-- src/H5ACdbg.c | 203 ++- src/H5ACmpio.c | 80 +- src/H5ACpkg.h | 13 +- src/H5ACprivate.h | 69 +- src/H5ACpublic.h | 61 + src/H5B2pkg.h | 9 - src/H5Bpkg.h | 3 - src/H5C.c | 1850 +++++++++++++---------- src/H5Cdbg.c | 467 +++++- src/H5Cepoch.c | 5 +- src/H5Cmpio.c | 377 ++--- src/H5Cpkg.h | 564 +++++-- src/H5Cprivate.h | 481 +++++- src/H5Cquery.c | 5 +- src/H5EApkg.h | 15 - src/H5F.c | 74 +- src/H5FApkg.h | 9 - src/H5FDmulti.c | 14 +- src/H5FSpkg.h | 6 - src/H5Fint.c | 67 +- src/H5Fio.c | 2 +- src/H5Fpkg.h | 12 +- src/H5Fprivate.h | 4 + src/H5Fpublic.h | 1 + src/H5Fsuper.c | 58 +- src/H5Gpkg.h | 3 - src/H5HFcache.c | 684 ++++++++- src/H5HFpkg.h | 9 - src/H5HGpkg.h | 3 - src/H5HLpkg.h | 6 - src/H5MF.c | 193 +-- src/H5MFaggr.c | 15 +- src/H5MFprivate.h | 8 +- src/H5O.c | 7 +- src/H5Opkg.h | 13 +- src/H5Oprivate.h | 16 +- src/H5Pfapl.c | 255 ++++ src/H5Ppublic.h | 2 + src/H5SMpkg.h | 2 - src/H5win32defs.h | 4 +- src/Makefile.am | 6 +- test/CMakeLists.txt | 137 +- test/CMakeTests.cmake | 288 ++-- test/Makefile.am | 51 +- test/cache.c | 417 +++--- test/cache_api.c | 16 +- test/cache_common.c | 132 +- test/cache_common.h | 3 +- test/cache_tagging.c | 10 +- test/dsets.c | 10 +- test/earray.c | 246 --- test/enc_dec_plist.c | 7 + test/evict_on_close.c | 16 +- test/fheap.c | 104 +- test/fillval.c | 2 +- test/freespace.c | 10 +- test/gen_plist.c | 9 + test/h5test.c | 4 +- test/links.c | 15 +- test/objcopy.c | 2 +- test/swmr_check_compat_vfd.c | 6 +- test/testfiles/plist_files/dapl_32be | Bin 136 -> 186 bytes test/testfiles/plist_files/dapl_32le | Bin 136 -> 186 bytes test/testfiles/plist_files/dapl_64be | Bin 136 -> 186 bytes test/testfiles/plist_files/dapl_64le | Bin 136 -> 186 bytes test/testfiles/plist_files/def_dapl_32be | Bin 131 -> 181 bytes test/testfiles/plist_files/def_dapl_32le | Bin 131 -> 181 bytes test/testfiles/plist_files/def_dapl_64be | Bin 131 -> 181 bytes test/testfiles/plist_files/def_dapl_64le | Bin 131 -> 181 bytes test/testfiles/plist_files/def_dxpl_32be | Bin 225 -> 245 bytes test/testfiles/plist_files/def_dxpl_32le | Bin 225 -> 245 bytes test/testfiles/plist_files/def_dxpl_64be | Bin 225 -> 245 bytes test/testfiles/plist_files/def_dxpl_64le | Bin 225 -> 245 bytes test/testfiles/plist_files/def_fapl_32be | Bin 1460 -> 1520 bytes test/testfiles/plist_files/def_fapl_32le | Bin 1460 -> 1520 bytes test/testfiles/plist_files/def_fapl_64be | Bin 1460 -> 1520 bytes test/testfiles/plist_files/def_fapl_64le | Bin 1460 -> 1520 bytes test/testfiles/plist_files/dxpl_32be | Bin 229 -> 249 bytes test/testfiles/plist_files/dxpl_32le | Bin 229 -> 249 bytes test/testfiles/plist_files/dxpl_64be | Bin 229 -> 249 bytes test/testfiles/plist_files/dxpl_64le | Bin 229 -> 249 bytes test/testfiles/plist_files/fapl_32be | Bin 1462 -> 1522 bytes test/testfiles/plist_files/fapl_32le | Bin 1462 -> 1522 bytes test/testfiles/plist_files/fapl_64be | Bin 1462 -> 1522 bytes test/testfiles/plist_files/fapl_64le | Bin 1462 -> 1522 bytes test/testfiles/plist_files/fcpl_32be | Bin 413 -> 413 bytes test/testfiles/plist_files/fcpl_32le | Bin 413 -> 413 bytes test/testfiles/plist_files/fcpl_64be | Bin 413 -> 413 bytes test/testfiles/plist_files/fcpl_64le | Bin 413 -> 413 bytes test/testfiles/plist_files/lapl_32be | Bin 1565 -> 1625 bytes test/testfiles/plist_files/lapl_32le | Bin 1565 -> 1625 bytes test/testfiles/plist_files/lapl_64be | Bin 1565 -> 1625 bytes test/testfiles/plist_files/lapl_64le | Bin 1565 -> 1625 bytes test/testflushrefresh.sh.in | 4 +- test/tfile.c | 123 +- test/unlink.c | 4 +- test/vds.c | 55 +- testpar/CMakeLists.txt | 4 +- testpar/CMakeTests.cmake | 22 +- testpar/t_cache.c | 44 +- tools/CMakeLists.txt | 6 +- tools/lib/CMakeLists.txt | 9 +- tools/lib/h5diff.c | 168 +-- tools/lib/h5diff_array.c | 25 +- tools/lib/h5diff_dset.c | 3 + tools/lib/h5tools_dump.c | 134 +- tools/src/CMakeLists.txt | 2 +- tools/src/h5copy/CMakeLists.txt | 35 +- tools/src/h5diff/CMakeLists.txt | 53 +- tools/src/h5dump/CMakeLists.txt | 39 +- tools/src/h5dump/h5dump_xml.c | 2 +- tools/src/h5format_convert/CMakeLists.txt | 21 +- tools/src/h5import/CMakeLists.txt | 21 +- tools/src/h5jam/CMakeLists.txt | 23 +- tools/src/h5ls/CMakeLists.txt | 39 +- tools/src/h5repack/CMakeLists.txt | 35 +- tools/src/h5repack/h5repack.c | 36 +- tools/src/h5repack/h5repack_copy.c | 24 +- tools/src/h5repack/h5repack_main.c | 425 +++--- tools/src/h5repack/h5repack_parse.c | 7 +- tools/src/h5repack/h5repack_verify.c | 9 +- tools/src/h5stat/CMakeLists.txt | 35 +- tools/src/misc/CMakeLists.txt | 27 +- tools/test/CMakeLists.txt | 2 +- tools/test/h5copy/CMakeLists.txt | 4 +- tools/test/h5copy/CMakeTests.cmake | 152 +- tools/test/h5copy/testh5copy.sh.in | 95 +- tools/test/h5diff/CMakeLists.txt | 32 +- tools/test/h5diff/CMakeTests.cmake | 143 +- tools/test/h5diff/Makefile.am | 16 + tools/test/h5diff/h5diffgentest.c | 263 +++- tools/test/h5diff/testh5diff.sh.in | 36 +- tools/test/h5dump/CMakeLists.txt | 32 +- tools/test/h5dump/CMakeTests.cmake | 150 +- tools/test/h5dump/CMakeTestsPBITS.cmake | 18 +- tools/test/h5dump/CMakeTestsVDS.cmake | 34 +- tools/test/h5dump/CMakeTestsXML.cmake | 26 +- tools/test/h5dump/Makefile.am | 16 +- tools/test/h5dump/h5dumpgentest.c | 152 +- tools/test/h5format_convert/CMakeLists.txt | 4 +- tools/test/h5format_convert/CMakeTests.cmake | 50 +- tools/test/h5format_convert/h5fc_gentest.c | 3 +- tools/test/h5format_convert/testh5fc.sh.in | 3 + tools/test/h5import/CMakeLists.txt | 2 +- tools/test/h5import/CMakeTests.cmake | 44 +- tools/test/h5jam/CMakeLists.txt | 4 +- tools/test/h5jam/CMakeTests.cmake | 68 +- tools/test/h5ls/CMakeLists.txt | 30 +- tools/test/h5ls/CMakeTests.cmake | 66 +- tools/test/h5ls/CMakeTestsVDS.cmake | 14 +- tools/test/h5ls/Makefile.am | 16 + tools/test/h5ls/testh5ls.sh.in | 38 +- tools/test/h5repack/CMakeLists.txt | 2 +- tools/test/h5repack/CMakeTests.cmake | 199 +-- tools/test/h5repack/h5repack.sh.in | 30 +- tools/test/h5repack/h5repacktst.c | 3 +- tools/test/h5stat/CMakeLists.txt | 4 +- tools/test/h5stat/CMakeTests.cmake | 18 +- tools/test/misc/CMakeLists.txt | 4 +- tools/test/misc/CMakeTests.cmake | 32 +- tools/test/misc/Makefile.am | 2 +- tools/test/misc/testh5repart.sh.in | 2 +- tools/test/misc/vds/CMakeLists.txt | 6 +- tools/test/perform/CMakeLists.txt | 8 +- tools/test/perform/CMakeTests.cmake | 111 +- tools/test/perform/sio_perf.c | 4 - 355 files changed, 25375 insertions(+), 22358 deletions(-) delete mode 100644 config/cmake_ext_mod/prunTest.cmake diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index b7aa77d..700ef15 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -17,14 +17,14 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (NOT TGZPATH) set (TGZPATH ${HDF5_SOURCE_DIR}) - endif (NOT TGZPATH) + endif () set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME}) set (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME}) - else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") + else () set (ZLIB_USE_EXTERNAL 0) set (SZIP_USE_EXTERNAL 0) - endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") -endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif () +endif () #----------------------------------------------------------------------------- # Option for ZLib support @@ -39,9 +39,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) if (ZLIB_FOUND) set (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_LIBRARIES}) - endif (ZLIB_FOUND) - endif (NOT ZLIB_FOUND) - endif (NOT ZLIB_USE_EXTERNAL) + endif () + endif () + endif () if (ZLIB_FOUND) set (H5_HAVE_FILTER_DEFLATE 1) set (H5_HAVE_ZLIB_H 1) @@ -49,33 +49,33 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) set (H5_ZLIB_HEADER "zlib.h") set (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) - else (ZLIB_FOUND) + else () if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) set (H5_HAVE_FILTER_DEFLATE 1) set (H5_HAVE_ZLIB_H 1) set (H5_HAVE_LIBZ 1) message (STATUS "Filter ZLIB is built") - else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + else () message (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") - endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - endif (ZLIB_FOUND) - else (NOT H5_ZLIB_HEADER) + endif () + endif () + else () # This project is being called from within another and ZLib is already configured set (H5_HAVE_FILTER_DEFLATE 1) set (H5_HAVE_ZLIB_H 1) set (H5_HAVE_LIBZ 1) - endif (NOT H5_ZLIB_HEADER) + endif () if (H5_HAVE_FILTER_DEFLATE) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") - endif (H5_HAVE_FILTER_DEFLATE) + endif () if (BUILD_SHARED_LIBS) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) - endif (BUILD_SHARED_LIBS) + endif () set (LINK_LIBS ${LINK_LIBS} ${ZLIB_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) message (STATUS "Filter ZLIB is ON") -endif (HDF5_ENABLE_Z_LIB_SUPPORT) +endif () #----------------------------------------------------------------------------- # Option for SzLib support @@ -90,37 +90,37 @@ if (HDF5_ENABLE_SZIP_SUPPORT) if (SZIP_FOUND) set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_LIBRARIES}) - endif (SZIP_FOUND) - endif (NOT SZIP_FOUND) - endif (NOT SZIP_USE_EXTERNAL) + endif () + endif () + endif () if (SZIP_FOUND) set (H5_HAVE_FILTER_SZIP 1) set (H5_HAVE_SZLIB_H 1) set (H5_HAVE_LIBSZ 1) set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIRS} ${SZIP_INCLUDE_DIR}) - else (SZIP_FOUND) + else () if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING}) set (H5_HAVE_FILTER_SZIP 1) set (H5_HAVE_SZLIB_H 1) set (H5_HAVE_LIBSZ 1) message (STATUS "Filter SZIP is built") - else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + else () message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") - endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - endif (SZIP_FOUND) + endif () + endif () if (BUILD_SHARED_LIBS) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) - endif (BUILD_SHARED_LIBS) + endif () set (LINK_LIBS ${LINK_LIBS} ${SZIP_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) message (STATUS "Filter SZIP is ON") if (H5_HAVE_FILTER_SZIP) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") - endif (H5_HAVE_FILTER_SZIP) + endif () if (HDF5_ENABLE_SZIP_ENCODING) set (H5_HAVE_SZIP_ENCODER 1) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} ENCODE") - endif (HDF5_ENABLE_SZIP_ENCODING) -endif (HDF5_ENABLE_SZIP_SUPPORT) + endif () +endif () diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 65d2222..3f0f7ca 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -8,9 +8,9 @@ if (WIN32) find_program (NSIS_EXECUTABLE NSIS.exe PATHS "$ENV{ProgramFiles}\\NSIS" "$ENV{ProgramFiles${PF_ENV_EXT}}\\NSIS") if(NOT CPACK_WIX_ROOT) file(TO_CMAKE_PATH "$ENV{WIX}" CPACK_WIX_ROOT) - endif() + endif () find_program (WIX_EXECUTABLE candle PATHS "${CPACK_WIX_ROOT}/bin") -endif (WIN32) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -21,31 +21,33 @@ if (NOT HDF5_INSTALL_NO_DEVELOPMENT) DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) -endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) +endif () #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (NOT HDF5_EXTERNALLY_CONFIGURED) - install ( - EXPORT ${HDF5_EXPORTED_TARGETS} - DESTINATION ${HDF5_INSTALL_CMAKE_DIR} - FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake - NAMESPACE ${HDF5_PACKAGE}:: - COMPONENT configinstall - ) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) - -#----------------------------------------------------------------------------- -# Export all exported targets to the build tree for use by parent project -#----------------------------------------------------------------------------- -if (NOT HDF5_EXTERNALLY_CONFIGURED) - export ( - TARGETS ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES} ${HDF5_UTILS_TO_EXPORT} - FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake - NAMESPACE ${HDF5_PACKAGE}:: - ) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) + if (HDF5_EXPORTED_TARGETS) + install ( + EXPORT ${HDF5_EXPORTED_TARGETS} + DESTINATION ${HDF5_INSTALL_CMAKE_DIR} + FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake + NAMESPACE ${HDF5_PACKAGE}:: + COMPONENT configinstall + ) + endif () + + #----------------------------------------------------------------------------- + # Export all exported targets to the build tree for use by parent project + #----------------------------------------------------------------------------- + if (NOT HDF5_EXTERNALLY_CONFIGURED) + export ( + TARGETS ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES} ${HDF5_UTILS_TO_EXPORT} + FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake + NAMESPACE ${HDF5_PACKAGE}:: + ) + endif () +endif () #----------------------------------------------------------------------------- # Set includes needed for build @@ -95,7 +97,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) DESTINATION ${HDF5_INSTALL_CMAKE_DIR} COMPONENT configinstall ) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) +endif () #----------------------------------------------------------------------------- # Configure the hdf5-config-version .cmake file for the install directory @@ -110,16 +112,16 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) DESTINATION ${HDF5_INSTALL_CMAKE_DIR} COMPONENT configinstall ) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) +endif () #----------------------------------------------------------------------------- # Configure the libhdf5.settings file for the lib info #----------------------------------------------------------------------------- if (H5_WORDS_BIGENDIAN) set (BYTESEX big-endian) -else (H5_WORDS_BIGENDIAN) +else () set (BYTESEX little-endian) -endif (H5_WORDS_BIGENDIAN) +endif () configure_file ( ${HDF_RESOURCES_DIR}/libhdf5.settings.cmake.in ${HDF5_BINARY_DIR}/libhdf5.settings @ONLY @@ -135,10 +137,10 @@ install ( #----------------------------------------------------------------------------- #foreach (libs ${LINK_LIBS}) # set (LIBS "${LIBS} -l${libs}") -#endforeach (libs ${LINK_LIBS}) +#endforeach () #foreach (libs ${HDF5_LIBRARIES_TO_EXPORT}) # set (HDF5LIBS "${HDF5LIBS} -l${libs}") -#endforeach (libs ${HDF5_LIBRARIES_TO_EXPORT}) +#endforeach () #configure_file ( # ${HDF_RESOURCES_DIR}/libhdf5.pc.in # ${HDF5_BINARY_DIR}/CMakeFiles/libhdf5.pc @ONLY @@ -178,8 +180,8 @@ if (HDF5_PACK_EXAMPLES) DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - endif (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") -endif (HDF5_PACK_EXAMPLES) + endif () +endif () #----------------------------------------------------------------------------- # Configure the README.txt file for the binary package @@ -191,7 +193,7 @@ HDF_README_PROPERTIES(HDF5_BUILD_FORTRAN) #----------------------------------------------------------------------------- if (WIN32) configure_file (${HDF5_SOURCE_DIR}/COPYING ${HDF5_BINARY_DIR}/COPYING.txt @ONLY) -endif (WIN32) +endif () #----------------------------------------------------------------------------- # Add Document File(s) to CMake Install @@ -214,7 +216,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${release_files} ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt ) - endif (WIN32) + endif () if (HDF5_PACK_INSTALL_DOCS) set (release_files ${release_files} @@ -227,40 +229,40 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt ) - endif (WIN32) + endif () if (CYGWIN) set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt ) - endif (CYGWIN) + endif () if (HDF5_ENABLE_PARALLEL) set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel ) - endif (HDF5_ENABLE_PARALLEL) - endif (HDF5_PACK_INSTALL_DOCS) + endif () + endif () install ( FILES ${release_files} DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - endif (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") -endif (NOT HDF5_EXTERNALLY_CONFIGURED) + endif () +endif () if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if (CMAKE_HOST_UNIX) set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) - else (CMAKE_HOST_UNIX) + else () GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) set (CMAKE_INSTALL_PREFIX "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) set (CMAKE_GENERIC_PROGRAM_FILES) - endif (CMAKE_HOST_UNIX) -endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + endif () +endif () #----------------------------------------------------------------------------- # Set the cpack variables @@ -270,9 +272,9 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") if (CDASH_LOCAL) set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") - else (CDASH_LOCAL) + else () set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION_STRING}") - endif (CDASH_LOCAL) + endif () set (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") set (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") set (CPACK_PACKAGE_VERSION_PATCH "") @@ -280,13 +282,13 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING") set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") - endif (EXISTS "${HDF5_SOURCE_DIR}/release_docs") + endif () set (CPACK_PACKAGE_RELOCATABLE TRUE) if (OVERRIDE_INSTALL_VERSION) set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${OVERRIDE_INSTALL_VERSION}") - else (OVERRIDE_INSTALL_VERSION) + else () set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}") - endif (OVERRIDE_INSTALL_VERSION) + endif () set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}/hdf.bmp") set (CPACK_GENERATOR "TGZ") @@ -295,7 +297,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) if (NSIS_EXECUTABLE) list (APPEND CPACK_GENERATOR "NSIS") - endif (NSIS_EXECUTABLE) + endif () # Installers for 32- vs. 64-bit CMake: # - Root install directory (displayed to end user at installer-run time) # - "NSIS package/display name" (text used in the installer GUI) @@ -304,10 +306,10 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) if (CMAKE_CL_64) set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} (Win64)") - else (CMAKE_CL_64) + else () set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") - endif (CMAKE_CL_64) + endif () # set the install/unistall icon used for the installer itself # There is a bug in NSI that does not handle full unix paths properly. set (CPACK_NSIS_MUI_ICON "${HDF_RESOURCES_EXT_DIR}\\\\hdf.ico") @@ -317,15 +319,15 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_PACKAGE_NAME}") if (OVERRIDE_INSTALL_VERSION) set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${OVERRIDE_INSTALL_VERSION}") - else (OVERRIDE_INSTALL_VERSION) + else () set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") - endif (OVERRIDE_INSTALL_VERSION) + endif () set (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") set (CPACK_NSIS_MODIFY_PATH ON) if (WIX_EXECUTABLE) list (APPEND CPACK_GENERATOR "WIX") - endif (WIX_EXECUTABLE) + endif () #WiX variables set (CPACK_WIX_UNINSTALL "1") # .. variable:: CPACK_WIX_LICENSE_RTF @@ -368,7 +370,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set(CPACK_WIX_PROPERTY_ARPHELPLINK "${HDF5_PACKAGE_BUGREPORT}") if (BUILD_SHARED_LIBS) set(CPACK_WIX_PATCH_FILE "${HDF_RESOURCES_DIR}/patch.xml") - endif (BUILD_SHARED_LIBS) + endif () elseif (APPLE) list (APPEND CPACK_GENERATOR "STGZ") list (APPEND CPACK_GENERATOR "DragNDrop") @@ -403,8 +405,8 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) FILES ${HDF5_BINARY_DIR}/CMakeFiles/PkgInfo DESTINATION .. ) - endif (HDF5_PACK_MACOSX_FRAMEWORK AND HDF5_BUILD_FRAMEWORKS) - else (WIN32) + endif () + else () list (APPEND CPACK_GENERATOR "STGZ") set (CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}") set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) @@ -442,12 +444,12 @@ The HDF5 data model, file format, API, library, and tools are open and distribut #----------------------------------------------------------------------------- # configure_file ("${HDF5_RESOURCES_DIR}/hdf5.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec" @ONLY IMMEDIATE) # set (CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec") - endif (WIN32) + endif () # By default, do not warn when built on machines using only VS Express: if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) - endif (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) + endif () include (InstallRequiredSystemLibraries) set (CPACK_INSTALL_CMAKE_PROJECTS "${HDF5_BINARY_DIR};HDF5;ALL;/") @@ -457,23 +459,23 @@ The HDF5 data model, file format, API, library, and tools are open and distribut if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) if (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;ALL;/") - else (WIN32) + else () set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/") set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;headers;/") set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;configinstall;/") - endif (WIN32) - endif (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + endif () + endif () if (SZIP_FOUND AND SZIP_USE_EXTERNAL) if (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;ALL;/") - else (WIN32) + else () set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/") set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;headers;/") set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/") - endif (WIN32) - endif (SZIP_FOUND AND SZIP_USE_EXTERNAL) - endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - endif (HDF5_PACKAGE_EXTLIBS) + endif () + endif () + endif () + endif () include (CPack) @@ -537,7 +539,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development INSTALL_TYPES Full Developer ) - endif (HDF5_BUILD_FORTRAN) + endif () if (HDF5_BUILD_CPP_LIB) cpack_add_component (cpplibraries @@ -552,7 +554,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development INSTALL_TYPES Full Developer ) - endif (HDF5_BUILD_CPP_LIB) + endif () if (HDF5_BUILD_TOOLS) cpack_add_component (toolsapplications @@ -573,7 +575,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development INSTALL_TYPES Full Developer ) - endif (HDF5_BUILD_TOOLS) + endif () if (HDF5_BUILD_HL_LIB) cpack_add_component (hllibraries @@ -607,7 +609,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development INSTALL_TYPES Full Developer ) - endif (HDF5_BUILD_CPP_LIB) + endif () if (HDF5_BUILD_FORTRAN) cpack_add_component (hlfortlibraries DISPLAY_NAME "HDF5 HL Fortran Libraries" @@ -615,7 +617,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Runtime INSTALL_TYPES Full Developer User ) - endif (HDF5_BUILD_FORTRAN) - endif (HDF5_BUILD_HL_LIB) + endif () + endif () -endif (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) +endif () diff --git a/CMakeLists.txt b/CMakeLists.txt index b59943e..11c9b53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5 C CXX) #----------------------------------------------------------------------------- @@ -76,13 +76,13 @@ endif () # # Override the zlib header file # if (VTK_USE_SYSTEM_ZLIB) # set (H5_ZLIB_HEADER "zlib.h") -# else (VTK_USE_SYSTEM_ZLIB) +# else () # set (H5_ZLIB_HEADER "vtk_zlib.h") # # Set vars that FindZlib would have set if used in sub project # set (ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}") # set (ZLIB_LIBRARIES vtkzlib) -# endif (VTK_USE_SYSTEM_ZLIB) -# endif (HDF5_ENABLE_Z_LIB_SUPPORT) +# endif () +# endif () # # # Add the sub project # add_subdirectory (Utilities/hdf5-1.8) @@ -100,7 +100,7 @@ option (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) mark_as_advanced (HDF5_USE_FOLDERS) if (HDF5_USE_FOLDERS) set_property (GLOBAL PROPERTY USE_FOLDERS ON) -endif (HDF5_USE_FOLDERS) +endif () option (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF) mark_as_advanced (HDF5_NO_PACKAGES) option (ALLOW_UNSUPPORTED "Allow unsupported combinations of configure options" OFF) @@ -201,48 +201,48 @@ set (HDF5_JAVA_LOGGING_SIMPLE_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-simple- if (APPLE) option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE) -endif (APPLE) +endif () if (NOT HDF5_INSTALL_BIN_DIR) set (HDF5_INSTALL_BIN_DIR bin) -endif (NOT HDF5_INSTALL_BIN_DIR) +endif () if (NOT HDF5_INSTALL_LIB_DIR) if (APPLE) if (HDF5_BUILD_FRAMEWORKS) set (HDF5_INSTALL_JAR_DIR ../Java) - else (HDF5_BUILD_FRAMEWORKS) + else () set (HDF5_INSTALL_JAR_DIR lib) - endif (HDF5_BUILD_FRAMEWORKS) + endif () set (HDF5_INSTALL_FMWK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - else (APPLE) + else () set (HDF5_INSTALL_JAR_DIR lib) - endif (APPLE) + endif () set (HDF5_INSTALL_LIB_DIR lib) -endif (NOT HDF5_INSTALL_LIB_DIR) +endif () if (NOT HDF5_INSTALL_INCLUDE_DIR) set (HDF5_INSTALL_INCLUDE_DIR include) -endif (NOT HDF5_INSTALL_INCLUDE_DIR) +endif () if (NOT HDF5_INSTALL_DATA_DIR) if (NOT WIN32) if (APPLE) if (HDF5_BUILD_FRAMEWORKS) set (HDF5_INSTALL_EXTRA_DIR ../SharedSupport) - else (HDF5_BUILD_FRAMEWORKS) + else () set (HDF5_INSTALL_EXTRA_DIR share) - endif (HDF5_BUILD_FRAMEWORKS) + endif () set (HDF5_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - endif (APPLE) + endif () set (HDF5_INSTALL_DATA_DIR share) set (HDF5_INSTALL_CMAKE_DIR share/cmake) - else (NOT WIN32) + else () set (HDF5_INSTALL_DATA_DIR ".") set (HDF5_INSTALL_CMAKE_DIR cmake) - endif (NOT WIN32) -endif (NOT HDF5_INSTALL_DATA_DIR) + endif () +endif () -if(DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") +if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH}) -endif(DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") +endif () #----------------------------------------------------------------------------- # parse the full version number from H5public.h and include in H5_VERS_INFO @@ -268,74 +268,74 @@ string (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_RELEASE ${_lt_vers_am_contents}) -MATH (EXPR H5_SOVERS_MAJOR ${H5_SOVERS_INTERFACE}-${H5_SOVERS_RELEASE}) +math (EXPR H5_SOVERS_MAJOR ${H5_SOVERS_INTERFACE}-${H5_SOVERS_RELEASE}) message (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") string (REGEX MATCH ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_TOOLS_SOVERS_EXISTS ${_lt_vers_am_contents}) -if(H5_TOOLS_SOVERS_EXISTS) +if (H5_TOOLS_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_TOOLS_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_TOOLS_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_RELEASE ${_lt_vers_am_contents}) - MATH (EXPR H5_TOOLS_SOVERS_MAJOR ${H5_TOOLS_SOVERS_INTERFACE}-${H5_TOOLS_SOVERS_RELEASE}) + math (EXPR H5_TOOLS_SOVERS_MAJOR ${H5_TOOLS_SOVERS_INTERFACE}-${H5_TOOLS_SOVERS_RELEASE}) message (STATUS "SOVERSION_TOOLS: ${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") -endif() +endif () string (REGEX REPLACE ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_CXX_SOVERS_EXISTS ${_lt_vers_am_contents}) -if(H5_CXX_SOVERS_EXISTS) +if (H5_CXX_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_CXX_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_RELEASE ${_lt_vers_am_contents}) - MATH (EXPR H5_CXX_SOVERS_MAJOR ${H5_CXX_SOVERS_INTERFACE}-${H5_CXX_SOVERS_RELEASE}) + math (EXPR H5_CXX_SOVERS_MAJOR ${H5_CXX_SOVERS_INTERFACE}-${H5_CXX_SOVERS_RELEASE}) message (STATUS "SOVERSION_CXX: ${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") -endif() +endif () string (REGEX REPLACE ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_F_SOVERS_EXISTS ${_lt_vers_am_contents}) -if(H5_F_SOVERS_EXISTS) +if (H5_F_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_F_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_RELEASE ${_lt_vers_am_contents}) - MATH (EXPR H5_F_SOVERS_MAJOR ${H5_F_SOVERS_INTERFACE}-${H5_F_SOVERS_RELEASE}) + math (EXPR H5_F_SOVERS_MAJOR ${H5_F_SOVERS_INTERFACE}-${H5_F_SOVERS_RELEASE}) message (STATUS "SOVERSION_F: ${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}") -endif() +endif () string (REGEX REPLACE ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_SOVERS_EXISTS ${_lt_vers_am_contents}) -if(H5_HL_SOVERS_EXISTS) +if (H5_HL_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_RELEASE ${_lt_vers_am_contents}) - MATH (EXPR H5_HL_SOVERS_MAJOR ${H5_HL_SOVERS_INTERFACE}-${H5_HL_SOVERS_RELEASE}) + math (EXPR H5_HL_SOVERS_MAJOR ${H5_HL_SOVERS_INTERFACE}-${H5_HL_SOVERS_RELEASE}) message (STATUS "SOVERSION_HL: ${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}") -endif() +endif () string (REGEX REPLACE ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_CXX_SOVERS_EXISTS ${_lt_vers_am_contents}) -if(H5_HL_CXX_SOVERS_EXISTS) +if (H5_HL_CXX_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_CXX_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_RELEASE ${_lt_vers_am_contents}) - MATH (EXPR H5_HL_CXX_SOVERS_MAJOR ${H5_HL_CXX_SOVERS_INTERFACE}-${H5_HL_CXX_SOVERS_RELEASE}) + math (EXPR H5_HL_CXX_SOVERS_MAJOR ${H5_HL_CXX_SOVERS_INTERFACE}-${H5_HL_CXX_SOVERS_RELEASE}) message (STATUS "SOVERSION_HL_CXX: ${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}") -endif() +endif () string (REGEX REPLACE ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_F_SOVERS_EXISTS ${_lt_vers_am_contents}) -if(H5_HL_F_SOVERS_EXISTS) +if (H5_HL_F_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_F_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_RELEASE ${_lt_vers_am_contents}) - MATH (EXPR H5_HL_F_SOVERS_MAJOR ${H5_HL_F_SOVERS_INTERFACE}-${H5_HL_F_SOVERS_RELEASE}) + math (EXPR H5_HL_F_SOVERS_MAJOR ${H5_HL_F_SOVERS_INTERFACE}-${H5_HL_F_SOVERS_RELEASE}) message (STATUS "SOVERSION_HL_F: ${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}") -endif() +endif () string (REGEX REPLACE ".*LT_JAVA_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_JAVA_SOVERS_EXISTS ${_lt_vers_am_contents}) if(H5_JAVA_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_JAVA_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" @@ -344,9 +344,9 @@ if(H5_JAVA_SOVERS_EXISTS) "\\1" H5_JAVA_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_JAVA_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_JAVA_SOVERS_RELEASE ${_lt_vers_am_contents}) - MATH (EXPR H5_JAVA_SOVERS_MAJOR ${H5_JAVA_SOVERS_INTERFACE}-${H5_JAVA_SOVERS_RELEASE}) + math (EXPR H5_JAVA_SOVERS_MAJOR ${H5_JAVA_SOVERS_INTERFACE}-${H5_JAVA_SOVERS_RELEASE}) message (STATUS "SOVERSION_JAVA: ${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}") -endif() +endif () #----------------------------------------------------------------------------- # Basic HDF5 stuff here @@ -358,45 +358,45 @@ set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") if (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") -else (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") +else () set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") -endif (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") +endif () set (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -if(H5_TOOLS_SOVERS_EXISTS) +if (H5_TOOLS_SOVERS_EXISTS) set (HDF5_TOOLS_PACKAGE_SOVERSION "${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") -else() +else () set (HDF5_TOOLS_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif() -if(H5_CXX_SOVERS_EXISTS) +endif () +if (H5_CXX_SOVERS_EXISTS) set (HDF5_CXX_PACKAGE_SOVERSION "${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") -else() +else () set (HDF5_CXX_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif() -if(H5_F_SOVERS_EXISTS) +endif () +if (H5_F_SOVERS_EXISTS) set (HDF5_F_PACKAGE_SOVERSION "${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}") -else() +else () set (HDF5_F_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif() -if(H5_HL_SOVERS_EXISTS) +endif () +if (H5_HL_SOVERS_EXISTS) set (HDF5_HL_PACKAGE_SOVERSION "${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}") -else() +else () set (HDF5_HL_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif() -if(H5_HL_F_SOVERS_EXISTS) +endif () +if (H5_HL_F_SOVERS_EXISTS) set (HDF5_HL_CXX_PACKAGE_SOVERSION "${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}") -else() +else () set (HDF5_HL_CXX_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif() -if(H5_HL_F_SOVERS_EXISTS) +endif () +if (H5_HL_F_SOVERS_EXISTS) set (HDF5_HL_F_PACKAGE_SOVERSION "${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}") -else() +else () set (HDF5_HL_F_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif() -if(H5_JAVA_SOVERS_EXISTS) +endif () +if (H5_JAVA_SOVERS_EXISTS) set (HDF5_PACKAGE_SOVERSION "${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}") -else() +else () set (HDF5_JAVA_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif() +endif () set (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") set (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}") set (HDF5_PACKAGE_URL "http://www.hdfgroup.org") @@ -427,16 +427,19 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ) if (WIN32) set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}) - else (WIN32) + set (CMAKE_PDB_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files." + ) + else () set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - endif (WIN32) -else (NOT HDF5_EXTERNALLY_CONFIGURED) + endif () +else () # if we are externally configured, but the project uses old cmake scripts # this may not be set and utilities like H5detect will fail if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) - endif (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) + endif () +endif () #----------------------------------------------------------------------------- # Targets built within this project are exported at Install time for use @@ -444,7 +447,7 @@ endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- if (NOT HDF5_EXPORTED_TARGETS) set (HDF5_EXPORTED_TARGETS "hdf5-targets") -endif (NOT HDF5_EXPORTED_TARGETS) +endif () #----------------------------------------------------------------------------- # To include a library in the list exported by the project AT BUILD TIME, @@ -470,17 +473,17 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) #----------------------------------------------------------------------------- if (HDF5_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS) set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries") -endif (HDF5_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS) +endif () #----------------------------------------------------------------------------- -# Option to Build Shared and Static libs, default is static +# Option to Build Shared and Static libs, default is both #----------------------------------------------------------------------------- option (BUILD_SHARED_LIBS "Build Shared Libraries" ON) set (H5_ENABLE_SHARED_LIB NO) if (BUILD_SHARED_LIBS) set (H5_ENABLE_SHARED_LIB YES) set (LINK_SHARED_LIBS ${LINK_LIBS}) -endif (BUILD_SHARED_LIBS) +endif () set (H5_ENABLE_STATIC_LIB YES) set (CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -492,8 +495,8 @@ if (BUILD_STATIC_EXECS) if (NOT WIN32) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") - endif (NOT WIN32) -endif (BUILD_STATIC_EXECS) + endif () +endif () #----------------------------------------------------------------------------- # Option to use code coverage @@ -503,7 +506,7 @@ if (HDF5_ENABLE_COVERAGE) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage") -endif (HDF5_ENABLE_COVERAGE) +endif () #----------------------------------------------------------------------------- # Option to indicate using dmalloc @@ -512,7 +515,7 @@ endif (HDF5_ENABLE_COVERAGE) # if (HDF5_ENABLE_USING_DMALLOC) # find_package (DMALLOC) # set (H5_HAVE_DMALLOC DMALLOC_FOUND) -# endif (HDF5_ENABLE_USING_DMALLOC) +# endif () #----------------------------------------------------------------------------- # Option to indicate using a memory checker @@ -520,7 +523,7 @@ endif (HDF5_ENABLE_COVERAGE) option (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) if (HDF5_ENABLE_USING_MEMCHECKER) set (H5_USING_MEMCHECKER 1) -endif (HDF5_ENABLE_USING_MEMCHECKER) +endif () #----------------------------------------------------------------------------- # Option to indicate internal memory allocation sanity checks are enabled @@ -528,7 +531,7 @@ endif (HDF5_ENABLE_USING_MEMCHECKER) option (HDF5_MEMORY_ALLOC_SANITY_CHECK "Indicate that internal memory allocation sanity checks are enabled" OFF) if (HDF5_MEMORY_ALLOC_SANITY_CHECK) set (H5_MEMORY_ALLOC_SANITY_CHECK 1) -endif (HDF5_MEMORY_ALLOC_SANITY_CHECK) +endif () #----------------------------------------------------------------------------- # Option to use deprecated public API symbols @@ -536,9 +539,9 @@ endif (HDF5_MEMORY_ALLOC_SANITY_CHECK) option (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON) if (HDF5_ENABLE_DEPRECATED_SYMBOLS) set (H5_NO_DEPRECATED_SYMBOLS 0) -else (HDF5_ENABLE_DEPRECATED_SYMBOLS) +else () set (H5_NO_DEPRECATED_SYMBOLS 1) -endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) +endif () #----------------------------------------------------------------------------- # When building utility executables that generate other (source) files : @@ -553,24 +556,24 @@ if (WIN32) add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1) add_definitions (-D_CRT_SECURE_NO_WARNINGS) add_definitions (-D_CONSOLE) - endif (NOT CYGWIN) -endif (WIN32) + endif () +endif () if (MSVC) set (CMAKE_MFC_FLAG 0) set (WIN_COMPILE_FLAGS "") set (WIN_LINK_FLAGS "") -endif (MSVC) +endif () set (MAKE_SYSTEM) if (CMAKE_BUILD_TOOL MATCHES "make") set (MAKE_SYSTEM 1) -endif (CMAKE_BUILD_TOOL MATCHES "make") +endif () set (CFG_INIT "/${CMAKE_CFG_INTDIR}") if (MAKE_SYSTEM) set (CFG_INIT "") -endif (MAKE_SYSTEM) +endif () #----------------------------------------------------------------------------- # Add some definitions for Debug Builds @@ -582,19 +585,19 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) # Enable tracing of the API if (HDF5_ENABLE_TRACE) add_definitions (-DH5_DEBUG_API ) - endif (HDF5_ENABLE_TRACE) + endif () # Enable instrumenting of the library's internal operations option (HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF) if (HDF5_ENABLE_INSTRUMENT) set (H5_HAVE_INSTRUMENTED_LIBRARY 1) - endif (HDF5_ENABLE_INSTRUMENT) + endif () mark_as_advanced (HDF5_ENABLE_INSTRUMENT) -else (CMAKE_BUILD_TYPE MATCHES Debug) +else () add_definitions (-DNDEBUG) if (HDF5_ENABLE_TRACE) add_definitions (-DH5_DEBUG_API ) - endif (HDF5_ENABLE_TRACE) -endif (CMAKE_BUILD_TYPE MATCHES Debug) + endif () +endif () #----------------------------------------------------------------------------- # Option to embed library info into executables @@ -602,7 +605,7 @@ endif (CMAKE_BUILD_TYPE MATCHES Debug) option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) if (HDF5_ENABLE_EMBEDDED_LIBINFO) set (H5_HAVE_EMBEDDED_LIBINFO 1) -endif (HDF5_ENABLE_EMBEDDED_LIBINFO) +endif () include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake) @@ -627,10 +630,10 @@ if (HDF5_ENABLE_PARALLEL) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) - else (MPI_C_FOUND) + else () message (STATUS "Parallel libraries not found") - endif (MPI_C_FOUND) -endif (HDF5_ENABLE_PARALLEL) + endif () +endif () # Parallel IO usage requires MPI to be Linked and Included if (H5_HAVE_PARALLEL) @@ -638,8 +641,8 @@ if (H5_HAVE_PARALLEL) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${MPI_C_LIBRARIES}) if (MPI_C_LINK_FLAGS) set (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") - endif (MPI_C_LINK_FLAGS) -endif (H5_HAVE_PARALLEL) + endif () +endif () set (DEFAULT_API_VERSION "v110") #----------------------------------------------------------------------------- @@ -650,7 +653,7 @@ set (H5_USE_16_API_DEFAULT 0) if (HDF5_USE_16_API_DEFAULT) set (H5_USE_16_API_DEFAULT 1) set (DEFAULT_API_VERSION "v16") -endif (HDF5_USE_16_API_DEFAULT) +endif () #----------------------------------------------------------------------------- # Option to use 1.8.x API @@ -660,7 +663,7 @@ set (H5_USE_18_API_DEFAULT 0) if (HDF5_USE_18_API_DEFAULT) set (H5_USE_18_API_DEFAULT 1) set (DEFAULT_API_VERSION "v18") -endif (HDF5_USE_18_API_DEFAULT) +endif () #----------------------------------------------------------------------------- # Include user macros @@ -681,13 +684,13 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) if (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) - endif (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) + endif () if (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) - endif (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - endif (HDF5_PACKAGE_EXTLIBS) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) + endif () + endif () +endif () #----------------------------------------------------------------------------- # Option to use threadsafe #----------------------------------------------------------------------------- @@ -699,45 +702,45 @@ if (HDF5_ENABLE_THREADSAFE) if (HDF5_ENABLE_PARALLEL) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) + else () message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_ENABLE_PARALLEL) + endif () + endif () if (HDF5_BUILD_FORTRAN) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) + else () message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_BUILD_FORTRAN) + endif () + endif () if (HDF5_BUILD_CPP_LIB) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) + else () message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_BUILD_CPP_LIB) + endif () + endif () if (HDF5_BUILD_HL_LIB) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** HL and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) + else () message (STATUS " **** Allowing unsupported HL and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_BUILD_HL_LIB) + endif () + endif () if (H5_HAVE_IOEO) message (STATUS " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") set (H5_HAVE_WIN_THREADS 1) - else (H5_HAVE_IOEO) + else () if (NOT H5_HAVE_PTHREAD_H) message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ") - endif (NOT H5_HAVE_PTHREAD_H) - endif (H5_HAVE_IOEO) + endif () + endif () set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads) if (NOT Threads_FOUND) message (STATUS " **** thread-safe package not found - threads still might work **** ") - endif (NOT Threads_FOUND) -endif (HDF5_ENABLE_THREADSAFE) + endif () +endif () # ----------------------------------------------------------------------- # wrapper script variables @@ -755,15 +758,15 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT ADD_DEPENDENCIES (${HDF5_LIB_TARGET} ZLIB) if (BUILD_SHARED_LIBS) add_dependencies (${HDF5_LIBSH_TARGET} ZLIB) - endif (BUILD_SHARED_LIBS) - endif (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + endif () + endif () if (SZIP_FOUND AND SZIP_USE_EXTERNAL) ADD_DEPENDENCIES (${HDF5_LIB_TARGET} SZIP) if (BUILD_SHARED_LIBS) add_dependencies (${HDF5_LIBSH_TARGET} SZIP) - endif (BUILD_SHARED_LIBS) - endif (SZIP_FOUND AND SZIP_USE_EXTERNAL) -endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif () + endif () +endif () #----------------------------------------------------------------------------- # Dashboard and Testing Settings @@ -780,7 +783,7 @@ if (BUILD_TESTING) if (HDF5_TEST_VFD) option (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) mark_as_advanced (HDF5_TEST_FHEAP_VFD) - endif (HDF5_TEST_VFD) + endif () option (HDF_TEST_EXPRESS "Control testing framework (0-3)" "0") mark_as_advanced (HDF_TEST_EXPRESS) @@ -795,14 +798,14 @@ if (BUILD_TESTING) if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") add_subdirectory (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) add_subdirectory (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test) - endif (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") + endif () if (H5_HAVE_PARALLEL) if (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") add_subdirectory (${HDF5_SOURCE_DIR}/testpar ${PROJECT_BINARY_DIR}/testpar) - endif (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") - endif (H5_HAVE_PARALLEL) - endif (NOT HDF5_EXTERNALLY_CONFIGURED) -endif (BUILD_TESTING) + endif () + endif () + endif () +endif () #----------------------------------------------------------------------------- # Option to build HDF5 Tools @@ -811,8 +814,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools option (HDF5_BUILD_TOOLS "Build HDF5 Tools" ON) if (HDF5_BUILD_TOOLS) add_subdirectory (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools) - endif (HDF5_BUILD_TOOLS) -endif (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") + endif () +endif () #----------------------------------------------------------------------------- # Option to build examples @@ -821,8 +824,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/ex option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" ON) if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) - endif (HDF5_BUILD_EXAMPLES) -endif (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") + endif () +endif () #----------------------------------------------------------------------------- # Option to build High Level API's @@ -832,8 +835,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") if (HDF5_BUILD_HL_LIB) set (H5_INCLUDE_HL 1) add_subdirectory (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl) - endif (HDF5_BUILD_HL_LIB) -endif (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") + endif () +endif () #----------------------------------------------------------------------------- # Option to build Fortran bindings/tests/examples @@ -851,10 +854,10 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for if (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Shared FORTRAN libraries are unsupported **** ") set (SKIP_HDF5_FORTRAN_SHARED ON) - else (NOT ALLOW_UNSUPPORTED) + else () message (STATUS " **** Allowing unsupported Fortran shared libraries **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (BUILD_SHARED_LIBS AND APPLE) + endif () + endif () option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON) include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake) @@ -871,8 +874,17 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for if (HDF5_ENABLE_F2003) if (NOT FORTRAN_HAVE_ISO_C_BINDING) set (HDF5_ENABLE_F2003 OFF) - endif (NOT FORTRAN_HAVE_ISO_C_BINDING) - endif (HDF5_ENABLE_F2003) + endif () + endif () + + # Parallel IO usage requires MPI to be Linked and Included + if (H5_HAVE_PARALLEL) + set (LINK_Fortran_LIBS ${LINK_LIBS} ${MPI_Fortran_LIBRARIES}) + set (LINK_Fortran_SHARED_LIBS ${LINK_SHARED_LIBS} ${MPI_Fortran_LIBRARIES}) + if (MPI_Fortran_LINK_FLAGS) + set (CMAKE_Fortran_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") + endif () + endif () # ----------------------------------------------------------------------- # wrapper script variables @@ -884,10 +896,10 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") #-- Build the High Level Fortran source codes add_subdirectory (${HDF5_SOURCE_DIR}/hl/fortran ${PROJECT_BINARY_DIR}/hl/fortran) - endif (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") - endif (HDF5_BUILD_HL_LIB) - endif (HDF5_BUILD_FORTRAN) -endif (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") + endif () + endif () + endif () +endif () #----------------------------------------------------------------------------- # Option to build HDF5 C++ Library @@ -899,22 +911,22 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") if (HDF5_ENABLE_PARALLEL) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive **** ") - else (NOT ALLOW_UNSUPPORTED) + else () message (STATUS " **** Allowing unsupported Parallel and C++ options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_ENABLE_PARALLEL) + endif () + endif () if (CMAKE_NO_STD_NAMESPACE) set (H5_NO_STD 1) - endif (CMAKE_NO_STD_NAMESPACE) + endif () add_subdirectory (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) if (HDF5_BUILD_HL_LIB) if (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++") #-- Build the High Level Fortran source codes add_subdirectory (${HDF5_SOURCE_DIR}/hl/c++ ${PROJECT_BINARY_DIR}/hl/c++) - endif (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++") - endif (HDF5_BUILD_HL_LIB) - endif (HDF5_BUILD_CPP_LIB) -endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") + endif () + endif () + endif () +endif () #----------------------------------------------------------------------------- # Check if Fortran's default real is double precision. If it is and HL is @@ -923,8 +935,8 @@ endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++" if (HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB) if (NOT FORTRAN_DEFAULT_REAL_NOT_DOUBLE) message (FATAL_ERROR " **** Fortran high-level routines are not supported when the default REAL is DOUBLE PRECISION, use HDF5_BUILD_HL_LIB:BOOL=OFF **** ") - endif (NOT FORTRAN_DEFAULT_REAL_NOT_DOUBLE) -endif (HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB) + endif () +endif () #----------------------------------------------------------------------------- # Option to build HDF5 Java Library @@ -933,8 +945,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/java" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/java") option (HDF5_BUILD_JAVA "Build Java HDF5 Library" OFF) if (HDF5_BUILD_JAVA) add_subdirectory (${HDF5_SOURCE_DIR}/java ${PROJECT_BINARY_DIR}/java) - endif (HDF5_BUILD_JAVA) -endif (EXISTS "${HDF5_SOURCE_DIR}/java" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/java") + endif () +endif () #----------------------------------------------------------------------------- # Generate the H5pubconf.h file containing user settings needed by compilation diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 849d218..3f5f380 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -11,10 +11,10 @@ set (CTEST_DROP_METHOD "http") if (CDASH_LOCAL) set (CTEST_DROP_SITE "cdash-internal.hdfgroup.org") set (CTEST_DROP_LOCATION "/submit.php?project=HDF5Trunk") -else (CDASH_LOCAL) +else () set (CTEST_DROP_SITE "cdash.hdfgroup.org") set (CTEST_DROP_LOCATION "/submit.php?project=HDF5+Trunk") -endif (CDASH_LOCAL) +endif () set (CTEST_DROP_SITE_CDASH TRUE) set (UPDATE_TYPE git) diff --git a/MANIFEST b/MANIFEST index b43e7ef..95c9bbd 100644 --- a/MANIFEST +++ b/MANIFEST @@ -504,10 +504,12 @@ ./src/H5C.c ./src/H5Cdbg.c ./src/H5Cepoch.c +./src/H5Cimage.c ./src/H5Clog.c ./src/H5Cmodule.h ./src/H5Cmpio.c ./src/H5Cpkg.h +./src/H5Cprefetched.c ./src/H5Cprivate.h ./src/H5Cpublic.h ./src/H5Cquery.c @@ -737,6 +739,7 @@ ./src/H5Obogus.c ./src/H5Obtreek.c ./src/H5Ocache.c +./src/H5Ocache_image.c ./src/H5Ochunk.c ./src/H5Ocont.c ./src/H5Ocopy.c @@ -881,13 +884,20 @@ ./src/libhdf5.settings.in ./src/H5win32defs.h +./test/AtomicWriterReader.txt ./test/COPYING ./test/H5srcdir.h ./test/H5srcdir_str.h.in ./test/Makefile.am +./test/POSIX_Order_Write_Test_Report.docx +./test/POSIX_Order_Write_Test_Report.pdf +./test/SWMR_POSIX_Order_UG.txt +./test/SWMR_UseCase_UG.txt ./test/accum.c ./test/accum_swmr_reader.c ./test/app_ref.c +./test/atomic_reader.c +./test/atomic_writer.c ./test/bad_compound.h5 ./test/be_data.h5 ./test/be_extlink1.h5 @@ -901,6 +911,7 @@ ./test/cache_api.c ./test/cache_common.c ./test/cache_common.h +./test/cache_image.c ./test/cache_logging.c ./test/cache_tagging.c ./test/cmpd_dset.c @@ -946,6 +957,8 @@ ./test/flush1.c ./test/flush2.c ./test/flushrefresh.c +./test/genall5.c +./test/genall5.h ./test/gen_bad_ohdr.c ./test/gen_bad_compound.c ./test/gen_bogus.c @@ -953,6 +966,7 @@ ./test/gen_deflate.c ./test/gen_file_image.c ./test/gen_filespace.c +./test/gen_idx.c ./test/gen_mergemsg.c ./test/gen_new_array.c ./test/gen_new_fill.c @@ -1001,7 +1015,18 @@ ./test/specmetaread.h5 ./test/stab.c ./test/swmr.c +./test/swmr_addrem_writer.c ./test/swmr_check_compat_vfd.c +./test/swmr_common.c +./test/swmr_common.h +./test/swmr_generator.c +./test/swmr_reader.c +./test/swmr_remove_reader.c +./test/swmr_remove_writer.c +./test/swmr_sparse_reader.c +./test/swmr_sparse_writer.c +./test/swmr_start_write.c +./test/swmr_writer.c ./test/tarray.c ./test/tarrold.h5 ./test/tattr.c @@ -1020,7 +1045,10 @@ ./test/testhdf5.h ./test/testlibinfo.sh.in ./test/test_plugin.sh.in +./test/test_usecases.sh.in ./test/testmeta.c +./test/testswmr.sh.in +./test/testvdsswmr.sh.in ./test/tfile.c ./test/tgenprop.c ./test/th5o.c @@ -1051,14 +1079,24 @@ ./test/tunicode.c ./test/tvlstr.c ./test/tvltypes.c +./test/twriteorder.c ./test/unlink.c ./test/unregister.c +./test/use_append_chunk.c +./test/use_append_mchunks.c +./test/use_common.c +./test/use_disable_mdc_flushes.c +./test/use.h ./test/vfd.c ./test/test_filters_le.h5 ./test/test_filters_be.h5 ./test/gen_filters.c ./test/chunk_info.c ./test/vds.c +./test/vds_swmr.h +./test/vds_swmr_gen.c +./test/vds_swmr_reader.c +./test/vds_swmr_writer.c ./test/testfiles/err_compat_1 ./test/testfiles/err_compat_2 @@ -1201,7 +1239,9 @@ ./tools/src/h5dump/h5dump_xml.c ./tools/src/h5dump/h5dump_xml.h ./tools/test/h5dump/Makefile.am +./tools/test/h5dump/dynlib_dump.c ./tools/test/h5dump/h5dumpgentest.c +./tools/test/h5dump/h5dump_plugin.sh.in ./tools/test/h5dump/testh5dump.sh.in ./tools/test/h5dump/testh5dumppbits.sh.in ./tools/test/h5dump/testh5dumpxml.sh.in @@ -1273,7 +1313,9 @@ ./tools/src/h5diff/h5diff_main.c ./tools/src/h5diff/ph5diff_main.c ./tools/test/h5diff/Makefile.am +./tools/test/h5diff/dynlib_diff.c ./tools/test/h5diff/h5diffgentest.c +./tools/test/h5diff/h5diff_plugin.sh.in ./tools/test/h5diff/testh5diff.sh.in ./tools/test/h5diff/testph5diff.sh.in @@ -1354,6 +1396,8 @@ ./tools/src/h5ls/Makefile.am ./tools/src/h5ls/h5ls.c ./tools/test/h5ls/Makefile.am +./tools/test/h5ls/dynlib_ls.c +./tools/test/h5ls/h5ls_plugin.sh.in ./tools/test/h5ls/testh5ls.sh.in ./tools/test/h5ls/testh5lsvds.sh.in @@ -1738,6 +1782,9 @@ ./tools/testfiles/tstring2.ddl ./tools/testfiles/tstringe.ddl ./tools/testfiles/tszip.ddl +./tools/testfiles/tudfilter.ddl +./tools/testfiles/tudfilter.h5 +./tools/testfiles/tudfilter.ls ./tools/testfiles/tudlink.h5 ./tools/testfiles/tudlink.h5.xml ./tools/testfiles/tudlink-1.ddl @@ -2108,6 +2155,10 @@ ./tools/test/h5diff/testfiles/h5diff_57.txt ./tools/test/h5diff/testfiles/h5diff_58.txt ./tools/test/h5diff/testfiles/h5diff_59.txt +./tools/test/h5diff/testfiles/h5diff_60.txt +./tools/test/h5diff/testfiles/h5diff_61.txt +./tools/test/h5diff/testfiles/h5diff_62.txt +./tools/test/h5diff/testfiles/h5diff_63.txt ./tools/test/h5diff/testfiles/h5diff_600.txt ./tools/test/h5diff/testfiles/h5diff_601.txt ./tools/test/h5diff/testfiles/h5diff_603.txt @@ -2310,6 +2361,12 @@ ./tools/test/h5diff/testfiles/tmptest.he5 ./tools/test/h5diff/testfiles/h5diff_tmp2.txt ./tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 +./tools/test/h5diff/testfiles/tudfilter.h5 +./tools/test/h5diff/testfiles/tudfilter2.h5 +./tools/test/h5diff/testfiles/h5diff_ud.txt +./tools/test/h5diff/testfiles/h5diff_udfail.txt +./tools/test/h5diff/testfiles/diff_strings1.h5 +./tools/test/h5diff/testfiles/diff_strings2.h5 #vds ./tools/test/h5diff/testfiles/h5diff_v1.txt ./tools/test/h5diff/testfiles/h5diff_v2.txt @@ -2967,7 +3024,6 @@ ./config/cmake_ext_mod/HDFUseFortran.cmake ./config/cmake_ext_mod/NSIS.InstallOptions.ini.in ./config/cmake_ext_mod/NSIS.template.in -./config/cmake_ext_mod/prunTest.cmake ./config/cmake_ext_mod/runTest.cmake ./config/cmake_ext_mod/version.plist.in @@ -3075,6 +3131,7 @@ # CMake-specific User Scripts ./config/cmake/scripts/CTestScript.cmake ./config/cmake/scripts/HDF5config.cmake +./config/cmake/scripts/HDF5options.cmake # Files generated by autogen ./aclocal.m4 diff --git a/UserMacros.cmake b/UserMacros.cmake index 65ea5d4..01e76ed 100644 --- a/UserMacros.cmake +++ b/UserMacros.cmake @@ -7,16 +7,15 @@ #----------------------------------------------------------------------------- # Option to Build with User Defined Values #----------------------------------------------------------------------------- -MACRO (MACRO_USER_DEFINED_LIBS) +macro (MACRO_USER_DEFINED_LIBS) set (USER_DEFINED_VALUE "FALSE") -ENDMACRO (MACRO_USER_DEFINED_LIBS) +endmacro () #------------------------------------------------------------------------------- option (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) if (BUILD_USER_DEFINED_LIBS) MACRO_USER_DEFINED_LIBS () -endif (BUILD_USER_DEFINED_LIBS) +endif () #----------------------------------------------------------------------------- #------------------- E X A M P L E E N D ----------------------------------- #----------------------------------------------------------------------------- - \ No newline at end of file diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 6f288a0..c9c4815 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_CPP) #----------------------------------------------------------------------------- @@ -25,7 +25,7 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR}) if (H5_HAVE_PARALLEL) add_definitions ("-DMPICH_SKIP_MPICXX") add_definitions ("-DMPICH_IGNORE_CXX_SEEK") -endif (H5_HAVE_PARALLEL) +endif () add_subdirectory (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) @@ -34,11 +34,11 @@ add_subdirectory (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples) -endif (HDF5_BUILD_EXAMPLES) +endif () #----------------------------------------------------------------------------- # Build the CPP unit tests #----------------------------------------------------------------------------- if (BUILD_TESTING) add_subdirectory (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test) -endif (BUILD_TESTING) +endif () diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index cfcdd8d..e5b0b4a 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,11 +1,11 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) +PROJECT (HDF5_CPP_EXAMPLES) + # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed # with "cpp_ex_". This allows for easier filtering of the examples. # -------------------------------------------------------------------- -PROJECT (HDF5_CPP_EXAMPLES) - #----------------------------------------------------------------------------- # Define examples #----------------------------------------------------------------------------- @@ -38,7 +38,7 @@ foreach (example ${examples}) TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ") target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) -endforeach (example ${examples}) +endforeach () foreach (example ${tutr_examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) @@ -46,8 +46,8 @@ foreach (example ${tutr_examples}) TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ") target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) -endforeach (example ${tutr_examples}) +endforeach () if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index 4db8c68..8b5c6b9 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -8,7 +8,7 @@ add_test ( NAME CPP_ex-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove Group.h5 SDS.h5 SDScompound.h5 @@ -17,16 +17,29 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "CPP_ex-clear-objects") foreach (example ${examples}) - add_test (NAME CPP_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME CPP_ex_${example} COMMAND $) + else () + add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cpp_ex_${example}.txt" + #-D "TEST_REFERENCE=cpp_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "CPP_ex_${example}") - endforeach (example ${examples}) + endforeach () #the following dependicies are handled by the order of the files # SET_TESTS_PROPERTIES(CPP_ex_readdata PROPERTIES DEPENDS CPP_ex_create) # SET_TESTS_PROPERTIES(CPP_ex_chunks PROPERTIES DEPENDS CPP_ex_extend_ds) @@ -34,7 +47,7 @@ add_test ( NAME CPP_ex_tutr-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove h5tutr_cmprss.h5 h5tutr_dset.h5 h5tutr_extend.h5 @@ -44,18 +57,30 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex_tutr-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "CPP_ex_tutr-clear-objects") - + foreach (example ${tutr_examples}) - add_test (NAME CPP_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME CPP_ex_${example} COMMAND $) + else () + add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cpp_ex_${example}.txt" + #-D "TEST_REFERENCE=cpp_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "CPP_ex_${example}") - endforeach (example ${tutr_examples}) + endforeach () #the following dependicies are handled by the order of the files # SET_TESTS_PROPERTIES(CPP_ex_h5tutr_crtatt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat) # SET_TESTS_PROPERTIES(CPP_ex_h5tutr_rdwt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat) # SET_TESTS_PROPERTIES(CPP_ex_h5tutr_crtgrpd PROPERTIES DEPENDS CPP_ex_h5tutr_crtgrpar) - \ No newline at end of file diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 445d57b..b147cfa 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_CPP_SRC) #----------------------------------------------------------------------------- @@ -104,7 +104,7 @@ if (BUILD_SHARED_LIBS) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_CPP_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -124,7 +124,8 @@ install ( if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) - endif (BUILD_SHARED_LIBS) + endif () + INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) install ( TARGETS @@ -137,4 +138,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT cpplibraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index 9e76b55..621578e 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -34,16 +34,16 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: AbstractDs default constructor -///\brief Default constructor -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs default constructor +///\brief Default constructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AbstractDs::AbstractDs(){} //-------------------------------------------------------------------------- -// Function: AbstractDs default constructor -///\brief Creates an AbstractDs instance using an existing id. -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs default constructor +///\brief Creates an AbstractDs instance using an existing id. +// Programmer Binh-Minh Ribler - 2000 // // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had @@ -54,275 +54,275 @@ AbstractDs::AbstractDs(){} // Mar 2016 -BMR, AbstractDs::AbstractDs(const hid_t ds_id){} //-------------------------------------------------------------------------- -// Function: AbstractDs::getTypeClass -///\brief Returns the class of the datatype that is used by this -/// object, which can be a dataset or an attribute. -///\return Datatype class identifier -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getTypeClass +///\brief Returns the class of the datatype that is used by this +/// object, which can be a dataset or an attribute. +///\return Datatype class identifier +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_class_t AbstractDs::getTypeClass() const { - // Gets the datatype used by this dataset or attribute. - // p_get_type calls either H5Dget_type or H5Aget_type depending on - // which object invokes getTypeClass - hid_t datatype_id; - try { - datatype_id = p_get_type(); // returned value is already validated - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getTypeClass", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getTypeClass", E.getDetailMsg()); - } + // Gets the datatype used by this dataset or attribute. + // p_get_type calls either H5Dget_type or H5Aget_type depending on + // which object invokes getTypeClass + hid_t datatype_id; + try { + datatype_id = p_get_type(); // returned value is already validated + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getTypeClass", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getTypeClass", E.getDetailMsg()); + } - // Gets the class of the datatype and validate it before returning - H5T_class_t type_class = H5Tget_class(datatype_id); + // Gets the class of the datatype and validate it before returning + H5T_class_t type_class = H5Tget_class(datatype_id); - // Close temporary datatype_id - herr_t ret_value = H5Tclose(datatype_id); - if (ret_value < 0) - { - if (fromClass() == "DataSet") - throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed"); - else if (fromClass() == "Attribute") - throw DataTypeIException("Attribute::getTypeClass", "H5Tclose failed"); - } + // Close temporary datatype_id + herr_t ret_value = H5Tclose(datatype_id); + if (ret_value < 0) + { + if (fromClass() == "DataSet") + throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed"); + else if (fromClass() == "Attribute") + throw DataTypeIException("Attribute::getTypeClass", "H5Tclose failed"); + } - // Check on the returned type_class - if (type_class == H5T_NO_CLASS) - { - if (fromClass() == "DataSet") - throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); - else if (fromClass() == "Attribute") - throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); - } - return(type_class); + // Check on the returned type_class + if (type_class == H5T_NO_CLASS) + { + if (fromClass() == "DataSet") + throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); + else if (fromClass() == "Attribute") + throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); + } + return(type_class); } //-------------------------------------------------------------------------- -// Function: AbstractDs::getDataType -///\brief Returns the generic datatype of this abstract dataset, which -/// can be a dataset or an attribute. -///\return DataType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getDataType +///\brief Returns the generic datatype of this abstract dataset, which +/// can be a dataset or an attribute. +///\return DataType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType AbstractDs::getDataType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getDataType. Then, create and - // return the DataType object - try { - DataType datatype; - f_DataType_setId(&datatype, p_get_type()); - return(datatype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getDataType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getDataType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getDataType. Then, create and + // return the DataType object + try { + DataType datatype; + f_DataType_setId(&datatype, p_get_type()); + return(datatype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getDataType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getDataType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getArrayType -///\brief Returns the array datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return ArrayType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: AbstractDs::getArrayType +///\brief Returns the array datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return ArrayType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- ArrayType AbstractDs::getArrayType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getArrayType. Then, create and - // return the ArrayType object - try { - // Create ArrayType and set values this way to work around the - // problem described in the JIRA issue HDFFV-7947 - ArrayType arraytype; - f_DataType_setId(&arraytype, p_get_type()); - return(arraytype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getArrayType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getArrayType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getArrayType. Then, create and + // return the ArrayType object + try { + // Create ArrayType and set values this way to work around the + // problem described in the JIRA issue HDFFV-7947 + ArrayType arraytype; + f_DataType_setId(&arraytype, p_get_type()); + return(arraytype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getArrayType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getArrayType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getCompType -///\brief Returns the compound datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return CompType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getCompType +///\brief Returns the compound datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return CompType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType AbstractDs::getCompType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getCompType. Then, create and - // return the CompType object - try { - CompType comptype; - f_DataType_setId(&comptype, p_get_type()); - return(comptype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getCompType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getCompType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getCompType. Then, create and + // return the CompType object + try { + CompType comptype; + f_DataType_setId(&comptype, p_get_type()); + return(comptype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getCompType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getCompType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getEnumType -///\brief Returns the enumeration datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return EnumType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getEnumType +///\brief Returns the enumeration datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return EnumType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType AbstractDs::getEnumType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getEnumType. Then, create and - // return the EnumType object - try { - EnumType enumtype; - f_DataType_setId(&enumtype, p_get_type()); - return(enumtype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getEnumType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getEnumType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getEnumType. Then, create and + // return the EnumType object + try { + EnumType enumtype; + f_DataType_setId(&enumtype, p_get_type()); + return(enumtype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getEnumType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getEnumType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getIntType -///\brief Returns the integer datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return IntType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getIntType +///\brief Returns the integer datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return IntType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType AbstractDs::getIntType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getIntType. Then, create and - // return the IntType object - try { - IntType inttype; - f_DataType_setId(&inttype, p_get_type()); - return(inttype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getIntType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getIntType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getIntType. Then, create and + // return the IntType object + try { + IntType inttype; + f_DataType_setId(&inttype, p_get_type()); + return(inttype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getIntType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getIntType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getFloatType -///\brief Returns the floating-point datatype of this abstract dataset, -/// which can be a dataset or an attribute. -///\return FloatType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getFloatType +///\brief Returns the floating-point datatype of this abstract dataset, +/// which can be a dataset or an attribute. +///\return FloatType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType AbstractDs::getFloatType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getFloatType. Then, create and - // return the FloatType object - try { - FloatType floatype; - f_DataType_setId(&floatype, p_get_type()); - return(floatype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getFloatType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getFloatType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getFloatType. Then, create and + // return the FloatType object + try { + FloatType floatype; + f_DataType_setId(&floatype, p_get_type()); + return(floatype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getFloatType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getFloatType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getStrType -///\brief Returns the string datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return StrType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getStrType +///\brief Returns the string datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return StrType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType AbstractDs::getStrType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getStrType. Then, create and - // return the StrType object - try { - StrType strtype; - f_DataType_setId(&strtype, p_get_type()); - return(strtype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getStrType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getStrType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getStrType. Then, create and + // return the StrType object + try { + StrType strtype; + f_DataType_setId(&strtype, p_get_type()); + return(strtype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getStrType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getStrType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getVarLenType -///\brief Returns the floating-point datatype of this abstract dataset, -/// which can be a dataset or an attribute. -///\return VarLenType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: AbstractDs::getVarLenType +///\brief Returns the floating-point datatype of this abstract dataset, +/// which can be a dataset or an attribute. +///\return VarLenType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- VarLenType AbstractDs::getVarLenType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getVarLenType. Then, create and - // return the VarLenType object - try { - VarLenType varlentype; - f_DataType_setId(&varlentype, p_get_type()); - return(varlentype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getVarLenType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getVarLenType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getVarLenType. Then, create and + // return the VarLenType object + try { + VarLenType varlentype; + f_DataType_setId(&varlentype, p_get_type()); + return(varlentype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getVarLenType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getVarLenType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AbstractDs::~AbstractDs() {} diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index 1b4775c..eaa9d14 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -37,44 +37,44 @@ class DataSpace; */ class H5_DLLCPP AbstractDs { public: - // Gets a copy the datatype of that this abstract dataset uses. - // Note that this datatype is a generic one and can only be accessed - // via generic member functions, i.e., member functions belong - // to DataType. To get specific datatype, i.e. EnumType, FloatType, - // etc..., use the specific functions, that follow, instead. - DataType getDataType() const; + // Gets a copy the datatype of that this abstract dataset uses. + // Note that this datatype is a generic one and can only be accessed + // via generic member functions, i.e., member functions belong + // to DataType. To get specific datatype, i.e. EnumType, FloatType, + // etc..., use the specific functions, that follow, instead. + DataType getDataType() const; - // Gets a copy of the specific datatype of this abstract dataset. - ArrayType getArrayType() const; - CompType getCompType() const; - EnumType getEnumType() const; - IntType getIntType() const; - FloatType getFloatType() const; - StrType getStrType() const; - VarLenType getVarLenType() const; + // Gets a copy of the specific datatype of this abstract dataset. + ArrayType getArrayType() const; + CompType getCompType() const; + EnumType getEnumType() const; + IntType getIntType() const; + FloatType getFloatType() const; + StrType getStrType() const; + VarLenType getVarLenType() const; - ///\brief Gets the size in memory of this abstract dataset. - virtual size_t getInMemDataSize() const = 0; + ///\brief Gets the size in memory of this abstract dataset. + virtual size_t getInMemDataSize() const = 0; - ///\brief Gets the dataspace of this abstract dataset - pure virtual. - virtual DataSpace getSpace() const = 0; + ///\brief Gets the dataspace of this abstract dataset - pure virtual. + virtual DataSpace getSpace() const = 0; - // Gets the class of the datatype that is used by this abstract - // dataset. - H5T_class_t getTypeClass() const; + // Gets the class of the datatype that is used by this abstract + // dataset. + H5T_class_t getTypeClass() const; - ///\brief Returns the amount of storage size required - pure virtual. - virtual hsize_t getStorageSize() const = 0; + ///\brief Returns the amount of storage size required - pure virtual. + virtual hsize_t getStorageSize() const = 0; - // Returns this class name - pure virtual. - virtual H5std_string fromClass() const = 0; + // Returns this class name - pure virtual. + virtual H5std_string fromClass() const = 0; - // Destructor - virtual ~AbstractDs(); + // Destructor + virtual ~AbstractDs(); protected: - // Default constructor - AbstractDs(); + // Default constructor + AbstractDs(); // *** Deprecation warning *** // The following two constructors are no longer appropriate after the @@ -83,14 +83,14 @@ class H5_DLLCPP AbstractDs { // other will be removed from 1.10 release, and then from 1.8 if its // removal does not raise any problems in two 1.10 releases. - // Mar 2016 -BMR, AbstractDs(const hid_t h5_id); + // Mar 2016 -BMR, AbstractDs(const hid_t h5_id); - // Copy constructor - // AbstractDs( const AbstractDs& original ); + // Copy constructor + // AbstractDs( const AbstractDs& original ); private: - // This member function is implemented by DataSet and Attribute - pure virtual. - virtual hid_t p_get_type() const = 0; + // This member function is implemented by DataSet and Attribute - pure virtual. + virtual hid_t p_get_type() const = 0; }; } #endif // __AbstractDs_H diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index ecce591..3cdcc0a 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -30,95 +30,95 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: ArrayType default constructor -///\brief Default constructor: Creates a stub ArrayType -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType default constructor +///\brief Default constructor: Creates a stub ArrayType +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::ArrayType() : DataType() {} //-------------------------------------------------------------------------- -// Function: ArrayType overloaded constructor -///\brief Creates an ArrayType object using an existing id. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType overloaded constructor +///\brief Creates an ArrayType object using an existing id. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- -ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) {} +ArrayType::ArrayType(const hid_t existing_id) : DataType(existing_id) {} //-------------------------------------------------------------------------- -// Function: ArrayType copy constructor -///\brief Copy constructor: makes a copy of the original ArrayType object. -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType copy constructor +///\brief Copy constructor: makes a copy of the original ArrayType object. +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::ArrayType(const ArrayType& original) : DataType(original) {} //-------------------------------------------------------------------------- -// Function: ArrayType overloaded constructor -///\brief Creates a new array data type based on the specified -/// \a base_type. -///\param base_type - IN: Existing datatype -///\param ndims - IN: Rank of the array, [0..H5S_MAX_RANK] -///\param dims - IN: Size of each array dimension -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType overloaded constructor +///\brief Creates a new array data type based on the specified +/// \a base_type. +///\param base_type - IN: Existing datatype +///\param ndims - IN: Rank of the array, [0..H5S_MAX_RANK] +///\param dims - IN: Size of each array dimension +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) : DataType() { // Call C API to create an array data type hid_t new_type_id = H5Tarray_create2(base_type.getId(), ndims, dims); if (new_type_id < 0) - throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed"); + throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed"); // Set the id for this object id = new_type_id; } //-------------------------------------------------------------------------- -// Function: ArrayType overloaded constructor -///\brief Creates an ArrayType instance by opening an HDF5 array datatype -/// given its name, provided as a C character string. -///\param dtype_name - IN: Array type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: ArrayType overloaded constructor +///\brief Creates an ArrayType instance by opening an HDF5 array datatype +/// given its name, provided as a C character string. +///\param dtype_name - IN: Array type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openArrayType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openArrayType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- ArrayType::ArrayType(const H5Location& loc, const char *dtype_name) : DataType() { - id = p_opentype(loc, dtype_name); + id = p_opentype(loc, dtype_name); } //-------------------------------------------------------------------------- -// Function: ArrayType overloaded constructor -///\brief Creates an ArrayType instance by opening an HDF5 array datatype -/// given its name, provided as an \c H5std_string. -///\param dtype_name - IN: Array type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: ArrayType overloaded constructor +///\brief Creates an ArrayType instance by opening an HDF5 array datatype +/// given its name, provided as an \c H5std_string. +///\param dtype_name - IN: Array type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openArrayType(const H5std_string&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openArrayType(const H5std_string&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- ArrayType::ArrayType(const H5Location& loc, const H5std_string& dtype_name) : DataType() { - id = p_opentype(loc, dtype_name.c_str()); + id = p_opentype(loc, dtype_name.c_str()); } //-------------------------------------------------------------------------- -// Function: ArrayType::operator= -///\brief Assignment operator -///\param rhs - IN: Reference to the existing array datatype -///\return Reference to ArrayType instance -///\exception H5::DataTypeIException +// Function: ArrayType::operator= +///\brief Assignment operator +///\param rhs - IN: Reference to the existing array datatype +///\return Reference to ArrayType instance +///\exception H5::DataTypeIException // Description -// Closes the id on the lhs object first with setId, then copies -// each data member from the rhs object. (Issue HDFFV-9562) -// Programmer Binh-Minh Ribler - Mar 2016 +// Closes the id on the lhs object first with setId, then copies +// each data member from the rhs object. (Issue HDFFV-9562) +// Programmer Binh-Minh Ribler - Mar 2016 // Modification //-------------------------------------------------------------------------- ArrayType& ArrayType::operator=(const ArrayType& rhs) @@ -139,14 +139,14 @@ ArrayType& ArrayType::operator=(const ArrayType& rhs) } //-------------------------------------------------------------------------- -// Function: ArrayType::getArrayNDims -///\brief Returns the number of dimensions for an array datatype. -///\return Number of dimensions -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType::getArrayNDims +///\brief Returns the number of dimensions for an array datatype. +///\return Number of dimensions +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May 2004 // Modification -// Apr, 2016 -// Became const. +// Apr, 2016 +// Became const. //-------------------------------------------------------------------------- int ArrayType::getArrayNDims() const { @@ -154,38 +154,38 @@ int ArrayType::getArrayNDims() const int ndims = H5Tget_array_ndims(id); if (ndims < 0) { - throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed"); + throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed"); } return(ndims); } //-------------------------------------------------------------------------- -// Function: ArrayType::getArrayDims -///\brief Retrieves the size of all dimensions of an array datatype. -///\param dims - OUT: Sizes of dimensions -///\return Number of dimensions -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType::getArrayDims +///\brief Retrieves the size of all dimensions of an array datatype. +///\param dims - OUT: Sizes of dimensions +///\return Number of dimensions +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May 2004 // Modification -// Apr, 2016 -// Became const. +// Apr, 2016 +// Became const. //-------------------------------------------------------------------------- int ArrayType::getArrayDims(hsize_t* dims) const { // Get the dimensions int ndims = H5Tget_array_dims2(id, dims); if (ndims < 0) - throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); + throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); // Return the number of dimensions return(ndims); } //-------------------------------------------------------------------------- -// Function: ArrayType destructor -///\brief Properly terminates access to this array datatype. -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType destructor +///\brief Properly terminates access to this array datatype. +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::~ArrayType() {} diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 65917ae..15b6bb3 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -27,39 +27,39 @@ namespace H5 { */ class H5_DLLCPP ArrayType : public DataType { public: - // Constructor that creates a new array data type based on the - // specified base type. - ArrayType(const DataType& base_type, int ndims, const hsize_t* dims); + // Constructor that creates a new array data type based on the + // specified base type. + ArrayType(const DataType& base_type, int ndims, const hsize_t* dims); - // Assignment operator - ArrayType& operator=(const ArrayType& rhs); + // Assignment operator + ArrayType& operator=(const ArrayType& rhs); - // Constructors that open an array datatype, given a location. - ArrayType(const H5Location& loc, const char* name); - ArrayType(const H5Location& loc, const H5std_string& name); + // Constructors that open an array datatype, given a location. + ArrayType(const H5Location& loc, const char* name); + ArrayType(const H5Location& loc, const H5std_string& name); - // Returns the number of dimensions of this array datatype. - int getArrayNDims() const; - //int getArrayNDims(); // removed 1.8.18 and 1.10.1 + // Returns the number of dimensions of this array datatype. + int getArrayNDims() const; + //int getArrayNDims(); // removed 1.8.18 and 1.10.1 - // Returns the sizes of dimensions of this array datatype. - int getArrayDims(hsize_t* dims) const; - //int getArrayDims(hsize_t* dims); // removed 1.8.18 and 1.10.1 + // Returns the sizes of dimensions of this array datatype. + int getArrayDims(hsize_t* dims) const; + //int getArrayDims(hsize_t* dims); // removed 1.8.18 and 1.10.1 - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("ArrayType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("ArrayType"); } - // Copy constructor: makes copy of the original object. - ArrayType( const ArrayType& original ); + // Copy constructor: makes copy of the original object. + ArrayType(const ArrayType& original); - // Constructor that takes an existing id - ArrayType( const hid_t existing_id ); + // Constructor that takes an existing id + ArrayType(const hid_t existing_id); - // Noop destructor - virtual ~ArrayType(); + // Noop destructor + virtual ~ArrayType(); - // Default constructor - ArrayType(); + // Default constructor + ArrayType(); }; } #endif // __H5ArrayType_H diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 22b163a..0dc2b1e 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -31,265 +31,265 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: AtomType default constructor [protected] -// Purpose Default constructor: creates a stub atomic datatype. -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType default constructor [protected] +// Purpose Default constructor: creates a stub atomic datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AtomType::AtomType() : DataType() {} //-------------------------------------------------------------------------- -// Function: AtomType overloaded constructor [protected] -// Purpose Creates an AtomType object using an existing id. -// Parameter existing_id - IN: Id of an existing datatype -// Exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType overloaded constructor [protected] +// Purpose Creates an AtomType object using an existing id. +// Parameter existing_id - IN: Id of an existing datatype +// Exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -AtomType::AtomType( const hid_t existing_id ) : DataType( existing_id ) {} +AtomType::AtomType(const hid_t existing_id) : DataType(existing_id) {} //-------------------------------------------------------------------------- -// Function: AtomType copy constructor -///\brief Copy constructor: makes a copy of the original AtomType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType copy constructor +///\brief Copy constructor: makes a copy of the original AtomType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -AtomType::AtomType( const AtomType& original ) : DataType( original ) {} +AtomType::AtomType(const AtomType& original) : DataType(original) {} #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: AtomType::setSize -///\brief Sets the total size for an atomic datatype. -///\param size - IN: Size to set -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType::setSize +///\brief Sets the total size for an atomic datatype. +///\param size - IN: Size to set +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setSize( size_t size ) const +void AtomType::setSize(size_t size) const { - // Call C routine H5Tset_size to set the total size - herr_t ret_value = H5Tset_size( id, size ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("setSize"), "H5Tset_size failed"); - } + // Call C routine H5Tset_size to set the total size + herr_t ret_value = H5Tset_size(id, size); + if (ret_value < 0) + { + throw DataTypeIException(inMemFunc("setSize"), "H5Tset_size failed"); + } } //-------------------------------------------------------------------------- -// Function: AtomType::getOrder -///\brief Returns the byte order of an atomic datatype. -///\return Byte order, which can be: -/// \li \c H5T_ORDER_LE -/// \li \c H5T_ORDER_BE -/// \li \c H5T_ORDER_VAX -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: AtomType::getOrder +///\brief Returns the byte order of an atomic datatype. +///\return Byte order, which can be: +/// \li \c H5T_ORDER_LE +/// \li \c H5T_ORDER_BE +/// \li \c H5T_ORDER_VAX +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- H5T_order_t AtomType::getOrder() const { - // Call C routine to get the byte ordering - H5T_order_t type_order = H5Tget_order( id ); + // Call C routine to get the byte ordering + H5T_order_t type_order = H5Tget_order(id); - // return a byte order constant if successful - if( type_order == H5T_ORDER_ERROR ) - { - throw DataTypeIException(inMemFunc("getOrder"), - "H5Tget_order returns H5T_ORDER_ERROR"); - } - return( type_order ); + // return a byte order constant if successful + if (type_order == H5T_ORDER_ERROR) + { + throw DataTypeIException(inMemFunc("getOrder"), + "H5Tget_order returns H5T_ORDER_ERROR"); + } + return(type_order); } //-------------------------------------------------------------------------- -// Function: AtomType::getOrder -///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c H5std_string for the buffer that -/// provide the text description of the returned byte order. -/// The text description can be either of the following: -/// "Little endian byte ordering (0)"; -/// "Big endian byte ordering (1)"; -/// "VAX mixed byte ordering (2)"; -///\param order_string - OUT: Text description of the returned byte order -///\return Byte order, which can be: -/// \li \c H5T_ORDER_LE -/// \li \c H5T_ORDER_BE -/// \li \c H5T_ORDER_VAX -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType::getOrder +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the buffer that +/// provide the text description of the returned byte order. +/// The text description can be either of the following: +/// "Little endian byte ordering (0)"; +/// "Big endian byte ordering (1)"; +/// "VAX mixed byte ordering (2)"; +///\param order_string - OUT: Text description of the returned byte order +///\return Byte order, which can be: +/// \li \c H5T_ORDER_LE +/// \li \c H5T_ORDER_BE +/// \li \c H5T_ORDER_VAX +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5T_order_t AtomType::getOrder( H5std_string& order_string ) const +H5T_order_t AtomType::getOrder(H5std_string& order_string) const { - // Call the overloaded to get the type order without text - H5T_order_t type_order = getOrder(); + // Call the overloaded to get the type order without text + H5T_order_t type_order = getOrder(); - // Then provide the text and return the type order - if( type_order == H5T_ORDER_LE ) - order_string = "Little endian byte ordering (0)"; - else if( type_order == H5T_ORDER_BE ) - order_string = "Big endian byte ordering (1)"; - else if( type_order == H5T_ORDER_VAX ) - order_string = "VAX mixed byte ordering (2)"; - return( type_order ); + // Then provide the text and return the type order + if (type_order == H5T_ORDER_LE) + order_string = "Little endian byte ordering (0)"; + else if (type_order == H5T_ORDER_BE) + order_string = "Big endian byte ordering (1)"; + else if (type_order == H5T_ORDER_VAX) + order_string = "VAX mixed byte ordering (2)"; + return(type_order); } //-------------------------------------------------------------------------- -// Function: AtomType::setOrder -///\brief Sets the byte ordering of an atomic datatype. -///\param order - IN: Byte ordering constant, which can be: -/// \li \c H5T_ORDER_LE -/// \li \c H5T_ORDER_BE -/// \li \c H5T_ORDER_VAX -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType::setOrder +///\brief Sets the byte ordering of an atomic datatype. +///\param order - IN: Byte ordering constant, which can be: +/// \li \c H5T_ORDER_LE +/// \li \c H5T_ORDER_BE +/// \li \c H5T_ORDER_VAX +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setOrder( H5T_order_t order ) const +void AtomType::setOrder(H5T_order_t order) const { - // Call C routine to set the byte ordering - herr_t ret_value = H5Tset_order( id, order ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("setOrder"), "H5Tset_order failed"); - } + // Call C routine to set the byte ordering + herr_t ret_value = H5Tset_order(id, order); + if (ret_value < 0) + { + throw DataTypeIException(inMemFunc("setOrder"), "H5Tset_order failed"); + } } //-------------------------------------------------------------------------- -// Function: AtomType::getPrecision -///\brief Returns the precision of an atomic datatype. -///\return Number of significant bits -///\exception H5::DataTypeIException +// Function: AtomType::getPrecision +///\brief Returns the precision of an atomic datatype. +///\return Number of significant bits +///\exception H5::DataTypeIException ///\par Description -/// The precision is the number of significant bits which, -/// unless padding is present, is 8 times larger than the -/// value returned by \c DataType::getSize(). -// Programmer Binh-Minh Ribler - 2000 +/// The precision is the number of significant bits which, +/// unless padding is present, is 8 times larger than the +/// value returned by \c DataType::getSize(). +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- size_t AtomType::getPrecision() const { - size_t num_signi_bits = H5Tget_precision( id ); // C routine + size_t num_signi_bits = H5Tget_precision(id); // C routine - // returns number of significant bits if successful - if( num_signi_bits == 0 ) - { - throw DataTypeIException(inMemFunc("getPrecision"), - "H5Tget_precision returns invalid number of significant bits"); - } - return( num_signi_bits ); + // returns number of significant bits if successful + if (num_signi_bits == 0) + { + throw DataTypeIException(inMemFunc("getPrecision"), + "H5Tget_precision returns invalid number of significant bits"); + } + return(num_signi_bits); } //-------------------------------------------------------------------------- -// Function: AtomType::setPrecision -///\brief Sets the precision of an atomic datatype. -///\param precision - IN: Number of bits of precision -///\exception H5::DataTypeIException +// Function: AtomType::setPrecision +///\brief Sets the precision of an atomic datatype. +///\param precision - IN: Number of bits of precision +///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: +/// For information, please see C layer Reference Manuat at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetPrecision -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setPrecision( size_t precision ) const +void AtomType::setPrecision(size_t precision) const { - // Call C routine to set the datatype precision - herr_t ret_value = H5Tset_precision( id, precision ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("setPrecision"), "H5Tset_precision failed"); - } + // Call C routine to set the datatype precision + herr_t ret_value = H5Tset_precision(id, precision); + if (ret_value < 0) + { + throw DataTypeIException(inMemFunc("setPrecision"), "H5Tset_precision failed"); + } } //-------------------------------------------------------------------------- -// Function: AtomType::getOffset -///\brief Retrieves the bit offset of the first significant bit. -///\return Offset value -///\exception H5::DataTypeIException +// Function: AtomType::getOffset +///\brief Retrieves the bit offset of the first significant bit. +///\return Offset value +///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: +/// For information, please see C layer Reference Manuat at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetOffset -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Modification -// 12/05/00: due to C API change -// - return type changed from size_t to int -// - offset = -1 when failure occurs vs. 0 +// 12/05/00: due to C API change +// - return type changed from size_t to int +// - offset = -1 when failure occurs vs. 0 //-------------------------------------------------------------------------- int AtomType::getOffset() const { - int offset = H5Tget_offset( id ); // C routine + int offset = H5Tget_offset(id); // C routine - // returns a non-negative offset value if successful - if( offset == -1 ) - { - throw DataTypeIException(inMemFunc("getOffset"), - "H5Tget_offset returns a negative offset value"); - } - return( offset ); + // returns a non-negative offset value if successful + if (offset == -1) + { + throw DataTypeIException(inMemFunc("getOffset"), + "H5Tget_offset returns a negative offset value"); + } + return(offset); } //-------------------------------------------------------------------------- -// Function: AtomType::setOffset -///\brief Sets the bit offset of the first significant bit. -///\param offset - IN: Offset of first significant bit -///\exception H5::DataTypeIException +// Function: AtomType::setOffset +///\brief Sets the bit offset of the first significant bit. +///\param offset - IN: Offset of first significant bit +///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: +/// For information, please see C layer Reference Manuat at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetOffset -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setOffset( size_t offset ) const +void AtomType::setOffset(size_t offset) const { - // Call C routine to set the bit offset - herr_t ret_value = H5Tset_offset( id, offset ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("setOffset"), "H5Tset_offset failed"); - } + // Call C routine to set the bit offset + herr_t ret_value = H5Tset_offset(id, offset); + if (ret_value < 0) + { + throw DataTypeIException(inMemFunc("setOffset"), "H5Tset_offset failed"); + } } //-------------------------------------------------------------------------- -// Function: AtomType::getPad -///\brief Retrieves the padding type of the least and most-significant -/// bit padding. -///\param lsb - OUT: Least-significant bit padding type -///\param msb - OUT: Most-significant bit padding type -///\exception H5::DataTypeIException +// Function: AtomType::getPad +///\brief Retrieves the padding type of the least and most-significant +/// bit padding. +///\param lsb - OUT: Least-significant bit padding type +///\param msb - OUT: Most-significant bit padding type +///\exception H5::DataTypeIException ///\par Description -/// Possible values for \a lsb and \a msb include: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. -/// \li \c H5T_PAD_ONE (1) - Set background to ones. -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. -// Programmer Binh-Minh Ribler - 2000 +/// Possible values for \a lsb and \a msb include: +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. +/// \li \c H5T_PAD_ONE (1) - Set background to ones. +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const +void AtomType::getPad(H5T_pad_t& lsb, H5T_pad_t& msb) const { - // Call C routine to get the padding type - herr_t ret_value = H5Tget_pad( id, &lsb, &msb ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("getPad"), "H5Tget_pad failed"); - } + // Call C routine to get the padding type + herr_t ret_value = H5Tget_pad(id, &lsb, &msb); + if (ret_value < 0) + { + throw DataTypeIException(inMemFunc("getPad"), "H5Tget_pad failed"); + } } //-------------------------------------------------------------------------- -// Function: AtomType::setPad -///\brief Sets the least and most-significant bits padding types. -///\param lsb - IN: Least-significant bit padding type -///\param msb - IN: Most-significant bit padding type -///\exception H5::DataTypeIException +// Function: AtomType::setPad +///\brief Sets the least and most-significant bits padding types. +///\param lsb - IN: Least-significant bit padding type +///\param msb - IN: Most-significant bit padding type +///\exception H5::DataTypeIException ///\par Description -/// Valid values for \a lsb and \a msb include: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. -/// \li \c H5T_PAD_ONE (1) - Set background to ones. -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for \a lsb and \a msb include: +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. +/// \li \c H5T_PAD_ONE (1) - Set background to ones. +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setPad( H5T_pad_t lsb, H5T_pad_t msb ) const +void AtomType::setPad(H5T_pad_t lsb, H5T_pad_t msb) const { - // Call C routine to set the padding type - herr_t ret_value = H5Tset_pad( id, lsb, msb ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("setPad"), "H5Tset_pad failed"); - } + // Call C routine to set the padding type + herr_t ret_value = H5Tset_pad(id, lsb, msb); + if (ret_value < 0) + { + throw DataTypeIException(inMemFunc("setPad"), "H5Tset_pad failed"); + } } #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: AtomType destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AtomType::~AtomType() {} #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index d84b53f..a1e0262 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -30,53 +30,53 @@ namespace H5 { */ class H5_DLLCPP AtomType : public DataType { public: - // Returns the byte order of an atomic datatype. - H5T_order_t getOrder() const; - H5T_order_t getOrder( H5std_string& order_string ) const; + // Returns the byte order of an atomic datatype. + H5T_order_t getOrder() const; + H5T_order_t getOrder(H5std_string& order_string) const; - // Sets the byte ordering of an atomic datatype. - void setOrder( H5T_order_t order ) const; + // Sets the byte ordering of an atomic datatype. + void setOrder(H5T_order_t order) const; - // Retrieves the bit offset of the first significant bit. - // 12/05/00 - changed return type to int from size_t - C API - int getOffset() const; + // Retrieves the bit offset of the first significant bit. + // 12/05/00 - changed return type to int from size_t - C API + int getOffset() const; - // Sets the bit offset of the first significant bit. - void setOffset( size_t offset ) const; + // Sets the bit offset of the first significant bit. + void setOffset(size_t offset) const; - // Retrieves the padding type of the least and most-significant bit padding. - void getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const; + // Retrieves the padding type of the least and most-significant bit padding. + void getPad(H5T_pad_t& lsb, H5T_pad_t& msb) const; - // Sets the least and most-significant bits padding types - void setPad( H5T_pad_t lsb, H5T_pad_t msb ) const; + // Sets the least and most-significant bits padding types + void setPad(H5T_pad_t lsb, H5T_pad_t msb) const; - // Returns the precision of an atomic datatype. - size_t getPrecision() const; + // Returns the precision of an atomic datatype. + size_t getPrecision() const; - // Sets the precision of an atomic datatype. - void setPrecision( size_t precision ) const; + // Sets the precision of an atomic datatype. + void setPrecision(size_t precision) const; - // Sets the total size for an atomic datatype. - void setSize( size_t size ) const; + // Sets the total size for an atomic datatype. + void setSize(size_t size) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("AtomType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("AtomType"); } #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Copy constructor - makes copy of the original object - AtomType( const AtomType& original ); + // Copy constructor - makes copy of the original object + AtomType(const AtomType& original); - // Noop destructor - virtual ~AtomType(); + // Noop destructor + virtual ~AtomType(); #endif // DOXYGEN_SHOULD_SKIP_THIS protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Default constructor - AtomType(); + // Default constructor + AtomType(); - // Constructor that takes an existing id - AtomType( const hid_t existing_id ); + // Constructor that takes an existing id + AtomType(const hid_t existing_id); #endif // DOXYGEN_SHOULD_SKIP_THIS }; } diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index dfd2b28..6701f6e 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -1,7 +1,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * +/* All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * @@ -20,7 +20,7 @@ #endif #include -#include "H5private.h" // for HDfree +#include "H5private.h" // for HDfree #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -44,17 +44,17 @@ using std::endl; class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate //-------------------------------------------------------------------------- -// Function: Attribute default constructor -///\brief Default constructor: Creates a stub attribute -// Programmer Binh-Minh Ribler - May, 2004 +// Function: Attribute default constructor +///\brief Default constructor: Creates a stub attribute +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- Attribute::Attribute() : AbstractDs(), H5Location(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: Attribute copy constructor -///\brief Copy constructor: makes a copy of the original Attribute object. -///\param original - IN: Original Attribute object to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute copy constructor +///\brief Copy constructor: makes a copy of the original Attribute object. +///\param original - IN: Original Attribute object to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute::Attribute(const Attribute& original) : AbstractDs(), H5Location(), id(original.id) { @@ -62,12 +62,12 @@ Attribute::Attribute(const Attribute& original) : AbstractDs(), H5Location(), id } //-------------------------------------------------------------------------- -// Function: Attribute overloaded constructor -///\brief Creates an Attribute object using the id of an existing -/// attribute. -///\param existing_id - IN: Id of an existing attribute -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute overloaded constructor +///\brief Creates an Attribute object using the id of an existing +/// attribute. +///\param existing_id - IN: Id of an existing attribute +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute::Attribute(const hid_t existing_id) : AbstractDs(), H5Location(), id(existing_id) { @@ -75,30 +75,30 @@ Attribute::Attribute(const hid_t existing_id) : AbstractDs(), H5Location(), id(e } //-------------------------------------------------------------------------- -// Function: Attribute::write -///\brief Writes data to this attribute. -///\param mem_type - IN: Attribute datatype (in memory) -///\param buf - IN: Data to be written -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute::write +///\brief Writes data to this attribute. +///\param mem_type - IN: Attribute datatype (in memory) +///\param buf - IN: Data to be written +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Attribute::write( const DataType& mem_type, const void *buf ) const +void Attribute::write(const DataType& mem_type, const void *buf) const { - herr_t ret_value = H5Awrite( id, mem_type.getId(), buf ); - if( ret_value < 0 ) - { - throw AttributeIException("Attribute::write", "H5Awrite failed"); - } + herr_t ret_value = H5Awrite(id, mem_type.getId(), buf); + if (ret_value < 0) + { + throw AttributeIException("Attribute::write", "H5Awrite failed"); + } } //-------------------------------------------------------------------------- -// Function: Attribute::write -///\brief This is an overloaded member function, provided for convenience. -/// It writes a \a H5std_string to this attribute. -///\param mem_type - IN: Attribute datatype (in memory) -///\param strg - IN: Data to be written -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Apr, 2003 +// Function: Attribute::write +///\brief This is an overloaded member function, provided for convenience. +/// It writes a \a H5std_string to this attribute. +///\param mem_type - IN: Attribute datatype (in memory) +///\param strg - IN: Data to be written +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Apr, 2003 //-------------------------------------------------------------------------- void Attribute::write(const DataType& mem_type, const H5std_string& strg) const { @@ -107,7 +107,7 @@ void Attribute::write(const DataType& mem_type, const H5std_string& strg) const htri_t is_variable_len = H5Tis_variable_str(mem_type.getId()); if (is_variable_len < 0) { - throw AttributeIException("Attribute::write", "H5Tis_variable_str failed"); + throw AttributeIException("Attribute::write", "H5Tis_variable_str failed"); } // Convert string to C-string const char* strg_C; @@ -117,55 +117,55 @@ void Attribute::write(const DataType& mem_type, const H5std_string& strg) const // Pass string in differently depends on variable or fixed length if (!is_variable_len) { - ret_value = H5Awrite(id, mem_type.getId(), strg_C); + ret_value = H5Awrite(id, mem_type.getId(), strg_C); } else { - // passing third argument by address - ret_value = H5Awrite(id, mem_type.getId(), &strg_C); + // passing third argument by address + ret_value = H5Awrite(id, mem_type.getId(), &strg_C); } if (ret_value < 0) { - throw AttributeIException("Attribute::write", "H5Awrite failed"); + throw AttributeIException("Attribute::write", "H5Awrite failed"); } } //-------------------------------------------------------------------------- -// Function: Attribute::read -///\brief Reads data from this attribute. -///\param mem_type - IN: Attribute datatype (in memory) -///\param buf - OUT: Buffer for read data -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute::read +///\brief Reads data from this attribute. +///\param mem_type - IN: Attribute datatype (in memory) +///\param buf - OUT: Buffer for read data +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Attribute::read( const DataType& mem_type, void *buf ) const +void Attribute::read(const DataType& mem_type, void *buf) const { - herr_t ret_value = H5Aread( id, mem_type.getId(), buf ); - if( ret_value < 0 ) - { - throw AttributeIException("Attribute::read", "H5Aread failed"); - } + herr_t ret_value = H5Aread(id, mem_type.getId(), buf); + if (ret_value < 0) + { + throw AttributeIException("Attribute::read", "H5Aread failed"); + } } //-------------------------------------------------------------------------- -// Function: Attribute::read -///\brief This is an overloaded member function, provided for convenience. -/// It reads a \a H5std_string from this attribute. -///\param mem_type - IN: Attribute datatype (in memory) -///\param strg - IN: Buffer for read string -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Apr, 2003 +// Function: Attribute::read +///\brief This is an overloaded member function, provided for convenience. +/// It reads a \a H5std_string from this attribute. +///\param mem_type - IN: Attribute datatype (in memory) +///\param strg - IN: Buffer for read string +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Apr, 2003 // Modification -// Mar 2008 -// Corrected a misunderstanding that H5Aread would allocate -// space for the buffer. Obtained the attribute size and -// allocated memory properly. -BMR -// Apr 2009 -// Used getInMemDataSize to get attribute data size. -BMR -// Jul 2009 -// Divided into specific private functions for fixed- and -// variable-len string data: p_read_fixed_len and -// p_read_variable_len. This should improve readability. -BMR +// Mar 2008 +// Corrected a misunderstanding that H5Aread would allocate +// space for the buffer. Obtained the attribute size and +// allocated memory properly. -BMR +// Apr 2009 +// Used getInMemDataSize to get attribute data size. -BMR +// Jul 2009 +// Divided into specific private functions for fixed- and +// variable-len string data: p_read_fixed_len and +// p_read_variable_len. This should improve readability. -BMR //-------------------------------------------------------------------------- void Attribute::read(const DataType& mem_type, H5std_string& strg) const { @@ -188,11 +188,11 @@ void Attribute::read(const DataType& mem_type, H5std_string& strg) const } //-------------------------------------------------------------------------- -// Function: Attribute::getInMemDataSize -///\brief Gets the size in memory of the attribute's data. -///\return Size of data (in memory) -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Apr 2009 +// Function: Attribute::getInMemDataSize +///\brief Gets the size in memory of the attribute's data. +///\return Size of data (in memory) +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Apr 2009 //-------------------------------------------------------------------------- size_t Attribute::getInMemDataSize() const { @@ -200,9 +200,9 @@ size_t Attribute::getInMemDataSize() const // Get the data type of this attribute hid_t mem_type_id = H5Aget_type(id); - if( mem_type_id < 0 ) + if (mem_type_id < 0) { - throw AttributeIException(func, "H5Aget_type failed"); + throw AttributeIException(func, "H5Aget_type failed"); } // Get the data type's size by first getting its native type then getting @@ -210,22 +210,22 @@ size_t Attribute::getInMemDataSize() const hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT); if (native_type < 0) { - throw AttributeIException(func, "H5Tget_native_type failed"); + throw AttributeIException(func, "H5Tget_native_type failed"); } size_t type_size = H5Tget_size(native_type); if (type_size == 0) { - throw AttributeIException(func, "H5Tget_size failed"); + throw AttributeIException(func, "H5Tget_size failed"); } // Close the native type and the datatype of this attribute. if (H5Tclose(native_type) < 0) { - throw DataSetIException(func, "H5Tclose(native_type) failed"); + throw DataSetIException(func, "H5Tclose(native_type) failed"); } if (H5Tclose(mem_type_id) < 0) { - throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); + throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); } // Get number of elements of the attribute by first getting its dataspace @@ -233,18 +233,18 @@ size_t Attribute::getInMemDataSize() const hid_t space_id = H5Aget_space(id); if (space_id < 0) { - throw AttributeIException(func, "H5Aget_space failed"); + throw AttributeIException(func, "H5Aget_space failed"); } hssize_t num_elements = H5Sget_simple_extent_npoints(space_id); if (num_elements < 0) { - throw AttributeIException(func, "H5Sget_simple_extent_npoints failed"); + throw AttributeIException(func, "H5Sget_simple_extent_npoints failed"); } // Close the dataspace if (H5Sclose(space_id) < 0) { - throw DataSetIException(func, "H5Sclose failed"); + throw DataSetIException(func, "H5Sclose failed"); } // Calculate and return the size of the data @@ -253,46 +253,46 @@ size_t Attribute::getInMemDataSize() const } //-------------------------------------------------------------------------- -// Function: Attribute::getSpace -///\brief Gets a copy of the dataspace for this attribute. -///\return Dataspace instance -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute::getSpace +///\brief Gets a copy of the dataspace for this attribute. +///\return Dataspace instance +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace Attribute::getSpace() const { // Calls C function H5Aget_space to get the id of the dataspace - hid_t dataspace_id = H5Aget_space( id ); + hid_t dataspace_id = H5Aget_space(id); // If the dataspace id is valid, create and return the DataSpace object - if( dataspace_id > 0 ) - { - DataSpace dataspace; - f_DataSpace_setId(&dataspace, dataspace_id); - return(dataspace); - } + if (dataspace_id > 0) + { + DataSpace dataspace; + f_DataSpace_setId(&dataspace, dataspace_id); + return(dataspace); + } else - { - throw AttributeIException("Attribute::getSpace", "H5Aget_space failed"); - } + { + throw AttributeIException("Attribute::getSpace", "H5Aget_space failed"); + } } //-------------------------------------------------------------------------- -// Function: Attribute::getName -///\brief Gets the name of this attribute, returning its length. -///\param attr_name - OUT: Buffer for the name string as char* -///\param buf_size - IN: Length of the buffer, default to 0 -///\return Actual length of the attribute name -///\exception H5::AttributeIException +// Function: Attribute::getName +///\brief Gets the name of this attribute, returning its length. +///\param attr_name - OUT: Buffer for the name string as char* +///\param buf_size - IN: Length of the buffer, default to 0 +///\return Actual length of the attribute name +///\exception H5::AttributeIException ///\par Description -/// This function retrieves \a buf_size chars of the attribute's -/// name including null termination. Thus, if the actual length -/// of the name is more than buf_size-1, the retrieved name will -/// be truncated to accommodate the null terminator. -/// To get length of the attribute's name for buffer allocation, -/// an application can call this function passing in NULL for the -/// first argument and ignore the second argument. -// Programmer Binh-Minh Ribler - Mar, 2014 +/// This function retrieves \a buf_size chars of the attribute's +/// name including null termination. Thus, if the actual length +/// of the name is more than buf_size-1, the retrieved name will +/// be truncated to accommodate the null terminator. +/// To get length of the attribute's name for buffer allocation, +/// an application can call this function passing in NULL for the +/// first argument and ignore the second argument. +// Programmer Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- ssize_t Attribute::getName(char* attr_name, size_t buf_size) const { @@ -302,25 +302,25 @@ ssize_t Attribute::getName(char* attr_name, size_t buf_size) const // If H5Aget_name returns a negative value, raise an exception if (name_size < 0) { - throw AttributeIException("Attribute::getName", "H5Aget_name failed"); + throw AttributeIException("Attribute::getName", "H5Aget_name failed"); } else if (name_size == 0) { - throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0"); + throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0"); } // Return length of the name return(name_size); } //-------------------------------------------------------------------------- -// Function: Attribute::getName -///\brief Returns the name of this attribute as an \a H5std_string. -///\return Name of the attribute -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: Attribute::getName +///\brief Returns the name of this attribute as an \a H5std_string. +///\return Name of the attribute +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - May, 2004 // Modification -// Mar 2014 - BMR -// Revised to use the modified getName() above +// Mar 2014 - BMR +// Revised to use the modified getName() above //-------------------------------------------------------------------------- H5std_string Attribute::getName() const { @@ -332,11 +332,11 @@ H5std_string Attribute::getName() const // If H5Aget_name failed, throw exception if (name_size < 0) { - throw AttributeIException("Attribute::getName", "H5Aget_name failed"); + throw AttributeIException("Attribute::getName", "H5Aget_name failed"); } else if (name_size == 0) { - throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0"); + throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0"); } // Attribute's name exists, retrieve it else if (name_size > 0) @@ -359,44 +359,44 @@ H5std_string Attribute::getName() const } //-------------------------------------------------------------------------- -// Function: Attribute::getName -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an integer -/// specifying a desired length to be retrieved of the name. -///\return Name (or part of name) of the attribute -///\param len - IN: Desired length of the name -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute::getName +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an integer +/// specifying a desired length to be retrieved of the name. +///\return Name (or part of name) of the attribute +///\param len - IN: Desired length of the name +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Mar 2014 - BMR -// Revised to use the new getName() below +// Mar 2014 - BMR +// Revised to use the new getName() below //-------------------------------------------------------------------------- H5std_string Attribute::getName(size_t len) const { H5std_string attr_name; ssize_t name_size = getName(attr_name, len); if (name_size < 0) - return(""); + return(""); else - return(attr_name); + return(attr_name); } //-------------------------------------------------------------------------- -// Function: Attribute::getName -///\brief Gets the name of this attribute, returning its length. -///\param attr_name - OUT: Buffer for the name string as \a H5std_string -///\param len - IN: Desired length of the name, default to 0 -///\return Actual length of the attribute name -///\exception H5::AttributeIException +// Function: Attribute::getName +///\brief Gets the name of this attribute, returning its length. +///\param attr_name - OUT: Buffer for the name string as \a H5std_string +///\param len - IN: Desired length of the name, default to 0 +///\return Actual length of the attribute name +///\exception H5::AttributeIException ///\par Description -/// This function retrieves the attribute's name as a string. The -/// buf_size can specify a specific length or default to 0, in -/// which case the entire name will be retrieved. -// Programmer Binh-Minh Ribler - Nov, 2001 +/// This function retrieves the attribute's name as a string. The +/// buf_size can specify a specific length or default to 0, in +/// which case the entire name will be retrieved. +// Programmer Binh-Minh Ribler - Nov, 2001 // Modification -// Mar 2014 - BMR -// Added to replace getName(size_t, H5std_string&) so that it'll -// allow the argument "len" to be skipped. +// Mar 2014 - BMR +// Added to replace getName(size_t, H5std_string&) so that it'll +// allow the argument "len" to be skipped. //-------------------------------------------------------------------------- ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const { @@ -406,7 +406,7 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const if (len == 0) { attr_name = getName(); - name_size = attr_name.length(); + name_size = attr_name.length(); } // If length is provided, get that number of characters in name else @@ -430,33 +430,33 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const } //-------------------------------------------------------------------------- -// Function: Attribute::getName -// Purpose This function is replaced by the previous function, which -// provides more convenient prototype. It will be removed -// in future release. -// Param len - IN: Desired length of the name -// Param attr_name - OUT: Buffer for the name string -// Return Actual length of the attribute name -// Exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Nov, 2001 +// Function: Attribute::getName +// Purpose This function is replaced by the previous function, which +// provides more convenient prototype. It will be removed +// in future release. +// Param len - IN: Desired length of the name +// Param attr_name - OUT: Buffer for the name string +// Return Actual length of the attribute name +// Exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Nov, 2001 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- -//ssize_t Attribute::getName( size_t len, H5std_string& attr_name ) const +//ssize_t Attribute::getName(size_t len, H5std_string& attr_name) const //{ // return (getName(attr_name, len)); //} //-------------------------------------------------------------------------- -// Function: Attribute::getStorageSize -///\brief Returns the amount of storage size required for this attribute. -///\return Size of the storage or 0, for no data -///\exception H5::AttributeIException -// Note: H5Dget_storage_size returns 0 when there is no data. This -// function should have no failure. (from SLU) -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: Attribute::getStorageSize +///\brief Returns the amount of storage size required for this attribute. +///\return Size of the storage or 0, for no data +///\exception H5::AttributeIException +// Note: H5Dget_storage_size returns 0 when there is no data. This +// function should have no failure. (from SLU) +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- hsize_t Attribute::getStorageSize() const { @@ -466,19 +466,19 @@ hsize_t Attribute::getStorageSize() const //-------------------------------------------------------------------------- // Function: Attribute::getId -///\brief Get the id of this attribute -///\return Attribute identifier +///\brief Get the id of this attribute +///\return Attribute identifier // Description: -// Class hierarchy is revised to address bugzilla 1068. Class -// AbstractDS and Attribute are moved out of H5Object. In -// addition, member IdComponent::id is moved into subclasses, and -// IdComponent::getId now becomes pure virtual function. +// Class hierarchy is revised to address bugzilla 1068. Class +// AbstractDS and Attribute are moved out of H5Object. In +// addition, member IdComponent::id is moved into subclasses, and +// IdComponent::getId now becomes pure virtual function. // Programmer Binh-Minh Ribler - May, 2008 // Modification -// Aug 2016 - BMR -// Note that Attribute is now inheriting from H5Location, because -// an attribute id can be used to specify a location in HDF5 -// library. +// Aug 2016 - BMR +// Note that Attribute is now inheriting from H5Location, because +// an attribute id can be used to specify a location in HDF5 +// library. //-------------------------------------------------------------------------- hid_t Attribute::getId() const { @@ -486,36 +486,36 @@ hid_t Attribute::getId() const } //-------------------------------------------------------------------------- -// Function: Attribute::p_get_type (private) -// Purpose Gets the datatype of this attribute. -// Return Id of the datatype -// Exception H5::AttributeIException +// Function: Attribute::p_get_type (private) +// Purpose Gets the datatype of this attribute. +// Return Id of the datatype +// Exception H5::AttributeIException // Description -// This private function is used in AbstractDs. -// Programmer Binh-Minh Ribler - 2000 +// This private function is used in AbstractDs. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hid_t Attribute::p_get_type() const { - hid_t type_id = H5Aget_type( id ); - if( type_id > 0 ) - return( type_id ); - else - { - throw AttributeIException("", "H5Aget_type failed"); - } + hid_t type_id = H5Aget_type(id); + if (type_id > 0) + return(type_id); + else + { + throw AttributeIException("", "H5Aget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: Attribute::p_read_fixed_len (private) -// brief Reads a fixed length \a H5std_string from an attribute. -// param mem_type - IN: Attribute datatype (in memory) -// param strg - IN: Buffer for read string -// exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Jul, 2009 +// Function: Attribute::p_read_fixed_len (private) +// brief Reads a fixed length \a H5std_string from an attribute. +// param mem_type - IN: Attribute datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Jul, 2009 // Modification -// Jul 2009 -// Separated the fixed length case from the original -// Attribute::read +// Jul 2009 +// Separated the fixed length case from the original +// Attribute::read //-------------------------------------------------------------------------- void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const { @@ -527,31 +527,31 @@ void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) c // If there is data, allocate buffer and read it. if (attr_size > 0) { - char *strg_C = new char[attr_size+1]; - herr_t ret_value = H5Aread(id, mem_type.getId(), strg_C); - if( ret_value < 0 ) - { - delete []strg_C; // de-allocate for fixed-len string - throw AttributeIException("Attribute::read", "H5Aread failed"); - } - // Get string from the C char* and release resource allocated locally - strg_C[attr_size] = '\0'; - strg = strg_C; - delete []strg_C; + char *strg_C = new char[attr_size+1]; + herr_t ret_value = H5Aread(id, mem_type.getId(), strg_C); + if (ret_value < 0) + { + delete []strg_C; // de-allocate for fixed-len string + throw AttributeIException("Attribute::read", "H5Aread failed"); + } + // Get string from the C char* and release resource allocated locally + strg_C[attr_size] = '\0'; + strg = strg_C; + delete []strg_C; } } //-------------------------------------------------------------------------- -// Function: Attribute::p_read_variable_len (private) -// brief Reads a variable length \a H5std_string from an attribute. -// param mem_type - IN: Attribute datatype (in memory) -// param strg - IN: Buffer for read string -// exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Jul, 2009 +// Function: Attribute::p_read_variable_len (private) +// brief Reads a variable length \a H5std_string from an attribute. +// param mem_type - IN: Attribute datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Jul, 2009 // Modification -// Jul 2009 -// Separated the variable length case from the original -// Attribute::read. -BMR +// Jul 2009 +// Separated the variable length case from the original +// Attribute::read. -BMR //-------------------------------------------------------------------------- void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg) const { @@ -561,9 +561,9 @@ void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg // Read attribute, no allocation for variable-len string; C library will herr_t ret_value = H5Aread(id, mem_type.getId(), &strg_C); - if( ret_value < 0 ) + if (ret_value < 0) { - throw AttributeIException("Attribute::read", "H5Aread failed"); + throw AttributeIException("Attribute::read", "H5Aread failed"); } // Get string from the C char* and release resource allocated by C API @@ -577,65 +577,65 @@ void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg ///\brief Sets the identifier of this object to a new value. /// ///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails +/// object fails // Description: -// The underlaying reference counting in the C library ensures -// that the current valid id of this object is properly closed. -// Then the object's id is reset to the new id. +// The underlaying reference counting in the C library ensures +// that the current valid id of this object is properly closed. +// Then the object's id is reset to the new id. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Attribute::p_setId(const hid_t new_id) { // handling references to this old id try { - close(); + close(); } catch (Exception& close_error) { - throw AttributeIException("Attribute::p_setId", close_error.getDetailMsg()); + throw AttributeIException("Attribute::p_setId", close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Attribute::close -///\brief Closes this attribute. +// Function: Attribute::close +///\brief Closes this attribute. /// -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void Attribute::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Aclose(id); - if( ret_value < 0 ) - { - throw AttributeIException("Attribute::close", "H5Aclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Aclose(id); + if (ret_value < 0) + { + throw AttributeIException("Attribute::close", "H5Aclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: Attribute destructor -///\brief Properly terminates access to this attribute. -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute destructor +///\brief Properly terminates access to this attribute. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- Attribute::~Attribute() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "Attribute::~Attribute - " << close_error.getDetailMsg() << endl; + cerr << "Attribute::~Attribute - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index c27bbdf..0243cd9 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -32,74 +32,74 @@ namespace H5 { class H5_DLLCPP Attribute : public AbstractDs, public H5Location { public: - // Copy constructor: makes a copy of an existing Attribute object. - Attribute( const Attribute& original ); + // Copy constructor: makes a copy of an existing Attribute object. + Attribute(const Attribute& original); - // Default constructor - Attribute(); + // Default constructor + Attribute(); - // Creates a copy of an existing attribute using the attribute id - Attribute( const hid_t attr_id ); + // Creates a copy of an existing attribute using the attribute id + Attribute(const hid_t attr_id); - // Closes this attribute. - virtual void close(); + // Closes this attribute. + virtual void close(); - // Gets the name of this attribute. - ssize_t getName(char* attr_name, size_t buf_size = 0) const; - H5std_string getName(size_t len) const; - H5std_string getName() const; - ssize_t getName(H5std_string& attr_name, size_t len = 0) const; - // The overloaded function below is replaced by the one above and it - // is kept for backward compatibility purpose. - ssize_t getName( size_t buf_size, H5std_string& attr_name ) const; + // Gets the name of this attribute. + ssize_t getName(char* attr_name, size_t buf_size = 0) const; + H5std_string getName(size_t len) const; + H5std_string getName() const; + ssize_t getName(H5std_string& attr_name, size_t len = 0) const; + // The overloaded function below is replaced by the one above and it + // is kept for backward compatibility purpose. + ssize_t getName(size_t buf_size, H5std_string& attr_name) const; - // Gets a copy of the dataspace for this attribute. - virtual DataSpace getSpace() const; + // Gets a copy of the dataspace for this attribute. + virtual DataSpace getSpace() const; - // Returns the amount of storage size required for this attribute. - virtual hsize_t getStorageSize() const; + // Returns the amount of storage size required for this attribute. + virtual hsize_t getStorageSize() const; - // Returns the in memory size of this attribute's data. - virtual size_t getInMemDataSize() const; + // Returns the in memory size of this attribute's data. + virtual size_t getInMemDataSize() const; - // Reads data from this attribute. - void read( const DataType& mem_type, void *buf ) const; - void read( const DataType& mem_type, H5std_string& strg ) const; + // Reads data from this attribute. + void read(const DataType& mem_type, void *buf) const; + void read(const DataType& mem_type, H5std_string& strg) const; - // Writes data to this attribute. - void write(const DataType& mem_type, const void *buf ) const; - void write(const DataType& mem_type, const H5std_string& strg ) const; + // Writes data to this attribute. + void write(const DataType& mem_type, const void *buf) const; + void write(const DataType& mem_type, const H5std_string& strg) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("Attribute"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("Attribute"); } - // Gets the attribute id. - virtual hid_t getId() const; + // Gets the attribute id. + virtual hid_t getId() const; - // Destructor: properly terminates access to this attribute. - virtual ~Attribute(); + // Destructor: properly terminates access to this attribute. + virtual ~Attribute(); #ifndef DOXYGEN_SHOULD_SKIP_THIS protected: - // Sets the attribute id. - virtual void p_setId(const hid_t new_id); + // Sets the attribute id. + virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 attribute id + hid_t id; // HDF5 attribute id - // This function contains the common code that is used by - // getTypeClass and various API functions getXxxType - // defined in AbstractDs for generic datatype and specific - // sub-types - virtual hid_t p_get_type() const; + // This function contains the common code that is used by + // getTypeClass and various API functions getXxxType + // defined in AbstractDs for generic datatype and specific + // sub-types + virtual hid_t p_get_type() const; - // Reads variable or fixed len strings from this attribute. - void p_read_variable_len(const DataType& mem_type, H5std_string& strg) const; - void p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const; + // Reads variable or fixed len strings from this attribute. + void p_read_variable_len(const DataType& mem_type, H5std_string& strg) const; + void p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const; - // Friend function to set Attribute id. For library use only. - friend void f_Attribute_setId(Attribute* attr, hid_t new_id); + // Friend function to set Attribute id. For library use only. + friend void f_Attribute_setId(Attribute* attr, hid_t new_id); }; } diff --git a/c++/src/H5Classes.h b/c++/src/H5Classes.h index 03faa1a..00066fe 100644 --- a/c++/src/H5Classes.h +++ b/c++/src/H5Classes.h @@ -18,31 +18,31 @@ #define __H5Classes_H namespace H5 { - class Exception; - class IdComponent; - class H5Location; - class H5Object; - class PropList; - class FileCreatPropList; - class FileAccPropList; - class LinkAccPropList; - class DSetCreatPropList; - class DSetMemXferPropList; - class DTypePropList; - class DataType; - class DataSpace; - class AtomType; - class PredType; - class EnumType; - class IntType; - class FloatType; - class StrType; - class CompType; - class AbstractDs; - class DataSet; - class Group; - class H5File; - class Attribute; - class H5Library; + class Exception; + class IdComponent; + class H5Location; + class H5Object; + class PropList; + class FileCreatPropList; + class FileAccPropList; + class LinkAccPropList; + class DSetCreatPropList; + class DSetMemXferPropList; + class DTypePropList; + class DataType; + class DataSpace; + class AtomType; + class PredType; + class EnumType; + class IntType; + class FloatType; + class StrType; + class CompType; + class AbstractDs; + class DataSet; + class Group; + class H5File; + class Attribute; + class H5Library; } #endif // __H5Classes_H diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 5f7971f..5c01055 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -16,7 +16,7 @@ #include #include "H5Include.h" -#include "H5private.h" // for HDstrcpy +#include "H5private.h" // for HDstrcpy #include "H5Exception.h" #include "H5IdComponent.h" #include "H5DataSpace.h" @@ -46,293 +46,292 @@ // December 2000 namespace H5 { -using namespace std; //-------------------------------------------------------------------------- -// Function: CommonFG::openDataType -///\brief Opens the named generic datatype at this location. -///\param name - IN: Name of the datatype to open -///\return DataType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openDataType +///\brief Opens the named generic datatype at this location. +///\param name - IN: Name of the datatype to open +///\return DataType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType CommonFG::openDataType( const char* name ) const +DataType CommonFG::openDataType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openDataType", "H5Topen2 failed"); + // If the datatype's opening failed, throw an exception + if (type_id < 0) + throwException("openDataType", "H5Topen2 failed"); - // No failure, create and return the DataType object - DataType data_type(type_id); - return(data_type); + // No failure, create and return the DataType object + DataType data_type(type_id); + return(data_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openDataType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openDataType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType CommonFG::openDataType( const H5std_string& name ) const +DataType CommonFG::openDataType(const H5std_string& name) const { - return( openDataType( name.c_str()) ); + return(openDataType(name.c_str())); } //-------------------------------------------------------------------------- -// Function: CommonFG::openArrayType -///\brief Opens the named array datatype at this location. -///\param name - IN: Name of the array datatype to open -///\return ArrayType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CommonFG::openArrayType +///\brief Opens the named array datatype at this location. +///\param name - IN: Name of the array datatype to open +///\return ArrayType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -ArrayType CommonFG::openArrayType( const char* name ) const +ArrayType CommonFG::openArrayType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openArrayType", "H5Topen2 failed"); - - // No failure, create and return the ArrayType object - ArrayType array_type; - f_DataType_setId(&array_type, type_id); - return(array_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if (type_id < 0) + throwException("openArrayType", "H5Topen2 failed"); + + // No failure, create and return the ArrayType object + ArrayType array_type; + f_DataType_setId(&array_type, type_id); + return(array_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openArrayType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CommonFG::openArrayType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -ArrayType CommonFG::openArrayType( const H5std_string& name ) const +ArrayType CommonFG::openArrayType(const H5std_string& name) const { - return( openArrayType( name.c_str()) ); + return(openArrayType(name.c_str())); } //-------------------------------------------------------------------------- -// Function: CommonFG::openCompType -///\brief Opens the named compound datatype at this location. -///\param name - IN: Name of the compound datatype to open -///\return CompType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openCompType +///\brief Opens the named compound datatype at this location. +///\param name - IN: Name of the compound datatype to open +///\return CompType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType CommonFG::openCompType( const char* name ) const +CompType CommonFG::openCompType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openCompType", "H5Topen2 failed"); - - // No failure, create and return the CompType object - CompType comp_type; - f_DataType_setId(&comp_type, type_id); - return(comp_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if (type_id < 0) + throwException("openCompType", "H5Topen2 failed"); + + // No failure, create and return the CompType object + CompType comp_type; + f_DataType_setId(&comp_type, type_id); + return(comp_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openCompType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openCompType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType CommonFG::openCompType( const H5std_string& name ) const +CompType CommonFG::openCompType(const H5std_string& name) const { - return( openCompType( name.c_str()) ); + return(openCompType(name.c_str())); } //-------------------------------------------------------------------------- -// Function: CommonFG::openEnumType -///\brief Opens the named enumeration datatype at this location. -///\param name - IN: Name of the enumeration datatype to open -///\return EnumType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openEnumType +///\brief Opens the named enumeration datatype at this location. +///\param name - IN: Name of the enumeration datatype to open +///\return EnumType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType CommonFG::openEnumType( const char* name ) const +EnumType CommonFG::openEnumType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openEnumType", "H5Topen2 failed"); - - // No failure, create and return the EnumType object - EnumType enum_type; - f_DataType_setId(&enum_type, type_id); - return(enum_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if (type_id < 0) + throwException("openEnumType", "H5Topen2 failed"); + + // No failure, create and return the EnumType object + EnumType enum_type; + f_DataType_setId(&enum_type, type_id); + return(enum_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openEnumType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openEnumType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType CommonFG::openEnumType( const H5std_string& name ) const +EnumType CommonFG::openEnumType(const H5std_string& name) const { - return( openEnumType( name.c_str()) ); + return(openEnumType(name.c_str())); } //-------------------------------------------------------------------------- -// Function: CommonFG::openIntType -///\brief Opens the named integer datatype at this location. -///\param name - IN: Name of the integer datatype to open -///\return IntType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openIntType +///\brief Opens the named integer datatype at this location. +///\param name - IN: Name of the integer datatype to open +///\return IntType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType CommonFG::openIntType( const char* name ) const +IntType CommonFG::openIntType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openIntType", "H5Topen2 failed"); - - // No failure, create and return the IntType object - IntType int_type; - f_DataType_setId(&int_type, type_id); - return(int_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if (type_id < 0) + throwException("openIntType", "H5Topen2 failed"); + + // No failure, create and return the IntType object + IntType int_type; + f_DataType_setId(&int_type, type_id); + return(int_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openIntType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openIntType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType CommonFG::openIntType( const H5std_string& name ) const +IntType CommonFG::openIntType(const H5std_string& name) const { - return( openIntType( name.c_str()) ); + return(openIntType(name.c_str())); } //-------------------------------------------------------------------------- -// Function: CommonFG::openFloatType -///\brief Opens the named floating-point datatype at this location. -///\param name - IN: Name of the floating-point datatype to open -///\return FloatType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openFloatType +///\brief Opens the named floating-point datatype at this location. +///\param name - IN: Name of the floating-point datatype to open +///\return FloatType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType CommonFG::openFloatType( const char* name ) const +FloatType CommonFG::openFloatType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openFloatType", "H5Topen2 failed"); - - // No failure, create and return the FloatType object - FloatType float_type; - f_DataType_setId(&float_type, type_id); - return(float_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if (type_id < 0) + throwException("openFloatType", "H5Topen2 failed"); + + // No failure, create and return the FloatType object + FloatType float_type; + f_DataType_setId(&float_type, type_id); + return(float_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openFloatType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openFloatType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType CommonFG::openFloatType( const H5std_string& name ) const +FloatType CommonFG::openFloatType(const H5std_string& name) const { - return( openFloatType( name.c_str()) ); + return(openFloatType(name.c_str())); } //-------------------------------------------------------------------------- -// Function: CommonFG::openStrType -///\brief Opens the named string datatype at this location. -///\param name - IN: Name of the string datatype to open -///\return StrType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openStrType +///\brief Opens the named string datatype at this location. +///\param name - IN: Name of the string datatype to open +///\return StrType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType CommonFG::openStrType( const char* name ) const +StrType CommonFG::openStrType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openStrType", "H5Topen2 failed"); - - // No failure, create and return the StrType object - StrType str_type; - f_DataType_setId(&str_type, type_id); - return(str_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if (type_id < 0) + throwException("openStrType", "H5Topen2 failed"); + + // No failure, create and return the StrType object + StrType str_type; + f_DataType_setId(&str_type, type_id); + return(str_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openStrType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openStrType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType CommonFG::openStrType( const H5std_string& name ) const +StrType CommonFG::openStrType(const H5std_string& name) const { - return( openStrType( name.c_str()) ); + return(openStrType(name.c_str())); } //-------------------------------------------------------------------------- -// Function: CommonFG::openVarLenType -///\brief Opens the named variable length datatype at this location. -///\param name - IN: Name of the variable length datatype to open -///\return VarLenType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CommonFG::openVarLenType +///\brief Opens the named variable length datatype at this location. +///\param name - IN: Name of the variable length datatype to open +///\return VarLenType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -VarLenType CommonFG::openVarLenType( const char* name ) const +VarLenType CommonFG::openVarLenType(const char* name) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - throwException("openVarLenType", "H5Topen2 failed"); - - // No failure, create and return the VarLenType object - VarLenType varlen_type; - f_DataType_setId(&varlen_type, type_id); - return(varlen_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if (type_id < 0) + throwException("openVarLenType", "H5Topen2 failed"); + + // No failure, create and return the VarLenType object + VarLenType varlen_type; + f_DataType_setId(&varlen_type, type_id); + return(varlen_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openVarLenType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CommonFG::openVarLenType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -VarLenType CommonFG::openVarLenType( const H5std_string& name ) const +VarLenType CommonFG::openVarLenType(const H5std_string& name) const { - return( openVarLenType( name.c_str()) ); + return(openVarLenType(name.c_str())); } #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 59f425c..588d49a 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -32,55 +32,55 @@ class VarLenType; */ class H5_DLLCPP CommonFG { public: - // Opens a generic named datatype in this location. - DataType openDataType(const char* name) const; - DataType openDataType(const H5std_string& name) const; + // Opens a generic named datatype in this location. + DataType openDataType(const char* name) const; + DataType openDataType(const H5std_string& name) const; - // Opens a named array datatype in this location. - ArrayType openArrayType(const char* name) const; - ArrayType openArrayType(const H5std_string& name) const; + // Opens a named array datatype in this location. + ArrayType openArrayType(const char* name) const; + ArrayType openArrayType(const H5std_string& name) const; - // Opens a named compound datatype in this location. - CompType openCompType(const char* name) const; - CompType openCompType(const H5std_string& name) const; + // Opens a named compound datatype in this location. + CompType openCompType(const char* name) const; + CompType openCompType(const H5std_string& name) const; - // Opens a named enumeration datatype in this location. - EnumType openEnumType(const char* name) const; - EnumType openEnumType(const H5std_string& name) const; + // Opens a named enumeration datatype in this location. + EnumType openEnumType(const char* name) const; + EnumType openEnumType(const H5std_string& name) const; - // Opens a named integer datatype in this location. - IntType openIntType(const char* name) const; - IntType openIntType(const H5std_string& name) const; + // Opens a named integer datatype in this location. + IntType openIntType(const char* name) const; + IntType openIntType(const H5std_string& name) const; - // Opens a named floating-point datatype in this location. - FloatType openFloatType(const char* name) const; - FloatType openFloatType(const H5std_string& name) const; + // Opens a named floating-point datatype in this location. + FloatType openFloatType(const char* name) const; + FloatType openFloatType(const H5std_string& name) const; - // Opens a named string datatype in this location. - StrType openStrType(const char* name) const; - StrType openStrType(const H5std_string& name) const; + // Opens a named string datatype in this location. + StrType openStrType(const char* name) const; + StrType openStrType(const H5std_string& name) const; - // Opens a named variable length datatype in this location. - VarLenType openVarLenType(const char* name) const; - VarLenType openVarLenType(const H5std_string& name) const; + // Opens a named variable length datatype in this location. + VarLenType openVarLenType(const char* name) const; + VarLenType openVarLenType(const H5std_string& name) const; #ifndef DOXYGEN_SHOULD_SKIP_THIS - /// For subclasses, H5File and Group, to return the correct - /// object id, i.e. file or group id. - virtual hid_t getLocId() const = 0; + /// For subclasses, H5File and Group, to return the correct + /// object id, i.e. file or group id. + virtual hid_t getLocId() const = 0; - /// For subclasses, H5File and Group, to throw appropriate exception. - virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const = 0; + /// For subclasses, H5File and Group, to throw appropriate exception. + virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const = 0; - // Default constructor. - CommonFG(); + // Default constructor. + CommonFG(); - // Noop destructor. - virtual ~CommonFG(); + // Noop destructor. + virtual ~CommonFG(); protected: - virtual void p_setId(const hid_t new_id) = 0; + virtual void p_setId(const hid_t new_id) = 0; #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index babda34..037527f 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -33,203 +33,203 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: CompType default constructor -///\brief Default constructor: Creates a stub compound datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType default constructor +///\brief Default constructor: Creates a stub compound datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType::CompType() : DataType() {} //-------------------------------------------------------------------------- -// Function: CompType copy constructor -///\brief Copy constructor: makes copy of the original CompType object -///\param original - IN: Original CompType instance -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType copy constructor +///\brief Copy constructor: makes copy of the original CompType object +///\param original - IN: Original CompType instance +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType::CompType( const CompType& original ) : DataType( original ) {} +CompType::CompType(const CompType& original) : DataType(original) {} //-------------------------------------------------------------------------- -// Function: CompType overloaded constructor -///\brief Creates a CompType object using the id of an existing datatype. -///\param existing_id - IN: Id of an existing compound datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType overloaded constructor +///\brief Creates a CompType object using the id of an existing datatype. +///\param existing_id - IN: Id of an existing compound datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType::CompType( const hid_t existing_id ) : DataType( existing_id ) {} +CompType::CompType(const hid_t existing_id) : DataType(existing_id) {} //-------------------------------------------------------------------------- -// Function: CompType overloaded constructor -///\brief Creates an empty compound datatype given a size, in bytes. -///\param size - IN: Number of bytes in the datatype to create -///\exception H5::DataTypeIException +// Function: CompType overloaded constructor +///\brief Creates an empty compound datatype given a size, in bytes. +///\param size - IN: Number of bytes in the datatype to create +///\exception H5::DataTypeIException // Description -// The DataType constructor calls the C API H5Tcreate to create -// the compound datatype. -// Programmer Binh-Minh Ribler - 2000 +// The DataType constructor calls the C API H5Tcreate to create +// the compound datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType::CompType( size_t size ) : DataType( H5T_COMPOUND, size ) {} +CompType::CompType(size_t size) : DataType(H5T_COMPOUND, size) {} //-------------------------------------------------------------------------- -// Function: CompType overloaded constructor -///\brief Gets the compound datatype of the specified dataset. -///\param dataset - IN: Dataset that this enum datatype associates with -///\return CompType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType overloaded constructor +///\brief Gets the compound datatype of the specified dataset. +///\param dataset - IN: Dataset that this enum datatype associates with +///\return CompType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType::CompType( const DataSet& dataset ) : DataType() +CompType::CompType(const DataSet& dataset) : DataType() { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type( dataset.getId() ); - - // If the datatype id is invalid, throw exception - if( id < 0 ) - { - throw DataSetIException("CompType constructor", "H5Dget_type failed"); - } + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type(dataset.getId()); + + // If the datatype id is invalid, throw exception + if (id < 0) + { + throw DataSetIException("CompType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: CompType overloaded constructor -///\brief Creates an CompType instance by opening an HDF5 compound -/// given its name, provided as a C character string. -///\param dtype_name - IN: Compound type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: CompType overloaded constructor +///\brief Creates an CompType instance by opening an HDF5 compound +/// given its name, provided as a C character string. +///\param dtype_name - IN: Compound type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openCompType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openCompType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- CompType::CompType(const H5Location& loc, const char *dtype_name) : DataType() { - id = p_opentype(loc, dtype_name); + id = p_opentype(loc, dtype_name); } //-------------------------------------------------------------------------- -// Function: CompType overloaded constructor -///\brief Creates an CompType instance by opening an HDF5 compound -/// datatype given its name, provided as an \c H5std_string. -///\param dtype_name - IN: Compound type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: CompType overloaded constructor +///\brief Creates an CompType instance by opening an HDF5 compound +/// datatype given its name, provided as an \c H5std_string. +///\param dtype_name - IN: Compound type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openCompType(const H5Location&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openCompType(const H5Location&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- CompType::CompType(const H5Location& loc, const H5std_string& dtype_name) : DataType() { - id = p_opentype(loc, dtype_name.c_str()); + id = p_opentype(loc, dtype_name.c_str()); } //-------------------------------------------------------------------------- -// Function: CompType::getNmembers -///\brief Returns the number of members in this compound datatype. -///\return Number of members -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getNmembers +///\brief Returns the number of members in this compound datatype. +///\return Number of members +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int CompType::getNmembers() const { - int num_members = H5Tget_nmembers( id ); - if( num_members < 0 ) - { - throw DataTypeIException("CompType::getNmembers", - "H5Tget_nmembers returns negative number of members"); - } - return( num_members ); + int num_members = H5Tget_nmembers(id); + if (num_members < 0) + { + throw DataTypeIException("CompType::getNmembers", + "H5Tget_nmembers returns negative number of members"); + } + return(num_members); } //-------------------------------------------------------------------------- -// Function: CompType::getMemberName -///\brief Returns the name of a member in this compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return Name of member -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberName +///\brief Returns the name of a member in this compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return Name of member +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string CompType::getMemberName( unsigned member_num ) const +H5std_string CompType::getMemberName(unsigned member_num) const { - char* member_name_C = H5Tget_member_name( id, member_num ); - if( member_name_C == NULL ) // NULL means failure + char* member_name_C = H5Tget_member_name(id, member_num); + if (member_name_C == NULL) // NULL means failure { - throw DataTypeIException("CompType::getMemberName", - "H5Tget_member_name returns NULL for member name"); + throw DataTypeIException("CompType::getMemberName", + "H5Tget_member_name returns NULL for member name"); } H5std_string member_name = H5std_string(member_name_C); // convert C string to string H5free_memory(member_name_C); // free the C string - return( member_name ); // return the member name string + return(member_name); // return the member name string } //-------------------------------------------------------------------------- -// Function: CompType::getMemberIndex -///\brief Returns the index of a member in this compound datatype. -///\param name - IN: Name of the member -///\return Index of member -///\exception H5::DataTypeIException +// Function: CompType::getMemberIndex +///\brief Returns the index of a member in this compound datatype. +///\param name - IN: Name of the member +///\return Index of member +///\exception H5::DataTypeIException ///\par Description -/// Members are stored in no particular order with numbers 0 -/// through N-1, where N is the value returned by the member -/// function \c CompType::getNmembers. -// Programmer Binh-Minh Ribler - May 16, 2002 +/// Members are stored in no particular order with numbers 0 +/// through N-1, where N is the value returned by the member +/// function \c CompType::getNmembers. +// Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- int CompType::getMemberIndex(const char* name) const { - int member_index = H5Tget_member_index(id, name); - if( member_index < 0 ) - { - throw DataTypeIException("CompType::getMemberIndex", - "H5Tget_member_index returns negative value"); - } - return( member_index ); + int member_index = H5Tget_member_index(id, name); + if (member_index < 0) + { + throw DataTypeIException("CompType::getMemberIndex", + "H5Tget_member_index returns negative value"); + } + return(member_index); } int CompType::getMemberIndex(const H5std_string& name) const { - return(getMemberIndex(name.c_str())); + return(getMemberIndex(name.c_str())); } //-------------------------------------------------------------------------- -// Function: CompType::getMemberOffset -///\brief Returns the byte offset of the beginning of a member with -/// respect to the beginning of the compound data type datum. -///\param member_num - IN: Zero-based index of the member -///\return Byte offset -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberOffset +///\brief Returns the byte offset of the beginning of a member with +/// respect to the beginning of the compound data type datum. +///\param member_num - IN: Zero-based index of the member +///\return Byte offset +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 // Description -/// Members are stored in no particular order with numbers 0 -/// through N-1, where N is the value returned by the member -/// function \c CompType::getNmembers. +/// Members are stored in no particular order with numbers 0 +/// through N-1, where N is the value returned by the member +/// function \c CompType::getNmembers. // -// Note that byte offset being returned as 0 doesn't indicate -// a failure. (According to Quincey) +// Note that byte offset being returned as 0 doesn't indicate +// a failure. (According to Quincey) //-------------------------------------------------------------------------- -size_t CompType::getMemberOffset( unsigned member_num ) const +size_t CompType::getMemberOffset(unsigned member_num) const { - size_t offset = H5Tget_member_offset( id, member_num ); - return( offset ); + size_t offset = H5Tget_member_offset(id, member_num); + return(offset); } //-------------------------------------------------------------------------- -// Function: CompType::getMemberClass -///\brief Gets the type class of the specified member. -///\param member_num - IN: Zero-based index of the member -///\return Type class of the member -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberClass +///\brief Gets the type class of the specified member. +///\param member_num - IN: Zero-based index of the member +///\return Type class of the member +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to use H5Tget_member_class instead. - Jul, 2005 +// Modified to use H5Tget_member_class instead. - Jul, 2005 //-------------------------------------------------------------------------- -H5T_class_t CompType::getMemberClass( unsigned member_num ) const +H5T_class_t CompType::getMemberClass(unsigned member_num) const { - H5T_class_t member_class = H5Tget_member_class(id, member_num); - if( member_class == H5T_NO_CLASS ) - { - throw DataTypeIException("CompType::getMemberClass", - "H5Tget_member_class returns H5T_NO_CLASS"); - } - return(member_class); + H5T_class_t member_class = H5Tget_member_class(id, member_num); + if (member_class == H5T_NO_CLASS) + { + throw DataTypeIException("CompType::getMemberClass", + "H5Tget_member_class returns H5T_NO_CLASS"); + } + return(member_class); } // This private member function calls the C API to get the identifier @@ -238,184 +238,184 @@ H5T_class_t CompType::getMemberClass( unsigned member_num ) const // the sub-types. hid_t CompType::p_get_member_type(unsigned member_num) const { - // get the id of the specified member first - hid_t member_type_id = H5Tget_member_type( id, member_num ); - if( member_type_id > 0 ) - return( member_type_id ); - else - { - // p_get_member_type is private, caller will catch this exception - // then throw another with appropriate API name - throw DataTypeIException("", "H5Tget_member_type failed"); - } + // get the id of the specified member first + hid_t member_type_id = H5Tget_member_type(id, member_num); + if (member_type_id > 0) + return(member_type_id); + else + { + // p_get_member_type is private, caller will catch this exception + // then throw another with appropriate API name + throw DataTypeIException("", "H5Tget_member_type failed"); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberDataType -///\brief Returns the generic datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return DataType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberDataType +///\brief Returns the generic datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return DataType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType CompType::getMemberDataType( unsigned member_num ) const +DataType CompType::getMemberDataType(unsigned member_num) const { - try { - DataType datatype; - f_DataType_setId(&datatype, p_get_member_type(member_num)); - return(datatype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberDataType", E.getDetailMsg()); - } + try { + DataType datatype; + f_DataType_setId(&datatype, p_get_member_type(member_num)); + return(datatype); + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberDataType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberArrayType -///\brief Returns the array datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return ArrayType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CompType::getMemberArrayType +///\brief Returns the array datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return ArrayType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -ArrayType CompType::getMemberArrayType( unsigned member_num ) const +ArrayType CompType::getMemberArrayType(unsigned member_num) const { - try { - ArrayType arraytype(p_get_member_type(member_num)); - f_DataType_setId(&arraytype, p_get_member_type(member_num)); - return(arraytype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberArrayType", E.getDetailMsg()); - } + try { + ArrayType arraytype(p_get_member_type(member_num)); + f_DataType_setId(&arraytype, p_get_member_type(member_num)); + return(arraytype); + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberArrayType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberCompType -///\brief Returns the compound datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return CompType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberCompType +///\brief Returns the compound datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return CompType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType CompType::getMemberCompType( unsigned member_num ) const +CompType CompType::getMemberCompType(unsigned member_num) const { try { CompType comptype(p_get_member_type(member_num)); - f_DataType_setId(&comptype, p_get_member_type(member_num)); + f_DataType_setId(&comptype, p_get_member_type(member_num)); return(comptype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberCompType", E.getDetailMsg()); - } + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberCompType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberEnumType -///\brief Returns the enumeration datatype of the specified member in -/// this compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return EnumType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberEnumType +///\brief Returns the enumeration datatype of the specified member in +/// this compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return EnumType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType CompType::getMemberEnumType( unsigned member_num ) const +EnumType CompType::getMemberEnumType(unsigned member_num) const { try { EnumType enumtype(p_get_member_type(member_num)); - f_DataType_setId(&enumtype, p_get_member_type(member_num)); + f_DataType_setId(&enumtype, p_get_member_type(member_num)); return(enumtype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberEnumType", E.getDetailMsg()); - } + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberEnumType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberIntType -///\brief Returns the integer datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return IntType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberIntType +///\brief Returns the integer datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return IntType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType CompType::getMemberIntType( unsigned member_num ) const +IntType CompType::getMemberIntType(unsigned member_num) const { try { IntType inttype(p_get_member_type(member_num)); - f_DataType_setId(&inttype, p_get_member_type(member_num)); + f_DataType_setId(&inttype, p_get_member_type(member_num)); return(inttype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberIntType", E.getDetailMsg()); - } + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberIntType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberFloatType -///\brief Returns the floating-point datatype of the specified member -/// in this compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return FloatType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberFloatType +///\brief Returns the floating-point datatype of the specified member +/// in this compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return FloatType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType CompType::getMemberFloatType( unsigned member_num ) const +FloatType CompType::getMemberFloatType(unsigned member_num) const { try { FloatType floatype(p_get_member_type(member_num)); - f_DataType_setId(&floatype, p_get_member_type(member_num)); + f_DataType_setId(&floatype, p_get_member_type(member_num)); return(floatype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberFloatType", E.getDetailMsg()); - } + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberFloatType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberStrType -///\brief Returns the string datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return StrType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberStrType +///\brief Returns the string datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return StrType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType CompType::getMemberStrType( unsigned member_num ) const +StrType CompType::getMemberStrType(unsigned member_num) const { try { StrType strtype(p_get_member_type(member_num)); - f_DataType_setId(&strtype, p_get_member_type(member_num)); + f_DataType_setId(&strtype, p_get_member_type(member_num)); return(strtype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg()); - } + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberVarLenType -///\brief Returns the variable length datatype of the specified member -/// in this compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return VarLenType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CompType::getMemberVarLenType +///\brief Returns the variable length datatype of the specified member +/// in this compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return VarLenType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -VarLenType CompType::getMemberVarLenType( unsigned member_num ) const +VarLenType CompType::getMemberVarLenType(unsigned member_num) const { try { VarLenType varlentype(p_get_member_type(member_num)); - f_DataType_setId(&varlentype, p_get_member_type(member_num)); + f_DataType_setId(&varlentype, p_get_member_type(member_num)); return(varlentype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberVarLenType", E.getDetailMsg()); - } + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberVarLenType", E.getDetailMsg()); + } } /* old style of getMemberType - using overloads; new style above @@ -424,27 +424,27 @@ VarLenType CompType::getMemberVarLenType( unsigned member_num ) const May, 2004: These should be reconsidered to provide more convenience. // Returns the datatype of the specified member in this compound datatype. // Several overloading of getMemberType are for different datatypes -void CompType::getMemberType( unsigned member_num, EnumType& enumtype ) const +void CompType::getMemberType(unsigned member_num, EnumType& enumtype) const { p_get_member_type(member_num, enumtype); } -void CompType::getMemberType( unsigned member_num, CompType& comptype ) const +void CompType::getMemberType(unsigned member_num, CompType& comptype) const { p_get_member_type(member_num, comptype); } -void CompType::getMemberType( unsigned member_num, IntType& inttype ) const +void CompType::getMemberType(unsigned member_num, IntType& inttype) const { p_get_member_type(member_num, inttype); } -void CompType::getMemberType( unsigned member_num, FloatType& floatype ) const +void CompType::getMemberType(unsigned member_num, FloatType& floatype) const { p_get_member_type(member_num, floatype); } -void CompType::getMemberType( unsigned member_num, StrType& strtype ) const +void CompType::getMemberType(unsigned member_num, StrType& strtype) const { p_get_member_type(member_num, strtype); } @@ -452,55 +452,55 @@ void CompType::getMemberType( unsigned member_num, StrType& strtype ) const */ //-------------------------------------------------------------------------- -// Function: CompType::insertMember -///\brief Inserts a new member to this compound datatype. -///\param name - IN: Name of the new member -///\param offset - IN: Offset in memory structure of the field to insert -///\param new_member - IN: New member to be inserted -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::insertMember +///\brief Inserts a new member to this compound datatype. +///\param name - IN: Name of the new member +///\param offset - IN: Offset in memory structure of the field to insert +///\param new_member - IN: New member to be inserted +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CompType::insertMember( const H5std_string& name, size_t offset, const DataType& new_member ) const +void CompType::insertMember(const H5std_string& name, size_t offset, const DataType& new_member) const { - // Convert string to C-string - const char* name_C; - name_C = name.c_str(); // name_C refers to the contents of name as a C-str - - hid_t new_member_id = new_member.getId(); // get new_member id for C API - - // Call C routine H5Tinsert to add the new member - herr_t ret_value = H5Tinsert( id, name_C, offset, new_member_id ); - if( ret_value < 0 ) - { - throw DataTypeIException("CompType::insertMember", "H5Tinsert failed"); - } + // Convert string to C-string + const char* name_C; + name_C = name.c_str(); // name_C refers to the contents of name as a C-str + + hid_t new_member_id = new_member.getId(); // get new_member id for C API + + // Call C routine H5Tinsert to add the new member + herr_t ret_value = H5Tinsert(id, name_C, offset, new_member_id); + if (ret_value < 0) + { + throw DataTypeIException("CompType::insertMember", "H5Tinsert failed"); + } } //-------------------------------------------------------------------------- -// Function: CompType::pack -///\brief Recursively removes padding from within a compound datatype. +// Function: CompType::pack +///\brief Recursively removes padding from within a compound datatype. /// -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CompType::pack() const { - // Calls C routine H5Tpack to remove padding - herr_t ret_value = H5Tpack( id ); - if( ret_value < 0 ) - { - throw DataTypeIException("CompType::pack", "H5Tpack failed"); - } + // Calls C routine H5Tpack to remove padding + herr_t ret_value = H5Tpack(id); + if (ret_value < 0) + { + throw DataTypeIException("CompType::pack", "H5Tpack failed"); + } } //-------------------------------------------------------------------------- -// Function: CompType::setSize -///\brief Sets the total size for this compound datatype. -///\param size - IN: Size to set -///\exception H5::DataTypeIException +// Function: CompType::setSize +///\brief Sets the total size for this compound datatype. +///\param size - IN: Size to set +///\exception H5::DataTypeIException // Note -// H5Tset_size works on atom datatypes and compound datatypes only -// Programmer Binh-Minh Ribler - 2014 +// H5Tset_size works on atom datatypes and compound datatypes only +// Programmer Binh-Minh Ribler - 2014 //-------------------------------------------------------------------------- void CompType::setSize(size_t size) const { @@ -508,7 +508,7 @@ void CompType::setSize(size_t size) const herr_t ret_value = H5Tset_size(id, size); if (ret_value < 0) { - throw DataTypeIException("CompType::setSize", "H5Tset_size failed"); + throw DataTypeIException("CompType::setSize", "H5Tset_size failed"); } } diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 3337df7..222044d 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -27,94 +27,94 @@ namespace H5 { */ class H5_DLLCPP CompType : public DataType { public: - // Default constructor - CompType(); + // Default constructor + CompType(); - // Creates a compound datatype using an existing id - CompType( const hid_t existing_id ); + // Creates a compound datatype using an existing id + CompType(const hid_t existing_id); - // Creates a new compound datatype, given the type's size - CompType( size_t size ); // H5Tcreate + // Creates a new compound datatype, given the type's size + CompType(size_t size); // H5Tcreate - // Gets the compound datatype of the specified dataset - CompType( const DataSet& dataset ); // H5Dget_type + // Gets the compound datatype of the specified dataset + CompType(const DataSet& dataset); // H5Dget_type - // Copy constructor - makes a copy of original object - CompType( const CompType& original ); + // Copy constructor - makes a copy of original object + CompType(const CompType& original); - // Constructors that open a compound datatype, given a location. - CompType(const H5Location& loc, const char* name); - CompType(const H5Location& loc, const H5std_string& name); + // Constructors that open a compound datatype, given a location. + CompType(const H5Location& loc, const char* name); + CompType(const H5Location& loc, const H5std_string& name); - // Returns the type class of the specified member of this compound - // datatype. It provides to the user a way of knowing what type - // to create another datatype of the same class - H5T_class_t getMemberClass( unsigned member_num ) const; + // Returns the type class of the specified member of this compound + // datatype. It provides to the user a way of knowing what type + // to create another datatype of the same class + H5T_class_t getMemberClass(unsigned member_num) const; - // Returns the index of a member in this compound data type. - int getMemberIndex(const char* name) const; - int getMemberIndex(const H5std_string& name) const; + // Returns the index of a member in this compound data type. + int getMemberIndex(const char* name) const; + int getMemberIndex(const H5std_string& name) const; - // Returns the offset of a member of this compound datatype. - size_t getMemberOffset( unsigned memb_no ) const; + // Returns the offset of a member of this compound datatype. + size_t getMemberOffset(unsigned memb_no) const; - // Returns the name of a member of this compound datatype. - H5std_string getMemberName( unsigned member_num ) const; + // Returns the name of a member of this compound datatype. + H5std_string getMemberName(unsigned member_num) const; - // Returns the generic datatype of the specified member in - // this compound datatype. - DataType getMemberDataType( unsigned member_num ) const; + // Returns the generic datatype of the specified member in + // this compound datatype. + DataType getMemberDataType(unsigned member_num) const; - // Returns the array datatype of the specified member in - // this compound datatype. - ArrayType getMemberArrayType( unsigned member_num ) const; + // Returns the array datatype of the specified member in + // this compound datatype. + ArrayType getMemberArrayType(unsigned member_num) const; - // Returns the compound datatype of the specified member in - // this compound datatype. - CompType getMemberCompType( unsigned member_num ) const; + // Returns the compound datatype of the specified member in + // this compound datatype. + CompType getMemberCompType(unsigned member_num) const; - // Returns the enumeration datatype of the specified member in - // this compound datatype. - EnumType getMemberEnumType( unsigned member_num ) const; + // Returns the enumeration datatype of the specified member in + // this compound datatype. + EnumType getMemberEnumType(unsigned member_num) const; - // Returns the integer datatype of the specified member in - // this compound datatype. - IntType getMemberIntType( unsigned member_num ) const; + // Returns the integer datatype of the specified member in + // this compound datatype. + IntType getMemberIntType(unsigned member_num) const; - // Returns the floating-point datatype of the specified member in - // this compound datatype. - FloatType getMemberFloatType( unsigned member_num ) const; + // Returns the floating-point datatype of the specified member in + // this compound datatype. + FloatType getMemberFloatType(unsigned member_num) const; - // Returns the string datatype of the specified member in - // this compound datatype. - StrType getMemberStrType( unsigned member_num ) const; + // Returns the string datatype of the specified member in + // this compound datatype. + StrType getMemberStrType(unsigned member_num) const; - // Returns the variable length datatype of the specified member in - // this compound datatype. - VarLenType getMemberVarLenType( unsigned member_num ) const; + // Returns the variable length datatype of the specified member in + // this compound datatype. + VarLenType getMemberVarLenType(unsigned member_num) const; - // Returns the number of members in this compound datatype. - int getNmembers() const; + // Returns the number of members in this compound datatype. + int getNmembers() const; - // Adds a new member to this compound datatype. - void insertMember( const H5std_string& name, size_t offset, const DataType& new_member ) const; + // Adds a new member to this compound datatype. + void insertMember(const H5std_string& name, size_t offset, const DataType& new_member) const; - // Recursively removes padding from within this compound datatype. - void pack() const; + // Recursively removes padding from within this compound datatype. + void pack() const; - // Sets the total size for this compound datatype. - void setSize(size_t size) const; + // Sets the total size for this compound datatype. + void setSize(size_t size) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("CompType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("CompType"); } - // Noop destructor. - virtual ~CompType(); + // Noop destructor. + virtual ~CompType(); private: - // Contains common code that is used by the member functions - // getMemberXxxType - hid_t p_get_member_type(unsigned member_num) const; + // Contains common code that is used by the member functions + // getMemberXxxType + hid_t p_get_member_type(unsigned member_num) const; }; } #endif // __H5CompType_H diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index 2420586..afc6ebf 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -67,34 +67,34 @@ *
*/ -/// This example shows how to create datasets. +/// This example shows how to create datasets. ///\par ///\example create.cpp ///\par -/// This example shows how to write datasets. +/// This example shows how to write datasets. ///\example writedata.cpp ///\par -/// This example shows how to read datasets. +/// This example shows how to read datasets. ///\example readdata.cpp ///\par -/// This example shows how to create a compound datatype, -/// write an array which has the compound datatype to the file, -/// and read back fields' subsets. +/// This example shows how to create a compound datatype, +/// write an array which has the compound datatype to the file, +/// and read back fields' subsets. ///\example compound.cpp ///\par -/// This example shows how to work with extendible datasets. +/// This example shows how to work with extendible datasets. ///\example extend_ds.cpp ///\par -/// This example shows how to read data from a chunked dataset. +/// This example shows how to read data from a chunked dataset. ///\example chunks.cpp ///\par -/// This example shows how to work with groups. +/// This example shows how to work with groups. ///\example h5group.cpp #endif // __H5CppDoc_H diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 7c5b994..a0db328 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -20,7 +20,7 @@ #endif #include -#include "H5private.h" // for HDfree +#include "H5private.h" // for HDfree #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -44,23 +44,23 @@ using std::cerr; using std::endl; //-------------------------------------------------------------------------- -// Function: DataSet default constructor -///\brief Default constructor: creates a stub DataSet. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet default constructor +///\brief Default constructor: creates a stub DataSet. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet::DataSet() : H5Object(), AbstractDs(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: DataSet overloaded constructor -///\brief Creates an DataSet object using the id of an existing dataset. -///\param existing_id - IN: Id of an existing dataset -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet overloaded constructor +///\brief Creates an DataSet object using the id of an existing dataset. +///\param existing_id - IN: Id of an existing dataset +// Programmer Binh-Minh Ribler - 2000 // Description -// incRefCount() is needed here to prevent the id from being closed -// prematurely. That is, when application uses the id of an -// existing DataSet object to create another DataSet object. So, -// when one of those objects is deleted, the id will be closed if -// the reference counter is only 1. +// incRefCount() is needed here to prevent the id from being closed +// prematurely. That is, when application uses the id of an +// existing DataSet object to create another DataSet object. So, +// when one of those objects is deleted, the id will be closed if +// the reference counter is only 1. //-------------------------------------------------------------------------- DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs(), id(existing_id) { @@ -68,10 +68,10 @@ DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs(), id(existin } //-------------------------------------------------------------------------- -// Function: DataSet copy constructor -///\brief Copy constructor: makes a copy of the original DataSet object. -///\param original - IN: DataSet instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet copy constructor +///\brief Copy constructor: makes a copy of the original DataSet object. +///\param original - IN: DataSet instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet::DataSet(const DataSet& original) : H5Object(), AbstractDs(), id(original.id) { @@ -79,22 +79,22 @@ DataSet::DataSet(const DataSet& original) : H5Object(), AbstractDs(), id(origina } //-------------------------------------------------------------------------- -// Function: DataSet overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 location, creates a -/// DataSet object -///\param loc - IN: Dataset reference object is in or location of -/// object that the dataset is located within. -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::DataSetIException +// Function: DataSet overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 location, creates a +/// DataSet object +///\param loc - IN: Dataset reference object is in or location of +/// object that the dataset is located within. +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::DataSetIException ///\par Description -/// \c loc can be DataSet, Group, H5File, or named DataType, that -/// is a datatype that has been named by DataType::commit. -// Programmer Binh-Minh Ribler - Oct, 2006 +/// \c loc can be DataSet, Group, H5File, or named DataType, that +/// is a datatype that has been named by DataType::commit. +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// Jul, 2008 -// Added for application convenience. +// Jul, 2008 +// Added for application convenience. //-------------------------------------------------------------------------- DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), AbstractDs(), id(H5I_INVALID_HID) { @@ -102,18 +102,18 @@ DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, co } //-------------------------------------------------------------------------- -// Function: DataSet overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 attribute, creates a -/// DataSet object -///\param attr - IN: Specifying location where the referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// Function: DataSet overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 attribute, creates a +/// DataSet object +///\param attr - IN: Specifying location where the referenced object is in +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// Jul, 2008 -// Added for application convenience. +// Jul, 2008 +// Added for application convenience. //-------------------------------------------------------------------------- DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), AbstractDs(), id(H5I_INVALID_HID) { @@ -121,26 +121,26 @@ DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, co } //-------------------------------------------------------------------------- -// Function: DataSet::getSpace -///\brief Gets a copy of the dataspace of this dataset. -///\return DataSpace instance -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getSpace +///\brief Gets a copy of the dataspace of this dataset. +///\return DataSpace instance +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace DataSet::getSpace() const { - // Calls C function H5Dget_space to get the id of the dataspace - hid_t dataspace_id = H5Dget_space( id ); - - // If the dataspace id is invalid, throw an exception - if( dataspace_id < 0 ) - { - throw DataSetIException("DataSet::getSpace", "H5Dget_space failed"); - } - //create dataspace object using the existing id then return the object - DataSpace data_space; - f_DataSpace_setId(&data_space, dataspace_id); - return( data_space ); + // Calls C function H5Dget_space to get the id of the dataspace + hid_t dataspace_id = H5Dget_space(id); + + // If the dataspace id is invalid, throw an exception + if (dataspace_id < 0) + { + throw DataSetIException("DataSet::getSpace", "H5Dget_space failed"); + } + //create dataspace object using the existing id then return the object + DataSpace data_space; + f_DataSpace_setId(&data_space, dataspace_id); + return(data_space); } // This private member function calls the C API to get the identifier @@ -148,57 +148,57 @@ DataSpace DataSet::getSpace() const // by the various AbstractDs functions to get the specific datatype. hid_t DataSet::p_get_type() const { - hid_t type_id = H5Dget_type( id ); - if( type_id > 0 ) - return( type_id ); - else - { - throw DataSetIException("", "H5Dget_type failed"); - } + hid_t type_id = H5Dget_type(id); + if (type_id > 0) + return(type_id); + else + { + throw DataSetIException("", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::getCreatePlist -///\brief Gets the dataset creation property list. -///\return DSetCreatPropList instance -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getCreatePlist +///\brief Gets the dataset creation property list. +///\return DSetCreatPropList instance +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList DataSet::getCreatePlist() const { - hid_t create_plist_id = H5Dget_create_plist( id ); - if( create_plist_id < 0 ) - { - throw DataSetIException("DataSet::getCreatePlist", "H5Dget_create_plist failed"); - } - - // create and return the DSetCreatPropList object - DSetCreatPropList create_plist; - f_PropList_setId(&create_plist, create_plist_id); - return(create_plist); + hid_t create_plist_id = H5Dget_create_plist(id); + if (create_plist_id < 0) + { + throw DataSetIException("DataSet::getCreatePlist", "H5Dget_create_plist failed"); + } + + // create and return the DSetCreatPropList object + DSetCreatPropList create_plist; + f_PropList_setId(&create_plist, create_plist_id); + return(create_plist); } //-------------------------------------------------------------------------- -// Function: DataSet::getStorageSize -///\brief Returns the amount of storage required for a dataset. -///\return Size of the storage or 0, for no data -///\exception H5::DataSetIException -// Note: H5Dget_storage_size returns 0 when there is no data. This -// function should have no failure. (from SLU) -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: DataSet::getStorageSize +///\brief Returns the amount of storage required for a dataset. +///\return Size of the storage or 0, for no data +///\exception H5::DataSetIException +// Note: H5Dget_storage_size returns 0 when there is no data. This +// function should have no failure. (from SLU) +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- hsize_t DataSet::getStorageSize() const { - hsize_t storage_size = H5Dget_storage_size(id); - return(storage_size); + hsize_t storage_size = H5Dget_storage_size(id); + return(storage_size); } //-------------------------------------------------------------------------- -// Function: DataSet::getInMemDataSize -///\brief Gets the size in memory of the dataset's data. -///\return Size of data (in memory) -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - Apr 2009 +// Function: DataSet::getInMemDataSize +///\brief Gets the size in memory of the dataset's data. +///\return Size of data (in memory) +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - Apr 2009 //-------------------------------------------------------------------------- size_t DataSet::getInMemDataSize() const { @@ -206,9 +206,9 @@ size_t DataSet::getInMemDataSize() const // Get the data type of this dataset hid_t mem_type_id = H5Dget_type(id); - if( mem_type_id < 0 ) + if (mem_type_id < 0) { - throw DataSetIException(func, "H5Dget_type failed"); + throw DataSetIException(func, "H5Dget_type failed"); } // Get the data type's size by first getting its native type then getting @@ -216,22 +216,22 @@ size_t DataSet::getInMemDataSize() const hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT); if (native_type < 0) { - throw DataSetIException(func, "H5Tget_native_type failed"); + throw DataSetIException(func, "H5Tget_native_type failed"); } size_t type_size = H5Tget_size(native_type); if (type_size == 0) { - throw DataSetIException(func, "H5Tget_size failed"); + throw DataSetIException(func, "H5Tget_size failed"); } // Close the native type and the datatype of this dataset. if (H5Tclose(native_type) < 0) { - throw DataSetIException(func, "H5Tclose(native_type) failed"); + throw DataSetIException(func, "H5Tclose(native_type) failed"); } if (H5Tclose(mem_type_id) < 0) { - throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); + throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); } // Get number of elements of the dataset by first getting its dataspace, @@ -239,18 +239,18 @@ size_t DataSet::getInMemDataSize() const hid_t space_id = H5Dget_space(id); if (space_id < 0) { - throw DataSetIException(func, "H5Dget_space failed"); + throw DataSetIException(func, "H5Dget_space failed"); } hssize_t num_elements = H5Sget_simple_extent_npoints(space_id); if (num_elements < 0) { - throw DataSetIException(func, "H5Sget_simple_extent_npoints failed"); + throw DataSetIException(func, "H5Sget_simple_extent_npoints failed"); } // Close the dataspace if (H5Sclose(space_id) < 0) { - throw DataSetIException(func, "H5Sclose failed"); + throw DataSetIException(func, "H5Sclose failed"); } // Calculate and return the size of the data @@ -259,184 +259,184 @@ size_t DataSet::getInMemDataSize() const } //-------------------------------------------------------------------------- -// Function: DataSet::getOffset -///\brief Returns the address of this dataset in the file. -///\return Address of dataset -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getOffset +///\brief Returns the address of this dataset in the file. +///\return Address of dataset +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- haddr_t DataSet::getOffset() const { - haddr_t ds_addr; // for address of dataset - - ds_addr = H5Dget_offset(id); - if( ds_addr == HADDR_UNDEF ) - { - throw DataSetIException("DataSet::getOffset", "H5Dget_offset returned HADDR_UNDEF"); - } - return(ds_addr); + haddr_t ds_addr; // for address of dataset + + ds_addr = H5Dget_offset(id); + if (ds_addr == HADDR_UNDEF) + { + throw DataSetIException("DataSet::getOffset", "H5Dget_offset returned HADDR_UNDEF"); + } + return(ds_addr); } //-------------------------------------------------------------------------- -// Function: DataSet::getSpaceStatus -///\brief Determines whether space has been allocated for a dataset. -///\param status - OUT: Space allocation status -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getSpaceStatus +///\brief Determines whether space has been allocated for a dataset. +///\param status - OUT: Space allocation status +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::getSpaceStatus(H5D_space_status_t& status) const { - herr_t ret_value = H5Dget_space_status(id, &status); - if( ret_value < 0 ) - { - throw DataSetIException("DataSet::getSpaceStatus", "H5Dget_space_status failed"); - } + herr_t ret_value = H5Dget_space_status(id, &status); + if (ret_value < 0) + { + throw DataSetIException("DataSet::getSpaceStatus", "H5Dget_space_status failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::getVlenBufSize -///\brief Returns the number of bytes required to store VL data. -///\param type - IN: Datatype, which is the datatype for the buffer -///\param space - IN: Selection for the memory buffer -///\return Amount of storage -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getVlenBufSize +///\brief Returns the number of bytes required to store VL data. +///\param type - IN: Datatype, which is the datatype for the buffer +///\param space - IN: Selection for the memory buffer +///\return Amount of storage +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space ) const +hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space) const { - // Obtain identifiers for C API - hid_t type_id = type.getId(); - hid_t space_id = space.getId(); - - hsize_t size; // for amount of storage - - herr_t ret_value = H5Dvlen_get_buf_size( id, type_id, space_id, &size ); - if( ret_value < 0 ) - { - throw DataSetIException("DataSet::getVlenBufSize", "H5Dvlen_get_buf_size failed"); - } - return( size ); + // Obtain identifiers for C API + hid_t type_id = type.getId(); + hid_t space_id = space.getId(); + + hsize_t size; // for amount of storage + + herr_t ret_value = H5Dvlen_get_buf_size(id, type_id, space_id, &size); + if (ret_value < 0) + { + throw DataSetIException("DataSet::getVlenBufSize", "H5Dvlen_get_buf_size failed"); + } + return(size); } //-------------------------------------------------------------------------- -// Function: DataSet::getVlenBufSize -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Return Amount of storage -// Exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getVlenBufSize +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Return Amount of storage +// Exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- -//hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const +//hsize_t DataSet::getVlenBufSize(DataType& type, DataSpace& space) const //{ // return(getVlenBufSize(type, space)); //} //-------------------------------------------------------------------------- -// Function: DataSet::vlenReclaim -///\brief Reclaims VL datatype memory buffers. -///\param type - IN: Datatype, which is the datatype stored in the buffer -///\param space - IN: Selection for the memory buffer to free the -/// VL datatypes within -///\param xfer_plist - IN: Property list used to create the buffer -///\param buf - IN: Pointer to the buffer to be reclaimed -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::vlenReclaim +///\brief Reclaims VL datatype memory buffers. +///\param type - IN: Datatype, which is the datatype stored in the buffer +///\param space - IN: Selection for the memory buffer to free the +/// VL datatypes within +///\param xfer_plist - IN: Property list used to create the buffer +///\param buf - IN: Pointer to the buffer to be reclaimed +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf ) +void DataSet::vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf) { - // Obtain identifiers for C API - hid_t type_id = type.getId(); - hid_t space_id = space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); - - herr_t ret_value = H5Dvlen_reclaim( type_id, space_id, xfer_plist_id, buf ); - if( ret_value < 0 ) - { - throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed"); - } + // Obtain identifiers for C API + hid_t type_id = type.getId(); + hid_t space_id = space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); + + herr_t ret_value = H5Dvlen_reclaim(type_id, space_id, xfer_plist_id, buf); + if (ret_value < 0) + { + throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::vlenReclaim -///\brief Reclaims VL datatype memory buffers. -///\param type - IN: Datatype, which is the datatype stored in the buffer -///\param space - IN: Selection for the memory buffer to free the -/// VL datatypes within -///\param xfer_plist - IN: Property list used to create the buffer -///\param buf - IN: Pointer to the buffer to be reclaimed -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::vlenReclaim +///\brief Reclaims VL datatype memory buffers. +///\param type - IN: Datatype, which is the datatype stored in the buffer +///\param space - IN: Selection for the memory buffer to free the +/// VL datatypes within +///\param xfer_plist - IN: Property list used to create the buffer +///\param buf - IN: Pointer to the buffer to be reclaimed +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //\parDescription -// This function has better prototype for the users than the -// other, which might be removed at some point. BMR - 2006/12/20 +// This function has better prototype for the users than the +// other, which might be removed at some point. BMR - 2006/12/20 //-------------------------------------------------------------------------- void DataSet::vlenReclaim(void* buf, const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist) { - // Obtain identifiers for C API - hid_t type_id = type.getId(); - hid_t space_id = space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); - - herr_t ret_value = H5Dvlen_reclaim(type_id, space_id, xfer_plist_id, buf); - if (ret_value < 0) - { - throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed"); - } + // Obtain identifiers for C API + hid_t type_id = type.getId(); + hid_t space_id = space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); + + herr_t ret_value = H5Dvlen_reclaim(type_id, space_id, xfer_plist_id, buf); + if (ret_value < 0) + { + throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::read -///\brief Reads raw data from the specified dataset. -///\param buf - IN: Buffer for read data -///\param mem_type - IN: Memory datatype -///\param mem_space - IN: Memory dataspace -///\param file_space - IN: Dataset's dataspace in the file -///\param xfer_plist - IN: Transfer property list for this I/O operation -///\exception H5::DataSetIException +// Function: DataSet::read +///\brief Reads raw data from the specified dataset. +///\param buf - IN: Buffer for read data +///\param mem_type - IN: Memory datatype +///\param mem_space - IN: Memory dataspace +///\param file_space - IN: Dataset's dataspace in the file +///\param xfer_plist - IN: Transfer property list for this I/O operation +///\exception H5::DataSetIException ///\par Description -/// This function reads raw data from this dataset into the -/// buffer \a buf, converting from file datatype and dataspace -/// to memory datatype \a mem_type and dataspace \a mem_space. -// Programmer Binh-Minh Ribler - 2000 +/// This function reads raw data from this dataset into the +/// buffer \a buf, converting from file datatype and dataspace +/// to memory datatype \a mem_type and dataspace \a mem_space. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const +void DataSet::read(void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const { - // Obtain identifiers for C API - hid_t mem_type_id = mem_type.getId(); - hid_t mem_space_id = mem_space.getId(); - hid_t file_space_id = file_space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); - - herr_t ret_value = H5Dread( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf ); - if( ret_value < 0 ) - { - throw DataSetIException("DataSet::read", "H5Dread failed"); - } + // Obtain identifiers for C API + hid_t mem_type_id = mem_type.getId(); + hid_t mem_space_id = mem_space.getId(); + hid_t file_space_id = file_space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); + + herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf); + if (ret_value < 0) + { + throw DataSetIException("DataSet::read", "H5Dread failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::read -///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c H5std_string for the buffer. -///\param strg - IN: Buffer for read data string -///\param mem_type - IN: Memory datatype -///\param mem_space - IN: Memory dataspace -///\param file_space - IN: Dataset's dataspace in the file -///\param xfer_plist - IN: Transfer property list for this I/O operation -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::read +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the buffer. +///\param strg - IN: Buffer for read data string +///\param mem_type - IN: Memory datatype +///\param mem_space - IN: Memory dataspace +///\param file_space - IN: Dataset's dataspace in the file +///\param xfer_plist - IN: Transfer property list for this I/O operation +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Jul 2009 -// Follow the change to Attribute::read and use the following -// private functions to read datasets with fixed- and -// variable-length string: -// DataSet::p_read_fixed_len and -// DataSet::p_read_variable_len +// Jul 2009 +// Follow the change to Attribute::read and use the following +// private functions to read datasets with fixed- and +// variable-length string: +// DataSet::p_read_fixed_len and +// DataSet::p_read_variable_len //-------------------------------------------------------------------------- void DataSet::read(H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const { @@ -465,47 +465,47 @@ void DataSet::read(H5std_string& strg, const DataType& mem_type, const DataSpace } //-------------------------------------------------------------------------- -// Function: DataSet::write -///\brief Writes raw data from an application buffer to a dataset. -///\param buf - IN: Buffer containing data to be written -///\param mem_type - IN: Memory datatype -///\param mem_space - IN: Memory dataspace -///\param file_space - IN: Dataset's dataspace in the file -///\param xfer_plist - IN: Transfer property list for this I/O operation -///\exception H5::DataSetIException +// Function: DataSet::write +///\brief Writes raw data from an application buffer to a dataset. +///\param buf - IN: Buffer containing data to be written +///\param mem_type - IN: Memory datatype +///\param mem_space - IN: Memory dataspace +///\param file_space - IN: Dataset's dataspace in the file +///\param xfer_plist - IN: Transfer property list for this I/O operation +///\exception H5::DataSetIException ///\par Description -/// This function writes raw data from an application buffer -/// \a buf to a dataset, converting from memory datatype -/// \a mem_type and dataspace \a mem_space to file datatype -/// and dataspace. -// Programmer Binh-Minh Ribler - 2000 +/// This function writes raw data from an application buffer +/// \a buf to a dataset, converting from memory datatype +/// \a mem_type and dataspace \a mem_space to file datatype +/// and dataspace. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const +void DataSet::write(const void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const { - // Obtain identifiers for C API - hid_t mem_type_id = mem_type.getId(); - hid_t mem_space_id = mem_space.getId(); - hid_t file_space_id = file_space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); - - herr_t ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf ); - if( ret_value < 0 ) - { - throw DataSetIException("DataSet::write", "H5Dwrite failed"); - } + // Obtain identifiers for C API + hid_t mem_type_id = mem_type.getId(); + hid_t mem_space_id = mem_space.getId(); + hid_t file_space_id = file_space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); + + herr_t ret_value = H5Dwrite(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf); + if (ret_value < 0) + { + throw DataSetIException("DataSet::write", "H5Dwrite failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::write -///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c H5std_string for the buffer. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::write +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the buffer. +// Programmer Binh-Minh Ribler - 2000 // Modification -// Jul 2009 -// Modified to pass the buffer into H5Dwrite properly depending -// whether the dataset has variable- or fixed-length string. +// Jul 2009 +// Modified to pass the buffer into H5Dwrite properly depending +// whether the dataset has variable- or fixed-length string. //-------------------------------------------------------------------------- -void DataSet::write( const H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const +void DataSet::write(const H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const { // Check if this attribute has variable-len string or fixed-len string and // proceed appropriately. @@ -515,11 +515,11 @@ void DataSet::write( const H5std_string& strg, const DataType& mem_type, const D throw DataSetIException("DataSet::write", "H5Tis_variable_str failed"); } - // Obtain identifiers for C API - hid_t mem_type_id = mem_type.getId(); - hid_t mem_space_id = mem_space.getId(); - hid_t file_space_id = file_space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); + // Obtain identifiers for C API + hid_t mem_type_id = mem_type.getId(); + hid_t mem_space_id = mem_space.getId(); + hid_t file_space_id = file_space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); // Convert string to C-string const char* strg_C; @@ -529,12 +529,12 @@ void DataSet::write( const H5std_string& strg, const DataType& mem_type, const D // Pass string in differently depends on variable or fixed length if (!is_variable_len) { - ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C ); + ret_value = H5Dwrite(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C); } else { // passing string argument by address - ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C ); + ret_value = H5Dwrite(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C); } if (ret_value < 0) { @@ -543,65 +543,65 @@ void DataSet::write( const H5std_string& strg, const DataType& mem_type, const D } //-------------------------------------------------------------------------- -// Function: DataSet::iterateElems -///\brief Iterates over all selected elements in a dataspace. -///\param buf - IN/OUT: Pointer to the buffer in memory containing the -/// elements to iterate over -///\param type - IN: Datatype for the elements stored in \a buf -///\param space - IN: Dataspace for \a buf. Also contains the selection -/// to iterate over. -///\param op - IN: Function pointer to the routine to be called for -/// each element in \a buf iterated over -///\param op_data - IN/OUT: Pointer to any user-defined data associated -/// with the operation -///\exception H5::DataSetIException -///\note This function may not work correctly yet - it's still -/// under development. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data ) +// Function: DataSet::iterateElems +///\brief Iterates over all selected elements in a dataspace. +///\param buf - IN/OUT: Pointer to the buffer in memory containing the +/// elements to iterate over +///\param type - IN: Datatype for the elements stored in \a buf +///\param space - IN: Dataspace for \a buf. Also contains the selection +/// to iterate over. +///\param op - IN: Function pointer to the routine to be called for +/// each element in \a buf iterated over +///\param op_data - IN/OUT: Pointer to any user-defined data associated +/// with the operation +///\exception H5::DataSetIException +///\note This function may not work correctly yet - it's still +/// under development. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +int DataSet::iterateElems(void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data) { - // Obtain identifiers for C API - hid_t type_id = type.getId(); - hid_t space_id = space.getId(); - herr_t ret_value = H5Diterate( buf, type_id, space_id, op, op_data ); - if( ret_value >= 0 ) - return( ret_value ); - else // raise exception when H5Diterate returns a negative value - { - throw DataSetIException("DataSet::iterateElems", "H5Diterate failed"); - } + // Obtain identifiers for C API + hid_t type_id = type.getId(); + hid_t space_id = space.getId(); + herr_t ret_value = H5Diterate(buf, type_id, space_id, op, op_data); + if (ret_value >= 0) + return(ret_value); + else // raise exception when H5Diterate returns a negative value + { + throw DataSetIException("DataSet::iterateElems", "H5Diterate failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::extend -///\brief Extends a dataset with unlimited dimension. -///\param size - IN: Array containing the new magnitude of each dimension -///\exception H5::DataSetIException +// Function: DataSet::extend +///\brief Extends a dataset with unlimited dimension. +///\param size - IN: Array containing the new magnitude of each dimension +///\exception H5::DataSetIException ///\par Description -/// For more information, please see the Description section in -/// C layer Reference Manual at: +/// For more information, please see the Description section in +/// C layer Reference Manual at: ///\par /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Extend -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::extend( const hsize_t* size ) const +void DataSet::extend(const hsize_t* size) const { - herr_t ret_value = H5Dset_extent( id, size ); - if( ret_value < 0 ) // raise exception when H5Dset_extent returns a neg value - throw DataSetIException("DataSet::extend", "H5Dset_extent failed"); + herr_t ret_value = H5Dset_extent(id, size); + if (ret_value < 0) // raise exception when H5Dset_extent returns a neg value + throw DataSetIException("DataSet::extend", "H5Dset_extent failed"); } //-------------------------------------------------------------------------- -// Function: DataSet::fillMemBuf -///\brief Fills a selection in memory with a value. -///\param fill - IN: Pointer to fill value to use - default NULL -///\param fill_type - IN: Datatype of the fill value -///\param buf - IN/OUT: Memory buffer to fill selection within -///\param buf_type - IN: Datatype of the elements in buffer -///\param space - IN: Dataspace describing memory buffer & containing selection to use -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2014 +// Function: DataSet::fillMemBuf +///\brief Fills a selection in memory with a value. +///\param fill - IN: Pointer to fill value to use - default NULL +///\param fill_type - IN: Datatype of the fill value +///\param buf - IN/OUT: Memory buffer to fill selection within +///\param buf_type - IN: Datatype of the elements in buffer +///\param space - IN: Dataspace describing memory buffer & containing selection to use +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2014 // Modification //-------------------------------------------------------------------------- void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const @@ -610,28 +610,28 @@ void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, hid_t buf_type_id = buf_type.getId(); hid_t space_id = space.getId(); herr_t ret_value = H5Dfill(fill, fill_type_id, buf, buf_type_id, space_id); - if( ret_value < 0 ) + if (ret_value < 0) { - throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); + throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); } } //-------------------------------------------------------------------------- -// Function: DataSet::fillMemBuf -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Param fill - IN: Pointer to fill value to use - default NULL -// Param fill_type - IN: Datatype of the fill value -// Param buf - IN/OUT: Memory buffer to fill selection within -// Param buf_type - IN: Datatype of the elements in buffer -// Param space - IN: Dataspace describing memory buffer & containing selection to use -// Exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::fillMemBuf +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Param fill - IN: Pointer to fill value to use - default NULL +// Param fill_type - IN: Datatype of the fill value +// Param buf - IN/OUT: Memory buffer to fill selection within +// Param buf_type - IN: Datatype of the elements in buffer +// Param space - IN: Dataspace describing memory buffer & containing selection to use +// Exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void DataSet::fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space) //{ @@ -639,39 +639,39 @@ void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, //} //-------------------------------------------------------------------------- -// Function: DataSet::fillMemBuf -///\brief Fills a selection in memory with 0. -///\param buf - IN/OUT: Memory buffer to fill selection within -///\param buf_type - IN: Datatype of the elements in buffer -///\param space - IN: Dataspace describing memory buffer & containing selection to use -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::fillMemBuf +///\brief Fills a selection in memory with 0. +///\param buf - IN/OUT: Memory buffer to fill selection within +///\param buf_type - IN: Datatype of the elements in buffer +///\param space - IN: Dataspace describing memory buffer & containing selection to use +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const { hid_t buf_type_id = buf_type.getId(); hid_t space_id = space.getId(); herr_t ret_value = H5Dfill(NULL, buf_type_id, buf, buf_type_id, space_id); - if( ret_value < 0 ) + if (ret_value < 0) { - throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); + throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); } } //-------------------------------------------------------------------------- // Function: DataSet::fillMemBuf -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. // Param buf - IN/OUT: Memory buffer to fill selection within // Param buf_type - IN: Datatype of the elements in buffer // Param space - IN: Dataspace describing memory buffer & containing selection to use -// Exception H5::DataSetIException +// Exception H5::DataSetIException // Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void DataSet::fillMemBuf(void *buf, DataType& buf_type, DataSpace& space) //{ @@ -680,8 +680,8 @@ void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& s //-------------------------------------------------------------------------- // Function: DataSet::getId -///\brief Get the id of this dataset. -///\return DataSet identifier +///\brief Get the id of this dataset. +///\return DataSet identifier // Description: // Class hierarchy is revised to address bugzilla 1068. Class // AbstractDs and Attribute are moved out of H5Object. In @@ -691,19 +691,19 @@ void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& s //-------------------------------------------------------------------------- hid_t DataSet::getId() const { - return(id); + return(id); } //-------------------------------------------------------------------------- -// Function: DataSet::p_read_fixed_len (private) -// brief Reads a fixed length \a H5std_string from a dataset. -// param mem_type - IN: DataSet datatype (in memory) -// param strg - IN: Buffer for read string -// exception H5::DataSetIException -// Programmer Binh-Minh Ribler - Jul, 2009 +// Function: DataSet::p_read_fixed_len (private) +// brief Reads a fixed length \a H5std_string from a dataset. +// param mem_type - IN: DataSet datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::DataSetIException +// Programmer Binh-Minh Ribler - Jul, 2009 // Modification -// Jul 2009 -// Added in follow to the change in Attribute::read +// Jul 2009 +// Added in follow to the change in Attribute::read //-------------------------------------------------------------------------- void DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const { @@ -715,33 +715,33 @@ void DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id // If there is data, allocate buffer and read it. if (data_size > 0) { - char *strg_C = new char [data_size+1]; - HDmemset(strg_C, 0, data_size+1); // clear buffer + char *strg_C = new char [data_size+1]; + HDmemset(strg_C, 0, data_size+1); // clear buffer - herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C); + herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C); - if( ret_value < 0 ) - { - delete []strg_C; // de-allocate for fixed-len string - throw DataSetIException("DataSet::read", "H5Dread failed for fixed length string"); - } + if (ret_value < 0) + { + delete []strg_C; // de-allocate for fixed-len string + throw DataSetIException("DataSet::read", "H5Dread failed for fixed length string"); + } - // Get string from the C char* and release resource allocated locally - strg = strg_C; - delete []strg_C; + // Get string from the C char* and release resource allocated locally + strg = strg_C; + delete []strg_C; } } //-------------------------------------------------------------------------- -// Function: DataSet::p_read_variable_len (private) -// brief Reads a variable length \a H5std_string from an dataset. -// param mem_type - IN: DataSet datatype (in memory) -// param strg - IN: Buffer for read string -// exception H5::DataSetIException -// Programmer Binh-Minh Ribler - Jul, 2009 +// Function: DataSet::p_read_variable_len (private) +// brief Reads a variable length \a H5std_string from an dataset. +// param mem_type - IN: DataSet datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::DataSetIException +// Programmer Binh-Minh Ribler - Jul, 2009 // Modification -// Jul 2009 -// Added in follow to the change in Attribute::read +// Jul 2009 +// Added in follow to the change in Attribute::read //-------------------------------------------------------------------------- void DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const { @@ -751,9 +751,9 @@ void DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space // Read dataset, no allocation for variable-len string; C library will herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C); - if( ret_value < 0 ) + if (ret_value < 0) { - throw DataSetIException("DataSet::read", "H5Dread failed for variable length string"); + throw DataSetIException("DataSet::read", "H5Dread failed for variable length string"); } // Get string from the C char* and release resource allocated by C API @@ -805,43 +805,43 @@ void f_PropList_setId(PropList* plist, hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataSet::close -///\brief Closes this dataset. +// Function: DataSet::close +///\brief Closes this dataset. /// -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void DataSet::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Dclose( id ); - if( ret_value < 0 ) - { - throw DataSetIException("DataSet::close", "H5Dclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Dclose(id); + if (ret_value < 0) + { + throw DataSetIException("DataSet::close", "H5Dclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: DataSet destructor -///\brief Properly terminates access to this dataset. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet destructor +///\brief Properly terminates access to this dataset. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- DataSet::~DataSet() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "DataSet::~DataSet - " << close_error.getDetailMsg() << endl; + cerr << "DataSet::~DataSet - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index ee9ef28..93f9782 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -31,82 +31,82 @@ namespace H5 { class H5_DLLCPP DataSet : public H5Object, public AbstractDs { public: - // Close this dataset. - virtual void close(); + // Close this dataset. + virtual void close(); - // Extends the dataset with unlimited dimension. - void extend( const hsize_t* size ) const; + // Extends the dataset with unlimited dimension. + void extend(const hsize_t* size) const; - // Fills a selection in memory with a value - void fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const; - //void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 + // Fills a selection in memory with a value + void fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const; + //void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 - // Fills a selection in memory with zero - void fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const; - //void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 + // Fills a selection in memory with zero + void fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const; + //void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 - // Gets the creation property list of this dataset. - DSetCreatPropList getCreatePlist() const; + // Gets the creation property list of this dataset. + DSetCreatPropList getCreatePlist() const; - // Returns the address of this dataset in the file. - haddr_t getOffset() const; + // Returns the address of this dataset in the file. + haddr_t getOffset() const; - // Gets the dataspace of this dataset. - virtual DataSpace getSpace() const; + // Gets the dataspace of this dataset. + virtual DataSpace getSpace() const; - // Determines whether space has been allocated for a dataset. - void getSpaceStatus(H5D_space_status_t& status) const; + // Determines whether space has been allocated for a dataset. + void getSpaceStatus(H5D_space_status_t& status) const; - // Returns the amount of storage size required for this dataset. - virtual hsize_t getStorageSize() const; + // Returns the amount of storage size required for this dataset. + virtual hsize_t getStorageSize() const; - // Returns the in memory size of this attribute's data. - virtual size_t getInMemDataSize() const; + // Returns the in memory size of this attribute's data. + virtual size_t getInMemDataSize() const; - // Returns the number of bytes required to store VL data. - hsize_t getVlenBufSize(const DataType& type, const DataSpace& space ) const; - //hsize_t getVlenBufSize(DataType& type, DataSpace& space) const; // removed from 1.8.18 and 1.10.1 + // Returns the number of bytes required to store VL data. + hsize_t getVlenBufSize(const DataType& type, const DataSpace& space) const; + //hsize_t getVlenBufSize(DataType& type, DataSpace& space) const; // removed from 1.8.18 and 1.10.1 - // Reclaims VL datatype memory buffers. - static void vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf ); - static void vlenReclaim(void *buf, const DataType& type, const DataSpace& space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT); + // Reclaims VL datatype memory buffers. + static void vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf); + static void vlenReclaim(void *buf, const DataType& type, const DataSpace& space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT); - // Reads the data of this dataset and stores it in the provided buffer. - // The memory and file dataspaces and the transferring property list - // can be defaults. - void read( void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; - void read( H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; + // Reads the data of this dataset and stores it in the provided buffer. + // The memory and file dataspaces and the transferring property list + // can be defaults. + void read(void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const; + void read(H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const; - // Writes the buffered data to this dataset. - // The memory and file dataspaces and the transferring property list - // can be defaults. - void write( const void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; - void write( const H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; + // Writes the buffered data to this dataset. + // The memory and file dataspaces and the transferring property list + // can be defaults. + void write(const void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const; + void write(const H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const; - // Iterates the selected elements in the specified dataspace - not implemented in C++ style yet - int iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data = NULL ); + // Iterates the selected elements in the specified dataspace - not implemented in C++ style yet + int iterateElems(void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data = NULL); - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DataSet"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DataSet"); } - // Creates a dataset by way of dereference. - DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); - DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + // Creates a dataset by way of dereference. + DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); - // Default constructor. - DataSet(); + // Default constructor. + DataSet(); - // Copy constructor. - DataSet( const DataSet& original ); + // Copy constructor. + DataSet(const DataSet& original); - // Creates a copy of an existing DataSet using its id. - DataSet(const hid_t existing_id); + // Creates a copy of an existing DataSet using its id. + DataSet(const hid_t existing_id); // Gets the dataset id. virtual hid_t getId() const; - // Destructor: properly terminates access to this dataset. - virtual ~DataSet(); + // Destructor: properly terminates access to this dataset. + virtual ~DataSet(); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -115,20 +115,20 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 dataset id + hid_t id; // HDF5 dataset id // This function contains the common code that is used by // getTypeClass and various API functions getXxxType // defined in AbstractDs for generic datatype and specific // sub-types - virtual hid_t p_get_type() const; + virtual hid_t p_get_type() const; - // Reads variable or fixed len strings from this dataset. - void p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const; - void p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const; + // Reads variable or fixed len strings from this dataset. + void p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const; + void p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const; - // Friend function to set DataSet id. For library use only. - friend void f_DataSet_setId(DataSet* dset, hid_t new_id); + // Friend function to set DataSet id. For library use only. + friend void f_DataSet_setId(DataSet* dset, hid_t new_id); }; } diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index cb479e1..2587a72 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -38,14 +38,14 @@ using std::endl; DataSpace* DataSpace::ALL_ = 0; //-------------------------------------------------------------------------- -// Function: DataSpace::getConstant -// Creates a DataSpace object representing the HDF5 constant -// H5S_ALL, pointed to by DataSpace::ALL_ -// Exception H5::DataSpaceIException +// Function: DataSpace::getConstant +// Creates a DataSpace object representing the HDF5 constant +// H5S_ALL, pointed to by DataSpace::ALL_ +// Exception H5::DataSpaceIException // Description -// If DataSpace::ALL_ already points to an allocated object, throw -// a DataSpaceIException. This scenario should not happen. -// Programmer Binh-Minh Ribler - 2015 +// If DataSpace::ALL_ already points to an allocated object, throw +// a DataSpaceIException. This scenario should not happen. +// Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- DataSpace* DataSpace::getConstant() { @@ -78,55 +78,55 @@ void DataSpace::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for default dataspace. +// Purpose Constant for default dataspace. //-------------------------------------------------------------------------- const DataSpace& DataSpace::ALL = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataSpace constructor -///\brief Creates a new dataspace given a dataspace type. -///\param type - IN: Type of the dataspace to be created, which -/// currently can be either \c H5S_SCALAR or \c H5S_SIMPLE; -/// default to \c H5S_SCALAR. -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace constructor +///\brief Creates a new dataspace given a dataspace type. +///\param type - IN: Type of the dataspace to be created, which +/// currently can be either \c H5S_SCALAR or \c H5S_SIMPLE; +/// default to \c H5S_SCALAR. +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace::DataSpace(H5S_class_t type) : IdComponent() { - id = H5Screate( type ); - if( id < 0 ) - { - throw DataSpaceIException("DataSpace constructor", "H5Screate failed"); - } + id = H5Screate(type); + if (id < 0) + { + throw DataSpaceIException("DataSpace constructor", "H5Screate failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace overloaded constructor -///\brief Creates a new simple dataspace. -///\param rank - IN: Number of dimensions of dataspace. -///\param dims - IN: An array of the size of each dimension. -///\param maxdims - IN: An array of the maximum size of each dimension. -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace overloaded constructor +///\brief Creates a new simple dataspace. +///\param rank - IN: Number of dimensions of dataspace. +///\param dims - IN: An array of the size of each dimension. +///\param maxdims - IN: An array of the maximum size of each dimension. +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) : IdComponent() +DataSpace::DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims) : IdComponent() { - id = H5Screate_simple( rank, dims, maxdims ); - if( id < 0 ) - { - throw DataSpaceIException("DataSpace constructor", "H5Screate_simple failed"); - } + id = H5Screate_simple(rank, dims, maxdims); + if (id < 0) + { + throw DataSpaceIException("DataSpace constructor", "H5Screate_simple failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace overloaded constructor -///\brief Creates a DataSpace object using the id of an existing -/// dataspace. -///\param existing_id - IN: Id of an existing dataspace -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace overloaded constructor +///\brief Creates a DataSpace object using the id of an existing +/// dataspace. +///\param existing_id - IN: Id of an existing dataspace +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace::DataSpace(const hid_t existing_id) : IdComponent(), id(existing_id) { @@ -134,10 +134,10 @@ DataSpace::DataSpace(const hid_t existing_id) : IdComponent(), id(existing_id) } //-------------------------------------------------------------------------- -// Function: DataSpace copy constructor -///\brief Copy constructor: makes a copy of the original DataSpace object. -///\param original - IN: DataSpace object to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace copy constructor +///\brief Copy constructor: makes a copy of the original DataSpace object. +///\param original - IN: DataSpace object to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace::DataSpace(const DataSpace& original) : IdComponent(), id(original.id) { @@ -145,48 +145,48 @@ DataSpace::DataSpace(const DataSpace& original) : IdComponent(), id(original.id) } //-------------------------------------------------------------------------- -// Function: DataSpace::copy -///\brief Makes a copy of an existing dataspace. -///\param like_space - IN: Dataspace to be copied -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::copy +///\brief Makes a copy of an existing dataspace. +///\param like_space - IN: Dataspace to be copied +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 -//-------------------------------------------------------------------------- -void DataSpace::copy( const DataSpace& like_space ) -{ - // If this object has an hdf5 valid id, close it - if( id != H5S_ALL ) { - try { - close(); - } - catch (Exception& close_error) { +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 +//-------------------------------------------------------------------------- +void DataSpace::copy(const DataSpace& like_space) +{ + // If this object has an hdf5 valid id, close it + if (id != H5S_ALL) { + try { + close(); + } + catch (Exception& close_error) { throw DataSpaceIException("DataSpace::copy", close_error.getDetailMsg()); - } - } // end if + } + } // end if - // call C routine to copy the dataspace - id = H5Scopy( like_space.getId() ); + // call C routine to copy the dataspace + id = H5Scopy(like_space.getId()); - if( id < 0 ) - throw DataSpaceIException("DataSpace::copy", "H5Scopy failed"); + if (id < 0) + throw DataSpaceIException("DataSpace::copy", "H5Scopy failed"); } //-------------------------------------------------------------------------- -// Function: DataSpace::operator= -///\brief Assignment operator. -///\param rhs - IN: Reference to the existing dataspace -///\return Reference to DataSpace instance -///\exception H5::DataSpaceIException +// Function: DataSpace::operator= +///\brief Assignment operator. +///\param rhs - IN: Reference to the existing dataspace +///\return Reference to DataSpace instance +///\exception H5::DataSpaceIException // Description -// Makes a copy of the type on the right hand side and stores -// the new id in the left hand side object. -// Programmer Binh-Minh Ribler - 2000 +// Makes a copy of the type on the right hand side and stores +// the new id in the left hand side object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSpace& DataSpace::operator=( const DataSpace& rhs ) +DataSpace& DataSpace::operator=(const DataSpace& rhs) { if (this != &rhs) copy(rhs); @@ -194,435 +194,434 @@ DataSpace& DataSpace::operator=( const DataSpace& rhs ) } //-------------------------------------------------------------------------- -// Function: DataSpace::isSimple -///\brief Determines whether this dataspace is a simple dataspace. -///\return \c true if the dataspace is a simple dataspace, and \c false, -/// otherwise -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::isSimple +///\brief Determines whether this dataspace is a simple dataspace. +///\return \c true if the dataspace is a simple dataspace, and \c false, +/// otherwise +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DataSpace::isSimple () const { - htri_t simple = H5Sis_simple( id ); - if( simple > 0 ) - return true; - else if( simple == 0 ) - return false; - else - { - throw DataSpaceIException("DataSpace::isSimple", - "H5Sis_simple returns negative value"); - } + htri_t simple = H5Sis_simple(id); + if (simple > 0) + return true; + else if (simple == 0) + return false; + else + { + throw DataSpaceIException("DataSpace::isSimple", + "H5Sis_simple returns negative value"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::offsetSimple -///\brief Sets the offset of this simple dataspace. -///\param offset - IN: Offset to position the selection at -///\exception H5::DataSpaceIException +// Function: DataSpace::offsetSimple +///\brief Sets the offset of this simple dataspace. +///\param offset - IN: Offset to position the selection at +///\exception H5::DataSpaceIException ///\par Description -/// This function creates an offset for the selection within -/// an extent, allowing the same shaped selection to be moved -/// to different locations within a dataspace without requiring -/// it to be re-defined. -// Programmer Binh-Minh Ribler - 2000 +/// This function creates an offset for the selection within +/// an extent, allowing the same shaped selection to be moved +/// to different locations within a dataspace without requiring +/// it to be re-defined. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::offsetSimple ( const hssize_t* offset ) const +void DataSpace::offsetSimple (const hssize_t* offset) const { - herr_t ret_value = H5Soffset_simple( id, offset ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::offsetSimple", "H5Soffset_simple failed"); - } + herr_t ret_value = H5Soffset_simple(id, offset); + if (ret_value < 0) + { + throw DataSpaceIException("DataSpace::offsetSimple", "H5Soffset_simple failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::getSimpleExtentDims -///\brief Retrieves dataspace dimension size and maximum size. -///\param dims - IN: Name of the new member -///\param maxdims - IN: Pointer to the value of the new member -///\return Number of dimensions, the same value as returned by -/// \c DataSpace::getSimpleExtentNdims() -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSimpleExtentDims +///\brief Retrieves dataspace dimension size and maximum size. +///\param dims - IN: Name of the new member +///\param maxdims - IN: Pointer to the value of the new member +///\return Number of dimensions, the same value as returned by +/// \c DataSpace::getSimpleExtentNdims() +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int DataSpace::getSimpleExtentDims ( hsize_t *dims, hsize_t *maxdims ) const +int DataSpace::getSimpleExtentDims (hsize_t *dims, hsize_t *maxdims) const { - int ndims = H5Sget_simple_extent_dims( id, dims, maxdims ); - if( ndims < 0 ) - { - throw DataSpaceIException("DataSpace::getSimpleExtentDims", - "H5Sget_simple_extent_dims returns negative number of dimensions"); - } - return( ndims ); + int ndims = H5Sget_simple_extent_dims(id, dims, maxdims); + if (ndims < 0) + { + throw DataSpaceIException("DataSpace::getSimpleExtentDims", + "H5Sget_simple_extent_dims returns negative number of dimensions"); + } + return(ndims); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSimpleExtentNdims -///\brief Returns the dimensionality of a dataspace. -///\return Number of dimensions -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSimpleExtentNdims +///\brief Returns the dimensionality of a dataspace. +///\return Number of dimensions +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DataSpace::getSimpleExtentNdims () const { - int ndims = H5Sget_simple_extent_ndims( id ); - if( ndims < 0 ) - { - throw DataSpaceIException("DataSpace::getSimpleExtentNdims", - "H5Sget_simple_extent_ndims returns negative value for dimensionality of the dataspace"); - } - return( ndims ); + int ndims = H5Sget_simple_extent_ndims(id); + if (ndims < 0) + { + throw DataSpaceIException("DataSpace::getSimpleExtentNdims", + "H5Sget_simple_extent_ndims returns negative value for dimensionality of the dataspace"); + } + return(ndims); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSimpleExtentNpoints -///\brief Returns the number of elements in a dataspace. -///\return Number of elements -///\exception H5::DataSpaceIException +// Function: DataSpace::getSimpleExtentNpoints +///\brief Returns the number of elements in a dataspace. +///\return Number of elements +///\exception H5::DataSpaceIException // Modification -// 12/05/00: due to C API change -// return type hssize_t vs. hsize_t -// num_elements = -1 when failure occurs vs. 0 -// Programmer Binh-Minh Ribler - 2000 +// 12/05/00: due to C API change +// return type hssize_t vs. hsize_t +// num_elements = -1 when failure occurs vs. 0 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hssize_t DataSpace::getSimpleExtentNpoints () const { - hssize_t num_elements = H5Sget_simple_extent_npoints( id ); - - if( num_elements > -1 ) - return( num_elements ); - else - { - throw DataSpaceIException("DataSpace::getSimpleExtentNpoints", - "H5Sget_simple_extent_npoints returns negative value for the number of elements in the dataspace"); - } + hssize_t num_elements = H5Sget_simple_extent_npoints(id); + if (num_elements > -1) + return(num_elements); + else + { + throw DataSpaceIException("DataSpace::getSimpleExtentNpoints", + "H5Sget_simple_extent_npoints returns negative value for the number of elements in the dataspace"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::getSimpleExtentType -///\brief Returns the current class of a dataspace. -///\return Class of the dataspace -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSimpleExtentType +///\brief Returns the current class of a dataspace. +///\return Class of the dataspace +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5S_class_t DataSpace::getSimpleExtentType () const { - H5S_class_t class_name = H5Sget_simple_extent_type( id ); - if( class_name == H5S_NO_CLASS ) - { - throw DataSpaceIException("DataSpace::getSimpleExtentType", - "H5Sget_simple_extent_type returns H5S_NO_CLASS"); - } - return( class_name ); + H5S_class_t class_name = H5Sget_simple_extent_type(id); + if (class_name == H5S_NO_CLASS) + { + throw DataSpaceIException("DataSpace::getSimpleExtentType", + "H5Sget_simple_extent_type returns H5S_NO_CLASS"); + } + return(class_name); } //-------------------------------------------------------------------------- -// Function: DataSpace::extentCopy -///\brief Copies the extent of a dataspace. -///\param dest_space - IN: Dataspace to copy from -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::extentCopy +///\brief Copies the extent of a dataspace. +///\param dest_space - IN: Dataspace to copy from +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::extentCopy (const DataSpace& dest_space) const { - hid_t dest_space_id = dest_space.getId(); - herr_t ret_value = H5Sextent_copy( dest_space_id, id ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::extentCopy", "H5Sextent_copy failed"); - } + hid_t dest_space_id = dest_space.getId(); + herr_t ret_value = H5Sextent_copy(dest_space_id, id); + if (ret_value < 0) + { + throw DataSpaceIException("DataSpace::extentCopy", "H5Sextent_copy failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::extentCopy -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const. This wrapper will be removed in future release. -// Param dest_space - IN: Dataspace to copy from -// Exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::extentCopy +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const. This wrapper will be removed in future release. +// Param dest_space - IN: Dataspace to copy from +// Exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- -//void DataSpace::extentCopy( DataSpace& dest_space ) const +//void DataSpace::extentCopy(DataSpace& dest_space) const //{ // extentCopy(dest_space); //} //-------------------------------------------------------------------------- -// Function: DataSpace::setExtentSimple -///\brief Sets or resets the size of an existing dataspace. -///\param rank - IN: Rank of the dataspace -///\param current_size - IN: Array containing current size of dataspace -///\param maximum_size - IN: Array containing maximum size of dataspace -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::setExtentSimple +///\brief Sets or resets the size of an existing dataspace. +///\param rank - IN: Rank of the dataspace +///\param current_size - IN: Array containing current size of dataspace +///\param maximum_size - IN: Array containing maximum size of dataspace +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size ) const +void DataSpace::setExtentSimple(int rank, const hsize_t *current_size, const hsize_t *maximum_size) const { - herr_t ret_value; - ret_value = H5Sset_extent_simple( id, rank, current_size, maximum_size ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::setExtentSimple", "H5Sset_extent_simple failed"); - } + herr_t ret_value; + ret_value = H5Sset_extent_simple(id, rank, current_size, maximum_size); + if (ret_value < 0) + { + throw DataSpaceIException("DataSpace::setExtentSimple", "H5Sset_extent_simple failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::setExtentNone -///\brief Removes the extent from a dataspace. +// Function: DataSpace::setExtentNone +///\brief Removes the extent from a dataspace. /// -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::setExtentNone () const { - herr_t ret_value = H5Sset_extent_none( id ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::setExtentNone", "H5Sset_extent_none failed"); - } + herr_t ret_value = H5Sset_extent_none(id); + if (ret_value < 0) + { + throw DataSpaceIException("DataSpace::setExtentNone", "H5Sset_extent_none failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectNpoints -///\brief Returns the number of elements in a dataspace selection. -///\return Number of elements -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSelectNpoints +///\brief Returns the number of elements in a dataspace selection. +///\return Number of elements +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hssize_t DataSpace::getSelectNpoints () const { - hssize_t num_elements = H5Sget_select_npoints( id ); - if( num_elements < 0 ) - { - throw DataSpaceIException("DataSpace::getSelectNpoints", - "H5Sget_select_npoints returns negative value for number of elements in the dataspace selection"); - } - return( num_elements ); + hssize_t num_elements = H5Sget_select_npoints(id); + if (num_elements < 0) + { + throw DataSpaceIException("DataSpace::getSelectNpoints", + "H5Sget_select_npoints returns negative value for number of elements in the dataspace selection"); + } + return(num_elements); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectHyperNblocks -///\brief Returns number of hyperslab blocks. -///\return Number of hyperslab blocks -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSelectHyperNblocks +///\brief Returns number of hyperslab blocks. +///\return Number of hyperslab blocks +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hssize_t DataSpace::getSelectHyperNblocks () const { - hssize_t num_blocks = H5Sget_select_hyper_nblocks( id ); - if( num_blocks < 0 ) - { - throw DataSpaceIException("DataSpace::getSelectHyperNblocks", - "H5Sget_select_hyper_nblocks returns negative value for the number of hyperslab blocks"); - } - return( num_blocks ); + hssize_t num_blocks = H5Sget_select_hyper_nblocks(id); + if (num_blocks < 0) + { + throw DataSpaceIException("DataSpace::getSelectHyperNblocks", + "H5Sget_select_hyper_nblocks returns negative value for the number of hyperslab blocks"); + } + return(num_blocks); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectHyperBlocklist -///\brief Gets the list of hyperslab blocks currently selected -///\param startblock - IN: Hyperslab block to start with -///\param numblocks - IN: Number of hyperslab blocks to get -///\param buf - IN: List of hyperslab blocks selected -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSelectHyperBlocklist +///\brief Gets the list of hyperslab blocks currently selected +///\param startblock - IN: Hyperslab block to start with +///\param numblocks - IN: Number of hyperslab blocks to get +///\param buf - IN: List of hyperslab blocks selected +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const +void DataSpace::getSelectHyperBlocklist(hsize_t startblock, hsize_t numblocks, hsize_t *buf) const { - herr_t ret_value; - ret_value = H5Sget_select_hyper_blocklist( id, startblock, numblocks, buf ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::getSelectHyperBlocklist", - "H5Sget_select_hyper_blocklist failed"); - } + herr_t ret_value; + ret_value = H5Sget_select_hyper_blocklist(id, startblock, numblocks, buf); + if (ret_value < 0) + { + throw DataSpaceIException("DataSpace::getSelectHyperBlocklist", + "H5Sget_select_hyper_blocklist failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectElemNpoints -///\brief Returns the number of element points in the current selection. -///\return Number of element points -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSelectElemNpoints +///\brief Returns the number of element points in the current selection. +///\return Number of element points +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hssize_t DataSpace::getSelectElemNpoints () const { - hssize_t num_points = H5Sget_select_elem_npoints( id ); - if( num_points < 0 ) - { - throw DataSpaceIException("DataSpace::getSelectElemNpoints", - "H5Sget_select_elem_npoints failed"); - } - return( num_points ); + hssize_t num_points = H5Sget_select_elem_npoints(id); + if (num_points < 0) + { + throw DataSpaceIException("DataSpace::getSelectElemNpoints", + "H5Sget_select_elem_npoints failed"); + } + return(num_points); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectElemPointlist -///\brief Gets the list of element points currently selected -///\param startpoint - IN: Element point to start with -///\param numpoints - IN: Number of element points to get -///\param buf - IN: List of element points selected -///\exception H5::DataSpaceIException +// Function: DataSpace::getSelectElemPointlist +///\brief Gets the list of element points currently selected +///\param startpoint - IN: Element point to start with +///\param numpoints - IN: Number of element points to get +///\param buf - IN: List of element points selected +///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElemPointList -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const +void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize_t numpoints, hsize_t *buf) const { - herr_t ret_value; - ret_value = H5Sget_select_elem_pointlist( id, startpoint, numpoints, buf ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::getSelectElemPointlist", - "H5Sget_select_elem_pointlist failed"); - } + herr_t ret_value; + ret_value = H5Sget_select_elem_pointlist(id, startpoint, numpoints, buf); + if (ret_value < 0) + { + throw DataSpaceIException("DataSpace::getSelectElemPointlist", + "H5Sget_select_elem_pointlist failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectBounds -///\brief Gets the bounding box containing the current selection. -///\param start - IN: Starting coordinates of the bounding box -///\param end - IN: Ending coordinates of the bounding box, i.e., -/// the coordinates of the diagonally opposite corner -///\exception H5::DataSpaceIException +// Function: DataSpace::getSelectBounds +///\brief Gets the bounding box containing the current selection. +///\param start - IN: Starting coordinates of the bounding box +///\param end - IN: Ending coordinates of the bounding box, i.e., +/// the coordinates of the diagonally opposite corner +///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectBounds -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const +void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end) const { - herr_t ret_value = H5Sget_select_bounds( id, start, end ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::getSelectBounds", - "H5Sget_select_bounds failed"); - } + herr_t ret_value = H5Sget_select_bounds(id, start, end); + if (ret_value < 0) + { + throw DataSpaceIException("DataSpace::getSelectBounds", + "H5Sget_select_bounds failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::selectElements -///\brief Selects array elements to be included in the selection for -/// this dataspace. -///\param op - IN: Operator specifying how the new selection is to be -/// combined with the existing selection for the dataspace -///\param num_elements - IN: Number of elements to be selected -///\param coord - IN: A 2-dimensional array of 0-based values -/// specifying the coordinates of the elements being selected -///\exception H5::DataSpaceIException +// Function: DataSpace::selectElements +///\brief Selects array elements to be included in the selection for +/// this dataspace. +///\param op - IN: Operator specifying how the new selection is to be +/// combined with the existing selection for the dataspace +///\param num_elements - IN: Number of elements to be selected +///\param coord - IN: A 2-dimensional array of 0-based values +/// specifying the coordinates of the elements being selected +///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElements -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::selectElements ( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const +void DataSpace::selectElements (H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const { - herr_t ret_value; - ret_value = H5Sselect_elements( id, op, num_elements, coord ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::selectElements", - "H5Sselect_elements failed"); - } + herr_t ret_value; + ret_value = H5Sselect_elements(id, op, num_elements, coord); + if (ret_value < 0) + { + throw DataSpaceIException("DataSpace::selectElements", + "H5Sselect_elements failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::selectAll -///\brief Selects the entire dataspace. +// Function: DataSpace::selectAll +///\brief Selects the entire dataspace. /// -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectAll () const { - herr_t ret_value = H5Sselect_all( id ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::selectAll", "H5Sselect_all failed"); - } + herr_t ret_value = H5Sselect_all(id); + if (ret_value < 0) + { + throw DataSpaceIException("DataSpace::selectAll", "H5Sselect_all failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::selectNone -///\brief Resets the selection region to include no elements. +// Function: DataSpace::selectNone +///\brief Resets the selection region to include no elements. /// -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectNone () const { - herr_t ret_value = H5Sselect_none( id ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::selectNone", - "H5Sselect_none failed"); - } + herr_t ret_value = H5Sselect_none(id); + if (ret_value < 0) + { + throw DataSpaceIException("DataSpace::selectNone", + "H5Sselect_none failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::selectValid -///\brief Verifies that the selection is within the extent of the -/// dataspace. -///\return \c true if the selection is within the extent of the -/// dataspace, and \c false, otherwise -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::selectValid +///\brief Verifies that the selection is within the extent of the +/// dataspace. +///\return \c true if the selection is within the extent of the +/// dataspace, and \c false, otherwise +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DataSpace::selectValid () const { - htri_t ret_value = H5Sselect_valid( id ); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else - { - throw DataSpaceIException("DataSpace::selectValid", - "H5Sselect_valid returns negative value"); - } -} - -//-------------------------------------------------------------------------- -// Function: DataSpace::selectHyperslab -///\brief Selects a hyperslab region to add to the current selected region. -///\param op - IN: Operation to perform on current selection -///\param count - IN: Number of blocks included in the hyperslab -///\param start - IN: Offset of the start of hyperslab -///\param stride - IN: Hyperslab stride - default to \c NULL -///\param block - IN: Size of block in the hyperslab - default to \c NULL -///\exception H5::DataSpaceIException + htri_t ret_value = H5Sselect_valid(id); + if (ret_value > 0) + return true; + else if (ret_value == 0) + return false; + else + { + throw DataSpaceIException("DataSpace::selectValid", + "H5Sselect_valid returns negative value"); + } +} + +//-------------------------------------------------------------------------- +// Function: DataSpace::selectHyperslab +///\brief Selects a hyperslab region to add to the current selected region. +///\param op - IN: Operation to perform on current selection +///\param count - IN: Number of blocks included in the hyperslab +///\param start - IN: Offset of the start of hyperslab +///\param stride - IN: Hyperslab stride - default to \c NULL +///\param block - IN: Size of block in the hyperslab - default to \c NULL +///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block ) const +void DataSpace::selectHyperslab(H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block) const { - herr_t ret_value; - ret_value = H5Sselect_hyperslab( id, op, start, stride, count, block ); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::selectHyperslab", - "H5Sselect_hyperslab failed"); - } + herr_t ret_value; + ret_value = H5Sselect_hyperslab(id, op, start, stride, count, block); + if (ret_value < 0) + { + throw DataSpaceIException("DataSpace::selectHyperslab", + "H5Sselect_hyperslab failed"); + } } //-------------------------------------------------------------------------- // Function: DataSpace::getId -///\brief Get the id of this dataspace -///\return Dataspace identifier +///\brief Get the id of this dataspace +///\return Dataspace identifier // Modification: -// May 2008 - BMR +// May 2008 - BMR // Class hierarchy is revised to address bugzilla 1068. Class // AbstractDS and Attribute are moved out of H5Object. In // addition, member IdComponent::id is moved into subclasses, and @@ -631,7 +630,7 @@ void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const h //-------------------------------------------------------------------------- hid_t DataSpace::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -656,49 +655,49 @@ void DataSpace::p_setId(const hid_t new_id) catch (Exception& close_error) { throw DataSpaceIException(inMemFunc("p_setId"), close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataSpace::close -///\brief Closes this dataspace. +// Function: DataSpace::close +///\brief Closes this dataspace. /// -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void DataSpace::close() { // check if id is a valid hdf5 object id before trying to close it if (p_valid_id(id)) { - herr_t ret_value = H5Sclose(id); - if( ret_value < 0 ) - { - throw DataSpaceIException("DataSpace::close", "H5Sclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Sclose(id); + if (ret_value < 0) + { + throw DataSpaceIException("DataSpace::close", "H5Sclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: DataSpace destructor -///\brief Properly terminates access to this dataspace. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace destructor +///\brief Properly terminates access to this dataspace. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- DataSpace::~DataSpace() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl; + cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index e76bc72..969e146 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -27,126 +27,126 @@ namespace H5 { */ class H5_DLLCPP DataSpace : public IdComponent { public: - ///\brief Default DataSpace objects - static const DataSpace& ALL; + ///\brief Default DataSpace objects + static const DataSpace& ALL; - // Creates a dataspace object given the space type - DataSpace(H5S_class_t type = H5S_SCALAR); + // Creates a dataspace object given the space type + DataSpace(H5S_class_t type = H5S_SCALAR); - // Creates a simple dataspace - DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL); + // Creates a simple dataspace + DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL); - // Creates a DataSpace object using an existing dataspace id. - DataSpace(const hid_t space_id); + // Creates a DataSpace object using an existing dataspace id. + DataSpace(const hid_t space_id); - // Copy constructor: makes a copy of the original DataSpace object. - DataSpace(const DataSpace& original); + // Copy constructor: makes a copy of the original DataSpace object. + DataSpace(const DataSpace& original); - // Assignment operator - DataSpace& operator=( const DataSpace& rhs ); + // Assignment operator + DataSpace& operator=(const DataSpace& rhs); - // Closes this dataspace. - virtual void close(); + // Closes this dataspace. + virtual void close(); - // Makes copy of an existing dataspace. - void copy(const DataSpace& like_space); + // Makes copy of an existing dataspace. + void copy(const DataSpace& like_space); - // Copies the extent of this dataspace. - void extentCopy(const DataSpace& dest_space) const; - // removed from 1.8.18 and 1.10.1 - //void extentCopy(DataSpace& dest_space) const; + // Copies the extent of this dataspace. + void extentCopy(const DataSpace& dest_space) const; + // removed from 1.8.18 and 1.10.1 + //void extentCopy(DataSpace& dest_space) const; - // Gets the bounding box containing the current selection. - void getSelectBounds( hsize_t* start, hsize_t* end ) const; + // Gets the bounding box containing the current selection. + void getSelectBounds(hsize_t* start, hsize_t* end) const; - // Gets the number of element points in the current selection. - hssize_t getSelectElemNpoints() const; + // Gets the number of element points in the current selection. + hssize_t getSelectElemNpoints() const; - // Retrieves the list of element points currently selected. - void getSelectElemPointlist( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const; + // Retrieves the list of element points currently selected. + void getSelectElemPointlist(hsize_t startpoint, hsize_t numpoints, hsize_t *buf) const; - // Gets the list of hyperslab blocks currently selected. - void getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const; + // Gets the list of hyperslab blocks currently selected. + void getSelectHyperBlocklist(hsize_t startblock, hsize_t numblocks, hsize_t *buf) const; - // Get number of hyperslab blocks. - hssize_t getSelectHyperNblocks() const; + // Get number of hyperslab blocks. + hssize_t getSelectHyperNblocks() const; - // Gets the number of elements in this dataspace selection. - hssize_t getSelectNpoints() const; + // Gets the number of elements in this dataspace selection. + hssize_t getSelectNpoints() const; - // Retrieves dataspace dimension size and maximum size. - int getSimpleExtentDims( hsize_t *dims, hsize_t *maxdims = NULL ) const; + // Retrieves dataspace dimension size and maximum size. + int getSimpleExtentDims(hsize_t *dims, hsize_t *maxdims = NULL) const; - // Gets the dimensionality of this dataspace. - int getSimpleExtentNdims() const; + // Gets the dimensionality of this dataspace. + int getSimpleExtentNdims() const; - // Gets the number of elements in this dataspace. - // 12/05/00 - changed return type to hssize_t from hsize_t - C API - hssize_t getSimpleExtentNpoints() const; + // Gets the number of elements in this dataspace. + // 12/05/00 - changed return type to hssize_t from hsize_t - C API + hssize_t getSimpleExtentNpoints() const; - // Gets the current class of this dataspace. - H5S_class_t getSimpleExtentType() const; + // Gets the current class of this dataspace. + H5S_class_t getSimpleExtentType() const; - // Determines if this dataspace is a simple one. - bool isSimple() const; + // Determines if this dataspace is a simple one. + bool isSimple() const; - // Sets the offset of this simple dataspace. - void offsetSimple( const hssize_t* offset ) const; + // Sets the offset of this simple dataspace. + void offsetSimple(const hssize_t* offset) const; - // Selects the entire dataspace. - void selectAll() const; + // Selects the entire dataspace. + void selectAll() const; - // Selects array elements to be included in the selection for - // this dataspace. - void selectElements( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const; + // Selects array elements to be included in the selection for + // this dataspace. + void selectElements(H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const; - // Selects a hyperslab region to add to the current selected region. - void selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL ) const; + // Selects a hyperslab region to add to the current selected region. + void selectHyperslab(H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL) const; - // Resets the selection region to include no elements. - void selectNone() const; + // Resets the selection region to include no elements. + void selectNone() const; - // Verifies that the selection is within the extent of the dataspace. - bool selectValid() const; + // Verifies that the selection is within the extent of the dataspace. + bool selectValid() const; - // Removes the extent from this dataspace. - void setExtentNone() const; + // Removes the extent from this dataspace. + void setExtentNone() const; - // Sets or resets the size of this dataspace. - void setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL ) const; + // Sets or resets the size of this dataspace. + void setExtentSimple(int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DataSpace"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DataSpace"); } - // Gets the dataspace id. - virtual hid_t getId() const; + // Gets the dataspace id. + virtual hid_t getId() const; - // Deletes the global constant - static void deleteConstants(); + // Deletes the global constant + static void deleteConstants(); - // Destructor: properly terminates access to this dataspace. - virtual ~DataSpace(); + // Destructor: properly terminates access to this dataspace. + virtual ~DataSpace(); #ifndef DOXYGEN_SHOULD_SKIP_THIS protected: - // Sets the dataspace id. - virtual void p_setId(const hid_t new_id); + // Sets the dataspace id. + virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 dataspace id + hid_t id; // HDF5 dataspace id #ifndef DOXYGEN_SHOULD_SKIP_THIS - static DataSpace* ALL_; + static DataSpace* ALL_; - // Creates the global constant - static DataSpace* getConstant(); + // Creates the global constant + static DataSpace* getConstant(); - // Friend function to set DataSpace id. For library use only. - friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id); + // Friend function to set DataSpace id. For library use only. + friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS }; diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 372b2c9..ae48d16 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -46,24 +46,24 @@ using std::cerr; using std::endl; //-------------------------------------------------------------------------- -// Function: DataType default constructor -///\brief Default constructor: Creates a stub datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType default constructor +///\brief Default constructor: Creates a stub datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType::DataType() : H5Object(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: DataType overloaded constructor -///\brief Creates a datatype using an existing datatype's id -///\param existing_id - IN: Id of the existing datatype +// Function: DataType overloaded constructor +///\brief Creates a datatype using an existing datatype's id +///\param existing_id - IN: Id of the existing datatype // Description -// Constructor creates a copy of an existing DataType using -// its id. -// Programmer Binh-Minh Ribler - 2000 +// Constructor creates a copy of an existing DataType using +// its id. +// Programmer Binh-Minh Ribler - 2000 // Modification -// Dec, 2005 -// Removed second argument, "predefined", after changing to the -// new ref counting mechanism that relies on C's ref counting. +// Dec, 2005 +// Removed second argument, "predefined", after changing to the +// new ref counting mechanism that relies on C's ref counting. //-------------------------------------------------------------------------- DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id) { @@ -71,36 +71,36 @@ DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id) } //-------------------------------------------------------------------------- -// Function: DataType overloaded constructor -///\brief Creates a object given its class and size -///\param type_class - IN: Class of datatype to create -///\param size - IN: Number of bytes in the datatype to create -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType overloaded constructor +///\brief Creates a object given its class and size +///\param type_class - IN: Class of datatype to create +///\param size - IN: Number of bytes in the datatype to create +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object() +DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object() { - // Call C routine to create the new datatype - id = H5Tcreate( type_class, size ); - if( id < 0 ) - { - throw DataTypeIException("DataType constructor", "H5Tcreate failed"); - } + // Call C routine to create the new datatype + id = H5Tcreate(type_class, size); + if (id < 0) + { + throw DataTypeIException("DataType constructor", "H5Tcreate failed"); + } } //-------------------------------------------------------------------------- -// Function: DataType overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a -/// DataType object +// Function: DataType overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 group, creates a +/// DataType object ///\param loc - IN: Location referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// Jul, 2008 -// Added for application convenience. +// Jul, 2008 +// Added for application convenience. //-------------------------------------------------------------------------- DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object() { @@ -108,18 +108,18 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, } //-------------------------------------------------------------------------- -// Function: DataType overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a -/// DataType object +// Function: DataType overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 group, creates a +/// DataType object ///\param attr - IN: Specifying location where the referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// Jul, 2008 -// Added for application convenience. +// Jul, 2008 +// Added for application convenience. //-------------------------------------------------------------------------- /* DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) { @@ -128,9 +128,9 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, */ //-------------------------------------------------------------------------- -// Function: DataType copy constructor -///\brief Copy constructor: makes a copy of the original DataType object -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType copy constructor +///\brief Copy constructor: makes a copy of the original DataType object +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType::DataType(const DataType& original) : H5Object(), id(original.id) { @@ -144,32 +144,32 @@ DataType::DataType(const DataType& original) : H5Object(), id(original.id) ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2015 // Description -// Copying the type so that when a predefined type is passed in, -// a copy of it is made, not just a duplicate of the HDF5 id. -// Note: calling DataType::copy will invoke DataType::close() -// unnecessarily and will produce undefined behavior. -// -BMR, Apr 2015 +// Copying the type so that when a predefined type is passed in, +// a copy of it is made, not just a duplicate of the HDF5 id. +// Note: calling DataType::copy will invoke DataType::close() +// unnecessarily and will produce undefined behavior. +// -BMR, Apr 2015 //-------------------------------------------------------------------------- DataType::DataType(const PredType& pred_type) : H5Object() { // Call C routine to copy the datatype - id = H5Tcopy( pred_type.getId() ); + id = H5Tcopy(pred_type.getId()); if (id < 0) - throw DataTypeIException("DataType constructor", "H5Tcopy failed"); + throw DataTypeIException("DataType constructor", "H5Tcopy failed"); } //-------------------------------------------------------------------------- // Function: DataType overloaded constructor ///\brief Creates a DataType instance by opening an HDF5 datatype given -/// its name as a char*. +/// its name as a char*. ///\param dtype_name - IN: Datatype name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openDataType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openDataType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- DataType::DataType(const H5Location& loc, const char *dtype_name) : H5Object() { @@ -178,16 +178,16 @@ DataType::DataType(const H5Location& loc, const char *dtype_name) : H5Object() //-------------------------------------------------------------------------- // Function: DataType overloaded constructor -///\brief Creates a DataType instance by opening an HDF5 datatype given -/// its name as an \c H5std_string. +///\brief Creates a DataType instance by opening an HDF5 datatype given +/// its name as an \c H5std_string. ///\param dtype_name - IN: Datatype name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openDataType(const H5std_string&) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openDataType(const H5std_string&) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- DataType::DataType(const H5Location& loc, const H5std_string& dtype_name) : H5Object() { @@ -195,108 +195,108 @@ DataType::DataType(const H5Location& loc, const H5std_string& dtype_name) : H5Ob } //-------------------------------------------------------------------------- -// Function: DataType::copy -///\brief Copies an existing datatype to this datatype object -///\param like_type - IN: Datatype to be copied -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::copy +///\brief Copies an existing datatype to this datatype object +///\param like_type - IN: Datatype to be copied +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- -void DataType::copy( const DataType& like_type ) +void DataType::copy(const DataType& like_type) { // close the current data type before copying like_type to this object try { - close(); + close(); } catch (Exception& close_error) { - throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg()); + throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg()); } // call C routine to copy the datatype - id = H5Tcopy( like_type.getId() ); - if( id < 0 ) - throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); + id = H5Tcopy(like_type.getId()); + if (id < 0) + throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); } //-------------------------------------------------------------------------- -// Function: DataType::copy -///\brief Copies the datatype of the given dataset to this datatype object -///\param dset - IN: Dataset -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jan, 2007 +// Function: DataType::copy +///\brief Copies the datatype of the given dataset to this datatype object +///\param dset - IN: Dataset +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jan, 2007 ///\par Description -/// The resulted dataset will be transient and modifiable. +/// The resulted dataset will be transient and modifiable. //-------------------------------------------------------------------------- void DataType::copy(const DataSet& dset) { // close the current data type before copying dset's datatype to this object try { - close(); + close(); } catch (Exception& close_error) { - throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg()); + throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg()); } // call C routine to copy the datatype - id = H5Tcopy( dset.getId() ); - if( id < 0 ) - throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); + id = H5Tcopy(dset.getId()); + if (id < 0) + throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); } //-------------------------------------------------------------------------- -// Function: DataType::operator= -///\brief Assignment operator -///\param rhs - IN: Reference to the existing datatype -///\return Reference to DataType instance -///\exception H5::DataTypeIException +// Function: DataType::operator= +///\brief Assignment operator +///\param rhs - IN: Reference to the existing datatype +///\return Reference to DataType instance +///\exception H5::DataTypeIException // Description -// Makes a copy of the type on the right hand side and stores -// the new id in the left hand side object. -// Programmer Binh-Minh Ribler - 2000 +// Makes a copy of the type on the right hand side and stores +// the new id in the left hand side object. +// Programmer Binh-Minh Ribler - 2000 // Modification -// Changed operator= to simply copy the id of rhs instead of -// calling H5Tcopy because, when the operator= is invoked, a -// different datatype id is created and it won't have the same -// characteristics as the original one, specifically, if the -// rhs represents a named datatype, "this" would still be a -// transient datatype. -// BMR - Mar, 2015 +// Changed operator= to simply copy the id of rhs instead of +// calling H5Tcopy because, when the operator= is invoked, a +// different datatype id is created and it won't have the same +// characteristics as the original one, specifically, if the +// rhs represents a named datatype, "this" would still be a +// transient datatype. +// BMR - Mar, 2015 //-------------------------------------------------------------------------- -DataType& DataType::operator=( const DataType& rhs ) +DataType& DataType::operator=(const DataType& rhs) { if (this != &rhs) { - setId(rhs.id); + setId(rhs.id); } return(*this); } //-------------------------------------------------------------------------- -// Function: DataType::operator== -///\brief Compares this DataType against the given one to determines -/// whether the two objects refer to the same actual datatype. -///\param compared_type - IN: Reference to the datatype to compare -///\return true if the datatypes are equal, and false, otherwise. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::operator== +///\brief Compares this DataType against the given one to determines +/// whether the two objects refer to the same actual datatype. +///\param compared_type - IN: Reference to the datatype to compare +///\return true if the datatypes are equal, and false, otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -bool DataType::operator==(const DataType& compared_type ) const +bool DataType::operator==(const DataType& compared_type) const { - // Call C routine H5Tequal to determines whether two datatype - // identifiers refer to the same datatype - htri_t ret_value = H5Tequal( id, compared_type.getId() ); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else - { - throw DataTypeIException(inMemFunc("operator=="), "H5Tequal returns negative value"); - } + // Call C routine H5Tequal to determines whether two datatype + // identifiers refer to the same datatype + htri_t ret_value = H5Tequal(id, compared_type.getId()); + if (ret_value > 0) + return true; + else if (ret_value == 0) + return false; + else + { + throw DataTypeIException(inMemFunc("operator=="), "H5Tequal returns negative value"); + } } //-------------------------------------------------------------------------- @@ -306,69 +306,69 @@ bool DataType::operator==(const DataType& compared_type ) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// This function was introduced in 1.10.1 to be used by the new -// XxxType constructors that were introduced to replace the -// existing functions CommonFG::openXxxType(), which is awkward -// to use. -BMR, Dec 2016 +// This function was introduced in 1.10.1 to be used by the new +// XxxType constructors that were introduced to replace the +// existing functions CommonFG::openXxxType(), which is awkward +// to use. -BMR, Dec 2016 //-------------------------------------------------------------------------- hid_t DataType::p_opentype(const H5Location& loc, const char *dtype_name) const { // Call C function to open the named datatype at this location hid_t ret_value = H5Topen2(loc.getId(), dtype_name, H5P_DEFAULT); if (ret_value < 0) - throw DataTypeIException("DataType constructor", "H5Topen2 failed"); + throw DataTypeIException("DataType constructor", "H5Topen2 failed"); return(ret_value); } //-------------------------------------------------------------------------- -// Function: DataType::p_commit (private) -//\brief Commits a transient datatype to a file, creating a new -// named datatype -//\param loc_id - IN: The id of either a file, group, dataset, named -// datatype, or attribute. -//\param name - IN: Name of the datatype -//\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::p_commit (private) +//\brief Commits a transient datatype to a file, creating a new +// named datatype +//\param loc_id - IN: The id of either a file, group, dataset, named +// datatype, or attribute. +//\param name - IN: Name of the datatype +//\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 // Modification: -// Copied from DataType::commit and made into private function -// to be commonly used by several overloads of DataType::commit. -// BMR - Jan, 2007 +// Copied from DataType::commit and made into private function +// to be commonly used by several overloads of DataType::commit. +// BMR - Jan, 2007 //-------------------------------------------------------------------------- void DataType::p_commit(hid_t loc_id, const char* name) { - // Call C routine to commit the transient datatype - herr_t ret_value = H5Tcommit2(loc_id, name, id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if( ret_value < 0 ) - throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit2 failed"); + // Call C routine to commit the transient datatype + herr_t ret_value = H5Tcommit2(loc_id, name, id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (ret_value < 0) + throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit2 failed"); } //-------------------------------------------------------------------------- -// Function: DataType::commit -///\brief Commits a transient datatype to a file, creating a new -/// named datatype -///\param loc - IN: A location (file, dataset, datatype, or group) -///\param name - IN: Name of the datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jan, 2007 +// Function: DataType::commit +///\brief Commits a transient datatype to a file, creating a new +/// named datatype +///\param loc - IN: A location (file, dataset, datatype, or group) +///\param name - IN: Name of the datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jan, 2007 //-------------------------------------------------------------------------- void DataType::commit(const H5Location& loc, const char* name) { - p_commit(loc.getId(), name); + p_commit(loc.getId(), name); } //-------------------------------------------------------------------------- -// Function: DataType::commit -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Param loc - IN: A location (file, dataset, datatype, or group) -// Param name - IN: Name of the datatype -// Exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jan, 2007 +// Function: DataType::commit +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Param loc - IN: A location (file, dataset, datatype, or group) +// Param name - IN: Name of the datatype +// Exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jan, 2007 // Modification -// Planned for removal. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Planned for removal. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void DataType::commit(H5Location& loc, const char* name) //{ @@ -376,30 +376,30 @@ void DataType::commit(const H5Location& loc, const char* name) //} //-------------------------------------------------------------------------- -// Function: DataType::commit -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::commit +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of the +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::commit(const H5Location& loc, const H5std_string& name) { - p_commit(loc.getId(), name.c_str()); + p_commit(loc.getId(), name.c_str()); } //-------------------------------------------------------------------------- -// Function: DataType::commit -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Param loc - IN: A location (file, dataset, datatype, or group) -// Param name - IN: Name of the datatype -// Exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jan, 2007 +// Function: DataType::commit +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Param loc - IN: A location (file, dataset, datatype, or group) +// Param name - IN: Name of the datatype +// Exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jan, 2007 // Modification -// Planned for removal. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Planned for removal. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void DataType::commit(H5Location& loc, const H5std_string& name) //{ @@ -407,340 +407,340 @@ void DataType::commit(const H5Location& loc, const H5std_string& name) //} //-------------------------------------------------------------------------- -// Function: DataType::committed -///\brief Determines whether a datatype is a named type or a -/// transient type. -///\return \c true if the datatype is a named type, and \c false, -/// otherwise. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::committed +///\brief Determines whether a datatype is a named type or a +/// transient type. +///\return \c true if the datatype is a named type, and \c false, +/// otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DataType::committed() const { - // Call C function to determine if a datatype is a named one - htri_t is_committed = H5Tcommitted( id ); - if (is_committed > 0) - return true; - else if (is_committed == 0) - return false; - else - { - throw DataTypeIException(inMemFunc("committed"), "H5Tcommitted return negative value"); - } -} - -//-------------------------------------------------------------------------- -// Function: DataType::find -///\brief Finds a conversion function that can handle a conversion -/// from this datatype to the specified datatype, \a dest. -///\param dest - IN: Destination datatype -///\param pcdata - IN: Pointer to type conversion data -///\return Pointer to a suitable conversion function -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const -{ - // Call C routine to find the conversion function - H5T_conv_t func = H5Tfind( id, dest.getId(), pcdata ); - if( func == NULL ) - { - throw DataTypeIException(inMemFunc("find"), "H5Tfind returns a NULL function"); - } - return( func ); -} - -//-------------------------------------------------------------------------- -// Function: DataType::convert -///\brief Converts data from this datatype to the specified datatypes. -///\param dest - IN: Destination datatype -///\param nelmts - IN: Size of array \a buf -///\param buf - IN/OUT: Array containing pre- and post-conversion -/// values -///\param background - IN: Optional backgroud buffer -///\param plist - IN: Property list - default to PropList::DEFAULT -///\return Pointer to a suitable conversion function -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void DataType::convert( const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist ) const -{ - // Get identifiers for C API - hid_t dest_id = dest.getId(); - hid_t plist_id = plist.getId(); - - // Call C routine H5Tconvert to convert the data - herr_t ret_value; - ret_value = H5Tconvert( id, dest_id, nelmts, buf, background, plist_id ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("convert"), "H5Tconvert failed"); - } -} - -//-------------------------------------------------------------------------- -// Function: DataType::lock -///\brief Locks a datatype, making it read-only and non-destructible. + // Call C function to determine if a datatype is a named one + htri_t is_committed = H5Tcommitted(id); + if (is_committed > 0) + return true; + else if (is_committed == 0) + return false; + else + { + throw DataTypeIException(inMemFunc("committed"), "H5Tcommitted return negative value"); + } +} + +//-------------------------------------------------------------------------- +// Function: DataType::find +///\brief Finds a conversion function that can handle a conversion +/// from this datatype to the specified datatype, \a dest. +///\param dest - IN: Destination datatype +///\param pcdata - IN: Pointer to type conversion data +///\return Pointer to a suitable conversion function +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +H5T_conv_t DataType::find(const DataType& dest, H5T_cdata_t **pcdata) const +{ + // Call C routine to find the conversion function + H5T_conv_t func = H5Tfind(id, dest.getId(), pcdata); + if (func == NULL) + { + throw DataTypeIException(inMemFunc("find"), "H5Tfind returns a NULL function"); + } + return(func); +} + +//-------------------------------------------------------------------------- +// Function: DataType::convert +///\brief Converts data from this datatype to the specified datatypes. +///\param dest - IN: Destination datatype +///\param nelmts - IN: Size of array \a buf +///\param buf - IN/OUT: Array containing pre- and post-conversion +/// values +///\param background - IN: Optional backgroud buffer +///\param plist - IN: Property list - default to PropList::DEFAULT +///\return Pointer to a suitable conversion function +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DataType::convert(const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist) const +{ + // Get identifiers for C API + hid_t dest_id = dest.getId(); + hid_t plist_id = plist.getId(); + + // Call C routine H5Tconvert to convert the data + herr_t ret_value; + ret_value = H5Tconvert(id, dest_id, nelmts, buf, background, plist_id); + if (ret_value < 0) + { + throw DataTypeIException(inMemFunc("convert"), "H5Tconvert failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: DataType::lock +///\brief Locks a datatype, making it read-only and non-destructible. /// -///\exception H5::DataTypeIException +///\exception H5::DataTypeIException ///\par Descrition -/// This is normally done by the library for predefined data -/// types so the application doesn't inadvertently change or -/// delete a predefined type. +/// This is normally done by the library for predefined data +/// types so the application doesn't inadvertently change or +/// delete a predefined type. /// -/// Once a data type is locked it can never be unlocked unless -/// the entire library is closed. -// Programmer Binh-Minh Ribler - 2000 +/// Once a data type is locked it can never be unlocked unless +/// the entire library is closed. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::lock() const { - // Call C routine to lock the datatype - herr_t ret_value = H5Tlock( id ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("lock"), "H5Tlock failed"); - } + // Call C routine to lock the datatype + herr_t ret_value = H5Tlock(id); + if (ret_value < 0) + { + throw DataTypeIException(inMemFunc("lock"), "H5Tlock failed"); + } } //-------------------------------------------------------------------------- -// Function: DataType::getClass -///\brief Returns the datatype class identifier. -///\return Datatype class identifier -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::getClass +///\brief Returns the datatype class identifier. +///\return Datatype class identifier +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_class_t DataType::getClass() const { - H5T_class_t type_class = H5Tget_class( id ); + H5T_class_t type_class = H5Tget_class(id); - // Return datatype class identifier if successful - if( type_class == H5T_NO_CLASS ) - { - throw DataTypeIException(inMemFunc("getClass"), "H5Tget_class returns H5T_NO_CLASS"); - } - return( type_class ); + // Return datatype class identifier if successful + if (type_class == H5T_NO_CLASS) + { + throw DataTypeIException(inMemFunc("getClass"), "H5Tget_class returns H5T_NO_CLASS"); + } + return(type_class); } //-------------------------------------------------------------------------- -// Function: DataType::getSize -///\brief Returns the size of a datatype. -///\return Datatype size in bytes -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::getSize +///\brief Returns the size of a datatype. +///\return Datatype size in bytes +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- size_t DataType::getSize() const { - // Call C routine to get the datatype size - size_t type_size = H5Tget_size( id ); - if( type_size <= 0 ) // valid data types are never zero size - { - throw DataTypeIException(inMemFunc("getSize"), "H5Tget_size returns invalid datatype size"); - } - return( type_size ); + // Call C routine to get the datatype size + size_t type_size = H5Tget_size(id); + if (type_size <= 0) // valid data types are never zero size + { + throw DataTypeIException(inMemFunc("getSize"), "H5Tget_size returns invalid datatype size"); + } + return(type_size); } //-------------------------------------------------------------------------- -// Function: DataType::getSuper -///\brief Returns the base datatype from which a datatype is derived. -///\return DataType object -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::getSuper +///\brief Returns the base datatype from which a datatype is derived. +///\return DataType object +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType DataType::getSuper() const { - // Call C routine to get the base datatype from which the specified - // datatype is derived. - hid_t base_type_id = H5Tget_super( id ); - - // If H5Tget_super returns a valid datatype id, create and return - // the base type, otherwise, raise exception - if( base_type_id > 0 ) - { - DataType base_type; - base_type.p_setId(base_type_id); - return(base_type); - } - else - { - throw DataTypeIException(inMemFunc("getSuper"), "H5Tget_super failed"); - } -} - -//-------------------------------------------------------------------------- -// Function: DataType::registerFunc -///\brief Registers the specified conversion function. -///\param pers - IN: Conversion option -/// \li \c H5T_PERS_HARD for hard conversion functions -/// \li \c H5T_PERS_SOFT for soft conversion functions. -///\param name - IN: Name displayed in diagnostic output. -///\param dest - IN: Destination datatype. -///\param func - IN: Function to convert between source and -/// destination datatypes. -///\exception H5::DataTypeIException + // Call C routine to get the base datatype from which the specified + // datatype is derived. + hid_t base_type_id = H5Tget_super(id); + + // If H5Tget_super returns a valid datatype id, create and return + // the base type, otherwise, raise exception + if (base_type_id > 0) + { + DataType base_type; + base_type.p_setId(base_type_id); + return(base_type); + } + else + { + throw DataTypeIException(inMemFunc("getSuper"), "H5Tget_super failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: DataType::registerFunc +///\brief Registers the specified conversion function. +///\param pers - IN: Conversion option +/// \li \c H5T_PERS_HARD for hard conversion functions +/// \li \c H5T_PERS_SOFT for soft conversion functions. +///\param name - IN: Name displayed in diagnostic output. +///\param dest - IN: Destination datatype. +///\param func - IN: Function to convert between source and +/// destination datatypes. +///\exception H5::DataTypeIException ///\par Description -/// For more information, please see: +/// For more information, please see: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-Register -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const +void DataType::registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const { - hid_t dest_id = dest.getId(); // get id of the destination datatype + hid_t dest_id = dest.getId(); // get id of the destination datatype - // Call C routine H5Tregister to register the conversion function - herr_t ret_value = H5Tregister( pers, name, id, dest_id, func ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("registerFunc"), "H5Tregister failed"); - } + // Call C routine H5Tregister to register the conversion function + herr_t ret_value = H5Tregister(pers, name, id, dest_id, func); + if (ret_value < 0) + { + throw DataTypeIException(inMemFunc("registerFunc"), "H5Tregister failed"); + } } //-------------------------------------------------------------------------- -// Function: DataType::registerFunc -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::registerFunc +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of the +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::registerFunc( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const +void DataType::registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const { - registerFunc( pers, name.c_str(), dest, func ); + registerFunc(pers, name.c_str(), dest, func); } //-------------------------------------------------------------------------- -// Function: DataType::unregister -///\brief Removes a conversion function from all conversion paths. -///\param pers - IN: Conversion option -/// \li \c H5T_PERS_HARD for hard conversion functions -/// \li \c H5T_PERS_SOFT for soft conversion functions. -///\param name - IN: Name displayed in diagnostic output. -///\param dest - IN: Destination datatype. -///\param func - IN: Function to convert between source and -/// destination datatypes. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::unregister +///\brief Removes a conversion function from all conversion paths. +///\param pers - IN: Conversion option +/// \li \c H5T_PERS_HARD for hard conversion functions +/// \li \c H5T_PERS_SOFT for soft conversion functions. +///\param name - IN: Name displayed in diagnostic output. +///\param dest - IN: Destination datatype. +///\param func - IN: Function to convert between source and +/// destination datatypes. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const +void DataType::unregister(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const { - hid_t dest_id = dest.getId(); // get id of the dest datatype for C API + hid_t dest_id = dest.getId(); // get id of the dest datatype for C API - // Call C routine H5Tunregister to remove the conversion function - herr_t ret_value = H5Tunregister( pers, name, id, dest_id, func ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("unregister"), "H5Tunregister failed"); - } + // Call C routine H5Tunregister to remove the conversion function + herr_t ret_value = H5Tunregister(pers, name, id, dest_id, func); + if (ret_value < 0) + { + throw DataTypeIException(inMemFunc("unregister"), "H5Tunregister failed"); + } } //-------------------------------------------------------------------------- -// Function: DataType::unregister -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::unregister +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of the +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::unregister( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const +void DataType::unregister(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const { - unregister( pers, name.c_str(), dest, func ); + unregister(pers, name.c_str(), dest, func); } //-------------------------------------------------------------------------- -// Function: DataType::setTag -///\brief Tags an opaque datatype. -///\param tag - IN: Descriptive ASCII string with which the opaque -/// datatype is to be tagged. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::setTag +///\brief Tags an opaque datatype. +///\param tag - IN: Descriptive ASCII string with which the opaque +/// datatype is to be tagged. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::setTag( const char* tag ) const +void DataType::setTag(const char* tag) const { - // Call C routine H5Tset_tag to tag an opaque datatype. - herr_t ret_value = H5Tset_tag( id, tag ); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("setTag"), "H5Tset_tag failed"); - } + // Call C routine H5Tset_tag to tag an opaque datatype. + herr_t ret_value = H5Tset_tag(id, tag); + if (ret_value < 0) + { + throw DataTypeIException(inMemFunc("setTag"), "H5Tset_tag failed"); + } } //-------------------------------------------------------------------------- -// Function: DataType::setTag -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::setTag +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of the +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::setTag( const H5std_string& tag ) const +void DataType::setTag(const H5std_string& tag) const { - setTag( tag.c_str()); + setTag(tag.c_str()); } //-------------------------------------------------------------------------- -// Function: DataType::getTag -///\brief Gets the tag associated with an opaque datatype. -///\return Tag associated with the opaque datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::getTag +///\brief Gets the tag associated with an opaque datatype. +///\return Tag associated with the opaque datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string DataType::getTag() const { - char* tag_Cstr = H5Tget_tag( id ); + char* tag_Cstr = H5Tget_tag(id); // if the tag C-string returned is not NULL, convert it to C++ string // and return it, otherwise, raise an exception - if( tag_Cstr != NULL ) + if (tag_Cstr != NULL) { - H5std_string tag = H5std_string(tag_Cstr); // C string to string object - H5free_memory(tag_Cstr); // free the C string - return (tag); // return the tag + H5std_string tag = H5std_string(tag_Cstr); // C string to string object + H5free_memory(tag_Cstr); // free the C string + return (tag); // return the tag } else { - throw DataTypeIException(inMemFunc("getTag"), "H5Tget_tag returns NULL for tag"); + throw DataTypeIException(inMemFunc("getTag"), "H5Tget_tag returns NULL for tag"); } } //-------------------------------------------------------------------------- -// Function: DataType::detectClass -///\brief Checks whether a datatype contains (or is) a certain type of -/// datatype. -///\return true if this datatype contains or is the specified type, -/// and false, otherwise. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: DataType::detectClass +///\brief Checks whether a datatype contains (or is) a certain type of +/// datatype. +///\return true if this datatype contains or is the specified type, +/// and false, otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- bool DataType::detectClass(H5T_class_t cls) const { - htri_t ret_value = H5Tdetect_class(id, cls); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else - { - throw DataTypeIException(inMemFunc("detectClass"), - "H5Tdetect_class returns negative value"); - } + htri_t ret_value = H5Tdetect_class(id, cls); + if (ret_value > 0) + return true; + else if (ret_value == 0) + return false; + else + { + throw DataTypeIException(inMemFunc("detectClass"), + "H5Tdetect_class returns negative value"); + } } //-------------------------------------------------------------------------- -// Function: DataType::isVariableStr -///\brief Check whether this datatype is a variable-length string. -///\return true if this datatype is a variable-length string, and -/// false, otherwise. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: DataType::isVariableStr +///\brief Check whether this datatype is a variable-length string. +///\return true if this datatype is a variable-length string, and +/// false, otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- bool DataType::isVariableStr() const { - htri_t is_varlen_str = H5Tis_variable_str(id); - if( is_varlen_str == 1 ) - return true; - else if( is_varlen_str == 0 ) - return false; - else - { - throw DataTypeIException(inMemFunc("isVariableStr"), - "H5Tis_variable_str returns negative value"); - } + htri_t is_varlen_str = H5Tis_variable_str(id); + if (is_varlen_str == 1) + return true; + else if (is_varlen_str == 0) + return false; + else + { + throw DataTypeIException(inMemFunc("isVariableStr"), + "H5Tis_variable_str returns negative value"); + } } //-------------------------------------------------------------------------- @@ -757,7 +757,7 @@ bool DataType::isVariableStr() const //-------------------------------------------------------------------------- hid_t DataType::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -782,58 +782,58 @@ void DataType::p_setId(const hid_t new_id) catch (Exception& close_error) { throw DataTypeIException(inMemFunc("p_setId"), close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataType::close -///\brief Closes the datatype if it is not a predefined type. +// Function: DataType::close +///\brief Closes the datatype if it is not a predefined type. /// -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void DataType::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Tclose(id); - if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("close"), "H5Tclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Tclose(id); + if (ret_value < 0) + { + throw DataTypeIException(inMemFunc("close"), "H5Tclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: DataType destructor -///\brief Properly terminates access to this datatype. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType destructor +///\brief Properly terminates access to this datatype. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 -// - Added the use of H5CPP_EXITED to terminate the HDF5 library -// and elimiate previous memory leaks. See comments in the -// header file "H5PredType.h" for details. - BMR, Mar 30, 2012 -// - Major re-implementation of the global constants was done -// to avoid relying on the order of the creation and deletion -// of the global constants. Hence, H5CPP_EXITED was removed. -// See Design Notes in "H5PredType.cpp" for details. -// - BMR, Sep 30, 2015 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 +// - Added the use of H5CPP_EXITED to terminate the HDF5 library +// and elimiate previous memory leaks. See comments in the +// header file "H5PredType.h" for details. - BMR, Mar 30, 2012 +// - Major re-implementation of the global constants was done +// to avoid relying on the order of the creation and deletion +// of the global constants. Hence, H5CPP_EXITED was removed. +// See Design Notes in "H5PredType.cpp" for details. +// - BMR, Sep 30, 2015 //-------------------------------------------------------------------------- DataType::~DataType() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl; + cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl; } } } // end namespace diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 4e904a6..fd9c17d 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -30,128 +30,128 @@ namespace H5 { */ class H5_DLLCPP DataType : public H5Object { public: - // Creates a datatype given its class and size - DataType( const H5T_class_t type_class, size_t size ); + // Creates a datatype given its class and size + DataType(const H5T_class_t type_class, size_t size); - // Copy constructor: makes a copy of the original object - DataType( const DataType& original ); + // Copy constructor: makes a copy of the original object + DataType(const DataType& original); - // Creates a copy of a predefined type - DataType(const PredType& pred_type); + // Creates a copy of a predefined type + DataType(const PredType& pred_type); - // Creates a datatype by way of dereference. - DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); -// DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + // Creates a datatype by way of dereference. + DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); +// DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); - // Closes this datatype. - virtual void close(); + // Closes this datatype. + virtual void close(); - // Copies an existing datatype to this datatype object. - void copy(const DataType& like_type); + // Copies an existing datatype to this datatype object. + void copy(const DataType& like_type); - // Copies the datatype of dset to this datatype object. - void copy(const DataSet& dset); + // Copies the datatype of dset to this datatype object. + void copy(const DataSet& dset); - // Returns the datatype class identifier. - H5T_class_t getClass() const; + // Returns the datatype class identifier. + H5T_class_t getClass() const; - // Commits a transient datatype to a file; this datatype becomes - // a named datatype which can be accessed from the location. - void commit(const H5Location& loc, const char* name); - void commit(const H5Location& loc, const H5std_string& name); + // Commits a transient datatype to a file; this datatype becomes + // a named datatype which can be accessed from the location. + void commit(const H5Location& loc, const char* name); + void commit(const H5Location& loc, const H5std_string& name); - // These two overloaded functions are kept for backward compatibility - // only; they missed the const - removed from 1.8.18 and 1.10.1 - //void commit(H5Location& loc, const char* name); - //void commit(H5Location& loc, const H5std_string& name); + // These two overloaded functions are kept for backward compatibility + // only; they missed the const - removed from 1.8.18 and 1.10.1 + //void commit(H5Location& loc, const char* name); + //void commit(H5Location& loc, const H5std_string& name); - // Determines whether this datatype is a named datatype or - // a transient datatype. - bool committed() const; + // Determines whether this datatype is a named datatype or + // a transient datatype. + bool committed() const; // Finds a conversion function that can handle the conversion // this datatype to the given datatype, dest. - H5T_conv_t find( const DataType& dest, H5T_cdata_t **pcdata ) const; + H5T_conv_t find(const DataType& dest, H5T_cdata_t **pcdata) const; - // Converts data from between specified datatypes. - void convert( const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist=PropList::DEFAULT) const; + // Converts data from between specified datatypes. + void convert(const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist=PropList::DEFAULT) const; - // Assignment operator - DataType& operator=( const DataType& rhs ); + // Assignment operator + DataType& operator=(const DataType& rhs); - // Determines whether two datatypes are the same. - bool operator==(const DataType& compared_type ) const; + // Determines whether two datatypes are the same. + bool operator==(const DataType& compared_type) const; - // Locks a datatype. - void lock() const; + // Locks a datatype. + void lock() const; - // Returns the size of a datatype. - size_t getSize() const; + // Returns the size of a datatype. + size_t getSize() const; - // Returns the base datatype from which a datatype is derived. - // Note: not quite right for specific types yet??? - DataType getSuper() const; + // Returns the base datatype from which a datatype is derived. + // Note: not quite right for specific types yet??? + DataType getSuper() const; - // Registers a conversion function. - void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; - void registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const; + // Registers a conversion function. + void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const; + void registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const; - // Removes a conversion function from all conversion paths. - void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; - void unregister( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const; + // Removes a conversion function from all conversion paths. + void unregister(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const; + void unregister(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const; - // Tags an opaque datatype. - void setTag( const char* tag ) const; - void setTag( const H5std_string& tag ) const; + // Tags an opaque datatype. + void setTag(const char* tag) const; + void setTag(const H5std_string& tag) const; - // Gets the tag associated with an opaque datatype. - H5std_string getTag() const; + // Gets the tag associated with an opaque datatype. + H5std_string getTag() const; - // Checks whether this datatype contains (or is) a certain type class. - bool detectClass(H5T_class_t cls) const; + // Checks whether this datatype contains (or is) a certain type class. + bool detectClass(H5T_class_t cls) const; - // Checks whether this datatype is a variable-length string. - bool isVariableStr() const; + // Checks whether this datatype is a variable-length string. + bool isVariableStr() const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DataType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DataType"); } // From CommonFG then H5Location - // Constructors to open a generic named datatype at a given location. - DataType(const H5Location& loc, const char* name); - DataType(const H5Location& loc, const H5std_string& name); + // Constructors to open a generic named datatype at a given location. + DataType(const H5Location& loc, const char* name); + DataType(const H5Location& loc, const H5std_string& name); // End of From CommonFG then H5Location - // Creates a copy of an existing DataType using its id - DataType( const hid_t type_id ); + // Creates a copy of an existing DataType using its id + DataType(const hid_t type_id); - // Default constructor - DataType(); + // Default constructor + DataType(); - // Gets the datatype id. - virtual hid_t getId() const; + // Gets the datatype id. + virtual hid_t getId() const; - // Destructor: properly terminates access to this datatype. - virtual ~DataType(); + // Destructor: properly terminates access to this datatype. + virtual ~DataType(); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - hid_t id; // HDF5 datatype id + hid_t id; // HDF5 datatype id - // Sets the datatype id. - virtual void p_setId(const hid_t new_id); + // Sets the datatype id. + virtual void p_setId(const hid_t new_id); - // Opens a datatype and returns the id. - hid_t p_opentype(const H5Location& loc, const char* dtype_name) const; + // Opens a datatype and returns the id. + hid_t p_opentype(const H5Location& loc, const char* dtype_name) const; #endif // DOXYGEN_SHOULD_SKIP_THIS private: - // Friend function to set DataType id. For library use only. - friend void f_DataType_setId(DataType* dtype, hid_t new_id); + // Friend function to set DataType id. For library use only. + friend void f_DataType_setId(DataType* dtype, hid_t new_id); - void p_commit(hid_t loc_id, const char* name); + void p_commit(hid_t loc_id, const char* name); }; } #endif // __H5DataType_H diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 8ab38dc..86d4d9c 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -40,7 +40,7 @@ DSetCreatPropList* DSetCreatPropList::DEFAULT_ = 0; // Function: DSetCreatPropList::getConstant // Purpose: Creates a DSetCreatPropList object representing the HDF5 // constant H5P_DATASET_CREATE, pointed to by -// DSetCreatPropList::DEFAULT_ +// DSetCreatPropList::DEFAULT_ // exception H5::PropListIException // Description // If DSetCreatPropList::DEFAULT_ already points to an allocated @@ -80,670 +80,670 @@ void DSetCreatPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for dataset creation default property +// Purpose Constant for dataset creation default property //-------------------------------------------------------------------------- const DSetCreatPropList& DSetCreatPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DSetCreatPropList default constructor -///\brief Default constructor: creates a stub dataset creation property list -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList default constructor +///\brief Default constructor: creates a stub dataset creation property list +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList::DSetCreatPropList() : ObjCreatPropList(H5P_DATASET_CREATE) {} //-------------------------------------------------------------------------- -// Function: DSetCreatPropList copy constructor -///\brief Copy constructor: makes a copy of the original -/// DSetCreatPropList object -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList copy constructor +///\brief Copy constructor: makes a copy of the original +/// DSetCreatPropList object +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DSetCreatPropList::DSetCreatPropList( const DSetCreatPropList& orig ) : ObjCreatPropList(orig) {} +DSetCreatPropList::DSetCreatPropList(const DSetCreatPropList& orig) : ObjCreatPropList(orig) {} //-------------------------------------------------------------------------- -// Function: DSetCreatPropList overloaded constructor -///\brief Creates a DSetCreatPropList object using the id of an -/// existing dataset creation property list. -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList overloaded constructor +///\brief Creates a DSetCreatPropList object using the id of an +/// existing dataset creation property list. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList::DSetCreatPropList(const hid_t plist_id) : ObjCreatPropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setChunk -///\brief Sets the size of the chunks used to store a chunked layout -/// dataset. -///\param ndims - IN: Number of dimensions of each chunk -///\param dim - IN: Array containing the size of each chunk -///\exception H5::PropListIException +// Function: DSetCreatPropList::setChunk +///\brief Sets the size of the chunks used to store a chunked layout +/// dataset. +///\param ndims - IN: Number of dimensions of each chunk +///\param dim - IN: Array containing the size of each chunk +///\exception H5::PropListIException ///\par Description -/// The \a ndims parameter currently must have the same value as -/// the rank of the dataset. The values of the \a dim array -/// define the size of the chunks to store the dataset's raw -/// data. As a side-effect, the layout of the dataset will be -/// changed to \c H5D_CHUNKED, if it is not so already. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const +/// The \a ndims parameter currently must have the same value as +/// the rank of the dataset. The values of the \a dim array +/// define the size of the chunks to store the dataset's raw +/// data. As a side-effect, the layout of the dataset will be +/// changed to \c H5D_CHUNKED, if it is not so already. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DSetCreatPropList::setChunk(int ndims, const hsize_t* dim) const { - herr_t ret_value = H5Pset_chunk( id, ndims, dim ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setChunk", "H5Pset_chunk failed"); - } + herr_t ret_value = H5Pset_chunk(id, ndims, dim); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setChunk", "H5Pset_chunk failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getChunk -///\brief Retrieves the size of the chunks used to store a chunked -/// layout dataset. -///\param max_ndims - IN: Size of \a dim array -///\param dim - OUT: Array to store the chunk dimensions -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::getChunk +///\brief Retrieves the size of the chunks used to store a chunked +/// layout dataset. +///\param max_ndims - IN: Size of \a dim array +///\param dim - OUT: Array to store the chunk dimensions +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const +int DSetCreatPropList::getChunk(int max_ndims, hsize_t* dim) const { - int chunk_size = H5Pget_chunk( id, max_ndims, dim ); - if( chunk_size < 0 ) - { - throw PropListIException("DSetCreatPropList::getChunk", - "H5Pget_chunk returns negative chunk size"); - } - return( chunk_size ); + int chunk_size = H5Pget_chunk(id, max_ndims, dim); + if (chunk_size < 0) + { + throw PropListIException("DSetCreatPropList::getChunk", + "H5Pget_chunk returns negative chunk size"); + } + return(chunk_size); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setLayout -///\brief Sets the type of storage used store the raw data for a dataset. -///\param layout - IN: Type of storage layout for raw data -///\exception H5::PropListIException +// Function: DSetCreatPropList::setLayout +///\brief Sets the type of storage used store the raw data for a dataset. +///\param layout - IN: Type of storage layout for raw data +///\exception H5::PropListIException ///\par Description -/// For information on valid layout types, please refer to +/// For information on valid layout types, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLayout -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setLayout(H5D_layout_t layout) const { - herr_t ret_value = H5Pset_layout( id, layout ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setLayout", - "H5Pset_layout failed"); - } + herr_t ret_value = H5Pset_layout(id, layout); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setLayout", + "H5Pset_layout failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getLayout -///\brief Retrieves the layout type of this property list -///\return Layout type, which can be: -/// \li \c H5D_COMPACT - raw data is stored in the object -/// header in the file. -/// \li \c H5D_CONTIGUOUS - raw data is stored separately from the -/// object header in one contiguous chunk in -/// the file. -/// \li \c H5D_CHUNKED - raw data is stored separately from the -/// object header in chunks in separate locations -/// in the file. -///\exception H5::PropListIException +// Function: DSetCreatPropList::getLayout +///\brief Retrieves the layout type of this property list +///\return Layout type, which can be: +/// \li \c H5D_COMPACT - raw data is stored in the object +/// header in the file. +/// \li \c H5D_CONTIGUOUS - raw data is stored separately from the +/// object header in one contiguous chunk in +/// the file. +/// \li \c H5D_CHUNKED - raw data is stored separately from the +/// object header in chunks in separate locations +/// in the file. +///\exception H5::PropListIException ///\par Description -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_layout_t DSetCreatPropList::getLayout() const { - H5D_layout_t layout = H5Pget_layout( id ); - if( layout == H5D_LAYOUT_ERROR ) - { - throw PropListIException("DSetCreatPropList::getLayout", - "H5Pget_layout returns H5D_LAYOUT_ERROR"); - } - return( layout ); + H5D_layout_t layout = H5Pget_layout(id); + if (layout == H5D_LAYOUT_ERROR) + { + throw PropListIException("DSetCreatPropList::getLayout", + "H5Pget_layout returns H5D_LAYOUT_ERROR"); + } + return(layout); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setDeflate -///\brief Sets compression method and compression level -///\param level - IN: Compression level, should [0..9], inclusive -///\exception H5::PropListIException +// Function: DSetCreatPropList::setDeflate +///\brief Sets compression method and compression level +///\param level - IN: Compression level, should [0..9], inclusive +///\exception H5::PropListIException ///\par Description -/// The function sets the compression method for this property -/// list to \c H5D_COMPRESS_DEFLATE and the compression level to -/// \a level. Lower compression levels are faster but result in -/// less compression. -// Programmer Binh-Minh Ribler - 2000 +/// The function sets the compression method for this property +/// list to \c H5D_COMPRESS_DEFLATE and the compression level to +/// \a level. Lower compression levels are faster but result in +/// less compression. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::setDeflate( int level ) const +void DSetCreatPropList::setDeflate(int level) const { - herr_t ret_value = H5Pset_deflate( id, level ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setDeflate", - "H5Pset_deflate failed"); - } + herr_t ret_value = H5Pset_deflate(id, level); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setDeflate", + "H5Pset_deflate failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setSzip -///\brief Sets up for the use of the SZIP compression filter. -///\param options_mask - IN: A bit-mask conveying the desired SZIP -/// options. Valid values are H5_SZIP_EC_OPTION_MASK -/// and H5_SZIP_NN_OPTION_MASK. -///\param pixels_per_block - IN: Number of pixels or data elements in -/// each data block. -///\exception H5::PropListIException +// Function: DSetCreatPropList::setSzip +///\brief Sets up for the use of the SZIP compression filter. +///\param options_mask - IN: A bit-mask conveying the desired SZIP +/// options. Valid values are H5_SZIP_EC_OPTION_MASK +/// and H5_SZIP_NN_OPTION_MASK. +///\param pixels_per_block - IN: Number of pixels or data elements in +/// each data block. +///\exception H5::PropListIException ///\par Description -/// The associate C function sets an SZIP compression filter, -/// H5Z_FILTER_SZIP, for a dataset. For more information about -/// SZIP and usage, please refer to the C layer Reference -/// Manual at: +/// The associate C function sets an SZIP compression filter, +/// H5Z_FILTER_SZIP, for a dataset. For more information about +/// SZIP and usage, please refer to the C layer Reference +/// Manual at: /// http://hdfgroup.org/HDF5/doc/RM_H5P.html#Property-SetSzip -// Programmer Binh-Minh Ribler - Jan, 2007 +// Programmer Binh-Minh Ribler - Jan, 2007 //-------------------------------------------------------------------------- void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_per_block) const { herr_t ret_value = H5Pset_szip(id, options_mask, pixels_per_block); - if( ret_value < 0 ) + if (ret_value < 0) { - throw PropListIException("DSetCreatPropList::setSzip", - "H5Pset_szip failed"); + throw PropListIException("DSetCreatPropList::setSzip", + "H5Pset_szip failed"); } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setNbit -///\brief Sets up for the use of the Nbit compression filter. -///\exception H5::PropListIException +// Function: DSetCreatPropList::setNbit +///\brief Sets up for the use of the Nbit compression filter. +///\exception H5::PropListIException ///\par Description -/// The associate C function sets an Nbit compression filter, -/// H5Z_FILTER_NBIT, for a dataset. For more information about -/// Nbit compression, please refer to the C layer Reference -/// Manual at: +/// The associate C function sets an Nbit compression filter, +/// H5Z_FILTER_NBIT, for a dataset. For more information about +/// Nbit compression, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-setNbit -// Programmer Binh-Minh Ribler - Apr, 2016 +// Programmer Binh-Minh Ribler - Apr, 2016 //-------------------------------------------------------------------------- void DSetCreatPropList::setNbit() const { herr_t ret_value = H5Pset_nbit(id); - if( ret_value < 0 ) + if (ret_value < 0) { - throw PropListIException("DSetCreatPropList::setNbit", - "H5Pset_nbit failed"); + throw PropListIException("DSetCreatPropList::setNbit", + "H5Pset_nbit failed"); } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFillValue -///\brief Sets a dataset fill value -///\param fvalue_type - IN: Data type for the value passed via \a value -///\param value - IN: Pointer to buffer containing the fill value -///\exception H5::PropListIException +// Function: DSetCreatPropList::setFillValue +///\brief Sets a dataset fill value +///\param fvalue_type - IN: Data type for the value passed via \a value +///\param value - IN: Pointer to buffer containing the fill value +///\exception H5::PropListIException ///\par Description -/// The datatype may differ from that of the dataset, but it must -/// be one that the HDF5 library is able to convert \a value to -/// the dataset datatype when the dataset is created. -/// The default fill value is 0 (zero,) which is interpreted -/// according to the actual dataset datatype. +/// The datatype may differ from that of the dataset, but it must +/// be one that the HDF5 library is able to convert \a value to +/// the dataset datatype when the dataset is created. +/// The default fill value is 0 (zero,) which is interpreted +/// according to the actual dataset datatype. ///\par -/// For information on setting fill value, please refer to the -/// C layer Reference Manual at: +/// For information on setting fill value, please refer to the +/// C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFillValue -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::setFillValue( const DataType& fvalue_type, const void* value ) const +void DSetCreatPropList::setFillValue(const DataType& fvalue_type, const void* value) const { - herr_t ret_value = H5Pset_fill_value( id, fvalue_type.getId(), value ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setFillValue", + herr_t ret_value = H5Pset_fill_value(id, fvalue_type.getId(), value); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setFillValue", "H5Pset_fill_value failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFillValue -///\brief Retrieves a dataset fill value -///\param fvalue_type - IN: Data type for the value passed via \a value -///\param value - OUT: Pointer to buffer to hold the retrieved fill value -///\exception H5::PropListIException +// Function: DSetCreatPropList::getFillValue +///\brief Retrieves a dataset fill value +///\param fvalue_type - IN: Data type for the value passed via \a value +///\param value - OUT: Pointer to buffer to hold the retrieved fill value +///\exception H5::PropListIException ///\par Description -/// The fill value is returned through \a value pointer -/// and the memory is allocated by the caller. The fill -/// value will be converted from its current data type to the -/// specified by \a fvalue_type. -// Programmer Binh-Minh Ribler - 2000 +/// The fill value is returned through \a value pointer +/// and the memory is allocated by the caller. The fill +/// value will be converted from its current data type to the +/// specified by \a fvalue_type. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value ) const +void DSetCreatPropList::getFillValue(const DataType& fvalue_type, void* value) const { - herr_t ret_value = H5Pget_fill_value( id, fvalue_type.getId(), value ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::getFillValue", + herr_t ret_value = H5Pget_fill_value(id, fvalue_type.getId(), value); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::getFillValue", "H5Pget_fill_value failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::isFillValueDefined -///\brief Check if fill value has been defined for this property +// Function: DSetCreatPropList::isFillValueDefined +///\brief Check if fill value has been defined for this property ///\return -/// \li \c H5D_FILL_VALUE_UNDEFINED =0, -/// \li \c H5D_FILL_VALUE_DEFAULT =1, -/// \li \c H5D_FILL_VALUE_USER_DEFINED =2 -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +/// \li \c H5D_FILL_VALUE_UNDEFINED =0, +/// \li \c H5D_FILL_VALUE_DEFAULT =1, +/// \li \c H5D_FILL_VALUE_USER_DEFINED =2 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_fill_value_t DSetCreatPropList::isFillValueDefined() const { - H5D_fill_value_t status; - herr_t ret_value = H5Pfill_value_defined(id, &status); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::isFillValueDefined", + H5D_fill_value_t status; + herr_t ret_value = H5Pfill_value_defined(id, &status); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::isFillValueDefined", "H5Pfill_value_defined returned H5D_FILL_VALUE_ERROR (-1)"); - } - else - return (status); + } + else + return (status); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFilter -///\brief Adds a filter to the filter pipeline -///\param filter_id - IN: Filter to add -///\param flags - IN: Specifies general properties of the filter -///\param cd_nelmts - IN: Number of elements in cd_values -///\param cd_values - IN: Auxiliary data for the filter -///\exception H5::PropListIException +// Function: DSetCreatPropList::setFilter +///\brief Adds a filter to the filter pipeline +///\param filter_id - IN: Filter to add +///\param flags - IN: Specifies general properties of the filter +///\param cd_nelmts - IN: Number of elements in cd_values +///\param cd_values - IN: Auxiliary data for the filter +///\exception H5::PropListIException ///\par Description -/// The \a flags argument is a bit vector of the field: -/// \c H5Z_FLAG_OPTIONAL(0x0001) +/// The \a flags argument is a bit vector of the field: +/// \c H5Z_FLAG_OPTIONAL(0x0001) ///\par -/// If this bit is set then the filter is optional. If the filter -/// fails during a \c DataSet::write() operation then the filter -/// is just excluded from the pipeline for the chunk for which it -/// failed; the filter will not participate in the pipeline -/// during a \c DataSet::read() of the chunk. If this bit is clear -/// and the filter fails then the entire I/O operation fails. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void DSetCreatPropList::setFilter( H5Z_filter_t filter_id, unsigned int flags, - size_t cd_nelmts, const unsigned int cd_values[] ) const +/// If this bit is set then the filter is optional. If the filter +/// fails during a \c DataSet::write() operation then the filter +/// is just excluded from the pipeline for the chunk for which it +/// failed; the filter will not participate in the pipeline +/// during a \c DataSet::read() of the chunk. If this bit is clear +/// and the filter fails then the entire I/O operation fails. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DSetCreatPropList::setFilter(H5Z_filter_t filter_id, unsigned int flags, + size_t cd_nelmts, const unsigned int cd_values[]) const { - herr_t ret_value = H5Pset_filter( id, filter_id, flags, cd_nelmts, cd_values ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setFilter", + herr_t ret_value = H5Pset_filter(id, filter_id, flags, cd_nelmts, cd_values); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setFilter", "H5Pset_filter failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::removeFilter -///\brief Removes one or more filters -///\param filter_id - IN: Filter to remove -///\exception H5::PropListIException +// Function: DSetCreatPropList::removeFilter +///\brief Removes one or more filters +///\param filter_id - IN: Filter to remove +///\exception H5::PropListIException ///\par Description -/// Deletes a filter from the dataset creation property list; -/// deletes all filters if \a filter_id is \c H5Z_FILTER_NONE. -// Programmer Binh-Minh Ribler - 2000 +/// Deletes a filter from the dataset creation property list; +/// deletes all filters if \a filter_id is \c H5Z_FILTER_NONE. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id) const { - herr_t ret_value = H5Premove_filter( id, filter_id); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::removeFilter", + herr_t ret_value = H5Premove_filter(id, filter_id); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::removeFilter", "H5Premove_filter failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getNfilters -///\brief Returns the number of filters in the pipeline -///\return Number of filters -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::getNfilters +///\brief Returns the number of filters in the pipeline +///\return Number of filters +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DSetCreatPropList::getNfilters() const { - int num_filters = H5Pget_nfilters( id ); - if( num_filters < 0 ) - { - throw PropListIException("DSetCreatPropList::getNfilters", + int num_filters = H5Pget_nfilters(id); + if (num_filters < 0) + { + throw PropListIException("DSetCreatPropList::getNfilters", "H5Pget_nfilters returned negative number of filters"); - } - else - return( num_filters ); + } + else + return(num_filters); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFilter -///\brief Returns information about a filter in a pipeline -///\param filter_number - IN: Filter to get, range [0..N-1], where -/// N is returned by H5Pget_nfilters() -///\param flags - OUT: General properties of the filter -///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number -/// of values defined by the filter -///\param cd_values - OUT: Array to hold the data; allocated by the user -///\param namelen - IN: Length of \a name -///\param name - OUT: Name of the filter -///\param filter_config - OUT: Flags indicating whether filter can encode/decode -///\return Filter id -///\exception H5::PropListIException +// Function: DSetCreatPropList::getFilter +///\brief Returns information about a filter in a pipeline +///\param filter_number - IN: Filter to get, range [0..N-1], where +/// N is returned by H5Pget_nfilters() +///\param flags - OUT: General properties of the filter +///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number +/// of values defined by the filter +///\param cd_values - OUT: Array to hold the data; allocated by the user +///\param namelen - IN: Length of \a name +///\param name - OUT: Name of the filter +///\param filter_config - OUT: Flags indicating whether filter can encode/decode +///\return Filter id +///\exception H5::PropListIException ///\par Description -/// Failure occurs when \a filter_number is out of range. -// Note: the first argument was mistakenly typed as int instead -// of unsigned int, but for backward compatibility, it cannot be -// changed. -BMR (2014/04/15) +/// Failure occurs when \a filter_number is out of range. +// Note: the first argument was mistakenly typed as int instead +// of unsigned int, but for backward compatibility, it cannot be +// changed. -BMR (2014/04/15) //-------------------------------------------------------------------------- H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, - unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, - size_t namelen, char name[], unsigned int& filter_config) const + unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, + size_t namelen, char name[], unsigned int& filter_config) const { - H5Z_filter_t filter_id; - filter_id = H5Pget_filter2(id, filter_number, &flags, &cd_nelmts, - cd_values, namelen, name, &filter_config); - if( filter_id == H5Z_FILTER_ERROR ) - throw PropListIException("DSetCreatPropList::getFilter", + H5Z_filter_t filter_id; + filter_id = H5Pget_filter2(id, filter_number, &flags, &cd_nelmts, + cd_values, namelen, name, &filter_config); + if (filter_id == H5Z_FILTER_ERROR) + throw PropListIException("DSetCreatPropList::getFilter", "H5Pget_filter2 returned H5Z_FILTER_ERROR"); - else - return(filter_id); + else + return(filter_id); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFilterById -///\brief Returns information about a filter in a pipeline given the -/// filter id -///\param filter_id - IN: Filter to get -///\param flags - OUT: General properties of the filter -///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number -/// of values defined by the filter -///\param cd_values - OUT: Array to hold the data; allocated by the user -///\param namelen - IN: Length of \a name -///\param name - OUT: Name of the filter -///\param filter_config - OUT: Flags indicating whether filter can encode/decode -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::getFilterById +///\brief Returns information about a filter in a pipeline given the +/// filter id +///\param filter_id - IN: Filter to get +///\param flags - OUT: General properties of the filter +///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number +/// of values defined by the filter +///\param cd_values - OUT: Array to hold the data; allocated by the user +///\param namelen - IN: Length of \a name +///\param name - OUT: Name of the filter +///\param filter_config - OUT: Flags indicating whether filter can encode/decode +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id, - unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, - size_t namelen, char name[], unsigned int &filter_config) const + unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, + size_t namelen, char name[], unsigned int &filter_config) const { - herr_t ret_value = H5Pget_filter_by_id2(id, filter_id, &flags, &cd_nelmts, - cd_values, namelen, name, &filter_config); - if (ret_value < 0) - throw PropListIException("DSetCreatPropList::getFilterById", + herr_t ret_value = H5Pget_filter_by_id2(id, filter_id, &flags, &cd_nelmts, + cd_values, namelen, name, &filter_config); + if (ret_value < 0) + throw PropListIException("DSetCreatPropList::getFilterById", "H5Pget_filter_by_id2 failed"); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::modifyFilter -///\brief Modifies the specified filter -///\param filter_id - IN: Filter to get -///\param flags - OUT: General properties of the filter -///\param cd_nelmts - IN: Number of elements in \a cd_values -/// \n OUT: Number of values defined by the filter -///\param cd_values - OUT: Array to hold the data; allocated by the user -///\exception H5::PropListIException +// Function: DSetCreatPropList::modifyFilter +///\brief Modifies the specified filter +///\param filter_id - IN: Filter to get +///\param flags - OUT: General properties of the filter +///\param cd_nelmts - IN: Number of elements in \a cd_values +/// \n OUT: Number of values defined by the filter +///\param cd_values - OUT: Array to hold the data; allocated by the user +///\exception H5::PropListIException ///\par Description -/// The \a flags argument is a bit vector of the field: -/// \c H5Z_FLAG_OPTIONAL(0x0001) +/// The \a flags argument is a bit vector of the field: +/// \c H5Z_FLAG_OPTIONAL(0x0001) ///\par -/// If this bit is set then the filter is optional. If the filter -/// fails during a DataSet::write() operation then the filter -/// is just excluded from the pipeline for the chunk for which it -/// failed; the filter will not participate in the pipeline -/// during a DataSet::read() of the chunk. If this bit is clear -/// and the filter fails then the entire I/O operation fails. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void DSetCreatPropList::modifyFilter( H5Z_filter_t filter_id, unsigned int - flags, size_t cd_nelmts, const unsigned int cd_values[] ) const +/// If this bit is set then the filter is optional. If the filter +/// fails during a DataSet::write() operation then the filter +/// is just excluded from the pipeline for the chunk for which it +/// failed; the filter will not participate in the pipeline +/// during a DataSet::read() of the chunk. If this bit is clear +/// and the filter fails then the entire I/O operation fails. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DSetCreatPropList::modifyFilter(H5Z_filter_t filter_id, unsigned int + flags, size_t cd_nelmts, const unsigned int cd_values[]) const { - herr_t ret_value = H5Pmodify_filter(id, filter_id, flags, cd_nelmts, cd_values); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::modifyFilter", + herr_t ret_value = H5Pmodify_filter(id, filter_id, flags, cd_nelmts, cd_values); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::modifyFilter", "H5Pmodify_filter failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::allFiltersAvail -///\brief Queries whether all the filters set in this property list -/// are available currently. -///\return true if all filters available, and false if one or more -/// filters not currently available -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::allFiltersAvail +///\brief Queries whether all the filters set in this property list +/// are available currently. +///\return true if all filters available, and false if one or more +/// filters not currently available +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DSetCreatPropList::allFiltersAvail() const { - htri_t ret_value = H5Pall_filters_avail(id); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else // Raise exception when H5Pall_filters_avail returns a negative value - { - throw PropListIException("DSetCreatPropList::allFiltersAvail", "H5Pall_filters_avail returned negative value"); - } + htri_t ret_value = H5Pall_filters_avail(id); + if (ret_value > 0) + return true; + else if (ret_value == 0) + return false; + else // Raise exception when H5Pall_filters_avail returns a negative value + { + throw PropListIException("DSetCreatPropList::allFiltersAvail", "H5Pall_filters_avail returned negative value"); + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setShuffle -///\brief Sets method of the shuffle filter +// Function: DSetCreatPropList::setShuffle +///\brief Sets method of the shuffle filter /// -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// Please refer to the Reference Manual of \c H5Pset_shuffle for -/// details. +/// Please refer to the Reference Manual of \c H5Pset_shuffle for +/// details. /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetShuffle -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setShuffle() const { - herr_t ret_value = H5Pset_shuffle(id); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setShuffle", + herr_t ret_value = H5Pset_shuffle(id); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setShuffle", "H5Pset_shuffle failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getAllocTime -///\brief Get space allocation time for this property. -///\return Space allocation time. -///\exception H5::PropListIException +// Function: DSetCreatPropList::getAllocTime +///\brief Get space allocation time for this property. +///\return Space allocation time. +///\exception H5::PropListIException ///\par Description -/// The values of space allocation time can be one of the -/// followings: -/// \li \c H5D_ALLOC_TIME_DEFAULT -/// \li \c H5D_ALLOC_TIME_EARLY -/// \li \c H5D_ALLOC_TIME_LATE -/// \li \c H5D_ALLOC_TIME_INCR -// Programmer Binh-Minh Ribler - 2000 +/// The values of space allocation time can be one of the +/// followings: +/// \li \c H5D_ALLOC_TIME_DEFAULT +/// \li \c H5D_ALLOC_TIME_EARLY +/// \li \c H5D_ALLOC_TIME_LATE +/// \li \c H5D_ALLOC_TIME_INCR +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_alloc_time_t DSetCreatPropList::getAllocTime() const { - H5D_alloc_time_t alloc_time; - herr_t ret_value = H5Pget_alloc_time(id, &alloc_time); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::getAllocTime", + H5D_alloc_time_t alloc_time; + herr_t ret_value = H5Pget_alloc_time(id, &alloc_time); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::getAllocTime", "H5Pget_alloc_time failed"); - } - else - return (alloc_time); + } + else + return (alloc_time); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFillTime -///\brief Gets fill value writing time. -///\return Fill value writing time -///\exception H5::PropListIException +// Function: DSetCreatPropList::getFillTime +///\brief Gets fill value writing time. +///\return Fill value writing time +///\exception H5::PropListIException ///\par Description -/// Valid values for fill value writing time include -/// \li \c H5D_FILL_TIME_NEVER -/// \li \c H5D_FILL_TIME_ALLOC. -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for fill value writing time include +/// \li \c H5D_FILL_TIME_NEVER +/// \li \c H5D_FILL_TIME_ALLOC. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_fill_time_t DSetCreatPropList::getFillTime() const { - H5D_fill_time_t fill_time; - herr_t ret_value = H5Pget_fill_time(id, &fill_time); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::getFillTime", + H5D_fill_time_t fill_time; + herr_t ret_value = H5Pget_fill_time(id, &fill_time); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::getFillTime", "H5Pget_fill_time failed"); - } - else - return (fill_time); + } + else + return (fill_time); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setAllocTime -///\brief Sets space allocation time for dataset during creation. -///\param alloc_time - IN: Allocation time -///\exception H5::PropListIException +// Function: DSetCreatPropList::setAllocTime +///\brief Sets space allocation time for dataset during creation. +///\param alloc_time - IN: Allocation time +///\exception H5::PropListIException ///\par Description -/// Valid values for space allocation time include: -/// \li \c H5D_ALLOC_TIME_DEFAULT -/// \li \c H5D_ALLOC_TIME_EARLY -/// \li \c H5D_ALLOC_TIME_LATE -/// \li \c H5D_ALLOC_TIME_INCR -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for space allocation time include: +/// \li \c H5D_ALLOC_TIME_DEFAULT +/// \li \c H5D_ALLOC_TIME_EARLY +/// \li \c H5D_ALLOC_TIME_LATE +/// \li \c H5D_ALLOC_TIME_INCR +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time) const { - herr_t ret_value = H5Pset_alloc_time(id, alloc_time); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setAllocTime", + herr_t ret_value = H5Pset_alloc_time(id, alloc_time); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setAllocTime", "H5Pset_alloc_time failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFillTime -///\brief Sets fill value writing time for dataset. -///\return Fill value writing time -///\exception H5::PropListIException +// Function: DSetCreatPropList::setFillTime +///\brief Sets fill value writing time for dataset. +///\return Fill value writing time +///\exception H5::PropListIException ///\par Description -/// Valid values for fill value writing time include -/// \li \c H5D_FILL_TIME_NEVER -/// \li \c H5D_FILL_TIME_ALLOC. -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for fill value writing time include +/// \li \c H5D_FILL_TIME_NEVER +/// \li \c H5D_FILL_TIME_ALLOC. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time) const { - herr_t ret_value = H5Pset_fill_time(id, fill_time); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setFillTime", + herr_t ret_value = H5Pset_fill_time(id, fill_time); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setFillTime", "H5Pset_fill_time failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFletcher32 -///\brief Sets Fletcher32 checksum of EDC for this property list. +// Function: DSetCreatPropList::setFletcher32 +///\brief Sets Fletcher32 checksum of EDC for this property list. /// -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFletcher32() const { - herr_t ret_value = H5Pset_fletcher32(id); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setFletcher32", + herr_t ret_value = H5Pset_fletcher32(id); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setFletcher32", "H5Pset_fletcher32 failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setExternal -///\brief Adds an external file to the list of external files -///\param name - IN: Name of the external file -///\param offset - IN: Location where the data starts in the file -///\param size - IN: Number of bytes reserved in the file for the data -///\exception H5::PropListIException +// Function: DSetCreatPropList::setExternal +///\brief Adds an external file to the list of external files +///\param name - IN: Name of the external file +///\param offset - IN: Location where the data starts in the file +///\param size - IN: Number of bytes reserved in the file for the data +///\exception H5::PropListIException ///\par Description -/// If a dataset is splitted across multiple files then the files -/// should be defined in order. The total size of the dataset is -/// the sum of the \a size arguments for all the external files. If -/// the total size is larger than the size of a dataset then the -/// dataset can be extended (provided the data space also allows -/// the extending). -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t size ) const +/// If a dataset is splitted across multiple files then the files +/// should be defined in order. The total size of the dataset is +/// the sum of the \a size arguments for all the external files. If +/// the total size is larger than the size of a dataset then the +/// dataset can be extended (provided the data space also allows +/// the extending). +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DSetCreatPropList::setExternal(const char* name, off_t offset, hsize_t size) const { - herr_t ret_value = H5Pset_external( id, name, offset, size ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::setExternal", + herr_t ret_value = H5Pset_external(id, name, offset, size); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::setExternal", "H5Pset_external failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getExternalCount -///\brief Returns the number of external files for a dataset -///\return Number of external files -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::getExternalCount +///\brief Returns the number of external files for a dataset +///\return Number of external files +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DSetCreatPropList::getExternalCount() const { - int num_ext_files = H5Pget_external_count( id ); - if( num_ext_files < 0 ) - { - throw PropListIException("DSetCreatPropList::getExternalCount", + int num_ext_files = H5Pget_external_count(id); + if (num_ext_files < 0) + { + throw PropListIException("DSetCreatPropList::getExternalCount", "H5Pget_external_count returns negative number of external files"); - } - else - return( num_ext_files ); + } + else + return(num_ext_files); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getExternal -///\brief Returns information about an external file -///\param idx - IN: Index of the external file, ranges [0-(N-1)] and -/// returned by getExternalCount() -///\param name_size - IN: Maximum length of \a name -///\param name - OUT: Name of the external file -///\param offset - OUT: Location to return an offset value -///\param size - OUT: Location to return the size of the external file data -///\exception H5::PropListIException +// Function: DSetCreatPropList::getExternal +///\brief Returns information about an external file +///\param idx - IN: Index of the external file, ranges [0-(N-1)] and +/// returned by getExternalCount() +///\param name_size - IN: Maximum length of \a name +///\param name - OUT: Name of the external file +///\param offset - OUT: Location to return an offset value +///\param size - OUT: Location to return the size of the external file data +///\exception H5::PropListIException ///\par Description -/// The parameter \a idx ranges [0..N-1] where N is returned by -/// getExternalCount(). At most \a name_size characters are copied -/// into the name array. If the external file name is longer than -/// name_size with the null terminator, the return value is not -/// null terminated (similar to strncpy()). -/// If \a name_size is zero or \a name is a null pointer, the -/// external file name will not be returned. If \a offset or -/// \a size are null pointers then the corresponding information -/// will not be returned. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void DSetCreatPropList::getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const +/// The parameter \a idx ranges [0..N-1] where N is returned by +/// getExternalCount(). At most \a name_size characters are copied +/// into the name array. If the external file name is longer than +/// name_size with the null terminator, the return value is not +/// null terminated (similar to strncpy()). +/// If \a name_size is zero or \a name is a null pointer, the +/// external file name will not be returned. If \a offset or +/// \a size are null pointers then the corresponding information +/// will not be returned. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DSetCreatPropList::getExternal(unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size) const { - herr_t ret_value = H5Pget_external( id, idx, name_size, name, &offset, &size ); - if( ret_value < 0 ) - { - throw PropListIException("DSetCreatPropList::getExternal", + herr_t ret_value = H5Pget_external(id, idx, name_size, name, &offset, &size); + if (ret_value < 0) + { + throw PropListIException("DSetCreatPropList::getExternal", "H5Pget_external failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList destructor -///\brief Noop destructor. +// Function: DSetCreatPropList destructor +///\brief Noop destructor. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DSetCreatPropList::~DSetCreatPropList () {} +DSetCreatPropList::~DSetCreatPropList() {} } // end namespace diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 60ce1d5..096a3d3 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -29,118 +29,87 @@ class DataType; */ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { public: - ///\brief Default dataset creation property list. - static const DSetCreatPropList& DEFAULT; - - // Creates a dataset creation property list. - DSetCreatPropList(); - - // Queries whether all the filters set in this property list are - // available currently. - bool allFiltersAvail() const; - - // Get space allocation time for this property. - H5D_alloc_time_t getAllocTime() const; - - // Set space allocation time for dataset during creation. - void setAllocTime(H5D_alloc_time_t alloc_time) const; - - // Retrieves the size of the chunks used to store a chunked layout dataset. - int getChunk( int max_ndims, hsize_t* dim ) const; - - // Sets the size of the chunks used to store a chunked layout dataset. - void setChunk( int ndims, const hsize_t* dim ) const; - - // Returns information about an external file. - void getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const; - - // Returns the number of external files for a dataset. - int getExternalCount() const; - - // Gets fill value writing time. - H5D_fill_time_t getFillTime() const; - - // Sets fill value writing time for dataset. - void setFillTime(H5D_fill_time_t fill_time) const; - - // Retrieves a dataset fill value. - void getFillValue( const DataType& fvalue_type, void* value ) const; - - // Sets a dataset fill value. - void setFillValue( const DataType& fvalue_type, const void* value ) const; - - // Returns information about a filter in a pipeline. - H5Z_filter_t getFilter(int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const; - - // Returns information about a filter in a pipeline given the filter id. - void getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const; - - // Gets the layout of the raw data storage of the data that uses this - // property list. - H5D_layout_t getLayout() const; - - // Sets the type of storage used to store the raw data for the - // dataset that uses this property list. - void setLayout(H5D_layout_t layout) const; - - // Returns the number of filters in the pipeline. - int getNfilters() const; - - // Checks if fill value has been defined for this property. - H5D_fill_value_t isFillValueDefined() const; - - // Modifies the specified filter. - void modifyFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const; - - // Remove one or all filters from the filter pipeline. - void removeFilter( H5Z_filter_t filter_id) const; - - // Sets compression method and compression level. - void setDeflate( int level ) const; - - // Adds an external file to the list of external files. - void setExternal( const char* name, off_t offset, hsize_t size ) const; - - // Adds a filter to the filter pipeline. - void setFilter( H5Z_filter_t filter, unsigned int flags = 0, size_t cd_nelmts = 0, const unsigned int cd_values[] = NULL) const; - - // Sets Fletcher32 checksum of EDC for this property list. - void setFletcher32() const; - - // Sets method of the shuffle filter. - void setShuffle() const; - - // Sets SZIP compression method. - void setSzip(unsigned int options_mask, unsigned int pixels_per_block) const; - - // Sets N-bit compression method. - void setNbit() const; - - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DSetCreatPropList"); } - - // Copy constructor: creates a copy of a DSetCreatPropList object. - DSetCreatPropList(const DSetCreatPropList& orig); - - // Creates a copy of an existing dataset creation property list - // using the property list id. - DSetCreatPropList(const hid_t plist_id); - - // Noop destructor. - virtual ~DSetCreatPropList(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - - // Deletes the global constant, should only be used by the library - static void deleteConstants(); - - private: - static DSetCreatPropList* DEFAULT_; - - // Creates the global constant, should only be used by the library - static DSetCreatPropList* getConstant(); - -#endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} -#endif // __H5DSCreatPropList_H + ///\brief Default dataset creation property list. + static const DSetCreatPropList& DEFAULT; + + // Creates a // Creates a dataset creation property list. + DSetCreatPropList(); +hether all the // Queries whether all the filters set in this property list are + // available currently. + bool allFiltersAvail() const; +me for this property. + // Get space allocation time for this property. + H5D_alloc_time_t getAllocTime() const; + creation. + voi // Set space allocation time for dataset during creation. + void setAllocTime(H5D_alloc_time_t alloc_time) const; +ayout dataset. + // Retrieves the size of the chunks used to store a chunked layout dataset. + int getChunk(int max_ndims, hsize_t* dim) const; +d setChunk( i // Sets the size of the chunks used to store a chunked layout dataset. + void setChunk(int ndims, const hsize_t* dim) const; +name_size, ch // Returns information about an external file. + void getExternal(unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size) const; +l value writi // Returns the number of external files for a dataset. + int getExternalCount() const; +taset. + void se // Gets fill value writing time. + H5D_fill_time_t getFillTime() const; +l value. + void // Sets fill value writing time for dataset. + void setFillTime(H5D_fill_time_t fill_time) const; +oid setFillValu // Retrieves a dataset fill value. + void getFillValue(const DataType& fvalue_type, void* value) const; +peline. + H5Z_ // Sets a dataset fill value. + void setFillValue(const DataType& fvalue_type, const void* value) const; +_t namelen, c // Returns information about a filter in a pipeline. + H5Z_filter_t getFilter(int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const; +ues, size_t nam // Returns information about a filter in a pipeline given the filter id. + void getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const; +dataset that us // Gets the layout of the raw data storage of the data that uses this + // property list. + H5D_layout_t getLayout() const; + getNfilters() const; + // Sets the type of storage used to store the raw data for the + // dataset that uses this property list. + void setLayout(H5D_layout_t layout) const; +modifyFilter( H5Z_filt // Returns the number of filters in the pipeline. + int getNfilters() const; +alues[] ) const // Checks if fill value has been defined for this property. + H5D_fill_value_t isFillValueDefined() const; +t; + + // Sets co // Modifies the specified filter. + void modifyFilter(H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[]) const; +st char* name // Remove one or all filters from the filter pipeline. + void removeFilter(H5Z_filter_t filter_id) const; +r_t filter, un // Sets compression method and compression level. + void setDeflate(int level) const; +; + + // Sets F // Adds an external file to the list of external files. + void setExternal(const char* name, off_t offset, hsize_t size) const; +uffle() const // Adds a filter to the filter pipeline. + void setFilter(H5Z_filter_t filter, unsigned int flags = 0, size_t cd_nelmts = 0, const unsigned int cd_values[] = NULL) const; +t; + + ///\brief // Sets Fletcher32 checksum of EDC for this property list. + void setFletcher32() const; +pList"); } + + // // Sets method of the shuffle filter. + void setShuffle() const; + DSetCreatPropL // Sets SZIP compression method. + void setSzip(unsigned int options_mask, unsigned int pixels_per_block) const; +he property lis // Sets N-bit compression method. + void setNbit() const; +destructor. + vi ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DSetCreatPropList"); } +only be used by // Copy constructor: creates a copy of a DSetCreatPropList object. + DSetCreatPropList(const DSetCreatPropList& orig); +tes the global // Creates a copy of an existing dataset creation property list + // using the property list id. + DSetCreatPropList(const hid_t plist_id); +if // __H5DSCreatPropList_H diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 8746d35..e018ff2 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -15,7 +15,7 @@ #include -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -36,7 +36,7 @@ DSetMemXferPropList* DSetMemXferPropList::DEFAULT_ = 0; // Function: DSetMemXferPropList::getConstant // Creates a DSetMemXferPropList object representing the HDF5 // constant H5P_DATASET_XFER, pointed to by -// DSetMemXferPropList::DEFAULT_ +// DSetMemXferPropList::DEFAULT_ // exception H5::PropListIException // Description // If DSetMemXferPropList::DEFAULT_ already points to an allocated @@ -76,25 +76,25 @@ void DSetMemXferPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for default dataset memory and transfer property list. +// Purpose Constant for default dataset memory and transfer property list. //-------------------------------------------------------------------------- const DSetMemXferPropList& DSetMemXferPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function DSetMemXferPropList default constructor -///\brief Default constructor: creates a stub dataset memory and -/// transfer property list object. -// Programmer: Binh-Minh Ribler - 2000 +// Function DSetMemXferPropList default constructor +///\brief Default constructor: creates a stub dataset memory and +/// transfer property list object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetMemXferPropList::DSetMemXferPropList() : PropList(H5P_DATASET_XFER) {} //-------------------------------------------------------------------------- -// Function DSetMemXferPropList constructor -///\brief Creates a dataset transfer property list with transform -/// expression. -// Programmer: Binh-Minh Ribler - 2000 +// Function DSetMemXferPropList constructor +///\brief Creates a dataset transfer property list with transform +/// expression. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetMemXferPropList::DSetMemXferPropList(const char* exp) : PropList(H5P_DATASET_XFER) { @@ -102,164 +102,164 @@ DSetMemXferPropList::DSetMemXferPropList(const char* exp) : PropList(H5P_DATASET } //-------------------------------------------------------------------------- -// Function DSetMemXferPropList copy constructor -///\brief Copy constructor: makes a copy of the original -/// DSetMemXferPropList object -///\param original - IN: Original dataset memory and transfer property -/// list object to copy -// Programmer: Binh-Minh Ribler - 2000 +// Function DSetMemXferPropList copy constructor +///\brief Copy constructor: makes a copy of the original +/// DSetMemXferPropList object +///\param original - IN: Original dataset memory and transfer property +/// list object to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList& original ) : PropList( original ) {} +DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList& original) : PropList(original ) {} //-------------------------------------------------------------------------- -// Function DSetMemXferPropList overloaded constructor -///\brief Creates a DSetMemXferPropList object using the id of an -/// existing DSetMemXferPropList. -///\param plist_id - IN: Id of an existing dataset memory and transfer -/// property list -// Programmer: Binh-Minh Ribler - 2000 +// Function DSetMemXferPropList overloaded constructor +///\brief Creates a DSetMemXferPropList object using the id of an +/// existing DSetMemXferPropList. +///\param plist_id - IN: Id of an existing dataset memory and transfer +/// property list +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetMemXferPropList::DSetMemXferPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setBuffer -///\brief Sets type conversion and background buffers. -///\param size - IN: Size, in bytes, of the type conversion and background buffers -///\param tconv - IN: Pointer to application-allocated type conversion buffer -///\param bkg - IN: Pointer to application-allocated background buffer -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::setBuffer +///\brief Sets type conversion and background buffers. +///\param size - IN: Size, in bytes, of the type conversion and background buffers +///\param tconv - IN: Pointer to application-allocated type conversion buffer +///\param bkg - IN: Pointer to application-allocated background buffer +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setBuffer( size_t size, void* tconv, void* bkg ) const +void DSetMemXferPropList::setBuffer(size_t size, void* tconv, void* bkg) const { - herr_t ret_value = H5Pset_buffer( id, size, tconv, bkg ); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::setBuffer", - "H5Pset_buffer failed"); - } + herr_t ret_value = H5Pset_buffer(id, size, tconv, bkg); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setBuffer", + "H5Pset_buffer failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getBuffer -///\brief Reads buffer settings. -///\param tconv - OUT: Pointer to application-allocated type conversion buf -///\param bkg - OUT: Pointer to application-allocated background buffer -///\return Buffer size, in bytes -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::getBuffer +///\brief Reads buffer settings. +///\param tconv - OUT: Pointer to application-allocated type conversion buf +///\param bkg - OUT: Pointer to application-allocated background buffer +///\return Buffer size, in bytes +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -size_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const +size_t DSetMemXferPropList::getBuffer(void** tconv, void** bkg) const { - size_t buffer_size = H5Pget_buffer( id, tconv, bkg ); - if( buffer_size == 0 ) - { - throw PropListIException("DSetMemXferPropList::getBuffer", - "H5Pget_buffer returned 0 for buffer size - failure"); - } - return( buffer_size ); + size_t buffer_size = H5Pget_buffer(id, tconv, bkg); + if(buffer_size == 0) + { + throw PropListIException("DSetMemXferPropList::getBuffer", + "H5Pget_buffer returned 0 for buffer size - failure"); + } + return(buffer_size); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setPreserve -///\brief Sets the dataset transfer property list status to true or false. -///\param status - IN: Status to set, true or false -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::setPreserve +///\brief Sets the dataset transfer property list status to true or false. +///\param status - IN: Status to set, true or false +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setPreserve( bool status ) const +void DSetMemXferPropList::setPreserve(bool status) const { - herr_t ret_value = H5Pset_preserve( id, (hbool_t) status ); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::setPreserve", - "H5Pset_preserve failed"); - } + herr_t ret_value = H5Pset_preserve(id, (hbool_t) status); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setPreserve", + "H5Pset_preserve failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getPreserve -///\brief Checks status of the dataset transfer property list. -///\return Status of the dataset transfer property list -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::getPreserve +///\brief Checks status of the dataset transfer property list. +///\return Status of the dataset transfer property list +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DSetMemXferPropList::getPreserve() const { - int ret_value = H5Pget_preserve( id ); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else - { - throw PropListIException("DSetMemXferPropList::getPreserve", - "H5Pget_preserve returned negative value for status"); - } + int ret_value = H5Pget_preserve(id); + if(ret_value > 0) + return true; + else if(ret_value == 0) + return false; + else + { + throw PropListIException("DSetMemXferPropList::getPreserve", + "H5Pget_preserve returned negative value for status"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setBtreeRatios -///\brief Sets B-tree split ratios for a dataset transfer property list. -///\param left - IN: B-tree split ratio for left-most nodes -///\param middle - IN: B-tree split ratio for right-most nodes and lone nodes -///\param right - IN: B-tree split ratio for all other nodes -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::setBtreeRatios +///\brief Sets B-tree split ratios for a dataset transfer property list. +///\param left - IN: B-tree split ratio for left-most nodes +///\param middle - IN: B-tree split ratio for right-most nodes and lone nodes +///\param right - IN: B-tree split ratio for all other nodes +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setBtreeRatios( double left, double middle, double right ) const +void DSetMemXferPropList::setBtreeRatios(double left, double middle, double right) const { - herr_t ret_value = H5Pset_btree_ratios( id, left, middle, right ); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::setBtreeRatios", - "H5Pset_btree_ratios failed"); - } + herr_t ret_value = H5Pset_btree_ratios(id, left, middle, right); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setBtreeRatios", + "H5Pset_btree_ratios failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getBtreeRatios -///\brief Gets B-tree split ratios for a dataset transfer property list. -///\param left - OUT: B-tree split ratio for left-most nodes -///\param middle - OUT: B-tree split ratio for right-most nodes and lone nodes -///\param right - OUT: B-tree split ratio for all other nodes -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::getBtreeRatios +///\brief Gets B-tree split ratios for a dataset transfer property list. +///\param left - OUT: B-tree split ratio for left-most nodes +///\param middle - OUT: B-tree split ratio for right-most nodes and lone nodes +///\param right - OUT: B-tree split ratio for all other nodes +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::getBtreeRatios( double& left, double& middle, double& right ) const +void DSetMemXferPropList::getBtreeRatios(double& left, double& middle, double& right) const { - herr_t ret_value = H5Pget_btree_ratios( id, &left, &middle, &right ); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::getBtreeRatios", - "H5Pget_btree_ratios failed"); - } + herr_t ret_value = H5Pget_btree_ratios(id, &left, &middle, &right); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::getBtreeRatios", + "H5Pget_btree_ratios failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setDataTransform -///\brief Sets data transform expression. -///\param expression - IN: null-terminated data transform expression (char*) -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - Mar, 2014 +// Function: DSetMemXferPropList::setDataTransform +///\brief Sets data transform expression. +///\param expression - IN: null-terminated data transform expression (char*) +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- void DSetMemXferPropList::setDataTransform(const char* expression) const { - herr_t ret_value = H5Pset_data_transform( id, expression); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::setDataTransform", - "H5Pset_data_transform failed"); - } + herr_t ret_value = H5Pset_data_transform(id, expression); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setDataTransform", + "H5Pset_data_transform failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setDataTransform -///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c H5std_string for the expression. -///\param expression - IN: H5std_string data transform expression -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - Mar, 2014 +// Function: DSetMemXferPropList::setDataTransform +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the expression. +///\param expression - IN: H5std_string data transform expression +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- void DSetMemXferPropList::setDataTransform(const H5std_string& expression) const { @@ -267,13 +267,13 @@ void DSetMemXferPropList::setDataTransform(const H5std_string& expression) const } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getDataTransform -///\brief Sets data transform expression. -///\param exp - OUT: buffer for data transform expression (char*) -///\param buf_size - IN: size of buffer for expression, including the -/// null terminator -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - Mar, 2014 +// Function: DSetMemXferPropList::getDataTransform +///\brief Sets data transform expression. +///\param exp - OUT: buffer for data transform expression (char*) +///\param buf_size - IN: size of buffer for expression, including the +/// null terminator +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t buf_size) const { @@ -285,8 +285,8 @@ ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t buf_size) const // H5Pget_data_transform returns a negative value, raise an exception if (exp_len < 0) { - throw PropListIException("DSetMemXferPropList::getDataTransform", - "H5Pget_data_transform failed"); + throw PropListIException("DSetMemXferPropList::getDataTransform", + "H5Pget_data_transform failed"); } // H5Pget_data_transform will put a null terminator at the end of the @@ -298,11 +298,11 @@ ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t buf_size) const } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getDataTransform -///\brief This is an overloaded member function, provided for convenience. -/// It takes no parameter and returns a \c H5std_string for the expression. -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - Mar, 2014 +// Function: DSetMemXferPropList::getDataTransform +///\brief This is an overloaded member function, provided for convenience. +/// It takes no parameter and returns a \c H5std_string for the expression. +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- H5std_string DSetMemXferPropList::getDataTransform() const { @@ -340,226 +340,226 @@ H5std_string DSetMemXferPropList::getDataTransform() const } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getTypeConvCB -///\brief Sets an exception handling callback for datatype conversion -/// for a dataset transfer property list. -///\param op - IN: User's function -///\param user_data - IN: User's data -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getTypeConvCB +///\brief Sets an exception handling callback for datatype conversion +/// for a dataset transfer property list. +///\param op - IN: User's function +///\param user_data - IN: User's data +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setTypeConvCB( H5T_conv_except_func_t op, void *user_data) const +void DSetMemXferPropList::setTypeConvCB(H5T_conv_except_func_t op, void *user_data) const { - herr_t ret_value = H5Pset_type_conv_cb( id, op, user_data); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::setTypeConvCB", - "H5Pset_type_conv_cb failed"); - } + herr_t ret_value = H5Pset_type_conv_cb(id, op, user_data); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setTypeConvCB", + "H5Pset_type_conv_cb failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getTypeConvCB -///\brief Gets the exception handling callback function and data. -///\param op - IN: Retrieved user function -///\param user_data - IN: Retrieved user data -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getTypeConvCB +///\brief Gets the exception handling callback function and data. +///\param op - IN: Retrieved user function +///\param user_data - IN: Retrieved user data +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void DSetMemXferPropList::getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) const +void DSetMemXferPropList::getTypeConvCB(H5T_conv_except_func_t *op, void **user_data) const { - herr_t ret_value = H5Pget_type_conv_cb( id, op, user_data); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::getTypeConvCB", - "H5Pget_type_conv_cb failed"); - } + herr_t ret_value = H5Pget_type_conv_cb(id, op, user_data); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::getTypeConvCB", + "H5Pget_type_conv_cb failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setVlenMemManager -///\brief Sets the memory manager for variable-length datatype allocation. -///\param alloc_func - IN: User's allocate routine -///\param alloc_info - IN: User's allocation parameters -///\param free_func - IN: User's free routine -///\param free_info - IN: User's free parameters -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::setVlenMemManager +///\brief Sets the memory manager for variable-length datatype allocation. +///\param alloc_func - IN: User's allocate routine +///\param alloc_info - IN: User's allocation parameters +///\param free_func - IN: User's free routine +///\param free_info - IN: User's free parameters +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info ) const +void DSetMemXferPropList::setVlenMemManager(H5MM_allocate_t alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info) const { - herr_t ret_value = H5Pset_vlen_mem_manager( id, alloc_func, alloc_info, - free_func, free_info ); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::setVlenMemManager", - "H5Pset_vlen_mem_manager failed"); - } + herr_t ret_value = H5Pset_vlen_mem_manager(id, alloc_func, alloc_info, + free_func, free_info); + if(ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setVlenMemManager", + "H5Pset_vlen_mem_manager failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setVlenMemManager -///\brief Sets the memory manager for variable-length datatype -/// allocation - system \c malloc and \c free will be used. +// Function: DSetMemXferPropList::setVlenMemManager +///\brief Sets the memory manager for variable-length datatype +/// allocation - system \c malloc and \c free will be used. /// -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetMemXferPropList::setVlenMemManager() const { - setVlenMemManager( NULL, NULL, NULL, NULL ); + setVlenMemManager(NULL, NULL, NULL, NULL); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getVlenMemManager -///\brief Gets the memory manager for variable-length datatype allocation -///\param alloc_func - OUT: User's allocate routine -///\param alloc_info - OUT: User's allocation parameters -///\param free_func - OUT: User's free routine -///\param free_info - OUT: User's free parameters -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::getVlenMemManager +///\brief Gets the memory manager for variable-length datatype allocation +///\param alloc_func - OUT: User's allocate routine +///\param alloc_info - OUT: User's allocation parameters +///\param free_func - OUT: User's free routine +///\param free_info - OUT: User's free parameters +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** alloc_info, H5MM_free_t& free_func, void** free_info ) const +void DSetMemXferPropList::getVlenMemManager(H5MM_allocate_t& alloc_func, void** alloc_info, H5MM_free_t& free_func, void** free_info) const { - herr_t ret_value = H5Pget_vlen_mem_manager( id, &alloc_func, alloc_info, &free_func, free_info ); - if( ret_value < 0 ) - { - throw PropListIException("DSetMemXferPropList::getVlenMemManager", - "H5Pget_vlen_mem_manager failed"); - } + herr_t ret_value = H5Pget_vlen_mem_manager(id, &alloc_func, alloc_info, &free_func, free_info); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::getVlenMemManager", + "H5Pget_vlen_mem_manager failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setSmallDataBlockSize -///\brief Sets the size of a contiguous block reserved for small data. -///\param size - IN: Maximum size, in bytes, of the small data block. -///\exception H5::PropListIException +// Function: DSetMemXferPropList::setSmallDataBlockSize +///\brief Sets the size of a contiguous block reserved for small data. +///\param size - IN: Maximum size, in bytes, of the small data block. +///\exception H5::PropListIException ///\par Description -/// For detail, please refer to the C layer Reference Manual at: +/// For detail, please refer to the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSmallData -// Programmer: Binh-Minh Ribler - April, 2004 +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) const { - herr_t ret_value = H5Pset_small_data_block_size(id, size); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setSmallDataBlockSize", - "H5Pset_small_data_block_size failed"); - } + herr_t ret_value = H5Pset_small_data_block_size(id, size); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setSmallDataBlockSize", + "H5Pset_small_data_block_size failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getSmallDataBlockSize -///\brief Returns the current small data block size setting. -///\return Size of the small data block, in bytes -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getSmallDataBlockSize +///\brief Returns the current small data block size setting. +///\return Size of the small data block, in bytes +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hsize_t DSetMemXferPropList::getSmallDataBlockSize() const { - hsize_t size; - herr_t ret_value = H5Pget_small_data_block_size(id, &size); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::getSmallDataBlockSize", - "H5Pget_small_data_block_size failed"); - } - return(size); + hsize_t size; + herr_t ret_value = H5Pget_small_data_block_size(id, &size); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::getSmallDataBlockSize", + "H5Pget_small_data_block_size failed"); + } + return(size); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setHyperVectorSize -///\brief Sets number of I/O vectors to be read/written in hyperslab I/O. +// Function: DSetMemXferPropList::setHyperVectorSize +///\brief Sets number of I/O vectors to be read/written in hyperslab I/O. /// -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// For information, please refer to the C layer Reference -/// Manual at: +/// For information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetHyperVectorSize -// Programmer: Binh-Minh Ribler - April, 2004 +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) const { - herr_t ret_value = H5Pset_hyper_vector_size(id, vector_size); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setHyperVectorSize", - "H5Pset_hyper_vector_size failed"); - } + herr_t ret_value = H5Pset_hyper_vector_size(id, vector_size); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setHyperVectorSize", + "H5Pset_hyper_vector_size failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getHyperVectorSize -///\brief Returns the number of I/O vectors to be read/written in -/// hyperslab I/O. -///\return Number of I/O vectors -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getHyperVectorSize +///\brief Returns the number of I/O vectors to be read/written in +/// hyperslab I/O. +///\return Number of I/O vectors +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t DSetMemXferPropList::getHyperVectorSize() const { - size_t vector_size; - herr_t ret_value = H5Pget_hyper_vector_size(id, &vector_size); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::getHyperVectorSize", - "H5Pget_hyper_vector_size failed"); - } - return(vector_size); + size_t vector_size; + herr_t ret_value = H5Pget_hyper_vector_size(id, &vector_size); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::getHyperVectorSize", + "H5Pget_hyper_vector_size failed"); + } + return(vector_size); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setEDCCheck -///\brief Enables or disables error-detecting for a dataset reading -/// process. -///\param check - IN: Specifies whether error detection is enabled or -/// disabled -///\exception H5::PropListIException +// Function: DSetMemXferPropList::setEDCCheck +///\brief Enables or disables error-detecting for a dataset reading +/// process. +///\param check - IN: Specifies whether error detection is enabled or +/// disabled +///\exception H5::PropListIException ///\par Description -/// The error detection algorithm used is the algorithm previously -/// specified in the corresponding dataset creation property -/// list. This function does not affect the use of error -/// detection in the writing process. +/// The error detection algorithm used is the algorithm previously +/// specified in the corresponding dataset creation property +/// list. This function does not affect the use of error +/// detection in the writing process. ///\par -/// Valid values are as follows: -/// \li \c H5Z_ENABLE_EDC (default) -/// \li \c H5Z_DISABLE_EDC -// Programmer: Binh-Minh Ribler - April, 2004 +/// Valid values are as follows: +/// \li \c H5Z_ENABLE_EDC (default) +/// \li \c H5Z_DISABLE_EDC +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check) const { - herr_t ret_value = H5Pset_edc_check(id, check); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setEDCCheck", - "H5Pset_edc_check failed"); - } + herr_t ret_value = H5Pset_edc_check(id, check); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setEDCCheck", + "H5Pset_edc_check failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getEDCCheck -///\brief Determines whether error-detection is enabled for dataset reads. -///\return \c H5Z_ENABLE_EDC or \c H5Z_DISABLE_EDC -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getEDCCheck +///\brief Determines whether error-detection is enabled for dataset reads. +///\return \c H5Z_ENABLE_EDC or \c H5Z_DISABLE_EDC +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5Z_EDC_t DSetMemXferPropList::getEDCCheck() const { - H5Z_EDC_t check = H5Pget_edc_check(id); - if (check < 0) - { - throw PropListIException("DSetMemXferPropList::getEDCCheck", - "H5Pget_edc_check failed"); - } - return(check); + H5Z_EDC_t check = H5Pget_edc_check(id); + if (check < 0) + { + throw PropListIException("DSetMemXferPropList::getEDCCheck", + "H5Pget_edc_check failed"); + } + return(check); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetMemXferPropList::~DSetMemXferPropList() {} diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 42194fb..f1c363f 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -27,93 +27,93 @@ namespace H5 { */ class H5_DLLCPP DSetMemXferPropList : public PropList { public: - ///\brief Default dataset memory and transfer property list. - static const DSetMemXferPropList& DEFAULT; + ///\brief Default dataset memory and transfer property list. + static const DSetMemXferPropList& DEFAULT; - // Creates a dataset memory and transfer property list. - DSetMemXferPropList(); + // Creates a dataset memory and transfer property list. + DSetMemXferPropList(); - // Creates a dataset transform property list. - DSetMemXferPropList(const char* expression); + // Creates a dataset transform property list. + DSetMemXferPropList(const char* expression); - // Sets type conversion and background buffers. - void setBuffer( size_t size, void* tconv, void* bkg ) const; + // Sets type conversion and background buffers. + void setBuffer(size_t size, void* tconv, void* bkg) const; - // Reads buffer settings. - size_t getBuffer( void** tconv, void** bkg ) const; + // Reads buffer settings. + size_t getBuffer(void** tconv, void** bkg) const; - // Sets B-tree split ratios for a dataset transfer property list. - void setBtreeRatios( double left, double middle, double right ) const; + // Sets B-tree split ratios for a dataset transfer property list. + void setBtreeRatios(double left, double middle, double right) const; - // Gets B-tree split ratios for a dataset transfer property list. - void getBtreeRatios( double& left, double& middle, double& right ) const; + // Gets B-tree split ratios for a dataset transfer property list. + void getBtreeRatios(double& left, double& middle, double& right) const; - // Sets data transform expression. - void setDataTransform(const char* expression) const; - void setDataTransform(const H5std_string& expression) const; + // Sets data transform expression. + void setDataTransform(const char* expression) const; + void setDataTransform(const H5std_string& expression) const; - // Gets data transform expression. - ssize_t getDataTransform(char* exp, size_t buf_size=0) const; - H5std_string getDataTransform() const; + // Gets data transform expression. + ssize_t getDataTransform(char* exp, size_t buf_size=0) const; + H5std_string getDataTransform() const; - // Sets the dataset transfer property list status to TRUE or FALSE. - void setPreserve( bool status ) const; + // Sets the dataset transfer property list status to TRUE or FALSE. + void setPreserve(bool status) const; - // Checks status of the dataset transfer property list. - bool getPreserve() const; + // Checks status of the dataset transfer property list. + bool getPreserve() const; - // Sets an exception handling callback for datatype conversion. - void setTypeConvCB( H5T_conv_except_func_t op, void *user_data) const; + // Sets an exception handling callback for datatype conversion. + void setTypeConvCB(H5T_conv_except_func_t op, void *user_data) const; - // Gets the exception handling callback for datatype conversion. - void getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) const; + // Gets the exception handling callback for datatype conversion. + void getTypeConvCB(H5T_conv_except_func_t *op, void **user_data) const; - // Sets the memory manager for variable-length datatype - // allocation in H5Dread and H5Dvlen_reclaim. - void setVlenMemManager( H5MM_allocate_t alloc, void* alloc_info, - H5MM_free_t free, void* free_info ) const; + // Sets the memory manager for variable-length datatype + // allocation in H5Dread and H5Dvlen_reclaim. + void setVlenMemManager(H5MM_allocate_t alloc, void* alloc_info, + H5MM_free_t free, void* free_info) const; - // alloc and free are set to NULL, indicating that system - // malloc and free are to be used. - void setVlenMemManager() const; + // alloc and free are set to NULL, indicating that system + // malloc and free are to be used. + void setVlenMemManager() const; - // Gets the memory manager for variable-length datatype - // allocation in H5Dread and H5Tvlen_reclaim. - void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info, - H5MM_free_t& free, void** free_info ) const; + // Gets the memory manager for variable-length datatype + // allocation in H5Dread and H5Tvlen_reclaim. + void getVlenMemManager(H5MM_allocate_t& alloc, void** alloc_info, + H5MM_free_t& free, void** free_info) const; - // Sets the size of a contiguous block reserved for small data. - void setSmallDataBlockSize(hsize_t size) const; + // Sets the size of a contiguous block reserved for small data. + void setSmallDataBlockSize(hsize_t size) const; - // Returns the current small data block size setting. - hsize_t getSmallDataBlockSize() const; + // Returns the current small data block size setting. + hsize_t getSmallDataBlockSize() const; - // Sets number of I/O vectors to be read/written in hyperslab I/O. - void setHyperVectorSize(size_t vector_size) const; + // Sets number of I/O vectors to be read/written in hyperslab I/O. + void setHyperVectorSize(size_t vector_size) const; - // Returns the number of I/O vectors to be read/written in - // hyperslab I/O. - size_t getHyperVectorSize() const; + // Returns the number of I/O vectors to be read/written in + // hyperslab I/O. + size_t getHyperVectorSize() const; - // Enables or disables error-detecting for a dataset reading - // process. - void setEDCCheck(H5Z_EDC_t check) const; + // Enables or disables error-detecting for a dataset reading + // process. + void setEDCCheck(H5Z_EDC_t check) const; - // Determines whether error-detection is enabled for dataset reads. - H5Z_EDC_t getEDCCheck() const; + // Determines whether error-detection is enabled for dataset reads. + H5Z_EDC_t getEDCCheck() const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DSetMemXferPropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DSetMemXferPropList"); } - // Copy constructor: makes a copy of a DSetMemXferPropList object. - DSetMemXferPropList(const DSetMemXferPropList& orig); + // Copy constructor: makes a copy of a DSetMemXferPropList object. + DSetMemXferPropList(const DSetMemXferPropList& orig); - // Creates a copy of an existing dataset memory and transfer - // property list using the property list id. - DSetMemXferPropList(const hid_t plist_id); + // Creates a copy of an existing dataset memory and transfer + // property list using the property list id. + DSetMemXferPropList(const hid_t plist_id); - // Noop destructor - virtual ~DSetMemXferPropList(); + // Noop destructor + virtual ~DSetMemXferPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -121,7 +121,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { static void deleteConstants(); private: - static DSetMemXferPropList* DEFAULT_; + static DSetMemXferPropList* DEFAULT_; // Creates the global constant, should only be used by the library static DSetMemXferPropList* getConstant(); diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 5e1f0bd..49f60e6 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -15,7 +15,7 @@ #include -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -37,230 +37,230 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: EnumType default constructor -///\brief Default constructor: Creates a stub datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType default constructor +///\brief Default constructor: Creates a stub datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType::EnumType() : DataType() {} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Creates an EnumType object using the id of an existing datatype. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType overloaded constructor +///\brief Creates an EnumType object using the id of an existing datatype. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType( const hid_t existing_id ) : DataType( existing_id ) {} +EnumType::EnumType(const hid_t existing_id) : DataType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: EnumType copy constructor -///\brief Copy constructor: makes a copy of the original EnumType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType copy constructor +///\brief Copy constructor: makes a copy of the original EnumType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType( const EnumType& original ) : DataType( original ) {} +EnumType::EnumType(const EnumType& original) : DataType( original ) {} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Creates an empty enumeration datatype given a size, in bytes. -///\param size - IN: Number of bytes in the datatype to create -///\exception H5::DataTypeIException +// Function: EnumType overloaded constructor +///\brief Creates an empty enumeration datatype given a size, in bytes. +///\param size - IN: Number of bytes in the datatype to create +///\exception H5::DataTypeIException // Description -// The DataType constructor calls the C API H5Tcreate to create -// the enum datatype. -// Programmer Binh-Minh Ribler - 2000 +// The DataType constructor calls the C API H5Tcreate to create +// the enum datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType( size_t size ) : DataType( H5T_ENUM, size ) {} +EnumType::EnumType(size_t size) : DataType( H5T_ENUM, size ) {} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Gets the enum datatype of the specified dataset. -///\param dataset - IN: Dataset that this enum datatype associates with -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType overloaded constructor +///\brief Gets the enum datatype of the specified dataset. +///\param dataset - IN: Dataset that this enum datatype associates with +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType( const DataSet& dataset ) : DataType() +EnumType::EnumType(const DataSet& dataset) : DataType() { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type( dataset.getId() ); + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type(dataset.getId()); - // If the datatype id is not valid, throw an exception - if( id < 0 ) - { - throw DataSetIException("EnumType constructor", "H5Dget_type failed"); - } + // If the datatype id is not valid, throw an exception + if (id < 0) + { + throw DataSetIException("EnumType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Creates a new enum datatype based on an integer datatype. -///\param data_type - IN: Base datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType overloaded constructor +///\brief Creates a new enum datatype based on an integer datatype. +///\param data_type - IN: Base datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType( const IntType& data_type ) : DataType() +EnumType::EnumType(const IntType& data_type) : DataType() { - // Calls C function H5Tenum_create to get the id of the datatype - id = H5Tenum_create( data_type.getId() ); + // Calls C function H5Tenum_create to get the id of the datatype + id = H5Tenum_create(data_type.getId()); - // If the datatype id is not valid, throw an exception - if( id < 0 ) - { - throw DataSetIException("EnumType constructor", "H5Tenum_create failed"); - } + // If the datatype id is not valid, throw an exception + if (id < 0) + { + throw DataSetIException("EnumType constructor", "H5Tenum_create failed"); + } } //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Creates an EnumType instance by opening an HDF5 enum datatype -/// given its name, provided as a C character string. -///\param dtype_name - IN: Enum datatype name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: EnumType overloaded constructor +///\brief Creates an EnumType instance by opening an HDF5 enum datatype +/// given its name, provided as a C character string. +///\param dtype_name - IN: Enum datatype name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openEnumType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openEnumType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- EnumType::EnumType(const H5Location& loc, const char *dtype_name) : DataType() { - id = p_opentype(loc, dtype_name); + id = p_opentype(loc, dtype_name); } //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Creates an EnumType instance by opening an HDF5 enum datatype -/// given its name, provided as an \c H5std_string. -///\param dtype_name - IN: Enum datatype name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: EnumType overloaded constructor +///\brief Creates an EnumType instance by opening an HDF5 enum datatype +/// given its name, provided as an \c H5std_string. +///\param dtype_name - IN: Enum datatype name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openEnumType(const H5std_string&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openEnumType(const H5std_string&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- EnumType::EnumType(const H5Location& loc, const H5std_string& dtype_name) : DataType() { - id = p_opentype(loc, dtype_name.c_str()); + id = p_opentype(loc, dtype_name.c_str()); } //-------------------------------------------------------------------------- -// Function: EnumType::insert -///\brief Inserts a new member to this enumeration datatype. -///\param name - IN: Name of the new member -///\param value - IN: Pointer to the value of the new member -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::insert +///\brief Inserts a new member to this enumeration datatype. +///\param name - IN: Name of the new member +///\param value - IN: Pointer to the value of the new member +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::insert( const char* name, void *value ) const +void EnumType::insert(const char* name, void *value) const { - // Calls C routine H5Tenum_insert to insert the new enum datatype member. - herr_t ret_value = H5Tenum_insert( id, name, value ); - if( ret_value < 0 ) - { - throw DataTypeIException("EnumType::insert", "H5Tenum_insert failed"); - } + // Calls C routine H5Tenum_insert to insert the new enum datatype member. + herr_t ret_value = H5Tenum_insert(id, name, value); + if (ret_value < 0) + { + throw DataTypeIException("EnumType::insert", "H5Tenum_insert failed"); + } } //-------------------------------------------------------------------------- -// Function: EnumType::insert -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::insert +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::insert( const H5std_string& name, void *value ) const +void EnumType::insert(const H5std_string& name, void *value) const { - insert( name.c_str(), value ); + insert(name.c_str(), value); } //-------------------------------------------------------------------------- -// Function: EnumType::nameOf -///\brief Returns the symbol name corresponding to a specified member -/// of this enumeration datatype. -///\param value - IN: Pointer to the value of the enum datatype -///\param size - IN: Size for the name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::nameOf +///\brief Returns the symbol name corresponding to a specified member +/// of this enumeration datatype. +///\param value - IN: Pointer to the value of the enum datatype +///\param size - IN: Size for the name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string EnumType::nameOf( void *value, size_t size ) const +H5std_string EnumType::nameOf(void *value, size_t size) const { - char* name_C = new char[size+1]; // temporary C-string for C API - HDmemset(name_C, 0, size+1); // clear buffer + char* name_C = new char[size+1]; // temporary C-string for C API + HDmemset(name_C, 0, size+1); // clear buffer - // Calls C routine H5Tenum_nameof to get the name of the specified enum type - herr_t ret_value = H5Tenum_nameof( id, value, name_C, size ); + // Calls C routine H5Tenum_nameof to get the name of the specified enum type + herr_t ret_value = H5Tenum_nameof(id, value, name_C, size); - // If H5Tenum_nameof returns a negative value, raise an exception, - if( ret_value < 0 ) - { + // If H5Tenum_nameof returns a negative value, raise an exception, + if (ret_value < 0) + { delete []name_C; - throw DataTypeIException("EnumType::nameOf", "H5Tenum_nameof failed"); - } - // otherwise, create the string to hold the datatype name and return it - H5std_string name(name_C); - delete []name_C; - return( name ); + throw DataTypeIException("EnumType::nameOf", "H5Tenum_nameof failed"); + } + // otherwise, create the string to hold the datatype name and return it + H5std_string name(name_C); + delete []name_C; + return(name); } //-------------------------------------------------------------------------- -// Function: EnumType::valueOf -///\brief Retrieves the value corresponding to a member of this -/// enumeration datatype, given the member's name. -///\param name - IN: Name of the queried member -///\param value - OUT: Pointer to the retrieved value -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::valueOf +///\brief Retrieves the value corresponding to a member of this +/// enumeration datatype, given the member's name. +///\param name - IN: Name of the queried member +///\param value - OUT: Pointer to the retrieved value +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::valueOf( const char* name, void *value ) const +void EnumType::valueOf(const char* name, void *value) const { - // Calls C routine H5Tenum_valueof to get the enum datatype value - herr_t ret_value = H5Tenum_valueof( id, name, value ); - if( ret_value < 0 ) - { - throw DataTypeIException("EnumType::valueOf", "H5Tenum_valueof failed"); - } + // Calls C routine H5Tenum_valueof to get the enum datatype value + herr_t ret_value = H5Tenum_valueof(id, name, value); + if (ret_value < 0) + { + throw DataTypeIException("EnumType::valueOf", "H5Tenum_valueof failed"); + } } //-------------------------------------------------------------------------- -// Function: EnumType::valueOf -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::valueOf +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::valueOf( const H5std_string& name, void *value ) const +void EnumType::valueOf(const H5std_string& name, void *value) const { - valueOf( name.c_str(), value ); + valueOf(name.c_str(), value); } //-------------------------------------------------------------------------- -// Function: EnumType::getMemberIndex -///\brief Returns the index of a member in this enumeration datatype. -///\param name - IN: Name of the queried member -///\return Index of the member if it exists. Index will have the value -/// between 0 and \c N-1, where \c N is the value returned by the -/// member function \c EnumType::getNmembers. -///\exception H5::DataTypeIException +// Function: EnumType::getMemberIndex +///\brief Returns the index of a member in this enumeration datatype. +///\param name - IN: Name of the queried member +///\return Index of the member if it exists. Index will have the value +/// between 0 and \c N-1, where \c N is the value returned by the +/// member function \c EnumType::getNmembers. +///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- int EnumType::getMemberIndex(const char *name) const { - int member_index = H5Tget_member_index(id, name); - if( member_index < 0 ) - { - throw DataTypeIException("EnumType::getMemberIndex", + int member_index = H5Tget_member_index(id, name); + if (member_index < 0) + { + throw DataTypeIException("EnumType::getMemberIndex", "H5Tget_member_index returns negative value"); - } - return( member_index ); + } + return(member_index); } //-------------------------------------------------------------------------- -// Function: EnumType::getMemberIndex -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of -/// argument \a name. +// Function: EnumType::getMemberIndex +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of +/// argument \a name. // Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- int EnumType::getMemberIndex(const H5std_string& name) const @@ -269,46 +269,46 @@ int EnumType::getMemberIndex(const H5std_string& name) const } //-------------------------------------------------------------------------- -// Function: EnumType::getNmembers -///\brief Returns the number of members in this enumeration datatype. -///\return Number of members -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: EnumType::getNmembers +///\brief Returns the number of members in this enumeration datatype. +///\return Number of members +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- int EnumType::getNmembers() const { - int num_members = H5Tget_nmembers( id ); - if( num_members < 0 ) - { - throw DataTypeIException("EnumType::getNmembers", + int num_members = H5Tget_nmembers(id); + if (num_members < 0) + { + throw DataTypeIException("EnumType::getNmembers", "H5Tget_nmembers returns negative number of members"); - } - return( num_members ); + } + return(num_members); } //-------------------------------------------------------------------------- -// Function: EnumType::getMemberValue -///\brief Retrieves the value of a member in this enumeration datatype, -/// given the member's index. -///\param memb_no - IN: Index of the queried member -///\param value - OUT: Pointer to the retrieved value -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::getMemberValue +///\brief Retrieves the value of a member in this enumeration datatype, +/// given the member's index. +///\param memb_no - IN: Index of the queried member +///\param value - OUT: Pointer to the retrieved value +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::getMemberValue( unsigned memb_no, void *value ) const +void EnumType::getMemberValue(unsigned memb_no, void *value) const { - // Call C routine H5Tget_member_value to get the datatype member's value - hid_t ret_value = H5Tget_member_value( id, memb_no, value ); - if( ret_value < 0 ) - { - throw DataTypeIException("EnumType::getMemberValue", "H5Tget_member_value failed"); - } + // Call C routine H5Tget_member_value to get the datatype member's value + hid_t ret_value = H5Tget_member_value(id, memb_no, value); + if (ret_value < 0) + { + throw DataTypeIException("EnumType::getMemberValue", "H5Tget_member_value failed"); + } } //-------------------------------------------------------------------------- -// Function: EnumType destructor -///\brief Properly terminates access to this enum datatype. -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType destructor +///\brief Properly terminates access to this enum datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType::~EnumType() {} diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index 054811b..2fbe2cd 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -28,56 +28,56 @@ namespace H5 { class H5_DLLCPP EnumType : public DataType { public: - // Creates an empty enumeration datatype based on a native signed - // integer type, whose size is given by size. - EnumType( size_t size ); + // Creates an empty enumeration datatype based on a native signed + // integer type, whose size is given by size. + EnumType(size_t size); - // Gets the enum datatype of the specified dataset - EnumType( const DataSet& dataset ); // H5Dget_type + // Gets the enum datatype of the specified dataset + EnumType(const DataSet& dataset); // H5Dget_type - // Creates a new enum datatype based on an integer datatype - EnumType( const IntType& data_type ); // H5Tenum_create + // Creates a new enum datatype based on an integer datatype + EnumType(const IntType& data_type); // H5Tenum_create - // Constructors that open an enum datatype, given a location. - EnumType(const H5Location& loc, const char* name); - EnumType(const H5Location& loc, const H5std_string& name); + // Constructors that open an enum datatype, given a location. + EnumType(const H5Location& loc, const char* name); + EnumType(const H5Location& loc, const H5std_string& name); - // Returns the number of members in this enumeration datatype. - int getNmembers () const; + // Returns the number of members in this enumeration datatype. + int getNmembers () const; - // Returns the index of a member in this enumeration data type. - int getMemberIndex(const char* name) const; - int getMemberIndex(const H5std_string& name) const; + // Returns the index of a member in this enumeration data type. + int getMemberIndex(const char* name) const; + int getMemberIndex(const H5std_string& name) const; - // Returns the value of an enumeration datatype member - void getMemberValue( unsigned memb_no, void *value ) const; + // Returns the value of an enumeration datatype member + void getMemberValue(unsigned memb_no, void *value) const; - // Inserts a new member to this enumeration type. - void insert( const char* name, void *value ) const; - void insert( const H5std_string& name, void *value ) const; + // Inserts a new member to this enumeration type. + void insert(const char* name, void *value) const; + void insert(const H5std_string& name, void *value) const; - // Returns the symbol name corresponding to a specified member - // of this enumeration datatype. - H5std_string nameOf( void *value, size_t size ) const; + // Returns the symbol name corresponding to a specified member + // of this enumeration datatype. + H5std_string nameOf(void *value, size_t size) const; - // Returns the value corresponding to a specified member of this - // enumeration datatype. - void valueOf( const char* name, void *value ) const; - void valueOf( const H5std_string& name, void *value ) const; + // Returns the value corresponding to a specified member of this + // enumeration datatype. + void valueOf(const char* name, void *value) const; + void valueOf(const H5std_string& name, void *value) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("EnumType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("EnumType"); } - // Default constructor - EnumType(); + // Default constructor + EnumType(); - // Creates an enumeration datatype using an existing id - EnumType( const hid_t existing_id ); + // Creates an enumeration datatype using an existing id + EnumType(const hid_t existing_id); - // Copy constructor: makes a copy of the original EnumType object. - EnumType( const EnumType& original ); + // Copy constructor: makes a copy of the original EnumType object. + EnumType(const EnumType& original); - virtual ~EnumType(); + virtual ~EnumType(); }; } #endif // __H5EnumType_H diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 335bb20..0316f64 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -23,207 +23,207 @@ namespace H5 { const char Exception::DEFAULT_MSG[] = "No detailed information provided"; //-------------------------------------------------------------------------- -// Function: Exception default constructor -///\brief Default constructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception default constructor +///\brief Default constructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Exception::Exception() : detail_message(""), func_name("") {} //-------------------------------------------------------------------------- -// Function: Exception overloaded constructor -///\brief Creates an exception with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception overloaded constructor +///\brief Creates an exception with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Exception::Exception(const H5std_string& func, const H5std_string& message) : detail_message(message), func_name(func) {} //-------------------------------------------------------------------------- -// Function: Exception copy constructor -///\brief Copy constructor: makes a copy of the original Exception object. -///\param orig - IN: Exception instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception copy constructor +///\brief Copy constructor: makes a copy of the original Exception object. +///\param orig - IN: Exception instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Exception::Exception( const Exception& orig ) : detail_message(orig.detail_message), func_name(orig.func_name) {} +Exception::Exception(const Exception& orig) : detail_message(orig.detail_message), func_name(orig.func_name) {} //-------------------------------------------------------------------------- -// Function: Exception::getMajorString -///\brief Returns a text string that describes the error -/// specified by a major error number. -///\param err_major - IN: Major error number -///\return Major error string +// Function: Exception::getMajorString +///\brief Returns a text string that describes the error +/// specified by a major error number. +///\param err_major - IN: Major error number +///\return Major error string ///\par Description -/// In the failure case, the string "Invalid major error number" -/// will be returned. -// Programmer Binh-Minh Ribler - 2000 +/// In the failure case, the string "Invalid major error number" +/// will be returned. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string Exception::getMajorString( hid_t err_major ) const +H5std_string Exception::getMajorString(hid_t err_major) const { - // Preliminary call to H5Eget_msg() to get the length of the message - ssize_t mesg_size = H5Eget_msg(err_major, NULL, NULL, 0); - - // If H5Eget_msg() returns a negative value, raise an exception, - if( mesg_size < 0 ) - throw IdComponentException("Exception::getMajorString", - "H5Eget_msg failed"); - - // Call H5Eget_msg again to get the actual message - char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API - mesg_size = H5Eget_msg(err_major, NULL, mesg_C, mesg_size+1); - - // Check for failure again - if( mesg_size < 0 ) - { - delete []mesg_C; - throw IdComponentException("Exception::getMajorString", - "H5Eget_msg failed"); - } - - // Convert the C error description and return - H5std_string major_str(mesg_C); - delete []mesg_C; - return( major_str ); + // Preliminary call to H5Eget_msg() to get the length of the message + ssize_t mesg_size = H5Eget_msg(err_major, NULL, NULL, 0); + + // If H5Eget_msg() returns a negative value, raise an exception, + if (mesg_size < 0) + throw IdComponentException("Exception::getMajorString", + "H5Eget_msg failed"); + + // Call H5Eget_msg again to get the actual message + char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API + mesg_size = H5Eget_msg(err_major, NULL, mesg_C, mesg_size+1); + + // Check for failure again + if (mesg_size < 0) + { + delete []mesg_C; + throw IdComponentException("Exception::getMajorString", + "H5Eget_msg failed"); + } + + // Convert the C error description and return + H5std_string major_str(mesg_C); + delete []mesg_C; + return(major_str); } //-------------------------------------------------------------------------- -// Function: Exception::getMinorString -///\brief Returns a text string that describes the error -/// specified by a minor error number. -///\param err_minor - IN: Minor error number -///\return Minor error string +// Function: Exception::getMinorString +///\brief Returns a text string that describes the error +/// specified by a minor error number. +///\param err_minor - IN: Minor error number +///\return Minor error string ///\par Description -/// In the failure case, the string "Invalid minor error number" -/// will be returned. -// Programmer Binh-Minh Ribler - 2000 +/// In the failure case, the string "Invalid minor error number" +/// will be returned. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string Exception::getMinorString( hid_t err_minor ) const +H5std_string Exception::getMinorString(hid_t err_minor) const { - // Preliminary call to H5Eget_msg() to get the length of the message - ssize_t mesg_size = H5Eget_msg(err_minor, NULL, NULL, 0); - - // If H5Eget_msg() returns a negative value, raise an exception, - if( mesg_size < 0 ) - throw IdComponentException("Exception::getMinorString", - "H5Eget_msg failed"); - - // Call H5Eget_msg again to get the actual message - char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API - mesg_size = H5Eget_msg(err_minor, NULL, mesg_C, mesg_size+1); - - // Check for failure again - if( mesg_size < 0 ) - { - delete []mesg_C; - throw IdComponentException("Exception::getMinorString", - "H5Eget_msg failed"); - } - - // Convert the C error description and return - H5std_string minor_str(mesg_C); - delete []mesg_C; - return( minor_str ); + // Preliminary call to H5Eget_msg() to get the length of the message + ssize_t mesg_size = H5Eget_msg(err_minor, NULL, NULL, 0); + + // If H5Eget_msg() returns a negative value, raise an exception, + if (mesg_size < 0) + throw IdComponentException("Exception::getMinorString", + "H5Eget_msg failed"); + + // Call H5Eget_msg again to get the actual message + char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API + mesg_size = H5Eget_msg(err_minor, NULL, mesg_C, mesg_size+1); + + // Check for failure again + if (mesg_size < 0) + { + delete []mesg_C; + throw IdComponentException("Exception::getMinorString", + "H5Eget_msg failed"); + } + + // Convert the C error description and return + H5std_string minor_str(mesg_C); + delete []mesg_C; + return(minor_str); } //-------------------------------------------------------------------------- -// Function: Exception::setAutoPrint -///\brief Turns on the automatic error printing. -///\param func - IN: Function to be called upon an error condition -///\param client_data - IN: Data passed to the error function +// Function: Exception::setAutoPrint +///\brief Turns on the automatic error printing. +///\param func - IN: Function to be called upon an error condition +///\param client_data - IN: Data passed to the error function ///\par Description -/// When the library is first initialized the auto printing -/// function, \a func, is set to the C API \c H5Eprint and -/// \a client_data is the standard error stream pointer, \c stderr. -/// Automatic stack traversal is always in the \c H5E_WALK_DOWNWARD -/// direction. +/// When the library is first initialized the auto printing +/// function, \a func, is set to the C API \c H5Eprint and +/// \a client_data is the standard error stream pointer, \c stderr. +/// Automatic stack traversal is always in the \c H5E_WALK_DOWNWARD +/// direction. ///\par -/// Users are encouraged to write their own more specific error -/// handlers -// Programmer Binh-Minh Ribler - 2000 +/// Users are encouraged to write their own more specific error +/// handlers +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Exception::setAutoPrint( H5E_auto2_t& func, void* client_data ) +void Exception::setAutoPrint(H5E_auto2_t& func, void* client_data) { - // calls the C API routine H5Eset_auto to set the auto printing to - // the specified function. - herr_t ret_value = H5Eset_auto2( H5E_DEFAULT, func, client_data ); - if( ret_value < 0 ) - throw Exception( "Exception::setAutoPrint", "H5Eset_auto failed" ); + // calls the C API routine H5Eset_auto to set the auto printing to + // the specified function. + herr_t ret_value = H5Eset_auto2(H5E_DEFAULT, func, client_data); + if (ret_value < 0) + throw Exception("Exception::setAutoPrint", "H5Eset_auto failed"); } //-------------------------------------------------------------------------- -// Function: Exception::dontPrint -///\brief Turns off the automatic error printing from the C library. -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::dontPrint +///\brief Turns off the automatic error printing from the C library. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Exception::dontPrint() { - // calls the C API routine H5Eset_auto with NULL parameters to turn - // off the automatic error printing. - herr_t ret_value = H5Eset_auto2( H5E_DEFAULT, NULL, NULL ); - if( ret_value < 0 ) - throw Exception( "Exception::dontPrint", "H5Eset_auto failed" ); + // calls the C API routine H5Eset_auto with NULL parameters to turn + // off the automatic error printing. + herr_t ret_value = H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + if (ret_value < 0) + throw Exception("Exception::dontPrint", "H5Eset_auto failed"); } //-------------------------------------------------------------------------- -// Function: Exception::getAutoPrint -///\brief Retrieves the current settings for the automatic error -/// stack traversal function and its data. -///\param func - OUT: Current setting for the function to be -/// called upon an error condition -///\param client_data - OUT: Current setting for the data passed to -/// the error function -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getAutoPrint +///\brief Retrieves the current settings for the automatic error +/// stack traversal function and its data. +///\param func - OUT: Current setting for the function to be +/// called upon an error condition +///\param client_data - OUT: Current setting for the data passed to +/// the error function +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Exception::getAutoPrint( H5E_auto2_t& func, void** client_data ) +void Exception::getAutoPrint(H5E_auto2_t& func, void** client_data) { - // calls the C API routine H5Eget_auto to get the current setting of - // the automatic error printing - herr_t ret_value = H5Eget_auto2( H5E_DEFAULT, &func, client_data ); - if( ret_value < 0 ) - throw Exception( "Exception::getAutoPrint", "H5Eget_auto failed" ); + // calls the C API routine H5Eget_auto to get the current setting of + // the automatic error printing + herr_t ret_value = H5Eget_auto2(H5E_DEFAULT, &func, client_data); + if (ret_value < 0) + throw Exception("Exception::getAutoPrint", "H5Eget_auto failed"); } //-------------------------------------------------------------------------- -// Function: Exception::clearErrorStack -///\brief Clears the error stack for the current thread. +// Function: Exception::clearErrorStack +///\brief Clears the error stack for the current thread. ///\par Description -/// The stack is also cleared whenever a C API function is -/// called, with certain exceptions (for instance, \c H5Eprint). -// Programmer Binh-Minh Ribler - 2000 +/// The stack is also cleared whenever a C API function is +/// called, with certain exceptions (for instance, \c H5Eprint). +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Exception::clearErrorStack() { - // calls the C API routine H5Eclear to clear the error stack - herr_t ret_value = H5Eclear2(H5E_DEFAULT); - if( ret_value < 0 ) - throw Exception( "Exception::clearErrorStack", "H5Eclear failed" ); + // calls the C API routine H5Eclear to clear the error stack + herr_t ret_value = H5Eclear2(H5E_DEFAULT); + if (ret_value < 0) + throw Exception("Exception::clearErrorStack", "H5Eclear failed"); } //-------------------------------------------------------------------------- -// Function: Exception::walkErrorStack -///\brief Walks the error stack for the current thread, calling the -/// specified function. -///\param direction - IN: Direction in which the error stack is to be walked -///\param func - IN: Function to be called for each error encountered -///\param client_data - IN: Data passed to the error function +// Function: Exception::walkErrorStack +///\brief Walks the error stack for the current thread, calling the +/// specified function. +///\param direction - IN: Direction in which the error stack is to be walked +///\param func - IN: Function to be called for each error encountered +///\param client_data - IN: Data passed to the error function ///\par Description -/// Valid values for \a direction include: -/// \li \c H5E_WALK_UPWARD - begin with the most specific error -/// and end at the API -/// \li \c H5E_WALK_DOWNWARD - begin at the API and end at the -/// inner-most function where the error was first detected +/// Valid values for \a direction include: +/// \li \c H5E_WALK_UPWARD - begin with the most specific error +/// and end at the API +/// \li \c H5E_WALK_DOWNWARD - begin at the API and end at the +/// inner-most function where the error was first detected ///\par -/// The function specified by \a func will be called for each -/// error in the error stack. The \c H5E_walk_t prototype is as -/// follows: +/// The function specified by \a func will be called for each +/// error in the error stack. The \c H5E_walk_t prototype is as +/// follows: ///\code /// typedef herr_t (*H5E_walk_t)(int n, H5E_error_t *err_desc, void *client_data) /// int n - Indexed position of the error in the stack; it begins at zero -/// regardless of stack traversal direction +/// regardless of stack traversal direction /// H5E_error_t *err_desc - Pointer to a data structure describing the -/// error. This structure is listed below. +/// error. This structure is listed below. /// void *client_data - Pointer to client data in the format expected by -/// the user-defined function. +/// the user-defined function. ///\endcode ///\par /// Data structure to describe the error: @@ -238,87 +238,87 @@ void Exception::clearErrorStack() /// const char *desc; //optional supplied description /// } H5E_error2_t; ///\endcode -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Exception::walkErrorStack( H5E_direction_t direction, H5E_walk2_t func, void* client_data ) +void Exception::walkErrorStack(H5E_direction_t direction, H5E_walk2_t func, void* client_data) { - // calls the C API routine H5Ewalk to walk the error stack - herr_t ret_value = H5Ewalk2( H5E_DEFAULT, direction, func, client_data ); - if( ret_value < 0 ) - throw Exception( "Exception::walkErrorStack", "H5Ewalk failed" ); + // calls the C API routine H5Ewalk to walk the error stack + herr_t ret_value = H5Ewalk2(H5E_DEFAULT, direction, func, client_data); + if (ret_value < 0) + throw Exception("Exception::walkErrorStack", "H5Ewalk failed"); } //-------------------------------------------------------------------------- -// Function: Exception::getDetailMsg -///\brief Returns the detailed message set at the time the exception -/// is thrown. -///\return Text message - \c H5std_string -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getDetailMsg +///\brief Returns the detailed message set at the time the exception +/// is thrown. +///\return Text message - \c H5std_string +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string Exception::getDetailMsg() const { - return(detail_message); + return(detail_message); } //-------------------------------------------------------------------------- -// Function: Exception::getCDetailMsg -///\brief Returns the detailed message set at the time the exception -/// is thrown. -///\return Text message - \c char pointer -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getCDetailMsg +///\brief Returns the detailed message set at the time the exception +/// is thrown. +///\return Text message - \c char pointer +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- const char* Exception::getCDetailMsg() const { - return(detail_message.c_str()); + return(detail_message.c_str()); } //-------------------------------------------------------------------------- -// Function: Exception::getFuncName -///\brief Returns the name of the function, where the exception is thrown. -///\return Text message - \c H5std_string -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getFuncName +///\brief Returns the name of the function, where the exception is thrown. +///\return Text message - \c H5std_string +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string Exception::getFuncName() const { - return(func_name); + return(func_name); } //-------------------------------------------------------------------------- -// Function: Exception::getCFuncName -///\brief Returns the name of the function, where the exception is thrown. -///\return Text message - \c char pointer -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getCFuncName +///\brief Returns the name of the function, where the exception is thrown. +///\return Text message - \c char pointer +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- const char* Exception::getCFuncName() const { - return(func_name.c_str()); + return(func_name.c_str()); } //-------------------------------------------------------------------------- -// Function: Exception::printErrorStack (static) -///\brief Prints the error stack in a default manner. -///\param stream - IN: File pointer, default to stderr -///\param err_stack - IN: Error stack ID, default to H5E_DEFAULT(0) -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::printErrorStack (static) +///\brief Prints the error stack in a default manner. +///\param stream - IN: File pointer, default to stderr +///\param err_stack - IN: Error stack ID, default to H5E_DEFAULT(0) +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Exception::printErrorStack(FILE* stream, hid_t err_stack) { herr_t ret_value = H5Eprint2(err_stack, stream); - if( ret_value < 0 ) - throw Exception( "Printing error stack", "H5Eprint2 failed" ); + if (ret_value < 0) + throw Exception("Printing error stack", "H5Eprint2 failed"); } //-------------------------------------------------------------------------- -// Function: Exception::printError -// Purpose: Prints the error stack in a default manner. This member -// function is replaced by the static function printErrorStack -// and will be removed from the next major release. -// Parameter stream - IN: File pointer -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::printError +// Purpose: Prints the error stack in a default manner. This member +// function is replaced by the static function printErrorStack +// and will be removed from the next major release. +// Parameter stream - IN: File pointer +// Programmer Binh-Minh Ribler - 2000 // Description: -// This function can be removed in next major release. -// -BMR, 2014/04/24 -// Removed from documentation. -BMR, 2016/03/23 +// This function can be removed in next major release. +// -BMR, 2014/04/24 +// Removed from documentation. -BMR, 2016/03/23 //-------------------------------------------------------------------------- void Exception::printError(FILE* stream) const { @@ -326,285 +326,285 @@ void Exception::printError(FILE* stream) const } //-------------------------------------------------------------------------- -// Function: Exception destructor -///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Exception::~Exception() throw() {} //-------------------------------------------------------------------------- -// Subclass: FileIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: FileIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: FileIException default constructor -///\brief Default constructor. +// Function: FileIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- FileIException::FileIException():Exception(){} //-------------------------------------------------------------------------- -// Function: FileIException overloaded constructor -///\brief Creates a FileIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: FileIException overloaded constructor +///\brief Creates a FileIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- FileIException::FileIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: FileIException destructor -///\brief Noop destructor. +// Function: FileIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- FileIException::~FileIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: GroupIException default constructor -///\brief Default constructor. +// Function: GroupIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- GroupIException::GroupIException():Exception(){} //-------------------------------------------------------------------------- -// Function: GroupIException overloaded constructor -///\brief Creates a GroupIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: GroupIException overloaded constructor +///\brief Creates a GroupIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- GroupIException::GroupIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: GroupIException destructor -///\brief Noop destructor. +// Function: GroupIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- GroupIException::~GroupIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: DataSpaceIException default constructor -///\brief Default constructor. +// Function: DataSpaceIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- DataSpaceIException::DataSpaceIException():Exception(){} //-------------------------------------------------------------------------- -// Function: DataSpaceIException overloaded constructor -///\brief Creates a DataSpaceIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: DataSpaceIException overloaded constructor +///\brief Creates a DataSpaceIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- DataSpaceIException::DataSpaceIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: DataSpaceIException destructor -///\brief Noop destructor. +// Function: DataSpaceIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- DataSpaceIException::~DataSpaceIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: DataTypeIException default constructor -///\brief Default constructor. +// Function: DataTypeIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- DataTypeIException::DataTypeIException():Exception(){} //-------------------------------------------------------------------------- -// Function: DataTypeIException overloaded constructor -///\brief Creates a DataTypeIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: DataTypeIException overloaded constructor +///\brief Creates a DataTypeIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- DataTypeIException::DataTypeIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: DataTypeIException destructor -///\brief Noop destructor. +// Function: DataTypeIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- DataTypeIException::~DataTypeIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: ObjHeaderIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: ObjHeaderIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: ObjHeaderIException default constructor -///\brief Default constructor. +// Function: ObjHeaderIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- ObjHeaderIException::ObjHeaderIException():Exception(){} //-------------------------------------------------------------------------- -// Function: ObjHeaderIException overloaded constructor -///\brief Creates an ObjHeaderIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: ObjHeaderIException overloaded constructor +///\brief Creates an ObjHeaderIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- ObjHeaderIException::ObjHeaderIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: ObjHeaderIException destructor -///\brief Noop destructor. +// Function: ObjHeaderIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- ObjHeaderIException::~ObjHeaderIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: PropListIException default constructor -///\brief Default constructor. +// Function: PropListIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- PropListIException::PropListIException():Exception(){} //-------------------------------------------------------------------------- -// Function: PropListIException overloaded constructor -///\brief Creates a PropListIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: PropListIException overloaded constructor +///\brief Creates a PropListIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- PropListIException::PropListIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: PropListIException destructor -///\brief Noop destructor. +// Function: PropListIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- PropListIException::~PropListIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: DataSetIException default constructor -///\brief Default constructor. +// Function: DataSetIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- DataSetIException::DataSetIException():Exception(){} //-------------------------------------------------------------------------- -// Function: DataSetIException overloaded constructor -///\brief Creates a DataSetIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: DataSetIException overloaded constructor +///\brief Creates a DataSetIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- DataSetIException::DataSetIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: DataSetIException destructor -///\brief Noop destructor. +// Function: DataSetIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- DataSetIException::~DataSetIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: AttributeIException default constructor -///\brief Default constructor. +// Function: AttributeIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- AttributeIException::AttributeIException():Exception(){} //-------------------------------------------------------------------------- -// Function: AttributeIException overloaded constructor -///\brief Creates an AttributeIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: AttributeIException overloaded constructor +///\brief Creates an AttributeIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- AttributeIException::AttributeIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: AttributeIException destructor -///\brief Noop destructor. +// Function: AttributeIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- AttributeIException::~AttributeIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: ReferenceException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: ReferenceException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: ReferenceException default constructor -///\brief Default constructor. +// Function: ReferenceException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- ReferenceException::ReferenceException():Exception(){} //-------------------------------------------------------------------------- -// Function: ReferenceException overloaded constructor -///\brief Creates a ReferenceException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: ReferenceException overloaded constructor +///\brief Creates a ReferenceException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- ReferenceException::ReferenceException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: ReferenceException destructor -///\brief Noop destructor. +// Function: ReferenceException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- ReferenceException::~ReferenceException() throw() {} //-------------------------------------------------------------------------- -// Subclass: LibraryIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: LibraryIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: LibraryIException default constructor -///\brief Default constructor. +// Function: LibraryIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- LibraryIException::LibraryIException():Exception(){} //-------------------------------------------------------------------------- -// Function: LibraryIException overloaded constructor -///\brief Creates a LibraryIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: LibraryIException overloaded constructor +///\brief Creates a LibraryIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- LibraryIException::LibraryIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: LibraryIException destructor -///\brief Noop destructor. +// Function: LibraryIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- LibraryIException::~LibraryIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: LocationException -// Programmer Binh-Minh Ribler - 2014 +// Subclass: LocationException +// Programmer Binh-Minh Ribler - 2014 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: LocationException default constructor -///\brief Default constructor. +// Function: LocationException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- LocationException::LocationException():Exception(){} //-------------------------------------------------------------------------- -// Function: LocationException overloaded constructor -///\brief Creates a LocationException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: LocationException overloaded constructor +///\brief Creates a LocationException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- LocationException::LocationException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: LocationException destructor -///\brief Noop destructor. +// Function: LocationException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- LocationException::~LocationException() throw() {} //-------------------------------------------------------------------------- -// Subclass: IdComponentException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: IdComponentException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: IdComponentException default constructor -///\brief Default constructor. +// Function: IdComponentException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- IdComponentException::IdComponentException(): Exception() {} //-------------------------------------------------------------------------- -// Function: IdComponentException overloaded constructor -///\brief Creates a IdComponentException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: IdComponentException overloaded constructor +///\brief Creates a IdComponentException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- IdComponentException::IdComponentException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: IdComponentException destructor -///\brief Noop destructor. +// Function: IdComponentException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- IdComponentException::~IdComponentException() throw() {} diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 7112995..1f85711 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -33,147 +33,147 @@ namespace H5 { */ class H5_DLLCPP Exception { public: - // Creates an exception with a function name where the failure occurs - // and an optional detailed message - Exception(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + // Creates an exception with a function name where the failure occurs + // and an optional detailed message + Exception(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - // Returns a character string that describes the error specified by - // a major error number. - H5std_string getMajorString( hid_t err_major_id ) const; + // Returns a character string that describes the error specified by + // a major error number. + H5std_string getMajorString(hid_t err_major_id) const; - // Returns a character string that describes the error specified by - // a minor error number. - H5std_string getMinorString( hid_t err_minor_id ) const; + // Returns a character string that describes the error specified by + // a minor error number. + H5std_string getMinorString(hid_t err_minor_id) const; - // Returns the detailed message set at the time the exception is thrown - H5std_string getDetailMsg() const; - const char* getCDetailMsg() const; // C string of detailed message - H5std_string getFuncName() const; // function name as a string object - const char* getCFuncName() const; // function name as a char string + // Returns the detailed message set at the time the exception is thrown + H5std_string getDetailMsg() const; + const char* getCDetailMsg() const; // C string of detailed message + H5std_string getFuncName() const; // function name as a string object + const char* getCFuncName() const; // function name as a char string - // Turns on the automatic error printing. - static void setAutoPrint( H5E_auto2_t& func, void* client_data); + // Turns on the automatic error printing. + static void setAutoPrint(H5E_auto2_t& func, void* client_data); - // Turns off the automatic error printing. - static void dontPrint(); + // Turns off the automatic error printing. + static void dontPrint(); - // Retrieves the current settings for the automatic error stack - // traversal function and its data. - static void getAutoPrint( H5E_auto2_t& func, void** client_data); + // Retrieves the current settings for the automatic error stack + // traversal function and its data. + static void getAutoPrint(H5E_auto2_t& func, void** client_data); - // Clears the error stack for the current thread. - static void clearErrorStack(); + // Clears the error stack for the current thread. + static void clearErrorStack(); - // Walks the error stack for the current thread, calling the - // specified function. - static void walkErrorStack( H5E_direction_t direction, - H5E_walk2_t func, void* client_data); + // Walks the error stack for the current thread, calling the + // specified function. + static void walkErrorStack(H5E_direction_t direction, + H5E_walk2_t func, void* client_data); - // Prints the error stack in a default manner. - static void printErrorStack(FILE* stream = stderr, - hid_t err_stack = H5E_DEFAULT); // Static - virtual void printError(FILE* stream = NULL) const; + // Prints the error stack in a default manner. + static void printErrorStack(FILE* stream = stderr, + hid_t err_stack = H5E_DEFAULT); + virtual void printError(FILE* stream = NULL) const; - // Default constructor - Exception(); + // Default constructor + Exception(); - // copy constructor - Exception( const Exception& orig); + // copy constructor + Exception(const Exception& orig); - // virtual Destructor - virtual ~Exception() throw(); + // virtual Destructor + virtual ~Exception() throw(); protected: - // Default value for detail_message - static const char DEFAULT_MSG[]; + // Default value for detail_message + static const char DEFAULT_MSG[]; private: - H5std_string detail_message; - H5std_string func_name; + H5std_string detail_message; + H5std_string func_name; }; class H5_DLLCPP FileIException : public Exception { public: - FileIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - FileIException(); - virtual ~FileIException() throw(); + FileIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + FileIException(); + virtual ~FileIException() throw(); }; class H5_DLLCPP GroupIException : public Exception { public: - GroupIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - GroupIException(); - virtual ~GroupIException() throw(); + GroupIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + GroupIException(); + virtual ~GroupIException() throw(); }; class H5_DLLCPP DataSpaceIException : public Exception { public: - DataSpaceIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - DataSpaceIException(); - virtual ~DataSpaceIException() throw(); + DataSpaceIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + DataSpaceIException(); + virtual ~DataSpaceIException() throw(); }; class H5_DLLCPP DataTypeIException : public Exception { public: - DataTypeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - DataTypeIException(); - virtual ~DataTypeIException() throw(); + DataTypeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + DataTypeIException(); + virtual ~DataTypeIException() throw(); }; class H5_DLLCPP ObjHeaderIException : public Exception { public: - ObjHeaderIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - ObjHeaderIException(); - virtual ~ObjHeaderIException() throw(); + ObjHeaderIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + ObjHeaderIException(); + virtual ~ObjHeaderIException() throw(); }; class H5_DLLCPP PropListIException : public Exception { public: - PropListIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - PropListIException(); - virtual ~PropListIException() throw(); + PropListIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + PropListIException(); + virtual ~PropListIException() throw(); }; class H5_DLLCPP DataSetIException : public Exception { public: - DataSetIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - DataSetIException(); - virtual ~DataSetIException() throw(); + DataSetIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + DataSetIException(); + virtual ~DataSetIException() throw(); }; class H5_DLLCPP AttributeIException : public Exception { public: - AttributeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - AttributeIException(); - virtual ~AttributeIException() throw(); + AttributeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + AttributeIException(); + virtual ~AttributeIException() throw(); }; class H5_DLLCPP ReferenceException : public Exception { public: - ReferenceException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - ReferenceException(); - virtual ~ReferenceException() throw(); + ReferenceException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + ReferenceException(); + virtual ~ReferenceException() throw(); }; class H5_DLLCPP LibraryIException : public Exception { public: - LibraryIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - LibraryIException(); - virtual ~LibraryIException() throw(); + LibraryIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + LibraryIException(); + virtual ~LibraryIException() throw(); }; class H5_DLLCPP LocationException : public Exception { public: - LocationException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - LocationException(); - virtual ~LocationException() throw(); + LocationException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + LocationException(); + virtual ~LocationException() throw(); }; class H5_DLLCPP IdComponentException : public Exception { public: - IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - IdComponentException(); - virtual ~IdComponentException() throw(); + IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + IdComponentException(); + virtual ~IdComponentException() throw(); }; } diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index c3919da..1ab812c 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -63,7 +63,7 @@ FileAccPropList* FileAccPropList::getConstant() //-------------------------------------------------------------------------- // Function: FileAccPropList::deleteConstants -// Purpose: Deletes the constant object that FileAccPropList::DEFAULT_ +// Purpose Deletes the constant object that FileAccPropList::DEFAULT_ // points to. // exception H5::PropListIException // Programmer Binh-Minh Ribler - 2015 @@ -75,271 +75,271 @@ void FileAccPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose: Constant for default property +// Purpose Constant for default property //-------------------------------------------------------------------------- const FileAccPropList& FileAccPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Default Constructor -///\brief Creates a file access property list -// Programmer: Binh-Minh Ribler - 2000 +// Function: Default Constructor +///\brief Creates a file access property list +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FileAccPropList::FileAccPropList() : PropList( H5P_FILE_ACCESS ) {} +FileAccPropList::FileAccPropList() : PropList(H5P_FILE_ACCESS) {} //-------------------------------------------------------------------------- -// Function: FileAccPropList copy constructor -///\brief Copy Constructor: makes a copy of the original -///\param original - IN: FileAccPropList instance to copy -// Programmer: Binh-Minh Ribler - 2000 +// Function: FileAccPropList copy constructor +///\brief Copy Constructor: makes a copy of the original +///\param original - IN: FileAccPropList instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileAccPropList::FileAccPropList(const FileAccPropList& original) : PropList(original) {} //-------------------------------------------------------------------------- -// Function: FileAccPropList overloaded constructor -///\brief Creates a file access property list using the id of an -/// existing one. -// Programmer: Binh-Minh Ribler - 2000 +// Function: FileAccPropList overloaded constructor +///\brief Creates a file access property list using the id of an +/// existing one. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileAccPropList::FileAccPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: FileAccPropList::setStdio -///\brief Modifies this property list to use the \c H5FD_STDIO driver. +// Function: FileAccPropList::setStdio +///\brief Modifies this property list to use the \c H5FD_STDIO driver. /// -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setStdio() const { - herr_t ret_value = H5Pset_fapl_stdio(id); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setStdio", "H5Pset_fapl_stdio failed"); - } + herr_t ret_value = H5Pset_fapl_stdio(id); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setStdio", "H5Pset_fapl_stdio failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getDriver -///\brief Return the ID of the low-level file driver. -///\return A low-level driver ID which is the same ID used when the -/// driver was set for the property list. The driver ID is -/// only valid as long as the file driver remains registered. -/// Valid driver identifiers can be found at: +// Function: FileAccPropList::getDriver +///\brief Return the ID of the low-level file driver. +///\return A low-level driver ID which is the same ID used when the +/// driver was set for the property list. The driver ID is +/// only valid as long as the file driver remains registered. +/// Valid driver identifiers can be found at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetDriver -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hid_t FileAccPropList::getDriver() const { - hid_t driver = H5Pget_driver(id); - if (driver < 0) - { - throw PropListIException("FileAccPropList::getDriver", "H5Pget_driver failed"); - } + hid_t driver = H5Pget_driver(id); + if (driver < 0) + { + throw PropListIException("FileAccPropList::getDriver", "H5Pget_driver failed"); + } return(driver); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setDriver -///\brief Set file driver for this property list. -///\param new_driver_id - IN: File driver -///\param new_driver_info - IN: Struct containing the driver-specific properites -///\exception H5::PropListIException +// Function: FileAccPropList::setDriver +///\brief Set file driver for this property list. +///\param new_driver_id - IN: File driver +///\param new_driver_info - IN: Struct containing the driver-specific properites +///\exception H5::PropListIException ///\par Description -/// For a list of valid driver identifiers, please see the C -/// layer Reference Manual at: +/// For a list of valid driver identifiers, please see the C +/// layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetDriver -// Programmer: Binh-Minh Ribler - April, 2004 +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setDriver(hid_t new_driver_id, const void *new_driver_info) const { - herr_t ret_value = H5Pset_driver(id, new_driver_id, new_driver_info); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setDriver", "H5Pset_driver failed"); - } + herr_t ret_value = H5Pset_driver(id, new_driver_id, new_driver_info); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setDriver", "H5Pset_driver failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setFamilyOffset -///\brief Sets offset for family driver. -///\param offset - IN: offset value -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::setFamilyOffset +///\brief Sets offset for family driver. +///\param offset - IN: offset value +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setFamilyOffset(hsize_t offset) const { - herr_t ret_value = H5Pset_family_offset(id, offset); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setFamilyOffset", "H5Pset_family_offset failed"); - } + herr_t ret_value = H5Pset_family_offset(id, offset); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setFamilyOffset", "H5Pset_family_offset failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getFamilyOffset -///\brief Get offset for family driver. -///\return Offset for family driver -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getFamilyOffset +///\brief Get offset for family driver. +///\return Offset for family driver +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hsize_t FileAccPropList::getFamilyOffset() const { - hsize_t offset; - herr_t ret_value = H5Pget_family_offset(id, &offset); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getFamilyOffset", "H5Pget_family_offset failed"); - } + hsize_t offset; + herr_t ret_value = H5Pget_family_offset(id, &offset); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getFamilyOffset", "H5Pget_family_offset failed"); + } return(offset); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setCore -///\brief Modifies this file access property list to use the \c H5FD_CORE -/// driver. -///\param increment - IN: Specifies how much memory to increase each -/// time more memory is needed, in bytes -///\param backing_store - IN: Indicating whether to write the file -/// contents to disk when the file is closed -///\exception H5::PropListIException +// Function: FileAccPropList::setCore +///\brief Modifies this file access property list to use the \c H5FD_CORE +/// driver. +///\param increment - IN: Specifies how much memory to increase each +/// time more memory is needed, in bytes +///\param backing_store - IN: Indicating whether to write the file +/// contents to disk when the file is closed +///\exception H5::PropListIException ///\par Description -/// For more details on the use of \c H5FD_CORE driver, please -/// refer to +/// For more details on the use of \c H5FD_CORE driver, please +/// refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplCore -// Programmer: Binh-Minh Ribler - April, 2004 +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const { - herr_t ret_value = H5Pset_fapl_core (id, increment, backing_store); - if (ret_value < 0) - { - throw PropListIException ("FileAccPropList::setCore", "H5Pset_fapl_core failed"); - } + herr_t ret_value = H5Pset_fapl_core (id, increment, backing_store); + if (ret_value < 0) + { + throw PropListIException ("FileAccPropList::setCore", "H5Pset_fapl_core failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getCore -///\brief Queries core file driver properties. -///\param increment - OUT: Size of memory increment, in bytes -///\param backing_store - OUT: Indicating whether to write the file -/// contents to disk when the file is closed -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getCore +///\brief Queries core file driver properties. +///\param increment - OUT: Size of memory increment, in bytes +///\param backing_store - OUT: Indicating whether to write the file +/// contents to disk when the file is closed +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::getCore (size_t& increment, hbool_t& backing_store) const { - herr_t ret_value = H5Pget_fapl_core(id, &increment, &backing_store); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getCore", "H5Pget_fapl_core failed"); - } + herr_t ret_value = H5Pget_fapl_core(id, &increment, &backing_store); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getCore", "H5Pget_fapl_core failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setFamily -///\brief Sets this file access property list to use the family driver. -///\param memb_size - IN: Size in bytes of each file member -///\param memb_plist - IN: File access property list to be used for -/// each family member -///\exception H5::PropListIException +// Function: FileAccPropList::setFamily +///\brief Sets this file access property list to use the family driver. +///\param memb_size - IN: Size in bytes of each file member +///\param memb_plist - IN: File access property list to be used for +/// each family member +///\exception H5::PropListIException ///\par Description -/// Note that \a memb_size is used only when creating a new file. -// Programmer: Binh-Minh Ribler - April, 2004 +/// Note that \a memb_size is used only when creating a new file. +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void FileAccPropList::setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const +void FileAccPropList::setFamily(hsize_t memb_size, const FileAccPropList& memb_plist) const { - herr_t ret_value = H5Pset_fapl_family (id, memb_size, memb_plist.getId() ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setFamily", "H5Pset_fapl_family failed"); - } + herr_t ret_value = H5Pset_fapl_family (id, memb_size, memb_plist.getId()); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setFamily", "H5Pset_fapl_family failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getFamily -///\brief Returns information about the family file access property -/// list. -///\param memb_size - OUT: Size in bytes of each file member -///\param memb_plist - OUT: Retrieved file access property list for each -/// file member -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getFamily +///\brief Returns information about the family file access property +/// list. +///\param memb_size - OUT: Size in bytes of each file member +///\param memb_plist - OUT: Retrieved file access property list for each +/// file member +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const { - hid_t memb_plist_id; - herr_t ret_value = H5Pget_fapl_family( id, &memb_size, &memb_plist_id ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed"); - } - memb_plist.p_setId(memb_plist_id); + hid_t memb_plist_id; + herr_t ret_value = H5Pget_fapl_family(id, &memb_size, &memb_plist_id); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed"); + } + memb_plist.p_setId(memb_plist_id); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getFamily -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts and its return value. -///\param memb_size - OUT: Size in bytes of each file member -///\return The file access property list for each file member -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getFamily +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts and its return value. +///\param memb_size - OUT: Size in bytes of each file member +///\return The file access property list for each file member +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const { - hid_t memb_plist_id; - herr_t ret_value = H5Pget_fapl_family( id, &memb_size, &memb_plist_id ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed"); - } - FileAccPropList memb_plist(memb_plist_id); - return(memb_plist); -} - -//-------------------------------------------------------------------------- -// Function: FileAccPropList::setSplit -///\brief Emulates the old split file driver, which stored meta data -/// in one file and raw data in another file. -///\param meta_plist - IN: File access plist for the metadata file -///\param raw_plist - IN: File access plist for the raw data file -///\param meta_ext - IN: Metadata filename extension as \c char* -///\param raw_ext - IN: Raw data filename extension as \c char* -///\exception H5::PropListIException + hid_t memb_plist_id; + herr_t ret_value = H5Pget_fapl_family(id, &memb_size, &memb_plist_id); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed"); + } + FileAccPropList memb_plist(memb_plist_id); + return(memb_plist); +} + +//-------------------------------------------------------------------------- +// Function: FileAccPropList::setSplit +///\brief Emulates the old split file driver, which stored meta data +/// in one file and raw data in another file. +///\param meta_plist - IN: File access plist for the metadata file +///\param raw_plist - IN: File access plist for the raw data file +///\param meta_ext - IN: Metadata filename extension as \c char* +///\param raw_ext - IN: Raw data filename extension as \c char* +///\exception H5::PropListIException ///\par Description -/// Temporary - For information, please refer to: +/// Temporary - For information, please refer to: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplSplit -// Programmer: Binh-Minh Ribler - April, 2004 +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext ) const -{ - hid_t meta_pid = meta_plist.getId(); - hid_t raw_pid = raw_plist.getId(); - herr_t ret_value = H5Pset_fapl_split( id, meta_ext, meta_pid, raw_ext, raw_pid ); - if( ret_value < 0 ) +void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext) const { - throw PropListIException("FileAccPropList::setSplit", "H5Pset_fapl_split failed"); - } + hid_t meta_pid = meta_plist.getId(); + hid_t raw_pid = raw_plist.getId(); + herr_t ret_value = H5Pset_fapl_split(id, meta_ext, meta_pid, raw_ext, raw_pid); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setSplit", "H5Pset_fapl_split failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setSplit -///\brief This is an overloaded member function, provided for convenience. -/// It takes character arguments as \c H5std_string. -///\param meta_plist - IN: File access plist for the metadata file -///\param raw_plist - IN: File access plist for the raw data file -///\param meta_ext - IN: Metadata filename extension as \c H5std_string -///\param raw_ext - IN: Raw data filename extension as \c H5std_string -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::setSplit +///\brief This is an overloaded member function, provided for convenience. +/// It takes character arguments as \c H5std_string. +///\param meta_plist - IN: File access plist for the metadata file +///\param raw_plist - IN: File access plist for the raw data file +///\param meta_ext - IN: Metadata filename extension as \c H5std_string +///\param raw_ext - IN: Raw data filename extension as \c H5std_string +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const H5std_string& meta_ext, const H5std_string& raw_ext ) const +void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const H5std_string& meta_ext, const H5std_string& raw_ext) const { - setSplit( meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str() ); + setSplit(meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str()); } // Stream Virtual File Driver had been removed from the main library. @@ -347,402 +347,402 @@ void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccP // -BMR, March, 2012 //-------------------------------------------------------------------------- -// Function: FileAccPropList::getSieveBufSize -///\brief Returns the current settings for the data sieve buffer size -/// property from this property list. -///\return Data sieve buffer size, in bytes -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getSieveBufSize +///\brief Returns the current settings for the data sieve buffer size +/// property from this property list. +///\return Data sieve buffer size, in bytes +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t FileAccPropList::getSieveBufSize() const { - size_t bufsize; - herr_t ret_value = H5Pget_sieve_buf_size(id, &bufsize); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed"); - } - return(bufsize); + size_t bufsize; + herr_t ret_value = H5Pget_sieve_buf_size(id, &bufsize); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed"); + } + return(bufsize); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setSieveBufSize -///\brief Sets the maximum size of the data sieve buffer. -///\param bufsize - IN: Maximum size, in bytes, of data sieve buffer -///\exception H5::PropListIException +// Function: FileAccPropList::setSieveBufSize +///\brief Sets the maximum size of the data sieve buffer. +///\param bufsize - IN: Maximum size, in bytes, of data sieve buffer +///\exception H5::PropListIException ///\par Description -/// For detail on data sieving, please refer to +/// For detail on data sieving, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSieveBufSize -// Programmer: Binh-Minh Ribler - April, 2004 +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setSieveBufSize(size_t bufsize) const { - herr_t ret_value = H5Pset_sieve_buf_size(id, bufsize); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed"); - } + herr_t ret_value = H5Pset_sieve_buf_size(id, bufsize); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setMetaBlockSize -///\brief Sets the minimum size of metadata block allocations. -///\param block_size - IN: Minimum size, in bytes, of metadata -/// block allocations -///\exception H5::PropListIException +// Function: FileAccPropList::setMetaBlockSize +///\brief Sets the minimum size of metadata block allocations. +///\param block_size - IN: Minimum size, in bytes, of metadata +/// block allocations +///\exception H5::PropListIException ///\par Description -/// For more detail, please see the C layer Reference Manual at: +/// For more detail, please see the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMetaBlockSize -// Programmer: Binh-Minh Ribler - April, 2004 +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setMetaBlockSize(hsize_t &block_size) const { - herr_t ret_value = H5Pset_meta_block_size(id, block_size); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setMetaBlockSize", "H5Pset_meta_block_size failed"); - } + herr_t ret_value = H5Pset_meta_block_size(id, block_size); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setMetaBlockSize", "H5Pset_meta_block_size failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getMetaBlockSize -///\brief Returns the current metadata block size setting. -///\return Metadata block size -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getMetaBlockSize +///\brief Returns the current metadata block size setting. +///\return Metadata block size +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hsize_t FileAccPropList::getMetaBlockSize() const { - hsize_t block_size; - herr_t ret_value = H5Pget_meta_block_size(id, &block_size); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getMetaBlockSize", "H5Pget_meta_block_size failed"); - } - return(block_size); + hsize_t block_size; + herr_t ret_value = H5Pget_meta_block_size(id, &block_size); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getMetaBlockSize", "H5Pget_meta_block_size failed"); + } + return(block_size); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setLog -///\brief Modifies this file access property list to use the logging -/// driver. -///\param logfile - IN: Name of the log file -///\param flags - IN: Flags specifying the types of logging activity -///\param buf_size - IN: Size of the logging buffer -///\exception H5::PropListIException +// Function: FileAccPropList::setLog +///\brief Modifies this file access property list to use the logging +/// driver. +///\param logfile - IN: Name of the log file +///\param flags - IN: Flags specifying the types of logging activity +///\param buf_size - IN: Size of the logging buffer +///\exception H5::PropListIException ///\par Description -/// For detail on \a flags, please refer to +/// For detail on \a flags, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplLog -// Programmer: Binh-Minh Ribler - April, 2004 +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setLog(const char *logfile, unsigned flags, size_t buf_size) const { - herr_t ret_value = H5Pset_fapl_log(id, logfile, flags, buf_size); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setLog", "H5Pset_fapl_log failed"); - } + herr_t ret_value = H5Pset_fapl_log(id, logfile, flags, buf_size); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setLog", "H5Pset_fapl_log failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setLog -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param logfile - IN: Name of the log file - string -///\param flags - IN: Flags specifying the types of logging activity -///\param buf_size - IN: Size of the logging buffer -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::setLog +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param logfile - IN: Name of the log file - string +///\param flags - IN: Flags specifying the types of logging activity +///\param buf_size - IN: Size of the logging buffer +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const { - setLog(logfile.c_str(), flags, buf_size); + setLog(logfile.c_str(), flags, buf_size); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setSec2 -///\brief Modifies this file access property list to use the sec2 -/// driver. +// Function: FileAccPropList::setSec2 +///\brief Modifies this file access property list to use the sec2 +/// driver. /// -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setSec2() const { - herr_t ret_value = H5Pset_fapl_sec2(id); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setSec2", "H5Pset_fapl_sec2 failed"); - } + herr_t ret_value = H5Pset_fapl_sec2(id); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setSec2", "H5Pset_fapl_sec2 failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setAlignment -///\brief Sets the alignment properties of this property list. -///\param threshold - IN: Threshold value for file object size -///\param alignment - IN: Alignment value -///\exception H5::PropListIException +// Function: FileAccPropList::setAlignment +///\brief Sets the alignment properties of this property list. +///\param threshold - IN: Threshold value for file object size +///\param alignment - IN: Alignment value +///\exception H5::PropListIException ///\par Description -/// The parameter \a threshold must have a non-negative value. -/// Note that setting the threshold value to 0 (zero) has the -/// effect of a special case, forcing everything to be aligned. -/// The parameter \a alignment must have a positive value. +/// The parameter \a threshold must have a non-negative value. +/// Note that setting the threshold value to 0 (zero) has the +/// effect of a special case, forcing everything to be aligned. +/// The parameter \a alignment must have a positive value. /// -/// For detail on \a setting alignment, please refer to +/// For detail on \a setting alignment, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAlignment -// Programmer: Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const +void FileAccPropList::setAlignment(hsize_t threshold, hsize_t alignment) const { - herr_t ret_value = H5Pset_alignment( id, threshold, alignment ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setAlignment", "H5Pset_alignment failed"); - } + herr_t ret_value = H5Pset_alignment(id, threshold, alignment); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setAlignment", "H5Pset_alignment failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getAlignment -///\brief Returns the current settings for alignment properties from -/// this property list. -///\param threshold - OUT: Retrieved threshold value for file object size -///\param alignment - OUT: Retrieved alignment value -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: FileAccPropList::getAlignment +///\brief Returns the current settings for alignment properties from +/// this property list. +///\param threshold - OUT: Retrieved threshold value for file object size +///\param alignment - OUT: Retrieved alignment value +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::getAlignment( hsize_t &threshold, hsize_t &alignment ) const +void FileAccPropList::getAlignment(hsize_t &threshold, hsize_t &alignment) const { - herr_t ret_value = H5Pget_alignment( id, &threshold, &alignment ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getAlignment", "H5Pget_alignment failed"); - } + herr_t ret_value = H5Pget_alignment(id, &threshold, &alignment); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getAlignment", "H5Pget_alignment failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setMultiType -///\brief Sets data type for \c MULTI driver. -///\param dtype - IN: Type of data -///\exception H5::PropListIException +// Function: FileAccPropList::setMultiType +///\brief Sets data type for \c MULTI driver. +///\param dtype - IN: Type of data +///\exception H5::PropListIException ///\par Description -/// More details and valid values for \a dtype can be found at: +/// More details and valid values for \a dtype can be found at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMultiType -// Programmer: Binh-Minh Ribler - April, 2004 +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setMultiType(H5FD_mem_t dtype) const { - herr_t ret_value = H5Pset_multi_type(id, dtype); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setMultiType", "H5Pset_multi_type failed"); - } + herr_t ret_value = H5Pset_multi_type(id, dtype); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setMultiType", "H5Pset_multi_type failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getMultiType -///\brief Returns the data type property for \c MULTI driver. -///\return The data type property -///\exception H5::PropListIException +// Function: FileAccPropList::getMultiType +///\brief Returns the data type property for \c MULTI driver. +///\return The data type property +///\exception H5::PropListIException ///\par Description -/// More details and possible returned values can be found at: +/// More details and possible returned values can be found at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMultiType -// Programmer: Binh-Minh Ribler - April, 2004 +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5FD_mem_t FileAccPropList::getMultiType() const { - H5FD_mem_t dtype; - herr_t ret_value = H5Pget_multi_type(id, &dtype); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getMultiType", "H5Pget_multi_type failed"); - } - return(dtype); + H5FD_mem_t dtype; + herr_t ret_value = H5Pget_multi_type(id, &dtype); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getMultiType", "H5Pget_multi_type failed"); + } + return(dtype); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setCache -///\brief Sets the meta data cache and raw data chunk cache parameters. -///\param mdc_nelmts - IN: Number of elements in the meta data cache -///\param rdcc_nelmts - IN: Number of elements in the raw data chunk cache -///\param rdcc_nbytes - IN: Total size of the raw data chunk cache, in bytes -///\param rdcc_w0 - IN: Preemption policy -///\exception H5::PropListIException +// Function: FileAccPropList::setCache +///\brief Sets the meta data cache and raw data chunk cache parameters. +///\param mdc_nelmts - IN: Number of elements in the meta data cache +///\param rdcc_nelmts - IN: Number of elements in the raw data chunk cache +///\param rdcc_nbytes - IN: Total size of the raw data chunk cache, in bytes +///\param rdcc_w0 - IN: Preemption policy +///\exception H5::PropListIException ///\par Description -/// The argument \a rdcc_w0 should hold a value between 0 and 1 -/// inclusive. This value indicates how much chunks that have -/// been fully read are favored for preemption. A value of zero -/// means fully read chunks are treated no differently than other -/// chunks (the preemption is strictly LRU) while a value of one -/// means fully read chunks are always preempted before other chunks. -// Programmer: Binh-Minh Ribler - 2000 +/// The argument \a rdcc_w0 should hold a value between 0 and 1 +/// inclusive. This value indicates how much chunks that have +/// been fully read are favored for preemption. A value of zero +/// means fully read chunks are treated no differently than other +/// chunks (the preemption is strictly LRU) while a value of one +/// means fully read chunks are always preempted before other chunks. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const +void FileAccPropList::setCache(int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0) const { - herr_t ret_value = H5Pset_cache( id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0 ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setCache", "H5Pset_cache failed"); - } + herr_t ret_value = H5Pset_cache(id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setCache", "H5Pset_cache failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getCache -///\brief Queries the meta data cache and raw data chunk cache parameters. -///\param mdc_nelmts - OUT: Number of elements in the meta data cache -///\param rdcc_nelmts - OUT: Number of elements in the raw data chunk cache -///\param rdcc_nbytes - OUT: Total size of the raw data chunk cache, in bytes -///\param rdcc_w0 - OUT: Preemption policy -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: FileAccPropList::getCache +///\brief Queries the meta data cache and raw data chunk cache parameters. +///\param mdc_nelmts - OUT: Number of elements in the meta data cache +///\param rdcc_nelmts - OUT: Number of elements in the raw data chunk cache +///\param rdcc_nbytes - OUT: Total size of the raw data chunk cache, in bytes +///\param rdcc_w0 - OUT: Preemption policy +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const +void FileAccPropList::getCache(int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0) const { - herr_t ret_value = H5Pget_cache( id, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0 ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getCache", "H5Pget_cache failed"); - } + herr_t ret_value = H5Pget_cache(id, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getCache", "H5Pget_cache failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setFcloseDegree -///\brief Sets the degree for the file close behavior. -///\param degree - IN: -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::setFcloseDegree +///\brief Sets the degree for the file close behavior. +///\param degree - IN: +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree) const { - herr_t ret_value = H5Pset_fclose_degree(id, degree); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setFcloseDegree", "H5Pset_fclose_degree failed"); - } + herr_t ret_value = H5Pset_fclose_degree(id, degree); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setFcloseDegree", "H5Pset_fclose_degree failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getFcloseDegree -///\brief Returns the degree for the file close behavior. -///\return The degree for the file close behavior -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getFcloseDegree +///\brief Returns the degree for the file close behavior. +///\return The degree for the file close behavior +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5F_close_degree_t FileAccPropList::getFcloseDegree() const { - H5F_close_degree_t degree; - herr_t ret_value = H5Pget_fclose_degree(id, °ree); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getFcloseDegree", "H5Pget_fclose_degree failed"); - } - return(degree); + H5F_close_degree_t degree; + herr_t ret_value = H5Pget_fclose_degree(id, °ree); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getFcloseDegree", "H5Pget_fclose_degree failed"); + } + return(degree); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setGcReferences -///\brief Sets garbage collecting references flag. -///\param gc_ref - IN: Flag setting reference garbage collection to -/// on (1) or off (0). -///\exception H5::PropListIException +// Function: FileAccPropList::setGcReferences +///\brief Sets garbage collecting references flag. +///\param gc_ref - IN: Flag setting reference garbage collection to +/// on (1) or off (0). +///\exception H5::PropListIException ///\par Description -/// For detail on \a fapl, please refer to +/// For detail on \a fapl, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetGCReferences -// Programmer: Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::setGcReferences( unsigned gc_ref ) const +void FileAccPropList::setGcReferences(unsigned gc_ref) const { - herr_t ret_value = H5Pset_gc_references( id, gc_ref ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setGcReferences", "H5Pset_gc_references failed"); - } + herr_t ret_value = H5Pset_gc_references(id, gc_ref); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setGcReferences", "H5Pset_gc_references failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getGcReferences -///\brief Returns the garbage collecting references setting. -///\return Garbage collecting references setting, 0 (off) or 1 (on) -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - 2000 +// Function: FileAccPropList::getGcReferences +///\brief Returns the garbage collecting references setting. +///\return Garbage collecting references setting, 0 (off) or 1 (on) +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- unsigned FileAccPropList::getGcReferences() const { - unsigned gc_ref; + unsigned gc_ref; - // the name of this routine will be changed to H5Pget_gc_references??? - herr_t ret_value = H5Pget_gc_references( id, &gc_ref ); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getGcReferences", "H5Pget_gc_references failed"); - } - return( gc_ref ); + // the name of this routine will be changed to H5Pget_gc_references??? + herr_t ret_value = H5Pget_gc_references(id, &gc_ref); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getGcReferences", "H5Pget_gc_references failed"); + } + return(gc_ref); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setLibverBounds -///\brief Sets bounds on versions of library format to be used when creating -/// or writing objects. -///\param libver_low - IN: Earliest version of the library that will be -/// used for creating or writing objects -///\param libver_high - IN: Latest version of the library that will be -///\exception H5::PropListIException +// Function: FileAccPropList::setLibverBounds +///\brief Sets bounds on versions of library format to be used when creating +/// or writing objects. +///\param libver_low - IN: Earliest version of the library that will be +/// used for creating or writing objects +///\param libver_high - IN: Latest version of the library that will be +///\exception H5::PropListIException ///\par Description -/// Valid values of \a libver_low are as follows: -/// \li \c H5F_LIBVER_EARLIEST (Default) -/// \li \c H5F_LIBVER_18 -/// \li \c H5F_LIBVER_LATEST +/// Valid values of \a libver_low are as follows: +/// \li \c H5F_LIBVER_EARLIEST (Default) +/// \li \c H5F_LIBVER_18 +/// \li \c H5F_LIBVER_LATEST /// -/// Valid values of \a libver_high are as follows: -/// \li \c H5F_LIBVER_18 -/// \li \c H5F_LIBVER_LATEST (Default) +/// Valid values of \a libver_high are as follows: +/// \li \c H5F_LIBVER_18 +/// \li \c H5F_LIBVER_LATEST (Default) /// -/// For more details, please refer to +/// For more details, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLibverBounds -// Programmer: Binh-Minh Ribler - March, 2015 +// Programmer Binh-Minh Ribler - March, 2015 //-------------------------------------------------------------------------- void FileAccPropList::setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const { herr_t ret_value = H5Pset_libver_bounds(id, libver_low, libver_high); if (ret_value < 0) { - throw PropListIException("FileAccPropList::setLibverBounds", "H5Pset_libver_bounds failed"); + throw PropListIException("FileAccPropList::setLibverBounds", "H5Pset_libver_bounds failed"); } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getLibverBounds -///\brief Gets the current settings for the library version format bounds -/// from a file access property list. -///\param libver_low - OUT: Earliest version of the library that will be -/// used for creating or writing objects -///\param libver_high - OUT: Latest version of the library that will be -/// used for creating or writing objects -///\exception H5::PropListIException +// Function: FileAccPropList::getLibverBounds +///\brief Gets the current settings for the library version format bounds +/// from a file access property list. +///\param libver_low - OUT: Earliest version of the library that will be +/// used for creating or writing objects +///\param libver_high - OUT: Latest version of the library that will be +/// used for creating or writing objects +///\exception H5::PropListIException ///\par Description -/// On success, the argument \a libver_low can have the following -/// values: -/// \li \c H5F_LIBVER_EARLIEST -/// \li \c H5F_LIBVER_18 -/// \li \c H5F_LIBVER_LATEST +/// On success, the argument \a libver_low can have the following +/// values: +/// \li \c H5F_LIBVER_EARLIEST +/// \li \c H5F_LIBVER_18 +/// \li \c H5F_LIBVER_LATEST /// -/// and \a libver_high: -/// \li \c H5F_LIBVER_18 -/// \li \c H5F_LIBVER_LATEST -// Programmer: Binh-Minh Ribler - March, 2015 +/// and \a libver_high: +/// \li \c H5F_LIBVER_18 +/// \li \c H5F_LIBVER_LATEST +// Programmer Binh-Minh Ribler - March, 2015 //-------------------------------------------------------------------------- void FileAccPropList::getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const { herr_t ret_value = H5Pget_libver_bounds(id, &libver_low, &libver_high); - if( ret_value < 0 ) + if (ret_value < 0) { - throw PropListIException("FileAccPropList::getLibverBounds", "H5Pget_libver_bounds failed"); + throw PropListIException("FileAccPropList::getLibverBounds", "H5Pget_libver_bounds failed"); } } //-------------------------------------------------------------------------- -// Function: FileAccPropList destructor -///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Function: FileAccPropList destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileAccPropList::~FileAccPropList() {} diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index aec5fcc..ae7c7f9 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -27,121 +27,121 @@ namespace H5 { */ class H5_DLLCPP FileAccPropList : public PropList { public: - ///\brief Default file access property list. - static const FileAccPropList& DEFAULT; + ///\brief Default file access property list. + static const FileAccPropList& DEFAULT; - // Creates a file access property list. - FileAccPropList(); + // Creates a file access property list. + FileAccPropList(); - // Modifies this property list to use the H5FD_STDIO driver - void setStdio() const; + // Modifies this property list to use the H5FD_STDIO driver + void setStdio() const; - // Set file driver for this property list - void setDriver(hid_t new_driver_id, const void *new_driver_info) const; + // Set file driver for this property list + void setDriver(hid_t new_driver_id, const void *new_driver_info) const; - // Returns a low-level file driver identifier. - hid_t getDriver() const; + // Returns a low-level file driver identifier. + hid_t getDriver() const; - // Sets offset for family driver. - void setFamilyOffset(hsize_t offset) const; + // Sets offset for family driver. + void setFamilyOffset(hsize_t offset) const; - // Gets offset for family driver. - hsize_t getFamilyOffset() const; + // Gets offset for family driver. + hsize_t getFamilyOffset() const; - // Modifies this file access property list to use the sec2 driver. - void setSec2() const; + // Modifies this file access property list to use the sec2 driver. + void setSec2() const; - // Modifies this file access property list to use the H5FD_CORE - // driver. - void setCore (size_t increment, hbool_t backing_store) const; + // Modifies this file access property list to use the H5FD_CORE + // driver. + void setCore (size_t increment, hbool_t backing_store) const; - // Queries H5FD_CORE driver properties. - void getCore (size_t& increment, hbool_t& backing_store) const; + // Queries H5FD_CORE driver properties. + void getCore (size_t& increment, hbool_t& backing_store) const; - // Sets this file access properties list to the family driver. - void setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const; + // Sets this file access properties list to the family driver. + void setFamily(hsize_t memb_size, const FileAccPropList& memb_plist) const; - // Returns information about the family file access property list. - void getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const; - FileAccPropList getFamily(hsize_t& memb_size) const; + // Returns information about the family file access property list. + void getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const; + FileAccPropList getFamily(hsize_t& memb_size) const; - // Emulates the old split file driver, - void setSplit(const FileAccPropList& meta_plist, - const FileAccPropList& raw_plist, - const char* meta_ext = ".meta", - const char* raw_ext = ".raw" ) const; - void setSplit(const FileAccPropList& meta_plist, - const FileAccPropList& raw_plist, - const H5std_string& meta_ext = ".meta", - const H5std_string& raw_ext = ".raw") const; + // Emulates the old split file driver, + void setSplit(const FileAccPropList& meta_plist, + const FileAccPropList& raw_plist, + const char* meta_ext = ".meta", + const char* raw_ext = ".raw") const; + void setSplit(const FileAccPropList& meta_plist, + const FileAccPropList& raw_plist, + const H5std_string& meta_ext = ".meta", + const H5std_string& raw_ext = ".raw") const; - // Sets the maximum size of the data sieve buffer. - void setSieveBufSize(size_t bufsize) const; + // Sets the maximum size of the data sieve buffer. + void setSieveBufSize(size_t bufsize) const; - // Returns the current settings for the data sieve buffer size - // property - size_t getSieveBufSize() const; + // Returns the current settings for the data sieve buffer size + // property + size_t getSieveBufSize() const; - // Sets the minimum size of metadata block allocations. - void setMetaBlockSize(hsize_t &block_size) const; + // Sets the minimum size of metadata block allocations. + void setMetaBlockSize(hsize_t &block_size) const; - // Returns the current metadata block size setting. - hsize_t getMetaBlockSize() const; + // Returns the current metadata block size setting. + hsize_t getMetaBlockSize() const; - // Modifies this file access property list to use the logging driver. - void setLog(const char *logfile, unsigned flags, size_t buf_size) const; - void setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const; + // Modifies this file access property list to use the logging driver. + void setLog(const char *logfile, unsigned flags, size_t buf_size) const; + void setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const; - // Sets alignment properties of this file access property list - void setAlignment( hsize_t threshold = 1, hsize_t alignment = 1 ) const; + // Sets alignment properties of this file access property list + void setAlignment(hsize_t threshold = 1, hsize_t alignment = 1) const; - // Retrieves the current settings for alignment properties from - // this property list. - void getAlignment( hsize_t& threshold, hsize_t& alignment ) const; + // Retrieves the current settings for alignment properties from + // this property list. + void getAlignment(hsize_t& threshold, hsize_t& alignment) const; - // Sets data type for multi driver. - void setMultiType(H5FD_mem_t dtype) const; + // Sets data type for multi driver. + void setMultiType(H5FD_mem_t dtype) const; - // Returns the data type property for MULTI driver. - H5FD_mem_t getMultiType() const; + // Returns the data type property for MULTI driver. + H5FD_mem_t getMultiType() const; - // Sets the meta data cache and raw data chunk cache parameters. - void setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const; + // Sets the meta data cache and raw data chunk cache parameters. + void setCache(int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0) const; - // Queries the meta data cache and raw data chunk cache parameters. - void getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const; + // Queries the meta data cache and raw data chunk cache parameters. + void getCache(int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0) const; - // Sets the degree for the file close behavior. - void setFcloseDegree(H5F_close_degree_t degree) const; + // Sets the degree for the file close behavior. + void setFcloseDegree(H5F_close_degree_t degree) const; - // Returns the degree for the file close behavior. - H5F_close_degree_t getFcloseDegree() const; + // Returns the degree for the file close behavior. + H5F_close_degree_t getFcloseDegree() const; - // Sets garbage collecting references flag. - void setGcReferences( unsigned gc_ref = 0 ) const; + // Sets garbage collecting references flag. + void setGcReferences(unsigned gc_ref = 0) const; - // Returns garbage collecting references setting. - unsigned getGcReferences() const; + // Returns garbage collecting references setting. + unsigned getGcReferences() const; - // Sets bounds on versions of library format to be used when creating - // or writing objects. - void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const; + // Sets bounds on versions of library format to be used when creating + // or writing objects. + void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const; - // Gets the current settings for the library version format bounds. - void getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const; + // Gets the current settings for the library version format bounds. + void getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("FileAccPropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("FileAccPropList"); } - // Copy constructor: creates a copy of a FileAccPropList object. - FileAccPropList( const FileAccPropList& original ); + // Copy constructor: creates a copy of a FileAccPropList object. + FileAccPropList(const FileAccPropList& original); - // Creates a copy of an existing file access property list - // using the property list id. - FileAccPropList (const hid_t plist_id); + // Creates a copy of an existing file access property list + // using the property list id. + FileAccPropList (const hid_t plist_id); - // Noop destructor - virtual ~FileAccPropList(); + // Noop destructor + virtual ~FileAccPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index 5a99dba..c490f26 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -33,7 +33,7 @@ FileCreatPropList* FileCreatPropList::DEFAULT_ = 0; //-------------------------------------------------------------------------- // Function: FileCreatPropList::getConstant -// Purpose: Creates a FileCreatPropList object representing the HDF5 +// Purpose Creates a FileCreatPropList object representing the HDF5 // constant H5P_FILE_ACCESS, pointed to by FileCreatPropList::DEFAULT_ // exception H5::PropListIException // Description @@ -62,7 +62,7 @@ FileCreatPropList* FileCreatPropList::getConstant() //-------------------------------------------------------------------------- // Function: FileCreatPropList::deleteConstants -// Purpose: Deletes the constant object that FileCreatPropList::DEFAULT_ +// Purpose Deletes the constant object that FileCreatPropList::DEFAULT_ // points to. // Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- @@ -73,231 +73,302 @@ void FileCreatPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for default property +// Purpose Constant for default property //-------------------------------------------------------------------------- const FileCreatPropList& FileCreatPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: FileCreatPropList default constructor -///\brief Default constructor: Creates a file create property list -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList default constructor +///\brief Default constructor: Creates a file create property list +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FileCreatPropList::FileCreatPropList() : PropList( H5P_FILE_CREATE ) {} +FileCreatPropList::FileCreatPropList() : PropList(H5P_FILE_CREATE) {} //-------------------------------------------------------------------------- -// Function: FileCreatPropList copy constructor -///\brief Copy constructor: makes a copy of the original -/// FileCreatPropList object. -///\param original - IN: FileCreatPropList instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList copy constructor +///\brief Copy constructor: makes a copy of the original +/// FileCreatPropList object. +///\param original - IN: FileCreatPropList instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FileCreatPropList::FileCreatPropList( const FileCreatPropList& original ) : PropList( original ) {} +FileCreatPropList::FileCreatPropList(const FileCreatPropList& original) : PropList( original ) {} //-------------------------------------------------------------------------- -// Function: FileCreatPropList overloaded constructor -///\brief Creates a file creation property list using the id of an -/// existing one. -///\param plist_id - IN: FileCreatPropList id to use -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList overloaded constructor +///\brief Creates a file creation property list using the id of an +/// existing one. +///\param plist_id - IN: FileCreatPropList id to use +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList::FileCreatPropList(const hid_t plist_id) : PropList(plist_id) {} #ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getVersion -///\brief Retrieves version information for various parts of a file. -///\param super - OUT: The file super block. -///\param freelist - OUT: The global free list. -///\param stab - OUT: The root symbol table entry. -///\param shhdr - OUT: Shared object headers. -///\exception H5::PropListIException +// Function: FileCreatPropList::getVersion +///\brief Retrieves version information for various parts of a file. +///\param super - OUT: The file super block. +///\param freelist - OUT: The global free list. +///\param stab - OUT: The root symbol table entry. +///\param shhdr - OUT: Shared object headers. +///\exception H5::PropListIException ///\par Description -/// Any (or even all) of the output arguments can be null pointers. -// Programmer Binh-Minh Ribler - 2000 +/// Any (or even all) of the output arguments can be null pointers. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr) const { - herr_t ret_value = H5Pget_version( id, &super, &freelist, &stab, &shhdr ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::getVersion", - "H5Pget_version failed"); - } + herr_t ret_value = H5Pget_version(id, &super, &freelist, &stab, &shhdr); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::getVersion", + "H5Pget_version failed"); + } } #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setUserblock -///\brief Sets the user block size field of this file creation property list. -///\param size - IN: User block size to be set, in bytes -///\exception H5::PropListIException +// Function: FileCreatPropList::setUserblock +///\brief Sets the user block size field of this file creation property list. +///\param size - IN: User block size to be set, in bytes +///\exception H5::PropListIException ///\par Description -/// The default user block size is 0; it may be set to any power -/// of 2 equal to 512 or greater (512, 1024, 2048, etc.) -// Programmer Binh-Minh Ribler - 2000 +/// The default user block size is 0; it may be set to any power +/// of 2 equal to 512 or greater (512, 1024, 2048, etc.) +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::setUserblock( hsize_t size ) const +void FileCreatPropList::setUserblock(hsize_t size) const { - herr_t ret_value = H5Pset_userblock( id, size); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::setUserblock", - "H5Pset_userblock failed"); - } + herr_t ret_value = H5Pset_userblock(id, size); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::setUserblock", + "H5Pset_userblock failed"); + } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getUserblock -///\brief Returns the user block size of this file creation property list. -///\return User block size -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList::getUserblock +///\brief Returns the user block size of this file creation property list. +///\return User block size +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hsize_t FileCreatPropList::getUserblock() const { - hsize_t userblock_size; - herr_t ret_value = H5Pget_userblock( id, &userblock_size ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::getUserblock", - "H5Pget_userblock failed"); - } - return( userblock_size ); + hsize_t userblock_size; + herr_t ret_value = H5Pget_userblock(id, &userblock_size); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::getUserblock", + "H5Pget_userblock failed"); + } + return(userblock_size); } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setSizes -///\brief Sets the byte size of the offsets and lengths used to -/// address objects in an HDF5 file. -///\param sizeof_addr - IN: Size of an object offset in bytes -///\param sizeof_size - IN: Size of an object length in bytes. -///\exception H5::PropListIException +// Function: FileCreatPropList::setSizes +///\brief Sets the byte size of the offsets and lengths used to +/// address objects in an HDF5 file. +///\param sizeof_addr - IN: Size of an object offset in bytes +///\param sizeof_size - IN: Size of an object length in bytes. +///\exception H5::PropListIException ///\par Description -/// For information on setting sizes, please refer to the -/// C layer Reference Manual at: +/// For information on setting sizes, please refer to the +/// C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSizes -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const +void FileCreatPropList::setSizes(size_t sizeof_addr, size_t sizeof_size) const { - herr_t ret_value = H5Pset_sizes( id, sizeof_addr, sizeof_size ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::setSizes", - "H5Pset_sizes failed"); - } + herr_t ret_value = H5Pset_sizes(id, sizeof_addr, sizeof_size); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::setSizes", + "H5Pset_sizes failed"); + } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getSizes -///\brief Retrieves the size of the offsets and lengths used in an -/// HDF5 file. +// Function: FileCreatPropList::getSizes +///\brief Retrieves the size of the offsets and lengths used in an +/// HDF5 file. /// -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const +void FileCreatPropList::getSizes(size_t& sizeof_addr, size_t& sizeof_size) const { - herr_t ret_value = H5Pget_sizes( id, &sizeof_addr, &sizeof_size ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::getSizes", - "H5Pget_sizes failed"); - } + herr_t ret_value = H5Pget_sizes(id, &sizeof_addr, &sizeof_size); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::getSizes", + "H5Pget_sizes failed"); + } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setSymk -///\brief Sets the size of parameters used to control the symbol table -/// nodes. -///\param ik - IN: Symbol table tree rank -///\param lk - IN: Symbol table node size -///\exception H5::PropListIException +// Function: FileCreatPropList::setSymk +///\brief Sets the size of parameters used to control the symbol table +/// nodes. +///\param ik - IN: Symbol table tree rank +///\param lk - IN: Symbol table node size +///\exception H5::PropListIException ///\par Description -/// For information, please see the C layer Reference Manual at: +/// For information, please see the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSymK -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const +void FileCreatPropList::setSymk(unsigned ik, unsigned lk) const { - herr_t ret_value = H5Pset_sym_k( id, ik, lk ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::setSymk", - "H5Pset_sym_k failed"); - } + herr_t ret_value = H5Pset_sym_k(id, ik, lk); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::setSymk", + "H5Pset_sym_k failed"); + } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getSymk -///\brief Retrieves the size of the symbol table B-tree 1/2 rank and -/// the symbol table leaf node 1/2 size. +// Function: FileCreatPropList::getSymk +///\brief Retrieves the size of the symbol table B-tree 1/2 rank and +/// the symbol table leaf node 1/2 size. /// -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// For information, please see +/// For information, please see /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetSymK -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const +void FileCreatPropList::getSymk(unsigned& ik, unsigned& lk) const { - herr_t ret_value = H5Pget_sym_k( id, &ik, &lk ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::getSymk", - "H5Pget_sym_k failed"); - } + herr_t ret_value = H5Pget_sym_k(id, &ik, &lk); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::getSymk", + "H5Pget_sym_k failed"); + } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setIstorek -///\brief Sets the size of the parameter used to control the B-trees -/// for indexing chunked datasets. -///\param ik - IN: 1/2 rank of chunked storage B-tree -///\exception H5::PropListIException +// Function: FileCreatPropList::setIstorek +///\brief Sets the size of the parameter used to control the B-trees +/// for indexing chunked datasets. +///\param ik - IN: 1/2 rank of chunked storage B-tree +///\exception H5::PropListIException ///\par Description -/// For information, please see the C layer Reference Manual at: +/// For information, please see the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetIstoreK -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::setIstorek( unsigned ik ) const +void FileCreatPropList::setIstorek(unsigned ik) const { - herr_t ret_value = H5Pset_istore_k( id, ik ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::setIstorek", - "H5Pset_istore_k failed"); - } + herr_t ret_value = H5Pset_istore_k(id, ik); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::setIstorek", + "H5Pset_istore_k failed"); + } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getIstorek -///\brief Returns the 1/2 rank of an indexed storage B-tree. -///\return 1/2 rank of chunked storage B-tree -///\exception H5::PropListIException +// Function: FileCreatPropList::getIstorek +///\brief Returns the 1/2 rank of an indexed storage B-tree. +///\return 1/2 rank of chunked storage B-tree +///\exception H5::PropListIException ///\par Description -/// For information, please see +/// For information, please see /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetIstoreK -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- unsigned FileCreatPropList::getIstorek() const { - unsigned ik; - herr_t ret_value = H5Pget_istore_k( id, &ik ); - if( ret_value < 0 ) - { - throw PropListIException("FileCreatPropList::getIstorek", - "H5Pget_istore_k failed"); - } - return( ik ); + unsigned ik; + herr_t ret_value = H5Pget_istore_k(id, &ik); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::getIstorek", + "H5Pget_istore_k failed"); + } + return(ik); +} + +//-------------------------------------------------------------------------- +// Function: FileCreatPropList::setFileSpace +///\brief Sets the strategy and the threshold value that the library +/// will employ in managing file space. +///\param strategy - IN: Strategy for file space management +///\param threshold - IN: Free-space section threshold. The library +/// default is 1, which is to track all free-space sections. +///\exception H5::PropListIException +///\par Description +/// If the given strategy is zero, the property will not be +/// changed and the existing strategy will be retained. +/// If the given threshold value is zero, the property will not be +/// changed and the existing threshold will be retained. +/// Valid values of \a libver_low are as follows: +/// \li \c H5F_FILE_SPACE_ALL (Default) +/// \li \c H5F_FILE_SPACE_ALL_PERSIST +/// \li \c H5F_FILE_SPACE_AGGR_VFD +/// \li \c H5F_FILE_SPACE_VFD +/// For information, please see the C layer Reference Manual at: +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFileSpace +// Programmer Binh-Minh Ribler - Feb, 2017 +//-------------------------------------------------------------------------- +void FileCreatPropList::setFileSpace(H5F_file_space_type_t strategy, hsize_t threshold) const +{ + herr_t ret_value = H5Pset_file_space(id, strategy, threshold); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::setFileSpace", + "H5Pset_file_space failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: FileCreatPropList::getFileSpaceStrategy +///\brief Returns the strategy that the library uses in managing file space. +///\return The strategy value +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Feb, 2017 +//-------------------------------------------------------------------------- +H5F_file_space_type_t FileCreatPropList::getFileSpaceStrategy() const +{ + H5F_file_space_type_t strategy = H5F_FILE_SPACE_ALL; + herr_t ret_value = H5Pget_file_space(id, &strategy, NULL); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::getFileSpaceStrategy", + "H5Pget_file_space for strategy failed"); + } + return(strategy); +} + +//-------------------------------------------------------------------------- +// Function: FileCreatPropList::getFileSpaceThreshold +///\brief Returns the threshold value that the library uses in tracking +/// free space sections. +///\return The threshold value +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Feb, 2017 +//-------------------------------------------------------------------------- +hsize_t FileCreatPropList::getFileSpaceThreshold() const +{ + hsize_t threshold = 0; + herr_t ret_value = H5Pget_file_space(id, NULL, &threshold); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::getFileSpaceThreshold", + "H5Pget_file_space for threshold failed"); + } + return(threshold); } //-------------------------------------------------------------------------- -// Function: FileCreatPropList destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList::~FileCreatPropList() {} diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 1ac925e..1bbaabf 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -27,67 +27,78 @@ namespace H5 { */ class H5_DLLCPP FileCreatPropList : public PropList { public: - ///\brief Default file creation property list. - static const FileCreatPropList& DEFAULT; + ///\brief Default file creation property list. + static const FileCreatPropList& DEFAULT; - // Creates a file create property list. - FileCreatPropList(); + // Creates a file create property list. + FileCreatPropList(); #ifndef H5_NO_DEPRECATED_SYMBOLS - // Retrieves version information for various parts of a file. - void getVersion( unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr ) const; + // Retrieves version information for various parts of a file. + void getVersion(unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr) const; #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Sets the userblock size field of a file creation property list. - void setUserblock( hsize_t size ) const; + // Sets the userblock size field of a file creation property list. + void setUserblock(hsize_t size) const; - // Gets the size of a user block in this file creation property list. - hsize_t getUserblock() const; + // Gets the size of a user block in this file creation property list. + hsize_t getUserblock() const; - // Retrieves the size-of address and size quantities stored in a - // file according to this file creation property list. - void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const; + // Retrieves the size-of address and size quantities stored in a + // file according to this file creation property list. + void getSizes(size_t& sizeof_addr, size_t& sizeof_size) const; - // Sets file size-of addresses and sizes. - void setSizes( size_t sizeof_addr = 4, size_t sizeof_size = 4 ) const; + // Sets file size-of addresses and sizes. + void setSizes(size_t sizeof_addr = 4, size_t sizeof_size = 4) const; - // Retrieves the size of the symbol table B-tree 1/2 rank and the - // symbol table leaf node 1/2 size. - void getSymk( unsigned& int_nodes_k, unsigned& leaf_nodes_k ) const; + // Retrieves the size of the symbol table B-tree 1/2 rank and the + // symbol table leaf node 1/2 size. + void getSymk(unsigned& int_nodes_k, unsigned& leaf_nodes_k) const; - // Sets the size of parameters used to control the symbol table nodes. - void setSymk( unsigned int_nodes_k, unsigned leaf_nodes_k ) const; + // Sets the size of parameters used to control the symbol table nodes. + void setSymk(unsigned int_nodes_k, unsigned leaf_nodes_k) const; - // Returns the 1/2 rank of an indexed storage B-tree. - unsigned getIstorek() const; + // Returns the 1/2 rank of an indexed storage B-tree. + unsigned getIstorek() const; - // Sets the size of parameter used to control the B-trees for - // indexing chunked datasets. - void setIstorek( unsigned ik ) const; + // Sets the size of parameter used to control the B-trees for + // indexing chunked datasets. + void setIstorek(unsigned ik) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("FileCreatPropList"); } + // Sets the strategy and the threshold value that the library will + // will employ in managing file space. + void setFileSpace(H5F_file_space_type_t strategy, hsize_t threshold) const; - // Copy constructor: creates a copy of a FileCreatPropList object. - FileCreatPropList(const FileCreatPropList& orig); + // Returns the strategy that the library uses in managing file space. + H5F_file_space_type_t getFileSpaceStrategy() const; - // Creates a copy of an existing file create property list - // using the property list id. - FileCreatPropList (const hid_t plist_id); + // Returns the threshold value that the library uses in tracking free + // space sections. + hsize_t getFileSpaceThreshold() const; - // Noop destructor - virtual ~FileCreatPropList(); + ///\brief Returns this class name. + virtual H5std_string fromClass() const { return("FileCreatPropList"); } + + // Copy constructor: creates a copy of a FileCreatPropList object. + FileCreatPropList(const FileCreatPropList& orig); + + // Creates a copy of an existing file create property list + // using the property list id. + FileCreatPropList(const hid_t plist_id); + + // Noop destructor + virtual ~FileCreatPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Deletes the global constant, should only be used by the library - static void deleteConstants(); + // Deletes the global constant, should only be used by the library + static void deleteConstants(); private: - static FileCreatPropList* DEFAULT_; + static FileCreatPropList* DEFAULT_; - // Creates the global constant, should only be used by the library - static FileCreatPropList* getConstant(); + // Creates the global constant, should only be used by the library + static FileCreatPropList* getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index fcf4e1c..cdb5837 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -46,43 +46,43 @@ namespace H5 { //-------------------------------------------------------------------------- // Function H5File default constructor -///\brief Default constructor: creates a stub H5File object. -// Programmer Binh-Minh Ribler - 2000 +///\brief Default constructor: creates a stub H5File object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File() : Group(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: H5File overloaded constructor -///\brief Creates or opens an HDF5 file depending on the parameter flags. -///\param name - IN: Name of the file -///\param flags - IN: File access flags -///\param create_plist - IN: File creation property list, used when -/// modifying default file meta-data. Default to -/// FileCreatPropList::DEFAULT -///\param access_plist - IN: File access property list. Default to -/// FileAccPropList::DEFAULT +// Function: H5File overloaded constructor +///\brief Creates or opens an HDF5 file depending on the parameter flags. +///\param name - IN: Name of the file +///\param flags - IN: File access flags +///\param create_plist - IN: File creation property list, used when +/// modifying default file meta-data. Default to +/// FileCreatPropList::DEFAULT +///\param access_plist - IN: File access property list. Default to +/// FileAccPropList::DEFAULT ///\par Description -/// Valid values of \a flags include: -/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, -/// erasing all data previously stored in -/// the file. -/// \li \c H5F_ACC_EXCL - Fail if file already exists. -/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive -/// \li \c H5F_ACC_RDONLY - Open file as read-only, if it already -/// exists, and fail, otherwise -/// \li \c H5F_ACC_RDWR - Open file for read/write, if it already -/// exists, and fail, otherwise +/// Valid values of \a flags include: +/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, +/// erasing all data previously stored in +/// the file. +/// \li \c H5F_ACC_EXCL - Fail if file already exists. +/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive +/// \li \c H5F_ACC_RDONLY - Open file as read-only, if it already +/// exists, and fail, otherwise +/// \li \c H5F_ACC_RDWR - Open file for read/write, if it already +/// exists, and fail, otherwise ///\par -/// For info on file creation in the case of an already-open file, -/// please refer to the \b Special \b case section in the C layer -/// Reference Manual at: +/// For info on file creation in the case of an already-open file, +/// please refer to the \b Special \b case section in the C layer +/// Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create // Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file -// could not be caught in the applications. Added try block here -// to catch then re-throw it. -BMR 2013/03/21 -// Programmer Binh-Minh Ribler - 2000 +// could not be caught in the applications. Added try block here +// to catch then re-throw it. -BMR 2013/03/21 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : Group(), id(H5I_INVALID_HID) +H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) { try { p_get_file(name, flags, create_plist, access_plist); @@ -92,22 +92,22 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c } //-------------------------------------------------------------------------- -// Function: H5File overloaded constructor -///\brief This is another overloaded constructor. It differs from the -/// above constructor only in the type of the \a name argument. -///\param name - IN: Name of the file - \c H5std_string -///\param flags - IN: File access flags -///\param create_plist - IN: File creation property list, used when -/// modifying default file meta-data. Default to -/// FileCreatPropList::DEFAULT -///\param access_plist - IN: File access property list. Default to -/// FileAccPropList::DEFAULT +// Function: H5File overloaded constructor +///\brief This is another overloaded constructor. It differs from the +/// above constructor only in the type of the \a name argument. +///\param name - IN: Name of the file - \c H5std_string +///\param flags - IN: File access flags +///\param create_plist - IN: File creation property list, used when +/// modifying default file meta-data. Default to +/// FileCreatPropList::DEFAULT +///\param access_plist - IN: File access property list. Default to +/// FileAccPropList::DEFAULT // Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file -// could not be caught in the applications. Added try block here -// to catch then re-throw it. -BMR 2013/03/21 -// Programmer Binh-Minh Ribler - 2000 +// could not be caught in the applications. Added try block here +// to catch then re-throw it. -BMR 2013/03/21 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : Group(), id(H5I_INVALID_HID) +H5File::H5File(const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) { try { p_get_file(name.c_str(), flags, create_plist, access_plist); @@ -120,21 +120,21 @@ H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPro //-------------------------------------------------------------------------- // This function is private and contains common code between the // constructors taking a string or a char* -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Modification -// - removed H5F_ACC_CREAT because H5Fcreate will fail with -// H5F_ACC_CREAT. - BMR, Sep 17, 2014 +// - removed H5F_ACC_CREAT because H5Fcreate will fail with +// H5F_ACC_CREAT. - BMR, Sep 17, 2014 //-------------------------------------------------------------------------- void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) { // These bits only set for creation, so if any of them are set, // create the file. - if( flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC)) + if (flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC)) { hid_t create_plist_id = create_plist.getId(); hid_t access_plist_id = access_plist.getId(); - id = H5Fcreate( name, flags, create_plist_id, access_plist_id ); - if( id < 0 ) // throw an exception when open/create fail + id = H5Fcreate(name, flags, create_plist_id, access_plist_id); + if (id < 0) // throw an exception when open/create fail { throw FileIException("H5File constructor", "H5Fcreate failed"); } @@ -143,8 +143,8 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro else { hid_t access_plist_id = access_plist.getId(); - id = H5Fopen( name, flags, access_plist_id ); - if( id < 0 ) // throw an exception when open/create fail + id = H5Fopen(name, flags, access_plist_id); + if (id < 0) // throw an exception when open/create fail { throw FileIException("H5File constructor", "H5Fopen failed"); } @@ -152,17 +152,17 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro } //-------------------------------------------------------------------------- -// Function: H5File overloaded constructor -///\brief Creates an H5File object using an existing file id. -///\param existing_id - IN: Id of an existing file -// Programmer Binh-Minh Ribler - 2015 +// Function: H5File overloaded constructor +///\brief Creates an H5File object using an existing file id. +///\param existing_id - IN: Id of an existing file +// Programmer Binh-Minh Ribler - 2015 // Description // Mar 29, 2015 -// Added in responding to a request from user Jason Newton. -// However, it is not recommended to use the private member "id" -// in applications. Unlike other situations, where similar -// constructor is needed by the library in order to return -// an object, H5File doesn't need it. -BMR (HDFFV-8766 partially) +// Added in responding to a request from user Jason Newton. +// However, it is not recommended to use the private member "id" +// in applications. Unlike other situations, where similar +// constructor is needed by the library in order to return +// an object, H5File doesn't need it. -BMR (HDFFV-8766 partially) //-------------------------------------------------------------------------- H5File::H5File(hid_t existing_id) : Group() { @@ -173,11 +173,11 @@ H5File::H5File(hid_t existing_id) : Group() #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5File copy constructor -///\brief Copy constructor: makes a copy of the original -/// H5File object. -///\param original - IN: H5File instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File copy constructor +///\brief Copy constructor: makes a copy of the original +/// H5File object. +///\param original - IN: H5File instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File(const H5File& original) : Group() { @@ -186,57 +186,57 @@ H5File::H5File(const H5File& original) : Group() } //-------------------------------------------------------------------------- -// Function: H5File::isHdf5 (static) -///\brief Determines whether a file in HDF5 format. (Static) -///\param name - IN: Name of the file -///\return true if the file is in HDF5 format, and false, otherwise -///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::isHdf5 (static) +///\brief Determines whether a file in HDF5 format. (Static) +///\param name - IN: Name of the file +///\return true if the file is in HDF5 format, and false, otherwise +///\exception H5::FileIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool H5File::isHdf5(const char* name) { - // Calls C routine H5Fis_hdf5 to determine whether the file is in - // HDF5 format. It returns positive value, 0, or negative value - htri_t ret_value = H5Fis_hdf5( name ); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else // Raise exception when H5Fis_hdf5 returns a negative value - { - throw FileIException("H5File::isHdf5", "H5Fis_hdf5 returned negative value"); - } + // Calls C routine H5Fis_hdf5 to determine whether the file is in + // HDF5 format. It returns positive value, 0, or negative value + htri_t ret_value = H5Fis_hdf5(name); + if (ret_value > 0) + return true; + else if (ret_value == 0) + return false; + else // Raise exception when H5Fis_hdf5 returns a negative value + { + throw FileIException("H5File::isHdf5", "H5Fis_hdf5 returned negative value"); + } } //-------------------------------------------------------------------------- -// Function: H5File::isHdf5 (static) -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \c H5std_string for \a name. (Static) -///\param name - IN: Name of the file - \c H5std_string -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::isHdf5 (static) +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \c H5std_string for \a name. (Static) +///\param name - IN: Name of the file - \c H5std_string +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -bool H5File::isHdf5(const H5std_string& name ) +bool H5File::isHdf5(const H5std_string& name) { - return( isHdf5( name.c_str()) ); + return(isHdf5( name.c_str())); } //-------------------------------------------------------------------------- -// Function: openFile -///\brief Opens an HDF5 file -///\param name - IN: Name of the file -///\param flags - IN: File access flags -///\param access_plist - IN: File access property list. Default to -/// FileAccPropList::DEFAULT +// Function: openFile +///\brief Opens an HDF5 file +///\param name - IN: Name of the file +///\param flags - IN: File access flags +///\param access_plist - IN: File access property list. Default to +/// FileAccPropList::DEFAULT ///\par Description -/// Valid values of \a flags include: -/// H5F_ACC_RDWR: Open with read/write access. If the file is -/// currently open for read-only access then it -/// will be reopened. Absence of this flag -/// implies read-only access. +/// Valid values of \a flags include: +/// H5F_ACC_RDWR: Open with read/write access. If the file is +/// currently open for read-only access then it +/// will be reopened. Absence of this flag +/// implies read-only access. /// -/// H5F_ACC_RDONLY: Open with read only access. - default +/// H5F_ACC_RDONLY: Open with read only access. - default /// -// Programmer Binh-Minh Ribler - Oct, 2005 +// Programmer Binh-Minh Ribler - Oct, 2005 //-------------------------------------------------------------------------- void H5File::openFile(const char* name, unsigned int flags, const FileAccPropList& access_plist) { @@ -256,14 +256,14 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis } //-------------------------------------------------------------------------- -// Function: H5File::openFile -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \c H5std_string for \a name. -///\param name - IN: Name of the file - \c H5std_string -///\param flags - IN: File access flags -///\param access_plist - IN: File access property list. Default to -/// FileAccPropList::DEFAULT -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::openFile +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \c H5std_string for \a name. +///\param name - IN: Name of the file - \c H5std_string +///\param flags - IN: File access flags +///\param access_plist - IN: File access property list. Default to +/// FileAccPropList::DEFAULT +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAccPropList& access_plist) { @@ -271,21 +271,21 @@ void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAc } //-------------------------------------------------------------------------- -// Function: H5File::reOpen -///\brief Reopens this file. +// Function: H5File::reOpen +///\brief Reopens this file. /// -///\exception H5::FileIException +///\exception H5::FileIException // Description -// If this object has represented another HDF5 file, the previous -// HDF5 file need to be closed first. -// Programmer Binh-Minh Ribler - 2000 +// If this object has represented another HDF5 file, the previous +// HDF5 file need to be closed first. +// Programmer Binh-Minh Ribler - 2000 // Note: This wrapper doesn't seem right regarding the 'id' and should // be investigated. BMR - 2/20/2005 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Feb 20, 2005 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Feb 20, 2005 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- void H5File::reOpen() { @@ -296,129 +296,148 @@ void H5File::reOpen() throw FileIException("H5File::reOpen", close_error.getDetailMsg()); } - // call C routine to reopen the file - Note: not sure about this, - // which id to be the parameter when closing? - id = H5Freopen( id ); - if( id < 0 ) // Raise exception when H5Freopen returns a neg value - throw FileIException("H5File::reOpen", "H5Freopen failed"); + // call C routine to reopen the file - Note: not sure about this, + // which id to be the parameter when closing? + id = H5Freopen(id); + if (id < 0) // Raise exception when H5Freopen returns a neg value + throw FileIException("H5File::reOpen", "H5Freopen failed"); } //-------------------------------------------------------------------------- -// Function: H5File::getCreatePlist -///\brief Returns the creation property list of this file -///\return FileCreatPropList object -///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::getCreatePlist +///\brief Returns the creation property list of this file +///\return FileCreatPropList object +///\exception H5::FileIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList H5File::getCreatePlist() const { - hid_t create_plist_id = H5Fget_create_plist( id ); - - // if H5Fget_create_plist returns a valid id, create and return - // the FileCreatPropList object for this property list - if( create_plist_id > 0 ) - { - FileCreatPropList create_plist( create_plist_id ); - return( create_plist ); - } - else - { - throw FileIException("H5File::getCreatePlist", "H5Fget_create_plist failed"); - } + hid_t create_plist_id = H5Fget_create_plist(id); + + // if H5Fget_create_plist returns a valid id, create and return + // the FileCreatPropList object for this property list + if (create_plist_id > 0) + { + FileCreatPropList create_plist(create_plist_id); + return(create_plist); + } + else + { + throw FileIException("H5File::getCreatePlist", "H5Fget_create_plist failed"); + } } //-------------------------------------------------------------------------- -// Function: H5File::getAccessPlist -///\brief Returns the access property list of this file -///\return FileAccPropList object -///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::getAccessPlist +///\brief Returns the access property list of this file +///\return FileAccPropList object +///\exception H5::FileIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileAccPropList H5File::getAccessPlist() const { - hid_t access_plist_id = H5Fget_access_plist( id ); + hid_t access_plist_id = H5Fget_access_plist(id); - // if H5Fget_access_plist returns a valid id, create and return - // the FileAccPropList object for this property list - if( access_plist_id > 0 ) - { - FileAccPropList access_plist( access_plist_id ); + // if H5Fget_access_plist returns a valid id, create and return + // the FileAccPropList object for this property list + if (access_plist_id > 0) + { + FileAccPropList access_plist(access_plist_id); return access_plist; - } - else // Raise an exception - { - throw FileIException("H5File::getAccessPlist", "H5Fget_access_plist failed"); - } + } + else // Raise an exception + { + throw FileIException("H5File::getAccessPlist", "H5Fget_access_plist failed"); + } } //-------------------------------------------------------------------------- -// Function: H5File::getFreeSpace -///\brief Returns the amount of free space in the file. -///\return Amount of free space -///\exception H5::FileIException +// Function: H5File::getFileInfo +///\brief Retrieves the general information of this file. +/// +///\exception H5::FileIException +///\par Description +/// The retrieved information may include information about +/// superblock extension, free space management, and shared object +// Programmer Binh-Minh Ribler - February 2017 +//-------------------------------------------------------------------------- +void H5File::getFileInfo(H5F_info2_t& file_info) const +{ + herr_t ret_value = H5Fget_info2(id, &file_info); + if (ret_value < 0) + { + throw FileIException("H5File::getFileInfo", "H5Fget_info2 failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: H5File::getFreeSpace +///\brief Returns the amount of free space in the file. +///\return Amount of free space +///\exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- hssize_t H5File::getFreeSpace() const { - hssize_t free_space = H5Fget_freespace(id); - if( free_space < 0 ) - { - throw FileIException("H5File::getFreeSpace", "H5Fget_freespace failed"); - } - return (free_space); + hssize_t free_space = H5Fget_freespace(id); + if (free_space < 0) + { + throw FileIException("H5File::getFreeSpace", "H5Fget_freespace failed"); + } + return (free_space); } //-------------------------------------------------------------------------- -// Function: H5File::getObjCount -///\brief Returns the number of opened object IDs (files, datasets, -/// groups and datatypes) in the same file. -///\param types - Type of object to retrieve the count -///\return Number of opened object IDs -///\exception H5::FileIException +// Function: H5File::getObjCount +///\brief Returns the number of opened object IDs (files, datasets, +/// groups and datatypes) in the same file. +///\param types - Type of object to retrieve the count +///\return Number of opened object IDs +///\exception H5::FileIException ///\par Description -/// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only -/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// The valid values for \a types include: +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ssize_t H5File::getObjCount(unsigned types) const { - ssize_t num_objs = H5Fget_obj_count(id, types); - if( num_objs < 0 ) - { - throw FileIException("H5File::getObjCount", "H5Fget_obj_count failed"); - } - return (num_objs); + ssize_t num_objs = H5Fget_obj_count(id, types); + if (num_objs < 0) + { + throw FileIException("H5File::getObjCount", "H5Fget_obj_count failed"); + } + return (num_objs); } //-------------------------------------------------------------------------- -// Function: H5File::getObjIDs -///\brief Retrieves a list of opened object IDs (files, datasets, -/// groups and datatypes) in the same file. -///\param types - Type of object to retrieve the count -///\param max_objs - Maximum number of object identifiers to place -/// into obj_id_list. -///\param oid_list - List of open object identifiers -///\exception H5::FileIException +// Function: H5File::getObjIDs +///\brief Retrieves a list of opened object IDs (files, datasets, +/// groups and datatypes) in the same file. +///\param types - Type of object to retrieve the count +///\param max_objs - Maximum number of object identifiers to place +/// into obj_id_list. +///\param oid_list - List of open object identifiers +///\exception H5::FileIException ///\par Description -/// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only -/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// The valid values for \a types include: +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // @@ -427,56 +446,56 @@ ssize_t H5File::getObjCount(unsigned types) const //-------------------------------------------------------------------------- void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const { - ssize_t ret_value = H5Fget_obj_ids(id, types, max_objs, oid_list); - if( ret_value < 0 ) - { - throw FileIException("H5File::getObjIDs", "H5Fget_obj_ids failed"); - } + ssize_t ret_value = H5Fget_obj_ids(id, types, max_objs, oid_list); + if (ret_value < 0) + { + throw FileIException("H5File::getObjIDs", "H5Fget_obj_ids failed"); + } } //-------------------------------------------------------------------------- -// Function: H5File::getVFDHandle -///\brief Returns the pointer to the file handle of the low-level file -/// driver. -///\param fapl - File access property list -///\param file_handle - Pointer to the file handle being used by -/// the low-level virtual file driver -///\exception H5::FileIException +// Function: H5File::getVFDHandle +///\brief Returns the pointer to the file handle of the low-level file +/// driver. +///\param fapl - File access property list +///\param file_handle - Pointer to the file handle being used by +/// the low-level virtual file driver +///\exception H5::FileIException ///\par Description -/// For the \c FAMILY or \c MULTI drivers, \a fapl should be -/// defined through the property list functions: -/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver -/// and \c FileAccPropList::setMultiType for the \c MULTI driver. +/// For the \c FAMILY or \c MULTI drivers, \a fapl should be +/// defined through the property list functions: +/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver +/// and \c FileAccPropList::setMultiType for the \c MULTI driver. /// -/// The obtained file handle is dynamic and is valid only while -/// the file remains open; it will be invalid if the file is -/// closed and reopened or opened during a subsequent session. +/// The obtained file handle is dynamic and is valid only while +/// the file remains open; it will be invalid if the file is +/// closed and reopened or opened during a subsequent session. // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const { - hid_t fapl_id = fapl.getId(); - herr_t ret_value = H5Fget_vfd_handle(id, fapl_id, file_handle); - if( ret_value < 0 ) - { - throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed"); - } + hid_t fapl_id = fapl.getId(); + herr_t ret_value = H5Fget_vfd_handle(id, fapl_id, file_handle); + if (ret_value < 0) + { + throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed"); + } } //-------------------------------------------------------------------------- -// Function: H5File::getVFDHandle -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. +// Function: H5File::getVFDHandle +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. // Param fapl - File access property list // Param file_handle - Pointer to the file handle being used by -// the low-level virtual file driver +// the low-level virtual file driver // Exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 // Modification -// Planned for removal. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Planned for removal. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void H5File::getVFDHandle(FileAccPropList& fapl, void **file_handle) const //{ @@ -484,103 +503,103 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const //} //-------------------------------------------------------------------------- -// Function: H5File::getVFDHandle -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param file_handle - Pointer to the file handle being used by -/// the low-level virtual file driver -///\exception H5::FileIException +// Function: H5File::getVFDHandle +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param file_handle - Pointer to the file handle being used by +/// the low-level virtual file driver +///\exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- void H5File::getVFDHandle(void **file_handle) const { - herr_t ret_value = H5Fget_vfd_handle(id, H5P_DEFAULT, file_handle); - if( ret_value < 0 ) - { - throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed"); - } + herr_t ret_value = H5Fget_vfd_handle(id, H5P_DEFAULT, file_handle); + if (ret_value < 0) + { + throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed"); + } } //-------------------------------------------------------------------------- -// Function: H5File::getFileSize -///\brief Returns the file size of the HDF5 file. -///\return File size -///\exception H5::FileIException +// Function: H5File::getFileSize +///\brief Returns the file size of the HDF5 file. +///\return File size +///\exception H5::FileIException ///\par Description -/// This function is called after an existing file is opened in -/// order to learn the true size of the underlying file. +/// This function is called after an existing file is opened in +/// order to learn the true size of the underlying file. // Programmer Raymond Lu - June 24, 2004 //-------------------------------------------------------------------------- hsize_t H5File::getFileSize() const { - hsize_t file_size; - herr_t ret_value = H5Fget_filesize(id, &file_size); - if (ret_value < 0) - { - throw FileIException("H5File::getFileSize", "H5Fget_filesize failed"); - } - return (file_size); + hsize_t file_size; + herr_t ret_value = H5Fget_filesize(id, &file_size); + if (ret_value < 0) + { + throw FileIException("H5File::getFileSize", "H5Fget_filesize failed"); + } + return (file_size); } //-------------------------------------------------------------------------- -// Function: H5File::getId -///\brief Get the id of this file -///\return File identifier -// Modification: +// Function: H5File::getId +///\brief Get the id of this file +///\return File identifier +// Modification // May 2008 - BMR -// Class hierarchy is revised to address bugzilla 1068. Class -// AbstractDS and Attribute are moved out of H5Object. In -// addition, member IdComponent::id is moved into subclasses, and -// IdComponent::getId now becomes pure virtual function. -// Programmer Binh-Minh Ribler - May, 2008 +// Class hierarchy is revised to address bugzilla 1068. Class +// AbstractDS and Attribute are moved out of H5Object. In +// addition, member IdComponent::id is moved into subclasses, and +// IdComponent::getId now becomes pure virtual function. +// Programmer Binh-Minh Ribler - May, 2008 //-------------------------------------------------------------------------- hid_t H5File::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5File::reopen -// Purpose: Reopens this file. +// Function: H5File::reopen +// Purpose Reopens this file. // Exception H5::FileIException // Description -// This function is replaced by the above function reOpen. -// Programmer Binh-Minh Ribler - 2000 +// This function is replaced by the above function reOpen. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::reopen() { - H5File::reOpen(); + H5File::reOpen(); } //-------------------------------------------------------------------------- -// Function: H5File::getLocId -// Purpose: Get the id of this file +// Function: H5File::getLocId +// Purpose Get the id of this file // Description -// This function is a redefinition of CommonFG::getLocId. It -// is used by CommonFG member functions to get the file id. -// Programmer Binh-Minh Ribler - 2000 +// This function is a redefinition of CommonFG::getLocId. It +// is used by CommonFG member functions to get the file id. +// Programmer Binh-Minh Ribler - 2000 // Deprecated: // After HDFFV-9920, the Group's methods can use getId() and getLocId() // is kept for backward compatibility. Aug 18, 2016 -BMR //-------------------------------------------------------------------------- hid_t H5File::getLocId() const { - return( getId() ); + return(getId()); } //-------------------------------------------------------------------------- -// Function: H5File::p_setId (protected) -///\brief Sets the identifier of this object to a new value. +// Function: H5File::p_setId (protected) +///\brief Sets the identifier of this object to a new value. /// -///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails -// Description: -// The underlaying reference counting in the C library ensures -// that the current valid id of this object is properly closed. -// Then the object's id is reset to the new id. -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::IdComponentException when the attempt to close the HDF5 +/// object fails +// Description +// The underlaying reference counting in the C library ensures +// that the current valid id of this object is properly closed. +// Then the object's id is reset to the new id. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::p_setId(const hid_t new_id) { @@ -591,24 +610,24 @@ void H5File::p_setId(const hid_t new_id) catch (Exception& E) { throw FileIException("H5File::p_setId", E.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5File::close -///\brief Closes this HDF5 file. +// Function: H5File::close +///\brief Closes this HDF5 file. /// -///\exception H5::FileIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::FileIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void H5File::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Fclose( id ); - if( ret_value < 0 ) + herr_t ret_value = H5Fclose(id); + if (ret_value < 0) { throw FileIException("H5File::close", "H5Fclose failed"); } @@ -618,34 +637,34 @@ void H5File::close() } //-------------------------------------------------------------------------- -// Function: H5File::throwException -///\brief Throws file exception - initially implemented for CommonFG -///\param func_name - Name of the function where failure occurs -///\param msg - Message describing the failure -///\exception H5::FileIException +// Function: H5File::throwException +///\brief Throws file exception - initially implemented for CommonFG +///\param func_name - Name of the function where failure occurs +///\param msg - Message describing the failure +///\exception H5::FileIException // Description // This function is also used in H5Location implementation so that -// proper exception can be thrown for file or group. The -// "H5File::" will be inserted to indicate the function called is -// an implementation of H5File. -// Programmer Binh-Minh Ribler - 2000 +// proper exception can be thrown for file or group. The +// "H5File::" will be inserted to indicate the function called is +// an implementation of H5File. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::throwException(const H5std_string& func_name, const H5std_string& msg) const { - H5std_string full_name = func_name; - full_name.insert(0, "H5File::"); - throw FileIException(full_name, msg); + H5std_string full_name = func_name; + full_name.insert(0, "H5File::"); + throw FileIException(full_name, msg); } //-------------------------------------------------------------------------- -// Function: H5File destructor -///\brief Properly terminates access to this file. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File destructor +///\brief Properly terminates access to this file. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Feb 20, 2005 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Feb 20, 2005 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- H5File::~H5File() { diff --git a/c++/src/H5File.h b/c++/src/H5File.h index dca6c67..5ac9118 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -28,97 +28,100 @@ namespace H5 { */ class H5_DLLCPP H5File : public Group { public: - // Creates or opens an HDF5 file. - H5File( const char* name, unsigned int flags, - const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT ); - H5File( const H5std_string& name, unsigned int flags, - const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT ); + // Creates or opens an HDF5 file. + H5File(const char* name, unsigned int flags, + const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, + const FileAccPropList& access_plist = FileAccPropList::DEFAULT); + H5File(const H5std_string& name, unsigned int flags, + const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, + const FileAccPropList& access_plist = FileAccPropList::DEFAULT); - // Open the file - void openFile(const H5std_string& name, unsigned int flags, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT); - void openFile(const char* name, unsigned int flags, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT); + // Open the file + void openFile(const H5std_string& name, unsigned int flags, + const FileAccPropList& access_plist = FileAccPropList::DEFAULT); + void openFile(const char* name, unsigned int flags, + const FileAccPropList& access_plist = FileAccPropList::DEFAULT); - // Close this file. - virtual void close(); + // Close this file. + virtual void close(); - // Gets the access property list of this file. - FileAccPropList getAccessPlist() const; + // Gets the access property list of this file. + FileAccPropList getAccessPlist() const; - // Gets the creation property list of this file. - FileCreatPropList getCreatePlist() const; + // Gets the creation property list of this file. + FileCreatPropList getCreatePlist() const; - // Retrieves the file size of an opened file. - hsize_t getFileSize() const; + // Gets general information about this file. + void getFileInfo(H5F_info2_t& file_info) const; - // Returns the amount of free space in the file. - hssize_t getFreeSpace() const; + // Returns the amount of free space in the file. + hssize_t getFreeSpace() const; - // Returns the number of opened object IDs (files, datasets, groups - // and datatypes) in the same file. - ssize_t getObjCount(unsigned types = H5F_OBJ_ALL) const; + // Returns the number of opened object IDs (files, datasets, groups + // and datatypes) in the same file. + ssize_t getObjCount(unsigned types = H5F_OBJ_ALL) const; - // Retrieves a list of opened object IDs (files, datasets, groups - // and datatypes) in the same file. - void getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const; + // Retrieves a list of opened object IDs (files, datasets, groups + // and datatypes) in the same file. + void getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const; - // Returns the pointer to the file handle of the low-level file driver. - void getVFDHandle(void **file_handle) const; - void getVFDHandle(const FileAccPropList& fapl, void **file_handle) const; - //void getVFDHandle(FileAccPropList& fapl, void **file_handle) const; // removed from 1.8.18 and 1.10.1 + // Returns the pointer to the file handle of the low-level file driver. + void getVFDHandle(void **file_handle) const; + void getVFDHandle(const FileAccPropList& fapl, void **file_handle) const; + //void getVFDHandle(FileAccPropList& fapl, void **file_handle) const; // removed from 1.8.18 and 1.10.1 - // Determines if a file, specified by its name, is in HDF5 format - static bool isHdf5(const char* name ); - static bool isHdf5(const H5std_string& name ); + // Returns the file size of the HDF5 file. + hsize_t getFileSize() const; - // Reopens this file. - void reOpen(); // added for better name + // Determines if a file, specified by its name, is in HDF5 format + static bool isHdf5(const char* name); + static bool isHdf5(const H5std_string& name); + + // Reopens this file. + void reOpen(); // added for better name #ifndef DOXYGEN_SHOULD_SKIP_THIS - void reopen(); // obsolete in favor of reOpen() + void reopen(); // obsolete in favor of reOpen() - // Creates an H5File using an existing file id. Not recommended - // in applications. - H5File(hid_t existing_id); + // Creates an H5File using an existing file id. Not recommended + // in applications. + H5File(hid_t existing_id); #endif // DOXYGEN_SHOULD_SKIP_THIS - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("H5File"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("H5File"); } - // Throw file exception. - virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; + // Throw file exception. + virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; - // for CommonFG to get the file id. - virtual hid_t getLocId() const; + // for CommonFG to get the file id. + virtual hid_t getLocId() const; - // Default constructor - H5File(); + // Default constructor + H5File(); - // Copy constructor: makes a copy of the original H5File object. - H5File(const H5File& original); + // Copy constructor: makes a copy of the original H5File object. + H5File(const H5File& original); - // Gets the HDF5 file id. - virtual hid_t getId() const; + // Gets the HDF5 file id. + virtual hid_t getId() const; - // H5File destructor. - virtual ~H5File(); + // H5File destructor. + virtual ~H5File(); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Sets the HDF5 file id. - virtual void p_setId(const hid_t new_id); + // Sets the HDF5 file id. + virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 file id + hid_t id; // HDF5 file id - // This function is private and contains common code between the - // constructors taking a string or a char* - void p_get_file( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ); + // This function is private and contains common code between the + // constructors taking a string or a char* + void p_get_file(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist); }; } diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 73e8072..5902cbe 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -36,73 +36,73 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: FloatType default constructor -///\brief Default constructor: Creates a stub floating-point datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType default constructor +///\brief Default constructor: Creates a stub floating-point datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType::FloatType() {} //-------------------------------------------------------------------------- -// Function: FloatType overloaded constructor -///\brief Creates a floating-point datatype using a predefined type. -///\param pred_type - IN: Predefined datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType overloaded constructor +///\brief Creates a floating-point datatype using a predefined type. +///\param pred_type - IN: Predefined datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType::FloatType( const PredType& pred_type ) : AtomType() +FloatType::FloatType(const PredType& pred_type) : AtomType() { - // use DataType::copy to make a copy of this predefined type - copy( pred_type ); + // use DataType::copy to make a copy of this predefined type + copy(pred_type); } //-------------------------------------------------------------------------- -// Function: FloatType overloaded constructor -///\brief Creates an FloatType object using the id of an existing -/// datatype. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType overloaded constructor +///\brief Creates an FloatType object using the id of an existing +/// datatype. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType::FloatType( const hid_t existing_id ) : AtomType( existing_id ) {} +FloatType::FloatType(const hid_t existing_id) : AtomType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: FloatType copy constructor -///\brief Copy constructor: makes a copy of the original FloatType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType copy constructor +///\brief Copy constructor: makes a copy of the original FloatType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType::FloatType( const FloatType& original ) : AtomType( original ){} +FloatType::FloatType(const FloatType& original) : AtomType( original ){} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Gets the floating-point datatype of the specified dataset -///\param dataset - IN: Dataset that this floating-point datatype -/// associates with -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType overloaded constructor +///\brief Gets the floating-point datatype of the specified dataset +///\param dataset - IN: Dataset that this floating-point datatype +/// associates with +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType::FloatType( const DataSet& dataset ) : AtomType() +FloatType::FloatType(const DataSet& dataset) : AtomType() { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type( dataset.getId() ); + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type(dataset.getId()); - if( id < 0 ) - { - throw DataSetIException("FloatType constructor", "H5Dget_type failed"); - } + if (id < 0) + { + throw DataSetIException("FloatType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: FloatType overloaded constructor -///\brief Creates an FloatType instance by opening an HDF5 float datatype -/// given its name, provided as a C character string. -///\param dtype_name - IN: Float type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: FloatType overloaded constructor +///\brief Creates an FloatType instance by opening an HDF5 float datatype +/// given its name, provided as a C character string. +///\param dtype_name - IN: Float type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openFloatType(const char*) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openFloatType(const char*) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- FloatType::FloatType(const H5Location& loc, const char *dtype_name) : AtomType() { @@ -110,213 +110,213 @@ FloatType::FloatType(const H5Location& loc, const char *dtype_name) : AtomType() } //-------------------------------------------------------------------------- -// Function: FloatType overloaded constructor -///\brief Creates an FloatType instance by opening an HDF5 float datatype -/// given its name, provided as an \c H5std_string. -///\param dtype_name - IN: Float type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: FloatType overloaded constructor +///\brief Creates an FloatType instance by opening an HDF5 float datatype +/// given its name, provided as an \c H5std_string. +///\param dtype_name - IN: Float type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openFloatType(const H5std_string&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openFloatType(const H5std_string&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- FloatType::FloatType(const H5Location& loc, const H5std_string& dtype_name) : AtomType() { - id = p_opentype(loc, dtype_name.c_str()); + id = p_opentype(loc, dtype_name.c_str()); } //-------------------------------------------------------------------------- -// Function: FloatType::getFields -///\brief Retrieves floating point datatype bit field information. -///\param spos - OUT: Retrieved floating-point sign bit -///\param epos - OUT: Retrieved exponent bit-position -///\param esize - OUT: Retrieved size of exponent, in bits -///\param mpos - OUT: Retrieved mantissa bit-position -///\param msize - OUT: Retrieved size of mantissa, in bits -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void FloatType::getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const +// Function: FloatType::getFields +///\brief Retrieves floating point datatype bit field information. +///\param spos - OUT: Retrieved floating-point sign bit +///\param epos - OUT: Retrieved exponent bit-position +///\param esize - OUT: Retrieved size of exponent, in bits +///\param mpos - OUT: Retrieved mantissa bit-position +///\param msize - OUT: Retrieved size of mantissa, in bits +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void FloatType::getFields(size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize) const { - herr_t ret_value = H5Tget_fields( id, &spos, &epos, &esize, &mpos, &msize ); - if( ret_value < 0 ) - { - throw DataTypeIException("FloatType::getFields", "H5Tget_fields failed"); - } + herr_t ret_value = H5Tget_fields(id, &spos, &epos, &esize, &mpos, &msize); + if (ret_value < 0) + { + throw DataTypeIException("FloatType::getFields", "H5Tget_fields failed"); + } } //-------------------------------------------------------------------------- -// Function: FloatType::setFields -///\brief Sets locations and sizes of floating point bit fields. -///\param spos - OUT: Sign position, i.e., the bit offset of the -/// floating-point sign bit. -///\param epos - OUT: Exponent bit position -///\param esize - OUT: Size of exponent, in bits -///\param mpos - OUT: Mantissa bit-position -///\param msize - OUT: Size of mantissa, in bits -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void FloatType::setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const +// Function: FloatType::setFields +///\brief Sets locations and sizes of floating point bit fields. +///\param spos - OUT: Sign position, i.e., the bit offset of the +/// floating-point sign bit. +///\param epos - OUT: Exponent bit position +///\param esize - OUT: Size of exponent, in bits +///\param mpos - OUT: Mantissa bit-position +///\param msize - OUT: Size of mantissa, in bits +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void FloatType::setFields(size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize) const { - herr_t ret_value = H5Tset_fields( id, spos, epos, esize, mpos, msize ); - if( ret_value < 0 ) - { - throw DataTypeIException("FloatType::setFields", "H5Tset_fields failed"); - } + herr_t ret_value = H5Tset_fields(id, spos, epos, esize, mpos, msize); + if (ret_value < 0) + { + throw DataTypeIException("FloatType::setFields", "H5Tset_fields failed"); + } } //-------------------------------------------------------------------------- -// Function: FloatType::getEbias -///\brief Retrieves the exponent bias of a floating-point type. -///\return Exponent bias -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType::getEbias +///\brief Retrieves the exponent bias of a floating-point type. +///\return Exponent bias +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- size_t FloatType::getEbias() const { - size_t ebias = H5Tget_ebias( id ); - // Returns the bias if successful - if( ebias == 0 ) - { - throw DataTypeIException("FloatType::getEbias", "H5Tget_ebias failed - returned exponent bias as 0"); - } - return( ebias ); + size_t ebias = H5Tget_ebias(id); + // Returns the bias if successful + if (ebias == 0) + { + throw DataTypeIException("FloatType::getEbias", "H5Tget_ebias failed - returned exponent bias as 0"); + } + return(ebias); } //-------------------------------------------------------------------------- -// Function: FloatType::setEbias -///\brief Sets the exponent bias of a floating-point type. -///\param ebias - Exponent bias value -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType::setEbias +///\brief Sets the exponent bias of a floating-point type. +///\param ebias - Exponent bias value +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FloatType::setEbias( size_t ebias ) const +void FloatType::setEbias(size_t ebias) const { - herr_t ret_value = H5Tset_ebias( id, ebias ); - if( ret_value < 0 ) - { - throw DataTypeIException("FloatType::setEbias", "H5Tset_ebias failed"); - } + herr_t ret_value = H5Tset_ebias(id, ebias); + if (ret_value < 0) + { + throw DataTypeIException("FloatType::setEbias", "H5Tset_ebias failed"); + } } //-------------------------------------------------------------------------- -// Function: FloatType::getNorm -///\brief Retrieves mantissa normalization of a floating-point datatype. -///\param norm_string - OUT: Text string of the normalization type -///\return Valid normalization type, which can be: -/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored -/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 -/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized -///\exception H5::DataTypeIException +// Function: FloatType::getNorm +///\brief Retrieves mantissa normalization of a floating-point datatype. +///\param norm_string - OUT: Text string of the normalization type +///\return Valid normalization type, which can be: +/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored +/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 +/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized +///\exception H5::DataTypeIException ///\par Description -/// For your convenience, this function also provides the text -/// string of the returned normalization type, via parameter -/// \a norm_string. -// Programmer Binh-Minh Ribler - 2000 +/// For your convenience, this function also provides the text +/// string of the returned normalization type, via parameter +/// \a norm_string. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5T_norm_t FloatType::getNorm( H5std_string& norm_string ) const +H5T_norm_t FloatType::getNorm(H5std_string& norm_string) const { - H5T_norm_t norm = H5Tget_norm( id ); // C routine - // Returns a valid normalization type if successful - if( norm == H5T_NORM_ERROR ) - { - throw DataTypeIException("FloatType::getNorm", "H5Tget_norm failed - returned H5T_NORM_ERROR"); - } - if( norm == H5T_NORM_IMPLIED ) - norm_string = "H5T_NORM_IMPLIED (0)"; - else if( norm == H5T_NORM_MSBSET ) - norm_string = "H5T_NORM_MSBSET (1)"; - else if( norm == H5T_NORM_NONE ) - norm_string = "H5T_NORM_NONE (2)"; - return( norm ); + H5T_norm_t norm = H5Tget_norm(id); // C routine + // Returns a valid normalization type if successful + if (norm == H5T_NORM_ERROR) + { + throw DataTypeIException("FloatType::getNorm", "H5Tget_norm failed - returned H5T_NORM_ERROR"); + } + if (norm == H5T_NORM_IMPLIED) + norm_string = "H5T_NORM_IMPLIED (0)"; + else if (norm == H5T_NORM_MSBSET) + norm_string = "H5T_NORM_MSBSET (1)"; + else if (norm == H5T_NORM_NONE) + norm_string = "H5T_NORM_NONE (2)"; + return(norm); } //-------------------------------------------------------------------------- -// Function: FloatType::setNorm -///\brief Sets the mantissa normalization of a floating-point datatype. -///\param norm - IN: Mantissa normalization type -///\exception H5::DataTypeIException +// Function: FloatType::setNorm +///\brief Sets the mantissa normalization of a floating-point datatype. +///\param norm - IN: Mantissa normalization type +///\exception H5::DataTypeIException ///\par Description -/// Valid values for normalization type include: -/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored -/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 -/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for normalization type include: +/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored +/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 +/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FloatType::setNorm( H5T_norm_t norm ) const +void FloatType::setNorm(H5T_norm_t norm) const { - herr_t ret_value = H5Tset_norm( id, norm ); - if( ret_value < 0 ) - { - throw DataTypeIException("FloatType::setNorm", "H5Tset_norm failed"); - } + herr_t ret_value = H5Tset_norm(id, norm); + if (ret_value < 0) + { + throw DataTypeIException("FloatType::setNorm", "H5Tset_norm failed"); + } } //-------------------------------------------------------------------------- -// Function: FloatType::getInpad -///\brief Retrieves the internal padding type for unused bits in -/// this floating-point datatypes. -///\return Internal padding type, which can be: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros -/// \li \c H5T_PAD_ONE (1) - Set background to ones -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone -///\exception H5::DataTypeIException +// Function: FloatType::getInpad +///\brief Retrieves the internal padding type for unused bits in +/// this floating-point datatypes. +///\return Internal padding type, which can be: +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros +/// \li \c H5T_PAD_ONE (1) - Set background to ones +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone +///\exception H5::DataTypeIException ///\par Description -/// For your convenience, this function also provides the text -/// string of the returned internal padding type, via parameter -/// \a pad_string. -// Programmer Binh-Minh Ribler - 2000 +/// For your convenience, this function also provides the text +/// string of the returned internal padding type, via parameter +/// \a pad_string. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5T_pad_t FloatType::getInpad( H5std_string& pad_string ) const +H5T_pad_t FloatType::getInpad(H5std_string& pad_string) const { - H5T_pad_t pad_type = H5Tget_inpad( id ); - // Returns a valid padding type if successful - if( pad_type == H5T_PAD_ERROR ) - { - throw DataTypeIException("FloatType::getInpad", "H5Tget_inpad failed - returned H5T_PAD_ERROR"); - } - if( pad_type == H5T_PAD_ZERO ) - pad_string = "H5T_PAD_ZERO (0)"; - else if( pad_type == H5T_PAD_ONE ) - pad_string = "H5T_PAD_ONE (1)"; - else if( pad_type == H5T_PAD_BACKGROUND ) - pad_string = "H5T_PAD_BACKGROUD (2)"; - return( pad_type ); + H5T_pad_t pad_type = H5Tget_inpad(id); + // Returns a valid padding type if successful + if (pad_type == H5T_PAD_ERROR) + { + throw DataTypeIException("FloatType::getInpad", "H5Tget_inpad failed - returned H5T_PAD_ERROR"); + } + if (pad_type == H5T_PAD_ZERO) + pad_string = "H5T_PAD_ZERO (0)"; + else if (pad_type == H5T_PAD_ONE) + pad_string = "H5T_PAD_ONE (1)"; + else if (pad_type == H5T_PAD_BACKGROUND) + pad_string = "H5T_PAD_BACKGROUD (2)"; + return(pad_type); } //-------------------------------------------------------------------------- -// Function: FloatType::setInpad -///\brief Fills unused internal floating point bits. -///\param inpad - IN: Internal padding type -///\exception H5::DataTypeIException +// Function: FloatType::setInpad +///\brief Fills unused internal floating point bits. +///\param inpad - IN: Internal padding type +///\exception H5::DataTypeIException ///\par Description -/// If any internal bits of a floating point type are unused -/// (that is, those significant bits which are not part of the -/// sign, exponent, or mantissa), then they will be filled -/// according to the padding value provided by \a inpad. +/// If any internal bits of a floating point type are unused +/// (that is, those significant bits which are not part of the +/// sign, exponent, or mantissa), then they will be filled +/// according to the padding value provided by \a inpad. ///\par -/// Valid values for normalization type include: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros -/// \li \c H5T_PAD_ONE (1) - Set background to ones -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for normalization type include: +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros +/// \li \c H5T_PAD_ONE (1) - Set background to ones +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FloatType::setInpad( H5T_pad_t inpad ) const +void FloatType::setInpad(H5T_pad_t inpad) const { - herr_t ret_value = H5Tset_inpad( id, inpad ); - if( ret_value < 0 ) - { - throw DataTypeIException("FloatType::setInpad", "H5Tset_inpad failed"); - } + herr_t ret_value = H5Tset_inpad(id, inpad); + if (ret_value < 0) + { + throw DataTypeIException("FloatType::setInpad", "H5Tset_inpad failed"); + } } //-------------------------------------------------------------------------- -// Function: FloatType destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType::~FloatType() {} diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index 1f4b227..2c925de 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -27,54 +27,54 @@ namespace H5 { */ class H5_DLLCPP FloatType : public AtomType { public: - // Creates a floating-point type using a predefined type. - FloatType( const PredType& pred_type ); + // Creates a floating-point type using a predefined type. + FloatType(const PredType& pred_type); - // Gets the floating-point datatype of the specified dataset. - FloatType( const DataSet& dataset ); + // Gets the floating-point datatype of the specified dataset. + FloatType(const DataSet& dataset); - // Constructors that open an HDF5 float datatype, given a location. - FloatType(const H5Location& loc, const char* name); - FloatType(const H5Location& loc, const H5std_string& name); + // Constructors that open an HDF5 float datatype, given a location. + FloatType(const H5Location& loc, const char* name); + FloatType(const H5Location& loc, const H5std_string& name); - // Retrieves the exponent bias of a floating-point type. - size_t getEbias() const; + // Retrieves the exponent bias of a floating-point type. + size_t getEbias() const; - // Sets the exponent bias of a floating-point type. - void setEbias( size_t ebias ) const; + // Sets the exponent bias of a floating-point type. + void setEbias(size_t ebias) const; - // Retrieves floating point datatype bit field information. - void getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const; + // Retrieves floating point datatype bit field information. + void getFields(size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize) const; - // Sets locations and sizes of floating point bit fields. - void setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const; + // Sets locations and sizes of floating point bit fields. + void setFields(size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize) const; - // Retrieves the internal padding type for unused bits in floating-point datatypes. - H5T_pad_t getInpad( H5std_string& pad_string ) const; + // Retrieves the internal padding type for unused bits in floating-point datatypes. + H5T_pad_t getInpad(H5std_string& pad_string) const; - // Fills unused internal floating point bits. - void setInpad( H5T_pad_t inpad ) const; + // Fills unused internal floating point bits. + void setInpad(H5T_pad_t inpad) const; - // Retrieves mantissa normalization of a floating-point datatype. - H5T_norm_t getNorm( H5std_string& norm_string ) const; + // Retrieves mantissa normalization of a floating-point datatype. + H5T_norm_t getNorm(H5std_string& norm_string) const; - // Sets the mantissa normalization of a floating-point datatype. - void setNorm( H5T_norm_t norm ) const; + // Sets the mantissa normalization of a floating-point datatype. + void setNorm(H5T_norm_t norm) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("FloatType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("FloatType"); } - // Default constructor - FloatType(); + // Default constructor + FloatType(); - // Creates a floating-point datatype using an existing id. - FloatType( const hid_t existing_id ); + // Creates a floating-point datatype using an existing id. + FloatType(const hid_t existing_id); - // Copy constructor: makes a copy of the original FloatType object. - FloatType( const FloatType& original ); + // Copy constructor: makes a copy of the original FloatType object. + FloatType(const FloatType& original); - // Noop destructor. - virtual ~FloatType(); + // Noop destructor. + virtual ~FloatType(); }; } #endif // __H5FloatType_H diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index c976b00..6b143b5 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -46,17 +46,17 @@ namespace H5 { using std::endl; //-------------------------------------------------------------------------- -// Function: Group default constructor -///\brief Default constructor: creates a stub Group. -// Programmer Binh-Minh Ribler - 2000 +// Function: Group default constructor +///\brief Default constructor: creates a stub Group. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group::Group() : H5Object(), CommonFG(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: Group copy constructor -///\brief Copy constructor: makes a copy of the original Group object. -///\param original - IN: Original group to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: Group copy constructor +///\brief Copy constructor: makes a copy of the original Group object. +///\param original - IN: Original group to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group::Group(const Group& original) : H5Object(), CommonFG(), id(original.id) { @@ -64,26 +64,26 @@ Group::Group(const Group& original) : H5Object(), CommonFG(), id(original.id) } //-------------------------------------------------------------------------- -// Function: Group::getLocId +// Function: Group::getLocId // Purpose: Get the id of this group -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Description -// This function is a redefinition of CommonFG::getLocId. It -// is used by CommonFG member functions to get the file id. +// This function is a redefinition of CommonFG::getLocId. It +// is used by CommonFG member functions to get the file id. // Deprecated: // After HDFFV-9920, the Group's methods can use getId() and getLocId() // is kept for backward compatibility. Aug 18, 2016 -BMR //-------------------------------------------------------------------------- hid_t Group::getLocId() const { - return( getId() ); + return(getId()); } //-------------------------------------------------------------------------- -// Function: Group overloaded constructor -///\brief Creates a Group object using the id of an existing group. -///\param existing_id - IN: Id of an existing group -// Programmer Binh-Minh Ribler - 2000 +// Function: Group overloaded constructor +///\brief Creates a Group object using the id of an existing group. +///\param existing_id - IN: Id of an existing group +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group::Group(const hid_t existing_id) : H5Object(), CommonFG(), id(existing_id) { @@ -91,17 +91,17 @@ Group::Group(const hid_t existing_id) : H5Object(), CommonFG(), id(existing_id) } //-------------------------------------------------------------------------- -// Function: Group overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a Group object -///\param loc - IN: Specifying location referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException +// Function: Group overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 group, creates a Group object +///\param loc - IN: Specifying location referenced object is in +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException ///\par Description -/// \c obj can be DataSet, Group, or named DataType, that -/// is a datatype that has been named by DataType::commit. -// Programmer Binh-Minh Ribler - Oct, 2006 +/// \c obj can be DataSet, Group, or named DataType, that +/// is a datatype that has been named by DataType::commit. +// Programmer Binh-Minh Ribler - Oct, 2006 //-------------------------------------------------------------------------- Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), CommonFG(), id(H5I_INVALID_HID) { @@ -109,14 +109,14 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const } //-------------------------------------------------------------------------- -// Function: Group overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a Group object -///\param attr - IN: Specifying location where the referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// Function: Group overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 group, creates a Group object +///\param attr - IN: Specifying location where the referenced object is in +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 //-------------------------------------------------------------------------- /* Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) { @@ -126,19 +126,19 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const //-------------------------------------------------------------------------- // Function: Group::getId -///\brief Get the id of this group -///\return Group identifier +///\brief Get the id of this group +///\return Group identifier // Modification: // May 2008 - BMR -// Class hierarchy is revised to address bugzilla 1068. Class -// AbstractDS and Attribute are moved out of H5Object. In -// addition, member IdComponent::id is moved into subclasses, and -// IdComponent::getId now becomes pure virtual function. +// Class hierarchy is revised to address bugzilla 1068. Class +// AbstractDS and Attribute are moved out of H5Object. In +// addition, member IdComponent::id is moved into subclasses, and +// IdComponent::getId now becomes pure virtual function. // Programmer Binh-Minh Ribler - May, 2008 //-------------------------------------------------------------------------- hid_t Group::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -147,11 +147,11 @@ hid_t Group::getId() const ///\brief Sets the identifier of this object to a new value. /// ///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails +/// object fails // Description: -// The underlaying reference counting in the C library ensures -// that the current valid id of this object is properly closed. -// Then the object's id is reset to the new id. +// The underlaying reference counting in the C library ensures +// that the current valid id of this object is properly closed. +// Then the object's id is reset to the new id. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Group::p_setId(const hid_t new_id) @@ -163,24 +163,24 @@ void Group::p_setId(const hid_t new_id) catch (Exception& close_error) { throwException("Group::p_setId", close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Group::close -///\brief Closes this group. +// Function: Group::close +///\brief Closes this group. /// -///\exception H5::GroupIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::GroupIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void Group::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Gclose( id ); - if( ret_value < 0 ) + herr_t ret_value = H5Gclose(id); + if (ret_value < 0) { throwException("Group::close", "H5Gclose failed"); } @@ -190,34 +190,34 @@ void Group::close() } //-------------------------------------------------------------------------- -// Function: Group::throwException -///\brief Throws H5::GroupIException. -///\param func_name - Name of the function where failure occurs -///\param msg - Message describing the failure -///\exception H5::GroupIException +// Function: Group::throwException +///\brief Throws H5::GroupIException. +///\param func_name - Name of the function where failure occurs +///\param msg - Message describing the failure +///\exception H5::GroupIException // Description -// This function is also used in H5Location's methods so that -// proper exception can be thrown for file or group. The -// "Group::" will be inserted to indicate the function called is -// an implementation of Group. -// Programmer Binh-Minh Ribler - 2000 +// This function is also used in H5Location's methods so that +// proper exception can be thrown for file or group. The +// "Group::" will be inserted to indicate the function called is +// an implementation of Group. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Group::throwException(const H5std_string& func_name, const H5std_string& msg) const { - H5std_string full_name = func_name; - full_name.insert(0, "Group::"); - throw GroupIException(full_name, msg); + H5std_string full_name = func_name; + full_name.insert(0, "Group::"); + throw GroupIException(full_name, msg); } //-------------------------------------------------------------------------- -// Function: Group destructor -///\brief Properly terminates access to this group. -// Programmer Binh-Minh Ribler - 2000 +// Function: Group destructor +///\brief Properly terminates access to this group. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Feb 20, 2005 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Feb 20, 2005 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- Group::~Group() { diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index 0a9e975..96dc5c1 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -30,53 +30,53 @@ class VarLenType; class H5_DLLCPP Group : public H5Object, public CommonFG { public: - // Group constructor to create a group or file (aka root group). - Group(const char* name, size_t size_hint = 0); - Group(const H5std_string& name, size_t size_hint = 0); + // Group constructor to create a group or file (aka root group). + Group(const char* name, size_t size_hint = 0); + Group(const H5std_string& name, size_t size_hint = 0); - // Group constructor to open a group or file (aka root group). - Group(const char* name); - Group(const H5std_string& name); + // Group constructor to open a group or file (aka root group). + Group(const char* name); + Group(const H5std_string& name); - // Close this group. - virtual void close(); + // Close this group. + virtual void close(); - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("Group"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("Group"); } - // Throw group exception. - virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; + // Throw group exception. + virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; - // for CommonFG to get the file id. - virtual hid_t getLocId() const; + // for CommonFG to get the file id. + virtual hid_t getLocId() const; - // Creates a group by way of dereference. - Group(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + // Creates a group by way of dereference. + Group(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); // Group(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); - // default constructor - Group(); + // default constructor + Group(); - // Copy constructor: makes a copy of the original object - Group(const Group& original); + // Copy constructor: makes a copy of the original object + Group(const Group& original); - // Gets the group id. - virtual hid_t getId() const; + // Gets the group id. + virtual hid_t getId() const; - // Destructor - virtual ~Group(); + // Destructor + virtual ~Group(); - // Creates a copy of an existing group using its id. - Group( const hid_t group_id ); + // Creates a copy of an existing group using its id. + Group(const hid_t group_id); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Sets the group id. - virtual void p_setId(const hid_t new_id); + // Sets the group id. + virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 group id + hid_t id; // HDF5 group id }; } diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index f3d916a..574b28a 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -15,7 +15,7 @@ #include -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5Library.h" @@ -34,21 +34,21 @@ bool IdComponent::H5cppinit = false; bool IdComponent::H5dontAtexit_called = false; //-------------------------------------------------------------------------- -// Function: IdComponent::incRefCount -///\brief Increment reference counter for a given id. -// Programmer Binh-Minh Ribler - May 2005 +// Function: IdComponent::incRefCount +///\brief Increment reference counter for a given id. +// Programmer Binh-Minh Ribler - May 2005 //-------------------------------------------------------------------------- void IdComponent::incRefCount(const hid_t obj_id) const { if (p_valid_id(obj_id)) - if (H5Iinc_ref(obj_id) < 0) - throw IdComponentException(inMemFunc("incRefCount"), "incrementing object ref count failed"); + if (H5Iinc_ref(obj_id) < 0) + throw IdComponentException(inMemFunc("incRefCount"), "incrementing object ref count failed"); } //-------------------------------------------------------------------------- -// Function: IdComponent::incRefCount -///\brief Increment reference counter for the id of this object. -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent::incRefCount +///\brief Increment reference counter for the id of this object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void IdComponent::incRefCount() const { @@ -56,31 +56,31 @@ void IdComponent::incRefCount() const } //-------------------------------------------------------------------------- -// Function: IdComponent::decRefCount -///\brief Decrement reference counter for a given id. -// Programmer Binh-Minh Ribler - May 2005 +// Function: IdComponent::decRefCount +///\brief Decrement reference counter for a given id. +// Programmer Binh-Minh Ribler - May 2005 // Modification: -// Added the check for ref counter to give a little more info -// on why H5Idec_ref fails in some cases - BMR 5/19/2005 +// Added the check for ref counter to give a little more info +// on why H5Idec_ref fails in some cases - BMR 5/19/2005 //-------------------------------------------------------------------------- void IdComponent::decRefCount(const hid_t obj_id) const { if (p_valid_id(obj_id)) - if (H5Idec_ref(obj_id) < 0) - { - if (H5Iget_ref(obj_id) <= 0) - throw IdComponentException(inMemFunc("decRefCount"), - "object ref count is 0 or negative"); - else - throw IdComponentException(inMemFunc("decRefCount"), - "decrementing object ref count failed"); - } + if (H5Idec_ref(obj_id) < 0) + { + if (H5Iget_ref(obj_id) <= 0) + throw IdComponentException(inMemFunc("decRefCount"), + "object ref count is 0 or negative"); + else + throw IdComponentException(inMemFunc("decRefCount"), + "decrementing object ref count failed"); + } } //-------------------------------------------------------------------------- -// Function: IdComponent::decRefCount -///\brief Decrement reference counter for the id of this object. -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent::decRefCount +///\brief Decrement reference counter for the id of this object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void IdComponent::decRefCount() const { @@ -88,28 +88,28 @@ void IdComponent::decRefCount() const } //-------------------------------------------------------------------------- -// Function: IdComponent::getCounter -///\brief Returns the reference counter for a given id. -///\return Reference count -// Programmer Binh-Minh Ribler - May 2005 +// Function: IdComponent::getCounter +///\brief Returns the reference counter for a given id. +///\return Reference count +// Programmer Binh-Minh Ribler - May 2005 //-------------------------------------------------------------------------- int IdComponent::getCounter(const hid_t obj_id) const { int counter = 0; if (p_valid_id(obj_id)) { - counter = H5Iget_ref(obj_id); - if (counter < 0) - throw IdComponentException(inMemFunc("incRefCount"), "getting object ref count failed - negative"); + counter = H5Iget_ref(obj_id); + if (counter < 0) + throw IdComponentException(inMemFunc("incRefCount"), "getting object ref count failed - negative"); } return (counter); } //-------------------------------------------------------------------------- -// Function: IdComponent::getCounter -///\brief Returns the reference counter for the id of this object. -///\return Reference count -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent::getCounter +///\brief Returns the reference counter for the id of this object. +///\return Reference count +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int IdComponent::getCounter() const { @@ -117,43 +117,43 @@ int IdComponent::getCounter() const } //-------------------------------------------------------------------------- -// Function: getHDFObjType (static) -///\brief Given an id, returns the type of the object. -///\return a valid HDF object type, which may be one of the following: -/// \li \c H5I_FILE -/// \li \c H5I_GROUP -/// \li \c H5I_DATATYPE -/// \li \c H5I_DATASPACE -/// \li \c H5I_DATASET -/// \li \c H5I_ATTR -/// \li or \c H5I_BADID, if no valid type can be determined or the -/// input object id is invalid. +// Function: getHDFObjType (static) +///\brief Given an id, returns the type of the object. +///\return a valid HDF object type, which may be one of the following: +/// \li \c H5I_FILE +/// \li \c H5I_GROUP +/// \li \c H5I_DATATYPE +/// \li \c H5I_DATASPACE +/// \li \c H5I_DATASET +/// \li \c H5I_ATTR +/// \li or \c H5I_BADID, if no valid type can be determined or the +/// input object id is invalid. // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id) { if (obj_id <= 0) - return H5I_BADID; // invalid + return H5I_BADID; // invalid H5I_type_t id_type = H5Iget_type(obj_id); if (id_type <= H5I_BADID || id_type >= H5I_NTYPES) - return H5I_BADID; // invalid + return H5I_BADID; // invalid else - return id_type; // valid type + return id_type; // valid type } //-------------------------------------------------------------------------- -// Function: getHDFObjType -///\brief Returns the type of the object. It is an overloaded function -/// of the above function. -///\return a valid HDF object type, which may be one of the following: -/// \li \c H5I_FILE -/// \li \c H5I_GROUP -/// \li \c H5I_DATATYPE -/// \li \c H5I_DATASPACE -/// \li \c H5I_DATASET -/// \li \c H5I_ATTR -/// \li or \c H5I_BADID, if no valid type can be determined or the -/// input object id is invalid. +// Function: getHDFObjType +///\brief Returns the type of the object. It is an overloaded function +/// of the above function. +///\return a valid HDF object type, which may be one of the following: +/// \li \c H5I_FILE +/// \li \c H5I_GROUP +/// \li \c H5I_DATATYPE +/// \li \c H5I_DATASPACE +/// \li \c H5I_DATASET +/// \li \c H5I_ATTR +/// \li or \c H5I_BADID, if no valid type can be determined or the +/// input object id is invalid. // Programmer Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- H5I_type_t IdComponent::getHDFObjType() const @@ -162,74 +162,140 @@ H5I_type_t IdComponent::getHDFObjType() const } //-------------------------------------------------------------------------- -// Function: IdComponent::operator= -///\brief Assignment operator. -///\param rhs - IN: Reference to the existing object -///\return Reference to IdComponent instance -///\exception H5::IdComponentException when attempt to close the HDF5 -/// object fails +// Function: getNumMembers (static) +///\brief Returns the number of members of the given type. +///\return Number of members +///\Description +/// If there is no member of the given type, getNumMembers will +/// return 0. Valid types are: +/// \li \c H5I_FILE (= 1) +/// \li \c H5I_GROUP +/// \li \c H5I_DATATYPE +/// \li \c H5I_DATASPACE +/// \li \c H5I_DATASET +/// \li \c H5I_ATTR +/// \li \c H5I_REFERENCE +/// \li \c H5I_VFL +/// \li \c H5I_GENPROP_CLS +/// \li \c H5I_GENPROP_LST +/// \li \c H5I_ERROR_CLASS +/// \li \c H5I_ERROR_MSG +/// \li \c H5I_ERROR_STACK +// Programmer Binh-Minh Ribler - Feb, 2017 +//-------------------------------------------------------------------------- +hsize_t IdComponent::getNumMembers(H5I_type_t type) +{ + hsize_t nmembers = 0; + herr_t ret_value = H5Inmembers(type, &nmembers); + if (ret_value < 0) + throw IdComponentException("getNumMembers", "H5Inmembers failed"); + else + return(nmembers); +} + +//-------------------------------------------------------------------------- +// Function: typeExists (static) +///\brief Queries if a given type is currently registered with the +/// library. +///\return true if the given type exists, and false, otherwise. +///\Description +/// Valid types are: +/// \li \c H5I_FILE (= 1) +/// \li \c H5I_GROUP +/// \li \c H5I_DATATYPE +/// \li \c H5I_DATASPACE +/// \li \c H5I_DATASET +/// \li \c H5I_ATTR +/// \li \c H5I_REFERENCE +/// \li \c H5I_VFL +/// \li \c H5I_GENPROP_CLS +/// \li \c H5I_GENPROP_LST +/// \li \c H5I_ERROR_CLASS +/// \li \c H5I_ERROR_MSG +/// \li \c H5I_ERROR_STACK +// Programmer Binh-Minh Ribler - Feb, 2017 +//-------------------------------------------------------------------------- +bool IdComponent::typeExists(H5I_type_t type) +{ + // Call C function + htri_t ret_value = H5Itype_exists(type); + if (ret_value > 0) + return true; + else if (ret_value == 0) + return false; + else // Raise exception when H5Itype_exists returns a negative value + throw IdComponentException("typeExists", "H5Itype_exists failed"); +} + +//-------------------------------------------------------------------------- +// Function: IdComponent::operator= +///\brief Assignment operator. +///\param rhs - IN: Reference to the existing object +///\return Reference to IdComponent instance +///\exception H5::IdComponentException when attempt to close the HDF5 +/// object fails // Description -// First, close the current valid id of this object. Then -// copy the id from rhs to this object, and increment the -// reference counter of the id to indicate that another object -// is referencing that id. +// First, close the current valid id of this object. Then +// copy the id from rhs to this object, and increment the +// reference counter of the id to indicate that another object +// is referencing that id. // Modification -// 2010/5/9 - BMR -// Removed close() and incRefCount() because setId/p_setId takes -// care of close() and setId takes care incRefCount(). -// Programmer Binh-Minh Ribler - 2000 +// 2010/5/9 - BMR +// Removed close() and incRefCount() because setId/p_setId takes +// care of close() and setId takes care incRefCount(). +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IdComponent& IdComponent::operator=( const IdComponent& rhs ) +IdComponent& IdComponent::operator=(const IdComponent& rhs) { if (this != &rhs) { - // handling references to this id - try { - setId(rhs.getId()); - // Note: a = b, so there are two objects with the same hdf5 id - // that's why incRefCount is needed, and it is called by setId - } - catch (Exception& close_error) { - throw FileIException(inMemFunc("operator="), close_error.getDetailMsg()); - } + // handling references to this id + try { + setId(rhs.getId()); + // Note: a = b, so there are two objects with the same hdf5 id + // that's why incRefCount is needed, and it is called by setId + } + catch (Exception& close_error) { + throw FileIException(inMemFunc("operator="), close_error.getDetailMsg()); + } } return *this; } //-------------------------------------------------------------------------- -// Function: IdComponent::setId -///\brief Sets the identifier of this object to a new value. -///\param new_id - IN: New identifier to be set to -///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails +// Function: IdComponent::setId +///\brief Sets the identifier of this object to a new value. +///\param new_id - IN: New identifier to be set to +///\exception H5::IdComponentException when the attempt to close the HDF5 +/// object fails // Description: -// p_setId ensures that the current valid id of this object is -// properly closed before resetting the object's id to the new id. -// Programmer Binh-Minh Ribler - 2000 +// p_setId ensures that the current valid id of this object is +// properly closed before resetting the object's id to the new id. +// Programmer Binh-Minh Ribler - 2000 // Modification -// 2008/7/23 - BMR -// Changed all subclasses' setId to p_setId and put back setId -// here. p_setId is used in the library where the id provided -// by a C API passed on to user's application in the form of a -// C++ API object, which will be destroyed properly, and so -// p_setId does not call incRefCount. On the other hand, the -// public version setId is used by other applications, in which -// the id passed to setId is that of another C++ API object, so -// setId must call incRefCount. +// 2008/7/23 - BMR +// Changed all subclasses' setId to p_setId and put back setId +// here. p_setId is used in the library where the id provided +// by a C API passed on to user's application in the form of a +// C++ API object, which will be destroyed properly, and so +// p_setId does not call incRefCount. On the other hand, the +// public version setId is used by other applications, in which +// the id passed to setId is that of another C++ API object, so +// setId must call incRefCount. //-------------------------------------------------------------------------- void IdComponent::setId(const hid_t new_id) { - // set to new_id - p_setId(new_id); + // set to new_id + p_setId(new_id); - // increment the reference counter of the new id - incRefCount(); + // increment the reference counter of the new id + incRefCount(); } //-------------------------------------------------------------------------- -// Function: IdComponent destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IdComponent::~IdComponent() {} @@ -240,29 +306,29 @@ IdComponent::~IdComponent() {} #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: IdComponent::inMemFunc -///\brief Makes and returns string "::" -///\param func_name - Name of the function where failure occurs +// Function: IdComponent::inMemFunc +///\brief Makes and returns string "::" +///\param func_name - Name of the function where failure occurs // Description -/// Concatenates the class name of this object with the -/// passed-in function name to create a string that indicates -/// where the failure occurs. The class-name is provided by -/// fromClass(). This string will be used by a base class when -/// an exception is thrown. -// Programmer Binh-Minh Ribler - Aug 6, 2005 +/// Concatenates the class name of this object with the +/// passed-in function name to create a string that indicates +/// where the failure occurs. The class-name is provided by +/// fromClass(). This string will be used by a base class when +/// an exception is thrown. +// Programmer Binh-Minh Ribler - Aug 6, 2005 //-------------------------------------------------------------------------- H5std_string IdComponent::inMemFunc(const char* func_name) const { - H5std_string full_name = func_name; - full_name.insert(0, "::"); - full_name.insert(0, fromClass()); - return (full_name); + H5std_string full_name = func_name; + full_name.insert(0, "::"); + full_name.insert(0, fromClass()); + return (full_name); } //-------------------------------------------------------------------------- -// Function: IdComponent default constructor - private -///\brief Default constructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent default constructor - private +///\brief Default constructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IdComponent::IdComponent() { @@ -276,45 +342,45 @@ IdComponent::IdComponent() } //-------------------------------------------------------------------------- -// Function: IdComponent::p_get_file_name (protected) -// Purpose: Gets the name of the file, in which this object belongs. -// Exception: H5::IdComponentException +// Function: IdComponent::p_get_file_name (protected) +// Purpose Gets the name of the file, in which this object belongs. +// Exception: H5::IdComponentException // Description: -// This function is protected so that the user applications can -// only have access to its code via allowable classes, namely, -// Attribute and H5Location subclasses. -// Programmer Binh-Minh Ribler - Jul, 2004 +// This function is protected so that the user applications can +// only have access to its code via allowable classes, namely, +// Attribute and H5Location subclasses. +// Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- H5std_string IdComponent::p_get_file_name() const { - hid_t temp_id = getId(); + hid_t temp_id = getId(); - // Preliminary call to H5Fget_name to get the length of the file name - ssize_t name_size = H5Fget_name(temp_id, NULL, 0); + // Preliminary call to H5Fget_name to get the length of the file name + ssize_t name_size = H5Fget_name(temp_id, NULL, 0); - // If H5Aget_name returns a negative value, raise an exception, - if( name_size < 0 ) - { - throw IdComponentException("", "H5Fget_name failed"); - } + // If H5Aget_name returns a negative value, raise an exception, + if (name_size < 0) + { + throw IdComponentException("", "H5Fget_name failed"); + } - // Call H5Fget_name again to get the actual file name - char* name_C = new char[name_size+1]; // temporary C-string for C API - HDmemset(name_C, 0, name_size+1); // clear buffer + // Call H5Fget_name again to get the actual file name + char* name_C = new char[name_size+1]; // temporary C-string for C API + HDmemset(name_C, 0, name_size+1); // clear buffer - name_size = H5Fget_name(temp_id, name_C, name_size+1); + name_size = H5Fget_name(temp_id, name_C, name_size+1); - // Check for failure again - if( name_size < 0 ) - { + // Check for failure again + if (name_size < 0) + { delete []name_C; - throw IdComponentException("", "H5Fget_name failed"); - } + throw IdComponentException("", "H5Fget_name failed"); + } - // Convert the C file name and return - H5std_string file_name(name_C); - delete []name_C; - return(file_name); + // Convert the C file name and return + H5std_string file_name(name_C); + delete []name_C; + return(file_name); } // @@ -322,22 +388,22 @@ H5std_string IdComponent::p_get_file_name() const // //-------------------------------------------------------------------------- -// Function: p_valid_id -// Purpose: Verifies that the given id is a valid id so it can be passed -// into an H5I C function. -// Return true if id is valid, false, otherwise -// Programmer Binh-Minh Ribler - May, 2005 +// Function: p_valid_id +// Purpose Verifies that the given id is a valid id so it can be passed +// into an H5I C function. +// Return true if id is valid, false, otherwise +// Programmer Binh-Minh Ribler - May, 2005 //-------------------------------------------------------------------------- bool IdComponent::p_valid_id(const hid_t obj_id) { if (obj_id <= 0) - return false; + return false; H5I_type_t id_type = H5Iget_type(obj_id); if (id_type <= H5I_BADID || id_type >= H5I_NTYPES) - return false; + return false; else - return true; + return true; } // Notes about IdComponent::id diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index d3d9b9f..6f57364 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -30,86 +30,92 @@ class DataSpace; class H5_DLLCPP IdComponent { public: - // Increment reference counter. - void incRefCount(const hid_t obj_id) const; - void incRefCount() const; + // Increment reference counter. + void incRefCount(const hid_t obj_id) const; + void incRefCount() const; - // Decrement reference counter. - void decRefCount(const hid_t obj_id) const; - void decRefCount() const; + // Decrement reference counter. + void decRefCount(const hid_t obj_id) const; + void decRefCount() const; - // Get the reference counter to this identifier. - int getCounter(const hid_t obj_id) const; - int getCounter() const; + // Get the reference counter to this identifier. + int getCounter(const hid_t obj_id) const; + int getCounter() const; - // Returns an HDF5 object type, given the object id. - static H5I_type_t getHDFObjType(const hid_t obj_id); + // Returns an HDF5 object type, given the object id. + static H5I_type_t getHDFObjType(const hid_t obj_id); - // Returns an HDF5 object type of this object. - H5I_type_t getHDFObjType() const; + // Returns an HDF5 object type of this object. + H5I_type_t getHDFObjType() const; - // Assignment operator. - IdComponent& operator=( const IdComponent& rhs ); + // Returns the number of members in a type. + static hsize_t getNumMembers(H5I_type_t type); - // Sets the identifier of this object to a new value. - void setId(const hid_t new_id); + // Determines if an type exists. + static bool typeExists(H5I_type_t type); - // *** Deprecation warning *** - // The following two constructors are no longer appropriate after the - // data member "id" had been moved to the sub-classes. - // The copy constructor is a noop and is removed in 1.8.15 and the - // other will be removed from 1.10 release, and then from 1.8 if its - // removal does not raise any problems in two 1.10 releases. + // Assignment operator. + IdComponent& operator=(const IdComponent& rhs); - // Creates an object to hold an HDF5 identifier. - IdComponent( const hid_t h5_id ); + // Sets the identifier of this object to a new value. + void setId(const hid_t new_id); + + // *** Deprecation warning *** + // The following two constructors are no longer appropriate after the + // data member "id" had been moved to the sub-classes. + // The copy constructor is a noop and is removed in 1.8.15 and the + // other will be removed from 1.10 release, and then from 1.8 if its + // removal does not raise any problems in two 1.10 releases. + + // Creates an object to hold an HDF5 identifier. + // IdComponent(const hid_t h5_id); - removed from 1.10.1 #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Copy constructor: makes copy of the original IdComponent object. - // IdComponent( const IdComponent& original ); - removed from 1.8.15 + // Copy constructor: makes copy of the original IdComponent object. + // IdComponent(const IdComponent& original); - removed from 1.8.15 - // Gets the identifier of this object. - virtual hid_t getId () const = 0; + // Gets the identifier of this object. + virtual hid_t getId () const = 0; - // Pure virtual function for there are various H5*close for the - // subclasses. - virtual void close() = 0; + // Pure virtual function for there are various H5*close for the + // subclasses. + virtual void close() = 0; - // Makes and returns the string "::"; - // is returned by fromClass(). - H5std_string inMemFunc(const char* func_name) const; + // Makes and returns the string "::"; + // is returned by fromClass(). + H5std_string inMemFunc(const char* func_name) const; - ///\brief Returns this class name. - virtual H5std_string fromClass() const { return("IdComponent");} + ///\brief Returns this class name. + virtual H5std_string fromClass() const { return("IdComponent");} #endif // DOXYGEN_SHOULD_SKIP_THIS - // Destructor - virtual ~IdComponent(); + // Destructor + virtual ~IdComponent(); #ifndef DOXYGEN_SHOULD_SKIP_THIS protected: - // Default constructor. - IdComponent(); + // Default constructor. + IdComponent(); - // Gets the name of the file, in which an HDF5 object belongs. - H5std_string p_get_file_name() const; + // Gets the name of the file, in which an HDF5 object belongs. + H5std_string p_get_file_name() const; - // Verifies that the given id is valid. - static bool p_valid_id(const hid_t obj_id); + // Verifies that the given id is valid. + static bool p_valid_id(const hid_t obj_id); - // Sets the identifier of this object to a new value. - this one - // doesn't increment reference count - virtual void p_setId(const hid_t new_id) = 0; + // Sets the identifier of this object to a new value. - this one + // doesn't increment reference count + virtual void p_setId(const hid_t new_id) = 0; - // This flag is used to decide whether H5dont_atexit should be called - static bool H5dontAtexit_called; + // This flag is used to decide whether H5dont_atexit should be called + static bool H5dontAtexit_called; private: - // This flag indicates whether H5Library::initH5cpp has been called - // to register various terminating functions with atexit() + // This flag indicates whether H5Library::initH5cpp has been called + // to register various terminating functions with atexit() static bool H5cppinit; #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Include.h b/c++/src/H5Include.h index 1e0e952..ba82d78 100644 --- a/c++/src/H5Include.h +++ b/c++/src/H5Include.h @@ -33,10 +33,10 @@ const bool true = 1; // so re-define them here for now. /* Initial version of the object header format */ -#define H5O_VERSION_1 1 +#define H5O_VERSION_1 1 /* Revised version - leaves out reserved bytes and alignment padding, and adds * magic number as prefix and checksum as suffix for all chunks. */ -#define H5O_VERSION_2 2 +#define H5O_VERSION_2 2 diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 38e2a7d..c64dae9 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -36,72 +36,72 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: IntType default constructor -///\brief Default constructor: Creates a stub integer datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType default constructor +///\brief Default constructor: Creates a stub integer datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::IntType() {} //-------------------------------------------------------------------------- -// Function: IntType copy constructor -///\brief Copy constructor: makes a copy of the original IntType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType copy constructor +///\brief Copy constructor: makes a copy of the original IntType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType::IntType( const IntType& original ) : AtomType( original ) {} +IntType::IntType(const IntType& original) : AtomType( original ) {} //-------------------------------------------------------------------------- -// Function: IntType overloaded constructor -///\brief Creates a integer type using a predefined type -///\param pred_type - IN: Predefined datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType overloaded constructor +///\brief Creates a integer type using a predefined type +///\param pred_type - IN: Predefined datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType::IntType( const PredType& pred_type ) : AtomType() +IntType::IntType(const PredType& pred_type) : AtomType() { - // use DataType::copy to make a copy of this predefined type - copy( pred_type ); + // use DataType::copy to make a copy of this predefined type + copy(pred_type); } //-------------------------------------------------------------------------- -// Function: IntType overloaded constructor -///\brief Creates an integer datatype using the id of an existing -/// datatype. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType overloaded constructor +///\brief Creates an integer datatype using the id of an existing +/// datatype. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType::IntType( const hid_t existing_id ) : AtomType( existing_id ) {} +IntType::IntType(const hid_t existing_id) : AtomType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: IntType overloaded constructor -///\brief Gets the integer datatype of the specified dataset. -///\param dataset - IN: Dataset that this integer datatype associates with -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType overloaded constructor +///\brief Gets the integer datatype of the specified dataset. +///\param dataset - IN: Dataset that this integer datatype associates with +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType::IntType( const DataSet& dataset ) : AtomType() +IntType::IntType(const DataSet& dataset) : AtomType() { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type( dataset.getId() ); - - if( id < 0 ) - { - throw DataSetIException("IntType constructor", "H5Dget_type failed"); - } + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type(dataset.getId()); + + if (id < 0) + { + throw DataSetIException("IntType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: IntType overloaded constructor -///\brief Creates a IntType instance by opening an HDF5 integer datatype -/// given its name as a char*. -///\param dtype_name - IN: Integer type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: IntType overloaded constructor +///\brief Creates a IntType instance by opening an HDF5 integer datatype +/// given its name as a char*. +///\param dtype_name - IN: Integer type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openIntType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openIntType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- IntType::IntType(const H5Location& loc, const char *dtype_name) : AtomType() { @@ -109,17 +109,17 @@ IntType::IntType(const H5Location& loc, const char *dtype_name) : AtomType() } //-------------------------------------------------------------------------- -// Function: IntType overloaded constructor -///\brief Creates a IntType instance by opening an HDF5 integer datatype -/// given its name, provided as an \c H5std_string. -///\param dtype_name - IN: Integer type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: IntType overloaded constructor +///\brief Creates a IntType instance by opening an HDF5 integer datatype +/// given its name, provided as an \c H5std_string. +///\param dtype_name - IN: Integer type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openArrayType(const H5std_string&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openArrayType(const H5std_string&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- IntType::IntType(const H5Location& loc, const H5std_string& dtype_name) : AtomType() { @@ -127,46 +127,46 @@ IntType::IntType(const H5Location& loc, const H5std_string& dtype_name) : AtomTy } //-------------------------------------------------------------------------- -// Function: IntType::getSign -///\brief Retrieves the sign type for an integer type. -///\return Valid sign type -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType::getSign +///\brief Retrieves the sign type for an integer type. +///\return Valid sign type +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_sign_t IntType::getSign() const { - H5T_sign_t type_sign = H5Tget_sign( id ); // C routine - - // Returns a valid sign type if no errors - if( type_sign == H5T_SGN_ERROR ) - { - throw DataTypeIException("IntType::getSign", - "H5Tget_sign failed - returned H5T_SGN_ERROR for the sign type"); - } - return( type_sign ); + H5T_sign_t type_sign = H5Tget_sign(id); // C routine + + // Returns a valid sign type if no errors + if (type_sign == H5T_SGN_ERROR) + { + throw DataTypeIException("IntType::getSign", + "H5Tget_sign failed - returned H5T_SGN_ERROR for the sign type"); + } + return(type_sign); } //-------------------------------------------------------------------------- -// Function: IntType::getSign -///\brief Sets the sign property for an integer type. -///\param sign - IN: Sign type -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType::getSign +///\brief Sets the sign property for an integer type. +///\param sign - IN: Sign type +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void IntType::setSign( H5T_sign_t sign ) const +void IntType::setSign(H5T_sign_t sign) const { - // Call C routine to set the sign property - herr_t ret_value = H5Tset_sign( id, sign ); - if( ret_value < 0 ) - { - throw DataTypeIException("IntType::setSign", "H5Tset_sign failed"); - } + // Call C routine to set the sign property + herr_t ret_value = H5Tset_sign(id, sign); + if (ret_value < 0) + { + throw DataTypeIException("IntType::setSign", "H5Tset_sign failed"); + } } //-------------------------------------------------------------------------- -// Function: IntType destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::~IntType() {} diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index 74786b9..ae4b3df 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -27,36 +27,36 @@ namespace H5 { */ class H5_DLLCPP IntType : public AtomType { public: - // Creates an integer type using a predefined type - IntType(const PredType& pred_type); + // Creates an integer type using a predefined type + IntType(const PredType& pred_type); - // Gets the integer datatype of the specified dataset - IntType(const DataSet& dataset); + // Gets the integer datatype of the specified dataset + IntType(const DataSet& dataset); - // Constructors that open an HDF5 integer datatype, given a location. - IntType(const H5Location& loc, const char* name); - IntType(const H5Location& loc, const H5std_string& name); + // Constructors that open an HDF5 integer datatype, given a location. + IntType(const H5Location& loc, const char* name); + IntType(const H5Location& loc, const H5std_string& name); - // Retrieves the sign type for an integer type - H5T_sign_t getSign() const; + // Retrieves the sign type for an integer type + H5T_sign_t getSign() const; - // Sets the sign proprety for an integer type. - void setSign( H5T_sign_t sign ) const; + // Sets the sign proprety for an integer type. + void setSign(H5T_sign_t sign) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("IntType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("IntType"); } - // Default constructor - IntType(); + // Default constructor + IntType(); - // Creates a integer datatype using an existing id - IntType(const hid_t existing_id); + // Creates a integer datatype using an existing id + IntType(const hid_t existing_id); - // Copy constructor: makes copy of IntType object - IntType(const IntType& original); + // Copy constructor: makes copy of IntType object + IntType(const IntType& original); - // Noop destructor. - virtual ~IntType(); + // Noop destructor. + virtual ~IntType(); }; } #endif // __H5IntType_H diff --git a/c++/src/H5LaccProp.cpp b/c++/src/H5LaccProp.cpp index e225b36..e9adb12 100644 --- a/c++/src/H5LaccProp.cpp +++ b/c++/src/H5LaccProp.cpp @@ -47,7 +47,7 @@ LinkAccPropList* LinkAccPropList::getConstant() // Tell the C library not to clean up, H5Library::termH5cpp will call // H5close - more dependency if use H5Library::dontAtExit() if (!IdComponent::H5dontAtexit_called) - { + { (void) H5dont_atexit(); IdComponent::H5dontAtexit_called = true; } @@ -75,39 +75,39 @@ void LinkAccPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose: Constant for default property +// Purpose: Constant for default property //-------------------------------------------------------------------------- const LinkAccPropList& LinkAccPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Default Constructor -///\brief Creates a file access property list -// Programmer: Binh-Minh Ribler - 2000 +// Function: Default Constructor +///\brief Creates a file access property list +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -LinkAccPropList::LinkAccPropList() : PropList( H5P_LINK_ACCESS ) {} +LinkAccPropList::LinkAccPropList() : PropList(H5P_LINK_ACCESS) {} //-------------------------------------------------------------------------- -// Function: LinkAccPropList copy constructor -///\brief Copy Constructor: makes a copy of the original -///\param original - IN: LinkAccPropList instance to copy -// Programmer: Binh-Minh Ribler - 2000 +// Function: LinkAccPropList copy constructor +///\brief Copy Constructor: makes a copy of the original +///\param original - IN: LinkAccPropList instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- LinkAccPropList::LinkAccPropList(const LinkAccPropList& original) : PropList(original) {} //-------------------------------------------------------------------------- -// Function: LinkAccPropList overloaded constructor -///\brief Creates a file access property list using the id of an -/// existing one. -// Programmer: Binh-Minh Ribler - 2000 +// Function: LinkAccPropList overloaded constructor +///\brief Creates a file access property list using the id of an +/// existing one. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- LinkAccPropList::LinkAccPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: LinkAccPropList destructor -///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Function: LinkAccPropList destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- LinkAccPropList::~LinkAccPropList() {} diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h index 2a84ffb..8bcdd64 100644 --- a/c++/src/H5LaccProp.h +++ b/c++/src/H5LaccProp.h @@ -30,24 +30,24 @@ namespace H5 { */ class H5_DLLCPP LinkAccPropList : public PropList { public: - ///\brief Default file access property list. - static const LinkAccPropList& DEFAULT; + ///\brief Default file access property list. + static const LinkAccPropList& DEFAULT; - // Creates a file access property list. - LinkAccPropList(); + // Creates a file access property list. + LinkAccPropList(); - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("LinkAccPropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("LinkAccPropList"); } - // Copy constructor: creates a copy of a LinkAccPropList object. - LinkAccPropList( const LinkAccPropList& original ); + // Copy constructor: creates a copy of a LinkAccPropList object. + LinkAccPropList(const LinkAccPropList& original); - // Creates a copy of an existing file access property list - // using the property list id. - LinkAccPropList (const hid_t plist_id); + // Creates a copy of an existing file access property list + // using the property list id. + LinkAccPropList (const hid_t plist_id); - // Noop destructor - virtual ~LinkAccPropList(); + // Noop destructor + virtual ~LinkAccPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 0ee6b4d..dc453b7 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -38,46 +38,46 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: H5Library::open (static) -///\brief Initializes the HDF5 library. +// Function: H5Library::open (static) +///\brief Initializes the HDF5 library. /// -///\exception H5::LibraryIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::LibraryIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::open() { - herr_t ret_value = H5open(); - if( ret_value < 0 ) - { - throw LibraryIException("H5Library::open", "H5open failed"); - } + herr_t ret_value = H5open(); + if (ret_value < 0) + { + throw LibraryIException("H5Library::open", "H5open failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Library::close (static) -///\brief Flushes all data to disk, closes files, and cleans up memory. +// Function: H5Library::close (static) +///\brief Flushes all data to disk, closes files, and cleans up memory. /// -///\exception H5::LibraryIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::LibraryIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::close() { - herr_t ret_value = H5close(); - if( ret_value < 0 ) - { - throw LibraryIException("H5Library::close", "H5close failed"); - } + herr_t ret_value = H5close(); + if (ret_value < 0) + { + throw LibraryIException("H5Library::close", "H5close failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Library::dontAtExit (static) -///\brief Instructs library not to install the C \c atexit cleanup routine +// Function: H5Library::dontAtExit (static) +///\brief Instructs library not to install the C \c atexit cleanup routine /// -///\exception H5::LibraryIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::LibraryIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Removed the check for failure returned from H5dont_atexit. -// will be fixed to not fail (HDFFV-9540) +// Removed the check for failure returned from H5dont_atexit. +// will be fixed to not fail (HDFFV-9540) //-------------------------------------------------------------------------- void H5Library::dontAtExit() { @@ -85,80 +85,80 @@ void H5Library::dontAtExit() } //-------------------------------------------------------------------------- -// Function: H5Library::getLibVersion (static) -///\brief Returns the HDF library release number. -///\param majnum - OUT: Major version of the library -///\param minnum - OUT: Minor version of the library -///\param relnum - OUT: Release number of the library -///\exception H5::LibraryIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Library::getLibVersion (static) +///\brief Returns the HDF library release number. +///\param majnum - OUT: Major version of the library +///\param minnum - OUT: Minor version of the library +///\param relnum - OUT: Release number of the library +///\exception H5::LibraryIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum ) +void H5Library::getLibVersion(unsigned& majnum, unsigned& minnum, unsigned& relnum) { - herr_t ret_value = H5get_libversion( &majnum, &minnum, &relnum ); - if( ret_value < 0 ) - { - throw LibraryIException("H5Library::getLibVersion", "H5get_libversion failed"); - } + herr_t ret_value = H5get_libversion(&majnum, &minnum, &relnum); + if (ret_value < 0) + { + throw LibraryIException("H5Library::getLibVersion", "H5get_libversion failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Library::checkVersion (static) -///\brief Verifies that the arguments match the version numbers -/// compiled into the library -///\param majnum - IN: Major version of the library -///\param minnum - IN: Minor version of the library -///\param relnum - IN: Release number of the library -///\exception H5::LibraryIException +// Function: H5Library::checkVersion (static) +///\brief Verifies that the arguments match the version numbers +/// compiled into the library +///\param majnum - IN: Major version of the library +///\param minnum - IN: Minor version of the library +///\param relnum - IN: Release number of the library +///\exception H5::LibraryIException ///\par Description -/// For information about library version, please refer to -/// the C layer Reference Manual at: +/// For information about library version, please refer to +/// the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-VersCheck -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum) { - herr_t ret_value = H5check_version(majnum, minnum, relnum); - if( ret_value < 0 ) - { - throw LibraryIException("H5Library::checkVersion", "H5check_version failed"); - } + herr_t ret_value = H5check_version(majnum, minnum, relnum); + if (ret_value < 0) + { + throw LibraryIException("H5Library::checkVersion", "H5check_version failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Library::garbageCollect (static) -///\brief Walks through all the garbage collection routines for the -/// library, which are supposed to free any unused memory they -/// have allocated. +// Function: H5Library::garbageCollect (static) +///\brief Walks through all the garbage collection routines for the +/// library, which are supposed to free any unused memory they +/// have allocated. /// -///\exception H5::LibraryIException +///\exception H5::LibraryIException ///\par Description -/// It is not required that H5Library::garbageCollect be called -/// at any particular time; it is only necessary in certain -/// situations, such as when the application has performed actions -/// that cause the library to allocate many objects. The -/// application should call H5Library::garbageCollect if it -/// eventually releases those objects and wants to reduce the -/// memory used by the library from the peak usage required. +/// It is not required that H5Library::garbageCollect be called +/// at any particular time; it is only necessary in certain +/// situations, such as when the application has performed actions +/// that cause the library to allocate many objects. The +/// application should call H5Library::garbageCollect if it +/// eventually releases those objects and wants to reduce the +/// memory used by the library from the peak usage required. ///\par -/// The library automatically garbage collects all the free -/// lists when the application ends. -// Programmer Binh-Minh Ribler - May, 2004 +/// The library automatically garbage collects all the free +/// lists when the application ends. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Library::garbageCollect() { - herr_t ret_value = H5garbage_collect(); - if( ret_value < 0 ) - { - throw LibraryIException("H5Library::garbageCollect", "H5garbage_collect failed"); - } + herr_t ret_value = H5garbage_collect(); + if (ret_value < 0) + { + throw LibraryIException("H5Library::garbageCollect", "H5garbage_collect failed"); + } } //-------------------------------------------------------------------------- // Function: H5Library::initH5cpp (static) ///\brief Initializes C++ library and registers terminating functions at -/// exit. Only for the library functions, not for user-defined -/// functions. +/// exit. Only for the library functions, not for user-defined +/// functions. // Description // initH5cpp registers the following functions with std::atexit(): // termH5cpp() - calls H5close() after all cleanup in @@ -231,45 +231,45 @@ void H5Library::termH5cpp() } //-------------------------------------------------------------------------- -// Function: H5Library::setFreeListLimits (static) -///\brief Sets limits on the different kinds of free lists. -///\param reg_global_lim - IN: Limit on all "regular" free list memory used -///\param reg_list_lim - IN: Limit on memory used in each "regular" free list -///\param arr_global_lim - IN: Limit on all "array" free list memory used -///\param arr_list_lim - IN: Limit on memory used in each "array" free list -///\param blk_global_lim - IN: Limit on all "block" free list memory used -///\param blk_list_lim - IN: Limit on memory used in each "block" free list -///\exception H5::LibraryIException +// Function: H5Library::setFreeListLimits (static) +///\brief Sets limits on the different kinds of free lists. +///\param reg_global_lim - IN: Limit on all "regular" free list memory used +///\param reg_list_lim - IN: Limit on memory used in each "regular" free list +///\param arr_global_lim - IN: Limit on all "array" free list memory used +///\param arr_list_lim - IN: Limit on memory used in each "array" free list +///\param blk_global_lim - IN: Limit on all "block" free list memory used +///\param blk_list_lim - IN: Limit on memory used in each "block" free list +///\exception H5::LibraryIException ///\par Description -/// Setting a value of -1 for a limit means no limit of that type. -/// For more information on free list limits, please refer to C -/// layer Reference Manual at: +/// Setting a value of -1 for a limit means no limit of that type. +/// For more information on free list limits, please refer to C +/// layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-SetFreeListLimits -// Programmer Binh-Minh Ribler - May, 2004 +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, - int arr_global_lim, int arr_list_lim, int blk_global_lim, - int blk_list_lim) + int arr_global_lim, int arr_list_lim, int blk_global_lim, + int blk_list_lim) { - herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim); - if( ret_value < 0 ) - { - throw LibraryIException("H5Library::setFreeListLimits", "H5set_free_list_limits failed"); - } + herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim); + if (ret_value < 0) + { + throw LibraryIException("H5Library::setFreeListLimits", "H5set_free_list_limits failed"); + } } #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Library default constructor - private -///\brief Default constructor: Creates a stub H5Library object -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Library default constructor - private +///\brief Default constructor: Creates a stub H5Library object +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Library::H5Library(){} //-------------------------------------------------------------------------- -// Function: H5Library destructor -///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Library destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Library::~H5Library(){} #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 694b052..018ba38 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -27,32 +27,32 @@ namespace H5 { */ class H5_DLLCPP H5Library { public: - // Initializes the HDF5 library. - static void open(); + // Initializes the HDF5 library. + static void open(); - // Flushes all data to disk, closes files, and cleans up memory. - static void close(); + // Flushes all data to disk, closes files, and cleans up memory. + static void close(); - // Instructs library not to install atexit cleanup routine - static void dontAtExit(); + // Instructs library not to install atexit cleanup routine + static void dontAtExit(); - // Returns the HDF library release number. - static void getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum ); + // Returns the HDF library release number. + static void getLibVersion(unsigned& majnum, unsigned& minnum, unsigned& relnum); - // Verifies that the arguments match the version numbers compiled - // into the library - static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum ); + // Verifies that the arguments match the version numbers compiled + // into the library + static void checkVersion(unsigned majnum, unsigned minnum, unsigned relnum); - // Walks through all the garbage collection routines for the library, - // which are supposed to free any unused memory they have allocated. - static void garbageCollect(); + // Walks through all the garbage collection routines for the library, + // which are supposed to free any unused memory they have allocated. + static void garbageCollect(); - // Sets limits on the different kinds of free lists. - static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int - arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); + // Sets limits on the different kinds of free lists. + static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int + arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); // Initializes C++ library and registers terminating functions at exit. - // Only for the library functions, not for user-defined functions. + // Only for the library functions, not for user-defined functions. static void initH5cpp(void); // Sends request for terminating the HDF5 library. diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index a3e6738..5a0bb73 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -15,7 +15,7 @@ #include -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -40,17 +40,17 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location default constructor (protected) -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location default constructor (protected) +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Location::H5Location() : IdComponent() {} //-------------------------------------------------------------------------- -// Function: H5Location overloaded constructor (protected) -// Purpose Creates an H5Location object using the id of an existing HDF5 -// object. -// Parameters object_id - IN: Id of an existing HDF5 object -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location overloaded constructor (protected) +// Purpose Creates an H5Location object using the id of an existing HDF5 +// object. +// Parameters object_id - IN: Id of an existing HDF5 object +// Programmer Binh-Minh Ribler - 2000 // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had @@ -62,11 +62,11 @@ H5Location::H5Location() : IdComponent() {} // H5Location::H5Location(const hid_t object_id) : IdComponent() {} //-------------------------------------------------------------------------- -// Function: H5Location copy constructor -// Purpose: This noop copy constructor is removed as a result of the data -// member "id" being moved down to sub-classes. (Mar 2015) -///\param original - IN: H5Location instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location copy constructor +// Purpose This noop copy constructor is removed as a result of the data +// member "id" being moved down to sub-classes. (Mar 2015) +///\param original - IN: H5Location instance to copy +// Programmer Binh-Minh Ribler - 2000 // // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had @@ -78,34 +78,34 @@ H5Location::H5Location() : IdComponent() {} #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::exists -///\brief Checks if a link of a given name exists in a location -///\param name - IN: Searched name -///\param lapl - IN: Link access property list -///\exception H5::LocationException -// Programmer Binh-Minh Ribler - Nov, 2016 +// Function: H5Location::exists +///\brief Checks if a link of a given name exists in a location +///\param name - IN: Searched name +///\param lapl - IN: Link access property list +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Nov, 2016 // Modification //-------------------------------------------------------------------------- bool H5Location::exists(const char* name, const LinkAccPropList& lapl) const { htri_t ret_value = H5Lexists(getId(), name, lapl.getId()); if (ret_value > 0) - return true; + return true; else if (ret_value == 0) - return false; + return false; else // Raise exception when H5Lexists returns a negative value { - throwException("exists", "H5Lexists failed"); + throwException("exists", "H5Lexists failed"); } } //-------------------------------------------------------------------------- -// Function: H5Location::exists -///\brief Checks if a link of a given name exists in a location -///\param name - IN: Searched name -///\param lapl - IN: Link access property list -///\exception H5::LocationException -// Programmer Binh-Minh Ribler - Dec, 2016 +// Function: H5Location::exists +///\brief Checks if a link of a given name exists in a location +///\param name - IN: Searched name +///\param lapl - IN: Link access property list +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Dec, 2016 // Modification //-------------------------------------------------------------------------- bool H5Location::exists(const H5std_string& name, const LinkAccPropList& lapl) const @@ -114,156 +114,156 @@ bool H5Location::exists(const H5std_string& name, const LinkAccPropList& lapl) c } //-------------------------------------------------------------------------- -// Function: H5Location::flush -///\brief Flushes all buffers associated with a location to disk. -///\param scope - IN: Specifies the scope of the flushing action, -/// which can be either of these values: -/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file -/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file -///\exception H5::Exception +// Function: H5Location::flush +///\brief Flushes all buffers associated with a location to disk. +///\param scope - IN: Specifies the scope of the flushing action, +/// which can be either of these values: +/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file +/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file +///\exception H5::Exception ///\par Description -/// This location is used to identify the file to be flushed. -// Programmer Binh-Minh Ribler - 2012 +/// This location is used to identify the file to be flushed. +// Programmer Binh-Minh Ribler - 2012 // Modification -// Sep 2012 - BMR -// Moved from H5File/H5Object +// Sep 2012 - BMR +// Moved from H5File/H5Object //-------------------------------------------------------------------------- void H5Location::flush(H5F_scope_t scope) const { - herr_t ret_value = H5Fflush(getId(), scope); - if( ret_value < 0 ) - { - throw LocationException(inMemFunc("flush"), "H5Fflush failed"); - } + herr_t ret_value = H5Fflush(getId(), scope); + if (ret_value < 0) + { + throw LocationException(inMemFunc("flush"), "H5Fflush failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Location::getFileName -///\brief Gets the name of the file, in which this HDF5 object belongs. -///\return File name -///\exception H5::LocationException -// Programmer Binh-Minh Ribler - Jul, 2004 +// Function: H5Location::getFileName +///\brief Gets the name of the file, in which this HDF5 object belongs. +///\return File name +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- H5std_string H5Location::getFileName() const { - try { + try { return(p_get_file_name()); - } - catch (LocationException& E) { - throw FileIException(inMemFunc("getFileName"), E.getDetailMsg()); - } -} - -//-------------------------------------------------------------------------- -// Function: H5Location::setComment -///\brief Sets or resets the comment for an object specified by its name. -///\param name - IN: Name of the object -///\param comment - IN: New comment -///\exception H5::LocationException -///\par Description -/// If \a comment is an empty string or a null pointer, the comment -/// message is removed from the object. -/// Comments should be relatively short, null-terminated, ASCII -/// strings. They can be attached to any object that has an -/// object header, e.g., data sets, groups, named data types, -/// and data spaces, but not symbolic links. -// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) + } + catch (LocationException& E) { + throw FileIException(inMemFunc("getFileName"), E.getDetailMsg()); + } +} + +//-------------------------------------------------------------------------- +// Function: H5Location::setComment +///\brief Sets or resets the comment for an object specified by its name. +///\param name - IN: Name of the object +///\param comment - IN: New comment +///\exception H5::LocationException +///\par Description +/// If \a comment is an empty string or a null pointer, the comment +/// message is removed from the object. +/// Comments should be relatively short, null-terminated, ASCII +/// strings. They can be attached to any object that has an +/// object header, e.g., data sets, groups, named data types, +/// and data spaces, but not symbolic links. +// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) // Modification -// 2007: QAK modified to use H5O APIs; however the first parameter is -// no longer just file or group, this function should be moved -// to another class to accommodate attribute, dataset, and named -// datatype. - BMR +// 2007: QAK modified to use H5O APIs; however the first parameter is +// no longer just file or group, this function should be moved +// to another class to accommodate attribute, dataset, and named +// datatype. - BMR //-------------------------------------------------------------------------- void H5Location::setComment(const char* name, const char* comment) const { - herr_t ret_value = H5Oset_comment_by_name(getId(), name, comment, H5P_DEFAULT); - if( ret_value < 0 ) - throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed"); + herr_t ret_value = H5Oset_comment_by_name(getId(), name, comment, H5P_DEFAULT); + if (ret_value < 0) + throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::setComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name and \a comment. -// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) +// Function: H5Location::setComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name and \a comment. +// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) //-------------------------------------------------------------------------- void H5Location::setComment(const H5std_string& name, const H5std_string& comment) const { - setComment(name.c_str(), comment.c_str()); + setComment(name.c_str(), comment.c_str()); } //-------------------------------------------------------------------------- -// Function: H5Location::setComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it doesn't take -/// an object name. -// Programmer Binh-Minh Ribler - Sep 2013 +// Function: H5Location::setComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it doesn't take +/// an object name. +// Programmer Binh-Minh Ribler - Sep 2013 // Modification //-------------------------------------------------------------------------- void H5Location::setComment(const char* comment) const { - herr_t ret_value = H5Oset_comment_by_name(getId(), ".", comment, H5P_DEFAULT); - if( ret_value < 0 ) - throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed"); + herr_t ret_value = H5Oset_comment_by_name(getId(), ".", comment, H5P_DEFAULT); + if (ret_value < 0) + throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::setComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a comment. -// Programmer Binh-Minh Ribler - Sep 2013 +// Function: H5Location::setComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a comment. +// Programmer Binh-Minh Ribler - Sep 2013 //-------------------------------------------------------------------------- void H5Location::setComment(const H5std_string& comment) const { - setComment(comment.c_str()); + setComment(comment.c_str()); } //-------------------------------------------------------------------------- -// Function: H5Location::removeComment -///\brief Removes the comment from an object specified by its name. -///\param name - IN: Name of the object -///\exception H5::LocationException -// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013) -// 2007: QAK modified to use H5O APIs; however the first parameter is -// no longer just file or group, this function should be moved -// to another class to accommodate attribute, dataset, and named -// datatype. - BMR +// Function: H5Location::removeComment +///\brief Removes the comment from an object specified by its name. +///\param name - IN: Name of the object +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013) +// 2007: QAK modified to use H5O APIs; however the first parameter is +// no longer just file or group, this function should be moved +// to another class to accommodate attribute, dataset, and named +// datatype. - BMR //-------------------------------------------------------------------------- void H5Location::removeComment(const char* name) const { - herr_t ret_value = H5Oset_comment_by_name(getId(), name, NULL, H5P_DEFAULT); - if( ret_value < 0 ) - throw LocationException(inMemFunc("removeComment"), "H5Oset_comment_by_name failed"); + herr_t ret_value = H5Oset_comment_by_name(getId(), name, NULL, H5P_DEFAULT); + if (ret_value < 0) + throw LocationException(inMemFunc("removeComment"), "H5Oset_comment_by_name failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::removeComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013) +// Function: H5Location::removeComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013) //-------------------------------------------------------------------------- void H5Location::removeComment(const H5std_string& name) const { - removeComment (name.c_str()); + removeComment (name.c_str()); } //-------------------------------------------------------------------------- -// Function: H5Location::getComment -///\brief Retrieves the comment for this location, returning its length. -///\param name - IN: Name of the object -///\param buf_size - IN: Length of the comment to retrieve -///\param comment - OUT: Retrieved comment -///\return Actual length of the comment -///\exception H5::LocationException +// Function: H5Location::getComment +///\brief Retrieves the comment for this location, returning its length. +///\param name - IN: Name of the object +///\param buf_size - IN: Length of the comment to retrieve +///\param comment - OUT: Retrieved comment +///\return Actual length of the comment +///\exception H5::LocationException ///\par Description -/// This function retrieves \a buf_size characters of the comment -/// including the null terminator. Thus, if the actual length -/// of the comment is more than buf_size-1, the retrieved comment -/// will be truncated to accommodate the null terminator. -// Programmer Binh-Minh Ribler - Mar 2014 +/// This function retrieves \a buf_size characters of the comment +/// including the null terminator. Thus, if the actual length +/// of the comment is more than buf_size-1, the retrieved comment +/// will be truncated to accommodate the null terminator. +// Programmer Binh-Minh Ribler - Mar 2014 //-------------------------------------------------------------------------- ssize_t H5Location::getComment(const char* name, size_t buf_size, char* comment) const { @@ -274,27 +274,27 @@ ssize_t H5Location::getComment(const char* name, size_t buf_size, char* comment) // If H5Oget_comment_by_name returns a negative value, raise an exception if (comment_len < 0) - { + { throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed"); } // If the comment is longer than the provided buffer size, the C library // will not null terminate it if (static_cast(comment_len) >= buf_size) - comment[buf_size-1] = '\0'; + comment[buf_size-1] = '\0'; // Return the actual comment length, which might be different from buf_size return(comment_len); } //-------------------------------------------------------------------------- -// Function: H5Location::getComment -///\brief Returns the comment as \a string for this location, -/// returning its length. -///\param name - IN: Name of the object -///\param buf_size - IN: Length of the comment to retrieve, default to 0 -///\return Comment string -///\exception H5::LocationException -// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) +// Function: H5Location::getComment +///\brief Returns the comment as \a string for this location, +/// returning its length. +///\param name - IN: Name of the object +///\param buf_size - IN: Length of the comment to retrieve, default to 0 +///\return Comment string +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) //-------------------------------------------------------------------------- H5std_string H5Location::getComment(const char* name, size_t buf_size) const { @@ -307,36 +307,36 @@ H5std_string H5Location::getComment(const char* name, size_t buf_size) const // If H5Oget_comment_by_name returns a negative value, raise an exception if (comment_len < 0) - { + { throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed"); } // If comment exists, calls C routine again to get it else if (comment_len > 0) - { - size_t tmp_len = buf_size; - - // If buffer size is not provided, use comment length - if (tmp_len == 0) - tmp_len = comment_len; - - // Temporary buffer for char* comment - char* comment_C = new char[tmp_len+1]; - HDmemset(comment_C, 0, tmp_len+1); // clear buffer - - // Used overloaded function - ssize_t temp_len = getComment(name, tmp_len+1, comment_C); - if (temp_len < 0) - { - delete []comment_C; - throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed"); - } - - // Convert the C comment to return - comment = comment_C; - - // Clean up resource - delete []comment_C; + { + size_t tmp_len = buf_size; + + // If buffer size is not provided, use comment length + if (tmp_len == 0) + tmp_len = comment_len; + + // Temporary buffer for char* comment + char* comment_C = new char[tmp_len+1]; + HDmemset(comment_C, 0, tmp_len+1); // clear buffer + + // Used overloaded function + ssize_t temp_len = getComment(name, tmp_len+1, comment_C); + if (temp_len < 0) + { + delete []comment_C; + throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed"); + } + + // Convert the C comment to return + comment = comment_C; + + // Clean up resource + delete []comment_C; } // Return the string comment @@ -344,11 +344,11 @@ H5std_string H5Location::getComment(const char* name, size_t buf_size) const } //-------------------------------------------------------------------------- -// Function: H5Location::getComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) +// Function: H5Location::getComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) //-------------------------------------------------------------------------- H5std_string H5Location::getComment(const H5std_string& name, size_t buf_size) const { @@ -357,112 +357,112 @@ H5std_string H5Location::getComment(const H5std_string& name, size_t buf_size) c #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::p_reference (protected) -// Purpose Creates a reference to an HDF5 object or a dataset region. +// Function: H5Location::p_reference (protected) +// Purpose Creates a reference to an HDF5 object or a dataset region. // Parameters -// name - IN: Name of the object to be referenced -// dataspace - IN: Dataspace with selection -// ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION -// Exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// name - IN: Name of the object to be referenced +// dataspace - IN: Dataspace with selection +// ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION +// Exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const { - herr_t ret_value = H5Rcreate(ref, getId(), name, ref_type, space_id); - if (ret_value < 0) - { - throw ReferenceException(inMemFunc("reference"), "H5Rcreate failed"); - } + herr_t ret_value = H5Rcreate(ref, getId(), name, ref_type, space_id); + if (ret_value < 0) + { + throw ReferenceException(inMemFunc("reference"), "H5Rcreate failed"); + } } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::reference -///\brief Creates a reference to an HDF5 object or a dataset region. -///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced -///\param dataspace - IN: Dataspace with selection -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference. -/// \li \c H5R_DATASET_REGION - Reference is a dataset region -/// reference. (default) -///\exception H5::ReferenceException -///\note This method is more suitable for a dataset region reference. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::reference +///\brief Creates a reference to an HDF5 object or a dataset region. +///\param ref - IN: Reference pointer +///\param name - IN: Name of the object to be referenced +///\param dataspace - IN: Dataspace with selection +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +/// reference. (default) +///\exception H5::ReferenceException +///\note This method is more suitable for a dataset region reference. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const char* name, const DataSpace& dataspace, H5R_type_t ref_type) const { - try { - p_reference(ref, name, dataspace.getId(), ref_type); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); - } -} - -//-------------------------------------------------------------------------- -// Function: H5Location::reference -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced -///\param dataspace - IN: Dataspace with selection -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference. -/// \li \c H5R_DATASET_REGION - Reference is a dataset region -/// reference. (default) -///\exception H5::ReferenceException -///\note This method is more suitable for a dataset region reference. -// Programmer Binh-Minh Ribler - May, 2004 + try { + p_reference(ref, name, dataspace.getId(), ref_type); + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); + } +} + +//-------------------------------------------------------------------------- +// Function: H5Location::reference +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +///\param ref - IN: Reference pointer +///\param name - IN: Name of the object to be referenced +///\param dataspace - IN: Dataspace with selection +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +/// reference. (default) +///\exception H5::ReferenceException +///\note This method is more suitable for a dataset region reference. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const H5std_string& name, const DataSpace& dataspace, H5R_type_t ref_type) const { - try { - p_reference(ref, name.c_str(), dataspace.getId(), ref_type); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); - } + try { + p_reference(ref, name.c_str(), dataspace.getId(), ref_type); + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: H5Location::reference -///\brief This is an overloaded function, provided for your convenience. -/// It differs from the above function in that it does not take -/// a DataSpace object and the reference type must be specified. -///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference (default) -/// \li \c H5R_DATASET_REGION - Reference is a dataset region -///\exception H5::ReferenceException -///\note This method is more suitable for an object reference. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::reference +///\brief This is an overloaded function, provided for your convenience. +/// It differs from the above function in that it does not take +/// a DataSpace object and the reference type must be specified. +///\param ref - IN: Reference pointer +///\param name - IN: Name of the object to be referenced +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference (default) +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +///\exception H5::ReferenceException +///\note This method is more suitable for an object reference. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const char* name, H5R_type_t ref_type) const { - try { - p_reference(ref, name, -1, ref_type); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); - } + try { + p_reference(ref, name, -1, ref_type); + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: H5Location::reference -///\brief This is an overloaded function, provided for your convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for the object's name. -///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced - \c H5std_string -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference (default) -/// \li \c H5R_DATASET_REGION - Reference is a dataset region -///\note This method is more suitable for an object reference. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::reference +///\brief This is an overloaded function, provided for your convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for the object's name. +///\param ref - IN: Reference pointer +///\param name - IN: Name of the object to be referenced - \c H5std_string +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference (default) +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +///\note This method is more suitable for an object reference. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const H5std_string& name, H5R_type_t ref_type) const { @@ -471,69 +471,69 @@ void H5Location::reference(void* ref, const H5std_string& name, H5R_type_t ref_t #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::p_dereference (protected) -// Purpose Dereference a ref into an hdf5 object. +// Function: H5Location::p_dereference (protected) +// Purpose Dereference a ref into an hdf5 object. // Parameters -// loc_id - IN: An hdf5 identifier specifying the location of the -// referenced object -// ref - IN: Reference pointer -// ref_type - IN: Reference type -// plist - IN: Property list - default to PropList::DEFAULT -// from_func - IN: Name of the calling function -// Exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// loc_id - IN: An hdf5 identifier specifying the location of the +// referenced object +// ref - IN: Reference pointer +// ref_type - IN: Reference type +// plist - IN: Property list - default to PropList::DEFAULT +// from_func - IN: Name of the calling function +// Exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// May 2008 - BMR -// Moved from IdComponent. +// May 2008 - BMR +// Moved from IdComponent. //-------------------------------------------------------------------------- hid_t H5Location::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const PropList& plist, const char* from_func) { - hid_t plist_id; - if (p_valid_id(plist.getId())) - plist_id = plist.getId(); - else - plist_id = H5P_DEFAULT; + hid_t plist_id; + if (p_valid_id(plist.getId())) + plist_id = plist.getId(); + else + plist_id = H5P_DEFAULT; - hid_t temp_id = H5Rdereference2(loc_id, plist_id, ref_type, ref); - if (temp_id < 0) - { - throw ReferenceException(inMemFunc(from_func), "H5Rdereference failed"); - } + hid_t temp_id = H5Rdereference2(loc_id, plist_id, ref_type, ref); + if (temp_id < 0) + { + throw ReferenceException(inMemFunc(from_func), "H5Rdereference failed"); + } - return(temp_id); + return(temp_id); } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::dereference -///\brief Dereferences a reference into an HDF5 object, given an HDF5 object. -///\param loc - IN: Location of the referenced object -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// Function: H5Location::dereference +///\brief Dereferences a reference into an HDF5 object, given an HDF5 object. +///\param loc - IN: Location of the referenced object +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// May, 2008 -// Corrected missing parameters. - BMR +// May, 2008 +// Corrected missing parameters. - BMR //-------------------------------------------------------------------------- void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) { - p_setId(p_dereference(loc.getId(), ref, ref_type, plist, "dereference")); + p_setId(p_dereference(loc.getId(), ref, ref_type, plist, "dereference")); } //-------------------------------------------------------------------------- -// Function: H5Location::dereference -///\brief Dereferences a reference into an HDF5 object, given an attribute. -///\param attr - IN: Attribute specifying the location of the referenced object -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// Function: H5Location::dereference +///\brief Dereferences a reference into an HDF5 object, given an attribute. +///\param attr - IN: Attribute specifying the location of the referenced object +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// May, 2008 -// Corrected missing parameters. - BMR +// May, 2008 +// Corrected missing parameters. - BMR //-------------------------------------------------------------------------- /* void H5Location::dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) { @@ -543,153 +543,152 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t #ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- -// Function: H5Location::getObjType -///\brief Retrieves the type of object that an object reference points to. -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference. -/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. -///\param ref - IN: Reference to query -///\return An object type, which can be one of the following: -/// \li \c H5G_UNKNOWN - A failure occurs. (-1) -/// \li \c H5G_GROUP - Object is a group. -/// \li \c H5G_DATASET - Object is a dataset. -/// \li \c H5G_TYPE Object - is a named datatype -/// \li \c H5G_LINK - Object is a symbolic link. -/// \li \c H5G_UDLINK - Object is a user-defined link. -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::getObjType +///\brief Retrieves the type of object that an object reference points to. +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. +///\param ref - IN: Reference to query +///\return An object type, which can be one of the following: +/// \li \c H5G_UNKNOWN - A failure occurs. (-1) +/// \li \c H5G_GROUP - Object is a group. +/// \li \c H5G_DATASET - Object is a dataset. +/// \li \c H5G_TYPE Object - is a named datatype +/// \li \c H5G_LINK - Object is a symbolic link. +/// \li \c H5G_UDLINK - Object is a user-defined link. +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 // Modification -// Sep 2012: Moved up from H5File, Group, DataSet, and DataType +// Sep 2012: Moved up from H5File, Group, DataSet, and DataType //-------------------------------------------------------------------------- H5G_obj_t H5Location::getObjType(void *ref, H5R_type_t ref_type) const { - try { - return(p_get_obj_type(ref, ref_type)); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("getObjType"), E.getDetailMsg()); - } + try { + return(p_get_obj_type(ref, ref_type)); + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("getObjType"), E.getDetailMsg()); + } } #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::p_get_obj_type (protected) -// Purpose Retrieves the type of object that an object reference points to. +// Function: H5Location::p_get_obj_type (protected) +// Purpose Retrieves the type of object that an object reference points to. // Parameters -// ref - IN: Reference to query -// ref_type - IN: Type of reference to query -// Return An object type, which can be one of the following: -// H5G_UNKNOWN \tFailure occurs (-1) -// H5G_GROUP \tObject is a group. -// H5G_DATASET \tObject is a dataset. -// H5G_TYPE Object \tis a named datatype. -// H5G_LINK \tObject is a symbolic link. -// H5G_UDLINK \tObject is a user-defined link. -// Exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// ref - IN: Reference to query +// ref_type - IN: Type of reference to query +// Return An object type, which can be one of the following: +// H5G_UNKNOWN \tFailure occurs (-1) +// H5G_GROUP \tObject is a group. +// H5G_DATASET \tObject is a dataset. +// H5G_TYPE Object \tis a named datatype. +// H5G_LINK \tObject is a symbolic link. +// H5G_UDLINK \tObject is a user-defined link. +// Exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- H5G_obj_t H5Location::p_get_obj_type(void *ref, H5R_type_t ref_type) const { H5G_obj_t obj_type = H5Rget_obj_type1(getId(), ref_type, ref); - if (obj_type == H5G_UNKNOWN) - { - throw ReferenceException(inMemFunc("getObjType"), "H5Rget_obj_type1 failed"); - } + { + throw ReferenceException(inMemFunc("getObjType"), "H5Rget_obj_type1 failed"); + } return(obj_type); } #endif // DOXYGEN_SHOULD_SKIP_THIS #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- -// Function: H5Location::getRefObjType -///\brief Retrieves the type of object that an object reference points to. -///\param ref - IN: Reference to query -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference. -/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. -///\return An object type, which can be one of the following: -/// \li \c H5O_TYPE_UNKNOWN - Unknown object type (-1) -/// \li \c H5O_TYPE_GROUP - Object is a group -/// \li \c H5O_TYPE_DATASET - Object is a dataset -/// \li \c H5O_TYPE_NAMED_DATATYPE - Object is a named datatype -/// \li \c H5O_TYPE_NTYPES - Number of different object types -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::getRefObjType +///\brief Retrieves the type of object that an object reference points to. +///\param ref - IN: Reference to query +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. +///\return An object type, which can be one of the following: +/// \li \c H5O_TYPE_UNKNOWN - Unknown object type (-1) +/// \li \c H5O_TYPE_GROUP - Object is a group +/// \li \c H5O_TYPE_DATASET - Object is a dataset +/// \li \c H5O_TYPE_NAMED_DATATYPE - Object is a named datatype +/// \li \c H5O_TYPE_NTYPES - Number of different object types +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_type) const { - try { + try { return(p_get_ref_obj_type(ref, ref_type)); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("getRefObjType"), E.getDetailMsg()); - } + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("getRefObjType"), E.getDetailMsg()); + } } #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::p_get_ref_obj_type (protected) -// Purpose Retrieves the type of object that an object reference points to. +// Function: H5Location::p_get_ref_obj_type (protected) +// Purpose Retrieves the type of object that an object reference points to. // Parameters -// ref - IN: Reference to query -// ref_type - IN: Type of reference to query -// Return An object type, which can be one of the following: -// H5O_TYPE_UNKNOWN - Unknown object type (-1) -// H5O_TYPE_GROUP - Object is a group -// H5O_TYPE_DATASET - Object is a dataset -// H5O_TYPE_NAMED_DATATYPE - Object is a named datatype -// H5O_TYPE_NTYPES - Number of object types -// Exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// ref - IN: Reference to query +// ref_type - IN: Type of reference to query +// Return An object type, which can be one of the following: +// H5O_TYPE_UNKNOWN - Unknown object type (-1) +// H5O_TYPE_GROUP - Object is a group +// H5O_TYPE_DATASET - Object is a dataset +// H5O_TYPE_NAMED_DATATYPE - Object is a named datatype +// H5O_TYPE_NTYPES - Number of object types +// Exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- H5O_type_t H5Location::p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const { - H5O_type_t obj_type = H5O_TYPE_UNKNOWN; - herr_t ret_value = H5Rget_obj_type2(getId(), ref_type, ref, &obj_type); - if (ret_value < 0) - { - throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 failed"); - } - if (obj_type == H5O_TYPE_UNKNOWN || obj_type >= H5O_TYPE_NTYPES) - { - throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 returned invalid type"); - } - return(obj_type); + H5O_type_t obj_type = H5O_TYPE_UNKNOWN; + herr_t ret_value = H5Rget_obj_type2(getId(), ref_type, ref, &obj_type); + if (ret_value < 0) + { + throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 failed"); + } + if (obj_type == H5O_TYPE_UNKNOWN || obj_type >= H5O_TYPE_NTYPES) + { + throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 returned invalid type"); + } + return(obj_type); } //-------------------------------------------------------------------------- -// Function: H5Location::getRegion -///\brief Retrieves a dataspace with the region pointed to selected. -///\param ref - IN: Reference to get region of -///\param ref_type - IN: Type of reference to get region of - default -// to H5R_DATASET_REGION -///\return DataSpace object -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::getRegion +///\brief Retrieves a dataspace with the region pointed to selected. +///\param ref - IN: Reference to get region of +///\param ref_type - IN: Type of reference to get region of - default +// to H5R_DATASET_REGION +///\return DataSpace object +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 // Modification -// Mar 29, 2015 -// Used friend function to set id for DataSpace instead of the -// existing id constructor or the setId method to avoid incrementing -// ref count, as a work-around for a problem described in the JIRA -// issue HDFFV-7947. -BMR +// Mar 29, 2015 +// Used friend function to set id for DataSpace instead of the +// existing id constructor or the setId method to avoid incrementing +// ref count, as a work-around for a problem described in the JIRA +// issue HDFFV-7947. -BMR //-------------------------------------------------------------------------- DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const { - hid_t space_id = H5Rget_region(getId(), ref_type, ref); - if (space_id < 0) - { - throw ReferenceException(inMemFunc("getRegion"), "H5Rget_region failed"); - } - try { - DataSpace dataspace; - f_DataSpace_setId(&dataspace, space_id); - return(dataspace); - } - catch (DataSpaceIException& E) { - throw ReferenceException(inMemFunc("getRegion"), E.getDetailMsg()); - } + hid_t space_id = H5Rget_region(getId(), ref_type, ref); + if (space_id < 0) + { + throw ReferenceException(inMemFunc("getRegion"), "H5Rget_region failed"); + } + try { + DataSpace dataspace; + f_DataSpace_setId(&dataspace, space_id); + return(dataspace); + } + catch (DataSpaceIException& E) { + throw ReferenceException(inMemFunc("getRegion"), E.getDetailMsg()); + } } @@ -705,11 +704,11 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const // to call the right getId() - although, as the structure of the // library at this time, getId() is basically the IdComponent::getId() // ***Updated: after the classes are rearranged (HDFFV-9920), functions -// in CommonFG are moved to Group, and they can call getId() -// instead of getLocId(). getLocId() is kept for backward -// compatibility on user applications. Aug 18, 2016 -BMR +// in CommonFG are moved to Group, and they can call getId() +// instead of getLocId(). getLocId() is kept for backward +// compatibility on user applications. Aug 18, 2016 -BMR // ***Updated: Moving to Group was a mistake, now to H5Location -// Aug 24, 2016 -BMR +// Aug 24, 2016 -BMR // - when a failure returned by the C API, the functions will call // throwException, which is a pure virtual function and is implemented // by H5File to throw a FileIException and by Group to throw a @@ -722,29 +721,29 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const // is kept in those methods as well. Sep 17, 2016 -BMR //-------------------------------------------------------------------------- -// Function: H5Location::createGroup -///\brief Creates a new group at this location which can be a file -/// or another group. -///\param name - IN: Name of the group to create -///\param size_hint - IN: Indicates the number of bytes to reserve for -/// the names that will appear in the group -///\return Group instance -///\exception H5::FileIException or H5::GroupIException +// Function: H5Location::createGroup +///\brief Creates a new group at this location which can be a file +/// or another group. +///\param name - IN: Name of the group to create +///\param size_hint - IN: Indicates the number of bytes to reserve for +/// the names that will appear in the group +///\return Group instance +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// The optional \a size_hint specifies how much file space to -/// reserve for storing the names that will appear in this new -/// group. If a non-positive value is provided for the \a size_hint -/// then a default size is chosen. -// Programmer Binh-Minh Ribler - 2000 +/// The optional \a size_hint specifies how much file space to +/// reserve for storing the names that will appear in this new +/// group. If a non-positive value is provided for the \a size_hint +/// then a default size is chosen. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group H5Location::createGroup( const char* name, size_t size_hint ) const +Group H5Location::createGroup(const char* name, size_t size_hint) const { // Group creation property list for size hint hid_t gcpl_id = 0; // Set the local heap size hint if (size_hint > 0) - { + { // If the creation of the property list failed, throw an exception if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) throwException("createGroup", "H5Pcreate failed"); @@ -755,351 +754,351 @@ Group H5Location::createGroup( const char* name, size_t size_hint ) const } } - // Call C routine H5Gcreate2 to create the named group, giving the - // location id which can be a file id or a group id - hid_t group_id = H5Gcreate2(getId(), name, H5P_DEFAULT, gcpl_id, H5P_DEFAULT ); + // Call C routine H5Gcreate2 to create the named group, giving the + // location id which can be a file id or a group id + hid_t group_id = H5Gcreate2(getId(), name, H5P_DEFAULT, gcpl_id, H5P_DEFAULT); - // Close the group creation property list, if necessary - if(gcpl_id > 0) + // Close the group creation property list, if necessary + if(gcpl_id > 0) H5Pclose(gcpl_id); - // If the creation of the group failed, throw an exception - if( group_id < 0 ) - throwException("createGroup", "H5Gcreate2 failed"); + // If the creation of the group failed, throw an exception + if (group_id < 0) + throwException("createGroup", "H5Gcreate2 failed"); - // No failure, create and return the Group object - Group group; - //group.p_setId(group_id); - H5Location *ptr = &group; - ptr->p_setId(group_id); - return( group ); + // No failure, create and return the Group object + Group group; + //group.p_setId(group_id); + H5Location *ptr = &group; + ptr->p_setId(group_id); + return(group); } //-------------------------------------------------------------------------- -// Function: H5Location::createGroup -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::createGroup +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group H5Location::createGroup( const H5std_string& name, size_t size_hint ) const +Group H5Location::createGroup(const H5std_string& name, size_t size_hint) const { - return( createGroup( name.c_str(), size_hint )); + return(createGroup( name.c_str(), size_hint)); } //-------------------------------------------------------------------------- -// Function: H5Location::openGroup -///\brief Opens an existing group in a location which can be a file -/// or another group. -///\param name - IN: Name of the group to open -///\return Group instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::openGroup +///\brief Opens an existing group in a location which can be a file +/// or another group. +///\param name - IN: Name of the group to open +///\return Group instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group H5Location::openGroup( const char* name ) const +Group H5Location::openGroup(const char* name) const { - // Call C routine H5Gopen2 to open the named group, giving the - // location id which can be a file id or a group id - hid_t group_id = H5Gopen2(getId(), name, H5P_DEFAULT ); + // Call C routine H5Gopen2 to open the named group, giving the + // location id which can be a file id or a group id + hid_t group_id = H5Gopen2(getId(), name, H5P_DEFAULT); - // If the opening of the group failed, throw an exception - if( group_id < 0 ) - throwException("openGroup", "H5Gopen2 failed"); + // If the opening of the group failed, throw an exception + if (group_id < 0) + throwException("openGroup", "H5Gopen2 failed"); - // No failure, create and return the Group object - Group group; - //group.p_setId(group_id); - H5Location *ptr = &group; - ptr->p_setId(group_id); - return( group ); + // No failure, create and return the Group object + Group group; + //group.p_setId(group_id); + H5Location *ptr = &group; + ptr->p_setId(group_id); + return(group); } //-------------------------------------------------------------------------- -// Function: H5Location::openGroup -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::openGroup +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group H5Location::openGroup( const H5std_string& name ) const +Group H5Location::openGroup(const H5std_string& name) const { - return( openGroup( name.c_str() )); + return(openGroup( name.c_str())); } //-------------------------------------------------------------------------- -// Function: H5Location::createDataSet -///\brief Creates a new dataset at this location. -///\param name - IN: Name of the dataset to create -///\param data_type - IN: Datatype of the dataset -///\param data_space - IN: Dataspace for the dataset -///\param create_plist - IN: Creation properly list for the dataset -///\return DataSet instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::createDataSet +///\brief Creates a new dataset at this location. +///\param name - IN: Name of the dataset to create +///\param data_type - IN: Datatype of the dataset +///\param data_space - IN: Dataspace for the dataset +///\param create_plist - IN: Creation properly list for the dataset +///\return DataSet instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet H5Location::createDataSet( const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const +DataSet H5Location::createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist) const { // Obtain identifiers for C API - hid_t type_id = data_type.getId(); - hid_t space_id = data_space.getId(); - hid_t create_plist_id = create_plist.getId(); + hid_t type_id = data_type.getId(); + hid_t space_id = data_space.getId(); + hid_t create_plist_id = create_plist.getId(); - // Call C routine H5Dcreate2 to create the named dataset - hid_t dataset_id = H5Dcreate2(getId(), name, type_id, space_id, H5P_DEFAULT, create_plist_id, H5P_DEFAULT ); + // Call C routine H5Dcreate2 to create the named dataset + hid_t dataset_id = H5Dcreate2(getId(), name, type_id, space_id, H5P_DEFAULT, create_plist_id, H5P_DEFAULT); - // If the creation of the dataset failed, throw an exception - if( dataset_id < 0 ) - throwException("createDataSet", "H5Dcreate2 failed"); + // If the creation of the dataset failed, throw an exception + if (dataset_id < 0) + throwException("createDataSet", "H5Dcreate2 failed"); - // No failure, create and return the DataSet object - DataSet dataset; - f_DataSet_setId(&dataset, dataset_id); - return( dataset ); + // No failure, create and return the DataSet object + DataSet dataset; + f_DataSet_setId(&dataset, dataset_id); + return(dataset); } //-------------------------------------------------------------------------- -// Function: H5Location::createDataSet -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::createDataSet +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet H5Location::createDataSet( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const +DataSet H5Location::createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist) const { - return( createDataSet( name.c_str(), data_type, data_space, create_plist )); + return(createDataSet( name.c_str(), data_type, data_space, create_plist)); } //-------------------------------------------------------------------------- -// Function: H5Location::openDataSet -///\brief Opens an existing dataset at this location. -///\param name - IN: Name of the dataset to open -///\return DataSet instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::openDataSet +///\brief Opens an existing dataset at this location. +///\param name - IN: Name of the dataset to open +///\return DataSet instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet H5Location::openDataSet( const char* name ) const +DataSet H5Location::openDataSet(const char* name) const { - // Call C function H5Dopen2 to open the specified dataset, giving - // the location id and the dataset's name - hid_t dataset_id = H5Dopen2(getId(), name, H5P_DEFAULT ); + // Call C function H5Dopen2 to open the specified dataset, giving + // the location id and the dataset's name + hid_t dataset_id = H5Dopen2(getId(), name, H5P_DEFAULT); - // If the dataset's opening failed, throw an exception - if(dataset_id < 0) - throwException("openDataSet", "H5Dopen2 failed"); + // If the dataset's opening failed, throw an exception + if(dataset_id < 0) + throwException("openDataSet", "H5Dopen2 failed"); - // No failure, create and return the DataSet object - DataSet dataset; - f_DataSet_setId(&dataset, dataset_id); - return( dataset ); + // No failure, create and return the DataSet object + DataSet dataset; + f_DataSet_setId(&dataset, dataset_id); + return(dataset); } //-------------------------------------------------------------------------- -// Function: H5Location::openDataSet -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::openDataSet +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet H5Location::openDataSet( const H5std_string& name ) const +DataSet H5Location::openDataSet(const H5std_string& name) const { - return( openDataSet( name.c_str() )); + return(openDataSet( name.c_str())); } //-------------------------------------------------------------------------- -// Function: H5Location::link -///\brief Creates a link of the specified type from \a new_name to -/// \a curr_name. -///\param link_type - IN: Link type; possible values are -/// \li \c H5G_LINK_HARD -/// \li \c H5G_LINK_SOFT -///\param curr_name - IN: Name of the existing object if link is a hard -/// link; can be anything for the soft link -///\param new_name - IN: New name for the object -///\exception H5::FileIException or H5::GroupIException +// Function: H5Location::link +///\brief Creates a link of the specified type from \a new_name to +/// \a curr_name. +///\param link_type - IN: Link type; possible values are +/// \li \c H5G_LINK_HARD +/// \li \c H5G_LINK_SOFT +///\param curr_name - IN: Name of the existing object if link is a hard +/// link; can be anything for the soft link +///\param new_name - IN: New name for the object +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// Note that both names are interpreted relative to the -/// specified location. -/// For information on creating hard link and soft link, please -/// refer to the C layer Reference Manual at: +/// Note that both names are interpreted relative to the +/// specified location. +/// For information on creating hard link and soft link, please +/// refer to the C layer Reference Manual at: /// http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateHard and /// http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateSoft -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Modification -// 2007: QAK modified to use H5L APIs - BMR +// 2007: QAK modified to use H5L APIs - BMR //-------------------------------------------------------------------------- -void H5Location::link( H5L_type_t link_type, const char* curr_name, const char* new_name ) const +void H5Location::link(H5L_type_t link_type, const char* curr_name, const char* new_name) const { herr_t ret_value = -1; switch(link_type) { case H5L_TYPE_HARD: - ret_value = H5Lcreate_hard(getId(), curr_name, H5L_SAME_LOC, new_name, H5P_DEFAULT, H5P_DEFAULT ); + ret_value = H5Lcreate_hard(getId(), curr_name, H5L_SAME_LOC, new_name, H5P_DEFAULT, H5P_DEFAULT); break; case H5L_TYPE_SOFT: - ret_value = H5Lcreate_soft( curr_name,getId(), new_name, H5P_DEFAULT, H5P_DEFAULT ); + ret_value = H5Lcreate_soft(curr_name,getId(), new_name, H5P_DEFAULT, H5P_DEFAULT); break; - case H5L_TYPE_ERROR: - case H5L_TYPE_EXTERNAL: - case H5L_TYPE_MAX: + case H5L_TYPE_ERROR: + case H5L_TYPE_EXTERNAL: + case H5L_TYPE_MAX: default: throwException("link", "unknown link type"); break; } /* end switch */ - if( ret_value < 0 ) - throwException("link", "creating link failed"); + if (ret_value < 0) + throwException("link", "creating link failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::link -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a curr_name and \a new_name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::link +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a curr_name and \a new_name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::link( H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name ) const +void H5Location::link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const { - link( link_type, curr_name.c_str(), new_name.c_str() ); + link(link_type, curr_name.c_str(), new_name.c_str()); } //-------------------------------------------------------------------------- -// Function: H5Location::unlink -///\brief Removes the specified name at this location. -///\param name - IN: Name of the object to be removed -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::unlink +///\brief Removes the specified name at this location. +///\param name - IN: Name of the object to be removed +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// 2007: QAK modified to use H5L APIs - BMR +// 2007: QAK modified to use H5L APIs - BMR //-------------------------------------------------------------------------- -void H5Location::unlink( const char* name ) const +void H5Location::unlink(const char* name) const { - herr_t ret_value = H5Ldelete(getId(), name, H5P_DEFAULT ); - if( ret_value < 0 ) - throwException("unlink", "H5Ldelete failed"); + herr_t ret_value = H5Ldelete(getId(), name, H5P_DEFAULT); + if (ret_value < 0) + throwException("unlink", "H5Ldelete failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::unlink -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::unlink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::unlink( const H5std_string& name ) const +void H5Location::unlink(const H5std_string& name) const { - unlink( name.c_str() ); + unlink(name.c_str()); } //-------------------------------------------------------------------------- -// Function: H5Location::move -///\brief Renames an object at this location. -///\param src - IN: Object's original name -///\param dst - IN: Object's new name -///\exception H5::FileIException or H5::GroupIException +// Function: H5Location::move +///\brief Renames an object at this location. +///\param src - IN: Object's original name +///\param dst - IN: Object's new name +///\exception H5::FileIException or H5::GroupIException ///\note -/// Exercise care in moving groups as it is possible to render -/// data in a file inaccessible with H5Location::move. Please refer -/// to the Group Interface in the HDF5 User's Guide for details at: +/// Exercise care in moving groups as it is possible to render +/// data in a file inaccessible with H5Location::move. Please refer +/// to the Group Interface in the HDF5 User's Guide for details at: /// https://www.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FGroups%2FHDF5_Groups.htm -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Modification -// 2007: QAK modified to use H5L APIs - BMR +// 2007: QAK modified to use H5L APIs - BMR //-------------------------------------------------------------------------- -void H5Location::move( const char* src, const char* dst ) const +void H5Location::move(const char* src, const char* dst) const { - herr_t ret_value = H5Lmove(getId(), src, H5L_SAME_LOC, dst, H5P_DEFAULT, H5P_DEFAULT ); - if( ret_value < 0 ) - throwException("move", "H5Lmove failed"); + herr_t ret_value = H5Lmove(getId(), src, H5L_SAME_LOC, dst, H5P_DEFAULT, H5P_DEFAULT); + if (ret_value < 0) + throwException("move", "H5Lmove failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::move -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a src and \a dst. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::move +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a src and \a dst. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::move( const H5std_string& src, const H5std_string& dst ) const +void H5Location::move(const H5std_string& src, const H5std_string& dst) const { - move( src.c_str(), dst.c_str() ); + move(src.c_str(), dst.c_str()); } #ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- -// Function: H5Location::getObjinfo -///\brief Returns information about an object. -///\param name - IN: Name of the object -///\param follow_link - IN: Link flag -///\param statbuf - OUT: Buffer to return information about the object -///\exception H5::FileIException or H5::GroupIException +// Function: H5Location::getObjinfo +///\brief Returns information about an object. +///\param name - IN: Name of the object +///\param follow_link - IN: Link flag +///\param statbuf - OUT: Buffer to return information about the object +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5G.html#Group-GetObjinfo -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& statbuf ) const +void H5Location::getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const { - herr_t ret_value = H5Gget_objinfo(getId(), name, follow_link, &statbuf ); - if( ret_value < 0 ) - throwException("getObjinfo", "H5Gget_objinfo failed"); + herr_t ret_value = H5Gget_objinfo(getId(), name, follow_link, &statbuf); + if (ret_value < 0) + throwException("getObjinfo", "H5Gget_objinfo failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjinfo -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::getObjinfo +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::getObjinfo( const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf ) const +void H5Location::getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const { - getObjinfo( name.c_str(), follow_link, statbuf ); + getObjinfo(name.c_str(), follow_link, statbuf); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjinfo -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above functions in that it doesn't have -/// the paramemter \a follow_link. -// Programmer Binh-Minh Ribler - Nov, 2005 +// Function: H5Location::getObjinfo +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above functions in that it doesn't have +/// the paramemter \a follow_link. +// Programmer Binh-Minh Ribler - Nov, 2005 // Note: need to modify to use H5Oget_info and H5Lget_info - BMR //-------------------------------------------------------------------------- -void H5Location::getObjinfo( const char* name, H5G_stat_t& statbuf ) const +void H5Location::getObjinfo(const char* name, H5G_stat_t& statbuf) const { - herr_t ret_value = H5Gget_objinfo(getId(), name, 0, &statbuf ); - if( ret_value < 0 ) - throwException("getObjinfo", "H5Gget_objinfo failed"); + herr_t ret_value = H5Gget_objinfo(getId(), name, 0, &statbuf); + if (ret_value < 0) + throwException("getObjinfo", "H5Gget_objinfo failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjinfo -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - Nov, 2005 +// Function: H5Location::getObjinfo +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - Nov, 2005 //-------------------------------------------------------------------------- -void H5Location::getObjinfo( const H5std_string& name, H5G_stat_t& statbuf ) const +void H5Location::getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const { - getObjinfo( name.c_str(), statbuf ); + getObjinfo(name.c_str(), statbuf); } #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- -// Function: H5Location::getLinkval -///\brief Returns the name of the object that the symbolic link points to. -///\param name - IN: Symbolic link to the object -///\param size - IN: Maximum number of characters of value to be returned -///\return Name of the object -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::getLinkval +///\brief Returns the name of the object that the symbolic link points to. +///\param name - IN: Symbolic link to the object +///\param size - IN: Maximum number of characters of value to be returned +///\return Name of the object +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string H5Location::getLinkval( const char* name, size_t size ) const +H5std_string H5Location::getLinkval(const char* name, size_t size) const { H5L_info_t linkinfo; - char *value_C; // value in C string + char *value_C; // value in C string size_t val_size = size; H5std_string value = ""; herr_t ret_value; @@ -1107,81 +1106,81 @@ H5std_string H5Location::getLinkval( const char* name, size_t size ) const // if user doesn't provide buffer size, determine it if (size == 0) { - ret_value = H5Lget_info(getId(), name, &linkinfo, H5P_DEFAULT); - if( ret_value < 0 ) - throwException("getLinkval", "H5Lget_info to find buffer size failed"); + ret_value = H5Lget_info(getId(), name, &linkinfo, H5P_DEFAULT); + if (ret_value < 0) + throwException("getLinkval", "H5Lget_info to find buffer size failed"); - val_size = linkinfo.u.val_size; + val_size = linkinfo.u.val_size; } // if link has value, retrieve the value, otherwise, return null string if (val_size > 0) { - value_C = new char[val_size+1]; // temporary C-string for C API - HDmemset(value_C, 0, val_size+1); // clear buffer - - ret_value = H5Lget_val(getId(), name, value_C, val_size, H5P_DEFAULT); - if( ret_value < 0 ) - { - delete []value_C; - throwException("getLinkval", "H5Lget_val failed"); - } - - value = H5std_string(value_C); - delete []value_C; + value_C = new char[val_size+1]; // temporary C-string for C API + HDmemset(value_C, 0, val_size+1); // clear buffer + + ret_value = H5Lget_val(getId(), name, value_C, val_size, H5P_DEFAULT); + if (ret_value < 0) + { + delete []value_C; + throwException("getLinkval", "H5Lget_val failed"); + } + + value = H5std_string(value_C); + delete []value_C; } return(value); } //-------------------------------------------------------------------------- -// Function: H5Location::getLinkval -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::getLinkval +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string H5Location::getLinkval( const H5std_string& name, size_t size ) const +H5std_string H5Location::getLinkval(const H5std_string& name, size_t size) const { - return( getLinkval( name.c_str(), size )); + return(getLinkval( name.c_str(), size)); } //-------------------------------------------------------------------------- -// Function: H5Location::mount -///\brief Mounts the file \a child onto this group. -///\param name - IN: Name of the group -///\param child - IN: File to mount -///\param plist - IN: Property list to use -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2014 (original 2000) +// Function: H5Location::mount +///\brief Mounts the file \a child onto this group. +///\param name - IN: Name of the group +///\param child - IN: File to mount +///\param plist - IN: Property list to use +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2014 (original 2000) //-------------------------------------------------------------------------- -void H5Location::mount(const char* name, const H5File& child, const PropList& plist ) const +void H5Location::mount(const char* name, const H5File& child, const PropList& plist) const { - // Obtain identifiers for C API - hid_t plist_id = plist.getId(); - hid_t child_id = child.getId(); + // Obtain identifiers for C API + hid_t plist_id = plist.getId(); + hid_t child_id = child.getId(); - // Call C routine H5Fmount to do the mouting - herr_t ret_value = H5Fmount(getId(), name, child_id, plist_id ); + // Call C routine H5Fmount to do the mouting + herr_t ret_value = H5Fmount(getId(), name, child_id, plist_id); - // Raise exception if H5Fmount returns negative value - if( ret_value < 0 ) - throwException("mount", "H5Fmount failed"); + // Raise exception if H5Fmount returns negative value + if (ret_value < 0) + throwException("mount", "H5Fmount failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::mount -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Param name - IN: Name of the group -// Param child - IN: File to mount -// Param plist - IN: Property list to use -// Exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::mount +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Param name - IN: Name of the group +// Param child - IN: File to mount +// Param plist - IN: Property list to use +// Exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void H5Location::mount(const char* name, H5File& child, PropList& plist) const //{ @@ -1189,26 +1188,26 @@ void H5Location::mount(const char* name, const H5File& child, const PropList& pl //} //-------------------------------------------------------------------------- -// Function: H5Location::mount -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::mount +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Location::mount(const H5std_string& name, const H5File& child, const PropList& plist) const { - mount(name.c_str(), child, plist); + mount(name.c_str(), child, plist); } //-------------------------------------------------------------------------- -// Function: H5Location::mount -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Programmer Binh-Minh Ribler - 2014 +// Function: H5Location::mount +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Programmer Binh-Minh Ribler - 2014 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void H5Location::mount(const H5std_string& name, H5File& child, PropList& plist) const //{ @@ -1216,109 +1215,109 @@ void H5Location::mount(const H5std_string& name, const H5File& child, const Prop //} //-------------------------------------------------------------------------- -// Function: H5Location::unmount -///\brief Unmounts the specified file. -///\param name - IN: Name of the file to unmount -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::unmount +///\brief Unmounts the specified file. +///\param name - IN: Name of the file to unmount +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::unmount( const char* name ) const +void H5Location::unmount(const char* name) const { - // Call C routine H5Fmount to do the mouting - herr_t ret_value = H5Funmount(getId(), name ); + // Call C routine H5Fmount to do the mouting + herr_t ret_value = H5Funmount(getId(), name); - // Raise exception if H5Funmount returns negative value - if( ret_value < 0 ) - throwException("unmount", "H5Funmount failed"); + // Raise exception if H5Funmount returns negative value + if (ret_value < 0) + throwException("unmount", "H5Funmount failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::unmount -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::unmount +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::unmount( const H5std_string& name ) const +void H5Location::unmount(const H5std_string& name) const { - unmount( name.c_str() ); + unmount(name.c_str()); } #ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- -// Function: H5Location::iterateElems -///\brief Iterates a user's function over the entries of a group. -///\param name - IN : Name of group to iterate over -///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices -///\param op - IN : User's function to operate on each entry -///\param op_data - IN/OUT: Data associated with the operation -///\return The return value of the first operator that returns non-zero, -/// or zero if all members were processed with no operator -/// returning non-zero. -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::iterateElems +///\brief Iterates a user's function over the entries of a group. +///\param name - IN : Name of group to iterate over +///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices +///\param op - IN : User's function to operate on each entry +///\param op_data - IN/OUT: Data associated with the operation +///\return The return value of the first operator that returns non-zero, +/// or zero if all members were processed with no operator +/// returning non-zero. +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int H5Location::iterateElems( const char* name, int *idx, H5G_iterate_t op , void* op_data ) +int H5Location::iterateElems(const char* name, int *idx, H5G_iterate_t op , void* op_data) { - int ret_value = H5Giterate(getId(), name, idx, op, op_data ); - if( ret_value < 0 ) - { - throwException("iterateElems", "H5Giterate failed"); - } - return( ret_value ); + int ret_value = H5Giterate(getId(), name, idx, op, op_data); + if (ret_value < 0) + { + throwException("iterateElems", "H5Giterate failed"); + } + return(ret_value); } //-------------------------------------------------------------------------- -// Function: H5Location::iterateElems -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::iterateElems +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int H5Location::iterateElems( const H5std_string& name, int *idx, H5G_iterate_t op , void* op_data ) +int H5Location::iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op , void* op_data) { - return( iterateElems( name.c_str(), idx, op, op_data )); + return(iterateElems( name.c_str(), idx, op, op_data)); } #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- -// Function: H5Location::getNumObjs -///\brief Returns the number of objects in this group. -///\return Number of objects -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - January, 2003 +// Function: H5Location::getNumObjs +///\brief Returns the number of objects in this group. +///\return Number of objects +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- hsize_t H5Location::getNumObjs() const { - H5G_info_t ginfo; /* Group information */ + H5G_info_t ginfo; // Group information - herr_t ret_value = H5Gget_info(getId(), &ginfo); - if(ret_value < 0) - throwException("getNumObjs", "H5Gget_info failed"); - return (ginfo.nlinks); + herr_t ret_value = H5Gget_info(getId(), &ginfo); + if(ret_value < 0) + throwException("getNumObjs", "H5Gget_info failed"); + return (ginfo.nlinks); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjnameByIdx -///\brief Returns the name of an object in this group, given the -/// object's index. -///\param idx - IN: Transient index of the object -///\return Object name -///\exception H5::FileIException or H5::GroupIException +// Function: H5Location::getObjnameByIdx +///\brief Returns the name of an object in this group, given the +/// object's index. +///\param idx - IN: Transient index of the object +///\return Object name +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// The value of idx can be any nonnegative number less than the -/// total number of objects in the group, which is returned by -/// the function \c H5Location::getNumObjs. Note that this is a -/// transient index; thus, an object may have a different index -/// each time the group is opened. -// Programmer Binh-Minh Ribler - Mar, 2005 +/// The value of idx can be any nonnegative number less than the +/// total number of objects in the group, which is returned by +/// the function \c H5Location::getNumObjs. Note that this is a +/// transient index; thus, an object may have a different index +/// each time the group is opened. +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- H5std_string H5Location::getObjnameByIdx(hsize_t idx) const { // call H5Lget_name_by_idx with name as NULL to get its length ssize_t name_len = H5Lget_name_by_idx(getId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, NULL, 0, H5P_DEFAULT); if(name_len < 0) - throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); // now, allocate C buffer to get the name char* name_C = new char[name_len+1]; @@ -1328,8 +1327,8 @@ H5std_string H5Location::getObjnameByIdx(hsize_t idx) const if (name_len < 0) { - delete []name_C; - throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + delete []name_C; + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); } // clean up and return the string @@ -1339,74 +1338,74 @@ H5std_string H5Location::getObjnameByIdx(hsize_t idx) const } //-------------------------------------------------------------------------- -// Function: H5Location::getObjnameByIdx -///\brief Retrieves the name of an object in this group, given the -/// object's index. -///\param idx - IN: Transient index of the object -///\param name - IN/OUT: Retrieved name of the object -///\param size - IN: Length to retrieve -///\return Actual size of the object name or 0, if object has no name -///\exception H5::FileIException or H5::GroupIException +// Function: H5Location::getObjnameByIdx +///\brief Retrieves the name of an object in this group, given the +/// object's index. +///\param idx - IN: Transient index of the object +///\param name - IN/OUT: Retrieved name of the object +///\param size - IN: Length to retrieve +///\return Actual size of the object name or 0, if object has no name +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// The value of idx can be any nonnegative number less than the -/// total number of objects in the group, which is returned by -/// the function \c H5Location::getNumObjs. Note that this is a -/// transient index; thus, an object may have a different index -/// each time the group is opened. -// Programmer Binh-Minh Ribler - January, 2003 +/// The value of idx can be any nonnegative number less than the +/// total number of objects in the group, which is returned by +/// the function \c H5Location::getNumObjs. Note that this is a +/// transient index; thus, an object may have a different index +/// each time the group is opened. +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- ssize_t H5Location::getObjnameByIdx(hsize_t idx, char* name, size_t size) const { - ssize_t name_len = H5Lget_name_by_idx(getId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5P_DEFAULT); - if(name_len < 0) - throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + ssize_t name_len = H5Lget_name_by_idx(getId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5P_DEFAULT); + if(name_len < 0) + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); - return (name_len); + return (name_len); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjnameByIdx -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - January, 2003 +// Function: H5Location::getObjnameByIdx +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- ssize_t H5Location::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const { - char* name_C = new char[size+1]; // temporary C-string for object name - HDmemset(name_C, 0, size+1); // clear buffer + char* name_C = new char[size+1]; // temporary C-string for object name + HDmemset(name_C, 0, size+1); // clear buffer - // call overloaded function to get the name - ssize_t name_len = getObjnameByIdx(idx, name_C, size+1); - if(name_len < 0) - { + // call overloaded function to get the name + ssize_t name_len = getObjnameByIdx(idx, name_C, size+1); + if(name_len < 0) + { delete []name_C; - throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); - } - - // clean up and return the string - name = H5std_string(name_C); - delete []name_C; - return (name_len); -} - -//-------------------------------------------------------------------------- -// Function: H5Location::childObjType -///\brief Returns the type of an object in this file/group, given the -/// object's name. -///\param objname - IN: Name of the object -///\return Object type, which can have the following values for group, -/// dataset, and named datatype -/// \li \c H5O_TYPE_GROUP -/// \li \c H5O_TYPE_DATASET -/// \li \c H5O_TYPE_NAMED_DATATYPE -/// Refer to the C API documentation for more details: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo -///\exception H5::FileIException or H5::GroupIException -/// Exception will be thrown when: -/// - an error returned by the C API -/// - object type is not one of the valid values above -// Programmer Binh-Minh Ribler - April, 2014 + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + } + + // clean up and return the string + name = H5std_string(name_C); + delete []name_C; + return (name_len); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::childObjType +///\brief Returns the type of an object in this file/group, given the +/// object's name. +///\param objname - IN: Name of the object +///\return Object type, which can have the following values for group, +/// dataset, and named datatype +/// \li \c H5O_TYPE_GROUP +/// \li \c H5O_TYPE_DATASET +/// \li \c H5O_TYPE_NAMED_DATATYPE +/// Refer to the C API documentation for more details: +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo +///\exception H5::FileIException or H5::GroupIException +/// Exception will be thrown when: +/// - an error returned by the C API +/// - object type is not one of the valid values above +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- H5O_type_t H5Location::childObjType(const char* objname) const { @@ -1418,33 +1417,33 @@ H5O_type_t H5Location::childObjType(const char* objname) const // Throw exception if C API returns failure if (ret_value < 0) - throwException("childObjType", "H5Oget_info_by_name failed"); + throwException("childObjType", "H5Oget_info_by_name failed"); // Return a valid type or throw an exception for unknown type else - switch (objinfo.type) - { - case H5O_TYPE_GROUP: - case H5O_TYPE_DATASET: - case H5O_TYPE_NAMED_DATATYPE: - objtype = objinfo.type; - break; - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - throwException("childObjType", "Unknown type of object"); - } + switch (objinfo.type) + { + case H5O_TYPE_GROUP: + case H5O_TYPE_DATASET: + case H5O_TYPE_NAMED_DATATYPE: + objtype = objinfo.type; + break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: + throwException("childObjType", "Unknown type of object"); + } return(objtype); } //-------------------------------------------------------------------------- -// Function: H5Location::childObjType -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \a H5std_string for the object's name. -///\brief Returns the type of an object in this group, given the -/// object's name. -///\param objname - IN: Name of the object (H5std_string&) -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - April, 2014 +// Function: H5Location::childObjType +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \a H5std_string for the object's name. +///\brief Returns the type of an object in this group, given the +/// object's name. +///\param objname - IN: Name of the object (H5std_string&) +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- H5O_type_t H5Location::childObjType(const H5std_string& objname) const { @@ -1454,33 +1453,33 @@ H5O_type_t H5Location::childObjType(const H5std_string& objname) const } //-------------------------------------------------------------------------- -// Function: H5Location::childObjType -///\brief Returns the type of an object in this file/group, given the -/// object's index and its type and order. -///\param index - IN: Position of the object -///\param index_type - IN: Type of the index, default to H5_INDEX_NAME -///\param order - IN: Traversing order, default to H5_ITER_INC -///\param objname - IN: Name of the object, default to "." -///\return Object type, which can have the following values for group, -/// dataset, and named datatype -/// \li \c H5O_TYPE_GROUP -/// \li \c H5O_TYPE_DATASET -/// \li \c H5O_TYPE_NAMED_DATATYPE -/// Refer to the C API documentation for more details: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo -///\exception H5::FileIException or H5::GroupIException -/// Exception will be thrown when: -/// - an error returned by the C API -/// - object type is not one of the valid values above +// Function: H5Location::childObjType +///\brief Returns the type of an object in this file/group, given the +/// object's index and its type and order. +///\param index - IN: Position of the object +///\param index_type - IN: Type of the index, default to H5_INDEX_NAME +///\param order - IN: Traversing order, default to H5_ITER_INC +///\param objname - IN: Name of the object, default to "." +///\return Object type, which can have the following values for group, +/// dataset, and named datatype +/// \li \c H5O_TYPE_GROUP +/// \li \c H5O_TYPE_DATASET +/// \li \c H5O_TYPE_NAMED_DATATYPE +/// Refer to the C API documentation for more details: +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo +///\exception H5::FileIException or H5::GroupIException +/// Exception will be thrown when: +/// - an error returned by the C API +/// - object type is not one of the valid values above // Developer's Notes: -// - this overload uses H5Oget_info_by_idx instead of H5Oget_info_by_name -// like the previous childObjType() -// - index is the required argument so, first -// - objname is last because it's more likely the location is already -// fully specified -// - Leave property list out for now because C API is not using it, it -// can be added later when needed. -// Programmer Binh-Minh Ribler - April, 2014 +// - this overload uses H5Oget_info_by_idx instead of H5Oget_info_by_name +// like the previous childObjType() +// - index is the required argument so, first +// - objname is last because it's more likely the location is already +// fully specified +// - Leave property list out for now because C API is not using it, it +// can be added later when needed. +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- H5O_type_t H5Location::childObjType(hsize_t index, H5_index_t index_type, H5_iter_order_t order, const char* objname) const { @@ -1493,37 +1492,37 @@ H5O_type_t H5Location::childObjType(hsize_t index, H5_index_t index_type, H5_ite // Throw exception if C API returns failure if (ret_value < 0) - throwException("childObjType", "H5Oget_info_by_idx failed"); + throwException("childObjType", "H5Oget_info_by_idx failed"); // Return a valid type or throw an exception for unknown type else - switch (objinfo.type) - { - case H5O_TYPE_GROUP: - case H5O_TYPE_DATASET: - case H5O_TYPE_NAMED_DATATYPE: - objtype = objinfo.type; - break; - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - throwException("childObjType", "Unknown type of object"); - } + switch (objinfo.type) + { + case H5O_TYPE_GROUP: + case H5O_TYPE_DATASET: + case H5O_TYPE_NAMED_DATATYPE: + objtype = objinfo.type; + break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: + throwException("childObjType", "Unknown type of object"); + } return(objtype); } //-------------------------------------------------------------------------- -// Function: H5Location::childObjVersion -///\brief Returns the object header version of an object in this file/group, -/// given the object's name. -///\param objname - IN: Name of the object -///\return Object version, which can have the following values: -/// \li \c H5O_VERSION_1 -/// \li \c H5O_VERSION_2 -///\exception H5::FileIException or H5::GroupIException -/// Exception will be thrown when: -/// - an error returned by the C API -/// - version number is not one of the valid values above -// Programmer Binh-Minh Ribler - April, 2014 +// Function: H5Location::childObjVersion +///\brief Returns the object header version of an object in this file/group, +/// given the object's name. +///\param objname - IN: Name of the object +///\return Object version, which can have the following values: +/// \li \c H5O_VERSION_1 +/// \li \c H5O_VERSION_2 +///\exception H5::FileIException or H5::GroupIException +/// Exception will be thrown when: +/// - an error returned by the C API +/// - version number is not one of the valid values above +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- unsigned H5Location::childObjVersion(const char* objname) const { @@ -1535,26 +1534,26 @@ unsigned H5Location::childObjVersion(const char* objname) const // Throw exception if C API returns failure if (ret_value < 0) - throwException("childObjVersion", "H5Oget_info_by_name failed"); + throwException("childObjVersion", "H5Oget_info_by_name failed"); // Return a valid version or throw an exception for invalid value else { - version = objinfo.hdr.version; - if (version != H5O_VERSION_1 && version != H5O_VERSION_2) - throwException("childObjVersion", "Invalid version for object"); + version = objinfo.hdr.version; + if (version != H5O_VERSION_1 && version != H5O_VERSION_2) + throwException("childObjVersion", "Invalid version for object"); } return(version); } //-------------------------------------------------------------------------- -// Function: H5Location::childObjVersion -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \a H5std_string for the object's name. -///\brief Returns the type of an object in this group, given the -/// object's name. -///\param objname - IN: Name of the object (H5std_string&) -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - April, 2014 +// Function: H5Location::childObjVersion +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \a H5std_string for the object's name. +///\brief Returns the type of an object in this group, given the +/// object's name. +///\param objname - IN: Name of the object (H5std_string&) +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- unsigned H5Location::childObjVersion(const H5std_string& objname) const { @@ -1566,35 +1565,35 @@ unsigned H5Location::childObjVersion(const H5std_string& objname) const #ifndef H5_NO_DEPRECATED_SYMBOLS #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::getObjTypeByIdx -///\brief Returns the type of an object in this group, given the -/// object's index. -///\param idx - IN: Transient index of the object -///\return Object type -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - January, 2003 +// Function: H5Location::getObjTypeByIdx +///\brief Returns the type of an object in this group, given the +/// object's index. +///\param idx - IN: Transient index of the object +///\return Object type +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx) const { H5G_obj_t obj_type = H5Gget_objtype_by_idx(getId(), idx); if (obj_type == H5G_UNKNOWN) - throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); + throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); return (obj_type); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjTypeByIdx -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function because it also provides -/// the returned object type in text (char*) -///\param idx - IN: Transient index of the object -///\param type_name - OUT: Object type in text -///\return Object type -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - May, 2010 +// Function: H5Location::getObjTypeByIdx +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function because it also provides +/// the returned object type in text (char*) +///\param idx - IN: Transient index of the object +///\param type_name - OUT: Object type in text +///\return Object type +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - May, 2010 // Modification -// Modified to use the other function. -BMR, 2016/03/07 +// Modified to use the other function. -BMR, 2016/03/07 //-------------------------------------------------------------------------- H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, char* type_name) const { @@ -1602,32 +1601,32 @@ H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, char* type_name) const return(getObjTypeByIdx(idx, stype_name)); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjTypeByIdx -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function because it also provides -/// the returned object type in text (H5std_string&) -///\param idx - IN: Transient index of the object -///\param type_name - OUT: Object type in text -///\return Object type -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - January, 2003 +// Function: H5Location::getObjTypeByIdx +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function because it also provides +/// the returned object type in text (H5std_string&) +///\param idx - IN: Transient index of the object +///\param type_name - OUT: Object type in text +///\return Object type +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const { H5G_obj_t obj_type = H5Gget_objtype_by_idx(getId(), idx); switch (obj_type) { - case H5G_LINK: type_name = H5std_string("symbolic link"); break; - case H5G_GROUP: type_name = H5std_string("group"); break; - case H5G_DATASET: type_name = H5std_string("dataset"); break; - case H5G_TYPE: type_name = H5std_string("datatype"); break; - case H5G_UNKNOWN: - case H5G_UDLINK: - case H5G_RESERVED_5: - case H5G_RESERVED_6: - case H5G_RESERVED_7: - default: - throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); + case H5G_LINK: type_name = H5std_string("symbolic link"); break; + case H5G_GROUP: type_name = H5std_string("group"); break; + case H5G_DATASET: type_name = H5std_string("dataset"); break; + case H5G_TYPE: type_name = H5std_string("datatype"); break; + case H5G_UNKNOWN: + case H5G_UDLINK: + case H5G_RESERVED_5: + case H5G_RESERVED_6: + case H5G_RESERVED_7: + default: + throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); } return (obj_type); } @@ -1645,34 +1644,34 @@ H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) cons //-------------------------------------------------------------------------- void H5Location::throwException(const H5std_string& func_name, const H5std_string& msg) const { - throwException(func_name, msg); + throwException(func_name, msg); } //-------------------------------------------------------------------------- -// Function: f_DataSet_setId - friend +// Function: f_DataSet_setId - friend // Modification: -// Moved to H5CommonFG.cpp after the rearrangement of classes -// -BMR, Dec 2016 +// Moved to H5CommonFG.cpp after the rearrangement of classes +// -BMR, Dec 2016 //-------------------------------------------------------------------------- // end of From H5CommonFG.cpp //-------------------------------------------------------------------------- -// Function: f_Attribute_setId - friend +// Function: f_Attribute_setId - friend // Modification: -// Moved to H5Object.cpp after the rearrangement of classes -// -BMR, Dec 2016 +// Moved to H5Object.cpp after the rearrangement of classes +// -BMR, Dec 2016 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: f_DataSpace_setId - friend -// Purpose: This function is friend to class H5::DataSpace so that it can -// can set DataSpace::id in order to work around a problem -// described in the JIRA issue HDFFV-7947. -// Applications shouldn't need to use it. -// param dspace - IN/OUT: DataSpace object to be changed -// param new_id - IN: New id to set -// Programmer Binh-Minh Ribler - 2015 +// Function: f_DataSpace_setId - friend +// Purpose This function is friend to class H5::DataSpace so that it can +// can set DataSpace::id in order to work around a problem +// described in the JIRA issue HDFFV-7947. +// Applications shouldn't need to use it. +// param dspace - IN/OUT: DataSpace object to be changed +// param new_id - IN: New id to set +// Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- void f_DataSpace_setId(DataSpace* dspace, hid_t new_id) { @@ -1680,9 +1679,9 @@ void f_DataSpace_setId(DataSpace* dspace, hid_t new_id) } //-------------------------------------------------------------------------- -// Function: H5Location destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Location::~H5Location() {} diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 6a449dc..337a2b3 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -17,7 +17,7 @@ #ifndef __H5Location_H #define __H5Location_H -#include "H5Classes.h" // constains forward class declarations +#include "H5Classes.h" // constains forward class declarations namespace H5 { @@ -37,188 +37,188 @@ class H5_DLLCPP LinkAccPropList; class H5_DLLCPP VarLenType; class H5_DLLCPP H5Location : public IdComponent { public: - // Checks if a link of a given name exists in a location - bool exists(const char* name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; - bool exists(const H5std_string& name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + // Checks if a link of a given name exists in a location + bool exists(const char* name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + bool exists(const H5std_string& name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; - // Flushes all buffers associated with this location to disk. - void flush( H5F_scope_t scope ) const; + // Flushes all buffers associated with this location to disk. + void flush(H5F_scope_t scope) const; - // Gets the name of the file, specified by this location. - H5std_string getFileName() const; + // Gets the name of the file, specified by this location. + H5std_string getFileName() const; #ifndef H5_NO_DEPRECATED_SYMBOLS - // Retrieves the type of object that an object reference points to. - H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const; + // Retrieves the type of object that an object reference points to. + H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const; #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Retrieves the type of object that an object reference points to. - H5O_type_t getRefObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const; - // Note: getRefObjType deprecates getObjType, but getObjType's name is - // misleading, so getRefObjType is used in the new function instead. - - // Sets the comment for an HDF5 object specified by its name. - void setComment(const char* name, const char* comment) const; - void setComment(const H5std_string& name, const H5std_string& comment) const; - void setComment(const char* comment) const; - void setComment(const H5std_string& comment) const; - - // Retrieves comment for the HDF5 object specified by its name. - ssize_t getComment(const char* name, size_t buf_size, char* comment) const; - H5std_string getComment(const char* name, size_t buf_size=0) const; - H5std_string getComment(const H5std_string& name, size_t buf_size=0) const; - - // Removes the comment for the HDF5 object specified by its name. - void removeComment(const char* name) const; - void removeComment(const H5std_string& name) const; - - // Creates a reference to a named object or to a dataset region - // in this object. - void reference(void* ref, const char* name, - H5R_type_t ref_type = H5R_OBJECT) const; - void reference(void* ref, const H5std_string& name, - H5R_type_t ref_type = H5R_OBJECT) const; - void reference(void* ref, const char* name, const DataSpace& dataspace, - H5R_type_t ref_type = H5R_DATASET_REGION) const; - void reference(void* ref, const H5std_string& name, const DataSpace& dataspace, - H5R_type_t ref_type = H5R_DATASET_REGION) const; - - // Open a referenced object whose location is specified by either - // a file, an HDF5 object, or an attribute. - void dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); - //void dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); - - // Retrieves a dataspace with the region pointed to selected. - DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; + // Retrieves the type of object that an object reference points to. + H5O_type_t getRefObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const; + // Note: getRefObjType deprecates getObjType, but getObjType's name is + // misleading, so getRefObjType is used in the new function instead. + + // Sets the comment for an HDF5 object specified by its name. + void setComment(const char* name, const char* comment) const; + void setComment(const H5std_string& name, const H5std_string& comment) const; + void setComment(const char* comment) const; + void setComment(const H5std_string& comment) const; + + // Retrieves comment for the HDF5 object specified by its name. + ssize_t getComment(const char* name, size_t buf_size, char* comment) const; + H5std_string getComment(const char* name, size_t buf_size=0) const; + H5std_string getComment(const H5std_string& name, size_t buf_size=0) const; + + // Removes the comment for the HDF5 object specified by its name. + void removeComment(const char* name) const; + void removeComment(const H5std_string& name) const; + + // Creates a reference to a named object or to a dataset region + // in this object. + void reference(void* ref, const char* name, + H5R_type_t ref_type = H5R_OBJECT) const; + void reference(void* ref, const H5std_string& name, + H5R_type_t ref_type = H5R_OBJECT) const; + void reference(void* ref, const char* name, const DataSpace& dataspace, + H5R_type_t ref_type = H5R_DATASET_REGION) const; + void reference(void* ref, const H5std_string& name, const DataSpace& dataspace, + H5R_type_t ref_type = H5R_DATASET_REGION) const; + + // Open a referenced object whose location is specified by either + // a file, an HDF5 object, or an attribute. + void dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + //void dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + + // Retrieves a dataspace with the region pointed to selected. + DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; // From CommonFG - // Creates a new group at this location which can be a file - // or another group. - Group createGroup(const char* name, size_t size_hint = 0) const; - Group createGroup(const H5std_string& name, size_t size_hint = 0) const; - - // Opens an existing group in a location which can be a file - // or another group. - Group openGroup(const char* name) const; - Group openGroup(const H5std_string& name) const; - - // Creates a new dataset in this group. - DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; - DataSet createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; - - // Opens an existing dataset at this location. - DataSet openDataSet(const char* name) const; - DataSet openDataSet(const H5std_string& name) const; - - // Returns the value of a symbolic link. - H5std_string getLinkval(const char* link_name, size_t size=0) const; - H5std_string getLinkval(const H5std_string& link_name, size_t size=0) const; - - // Returns the number of objects in this group. - hsize_t getNumObjs() const; - - // Retrieves the name of an object in this group, given the - // object's index. - H5std_string getObjnameByIdx(hsize_t idx) const; - ssize_t getObjnameByIdx(hsize_t idx, char* name, size_t size) const; - ssize_t getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const; - - // Retrieves the type of an object in this file or group, given the - // object's name - H5O_type_t childObjType(const H5std_string& objname) const; - H5O_type_t childObjType(const char* objname) const; - H5O_type_t childObjType(hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char* objname=".") const; - - // Returns the object header version of an object in this file or group, - // given the object's name. - unsigned childObjVersion(const char* objname) const; - unsigned childObjVersion(const H5std_string& objname) const; + // Creates a new group at this location which can be a file + // or another group. + Group createGroup(const char* name, size_t size_hint = 0) const; + Group createGroup(const H5std_string& name, size_t size_hint = 0) const; + + // Opens an existing group in a location which can be a file + // or another group. + Group openGroup(const char* name) const; + Group openGroup(const H5std_string& name) const; + + // Creates a new dataset in this group. + DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; + DataSet createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; + + // Opens an existing dataset at this location. + DataSet openDataSet(const char* name) const; + DataSet openDataSet(const H5std_string& name) const; + + // Returns the value of a symbolic link. + H5std_string getLinkval(const char* link_name, size_t size=0) const; + H5std_string getLinkval(const H5std_string& link_name, size_t size=0) const; + + // Returns the number of objects in this group. + hsize_t getNumObjs() const; + + // Retrieves the name of an object in this group, given the + // object's index. + H5std_string getObjnameByIdx(hsize_t idx) const; + ssize_t getObjnameByIdx(hsize_t idx, char* name, size_t size) const; + ssize_t getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const; + + // Retrieves the type of an object in this file or group, given the + // object's name + H5O_type_t childObjType(const H5std_string& objname) const; + H5O_type_t childObjType(const char* objname) const; + H5O_type_t childObjType(hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char* objname=".") const; + + // Returns the object header version of an object in this file or group, + // given the object's name. + unsigned childObjVersion(const char* objname) const; + unsigned childObjVersion(const H5std_string& objname) const; #ifndef H5_NO_DEPRECATED_SYMBOLS - // Returns the type of an object in this group, given the - // object's index. - H5G_obj_t getObjTypeByIdx(hsize_t idx) const; - H5G_obj_t getObjTypeByIdx(hsize_t idx, char* type_name) const; - H5G_obj_t getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const; - - // Returns information about an HDF5 object, given by its name, - // at this location. - void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const; - void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const; - void getObjinfo(const char* name, H5G_stat_t& statbuf) const; - void getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const; - - // Iterates over the elements of this group - not implemented in - // C++ style yet. - int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data); - int iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op, void *op_data); + // Returns the type of an object in this group, given the + // object's index. + H5G_obj_t getObjTypeByIdx(hsize_t idx) const; + H5G_obj_t getObjTypeByIdx(hsize_t idx, char* type_name) const; + H5G_obj_t getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const; + + // Returns information about an HDF5 object, given by its name, + // at this location. + void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const; + void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const; + void getObjinfo(const char* name, H5G_stat_t& statbuf) const; + void getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const; + + // Iterates over the elements of this group - not implemented in + // C++ style yet. + int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data); + int iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op, void *op_data); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Creates a link of the specified type from new_name to current_name; - // both names are interpreted relative to the specified location id. - void link(H5L_type_t link_type, const char* curr_name, const char* new_name) const; - void link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const; + // Creates a link of the specified type from new_name to current_name; + // both names are interpreted relative to the specified location id. + void link(H5L_type_t link_type, const char* curr_name, const char* new_name) const; + void link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const; - // Removes the specified name at this location. - void unlink(const char* name) const; - void unlink(const H5std_string& name) const; + // Removes the specified name at this location. + void unlink(const char* name) const; + void unlink(const H5std_string& name) const; - // Mounts the file 'child' onto this location. - void mount(const char* name, const H5File& child, const PropList& plist) const; - //void mount(const char* name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 - void mount(const H5std_string& name, const H5File& child, const PropList& plist) const; - //void mount(const H5std_string& name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 + // Mounts the file 'child' onto this location. + void mount(const char* name, const H5File& child, const PropList& plist) const; + //void mount(const char* name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 + void mount(const H5std_string& name, const H5File& child, const PropList& plist) const; + //void mount(const H5std_string& name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 - // Unmounts the file named 'name' from this parent location. - void unmount(const char* name) const; - void unmount(const H5std_string& name) const; + // Unmounts the file named 'name' from this parent location. + void unmount(const char* name) const; + void unmount(const H5std_string& name) const; - // Renames an object at this location. - void move(const char* src, const char* dst) const; - void move(const H5std_string& src, const H5std_string& dst) const; + // Renames an object at this location. + void move(const char* src, const char* dst) const; + void move(const H5std_string& src, const H5std_string& dst) const; // end From CommonFG - /// For subclasses, H5File and Group, to throw appropriate exception. - virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; + /// For subclasses, H5File and Group, to throw appropriate exception. + virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; - // Default constructor - H5Location(); + // Default constructor + H5Location(); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - // *** Deprecation warning *** - // The following two constructors are no longer appropriate after the - // data member "id" had been moved to the sub-classes. - // The copy constructor is a noop and is removed in 1.8.15 and the - // other will be removed from 1.10 release, and then from 1.8 if its - // removal does not raise any problems in two 1.10 releases. + // *** Deprecation warning *** + // The following two constructors are no longer appropriate after the + // data member "id" had been moved to the sub-classes. + // The copy constructor is a noop and is removed in 1.8.15 and the + // other will be removed from 1.10 release, and then from 1.8 if its + // removal does not raise any problems in two 1.10 releases. - // Creates a copy of an existing object giving the location id. - H5Location(const hid_t loc_id); + // Creates a copy of an existing object giving the location id. + H5Location(const hid_t loc_id); - // Creates a reference to an HDF5 object or a dataset region. - void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const; + // Creates a reference to an HDF5 object or a dataset region. + void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const; - // Dereferences a ref into an HDF5 id. - hid_t p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const PropList& plist, const char* from_func); + // Dereferences a ref into an HDF5 id. + hid_t p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const PropList& plist, const char* from_func); #ifndef H5_NO_DEPRECATED_SYMBOLS - // Retrieves the type of object that an object reference points to. - H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const; + // Retrieves the type of object that an object reference points to. + H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const; #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Retrieves the type of object that an object reference points to. - H5O_type_t p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const; + // Retrieves the type of object that an object reference points to. + H5O_type_t p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const; - // Sets the identifier of this object to a new value. - this one - // doesn't increment reference count - //virtual void p_setId(const hid_t new_id); + // Sets the identifier of this object to a new value. - this one + // doesn't increment reference count + //virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS - // Noop destructor. - virtual ~H5Location(); + // Noop destructor. + virtual ~H5Location(); }; /* end class H5Location */ diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 48d81f8..b5d0f88 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -15,7 +15,7 @@ #include -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -46,25 +46,25 @@ namespace H5 { extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name, const H5A_info_t *ainfo, void *op_data) { - H5std_string s_attr_name = H5std_string( attr_name ); + H5std_string s_attr_name = H5std_string(attr_name); UserData4Aiterate* myData = reinterpret_cast (op_data); - myData->op( *myData->location, s_attr_name, myData->opData ); + myData->op(*myData->location, s_attr_name, myData->opData); return 0; } #endif //-------------------------------------------------------------------------- -// Function: H5Object default constructor (protected) -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object default constructor (protected) +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Object::H5Object() : H5Location() {} //-------------------------------------------------------------------------- -// Function: H5Object overloaded constructor (protected) -// Purpose Creates an H5Object object using the id of an existing HDF5 -// object. -// Parameters object_id - IN: Id of an existing HDF5 object -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object overloaded constructor (protected) +// Purpose Creates an H5Object object using the id of an existing HDF5 +// object. +// Parameters object_id - IN: Id of an existing HDF5 object +// Programmer Binh-Minh Ribler - 2000 // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had // been moved to the sub-classes. It will be removed in 1.10 release. If its @@ -75,11 +75,11 @@ H5Object::H5Object() : H5Location() {} //H5Object::H5Object(const hid_t object_id) : H5Location() {} //-------------------------------------------------------------------------- -// Function: H5Object copy constructor -///\brief Copy constructor: makes a copy of the original H5Object -/// instance. -///\param original - IN: H5Object instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object copy constructor +///\brief Copy constructor: makes a copy of the original H5Object +/// instance. +///\param original - IN: H5Object instance to copy +// Programmer Binh-Minh Ribler - 2000 // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had // been moved to the sub-classes. It is removed from 1.8.15 because it is @@ -103,158 +103,157 @@ void f_Attribute_setId(Attribute* attr, hid_t new_id) } //-------------------------------------------------------------------------- -// Function: H5Object::createAttribute -///\brief Creates an attribute for a group, dataset, or named datatype. -///\param name - IN: Name of the attribute -///\param data_type - IN: Datatype for the attribute -///\param data_space - IN: Dataspace for the attribute - only simple -/// dataspaces are allowed at this time -///\param create_plist - IN: Creation property list - default to -/// PropList::DEFAULT -///\return Attribute instance -///\exception H5::AttributeIException +// Function: H5Object::createAttribute +///\brief Creates an attribute for a group, dataset, or named datatype. +///\param name - IN: Name of the attribute +///\param data_type - IN: Datatype for the attribute +///\param data_space - IN: Dataspace for the attribute - only simple +/// dataspaces are allowed at this time +///\param create_plist - IN: Creation property list - default to +/// PropList::DEFAULT +///\return Attribute instance +///\exception H5::AttributeIException ///\par Description -/// The attribute name specified in \a name must be unique. -/// Attempting to create an attribute with the same name as an -/// existing attribute will raise an exception, leaving the -/// pre-existing attribute intact. To overwrite an existing -/// attribute with a new attribute of the same name, first -/// delete the existing one with \c H5Object::removeAttr, then -/// recreate it with this function. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -Attribute H5Object::createAttribute( const char* name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const +/// The attribute name specified in \a name must be unique. +/// Attempting to create an attribute with the same name as an +/// existing attribute will raise an exception, leaving the +/// pre-existing attribute intact. To overwrite an existing +/// attribute with a new attribute of the same name, first +/// delete the existing one with \c H5Object::removeAttr, then +/// recreate it with this function. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +Attribute H5Object::createAttribute(const char* name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist) const { - hid_t type_id = data_type.getId(); - hid_t space_id = data_space.getId(); - hid_t plist_id = create_plist.getId(); - hid_t attr_id = H5Acreate2(getId(), name, type_id, space_id, plist_id, H5P_DEFAULT ); - - // If the attribute id is valid, create and return the Attribute object - if( attr_id > 0 ) - { - Attribute attr; - f_Attribute_setId(&attr, attr_id); - return( attr ); - } - else - throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed"); + hid_t type_id = data_type.getId(); + hid_t space_id = data_space.getId(); + hid_t plist_id = create_plist.getId(); + hid_t attr_id = H5Acreate2(getId(), name, type_id, space_id, plist_id, H5P_DEFAULT); + + // If the attribute id is valid, create and return the Attribute object + if (attr_id > 0) + { + Attribute attr; + f_Attribute_setId(&attr, attr_id); + return(attr); + } + else + throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed"); } //-------------------------------------------------------------------------- -// Function: H5Object::createAttribute -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::createAttribute +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Object::createAttribute( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const +Attribute H5Object::createAttribute(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist) const { - return( createAttribute( name.c_str(), data_type, data_space, create_plist )); + return(createAttribute( name.c_str(), data_type, data_space, create_plist)); } //-------------------------------------------------------------------------- -// Function: H5Object::openAttribute -///\brief Opens an attribute given its name. -///\param name - IN: Name of the attribute -///\return Attribute instance -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::openAttribute +///\brief Opens an attribute given its name. +///\param name - IN: Name of the attribute +///\return Attribute instance +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Object::openAttribute( const char* name ) const +Attribute H5Object::openAttribute(const char* name) const { - hid_t attr_id = H5Aopen(getId(), name, H5P_DEFAULT); - if( attr_id > 0 ) - { - Attribute attr; - f_Attribute_setId(&attr, attr_id); - return( attr ); - } - else - { - throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen failed"); - } + hid_t attr_id = H5Aopen(getId(), name, H5P_DEFAULT); + if (attr_id > 0) + { + Attribute attr; + f_Attribute_setId(&attr, attr_id); + return(attr); + } + else + { + throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Object::openAttribute -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::openAttribute +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Object::openAttribute( const H5std_string& name ) const +Attribute H5Object::openAttribute(const H5std_string& name) const { - return( openAttribute( name.c_str()) ); + return(openAttribute( name.c_str())); } //-------------------------------------------------------------------------- -// Function: H5Object::openAttribute -///\brief Opens an attribute given its index. -///\param idx - IN: Index of the attribute, a 0-based, non-negative integer -///\return Attribute instance -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::openAttribute +///\brief Opens an attribute given its index. +///\param idx - IN: Index of the attribute, a 0-based, non-negative integer +///\return Attribute instance +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Object::openAttribute( const unsigned int idx ) const +Attribute H5Object::openAttribute(const unsigned int idx) const { - hid_t attr_id = H5Aopen_by_idx(getId(), ".", H5_INDEX_CRT_ORDER, - H5_ITER_INC, static_cast(idx), H5P_DEFAULT, H5P_DEFAULT); - if( attr_id > 0 ) - { - Attribute attr; - f_Attribute_setId(&attr, attr_id); - return(attr); - } - else - { - throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed"); - } + hid_t attr_id = H5Aopen_by_idx(getId(), ".", H5_INDEX_CRT_ORDER, + H5_ITER_INC, static_cast(idx), H5P_DEFAULT, H5P_DEFAULT); + if (attr_id > 0) + { + Attribute attr; + f_Attribute_setId(&attr, attr_id); + return(attr); + } + else + { + throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Object::iterateAttrs -///\brief Iterates a user's function over all the attributes of an H5 -/// object, which may be a group, dataset or named datatype. -///\param user_op - IN: User's function to operate on each attribute -///\param _idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices -///\param op_data - IN: User's data to pass to user's operator function -///\return Returned value of the last operator if it was non-zero, or -/// zero if all attributes were processed -///\exception H5::AttributeIException +// Function: H5Object::iterateAttrs +///\brief Iterates a user's function over all the attributes of an H5 +/// object, which may be a group, dataset or named datatype. +///\param user_op - IN: User's function to operate on each attribute +///\param _idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices +///\param op_data - IN: User's data to pass to user's operator function +///\return Returned value of the last operator if it was non-zero, or +/// zero if all attributes were processed +///\exception H5::AttributeIException ///\par Description -/// The signature of user_op is -/// void (*)(H5::H5Location&, H5std_string, void*). -/// For information, please refer to the C layer Reference Manual -/// at: +/// The signature of user_op is +/// void (*)(H5::H5Location&, H5std_string, void*). +/// For information, please refer to the C layer Reference Manual +/// at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5A.html#Annot-Iterate -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int H5Object::iterateAttrs( attr_operator_t user_op, unsigned *_idx, void *op_data ) +int H5Object::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_data) { - // store the user's function and data - UserData4Aiterate* userData = new UserData4Aiterate; - userData->opData = op_data; - userData->op = user_op; - userData->location = this; - - // call the C library routine H5Aiterate2 to iterate the attributes - hsize_t idx = _idx ? static_cast(*_idx) : 0; - int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, - userAttrOpWrpr, reinterpret_cast(userData)); - - // release memory - delete userData; - - if( ret_value >= 0 ) { - /* Pass back update index value to calling code */ - if (_idx) - *_idx = static_cast(idx); - - return( ret_value ); - } - else // raise exception when H5Aiterate returns a negative value - throw AttributeIException(inMemFunc("iterateAttrs"), "H5Aiterate2 failed"); + // store the user's function and data + UserData4Aiterate* userData = new UserData4Aiterate; + userData->opData = op_data; + userData->op = user_op; + userData->location = this; + + // call the C library routine H5Aiterate2 to iterate the attributes + hsize_t idx = _idx ? static_cast(*_idx) : 0; + int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, + userAttrOpWrpr, reinterpret_cast(userData)); + + // release memory + delete userData; + + if (ret_value >= 0) { + /* Pass back update index value to calling code */ + if (_idx) + *_idx = static_cast(idx); + return(ret_value); + } + else // raise exception when H5Aiterate returns a negative value + throw AttributeIException(inMemFunc("iterateAttrs"), "H5Aiterate2 failed"); } //-------------------------------------------------------------------------- @@ -291,106 +290,106 @@ unsigned H5Object::objVersion() const } //-------------------------------------------------------------------------- -// Function: H5Object::getNumAttrs -///\brief Returns the number of attributes attached to this HDF5 object. -///\return Number of attributes -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::getNumAttrs +///\brief Returns the number of attributes attached to this HDF5 object. +///\return Number of attributes +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int H5Object::getNumAttrs() const { - H5O_info_t oinfo; /* Object info */ + H5O_info_t oinfo; /* Object info */ - if(H5Oget_info(getId(), &oinfo) < 0) - throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed"); - else - return(static_cast(oinfo.num_attrs)); + if(H5Oget_info(getId(), &oinfo) < 0) + throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed"); + else + return(static_cast(oinfo.num_attrs)); } //-------------------------------------------------------------------------- -// Function: H5Object::attrExists -///\brief Checks whether the named attribute exists at this location. -///\param name - IN: Name of the attribute to be queried -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2013 +// Function: H5Object::attrExists +///\brief Checks whether the named attribute exists at this location. +///\param name - IN: Name of the attribute to be queried +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2013 //-------------------------------------------------------------------------- bool H5Object::attrExists(const char* name) const { - // Call C routine H5Aexists to determine whether an attribute exists - // at this location, which could be specified by a file, group, dataset, - // or named datatype. - herr_t ret_value = H5Aexists(getId(), name); - if( ret_value > 0 ) - return true; - else if(ret_value == 0) - return false; - else // Raise exception when H5Aexists returns a negative value - throw AttributeIException(inMemFunc("attrExists"), "H5Aexists failed"); + // Call C routine H5Aexists to determine whether an attribute exists + // at this location, which could be specified by a file, group, dataset, + // or named datatype. + herr_t ret_value = H5Aexists(getId(), name); + if (ret_value > 0) + return true; + else if(ret_value == 0) + return false; + else // Raise exception when H5Aexists returns a negative value + throw AttributeIException(inMemFunc("attrExists"), "H5Aexists failed"); } //-------------------------------------------------------------------------- -// Function: H5Object::attrExists -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::attrExists +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool H5Object::attrExists(const H5std_string& name) const { - return(attrExists(name.c_str())); + return(attrExists(name.c_str())); } //-------------------------------------------------------------------------- -// Function: H5Object::removeAttr -///\brief Removes the named attribute from this object. -///\param name - IN: Name of the attribute to be removed -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::removeAttr +///\brief Removes the named attribute from this object. +///\param name - IN: Name of the attribute to be removed +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Object::removeAttr( const char* name ) const +void H5Object::removeAttr(const char* name) const { - herr_t ret_value = H5Adelete(getId(), name); - if( ret_value < 0 ) - throw AttributeIException(inMemFunc("removeAttr"), "H5Adelete failed"); + herr_t ret_value = H5Adelete(getId(), name); + if (ret_value < 0) + throw AttributeIException(inMemFunc("removeAttr"), "H5Adelete failed"); } //-------------------------------------------------------------------------- -// Function: H5Object::removeAttr -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::removeAttr +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Object::removeAttr( const H5std_string& name ) const +void H5Object::removeAttr(const H5std_string& name) const { - removeAttr( name.c_str() ); + removeAttr(name.c_str()); } //-------------------------------------------------------------------------- -// Function: H5Object::renameAttr -///\brief Renames the named attribute from this object. -///\param oldname - IN: Name of the attribute to be renamed -///\param newname - IN: New name ame of the attribute -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: H5Object::renameAttr +///\brief Renames the named attribute from this object. +///\param oldname - IN: Name of the attribute to be renamed +///\param newname - IN: New name ame of the attribute +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- void H5Object::renameAttr(const char* oldname, const char* newname) const { - herr_t ret_value = H5Arename(getId(), oldname, newname); - if (ret_value < 0) - throw AttributeIException(inMemFunc("renameAttr"), "H5Arename failed"); + herr_t ret_value = H5Arename(getId(), oldname, newname); + if (ret_value < 0) + throw AttributeIException(inMemFunc("renameAttr"), "H5Arename failed"); } //-------------------------------------------------------------------------- -// Function: H5Object::renameAttr -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for the names. -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: H5Object::renameAttr +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for the names. +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- void H5Object::renameAttr(const H5std_string& oldname, const H5std_string& newname) const { - renameAttr (oldname.c_str(), newname.c_str()); + renameAttr (oldname.c_str(), newname.c_str()); } //-------------------------------------------------------------------------- // Function: getObjName @@ -405,11 +404,11 @@ ssize_t H5Object::getObjName(char *obj_name, size_t buf_size) const // If H5Iget_name returns a negative value, raise an exception if (name_size < 0) - { + { throw Exception(inMemFunc("getObjName"), "H5Iget_name failed"); } else if (name_size == 0) - { + { throw Exception(inMemFunc("getObjName"), "Object must have a name, but name length is 0"); } // Return length of the name @@ -433,16 +432,16 @@ H5std_string H5Object::getObjName() const // If H5Iget_name failed, throw exception if (name_size < 0) - { + { throw Exception(inMemFunc("getObjName"), "H5Iget_name failed"); } else if (name_size == 0) - { + { throw Exception(inMemFunc("getObjName"), "Object must have a name, but name length is 0"); } // Object's name exists, retrieve it else if (name_size > 0) - { + { char* name_C = new char[name_size+1]; // temporary C-string HDmemset(name_C, 0, name_size+1); // clear buffer @@ -478,13 +477,13 @@ ssize_t H5Object::getObjName(H5std_string& obj_name, size_t len) const // If no length is provided, get the entire object name if (len == 0) - { + { obj_name = getObjName(); name_size = obj_name.length(); } // If length is provided, get that number of characters in name else - { + { char* name_C = new char[len+1]; // temporary C-string HDmemset(name_C, 0, len+1); // clear buffer @@ -505,9 +504,9 @@ ssize_t H5Object::getObjName(H5std_string& obj_name, size_t len) const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Object destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Object::~H5Object() {} #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 5ea8937..866d739 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -24,20 +24,20 @@ namespace H5 { and Group. Modification: - Sept 18, 2012: Added class H5Location in between IdComponent and - H5Object. An H5File now inherits from H5Location. All HDF5 - wrappers in H5Object are moved up to H5Location. H5Object - is left mostly empty for future wrappers that are only for - group, dataset, and named datatype. Note that the reason for - adding H5Location instead of simply moving H5File to be under - H5Object is H5File is not an HDF5 object, and renaming H5Object - to H5Location will risk breaking user applications. - -BMR - Apr 2, 2014: Added wrapper getObjName for H5Iget_name - Sep 21, 2016: Rearranging classes (HDFFV-9920) moved H5A wrappers back - into H5Object. This way, C functions that takes attribute id - can be in H5Location and those that cannot take attribute id - can be in H5Object. + Sept 18, 2012: Added class H5Location in between IdComponent and + H5Object. An H5File now inherits from H5Location. All HDF5 + wrappers in H5Object are moved up to H5Location. H5Object + is left mostly empty for future wrappers that are only for + group, dataset, and named datatype. Note that the reason for + adding H5Location instead of simply moving H5File to be under + H5Object is H5File is not an HDF5 object, and renaming H5Object + to H5Location will risk breaking user applications. + -BMR + Apr 2, 2014: Added wrapper getObjName for H5Iget_name + Sep 21, 2016: Rearranging classes (HDFFV-9920) moved H5A wrappers back + into H5Object. This way, C functions that takes attribute id + can be in H5Location and those that cannot take attribute id + can be in H5Object. Inheritance: H5Location -> IdComponent */ @@ -46,88 +46,88 @@ class H5_DLLCPP H5Object; class H5_DLLCPP Attribute; // Define the operator function pointer for H5Aiterate(). -typedef void (*attr_operator_t)( H5Object& loc/*in*/, +typedef void (*attr_operator_t)(H5Object& loc/*in*/, const H5std_string attr_name/*in*/, void *operator_data/*in,out*/); // User data for attribute iteration class UserData4Aiterate { public: - attr_operator_t op; - void* opData; - H5Object* location; + attr_operator_t op; + void* opData; + H5Object* location; }; class H5_DLLCPP H5Object : public H5Location { public: - // Creates an attribute for the specified object - // PropList is currently not used, so always be default. - Attribute createAttribute( const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const; - Attribute createAttribute( const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const; + // Creates an attribute for the specified object + // PropList is currently not used, so always be default. + Attribute createAttribute(const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; + Attribute createAttribute(const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; - // Given its name, opens the attribute that belongs to an object at - // this location. - Attribute openAttribute( const char* name ) const; - Attribute openAttribute( const H5std_string& name ) const; + // Given its name, opens the attribute that belongs to an object at + // this location. + Attribute openAttribute(const char* name) const; + Attribute openAttribute(const H5std_string& name) const; - // Given its index, opens the attribute that belongs to an object at - // this location. - Attribute openAttribute( const unsigned int idx ) const; + // Given its index, opens the attribute that belongs to an object at + // this location. + Attribute openAttribute(const unsigned int idx) const; - // Iterate user's function over the attributes of this object. - int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL); + // Iterate user's function over the attributes of this object. + int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL); - // Returns the object header version of an object - unsigned objVersion() const; + // Returns the object header version of an object + unsigned objVersion() const; - // Determines the number of attributes belong to this object. - int getNumAttrs() const; + // Determines the number of attributes belong to this object. + int getNumAttrs() const; - // Checks whether the named attribute exists for this object. - bool attrExists(const char* name) const; - bool attrExists(const H5std_string& name) const; + // Checks whether the named attribute exists for this object. + bool attrExists(const char* name) const; + bool attrExists(const H5std_string& name) const; - // Renames the named attribute to a new name. - void renameAttr(const char* oldname, const char* newname) const; - void renameAttr(const H5std_string& oldname, const H5std_string& newname) const; + // Renames the named attribute to a new name. + void renameAttr(const char* oldname, const char* newname) const; + void renameAttr(const H5std_string& oldname, const H5std_string& newname) const; - // Removes the named attribute from this object. - void removeAttr(const char* name) const; - void removeAttr(const H5std_string& name) const; + // Removes the named attribute from this object. + void removeAttr(const char* name) const; + void removeAttr(const H5std_string& name) const; - // Returns an identifier. - virtual hid_t getId() const = 0; + // Returns an identifier. + virtual hid_t getId() const = 0; #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Gets the name of this HDF5 object, i.e., Group, DataSet, or - // DataType. These should have const but are retiring anyway. - ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; - ssize_t getObjName(H5std_string& obj_name, size_t len = 0) const; - H5std_string getObjName() const; + // Gets the name of this HDF5 object, i.e., Group, DataSet, or + // DataType. These should have const but are retiring anyway. + ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; + ssize_t getObjName(H5std_string& obj_name, size_t len = 0) const; + H5std_string getObjName() const; protected: - // Default constructor - H5Object(); + // Default constructor + H5Object(); - // *** Deprecation warning *** - // The following two constructors are no longer appropriate after the - // data member "id" had been moved to the sub-classes. - // The copy constructor is a noop and is removed in 1.8.15 and the - // other will be removed from 1.10 release, and then from 1.8 if its - // removal does not raise any problems in two 1.10 releases. + // *** Deprecation warning *** + // The following two constructors are no longer appropriate after the + // data member "id" had been moved to the sub-classes. + // The copy constructor is a noop and is removed in 1.8.15 and the + // other will be removed from 1.10 release, and then from 1.8 if its + // removal does not raise any problems in two 1.10 releases. - // Creates a copy of an existing object giving the object id - H5Object( const hid_t object_id ); + // Creates a copy of an existing object giving the object id + H5Object(const hid_t object_id); - // Copy constructor: makes copy of an H5Object object. - // H5Object(const H5Object& original); + // Copy constructor: makes copy of an H5Object object. + // H5Object(const H5Object& original); - // Sets the identifier of this object to a new value. - this one - // doesn't increment reference count - virtual void p_setId(const hid_t new_id) = 0; + // Sets the identifier of this object to a new value. - this one + // doesn't increment reference count + virtual void p_setId(const hid_t new_id) = 0; - // Noop destructor. - virtual ~H5Object(); + // Noop destructor. + virtual ~H5Object(); #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index 397a96f..6fdd9dc 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -75,49 +75,49 @@ void ObjCreatPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose: Constant for default property +// Purpose: Constant for default property //-------------------------------------------------------------------------- const ObjCreatPropList& ObjCreatPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Default Constructor -///\brief Creates a file access property list -// Programmer: Binh-Minh Ribler - 2000 +// Function: Default Constructor +///\brief Creates a file access property list +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- ObjCreatPropList::ObjCreatPropList() : PropList(H5P_OBJECT_CREATE) {} //-------------------------------------------------------------------------- -// Function: ObjCreatPropList copy constructor -///\brief Copy Constructor: makes a copy of the original -///\param original - IN: ObjCreatPropList instance to copy -// Programmer: Binh-Minh Ribler - 2000 +// Function: ObjCreatPropList copy constructor +///\brief Copy Constructor: makes a copy of the original +///\param original - IN: ObjCreatPropList instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- ObjCreatPropList::ObjCreatPropList(const ObjCreatPropList& original) : PropList(original) {} //-------------------------------------------------------------------------- -// Function: ObjCreatPropList overloaded constructor -///\brief Creates a file access property list using the id of an -/// existing one. -// Programmer: Binh-Minh Ribler - 2000 +// Function: ObjCreatPropList overloaded constructor +///\brief Creates a file access property list using the id of an +/// existing one. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- ObjCreatPropList::ObjCreatPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: ObjCreatPropList::setAttrPhaseChange -///\brief Sets attribute storage phase change thresholds. -///\param max_compact - IN: Maximum number of attributes to be stored in -/// compact storage. Default to 8 -///\param min_dense - IN: Minimum number of attributes to be stored in -/// dense storage. Default to 6 -///\exception H5::PropListIException +// Function: ObjCreatPropList::setAttrPhaseChange +///\brief Sets attribute storage phase change thresholds. +///\param max_compact - IN: Maximum number of attributes to be stored in +/// compact storage. Default to 8 +///\param min_dense - IN: Minimum number of attributes to be stored in +/// dense storage. Default to 6 +///\exception H5::PropListIException ///\par Description -/// If \c max_compact is set to 0, dense storage will be used. -/// For more detail about on attribute storage, please refer to the -/// C layer Reference Manual at: +/// If \c max_compact is set to 0, dense storage will be used. +/// For more detail about on attribute storage, please refer to the +/// C layer Reference Manual at: /// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrPhaseChange -// Programmer: Binh-Minh Ribler - September 2015 +// Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact, unsigned min_dense) const { @@ -129,19 +129,19 @@ void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact, unsigned min_den } //-------------------------------------------------------------------------- -// Function: ObjCreatPropList::getAttrPhaseChange -///\brief Gets attribute storage phase change thresholds. -///\param max_compact - OUT: Maximum number of attributes to be stored in -/// compact storage. -///\param min_dense - OUT: Minimum number of attributes to be stored in -/// dense storage. -///\exception H5::PropListIException +// Function: ObjCreatPropList::getAttrPhaseChange +///\brief Gets attribute storage phase change thresholds. +///\param max_compact - OUT: Maximum number of attributes to be stored in +/// compact storage. +///\param min_dense - OUT: Minimum number of attributes to be stored in +/// dense storage. +///\exception H5::PropListIException ///\par Description -/// If \c max_compact is set to 0, dense storage will be used. -/// For more detail about on attribute storage, please refer to the -/// C layer Reference Manual at: +/// If \c max_compact is set to 0, dense storage will be used. +/// For more detail about on attribute storage, please refer to the +/// C layer Reference Manual at: /// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrPhaseChange -// Programmer: Binh-Minh Ribler - September 2015 +// Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const { @@ -154,23 +154,23 @@ void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_d } //-------------------------------------------------------------------------- -// Function: ObjCreatPropList::setAttrCrtOrder -///\brief Sets tracking and indexing of attribute creation order. -///\param crt_order_flags - IN: Flags specifying whether to track and -/// index attribute creation order. Default: No flag set -///\exception H5::PropListIException +// Function: ObjCreatPropList::setAttrCrtOrder +///\brief Sets tracking and indexing of attribute creation order. +///\param crt_order_flags - IN: Flags specifying whether to track and +/// index attribute creation order. Default: No flag set +///\exception H5::PropListIException ///\par Description -/// Valid flags are: -/// \li \c H5P_CRT_ORDER_TRACKED - Attribute creation order is tracked -/// \li \c H5P_CRT_ORDER_INDEXED - Attribute creation order is -/// indexed (requires H5P_CRT_ORDER_TRACKED). -/// When no flag is set, attribute creation order is neither -/// tracked not indexed. Note that HDF5 currently provides no -/// mechanism to turn on attribute creation order tracking at object -/// creation time and to build the index later. -/// The C layer Reference Manual at can be found at: +/// Valid flags are: +/// \li \c H5P_CRT_ORDER_TRACKED - Attribute creation order is tracked +/// \li \c H5P_CRT_ORDER_INDEXED - Attribute creation order is +/// indexed (requires H5P_CRT_ORDER_TRACKED). +/// When no flag is set, attribute creation order is neither +/// tracked not indexed. Note that HDF5 currently provides no +/// mechanism to turn on attribute creation order tracking at object +/// creation time and to build the index later. +/// The C layer Reference Manual at can be found at: /// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrCreationOrder -// Programmer: Binh-Minh Ribler - September 2015 +// Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const { @@ -182,18 +182,18 @@ void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const } //-------------------------------------------------------------------------- -// Function: ObjCreatPropList::getAttrCrtOrder -///\brief Gets tracking and indexing settings for attribute -/// creation order. -///\param crt_order_flags - OUT: Flags specifying whether to track and -/// index attribute creation order -///\exception H5::PropListIException +// Function: ObjCreatPropList::getAttrCrtOrder +///\brief Gets tracking and indexing settings for attribute +/// creation order. +///\param crt_order_flags - OUT: Flags specifying whether to track and +/// index attribute creation order +///\exception H5::PropListIException ///\par Description -/// When no flag is set, i.e. crt_order_flags = 0, attribute -/// creation order is neither tracked not indexed. -/// The C layer Reference Manual at can be found at: +/// When no flag is set, i.e. crt_order_flags = 0, attribute +/// creation order is neither tracked not indexed. +/// The C layer Reference Manual at can be found at: /// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrCreationOrder -// Programmer: Binh-Minh Ribler - September 2015 +// Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- unsigned ObjCreatPropList::getAttrCrtOrder() const { @@ -208,9 +208,9 @@ unsigned ObjCreatPropList::getAttrCrtOrder() const } //-------------------------------------------------------------------------- -// Function: ObjCreatPropList destructor -///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Function: ObjCreatPropList destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- ObjCreatPropList::~ObjCreatPropList() {} diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index bfba1c4..4858e07 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -27,37 +27,37 @@ namespace H5 { */ class H5_DLLCPP ObjCreatPropList : public PropList { public: - ///\brief Default object creation property list. - static const ObjCreatPropList& DEFAULT; + ///\brief Default object creation property list. + static const ObjCreatPropList& DEFAULT; - // Creates a object creation property list. - ObjCreatPropList(); + // Creates a object creation property list. + ObjCreatPropList(); - // Sets attribute storage phase change thresholds. - void setAttrPhaseChange(unsigned max_compact = 8, unsigned min_dense = 6) const; + // Sets attribute storage phase change thresholds. + void setAttrPhaseChange(unsigned max_compact = 8, unsigned min_dense = 6) const; - // Gets attribute storage phase change thresholds. - void getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const; + // Gets attribute storage phase change thresholds. + void getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const; - // Sets tracking and indexing of attribute creation order. - void setAttrCrtOrder(unsigned crt_order_flags) const; + // Sets tracking and indexing of attribute creation order. + void setAttrCrtOrder(unsigned crt_order_flags) const; - // Gets tracking and indexing settings for attribute creation order. - unsigned getAttrCrtOrder() const; + // Gets tracking and indexing settings for attribute creation order. + unsigned getAttrCrtOrder() const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("ObjCreatPropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("ObjCreatPropList"); } - // Copy constructor: creates a copy of a ObjCreatPropList object. - ObjCreatPropList( const ObjCreatPropList& original ); + // Copy constructor: creates a copy of a ObjCreatPropList object. + ObjCreatPropList(const ObjCreatPropList& original); - // Creates a copy of an existing object creation property list - // using the property list id. - ObjCreatPropList (const hid_t plist_id); + // Creates a copy of an existing object creation property list + // using the property list id. + ObjCreatPropList (const hid_t plist_id); - // Noop destructor - virtual ~ObjCreatPropList(); + // Noop destructor + virtual ~ObjCreatPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index e2eed18..03327c8 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -32,14 +32,14 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: PredType overloaded constructor -///\brief Creates a PredType object using the id of an existing -/// predefined datatype. -///\param predtype_id - IN: Id of a predefined datatype +// Function: PredType overloaded constructor +///\brief Creates a PredType object using the id of an existing +/// predefined datatype. +///\param predtype_id - IN: Id of a predefined datatype // Description -// This constructor creates a PredType object by copying -// the provided HDF5 predefined datatype. -// Programmer Binh-Minh Ribler - 2000 +// This constructor creates a PredType object by copying +// the provided HDF5 predefined datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::PredType(const hid_t predtype_id) : AtomType(predtype_id) { @@ -47,69 +47,69 @@ PredType::PredType(const hid_t predtype_id) : AtomType(predtype_id) } //-------------------------------------------------------------------------- -// Function: PredType default constructor -///\brief Default constructor: Creates a stub predefined datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: PredType default constructor +///\brief Default constructor: Creates a stub predefined datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::PredType() : AtomType() {} #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: PredType copy constructor -///\brief Copy constructor: makes a copy of the original PredType object. -///\param original - IN: PredType instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: PredType copy constructor +///\brief Copy constructor: makes a copy of the original PredType object. +///\param original - IN: PredType instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::PredType(const PredType& original) : AtomType(original) {} //-------------------------------------------------------------------------- -// Function: PredType::operator= -///\brief Assignment operator. -///\param rhs - IN: Reference to the predefined datatype -///\return Reference to PredType instance -///\exception H5::DataTypeIException +// Function: PredType::operator= +///\brief Assignment operator. +///\param rhs - IN: Reference to the predefined datatype +///\return Reference to PredType instance +///\exception H5::DataTypeIException // Description -// Makes a copy of the type on the right hand side and stores -// the new id in the left hand side object. -// Programmer Binh-Minh Ribler - 2000 +// Makes a copy of the type on the right hand side and stores +// the new id in the left hand side object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -PredType& PredType::operator=( const PredType& rhs ) +PredType& PredType::operator=(const PredType& rhs) { if (this != &rhs) - copy(rhs); + copy(rhs); return(*this); } #ifndef DOXYGEN_SHOULD_SKIP_THIS // These dummy functions do not inherit from DataType - they'll // throw an DataTypeIException if invoked. -void PredType::commit(H5Location& loc, const char* name ) +void PredType::commit(H5Location& loc, const char* name) { - throw DataTypeIException("PredType::commit", "Error: Attempted to commit a predefined datatype. Invalid operation!" ); + throw DataTypeIException("PredType::commit", "Error: Attempted to commit a predefined datatype. Invalid operation!"); } -void PredType::commit(H5Location& loc, const H5std_string& name ) +void PredType::commit(H5Location& loc, const H5std_string& name) { - commit( loc, name.c_str()); + commit(loc, name.c_str()); } bool PredType::committed() { - throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype." ); + throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype."); } #endif // DOXYGEN_SHOULD_SKIP_THIS // Default destructor //-------------------------------------------------------------------------- -// Function: PredType destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: PredType destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::~PredType() {} /***************************************************************************** - The following section is regarding the global constants PredType, - DataSpace, and PropList. + The following section is regarding the global constants PredType, + DataSpace, and PropList. *****************************************************************************/ @@ -292,18 +292,18 @@ PredType* PredType::NATIVE_UINT_FAST64_; #endif /* H5_SIZEOF_UINT_FAST64_T */ //-------------------------------------------------------------------------- -// Function: PredType::getPredTypes -// Purpose: Returns the dummy PredType constant object pointer -// Return: PredType object pointer +// Function: PredType::getPredTypes +// Purpose Returns the dummy PredType constant object pointer +// Return: PredType object pointer // Description -// If the dummy constant PREDTYPE_CONST_ is not allocated yet, -// call makePredTypes() to allocate all of the PredType constants. -// Otherwise, just simply return the object pointer PREDTYPE_CONST_. +// If the dummy constant PREDTYPE_CONST_ is not allocated yet, +// call makePredTypes() to allocate all of the PredType constants. +// Otherwise, just simply return the object pointer PREDTYPE_CONST_. // -// Note that, there is a similar function to getPredTypes() in -// other classes, that have global constants, is called getConstant(). +// Note that, there is a similar function to getPredTypes() in +// other classes, that have global constants, is called getConstant(). // -// Programmer Binh-Minh Ribler - September 2015 +// Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- PredType* PredType::getPredTypes() { @@ -318,16 +318,16 @@ PredType* PredType::getPredTypes() // If the dummy constant pointer is not allocated, allocate all PredType // constant pointers. Otherwise, throw because it shouldn't be. if (PREDTYPE_CONST_ == 0) - makePredTypes(); + makePredTypes(); else - throw H5::DataTypeIException("PredType::getPredTypes", "PredType::getPredTypes is being invoked on an allocated PREDTYPE_CONST_"); + throw H5::DataTypeIException("PredType::getPredTypes", "PredType::getPredTypes is being invoked on an allocated PREDTYPE_CONST_"); return PREDTYPE_CONST_; } //-------------------------------------------------------------------------- -// Function: PredType::makePredTypes -// Purpose: Allocate all PredType constants. -// Programmer Binh-Minh Ribler - September 2015 +// Function: PredType::makePredTypes +// Purpose Allocate all PredType constants. +// Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void PredType::makePredTypes() { @@ -515,9 +515,9 @@ void PredType::makePredTypes() //-------------------------------------------------------------------------- -// Function: PredType::deleteConstants -// Purpose: Deletes all PredType constant pointers. -// Programmer Binh-Minh Ribler - September 2015 +// Function: PredType::deleteConstants +// Purpose Deletes all PredType constant pointers. +// Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void PredType::deleteConstants() { @@ -891,206 +891,205 @@ const PredType& PredType::NATIVE_UINT_FAST64 = *NATIVE_UINT_FAST64_; } // end namespace /*************************************************************************** - Design Note - =========== + Design Note + =========== September 2015: - The C++ library has several types of global constants from different - classes, such as PropList, PredType, DataSpace, etc... Previously, - these global constants were declared statically and the C++ library used - a constant, called PredType::AtExit, to detect when all the global - contants are destroyed then close the C library (H5close). This method - relied on the order of the constants being created and destroyed and - that PredType constants be the last to be destroyed. In September - 2015, it was recognized that the order in which the global constants were - created and destroyed was actually undefined, thus can be different - between different compilers. This resulted in failure when compilers - destroy PredType constants before others because when PredType::AtExit - was destroyed, the C library was closed, so when the constants of other - classes such as PropList or DataSpace were being deleted, the C library - would not be available. - - These are the classes that have global constants: - + PredType - + DataSpace - + PropList (and its subclasses below) - + FileAccPropList - + FileCreatPropList - + DSetMemXferPropList - + DSetCreatPropList - - - The new method includes these main points: - - - The C++ library uses dynamically allocated constants to have the - control in which order the global constants are created/destroyed. - - - The previous static constants are changed to be the references to - the dynamically allocated constants to avoid impact on applications. - - - The first time an IdComponent default constructor is invoked, it - will call the function H5Library::initH5cpp which registers the - terminating functions from each class that has the global constants - so that these functions can destroy those constants at the exit of the - application. IdComponent is a baseclass of any object class that has - an identifier, such as Group, DataSet, DataType,... The classes which - have the global constants are all derived from IdComponent. - - - At the normal termination of the application, each registered function - for each constant type will delete all the allocated constants in - that type class, then a different terminating function, which was also - registered with atexit() by initH5cpp, will call H5close to close the - C library. - - The following list presents the differences between the old and new - methods and the changes implemented for the new method. - - 1. The following items are added to class H5Library: - // Private instance to be created by H5Library only - static H5Library* instance; - - // Returns a singleton H5Library to initialize the global - // constants, invoked in IdComponent default constructor - static H5Library* getInstance(); // public - - // Registers cleanup and terminating functions with atexit(), - // called in IdComponent default constructor - static void initH5cpp(void); // public - - // Calls H5close to terminate the library, registered with - // atexit(), as the last thing to be done. - static void termH5cpp(void); // public - - 2. The following shows the differences between the old and new methods - for allocating the PredType constants. There are more than 100 - constants, but only one is shown here for examples. - - Old Method: - ---------- - // Declaration of the constant - in "H5PredType.h" - static const PredType NATIVE_INT; - - // Definition of the constant - in "H5PredType.cpp" - const PredType PredType::NATIVE_INT(H5T_NATIVE_INT); - - New Method: - ---------- - // Declare pointer for a constant - in "H5PredType.h" - static PredType* NATIVE_INT_; // "H5PredType.h" - - // Change previous constant to reference - in "H5PredType.h" - static const PredType& NATIVE_INT; - - // The assignment of the first static constant, named - // PREDTYPE_CONST, calls makePredTypes() which allocates the - // dynamic memory for every PredType constant. - - // Creates a dynamic PredType object representing a C constant - // - in makePredTypes() - NATIVE_INT_ = new PredType(H5T_NATIVE_INT); - - // Assign the constant reference to the dynamic object - // - in "H5PredType.cpp" - const PredType& PredType::NATIVE_INT = *NATIVE_INT_; - - Functions added to class PredType: - - // Creates the constants - static void makePredTypes(); // private - - // Calls makePredTypes to create the constants and returns - // the dummy constant PREDTYPE_CONST; - static PredType* getPredTypes(); // private - - // Deletes the constants - static void deleteConstants(); // public - - 3. This section shows the differences between the old and new methods - for allocating the DataSpace constant, DataSpace::ALL. + The C++ library has several types of global constants from different + classes, such as PropList, PredType, DataSpace, etc... Previously, + these global constants were declared statically and the C++ library used + a constant, called PredType::AtExit, to detect when all the global + contants are destroyed then close the C library (H5close). This method + relied on the order of the constants being created and destroyed and + that PredType constants be the last to be destroyed. In September + 2015, it was recognized that the order in which the global constants were + created and destroyed was actually undefined, thus can be different + between different compilers. This resulted in failure when compilers + destroy PredType constants before others because when PredType::AtExit + was destroyed, the C library was closed, so when the constants of other + classes such as PropList or DataSpace were being deleted, the C library + would not be available. + + These are the classes that have global constants: + + PredType + + DataSpace + + PropList (and its subclasses below) + + FileAccPropList + + FileCreatPropList + + DSetMemXferPropList + + DSetCreatPropList + + The new method includes these main points: + + - The C++ library uses dynamically allocated constants to have the + control in which order the global constants are created/destroyed. + + - The previous static constants are changed to be the references to + the dynamically allocated constants to avoid impact on applications. + + - The first time an IdComponent default constructor is invoked, it + will call the function H5Library::initH5cpp which registers the + terminating functions from each class that has the global constants + so that these functions can destroy those constants at the exit of the + application. IdComponent is a baseclass of any object class that has + an identifier, such as Group, DataSet, DataType,... The classes which + have the global constants are all derived from IdComponent. + + - At the normal termination of the application, each registered function + for each constant type will delete all the allocated constants in + that type class, then a different terminating function, which was also + registered with atexit() by initH5cpp, will call H5close to close the + C library. + + The following list presents the differences between the old and new + methods and the changes implemented for the new method. + + 1. The following items are added to class H5Library: + // Private instance to be created by H5Library only + static H5Library* instance; + + // Returns a singleton H5Library to initialize the global + // constants, invoked in IdComponent default constructor + static H5Library* getInstance(); // public + + // Registers cleanup and terminating functions with atexit(), + // called in IdComponent default constructor + static void initH5cpp(void); // public + + // Calls H5close to terminate the library, registered with + // atexit(), as the last thing to be done. + static void termH5cpp(void); // public + + 2. The following shows the differences between the old and new methods + for allocating the PredType constants. There are more than 100 + constants, but only one is shown here for examples. + + Old Method: + ---------- + // Declaration of the constant - in "H5PredType.h" + static const PredType NATIVE_INT; + + // Definition of the constant - in "H5PredType.cpp" + const PredType PredType::NATIVE_INT(H5T_NATIVE_INT); + + New Method: + ---------- + // Declare pointer for a constant - in "H5PredType.h" + static PredType* NATIVE_INT_; // "H5PredType.h" + + // Change previous constant to reference - in "H5PredType.h" + static const PredType& NATIVE_INT; + + // The assignment of the first static constant, named + // PREDTYPE_CONST, calls makePredTypes() which allocates the + // dynamic memory for every PredType constant. + + // Creates a dynamic PredType object representing a C constant + // - in makePredTypes() + NATIVE_INT_ = new PredType(H5T_NATIVE_INT); + + // Assign the constant reference to the dynamic object + // - in "H5PredType.cpp" + const PredType& PredType::NATIVE_INT = *NATIVE_INT_; + + Functions added to class PredType: + + // Creates the constants + static void makePredTypes(); // private + + // Calls makePredTypes to create the constants and returns + // the dummy constant PREDTYPE_CONST; + static PredType* getPredTypes(); // private + + // Deletes the constants + static void deleteConstants(); // public + + 3. This section shows the differences between the old and new methods + for allocating the DataSpace constant, DataSpace::ALL. - Old Method: - ---------- - // Declaration of the constant - in "H5DataSpace.h" - static const DataSpace ALL; + Old Method: + ---------- + // Declaration of the constant - in "H5DataSpace.h" + static const DataSpace ALL; - // Definition of the constant - in "H5DataSpace.cpp" - const DataSpace DataSpace::ALL(H5S_ALL); + // Definition of the constant - in "H5DataSpace.cpp" + const DataSpace DataSpace::ALL(H5S_ALL); - New Method: - ---------- - // Declare pointer for a constant - in "H5DataSpace.h" - static DataSpace* ALL_; // "H5DataSpace.h" + New Method: + ---------- + // Declare pointer for a constant - in "H5DataSpace.h" + static DataSpace* ALL_; // "H5DataSpace.h" - // Change previous constant to reference - in "H5DataSpace.h" - static const DataSpace& ALL; + // Change previous constant to reference - in "H5DataSpace.h" + static const DataSpace& ALL; - // Creates a dynamic DataSpace object representing the C constant - // - in "H5DataSpace.cpp" - ALL_ = new DataSpace(H5S_ALL); + // Creates a dynamic DataSpace object representing the C constant + // - in "H5DataSpace.cpp" + ALL_ = new DataSpace(H5S_ALL); - // Assign the constant reference to the dynamic object - // - in "H5DataSpace.cpp" - const DataSpace& DataSpace::ALL = *ALL_; + // Assign the constant reference to the dynamic object + // - in "H5DataSpace.cpp" + const DataSpace& DataSpace::ALL = *ALL_; - Functions added to class DataSpace: + Functions added to class DataSpace: - // Creates the constant - static DataSpace* getConstant(); // private + // Creates the constant + static DataSpace* getConstant(); // private - // Deletes the constant - static void deleteConstants(); // public + // Deletes the constant + static void deleteConstants(); // public - 4. This section shows the differences between the old and new methods - for allocating the following constants - - PropList constant, PropList::DEFAULT. - - DSetCreatPropList constant, DSetCreatPropList::DEFAULT. - - DSetMemXferPropList constant, DSetMemXferPropList::DEFAULT. - - FileCreatPropList constant, FileCreatPropList::DEFAULT. - - FileAccPropList constant, FileAccPropList::DEFAULT. + 4. This section shows the differences between the old and new methods + for allocating the following constants + - PropList constant, PropList::DEFAULT. + - DSetCreatPropList constant, DSetCreatPropList::DEFAULT. + - DSetMemXferPropList constant, DSetMemXferPropList::DEFAULT. + - FileCreatPropList constant, FileCreatPropList::DEFAULT. + - FileAccPropList constant, FileAccPropList::DEFAULT. - For these constants, the library has the same changes, except the - class names and the HDF5 corresponding constants. Only the items - of PropList are listed, and "PropList" can be replaced by any of - DSetCreatPropList, DSetMemXferPropList, FileCreatPropList, - FileAccPropList for those classes. The HDF5 C constant "H5P_DEFAULT" - can be replaced by any of these respectively: H5P_DATASET_CREATE, - H5P_DATASET_XFER, H5P_FILE_CREATE, and H5P_FILE_ACCESS. + For these constants, the library has the same changes, except the + class names and the HDF5 corresponding constants. Only the items + of PropList are listed, and "PropList" can be replaced by any of + DSetCreatPropList, DSetMemXferPropList, FileCreatPropList, + FileAccPropList for those classes. The HDF5 C constant "H5P_DEFAULT" + can be replaced by any of these respectively: H5P_DATASET_CREATE, + H5P_DATASET_XFER, H5P_FILE_CREATE, and H5P_FILE_ACCESS. - Old Method: - ---------- - // Declaration of the constant - in "H5PropList.h" - static const PropList DEFAULT; + Old Method: + ---------- + // Declaration of the constant - in "H5PropList.h" + static const PropList DEFAULT; - // Definition of the constant - in "H5PropList.cpp" - const PropList PropList::DEFAULT(H5P_DEFAULT); + // Definition of the constant - in "H5PropList.cpp" + const PropList PropList::DEFAULT(H5P_DEFAULT); - New Method: - ---------- - // Declare pointer for a constant - in "H5PropList.h" - static PropList* DEFAULT_; // "H5PropList.h" + New Method: + ---------- + // Declare pointer for a constant - in "H5PropList.h" + static PropList* DEFAULT_; // "H5PropList.h" - // Change previous constant to reference - in "H5PropList.h" - static const PropList& DEFAULT; + // Change previous constant to reference - in "H5PropList.h" + static const PropList& DEFAULT; - // Creates a dynamic PropList object representing the C constant - // - in "H5PropList.cpp" - DEFAULT_ = new PropList(H5P_DEFAULT); + // Creates a dynamic PropList object representing the C constant + // - in "H5PropList.cpp" + DEFAULT_ = new PropList(H5P_DEFAULT); - // Assign the constant reference to the dynamic object - // - in "H5PropList.cpp" - const PropList& PropList::DEFAULT = *DEFAULT_; + // Assign the constant reference to the dynamic object + // - in "H5PropList.cpp" + const PropList& PropList::DEFAULT = *DEFAULT_; - Functions added to class PropList: + Functions added to class PropList: - // Creates the constant - static PropList* getConstant(); // private + // Creates the constant + static PropList* getConstant(); // private - // Deletes the constants - static void deleteConstants(); // public + // Deletes the constants + static void deleteConstants(); // public - The same functions are added to the subclasses of PropList instead of - using PropList's because of the class types and in favor of clarity. + The same functions are added to the subclasses of PropList instead of + using PropList's because of the class types and in favor of clarity. ****************************************************************************/ diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 750902e..a8d6e37 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -30,207 +30,207 @@ namespace H5 { */ class H5_DLLCPP PredType : public AtomType { public: - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("PredType"); } - - // Makes a copy of the predefined type and stores the new - // id in the left hand side object. - PredType& operator=( const PredType& rhs ); - - // Copy constructor - makes copy of the original object - PredType( const PredType& original ); - - // Noop destructor - virtual ~PredType(); - - /*! \brief This dummy function do not inherit from DataType - it will - throw a DataTypeIException if invoked. - */ - void commit(H5Location& loc, const H5std_string& name ); - /*! \brief This dummy function do not inherit from DataType - it will - throw a DataTypeIException if invoked. - */ - void commit(H5Location& loc, const char* name ); - /*! \brief This dummy function do not inherit from DataType - it will - throw a DataTypeIException if invoked. - */ - bool committed(); - - ///\brief PredType constants - static const PredType& STD_I8BE; - static const PredType& STD_I8LE; - static const PredType& STD_I16BE; - static const PredType& STD_I16LE; - static const PredType& STD_I32BE; - static const PredType& STD_I32LE; - static const PredType& STD_I64BE; - static const PredType& STD_I64LE; - static const PredType& STD_U8BE; - static const PredType& STD_U8LE; - static const PredType& STD_U16BE; - static const PredType& STD_U16LE; - static const PredType& STD_U32BE; - static const PredType& STD_U32LE; - static const PredType& STD_U64BE; - static const PredType& STD_U64LE; - static const PredType& STD_B8BE; - static const PredType& STD_B8LE; - static const PredType& STD_B16BE; - static const PredType& STD_B16LE; - static const PredType& STD_B32BE; - static const PredType& STD_B32LE; - static const PredType& STD_B64BE; - static const PredType& STD_B64LE; - static const PredType& STD_REF_OBJ; - static const PredType& STD_REF_DSETREG; - - static const PredType& C_S1; - static const PredType& FORTRAN_S1; - - static const PredType& IEEE_F32BE; - static const PredType& IEEE_F32LE; - static const PredType& IEEE_F64BE; - static const PredType& IEEE_F64LE; - - static const PredType& UNIX_D32BE; - static const PredType& UNIX_D32LE; - static const PredType& UNIX_D64BE; - static const PredType& UNIX_D64LE; - - static const PredType& INTEL_I8; - static const PredType& INTEL_I16; - static const PredType& INTEL_I32; - static const PredType& INTEL_I64; - static const PredType& INTEL_U8; - static const PredType& INTEL_U16; - static const PredType& INTEL_U32; - static const PredType& INTEL_U64; - static const PredType& INTEL_B8; - static const PredType& INTEL_B16; - static const PredType& INTEL_B32; - static const PredType& INTEL_B64; - static const PredType& INTEL_F32; - static const PredType& INTEL_F64; - - static const PredType& ALPHA_I8; - static const PredType& ALPHA_I16; - static const PredType& ALPHA_I32; - static const PredType& ALPHA_I64; - static const PredType& ALPHA_U8; - static const PredType& ALPHA_U16; - static const PredType& ALPHA_U32; - static const PredType& ALPHA_U64; - static const PredType& ALPHA_B8; - static const PredType& ALPHA_B16; - static const PredType& ALPHA_B32; - static const PredType& ALPHA_B64; - static const PredType& ALPHA_F32; - static const PredType& ALPHA_F64; - - static const PredType& MIPS_I8; - static const PredType& MIPS_I16; - static const PredType& MIPS_I32; - static const PredType& MIPS_I64; - static const PredType& MIPS_U8; - static const PredType& MIPS_U16; - static const PredType& MIPS_U32; - static const PredType& MIPS_U64; - static const PredType& MIPS_B8; - static const PredType& MIPS_B16; - static const PredType& MIPS_B32; - static const PredType& MIPS_B64; - static const PredType& MIPS_F32; - static const PredType& MIPS_F64; - - static const PredType& NATIVE_CHAR; - static const PredType& NATIVE_SCHAR; - static const PredType& NATIVE_UCHAR; - static const PredType& NATIVE_SHORT; - static const PredType& NATIVE_USHORT; - static const PredType& NATIVE_INT; - static const PredType& NATIVE_UINT; - static const PredType& NATIVE_LONG; - static const PredType& NATIVE_ULONG; - static const PredType& NATIVE_LLONG; - static const PredType& NATIVE_ULLONG; - static const PredType& NATIVE_FLOAT; - static const PredType& NATIVE_DOUBLE; - static const PredType& NATIVE_LDOUBLE; - static const PredType& NATIVE_B8; - static const PredType& NATIVE_B16; - static const PredType& NATIVE_B32; - static const PredType& NATIVE_B64; - static const PredType& NATIVE_OPAQUE; - static const PredType& NATIVE_HSIZE; - static const PredType& NATIVE_HSSIZE; - static const PredType& NATIVE_HERR; - static const PredType& NATIVE_HBOOL; - - static const PredType& NATIVE_INT8; - static const PredType& NATIVE_UINT8; - static const PredType& NATIVE_INT16; - static const PredType& NATIVE_UINT16; - static const PredType& NATIVE_INT32; - static const PredType& NATIVE_UINT32; - static const PredType& NATIVE_INT64; - static const PredType& NATIVE_UINT64; + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("PredType"); } + + // Makes a copy of the predefined type and stores the new + // id in the left hand side object. + PredType& operator=(const PredType& rhs); + + // Copy constructor - makes copy of the original object + PredType(const PredType& original); + + // Noop destructor + virtual ~PredType(); + + /*! \brief This dummy function do not inherit from DataType - it will + throw a DataTypeIException if invoked. + */ + void commit(H5Location& loc, const H5std_string& name); + /*! \brief This dummy function do not inherit from DataType - it will + throw a DataTypeIException if invoked. + */ + void commit(H5Location& loc, const char* name); + /*! \brief This dummy function do not inherit from DataType - it will + throw a DataTypeIException if invoked. + */ + bool committed(); + + ///\brief PredType constants + static const PredType& STD_I8BE; + static const PredType& STD_I8LE; + static const PredType& STD_I16BE; + static const PredType& STD_I16LE; + static const PredType& STD_I32BE; + static const PredType& STD_I32LE; + static const PredType& STD_I64BE; + static const PredType& STD_I64LE; + static const PredType& STD_U8BE; + static const PredType& STD_U8LE; + static const PredType& STD_U16BE; + static const PredType& STD_U16LE; + static const PredType& STD_U32BE; + static const PredType& STD_U32LE; + static const PredType& STD_U64BE; + static const PredType& STD_U64LE; + static const PredType& STD_B8BE; + static const PredType& STD_B8LE; + static const PredType& STD_B16BE; + static const PredType& STD_B16LE; + static const PredType& STD_B32BE; + static const PredType& STD_B32LE; + static const PredType& STD_B64BE; + static const PredType& STD_B64LE; + static const PredType& STD_REF_OBJ; + static const PredType& STD_REF_DSETREG; + + static const PredType& C_S1; + static const PredType& FORTRAN_S1; + + static const PredType& IEEE_F32BE; + static const PredType& IEEE_F32LE; + static const PredType& IEEE_F64BE; + static const PredType& IEEE_F64LE; + + static const PredType& UNIX_D32BE; + static const PredType& UNIX_D32LE; + static const PredType& UNIX_D64BE; + static const PredType& UNIX_D64LE; + + static const PredType& INTEL_I8; + static const PredType& INTEL_I16; + static const PredType& INTEL_I32; + static const PredType& INTEL_I64; + static const PredType& INTEL_U8; + static const PredType& INTEL_U16; + static const PredType& INTEL_U32; + static const PredType& INTEL_U64; + static const PredType& INTEL_B8; + static const PredType& INTEL_B16; + static const PredType& INTEL_B32; + static const PredType& INTEL_B64; + static const PredType& INTEL_F32; + static const PredType& INTEL_F64; + + static const PredType& ALPHA_I8; + static const PredType& ALPHA_I16; + static const PredType& ALPHA_I32; + static const PredType& ALPHA_I64; + static const PredType& ALPHA_U8; + static const PredType& ALPHA_U16; + static const PredType& ALPHA_U32; + static const PredType& ALPHA_U64; + static const PredType& ALPHA_B8; + static const PredType& ALPHA_B16; + static const PredType& ALPHA_B32; + static const PredType& ALPHA_B64; + static const PredType& ALPHA_F32; + static const PredType& ALPHA_F64; + + static const PredType& MIPS_I8; + static const PredType& MIPS_I16; + static const PredType& MIPS_I32; + static const PredType& MIPS_I64; + static const PredType& MIPS_U8; + static const PredType& MIPS_U16; + static const PredType& MIPS_U32; + static const PredType& MIPS_U64; + static const PredType& MIPS_B8; + static const PredType& MIPS_B16; + static const PredType& MIPS_B32; + static const PredType& MIPS_B64; + static const PredType& MIPS_F32; + static const PredType& MIPS_F64; + + static const PredType& NATIVE_CHAR; + static const PredType& NATIVE_SCHAR; + static const PredType& NATIVE_UCHAR; + static const PredType& NATIVE_SHORT; + static const PredType& NATIVE_USHORT; + static const PredType& NATIVE_INT; + static const PredType& NATIVE_UINT; + static const PredType& NATIVE_LONG; + static const PredType& NATIVE_ULONG; + static const PredType& NATIVE_LLONG; + static const PredType& NATIVE_ULLONG; + static const PredType& NATIVE_FLOAT; + static const PredType& NATIVE_DOUBLE; + static const PredType& NATIVE_LDOUBLE; + static const PredType& NATIVE_B8; + static const PredType& NATIVE_B16; + static const PredType& NATIVE_B32; + static const PredType& NATIVE_B64; + static const PredType& NATIVE_OPAQUE; + static const PredType& NATIVE_HSIZE; + static const PredType& NATIVE_HSSIZE; + static const PredType& NATIVE_HERR; + static const PredType& NATIVE_HBOOL; + + static const PredType& NATIVE_INT8; + static const PredType& NATIVE_UINT8; + static const PredType& NATIVE_INT16; + static const PredType& NATIVE_UINT16; + static const PredType& NATIVE_INT32; + static const PredType& NATIVE_UINT32; + static const PredType& NATIVE_INT64; + static const PredType& NATIVE_UINT64; // LEAST types #if H5_SIZEOF_INT_LEAST8_T != 0 - static const PredType& NATIVE_INT_LEAST8; + static const PredType& NATIVE_INT_LEAST8; #endif /* H5_SIZEOF_INT_LEAST8_T */ #if H5_SIZEOF_UINT_LEAST8_T != 0 - static const PredType& NATIVE_UINT_LEAST8; + static const PredType& NATIVE_UINT_LEAST8; #endif /* H5_SIZEOF_UINT_LEAST8_T */ #if H5_SIZEOF_INT_LEAST16_T != 0 - static const PredType& NATIVE_INT_LEAST16; + static const PredType& NATIVE_INT_LEAST16; #endif /* H5_SIZEOF_INT_LEAST16_T */ #if H5_SIZEOF_UINT_LEAST16_T != 0 - static const PredType& NATIVE_UINT_LEAST16; + static const PredType& NATIVE_UINT_LEAST16; #endif /* H5_SIZEOF_UINT_LEAST16_T */ #if H5_SIZEOF_INT_LEAST32_T != 0 - static const PredType& NATIVE_INT_LEAST32; + static const PredType& NATIVE_INT_LEAST32; #endif /* H5_SIZEOF_INT_LEAST32_T */ #if H5_SIZEOF_UINT_LEAST32_T != 0 - static const PredType& NATIVE_UINT_LEAST32; + static const PredType& NATIVE_UINT_LEAST32; #endif /* H5_SIZEOF_UINT_LEAST32_T */ #if H5_SIZEOF_INT_LEAST64_T != 0 - static const PredType& NATIVE_INT_LEAST64; + static const PredType& NATIVE_INT_LEAST64; #endif /* H5_SIZEOF_INT_LEAST64_T */ #if H5_SIZEOF_UINT_LEAST64_T != 0 - static const PredType& NATIVE_UINT_LEAST64; + static const PredType& NATIVE_UINT_LEAST64; #endif /* H5_SIZEOF_UINT_LEAST64_T */ // FAST types #if H5_SIZEOF_INT_FAST8_T != 0 - static const PredType& NATIVE_INT_FAST8; + static const PredType& NATIVE_INT_FAST8; #endif /* H5_SIZEOF_INT_FAST8_T */ #if H5_SIZEOF_UINT_FAST8_T != 0 - static const PredType& NATIVE_UINT_FAST8; + static const PredType& NATIVE_UINT_FAST8; #endif /* H5_SIZEOF_UINT_FAST8_T */ #if H5_SIZEOF_INT_FAST16_T != 0 - static const PredType& NATIVE_INT_FAST16; + static const PredType& NATIVE_INT_FAST16; #endif /* H5_SIZEOF_INT_FAST16_T */ #if H5_SIZEOF_UINT_FAST16_T != 0 - static const PredType& NATIVE_UINT_FAST16; + static const PredType& NATIVE_UINT_FAST16; #endif /* H5_SIZEOF_UINT_FAST16_T */ #if H5_SIZEOF_INT_FAST32_T != 0 - static const PredType& NATIVE_INT_FAST32; + static const PredType& NATIVE_INT_FAST32; #endif /* H5_SIZEOF_INT_FAST32_T */ #if H5_SIZEOF_UINT_FAST32_T != 0 - static const PredType& NATIVE_UINT_FAST32; + static const PredType& NATIVE_UINT_FAST32; #endif /* H5_SIZEOF_UINT_FAST32_T */ #if H5_SIZEOF_INT_FAST64_T != 0 - static const PredType& NATIVE_INT_FAST64; + static const PredType& NATIVE_INT_FAST64; #endif /* H5_SIZEOF_INT_FAST64_T */ #if H5_SIZEOF_UINT_FAST64_T != 0 - static const PredType& NATIVE_UINT_FAST64; + static const PredType& NATIVE_UINT_FAST64; #endif /* H5_SIZEOF_UINT_FAST64_T */ #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -242,11 +242,11 @@ class H5_DLLCPP PredType : public AtomType { static const PredType& PREDTYPE_CONST; // dummy constant protected: - // Default constructor - PredType(); + // Default constructor + PredType(); - // Creates a pre-defined type using an HDF5 pre-defined constant - PredType( const hid_t predtype_id ); // used by the library only + // Creates a pre-defined type using an HDF5 pre-defined constant + PredType(const hid_t predtype_id); // used by the library only private: // Activates the creation of the PredType global constants diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index f0eb847..c4176c2 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -21,7 +21,7 @@ #include -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -42,7 +42,7 @@ PropList* PropList::DEFAULT_ = 0; //-------------------------------------------------------------------------- // Function: PropList::getConstant -// Purpose: Creates a PropList object representing the HDF5 constant +// Purpose Creates a PropList object representing the HDF5 constant // H5P_DEFAULT, pointed to by PropList::DEFAULT_. // Exception H5::PropListIException // Description @@ -71,7 +71,7 @@ PropList* PropList::getConstant() //-------------------------------------------------------------------------- // Function: PropList::deleteConstants -// Purpose: Deletes the constant object that PropList::DEFAULT_ points to. +// Purpose Deletes the constant object that PropList::DEFAULT_ points to. // Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- void PropList::deleteConstants() @@ -81,24 +81,24 @@ void PropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for default property. +// Purpose Constant for default property. //-------------------------------------------------------------------------- const PropList& PropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function Default constructor -///\brief Default constructor: creates a stub property list object. -// Programmer Binh-Minh Ribler - 2000 +// Function: Default constructor +///\brief Default constructor: creates a stub property list object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PropList::PropList() : IdComponent(), id(H5P_DEFAULT) {} //-------------------------------------------------------------------------- -// Function: PropList copy constructor -///\brief Copy constructor -///\param original - IN: The original property list to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList copy constructor +///\brief Copy constructor +///\param original - IN: The original property list to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PropList::PropList(const PropList& original) : IdComponent(), id(original.id) { @@ -106,166 +106,166 @@ PropList::PropList(const PropList& original) : IdComponent(), id(original.id) } //-------------------------------------------------------------------------- -// Function: PropList overloaded constructor -///\brief Creates a property list using the id of an existing property. -///\param plist_id - IN: Id of the existing property list -///\exception H5::PropListIException +// Function: PropList overloaded constructor +///\brief Creates a property list using the id of an existing property. +///\param plist_id - IN: Id of the existing property list +///\exception H5::PropListIException // Description -// This function creates a new property list if a property -// class is provided or makes a copy of a property list if one -// is given. If the given id is anything else, then set this -// property's id to H5P_DEFAULT. -// Programmer Binh-Minh Ribler - 2000 +// This function creates a new property list if a property +// class is provided or makes a copy of a property list if one +// is given. If the given id is anything else, then set this +// property's id to H5P_DEFAULT. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -PropList::PropList( const hid_t plist_id ) : IdComponent() +PropList::PropList(const hid_t plist_id) : IdComponent() { if (plist_id <= 0) - id = H5P_DEFAULT; + id = H5P_DEFAULT; H5I_type_t id_type = H5Iget_type(plist_id); switch (id_type) { - case H5I_GENPROP_CLS: - // call C routine to create a new property from the given prop class - id = H5Pcreate(plist_id); - if( id < 0 ) - { - throw PropListIException("PropList constructor", "H5Pcreate failed"); - } - break; - case H5I_GENPROP_LST: - // call C routine to make a copy of the given property list - id = H5Pcopy(plist_id); - if( id < 0 ) - { - throw PropListIException("PropList constructor", "H5Pcopy failed"); - } - break; - default: - id = H5P_DEFAULT; - break; + case H5I_GENPROP_CLS: + // call C routine to create a new property from the given prop class + id = H5Pcreate(plist_id); + if (id < 0) + { + throw PropListIException("PropList constructor", "H5Pcreate failed"); + } + break; + case H5I_GENPROP_LST: + // call C routine to make a copy of the given property list + id = H5Pcopy(plist_id); + if (id < 0) + { + throw PropListIException("PropList constructor", "H5Pcopy failed"); + } + break; + default: + id = H5P_DEFAULT; + break; } } //-------------------------------------------------------------------------- -// Function: PropList::copy -///\brief Makes a copy of an existing property list. -///\param like_plist - IN: Reference to the existing property list -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList::copy +///\brief Makes a copy of an existing property list. +///\param like_plist - IN: Reference to the existing property list +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- -void PropList::copy( const PropList& like_plist ) +void PropList::copy(const PropList& like_plist) { // If this object is representing an hdf5 object, close it before // copying like_plist to it try { - close(); + close(); } catch (Exception& close_error) { - throw PropListIException(inMemFunc("copy"), close_error.getDetailMsg()); + throw PropListIException(inMemFunc("copy"), close_error.getDetailMsg()); } // call C routine to copy the property list - id = H5Pcopy( like_plist.getId() ); - if( id < 0 ) - throw PropListIException(inMemFunc("copy"), "H5Pcopy failed"); + id = H5Pcopy(like_plist.getId()); + if (id < 0) + throw PropListIException(inMemFunc("copy"), "H5Pcopy failed"); } //-------------------------------------------------------------------------- -// Function: PropList::operator= -///\brief Assignment operator. -///\param rhs - IN: Reference to the existing property list -///\return Reference to PropList instance -///\exception H5::PropListIException +// Function: PropList::operator= +///\brief Assignment operator. +///\param rhs - IN: Reference to the existing property list +///\return Reference to PropList instance +///\exception H5::PropListIException // Description -// Makes a copy of the property list on the right hand side -// and stores the new id in the left hand side object. -// Programmer Binh-Minh Ribler - 2000 +// Makes a copy of the property list on the right hand side +// and stores the new id in the left hand side object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -PropList& PropList::operator=( const PropList& rhs ) +PropList& PropList::operator=(const PropList& rhs) { if (this != &rhs) - copy(rhs); + copy(rhs); return(*this); } //-------------------------------------------------------------------------- -// Function: PropList::copyProp -///\brief Copies a property from this property list or class to another -///\param dest - IN: Destination property list or class -///\param name - IN: Name of the property to copy - \c char pointer -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: PropList::copyProp +///\brief Copies a property from this property list or class to another +///\param dest - IN: Destination property list or class +///\param name - IN: Name of the property to copy - \c char pointer +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- void PropList::copyProp(PropList& dest, const char *name) const { - hid_t dst_id = dest.getId(); - herr_t ret_value = H5Pcopy_prop(dst_id, id, name); - if( ret_value < 0 ) - { - throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed"); - } + hid_t dst_id = dest.getId(); + herr_t ret_value = H5Pcopy_prop(dst_id, id, name); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::copyProp -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param dest - IN: Destination property list or class -///\param name - IN: Name of the property to copy - \c H5std_string -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: PropList::copyProp +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param dest - IN: Destination property list or class +///\param name - IN: Name of the property to copy - \c H5std_string +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -void PropList::copyProp( PropList& dest, const H5std_string& name ) const +void PropList::copyProp(PropList& dest, const H5std_string& name) const { - copyProp( dest, name.c_str()); + copyProp(dest, name.c_str()); } //-------------------------------------------------------------------------- -// Function: PropList::copyProp -///\brief Copies a property from one list or class to another - Obsolete -///\param dest - IN: Destination property list or class -///\param src - IN: Source property list or class -///\param name - IN: Name of the property to copy - \c char pointer -///\note This member function will be removed in the next release -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList::copyProp +///\brief Copies a property from one list or class to another - Obsolete +///\param dest - IN: Destination property list or class +///\param src - IN: Source property list or class +///\param name - IN: Name of the property to copy - \c char pointer +///\note This member function will be removed in the next release +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const +void PropList::copyProp(PropList& dest, PropList& src, const char *name) const { - hid_t dst_id = dest.getId(); - hid_t src_id = src.getId(); - herr_t ret_value = H5Pcopy_prop(dst_id, src_id, name); - if( ret_value < 0 ) - { - throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed"); - } + hid_t dst_id = dest.getId(); + hid_t src_id = src.getId(); + herr_t ret_value = H5Pcopy_prop(dst_id, src_id, name); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::copyProp -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. - Obsolete -///\param dest - IN: Destination property list or class -///\param src - IN: Source property list or class -///\param name - IN: Name of the property to copy - \c H5std_string -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList::copyProp +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. - Obsolete +///\param dest - IN: Destination property list or class +///\param src - IN: Source property list or class +///\param name - IN: Name of the property to copy - \c H5std_string +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void PropList::copyProp( PropList& dest, PropList& src, const H5std_string& name ) const +void PropList::copyProp(PropList& dest, PropList& src, const H5std_string& name) const { - copyProp( dest, src, name.c_str()); + copyProp(dest, src, name.c_str()); } //-------------------------------------------------------------------------- // Function: PropList::getId -///\brief Get the id of this property list -///\return Property list identifier +///\brief Get the id of this property list +///\return Property list identifier // Description: // Class hierarchy is revised to address bugzilla 1068. Class // AbstractDS and Attribute are moved out of H5Object. In @@ -275,7 +275,7 @@ void PropList::copyProp( PropList& dest, PropList& src, const H5std_string& name //-------------------------------------------------------------------------- hid_t PropList::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -307,444 +307,441 @@ void PropList::p_setId(const hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: PropList::close -///\brief Closes the property list if it is not a default one. +// Function: PropList::close +///\brief Closes the property list if it is not a default one. /// -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void PropList::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Pclose( id ); - if( ret_value < 0 ) - { - throw PropListIException(inMemFunc("close"), "H5Pclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Pclose(id); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("close"), "H5Pclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: PropList::getClass -///\brief Returns the class of this property list, i.e. \c H5P_FILE_CREATE... -///\return The property list class if it is not equal to \c H5P_ROOT -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: PropList::getClass +///\brief Returns the class of this property list, i.e. \c H5P_FILE_CREATE... +///\return The property list class if it is not equal to \c H5P_ROOT +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hid_t PropList::getClass() const { - hid_t plist_class = H5Pget_class( id ); - if( plist_class == H5P_ROOT ) - { - throw PropListIException(inMemFunc("getClass"), - "H5Pget_class failed - returned H5P_ROOT"); - } - return( plist_class ); + hid_t plist_class = H5Pget_class(id); + if (plist_class == H5P_ROOT) + { + throw PropListIException(inMemFunc("getClass"), + "H5Pget_class failed - returned H5P_ROOT"); + } + return(plist_class); } //-------------------------------------------------------------------------- -// Function: PropList::propExist -///\brief Query the existance of a property in a property object. -///\param name - IN: Name of property to check for - \c char pointer -///\return true if the property exists in the property object, and -/// false, otherwise. -///\exception H5::PropListIException +// Function: PropList::propExist +///\brief Queries the existence of a property in a property object. +///\param name - IN: Name of property to check for - \c char pointer +///\return true if the property exists in the property object, and +/// false, otherwise. +///\exception H5::PropListIException ///\par Description -/// This routine checks if a property exists within a property -/// list or class. +/// This routine checks if a property exists within a property +/// list or class. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -bool PropList::propExist(const char* name ) const -{ - // Calls C routine H5Pexist to determine whether a property exists - // within a property list or class. It returns a positive value, 0, - // or a negative value - htri_t ret_value = H5Pexist(id, name); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else // Raise exception when H5Pexist returns a negative value - { - throw PropListIException(inMemFunc("propExist"), "H5Pexist failed"); - } -} -//-------------------------------------------------------------------------- -// Function: PropList::propExist -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to check for - \c H5std_string +bool PropList::propExist(const char* name) const +{ + // Calls C routine H5Pexist to determine whether a property exists + // within a property list or class. It returns a positive value, 0, + // or a negative value + htri_t ret_value = H5Pexist(id, name); + if (ret_value > 0) + return true; + else if (ret_value == 0) + return false; + else // Raise exception when H5Pexist returns a negative value + { + throw PropListIException(inMemFunc("propExist"), "H5Pexist failed"); + } +} +//-------------------------------------------------------------------------- +// Function: PropList::propExist +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to check for - \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -bool PropList::propExist(const H5std_string& name ) const +bool PropList::propExist(const H5std_string& name) const { - return( propExist( name.c_str()) ); + return(propExist( name.c_str())); } //-------------------------------------------------------------------------- -// Function: PropList::closeClass -///\brief Close a property list class. +// Function: PropList::closeClass +///\brief Close a property list class. /// -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// Releases memory and detaches a class from the property -/// list class hierarchy. +/// Releases memory and detaches a class from the property +/// list class hierarchy. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::closeClass() const { - herr_t ret_value = H5Pclose_class(id); - if( ret_value < 0 ) - { - throw PropListIException(inMemFunc("closeClass"), "H5Pclose_class failed"); - } + herr_t ret_value = H5Pclose_class(id); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("closeClass"), "H5Pclose_class failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::getProperty -///\brief Query the value of a property in a property list. -///\param name - IN: Name of property to query - \c char pointer -///\param value - OUT: Pointer to the buffer for the property value -///\exception H5::PropListIException +// Function: PropList::getProperty +///\brief Query the value of a property in a property list. +///\param name - IN: Name of property to query - \c char pointer +///\param value - OUT: Pointer to the buffer for the property value +///\exception H5::PropListIException ///\par Description -/// Retrieves a copy of the value for a property in a property -/// list. The property name must exist or this routine will -/// throw an exception. +/// Retrieves a copy of the value for a property in a property +/// list. The property name must exist or this routine will +/// throw an exception. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::getProperty(const char* name, void* value) const { - herr_t ret_value = H5Pget(id, name, value); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); - } + herr_t ret_value = H5Pget(id, name, value); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::getProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to query - \c char pointer -///\return The property that is a \c H5std_string. -///\exception H5::PropListIException +// Function: PropList::getProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to query - \c char pointer +///\return The property that is a \c H5std_string. +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5std_string PropList::getProperty(const char* name) const { - // Get property size first - size_t size = getPropSize(name); + // Get property size first + size_t size = getPropSize(name); - // Allocate buffer then get the property - char* prop_strg_C = new char[size+1]; // temporary C-string for C API - HDmemset(prop_strg_C, 0, size+1); // clear buffer + // Allocate buffer then get the property + char* prop_strg_C = new char[size+1]; // temporary C-string for C API + HDmemset(prop_strg_C, 0, size+1); // clear buffer - herr_t ret_value = H5Pget(id, name, prop_strg_C); // call C API + herr_t ret_value = H5Pget(id, name, prop_strg_C); // call C API - // Throw exception if H5Pget returns failure - if (ret_value < 0) - { + // Throw exception if H5Pget returns failure + if (ret_value < 0) + { delete []prop_strg_C; - throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); - } + throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); + } - // Return propety value as a string after deleting temp C-string - H5std_string prop_strg(prop_strg_C); - delete []prop_strg_C; - return (prop_strg); + // Return propety value as a string after deleting temp C-string + H5std_string prop_strg(prop_strg_C); + delete []prop_strg_C; + return (prop_strg); } //-------------------------------------------------------------------------- -// Function: PropList::getProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to query - \c H5std_string -///\param value - OUT: Pointer to the buffer for the property value +// Function: PropList::getProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to query - \c H5std_string +///\param value - OUT: Pointer to the buffer for the property value // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::getProperty(const H5std_string& name, void* value) const { - getProperty(name.c_str(), value); + getProperty(name.c_str(), value); } //-------------------------------------------------------------------------- -// Function: PropList::getProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to query - \c H5std_string -///\return The property that is a \c H5std_string. +// Function: PropList::getProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to query - \c H5std_string +///\return The property that is a \c H5std_string. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5std_string PropList::getProperty(const H5std_string& name) const { - return (getProperty(name.c_str())); + return (getProperty(name.c_str())); } //-------------------------------------------------------------------------- -// Function: PropList::getPropSize -///\brief Query the size of a property in a property list or class. -///\param name - IN: Name of property to query -///\return Size of the property -///\exception H5::PropListIException +// Function: PropList::getPropSize +///\brief Query the size of a property in a property list or class. +///\param name - IN: Name of property to query +///\return Size of the property +///\exception H5::PropListIException ///\par Description -/// This routine retrieves the size of a property's value -/// in bytes. Zero-sized properties are allowed and the return -/// value will be of 0. This function works for both property -/// lists and classes. +/// This routine retrieves the size of a property's value +/// in bytes. Zero-sized properties are allowed and the return +/// value will be of 0. This function works for both property +/// lists and classes. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t PropList::getPropSize(const char *name) const { - size_t prop_size; - herr_t ret_value = H5Pget_size(id, name, &prop_size); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("getPropSize"), "H5Pget_size failed"); - } - return(prop_size); + size_t prop_size; + herr_t ret_value = H5Pget_size(id, name, &prop_size); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("getPropSize"), "H5Pget_size failed"); + } + return(prop_size); } //-------------------------------------------------------------------------- -// Function: PropList::getPropSize -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to query - \c H5std_string +// Function: PropList::getPropSize +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to query - \c H5std_string /// // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t PropList::getPropSize(const H5std_string& name) const { - return (getPropSize(name.c_str())); + return (getPropSize(name.c_str())); } //-------------------------------------------------------------------------- -// Function: PropList::getClassName -///\brief Return the name of a generic property list class. -///\return A string containing the class name, if success, otherwise, -/// a NULL string. +// Function: PropList::getClassName +///\brief Return the name of a generic property list class. +///\return A string containing the class name, if success, otherwise, +/// a NULL string. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5std_string PropList::getClassName() const { - char* temp_str; - temp_str = H5Pget_class_name(id); // this API specified that temp_str must - // be freed. - - if (temp_str != NULL) - { - H5std_string class_name(temp_str); - H5free_memory(temp_str); - return(class_name); - } - else - return 0; + char* temp_str; + temp_str = H5Pget_class_name(id); + if (temp_str != NULL) + { + H5std_string class_name(temp_str); + H5free_memory(temp_str); + return(class_name); + } + else + return 0; } //-------------------------------------------------------------------------- -// Function: PropList::getNumProps -///\brief Returns the number of properties in this property list or class. -///\return Size of the property. -///\exception H5::PropListIException +// Function: PropList::getNumProps +///\brief Returns the number of properties in this property list or class. +///\return Size of the property. +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t PropList::getNumProps() const { - size_t nprops; - herr_t ret_value = H5Pget_nprops (id, &nprops); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("getNumProps"), "H5Pget_nprops failed"); - } - return (nprops); + size_t nprops; + herr_t ret_value = H5Pget_nprops (id, &nprops); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("getNumProps"), "H5Pget_nprops failed"); + } + return (nprops); } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief Set a property's value in a property list. -///\param name - IN: Name of property to set - \c char pointer -///\param value - IN: Void pointer to the value for the property -///\exception H5::PropListIException +// Function: PropList::setProperty +///\brief Set a property's value in a property list. +///\param name - IN: Name of property to set - \c char pointer +///\param value - IN: Void pointer to the value for the property +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, void* value) const { - herr_t ret_value = H5Pset(id, name, value); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); - } + herr_t ret_value = H5Pset(id, name, value); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to set - \c char pointer -///\param charptr - IN: Char pointer to the value for the property +// Function: PropList::setProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to set - \c char pointer +///\param charptr - IN: Char pointer to the value for the property // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, const char* charptr) const { - herr_t ret_value = H5Pset(id, name, (void*)charptr); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); - } + herr_t ret_value = H5Pset(id, name, (void*)charptr); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to set - \c char pointer -///\param strg - IN: Value for the property is a \c H5std_string +// Function: PropList::setProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to set - \c char pointer +///\param strg - IN: Value for the property is a \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, H5std_string& strg) const { - setProperty(name, strg.c_str()); + setProperty(name, strg.c_str()); } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to set - \c H5std_string -///\param value - IN: Void pointer to the value for the property +// Function: PropList::setProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to set - \c H5std_string +///\param value - IN: Void pointer to the value for the property // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const H5std_string& name, void* value) const { - setProperty(name.c_str(), value); + setProperty(name.c_str(), value); } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to set - \c H5std_string -///\param strg - IN: Value for the property is a \c H5std_string +// Function: PropList::setProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to set - \c H5std_string +///\param strg - IN: Value for the property is a \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const H5std_string& name, H5std_string& strg) const { - setProperty(name.c_str(), strg.c_str()); + setProperty(name.c_str(), strg.c_str()); } //-------------------------------------------------------------------------- -// Function: PropList::isAClass -///\brief Determines whether a property list is a certain class. -///\param prop_class - IN: Property class to query -///\return true if the property list is a member of the property list -/// class, and false, otherwise. -///\exception H5::PropListIException +// Function: PropList::isAClass +///\brief Determines whether a property list is a certain class. +///\param prop_class - IN: Property class to query +///\return true if the property list is a member of the property list +/// class, and false, otherwise. +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- bool PropList::isAClass(const PropList& prop_class) const { - htri_t ret_value = H5Pisa_class(id, prop_class.getId()); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else // Raise exception when H5Pisa_class returns a negative value - { - throw PropListIException(inMemFunc("isAClass"), "H5Pisa_class failed"); - } - + htri_t ret_value = H5Pisa_class(id, prop_class.getId()); + if (ret_value > 0) + return true; + else if (ret_value == 0) + return false; + else // Raise exception when H5Pisa_class returns a negative value + { + throw PropListIException(inMemFunc("isAClass"), "H5Pisa_class failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::removeProp -///\brief Removes a property from a property list. -///\param name - IN: Name of property to remove - \c char pointer -///\exception H5::PropListIException +// Function: PropList::removeProp +///\brief Removes a property from a property list. +///\param name - IN: Name of property to remove - \c char pointer +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::removeProp(const char *name) const { - herr_t ret_value = H5Premove(id, name); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("removeProp"), "H5Premove failed"); - } + herr_t ret_value = H5Premove(id, name); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("removeProp"), "H5Premove failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::removeProp -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to remove - \c H5std_string +// Function: PropList::removeProp +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to remove - \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::removeProp(const H5std_string& name) const { - removeProp(name.c_str()); + removeProp(name.c_str()); } //-------------------------------------------------------------------------- -// Function: PropList::operator== -///\brief Compares this property list or class against the given list or class. -///\param rhs - IN: Reference to the property list to compare -///\return true if the property lists or classes are equal, and -/// false, otherwise. -///\exception H5::PropListIException +// Function: PropList::operator== +///\brief Compares this property list or class against the given list or class. +///\param rhs - IN: Reference to the property list to compare +///\return true if the property lists or classes are equal, and +/// false, otherwise. +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- bool PropList::operator==(const PropList& rhs) const { - htri_t ret_value = H5Pequal(id, rhs.getId()); - if( ret_value > 0 ) - return true; - else if( ret_value == 0 ) - return false; - else // Raise exception when H5Pequal returns a negative value - { - throw PropListIException(inMemFunc("operator=="), "H5Pequal failed"); - } + htri_t ret_value = H5Pequal(id, rhs.getId()); + if (ret_value > 0) + return true; + else if (ret_value == 0) + return false; + else // Raise exception when H5Pequal returns a negative value + { + throw PropListIException(inMemFunc("operator=="), "H5Pequal failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::getClassParent -///\brief Returns the parent class of a generic property class -///\return The parent class of a property class -///\exception H5::PropListIException +// Function: PropList::getClassParent +///\brief Returns the parent class of a generic property class +///\return The parent class of a property class +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- PropList PropList::getClassParent() const { - hid_t class_id = H5Pget_class_parent(id); - if (class_id < 0) - { - throw PropListIException(inMemFunc("getClassParent"), "H5Pget_class_parent failed"); - } - PropList pclass(class_id); - return(pclass); + hid_t class_id = H5Pget_class_parent(id); + if (class_id < 0) + { + throw PropListIException(inMemFunc("getClassParent"), "H5Pget_class_parent failed"); + } + PropList pclass(class_id); + return(pclass); } //-------------------------------------------------------------------------- -// Function: PropList destructor -///\brief Properly terminates access to this property list. -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList destructor +///\brief Properly terminates access to this property list. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- PropList::~PropList() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "PropList::~PropList - " << close_error.getDetailMsg() << endl; + cerr << "PropList::~PropList - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index faaf68d..3977774 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -28,111 +28,111 @@ namespace H5 { */ class H5_DLLCPP PropList : public IdComponent { public: - ///\brief Default property list + ///\brief Default property list static const PropList& DEFAULT; - // Creates a property list of a given type or creates a copy of an - // existing property list giving the property list id. - PropList(const hid_t plist_id); + // Creates a property list of a given type or creates a copy of an + // existing property list giving the property list id. + PropList(const hid_t plist_id); - // Make a copy of the given property list using assignment statement - PropList& operator=( const PropList& rhs ); + // Make a copy of the given property list using assignment statement + PropList& operator=(const PropList& rhs); - // Compares this property list or class against the given list or class. - bool operator==(const PropList& rhs) const; + // Compares this property list or class against the given list or class. + bool operator==(const PropList& rhs) const; - // Close this property list. - virtual void close(); + // Close this property list. + virtual void close(); - // Close a property list class. - void closeClass() const; + // Close a property list class. + void closeClass() const; - // Makes a copy of the given property list. - void copy( const PropList& like_plist ); + // Makes a copy of the given property list. + void copy(const PropList& like_plist); - // Copies a property from this property list or class to another - void copyProp( PropList& dest, const char* name) const; - void copyProp( PropList& dest, const H5std_string& name) const; + // Copies a property from this property list or class to another + void copyProp(PropList& dest, const char* name) const; + void copyProp(PropList& dest, const H5std_string& name) const; - // Copies a property from one property list or property class to another - void copyProp( PropList& dest, PropList& src, const char* name) const; - void copyProp( PropList& dest, PropList& src, const H5std_string& name) const; + // Copies a property from one property list or property class to another + void copyProp(PropList& dest, PropList& src, const char* name) const; + void copyProp(PropList& dest, PropList& src, const H5std_string& name) const; - // Gets the class of this property list, i.e. H5P_FILE_CREATE, - // H5P_FILE_ACCESS, ... - hid_t getClass() const; + // Gets the class of this property list, i.e. H5P_FILE_CREATE, + // H5P_FILE_ACCESS, ... + hid_t getClass() const; - // Return the name of a generic property list class. - H5std_string getClassName() const; + // Return the name of a generic property list class. + H5std_string getClassName() const; - // Returns the parent class of a generic property class. - PropList getClassParent() const; + // Returns the parent class of a generic property class. + PropList getClassParent() const; - // Returns the number of properties in this property list or class. - size_t getNumProps() const; + // Returns the number of properties in this property list or class. + size_t getNumProps() const; - // Query the value of a property in a property list. - void getProperty(const char* name, void* value) const; - void getProperty(const H5std_string& name, void* value) const; - H5std_string getProperty(const char* name) const; - H5std_string getProperty(const H5std_string& name) const; + // Query the value of a property in a property list. + void getProperty(const char* name, void* value) const; + void getProperty(const H5std_string& name, void* value) const; + H5std_string getProperty(const char* name) const; + H5std_string getProperty(const H5std_string& name) const; - // Set a property's value in a property list. - void setProperty(const char* name, void* value) const; - void setProperty(const char* name, const char* charptr) const; - void setProperty(const char* name, H5std_string& strg) const; - void setProperty(const H5std_string& name, void* value) const; - void setProperty(const H5std_string& name, H5std_string& strg) const; + // Set a property's value in a property list. + void setProperty(const char* name, void* value) const; + void setProperty(const char* name, const char* charptr) const; + void setProperty(const char* name, H5std_string& strg) const; + void setProperty(const H5std_string& name, void* value) const; + void setProperty(const H5std_string& name, H5std_string& strg) const; - // Query the size of a property in a property list or class. - size_t getPropSize(const char *name) const; - size_t getPropSize(const H5std_string& name) const; + // Query the size of a property in a property list or class. + size_t getPropSize(const char *name) const; + size_t getPropSize(const H5std_string& name) const; - // Determines whether a property list is a certain class. - bool isAClass(const PropList& prop_class) const; + // Determines whether a property list is a certain class. + bool isAClass(const PropList& prop_class) const; - /// Query the existance of a property in a property object. - bool propExist(const char* name) const; - bool propExist(const H5std_string& name) const; + /// Query the existance of a property in a property object. + bool propExist(const char* name) const; + bool propExist(const H5std_string& name) const; - // Removes a property from a property list. - void removeProp(const char *name) const; - void removeProp(const H5std_string& name) const; + // Removes a property from a property list. + void removeProp(const char *name) const; + void removeProp(const H5std_string& name) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("PropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("PropList"); } - // Default constructor: creates a stub PropList object. - PropList(); + // Default constructor: creates a stub PropList object. + PropList(); - // Copy constructor: creates a copy of a PropList object. - PropList(const PropList& original); + // Copy constructor: creates a copy of a PropList object. + PropList(const PropList& original); - // Gets the property list id. - virtual hid_t getId() const; + // Gets the property list id. + virtual hid_t getId() const; - // Destructor: properly terminates access to this property list. - virtual ~PropList(); + // Destructor: properly terminates access to this property list. + virtual ~PropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Deletes the PropList global constant - static void deleteConstants(); + // Deletes the PropList global constant + static void deleteConstants(); protected: - hid_t id; // HDF5 property list id + hid_t id; // HDF5 property list id - // Sets the property list id. - virtual void p_setId(const hid_t new_id); + // Sets the property list id. + virtual void p_setId(const hid_t new_id); private: - static PropList* DEFAULT_; + static PropList* DEFAULT_; - // Dynamically allocates the PropList global constant - static PropList* getConstant(); + // Dynamically allocates the PropList global constant + static PropList* getConstant(); - // Friend function to set PropList id. For library use only. - friend void f_PropList_setId(PropList* plist, hid_t new_id); + // Friend function to set PropList id. For library use only. + friend void f_PropList_setId(PropList* plist, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS }; diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 50c9e45..54981ab 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -36,249 +36,247 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: StrType default constructor -///\brief Default constructor: Creates a stub string datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType default constructor +///\brief Default constructor: Creates a stub string datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::StrType() : AtomType() {} //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Creates a string datatype using a predefined type. -///\param pred_type - IN: Predefined datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType overloaded constructor +///\brief Creates a string datatype using a predefined type. +///\param pred_type - IN: Predefined datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType::StrType( const PredType& pred_type ) : AtomType() +StrType::StrType(const PredType& pred_type) : AtomType() { - // use DataType::copy to make a copy of this predefined type - copy( pred_type ); + // use DataType::copy to make a copy of this predefined type + copy(pred_type); } //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -// Purpose Creates a string datatype with a specified length -// Param pred_type - IN: String predefined type to replicate. -// Param size - IN: Length of the new string type -// Exception H5::DataTypeIException +// Function: StrType overloaded constructor +// Purpose Creates a string datatype with a specified length +// Param pred_type - IN: String predefined type to replicate. +// Param size - IN: Length of the new string type +// Exception H5::DataTypeIException // Description -// The 1st argument could have been skipped, but this -// constructor will collide with the one that takes an -// existing id. +// The 1st argument could have been skipped, but this +// constructor will collide with the one that takes an +// existing id. // -// Update: replacing the 1st argument with a dummy 0 to -// avoid the clashing problem, that doesn't eliminate the -// the 1st argument but it's simpler for the user to type -// a '0' than PredType::C_S1. - Dec 2, 2005 +// Update: replacing the 1st argument with a dummy 0 to +// avoid the clashing problem, that doesn't eliminate the +// the 1st argument but it's simpler for the user to type +// a '0' than PredType::C_S1. - Dec 2, 2005 // Note -// The use of this constructor can be shortened by using -// its overloaded below as StrType(0, size). -// Programmer Binh-Minh Ribler - 2000 +// The use of this constructor can be shortened by using +// its overloaded below as StrType(0, size). +// Programmer Binh-Minh Ribler - 2000 // Modification -// Planned for removal. -BMR, 2005/12/02 -// Removed from documentation. -BMR, 2016/03/07 +// Planned for removal. -BMR, 2005/12/02 +// Removed from documentation. -BMR, 2016/03/07 //-------------------------------------------------------------------------- -StrType::StrType( const PredType& pred_type, const size_t& size ) : AtomType() +StrType::StrType(const PredType& pred_type, const size_t& size) : AtomType() { - // use DataType::copy to make a copy of the string predefined type - // then set its length - copy(pred_type); - setSize(size); + // use DataType::copy to make a copy of the string predefined type + // then set its length + copy(pred_type); + setSize(size); } //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Creates a string datatype with a specified length -///\param dummy - IN: To simplify calling the previous constructor -/// and avoid prototype clash with another constructor -///\param size - IN: Length of the new string type -///\exception H5::DataTypeIException +// Function: StrType overloaded constructor +///\brief Creates a string datatype with a specified length +///\param dummy - IN: To simplify calling the previous constructor +/// and avoid prototype clash with another constructor +///\param size - IN: Length of the new string type +///\exception H5::DataTypeIException ///\par Description -/// The 1st argument is just a dummy to simplify calling the -/// previous constructor, such as: -/// StrType atype(0, size) instead of -/// StrType atype(PredType::C_S1, size) +/// The 1st argument is just a dummy to simplify calling the +/// previous constructor, such as: +/// StrType atype(0, size) instead of +/// StrType atype(PredType::C_S1, size) // Note -// This constructor replaced the previous one. -// Programmer Binh-Minh Ribler - Nov 28, 2005 +// This constructor replaced the previous one. +// Programmer Binh-Minh Ribler - Nov 28, 2005 //-------------------------------------------------------------------------- -StrType::StrType( const int dummy, const size_t& size ) : AtomType() +StrType::StrType(const int dummy, const size_t& size) : AtomType() { - // use DataType::copy to make a copy of the string predefined type - // then set its length - copy(PredType::C_S1); - setSize(size); + // use DataType::copy to make a copy of the string predefined type + // then set its length + copy(PredType::C_S1); + setSize(size); } //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Creates an StrType object using the id of an existing datatype. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType overloaded constructor +///\brief Creates an StrType object using the id of an existing datatype. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType::StrType( const hid_t existing_id ) : AtomType( existing_id ) {} +StrType::StrType(const hid_t existing_id) : AtomType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: StrType copy constructor -///\brief Copy constructor: makes a copy of the original StrType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType copy constructor +///\brief Copy constructor: makes a copy of the original StrType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType::StrType( const StrType& original ) : AtomType ( original ) {} +StrType::StrType(const StrType& original) : AtomType ( original ) {} //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Gets the string datatype of the specified dataset -///\param dataset - IN: Dataset that this string datatype associates with -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType overloaded constructor +///\brief Gets the string datatype of the specified dataset +///\param dataset - IN: Dataset that this string datatype associates with +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType::StrType( const DataSet& dataset ) : AtomType () +StrType::StrType(const DataSet& dataset) : AtomType () { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type( dataset.getId() ); + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type(dataset.getId()); - if( id < 0 ) - { - throw DataSetIException("StrType constructor", "H5Dget_type failed"); - } + if (id < 0) + { + throw DataSetIException("StrType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Creates an StrType instance by opening an HDF5 string datatype -/// given its name, provided as a C character string. -///\param dtype_name - IN: String type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: StrType overloaded constructor +///\brief Creates an StrType instance by opening an HDF5 string datatype +/// given its name, provided as a C character string. +///\param dtype_name - IN: String type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openStrType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openStrType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- StrType::StrType(const H5Location& loc, const char *dtype_name) : AtomType() { - id = p_opentype(loc, dtype_name); + id = p_opentype(loc, dtype_name); } //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Creates an StrType instance by opening an HDF5 string datatype -/// given its name, provided as an \c H5std_string. -///\param dtype_name - IN: String type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: StrType overloaded constructor +///\brief Creates an StrType instance by opening an HDF5 string datatype +/// given its name, provided as an \c H5std_string. +///\param dtype_name - IN: String type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openStrType(const H5std_string&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openStrType(const H5std_string&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- StrType::StrType(const H5Location& loc, const H5std_string& dtype_name) : AtomType() { - id = p_opentype(loc, dtype_name.c_str()); + id = p_opentype(loc, dtype_name.c_str()); } //-------------------------------------------------------------------------- -// Function: StrType::getCset -///\brief Retrieves the character set type of this string datatype. -///\return Character set type, which can be: -/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. +// Function: StrType::getCset +///\brief Retrieves the character set type of this string datatype. +///\return Character set type, which can be: +/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. ///\note -/// ASCII and UTF-8 Unicode are the only currently supported character -/// encodings. Extended ASCII encodings (for example, ISO 8859) are not -/// supported. This encoding policy is not enforced by the HDF5 Library. -/// Using encodings other than ASCII and UTF-8 can lead to compatibility -/// and usability problems. See the C API entry H5Pset_char_encoding for -/// more information. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +/// ASCII and UTF-8 Unicode are the only currently supported character +/// encodings. Extended ASCII encodings (for example, ISO 8859) are not +/// supported. This encoding policy is not enforced by the HDF5 Library. +/// Using encodings other than ASCII and UTF-8 can lead to compatibility +/// and usability problems. See the C API entry H5Pset_char_encoding for +/// more information. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_cset_t StrType::getCset() const { - H5T_cset_t cset = H5Tget_cset( id ); + H5T_cset_t cset = H5Tget_cset(id); - // Returns a valid character set type if successful - if( cset == H5T_CSET_ERROR ) - { - throw DataTypeIException("StrType::getCset", "H5Tget_cset failed"); - } - return( cset ); + // Returns a valid character set type if successful + if (cset == H5T_CSET_ERROR) + { + throw DataTypeIException("StrType::getCset", "H5Tget_cset failed"); + } + return(cset); } //-------------------------------------------------------------------------- -// Function: StrType::setCset -///\brief Sets character set to be used. -///\param cset - IN: character set type, which can be: -/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. +// Function: StrType::setCset +///\brief Sets character set to be used. +///\param cset - IN: character set type, which can be: +/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. ///\note -/// ASCII and UTF-8 Unicode are the only currently supported character -/// encodings. Extended ASCII encodings (for example, ISO 8859) are not -/// supported. This encoding policy is not enforced by the HDF5 Library. -/// Using encodings other than ASCII and UTF-8 can lead to compatibility -/// and usability problems. See the C API entry H5Pset_char_encoding for -/// more information. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +/// ASCII and UTF-8 Unicode are the only currently supported character +/// encodings. Extended ASCII encodings (for example, ISO 8859) are not +/// supported. This encoding policy is not enforced by the HDF5 Library. +/// Using encodings other than ASCII and UTF-8 can lead to compatibility +/// and usability problems. See the C API entry H5Pset_char_encoding for +/// more information. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void StrType::setCset( H5T_cset_t cset ) const +void StrType::setCset(H5T_cset_t cset) const { - herr_t ret_value = H5Tset_cset( id, cset ); - - if( ret_value < 0 ) - { - throw DataTypeIException("StrType::setCset", "H5Tset_cset failed"); - } + herr_t ret_value = H5Tset_cset(id, cset); + if (ret_value < 0) + { + throw DataTypeIException("StrType::setCset", "H5Tset_cset failed"); + } } //-------------------------------------------------------------------------- -// Function: StrType::getStrpad -///\brief Retrieves the storage mechanism for of this string datatype. -///\return String storage mechanism, which can be: -/// \li \c H5T_STR_NULLTERM (0) - Null terminate (as C does) -/// \li \c H5T_STR_NULLPAD (0) - Pad with zeros -/// \li \c H5T_STR_SPACEPAD (0) - pad with spaces (as FORTRAN does) -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType::getStrpad +///\brief Retrieves the storage mechanism for of this string datatype. +///\return String storage mechanism, which can be: +/// \li \c H5T_STR_NULLTERM (0) - Null terminate (as C does) +/// \li \c H5T_STR_NULLPAD (0) - Pad with zeros +/// \li \c H5T_STR_SPACEPAD (0) - pad with spaces (as FORTRAN does) +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_str_t StrType::getStrpad() const { - H5T_str_t strpad = H5Tget_strpad( id ); + H5T_str_t strpad = H5Tget_strpad(id); - // Returns a valid string padding type if successful - if( strpad == H5T_STR_ERROR ) - { - throw DataTypeIException("StrType::getStrpad", - "H5Tget_strpad failed - returned H5T_STR_ERROR"); - } - return( strpad ); + // Returns a valid string padding type if successful + if (strpad == H5T_STR_ERROR) + { + throw DataTypeIException("StrType::getStrpad", + "H5Tget_strpad failed - returned H5T_STR_ERROR"); + } + return(strpad); } //-------------------------------------------------------------------------- -// Function: StrType::setStrpad -///\brief Defines the storage mechanism for this string datatype. -///\param strpad - IN: String padding type -///\exception H5::DataTypeIException +// Function: StrType::setStrpad +///\brief Defines the storage mechanism for this string datatype. +///\param strpad - IN: String padding type +///\exception H5::DataTypeIException ///\par Description -/// For detail, please refer to the C layer Reference Manual at: +/// For detail, please refer to the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetStrpad -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void StrType::setStrpad( H5T_str_t strpad ) const +void StrType::setStrpad(H5T_str_t strpad) const { - herr_t ret_value = H5Tset_strpad( id, strpad ); - - if( ret_value < 0 ) - { - throw DataTypeIException("StrType::setStrpad", "H5Tset_strpad failed"); - } + herr_t ret_value = H5Tset_strpad(id, strpad); + if (ret_value < 0) + { + throw DataTypeIException("StrType::setStrpad", "H5Tset_strpad failed"); + } } //-------------------------------------------------------------------------- -// Function: StrType destructor -///\brief Properly terminates access to this string datatype. -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType destructor +///\brief Properly terminates access to this string datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::~StrType() {} diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index b920a3b..3272ad3 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -27,48 +27,48 @@ namespace H5 { */ class H5_DLLCPP StrType : public AtomType { public: - // Creates a string type using a predefined type - StrType(const PredType& pred_type); + // Creates a string type using a predefined type + StrType(const PredType& pred_type); - // Creates a string type with specified length - may be obsolete - StrType(const PredType& pred_type, const size_t& size); + // Creates a string type with specified length - may be obsolete + StrType(const PredType& pred_type, const size_t& size); - // Creates a string type with specified length - StrType(const int dummy, const size_t& size); + // Creates a string type with specified length + StrType(const int dummy, const size_t& size); // Gets the string datatype of the specified dataset - StrType(const DataSet& dataset); + StrType(const DataSet& dataset); - // Constructors that open an HDF5 string datatype, given a location. - StrType(const H5Location& loc, const char* name); - StrType(const H5Location& loc, const H5std_string& name); + // Constructors that open an HDF5 string datatype, given a location. + StrType(const H5Location& loc, const char* name); + StrType(const H5Location& loc, const H5std_string& name); - // Retrieves the character set type of this string datatype. - H5T_cset_t getCset() const; + // Retrieves the character set type of this string datatype. + H5T_cset_t getCset() const; - // Sets character set to be used. - void setCset(H5T_cset_t cset) const; + // Sets character set to be used. + void setCset(H5T_cset_t cset) const; - // Retrieves the string padding method for this string datatype. - H5T_str_t getStrpad() const; + // Retrieves the string padding method for this string datatype. + H5T_str_t getStrpad() const; - // Defines the storage mechanism for character strings. - void setStrpad(H5T_str_t strpad) const; + // Defines the storage mechanism for character strings. + void setStrpad(H5T_str_t strpad) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("StrType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("StrType"); } - // default constructor - StrType(); + // default constructor + StrType(); - // Creates a string datatype using an existing id - StrType(const hid_t existing_id); + // Creates a string datatype using an existing id + StrType(const hid_t existing_id); - // Copy constructor - makes a copy of the original object - StrType(const StrType& original); + // Copy constructor - makes a copy of the original object + StrType(const StrType& original); - // Noop destructor. - virtual ~StrType(); + // Noop destructor. + virtual ~StrType(); }; } #endif // __H5StrType_H diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 5ecc39b..7f50b9a 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -30,88 +30,88 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: VarLenType default constructor -///\brief Default constructor: Creates a stub variable-length datatype. +// Function: VarLenType default constructor +///\brief Default constructor: Creates a stub variable-length datatype. //-------------------------------------------------------------------------- VarLenType::VarLenType() : DataType() {} //-------------------------------------------------------------------------- -// Function: VarLenType overloaded constructor -///\brief Creates an VarLenType object using an existing id. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: VarLenType overloaded constructor +///\brief Creates an VarLenType object using an existing id. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::VarLenType(const hid_t existing_id) : DataType(existing_id) {} //-------------------------------------------------------------------------- -// Function: VarLenType copy constructor -///\brief Copy constructor: makes a copy of the original VarLenType object. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: VarLenType copy constructor +///\brief Copy constructor: makes a copy of the original VarLenType object. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::VarLenType(const VarLenType& original) : DataType(original) {} //-------------------------------------------------------------------------- -// Function: VarLenType overloaded constructor -///\brief Creates a new variable-length datatype based on the specified -/// \a base_type. -///\param base_type - IN: Pointer to existing datatype -///\exception H5::DataTypeIException +// Function: VarLenType overloaded constructor +///\brief Creates a new variable-length datatype based on the specified +/// \a base_type. +///\param base_type - IN: Pointer to existing datatype +///\exception H5::DataTypeIException // Description -// DataType passed by pointer to avoid clashing with copy -// constructor. -// Programmer Binh-Minh Ribler - May, 2004 +// DataType passed by pointer to avoid clashing with copy +// constructor. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::VarLenType(const DataType* base_type) : DataType() { - id = H5Tvlen_create(base_type->getId()); - if (id < 0) - { - throw DataTypeIException("VarLenType constructor", + id = H5Tvlen_create(base_type->getId()); + if (id < 0) + { + throw DataTypeIException("VarLenType constructor", "H5Tvlen_create returns negative value"); - } + } } //-------------------------------------------------------------------------- -// Function: VarLenType overloaded constructor -///\brief Creates an VarLenType instance by opening an HDF5 variable -/// length datatype given its name, provided as a C char*. -///\param dtype_name - IN: Variable length type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: VarLenType overloaded constructor +///\brief Creates an VarLenType instance by opening an HDF5 variable +/// length datatype given its name, provided as a C char*. +///\param dtype_name - IN: Variable length type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openVarLenType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openVarLenType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- VarLenType::VarLenType(const H5Location& loc, const char *dtype_name) : DataType() { - id = p_opentype(loc, dtype_name); + id = p_opentype(loc, dtype_name); } //-------------------------------------------------------------------------- -// Function: VarLenType overloaded constructor -///\brief Creates an VarLenType instance by opening an HDF5 variable -/// length datatype given its name, provided as an \c H5std_string. -///\param dtype_name - IN: Variable length type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: VarLenType overloaded constructor +///\brief Creates an VarLenType instance by opening an HDF5 variable +/// length datatype given its name, provided as an \c H5std_string. +///\param dtype_name - IN: Variable length type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openVarLenType(const H5std_string&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openVarLenType(const H5std_string&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- VarLenType::VarLenType(const H5Location& loc, const H5std_string& dtype_name) : DataType() { - id = p_opentype(loc, dtype_name.c_str()); + id = p_opentype(loc, dtype_name.c_str()); } //-------------------------------------------------------------------------- -// Function: VarLenType destructor -///\brief Properly terminates access to this datatype. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: VarLenType destructor +///\brief Properly terminates access to this datatype. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::~VarLenType() {} diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index af4f7b7..a93f44d 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -27,28 +27,28 @@ namespace H5 { */ class H5_DLLCPP VarLenType : public DataType { public: - // Constructor that creates a variable-length datatype based - // on the specified base type. - VarLenType(const DataType* base_type); + // Constructor that creates a variable-length datatype based + // on the specified base type. + VarLenType(const DataType* base_type); - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("VarLenType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("VarLenType"); } - // Copy constructor: makes copy of the original object. - VarLenType( const VarLenType& original ); + // Copy constructor: makes copy of the original object. + VarLenType(const VarLenType& original); - // Constructor that takes an existing id - VarLenType( const hid_t existing_id ); + // Constructor that takes an existing id + VarLenType(const hid_t existing_id); - // Constructors that open a variable-length datatype, given a location. - VarLenType(const H5Location& loc, const char* name); - VarLenType(const H5Location& loc, const H5std_string& name); + // Constructors that open a variable-length datatype, given a location. + VarLenType(const H5Location& loc, const char* name); + VarLenType(const H5Location& loc, const H5std_string& name); - // Noop destructor - virtual ~VarLenType(); + // Noop destructor + virtual ~VarLenType(); - // Default constructor - VarLenType(); + // Default constructor + VarLenType(); }; } #endif // __H5VarLenType_H diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 75ea500..65815f9 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_CPP_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index 9bcc706..d23a80b 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -20,7 +20,20 @@ add_test ( titerate.h5 ) -add_test (NAME CPP_testhdf5 COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME CPP_testhdf5 COMMAND $) +else () + add_test (NAME CPP_testhdf5 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cpp_testhdf5.txt" + #-D "TEST_REFERENCE=cpp_testhdf5.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (CPP_testhdf5 PROPERTIES DEPENDS CPP_testhdf5-clear-objects) if (HDF5_TEST_VFD) @@ -36,9 +49,9 @@ if (HDF5_TEST_VFD) if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) - endif (DIRECT_VFD) + endif () - MACRO (ADD_VFD_TEST vfdname resultcode) + macro (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}") add_test ( @@ -66,12 +79,12 @@ if (HDF5_TEST_VFD) ) set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects) set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT 30) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_VFD_TEST) + endif () + endmacro () # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - endforeach (vfd ${VFD_LIST}) + endforeach () -endif (HDF5_TEST_VFD) +endif () diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 8752744..48a0c4d 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -16,12 +16,12 @@ /***************************************************************************** FILE dsets.cpp - HDF5 C++ testing the functionalities associated with the - C dataset interface (H5D) + C dataset interface (H5D) EXTERNAL ROUTINES/VARIABLES: These routines are in the test directory of the C library: - h5_reset() -- in h5test.c, resets the library by closing it - h5_fileaccess() -- in h5test.c, returns a file access template + h5_reset() -- in h5test.c, resets the library by closing it + h5_fileaccess() -- in h5test.c, returns a file access template ***************************************************************************/ @@ -34,20 +34,20 @@ using std::cerr; using std::endl; #include -#include "H5Cpp.h" // C++ API header file +#include "H5Cpp.h" // C++ API header file using namespace H5; #include "h5test.h" -#include "h5cpputil.h" // C++ utilility header file +#include "h5cpputil.h" // C++ utilility header file -const H5std_string FILE1("dataset.h5"); -const H5std_string DSET_DEFAULT_NAME("default"); -const H5std_string DSET_DEFAULT_NAME_PATH("/default"); -const H5std_string DSET_CHUNKED_NAME("chunked"); -const H5std_string DSET_SIMPLE_IO_NAME("simple_io"); -const H5std_string DSET_TCONV_NAME ("tconv"); -const H5std_string DSET_COMPRESS_NAME("compressed"); -const H5std_string DSET_BOGUS_NAME ("bogus"); +const H5std_string FILE1("dataset.h5"); +const H5std_string DSET_DEFAULT_NAME("default"); +const H5std_string DSET_DEFAULT_NAME_PATH("/default"); +const H5std_string DSET_CHUNKED_NAME("chunked"); +const H5std_string DSET_SIMPLE_IO_NAME("simple_io"); +const H5std_string DSET_TCONV_NAME("tconv"); +const H5std_string DSET_COMPRESS_NAME("compressed"); +const H5std_string DSET_BOGUS_NAME("bogus"); /* Temporary filter IDs used for testing */ const int H5Z_FILTER_BOGUS = 305; @@ -58,16 +58,16 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, /*------------------------------------------------------------------------- - * Function: test_create + * Function: test_create * - * Purpose: Attempts to create a dataset. + * Purpose Attempts to create a dataset. * - * Return: Success: 0 + * Return Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: * @@ -81,125 +81,125 @@ test_create( H5File& file) // Setting this to NULL for cleaning up in failure situations DataSet *dataset = NULL; try { - // Create a data space - hsize_t dims[2]; - dims[0] = 256; - dims[1] = 512; - DataSpace space (2, dims, NULL); - - // Create a dataset using the default dataset creation properties. - // We're not sure what they are, so we won't check. - dataset = new DataSet (file.createDataSet - (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); - - - // Add a comment to the dataset - file.setComment (DSET_DEFAULT_NAME, "This is a dataset"); - - // Close the dataset - delete dataset; - dataset = NULL; - - // Try creating a dataset that already exists. This should fail since a - // dataset can only be created once. If an exception is not thrown for - // this action by createDataSet, then throw an invalid action exception. - try { - dataset = new DataSet (file.createDataSet - (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); - - // continuation here, that means no exception has been thrown - throw InvalidActionException("H5File::createDataSet", "Library allowed overwrite of existing dataset"); - } - catch (FileIException& E) // catching invalid creating dataset - {} // do nothing, exception expected - - // Open the dataset we created above and then close it. This is one - // way to open an existing dataset for accessing. - dataset = new DataSet (file.openDataSet (DSET_DEFAULT_NAME)); - - // Get and verify the name of this dataset, using - // H5std_string getObjName() - H5std_string ds_name = dataset->getObjName(); - verify_val(ds_name, DSET_DEFAULT_NAME_PATH, "DataSet::getObjName", __LINE__, __FILE__); - - // Get and verify the comment from this dataset, using - // H5std_string getComment(const H5std_string& name, ) - H5std_string comment = file.getComment(DSET_DEFAULT_NAME); - verify_val(comment, "This is a dataset", "DataSet::getComment", __LINE__, __FILE__); - - // Close the dataset when accessing is completed - delete dataset; - - // This is another way to open an existing dataset for accessing. - DataSet another_dataset(file.openDataSet (DSET_DEFAULT_NAME)); - - // Try opening a non-existent dataset. This should fail so if an - // exception is not thrown for this action by openDataSet, then - // display failure information and throw an exception. - try { - dataset = new DataSet (file.openDataSet( "does_not_exist" )); - - // continuation here, that means no exception has been thrown - throw InvalidActionException("H5File::openDataSet", "Attempted to open a non-existent dataset"); - } - catch (FileIException& E ) // catching creating non-existent dataset - {} // do nothing, exception expected - - // Create a new dataset that uses chunked storage instead of the default - // layout. - DSetCreatPropList create_parms; - hsize_t csize[2]; - csize[0] = 5; - csize[1] = 100; - create_parms.setChunk( 2, csize ); - - dataset = new DataSet (file.createDataSet - (DSET_CHUNKED_NAME, PredType::NATIVE_DOUBLE, space, create_parms)); - // Note: this one has no error message in C when failure occurs? - - // clean up and return with success - delete dataset; - - PASSED(); - return 0; - } // outer most try block + // Create a data space + hsize_t dims[2]; + dims[0] = 256; + dims[1] = 512; + DataSpace space (2, dims, NULL); + + // Create a dataset using the default dataset creation properties. + // We're not sure what they are, so we won't check. + dataset = new DataSet (file.createDataSet + (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); + + + // Add a comment to the dataset + file.setComment (DSET_DEFAULT_NAME, "This is a dataset"); + + // Close the dataset + delete dataset; + dataset = NULL; + + // Try creating a dataset that already exists. This should fail since a + // dataset can only be created once. If an exception is not thrown for + // this action by createDataSet, then throw an invalid action exception. + try { + dataset = new DataSet (file.createDataSet + (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); + + // continuation here, that means no exception has been thrown + throw InvalidActionException("H5File::createDataSet", "Library allowed overwrite of existing dataset"); + } + catch (FileIException& E) // catching invalid creating dataset + {} // do nothing, exception expected + + // Open the dataset we created above and then close it. This is one + // way to open an existing dataset for accessing. + dataset = new DataSet (file.openDataSet (DSET_DEFAULT_NAME)); + + // Get and verify the name of this dataset, using + // H5std_string getObjName() + H5std_string ds_name = dataset->getObjName(); + verify_val(ds_name, DSET_DEFAULT_NAME_PATH, "DataSet::getObjName", __LINE__, __FILE__); + + // Get and verify the comment from this dataset, using + // H5std_string getComment(const H5std_string& name, ) + H5std_string comment = file.getComment(DSET_DEFAULT_NAME); + verify_val(comment, "This is a dataset", "DataSet::getComment", __LINE__, __FILE__); + + // Close the dataset when accessing is completed + delete dataset; + + // This is another way to open an existing dataset for accessing. + DataSet another_dataset(file.openDataSet (DSET_DEFAULT_NAME)); + + // Try opening a non-existent dataset. This should fail so if an + // exception is not thrown for this action by openDataSet, then + // display failure information and throw an exception. + try { + dataset = new DataSet (file.openDataSet( "does_not_exist" )); + + // continuation here, that means no exception has been thrown + throw InvalidActionException("H5File::openDataSet", "Attempted to open a non-existent dataset"); + } + catch (FileIException& E ) // catching creating non-existent dataset + {} // do nothing, exception expected + + // Create a new dataset that uses chunked storage instead of the default + // layout. + DSetCreatPropList create_parms; + hsize_t csize[2]; + csize[0] = 5; + csize[1] = 100; + create_parms.setChunk( 2, csize ); + + dataset = new DataSet (file.createDataSet(DSET_CHUNKED_NAME, + PredType::NATIVE_DOUBLE, space, create_parms)); + // Note: this one has no error message in C when failure occurs? + + // clean up and return with success + delete dataset; + + PASSED(); + return 0; + } // outer most try block catch (InvalidActionException& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - // clean up and return with failure - if (dataset != NULL) - delete dataset; - return -1; + // clean up and return with failure + if (dataset != NULL) + delete dataset; + return -1; } // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_create", __LINE__, __FILE__); + issue_fail_msg("test_create", __LINE__, __FILE__); - // clean up and return with failure - if (dataset != NULL) - delete dataset; - return -1; + // clean up and return with failure + if (dataset != NULL) + delete dataset; + return -1; } } // test_create /*------------------------------------------------------------------------- - * Function: test_simple_io + * Function: test_simple_io * - * Purpose: Tests simple I/O. That is, reading and writing a complete - * multi-dimensional array without data type or data space - * conversions, without compression, and stored contiguously. + * Purpose Tests simple I/O. That is, reading and writing a complete + * multi-dimensional array without data type or data space + * conversions, without compression, and stored contiguously. * - * Return: Success: 0 + * Return Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: * @@ -211,81 +211,81 @@ test_simple_io( H5File& file) SUBTEST("Simple I/O"); - int points[100][200]; - int check[100][200]; - int i, j, n; + int points[100][200]; + int check[100][200]; + int i, j, n; // Initialize the dataset for (i = n = 0; i < 100; i++) { - for (j = 0; j < 200; j++) { - points[i][j] = n++; - } + for (j = 0; j < 200; j++) { + points[i][j] = n++; + } } char* tconv_buf = new char [1000]; try { - // Create the data space - hsize_t dims[2]; - dims[0] = 100; - dims[1] = 200; - DataSpace space (2, dims, NULL); - - // Create a small conversion buffer to test strip mining - DSetMemXferPropList xfer; - - xfer.setBuffer (1000, tconv_buf, NULL); - - // Create the dataset - DataSet dataset (file.createDataSet (DSET_SIMPLE_IO_NAME, PredType::NATIVE_INT, space)); - - // Write the data to the dataset - dataset.write(static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Read the dataset back - dataset.read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < 100; i++) - for (j = 0; j < 200; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("DataSet::read"); - } - - // clean up and return with success - delete [] tconv_buf; - PASSED(); - return 0; + // Create the data space + hsize_t dims[2]; + dims[0] = 100; + dims[1] = 200; + DataSpace space (2, dims, NULL); + + // Create a small conversion buffer to test strip mining + DSetMemXferPropList xfer; + + xfer.setBuffer (1000, tconv_buf, NULL); + + // Create the dataset + DataSet dataset (file.createDataSet (DSET_SIMPLE_IO_NAME, PredType::NATIVE_INT, space)); + + // Write the data to the dataset + dataset.write(static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Read the dataset back + dataset.read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < 100; i++) + for (j = 0; j < 200; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("DataSet::read"); + } + + // clean up and return with success + delete [] tconv_buf; + PASSED(); + return 0; } // end try // catch all dataset, space, plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - // clean up and return with failure - if (tconv_buf) - delete [] tconv_buf; - return -1; + // clean up and return with failure + if (tconv_buf) + delete [] tconv_buf; + return -1; } } // test_simple_io /*------------------------------------------------------------------------- - * Function: test_datasize + * Function: test_datasize * - * Purpose: Tests DataSet::getInMemDataSize(). + * Purpose Tests DataSet::getInMemDataSize(). * - * Return: Success: 0 + * Return Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * Thursday, March 22, 2012 + * Programmer Binh-Minh Ribler + * Thursday, March 22, 2012 * * Modifications: * @@ -297,65 +297,65 @@ test_datasize(FileAccPropList &fapl) SUBTEST("DataSet::getInMemDataSize()"); try { - // Open FILE1. - H5File file(FILE1, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); - - // Open dataset DSET_SIMPLE_IO_NAME. - DataSet dset = file.openDataSet (DSET_SIMPLE_IO_NAME); - - // Get the dataset's dataspace to calculate the size for verification. - DataSpace space(dset.getSpace()); - - // Get the dimension sizes. - hsize_t dims[2]; - int n_dims = space.getSimpleExtentDims(dims); - if (n_dims < 0) - { - throw Exception("test_compression", "DataSpace::getSimpleExtentDims() failed"); - } - - // Calculate the supposed size. Size of each value is int (4), from - // test_simple_io. - size_t expected_size = 4 * dims[0] * dims[1]; - - // getInMemDataSize() returns the in memory size of the data. - size_t ds_size = dset.getInMemDataSize(); - - // Verify the data size. - if (ds_size != expected_size) - { - H5_FAILED(); - cerr << " Expected data size = " << expected_size; - cerr << " but dset.getInMemDataSize() returned " << ds_size << endl; - throw Exception("test_compression", "Failed in testing DataSet::getInMemDataSize()"); - } - - PASSED(); - return 0; + // Open FILE1. + H5File file(FILE1, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); + + // Open dataset DSET_SIMPLE_IO_NAME. + DataSet dset = file.openDataSet (DSET_SIMPLE_IO_NAME); + + // Get the dataset's dataspace to calculate the size for verification. + DataSpace space(dset.getSpace()); + + // Get the dimension sizes. + hsize_t dims[2]; + int n_dims = space.getSimpleExtentDims(dims); + if (n_dims < 0) + { + throw Exception("test_compression", "DataSpace::getSimpleExtentDims() failed"); + } + + // Calculate the supposed size. Size of each value is int (4), from + // test_simple_io. + size_t expected_size = 4 * dims[0] * dims[1]; + + // getInMemDataSize() returns the in memory size of the data. + size_t ds_size = dset.getInMemDataSize(); + + // Verify the data size. + if (ds_size != expected_size) + { + H5_FAILED(); + cerr << " Expected data size = " << expected_size; + cerr << " but dset.getInMemDataSize() returned " << ds_size << endl; + throw Exception("test_compression", "Failed in testing DataSet::getInMemDataSize()"); + } + + PASSED(); + return 0; } // end try // catch all dataset, space, plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - return -1; + return -1; } } // test_datasize /*------------------------------------------------------------------------- - * Function: test_tconv + * Function: test_tconv * - * Purpose: Test some simple data type conversion stuff. + * Purpose Test some simple data type conversion stuff. * - * Return: Success: 0 + * Return Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: * @@ -365,7 +365,7 @@ static herr_t test_tconv(H5File& file) { // Prepare buffers for input/output - char *out=NULL, *in=NULL; + char *out=NULL, *in=NULL; out = new char [4*1000000]; // assert (out); - should use exception handler for new - BMR in = new char [4*1000000]; @@ -375,81 +375,81 @@ test_tconv(H5File& file) // Initialize the dataset for (int i = 0; i < 1000000; i++) { - out[i*4+0] = 0x11; - out[i*4+1] = 0x22; - out[i*4+2] = 0x33; - out[i*4+3] = 0x44; + out[i*4+0] = 0x11; + out[i*4+1] = 0x22; + out[i*4+2] = 0x33; + out[i*4+3] = 0x44; } try { - // Create the data space - hsize_t dims[1]; - dims[0] = 1000000; - DataSpace space (1, dims, NULL); - - // Create the data set - DataSet dataset (file.createDataSet (DSET_TCONV_NAME, PredType::STD_I32LE, space)); - - // Write the data to the dataset - dataset.write (static_cast(out), PredType::STD_I32LE); - - // Read data with byte order conversion - dataset.read (static_cast(in), PredType::STD_I32BE); - - // Check - for (int i = 0; i < 1000000; i++) { - if (in[4*i+0]!=out[4*i+3] || - in[4*i+1]!=out[4*i+2] || - in[4*i+2]!=out[4*i+1] || - in[4*i+3]!=out[4*i+0]) - { - throw Exception("DataSet::read", "Read with byte order conversion failed"); - } - } - - // clean up and return with success - delete [] out; - delete [] in; - PASSED(); - return 0; + // Create the data space + hsize_t dims[1]; + dims[0] = 1000000; + DataSpace space (1, dims, NULL); + + // Create the data set + DataSet dataset (file.createDataSet (DSET_TCONV_NAME, PredType::STD_I32LE, space)); + + // Write the data to the dataset + dataset.write (static_cast(out), PredType::STD_I32LE); + + // Read data with byte order conversion + dataset.read (static_cast(in), PredType::STD_I32BE); + + // Check + for (int i = 0; i < 1000000; i++) { + if (in[4*i+0]!=out[4*i+3] || + in[4*i+1]!=out[4*i+2] || + in[4*i+2]!=out[4*i+1] || + in[4*i+3]!=out[4*i+0]) + { + throw Exception("DataSet::read", "Read with byte order conversion failed"); + } + } + + // clean up and return with success + delete [] out; + delete [] in; + PASSED(); + return 0; } // end try // catch all dataset and space exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - // clean up and return with failure - delete [] out; - delete [] in; - return -1; + // clean up and return with failure + delete [] out; + delete [] in; + return -1; } } // test_tconv /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version number */ - H5Z_FILTER_BOGUS, /* Filter id number */ - 1, 1, /* Encode and decode enabled */ - "bogus", /* Filter name for debugging */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version number */ + H5Z_FILTER_BOGUS, /* Filter id number */ + 1, 1, /* Encode and decode enabled */ + "bogus", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - (H5Z_func_t)filter_bogus, /* The actual filter function */ + (H5Z_func_t)filter_bogus, /* The actual filter function */ }}; /*------------------------------------------------------------------------- - * Function: bogus + * Function: bogus * - * Purpose: A bogus compression method that doesn't do anything. + * Purpose A bogus compression method that doesn't do anything. * - * Return: Success: Data chunk size + * Return Success: Data chunk size * - * Failure: 0 + * Failure: 0 * - * Programmer: Robb Matzke - * Tuesday, April 21, 1998 + * Programmer Robb Matzke + * Tuesday, April 21, 1998 * * Modifications: * @@ -466,19 +466,19 @@ filter_bogus(unsigned int flags, size_t cd_nelmts, /*------------------------------------------------------------------------- - * Function: test_compression + * Function: test_compression * - * Purpose: Tests dataset compression. If compression is requested when - * it hasn't been compiled into the library (such as when - * updating an existing compressed dataset) then data is sent to - * the file uncompressed but no errors are returned. + * Purpose Tests dataset compression. If compression is requested when + * it hasn't been compiled into the library (such as when + * updating an existing compressed dataset) then data is sent to + * the file uncompressed but no errors are returned. * - * Return: Success: 0 + * Return Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: * @@ -488,266 +488,266 @@ static herr_t test_compression(H5File& file) { #ifndef H5_HAVE_FILTER_DEFLATE - const char *not_supported; + const char *not_supported; not_supported = " Deflate compression is not enabled."; #endif /* H5_HAVE_FILTER_DEFLATE */ - int points[100][200]; - int check[100][200]; - hsize_t i, j, n; + int points[100][200]; + int check[100][200]; + hsize_t i, j, n; // Initialize the dataset for (i = n = 0; i < 100; i++) { - for (j = 0; j < 200; j++) { - points[i][j] = static_cast(n++); - } + for (j = 0; j < 200; j++) { + points[i][j] = static_cast(n++); + } } char* tconv_buf = new char [1000]; DataSet* dataset = NULL; try { - const hsize_t size[2] = {100, 200}; - // Create the data space - DataSpace space1(2, size, NULL); + const hsize_t size[2] = {100, 200}; + // Create the data space + DataSpace space1(2, size, NULL); - // Create a small conversion buffer to test strip mining - DSetMemXferPropList xfer; + // Create a small conversion buffer to test strip mining + DSetMemXferPropList xfer; - xfer.setBuffer (1000, tconv_buf, NULL); + xfer.setBuffer (1000, tconv_buf, NULL); - // Use chunked storage with compression - DSetCreatPropList dscreatplist; + // Use chunked storage with compression + DSetCreatPropList dscreatplist; - const hsize_t chunk_size[2] = {2, 25}; - dscreatplist.setChunk (2, chunk_size); - dscreatplist.setDeflate (6); + const hsize_t chunk_size[2] = {2, 25}; + dscreatplist.setChunk (2, chunk_size); + dscreatplist.setDeflate (6); #ifdef H5_HAVE_FILTER_DEFLATE - SUBTEST("Compression (setup)"); - - // Create the dataset - dataset = new DataSet (file.createDataSet - (DSET_COMPRESS_NAME, PredType::NATIVE_INT, space1, dscreatplist)); - - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 1: Read uninitialized data. It should be zero. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (uninitialized read)"); - - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - for (i=0; i(i) << "," << - static_cast(j) << endl; - throw Exception("test_compression", "Failed in uninitialized read"); - } - } - } - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 2: Test compression by setting up a chunked dataset and writing - * to it. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (write)"); - - for (i=n=0; i(n++); - } - } - - dataset->write (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 3: Try to read the data we just wrote. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (read)"); - - // Read the dataset back - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("test_compression", "Failed in read"); - } - - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 4: Write new data over the top of the old data. The new data is - * random thus not very compressible, and will cause the chunks to move - * around as they grow. We only change values for the left half of the - * dataset although we rewrite the whole thing. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (modify)"); - - for (i=0; iwrite (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Read the dataset back and check it - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("test_compression", "Failed in modify"); - } - - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 5: Close the dataset and then open it and read it again. This - * insures that the compression message is picked up properly from the - * object header. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (re-open)"); - - // close this dataset to reuse the var - delete dataset; - - dataset = new DataSet (file.openDataSet (DSET_COMPRESS_NAME)); - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("test_compression", "Failed in re-open"); - } - - PASSED(); - - - /*---------------------------------------------------------------------- - * STEP 6: Test partial I/O by writing to and then reading from a - * hyperslab of the dataset. The hyperslab does not line up on chunk - * boundaries (we know that case already works from above tests). - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (partial I/O)"); - - const hsize_t hs_size[2] = {4, 50}; - const hsize_t hs_offset[2] = {7, 30}; - for (i = 0; i < hs_size[0]; i++) { - for (j = 0; j < hs_size[1]; j++) { - points[hs_offset[0]+i][hs_offset[1]+j] = rand (); - } - } - space1.selectHyperslab( H5S_SELECT_SET, hs_size, hs_offset ); - dataset->write (static_cast(points), PredType::NATIVE_INT, space1, space1, xfer); - dataset->read (static_cast(check), PredType::NATIVE_INT, space1, space1, xfer); - - // Check that the values read are the same as the values written - for (i=0; i((hs_offset[0]+i)) << - "," << static_cast((hs_offset[1]+j)) << endl; - - cerr << " At original: " << static_cast(points[hs_offset[0]+i][hs_offset[1]+j]) << endl; - cerr << " At returned: " << static_cast(check[hs_offset[0]+i][hs_offset[1]+j]) << endl; - throw Exception("test_compression", "Failed in partial I/O"); - } - } // for j - } // for i - - delete dataset; - dataset = NULL; - - PASSED(); + SUBTEST("Compression (setup)"); + + // Create the dataset + dataset = new DataSet (file.createDataSet + (DSET_COMPRESS_NAME, PredType::NATIVE_INT, space1, dscreatplist)); + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 1: Read uninitialized data. It should be zero. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (uninitialized read)"); + + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + for (i=0; i(i) + << "," << static_cast(j) << endl; + throw Exception("test_compression", "Failed in uninitialized read"); + } + } + } + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 2: Test compression by setting up a chunked dataset and writing + * to it. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (write)"); + + for (i=n=0; i(n++); + } + } + + dataset->write (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 3: Try to read the data we just wrote. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (read)"); + + // Read the dataset back + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("test_compression", "Failed in read"); + } + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 4: Write new data over the top of the old data. The new data is + * random thus not very compressible, and will cause the chunks to move + * around as they grow. We only change values for the left half of the + * dataset although we rewrite the whole thing. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (modify)"); + + for (i=0; iwrite (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Read the dataset back and check it + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("test_compression", "Failed in modify"); + } + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 5: Close the dataset and then open it and read it again. This + * insures that the compression message is picked up properly from the + * object header. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (re-open)"); + + // close this dataset to reuse the var + delete dataset; + + dataset = new DataSet (file.openDataSet (DSET_COMPRESS_NAME)); + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("test_compression", "Failed in re-open"); + } + + PASSED(); + + + /*---------------------------------------------------------------------- + * STEP 6: Test partial I/O by writing to and then reading from a + * hyperslab of the dataset. The hyperslab does not line up on chunk + * boundaries (we know that case already works from above tests). + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (partial I/O)"); + + const hsize_t hs_size[2] = {4, 50}; + const hsize_t hs_offset[2] = {7, 30}; + for (i = 0; i < hs_size[0]; i++) { + for (j = 0; j < hs_size[1]; j++) { + points[hs_offset[0]+i][hs_offset[1]+j] = rand (); + } + } + space1.selectHyperslab( H5S_SELECT_SET, hs_size, hs_offset ); + dataset->write (static_cast(points), PredType::NATIVE_INT, space1, space1, xfer); + dataset->read (static_cast(check), PredType::NATIVE_INT, space1, space1, xfer); + + // Check that the values read are the same as the values written + for (i=0; i((hs_offset[0]+i)) << + "," << static_cast((hs_offset[1]+j)) << endl; + + cerr << " At original: " << static_cast(points[hs_offset[0]+i][hs_offset[1]+j]) << endl; + cerr << " At returned: " << static_cast(check[hs_offset[0]+i][hs_offset[1]+j]) << endl; + throw Exception("test_compression", "Failed in partial I/O"); + } + } // for j + } // for i + + delete dataset; + dataset = NULL; + + PASSED(); #else - SUBTEST("deflate filter"); - SKIPPED(); - cerr << not_supported << endl; + SUBTEST("deflate filter"); + SKIPPED(); + cerr << not_supported << endl; #endif - /*---------------------------------------------------------------------- - * STEP 7: Register an application-defined compression method and use it - * to write and then read the dataset. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (app-defined method)"); + /*---------------------------------------------------------------------- + * STEP 7: Register an application-defined compression method and use it + * to write and then read the dataset. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (app-defined method)"); if (H5Zregister (H5Z_BOGUS)<0) - throw Exception("test_compression", "Failed in app-defined method"); - if (H5Pset_filter (dscreatplist.getId(), H5Z_FILTER_BOGUS, 0, 0, NULL)<0) - throw Exception("test_compression", "Failed in app-defined method"); - dscreatplist.setFilter (H5Z_FILTER_BOGUS, 0, 0, NULL); - - DataSpace space2 (2, size, NULL); - dataset = new DataSet (file.createDataSet (DSET_BOGUS_NAME, PredType::NATIVE_INT, space2, dscreatplist)); - - dataset->write (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("test_compression", "Failed in app-defined method"); - } - - PASSED(); - - /*---------------------------------------------------------------------- - * Cleanup - *---------------------------------------------------------------------- - */ - delete dataset; - delete [] tconv_buf; - return 0; + throw Exception("test_compression", "Failed in app-defined method"); + if (H5Pset_filter (dscreatplist.getId(), H5Z_FILTER_BOGUS, 0, 0, NULL)<0) + throw Exception("test_compression", "Failed in app-defined method"); + dscreatplist.setFilter (H5Z_FILTER_BOGUS, 0, 0, NULL); + + DataSpace space2 (2, size, NULL); + dataset = new DataSet (file.createDataSet (DSET_BOGUS_NAME, PredType::NATIVE_INT, space2, dscreatplist)); + + dataset->write (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("test_compression", "Failed in app-defined method"); + } + + PASSED(); + + /*---------------------------------------------------------------------- + * Cleanup + *---------------------------------------------------------------------- + */ + delete dataset; + delete [] tconv_buf; + return 0; } // end try // catch all dataset, file, space, and plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - - // clean up and return with failure - if (dataset != NULL) - delete dataset; - if (tconv_buf) - delete [] tconv_buf; - return -1; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + + // clean up and return with failure + if (dataset != NULL) + delete dataset; + if (tconv_buf) + delete [] tconv_buf; + return -1; } } // test_compression @@ -755,18 +755,18 @@ test_compression(H5File& file) /*------------------------------------------------------------------------- * Function: test_nbit_methods * - * Purpose: Tests setting nbit compression methods. + * Purpose Tests setting nbit compression methods. * - * Return: Success: 0 + * Return Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * Friday, April 22, 2016 + * Programmer Binh-Minh Ribler + * Friday, April 22, 2016 * *------------------------------------------------------------------------- */ -const H5std_string DSET_NBIT_NAME("nbit_dataset"); +const H5std_string DSET_NBIT_NAME("nbit_dataset"); const hsize_t DIM1 = 2; const hsize_t DIM2 = 5; static herr_t test_nbit_compression(H5File& file) @@ -787,101 +787,101 @@ static herr_t test_nbit_compression(H5File& file) try { - // Define datatypes of members of compound datatype - IntType i_type(PredType::NATIVE_INT); - IntType c_type(PredType::NATIVE_CHAR); - IntType s_type(PredType::NATIVE_SHORT); - - // Create a dataset compound datatype - CompType cmpd(sizeof(s1_t)); - cmpd.insertMember("i", HOFFSET(s1_t, i), i_type); - cmpd.insertMember("c", HOFFSET(s1_t, c), c_type); - cmpd.insertMember("s", HOFFSET(s1_t, s), s_type); - - // Create a memory compound datatype - CompType mem_cmpd(sizeof(s1_t)); - mem_cmpd.insertMember("i", HOFFSET(s1_t, i), i_type); - mem_cmpd.insertMember("c", HOFFSET(s1_t, c), c_type); - mem_cmpd.insertMember("s", HOFFSET(s1_t, s), s_type); - - // Set order of dataset compound datatype - //cmpd.setOrder(H5T_ORDER_BE); only for atomic type? - - // Create the data space - DataSpace space(2, size); - - // Use nbit filter - DSetCreatPropList dscreat; - dscreat.setChunk(2, chunk_size); - dscreat.setNbit(); - - // Create the dataset - DataSet dataset(file.createDataSet(DSET_NBIT_NAME, cmpd, space, dscreat)); - - // Initialize data, assuming size of long long >= size of member datatypes - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - orig_data[i][j].i = static_cast(i * j); - orig_data[i][j].c = static_cast('a' + i); - orig_data[i][j].s = static_cast(i + j); - - // Some even-numbered integer values are negative - if ((i*size[1]+j+1)%2 == 0) { - orig_data[i][j].i = -orig_data[i][j].i; - orig_data[i][j].s = static_cast(-orig_data[i][j].s); - } - } - - // Write to the dataset - dataset.write(static_cast(orig_data), mem_cmpd); - - // Read the dataset back */ - dataset.read(static_cast(new_data), mem_cmpd); - - // Check that the values read are the same as the values written. - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - if((new_data[i][j].i != orig_data[i][j].i) || - (new_data[i][j].c != orig_data[i][j].c) || - (new_data[i][j].s != orig_data[i][j].s)) - { - H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", static_cast(i), static_cast(j)); - } + // Define datatypes of members of compound datatype + IntType i_type(PredType::NATIVE_INT); + IntType c_type(PredType::NATIVE_CHAR); + IntType s_type(PredType::NATIVE_SHORT); + + // Create a dataset compound datatype + CompType cmpd(sizeof(s1_t)); + cmpd.insertMember("i", HOFFSET(s1_t, i), i_type); + cmpd.insertMember("c", HOFFSET(s1_t, c), c_type); + cmpd.insertMember("s", HOFFSET(s1_t, s), s_type); + + // Create a memory compound datatype + CompType mem_cmpd(sizeof(s1_t)); + mem_cmpd.insertMember("i", HOFFSET(s1_t, i), i_type); + mem_cmpd.insertMember("c", HOFFSET(s1_t, c), c_type); + mem_cmpd.insertMember("s", HOFFSET(s1_t, s), s_type); + + // Set order of dataset compound datatype + //cmpd.setOrder(H5T_ORDER_BE); only for atomic type? + + // Create the data space + DataSpace space(2, size); + + // Use nbit filter + DSetCreatPropList dscreat; + dscreat.setChunk(2, chunk_size); + dscreat.setNbit(); + + // Create the dataset + DataSet dataset(file.createDataSet(DSET_NBIT_NAME, cmpd, space, dscreat)); + + // Initialize data, assuming size of long long >= size of member datatypes + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + orig_data[i][j].i = static_cast(i * j); + orig_data[i][j].c = static_cast('a' + i); + orig_data[i][j].s = static_cast(i + j); + + // Some even-numbered integer values are negative + if ((i*size[1]+j+1)%2 == 0) { + orig_data[i][j].i = -orig_data[i][j].i; + orig_data[i][j].s = static_cast(-orig_data[i][j].s); + } + } + + // Write to the dataset + dataset.write(static_cast(orig_data), mem_cmpd); + + // Read the dataset back */ + dataset.read(static_cast(new_data), mem_cmpd); + + // Check that the values read are the same as the values written. + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + if((new_data[i][j].i != orig_data[i][j].i) || + (new_data[i][j].c != orig_data[i][j].c) || + (new_data[i][j].s != orig_data[i][j].s)) + { + H5_FAILED(); + printf(" Read different values than written.\n"); + printf(" At index %lu,%lu\n", static_cast(i), static_cast(j)); + } } - PASSED(); - return 0; + PASSED(); + return 0; } // end try block // catch all dataset, file, space, and plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - return -1; + return -1; } } // test_nbit_compression /*------------------------------------------------------------------------- - * Function: test_multiopen + * Function: test_multiopen * - * Purpose: Tests that a bug no longer exists. If a dataset is opened - * twice and one of the handles is used to extend the dataset, - * then the other handle should return the new size when - * queried. + * Purpose Tests that a bug no longer exists. If a dataset is opened + * twice and one of the handles is used to extend the dataset, + * then the other handle should return the new size when + * queried. * - * Return: Success: 0 + * Return Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C version) - * Saturday, February 17, 2001 + * Programmer Binh-Minh Ribler (using C version) + * Saturday, February 17, 2001 * * Modifications: * @@ -896,74 +896,75 @@ test_multiopen (H5File& file) DataSpace* space = NULL; try { - // Create a dataset creation property list - DSetCreatPropList dcpl; + // Create a dataset creation property list + DSetCreatPropList dcpl; - // Set chunk size to given size - hsize_t cur_size[1] = {10}; - dcpl.setChunk (1, cur_size); + // Set chunk size to given size + hsize_t cur_size[1] = {10}; + dcpl.setChunk (1, cur_size); - // Create a simple data space with unlimited size - hsize_t max_size[1] = {H5S_UNLIMITED}; - space = new DataSpace (1, cur_size, max_size); + // Create a simple data space with unlimited size + hsize_t max_size[1] = {H5S_UNLIMITED}; + space = new DataSpace (1, cur_size, max_size); - // Create first dataset - DataSet dset1 = file.createDataSet ("multiopen", PredType::NATIVE_INT, *space, dcpl); + // Create first dataset + DataSet dset1 = file.createDataSet ("multiopen", PredType::NATIVE_INT, *space, dcpl); - // Open again the first dataset from the file to another DataSet object. - DataSet dset2 = file.openDataSet ("multiopen"); + // Open again the first dataset from the file to another DataSet object. + DataSet dset2 = file.openDataSet ("multiopen"); - // Relieve the dataspace - delete space; - space = NULL; + // Relieve the dataspace + delete space; + space = NULL; - // Extend the dimensionality of the first dataset - cur_size[0] = 20; - dset1.extend (cur_size); + // Extend the dimensionality of the first dataset + cur_size[0] = 20; + dset1.extend (cur_size); - // Get the size from the second handle - space = new DataSpace (dset2.getSpace()); + // Get the size from the second handle + space = new DataSpace (dset2.getSpace()); - hsize_t tmp_size[1]; - space->getSimpleExtentDims (tmp_size); - if (cur_size[0]!=tmp_size[0]) - { - cerr << " Got " << static_cast(tmp_size[0]) << " instead of " - << static_cast(cur_size[0]) << "!" << endl; - throw Exception("test_multiopen", "Failed in multi-open with extending"); - } + hsize_t tmp_size[1]; + space->getSimpleExtentDims (tmp_size); + if (cur_size[0]!=tmp_size[0]) + { + cerr << " Got " << static_cast(tmp_size[0]) + << " instead of " << static_cast(cur_size[0]) + << "!" << endl; + throw Exception("test_multiopen", "Failed in multi-open with extending"); + } - // clean up and return with success - delete space; - PASSED(); - return 0; + // clean up and return with success + delete space; + PASSED(); + return 0; } // end try block // catch all dataset, file, space, and plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - // clean up and return with failure - if (space != NULL) - delete space; - return -1; + // clean up and return with failure + if (space != NULL) + delete space; + return -1; } } // test_multiopen /*------------------------------------------------------------------------- - * Function: test_types + * Function: test_types * - * Purpose: Test various types - should be moved to dtypes.cpp + * Purpose Test various types - should be moved to dtypes.cpp * - * Return: Success: 0 + * Return Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C version) - * February 17, 2001 + * Programmer Binh-Minh Ribler (using C version) + * February 17, 2001 * * Modifications: * @@ -974,239 +975,238 @@ test_types(H5File& file) { SUBTEST("Various datatypes"); - size_t i; + size_t i; DataSet* dset = NULL; try { - // Create a group in the file that was passed in from the caller - Group grp = file.createGroup ("typetests"); - - /* bitfield_1 */ - unsigned char buf[32]; - hsize_t nelmts = sizeof(buf); - DataType type; - try { // block of bitfield_1 - // test copying a predefined type - type.copy (PredType::STD_B8LE); - - // Test copying a user-defined type using DataType::copy - DataType copied_type; - copied_type.copy(type); - - // Test copying a user-defined type using DataType::operator= - DataType another_copied_type; - another_copied_type = type; - - // Test copying a user-defined int type using DataType::operator= - IntType orig_int(PredType::STD_B8LE); - DataType generic_type; - generic_type = orig_int; - - // Test copying an integer predefined type - IntType new_int_type(PredType::STD_B8LE); - - // Test copying an int predefined type using DataType::operator= - IntType another_int_type; - another_int_type = new_int_type; - - DataSpace space (1, &nelmts); - dset = new DataSet(grp.createDataSet("bitfield_1", type, space)); - - // Fill buffer - for (i=0; i(0xff) ^ static_cast(i); - - // Write data from buf using all default dataspaces and property list - dset->write (buf, type); - - // no failure in bitfield_1, close this dataset - delete dset; - } // end try block of bitfield_1 - - // catch exceptions thrown in try block of bitfield_1 - catch (Exception& E) - { - cerr << " FAILED" << endl; - cerr << " <<< " << "bitfield_1: " << E.getFuncName() - << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - return -1; - } - - /* bitfield_2 */ - nelmts = sizeof(buf)/2; - try { // bitfield_2 block - type.copy (PredType::STD_B16LE); - DataSpace space (1, &nelmts); - dset = new DataSet(grp.createDataSet("bitfield_2", type, space)); - - // Fill buffer - for (i=0; i(0xff) ^ static_cast(i); - - // Write data from buf using all default dataspaces and property - // list; if writing fails, deallocate dset and return. - dset->write (buf, type); - - // no failure in bitfield_2, close this dataset and reset for - // variable reuse - delete dset; - dset = NULL; - } // end try block of bitfield_2 - - // catch exceptions thrown in try block of bitfield_2 - catch (Exception& E) - { - cerr << " FAILED" << endl; - cerr << " <<< " << "bitfield_2: " << E.getFuncName() - << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - throw E; // propagate the exception - } - - /* opaque_1 */ - DataType* optype = NULL; - try { // opaque_1 block - optype = new DataType(H5T_OPAQUE, 1); - nelmts = sizeof(buf); - DataSpace space (1, &nelmts); - optype->setTag ("testing 1-byte opaque type"); - dset = new DataSet(grp.createDataSet("opaque_1", *optype, space)); - - // Fill buffer - for (i=0; i(0xff) ^ static_cast(i); - - // Write data from buf using all default dataspaces and property - // list; if writing fails, deallocate dset and return. - dset->write (buf, *optype); - - // no failure in opaque_1 - delete dset; dset = NULL; - delete optype; optype = NULL; - } // end try block of opaque_1 - - // catch exceptions thrown in try block of opaque_1 - catch (Exception& E) - { - cerr << " FAILED" << endl; - cerr << " <<< " << "opaque_1: " << E.getFuncName() - << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - if (optype != NULL) - delete optype; - throw E; // propagate the exception - } - - /* opaque_2 */ - try { // block opaque_2 - nelmts = sizeof(buf)/4; - DataSpace space (1, &nelmts); - optype = new DataType(H5T_OPAQUE, 4); - optype->setTag ("testing 4-byte opaque type"); - dset = new DataSet(grp.createDataSet("opaque_2", *optype, space)); - - // Fill buffer - for (i=0; i(0xff) ^ static_cast(i); - - // Write data from buf using all default dataspaces and property - // list; if writing fails, deallocate dset and return. - dset->write (buf, *optype); - - // no failure in opaque_1 - delete dset; dset = NULL; - delete optype; optype = NULL; - } //end try block of opaque_2 - - // catch exceptions thrown in try block of opaque_2 - catch (Exception& E) - { - cerr << " FAILED" << endl; - cerr << " <<< " << "opaque_2: " << E.getFuncName() - << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - if (optype != NULL) - delete optype; - throw E; // propagate the exception - } - - PASSED(); - return 0; + // Create a group in the file that was passed in from the caller + Group grp = file.createGroup ("typetests"); + + /* bitfield_1 */ + unsigned char buf[32]; + hsize_t nelmts = sizeof(buf); + DataType type; + try { // block of bitfield_1 + // test copying a predefined type + type.copy (PredType::STD_B8LE); + + // Test copying a user-defined type using DataType::copy + DataType copied_type; + copied_type.copy(type); + + // Test copying a user-defined type using DataType::operator= + DataType another_copied_type; + another_copied_type = type; + + // Test copying a user-defined int type using DataType::operator= + IntType orig_int(PredType::STD_B8LE); + DataType generic_type; + generic_type = orig_int; + + // Test copying an integer predefined type + IntType new_int_type(PredType::STD_B8LE); + + // Test copying an int predefined type using DataType::operator= + IntType another_int_type; + another_int_type = new_int_type; + + DataSpace space (1, &nelmts); + dset = new DataSet(grp.createDataSet("bitfield_1", type, space)); + + // Fill buffer + for (i=0; i(0xff) ^ static_cast(i); + + // Write data from buf using all default dataspaces and property list + dset->write (buf, type); + + // no failure in bitfield_1, close this dataset + delete dset; + } // end try block of bitfield_1 + + // catch exceptions thrown in try block of bitfield_1 + catch (Exception& E) + { + cerr << " FAILED" << endl; + cerr << " <<< " << "bitfield_1: " << E.getFuncName() + << " - " << E.getDetailMsg() << " >>>" << endl << endl; + if (dset != NULL) + delete dset; + return -1; + } + + /* bitfield_2 */ + nelmts = sizeof(buf)/2; + try { // bitfield_2 block + type.copy (PredType::STD_B16LE); + DataSpace space (1, &nelmts); + dset = new DataSet(grp.createDataSet("bitfield_2", type, space)); + + // Fill buffer + for (i=0; i(0xff) ^ static_cast(i); + + // Write data from buf using all default dataspaces and property + // list; if writing fails, deallocate dset and return. + dset->write (buf, type); + + // no failure in bitfield_2, close this dataset and reset for + // variable reuse + delete dset; + dset = NULL; + } // end try block of bitfield_2 + + // catch exceptions thrown in try block of bitfield_2 + catch (Exception& E) + { + cerr << " FAILED" << endl; + cerr << " <<< " << "bitfield_2: " << E.getFuncName() + << " - " << E.getDetailMsg() << " >>>" << endl << endl; + if (dset != NULL) + delete dset; + throw E; // propagate the exception + } + + /* opaque_1 */ + DataType* optype = NULL; + try { // opaque_1 block + optype = new DataType(H5T_OPAQUE, 1); + nelmts = sizeof(buf); + DataSpace space (1, &nelmts); + optype->setTag ("testing 1-byte opaque type"); + dset = new DataSet(grp.createDataSet("opaque_1", *optype, space)); + + // Fill buffer + for (i=0; i(0xff) ^ static_cast(i); + + // Write data from buf using all default dataspaces and property + // list; if writing fails, deallocate dset and return. + dset->write (buf, *optype); + + // no failure in opaque_1 + delete dset; dset = NULL; + delete optype; optype = NULL; + } // end try block of opaque_1 + + // catch exceptions thrown in try block of opaque_1 + catch (Exception& E) + { + cerr << " FAILED" << endl; + cerr << " <<< " << "opaque_1: " << E.getFuncName() + << " - " << E.getDetailMsg() << " >>>" << endl << endl; + if (dset != NULL) + delete dset; + if (optype != NULL) + delete optype; + throw E; // propagate the exception + } + + /* opaque_2 */ + try { // block opaque_2 + nelmts = sizeof(buf)/4; + DataSpace space (1, &nelmts); + optype = new DataType(H5T_OPAQUE, 4); + optype->setTag ("testing 4-byte opaque type"); + dset = new DataSet(grp.createDataSet("opaque_2", *optype, space)); + + // Fill buffer + for (i=0; i(0xff) ^ static_cast(i); + + // Write data from buf using all default dataspaces and property + // list; if writing fails, deallocate dset and return. + dset->write (buf, *optype); + + // no failure in opaque_1 + delete dset; dset = NULL; + delete optype; optype = NULL; + } //end try block of opaque_2 + + // catch exceptions thrown in try block of opaque_2 + catch (Exception& E) + { + cerr << " FAILED" << endl; + cerr << " <<< " << "opaque_2: " << E.getFuncName() + << " - " << E.getDetailMsg() << " >>>" << endl << endl; + if (dset != NULL) + delete dset; + if (optype != NULL) + delete optype; + throw E; // propagate the exception + } + + PASSED(); + return 0; } // end top try block catch (Exception& E) { - return -1; + return -1; } } // test_types /*------------------------------------------------------------------------- - * Function: test_dset + * Function: test_dset * - * Purpose: Tests the dataset interface (H5D) + * Purpose Tests the dataset interface (H5D) * - * Return: Success: 0 + * Return Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: - * Nov 12, 01: - * - moved h5_cleanup to outside of try block because - * dataset.h5 cannot be removed until "file" is out of - * scope and dataset.h5 is closed. - * Feb 20, 05: - * - cleanup_dsets took care of the cleanup now. + * Nov 12, 01: + * - moved h5_cleanup to outside of try block because + * dataset.h5 cannot be removed until "file" is out of + * scope and dataset.h5 is closed. + * Feb 20, 05: + * - cleanup_dsets took care of the cleanup now. * *------------------------------------------------------------------------- */ extern "C" void test_dset() { - hid_t fapl_id; + hid_t fapl_id; fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template - - int nerrors=0; // keep track of number of failures occurr + int nerrors=0; // keep track of number of failures occur try { - // Use the file access template id to create a file access prop. - // list object to pass in H5File::H5File - FileAccPropList fapl(fapl_id); + // Use the file access template id to create a file access prop. + // list object to pass in H5File::H5File + FileAccPropList fapl(fapl_id); - H5File file(FILE1, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); + H5File file(FILE1, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); - // Cause the library to emit initial messages - Group grp = file.createGroup( "emit diagnostics", 0); - grp.setComment("Causes diagnostic messages to be emitted"); + // Cause the library to emit initial messages + Group grp = file.createGroup( "emit diagnostics", 0); + grp.setComment("Causes diagnostic messages to be emitted"); - nerrors += test_create(file) < 0 ? 1:0; - nerrors += test_simple_io(file) < 0 ? 1:0; - nerrors += test_tconv(file) < 0 ? 1:0; - nerrors += test_compression(file) < 0 ? 1:0; - nerrors += test_nbit_compression(file) < 0 ? 1:0; - nerrors += test_multiopen (file) < 0 ? 1:0; - nerrors += test_types(file) < 0 ? 1:0; + nerrors += test_create(file) < 0 ? 1:0; + nerrors += test_simple_io(file) < 0 ? 1:0; + nerrors += test_tconv(file) < 0 ? 1:0; + nerrors += test_compression(file) < 0 ? 1:0; + nerrors += test_nbit_compression(file) < 0 ? 1:0; + nerrors += test_multiopen (file) < 0 ? 1:0; + nerrors += test_types(file) < 0 ? 1:0; - // Close group "emit diagnostics". - grp.close(); + // Close group "emit diagnostics". + grp.close(); - // Close the file before testing data size. - file.close(); + // Close the file before testing data size. + file.close(); - nerrors += test_datasize(fapl) <0 ? 1:0; + nerrors += test_datasize(fapl) <0 ? 1:0; } catch (Exception& E) { - test_report(nerrors, H5std_string(" Dataset")); + test_report(nerrors, H5std_string(" Dataset")); } // Clean up data file @@ -1216,11 +1216,11 @@ void test_dset() /*------------------------------------------------------------------------- * Function: cleanup_dsets * - * Purpose: Cleanup temporary test files + * Purpose Cleanup temporary test files * - * Return: none + * Return none * - * Programmer: (use C version) + * Programmer (use C version) * * Modifications: * diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index 95d29a8..cf7fc2c 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -37,18 +37,18 @@ using namespace H5; #include "h5cpputil.h" // C++ utilility header file /*------------------------------------------------------------------------- - * Function: test_report + * Function: test_report * - * Purpose: Prints out the number of errors for the tests indicated - * by 'testname,' if there were any failures occurred. If - * no failure, test_report prints out the tests passed message. + * Purpose Prints out the number of errors for the tests indicated + * by 'testname,' if there were any failures occurred. If + * no failure, test_report prints out the tests passed message. * - * Return: if any failure has occurred: 1 + * Return if any failure has occurred: 1 * - * if no failure occurs: 0 + * if no failure occurs: 0 * - * Programmer: Binh-Minh Ribler (using C code segment for reporting tests) - * Friday, February 6, 2001 + * Programmer Binh-Minh Ribler (using C code segment for reporting tests) + * Friday, February 6, 2001 * * Modifications: * @@ -59,12 +59,12 @@ int test_report( int nerrors, const H5std_string& testname ) if (nerrors) { nerrors = MAX(1, nerrors); - if (1 == nerrors) - cerr << "***** " << nerrors << testname - << " TEST FAILED! *****" << endl; - else - cerr << "***** " << nerrors << testname - << " TESTS FAILED! *****" << endl; + if (1 == nerrors) + cerr << "***** " << nerrors << testname + << " TEST FAILED! *****" << endl; + else + cerr << "***** " << nerrors << testname + << " TESTS FAILED! *****" << endl; return 1; } else @@ -75,68 +75,68 @@ int test_report( int nerrors, const H5std_string& testname ) } /*------------------------------------------------------------------------- - * Function: issue_fail_msg + * Function: issue_fail_msg * - * Purpose: Displays that a function has failed with its location. + * Purpose Displays that a function has failed with its location. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (copied and modified macro CHECK from C) - * Monday, December 20, 2004 + * Programmer Binh-Minh Ribler (copied and modified macro CHECK from C) + * Monday, December 20, 2004 * *------------------------------------------------------------------------- */ void issue_fail_msg(const char* where, int line, const char* file_name, - const char* message) + const char* message) { if (GetTestVerbosity()>=VERBO_HI) { - cerr << endl; + cerr << endl; cerr << ">>> FAILED in " << where << " at line " << line << " in " << file_name << " - " << message << endl << endl; } } /*------------------------------------------------------------------------- - * Function: issue_fail_msg + * Function: issue_fail_msg * - * Purpose: Displays that a function has failed with its location. + * Purpose Displays that a function has failed with its location. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (copied and modified macro CHECK from C) - * Monday, December 20, 2004 + * Programmer Binh-Minh Ribler (copied and modified macro CHECK from C) + * Monday, December 20, 2004 * *------------------------------------------------------------------------- */ void issue_fail_msg(const char* where, int line, const char* file_name, - const char* func_name, const char* message) + const char* func_name, const char* message) { if (GetTestVerbosity()>=VERBO_HI) { - cerr << endl; + cerr << endl; cerr << ">>> FAILED in " << where << ": " << func_name << endl << - " at line " << line << " in " << file_name << endl << - " C library detail: " << message << endl << endl; + " at line " << line << " in " << file_name << endl << + " C library detail: " << message << endl << endl; } } /*------------------------------------------------------------------------- - * Function: check_values + * Function: check_values * - * Purpose: Checks a read value against the written value. If they are - * different, the function will print out a message and the - * different values. This function is made to reuse the code - * segment that is used in various places throughout - * the test code. Where the C version of this code segment - * "goto error," this function will return -1. + * Purpose Checks a read value against the written value. If they are + * different, the function will print out a message and the + * different values. This function is made to reuse the code + * segment that is used in various places throughout + * the test code. Where the C version of this code segment + * "goto error," this function will return -1. * - * Return: Success: 0 + * Return Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C code segment for checking values) - * Friday, February 6, 2001 + * Programmer Binh-Minh Ribler (using C code segment for checking values) + * Friday, February 6, 2001 * * Modifications: * @@ -146,26 +146,26 @@ int check_values (hsize_t i, hsize_t j, int apoint, int acheck) { if (apoint != acheck) { - cerr << " Read different values than written.\n" << endl; - cerr << " At index " << static_cast(i) << "," << - static_cast(j) << endl; - return -1; + cerr << " Read different values than written.\n" << endl; + cerr << " At index " << static_cast(i) << "," << + static_cast(j) << endl; + return -1; } return 0; } // check_values /*------------------------------------------------------------------------- - * Function: check_values + * Function: check_values * - * Purpose: Checks a char string pointer for NULL. If it is NULL, - * the function will print out a message + * Purpose Checks a char string pointer for NULL. If it is NULL, + * the function will print out a message * - * Return: Success: 0 + * Return Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler (using C code segment for checking values) - * Friday, September 16, 2016 + * Programmer Binh-Minh Ribler (using C code segment for checking values) + * Friday, September 16, 2016 * *------------------------------------------------------------------------- */ @@ -173,26 +173,26 @@ void check_values(const char *value, const char* msg, int line, const char* file { if (value == NULL) { - cerr << endl; + cerr << endl; cerr << "*** ERROR: " << msg << ", at line " << line << endl; - IncTestNumErrs(); - throw TestFailedException(file_name, msg); + IncTestNumErrs(); + throw TestFailedException(file_name, msg); } } /*------------------------------------------------------------------------- - * Function: verify_val (const char*, const char*,...) + * Function: verify_val (const char*, const char*,...) * - * Purpose: Compares two character strings. If they are - * different, the function will print out a message and the - * different values. + * Purpose Compares two character strings. If they are + * different, the function will print out a message and the + * different values. * - * Return: Success: 0 + * Return Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * May 2, 2010 + * Programmer Binh-Minh Ribler + * May 2, 2010 * * Modifications: * @@ -225,12 +225,12 @@ InvalidActionException::InvalidActionException():Exception(){} //-------------------------------------------------------------------------- // Function: InvalidActionException overloaded constructor // -// Purpose: Creates an InvalidActionException with the name of the function, +// Purpose Creates an InvalidActionException with the name of the function, // which the failure should have occurred but didn't, and a -// message explaining why it should fail. +// message explaining why it should fail. // Parameters -// func - IN: Name of the function where failure should occur -// message - IN: Message +// func - IN: Name of the function where failure should occur +// message - IN: Message //-------------------------------------------------------------------------- InvalidActionException::InvalidActionException(const H5std_string func, const H5std_string message) : Exception(func, message) {} @@ -247,12 +247,12 @@ TestFailedException::TestFailedException():Exception(){} //-------------------------------------------------------------------------- // Function: TestFailedException overloaded constructor // -// Purpose: Creates an TestFailedException with the name of the function, +// Purpose Creates an TestFailedException with the name of the function, // which the failure should have occurred but didn't, and a -// message explaining why it should fail. +// message explaining why it should fail. // Parameters -// func - IN: Name of the function where failure should occur -// message - IN: Message +// func - IN: Name of the function where failure should occur +// message - IN: Message //-------------------------------------------------------------------------- TestFailedException::TestFailedException(const H5std_string func, const H5std_string message) : Exception(func, message) {} diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index f8aaec7..7f92e60 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -37,22 +37,22 @@ int check_values (hsize_t i, hsize_t j, int apoint, int acheck); void check_values(const char *value, const char* msg, int line, const char* file_name); int test_report (int, const H5std_string&); void issue_fail_msg(const char* where, int line, const char* file_name, - const char* message=""); + const char* message=""); void issue_fail_msg(const char* where, int line, const char* file_name, - const char* func_name, const char* message); + const char* func_name, const char* message); class InvalidActionException : public Exception { public: - InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); - InvalidActionException(); - virtual ~InvalidActionException() throw(); + InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); + InvalidActionException(); + virtual ~InvalidActionException() throw(); }; class TestFailedException : public Exception { public: - TestFailedException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); - TestFailedException(); - virtual ~TestFailedException() throw(); + TestFailedException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); + TestFailedException(); + virtual ~TestFailedException() throw(); }; // Overloaded/Template functions to verify values and display proper info @@ -65,18 +65,18 @@ template { if (GetTestVerbosity()>=VERBO_HI) { - cerr << endl; + cerr << endl; cerr << " Call to routine: " << where << " at line " << line - << " in " << file_name << " had value " << x << endl; + << " in " << file_name << " had value " << x << endl; } if (x != value) { - cerr << endl; + cerr << endl; cerr << "*** UNEXPECTED VALUE from " << where << " should be " - << value << ", but is " << x << " at line " << line - << " in " << file_name << endl; - IncTestNumErrs(); - throw TestFailedException(where, ""); + << value << ", but is " << x << " at line " << line + << " in " << file_name << endl; + IncTestNumErrs(); + throw TestFailedException(where, ""); } } @@ -85,12 +85,12 @@ template { if (x != value) { - cerr << endl; + cerr << endl; cerr << "*** UNEXPECTED VALUE: " << file_name << ":line " << line - << ": " << msg << " different: " << x << ", should be " << value - << endl; - IncTestNumErrs(); - throw TestFailedException(file_name, msg); + << ": " << msg << " different: " << x << ", should be " << value + << endl; + IncTestNumErrs(); + throw TestFailedException(file_name, msg); } } @@ -99,17 +99,17 @@ template { if (GetTestVerbosity()>=VERBO_HI) { - cerr << endl; + cerr << endl; cerr << " Call to routine: " << where << " at line " << line - << " in " << file_name << " had value " << x << endl; + << " in " << file_name << " had value " << x << endl; } if (x == value) { - cerr << endl; + cerr << endl; cerr << "*** UNEXPECTED VALUE from " << where << " should not be " - << value << " at line " << line << " in " << file_name << endl; - IncTestNumErrs(); - throw TestFailedException(where, ""); + << value << " at line " << line << " in " << file_name << endl; + IncTestNumErrs(); + throw TestFailedException(where, ""); } } @@ -118,10 +118,10 @@ template { if (x == value) { - cerr << endl; + cerr << endl; cerr << "*** Function " << msg << " FAILED at line " << line << endl; - IncTestNumErrs(); - throw TestFailedException(file_name, msg); + IncTestNumErrs(); + throw TestFailedException(file_name, msg); } } @@ -130,12 +130,12 @@ template { if (x == value) { - cerr << endl; - cerr << "*** UNEXPECTED FLOAT VALUE: " << file_name << ":line " << line - << ": " << msg << " different: " << x << ", should be " << value - << " (epsilon=" << epsilon << ")" << endl; - IncTestNumErrs(); - throw TestFailedException(file_name, msg); + cerr << endl; + cerr << "*** UNEXPECTED FLOAT VALUE: " << file_name << ":line " << line + << ": " << msg << " different: " << x << ", should be " << value + << " (epsilon=" << epsilon << ")" << endl; + IncTestNumErrs(); + throw TestFailedException(file_name, msg); } } diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index f10016f..490772f 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -53,12 +53,12 @@ typedef enum int_t { /*------------------------------------------------------------------------- * Function: test_array_compound_array * - * Purpose: Tests 1-D array of compound datatypes (with array fields) + * Purpose Tests 1-D array of compound datatypes (with array fields) * - * Return: None. + * Return None. * - * Programmer: Binh-Minh Ribler (using C version) - * January, 2016 + * Programmer Binh-Minh Ribler (using C version) + * January, 2016 * * Modifications: * @@ -76,7 +76,7 @@ static void test_array_compound_array() hsize_t sdims1[] = {SPACE1_DIM1}; hsize_t tdims1[] = {ARRAY1_DIM1}; int nmemb; // Number of compound members - int ii; // counting variables + int ii; // counting variables hsize_t idxi, idxj, idxk; // dimension indicing variables H5T_class_t mclass; // Datatype class for field @@ -85,193 +85,193 @@ static void test_array_compound_array() for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) { wdata[idxi][idxj].i = idxi * 10 + idxj; for(idxk = 0; idxk < ARRAY1_DIM1; idxk++) - { + { float temp = idxi * 10.0 + idxj * 2.5 + idxk; wdata[idxi][idxj].f[idxk] = temp; - } + } } // end for try { - // Create File - H5File file1(FILENAME, H5F_ACC_TRUNC); + // Create File + H5File file1(FILENAME, H5F_ACC_TRUNC); - // Create dataspace for datasets - DataSpace space(SPACE1_RANK, sdims1, NULL); + // Create dataspace for datasets + DataSpace space(SPACE1_RANK, sdims1, NULL); - /* - * Create an array datatype of compounds, arrtype. Each compound - * datatype, comptype, contains an integer and an array of floats, - * arrfltype. - */ + /* + * Create an array datatype of compounds, arrtype. Each compound + * datatype, comptype, contains an integer and an array of floats, + * arrfltype. + */ - // Create a compound datatype - CompType comptype(sizeof(s1_t)); + // Create a compound datatype + CompType comptype(sizeof(s1_t)); - // Insert integer field - comptype.insertMember("i", HOFFSET(s1_t, i), PredType::NATIVE_INT); + // Insert integer field + comptype.insertMember("i", HOFFSET(s1_t, i), PredType::NATIVE_INT); - // Create an array of floats datatype - ArrayType arrfltype(PredType::NATIVE_FLOAT, ARRAY1_RANK, tdims1); + // Create an array of floats datatype + ArrayType arrfltype(PredType::NATIVE_FLOAT, ARRAY1_RANK, tdims1); - // Insert float array field - comptype.insertMember("f", HOFFSET(s1_t, f), arrfltype); + // Insert float array field + comptype.insertMember("f", HOFFSET(s1_t, f), arrfltype); - // Close array of floats field datatype - arrfltype.close(); + // Close array of floats field datatype + arrfltype.close(); - // Create an array datatype of the compound datatype - ArrayType arrtype(comptype, ARRAY1_RANK, tdims1); + // Create an array datatype of the compound datatype + ArrayType arrtype(comptype, ARRAY1_RANK, tdims1); - // Close compound datatype comptype - comptype.close(); + // Close compound datatype comptype + comptype.close(); - // Create a dataset - DataSet dataset = file1.createDataSet("Dataset1", arrtype, space); + // Create a dataset + DataSet dataset = file1.createDataSet("Dataset1", arrtype, space); - // Write dataset to disk - dataset.write(wdata, arrtype); + // Write dataset to disk + dataset.write(wdata, arrtype); - // Test opening ArrayType with opening constructor (Dec 2016) + // Test opening ArrayType with opening constructor (Dec 2016) - // Commit the arrtype to give it a name - arrtype.commit(file1, ARRAYTYPE_NAME); + // Commit the arrtype to give it a name + arrtype.commit(file1, ARRAYTYPE_NAME); - // Close it, then re-open with the opening constructor - arrtype.close(); - ArrayType named_type(file1, ARRAYTYPE_NAME); + // Close it, then re-open with the opening constructor + arrtype.close(); + ArrayType named_type(file1, ARRAYTYPE_NAME); - // Get and verify the type's name - H5std_string type_name = named_type.getObjName(); - verify_val(type_name, ARRAYTYPE_NAME, "DataType::getObjName tests constructor", __LINE__, __FILE__); - named_type.close(); + // Get and verify the type's name + H5std_string type_name = named_type.getObjName(); + verify_val(type_name, ARRAYTYPE_NAME, "DataType::getObjName tests constructor", __LINE__, __FILE__); + named_type.close(); - // Close all - dataset.close(); - space.close(); - file1.close(); + // Close all + dataset.close(); + space.close(); + file1.close(); - // Re-open file - file1.openFile(FILENAME, H5F_ACC_RDONLY); + // Re-open file + file1.openFile(FILENAME, H5F_ACC_RDONLY); - // Open the dataset - dataset = file1.openDataSet("Dataset1"); + // Open the dataset + dataset = file1.openDataSet("Dataset1"); - /* - * Check the datatype array of compounds - */ + /* + * Check the datatype array of compounds + */ - // Verify that it is an array of compounds - DataType dstype = dataset.getDataType(); - mclass = dstype.getClass(); - verify_val(mclass==H5T_ARRAY, true, "f2_type.getClass", __LINE__, __FILE__); + // Verify that it is an array of compounds + DataType dstype = dataset.getDataType(); + mclass = dstype.getClass(); + verify_val(mclass==H5T_ARRAY, true, "f2_type.getClass", __LINE__, __FILE__); - dstype.close(); + dstype.close(); - // Get the array datatype to check - ArrayType atype_check = dataset.getArrayType(); + // Get the array datatype to check + ArrayType atype_check = dataset.getArrayType(); - // Check the array rank - int ndims = atype_check.getArrayNDims(); - verify_val(ndims, ARRAY1_RANK, "atype_check.getArrayNDims", __LINE__, __FILE__); + // Check the array rank + int ndims = atype_check.getArrayNDims(); + verify_val(ndims, ARRAY1_RANK, "atype_check.getArrayNDims", __LINE__, __FILE__); - // Get the array dimensions - hsize_t rdims1[H5S_MAX_RANK]; - atype_check.getArrayDims(rdims1); + // Get the array dimensions + hsize_t rdims1[H5S_MAX_RANK]; + atype_check.getArrayDims(rdims1); - // Check the array dimensions - for (ii =0; ii FP_EPSILON) - verify_val(read_data2, attr_data5, FP_EPSILON, "Attribute::read", __LINE__, __FILE__); + // Read attribute information + float read_data2=0.0; // Buffer for reading 1st attribute + ds_attr.read(PredType::NATIVE_FLOAT,&read_data2); + if (HDfabs(read_data2 - attr_data5) > FP_EPSILON) + verify_val(read_data2, attr_data5, FP_EPSILON, "Attribute::read", __LINE__, __FILE__); - // Get the dataspace of the attribute - DataSpace att_space = ds_attr.getSpace(); + // Get the dataspace of the attribute + DataSpace att_space = ds_attr.getSpace(); - // Make certain the dataspace is scalar - H5S_class_t space_type = att_space.getSimpleExtentType(); - verify_val(space_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__); + // Make certain the dataspace is scalar + H5S_class_t space_type = att_space.getSimpleExtentType(); + verify_val(space_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_attr_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_scalar_read() @@ -877,65 +877,65 @@ static void test_attr_mult_write() SUBTEST("Multiple Attribute Writing Functions"); try { - // Create file - H5File fid1 (FILE_MULTI, H5F_ACC_TRUNC); + // Create file + H5File fid1 (FILE_MULTI, H5F_ACC_TRUNC); - // Create dataspace for dataset - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - DataSpace ds_space (SPACE1_RANK, dims1); + // Create dataspace for dataset + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + DataSpace ds_space (SPACE1_RANK, dims1); - // Create a dataset - DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space); + // Create a dataset + DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space); - // Create dataspace for 1st attribute - hsize_t dims2[] = {ATTR1_DIM1}; - DataSpace att_space (ATTR1_RANK, dims2); + // Create dataspace for 1st attribute + hsize_t dims2[] = {ATTR1_DIM1}; + DataSpace att_space (ATTR1_RANK, dims2); - // Create 1st attribute for the dataset - Attribute ds_attr = dataset.createAttribute (ATTR1_NAME, PredType::NATIVE_INT, att_space); + // Create 1st attribute for the dataset + Attribute ds_attr = dataset.createAttribute (ATTR1_NAME, PredType::NATIVE_INT, att_space); - // Write attribute information - ds_attr.write (PredType::NATIVE_INT, attr_data1); + // Write attribute information + ds_attr.write (PredType::NATIVE_INT, attr_data1); - // Create dataspace for 2nd attribute - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; - DataSpace att2_space (ATTR2_RANK, dims3); + // Create dataspace for 2nd attribute + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + DataSpace att2_space (ATTR2_RANK, dims3); - // Create 2nd attribute for the dataset - Attribute ds_attr2 = dataset.createAttribute (ATTR2_NAME, PredType::NATIVE_INT, att2_space); + // Create 2nd attribute for the dataset + Attribute ds_attr2 = dataset.createAttribute (ATTR2_NAME, PredType::NATIVE_INT, att2_space); - // Write 2nd attribute information - ds_attr2.write (PredType::NATIVE_INT, attr_data2); + // Write 2nd attribute information + ds_attr2.write (PredType::NATIVE_INT, attr_data2); - // Create dataspace for 3rd attribute - hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; - DataSpace att3_space (ATTR3_RANK, dims4); + // Create dataspace for 3rd attribute + hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; + DataSpace att3_space (ATTR3_RANK, dims4); - // Create 3rd attribute for the dataset - Attribute ds_attr3 = dataset.createAttribute (ATTR3_NAME, PredType::NATIVE_DOUBLE, att3_space); + // Create 3rd attribute for the dataset + Attribute ds_attr3 = dataset.createAttribute (ATTR3_NAME, PredType::NATIVE_DOUBLE, att3_space); - // Try creating an attribute that already exists. This should fail - // since two attributes cannot have the same name. If an exception - // is not thrown for this action by createAttribute, then throw an - // invalid action exception. - try { - Attribute invalid_attr = dataset.createAttribute (ATTR3_NAME, PredType::NATIVE_DOUBLE, att3_space); + // Try creating an attribute that already exists. This should fail + // since two attributes cannot have the same name. If an exception + // is not thrown for this action by createAttribute, then throw an + // invalid action exception. + try { + Attribute invalid_attr = dataset.createAttribute (ATTR3_NAME, PredType::NATIVE_DOUBLE, att3_space); - // continuation here, that means no exception has been thrown - throw InvalidActionException("DataSet::createAttribute", "Attempting to create a duplicate attribute"); - } - catch (AttributeIException& E) // catching invalid creating attribute + // continuation here, that means no exception has been thrown + throw InvalidActionException("DataSet::createAttribute", "Attempting to create a duplicate attribute"); + } + catch (AttributeIException& E) // catching invalid creating attribute {} // do nothing, exception expected - // Write 3rd attribute information - ds_attr3.write (PredType::NATIVE_DOUBLE, attr_data3); + // Write 3rd attribute information + ds_attr3.write (PredType::NATIVE_DOUBLE, attr_data3); - PASSED(); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_attr_mult_write()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_mult_write()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_mult_write() @@ -951,39 +951,39 @@ static void test_attr_mult_read() double read_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3]={{{0}}}; // Buffer for reading 3rd attribute hsize_t i,j,k; - // Output message about test being performed + // Output message about test being performed SUBTEST("Multiple Attribute Reading Functions"); try { - // Open file - H5File fid1(FILE_MULTI, H5F_ACC_RDWR); + // Open file + H5File fid1(FILE_MULTI, H5F_ACC_RDWR); - // Open the dataset - DataSet dataset = fid1.openDataSet(DSET1_NAME); + // Open the dataset + DataSet dataset = fid1.openDataSet(DSET1_NAME); - // Verify the correct number of attributes - int num_attrs = dataset.getNumAttrs(); - verify_val(num_attrs, 3, "DataSet::getNumAttrs", __LINE__, __FILE__); + // Verify the correct number of attributes + int num_attrs = dataset.getNumAttrs(); + verify_val(num_attrs, 3, "DataSet::getNumAttrs", __LINE__, __FILE__); - // Open 1st attribute for the dataset - Attribute attr = dataset.openAttribute((unsigned)0); + // Open 1st attribute for the dataset + Attribute attr = dataset.openAttribute((unsigned)0); - /* Verify Dataspace */ + /* Verify Dataspace */ - // Get the dataspace of the attribute - DataSpace space = attr.getSpace(); + // Get the dataspace of the attribute + DataSpace space = attr.getSpace(); - // Get the rank of the dataspace and verify it - int rank = space.getSimpleExtentNdims(); - verify_val(rank, ATTR1_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + // Get the rank of the dataspace and verify it + int rank = space.getSimpleExtentNdims(); + verify_val(rank, ATTR1_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - // Get the dims of the dataspace and verify them - hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions - int ndims = space.getSimpleExtentDims(dims); - if ((long)dims[0] != (long)ATTR1_DIM1) - TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %d\n",__LINE__,(int)dims[0],ATTR1_DIM1); + // Get the dims of the dataspace and verify them + hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions + int ndims = space.getSimpleExtentDims(dims); + if ((long)dims[0] != (long)ATTR1_DIM1) + TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %d\n",__LINE__,(int)dims[0],ATTR1_DIM1); - /* Verify Datatype */ + /* Verify Datatype */ // Get the class of the datatype that is used by attr H5T_class_t type_class = attr.getTypeClass(); @@ -991,51 +991,51 @@ static void test_attr_mult_read() // Verify that the type is of integer datatype verify_val(type_class, H5T_INTEGER, "Attribute::getTypeClass", __LINE__, __FILE__); - // Get the integer datatype + // Get the integer datatype IntType i_type1 = attr.getIntType(); - // Get and verify the order of this type - H5T_order_t order = i_type1.getOrder(); - verify_val(order, PredType::NATIVE_INT.getOrder(), "DataType::getOrder", __LINE__, __FILE__); + // Get and verify the order of this type + H5T_order_t order = i_type1.getOrder(); + verify_val(order, PredType::NATIVE_INT.getOrder(), "DataType::getOrder", __LINE__, __FILE__); - // Get and verify the size of this type - size_t size = i_type1.getSize(); - verify_val(size, PredType::NATIVE_INT.getSize(), "DataType::getSize", __LINE__, __FILE__); + // Get and verify the size of this type + size_t size = i_type1.getSize(); + verify_val(size, PredType::NATIVE_INT.getSize(), "DataType::getSize", __LINE__, __FILE__); - // Read attribute information - attr.read(PredType::NATIVE_INT, read_data1); + // Read attribute information + attr.read(PredType::NATIVE_INT, read_data1); - // Verify values read in - for(i=0; iopenAttribute(ATTR1_NAME)); + // Open attribute + Attribute *attr2 = new Attribute (dset2->openAttribute(ATTR1_NAME)); - // Read data from the attribute - attr2->read(PredType::NATIVE_INT, &rdata); - verify_val(data, rdata, "Attribute::read", __LINE__, __FILE__); + // Read data from the attribute + attr2->read(PredType::NATIVE_INT, &rdata); + verify_val(data, rdata, "Attribute::read", __LINE__, __FILE__); - // Close attribute and dataset - delete attr2; - delete dset2; + // Close attribute and dataset + delete attr2; + delete dset2; #ifndef H5_NO_DEPRECATED_SYMBOLS - // Check reference count on named datatype - fid1.getObjinfo(TYPE1_NAME, statbuf); - verify_val((int)statbuf.nlink, 3, "DataSet::openAttribute", __LINE__, __FILE__); + // Check reference count on named datatype + fid1.getObjinfo(TYPE1_NAME, statbuf); + verify_val((int)statbuf.nlink, 3, "DataSet::openAttribute", __LINE__, __FILE__); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - } // end of second enclosing + } // end of second enclosing - // Unlink the dataset - fid1.unlink(DSET1_NAME); + // Unlink the dataset + fid1.unlink(DSET1_NAME); #ifndef H5_NO_DEPRECATED_SYMBOLS - // Check reference count on named datatype - fid1.getObjinfo(TYPE1_NAME, statbuf); - verify_val((int)statbuf.nlink, 1, "H5File::unlink", __LINE__, __FILE__); + // Check reference count on named datatype + fid1.getObjinfo(TYPE1_NAME, statbuf); + verify_val((int)statbuf.nlink, 1, "H5File::unlink", __LINE__, __FILE__); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Unlink the named datatype - fid1.unlink(TYPE1_NAME); + // Unlink the named datatype + fid1.unlink(TYPE1_NAME); - // Close file - fid1.close(); + // Close file + fid1.close(); - // Check size of file - filesize = h5_get_file_size(FILE_DTYPE.c_str(), H5P_DEFAULT); - verify_val((long)filesize, (long)empty_filesize, "Checking file size", __LINE__, __FILE__); + // Check size of file + filesize = h5_get_file_size(FILE_DTYPE.c_str(), H5P_DEFAULT); + verify_val((long)filesize, (long)empty_filesize, "Checking file size", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_attr_dtype_shared()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_dtype_shared()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_dtype_shared() @@ -1424,116 +1424,116 @@ static void test_string_attr() SUBTEST("I/O on FL and VL String Attributes"); try { - // Create file - H5File fid1(FILE_BASIC, H5F_ACC_RDWR); - - // - // Fixed-lenth string attributes - // - // Create a fixed-length string datatype to refer to. - StrType fls_type(0, ATTR_LEN); - - // Open the root group. - Group root = fid1.openGroup("/"); - - // Create dataspace for the attribute. - DataSpace att_space (H5S_SCALAR); - - /* Test Attribute::write(...,const void *buf) with Fixed len string */ - - // Create an attribute for the root group. - Attribute gr_flattr1 = root.createAttribute(ATTR1_FL_STR_NAME, fls_type, att_space); - - // Write data to the attribute. - gr_flattr1.write(fls_type, ATTRSTR_DATA.c_str()); - - /* Test Attribute::write(...,const H5std_string& strg) with FL string */ - - // Create an attribute for the root group. - Attribute gr_flattr2 = root.createAttribute(ATTR2_FL_STR_NAME, fls_type, att_space); - - // Write data to the attribute. - gr_flattr2.write(fls_type, ATTRSTR_DATA); - - /* Test Attribute::read(...,void *buf) with FL string */ - - // Read and verify the attribute string as a string of chars. - char flstring_att_check[ATTR_LEN]; - gr_flattr1.read(fls_type, flstring_att_check); - if(HDstrcmp(flstring_att_check, ATTRSTR_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), flstring_att_check); - - // Read and verify the attribute string as a string of chars; buffer - // is dynamically allocated. - size_t attr_size = gr_flattr1.getInMemDataSize(); - char *fl_dyn_string_att_check; - fl_dyn_string_att_check = new char[attr_size+1]; - gr_flattr1.read(fls_type, fl_dyn_string_att_check); - if(HDstrcmp(fl_dyn_string_att_check, ATTRSTR_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), fl_dyn_string_att_check); - delete []fl_dyn_string_att_check; - - /* Test Attribute::read(...,H5std_string& strg) with FL string */ - - // Read and verify the attribute string as an std::string. - H5std_string read_flstr1; - gr_flattr1.read(fls_type, read_flstr1); - if (read_flstr1 != ATTRSTR_DATA) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_flstr1=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_flstr1.c_str()); - - // Read and verify the attribute string as a string of chars. - HDstrcpy(flstring_att_check, ""); - gr_flattr2.read(fls_type, flstring_att_check); - if(HDstrcmp(flstring_att_check, ATTRSTR_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), flstring_att_check); - - /* Test Attribute::read(...,H5std_string& strg) with FL string */ - - // Read and verify the attribute string as an std::string. - H5std_string read_flstr2; - gr_flattr2.read(fls_type, read_flstr2); - if (read_flstr2 != ATTRSTR_DATA) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_flstr2=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_flstr2.c_str()); - - // - // Variable-lenth string attributes - // - // Create a variable length string datatype to refer to. - StrType vls_type(0, H5T_VARIABLE); - - // Create an attribute for the root group. - Attribute gr_vlattr = root.createAttribute(ATTR_VL_STR_NAME, vls_type, att_space); - - // Write data to the attribute. - gr_vlattr.write(vls_type, ATTRSTR_DATA); - - /* Test Attribute::read(...,void *buf) with Variable len string */ - // Read and verify the attribute string as a string of chars. - char *string_att_check; - gr_vlattr.read(vls_type, &string_att_check); - if(HDstrcmp(string_att_check, ATTRSTR_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,string_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), string_att_check); - HDfree(string_att_check); - - /* Test Attribute::read(...,H5std_string& strg) with VL string */ - // Read and verify the attribute string as an std::string. - H5std_string read_str; - gr_vlattr.read(vls_type, read_str); - if (read_str != ATTRSTR_DATA) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_str=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_str.c_str()); - PASSED(); + // Create file + H5File fid1(FILE_BASIC, H5F_ACC_RDWR); + + // + // Fixed-lenth string attributes + // + // Create a fixed-length string datatype to refer to. + StrType fls_type(0, ATTR_LEN); + + // Open the root group. + Group root = fid1.openGroup("/"); + + // Create dataspace for the attribute. + DataSpace att_space (H5S_SCALAR); + + /* Test Attribute::write(...,const void *buf) with Fixed len string */ + + // Create an attribute for the root group. + Attribute gr_flattr1 = root.createAttribute(ATTR1_FL_STR_NAME, fls_type, att_space); + + // Write data to the attribute. + gr_flattr1.write(fls_type, ATTRSTR_DATA.c_str()); + + /* Test Attribute::write(...,const H5std_string& strg) with FL string */ + + // Create an attribute for the root group. + Attribute gr_flattr2 = root.createAttribute(ATTR2_FL_STR_NAME, fls_type, att_space); + + // Write data to the attribute. + gr_flattr2.write(fls_type, ATTRSTR_DATA); + + /* Test Attribute::read(...,void *buf) with FL string */ + + // Read and verify the attribute string as a string of chars. + char flstring_att_check[ATTR_LEN]; + gr_flattr1.read(fls_type, flstring_att_check); + if(HDstrcmp(flstring_att_check, ATTRSTR_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), flstring_att_check); + + // Read and verify the attribute string as a string of chars; buffer + // is dynamically allocated. + size_t attr_size = gr_flattr1.getInMemDataSize(); + char *fl_dyn_string_att_check; + fl_dyn_string_att_check = new char[attr_size+1]; + gr_flattr1.read(fls_type, fl_dyn_string_att_check); + if(HDstrcmp(fl_dyn_string_att_check, ATTRSTR_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), fl_dyn_string_att_check); + delete []fl_dyn_string_att_check; + + /* Test Attribute::read(...,H5std_string& strg) with FL string */ + + // Read and verify the attribute string as an std::string. + H5std_string read_flstr1; + gr_flattr1.read(fls_type, read_flstr1); + if (read_flstr1 != ATTRSTR_DATA) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_flstr1=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_flstr1.c_str()); + + // Read and verify the attribute string as a string of chars. + HDstrcpy(flstring_att_check, ""); + gr_flattr2.read(fls_type, flstring_att_check); + if(HDstrcmp(flstring_att_check, ATTRSTR_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), flstring_att_check); + + /* Test Attribute::read(...,H5std_string& strg) with FL string */ + + // Read and verify the attribute string as an std::string. + H5std_string read_flstr2; + gr_flattr2.read(fls_type, read_flstr2); + if (read_flstr2 != ATTRSTR_DATA) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_flstr2=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_flstr2.c_str()); + + // + // Variable-lenth string attributes + // + // Create a variable length string datatype to refer to. + StrType vls_type(0, H5T_VARIABLE); + + // Create an attribute for the root group. + Attribute gr_vlattr = root.createAttribute(ATTR_VL_STR_NAME, vls_type, att_space); + + // Write data to the attribute. + gr_vlattr.write(vls_type, ATTRSTR_DATA); + + /* Test Attribute::read(...,void *buf) with Variable len string */ + // Read and verify the attribute string as a string of chars. + char *string_att_check; + gr_vlattr.read(vls_type, &string_att_check); + if(HDstrcmp(string_att_check, ATTRSTR_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,string_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), string_att_check); + HDfree(string_att_check); + + /* Test Attribute::read(...,H5std_string& strg) with VL string */ + // Read and verify the attribute string as an std::string. + H5std_string read_str; + gr_vlattr.read(vls_type, read_str); + if (read_str != ATTRSTR_DATA) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_str=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_str.c_str()); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_string_attr()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_string_attr()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_string_attr() /**************************************************************** ** ** test_attr_exists(): Test checking for attribute existence. -** (additional attrExists tests are in test_attr_rename()) +** (additional attrExists tests are in test_attr_rename()) ** ****************************************************************/ static void test_attr_exists() @@ -1542,40 +1542,40 @@ static void test_attr_exists() SUBTEST("Check Attribute Existence"); try { - // Open file. - H5File fid1(FILE_BASIC, H5F_ACC_RDWR); + // Open file. + H5File fid1(FILE_BASIC, H5F_ACC_RDWR); - // Open the root group. - Group root = fid1.openGroup("/"); + // Open the root group. + Group root = fid1.openGroup("/"); - // Check for existence of attribute - bool attr_exists = fid1.attrExists(ATTR1_FL_STR_NAME); - if (attr_exists == false) - throw InvalidActionException("H5File::attrExists", "fid1, ATTR1_FL_STR_NAMEAttribute should exist but does not"); + // Check for existence of attribute + bool attr_exists = fid1.attrExists(ATTR1_FL_STR_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "fid1, ATTR1_FL_STR_NAMEAttribute should exist but does not"); - // Check for existence of attribute - attr_exists = fid1.attrExists(FATTR1_NAME); - if (attr_exists == false) - throw InvalidActionException("H5File::attrExists", "fid1,FATTR2_NAMEAttribute should exist but does not"); + // Check for existence of attribute + attr_exists = fid1.attrExists(FATTR1_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "fid1,FATTR2_NAMEAttribute should exist but does not"); - // Open a group. - Group group = fid1.openGroup(GROUP1_NAME); + // Open a group. + Group group = fid1.openGroup(GROUP1_NAME); - // Check for existence of attribute - attr_exists = group.attrExists(ATTR2_NAME); - if (attr_exists == false) - throw InvalidActionException("H5File::attrExists", "group, ATTR2_NAMEAttribute should exist but does not"); + // Check for existence of attribute + attr_exists = group.attrExists(ATTR2_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "group, ATTR2_NAMEAttribute should exist but does not"); - PASSED(); + PASSED(); } // end try block catch (InvalidActionException& E) { - issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); } catch (Exception& E) { - issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_exists() @@ -1591,100 +1591,100 @@ const unsigned MAX_COMPACT_DEF = 8; const unsigned MIN_DENSE_DEF = 6; static void test_attr_dense_create(FileCreatPropList& fcpl, - FileAccPropList& fapl) + FileAccPropList& fapl) { // Output message about test being performed SUBTEST("Dense Attribute Storage Creation"); try { - // Create file - H5File fid1 (FILE_CRTPROPS, H5F_ACC_TRUNC, fcpl, fapl); + // Create file + H5File fid1 (FILE_CRTPROPS, H5F_ACC_TRUNC, fcpl, fapl); - // Close file - fid1.close(); + // Close file + fid1.close(); - // Get size of file - h5_stat_size_t empty_filesize; // Size of empty file - empty_filesize = h5_get_file_size(FILE_CRTPROPS.c_str(), fapl.getId()); - if (empty_filesize < 0) + // Get size of file + h5_stat_size_t empty_filesize; // Size of empty file + empty_filesize = h5_get_file_size(FILE_CRTPROPS.c_str(), fapl.getId()); + if (empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); - // Re-open file - fid1.openFile(FILE_CRTPROPS, H5F_ACC_RDWR, fapl); + // Re-open file + fid1.openFile(FILE_CRTPROPS, H5F_ACC_RDWR, fapl); - // Create dataspace for dataset - DataSpace ds_space(H5S_SCALAR); + // Create dataspace for dataset + DataSpace ds_space(H5S_SCALAR); - // Create dataset creation property list. - DSetCreatPropList dcpl; + // Create dataset creation property list. + DSetCreatPropList dcpl; - // Create a dataset - DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space, dcpl); + // Create a dataset + DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space, dcpl); - unsigned max_compact = 0, min_dense = 0; + unsigned max_compact = 0, min_dense = 0; - // Retrieve limits for compact/dense attribute storage - dcpl.getAttrPhaseChange(max_compact, min_dense); - verify_val(max_compact, MAX_COMPACT_DEF, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); - verify_val(min_dense, MIN_DENSE_DEF, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); + // Retrieve limits for compact/dense attribute storage + dcpl.getAttrPhaseChange(max_compact, min_dense); + verify_val(max_compact, MAX_COMPACT_DEF, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); + verify_val(min_dense, MIN_DENSE_DEF, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); - // Set new compact/dense attribute storage limits to some random numbers - dcpl.setAttrPhaseChange(7, 5); + // Set new compact/dense attribute storage limits to some random numbers + dcpl.setAttrPhaseChange(7, 5); - // Retrieve limits for compact/dense attribute storage and verify them - dcpl.getAttrPhaseChange(max_compact, min_dense); - verify_val(max_compact, static_cast(7), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); - verify_val(min_dense, static_cast(5), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); + // Retrieve limits for compact/dense attribute storage and verify them + dcpl.getAttrPhaseChange(max_compact, min_dense); + verify_val(max_compact, static_cast(7), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); + verify_val(min_dense, static_cast(5), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); - // Close property list - dcpl.close(); + // Close property list + dcpl.close(); - // H5O_is_attr_dense_test - un-usable + // H5O_is_attr_dense_test - un-usable - // Add attributes, until just before converting to dense storage - char attr_name[NAME_BUF_SIZE]; - unsigned attr_num; - for (attr_num = 0; attr_num < max_compact; attr_num++) - { - // Create attribute - sprintf(attr_name, "attr %02u", attr_num); - Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); + // Add attributes, until just before converting to dense storage + char attr_name[NAME_BUF_SIZE]; + unsigned attr_num; + for (attr_num = 0; attr_num < max_compact; attr_num++) + { + // Create attribute + sprintf(attr_name, "attr %02u", attr_num); + Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); - // Write data to the attribute - attr.write(PredType::NATIVE_UINT, &attr_num); - } // end for + // Write data to the attribute + attr.write(PredType::NATIVE_UINT, &attr_num); + } // end for - // H5O_is_attr_dense_test - un-usable + // H5O_is_attr_dense_test - un-usable - { // Add one more attribute, to push into "dense" storage + { // Add one more attribute, to push into "dense" storage - // Create another attribute - sprintf(attr_name, "attr %02u", attr_num); - Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); + // Create another attribute + sprintf(attr_name, "attr %02u", attr_num); + Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); - // Write data to the attribute - attr.write(PredType::NATIVE_UINT, &attr_num); - } + // Write data to the attribute + attr.write(PredType::NATIVE_UINT, &attr_num); + } - // Attempt to add attribute again, which should fail - try - { - // Create another attribute - sprintf(attr_name, "attr %02u", attr_num); - Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); + // Attempt to add attribute again, which should fail + try + { + // Create another attribute + sprintf(attr_name, "attr %02u", attr_num); + Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); - // continuation here, that means no exception has been thrown - throw InvalidActionException("DataSet::createAttribute", "Maximum number of attributes has been reached"); - } - catch (AttributeIException& E) // catching invalid action + // continuation here, that means no exception has been thrown + throw InvalidActionException("DataSet::createAttribute", "Maximum number of attributes has been reached"); + } + catch (AttributeIException& E) // catching invalid action {} // do nothing, exception expected - PASSED(); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_attr_dense_create()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_dense_create()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_dense_create() @@ -1695,81 +1695,81 @@ static void test_attr_dense_create(FileCreatPropList& fcpl, ** ****************************************************************/ static void test_attr_corder_create_basic(FileCreatPropList& fcpl, - FileAccPropList& fapl) + FileAccPropList& fapl) { // Output message about test being performed SUBTEST("Basic Code for Attributes with Creation Order Info"); try { - // Create file - H5File fid1 (FILE_CRTPROPS, H5F_ACC_TRUNC, fcpl, fapl); - - // Create dataset creation property list. - DSetCreatPropList dcpl; - - // Get creation order indexing on object - unsigned crt_order_flags = 0; - crt_order_flags = dcpl.getAttrCrtOrder(); - verify_val(crt_order_flags, (unsigned)0, "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); - - // Setting invalid combination of a attribute order creation order - // indexing on should fail - try { - dcpl.setAttrCrtOrder(H5P_CRT_ORDER_INDEXED); - - // continuation here, that means no exception has been thrown - throw InvalidActionException("DSetCreatPropList::getAttrCrtOrder", "Indexing cannot be set alone, order tracking is required"); - } - catch (PropListIException& E) // catching invalid action + // Create file + H5File fid1 (FILE_CRTPROPS, H5F_ACC_TRUNC, fcpl, fapl); + + // Create dataset creation property list. + DSetCreatPropList dcpl; + + // Get creation order indexing on object + unsigned crt_order_flags = 0; + crt_order_flags = dcpl.getAttrCrtOrder(); + verify_val(crt_order_flags, (unsigned)0, "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); + + // Setting invalid combination of a attribute order creation order + // indexing on should fail + try { + dcpl.setAttrCrtOrder(H5P_CRT_ORDER_INDEXED); + + // continuation here, that means no exception has been thrown + throw InvalidActionException("DSetCreatPropList::getAttrCrtOrder", "Indexing cannot be set alone, order tracking is required"); + } + catch (PropListIException& E) // catching invalid action {} // do nothing, exception expected - // Set attribute creation order tracking & indexing for object then - // verify them - dcpl.setAttrCrtOrder(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED); - crt_order_flags = dcpl.getAttrCrtOrder(); - verify_val(crt_order_flags, (unsigned)(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED), "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); + // Set attribute creation order tracking & indexing for object then + // verify them + dcpl.setAttrCrtOrder(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED); + crt_order_flags = dcpl.getAttrCrtOrder(); + verify_val(crt_order_flags, (unsigned)(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED), "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); - // Create dataspace for dataset - DataSpace ds_space(H5S_SCALAR); + // Create dataspace for dataset + DataSpace ds_space(H5S_SCALAR); - // Create a dataset - DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space, dcpl); + // Create a dataset + DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space, dcpl); - // Close dataspace - ds_space.close(); + // Close dataspace + ds_space.close(); - // Check on dataset's attribute storage status. - // NOTE: Wrappers not available yet (H5O_is_attr_empty_test - // and H5O_is_attr_dense_test) + // Check on dataset's attribute storage status. + // NOTE: Wrappers not available yet (H5O_is_attr_empty_test + // and H5O_is_attr_dense_test) - // Close dataset - dataset.close(); + // Close dataset + dataset.close(); - // Close property list - dcpl.close(); + // Close property list + dcpl.close(); - // Close file - fid1.close(); + // Close file + fid1.close(); - // Re-open file - fid1.openFile(FILE_CRTPROPS, H5F_ACC_RDWR, fapl); + // Re-open file + fid1.openFile(FILE_CRTPROPS, H5F_ACC_RDWR, fapl); - // Open dataset created previously - dataset = fid1.openDataSet(DSET1_NAME); + // Open dataset created previously + dataset = fid1.openDataSet(DSET1_NAME); - // Retrieve dataset creation property list for the dataset - dcpl = dataset.getCreatePlist(); + // Retrieve dataset creation property list for the dataset + dcpl = dataset.getCreatePlist(); - // Query the attribute creation properties - crt_order_flags = dcpl.getAttrCrtOrder(); - verify_val(crt_order_flags, (unsigned)(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED), "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); + // Query the attribute creation properties + crt_order_flags = dcpl.getAttrCrtOrder(); + verify_val(crt_order_flags, (unsigned)(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED), "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); - PASSED(); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_attr_corder_create_basic()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_corder_create_basic()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_corder_create_basic() @@ -1814,42 +1814,42 @@ void test_attr() // Set the file access proplist for the type of format if (new_format) { - MESSAGE(7, ("testing with new file format\n")); - curr_fapl = fapl_new; + MESSAGE(7, ("testing with new file format\n")); + curr_fapl = fapl_new; } else { - MESSAGE(7, ("testing with old file format\n")); - curr_fapl = fapl; + MESSAGE(7, ("testing with old file format\n")); + curr_fapl = fapl; } - test_attr_basic_write(); // Test basic H5A writing code - test_attr_getname(); // Test overloads of Attribute::getName - test_attr_rename(); // Test renaming attribute - test_attr_basic_read(); // Test basic H5A reading code + test_attr_basic_write(); // Test basic H5A writing code + test_attr_getname(); // Test overloads of Attribute::getName + test_attr_rename(); // Test renaming attribute + test_attr_basic_read(); // Test basic H5A reading code - test_attr_compound_write(); // Test complex datatype H5A writing code - test_attr_compound_read(); // Test complex datatype H5A reading code + test_attr_compound_write(); // Test complex datatype H5A writing code + test_attr_compound_read(); // Test complex datatype H5A reading code - test_attr_scalar_write(); // Test scalar dataspace H5A writing code - test_attr_scalar_read(); // Test scalar dataspace H5A reading code + test_attr_scalar_write(); // Test scalar dataspace H5A writing code + test_attr_scalar_read(); // Test scalar dataspace H5A reading code - test_attr_mult_write(); // Test writing multiple attributes - test_attr_mult_read(); // Test reading multiple attributes - test_attr_delete(); // Test deleting attributes + test_attr_mult_write(); // Test writing multiple attributes + test_attr_mult_read(); // Test reading multiple attributes + test_attr_delete(); // Test deleting attributes - test_attr_dtype_shared(); // Test using shared datatypes in attributes + test_attr_dtype_shared(); // Test using shared datatypes in attributes - test_string_attr(); // Test read/write string attribute - test_attr_exists(); // Test H5Location::attrExists + test_string_attr(); // Test read/write string attribute + test_attr_exists(); // Test H5Location::attrExists // Test with new format if (new_format) { - // Test dense attribute storage creation + // Test dense attribute storage creation test_attr_dense_create(fcpl, curr_fapl); - // Test create objects with attribute creation info + // Test create objects with attribute creation info test_attr_corder_create_basic(fcpl, curr_fapl); } } // end for @@ -1857,18 +1857,18 @@ void test_attr() catch (Exception& E) { - issue_fail_msg("test_attr()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr() /*------------------------------------------------------------------------- - * Function: cleanup_attr + * Function cleanup_attr * - * Purpose: Cleanup temporary test files + * Purpose Cleanup temporary test files * - * Return: none + * Return none * - * Programmer: Albert Cheng + * Programmer Albert Cheng * July 2, 1998 * * Modifications: diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index f49ebb2..ee634c2 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -34,7 +34,7 @@ using namespace H5; #include "h5cpputil.h" // C++ utilility header file /* Number of elements in each test */ -#define NTESTELEM 100000 +#define NTESTELEM 100000 typedef struct complex_t { double re; @@ -45,11 +45,11 @@ typedef struct complex_t { /*------------------------------------------------------------------------- * Function: test_compound_1 * - * Purpose: Tests various things about compound data types. + * Purpose Tests various things about compound data types. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (using C version) + * Programmer Binh-Minh Ribler (using C version) * January, 2007 * * Modifications: @@ -61,13 +61,13 @@ static void test_compound_1() // Output message about test being performed SUBTEST("Compound Data Types"); try { - // Create an empty compound datatype - CompType complex_type(sizeof(complex_t)); + // Create an empty compound datatype + CompType complex_type(sizeof(complex_t)); - // Add a couple of fields - complex_type.insertMember("real", HOFFSET(complex_t, re), PredType::NATIVE_DOUBLE); - complex_type.insertMember("imaginary", HOFFSET(complex_t, im), PredType::NATIVE_DOUBLE); - PASSED(); + // Add a couple of fields + complex_type.insertMember("real", HOFFSET(complex_t, re), PredType::NATIVE_DOUBLE); + complex_type.insertMember("imaginary", HOFFSET(complex_t, im), PredType::NATIVE_DOUBLE); + PASSED(); } // end of try block catch (Exception& E) @@ -78,15 +78,15 @@ static void test_compound_1() /*------------------------------------------------------------------------- - * Function: test_compound_2 + * Function: test_compound_2 * - * Purpose: Tests a compound type conversion where the source and - * destination are the same except for the order of the - * elements. + * Purpose Tests a compound type conversion where the source and + * destination are the same except for the order of the + * elements. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) + * Programmer Binh-Minh Ribler (use C version) * January, 2007 * * Modifications: @@ -96,100 +96,100 @@ static void test_compound_1() static void test_compound_2() { typedef struct { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } src_typ_t; typedef struct { - int e, d, c[4], b, a; + int e, d, c[4], b, a; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - const int nelmts = NTESTELEM; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + const int nelmts = NTESTELEM; const hsize_t four = 4; - int i; + int i; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; ArrayType *array_dt = NULL; // Output message about test being performed SUBTEST("Compound Element Reordering"); try { - // Sizes should be the same, but be careful just in case - buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); - for (i=0; ia = i*8+0; - s_ptr->b = i*8+1; - s_ptr->c[0] = i*8+2; - s_ptr->c[1] = i*8+3; - s_ptr->c[2] = i*8+4; - s_ptr->c[3] = i*8+5; - s_ptr->d = i*8+6; - s_ptr->e = i*8+7; - } - memcpy(buf, orig, nelmts*sizeof(src_typ_t)); - - // Build hdf5 datatypes - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType st(sizeof(src_typ_t)); - st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); - st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); - st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); - st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); - st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); + // Sizes should be the same, but be careful just in case + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); + for (i=0; ia = i*8+0; + s_ptr->b = i*8+1; + s_ptr->c[0] = i*8+2; + s_ptr->c[1] = i*8+3; + s_ptr->c[2] = i*8+4; + s_ptr->c[3] = i*8+5; + s_ptr->d = i*8+6; + s_ptr->e = i*8+7; + } + memcpy(buf, orig, nelmts*sizeof(src_typ_t)); + + // Build hdf5 datatypes + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType st(sizeof(src_typ_t)); + st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); + st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); + st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); + st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); delete array_dt; - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType dt(sizeof(dst_typ_t)); - dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); - dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_INT); - dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); - dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_INT); - dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); - - // Perform the conversion - st.convert(dt, (size_t)nelmts, buf, bkg); - - // Compare results - for (i=0; ia != d_ptr->a || - s_ptr->b != d_ptr->b || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->d != d_ptr->d || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - cerr << " i=" << i << endl; - cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b - << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," - << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" - << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; - cerr << " dst={a=" << s_ptr->a << ", b=" << s_ptr->b - << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," - << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" - << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; - } - } - // Release resources - HDfree(buf); - HDfree(bkg); - HDfree(orig); - s_ptr = NULL; - d_ptr = NULL; - st.close(); - dt.close(); - PASSED(); + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType dt(sizeof(dst_typ_t)); + dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); + dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_INT); + dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); + dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_INT); + dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); + + // Perform the conversion + st.convert(dt, (size_t)nelmts, buf, bkg); + + // Compare results + for (i=0; ia != d_ptr->a || + s_ptr->b != d_ptr->b || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->d != d_ptr->d || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + cerr << " i=" << i << endl; + cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b + << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," + << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" + << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; + cerr << " dst={a=" << s_ptr->a << ", b=" << s_ptr->b + << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," + << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" + << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; + } + } + // Release resources + HDfree(buf); + HDfree(bkg); + HDfree(orig); + s_ptr = NULL; + d_ptr = NULL; + st.close(); + dt.close(); + PASSED(); } // end of try block catch (Exception& E) @@ -203,15 +203,15 @@ static void test_compound_2() /*------------------------------------------------------------------------- - * Function: test_compound_3 + * Function: test_compound_3 * - * Purpose: Tests compound conversions where the source and destination - * are the same except the destination is missing a couple - * members which appear in the source. + * Purpose Tests compound conversions where the source and destination + * are the same except the destination is missing a couple + * members which appear in the source. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) + * Programmer Binh-Minh Ribler (use C version) * January, 2007 * * Modifications: @@ -221,16 +221,16 @@ static void test_compound_2() static void test_compound_3() { typedef struct { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } src_typ_t; typedef struct { - int a, c[4], e; + int a, c[4], e; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - int i; - const int nelmts = NTESTELEM; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + int i; + const int nelmts = NTESTELEM; const hsize_t four = 4; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; ArrayType* array_dt = NULL; @@ -238,85 +238,85 @@ static void test_compound_3() // Output message about test being performed SUBTEST("Compound Datatype Subset Conversions"); try { - /* Initialize */ - buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); - for (i=0; ia = i*8+0; - s_ptr->b = i*8+1; - s_ptr->c[0] = i*8+2; - s_ptr->c[1] = i*8+3; - s_ptr->c[2] = i*8+4; - s_ptr->c[3] = i*8+5; - s_ptr->d = i*8+6; - s_ptr->e = i*8+7; - } - memcpy(buf, orig, nelmts*sizeof(src_typ_t)); - - /* Build hdf5 datatypes */ - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType st(sizeof(src_typ_t)); - st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); - st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); - st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); - st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); - st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); + /* Initialize */ + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); + for (i=0; ia = i*8+0; + s_ptr->b = i*8+1; + s_ptr->c[0] = i*8+2; + s_ptr->c[1] = i*8+3; + s_ptr->c[2] = i*8+4; + s_ptr->c[3] = i*8+5; + s_ptr->d = i*8+6; + s_ptr->e = i*8+7; + } + memcpy(buf, orig, nelmts*sizeof(src_typ_t)); + + /* Build hdf5 datatypes */ + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType st(sizeof(src_typ_t)); + st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); + st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); + st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); + st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); delete array_dt; - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType dt(sizeof(dst_typ_t)); - dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); - dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); - dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); - - /* Perform the conversion */ - st.convert(dt, (size_t)nelmts, buf, bkg); - - /* Compare results */ - for (i=0; ia != d_ptr->a || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - cerr << " i=" << i << endl; - cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b - << ", c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," - << s_ptr->c[2] << "," << s_ptr->c[3] << "], d=" - << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; - cerr << " dst={a=" << d_ptr->a - << ", c=[" << d_ptr->c[0] << "," << d_ptr->c[1] << "," - << d_ptr->c[2] << "," << d_ptr->c[3] << "], e=" - << d_ptr->e << "}" << endl; - } // if - } // for - - /* Release resources */ - HDfree(buf); - HDfree(bkg); - HDfree(orig); - s_ptr = NULL; - d_ptr = NULL; - st.close(); - dt.close(); - PASSED(); + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType dt(sizeof(dst_typ_t)); + dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); + dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); + dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); + + /* Perform the conversion */ + st.convert(dt, (size_t)nelmts, buf, bkg); + + /* Compare results */ + for (i=0; ia != d_ptr->a || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + cerr << " i=" << i << endl; + cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b + << ", c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," + << s_ptr->c[2] << "," << s_ptr->c[3] << "], d=" + << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; + cerr << " dst={a=" << d_ptr->a + << ", c=[" << d_ptr->c[0] << "," << d_ptr->c[1] << "," + << d_ptr->c[2] << "," << d_ptr->c[3] << "], e=" + << d_ptr->e << "}" << endl; + } // if + } // for + + /* Release resources */ + HDfree(buf); + HDfree(bkg); + HDfree(orig); + s_ptr = NULL; + d_ptr = NULL; + st.close(); + dt.close(); + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } if(array_dt) @@ -325,16 +325,16 @@ static void test_compound_3() /*------------------------------------------------------------------------- - * Function: test_compound_4 + * Function: test_compound_4 * - * Purpose: Tests compound conversions when the destination has the same - * fields as the source but one or more of the fields are - * smaller. + * Purpose Tests compound conversions when the destination has the same + * fields as the source but one or more of the fields are + * smaller. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -344,20 +344,20 @@ static void test_compound_4() { typedef struct { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } src_typ_t; typedef struct { - short b; - int a, c[4]; - short d; - int e; + short b; + int a, c[4]; + short d; + int e; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - int i; - const int nelmts = NTESTELEM; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + int i; + const int nelmts = NTESTELEM; const hsize_t four = 4; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; ArrayType* array_dt = NULL; @@ -365,85 +365,85 @@ static void test_compound_4() // Output message about test being performed SUBTEST("Compound Element Shrinking & Reordering"); try { - /* Sizes should be the same, but be careful just in case */ - buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); - for (i=0; ia = i*8+0; - s_ptr->b = (i*8+1) & 0x7fff; - s_ptr->c[0] = i*8+2; - s_ptr->c[1] = i*8+3; - s_ptr->c[2] = i*8+4; - s_ptr->c[3] = i*8+5; - s_ptr->d = (i*8+6) & 0x7fff; - s_ptr->e = i*8+7; - } - memcpy(buf, orig, nelmts*sizeof(src_typ_t)); - - /* Build hdf5 datatypes */ - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType st(sizeof(src_typ_t)); - st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); - st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); - st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); - st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); - st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); + /* Sizes should be the same, but be careful just in case */ + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); + for (i=0; ia = i*8+0; + s_ptr->b = (i*8+1) & 0x7fff; + s_ptr->c[0] = i*8+2; + s_ptr->c[1] = i*8+3; + s_ptr->c[2] = i*8+4; + s_ptr->c[3] = i*8+5; + s_ptr->d = (i*8+6) & 0x7fff; + s_ptr->e = i*8+7; + } + memcpy(buf, orig, nelmts*sizeof(src_typ_t)); + + /* Build hdf5 datatypes */ + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType st(sizeof(src_typ_t)); + st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); + st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); + st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); + st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); delete array_dt; - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType dt(sizeof(dst_typ_t)); - dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); - dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_SHORT); - dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); - dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_SHORT); - dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); - - /* Perform the conversion */ - st.convert(dt, (size_t)nelmts, buf, bkg); - - /* Compare results */ - for (i=0; ia != d_ptr->a || - s_ptr->b != d_ptr->b || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->d != d_ptr->d || - s_ptr->e != d_ptr->e) - { - H5_FAILED(); - cerr << " i=" << i << endl; - cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b - << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," - << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" - << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; - cerr << " dst={a=" << d_ptr->a << ", b=" << d_ptr->b - << "c=[" << d_ptr->c[0] << "," << d_ptr->c[1] << "," - << d_ptr->c[2] << "," << d_ptr->c[3] << ", d=" - << d_ptr->d << ", e=" << d_ptr->e << "}" << endl; - } // if - } // for - - /* Release resources */ - HDfree(buf); - HDfree(bkg); - HDfree(orig); - s_ptr = NULL; - d_ptr = NULL; - st.close(); - dt.close(); - PASSED(); + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType dt(sizeof(dst_typ_t)); + dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); + dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_SHORT); + dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); + dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_SHORT); + dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); + + /* Perform the conversion */ + st.convert(dt, (size_t)nelmts, buf, bkg); + + /* Compare results */ + for (i=0; ia != d_ptr->a || + s_ptr->b != d_ptr->b || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->d != d_ptr->d || + s_ptr->e != d_ptr->e) + { + H5_FAILED(); + cerr << " i=" << i << endl; + cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b + << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," + << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" + << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; + cerr << " dst={a=" << d_ptr->a << ", b=" << d_ptr->b + << "c=[" << d_ptr->c[0] << "," << d_ptr->c[1] << "," + << d_ptr->c[2] << "," << d_ptr->c[3] << ", d=" + << d_ptr->d << ", e=" << d_ptr->e << "}" << endl; + } // if + } // for + + /* Release resources */ + HDfree(buf); + HDfree(bkg); + HDfree(orig); + s_ptr = NULL; + d_ptr = NULL; + st.close(); + dt.close(); + PASSED(); } // end of try block catch (Exception& E) @@ -457,17 +457,17 @@ static void test_compound_4() /*------------------------------------------------------------------------- - * Function: test_compound_5 + * Function: test_compound_5 * - * Purpose: Many versions of HDF5 have a bug in the optimized compound + * Purpose Many versions of HDF5 have a bug in the optimized compound * datatype conversion function, H5T_conv_struct_opt(), which * is triggered when the top-level type contains a struct * which must undergo a conversion. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -499,55 +499,55 @@ static void test_compound_5() SUBTEST("Optimized Struct Converter"); try { - /* Build datatypes */ - array_dt = new ArrayType(PredType::NATIVE_SHORT, 1, dims); - CompType short_array(4*sizeof(short)); - short_array.insertMember("_", 0, *array_dt); - array_dt->close(); + /* Build datatypes */ + array_dt = new ArrayType(PredType::NATIVE_SHORT, 1, dims); + CompType short_array(4*sizeof(short)); + short_array.insertMember("_", 0, *array_dt); + array_dt->close(); delete array_dt; - CompType int_array(4*sizeof(int)); - array_dt = new ArrayType(PredType::NATIVE_INT, 1, dims); - int_array.insertMember("_", 0, *array_dt); - array_dt->close(); - - StrType strg(PredType::C_S1, 16); - CompType src_type(sizeof(src_typ_t)); - src_type.insertMember("name", HOFFSET(src_typ_t, name), strg); - src_type.insertMember("tdim", HOFFSET(src_typ_t, tdim), PredType::NATIVE_SHORT); - src_type.insertMember("coll_ids", HOFFSET(src_typ_t, coll_ids), short_array); - - CompType dst_type(sizeof(dst_typ_t)); - dst_type.insertMember("name", HOFFSET(dst_typ_t, name), strg); - dst_type.insertMember("tdim", HOFFSET(dst_typ_t, tdim), PredType::NATIVE_SHORT); - dst_type.insertMember("coll_ids", HOFFSET(dst_typ_t, coll_ids), int_array); - - /* Convert data */ - memcpy(buf, src, sizeof(src)); - src_type.convert(dst_type, (size_t)2, buf, bkg); - dst = (dst_typ_t*)buf; - - /* Cleanup */ - src_type.close(); - dst_type.close(); - strg.close(); - short_array.close(); - int_array.close(); - - /* Check results */ - if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || - src[1].tdim!=dst[1].tdim || - src[1].coll_ids[0]!=dst[1].coll_ids[0] || - src[1].coll_ids[1]!=dst[1].coll_ids[1] || - src[1].coll_ids[2]!=dst[1].coll_ids[2] || - src[1].coll_ids[3]!=dst[1].coll_ids[3]) - { H5_FAILED(); } - - /* Free memory buffers */ - HDfree(buf); - HDfree(bkg); - dst = NULL; - PASSED(); + CompType int_array(4*sizeof(int)); + array_dt = new ArrayType(PredType::NATIVE_INT, 1, dims); + int_array.insertMember("_", 0, *array_dt); + array_dt->close(); + + StrType strg(PredType::C_S1, 16); + CompType src_type(sizeof(src_typ_t)); + src_type.insertMember("name", HOFFSET(src_typ_t, name), strg); + src_type.insertMember("tdim", HOFFSET(src_typ_t, tdim), PredType::NATIVE_SHORT); + src_type.insertMember("coll_ids", HOFFSET(src_typ_t, coll_ids), short_array); + + CompType dst_type(sizeof(dst_typ_t)); + dst_type.insertMember("name", HOFFSET(dst_typ_t, name), strg); + dst_type.insertMember("tdim", HOFFSET(dst_typ_t, tdim), PredType::NATIVE_SHORT); + dst_type.insertMember("coll_ids", HOFFSET(dst_typ_t, coll_ids), int_array); + + /* Convert data */ + memcpy(buf, src, sizeof(src)); + src_type.convert(dst_type, (size_t)2, buf, bkg); + dst = (dst_typ_t*)buf; + + /* Cleanup */ + src_type.close(); + dst_type.close(); + strg.close(); + short_array.close(); + int_array.close(); + + /* Check results */ + if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || + src[1].tdim!=dst[1].tdim || + src[1].coll_ids[0]!=dst[1].coll_ids[0] || + src[1].coll_ids[1]!=dst[1].coll_ids[1] || + src[1].coll_ids[2]!=dst[1].coll_ids[2] || + src[1].coll_ids[3]!=dst[1].coll_ids[3]) + { H5_FAILED(); } + + /* Free memory buffers */ + HDfree(buf); + HDfree(bkg); + dst = NULL; + PASSED(); } // end of try block catch (Exception& E) @@ -561,16 +561,16 @@ static void test_compound_5() /*------------------------------------------------------------------------- - * Function: test_compound_6 + * Function: test_compound_6 * - * Purpose: Tests compound conversions when the destination has the same - * fields as the source but one or more of the fields are - * larger. + * Purpose Tests compound conversions when the destination has the same + * fields as the source but one or more of the fields are + * larger. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -579,72 +579,72 @@ static void test_compound_5() static void test_compound_6() { typedef struct { - short b; - short d; + short b; + short d; } src_typ_t; typedef struct { - long b; - long d; + long b; + long d; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - int i; - const int nelmts = NTESTELEM; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + int i; + const int nelmts = NTESTELEM; unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; // Output message about test being performed SUBTEST("Compound Element Growing"); try { - /* Sizes should be the same, but be careful just in case */ - buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); - for (i=0; ib = (i*8+1) & 0x7fff; - s_ptr->d = (i*8+6) & 0x7fff; - } - memcpy(buf, orig, nelmts*sizeof(src_typ_t)); - - /* Build hdf5 datatypes */ - CompType st(sizeof(src_typ_t)); - st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_SHORT); - st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_SHORT); - - CompType dt(sizeof(dst_typ_t)); - dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_LONG); - dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_LONG); - - /* Perform the conversion */ - st.convert(dt, (size_t)nelmts, buf, bkg); - - /* Compare results */ - for (i=0; ib != d_ptr->b || - s_ptr->d != d_ptr->d) - { - H5_FAILED(); - cerr << " i=" << i << endl; - cerr << " src={b=" << s_ptr->b << ", d=" << s_ptr->d - << "}" << endl; - cerr << " dst={b=" << d_ptr->b << ", d=" << d_ptr->d - << "}" << endl; - } // if - } // for - - /* Release resources */ - HDfree(buf); - HDfree(bkg); - HDfree(orig); - s_ptr = NULL; - d_ptr = NULL; - st.close(); - dt.close(); - PASSED(); + /* Sizes should be the same, but be careful just in case */ + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); + for (i=0; ib = (i*8+1) & 0x7fff; + s_ptr->d = (i*8+6) & 0x7fff; + } + memcpy(buf, orig, nelmts*sizeof(src_typ_t)); + + /* Build hdf5 datatypes */ + CompType st(sizeof(src_typ_t)); + st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_SHORT); + st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_SHORT); + + CompType dt(sizeof(dst_typ_t)); + dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_LONG); + dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_LONG); + + /* Perform the conversion */ + st.convert(dt, (size_t)nelmts, buf, bkg); + + /* Compare results */ + for (i=0; ib != d_ptr->b || + s_ptr->d != d_ptr->d) + { + H5_FAILED(); + cerr << " i=" << i << endl; + cerr << " src={b=" << s_ptr->b << ", d=" << s_ptr->d + << "}" << endl; + cerr << " dst={b=" << d_ptr->b << ", d=" << d_ptr->d + << "}" << endl; + } // if + } // for + + /* Release resources */ + HDfree(buf); + HDfree(bkg); + HDfree(orig); + s_ptr = NULL; + d_ptr = NULL; + st.close(); + dt.close(); + PASSED(); } // end of try block catch (Exception& E) @@ -654,15 +654,15 @@ static void test_compound_6() } // test_compound_6() /*------------------------------------------------------------------------- - * Function: test_compound_7 + * Function: test_compound_7 * - * Purpose: Tests inserting fields into compound datatypes when the field - * overlaps the end of the compound datatype. + * Purpose Tests inserting fields into compound datatypes when the field + * overlaps the end of the compound datatype. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -671,47 +671,47 @@ static void test_compound_6() static void test_compound_7() { typedef struct { - int a; - float b; - long c; + int a; + float b; + long c; } s1_typ_t; typedef struct { - int a; - float b; - long c; - double d; + int a; + float b; + long c; + double d; } s2_typ_t; // Output message about test being performed SUBTEST("Compound Element Insertion"); try { - CompType tid1(sizeof(s1_typ_t)); + CompType tid1(sizeof(s1_typ_t)); - tid1.insertMember("a", HOFFSET(s1_typ_t,a),PredType::NATIVE_INT); - tid1.insertMember("b", HOFFSET(s1_typ_t,b),PredType::NATIVE_FLOAT); - tid1.insertMember("c", HOFFSET(s1_typ_t,c),PredType::NATIVE_LONG); + tid1.insertMember("a", HOFFSET(s1_typ_t,a),PredType::NATIVE_INT); + tid1.insertMember("b", HOFFSET(s1_typ_t,b),PredType::NATIVE_FLOAT); + tid1.insertMember("c", HOFFSET(s1_typ_t,c),PredType::NATIVE_LONG); - size_t type_size = tid1.getSize(); - verify_val(type_size, sizeof(s1_typ_t), "DataType::getSize", __LINE__, __FILE__); + size_t type_size = tid1.getSize(); + verify_val(type_size, sizeof(s1_typ_t), "DataType::getSize", __LINE__, __FILE__); - CompType tid2; - tid2.copy(tid1); + CompType tid2; + tid2.copy(tid1); - type_size = tid2.getSize(); - verify_val_noteq(type_size, sizeof(s2_typ_t), "DataType::getSize", __LINE__, __FILE__); + type_size = tid2.getSize(); + verify_val_noteq(type_size, sizeof(s2_typ_t), "DataType::getSize", __LINE__, __FILE__); - /* Should not be able to insert field past end of compound datatype */ - try { - tid2.insertMember("d", HOFFSET(s2_typ_t, d), PredType::NATIVE_DOUBLE); - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("CompType::insertMember", "Attempted to insert field past end of compound data type."); - } catch (DataTypeIException& err) {} + /* Should not be able to insert field past end of compound datatype */ + try { + tid2.insertMember("d", HOFFSET(s2_typ_t, d), PredType::NATIVE_DOUBLE); + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("CompType::insertMember", "Attempted to insert field past end of compound data type."); + } catch (DataTypeIException& err) {} - /* Release resources */ - tid1.close(); - tid2.close(); - PASSED(); + /* Release resources */ + tid1.close(); + tid2.close(); + PASSED(); } // end of try block catch (Exception& E) @@ -721,13 +721,13 @@ static void test_compound_7() } // test_compound_7() /*------------------------------------------------------------------------- - * Function: test_compound_set_size + * Function: test_compound_set_size * - * Purpose: Tests member function setSize() on compound datatype + * Purpose Tests member function setSize() on compound datatype * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use partial C version test_ooo_order) + * Programmer Binh-Minh Ribler (use partial C version test_ooo_order) * March, 2014 * * Modifications: @@ -738,7 +738,7 @@ const H5std_string COMPFILE("tcompound_types.h5"); static void test_compound_set_size() { typedef struct { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } src_typ_t; // Output message about test being performed @@ -755,53 +755,53 @@ static void test_compound_set_size() dtype.insertMember("c", HOFFSET(src_typ_t, c), PredType::NATIVE_LONG); dtype.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_DOUBLE); - // Verify that the compound is not packed - // bool packed = dtype.packed(); // not until C library provides API - // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); + // Verify that the compound is not packed + // bool packed = dtype.packed(); // not until C library provides API + // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); - dtype.commit(file, "dtype"); + dtype.commit(file, "dtype"); - // Close the type and file - dtype.close(); - file.close(); + // Close the type and file + dtype.close(); + file.close(); - // Open the file for read/write - file.openFile(COMPFILE, H5F_ACC_RDWR); + // Open the file for read/write + file.openFile(COMPFILE, H5F_ACC_RDWR); - // Open the data type "dtype" - CompType dtype_tmp = file.openCompType("dtype"); + // Open the data type "dtype" + CompType dtype_tmp = file.openCompType("dtype"); - // Make a copy of the data type - dtype.copy(dtype_tmp); + // Make a copy of the data type + dtype.copy(dtype_tmp); - // Verify that the compound is not packed - // packed = dtype_tmp.packed(); // not until C library provides API - // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); + // Verify that the compound is not packed + // packed = dtype_tmp.packed(); // not until C library provides API + // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); - // Expand the type, and verify that it became unpacked - dtype.setSize((size_t)33); - // packed = dtype.packed(); // not until C library provides API - // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); + // Expand the type, and verify that it became unpacked + dtype.setSize((size_t)33); + // packed = dtype.packed(); // not until C library provides API + // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); - // Verify setSize() actually set size - size_t new_size = dtype.getSize(); - verify_val(new_size, (size_t)33, "DataType::getSize", __LINE__, __FILE__); + // Verify setSize() actually set size + size_t new_size = dtype.getSize(); + verify_val(new_size, (size_t)33, "DataType::getSize", __LINE__, __FILE__); - // Shrink the type, and verify that it became packed - dtype.setSize((size_t)32); - // packed = dtype.packed(); // not until C library provides API - // verify_val(packed, TRUE, "DataType::packed", __LINE__, __FILE__); + // Shrink the type, and verify that it became packed + dtype.setSize((size_t)32); + // packed = dtype.packed(); // not until C library provides API + // verify_val(packed, TRUE, "DataType::packed", __LINE__, __FILE__); - // Verify setSize() actually set size again - new_size = dtype.getSize(); - verify_val(new_size, (size_t)32, "DataType::getSize", __LINE__, __FILE__); + // Verify setSize() actually set size again + new_size = dtype.getSize(); + verify_val(new_size, (size_t)32, "DataType::getSize", __LINE__, __FILE__); - /* Close types and file */ - dtype_tmp.close(); - dtype.close(); - file.close(); + /* Close types and file */ + dtype_tmp.close(); + dtype.close(); + file.close(); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -811,14 +811,14 @@ static void test_compound_set_size() } // test_compound_set_size() /*------------------------------------------------------------------------- - * Function: test_compound + * Function: test_compound * - * Purpose: Main compound datatype testing routine + * Purpose Main compound datatype testing routine * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler - * January 2007 + * Programmer Binh-Minh Ribler + * January 2007 * * Modifications: * @@ -830,23 +830,23 @@ void test_compound() // Output message about test being performed MESSAGE(5, ("Testing Compound Data Type operations\n")); - test_compound_1(); // various things about compound data types - test_compound_2(); // compound element reordering - test_compound_3(); // compound datatype subset conversions - test_compound_4(); // compound element shrinking & reordering - test_compound_5(); // optimized struct converter - test_compound_6(); // compound element growing - test_compound_7(); // compound element insertion - test_compound_set_size(); // set size on compound data types + test_compound_1(); // various things about compound data types + test_compound_2(); // compound element reordering + test_compound_3(); // compound datatype subset conversions + test_compound_4(); // compound element shrinking & reordering + test_compound_5(); // optimized struct converter + test_compound_6(); // compound element growing + test_compound_7(); // compound element insertion + test_compound_set_size(); // set size on compound data types } // test_compound() /*------------------------------------------------------------------------- - * Function: cleanup_compound + * Function: cleanup_compound * - * Purpose: Cleanup temporary test files - nothing at this time. + * Purpose Cleanup temporary test files - nothing at this time. * - * Return: none + * Return none * * Modifications: * diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp index d733ffe..f39694b 100644 --- a/c++/test/tdspl.cpp +++ b/c++/test/tdspl.cpp @@ -16,7 +16,7 @@ /***************************************************************************** FILE tdspl.cpp - HDF5 C++ testing the dataset memory and transfer property - list functionality + list functionality ***************************************************************************/ #ifdef OLD_HEADER_FILENAME @@ -45,70 +45,70 @@ static void test_transfplist() SUBTEST("DSetMemXferPropList::set/getDataTransform()"); try { - // Create various data set prop lists and set data transform expression. - DSetMemXferPropList dxpl_c_to_f(c_to_f); - - DSetMemXferPropList dxpl_simple; - dxpl_simple.setDataTransform(simple); - - DSetMemXferPropList dxpl_utrans_inv; - dxpl_utrans_inv.setDataTransform(utrans_inv); - - // - // Make a copy of one of those prop lists then read the data transform - // expression and verify that it's the same as the original. - // - - // Copy the prop list. - DSetMemXferPropList dxpl_c_to_f_copy; - dxpl_c_to_f_copy.copy(dxpl_c_to_f); - - // Find out the length of the transform expression, allocate the buffer - // for it, then read and verify the expression from the copied plist - ssize_t tran_len = dxpl_c_to_f_copy.getDataTransform(NULL); - char *c_to_f_read = (char *)HDmalloc(tran_len+1); - HDmemset(c_to_f_read, 0, tran_len+1); - dxpl_c_to_f_copy.getDataTransform(c_to_f_read, tran_len+1); - verify_val((const char*)c_to_f_read, (const char*)c_to_f, - "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - HDfree(c_to_f_read); - - // - // Read the expression of each of the prop lists and verify the read - // expression - // - - // Get and verify the expression with: - // ssize_t getDataTransform(char* exp, const size_t buf_size [default=0]) - tran_len = dxpl_c_to_f.getDataTransform(NULL); - c_to_f_read = (char *)HDmalloc(tran_len+1); - HDmemset(c_to_f_read, 0, tran_len+1); - dxpl_c_to_f.getDataTransform(c_to_f_read, tran_len+1); - verify_val((const char*)c_to_f_read, (const char*)c_to_f, - "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - HDfree(c_to_f_read); - - // Get and verify the expression with: - // H5std_string DSetMemXferPropList::getDataTransform() - H5std_string simple_read = dxpl_simple.getDataTransform(); - verify_val((const char*)simple_read.c_str(), (const char*)simple, - "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - - // Get and verify the expression with: - // ssize_t getDataTransform(char* exp, const size_t buf_size) - tran_len = dxpl_utrans_inv.getDataTransform(NULL, 0); - char *utrans_inv_read = (char *)HDmalloc(tran_len+1); - HDmemset(utrans_inv_read, 0, tran_len+1); - dxpl_utrans_inv.getDataTransform(utrans_inv_read, tran_len+1); - verify_val((const char*)utrans_inv_read, (const char*)utrans_inv, - "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - HDfree(utrans_inv_read); - - PASSED(); + // Create various data set prop lists and set data transform expression. + DSetMemXferPropList dxpl_c_to_f(c_to_f); + + DSetMemXferPropList dxpl_simple; + dxpl_simple.setDataTransform(simple); + + DSetMemXferPropList dxpl_utrans_inv; + dxpl_utrans_inv.setDataTransform(utrans_inv); + + // + // Make a copy of one of those prop lists then read the data transform + // expression and verify that it's the same as the original. + // + + // Copy the prop list. + DSetMemXferPropList dxpl_c_to_f_copy; + dxpl_c_to_f_copy.copy(dxpl_c_to_f); + + // Find out the length of the transform expression, allocate the buffer + // for it, then read and verify the expression from the copied plist + ssize_t tran_len = dxpl_c_to_f_copy.getDataTransform(NULL); + char *c_to_f_read = (char *)HDmalloc(tran_len+1); + HDmemset(c_to_f_read, 0, tran_len+1); + dxpl_c_to_f_copy.getDataTransform(c_to_f_read, tran_len+1); + verify_val((const char*)c_to_f_read, (const char*)c_to_f, + "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); + HDfree(c_to_f_read); + + // + // Read the expression of each of the prop lists and verify the read + // expression + // + + // Get and verify the expression with: + // ssize_t getDataTransform(char* exp, const size_t buf_size [default=0]) + tran_len = dxpl_c_to_f.getDataTransform(NULL); + c_to_f_read = (char *)HDmalloc(tran_len+1); + HDmemset(c_to_f_read, 0, tran_len+1); + dxpl_c_to_f.getDataTransform(c_to_f_read, tran_len+1); + verify_val((const char*)c_to_f_read, (const char*)c_to_f, + "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); + HDfree(c_to_f_read); + + // Get and verify the expression with: + // H5std_string DSetMemXferPropList::getDataTransform() + H5std_string simple_read = dxpl_simple.getDataTransform(); + verify_val((const char*)simple_read.c_str(), (const char*)simple, + "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); + + // Get and verify the expression with: + // ssize_t getDataTransform(char* exp, const size_t buf_size) + tran_len = dxpl_utrans_inv.getDataTransform(NULL, 0); + char *utrans_inv_read = (char *)HDmalloc(tran_len+1); + HDmemset(utrans_inv_read, 0, tran_len+1); + dxpl_utrans_inv.getDataTransform(utrans_inv_read, tran_len+1); + verify_val((const char*)utrans_inv_read, (const char*)utrans_inv, + "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); + HDfree(utrans_inv_read); + + PASSED(); } catch (Exception& E) { - issue_fail_msg("test_transfplist", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_transfplist", __LINE__, __FILE__, E.getCDetailMsg()); } } diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp index 28ede6b..779c931 100644 --- a/c++/test/testhdf5.cpp +++ b/c++/test/testhdf5.cpp @@ -28,16 +28,16 @@ base functionality testing. EXTERNAL ROUTINES/VARIABLES: - TestInit(...) -- Initialize testing framework - TestInfo(...) -- Print test info - AddTest(...) -- Setup a test function and add it to the list of tests - TestParseCmdLine(...) -- Parse command line arguments - PerformTests() -- Perform requested testing - GetTestSummary() -- Retrieve Summary request value - TestSummary() -- Display test summary - GetTestCleanup() -- Retrieve Cleanup request value - TestCleanup() -- Clean up files from testing - GetTestNumErrs() -- Retrieve the number of testing errors + TestInit(...) -- Initialize testing framework + TestInfo(...) -- Print test info + AddTest(...) -- Setup a test function and add it to the list of tests + TestParseCmdLine(...) -- Parse command line arguments + PerformTests() -- Perform requested testing + GetTestSummary() -- Retrieve Summary request value + TestSummary() -- Display test summary + GetTestCleanup() -- Retrieve Cleanup request value + TestCleanup() -- Clean up files from testing + GetTestNumErrs() -- Retrieve the number of testing errors ***************************************************************************/ #ifdef OLD_HEADER_FILENAME @@ -60,47 +60,47 @@ main(int argc, char *argv[]) { try { - // Turn of the auto-printing when failure occurs so that we can - // handle the errors appropriately since sometime failures are - // caused deliberately and expected. - Exception::dontPrint(); - /* Initialize testing framework */ - TestInit(argv[0], NULL, NULL); - - // testing file creation and opening in tfile.cpp - AddTest("tfile", test_file, cleanup_file, "File I/O Operations", NULL); - // testing dataset functionalities in dset.cpp - AddTest("dsets", test_dset, cleanup_dsets, "Dataset I/O Operations", NULL); - // testing dataspace functionalities in th5s.cpp - AddTest("th5s", test_h5s, cleanup_h5s, "Dataspaces", NULL); - // testing attribute functionalities in tattr.cpp - AddTest("tattr", test_attr, cleanup_attr, "Attributes", NULL); - // testing object functionalities in tobject.cpp - AddTest("tobject", test_object, cleanup_object, "Objects", NULL); - // testing reference functionalities in trefer.cpp - AddTest("trefer", test_reference, cleanup_reference, "References", NULL); - // testing variable-length strings in tvlstr.cpp - AddTest("tvlstr", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL); - AddTest("ttypes", test_types, cleanup_types, "Generic Data Types", NULL); - AddTest("tarray", test_array, cleanup_array, "Array Datatypes", NULL); - AddTest("tcompound", test_compound, cleanup_compound, "Compound Data Types", NULL); - AddTest("tdspl", test_dsproplist, cleanup_dsproplist, "Dataset Property List", NULL); - AddTest("tfilter", test_filters, cleanup_filters, "Various Filters", NULL); - AddTest("tlinks", test_links, cleanup_links, "Various Links", NULL); + // Turn of the auto-printing when failure occurs so that we can + // handle the errors appropriately since sometime failures are + // caused deliberately and expected. + Exception::dontPrint(); + /* Initialize testing framework */ + TestInit(argv[0], NULL, NULL); + + // testing file creation and opening in tfile.cpp + AddTest("tfile", test_file, cleanup_file, "File I/O Operations", NULL); + // testing dataset functionalities in dset.cpp + AddTest("dsets", test_dset, cleanup_dsets, "Dataset I/O Operations", NULL); + // testing dataspace functionalities in th5s.cpp + AddTest("th5s", test_h5s, cleanup_h5s, "Dataspaces", NULL); + // testing attribute functionalities in tattr.cpp + AddTest("tattr", test_attr, cleanup_attr, "Attributes", NULL); + // testing object functionalities in tobject.cpp + AddTest("tobject", test_object, cleanup_object, "Objects", NULL); + // testing reference functionalities in trefer.cpp + AddTest("trefer", test_reference, cleanup_reference, "References", NULL); + // testing variable-length strings in tvlstr.cpp + AddTest("tvlstr", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL); + AddTest("ttypes", test_types, cleanup_types, "Generic Data Types", NULL); + AddTest("tarray", test_array, cleanup_array, "Array Datatypes", NULL); + AddTest("tcompound", test_compound, cleanup_compound, "Compound Data Types", NULL); + AddTest("tdspl", test_dsproplist, cleanup_dsproplist, "Dataset Property List", NULL); + AddTest("tfilter", test_filters, cleanup_filters, "Various Filters", NULL); + AddTest("tlinks", test_links, cleanup_links, "Various Links", NULL); /* Comment out tests that are not done yet. - BMR, Feb 2001 - AddTest("select", test_select, cleanup_select, "Selections", NULL); - AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL); - AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL); + AddTest("select", test_select, cleanup_select, "Selections", NULL); + AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL); + AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL); */ - AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL); + AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL); /* - AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL); - AddTest("id", test_ids, NULL, "User-Created Identifiers", NULL); + AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL); + AddTest("id", test_ids, NULL, "User-Created Identifiers", NULL); Comment out tests that are not done yet */ /* Tentative - BMR 2007/1/12 - AddTest("enum", test_enum, cleanup_enum, "Enum Data Types", NULL); + AddTest("enum", test_enum, cleanup_enum, "Enum Data Types", NULL); */ } catch (Exception& E) diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index c7ed933..261beab 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -49,6 +49,7 @@ const size_t F2_OFFSET_SIZE = 8; const size_t F2_LENGTH_SIZE = 8; const unsigned F2_SYM_LEAF_K = 8; const unsigned F2_SYM_INTERN_K = 32; +const unsigned F2_ISTORE = 64; const H5std_string FILE2("tfile2.h5"); const hsize_t F3_USERBLOCK_SIZE = (hsize_t)0; @@ -65,20 +66,20 @@ const H5std_string FILE4("tfile4.h5"); /*------------------------------------------------------------------------- * Function: test_file_create * - * Purpose: Test file and template creations + * Purpose Test file and template creations * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) + * Programmer Binh-Minh Ribler (use C version) * January, 2001 * * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hsize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * January, 2005: C tests' macro VERIFY casts values to 'long' for all + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hsize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. * *------------------------------------------------------------------------- */ @@ -97,81 +98,81 @@ static void test_file_create() // Setting this to NULL for cleaning up in failure situations H5File* file1 = NULL; try { - // Create file FILE1 - file1 = new H5File (FILE1, H5F_ACC_EXCL); - - // Try to create the same file with H5F_ACC_TRUNC. This should fail - // because file1 is the same file and is currently open. - try { - H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "Attempted to create an existing file."); - } - catch (FileIException& E) // catch truncating existing file - {} // do nothing, FAIL expected - - // Close file1 - delete file1; - file1 = NULL; - - // Try again with H5F_ACC_EXCL. This should fail because the file - // already exists from the previous steps. - try { - H5File file2(FILE1, H5F_ACC_EXCL); // should throw E - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "File already exists."); - } - catch (FileIException& E) // catching creating existing file - {} // do nothing, FAIL expected - - // Test create with H5F_ACC_TRUNC. This will truncate the existing file. - file1 = new H5File (FILE1, H5F_ACC_TRUNC); - - // Try to create first file again. This should fail because file1 - // is the same file and is currently open. - try { - H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "H5F_ACC_TRUNC attempt on an opened file."); - } - catch (FileIException& E) // catching truncating opened file - {} // do nothing, FAIL expected - - // Try with H5F_ACC_EXCL. This should fail too because the file already - // exists. - try { - H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "H5F_ACC_EXCL attempt on an existing file."); - } - catch (FileIException& E) // catching H5F_ACC_EXCL on existing file - {} // do nothing, FAIL expected - - // Get the file-creation template - FileCreatPropList tmpl1 = file1->getCreatePlist(); - - hsize_t ublock = tmpl1.getUserblock(); - verify_val((long)ublock, (long)F1_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - - size_t parm1, parm2; // file-creation parameters - tmpl1.getSizes( parm1, parm2); - verify_val(parm1, F1_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - verify_val(parm2, F1_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + // Create file FILE1 + file1 = new H5File (FILE1, H5F_ACC_EXCL); + + // Try to create the same file with H5F_ACC_TRUNC. This should fail + // because file1 is the same file and is currently open. + try { + H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "Attempted to create an existing file."); + } + catch (FileIException& E) // catch truncating existing file + {} // do nothing, FAIL expected + + // Close file1 + delete file1; + file1 = NULL; + + // Try again with H5F_ACC_EXCL. This should fail because the file + // already exists from the previous steps. + try { + H5File file2(FILE1, H5F_ACC_EXCL); // should throw E + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "File already exists."); + } + catch (FileIException& E) // catching creating existing file + {} // do nothing, FAIL expected + + // Test create with H5F_ACC_TRUNC. This will truncate the existing file. + file1 = new H5File (FILE1, H5F_ACC_TRUNC); + + // Try to create first file again. This should fail because file1 + // is the same file and is currently open. + try { + H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "H5F_ACC_TRUNC attempt on an opened file."); + } + catch (FileIException& E) // catching truncating opened file + {} // do nothing, FAIL expected + + // Try with H5F_ACC_EXCL. This should fail too because the file already + // exists. + try { + H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "H5F_ACC_EXCL attempt on an existing file."); + } + catch (FileIException& E) // catching H5F_ACC_EXCL on existing file + {} // do nothing, FAIL expected + + // Get the file-creation template + FileCreatPropList tmpl1 = file1->getCreatePlist(); + + hsize_t ublock = tmpl1.getUserblock(); + verify_val((long)ublock, (long)F1_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); + + size_t parm1, parm2; // file-creation parameters + tmpl1.getSizes( parm1, parm2); + verify_val(parm1, F1_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + verify_val(parm2, F1_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); unsigned iparm1,iparm2; // file-creation parameters tmpl1.getSymk( iparm1, iparm2); verify_val(iparm1, F1_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); verify_val(iparm2, F1_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - // tmpl1 is automatically closed; if error occurs, it'll be - // caught in the catch block + // tmpl1 is automatically closed; if error occurs, it'll be + // caught in the catch block - // Close first file - delete file1; + // Close first file + delete file1; } catch (InvalidActionException& E) { @@ -183,7 +184,7 @@ static void test_file_create() // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); if (file1 != NULL) // clean up delete file1; } @@ -192,79 +193,79 @@ static void test_file_create() FileCreatPropList* tmpl1 = NULL; try { - // Create a new file with a non-standard file-creation template - tmpl1 = new FileCreatPropList; + // Create a new file with a non-standard file-creation template + tmpl1 = new FileCreatPropList; - // Set the new file-creation parameters - tmpl1->setUserblock (F2_USERBLOCK_SIZE); - tmpl1->setSizes( F2_OFFSET_SIZE, F2_LENGTH_SIZE ); - tmpl1->setSymk( F2_SYM_INTERN_K, F2_SYM_LEAF_K ); + // Set the new file-creation parameters + tmpl1->setUserblock (F2_USERBLOCK_SIZE); + tmpl1->setSizes( F2_OFFSET_SIZE, F2_LENGTH_SIZE ); + tmpl1->setSymk( F2_SYM_INTERN_K, F2_SYM_LEAF_K ); - // Try to create second file, with non-standard file-creation template - // params. - H5File file2( FILE2, H5F_ACC_TRUNC, *tmpl1 ); + // Try to create second file, with non-standard file-creation template + // params. + H5File file2( FILE2, H5F_ACC_TRUNC, *tmpl1 ); - // Release file-creation template - delete tmpl1; - tmpl1 = NULL; + // Release file-creation template + delete tmpl1; + tmpl1 = NULL; - // Get the file-creation template - tmpl1 = new FileCreatPropList (file2.getCreatePlist()); + // Get the file-creation template + tmpl1 = new FileCreatPropList (file2.getCreatePlist()); - // Get the file-creation parameters - hsize_t ublock = tmpl1->getUserblock(); - verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); + // Get the file-creation parameters + hsize_t ublock = tmpl1->getUserblock(); + verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - size_t parm1, parm2; // file-creation parameters - tmpl1->getSizes( parm1, parm2); - verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + size_t parm1, parm2; // file-creation parameters + tmpl1->getSizes( parm1, parm2); + verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - unsigned iparm1,iparm2; // file-creation parameters + unsigned iparm1,iparm2; // file-creation parameters tmpl1->getSymk( iparm1, iparm2); verify_val(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); verify_val(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - // Clone the file-creation template - FileCreatPropList tmpl2; - tmpl2.copy (*tmpl1); + // Clone the file-creation template + FileCreatPropList tmpl2; + tmpl2.copy (*tmpl1); - // Release file-creation template - delete tmpl1; - tmpl1 = NULL; + // Release file-creation template + delete tmpl1; + tmpl1 = NULL; - // Set the new file-creation parameter - tmpl2.setUserblock( F3_USERBLOCK_SIZE ); + // Set the new file-creation parameter + tmpl2.setUserblock( F3_USERBLOCK_SIZE ); - // Try to create second file, with non-standard file-creation template - // params - H5File file3( FILE3, H5F_ACC_TRUNC, tmpl2 ); + // Try to create second file, with non-standard file-creation template + // params + H5File file3( FILE3, H5F_ACC_TRUNC, tmpl2 ); - // Get the file-creation template - tmpl1 = new FileCreatPropList (file3.getCreatePlist()); + // Get the file-creation template + tmpl1 = new FileCreatPropList (file3.getCreatePlist()); - // Get the file-creation parameters - ublock = tmpl1->getUserblock(); - verify_val((long)ublock, (long)F3_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); + // Get the file-creation parameters + ublock = tmpl1->getUserblock(); + verify_val((long)ublock, (long)F3_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - tmpl1->getSizes( parm1, parm2); - verify_val(parm1, F3_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - verify_val(parm2, F3_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + tmpl1->getSizes( parm1, parm2); + verify_val(parm1, F3_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + verify_val(parm2, F3_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - tmpl1->getSymk( iparm1, iparm2); - verify_val(iparm1, F3_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - verify_val(iparm2, F3_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); + tmpl1->getSymk( iparm1, iparm2); + verify_val(iparm1, F3_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); + verify_val(iparm2, F3_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - // Release file-creation template - delete tmpl1; - PASSED(); + // Release file-creation template + delete tmpl1; + PASSED(); } // catch all exceptions catch (Exception& E) { - issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); - if (tmpl1 != NULL) // clean up - delete tmpl1; + issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); + if (tmpl1 != NULL) // clean up + delete tmpl1; } } // test_file_create() @@ -272,20 +273,20 @@ static void test_file_create() /*------------------------------------------------------------------------- * Function: test_file_open * - * Purpose: Test file accesses + * Purpose Test file accesses * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) + * Programmer Binh-Minh Ribler (use C version) * January, 2001 * * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hsize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * January, 2005: C tests' macro VERIFY casts values to 'long' for all + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hsize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. * *------------------------------------------------------------------------- */ @@ -296,53 +297,53 @@ static void test_file_open() try { - // Open first file - H5File file1 (FILE2, H5F_ACC_RDWR ); + // Open first file + H5File file1 (FILE2, H5F_ACC_RDWR ); - // Get the file-creation template - FileCreatPropList tmpl1 = file1.getCreatePlist(); + // Get the file-creation template + FileCreatPropList tmpl1 = file1.getCreatePlist(); - // Get the file-creation parameters - hsize_t ublock = tmpl1.getUserblock(); - verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); + // Get the file-creation parameters + hsize_t ublock = tmpl1.getUserblock(); + verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - size_t parm1, parm2; // file-creation parameters - tmpl1.getSizes( parm1, parm2); - verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + size_t parm1, parm2; // file-creation parameters + tmpl1.getSizes( parm1, parm2); + verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); unsigned iparm1,iparm2; // file-creation parameters tmpl1.getSymk( iparm1, iparm2); verify_val(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); verify_val(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - // Test H5File constructor with existing file id - H5File file2(file1.getId()); - file1.close(); + // Test H5File constructor with existing file id + H5File file2(file1.getId()); + file1.close(); - // Try truncating the file, and it should fail because the file is - // still opened with file2. - try { - H5File file3 (FILE2, H5F_ACC_TRUNC); // should throw E + // Try truncating the file, and it should fail because the file is + // still opened with file2. + try { + H5File file3 (FILE2, H5F_ACC_TRUNC); // should throw E - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "Attempt truncating an opened file."); - } - catch (FileIException& E) // catching H5F_ACC_TRUNC on opened file - {} // do nothing, FAIL expected + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "Attempt truncating an opened file."); + } + catch (FileIException& E) // catching H5F_ACC_TRUNC on opened file + {} // do nothing, FAIL expected - // Now, really close the file. - file2.close(); + // Now, really close the file. + file2.close(); - // Truncating should succeed now. - H5File file3(FILE2, H5F_ACC_TRUNC); + // Truncating should succeed now. + H5File file3(FILE2, H5F_ACC_TRUNC); - // Opening another file to file3 object, FILE2 should be closed, so - // the next attempt to truncate FILE2 should succeed. - file3.openFile(FILE1, H5F_ACC_RDONLY); - H5File file4(FILE2, H5F_ACC_TRUNC); + // Opening another file to file3 object, FILE2 should be closed, so + // the next attempt to truncate FILE2 should succeed. + file3.openFile(FILE1, H5F_ACC_RDONLY); + H5File file4(FILE2, H5F_ACC_TRUNC); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -355,11 +356,11 @@ static void test_file_open() /*------------------------------------------------------------------------- * Function: test_file_size * - * Purpose: Test file size. + * Purpose Test file size. * - * Return: None + * Return None * - * Programmer: Raymond Lu + * Programmer Raymond Lu * June, 2004 * * Modifications: @@ -371,7 +372,7 @@ static void test_file_size() // Output message about test being performed SUBTEST("File Size"); - hid_t fapl_id; + hid_t fapl_id; fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template try { @@ -379,13 +380,13 @@ static void test_file_size() // list object to pass in H5File::H5File FileAccPropList fapl(fapl_id); - // Set to sec2 driver. Do we want to test other file drivers? + // Set to sec2 driver. Do we want to test other file drivers? // They're not tested in C++. // File drivers seem not implemented. - // fapl.setSec2(); + // fapl.setSec2(); // Create a file - H5File file4( FILE4, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); + H5File file4( FILE4, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); // Get file size hsize_t file_size = file4.getFileSize(); @@ -394,14 +395,14 @@ static void test_file_size() if (file_size < 1*KB || file_size > 4*KB) issue_fail_msg("test_file_size()", __LINE__, __FILE__, "getFileSize() returned unreasonable value"); - // Get the amount of free space in the file - hssize_t free_space = file4.getFreeSpace(); + // Get the amount of free space in the file + hssize_t free_space = file4.getFreeSpace(); - // Check if it's reasonable. It's 0 now. - if (free_space < 0 || free_space > 4*KB) - issue_fail_msg("test_file_size()", __LINE__, __FILE__, "getFreeSpace returned unreasonable value"); + // Check if it's reasonable. It's 0 now. + if (free_space < 0 || free_space > 4*KB) + issue_fail_msg("test_file_size()", __LINE__, __FILE__, "getFreeSpace returned unreasonable value"); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -410,7 +411,9 @@ static void test_file_size() } // use C test utility routine to close property list. - H5Pclose(fapl_id); + herr_t ret = H5Pclose(fapl_id); + if (ret < 0) + issue_fail_msg("test_file_size()", __LINE__, __FILE__, "H5Pclose failed"); } // test_file_size() @@ -418,25 +421,25 @@ static void test_file_size() /*------------------------------------------------------------------------- * Function: test_file_name * - * Purpose: Test getting file's name. + * Purpose Test getting file's name. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler + * Programmer Binh-Minh Ribler * July, 2004 * * Modifications: * *------------------------------------------------------------------------- */ -const int RANK = 2; -const int NX = 4; -const int NY = 5; -const H5std_string GROUPNAME ("group"); -const H5std_string DSETNAME ("dataset"); -const H5std_string DATTRNAME ("dataset attribute"); -const H5std_string FATTRNAME ("file attribute"); -const H5std_string DTYPENAME ("compound"); +const int RANK = 2; +const int NX = 4; +const int NY = 5; +const H5std_string GROUPNAME ("group"); +const H5std_string DSETNAME ("dataset"); +const H5std_string DATTRNAME ("dataset attribute"); +const H5std_string FATTRNAME ("file attribute"); +const H5std_string DTYPENAME ("compound"); // Compound datatype typedef struct s1_t { @@ -452,68 +455,67 @@ static void test_file_name() H5std_string file_name; try { // Create a file using default properties. - H5File file4(FILE4, H5F_ACC_TRUNC); + H5File file4(FILE4, H5F_ACC_TRUNC); // Get file name from the file instance. file_name = file4.getFileName(); - verify_val(file_name, FILE4, "H5File::getFileName", __LINE__, __FILE__); + verify_val(file_name, FILE4, "H5File::getFileName", __LINE__, __FILE__); - // Create a group in the root group. - Group group(file4.createGroup(GROUPNAME, 0)); + // Create a group in the root group. + Group group(file4.createGroup(GROUPNAME, 0)); - // Get and verify file name via a group. - file_name = group.getFileName(); - verify_val(file_name, FILE4, "Group::getFileName", __LINE__, __FILE__); + // Get and verify file name via a group. + file_name = group.getFileName(); + verify_val(file_name, FILE4, "Group::getFileName", __LINE__, __FILE__); - // Create the data space. - hsize_t dims[RANK] = {NX, NY}; - DataSpace space(RANK, dims); + // Create the data space. + hsize_t dims[RANK] = {NX, NY}; + DataSpace space(RANK, dims); - // Create a new dataset. - DataSet dataset(file4.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); + // Create a new dataset. + DataSet dataset(file4.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); - // Get and verify file name via a dataset. - file_name = dataset.getFileName(); - verify_val(file_name, FILE4, "DataSet::getFileName", __LINE__, __FILE__); + // Get and verify file name via a dataset. + file_name = dataset.getFileName(); + verify_val(file_name, FILE4, "DataSet::getFileName", __LINE__, __FILE__); - // Create an attribute for the dataset. - Attribute attr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); + // Create an attribute for the dataset. + Attribute attr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); - // Get and verify file name via an attribute. - file_name = attr.getFileName(); - verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); + // Get and verify file name via an attribute. + file_name = attr.getFileName(); + verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); - // Create a compound datatype. - CompType comp_type (sizeof(s1_t)); + // Create a compound datatype. + CompType comp_type (sizeof(s1_t)); - // Insert fields. - comp_type.insertMember("a", HOFFSET(s1_t, a), PredType::NATIVE_INT); - comp_type.insertMember("b", HOFFSET(s1_t, b), PredType::NATIVE_FLOAT); + // Insert fields. + comp_type.insertMember("a", HOFFSET(s1_t, a), PredType::NATIVE_INT); + comp_type.insertMember("b", HOFFSET(s1_t, b), PredType::NATIVE_FLOAT); - // Save it on file. - comp_type.commit(file4, DTYPENAME); + // Save it on file. + comp_type.commit(file4, DTYPENAME); - // Get and verify file name via a committed datatype. - comp_type.getFileName(); - verify_val(file_name, FILE4, "CompType::getFileName", __LINE__, __FILE__); - PASSED(); + // Get and verify file name via a committed datatype. + comp_type.getFileName(); + verify_val(file_name, FILE4, "CompType::getFileName", __LINE__, __FILE__); + PASSED(); } // end of try block catch (Exception& E) { issue_fail_msg("test_file_name()", __LINE__, __FILE__, E.getCDetailMsg()); } - } // test_file_name() -const int RANK1 = 1; -const int ATTR1_DIM1 = 3; -const H5std_string FILE5("tfattrs.h5"); -const H5std_string FATTR1_NAME ("file attribute 1"); -const H5std_string FATTR2_NAME ("file attribute 2"); -int fattr_data[ATTR1_DIM1]={512,-234,98123}; /* Test data for file attribute */ -int dattr_data[ATTR1_DIM1]={256,-123,1000}; /* Test data for dataset attribute */ +const int RANK1 = 1; +const int ATTR1_DIM1 = 3; +const H5std_string FILE5("tfattrs.h5"); +const H5std_string FATTR1_NAME ("file attribute 1"); +const H5std_string FATTR2_NAME ("file attribute 2"); +int fattr_data[ATTR1_DIM1]={512,-234,98123}; // Test data for file attribute +int dattr_data[ATTR1_DIM1]={256,-123,1000}; // Test data for dataset attribute static void test_file_attribute() { @@ -526,89 +528,89 @@ static void test_file_attribute() H5std_string file_name; try { // Create a file using default properties. - H5File file5(FILE5, H5F_ACC_TRUNC); + H5File file5(FILE5, H5F_ACC_TRUNC); - // Create the data space - hsize_t dims[RANK1] = {ATTR1_DIM1}; - DataSpace space(RANK1, dims); + // Create the data space + hsize_t dims[RANK1] = {ATTR1_DIM1}; + DataSpace space(RANK1, dims); - // Create two attributes for the file - Attribute fattr1(file5.createAttribute(FATTR1_NAME, PredType::NATIVE_FLOAT, space)); - Attribute fattr2(file5.createAttribute(FATTR2_NAME, PredType::NATIVE_INT, space)); + // Create two attributes for the file + Attribute fattr1(file5.createAttribute(FATTR1_NAME, PredType::NATIVE_FLOAT, space)); + Attribute fattr2(file5.createAttribute(FATTR2_NAME, PredType::NATIVE_INT, space)); - fattr2.write(PredType::NATIVE_INT, fattr_data); + fattr2.write(PredType::NATIVE_INT, fattr_data); - try { - // Try to create the same attribute again (should fail) - Attribute fattr_dup(file5.createAttribute(FATTR2_NAME, PredType::NATIVE_INT, space)); - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File createAttribute", "Attempted to create an existing attribute."); - } - catch (AttributeIException& E) // catch creating existing attribute - {} // do nothing, FAIL expected + try { + // Try to create the same attribute again (should fail) + Attribute fattr_dup(file5.createAttribute(FATTR2_NAME, PredType::NATIVE_INT, space)); + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File createAttribute", "Attempted to create an existing attribute."); + } + catch (AttributeIException& E) // catch creating existing attribute + {} // do nothing, FAIL expected - // Create a new dataset - DataSet dataset(file5.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); + // Create a new dataset + DataSet dataset(file5.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); - // Create an attribute for the dataset - Attribute dattr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); + // Create an attribute for the dataset + Attribute dattr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); - // Write data to the second file attribute - dattr.write(PredType::NATIVE_INT, dattr_data); + // Write data to the second file attribute + dattr.write(PredType::NATIVE_INT, dattr_data); - // Test flushing out the data from the attribute object + // Test flushing out the data from the attribute object dattr.flush(H5F_SCOPE_GLOBAL); - // Get and verify the number of all objects in the file - // Current: 1 file, 2 file attr, 1 ds, and 1 ds attr. - ssize_t num_objs = file5.getObjCount(H5F_OBJ_ALL); - verify_val(num_objs, 5, "H5File::getObjCount", __LINE__, __FILE__); - - num_objs = file5.getObjCount(H5F_OBJ_GROUP); - verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_GROUP)", __LINE__, __FILE__); - num_objs = file5.getObjCount(H5F_OBJ_DATASET); - verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_DATASET)", __LINE__, __FILE__); - num_objs = file5.getObjCount(H5F_OBJ_ATTR); - verify_val(num_objs, 3, "H5File::getObjCount(H5F_OBJ_ATTR)", __LINE__, __FILE__); - num_objs = file5.getObjCount(H5F_OBJ_DATATYPE); - verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_DATATYPE)", __LINE__, __FILE__); - num_objs = file5.getObjCount(H5F_OBJ_FILE); - verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_FILE)", __LINE__, __FILE__); - - // Get the file name using the attributes - H5std_string fname = fattr1.getFileName(); - verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); - - fname.clear(); - fname = dattr.getFileName(); - verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); - - // Get the class of a file attribute's datatype - H5T_class_t atclass = fattr1.getTypeClass(); - verify_val(atclass, H5T_FLOAT, "Attribute::getTypeClass()", __LINE__, __FILE__); - - // Get and verify the number of attributes attached to a file - int n_attrs = file5.getNumAttrs(); - verify_val(n_attrs, 2, "H5File::getNumAttrs()", __LINE__, __FILE__); - - // Get and verify the number of attributes attached to a dataset - n_attrs = 0; - n_attrs = dataset.getNumAttrs(); - verify_val(n_attrs, 1, "DataSet::getNumAttrs()", __LINE__, __FILE__); - - // Read back attribute's data - HDmemset(rdata, 0, sizeof(rdata)); + // Get and verify the number of all objects in the file + // Current: 1 file, 2 file attr, 1 ds, and 1 ds attr. + ssize_t num_objs = file5.getObjCount(H5F_OBJ_ALL); + verify_val(num_objs, 5, "H5File::getObjCount", __LINE__, __FILE__); + + num_objs = file5.getObjCount(H5F_OBJ_GROUP); + verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_GROUP)", __LINE__, __FILE__); + num_objs = file5.getObjCount(H5F_OBJ_DATASET); + verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_DATASET)", __LINE__, __FILE__); + num_objs = file5.getObjCount(H5F_OBJ_ATTR); + verify_val(num_objs, 3, "H5File::getObjCount(H5F_OBJ_ATTR)", __LINE__, __FILE__); + num_objs = file5.getObjCount(H5F_OBJ_DATATYPE); + verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_DATATYPE)", __LINE__, __FILE__); + num_objs = file5.getObjCount(H5F_OBJ_FILE); + verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_FILE)", __LINE__, __FILE__); + + // Get the file name using the attributes + H5std_string fname = fattr1.getFileName(); + verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); + + fname.clear(); + fname = dattr.getFileName(); + verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); + + // Get the class of a file attribute's datatype + H5T_class_t atclass = fattr1.getTypeClass(); + verify_val(atclass, H5T_FLOAT, "Attribute::getTypeClass()", __LINE__, __FILE__); + + // Get and verify the number of attributes attached to a file + int n_attrs = file5.getNumAttrs(); + verify_val(n_attrs, 2, "H5File::getNumAttrs()", __LINE__, __FILE__); + + // Get and verify the number of attributes attached to a dataset + n_attrs = 0; + n_attrs = dataset.getNumAttrs(); + verify_val(n_attrs, 1, "DataSet::getNumAttrs()", __LINE__, __FILE__); + + // Read back attribute's data + HDmemset(rdata, 0, sizeof(rdata)); dattr.read(PredType::NATIVE_INT, rdata); /* Check results */ for (i = 0; i < ATTR1_DIM1; i++) { if (rdata[i] != dattr_data[i]) { H5_FAILED(); - cerr << endl; + cerr << endl; cerr << "element [" << i << "] is " << rdata[i] << - "but should have been " << dattr_data[i] << endl; + "but should have been " << dattr_data[i] << endl; } } - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -616,29 +618,30 @@ static void test_file_attribute() issue_fail_msg("test_file_attribute()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_file_attribute() + -const H5std_string FILE6("tfile5.h5"); -const H5std_string ROOTGROUP("/"); -const H5std_string GROUP1("/G1"); -const H5std_string SUBGROUP3("/G1/G3"); +const H5std_string FILE6("tfile5.h5"); +const H5std_string ROOTGROUP("/"); +const H5std_string GROUP1("/G1"); +const H5std_string SUBGROUP3("/G1/G3"); /*------------------------------------------------------------------------- - * Function: test_libver_bounds_real + * Function: test_libver_bounds_real * - * Purpose: Verify that a file created and modified with the - * specified libver bounds has the specified object header - * versions for the right objects. + * Purpose Verify that a file created and modified with the + * specified libver bounds has the specified object header + * versions for the right objects. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) - * March, 2015 + * Programmer Binh-Minh Ribler (use C version) + * March, 2015 * *------------------------------------------------------------------------- */ static void test_libver_bounds_real( - H5F_libver_t libver_create, unsigned oh_vers_create, - H5F_libver_t libver_mod, unsigned oh_vers_mod) + H5F_libver_t libver_create, unsigned oh_vers_create, + H5F_libver_t libver_mod, unsigned oh_vers_mod) { try { @@ -710,12 +713,12 @@ static void test_libver_bounds_real( * * Function: test_libver_bounds * - * Purpose: Verify that a file created and modified with various - * libver bounds is handled correctly. + * Purpose Verify that a file created and modified with various + * libver bounds is handled correctly. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) + * Programmer Binh-Minh Ribler (use C version) * March 2015 * *------------------------------------------------------------------------- @@ -732,16 +735,14 @@ static void test_libver_bounds() } /* end test_libver_bounds() */ /*------------------------------------------------------------------------- - * Function: test_commonfg + * Function: test_commonfg * - * Purpose: Verify that a file created and modified with the - * specified libver bounds has the specified object header - * versions for the right objects. + * Purpose Verify that H5File works as a root group. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) - * March, 2015 + * Programmer Binh-Minh Ribler (use C version) + * March, 2015 * *------------------------------------------------------------------------- */ @@ -752,40 +753,40 @@ static void test_commonfg() try { // Create a file using default properties. - H5File file4(FILE4, H5F_ACC_TRUNC); + H5File file4(FILE4, H5F_ACC_TRUNC); - // Try opening the root group. - Group rootgroup(file4.openGroup(ROOTGROUP)); + // Try opening the root group. + Group rootgroup(file4.openGroup(ROOTGROUP)); - // Create a group in the root group. - Group group(rootgroup.createGroup(GROUPNAME, 0)); + // Create a group in the root group. + Group group(rootgroup.createGroup(GROUPNAME, 0)); - // Create the data space. - hsize_t dims[RANK] = {NX, NY}; - DataSpace space(RANK, dims); + // Create the data space. + hsize_t dims[RANK] = {NX, NY}; + DataSpace space(RANK, dims); - // Create a new dataset. - DataSet dataset(group.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); + // Create a new dataset. + DataSet dataset(group.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); - // Get and verify file name via a dataset. - H5std_string file_name = dataset.getFileName(); - verify_val(file_name, FILE4, "DataSet::getFileName", __LINE__, __FILE__); + // Get and verify file name via a dataset. + H5std_string file_name = dataset.getFileName(); + verify_val(file_name, FILE4, "DataSet::getFileName", __LINE__, __FILE__); - // Create an attribute for the dataset. - Attribute attr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); + // Create an attribute for the dataset. + Attribute attr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); - // Get and verify file name via an attribute. - file_name = attr.getFileName(); - verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); + // Get and verify file name via an attribute. + file_name = attr.getFileName(); + verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); - // Create an attribute for the file via root group. - Attribute rootg_attr(rootgroup.createAttribute(FATTRNAME, PredType::NATIVE_INT, space)); + // Create an attribute for the file via root group. + Attribute rootg_attr(rootgroup.createAttribute(FATTRNAME, PredType::NATIVE_INT, space)); - // Get and verify file name via an attribute. - file_name = attr.getFileName(); - verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); + // Get and verify file name via an attribute. + file_name = attr.getFileName(); + verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -795,14 +796,133 @@ static void test_commonfg() } /* end test_commonfg() */ +const H5std_string FILE7("tfile7.h5"); + +/*------------------------------------------------------------------------- + * Function: test_file_info + * + * Purpose Verify that various properties in a file creation property + * lists are stored correctly in the file and can be retrieved + * when the file is re-opened. + * + * Return None + * + * Programmer Binh-Minh Ribler + * February, 2017 + * + *------------------------------------------------------------------------- + */ +static void test_file_info() +{ + // Output message about test being performed + SUBTEST("File general information"); + + hsize_t in_threshold = 2; // Free space section threshold to set */ + hsize_t out_threshold = 0; // Free space section threshold to get */ + // File space handling strategy + H5F_file_space_type_t in_strategy = H5F_FILE_SPACE_ALL; + // File space handling strategy + H5F_file_space_type_t out_strategy = H5F_FILE_SPACE_DEFAULT; + + try { + // Create a file using default properties. + H5File tempfile(FILE7, H5F_ACC_TRUNC); + + // Get the file's version information. + H5F_info2_t finfo; + tempfile.getFileInfo(finfo); + verify_val(finfo.super.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); + verify_val(finfo.free.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); + verify_val(finfo.sohm.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); + + // Close the file. + tempfile.close(); + + // Create file creation property list. + FileCreatPropList fcpl; + + // Set various file information. + fcpl.setUserblock(F2_USERBLOCK_SIZE); + fcpl.setSizes(F2_OFFSET_SIZE, F2_LENGTH_SIZE); + fcpl.setSymk(F2_SYM_INTERN_K, F2_SYM_LEAF_K); + fcpl.setIstorek(F2_ISTORE); + fcpl.setFileSpace(in_strategy, in_threshold); + + // Creating a file with the non-default file creation property list + // should create a version 1 superblock + + // Create file with custom file creation property list. + H5File file7(FILE7, H5F_ACC_TRUNC, fcpl); + + // Close the file creation property list. + fcpl.close(); + + // Get the file's version information. + file7.getFileInfo(finfo); + verify_val(finfo.super.version, 2, "H5File::getFileInfo", __LINE__, __FILE__); + verify_val(finfo.free.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); + verify_val(finfo.sohm.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); + + // Close the file. + file7.close(); + + // Re-open the file. + file7.openFile(FILE7, H5F_ACC_RDONLY); + + // Get the file's creation property list. + FileCreatPropList fcpl2 = file7.getCreatePlist(); + + // Get the file's version information. + file7.getFileInfo(finfo); + verify_val(finfo.super.version, 2, "H5File::getFileInfo", __LINE__, __FILE__); + verify_val(finfo.free.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); + verify_val(finfo.sohm.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); + + // Retrieve the property values & check them. + hsize_t userblock = fcpl2.getUserblock(); + verify_val(userblock, F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); + + size_t off_size = 0, len_size = 0; + fcpl2.getSizes(off_size, len_size); + verify_val(off_size, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + verify_val(len_size, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + + unsigned sym_ik = 0, sym_lk = 0; + fcpl2.getSymk(sym_ik, sym_lk); + verify_val(sym_ik, F2_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); + verify_val(sym_lk, F2_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); + + unsigned istore_ik = fcpl2.getIstorek(); + verify_val(istore_ik, F2_ISTORE, "FileCreatPropList::getIstorek", __LINE__, __FILE__); + + /* ret=H5Pget_shared_mesg_nindexes(fcpl2,&nindexes); + CHECK(ret, FAIL, "H5Pget_shared_mesg_nindexes"); + VERIFY(nindexes, MISC11_NINDEXES, "H5Pget_shared_mesg_nindexes"); + */ + + // Get and verify the file space info from the creation property list */ + out_strategy = fcpl2.getFileSpaceStrategy(); + verify_val(static_cast(out_strategy), static_cast(in_strategy), "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__); + + out_threshold = fcpl2.getFileSpaceThreshold(); + verify_val(static_cast(out_threshold), static_cast(in_threshold), "FileCreatPropList::getFileSpaceThreshold", __LINE__, __FILE__); + + PASSED(); + } // end of try block + catch (Exception& E) + { + issue_fail_msg("test_filespace_info()", __LINE__, __FILE__, E.getCDetailMsg()); + } +} /* test_file_info() */ + /*------------------------------------------------------------------------- * Function: test_file * - * Purpose: Main file testing routine + * Purpose Main file testing routine * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) + * Programmer Binh-Minh Ribler (use C version) * January 2001 * * Modifications: @@ -815,24 +935,25 @@ void test_file() // Output message about test being performed MESSAGE(5, ("Testing File I/O Operations\n")); - test_file_create(); // Test file creation (also creation templates) - test_file_open(); // Test file opening - test_file_size(); // Test file size - test_file_name(); // Test getting file's name - test_file_attribute(); // Test file attribute feature - test_libver_bounds(); // Test format version - test_commonfg(); + test_file_create(); // Test file creation (also creation templates) + test_file_open(); // Test file opening + test_file_size(); // Test file size + test_file_name(); // Test getting file's name + test_file_attribute(); // Test file attribute feature + test_libver_bounds(); // Test format version + test_commonfg(); // Test H5File as a root group + test_file_info(); // Test various file info } // test_file() /*------------------------------------------------------------------------- - * Function: cleanup_file + * Function: cleanup_file * - * Purpose: Cleanup temporary test files + * Purpose Cleanup temporary test files * - * Return: none + * Return none * - * Programmer: (use C version) + * Programmer (use C version) * * Modifications: * @@ -846,7 +967,8 @@ void cleanup_file() HDremove(FILE1.c_str()); HDremove(FILE2.c_str()); HDremove(FILE3.c_str()); -// HDremove(FILE4.c_str()); + HDremove(FILE4.c_str()); HDremove(FILE5.c_str()); HDremove(FILE6.c_str()); + HDremove(FILE7.c_str()); } // cleanup_file diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index ee78fe1..19f5b5a 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -33,15 +33,15 @@ using namespace H5; #include "h5test.h" #include "h5cpputil.h" // C++ utilility header file -#define DSET_DIM1 100 -#define DSET_DIM2 200 +#define DSET_DIM1 100 +#define DSET_DIM2 200 #define FILTER_CHUNK_DIM1 2 #define FILTER_CHUNK_DIM2 25 // will do this function later or use it as guideline - BMR - 2007/01/26 #if 0 static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl, - int if_fletcher32, int corrupted, hsize_t *dset_size) + int if_fletcher32, int corrupted, hsize_t *dset_size) { cerr << "do nothing right now" << endl; return(0); @@ -58,25 +58,25 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, static size_t filter_bogus(size_t nbytes); /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "bogus", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_BOGUS, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "bogus", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ (H5Z_func_t)filter_bogus, /* The actual filter function */ }}; /*------------------------------------------------------------------------- * Function: filter_bogus * - * Purpose: A bogus compression method that doesn't do anything. + * Purpose A bogus compression method that doesn't do anything. * - * Return: Success: Data chunk size + * Return Success: Data chunk size * - * Failure: 0 + * Failure: 0 * - * Programmer: Robb Matzke + * Programmer Robb Matzke * Tuesday, April 21, 1998 * * Modifications: @@ -95,17 +95,17 @@ filter_bogus(size_t nbytes) } /*------------------------------------------------------------------------- - * Function: test_null_filter + * Function: test_null_filter * - * Purpose: Test null I/O filter by itself. + * Purpose Test null I/O filter by itself. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version, from dsets.c/test_filters) - * January, 2007 + * Programmer Binh-Minh Ribler (use C version, from dsets.c/test_filters) + * January, 2007 * * Modifications: - * Note: H5Z interface is not implemented yet. + * Note: H5Z interface is not implemented yet. * *------------------------------------------------------------------------- */ @@ -118,25 +118,25 @@ static void test_null_filter() // Output message about test being performed SUBTEST("'Null' filter"); try { - //hsize_t null_size; // Size of dataset with null filter + //hsize_t null_size; // Size of dataset with null filter - // Prepare dataset create property list - DSetCreatPropList dsplist; - dsplist.setChunk(2, chunk_size); + // Prepare dataset create property list + DSetCreatPropList dsplist; + dsplist.setChunk(2, chunk_size); - if (H5Zregister (H5Z_BOGUS)<0) + if (H5Zregister (H5Z_BOGUS)<0) throw Exception("test_null_filter", "H5Zregister failed"); - // Set some pretent filter - dsplist.setFilter(H5Z_FILTER_BOGUS); + // Set some pretent filter + dsplist.setFilter(H5Z_FILTER_BOGUS); - // this function is just a stub right now; will work on it later - BMR - //if(test_filter_internal(file,DSET_BOGUS_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&null_size)<0) + // this function is just a stub right now; will work on it later - BMR + //if(test_filter_internal(file,DSET_BOGUS_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&null_size)<0) // throw Exception("test_null_filter", "test_filter_internal failed"); - // Close objects. - dsplist.close(); - PASSED(); + // Close objects. + dsplist.close(); + PASSED(); } // end of try // catch all other exceptions @@ -147,17 +147,17 @@ static void test_null_filter() } // test_null_filter /*------------------------------------------------------------------------- - * Function: test_szip_filter + * Function: test_szip_filter * - * Purpose: Test SZIP filter by itself. + * Purpose Test SZIP filter by itself. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (partly from dsets.c/test_filters) - * January, 2007 + * Programmer Binh-Minh Ribler (partly from dsets.c/test_filters) + * January, 2007 * * Modifications: - * Note: H5Z interface is not implemented yet. + * Note: H5Z interface is not implemented yet. * *------------------------------------------------------------------------- */ @@ -232,7 +232,7 @@ static void test_szip_filter(H5File& file1) delete[] tconv_buf; } // if szip presents else { - SKIPPED(); + SKIPPED(); } #else /* H5_HAVE_FILTER_SZIP */ @@ -266,9 +266,9 @@ void test_filters() H5File file1(FILE1, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); - // Test basic VL string datatype - test_null_filter(); - test_szip_filter(file1); + // Test basic VL string datatype + test_null_filter(); + test_szip_filter(file1); } catch (Exception& E) { @@ -277,13 +277,13 @@ void test_filters() } // test_filters() /*------------------------------------------------------------------------- - * Function: cleanup_filters + * Function: cleanup_filters * - * Purpose: Cleanup temporary test files + * Purpose Cleanup temporary test files * - * Return: none + * Return none * - * Programmer: Quincey Koziol + * Programmer Quincey Koziol * September 10, 1999 * * Modifications: diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index c795c08..a3aafb3 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -35,7 +35,7 @@ using namespace H5; #include "h5test.h" #include "h5cpputil.h" // C++ utilility header file -#include "H5srcdir.h" // srcdir querying header file +#include "H5srcdir.h" // srcdir querying header file const H5std_string TESTFILE("th5s.h5"); const H5std_string DATAFILE("th5s1.h5"); @@ -86,124 +86,123 @@ int space5_data = 7; /*------------------------------------------------------------------------- * - * Function: test_h5s_basic + * Function: test_h5s_basic * - * Purpose: Test basic H5S (dataspace) code + * Purpose Test basic H5S (dataspace) code * - * Return: none + * Return none * - * Programmer: Binh-Minh Ribler (using C version) + * Programmer Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. * April 12, 2011: Raymond Lu - * Starting from the 1.8.7 release, we allow dimension - * size to be zero. So I took out the test against it. + * Starting from the 1.8.7 release, we allow dimension + * size to be zero. So I took out the test against it. *------------------------------------------------------------------------- */ static void test_h5s_basic() { - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3, - SPACE2_DIM4}; - hsize_t dims3[H5S_MAX_RANK+1]; - hsize_t tmax[4]; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3, SPACE2_DIM4}; + hsize_t dims3[H5S_MAX_RANK+1]; + hsize_t tmax[4]; // Output message about test being performed SUBTEST("Dataspace Manipulation"); try { - // Create simple dataspace sid1 - DataSpace sid1 (SPACE1_RANK, dims1 ); - - // Get simple extent npoints of the dataspace sid1 and verify it - hssize_t n; // Number of dataspace elements - n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, (long)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3), - "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - - // Get the logical rank of dataspace sid1 and verify it - int rank; // Logical rank of dataspace - rank = sid1.getSimpleExtentNdims(); - verify_val(rank, SPACE1_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - - // Retrieves dimension size of dataspace sid1 and verify it - int ndims; // Number of dimensions - hsize_t tdims[4]; // Dimension array to test with - ndims = sid1.getSimpleExtentDims( tdims ); - verify_val(ndims, SPACE1_RANK, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - verify_val(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(unsigned)), 0, - "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - - // Create simple dataspace sid2 - hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, SPACE2_MAX4}; - DataSpace sid2 (SPACE2_RANK, dims2, max2); - - // Get simple extent npoints of dataspace sid2 and verify it - n = sid2.getSimpleExtentNpoints(); - verify_val((long)n, (long)(SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4), - "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - - // Get the logical rank of dataspace sid2 and verify it - rank = sid2.getSimpleExtentNdims(); - verify_val(rank, SPACE2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - - // Retrieves dimension size and max size of dataspace sid2 and - // verify them - ndims = sid2.getSimpleExtentDims( tdims, tmax ); - verify_val(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0, - "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - verify_val(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(unsigned)), 0, - "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - - // Check to be sure we can't create a simple data space that has too - // many dimensions. - try { - DataSpace manydims_ds(H5S_MAX_RANK+1, dims3, NULL); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("DataSpace constructor", "Library allowed overwrite of existing dataset"); - } - catch (DataSpaceIException& E) // Simple data space with too many dims - {} // do nothing, exception expected + // Create simple dataspace sid1 + DataSpace sid1 (SPACE1_RANK, dims1 ); + + // Get simple extent npoints of the dataspace sid1 and verify it + hssize_t n; // Number of dataspace elements + n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, (long)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3), + "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + + // Get the logical rank of dataspace sid1 and verify it + int rank; // Logical rank of dataspace + rank = sid1.getSimpleExtentNdims(); + verify_val(rank, SPACE1_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + + // Retrieves dimension size of dataspace sid1 and verify it + int ndims; // Number of dimensions + hsize_t tdims[4]; // Dimension array to test with + ndims = sid1.getSimpleExtentDims( tdims ); + verify_val(ndims, SPACE1_RANK, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + verify_val(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(unsigned)), 0, + "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + + // Create simple dataspace sid2 + hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, SPACE2_MAX4}; + DataSpace sid2 (SPACE2_RANK, dims2, max2); + + // Get simple extent npoints of dataspace sid2 and verify it + n = sid2.getSimpleExtentNpoints(); + verify_val((long)n, (long)(SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4), + "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + + // Get the logical rank of dataspace sid2 and verify it + rank = sid2.getSimpleExtentNdims(); + verify_val(rank, SPACE2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + + // Retrieves dimension size and max size of dataspace sid2 and + // verify them + ndims = sid2.getSimpleExtentDims( tdims, tmax ); + verify_val(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0, + "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + verify_val(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(unsigned)), 0, + "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + + // Check to be sure we can't create a simple data space that has too + // many dimensions. + try { + DataSpace manydims_ds(H5S_MAX_RANK+1, dims3, NULL); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("DataSpace constructor", "Library allowed overwrite of existing dataset"); + } + catch (DataSpaceIException& E) // Simple data space with too many dims + {} // do nothing, exception expected /* - * Try reading a file that has been prepared that has a dataset with a - * higher dimensionality than what the library can handle. - * - * If this test fails and the H5S_MAX_RANK variable has changed, follow - * the instructions in space_overflow.c for regenating the th5s.h5 file. - */ - char *tmp_str = new char[TESTFILE.length()+1]; - strcpy(tmp_str, TESTFILE.c_str()); - const char *testfile = H5_get_srcdir_filename(tmp_str); - delete []tmp_str; - - // Create file - H5File fid1(testfile, H5F_ACC_RDONLY); - - // Try to open the dataset that has higher dimensionality than - // what the library can handle and this operation should fail. - try { - DataSet dset1 = fid1.openDataSet( "dset" ); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File::openDataSet", "Opening a dataset with higher dimensionality than what the library can handle"); - } - catch (FileIException& E) // catching higher dimensionality dataset - {} // do nothing, exception expected + * Try reading a file that has been prepared that has a dataset with a + * higher dimensionality than what the library can handle. + * + * If this test fails and the H5S_MAX_RANK variable has changed, follow + * the instructions in space_overflow.c for regenating the th5s.h5 file. + */ + char *tmp_str = new char[TESTFILE.length()+1]; + strcpy(tmp_str, TESTFILE.c_str()); + const char *testfile = H5_get_srcdir_filename(tmp_str); + delete []tmp_str; + + // Create file + H5File fid1(testfile, H5F_ACC_RDONLY); + + // Try to open the dataset that has higher dimensionality than + // what the library can handle and this operation should fail. + try { + DataSet dset1 = fid1.openDataSet( "dset" ); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File::openDataSet", "Opening a dataset with higher dimensionality than what the library can handle"); + } + catch (FileIException& E) // catching higher dimensionality dataset + {} // do nothing, exception expected // CHECK_I(ret, "H5Fclose"); // leave this here, later, fake a failure - // in the p_close see how this will handle it. - BMR + // in the p_close see how this will handle it. - BMR - PASSED(); - } // end of try block + PASSED(); + } // end of try block catch (InvalidActionException& E) { @@ -219,22 +218,22 @@ static void test_h5s_basic() /*------------------------------------------------------------------------- * - * Function: test_h5s_scalar_write + * Function: test_h5s_scalar_write * - * Purpose: Test scalar H5S (dataspace) writing code + * Purpose Test scalar H5S (dataspace) writing code * - * Return: none + * Return none * - * Programmer: Binh-Minh Ribler (using C version) + * Programmer Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_scalar_write() @@ -243,124 +242,124 @@ static void test_h5s_scalar_write() SUBTEST("Scalar Dataspace Writing"); try { - // Create file - H5File fid1(DATAFILE, H5F_ACC_TRUNC); + // Create file + H5File fid1(DATAFILE, H5F_ACC_TRUNC); - // Create scalar dataspace - DataSpace sid1(SPACE3_RANK, NULL); + // Create scalar dataspace + DataSpace sid1(SPACE3_RANK, NULL); - //n = H5Sget_simple_extent_npoints(sid1); - hssize_t n; // Number of dataspace elements - n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + //n = H5Sget_simple_extent_npoints(sid1); + hssize_t n; // Number of dataspace elements + n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - int rank; // Logical rank of dataspace - rank = sid1.getSimpleExtentNdims(); - verify_val(rank, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + int rank; // Logical rank of dataspace + rank = sid1.getSimpleExtentNdims(); + verify_val(rank, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - // Retrieves dimension size of dataspace sid1 and verify it - int ndims; // Number of dimensions - hsize_t tdims[4]; // Dimension array to test with - ndims = sid1.getSimpleExtentDims( tdims ); - verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + // Retrieves dimension size of dataspace sid1 and verify it + int ndims; // Number of dimensions + hsize_t tdims[4]; // Dimension array to test with + ndims = sid1.getSimpleExtentDims( tdims ); + verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - // Verify extent type - H5S_class_t ext_type; // Extent type - ext_type = sid1.getSimpleExtentType(); - verify_val(ext_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__); + // Verify extent type + H5S_class_t ext_type; // Extent type + ext_type = sid1.getSimpleExtentType(); + verify_val(ext_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__); - // Create and write a dataset - DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); - dataset.write(&space3_data, PredType::NATIVE_UINT); + // Create and write a dataset + DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); + dataset.write(&space3_data, PredType::NATIVE_UINT); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_h5s_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_h5s_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_scalar_write() /*------------------------------------------------------------------------- * - * Function: test_h5s_scalar_read + * Function: test_h5s_scalar_read * - * Purpose: Test scalar H5S (dataspace) reading code + * Purpose Test scalar H5S (dataspace) reading code * - * Return: none + * Return none * - * Programmer: Binh-Minh Ribler (using C version) + * Programmer Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_scalar_read() { - hsize_t tdims[4]; // Dimension array to test with + hsize_t tdims[4]; // Dimension array to test with // Output message about test being performed SUBTEST("Scalar Dataspace Reading"); try { - // Open file - H5File fid1(DATAFILE, H5F_ACC_RDWR); + // Open file + H5File fid1(DATAFILE, H5F_ACC_RDWR); - // Create a dataset - DataSet dataset = fid1.openDataSet("Dataset1"); + // Create a dataset + DataSet dataset = fid1.openDataSet("Dataset1"); - DataSpace sid1 = dataset.getSpace(); + DataSpace sid1 = dataset.getSpace(); - // Get the number of dataspace elements - hssize_t n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + // Get the number of dataspace elements + hssize_t n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - // Get the logical rank of the dataspace - int ndims = sid1.getSimpleExtentNdims(); - verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + // Get the logical rank of the dataspace + int ndims = sid1.getSimpleExtentNdims(); + verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - ndims = sid1.getSimpleExtentDims(tdims); - verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + ndims = sid1.getSimpleExtentDims(tdims); + verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - // Read data back and verify it - unsigned rdata; // Scalar data read in - dataset.read(&rdata, PredType::NATIVE_UINT); - verify_val(rdata, space3_data, "DataSet::read", __LINE__, __FILE__); + // Read data back and verify it + unsigned rdata; // Scalar data read in + dataset.read(&rdata, PredType::NATIVE_UINT); + verify_val(rdata, space3_data, "DataSet::read", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) { - // all the exceptions caused by negative returned values by C APIs - issue_fail_msg("test_h5s_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); + // all the exceptions caused by negative returned values by C APIs + issue_fail_msg("test_h5s_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_scalar_read() /*------------------------------------------------------------------------- * - * Function: test_h5s_null + * Function: test_h5s_null * - * Purpose: Test null H5S (dataspace) code + * Purpose Test null H5S (dataspace) code * - * Return: none + * Return none * - * Programmer: Raymond Lu (using C version) + * Programmer Raymond Lu (using C version) * May 18, 2004 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_null() @@ -369,53 +368,53 @@ static void test_h5s_null() SUBTEST("Null Dataspace Writing"); try { - // Create file - H5File fid1(DATAFILE, H5F_ACC_TRUNC); + // Create file + H5File fid1(DATAFILE, H5F_ACC_TRUNC); - // Create scalar dataspace - DataSpace sid1(H5S_NULL); + // Create scalar dataspace + DataSpace sid1(H5S_NULL); - hssize_t n; // Number of dataspace elements - n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 0, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + hssize_t n; // Number of dataspace elements + n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 0, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - // Create a dataset - DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); + // Create a dataset + DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); // Try to write nothing to the dataset - dataset.write(&space5_data, PredType::NATIVE_INT); + dataset.write(&space5_data, PredType::NATIVE_INT); // Read the data. Make sure no change to the buffer - dataset.read(&space5_data, PredType::NATIVE_INT); - verify_val(space5_data, 7, "DataSet::read", __LINE__, __FILE__); + dataset.read(&space5_data, PredType::NATIVE_INT); + verify_val(space5_data, 7, "DataSet::read", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_h5s_null()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_h5s_null()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_null() /*------------------------------------------------------------------------- * - * Function: test_h5s_compound_scalar_write + * Function: test_h5s_compound_scalar_write * - * Purpose: Test scalar H5S (dataspace) writing for compound - * datatypes + * Purpose Test scalar H5S (dataspace) writing for compound + * datatypes * - * Return: none + * Return none * - * Programmer: Binh-Minh Ribler (using C version) + * Programmer Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_compound_scalar_write() @@ -424,135 +423,135 @@ static void test_h5s_compound_scalar_write() SUBTEST("Compound Dataspace Writing"); try { - // Create file - H5File fid1(DATAFILE, H5F_ACC_TRUNC); - - // Create the compound datatype. - CompType tid1(sizeof(struct space4_struct)); - space4_field1_off=HOFFSET(struct space4_struct, c1); - tid1.insertMember(SPACE4_FIELDNAME1, space4_field1_off, - PredType::NATIVE_SCHAR); - space4_field2_off=HOFFSET(struct space4_struct, u); - tid1.insertMember(SPACE4_FIELDNAME2, space4_field2_off, - PredType::NATIVE_UINT); - space4_field3_off=HOFFSET(struct space4_struct, f); - tid1.insertMember(SPACE4_FIELDNAME3, space4_field3_off, - PredType::NATIVE_FLOAT); - space4_field4_off=HOFFSET(struct space4_struct, c2); - tid1.insertMember(SPACE4_FIELDNAME4, space4_field4_off, - PredType::NATIVE_SCHAR); - - // Create scalar dataspace - DataSpace sid1(SPACE3_RANK, NULL); - - // Get the number of dataspace elements - hssize_t n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - - // Get the logical rank of the dataspace - int ndims = sid1.getSimpleExtentNdims(); - verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - - hsize_t tdims[4]; // Dimension array to test with - ndims = sid1.getSimpleExtentDims(tdims); - verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - - // Create and write a dataset - DataSet dataset = fid1.createDataSet("Dataset1", tid1, sid1); - dataset.write(&space4_data, tid1); - - PASSED(); - } // end of try block + // Create file + H5File fid1(DATAFILE, H5F_ACC_TRUNC); + + // Create the compound datatype. + CompType tid1(sizeof(struct space4_struct)); + space4_field1_off=HOFFSET(struct space4_struct, c1); + tid1.insertMember(SPACE4_FIELDNAME1, space4_field1_off, + PredType::NATIVE_SCHAR); + space4_field2_off=HOFFSET(struct space4_struct, u); + tid1.insertMember(SPACE4_FIELDNAME2, space4_field2_off, + PredType::NATIVE_UINT); + space4_field3_off=HOFFSET(struct space4_struct, f); + tid1.insertMember(SPACE4_FIELDNAME3, space4_field3_off, + PredType::NATIVE_FLOAT); + space4_field4_off=HOFFSET(struct space4_struct, c2); + tid1.insertMember(SPACE4_FIELDNAME4, space4_field4_off, + PredType::NATIVE_SCHAR); + + // Create scalar dataspace + DataSpace sid1(SPACE3_RANK, NULL); + + // Get the number of dataspace elements + hssize_t n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + + // Get the logical rank of the dataspace + int ndims = sid1.getSimpleExtentNdims(); + verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + + hsize_t tdims[4]; // Dimension array to test with + ndims = sid1.getSimpleExtentDims(tdims); + verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + + // Create and write a dataset + DataSet dataset = fid1.createDataSet("Dataset1", tid1, sid1); + dataset.write(&space4_data, tid1); + + PASSED(); + } // end of try block catch (Exception& E) { - // all the exceptions caused by negative returned values by C APIs - issue_fail_msg("test_h5s_compound_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg()); + // all the exceptions caused by negative returned values by C APIs + issue_fail_msg("test_h5s_compound_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_compound_scalar_write() /*------------------------------------------------------------------------- * - * Function: test_h5s_compound_scalar_read + * Function: test_h5s_compound_scalar_read * - * Purpose: Test scalar H5S (dataspace) reading for compound - * datatypes + * Purpose Test scalar H5S (dataspace) reading for compound + * datatypes * - * Return: none + * Return none * - * Programmer: Binh-Minh Ribler (using C version) + * Programmer Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_compound_scalar_read() { - hsize_t tdims[4]; // Dimension array to test with + hsize_t tdims[4]; // Dimension array to test with // Output message about test being performed SUBTEST("Compound Dataspace Reading"); try { - // Open file - H5File fid1(DATAFILE, H5F_ACC_RDWR); + // Open file + H5File fid1(DATAFILE, H5F_ACC_RDWR); - // Create a dataset - DataSet dataset = fid1.openDataSet("Dataset1"); + // Create a dataset + DataSet dataset = fid1.openDataSet("Dataset1"); - DataSpace sid1 = dataset.getSpace(); + DataSpace sid1 = dataset.getSpace(); - // Get the number of dataspace elements - hssize_t n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + // Get the number of dataspace elements + hssize_t n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - // Get the logical rank of the dataspace - int ndims = sid1.getSimpleExtentNdims(); - verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + // Get the logical rank of the dataspace + int ndims = sid1.getSimpleExtentNdims(); + verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - ndims = sid1.getSimpleExtentDims(tdims); - verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + ndims = sid1.getSimpleExtentDims(tdims); + verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - // Get the datatype of this dataset. - CompType type(dataset); + // Get the datatype of this dataset. + CompType type(dataset); - struct space4_struct rdata; // Scalar data read in - dataset.read(&rdata, type); + struct space4_struct rdata; // Scalar data read in + dataset.read(&rdata, type); - // Verify read data - if(HDmemcmp(&space4_data,&rdata,sizeof(struct space4_struct))) - { + // Verify read data + if(HDmemcmp(&space4_data,&rdata,sizeof(struct space4_struct))) + { cerr << "scalar data different: space4_data.c1=" - << space4_data.c1 << ", read_data4.c1=" << rdata.c1 << endl; + << space4_data.c1 << ", read_data4.c1=" << rdata.c1 << endl; cerr << "scalar data different: space4_data.u=" - << space4_data.u << ", read_data4.u=" << rdata.u << endl; + << space4_data.u << ", read_data4.u=" << rdata.u << endl; cerr << "scalar data different: space4_data.f=" - << space4_data.f << ", read_data4.f=" << rdata.f << endl; + << space4_data.f << ", read_data4.f=" << rdata.f << endl; TestErrPrintf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n", - space4_data.c1, rdata.c2); - } // end if - PASSED(); + space4_data.c1, rdata.c2); + } // end if + PASSED(); } // end of try block catch (Exception& E) { - // all the exceptions caused by negative returned values by C APIs - issue_fail_msg("test_h5s_compound_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); + // all the exceptions caused by negative returned values by C APIs + issue_fail_msg("test_h5s_compound_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_compound_scalar_read() /*------------------------------------------------------------------------- * - * Function: test_h5s + * Function: test_h5s * - * Purpose: Main dataspace testing routine + * Purpose Main dataspace testing routine * - * Return: none + * Return none * - * Programmer: Binh-Minh Ribler (using C version) + * Programmer Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: @@ -564,23 +563,23 @@ void test_h5s() // Output message about test being performed MESSAGE(5, ("Testing Dataspaces\n")); - test_h5s_basic(); // Test basic H5S code - test_h5s_scalar_write(); // Test scalar H5S writing code - test_h5s_scalar_read(); // Test scalar H5S reading code - test_h5s_null(); // Test null H5S code - test_h5s_compound_scalar_write(); // Test compound datatype scalar H5S writing code - test_h5s_compound_scalar_read(); // Test compound datatype scalar H5S reading code + test_h5s_basic(); // Test basic H5S code + test_h5s_scalar_write(); // Test scalar H5S writing code + test_h5s_scalar_read(); // Test scalar H5S reading code + test_h5s_null(); // Test null H5S code + test_h5s_compound_scalar_write(); // Test compound datatype scalar H5S writing code + test_h5s_compound_scalar_read(); // Test compound datatype scalar H5S reading code } // test_h5s() /*------------------------------------------------------------------------- - * Function: cleanup_h5s + * Function: cleanup_h5s * - * Purpose: Cleanup temporary test files + * Purpose Cleanup temporary test files * - * Return: none + * Return none * - * Programmer: Albert Cheng + * Programmer Albert Cheng * July 2, 1998 * * Modifications: diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index 7ee2b53..fce42fa 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -49,20 +49,20 @@ using namespace H5; //#define SPACE1_RANK 1 //#define SPACE1_DIM1 4 -const H5std_string FILE_ITERATE("titerate.h5"); -const H5std_string GROUP1("Top Group"); -const H5std_string GROUP1_PATH("/Top Group"); -const H5std_string GROUP1_1("Sub-Group 1.1"); -const H5std_string GROUP1_1_PATH("/Top Group/Sub-Group 1.1"); -const H5std_string GROUP1_2("Sub-Group 1.2"); -const H5std_string GROUP1_2_PATH("/Top Group/Sub-Group 1.2"); -const H5std_string DSET_DEFAULT_NAME("default"); -const H5std_string DSET_IN_FILE("Dataset in File"); -const H5std_string DSET_IN_FILE_PATH("/Dataset in File"); -const H5std_string DSET_IN_GRP1("Dataset in Group 1"); -const H5std_string DSET_IN_GRP1_PATH("/Top Group/Dataset in Group 1"); -const H5std_string DSET_IN_GRP1_2("Dataset in Group 1.2"); -const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset in Group 1.2"); +const H5std_string FILE_ITERATE("titerate.h5"); +const H5std_string GROUP1("Top Group"); +const H5std_string GROUP1_PATH("/Top Group"); +const H5std_string GROUP1_1("Sub-Group 1.1"); +const H5std_string GROUP1_1_PATH("/Top Group/Sub-Group 1.1"); +const H5std_string GROUP1_2("Sub-Group 1.2"); +const H5std_string GROUP1_2_PATH("/Top Group/Sub-Group 1.2"); +const H5std_string DSET_DEFAULT_NAME("default"); +const H5std_string DSET_IN_FILE("Dataset in File"); +const H5std_string DSET_IN_FILE_PATH("/Dataset in File"); +const H5std_string DSET_IN_GRP1("Dataset in Group 1"); +const H5std_string DSET_IN_GRP1_PATH("/Top Group/Dataset in Group 1"); +const H5std_string DSET_IN_GRP1_2("Dataset in Group 1.2"); +const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset in Group 1.2"); typedef enum { RET_ZERO, @@ -127,15 +127,15 @@ liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_ } /* end liter_cb() */ /*------------------------------------------------------------------------- - * Function: test_iter_group + * Function: test_iter_group * - * Purpose: Tests group iteration + * Purpose Tests group iteration * - * Return: Success: 0 - * Failure: -1 + * Return Success: 0 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * Friday, September 9, 2016 + * Programmer Binh-Minh Ribler + * Friday, September 9, 2016 * * Modifications: * @@ -148,142 +148,142 @@ static void test_iter_group(FileAccPropList& fapl) char name[NAMELEN]; /* temporary name buffer */ char *lnames[NDATASETS + 2];/* Names of the links created */ iter_info info; /* Custom iteration information */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ SUBTEST("Group Iteration"); /* Create the test file with the datasets */ try { - // Create file - H5File file(FILE_ITERATE, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); + // Create file + H5File file(FILE_ITERATE, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); - /* Test iterating over empty group */ - info.command = RET_ZERO; - idx = 0; - ret = H5Literate(file.getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info); - verify_val(ret, SUCCEED, "H5Literate", __LINE__, __FILE__); + /* Test iterating over empty group */ + info.command = RET_ZERO; + idx = 0; + ret = H5Literate(file.getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info); + verify_val(ret, SUCCEED, "H5Literate", __LINE__, __FILE__); - DataType datatype(PredType::NATIVE_INT); + DataType datatype(PredType::NATIVE_INT); - // Create a scalar file space - DataSpace filespace; + // Create a scalar file space + DataSpace filespace; - for (i=0; i< NDATASETS; i++) - { + for (i=0; i< NDATASETS; i++) + { sprintf(name, "Dataset %d", i); - // Create a dataset in the file - DataSet dataset = file.createDataSet(name, datatype, filespace); + // Create a dataset in the file + DataSet dataset = file.createDataSet(name, datatype, filespace); /* Keep a copy of the dataset names */ lnames[i] = HDstrdup(name); check_values(lnames[i], "HDstrdup returns NULL", __LINE__, __FILE__); - } /* end for */ + } /* end for */ - /* Create a group and named datatype under root group for testing */ - Group grp(file.createGroup(GROUP1, 0)); - lnames[NDATASETS] = HDstrdup("grp"); - check_values(lnames[NDATASETS], "HDstrdup returns NULL", __LINE__, __FILE__); + /* Create a group and named datatype under root group for testing */ + Group grp(file.createGroup(GROUP1, 0)); + lnames[NDATASETS] = HDstrdup("grp"); + check_values(lnames[NDATASETS], "HDstrdup returns NULL", __LINE__, __FILE__); - datatype.commit(file, "dtype"); - lnames[NDATASETS + 1] = HDstrdup("dtype"); - check_values(lnames[NDATASETS], "HDstrdup returns NULL", __LINE__, __FILE__); + datatype.commit(file, "dtype"); + lnames[NDATASETS + 1] = HDstrdup("dtype"); + check_values(lnames[NDATASETS], "HDstrdup returns NULL", __LINE__, __FILE__); - /* Sort the dataset names */ - HDqsort(lnames, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); + /* Sort the dataset names */ + HDqsort(lnames, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); - /* Iterate through the datasets in the root group in various ways */ + /* Iterate through the datasets in the root group in various ways */ - // Open data file to read - file.openFile(FILE_ITERATE, H5F_ACC_RDONLY, fapl); + // Open data file to read + file.openFile(FILE_ITERATE, H5F_ACC_RDONLY, fapl); - // Open the root group - Group root_group(file.openGroup("/")); + // Open the root group + Group root_group(file.openGroup("/")); - // Get the number of object in the root group - hsize_t nobjs = root_group.getNumObjs(); - verify_val(nobjs, (hsize_t)(NDATASETS + 2), "H5Gget_info", __LINE__, __FILE__); + // Get the number of object in the root group + hsize_t nobjs = root_group.getNumObjs(); + verify_val(nobjs, (hsize_t)(NDATASETS + 2), "H5Gget_info", __LINE__, __FILE__); - H5std_string obj_name; - for (i = 0; i < nobjs; i++) - { - //H5O_info_t oinfo; /* Object info */ + H5std_string obj_name; + for (i = 0; i < nobjs; i++) + { + //H5O_info_t oinfo; /* Object info */ - obj_name = root_group.getObjnameByIdx(i); + obj_name = root_group.getObjnameByIdx(i); //ret = (herr_t)H5Lget_name_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, dataset_name, (size_t)NAMELEN, H5P_DEFAULT); - //oinfo = root_group.childObjType((hsize_t)i, H5_INDEX_NAME, H5_ITER_INC, "."); + //oinfo = root_group.childObjType((hsize_t)i, H5_INDEX_NAME, H5_ITER_INC, "."); //ret = H5Oget_info_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5P_DEFAULT); - } /* end for */ - - // Attempted to iterate with invalid index, should fail - try { - obj_name = root_group.getObjnameByIdx(NDATASETS + 3); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with invalid index"); - } - catch (GroupIException& invalid_action) // invalid index - {} // do nothing, exception expected - - // Attempted to iterate with negative index, should fail - try { - info.command = RET_ZERO; - idx = (hsize_t)-1; - obj_name = root_group.getObjnameByIdx(idx); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with negative index"); - } - catch (FileIException& invalid_action) // invalid index - {} // do nothing, exception expected - catch (GroupIException& invalid_action) // invalid index - {} // do nothing, exception expected - - /* Test skipping exactly as many entries as in the group */ - try { - info.command = RET_ZERO; - idx = NDATASETS + 2; - obj_name = root_group.getObjnameByIdx(idx); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with negative index"); - } - catch (FileIException& invalid_action) // invalid index - {} // do nothing, exception expected - catch (GroupIException& invalid_action) // invalid index - {} // do nothing, exception expected - - /* Test skipping more entries than are in the group */ - try { - info.command = RET_ZERO; - idx = NDATASETS + 3; - obj_name = root_group.getObjnameByIdx(idx); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with negative index"); - } - catch (FileIException& invalid_action) // invalid index - {} // do nothing, exception expected - catch (GroupIException& invalid_action) // invalid index - {} // do nothing, exception expected - - /* Free the dataset names */ - for(i = 0; i< (NDATASETS + 2); i++) - HDfree(lnames[i]); - - // Everything will be closed as they go out of scope - - PASSED(); - } // try block + } /* end for */ + + // Attempted to iterate with invalid index, should fail + try { + obj_name = root_group.getObjnameByIdx(NDATASETS + 3); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with invalid index"); + } + catch (GroupIException& invalid_action) // invalid index + {} // do nothing, exception expected + + // Attempted to iterate with negative index, should fail + try { + info.command = RET_ZERO; + idx = (hsize_t)-1; + obj_name = root_group.getObjnameByIdx(idx); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with negative index"); + } + catch (FileIException& invalid_action) // invalid index + {} // do nothing, exception expected + catch (GroupIException& invalid_action) // invalid index + {} // do nothing, exception expected + + /* Test skipping exactly as many entries as in the group */ + try { + info.command = RET_ZERO; + idx = NDATASETS + 2; + obj_name = root_group.getObjnameByIdx(idx); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with negative index"); + } + catch (FileIException& invalid_action) // invalid index + {} // do nothing, exception expected + catch (GroupIException& invalid_action) // invalid index + {} // do nothing, exception expected + + /* Test skipping more entries than are in the group */ + try { + info.command = RET_ZERO; + idx = NDATASETS + 3; + obj_name = root_group.getObjnameByIdx(idx); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with negative index"); + } + catch (FileIException& invalid_action) // invalid index + {} // do nothing, exception expected + catch (GroupIException& invalid_action) // invalid index + {} // do nothing, exception expected + + /* Free the dataset names */ + for(i = 0; i< (NDATASETS + 2); i++) + HDfree(lnames[i]); + + // Everything will be closed as they go out of scope + + PASSED(); + } // try block // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_iter_group", __LINE__, __FILE__); + issue_fail_msg("test_iter_group", __LINE__, __FILE__); } #if 0 @@ -355,59 +355,59 @@ static void test_iter_group(FileAccPropList& fapl) /**************************************************************** ** ** printelems(): Open an attribute and verify that it has a -** the correct name +** the correct name ** ****************************************************************/ -const H5std_string FILE_NAME("titerate.h5"); -const H5std_string GRP_NAME("/Group_A"); -const H5std_string FDATASET_NAME( "file dset" ); -const H5std_string GDATASET_NAME( "group dset" ); -const H5std_string ATTR_NAME( "Units" ); -const H5std_string FATTR_NAME( "F attr" ); -const H5std_string GATTR_NAME( "G attr" ); -const int DIM1 = 2; +const H5std_string FILE_NAME("titerate.h5"); +const H5std_string GRP_NAME("/Group_A"); +const H5std_string FDATASET_NAME("file dset"); +const H5std_string GDATASET_NAME("group dset"); +const H5std_string ATTR_NAME("Units"); +const H5std_string FATTR_NAME("F attr"); +const H5std_string GATTR_NAME("G attr"); +const int DIM1 = 2; void printelems(const Group& group, const H5std_string& dsname, const H5std_string& atname) { try { - DataSet d1(group.openDataSet(dsname)); - DataSpace s1 = d1.getSpace(); - s1.close(); - d1.close(); - - unsigned idx = 0; - Attribute a1(group.openAttribute(idx)); - H5std_string aname = a1.getName(); + DataSet d1(group.openDataSet(dsname)); + DataSpace s1 = d1.getSpace(); + s1.close(); + d1.close(); + + unsigned idx = 0; + Attribute a1(group.openAttribute(idx)); + H5std_string aname = a1.getName(); verify_val(aname, atname, "printelems", __LINE__, __FILE__); - a1.close(); + a1.close(); } // catch failure caused by the DataSpace operations catch( DataSpaceIException error ) { - error.printError(); + error.printError(); } // catch failure caused by the Group operations catch( GroupIException error ) { - error.printError(); + error.printError(); } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); + error.printError(); } } /*------------------------------------------------------------------------- - * Function: test_HDFFV_9920 + * Function: test_HDFFV_9920 * - * Purpose: Tests the fix for HDFFV-9920 + * Purpose Tests the fix for HDFFV-9920 * - * Programmer: Binh-Minh Ribler - * Friday, September 9, 2016 + * Programmer Binh-Minh Ribler + * Friday, September 9, 2016 * * Modifications: * @@ -420,74 +420,74 @@ static void test_HDFFV_9920() try { - // Create a new file and a group in it - H5File file( FILE_NAME, H5F_ACC_TRUNC ); + // Create a new file and a group in it + H5File file( FILE_NAME, H5F_ACC_TRUNC ); - Group gr1(file.createGroup(GRP_NAME)); + Group gr1(file.createGroup(GRP_NAME)); - // Create the data space for the attribute. - DataSpace dspace = DataSpace (1, dims ); + // Create the data space for the attribute. + DataSpace dspace = DataSpace (1, dims ); - DataSet fds = file.createDataSet(FDATASET_NAME, PredType::STD_I32BE, dspace); - DataSet gds = gr1.createDataSet(GDATASET_NAME, PredType::STD_I32BE, dspace); + DataSet fds = file.createDataSet(FDATASET_NAME, PredType::STD_I32BE, dspace); + DataSet gds = gr1.createDataSet(GDATASET_NAME, PredType::STD_I32BE, dspace); - // Create a file attribute and a group attribute. - Attribute fa1 = file.createAttribute(FATTR_NAME, PredType::STD_I32BE, - dspace); - Attribute ga1 = gr1.createAttribute(GATTR_NAME, PredType::STD_I32BE, - dspace); + // Create a file attribute and a group attribute. + Attribute fa1 = file.createAttribute(FATTR_NAME, PredType::STD_I32BE, + dspace); + Attribute ga1 = gr1.createAttribute(GATTR_NAME, PredType::STD_I32BE, + dspace); - // Write the attribute data. - fa1.write( PredType::NATIVE_INT, attr_data); - ga1.write( PredType::NATIVE_INT, attr_data); + // Write the attribute data. + fa1.write( PredType::NATIVE_INT, attr_data); + ga1.write( PredType::NATIVE_INT, attr_data); - fa1.close(); - ga1.close(); - fds.close(); - gds.close(); + fa1.close(); + ga1.close(); + fds.close(); + gds.close(); - // Verify the attributes have correct names. - printelems(file, FDATASET_NAME, FATTR_NAME); - printelems(gr1, GDATASET_NAME, GATTR_NAME); + // Verify the attributes have correct names. + printelems(file, FDATASET_NAME, FATTR_NAME); + printelems(gr1, GDATASET_NAME, GATTR_NAME); } // end of try block // catch failure caused by the H5File operations catch( DataSpaceIException error ) { - error.printError(); + error.printError(); } // catch failure caused by the H5File operations catch( AttributeIException error ) { - error.printError(); + error.printError(); } // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); + error.printError(); } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); + error.printError(); } } /*------------------------------------------------------------------------- - * Function: test_iterate + * Function: test_iterate * - * Purpose: Tests iterate functionality + * Purpose Tests iterate functionality * - * Return: Success: 0 - * Failure: -1 + * Return Success: 0 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * Tuesday, September 6, 2016 + * Programmer Binh-Minh Ribler + * Tuesday, September 6, 2016 * * Modifications: * @@ -503,20 +503,20 @@ void test_iterate() FileAccPropList fapl; fapl.setLibverBounds(H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - test_iter_group(fapl); // Test iterating groups - test_HDFFV_9920(); // Test the fix of HDFFV-9920 - //test_iter_attr(fapl); // Test iterating attributes + test_iter_group(fapl); // Test iterating groups + test_HDFFV_9920(); // Test the fix of HDFFV-9920 + //test_iter_attr(fapl); // Test iterating attributes } // test_iterate /*------------------------------------------------------------------------- * Function: cleanup_iterate * - * Purpose: Cleanup temporary test files + * Purpose Cleanup temporary test files * - * Return: none + * Return none * - * Programmer: (use C version) + * Programmer (use C version) * * Modifications: * diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 3acf4e1..c217718 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -43,9 +43,9 @@ using namespace H5; //#define H5G_TESTING //#include "h5test.h" -//#include "H5Gpkg.h" /* Groups */ -//#include "H5Iprivate.h" /* IDs */ -//#include "H5Lprivate.h" /* Links */ +//#include "H5Gpkg.h" /* Groups */ +//#include "H5Iprivate.h" /* IDs */ +//#include "H5Lprivate.h" /* Links */ /* File for external link test. Created with gen_udlinks.c */ #define LINKED_FILE "be_extlink2.h5" @@ -64,39 +64,39 @@ const char *FILENAME[] = { "links6", /* 9 */ "links7", /* 10 */ "links8", /* 11 */ - "extlinks0", /* 12: main files */ - "tmp/extlinks0", /* 13: */ - "extlinks1", /* 14: target files */ - "tmp/extlinks1", /* 15: */ - "extlinks2", /* 16: */ - "tmp/extlinks2", /* 17: */ - "extlinks3", /* 18: */ - "tmp/extlinks3", /* 19: */ - "extlinks4", /* 20: */ - "tmp/extlinks4", /* 21: */ - "extlinks5", /* 22: */ - "tmp/extlinks6", /* 23: */ - "extlinks7", /* 24: */ - "tmp/extlinks7", /* 25: */ - "tmp/extlinks8", /* 26: */ - "extlinks9", /* 27: */ - "tmp/extlinks9", /* 28: */ - "extlinks10", /* 29: */ /* TESTS for windows */ - "tmp/extlinks10", /* 30: */ - "tmp/extlinks11", /* 31: */ - "tmp/extlinks12", /* 32: */ - "extlinks13", /* 33: */ - "tmp/extlinks13", /* 34: */ - "tmp/extlinks14", /* 35: */ - "tmp/extlinks15", /* 36: */ - "extlinks16A", /* 37: */ /* TESTS for H5P_set_elink_fapl */ - "extlinks16B", /* 38: */ - "extlinks17", /* 39: */ - "extlinks18A", /* 40: */ - "extlinks18B", /* 41: */ - "extlinks19A", /* 42: */ - "extlinks19B", /* 43: */ - "extlinks20", /* 44: */ + "extlinks0", /* 12: main files */ + "tmp/extlinks0", /* 13: */ + "extlinks1", /* 14: target files */ + "tmp/extlinks1", /* 15: */ + "extlinks2", /* 16: */ + "tmp/extlinks2", /* 17: */ + "extlinks3", /* 18: */ + "tmp/extlinks3", /* 19: */ + "extlinks4", /* 20: */ + "tmp/extlinks4", /* 21: */ + "extlinks5", /* 22: */ + "tmp/extlinks6", /* 23: */ + "extlinks7", /* 24: */ + "tmp/extlinks7", /* 25: */ + "tmp/extlinks8", /* 26: */ + "extlinks9", /* 27: */ + "tmp/extlinks9", /* 28: */ + "extlinks10", /* 29: */ /* TESTS for windows */ + "tmp/extlinks10", /* 30: */ + "tmp/extlinks11", /* 31: */ + "tmp/extlinks12", /* 32: */ + "extlinks13", /* 33: */ + "tmp/extlinks13", /* 34: */ + "tmp/extlinks14", /* 35: */ + "tmp/extlinks15", /* 36: */ + "extlinks16A", /* 37: */ /* TESTS for H5P_set_elink_fapl */ + "extlinks16B", /* 38: */ + "extlinks17", /* 39: */ + "extlinks18A", /* 40: */ + "extlinks18B", /* 41: */ + "extlinks19A", /* 42: */ + "extlinks19B", /* 43: */ + "extlinks20", /* 44: */ NULL }; @@ -104,12 +104,12 @@ const char *FILENAME[] = { #define TMPDIR "tmp" -#define FAMILY_SIZE 1024 +#define FAMILY_SIZE 1024 #define CORE_INCREMENT 1024 -#define NUM400 400 +#define NUM400 400 /* do not do check_all_closed() for "ext*" files and "tmp/ext*" */ -#define EXTSTOP 12 +#define EXTSTOP 12 #define LINK_BUF_SIZE 1024 #define NAME_BUF_SIZE 1024 @@ -323,16 +323,16 @@ static const char *FILENAME[] = { /*------------------------------------------------------------------------- - * Function: test_basic_links + * Function: test_basic_links * - * Purpose: Test building a file with assorted links. + * Purpose Test building a file with assorted links. * - * Return: Success: 0 + * Return Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * October 16, 2009 + * Programmer Binh-Minh Ribler + * October 16, 2009 * * Modifications: * @@ -340,114 +340,114 @@ static const char *FILENAME[] = { */ static void test_basic_links(hid_t fapl_id, hbool_t new_format) { - hsize_t size[1] = {1}; - char filename[NAME_BUF_SIZE]; + hsize_t size[1] = {1}; + char filename[NAME_BUF_SIZE]; // Use the file access template id to create a file access prop. list. FileAccPropList fapl(fapl_id); try { - if(new_format) - SUBTEST("Link creation (w/new group format)") - else - SUBTEST("Link creation") + if(new_format) + SUBTEST("Link creation (w/new group format)") + else + SUBTEST("Link creation") - h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); - H5File file(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + H5File file(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); - // Create simple dataspace - DataSpace scalar (1, size, size); + // Create simple dataspace + DataSpace scalar (1, size, size); - // Create a group then close it by letting the object go out of scope - { - Group group(file.createGroup("grp1", 0)); - } + // Create a group then close it by letting the object go out of scope + { + Group group(file.createGroup("grp1", 0)); + } - // Create a dataset then close it by letting the object go out of scope - { - DataSet dset1(file.createDataSet("dset1", PredType::NATIVE_INT, scalar)); - } + // Create a dataset then close it by letting the object go out of scope + { + DataSet dset1(file.createDataSet("dset1", PredType::NATIVE_INT, scalar)); + } - hid_t file_id = file.getId(); + hid_t file_id = file.getId(); - // Because these are not implemented in the C++ API yet, they are - // used so CommonFG::getLinkval can be tested. - // Create a hard link - if(H5Lcreate_hard( - file_id, "dset1", H5L_SAME_LOC, "grp1/hard1", - H5P_DEFAULT, H5P_DEFAULT) < 0) - throw Exception("test_basic_links", "H5Lcreate_hard failed"); + // Because these are not implemented in the C++ API yet, they are + // used so CommonFG::getLinkval can be tested. + // Create a hard link + if(H5Lcreate_hard( + file_id, "dset1", H5L_SAME_LOC, "grp1/hard1", + H5P_DEFAULT, H5P_DEFAULT) < 0) + throw Exception("test_basic_links", "H5Lcreate_hard failed"); - // Create a symbolic link - if(H5Lcreate_soft( - "/dset1", file_id, "grp1/soft", H5P_DEFAULT, H5P_DEFAULT) < 0) - throw Exception("test_basic_links", "H5Lcreate_soft failed"); + // Create a symbolic link + if(H5Lcreate_soft( + "/dset1", file_id, "grp1/soft", H5P_DEFAULT, H5P_DEFAULT) < 0) + throw Exception("test_basic_links", "H5Lcreate_soft failed"); - // Create a symbolic link to something that doesn't exist - if(H5Lcreate_soft( - "foobar", file_id, "grp1/dangle", H5P_DEFAULT, H5P_DEFAULT) < 0) - throw Exception("test_basic_links", "H5Lcreate_soft failed"); + // Create a symbolic link to something that doesn't exist + if(H5Lcreate_soft( + "foobar", file_id, "grp1/dangle", H5P_DEFAULT, H5P_DEFAULT) < 0) + throw Exception("test_basic_links", "H5Lcreate_soft failed"); - // Create a recursive symbolic link - if(H5Lcreate_soft( - "/grp1/recursive", file_id, "/grp1/recursive", - H5P_DEFAULT, H5P_DEFAULT) < 0) - throw Exception("test_basic_links", "H5Lcreate_soft failed"); + // Create a recursive symbolic link + if(H5Lcreate_soft( + "/grp1/recursive", file_id, "/grp1/recursive", + H5P_DEFAULT, H5P_DEFAULT) < 0) + throw Exception("test_basic_links", "H5Lcreate_soft failed"); - // Verify link values before closing the file + // Verify link values before closing the file - H5std_string softlink_val = file.getLinkval("grp1/soft"); - verify_val(softlink_val, "/dset1", "H5File::getLinkval grp1/soft", __LINE__, __FILE__); + H5std_string softlink_val = file.getLinkval("grp1/soft"); + verify_val(softlink_val, "/dset1", "H5File::getLinkval grp1/soft", __LINE__, __FILE__); - H5std_string dngllink_val = file.getLinkval("grp1/dangle"); - verify_val(dngllink_val, "foobar", "H5File::getLinkval grp1/dangle", __LINE__, __FILE__); + H5std_string dngllink_val = file.getLinkval("grp1/dangle"); + verify_val(dngllink_val, "foobar", "H5File::getLinkval grp1/dangle", __LINE__, __FILE__); - H5std_string reclink_val = file.getLinkval("grp1/recursive"); - verify_val(reclink_val, "/grp1/recursive", "H5File::getLinkval grp1/recursive", __LINE__, __FILE__); + H5std_string reclink_val = file.getLinkval("grp1/recursive"); + verify_val(reclink_val, "/grp1/recursive", "H5File::getLinkval grp1/recursive", __LINE__, __FILE__); } // end of try block catch (Exception& E) { - issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); } // Open the file and check on the links in it try { - // Open the file above - H5File file(filename, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); + // Open the file above + H5File file(filename, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); - // Verify link existence - if(file.exists("dset1", LinkAccPropList::DEFAULT) != TRUE) - throw InvalidActionException("H5File::exists", "dset1 doesn't exist"); - if(file.exists("grp1/soft", LinkAccPropList::DEFAULT) != TRUE) - throw InvalidActionException("H5File::exists", "grp1/soft doesn't exist"); + // Verify link existence + if(file.exists("dset1", LinkAccPropList::DEFAULT) != TRUE) + throw InvalidActionException("H5File::exists", "dset1 doesn't exist"); + if(file.exists("grp1/soft", LinkAccPropList::DEFAULT) != TRUE) + throw InvalidActionException("H5File::exists", "grp1/soft doesn't exist"); - // Verify link values - H5std_string softlink_val = file.getLinkval("grp1/soft"); - verify_val(softlink_val, "/dset1", "H5File::getLinkval grp1/soft", __LINE__, __FILE__); + // Verify link values + H5std_string softlink_val = file.getLinkval("grp1/soft"); + verify_val(softlink_val, "/dset1", "H5File::getLinkval grp1/soft", __LINE__, __FILE__); - H5std_string reclink_val = file.getLinkval("grp1/recursive"); - verify_val(reclink_val, "/grp1/recursive", "H5File::getLinkval grp1/recursive", __LINE__, __FILE__); + H5std_string reclink_val = file.getLinkval("grp1/recursive"); + verify_val(reclink_val, "/grp1/recursive", "H5File::getLinkval grp1/recursive", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); } } /*------------------------------------------------------------------------- - * Function: test_links + * Function: test_links * - * Purpose: Test links + * Purpose Test links * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler + * Programmer Binh-Minh Ribler * October 16, 2009 * *------------------------------------------------------------------------- @@ -455,7 +455,7 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) extern "C" void test_links() { - hid_t fapl_id, fapl2_id; /* File access property lists */ + hid_t fapl_id, fapl2_id; /* File access property lists */ unsigned new_format; /* Whether to use the new format or not */ const char *envval; @@ -469,40 +469,40 @@ void test_links() MESSAGE(5, ("Testing Various Links\n")); try { - /* Copy the file access property list */ - if((fapl2_id = H5Pcopy(fapl_id)) < 0) - throw Exception("test_links", "H5Pcopy failed"); - - /* Set the "use the latest version of the format" bounds for creating objects in the file */ - if(H5Pset_libver_bounds(fapl2_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - throw Exception("test_links", "H5Pset_libver_bounds failed"); - - /* Loop over using new group format */ - for(new_format = FALSE; new_format <= TRUE; new_format++) - { - hid_t my_fapl_id; - - /* Check for FAPL to use */ - if(new_format) - my_fapl_id = fapl2_id; - else - my_fapl_id = fapl_id; - - /* General tests... (on both old & new format groups */ - // FileAccPropList may be passed in instead of fapl id - test_basic_links(my_fapl_id, new_format); + /* Copy the file access property list */ + if((fapl2_id = H5Pcopy(fapl_id)) < 0) + throw Exception("test_links", "H5Pcopy failed"); + + /* Set the "use the latest version of the format" bounds for creating objects in the file */ + if(H5Pset_libver_bounds(fapl2_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + throw Exception("test_links", "H5Pset_libver_bounds failed"); + + /* Loop over using new group format */ + for(new_format = FALSE; new_format <= TRUE; new_format++) + { + hid_t my_fapl_id; + + /* Check for FAPL to use */ + if(new_format) + my_fapl_id = fapl2_id; + else + my_fapl_id = fapl_id; + + /* General tests... (on both old & new format groups */ + // FileAccPropList may be passed in instead of fapl id + test_basic_links(my_fapl_id, new_format); #if 0 // these tests are from the C test links.c and left here for future // implementation of H5L API - nerrors += test_basic_links(fapl_id, new_format) < 0 ? 1 : 0; - nerrors += cklinks(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += new_links(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += ck_new_links(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += long_links(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += toomany(my_fapl, new_format) < 0 ? 1 : 0; - - /* Test new H5L link creation routine */ - nerrors += test_lcpl(my_fapl, new_format); + nerrors += test_basic_links(fapl_id, new_format) < 0 ? 1 : 0; + nerrors += cklinks(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += new_links(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += ck_new_links(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += long_links(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += toomany(my_fapl, new_format) < 0 ? 1 : 0; + + /* Test new H5L link creation routine */ + nerrors += test_lcpl(my_fapl, new_format); nerrors += test_move(my_fapl, new_format); nerrors += test_copy(my_fapl, new_format); nerrors += test_move_preserves(my_fapl, new_format); @@ -579,7 +579,7 @@ void test_links() /* do not do this for files used by external link tests */ nerrors += check_all_closed(my_fapl, new_format, EXTSTOP) < 0 ? 1 : 0; #endif // 0 - } /* end for */ + } /* end for */ #if 0 /* New group revision feature tests */ @@ -609,33 +609,33 @@ void test_links() nerrors += group_info_old(fapl) < 0 ? 1 : 0; #endif - /* Close 2nd FAPL */ - H5Pclose(fapl2_id); + /* Close 2nd FAPL */ + H5Pclose(fapl2_id); - h5_clean_files(FILENAME, fapl_id); + h5_clean_files(FILENAME, fapl_id); - /* Test that external links can be used after a library reset. MUST be - * called last so the reset doesn't interfere with the property lists. This - * routine will delete its own file. */ - /* nerrors += external_reset_register() < 0 ? 1 : 0; + /* Test that external links can be used after a library reset. MUST be + * called last so the reset doesn't interfere with the property lists. This + * routine will delete its own file. */ + /* nerrors += external_reset_register() < 0 ? 1 : 0; */ } catch (Exception& E) { - issue_fail_msg("test_links()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_links()", __LINE__, __FILE__, E.getCDetailMsg()); } } /*------------------------------------------------------------------------- - * Function: cleanup_links + * Function: cleanup_links * - * Purpose: Cleanup temporary test files + * Purpose Cleanup temporary test files * - * Return: none + * Return none * - * Programmer: Binh-Minh Ribler - * October 16, 2009 + * Programmer Binh-Minh Ribler + * October 16, 2009 * * Modifications: * diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index 325b2b0..6003dd6 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -31,41 +31,41 @@ using namespace H5; #include "h5test.h" #include "h5cpputil.h" // C++ utilility header file -const H5std_string FILE_OBJECTS("tobjects.h5"); -const H5std_string GROUP1("Top Group"); -const H5std_string GROUP1_PATH("/Top Group"); -const H5std_string GROUP1_1("Sub-Group 1.1"); -const H5std_string GROUP1_1_PATH("/Top Group/Sub-Group 1.1"); -const H5std_string GROUP1_2("Sub-Group 1.2"); -const H5std_string GROUP1_2_PATH("/Top Group/Sub-Group 1.2"); -const H5std_string DSET_DEFAULT_NAME("default"); -const H5std_string DSET_IN_FILE("Dataset in File"); -const H5std_string DSET_IN_FILE_PATH("/Dataset in File"); -const H5std_string DSET_IN_GRP1("Dataset_in_Group_1"); -const H5std_string DSET_IN_GRP1_PATH("/Top Group/Dataset_in_Group_1"); -const H5std_string DSET_IN_GRP1_2("Dataset_in_Group_1.2"); -const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset_in_Group_1.2"); +const H5std_string FILE_OBJECTS("tobjects.h5"); +const H5std_string GROUP1("Top Group"); +const H5std_string GROUP1_PATH("/Top Group"); +const H5std_string GROUP1_1("Sub-Group 1.1"); +const H5std_string GROUP1_1_PATH("/Top Group/Sub-Group 1.1"); +const H5std_string GROUP1_2("Sub-Group 1.2"); +const H5std_string GROUP1_2_PATH("/Top Group/Sub-Group 1.2"); +const H5std_string DSET_DEFAULT_NAME("default"); +const H5std_string DSET_IN_FILE("Dataset in File"); +const H5std_string DSET_IN_FILE_PATH("/Dataset in File"); +const H5std_string DSET_IN_GRP1("Dataset_in_Group_1"); +const H5std_string DSET_IN_GRP1_PATH("/Top Group/Dataset_in_Group_1"); +const H5std_string DSET_IN_GRP1_2("Dataset_in_Group_1.2"); +const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset_in_Group_1.2"); /*------------------------------------------------------------------------- - * Function: test_get_objname + * Function: test_get_objname * - * Purpose: Tests getting object name of groups and datasets. + * Purpose Tests getting object name of groups and datasets. * * Description: - * File structure: - * GROUP1 - * GROUP1_1 - * GROUP1_2 - * DSET_IN_GRP1_2 - * DSET_IN_GRP1 - * DSET_IN_FILE + * File structure: + * GROUP1 + * GROUP1_1 + * GROUP1_2 + * DSET_IN_GRP1_2 + * DSET_IN_GRP1 + * DSET_IN_FILE * * - * Return: Success: 0 - * Failure: -1 + * Return Success: 0 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * Friday, March 4, 2014 + * Programmer Binh-Minh Ribler + * Friday, March 4, 2014 * * Modifications: * @@ -76,104 +76,104 @@ static void test_get_objname() SUBTEST("H5Object::getObjName on Groups and Datasets"); try { - // Create file - H5File file(FILE_OBJECTS, H5F_ACC_TRUNC); + // Create file + H5File file(FILE_OBJECTS, H5F_ACC_TRUNC); - // Create a top group and 2 subgroups - Group grp1 = file.createGroup(GROUP1, 0); - Group grp1_1 = grp1.createGroup(GROUP1_1, 0); - Group grp1_2 = grp1.createGroup(GROUP1_2, 0); + // Create a top group and 2 subgroups + Group grp1 = file.createGroup(GROUP1, 0); + Group grp1_1 = grp1.createGroup(GROUP1_1, 0); + Group grp1_2 = grp1.createGroup(GROUP1_2, 0); - // Get part of the group's name, random length using - // ssize_t getObjName(char* comment, size_t buf_size) + // Get part of the group's name, random length using + // ssize_t getObjName(char* comment, size_t buf_size) - // Get the length of the group's name first - ssize_t name_len = grp1.getObjName(NULL); + // Get the length of the group's name first + ssize_t name_len = grp1.getObjName(NULL); - // Random length is 4 - if (name_len > 4) - { - char* grp1_name = new char[5]; - name_len = grp1.getObjName(grp1_name, 5); - verify_val((const char*)grp1_name, "/Top", "Group::getObjName", __LINE__, __FILE__); - delete []grp1_name; - } + // Random length is 4 + if (name_len > 4) + { + char* grp1_name = new char[5]; + name_len = grp1.getObjName(grp1_name, 5); + verify_val((const char*)grp1_name, "/Top", "Group::getObjName", __LINE__, __FILE__); + delete []grp1_name; + } - // Create a data space - hsize_t dims[2]; - dims[0] = 2; - dims[1] = 5; - DataSpace space (2, dims, NULL); + // Create a data space + hsize_t dims[2]; + dims[0] = 2; + dims[1] = 5; + DataSpace space (2, dims, NULL); - // Create a dataset in the file - DataSet dsinfile = file.createDataSet(DSET_IN_FILE, - PredType::NATIVE_DOUBLE, space); + // Create a dataset in the file + DataSet dsinfile = file.createDataSet(DSET_IN_FILE, + PredType::NATIVE_DOUBLE, space); - // Create a dataset in the group - DataSet dsingrp = grp1.createDataSet(DSET_IN_GRP1, - PredType::NATIVE_INT, space); + // Create a dataset in the group + DataSet dsingrp = grp1.createDataSet(DSET_IN_GRP1, + PredType::NATIVE_INT, space); - // Get and verify the name of each dataset, using - // H5std_string getObjName() and - // ssize_t getObjName(H5std_string& obj_name, size_t len = 0) - H5std_string ds_name = dsinfile.getObjName(); - verify_val(ds_name, DSET_IN_FILE_PATH, "DataSet::getObjName", __LINE__, __FILE__); + // Get and verify the name of each dataset, using + // H5std_string getObjName() and + // ssize_t getObjName(H5std_string& obj_name, size_t len = 0) + H5std_string ds_name = dsinfile.getObjName(); + verify_val(ds_name, DSET_IN_FILE_PATH, "DataSet::getObjName", __LINE__, __FILE__); - name_len = dsingrp.getObjName(ds_name); // default len - verify_val(ds_name, DSET_IN_GRP1_PATH, "DataSet::getObjName", __LINE__, __FILE__); + name_len = dsingrp.getObjName(ds_name); // default len + verify_val(ds_name, DSET_IN_GRP1_PATH, "DataSet::getObjName", __LINE__, __FILE__); - // Close dataset - dsingrp.close(); + // Close dataset + dsingrp.close(); - // Create a dataset in sub-group 1.2 - dsingrp = grp1_2.createDataSet(DSET_IN_GRP1_2, PredType::NATIVE_INT, space); + // Create a dataset in sub-group 1.2 + dsingrp = grp1_2.createDataSet(DSET_IN_GRP1_2, PredType::NATIVE_INT, space); - // Get and verify the name of the dataset that belongs to subgroup - // 1.2, using H5std_string getObjName() - ds_name = dsingrp.getObjName(); - verify_val(ds_name, DSET_IN_GRP1_2_PATH, "DataSet::getObjName", __LINE__, __FILE__); + // Get and verify the name of the dataset that belongs to subgroup + // 1.2, using H5std_string getObjName() + ds_name = dsingrp.getObjName(); + verify_val(ds_name, DSET_IN_GRP1_2_PATH, "DataSet::getObjName", __LINE__, __FILE__); - // Close dataset - dsingrp.close(); + // Close dataset + dsingrp.close(); - // Reopen that same dataset then check the name again with another - // overload: ssize_t getObjName(H5std_string& obj_name, size_t len = 0) - dsingrp = grp1_2.openDataSet(DSET_IN_GRP1_2); - name_len = dsingrp.getObjName(ds_name); - verify_val(ds_name, DSET_IN_GRP1_2_PATH, "DataSet::getObjName", __LINE__, __FILE__); + // Reopen that same dataset then check the name again with another + // overload: ssize_t getObjName(H5std_string& obj_name, size_t len = 0) + dsingrp = grp1_2.openDataSet(DSET_IN_GRP1_2); + name_len = dsingrp.getObjName(ds_name); + verify_val(ds_name, DSET_IN_GRP1_2_PATH, "DataSet::getObjName", __LINE__, __FILE__); - // Everything will be closed as they go out of scope + // Everything will be closed as they go out of scope - PASSED(); - } // try block + PASSED(); + } // try block // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_get_objname", __LINE__, __FILE__); + issue_fail_msg("test_get_objname", __LINE__, __FILE__); } } // test_get_objname /*------------------------------------------------------------------------- - * Function: test_existance + * Function: test_existance * - * Purpose: Tests getting object name of groups and datasets. + * Purpose Tests getting object name of groups and datasets. * * Description: - * File structure: - * GROUP1 - * GROUP1_1 - * GROUP1_2 - * DSET_IN_GRP1_2 - * DSET_IN_GRP1 - * DSET_IN_FILE + * File structure: + * GROUP1 + * GROUP1_1 + * GROUP1_2 + * DSET_IN_GRP1_2 + * DSET_IN_GRP1 + * DSET_IN_FILE * * - * Return: Success: 0 - * Failure: -1 + * Return Success: 0 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * Friday, March 4, 2014 + * Programmer Binh-Minh Ribler + * Friday, March 4, 2014 * * Modifications: * @@ -184,62 +184,62 @@ static void test_existance() SUBTEST("H5File::exists and Group::exists"); try { - // Open file - H5File file(FILE_OBJECTS, H5F_ACC_RDONLY); + // Open file + H5File file(FILE_OBJECTS, H5F_ACC_RDONLY); - // Check if GROUP1 exists in the file - bool exists = file.exists(GROUP1); + // Check if GROUP1 exists in the file + bool exists = file.exists(GROUP1); - // Open GROUP1 - Group grp1 = file.openGroup(GROUP1); + // Open GROUP1 + Group grp1 = file.openGroup(GROUP1); - // Check if GROUP1_1 and GROUP1_2 exist in GROUP1 - exists = grp1.exists(GROUP1_1); - verify_val(exists, TRUE, "Group::exists GROUP1_1", __LINE__, __FILE__); - exists = grp1.exists(GROUP1_2); - verify_val(exists, TRUE, "Group::exists GROUP1_2", __LINE__, __FILE__); + // Check if GROUP1_1 and GROUP1_2 exist in GROUP1 + exists = grp1.exists(GROUP1_1); + verify_val(exists, TRUE, "Group::exists GROUP1_1", __LINE__, __FILE__); + exists = grp1.exists(GROUP1_2); + verify_val(exists, TRUE, "Group::exists GROUP1_2", __LINE__, __FILE__); - // Check if DSET_IN_GRP1 exists in GROUP1 - exists = grp1.exists(DSET_IN_GRP1); - verify_val(exists, TRUE, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); + // Check if DSET_IN_GRP1 exists in GROUP1 + exists = grp1.exists(DSET_IN_GRP1); + verify_val(exists, TRUE, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); - // Open GROUP1_2 - Group grp1_2 = grp1.openGroup(GROUP1_2); + // Open GROUP1_2 + Group grp1_2 = grp1.openGroup(GROUP1_2); - // Check if DSET_IN_GRP1_2 exists in GROUP1_2 - exists = grp1_2.exists(DSET_IN_GRP1_2); - verify_val(exists, TRUE, "Group::exists DSET_IN_GRP1_2", __LINE__, __FILE__); + // Check if DSET_IN_GRP1_2 exists in GROUP1_2 + exists = grp1_2.exists(DSET_IN_GRP1_2); + verify_val(exists, TRUE, "Group::exists DSET_IN_GRP1_2", __LINE__, __FILE__); - // Check if a dataset exists given dataset as location with full path name - DataSet dset1 = file.openDataSet(DSET_IN_FILE); - exists = dset1.exists("/Top Group/Dataset_in_Group_1"); - verify_val(exists, TRUE, "Group::exists given dataset with full path name", __LINE__, __FILE__); + // Check if a dataset exists given dataset as location with full path name + DataSet dset1 = file.openDataSet(DSET_IN_FILE); + exists = dset1.exists("/Top Group/Dataset_in_Group_1"); + verify_val(exists, TRUE, "Group::exists given dataset with full path name", __LINE__, __FILE__); - exists = grp1_2.exists(DSET_IN_GRP1); - verify_val(exists, FALSE, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); + exists = grp1_2.exists(DSET_IN_GRP1); + verify_val(exists, FALSE, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); - // Everything will be closed as they go out of scope + // Everything will be closed as they go out of scope - PASSED(); - } // try block + PASSED(); + } // try block // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_existance", __LINE__, __FILE__); + issue_fail_msg("test_existance", __LINE__, __FILE__); } } // test_existance /*------------------------------------------------------------------------- - * Function: test_get_objname_ontypes + * Function: test_get_objname_ontypes * - * Purpose: Test getting object name from various committed types. + * Purpose Test getting object name from various committed types. * - * Return: Success: 0 - * Failure: -1 + * Return Success: 0 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * March 4, 2014 + * Programmer Binh-Minh Ribler + * March 4, 2014 * * Modifications: * @@ -250,97 +250,97 @@ static void test_get_objname_ontypes() SUBTEST("H5Object::getObjName on Committed Datatypes"); try { - // Create a file with default prop lists - H5File file(FILE_OBJECTS, H5F_ACC_RDWR); - - // Create a group - Group grp = file.createGroup ("typetests"); - - // Create a datatype and save it - IntType inttype(PredType::STD_B8LE); - inttype.commit(file, "INT type of STD_B8LE"); - - // Close the type then open it again to test getting its name - inttype.close(); - inttype = file.openIntType("INT type of STD_B8LE"); // deprecated - - // Get and verify its name - H5std_string inttype_name = inttype.getObjName(); - verify_val(inttype_name, "/INT type of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); - - // Close the type then open it again to test getting its name, but - // with the constructor this time - inttype.close(); - IntType std_b8le(file, "INT type of STD_B8LE"); - - // Get and verify its name - H5std_string std_b8le_name = std_b8le.getObjName(); - verify_val(std_b8le_name, "/INT type of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); - - // Make copy of a predefined type and save it - DataType dtype(PredType::STD_B8LE); - dtype.commit(file, "STD_B8LE"); - - // Close the data type and file - dtype.close(); - file.close(); - - // Re-open the file and the data type to test getting its name - file.openFile(FILE_OBJECTS, H5F_ACC_RDWR); - dtype = file.openDataType("STD_B8LE"); // deprecated - - // Get and verify its name - H5std_string type_name = dtype.getObjName(); - verify_val(type_name, "/STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); - - // Close the type and open it again with the constructor then test - // getting its name - dtype.close(); - DataType dtype2(file, "STD_B8LE"); - type_name = dtype2.getObjName(); - verify_val(type_name, "/STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); - - // Test getting type's name from copied type - DataType copied_type; - copied_type.copy(dtype2); - copied_type.commit(file, "copy of STD_B8LE"); - type_name = copied_type.getObjName(); - verify_val(type_name, "/copy of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); - - // Test copying an integer predefined type - IntType new_int_type(PredType::NATIVE_INT); - - // Name this datatype - new_int_type.commit(grp, "IntType NATIVE_INT"); - ssize_t name_len = new_int_type.getObjName(type_name); // default len - verify_val(name_len, (ssize_t)HDstrlen("/typetests/IntType NATIVE_INT"), "DataType::getObjName", __LINE__, __FILE__); - verify_val(type_name, "/typetests/IntType NATIVE_INT", "DataType::getObjName", __LINE__, __FILE__); - - // Close everything or they can be closed when objects go out of scope - dtype2.close(); - copied_type.close(); - new_int_type.close(); - grp.close(); - - PASSED(); + // Create a file with default prop lists + H5File file(FILE_OBJECTS, H5F_ACC_RDWR); + + // Create a group + Group grp = file.createGroup ("typetests"); + + // Create a datatype and save it + IntType inttype(PredType::STD_B8LE); + inttype.commit(file, "INT type of STD_B8LE"); + + // Close the type then open it again to test getting its name + inttype.close(); + inttype = file.openIntType("INT type of STD_B8LE"); // deprecated + + // Get and verify its name + H5std_string inttype_name = inttype.getObjName(); + verify_val(inttype_name, "/INT type of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Close the type then open it again to test getting its name, but + // with the constructor this time + inttype.close(); + IntType std_b8le(file, "INT type of STD_B8LE"); + + // Get and verify its name + H5std_string std_b8le_name = std_b8le.getObjName(); + verify_val(std_b8le_name, "/INT type of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Make copy of a predefined type and save it + DataType dtype(PredType::STD_B8LE); + dtype.commit(file, "STD_B8LE"); + + // Close the data type and file + dtype.close(); + file.close(); + + // Re-open the file and the data type to test getting its name + file.openFile(FILE_OBJECTS, H5F_ACC_RDWR); + dtype = file.openDataType("STD_B8LE"); // deprecated + + // Get and verify its name + H5std_string type_name = dtype.getObjName(); + verify_val(type_name, "/STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Close the type and open it again with the constructor then test + // getting its name + dtype.close(); + DataType dtype2(file, "STD_B8LE"); + type_name = dtype2.getObjName(); + verify_val(type_name, "/STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Test getting type's name from copied type + DataType copied_type; + copied_type.copy(dtype2); + copied_type.commit(file, "copy of STD_B8LE"); + type_name = copied_type.getObjName(); + verify_val(type_name, "/copy of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Test copying an integer predefined type + IntType new_int_type(PredType::NATIVE_INT); + + // Name this datatype + new_int_type.commit(grp, "IntType NATIVE_INT"); + ssize_t name_len = new_int_type.getObjName(type_name); // default len + verify_val(name_len, (ssize_t)HDstrlen("/typetests/IntType NATIVE_INT"), "DataType::getObjName", __LINE__, __FILE__); + verify_val(type_name, "/typetests/IntType NATIVE_INT", "DataType::getObjName", __LINE__, __FILE__); + + // Close everything or they can be closed when objects go out of scope + dtype2.close(); + copied_type.close(); + new_int_type.close(); + grp.close(); + + PASSED(); } // end top try block catch (Exception& E) { - issue_fail_msg("test_get_objname_ontypes", __LINE__, __FILE__); + issue_fail_msg("test_get_objname_ontypes", __LINE__, __FILE__); } } // test_get_objname_ontypes /*------------------------------------------------------------------------- - * Function: test_get_objtype + * Function: test_get_objtype * - * Purpose: Tests getting object type + * Purpose Tests getting object type * - * Return: Success: 0 - * Failure: -1 + * Return Success: 0 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * Friday, March 4, 2014 + * Programmer Binh-Minh Ribler + * Friday, March 4, 2014 * * Modifications: * @@ -351,61 +351,61 @@ static void test_get_objtype() SUBTEST("H5File::childObjType and H5Group::childObjType"); try { - // Open file - H5File file(FILE_OBJECTS, H5F_ACC_RDWR); + // Open file + H5File file(FILE_OBJECTS, H5F_ACC_RDWR); - // Open the top group - Group grp1 = file.openGroup(GROUP1); + // Open the top group + Group grp1 = file.openGroup(GROUP1); - // Create a datatype and save it - DataType dtype(PredType::STD_I32LE); - dtype.commit(grp1, "STD_I32LE"); + // Create a datatype and save it + DataType dtype(PredType::STD_I32LE); + dtype.commit(grp1, "STD_I32LE"); - // Get and verify object type with - // H5O_type_t childObjType(const H5std_string& objname) - H5O_type_t objtype = file.childObjType(DSET_IN_FILE); - verify_val(objtype, H5O_TYPE_DATASET, "DataSet::childObjType", __LINE__, __FILE__); + // Get and verify object type with + // H5O_type_t childObjType(const H5std_string& objname) + H5O_type_t objtype = file.childObjType(DSET_IN_FILE); + verify_val(objtype, H5O_TYPE_DATASET, "DataSet::childObjType", __LINE__, __FILE__); - // Get and verify object type with - // H5O_type_t childObjType(const char* objname) - objtype = grp1.childObjType(GROUP1_1.c_str()); - verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__); + // Get and verify object type with + // H5O_type_t childObjType(const char* objname) + objtype = grp1.childObjType(GROUP1_1.c_str()); + verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__); - // Get and verify object type with - // H5O_type_t childObjType(hsize_t index, H5_index_t index_type, - // H5_iter_order_t order, const char* objname=".") - objtype = grp1.childObjType((hsize_t)1, H5_INDEX_NAME, H5_ITER_INC); - verify_val(objtype, H5O_TYPE_NAMED_DATATYPE, "DataSet::childObjType", __LINE__, __FILE__); + // Get and verify object type with + // H5O_type_t childObjType(hsize_t index, H5_index_t index_type, + // H5_iter_order_t order, const char* objname=".") + objtype = grp1.childObjType((hsize_t)1, H5_INDEX_NAME, H5_ITER_INC); + verify_val(objtype, H5O_TYPE_NAMED_DATATYPE, "DataSet::childObjType", __LINE__, __FILE__); - // Get and verify object type with - // H5O_type_t childObjType(hsize_t index, - // H5_index_t index_type=H5_INDEX_NAME, - // H5_iter_order_t order=H5_ITER_INC, const char* objname=".") - objtype = grp1.childObjType((hsize_t)2); - verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__); + // Get and verify object type with + // H5O_type_t childObjType(hsize_t index, + // H5_index_t index_type=H5_INDEX_NAME, + // H5_iter_order_t order=H5_ITER_INC, const char* objname=".") + objtype = grp1.childObjType((hsize_t)2); + verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__); - // Everything will be closed as they go out of scope + // Everything will be closed as they go out of scope - PASSED(); - } // try block + PASSED(); + } // try block // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_get_objtype", __LINE__, __FILE__); + issue_fail_msg("test_get_objtype", __LINE__, __FILE__); } } // test_get_objtype /*------------------------------------------------------------------------- - * Function: test_objects + * Function: test_objects * - * Purpose: Tests HDF5 object related functionality + * Purpose Tests HDF5 object related functionality * - * Return: Success: 0 - * Failure: -1 + * Return Success: 0 + * Failure: -1 * - * Programmer: Binh-Minh Ribler - * Friday, Mar 4, 2014 + * Programmer Binh-Minh Ribler + * Friday, Mar 4, 2014 * * Modifications: * @@ -419,7 +419,7 @@ void test_object() test_get_objname(); // Test get object name from groups/datasets test_existance(); // Test check for object existance - test_get_objname_ontypes(); // Test get object name from types + test_get_objname_ontypes(); // Test get object name from types test_get_objtype(); // Test get object type } // test_objects @@ -427,11 +427,11 @@ void test_object() /*------------------------------------------------------------------------- * Function: cleanup_objects * - * Purpose: Cleanup temporary test files + * Purpose Cleanup temporary test files * - * Return: none + * Return none * - * Programmer: (use C version) + * Programmer (use C version) * * Modifications: * diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index 9bc2eb0..d8a0d5f 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -16,7 +16,7 @@ /***************************************************************************** FILE trefer.cpp - HDF5 C++ testing the functionalities associated with the C - Reference interface (H5R) + Reference interface (H5R) ***************************************************************************/ #ifdef OLD_HEADER_FILENAME @@ -79,100 +79,100 @@ test_reference_params(void) H5File* file1 = NULL; try { - hobj_ref_t *wbuf, // buffer to write to disk - *rbuf, // buffer read from disk - *tbuf; // temp. buffer read from disk + hobj_ref_t *wbuf, // buffer to write to disk + *rbuf, // buffer read from disk + *tbuf; // temp. buffer read from disk - // Allocate write & read buffers - int temp_size = MAX(sizeof(unsigned),sizeof(hobj_ref_t)); - wbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); - rbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); - tbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + // Allocate write & read buffers + int temp_size = MAX(sizeof(unsigned),sizeof(hobj_ref_t)); + wbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + rbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + tbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); // Create file FILE1 file1 = new H5File (FILE1, H5F_ACC_TRUNC); - // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; - DataSpace sid1(SPACE1_RANK, dims1); - - // Create a group - Group group = file1->createGroup("Group1"); - - // Set group's comment - group.setComment(".", write_comment); - - // Create a dataset (inside /Group1) - DataSet dataset = group.createDataSet(DSET1_NAME, PredType::NATIVE_UINT, sid1); - - unsigned *tu32; // Temporary pointer to uint32 data - int i; - for (tu32=(unsigned *)wbuf, i=0; icreateDataSet("Dataset3", PredType::STD_REF_OBJ, sid1); - - /* Test parameters to H5Location::reference */ - try { - file1->reference(NULL, "/Group1/Dataset1"); - } catch (ReferenceException& E) {} // We expect this to fail - try { - file1->reference(&wbuf[0], NULL); - } catch (ReferenceException& E) {} // We expect this to fail - try { - file1->reference(&wbuf[0], ""); - } catch (ReferenceException& E) {} // We expect this to fail - try { - file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_MAXTYPE); - } catch (ReferenceException& E) {} // We expect this to fail - try { - file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_DATASET_REGION); - } catch (ReferenceException& E) {} // We expect this to fail - - // Close resources - dataset.close(); - file1->close(); - // Let sid1 go out of scope - - // Free memory buffers - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); - - PASSED(); + // Create dataspace for datasets + hsize_t dims1[] = {SPACE1_DIM1}; + DataSpace sid1(SPACE1_RANK, dims1); + + // Create a group + Group group = file1->createGroup("Group1"); + + // Set group's comment + group.setComment(".", write_comment); + + // Create a dataset (inside /Group1) + DataSet dataset = group.createDataSet(DSET1_NAME, PredType::NATIVE_UINT, sid1); + + unsigned *tu32; // Temporary pointer to uint32 data + int i; + for (tu32=(unsigned *)wbuf, i=0; icreateDataSet("Dataset3", PredType::STD_REF_OBJ, sid1); + + /* Test parameters to H5Location::reference */ + try { + file1->reference(NULL, "/Group1/Dataset1"); + } catch (ReferenceException& E) {} // We expect this to fail + try { + file1->reference(&wbuf[0], NULL); + } catch (ReferenceException& E) {} // We expect this to fail + try { + file1->reference(&wbuf[0], ""); + } catch (ReferenceException& E) {} // We expect this to fail + try { + file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_MAXTYPE); + } catch (ReferenceException& E) {} // We expect this to fail + try { + file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_DATASET_REGION); + } catch (ReferenceException& E) {} // We expect this to fail + + // Close resources + dataset.close(); + file1->close(); + // Let sid1 go out of scope + + // Free memory buffers + HDfree(wbuf); + HDfree(rbuf); + HDfree(tbuf); + + PASSED(); } // end try catch (Exception& E) { - issue_fail_msg("test_reference_param()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + issue_fail_msg("test_reference_param()",__LINE__,__FILE__, + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -182,7 +182,7 @@ test_reference_params(void) /**************************************************************** ** ** test_reference_obj(): Test basic object reference functions -** to various kinds of objects +** to various kinds of objects ** ****************************************************************/ static void test_reference_obj(void) @@ -195,176 +195,176 @@ static void test_reference_obj(void) H5File* file1 = NULL; try { - hobj_ref_t *wbuf, // buffer to write to disk - *rbuf, // buffer read from disk - *tbuf; // temp. buffer read from disk + hobj_ref_t *wbuf, // buffer to write to disk + *rbuf, // buffer read from disk + *tbuf; // temp. buffer read from disk - // Allocate write & read buffers - int temp_size = MAX(sizeof(unsigned),sizeof(hobj_ref_t)); - wbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); - rbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); - tbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + // Allocate write & read buffers + int temp_size = MAX(sizeof(unsigned),sizeof(hobj_ref_t)); + wbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + rbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + tbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); // Create file FILE1 file1 = new H5File (FILE1, H5F_ACC_TRUNC); - // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; - DataSpace sid1(SPACE1_RANK, dims1); + // Create dataspace for datasets + hsize_t dims1[] = {SPACE1_DIM1}; + DataSpace sid1(SPACE1_RANK, dims1); - // Create dataset access property list - PropList dapl(H5P_DATASET_ACCESS); + // Create dataset access property list + PropList dapl(H5P_DATASET_ACCESS); - // Create a group - Group group = file1->createGroup("Group1"); + // Create a group + Group group = file1->createGroup("Group1"); - // Set group's comment - group.setComment(".", write_comment); + // Set group's comment + group.setComment(".", write_comment); - // Create a dataset (inside /Group1) - DataSet dataset = group.createDataSet(DSET1_NAME, PredType::NATIVE_UINT, sid1); + // Create a dataset (inside /Group1) + DataSet dataset = group.createDataSet(DSET1_NAME, PredType::NATIVE_UINT, sid1); - unsigned *tu32; // Temporary pointer to uint32 data - for (tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++) - *tu32++=i*3; // from C test + unsigned *tu32; // Temporary pointer to uint32 data + for (tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++) + *tu32++=i*3; // from C test - // Write selection to disk - dataset.write(wbuf, PredType::NATIVE_UINT); + // Write selection to disk + dataset.write(wbuf, PredType::NATIVE_UINT); - // Close Dataset - dataset.close(); + // Close Dataset + dataset.close(); - // Create another dataset (inside /Group1) - dataset = group.createDataSet("Dataset2", PredType::NATIVE_UCHAR, sid1); + // Create another dataset (inside /Group1) + dataset = group.createDataSet("Dataset2", PredType::NATIVE_UCHAR, sid1); - // Close Dataset - dataset.close(); + // Close Dataset + dataset.close(); - // Create a datatype to refer to - CompType dtype1(sizeof(s1_t)); + // Create a datatype to refer to + CompType dtype1(sizeof(s1_t)); - // Insert fields - dtype1.insertMember(MEMBER1, HOFFSET(s1_t, a), PredType::NATIVE_INT); - dtype1.insertMember(MEMBER2, HOFFSET(s1_t, b), PredType::NATIVE_INT); - dtype1.insertMember(MEMBER3, HOFFSET(s1_t, c), PredType::NATIVE_FLOAT); + // Insert fields + dtype1.insertMember(MEMBER1, HOFFSET(s1_t, a), PredType::NATIVE_INT); + dtype1.insertMember(MEMBER2, HOFFSET(s1_t, b), PredType::NATIVE_INT); + dtype1.insertMember(MEMBER3, HOFFSET(s1_t, c), PredType::NATIVE_FLOAT); - // Save datatype for later - dtype1.commit(group, "Datatype1"); + // Save datatype for later + dtype1.commit(group, "Datatype1"); - // Close datatype and group - dtype1.close(); - group.close(); + // Close datatype and group + dtype1.close(); + group.close(); - // Create a dataset - dataset = file1->createDataSet("Dataset3", PredType::STD_REF_OBJ, sid1); + // Create a dataset + dataset = file1->createDataSet("Dataset3", PredType::STD_REF_OBJ, sid1); - // Create reference to dataset and test getRefObjType - file1->reference(&wbuf[0], "/Group1/Dataset1"); - H5O_type_t refobj_type = dataset.getRefObjType(&wbuf[0], H5R_OBJECT); - verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); + // Create reference to dataset and test getRefObjType + file1->reference(&wbuf[0], "/Group1/Dataset1"); + H5O_type_t refobj_type = dataset.getRefObjType(&wbuf[0], H5R_OBJECT); + verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); - // Create reference to dataset and test getRefObjType - file1->reference(&wbuf[1], "/Group1/Dataset2"); - refobj_type = dataset.getRefObjType(&wbuf[1], H5R_OBJECT); - verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); + // Create reference to dataset and test getRefObjType + file1->reference(&wbuf[1], "/Group1/Dataset2"); + refobj_type = dataset.getRefObjType(&wbuf[1], H5R_OBJECT); + verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); - // Create reference to group - file1->reference(&wbuf[2], "/Group1"); - refobj_type = dataset.getRefObjType(&wbuf[2], H5R_OBJECT); - verify_val(refobj_type, H5O_TYPE_GROUP, "DataSet::getRefObjType",__LINE__,__FILE__); + // Create reference to group + file1->reference(&wbuf[2], "/Group1"); + refobj_type = dataset.getRefObjType(&wbuf[2], H5R_OBJECT); + verify_val(refobj_type, H5O_TYPE_GROUP, "DataSet::getRefObjType",__LINE__,__FILE__); - // Create reference to named datatype - file1->reference(&wbuf[3], "/Group1/Datatype1"); - refobj_type = dataset.getRefObjType(&wbuf[3], H5R_OBJECT); - verify_val(refobj_type, H5O_TYPE_NAMED_DATATYPE, "DataSet::getRefObjType",__LINE__,__FILE__); + // Create reference to named datatype + file1->reference(&wbuf[3], "/Group1/Datatype1"); + refobj_type = dataset.getRefObjType(&wbuf[3], H5R_OBJECT); + verify_val(refobj_type, H5O_TYPE_NAMED_DATATYPE, "DataSet::getRefObjType",__LINE__,__FILE__); - // Write selection to disk - dataset.write(wbuf, PredType::STD_REF_OBJ); + // Write selection to disk + dataset.write(wbuf, PredType::STD_REF_OBJ); - // Close disk dataspace, dataset, and file - sid1.close(); - dataset.close(); - delete file1; + // Close disk dataspace, dataset, and file + sid1.close(); + dataset.close(); + delete file1; - // Re-open the file - file1 = new H5File(FILE1, H5F_ACC_RDWR); + // Re-open the file + file1 = new H5File(FILE1, H5F_ACC_RDWR); - // Open the dataset - dataset = file1->openDataSet("/Dataset3"); + // Open the dataset + dataset = file1->openDataSet("/Dataset3"); - // Read selection from disk - dataset.read(rbuf, PredType::STD_REF_OBJ); + // Read selection from disk + dataset.read(rbuf, PredType::STD_REF_OBJ); - // Dereference dataset object by ctor, from the location where - // 'dataset' is located - DataSet dset2(dataset, &rbuf[0], H5R_OBJECT, dapl); + // Dereference dataset object by ctor, from the location where + // 'dataset' is located + DataSet dset2(dataset, &rbuf[0], H5R_OBJECT, dapl); - // Check information in the referenced dataset - sid1 = dset2.getSpace(); - hssize_t n_elements = sid1.getSimpleExtentNpoints(); - verify_val((long)n_elements, 4, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + // Check information in the referenced dataset + sid1 = dset2.getSpace(); + hssize_t n_elements = sid1.getSimpleExtentNpoints(); + verify_val((long)n_elements, 4, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - // Read from disk - dset2.read(tbuf, PredType::NATIVE_UINT); + // Read from disk + dset2.read(tbuf, PredType::NATIVE_UINT); - for(tu32 = (unsigned *)tbuf, i = 0; i < SPACE1_DIM1; i++, tu32++) - verify_val(*tu32, (uint32_t)(i*3), "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + for(tu32 = (unsigned *)tbuf, i = 0; i < SPACE1_DIM1; i++, tu32++) + verify_val(*tu32, (uint32_t)(i*3), "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - // Close dereferenced dataset - dset2.close(); + // Close dereferenced dataset + dset2.close(); - // Dereference group object from the location where 'dataset' is located - group.dereference(dataset, &rbuf[2]); + // Dereference group object from the location where 'dataset' is located + group.dereference(dataset, &rbuf[2]); - // Get group's comment using - // H5std_string getComment(const char* name, ) - H5std_string read_comment1 = group.getComment(".", 10); - verify_val(read_comment1.c_str(), write_comment, "Group::getComment",__LINE__,__FILE__); + // Get group's comment using + // H5std_string getComment(const char* name, ) + H5std_string read_comment1 = group.getComment(".", 10); + verify_val(read_comment1.c_str(), write_comment, "Group::getComment",__LINE__,__FILE__); - // Test with the old default value - read_comment1 = group.getComment(".", 256); - verify_val(read_comment1.c_str(), write_comment, "Group::getComment",__LINE__,__FILE__); + // Test with the old default value + read_comment1 = group.getComment(".", 256); + verify_val(read_comment1.c_str(), write_comment, "Group::getComment",__LINE__,__FILE__); - // Test that getComment handles failures gracefully, using - // H5std_string getComment(const char* name, ) - try { - H5std_string read_comment_tmp = group.getComment(NULL); - } - catch (Exception& E) {} // We expect this to fail + // Test that getComment handles failures gracefully, using + // H5std_string getComment(const char* name, ) + try { + H5std_string read_comment_tmp = group.getComment(NULL); + } + catch (Exception& E) {} // We expect this to fail - // Close group - group.close(); + // Close group + group.close(); - /* - * Verify correct referenced datatype - */ - // Open datatype object - dtype1.dereference(dataset, &rbuf[3]); + /* + * Verify correct referenced datatype + */ + // Open datatype object + dtype1.dereference(dataset, &rbuf[3]); - // Verify correct datatype + // Verify correct datatype H5T_class_t tclass; tclass = dtype1.getClass(); - verify_val(tclass, H5T_COMPOUND, "DataType::getClass",__LINE__,__FILE__); - int n_members = dtype1.getNmembers(); + verify_val(tclass, H5T_COMPOUND, "DataType::getClass",__LINE__,__FILE__); + int n_members = dtype1.getNmembers(); verify_val(n_members, 3, "CompType::getNmembers",__LINE__,__FILE__); - // Close all objects and file - dtype1.close(); - dataset.close(); - file1->close(); + // Close all objects and file + dtype1.close(); + dataset.close(); + file1->close(); - // Free allocated buffers - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); + // Free allocated buffers + HDfree(wbuf); + HDfree(rbuf); + HDfree(tbuf); - PASSED(); + PASSED(); } // end try catch (Exception& E) { - issue_fail_msg("test_reference_obj()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + issue_fail_msg("test_reference_obj()",__LINE__,__FILE__, + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -376,7 +376,7 @@ static void test_reference_obj(void) ** ** test_reference_group(): Test object reference functionality ** Tests for correct behavior of various routines on -** dereferenced group +** dereferenced group ** ****************************************************************/ #define GROUPNAME "/group" @@ -389,8 +389,8 @@ static void test_reference_obj(void) static void test_reference_group(void) { - hobj_ref_t wref; /* Reference to write */ - hobj_ref_t rref; /* Reference to read */ + hobj_ref_t wref; /* Reference to write */ + hobj_ref_t rref; /* Reference to read */ const H5std_string write_comment="Foo!"; // Comments for group // Output message about test being performed @@ -398,102 +398,102 @@ test_reference_group(void) H5File* file1 = NULL; try { - /* - * Create file with a group and a dataset containing an object - * reference to the group - */ + /* + * Create file with a group and a dataset containing an object + * reference to the group + */ // Create file FILE1 file1 = new H5File (FILE1, H5F_ACC_TRUNC); - // Create scalar dataspace - DataSpace sid1; + // Create scalar dataspace + DataSpace sid1; - // Create a group - Group group = file1->createGroup(GROUPNAME); + // Create a group + Group group = file1->createGroup(GROUPNAME); - /* Create nested groups */ - Group group2 = group.createGroup(GROUPNAME2); - group2.close(); - group2 = group.createGroup(GROUPNAME3); - group2.close(); + /* Create nested groups */ + Group group2 = group.createGroup(GROUPNAME2); + group2.close(); + group2 = group.createGroup(GROUPNAME3); + group2.close(); - // Create bottom dataset - DataSet dset1 = group.createDataSet(DSETNAME2, PredType::NATIVE_INT, sid1); - dset1.close(); + // Create bottom dataset + DataSet dset1 = group.createDataSet(DSETNAME2, PredType::NATIVE_INT, sid1); + dset1.close(); - // Close group 1 - group.close(); + // Close group 1 + group.close(); - // Create dataset - DataSet dset2 = file1->createDataSet(DSETNAME, PredType::STD_REF_OBJ, sid1); + // Create dataset + DataSet dset2 = file1->createDataSet(DSETNAME, PredType::STD_REF_OBJ, sid1); - file1->reference(&wref, GROUPNAME); + file1->reference(&wref, GROUPNAME); - // Write selection to disk - dset2.write(&wref, PredType::STD_REF_OBJ); + // Write selection to disk + dset2.write(&wref, PredType::STD_REF_OBJ); - // Close resources - dset2.close(); - sid1.close(); - file1->close(); + // Close resources + dset2.close(); + sid1.close(); + file1->close(); - /* - * Re-open the file and test deferencing group - */ + /* + * Re-open the file and test deferencing group + */ - // Re-open file + // Re-open file file1->openFile(FILE1, H5F_ACC_RDWR); - // Re-open dataset - dset1 = file1->openDataSet(DSETNAME); + // Re-open dataset + dset1 = file1->openDataSet(DSETNAME); - // Read in the reference - dset1.read(&rref, PredType::STD_REF_OBJ); + // Read in the reference + dset1.read(&rref, PredType::STD_REF_OBJ); - // Dereference to get the group - Group refgroup(dset1, &rref); + // Dereference to get the group + Group refgroup(dset1, &rref); - // Dereference group object the other way - group.dereference(dset1, &rref); + // Dereference group object the other way + group.dereference(dset1, &rref); - /* - * Various queries on the group opened - */ + /* + * Various queries on the group opened + */ - // Check number of objects in the group dereferenced by constructor - hsize_t nobjs = refgroup.getNumObjs(); - verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__); + // Check number of objects in the group dereferenced by constructor + hsize_t nobjs = refgroup.getNumObjs(); + verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__); - // Check number of objects in the group dereferenced by ::reference - nobjs = group.getNumObjs(); - verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__); + // Check number of objects in the group dereferenced by ::reference + nobjs = group.getNumObjs(); + verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__); - // Check getting file name given the group dereferenced via constructor - H5std_string fname = refgroup.getFileName(); - verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); + // Check getting file name given the group dereferenced via constructor + H5std_string fname = refgroup.getFileName(); + verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); - // Check getting file name given the group dereferenced by ::reference - fname = group.getFileName(); - verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); - - // Unlink one of the objects in the dereferenced group, and re-check - refgroup.unlink(GROUPNAME2); - nobjs = refgroup.getNumObjs(); - verify_val(nobjs, (hsize_t)2, "H5Group::getNumObjs",__LINE__,__FILE__); - - // Close resources - group.close(); - refgroup.close(); - dset1.close(); - file1->close(); - - PASSED(); + // Check getting file name given the group dereferenced by ::reference + fname = group.getFileName(); + verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); + + // Unlink one of the objects in the dereferenced group, and re-check + refgroup.unlink(GROUPNAME2); + nobjs = refgroup.getNumObjs(); + verify_val(nobjs, (hsize_t)2, "H5Group::getNumObjs",__LINE__,__FILE__); + + // Close resources + group.close(); + refgroup.close(); + dset1.close(); + file1->close(); + + PASSED(); } // end try catch (Exception& E) { - issue_fail_msg("test_reference_group()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + issue_fail_msg("test_reference_group()",__LINE__,__FILE__, + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -509,283 +509,283 @@ test_reference_group(void) static void test_reference_region_1D(void) { - hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ hsize_t * coords; /* Coordinate buffer */ - hsize_t low[SPACE3_RANK]; /* Selection bounds */ - hsize_t high[SPACE3_RANK]; /* Selection bounds */ + hsize_t low[SPACE3_RANK]; /* Selection bounds */ + hsize_t high[SPACE3_RANK]; /* Selection bounds */ int i; /* counting variables */ // Output message about test being performed SUBTEST("1-D Dataset Region Reference Functions"); try { - hdset_reg_ref_t *wbuf, // buffer to write to disk - *rbuf; // buffer read from disk - uint8_t *dwbuf, // Buffer for writing numeric data to disk - *drbuf; // Buffer for reading numeric data from disk + hdset_reg_ref_t *wbuf, // buffer to write to disk + *rbuf; // buffer read from disk + uint8_t *dwbuf, // Buffer for writing numeric data to disk + *drbuf; // Buffer for reading numeric data from disk - // Allocate write & read buffers - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); - rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); - dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); + // Allocate write & read buffers + wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1); + drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); // Create file FILE1 H5File file1(FILE2, H5F_ACC_TRUNC); - // Create dataspace for datasets - hsize_t dims3[] = {SPACE3_DIM1}; - DataSpace sid3(SPACE3_RANK, dims3); + // Create dataspace for datasets + hsize_t dims3[] = {SPACE3_DIM1}; + DataSpace sid3(SPACE3_RANK, dims3); - // Create dataset access property list - PropList dapl(H5P_DATASET_ACCESS); + // Create dataset access property list + PropList dapl(H5P_DATASET_ACCESS); - // Create a dataset - DataSet dset3 = file1.createDataSet(DSET2_NAME, PredType::STD_U8LE, sid3); + // Create a dataset + DataSet dset3 = file1.createDataSet(DSET2_NAME, PredType::STD_U8LE, sid3); - uint8_t *tu8; // Temporary pointer to uint8 data - for (tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++) - *tu8++ = i * 3; // from C test + uint8_t *tu8; // Temporary pointer to uint8 data + for (tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++) + *tu8++ = i * 3; // from C test - // Write selection to disk - dset3.write(dwbuf, PredType::STD_U8LE); + // Write selection to disk + dset3.write(dwbuf, PredType::STD_U8LE); - // Close Dataset - dset3.close(); + // Close Dataset + dset3.close(); - // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; - DataSpace sid1(SPACE1_RANK, dims1); + // Create dataspace for datasets + hsize_t dims1[] = {SPACE1_DIM1}; + DataSpace sid1(SPACE1_RANK, dims1); - // Create a dataset - DataSet dset1 = file1.createDataSet(DSET1_NAME, PredType::STD_REF_DSETREG, sid1); + // Create a dataset + DataSet dset1 = file1.createDataSet(DSET1_NAME, PredType::STD_REF_DSETREG, sid1); - /* - * Create references and prepare for testing - */ + /* + * Create references and prepare for testing + */ - /* Select 15 2x1 hyperslabs for first reference */ - start[0] = 2; - stride[0] = 5; - count[0] = 15; - block[0] = 2; + /* Select 15 2x1 hyperslabs for first reference */ + start[0] = 2; + stride[0] = 5; + count[0] = 15; + block[0] = 2; - // Select a hyperslab region to add to the current selected region - sid3.selectHyperslab(H5S_SELECT_SET, count, start, stride, block); + // Select a hyperslab region to add to the current selected region + sid3.selectHyperslab(H5S_SELECT_SET, count, start, stride, block); - // Get and verify the number of elements in a dataspace selection - hssize_t nelms = sid3.getSelectNpoints(); - verify_val(nelms, 30, "DataSet::getRefObjType",__LINE__,__FILE__); + // Get and verify the number of elements in a dataspace selection + hssize_t nelms = sid3.getSelectNpoints(); + verify_val(nelms, 30, "DataSet::getRefObjType",__LINE__,__FILE__); - // Store first dataset region - file1.reference(&wbuf[0], "/Dataset2", sid3); + // Store first dataset region + file1.reference(&wbuf[0], "/Dataset2", sid3); - // Get and verify object type - H5O_type_t obj_type = dset1.getRefObjType(&wbuf[0], H5R_DATASET_REGION); - verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); + // Get and verify object type + H5O_type_t obj_type = dset1.getRefObjType(&wbuf[0], H5R_DATASET_REGION); + verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); - /* Select sequence of ten points for second reference */ - coord1[0][0] = 16; - coord1[1][0] = 22; - coord1[2][0] = 38; - coord1[3][0] = 41; - coord1[4][0] = 52; - coord1[5][0] = 63; - coord1[6][0] = 70; - coord1[7][0] = 89; - coord1[8][0] = 97; - coord1[9][0] = 3; - - // Selects array elements to be included in the selection for sid3 - sid3.selectElements(H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1); - - // Get and verify the number of elements in a dataspace selection - nelms = sid3.getSelectNpoints(); - verify_val(nelms, 10, "DataSet::getRefObjType",__LINE__,__FILE__); - - // Store first dataset region - file1.reference(&wbuf[1], "/Dataset2", sid3); - - // Write selection to disk - dset1.write(wbuf, PredType::STD_REF_DSETREG); - - // Close disk dataspace, dataset, and file - sid1.close(); - dset1.close(); - sid3.close(); - file1.close(); - - /* - * Testing various dereference functions - */ - - // Re-open the file - file1.openFile(FILE2, H5F_ACC_RDWR); - - // Open the dataset - dset1 = file1.openDataSet("/Dataset1"); - - // Read selection from disk - dset1.read(rbuf, PredType::STD_REF_DSETREG); - - { // Test DataSet::dereference - dset3.dereference(dset1, &rbuf[0], H5R_DATASET_REGION, dapl); - - // Get and verify object type - obj_type = dset1.getRefObjType(&rbuf[0], H5R_DATASET_REGION); - verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); - - // Get dataspace of dset3 the verify number of elements - sid1 = dset3.getSpace(); - nelms = sid1.getSimpleExtentNpoints(); - verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - } // End of test DataSet::dereference - - { // Test DataSet constructor -by dereference - // Dereference dataset object by ctor, from the location where - // 'dset1' is located - DataSet newds(dset1, &rbuf[0], H5R_DATASET_REGION, dapl); - - // Get dataspace of newds then verify number of elements - sid1 = newds.getSpace(); - nelms = sid1.getSimpleExtentNpoints(); - verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - - // Close objects for this mini test - newds.close(); - sid1.close(); - } // End of test DataSet constructor -by dereference - - // Read from disk - dset3.read(drbuf, PredType::STD_U8LE); - - for(tu8 = (uint8_t *)drbuf, i = 0; i < SPACE3_DIM1; i++, tu8++) - verify_val(*tu8, (uint8_t)(i * 3), "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - - /* - * Test getting the referenced region - */ - - // Get region - DataSpace reg_sp = dset1.getRegion(&rbuf[0]); - - // Get and verify number of elements in a dataspace selection - nelms = reg_sp.getSelectNpoints(); - verify_val((long)nelms, 30, "DataSpace::getSelectNpoints",__LINE__,__FILE__); - - // Get and verify number of hyperslab blocks - nelms = reg_sp.getSelectHyperNblocks(); - verify_val((long)nelms, 15, "DataSpace::getSelectNpoints",__LINE__,__FILE__); - - /* Allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc(nelms * SPACE3_RANK * sizeof(hsize_t) * 2); - - // Get the list of hyperslab blocks currently selected - reg_sp.getSelectHyperBlocklist((hsize_t)0, (hsize_t)nelms, coords); - - // Verify values in the list - verify_val(coords[0], (hsize_t)2, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[1], (hsize_t)3, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[2], (hsize_t)7, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[3], (hsize_t)8, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[4],(hsize_t)12, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[5],(hsize_t)13, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[6],(hsize_t)17, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[7],(hsize_t)18, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[8],(hsize_t)22, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[9],(hsize_t)23, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[10],(hsize_t)27, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[11],(hsize_t)28, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[12],(hsize_t)32, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[13],(hsize_t)33, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[14],(hsize_t)37, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[15],(hsize_t)38, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[16],(hsize_t)42, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[17],(hsize_t)43, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[18],(hsize_t)47, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[19],(hsize_t)48, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[20],(hsize_t)52, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[21],(hsize_t)53, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[22],(hsize_t)57, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[23],(hsize_t)58, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[24],(hsize_t)62, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[25],(hsize_t)63, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[26],(hsize_t)67, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[27],(hsize_t)68, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[28],(hsize_t)72, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[29],(hsize_t)73, "Hyperslab Coordinates",__LINE__,__FILE__); - - HDfree(coords); - - // Check boundaries - reg_sp.getSelectBounds(low, high); - verify_val(low[0],(hsize_t)2, "DataSpace::getSelectBounds",__LINE__,__FILE__); - verify_val(high[0],(hsize_t)73, "DataSpace::getSelectBounds",__LINE__,__FILE__); - - /* Close region space */ - reg_sp.close(); - - /* - * Another test on getting the referenced region - */ - - // Get region - DataSpace elm_sp = dset1.getRegion(&rbuf[1]); - - // Get and verify number of element points in the current selection - hssize_t nelmspts = elm_sp.getSelectElemNpoints(); - verify_val((long)nelmspts, 10, "DataSpace::getSelectNpoints",__LINE__,__FILE__); - - /* Allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc(nelmspts * SPACE3_RANK * sizeof(hsize_t)); - - // Get the list of element points currently selected - elm_sp.getSelectElemPointlist((hsize_t)0, (hsize_t)nelmspts, coords); - - // Verify points - verify_val(coords[0], coord1[0][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[1], coord1[1][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[2], coord1[2][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[3], coord1[3][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[4], coord1[4][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[5], coord1[5][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[6], coord1[6][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[7], coord1[7][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[8], coord1[8][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[9], coord1[9][0], "Element Coordinates",__LINE__,__FILE__); - - HDfree(coords); - - // Check boundaries - elm_sp.getSelectBounds(low, high); - verify_val(low[0],(hsize_t)3, "DataSpace::getSelectBounds",__LINE__,__FILE__); - verify_val(high[0],(hsize_t)97, "DataSpace::getSelectBounds",__LINE__,__FILE__); - - // Close element space - elm_sp.close(); - - // Close resources - sid1.close(); - dset3.close(); - dset1.close(); - file1.close(); - - // Free memory buffers - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); - - PASSED(); + /* Select sequence of ten points for second reference */ + coord1[0][0] = 16; + coord1[1][0] = 22; + coord1[2][0] = 38; + coord1[3][0] = 41; + coord1[4][0] = 52; + coord1[5][0] = 63; + coord1[6][0] = 70; + coord1[7][0] = 89; + coord1[8][0] = 97; + coord1[9][0] = 3; + + // Selects array elements to be included in the selection for sid3 + sid3.selectElements(H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1); + + // Get and verify the number of elements in a dataspace selection + nelms = sid3.getSelectNpoints(); + verify_val(nelms, 10, "DataSet::getRefObjType",__LINE__,__FILE__); + + // Store first dataset region + file1.reference(&wbuf[1], "/Dataset2", sid3); + + // Write selection to disk + dset1.write(wbuf, PredType::STD_REF_DSETREG); + + // Close disk dataspace, dataset, and file + sid1.close(); + dset1.close(); + sid3.close(); + file1.close(); + + /* + * Testing various dereference functions + */ + + // Re-open the file + file1.openFile(FILE2, H5F_ACC_RDWR); + + // Open the dataset + dset1 = file1.openDataSet("/Dataset1"); + + // Read selection from disk + dset1.read(rbuf, PredType::STD_REF_DSETREG); + + { // Test DataSet::dereference + dset3.dereference(dset1, &rbuf[0], H5R_DATASET_REGION, dapl); + + // Get and verify object type + obj_type = dset1.getRefObjType(&rbuf[0], H5R_DATASET_REGION); + verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); + + // Get dataspace of dset3 the verify number of elements + sid1 = dset3.getSpace(); + nelms = sid1.getSimpleExtentNpoints(); + verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + } // End of test DataSet::dereference + + { // Test DataSet constructor -by dereference + // Dereference dataset object by ctor, from the location where + // 'dset1' is located + DataSet newds(dset1, &rbuf[0], H5R_DATASET_REGION, dapl); + + // Get dataspace of newds then verify number of elements + sid1 = newds.getSpace(); + nelms = sid1.getSimpleExtentNpoints(); + verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + + // Close objects for this mini test + newds.close(); + sid1.close(); + } // End of test DataSet constructor -by dereference + + // Read from disk + dset3.read(drbuf, PredType::STD_U8LE); + + for(tu8 = (uint8_t *)drbuf, i = 0; i < SPACE3_DIM1; i++, tu8++) + verify_val(*tu8, (uint8_t)(i * 3), "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + + /* + * Test getting the referenced region + */ + + // Get region + DataSpace reg_sp = dset1.getRegion(&rbuf[0]); + + // Get and verify number of elements in a dataspace selection + nelms = reg_sp.getSelectNpoints(); + verify_val((long)nelms, 30, "DataSpace::getSelectNpoints",__LINE__,__FILE__); + + // Get and verify number of hyperslab blocks + nelms = reg_sp.getSelectHyperNblocks(); + verify_val((long)nelms, 15, "DataSpace::getSelectNpoints",__LINE__,__FILE__); + + /* Allocate space for the hyperslab blocks */ + coords = (hsize_t *)HDmalloc(nelms * SPACE3_RANK * sizeof(hsize_t) * 2); + + // Get the list of hyperslab blocks currently selected + reg_sp.getSelectHyperBlocklist((hsize_t)0, (hsize_t)nelms, coords); + + // Verify values in the list + verify_val(coords[0], (hsize_t)2, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[1], (hsize_t)3, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[2], (hsize_t)7, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[3], (hsize_t)8, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[4],(hsize_t)12, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[5],(hsize_t)13, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[6],(hsize_t)17, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[7],(hsize_t)18, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[8],(hsize_t)22, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[9],(hsize_t)23, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[10],(hsize_t)27, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[11],(hsize_t)28, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[12],(hsize_t)32, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[13],(hsize_t)33, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[14],(hsize_t)37, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[15],(hsize_t)38, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[16],(hsize_t)42, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[17],(hsize_t)43, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[18],(hsize_t)47, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[19],(hsize_t)48, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[20],(hsize_t)52, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[21],(hsize_t)53, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[22],(hsize_t)57, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[23],(hsize_t)58, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[24],(hsize_t)62, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[25],(hsize_t)63, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[26],(hsize_t)67, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[27],(hsize_t)68, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[28],(hsize_t)72, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[29],(hsize_t)73, "Hyperslab Coordinates",__LINE__,__FILE__); + + HDfree(coords); + + // Check boundaries + reg_sp.getSelectBounds(low, high); + verify_val(low[0],(hsize_t)2, "DataSpace::getSelectBounds",__LINE__,__FILE__); + verify_val(high[0],(hsize_t)73, "DataSpace::getSelectBounds",__LINE__,__FILE__); + + /* Close region space */ + reg_sp.close(); + + /* + * Another test on getting the referenced region + */ + + // Get region + DataSpace elm_sp = dset1.getRegion(&rbuf[1]); + + // Get and verify number of element points in the current selection + hssize_t nelmspts = elm_sp.getSelectElemNpoints(); + verify_val((long)nelmspts, 10, "DataSpace::getSelectNpoints",__LINE__,__FILE__); + + /* Allocate space for the hyperslab blocks */ + coords = (hsize_t *)HDmalloc(nelmspts * SPACE3_RANK * sizeof(hsize_t)); + + // Get the list of element points currently selected + elm_sp.getSelectElemPointlist((hsize_t)0, (hsize_t)nelmspts, coords); + + // Verify points + verify_val(coords[0], coord1[0][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[1], coord1[1][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[2], coord1[2][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[3], coord1[3][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[4], coord1[4][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[5], coord1[5][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[6], coord1[6][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[7], coord1[7][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[8], coord1[8][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[9], coord1[9][0], "Element Coordinates",__LINE__,__FILE__); + + HDfree(coords); + + // Check boundaries + elm_sp.getSelectBounds(low, high); + verify_val(low[0],(hsize_t)3, "DataSpace::getSelectBounds",__LINE__,__FILE__); + verify_val(high[0],(hsize_t)97, "DataSpace::getSelectBounds",__LINE__,__FILE__); + + // Close element space + elm_sp.close(); + + // Close resources + sid1.close(); + dset3.close(); + dset1.close(); + file1.close(); + + // Free memory buffers + HDfree(wbuf); + HDfree(rbuf); + HDfree(dwbuf); + HDfree(drbuf); + + PASSED(); } // end try catch (Exception& E) { - issue_fail_msg("test_reference_region_1D()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + issue_fail_msg("test_reference_region_1D()",__LINE__,__FILE__, + E.getCFuncName(), E.getCDetailMsg()); } } /* test_reference_region_1D() */ @@ -823,9 +823,9 @@ void test_reference(void) /**************************************************************** -** Function: cleanup_reference -** Purpose: Cleanup temporary test files -** Return: none +** Function: cleanup_reference +** Purpose Cleanup temporary test files +** Return none ****************************************************************/ extern "C" void cleanup_reference(void) diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 6605c03..0cc8918 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -37,7 +37,7 @@ using namespace H5; * Offset from alinged memory returned by malloc(). This can be used to test * that type conversions handle non-aligned buffers correctly. */ -#define ALIGNMENT 1 +#define ALIGNMENT 1 /* * Define if you want to test alignment code on a machine that doesn't @@ -70,7 +70,7 @@ const char *FILENAME[] = { * endian. If local variable `endian' is H5T_ORDER_BE then the result will * be I, otherwise the result will be Z-(I+1). */ -#define ENDIAN(Z,I) (H5T_ORDER_BE==endian?(I):(Z)-((I)+1)) +#define ENDIAN(Z,I) (H5T_ORDER_BE==endian?(I):(Z)-((I)+1)) typedef enum flt_t { @@ -86,12 +86,12 @@ typedef enum int_t { /*------------------------------------------------------------------------- * Function: test_classes * - * Purpose: Test type classes + * Purpose Test type classes * - * Return: None. + * Return None. * - * Programmer: Binh-Minh Ribler (using C version) - * January, 2007 + * Programmer Binh-Minh Ribler (using C version) + * January, 2007 * * Modifications: * @@ -101,38 +101,38 @@ static void test_classes() { SUBTEST("PredType::getClass()"); try { - // maybe later, int curr_nerrors = GetTestNumErrs(); - - // PredType::NATIVE_INT should be in H5T_INTEGER class - H5T_class_t tcls = PredType::NATIVE_INT.getClass(); - if (H5T_INTEGER!=tcls) { - puts(" Invalid type class for H5T_NATIVE_INT"); - } - - // PredType::NATIVE_DOUBLE should be in H5T_FLOAT class - tcls = PredType::NATIVE_DOUBLE.getClass(); - if (H5T_FLOAT!=tcls) { - verify_val(tcls, H5T_FLOAT, "test_class: invalid type class for NATIVE_DOUBLE -", __LINE__, __FILE__); - } - PASSED(); + // maybe later, int curr_nerrors = GetTestNumErrs(); + + // PredType::NATIVE_INT should be in H5T_INTEGER class + H5T_class_t tcls = PredType::NATIVE_INT.getClass(); + if (H5T_INTEGER!=tcls) { + puts(" Invalid type class for H5T_NATIVE_INT"); + } + + // PredType::NATIVE_DOUBLE should be in H5T_FLOAT class + tcls = PredType::NATIVE_DOUBLE.getClass(); + if (H5T_FLOAT!=tcls) { + verify_val(tcls, H5T_FLOAT, "test_class: invalid type class for NATIVE_DOUBLE -", __LINE__, __FILE__); + } + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_classes", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_classes", __LINE__, __FILE__, E.getCDetailMsg()); } } /*------------------------------------------------------------------------- * Function: test_copy * - * Purpose: Test datatype copy functionality + * Purpose Test datatype copy functionality * - * Return: Success: 0 + * Return Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Binh-Minh Ribler (using C version) - * January, 2007 + * Programmer Binh-Minh Ribler (using C version) + * January, 2007 * * Modifications: * @@ -143,21 +143,21 @@ static void test_copy() SUBTEST("DataType::copy() and DataType::operator="); try { - // Test copying from a predefined datatype using DataType::operator= - DataType assigned_type; - assigned_type = PredType::NATIVE_SHORT; + // Test copying from a predefined datatype using DataType::operator= + DataType assigned_type; + assigned_type = PredType::NATIVE_SHORT; // Test copying a predefined type using DataType::copy - DataType copied_type; + DataType copied_type; copied_type.copy (PredType::STD_B8LE); - // Test copying a user-defined type using DataType::operator= - DataType assigned_usertype; - assigned_usertype = copied_type; + // Test copying a user-defined type using DataType::operator= + DataType assigned_usertype; + assigned_usertype = copied_type; - // Test copying from a user-defined datatype using DataType::copy - DataType copied_usertype; - copied_usertype.copy(copied_type); + // Test copying from a user-defined datatype using DataType::copy + DataType copied_usertype; + copied_usertype.copy(copied_type); // Test copying a user-defined int type using DataType::operator= IntType orig_int(PredType::STD_B8LE); @@ -171,26 +171,26 @@ static void test_copy() IntType another_int_type; another_int_type = new_int_type; - PASSED(); + PASSED(); } catch (Exception& E) { - issue_fail_msg("test_copy", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_copy", __LINE__, __FILE__, E.getCDetailMsg()); } } /*------------------------------------------------------------------------- - * Function: test_query + * Function: test_query * - * Purpose: Tests query functions of compound and enumeration types. + * Purpose Tests query functions of compound and enumeration types. * - * Return: Success: 0 + * Return Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -203,113 +203,113 @@ const H5std_string EnumT_NAME("Enum_type"); static void test_query() { typedef struct { - int a; - float b; - long c; - double d; + int a; + float b; + long c; + double d; } src_typ_t; - short enum_val; + short enum_val; // Output message about test being performed SUBTEST("Query functions of compound and enumeration types"); try { - // Create File - H5File file(FILENAME[2], H5F_ACC_TRUNC); - - // Create a compound datatype - CompType tid1(sizeof(src_typ_t)); - - tid1.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); - tid1.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_FLOAT); - tid1.insertMember("c", HOFFSET(src_typ_t, c), PredType::NATIVE_LONG); - tid1.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_DOUBLE); - - // Create a enumerate datatype - EnumType tid2(sizeof(short)); - - tid2.insert("RED", (enum_val=0,&enum_val)); - tid2.insert("GREEN", (enum_val=1,&enum_val)); - tid2.insert("BLUE", (enum_val=2,&enum_val)); - tid2.insert("ORANGE", (enum_val=3,&enum_val)); - tid2.insert("YELLOW", (enum_val=4,&enum_val)); - - // Query member number and member index by name, for compound type - int nmembs = tid1.getNmembers(); - verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__); - - int index = tid1.getMemberIndex("c"); - verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__); - - // Query member number and member index by name, for enumeration type. - nmembs = tid2.getNmembers(); - verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__); - - index = tid2.getMemberIndex("ORANGE"); - verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__); - - // Commit compound datatype and close it - tid1.commit(file, CompT_NAME); - tid1.close(); - - // Commit enumeration datatype and close it - tid2.commit(file, EnumT_NAME); - tid2.close(); - - // Open the datatypes for query - - // Deprecated functions - tid1 = file.openCompType(CompT_NAME); - tid1.close(); - tid2 = file.openEnumType(EnumT_NAME); - tid2.close(); - - CompType comptype(file, CompT_NAME); - EnumType enumtype(file, EnumT_NAME); - - // Query member number and member index by name, for compound type - nmembs = comptype.getNmembers(); - verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__); - index = comptype.getMemberIndex("c"); - verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__); - - // Query member number and member index by name, for enumeration type - nmembs = enumtype.getNmembers(); - verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__); - index = enumtype.getMemberIndex("ORANGE"); - verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__); - - // Close datatypes and file - comptype.close(); - enumtype.close(); - file.close(); - - // Try truncating the file to make sure reference counting is good. - // If any references to ids of the accessed types are left unterminated, - // the truncating will fail, because the file will not be closed in - // the file.close() above. - H5File file1(FILENAME[2], H5F_ACC_TRUNC); - - PASSED(); + // Create File + H5File file(FILENAME[2], H5F_ACC_TRUNC); + + // Create a compound datatype + CompType tid1(sizeof(src_typ_t)); + + tid1.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + tid1.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_FLOAT); + tid1.insertMember("c", HOFFSET(src_typ_t, c), PredType::NATIVE_LONG); + tid1.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_DOUBLE); + + // Create a enumerate datatype + EnumType tid2(sizeof(short)); + + tid2.insert("RED", (enum_val=0,&enum_val)); + tid2.insert("GREEN", (enum_val=1,&enum_val)); + tid2.insert("BLUE", (enum_val=2,&enum_val)); + tid2.insert("ORANGE", (enum_val=3,&enum_val)); + tid2.insert("YELLOW", (enum_val=4,&enum_val)); + + // Query member number and member index by name, for compound type + int nmembs = tid1.getNmembers(); + verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__); + + int index = tid1.getMemberIndex("c"); + verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__); + + // Query member number and member index by name, for enumeration type. + nmembs = tid2.getNmembers(); + verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__); + + index = tid2.getMemberIndex("ORANGE"); + verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__); + + // Commit compound datatype and close it + tid1.commit(file, CompT_NAME); + tid1.close(); + + // Commit enumeration datatype and close it + tid2.commit(file, EnumT_NAME); + tid2.close(); + + // Open the datatypes for query + + // Deprecated functions + tid1 = file.openCompType(CompT_NAME); + tid1.close(); + tid2 = file.openEnumType(EnumT_NAME); + tid2.close(); + + CompType comptype(file, CompT_NAME); + EnumType enumtype(file, EnumT_NAME); + + // Query member number and member index by name, for compound type + nmembs = comptype.getNmembers(); + verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__); + index = comptype.getMemberIndex("c"); + verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__); + + // Query member number and member index by name, for enumeration type + nmembs = enumtype.getNmembers(); + verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__); + index = enumtype.getMemberIndex("ORANGE"); + verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__); + + // Close datatypes and file + comptype.close(); + enumtype.close(); + file.close(); + + // Try truncating the file to make sure reference counting is good. + // If any references to ids of the accessed types are left unterminated, + // the truncating will fail, because the file will not be closed in + // the file.close() above. + H5File file1(FILENAME[2], H5F_ACC_TRUNC); + + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_query", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_query", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_query /*------------------------------------------------------------------------- - * Function: test_transient + * Function: test_transient * - * Purpose: Tests transient datatypes. + * Purpose Tests transient datatypes. * - * Return: Success: 0 + * Return Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -318,58 +318,58 @@ static void test_query() const char* filename1 = "dtypes1.h5"; static void test_transient () { - static hsize_t ds_size[2] = {10, 20}; + static hsize_t ds_size[2] = {10, 20}; SUBTEST("Transient datatypes"); try { - // Create the file and the dataspace. - H5File file(filename1, H5F_ACC_TRUNC); - DataSpace space(2, ds_size, ds_size); - - // Copying a predefined type results in a modifiable copy - IntType type(PredType::NATIVE_INT); - type.setPrecision(256); - - // It should not be possible to create an attribute for a transient type - try { - Attribute attr(type.createAttribute("attr1", PredType::NATIVE_INT, space)); - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5Object::createAttribute", "Attempted to commit a predefined datatype."); - } catch (AttributeIException& err) {} // do nothing, failure expected - - // Create a dataset from a transient datatype - // type.close(); - put trace in H5Tclose to make sure it's closed - type.copy(PredType::NATIVE_INT); - DataSet dset(file.createDataSet("dset1", type, space)); - - // The type returned from a dataset should not be modifiable - IntType itype(dset); - try { - itype.setPrecision(256); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("PredType::setPrecision", "Dataset datatypes should not be modifiable!"); - } catch (DataTypeIException& err) {} - itype.close(); - - // Get a copy of the dataset's datatype by applying DataType::copy() - // to the dataset. The resulted datatype should be modifiable. - itype.copy(dset); - itype.setPrecision(256); - itype.close(); - - // Close the dataset and reopen it, testing that its type is still - // read-only. (Note that a copy of it is modifiable.) - dset.close(); - dset = file.openDataSet("dset1"); - - // Close objects and file. - dset.close(); - file.close(); - type.close(); - space.close(); - PASSED(); + // Create the file and the dataspace. + H5File file(filename1, H5F_ACC_TRUNC); + DataSpace space(2, ds_size, ds_size); + + // Copying a predefined type results in a modifiable copy + IntType type(PredType::NATIVE_INT); + type.setPrecision(256); + + // It should not be possible to create an attribute for a transient type + try { + Attribute attr(type.createAttribute("attr1", PredType::NATIVE_INT, space)); + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5Object::createAttribute", "Attempted to commit a predefined datatype."); + } catch (AttributeIException& err) {} // do nothing, failure expected + + // Create a dataset from a transient datatype + // type.close(); - put trace in H5Tclose to make sure it's closed + type.copy(PredType::NATIVE_INT); + DataSet dset(file.createDataSet("dset1", type, space)); + + // The type returned from a dataset should not be modifiable + IntType itype(dset); + try { + itype.setPrecision(256); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("PredType::setPrecision", "Dataset datatypes should not be modifiable!"); + } catch (DataTypeIException& err) {} + itype.close(); + + // Get a copy of the dataset's datatype by applying DataType::copy() + // to the dataset. The resulted datatype should be modifiable. + itype.copy(dset); + itype.setPrecision(256); + itype.close(); + + // Close the dataset and reopen it, testing that its type is still + // read-only. (Note that a copy of it is modifiable.) + dset.close(); + dset = file.openDataSet("dset1"); + + // Close objects and file. + dset.close(); + file.close(); + type.close(); + space.close(); + PASSED(); } // end of try block catch (Exception& E) { @@ -379,16 +379,16 @@ static void test_transient () /*------------------------------------------------------------------------- - * Function: test_named + * Function: test_named * - * Purpose: Tests named datatypes. + * Purpose Tests named datatypes. * - * Return: Success: 0 + * Return Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -397,141 +397,141 @@ static void test_transient () const H5std_string filename2("dtypes2.h5"); static void test_named () { - static hsize_t ds_size[2] = {10, 20}; - hsize_t i; - unsigned attr_data[10][20]; - DataType *ds_type = NULL; + static hsize_t ds_size[2] = {10, 20}; + hsize_t i; + unsigned attr_data[10][20]; + DataType *ds_type = NULL; SUBTEST("Named datatypes"); try { - // Create the file. - H5File file(filename2, H5F_ACC_TRUNC); + // Create the file. + H5File file(filename2, H5F_ACC_TRUNC); - // Create a simple dataspace. - DataSpace space(2, ds_size, ds_size); + // Create a simple dataspace. + DataSpace space(2, ds_size, ds_size); - // Predefined types cannot be committed. - try { - PredType nativeint(PredType::NATIVE_INT); - nativeint.commit(file, "test_named_1 (should not exist)"); + // Predefined types cannot be committed. + try { + PredType nativeint(PredType::NATIVE_INT); + nativeint.commit(file, "test_named_1 (should not exist)"); - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("PredType::commit", "Attempted to commit a predefined datatype."); - } catch (DataTypeIException& err) {} + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("PredType::commit", "Attempted to commit a predefined datatype."); + } catch (DataTypeIException& err) {} - // Copy a predefined datatype and commit the copy. + // Copy a predefined datatype and commit the copy. IntType itype(PredType::NATIVE_INT); itype.commit(file, "native-int"); - // Test commit passing in const H5File& for prototype with const - try - { - // Create random char type - IntType atype(PredType::NATIVE_UCHAR); + // Test commit passing in const H5File& for prototype with const + try + { + // Create random char type + IntType atype(PredType::NATIVE_UCHAR); - // Creating group, declared as const - const Group const_grp = file.createGroup("GR as loc"); + // Creating group, declared as const + const Group const_grp = file.createGroup("GR as loc"); - // Commit type passing in const group; compilation would fail if - // no matching prototype - atype.commit(const_grp, "random uchar"); - } // end of try block - catch (Exception& E) + // Commit type passing in const group; compilation would fail if + // no matching prototype + atype.commit(const_grp, "random uchar"); + } // end of try block + catch (Exception& E) { - issue_fail_msg("test_named", __LINE__, __FILE__, "Commit at const group"); - } - - // Check that it is committed. - if (itype.committed() == false) - cerr << "IntType::committed() returned false" << endl; - - // We should not be able to modify a type after it has been committed. - try { - itype.setPrecision(256); // attempt an invalid action... - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("IntType::setPrecision", "Attempted to modify a committed datatype."); - } catch (DataTypeIException& err) {} - - // We should not be able to re-commit a committed type - try { - itype.commit(file, "test_named_2 (should not exist)"); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("IntType::commit", "Attempted to re-commit a committed datatype."); - } catch (DataTypeIException& err) {} // do nothing, failure expected - - // It should be possible to define an attribute for the named type - Attribute attr1 = itype.createAttribute("attr1", PredType::NATIVE_UCHAR, space); - for (i=0; icommitted(); - if (!iscommitted) - throw InvalidActionException("IntType::committed()", "Dataset type should be named type!"); - dset.close(); - ds_type->close(); + issue_fail_msg("test_named", __LINE__, __FILE__, "Commit at const group"); + } + + // Check that it is committed. + if (itype.committed() == false) + cerr << "IntType::committed() returned false" << endl; + + // We should not be able to modify a type after it has been committed. + try { + itype.setPrecision(256); // attempt an invalid action... + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("IntType::setPrecision", "Attempted to modify a committed datatype."); + } catch (DataTypeIException& err) {} + + // We should not be able to re-commit a committed type + try { + itype.commit(file, "test_named_2 (should not exist)"); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("IntType::commit", "Attempted to re-commit a committed datatype."); + } catch (DataTypeIException& err) {} // do nothing, failure expected + + // It should be possible to define an attribute for the named type + Attribute attr1 = itype.createAttribute("attr1", PredType::NATIVE_UCHAR, space); + for (i=0; icommitted(); + if (!iscommitted) + throw InvalidActionException("IntType::committed()", "Dataset type should be named type!"); + dset.close(); + ds_type->close(); delete ds_type; - // Reopen the dataset and its type, then make sure the type is - // a named type. - dset = file.openDataSet("dset1"); - ds_type = new DataType(dset.getDataType()); - iscommitted = ds_type->committed(); - if (!iscommitted) - throw InvalidActionException("IntType::committed()", "Dataset type should be named type!"); - - // Close the dataset and create another with the type returned from - // the first dataset. - dset.close(); - dset = file.createDataSet("dset2", *ds_type, space); - ds_type->close(); - dset.close(); + // Reopen the dataset and its type, then make sure the type is + // a named type. + dset = file.openDataSet("dset1"); + ds_type = new DataType(dset.getDataType()); + iscommitted = ds_type->committed(); + if (!iscommitted) + throw InvalidActionException("IntType::committed()", "Dataset type should be named type!"); + + // Close the dataset and create another with the type returned from + // the first dataset. + dset.close(); + dset = file.createDataSet("dset2", *ds_type, space); + ds_type->close(); + dset.close(); delete ds_type; - // Reopen the second dataset and make sure the type is shared - dset = file.openDataSet("dset2"); - ds_type = new DataType(dset.getDataType()); - iscommitted = ds_type->committed(); - if (!iscommitted) - throw InvalidActionException("DataType::iscommitted()", "Dataset type should be named type!"); - ds_type->close(); - - // Get the dataset datatype by applying DataType::copy() to the - // dataset. The resulted datatype should be modifiable. - IntType copied_type; - copied_type.copy(dset); - copied_type.setPrecision(256); - copied_type.close(); - - // Clean up - dset.close(); - itype.close(); - space.close(); - file.close(); - PASSED(); + // Reopen the second dataset and make sure the type is shared + dset = file.openDataSet("dset2"); + ds_type = new DataType(dset.getDataType()); + iscommitted = ds_type->committed(); + if (!iscommitted) + throw InvalidActionException("DataType::iscommitted()", "Dataset type should be named type!"); + ds_type->close(); + + // Get the dataset datatype by applying DataType::copy() to the + // dataset. The resulted datatype should be modifiable. + IntType copied_type; + copied_type.copy(dset); + copied_type.setPrecision(256); + copied_type.close(); + + // Clean up + dset.close(); + itype.close(); + space.close(); + file.close(); + PASSED(); } // end of try block catch (Exception& E) { @@ -565,14 +565,14 @@ void test_types() /*------------------------------------------------------------------------- - * Function: cleanup_types + * Function: cleanup_types * - * Purpose: Cleanup temporary test files + * Purpose Cleanup temporary test files * - * Return: none + * Return none * - * Programmer: Quincey Koziol - * September 10, 1999 + * Programmer Quincey Koziol + * September 10, 1999 * * Modifications: * @@ -582,5 +582,5 @@ extern "C" void cleanup_types() { for (int i = 0; i < 3; i++) - HDremove(FILENAME[i]); + HDremove(FILENAME[i]); } // cleanup_types diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index 43dcc0b..5dee1a2 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -45,9 +45,9 @@ const hsize_t SPACE1_DIM1 = 4; /**************************************************************** ** ** test_vlstr_alloc_custom(): Test VL datatype custom memory -** allocation routines. This routine just uses malloc to -** allocate the memory and increments the amount of memory -** allocated. It is passed into setVlenMemManager. +** allocation routines. This routine just uses malloc to +** allocate the memory and increments the amount of memory +** allocated. It is passed into setVlenMemManager. ** ** Note: exact copy from the C version. ** (Not used now) @@ -55,9 +55,9 @@ const hsize_t SPACE1_DIM1 = 4; #if 0 // not used now static void *test_vlstr_alloc_custom(size_t size, void *info) { - void *ret_value=NULL; // Pointer to return + void *ret_value=NULL; // Pointer to return size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -67,8 +67,8 @@ static void *test_vlstr_alloc_custom(size_t size, void *info) extra=MAX(sizeof(void *),sizeof(size_t)); if((ret_value=HDmalloc(extra+size))!=NULL) { - *(size_t *)ret_value=size; - *mem_used+=size; + *(size_t *)ret_value=size; + *mem_used+=size; } // end if ret_value = ((unsigned char *)ret_value) + extra; @@ -79,9 +79,9 @@ static void *test_vlstr_alloc_custom(size_t size, void *info) /**************************************************************** ** ** test_vlstr_free_custom(): Test VL datatype custom memory -** allocation routines. This routine just uses free to -** release the memory and decrements the amount of memory -** allocated. It is passed into setVlenMemManager. +** allocation routines. This routine just uses free to +** release the memory and decrements the amount of memory +** allocated. It is passed into setVlenMemManager. ** ** Note: exact copy from the C version. ** (Not used now) @@ -91,7 +91,7 @@ static void test_vlstr_free_custom(void *_mem, void *info) { unsigned char *mem; size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -109,14 +109,14 @@ static void test_vlstr_free_custom(void *_mem, void *info) #endif /*------------------------------------------------------------------------- - * Function: test_vlstring_dataset + * Function: test_vlstring_dataset * - * Purpose: Test writing/reading VL strings on datasets. + * Purpose Test writing/reading VL strings on datasets. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer Binh-Minh Ribler (use C version) + * January, 2007 * *------------------------------------------------------------------------- */ @@ -136,89 +136,89 @@ static void test_vlstring_dataset() SUBTEST("VL String on Datasets"); try { - // Open the file - H5File file1(FILENAME, H5F_ACC_TRUNC); + // Open the file + H5File file1(FILENAME, H5F_ACC_TRUNC); - // Create a datatype to refer to. - StrType vlst(0, H5T_VARIABLE); + // Create a datatype to refer to. + StrType vlst(0, H5T_VARIABLE); - // Open the root group. - Group root = file1.openGroup("/"); + // Open the root group. + Group root = file1.openGroup("/"); - // Create dataspace for the dataset. - DataSpace ds_space (H5S_SCALAR); + // Create dataspace for the dataset. + DataSpace ds_space (H5S_SCALAR); - // Create an dataset in the root group. - DataSet dset1 = root.createDataSet(DSET1_NAME, vlst, ds_space); + // Create an dataset in the root group. + DataSet dset1 = root.createDataSet(DSET1_NAME, vlst, ds_space); - // Write data to the dataset. - dset1.write(DSET1_DATA, vlst); + // Write data to the dataset. + dset1.write(DSET1_DATA, vlst); - // Read and verify the dataset string as a string of chars. - dset1.read(&string_ds_check, vlst); - if(HDstrcmp(string_ds_check, DSET1_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,string_ds_check=%s\n",__LINE__, DSET1_DATA.c_str(), string_ds_check); + // Read and verify the dataset string as a string of chars. + dset1.read(&string_ds_check, vlst); + if(HDstrcmp(string_ds_check, DSET1_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,string_ds_check=%s\n",__LINE__, DSET1_DATA.c_str(), string_ds_check); - HDfree(string_ds_check); // note: no need for std::string test + HDfree(string_ds_check); // note: no need for std::string test string_ds_check = NULL; - // Read and verify the dataset string as an std::string. - H5std_string read_str; - dset1.read(read_str, vlst); - if (read_str != DSET1_DATA) - TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,read_str=%s\n",__LINE__, DSET1_DATA.c_str(), read_str.c_str()); + // Read and verify the dataset string as an std::string. + H5std_string read_str; + dset1.read(read_str, vlst); + if (read_str != DSET1_DATA) + TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,read_str=%s\n",__LINE__, DSET1_DATA.c_str(), read_str.c_str()); - // Close the dataset. - dset1.close(); + // Close the dataset. + dset1.close(); - // Test scalar type dataset with 1 value. - dset1 = root.createDataSet("test_scalar_small", vlst, ds_space); + // Test scalar type dataset with 1 value. + dset1 = root.createDataSet("test_scalar_small", vlst, ds_space); - dynstring_ds_write = (char*)HDcalloc(1, sizeof(char)); - HDmemset(dynstring_ds_write, 'A', 1); + dynstring_ds_write = (char*)HDcalloc(1, sizeof(char)); + HDmemset(dynstring_ds_write, 'A', 1); - // Write data to the dataset, then read it back. - dset1.write(&dynstring_ds_write, vlst); - dset1.read(&string_ds_check, vlst); + // Write data to the dataset, then read it back. + dset1.write(&dynstring_ds_write, vlst); + dset1.read(&string_ds_check, vlst); - // Verify data read. - if(HDstrcmp(string_ds_check,dynstring_ds_write)!=0) - TestErrPrintf("VL string datasets don't match!, dynstring_ds_write=%s, string_ds_check=%s\n",dynstring_ds_write,string_ds_check); - HDfree(string_ds_check); + // Verify data read. + if(HDstrcmp(string_ds_check,dynstring_ds_write)!=0) + TestErrPrintf("VL string datasets don't match!, dynstring_ds_write=%s, string_ds_check=%s\n",dynstring_ds_write,string_ds_check); + HDfree(string_ds_check); string_ds_check = NULL; - dset1.close(); + dset1.close(); - // Open dataset DSET1_NAME again. - dset1 = root.openDataSet(DSET1_NAME); + // Open dataset DSET1_NAME again. + dset1 = root.openDataSet(DSET1_NAME); - // Close dataset and file - dset1.close(); - file1.close(); + // Close dataset and file + dset1.close(); + file1.close(); - PASSED(); + PASSED(); } // end try block // Catch all exceptions. catch (Exception& E) { - issue_fail_msg("test_vlstring_dataset()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_vlstring_dataset()", __LINE__, __FILE__, E.getCDetailMsg()); } if(dynstring_ds_write) HDfree(dynstring_ds_write); if(string_ds_check) - HDfree(string_ds_check); + HDfree(string_ds_check); } // test_vlstring_dataset() /*------------------------------------------------------------------------- - * Function: test_vlstring_array_dataset + * Function: test_vlstring_array_dataset * - * Purpose: Test writing/reading VL string array to/from datasets. + * Purpose Test writing/reading VL string array to/from datasets. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler - * July, 2009 + * Programmer Binh-Minh Ribler + * July, 2009 * *------------------------------------------------------------------------- */ @@ -235,89 +235,89 @@ static void test_vlstring_array_dataset() H5File* file1 = NULL; try { // Create file. - file1 = new H5File(FILENAME, H5F_ACC_RDWR); + file1 = new H5File(FILENAME, H5F_ACC_RDWR); // Create dataspace for datasets. hsize_t dims1[] = {SPACE1_DIM1}; DataSpace ds_space(SPACE1_RANK, dims1); - // Create a datatype to refer to. - StrType vlst(0, H5T_VARIABLE); - - // Create and write a dataset. - DataSet dataset(file1->createDataSet(DSSTRARR_NAME, vlst, ds_space)); - dataset.write(string_ds_array, vlst); - - // Read and verify the dataset using strings of chars as buffer. - // Note: reading by array of H5std_string doesn't work yet. - char *string_ds_check[SPACE1_DIM1]; - dataset.read(string_ds_check, vlst); - - hsize_t ii; - for (ii = 0; ii < SPACE1_DIM1; ii++) - { - if(HDstrcmp(string_ds_check[ii], string_ds_array[ii])!=0) - TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]); - - HDfree(string_ds_check[ii]); - } - - // Close objects that are no longer needed. - dataset.close(); - ds_space.close(); - - // - // Test with scalar data space. - // - - // Create H5S_SCALAR data space. - DataSpace scalar_space; - - // Create and write another dataset. - DataSet dataset2(file1->createDataSet("Dataset2", vlst, scalar_space)); - char *wdata2 = (char*)HDcalloc(65534, sizeof(char)); - HDmemset(wdata2, 'A', 65533); - dataset2.write(&wdata2, vlst); - - char *rdata2; - dataset2.read(&rdata2, vlst); - if (HDstrcmp(wdata2, rdata2)!=0) - TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, wdata2, rdata2); - - // Release resources from second dataset operation. - scalar_space.close(); - dataset2.close(); - HDfree(wdata2); - HDfree(rdata2); - - // Close objects and file. - dataset2.close(); - vlst.close(); - file1->close(); - - PASSED(); + // Create a datatype to refer to. + StrType vlst(0, H5T_VARIABLE); + + // Create and write a dataset. + DataSet dataset(file1->createDataSet(DSSTRARR_NAME, vlst, ds_space)); + dataset.write(string_ds_array, vlst); + + // Read and verify the dataset using strings of chars as buffer. + // Note: reading by array of H5std_string doesn't work yet. + char *string_ds_check[SPACE1_DIM1]; + dataset.read(string_ds_check, vlst); + + hsize_t ii; + for (ii = 0; ii < SPACE1_DIM1; ii++) + { + if(HDstrcmp(string_ds_check[ii], string_ds_array[ii])!=0) + TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]); + + HDfree(string_ds_check[ii]); + } + + // Close objects that are no longer needed. + dataset.close(); + ds_space.close(); + + // + // Test with scalar data space. + // + + // Create H5S_SCALAR data space. + DataSpace scalar_space; + + // Create and write another dataset. + DataSet dataset2(file1->createDataSet("Dataset2", vlst, scalar_space)); + char *wdata2 = (char*)HDcalloc(65534, sizeof(char)); + HDmemset(wdata2, 'A', 65533); + dataset2.write(&wdata2, vlst); + + char *rdata2; + dataset2.read(&rdata2, vlst); + if (HDstrcmp(wdata2, rdata2)!=0) + TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, wdata2, rdata2); + + // Release resources from second dataset operation. + scalar_space.close(); + dataset2.close(); + HDfree(wdata2); + HDfree(rdata2); + + // Close objects and file. + dataset2.close(); + vlst.close(); + file1->close(); + + PASSED(); } // end try // Catch all exceptions. catch (Exception& E) { - issue_fail_msg("test_vlstring_array_dataset()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_vlstring_array_dataset()", __LINE__, __FILE__, E.getCDetailMsg()); } if(file1) - delete file1; + delete file1; } // end test_vlstring_array_dataset() /*------------------------------------------------------------------------- - * Function: test_vlstrings_special + * Function: test_vlstrings_special * - * Purpose: Test VL string code for special string cases, nil and - * zero-sized. + * Purpose Test VL string code for special string cases, nil and + * zero-sized. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer Binh-Minh Ribler (use C version) + * January, 2007 * *------------------------------------------------------------------------- */ @@ -331,110 +331,110 @@ static void test_vlstrings_special() SUBTEST("Special VL Strings"); try { - // Create file. - H5File file1(FILENAME, H5F_ACC_TRUNC); + // Create file. + H5File file1(FILENAME, H5F_ACC_TRUNC); // Create dataspace for datasets. hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); - // Create a datatype to refer to. - StrType vlst(0, H5T_VARIABLE); - - // Create a dataset. - DataSet dataset(file1.createDataSet("Dataset3", vlst, sid1)); - - // Read from the dataset before writing data. - dataset.read(rdata, vlst); - - // Check data read in. - hsize_t ii; // counting variable - for (ii=0; iiopenStrType(VLSTR_TYPE); // deprecated + // Try opening datatype again. + vlst = file1->openStrType(VLSTR_TYPE); // deprecated - // Close again and reopen with constructor. - vlst.close(); - StrType vlst1(*file1, VLSTR_TYPE); + // Close again and reopen with constructor. + vlst.close(); + StrType vlst1(*file1, VLSTR_TYPE); - // Close datatype and file. - vlst1.close(); - file1->close(); + // Close datatype and file. + vlst1.close(); + file1->close(); delete file1; - // Open file. - file1 = new H5File(FILENAME, H5F_ACC_RDWR); + // Open file. + file1 = new H5File(FILENAME, H5F_ACC_RDWR); - // Open the variable-length string datatype just created - StrType vlst2(*file1, VLSTR_TYPE); + // Open the variable-length string datatype just created + StrType vlst2(*file1, VLSTR_TYPE); - // Verify character set and padding - cset = vlst2.getCset(); - verify_val(cset, H5T_CSET_ASCII, "StrType::getCset", __LINE__, __FILE__); - pad = vlst2.getStrpad(); - verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__); + // Verify character set and padding + cset = vlst2.getCset(); + verify_val(cset, H5T_CSET_ASCII, "StrType::getCset", __LINE__, __FILE__); + pad = vlst2.getStrpad(); + verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__); - // Close datatype and file - vlst2.close(); - file1->close(); + // Close datatype and file + vlst2.close(); + file1->close(); - PASSED(); + PASSED(); } // end try block // Catch all exceptions. @@ -516,18 +516,18 @@ static void test_vlstring_type() } if(file1) - delete file1; + delete file1; } // end test_vlstring_type() /*------------------------------------------------------------------------- - * Function: test_compact_vlstring + * Function: test_compact_vlstring * - * Purpose: Test storing VL strings in compact datasets. + * Purpose Test storing VL strings in compact datasets. * - * Return: None + * Return None * - * Programmer: Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer Binh-Minh Ribler (use C version) + * January, 2007 * *------------------------------------------------------------------------- */ @@ -537,55 +537,55 @@ static void test_compact_vlstring() SUBTEST("VL Strings on Compact Dataset"); try { - // Create file - H5File file1(FILENAME, H5F_ACC_TRUNC); + // Create file + H5File file1(FILENAME, H5F_ACC_TRUNC); - // Create dataspace for datasets + // Create dataspace for datasets hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); - // Create a datatype to refer to - StrType vlst(0, H5T_VARIABLE); - - // Create dataset create property list and set layout - DSetCreatPropList plist; - plist.setLayout(H5D_COMPACT); - - // Create a dataset - DataSet dataset(file1.createDataSet("Dataset5", vlst, sid1, plist)); - - // Write dataset to disk - const char *wdata[SPACE1_DIM1] = {"one", "two", "three", "four"}; - dataset.write(wdata, vlst); - - // Read dataset from disk - char *rdata[SPACE1_DIM1]; // Information read in - dataset.read(rdata, vlst); - - // Compare data read in - hsize_t i; - for (i=0; i ${TEST}") TRY_RUN (${TEST}_RUN ${TEST}_COMPILE @@ -177,41 +177,41 @@ MACRO (H5ConversionTests TEST msg) OUTPUT_VARIABLE OUTPUT ) if (${TEST}_COMPILE) - if (${TEST}_RUN MATCHES 0) + if (${TEST}_RUN MATCHES 0) set (${TEST} 1 CACHE INTERNAL ${msg}) message (STATUS "${msg}... yes") - else (${TEST}_RUN MATCHES 0) + else () set (${TEST} "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - endif (${TEST}_RUN MATCHES 0) - else (${TEST}_COMPILE ) + endif () + else () set (${TEST} "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" ) - endif (${TEST}_COMPILE) + endif () - endif ("${TEST}" MATCHES "^${TEST}$") -ENDMACRO (H5ConversionTests) + endif () +endmacro () #----------------------------------------------------------------------------- # Macro to make some of the conversion tests easier to write/read #----------------------------------------------------------------------------- -MACRO (H5MiscConversionTest VAR TEST msg) +macro (H5MiscConversionTest VAR TEST msg) if ("${TEST}" MATCHES "^${TEST}$") if (${VAR}) set (${TEST} 1 CACHE INTERNAL ${msg}) message (STATUS "${msg}... yes") - else (${VAR}) + else () set (${TEST} "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") - endif (${VAR}) - endif ("${TEST}" MATCHES "^${TEST}$") -ENDMACRO (H5MiscConversionTest) + endif () + endif () +endmacro () #----------------------------------------------------------------------------- # Check various conversion capabilities @@ -219,9 +219,9 @@ ENDMACRO (H5MiscConversionTest) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine is using a special algorithm to convert -# 'long double' to '(unsigned) long' values. (This flag should only be set for -# the IBM Power6 Linux. When the bit sequence of long double is -# 0x4351ccf385ebc8a0bfcc2a3c3d855620, the converted value of (unsigned)long +# 'long double' to '(unsigned) long' values. (This flag should only be set for +# the IBM Power6 Linux. When the bit sequence of long double is +# 0x4351ccf385ebc8a0bfcc2a3c3d855620, the converted value of (unsigned)long # is 0x004733ce17af227f, not the same as the library's conversion to 0x004733ce17af2282. # The machine's conversion gets the correct value. We define the macro and disable # this kind of test until we figure out what algorithm they use. @@ -229,10 +229,10 @@ ENDMACRO (H5MiscConversionTest) H5ConversionTests (H5_LDOUBLE_TO_LONG_SPECIAL "Checking IF your system converts long double to (unsigned) long values with special algorithm") # ---------------------------------------------------------------------- # Set the flag to indicate that the machine is using a special algorithm -# to convert some values of '(unsigned) long' to 'long double' values. -# (This flag should be off for all machines, except for IBM Power6 Linux, -# when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff..., -# ..., 7fffff..., the compiler uses a unknown algorithm. We define a +# to convert some values of '(unsigned) long' to 'long double' values. +# (This flag should be off for all machines, except for IBM Power6 Linux, +# when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff..., +# ..., 7fffff..., the compiler uses a unknown algorithm. We define a # macro and skip the test for now until we know about the algorithm. # H5ConversionTests (H5_LONG_TO_LDOUBLE_SPECIAL "Checking IF your system can convert (unsigned) long to long double values with special algorithm") @@ -261,7 +261,7 @@ H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restricti # ----------------------------------------------------------------------- # wrapper script variables -# +# set (prefix ${CMAKE_INSTALL_PREFIX}) set (exec_prefix "\${prefix}") set (libdir "${exec_prefix}/lib") @@ -272,4 +272,4 @@ set (CXX ${CMAKE_CXX_COMPILER}) set (FC ${CMAKE_Fortran_COMPILER}) foreach (LINK_LIB ${LINK_LIBS}) set (LIBS "${LIBS} -l${LINK_LIB}") -endforeach (LINK_LIB ${LINK_LIBS}) +endforeach () diff --git a/config/cmake/FindHDFJAVA.cmake.in b/config/cmake/FindHDFJAVA.cmake.in index b822280..25057e6 100644 --- a/config/cmake/FindHDFJAVA.cmake.in +++ b/config/cmake/FindHDFJAVA.cmake.in @@ -4,18 +4,18 @@ # # Find the HDFJAVA includes and get all installed hdf-java library settings from -# HDFJAVA-config.cmake file : Requires a CMake compatible hdf-java-@HDFJAVA_PACKAGE_VERSION@ or later +# HDFJAVA-config.cmake file : Requires a CMake compatible hdf-java-@HDFJAVA_PACKAGE_VERSION@ or later # for this feature to work. The following vars are set if hdf-java is found. # # HDFJAVA_FOUND - True if found, otherwise all other vars are undefined # HDFJAVA_VERSION_STRING - full version (e.g. @HDFJAVA_PACKAGE_VERSION@) # HDFJAVA_VERSION_MAJOR - major part of version (e.g. @HDFJAVA_PACKAGE_VERSION_MAJOR@) # HDFJAVA_VERSION_MINOR - minor part (e.g. @HDFJAVA_PACKAGE_VERSION_MINOR@) -# +# # Target names that are valid (depending on enabled options) # will be the following # -# +# # To aid in finding HDFJAVA as part of a subproject set # HDFJAVA_ROOT_DIR_HINT to the location where @HDFJAVA_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake lies @@ -60,9 +60,9 @@ if (HDFJAVA_ROOT_DIR) set (HDFJAVA_FOUND "YES") INCLUDE (${HDFJAVA_ROOT_DIR}/@HDFJAVA_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake) set (HDFJAVA_LIBRARIES "${HDFJAVA_LIBRARY}") - set (HDFJAVA_INCLUDE_DIRS + set (HDFJAVA_INCLUDE_DIRS ${HDFJAVA_LIBRARY}/jarhdf-@HDFJAVA_PACKAGE_VERSION@.jar ${HDFJAVA_LIBRARY}/jarhdf5-@HDFJAVA_PACKAGE_VERSION@.jar ) - -endif (HDFJAVA_ROOT_DIR) + +endif () diff --git a/config/cmake/FindJNI.cmake b/config/cmake/FindJNI.cmake index 9d755fc..baab2ea 100644 --- a/config/cmake/FindJNI.cmake +++ b/config/cmake/FindJNI.cmake @@ -147,8 +147,6 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES /usr/lib/jvm/java-1.5.0-sun/jre/lib/{libarch} /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/{libarch} # can this one be removed according to #8821 ? Alex /usr/lib/jvm/java-6-openjdk/jre/lib/{libarch} - /usr/lib/jvm/java-7-openjdk/jre/lib/{libarch} - /usr/lib/jvm/java-7-openjdk-{libarch}/jre/lib/{libarch} /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/{libarch} # fedora # Debian specific paths for default JVM /usr/lib/jvm/default-java/jre/lib/{libarch} diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index e1cb781..6aa5e1f 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: @@ -12,7 +12,7 @@ set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) #INSTALLDIR - HDF5-1.8 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATIC_LIBRARIES - Default is YES +#STATIC_ONLY - Default is YES #FORTRAN_LIBRARIES - Default is NO ##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) if(DEFINED CTEST_SCRIPT_ARG) @@ -23,61 +23,61 @@ if(DEFINED CTEST_SCRIPT_ARG) foreach(current_var ${script_args}) if ("${current_var}" MATCHES "^([^=]+)=(.+)$") set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif() - endforeach() -endif() + endif () + endforeach () +endif () if(NOT DEFINED INSTALLDIR) set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") -endif() +endif () if(NOT DEFINED CTEST_CONFIGURATION_TYPE) set(CTEST_CONFIGURATION_TYPE "Release") -endif() +endif () if(NOT DEFINED CTEST_SOURCE_NAME) set(CTEST_SOURCE_NAME "HDF5Examples") -endif() -if(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "YES") -else(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "NO") -endif() +endif () +if(NOT DEFINED STATIC_ONLY) + set(STATICONLYLIBRARIES "YES") +else(NOT DEFINED STATIC_ONLY) + set(STATICONLYLIBRARIES "NO") +endif () if(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "NO") else(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "YES") -endif() +endif () if(NOT DEFINED HDF_LOCAL) set(CDASH_LOCAL "NO") else(NOT HDF_LOCAL) set(CDASH_LOCAL "YES") -endif() +endif () if(NOT DEFINED CTEST_SITE) set(CTEST_SITE "local") -endif() +endif () if(NOT DEFINED CTEST_BUILD_NAME) set(CTEST_BUILD_NAME "examples") -endif() +endif () set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) # set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.2.1-Source") -#endif() +#endif () ############################################################################################################### # Adjust the following SET Commands as needed ############################################################################################################### if(WIN32) - if(${STATICLIBRARIES}) + if(${STATICONLYLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif() + endif () set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") else(WIN32) - if(${STATICLIBRARIES}) + if(${STATICONLYLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif() + endif () set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) @@ -86,12 +86,12 @@ else(WIN32) endif(WIN32) if(${FORTRANLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") -else() +else () set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") -endif() +endif () if(${CDASH_LOCAL}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") -endif() +endif () set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### @@ -111,11 +111,11 @@ if(APPLE) if(NOT NO_MAC_FORTRAN) # Shared fortran is not supported, build static set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else() + else () set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif() + endif () set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif() +endif () #----------------------------------------------------------------------------- set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") @@ -126,16 +126,16 @@ if(CTEST_USE_TAR_SOURCE) if(WIN32) message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else() + else () message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif() + endif () if(NOT rv EQUAL 0) message(STATUS "extracting... [error-(${rv}) clean up]") file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif() + endif () endif(CTEST_USE_TAR_SOURCE) #----------------------------------------------------------------------------- @@ -154,9 +154,9 @@ ProcessorCount(N) if(NOT N EQUAL 0) if(NOT WIN32) set(CTEST_BUILD_FLAGS -j${N}) - endif() + endif () set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif() +endif () set (CTEST_CONFIGURE_COMMAND "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) @@ -174,27 +174,27 @@ ctest_start (Experimental) ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) if(${res} LESS 0 OR ${res} GREATER 0) file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") -endif() +endif () if(LOCAL_SUBMIT) ctest_submit (PARTS Configure Notes) -endif() +endif () ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND APPEND RETURN_VALUE res NUMBER_ERRORS errval) if(${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") -endif() +endif () if(LOCAL_SUBMIT) ctest_submit (PARTS Build) -endif() +endif () ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) if(${res} LESS 0 OR ${res} GREATER 0) file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") -endif() +endif () if(LOCAL_SUBMIT) ctest_submit (PARTS Test) -endif() +endif () if(${res} LESS 0 OR ${res} GREATER 0) message (FATAL_ERROR "tests FAILED") -endif() +endif () #----------------------------------------------------------------------------- ############################################################################################################## message(STATUS "DONE") \ No newline at end of file diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index d88e672..747e043 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -5,21 +5,21 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype) if (${libtype} MATCHES "SHARED") if (ARGN) set (PACKAGE_SOVERSION ${ARGN}) - else (ARGN) + else () set (PACKAGE_SOVERSION ${HDF5_PACKAGE_SOVERSION}) - endif (ARGN) + endif () if (WIN32) set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) - else (WIN32) + else () set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION}) - endif (WIN32) + endif () set_target_properties (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) if (WIN32) set (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${PACKAGE_SOVERSION}") - else (WIN32) + else () set_target_properties (${libtarget} PROPERTIES SOVERSION ${PACKAGE_SOVERSION}) - endif (WIN32) - endif (${libtype} MATCHES "SHARED") + endif () + endif () HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype}) #-- Apple Specific install_name for libraries @@ -31,7 +31,7 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype) INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} ) - endif (HDF5_BUILD_WITH_INSTALL_NAME) + endif () if (HDF5_BUILD_FRAMEWORKS) if (${libtype} MATCHES "SHARED") # adapt target to build frameworks instead of dylibs @@ -42,8 +42,8 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype) MACOSX_FRAMEWORK_IDENTIFIER org.hdfgroup.${libtarget} MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${HDF5_PACKAGE_VERSION_MAJOR} MACOSX_FRAMEWORK_BUNDLE_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) - endif (${libtype} MATCHES "SHARED") - endif (HDF5_BUILD_FRAMEWORKS) - endif (APPLE) + endif () + endif () + endif () -endmacro (H5_SET_LIB_OPTIONS) +endmacro () diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index eba448c..a419950 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -7,7 +7,7 @@ if (${C_HAVE_QUADMATH}) set(HAVE_QUADMATH 1) else () set(HAVE_QUADMATH 0) -endif() +endif () # # This file provides functions for HDF5 specific Fortran support. @@ -18,16 +18,16 @@ ENABLE_LANGUAGE (Fortran) # The provided CMake Fortran macros don't provide a general compile/run function # so this one is used. #----------------------------------------------------------------------------- -MACRO (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN) +macro (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN) # -# if (NOT DEFINED ${RUN_RESULT_VAR}) +# if (NOT DEFINED ${RUN_RESULT_VAR}) message (STATUS "Detecting Fortran ${FUNCTION}") if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - else (CMAKE_REQUIRED_LIBRARIES) + else () set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - endif (CMAKE_REQUIRED_LIBRARIES) + endif () file (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90 "${CODE}" @@ -40,7 +40,7 @@ MACRO (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN) ) set(${RETURN} ${OUTPUT}) - + #message ( "Test result1 ${RETURN} ") #message ( "Test result3 ${RESULT} ") #message ( "Test result2 ${CMAKE_MATCH_0} ") @@ -65,15 +65,15 @@ MACRO (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN) "${OUTPUT}\n\n") endif () endif () -# endif (NOT DEFINED ${RUN_RESULT_VAR}) -ENDMACRO (FORTRAN_RUN) +# endif () +endmacro () # Read source line beginning at the line matching Input:"START" and ending at the line matching Input:"END" -MACRO (READ_SOURCE START END RETURN) - file(READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" CODE) - string(REGEX MATCH "${START}[\\\t\\\n\\\r[].+]*${END}" CODE ${CODE}) - set(RETURN "${CODE}") -ENDMACRO (READ_SOURCE START END RETURN) +macro (READ_SOURCE START END RETURN) + file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" CODE) + string (REGEX MATCH "${START}[\\\t\\\n\\\r[].+]*${END}" CODE ${CODE}) + set (RETURN "${CODE}") +endmacro () #----------------------------------------------------------------------------- # Check to see C_LONG_DOUBLE is available @@ -85,10 +85,10 @@ CHECK_FORTRAN_FEATURE(c_long_double ) if (${FORTRAN_HAVE_C_LONG_DOUBLE}) - set(FORTRAN_HAVE_C_LONG_DOUBLE 1) + set (FORTRAN_HAVE_C_LONG_DOUBLE 1) else () - set(FORTRAN_HAVE_C_LONG_DOUBLE 0) -endif() + set (FORTRAN_HAVE_C_LONG_DOUBLE 0) +endif () # Check to see C_LONG_DOUBLE is different from C_DOUBLE @@ -98,30 +98,30 @@ CHECK_FORTRAN_FEATURE(c_long_double FORTRAN_C_LONG_DOUBLE_IS_UNIQUE ) if (${FORTRAN_C_LONG_DOUBLE_IS_UNIQUE}) - set(FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 1) + set (FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 1) else () - set(FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 0) -endif() + set (FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 0) +endif () ## Set the sizeof function for use later in the fortran tests -if(FORTRAN_HAVE_STORAGE_SIZE) - set(FC_SIZEOF_A "STORAGE_SIZE(a, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") - set(FC_SIZEOF_B "STORAGE_SIZE(b, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") - set(FC_SIZEOF_C "STORAGE_SIZE(c, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") -elseif(FORTRAN_HAVE_C_SIZEOF) - set(FC_SIZEOF_A "SIZEOF(a)") - set(FC_SIZEOF_B "SIZEOF(b)") - set(FC_SIZEOF_C "SIZEOF(c)") -else(FORTRAN_HAVE_STORAGE_SIZE) +if (FORTRAN_HAVE_STORAGE_SIZE) + set (FC_SIZEOF_A "STORAGE_SIZE(a, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") + set (FC_SIZEOF_B "STORAGE_SIZE(b, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") + set (FC_SIZEOF_C "STORAGE_SIZE(c, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") +elseif (FORTRAN_HAVE_C_SIZEOF) + set (FC_SIZEOF_A "SIZEOF(a)") + set (FC_SIZEOF_B "SIZEOF(b)") + set (FC_SIZEOF_C "SIZEOF(c)") +else () message (FATAL_ERROR "Fortran compiler requires either intrinsic functions SIZEOF or STORAGE_SIZE") -endif(FORTRAN_HAVE_STORAGE_SIZE) +endif () #----------------------------------------------------------------------------- # Determine the available KINDs for REALs and INTEGERs #----------------------------------------------------------------------------- -READ_SOURCE("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" CODE) -FORTRAN_RUN("REAL and INTEGER KINDs" +READ_SOURCE ("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" CODE) +FORTRAN_RUN ("REAL and INTEGER KINDs" "${CODE}" XX YY @@ -134,35 +134,35 @@ FORTRAN_RUN("REAL and INTEGER KINDs" # dnl -- LINE 4 -- number of valid integer kinds # dnl -- LINE 5 -- number of valid real kinds -file(READ "${CMAKE_BINARY_DIR}/pac_fconftest.out" PROG_OUTPUT) +file (READ "${CMAKE_BINARY_DIR}/pac_fconftest.out" PROG_OUTPUT) # Convert the string to a list of strings by replacing the carriage return with a semicolon -string(REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") +string (REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") -list(GET PROG_OUTPUT 0 pac_validIntKinds) -list(GET PROG_OUTPUT 1 pac_validRealKinds) -list(GET PROG_OUTPUT 2 H5_PAC_FC_MAX_REAL_PRECISION) +list (GET PROG_OUTPUT 0 pac_validIntKinds) +list (GET PROG_OUTPUT 1 pac_validRealKinds) +list (GET PROG_OUTPUT 2 H5_PAC_FC_MAX_REAL_PRECISION) # If the lists are empty then something went wrong. -if( NOT pac_validIntKinds) +if (NOT pac_validIntKinds) message (FATAL_ERROR "Failed to find available INTEGER KINDs for Fortran") -endif() -if( NOT pac_validRealKinds) +endif () +if (NOT pac_validRealKinds) message (FATAL_ERROR "Failed to find available REAL KINDs for Fortran") -endif() -if( NOT H5_PAC_FC_MAX_REAL_PRECISION) +endif () +if (NOT H5_PAC_FC_MAX_REAL_PRECISION) message (FATAL_ERROR "No output from Fortran decimal precision program") -endif() +endif () -set(PAC_FC_ALL_INTEGER_KINDS "\{${pac_validIntKinds}\}") -set(PAC_FC_ALL_REAL_KINDS "\{${pac_validRealKinds}\}") +set (PAC_FC_ALL_INTEGER_KINDS "\{${pac_validIntKinds}\}") +set (PAC_FC_ALL_REAL_KINDS "\{${pac_validRealKinds}\}") -list(GET PROG_OUTPUT 3 NUM_IKIND) -list(GET PROG_OUTPUT 4 NUM_RKIND) +list (GET PROG_OUTPUT 3 NUM_IKIND) +list (GET PROG_OUTPUT 4 NUM_RKIND) -set(PAC_FORTRAN_NUM_INTEGER_KINDS "${NUM_IKIND}") +set (PAC_FORTRAN_NUM_INTEGER_KINDS "${NUM_IKIND}") -set(H5CONFIG_F_NUM_IKIND "INTEGER, PARAMETER :: num_ikinds = ${NUM_IKIND}") -set(H5CONFIG_F_IKIND "INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/${pac_validIntKinds}/)") +set (H5CONFIG_F_NUM_IKIND "INTEGER, PARAMETER :: num_ikinds = ${NUM_IKIND}") +set (H5CONFIG_F_IKIND "INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/${pac_validIntKinds}/)") message (STATUS "....NUMBER OF INTEGER KINDS FOUND ${PAC_FORTRAN_NUM_INTEGER_KINDS}") message (STATUS "....REAL KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}") @@ -175,10 +175,10 @@ message (STATUS "....MAX DECIMAL PRECISION ${H5_PAC_FC_MAX_REAL_PRECISION}") # ********** # INTEGERS # ********** -string(REGEX REPLACE "," ";" VAR "${pac_validIntKinds}") +string (REGEX REPLACE "," ";" VAR "${pac_validIntKinds}") -foreach( KIND ${VAR} ) - set(PROG_SRC +foreach (KIND ${VAR} ) + set (PROG_SRC " PROGRAM main USE ISO_C_BINDING @@ -193,37 +193,36 @@ foreach( KIND ${VAR} ) YY PROG_OUTPUT1 ) - string(REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") - set(pack_int_sizeof "${pack_int_sizeof} ${PROG_OUTPUT1},") -endforeach(KIND) + string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") + set (pack_int_sizeof "${pack_int_sizeof} ${PROG_OUTPUT1},") +endforeach () if (pack_int_sizeof STREQUAL "") message (FATAL_ERROR "Failed to find available INTEGER KINDs for Fortran") -endif() - -string(STRIP ${pack_int_sizeof} pack_int_sizeof) +endif () +string (STRIP ${pack_int_sizeof} pack_int_sizeof) #Remove trailing comma -string(REGEX REPLACE ",$" "" pack_int_sizeof "${pack_int_sizeof}") +string (REGEX REPLACE ",$" "" pack_int_sizeof "${pack_int_sizeof}") #Remove spaces -string(REGEX REPLACE " " "" pack_int_sizeof "${pack_int_sizeof}") +string (REGEX REPLACE " " "" pack_int_sizeof "${pack_int_sizeof}") -set(PAC_FC_ALL_INTEGER_KINDS_SIZEOF "\{${pack_int_sizeof}\}") +set (PAC_FC_ALL_INTEGER_KINDS_SIZEOF "\{${pack_int_sizeof}\}") -message(STATUS "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") +message (STATUS "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") # ********** # REALS # ********** -string(REGEX REPLACE "," ";" VAR "${pac_validRealKinds}") +string (REGEX REPLACE "," ";" VAR "${pac_validRealKinds}") #find the maximum kind of the real -list(LENGTH VAR LEN_VAR) -MATH (EXPR _LEN "${LEN_VAR}-1") -list(GET VAR ${_LEN} max_real_fortran_kind) +list (LENGTH VAR LEN_VAR) +math (EXPR _LEN "${LEN_VAR}-1") +list (GET VAR ${_LEN} max_real_fortran_kind) -foreach( KIND ${VAR} ) - set(PROG_SRC +foreach (KIND ${VAR} ) + set (PROG_SRC " PROGRAM main USE ISO_C_BINDING @@ -233,42 +232,42 @@ foreach( KIND ${VAR} ) END " ) - FORTRAN_RUN("REAL KIND SIZEOF" ${PROG_SRC} + FORTRAN_RUN ("REAL KIND SIZEOF" ${PROG_SRC} XX YY PROG_OUTPUT1 ) - string(REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") - set(pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},") -endforeach(KIND) + string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") + set (pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},") +endforeach () if (pack_int_sizeof STREQUAL "") message (FATAL_ERROR "Failed to find available REAL KINDs for Fortran") -endif() +endif () string(STRIP ${pack_real_sizeof} pack_real_sizeof) #Remove trailing comma -string(REGEX REPLACE ",$" "" pack_real_sizeof "${pack_real_sizeof}") +string (REGEX REPLACE ",$" "" pack_real_sizeof "${pack_real_sizeof}") #Remove spaces -string(REGEX REPLACE " " "" pack_real_sizeof "${pack_real_sizeof}") +string (REGEX REPLACE " " "" pack_real_sizeof "${pack_real_sizeof}") -set(H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${pack_real_sizeof}/)") +set (H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${pack_real_sizeof}/)") -message(STATUS "....FOUND SIZEOF for REAL KINDs \{${pack_real_sizeof}\}") +message (STATUS "....FOUND SIZEOF for REAL KINDs \{${pack_real_sizeof}\}") -set(PAC_FC_ALL_REAL_KINDS_SIZEOF "\{${pack_real_sizeof}\}") +set (PAC_FC_ALL_REAL_KINDS_SIZEOF "\{${pack_real_sizeof}\}") #find the maximum kind of the real -string(REGEX REPLACE "," ";" VAR "${pack_real_sizeof}") -list(LENGTH VAR LEN_VAR) -MATH (EXPR _LEN "${LEN_VAR}-1") -list(GET VAR ${_LEN} max_real_fortran_sizeof) +string (REGEX REPLACE "," ";" VAR "${pack_real_sizeof}") +list (LENGTH VAR LEN_VAR) +math (EXPR _LEN "${LEN_VAR}-1") +list (GET VAR ${_LEN} max_real_fortran_sizeof) #----------------------------------------------------------------------------- # Find sizeof of native kinds #----------------------------------------------------------------------------- -FORTRAN_RUN("SIZEOF NATIVE KINDs" +FORTRAN_RUN ("SIZEOF NATIVE KINDs" " PROGRAM main USE ISO_C_BINDING @@ -277,9 +276,9 @@ FORTRAN_RUN("SIZEOF NATIVE KINDs" REAL b DOUBLE PRECISION c WRITE(*,*) ${FC_SIZEOF_A} - WRITE(*,*) kind(a) - WRITE(*,*) ${FC_SIZEOF_B} - WRITE(*,*) kind(b) + WRITE(*,*) kind(a) + WRITE(*,*) ${FC_SIZEOF_B} + WRITE(*,*) kind(b) WRITE(*,*) ${FC_SIZEOF_C} WRITE(*,*) kind(c) END @@ -297,63 +296,63 @@ FORTRAN_RUN("SIZEOF NATIVE KINDs" # dnl -- LINE 6 -- kind of DOUBLE PRECISION # Convert the string to a list of strings by replacing the carriage return with a semicolon -string(REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") +string (REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") -list(GET PROG_OUTPUT 0 PAC_FORTRAN_NATIVE_INTEGER_SIZEOF) -list(GET PROG_OUTPUT 1 PAC_FORTRAN_NATIVE_INTEGER_KIND) -list(GET PROG_OUTPUT 2 PAC_FORTRAN_NATIVE_REAL_SIZEOF) -list(GET PROG_OUTPUT 3 PAC_FORTRAN_NATIVE_REAL_KIND) -list(GET PROG_OUTPUT 4 PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF) -list(GET PROG_OUTPUT 5 PAC_FORTRAN_NATIVE_DOUBLE_KIND) +list (GET PROG_OUTPUT 0 PAC_FORTRAN_NATIVE_INTEGER_SIZEOF) +list (GET PROG_OUTPUT 1 PAC_FORTRAN_NATIVE_INTEGER_KIND) +list (GET PROG_OUTPUT 2 PAC_FORTRAN_NATIVE_REAL_SIZEOF) +list (GET PROG_OUTPUT 3 PAC_FORTRAN_NATIVE_REAL_KIND) +list (GET PROG_OUTPUT 4 PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF) +list (GET PROG_OUTPUT 5 PAC_FORTRAN_NATIVE_DOUBLE_KIND) if (NOT PAC_FORTRAN_NATIVE_INTEGER_SIZEOF) message (FATAL_ERROR "Failed to find SIZEOF NATIVE INTEGER KINDs for Fortran") -endif() +endif () if (NOT PAC_FORTRAN_NATIVE_REAL_SIZEOF) message (FATAL_ERROR "Failed to find SIZEOF NATIVE REAL KINDs for Fortran") -endif() +endif () if (NOT PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF) message (FATAL_ERROR "Failed to find SIZEOF NATIVE DOUBLE KINDs for Fortran") -endif() +endif () if (NOT PAC_FORTRAN_NATIVE_INTEGER_KIND) message (FATAL_ERROR "Failed to find KIND of NATIVE INTEGER for Fortran") -endif() +endif () if (NOT PAC_FORTRAN_NATIVE_REAL_KIND) message (FATAL_ERROR "Failed to find KIND of NATIVE REAL for Fortran") -endif() +endif () if (NOT PAC_FORTRAN_NATIVE_DOUBLE_KIND) message (FATAL_ERROR "Failed to find KIND of NATIVE DOUBLE for Fortran") -endif() +endif () -set(FORTRAN_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) -#set(H5_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) +set (FORTRAN_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) +#set (H5_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) # remove the invalid kind from the list -if(NOT(${SIZEOF___FLOAT128} EQUAL 0)) - if(NOT(${SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) - AND NOT(${FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof}) - # account for the fact that the C compiler can have 16-byte __float128 and the fortran compiler only has 8-byte doubles, - # so we don't want to remove the 8-byte fortran doubles. - AND NOT(${PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF} EQUAL ${max_real_fortran_sizeof})) - message(WARNING " +if (NOT(${SIZEOF___FLOAT128} EQUAL 0)) + if (NOT(${SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) + AND NOT(${FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof}) + # account for the fact that the C compiler can have 16-byte __float128 and the fortran compiler only has 8-byte doubles, + # so we don't want to remove the 8-byte fortran doubles. + AND NOT(${PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF} EQUAL ${max_real_fortran_sizeof})) + message (WARNING " Fortran REAL(KIND=${max_real_fortran_kind}) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size !!! Fortran interfaces will not be generated for REAL(KIND=${max_real_fortran_kind}) !!!") - string(REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS ${PAC_FC_ALL_REAL_KINDS}) - string(REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS_SIZEOF ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) - MATH (EXPR NUM_RKIND "${NUM_RKIND} - 1") - endif() -endif(NOT(${SIZEOF___FLOAT128} EQUAL 0)) + string (REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS ${PAC_FC_ALL_REAL_KINDS}) + string (REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS_SIZEOF ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) + math (EXPR NUM_RKIND "${NUM_RKIND} - 1") + endif () +endif () -set(H5CONFIG_F_NUM_RKIND "INTEGER, PARAMETER :: num_rkinds = ${NUM_RKIND}") +set (H5CONFIG_F_NUM_RKIND "INTEGER, PARAMETER :: num_rkinds = ${NUM_RKIND}") -string(REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS}) -string(REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) -set(H5CONFIG_F_RKIND "INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/${OUT_VAR}/)") +string (REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS}) +string (REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) +set (H5CONFIG_F_RKIND "INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/${OUT_VAR}/)") -string(REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) -string(REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) -set(H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${OUT_VAR}/)") +string (REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) +string (REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) +set (H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${OUT_VAR}/)") ENABLE_LANGUAGE (C) @@ -361,14 +360,14 @@ ENABLE_LANGUAGE (C) # The provided CMake C macros don't provide a general compile/run function # so this one is used. #----------------------------------------------------------------------------- -MACRO (C_RUN FUNCTION CODE RETURN) +macro (C_RUN FUNCTION CODE RETURN) message (STATUS "Detecting C ${FUNCTION}") if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - else (CMAKE_REQUIRED_LIBRARIES) + else () set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - endif (CMAKE_REQUIRED_LIBRARIES) + endif () file (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c ${CODE} @@ -380,8 +379,8 @@ MACRO (C_RUN FUNCTION CODE RETURN) RUN_OUTPUT_VARIABLE OUTPUT ) - set(${RETURN} ${OUTPUT}) - + set (${RETURN} ${OUTPUT}) + #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") #message ( "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ") #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") @@ -405,10 +404,10 @@ MACRO (C_RUN FUNCTION CODE RETURN) endif () else () message (FATAL_ERROR "Compilation of C ${FUNCTION} - Failed") - endif() -ENDMACRO (C_RUN) + endif () +endmacro () -set(PROG_SRC +set (PROG_SRC " #include #include @@ -426,7 +425,7 @@ set(PROG_SRC #define C_FLT128_DIG 0 #endif #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#define C_LDBL_DIG DECIMAL_DIG +#define C_LDBL_DIG DECIMAL_DIG #else #define C_LDBL_DIG LDBL_DIG #endif @@ -435,33 +434,33 @@ set(PROG_SRC return 1\\\; } " - ) +) -C_RUN("maximum decimal precision for C" ${PROG_SRC} PROG_OUTPUT) +C_RUN ("maximum decimal precision for C" ${PROG_SRC} PROG_OUTPUT) # dnl The output from the above program will be: # dnl -- LINE 1 -- long double decimal precision # dnl -- LINE 2 -- __float128 decimal precision # Convert the string to a list of strings by replacing the carriage return with a semicolon -string(REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") +string (REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") -list(GET PROG_OUTPUT 0 LDBL_DIG) -list(GET PROG_OUTPUT 1 FLT128_DIG) +list (GET PROG_OUTPUT 0 LDBL_DIG) +list (GET PROG_OUTPUT 1 FLT128_DIG) -if(SIZEOF___FLOAT128 EQUAL 0 OR FLT128_DIG EQUAL 0) - SET(H5_HAVE_FLOAT128 0) - SET(SIZEOF___FLOAT128 0) - set(H5_PAC_C_MAX_REAL_PRECISION ${LDBL_DIG}) +if (SIZEOF___FLOAT128 EQUAL 0 OR FLT128_DIG EQUAL 0) + set (H5_HAVE_FLOAT128 0) + set (SIZEOF___FLOAT128 0) + set (H5_PAC_C_MAX_REAL_PRECISION ${LDBL_DIG}) else () set(H5_PAC_C_MAX_REAL_PRECISION ${FLT128_DIG}) -endif() +endif () # Setting definition if there is a 16 byte fortran integer -string(FIND ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF} "16" pos) -if(${pos} EQUAL -1) - set(HAVE_Fortran_INTEGER_SIZEOF_16 0) +string (FIND ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF} "16" pos) +if (${pos} EQUAL -1) + set (HAVE_Fortran_INTEGER_SIZEOF_16 0) else () - set(HAVE_Fortran_INTEGER_SIZEOF_16 1) + set (HAVE_Fortran_INTEGER_SIZEOF_16 1) endif () diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 058dd7a..eadff5f 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: @@ -12,98 +12,98 @@ set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) #INSTALLDIR - HDF5 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATIC_LIBRARIES - Default is YES +#STATIC_ONLY - Default is YES #FORTRAN_LIBRARIES - Default is NO #JAVA_LIBRARIES - Default is NO ##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) -if(DEFINED CTEST_SCRIPT_ARG) +if (DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 # to variables with the respective names set to the respective values - string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach(current_var ${script_args}) + string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach (current_var ${script_args}) if ("${current_var}" MATCHES "^([^=]+)=(.+)$") - set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif() - endforeach() -endif() -if(NOT DEFINED INSTALLDIR) - set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") -endif() -if(NOT DEFINED CTEST_CONFIGURATION_TYPE) - set(CTEST_CONFIGURATION_TYPE "Release") -endif() -if(NOT DEFINED CTEST_SOURCE_NAME) - set(CTEST_SOURCE_NAME "HDF5Examples") -endif() -if(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "YES") -else(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "NO") -endif() -if(NOT DEFINED FORTRAN_LIBRARIES) - set(FORTRANLIBRARIES "NO") -else(NOT DEFINED FORTRAN_LIBRARIES) - set(FORTRANLIBRARIES "YES") -endif() -if(NOT DEFINED JAVA_LIBRARIES) - set(JAVALIBRARIES "NO") -else(NOT DEFINED JAVA_LIBRARIES) - set(JAVALIBRARIES "YES") -endif() -if(NOT DEFINED HDF_LOCAL) - set(CDASH_LOCAL "NO") -else(NOT HDF_LOCAL) - set(CDASH_LOCAL "YES") -endif() + set ("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif () + endforeach () +endif () +if (NOT DEFINED INSTALLDIR) + set (INSTALLDIR "@CMAKE_INSTALL_PREFIX@") +endif () +if (NOT DEFINED CTEST_CONFIGURATION_TYPE) + set (CTEST_CONFIGURATION_TYPE "Release") +endif () +if (NOT DEFINED CTEST_SOURCE_NAME) + set (CTEST_SOURCE_NAME "HDF5Examples") +endif () +if (NOT DEFINED STATIC_ONLY) + set (STATICONLYLIBRARIES "YES") +else () + set (STATICONLYLIBRARIES "NO") +endif () +if (NOT DEFINED FORTRAN_LIBRARIES) + set (FORTRANLIBRARIES "NO") +else () + set (FORTRANLIBRARIES "YES") +endif () +if (NOT DEFINED JAVA_LIBRARIES) + set (JAVALIBRARIES "NO") +else () + set (JAVALIBRARIES "YES") +endif () +if (NOT DEFINED HDF_LOCAL) + set (CDASH_LOCAL "NO") +else () + set (CDASH_LOCAL "YES") +endif () if(NOT DEFINED CTEST_SITE) - set(CTEST_SITE "local") -endif() + set (CTEST_SITE "local") +endif () if(NOT DEFINED CTEST_BUILD_NAME) - set(CTEST_BUILD_NAME "examples") -endif() -set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") + set (CTEST_BUILD_NAME "examples") +endif () +set (BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") #TAR_SOURCE - name of tarfile -#if(NOT DEFINED TAR_SOURCE) -# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") -#endif() +#if (NOT DEFINED TAR_SOURCE) +# set (CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") +#endif () ############################################################################################################### # Adjust the following SET Commands as needed ############################################################################################################### -if(WIN32) - if(${STATICLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif() - set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") - set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else(WIN32) - if(${STATICLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif() - set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") - set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") - set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif(WIN32) -if(${FORTRANLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") -else() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") -endif() +if (WIN32) + if (${STATICONLYLIBRARIES}) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") + endif () + set (ENV{HDF5_DIR} "${INSTALLDIR}/cmake") + set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") +else () + if (${STATICONLYLIBRARIES}) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + endif () + set (ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") + set (ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") + set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +endif () +if (${FORTRANLIBRARIES}) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") +else () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") +endif () if(${JAVALIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") -else() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") -endif() + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") +else () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") +endif () if(${CDASH_LOCAL}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") -endif() -set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") +endif () +set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### # For any comments please contact cdashhelp@hdfgroup.org @@ -113,99 +113,99 @@ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HD #----------------------------------------------------------------------------- # MAC machines need special option #----------------------------------------------------------------------------- -if(APPLE) +if (APPLE) # Compiler choice - execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set(ENV{CC} "${XCODE_CC}") - set(ENV{CXX} "${XCODE_CXX}") - if(NOT NO_MAC_FORTRAN) + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") + if (NOT NO_MAC_FORTRAN) # Shared fortran is not supported, build static - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif() + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + else () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") + endif () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif () #----------------------------------------------------------------------------- -set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") ## -------------------------- -if(CTEST_USE_TAR_SOURCE) +if (CTEST_USE_TAR_SOURCE) ## Uncompress source if tar or zip file provided ## -------------------------- - if(WIN32) - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else() - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif() + if (WIN32) + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else () + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif () - if(NOT rv EQUAL 0) - message(STATUS "extracting... [error-(${rv}) clean up]") - file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif() -endif(CTEST_USE_TAR_SOURCE) + if (NOT rv EQUAL 0) + message (STATUS "extracting... [error-(${rv}) clean up]") + file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message (FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") + endif () +endif() #----------------------------------------------------------------------------- ## Clear the build directory ## -------------------------- -set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") - ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) + ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) else () - file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") + file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") endif () # Use multiple CPU cores to build -include(ProcessorCount) -ProcessorCount(N) -if(NOT N EQUAL 0) - if(NOT WIN32) - set(CTEST_BUILD_FLAGS -j${N}) - endif() - set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif() +include (ProcessorCount) +ProcessorCount (N) +if (NOT N EQUAL 0) + if (NOT WIN32) + set (CTEST_BUILD_FLAGS -j${N}) + endif () + set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif () set (CTEST_CONFIGURE_COMMAND "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) #----------------------------------------------------------------------------- ## -- set output to english -set($ENV{LC_MESSAGES} "en_EN") +set ($ENV{LC_MESSAGES} "en_EN") #----------------------------------------------------------------------------- -configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) +configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") ## NORMAL process ## -------------------------- ctest_start (Experimental) ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -if(${res} LESS 0 OR ${res} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") -endif() -if(LOCAL_SUBMIT) +if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") +endif () +if (LOCAL_SUBMIT) ctest_submit (PARTS Configure Notes) -endif() +endif () ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND APPEND RETURN_VALUE res NUMBER_ERRORS errval) -if(${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) +if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") -endif() -if(LOCAL_SUBMIT) +endif () +if (LOCAL_SUBMIT) ctest_submit (PARTS Build) -endif() +endif () ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) -if(${res} LESS 0 OR ${res} GREATER 0) +if (${res} LESS 0 OR ${res} GREATER 0) file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") -endif() -if(LOCAL_SUBMIT) +endif () +if (LOCAL_SUBMIT) ctest_submit (PARTS Test) -endif() -if(${res} LESS 0 OR ${res} GREATER 0) +endif () +if (${res} LESS 0 OR ${res} GREATER 0) message (FATAL_ERROR "tests FAILED") -endif() +endif () #----------------------------------------------------------------------------- ############################################################################################################## -message(STATUS "DONE") \ No newline at end of file +message (STATUS "DONE") diff --git a/config/cmake/HDF5_Process_Flex_Files.cmake b/config/cmake/HDF5_Process_Flex_Files.cmake index 2306e93..667ad31 100644 --- a/config/cmake/HDF5_Process_Flex_Files.cmake +++ b/config/cmake/HDF5_Process_Flex_Files.cmake @@ -49,7 +49,7 @@ if (FILE_PARSE) message (STATUS "processed pragma in ${FILE_PARSE}") file (READ ${GEN_DIR}/${FILE_PARSE}.h TEST_STREAM) file (WRITE ${FILE_PARSE}.h "${TEST_STREAM}") -endif (FILE_PARSE) +endif () if (FILE_ANALYZE) # Add code that disables warnings in the flex/bison-generated code. @@ -81,4 +81,4 @@ if (FILE_ANALYZE) ") file (APPEND ${FILE_ANALYZE} "${TEST_STREAM}") message (STATUS "processed pragma in ${FILE_ANALYZE}") -endif (FILE_ANALYZE) +endif () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 665db32..238e363 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -12,21 +12,21 @@ if (CMAKE_COMPILER_IS_GNUCC) if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") endif () - endif (CMAKE_BUILD_TYPE MATCHES Debug) -endif (CMAKE_COMPILER_IS_GNUCC) -if (CMAKE_COMPILER_IS_GNUCXX) + endif () +endif () +if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) if (CMAKE_BUILD_TYPE MATCHES Debug) set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") endif () - else (CMAKE_BUILD_TYPE MATCHES Debug) + else () set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt") endif () - endif (CMAKE_BUILD_TYPE MATCHES Debug) -endif (CMAKE_COMPILER_IS_GNUCXX) + endif () +endif () #----------------------------------------------------------------------------- # Option to allow the user to disable compiler warnings @@ -41,22 +41,22 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") - endif (MSVC) + endif () if (WIN32) add_definitions (-D_CRT_SECURE_NO_WARNINGS) - endif (WIN32) + endif () # Borland uses -w- to suppress warnings. if (BORLAND) set (HDF5_WARNINGS_BLOCKED 1) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") - endif (BORLAND) + endif () # Most compilers use -w to suppress warnings. if (NOT HDF5_WARNINGS_BLOCKED) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") - endif (NOT HDF5_WARNINGS_BLOCKED) -endif (HDF5_DISABLE_COMPILER_WARNINGS) + endif () +endif () #----------------------------------------------------------------------------- # CDash is configured to only allow 3000 warnings, so @@ -64,10 +64,22 @@ endif (HDF5_DISABLE_COMPILER_WARNINGS) #----------------------------------------------------------------------------- if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline") - else (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (CMAKE_C_FLAGS_5 "${CMAKE_C_FLAGS_5} -Wcast-qual") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs") + else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP") - endif (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + endif () + + #----------------------------------------------------------------------------- + # Option to allow the user to enable developer warnings + #----------------------------------------------------------------------------- + option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF) + if (HDF5_ENABLE_DEV_WARNINGS) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Winline -Waggregate-return") + else () + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter -Wno-inline -Wno-aggregate-return") + endif () + # Append warning flags # Don't use the '-Wtraditional' flag, we're way past having K&R C code # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional") @@ -83,75 +95,102 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) set (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute") # Append warning flags from gcc-3.2* case - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wpacked -Wdisabled-optimization") + if (HDF5_ENABLE_DEV_WARNINGS) + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn") + else () + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wno-missing-noreturn") + endif () # Enable more format checking flags, beyond the basic -Wformat included # in -Wall - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2") - - # The "unreachable code" warning appears to be reliable now... - # (this warning was removed in gcc 4.5+) - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wunreachable-code") - endif() + set (H5_CFLAGS1_5 "${H5_CFLAGS1_5} -Wformat=2") # Append warning flags from gcc-3.3* case set (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels") # Append warning flags from gcc-3.4* case - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") # Append more extra warning flags that only gcc4.0+ know about set (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") # Append more extra warning flags that only gcc 4.1+ know about - set (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat") + set (H5_CFLAGS2_5 "${H5_CFLAGS2_5} -Wunsafe-loop-optimizations") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wc++-compat") # Append more extra warning flags that only gcc 4.2+ know about - set (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow") + set (H5_CFLAGS2_5 "${H5_CFLAGS2_5} -Wstrict-overflow") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-strict-overflow") # Append more extra warning flags that only gcc 4.3+ know about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK - set (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wlogical-op -Wlarger-than=2048 -Wvla") # Append more extra warning flags that only gcc 4.4+ know about - set (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") # Append more extra warning flags that only gcc 4.5+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) - set (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") - endif() + set (H5_CFLAGS2_5 "${H5_CFLAGS2_5} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wjump-misses-init -Wunsuffixed-float-constants") + endif () # Append more extra warning flags that only gcc 4.6+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) - set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") - endif() + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdouble-promotion -Wtrampolines") + if (HDF5_ENABLE_DEV_WARNINGS) + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=const") + else () + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=const") + endif () + endif () + + # The "unreachable code" warning appears to be reliable now... + # (this warning was removed in gcc 4.5+) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wunreachable-code") + endif () # Append more extra warning flags that only gcc 4.7+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) - set (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") - endif() + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wstack-usage=8192 -Wvector-operation-performance") + if (HDF5_ENABLE_DEV_WARNINGS) + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") + else () + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn") + endif () + endif () # Append more extra warning flags that only gcc 4.8+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8) - set (H5_CFLAGS5 "${H5_CFLAGS5} -Wsuggest-attribute=format") - endif() + if (HDF5_ENABLE_DEV_WARNINGS) + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=format") + else () + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=format") + endif () + endif () # Append more extra warning flags that only gcc 4.9+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) - set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdate-time -Wopenmp-simd") - endif() + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdate-time -Wopenmp-simd") + endif () # (There was no release of gcc 5.0) # Append more extra warning flags that only gcc 5.1+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1) - set (H5_CFLAGS6 "${H5_CFLAGS6} -Warray-bounds=2 -Wc99-c11-compat") - endif() + set (H5_CFLAGS3 "${H5_CFLAGS3} -Warray-bounds=2 -Wc99-c11-compat") + endif () + + # Append more extra warning flags that only gcc 6.x+ know about + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa") + endif () -endif (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) +endif () #----------------------------------------------------------------------------- # Option to allow the user to enable all warnings @@ -159,16 +198,23 @@ endif (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) if (HDF5_ENABLE_ALL_WARNINGS) if (MSVC) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") - else (MSVC) + if (HDF5_ENABLE_DEV_WARNINGS) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /wd4668") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /wd4668") + else () + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + endif () + else () if (CMAKE_COMPILER_IS_GNUCC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") - endif (CMAKE_COMPILER_IS_GNUCC) - endif (MSVC) -endif (HDF5_ENABLE_ALL_WARNINGS) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2}") + endif () + endif () +endif () #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -180,12 +226,12 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") - else (MSVC) + else () if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") - endif (CMAKE_COMPILER_IS_GNUCC) - endif (MSVC) -endif (HDF5_ENABLE_GROUPZERO_WARNINGS) + endif () + endif () +endif () #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -197,10 +243,10 @@ if (HDF5_ENABLE_GROUPONE_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") - else (MSVC) + else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") - endif (MSVC) -endif (HDF5_ENABLE_GROUPONE_WARNINGS) + endif () +endif () #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -212,10 +258,10 @@ if (HDF5_ENABLE_GROUPTWO_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") - else (MSVC) + else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") - endif (MSVC) -endif (HDF5_ENABLE_GROUPTWO_WARNINGS) + endif () +endif () #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -227,10 +273,10 @@ if (HDF5_ENABLE_GROUPTHREE_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") - else (MSVC) + else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") - endif (MSVC) -endif (HDF5_ENABLE_GROUPTHREE_WARNINGS) + endif () +endif () #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -239,28 +285,8 @@ option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) if (HDF5_ENABLE_GROUPFOUR_WARNINGS) if (NOT MSVC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") - endif (NOT MSVC) -endif (HDF5_ENABLE_GROUPFOUR_WARNINGS) - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) -if (HDF5_ENABLE_GROUPFIVE_WARNINGS) - if (NOT MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}") - endif (NOT MSVC) -endif (HDF5_ENABLE_GROUPFIVE_WARNINGS) - -#----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GROUPSIX_WARNINGS "Enable group six warnings" OFF) -if (HDF5_ENABLE_GROUPSIX_WARNINGS) - if (NOT MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS6}") - endif (NOT MSVC) -endif (HDF5_ENABLE_GROUPSIX_WARNINGS) + endif () +endif () #----------------------------------------------------------------------------- # This is in here to help some of the GCC based IDES like Eclipse @@ -268,7 +294,7 @@ endif (HDF5_ENABLE_GROUPSIX_WARNINGS) #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") -endif (CMAKE_COMPILER_IS_GNUCC) -if (CMAKE_COMPILER_IS_GNUCXX) +endif () +if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") -endif (CMAKE_COMPILER_IS_GNUCXX) +endif () diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index 7ab3c35..1d6ef45 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -43,7 +43,7 @@ To test the installation with the examples; with the CTEST_CONFIGURATION_TYPE script option. Note that this must be the same as the value used with the -C command line option. The default build configuration is defined to build and use static libraries. - Shared libraries can be used with the STATICLIBRARIES script option set to "NO". + Shared libraries can be used with the STATICONLYLIBRARIES script option set to "NO". Other options can be changed by editing the HDF5_Examples.cmake file. If the defaults are okay, execute from this directory: diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake index 6391c63..3e74d4f 100644 --- a/config/cmake/UseJava.cmake +++ b/config/cmake/UseJava.cmake @@ -1250,7 +1250,7 @@ function(create_javadoc _target) else () set(_overview ${_overview}:${_path}) endif () - endforeach() + endforeach () set(_javadoc_options ${_javadoc_options} -overview ${_overview}) endif () diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index a54f22c..216a014 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -3,14 +3,14 @@ ######################################################## # To use this option, copy both the macro and option code -# into the root UserMacros.cmake file. +# into the root UserMacros.cmake file. # OR add an include to the root UserMacros.cmake file: # INCLUDE(path_to_file/WINDOWS_MT.cmake) #----------------------------------------------------------------------------- # Option to Build with Static CRT libraries on Windows #------------------------------------------------------------------------------- -MACRO (TARGET_STATIC_CRT_FLAGS) +macro (TARGET_STATIC_CRT_FLAGS) if (MSVC AND NOT BUILD_SHARED_LIBS) foreach (flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE @@ -19,23 +19,22 @@ MACRO (TARGET_STATIC_CRT_FLAGS) CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) if (${flag_var} MATCHES "/MD") string (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - endif (${flag_var} MATCHES "/MD") - endforeach (flag_var) + endif () + endforeach () foreach (flag_var CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO) if (${flag_var} MATCHES "/libs:dll") string (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") - endif (${flag_var} MATCHES "/libs:dll") - endforeach (flag_var) + endif () + endforeach () set (WIN_COMPILE_FLAGS "") set (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - endif (MSVC AND NOT BUILD_SHARED_LIBS) -ENDMACRO (TARGET_STATIC_CRT_FLAGS) + endif () +endmacro () #----------------------------------------------------------------------------- option (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) if (BUILD_STATIC_CRT_LIBS) TARGET_STATIC_CRT_FLAGS () -endif (BUILD_STATIC_CRT_LIBS) - \ No newline at end of file +endif () diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 24ae95c..5901a78 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -42,6 +42,8 @@ set (HDF5_MEMORY_ALLOC_SANITY_CHECK OFF CACHE BOOL "Indicate that internal memor set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) +set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) + set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index 5911fa7..ad1b96d 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -12,36 +12,36 @@ set (PACKAGE_VERSION "@HDF5_VERSION_STRING@") if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) set(PACKAGE_VERSION_COMPATIBLE FALSE) -else() +else () if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") - + # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@ if ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - + # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x - set (PACKAGE_VERSION_COMPATIBLE TRUE) - + set (PACKAGE_VERSION_COMPATIBLE TRUE) + if ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") set (PACKAGE_VERSION_EXACT TRUE) - + if ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") # not using this yet - endif ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") - endif ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") - else ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - set (PACKAGE_VERSION_COMPATIBLE FALSE) - endif ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - endif ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") -endif() + endif () + endif () + else () + set (PACKAGE_VERSION_COMPATIBLE FALSE) + endif () + endif () +endif () # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") return() -endif() +endif () # check that the installed version has the same 32/64bit-ness as the one which is currently searching: if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif() +endif () diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index 41fc726..6dffa6c 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -50,7 +50,7 @@ if (${HDF5_PACKAGE_NAME}_BUILD_JAVA) ) set (${HDF5_PACKAGE_NAME}_JAVA_LIBRARY "@PACKAGE_CURRENT_BUILD_DIR@/lib") set (${HDF5_PACKAGE_NAME}_JAVA_LIBRARIES "${${HDF5_PACKAGE_NAME}_JAVA_LIBRARY}") -endif() +endif () #----------------------------------------------------------------------------- # Directories diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 59f4c7b..0e0106f 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -5,44 +5,44 @@ cmake_policy(SET CMP0007 NEW) # arguments checking if (NOT TEST_TESTER) message (FATAL_ERROR "Require TEST_TESTER to be defined") -endif (NOT TEST_TESTER) +endif () if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") -endif (NOT TEST_PROGRAM) +endif () if (NOT TEST_LIBRARY_DIRECTORY) message (STATUS "Require TEST_LIBRARY_DIRECTORY to be defined") -endif (NOT TEST_LIBRARY_DIRECTORY) +endif () if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif (NOT TEST_FOLDER) +endif () if (NOT TEST_OUTPUT) message (FATAL_ERROR "Require TEST_OUTPUT to be defined") -endif (NOT TEST_OUTPUT) +endif () if (NOT TEST_CLASSPATH) message (STATUS "Require TEST_CLASSPATH to be defined") -endif (NOT TEST_CLASSPATH) +endif () if (NOT TEST_REFERENCE) message (FATAL_ERROR "Require TEST_REFERENCE to be defined") -endif (NOT TEST_REFERENCE) +endif () if (NOT TEST_ERRREF) if (NOT SKIP_APPEND) # append error file since skip was not defined set (ERROR_APPEND 1) - endif(NOT SKIP_APPEND) -endif (NOT TEST_ERRREF) + endif () +endif () if (NOT TEST_LOG_LEVEL) set (LOG_LEVEL "info") -else (NOT TEST_LOG_LEVEL) +else () set (LOG_LEVEL "${TEST_LOG_LEVEL}") -endif (NOT TEST_LOG_LEVEL) +endif () message (STATUS "COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=${LOG_LEVEL} -Djava.library.path=\"${TEST_LIBRARY_DIRECTORY}\" -cp \"${TEST_CLASSPATH}\" ${TEST_ARGS} ${TEST_PROGRAM} ${ARGN}") if (WIN32 AND NOT MINGW) set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}") -endif (WIN32 AND NOT MINGW) +endif () # run the test program, capture the stdout/stderr and the result var execute_process ( @@ -64,25 +64,25 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) if (TEST_MASK_FILE) STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}") - endif (TEST_MASK_FILE) + endif () if (NOT ERROR_APPEND) # append error output to the stdout output file file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") - else (NOT ERROR_APPEND) + else () # write back to original .err file file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") - endif (NOT ERROR_APPEND) -endif (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + endif () +endif () if (TEST_MASK_ERROR) if (NOT TEST_ERRREF) # the error stack has been appended to the output file file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - else (NOT TEST_ERRREF) + else () # the error stack remains in the .err file file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - endif (NOT TEST_ERRREF) + endif () string (REGEX REPLACE "Time:[^\n]+\n" "Time: XXXX\n" TEST_STREAM "${TEST_STREAM}") string (REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") string (REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") @@ -94,16 +94,16 @@ if (TEST_MASK_ERROR) # write back the changes to the original files if (NOT TEST_ERRREF) file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") - else (NOT TEST_ERRREF) + else () file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") - endif (NOT TEST_ERRREF) -endif (TEST_MASK_ERROR) + endif () +endif () # if the return value is !=0 bail out if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) message (STATUS "ERROR OUTPUT: ${TEST_STREAM}") message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != 0.\n${TEST_ERROR}") -endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +endif () message (STATUS "COMMAND Error: ${TEST_ERROR}") @@ -112,7 +112,7 @@ if (NOT TEST_SKIP_COMPARE) if (WIN32 AND NOT MINGW) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") - endif (WIN32 AND NOT MINGW) + endif () # now compare the output with the reference execute_process ( @@ -120,42 +120,42 @@ if (NOT TEST_SKIP_COMPARE) RESULT_VARIABLE TEST_RESULT ) if (NOT ${TEST_RESULT} STREQUAL 0) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) - list (LENGTH test_ref len_ref) - if (NOT ${len_act} STREQUAL "0") - MATH (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") - set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - endif (NOT "${str_act}" STREQUAL "") - endif (NOT "${str_act}" STREQUAL "${str_ref}") - endforeach (line RANGE 0 ${_FP_LEN}) - endif (NOT ${len_act} STREQUAL "0") - if (NOT ${len_act} STREQUAL ${len_ref}) - set (TEST_RESULT 1) - endif (NOT ${len_act} STREQUAL ${len_ref}) - endif (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) + list (LENGTH test_ref len_ref) + if (NOT ${len_act} STREQUAL "0") + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () + endif () + endforeach () + endif () + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif () + endif () message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout if (NOT ${TEST_RESULT} STREQUAL 0) message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") - endif (NOT ${TEST_RESULT} STREQUAL 0) + endif () # now compare the .err file with the error reference, if supplied if (TEST_ERRREF) if (WIN32 AND NOT MINGW) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") - endif (WIN32 AND NOT MINGW) + endif () # now compare the error output with the error reference execute_process ( @@ -163,38 +163,38 @@ if (NOT TEST_SKIP_COMPARE) RESULT_VARIABLE TEST_RESULT ) if (NOT ${TEST_RESULT} STREQUAL 0) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) - list (LENGTH test_ref len_ref) - MATH (EXPR _FP_LEN "${len_ref} - 1") - if (NOT ${len_act} STREQUAL "0") - MATH (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") - set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - endif (NOT "${str_act}" STREQUAL "") - endif (NOT "${str_act}" STREQUAL "${str_ref}") - endforeach (line RANGE 0 ${_FP_LEN}) - endif (NOT ${len_act} STREQUAL "0") - if (NOT ${len_act} STREQUAL ${len_ref}) - set (TEST_RESULT 1) - endif (NOT ${len_act} STREQUAL ${len_ref}) - endif (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) + list (LENGTH test_ref len_ref) + math (EXPR _FP_LEN "${len_ref} - 1") + if (NOT ${len_act} STREQUAL "0") + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () + endif () + endforeach () + endif () + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif () + endif () message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout if (NOT ${TEST_RESULT} STREQUAL 0) message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") - endif (NOT ${TEST_RESULT} STREQUAL 0) - endif (TEST_ERRREF) -endif (NOT TEST_SKIP_COMPARE) + endif () + endif () +endif () if (TEST_GREP_COMPARE) # now grep the output with the reference @@ -205,7 +205,7 @@ if (TEST_GREP_COMPARE) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) if (${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") - endif (${TEST_RESULT} STREQUAL "0") + endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) if (${TEST_EXPECT} STREQUAL "1") @@ -213,9 +213,9 @@ if (TEST_GREP_COMPARE) string (LENGTH "${TEST_MATCH}" TEST_RESULT) if (NOT ${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") - endif (NOT ${TEST_RESULT} STREQUAL "0") - endif (${TEST_EXPECT} STREQUAL "0") -endif (TEST_GREP_COMPARE) + endif () + endif () +endif () # everything went fine... message ("${TEST_PROGRAM} Passed") diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index f2675c3..dca9631 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ######################################################## # This dashboard is maintained by The HDF Group # For any comments please contact cdashhelp@hdfgroup.org @@ -7,225 +7,204 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) # ----------------------------------------------------------- # -- Get environment # ----------------------------------------------------------- -if(NOT SITE_OS_NAME) +if (NOT SITE_OS_NAME) ## machine name not provided - attempt to discover with uname ## -- set hostname ## -------------------------- - find_program(HOSTNAME_CMD NAMES hostname) - exec_program(${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) - set(CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") - find_program(UNAME NAMES uname) - macro(getuname name flag) - exec_program("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") - endmacro(getuname) + find_program (HOSTNAME_CMD NAMES hostname) + exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) + set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") + find_program (UNAME NAMES uname) + macro (getuname name flag) + exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") + endmacro () - getuname(osname -s) - getuname(osrel -r) - getuname(cpu -m) - message(STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") + getuname (osname -s) + getuname (osrel -r) + getuname (cpu -m) + message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") - set(CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") - if(USE_AUTOTOOLS) - set(CTEST_BUILD_NAME "AT-${CTEST_BUILD_NAME}") - endif() - if(SITE_BUILDNAME_SUFFIX) - set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") - endif() - set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") -else(NOT SITE_OS_NAME) + set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") + if (SITE_BUILDNAME_SUFFIX) + set (CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}") + endif () + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") +else () ## machine name provided ## -------------------------- - if(CMAKE_HOST_UNIX) + if (CMAKE_HOST_UNIX) set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}") - else() + else () set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") - endif() - if(SITE_BUILDNAME_SUFFIX) + endif () + if (SITE_BUILDNAME_SUFFIX) set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") - endif() - set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") -endif(NOT SITE_OS_NAME) + endif () + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") +endif () #----------------------------------------------------------------------------- # MAC machines need special option #----------------------------------------------------------------------------- -if(APPLE) +if (APPLE) # Compiler choice - execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set(ENV{CC} "${XCODE_CC}") - set(ENV{CXX} "${XCODE_CXX}") + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") - if(NOT NO_MAC_FORTRAN) - # Shared fortran is not supported, build static - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else(NOT NO_MAC_FORTRAN) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - endif(NOT NO_MAC_FORTRAN) + if (NOT NO_MAC_FORTRAN) + # Shared fortran is not supported, build static + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + else () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + endif () - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif(APPLE) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif () #----------------------------------------------------------------------------- -set(NEED_REPOSITORY_CHECKOUT 0) -set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -if(CTEST_USE_TAR_SOURCE) +set (NEED_REPOSITORY_CHECKOUT 0) +set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +if (CTEST_USE_TAR_SOURCE) ## Uncompress source if tar file provided ## -------------------------- - if(WIN32) - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_USE_TAR_SOURCE}.zip]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else() - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif() + if (WIN32) + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else () + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif () - if(NOT rv EQUAL 0) - message(STATUS "extracting... [error-(${rv}) clean up]") - file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message(FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") - endif() + if (NOT rv EQUAL 0) + message (STATUS "extracting... [error-(${rv}) clean up]") + file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message (FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") + endif () - file(RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) - set(LOCAL_SKIP_UPDATE "TRUE") -else(CTEST_USE_TAR_SOURCE) - if(LOCAL_UPDATE) - if(CTEST_USE_GIT_SOURCE) - find_program(CTEST_GIT_COMMAND NAMES git git.cmd) - set(CTEST_GIT_UPDATE_OPTIONS) + file (RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) + set (LOCAL_SKIP_UPDATE "TRUE") +else () + if (LOCAL_UPDATE) + if (CTEST_USE_GIT_SOURCE) + find_program (CTEST_GIT_COMMAND NAMES git git.cmd) + set (CTEST_GIT_UPDATE_OPTIONS) - if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") - set(NEED_REPOSITORY_CHECKOUT 1) - endif() + if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set (NEED_REPOSITORY_CHECKOUT 1) + endif () - if(${NEED_REPOSITORY_CHECKOUT}) - if(REPOSITORY_BRANCH) - set(CTEST_GIT_options "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" --single-branch \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") - else() - set(CTEST_GIT_options "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") - endif() - set(CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${CTEST_GIT_options}") - else() - set(CTEST_GIT_options "pull") - endif() - set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}") - else(CTEST_USE_GIT_SOURCE) + if (${NEED_REPOSITORY_CHECKOUT}) + if (REPOSITORY_BRANCH) + set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" --single-branch \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") + else () + set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") + endif () + set (CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${CTEST_GIT_options}") + else () + set (CTEST_GIT_options "pull") + endif () + set (CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}") + else () ## -------------------------- ## use subversion to get source #----------------------------------------------------------------------------- ## cygwin does not handle the find_package() call ## -------------------------- - set(CTEST_UPDATE_COMMAND "SVNCommand") - if(NOT SITE_CYGWIN}) + set (CTEST_UPDATE_COMMAND "SVNCommand") + if (NOT SITE_CYGWIN}) find_package (Subversion) - set(CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}") - set(CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") - else() - set(CTEST_SVN_COMMAND "/usr/bin/svn") - set(CTEST_UPDATE_COMMAND "/usr/bin/svn") - endif() + set (CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}") + set (CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") + else () + set (CTEST_SVN_COMMAND "/usr/bin/svn") + set (CTEST_UPDATE_COMMAND "/usr/bin/svn") + endif () - if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") - set(NEED_REPOSITORY_CHECKOUT 1) - endif() + if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set (NEED_REPOSITORY_CHECKOUT 1) + endif () - if(NOT CTEST_REPO_VERSION) - set(CTEST_REPO_VERSION "HEAD") - endif() - if(${NEED_REPOSITORY_CHECKOUT}) - set(CTEST_CHECKOUT_COMMAND + if (NOT CTEST_REPO_VERSION) + set (CTEST_REPO_VERSION "HEAD") + endif () + if (${NEED_REPOSITORY_CHECKOUT}) + set (CTEST_CHECKOUT_COMMAND "\"${CTEST_SVN_COMMAND}\" co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r ${CTEST_REPO_VERSION}") - else() - if(CTEST_REPO_VERSION) - set(CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}") - endif() - endif() - endif(CTEST_USE_GIT_SOURCE) - endif(LOCAL_UPDATE) -endif(CTEST_USE_TAR_SOURCE) + else () + if (CTEST_REPO_VERSION) + set (CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}") + endif () + endif () + endif () + endif () +endif () #----------------------------------------------------------------------------- ## Clear the build directory ## -------------------------- -set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) -if(NOT EXISTS "${CTEST_BINARY_DIRECTORY}") - file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") -else() - ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) -endif() +set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +if (NOT EXISTS "${CTEST_BINARY_DIRECTORY}") + file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +else () + ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) +endif () # Use multiple CPU cores to build -include(ProcessorCount) -ProcessorCount(N) -if(NOT N EQUAL 0) - if(NOT WIN32) - set(CTEST_BUILD_FLAGS -j${N}) - endif() - set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif() +include (ProcessorCount) +ProcessorCount (N) +if (NOT N EQUAL 0) + if (NOT WIN32) + set (CTEST_BUILD_FLAGS -j${N}) + endif () + set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif () #----------------------------------------------------------------------------- # Send the main script as a note. -if(USE_AUTOTOOLS) - ## autotools builds need to use make and does not use the cacheinit.cmake file - ## -- make command - ## ----------------- - find_program(MAKE NAMES make) - list(APPEND CTEST_NOTES_FILES - "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" - "${CMAKE_CURRENT_LIST_FILE}" - ) -else() - list(APPEND CTEST_NOTES_FILES - "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" - "${CMAKE_CURRENT_LIST_FILE}" - "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" - ) -endif() +list (APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" +) #----------------------------------------------------------------------------- # Check for required variables. # -------------------------- -foreach(req +foreach (req CTEST_CMAKE_GENERATOR CTEST_SITE CTEST_BUILD_NAME ) - if(NOT DEFINED ${req}) - message(FATAL_ERROR "The containing script must set ${req}") - endif() -endforeach(req) + if (NOT DEFINED ${req}) + message (FATAL_ERROR "The containing script must set ${req}") + endif () +endforeach () #----------------------------------------------------------------------------- # Initialize the CTEST commands #------------------------------ -if(USE_AUTOTOOLS) - set(CTEST_CONFIGURE_COMMAND "${CTEST_SOURCE_DIRECTORY}/configure ${ADD_BUILD_OPTIONS}") - set(CTEST_BUILD_COMMAND "${MAKE} ${CTEST_BUILD_FLAGS}") - configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) - file(WRITE ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake "ADD_TEST(makecheck \"${MAKE}\" \"${CTEST_BUILD_FLAGS}\" \"-i\" \"check\")") -else(USE_AUTOTOOLS) - if(LOCAL_MEMCHECK_TEST) - find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) - set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" - ) - else() - if(LOCAL_COVERAGE_TEST) - find_program(CTEST_COVERAGE_COMMAND NAMES gcov) - endif() - set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" - ) - endif() -endif() - +if (LOCAL_MEMCHECK_TEST) + find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind) + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) +else () + if (LOCAL_COVERAGE_TEST) + find_program (CTEST_COVERAGE_COMMAND NAMES gcov) + endif () + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) +endif () + #----------------------------------------------------------------------------- ## -- set output to english -set($ENV{LC_MESSAGES} "en_EN") +set ($ENV{LC_MESSAGES} "en_EN") # Print summary information. -foreach(v +foreach (v CTEST_SITE CTEST_BUILD_NAME CTEST_SOURCE_DIRECTORY @@ -238,9 +217,9 @@ foreach(v CTEST_SCRIPT_DIRECTORY CTEST_USE_LAUNCHERS ) - set(vars "${vars} ${v}=[${${v}}]\n") -endforeach(v) -message(STATUS "Dashboard script configuration:\n${vars}\n") + set (vars "${vars} ${v}=[${${v}}]\n") +endforeach () +message (STATUS "Dashboard script configuration:\n${vars}\n") #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- @@ -252,63 +231,63 @@ message(STATUS "Dashboard script configuration:\n${vars}\n") ## -- LOCAL_COVERAGE_TEST executes code coverage process ## -------------------------- ctest_start (${MODEL} TRACK ${MODEL}) - if(LOCAL_UPDATE) + if (LOCAL_UPDATE) ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}") - endif() - configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) + endif () + configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - if(LOCAL_SUBMIT) + if (LOCAL_SUBMIT) ctest_submit (PARTS Update Configure Notes) - endif() - if(${res} LESS 0 OR ${res} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") - endif() + endif () + if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") + endif () ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval) - if(LOCAL_SUBMIT) + if (LOCAL_SUBMIT) ctest_submit (PARTS Build) - endif() - if(${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") - endif() + endif () + if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") + endif () - if(NOT LOCAL_SKIP_TEST) - if(NOT LOCAL_MEMCHECK_TEST) + if (NOT LOCAL_SKIP_TEST) + if (NOT LOCAL_MEMCHECK_TEST) ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) - if(LOCAL_SUBMIT) + if (LOCAL_SUBMIT) ctest_submit (PARTS Test) - endif() - if(${res} LESS 0 OR ${res} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") - endif() - else() + endif () + if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") + endif () + else () ctest_memcheck (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) - if(LOCAL_SUBMIT) + if (LOCAL_SUBMIT) ctest_submit (PARTS MemCheck) - endif() - endif() - if(LOCAL_COVERAGE_TEST) + endif () + endif () + if (LOCAL_COVERAGE_TEST) ctest_coverage (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) - if(LOCAL_SUBMIT) + if (LOCAL_SUBMIT) ctest_submit (PARTS Coverage) - endif() - endif() - endif(NOT LOCAL_SKIP_TEST) + endif () + endif () + endif () - if(NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE AND NOT LOCAL_SKIP_BUILD) + if (NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE AND NOT LOCAL_SKIP_BUILD) ##----------------------------------------------- ## Package the product ##----------------------------------------------- - execute_process(COMMAND cpack -C ${CTEST_CONFIGURATION_TYPE} -V + execute_process (COMMAND cpack -C ${CTEST_CONFIGURATION_TYPE} -V WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} RESULT_VARIABLE cpackResult OUTPUT_VARIABLE cpackLog ERROR_VARIABLE cpackLog.err ) - file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") - if(cpackResult GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed packaging: ${cpackResult}:${cpackLog.err} \n") - endif() - endif() + file (WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") + if (cpackResult GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed packaging: ${cpackResult}:${cpackLog.err} \n") + endif () + endif () #----------------------------------------------------------------------------- diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 2b1b097..55fecfb 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -1,10 +1,10 @@ ############################################################################################# ### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### ### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ### -### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf5.log ### +### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -VV -O hdf5.log ### ############################################################################################# -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################ # Usage: # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log @@ -21,13 +21,13 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) # INSTALLDIR - root folder where hdf5 is installed # CTEST_CONFIGURATION_TYPE - Release, Debug, etc # CTEST_SOURCE_NAME - source folder -# STATIC_LIBRARIES - Build/use static libraries +# STATIC_ONLY - Build/use static libraries # FORTRAN_LIBRARIES - Build/use fortran libraries # JAVA_LIBRARIES - Build/use java libraries # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## -set(CTEST_SOURCE_VERSION 1.10.0) +set(CTEST_SOURCE_VERSION 1.10.1) set(CTEST_SOURCE_VERSEXT "") ############################################################################## @@ -36,7 +36,7 @@ set(CTEST_SOURCE_VERSEXT "") #INSTALLDIR - HDF5-1.10.0 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0 -#STATIC_LIBRARIES - Default is YES +#STATIC_ONLY - Default is YES #FORTRAN_LIBRARIES - Default is NO #JAVA_LIBRARIES - Default is NO #NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac @@ -48,14 +48,14 @@ if(DEFINED CTEST_SCRIPT_ARG) foreach(current_var ${script_args}) if ("${current_var}" MATCHES "^([^=]+)=(.+)$") set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif() - endforeach() -endif() + endif () + endforeach () +endif () # build generator must be defined if(NOT DEFINED BUILD_GENERATOR) message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") -else() +else () if(${BUILD_GENERATOR} STREQUAL "Unix") set(CTEST_CMAKE_GENERATOR "Unix Makefiles") elseif(${BUILD_GENERATOR} STREQUAL "VS2015") @@ -70,10 +70,10 @@ else() set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") elseif(${BUILD_GENERATOR} STREQUAL "VS201264") set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - else() + else () message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") - endif() -endif() + endif () +endif () ################################################################### ### Following Line is one of [Release, RelWithDebInfo, Debug] ##### @@ -83,41 +83,41 @@ set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") if(NOT DEFINED INSTALLDIR) if(WIN32) set(INSTALLDIR "C:/Program Files/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") - else() + else () set(INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") - endif() -endif() + endif () +endif () if(NOT DEFINED CTEST_CONFIGURATION_TYPE) set(CTEST_CONFIGURATION_TYPE "Release") -endif() +endif () if(NOT DEFINED CTEST_SOURCE_NAME) set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") -endif() -if(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "YES") -else() - set(STATICLIBRARIES "NO") -endif() +endif () +if(NOT DEFINED STATIC_ONLY) + set(STATICONLYLIBRARIES "YES") +else () + set(STATICONLYLIBRARIES "NO") +endif () if(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "NO") -else() +else () set(FORTRANLIBRARIES "YES") -endif() +endif () if(NOT DEFINED JAVA_LIBRARIES) set(JAVALIBRARIES "NO") -else() +else () set(JAVALIBRARIES "YES") -endif() +endif () set(CTEST_BINARY_NAME "build") set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") if(WIN32) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else() +else () set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif() +endif () ################################################################### ######### Following describes compiler ############ @@ -148,17 +148,33 @@ if(WIN32) set(SITE_OS_BITS "32") set(SITE_COMPILER_NAME "vs2012") set(SITE_COMPILER_VERSION "11") - endif() + endif () ## Set the following to unique id your computer ## set(CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") -else() +else () + set(CTEST_CMAKE_GENERATOR "Unix Makefiles") ## Set the following to unique id your computer ## if(APPLE) set(CTEST_SITE "MAC.XXXX") - else() + else () set(CTEST_SITE "LINUX.XXXX") - endif() -endif() + endif () + if(APPLE) + execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set(ENV{CC} "${XCODE_CC}") + set(ENV{CXX} "${XCODE_CXX}") + set(CTEST_USE_LAUNCHERS 1) + set(RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") + set(RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") + set(RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") + set(RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") + set(RR_FLAGS_C "${RR_FLAGS_COMMON}") + set(RR_FLAGS_CXX "${RR_FLAGS_COMMON}") + set(ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") + set(ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") + endif () +endif () ################################################################### ################################################################### @@ -178,103 +194,86 @@ set(MODEL "Experimental") #set(LOCAL_NO_PACKAGE "TRUE") ##### Following controls source update ##### #set(LOCAL_UPDATE "TRUE") -set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/trunk") +set(REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") +set(REPOSITORY_BRANCH "develop") + #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows #set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") ################################################################### ################################################################### -#### Change default configuration of options in config/cmake/cacheinit.cmake file ### -#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") - -################################################################### -if(${STATICLIBRARIES}) +if(${STATICONLYLIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") ######### Following describes computer ############ ## following is optional to describe build ## set(SITE_BUILDNAME_SUFFIX "STATIC") -endif() +endif () ################################################################### - -### uncomment/comment and change the following lines for other configuration options - -#### ext libraries #### -### ext libs from tgz -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}") -### ext libs from svn -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=SVN") -### ext libs on system -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") -### disable ext libs building -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") #### fortran #### if(${FORTRANLIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") -else() + ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") +else () set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") -endif() + ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") +endif () #### java #### if(${JAVALIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") -else() +else () set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") -endif() - -### disable test program builds -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") - -### disable packaging -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") -### Create install package with external libraries (szip, zlib, jpeg) -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") +endif () ### change install prefix -set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") -set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}") ################################################################### if(WIN32) + set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}") + include(${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake) include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() -else() + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe") + file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi") + file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip") + file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () +else () + set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") + include(${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake) include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) if(APPLE) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - else() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + else () if(CYGWIN) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - else() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - endif() - endif() -endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + else () + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + endif () + endif () +endif () diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 0775cbe..5095b33 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -4,28 +4,28 @@ # arguments checking if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM tellub to be defined") -endif (NOT TEST_PROGRAM) +endif () if (NOT TEST_GET_PROGRAM) message (FATAL_ERROR "Require TEST_GET_PROGRAM getub to be defined") -endif (NOT TEST_GET_PROGRAM) +endif () if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif (NOT TEST_FOLDER) +endif () if (NOT TEST_HFILE) message (FATAL_ERROR "Require TEST_HFILE the hdf file to be defined") -endif (NOT TEST_HFILE) +endif () if (NOT TEST_UFILE) message (FATAL_ERROR "Require TEST_UFILE the ub file to be defined") -endif (NOT TEST_UFILE) +endif () if (NOT TEST_CHECKUB) message (STATUS "Require TEST_CHECKUB - YES or NO - to be defined") -endif (NOT TEST_CHECKUB) +endif () #if (NOT TEST_EXPECT) # message (STATUS "Require TEST_EXPECT to be defined") -#endif (NOT TEST_EXPECT) +#endif () #if (NOT TEST_OFILE) # message (FATAL_ERROR "Require TEST_OFILE the original hdf file to be defined") -#endif (NOT TEST_OFILE) +#endif () set (TEST_U_STRING_LEN 0) set (TEST_O_STRING_LEN 0) @@ -53,11 +53,11 @@ if (TEST_CHECKUB STREQUAL "YES") ) if (NOT ${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") - endif (NOT ${TEST_RESULT} STREQUAL "0") + endif () file (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) - endif (TEST_OFILE) + endif () - MATH( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) + math( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) if (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $s2 $origfile > $cmpfile @@ -73,10 +73,10 @@ if (TEST_CHECKUB STREQUAL "YES") #cat $ufile >> $cmpfile file (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) file (APPEND ${TEST_HFILE}-ub.cmp "${TEST_STREAM}") - else (NOT TEST_O_STRING_LEN STREQUAL "0") + else () file (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) file (WRITE ${TEST_HFILE}-ub.cmp ${TEST_STREAM}) - endif (NOT TEST_O_STRING_LEN STREQUAL "0") + endif () #$JAM_BIN/getub -c $size $hfile > $tfile EXECUTE_PROCESS ( @@ -99,8 +99,8 @@ if (TEST_CHECKUB STREQUAL "YES") # if the return value is !=${TEST_EXPECT} bail out if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) message (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") - endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) -else (TEST_CHECKUB STREQUAL "YES") + endif () +else () # call 'ubsize' to get the size of the user block #ubsize=`$JAM_BIN/tellub $hfile` EXECUTE_PROCESS ( @@ -112,8 +112,8 @@ else (TEST_CHECKUB STREQUAL "YES") ) if (NOT TEST_H_STRING_LEN STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") - endif (NOT TEST_H_STRING_LEN STREQUAL "0") -endif (TEST_CHECKUB STREQUAL "YES") + endif () +endif () # everything went fine... message ("Passed: The output of CHECK matched expectation") diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index 10f0a7b..c9b4ecc 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -4,29 +4,36 @@ # arguments checking if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") -endif (NOT TEST_PROGRAM) -#if (NOT TEST_ARGS) -# message (STATUS "Require TEST_ARGS to be defined") -#endif (NOT TEST_ARGS) -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif (NOT TEST_EXPECT) +endif () if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif (NOT TEST_FOLDER) +endif () if (NOT TEST_VFD) message (FATAL_ERROR "Require TEST_VFD to be defined") -endif (NOT TEST_VFD) +endif () -set (ERROR_APPEND 1) +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) +endif () + +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) +endif () + +# if there is not an error reference file add the error output to the stdout file +if (NOT TEST_ERRREF) + set (ERROR_APPEND 1) +endif () message (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") set (ENV{HDF5_DRIVER} "${TEST_VFD}") + # run the test program, capture the stdout/stderr and the result var -EXECUTE_PROCESS ( +execute_process ( COMMAND ${TEST_PROGRAM} ${TEST_ARGS} WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT OUTPUT_FILE ${TEST_OUTPUT}_${TEST_VFD}.out ERROR_FILE ${TEST_OUTPUT}_${TEST_VFD}.err OUTPUT_VARIABLE TEST_OUT @@ -35,16 +42,24 @@ EXECUTE_PROCESS ( message (STATUS "COMMAND Result: ${TEST_RESULT}") +# if the .err file exists and ERRROR_APPEND is enabled if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err TEST_STREAM) file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out "${TEST_STREAM}") -endif (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err) +endif () # if the return value is !=${TEST_EXPECT} bail out if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") -endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + if (NOT TEST_NOERRDISPLAY) + if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM) + message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}") + endif () + endif () + message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif () + +message (STATUS "COMMAND Error: ${TEST_ERROR}") # everything went fine... message ("Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") - diff --git a/config/cmake_ext_mod/CheckTypeSize.cmake b/config/cmake_ext_mod/CheckTypeSize.cmake index 5095a27..d217ac5 100644 --- a/config/cmake_ext_mod/CheckTypeSize.cmake +++ b/config/cmake_ext_mod/CheckTypeSize.cmake @@ -7,24 +7,24 @@ # HAVE_${VARIABLE} - does the variable exists or not # -MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) +macro (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) if ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") - set (MACRO_CHECK_TYPE_SIZE_FLAGS + set (MACRO_CHECK_TYPE_SIZE_FLAGS "-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}" ) foreach (def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H HAVE_INTTYPES_H) if ("${def}") set (MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}") - endif ("${def}") - endforeach (def) + endif () + endforeach () message (STATUS "Check size of ${TYPE}") if (CMAKE_REQUIRED_LIBRARIES) - set (CHECK_TYPE_SIZE_ADD_LIBRARIES + set (CHECK_TYPE_SIZE_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" ) - endif (CMAKE_REQUIRED_LIBRARIES) + endif () try_run (${VARIABLE} HAVE_${VARIABLE} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/CheckTypeSize.c @@ -35,16 +35,16 @@ MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) if (HAVE_${VARIABLE}) message (STATUS "Check size of ${TYPE} - done") file (APPEND - ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n" ) - else (HAVE_${VARIABLE}) + else () message (STATUS "Check size of ${TYPE} - failed") file (APPEND - ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\n\n" ) - endif (HAVE_${VARIABLE}) - endif ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + endif () + endif () set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) -ENDMACRO (HDF_CHECK_TYPE_SIZE) +endmacro () diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 5a14990..2e99c94 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -11,9 +11,9 @@ include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) include (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) include (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) -if(CMAKE_CXX_COMPILER) +if (CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER_LOADED) include (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake) -endif(CMAKE_CXX_COMPILER) +endif () #----------------------------------------------------------------------------- # APPLE/Darwin setup @@ -28,29 +28,29 @@ if (APPLE) "variable has been set to a blank value which will build the default architecture for this system.") endif () set (${HDF_PREFIX}_AC_APPLE_UNIVERSAL_BUILD 0) -endif (APPLE) +endif () # Check for Darwin (not just Apple - we also want to catch OpenDarwin) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set (${HDF_PREFIX}_HAVE_DARWIN 1) -endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +endif () # Check for Solaris if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") set (${HDF_PREFIX}_HAVE_SOLARIS 1) -endif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") +endif () #----------------------------------------------------------------------------- # This MACRO checks IF the symbol exists in the library and IF it # does, it appends library to the list. #----------------------------------------------------------------------------- set (LINK_LIBS "") -MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) +macro (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE}) if (${VARIABLE}) set (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) - endif (${VARIABLE}) -ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) + endif () +endmacro () # ---------------------------------------------------------------------- # WINDOWS Hard code Values @@ -62,7 +62,7 @@ if (WIN32) set (${HDF_PREFIX}_HAVE_MINGW 1) set (WINDOWS 1) # MinGW tries to imitate Windows set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") - endif (MINGW) + endif () set (${HDF_PREFIX}_HAVE_WIN32_API 1) set (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") if (NOT UNIX AND NOT MINGW) @@ -70,9 +70,9 @@ if (WIN32) set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") if (MSVC) set (${HDF_PREFIX}_HAVE_VISUAL_STUDIO 1) - endif (MSVC) - endif (NOT UNIX AND NOT MINGW) -endif (WIN32) + endif () + endif () +endif () if (WINDOWS) set (${HDF_PREFIX}_HAVE_STDDEF_H 1) @@ -84,20 +84,20 @@ if (WINDOWS) set (${HDF_PREFIX}_HAVE_LONGJMP 1) if (NOT MINGW) set (${HDF_PREFIX}_HAVE_GETHOSTNAME 1) - endif (NOT MINGW) + endif () if (NOT UNIX AND NOT CYGWIN AND NOT MINGW) set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1) - endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW) + endif () set (${HDF_PREFIX}_HAVE_FUNCTION 1) set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1) set (${HDF_PREFIX}_HAVE_TIMEZONE 1) set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1) if (MINGW) set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1) - endif (MINGW) + endif () set (${HDF_PREFIX}_HAVE_LIBWS2_32 1) set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1) -endif (WINDOWS) +endif () # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values @@ -105,7 +105,7 @@ endif (WINDOWS) if (CYGWIN) set (${HDF_PREFIX}_HAVE_LSEEK64 0) -endif (CYGWIN) +endif () #----------------------------------------------------------------------------- # Check for the math library "m" @@ -115,7 +115,7 @@ if (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen ${HDF_PREFIX}_HAVE_LIBDL) CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup ${HDF_PREFIX}_HAVE_LIBWS2_32) CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname ${HDF_PREFIX}_HAVE_LIBWSOCK32) -endif (NOT WINDOWS) +endif () # UCB (BSD) compatibility library CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname ${HDF_PREFIX}_HAVE_LIBUCB) @@ -126,20 +126,20 @@ set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) set (USE_INCLUDES "") if (WINDOWS) set (USE_INCLUDES ${USE_INCLUDES} "windows.h") -endif (WINDOWS) +endif () if (NOT WINDOWS) TEST_BIG_ENDIAN (${HDF_PREFIX}_WORDS_BIGENDIAN) -endif (NOT WINDOWS) +endif () # For other specific tests, use this MACRO. -MACRO (HDF_FUNCTION_TEST OTHER_TEST) +macro (HDF_FUNCTION_TEST OTHER_TEST) if ("${HDF_PREFIX}_${OTHER_TEST}" MATCHES "^${HDF_PREFIX}_${OTHER_TEST}$") set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") set (OTHER_TEST_ADD_LIBRARIES) if (CMAKE_REQUIRED_LIBRARIES) set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - endif (CMAKE_REQUIRED_LIBRARIES) + endif () foreach (def HAVE_SYS_TIME_H @@ -149,14 +149,14 @@ MACRO (HDF_FUNCTION_TEST OTHER_TEST) ) if ("${${HDF_PREFIX}_${def}}") set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") - endif ("${${HDF_PREFIX}_${def}}") - endforeach (def) + endif () + endforeach () if (LARGEFILE) set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - endif (LARGEFILE) + endif () #message (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} @@ -169,16 +169,16 @@ MACRO (HDF_FUNCTION_TEST OTHER_TEST) if (${OTHER_TEST}) set (${HDF_PREFIX}_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") message (STATUS "Performing Other Test ${OTHER_TEST} - Success") - else (${OTHER_TEST}) + else () message (STATUS "Performing Other Test ${OTHER_TEST} - Failed") set (${HDF_PREFIX}_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing Other Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) - endif (${OTHER_TEST}) - endif ("${HDF_PREFIX}_${OTHER_TEST}" MATCHES "^${HDF_PREFIX}_${OTHER_TEST}$") -ENDMACRO (HDF_FUNCTION_TEST) + endif () + endif () +endmacro () #----------------------------------------------------------------------------- # Check for these functions before the time headers are checked @@ -188,12 +188,12 @@ HDF_FUNCTION_TEST (STDC_HEADERS) #----------------------------------------------------------------------------- # Check IF header file exists and add it to the list. #----------------------------------------------------------------------------- -MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) +macro (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE}) if (${VARIABLE}) set (USE_INCLUDES ${USE_INCLUDES} ${FILE}) - endif (${VARIABLE}) -ENDMACRO (CHECK_INCLUDE_FILE_CONCAT) + endif () +endmacro () #----------------------------------------------------------------------------- # Check for the existence of certain header files @@ -219,8 +219,8 @@ if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) if (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX) set (${HDF_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") set (USE_INCLUDES ${USE_INCLUDES} "stdint.h") - endif (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX) -endif (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) + endif () +endif () # Darwin CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_H) @@ -229,16 +229,16 @@ CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_ CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H) if (NOT CYGWIN) CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H) -endif (NOT CYGWIN) +endif () CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" ${HDF_PREFIX}_HAVE_SYS_TIMEB_H) if (CMAKE_SYSTEM_NAME MATCHES "OSF") CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H) CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" ${HDF_PREFIX}_HAVE_SYS_PROC_H) -else (CMAKE_SYSTEM_NAME MATCHES "OSF") +else () set (${HDF_PREFIX}_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) set (${HDF_PREFIX}_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) -endif (CMAKE_SYSTEM_NAME MATCHES "OSF") +endif () CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H) CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H) @@ -295,29 +295,29 @@ if (NOT WINDOWS) # check should be generalized for all POSIX systems as it # is in the Autotools. if (TEST_LFS_WORKS_COMPILE) - if (TEST_LFS_WORKS_RUN MATCHES 0) + if (TEST_LFS_WORKS_RUN MATCHES 0) set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) set (LARGEFILE 1) set (HDF_EXTRA_FLAGS ${HDF_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) message (STATUS "${msg}... yes") - else (TEST_LFS_WORKS_RUN MATCHES 0) + else () set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - endif (TEST_LFS_WORKS_RUN MATCHES 0) - else (TEST_LFS_WORKS_COMPILE ) + endif () + else () set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) - endif (TEST_LFS_WORKS_COMPILE) - endif (HDF_ENABLE_LARGE_FILE) + endif () + endif () set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_FLAGS}) - endif (NOT ${HDF_PREFIX}_HAVE_SOLARIS AND NOT ${HDF_PREFIX}_HAVE_DARWIN) -endif (NOT WINDOWS) + endif () +endif () add_definitions (${HDF_EXTRA_FLAGS}) @@ -331,7 +331,7 @@ if (NOT WINDOWS OR MINGW) CHECK_FUNCTION_EXISTS (fseeko64 ${HDF_PREFIX}_HAVE_FSEEKO64) CHECK_FUNCTION_EXISTS (ftello64 ${HDF_PREFIX}_HAVE_FTELLO64) CHECK_FUNCTION_EXISTS (ftruncate64 ${HDF_PREFIX}_HAVE_FTRUNCATE64) - endif (${HDF_PREFIX}_HAVE_OFF64_T) + endif () CHECK_FUNCTION_EXISTS (fseeko ${HDF_PREFIX}_HAVE_FSEEKO) CHECK_FUNCTION_EXISTS (ftello ${HDF_PREFIX}_HAVE_FTELLO) @@ -340,13 +340,13 @@ if (NOT WINDOWS OR MINGW) if (HAVE_STAT64_STRUCT) CHECK_FUNCTION_EXISTS (fstat64 ${HDF_PREFIX}_HAVE_FSTAT64) CHECK_FUNCTION_EXISTS (stat64 ${HDF_PREFIX}_HAVE_STAT64) - endif (HAVE_STAT64_STRUCT) -endif (NOT WINDOWS OR MINGW) + endif () +endif () #----------------------------------------------------------------------------- # Check the size in bytes of all the int and float types #----------------------------------------------------------------------------- -MACRO (HDF_CHECK_TYPE_SIZE type var) +macro (HDF_CHECK_TYPE_SIZE type var) set (aType ${type}) set (aVar ${var}) # message (STATUS "Checking size of ${aType} and storing into ${aVar}") @@ -354,8 +354,8 @@ MACRO (HDF_CHECK_TYPE_SIZE type var) if (NOT ${aVar}) set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") # message (STATUS "Size of ${aType} was NOT Found") - endif (NOT ${aVar}) -ENDMACRO (HDF_CHECK_TYPE_SIZE) + endif () +endmacro () HDF_CHECK_TYPE_SIZE (char ${HDF_PREFIX}_SIZEOF_CHAR) HDF_CHECK_TYPE_SIZE (short ${HDF_PREFIX}_SIZEOF_SHORT) @@ -363,12 +363,12 @@ HDF_CHECK_TYPE_SIZE (int ${HDF_PREFIX}_SIZEOF_INT) HDF_CHECK_TYPE_SIZE (unsigned ${HDF_PREFIX}_SIZEOF_UNSIGNED) if (NOT APPLE) HDF_CHECK_TYPE_SIZE (long ${HDF_PREFIX}_SIZEOF_LONG) -endif (NOT APPLE) +endif () HDF_CHECK_TYPE_SIZE ("long long" ${HDF_PREFIX}_SIZEOF_LONG_LONG) HDF_CHECK_TYPE_SIZE (__int64 ${HDF_PREFIX}_SIZEOF___INT64) if (NOT ${HDF_PREFIX}_SIZEOF___INT64) set (${HDF_PREFIX}_SIZEOF___INT64 0) -endif (NOT ${HDF_PREFIX}_SIZEOF___INT64) +endif () HDF_CHECK_TYPE_SIZE (float ${HDF_PREFIX}_SIZEOF_FLOAT) HDF_CHECK_TYPE_SIZE (double ${HDF_PREFIX}_SIZEOF_DOUBLE) @@ -407,17 +407,17 @@ if (NOT APPLE) HDF_CHECK_TYPE_SIZE (ssize_t ${HDF_PREFIX}_SIZEOF_SSIZE_T) if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T) set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0) - endif (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T) + endif () if (NOT WINDOWS) HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T) - endif (NOT WINDOWS) -endif (NOT APPLE) + endif () +endif () HDF_CHECK_TYPE_SIZE (off_t ${HDF_PREFIX}_SIZEOF_OFF_T) HDF_CHECK_TYPE_SIZE (off64_t ${HDF_PREFIX}_SIZEOF_OFF64_T) if (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) set (${HDF_PREFIX}_SIZEOF_OFF64_T 0) -endif (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) +endif () #----------------------------------------------------------------------------- # Extra C99 types @@ -428,9 +428,9 @@ CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H) if (HAVE_STDBOOL_H) set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h) HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL) -else (HAVE_STDBOOL_H) +else () HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL) -endif (HAVE_STDBOOL_H) +endif () if (NOT WINDOWS) #----------------------------------------------------------------------------- @@ -459,11 +459,11 @@ if (NOT WINDOWS) HAVE_STRUCT_TM_TM_ZONE ) HDF_FUNCTION_TEST (${test}) - endforeach (test) + endforeach () if (NOT CYGWIN AND NOT MINGW) HDF_FUNCTION_TEST (HAVE_TIMEZONE) # HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) - endif (NOT CYGWIN AND NOT MINGW) + endif () # ---------------------------------------------------------------------- # Does the struct stat have the st_blocks field? This field is not Posix. @@ -481,7 +481,7 @@ if (NOT WINDOWS) CHECK_FUNCTION_EXISTS (_scrsize ${HDF_PREFIX}_HAVE__SCRSIZE) if (NOT CYGWIN AND NOT MINGW) CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo ${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO) - endif (NOT CYGWIN AND NOT MINGW) + endif () CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGWINSZ) CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGETD) @@ -490,8 +490,8 @@ if (NOT WINDOWS) # if (NOT CYGWIN AND NOT MINGW) CHECK_FUNCTION_EXISTS (getpwuid ${HDF_PREFIX}_HAVE_GETPWUID) - endif (NOT CYGWIN AND NOT MINGW) -endif (NOT WINDOWS) + endif () +endif () #----------------------------------------------------------------------------- # Check for some functions that are used @@ -539,8 +539,8 @@ CHECK_FUNCTION_EXISTS (vsnprintf ${HDF_PREFIX}_HAVE_VSNPRINTF) if (NOT WINDOWS) if (${HDF_PREFIX}_HAVE_VSNPRINTF) HDF_FUNCTION_TEST (VSNPRINTF_WORKS) - endif (${HDF_PREFIX}_HAVE_VSNPRINTF) -endif (NOT WINDOWS) + endif () +endif () #----------------------------------------------------------------------------- # sigsetjmp is special; may actually be a macro @@ -550,9 +550,9 @@ if (NOT ${HDF_PREFIX}_HAVE_SIGSETJMP) CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" ${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) if (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) set (${HDF_PREFIX}_HAVE_SIGSETJMP 1) - endif (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) - endif (${HDF_PREFIX}_HAVE_SETJMP_H) -endif (NOT ${HDF_PREFIX}_HAVE_SIGSETJMP) + endif () + endif () +endif () #----------------------------------------------------------------------------- # Check a bunch of other functions @@ -568,17 +568,17 @@ if (NOT WINDOWS) HAVE_SOCKLEN_T ) HDF_FUNCTION_TEST (${test}) - endforeach (test) -endif (NOT WINDOWS) + endforeach () +endif () # For other CXX specific tests, use this MACRO. -MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) +macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) if ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") set (OTHER_TEST_ADD_LIBRARIES) if (CMAKE_REQUIRED_LIBRARIES) set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - endif (CMAKE_REQUIRED_LIBRARIES) + endif () foreach (def HAVE_SYS_TIME_H @@ -588,14 +588,14 @@ MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) ) if ("${${HDF_PREFIX}_${def}}") set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") - endif ("${${HDF_PREFIX}_${def}}") - endforeach (def) + endif () + endforeach () if (LARGEFILE) set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - endif (LARGEFILE) + endif () #message (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} @@ -608,16 +608,16 @@ MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) if (${OTHER_TEST} EQUAL 0) set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") message (STATUS "Performing CXX Test ${OTHER_TEST} - Success") - else (${OTHER_TEST} EQUAL 0) + else () message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) - endif (${OTHER_TEST} EQUAL 0) - endif ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") -ENDMACRO (HDF_CXX_FUNCTION_TEST) + endif () + endif () +endmacro () #----------------------------------------------------------------------------- # Check a bunch of cxx functions @@ -632,8 +632,8 @@ if (CMAKE_CXX_COMPILER_LOADED) CXX_HAVE_OFFSETOF ) HDF_CXX_FUNCTION_TEST (${test}) - endforeach (test) -endif (CMAKE_CXX_COMPILER_LOADED) + endforeach () +endif () #----------------------------------------------------------------------------- # Check if InitOnceExecuteOnce is available @@ -646,21 +646,21 @@ if (WINDOWS) set (CMAKE_REQUIRED_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - endif (LARGEFILE) + endif () set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}") if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - else (CMAKE_REQUIRED_LIBRARIES) + else () set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) - endif (CMAKE_REQUIRED_LIBRARIES) + endif () if (CMAKE_REQUIRED_INCLUDES) set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - else (CMAKE_REQUIRED_INCLUDES) + else () set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) - endif (CMAKE_REQUIRED_INCLUDES) + endif () TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED ${CMAKE_BINARY_DIR} @@ -674,7 +674,7 @@ if (WINDOWS) # if it did not compile make the return value fail code of 1 if (NOT HAVE_IOEO_COMPILED) set (HAVE_IOEO_EXITCODE 1) - endif (NOT HAVE_IOEO_COMPILED) + endif () # if the return value was 0 then it worked if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) set (${HDF_PREFIX}_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") @@ -683,22 +683,22 @@ if (WINDOWS) "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO}\n") - else ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + else () if (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") set (${HDF_PREFIX}_HAVE_IOEO "${HAVE_IOEO_EXITCODE}") - else (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + else () set (${HDF_PREFIX}_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") - endif (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + endif () message (STATUS "Performing Test InitOnceExecuteOnce - Failed") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing InitOnceExecuteOnce Test failed with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO_EXITCODE}\n") - endif ("${HAVE_IOEO_EXITCODE}" EQUAL 0) - endif ("${${HDF_PREFIX}_HAVE_IOEO}" MATCHES "^${${HDF_PREFIX}_HAVE_IOEO}$") - endif (NOT HDF_NO_IOEO_TEST) -endif (WINDOWS) + endif () + endif () + endif () +endif () #----------------------------------------------------------------------------- # Determine how 'inline' is used @@ -706,7 +706,7 @@ endif (WINDOWS) foreach (inline_test inline __inline__ __inline) string (TOUPPER ${inline_test} INLINE_TEST_MACRO) HDF_FUNCTION_TEST (HAVE_${INLINE_TEST_MACRO}) -endforeach (inline_test) +endforeach () #----------------------------------------------------------------------------- # Check how to print a Long Long integer @@ -717,7 +717,7 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH") if (${HDF_PREFIX}_SIZEOF_LONG_LONG) set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") - endif (${HDF_PREFIX}_SIZEOF_LONG_LONG) + endif () TRY_RUN (${HDF_PREFIX}_PRINTF_LL_TEST_RUN ${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c @@ -729,24 +729,24 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " string(REGEX REPLACE ".*PRINTF_LL_WIDTH=\\[(.*)\\].*" "\\1" ${HDF_PREFIX}_PRINTF_LL "${OUTPUT}") set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${${HDF_PREFIX}_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") set (PRINT_LL_FOUND 1) - else (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0) + else () message ("Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") - endif (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0) - else (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE) + endif () + else () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed with the following output:\n ${OUTPUT}\n" ) - endif (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE) + endif () if (PRINT_LL_FOUND) message (STATUS "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") - else (PRINT_LL_FOUND) + else () message (STATUS "Checking for appropriate format for 64 bit long: not found") set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll" ) - endif (PRINT_LL_FOUND) -endif (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "unknown") + endif () +endif () # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle converting diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index 1a02f82..ff1ead2 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -114,9 +114,10 @@ include(GetPrerequisites) # # Start out with the generic MPI compiler names, as these are most commonly used. -set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) +set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r mpicc.bat) set(_MPI_CXX_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ - mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) + mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r + mpicxx.bat) set(_MPI_Fortran_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r mpif90 mpif90_r mpf90 mpf90_r mpif77 mpif77_r mpf77 mpf77_r) @@ -128,9 +129,9 @@ set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpig77 mpig77_r mpg77 mpg77_r) # Intel MPI compiler names -set(_MPI_Intel_C_COMPILER_NAMES mpiicc) -set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC) -set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) +set(_MPI_Intel_C_COMPILER_NAMES mpiicc mpiicc.bat) +set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC mpiicpc.bat) +set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77 mpiifort.bat) # PGI compiler names set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) @@ -314,8 +315,9 @@ function (interrogate_mpi_compiler lang try_libs) set(MPI_COMPILE_FLAGS_WORK) foreach(FLAG ${MPI_ALL_COMPILE_FLAGS}) + string(REGEX REPLACE "^ " "" FLAG ${FLAG}) if (MPI_COMPILE_FLAGS_WORK) - string(APPEND MPI_COMPILE_FLAGS_WORK " ${FLAG}") + set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}") else() set(MPI_COMPILE_FLAGS_WORK ${FLAG}) endif() @@ -323,9 +325,13 @@ function (interrogate_mpi_compiler lang try_libs) # Extract include paths from compile command line string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") + set(MPI_INCLUDE_PATH_WORK) + foreach(IPATH ${MPI_ALL_INCLUDE_PATHS}) string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH}) string(REPLACE "//" "/" IPATH ${IPATH}) + string(REPLACE "\"" "" IPATH ${IPATH}) + file(TO_CMAKE_PATH "${IPATH}" IPATH) list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH}) endforeach() @@ -363,8 +369,9 @@ function (interrogate_mpi_compiler lang try_libs) string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") set(MPI_LINK_FLAGS_WORK) foreach(FLAG ${MPI_ALL_LINK_FLAGS}) + string(REGEX REPLACE "^ " "" FLAG ${FLAG}) if (MPI_LINK_FLAGS_WORK) - string(APPEND MPI_LINK_FLAGS_WORK " ${FLAG}") + set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}") else() set(MPI_LINK_FLAGS_WORK ${FLAG}) endif() @@ -386,8 +393,7 @@ function (interrogate_mpi_compiler lang try_libs) # in the showme list that can only be found in the implicit # link directories of the compiler. if (DEFINED CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES) - string(APPEND MPI_LINK_PATH - ";${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}") + set(MPI_LINK_PATH "${MPI_LINK_PATH};${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}") endif () # Determine full path names for all of the libraries that one needs @@ -462,11 +468,11 @@ function (interrogate_mpi_compiler lang try_libs) set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) find_path(MPI_HEADER_PATH mpifptr.h HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES include include/${MS_MPI_ARCH_DIR} include/${MS_MPI_ARCH_DIR2} Inc Inc/${MS_MPI_ARCH_DIR} Inc/${MS_MPI_ARCH_DIR2}) + PATH_SUFFIXES include Include include/${MS_MPI_ARCH_DIR} Include/${MS_MPI_ARCH_DIR2} Include/${MS_MPI_ARCH_DIR} include/${MS_MPI_ARCH_DIR2} Inc Inc/${MS_MPI_ARCH_DIR} Inc/${MS_MPI_ARCH_DIR2}) if (MPI_INCLUDE_PATH_WORK AND MPI_HEADER_PATH) list(APPEND MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) - endif() - + endif () + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) find_library(MPI_LIB NAMES fmpi fmpich fmpich2 fmpich2g msmpifec msmpifmc @@ -474,8 +480,8 @@ function (interrogate_mpi_compiler lang try_libs) PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}) if (MPI_LIBRARIES_WORK AND MPI_LIB) list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) - endif() - endif() + endif () + endif () if (NOT MPI_LIBRARIES_WORK) set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND") @@ -624,6 +630,9 @@ foreach (lang C CXX Fortran) try_regular_compiler(${lang} regular_compiler_worked) endif() + # add fortran mpi module path if ENV VAR exists + set (MPI_${lang}_INCLUDE_PATH "${MPI_${lang}_INCLUDE_PATH};$ENV{MPI_FORTRAN_MOD_DIR}") + set(MPI_${lang}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) set(MPI_${lang}_FIND_REQUIRED ${MPI_FIND_REQUIRED}) set(MPI_${lang}_FIND_VERSION ${MPI_FIND_VERSION}) diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake index 5f0f031..bb5f8d6 100644 --- a/config/cmake_ext_mod/FindSZIP.cmake +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -24,7 +24,7 @@ # made to remove references to Qt and make this file more generally applicable ######################################################################### -MACRO (SZIP_ADJUST_LIB_VARS basename) +macro (SZIP_ADJUST_LIB_VARS basename) if (${basename}_INCLUDE_DIR) # if only the release version was found, set the debug variable also to the release version @@ -32,38 +32,37 @@ MACRO (SZIP_ADJUST_LIB_VARS basename) set (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE}) set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE}) set (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE}) - endif (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) + endif () # if only the debug version was found, set the release variable also to the debug version if (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) set (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG}) set (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG}) set (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG}) - endif (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) + endif () if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) # if the generator supports configuration types then set # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) set (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) - else (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + else () # if there are no configuration types and CMAKE_BUILD_TYPE has no value # then just use the release libraries set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) - endif (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + endif () set (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) - endif (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) + endif () set (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library") if (${basename}_LIBRARY) set (${basename}_FOUND 1) - endif (${basename}_LIBRARY) - - endif (${basename}_INCLUDE_DIR ) + endif () + endif () # Make variables changeble to the advanced user MARK_AS_ADVANCED (${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ${basename}_INCLUDE_DIR ) -ENDMACRO (SZIP_ADJUST_LIB_VARS) +endmacro () # Look for the header file. @@ -93,10 +92,10 @@ FIND_PATH (SZIP_INCLUDE_DIR if (WIN32) set (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") set (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip") -else (WIN32) +else () set (SZIP_SEARCH_DEBUG_NAMES "sz_d") set (SZIP_SEARCH_RELEASE_NAMES "sz;szip") -endif (WIN32) +endif () # Look for the library. FIND_LIBRARY (SZIP_LIBRARY_DEBUG @@ -120,16 +119,15 @@ if (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) if (SZIP_LIBRARY_DEBUG) get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_DEBUG} PATH) set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - elseif (SZIP_LIBRARY_RELEASE) + elseif () get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_RELEASE} PATH) set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - endif (SZIP_LIBRARY_DEBUG) - -else (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + endif () +else () set (SZIP_FOUND 0) set (SZIP_LIBRARIES) set (SZIP_INCLUDE_DIRS) -endif (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) +endif () # Report the results. if (NOT SZIP_FOUND) @@ -138,12 +136,12 @@ if (NOT SZIP_FOUND) ) if (NOT SZIP_FIND_QUIETLY) message (STATUS "${SZIP_DIR_MESSAGE}") - else (NOT SZIP_FIND_QUIETLY) + else () if (SZIP_FIND_REQUIRED) message (FATAL_ERROR "SZip was NOT found and is Required by this project") - endif (SZIP_FIND_REQUIRED) - endif (NOT SZIP_FIND_QUIETLY) -endif (NOT SZIP_FOUND) + endif () + endif () +endif () if (SZIP_FOUND) include (CheckSymbolExists) @@ -161,7 +159,7 @@ if (SZIP_FOUND) set (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) # ############################################# -endif (SZIP_FOUND) +endif () if (FIND_SZIP_DEBUG) message (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") @@ -169,4 +167,4 @@ if (FIND_SZIP_DEBUG) message (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}") message (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}") message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") -endif (FIND_SZIP_DEBUG) +endif () diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 2145a3d..9d50f50 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -17,6 +17,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) elseif (${compress_type} MATCHES "GIT") @@ -33,6 +34,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) elseif (${compress_type} MATCHES "TGZ") @@ -49,9 +51,10 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) - endif (${compress_type} MATCHES "SVN") + endif () externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR) ##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) @@ -68,13 +71,13 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) add_dependencies (JPEG jpeg-shared) set (JPEG_SHARED_LIBRARY "jpeg-shared") set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_shared_LIBRARY}) - endif (BUILD_SHARED_LIBS) + endif () set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") set (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") set (JPEG_FOUND 1) set (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) -endmacro (EXTERNAL_JPEG_LIBRARY) +endmacro () #------------------------------------------------------------------------------- macro (PACKAGE_JPEG_LIBRARY compress_type) @@ -85,8 +88,8 @@ macro (PACKAGE_JPEG_LIBRARY compress_type) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") add_dependencies (JPEG-GenHeader-Copy JPEG) - endif (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") -endmacro (PACKAGE_JPEG_LIBRARY) + endif () +endmacro () #------------------------------------------------------------------------------- macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) @@ -104,6 +107,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) @@ -121,6 +125,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) @@ -138,10 +143,11 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) - endif (${compress_type} MATCHES "SVN") + endif () externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) ##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) @@ -158,13 +164,13 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) add_dependencies (SZIP szip-shared) set (SZIP_SHARED_LIBRARY "szip-shared") set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_shared_LIBRARY}) - endif (BUILD_SHARED_LIBS) + endif () set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") set (SZIP_FOUND 1) set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) -endmacro (EXTERNAL_SZIP_LIBRARY) +endmacro () #------------------------------------------------------------------------------- macro (PACKAGE_SZIP_LIBRARY compress_type) @@ -175,8 +181,8 @@ macro (PACKAGE_SZIP_LIBRARY compress_type) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") add_dependencies (SZIP-GenHeader-Copy SZIP) - endif (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") -endmacro (PACKAGE_SZIP_LIBRARY) + endif () +endmacro () #------------------------------------------------------------------------------- macro (EXTERNAL_ZLIB_LIBRARY compress_type) @@ -194,6 +200,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) elseif (${compress_type} MATCHES "GIT") @@ -210,6 +217,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) elseif (${compress_type} MATCHES "TGZ") @@ -226,16 +234,17 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) - endif (${compress_type} MATCHES "SVN") + endif () externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR) if (WIN32) set (ZLIB_LIB_NAME "zlib") - else (WIN32) + else () set (ZLIB_LIB_NAME "z") - endif (WIN32) + endif () ##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target zlib-static add_library(zlib-static STATIC IMPORTED) @@ -250,13 +259,13 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) add_dependencies (ZLIB zlib-shared) set (ZLIB_SHARED_LIBRARY "zlib-shared") set (ZLIB_LIBRARIES ${ZLIB_LIBRARIES} ${ZLIB_SHARED_LIBRARY}) - endif (BUILD_SHARED_LIBS) + endif () set (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") set (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") set (ZLIB_FOUND 1) set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) -endmacro (EXTERNAL_ZLIB_LIBRARY) +endmacro () #------------------------------------------------------------------------------- macro (PACKAGE_ZLIB_LIBRARY compress_type) @@ -267,5 +276,5 @@ macro (PACKAGE_ZLIB_LIBRARY compress_type) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") add_dependencies (ZLIB-GenHeader-Copy ZLIB) - endif (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") -endmacro (PACKAGE_ZLIB_LIBRARY) + endif () +endmacro () diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 1d6b49a..ecf3be0 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------- macro (SET_GLOBAL_VARIABLE name value) set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) -endmacro (SET_GLOBAL_VARIABLE) +endmacro () #------------------------------------------------------------------------------- macro (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) @@ -14,7 +14,7 @@ macro (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) -endmacro (IDE_GENERATED_PROPERTIES) +endmacro () #------------------------------------------------------------------------------- macro (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) @@ -31,45 +31,49 @@ macro (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) -endmacro (IDE_SOURCE_PROPERTIES) +endmacro () #------------------------------------------------------------------------------- macro (TARGET_NAMING libtarget libtype) if (${libtype} MATCHES "SHARED") set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}${ARGN}") - endif (${libtype} MATCHES "SHARED") -endmacro (TARGET_NAMING) + endif () +endmacro () #------------------------------------------------------------------------------- macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) if (WIN32 AND MSVC) - get_target_property (target_name ${libtarget} OUTPUT_NAME_RELWITHDEBINFO) + get_target_property (target_type ${libtarget} TYPE) + if (${libtype} MATCHES "SHARED") + set (targetfilename $) + else () + get_property (target_name TARGET ${libtarget} PROPERTY OUTPUT_NAME_RELWITHDEBINFO) + set (targetfilename $/${target_name}.pdb) + endif () install ( FILES - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${target_name}.pdb + ${targetfilename} DESTINATION ${targetdestination} CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - endif (WIN32 AND MSVC) -endmacro (INSTALL_TARGET_PDB) + endif () +endmacro () #------------------------------------------------------------------------------- macro (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) if (WIN32 AND MSVC) - get_target_property (target_name ${progtarget} OUTPUT_NAME_RELWITHDEBINFO) - get_target_property (target_prefix ${progtarget} PREFIX) install ( FILES - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target_prefix}${target_name}.pdb + $ DESTINATION ${targetdestination} CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - endif (WIN32 AND MSVC) -endmacro (INSTALL_PROGRAM_PDB) + endif () +endmacro () #------------------------------------------------------------------------------- macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) @@ -77,19 +81,19 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) if (WIN32) set (LIB_RELEASE_NAME "${libname}") set (LIB_DEBUG_NAME "${libname}_D") - else (WIN32) + else () set (LIB_RELEASE_NAME "${libname}") set (LIB_DEBUG_NAME "${libname}_debug") - endif (WIN32) - else (${libtype} MATCHES "SHARED") + endif () + else () if (WIN32) set (LIB_RELEASE_NAME "lib${libname}") set (LIB_DEBUG_NAME "lib${libname}_D") - else (WIN32) + else () set (LIB_RELEASE_NAME "${libname}") set (LIB_DEBUG_NAME "${libname}_debug") - endif (WIN32) - endif (${libtype} MATCHES "SHARED") + endif () + endif () set_target_properties (${libtarget} PROPERTIES @@ -98,6 +102,18 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME} ) + if (${libtype} MATCHES "STATIC") + if (WIN32) + set_target_properties (${libtarget} + PROPERTIES + COMPILE_PDB_NAME_DEBUG ${LIB_DEBUG_NAME} + COMPILE_PDB_NAME_RELEASE ${LIB_RELEASE_NAME} + COMPILE_PDB_NAME_MINSIZEREL ${LIB_RELEASE_NAME} + COMPILE_PDB_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME} + COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" + ) + endif () + endif () #----- Use MSVC Naming conventions for Shared Libraries if (MINGW AND ${libtype} MATCHES "SHARED") @@ -107,9 +123,8 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) IMPORT_PREFIX "" PREFIX "" ) - endif (MINGW AND ${libtype} MATCHES "SHARED") - -endmacro (HDF_SET_LIB_OPTIONS) + endif () +endmacro () #------------------------------------------------------------------------------- macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) @@ -117,12 +132,12 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") - endif (${importtype} MATCHES "IMPORT") + endif () if (${CMAKE_BUILD_TYPE} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) - else (${CMAKE_BUILD_TYPE} MATCHES "Debug") + else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) - endif (${CMAKE_BUILD_TYPE} MATCHES "Debug") + endif () if (${libtype} MATCHES "SHARED") if (WIN32) @@ -131,91 +146,74 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}.lib" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - else (MINGW) + else () set_target_properties (${libtarget} PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" - ) - endif (MINGW) - else (WIN32) + ) + endif () + else () if (CYGWIN) set_target_properties (${libtarget} PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - else (CYGWIN) + else () set_target_properties (${libtarget} PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_SONAME "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${libversion}" SOVERSION "${libversion}" ) - endif (CYGWIN) - endif (WIN32) - else (${libtype} MATCHES "SHARED") + endif () + endif () + else () if (WIN32 AND NOT MINGW) set_target_properties (${libtarget} PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - else (WIN32 AND NOT MINGW) + else () set_target_properties (${libtarget} PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_STATIC_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - endif (WIN32 AND NOT MINGW) - endif (${libtype} MATCHES "SHARED") - -endmacro (HDF_IMPORT_SET_LIB_OPTIONS) + endif () + endif () +endmacro () #------------------------------------------------------------------------------- macro (TARGET_C_PROPERTIES wintarget libtype addcompileflags addlinkflags) if (MSVC) TARGET_MSVC_PROPERTIES (${wintarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - else (MSVC) - set_target_properties (${wintarget} - PROPERTIES - COMPILE_FLAGS "${addcompileflags}" - LINK_FLAGS "${addlinkflags}" - ) - endif (MSVC) -endmacro (TARGET_C_PROPERTIES) + else () + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}") + endif () +endmacro () #------------------------------------------------------------------------------- macro (TARGET_MSVC_PROPERTIES wintarget libtype addcompileflags addlinkflags) if (MSVC) - set_target_properties (${wintarget} - PROPERTIES - COMPILE_FLAGS "${addcompileflags}" - LINK_FLAGS "${addlinkflags}" - ) - endif (MSVC) -endmacro (TARGET_MSVC_PROPERTIES) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}") + endif () +endmacro () #------------------------------------------------------------------------------- macro (TARGET_FORTRAN_PROPERTIES forttarget libtype addcompileflags addlinkflags) if (WIN32) TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - endif (WIN32) -endmacro (TARGET_FORTRAN_PROPERTIES) + endif () +endmacro () #------------------------------------------------------------------------------- macro (TARGET_FORTRAN_WIN_PROPERTIES forttarget libtype addcompileflags addlinkflags) if (MSVC) if (${libtype} MATCHES "SHARED") - set_target_properties (${forttarget} - PROPERTIES - COMPILE_FLAGS "/dll ${addcompileflags}" - LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" - ) - else (${libtype} MATCHES "SHARED") - set_target_properties (${forttarget} - PROPERTIES - COMPILE_FLAGS "${addcompileflags}" - LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" - ) - endif (${libtype} MATCHES "SHARED") - endif (MSVC) -endmacro (TARGET_FORTRAN_WIN_PROPERTIES) + set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}") + else () + set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}") + endif () + endif () +endmacro () #----------------------------------------------------------------------------- # Configure the README.txt file for the binary package @@ -228,16 +226,16 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_INSTALL_ENDING "msi") if (CMAKE_CL_64) set (BINARY_SYSTEM_NAME "win64") - else (CMAKE_CL_64) + else () set (BINARY_SYSTEM_NAME "win32") - endif (CMAKE_CL_64) + endif () if (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") set (BINARY_PLATFORM "${BINARY_PLATFORM} 7") elseif (${CMAKE_SYSTEM_VERSION} MATCHES "6.2") set (BINARY_PLATFORM "${BINARY_PLATFORM} 8") elseif (${CMAKE_SYSTEM_VERSION} MATCHES "6.3") set (BINARY_PLATFORM "${BINARY_PLATFORM} 10") - endif (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") + endif () set (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") if (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") @@ -249,36 +247,36 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2013") elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "19.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015") - else (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + else () set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") - endif (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + endif () elseif (APPLE) set (BINARY_EXAMPLE_ENDING "tar.gz") set (BINARY_INSTALL_ENDING "dmg") set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") - else (WIN32) + else () set (BINARY_EXAMPLE_ENDING "tar.gz") set (BINARY_INSTALL_ENDING "sh") set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") - endif (WIN32) + endif () if (target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM} / ${CMAKE_Fortran_COMPILER_ID} Fortran") - endif (target_fortran) + endif () if (BUILD_SHARED_LIBS) set (LIB_TYPE "Static and Shared") - else (BUILD_SHARED_LIBS) + else () set (LIB_TYPE "Static") - endif (BUILD_SHARED_LIBS) + endif () configure_file ( ${HDF_RESOURCES_DIR}/README.txt.cmake.in ${CMAKE_BINARY_DIR}/README.txt @ONLY ) -endmacro (HDF_README_PROPERTIES) +endmacro () macro (HDFTEST_COPY_FILE src dest target) add_custom_command( diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index 275f2ea..bf254a1 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -26,14 +26,14 @@ set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}") # The provided CMake Fortran macros don't provide a general check function # so this one is used for a sizeof test. #----------------------------------------------------------------------------- -MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) +macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) message (STATUS "Testing Fortran ${FUNCTION}") if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - else (CMAKE_REQUIRED_LIBRARIES) + else () set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - endif (CMAKE_REQUIRED_LIBRARIES) + endif () file (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90 "${CODE}" @@ -63,8 +63,7 @@ MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") endif () - -ENDMACRO (CHECK_FORTRAN_FEATURE) +endmacro () #----------------------------------------------------------------------------- # Configure Checks which require Fortran compilation must go in here @@ -75,7 +74,7 @@ ENDMACRO (CHECK_FORTRAN_FEATURE) #----------------------------------------------------------------------------- # Check for Non-standard extension intrinsic function SIZEOF -set(FORTRAN_HAVE_SIZEOF FALSE) +set (FORTRAN_HAVE_SIZEOF FALSE) CHECK_FORTRAN_FEATURE(sizeof " PROGRAM main @@ -86,7 +85,7 @@ CHECK_FORTRAN_FEATURE(sizeof ) # Check for F2008 standard intrinsic function C_SIZEOF -set(FORTRAN_HAVE_C_SIZEOF FALSE) +set (FORTRAN_HAVE_C_SIZEOF FALSE) CHECK_FORTRAN_FEATURE(c_sizeof " PROGRAM main @@ -112,7 +111,7 @@ CHECK_FORTRAN_FEATURE(storage_size ) # Check for F2008 standard intrinsic module "ISO_FORTRAN_ENV" -set(HAVE_ISO_FORTRAN_ENV FALSE) +set (HAVE_ISO_FORTRAN_ENV FALSE) CHECK_FORTRAN_FEATURE(ISO_FORTRAN_ENV " PROGRAM main @@ -122,7 +121,7 @@ CHECK_FORTRAN_FEATURE(ISO_FORTRAN_ENV HAVE_ISO_FORTRAN_ENV ) -set(FORTRAN_DEFAULT_REAL_NOT_DOUBLE FALSE) +set (FORTRAN_DEFAULT_REAL_NOT_DOUBLE FALSE) CHECK_FORTRAN_FEATURE(RealIsNotDouble " MODULE type_mod @@ -152,7 +151,7 @@ CHECK_FORTRAN_FEATURE(RealIsNotDouble #----------------------------------------------------------------------------- # Checks if the ISO_C_BINDING module meets all the requirements #----------------------------------------------------------------------------- -set(FORTRAN_HAVE_ISO_C_BINDING FALSE) +set (FORTRAN_HAVE_ISO_C_BINDING FALSE) CHECK_FORTRAN_FEATURE(iso_c_binding " PROGRAM main @@ -175,5 +174,5 @@ if (CMAKE_Fortran_COMPILER MATCHES ifort) if (WIN32) set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) - endif (WIN32) -endif (CMAKE_Fortran_COMPILER MATCHES ifort) + endif () +endif () diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index a090057..31c8421 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -4,25 +4,25 @@ # arguments checking if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") -endif (NOT TEST_PROGRAM) +endif () #if (NOT TEST_ARGS) # message (STATUS "Require TEST_ARGS to be defined") -#endif (NOT TEST_ARGS) +#endif () if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif (NOT TEST_FOLDER) +endif () if (NOT TEST_OUTPUT) message (FATAL_ERROR "Require TEST_OUTPUT to be defined") -endif (NOT TEST_OUTPUT) +endif () #if (NOT TEST_EXPECT) # message (STATUS "Require TEST_EXPECT to be defined") -#endif (NOT TEST_EXPECT) +#endif () if (NOT TEST_FILTER) message (STATUS "Require TEST_FILTER to be defined") -endif (NOT TEST_FILTER) +endif () if (NOT TEST_REFERENCE) message (FATAL_ERROR "Require TEST_REFERENCE to be defined") -endif (NOT TEST_REFERENCE) +endif () message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") @@ -48,7 +48,7 @@ string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) if (${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") -endif (${TEST_RESULT} STREQUAL "0") +endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) if (${TEST_EXPECT} STREQUAL "1") @@ -56,8 +56,8 @@ if (${TEST_EXPECT} STREQUAL "1") string (LENGTH "${TEST_MATCH}" TEST_RESULT) if (NOT ${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") - endif (NOT ${TEST_RESULT} STREQUAL "0") -endif (${TEST_EXPECT} STREQUAL "1") + endif () +endif () # everything went fine... message ("Passed: The output of ${TEST_PROGRAM} matched") diff --git a/config/cmake_ext_mod/prunTest.cmake b/config/cmake_ext_mod/prunTest.cmake deleted file mode 100644 index 38ecb7e..0000000 --- a/config/cmake_ext_mod/prunTest.cmake +++ /dev/null @@ -1,145 +0,0 @@ -# runTest.cmake executes a command and captures the output in a file. File is then compared -# against a reference file. Exit status of command can also be compared. -cmake_policy(SET CMP0007 NEW) - -# arguments checking -if (NOT TEST_PROGRAM) - message (FATAL_ERROR "Require TEST_PROGRAM to be defined") -endif (NOT TEST_PROGRAM) -#if (NOT TEST_ARGS) -# message (STATUS "Require TEST_ARGS to be defined") -#endif (NOT TEST_ARGS) -if (NOT TEST_FOLDER) - message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif (NOT TEST_FOLDER) -if (NOT TEST_OUTPUT) - message (FATAL_ERROR "Require TEST_OUTPUT to be defined") -endif (NOT TEST_OUTPUT) -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif (NOT TEST_EXPECT) -#if (NOT TEST_FILTER) -# message (STATUS "Require TEST_FILTER to be defined") -#endif (NOT TEST_FILTER) -if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - message (FATAL_ERROR "Require TEST_REFERENCE to be defined") -endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - -set (ERROR_APPEND 1) - -message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") - -if (TEST_ENV_VAR) - set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") -endif (TEST_ENV_VAR) - -# run the test program, capture the stdout/stderr and the result var -EXECUTE_PROCESS ( - COMMAND ${TEST_PROGRAM} ${TEST_ARGS} - WORKING_DIRECTORY ${TEST_FOLDER} - RESULT_VARIABLE TEST_RESULT - OUTPUT_FILE ${TEST_OUTPUT} - ERROR_FILE ${TEST_OUTPUT}.err - OUTPUT_VARIABLE TEST_OUT - ERROR_VARIABLE TEST_ERROR -) - -message (STATUS "COMMAND Result: ${TEST_RESULT}") - -file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) -file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") - -if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) - -if (TEST_APPEND) - file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_ERROR}\n") -endif (TEST_APPEND) - -message (STATUS "COMMAND Error: ${TEST_ERROR}") - -if (TEST_MASK) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif (TEST_MASK) - -if (TEST_MASK_MOD) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif (TEST_MASK_MOD) - -if (TEST_MASK_ERROR) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") - STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif (TEST_MASK_ERROR) - -if (TEST_FILTER) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif (TEST_FILTER) - -#if (TEST_REF_FILTER) -# message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") -# file (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) -# STRING(REGEX REPLACE "${TEST_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") -# file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") -#endif (TEST_REF_FILTER) - -if (NOT TEST_SKIP_COMPARE) - if (WIN32 AND NOT MINGW) - file (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) - file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") - endif (WIN32 AND NOT MINGW) - - # now compare the output with the reference - EXECUTE_PROCESS ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/P_${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) - if (NOT ${TEST_RESULT} STREQUAL 0) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) - LIST (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/P_${TEST_REFERENCE} test_ref) - LIST (LENGTH test_ref len_ref) - if (NOT ${len_act} STREQUAL "0") - MATH (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - LIST (GET test_act ${line} str_act) - LIST (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") - set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - endif (NOT "${str_act}" STREQUAL "") - endif (NOT "${str_act}" STREQUAL "${str_ref}") - endforeach (line RANGE 0 ${_FP_LEN}) - endif (NOT ${len_act} STREQUAL "0") - if (NOT ${len_act} STREQUAL ${len_ref}) - set (TEST_RESULT 1) - endif (NOT ${len_act} STREQUAL ${len_ref}) - endif (NOT ${TEST_RESULT} STREQUAL 0) - - message (STATUS "COMPARE Result: ${TEST_RESULT}") - - # again, if return value is !=0 scream and shout - if (NOT ${TEST_RESULT} STREQUAL 0) - message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match P_${TEST_REFERENCE}") - endif (NOT ${TEST_RESULT} STREQUAL 0) -endif (NOT TEST_SKIP_COMPARE) - -# everything went fine... -message ("Passed: The output of ${TEST_PROGRAM} matches P_${TEST_REFERENCE}") - diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 48e9d03..9a2236e 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -6,9 +6,6 @@ cmake_policy(SET CMP0007 NEW) if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") endif () -#if (NOT TEST_ARGS) -# message (STATUS "Require TEST_ARGS to be defined") -#endif () if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") endif () @@ -18,20 +15,17 @@ endif () if (NOT TEST_EXPECT) message (STATUS "Require TEST_EXPECT to be defined") endif () -#if (NOT TEST_FILTER) -# message (STATUS "Require TEST_FILTER to be defined") -#endif () if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) message (FATAL_ERROR "Require TEST_REFERENCE to be defined") -endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) +endif () if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) -endif (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) +endif () if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) -endif (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) +endif () # if there is not an error reference file add the error output to the stdout file if (NOT TEST_ERRREF) @@ -40,6 +34,14 @@ endif () message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") +if (TEST_LIBRARY_DIRECTORY) + if (WIN32 AND NOT MINGW) + set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") + else () + set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") + endif () +endif () + if (TEST_ENV_VAR) set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") endif () @@ -69,6 +71,16 @@ else () ) endif () +if (TEST_REGEX) + # TEST_REGEX should always be matched + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM}) + string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT) + if (${REGEX_RESULT} STREQUAL "0") + message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}") + endif () +endif () + message (STATUS "COMMAND Result: ${TEST_RESULT}") # if the .err file exists and ERRROR_APPEND is enabled @@ -84,7 +96,13 @@ endif () # if the return value is !=${TEST_EXPECT} bail out if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") + if (NOT TEST_NOERRDISPLAY) + if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + message (STATUS "Output :\n${TEST_STREAM}") + endif () + endif () + message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") endif () message (STATUS "COMMAND Error: ${TEST_ERROR}") @@ -125,15 +143,22 @@ if (TEST_MASK_ERROR) else () file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") endif () -endif (TEST_MASK_ERROR) +endif () # remove text from the output file if (TEST_FILTER) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - string (REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") + string (REGEX REPLACE "${TEST_FILTER}" "${TEST_FILTER_REPLACE}" TEST_STREAM "${TEST_STREAM}") file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif () +if (TEST_REF_FILTER) + #message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + STRING(REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") +endif () + # compare output files to references unless this must be skipped if (NOT TEST_SKIP_COMPARE) if (WIN32 AND NOT MINGW) @@ -141,11 +166,22 @@ if (NOT TEST_SKIP_COMPARE) file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") endif () - # now compare the output with the reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) + if (NOT TEST_SORT_COMPARE) + # now compare the output with the reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + else () + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) + list (SORT v1) + list (SORT v2) + if (NOT v1 STREQUAL v2) + set(TEST_RESULT 1) + endif () + endif () + if (NOT ${TEST_RESULT} STREQUAL 0) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) @@ -175,7 +211,7 @@ if (NOT TEST_SKIP_COMPARE) if (NOT ${len_act} STREQUAL ${len_ref}) set (TEST_RESULT 1) endif () - endif (NOT ${TEST_RESULT} STREQUAL 0) + endif () message (STATUS "COMPARE Result: ${TEST_RESULT}") @@ -214,7 +250,7 @@ if (NOT TEST_SKIP_COMPARE) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () - endforeach (line RANGE 0 ${_FP_LEN}) + endforeach () else () if (${len_act} STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") @@ -222,7 +258,7 @@ if (NOT TEST_SKIP_COMPARE) if (${len_ref} STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () - endif() + endif () if (NOT ${len_act} STREQUAL ${len_ref}) set (TEST_RESULT 1) endif () @@ -234,8 +270,8 @@ if (NOT TEST_SKIP_COMPARE) if (NOT ${TEST_RESULT} STREQUAL 0) message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") endif () - endif (TEST_ERRREF) -endif (NOT TEST_SKIP_COMPARE) + endif () +endif () # everything went fine... message ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") diff --git a/configure.ac b/configure.ac index 9f84b0f..2af7988 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,7 @@ AC_CONFIG_MACRO_DIR([m4]) ## AM_INIT_AUTOMAKE takes a list of options that should be applied to ## every Makefile.am when automake is run. AM_INIT_AUTOMAKE([foreign subdir-objects]) -AM_SILENT_RULES([yes]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # use silent rules where available - automake 1.11 ## AM_MAINTAINER_MODE turns off "rebuild rules" that contain dependencies ## for Makefiles, configure, src/H5config.h, etc. If AM_MAINTAINER_MODE @@ -3359,11 +3359,14 @@ AC_CONFIG_FILES([src/libhdf5.settings test/Makefile test/testcheck_version.sh test/testerror.sh - test/testflushrefresh.sh + test/testflushrefresh.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh + test/testswmr.sh test/test_plugin.sh + test/test_usecases.sh + test/testvdsswmr.sh testpar/Makefile tools/Makefile tools/lib/Makefile @@ -3380,16 +3383,19 @@ AC_CONFIG_FILES([src/libhdf5.settings tools/src/h5stat/Makefile tools/test/Makefile tools/test/h5dump/Makefile + tools/test/h5dump/h5dump_plugin.sh tools/test/h5dump/testh5dump.sh tools/test/h5dump/testh5dumppbits.sh tools/test/h5dump/testh5dumpvds.sh tools/test/h5dump/testh5dumpxml.sh tools/test/h5ls/Makefile + tools/test/h5ls/h5ls_plugin.sh tools/test/h5ls/testh5ls.sh tools/test/h5ls/testh5lsvds.sh tools/test/h5import/Makefile tools/test/h5import/h5importtestutil.sh tools/test/h5diff/Makefile + tools/test/h5diff/h5diff_plugin.sh tools/test/h5diff/testh5diff.sh tools/test/h5diff/testph5diff.sh tools/src/h5format_convert/Makefile @@ -3403,7 +3409,7 @@ AC_CONFIG_FILES([src/libhdf5.settings tools/test/h5copy/Makefile tools/test/h5copy/testh5copy.sh tools/test/misc/Makefile - tools/test/misc/testh5clear.sh + tools/test/misc/testh5clear.sh tools/test/misc/testh5mkgrp.sh tools/test/misc/testh5repart.sh tools/test/misc/vds/Makefile @@ -3451,7 +3457,7 @@ AC_CONFIG_FILES([src/libhdf5.settings hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh - hl/tools/h5watch/Makefile + hl/tools/h5watch/Makefile hl/tools/h5watch/testh5watch.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 8849ce7..d8eb1a2 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_EXAMPLES) #----------------------------------------------------------------------------- @@ -56,8 +56,8 @@ foreach (example ${examples}) TARGET_C_PROPERTIES (${example}-shared SHARED " " " ") target_link_libraries (${example}-shared ${HDF5_LIBSH_TARGET}) set_target_properties (${example}-shared PROPERTIES FOLDER examples) - endif (BUILD_SHARED_LIBS) -endforeach (example ${examples}) + endif () +endforeach () if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) @@ -71,9 +71,9 @@ if (H5_HAVE_PARALLEL) TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ") target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET}) set_target_properties (ph5example-shared PROPERTIES FOLDER examples) - endif (BUILD_SHARED_LIBS) -endif (H5_HAVE_PARALLEL) + endif () +endif () if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 4a4728e..3412b22 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -8,19 +8,19 @@ if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5EX-shared") file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared/red ${PROJECT_BINARY_DIR}/H5EX-shared/blue ${PROJECT_BINARY_DIR}/H5EX-shared/u2w) - endif (BUILD_SHARED_LIBS) + endif () # Remove any output file left over from previous test run add_test ( NAME EXAMPLES-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove Attributes.h5 btrees_file.h5 cmprss.h5 default_file.h5 dset.h5 - extend.h5 + extend.h5 extlink_prefix_source.h5 extlink_source.h5 extlink_target.h5 @@ -62,29 +62,42 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "EXAMPLES-clear-objects") foreach (example ${examples}) - add_test (NAME EXAMPLES-${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME EXAMPLES-${example} COMMAND $) + else () + add_test (NAME EXAMPLES-${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${example}.txt" + #-D "TEST_REFERENCE=${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "EXAMPLES-${example}") - endforeach (example ${examples}) + endforeach () if (BUILD_SHARED_LIBS) # Remove any output file left over from previous test run add_test ( NAME EXAMPLES-shared-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove Attributes.h5 btrees_file.h5 cmprss.h5 default_file.h5 dset.h5 - extend.h5 + extend.h5 extlink_prefix_source.h5 extlink_source.h5 extlink_target.h5 @@ -128,32 +141,71 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-shared-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "EXAMPLES-shared-clear-objects") foreach (example ${examples}) - add_test (NAME EXAMPLES-shared-${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME EXAMPLES-shared-${example} COMMAND $) + else () + add_test (NAME EXAMPLES-shared-${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${example}.txt" + #-D "TEST_REFERENCE=${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (EXAMPLES-shared-${example} PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-shared-${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "EXAMPLES-shared-${example}") - endforeach (example ${examples}) - endif (BUILD_SHARED_LIBS) + endforeach () + endif () ### Windows pops up a modal permission dialog on this test if (H5_HAVE_PARALLEL AND NOT WIN32) - add_test (NAME EXAMPLES-ph5example COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME EXAMPLES-ph5example COMMAND $) + else () + add_test (NAME EXAMPLES-ph5example COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=ph5example.txt" + #-D "TEST_REFERENCE=ph5example.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "EXAMPLES-ph5example") if (BUILD_SHARED_LIBS) - add_test (NAME EXAMPLES-shared-ph5example COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME EXAMPLES-shared-ph5example COMMAND $) + else () + add_test (NAME EXAMPLES-shared-ph5example COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=ph5example-shared.txt" + #-D "TEST_REFERENCE=ph5example-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "EXAMPLES-shared-ph5example") - endif (BUILD_SHARED_LIBS) - endif (H5_HAVE_PARALLEL AND NOT WIN32) + endif () + endif () diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index c725047..f7179cf 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_F90 C CXX Fortran) if (H5_HAVE_PARALLEL) @@ -6,8 +6,8 @@ if (H5_HAVE_PARALLEL) set (LINK_LIBS ${LINK_LIBS} ${MPI_Fortran_LIBRARIES}) if (MPI_Fortran_LINK_FLAGS) set (CMAKE_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") - endif (MPI_Fortran_LINK_FLAGS) -endif (H5_HAVE_PARALLEL) + endif () +endif () #----------------------------------------------------------------------------- # Traverse source subdirectory @@ -19,7 +19,7 @@ add_subdirectory (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_F90_SOURCE_DIR}/examples ${HDF5_F90_BINARY_DIR}/examples) -endif (HDF5_BUILD_EXAMPLES) +endif () #----------------------------------------------------------------------------- # Testing @@ -28,5 +28,5 @@ if (BUILD_TESTING) add_subdirectory (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) if (MPI_Fortran_FOUND) add_subdirectory (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar) - endif (MPI_Fortran_FOUND) -endif (BUILD_TESTING) + endif () +endif () diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index aad5f33..a5c3422 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed @@ -66,8 +66,8 @@ foreach (example ${examples}) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -endforeach (example ${examples}) + endif () +endforeach () foreach (example ${F2003_examples}) add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) @@ -97,8 +97,8 @@ foreach (example ${F2003_examples}) FOLDER examples/fortran03 Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -endforeach (example ${F2003_examples}) + endif () +endforeach () if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) @@ -130,9 +130,9 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + endif () +endif () if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index 34230c8..5665a2f 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -28,7 +28,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "f90_ex-clear-objects") if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test ( @@ -53,45 +53,97 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex-shared-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "f90_ex-shared-clear-objects") - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () foreach (example ${examples}) - add_test (NAME f90_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME f90_ex_${example} COMMAND $) + else () + add_test (NAME f90_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=f90_ex_${example}.txt" + #-D "TEST_REFERENCE=f90_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "f90_ex_${example}") if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - add_test (NAME f90_ex-shared_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME f90_ex-shared_${example} COMMAND $) + else () + add_test (NAME f90_ex-shared_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=f90_ex_${example}-shared.txt" + #-D "TEST_REFERENCE=f90_ex_${example}-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex-shared_${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "f90_ex-shared_${example}") - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -endforeach (example ${examples}) + endif () +endforeach () if (HDF5_ENABLE_F2003) foreach (example ${F2003_examples}) - add_test (NAME f03_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME f03_ex_${example} COMMAND $) + else () + add_test (NAME f03_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=f03_ex_${example}.txt" + #-D "TEST_REFERENCE=f03_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "f03_ex_${example}") if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - add_test (NAME f03_ex-shared_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME f03_ex-shared_${example} COMMAND $) + else () + add_test (NAME f03_ex-shared_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=f03_ex_${example}-shared.txt" + #-D "TEST_REFERENCE=f03_ex_${example}-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (f03_ex-shared_${example} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "f03_ex-shared_${example}") - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - endforeach (example ${F2003_examples}) -endif (HDF5_ENABLE_F2003) + endif () + endforeach () +endif () if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_test (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test (NAME f90_ex-shared_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) -endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + endif () +endif () diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index a74459f..6d51feb 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- @@ -8,16 +8,16 @@ if (WIN32) if (MSVC) if (NOT H5_HAVE_PARALLEL) set (H5_NOPAREXP ";") - endif (NOT H5_HAVE_PARALLEL) + endif () if (NOT HDF5_ENABLE_F2003) set (H5_NOF03EXP ";") - else (NOT HDF5_ENABLE_F2003) + else () set (H5_F03EXP ";") - endif (NOT HDF5_ENABLE_F2003) + endif () configure_file (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY) - endif (MSVC) - endif (BUILD_SHARED_LIBS) -endif (WIN32) + endif () + endif () +endif () # configure for Fortran preprocessor @@ -25,12 +25,12 @@ endif (WIN32) set (CMAKE_H5_HAVE_PARALLEL 0) if (H5_HAVE_PARALLEL) set (CMAKE_H5_HAVE_PARALLEL 1) -endif (H5_HAVE_PARALLEL) +endif () set (CMAKE_H5_HAVE_FLOAT128 0) if (HAVE_FLOAT128) set (CMAKE_H5_HAVE_FLOAT128 1) -endif(HAVE_FLOAT128) +endif () configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5config_f.inc.cmake ${CMAKE_BINARY_DIR}/H5config_f.inc @ONLY) configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5fort_type_defines.h.in ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h @ONLY) @@ -53,12 +53,12 @@ if (WIN32 AND MSVC) PROPERTIES COMPILE_FLAGS "/MT" ) - endif (BUILD_SHARED_LIBS) + endif () set_target_properties (H5_buildiface PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) -endif (WIN32 AND MSVC) +endif () set_target_properties (H5_buildiface PROPERTIES LINKER_LANGUAGE Fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} @@ -68,15 +68,15 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) - else (WIN32) + else () set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif (WIN32) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () +endif () if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else (WIN32) +else () set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) -endif (WIN32) +endif () INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) @@ -150,7 +150,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_F90_C_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Fortran Modules @@ -186,7 +186,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) DEPENDS ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 PROPERTIES GENERATED TRUE) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () set (f90_F_BASE_SOURCES # normal distribution @@ -233,7 +233,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Add Main fortran library @@ -244,7 +244,7 @@ TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_link_libraries (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES}) -endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} STATIC) set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES @@ -257,7 +257,7 @@ if (WIN32) set_property (TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "HDF5F90_WINDOWS" ) -endif (WIN32) +endif () set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET}) add_dependencies(${HDF5_F90_LIB_TARGET} H5gen) @@ -266,12 +266,12 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") - endif (WIN32 AND MSVC) + endif () TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_link_libraries (${HDF5_F90_LIBSH_TARGET} ${MPI_Fortran_LIBRARIES}) - endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_LIB_NAME} SHARED ${HDF5_F_PACKAGE_SOVERSION}) set_target_properties (${HDF5_F90_LIBSH_TARGET} PROPERTIES @@ -286,10 +286,10 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set_property (TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_DLL;HDF5F90_WINDOWS" ) - endif (WIN32) + endif () set (install_targets ${install_targets} ${HDF5_F90_LIBSH_TARGET}) add_dependencies(${HDF5_F90_LIBSH_TARGET} H5genSH) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -367,7 +367,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) COMPONENT fortheaders ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects @@ -376,7 +376,9 @@ if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INSTALL_TARGET_PDB (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) #INSTALL_TARGET_PDB (${HDF5_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () + INSTALL_TARGET_PDB (${HDF5_F90_C_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) + #INSTALL_TARGET_PDB (${HDF5_F90_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) install ( TARGETS @@ -389,4 +391,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT fortlibraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index a271666..51775db 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -57,9 +57,9 @@ libhdf5_fortran_la_LIBADD=$(LIBHDF5) # Remove it only when distclean. DISTCLEANFILES=h5fc -# H5fortran_types.F90 and H5f90i.h are automatically generaed by +# H5fortran_types.F90 and H5f90i.h are automatically generated by # H5match_types, and must be cleaned explicitly. -MOSTLYCLEANFILES=H5fortran_types.F90 H5f90i_gen.h +MOSTLYCLEANFILES=H5fortran_types.F90 H5f90i_gen.h H5_gen.F90 # Fortran module files can have different extensions and different names # (e.g., different capitalizations) on different platforms. Write rules diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 5b11a0a..1661a10 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- @@ -21,12 +21,12 @@ if (WIN32 AND MSVC) PROPERTIES COMPILE_FLAGS "/MT" ) - endif (BUILD_SHARED_LIBS) + endif () set_target_properties (H5_test_buildiface PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) -endif (WIN32 AND MSVC) +endif () set_target_properties (H5_test_buildiface PROPERTIES LINKER_LANGUAGE Fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} @@ -36,15 +36,15 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) - else (WIN32) + else () set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif (WIN32) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () +endif () if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else (WIN32) +else () set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) -endif (WIN32) +endif () INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) @@ -79,7 +79,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INTERFACE_INCLUDE_DIRECTORIES "$/include>" INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () set (CMD $) add_custom_command ( @@ -107,7 +107,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) DEPENDS ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 PROPERTIES GENERATED TRUE) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () set (HDF5_F90_TF_SOURCES # generated files @@ -126,7 +126,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) tf.F90 ) set_source_files_properties (${HDF5_F90_TF_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC ${HDF5_F90_TF_SOURCES}) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} STATIC " " " ") @@ -147,7 +147,7 @@ if (WIN32) set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "HDF5F90_WINDOWS" ) -endif (WIN32) +endif () add_dependencies(${HDF5_F90_TEST_LIB_TARGET} H5testgen) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) @@ -155,7 +155,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) set (SHARED_LINK_FLAGS "/DLL") - endif (WIN32 AND MSVC) + endif () TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_C_TEST_LIBSH_TARGET} @@ -176,9 +176,9 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set_property (TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_TEST_DLL;HDF5F90_WINDOWS" ) - endif (WIN32) + endif () add_dependencies(${HDF5_F90_TEST_LIBSH_TARGET} H5testgenSH) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Add Tests @@ -211,7 +211,7 @@ target_link_libraries (testhdf5_fortran ) if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran "ws2_32.lib") -endif (WIN32 AND MSVC) +endif () target_include_directories (testhdf5_fortran PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran @@ -247,7 +247,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran-shared "ws2_32.lib") - endif (WIN32 AND MSVC) + endif () target_include_directories (testhdf5_fortran-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (testhdf5_fortran-shared PROPERTIES LINKER_LANGUAGE Fortran @@ -255,7 +255,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) add_dependencies (testhdf5_fortran-shared ${HDF5_F90_TEST_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #-- Adding test for testhdf5_fortran_1_8 add_executable (testhdf5_fortran_1_8 @@ -275,7 +275,7 @@ target_link_libraries (testhdf5_fortran_1_8 ) if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran_1_8 "ws2_32.lib") -endif (WIN32 AND MSVC) +endif () target_include_directories (testhdf5_fortran_1_8 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran @@ -302,7 +302,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran_1_8-shared "ws2_32.lib") - endif (WIN32 AND MSVC) + endif () target_include_directories (testhdf5_fortran_1_8-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (testhdf5_fortran_1_8-shared PROPERTIES LINKER_LANGUAGE Fortran @@ -310,7 +310,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) add_dependencies (testhdf5_fortran_1_8-shared ${HDF5_F90_TEST_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #-- Adding test for fortranlib_test_F03 add_executable (fortranlib_test_F03 @@ -332,7 +332,7 @@ target_link_libraries (fortranlib_test_F03 ) if (WIN32 AND MSVC) target_link_libraries (fortranlib_test_F03 "ws2_32.lib") -endif (WIN32 AND MSVC) +endif () target_include_directories (fortranlib_test_F03 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran @@ -361,7 +361,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (fortranlib_test_F03-shared "ws2_32.lib") - endif (WIN32 AND MSVC) + endif () target_include_directories (fortranlib_test_F03-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (fortranlib_test_F03-shared PROPERTIES @@ -370,7 +370,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) add_dependencies (fortranlib_test_F03-shared ${HDF5_F90_TEST_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #-- Adding test for fflush1 add_executable (fflush1 fflush1.F90) @@ -383,7 +383,7 @@ target_link_libraries (fflush1 ) if (WIN32 AND MSVC) target_link_libraries (fflush1 "ws2_32.lib") -endif (WIN32 AND MSVC) +endif () target_include_directories (fflush1 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (fflush1 PROPERTIES LINKER_LANGUAGE Fortran @@ -403,7 +403,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (fflush1-shared "ws2_32.lib") - endif (WIN32 AND MSVC) + endif () target_include_directories (fflush1-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (fflush1-shared PROPERTIES LINKER_LANGUAGE Fortran @@ -411,7 +411,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) add_dependencies (fflush1-shared ${HDF5_F90_TEST_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #-- Adding test for fflush2 add_executable (fflush2 fflush2.F90) @@ -424,7 +424,7 @@ target_link_libraries (fflush2 ) if (WIN32 AND MSVC) target_link_libraries (fflush2 "ws2_32.lib") -endif (WIN32 AND MSVC) +endif () target_include_directories (fflush2 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (fflush2 PROPERTIES LINKER_LANGUAGE Fortran @@ -444,7 +444,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (fflush2-shared "ws2_32.lib") - endif (WIN32 AND MSVC) + endif () target_include_directories (fflush2-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (fflush2-shared PROPERTIES LINKER_LANGUAGE Fortran @@ -452,6 +452,6 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) add_dependencies (fflush2-shared ${HDF5_F90_TEST_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () include (CMakeTests.cmake) diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index e91e820..a282ec6 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -6,7 +6,7 @@ ############################################################################## if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/fshared") -endif (BUILD_SHARED_LIBS) +endif () # Remove any output file left over from previous test run add_test ( @@ -49,24 +49,69 @@ add_test ( ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (FORTRAN_testhdf5-clear-objects PROPERTIES DEPENDS ${last_test}) -endif (NOT "${last_test}" STREQUAL "") +endif () set (last_test "FORTRAN_testhdf5-clear-objects") -add_test (NAME FORTRAN_testhdf5_fortran COMMAND $) -set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_testhdf5_fortran COMMAND $) +else () + add_test (NAME FORTRAN_testhdf5_fortran COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=testhdf5_fortran.txt" + #-D "TEST_REFERENCE=testhdf5_fortran.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () +#set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES DEPENDS FORTRAN_testhdf5-clear-objects) #-- Adding test for testhdf5_fortran_1_8 -add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND $) -set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND $) +else () + add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=testhdf5_fortran_1_8.txt" + #-D "TEST_REFERENCE=testhdf5_fortran_1_8.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () +#set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran) #-- Adding test for fortranlib_test_F03 if (HDF5_ENABLE_F2003) - add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $) - set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $) + else () + add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=fortranlib_test_F03.txt" + #-D "TEST_REFERENCE=fortranlib_test_F03.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () +# set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8) -endif (HDF5_ENABLE_F2003) +endif () #-- Adding test for fflush1 add_test (NAME FORTRAN_fflush1 COMMAND $) @@ -119,21 +164,66 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) set_tests_properties (FORTRAN_testhdf5-shared-clear-objects PROPERTIES DEPENDS FORTRAN_testhdf5-clear-objects) - add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND $) - set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND $) + else () + add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=testhdf5_fortran.txt" + #-D "TEST_REFERENCE=testhdf5_fortran.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () +# set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES DEPENDS "FORTRAN_testhdf5_fortran;FORTRAN_testhdf5-shared-clear-objects") #-- Adding test for testhdf5_fortran_1_8 - add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND $) - set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND $) + else () + add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=testhdf5_fortran_1_8.txt" + #-D "TEST_REFERENCE=testhdf5_fortran_1_8.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () +# set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8) #-- Adding test for fortranlib_test_F03 if (HDF5_ENABLE_F2003) - add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND $) - set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND $) + else () + add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_REGEX= 0 error.s." + -D "TEST_MATCH= 0 error(s)" + -D "TEST_OUTPUT=fortranlib_test_F03.txt" + #-D "TEST_REFERENCE=fortranlib_test_F03.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () +# set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES DEPENDS FORTRAN_fortranlib_test_F03) - endif (HDF5_ENABLE_F2003) + endif () #-- Adding test for fflush1 add_test (NAME FORTRAN_fflush1-shared COMMAND $) @@ -142,4 +232,4 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fflush2 add_test (NAME FORTRAN_fflush2-shared COMMAND $) set_tests_properties (FORTRAN_fflush2-shared PROPERTIES DEPENDS FORTRAN_fflush1-shared) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 4f21419..909cbaf 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +INCLUDE_DIRECTORIES (${MPI_Fortran_INCLUDE_PATH} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Add Tests @@ -18,15 +18,15 @@ add_executable (parallel_test ) TARGET_NAMING (parallel_test STATIC) TARGET_FORTRAN_PROPERTIES (parallel_test STATIC " " " ") -target_link_libraries (parallel_test +target_link_libraries (parallel_test ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} - ${MPI_Fortran_LIBRARIES} + ${LINK_Fortran_LIBS} ) if (WIN32 AND MSVC) target_link_libraries (parallel_test "ws2_32.lib") -endif (WIN32 AND MSVC) +endif () target_include_directories (parallel_test PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (parallel_test PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (parallel_test PROPERTIES FOLDER test/fortran) diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index bed8291..a47e023 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- @@ -17,16 +17,16 @@ add_subdirectory (${HDF5_HL_SOURCE_DIR}/src ${HDF5_HL_BINARY_DIR}/src) #-- Build the High level Tools if (HDF5_BUILD_TOOLS) add_subdirectory (${HDF5_HL_SOURCE_DIR}/tools ${HDF5_HL_BINARY_DIR}/tools) -endif (HDF5_BUILD_TOOLS) +endif () #-- Add High Level Examples if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_HL_SOURCE_DIR}/examples ${HDF5_HL_BINARY_DIR}/examples) -endif (HDF5_BUILD_EXAMPLES) +endif () #-- Build the Unit testing if requested if (NOT HDF5_EXTERNALLY_CONFIGURED) if (BUILD_TESTING) add_subdirectory (${HDF5_HL_SOURCE_DIR}/test ${HDF5_HL_BINARY_DIR}/test) - endif (BUILD_TESTING) -endif (NOT HDF5_EXTERNALLY_CONFIGURED) + endif () +endif () diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 36f4c30..91bfa14 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_CPP) #----------------------------------------------------------------------------- @@ -11,7 +11,7 @@ add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/src ${HDF5_HL_CPP_BINARY_DIR}/src) # -------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/examples ${HDF5_HL_CPP_BINARY_DIR}/examples) -endif (HDF5_BUILD_EXAMPLES) +endif () # -------------------------------------------------------------------- # Add in the unit tests for the packet table c++ wrapper @@ -19,4 +19,4 @@ endif (HDF5_BUILD_EXAMPLES) if (BUILD_TESTING) add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/test ${HDF5_HL_CPP_BINARY_DIR}/test) -endif (BUILD_TESTING) +endif () diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 77a50bf..33ad1e5 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_CPP_EXAMPLES) #----------------------------------------------------------------------------- @@ -23,4 +23,4 @@ set_target_properties (ptExampleFL PROPERTIES FOLDER examples/hl/cpp) if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () diff --git a/hl/c++/examples/CMakeTests.cmake b/hl/c++/examples/CMakeTests.cmake index bac9fdf..86bdd93 100644 --- a/hl/c++/examples/CMakeTests.cmake +++ b/hl/c++/examples/CMakeTests.cmake @@ -8,9 +8,22 @@ add_test ( NAME HL_CPP_ex_ptExampleFL-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove PTcppexampleFL.h5 ) -add_test (NAME HL_CPP_ex_ptExampleFL COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_CPP_ex_ptExampleFL COMMAND $) +else () + add_test (NAME HL_CPP_ex_ptExampleFL COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=ptExampleFL.txt" + #-D "TEST_REFERENCE=ptExampleFL.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (HL_CPP_ex_ptExampleFL PROPERTIES DEPENDS HL_CPP_ex_ptExampleFL-clear-objects) diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index f30e684..38604cd 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_CPP_SRC) #----------------------------------------------------------------------------- @@ -42,7 +42,7 @@ if (BUILD_SHARED_LIBS) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_HL_CPP_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -62,7 +62,8 @@ install ( if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries) - endif (BUILD_SHARED_LIBS) + endif () + INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries) install ( TARGETS @@ -75,4 +76,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT hlcpplibraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index de5b363..a2f9429 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_CPP_TEST) #----------------------------------------------------------------------------- diff --git a/hl/c++/test/CMakeTests.cmake b/hl/c++/test/CMakeTests.cmake index e36b5aa..d41f79e 100644 --- a/hl/c++/test/CMakeTests.cmake +++ b/hl/c++/test/CMakeTests.cmake @@ -4,5 +4,18 @@ ### T E S T I N G ### ############################################################################## ############################################################################## - + +if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME HL_CPP_ptableTest COMMAND $) +else () + add_test (NAME HL_CPP_ptableTest COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_ptableTest.txt" + #-D "TEST_REFERENCE=hl_ptableTest.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index f5e6f5e..1144e0f 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_EXAMPLES ) #----------------------------------------------------------------------------- @@ -32,10 +32,10 @@ foreach (example ${examples}) TARGET_C_PROPERTIES (hl_ex_${example} STATIC " " " ") target_link_libraries (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl) -endforeach (example ${examples}) +endforeach () if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake index 6384aa5..5645155 100644 --- a/hl/examples/CMakeTests.cmake +++ b/hl/examples/CMakeTests.cmake @@ -12,7 +12,7 @@ set (HDF5_TEST_FILES foreach (h5_file ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "hl_ex_ex_ds1_files") -endforeach (h5_file ${HDF5_TEST_FILES}) +endforeach () add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_ex_ds1 tests" DEPENDS ${hl_ex_ex_ds1_files_list}) # Remove any output file left over from previous test run @@ -46,9 +46,22 @@ add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_ set (last_test "HL_ex-clear-objects") foreach (example ${examples}) - add_test (NAME HL_ex_${example} COMMAND $) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (HL_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "HL_ex_${example}") -endforeach (example ${examples}) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_ex_${example} COMMAND $) + else () + add_test (NAME HL_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_ex_${example}.txt" + #-D "TEST_REFERENCE=hl_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (HL_ex_${example} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "HL_ex_${example}") +endforeach () diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index 892169c..c651ce9 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_F90 C CXX Fortran) #----------------------------------------------------------------------------- @@ -11,11 +11,11 @@ add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/examples ${HDF5_HL_F90_BINARY_DIR}/examples) -endif (HDF5_BUILD_EXAMPLES) +endif () #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if (BUILD_TESTING) add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/test ${HDF5_HL_F90_BINARY_DIR}/test) -endif (BUILD_TESTING) +endif () diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index 87838a0..dfe6102 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- @@ -18,7 +18,7 @@ foreach (example ${examples}) add_executable (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (hl_f90_ex_${example} STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_ex_${example} STATIC " " " ") - target_link_libraries (hl_f90_ex_${example} + target_link_libraries (hl_f90_ex_${example} ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -27,10 +27,10 @@ foreach (example ${examples}) set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran) -endforeach (example ${examples}) +endforeach () if (BUILD_TESTING) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake index 2c10295..b5f5fc6 100644 --- a/hl/fortran/examples/CMakeTests.cmake +++ b/hl/fortran/examples/CMakeTests.cmake @@ -16,6 +16,19 @@ add_test ( foreach (example ${examples}) - add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND $) + else () + add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_ex_${example}.txt" + #-D "TEST_REFERENCE=hl_f90_ex_${example}.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (HL_FORTRAN_f90_ex_${example} PROPERTIES DEPENDS HL_FORTRAN_f90_ex-clear-objects) -endforeach (example ${examples}) +endforeach () diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 2eaac31..345a739 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT(HDF5_HL_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- @@ -7,9 +7,9 @@ if (WIN32) if (BUILD_SHARED_LIBS) if (MSVC) configure_file (${HDF5_HL_F90_SRC_SOURCE_DIR}/hdf5_hl_fortrandll.def.in ${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def @ONLY) - endif (MSVC) - endif (BUILD_SHARED_LIBS) -endif (WIN32) + endif () + endif () +endif () #----------------------------------------------------------------------------- # Generate the H5LT and H5TB REAL APIs @@ -25,12 +25,12 @@ if (WIN32 AND MSVC) PROPERTIES COMPILE_FLAGS "/MT" ) - endif (BUILD_SHARED_LIBS) + endif () set_target_properties (H5HL_buildiface PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) -endif (WIN32 AND MSVC) +endif () set_target_properties (H5HL_buildiface PROPERTIES LINKER_LANGUAGE Fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} @@ -40,15 +40,15 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) - else (WIN32) + else () set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif (WIN32) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () +endif () if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else (WIN32) +else () set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) -endif (WIN32) +endif () #----------------------------------------------------------------------------- # Setup include Directories @@ -101,7 +101,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_HL_F90_C_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Fortran Modules @@ -146,7 +146,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 PROPERTIES GENERATED TRUE ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () set (HDF5_HL_F90_F_SOURCES ${HDF5_HL_F90_F_BASE_SOURCES} @@ -166,7 +166,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 ) set_source_files_properties (${HDF5_HL_F90_F_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES}) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} STATIC " " " ") @@ -183,7 +183,7 @@ if (WIN32) set_property (TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "HDF5F90_WINDOWS" ) -endif (WIN32) +endif () set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET}) add_dependencies(${HDF5_HL_F90_LIB_TARGET} H5HLgen) @@ -192,7 +192,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def") - endif (WIN32 AND MSVC) + endif () TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIBSH_TARGET}") @@ -208,10 +208,10 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set_property (TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_HL_DLL;HDF5F90_WINDOWS" ) - endif (WIN32) + endif () set (install_targets ${install_targets} ${HDF5_HL_F90_LIBSH_TARGET}) add_dependencies(${HDF5_HL_F90_LIBSH_TARGET} H5HLgenSH) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -253,7 +253,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) COMPONENT fortheaders ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects @@ -262,7 +262,9 @@ if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) - endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endif () + INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) + #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) install ( TARGETS @@ -275,4 +277,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT hlfortlibraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 13cb177..3138173 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- @@ -25,7 +25,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #-- Adding test for hl_f90_tstlite add_executable (hl_f90_tstlite tstlite.F90) @@ -46,7 +46,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #-- Adding test for hl_f90_tstimage add_executable (hl_f90_tstimage tstimage.F90) @@ -67,7 +67,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () #-- Adding test for hl_f90_tsttable add_executable (hl_f90_tsttable tsttable.F90) @@ -88,6 +88,6 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () include (CMakeTests.cmake) diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index c538ae8..3c8a831 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -21,16 +21,68 @@ add_test ( tstds.h5 ) -add_test (NAME HL_FORTRAN_f90_tstds COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tstds COMMAND $) +else () + add_test (NAME HL_FORTRAN_f90_tstds COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tstds.txt" + #-D "TEST_REFERENCE=hl_f90_tstds.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (HL_FORTRAN_f90_tstds PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -add_test (NAME HL_FORTRAN_f90_tstlite COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tstlite COMMAND $) +else () + add_test (NAME HL_FORTRAN_f90_tstlite COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tstlite.txt" + #-D "TEST_REFERENCE=hl_f90_tstlite.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (HL_FORTRAN_f90_tstlite PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -add_test (NAME HL_FORTRAN_f90_tstimage COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tstimage COMMAND $) +else () + add_test (NAME HL_FORTRAN_f90_tstimage COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tstimage.txt" + #-D "TEST_REFERENCE=hl_f90_tstimage.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (HL_FORTRAN_f90_tstimage PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -add_test (NAME HL_FORTRAN_f90_tsttable COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tsttable COMMAND $) +else () + add_test (NAME HL_FORTRAN_f90_tsttable COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tsttable.txt" + #-D "TEST_REFERENCE=hl_f90_tsttable.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (HL_FORTRAN_f90_tsttable PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) @@ -52,15 +104,67 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) PROPERTIES DEPENDS "HL_FORTRAN_f90_tsttable;HL_FORTRAN_f90_tstimage;HL_FORTRAN_f90_tstlite;HL_FORTRAN_f90_tstds" ) - add_test (NAME HL_FORTRAN_f90_tstds-shared COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tstds-shared COMMAND $) + else () + add_test (NAME HL_FORTRAN_f90_tstds-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tstds-shared.txt" + #-D "TEST_REFERENCE=hl_f90_tstds-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (HL_FORTRAN_f90_tstds-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) - add_test (NAME HL_FORTRAN_f90_tstlite-shared COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tstlite-shared COMMAND $) + else () + add_test (NAME HL_FORTRAN_f90_tstlite-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tstlite-shared.txt" + #-D "TEST_REFERENCE=hl_f90_tstlite-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (HL_FORTRAN_f90_tstlite-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) - add_test (NAME HL_FORTRAN_f90_tstimage-shared COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tstimage-shared COMMAND $) + else () + add_test (NAME HL_FORTRAN_f90_tstimage-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tstimage-shared.txt" + #-D "TEST_REFERENCE=hl_f90_tstimage-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (HL_FORTRAN_f90_tstimage-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) - add_test (NAME HL_FORTRAN_f90_tsttable-shared COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_FORTRAN_f90_tsttable-shared COMMAND $) + else () + add_test (NAME HL_FORTRAN_f90_tsttable-shared COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_f90_tsttable-shared.txt" + #-D "TEST_REFERENCE=hl_f90_tsttable-shared.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (HL_FORTRAN_f90_tsttable-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) -endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif () diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 0c71583..86472fb 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_SRC) #----------------------------------------------------------------------------- @@ -53,7 +53,7 @@ if (BUILD_SHARED_LIBS) ) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIBSH_TARGET}") set (install_targets ${install_targets} ${HDF5_HL_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -73,7 +73,8 @@ install ( if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_HL_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries) - endif (BUILD_SHARED_LIBS) + endif () + INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries) install ( TARGETS @@ -86,4 +87,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT hllibraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 987c5bb..8845505 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed @@ -30,7 +30,7 @@ MACRO (HL_ADD_EXE hl_name) ${HDF5_LIB_TARGET} ) set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) -ENDMACRO (HL_ADD_EXE) +ENDMACRO () MACRO (HL_ADD_SHEXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) @@ -42,7 +42,7 @@ MACRO (HL_ADD_SHEXE hl_name) ${HDF5_LIBSH_TARGET} ) set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) -ENDMACRO (HL_ADD_SHEXE) +ENDMACRO () HL_ADD_EXE (test_lite) HL_ADD_EXE (test_image) @@ -88,6 +88,6 @@ if (HDF5_BUILD_GENERATORS) ${HDF5_LIB_TARGET} ) set_target_properties (hl_gen_test_ld PROPERTIES FOLDER test/hl/gen) -endif (HDF5_BUILD_GENERATORS) +endif () include (CMakeTests.cmake) diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index 228853d..211c501 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -29,21 +29,34 @@ set (HL_REFERENCE_TEST_FILES # -------------------------------------------------------------------- foreach (h5_file ${HL_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_HL_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_HL_TEST_BINARY_DIR}/${h5_file}" "hl_test_files") -endforeach (h5_file ${HL_REFERENCE_TEST_FILES}) +endforeach () add_custom_target(hl_test_files ALL COMMENT "Copying files needed by hl_test tests" DEPENDS ${hl_test_files_list}) # -------------------------------------------------------------------- # Macro used to add a unit test # -------------------------------------------------------------------- -MACRO (HL_ADD_TEST hl_name) - add_test (NAME HL_${hl_name} COMMAND $) +macro (HL_ADD_TEST hl_name) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_${hl_name} COMMAND $) + else () + add_test (NAME HL_${hl_name} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=hl_${hl_name}.txt" + #-D "TEST_REFERENCE=hl_${hl_name}.out" + -D "TEST_FOLDER=${HDF5_HL_TEST_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (HL_${hl_name} PROPERTIES DEPENDS ${last_test} ENVIRONMENT "srcdir=${HDF5_HL_TEST_BINARY_DIR}" WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR} ) endif () -ENDMACRO (HL_ADD_TEST) +endmacro () # Remove any output file left over from previous test run add_test ( @@ -82,7 +95,7 @@ add_test ( ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (HL_test-clear-objects PROPERTIES DEPENDS ${last_test}) -endif (NOT "${last_test}" STREQUAL "") +endif () set (last_test "HL_test-clear-objects") HL_add_test (test_lite ) diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 8384b59..9536517 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_TOOLS C CXX) add_subdirectory (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5 ${HDF5_HL_TOOLS_BINARY_DIR}/gif2h5) diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index 9e6e828..9d7a406 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_TOOLS_GIF2H5) #----------------------------------------------------------------------------- @@ -50,19 +50,21 @@ if (BUILD_TESTING) set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) # add_test (NAME hl_h52gifgentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -install ( - TARGETS - gif2h5 - h52gif - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications -) +if (HDF5_EXPORTED_TARGETS) + install ( + TARGETS + gif2h5 + h52gif + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications + ) +endif () diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index 6d55abc..fde40e3 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_HL_TOOLS_H5WATCH) #----------------------------------------------------------------------------- @@ -49,13 +49,17 @@ if (BUILD_TESTING) set_target_properties (h5watchgentest PROPERTIES FOLDER generator/tools/hl) include (CMakeTests.cmake) -endif (BUILD_TESTING) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -install ( - TARGETS - h5watch - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications -) +if (HDF5_EXPORTED_TARGETS) + install ( + TARGETS + h5watch + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications + ) +endif () diff --git a/hl/tools/h5watch/CMakeTests.cmake b/hl/tools/h5watch/CMakeTests.cmake index 3242a72..2242692 100644 --- a/hl/tools/h5watch/CMakeTests.cmake +++ b/hl/tools/h5watch/CMakeTests.cmake @@ -56,7 +56,7 @@ foreach (h5watch_file ${H5WATCH_TEST_FILES}) COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_HL_TOOLS_DIR}/testfiles/${h5watch_file} ${dest} ) -endforeach (h5watch_file ${H5WATCH_TEST_FILES}) +endforeach () ############################################################################## ############################################################################## @@ -64,21 +64,9 @@ endforeach (h5watch_file ${H5WATCH_TEST_FILES}) ############################################################################## ############################################################################## - MACRO (ADD_H5_TEST resultfile resultcode) + macro (ADD_H5_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5WATCH_ARGS-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5WATCH_ARGS-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5WATCH_ARGS-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - set (last_test "H5WATCH_ARGS-${resultfile}-clearall-objects") - add_test ( NAME H5WATCH_ARGS-h5watch-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -89,20 +77,18 @@ endforeach (h5watch_file ${H5WATCH_TEST_FILES}) -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5WATCH_ARGS-h5watch-${resultfile} PROPERTIES DEPENDS H5WATCH_ARGS-${resultfile}-clear-objects) - set (last_test "H5WATCH_ARGS-${resultfile}") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) + set_tests_properties (H5WATCH_ARGS-h5watch-${resultfile} PROPERTIES DEPENDS ${last_test}) + set (last_test "H5WATCH_ARGS-h5watch-${resultfile}") + endif () + endmacro () - MACRO (ADD_H5_WATCH resultfile resultcode) + macro (ADD_H5_WATCH resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5WATCH-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5 - ${resultfile}.out - ${resultfile}.out.err ) set_tests_properties (H5WATCH-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") add_test ( @@ -117,8 +103,8 @@ endforeach (h5watch_file ${H5WATCH_TEST_FILES}) -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5WATCH-${resultfile} PROPERTIES DEPENDS H5WATCH-${resultfile}-clear-objects) - endif (NOTHDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_WATCH resultfile resultcode) + endif () + endmacro () ############################################################################## ############################################################################## @@ -130,7 +116,7 @@ endforeach (h5watch_file ${H5WATCH_TEST_FILES}) # supports SWMR. set (SWMR_INCOMPAT ${hl_swmr_check_compat_vfd}) -IF (NOT SWMR_INCOMPAT) +if (NOT SWMR_INCOMPAT) # Remove any output file left over from previous test run add_test ( NAME H5WATCH-clearall-objects @@ -140,7 +126,7 @@ IF (NOT SWMR_INCOMPAT) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5WATCH-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5WATCH-clearall-objects") ################################################################################################# @@ -169,23 +155,23 @@ IF (NOT SWMR_INCOMPAT) set (last_test "H5WATCH-h5watchgentest") # Test on --help options - ADD_H5_TEST(w-help1 0 --help) + ADD_H5_TEST (w-help1 0 --help) # # Tests on expected failures - ADD_H5_TEST(w-err-dset1 1 WATCH.h5) - ADD_H5_TEST(w-err-dset2 1 WATCH.h5/group/DSET_CMPD) - ADD_H5_TEST(w-err-dset-none 1 WATCH.h5/DSET_NONE) - ADD_H5_TEST(w-err-dset-nomax 1 WATCH.h5/DSET_NOMAX) - ADD_H5_TEST(w-err-file 1 ../WATCH.h5/DSET_CMPD) - ADD_H5_TEST(w-err-width 1 --width=-8 WATCH.h5/DSET_ONE) - ADD_H5_TEST(w-err-poll 1 --polling=-8 WATCH.h5/DSET_ONE) - ADD_H5_TEST(w-err-poll0 1 --polling=0 WATCH.h5/DSET_ONE) + ADD_H5_TEST (w-err-dset1 1 WATCH.h5) + ADD_H5_TEST (w-err-dset2 1 WATCH.h5/group/DSET_CMPD) + ADD_H5_TEST (w-err-dset-none 1 WATCH.h5/DSET_NONE) + ADD_H5_TEST (w-err-dset-nomax 1 WATCH.h5/DSET_NOMAX) + ADD_H5_TEST (w-err-file 1 ../WATCH.h5/DSET_CMPD) + ADD_H5_TEST (w-err-width 1 --width=-8 WATCH.h5/DSET_ONE) + ADD_H5_TEST (w-err-poll 1 --polling=-8 WATCH.h5/DSET_ONE) + ADD_H5_TEST (w-err-poll0 1 --polling=0 WATCH.h5/DSET_ONE) # # Tests on invalid field names via --fields option for a compound typed dataset: DSET_CMPD - ADD_H5_TEST(w-err-cmpd1 1 --fields=fieldx WATCH.h5/DSET_CMPD) - ADD_H5_TEST(w-err-cmpd2 1 --fields=field1,field2. WATCH.h5/DSET_CMPD) - ADD_H5_TEST(w-err-cmpd3 1 --fields=field1,field2, WATCH.h5/DSET_CMPD) - ADD_H5_TEST(w-err-cmpd4 1 --fields=field1,field2.b.k WATCH.h5/DSET_CMPD) - ADD_H5_TEST(w-err-cmpd5 1 --fields=field1 --fields=field2.b.k WATCH.h5/DSET_CMPD) + ADD_H5_TEST (w-err-cmpd1 1 --fields=fieldx WATCH.h5/DSET_CMPD) + ADD_H5_TEST (w-err-cmpd2 1 --fields=field1,field2. WATCH.h5/DSET_CMPD) + ADD_H5_TEST (w-err-cmpd3 1 --fields=field1,field2, WATCH.h5/DSET_CMPD) + ADD_H5_TEST (w-err-cmpd4 1 --fields=field1,field2.b.k WATCH.h5/DSET_CMPD) + ADD_H5_TEST (w-err-cmpd5 1 --fields=field1 --fields=field2.b.k WATCH.h5/DSET_CMPD) # -ENDIF (NOT SWMR_INCOMPAT) +endif () diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 706b196..d37a409 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.0) +cmake_minimum_required(VERSION 3.2.2) PROJECT ( HDF5_JAVA C Java ) set (CMAKE_MODULE_PATH "${HDF_RESOURCES_DIR};${HDF_RESOURCES_EXT_DIR}") @@ -15,9 +15,9 @@ INCLUDE_DIRECTORIES ( ${JNI_INCLUDE_DIRS} ) if (WIN32) set (HDF_JRE_DIRECTORY "C:/Program Files/Java/jre8") -else (WIN32) +else () set (HDF_JRE_DIRECTORY "/usr/lib/jvm/jre") -endif (WIN32) +endif () #----------------------------------------------------------------------------- # Include the main src and config directories @@ -41,14 +41,14 @@ add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/src ${HDF5_JAVA_BINARY_DIR}/src) #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/examples ${HDF5_JAVA_BINARY_DIR}/examples) -endif (HDF5_BUILD_EXAMPLES) +endif () #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if (BUILD_TESTING) add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/test ${HDF5_JAVA_BINARY_DIR}/test) -endif (BUILD_TESTING) +endif () #----------------------------------------------------------------------------- # Add Required Jar(s) @@ -72,4 +72,4 @@ if (HDF5_JAVA_PACK_JRE) DESTINATION ${HDF5_INSTALL_BIN_DIR} USE_SOURCE_PERMISSIONS ) -endif (HDF5_JAVA_PACK_JRE) +endif () diff --git a/java/examples/CMakeLists.txt b/java/examples/CMakeLists.txt index 0430bdb..a1a7483 100644 --- a/java/examples/CMakeLists.txt +++ b/java/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDFJAVA_EXAMPLES) add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/datasets datasets) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index 3a69359..d698cfd 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDFJAVA_EXAMPLES_DATASETS Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -31,16 +31,16 @@ set (HDF_JAVA_EXAMPLES if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") -else (WIN32) +else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") -endif (WIN32) +endif () set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS}") set (CMAKE_JAVA_CLASSPATH ".") foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") -endforeach (CMAKE_INCLUDE_PATH) +endforeach () foreach (example ${HDF_JAVA_EXAMPLES}) file (WRITE ${PROJECT_BINARY_DIR}/${example}_Manifest.txt @@ -52,23 +52,23 @@ foreach (example ${HDF_JAVA_EXAMPLES}) # install_jar (${example} ${HJAVA_INSTALL_DATA_DIR}/examples examples) get_target_property (${example}_CLASSPATH ${example} CLASSDIR) add_dependencies (${example} ${HDF5_JAVA_HDF5_LIB_TARGET}) -endforeach (example ${HDF_JAVA_EXAMPLES}) +endforeach () set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_NOP_JAR}") set (CMAKE_JAVA_CLASSPATH ".") foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}") -endforeach (HDFJAVA_JAR) +endforeach () MACRO (ADD_H5_TEST resultfile resultcode) if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else() + else () set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif() - endif(CMAKE_BUILD_TYPE MATCHES Debug) + endif () + endif () add_test ( NAME JAVA_datasets-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -85,16 +85,16 @@ MACRO (ADD_H5_TEST resultfile resultcode) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_datasets-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "JAVA_datasets-${resultfile}") -ENDMACRO (ADD_H5_TEST file) +ENDMACRO () if (BUILD_TESTING) # detect whether the encoder is present. if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif (H5_HAVE_FILTER_DEFLATE) + endif () if (H5_HAVE_FILTER_SZIP) set (USE_FILTER_SZIP "true") @@ -109,17 +109,17 @@ if (BUILD_TESTING) ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.data ) - else (${example} STREQUAL "H5Ex_D_External") + else () add_test ( NAME JAVA_datasets-${example}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ) - endif (${example} STREQUAL "H5Ex_D_External") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_datasets-${example}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () add_test ( NAME JAVA_datasets-${example}-copy-objects COMMAND ${CMAKE_COMMAND} @@ -132,10 +132,10 @@ if (BUILD_TESTING) if (${example} STREQUAL "H5Ex_D_Szip") if (USE_FILTER_SZIP) ADD_H5_TEST (${example} 0) - endif (USE_FILTER_SZIP) - else (${example} STREQUAL "H5Ex_D_Szip") + endif () + else () ADD_H5_TEST (${example} 0) - endif (${example} STREQUAL "H5Ex_D_Szip") + endif () - endforeach (example ${HDF_JAVA_EXAMPLES}) -endif (BUILD_TESTING) + endforeach () +endif () diff --git a/java/examples/datasets/H5Ex_D_Chunk.java b/java/examples/datasets/H5Ex_D_Chunk.java index 7f02e5a..b12b227 100644 --- a/java/examples/datasets/H5Ex_D_Chunk.java +++ b/java/examples/datasets/H5Ex_D_Chunk.java @@ -44,7 +44,7 @@ public class H5Ex_D_Chunk { // Values for the status of space allocation enum H5D_layout { - H5D_LAYOUT_ERROR(-1), H5D_COMPACT(0), H5D_CONTIGUOUS(1), H5D_CHUNKED(2), H5D_NLAYOUTS(3); + H5D_LAYOUT_ERROR(-1), H5D_COMPACT(0), H5D_CONTIGUOUS(1), H5D_CHUNKED(2), H5D_VIRTUAL(3), H5D_NLAYOUTS(4); private static final Map lookup = new HashMap(); static { @@ -250,6 +250,9 @@ public class H5Ex_D_Chunk { case H5D_CHUNKED: System.out.println("H5D_CHUNKED"); break; + case H5D_VIRTUAL: + System.out.println("H5D_VIRTUAL"); + break; case H5D_LAYOUT_ERROR: break; case H5D_NLAYOUTS: diff --git a/java/examples/datasets/H5Ex_D_Compact.java b/java/examples/datasets/H5Ex_D_Compact.java index 4f1e2f0..0417c7c 100644 --- a/java/examples/datasets/H5Ex_D_Compact.java +++ b/java/examples/datasets/H5Ex_D_Compact.java @@ -38,7 +38,7 @@ public class H5Ex_D_Compact { // Values for the status of space allocation enum H5D_layout { - H5D_LAYOUT_ERROR(-1), H5D_COMPACT(0), H5D_CONTIGUOUS(1), H5D_CHUNKED(2), H5D_NLAYOUTS(3); + H5D_LAYOUT_ERROR(-1), H5D_COMPACT(0), H5D_CONTIGUOUS(1), H5D_CHUNKED(2), H5D_VIRTUAL(3), H5D_NLAYOUTS(4); private static final Map lookup = new HashMap(); static { @@ -212,6 +212,9 @@ public class H5Ex_D_Compact { case H5D_CHUNKED: System.out.println("H5D_CHUNKED"); break; + case H5D_VIRTUAL: + System.out.println("H5D_VIRTUAL"); + break; case H5D_LAYOUT_ERROR: break; case H5D_NLAYOUTS: diff --git a/java/examples/datasets/runExample.sh.in b/java/examples/datasets/runExample.sh.in index 440de33..53d8070 100644 --- a/java/examples/datasets/runExample.sh.in +++ b/java/examples/datasets/runExample.sh.in @@ -161,6 +161,8 @@ CLEAN_DATAFILES_AND_BLDDIR() { $RM $BLDDIR/examples.datasets.H5Ex_D_*.txt $RM $BLDDIR/H5Ex_D_*.out + $RM $BLDDIR/H5Ex_D_*.h5 + $RM $BLDDIR/H5Ex_D_External.data } # Print a line-line message left justified in a field of 70 characters diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 3eae115..8569b8b 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDFJAVA_EXAMPLES_DATATYPES Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -31,16 +31,16 @@ set (HDF_JAVA_EXAMPLES if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") -else (WIN32) +else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") -endif (WIN32) +endif () set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS}") set (CMAKE_JAVA_CLASSPATH ".") foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") -endforeach (CMAKE_INCLUDE_PATH) +endforeach () foreach (example ${HDF_JAVA_EXAMPLES}) file (WRITE ${PROJECT_BINARY_DIR}/${example}_Manifest.txt @@ -52,23 +52,23 @@ foreach (example ${HDF_JAVA_EXAMPLES}) # install_jar (${example} ${HJAVA_INSTALL_DATA_DIR}/examples examples) get_target_property (${example}_CLASSPATH ${example} CLASSDIR) add_dependencies (${example} ${HDF5_JAVA_HDF5_LIB_TARGET}) -endforeach (example ${HDF_JAVA_EXAMPLES}) +endforeach () set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_NOP_JAR}") set (CMAKE_JAVA_CLASSPATH ".") foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}") -endforeach (HDFJAVA_JAR) +endforeach () MACRO (ADD_H5_TEST resultfile resultcode) if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else() + else () set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif() - endif(CMAKE_BUILD_TYPE MATCHES Debug) + endif () + endif () add_test ( NAME JAVA_datatypes-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -85,9 +85,9 @@ MACRO (ADD_H5_TEST resultfile resultcode) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_datatypes-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "JAVA_datatypes-${resultfile}") -ENDMACRO (ADD_H5_TEST file) +ENDMACRO () if (BUILD_TESTING) foreach (example ${HDF_JAVA_EXAMPLES}) @@ -99,7 +99,7 @@ if (BUILD_TESTING) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_datatypes-${example}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () add_test ( NAME JAVA_datatypes-${example}-copy-objects COMMAND ${CMAKE_COMMAND} @@ -110,5 +110,5 @@ if (BUILD_TESTING) set_tests_properties (JAVA_datatypes-${example}-copy-objects PROPERTIES DEPENDS JAVA_datatypes-${example}-clear-objects) set (last_test "JAVA_datatypes-${example}-copy-objects") ADD_H5_TEST (${example} 0) - endforeach (example ${HDF_JAVA_EXAMPLES}) -endif (BUILD_TESTING) + endforeach () +endif () diff --git a/java/examples/datatypes/runExample.sh.in b/java/examples/datatypes/runExample.sh.in index 1b02774..5b8816c 100644 --- a/java/examples/datatypes/runExample.sh.in +++ b/java/examples/datatypes/runExample.sh.in @@ -158,6 +158,7 @@ CLEAN_DATAFILES_AND_BLDDIR() { $RM $BLDDIR/examples.datatypes.H5Ex_T_*.txt $RM $BLDDIR/H5Ex_T_*.out + $RM $BLDDIR/H5Ex_T_*.h5 } # Print a line-line message left justified in a field of 70 characters diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index 2cab211..bb5f80f 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDFJAVA_EXAMPLES_GROUPS Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -20,16 +20,16 @@ set (HDF_JAVA_EXAMPLES if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") -else (WIN32) +else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") -endif (WIN32) +endif () set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS}") set (CMAKE_JAVA_CLASSPATH ".") foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") -endforeach (CMAKE_INCLUDE_PATH) +endforeach () foreach (example ${HDF_JAVA_EXAMPLES}) file (WRITE ${PROJECT_BINARY_DIR}/${example}_Manifest.txt @@ -41,14 +41,14 @@ foreach (example ${HDF_JAVA_EXAMPLES}) # install_jar (${example} ${HJAVA_INSTALL_DATA_DIR}/examples examples) get_target_property (${example}_CLASSPATH ${example} CLASSDIR) add_dependencies (${example} ${HDF5_JAVA_HDF5_LIB_TARGET}) -endforeach (example ${HDF_JAVA_EXAMPLES}) +endforeach () set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_NOP_JAR}") set (CMAKE_JAVA_CLASSPATH ".") foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}") -endforeach (HDFJAVA_JAR) +endforeach () set (HDF_JAVA_TEST_FILES h5ex_g_iterate.h5 @@ -57,17 +57,17 @@ set (HDF_JAVA_TEST_FILES foreach (h5_file ${HDF_JAVA_TEST_FILES}) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "H5Ex_G_Visit_files") -endforeach (h5_file ${HDF_JAVA_TEST_FILES}) +endforeach () add_custom_target(H5Ex_G_Visit_files ALL COMMENT "Copying files needed by H5Ex_G_Visit tests" DEPENDS ${H5Ex_G_Visit_files_list}) MACRO (ADD_H5_TEST resultfile resultcode) if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else() + else () set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif() - endif(CMAKE_BUILD_TYPE MATCHES Debug) + endif () + endif () add_test ( NAME JAVA_groups-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -84,9 +84,9 @@ MACRO (ADD_H5_TEST resultfile resultcode) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_groups-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "JAVA_groups-${resultfile}") -ENDMACRO (ADD_H5_TEST file) +ENDMACRO () if (BUILD_TESTING) foreach (example ${HDF_JAVA_EXAMPLES}) @@ -99,19 +99,19 @@ if (BUILD_TESTING) ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}1.h5 ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}2.h5 ) - else (${example} STREQUAL "H5Ex_G_Compact") + else () add_test ( NAME JAVA_groups-${example}-clear-h5s COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ) - endif (${example} STREQUAL "H5Ex_G_Compact") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_groups-${example}-clear-h5s PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "JAVA_groups-${example}-clear-h5s") - endif (NOT ${example} STREQUAL "H5Ex_G_Iterate" AND NOT ${example} STREQUAL "H5Ex_G_Visit") + endif () add_test ( NAME JAVA_groups-${example}-copy-objects COMMAND ${CMAKE_COMMAND} @@ -121,8 +121,8 @@ if (BUILD_TESTING) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_groups-${example}-copy-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "JAVA_groups-${example}-copy-objects") ADD_H5_TEST (${example} 0) - endforeach (example ${HDF_JAVA_EXAMPLES}) -endif (BUILD_TESTING) + endforeach () +endif () diff --git a/java/examples/groups/runExample.sh.in b/java/examples/groups/runExample.sh.in index 665b307..2a3f1c6 100644 --- a/java/examples/groups/runExample.sh.in +++ b/java/examples/groups/runExample.sh.in @@ -153,6 +153,14 @@ CLEAN_DATAFILES_AND_BLDDIR() { $RM $BLDDIR/examples.groups.H5Ex_G_*.txt $RM $BLDDIR/H5Ex_G_*.out + $RM $BLDDIR/H5Ex_G_*.h5 + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then SDIR=`$DIRNAME $tstfile` + $RM $BLDDIR/h5ex_g_iterate.h5 + $RM $BLDDIR/h5ex_g_visit.h5 + fi } COPY_REFFILES="$LIST_REF_FILES" diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 2d0c218..9dc4dd7 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDFJAVA_EXAMPLES_INTRO Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -20,16 +20,16 @@ set (HDF_JAVA_EXAMPLES if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") -else (WIN32) +else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") -endif (WIN32) +endif () set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS}") set (CMAKE_JAVA_CLASSPATH ".") foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") -endforeach (CMAKE_INCLUDE_PATH) +endforeach () foreach (example ${HDF_JAVA_EXAMPLES}) file (WRITE ${PROJECT_BINARY_DIR}/${example}_Manifest.txt @@ -41,14 +41,14 @@ foreach (example ${HDF_JAVA_EXAMPLES}) # install_jar (${example} ${HJAVA_INSTALL_DATA_DIR}/examples examples) get_target_property (${example}_CLASSPATH ${example} CLASSDIR) add_dependencies (${example} ${HDF5_JAVA_HDF5_LIB_TARGET}) -endforeach (example ${HDF_JAVA_EXAMPLES}) +endforeach () set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_NOP_JAR}") set (CMAKE_JAVA_CLASSPATH ".") foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}") -endforeach (HDFJAVA_JAR) +endforeach () foreach (example ${HDF_JAVA_OBJECT_EXAMPLES}) file (WRITE ${PROJECT_BINARY_DIR}/${example}_Manifest.txt @@ -60,16 +60,16 @@ foreach (example ${HDF_JAVA_OBJECT_EXAMPLES}) # install_jar (${example} ${HJAVA_INSTALL_DATA_DIR}/examples examples) get_target_property (${example}_CLASSPATH ${example} CLASSDIR) add_dependencies (${example} ${HDFJAVA_H5_LIB_TARGET}) -endforeach (example ${HDF_JAVA_OBJECT_EXAMPLES}) +endforeach () MACRO (ADD_H5_TEST resultfile resultcode) if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else() + else () set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif() - endif(CMAKE_BUILD_TYPE MATCHES Debug) + endif () + endif () add_test ( NAME JAVA_intro-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -86,9 +86,9 @@ MACRO (ADD_H5_TEST resultfile resultcode) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_intro-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "JAVA_intro-${resultfile}") -ENDMACRO (ADD_H5_TEST file) +ENDMACRO () if (BUILD_TESTING) @@ -101,7 +101,7 @@ if (BUILD_TESTING) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_intro-${example}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () add_test ( NAME JAVA_intro-${example}-copy-objects COMMAND ${CMAKE_COMMAND} @@ -112,6 +112,6 @@ if (BUILD_TESTING) set_tests_properties (JAVA_intro-${example}-copy-objects PROPERTIES DEPENDS JAVA_intro-${example}-clear-objects) set (last_test "JAVA_intro-${example}-copy-objects") ADD_H5_TEST (${example} 0) - endforeach (example ${HDF_JAVA_EXAMPLES}) + endforeach () -endif (BUILD_TESTING) +endif () diff --git a/java/examples/intro/runExample.sh.in b/java/examples/intro/runExample.sh.in index a8e65ff..65ca160 100644 --- a/java/examples/intro/runExample.sh.in +++ b/java/examples/intro/runExample.sh.in @@ -147,6 +147,7 @@ CLEAN_DATAFILES_AND_BLDDIR() { $RM $BLDDIR/examples.intro.H5_*.txt $RM $BLDDIR/H5_*.out + $RM $BLDDIR/H5_*.h5 } # Print a line-line message left justified in a field of 70 characters diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt index ae78201..3f93f39 100644 --- a/java/src/CMakeLists.txt +++ b/java/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.0) +cmake_minimum_required(VERSION 3.2.2) PROJECT ( HDF5_JAVA_SRC C Java ) #----------------------------------------------------------------------------- diff --git a/java/src/Makefile.am b/java/src/Makefile.am index 21aa5ec..d9e6f50 100644 --- a/java/src/Makefile.am +++ b/java/src/Makefile.am @@ -130,6 +130,7 @@ CLEANFILES = classhdf5_java.stamp $(jarfile) $(JAVAROOT)/$(pkgpath)/callbacks/*. clean: rm -rf $(JAVAROOT)/* rm -f $(jarfile) + rm -rf javadoc rm -f classhdf5_java.stamp diff --git a/java/src/hdf/CMakeLists.txt b/java/src/hdf/CMakeLists.txt index f465da9..84bda53 100644 --- a/java/src/hdf/CMakeLists.txt +++ b/java/src/hdf/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_JAVA_HDF) add_subdirectory (${HDF5_JAVA_HDF_SOURCE_DIR}/hdf5lib hdf5lib) diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt index 5362c44..c856c04 100644 --- a/java/src/hdf/hdf5lib/CMakeLists.txt +++ b/java/src/hdf/hdf5lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_JAVA_HDF_HDF5 Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -105,7 +105,7 @@ add_jar (${HDF5_JAVA_HDF5_LIB_TARGET} OUTPUT_NAME "${HDF5_JAVA_HDF5_LIB_TARGET}- install_jar (${HDF5_JAVA_HDF5_LIB_TARGET} LIBRARY DESTINATION ${HDF5_INSTALL_JAR_DIR} COMPONENT libraries) #if (NOT WIN32) # install_jni_symlink (${HDF5_JAVA_HDF5_LIB_TARGET} ${HDF5_INSTALL_JAR_DIR} libraries) -#endif (NOT WIN32) +#endif () get_target_property (${HDF5_JAVA_HDF5_LIB_TARGET}_JAR_FILE ${HDF5_JAVA_HDF5_LIB_TARGET} JAR_FILE) SET_GLOBAL_VARIABLE (HDF5_JAVA_JARS_TO_EXPORT "${HDF5_JAVA_JARS_TO_EXPORT};${${HDF5_JAVA_HDF5_LIB_TARGET}_JAR_FILE}") diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 6b2af4b..02d35ba 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -151,7 +151,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * layout of the source and destination, and the data for the array passed as a block of bytes, for instance, * *
- *      herr_t H5Dread(int fid, int filetype, int memtype, int memspace,
+ *      herr_t H5Dread(long fid, long filetype, long memtype, long memspace,
  *      void * data);
  * 
* @@ -171,7 +171,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * library. So the function above would be declared: * *
- * public synchronized static native int H5Dread(int fid, int filetype, int memtype, int memspace, Object data);
+ * public synchronized static native int H5Dread(long fid, long filetype, long memtype, long memspace, Object data);
  * 
* OPEN_IDS.addElement(id); @@ -192,7 +192,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * can be accessed as public variables of the Java class, such as: * *
- * int data_type = HDF5CDataTypes.JH5T_NATIVE_INT;
+ * long data_type = HDF5CDataTypes.JH5T_NATIVE_INT;
  * 
* * The Java application uses both types of constants the same way, the only difference is that the diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 9da31ee..9e6c099 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_JAVA_JNI C CXX) set (HDF5_JAVA_JNI_CSRCS @@ -67,8 +67,8 @@ if (WIN32) COMMENT "Copying ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${HDF5_JAVA_JNI_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) add_dependencies (HDF5_JAVA_JNI-Test-Copy ${HDF5_JAVA_JNI_LIB_TARGET}) - endif (BUILD_TESTING) -endif (WIN32) + endif () +endif () #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects @@ -79,11 +79,11 @@ if (HDF5_EXPORTED_TARGETS) TARGETS ${HDF5_JAVA_JNI_LIB_TARGET} EXPORT - ${HDF5_JAVA_EXPORTED_TARGETS} + ${HDF5_EXPORTED_TARGETS} LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries RUNTIME DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT libraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index 976a224..ccd0b91 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -28,396 +28,396 @@ extern "C" { #pragma GCC diagnostic ignored "-Wmissing-prototypes" -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1QUARTER_1HADDR_1MAX(JNIEnv *env, jclass cls) { return (hsize_t)HADDR_MAX/4; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1SZIP_1ALLOW_1K13_1OPTION_1MASK(JNIEnv *env, jclass cls) { return H5_SZIP_ALLOW_K13_OPTION_MASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1SZIP_1CHIP_1OPTION_1MASK(JNIEnv *env, jclass cls) { return H5_SZIP_CHIP_OPTION_MASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1SZIP_1EC_1OPTION_1MASK(JNIEnv *env, jclass cls) { return H5_SZIP_EC_OPTION_MASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1SZIP_1MAX_1PIXELS_1PER_1BLOCK(JNIEnv *env, jclass cls) { return H5_SZIP_MAX_PIXELS_PER_BLOCK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1SZIP_1NN_1OPTION_1MASK(JNIEnv *env, jclass cls) { return H5_SZIP_NN_OPTION_MASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1INDEX_1UNKNOWN(JNIEnv *env, jclass cls) { return H5_INDEX_UNKNOWN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1INDEX_1NAME(JNIEnv *env, jclass cls) { return H5_INDEX_NAME; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1INDEX_1CRT_1ORDER(JNIEnv *env, jclass cls) { return H5_INDEX_CRT_ORDER; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1INDEX_1N(JNIEnv *env, jclass cls) { return H5_INDEX_N; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1ITER_1UNKNOWN(JNIEnv *env, jclass cls) { return H5_ITER_UNKNOWN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1ITER_1INC(JNIEnv *env, jclass cls) { return H5_ITER_INC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1ITER_1DEC(JNIEnv *env, jclass cls) { return H5_ITER_DEC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1ITER_1NATIVE(JNIEnv *env, jclass cls) { return H5_ITER_NATIVE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1ITER_1N(JNIEnv *env, jclass cls) { return H5_ITER_N; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5AC_1CURR_1CACHE_1CONFIG_1VERSION(JNIEnv *env, jclass cls) { return H5AC__CURR_CACHE_CONFIG_VERSION; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5AC_1MAX_1TRACE_1FILE_1NAME_1LEN(JNIEnv *env, jclass cls) { return H5AC__MAX_TRACE_FILE_NAME_LEN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5AC_1METADATA_1WRITE_1STRATEGY_1PROCESS_1ZERO_1ONLY(JNIEnv *env, jclass cls) { return H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5AC_1METADATA_1WRITE_1STRATEGY_1DISTRIBUTED(JNIEnv *env, jclass cls) { return H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1incr_1off(JNIEnv *env, jclass cls) { return H5C_incr__off; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1incr_1threshold(JNIEnv *env, jclass cls) { return H5C_incr__threshold; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1flash_1incr_1off(JNIEnv *env, jclass cls) { return H5C_flash_incr__off; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1flash_1incr_1add_1space(JNIEnv *env, jclass cls) { return H5C_flash_incr__add_space; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1decr_1off(JNIEnv *env, jclass cls) { return H5C_decr__off; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1decr_1threshold(JNIEnv *env, jclass cls) { return H5C_decr__threshold; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1decr_1age_1out(JNIEnv *env, jclass cls) { return H5C_decr__age_out; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1decr_1age_1out_1with_1threshold(JNIEnv *env, jclass cls) { return H5C_decr__age_out_with_threshold; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1CHUNK_1IDX_1BTREE(JNIEnv *env, jclass cls) { return H5D_CHUNK_IDX_BTREE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1ALLOC_1TIME_1DEFAULT(JNIEnv *env, jclass cls) { return H5D_ALLOC_TIME_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1ALLOC_1TIME_1EARLY(JNIEnv *env, jclass cls) { return H5D_ALLOC_TIME_EARLY; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1ALLOC_1TIME_1ERROR(JNIEnv *env, jclass cls) { return H5D_ALLOC_TIME_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1ALLOC_1TIME_1INCR(JNIEnv *env, jclass cls) { return H5D_ALLOC_TIME_INCR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1ALLOC_1TIME_1LATE(JNIEnv *env, jclass cls) { return H5D_ALLOC_TIME_LATE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1TIME_1ERROR(JNIEnv *env, jclass cls) { return H5D_FILL_TIME_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1TIME_1ALLOC(JNIEnv *env, jclass cls) { return H5D_FILL_TIME_ALLOC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1TIME_1NEVER(JNIEnv *env, jclass cls) { return H5D_FILL_TIME_NEVER; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1TIME_1IFSET(JNIEnv *env, jclass cls) { return H5D_FILL_TIME_IFSET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1VALUE_1DEFAULT(JNIEnv *env, jclass cls) { return H5D_FILL_VALUE_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1VALUE_1ERROR(JNIEnv *env, jclass cls) { return H5D_FILL_VALUE_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1VALUE_1UNDEFINED(JNIEnv *env, jclass cls) { return H5D_FILL_VALUE_UNDEFINED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1VALUE_1USER_1DEFINED(JNIEnv *env, jclass cls) { return H5D_FILL_VALUE_USER_DEFINED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1LAYOUT_1ERROR(JNIEnv *env, jclass cls) { return H5D_LAYOUT_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1CHUNKED(JNIEnv *env, jclass cls) { return H5D_CHUNKED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1COMPACT(JNIEnv *env, jclass cls) { return H5D_COMPACT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1CONTIGUOUS(JNIEnv *env, jclass cls) { return H5D_CONTIGUOUS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VIRTUAL(JNIEnv *env, jclass cls) { return H5D_VIRTUAL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1NLAYOUTS(JNIEnv *env, jclass cls) { return H5D_NLAYOUTS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1SPACE_1STATUS_1ALLOCATED(JNIEnv *env, jclass cls) { return H5D_SPACE_STATUS_ALLOCATED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1SPACE_1STATUS_1ERROR(JNIEnv *env, jclass cls) { return H5D_SPACE_STATUS_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1SPACE_1STATUS_1NOT_1ALLOCATED(JNIEnv *env, jclass cls) { return H5D_SPACE_STATUS_NOT_ALLOCATED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1SPACE_1STATUS_1PART_1ALLOCATED(JNIEnv *env, jclass cls) { return H5D_SPACE_STATUS_PART_ALLOCATED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1ERROR(JNIEnv *env, jclass cls) { return H5D_VDS_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1FIRST_1MISSING(JNIEnv *env, jclass cls) { return H5D_VDS_FIRST_MISSING; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1LAST_1AVAILABLE(JNIEnv *env, jclass cls) { return H5D_VDS_LAST_AVAILABLE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ALIGNMENT(JNIEnv *env, jclass cls) { return H5E_ALIGNMENT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ALREADYEXISTS(JNIEnv *env, jclass cls) { return H5E_ALREADYEXISTS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ALREADYINIT(JNIEnv *env, jclass cls) { return H5E_ALREADYINIT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ARGS(JNIEnv *env, jclass cls) { return H5E_ARGS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ATOM(JNIEnv *env, jclass cls) { return H5E_ATOM; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ATTR(JNIEnv *env, jclass cls) { return H5E_ATTR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADATOM(JNIEnv *env, jclass cls) { return H5E_BADATOM; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADFILE(JNIEnv *env, jclass cls) { return H5E_BADFILE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADGROUP(JNIEnv *env, jclass cls) { return H5E_BADGROUP; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADMESG(JNIEnv *env, jclass cls) { return H5E_BADMESG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADRANGE(JNIEnv *env, jclass cls) { return H5E_BADRANGE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADSELECT(JNIEnv *env, jclass cls) { return H5E_BADSELECT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADSIZE(JNIEnv *env, jclass cls) { return H5E_BADSIZE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADTYPE(JNIEnv *env, jclass cls) { return H5E_BADTYPE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADVALUE(JNIEnv *env, jclass cls) { return H5E_BADVALUE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BTREE(JNIEnv *env, jclass cls) { return H5E_BTREE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CACHE(JNIEnv *env, jclass cls) { return H5E_CACHE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CALLBACK(JNIEnv *env, jclass cls) { return H5E_CALLBACK; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANAPPLY(JNIEnv *env, jclass cls) { return H5E_CANAPPLY; } -/*JNIEXPORT jlong JNICALL +/*JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTALLOC(JNIEnv *env, jclass cls) { return H5E_CANTALLOC; }*/ -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLIP(JNIEnv *env, jclass cls) { return H5E_CANTCLIP; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLOSEFILE(JNIEnv *env, jclass cls) { return H5E_CANTCLOSEFILE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCONVERT(JNIEnv *env, jclass cls) { return H5E_CANTCONVERT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOPY(JNIEnv *env, jclass cls) { return H5E_CANTCOPY; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOUNT(JNIEnv *env, jclass cls) { return H5E_CANTCOUNT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCREATE(JNIEnv *env, jclass cls) { return H5E_CANTCREATE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDEC(JNIEnv *env, jclass cls) { return H5E_CANTDEC; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDECODE(JNIEnv *env, jclass cls) { return H5E_CANTDECODE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDELETE(JNIEnv *env, jclass cls) { return H5E_CANTDELETE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTENCODE(JNIEnv *env, jclass cls) { return H5E_CANTENCODE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFLUSH(JNIEnv *env, jclass cls) { return H5E_CANTFLUSH; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFREE(JNIEnv *env, jclass cls) { return H5E_CANTFREE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGET(JNIEnv *env, jclass cls) { return H5E_CANTGET; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINC(JNIEnv *env, jclass cls) { return H5E_CANTINC; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINIT(JNIEnv *env, jclass cls) { return H5E_CANTINIT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINSERT(JNIEnv *env, jclass cls) { return H5E_CANTINSERT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLIST(JNIEnv *env, jclass cls) { return H5E_CANTLIST; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLOAD(JNIEnv *env, jclass cls) { return H5E_CANTLOAD; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLOCK(JNIEnv *env, jclass cls) { return H5E_CANTLOCK; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTNEXT(JNIEnv *env, jclass cls) { return H5E_CANTNEXT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPENFILE(JNIEnv *env, jclass cls) { return H5E_CANTOPENFILE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPENOBJ(JNIEnv *env, jclass cls) { return H5E_CANTOPENOBJ; } -/*JNIEXPORT jlong JNICALL +/*JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRECV(JNIEnv *env, jclass cls) { return H5E_CANTRECV; }*/ -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREGISTER(JNIEnv *env, jclass cls) { return H5E_CANTREGISTER; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRELEASE(JNIEnv *env, jclass cls) { return H5E_CANTRELEASE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSELECT(JNIEnv *env, jclass cls) { return H5E_CANTSELECT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSET(JNIEnv *env, jclass cls) { return H5E_CANTSET; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSPLIT(JNIEnv *env, jclass cls) { return H5E_CANTSPLIT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNLOCK(JNIEnv *env, jclass cls) { return H5E_CANTUNLOCK; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CLOSEERROR(JNIEnv *env, jclass cls) { return H5E_CLOSEERROR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1COMPLEN(JNIEnv *env, jclass cls) { return H5E_COMPLEN; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1DATASET(JNIEnv *env, jclass cls) { return H5E_DATASET; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1DATASPACE(JNIEnv *env, jclass cls) { return H5E_DATASPACE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1DATATYPE(JNIEnv *env, jclass cls) { return H5E_DATATYPE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1DEFAULT(JNIEnv *env, jclass cls) { return H5E_DEFAULT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1DUPCLASS(JNIEnv *env, jclass cls) { return H5E_DUPCLASS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1EFL(JNIEnv *env, jclass cls) { return H5E_EFL; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1EXISTS(JNIEnv *env, jclass cls) { return H5E_EXISTS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FCNTL(JNIEnv *env, jclass cls) { return H5E_FCNTL; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FILE(JNIEnv *env, jclass cls) { return H5E_FILE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FILEEXISTS(JNIEnv *env, jclass cls) { return H5E_FILEEXISTS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FILEOPEN(JNIEnv *env, jclass cls) { return H5E_FILEOPEN; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FUNC(JNIEnv *env, jclass cls) { return H5E_FUNC; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1HEAP(JNIEnv *env, jclass cls) { return H5E_HEAP; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1INTERNAL(JNIEnv *env, jclass cls) { return H5E_INTERNAL; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1IO(JNIEnv *env, jclass cls) { return H5E_IO; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1LINK(JNIEnv *env, jclass cls) { return H5E_LINK; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1LINKCOUNT(JNIEnv *env, jclass cls) { return H5E_LINKCOUNT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MAJOR(JNIEnv *env, jclass cls) { return H5E_MAJOR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MINOR(JNIEnv *env, jclass cls) { return H5E_MINOR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MOUNT(JNIEnv *env, jclass cls) { return H5E_MOUNT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MPI(JNIEnv *env, jclass cls) { return H5E_MPI; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MPIERRSTR(JNIEnv *env, jclass cls) { return H5E_MPIERRSTR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOFILTER(JNIEnv *env, jclass cls) { return H5E_NOFILTER; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOIDS(JNIEnv *env, jclass cls) { return H5E_NOIDS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NONE_1MAJOR(JNIEnv *env, jclass cls) { return H5E_NONE_MAJOR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NONE_1MINOR(JNIEnv *env, jclass cls) { return H5E_NONE_MINOR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOSPACE(JNIEnv *env, jclass cls) { return H5E_NOSPACE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTCACHED(JNIEnv *env, jclass cls) { return H5E_NOTCACHED; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTFOUND(JNIEnv *env, jclass cls) { return H5E_NOTFOUND; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTHDF5(JNIEnv *env, jclass cls) { return H5E_NOTHDF5; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1OHDR(JNIEnv *env, jclass cls) { return H5E_OHDR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1OVERFLOW(JNIEnv *env, jclass cls) { return H5E_OVERFLOW; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1PLINE(JNIEnv *env, jclass cls) { return H5E_PLINE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1PLIST(JNIEnv *env, jclass cls) { return H5E_PLIST; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1PROTECT(JNIEnv *env, jclass cls) { return H5E_PROTECT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1READERROR(JNIEnv *env, jclass cls) { return H5E_READERROR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1REFERENCE(JNIEnv *env, jclass cls) { return H5E_REFERENCE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1RESOURCE(JNIEnv *env, jclass cls) { return H5E_RESOURCE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1RS(JNIEnv *env, jclass cls) { return H5E_RS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1SEEKERROR(JNIEnv *env, jclass cls) { return H5E_SEEKERROR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1SETLOCAL(JNIEnv *env, jclass cls) { return H5E_SETLOCAL; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1STORAGE(JNIEnv *env, jclass cls) { return H5E_STORAGE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1SYM(JNIEnv *env, jclass cls) { return H5E_SYM; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1TRUNCATED(JNIEnv *env, jclass cls) { return H5E_TRUNCATED; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1TST(JNIEnv *env, jclass cls) { return H5E_TST; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1UNINITIALIZED(JNIEnv *env, jclass cls) { return H5E_UNINITIALIZED; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1UNSUPPORTED(JNIEnv *env, jclass cls) { return H5E_UNSUPPORTED; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1VERSION(JNIEnv *env, jclass cls) { return H5E_VERSION; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1VFL(JNIEnv *env, jclass cls) { return H5E_VFL; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1WALK_1DOWNWARD(JNIEnv *env, jclass cls) { return H5E_WALK_DOWNWARD; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1WALK_1UPWARD(JNIEnv *env, jclass cls) { return H5E_WALK_UPWARD; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1WRITEERROR(JNIEnv *env, jclass cls) { return H5E_WRITEERROR; } /* Java does not have unsigned native types */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-conversion" -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1CREAT(JNIEnv *env, jclass cls) { return H5F_ACC_CREAT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1EXCL(JNIEnv *env, jclass cls) { return H5F_ACC_EXCL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1RDONLY(JNIEnv *env, jclass cls) { return H5F_ACC_RDONLY; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1RDWR(JNIEnv *env, jclass cls) { return H5F_ACC_RDWR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1TRUNC(JNIEnv *env, jclass cls) { return H5F_ACC_TRUNC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1DEFAULT(JNIEnv *env, jclass cls) { return H5F_ACC_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1SWMR_1READ(JNIEnv *env, jclass cls) { return H5F_ACC_SWMR_READ; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1SWMR_1WRITE(JNIEnv *env, jclass cls) { return H5F_ACC_SWMR_WRITE; } #pragma GCC diagnostic pop -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1DEFAULT(JNIEnv *env, jclass cls) { return H5F_CLOSE_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1SEMI(JNIEnv *env, jclass cls) { return H5F_CLOSE_SEMI; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1STRONG(JNIEnv *env, jclass cls) { return H5F_CLOSE_STRONG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1WEAK(JNIEnv *env, jclass cls) { return H5F_CLOSE_WEAK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_EARLIEST;} -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1LATEST(JNIEnv *env, jclass cls){return H5F_LIBVER_LATEST;} -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1ALL(JNIEnv *env, jclass cls) { return H5F_OBJ_ALL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1ATTR(JNIEnv *env, jclass cls) { return H5F_OBJ_ATTR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1DATASET(JNIEnv *env, jclass cls) { return H5F_OBJ_DATASET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1DATATYPE(JNIEnv *env, jclass cls) { return H5F_OBJ_DATATYPE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1FILE(JNIEnv *env, jclass cls) { return H5F_OBJ_FILE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1GROUP(JNIEnv *env, jclass cls) { return H5F_OBJ_GROUP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1LOCAL(JNIEnv *env, jclass cls) { return H5F_OBJ_LOCAL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1SCOPE_1GLOBAL(JNIEnv *env, jclass cls) { return H5F_SCOPE_GLOBAL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1SCOPE_1LOCAL(JNIEnv *env, jclass cls) { return H5F_SCOPE_LOCAL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1UNLIMITED(JNIEnv *env, jclass cls) { return (jint)H5F_UNLIMITED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1FILE_1SPACE_1DEFAULT(JNIEnv *env, jclass cls) { return H5F_FILE_SPACE_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1FILE_1SPACE_1ALL_1PERSIST(JNIEnv *env, jclass cls) { return H5F_FILE_SPACE_ALL_PERSIST; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1FILE_1SPACE_1ALL(JNIEnv *env, jclass cls) { return H5F_FILE_SPACE_ALL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1FILE_1SPACE_1AGGR_1VFD(JNIEnv *env, jclass cls) { return H5F_FILE_SPACE_AGGR_VFD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1FILE_1SPACE_1VFD(JNIEnv *env, jclass cls) { return H5F_FILE_SPACE_VFD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1FILE_1SPACE_1NTYPES(JNIEnv *env, jclass cls) { return H5F_FILE_SPACE_NTYPES; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1CORE(JNIEnv *env, jclass cls) { return H5FD_CORE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1DIRECT(JNIEnv *env, jclass cls) { #ifdef H5_HAVE_DIRECT return H5FD_DIRECT; @@ -425,19 +425,19 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1DIRECT(JNIEnv *env, jclass cls) { return -1; #endif } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1FAMILY(JNIEnv *env, jclass cls) { return H5FD_FAMILY; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG(JNIEnv *env, jclass cls) { return H5FD_LOG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MPIO(JNIEnv *env, jclass cls) { return H5FD_MPIO; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MULTI(JNIEnv *env, jclass cls) { return H5FD_MULTI; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1SEC2(JNIEnv *env, jclass cls) { return H5FD_SEC2; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1STDIO(JNIEnv *env, jclass cls) { return H5FD_STDIO; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1WINDOWS(JNIEnv *env, jclass cls) { #ifdef H5_HAVE_WINDOWS return H5FD_DIRECT; @@ -445,84 +445,84 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1WINDOWS(JNIEnv *env, jclass cls) { return -1; #endif } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1LOC_1READ(JNIEnv *env, jclass cls) { return H5FD_LOG_LOC_READ; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1LOC_1WRITE(JNIEnv *env, jclass cls) { return H5FD_LOG_LOC_WRITE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1LOC_1SEEK(JNIEnv *env, jclass cls) { return H5FD_LOG_LOC_SEEK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1LOC_1IO(JNIEnv *env, jclass cls) { return H5FD_LOG_LOC_IO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1FILE_1READ(JNIEnv *env, jclass cls) { return H5FD_LOG_FILE_READ; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1FILE_1WRITE(JNIEnv *env, jclass cls) { return H5FD_LOG_FILE_WRITE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1FILE_1IO(JNIEnv *env, jclass cls) { return H5FD_LOG_FILE_IO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1FLAVOR(JNIEnv *env, jclass cls) { return H5FD_LOG_FLAVOR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1NUM_1READ(JNIEnv *env, jclass cls) { return H5FD_LOG_NUM_READ; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1NUM_1WRITE(JNIEnv *env, jclass cls) { return H5FD_LOG_NUM_WRITE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1NUM_1SEEK(JNIEnv *env, jclass cls) { return H5FD_LOG_NUM_SEEK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1NUM_1TRUNCATE(JNIEnv *env, jclass cls) { return H5FD_LOG_NUM_TRUNCATE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1NUM_1IO(JNIEnv *env, jclass cls) { return H5FD_LOG_NUM_IO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1OPEN(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_OPEN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1STAT(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_STAT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1READ(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_READ; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1WRITE(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_WRITE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1SEEK(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_SEEK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1CLOSE(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_CLOSE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1IO(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_IO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1ALLOC(JNIEnv *env, jclass cls) { return H5FD_LOG_ALLOC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1ALL(JNIEnv *env, jclass cls) { return H5FD_LOG_ALL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1NOLIST(JNIEnv *env, jclass cls) { return H5FD_MEM_NOLIST; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT(JNIEnv *env, jclass cls) { return H5FD_MEM_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1SUPER(JNIEnv *env, jclass cls) { return H5FD_MEM_SUPER; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1BTREE(JNIEnv *env, jclass cls) { return H5FD_MEM_BTREE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DRAW(JNIEnv *env, jclass cls) { return H5FD_MEM_DRAW; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1GHEAP(JNIEnv *env, jclass cls) { return H5FD_MEM_GHEAP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1LHEAP(JNIEnv *env, jclass cls) { return H5FD_MEM_LHEAP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1OHDR(JNIEnv *env, jclass cls) { return H5FD_MEM_OHDR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1NTYPES(JNIEnv *env, jclass cls) { return H5FD_MEM_NTYPES; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1DEFAULT_1HADDR_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)(HADDR_MAX/H5FD_MEM_NTYPES); } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)0; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1SUPER_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)0; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1BTREE_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)(1 * (HADDR_MAX / (H5FD_MEM_NTYPES-1))); } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1DRAW_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)(2 * (HADDR_MAX / (H5FD_MEM_NTYPES-1))); } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1GHEAP_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)(3 * (HADDR_MAX / (H5FD_MEM_NTYPES-1))); } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1LHEAP_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)(4 * (HADDR_MAX / (H5FD_MEM_NTYPES-1))); } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1OHDR_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)(5 * (HADDR_MAX / (H5FD_MEM_NTYPES-1))); } @@ -532,769 +532,769 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1OHDR_1SIZE(JNIEnv *env, jclas */ #ifndef H5_NO_DEPRECATED_SYMBOLS -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1DATASET(JNIEnv *env, jclass cls) { return H5G_DATASET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1GROUP(JNIEnv *env, jclass cls) { return H5G_GROUP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1LINK(JNIEnv *env, jclass cls) { return H5G_LINK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1UDLINK(JNIEnv *env, jclass cls) { return H5G_UDLINK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1RESERVED_15(JNIEnv *env, jclass cls) { return H5G_RESERVED_5; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1RESERVED_16(JNIEnv *env, jclass cls) { return H5G_RESERVED_6; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1RESERVED_17(JNIEnv *env, jclass cls) { return H5G_RESERVED_7; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1TYPE(JNIEnv *env, jclass cls) { return H5G_TYPE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1UNKNOWN(JNIEnv *env, jclass cls) { return H5G_UNKNOWN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1LINK_1ERROR(JNIEnv *env, jclass cls) { return H5G_LINK_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1LINK_1HARD(JNIEnv *env, jclass cls) { return H5G_LINK_HARD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1LINK_1SOFT(JNIEnv *env, jclass cls) { return H5G_LINK_SOFT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1NLIBTYPES(JNIEnv *env, jclass cls) { return H5G_NLIBTYPES; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1NTYPES(JNIEnv *env, jclass cls) { return H5G_NTYPES; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1NUSERTYPES(JNIEnv *env, jclass cls) { return H5G_NUSERTYPES; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1SAME_1LOC(JNIEnv *env, jclass cls) { return H5G_SAME_LOC; } #endif /* H5_NO_DEPRECATED_SYMBOLS */ -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1STORAGE_1TYPE_1UNKNOWN(JNIEnv *env, jclass cls){ return H5G_STORAGE_TYPE_UNKNOWN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1STORAGE_1TYPE_1SYMBOL_1TABLE(JNIEnv *env, jclass cls){ return H5G_STORAGE_TYPE_SYMBOL_TABLE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1STORAGE_1TYPE_1COMPACT(JNIEnv *env, jclass cls){ return H5G_STORAGE_TYPE_COMPACT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1STORAGE_1TYPE_1DENSE(JNIEnv *env, jclass cls){ return H5G_STORAGE_TYPE_DENSE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1UNINIT(JNIEnv *env, jclass cls) { return H5I_UNINIT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1BADID(JNIEnv *env, jclass cls) { return H5I_BADID; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1FILE(JNIEnv *env, jclass cls) { return H5I_FILE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1GROUP(JNIEnv *env, jclass cls) { return H5I_GROUP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1DATATYPE(JNIEnv *env, jclass cls) { return H5I_DATATYPE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1DATASPACE(JNIEnv *env, jclass cls) { return H5I_DATASPACE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1DATASET(JNIEnv *env, jclass cls) { return H5I_DATASET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1ATTR(JNIEnv *env, jclass cls) { return H5I_ATTR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1REFERENCE(JNIEnv *env, jclass cls) { return H5I_REFERENCE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1VFL(JNIEnv *env, jclass cls) { return H5I_VFL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1INVALID_1HID(JNIEnv *env, jclass cls) { return H5I_INVALID_HID; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1GENPROP_1CLS(JNIEnv *env, jclass cls) { return H5I_GENPROP_CLS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1GENPROP_1LST(JNIEnv *env, jclass cls) { return H5I_GENPROP_LST; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1ERROR_1CLASS(JNIEnv *env, jclass cls) { return H5I_ERROR_CLASS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1ERROR_1MSG(JNIEnv *env, jclass cls) { return H5I_ERROR_MSG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1ERROR_1STACK(JNIEnv *env, jclass cls) { return H5I_ERROR_STACK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1NTYPES(JNIEnv *env, jclass cls) { return H5I_NTYPES; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5L_1TYPE_1ERROR(JNIEnv *env, jclass cls) { return H5L_TYPE_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5L_1TYPE_1HARD(JNIEnv *env, jclass cls) { return H5L_TYPE_HARD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5L_1TYPE_1SOFT(JNIEnv *env, jclass cls) { return H5L_TYPE_SOFT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5L_1TYPE_1EXTERNAL(JNIEnv *env, jclass cls) { return H5L_TYPE_EXTERNAL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5L_1TYPE_1MAX(JNIEnv *env, jclass cls) { return H5L_TYPE_MAX; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1COPY_1SHALLOW_1HIERARCHY_1FLAG(JNIEnv *env, jclass cls){return H5O_COPY_SHALLOW_HIERARCHY_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1COPY_1EXPAND_1SOFT_1LINK_1FLAG(JNIEnv *env, jclass cls){return H5O_COPY_EXPAND_SOFT_LINK_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1COPY_1EXPAND_1EXT_1LINK_1FLAG(JNIEnv *env, jclass cls){return H5O_COPY_EXPAND_EXT_LINK_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1COPY_1EXPAND_1REFERENCE_1FLAG(JNIEnv *env, jclass cls){return H5O_COPY_EXPAND_REFERENCE_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1COPY_1WITHOUT_1ATTR_1FLAG(JNIEnv *env, jclass cls){return H5O_COPY_WITHOUT_ATTR_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1COPY_1PRESERVE_1NULL_1FLAG(JNIEnv *env, jclass cls){return H5O_COPY_PRESERVE_NULL_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1NONE_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_NONE_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1SDSPACE_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_SDSPACE_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1DTYPE_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_DTYPE_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1FILL_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_FILL_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1PLINE_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_PLINE_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1ATTR_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_ATTR_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1ALL_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_ALL_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1TYPE_1UNKNOWN(JNIEnv *env, jclass cls) { return H5O_TYPE_UNKNOWN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1TYPE_1GROUP(JNIEnv *env, jclass cls) { return H5O_TYPE_GROUP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1TYPE_1DATASET(JNIEnv *env, jclass cls) { return H5O_TYPE_DATASET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1TYPE_1NAMED_1DATATYPE(JNIEnv *env, jclass cls) { return H5O_TYPE_NAMED_DATATYPE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1TYPE_1NTYPES(JNIEnv *env, jclass cls) { return H5O_TYPE_NTYPES; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1ROOT(JNIEnv *env, jclass cls){return H5P_ROOT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1OBJECT_1CREATE(JNIEnv *env, jclass cls){return H5P_OBJECT_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1FILE_1CREATE(JNIEnv *env, jclass cls){return H5P_FILE_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1FILE_1ACCESS(JNIEnv *env, jclass cls){return H5P_FILE_ACCESS;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATASET_1CREATE(JNIEnv *env, jclass cls){return H5P_DATASET_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATASET_1ACCESS(JNIEnv *env, jclass cls){return H5P_DATASET_ACCESS;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATASET_1XFER(JNIEnv *env, jclass cls){return H5P_DATASET_XFER;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1FILE_1MOUNT(JNIEnv *env, jclass cls){return H5P_FILE_MOUNT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1GROUP_1CREATE(JNIEnv *env, jclass cls){return H5P_GROUP_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1GROUP_1ACCESS(JNIEnv *env, jclass cls){return H5P_GROUP_ACCESS;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATATYPE_1CREATE(JNIEnv *env, jclass cls){return H5P_DATATYPE_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATATYPE_1ACCESS(JNIEnv *env, jclass cls){return H5P_DATATYPE_ACCESS;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1STRING_1CREATE(JNIEnv *env, jclass cls){return H5P_STRING_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1ATTRIBUTE_1CREATE(JNIEnv *env, jclass cls){return H5P_ATTRIBUTE_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1ATTRIBUTE_1ACCESS(JNIEnv *env, jclass cls){return H5P_ATTRIBUTE_ACCESS;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1OBJECT_1COPY(JNIEnv *env, jclass cls){return H5P_OBJECT_COPY;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1LINK_1CREATE(JNIEnv *env, jclass cls){return H5P_LINK_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1LINK_1ACCESS(JNIEnv *env, jclass cls){return H5P_LINK_ACCESS;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1FILE_1CREATE_1DEFAULT(JNIEnv *env, jclass cls){return H5P_FILE_CREATE_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1FILE_1ACCESS_1DEFAULT(JNIEnv *env, jclass cls){return H5P_FILE_ACCESS_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATASET_1CREATE_1DEFAULT(JNIEnv *env, jclass cls){return H5P_DATASET_CREATE_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATASET_1ACCESS_1DEFAULT(JNIEnv *env, jclass cls){return H5P_DATASET_ACCESS_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATASET_1XFER_1DEFAULT(JNIEnv *env, jclass cls){return H5P_DATASET_XFER_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1FILE_1MOUNT_1DEFAULT(JNIEnv *env, jclass cls){return H5P_FILE_MOUNT_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1GROUP_1CREATE_1DEFAULT(JNIEnv *env, jclass cls){return H5P_GROUP_CREATE_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1GROUP_1ACCESS_1DEFAULT(JNIEnv *env, jclass cls){return H5P_GROUP_ACCESS_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATATYPE_1CREATE_1DEFAULT(JNIEnv *env, jclass cls){return H5P_DATATYPE_CREATE_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATATYPE_1ACCESS_1DEFAULT(JNIEnv *env, jclass cls){return H5P_DATATYPE_ACCESS_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1ATTRIBUTE_1CREATE_1DEFAULT(JNIEnv *env, jclass cls){return H5P_ATTRIBUTE_CREATE_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1ATTRIBUTE_1ACCESS_1DEFAULT(JNIEnv *env, jclass cls){return H5P_ATTRIBUTE_ACCESS_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1OBJECT_1COPY_1DEFAULT(JNIEnv *env, jclass cls){return H5P_OBJECT_COPY_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1LINK_1CREATE_1DEFAULT(JNIEnv *env, jclass cls){return H5P_LINK_CREATE_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1LINK_1ACCESS_1DEFAULT(JNIEnv *env, jclass cls){return H5P_LINK_ACCESS_DEFAULT;} -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1CRT_1ORDER_1TRACKED(JNIEnv *env, jclass cls){return H5P_CRT_ORDER_TRACKED;} -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1CRT_1ORDER_1INDEXED(JNIEnv *env, jclass cls){return H5P_CRT_ORDER_INDEXED;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DEFAULT(JNIEnv *env, jclass cls) { return H5P_DEFAULT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1NO_1CLASS(JNIEnv *env, jclass cls) { return H5P_ROOT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5PL_1TYPE_1ERROR(JNIEnv *env, jclass cls) { return H5PL_TYPE_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5PL_1TYPE_1FILTER(JNIEnv *env, jclass cls) { return H5PL_TYPE_FILTER; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5PL_1FILTER_1PLUGIN(JNIEnv *env, jclass cls) { return H5PL_FILTER_PLUGIN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5PL_1ALL_1PLUGIN(JNIEnv *env, jclass cls) { return H5PL_ALL_PLUGIN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5R_1BADTYPE(JNIEnv *env, jclass cls) { return H5R_BADTYPE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5R_1MAXTYPE(JNIEnv *env, jclass cls) { return H5R_MAXTYPE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5R_1OBJ_1REF_1BUF_1SIZE(JNIEnv *env, jclass cls) { return H5R_OBJ_REF_BUF_SIZE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5R_1DSET_1REG_1REF_1BUF_1SIZE(JNIEnv *env, jclass cls) { return H5R_DSET_REG_REF_BUF_SIZE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5R_1OBJECT(JNIEnv *env, jclass cls) { return H5R_OBJECT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5R_1DATASET_1REGION(JNIEnv *env, jclass cls) { return H5R_DATASET_REGION; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1ALL(JNIEnv *env, jclass cls) { return H5S_ALL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1MAX_1RANK(JNIEnv *env, jclass cls) { return H5S_MAX_RANK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1NO_1CLASS(JNIEnv *env, jclass cls) { return H5S_NO_CLASS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1NULL(JNIEnv *env, jclass cls) { return H5S_NULL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SCALAR(JNIEnv *env, jclass cls) { return H5S_SCALAR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SEL_1ALL(JNIEnv *env, jclass cls) { return H5S_SEL_ALL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SEL_1ERROR(JNIEnv *env, jclass cls) { return H5S_SEL_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SEL_1HYPERSLABS(JNIEnv *env, jclass cls) { return H5S_SEL_HYPERSLABS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SEL_1N(JNIEnv *env, jclass cls) { return H5S_SEL_N; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SEL_1NONE(JNIEnv *env, jclass cls) { return H5S_SEL_NONE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SEL_1POINTS(JNIEnv *env, jclass cls) { return H5S_SEL_POINTS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1AND(JNIEnv *env, jclass cls) { return H5S_SELECT_AND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1APPEND(JNIEnv *env, jclass cls) { return H5S_SELECT_APPEND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1INVALID(JNIEnv *env, jclass cls) { return H5S_SELECT_INVALID; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1NOOP(JNIEnv *env, jclass cls) { return H5S_SELECT_NOOP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1NOTA(JNIEnv *env, jclass cls) { return H5S_SELECT_NOTA; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1NOTB(JNIEnv *env, jclass cls) { return H5S_SELECT_NOTB; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1OR(JNIEnv *env, jclass cls) { return H5S_SELECT_OR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1PREPEND(JNIEnv *env, jclass cls) { return H5S_SELECT_PREPEND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1SET(JNIEnv *env, jclass cls) { return H5S_SELECT_SET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1XOR(JNIEnv *env, jclass cls) { return H5S_SELECT_XOR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SIMPLE(JNIEnv *env, jclass cls) { return H5S_SIMPLE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1UNLIMITED(JNIEnv *env, jclass cls) { return (jint)H5S_UNLIMITED; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1B16(JNIEnv *env, jclass cls) { return H5T_ALPHA_B16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1B32(JNIEnv *env, jclass cls) { return H5T_ALPHA_B32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1B64(JNIEnv *env, jclass cls) { return H5T_ALPHA_B64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1B8(JNIEnv *env, jclass cls) { return H5T_ALPHA_B8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1F32(JNIEnv *env, jclass cls) { return H5T_ALPHA_F32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1F64(JNIEnv *env, jclass cls) { return H5T_ALPHA_F64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1I16(JNIEnv *env, jclass cls) { return H5T_ALPHA_I16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1I32(JNIEnv *env, jclass cls) { return H5T_ALPHA_I32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1I64(JNIEnv *env, jclass cls) { return H5T_ALPHA_I64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1I8(JNIEnv *env, jclass cls) { return H5T_ALPHA_I8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1U16(JNIEnv *env, jclass cls) { return H5T_ALPHA_U16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1U32(JNIEnv *env, jclass cls) { return H5T_ALPHA_U32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1U64(JNIEnv *env, jclass cls) { return H5T_ALPHA_U64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1U8(JNIEnv *env, jclass cls) { return H5T_ALPHA_U8; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ARRAY(JNIEnv *env, jclass cls) { return H5T_ARRAY; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1BITFIELD(JNIEnv *env, jclass cls) { return H5T_BITFIELD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1BKG_1NO(JNIEnv *env, jclass cls) { return H5T_BKG_NO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1BKG_1YES(JNIEnv *env, jclass cls) { return H5T_BKG_YES; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1C_1S1(JNIEnv *env, jclass cls) { return H5T_C_S1; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1COMPOUND(JNIEnv *env, jclass cls) { return H5T_COMPOUND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CONV_1CONV(JNIEnv *env, jclass cls) { return H5T_CONV_CONV; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CONV_1FREE(JNIEnv *env, jclass cls) { return H5T_CONV_FREE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CONV_1INIT(JNIEnv *env, jclass cls) { return H5T_CONV_INIT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1ERROR(JNIEnv *env, jclass cls) { return H5T_CSET_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1ASCII(JNIEnv *env, jclass cls) { return H5T_CSET_ASCII; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1UTF8(JNIEnv *env, jclass cls) { return H5T_CSET_UTF8; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_110(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_10; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_111(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_11; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_112(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_12; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_113(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_13; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_114(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_14; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_115(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_15; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_12(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_2; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_13(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_3; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_14(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_4; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_15(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_5; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_16(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_6; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_17(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_7; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_18(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_8; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_19(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_9; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1DIR_1ASCEND(JNIEnv *env, jclass cls) { return H5T_DIR_ASCEND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1DIR_1DEFAULT(JNIEnv *env, jclass cls) { return H5T_DIR_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1DIR_1DESCEND(JNIEnv *env, jclass cls) { return H5T_DIR_DESCEND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ENUM(JNIEnv *env, jclass cls) { return H5T_ENUM; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1FLOAT(JNIEnv *env, jclass cls) { return H5T_FLOAT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1FORTRAN_1S1(JNIEnv *env, jclass cls) { return H5T_FORTRAN_S1; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1IEEE_1F32BE(JNIEnv *env, jclass cls) { return H5T_IEEE_F32BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1IEEE_1F32LE(JNIEnv *env, jclass cls) { return H5T_IEEE_F32LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1IEEE_1F64BE(JNIEnv *env, jclass cls) { return H5T_IEEE_F64BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1IEEE_1F64LE(JNIEnv *env, jclass cls) { return H5T_IEEE_F64LE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEGER(JNIEnv *env, jclass cls) { return H5T_INTEGER; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1B16(JNIEnv *env, jclass cls) { return H5T_INTEL_B16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1B32(JNIEnv *env, jclass cls) { return H5T_INTEL_B32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1B64(JNIEnv *env, jclass cls) { return H5T_INTEL_B64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1B8(JNIEnv *env, jclass cls) { return H5T_INTEL_B8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1F32(JNIEnv *env, jclass cls) { return H5T_INTEL_F32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1F64(JNIEnv *env, jclass cls) { return H5T_INTEL_F64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1I16(JNIEnv *env, jclass cls) { return H5T_INTEL_I16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1I32(JNIEnv *env, jclass cls) { return H5T_INTEL_I32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1I64(JNIEnv *env, jclass cls) { return H5T_INTEL_I64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1I8(JNIEnv *env, jclass cls) { return H5T_INTEL_I8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1U16(JNIEnv *env, jclass cls) { return H5T_INTEL_U16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1U32(JNIEnv *env, jclass cls) { return H5T_INTEL_U32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1U64(JNIEnv *env, jclass cls) { return H5T_INTEL_U64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1U8(JNIEnv *env, jclass cls) { return H5T_INTEL_U8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1B16(JNIEnv *env, jclass cls) { return H5T_MIPS_B16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1B32(JNIEnv *env, jclass cls) { return H5T_MIPS_B32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1B64(JNIEnv *env, jclass cls) { return H5T_MIPS_B64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1B8(JNIEnv *env, jclass cls) { return H5T_MIPS_B8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1F32(JNIEnv *env, jclass cls) { return H5T_MIPS_F32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1F64(JNIEnv *env, jclass cls) { return H5T_MIPS_F64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1I16(JNIEnv *env, jclass cls) { return H5T_MIPS_I16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1I32(JNIEnv *env, jclass cls) { return H5T_MIPS_I32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1I64(JNIEnv *env, jclass cls) { return H5T_MIPS_I64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1I8(JNIEnv *env, jclass cls) { return H5T_MIPS_I8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1U16(JNIEnv *env, jclass cls) { return H5T_MIPS_U16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1U32(JNIEnv *env, jclass cls) { return H5T_MIPS_U32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1U64(JNIEnv *env, jclass cls) { return H5T_MIPS_U64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1U8(JNIEnv *env, jclass cls) { return H5T_MIPS_U8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1B16(JNIEnv *env, jclass cls) { return H5T_NATIVE_B16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1B32(JNIEnv *env, jclass cls) { return H5T_NATIVE_B32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1B64(JNIEnv *env, jclass cls) { return H5T_NATIVE_B64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1B8(JNIEnv *env, jclass cls) { return H5T_NATIVE_B8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1CHAR(JNIEnv *env, jclass cls) { return H5T_NATIVE_CHAR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1DOUBLE(JNIEnv *env, jclass cls) { return H5T_NATIVE_DOUBLE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1FLOAT(JNIEnv *env, jclass cls) { return H5T_NATIVE_FLOAT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1HADDR(JNIEnv *env, jclass cls) { return H5T_NATIVE_HADDR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1HBOOL(JNIEnv *env, jclass cls) { return H5T_NATIVE_HBOOL; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1HERR(JNIEnv *env, jclass cls) { return H5T_NATIVE_HERR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1HSIZE(JNIEnv *env, jclass cls) { return H5T_NATIVE_HSIZE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1HSSIZE(JNIEnv *env, jclass cls) { return H5T_NATIVE_HSSIZE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1FAST16(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_FAST16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1FAST32(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_FAST32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1FAST64(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_FAST64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1FAST8(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_FAST8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1LEAST16(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_LEAST16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1LEAST32(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_LEAST32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1LEAST64(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_LEAST64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1LEAST8(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_LEAST8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT16(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT32(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT64(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT8(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1LDOUBLE(JNIEnv *env, jclass cls) { return H5T_NATIVE_LDOUBLE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1LLONG(JNIEnv *env, jclass cls) { return H5T_NATIVE_LLONG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1LONG(JNIEnv *env, jclass cls) { return H5T_NATIVE_LONG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1OPAQUE(JNIEnv *env, jclass cls) { return H5T_NATIVE_OPAQUE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1SCHAR(JNIEnv *env, jclass cls) { return H5T_NATIVE_SCHAR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1SHORT(JNIEnv *env, jclass cls) { return H5T_NATIVE_SHORT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UCHAR(JNIEnv *env, jclass cls) { return H5T_NATIVE_UCHAR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1FAST16(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_FAST16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1FAST32(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_FAST32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1FAST64(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_FAST64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1FAST8(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_FAST8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1LEAST16(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_LEAST16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1LEAST32(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_LEAST32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1LEAST64(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_LEAST64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1LEAST8(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_LEAST8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT16(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT32(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT64(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT8(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1ULLONG(JNIEnv *env, jclass cls) { return H5T_NATIVE_ULLONG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1ULONG(JNIEnv *env, jclass cls) { return H5T_NATIVE_ULONG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1USHORT(JNIEnv *env, jclass cls) { return H5T_NATIVE_USHORT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NCLASSES(JNIEnv *env, jclass cls) { return H5T_NCLASSES; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NO_1CLASS(JNIEnv *env, jclass cls) { return H5T_NO_CLASS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NORM_1ERROR(JNIEnv *env, jclass cls) { return H5T_NORM_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NORM_1IMPLIED(JNIEnv *env, jclass cls) { return H5T_NORM_IMPLIED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NORM_1MSBSET(JNIEnv *env, jclass cls) { return H5T_NORM_MSBSET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NORM_1NONE(JNIEnv *env, jclass cls) { return H5T_NORM_NONE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NPAD(JNIEnv *env, jclass cls) { return H5T_NPAD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NSGN(JNIEnv *env, jclass cls) { return H5T_NSGN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1OPAQUE(JNIEnv *env, jclass cls) { return H5T_OPAQUE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1OPAQUE_1TAG_1MAX(JNIEnv *env, jclass cls) { return H5T_OPAQUE_TAG_MAX; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ORDER_1BE(JNIEnv *env, jclass cls) { return H5T_ORDER_BE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ORDER_1ERROR(JNIEnv *env, jclass cls) { return H5T_ORDER_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ORDER_1LE(JNIEnv *env, jclass cls) { return H5T_ORDER_LE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ORDER_1NONE(JNIEnv *env, jclass cls) { return H5T_ORDER_NONE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ORDER_1VAX(JNIEnv *env, jclass cls) { return H5T_ORDER_VAX; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PAD_1BACKGROUND(JNIEnv *env, jclass cls) { return H5T_PAD_BACKGROUND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PAD_1ERROR(JNIEnv *env, jclass cls) { return H5T_PAD_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PAD_1ONE(JNIEnv *env, jclass cls) { return H5T_PAD_ONE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PAD_1ZERO(JNIEnv *env, jclass cls) { return H5T_PAD_ZERO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PERS_1DONTCARE(JNIEnv *env, jclass cls) { return H5T_PERS_DONTCARE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PERS_1HARD(JNIEnv *env, jclass cls) { return H5T_PERS_HARD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PERS_1SOFT(JNIEnv *env, jclass cls) { return H5T_PERS_SOFT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1REFERENCE(JNIEnv *env, jclass cls) { return H5T_REFERENCE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1SGN_12(JNIEnv *env, jclass cls) { return H5T_SGN_2; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1SGN_1ERROR(JNIEnv *env, jclass cls) { return H5T_SGN_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1SGN_1NONE(JNIEnv *env, jclass cls) { return H5T_SGN_NONE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B16BE(JNIEnv *env, jclass cls) { return H5T_STD_B16BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B16LE(JNIEnv *env, jclass cls) { return H5T_STD_B16LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B32BE(JNIEnv *env, jclass cls) { return H5T_STD_B32BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B32LE(JNIEnv *env, jclass cls) { return H5T_STD_B32LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B64BE(JNIEnv *env, jclass cls) { return H5T_STD_B64BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B64LE(JNIEnv *env, jclass cls) { return H5T_STD_B64LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B8BE(JNIEnv *env, jclass cls) { return H5T_STD_B8BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B8LE(JNIEnv *env, jclass cls) { return H5T_STD_B8LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I16BE(JNIEnv *env, jclass cls) { return H5T_STD_I16BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I16LE(JNIEnv *env, jclass cls) { return H5T_STD_I16LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I32BE(JNIEnv *env, jclass cls) { return H5T_STD_I32BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I32LE(JNIEnv *env, jclass cls) { return H5T_STD_I32LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I64BE(JNIEnv *env, jclass cls) { return H5T_STD_I64BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I64LE(JNIEnv *env, jclass cls) { return H5T_STD_I64LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I8BE(JNIEnv *env, jclass cls) { return H5T_STD_I8BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I8LE(JNIEnv *env, jclass cls) { return H5T_STD_I8LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1REF_1DSETREG(JNIEnv *env, jclass cls) { return H5T_STD_REF_DSETREG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1REF_1OBJ(JNIEnv *env, jclass cls) { return H5T_STD_REF_OBJ; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U16BE(JNIEnv *env, jclass cls) { return H5T_STD_U16BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U16LE(JNIEnv *env, jclass cls) { return H5T_STD_U16LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U32BE(JNIEnv *env, jclass cls) { return H5T_STD_U32BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U32LE(JNIEnv *env, jclass cls) { return H5T_STD_U32LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U64BE(JNIEnv *env, jclass cls) { return H5T_STD_U64BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U64LE(JNIEnv *env, jclass cls) { return H5T_STD_U64LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U8BE(JNIEnv *env, jclass cls) { return H5T_STD_U8BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U8LE(JNIEnv *env, jclass cls) { return H5T_STD_U8LE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1ERROR(JNIEnv *env, jclass cls) { return H5T_STR_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1NULLPAD(JNIEnv *env, jclass cls) { return H5T_STR_NULLPAD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1NULLTERM(JNIEnv *env, jclass cls) { return H5T_STR_NULLTERM; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_110(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_10; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_111(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_11; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_112(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_12; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_113(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_13; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_114(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_14; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_115(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_15; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_13(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_3; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_14(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_4; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_15(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_5; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_16(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_6; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_17(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_7; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_18(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_8; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_19(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_9; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1SPACEPAD(JNIEnv *env, jclass cls) { return H5T_STR_SPACEPAD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STRING(JNIEnv *env, jclass cls) { return H5T_STRING; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1TIME(JNIEnv *env, jclass cls) { return H5T_TIME; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1UNIX_1D32BE(JNIEnv *env, jclass cls) { return H5T_UNIX_D32BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1UNIX_1D32LE(JNIEnv *env, jclass cls) { return H5T_UNIX_D32LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1UNIX_1D64BE(JNIEnv *env, jclass cls) { return H5T_UNIX_D64BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1UNIX_1D64LE(JNIEnv *env, jclass cls) { return H5T_UNIX_D64LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1VARIABLE(JNIEnv *env, jclass cls) { return (int)H5T_VARIABLE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1VLEN(JNIEnv *env, jclass cls) { return H5T_VLEN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1CB_1CONT(JNIEnv *env, jclass cls) { return H5Z_CB_CONT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1CB_1ERROR(JNIEnv *env, jclass cls) { return H5Z_CB_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1CB_1FAIL(JNIEnv *env, jclass cls) { return H5Z_CB_FAIL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1CB_1NO(JNIEnv *env, jclass cls) { return H5Z_CB_NO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1DISABLE_1EDC(JNIEnv *env, jclass cls) { return H5Z_DISABLE_EDC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1ENABLE_1EDC(JNIEnv *env, jclass cls) { return H5Z_ENABLE_EDC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1ERROR_1EDC(JNIEnv *env, jclass cls) { return H5Z_ERROR_EDC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1CONFIG_1DECODE_1ENABLED(JNIEnv *env, jclass cls) { return H5Z_FILTER_CONFIG_DECODE_ENABLED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1CONFIG_1ENCODE_1ENABLED(JNIEnv *env, jclass cls) { return H5Z_FILTER_CONFIG_ENCODE_ENABLED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1DEFLATE(JNIEnv *env, jclass cls) { return H5Z_FILTER_DEFLATE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1ERROR(JNIEnv *env, jclass cls) { return H5Z_FILTER_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1FLETCHER32(JNIEnv *env, jclass cls) { return H5Z_FILTER_FLETCHER32; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1MAX(JNIEnv *env, jclass cls) { return H5Z_FILTER_MAX; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1NBIT(JNIEnv *env, jclass cls) {return H5Z_FILTER_NBIT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1NONE(JNIEnv *env, jclass cls) { return H5Z_FILTER_NONE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1RESERVED(JNIEnv *env, jclass cls) { return H5Z_FILTER_RESERVED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1SCALEOFFSET(JNIEnv *env, jclass cls){ return H5Z_FILTER_SCALEOFFSET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1SHUFFLE(JNIEnv *env, jclass cls) { return H5Z_FILTER_SHUFFLE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1SZIP(JNIEnv *env, jclass cls) { return H5Z_FILTER_SZIP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FLAG_1DEFMASK(JNIEnv *env, jclass cls) { return H5Z_FLAG_DEFMASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FLAG_1INVMASK(JNIEnv *env, jclass cls) { return H5Z_FLAG_INVMASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FLAG_1MANDATORY(JNIEnv *env, jclass cls) { return H5Z_FLAG_MANDATORY; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FLAG_1OPTIONAL(JNIEnv *env, jclass cls) { return H5Z_FLAG_OPTIONAL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FLAG_1REVERSE(JNIEnv *env, jclass cls) { return H5Z_FLAG_REVERSE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FLAG_1SKIP_1EDC(JNIEnv *env, jclass cls) { return H5Z_FLAG_SKIP_EDC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1MAX_1NFILTERS(JNIEnv *env, jclass cls) { return H5Z_MAX_NFILTERS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1NO_1EDC(JNIEnv *env, jclass cls) { return H5Z_NO_EDC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SO_1INT_1MINBITS_1DEFAULT(JNIEnv *env, jclass cls) { return H5Z_SO_INT_MINBITS_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SO_1FLOAT_1DSCALE(JNIEnv *env, jclass cls){return H5Z_SO_FLOAT_DSCALE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SO_1FLOAT_1ESCALE(JNIEnv *env, jclass cls){return H5Z_SO_FLOAT_ESCALE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SO_1INT(JNIEnv *env, jclass cls){return H5Z_SO_INT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SHUFFLE_1USER_1NPARMS(JNIEnv *env, jclass cls) { return H5Z_SHUFFLE_USER_NPARMS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SHUFFLE_1TOTAL_1NPARMS(JNIEnv *env, jclass cls) { return H5Z_SHUFFLE_TOTAL_NPARMS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SZIP_1USER_1NPARMS(JNIEnv *env, jclass cls) { return H5Z_SZIP_USER_NPARMS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SZIP_1TOTAL_1NPARMS(JNIEnv *env, jclass cls) { return H5Z_SZIP_TOTAL_NPARMS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SZIP_1PARM_1MASK(JNIEnv *env, jclass cls) { return H5Z_SZIP_PARM_MASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SZIP_1PARM_1PPB(JNIEnv *env, jclass cls) { return H5Z_SZIP_PARM_PPB; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SZIP_1PARM_1BPP(JNIEnv *env, jclass cls) { return H5Z_SZIP_PARM_BPP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SZIP_1PARM_1PPS(JNIEnv *env, jclass cls) { return H5Z_SZIP_PARM_PPS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1NBIT_1USER_1NPARMS(JNIEnv *env, jclass cls) { return H5Z_NBIT_USER_NPARMS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SCALEOFFSET_1USER_1NPARMS(JNIEnv *env, jclass cls) { return H5Z_SCALEOFFSET_USER_NPARMS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1ALL(JNIEnv *env, jclass cls) { return H5Z_FILTER_ALL; } #pragma GCC diagnostic pop diff --git a/java/src/jni/h5dImp.h b/java/src/jni/h5dImp.h index 2a91334..eb26265 100644 --- a/java/src/jni/h5dImp.h +++ b/java/src/jni/h5dImp.h @@ -353,7 +353,7 @@ Java_hdf_hdf5lib_H5_H5Diterate * Method: H5Dflush * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Dflush (JNIEnv*, jclass, jlong); @@ -362,7 +362,7 @@ Java_hdf_hdf5lib_H5_H5Dflush * Method: H5Drefresh * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Drefresh (JNIEnv*, jclass, jlong); diff --git a/java/src/jni/h5fImp.h b/java/src/jni/h5fImp.h index 7aff835..396df65 100644 --- a/java/src/jni/h5fImp.h +++ b/java/src/jni/h5fImp.h @@ -217,7 +217,7 @@ Java_hdf_hdf5lib_H5_H5Fclear_1elink_1file_1cache * Method: H5Fstart_swmr_write * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Fstart_1swmr_1write (JNIEnv *, jclass, jlong); @@ -226,7 +226,7 @@ Java_hdf_hdf5lib_H5_H5Fstart_1swmr_1write * Method: H5Fstart_mdc_logging * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Fstart_1mdc_1logging (JNIEnv *, jclass, jlong); @@ -235,7 +235,7 @@ Java_hdf_hdf5lib_H5_H5Fstart_1mdc_1logging * Method: H5Fstop_mdc_logging * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Fstop_1mdc_1logging (JNIEnv *, jclass, jlong); @@ -244,7 +244,7 @@ Java_hdf_hdf5lib_H5_H5Fstop_1mdc_1logging * Method: H5Fget_mdc_logging_status * Signature: (J[Z)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Fget_1mdc_1logging_1status (JNIEnv *, jclass, jlong, jbooleanArray); diff --git a/java/src/jni/h5gImp.h b/java/src/jni/h5gImp.h index 3113689..dce1247 100644 --- a/java/src/jni/h5gImp.h +++ b/java/src/jni/h5gImp.h @@ -102,7 +102,7 @@ Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx * Method: H5Gflush * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Gflush (JNIEnv*, jclass, jlong); @@ -111,7 +111,7 @@ Java_hdf_hdf5lib_H5_H5Gflush * Method: H5Grefresh * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Grefresh (JNIEnv*, jclass, jlong); diff --git a/java/src/jni/h5oImp.h b/java/src/jni/h5oImp.h index 293dc2e..5d07c29 100644 --- a/java/src/jni/h5oImp.h +++ b/java/src/jni/h5oImp.h @@ -191,7 +191,7 @@ Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx * Method: H5Oflush * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Oflush (JNIEnv*, jclass, jlong); @@ -200,7 +200,7 @@ Java_hdf_hdf5lib_H5_H5Oflush * Method: H5Orefresh * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Orefresh (JNIEnv*, jclass, jlong); diff --git a/java/src/jni/h5tImp.h b/java/src/jni/h5tImp.h index e614082..417d231 100644 --- a/java/src/jni/h5tImp.h +++ b/java/src/jni/h5tImp.h @@ -613,7 +613,7 @@ Java_hdf_hdf5lib_H5_H5Tconvert * Method: H5Tflush * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Tflush (JNIEnv*, jclass, jlong); @@ -622,7 +622,7 @@ Java_hdf_hdf5lib_H5_H5Tflush * Method: H5Trefresh * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Trefresh (JNIEnv*, jclass, jlong); diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index b3a996b..8912b3f 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_JAVA_TEST Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -70,31 +70,31 @@ set (HDF_JAVA_TEST_FILES foreach (h5_file ${HDF_JAVA_TEST_FILES}) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "${HDF5_JAVA_TEST_LIB_TARGET}_files") -endforeach (h5_file ${HDF_JAVA_TEST_FILES}) +endforeach () HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/h5ex_g_iterate.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_files") add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_files_list}) if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") -else (WIN32) +else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") -endif (WIN32) +endif () set (CMAKE_JAVA_CLASSPATH ".") foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") -endforeach (CMAKE_INCLUDE_PATH) +endforeach () set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${HDF5_JAVA_TEST_LIB_TARGET}_JAR_FILE}") set (testfilter "OK (598 tests)") if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else() + else () set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif() -endif(CMAKE_BUILD_TYPE MATCHES Debug) + endif () +endif () add_test ( NAME JUnit-interface-clearall-objects diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index 7fd80f8..34ec02a 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -530,6 +530,7 @@ JUnit version 4.11 .testH5Pvirtual_storage .testH5Pget_selection_source_dataset .testH5Pget_source_filename +.testH5Pset_get_virtual_printf_gap .testH5Pget_virtual_count .testH5Pset_get_virtual_view .testH5Pget_mapping_parameters @@ -637,7 +638,7 @@ JUnit version 4.11 Time: XXXX -OK (635 tests) +OK (636 tests) HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Fopen(): can't set access and transfer property lists diff --git a/java/test/TestH5Ocopy.java b/java/test/TestH5Ocopy.java index 62dd886..cf0fb1f 100644 --- a/java/test/TestH5Ocopy.java +++ b/java/test/TestH5Ocopy.java @@ -239,6 +239,7 @@ public class TestH5Ocopy { try {H5.H5Pclose(ocp_plist_id);} catch (Exception ex) {} try {H5.H5Fclose(H5fid2);} catch (Exception ex) {} } + _deleteFile("copy.h5"); } @Test diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java index 9372ae1..15fbd03 100644 --- a/java/test/TestH5Pvirtual.java +++ b/java/test/TestH5Pvirtual.java @@ -220,6 +220,7 @@ public class TestH5Pvirtual { try {H5.H5Dclose(H5did);} catch (Exception ex) {} } assertTrue("testH5Pget_virtual_count: "+num_map, num_map >= 0); + assertEquals(3, num_map); } @Test @@ -406,7 +407,7 @@ public class TestH5Pvirtual { } } - @Ignore + @Test public void testH5Pset_get_virtual_printf_gap() { long ret_val = -1; H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id); @@ -415,7 +416,7 @@ public class TestH5Pvirtual { assertTrue("H5Pget_virtual_printf_gap", ret_val >= 0); assertEquals(0, ret_val); H5.H5Pset_virtual_printf_gap(H5dapl_id, 2); - ret_val = H5.H5Pget_virtual_view(H5dapl_id); + ret_val = H5.H5Pget_virtual_printf_gap(H5dapl_id); assertTrue("H5Pget_virtual_printf_gap", ret_val >= 0); assertEquals(2, ret_val); } diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index a9a71cb..31037ba 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -183,7 +183,16 @@ CLEAN_DATAFILES_AND_BLDDIR() $RM $BLDDIR/JUnit-interface.out $RM $BLDDIR/JUnit-interface.err $RM $BLDDIR/JUnit-interface.ext + # skip rm if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $RM $BLDDIR/JUnit-interface.ert $RM $BLDDIR/JUnit-interface.txt + fi } # Print a line-line message left justified in a field of 70 characters diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index ee331a8..70ec47f 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -30,7 +30,7 @@ Obtaining HDF5 source code CMake version 1. We suggest you obtain the latest CMake from the Kitware web site. - The HDF5 1.10."X" product requires a minimum CMake version 3.1.0, + The HDF5 1.10."X" product requires a minimum CMake version 3.2.2, where "X" is the current HDF5 release version. Note: @@ -51,7 +51,7 @@ The following files referenced below are available at the HDF web site: http://www.hdfgroup.org/HDF5/release/cmakebuild.html Single compressed file with all the files needed, including source: - hdf5-1.10.0-CMake.zip or hdf5-1.10.0-CMake.tar.gz + hdf5-1.10.X-CMake.zip or hdf5-1.10.X-CMake.tar.gz Individual files ----------------------------------------------- @@ -249,7 +249,7 @@ IV. Further considerations ======================================================================== 1. We suggest you obtain the latest CMake for windows from the Kitware - web site. The HDF5 1.10."X" product requires a minimum CMake version 3.1.0. + web site. The HDF5 1.10."X" product requires a minimum CMake version 3.2.2. 2. If you plan to use Zlib or Szip: A. Download the binary packages and install them in a central location. @@ -263,10 +263,10 @@ IV. Further considerations B. Use source packages from an SVN server by adding the following CMake options: - HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" - ZLIB_SVN_URL:STRING="http://some_location/zlib/trunk" - SZIP_SVN_URL:STRING="http://some_location/szip/trunk" - where "some_location" is the URL to the SVN repository. Also set + HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="GIT" + ZLIB_GIT_URL:STRING="http://some_location/zlib" + SZIP_GIT_URL:STRING="http://some_location/szip" + where "some_location" is the URL to the GIT repository. Also set CMAKE_BUILD_TYPE to the configuration type. C. Use source packages from a compressed file by adding the following @@ -376,10 +376,10 @@ These five steps are described in detail below. * MinGW Makefiles * NMake Makefiles * Unix Makefiles - * Visual Studio 12 2013 - * Visual Studio 12 2013 Win64 * Visual Studio 11 2012 * Visual Studio 11 2012 Win64 + * Visual Studio 12 2013 + * Visual Studio 12 2013 Win64 * Visual Studio 14 2015 * Visual Studio 14 2015 Win64 @@ -396,6 +396,7 @@ These five steps are described in detail below. # EXTERNAL cache entries ######################## set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) + set (HDF5_GENERATE_HEADERS ON CACHE BOOL "Rebuild Generated Files" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) @@ -403,7 +404,7 @@ These five steps are described in detail below. set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) set (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) - set (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) + set (ALLOW_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) set (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) set (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) set (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) @@ -413,14 +414,16 @@ These five steps are described in detail below. set (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) set (HDF5_MEMORY_ALLOC_SANITY_CHECK OFF CACHE BOOL "Indicate that internal memory allocation sanity checks are enabled" FORCE) set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) + set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) + set (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) set (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" FORCE) set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) - set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE) - set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO SVN TGZ) + set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT SVN TGZ)" FORCE) + set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT SVN TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) @@ -477,15 +480,15 @@ These five steps are described in detail below. Release and build the solution. 3.2.1 The external libraries (zlib and szip) can be configured - to allow building the libraries by downloading from an SVN repository. + to allow building the libraries by downloading from an GIT repository. The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT'; by adding the following configuration option: - -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" + -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="GIT" - The options to control the SVN URL (config/cmake/cacheinit.cmake file) are: - ZLIB_SVN_URL:STRING="http://${svn_url}/zlib/trunk" - SZIP_SVN_URL:STRING="http://${svn_url}/szip/trunk" - ${svn_url} should be changed to your location. Also define CMAKE_BUILD_TYPE + The options to control the GIT URL (config/cmake/cacheinit.cmake file) are: + ZLIB_GIT_URL:STRING="http://${git_url}/zlib" + SZIP_GIT_URL:STRING="http://${git_url}/szip" + ${git_url} should be changed to your location. Also define CMAKE_BUILD_TYPE to be the configuration type. 3.2.2 Or the external libraries (zlib and szip) can be configured @@ -525,8 +528,8 @@ These five steps are described in detail below. NOTE: See note 8 of this document for NSIS information. See note 9 of this document for WiX information. - Also, if you are using a Visual Studio Express version or do not - want to enable the packaging components, set HDF5_NO_PACKAGES + Also, if you are using a Visual Studio Express version or + want to disable the packaging components, set HDF5_NO_PACKAGES to ON (on the command line add -DHDF5_NO_PACKAGES:BOOL=ON) 6. The files that support building HDF5 with CMake are all the files in the @@ -563,7 +566,7 @@ The config/cmake/cacheinit.cmake file can override the following values. ---------------- General Build Options --------------------- BUILD_SHARED_LIBS "Build Shared Libraries" ON -BUILD_STATIC_EXECS "Build Static Executabless" OFF +BUILD_STATIC_EXECS "Build Static Executables" OFF BUILD_TESTING "Build HDF5 Unit Testing" ON ---------------- HDF5 Build Options --------------------- @@ -624,9 +627,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT) HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF if (WINDOWS) H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin" -else (WINDOWS) +else () H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin" -endif (WINDOWS) +endif () @@ -647,9 +650,9 @@ build and test process. VIII. Options for Platform Configuration Files ======================================================================== -Below is the HDF5config.cmake ctest script with extra comments. +Below is the HDF5config.cmake and HDF5options.cmake ctest scripts. Execute: - ctest -S HDF5config.cmake,BUILD_GENERATOR=xxx -C Release -V -O hdf5.log + ctest -S HDF5config.cmake,BUILD_GENERATOR=xxx -C Release -VV -O hdf5.log The same scripts can be used on Linux, Mac OSX or a Windows machine by adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. @@ -657,10 +660,10 @@ adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. ############################################################################################# ### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### ### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ### -### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf5.log ### +### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -VV -O hdf5.log ### ############################################################################################# -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################ # Usage: # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log @@ -677,22 +680,22 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) # INSTALLDIR - root folder where hdf5 is installed # CTEST_CONFIGURATION_TYPE - Release, Debug, etc # CTEST_SOURCE_NAME - source folder -# STATIC_LIBRARIES - Build/use static libraries +# STATIC_ONLY - Build/use static libraries # FORTRAN_LIBRARIES - Build/use fortran libraries # JAVA_LIBRARIES - Build/use java libraries # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## -set(CTEST_SOURCE_VERSION 1.10.0) -set(CTEST_SOURCE_VERSEXT "-pre1") +set(CTEST_SOURCE_VERSION 1.10.1) +set(CTEST_SOURCE_VERSEXT "") ############################################################################## # handle input parameters to script. #BUILD_GENERATOR - which CMake generator to use, required #INSTALLDIR - HDF5-1.10.0 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo -#CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0 -#STATIC_LIBRARIES - Default is YES +#CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.1 +#STATIC_ONLY - Default is YES #FORTRAN_LIBRARIES - Default is NO #JAVA_LIBRARIES - Default is NO #NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac @@ -704,14 +707,14 @@ if(DEFINED CTEST_SCRIPT_ARG) foreach(current_var ${script_args}) if ("${current_var}" MATCHES "^([^=]+)=(.+)$") set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif() - endforeach() -endif() + endif () + endforeach () +endif () # build generator must be defined if(NOT DEFINED BUILD_GENERATOR) message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") -else() +else () if(${BUILD_GENERATOR} STREQUAL "Unix") set(CTEST_CMAKE_GENERATOR "Unix Makefiles") elseif(${BUILD_GENERATOR} STREQUAL "VS2015") @@ -726,49 +729,54 @@ else() set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") elseif(${BUILD_GENERATOR} STREQUAL "VS201264") set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - else() + else () message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") - endif() -endif() + endif () +endif () + +################################################################### +### Following Line is one of [Release, RelWithDebInfo, Debug] ##### +set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") +################################################################### if(NOT DEFINED INSTALLDIR) if(WIN32) - set(INSTALLDIR "C:\\Program\ Files\\myhdf5") - else() - set(INSTALLDIR "/usr/local/myhdf5") - endif() -endif() + set(INSTALLDIR "C:/Program Files/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") + else () + set(INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") + endif () +endif () if(NOT DEFINED CTEST_CONFIGURATION_TYPE) set(CTEST_CONFIGURATION_TYPE "Release") -endif() +endif () if(NOT DEFINED CTEST_SOURCE_NAME) set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") -endif() -if(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "YES") -else() - set(STATICLIBRARIES "NO") -endif() +endif () +if(NOT DEFINED STATIC_ONLY) + set(STATICONLYLIBRARIES "YES") +else () + set(STATICONLYLIBRARIES "NO") +endif () if(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "NO") -else() +else () set(FORTRANLIBRARIES "YES") -endif() +endif () if(NOT DEFINED JAVA_LIBRARIES) set(JAVALIBRARIES "NO") -else() +else () set(JAVALIBRARIES "YES") -endif() +endif () set(CTEST_BINARY_NAME "build") set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") if(WIN32) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else() +else () set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif() +endif () ################################################################### ######### Following describes compiler ############ @@ -799,17 +807,33 @@ if(WIN32) set(SITE_OS_BITS "32") set(SITE_COMPILER_NAME "vs2012") set(SITE_COMPILER_VERSION "11") - endif() + endif () ## Set the following to unique id your computer ## set(CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") -else() +else () + set(CTEST_CMAKE_GENERATOR "Unix Makefiles") ## Set the following to unique id your computer ## if(APPLE) set(CTEST_SITE "MAC.XXXX") - else() + else () set(CTEST_SITE "LINUX.XXXX") - endif() -endif() + endif () + if(APPLE) + execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set(ENV{CC} "${XCODE_CC}") + set(ENV{CXX} "${XCODE_CXX}") + set(CTEST_USE_LAUNCHERS 1) + set(RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") + set(RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") + set(RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") + set(RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") + set(RR_FLAGS_C "${RR_FLAGS_COMMON}") + set(RR_FLAGS_CXX "${RR_FLAGS_COMMON}") + set(ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") + set(ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") + endif () +endif () ################################################################### ################################################################### @@ -829,106 +853,128 @@ set(MODEL "Experimental") #set(LOCAL_NO_PACKAGE "TRUE") ##### Following controls source update ##### #set(LOCAL_UPDATE "TRUE") -set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/trunk") +set(REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") +set(REPOSITORY_BRANCH "develop") + #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows #set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") ################################################################### ################################################################### -#### Change default configuration of options in config/cmake/cacheinit.cmake file ### -#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") - -################################################################### -if(${STATICLIBRARIES}) +if(${STATICONLYLIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") ######### Following describes computer ############ ## following is optional to describe build ## set(SITE_BUILDNAME_SUFFIX "STATIC") -endif() +endif () +################################################################### +#### fortran #### +if(${FORTRANLIBRARIES}) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") + ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") +else () + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") +endif () +#### java #### +if(${JAVALIBRARIES}) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") +else () + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") +endif () + +### change install prefix +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}") + ################################################################### +if(WIN32) + set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}") + include(${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake) + include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe") + file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi") + file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip") + file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () +else () + set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") + include(${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake) + include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) + if(APPLE) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + else () + if(CYGWIN) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + else () + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif () + endif () + endif () +endif () + +HDF5options.cmake: +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +############################################################################################# + ### uncomment/comment and change the following lines for other configuration options +############################################################################################# #### ext libraries #### + ### ext libs from tgz set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}") -### ext libs from svn -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=SVN") +### ext libs from git +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=GIT") ### ext libs on system #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") -### disable ext libs building + +### disable ext zlib building #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") +### disable ext szip building #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") -#### fortran #### -if(${FORTRANLIBRARIES}) - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") -else() - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") -endif() -#### java #### -if(${JAVALIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") -else() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") -endif() +############################################################################################# ### disable test program builds + #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") +############################################################################################# ### disable packaging + #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") ### Create install package with external libraries (szip, zlib, jpeg) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") -### change install prefix -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") - -################################################################### - -if(WIN32) - include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() -else() - include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) - if(APPLE) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - else() - if(CYGWIN) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - else() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - endif() - endif() -endif() - +############################################################################################# ======================================================================== For further assistance, send email to help@hdfgroup.org diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index cc77fcb..fdae007 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -4,21 +4,34 @@ HDF5 version 1.9.236 currently under development INTRODUCTION -This document describes the differences between HDF5-1.9.0 and -HDF5 1.9.x snapshot, and contains information on the platforms -tested and known problems in HDF5-1.9.x. +This document describes the differences between HDF5-1.10.0-patch1 and +HDF5 1.10.1, and contains information on the platforms tested and known problems in HDF5-1.10.1. For more details check the HISTORY*.txt files in the HDF5 source. -Links to HDF5 1.9.x source code can be found on The HDF Group's -development FTP server at the following location: - ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/hdf5/snapshots +Links to HDF5 1.10.1 source code, documentation, and additional materials can be found on The HDF5 web page at: + + https://support.hdfgroup.org/HDF5/ + +The HDF5 1.10.1 release can be obtained from: + + https://support.hdfgroup.org/HDF5/release/obtain5110.html + User documentation for the snapshot can be accessed directly at this location: - http://www.hdfgroup.uiuc.edu/HDF5/doc_dev_snapshot/H5_dev/ -For more information, see the HDF5 home page: + https://support.hdfgroup.org/HDF5/doc1.10/ + +New features in the HDF5-1.10.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.10.1?" document: + + https://support.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew1101.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.19 (current +release) versus Release 1.10.1 - http://www.hdfgroup.org/HDF5/ + https://support.hdfgroup.org/HDF5/doc1.10/ADGuide/Changes.html If you have any questions or comments, please send them to the HDF Help Desk: @@ -29,7 +42,7 @@ CONTENTS - New Features - Support for new platforms and languages -- Bug Fixes since HDF5-1.8.0 +- Bug Fixes since HDF5-1.10.0-patch1 - Supported Platforms - Tested Configuration Features Summary - More Tested Platforms @@ -41,1196 +54,77 @@ New Features Configuration: ------------- - - CMake - Added NAMESPACE hdf5:: to package configuration files - - CMake: change CTEST_BUILD_CONFIGURATION to CTEST_CONFIGURATION_TYPE, which is - recommended by CMake documentation. - HDFFV-9971 (ADB 2016/8/22) - - Java JNI library API wrappers and supporting files added as HDF_JAVA language - option. Both configure and CMake disable this option by default. - HDFFV-9552 (ADB 2016/02/28) - - CMake minimum is now 3.1.0. (ADB 2015/11/14) - - cmakehdf5: configure options added to enable or disable the building of - different API's and testings. See "cmakehdf5 --help" for details. - (AKC - 2014/12/09 HDFFV-8932) - - Autotools: Automake updated to 1.14.1 (ADB - 2014/04/08) - - CMake: Moved minimum CMake version to 2.8.11 which enables better library - include processing. (ADB - 2014/03/26) - - New configuration option added to change the default plugin path. - configure option is --with-default-plugin=location - cmake option is -DH5_DEFAULT_PLUGINDIR:PATH=location - HDFFV-8513. (ADB 2013/09/04) - - Rename FFLAGS to FCFLAGS in configure (ADB 2013/08/13) - - CMake minimum is now 2.8.10. (ADB 2013/01/14) - - A new tool, cmakehdf5, which is a build command script similar to - buildhdf5 is added and is available in the bin directory. - (AKC - 2012/12/12) - - Fixed AIX Fortran compiler flags to use appropriate settings for - debugging, profiling, optimization situations. HDFFV-8069. (AKC - 2012/09/27) - - Updated to latest autotools and changed all hard *.sh scripts to - configure managed *.sh.in files. Removed overloading of autotools - TESTS variable by examples and tests. Renamed configure.in to - configure.ac. (ADB - 2012/08/23 - HDFFV-8129) - - Added code to display the version information of XL fortran and C++ - in the summary of configure. (AKC - 2012/02/28 - HDFFV-7793) - - Configure now generates Makefiles that build in "silent make mode" - by default in which compile and link lines are significantly - simplified for clarity. To override this and view actual compile and - link lines during building, the --disable-silent-rules flag can be used - at configure time, or the 'make' command can be followed by V=1, to - indicate a "verbose" make. (MAM - 2011/4/14). - - Added mpicc and mpif90 as the default C and Fortran compilers for Linux - systems when --enable-parallel is specified but no $CC or $FC is defined. - (AKC - 2011/2/7) - - Added a new configure option, "--enable-unsupported", which can - be used to stop configure from preventing the use of unsupported - configure option combinations, such as c++ in parallel or parallel - HDF5 with threadsafe. Use at your own risk, as it may result in a - library that won't compile or run as expected! - (MAM - 2010/11/17 - Bug 2061) - - PHDF5 changed to use "mpiexec", instead of mpirun, as the default MPI - applications startup command as defined in the MPI-2 definition, section - 4.1. (AKC - 2010/6/11 - Bug 1921) - - Configure now adds appropriate defines for supporting large (64-bit) - files on all systems, where supported, by default, instead of only linux. - This largefile support is controllable with the --enable-largefile - configure option. This is replacing the linux-specific --enable-linux-lfs - option, which has been removed from configure. - (MAM - 2010/05/05 - 1772/1434) - - Upgraded versions of autotools used to generate configuration suite. - We now use Automake 1.11.1, Autoconf 2.65, and Libtool 2.2.6b. - MAM 2010/04/15. - - Added the xlc-* and mpcc_r-* BASENAME patterns to be recognized as IBM - compilers so that the ibm compiler options can be added properly. This - allows non-system-default compiler command names (e.g. xlc-m.n.k.l) be - recognized. AKC 2009/11/26. - - Configuration suite now uses Automake 1.11 and Autoconf 2.64. - MAM 2009/08/11. - - Changed default Gnu fortran compiler from g95 to gfortran since - gfortran is more likely installed with gcc now. -AKC 2009/07/19- - - Added libtool version numbers to generated c++, fortran, and - hl libraries. MAM 2009/04/19. - - Regenerated Makefile.ins using Automake 1.10.2. MAM 2009/04/19. - - Added a Make target of check-all-install to test the correctness of - installing via the prefix= or $DESTDIR options. AKC - 2009/04/14 - - Configuration suite now uses Libtool 2.2.6a. MAM 2008/10/24 - - - Configuration suite now uses Autoconf 2.61, Automake 1.10.1. - MAM 2008/05/05. - - - The new configure option "--disable-sharedlib-rpath" disables - embedding the '-Wl,-rpath' information into executables when - shared libraries are produced, and instead solely relies on the - information in LD_LIBRARY_PATH. (MAM - 2008/05/15) + - CMake minimum is now 3.2.2. (ADB 2016/01/10) + Library: -------- - - Java API added new H5Iget_name that returns a string. - The old function, now deprecated, would cause a memory leak and - not return a proper String value. - HDFFV-9972 (ADB 2016/8/22) - - Add support to expand the plugin path value on Windows when the path - includes an environment variable. - HDFFV-9706 (ADB 2016/8/22) - - - H5F_ACC_DEBUG labeled "deprecated" - - The symbol was originally used to emit some extra debugging - informationi in the multi VFD. The underlying functionality - was removed due to disuse in HDF5 1.8.16 though the symbol - remained defined since it was visible in H5Fpublic.h. - - In this release, the symbol has been labeled deprecated and will - not be defined when H5_NO_DEPRECATED_SYMBOLS is defined. - - (DER - 2015-04-30, HDFFV-1074) - - - The library can load filter libraries dynamically during runtime. Users - can set the search path through environment variable HDF5_PLUGIN_PATH - and call H5Pset_filter to enable a dynamic filter. (SLU - 2013/04/08) - - Added new API functions H5Dscatter and H5Dgather to scatter data to and - and gather data from a selection within a memory buffer. - (NAF - 2013/02/05) - - The library now supports the data conversion from enumeration to numeric - (integer and floating-point number) datatypes. See Issue 8221. - (SLU - 2012/10/23) - - The data sieve buffer size was for all the datasets in the file. It - could waste memory if any dataset size is smaller than the sieve buffer - size. Now the library picks the smaller one between the dataset size - and the sieve buffer size from the file access property. See Issue 7934. - (SLU - 2012/4/2) - - I added a new parameter of object access property list to the function - H5Rdereference (Issue 2763). It's called H5Rdereference2 now. The former - H5Rdereference function has been deprecated to H5Rdereference1. (SLU - - 2011/7/18) - - H5Tcreate now supports string type (fixed-length and variable-length). - (SLU - 2011/05/20) - - Added ability to cache files opened through external links. Added new - public functions H5Pset_elink_file_cache_size(), - H5Pget_elink_file_cache_size(), and H5Fclear_elink_file_cache(). - (NAF - 2011/02/17) - - Removed all old code for Metraowerks compilers, bracketed by - __MWERKS__). Metraowerks compiler is long gone. (AKC - 2010/11/17) - - Added support for threadsafety on windows using the windows threads - library. Use the HDF5_ENABLE_THREADSAFE option in CMake while on a - windows platform to enable this functionality. This is supported on - Windows Vista and newer Windows operating systems. (MAM - 2010/09/10) - - When a mandatory filter failed to write data chunks, the dataset - couldn't close (bug 1260). The fix releases all resources and closes - the dataset but returns a failure. (SLU - 2010/9/8) - - H5Tset_order and H5Tget_order now support all data types. A new byte - order H5T_ORDER_MIXED has been added specifically for compound datatype - and its derived type. Please see bug #1934. (SLU - 2010/8/23) - - Improved performance of the chunk cache by avoiding unnecessary b-tree - lookups of chunks already in cache. (NAF - 2010/06/15) - - Greatly improved performance of extending a dataset with early - allocation. (NAF - 2010/03/24 - 1637) - - Added support for filtering densely stored groups. Many of the API - functions related to filters have been extended to support dense groups - as well as datasets. Pipeline messages can now be stored in a group's - object header. (NAF/QAK - 2009/10/8) - - The embedded library information is displayed by H5check_version() if a - version mismatch is detected. Also changed H5check_version() to - suppress the warning message totally if $HDF5_DISABLE_VERSION_CHECK is 2 - or higher. (Old behavior treated 3 or higher the same as 1, that is - print a warning and allows the program to continue. (AKC - 2009/9/28) - - If a user does not care for the extra library information insert - in the executables, he may turn it off by --disable-embedded-libinfo - during configure. (AKC - 2009/9/15) - - Corrected problem where library would re-write the superblock in a file - opened for R/W access, even when no changes were made to the file. - (QAK - 2009/08/20, Bz#1473) - - Separated "factory" free list class from block free lists. These free - lists are dynamically created and manage blocks of a fixed size. - H5set_free_list_limits() will use the same settings specified for block - free lists for factory free lists. (NAF - 2009/04/08) - - Added support for dense attributes to H5Ocopy. (XCao/NAF - 2009/01/29) - - Added H5Pset_elink_cb and H5Pget_elink_cb functions to support a - user-defined callback function for external link traversal. - (NAF - 2009/01/08) - - Added H5Pset_elink_acc_flags and H5Pget_elink_acc_flags functions to - allow the user to specify the file access flags used to open the target - file of an external link. (NAF - 2009/01/08) - - Added H5Pset_chunk_cache() and H5Pget_chunk_cache() functions to allow - individual rdcc configuration for each dataset. Added - H5Dget_access_plist() function to retrieve a dataset access property - list from a dataset. (NAF - 2008/11/12) - - Added H5Iis_valid() function to check if an id is valid without producing - an error message. (NAF - 2008/11/5) - - Added two new public routines: H5Pget_elink_fapl() and - H5Pset_elink_fapl(). (see bug #1247) (VC - 2008/10/13) - - Improved free space tracking in file to be faster. (QAK - 2008/10/06) - - Added 'mounted' field to H5G_info_t struct. (QAK - 2008/07/15) + - Parallel Library: ----------------- - - Add H5Pget_mpio_no_collective_cause() function that retrive reasons - why the collective I/O was broken during read/write IO access. - (JKM - 2012/08/30 HDFFV-8143) - - Special Collective IO (IO when some processes do not contribute to the - IO) and Complex Derived Datatype MPI functionalities are no longer - conditionally enabled in the library by configure. They are always - enabled in order to take advantage of performance boosts from these - behaviors. Older MPI implementations that do not allow for these - functionalities can no longer by used by HDF5. (MAM - 2011/07/08). - - Modified parallel tests to run with arbitrary number of processes. The - modified tests are testphdf5 (parallel dataset access), t_chunk_alloc - (chunk allocation), and t_posix_compliant (posix compliance). The rest of - the parallel tests already use in the code the number of processes - available in the communicator. (CMC - 2009/04/28) + - Fortran Library: ---------------- - - - Added parallel routine H5Pget_mpio_actual_io_mode_f (MSB - 2012/09/27) - - - Added for the C API the Fortran wrapper: - h5ocopy_f (MSB - 2012/03/22) - - - HDF5 Fortran library was enhanced to support Fortran 2003 standard. - The following features are available when the HDF5 library is configured - using --enable-fortran --enable-fortran2003 configure flags AND - if fortran compiler is Fortran2003 compliant: - - - Subroutines overloaded with the C_PTR derived type: - h5pget_f - h5pget_fill_value_f - h5pinsert_f - h5pregister_f - h5pset_f - h5pset_fill_value_f - h5rcreate_f - h5rderefrence_f - h5rget_name_f - h5rget_obj_type_f - - Subroutines overloaded with the C_PTR derived type - and simplified signatures: - h5aread_f - h5awrite_f - h5dread_f - h5dwrite_f - - New subroutines - h5dvlen_reclaim_f - h5literate_by_name_f - h5literate_f - h5ovisit_f - h5tconvert_f - - - Subroutines with additional optional parameters: - h5pcreate_class_f - (EIP - 2011/10/14) - - - Added for the C APIs the Fortran wrappers: - h5dget_access_plist_f - h5iis_valid_f - h5pset_chunk_cache_f - h5pget_chunk_cache_f - (MSB - 2009/04/17) - - + - C++ Library: ------------ - - New member function added - - The assignment operator ArrayType::operator= is added because ArrayType - has pointer data members. - - (BMR, 2016/03/07, HDFFV-9562) - - - New member functions - + Overloaded CommonFG::getObjnameByIdx to take char* for name - + Overloaded CommonFG::getObjTypeByIdx to return type name as a char*. - (BMR - 2010/05/02) - + DataSet::getInMemDataSize() to simplify getting the dataset's - data size in memory. (BMR - 2009/07/26) - - These member functions were added as wrapper for H5Rdereference to - replace the incorrect IdComponent::dereference(). - void H5Object::dereference(H5File& h5file, void* ref) - void H5Object::dereference(H5Object& obj, void* ref) - In addition, these constructors were added to create the associated - objects by way of dereference: - Attribute(H5Object& obj, void* ref); - Attribute(H5File& file, void* ref); - DataSet(H5Object& obj, void* ref); - DataSet(H5File& file, void* ref); - DataType(H5Object& obj, void* ref); - DataType(H5File& file, void* ref); - Group(H5Object& obj, void* ref); - Group(H5File& obj, void* ref); - (BMR - 2008/08/10) - - + - Tools: ------ - - h5repack: Added ability to use plugin filters. HDFFV-8345 (ADB - 2013/09/04). - - h5dump: Added option -N --any_path, which searches the file for paths that - match the search path. HDFFV-7989 (ADB - 2013/08/12). - - h5dump: Added optional arg 0 to -A, which excludes attributes from display. - HDFFV-8134 (ADB - 2013/08/01). - - h5dump: Fixed displaying compression ratio for unknown or user-defined - filters. HDFFV-8344 (XCAO 2013/03/19) - - h5dump: Changed UNKNOWN_FILTER to USER_DEFINED_FILTER for user defined filter. - HDFFV-8346 (XCAO 2013/03/19) - - h5dump: Added capability for "-a" option to show attributes containing "/" - by using an escape character. For example, for a dataset "/dset" - containing attribute "speed(m/h)", use "h5dump -a "/dset/speed(\/h)" - to show the content of the attribute. See details at HDFFV-7523 - (PC -- 2012/03/12) - - h5dump: Added ability to apply command options across multiple files using a - wildcard in the filename. Example; "h5dump -H -d Dataset1 tarr*.h5". - HDFFV-7876 (ADB - 2012/03/12). - - h5repack: Improved performance for big chunked datasets (size > 128MB) - when used with layout (-l) or compression (-f) option. - It would perform much better prior to the improvement, - especially for cases that chunk dimentions looks like - "1024x5x1" (compare to "1x5x1024"). When bigger numbers - are toward front and smaller number is toward back in chunk - dimentions. HDFFV-7862 (JKM - 2012/03/01) - - h5dump: Added new option --no-compact-subset. This option will not - interpret the '[' character as starting the compact form of - subsetting. This is useful when the "h5dump error: unable to - open dataset "datset_name"" message is output because a dataset - name contains a '[' character. HDFFV-7689 (ADB - 2012/01/31) - - h5dump: Corrected schema location: - - (ADB - 2011/08/10) - - h5diff: Added new level for -v (verbose) option. The new levels are - 1 and 2. So -v1 and -v2 can be specified to view more - information about attributes differences. - Bug#2121 (JKM 2011/3/23) - - h5dump: Added new option --enable-error-stack. This option will display - error stack information in the output stream. This is useful - when the "h5dump: Unable to print data" message is output. - (ADB - 2011/02/24) - - h5diff: Add a new flag --exclude-path. Specified path to an object will - be excluded from comparing the two files or two groups. If group - is specified all the member objects will be excluded. - (JKM - 2010/09/16). - - h5ls: Add new flag --no-dangling-links. (refer to --help for details) - (JKM - 2010/06/15) - - h5ls: Add new flag --follow-symlinks. (refer to --help for details) - (JKM - 2010/05/25) - - h5diff: Add new flag --no-dangling-links. (refer to --help for details) - (JKM - 2010/02/10) - - h5diff: Add new flag --follow-symlinks. (refer to --help for details) - (JKM - 2010/01/25) - - h5diff: fix for displaying garbage value on LE machine for BE data. - (JKM - 2009/11/20) - - h5dump: subsetting now allows default for count. Also trailing ; in short form - can be omitted after last specified value. - (ADB - 2009/09/04) - - h5dump/h5ls: now can display data in region references - using new -R, --region flag. - (ADB - 2009/09/04) - - h5diff: new flag, -c, --compare, list objects that are not comparable. - (PVN - 2009/4/10 - 1368) - - h5diff new flag, -N, --nan, avoids NaNs detection. (PVN - 2009/4/10) - - h5dump correctly specifies XML dtd / schema urls (ADB - 2009/4/3 - 1519) - - h5repack now handles group creation order. (PVN - 2009/4/2 - 1402) - - h5dump: added a printing of the compression ratio of uncompressed and compressed - sizes for cases where compression filters are present. (PVN - 2008/05/01) - - h5dump: added an option to allow a user defined formatting string for printf - regarding floating point numbers. (PVN - 2008/05/06) - - h5dump: support for external links, display the object that the external link - points to. (PVN - 2008/05/12) - - h5repack: add a userblock to an HDF5 file during the repack. (PVN - 2008/08/26) - - h5repack: add 2 options that call H5Pset_alignment in the repacked file. (PVN - 2008/08/29) - - h5ls: added capability to traverse through external links when the -r - (recursive) flag is given. (NAF - 2008/09/16) - - h5ls: added -E option to enable traversal of external links. h5ls will - not traverse external links without this flag being set. - (NAF - 2008/10/06) - - h5diff: added support for long double (PVN - 2008/10/28) - - h5dump: binary output defaults to NATIVE with -b optionally accepting - the form of binary output (NATIVE, FILE, BE, LE). (PVN - 2008/10/30) - - h5diff: return 1 for file differences when both file graphs differ by any object. - Error return code was changed to 2 from -1. (PVN - 2008/10/30) - - h5import: TEXTFPE (scientific format) was deprecated. Use TEXTFP - instead (PVN - 2008/10/30) - - h5repack: When user doesn't specify a chunk size, h5repack now defines a default - chunk size as the same size of the size of the hyperslab used to read the chunks. - The size of the hyperslabs are defined as the size of each dimension or a - predefined constant, whatever is smaller. This assures that the chunk - read fits in the chunk cache. (PVN - 2008/11/21) - - h5diff: h5diff treats two INFINITY values different. Fixed by checking (value==expect) - before call ABS(...) at h5diff_array.c This will make that (INF==INF) is true - (INF is treated as an number instead of NaN) (PC -- 2009/07/28) - - h5diff: add option "--use-system-epsilon" to print difference if (|a-b| > EPSILON) - Change default to use strict equality (PC -- 2009/09/12) - + - High-Level APIs: --------------- - C Packet Table API - ------------------ - - Replacement of a public function - - The existing function H5PTcreate_fl limits applications to deflate - compression only. The public function H5PTcreate is added to replace - H5PTcreate_fl. H5PTcreate takes a property list ID to provide - flexibility on creation properties. - - hid_t H5PTcreate(hid_t loc_id, const char *dset_name, - hid_t dtype_id, hsize_t chunk_size, hid_t plist_id); - (BMR, 2016/03/04, HDFFV-8623) - - - New public functions - - Two accessor functions were added per HDFFV-8623/patch 003. - /* Returns the ID of the dataset associated with the packet table */ - hid_t H5PTget_dataset(hid_t table_id); - - /* Returns the ID of the datatype the packet table uses */ - hid_t H5PTget_type(hid_t table_id); - (BMR, 2016/03/04, HDFFV-8623) - - - Regarding #ifdef VLPT_REMOVED - - The #ifdef VLPT_REMOVED blocks are removed from the PT library source - except the following cases: - + H5PTis_varlen() is made available again. - + H5PTfree_vlen_readbuff() now became H5PTfree_vlen_buff() - (BMR, 2016/03/04, HDFFV-442) - - C++ Packet Table API - -------------------- - - New constructor - - An overloaded constructor is added to FL_PacketTable and takes a property - list ID to provide flexibility on creation properties. - - FL_PacketTable(hid_t fileID, hid_t plist_id, const char* name, hid_t dtypeID, hsize_t chunkSize); - (BMR, 2016/03/08, HDFFV-8623) - - - New public functions - - Two accessor wrappers to class PacketTable, per HDFFV-8623/patch 004. - /* Returns the ID of the dataset associated with the packet table */ - hid_t PacketTable::GetDataset() - - /* Returns the ID of the datatype the packet table uses */ - hid_t PacketTable::GetDataset() - (BMR, 2016/03/04, HDFFV-8623) - - - Member functions having "char*" as an argument - - Overloaded functions were added to provide "const char*" argument, the - existing version will be deprecated. - (BMR, 2016/03/04) - - - Regarding #ifdef VLPT_REMOVED - - The #ifdef VLPT_REMOVED blocks are removed from the PT library source - except the following cases: - + VL_PacketTable::IsVariableLength() is moved to PacketTable - + VL_PacketTable::FreeReadBuff() now became PacketTable::FreeBuff() - - (BMR, 2016/03/04, HDFFV-442) - - - Internal header file - -------------------- - - A new API function H5DOwrite_chunk. It writes a data chunk directly - into a file bypassing hyperslab selection, data conversion, and - filter pipeline. The user must be careful with the function and - clearly understand the I/O process of the library. - (SLU - 2013/2/11) - - New API: h5ltpath_valid (Fortran: h5ltpath_valid_f) which checks - if a path is correct and determines if a link resolves to a valid - object and checks that the link does not dangle. (MSB- 2012/3/15) - - - Added Fortran wrappers for Dimension Scale APIs. HDFFV-3797 - h5dsset_scale_f - h5dsattach_scale_f - h5dsdetach_scale_f - h5dsis_attached_f - h5dsis_scale_f - h5dsset_label_f - h5dsget_label_f - h5dsget_scale_name_f - h5dsget_num_scales_f - (EIP for SB - 2011/10/13) - - - Table: In version 3.0 of Table, "NROWS" (used to store number of records) was - deprecated (PVN - 2008/11/24) + C Packet Table API + ------------------ + - + Internal header file + -------------------- + - + Documentation ------------- Support for new platforms, languages and compilers. ======================================= - - Intel V11.1 uses now -O3 optimization in production mode (EIP - 2010/10/08) - - PathScale compilers are recognized and can build the HDF5 library - properly. AKC - 2009/7/28 - - - SunOS 5.11 (emu) 32-bit and 64-bit with Sun C/C++ 5.12 compiler and - Sun Fortran 95 8.6 compiler. (SLU - 2013/04/15) + - -Bug Fixes since HDF5-1.8.0 release +Bug Fixes since HDF5-1.10.0-patch1 release ================================== Library ------- - - Fixed a memory bug that could occur when a message was improperly marked - as sharable on disk. - - (NAF, 2016/07/01, HDFFV-9950) - - - Incorrect usage of list in CMake COMPILE_DEFINITIONS set_property - - The CMake command, set_property with COMPILE_DEFINITIONS property - needs a quoted semi-colon separated list of values. CMake will - transform the list to a series of -D{value} for the compile. - - (ADB - 2014/12/09, HDFV-9041) - - - H5Z.c: H5Zfilter_avail(H5Z_filter_t id) - Added else block if the call to the internal H5Z_filter_avail(id) does not - fail and returns FALSE. This block calls the H5PL_load(H5PL_TYPE_FILTER, (int)id) - function to attempt to dynamically load the filter plugin. - (ADB - 2014/03/03 HDFFV-8629) - - Added const qualifier to source buffer parameters in H5Dgather and - H5D_scatter_func_t (H5Dscatter callback). (NAF - 2013/7/02) - - Fixed an error involving failure to write fill values to the user's - buffer when reading unallocated chunks from datasets that have a - fill value set to H5D_FILL_VALUE_DEFAULT. A consequence of this - was the reporting of spurious data values in h5dump and h5diff - output. - (HDFFV-8247; JP - 2013/05/03) - - Fixed an error that could occur when calling H5Ocopy within an - H5Literate callback (and possibly other situations). - (NAF - 2012/7/25 - HDFFV-5853) - - Fixed an error that would occur when copying an object with attribute - creation order tracked and indexed. (NAF - 2012/3/28 - HDFFV-7762) - - Fixed a bug in H5Ocopy(): When copying an opened object, call the - object's flush class action to ensure that cached data is flushed - so that H5Ocopy will get the correct data. - (VC - 2012/3/27 - HDFFV-7853) - - When an application tries to write or read many small data chunks and - runs out of memory, the library had a seg fault. The fix is to - return the error stack with proper information. (SLU - 2012/3/23. - Issue 7785) - - H5Pset_data_transform had seg fault in some cases like x*-100. It - works correctly now and handles other cases like 100-x or 2/x. - (SLU - 2012/3/15. Issue 7922) - - Fixed rare corruption bugs that could occur when using the new object - header format. (NAF - 2012/3/15 - HDFFV-7879) - - Creating a dataset in a read-only file caused seg fault when the file - is closed. It's fixed. The attemp to create a dataset will fail - with the error stack indicating the file is read-only. (SLU - - 2012/1/25. Issue 7756) - - Fixed a seg fault that could occur when shrinking a dataset with chunks - larger than 1 MB. (NAF - 2011/11/30 - HDFFV-7833) - - Fixed a bug that could cause file corruption when copying named - datatypes to a file using shared messages. (NAF - 2011/11/14) - - Fixed a bug that could cause H5Oget_info to return the wrong address - after copying a named datatype. (NAF - 2011/11/14) - - The library allowed the conversion of strings between ASCII and UTF8 - (Issue 7582). We have corrected it to report an error under this - situation. (SLU - 2011/11/8) - - The library had seg fault when it tried to shrink the size of compound type - through H5Tset_size immediately after the type was created (Issue - 7618). It's fixed now. (SLU - 2011/10/26) - - Fixed a bug that occurred when using H5Ocopy on a committed datatype - containing an attribute using that committed datatype. - (NAF - 2011/10/13 - Issue 5854) - - #ifdef _WIN32 instances changed to #ifdef H5_HAVE_WIN32_API and added - H5_HAVE_VISUAL_STUDIO checks where necessary. CMake only as configure - never set _WIN32. - - CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv - discovered 3 problems in tests and tools' library (Issue 7674): - 1. In dsets.c, left shifting an unsigned int for 32 bits or more - caused undefined behavior. - 2. In dt_arith.c, the INIT_INTEGER macro definition has an overflow - when the value is negative minimal and is being subtracted one. - 3. In tools/lib/h5tools_str.c, right shifting an int value for 32 bits - or more caused undefined behavior. - All the problems have been corrected. (SLU - 2011/9/2) - - In v1.6 library, there was EOA for the whole MULTI file saved in the - super block. We took it out in v1.8 library because it's meaningless - for the MULTI file. v1.8 library saves the EOA for the metadata file, - instead. But this caused some backward compatibility problem. - v1.8 library couldn't open the file created with v1.6 library. We - fixed the problem by checking the EOA value to detect the file - created with v1.6 library. (SLU - 2011/6/22) - - When a dataset had filters and reading data failed, the error message - didn't say which filter isn't registered. It's fixed now. - (SLU - 2011/6/3) - - The datatype handler created with H5Tencode/decode used to have the - reference count 0 (zero). I have fixed it. It is 1 (one) now. - (SLU - 2011/2/18) - - Fixed a bug that caused big endian machines to generate corrupt files - when using the scale-offset filter with floating point data or - fill values. Note that such datasets will no longer be readable - by any machine after this patch. (NAF - 2010/02/02 - Bug 2131) - - Retrieving a link's name by index in the case where the link is - external and the file that the link refers to doesn't exist will - now fail gracefully rather than cause a segmentation fault. - (MAM - 2010/11/17) - - Modified library to always cache symbol table information. Libraries - version 1.6.3 have a bug which causes them to require this - information for some operations. (NAF - 2010/09/21 - 1864) - - Fixed a bug that could occur when getting information for a new-style - group that was previously opened through a file handle that was - later closed. (NAF - 2010/09/15) - - Added define check in H5public.h if stdint.h is supported by the C++ - compiler. This define is only available on Windows with VS2010 and - using CMake to build the library. (ADB - 2010/09/13 - Bug 1938) - - H5Eset_current_stack now also closes the error stack to be set as the - default. This is to avoid a potential problem (Bug 1799). - (SLU - 2010/9/7) - - Fixed the bug in the filter's public CAN_APPLY function. The return - value should be htri_t not herr_t (Bug #1239). (SLU - 2010/8/5) - - Fixed a bug in the direct I/O driver that could render files with - certain kinds of unaligned data unreadable or corrupt them. - (NAF - 2010/07/28) - - valgrind reported an error of copying data to itself when a new attribute - is written (Bug #1956). I fixed it by taking out the memcpy step in - the attribute code. (SLU - 2010/07/28) - - Fixed a bug that could cause file corruption when using non-default - sizes of addresses and/or lengths. This bug could also cause - uncorrupted files with this property to be unreadable. This bug - was introduced in 1.8.5. (NAF - 2010/07/16 - 1951) - - Fixed a file corruption bug that could happen when shrinking a - compressed dataset. (NAF - 2010/05/20) - - Fixed some memory leaks in VL datatype conversion when strings are - used as fill values. (MAM - 2010/05/12 - BZ# 1826) - - Fixed a bug when copying objects with NULL references with the - H5O_COPY_EXPAND_REFERENCE_FLAG flag set. (NAF - 2010/04/08 - 1815) - - Files can now be concurrently opened more than once using the core file - driver, as long as the backing store is used. (NAF - 2010/03/09) - - Added support for H5O_COPY_EXPAND_EXT_LINK_FLAG to H5Ocopy. External - links will now be expanded if this flag is set. - (NAF - 2010/03/05 - 1733) - - Fixed a bug where the library, when traversing an external link, would - reopen the source file if nothing else worked. (NAF - 2010/03/05) - - Fixed an intermittent bug in the b-tree code which could be triggered - by expanding and shrinking chunked datasets in certain ways. - (NAF - 2010/02/16) - - H5Tdetect_class said a VL string is a string type. But when it's - in a compound type, it said it's a VL type (Bug #1584). I fixed it - to be consistent. It always return string type. (SLU - 2009/12/10) - - Fixed a bug where writing and deleting many global heap objects (i.e. - variable length data) would render the file unreadable. Previously - created files exhibiting this problem should now be readable. - (NAF - 2009/10/27 - 1483) - - Fixed incorrect return value for H5Pget_preserve. (AKC - 2009/10/08 - 1628) - - Fixed an assertion failure that occurred when H5Ocopy was called on a - dataset using a vlen inside a compound. (NAF - 2009/10/02 - 1597) - - Fixed incorrect return value for H5Pget_filter_by_id1/2 in H5Ppublic.h. - (NAF - 2009/09/25 - 1620) - - Fixed a bug where properties weren't being compared with the registered - compare callback. (NAF - 2009/09/25 - 1555) - - Fixed a bug where H5Pget_fitler_by_id would succeed when called for a - filter that wasn't present. (NAF - 2009/06/25 - 1250) - - Fixed an issue with committed compound datatypes containing a vlen. - Also fixed memory leaks involving committed datatypes. - (NAF - 2009/06/10 - 1593) - - Added versioning to H5Z_class_t struct to allow compatibility with 1.6 - API. (NAF - 2009/04/20 - 1533) - - Fixed a problem with using data transforms with non-native types in the - file. (NAF - 2009/04/20 - 1548) - - Added direct.h include file to windows section of H5private.h - to fix _getcwd() warning. (ADB - 2009/04/14 - 1536) - - Fixed a bug that prevented external links from working after calling - H5close(). (NAF - 2009/04/10 - 1539) - - Modified library to write cached symbol table information to the - superblock, to allow library versions 1.3.0 to 1.6.3 to read files - created by this version. (NAF - 2009/04/08 - 1423) - - Changed skip lists to use a deterministic algorithm. The library should - now never call rand() or srand(). (NAF - 2009/04/08 - 503) - - Fixed a bug where H5Lcopy and H5Lmove wouldn't create intermediate - groups when that property was set. (NAF - 2009/04/07 - 1526) - - Fixed a bug that caused files with a user block to grow by the size of - the user block every time they were opened. - (NAF - 2009/03/26 - 1499) - - Fixed a rare problem that could occur with files using the old (pre 1.4) - array datatype. (NAF - 2009/03/23) - - Modified library to be able to open files with corrupt root group symbol - table messages, and correct these errors if they are found. Such - files can only be successfully opened with write access. - (NAF - 2009/03/23 - 1189) - - Removed the long_long #define and replaced all instances with - "long long". This caused problems with third party products. All - currently supported compliers support the type. (ADB - 2009/03/05) - - Fixed various bugs that could prevent the fill value from being written - in certain rare cases. (NAF - 2009/02/26 - 1469) - - Fixed a bug that prevented more than one dataset chunk from being cached - at a time. (NAF - 2009/02/12 - 1015) - - Fixed an assertion failure caused by opening an attribute multiple times - through multiple file handles. (NAF - 2009/02/12 - 1420) - - Fixed a problem that could prevent the user from adding attributes (or - any object header message) in some circumstances. - (NAF - 2009/02/12 - 1427) - - Fixed a bug that could cause problems when an attribute was added to a - committed datatype using the committed datatype's datatype. - (NAF - 2009/02/12) - - Fixed a bug that could cause problems when copying an object with a - shared message in its own object header. (NAF - 2009/01/29) - - Changed H5Tset_order to properly reject H5T_ORDER_NONE for most - datatypes. (NAF - 2009/01/27 - 1443) - - Fixed a bug where H5Tpack wouldn't remove trailing space from an - otherwise packed compound type. (NAF - 2009/01/14) - - Fixed up some old v2 btree assertions that get run in debug mode that - were previously failing on compilation, and removed some of the - more heavily outdated and non-rewritable ones. (MAM - 2008/12/15) - - Fixed a bug that could cause problems when "automatically" unmounting - multiple files. (NAF - 2008/11/17) - - H5Ovisit and H5Ovisit_by_name will now properly terminate when the - callback function returns a positive value on the starting object. - (NAF - 2008/11/03) - - Fixed an error where a null message could be created that was larger - than could be written to the file. (NAF - 2008/10/23) - - Corrected error with family/split/multi VFD not updating driver info - when "latest" version of the file format used. (QAK - 2008/10/14) - - Corrected alignment+threshold errors to work correctly when metadata - aggregation is enabled. (QAK - 2008/10/06) - - Changed H5Fget_obj_count and H5Fget_obj_ids to ignore objects registered - by the library for internal library use. (NAF - 2008/10/06) - - Fixed potential memory leak during compound conversion. - (NAF - 2008/10/06) - - Changed the return value of H5Fget_obj_count from INT to SSIZE_T. Also - changed the return value of H5Fget_obj_ids from HERR_T to SSIZE_T and - the type of the parameter MAX_OBJS from INT to SIZE_T. (SLU - 2008/09/26) - - Fixed an issue that could cause data to be improperly overwritten - during compound type conversion. (NAF - 2008/09/19) - - Fixed pointer alignment violations that could occur during vlen - conversion. (NAF - 2008/09/16) - - Fixed problem where library could cause a segmentation fault when - an invalid location ID was given to H5Giterate(). (QAK - 2008/08/19) - - Fixed improper shutdown when objects have reference count > 1. The - library now tracks reference count due to the application separately - from that due to internal library routines. (NAF - 2008/08/19) - - Fixed assertion failure caused by incorrect array datatype version. - (NAF - 2008/08/08) - - Fixed an issue where mount point traversal would fail when using - multiple handles for the child. (NAF - 2008/08/07) - - Fixed an issue where mount points were inaccessible when using multiple - file handles for the parent. The mount table is now in the shared - file structure (the parent pointer is still in the top structure). - (NAF - 2008/08/07) - - when an attribute was opened twice and data was written with one of the handles, - the file didn't have the data. It happened because each handle had its own - object structure, and the empty one overwrote the data with fill value. This is - fixed by making some attribute information like the data be shared in the - attribute structure. SLU - 2008/07/22 - - Fixed issue where a group could have a file mounted on it twice. - (QAK - 2008/07/15) - - Fixed a Windows-specific issue in the ohdr test which was causing users - in some timezones to get false errors. This a deficiency in the Windows - mktime() function, and has been handled properly. SJW - 2008/06/19 - - Fixed the problem with the searching of target file for H5Lcreate_external(). - The searching pattern will depend on whether the target file's - pathname is an absolute or a relative path. Please see the description - in the RM for H5Lcreate_external(). (VC - 2008/04/08) - - Fixed possible file corruption bug when encoding datatype - descriptions for compound datatypes whose size was between - 256 & 511 bytes and the file was opened with the "use the - latest format" property enabled (with H5Pset_libver_bounds). - (QAK - 2008/03/13) - - Fixed bug in H5Aget_num_attrs() routine to handle invalid location - ID correctly. (QAK - 2008/03/11) - - H5Dset_extent: when shrinking dimensions, some chunks were not deleted. - (PVN - 2009/01/8) - - Added code to maintain a min_clean_fraction in the metadata cache when - in serial mode. (MAM - 2009/01/9) - - + - Configuration ------------- - - CMake: When CMake commands are executed individually on the command line - and the external filters are being built, the CMAKE_BUILD_TYPE define - must be set to the same value as the configuration - (-DCMAKE_BUILD_TYPE:STRING=Release if using -C Release). This is needed - by the the szip and zlib filter build commands. (ADB - HDFFV-8695) - - CMake: Remove use of XLATE_UTILITY program. (ADB - 2014/03/28 HDFFV-8640) - - CMake: Added missing quotes in setting the CMAKE_EXE_LINKER_FLAGS for the - MPI option. (ADB - 2014/02/27 HDFFV-8674) - - Modified H5detect.c to scan floating point types for padding bits before - analyzing the type further. This should fix problems with gcc 4.8 - (NAF - 2013/09/19 - HDFFV-8523/HDFFV-8500) - - Fixed Makefile issue in which "-Wl," was not properly specified - prior to -rpath when building parallel fortran libraries with - an Intel compiler. (MAM - 2012/03/26) - - Makefiles generated by other packages using h5cc as the compiler - no longer error when 'make' is invoked more than once in order - to 'rebuild' after changes to source. (MAM - 2012/03/26) - - Added --enable-fortran2003 flag to enable Fortran2003 support - in the HDF5 Fortran library. The flag should be used along with the - --enable-fortran flag and takes affect only when Fortran compiler - is Fortran2003 compliant. (EIP - 2011/11/14) - - - In Windows platform, the default VFD, was Windows VFD, is restored back - to the SEC2, aka POSIX, VFD. The Windows VFD is deprecated. HDFFV-7740 - (AKC 2011/09/26) - - Removed config/ibm-aix6.x. All IBM-AIX settings are in one file, - ibm-aix. (AKC - 2011/4/14) - - Shared C libraries are no longer disabled on Mac when Fortran - is enabled. Shared Fortran libraries are still not supported on Mac, - so configure will disable them by default, but this is overridable - with the new --enable-unsupported configure option. The configure - summary has been updated to reflect the fact that the shared-ness of - the C++/Fortran wrapper libraries may not align with the C library. - (MAM - 04/11/2011 - HDFFV-4353). - - Removed recognition of the parallel compilers of LAM(hcc) and - ChMPIon(cmpicc) since we have no access to these two MPI implementations - and cannot verify their correctness. (AKC - 2010/7/14 - Bug 1921) - - Removed the following config files, as we no longer support them: - config/dec-osf*, config/hpux11.00, config/irix5.x, - config/powerpc-ibm-aix4.x config/rs6000-ibm-aix5.x config/unicos* - MAM - 2009/10/08 - - Modified configure and make process to properly preserve user's CFLAGS - (and company) environment variables. Build will now properly use - automake's AM_CFLAGS for any compiler flags set by the configure - process. Configure will no longer modify CFLAGS directly, nor will - setting CFLAGS during make completely replace what configure has set up. - MAM - 2009/10/08 - - Support for TFLOPS, config/intel-osf1, is removed since the TFLOPS - machine has long retired. AKC - 2009/10/06. - - Added $(EXEEXT) extension to H5detect when it's executed in the - src/Makfile to generate H5Tinit.c so it works correctly on platforms - that require the full extension when running executables. - MAM - 2009/10/01 - BZ #1613 - - Configure will now set FC and CXX to "no" when fortran and c++ - are not being compiled, respectively, so configure will not run - some of the compiler tests for these languages when they are not - being used. MAM - 2009/10/01 - - The PathScale compiler (v3.2) was mistaken as gcc v4.2.0 but it fails to - recognize some gcc options. Fixed. (see bug 1301). AKC - 2009/7/28 - - - The --enable-static-exec flag will now properly place the -static flag - on the link line of all installed executables. This will force the - executable to link with static libraries over shared libraries, provided - the static libraries are available. MAM - 2009/08/31 - BZ #1583 - - The --includedir=DIR configuration option now works as intended, and can - be used to specify the location to install C header files. The default - location remains unchanged, residing at ${prefix}/include. - MAM - 2009/03/10 - BZ #1381 - - Configure no longer removes the '-g' flag from CFLAGS when in production - mode if it has been explicitly set in the CFLAGS environment variable - prior to configuration. MAM - 2009/03/09 - BZ #1401. - - Fixed error with 'make check install' failing due to h5dump - needing other tools built first. MAM - 2008/10/24. - - Wpen using shared szip, it is no longer necessary to specify - the path to the shared szip libraries in LD_LIBRARY_PATH. MAM - - 2008/10/24. - - The file libhdf5_fortran.settings is not installed since its content - is included in libhdf5.settings now. AKC - 2008/10/21 - - "make DESTDIR=xxx install" failed to install some tools and files - (e.g., h5cc and fortran modules). Fixed. AKC - 2008/10/8. - - Autotools: An export of LD_LIBRARY_PATH= was - removed from configure and make installcheck was revised to run - scripts installed in share/hdf5_examples to use the installed h5cc, etc. - to compile and run example source files also installed there. Make - installcheck will now fail when a shared szip or other external lib file - cannot be found in the same manner that executables compiled and linked - with h5cc will fail to run when those lib files cannot be found after - install. Make installcheck should pass after setting LD_LIBRARY_PATH to the - szip location. - (LRK - 2014/04/16) + - Performance ------------- - - Removed program perform/benchpar from the enable-build-all list. The - program will be retired or moved to another location. HDFFV-8156 - (AKC 2012/10/01) - - Retired program perform/mpi-perf. Its purpose has been incorporated - into h5perf before. (AKC 2012/09/20) - - ifdefs added to tests around include unistd.h and function to simulate - getlogin() on Windows. - (ADB - 2011/08/15) - - perf_serial test added to Windows projects and check batch file. - (ADB - 2009/06/11) + - + Fortran -------- - - Fixed a typo in return value of the nh5dread_f_c function ( was 1 - instead of 0 on success); fixed the return value to make it consistent - with other Fortran functions; cleaned the code from debug statements. - (EIP - 2012/06/23) - - - Fixed problem writing/reading control characters to a dataset; writing - a string containing: alerts, backspace, carriage_return, form_feed, - horizontal_tab, vertical_tab, new_line is now tested and working. - (MSB - 2012/09/01) - - - Corrected the integer type of H5S_UNLIMITED_F to HSIZE_T (MSB - 2012/09/01) - - - Corrected the number of continuation lines in the src files - to be less then 32 lines for F95 compliance. (MSB - 2012/10/01) + - Tools ----- - - h5dump subsetting fixed for dims greater then two - When a dataset has more then two dimensions, subsetting would incorrectly - calculate the data that needed to be displayed. - Added in block and stride calculation that account for dimensions greater - then two. NOTE: lines that have line breaks inserted because of display - length calculations, may have index info that is incorrect until the next - dimension break. (ADB, 2016/03/04, HDFFV-9698) - - h5repack: h5repack would not attempt to remove UD filters. Added a - check to h5repack for UD filters that checks if the filter can - be dynamically loaded. This will require a change in the library to - add the H5PL_load() to the H5Zfilter_avail(). (ADB - 2014/03/03 HDFFV-8629) - - h5repack: Fixed failure for converting a layout of small chunked dataset - (size < 1K) to contiguous layout. HDFFV-8214 (JKM 2013/03/18) - - h5diff: Fixed to return correct exit code 1 when detect unique extra - attribute. Prior to this fix, h5diff returned exit code 0 indicating - two files are identical. HDFFV-7643 (JKM 2013/02/15) - - h5diff: Improved speed when comparing HDF5 files with lots of - attributes. Much slower performance was identified with release - version from 1.8.7 to 1.8.10 compared to 1.8.6. (JKM 2012/10/19) - - h5repack: "h5repack -f NONE file1.h5 out.h5" command failed if - source file contains chunked dataset and a chunk dim is bigger than - the dataset dim. Another issue is that the command changed max dims - if chunk dim is smaller than the dataset dim. - These issue occurred when dataset size is smaller than 64k (compact - size limit) Fixed both. - HDFFV-8012 (JKM 2012/09/24) - - h5diff: Fixed not to accumulate attribute difference to dataset - difference in verbose mode (-v, -r), which caused incorrect - difference between dataset and group/datatype object if attribute - exist with any differences. This also lead to fix inconsistent - format indicating difference between dataset and group/datatype - object. HDFFV-5919 (JKM 2012/09/05) - - h5diff: Fixed the incorrect result when comparing attribute data - values and the data type has same class but different size. - HDFFV-7942 (JKM 2012/08/15) - - ph5diff: Fixed intermittent hang issue on a certain operation in - parallel mode. It was detected by daily test for comparing - non-comparable objects, but it could have occurred in other - operations depend on machine condition. HDFFV-8003 (JKM 2012/08/01) - - h5diff: Fixed test failure for "make check" due to failure of - copying test files when performed in HDF5 source tree. Also applied - to other tools. - HDFFV-8107 (JKM 2012/08/01) - - h5diff: Fixed the Function COPY_TESTFILES_TO_TESTDIR() of - testh5diff.sh to better report when there is an error in the file - copying. HDFFV-8105 (AKC -2012/07/22) - - h5diff: Fixed not to check and display dangling link status without - --follow-symlinks option. This also improved performance when - comparing lots of external links without the --follow-symlinks - option. HDFFV-7998 (JKM 2012/04/26) - - h5unjam: Fixed sefgault when used -V (show version) option. - HDFFV-8001 (JKM 2012/04/19) - - h5repack: Fixed a failure when change the chunk size of a specified - chunked dataset with unlimited max dims. HDFFV-7993 (JKM 2012/04/11) - - h5diff: Fixed failure for comparing same named object with different - object types in comparing groups. Prior to the fix, h5diff resulted - in error. After the fix, h5diff detects such case as non-comparable - and display messages accordingly. HDFFV-7664 (JKM 2012/03/28) - - h5diff: If unique objects exists only in one file and try to exclude - the unique objects with --exclude-path option, h5diff missed - excluding some objects. - Fixed to exclude objects correctly in such case. - HDFFV-7837 (JKM 2012/03/20) - - h5dump: Added tools library error stack to properly catch error - information generated within the library. - HDFFV-7958 (ADB 2012/03/12) - - h5dump: Dangling links no longer throw error message, change process - when open link fails. - HDFFV-7839 (ADB 2012/03/12) - - h5diff: When two symbolic dangling links are compared with - --follow-symlinks option, the result should be same. It worked for - comparing two files, but didn't work for comparing two objects. - HDFFV-7835 (JKM 2012/03/09) - - h5dump: Refactored code to remove duplicated functions. Split XML - functions from DDL functions. Corrected indentation and formatting - errors. Also fixed subsetting counting overflow (HDFFV-5874). Verified - all tools call tools_init() in main. - HDFFV-7560 (ADB 2012/02/17) - - h5diff: fixed to prevent from displaying error stack message when - comparing the two dangling symlinks with follow-symlinks option. - HDFFV-7836 (JKM 2012/01/13) - - h5repack: fixed memory leak for handling variable length string in - attribute. HDFFV-7840 (JKM 2012/01/06) - - h5ls: fixed segfault when access region reference data in an - attribute. HDFFV-7838 (JKM 2011/12/29) - - h5diff: fixed segfault over non-comparable attribute with different - dimention or rank, along with '-c' option to display details. - HDFFV-7770 (JKM 2011/10/24) - - Fixed h5diff to display all the comparable object and attribute - regardless of non-comparables. HDFFV-7693 (JKM 2011/09/16) - - Fixed h5repack to update values of references(object and region) of - attributes in h5repack for 1) references, 2) ARRAY of references, - 3) VLEN of references, and 4) COMPOUND of references. - (JIRA HDF5 5932) PC -2011/09/14 - - h5diff: fixed segfault over dataset with container types - (array,lven) with multiple nested compound types. - (ex: compound->array->compound, compound->vlen->compound) - HDFFV-7712 JKM (2011/09/01) - - h5repack: added macro to handle failure in H5Dread/write when memory - allocation failed inside the library. (PC -- 2011/08/19) - - Fixed h5jam not to allow specifying an HDF5 formatted file as input - file for -u (user block file) option, because the original HDF5 file - will not be accessible if allows. HDFFV-5941 (JKM 2011/08/15) - - Revised command help pages of h5jam and h5unjam. The descriptions - were not up to date and some were missing. - HDFFV-7515 (JKM 2011/08/15) - - h5repack: h5repack failed to copy dataset if the layout is changed - from chunked with unlimited dims to contiguous. HDFFV-7649 - (PC -- 2011/07/15) - - h5diff: "--delta" option considers two NaN of the same type are - different, which is wrong based on h5diff description in Reference - Manual. HDFFV-7656 (PC -- 2011/07/15) - - Fixed h5diff to display instructive error message and exit with 1 - when mutually exclusive options (-d, -p and --use-system-epsilon) - are used together. HDFFV-7600 (JKM 2011/07/07) - - Fixed h5dump to display the first line of each element into correct - position for multiple dimention array type. - Before this fix, the first line of each element in array were - displayed after the last line of previous element without - moving to the next line (+indentation). - Bug #HDFFV-5878 (JKM 2011/06/15) - - Fixed h5dump to display correct value for H5T_STD_I8LE dataset - on a system (ppc64, linux, Big-Endian, clustering). - Bug #HDFFV-7594 (ABERT & JKM 2011/05/12) - - Fixed h5diff to compare file itself correctly. Previously h5diff - reported either different or not compatible in certain cases even - comparing file itself. This fix also improve performance when - comparing same target objects through verifying the obj&file - addresses before comparing the details in the objects (ex: datasets - or attributes) Bug #HDFFV-5928 (XCAO & JKM 2011/05/06) - - Updated h5dump test case script to prevent entire test failure upon - source directory is read-only. Bug# HDFFV-4342 (JKM 2011/4/12) - - Fixed h5dump displaying incorrect values for H5T_STD_I8BE type data in - attribute on Big-Endian machine. H5T_STD_I8BE is unsigned 8bit type, - so h5dump is supposed to display -2 instead of 254. It worked - correctly on Little-Endian system , but not on Big-Endian system. - Bug #HDFFV-4358 (JKM 2011/04/08) - - Updated to unify option name to '--enable-error-stack' for printing - HDF5 error stack messages for HDF5 tools. h5ls and h5dump for now. - For h5ls, this replaces "-e/--errors" option, which is deprecated. - Bug#2182 (JKM 2011/3/30) - - Fix h5diff for --use-system-epsilon option: the calculation changed - from ( |a - b| / b ) to ( |a - b| ). This was decided for better - performance. Bug#2184 (JKM 2011/3/24) - - Fixed output for H5T_REFERENCE in h5dump. According to the BNF document - the output of a H5T_REFERENCE should be followed by the type; - ::= H5T_REFERENCE { } - ::= H5T_STD_REF_OBJECT | H5T_STD_REF_DSETREG - Previously this was only displayed if the -R option was used. - Bug#1725 (ADB 2011/3/28) - - Fix h5diff issues for #1: h5diff compared attributes correctly only - when two objects have the same number of attributes and attribute - names are identical, #2: didn't display useful information about - attribute difference. Bug#2121 (JKM 2011/3/17) - - Fixed memory leak for h5diff when accessing symbolic links with - --follow-symlink option. Bug#2214 (JKM 2011/3/18) - - Fixed memory leak for h5diff when access variable length string - data. Bug#2216 (JKM 2011/3/18) - - Fixed and improved help page for -a option of h5ls. - Bug#1904 (JKM 2011/3/11) - - Fixed h5dump not to include attribute values in the output file when - h5dump "-y -o output_file" options were used. The problem was introduced - in HDF5 1.8.6 by showing data pointed by region references. (XCAO 2011/3/9) - - Fixed h5copy to be able to copy any object into the same HDF5 file. - Previously h5copy displayed error message when target file is same - as source file. (XCAO 2011/3/8) - - Fixed h5dump for skipping some values for long array type dataset on - Windows. This issue only occurred on Windows due to the different - return behavior from _vsnprintf() funtion. Bug#2161 (JKM 2011/3/3) - - Fixed h5dump for skipping array indices every certain number - when the array type dataset is relatively big. The certain number - varies according to the size of array. Bug#2092 (JKM 2011/2/15). - - Fixed h5diff for the segfault when compares compound datasets - with combination of fixed length string types and vlen string types - in certain orders. bug#2089 (JKM 2010/12/28) - - Improve h5diff performance. 1) use HDmemcmp() before comparing each - elements. 2) replace expensive H5Tequals() calls 3) retrieve datatype - information at dataset level not each element level for compound - datasets - - Fixed h5ls to display nested compound type with curly bracket - when -S (--simple) option is used with -l (--label), so it shows - which member (in curly bracket) belong to which nested compound type - and make the output make sense. bug#1979 (JKM 2010/11/09) - - Fixed h5diff to handle variable-length strings in a compound dataset - correctly. (also variable-length string array in a compound dataset) - Garbage values were displayed when h5diff compared multiple - variable-length strings in a compound type dataset. - Bug#1989 (JKM 2010/10/28) - - Fixed h5copy to fail gracefully when copying object to non-exist - group without -p option. Bug#2040 (JKM 2010/10/18) - - Fixed to compare member objects and groups recursively when two - files or groups are specified to be compared. Bug#1975 - (JKM 2010/9/16) - - Make h5repack be able to convert a layout to COMPACT for small size - dataset as default. bug#1896 (JKM 2010/09/15) - - Change h5ls not to manipulate special characters in object name or - attribute name for smart display. bug#1784 (JKM 2010/06/28) - - Fixed h5ls to return exit code 1 (error) when non-existent file is - specified. bug#1793. (JKM 2010/04/27) - - h5copy failed to copy dangling link when the link is specified - directly. bug#1817. (JKM 2010/04/22) - - h5repack lost attributes from a dataset of reference type. bug#1726. - (JKM 2010/3/25) - - h5repack sets NULL for object reference value for group or - named datatype. bug#1814. (JKM 2010/03/19) - - h5diff: fixed incorrect behavior (hang) in parallel mode when - specify invalid options (ex: -v and -q) (JKM 2010/02/17) - - h5dump/h5ls display buffer resize fixed in tools library. - (ADB - 2009/07/21 - 1520) - - Fixed many problems that could occur when using h5repack with named - datatypes. (NAF - 2009/4/20 - 1516/1466) - - h5dump, h5diff, h5repack were not reading (by hyperslabs) datasets - that have a datatype datum size greater than H5TOOLS_BUFSIZE, a - constant defined as 1024Kb, such as array types with large - dimensions (PVN - 2009/4/1 - 1501) - - h5import: By selecting a compression type, a big endian byte order was being - selected (PVN - 2009/3/11 - 1462) - - zip_perf.c had missing argument on one of the open() calls. Fixed. - (AKC - 2008/12/9) - - h5dump now checks for uniqueness of committed datatypes. - (NAF - 2008/10/15) - - Fixed unnecessary indentation of committed datatypes in h5dump. - (NAF - 2008/10/15) - - Fixed bugs in h5stat:segmemtation fault when printing groups and - print warning message when traversal of objects is unsuccessful. - (see bug #1253) (VC- 2008/10/13) - - Fixed bug in h5ls that prevented relative group listings (like - "h5ls foo.h5/bar") from working correctly (QAK - 2008/06/03) - - Fixed bug in h5diff that prevented datasets & attributes with - variable-length string elements from comparing correctly. - (QAK - 2008/02/28) - - h5import bug on Windows w/binary datasets. fread in windows needs a - binary file to be open with 'rb' instead of 'r' otherwise it - terminates execution if an end of file character is found on the - input file. Besides that the binary file generated needs to be open - with 'wb' , otherwise an end of line character is read twice. - (PVN - 2008/02/19) - - Fixed bug in h5dump that caused binary output to be made only for the first - dataset, when several datasets were requested. (PVN - 2008/04/07) - - h5dump: when doing binary output (-b), the stdout printing of attributes - was done incorrectly. Removed printing of attributes when doing binary - output. PVN - 2008/06/05 - + - High-Level APIs: - ------ - - Packet Table is updated. - - In the Packet Table C API, there are changes with the following functions, - which had been ifdef'ed out with VLPT_REMOVED since 2006 - * H5PTcreate_vl, is removed from this release - * H5PTfree_vlen_readbuff, is renamed to H5PTfree_vlen_buff - * H5PTis_varlen, is made available again - - Various cleanup: replacing 0/-1 with SUCCEED/FAIL and H5I_BADID with - H5I_INVALID_HID. (BMR, 2016/03/04, HDFFV-442) - - - Fixed problem with H5DSget_scale_name including the NULL terminator in - the size calculation returned by the function. The API does not - include the NULL terminator in the size returned (MSB- 2013/2/10) - - - Fixed problem with H5TBdelete_record destroying all data following the deletion - of a row. (MSB- 2012/7/26) - - - Fixed H5LTget_attribute_string not closing an object identifier when an - error occurs. (MSB- 2012/7/21) - - - Fixed the H5LTdtype_to_text function. It had some memory problems when - dealing with some complicated data types. HDFFVI-7701 (SLU - 2011/10/19) - - - Fixed a bug in H5DSattach_scale, H5DSis_attached and H5DSdetach_scale - caused by using H5Tget_native_type function to determine the native - type for reading REFERENCE_LIST attribute. The bug was exposed - on Mac PPC. - (EIP - 2010/05/22 -1851) - - Fixed a bug in the H5DSdetach_scale function when 0 bytes - were allocated after the last reference to a dim. scale - was removed from the list of references in a VL element of the - DIMENSION_LIST attribute; modified the function to comply - with the Spec: DIMENSION_LIST attribute is deleted now when no - dimension scales left attached. - (EIP - 2010/05/14 -1822) - - Fixed a bug where the H5TB API would forget the order of fields when - added out of offset order. (NAF - 2009/10/27 - 1582) - - H5DSis_attached failed to account for different platform types. Added a - get native type call. (ADB - 2009/9/29 - 1562) - - Dimension scales: The scale index return value in H5DSiterate_scales was not always - incremented. (PVN - 2009/4/8 - 1538) + ------ + - Fortran High-Level APIs: - ------ - - - Lite: The h5ltget_attribute_string_f used to return the C NULL character in the - returned character buffer. The returned Fortran charactor buffer now does - not return the C NULL character. (MSB - 2012/3/23) - - Lite: The h5ltget_dataset_info_f function (gets information about a dataset) - was not correctly returning the dimension array. (PVN - 2009/3/23) - - Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions - had memory problems with the g95 fortran compiler. (PVN � 5/13/2009) 1522 - - - - + ------ + - Documentation ------------- @@ -1238,141 +132,80 @@ Bug Fixes since HDF5-1.8.0 release F90 APIs -------- - - Modified the h5open_f and h5close_f subroutines to not to call H5open - and H5close correspodningly. While the H5open call just adds overhead, - the H5close call called by an Fortran application shuts down the HDF5 - library making it unaccessible to the application. - HDFFV-915 (EIP & SB - 2011/10/13) + - C++ APIs -------- - - The constructor PropList::PropList(id) was fixed to act properly - according to the nature of 'id'. When 'id' is a property class id, - a new property list will be created. When 'id' id a property list id, - a copy of the property list will be made. (BMR - 2010/5/9) - - The parameters 'size' and 'bufsize' in CommonFG::getLinkval and - CommonFG::getComment, respectively, now have default values for - user's convenience. (BMR - 2009/10/23) - - NULL pointer accessing was fixed, bugzilla 1061. (BMR - 2009/10/05) - - read/write methods of DataSet and Attribute classes were fixed - to handle string correctly. (BMR - 2009/07/26) - - Fixed bug that caused segfaults in Attribute::read. (BMR - 2008/04/20) - - Fixed bug in PropList::getClassName to use portable HDfree instead - of free. (BMR - 2008/04/20) - - Fixed a design bug which allowed an Attribute object to create/modify - attributes (bugzilla #1068). The API class hierarchy was revised - to address the problem. Classes AbstractDS and Attribute are moved - out of H5Object. Class Attribute now multiply inherits from - IdComponent and AbstractDs and class DataSet from H5Object and - AbstractDs. In addition, the data member IdComponent::id was - moved into subclasses: Attribute, DataSet, DataSpace, DataType, - H5File, Group, and PropList. (BMR - 2008/08/10) - - IdComponent::dereference was incorrect and replaced as described - in "New Features" section. - (BMR - 2008/08/10) - + - + Testing ------- - - tools/h5diff/testh5diff.sh is run in every "make check", even after it - has passed in the previous run. It should not run again if there is no - code changes. Fixed. (AKC - 2013/07/19 HDFFV-8392) - - In some Mac system, testlibinfo.sh failed with this error: - Check file ../src/.libs/libhdf5.7.dylib - strings: object: ../src/.libs/libhdf5.7.dylib malformed object \ - (unknown load command 15) - The strings command of Mac inspects library files and older - versions of strings may not know newer library format, resulting - in errors. Fixed by sending the library file as stdin to the strings - coommand to avoid this problem. (AKC - 2013/03/08 HDFFV-8305) - - - Fixed a typo in the ERROR macro in test/testhdf5.h. It segmentation - faulted when used before. (AKC - 2013/02/12 HDFFV-8267) - + - Supported Platforms =================== - AIX 6.1 xlc 10.1.0.5 - (NASA G-ADA) xlC 10.1.0.5 - xlf90 12.1.0.6 - - Linux 2.6.18-308.13.1.el5PAE GNU C (gcc), Fortran (gfortran), C++ (g++) - #1 SMP i686 i686 i386 compilers for 32-bit applications; - (jam) Version 4.1.2 20080704 (Red Hat 4.1.2-54) - Version 4.8.2 - PGI C, Fortran, C++ Compilers for 32-bit - applications; - Version 13.7-0 - Intel(R) C, C++, Fortran Compiler for 32-bit - applications; - Version 14.0.2 (Build 20140120) - - Linux 2.6.18-371.6.1.el5 GNU C (gcc), Fortran (gfortran), C++ (g++) - #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; - (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-54) - Version 4.8.2 - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64; - Version 14.0.2 (Build 20140120) - - Linux 2.6.32-431.11.2.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) #1 SMP x86_64 GNU/Linux compilers: - (platypus) Version 4.4.7 20120313 - Version 4.8.2 + (mayll/platypus) Version 4.4.7 20120313 + Version 4.8.4 PGI C, Fortran, C++ for 64-bit target on x86-64; - Version 13.7-0 + Version 16.10-0 Intel(R) C (icc), C++ (icpc), Fortran (icc) compilers: - Version 14.0.2 (Build 20140120) + Version 15.0.3.187 (Build 20150407) + MPICH 3.1.4 compiled with GCC 4.9.3 - Linux 2.6.32-431.29.2.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + Linux 2.6.32-573.18.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) IBM XL C/C++ V13.1 IBM XL Fortran V15.1 - Linux 2.6.32-220.23.1.1chaos Intel C, C++, Fortran Compilers - ch5.x86_64 GNU/Linux Version 12.1.5.339 - (LLNL Aztec) - - IBM Blue Gene/P XL C for Blue Gene/P, bgxlc V9.0 - (LLNL uDawn) XL C++ for Blue Gene/P, bgxlC V9.0 - XL Fortran for Blue Gene/P, bgxlf90 V11.1 - + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Version 4.9.3, Version 5.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 Build 20150407 + MPICH 3.1.4 compiled with GCC 4.9.3 + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc (emu) Sun Fortran 95 8.6 SunOS_sparc Sun C++ 5.12 SunOS_sparc - Windows 7 Visual Studio 2008 (cmake) - Visual Studio 2010 w/ Intel Fortran 14 (cmake) - Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) - Visual Studio 2015 (cmake) - Cygwin(CYGWIN_NT-6.1 1.7.34(0.285/5/3) gcc(4.9.2) compiler and gfortran) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Cygwin(CYGWIN_NT-6.1 2.2.1(0.289/5/3) gcc(4.9.3) compiler and gfortran) (cmake and autotools) - Windows 7 x64 Visual Studio 2008 (cmake) - Visual Studio 2010 w/ Intel Fortran 14 (cmake) - Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) - Visual Studio 2015 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 10 Visual Studio 2015 w/ Intel Fortran 16 (cmake) - Windows 8.1 Visual Studio 2012 w/ Intel Fortran 15 (cmake) - Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.1 from Xcode 5.1 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (swallow/kite) Intel icc/icpc/ifort version 15.0.3 - Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) - Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Mac OS X Mavericks 10.9.5 Apple clang/clang++ version 6.0 from Xcode 6.2 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (wren/quail) Intel icc/icpc/ifort version 15.0.3 - Mac OS X Lion 10.7.3 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.2.1 - 32- and 64-bit g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.2.1 - (duck) gfortran GNU Fortran (GCC) 4.6.2 + Mac OS X Yosemite 10.10.5 Apple clang/clang++ version 6.1 from Xcode 7.0 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 - Mac OS X Mountain Lion 10.8.1 cc Apple clang version 4.0 from Xcode 4.5.1 - (owl) c++ Apple clang version 4.0 from Xcode 4.5.1 - gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.5.1 - g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.5.1 - gfortran GNU Fortran (GCC) 4.6.2 + Mac OS X El Capitan 10.11.6 Apple clang/clang++ version 7.3.0 from Xcode 7.3 + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 16.0.2 Tested Configuration Features Summary @@ -1396,22 +229,18 @@ Windows 7 y y/y n y y y Windows 7 x64 y y/y n y y y Windows 7 Cygwin n y/n n y y y Windows 7 x64 Cygwin n y/n n y y y -Windows 8 y y/y n y y y -Windows 8 x64 y y/y n y y y -Mac OS X Lion 10.7.3 32-bit n y/y n y y n -Mac OS X Lion 10.7.3 64-bit n y/y n y y y -Mac OS X Mountain Lion 10.8.1 64-bit n y/y n y y y -Mac OS X Mavericks 10.9.1 64-bit n y/y n y y ? -AIX 6.1 32- and 64-bit n y/n n y y y -CentOS 5.9 Linux 2.6.18-308 i686 GNU y y/y y y y y -CentOS 5.9 Linux 2.6.18-308 i686 Intel n y/y n y y y -CentOS 5.9 Linux 2.6.18-308 i686 PGI n y/y n y y y -CentOS 5.9 Linux 2.6.18 x86_64 GNU n y/y n y y y -CentOS 5.9 Linux 2.6.18 x86_64 Intel n y/y n y y y -CentOS 6.4 Linux 2.6.32 x86_64 GNU y y/y y y y y -CentOS 6.4 Linux 2.6.32 x86_64 Intel n y/y n y y y -CentOS 6.4 Linux 2.6.32 x86_64 PGI n y/y n y y y -Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y +Windows 10 y y/y n y y y +Windows 10 x64 y y/y n y y y +Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y ? +Mac OS X Yosemite 10.10.5 64-bit n y/y n y y ? +Mac OS X El Capitan 10.11.6 64-bit n y/y n y y ? +CentOS 6.7 Linux 2.6.18 x86_64 GNU n y/y n y y y +CentOS 6.7 Linux 2.6.18 x86_64 Intel n y/y n y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.2 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 7.2 Linux 2.6.32 x86_64 Intel n y/y n y y y +Linux 2.6.32-573.18.1.el6.ppc64 n y/n n y y y Platform Shared Shared Shared Thread- @@ -1422,22 +251,18 @@ Windows 7 y y y y Windows 7 x64 y y y y Windows 7 Cygwin n n n y Windows 7 x64 Cygwin n n n y -Windows 8 y y y y -Windows 8 x64 y y y y -Mac OS X Lion 10.7.3 32-bit y n y y -Mac OS X Lion 10.7.3 64-bit y n y y -Mac OS X Mountain Lion 10.8.1 64-bit y n y y -Mac OS X Mavericks 10.9.1 64-bit y n y y -AIX 6.1 32- and 64-bit y n n y -CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y -CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n -CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n -CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y -CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n -CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n -CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n -CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n -Linux 2.6.32-431.11.2.el6.ppc64 y y y n +Windows 10 y y y y +Windows 10 x64 y y y y +Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +Mac OS X Yosemite 10.10.5 64-bit y n y y +Mac OS X El Capitan 10.11.6 64-bit y n y y +CentOS 6.7 Linux 2.6.18 x86_64 GNU y y y y +CentOS 6.7 Linux 2.6.18 x86_64 Intel y y y n +CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y n +CentOS 7.2 Linux 2.6.32 x86_64 GNU y y y n +CentOS 7.2 Linux 2.6.32 x86_64 Intel y y y n +Linux 2.6.32-573.18.1.el6.ppc64 y y y n Compiler versions for each platform are listed in the preceding "Supported Platforms" table. @@ -1447,70 +272,26 @@ More Tested Platforms ===================== The following platforms are not supported but have been tested for this release. - Linux 2.6.18-308.13.1.el5PAE MPICH mpich 3.1.2 compiled with - #1 SMP i686 i686 i386 gcc 4.9.1 and gfortran 4.9.1 - (jam) g95 (GCC 4.0.3 (g95 0.94!) - - Linux 2.6.18-431.11.2.el6 MPICH mpich 3.1.2 compiled with - #1 SMP x86_64 GNU/Linux gcc 4.9.1 and gfortran 4.9.1 - (platypus) g95 (GCC 4.0.3 (g95 0.94!) - - FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719 - (loyalty) gcc 4.6.1 20110422 - g++ 4.6.1 20110422 - gfortran 4.6.1 20110422 - - FreeBSD 8.2-STABLE amd64 gcc 4.2.1 [FreeBSD] 20070719 - (freedom) gcc 4.6.1 20110422 - g++ 4.6.1 20110422 - gfortran 4.6.1 20110422 - - Debian7.5.0 3.2.0-4-686 #1 SMP Debian 3.2.51-1 i686 GNU/Linux - gcc (Debian 4.7.2-5) 4.7.2 - GNU Fortran (Debian 4.7.2-5) 4.7.2 - (cmake and autotools) - - Debian7.5.0 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux - gcc (Debian 4.7.2-5) 4.7.2 - GNU Fortran (Debian 4.7.2-5) 4.7.2 - (cmake and autotools) + Linux 2.6.32-573.18.1.el6.ppc64 MPICH mpich 3.1.4 compiled with + #1 SMP ppc64 GNU/Linux IBM XL C/C++ for Linux, V13.1 + (ostrich) and IBM XL Fortran for Linux, V15.1 - Fedora20 3.15.3-200.fc20.i6866 #1 SMP i686 i686 i386 GNU/Linux - gcc (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) - GNU Fortran (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + Debian 8.4 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1 x86_64 GNU/Linux + gcc, g++ (Debian 4.9.2-10) 4.9.2 + GNU Fortran (Debian 4.9.2-10) 4.9.2 (cmake and autotools) - Fedora20 3.15.3-200.fc20.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux - gcc (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) - GNU Fortran (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + Fedora 24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc, g++ (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + GNU Fortran (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) (cmake and autotools) - SUSE 13.1 3.11.10-17-desktop #1 SMP PREEMPT i686 athlon i386 GNU/Linux - gcc (SUSE Linux) 4.8.1 - GNU Fortran (SUSE Linux) 4.8.1 + Ubuntu 16.04.1 4.4.0-38-generic #57-Ubuntu SMP x86_64 GNU/Linux + gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 + GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 (cmake and autotools) - SUSE 13.1 3.11.10-17-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux - gcc (SUSE Linux) 4.8.1 - GNU Fortran (SUSE Linux) 4.8.1 - (cmake and autotools) - - Ubuntu 14.04 3.13.0-35-generic #62-Ubuntu SMP i686 GNU/Linux - gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 - GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 - (cmake and autotools) - - Ubuntu 14.04 3.13.0-35-generic #62-Ubuntu SMP x86_64 GNU/Linux - gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 - GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 - (cmake and autotools) - - Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 - hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai - pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai - pgCC 12.5-0 64-bit target on x86-64 Linux -tp shanghai - - + Known Problems ============== * "make check" fails on CYGWIN when building shared lib files is enabled. The diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt index d3618e9..f188ab3 100644 --- a/release_docs/USING_CMake_Examples.txt +++ b/release_docs/USING_CMake_Examples.txt @@ -22,7 +22,7 @@ I. Preconditions 1. We suggest you obtain the latest CMake for windows from the Kitware web site. The HDF5 1.10.x product requires a minimum CMake version - of 3.1.0. + of 3.2.2. 2. You have installed the HDF5 library built with CMake, by executing the HDF Install Utility (the *.msi file in the binary package for @@ -52,7 +52,7 @@ Default installation process: with the CTEST_CONFIGURATION_TYPE script option. Note that this must be the same as the value used with the -C command line option. The default build configuration is defined to build and use static libraries. - Shared libraries can be used with the STATIC_LIBRARIES script option set to "NO". + Shared libraries can be used with the STATIC_ONLY script option set to "NO". Other options can be changed by editing the HDF5_Examples.cmake file. If the defaults are okay, execute from this directory: diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 313af83..87ebafc 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -37,7 +37,7 @@ I. Preconditions 1. We suggest you obtain the latest CMake for windows from the Kitware web site. The HDF5 1.10.x product requires a minimum CMake version - of 3.1.0. + of 3.2.2. 2. You have installed the HDF5 library built with CMake, by executing the HDF Install Utility (the *.msi file in the binary package for @@ -180,7 +180,7 @@ Given the preconditions in section I, create a CMakeLists.txt file at the source root. Include the following text in the file: ########################################################## -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) project (HDF5MyApp C CXX) set (LIB_TYPE STATIC) # or SHARED @@ -227,97 +227,97 @@ NOTE: this file is available at the HDF web site: ctest ======================================================================== -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: # ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -V -O test.log ############################################################################################################### -set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) +set (CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set (CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) # handle input parameters to script. #INSTALLDIR - HDF5 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATIC_LIBRARIES - Default is YES +#STATIC_ONLY - Default is YES #FORTRAN_LIBRARIES - Default is NO #JAVA_LIBRARIES - Default is NO ##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) -if(DEFINED CTEST_SCRIPT_ARG) +if (DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 # to variables with the respective names set to the respective values - string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach(current_var ${script_args}) + string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach (current_var ${script_args}) if ("${current_var}" MATCHES "^([^=]+)=(.+)$") set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif() - endforeach() -endif() -if(NOT DEFINED INSTALLDIR) - set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") -endif() -if(NOT DEFINED CTEST_CONFIGURATION_TYPE) - set(CTEST_CONFIGURATION_TYPE "Release") -endif() -if(NOT DEFINED CTEST_SOURCE_NAME) - set(CTEST_SOURCE_NAME "HDF5Examples") -endif() -if(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "YES") -else(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "NO") -endif() -if(NOT DEFINED FORTRAN_LIBRARIES) - set(FORTRANLIBRARIES "NO") -else(NOT DEFINED FORTRAN_LIBRARIES) - set(FORTRANLIBRARIES "YES") -endif() -if(NOT DEFINED JAVA_LIBRARIES) - set(JAVALIBRARIES "NO") -else(NOT DEFINED JAVA_LIBRARIES) - set(JAVALIBRARIES "YES") -endif() + endif () + endforeach () +endif () +if (NOT DEFINED INSTALLDIR) + set (INSTALLDIR "@CMAKE_INSTALL_PREFIX@") +endif () +if (NOT DEFINED CTEST_CONFIGURATION_TYPE) + set (CTEST_CONFIGURATION_TYPE "Release") +endif () +if (NOT DEFINED CTEST_SOURCE_NAME) + set (CTEST_SOURCE_NAME "HDF5Examples") +endif () +if (NOT DEFINED STATIC_ONLY) + set (STATICONLYLIBRARIES "YES") +else () + set (STATICONLYLIBRARIES "NO") +endif () +if (NOT DEFINED FORTRAN_LIBRARIES) + set (FORTRANLIBRARIES "NO") +else () + set (FORTRANLIBRARIES "YES") +endif () +if (NOT DEFINED JAVA_LIBRARIES) + set (JAVALIBRARIES "NO") +else () + set (JAVALIBRARIES "YES") +endif () #TAR_SOURCE - name of tarfile -#if(NOT DEFINED TAR_SOURCE) -# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") -#endif() +#if (NOT DEFINED TAR_SOURCE) +# set (CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") +#endif () ############################################################################################################### # Adjust the following SET Commands as needed ############################################################################################################### -if(WIN32) - if(${STATICLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif() - set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") - set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else(WIN32) - if(${STATICLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif() - set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") - set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") - set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +if (WIN32) + if (${STATICONLYLIBRARIES}) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") + endif () + set (ENV{HDF5_DIR} "${INSTALLDIR}/cmake") + set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") +else (WIN32) + if (${STATICONLYLIBRARIES}) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + endif () + set (ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") + set (ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") + set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) + set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") + set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") endif(WIN32) -if(${FORTRANLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") -else() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") -endif() -if(${JAVALIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") -else() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") -endif() -set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") +if (${FORTRANLIBRARIES}) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") +else () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") +endif () +if (${JAVALIBRARIES}) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") +else () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") +endif () +set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### # For any comments please contact cdashhelp@hdfgroup.org @@ -327,90 +327,90 @@ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HD #----------------------------------------------------------------------------- # MAC machines need special option #----------------------------------------------------------------------------- -if(APPLE) +if (APPLE) # Compiler choice - execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set(ENV{CC} "${XCODE_CC}") - set(ENV{CXX} "${XCODE_CXX}") - if(NOT NO_MAC_FORTRAN) + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") + if (NOT NO_MAC_FORTRAN) # Shared fortran is not supported, build static - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif() - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif() + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + else () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") + endif () + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif () #----------------------------------------------------------------------------- -set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") ## -------------------------- -if(CTEST_USE_TAR_SOURCE) +if (CTEST_USE_TAR_SOURCE) ## Uncompress source if tar or zip file provided ## -------------------------- - if(WIN32) - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else() - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif() - - if(NOT rv EQUAL 0) - message(STATUS "extracting... [error-(${rv}) clean up]") - file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif() -endif(CTEST_USE_TAR_SOURCE) + if (WIN32) + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else () + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif () + + if (NOT rv EQUAL 0) + message (STATUS "extracting... [error-(${rv}) clean up]") + file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message (FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") + endif () +endif () #----------------------------------------------------------------------------- ## Clear the build directory ## -------------------------- -set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") - ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) + ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) else () - file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") + file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") endif () # Use multiple CPU cores to build -include(ProcessorCount) -ProcessorCount(N) -if(NOT N EQUAL 0) - if(NOT WIN32) - set(CTEST_BUILD_FLAGS -j${N}) - endif() - set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif() +include (ProcessorCount) +ProcessorCount (N) +if (NOT N EQUAL 0) + if (NOT WIN32) + set (CTEST_BUILD_FLAGS -j${N}) + endif () + set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif () set (CTEST_CONFIGURE_COMMAND "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) #----------------------------------------------------------------------------- ## -- set output to english -set($ENV{LC_MESSAGES} "en_EN") +set ($ENV{LC_MESSAGES} "en_EN") #----------------------------------------------------------------------------- -configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) +configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") ## NORMAL process ## -------------------------- ctest_start (Experimental) ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}") -if(LOCAL_SUBMIT) +if (LOCAL_SUBMIT) ctest_submit (PARTS Configure Notes) -endif() +endif () ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) -if(LOCAL_SUBMIT) +if (LOCAL_SUBMIT) ctest_submit (PARTS Build) -endif() +endif () ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) -if(LOCAL_SUBMIT) +if (LOCAL_SUBMIT) ctest_submit (PARTS Test) -endif() -if(res GREATER 0) +endif () +if (res GREATER 0) message (FATAL_ERROR "tests FAILED") -endif() +endif () #----------------------------------------------------------------------------- ############################################################################################################## diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 55de5ea..ef361b2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- @@ -90,8 +90,10 @@ set (H5C_SOURCES ${HDF5_SRC_DIR}/H5C.c ${HDF5_SRC_DIR}/H5Cdbg.c ${HDF5_SRC_DIR}/H5Cepoch.c + ${HDF5_SRC_DIR}/H5Cimage.c ${HDF5_SRC_DIR}/H5Clog.c ${HDF5_SRC_DIR}/H5Cmpio.c + ${HDF5_SRC_DIR}/H5Cprefetched.c ${HDF5_SRC_DIR}/H5Cquery.c ${HDF5_SRC_DIR}/H5Ctag.c ${HDF5_SRC_DIR}/H5Ctest.c @@ -439,6 +441,7 @@ set (H5O_SOURCES ${HDF5_SRC_DIR}/H5Obogus.c ${HDF5_SRC_DIR}/H5Obtreek.c ${HDF5_SRC_DIR}/H5Ocache.c + ${HDF5_SRC_DIR}/H5Ocache_image.c ${HDF5_SRC_DIR}/H5Ochunk.c ${HDF5_SRC_DIR}/H5Ocont.c ${HDF5_SRC_DIR}/H5Ocopy.c @@ -658,7 +661,7 @@ set (H5Z_SOURCES if (H5_ZLIB_HEADER) SET_PROPERTY(SOURCE ${HDF5_SRC_DIR}/H5Zdeflate.c PROPERTY COMPILE_DEFINITIONS H5_ZLIB_HEADER="${H5_ZLIB_HEADER}") -endif (H5_ZLIB_HEADER) +endif () set (H5Z_HDRS @@ -816,10 +819,10 @@ if (HDF5_GENERATE_HEADERS) COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SRC_DIR}/H5overflow.txt OUTPUT_VARIABLE SCRIPT_OUTPUT ) message(STATUS ${SCRIPT_OUTPUT}) - else (PERL_FOUND) + else () message (STATUS "Cannot generate headers - perl not found") - endif (PERL_FOUND) -endif (HDF5_GENERATE_HEADERS) + endif () +endif () #----------------------------------------------------------------------------- # Setup the H5Detect utility which generates H5Tinit with platform @@ -829,7 +832,7 @@ add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) TARGET_C_PROPERTIES (H5detect STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") -endif (MSVC OR MINGW) +endif () set (CMD $) add_custom_command ( @@ -843,7 +846,7 @@ add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") -endif (MSVC OR MINGW) +endif () set (CMD $) add_custom_command ( @@ -864,10 +867,10 @@ TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_LIB_TARGET} ${LINK_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} dl) -endif (NOT WIN32) +endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) target_link_libraries (${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) -endif (H5_HAVE_PARALLEL AND MPI_C_FOUND) +endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) set_target_properties (${HDF5_LIB_TARGET} PROPERTIES @@ -881,7 +884,7 @@ if (HDF5_ENABLE_DEBUG_APIS) COMPILE_DEFINITIONS "H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG" ) -endif (HDF5_ENABLE_DEBUG_APIS) +endif () set (install_targets ${HDF5_LIB_TARGET}) if (BUILD_SHARED_LIBS) @@ -908,10 +911,10 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${HDF5_LIBSH_TARGET} ${LINK_SHARED_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIBSH_TARGET} dl) - endif (NOT WIN32) + endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) target_link_libraries (${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) - endif (H5_HAVE_PARALLEL AND MPI_C_FOUND) + endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_LIBSH_TARGET} PROPERTIES @@ -926,16 +929,16 @@ if (BUILD_SHARED_LIBS) "H5_HAVE_THREADSAFE" ) target_link_libraries (${HDF5_LIBSH_TARGET} Threads::Threads) - endif (HDF5_ENABLE_THREADSAFE) + endif () if (HDF5_ENABLE_DEBUG_APIS) set_property (TARGET ${HDF5_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG" ) - endif (HDF5_ENABLE_DEBUG_APIS) + endif () set (install_targets ${install_targets} ${HDF5_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif () #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -950,7 +953,7 @@ if (NOT HDF5_INSTALL_NO_DEVELOPMENT) COMPONENT headers ) -endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) +endif () #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects @@ -958,7 +961,8 @@ endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries) - endif (BUILD_SHARED_LIBS) + endif () + INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries) install ( TARGETS @@ -971,4 +975,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT libraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/src/H5AC.c b/src/H5AC.c index 117e662..ee68a6f 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -107,38 +107,43 @@ hbool_t H5_coll_api_sanity_check_g = false; /* Local Variables */ /*******************/ -static const char *H5AC_entry_type_names[H5AC_NTYPES] = -{ - "B-tree nodes", - "symbol table nodes", - "local heap prefixes", - "local heap data blocks", - "global heaps", - "object headers", - "object header chunks", - "v2 B-tree headers", - "v2 B-tree internal nodes", - "v2 B-tree leaf nodes", - "fractal heap headers", - "fractal heap direct blocks", - "fractal heap indirect blocks", - "free space headers", - "free space sections", - "shared OH message master table", - "shared OH message index", - "extensible array headers", - "extensible array index blocks", - "extensible array super blocks", - "extensible array data blocks", - "extensible array data block pages", - "fixed array headers", - "fixed array data block", - "fixed array data block pages", - "superblock", - "driver info", - "epoch marker", /* internal to cache only */ - "proxy entry", - "test entry" /* for testing only -- not used for actual files */ +/* Metadata entry class list */ + +/* Remember to add new type ID to the H5AC_type_t enum in H5ACprivate.h when + * adding a new class. + */ + +static const H5AC_class_t *const H5AC_class_s[] = { + H5AC_BT, /* ( 0) B-tree nodes */ + H5AC_SNODE, /* ( 1) symbol table nodes */ + H5AC_LHEAP_PRFX, /* ( 2) local heap prefix */ + H5AC_LHEAP_DBLK, /* ( 3) local heap data block */ + H5AC_GHEAP, /* ( 4) global heap */ + H5AC_OHDR, /* ( 5) object header */ + H5AC_OHDR_CHK, /* ( 6) object header chunk */ + H5AC_BT2_HDR, /* ( 7) v2 B-tree header */ + H5AC_BT2_INT, /* ( 8) v2 B-tree internal node */ + H5AC_BT2_LEAF, /* ( 9) v2 B-tree leaf node */ + H5AC_FHEAP_HDR, /* (10) fractal heap header */ + H5AC_FHEAP_DBLOCK, /* (11) fractal heap direct block */ + H5AC_FHEAP_IBLOCK, /* (12) fractal heap indirect block */ + H5AC_FSPACE_HDR, /* (13) free space header */ + H5AC_FSPACE_SINFO, /* (14) free space sections */ + H5AC_SOHM_TABLE, /* (15) shared object header message master table */ + H5AC_SOHM_LIST, /* (16) shared message index stored as a list */ + H5AC_EARRAY_HDR, /* (17) extensible array header */ + H5AC_EARRAY_IBLOCK, /* (18) extensible array index block */ + H5AC_EARRAY_SBLOCK, /* (19) extensible array super block */ + H5AC_EARRAY_DBLOCK, /* (20) extensible array data block */ + H5AC_EARRAY_DBLK_PAGE, /* (21) extensible array data block page */ + H5AC_FARRAY_HDR, /* (22) fixed array header */ + H5AC_FARRAY_DBLOCK, /* (23) fixed array data block */ + H5AC_FARRAY_DBLK_PAGE, /* (24) fixed array data block page */ + H5AC_SUPERBLOCK, /* (25) file superblock */ + H5AC_DRVRINFO, /* (26) driver info block (supplements superblock) */ + H5AC_EPOCH_MARKER, /* (27) epoch marker - always internal to cache */ + H5AC_PROXY_ENTRY, /* (28) cache entry proxy */ + H5AC_PREFETCHED_ENTRY /* (29) prefetched entry - always internal to cache */ }; @@ -366,12 +371,13 @@ H5AC_term_package(void) *------------------------------------------------------------------------- */ herr_t -H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) +H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_config_t * image_config_ptr) { #ifdef H5_HAVE_PARALLEL char prefix[H5C__PREFIX_LEN] = ""; H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ + struct H5C_cache_image_ctl_t int_ci_config = H5C__DEFAULT_CACHE_IMAGE_CTL; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -380,11 +386,16 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) HDassert(f); HDassert(NULL == f->shared->cache); HDassert(config_ptr != NULL) ; - HDcompile_assert(NELMTS(H5AC_entry_type_names) == H5AC_NTYPES); + HDassert(image_config_ptr != NULL) ; + HDassert(image_config_ptr->version == H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION); + HDcompile_assert(NELMTS(H5AC_class_s) == H5AC_NTYPES); HDcompile_assert(H5C__MAX_NUM_TYPE_IDS == H5AC_NTYPES); + /* Validate configurations */ if(H5AC_validate_config(config_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad cache configuration") + if(H5AC_validate_cache_image_config(image_config_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad cache image configuration") #ifdef H5_HAVE_PARALLEL if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { @@ -402,7 +413,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get mpi size") if(NULL == (aux_ptr = H5FL_CALLOC(H5AC_aux_t))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate H5AC auxilary structure.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate H5AC auxilary structure") aux_ptr->magic = H5AC__H5AC_AUX_T_MAGIC; aux_ptr->mpi_comm = mpi_comm; @@ -426,15 +437,16 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) aux_ptr->candidate_slist_ptr = NULL; aux_ptr->write_done = NULL; aux_ptr->sync_point_done = NULL; + aux_ptr->p0_image_len = 0; sprintf(prefix, "%d:", mpi_rank); if(mpi_rank == 0) { if(NULL == (aux_ptr->d_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create dirtied entry list.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create dirtied entry list") if(NULL == (aux_ptr->c_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cleaned entry list.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cleaned entry list") } /* end if */ /* construct the candidate slist for all processes. @@ -442,25 +454,25 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) * will use it in the case of a flush. */ if(NULL == (aux_ptr->candidate_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create candidate entry list.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create candidate entry list") if(aux_ptr != NULL) if(aux_ptr->mpi_rank == 0) f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), - (const char **)H5AC_entry_type_names, + H5AC_class_s, H5AC__check_if_write_permitted, TRUE, H5AC__log_flushed_entry, (void *)aux_ptr); else f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), - (const char **)H5AC_entry_type_names, + H5AC_class_s, H5AC__check_if_write_permitted, TRUE, NULL, (void *)aux_ptr); else f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), - (const char **)H5AC_entry_type_names, + H5AC_class_s, H5AC__check_if_write_permitted, TRUE, NULL, NULL); } /* end if */ else { @@ -471,7 +483,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) */ f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), - (const char **)H5AC_entry_type_names, + H5AC_class_s, H5AC__check_if_write_permitted, TRUE, NULL, NULL); #ifdef H5_HAVE_PARALLEL } /* end else */ @@ -500,6 +512,20 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) if(H5AC_set_cache_auto_resize_config(f->shared->cache, config_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "auto resize configuration failed") + /* don't need to get the current H5C image config here since the + * cache has just been created, and thus f->shared->cache->image_ctl + * must still set to its initial value (H5C__DEFAULT_CACHE_IMAGE_CTL). + * Note that this not true as soon as control returns to the application + * program, as some test code modifies f->shared->cache->image_ctl. + */ + int_ci_config.version = image_config_ptr->version; + int_ci_config.generate_image = image_config_ptr->generate_image; + int_ci_config.save_resize_status = image_config_ptr->save_resize_status; + int_ci_config.entry_ageout = image_config_ptr->entry_ageout; + + if(H5C_set_cache_image_config(f, f->shared->cache, &int_ci_config) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "auto resize configuration failed") + done: #ifdef H5_HAVE_PARALLEL /* if there is a failure, try to tidy up the auxilary structure */ @@ -557,7 +583,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) #if H5AC__TRACE_FILE_ENABLED if(H5AC__close_trace_file(f->shared->cache) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__close_trace_file() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__close_trace_file() failed") #endif /* H5AC__TRACE_FILE_ENABLED */ if(H5F_USE_MDC_LOGGING(f)) { @@ -571,7 +597,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) #ifdef H5_HAVE_PARALLEL /* destroying the cache, so clear all collective entries */ if(H5C_clear_coll_entries(f->shared->cache, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed") aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache); if(aux_ptr) @@ -580,7 +606,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) /* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */ if(H5AC__flush_entries(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") #endif /* H5_HAVE_PARALLEL */ /* Destroy the cache */ @@ -590,12 +616,18 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) #ifdef H5_HAVE_PARALLEL if(aux_ptr != NULL) { - if(aux_ptr->d_slist_ptr != NULL) + if(aux_ptr->d_slist_ptr != NULL) { + HDassert(H5SL_count(aux_ptr->d_slist_ptr) == 0); H5SL_close(aux_ptr->d_slist_ptr); - if(aux_ptr->c_slist_ptr != NULL) + } /* end if */ + if(aux_ptr->c_slist_ptr != NULL) { + HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0); H5SL_close(aux_ptr->c_slist_ptr); - if(aux_ptr->candidate_slist_ptr != NULL) + } /* end if */ + if(aux_ptr->candidate_slist_ptr != NULL) { + HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0); H5SL_close(aux_ptr->candidate_slist_ptr); + } /* end if */ aux_ptr->magic = 0; aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr); } /* end if */ @@ -706,7 +738,7 @@ H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, #endif /* H5AC__TRACE_FILE_ENABLED */ if(H5C_expunge_entry(f, dxpl_id, type, addr, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_expunge_entry() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_expunge_entry() failed") done: #if H5AC__TRACE_FILE_ENABLED @@ -776,17 +808,17 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id) #ifdef H5_HAVE_PARALLEL /* flushing the cache, so clear all collective entries */ if(H5C_clear_coll_entries(f->shared->cache, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed") /* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */ if(H5AC__flush_entries(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") #endif /* H5_HAVE_PARALLEL */ /* Flush the cache */ /* (Again, in parallel - writes out the superblock) */ if(H5C_flush_cache(f, dxpl_id, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache") done: #if H5AC__TRACE_FILE_ENABLED @@ -840,11 +872,11 @@ H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status) FUNC_ENTER_NOAPI(FAIL) if((f == NULL) || (!H5F_addr_defined(addr)) || (status == NULL)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry") if(H5C_get_entry_status(f, addr, NULL, &in_cache, &is_dirty, &is_protected, &is_pinned, &is_corked, &is_flush_dep_parent, &is_flush_dep_child, &image_is_up_to_date) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed") if(in_cache) { *status |= H5AC_ES__IN_CACHE; @@ -958,7 +990,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add /* Check if we should try to flush */ if(aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold) if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point") } /* end if */ } #endif /* H5_HAVE_PARALLEL */ @@ -978,6 +1010,41 @@ done: /*------------------------------------------------------------------------- + * Function: H5AC_load_cache_image_on_next_protect + * + * Purpose: Load the cache image block at the specified location, + * decode it, and insert its contents into the metadata + * cache. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: John Mainzer + * 7/6/15 + * + *------------------------------------------------------------------------- + */ +herr_t +H5AC_load_cache_image_on_next_protect(H5F_t * f, haddr_t addr, hsize_t len, + hbool_t rw) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + HDassert(f->shared->cache); + + if(H5C_load_cache_image_on_next_protect(f, addr, len, rw) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "call to H5C_load_cache_image_on_next_protect failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_load_cache_image_on_next_protect() */ + + +/*------------------------------------------------------------------------- * Function: H5AC_mark_entry_dirty * * Purpose: Mark a pinned or protected entry as dirty. The target @@ -1330,13 +1397,13 @@ H5_ATTR_UNUSED #endif /* H5_HAVE_PARALLEL */ if(H5C_move_entry(f->shared->cache, type, old_addr, new_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, "H5C_move_entry() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, "H5C_move_entry() failed") #ifdef H5_HAVE_PARALLEL /* Check if we should try to flush */ if(NULL != aux_ptr && aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold) if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point") #endif /* H5_HAVE_PARALLEL */ done: @@ -1426,7 +1493,7 @@ done: * Function: H5AC_prep_for_file_close * * Purpose: This function should be called just prior to the cache - * flushes at file close. + * flushes at file close. * * The objective of the call is to allow the metadata cache * to do any preparatory work prior to generation of a @@ -1508,7 +1575,7 @@ H5AC_create_flush_dependency(void * parent_thing, void * child_thing) /* Create the flush dependency */ if(H5C_create_flush_dependency(parent_thing, child_thing) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "H5C_create_flush_dependency() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "H5C_create_flush_dependency() failed") done: #if H5AC__TRACE_FILE_ENABLED @@ -1609,7 +1676,7 @@ H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, #endif /* H5AC_DO_TAGGING_SANITY_CHECKS */ if(NULL == (thing = H5C_protect(f, dxpl_id, type, addr, udata, flags))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_protect() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_protect() failed") #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr != NULL) @@ -1832,7 +1899,7 @@ H5AC_destroy_flush_dependency(void * parent_thing, void * child_thing) /* Destroy the flush dependency */ if(H5C_destroy_flush_dependency(parent_thing, child_thing) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "H5C_destroy_flush_dependency() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "H5C_destroy_flush_dependency() failed") done: #if H5AC__TRACE_FILE_ENABLED @@ -1956,18 +2023,18 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, if(deleted && aux_ptr->mpi_rank == 0) if(H5AC__log_deleted_entry((H5AC_info_t *)thing) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5AC__log_deleted_entry() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5AC__log_deleted_entry() failed") } /* end if */ #endif /* H5_HAVE_PARALLEL */ if(H5C_unprotect(f, dxpl_id, addr, thing, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5C_unprotect() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5C_unprotect() failed") #ifdef H5_HAVE_PARALLEL /* Check if we should try to flush */ if((aux_ptr != NULL) && (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)) if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point") #endif /* H5_HAVE_PARALLEL */ done: @@ -2010,22 +2077,22 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, /* Check args */ if((cache_ptr == NULL) || (config_ptr == NULL) || (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr or config_ptr on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr or config_ptr on entry") #ifdef H5_HAVE_PARALLEL { H5AC_aux_t *aux_ptr; aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); if((aux_ptr != NULL) && (aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad aux_ptr on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad aux_ptr on entry") } #endif /* H5_HAVE_PARALLEL */ /* Retrieve the configuration */ if(H5C_get_cache_auto_resize_config((const H5C_t *)cache_ptr, &internal_config) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_auto_resize_config() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_auto_resize_config() failed") if(H5C_get_evictions_enabled((const H5C_t *)cache_ptr, &evictions_enabled) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_resize_enabled() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_resize_enabled() failed") /* Set the information to return */ if(internal_config.rpt_fcn == NULL) @@ -2094,7 +2161,7 @@ done: */ herr_t H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr, - size_t *cur_size_ptr, int32_t *cur_num_entries_ptr) + size_t *cur_size_ptr, uint32_t *cur_num_entries_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2102,7 +2169,7 @@ H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_s if(H5C_get_cache_size((H5C_t *)cache_ptr, max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_size() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_size() failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2129,7 +2196,7 @@ H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr) FUNC_ENTER_NOAPI(FAIL) if(H5C_get_cache_hit_rate((H5C_t *)cache_ptr, hit_rate_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_hit_rate() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_hit_rate() failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2156,7 +2223,7 @@ H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr) FUNC_ENTER_NOAPI(FAIL) if(H5C_reset_cache_hit_rate_stats((H5C_t *)cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats() failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2205,14 +2272,14 @@ H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config #endif /* H5AC__TRACE_FILE_ENABLED */ if(cache_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad cache_ptr on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad cache_ptr on entry") #ifdef H5_HAVE_PARALLEL { H5AC_aux_t *aux_ptr; aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); if((aux_ptr != NULL) && (aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad aux_ptr on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad aux_ptr on entry") } #endif /* H5_HAVE_PARALLEL */ @@ -2224,29 +2291,29 @@ H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config FILE * file_ptr; if(NULL == (file_ptr = H5C_get_trace_file_ptr(cache_ptr))) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_trace_file_ptr() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_trace_file_ptr() failed") if((!(config_ptr->close_trace_file)) && (file_ptr != NULL)) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Trace file already open.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Trace file already open") } /* end if */ /* Close & reopen trace file, if requested */ if(config_ptr->close_trace_file) if(H5AC__close_trace_file(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__close_trace_file() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__close_trace_file() failed") if(config_ptr->open_trace_file) if(H5AC__open_trace_file(cache_ptr, config_ptr->trace_file_name) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "H5AC__open_trace_file() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "H5AC__open_trace_file() failed") /* Convert external configuration to internal representation */ if(H5AC__ext_config_2_int_config(config_ptr, &internal_config) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed") /* Set configuration */ if(H5C_set_cache_auto_resize_config(cache_ptr, &internal_config) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_cache_auto_resize_config() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_cache_auto_resize_config() failed") if(H5C_set_evictions_enabled(cache_ptr, config_ptr->evictions_enabled) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_evictions_enabled() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_evictions_enabled() failed") #ifdef H5_HAVE_PARALLEL { @@ -2345,9 +2412,9 @@ H5AC_validate_config(H5AC_cache_config_t *config_ptr) /* Check args */ if(config_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL config_ptr on entry") if(config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown config version.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown config version") /* don't bother to test trace_file_name unless open_trace_file is TRUE */ if(config_ptr->open_trace_file) { @@ -2359,31 +2426,31 @@ H5AC_validate_config(H5AC_cache_config_t *config_ptr) */ name_len = HDstrlen(config_ptr->trace_file_name); if(name_len == 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name is empty.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name is empty") else if(name_len > H5AC__MAX_TRACE_FILE_NAME_LEN) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name too long.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name too long") } /* end if */ if((config_ptr->evictions_enabled == FALSE) && ((config_ptr->incr_mode != H5C_incr__off) || (config_ptr->flash_incr_mode != H5C_flash_incr__off) || (config_ptr->decr_mode != H5C_decr__off))) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Can't disable evictions while auto-resize is enabled.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Can't disable evictions while auto-resize is enabled") if(config_ptr->dirty_bytes_threshold < H5AC__MIN_DIRTY_BYTES_THRESHOLD) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too small.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too small") else if(config_ptr->dirty_bytes_threshold > H5AC__MAX_DIRTY_BYTES_THRESHOLD) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too big.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too big") if((config_ptr->metadata_write_strategy != H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY) && (config_ptr->metadata_write_strategy != H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->metadata_write_strategy out of range.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->metadata_write_strategy out of range") if(H5AC__ext_config_2_int_config(config_ptr, &internal_config) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed") if(H5C_validate_resize_config(&internal_config, H5C_RESIZE_CFG__VALIDATE_ALL) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "error(s) in new config.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "error(s) in new config") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2391,6 +2458,61 @@ done: /*------------------------------------------------------------------------- + * Function: H5AC_validate_cache_image_config() + * + * Purpose: Run a sanity check on the contents of the supplied + * instance of H5AC_cache_image_config_t. + * + * Do nothing and return SUCCEED if no errors are detected, + * and flag an error and return FAIL otherwise. + * + * At present, this function operates by packing the data + * from the instance of H5AC_cache_image_config_t into an + * instance of H5C_cache_image_ctl_t, and then calling + * H5C_validate_cache_image_config(). If and when + * H5AC_cache_image_config_t and H5C_cache_image_ctl_t + * diverge, we may have to change this. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: John Mainzer + * 6/25/15 + * + *------------------------------------------------------------------------- + */ +herr_t +H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr) +{ + H5C_cache_image_ctl_t internal_config = H5C__DEFAULT_CACHE_IMAGE_CTL; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ + if(config_ptr == NULL) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL config_ptr on entry") + + if(config_ptr->version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown image config version") + + /* don't need to get the current H5C image config here since the + * default values of fields not in the H5AC config will always be + * valid. + */ + internal_config.version = config_ptr->version; + internal_config.generate_image = config_ptr->generate_image; + internal_config.save_resize_status = config_ptr->save_resize_status; + internal_config.entry_ageout = config_ptr->entry_ageout; + + if(H5C_validate_cache_image_config(&internal_config) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "error(s) in new cache image config") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_validate_cache_image_config() */ + + +/*------------------------------------------------------------------------- * * Function: H5AC__check_if_write_permitted * @@ -2473,7 +2595,7 @@ H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr, if((ext_conf_ptr == NULL) || (ext_conf_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION) || (int_conf_ptr == NULL)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad ext_conf_ptr or inf_conf_ptr on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad ext_conf_ptr or inf_conf_ptr on entry") int_conf_ptr->version = H5C__CURR_AUTO_SIZE_CTL_VER; if(ext_conf_ptr->rpt_fcn_enabled) @@ -2540,7 +2662,7 @@ H5AC_ignore_tags(const H5F_t *f) /* Set up a new metadata tag */ if(H5C_ignore_tags(f->shared->cache) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "H5C_ignore_tags() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "H5C_ignore_tags() failed") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5ACdbg.c b/src/H5ACdbg.c index 8d99c6f..8ca5102 100644 --- a/src/H5ACdbg.c +++ b/src/H5ACdbg.c @@ -252,6 +252,207 @@ done: /*------------------------------------------------------------------------- * + * Function: H5AC_get_entry_ptr_from_addr() + * + * Purpose: Debugging function that attempts to look up an entry in the + * cache by its file address, and if found, returns a pointer + * to the entry in *entry_ptr_ptr. If the entry is not in the + * cache, *entry_ptr_ptr is set to NULL. + * + * WARNING: This call should be used only in debugging + * routines, and it should be avoided when + * possible. + * + * Further, if we ever multi-thread the cache, + * this routine will have to be either discarded + * or heavily re-worked. + * + * Finally, keep in mind that the entry whose + * pointer is obtained in this fashion may not + * be in a stable state. + * + * Note that this function is only defined if NDEBUG + * is not defined. + * + * As heavy use of this function is almost certainly a + * bad idea, the metadata cache tracks the number of + * successful calls to this function, and (if + * H5C_DO_SANITY_CHECKS is defined) displays any + * non-zero count on cache shutdown. + * + * This function is just a wrapper that calls the H5C + * version of the function. + * + * Return: FAIL if error is detected, SUCCEED otherwise. + * + * Programmer: John Mainzer, 5/30/14 + * + *------------------------------------------------------------------------- + */ +#ifndef NDEBUG +herr_t +H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, void **entry_ptr_ptr) +{ + H5C_t *cache_ptr; /* Ptr to cache */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + cache_ptr = f->shared->cache; + + if(H5C_get_entry_ptr_from_addr(cache_ptr, addr, entry_ptr_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_ptr_from_addr() failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_get_entry_ptr_from_addr() */ +#endif /* NDEBUG */ + + +/*------------------------------------------------------------------------- + * Function: H5AC_flush_dependency_exists() + * + * Purpose: Test to see if a flush dependency relationship exists + * between the supplied parent and child. Both parties + * are indicated by addresses so as to avoid the necessity + * of protect / unprotect calls prior to this call. + * + * If either the parent or the child is not in the metadata + * cache, the function sets *fd_exists_ptr to FALSE. + * + * If both are in the cache, the childs list of parents is + * searched for the proposed parent. If the proposed parent + * is found in the childs parent list, the function sets + * *fd_exists_ptr to TRUE. In all other non-error cases, + * the function sets *fd_exists_ptr FALSE. + * + * Return: SUCCEED on success/FAIL on failure. Note that + * *fd_exists_ptr is undefined on failure. + * + * Programmer: John Mainzer + * 9/28/16 + * + *------------------------------------------------------------------------- + */ +#ifndef NDEBUG +herr_t +H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, + hbool_t *fd_exists_ptr) +{ + H5C_t *cache_ptr; /* Ptr to cache */ + herr_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + cache_ptr = f->shared->cache; + + ret_value = H5C_flush_dependency_exists(cache_ptr, parent_addr, child_addr, fd_exists_ptr); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_flush_dependency_exists() */ +#endif /* NDEBUG */ + + +/*------------------------------------------------------------------------- + * + * Function: H5AC_verify_entry_type() + * + * Purpose: Debugging function that attempts to look up an entry in the + * cache by its file address, and if found, test to see if its + * type field contains the expected value. + * + * If the specified entry is in cache, *in_cache_ptr is set + * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending + * on whether the entries type field matches the + * expected_type parameter + * + * If the target entry is not in cache, *in_cache_ptr is + * set to FALSE, and *type_ok_ptr is undefined. + * + * Note that this function is only defined if NDEBUG + * is not defined. + * + * This function is just a wrapper that calls the H5C + * version of the function. + * + * Return: FAIL if error is detected, SUCCEED otherwise. + * + * Programmer: John Mainzer, 5/30/14 + * + * Changes: None. + * + * JRM -- 9/17/16 + * + *------------------------------------------------------------------------- + */ +#ifndef NDEBUG +herr_t +H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, + const H5AC_class_t *expected_type, hbool_t *in_cache_ptr, + hbool_t *type_ok_ptr) +{ + H5C_t * cache_ptr; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + cache_ptr = f->shared->cache; + + if(H5C_verify_entry_type(cache_ptr, addr, expected_type, in_cache_ptr, type_ok_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_verify_entry_type() failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_verify_entry_type() */ +#endif /* NDEBUG */ + + +/*------------------------------------------------------------------------- + * Function: H5AC_get_serialization_in_progress + * + * Purpose: Return the current value of + * cache_ptr->serialization_in_progress. + * + * Return: Current value of cache_ptr->serialization_in_progress. + * + * Programmer: John Mainzer + * 8/24/15 + * + *------------------------------------------------------------------------- + */ +#ifndef NDEBUG +hbool_t +H5AC_get_serialization_in_progress(H5F_t *f) +{ + H5C_t * cache_ptr; + hbool_t ret_value = FALSE; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + cache_ptr = f->shared->cache; + + /* Set return value */ + ret_value = H5C_get_serialization_in_progress(cache_ptr); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_get_serialization_in_progress() */ +#endif /* NDEBUG */ + + +/*------------------------------------------------------------------------- + * * Function: H5AC_cache_is_clean() * * Purpose: Debugging function that verifies that all rings in the @@ -274,7 +475,7 @@ hbool_t H5AC_cache_is_clean(const H5F_t *f, H5AC_ring_t inner_ring) { H5C_t *cache_ptr; - hbool_t ret_value; /* Return value */ + hbool_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index 44ffd9d..945aaba 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -81,7 +81,7 @@ typedef struct H5AC_addr_list_ud_t { H5AC_aux_t * aux_ptr; /* 'Auxiliary' parallel cache info */ haddr_t * addr_buf_ptr; /* Array to store addresses */ - int i; /* Counter for position in array */ + unsigned u; /* Counter for position in array */ } H5AC_addr_list_ud_t; @@ -90,21 +90,21 @@ typedef struct H5AC_addr_list_ud_t /********************/ static herr_t H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, - int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); + unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); static herr_t H5AC__broadcast_clean_list(H5AC_t *cache_ptr); static herr_t H5AC__construct_candidate_list(H5AC_t *cache_ptr, H5AC_aux_t *aux_ptr, int sync_point_op); static herr_t H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, - int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); + unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); static herr_t H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id); static herr_t H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f, hid_t dxpl_id); -static herr_t H5AC__receive_haddr_list(MPI_Comm mpi_comm, int *num_entries_ptr, +static herr_t H5AC__receive_haddr_list(MPI_Comm mpi_comm, unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); static herr_t H5AC__receive_candidate_list(const H5AC_t *cache_ptr, - int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); + unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); static herr_t H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t dxpl_id); -static herr_t H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, int num_candidates, +static herr_t H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, haddr_t *candidates_list_ptr); static herr_t H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id); static herr_t H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f, hid_t dxpl_id); @@ -151,7 +151,7 @@ H5FL_DEFINE_STATIC(H5AC_slist_entry_t); */ herr_t H5AC__set_sync_point_done_callback(H5C_t * cache_ptr, - void (* sync_point_done)(int num_writes, haddr_t * written_entries_tbl)) + void (* sync_point_done)(unsigned num_writes, haddr_t * written_entries_tbl)) { H5AC_aux_t * aux_ptr; @@ -282,13 +282,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, int *num_entries_ptr, +H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr) { H5AC_aux_t * aux_ptr = NULL; haddr_t * haddr_buf_ptr = NULL; int mpi_result; - int num_entries; + unsigned num_entries; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -310,13 +310,13 @@ H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, int *num_entries_ptr, * receivers can set up buffers to receive them. If there aren't * any, we are done. */ - num_entries = (int)H5SL_count(aux_ptr->candidate_slist_ptr); - if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm))) + num_entries = (unsigned)H5SL_count(aux_ptr->candidate_slist_ptr); + if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_UNSIGNED, 0, aux_ptr->mpi_comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) if(num_entries > 0) { size_t buf_size = 0; - int chk_num_entries = 0; + unsigned chk_num_entries = 0; /* convert the candidate list into the format we * are used to receiving from process 0, and also load it @@ -328,7 +328,7 @@ H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, int *num_entries_ptr, HDassert(haddr_buf_ptr != NULL); /* Now broadcast the list of candidate entries */ - buf_size = sizeof(haddr_t) * (size_t)num_entries; + buf_size = sizeof(haddr_t) * num_entries; if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)haddr_buf_ptr, (int)buf_size, MPI_BYTE, 0, aux_ptr->mpi_comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) } /* end if */ @@ -378,8 +378,8 @@ H5AC__broadcast_clean_list_cb(void *_item, void H5_ATTR_UNUSED *_key, /* Store the entry's address in the buffer */ addr = slist_entry_ptr->addr; - udata->addr_buf_ptr[udata->i] = addr; - udata->i++; + udata->addr_buf_ptr[udata->u] = addr; + udata->u++; /* now release the entry */ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); @@ -420,7 +420,7 @@ H5AC__broadcast_clean_list(H5AC_t * cache_ptr) haddr_t * addr_buf_ptr = NULL; H5AC_aux_t * aux_ptr; int mpi_result; - int num_entries = 0; + unsigned num_entries = 0; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -437,8 +437,8 @@ H5AC__broadcast_clean_list(H5AC_t * cache_ptr) * receives can set up a buffer to receive them. If there aren't * any, we are done. */ - num_entries = (int)H5SL_count(aux_ptr->c_slist_ptr); - if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm))) + num_entries = (unsigned)H5SL_count(aux_ptr->c_slist_ptr); + if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_UNSIGNED, 0, aux_ptr->mpi_comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) if(num_entries > 0) { @@ -446,14 +446,14 @@ H5AC__broadcast_clean_list(H5AC_t * cache_ptr) size_t buf_size; /* allocate a buffer to store the list of entry base addresses in */ - buf_size = sizeof(haddr_t) * (size_t)num_entries; + buf_size = sizeof(haddr_t) * num_entries; if(NULL == (addr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for addr buffer") /* Set up user data for callback */ udata.aux_ptr = aux_ptr; udata.addr_buf_ptr = addr_buf_ptr; - udata.i = 0; + udata.u = 0; /* Free all the clean list entries, building the address list in the callback */ /* (Callback also removes the matching entries from the dirtied list) */ @@ -568,8 +568,8 @@ H5AC__copy_candidate_list_to_buffer_cb(void *_item, void H5_ATTR_UNUSED *_key, HDassert(udata); /* Store the entry's address in the buffer */ - udata->addr_buf_ptr[udata->i] = slist_entry_ptr->addr; - udata->i++; + udata->addr_buf_ptr[udata->u] = slist_entry_ptr->addr; + udata->u++; /* now release the entry */ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); @@ -610,14 +610,14 @@ H5AC__copy_candidate_list_to_buffer_cb(void *_item, void H5_ATTR_UNUSED *_key, *------------------------------------------------------------------------- */ static herr_t -H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, int *num_entries_ptr, +H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr) { H5AC_aux_t * aux_ptr = NULL; H5AC_addr_list_ud_t udata; haddr_t * haddr_buf_ptr = NULL; size_t buf_size; - int num_entries = 0; + unsigned num_entries = 0; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -635,19 +635,19 @@ H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, int *num_entries_pt HDassert(haddr_buf_ptr_ptr != NULL); HDassert(*haddr_buf_ptr_ptr == NULL); - num_entries = (int)H5SL_count(aux_ptr->candidate_slist_ptr); + num_entries = (unsigned)H5SL_count(aux_ptr->candidate_slist_ptr); /* allocate a buffer(s) to store the list of candidate entry * base addresses in */ - buf_size = sizeof(haddr_t) * (size_t)num_entries; + buf_size = sizeof(haddr_t) * num_entries; if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for haddr buffer") /* Set up user data for callback */ udata.aux_ptr = aux_ptr; udata.addr_buf_ptr = haddr_buf_ptr; - udata.i = 0; + udata.u = 0; /* Free all the candidate list entries, building the address list in the callback */ if(H5SL_free(aux_ptr->candidate_slist_ptr, H5AC__copy_candidate_list_to_buffer_cb, &udata) < 0) @@ -1234,7 +1234,7 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id) H5AC_aux_t * aux_ptr; haddr_t * candidates_list_ptr = NULL; int mpi_result; - int num_candidates = 0; + unsigned num_candidates = 0; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1448,12 +1448,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__receive_haddr_list(MPI_Comm mpi_comm, int *num_entries_ptr, +H5AC__receive_haddr_list(MPI_Comm mpi_comm, unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr) { haddr_t * haddr_buf_ptr = NULL; int mpi_result; - int num_entries; + unsigned num_entries; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1468,14 +1468,14 @@ H5AC__receive_haddr_list(MPI_Comm mpi_comm, int *num_entries_ptr, * can set up a buffer to receive them. If there aren't * any, we are done. */ - if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, mpi_comm))) + if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_UNSIGNED, 0, mpi_comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) if(num_entries > 0) { size_t buf_size; /* allocate buffers to store the list of entry base addresses in */ - buf_size = sizeof(haddr_t) * (size_t)num_entries; + buf_size = sizeof(haddr_t) * num_entries; if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for haddr buffer") @@ -1523,7 +1523,7 @@ H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t dxpl_id) H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; haddr_t * haddr_buf_ptr = NULL; - int num_entries = 0; + unsigned num_entries = 0; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1543,7 +1543,7 @@ H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t dxpl_id) if(num_entries > 0) /* mark the indicated entries as clean */ - if(H5C_mark_entries_as_clean(f, dxpl_id, (int32_t)num_entries, haddr_buf_ptr) < 0) + if(H5C_mark_entries_as_clean(f, dxpl_id, num_entries, haddr_buf_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't mark entries clean.") /* if it is defined, call the sync point done callback. Note @@ -1582,7 +1582,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__receive_candidate_list(const H5AC_t *cache_ptr, int *num_entries_ptr, +H5AC__receive_candidate_list(const H5AC_t *cache_ptr, unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr) { H5AC_aux_t * aux_ptr; @@ -1667,7 +1667,7 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id) H5AC_aux_t * aux_ptr; haddr_t * haddr_buf_ptr = NULL; int mpi_result; - int num_entries = 0; + unsigned num_entries = 0; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2224,11 +2224,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, int num_candidates, +H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, haddr_t *candidates_list_ptr) { H5AC_aux_t * aux_ptr; - int i; + unsigned u; FUNC_ENTER_STATIC_NOERR @@ -2249,12 +2249,12 @@ H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, int num_candidates, * cleaned list. However, for this metadata write strategy, * we just want to remove all references to the candidate entries. */ - for(i = 0; i < num_candidates; i++) { + for(u = 0; u < num_candidates; u++) { H5AC_slist_entry_t * d_slist_entry_ptr; H5AC_slist_entry_t * c_slist_entry_ptr; haddr_t addr; - addr = candidates_list_ptr[i]; + addr = candidates_list_ptr[u]; /* addr may be either on the dirtied list, or on the flushed * and still clean list. Remove it. diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index dbbd8a0..77ba0ae 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -351,6 +351,12 @@ H5FL_EXTERN(H5AC_aux_t); * this verification. The field is set to NULL when the * callback is not needed. * + * The following field supports the metadata cache image feature. + * + * p0_image_len: unsiged integer containing the length of the metadata cache + * image constructed by MPI process 0. This field should be 0 + * if the value is unknown, or if cache image is not enabled. + * ****************************************************************************/ #ifdef H5_HAVE_PARALLEL @@ -398,8 +404,11 @@ typedef struct H5AC_aux_t void (* write_done)(void); - void (* sync_point_done)(int num_writes, + void (* sync_point_done)(unsigned num_writes, haddr_t * written_entries_tbl); + + unsigned p0_image_len; + } H5AC_aux_t; /* struct H5AC_aux_t */ #endif /* H5_HAVE_PARALLEL */ @@ -421,7 +430,7 @@ H5_DLL herr_t H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, H5_DLL herr_t H5AC__flush_entries(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5AC__run_sync_point(H5F_t *f, hid_t dxpl_id, int sync_point_op); H5_DLL herr_t H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, - void (*sync_point_done)(int num_writes, haddr_t *written_entries_tbl)); + void (*sync_point_done)(unsigned num_writes, haddr_t *written_entries_tbl)); H5_DLL herr_t H5AC__set_write_done_callback(H5C_t * cache_ptr, void (* write_done)(void)); #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 3dd6079..1fe6456 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -88,7 +88,7 @@ typedef enum { H5AC_DRVRINFO_ID, /* (26) driver info block (supplements superblock) */ H5AC_EPOCH_MARKER_ID, /* (27) epoch marker - always internal to cache */ H5AC_PROXY_ENTRY_ID, /* (28) cache entry proxy */ - H5AC_TEST_ID, /* (29) test entry -- not used for actual files */ + H5AC_PREFETCHED_ENTRY_ID, /* (29) prefetched entry - always internal to cache */ H5AC_NTYPES /* Number of types, must be last */ } H5AC_type_t; @@ -111,14 +111,22 @@ typedef enum { * use the dump_stats parameter to takedown_cache(), or call * H5C_stats() directly. * JRM -- 4/12/15 + * + * Added the H5AC_DUMP_IMAGE_STATS_ON_CLOSE #define, which works much + * the same way as H5AC_DUMP_STATS_ON_CLOSE. However, the set of stats + * displayed is much smaller, and directed purely at the cache image feature. + * + * JRM -- 11/1/15 */ #if H5C_COLLECT_CACHE_STATS #define H5AC_DUMP_STATS_ON_CLOSE 0 +#define H5AC_DUMP_IMAGE_STATS_ON_CLOSE 0 #else /* H5C_COLLECT_CACHE_STATS */ #define H5AC_DUMP_STATS_ON_CLOSE 0 +#define H5AC_DUMP_IMAGE_STATS_ON_CLOSE 0 #endif /* H5C_COLLECT_CACHE_STATS */ @@ -319,7 +327,13 @@ H5_DLLVAR hid_t H5AC_rawdata_dxpl_id; } #endif /* H5_HAVE_PARALLEL */ - +#define H5AC__DEFAULT_CACHE_IMAGE_CONFIG \ +{ \ + /* int32_t version = */ H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, \ + /* hbool_t generate_image = */ FALSE, \ + /* hbool_t save_resize_status = */ FALSE, \ + /* int32_t entry_ageout = */ H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE \ +} /* * Library prototypes. */ @@ -344,7 +358,6 @@ H5_DLLVAR hid_t H5AC_rawdata_dxpl_id; #define H5AC__TAKE_OWNERSHIP_FLAG H5C__TAKE_OWNERSHIP_FLAG #define H5AC__FLUSH_LAST_FLAG H5C__FLUSH_LAST_FLAG #define H5AC__FLUSH_COLLECTIVELY_FLAG H5C__FLUSH_COLLECTIVELY_FLAG -#define H5AC__EVICT_ALLOW_LAST_PINS_FLAG H5C__EVICT_ALLOW_LAST_PINS_FLAG /* #defines of flags used to report entry status in the @@ -360,11 +373,44 @@ H5_DLLVAR hid_t H5AC_rawdata_dxpl_id; #define H5AC_ES__IS_CORKED 0x0040 #define H5AC_ES__IMAGE_IS_UP_TO_DATE 0x0080 +/* Metadata entry class declarations */ +H5_DLLVAR const H5AC_class_t H5AC_BT[1]; +H5_DLLVAR const H5AC_class_t H5AC_SNODE[1]; +H5_DLLVAR const H5AC_class_t H5AC_LHEAP_PRFX[1]; +H5_DLLVAR const H5AC_class_t H5AC_LHEAP_DBLK[1]; +H5_DLLVAR const H5AC_class_t H5AC_GHEAP[1]; +H5_DLLVAR const H5AC_class_t H5AC_OHDR[1]; +H5_DLLVAR const H5AC_class_t H5AC_OHDR_CHK[1]; +H5_DLLVAR const H5AC_class_t H5AC_BT2_HDR[1]; +H5_DLLVAR const H5AC_class_t H5AC_BT2_INT[1]; +H5_DLLVAR const H5AC_class_t H5AC_BT2_LEAF[1]; +H5_DLLVAR const H5AC_class_t H5AC_FHEAP_HDR[1]; +H5_DLLVAR const H5AC_class_t H5AC_FHEAP_DBLOCK[1]; +H5_DLLVAR const H5AC_class_t H5AC_FHEAP_IBLOCK[1]; +H5_DLLVAR const H5AC_class_t H5AC_FSPACE_HDR[1]; +H5_DLLVAR const H5AC_class_t H5AC_FSPACE_SINFO[1]; +H5_DLLVAR const H5AC_class_t H5AC_SOHM_TABLE[1]; +H5_DLLVAR const H5AC_class_t H5AC_SOHM_LIST[1]; +H5_DLLVAR const H5AC_class_t H5AC_EARRAY_HDR[1]; +H5_DLLVAR const H5AC_class_t H5AC_EARRAY_IBLOCK[1]; +H5_DLLVAR const H5AC_class_t H5AC_EARRAY_SBLOCK[1]; +H5_DLLVAR const H5AC_class_t H5AC_EARRAY_DBLOCK[1]; +H5_DLLVAR const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1]; +H5_DLLVAR const H5AC_class_t H5AC_FARRAY_HDR[1]; +H5_DLLVAR const H5AC_class_t H5AC_FARRAY_DBLOCK[1]; +H5_DLLVAR const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1]; +H5_DLLVAR const H5AC_class_t H5AC_SUPERBLOCK[1]; +H5_DLLVAR const H5AC_class_t H5AC_DRVRINFO[1]; +H5_DLLVAR const H5AC_class_t H5AC_EPOCH_MARKER[1]; +H5_DLLVAR const H5AC_class_t H5AC_PROXY_ENTRY[1]; +H5_DLLVAR const H5AC_class_t H5AC_PREFETCHED_ENTRY[1]; + /* external function declarations: */ H5_DLL herr_t H5AC_init(void); -H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr); +H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, + H5AC_cache_image_config_t * image_config_ptr); H5_DLL herr_t H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status_ptr); H5_DLL herr_t H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, @@ -394,13 +440,18 @@ H5_DLL herr_t H5AC_remove_entry(void *entry); H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr, H5AC_cache_config_t *config_ptr); H5_DLL herr_t H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, - size_t *min_clean_size_ptr, size_t *cur_size_ptr, int32_t *cur_num_entries_ptr); + size_t *min_clean_size_ptr, size_t *cur_size_ptr, uint32_t *cur_num_entries_ptr); H5_DLL herr_t H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr); H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t *cache_ptr); H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr); H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr); +/* Cache image routines */ +H5_DLL herr_t H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, + hsize_t len, hbool_t rw); +H5_DLL herr_t H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr); + /* Tag & Ring routines */ H5_DLL herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag); H5_DLL herr_t H5AC_flush_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hid_t dxpl_id); @@ -433,6 +484,14 @@ H5_DLL herr_t H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr); H5_DLL herr_t H5AC_stats(const H5F_t *f); H5_DLL herr_t H5AC_dump_cache(const H5F_t *f); #ifndef NDEBUG +H5_DLL herr_t H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, + void **entry_ptr_ptr); +H5_DLL herr_t H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, + haddr_t child_addr, hbool_t *fd_exists_ptr); +H5_DLL herr_t H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, + const H5AC_class_t *expected_type, hbool_t *in_cache_ptr, + hbool_t *type_ok_ptr); +H5_DLL hbool_t H5AC_get_serialization_in_progress(H5F_t *f); H5_DLL hbool_t H5AC_cache_is_clean(const H5F_t *f, H5AC_ring_t inner_ring); #endif /* NDEBUG */ /* end debugging functions */ diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index dd16764..5fdb3f4 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -508,6 +508,67 @@ typedef struct H5AC_cache_config_t } H5AC_cache_config_t; +/**************************************************************************** + * + * structure H5AC_cache_image_config_t + * + * H5AC_cache_image_ctl_t is a public structure intended for use in public + * APIs. At least in its initial incarnation, it is a copy of struct + * H5C_cache_image_ctl_t. + * + * The fields of the structure are discussed individually below: + * + * version: Integer field containing the version number of this version + * of the H5C_image_ctl_t structure. Any instance of + * H5C_image_ctl_t passed to the cache must have a known + * version number, or an error will be flagged. + * + * generate_image: Boolean flag indicating whether a cache image should + * be created on file close. + * + * save_resize_status: Boolean flag indicating whether the cache image + * should include the adaptive cache resize configuration and status. + * Note that this field is ignored at present. + * + * entry_ageout: Integer field indicating the maximum number of + * times a prefetched entry can appear in subsequent cache images. + * This field exists to allow the user to avoid the buildup of + * infrequently used entries in long sequences of cache images. + * + * The value of this field must lie in the range + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100). + * + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit + * is imposed on number of times a prefeteched entry can appear + * in subsequent cache images. + * + * A value of 0 prevents prefetched entries from being included + * in cache images. + * + * Positive integers restrict prefetched entries to the specified + * number of appearances. + * + * Note that the number of subsequent cache images that a prefetched + * entry has appeared in is tracked in an 8 bit field. Thus, while + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its + * current value, any value in excess of 255 will be the functional + * equivalent of H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE. + * + ****************************************************************************/ + +#define H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION 1 + +#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE -1 +#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX 100 + +typedef struct H5AC_cache_image_config_t { + int32_t version; + hbool_t generate_image; + hbool_t save_resize_status; + int32_t entry_ageout; +} H5AC_cache_image_config_t; + #ifdef __cplusplus } #endif diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 7b1ec4d..71fdfde 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -307,15 +307,6 @@ typedef struct H5B2_node_info_test_t { /* Package Private Variables */ /*****************************/ -/* H5B2 header inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_BT2_HDR[1]; - -/* H5B2 internal node inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_BT2_INT[1]; - -/* H5B2 leaf node inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_BT2_LEAF[1]; - /* Declare a free list to manage the H5B2_internal_t struct */ H5FL_EXTERN(H5B2_internal_t); diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index 41e0951..fb93b8a 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -73,9 +73,6 @@ typedef struct H5B_cache_ud_t { /* Package Private Variables */ /*****************************/ -/* H5B header inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_BT[1]; - /* Declare a free list to manage the haddr_t sequence information */ H5FL_SEQ_EXTERN(haddr_t); diff --git a/src/H5C.c b/src/H5C.c index 4adee6d..805b4f5 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -46,9 +46,9 @@ * - Change protect/unprotect to lock/unlock. * * - Flush entries in increasing address order in - * H5C_make_space_in_cache(). + * H5C__make_space_in_cache(). * - * - Also in H5C_make_space_in_cache(), use high and low water marks + * - Also in H5C__make_space_in_cache(), use high and low water marks * to reduce the number of I/O calls. * * - When flushing, attempt to combine contiguous entries to reduce @@ -75,7 +75,7 @@ /****************/ #include "H5Cmodule.h" /* This source code file is part of the H5C module */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /* suppress error about including H5Fpkg */ /***********/ @@ -155,21 +155,17 @@ static void * H5C_load_entry(H5F_t * f, haddr_t addr, void * udata); -static herr_t H5C_make_space_in_cache(H5F_t * f, - hid_t dxpl_id, - size_t space_needed, - hbool_t write_permitted); - static herr_t H5C__mark_flush_dep_dirty(H5C_cache_entry_t * entry); static herr_t H5C__mark_flush_dep_clean(H5C_cache_entry_t * entry); +static herr_t H5C__serialize_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring); +static herr_t H5C__serialize_single_entry(H5F_t *f, hid_t dxpl_id, + H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr); + static herr_t H5C__verify_len_eoa(H5F_t *f, const H5C_class_t * type, haddr_t addr, size_t *len, hbool_t actual); -static herr_t H5C__generate_image(H5F_t *f, H5C_t * cache_ptr, H5C_cache_entry_t *entry_ptr, - hid_t dxpl_id); - #if H5C_DO_SLIST_SANITY_CHECKS static hbool_t H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr); @@ -243,7 +239,7 @@ H5C_t * H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, - const char * (* type_name_table_ptr), + const H5C_class_t * const * class_table_ptr, H5C_write_permitted_func_t check_write_permitted, hbool_t write_permitted, H5C_log_flush_func_t log_flush, @@ -261,21 +257,21 @@ H5C_create(size_t max_cache_size, HDassert( max_type_id >= 0 ); HDassert( max_type_id < H5C__MAX_NUM_TYPE_IDS ); - HDassert( type_name_table_ptr ); + HDassert( class_table_ptr ); for ( i = 0; i <= max_type_id; i++ ) { - HDassert( (type_name_table_ptr)[i] ); - HDassert( HDstrlen(( type_name_table_ptr)[i]) > 0 ); + HDassert( (class_table_ptr)[i] ); + HDassert(HDstrlen((class_table_ptr)[i]->name) > 0); } /* end for */ if(NULL == (cache_ptr = H5FL_CALLOC(H5C_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if(NULL == (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list") if(NULL == (cache_ptr->tag_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list for tagged entry addresses.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list for tagged entry addresses") /* If we get this far, we should succeed. Go ahead and initialize all * the fields. @@ -297,7 +293,7 @@ H5C_create(size_t max_cache_size, cache_ptr->max_type_id = max_type_id; - cache_ptr->type_name_table_ptr = type_name_table_ptr; + cache_ptr->class_table_ptr = class_table_ptr; cache_ptr->max_cache_size = max_cache_size; cache_ptr->min_clean_size = min_clean_size; @@ -389,6 +385,7 @@ H5C_create(size_t max_cache_size, cache_ptr->resize_enabled = FALSE; cache_ptr->cache_full = FALSE; cache_ptr->size_decreased = FALSE; + cache_ptr->resize_in_progress = FALSE; (cache_ptr->resize_ctl).version = H5C__CURR_AUTO_SIZE_CTL_VER; (cache_ptr->resize_ctl).rpt_fcn = NULL; @@ -434,28 +431,52 @@ H5C_create(size_t max_cache_size, ((cache_ptr->epoch_markers)[i]).magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; ((cache_ptr->epoch_markers)[i]).addr = (haddr_t)i; - ((cache_ptr->epoch_markers)[i]).type = &H5C__epoch_marker_class; + ((cache_ptr->epoch_markers)[i]).type = H5AC_EPOCH_MARKER; } + /* Initialize cache image generation on file close related fields. + * Initial value of image_ctl must match H5C__DEFAULT_CACHE_IMAGE_CTL + * in H5Cprivate.h. + */ + cache_ptr->image_ctl.version = H5C__CURR_CACHE_IMAGE_CTL_VER; + cache_ptr->image_ctl.generate_image = FALSE; + cache_ptr->image_ctl.save_resize_status = FALSE; + cache_ptr->image_ctl.entry_ageout = -1; + cache_ptr->image_ctl.flags = H5C_CI__ALL_FLAGS; + + cache_ptr->serialization_in_progress= FALSE; + cache_ptr->load_image = FALSE; + cache_ptr->image_loaded = FALSE; + cache_ptr->delete_image = FALSE; + cache_ptr->image_addr = HADDR_UNDEF; + cache_ptr->image_len = 0; + cache_ptr->image_data_len = 0; + cache_ptr->entries_loaded_counter = 0; cache_ptr->entries_inserted_counter = 0; cache_ptr->entries_relocated_counter = 0; + cache_ptr->entry_fd_height_change_counter = 0; + + cache_ptr->num_entries_in_image = 0; + cache_ptr->image_entries = NULL; + cache_ptr->image_buffer = NULL; /* initialize free space manager related fields: */ cache_ptr->rdfsm_settled = FALSE; cache_ptr->mdfsm_settled = FALSE; - if ( H5C_reset_cache_hit_rate_stats(cache_ptr) != SUCCEED ) { - + if(H5C_reset_cache_hit_rate_stats(cache_ptr) < 0) /* this should be impossible... */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, \ - "H5C_reset_cache_hit_rate_stats failed.") - } + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "H5C_reset_cache_hit_rate_stats failed") H5C_stats__reset(cache_ptr); cache_ptr->prefix[0] = '\0'; /* empty string */ +#ifndef NDEBUG + cache_ptr->get_entry_ptr_from_addr_counter = 0; +#endif /* NDEBUG */ + /* Set return value */ ret_value = cache_ptr; @@ -733,6 +754,11 @@ H5C_prep_for_file_close(H5F_t *f, hid_t dxpl_id) /* Make certain there aren't any protected entries */ HDassert(cache_ptr->pl_len == 0); + /* Prepare cache image */ + if(H5C__prep_image_for_file_close(f, dxpl_id) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cache image") + + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_prep_for_file_close() */ @@ -775,10 +801,20 @@ H5C_dest(H5F_t * f, hid_t dxpl_id) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(cache_ptr->close_warning_received); +#if H5AC_DUMP_IMAGE_STATS_ON_CLOSE + if(H5C_image_stats(cache_ptr, TRUE) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't display cache image stats") +#endif /* H5AC_DUMP_IMAGE_STATS_ON_CLOSE */ + /* Flush and invalidate all cache entries */ if(H5C_flush_invalidate_cache(f, dxpl_id, H5C__NO_FLAGS_SET) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") + /* Generate & write cache image if requested */ + if(cache_ptr->image_ctl.generate_image) + if(H5C__generate_cache_image(f, dxpl_id, cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "Can't generate metadata cache image") + if(cache_ptr->slist_ptr != NULL) { H5SL_close(cache_ptr->slist_ptr); cache_ptr->slist_ptr = NULL; @@ -790,6 +826,12 @@ H5C_dest(H5F_t * f, hid_t dxpl_id) } /* end if */ #ifndef NDEBUG +#if H5C_DO_SANITY_CHECKS + if(cache_ptr->get_entry_ptr_from_addr_counter > 0) + HDfprintf(stdout, "*** %ld calls to H5C_get_entry_ptr_from_add(). ***\n", + cache_ptr->get_entry_ptr_from_addr_counter); +#endif /* H5C_DO_SANITY_CHECKS */ + cache_ptr->magic = 0; #endif /* NDEBUG */ @@ -815,14 +857,12 @@ done: herr_t H5C_evict(H5F_t * f, hid_t dxpl_id) { - H5C_t *cache_ptr = f->shared->cache; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(f); /* Flush and invalidate all cache entries except the pinned entries */ if(H5C_flush_invalidate_cache(f, dxpl_id, H5C__EVICT_ALLOW_LAST_PINS_FLAG) < 0 ) @@ -868,7 +908,7 @@ H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, #if H5C_DO_EXTREME_SANITY_CHECKS if(H5C_validate_lru_list(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on entry.\n") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /* Look for entry in cache */ @@ -882,9 +922,9 @@ H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, /* Check for entry being pinned or protected */ if(entry_ptr->is_protected) - HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "Target entry is protected.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "Target entry is protected") if(entry_ptr->is_pinned) - HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "Target entry is pinned.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "Target entry is pinned") #ifdef H5_HAVE_PARALLEL if(entry_ptr->coll_access) { entry_ptr->coll_access = FALSE; @@ -909,7 +949,7 @@ H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, done: #if H5C_DO_EXTREME_SANITY_CHECKS if(H5C_validate_lru_list(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on exit.\n") + HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) @@ -968,12 +1008,12 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) { #if H5C_DO_SANITY_CHECKS int i; - int32_t index_len = 0; + uint32_t index_len = 0; size_t index_size = (size_t)0; size_t clean_index_size = (size_t)0; size_t dirty_index_size = (size_t)0; size_t slist_size = (size_t)0; - int32_t slist_len = 0; + uint32_t slist_len = 0; #endif /* H5C_DO_SANITY_CHECKS */ H5C_ring_t ring; H5C_t * cache_ptr; @@ -1020,7 +1060,7 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) if((H5C_validate_protected_entry_list(cache_ptr) < 0) || (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry.\n") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ ignore_protected = ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 ); @@ -1032,7 +1072,7 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) if(destroy) { if(H5C_flush_invalidate_cache(f, dxpl_id, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate failed") } /* end if */ else { /* flush each ring, starting from the outermost ring and @@ -1040,9 +1080,9 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) */ ring = H5C_RING_USER; while(ring < H5C_RING_NTYPES) { - /* only call the free space manager settle routines when close - * warning has been received, and then only when the index is - * non-empty for that ring. + + /* Only call the free space manager settle routines when close + * warning has been received. */ if(cache_ptr->close_warning_received) { switch(ring) { @@ -1050,36 +1090,20 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) break; case H5C_RING_RDFSM: - if(!cache_ptr->rdfsm_settled) { - hbool_t fsm_settled = FALSE; /* Whether the FSM was actually settled */ - - /* Settle raw data FSM */ - if(H5MF_settle_raw_data_fsm(f, dxpl_id, &fsm_settled) < 0) + /* Settle raw data FSM */ + if(!cache_ptr->rdfsm_settled) + if(H5MF_settle_raw_data_fsm(f, dxpl_id, &cache_ptr->rdfsm_settled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "RD FSM settle failed") - - /* Only set the flag if the FSM was actually settled */ - if(fsm_settled) - cache_ptr->rdfsm_settled = TRUE; - } /* end if */ break; case H5C_RING_MDFSM: - if(!cache_ptr->mdfsm_settled) { - hbool_t fsm_settled = FALSE; /* Whether the FSM was actually settled */ - - /* Settle metadata FSM */ - if(H5MF_settle_meta_data_fsm(f, dxpl_id, &fsm_settled) < 0) + /* Settle metadata FSM */ + if(!cache_ptr->mdfsm_settled) + if(H5MF_settle_meta_data_fsm(f, dxpl_id, &cache_ptr->mdfsm_settled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "MD FSM settle failed") - - /* Only set the flag if the FSM was actually settled */ - if(fsm_settled) - cache_ptr->mdfsm_settled = TRUE; - } /* end if */ break; case H5C_RING_SBE: - break; - case H5C_RING_SB: break; @@ -1090,7 +1114,7 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) } /* end if */ if(H5C_flush_ring(f, dxpl_id, ring, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush ring failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush ring failed") ring++; } /* end while */ } /* end else */ @@ -1131,7 +1155,6 @@ H5C_flush_to_min_clean(H5F_t * f, hid_t dxpl_id) { H5C_t * cache_ptr; - herr_t result; hbool_t write_permitted; #if 0 /* modified code -- commented out for now */ /* JRM */ int i; @@ -1153,36 +1176,19 @@ H5C_flush_to_min_clean(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - if ( cache_ptr->check_write_permitted != NULL ) { - - result = (cache_ptr->check_write_permitted)(f, &write_permitted); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Can't get write_permitted") - } - } else { - + if(cache_ptr->check_write_permitted != NULL) { + if((cache_ptr->check_write_permitted)(f, &write_permitted) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't get write_permitted") + } /* end if */ + else write_permitted = cache_ptr->write_permitted; - } - if ( ! write_permitted ) { + if(!write_permitted) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cache write is not permitted!?!") - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "cache write is not permitted!?!\n"); - } #if 1 /* original code */ - result = H5C_make_space_in_cache(f, - dxpl_id, - (size_t)0, - write_permitted); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_make_space_in_cache failed.") - } + if(H5C__make_space_in_cache(f, dxpl_id, (size_t)0, write_permitted) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C__make_space_in_cache failed") #else /* modified code -- commented out for now */ if ( cache_ptr->max_cache_size > cache_ptr->index_size ) { @@ -1220,12 +1226,8 @@ H5C_flush_to_min_clean(H5F_t * f, */ flushed_entries_list = (haddr_t *)H5MM_malloc(sizeof(haddr_t) * (size_t)(cache_ptr->slist_len)); - - if ( flushed_entries_list == NULL ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \ - "memory allocation failed for flushed entries list") - } + if(flushed_entries_list == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for flushed entries list") /* Scan the dirty LRU list from tail forward and mark sufficient * entries to free up the necessary space. Keep a list of the @@ -1255,13 +1257,8 @@ H5C_flush_to_min_clean(H5F_t * f, /* Flush the marked entries */ - result = H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, - H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_flush_cache failed.") - } + if(H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_flush_cache failed") /* Now touch up the LRU list so as to place the flushed entries in * the order they they would be in if we had flushed them in the @@ -1336,8 +1333,9 @@ H5C_insert_entry(H5F_t * f, hbool_t set_flush_marker; hbool_t write_permitted = TRUE; size_t empty_space; - H5C_cache_entry_t *entry_ptr; + H5C_cache_entry_t *entry_ptr = NULL; H5C_cache_entry_t *test_entry_ptr; + hbool_t entry_tagged = FALSE; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1350,6 +1348,7 @@ H5C_insert_entry(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( type ); + HDassert( type->mem_type == cache_ptr->class_table_ptr[type->id]->mem_type ); HDassert( type->image_len ); HDassert( H5F_addr_defined(addr) ); HDassert( thing ); @@ -1357,14 +1356,10 @@ H5C_insert_entry(H5F_t * f, #if H5C_DO_EXTREME_SANITY_CHECKS /* no need to verify that entry is not already in the index as */ /* we already make that check below. */ - - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "an extreme sanity check failed on entry.\n"); - } + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0) || + (H5C_validate_lru_list(cache_ptr) < 0)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ set_flush_marker = ( (flags & H5C__SET_FLUSH_MARKER_FLAG) != 0 ); @@ -1389,9 +1384,9 @@ H5C_insert_entry(H5F_t * f, if(test_entry_ptr != NULL) { if(test_entry_ptr == entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "entry already in cache.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "entry already in cache") else - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "duplicate entry in cache.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "duplicate entry in cache") } /* end if */ entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; @@ -1458,16 +1453,33 @@ H5C_insert_entry(H5F_t * f, entry_ptr->coll_prev = NULL; #endif /* H5_HAVE_PARALLEL */ + /* initialize cache image related fields */ + entry_ptr->include_in_image = FALSE; + entry_ptr->lru_rank = 0; + entry_ptr->image_dirty = FALSE; + entry_ptr->fd_parent_count = 0; + entry_ptr->fd_parent_addrs = NULL; + entry_ptr->fd_child_count = 0; + entry_ptr->fd_dirty_child_count = 0; + entry_ptr->image_fd_height = 0; + entry_ptr->prefetched = FALSE; + entry_ptr->prefetch_type_id = 0; + entry_ptr->age = 0; +#ifndef NDEBUG /* debugging field */ + entry_ptr->serialization_count = 0; +#endif /* NDEBUG */ + /* Apply tag to newly inserted entry */ if(H5C__tag_entry(cache_ptr, entry_ptr, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Cannot tag metadata entry") + entry_tagged = TRUE; H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) if(cache_ptr->flash_size_increase_possible && (entry_ptr->size > cache_ptr->flash_size_increase_threshold)) if(H5C__flash_increase_cache_size(cache_ptr, 0, entry_ptr->size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C__flash_increase_cache_size failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C__flash_increase_cache_size failed") if(cache_ptr->index_size >= cache_ptr->max_cache_size) empty_space = 0; @@ -1497,7 +1509,7 @@ H5C_insert_entry(H5F_t * f, /* Note that space_needed is just the amount of space that * needed to insert the new entry without exceeding the cache - * size limit. The subsequent call to H5C_make_space_in_cache() + * size limit. The subsequent call to H5C__make_space_in_cache() * may evict the entries required to free more or less space * depending on conditions. It MAY be less if the cache is * currently undersized, or more if the cache is oversized. @@ -1520,9 +1532,9 @@ H5C_insert_entry(H5F_t * f, * no point in worrying about the third. */ - if(H5C_make_space_in_cache(f, dxpl_id, space_needed, write_permitted) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C_make_space_in_cache failed.") - } + if(H5C__make_space_in_cache(f, dxpl_id, space_needed, write_permitted) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C__make_space_in_cache failed") + } /* end if */ H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL) @@ -1533,10 +1545,10 @@ H5C_insert_entry(H5F_t * f, H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, FAIL) #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed just before done.\n") + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0) || + (H5C_validate_lru_list(cache_ptr) < 0)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed just before done") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /* If the entry's type has a 'notify' callback send a 'after insertion' @@ -1588,12 +1600,16 @@ H5C_insert_entry(H5F_t * f, done: #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit.\n") + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0) || + (H5C_validate_lru_list(cache_ptr) < 0)) + HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ + if(ret_value < 0 && entry_tagged) + if(H5C__untag_entry(cache_ptr, entry_ptr) < 0) + HDONE_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove entry from tag list") + FUNC_LEAVE_NOAPI(ret_value) } /* H5C_insert_entry() */ @@ -1915,7 +1931,7 @@ H5C_move_entry(H5C_t * cache_ptr, if((H5C_validate_protected_entry_list(cache_ptr) < 0) || (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry.\n") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ H5C__SEARCH_INDEX(cache_ptr, old_addr, entry_ptr, FAIL) @@ -2019,7 +2035,7 @@ done: if((H5C_validate_protected_entry_list(cache_ptr) < 0) || (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit.\n") + HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) @@ -2060,17 +2076,14 @@ H5C_resize_entry(void *thing, size_t new_size) /* Check for usage errors */ if(new_size <= 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "New size is non-positive.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "New size is non-positive") if(!(entry_ptr->is_pinned || entry_ptr->is_protected)) HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "Entry isn't pinned or protected??") #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "an extreme sanity check failed on entry.\n"); - } + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /* update for change in entry size if necessary */ @@ -2167,14 +2180,10 @@ H5C_resize_entry(void *thing, size_t new_size) } /* end if */ done: - #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "an extreme sanity check failed on exit.\n"); - } + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0)) + HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) @@ -2270,13 +2279,10 @@ H5C_pin_protected_entry(void *thing) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "an extreme sanity check failed on entry.\n"); - } + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0) || + (H5C_validate_lru_list(cache_ptr) < 0)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2289,15 +2295,11 @@ H5C_pin_protected_entry(void *thing) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") done: - #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "an extreme sanity check failed on exit.\n"); - } + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0) || + (H5C_validate_lru_list(cache_ptr) < 0)) + HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) @@ -2324,32 +2326,6 @@ done: * * Programmer: John Mainzer - 6/2/04 * - * JRM -- 11/13/08 - * Modified function to call H5C_make_space_in_cache() when - * the min_clean_size is violated, not just when there isn't - * enough space for and entry that has just been loaded. - * - * The purpose of this modification is to avoid "metadata - * blizzards" in the write only case. In such instances, - * the cache was allowed to fill with dirty metadata. When - * we finally needed to evict an entry to make space, we had - * to flush out a whole cache full of metadata -- which has - * interesting performance effects. We hope to avoid (or - * perhaps more accurately hide) this effect by maintaining - * the min_clean_size, which should force us to start flushing - * entries long before we actually have to evict something - * to make space. - * - * JRM -- 9/1/14 - * Replace the old rw parameter with the flags parameter. - * This allows H5C_protect to accept flags other than - * H5C__READ_ONLY_FLAG. - * - * Added support for the H5C__FLUSH_LAST_FLAG. - * At present, this flag is only applied if the entry is - * not in cache, and is loaded into the cache as a result of - * this call. - * *------------------------------------------------------------------------- */ void * @@ -2388,17 +2364,23 @@ H5C_protect(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( type ); + HDassert( type->mem_type == cache_ptr->class_table_ptr[type->id]->mem_type ); HDassert( H5F_addr_defined(addr) ); #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on entry.\n") - } + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0) || + (H5C_validate_lru_list(cache_ptr) < 0)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ + /* Load the cache image, if requested */ + if(cache_ptr->load_image) { + cache_ptr->load_image = FALSE; + if(H5C__load_cache_image(f, dxpl_id) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "Can't load cache image") + } /* end if */ + read_only = ( (flags & H5C__READ_ONLY_FLAG) != 0 ); flush_last = ( (flags & H5C__FLUSH_LAST_FLAG) != 0 ); @@ -2428,9 +2410,24 @@ H5C_protect(H5F_t * f, /* first check to see if the target is in cache */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, NULL) - if ( entry_ptr != NULL ) { + if(entry_ptr != NULL) { if(entry_ptr->ring != ring) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "ring type mismatch occured for cache entry\n") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "ring type mismatch occured for cache entry") + + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + + if(entry_ptr->prefetched) { + /* This call removes the prefetched entry from the cache, + * and replaces it with an entry deserialized from the + * image of the prefetched entry. + */ + if(H5C__deserialize_prefetched_entry(f, dxpl_id, cache_ptr, &entry_ptr, type, addr, udata) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "can't deserialize prefetched entry") + + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(!entry_ptr->prefetched); + HDassert(entry_ptr->addr == addr); + } /* end if */ /* Check for trying to load the wrong type of entry from an address */ if(entry_ptr->type != type) @@ -2523,6 +2520,8 @@ H5C_protect(H5F_t * f, HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "can't load entry") entry_ptr = (H5C_cache_entry_t *)thing; + cache_ptr->entries_loaded_counter++; + entry_ptr->ring = ring; #ifdef H5_HAVE_PARALLEL if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI) && entry_ptr->coll_access) @@ -2540,7 +2539,7 @@ H5C_protect(H5F_t * f, ( entry_ptr->size > cache_ptr->flash_size_increase_threshold ) ) { if(H5C__flash_increase_cache_size(cache_ptr, 0, entry_ptr->size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__flash_increase_cache_size failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__flash_increase_cache_size failed") } if(cache_ptr->index_size >= cache_ptr->max_cache_size) @@ -2549,7 +2548,7 @@ H5C_protect(H5F_t * f, empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; /* try to free up if necceary and if evictions are permitted. Note - * that if evictions are enabled, we will call H5C_make_space_in_cache() + * that if evictions are enabled, we will call H5C__make_space_in_cache() * regardless if the min_free_space requirement is not met. */ if ( ( cache_ptr->evictions_enabled ) && @@ -2584,7 +2583,7 @@ H5C_protect(H5F_t * f, /* Note that space_needed is just the amount of space that * needed to insert the new entry without exceeding the cache - * size limit. The subsequent call to H5C_make_space_in_cache() + * size limit. The subsequent call to H5C__make_space_in_cache() * may evict the entries required to free more or less space * depending on conditions. It MAY be less if the cache is * currently undersized, or more if the cache is oversized. @@ -2611,9 +2610,9 @@ H5C_protect(H5F_t * f, * see no point in worrying about the fourth. */ - if(H5C_make_space_in_cache(f, dxpl_id, space_needed, write_permitted) < 0 ) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_make_space_in_cache failed 1.") - } + if(H5C__make_space_in_cache(f, dxpl_id, space_needed, write_permitted) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__make_space_in_cache failed") + } /* end if */ /* Insert the entry in the hash table. It can't be dirty yet, so * we don't even check to see if it should go in the skip list. @@ -2648,44 +2647,34 @@ H5C_protect(H5F_t * f, */ H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, NULL) - /* Update entries loaded in cache counter */ - cache_ptr->entries_loaded_counter++; - /* Record that the entry was loaded, to trigger a notify callback later */ /* (After the entry is fully added to the cache) */ was_loaded = TRUE; - } - - HDassert( entry_ptr->addr == addr ); - HDassert( entry_ptr->type == type ); - - if ( entry_ptr->is_protected ) { - - if ( ( read_only ) && ( entry_ptr->is_read_only ) ) { + } /* end else */ - HDassert( entry_ptr->ro_ref_count > 0 ); + HDassert(entry_ptr->addr == addr); + HDassert(entry_ptr->type == type); + if(entry_ptr->is_protected) { + if(read_only && entry_ptr->is_read_only) { + HDassert(entry_ptr->ro_ref_count > 0); (entry_ptr->ro_ref_count)++; - - } else { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, \ - "Target already protected & not read only?!?.") - } - } else { - + } /* end if */ + else + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Target already protected & not read only?!?") + } /* end if */ + else { H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, NULL) entry_ptr->is_protected = TRUE; if ( read_only ) { - entry_ptr->is_read_only = TRUE; entry_ptr->ro_ref_count = 1; - } + } /* end if */ entry_ptr->dirtied = FALSE; - } + } /* end else */ H5C__UPDATE_CACHE_HIT_RATE_STATS(cache_ptr, hit) @@ -2703,7 +2692,7 @@ H5C_protect(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { if((cache_ptr->check_write_permitted)(f, &write_permitted) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Can't get write_permitted 2") + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Can't get write_permitted") else have_write_permitted = TRUE; } else { @@ -2715,16 +2704,14 @@ H5C_protect(H5F_t * f, } } - if ( ( cache_ptr->resize_enabled ) && - ( cache_ptr->cache_accesses >= - (cache_ptr->resize_ctl).epoch_length ) ) { + if(cache_ptr->resize_enabled && + (cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length)) { if(H5C__auto_adjust_cache_size(f, dxpl_id, write_permitted) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Cache auto-resize failed.") - } - - if ( cache_ptr->size_decreased ) { + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Cache auto-resize failed") + } /* end if */ + if(cache_ptr->size_decreased) { cache_ptr->size_decreased = FALSE; /* check to see if the cache is now oversized due to the cache @@ -2732,7 +2719,7 @@ H5C_protect(H5F_t * f, * bring the cache size down to the current maximum cache size. * * Also, if the min_clean_size requirement is not met, we - * should also call H5C_make_space_in_cache() to bring us + * should also call H5C__make_space_in_cache() to bring us * into complience. */ @@ -2749,10 +2736,10 @@ H5C_protect(H5F_t * f, if(cache_ptr->index_size > cache_ptr->max_cache_size) cache_ptr->cache_full = TRUE; - if(H5C_make_space_in_cache(f, dxpl_id, (size_t)0, write_permitted) < 0 ) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_make_space_in_cache failed 2.") + if(H5C__make_space_in_cache(f, dxpl_id, (size_t)0, write_permitted) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__make_space_in_cache failed") } - } + } /* end if */ } /* If we loaded the entry and the entry's type has a 'notify' callback, send @@ -2789,10 +2776,10 @@ H5C_protect(H5F_t * f, done: #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on exit.\n") + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0) || + (H5C_validate_lru_list(cache_ptr) < 0)) + HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) @@ -2819,7 +2806,7 @@ H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr) FUNC_ENTER_NOAPI(FAIL) if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad cache_ptr on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad cache_ptr on entry") cache_ptr->cache_hits = 0; cache_ptr->cache_accesses = 0; @@ -2859,27 +2846,27 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, FUNC_ENTER_NOAPI(FAIL) if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad cache_ptr on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad cache_ptr on entry") if(config_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "NULL config_ptr on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "NULL config_ptr on entry") if(config_ptr->version != H5C__CURR_AUTO_SIZE_CTL_VER) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "unknown config version.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "unknown config version") /* check general configuration section of the config: */ if(H5C_validate_resize_config(config_ptr, H5C_RESIZE_CFG__VALIDATE_GENERAL) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in general configuration fields of new config.") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in general configuration fields of new config") /* check size increase control fields of the config: */ if(H5C_validate_resize_config(config_ptr, H5C_RESIZE_CFG__VALIDATE_INCREMENT) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in the size increase control fields of new config.") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in the size increase control fields of new config") /* check size decrease control fields of the config: */ if(H5C_validate_resize_config(config_ptr, H5C_RESIZE_CFG__VALIDATE_DECREMENT) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in the size decrease control fields of new config.") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in the size decrease control fields of new config") /* check for conflicts between size increase and size decrease controls: */ if(H5C_validate_resize_config(config_ptr, H5C_RESIZE_CFG__VALIDATE_INTERACTIONS) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "conflicting threshold fields in new config.") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "conflicting threshold fields in new config") /* will set the increase possible fields to FALSE later if needed */ cache_ptr->size_increase_possible = TRUE; @@ -2899,7 +2886,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, break; default: /* should be unreachable */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown incr_mode?!?!?.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown incr_mode?!?!?") } /* end switch */ /* logically, this is were configuration for flash cache size increases @@ -2933,7 +2920,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, break; default: /* should be unreachable */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown decr_mode?!?!?.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown decr_mode?!?!?") } /* end switch */ if(config_ptr->max_size == config_ptr->min_size) { @@ -2989,18 +2976,18 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, if(H5C_reset_cache_hit_rate_stats(cache_ptr) < 0) /* this should be impossible... */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats failed") /* remove excess epoch markers if any */ if((config_ptr->decr_mode == H5C_decr__age_out_with_threshold) || (config_ptr->decr_mode == H5C_decr__age_out)) { if(cache_ptr->epoch_markers_active > cache_ptr->resize_ctl.epochs_before_eviction) if(H5C__autoadjust__ageout__remove_excess_markers(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't remove excess epoch markers.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't remove excess epoch markers") } /* end if */ else if(cache_ptr->epoch_markers_active > 0) { if(H5C__autoadjust__ageout__remove_all_markers(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error removing all epoch markers.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error removing all epoch markers") } /* configure flash size increase facility. We wait until the @@ -3024,7 +3011,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, break; default: /* should be unreachable */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown flash_incr_mode?!?!?.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown flash_incr_mode?!?!?") break; } /* end switch */ } /* end if */ @@ -3055,7 +3042,7 @@ H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled) FUNC_ENTER_NOAPI(FAIL) if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry") /* There is no fundamental reason why we should not permit * evictions to be disabled while automatic resize is enabled. @@ -3066,7 +3053,7 @@ H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled) if((evictions_enabled != TRUE) && ((cache_ptr->resize_ctl.incr_mode != H5C_incr__off) || (cache_ptr->resize_ctl.decr_mode != H5C_decr__off))) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't disable evictions when auto resize enabled.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't disable evictions when auto resize enabled") cache_ptr->evictions_enabled = evictions_enabled; @@ -3161,13 +3148,10 @@ H5C_unpin_entry(void *_entry_ptr) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "an extreme sanity check failed on entry.\n"); - } + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0) || + (H5C_validate_lru_list(cache_ptr) < 0)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -3176,19 +3160,14 @@ H5C_unpin_entry(void *_entry_ptr) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry from client") done: - #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "an extreme sanity check failed on exit.\n"); - } + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0) || + (H5C_validate_lru_list(cache_ptr) < 0)) + HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_unpin_entry() */ @@ -3275,13 +3254,10 @@ H5C_unprotect(H5F_t * f, was_clean = ! ( entry_ptr->is_dirty ); #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "an extreme sanity check failed on entry.\n"); - } + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0) || + (H5C_validate_lru_list(cache_ptr) < 0)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /* if the entry has multiple read only protects, just decrement @@ -3438,9 +3414,9 @@ H5C_unprotect(H5F_t * f, /* verify that the target entry is in the cache. */ H5C__SEARCH_INDEX(cache_ptr, addr, test_entry_ptr, FAIL) if(test_entry_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "entry not in hash table?!?.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "entry not in hash table?!?") else if(test_entry_ptr != entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?") /* Set the 'free file space' flag for the flush, if needed */ if(free_file_space) @@ -3463,9 +3439,9 @@ H5C_unprotect(H5F_t * f, /* verify that the target entry is in the cache. */ H5C__SEARCH_INDEX(cache_ptr, addr, test_entry_ptr, FAIL) if(test_entry_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "entry not in hash table?!?.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "entry not in hash table?!?") else if(test_entry_ptr != entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?") if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't clear entry") @@ -3476,19 +3452,14 @@ H5C_unprotect(H5F_t * f, H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) done: - #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "an extreme sanity check failed on exit.\n"); - } + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0) || + (H5C_validate_lru_list(cache_ptr) < 0)) { + HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_unprotect() */ @@ -3496,23 +3467,20 @@ done: * * Function: H5C_unsettle_entry_ring * - * Purpose: Advise the metadata cache that the specified entry's metadata - * cache manager ring is no longer settled (if it was on entry). + * Purpose: Advise the metadata cache that the specified entry's free space + * manager ring is no longer settled (if it was on entry). * - * If the target metadata cache manager ring is already + * If the target free space manager ring is already * unsettled, do nothing, and return SUCCEED. * - * If the target metadata cache manager ring is settled, and + * If the target free space manager ring is settled, and * we are not in the process of a file shutdown, mark * the ring as unsettled, and return SUCCEED. * - * If the target metadata cache manager is settled, and we + * If the target free space manager is settled, and we * are in the process of a file shutdown, post an error * message, and return FAIL. * - * Note that this function simply passes the call on to - * the metadata cache proper, and returns the result. - * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -3592,18 +3560,13 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, FUNC_ENTER_NOAPI(FAIL) - if ( config_ptr == NULL ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "NULL config_ptr on entry.") - } - - if ( config_ptr->version != H5C__CURR_AUTO_SIZE_CTL_VER ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown config version.") - } + if(config_ptr == NULL) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "NULL config_ptr on entry") + if(config_ptr->version != H5C__CURR_AUTO_SIZE_CTL_VER) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown config version") - if ( (tests & H5C_RESIZE_CFG__VALIDATE_GENERAL) != 0 ) { + if((tests & H5C_RESIZE_CFG__VALIDATE_GENERAL) != 0) { if(config_ptr->max_size > H5C__MAX_MAX_CACHE_SIZE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "max_size too big") @@ -3614,43 +3577,29 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, if(config_ptr->min_size > config_ptr->max_size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "min_size > max_size") - if ( ( config_ptr->set_initial_size ) && - ( ( config_ptr->initial_size < config_ptr->min_size ) || - ( config_ptr->initial_size > config_ptr->max_size ) ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "initial_size must be in the interval [min_size, max_size]"); - } - - if ( ( config_ptr->min_clean_fraction < (double)0.0f ) || - ( config_ptr->min_clean_fraction > (double)1.0f ) ) { + if(config_ptr->set_initial_size && + ((config_ptr->initial_size < config_ptr->min_size) || + (config_ptr->initial_size > config_ptr->max_size))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "initial_size must be in the interval [min_size, max_size]") - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "min_clean_fraction must be in the interval [0.0, 1.0]"); - } - - if ( config_ptr->epoch_length < H5C__MIN_AR_EPOCH_LENGTH ) { + if((config_ptr->min_clean_fraction < (double)0.0f) || + (config_ptr->min_clean_fraction > (double)1.0f)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "min_clean_fraction must be in the interval [0.0, 1.0]") + if(config_ptr->epoch_length < H5C__MIN_AR_EPOCH_LENGTH) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epoch_length too small") - } - - if ( config_ptr->epoch_length > H5C__MAX_AR_EPOCH_LENGTH ) { + if(config_ptr->epoch_length > H5C__MAX_AR_EPOCH_LENGTH) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epoch_length too big") - } } /* H5C_RESIZE_CFG__VALIDATE_GENERAL */ - if ( (tests & H5C_RESIZE_CFG__VALIDATE_INCREMENT) != 0 ) { - - if ( ( config_ptr->incr_mode != H5C_incr__off ) && - ( config_ptr->incr_mode != H5C_incr__threshold ) ) { - + if((tests & H5C_RESIZE_CFG__VALIDATE_INCREMENT) != 0) { + if((config_ptr->incr_mode != H5C_incr__off) && + (config_ptr->incr_mode != H5C_incr__threshold)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid incr_mode") - } - - if ( config_ptr->incr_mode == H5C_incr__threshold ) { + if(config_ptr->incr_mode == H5C_incr__threshold) { if((config_ptr->lower_hr_threshold < (double)0.0f) || (config_ptr->lower_hr_threshold > (double)1.0f)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "lower_hr_threshold must be in the range [0.0, 1.0]") @@ -3663,33 +3612,24 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, */ } /* H5C_incr__threshold */ - switch ( config_ptr->flash_incr_mode ) - { + switch(config_ptr->flash_incr_mode) { case H5C_flash_incr__off: /* nothing to do here */ break; case H5C_flash_incr__add_space: - if ( ( config_ptr->flash_multiple < (double)0.1f ) || - ( config_ptr->flash_multiple > (double)10.0f ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "flash_multiple must be in the range [0.1, 10.0]"); - } - - if ( ( config_ptr->flash_threshold < (double)0.1f ) || - ( config_ptr->flash_threshold > (double)1.0f ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "flash_threshold must be in the range [0.1, 1.0]"); - } + if((config_ptr->flash_multiple < (double)0.1f) || + (config_ptr->flash_multiple > (double)10.0f)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "flash_multiple must be in the range [0.1, 10.0]") + if((config_ptr->flash_threshold < (double)0.1f) || + (config_ptr->flash_threshold > (double)1.0f)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "flash_threshold must be in the range [0.1, 1.0]") break; default: - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "Invalid flash_incr_mode"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid flash_incr_mode") break; - } + } /* end switch */ } /* H5C_RESIZE_CFG__VALIDATE_INCREMENT */ @@ -3705,35 +3645,23 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, } if ( config_ptr->decr_mode == H5C_decr__threshold ) { + if(config_ptr->upper_hr_threshold > (double)1.0f) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "upper_hr_threshold must be <= 1.0") - if ( config_ptr->upper_hr_threshold > (double)1.0f ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "upper_hr_threshold must be <= 1.0"); - } - - if ( ( config_ptr->decrement > (double)1.0f ) || - ( config_ptr->decrement < (double)0.0f ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "decrement must be in the interval [0.0, 1.0]"); - } + if((config_ptr->decrement > (double)1.0f) || + (config_ptr->decrement < (double)0.0f)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "decrement must be in the interval [0.0, 1.0]") /* no need to check max_decrement as it is a size_t * and thus must be non-negative. */ } /* H5C_decr__threshold */ - if ( ( config_ptr->decr_mode == H5C_decr__age_out ) || - ( config_ptr->decr_mode == H5C_decr__age_out_with_threshold ) - ) { - - if ( config_ptr->epochs_before_eviction < 1 ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "epochs_before_eviction must be positive"); - } + if((config_ptr->decr_mode == H5C_decr__age_out) || + (config_ptr->decr_mode == H5C_decr__age_out_with_threshold)) { + if(config_ptr->epochs_before_eviction < 1) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epochs_before_eviction must be positive") if(config_ptr->epochs_before_eviction > H5C__MAX_EPOCH_MARKERS) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epochs_before_eviction too big") @@ -3747,43 +3675,24 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, */ } /* H5C_decr__age_out || H5C_decr__age_out_with_threshold */ - if ( config_ptr->decr_mode == H5C_decr__age_out_with_threshold ) { - - if ( ( config_ptr->upper_hr_threshold > (double)1.0f ) || - ( config_ptr->upper_hr_threshold < (double)0.0f ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "upper_hr_threshold must be in the interval [0.0, 1.0]"); - } + if(config_ptr->decr_mode == H5C_decr__age_out_with_threshold) { + if((config_ptr->upper_hr_threshold > (double)1.0f) || + (config_ptr->upper_hr_threshold < (double)0.0f)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "upper_hr_threshold must be in the interval [0.0, 1.0]") } /* H5C_decr__age_out_with_threshold */ - } /* H5C_RESIZE_CFG__VALIDATE_DECREMENT */ if ( (tests & H5C_RESIZE_CFG__VALIDATE_INTERACTIONS) != 0 ) { - - if ( ( config_ptr->incr_mode == H5C_incr__threshold ) - && - ( ( config_ptr->decr_mode == H5C_decr__threshold ) - || - ( config_ptr->decr_mode == H5C_decr__age_out_with_threshold ) - ) - && - ( config_ptr->lower_hr_threshold - >= - config_ptr->upper_hr_threshold - ) - ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "conflicting threshold fields in config.") - } + if((config_ptr->incr_mode == H5C_incr__threshold) + && ((config_ptr->decr_mode == H5C_decr__threshold) || + (config_ptr->decr_mode == H5C_decr__age_out_with_threshold)) + && (config_ptr->lower_hr_threshold >= config_ptr->upper_hr_threshold)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "conflicting threshold fields in config") } /* H5C_RESIZE_CFG__VALIDATE_INTERACTIONS */ done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_validate_resize_config() */ @@ -3879,6 +3788,7 @@ H5C_create_flush_dependency(void * parent_thing, void * child_thing) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for flush dependency parent list") child_entry->flush_dep_parent_nalloc *= 2; } /* end else */ + cache_ptr->entry_fd_height_change_counter++; } /* end if */ /* Add the dependency to the child's parent array */ @@ -4086,7 +3996,7 @@ H5C__auto_adjust_cache_size(H5F_t * f, hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; - herr_t result; + hbool_t reentrant_call = FALSE; hbool_t inserted_epoch_marker = FALSE; size_t new_max_cache_size = 0; size_t old_max_cache_size = 0; @@ -4106,29 +4016,33 @@ H5C__auto_adjust_cache_size(H5F_t * f, HDassert( (double)0.0f <= (cache_ptr->resize_ctl).min_clean_fraction ); HDassert( (cache_ptr->resize_ctl).min_clean_fraction <= (double)100.0f ); - if ( !cache_ptr->resize_enabled ) { + /* check to see if cache_ptr->resize_in_progress is TRUE. If it, this + * is a re-entrant call via a client callback called in the resize + * process. To avoid an infinite recursion, set reentrant_call to + * TRUE, and goto done. + */ + if(cache_ptr->resize_in_progress) { + reentrant_call = TRUE; + HGOTO_DONE(SUCCEED) + } /* end if */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Auto cache resize disabled.") - } + cache_ptr->resize_in_progress = TRUE; - HDassert( ( (cache_ptr->resize_ctl).incr_mode != H5C_incr__off ) || \ - ( (cache_ptr->resize_ctl).decr_mode != H5C_decr__off ) ); + if(!cache_ptr->resize_enabled) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Auto cache resize disabled") - if ( H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED ) { + HDassert(((cache_ptr->resize_ctl).incr_mode != H5C_incr__off) || \ + ((cache_ptr->resize_ctl).decr_mode != H5C_decr__off)); - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate.") - } + if(H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate") HDassert( ( (double)0.0f <= hit_rate ) && ( hit_rate <= (double)1.0f ) ); - switch ( (cache_ptr->resize_ctl).incr_mode ) - { + switch((cache_ptr->resize_ctl).incr_mode) { case H5C_incr__off: - if ( cache_ptr->size_increase_possible ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "size_increase_possible but H5C_incr__off?!?!?") - } + if(cache_ptr->size_increase_possible) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "size_increase_possible but H5C_incr__off?!?!?") break; case H5C_incr__threshold: @@ -4178,7 +4092,7 @@ H5C__auto_adjust_cache_size(H5F_t * f, break; default: - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unknown incr_mode.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unknown incr_mode") } /* If the decr_mode is either age out or age out with threshold, we @@ -4205,17 +4119,10 @@ H5C__auto_adjust_cache_size(H5F_t * f, ) ) { - result = H5C__autoadjust__ageout__insert_new_marker(cache_ptr); - - if ( result != SUCCEED ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "can't insert new epoch marker.") - - } else { + if(H5C__autoadjust__ageout__insert_new_marker(cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't insert new epoch marker") - inserted_epoch_marker = TRUE; - } + inserted_epoch_marker = TRUE; } /* don't run the cache size decrease code unless the cache size @@ -4275,32 +4182,18 @@ H5C__auto_adjust_cache_size(H5F_t * f, case H5C_decr__age_out_with_threshold: case H5C_decr__age_out: - if ( ! inserted_epoch_marker ) { - - if ( ! cache_ptr->size_decrease_possible ) { - + if(!inserted_epoch_marker) { + if(!cache_ptr->size_decrease_possible) status = decrease_disabled; - - } else { - - result = H5C__autoadjust__ageout(f, - dxpl_id, - hit_rate, - &status, - &new_max_cache_size, - write_permitted); - - if ( result != SUCCEED ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "ageout code failed.") - } - } - } + else { + if(H5C__autoadjust__ageout(f, dxpl_id, hit_rate, &status, &new_max_cache_size, write_permitted) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ageout code failed") + } /* end else */ + } /* end if */ break; default: - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unknown incr_mode.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unknown incr_mode") } } @@ -4316,13 +4209,8 @@ H5C__auto_adjust_cache_size(H5F_t * f, ) { /* move last epoch marker to the head of the LRU list */ - result = H5C__autoadjust__ageout__cycle_epoch_marker(cache_ptr); - - if ( result != SUCCEED ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "error cycling epoch marker.") - } + if(H5C__autoadjust__ageout__cycle_epoch_marker(cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error cycling epoch marker") } if ( ( status == increase ) || ( status == decrease ) ) { @@ -4363,9 +4251,7 @@ H5C__auto_adjust_cache_size(H5F_t * f, switch ( (cache_ptr->resize_ctl).flash_incr_mode ) { case H5C_flash_incr__off: - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "flash_size_increase_possible but H5C_flash_incr__off?!") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flash_size_increase_possible but H5C_flash_incr__off?!") break; case H5C_flash_incr__add_space: @@ -4376,15 +4262,13 @@ H5C__auto_adjust_cache_size(H5F_t * f, break; default: /* should be unreachable */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Unknown flash_incr_mode?!?!?.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown flash_incr_mode?!?!?") break; } } } if ( (cache_ptr->resize_ctl).rpt_fcn != NULL ) { - (*((cache_ptr->resize_ctl).rpt_fcn)) (cache_ptr, H5C__CURR_AUTO_RESIZE_RPT_FCN_VER, @@ -4396,14 +4280,17 @@ H5C__auto_adjust_cache_size(H5F_t * f, new_min_clean_size); } - if ( H5C_reset_cache_hit_rate_stats(cache_ptr) != SUCCEED ) { - + if(H5C_reset_cache_hit_rate_stats(cache_ptr) < 0) /* this should be impossible... */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_reset_cache_hit_rate_stats failed.") - } + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats failed") done: + /* Sanity checks */ + HDassert(cache_ptr->resize_in_progress); + if(!reentrant_call) + cache_ptr->resize_in_progress = FALSE; + HDassert((!reentrant_call) || (cache_ptr->resize_in_progress)); + FUNC_LEAVE_NOAPI(ret_value) } /* H5C__auto_adjust_cache_size() */ @@ -4436,7 +4323,6 @@ H5C__autoadjust__ageout(H5F_t * f, hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; - herr_t result; size_t test_size; herr_t ret_value = SUCCEED; /* Return value */ @@ -4449,17 +4335,9 @@ H5C__autoadjust__ageout(H5F_t * f, HDassert( ( new_max_cache_size_ptr ) && ( *new_max_cache_size_ptr == 0 ) ); /* remove excess epoch markers if any */ - if ( cache_ptr->epoch_markers_active > - (cache_ptr->resize_ctl).epochs_before_eviction ) { - - result = H5C__autoadjust__ageout__remove_excess_markers(cache_ptr); - - if ( result != SUCCEED ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "can't remove excess epoch markers.") - } - } + if(cache_ptr->epoch_markers_active > (cache_ptr->resize_ctl).epochs_before_eviction) + if(H5C__autoadjust__ageout__remove_excess_markers(cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't remove excess epoch markers") if ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) || @@ -4475,7 +4353,7 @@ H5C__autoadjust__ageout(H5F_t * f, /* evict aged out cache entries if appropriate... */ if(H5C__autoadjust__ageout__evict_aged_out_entries(f, dxpl_id, write_permitted) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error flushing aged out entries.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error flushing aged out entries") /* ... and then reduce cache size if appropriate */ if ( cache_ptr->index_size < cache_ptr->max_cache_size ) { @@ -4557,11 +4435,8 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - if ( cache_ptr->epoch_markers_active <= 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "No active epoch markers on entry?!?!?.") - } + if(cache_ptr->epoch_markers_active <= 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "No active epoch markers on entry?!?!?") /* remove the last marker from both the ring buffer and the LRU list */ @@ -4573,15 +4448,10 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) cache_ptr->epoch_marker_ringbuf_size -= 1; - if ( cache_ptr->epoch_marker_ringbuf_size < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow.") - } - - if ( (cache_ptr->epoch_marker_active)[i] != TRUE ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?") - } + if(cache_ptr->epoch_marker_ringbuf_size < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow") + if((cache_ptr->epoch_marker_active)[i] != TRUE) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?") H5C__DLL_REMOVE((&((cache_ptr->epoch_markers)[i])), \ (cache_ptr)->LRU_head_ptr, \ @@ -4594,9 +4464,9 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) * the ring buffer. */ - HDassert( ((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i ); - HDassert( ((cache_ptr->epoch_markers)[i]).next == NULL ); - HDassert( ((cache_ptr->epoch_markers)[i]).prev == NULL ); + HDassert(((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i); + HDassert(((cache_ptr->epoch_markers)[i]).next == NULL); + HDassert(((cache_ptr->epoch_markers)[i]).prev == NULL); cache_ptr->epoch_marker_ringbuf_last = (cache_ptr->epoch_marker_ringbuf_last + 1) % @@ -4606,10 +4476,8 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) cache_ptr->epoch_marker_ringbuf_size += 1; - if ( cache_ptr->epoch_marker_ringbuf_size > H5C__MAX_EPOCH_MARKERS ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer overflow.") - } + if(cache_ptr->epoch_marker_ringbuf_size > H5C__MAX_EPOCH_MARKERS) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer overflow") H5C__DLL_PREPEND((&((cache_ptr->epoch_markers)[i])), \ (cache_ptr)->LRU_head_ptr, \ @@ -4671,19 +4539,6 @@ done: * * Programmer: John Mainzer, 11/22/04 * - * Changes: Modified function to detect deletions of entries - * during a scan of the LRU, and where appropriate, - * restart the scan to avoid proceeding with a next - * entry that is no longer in the cache. - * - * Note the absence of checks after flushes of clean - * entries. As a second entry can only be removed by - * by a call to the pre_serialize or serialize callback - * of the first, and as these callbacks will not be called - * on clean entries, no checks are needed. - * - * JRM -- 4/6/15 - * *------------------------------------------------------------------------- */ static herr_t @@ -4775,39 +4630,26 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") } - if ( prev_ptr != NULL ) { - + if(prev_ptr != NULL) { if(corked) /* dirty corked entry is skipped */ entry_ptr = prev_ptr; - - else if ( ( restart_scan ) - || - ( prev_ptr->is_dirty != prev_is_dirty ) - || - ( prev_ptr->next != next_ptr ) - || - ( prev_ptr->is_protected ) - || - ( prev_ptr->is_pinned ) ) { - - /* something has happened to the LRU -- start over + else if(restart_scan || (prev_ptr->is_dirty != prev_is_dirty) + || (prev_ptr->next != next_ptr) + || (prev_ptr->is_protected) + || (prev_ptr->is_pinned)) { + /* Something has happened to the LRU -- start over * from the tail. */ restart_scan = FALSE; entry_ptr = cache_ptr->LRU_tail_ptr; H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) - - } else { - + } /* end else-if */ + else entry_ptr = prev_ptr; - - } - } else { - + } /* end if */ + else entry_ptr = NULL; - - } } /* end while */ /* for now at least, don't bother to maintain the minimum clean size, @@ -4825,9 +4667,9 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, * entry). */ - } else /* ! write_permitted */ { - - /* since we are not allowed to write, all we can do is evict + } /* end if */ + else /* ! write_permitted */ { + /* Since we are not allowed to write, all we can do is evict * any clean entries that we may encounter before we either * hit the eviction size limit, or encounter the epoch marker. * @@ -4840,23 +4682,19 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, * performance implications, but it shouldn't cause any net * slowdown. */ - - HDassert( H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS ); - + HDassert(H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS); entry_ptr = cache_ptr->LRU_tail_ptr; - - while ( ( entry_ptr != NULL ) && - ( (entry_ptr->type)->id != H5AC_EPOCH_MARKER_ID ) && - ( bytes_evicted < eviction_size_limit ) ) - { - HDassert( ! (entry_ptr->is_protected) ); + while(entry_ptr != NULL && + ((entry_ptr->type)->id != H5AC_EPOCH_MARKER_ID) && + (bytes_evicted < eviction_size_limit)) { + HDassert(!(entry_ptr->is_protected)); prev_ptr = entry_ptr->prev; - if ( ! (entry_ptr->is_dirty) ) { + if(!(entry_ptr->is_dirty)) { if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush clean entry") - } + } /* end if */ /* just skip the entry if it is dirty, as we can't do * anything with it now since we can't write. * @@ -4864,21 +4702,15 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, * and thus we needn't test to see if the LRU has been changed * out from under us. */ - entry_ptr = prev_ptr; - } /* end while */ - } - - if ( cache_ptr->index_size < cache_ptr->max_cache_size ) { + } /* end else */ + if(cache_ptr->index_size < cache_ptr->max_cache_size) cache_ptr->cache_full = FALSE; - } done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C__autoadjust__ageout__evict_aged_out_entries() */ @@ -4907,23 +4739,16 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - if ( cache_ptr->epoch_markers_active >= - (cache_ptr->resize_ctl).epochs_before_eviction ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Already have a full complement of markers.") - } + if(cache_ptr->epoch_markers_active >= (cache_ptr->resize_ctl).epochs_before_eviction) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Already have a full complement of markers") /* find an unused marker */ i = 0; - while ( ( (cache_ptr->epoch_marker_active)[i] ) && - ( i < H5C__MAX_EPOCH_MARKERS ) ) - { + while((cache_ptr->epoch_marker_active)[i] && i < H5C__MAX_EPOCH_MARKERS) i++; - } if(i >= H5C__MAX_EPOCH_MARKERS) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't find unused marker.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't find unused marker") HDassert( ((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i ); HDassert( ((cache_ptr->epoch_markers)[i]).next == NULL ); @@ -4941,7 +4766,7 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) if ( cache_ptr->epoch_marker_ringbuf_size > H5C__MAX_EPOCH_MARKERS ) { - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer overflow.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer overflow") } H5C__DLL_PREPEND((&((cache_ptr->epoch_markers)[i])), \ @@ -5000,15 +4825,11 @@ H5C__autoadjust__ageout__remove_all_markers(H5C_t * cache_ptr) cache_ptr->epoch_marker_ringbuf_size -= 1; - if ( cache_ptr->epoch_marker_ringbuf_size < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow.") - } - - if ( (cache_ptr->epoch_marker_active)[i] != TRUE ) { + if(cache_ptr->epoch_marker_ringbuf_size < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow") + if((cache_ptr->epoch_marker_active)[i] != TRUE) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?") - } /* remove the epoch marker from the LRU list */ H5C__DLL_REMOVE((&((cache_ptr->epoch_markers)[i])), \ @@ -5066,15 +4887,10 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr) HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - if ( cache_ptr->epoch_markers_active <= - (cache_ptr->resize_ctl).epochs_before_eviction ) { + if(cache_ptr->epoch_markers_active <= (cache_ptr->resize_ctl).epochs_before_eviction) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "no excess markers on entry") - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "no excess markers on entry.") - } - - while ( cache_ptr->epoch_markers_active > - (cache_ptr->resize_ctl).epochs_before_eviction ) - { + while(cache_ptr->epoch_markers_active > (cache_ptr->resize_ctl).epochs_before_eviction) { /* get the index of the last epoch marker in the LRU list * and remove it from the ring buffer. */ @@ -5088,15 +4904,10 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr) cache_ptr->epoch_marker_ringbuf_size -= 1; - if ( cache_ptr->epoch_marker_ringbuf_size < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow.") - } - - if ( (cache_ptr->epoch_marker_active)[i] != TRUE ) { - + if(cache_ptr->epoch_marker_ringbuf_size < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow") + if((cache_ptr->epoch_marker_active)[i] != TRUE) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?") - } /* remove the epoch marker from the LRU list */ H5C__DLL_REMOVE((&((cache_ptr->epoch_markers)[i])), \ @@ -5165,11 +4976,8 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, HDassert( new_entry_size > cache_ptr->flash_size_increase_threshold ); HDassert( old_entry_size < new_entry_size ); - if ( old_entry_size >= new_entry_size ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "old_entry_size >= new_entry_size") - } + if(old_entry_size >= new_entry_size) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "old_entry_size >= new_entry_size") space_needed = new_entry_size - old_entry_size; @@ -5182,8 +4990,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, switch ( (cache_ptr->resize_ctl).flash_incr_mode ) { case H5C_flash_incr__off: - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "flash_size_increase_possible but H5C_flash_incr__off?!") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flash_size_increase_possible but H5C_flash_incr__off?!") break; case H5C_flash_incr__add_space: @@ -5203,8 +5010,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, break; default: /* should be unreachable */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Unknown flash_incr_mode?!?!?.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown flash_incr_mode?!?!?") break; } @@ -5233,8 +5039,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, switch ( (cache_ptr->resize_ctl).flash_incr_mode ) { case H5C_flash_incr__off: - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "flash_size_increase_possible but H5C_flash_incr__off?!") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flash_size_increase_possible but H5C_flash_incr__off?!") break; case H5C_flash_incr__add_space: @@ -5245,8 +5050,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, break; default: /* should be unreachable */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Unknown flash_incr_mode?!?!?.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown flash_incr_mode?!?!?") break; } @@ -5260,10 +5064,8 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, /* get the hit rate for the reporting function. Should still * be good as we havent reset the hit rate statistics. */ - if ( H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate.") - } + if(H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate") (*((cache_ptr->resize_ctl).rpt_fcn)) (cache_ptr, @@ -5276,12 +5078,9 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, new_min_clean_size); } - if ( H5C_reset_cache_hit_rate_stats(cache_ptr) != SUCCEED ) { - + if(H5C_reset_cache_hit_rate_stats(cache_ptr) < 0) /* this should be impossible... */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_reset_cache_hit_rate_stats failed.") - } + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats failed") } done: @@ -5347,8 +5146,8 @@ H5C_flush_invalidate_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) #if H5C_DO_SANITY_CHECKS { int32_t i; - int32_t index_len = 0; - int32_t slist_len = 0; + uint32_t index_len = 0; + uint32_t slist_len = 0; size_t index_size = (size_t)0; size_t clean_index_size = (size_t)0; size_t dirty_index_size = (size_t)0; @@ -5383,7 +5182,7 @@ H5C_flush_invalidate_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) /* remove ageout markers if present */ if(cache_ptr->epoch_markers_active > 0) if(H5C__autoadjust__ageout__remove_all_markers(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error removing all epoch markers.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error removing all epoch markers") /* flush invalidate each ring, starting from the outermost ring and * working inward. @@ -5391,7 +5190,7 @@ H5C_flush_invalidate_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) ring = H5C_RING_USER; while(ring < H5C_RING_NTYPES) { if(H5C_flush_invalidate_ring(f, dxpl_id, ring, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate ring failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate ring failed") ring++; } /* end while */ @@ -5479,7 +5278,7 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, { H5C_t *cache_ptr; hbool_t restart_slist_scan; - int32_t protected_entries = 0; + uint32_t protected_entries = 0; int32_t i; int32_t cur_ring_pel_len; int32_t old_ring_pel_len; @@ -5489,7 +5288,7 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, H5C_cache_entry_t *entry_ptr = NULL; H5C_cache_entry_t *next_entry_ptr = NULL; #if H5C_DO_SANITY_CHECKS - int64_t initial_slist_len = 0; + uint32_t initial_slist_len = 0; size_t initial_slist_size = 0; #endif /* H5C_DO_SANITY_CHECKS */ herr_t ret_value = SUCCEED; @@ -5674,9 +5473,10 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, * everything we can before we flag an error. */ protected_entries++; - } else if(entry_ptr->is_pinned) { + } /* end if */ + else if(entry_ptr->is_pinned) { if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__DURING_FLUSH_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty pinned entry flush failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty pinned entry flush failed") if(cache_ptr->slist_changed) { /* The slist has been modified by something @@ -5690,10 +5490,10 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, cache_ptr->slist_changed = FALSE; H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr); } /* end if */ - } /* end if */ + } /* end else-if */ else { if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry flush destroy failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry flush destroy failed") if(cache_ptr->slist_changed) { /* The slist has been modified by something @@ -5722,8 +5522,8 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, */ if(node_ptr == NULL) { - HDassert(cache_ptr->slist_len == (initial_slist_len + cache_ptr->slist_len_increase)); - HDassert((int64_t)cache_ptr->slist_size == ((int64_t)initial_slist_size + cache_ptr->slist_size_increase)); + HDassert(cache_ptr->slist_len == (uint32_t)((int32_t)initial_slist_len + cache_ptr->slist_len_increase)); + HDassert(cache_ptr->slist_size == (size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase)); } /* end if */ #endif /* H5C_DO_SANITY_CHECKS */ @@ -5797,7 +5597,7 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, cache_ptr->entry_watched_for_removal = next_entry_ptr; if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Entry flush destroy failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Entry flush destroy failed") /* Restart the index list scan if necessary. Must * do this if the next entry is evicted, and also if @@ -5878,9 +5678,9 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, HDassert(protected_entries <= cache_ptr->pl_len); if(protected_entries > 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cache has protected entries.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cache has protected entries") else if(cur_ring_pel_len > 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't unpin all pinned entries in ring.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't unpin all pinned entries in ring") done: FUNC_LEAVE_NOAPI(ret_value) @@ -5920,12 +5720,12 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) hbool_t ignore_protected; hbool_t tried_to_flush_protected_entry = FALSE; hbool_t restart_slist_scan; - int32_t protected_entries = 0; + uint32_t protected_entries = 0; H5SL_node_t * node_ptr = NULL; H5C_cache_entry_t * entry_ptr = NULL; H5C_cache_entry_t * next_entry_ptr = NULL; #if H5C_DO_SANITY_CHECKS - int64_t initial_slist_len = 0; + uint32_t initial_slist_len = 0; size_t initial_slist_size = 0; #endif /* H5C_DO_SANITY_CHECKS */ int i; @@ -5944,7 +5744,7 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) if((H5C_validate_protected_entry_list(cache_ptr) < 0) || (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry.\n") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ ignore_protected = ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 ); @@ -6108,7 +5908,7 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) } /* end if */ else { if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (flags | H5C__DURING_FLUSH_FLAG)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry") if(cache_ptr->slist_changed) { /* The slist has been modified by something @@ -6130,8 +5930,8 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) #if H5C_DO_SANITY_CHECKS /* Verify that the slist size and length are as expected. */ - HDassert((initial_slist_len + cache_ptr->slist_len_increase) == cache_ptr->slist_len); - HDassert((size_t)((int64_t)initial_slist_size + cache_ptr->slist_size_increase) == cache_ptr->slist_size); + HDassert((uint32_t)((int32_t)initial_slist_len + cache_ptr->slist_len_increase) == cache_ptr->slist_len); + HDassert((size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase) == cache_ptr->slist_size); #endif /* H5C_DO_SANITY_CHECKS */ } /* while */ @@ -6183,34 +5983,6 @@ done: * * Programmer: John Mainzer, 5/5/04 * - * Changes: Refactored function to remove the type_ptr parameter. - * - * JRM -- 8/7/14 - * - * Added code to check for slist changes in pre_serialize and - * serialize calls, and set - * cache_ptr->slist_change_in_pre_serialize and - * cache_ptr->slist_change_in_serialize as appropriate. - * - * JRM -- 12/13/14 - * - * Refactored function to delay all modifications of the - * metadata cache data structures until after any calls - * to the pre-serialize or serialize callbacks. - * - * Need to do this, as some pre-serialize or serialize - * calls result in calls to the metadata cache and - * modifications to its data structures. Thus, at the - * time of any such call, the target entry flags and - * the metadata cache must all be consistant. - * - * Also added the entry_size_change_ptr parameter, which - * allows the function to report back any change in the size - * of the entry during the flush. Such size changes may - * occur during the pre-serialize callback. - * - * JRM -- 12/24/14 - * *------------------------------------------------------------------------- */ herr_t @@ -6228,6 +6000,8 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, hbool_t destroy_entry; /* internal flag */ hbool_t generate_image; /* internal flag */ hbool_t was_dirty; + hbool_t suppress_image_entry_writes = FALSE; + hbool_t suppress_image_entry_frees = FALSE; haddr_t entry_addr = HADDR_UNDEF; herr_t ret_value = SUCCEED; /* Return value */ @@ -6240,6 +6014,7 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, HDassert(entry_ptr); HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(entry_ptr->ring != H5C_RING_UNDEFINED); + HDassert(entry_ptr->type); /* setup external flags from the flags parameter */ destroy = ((flags & H5C__FLUSH_INVALIDATE_FLAG) != 0); @@ -6270,44 +6045,64 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, else write_entry = FALSE; + /* if we have received close warning, and we have been instructed to + * generate a metadata cache image, and we have actually constructed + * the entry images, set suppress_image_entry_frees to TRUE. + * + * Set suppress_image_entry_writes to TRUE if indicated by the + * image_ctl flags. + */ + if(cache_ptr->close_warning_received && cache_ptr->image_ctl.generate_image + && cache_ptr->num_entries_in_image > 0 && cache_ptr->image_entries) { + /* Sanity checks */ + HDassert(entry_ptr->image_up_to_date || !(entry_ptr->include_in_image)); + HDassert(entry_ptr->image_ptr || !(entry_ptr->include_in_image)); + HDassert((!clear_only) || !(entry_ptr->include_in_image)); + HDassert((!take_ownership) || !(entry_ptr->include_in_image)); + HDassert((!free_file_space) || !(entry_ptr->include_in_image)); + + suppress_image_entry_frees = TRUE; + + if(cache_ptr->image_ctl.flags & H5C_CI__SUPRESS_ENTRY_WRITES) + suppress_image_entry_writes = TRUE; + } /* end if */ + /* run initial sanity checks */ #if H5C_DO_SANITY_CHECKS if(entry_ptr->in_slist) { HDassert(entry_ptr->is_dirty); if((entry_ptr->flush_marker) && (!entry_ptr->is_dirty)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry in slist failed sanity checks.") - } else { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry in slist failed sanity checks") + } /* end if */ + else { HDassert(!entry_ptr->is_dirty); HDassert(!entry_ptr->flush_marker); if((entry_ptr->is_dirty) || (entry_ptr->flush_marker)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry failed sanity checks.") - } + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry failed sanity checks") + } /* end else */ #endif /* H5C_DO_SANITY_CHECKS */ if(entry_ptr->is_protected) { HDassert(!entry_ptr->is_protected); /* Attempt to flush a protected entry -- scream and die. */ - HGOTO_ERROR(H5E_CACHE, H5E_PROTECT, FAIL, "Attempt to flush a protected entry.") + HGOTO_ERROR(H5E_CACHE, H5E_PROTECT, FAIL, "Attempt to flush a protected entry") } /* end if */ - /* set entry_ptr->flush_in_progress = TRUE and set + /* Set entry_ptr->flush_in_progress = TRUE and set * entry_ptr->flush_marker = FALSE * - * in the parallel case, do some sanity checking in passing. - */ - HDassert(entry_ptr->type); - - was_dirty = entry_ptr->is_dirty; /* needed later for logging */ - - /* We will set flush_in_progress back to FALSE at the end if the + * We will set flush_in_progress back to FALSE at the end if the * entry still exists at that point. */ entry_ptr->flush_in_progress = TRUE; entry_ptr->flush_marker = FALSE; + /* Preserve current dirty state for later */ + was_dirty = entry_ptr->is_dirty; + /* The entry is dirty, and we are doing a flush, a flush destroy or have * been requested to generate an image. In those cases, serialize the * entry. @@ -6324,6 +6119,9 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, } /* end if */ if(!(entry_ptr->image_up_to_date)) { + /* Sanity check */ + HDassert(!entry_ptr->prefetched); + /* Generate the entry's image */ if(H5C__generate_image(f, cache_ptr, entry_ptr, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't generate entry's image") @@ -6344,7 +6142,17 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Write when writes are always forbidden!?!?!") #endif /* H5C_DO_SANITY_CHECKS */ - if(((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0) { + /* Write the image to disk unless the write is suppressed. + * + * This happens if both suppress_image_entry_writes and + * entry_ptr->include_in_image are TRUE, or if the + * H5AC__CLASS_SKIP_WRITES is set in the entry's type. This + * flag should only be used in test code + */ + if((!suppress_image_entry_writes || !entry_ptr->include_in_image) + && (((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0)) { + H5FD_mem_t mem_type = H5FD_MEM_DEFAULT; + #ifdef H5_HAVE_PARALLEL if(cache_ptr->coll_write_list) { if(H5SL_insert(cache_ptr->coll_write_list, entry_ptr, &entry_ptr->addr) < 0) @@ -6352,8 +6160,16 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, } /* end if */ else #endif /* H5_HAVE_PARALLEL */ - if(H5F_block_write(f, entry_ptr->type->mem_type, entry_ptr->addr, entry_ptr->size, dxpl_id, entry_ptr->image_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't write image to file.") + + if(entry_ptr->prefetched) { + HDassert(entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); + mem_type = cache_ptr->class_table_ptr[entry_ptr->prefetch_type_id]->mem_type; + } /* end if */ + else + mem_type = entry_ptr->type->mem_type; + + if(H5F_block_write(f, mem_type, entry_ptr->addr, entry_ptr->size, dxpl_id, entry_ptr->image_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't write image to file") } /* end if */ /* if the entry has a notify callback, notify it that we have @@ -6497,10 +6313,29 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, /* Sanity check */ HDassert(0 == entry_ptr->flush_dep_nparents); - /* Start by freeing the buffer for the on disk image */ - if(entry_ptr->image_ptr != NULL) + /* if both suppress_image_entry_frees and entry_ptr->include_in_image + * are true, simply set entry_ptr->image_ptr to NULL, as we have + * another pointer to the buffer in an instance of H5C_image_entry_t + * in cache_ptr->image_entries. + * + * Otherwise, free the buffer if it exists. + */ + if(suppress_image_entry_frees && entry_ptr->include_in_image) + entry_ptr->image_ptr = NULL; + else if(entry_ptr->image_ptr != NULL) entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr); + /* If the entry is not a prefetched entry, verify that the flush + * dependency parents addresses array has been transfered. + * + * If the entry is prefetched, the free_isr routine will dispose of + * the flush dependency parents adresses array if necessary. + */ + if(!entry_ptr->prefetched) { + HDassert(0 == entry_ptr->fd_parent_count); + HDassert(NULL == entry_ptr->fd_parent_addrs); + } /* end if */ + /* Check whether we should free the space in the file that * the entry occupies */ @@ -6584,7 +6419,7 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, HDassert(entry_ptr->image_ptr == NULL); if(entry_ptr->type->free_icr((void *)entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "free_icr callback failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "free_icr callback failed") } /* end if */ else { HDassert(take_ownership); @@ -6599,12 +6434,11 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, if(cache_ptr->log_flush) if((cache_ptr->log_flush)(cache_ptr, entry_addr, was_dirty, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "log_flush callback failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "log_flush callback failed") done: HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || ( ! entry_ptr->flush_in_progress ) ); - HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || ( take_ownership ) || ( ! entry_ptr->is_dirty ) ); @@ -6662,14 +6496,14 @@ H5C__verify_len_eoa(H5F_t *f, const H5C_class_t *type, haddr_t addr, /* Check if the amount of data to read will be past the EOA */ if(H5F_addr_gt((addr + *len), eoa)) { if(actual) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "actual len exceeds EOA.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "actual len exceeds EOA") else /* Trim down the length of the metadata */ *len = (size_t)(eoa - addr); } /* end if */ if(*len <= 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "len not positive after adjustment for EOA.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "len not positive after adjustment for EOA") done: FUNC_LEAVE_NOAPI(ret_value) @@ -6749,7 +6583,7 @@ H5C_load_entry(H5F_t * f, /* Allocate the buffer for reading the on-disk entry image */ if(NULL == (image = (uint8_t *)H5MM_malloc(len + H5C_IMAGE_EXTRA_SPACE))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "memory allocation failed for on disk image buffer.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "memory allocation failed for on disk image buffer") #if H5C_DO_MEMORY_SANITY_CHECKS HDmemcpy(image + len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ @@ -6826,7 +6660,7 @@ H5C_load_entry(H5F_t * f, if(actual_len != len) { /* Verify that the length isn't past the EOA for the file */ if(H5C__verify_len_eoa(f, type, addr, &actual_len, TRUE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "actual_len exceeds EOA.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "actual_len exceeds EOA") /* Expand buffer to new size */ if(NULL == (new_image = H5MM_realloc(image, actual_len + H5C_IMAGE_EXTRA_SPACE))) @@ -6976,6 +6810,22 @@ H5C_load_entry(H5F_t * f, entry->coll_prev = NULL; #endif /* H5_HAVE_PARALLEL */ + /* initialize cache image related fields */ + entry->include_in_image = FALSE; + entry->lru_rank = 0; + entry->image_dirty = FALSE; + entry->fd_parent_count = 0; + entry->fd_parent_addrs = NULL; + entry->fd_child_count = 0; + entry->fd_dirty_child_count = 0; + entry->image_fd_height = 0; + entry->prefetched = FALSE; + entry->prefetch_type_id = 0; + entry->age = 0; +#ifndef NDEBUG /* debugging field */ + entry->serialization_count = 0; +#endif /* NDEBUG */ + H5C__RESET_CACHE_ENTRY_STATS(entry); ret_value = thing; @@ -6996,7 +6846,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5C_make_space_in_cache + * Function: H5C__make_space_in_cache * * Purpose: Attempt to evict cache entries until the index_size * is at least needed_space below max_cache_size. @@ -7027,53 +6877,19 @@ done: * * Programmer: John Mainzer, 5/14/04 * - * Changes: Modified function to skip over entries with the - * flush_in_progress flag set. If this is not done, - * an infinite recursion is possible if the cache is - * full, and the pre-serialize or serialize routine - * attempts to load another entry. - * - * This error was exposed by a re-factor of the - * H5C__flush_single_entry() routine. However, it was - * a potential bug from the moment that entries were - * allowed to load other entries on flush. - * - * In passing, note that the primary and secondary dxpls - * mentioned in the comment above have been replaced by - * a single dxpl at some point, and thus the discussion - * above is somewhat obsolete. Date of this change is - * unkown. - * - * JRM -- 12/26/14 - * - * Modified function to detect deletions of entries - * during a scan of the LRU, and where appropriate, - * restart the scan to avoid proceeding with a next - * entry that is no longer in the cache. - * - * Note the absence of checks after flushes of clean - * entries. As a second entry can only be removed by - * by a call to the pre_serialize or serialize callback - * of the first, and as these callbacks will not be called - * on clean entries, no checks are needed. - * - * JRM -- 4/6/15 - * *------------------------------------------------------------------------- */ -static herr_t -H5C_make_space_in_cache(H5F_t * f, - hid_t dxpl_id, - size_t space_needed, - hbool_t write_permitted) +herr_t +H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, + hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; #if H5C_COLLECT_CACHE_STATS int32_t clean_entries_skipped = 0; int32_t total_entries_scanned = 0; #endif /* H5C_COLLECT_CACHE_STATS */ - int32_t entries_examined = 0; - int32_t initial_list_len; + uint32_t entries_examined = 0; + uint32_t initial_list_len; size_t empty_space; hbool_t prev_is_dirty = FALSE; hbool_t didnt_flush_entry = FALSE; @@ -7081,33 +6897,27 @@ H5C_make_space_in_cache(H5F_t * f, H5C_cache_entry_t * entry_ptr; H5C_cache_entry_t * prev_ptr; H5C_cache_entry_t * next_ptr; - int32_t num_corked_entries = 0; + uint32_t num_corked_entries = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE - HDassert( f ); - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( cache_ptr->index_size == - (cache_ptr->clean_index_size + cache_ptr->dirty_index_size) ); + /* Sanity checks */ + HDassert(f); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(cache_ptr->index_size == (cache_ptr->clean_index_size + cache_ptr->dirty_index_size)); if ( write_permitted ) { - restart_scan = FALSE; initial_list_len = cache_ptr->LRU_list_len; entry_ptr = cache_ptr->LRU_tail_ptr; - if ( cache_ptr->index_size >= cache_ptr->max_cache_size ) { - + if(cache_ptr->index_size >= cache_ptr->max_cache_size) empty_space = 0; - - } else { - + else empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; - } - while ( ( ( (cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size @@ -7353,10 +7163,8 @@ H5C_make_space_in_cache(H5F_t * f, } done: - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5C_make_space_in_cache() */ +} /* H5C__make_space_in_cache() */ /*------------------------------------------------------------------------- @@ -8166,6 +7974,515 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t * entry, /*------------------------------------------------------------------------- + * Function: H5C__serialize_cache + * + * Purpose: Serialize (i.e. construct an on disk image) for all entries + * in the metadata cache including clean entries. + * + * Note that flush dependencies and "flush me last" flags + * must be observed in the serialization process. + * + * Note also that entries may be loaded, flushed, evicted, + * expunged, relocated, resized, or removed from the cache + * during this process, just as these actions may occur during + * a regular flush. + * + * However, we are given that the cache will contain no protected + * entries on entry to this routine (although entries may be + * briefly protected and then unprotected during the serialize + * process). + * + * The objective of this routine is serialize all entries and + * to force all entries into their actual locations on disk. + * + * The initial need for this routine is to settle all entries + * in the cache prior to construction of the metadata cache + * image so that the size of the cache image can be calculated. + * However, I gather that other uses for the routine are + * under consideration. + * + * Return: Non-negative on success/Negative on failure or if there was + * a request to flush all items and something was protected. + * + * Programmer: John Mainzer + * 7/22/15 + * + *------------------------------------------------------------------------- + */ +herr_t +H5C__serialize_cache(H5F_t *f, hid_t dxpl_id) +{ +#if H5C_DO_SANITY_CHECKS + int i; + uint32_t index_len = 0; + size_t index_size = (size_t)0; + size_t clean_index_size = (size_t)0; + size_t dirty_index_size = (size_t)0; + size_t slist_size = (size_t)0; + uint32_t slist_len = 0; +#endif /* H5C_DO_SANITY_CHECKS */ + H5C_ring_t ring; + H5C_t * cache_ptr; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_PACKAGE + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + cache_ptr = f->shared->cache; + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(cache_ptr->slist_ptr); + +#if H5C_DO_SANITY_CHECKS + HDassert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0); + HDassert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + HDassert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + HDassert(cache_ptr->dirty_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + HDassert(cache_ptr->slist_ring_len[H5C_RING_UNDEFINED] == 0); + HDassert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + + for(i = H5C_RING_USER; i < H5C_RING_NTYPES; i++) { + index_len += cache_ptr->index_ring_len[i]; + index_size += cache_ptr->index_ring_size[i]; + clean_index_size += cache_ptr->clean_index_ring_size[i]; + dirty_index_size += cache_ptr->dirty_index_ring_size[i]; + + slist_len += cache_ptr->slist_ring_len[i]; + slist_size += cache_ptr->slist_ring_size[i]; + } /* end for */ + + HDassert(cache_ptr->index_len == index_len); + HDassert(cache_ptr->index_size == index_size); + HDassert(cache_ptr->clean_index_size == clean_index_size); + HDassert(cache_ptr->dirty_index_size == dirty_index_size); + HDassert(cache_ptr->slist_len == slist_len); + HDassert(cache_ptr->slist_size == slist_size); +#endif /* H5C_DO_SANITY_CHECKS */ + +#if H5C_DO_EXTREME_SANITY_CHECKS + if((H5C_validate_protected_entry_list(cache_ptr) < 0) || + (H5C_validate_pinned_entry_list(cache_ptr) < 0) || + (H5C_validate_lru_list(cache_ptr) < 0)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") +#endif /* H5C_DO_EXTREME_SANITY_CHECKS */ + +#ifndef NDEBUG + /* if this is a debug build, set the serialization_count field of + * each entry in the cache to zero before we start the serialization. + * This allows us to detect the case in which any entry is serialized + * more than once (a performance issues), and more importantly, the + * case is which any flush depencency parent is serializes more than + * once (a correctness issue). + */ + { + H5C_cache_entry_t * scan_ptr = NULL; + + scan_ptr = cache_ptr->il_head; + while(scan_ptr != NULL) { + HDassert(scan_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + scan_ptr->serialization_count = 0; + scan_ptr = scan_ptr->il_next; + } /* end while */ + } /* end block */ +#endif /* NDEBUG */ + + /* set cache_ptr->serialization_in_progress to TRUE, and back + * to FALSE at the end of the function. Must maintain this flag + * to support H5C_get_serialization_in_progress(), which is in + * turn required to support sanity checking in some cache + * clients. + */ + HDassert(!cache_ptr->serialization_in_progress); + cache_ptr->serialization_in_progress = TRUE; + + /* Serialize each ring, starting from the outermost ring and + * working inward. + */ + ring = H5C_RING_USER; + while(ring < H5C_RING_NTYPES) { + HDassert(cache_ptr->close_warning_received); + switch(ring) { + case H5C_RING_USER: + break; + + case H5C_RING_RDFSM: + /* Settle raw data FSM */ + if(!cache_ptr->rdfsm_settled) + if(H5MF_settle_raw_data_fsm(f, dxpl_id, &cache_ptr->rdfsm_settled) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "RD FSM settle failed") + break; + + case H5C_RING_MDFSM: + /* Settle metadata FSM */ + if(!cache_ptr->mdfsm_settled) + if(H5MF_settle_meta_data_fsm(f, dxpl_id, &cache_ptr->mdfsm_settled) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "MD FSM settle failed") + break; + + case H5C_RING_SBE: + case H5C_RING_SB: + break; + + default: + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown ring?!?!") + break; + } /* end switch */ + + if(H5C__serialize_ring(f, dxpl_id, ring) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "serialize ring failed") + + ring++; + } /* end while */ + +#ifndef NDEBUG + /* Verify that no entry has been serialized more than once. + * FD parents with multiple serializations should have been caught + * elsewhere, so no specific check for them here. + */ + { + H5C_cache_entry_t * scan_ptr = NULL; + + scan_ptr = cache_ptr->il_head; + while(scan_ptr != NULL) { + HDassert(scan_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(scan_ptr->serialization_count <= 1); + + scan_ptr = scan_ptr->il_next; + } /* end while */ + } /* end block */ +#endif /* NDEBUG */ + +done: + cache_ptr->serialization_in_progress = FALSE; + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C__serialize_cache() */ + + +/*------------------------------------------------------------------------- + * Function: H5C__serialize_ring + * + * Purpose: Serialize the entries contained in the specified cache and + * ring. All entries in rings outside the specified ring + * must have been serialized on entry. + * + * If the cache contains protected entries in the specified + * ring, the function will fail, as protected entries cannot + * be serialized. However all unprotected entries in the + * target ring should be serialized before the function + * returns failure. + * + * If flush dependencies appear in the target ring, the + * function makes repeated passes through the index list + * serializing entries in flush dependency order. + * + * All entries outside the H5C_RING_SBE are marked for + * inclusion in the cache image. Entries in H5C_RING_SBE + * and below are marked for exclusion from the image. + * + * Return: Non-negative on success/Negative on failure or if there was + * a request to flush all items and something was protected. + * + * Programmer: John Mainzer + * 9/11/15 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5C__serialize_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring) +{ + hbool_t done = FALSE; + H5C_t * cache_ptr; + H5C_cache_entry_t * entry_ptr; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + cache_ptr = f->shared->cache; + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(ring > H5C_RING_UNDEFINED); + HDassert(ring < H5C_RING_NTYPES); + + HDassert(cache_ptr->serialization_in_progress); + + /* The objective here is to serialize all entries in the cache ring + * in flush dependency order. + * + * The basic algorithm is to scan the cache index list looking for + * unserialized entries that are either not in a flush dependency + * relationship, or which have no unserialized children. Any such + * entry is serialized and its flush dependency parents (if any) are + * informed -- allowing them to decrement their userialized child counts. + * + * However, this algorithm is complicated by the ability + * of client serialization callbacks to perform operations on + * on the cache which can result in the insertion, deletion, + * relocation, resize, dirty, flush, eviction, or removal (via the + * take ownership flag) of entries. Changes in the flush dependency + * structure are also possible. + * + * On the other hand, the algorithm is simplified by the fact that + * we are serializing, not flushing. Thus, as long as all entries + * are serialized correctly, it doesn't matter if we have to go back + * and serialize an entry a second time. + * + * These possible actions result in the following modfications to + * tha basic algorithm: + * + * 1) In the event of an entry expunge, eviction or removal, we must + * restart the scan as it is possible that the next entry in our + * scan is no longer in the cache. Were we to examine this entry, + * we would be accessing deallocated memory. + * + * 2) A resize, dirty, or insertion of an entry may result in the + * the increment of a flush dependency parent's dirty and/or + * unserialized child count. In the context of serializing the + * the cache, this is a non-issue, as even if we have already + * serialized the parent, it will be marked dirty and its image + * marked out of date if appropriate when the child is serialized. + * + * However, this is a major issue for a flush, as were this to happen + * in a flush, it would violate the invariant that the flush dependency + * feature is intended to enforce. As the metadata cache has no + * control over the behavior of cache clients, it has no way of + * preventing this behaviour. However, it should detect it if at all + * possible. + * + * Do this by maintaining a count of the number of times each entry is + * serialized during a cache serialization. If any flush dependency + * parent is serialized more than once, throw an assertion failure. + * + * 3) An entry relocation will typically change the location of the + * entry in the index list. This shouldn't cause problems as we + * will scan the index list until we make a complete pass without + * finding anything to serialize -- making relocations of either + * the current or next entries irrelevant. + * + * Note that since a relocation may result in our skipping part of + * the index list, we must always do at least one more pass through + * the index list after an entry relocation. + * + * 4) Changes in the flush dependency structure are possible on + * entry insertion, load, expunge, evict, or remove. Destruction + * of a flush dependency has no effect, as it can only relax the + * flush dependencies. Creation of a flush dependency can create + * an unserialized child of a flush dependency parent where all + * flush dependency children were previously serialized. Should + * this child dirty the flush dependency parent when it is serialized, + * the parent will be re-serialized. + * + * Per the discussion of 2) above, this is a non issue for cache + * serialization, and a major problem for cache flush. Using the + * same detection mechanism, throw an assertion failure if this + * condition appears. + * + * Observe that either eviction or removal of entries as a result of + * a serialization is not a problem as long as the flush depencency + * tree does not change beyond the removal of a leaf. + */ + while(!done) { + /* Reset the counters so that we can detect insertions, loads, + * moves, and flush dependency height changes caused by the pre_serialize + * and serialize callbacks. + */ + cache_ptr->entries_loaded_counter = 0; + cache_ptr->entries_inserted_counter = 0; + cache_ptr->entries_relocated_counter = 0; + + done = TRUE; /* set to FALSE if any activity in inner loop */ + entry_ptr = cache_ptr->il_head; + while(entry_ptr != NULL) { + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + + /* Verify that either the entry is already serialized, or + * that it is assigned to either the target or an inner + * ring. + */ + HDassert((entry_ptr->ring >= ring) || (entry_ptr->image_up_to_date)); + + /* Skip flush me last entries or inner ring entries */ + if(!entry_ptr->flush_me_last && entry_ptr->ring == ring) { + + /* if we encounter an unserialized entry in the current + * ring that is not marked flush me last, we are not done. + */ + if(!entry_ptr->image_up_to_date) + done = FALSE; + + /* Serialize the entry if its image is not up to date + * and it has no unserialized flush dependency children. + */ + if(!entry_ptr->image_up_to_date && entry_ptr->flush_dep_nunser_children == 0) { + HDassert(entry_ptr->serialization_count == 0); + + /* Serialize the entry */ + if(H5C__serialize_single_entry(f, dxpl_id, cache_ptr, entry_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "entry serialization failed") + + HDassert(entry_ptr->flush_dep_nunser_children == 0); + HDassert(entry_ptr->serialization_count == 0); + +#ifndef NDEBUG + /* Increment serialization counter (to detect multiple serializations) */ + entry_ptr->serialization_count++; +#endif /* NDEBUG */ + } /* end if */ + } /* end if */ + + /* Check for the cache being perturbed during the entry serialize */ + if((cache_ptr->entries_loaded_counter > 0) || + (cache_ptr->entries_inserted_counter > 0) || + (cache_ptr->entries_relocated_counter > 0)) { + +#if H5C_COLLECT_CACHE_STATS + H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr); +#endif /* H5C_COLLECT_CACHE_STATS */ + + /* Reset the counters */ + cache_ptr->entries_loaded_counter = 0; + cache_ptr->entries_inserted_counter = 0; + cache_ptr->entries_relocated_counter = 0; + + /* Restart scan */ + entry_ptr = cache_ptr->il_head; + } /* end if */ + else + /* Advance to next entry */ + entry_ptr = entry_ptr->il_next; + } /* while ( entry_ptr != NULL ) */ + } /* while ( ! done ) */ + + + /* Reset the counters so that we can detect insertions, loads, + * moves, and flush dependency height changes caused by the pre_serialize + * and serialize callbacks. + */ + cache_ptr->entries_loaded_counter = 0; + cache_ptr->entries_inserted_counter = 0; + cache_ptr->entries_relocated_counter = 0; + + /* At this point, all entries not marked "flush me last" and in + * the current ring or outside it should be serialized and have up + * to date images. Scan the index list again to serialize the + * "flush me last" entries (if they are in the current ring) and to + * verify that all other entries have up to date images. + */ + entry_ptr = cache_ptr->il_head; + while(entry_ptr != NULL) { + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(entry_ptr->ring > H5C_RING_UNDEFINED); + HDassert(entry_ptr->ring < H5C_RING_NTYPES); + HDassert((entry_ptr->ring >= ring) || (entry_ptr->image_up_to_date)); + + if(entry_ptr->ring == ring) { + if(entry_ptr->flush_me_last) { + if(!entry_ptr->image_up_to_date) { + HDassert(entry_ptr->serialization_count == 0); + HDassert(entry_ptr->flush_dep_nunser_children == 0); + + /* Serialize the entry */ + if(H5C__serialize_single_entry(f, dxpl_id, cache_ptr, entry_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "entry serialization failed") + + /* Check for the cache changing */ + if((cache_ptr->entries_loaded_counter > 0) || + (cache_ptr->entries_inserted_counter > 0) || + (cache_ptr->entries_relocated_counter > 0)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flush_me_last entry serialization triggered restart") + + HDassert(entry_ptr->flush_dep_nunser_children == 0); + HDassert(entry_ptr->serialization_count == 0); +#ifndef NDEBUG + /* Increment serialization counter (to detect multiple serializations) */ + entry_ptr->serialization_count++; +#endif /* NDEBUG */ + } /* end if */ + } /* end if */ + else { + HDassert(entry_ptr->image_up_to_date); + HDassert(entry_ptr->serialization_count <= 1); + HDassert(entry_ptr->flush_dep_nunser_children == 0); + } /* end else */ + } /* if ( entry_ptr->ring == ring ) */ + + entry_ptr = entry_ptr->il_next; + } /* while ( entry_ptr != NULL ) */ + +done: + HDassert(cache_ptr->serialization_in_progress); + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C__serialize_ring() */ + + +/*------------------------------------------------------------------------- + * Function: H5C__serialize_single_entry + * + * Purpose: Serialize the cache entry pointed to by the entry_ptr + * parameter. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: John Mainzer, 7/24/15 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5C__serialize_single_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr, + H5C_cache_entry_t *entry_ptr) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity checks */ + HDassert(f); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(entry_ptr); + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(!entry_ptr->prefetched); + HDassert(!entry_ptr->image_up_to_date); + HDassert(entry_ptr->is_dirty); + HDassert(!entry_ptr->is_protected); + HDassert(!entry_ptr->flush_in_progress); + HDassert(entry_ptr->type); + + /* Set entry_ptr->flush_in_progress to TRUE so the the target entry + * will not be evicted out from under us. Must set it back to FALSE + * when we are done. + */ + entry_ptr->flush_in_progress = TRUE; + + /* Allocate buffer for the entry image if required. */ + if(NULL == entry_ptr->image_ptr) { + HDassert(entry_ptr->size > 0); + if(NULL == (entry_ptr->image_ptr = H5MM_malloc(entry_ptr->size + H5C_IMAGE_EXTRA_SPACE)) ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for on disk image buffer") +#if H5C_DO_MEMORY_SANITY_CHECKS + HDmemcpy(((uint8_t *)entry_ptr->image_ptr) + image_size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); +#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + } /* end if */ + + /* Generate image for entry */ + if(H5C__generate_image(f, cache_ptr, entry_ptr, dxpl_id) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "Can't generate image for cache entry") + + /* Reset the flush_in progress flag */ + entry_ptr->flush_in_progress = FALSE; + +done: + HDassert((ret_value != SUCCEED) || (!entry_ptr->flush_in_progress)); + HDassert((ret_value != SUCCEED) || (entry_ptr->image_up_to_date)); + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C__serialize_single_entry() */ + + +/*------------------------------------------------------------------------- * Function: H5C__generate_image * * Purpose: Serialize an entry and generate its image. @@ -8186,7 +8503,7 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t * entry, * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, hid_t dxpl_id) { @@ -8196,10 +8513,18 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, unsigned serialize_flags = H5C__SERIALIZE_NO_FLAGS_SET; herr_t ret_value = SUCCEED; - FUNC_ENTER_STATIC + FUNC_ENTER_PACKAGE /* Sanity check */ + HDassert(f); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(entry_ptr); + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(!entry_ptr->image_up_to_date); + HDassert(entry_ptr->is_dirty); + HDassert(!entry_ptr->is_protected); + HDassert(entry_ptr->type); /* make note of the entry's current address */ old_addr = entry_ptr->addr; @@ -8213,8 +8538,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, /* Check for any flags set in the pre-serialize callback */ if(serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET) { /* Check for unexpected flags from serialize callback */ - if(serialize_flags & ~(H5C__SERIALIZE_RESIZED_FLAG | - H5C__SERIALIZE_MOVED_FLAG)) + if(serialize_flags & ~(H5C__SERIALIZE_RESIZED_FLAG | H5C__SERIALIZE_MOVED_FLAG)) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unknown serialize flag(s)") #ifdef H5_HAVE_PARALLEL @@ -8245,12 +8569,15 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, * tests will be necessary. */ if(cache_ptr->aux_ptr != NULL) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "resize/move in serialize occured in parallel case.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "resize/move in serialize occured in parallel case") #endif /* If required, resize the buffer and update the entry and the cache * data structures */ if(serialize_flags & H5C__SERIALIZE_RESIZED_FLAG) { + /* Sanity check */ + HDassert(new_len > 0); + /* Allocate a new image buffer */ if(NULL == (entry_ptr->image_ptr = H5MM_realloc(entry_ptr->image_ptr, new_len + H5C_IMAGE_EXTRA_SPACE))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for on disk image buffer") @@ -8261,9 +8588,8 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, /* Update statistics for resizing the entry */ H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_len); - /* update the hash table for the size change */ - H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, \ - new_len, entry_ptr, !(entry_ptr->is_dirty)); + /* Update the hash table for the size change */ + H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_len, entry_ptr, !(entry_ptr->is_dirty)); /* The entry can't be protected since we are in the process of * flushing it. Thus we must update the replacement policy data @@ -8276,10 +8602,11 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, * for the flush or flush destroy yet, the entry should * be in the slist. Thus update it for the size change. */ + HDassert(entry_ptr->is_dirty); HDassert(entry_ptr->in_slist); H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_len); - /* finally, update the entry for its new size */ + /* Finally, update the entry for its new size */ entry_ptr->size = new_len; } /* end if */ @@ -8296,10 +8623,10 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr, FAIL); H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE); - /* update the entry for its new address */ + /* Update the entry for its new address */ entry_ptr->addr = new_addr; - /* and then reinsert in the index and slist */ + /* And then reinsert in the index and slist */ H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL); H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL); } /* end if */ @@ -8316,6 +8643,13 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ entry_ptr->image_up_to_date = TRUE; + /* Propagate the fact that the entry is serialized up the + * flush dependency chain if appropriate. Since the image must + * have been out of date for this function to have been called + * (see assertion on entry), no need to check that -- only check + * for flush dependency parents. + */ + HDassert(entry_ptr->flush_dep_nunser_children == 0); if(entry_ptr->flush_dep_nparents > 0) if(H5C__mark_flush_dep_serialized(entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "Can't propagate serialization status to fd parents") diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index 5697bff..eb5f123 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -35,6 +35,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata Cache */ #include "H5Cpkg.h" /* Cache */ #include "H5Eprivate.h" /* Error Handling */ @@ -53,10 +54,6 @@ /* Local Prototypes */ /********************/ -#if 0 /* debugging routines */ -herr_t H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn); -#endif /* debugging routines */ - /*********************/ /* Package Variables */ @@ -104,7 +101,7 @@ H5C_dump_cache(H5C_t * cache_ptr, const char * cache_name) /* First, create a skip list */ if(NULL == (slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create skip list.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create skip list") /* Next, scan the index, and insert all entries in the skip list. * Do this, as we want to display cache entries in increasing address @@ -194,7 +191,7 @@ done: * *------------------------------------------------------------------------- */ -#if 0 /* debugging routine */ +#ifndef NDEBUG herr_t H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) { @@ -203,14 +200,14 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) H5C_cache_entry_t * entry_ptr = NULL; H5SL_node_t * node_ptr = NULL; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOERR HDassert(cache_ptr != NULL); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(calling_fcn != NULL); HDfprintf(stdout, "\n\nDumping metadata cache skip list from %s.\n", calling_fcn); - HDfprintf(stdout, " slist len = %d.\n", cache_ptr->slist_len); + HDfprintf(stdout, " slist len = %u.\n", cache_ptr->slist_len); HDfprintf(stdout, " slist size = %lld.\n", (long long)(cache_ptr->slist_size)); if(cache_ptr->slist_len > 0) { @@ -240,9 +237,9 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) (int)(entry_ptr->is_dirty), entry_ptr->type->name); - HDfprintf(stdout, " node_ptr = 0x%llx, item = 0x%llx\n", + HDfprintf(stdout, " node_ptr = 0x%llx, item = %p\n", (unsigned long long)node_ptr, - (unsigned long long)H5SL_item(node_ptr)); + H5SL_item(node_ptr)); /* increment node_ptr before we delete its target */ node_ptr = H5SL_next(node_ptr); @@ -257,10 +254,9 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) HDfprintf(stdout, "\n\n"); -done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_dump_cache_skip_list() */ -#endif /* debugging routine */ +#endif /* NDEBUG */ /*------------------------------------------------------------------------- @@ -285,7 +281,7 @@ H5C_set_prefix(H5C_t * cache_ptr, char * prefix) if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC) || (prefix == NULL) || (HDstrlen(prefix) >= H5C__PREFIX_LEN)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry") HDstrncpy(&(cache_ptr->prefix[0]), prefix, (size_t)(H5C__PREFIX_LEN)); @@ -385,6 +381,7 @@ H5C_stats(H5C_t * cache_ptr, size_t aggregate_max_size = 0; int32_t aggregate_max_pins = 0; double hit_rate; + double prefetch_use_rate; double average_successful_search_depth = 0.0f; double average_failed_search_depth = 0.0f; double average_entries_skipped_per_calls_to_msic = 0.0f; @@ -490,12 +487,12 @@ H5C_stats(H5C_t * cache_ptr, average_failed_search_depth); HDfprintf(stdout, - "%s current (max) index size / length = %ld (%ld) / %ld (%ld)\n", + "%s current (max) index size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix, (long)(cache_ptr->index_size), (long)(cache_ptr->max_index_size), - (long)(cache_ptr->index_len), - (long)(cache_ptr->max_index_len)); + (unsigned long)(cache_ptr->index_len), + (unsigned long)(cache_ptr->max_index_len)); HDfprintf(stdout, "%s current (max) clean/dirty idx size = %ld (%ld) / %ld (%ld)\n", @@ -506,46 +503,46 @@ H5C_stats(H5C_t * cache_ptr, (long)(cache_ptr->max_dirty_index_size)); HDfprintf(stdout, - "%s current (max) slist size / length = %ld (%ld) / %ld (%ld)\n", + "%s current (max) slist size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix, (long)(cache_ptr->slist_size), (long)(cache_ptr->max_slist_size), - (long)(cache_ptr->slist_len), - (long)(cache_ptr->max_slist_len)); + (unsigned long)(cache_ptr->slist_len), + (unsigned long)(cache_ptr->max_slist_len)); HDfprintf(stdout, - "%s current (max) PL size / length = %ld (%ld) / %ld (%ld)\n", + "%s current (max) PL size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix, (long)(cache_ptr->pl_size), (long)(cache_ptr->max_pl_size), - (long)(cache_ptr->pl_len), - (long)(cache_ptr->max_pl_len)); + (unsigned long)(cache_ptr->pl_len), + (unsigned long)(cache_ptr->max_pl_len)); HDfprintf(stdout, - "%s current (max) PEL size / length = %ld (%ld) / %ld (%ld)\n", + "%s current (max) PEL size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix, (long)(cache_ptr->pel_size), (long)(cache_ptr->max_pel_size), - (long)(cache_ptr->pel_len), - (long)(cache_ptr->max_pel_len)); + (unsigned long)(cache_ptr->pel_len), + (unsigned long)(cache_ptr->max_pel_len)); HDfprintf(stdout, - "%s current LRU list size / length = %ld / %ld\n", + "%s current LRU list size / length = %ld / %lu\n", cache_ptr->prefix, (long)(cache_ptr->LRU_list_size), - (long)(cache_ptr->LRU_list_len)); + (unsigned long)(cache_ptr->LRU_list_len)); HDfprintf(stdout, - "%s current clean LRU size / length = %ld / %ld\n", + "%s current clean LRU size / length = %ld / %lu\n", cache_ptr->prefix, (long)(cache_ptr->cLRU_list_size), - (long)(cache_ptr->cLRU_list_len)); + (unsigned long)(cache_ptr->cLRU_list_len)); HDfprintf(stdout, - "%s current dirty LRU size / length = %ld / %ld\n", + "%s current dirty LRU size / length = %ld / %lu\n", cache_ptr->prefix, (long)(cache_ptr->dLRU_list_size), - (long)(cache_ptr->dLRU_list_len)); + (unsigned long)(cache_ptr->dLRU_list_len)); HDfprintf(stdout, "%s Total hits / misses / hit_rate = %ld / %ld / %f\n", @@ -648,6 +645,38 @@ H5C_stats(H5C_t * cache_ptr, (long long)(cache_ptr->LRU_scan_restarts), (long long)(cache_ptr->index_scan_restarts)); + HDfprintf(stdout, + "%s cache image creations/loads/size = %d / %d / %Hu\n", + cache_ptr->prefix, + cache_ptr->images_created, + cache_ptr->images_loaded, + cache_ptr->last_image_size); + + HDfprintf(stdout, + "%s prefetches / dirty prefetches = %lld / %lld\n", + cache_ptr->prefix, + (long long)(cache_ptr->prefetches), + (long long)(cache_ptr->dirty_prefetches)); + + HDfprintf(stdout, + "%s prefetch hits/flushes/evictions = %lld / %lld / %lld\n", + cache_ptr->prefix, + (long long)(cache_ptr->prefetch_hits), + (long long)(cache_ptr->flushes[H5AC_PREFETCHED_ENTRY_ID]), + (long long)(cache_ptr->evictions[H5AC_PREFETCHED_ENTRY_ID])); + + if(cache_ptr->prefetches > 0) + prefetch_use_rate = + (double)100.0f * ((double)(cache_ptr->prefetch_hits)) / + ((double)(cache_ptr->prefetches)); + else + prefetch_use_rate = 0.0f; + + HDfprintf(stdout, + "%s prefetched entry use rate = %lf\n", + cache_ptr->prefix, + prefetch_use_rate); + #if H5C_COLLECT_CACHE_ENTRY_STATS HDfprintf(stdout, "%s aggregate max / min accesses = %d / %d\n", @@ -673,7 +702,7 @@ H5C_stats(H5C_t * cache_ptr, HDfprintf(stdout, "%s Stats on %s:\n", cache_ptr->prefix, - ((cache_ptr->type_name_table_ptr))[i]); + ((cache_ptr->class_table_ptr))[i]->name); if((cache_ptr->hits[i] > 0) || (cache_ptr->misses[i] > 0)) hit_rate = (double)100.0f * ((double)(cache_ptr->hits[i])) / @@ -869,6 +898,14 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr) cache_ptr->LRU_scan_restarts = 0; cache_ptr->index_scan_restarts = 0; + cache_ptr->images_created = 0; + cache_ptr->images_loaded = 0; + cache_ptr->last_image_size = (hsize_t)0; + + cache_ptr->prefetches = 0; + cache_ptr->dirty_prefetches = 0; + cache_ptr->prefetch_hits = 0; + #if H5C_COLLECT_CACHE_ENTRY_STATS for(i = 0; i <= cache_ptr->max_type_id; i++) { cache_ptr->max_accesses[i] = 0; @@ -952,6 +989,303 @@ H5C__dump_entry(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, if(entry_ptr->flush_dep_nchildren) H5C__dump_children(cache_ptr, entry_ptr, FALSE, "Child", indent); } /* end H5C__dump_entry() */ + + +/*------------------------------------------------------------------------- + * Function: H5C_flush_dependency_exists() + * + * Purpose: Test to see if a flush dependency relationship exists + * between the supplied parent and child. Both parties + * are indicated by addresses so as to avoid the necessity + * of protect / unprotect calls prior to this call. + * + * If either the parent or the child is not in the metadata + * cache, the function sets *fd_exists_ptr to FALSE. + * + * If both are in the cache, the childs list of parents is + * searched for the proposed parent. If the proposed parent + * is found in the childs parent list, the function sets + * *fd_exists_ptr to TRUE. In all other non-error cases, + * the function sets *fd_exists_ptr FALSE. + * + * Return: SUCCEED on success/FAIL on failure. Note that + * *fd_exists_ptr is undefined on failure. + * + * Programmer: John Mainzer + * 9/28/16 + * + *------------------------------------------------------------------------- + */ +#ifndef NDEBUG +herr_t +H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child_addr, + hbool_t *fd_exists_ptr) +{ + hbool_t fd_exists = FALSE; /* whether flush dependency exists */ + H5C_cache_entry_t * parent_ptr; /* Ptr to parent entry */ + H5C_cache_entry_t * child_ptr; /* Ptr to child entry */ + hbool_t ret_value = FALSE; /* Return value */ + + FUNC_ENTER_NOAPI(NULL) + + /* Sanity checks */ + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(H5F_addr_defined(parent_addr)); + HDassert(H5F_addr_defined(child_addr)); + HDassert(fd_exists_ptr); + + H5C__SEARCH_INDEX(cache_ptr, parent_addr, parent_ptr, FAIL) + H5C__SEARCH_INDEX(cache_ptr, child_addr, child_ptr, FAIL) + + if(parent_ptr && child_ptr) { + HDassert(parent_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(child_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + + if(child_ptr->flush_dep_nparents > 0) { + unsigned u; /* Local index variable */ + + HDassert(child_ptr->flush_dep_parent); + HDassert(child_ptr->flush_dep_parent_nalloc >= child_ptr->flush_dep_nparents); + + for(u = 0; u < child_ptr->flush_dep_nparents; u++) { + if(child_ptr->flush_dep_parent[u] == parent_ptr) { + fd_exists = TRUE; + HDassert(parent_ptr->flush_dep_nchildren > 0); + break; + } /* end if */ + } /* end for */ + } /* end if */ + } /* end if */ + + *fd_exists_ptr = fd_exists; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C_flush_dependency_exists() */ +#endif /* NDEBUG */ + + +/*------------------------------------------------------------------------- + * + * Function: H5C_validate_index_list + * + * Purpose: Debugging function that scans the index list for errors. + * + * If an error is detected, the function generates a + * diagnostic and returns FAIL. If no error is detected, + * the function returns SUCCEED. + * + * Return: FAIL if error is detected, SUCCEED otherwise. + * + * Programmer: John Mainzer, 9/16/16 + * + *------------------------------------------------------------------------- + */ +#ifndef NDEBUG +herr_t +H5C_validate_index_list(H5C_t *cache_ptr) +{ + H5C_cache_entry_t * entry_ptr = NULL; + uint32_t len = 0; + int32_t index_ring_len[H5C_RING_NTYPES]; + size_t size = 0; + size_t clean_size = 0; + size_t dirty_size = 0; + size_t index_ring_size[H5C_RING_NTYPES]; + size_t clean_index_ring_size[H5C_RING_NTYPES]; + size_t dirty_index_ring_size[H5C_RING_NTYPES]; + int i; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + + for(i = 0; i < H5C_RING_NTYPES; i++) { + index_ring_len[i] = 0; + index_ring_size[i] = 0; + clean_index_ring_size[i] = 0; + dirty_index_ring_size[i] = 0; + } /* end if */ + + if(((cache_ptr->il_head == NULL) || (cache_ptr->il_tail == NULL)) + && (cache_ptr->il_head != cache_ptr->il_tail)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointer validation failed") + + if((cache_ptr->index_len == 1) && ((cache_ptr->il_head != cache_ptr->il_tail) + || (cache_ptr->il_head == NULL) || (cache_ptr->il_head->size != cache_ptr->index_size))) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointer sanity checks failed") + + if((cache_ptr->index_len >= 1) + && ((cache_ptr->il_head == NULL) + || (cache_ptr->il_head->il_prev != NULL) + || (cache_ptr->il_tail == NULL) + || (cache_ptr->il_tail->il_next != NULL))) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list length sanity checks failed") + + entry_ptr = cache_ptr->il_head; + while(entry_ptr != NULL) { + if((entry_ptr != cache_ptr->il_head) + && ((entry_ptr->il_prev == NULL) || (entry_ptr->il_prev->il_next != entry_ptr))) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointers for entry are invalid") + + if((entry_ptr != cache_ptr->il_tail) + && ((entry_ptr->il_next == NULL) || (entry_ptr->il_next->il_prev != entry_ptr))) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointers for entry are invalid") + + HDassert(entry_ptr->ring > 0); + HDassert(entry_ptr->ring < H5C_RING_NTYPES); + + len++; + index_ring_len[entry_ptr->ring] += 1; + + size += entry_ptr->size; + index_ring_size[entry_ptr->ring] += entry_ptr->size; + + if(entry_ptr->is_dirty) { + dirty_size += entry_ptr->size; + dirty_index_ring_size[entry_ptr->ring] += entry_ptr->size; + } /* end if */ + else { + clean_size += entry_ptr->size; + clean_index_ring_size[entry_ptr->ring] += entry_ptr->size; + } /* end else */ + + entry_ptr = entry_ptr->il_next; + } /* end while */ + + if((cache_ptr->index_len != len) || (cache_ptr->il_len != len) + || (cache_ptr->index_size != size) || (cache_ptr->il_size != size) + || (cache_ptr->clean_index_size != clean_size) + || (cache_ptr->dirty_index_size != dirty_size) + || (clean_size + dirty_size != size)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index, clean and dirty sizes for cache are invalid") + + size = 0; + clean_size = 0; + dirty_size = 0; + for(i = 0; i < H5C_RING_NTYPES; i++) { + size += clean_index_ring_size[i] + dirty_index_ring_size[i]; + clean_size += clean_index_ring_size[i]; + dirty_size += dirty_index_ring_size[i]; + } /* end for */ + + if((cache_ptr->index_size != size) + || (cache_ptr->clean_index_size != clean_size) + || (cache_ptr->dirty_index_size != dirty_size)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index, clean and dirty sizes for cache are invalid") + +done: + if(ret_value != SUCCEED) + HDassert(0); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C_validate_index_list() */ +#endif /* NDEBUG */ + + +/*------------------------------------------------------------------------- + * + * Function: H5C_get_entry_ptr_from_addr() + * + * Purpose: Debugging function that attempts to look up an entry in the + * cache by its file address, and if found, returns a pointer + * to the entry in *entry_ptr_ptr. If the entry is not in the + * cache, *entry_ptr_ptr is set to NULL. + * + * WARNING: This call should be used only in debugging + * routines, and it should be avoided when + * possible. + * + * Further, if we ever multi-thread the cache, + * this routine will have to be either discarded + * or heavily re-worked. + * + * Finally, keep in mind that the entry whose + * pointer is obtained in this fashion may not + * be in a stable state. + * + * Note that this function is only defined if NDEBUG + * is not defined. + * + * As heavy use of this function is almost certainly a + * bad idea, the metadata cache tracks the number of + * successful calls to this function, and (if + * H5C_DO_SANITY_CHECKS is defined) displays any + * non-zero count on cache shutdown. + * + * Return: FAIL if error is detected, SUCCEED otherwise. + * + * Programmer: John Mainzer, 5/30/14 + * + *------------------------------------------------------------------------- + */ +#ifndef NDEBUG +herr_t +H5C_get_entry_ptr_from_addr(H5C_t *cache_ptr, haddr_t addr, void **entry_ptr_ptr) +{ + H5C_cache_entry_t * entry_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(H5F_addr_defined(addr)); + HDassert(entry_ptr_ptr); + + H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) + + if(entry_ptr == NULL) + /* the entry doesn't exist in the cache -- report this + * and quit. + */ + *entry_ptr_ptr = NULL; + else { + *entry_ptr_ptr = entry_ptr; + + /* increment call counter */ + (cache_ptr->get_entry_ptr_from_addr_counter)++; + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C_get_entry_ptr_from_addr() */ +#endif /* NDEBUG */ + + +/*------------------------------------------------------------------------- + * Function: H5C_get_serialization_in_progress + * + * Purpose: Return the current value of + * cache_ptr->serialization_in_progress. + * + * Return: Current value of cache_ptr->serialization_in_progress. + * + * Programmer: John Mainzer + * 8/24/15 + * + *------------------------------------------------------------------------- + */ +#ifndef NDEBUG +hbool_t +H5C_get_serialization_in_progress(const H5C_t *cache_ptr) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + + FUNC_LEAVE_NOAPI(cache_ptr->serialization_in_progress) +} /* H5C_get_serialization_in_progress() */ +#endif /* NDEBUG */ + + /*------------------------------------------------------------------------- * * Function: H5C_cache_is_clean() @@ -986,12 +1320,79 @@ H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring) while(ring <= inner_ring) { if(cache_ptr->dirty_index_ring_size[ring] > 0) - ret_value = FALSE; + HGOTO_DONE(FALSE) ring++; } /* end while */ +done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_cache_is_clean() */ #endif /* NDEBUG */ + +/*------------------------------------------------------------------------- + * + * Function: H5C_verify_entry_type() + * + * Purpose: Debugging function that attempts to look up an entry in the + * cache by its file address, and if found, test to see if its + * type field contains the expted value. + * + * If the specified entry is in cache, *in_cache_ptr is set + * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending + * on whether the entries type field matches the expected_type + * parameter. + * + * If the target entry is not in cache, *in_cache_ptr is + * set to FALSE, and *type_ok_ptr is undefined. + * + * Note that this function is only defined if NDEBUG + * is not defined. + * + * Return: FAIL if error is detected, SUCCEED otherwise. + * + * Programmer: John Mainzer, 5/30/14 + * + *------------------------------------------------------------------------- + */ +#ifndef NDEBUG +herr_t +H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, + const H5C_class_t *expected_type, hbool_t *in_cache_ptr, + hbool_t *type_ok_ptr) +{ + H5C_cache_entry_t * entry_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(H5F_addr_defined(addr)); + HDassert(expected_type); + HDassert(in_cache_ptr); + HDassert(type_ok_ptr); + + H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) + + if(entry_ptr == NULL) + /* the entry doesn't exist in the cache -- report this + * and quit. + */ + *in_cache_ptr = FALSE; + else { + *in_cache_ptr = TRUE; + + if(entry_ptr->prefetched) + *type_ok_ptr = (expected_type->id == entry_ptr->prefetch_type_id); + else + *type_ok_ptr = (expected_type == entry_ptr->type); + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C_verify_entry_type() */ +#endif /* NDEBUG */ + diff --git a/src/H5Cepoch.c b/src/H5Cepoch.c index e576028..655d795 100644 --- a/src/H5Cepoch.c +++ b/src/H5Cepoch.c @@ -92,8 +92,7 @@ static herr_t H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, /*******************/ -const H5C_class_t H5C__epoch_marker_class = -{ +const H5AC_class_t H5AC_EPOCH_MARKER[1] = {{ /* id = */ H5AC_EPOCH_MARKER_ID, /* name = */ "epoch marker", /* mem_type = */ H5FD_MEM_DEFAULT, /* value doesn't matter */ @@ -108,7 +107,7 @@ const H5C_class_t H5C__epoch_marker_class = /* notify = */ H5C__epoch_marker_notify, /* free_icr = */ H5C__epoch_marker_free_icr, /* fsf_size = */ H5C__epoch_marker_fsf_size, -}; +}}; /*************************************************************************** diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index ab94879..ebb98b3 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -164,38 +164,13 @@ static herr_t H5C__collective_write(H5F_t *f, hid_t dxpl_id); * Programmer: John Mainzer * 3/17/10 * - * Changes: Ported code to detect next entry status changes as the - * the result of a flush from the serial code in the scan of - * the LRU. Also added code to detect and adapt to the - * removal from the cache of the next entry in the scan of - * the LRU. - * - * Note that at present, all of these changes should not - * be required as the operations on entries as they are - * flushed that can cause these condiditions are not premitted - * in the parallel case. However, Quincey indicates that - * this may change, and thus has requested the modification. - * - * Note the assert(FALSE) in the if statement whose body - * restarts the scan of the LRU. As the body of the if - * statement should be unreachable, it should never be - * triggered until the constraints on the parallel case - * are relaxed. Please remove the assertion at that time. - * - * Also added warning on the Pinned Entry List scan, as it - * is potentially subject to the same issue. As there is - * no cognate of this scan in the serial code, I don't have - * a fix to port to it. - * - * JRM -- 4/10/19 - * *------------------------------------------------------------------------- */ herr_t H5C_apply_candidate_list(H5F_t * f, hid_t dxpl_id, H5C_t * cache_ptr, - int num_candidates, + unsigned num_candidates, haddr_t * candidates_list_ptr, int mpi_rank, int mpi_size) @@ -205,19 +180,19 @@ H5C_apply_candidate_list(H5F_t * f, int i; int m; int n; - int first_entry_to_flush; - int last_entry_to_flush; - int entries_to_clear = 0; - int entries_to_flush = 0; - int entries_to_flush_or_clear_last = 0; - int entries_to_flush_collectively = 0; - int entries_cleared = 0; - int entries_flushed = 0; - int entries_delayed = 0; - int entries_flushed_or_cleared_last = 0; - int entries_flushed_collectively = 0; - int entries_examined = 0; - int initial_list_len; + unsigned first_entry_to_flush; + unsigned last_entry_to_flush; + unsigned entries_to_clear = 0; + unsigned entries_to_flush = 0; + unsigned entries_to_flush_or_clear_last = 0; + unsigned entries_to_flush_collectively = 0; + unsigned entries_cleared = 0; + unsigned entries_flushed = 0; + unsigned entries_delayed = 0; + unsigned entries_flushed_or_cleared_last = 0; + unsigned entries_flushed_collectively = 0; + unsigned entries_examined = 0; + unsigned initial_list_len; int * candidate_assignment_table = NULL; haddr_t addr; H5C_cache_entry_t * clear_ptr = NULL; @@ -231,29 +206,30 @@ H5C_apply_candidate_list(H5F_t * f, #if H5C_APPLY_CANDIDATE_LIST__DEBUG char tbl_buf[1024]; #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ - herr_t ret_value = SUCCEED; /* Return value */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert( cache_ptr != NULL ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( num_candidates > 0 ); - HDassert( num_candidates <= cache_ptr->slist_len ); - HDassert( candidates_list_ptr != NULL ); - HDassert( 0 <= mpi_rank ); - HDassert( mpi_rank < mpi_size ); + /* Sanity checks */ + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(num_candidates > 0); + HDassert(num_candidates <= cache_ptr->slist_len); + HDassert(candidates_list_ptr != NULL); + HDassert(0 <= mpi_rank); + HDassert(mpi_rank < mpi_size); #if H5C_APPLY_CANDIDATE_LIST__DEBUG - HDfprintf(stdout, "%s:%d: setting up candidate assignment table.\n", - FUNC, mpi_rank); - for ( i = 0; i < 1024; i++ ) tbl_buf[i] = '\0'; + HDfprintf(stdout, "%s:%d: setting up candidate assignment table.\n", FUNC, mpi_rank); + + HDmemset(tbl_buf, 0, sizeof(tbl_buf)); + sprintf(&(tbl_buf[0]), "candidate list = "); - for ( i = 0; i < num_candidates; i++ ) - { - sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " 0x%llx", - (long long)(*(candidates_list_ptr + i))); - } + for(u = 0; u < num_candidates; u++) + sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " 0x%llx", (long long)(*(candidates_list_ptr + u))); sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n"); + HDfprintf(stdout, "%s", tbl_buf); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ @@ -269,7 +245,6 @@ H5C_apply_candidate_list(H5F_t * f, n = num_candidates / mpi_size; m = num_candidates % mpi_size; HDassert(n >= 0); - if(NULL == (candidate_assignment_table = (int *)H5MM_malloc(sizeof(int) * (size_t)(mpi_size + 1)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for candidate assignment table") @@ -297,9 +272,8 @@ H5C_apply_candidate_list(H5F_t * f, HDassert((candidate_assignment_table[mpi_size - 1] + n) == num_candidates); #if H5C_DO_SANITY_CHECKS - /* verify that the candidate assignment table has the expected form */ - for ( i = 1; i < mpi_size - 1; i++ ) - { + /* Verify that the candidate assignment table has the expected form */ + for(i = 1; i < mpi_size - 1; i++) { int a, b; a = candidate_assignment_table[i] - candidate_assignment_table[i - 1]; @@ -323,73 +297,71 @@ H5C_apply_candidate_list(H5F_t * f, sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n"); HDfprintf(stdout, "%s", tbl_buf); - HDfprintf(stdout, "%s:%d: flush entries [%d, %d].\n", + HDfprintf(stdout, "%s:%d: flush entries [%u, %u].\n", FUNC, mpi_rank, first_entry_to_flush, last_entry_to_flush); HDfprintf(stdout, "%s:%d: marking entries.\n", FUNC, mpi_rank); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ - for(i = 0; i < num_candidates; i++) { - addr = candidates_list_ptr[i]; - HDassert( H5F_addr_defined(addr) ); + for(u = 0; u < num_candidates; u++) { + addr = candidates_list_ptr[u]; + HDassert(H5F_addr_defined(addr)); #if H5C_DO_SANITY_CHECKS - if ( i > 0 ) { - if ( last_addr == addr ) { - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Duplicate entry in cleaned list.\n") - } else if ( last_addr > addr ) { - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "candidate list not sorted.\n") - } - } + if(u > 0) { + if(last_addr == addr) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "duplicate entry in cleaned list") + else if(last_addr > addr) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "candidate list not sorted") + } /* end if */ last_addr = addr; #endif /* H5C_DO_SANITY_CHECKS */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) - if(entry_ptr == NULL) { - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed candidate entry not in cache?!?!?.") - } else if(!entry_ptr->is_dirty) { - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not dirty?!?!?.") - } else if ( entry_ptr->is_protected ) { + if(entry_ptr == NULL) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "listed candidate entry not in cache?!?!?") + if(!entry_ptr->is_dirty) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not dirty?!?!?") + if(entry_ptr->is_protected) /* For now at least, we can't deal with protected entries. * If we encounter one, scream and die. If it becomes an * issue, we should be able to work around this. */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry is protected?!?!?.") - } else { - /* determine whether the entry is to be cleared or flushed, - * and mark it accordingly. We will scan the protected and - * pinned list shortly, and clear or flush according to these - * markings. - */ - if((i >= first_entry_to_flush) && (i <= last_entry_to_flush)) { - entries_to_flush++; - entry_ptr->flush_immediately = TRUE; - } /* end if */ - else { - entries_to_clear++; - entry_ptr->clear_on_unprotect = TRUE; - } /* end else */ - - /* Entries marked as collectively accessed and are in the - candidate list to clear from the cache have to be - removed from the coll list. This is OK since the - candidate list is collective and uniform across all - ranks. */ - if(TRUE == entry_ptr->coll_access) { - entry_ptr->coll_access = FALSE; - H5C__REMOVE_FROM_COLL_LIST(cache_ptr, entry_ptr, FAIL) - } /* end if */ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry is protected?!?!?") + + /* Determine whether the entry is to be cleared or flushed, + * and mark it accordingly. We will scan the protected and + * pinned list shortly, and clear or flush according to these + * markings. + */ + if(u >= first_entry_to_flush && u <= last_entry_to_flush) { + entries_to_flush++; + entry_ptr->flush_immediately = TRUE; + } /* end if */ + else { + entries_to_clear++; + entry_ptr->clear_on_unprotect = TRUE; } /* end else */ + + /* Entries marked as collectively accessed and are in the + * candidate list to clear from the cache have to be + * removed from the coll list. This is OK since the + * candidate list is collective and uniform across all + * ranks. + */ + if(entry_ptr->coll_access) { + entry_ptr->coll_access = FALSE; + H5C__REMOVE_FROM_COLL_LIST(cache_ptr, entry_ptr, FAIL) + } /* end if */ } /* end for */ #if H5C_APPLY_CANDIDATE_LIST__DEBUG - HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %d/%d/%d.\n", - FUNC, mpi_rank, (int)num_candidates, (int)entries_to_clear, - (int)entries_to_flush); + HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %u/%u/%u.\n", + FUNC, mpi_rank, num_candidates, entries_to_clear, + entries_to_flush); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ - /* We have now marked all the entries on the candidate list for * either flush or clear -- now scan the LRU and the pinned list * for these entries and do the deed. @@ -586,7 +558,7 @@ H5C_apply_candidate_list(H5F_t * f, } /* end while */ #if H5C_APPLY_CANDIDATE_LIST__DEBUG - HDfprintf(stdout, "%s:%d: entries examined/cleared/flushed = %d/%d/%d.\n", + HDfprintf(stdout, "%s:%d: entries examined/cleared/flushed = %u/%u/%u.\n", FUNC, mpi_rank, entries_examined, entries_cleared, entries_flushed); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ @@ -713,7 +685,7 @@ H5C_apply_candidate_list(H5F_t * f, #if H5C_APPLY_CANDIDATE_LIST__DEBUG HDfprintf(stdout, - "%s:%d: pel entries examined/cleared/flushed = %d/%d/%d.\n", + "%s:%d: pel entries examined/cleared/flushed = %u/%u/%u.\n", FUNC, mpi_rank, entries_examined, entries_cleared, entries_flushed); HDfprintf(stdout, "%s:%d: done.\n", FUNC, mpi_rank); @@ -758,7 +730,7 @@ H5C_apply_candidate_list(H5F_t * f, /* Write collective list */ if(H5C__collective_write(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "Can't write metadata collectively") + HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "can't write metadata collectively") } /* end if */ /* ====================================================================== * @@ -774,12 +746,11 @@ H5C_apply_candidate_list(H5F_t * f, (entries_cleared != entries_to_clear) || (entries_flushed_or_cleared_last != entries_to_flush_or_clear_last) || (entries_flushed_collectively != entries_to_flush_collectively)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry count mismatch.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry count mismatch") done: if(candidate_assignment_table != NULL) candidate_assignment_table = (int *)H5MM_xfree((void *)candidate_assignment_table); - if(cache_ptr->coll_write_list) { if(H5SL_close(cache_ptr->coll_write_list) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "failed to destroy skip list") @@ -836,7 +807,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) if(space_needed > 0) { /* we have work to do */ H5C_cache_entry_t *entry_ptr; - int nominated_entries_count = 0; + unsigned nominated_entries_count = 0; size_t nominated_entries_size = 0; haddr_t nominated_addr; @@ -857,7 +828,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) nominated_addr = entry_ptr->addr; if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed(1).") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed") nominated_entries_size += entry_ptr->size; nominated_entries_count++; @@ -881,7 +852,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) nominated_addr = entry_ptr->addr; if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed(2).") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed") nominated_entries_size += entry_ptr->size; nominated_entries_count++; @@ -950,7 +921,7 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr) if(space_needed > 0) { /* we have work to do */ H5C_cache_entry_t *entry_ptr; - int nominated_entries_count = 0; + unsigned nominated_entries_count = 0; size_t nominated_entries_size = 0; HDassert( cache_ptr->slist_len > 0 ); @@ -973,7 +944,7 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr) nominated_addr = entry_ptr->addr; if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed") nominated_entries_size += entry_ptr->size; nominated_entries_count++; @@ -1017,51 +988,28 @@ done: * Programmer: John Mainzer * 7/5/05 * - * Changes: Tidied up code, removeing some old commented out - * code that had been left in pending success of the - * new version. - * - * Note that unlike H5C_apply_candidate_list(), - * H5C_mark_entries_as_clean() makes all its calls to - * H5C__flush_single_entry() with the - * H5C__FLUSH_CLEAR_ONLY_FLAG set. As a result, - * the pre_serialize() and serialize calls are not made. - * - * This then implies that (assuming such actions were - * permitted in the parallel case) no loads, dirties, - * resizes, or removals of other entries can occur as - * a side effect of the flush. Hence, there is no need - * for the checks for entry removal / status change - * that I ported to H5C_apply_candidate_list(). - * - * However, if (in addition to allowing such operations - * in the parallel case), we allow such operations outside - * of the pre_serialize / serialize routines, this may - * cease to be the case -- requiring a review of this - * function. - * *------------------------------------------------------------------------- */ herr_t H5C_mark_entries_as_clean(H5F_t * f, hid_t dxpl_id, - int32_t ce_array_len, + unsigned ce_array_len, haddr_t * ce_array_ptr) { H5C_t * cache_ptr; - int entries_cleared; - int entries_examined; - int i; - int initial_list_len; + unsigned entries_cleared; + unsigned entries_examined; + unsigned initial_list_len; haddr_t addr; #if H5C_DO_SANITY_CHECKS - int pinned_entries_marked = 0; - int protected_entries_marked = 0; - int other_entries_marked = 0; + unsigned pinned_entries_marked = 0; + unsigned protected_entries_marked = 0; + unsigned other_entries_marked = 0; haddr_t last_addr; #endif /* H5C_DO_SANITY_CHECKS */ H5C_cache_entry_t * clear_ptr = NULL; H5C_cache_entry_t * entry_ptr = NULL; + unsigned u; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1076,46 +1024,30 @@ H5C_mark_entries_as_clean(H5F_t * f, HDassert( ce_array_ptr != NULL ); #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "an extreme sanity check failed on entry.\n"); - } + if(H5C_validate_protected_entry_list(cache_ptr) < 0 || + H5C_validate_pinned_entry_list(cache_ptr) < 0 || + H5C_validate_lru_list(cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ - for ( i = 0; i < ce_array_len; i++ ) - { - addr = ce_array_ptr[i]; + for(u = 0; u < ce_array_len; u++) { + addr = ce_array_ptr[u]; #if H5C_DO_SANITY_CHECKS - if ( i == 0 ) { - + if(u == 0) last_addr = addr; - - } else { - - if ( last_addr == addr ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Duplicate entry in cleaned list.\n"); - - } else if ( last_addr > addr ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "cleaned list not sorted.\n"); - } - } + else { + if(last_addr == addr) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Duplicate entry in cleaned list") + if(last_addr > addr) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cleaned list not sorted") + } /* end else */ #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "an extreme sanity check failed in for loop.\n"); - } + if(H5C_validate_protected_entry_list(cache_ptr) < 0 + || H5C_validate_pinned_entry_list(cache_ptr) < 0 + || H5C_validate_lru_list(cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed in for loop") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ #endif /* H5C_DO_SANITY_CHECKS */ @@ -1123,28 +1055,24 @@ H5C_mark_entries_as_clean(H5F_t * f, H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) - if ( entry_ptr == NULL ) { + if(entry_ptr == NULL) { #if H5C_DO_SANITY_CHECKS HDfprintf(stdout, - "H5C_mark_entries_as_clean: entry[%d] = %ld not in cache.\n", - (int)i, - (long)addr); + "H5C_mark_entries_as_clean: entry[%u] = %a not in cache.\n", + u, + addr); #endif /* H5C_DO_SANITY_CHECKS */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Listed entry not in cache?!?!?.") - - } else if ( ! entry_ptr->is_dirty ) { - + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not in cache?!?!?") + } /* end if */ + else if(!entry_ptr->is_dirty) { #if H5C_DO_SANITY_CHECKS HDfprintf(stdout, - "H5C_mark_entries_as_clean: entry %ld is not dirty!?!\n", - (long)addr); + "H5C_mark_entries_as_clean: entry %a is not dirty!?!\n", + addr); #endif /* H5C_DO_SANITY_CHECKS */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Listed entry not dirty?!?!?.") - - } else { - + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not dirty?!?!?") + } /* end else-if */ + else { /* Mark the entry to be cleared on unprotect. We will * scan the LRU list shortly, and clear all those entries * not currently protected. @@ -1200,31 +1128,25 @@ H5C_mark_entries_as_clean(H5F_t * f, * point. * JRM -- 4/7/15 */ - entries_cleared = 0; entries_examined = 0; initial_list_len = cache_ptr->LRU_list_len; entry_ptr = cache_ptr->LRU_tail_ptr; - - while ( ( entry_ptr != NULL ) && - ( entries_examined <= initial_list_len ) && - ( entries_cleared < ce_array_len ) ) - { - if ( entry_ptr->clear_on_unprotect ) { - + while(entry_ptr != NULL && entries_examined <= initial_list_len && + entries_cleared < ce_array_len) { + if(entry_ptr->clear_on_unprotect) { entry_ptr->clear_on_unprotect = FALSE; clear_ptr = entry_ptr; entry_ptr = entry_ptr->prev; entries_cleared++; if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry.") - } else { - + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear entry") + } /* end if */ + else entry_ptr = entry_ptr->prev; - } entries_examined++; - } + } /* end while */ #if H5C_DO_SANITY_CHECKS HDassert( entries_cleared == other_entries_marked ); @@ -1233,25 +1155,20 @@ H5C_mark_entries_as_clean(H5F_t * f, /* It is also possible that some of the cleared entries are on the * pinned list. Must scan that also. */ - entry_ptr = cache_ptr->pel_head_ptr; - - while ( entry_ptr != NULL ) - { - if ( entry_ptr->clear_on_unprotect ) { - + while(entry_ptr != NULL) { + if(entry_ptr->clear_on_unprotect) { entry_ptr->clear_on_unprotect = FALSE; clear_ptr = entry_ptr; entry_ptr = entry_ptr->next; entries_cleared++; - if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry.") - } else { - + if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry") + } /* end if */ + else entry_ptr = entry_ptr->next; - } - } + } /* end while */ #if H5C_DO_SANITY_CHECKS HDassert( entries_cleared == pinned_entries_marked + other_entries_marked ); @@ -1262,33 +1179,28 @@ H5C_mark_entries_as_clean(H5F_t * f, ( (ce_array_len - entries_cleared) <= cache_ptr->pl_len ) ); #if H5C_DO_SANITY_CHECKS - i = 0; + u = 0; entry_ptr = cache_ptr->pl_head_ptr; while ( entry_ptr != NULL ) { if ( entry_ptr->clear_on_unprotect ) { - i++; + u++; } entry_ptr = entry_ptr->next; } - HDassert( (entries_cleared + i) == ce_array_len ); + HDassert( (entries_cleared + u) == ce_array_len ); #endif /* H5C_DO_SANITY_CHECKS */ done: - #if H5C_DO_EXTREME_SANITY_CHECKS - if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || - ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "an extreme sanity check failed on exit.\n"); - } + if(H5C_validate_protected_entry_list(cache_ptr) < 0 + || H5C_validate_pinned_entry_list(cache_ptr) < 0 + || H5C_validate_lru_list(cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_mark_entries_as_clean() */ @@ -1309,7 +1221,7 @@ done: herr_t H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial) { - int32_t clear_cnt; + uint32_t clear_cnt; H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; @@ -1499,4 +1411,3 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5C__collective_write() */ #endif /* H5_HAVE_PARALLEL */ - diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 6e37bca..5b923e9 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -209,7 +209,6 @@ if ( ( (entry_ptr) == NULL ) || \ ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (head_ptr) != (tail_ptr) ) \ ) || \ - ( (len) < 0 ) || \ ( ( (len) == 1 ) && \ ( ( (head_ptr) != (tail_ptr) ) || \ ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ @@ -375,7 +374,6 @@ if ( ( (entry_ptr) == NULL ) || \ ( ( ( (hd_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (hd_ptr) != (tail_ptr) ) \ ) || \ - ( (len) < 0 ) || \ ( ( (len) == 1 ) && \ ( ( (hd_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (Size) ) \ @@ -483,7 +481,7 @@ if ( ( (hd_ptr) == NULL ) || \ ) \ ) \ ) { \ - HDassert(0 && "il DLL pre remove SC failed"); \ + HDassert(0 && "il DLL pre remove SC failed"); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "il DLL pre remove SC failed") \ } @@ -494,7 +492,6 @@ if ( ( (entry_ptr) == NULL ) || \ ( ( ( (hd_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (hd_ptr) != (tail_ptr) ) \ ) || \ - ( (len) < 0 ) || \ ( ( (len) == 1 ) && \ ( ( (hd_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (Size) ) \ @@ -506,7 +503,7 @@ if ( ( (entry_ptr) == NULL ) || \ ) \ ) \ ) { \ - HDassert(0 && "IL DLL pre insert SC failed"); \ + HDassert(0 && "IL DLL pre insert SC failed"); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "IL DLL pre insert SC failed") \ } @@ -514,7 +511,6 @@ if ( ( (entry_ptr) == NULL ) || \ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (head_ptr) != (tail_ptr) ) \ ) || \ - ( (len) < 0 ) || \ ( ( (len) == 1 ) && \ ( ( (head_ptr) != (tail_ptr) ) || \ ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ @@ -526,7 +522,7 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ) \ ) \ ) { \ - HDassert(0 && "IL DLL sanity check failed"); \ + HDassert(0 && "IL DLL sanity check failed"); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "IL DLL sanity check failed") \ } @@ -599,23 +595,6 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ * H5C__UPDATE_CACHE_HIT_RATE_STATS(), which is always active as * the cache hit rate stats are always collected and available. * - * Changes: - * - * JRM -- 3/21/06 - * Added / updated macros for pinned entry related stats. - * - * JRM -- 8/9/06 - * More pinned entry stats related updates. - * - * JRM -- 3/31/07 - * Updated H5C__UPDATE_STATS_FOR_PROTECT() to keep stats on - * read and write protects. - * - * MAM -- 1/15/09 - * Created H5C__UPDATE_MAX_INDEX_SIZE_STATS to contain - * common code within macros that update the maximum - * index, clean_index, and dirty_index statistics fields. - * ***********************************************************************/ #define H5C__UPDATE_CACHE_HIT_RATE_STATS(cache_ptr, hit) \ @@ -702,6 +681,31 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ #define H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr) \ ((cache_ptr)->index_scan_restarts)++; +#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr) \ +{ \ + (cache_ptr)->images_created++; \ +} + +#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr) \ +{ \ + /* make sure image len is still good */ \ + HDassert((cache_ptr)->image_len > 0); \ + (cache_ptr)->images_loaded++; \ + (cache_ptr)->last_image_size = (cache_ptr)->image_len; \ +} + +#define H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, dirty) \ +{ \ + (cache_ptr)->prefetches++; \ + if ( dirty ) \ + (cache_ptr)->dirty_prefetches++; \ +} + +#define H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr) \ +{ \ + (cache_ptr)->prefetch_hits++; \ +} + #if H5C_COLLECT_CACHE_ENTRY_STATS #define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) \ @@ -926,6 +930,10 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ #define H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) #define H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) #define H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr) +#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr) +#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr) +#define H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, dirty) +#define H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr) #endif /* H5C_COLLECT_CACHE_STATS */ @@ -999,8 +1007,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ - "Pre HT insert SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "pre HT insert SC failed") \ } #define H5C__POST_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) \ @@ -1022,8 +1029,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ - "Post HT insert SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "post HT insert SC failed") \ } #define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) \ @@ -1064,7 +1070,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Pre HT remove SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "pre HT remove SC failed") \ } #define H5C__POST_HT_REMOVE_SC(cache_ptr, entry_ptr) \ @@ -1090,7 +1096,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Post HT remove SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "post HT remove SC failed") \ } /* (Keep in sync w/H5C_TEST__PRE_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ @@ -1102,7 +1108,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( ! H5F_addr_defined(Addr) ) || \ ( H5C__HASH_FCN(Addr) < 0 ) || \ ( H5C__HASH_FCN(Addr) >= H5C__HASH_TABLE_LEN ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "Pre HT search SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "pre HT search SC failed") \ } /* (Keep in sync w/H5C_TEST__POST_SUC_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ @@ -1124,8 +1130,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( (entry_ptr)->ht_prev->ht_next != (entry_ptr) ) ) || \ ( ( (entry_ptr)->ht_next != NULL ) && \ ( (entry_ptr)->ht_next->ht_prev != (entry_ptr) ) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ - "Post successful HT search SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "post successful HT search SC failed") \ } /* (Keep in sync w/H5C_TEST__POST_HT_SHIFT_TO_FRONT macro in test/cache_common.h -QAK) */ @@ -1133,8 +1138,7 @@ if ( ( (cache_ptr) == NULL ) || \ if ( ( (cache_ptr) == NULL ) || \ ( ((cache_ptr)->index)[k] != (entry_ptr) ) || \ ( (entry_ptr)->ht_prev != NULL ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ - "Post HT shift to front SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "post HT shift to front SC failed") \ } #define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ @@ -1169,8 +1173,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Pre HT entry size change SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "pre HT entry size change SC failed") \ } #define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ @@ -1200,8 +1203,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Post HT entry size change SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "post HT entry size change SC failed") \ } #define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ @@ -1228,8 +1230,7 @@ if ( \ ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Pre HT update for entry clean SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "pre HT update for entry clean SC failed") \ } #define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ @@ -1256,8 +1257,7 @@ if ( \ ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Pre HT update for entry dirty SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "pre HT update for entry dirty SC failed") \ } #define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ @@ -1273,8 +1273,7 @@ if ( ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Post HT update for entry clean SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "post HT update for entry clean SC failed") \ } #define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ @@ -1290,8 +1289,7 @@ if ( ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Post HT update for entry dirty SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "post HT update for entry dirty SC failed") \ } #else /* H5C_DO_SANITY_CHECKS */ @@ -1592,8 +1590,7 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->slist_size ); \ \ if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) < 0) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ - "Can't insert entry in skip list") \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), "can't insert entry in skip list") \ \ (entry_ptr)->in_slist = TRUE; \ (cache_ptr)->slist_changed = TRUE; \ @@ -1628,8 +1625,7 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->slist_size ); \ \ if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) < 0) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ - "Can't insert entry in skip list") \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), "can't insert entry in skip list") \ \ (entry_ptr)->in_slist = TRUE; \ (cache_ptr)->slist_changed = TRUE; \ @@ -1681,8 +1677,7 @@ if ( ( (cache_ptr)->index_size != \ \ if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ != (entry_ptr) ) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \ - "Can't delete entry from skip list.") \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "can't delete entry from skip list") \ \ HDassert( (cache_ptr)->slist_len > 0 ); \ if(!(during_flush)) \ @@ -1719,8 +1714,7 @@ if ( ( (cache_ptr)->index_size != \ \ if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ != (entry_ptr) ) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \ - "Can't delete entry from skip list.") \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "can't delete entry from skip list") \ \ HDassert( (cache_ptr)->slist_len > 0 ); \ if(!(during_flush)) \ @@ -2239,6 +2233,120 @@ if ( ( (cache_ptr)->index_size != \ /*------------------------------------------------------------------------- * + * Macro: H5C__UPDATE_RP_FOR_INSERT_APPEND + * + * Purpose: Update the replacement policy data structures for an + * insertion of the specified cache entry. + * + * Unlike H5C__UPDATE_RP_FOR_INSERTION below, mark the + * new entry as the LEAST recently used entry, not the + * most recently used. + * + * For now at least, this macro should only be used in + * the reconstruction of the metadata cache from a cache + * image block. + * + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. + * + * Return: N/A + * + * Programmer: John Mainzer, 8/15/15 + * + *------------------------------------------------------------------------- + */ + +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + +#define H5C__UPDATE_RP_FOR_INSERT_APPEND(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the tail of the LRU list. */ \ + \ + H5C__DLL_APPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* insert the entry at the tail of the clean or dirty LRU list as \ + * appropriate. \ + */ \ + \ + if ( entry_ptr->is_dirty ) { \ + H5C__AUX_DLL_APPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, (fail_val)) \ + } else { \ + H5C__AUX_DLL_APPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, (fail_val)) \ + } \ + \ + /* End modified LRU specific code. */ \ + } \ +} + +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + +#define H5C__UPDATE_RP_FOR_INSERT_APPEND(cache_ptr, entry_ptr, fail_val) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_protected) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + \ + if ( (entry_ptr)->is_pinned ) { \ + \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, (fail_val)) \ + \ + } else { \ + \ + /* modified LRU specific code */ \ + \ + /* insert the entry at the tail of the LRU list. */ \ + \ + H5C__DLL_APPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ + \ + /* End modified LRU specific code. */ \ + } \ +} + +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + + +/*------------------------------------------------------------------------- + * * Macro: H5C__UPDATE_RP_FOR_INSERTION * * Purpose: Update the replacement policy data structures for an @@ -2437,7 +2545,6 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->pel_tail_ptr, \ (cache_ptr)->pel_len, \ (cache_ptr)->pel_size, (fail_val)) \ - HDassert( (cache_ptr)->pel_len >= 0 ); \ \ } else { \ \ @@ -2500,7 +2607,6 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->pel_tail_ptr, \ (cache_ptr)->pel_len, \ (cache_ptr)->pel_size, (fail_val)) \ - HDassert( (cache_ptr)->pel_len >= 0 ); \ \ } else { \ \ @@ -2844,41 +2950,40 @@ if ( ( (cache_ptr)->index_size != \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ (cache_ptr)->pel_tail_ptr, (cache_ptr)->pel_len, \ (cache_ptr)->pel_size, (fail_val)) \ - HDassert( (cache_ptr)->pel_len >= 0 ); \ \ - /* modified LRU specific code */ \ + /* modified LRU specific code */ \ \ - /* insert the entry at the head of the LRU list. */ \ + /* insert the entry at the head of the LRU list. */ \ \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ \ - /* Similarly, insert the entry at the head of either the clean \ - * or dirty LRU list as appropriate. \ - */ \ + /* Similarly, insert the entry at the head of either the clean \ + * or dirty LRU list as appropriate. \ + */ \ \ - if ( (entry_ptr)->is_dirty ) { \ + if ( (entry_ptr)->is_dirty ) { \ \ - H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, \ - (fail_val)) \ + H5C__AUX_DLL_PREPEND((entry_ptr), \ + (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, \ + (fail_val)) \ \ - } else { \ + } else { \ \ - H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, \ - (fail_val)) \ - } \ + H5C__AUX_DLL_PREPEND((entry_ptr), \ + (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, \ + (fail_val)) \ + } \ \ - /* End modified LRU specific code. */ \ + /* End modified LRU specific code. */ \ \ } /* H5C__UPDATE_RP_FOR_UNPIN */ @@ -2901,7 +3006,6 @@ if ( ( (cache_ptr)->index_size != \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ (cache_ptr)->pel_tail_ptr, (cache_ptr)->pel_len, \ (cache_ptr)->pel_size, (fail_val)) \ - HDassert( (cache_ptr)->pel_len >= 0 ); \ \ /* modified LRU specific code */ \ \ @@ -3074,22 +3178,22 @@ if ( ( (hd_ptr) == NULL ) || \ ( (len) <= 0 ) || \ ( (Size) < (entry_ptr)->size ) || \ ( ( (Size) == (entry_ptr)->size ) && ( ! ( (len) == 1 ) ) ) || \ - ( ( (entry_ptr)->coll_prev == NULL ) && ( (hd_ptr) != (entry_ptr) ) ) || \ + ( ( (entry_ptr)->coll_prev == NULL ) && ( (hd_ptr) != (entry_ptr) ) ) || \ ( ( (entry_ptr)->coll_next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) || \ ( ( (len) == 1 ) && \ ( ! ( ( (hd_ptr) == (entry_ptr) ) && ( (tail_ptr) == (entry_ptr) ) && \ - ( (entry_ptr)->coll_next == NULL ) && \ - ( (entry_ptr)->coll_prev == NULL ) && \ + ( (entry_ptr)->coll_next == NULL ) && \ + ( (entry_ptr)->coll_prev == NULL ) && \ ( (Size) == (entry_ptr)->size ) \ ) \ ) \ ) \ ) { \ - HDassert(0 && "coll DLL pre remove SC failed"); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "coll DLL pre remove SC failed") \ + HDassert(0 && "coll DLL pre remove SC failed"); \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "coll DLL pre remove SC failed") \ } -#define H5C__COLL_DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ +#define H5C__COLL_DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (head_ptr) != (tail_ptr) ) \ ) || \ @@ -3101,36 +3205,35 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ) \ ) || \ ( ( (len) >= 1 ) && \ - ( ( (head_ptr) == NULL ) || ( (head_ptr)->coll_prev != NULL ) || \ - ( (tail_ptr) == NULL ) || ( (tail_ptr)->coll_next != NULL ) \ + ( ( (head_ptr) == NULL ) || ( (head_ptr)->coll_prev != NULL ) || \ + ( (tail_ptr) == NULL ) || ( (tail_ptr)->coll_next != NULL ) \ ) \ ) \ ) { \ - HDassert(0 && "COLL DLL sanity check failed"); \ + HDassert(0 && "COLL DLL sanity check failed"); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "COLL DLL sanity check failed") \ } #define H5C__COLL_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ if ( ( (entry_ptr) == NULL ) || \ - ( (entry_ptr)->coll_next != NULL ) || \ - ( (entry_ptr)->coll_prev != NULL ) || \ + ( (entry_ptr)->coll_next != NULL ) || \ + ( (entry_ptr)->coll_prev != NULL ) || \ ( ( ( (hd_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (hd_ptr) != (tail_ptr) ) \ ) || \ - ( (len) < 0 ) || \ ( ( (len) == 1 ) && \ ( ( (hd_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (Size) ) \ ) \ ) || \ ( ( (len) >= 1 ) && \ - ( ( (hd_ptr) == NULL ) || ( (hd_ptr)->coll_prev != NULL ) || \ - ( (tail_ptr) == NULL ) || ( (tail_ptr)->coll_next != NULL ) \ + ( ( (hd_ptr) == NULL ) || ( (hd_ptr)->coll_prev != NULL ) || \ + ( (tail_ptr) == NULL ) || ( (tail_ptr)->coll_next != NULL ) \ ) \ ) \ ) { \ - HDassert(0 && "COLL DLL pre insert SC failed"); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "COLL DLL pre insert SC failed") \ + HDassert(0 && "COLL DLL pre insert SC failed"); \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "COLL DLL pre insert SC failed") \ } #else /* H5C_DO_SANITY_CHECKS */ @@ -3433,10 +3536,8 @@ typedef struct H5C_tag_info_t { * types are stored in the type_name_table discussed below, and * indexed by the ids. * - * type_name_table_ptr: Pointer to an array of pointer to char of length - * max_type_id + 1. The strings pointed to by the entries - * in the array are the names of the entry types associated - * with the indexing type IDs. + * class_table_ptr: Pointer to an array of H5C_class_t of length + * max_type_id + 1. Entry classes for the cache. * * max_cache_size: Nominal maximum number of bytes that may be stored in the * cache. This value should be viewed as a soft limit, as the @@ -3986,7 +4087,22 @@ typedef struct H5C_tag_info_t { * * size_decreased: Boolean flag set to TRUE whenever the maximum cache * size is decreased. The flag triggers a call to - * H5C_make_space_in_cache() on the next call to H5C_protect(). + * H5C__make_space_in_cache() on the next call to H5C_protect(). + * + * resize_in_progress: As the metadata cache has become re-entrant, it is + * possible that a protect may trigger a call to + * H5C__auto_adjust_cache_size(), which may trigger a flush, + * which may trigger a protect, which will result in another + * call to H5C__auto_adjust_cache_size(). + * + * The resize_in_progress boolean flag is used to detect this, + * and to prevent the infinite recursion that would otherwise + * occur. + * + * Note that this issue is not hypothetical -- this field + * was added 12/29/15 to fix a bug exposed in the testing + * of changes to the file driver info superblock extension + * management code needed to support rings. * * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration * data for automatic cache resizing. @@ -4063,6 +4179,77 @@ typedef struct H5C_tag_info_t { * this field will be reset every automatic resize epoch. * * + * Metadata cache image management related fields. + * + * image_ctl: Instance of H5C_cache_image_ctl_t containing configuration + * data for generation of a cache image on file close. + * + * serialization_in_progress: Boolean field that is set to TRUE iff + * the cache is in the process of being serialized. This + * field is needed to support the H5C_serialization_in_progress() + * call, which is in turn required for sanity checks in some + * cache clients. + * + * load_image: Boolean flag indicating that the metadata cache image + * superblock extension message exists and should be + * read, and the image block read and decoded on the next + * call to H5C_protect(). + * + * image_loaded: Boolean flag indicating that the metadata cache has + * loaded the metadata cache image as directed by the + * MDC cache image superblock extension message. + * + * delete_image: Boolean flag indicating whether the metadata cache image + * superblock message should be deleted and the cache image + * file space freed after they have been read and decoded. + * + * This flag should be set to TRUE iff the file is opened + * R/W and there is a cache image to be read. + * + * image_addr: haddr_t containing the base address of the on disk + * metadata cache image, or HADDR_UNDEF if that value is + * undefined. Note that this field is used both in the + * construction and write, and the read and decode of + * metadata cache image blocks. + * + * image_len: hsize_t containing the size of the on disk metadata cache + * image, or zero if that value is undefined. Note that this + * field is used both in the construction and write, and the + * read and decode of metadata cache image blocks. + * + * image_data_len: size_t containing the number of bytes of data in the + * on disk metadata cache image, or zero if that value is + * undefined. + * + * In most cases, this value is the same as the image_len + * above. It exists to allow for metadata cache image blocks + * that are larger than the actual image. Thus in all + * cases image_data_len <= image_len. + * + * To create the metadata cache image, we must first serialize all the + * entries in the metadata cache. This is done by a scan of the index. + * As entries must be serialized in increasing flush dependency height + * order, we scan the index repeatedly, once for each flush dependency + * height in increasing order. + * + * This operation is complicated by the fact that entries other the the + * target may be inserted, loaded, relocated, or removed from the cache + * (either by eviction or the take ownership flag) as the result of a + * pre_serialize or serialize callback. While entry removals are not + * a problem for the scan of the index, insertions, loads, and relocations + * are. Hence the entries loaded, inserted, and relocated counters + * listed below have been implemented to allow these conditions to be + * detected and dealt with by restarting the scan. + * + * The serialization operation is further complicated by the fact that + * the flush dependency height of a given entry may increase (as the + * result of an entry load or insert) or decrease (as the result of an + * entry removal -- via either eviction or the take ownership flag). The + * entry_fd_height_change_counter field is maintained to allow detection + * of this condition, and a restart of the scan when it occurs. + * + * Note that all these new fields would work just as well as booleans. + * * entries_loaded_counter: Number of entries loaded into the cache * since the last time this field was reset. * @@ -4072,6 +4259,29 @@ typedef struct H5C_tag_info_t { * entries relocated_counter: Number of entries whose base address has * been changed since the last time this field was reset. * + * entry_fd_height_change_counter: Number of entries whose flush dependency + * height has changed since the last time this field was reset. + * + * The following fields are used assemble the cache image prior to + * writing it to disk. + * + * num_entries_in_image: Unsigned integer field containing the number of entries + * to be copied into the metadata cache image. Note that + * this value will be less than the number of entries in + * the cache, and the superblock and its related entries + * are not written to the metadata cache image. + * + * image_entries: Pointer to a dynamically allocated array of instance of + * H5C_image_entry_t of length num_entries_in_image, or NULL + * if that array does not exist. This array is used to + * assemble entry data to be included in the image, and to + * sort them by flush dependency height and LRU rank. + * + * image_buffer: Pointer to the dynamically allocated buffer of length + * image_len in which the metadata cache image is assembled, + * or NULL if that buffer does not exist. + * + * * Free Space Manager Related fields: * * The free space managers must be informed when we are about to close @@ -4080,10 +4290,10 @@ typedef struct H5C_tag_info_t { * page buffering, this is no longer viable, as we must finalize the on * disk image of all metadata much sooner. * - * This is handled by the H5FS_settle_raw_data_fsm() and - * H5FS_settle_meta_data_fsm() routines. As these calls are expensive, + * This is handled by the H5MF_settle_raw_data_fsm() and + * H5MF_settle_meta_data_FSM() routines. As these calls are expensive, * the following fields are used to track whether the target free space - * managers are clean. + * managers are clean. * * They are also used in sanity checking, as once a free space manager is * settled, it should not become unsettled (i.e. be asked to allocate or @@ -4100,7 +4310,7 @@ typedef struct H5C_tag_info_t { * free space manager metadata. * * mdfsm_settled: Boolean flag indicating whether the meta data free space - * manager is settled -- i.e. whether the correct space has + * manager is settled -- i.e. whether the correct space has * been allocated for it in the file. * * Note that the name of this field is deceptive. In the @@ -4285,23 +4495,63 @@ typedef struct H5C_tag_info_t { * max_pel_size: Largest value attained by the pel_size field in the * current epoch. * - * calls_to_msic: Total number of calls to H5C_make_space_in_cache + * calls_to_msic: Total number of calls to H5C__make_space_in_cache * * total_entries_skipped_in_msic: Number of clean entries skipped while - * enforcing the min_clean_fraction in H5C_make_space_in_cache(). + * enforcing the min_clean_fraction in H5C__make_space_in_cache(). * * total_entries_scanned_in_msic: Number of clean entries skipped while - * enforcing the min_clean_fraction in H5C_make_space_in_cache(). + * enforcing the min_clean_fraction in H5C__make_space_in_cache(). * * max_entries_skipped_in_msic: Maximum number of clean entries skipped - * in any one call to H5C_make_space_in_cache(). + * in any one call to H5C__make_space_in_cache(). * * max_entries_scanned_in_msic: Maximum number of entries scanned over - * in any one call to H5C_make_space_in_cache(). + * in any one call to H5C__make_space_in_cache(). * * entries_scanned_to_make_space: Number of entries scanned only when looking * for entries to evict in order to make space in cache. * + * + * The following fields track statistics on cache images. + * + * images_created: Integer field containing the number of cache images + * created since the last time statistics were reset. + * + * At present, this field must always be either 0 or 1. + * Further, since cache images are only created at file + * close, this field should only be set at that time. + * + * images_loaded: Integer field containing the number of cache images + * loaded since the last time statistics were reset. + * + * At present, this field must always be either 0 or 1. + * Further, since cache images are only loaded at the + * time of the first protect or on file close, this value + * should only change on those events. + * + * last_image_size: Size of the most recently loaded metadata cache image + * loaded into the cache, or zero if no image has been + * loaded. + * + * At present, at most one cache image can be loaded into + * the metadata cache for any given file, and this image + * will be loaded either on the first protect, or on file + * close if no entry is protected before then. + * + * + * Fields for tracking prefetched entries. Note that flushes and evictions + * of prefetched entries are tracked in the flushes and evictions arrays + * discused above. + * + * prefetches: Number of prefetched entries that are loaded to the + * cache. + * + * dirty_prefetches: Number of dirty prefetched entries that are loaded + * into the cache. + * + * prefetch_hits: Number of prefetched entries that are actually used. + * * * As entries are now capable of moving, loading, dirtying, and deleting * other entries in their pre_serialize and serialize callbacks, it has @@ -4372,6 +4622,11 @@ typedef struct H5C_tag_info_t { * field is intended to allow marking of output of with * the processes mpi rank. * + * get_entry_ptr_from_addr_counter: Counter used to track the number of + * times the H5C_get_entry_ptr_from_addr() function has been + * called successfully. This field is only defined when + * NDEBUG is not #defined. + * ****************************************************************************/ struct H5C_t { uint32_t magic; @@ -4382,7 +4637,7 @@ struct H5C_t { FILE * log_file_ptr; void * aux_ptr; int32_t max_type_id; - const char * (* type_name_table_ptr); + const H5C_class_t * const *class_table_ptr; size_t max_cache_size; size_t min_clean_size; H5C_write_permitted_func_t check_write_permitted; @@ -4392,16 +4647,16 @@ struct H5C_t { hbool_t close_warning_received; /* Fields for maintaining [hash table] index of entries */ - int32_t index_len; + uint32_t index_len; size_t index_size; - int32_t index_ring_len[H5C_RING_NTYPES]; + uint32_t index_ring_len[H5C_RING_NTYPES]; size_t index_ring_size[H5C_RING_NTYPES]; size_t clean_index_size; size_t clean_index_ring_size[H5C_RING_NTYPES]; size_t dirty_index_size; size_t dirty_index_ring_size[H5C_RING_NTYPES]; H5C_cache_entry_t * index[H5C__HASH_TABLE_LEN]; - int32_t il_len; + uint32_t il_len; size_t il_size; H5C_cache_entry_t * il_head; H5C_cache_entry_t * il_tail; @@ -4413,15 +4668,15 @@ struct H5C_t { /* Fields for maintaining list of in-order entries, for flushing */ hbool_t slist_changed; - int32_t slist_len; + uint32_t slist_len; size_t slist_size; - int32_t slist_ring_len[H5C_RING_NTYPES]; + uint32_t slist_ring_len[H5C_RING_NTYPES]; size_t slist_ring_size[H5C_RING_NTYPES]; H5SL_t * slist_ptr; - int32_t num_last_entries; + uint32_t num_last_entries; #if H5C_DO_SANITY_CHECKS - int64_t slist_len_increase; - int64_t slist_size_increase; + int32_t slist_len_increase; + ssize_t slist_size_increase; #endif /* H5C_DO_SANITY_CHECKS */ /* Fields for maintaining list of tagged entries */ @@ -4429,38 +4684,38 @@ struct H5C_t { hbool_t ignore_tags; /* Fields for tracking protected entries */ - int32_t pl_len; + uint32_t pl_len; size_t pl_size; H5C_cache_entry_t * pl_head_ptr; H5C_cache_entry_t * pl_tail_ptr; /* Fields for tracking pinned entries */ - int32_t pel_len; + uint32_t pel_len; size_t pel_size; H5C_cache_entry_t * pel_head_ptr; H5C_cache_entry_t * pel_tail_ptr; /* Fields for complete LRU list of entries */ - int32_t LRU_list_len; + uint32_t LRU_list_len; size_t LRU_list_size; H5C_cache_entry_t * LRU_head_ptr; H5C_cache_entry_t * LRU_tail_ptr; /* Fields for clean LRU list of entries */ - int32_t cLRU_list_len; + uint32_t cLRU_list_len; size_t cLRU_list_size; H5C_cache_entry_t * cLRU_head_ptr; H5C_cache_entry_t * cLRU_tail_ptr; /* Fields for dirty LRU list of entries */ - int32_t dLRU_list_len; + uint32_t dLRU_list_len; size_t dLRU_list_size; H5C_cache_entry_t * dLRU_head_ptr; H5C_cache_entry_t * dLRU_tail_ptr; #ifdef H5_HAVE_PARALLEL /* Fields for collective metadata reads */ - int32_t coll_list_len; + uint32_t coll_list_len; size_t coll_list_size; H5C_cache_entry_t * coll_head_ptr; H5C_cache_entry_t * coll_tail_ptr; @@ -4477,6 +4732,7 @@ struct H5C_t { hbool_t resize_enabled; hbool_t cache_full; hbool_t size_decreased; + hbool_t resize_in_progress; H5C_auto_size_ctl_t resize_ctl; /* Fields for epoch markers used in automatic cache size adjustment */ @@ -4492,9 +4748,23 @@ struct H5C_t { int64_t cache_hits; int64_t cache_accesses; + /* fields supporting generation of a cache image on file close */ + H5C_cache_image_ctl_t image_ctl; + hbool_t serialization_in_progress; + hbool_t load_image; + hbool_t image_loaded; + hbool_t delete_image; + haddr_t image_addr; + hsize_t image_len; + hsize_t image_data_len; int64_t entries_loaded_counter; int64_t entries_inserted_counter; int64_t entries_relocated_counter; + int64_t entry_fd_height_change_counter; + uint32_t num_entries_in_image; + H5C_image_entry_t * image_entries; + void * image_buffer; + /* Free Space Manager Related fields */ hbool_t rdfsm_settled; hbool_t mdfsm_settled; @@ -4532,21 +4802,21 @@ struct H5C_t { int64_t total_successful_ht_search_depth; int64_t failed_ht_searches; int64_t total_failed_ht_search_depth; - int32_t max_index_len; + uint32_t max_index_len; size_t max_index_size; size_t max_clean_index_size; size_t max_dirty_index_size; /* Fields for in-order skip list */ - int32_t max_slist_len; + uint32_t max_slist_len; size_t max_slist_size; /* Fields for protected entry list */ - int32_t max_pl_len; + uint32_t max_pl_len; size_t max_pl_size; /* Fields for pinned entry list */ - int32_t max_pel_len; + uint32_t max_pel_len; size_t max_pel_size; /* Fields for tracking 'make space in cache' (msic) operations */ @@ -4562,6 +4832,16 @@ struct H5C_t { int64_t LRU_scan_restarts; int64_t index_scan_restarts; + /* Fields for tracking cache image operations */ + int32_t images_created; + int32_t images_loaded; + hsize_t last_image_size; + + /* Fields for tracking prefetched entries */ + int64_t prefetches; + int64_t dirty_prefetches; + int64_t prefetch_hits; + #if H5C_COLLECT_CACHE_ENTRY_STATS int32_t max_accesses[H5C__MAX_NUM_TYPE_IDS + 1]; int32_t min_accesses[H5C__MAX_NUM_TYPE_IDS + 1]; @@ -4573,6 +4853,10 @@ struct H5C_t { #endif /* H5C_COLLECT_CACHE_STATS */ char prefix[H5C__PREFIX_LEN]; + +#ifndef NDEBUG + int64_t get_entry_ptr_from_addr_counter; +#endif /* NDEBUG */ }; /* Define typedef for tagged cache entry iteration callbacks */ @@ -4583,20 +4867,28 @@ typedef int (*H5C_tag_iter_cb_t)(H5C_cache_entry_t *entry, void *ctx); /* Package Private Variables */ /*****************************/ -/* Metadata cache epoch class */ -H5_DLLVAR const H5C_class_t H5C__epoch_marker_class; - /******************************/ /* Package Private Prototypes */ /******************************/ +H5_DLL herr_t H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5C__deserialize_prefetched_entry(H5F_t *f, hid_t dxpl_id, + H5C_t * cache_ptr, H5C_cache_entry_t** entry_ptr_ptr, + const H5C_class_t * type, haddr_t addr, void * udata); /* General routines */ H5_DLL herr_t H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, unsigned flags); +H5_DLL herr_t H5C__generate_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr); +H5_DLL herr_t H5C__load_cache_image(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5C__mark_flush_dep_serialized(H5C_cache_entry_t * entry_ptr); H5_DLL herr_t H5C__mark_flush_dep_unserialized(H5C_cache_entry_t * entry_ptr); +H5_DLL herr_t H5C__make_space_in_cache(H5F_t * f, hid_t dxpl_id, + size_t space_needed, hbool_t write_permitted); H5_DLL herr_t H5C__flush_marked_entries(H5F_t * f, hid_t dxpl_id); +H5_DLL herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, + H5C_cache_entry_t *entry_ptr, hid_t dxpl_id); +H5_DLL herr_t H5C__serialize_cache(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, hbool_t match_global, H5C_tag_iter_cb_t cb, void *cb_ctx); diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 654ce35..28eacf2 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -114,6 +114,7 @@ /* Cache configuration versions */ #define H5C__CURR_AUTO_SIZE_CTL_VER 1 #define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1 +#define H5C__CURR_CACHE_IMAGE_CTL_VER 1 /* Default configuration settings */ #define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f @@ -994,16 +995,16 @@ typedef int H5C_ring_t; * just before the entry is freed. * * This is necessary, as the LRU list can be changed out - * from under H5C_make_space_in_cache() by the serialize + * from under H5C__make_space_in_cache() by the serialize * callback which may change the size of an existing entry, * and/or load a new entry while serializing the target entry. * * This in turn can cause a recursive call to - * H5C_make_space_in_cache() which may either flush or evict + * H5C__make_space_in_cache() which may either flush or evict * the next entry that the first invocation of that function * was about to examine. * - * The magic field allows H5C_make_space_in_cache() to + * The magic field allows H5C__make_space_in_cache() to * detect this case, and re-start its scan from the bottom * of the LRU when this situation occurs. * @@ -1338,6 +1339,187 @@ typedef int H5C_ring_t; * In either case, when there is no previous item, it should * be NULL. * + * Fields supporting the cache image feature: + * + * The following fields are used to store data about the entry which must + * be stored in the cache image block, but which will typically be either + * lost or heavily altered in the process of serializing the cache and + * preparing its contents to be copied into the cache image block. + * + * Some fields are also used in loading the contents of the metadata cache + * image back into the cache, and in managing such entries until they are + * either protected by the library (at which point they become regular + * entries) or are evicted. See discussion of the prefetched field for + * further details. + * + * include_in_image: Boolean flag indicating whether this entry should + * be included in the metadata cache image. This field should + * always be false prior to the H5C_prep_for_file_close() call. + * During that call, it should be set to TRUE for all entries + * that are to be included in the metadata cache image. At + * present, only the superblock, the superblock extension + * object header and its chunks (if any) are omitted from + * the image. + * + * lru_rank: Rank of the entry in the LRU just prior to file close. + * + * Note that the first entry on the LRU has lru_rank 1, + * and that entries not on the LRU at that time will have + * either lru_rank -1 (if pinned) or 0 (if loaded during + * the process of flushing the cache. + * + * image_dirty: Boolean flag indicating whether the entry should be marked + * as dirty in the metadata cache image. The flag is set to + * TRUE iff the entry is dirty when H5C_prep_for_file_close() + * is called. + * + * fd_parent_count: If the entry is a child in one or more flush dependency + * relationships, this field contains the number of flush + * dependency parents. + * + * In all other cases, the field is set to zero. + * + * Note that while this count is initially taken from the + * flush dependency fields above, if the entry is in the + * cache image (i.e. include_in_image is TRUE), any parents + * that are not in the image are removed from this count and + * from the fd_parent_addrs array below. + * + * Finally observe that if the entry is dirty and in the + * cache image, and its parent is dirty and not in the cache + * image, then the entry must be removed from the cache image + * to avoid violating the flush dependency flush ordering. + * + * fd_parent_addrs: If the entry is a child in one or more flush dependency + * relationship when H5C_prep_for_file_close() is called, this + * field must contain a pointer to an array of size + * fd_parent_count containing the on disk addresses of the + * parent. + * + * In all other cases, the field is set to NULL. + * + * Note that while this list of addresses is initially taken + * from the flush dependency fields above, if the entry is in the + * cache image (i.e. include_in_image is TRUE), any parents + * that are not in the image are removed from this list, and + * and from the fd_parent_count above. + * + * Finally observe that if the entry is dirty and in the + * cache image, and its parent is dirty and not in the cache + * image, then the entry must be removed from the cache image + * to avoid violating the flush dependency flush ordering. + * + * fd_child_count: If the entry is a parent in a flush dependency + * relationship, this field contains the number of flush + * dependency children. + * + * In all other cases, the field is set to zero. + * + * Note that while this count is initially taken from the + * flush dependency fields above, if the entry is in the + * cache image (i.e. include_in_image is TRUE), any children + * that are not in the image are removed from this count. + * + * fd_dirty_child_count: If the entry is a parent in a flush dependency + * relationship, this field contains the number of dirty flush + * dependency children. + * + * In all other cases, the field is set to zero. + * + * Note that while this count is initially taken from the + * flush dependency fields above, if the entry is in the + * cache image (i.e. include_in_image is TRUE), any dirty + * children that are not in the image are removed from this + * count. + * + * image_fd_height: Flush dependency height of the entry in the cache image. + * + * The flush dependency height of any entry involved in a + * flush dependency relationship is defined to be the + * longest flush dependency path from that entry to an entry + * with no flush depenency children. + * + * Since the image_fd_height is used to order entries in the + * cache image so that fd parents preceed fd children, for + * purposes of this field, and entry is at flush dependency + * level 0 if it either has no children, or if all of its + * children are not in the cache image. + * + * Note that if a child in a flush dependency relationship is + * dirty and in the cache image, and its parent is dirty and + * not in the cache image, then the child must be excluded + * from the cache image to maintain flush ordering. + * + * prefetched: Boolean flag indicating that the on disk image of the entry + * has been loaded into the cache prior any request for the + * entry by the rest of the library. + * + * As of this writing (8/10/15), this can only happen through + * the load of a cache image block, although other scenarios + * are contemplated for the use of this feature. Note that + * unlike the usual prefetch situation, this means that a + * pre fetched entry can be dirty, and/or can be a party to + * flush dependency relationship(s). This complicates matters + * somewhat. + * + * The essential feature of a pre-fetched entry is that it + * consists only of a buffer containing the on disk image of + * the entry. Thus it must be deserialized before it can + * be passed back to the library on a protect call. This + * task is handled by H5C_deserialized_prefetched_entry(). + * In essence, this routine calls the deserialize callback + * provided in the protect call with the on disk image, + * deletes the prefetched entry from the cache, and replaces + * it with the deserialized entry returned by the deserialize + * callback. + * + * Further, if the prefetched entry is a flush dependency parent, + * all its flush dependency children (which must also be + * pre-fetched entries), must be tranfered to the new cache + * entry returned by the deserailization callback. + * + * Finally, if the prefetched entry is a flush dependency child, + * this flush dependency must be destroyed prior to the + * deserialize call. + * + * In addition to the above special processing on the first + * protect call on a prefetched entry (after which is no longer + * a prefetched entry), prefetched entries also require special + * tretment on flush and evict. + * + * On flush, a dirty prefetched entry must simply be written + * to disk and marked clean without any call to any client + * callback. + * + * On eviction, if a prefetched entry is a flush dependency + * child, that flush dependency relationship must be destroyed + * just prior to the eviction. If the flush dependency code + * is working properly, it should be impossible for any entry + * that is a flush dependency parent to be evicted. + * + * prefetch_type_id: Integer field containing the type ID of the prefetched + * entry. This ID must match the ID of the type provided in any + * protect call on the prefetched entry. + * + * The value of this field is undefined in prefetched is FALSE. + * + * age: Number of times a prefetched entry has appeared in + * subsequent cache images. The field exists to allow + * imposition of a limit on how many times a prefetched + * entry can appear in subsequent cache images without being + * converted to a regular entry. + * + * This field must be zero if prefetched is FALSE. + * + * serialization_count: Integer field used to maintain a count of the + * number of times each entry is serialized during cache + * serialization. While no entry should be serialized more than + * once in any serialization call, throw an assertion if any + * flush depencency parent is serialized more than once during + * a single cache serialization. + * + * This is a debugging field, and thus is maintained only if + * NDEBUG is undefined. * * Fields supporting tagged entries: * @@ -1433,6 +1615,23 @@ typedef struct H5C_cache_entry_t { struct H5C_cache_entry_t *coll_prev; #endif /* H5_HAVE_PARALLEL */ + /* fields supporting cache image */ + hbool_t include_in_image; + int32_t lru_rank; + hbool_t image_dirty; + uint64_t fd_parent_count; + haddr_t *fd_parent_addrs; + uint64_t fd_child_count; + uint64_t fd_dirty_child_count; + uint32_t image_fd_height; + hbool_t prefetched; + int prefetch_type_id; + int32_t age; + +#ifndef NDEBUG /* debugging field */ + int serialization_count; +#endif /* NDEBUG */ + /* fields supporting tag lists */ struct H5C_cache_entry_t *tl_next; struct H5C_cache_entry_t *tl_prev; @@ -1447,6 +1646,168 @@ typedef struct H5C_cache_entry_t { #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ } H5C_cache_entry_t; + +/**************************************************************************** + * + * structure H5C_image_entry_t + * + * Instances of the H5C_image_entry_t structure are used to store data on + * metadata cache entries used in the construction of the metadata cache + * image block. In essence this structure is a greatly simplified version + * of H5C_cache_entry_t. + * + * The fields of this structure are discussed individually below: + * + * JRM - 8/5/15 + * + * magic: Unsigned 32 bit integer that must always be set to + * H5C_IMAGE_ENTRY_T_MAGIC when the entry is valid. + * The field must be set to H5C_IMAGE_ENTRY_T_BAD_MAGIC + * just before the entry is freed. + * + * addr: Base address of the cache entry on disk. + * + * size: Length of the cache entry on disk in bytes. + * + * ring: Instance of H5C_ring_t indicating the flush ordering ring + * to which this entry is assigned. + * + * age: Number of times this prefetech entry has appeared in + * the current sequence of cache images. This field is + * initialized to 0 if the instance of H5C_image_entry_t + * is constructed from a regular entry. + * + * If the instance is constructed from a prefetched entry + * currently residing in the metadata cache, the field is + * set to 1 + the age of the prefetched entry, or to + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX if that sum exceeds + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX. + * + * type_id: Integer field containing the type ID of the entry. + * + * lru_rank: Rank of the entry in the LRU just prior to file close. + * + * Note that the first entry on the LRU has lru_rank 1, + * and that entries not on the LRU at that time will have + * either lru_rank -1 (if pinned) or 0 (if loaded during + * the process of flushing the cache. + * + * is_dirty: Boolean flag indicating whether the contents of the cache + * entry has been modified since the last time it was written + * to disk as a regular piece of metadata. + * + * image_fd_height: Flush dependency height of the entry in the cache image. + * + * The flush dependency height of any entry involved in a + * flush dependency relationship is defined to be the + * longest flush dependency path from that entry to an entry + * with no flush depenency children. + * + * Since the image_fd_height is used to order entries in the + * cache image so that fd parents preceed fd children, for + * purposes of this field, an entry is at flush dependency + * level 0 if it either has no children, or if all of its + * children are not in the cache image. + * + * Note that if a child in a flush dependency relationship is + * dirty and in the cache image, and its parent is dirty and + * not in the cache image, then the child must be excluded + * from the cache image to maintain flush ordering. + * + * fd_parent_count: If the entry is a child in one or more flush dependency + * relationships, this field contains the number of flush + * dependency parents. + * + * In all other cases, the field is set to zero. + * + * Note that while this count is initially taken from the + * flush dependency fields in the associated instance of + * H5C_cache_entry_t, if the entry is in the cache image + * (i.e. include_in_image is TRUE), any parents that are + * not in the image are removed from this count and + * from the fd_parent_addrs array below. + * + * Finally observe that if the entry is dirty and in the + * cache image, and its parent is dirty and not in the cache + * image, then the entry must be removed from the cache image + * to avoid violating the flush dependency flush ordering. + * This should have happened before the construction of + * the instance of H5C_image_entry_t. + * + * fd_parent_addrs: If the entry is a child in one or more flush dependency + * relationship when H5C_prep_for_file_close() is called, this + * field must contain a pointer to an array of size + * fd_parent_count containing the on disk addresses of the + * parents. + * + * In all other cases, the field is set to NULL. + * + * Note that while this list of addresses is initially taken + * from the flush dependency fields in the associated instance of + * H5C_cache_entry_t, if the entry is in the cache image + * (i.e. include_in_image is TRUE), any parents that are not + * in the image are removed from this list, and from the + * fd_parent_count above. + * + * Finally observe that if the entry is dirty and in the + * cache image, and its parent is dirty and not in the cache + * image, then the entry must be removed from the cache image + * to avoid violating the flush dependency flush ordering. + * This should have happened before the construction of + * the instance of H5C_image_entry_t. + * + * fd_child_count: If the entry is a parent in a flush dependency + * relationship, this field contains the number of flush + * dependency children. + * + * In all other cases, the field is set to zero. + * + * Note that while this count is initially taken from the + * flush dependency fields in the associated instance of + * H5C_cache_entry_t, if the entry is in the cache image + * (i.e. include_in_image is TRUE), any children + * that are not in the image are removed from this count. + * + * fd_dirty_child_count: If the entry is a parent in a flush dependency + * relationship, this field contains the number of dirty flush + * dependency children. + * + * In all other cases, the field is set to zero. + * + * Note that while this count is initially taken from the + * flush dependency fields in the associated instance of + * H5C_cache_entry_t, if the entry is in the cache image + * (i.e. include_in_image is TRUE), any dirty children + * that are not in the image are removed from this count. + * + * image_ptr: Pointer to void. When not NULL, this field points to a + * dynamically allocated block of size bytes in which the + * on disk image of the metadata cache entry is stored. + * + * If the entry is dirty, the pre-serialize and serialize + * callbacks must be used to update this image before it is + * written to disk + * + * + ****************************************************************************/ + +typedef struct H5C_image_entry_t { + uint32_t magic; + haddr_t addr; + size_t size; + H5C_ring_t ring; + int32_t age; + int32_t type_id; + int32_t lru_rank; + hbool_t is_dirty; + unsigned image_fd_height; + uint64_t fd_parent_count; + haddr_t *fd_parent_addrs; + uint64_t fd_child_count; + uint64_t fd_dirty_child_count; + void *image_ptr; +} H5C_image_entry_t; + /**************************************************************************** * * structure H5C_auto_size_ctl_t @@ -1736,12 +2097,98 @@ typedef struct H5C_auto_size_ctl_t { double empty_reserve; } H5C_auto_size_ctl_t; +/**************************************************************************** + * + * structure H5C_cache_image_ctl_t + * + * Instances of H5C_image_ctl_t are used to get and set the control + * fields for generation of a metadata cache image on file close. + * + * At present control of construction of a cache image is via a FAPL + * property at file open / create. + * + * The fields of the structure are discussed individually below: + * + * version: Integer field containing the version number of this version + * of the H5C_image_ctl_t structure. Any instance of + * H5C_image_ctl_t passed to the cache must have a known + * version number, or an error will be flagged. + * + * generate_image: Boolean flag indicating whether a cache image should + * be created on file close. + * + * save_resize_status: Boolean flag indicating whether the cache image + * should include the adaptive cache resize configuration and status. + * Note that this field is ignored at present. + * + * entry_ageout: Integer field indicating the maximum number of + * times a prefetched entry can appear in subsequent cache images. + * This field exists to allow the user to avoid the buildup of + * infrequently used entries in long sequences of cache images. + * + * The value of this field must lie in the range + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100). + * + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit + * is imposed on number of times a prefeteched entry can appear + * in subsequent cache images. + * + * A value of 0 prevents prefetched entries from being included + * in cache images. + * + * Positive integers restrict prefetched entries to the specified + * number of appearances. + * + * Note that the number of subsequent cache images that a prefetched + * entry has appeared in is tracked in an 8 bit field. Thus, while + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its + * current value, any value in excess of 255 will be the functional + * equivalent of H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE. + * + * flags: Unsigned integer containing flags controling which aspects of the + * cache image functinality is actually executed. The primary impetus + * behind this field is to allow developement of tests for partial + * implementations that will require little if any modification to run + * with the full implementation. In normal operation, all flags should + * be set. + * + ****************************************************************************/ + +#define H5C_CI__GEN_MDCI_SBE_MESG ((unsigned)0x0001) +#define H5C_CI__GEN_MDC_IMAGE_BLK ((unsigned)0x0002) +#define H5C_CI__SUPRESS_ENTRY_WRITES ((unsigned)0x0004) +#define H5C_CI__WRITE_CACHE_IMAGE ((unsigned)0x0008) + +/* This #define must set all defined H5C_CI flags. It is + * used in the default value for instances of H5C_cache_image_ctl_t. + * This value will only be modified in test code. + */ +#define H5C_CI__ALL_FLAGS ((unsigned)0x000F) + +#define H5C__DEFAULT_CACHE_IMAGE_CTL \ +{ \ + /* version = */ H5C__CURR_CACHE_IMAGE_CTL_VER, \ + /* generate_image = */ FALSE, \ + /* save_resize_status = */ FALSE, \ + /* entry_ageout = */ H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE, \ + /* flags = */ H5C_CI__ALL_FLAGS \ +} + +typedef struct H5C_cache_image_ctl_t { + int32_t version; + hbool_t generate_image; + hbool_t save_resize_status; + int32_t entry_ageout; + unsigned flags; +} H5C_cache_image_ctl_t; + /***************************************/ /* Library-private Function Prototypes */ /***************************************/ H5_DLL H5C_t *H5C_create(size_t max_cache_size, size_t min_clean_size, - int max_type_id, const char *(*type_name_table_ptr), + int max_type_id, const H5C_class_t * const *class_table_ptr, H5C_write_permitted_func_t check_write_permitted, hbool_t write_permitted, H5C_log_flush_func_t log_flush, void *aux_ptr); H5_DLL herr_t H5C_set_up_logging(H5C_t *cache_ptr, const char log_location[], hbool_t start_immediately); @@ -1770,9 +2217,11 @@ herr_t H5C_verify_tag(int id, haddr_t tag); H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr); +H5_DLL herr_t H5C_get_cache_image_config(const H5C_t * cache_ptr, + H5C_cache_image_ctl_t *config_ptr); H5_DLL herr_t H5C_get_cache_size(H5C_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, - int32_t *cur_num_entries_ptr); + uint32_t *cur_num_entries_ptr); H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t *cache_ptr, double *hit_rate_ptr); H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t *size_ptr, hbool_t *in_cache_ptr, hbool_t *is_dirty_ptr, @@ -1783,8 +2232,11 @@ H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t *cache_ptr, hbool_t *evictio H5_DLL void * H5C_get_aux_ptr(const H5C_t *cache_ptr); H5_DLL FILE *H5C_get_trace_file_ptr(const H5C_t *cache_ptr); H5_DLL FILE *H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr); +H5_DLL herr_t H5C_image_stats(H5C_t * cache_ptr, hbool_t print_header); H5_DLL herr_t H5C_insert_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags); +H5_DLL herr_t H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, + hsize_t len, hbool_t rw); H5_DLL herr_t H5C_mark_entry_dirty(void *thing); H5_DLL herr_t H5C_mark_entry_clean(void *thing); H5_DLL herr_t H5C_mark_entry_unserialized(void *thing); @@ -1799,6 +2251,8 @@ H5_DLL void * H5C_protect(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, H5_DLL herr_t H5C_reset_cache_hit_rate_stats(H5C_t *cache_ptr); H5_DLL herr_t H5C_resize_entry(void *thing, size_t new_size); H5_DLL herr_t H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr); +H5_DLL herr_t H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, + H5C_cache_image_ctl_t *config_ptr); H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled); H5_DLL herr_t H5C_set_prefix(H5C_t *cache_ptr, char *prefix); H5_DLL herr_t H5C_set_trace_file_ptr(H5C_t *cache_ptr, FILE *trace_file_ptr); @@ -1810,6 +2264,7 @@ H5_DLL herr_t H5C_unpin_entry(void *thing); H5_DLL herr_t H5C_destroy_flush_dependency(void *parent_thing, void *child_thing); H5_DLL herr_t H5C_unprotect(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *thing, unsigned int flags); +H5_DLL herr_t H5C_validate_cache_image_config(H5C_cache_image_ctl_t * ctl_ptr); H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests); H5_DLL herr_t H5C_ignore_tags(H5C_t *cache_ptr); @@ -1819,20 +2274,32 @@ H5_DLL herr_t H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hboo H5_DLL herr_t H5C_get_entry_ring(const H5F_t *f, haddr_t addr, H5C_ring_t *ring); H5_DLL herr_t H5C_unsettle_entry_ring(void *thing); H5_DLL herr_t H5C_remove_entry(void *thing); +H5_DLL herr_t H5C_cache_image_status(H5F_t * f, hbool_t *load_ci_ptr, + hbool_t *write_ci_ptr); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5C_apply_candidate_list(H5F_t *f, hid_t dxpl_id, - H5C_t *cache_ptr, int num_candidates, haddr_t *candidates_list_ptr, + H5C_t *cache_ptr, unsigned num_candidates, haddr_t *candidates_list_ptr, int mpi_rank, int mpi_size); H5_DLL herr_t H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr); H5_DLL herr_t H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr); H5_DLL herr_t H5C_clear_coll_entries(H5C_t * cache_ptr, hbool_t partial); -H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, hid_t dxpl_id, int32_t ce_array_len, +H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, hid_t dxpl_id, unsigned ce_array_len, haddr_t *ce_array_ptr); #endif /* H5_HAVE_PARALLEL */ #ifndef NDEBUG /* debugging functions */ +H5_DLL hbool_t H5C_get_serialization_in_progress(const H5C_t *cache_ptr); H5_DLL hbool_t H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring); +H5_DLL herr_t H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn); +H5_DLL herr_t H5C_get_entry_ptr_from_addr(H5C_t *cache_ptr, haddr_t addr, + void **entry_ptr_ptr); +H5_DLL herr_t H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, + haddr_t child_addr, hbool_t *fd_exists_ptr); +H5_DLL herr_t H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, + const H5C_class_t *expected_type, hbool_t *in_cache_ptr, + hbool_t *type_ok_ptr); +H5_DLL herr_t H5C_validate_index_list(H5C_t *cache_ptr); #endif /* NDEBUG */ #endif /* !_H5Cprivate_H */ diff --git a/src/H5Cquery.c b/src/H5Cquery.c index f5409f7..33a322d 100644 --- a/src/H5Cquery.c +++ b/src/H5Cquery.c @@ -131,7 +131,7 @@ H5C_get_cache_size(H5C_t * cache_ptr, size_t * max_size_ptr, size_t * min_clean_size_ptr, size_t * cur_size_ptr, - int32_t * cur_num_entries_ptr) + uint32_t * cur_num_entries_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -444,7 +444,8 @@ H5C_get_entry_ring(const H5F_t *f, haddr_t addr, H5C_ring_t *ring) /* Locate the entry at the address */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) - HDassert(entry_ptr); + if(entry_ptr == NULL) + HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't find entry in index") /* Return the ring value */ *ring = entry_ptr->ring; diff --git a/src/H5EApkg.h b/src/H5EApkg.h index 093403c..7540ff2 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -378,21 +378,6 @@ typedef struct H5EA__ctx_cb_t { /* Package Private Variables */ /*****************************/ -/* H5EA header inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_EARRAY_HDR[1]; - -/* H5EA index block inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_EARRAY_IBLOCK[1]; - -/* H5EA index block inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_EARRAY_SBLOCK[1]; - -/* H5EA data block inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_EARRAY_DBLOCK[1]; - -/* H5EA data block page inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1]; - /* Internal extensible array testing class */ H5_DLLVAR const H5EA_class_t H5EA_CLS_TEST[1]; diff --git a/src/H5F.c b/src/H5F.c index a43009b..5fd3a7d 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -445,6 +445,8 @@ done: hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { + hbool_t ci_load = FALSE; /* whether MDC ci load requested */ + hbool_t ci_write = FALSE; /* whether MDC CI write requested */ H5F_t *new_file = NULL; /*file struct for new file */ hid_t dxpl_id = H5AC_ind_read_dxpl_id; /*dxpl used by library */ hid_t ret_value; /*return value */ @@ -490,6 +492,12 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) if(NULL == (new_file = H5F_open(filename, flags, fcpl_id, fapl_id, dxpl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to create file") + /* Check to see if both SWMR and cache image are requested. Fail if so */ + if(H5C_cache_image_status(new_file, &ci_load, &ci_write) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MDC cache image status") + if((ci_load || ci_write) && (flags & (H5F_ACC_SWMR_READ | H5F_ACC_SWMR_WRITE))) + HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "can't have both SWMR and cache image") + /* Get an atom for the file */ if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file") @@ -498,9 +506,8 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) new_file->file_id = ret_value; done: - if(ret_value < 0 && new_file) - if(H5F_close(new_file) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problems closing file") + if(ret_value < 0 && new_file && H5F_try_close(new_file, NULL) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problems closing file") FUNC_LEAVE_API(ret_value) } /* end H5Fcreate() */ @@ -549,6 +556,8 @@ done: hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) { + hbool_t ci_load = FALSE; /* whether MDC ci load requested */ + hbool_t ci_write = FALSE; /* whether MDC CI write requested */ H5F_t *new_file = NULL; /*file struct for new file */ hid_t dxpl_id = H5AC_ind_read_dxpl_id; /*dxpl used by library */ hid_t ret_value; /*return value */ @@ -578,6 +587,12 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) if(NULL == (new_file = H5F_open(filename, flags, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to open file") + /* Check to see if both SWMR and cache image are requested. Fail if so */ + if(H5C_cache_image_status(new_file, &ci_load, &ci_write) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MDC cache image status") + if((ci_load || ci_write) && (flags & (H5F_ACC_SWMR_READ | H5F_ACC_SWMR_WRITE))) + HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "can't have both SWMR and cache image") + /* Get an atom for the file */ if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") @@ -1177,7 +1192,7 @@ H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, int *cur_num_entries_ptr) { H5F_t *file; /* File object for file ID */ - int32_t cur_num_entries; + uint32_t cur_num_entries; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1593,6 +1608,8 @@ done: herr_t H5Fstart_swmr_write(hid_t file_id) { + hbool_t ci_load = FALSE; /* whether MDC ci load requested */ + hbool_t ci_write = FALSE; /* whether MDC CI write requested */ H5F_t *file = NULL; /* File info */ size_t grp_dset_count=0; /* # of open objects: groups & datasets */ size_t nt_attr_count=0; /* # of opened named datatypes + opened attributes */ @@ -1626,6 +1643,12 @@ H5Fstart_swmr_write(hid_t file_id) HDassert(file->shared->sblock->status_flags & H5F_SUPER_WRITE_ACCESS); + /* Check to see if cache image is enabled. Fail if so */ + if(H5C_cache_image_status(file, &ci_load, &ci_write) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MDC cache image status") + if(ci_load || ci_write ) + HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "can't have both SWMR and MDC cache image") + /* Flush data buffers */ if(H5F_flush(file, H5AC_ind_read_dxpl_id, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") @@ -1868,7 +1891,48 @@ H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled, done: FUNC_LEAVE_API(ret_value) -} /* H5Fstop_mdc_logging() */ +} /* H5Fget_mdc_logging_status() */ + + +/*------------------------------------------------------------------------- + * Function: H5Fset_latest_format + * + * Purpose: Enable switching the "latest format" flag while a file is open. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Monday, September 21, 2015 + *------------------------------------------------------------------------- + */ +herr_t +H5Fset_latest_format(hid_t file_id, hbool_t latest_format) +{ + H5F_t *f; /* File */ + unsigned latest_flags; /* Latest format flags for file */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "ib", file_id, latest_format); + + /* Check args */ + if(NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "not a file ID") + + /* Check if the value is changing */ + latest_flags = H5F_USE_LATEST_FLAGS(f, H5F_LATEST_ALL_FLAGS); + if(latest_format != (H5F_LATEST_ALL_FLAGS == latest_flags)) { + /* Call the flush routine, for this file */ + if(H5F_flush(f, H5AC_ind_read_dxpl_id, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") + + /* Toggle the 'latest format' flag */ + H5F_SET_LATEST_FLAGS(f, latest_format ? H5F_LATEST_ALL_FLAGS : 0); + } /* end if */ + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Fset_latest_format() */ /*------------------------------------------------------------------------- diff --git a/src/H5FApkg.h b/src/H5FApkg.h index ccef562..63eacff 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -249,15 +249,6 @@ typedef struct H5FA_dblk_page_cache_ud_t { /* Package Private Variables */ /*****************************/ -/* H5FA header inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_FARRAY_HDR[1]; - -/* H5FA data block inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_FARRAY_DBLOCK[1]; - -/* H5FA data block page inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1]; - /* Internal fixed array testing class */ H5_DLLVAR const H5FA_class_t H5FA_CLS_TEST[1]; diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index befcaca..7e12869 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -1151,14 +1151,18 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) ALL_MEMBERS(mt) { out_mt = mt; - if (f1->memb[mt] && f2->memb[mt]) break; - if (!cmp) { - if (f1->memb[mt]) cmp = -1; - else if (f2->memb[mt]) cmp = 1; + if(f1->memb[mt] && f2->memb[mt]) + break; + if(!cmp) { + if(f1->memb[mt]) + cmp = -1; + else if(f2->memb[mt]) + cmp = 1; } } END_MEMBERS; assert(cmp || out_mt=H5FD_MEM_NTYPES) return cmp; + if(out_mt>=H5FD_MEM_NTYPES) + return cmp; return H5FDcmp(f1->memb[out_mt], f2->memb[out_mt]); } diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index f07ffad..4411236 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -199,12 +199,6 @@ struct H5FS_t { /* Package Private Variables */ /*****************************/ -/* H5FS header inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_FSPACE_HDR[1]; - -/* H5FS section info inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_FSPACE_SINFO[1]; - /* Declare a free list to manage the H5FS_node_t struct */ H5FL_EXTERN(H5FS_node_t); diff --git a/src/H5Fint.c b/src/H5Fint.c index 8ad97a8..d122357 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -188,6 +188,8 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) if(H5P_set(new_plist, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, &(f->coll_md_write)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set collective metadata read flag") #endif /* H5_HAVE_PARALLEL */ + if(H5P_set(new_plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, &(f->shared->mdc_initCacheImageCfg)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set initial metadata cache resize config.") /* Prepare the driver property */ driver_prop.driver_id = f->shared->lf->driver_id; @@ -667,6 +669,8 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t if(H5P_get(plist, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, &(f->coll_md_write)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get collective metadata write flag") #endif /* H5_HAVE_PARALLEL */ + if(H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, &(f->shared->mdc_initCacheImageCfg)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get initial metadata cache resize config") /* Get the VFD values to cache */ f->shared->maxaddr = H5FD_get_maxaddr(lf); @@ -750,7 +754,7 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t * The cache might be created with a different number of elements and * the access property list should be updated to reflect that. */ - if(H5AC_create(f, &(f->shared->mdc_initCacheCfg)) < 0) + if(H5AC_create(f, &(f->shared->mdc_initCacheCfg), &(f->shared->mdc_initCacheImageCfg)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create metadata cache") /* Create the file's "open object" information */ @@ -829,7 +833,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) if((H5F_ACC_RDWR & H5F_INTENT(f)) && flush) if(H5F__flush_phase1(f, dxpl_id) < 0) /* Push error, but keep going*/ - HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") + HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush cached data (phase 1)") /* Notify the metadata cache that the file is about to be closed. * This allows the cache to set up for creating a metadata cache @@ -845,8 +849,8 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) */ if((H5F_ACC_RDWR & H5F_INTENT(f)) && flush) if(H5F__flush_phase2(f, dxpl_id, TRUE) < 0) - /* Push error, but keep going*/ - HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") + /* Push error, but keep going */ + HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush cached data (phase 2)") /* With the shutdown modifications, the contents of the metadata cache * should be clean at this point, with the possible exception of the @@ -865,7 +869,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) } /* end if */ /* With the shutdown modifications, the contents of the metadata cache - * should be clean at this point, with the possible exception of the + * should be clean at this point, with the possible exception of the * the superblock and superblock extension. * * Verify this. @@ -888,18 +892,21 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) * (assuming they are persistent). In this case, closing the * free space managers should have no effect on EOA. * - * -- JRM + * -- JRM */ if(H5F_ACC_RDWR & H5F_INTENT(f)) { if(H5MF_close(f, dxpl_id) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file free space info") - /* at this point, only the superblock and superblock + /* at this point, only the superblock and superblock * extension should be dirty. */ HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); + /* Flush the file again (if requested), as shutting down the + * free space manager may dirty some data structures again. + */ if(flush) { /* Clear status_flags */ f->shared->sblock->status_flags &= (uint8_t)(~H5F_SUPER_WRITE_ACCESS); @@ -914,7 +921,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) * so that the eoa value corresponds to the end of the * space written to in the file. * - * At most, this should change the superblock or the + * At most, this should change the superblock or the * superblock extension messages. */ if(H5MF_free_aggrs(f, dxpl_id) < 0) @@ -926,7 +933,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") - /* at this point, only the superblock and superblock + /* at this point, only the superblock and superblock * extension should be dirty. */ HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); @@ -948,7 +955,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) f->shared->sblock = NULL; } /* end if */ - /* with the possible exception of the superblock and superblock + /* with the possible exception of the superblock and superblock * extension, the metadata cache should be clean at this point. * * Verify this. @@ -1278,6 +1285,10 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, shared = file->shared; lf = shared->lf; + /* Get the file access property list, for future queries */ + if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list") + /* * Read or write the file superblock, depending on whether the file is * empty or not. @@ -1311,10 +1322,6 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read root group") } /* end if */ - /* Get the file access property list, for future queries */ - if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list") - /* * Decide the file close degree. If it's the first time to open the * file, set the degree to access property list value; if it's the @@ -1522,7 +1529,7 @@ H5F__flush_phase2(H5F_t *f, hid_t dxpl_id, hbool_t closing) /* Flush file buffers to disk. */ if(H5FD_flush(f->shared->lf, dxpl_id, closing) < 0) /* Push error, but keep going*/ - HDONE_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed") + HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "low level flush failed") FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__flush_phase2() */ @@ -2671,3 +2678,33 @@ H5F_set_coll_md_read(H5F_t *f, H5P_coll_md_read_flag_t cmr) } /* H5F_set_coll_md_read() */ #endif /* H5_HAVE_PARALLEL */ + +/*------------------------------------------------------------------------- + * Function: H5F_set_latest_flags + * + * Purpose: Set the latest_flags field with a new value. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Quincey Koziol + * 4/26/16 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_set_latest_flags(H5F_t *f, unsigned flags) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + HDassert(0 == ((~flags) & H5F_LATEST_ALL_FLAGS)); + + f->shared->latest_flags = flags; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5F_set_latest_flags() */ + diff --git a/src/H5Fio.c b/src/H5Fio.c index e215666..afe1278 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -302,7 +302,7 @@ H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id) #ifndef NDEBUG { unsigned status = 0; - int32_t cur_num_entries; + uint32_t cur_num_entries; /* Retrieve status of the superblock */ if(H5AC_get_entry_status(f, (haddr_t)0, &status) < 0) diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 11665f4..93a3978 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -287,6 +287,12 @@ struct H5F_file_t { /* metadata cache. This structure is */ /* fixed at creation time and should */ /* not change thereafter. */ + H5AC_cache_image_config_t + mdc_initCacheImageCfg; /* initial configuration for the */ + /* generate metadata cache image on */ + /* close option. This structure is */ + /* fixed at creation time and should */ + /* not change thereafter. */ hbool_t use_mdc_logging; /* Set when metadata logging is desired */ hbool_t start_mdc_log_on_access; /* set when mdc logging should */ /* begin on file access/create */ @@ -369,9 +375,6 @@ H5FL_EXTERN(H5F_t); /* Declare a free list to manage the H5F_file_t struct */ H5FL_EXTERN(H5F_file_t); -H5_DLLVAR const H5AC_class_t H5AC_SUPERBLOCK[1]; -H5_DLLVAR const H5AC_class_t H5AC_DRVRINFO[1]; - /******************************/ /* Package Private Prototypes */ @@ -400,7 +403,8 @@ H5_DLL herr_t H5F__super_free(H5F_super_t *sblock); /* Superblock extension related routines */ H5_DLL herr_t H5F_super_ext_open(H5F_t *f, haddr_t ext_addr, H5O_loc_t *ext_ptr); -H5_DLL herr_t H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, hbool_t may_create); +H5_DLL herr_t H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, + void *mesg, hbool_t may_create, unsigned mesg_flags); H5_DLL herr_t H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id); H5_DLL herr_t H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, hbool_t was_created); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index bcc56c6..7d288fa 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -317,6 +317,7 @@ #define H5F_SET_GRP_BTREE_SHARED(F, RC) (((F)->shared->grp_btree_shared = (RC)) ? SUCCEED : FAIL) #define H5F_USE_TMP_SPACE(F) ((F)->shared->use_tmp_space) #define H5F_IS_TMP_ADDR(F, ADDR) (H5F_addr_le((F)->shared->tmp_addr, (ADDR))) +#define H5F_SET_LATEST_FLAGS(F, FL) ((F)->shared->latest_flags = (FL)) #ifdef H5_HAVE_PARALLEL #define H5F_COLL_MD_READ(F) ((F)->coll_md_read) #endif /* H5_HAVE_PARALLEL */ @@ -367,6 +368,7 @@ #define H5F_SET_GRP_BTREE_SHARED(F, RC) (H5F_set_grp_btree_shared((F), (RC))) #define H5F_USE_TMP_SPACE(F) (H5F_use_tmp_space(F)) #define H5F_IS_TMP_ADDR(F, ADDR) (H5F_is_tmp_addr((F), (ADDR))) +#define H5F_SET_LATEST_FLAGS(F, FL) (H5F_set_latest_flags((F), (FL))) #ifdef H5_HAVE_PARALLEL #define H5F_COLL_MD_READ(F) (H5F_coll_md_read(F)) #endif /* H5_HAVE_PARALLEL */ @@ -481,6 +483,7 @@ #define H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME "evict_on_close_flag" /* Whether or not the metadata cache will evict objects on close */ #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME "core_write_tracking_page_size" /* The page size in kiB when core VFD write tracking is enabled */ #define H5F_ACS_COLL_MD_WRITE_FLAG_NAME "collective_metadata_write" /* property indicating whether metadata writes are done collectively or not */ +#define H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME "mdc_initCacheImageCfg" /* Initial metadata cache image creation configuration */ /* ======================== File Mount properties ====================*/ #define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ @@ -700,6 +703,7 @@ H5_DLL struct H5UC_t *H5F_grp_btree_shared(const H5F_t *f); H5_DLL herr_t H5F_set_grp_btree_shared(H5F_t *f, struct H5UC_t *rc); H5_DLL hbool_t H5F_use_tmp_space(const H5F_t *f); H5_DLL hbool_t H5F_is_tmp_addr(const H5F_t *f, haddr_t addr); +H5_DLL herr_t H5F_set_latest_flags(H5F_t *f, unsigned flags); #ifdef H5_HAVE_PARALLEL H5_DLL H5P_coll_md_read_flag_t H5F_coll_md_read(const H5F_t *f); H5_DLL void H5F_set_coll_md_read(H5F_t *f, H5P_coll_md_read_flag_t flag); diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index a79da75..c57a821 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -246,6 +246,7 @@ H5_DLL herr_t H5Fstart_swmr_write(hid_t file_id); H5_DLL ssize_t H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info/*out*/); H5_DLL herr_t H5Fclear_elink_file_cache(hid_t file_id); +H5_DLL herr_t H5Fset_latest_format(hid_t file_id, hbool_t latest_format); H5_DLL herr_t H5Fstart_mdc_logging(hid_t file_id); H5_DLL herr_t H5Fstop_mdc_logging(hid_t file_id); H5_DLL herr_t H5Fget_mdc_logging_status(hid_t file_id, diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 893ce26..3b86dae 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -240,7 +240,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5F__update_super_ext_driver_msg(H5F_t *f, hid_t dxpl_id) { H5F_super_t *sblock; /* Pointer to the super block */ @@ -290,7 +290,7 @@ H5F__update_super_ext_driver_msg(H5F_t *f, hid_t dxpl_id) */ drvinfo.len = driver_size; drvinfo.buf = dbuf; - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_DRVINFO_ID, &drvinfo, FALSE) < 0) + if(H5F_super_ext_write_msg(f, dxpl_id, H5O_DRVINFO_ID, &drvinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "unable to update driver info header message") } /* end if driver_size > 0 */ } /* end if !H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO) */ @@ -692,6 +692,34 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id, hbool_t initial_read) f->shared->fs_addr[u] = fsinfo.fs_addr[u-1]; } /* end if */ + /* Check for the extension having a 'metadata cache image' message */ + if((status = H5O_msg_exists(&ext_loc, H5O_MDCI_MSG_ID, dxpl_id)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header") + if(status) { + hbool_t rw = ((rw_flags & H5AC__READ_ONLY_FLAG) == 0); + H5O_mdci_t mdci_msg; + + /* if the metadata cache image superblock extension message exists, + * read its contents and pass the data on to the metadata cache. + * Given this data, the cache will load and decode the metadata + * cache image block, decoded it and load its contents into the + * the cache on the test protect call. + * + * Further, if the file is opened R/W, the metadata cache will + * delete the metadata cache image superblock extension and free + * the cache image block. Don't do this now as f->shared + * is not fully setup, which complicates matters. + */ + + /* Retrieve the 'metadata cache image message' structure */ + if(NULL == H5O_msg_read(&ext_loc, H5O_MDCI_MSG_ID, &mdci_msg, dxpl_id)) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get metadata cache image message") + + /* Indicate to the cache that there's an image to load on first protect call */ + if(H5AC_load_cache_image_on_next_protect(f, mdci_msg.addr, mdci_msg.size, rw) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTLOAD, FAIL, "call to H5AC_load_cache_image_on_next_protect failed"); + } /* end if */ + /* Close superblock extension */ if(H5F_super_ext_close(f, &ext_loc, dxpl_id, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close file's superblock extension") @@ -737,7 +765,7 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id, hbool_t initial_read) HDassert(f->shared->sblock == NULL); f->shared->sblock = sblock; #endif /* JRM */ - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_DRVINFO_ID, &drvinfo, FALSE) < 0) + if(H5F_super_ext_write_msg(f, dxpl_id, H5O_DRVINFO_ID, &drvinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ @@ -833,6 +861,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) H5O_loc_t ext_loc; /* Superblock extension object location */ hbool_t need_ext; /* Whether the superblock extension is needed */ hbool_t ext_created = FALSE; /* Whether the extension has been created */ + hbool_t non_default_fs_settings = FALSE; /* Whether the file has non-default free-space settings */ herr_t ret_value = SUCCEED; /* Return Value */ FUNC_ENTER_PACKAGE_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) @@ -859,6 +888,11 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, &sblock->btree_k[0]) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get rank for btree internal nodes") + /* Check for non-default free-space settings */ + if(!(f->shared->fs_strategy == H5F_FILE_SPACE_STRATEGY_DEF && + f->shared->fs_threshold == H5F_FREE_SPACE_THRESHOLD_DEF)) + non_default_fs_settings = TRUE; + /* Bump superblock version if latest superblock version support is enabled */ if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_SUPERBLOCK)) super_vers = HDF5_SUPERBLOCK_VERSION_LATEST; @@ -868,8 +902,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) /* Bump superblock version to create superblock extension for * non-default file space strategy or non-default free-space threshold */ - else if(f->shared->fs_strategy != H5F_FILE_SPACE_STRATEGY_DEF || - f->shared->fs_threshold != H5F_FREE_SPACE_THRESHOLD_DEF) + else if(non_default_fs_settings) super_vers = HDF5_SUPERBLOCK_VERSION_2; /* Check for non-default indexed storage B-tree internal 'K' value * and set the version # of the superblock to 1 if it is a non-default @@ -986,8 +1019,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) need_ext = TRUE; } /* end if */ /* Files with non-default free space settings always need the superblock extension */ - else if(f->shared->fs_strategy != H5F_FILE_SPACE_STRATEGY_DEF || - f->shared->fs_threshold != H5F_FREE_SPACE_THRESHOLD_DEF) { + else if(non_default_fs_settings) { HDassert(super_vers >= HDF5_SUPERBLOCK_VERSION_2); need_ext = TRUE; } /* end if */ @@ -1075,9 +1107,8 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) f->shared->drvinfo_sb_msg_exists = TRUE; } /* end if */ - /* Check for non-default free space settings */ - if(f->shared->fs_strategy != H5F_FILE_SPACE_STRATEGY_DEF || - f->shared->fs_threshold != H5F_FREE_SPACE_THRESHOLD_DEF) { + /* Check for non-default free-space info settings */ + if(non_default_fs_settings) { H5FD_mem_t type; /* Memory type for iteration */ H5O_fsinfo_t fsinfo; /* Free space manager info message */ @@ -1365,7 +1396,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, hbool_t may_create) +H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, + hbool_t may_create, unsigned mesg_flags) { H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ @@ -1410,7 +1442,7 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, hbool_ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "Message should not exist") /* Create the message with ID in the superblock extension */ - if(H5O_msg_create(&ext_loc, id, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, mesg, dxpl_id) < 0) + if(H5O_msg_create(&ext_loc, id, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to create the message in object header") } /* end if */ else { @@ -1418,7 +1450,7 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, hbool_ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "Message should exist") /* Update the message with ID in the superblock extension */ - if(H5O_msg_write(&ext_loc, id, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, mesg, dxpl_id) < 0) + if(H5O_msg_write(&ext_loc, id, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to write the message in object header") } /* end else */ diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index c994da3..1e8ad31 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -312,9 +312,6 @@ typedef struct H5G_copy_file_ud_t { */ H5_DLLVAR H5B_class_t H5B_SNODE[1]; -/* The cache subclass */ -H5_DLLVAR const H5AC_class_t H5AC_SNODE[1]; - /* The v2 B-tree class for indexing 'name' field on links */ H5_DLLVAR const H5B2_class_t H5G_BT2_NAME[1]; diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 302fe04..ffdac9a 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -116,14 +116,17 @@ static herr_t H5HF__cache_dblock_free_icr(void *thing); /* Debugging Function Prototypes */ #ifndef NDEBUG -static herr_t H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, - hbool_t *clean); -static herr_t H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, - H5HF_indirect_t *iblock, unsigned *iblock_status, hbool_t *clean); -static herr_t H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, - H5HF_indirect_t *iblock, hbool_t *clean, hbool_t *has_dblocks); -static herr_t H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, - H5HF_indirect_t *iblock, hbool_t *clean, hbool_t *has_iblocks); +static herr_t H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, + H5HF_hdr_t *hdr, hbool_t *fd_clean, hbool_t *clean); +static herr_t H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, + hid_t dxpl_id, haddr_t fd_parent_addr, H5HF_indirect_t *iblock, + unsigned *iblock_status, hbool_t *fd_clean, hbool_t *clean); +static herr_t H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, + haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, + hbool_t *clean, hbool_t *has_dblocks); +static herr_t H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, + hid_t dxpl_id, haddr_t fd_parent_addr, H5HF_indirect_t *iblock, + hbool_t *fd_clean, hbool_t *clean, hbool_t *has_iblocks); #endif /* NDEBUG */ @@ -687,6 +690,7 @@ H5HF__cache_hdr_pre_serialize(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, #ifndef NDEBUG { hbool_t descendants_clean = TRUE; + hbool_t fd_children_clean = TRUE; /* Verify that flush dependencies are working correctly. Do this * by verifying that either: @@ -701,10 +705,22 @@ H5HF__cache_hdr_pre_serialize(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, * constraint is met by default. * * Do this with a call to H5HF__cache_verify_hdr_descendants_clean(). + * + * Note that decendants need not be clean if the pre_serialize call + * is made during a cache serialization instead of an entry or cache + * flush. + * + * Note also that with the recent change in the definition of flush + * dependency, not all decendants need be clean -- only direct flush + * dependency children. + * + * Finally, observe that the H5HF__cache_verify_hdr_descendants_clean() + * call still looks for dirty descendants. At present we do not check + * this value. */ - if(H5HF__cache_verify_hdr_descendants_clean((H5F_t *)f, hdr, &descendants_clean) < 0) + if(H5HF__cache_verify_hdr_descendants_clean((H5F_t *)f, dxpl_id, hdr, &fd_children_clean, &descendants_clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify hdr descendants clean.") - HDassert(descendants_clean); + HDassert(fd_children_clean); } #endif /* NDEBUG */ @@ -1176,8 +1192,9 @@ H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len) * and if so, to move it to real file space before the entry is * serialized. * - * In debug compiles, this function also verifies that all children - * of this indirect block are either clean or are not in cache. + * In debug compiles, this function also verifies that all + * immediate flush dependency children of this indirect block + * are either clean or are not in cache. * * Return: Success: SUCCEED * Failure: FAIL @@ -1217,10 +1234,12 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, #ifndef NDEBUG { hbool_t descendants_clean = TRUE; + hbool_t fd_children_clean = TRUE; unsigned iblock_status = 0; /* verify that flush dependencies are working correctly. Do this - * by verifying that all children of this iblock are clean. + * by verifying that all immediate flush dependency children of this + * iblock are clean. */ if(H5AC_get_entry_status(f, iblock->addr, &iblock_status) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get iblock status") @@ -1230,9 +1249,9 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, * there is no need to check to see if it is pinned or protected, or to * protect it if it is not. */ - if(H5HF__cache_verify_iblock_descendants_clean((H5F_t *)f, iblock, &iblock_status, &descendants_clean) < 0) + if(H5HF__cache_verify_iblock_descendants_clean((H5F_t *)f, dxpl_id, iblock->addr, iblock, &iblock_status, &fd_children_clean, &descendants_clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify descendants clean.") - HDassert(descendants_clean); + HDassert(fd_children_clean); } #endif /* NDEBUG */ @@ -2585,6 +2604,54 @@ done: * instance of H5HF_hdr_t are clean. Set *clean to * TRUE if this is the case, and to FALSE otherwise. * + * Update -- 8/24/15 + * + * With the advent of the metadata cache image feature, it is + * possible for the pre-serialize and serialize calls to be + * invoked outside of a flush. While this serialization + * observes flush dependencies for the order of serialization, + * the entries are not written to disk, and hence dirty entries + * remain dirty. + * + * To address this, updated the sanity checks in this function + * to treat entries whose images are up to date as clean if + * a cache serialization is in progress. + * + * Update -- 9/29/16 + * + * The implementation of flush dependencies has been changed. + * Prior to this change, a flush dependency parent could be + * flushed if and only if all its flush dependency decendants + * were clean. In the new definition, a flush dependency + * parent can be flushed if all its immediate flush dependency + * children are clean, regardless of any other dirty + * decendants. + * + * Further, metadata cache entries are now allowed to have + * multiple flush dependency parents. + * + * This means that the fractal heap is no longer ncessarily + * flushed from the bottom up. + * + * For example, it is now possible for a dirty fractal heap + * header to be flushed before a dirty dblock, as long as the + * there in an interviening iblock, and the header has no + * dirty immediate flush dependency children. + * + * Also, I gather that under some circumstances, a dblock + * will be direct a flush dependency child both of the iblock + * that points to it, and of the fractal heap header. + * + * As a result of these changes, the functionality of these + * sanity checking routines has been modified significantly. + * Instead of scanning the fractal heap from a starting point + * down, and verifying that there were no dirty entries, the + * functions now scan downward from the starting point and + * verify that there are no dirty flush dependency children + * of the specified flush dependency parent. In passing, + * they also walk the data structure, and verify it. + * + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -2594,9 +2661,10 @@ done: */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, - hbool_t *clean) +H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, + H5HF_hdr_t *hdr, hbool_t *fd_clean, hbool_t *clean) { + hbool_t fd_exists = FALSE; /* whether flush dependency exists. */ haddr_t hdr_addr; /* Address of header */ unsigned hdr_status = 0; /* Header cache entry status */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2608,6 +2676,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, HDassert(hdr); HDassert(hdr->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); + HDassert(fd_clean); HDassert(clean); hdr_addr = hdr->cache_info.addr; HDassert(hdr_addr == hdr->heap_addr); @@ -2672,15 +2741,165 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, root_iblock_in_cache = ( (root_iblock_status & H5AC_ES__IN_CACHE) != 0); HDassert(root_iblock_in_cache || (root_iblock == NULL)); - if(!root_iblock_in_cache) /* we are done */ - *clean = TRUE; - else if(root_iblock_status & H5AC_ES__IS_DIRTY) - *clean = FALSE; + if(!root_iblock_in_cache) { /* we are done */ + *clean = TRUE; + *fd_clean = TRUE; + } /* end if */ + else if((root_iblock_status & H5AC_ES__IS_DIRTY) && + (((root_iblock_status & H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || + (!H5AC_get_serialization_in_progress(f)))) { + *clean = FALSE; + + /* verify that a flush dependency exists between the header and + * the root inode. + */ + if(H5AC_flush_dependency_exists(f, hdr->heap_addr, root_iblock_addr, &fd_exists) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") + HDassert(fd_exists); + + *fd_clean = FALSE; + } /* end else-if */ + else { /* must examine children */ + hbool_t unprotect_root_iblock = FALSE; + + /* At this point, the root iblock may be pinned, protected, + * both, or neither, and we may or may not have a pointer + * to root iblock in memory. + * + * Before we call H5HF__cache_verify_iblock_descendants_clean(), + * we must ensure that the root iblock is either pinned or + * protected or both, and that we have a pointer to it. + * Do this as follows: + */ + if(root_iblock == NULL) { /* we don't have ptr to root iblock */ + if(0 == (root_iblock_status & H5AC_ES__IS_PROTECTED)) { + /* just protect the root iblock -- this will give us + * the pointer we need to proceed, and ensure that + * it is locked into the metadata cache for the + * duration. + * + * Note that the udata is only used in the load callback. + * While the fractal heap makes heavy use of the udata + * in this case, since we know that the entry is in cache, + * we can pass NULL udata. + * + * The tag specified in the dxpl we received + * as a parameter (via dxpl_id) may not be correct. + * Grab the (hopefully) correct tag from the header, + * and load it into the dxpl via the H5_BEGIN_TAG and + * H5_END_TAG macros. Note that any error bracked by + * these macros must be reported with HGOTO_ERROR_TAG. + */ + H5_BEGIN_TAG(dxpl_id, hdr->heap_addr, FAIL) + + if(NULL == (root_iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) + HGOTO_ERROR_TAG(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") + + H5_END_TAG(FAIL) + + unprotect_root_iblock = TRUE; + } /* end if */ + else { + /* the root iblock is protected, and we have no + * legitimate way of getting a pointer to it. + * + * We square this circle by using the + * H5AC_get_entry_ptr_from_addr() to get the needed + * pointer. + * + * WARNING: This call should be used only in debugging + * routines, and it should be avoided there when + * possible. + * + * Further, if we ever multi-thread the cache, + * this routine will have to be either discarded + * or heavily re-worked. + * + * Finally, keep in mind that the entry whose + * pointer is obtained in this fashion may not + * be in a stable state. + * + * Assuming that the flush dependency code is working + * as it should, the only reason for the root iblock to + * be unpinned is if none of its children are in cache. + * This unfortunately means that if it is protected and + * not pinned, the fractal heap is in the process of loading + * or inserting one of its children. The obvious + * implication is that there is a significant chance that + * the root iblock is in an unstable state. + * + * All this suggests that using + * H5AC_get_entry_ptr_from_addr() to obtain the pointer + * to the protected root iblock is questionable here. + * However, since this is test/debugging code, I expect + * that we will use this approach until it causes problems, + * or we think of a better way. + */ + if(H5AC_get_entry_ptr_from_addr(f, root_iblock_addr, (void **)(&root_iblock)) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "H5AC_get_entry_ptr_from_addr() failed.") + HDassert(root_iblock); + } /* end else */ + } /* end if */ + else { /* root_iblock != NULL */ + /* we have the pointer to the root iblock. Protect it + * if it is neither pinned nor protected -- otherwise we + * are ready to go. + */ + H5HF_indirect_t * iblock = NULL; + + if(((root_iblock_status & H5AC_ES__IS_PINNED) == 0) && + ((root_iblock_status & H5AC_ES__IS_PROTECTED) == 0)) { + /* the root iblock is neither pinned nor protected -- hence + * we must protect it before we proceed + * + * Note that the udata is only used in the load callback. + * While the fractal heap makes heavy use of the udata + * in this case, since we know that the entry is in cache, + * we can pass NULL udata. + * + * The tag associated specified in the dxpl we received + * as a parameter (via dxpl_id) may not be correct. + * Grab the (hopefully) correct tag from the header, + * and load it into the dxpl via the H5_BEGIN_TAG and + * H5_END_TAG macros. Note that any error bracked by + * these macros must be reported with HGOTO_ERROR_TAG. + */ + H5_BEGIN_TAG(dxpl_id, hdr->heap_addr, FAIL) + + if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) + HGOTO_ERROR_TAG(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") + + H5_END_TAG(FAIL) + + unprotect_root_iblock = TRUE; + HDassert(iblock == root_iblock); + } /* end if */ + } /* end else */ + + /* at this point, one way or another, the root iblock is locked + * in memory for the duration of the call. Do some sanity checks, + * and then call H5HF__cache_verify_iblock_descendants_clean(). + */ + HDassert(root_iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(root_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + + if(H5HF__cache_verify_iblock_descendants_clean(f, dxpl_id, hdr->heap_addr, root_iblock, &root_iblock_status, fd_clean, clean) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify root iblock & descendants clean.") + + /* Unprotect the root indirect block if required */ + if(unprotect_root_iblock) { + HDassert(root_iblock); + if(H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, root_iblock, H5AC__NO_FLAGS_SET) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "H5AC_unprotect() faild.") + } /* end if */ + } /* end else */ } /* end if */ else if((hdr->man_dtable.curr_root_rows == 0) && (HADDR_UNDEF != hdr->man_dtable.table_addr)) { haddr_t root_dblock_addr; unsigned root_dblock_status = 0; + hbool_t in_cache; + hbool_t type_ok; /* this is scenario 2 -- we have a root dblock */ root_dblock_addr = hdr->man_dtable.table_addr; @@ -2688,25 +2907,48 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get root dblock status") if(root_dblock_status & H5AC_ES__IN_CACHE) { + if(H5AC_verify_entry_type(f, root_dblock_addr, &H5AC_FHEAP_DBLOCK[0], &in_cache, &type_ok) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check dblock type") + HDassert(in_cache); + if(!type_ok) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock addr doesn't refer to a dblock?!?") + /* If a root dblock is in cache, it must have a flush - * dependency relationship with the header. + * dependency relationship with the header, and it + * may not be the parent in any flush dependency + * relationship. + * + * We don't test this fully, but we will verify that + * the root iblock is a child in a flush dependency + * relationship with the header. */ - if(0 == (root_dblock_status & H5AC_ES__IS_FLUSH_DEP_CHILD)) - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock in cache and not a flush dep child.") + if(H5AC_flush_dependency_exists(f, hdr->heap_addr, root_dblock_addr, &fd_exists) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") + if(!fd_exists) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock is not a flush dep parent of header.") + if(0 != (root_dblock_status & H5AC_ES__IS_FLUSH_DEP_PARENT)) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock in cache and is a flush dep parent.") - if(root_dblock_status & H5AC_ES__IS_DIRTY) - *clean = FALSE; - } /* end if */ - else /* root dblock not in cache */ - *clean = TRUE; + *clean = !((root_dblock_status & H5AC_ES__IS_DIRTY) && + (((root_dblock_status & + H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || + (!H5AC_get_serialization_in_progress(f)))); + + *fd_clean = *clean; + } /* end if */ + else { /* root dblock not in cache */ + *fd_clean = TRUE; + *clean = TRUE; + } /* end else */ } /* end else-if */ - else - /* this is scenario 3 -- the fractal heap is empty, and we - * have nothing to do. - */ - *clean = TRUE; + else { + /* this is scenario 3 -- the fractal heap is empty, and we + * have nothing to do. + */ + *fd_clean = TRUE; + *clean = TRUE; + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -2741,6 +2983,40 @@ done: * H5HF__cache_verify_descendant_iblocks_clean() are * recursive co-routines. * + * Update -- 9/29/16 + * + * The implementation of flush dependencies has been changed. + * Prior to this change, a flush dependency parent could be + * flushed if and only if all its flush dependency decendants + * were clean. In the new definition, a flush dependency + * parent can be flushed if all its immediate flush dependency + * children are clean, regardless of any other dirty + * decendants. + * + * Further, metadata cache entries are now allowed to have + * multiple flush dependency parents. + * + * This means that the fractal heap is no longer ncessarily + * flushed from the bottom up. + * + * For example, it is now possible for a dirty fractal heap + * header to be flushed before a dirty dblock, as long as the + * there in an interviening iblock, and the header has no + * dirty immediate flush dependency children. + * + * Also, I gather that under some circumstances, a dblock + * will be direct a flush dependency child both of the iblock + * that points to it, and of the fractal heap header. + * + * As a result of these changes, the functionality of these + * sanity checking routines has been modified significantly. + * Instead of scanning the fractal heap from a starting point + * down, and verifying that there were no dirty entries, the + * functions now scan downward from the starting point and + * verify that there are no dirty flush dependency children + * of the specified flush dependency parent. In passing, + * they also walk the data structure, and verify it. + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -2750,8 +3026,9 @@ done: */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, H5HF_indirect_t *iblock, - unsigned *iblock_status, hbool_t *clean) +H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, hid_t dxpl_id, + haddr_t fd_parent_addr, H5HF_indirect_t *iblock, unsigned *iblock_status, + hbool_t * fd_clean, hbool_t *clean) { hbool_t has_dblocks = FALSE; hbool_t has_iblocks = FALSE; @@ -2761,17 +3038,19 @@ H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, H5HF_indirect_t *iblock, /* Sanity checks */ HDassert(f); + HDassert(H5F_addr_defined(fd_parent_addr)); HDassert(iblock); HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); HDassert(iblock_status); - HDassert(clean); - HDassert(*clean); + HDassert(fd_clean); + HDassert(*fd_clean); + HDassert(clean); /* note that *clean need not be TRUE */ - if((*clean) && H5HF__cache_verify_iblocks_dblocks_clean(f, iblock, clean, &has_dblocks) < 0) + if((*fd_clean) && H5HF__cache_verify_iblocks_dblocks_clean(f, fd_parent_addr, iblock, fd_clean, clean, &has_dblocks) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify dblocks clean.") - if((*clean) && H5HF__cache_verify_descendant_iblocks_clean(f, iblock, clean, &has_iblocks) < 0) + if((*fd_clean) && H5HF__cache_verify_descendant_iblocks_clean(f, dxpl_id, fd_parent_addr, iblock, fd_clean, clean, &has_iblocks) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify iblocks clean.") /* verify that flush dependency setup is plausible */ @@ -2808,6 +3087,53 @@ done: * during the call. Caller must ensure that this is * the case before the call. * + * Update -- 8/24/15 + * + * With the advent of the metadata cache image feature, it is + * possible for the pre-serialize and serialize calls to be + * invoked outside of a flush. While this serialization + * observes flush dependencies for the order of serialization, + * the entries are not written to disk, and hence dirty entries + * remain dirty. + * + * To address this, updated the sanity checks in this function + * to treat entries whose images are up to date as clean if + * a cache serialization is in progress. + * + * Update -- 9/29/16 + * + * The implementation of flush dependencies has been changed. + * Prior to this change, a flush dependency parent could be + * flushed if and only if all its flush dependency decendants + * were clean. In the new definition, a flush dependency + * parent can be flushed if all its immediate flush dependency + * children are clean, regardless of any other dirty + * decendants. + * + * Further, metadata cache entries are now allowed to have + * multiple flush dependency parents. + * + * This means that the fractal heap is no longer ncessarily + * flushed from the bottom up. + * + * For example, it is now possible for a dirty fractal heap + * header to be flushed before a dirty dblock, as long as the + * there in an interviening iblock, and the header has no + * dirty immediate flush dependency children. + * + * Also, I gather that under some circumstances, a dblock + * will be direct a flush dependency child both of the iblock + * that points to it, and of the fractal heap header. + * + * As a result of these changes, the functionality of these + * sanity checking routines has been modified significantly. + * Instead of scanning the fractal heap from a starting point + * down, and verifying that there were no dirty entries, the + * functions now scan downward from the starting point and + * verify that there are no dirty flush dependency children + * of the specified flush dependency parent. In passing, + * they also walk the data structure, and verify it. + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -2817,53 +3143,82 @@ done: */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, H5HF_indirect_t *iblock, - hbool_t *clean, hbool_t *has_dblocks) +H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, + H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, + hbool_t *has_dblocks) { unsigned num_direct_rows; unsigned max_dblock_index; unsigned i; + haddr_t iblock_addr; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); + HDassert(H5F_addr_defined(fd_parent_addr)); HDassert(iblock); HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(clean); - HDassert(*clean); + HDassert(fd_clean); + HDassert(*fd_clean); + HDassert(clean); /* note that *clean need not be true */ HDassert(has_dblocks); i = 0; num_direct_rows = MIN(iblock->nrows, iblock->hdr->man_dtable.max_direct_rows); HDassert(num_direct_rows <= iblock->nrows); max_dblock_index = (num_direct_rows * iblock->hdr->man_dtable.cparam.width) - 1; - while((*clean) && (i <= max_dblock_index)) { + iblock_addr = iblock->addr; + HDassert(H5F_addr_defined(iblock_addr)); + + while((*fd_clean) && (i <= max_dblock_index)) { haddr_t dblock_addr; dblock_addr = iblock->ents[i].addr; if(H5F_addr_defined(dblock_addr)) { - unsigned dblock_status = 0; + hbool_t in_cache; + hbool_t type_ok; + + if(H5AC_verify_entry_type(f, dblock_addr, &H5AC_FHEAP_DBLOCK[0], &in_cache, &type_ok) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check dblock type") + + if(in_cache) { /* dblock is in cache */ + hbool_t fd_exists; + unsigned dblock_status = 0; + + if(!type_ok) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "dblock addr doesn't refer to a dblock?!?") + + if(H5AC_get_entry_status(f, dblock_addr, &dblock_status) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get dblock status") + + HDassert(dblock_status & H5AC_ES__IN_CACHE); - if(H5AC_get_entry_status(f, dblock_addr, &dblock_status) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get dblock status") - if(dblock_status & H5AC_ES__IN_CACHE) { *has_dblocks = TRUE; - if(dblock_status & H5AC_ES__IS_DIRTY) + if((dblock_status & H5AC_ES__IS_DIRTY) && + (((dblock_status & H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || + (!H5AC_get_serialization_in_progress(f)))) { *clean = FALSE; + + if(H5AC_flush_dependency_exists(f, fd_parent_addr, dblock_addr, &fd_exists) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") + + if(fd_exists) + *fd_clean = FALSE; + } /* end if */ - /* If a child dblock is in cache, it must have a flush - * dependency relationship with this iblock, and it - * may not be the parent in any flush dependency - * relationship. + /* If a child dblock is in cache, it must have a flush + * dependency relationship with this iblock. Test this + * here. */ - if(0 == (dblock_status & H5AC_ES__IS_FLUSH_DEP_CHILD)) - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "dblock in cache and not a flush dep child.") - if(0 != (dblock_status & H5AC_ES__IS_FLUSH_DEP_PARENT)) - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "dblock in cache and is a flush dep parent.") + if(H5AC_flush_dependency_exists(f, iblock_addr, dblock_addr, &fd_exists) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") + + if(!fd_exists) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "dblock in cache and not a flush dep child of iblock.") } /* end if */ } /* end if */ @@ -2896,6 +3251,54 @@ done: * during the call. Caller must ensure that this is * the case before the call. * + * Update -- 8/24/15 + * + * With the advent of the metadata cache image feature, it is + * possible for the pre-serialize and serialize calls to be + * invoked outside of a flush. While this serialization + * observes flush dependencies for the order of serialization, + * the entries are not written to disk, and hence dirty entries + * remain dirty. + * + * To address this, updated the sanity checks in this function + * to treat entries whose images are up to date as clean if + * a cache serialization is in progress. + * + * Update -- 9/29/16 + * + * The implementation of flush dependencies has been changed. + * Prior to this change, a flush dependency parent could be + * flushed if and only if all its flush dependency decendants + * were clean. In the new definition, a flush dependency + * parent can be flushed if all its immediate flush dependency + * children are clean, regardless of any other dirty + * decendants. + * + * Further, metadata cache entries are now allowed to have + * multiple flush dependency parents. + * + * This means that the fractal heap is no longer ncessarily + * flushed from the bottom up. + * + * For example, it is now possible for a dirty fractal heap + * header to be flushed before a dirty dblock, as long as the + * there in an interviening iblock, and the header has no + * dirty immediate flush dependency children. + * + * Also, I gather that under some circumstances, a dblock + * will be direct a flush dependency child both of the iblock + * that points to it, and of the fractal heap header. + * + * As a result of these changes, the functionality of these + * sanity checking routines has been modified significantly. + * Instead of scanning the fractal heap from a starting point + * down, and verifying that there were no dirty entries, the + * functions now scan downward from the starting point and + * verify that there are no dirty flush dependency children + * of the specified flush dependency parent. In passing, + * they also walk the data structure, and verify it. + * + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -2905,33 +3308,38 @@ done: */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, H5HF_indirect_t *iblock, +H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_id, + haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, hbool_t *has_iblocks) { unsigned first_iblock_index; unsigned last_iblock_index; unsigned num_direct_rows; unsigned i; + haddr_t iblock_addr; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); + HDassert(H5F_addr_defined(fd_parent_addr)); HDassert(iblock); HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(clean); - HDassert(*clean); + HDassert(fd_clean); + HDassert(*fd_clean); + HDassert(clean); /* note that *clean need not be true */ HDassert(has_iblocks); num_direct_rows = MIN(iblock->nrows, iblock->hdr->man_dtable.max_direct_rows); HDassert(num_direct_rows <= iblock->nrows); + iblock_addr = iblock->addr; first_iblock_index = num_direct_rows * iblock->hdr->man_dtable.cparam.width; last_iblock_index = (iblock->nrows * iblock->hdr->man_dtable.cparam.width) - 1; i = first_iblock_index; - while((*clean) && (i <= last_iblock_index)) { + while((*fd_clean) && (i <= last_iblock_index)) { haddr_t child_iblock_addr = iblock->ents[i].addr; if(H5F_addr_defined(child_iblock_addr)) { @@ -2941,9 +3349,157 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, H5HF_indirect_t *iblock, HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get iblock status") if(child_iblock_status & H5AC_ES__IN_CACHE) { + hbool_t fd_exists; + *has_iblocks = TRUE; - if(child_iblock_status & H5AC_ES__IS_DIRTY) - *clean = FALSE; + + if((child_iblock_status & H5AC_ES__IS_DIRTY) && + (((child_iblock_status & H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || + (!H5AC_get_serialization_in_progress(f)))) { + + *clean = FALSE; + + if(H5AC_flush_dependency_exists(f, fd_parent_addr, child_iblock_addr, &fd_exists) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") + + if(fd_exists) + *fd_clean = FALSE; + } /* end if */ + + /* if the child iblock is in cache and *fd_clean is TRUE, + * we must continue to explore down the fractal heap tree + * structure to verify that all descendant blocks that are + * flush dependency children of the entry at parent_addr are + * either clean, or not in the metadata cache. We do this + * with a recursive call to + * H5HF__cache_verify_iblock_descendants_clean(). + * However, we can't make this call unless the child iblock + * is somehow locked into the cache -- typically via either + * pinning or protecting. + * + * If the child iblock is pinned, we can look up its pointer + * on the current iblock's pinned child iblock list, and + * and use that pointer in the recursive call. + * + * If the entry is unprotected and unpinned, we simply + * protect it. + * + * If, however, the the child iblock is already protected, + * but not pinned, we have a bit of a problem, as we have + * no legitimate way of looking up its pointer in memory. + * + * To solve this problem, I have added a new metadata cache + * call to obtain the pointer. + * + * WARNING: This call should be used only in debugging + * routines, and it should be avoided there when + * possible. + * + * Further, if we ever multi-thread the cache, + * this routine will have to be either discarded + * or heavily re-worked. + * + * Finally, keep in mind that the entry whose + * pointer is obtained in this fashion may not + * be in a stable state. + * + * Assuming that the flush dependency code is working + * as it should, the only reason for the child entry to + * be unpinned is if none of its children are in cache. + * This unfortunately means that if it is protected and + * not pinned, the fractal heap is in the process of loading + * or inserting one of its children. The obvious implication + * is that there is a significant chance that the child + * iblock is in an unstable state. + * + * All this suggests that using the new call to obtain the + * pointer to the protected child iblock is questionable + * here. However, since this is test/debugging code, I + * expect that we will use this approach until it causes + * problems, or we think of a better way. + */ + if(*fd_clean) { + H5HF_indirect_t *child_iblock = NULL; + hbool_t unprotect_child_iblock = FALSE; + + if(0 == (child_iblock_status & H5AC_ES__IS_PINNED)) { + /* child iblock is not pinned */ + if(0 == (child_iblock_status & H5AC_ES__IS_PROTECTED)) { + /* child iblock is unprotected, and unpinned */ + /* protect it. Note that the udata is only */ + /* used in the load callback. While the */ + /* fractal heap makes heavy use of the udata */ + /* in this case, since we know that the */ + /* entry is in cache, we can pass NULL udata */ + /* */ + /* The tag associated specified in the dxpl */ + /* we received as a parameter (via dxpl_id) */ + /* may not be correct. */ + /* */ + /* Grab the (hopefully) correct tag from the */ + /* parent iblock, and load it into the dxpl */ + /* via the H5_BEGIN_TAG and H5_END_TAG */ + /* macros. Note that any error bracked by */ + /* these macros must be reported with */ + /* HGOTO_ERROR_TAG. */ + + H5_BEGIN_TAG(dxpl_id, iblock->hdr->heap_addr, FAIL) + + if(NULL == (child_iblock = (H5HF_indirect_t *) H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, child_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) + HGOTO_ERROR_TAG(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") + + H5_END_TAG(FAIL) + + unprotect_child_iblock = TRUE; + } /* end if */ + else { + /* child iblock is protected -- use */ + /* H5AC_get_entry_ptr_from_addr() to get a */ + /* pointer to the entry. This is very slimy -- */ + /* come up with a better solution. */ + if(H5AC_get_entry_ptr_from_addr(f, child_iblock_addr, (void **)(&child_iblock)) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "H5AC_get_entry_ptr_from_addr() faild.") + HDassert(child_iblock); + } /* end else */ + } /* end if */ + else { + /* child iblock is pinned -- look it up in the */ + /* parent iblocks child_iblocks array. */ + HDassert(iblock->child_iblocks); + child_iblock = iblock->child_iblocks[i - first_iblock_index]; + } /* end else */ + + /* At this point, one way or another we should have + * a pointer to the child iblock. Verify that we + * that we have the correct one. + */ + HDassert(child_iblock); + HDassert(child_iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(child_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + HDassert(child_iblock->addr == child_iblock_addr); + + /* now make the recursive call */ + if(H5HF__cache_verify_iblock_descendants_clean(f, dxpl_id, fd_parent_addr, child_iblock, &child_iblock_status, fd_clean, clean) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify child iblock clean.") + + /* if iblock_addr != fd_parent_addr, verify that a flush + * dependency relationship exists between iblock and + * the child iblock. + */ + if(fd_parent_addr != iblock_addr) { + if(H5AC_flush_dependency_exists(f, iblock_addr, child_iblock_addr, &fd_exists) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") + + if(!fd_exists) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "iblock is not a flush dep parent of child_iblock.") + } /* end if */ + + /* if we protected the child iblock, unprotect it now */ + if(unprotect_child_iblock) { + if(H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_IBLOCK, child_iblock_addr, child_iblock, H5AC__NO_FLAGS_SET) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "H5AC_unprotect() faild.") + } /* end if */ + } /* end if */ } /* end if */ } /* end if */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 6abae65..9c1d9a6 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -559,15 +559,6 @@ typedef struct H5HF_dblock_cache_ud_t { /* Package Private Variables */ /*****************************/ -/* H5HF header inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_FHEAP_HDR[1]; - -/* H5HF indirect block inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_FHEAP_IBLOCK[1]; - -/* H5HF direct block inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_FHEAP_DBLOCK[1]; - /* The v2 B-tree class for tracking indirectly accessed 'huge' objects */ H5_DLLVAR const H5B2_class_t H5HF_HUGE_BT2_INDIR[1]; diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h index e566ece..a5c80ea 100644 --- a/src/H5HGpkg.h +++ b/src/H5HGpkg.h @@ -40,9 +40,6 @@ /* Package Private Variables */ /*****************************/ -/* The cache subclass */ -H5_DLLVAR const H5AC_class_t H5AC_GHEAP[1]; - /* Declare extern the free list to manage the H5HG_t struct */ H5FL_EXTERN(H5HG_heap_t); diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 7075b2a..06db696 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -39,12 +39,6 @@ /* Package Private Variables */ /*****************************/ -/* The local heap prefix cache subclass */ -H5_DLLVAR const H5AC_class_t H5AC_LHEAP_PRFX[1]; - -/* The local heap data block cache subclass */ -H5_DLLVAR const H5AC_class_t H5AC_LHEAP_DBLK[1]; - /* Declare extern the free list to manage the H5HL_free_t struct */ H5FL_EXTERN(H5HL_free_t); diff --git a/src/H5MF.c b/src/H5MF.c index 3ed6d28..23f128f 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -273,7 +273,7 @@ H5MF__alloc_open(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type) /* Open an existing free space structure for the file */ if(NULL == (f->shared->fs_man[type] = H5FS_open(f, dxpl_id, f->shared->fs_addr[type], NELMTS(classes), classes, f, f->shared->alignment, f->shared->threshold))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space info") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space info") /* Set the state for the free space manager to "open", if it is now */ if(f->shared->fs_man[type]) @@ -419,7 +419,7 @@ H5MF__alloc_close(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type) /* Close an existing free space structure for the file */ if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release free space info") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free space info") f->shared->fs_man[type] = NULL; f->shared->fs_state[type] = H5F_FS_STATE_CLOSED; @@ -548,7 +548,7 @@ HDfprintf(stderr, "%s: Check 2.0\n", FUNC); /* Allocate from the metadata aggregator (or the VFD) */ if(HADDR_UNDEF == (ret_value = H5MF_aggr_vfd_alloc(f, alloc_type, dxpl_id, size))) - HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from aggr/vfd") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from aggr/vfd") done: /* Reset the ring in the DXPL */ @@ -663,7 +663,7 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN /* check arguments */ HDassert(f); if(!H5F_addr_defined(addr) || 0 == size) - HGOTO_DONE(SUCCEED); + HGOTO_DONE(SUCCEED) HDassert(addr != 0); /* Can't deallocate the superblock :-) */ /* Check for attempting to free space that's a 'temporary' file address */ @@ -712,7 +712,7 @@ HDfprintf(stderr, "%s: Trying to avoid starting up free space manager\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Try to shrink the file or absorb the block into a block aggregator */ if((status = H5MF_try_shrink(f, alloc_type, dxpl_id, addr, size)) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTMERGE, FAIL, "can't check for absorbing block") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL, "can't check for absorbing block") else if(status > 0) /* Indicate success */ HGOTO_DONE(SUCCEED) @@ -1222,7 +1222,7 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) if(f->shared->fs_man[type]) { udata.alloc_type = type; if((status = H5FS_sect_try_shrink_eoa(f, dxpl_id, f->shared->fs_man[type], &udata)) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") else if(status > 0) eoa_shrank = TRUE; } /* end if */ @@ -1251,18 +1251,18 @@ done: * Purpose: Handle any tasks required before the metadata cache * can serialize or flush the raw data free space manager * and any metadata free space managers that reside in the - * raw data free space manager ring. + * raw data free space manager ring. * * Specifically, any metadata managers that DON'T handle - * space allocation for free space manager header or section - * info will reside in the raw data free space manager ring. - * As of this writing, the plan is to move to only two free space + * space allocation for free space manager header or section + * info will reside in the raw data free space manager ring. + * As of this writing, the plan is to move to only two free space * managers, one for raw data and one for metadata -- which * means that only the raw data free space manager will reside * in the free space manager ring. However, this has not been * fully implemented yet, so this code must support the * possibilty of multiple metadata free space managers, at most - * two of which handle free space manager header or section info, + * two of which handle free space manager header or section info, * and thus reside in the metadata free space manager ring. * * At present, the task list is: @@ -1271,20 +1271,20 @@ done: * * a) Free both aggregators. Space not at EOA will be * added to the appropriate free space manager. - * + * * The raw data aggregator should not be restarted * after this point. It is possible that the metadata * aggregator will be. - * + * * b) Free all file space currently allocated to free - * space managers. + * space managers. * * c) Delete the free space manager superblock * extension message if allocated. * * This done, reduce the EOA by moving it to just before * the last piece of free memory in the file. - * + * * 2) Ensure that space is allocated for the free space * manager superblock extension message. Must do this * now, before reallocating file space for free space @@ -1309,6 +1309,7 @@ done: * We will allocate space for free space managers involved * in the allocation of file space for free space managers * in H5MF_settle_meta_data_fsm() + * * Return: SUCCEED/FAIL * * Programmer: John Mainzer @@ -1348,16 +1349,16 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* a) Free the space in aggregators: * - * (for space not at EOF, it may be put into free space managers) + * (for space not at EOF, it may be put into free space managers) * - * Do this now so that the raw data FSM (and any other FSM that isn't + * Do this now so that the raw data FSM (and any other FSM that isn't * involved in space allocation for FSMs) will have no further activity. * * Note that while the raw data aggregator should not be restarted during * the close process, this need not be the case for the metadata aggregator. */ if(H5MF_free_aggrs(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't free aggregators") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free aggregators") /* Set the ring type in the DXPL. In most cases, we will * need H5AC_RING_MDFSM first, so initialy set the ring in @@ -1365,29 +1366,29 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * needed. */ if(H5AC_set_ring(dxpl_id, H5AC_RING_MDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value(0)") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value(0)") reset_ring = TRUE; curr_ring = H5AC_RING_MDFSM; /* b) Free the file space (if any) allocated to each free space manager. * - * Do this to facilitate reduction of the size of the file to the - * extent possible. We will re-allocate space to free space managers + * Do this to facilitate reduction of the size of the file to the + * extent possible. We will re-allocate space to free space managers * that have free space to save after this reduction. * * In the case of the raw data free space manager, and any other free * space manager that does not allocate space for free space managers, * allocations should be complete at this point, as all raw data should * have space allocated and be flushed to file at this point. Thus we - * can examine such free space managers and only re-allocate space for + * can examine such free space managers and only re-allocate space for * them if they contain free space. Do this later in this function after * the EOA has been reduced to the extent possible. * - * For free space managers that allocate file space for free space - * managers (usually just a single metadata free space manager, but for - * now at least, free space managers for different types of metadata + * For free space managers that allocate file space for free space + * managers (usually just a single metadata free space manager, but for + * now at least, free space managers for different types of metadata * are possible), the matter is more ticklish due to the self- - * referential nature of the problem. These FSMs are dealt with in + * referential nature of the problem. These FSMs are dealt with in * H5MF_settle_meta_data_fsm(). */ for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) { @@ -1403,8 +1404,8 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) if(!fsm_visited[fsm_type]) { fsm_visited[fsm_type] = TRUE; - /* If there is no active FSM for this type, but such a FSM has - * space allocated in file, open it so that we can free its file + /* If there is no active FSM for this type, but such a FSM has + * space allocated in file, open it so that we can free its file * space. */ if(NULL == f->shared->fs_man[fsm_type]) { @@ -1414,7 +1415,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* Start up FSM for the file memory type */ if(H5MF__alloc_open(f, dxpl_id, fsm_type) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") fsm_opened[fsm_type] = TRUE; } /* end if */ } /* end if */ @@ -1429,14 +1430,14 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) else needed_ring = H5AC_RING_RDFSM; if(needed_ring != curr_ring) { - if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring)< 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value.") + if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") curr_ring = needed_ring; } /* end if */ /* Query free space manager info for this type */ if(H5FS_stat_info(f, f->shared->fs_man[fsm_type], &fs_stat) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't get free-space info") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't get free-space info") /* Check if the free space manager has space in the file */ if(H5F_addr_defined(fs_stat.addr) || H5F_addr_defined(fs_stat.sect_addr)) { @@ -1445,7 +1446,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * any free space. */ if(H5FS_free(f, f->shared->fs_man[fsm_type], dxpl_id) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release free-space headers") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free-space headers") f->shared->fs_addr[fsm_type] = HADDR_UNDEF; } /* end if */ } /* end if */ @@ -1456,54 +1457,54 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) } /* end if */ } /* end for */ - /* c) Delete the free space manager superblock extension message + /* c) Delete the free space manager superblock extension message * if allocated. * * Must do this since the routine that writes / creates superblock - * extension messages will choke if the target message is + * extension messages will choke if the target message is * unexpectedly either absent or present. */ if(H5F_addr_defined(f->shared->sblock->ext_addr)) if(H5F_super_ext_remove_msg(f, dxpl_id, H5O_FSINFO_ID) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension") /* As the final element in 1), shrink the EOA for the file */ if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") - - /* 2) Ensure that space is allocated for the free space manager superblock - * extension message. Must do this now, before reallocating file space + + /* 2) Ensure that space is allocated for the free space manager superblock + * extension message. Must do this now, before reallocating file space * for free space managers, as it is possible that this allocation may - * grab the last section in a FSM -- making it unnecessary to + * grab the last section in a FSM -- making it unnecessary to * re-allocate file space for it. * * Do this by writing a free space manager superblock extension message. - * - * Since no free space manager has file space allocated for it, this + * + * Since no free space manager has file space allocated for it, this * message must be invalid since we can't save addresses of FSMs when * those addresses are unknown. This is OK -- we will write the correct * values to the message at free space manager shutdown. */ - for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) - fsinfo.fs_addr[type-1] = HADDR_UNDEF; + for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) + fsinfo.fs_addr[type - 1] = HADDR_UNDEF; fsinfo.strategy = f->shared->fs_strategy; fsinfo.threshold = f->shared->fs_threshold; - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, TRUE) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") + if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_NO_FLAGS_SET) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") /* 3) Scan all free space managers not involved in allocating * space for free space managers. For each such free space - * manager, test to see if it contains free space. If + * manager, test to see if it contains free space. If * it does, allocate file space for its header and section - * data. If it contains no free space, leave it without - * allocated file space as there is no need to save it to + * data. If it contains no free space, leave it without + * allocated file space as there is no need to save it to * file. * * Note that all free space managers in this class should - * see no further space allocations / deallocations as - * at this point, all raw data allocations should be + * see no further space allocations / deallocations as + * at this point, all raw data allocations should be * finalized, as should all metadata allocations not involving * free space managers. * @@ -1529,11 +1530,11 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) if(needed_ring != curr_ring) { if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring)< 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value.") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") curr_ring = needed_ring; } /* end if */ - /* Since there can be a many-to-one mapping from memory types + /* Since there can be a many-to-one mapping from memory types * to free space managers, ensure that we don't visit any FSM * more than once. */ @@ -1555,10 +1556,10 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* Query free space manager info for this type */ if(H5FS_stat_info(f, f->shared->fs_man[fsm_type], &fs_stat) < 0 ) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't get free-space info") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info") - /* If the free space manager contains section info, - * allocate space for the header and sinfo (note that + /* If the free space manager contains section info, + * allocate space for the header and sinfo (note that * space must not be allocated at present -- verify * verify this with assertions). */ @@ -1568,18 +1569,18 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* Allocate FSM header */ if(H5FS_alloc_hdr(f, f->shared->fs_man[fsm_type], &f->shared->fs_addr[fsm_type], dxpl_id) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, FAIL, "can't allocated free-space header") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocated free-space header") /* Allocate FSM section info */ HDassert(!H5F_addr_defined(fs_stat.sect_addr)); HDassert(fs_stat.alloc_sect_size == 0); if(H5FS_alloc_sect(f, f->shared->fs_man[fsm_type], dxpl_id) < 0 ) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, FAIL, "can't allocate free-space section info") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate free-space section info") #ifndef NDEBUG /* Re-Query free space manager info for this type */ if(H5FS_stat_info(f, f->shared->fs_man[fsm_type], &fs_stat) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't get free-space info") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't get free-space info") HDassert(H5F_addr_defined(fs_stat.addr)); HDassert(H5F_addr_defined(fs_stat.sect_addr)); @@ -1600,7 +1601,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* Close any opened FSMs */ if(fsm_opened[fsm_type]) { if(H5MF__alloc_close(f, dxpl_id, fsm_type) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't close file free space manager") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't close file free space manager") fsm_opened[fsm_type] = FALSE; } /* end if */ } /* end if */ @@ -1618,7 +1619,7 @@ done: /* Reset the ring in the DXPL */ if(reset_ring) if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value") + HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* H5MF_settle_raw_data_fsm() */ @@ -1761,7 +1762,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* Set the ring in the dxpl appropriately for subsequent calls */ if(H5AC_set_ring(dxpl_id, H5AC_RING_MDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") reset_ring = TRUE; #ifndef NDEBUG @@ -1769,7 +1770,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) if(hdr_fspace) { /* Query free space manager info for this type */ if(H5FS_stat_info(f, hdr_fspace, &fs_stat) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get free-space info") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info") HDassert(!H5F_addr_defined(fs_stat.addr)); HDassert(!H5F_addr_defined(fs_stat.sect_addr)); @@ -1780,7 +1781,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) if((sinfo_fspace) && (hdr_fspace != sinfo_fspace)) { /* Query free space manager info for this type */ if(H5FS_stat_info(f, sinfo_fspace, &fs_stat) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get free-space info") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info") HDassert(!H5F_addr_defined(fs_stat.addr)); HDassert(!H5F_addr_defined(fs_stat.sect_addr)); @@ -1788,32 +1789,32 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) } /* end if */ #endif /* NDEBUG */ - /* Free the space in the metadata aggregator. Do this via the + /* Free the space in the metadata aggregator. Do this via the * H5MF_free_aggrs() call. Note that the raw data aggregator must * have already been freed. Sanity checks for this? */ /* (for space not at EOF, it may be put into free space managers) */ if(H5MF_free_aggrs(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't free aggregators") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free aggregators") /* Trying shrinking the EOA for the file */ if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") /* ******************* PROBLEM: ******************** * - * If the file has an alignement other than 1, and if - * the EOA is not a multiple of this alignment, allocating sapce - * for the section via the VFD info has the potential of generating - * a fragment that will be added to the free space manager. This + * If the file has an alignement other than 1, and if + * the EOA is not a multiple of this alignment, allocating sapce + * for the section via the VFD info has the potential of generating + * a fragment that will be added to the free space manager. This * of course undoes everything we have been doing here. * - * Need a way around this. Obvious solution is to force the EOA to - * be a multiple of the alignment. + * Need a way around this. Obvious solution is to force the EOA to + * be a multiple of the alignment. * * Fortunately, alignment is typically 1, so this is a non-issue in - * most cases. In cases where the alignment is not 1, for now we - * have decided to drop the fragment on the floor. + * most cases. In cases where the alignment is not 1, for now we + * have decided to drop the fragment on the floor. * * Eventually, we should fix this by modifying the on disk representations * of free space managers to allow for empty space, so as to bypass the @@ -1823,40 +1824,40 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* HDassert(f->shared->alignment == 1); */ - /* The free space manager(s) that handle space allocations for free - * space managers should be settled now, albeit without file space + /* The free space manager(s) that handle space allocations for free + * space managers should be settled now, albeit without file space * allocated to them. To avoid the possibility of changing the sizes - * of their section info blocks, allocate space for them now at the + * of their section info blocks, allocate space for them now at the * end of file via H5FD_alloc(). * - * In the past, this issue of allocating space without touching the - * free space managers has been deal with by calling - * H5MF_aggr_vfd_alloc(), which in turn calls H5MF_aggr_alloc(). - * This is problematic since (if I read the code correctly) it will - * re-constitute the metadata aggregator, which will add any left - * over space to one of the free space managers when freed. + * In the past, this issue of allocating space without touching the + * free space managers has been deal with by calling + * H5MF_aggr_vfd_alloc(), which in turn calls H5MF_aggr_alloc(). + * This is problematic since (if I read the code correctly) it will + * re-constitute the metadata aggregator, which will add any leftover + * space to one of the free space managers when freed. * * This is a non-starter, since the entire objective is to settle the * free space managers. * - * Hence the decision to call H5FD_alloc() directly. - * - * As discussed in PROBLEM above, if f->shared->alignment is not 1, + * Hence the decision to call H5FD_alloc() directly. + * + * As discussed in PROBLEM above, if f->shared->alignment is not 1, * this has the possibility of generating a fragment of file space * that would typically be inserted into one of the free space managers. * * This is isn't good, but due to schedule pressure, we will just drop - * the fragement on the floor for now. + * the fragment on the floor for now. */ if(hdr_fspace) if(H5FS_alloc_vfd_alloc_hdr_and_section_info(f, dxpl_id, hdr_fspace, &(f->shared->fs_addr[hdr_fsm_alloc_type])) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, FAIL, "can't vfd allocate hdr FSM file space") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't vfd allocate hdr FSM file space") if(sinfo_fspace && (sinfo_fspace != hdr_fspace)) if(H5FS_alloc_vfd_alloc_hdr_and_section_info(f, dxpl_id, sinfo_fspace, &(f->shared->fs_addr[sinfo_fsm_alloc_type])) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, FAIL, "can't vfd allocate sinfo FSM file space") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't vfd allocate sinfo FSM file space") /* Indicate that the FSM was settled successfully */ *fsm_settled = TRUE; @@ -1865,7 +1866,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) done: if(reset_ring) if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value") + HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") FUNC_LEAVE_NOAPI(ret_value) } /* H5MF_settle_meta_data_fsm() */ @@ -1927,7 +1928,7 @@ HDfprintf(stderr, "%s: Check 1.0 - f->shared->fs_man[%u] = %p, f->shared->fs_add HDfprintf(stderr, "%s: Before closing free space manager\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release free space info") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free space info") f->shared->fs_man[type] = NULL; f->shared->fs_state[type] = H5F_FS_STATE_CLOSED; } /* end if */ @@ -1955,7 +1956,7 @@ HDfprintf(stderr, "%s: Before deleting free space manager\n", FUNC); /* Delete free space manager for this type */ if(H5FS_delete(f, dxpl_id, tmp_fs_addr) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't delete free space manager") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't delete free space manager") /* Shift [back] to closed state */ HDassert(f->shared->fs_state[type] == H5F_FS_STATE_DELETING); @@ -2113,7 +2114,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); fsinfo.threshold = f->shared->fs_threshold; /* Write the free space manager message -- message must already exist */ - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, FALSE) < 0) + if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") /* Final close of free-space managers */ @@ -2136,7 +2137,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); HDassert(f->shared->fs_state[type] == H5F_FS_STATE_OPEN); if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't close free space manager") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close free space manager") f->shared->fs_man[type] = NULL; f->shared->fs_state[type] = H5F_FS_STATE_CLOSED; } /* end if */ diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index 7b5a298..1510645 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -116,15 +116,15 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ /* Get the EOA for the file -- need for sanity check below */ if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, alloc_type))) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, HADDR_UNDEF, "Unable to get eoa") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, HADDR_UNDEF, "Unable to get eoa") /* Check for overlap into temporary allocation space */ if(H5F_addr_gt((eoa + size), f->shared->tmp_addr)) - HGOTO_ERROR(H5E_FSPACE, H5E_BADRANGE, HADDR_UNDEF, "hdr file space alloc will overlap into 'temporary' file space") + HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, HADDR_UNDEF, "hdr file space alloc will overlap into 'temporary' file space") /* Allocate space for the header */ if(HADDR_UNDEF == (ret_value = H5FD_alloc(f->shared->lf, dxpl_id, alloc_type, f, size, &eoa_frag_addr, &eoa_frag_size))) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space for hdr") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space for hdr") /* Sanity check for overlapping into file's temporary allocation space */ HDassert(H5F_addr_le((ret_value + size), f->shared->tmp_addr)); @@ -232,9 +232,9 @@ haddr_t H5MF_aggr_alloc(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, H5F_blk_aggr_t *other_aggr, H5FD_mem_t type, hsize_t size) { - haddr_t eoa_frag_addr = HADDR_UNDEF; /* Address of fragment at EOA */ - hsize_t eoa_frag_size = 0; /* Size of fragment at EOA */ - haddr_t eoa = HADDR_UNDEF; /* Initial EOA for the file */ + haddr_t eoa_frag_addr = HADDR_UNDEF; /* Address of fragment at EOA */ + hsize_t eoa_frag_size = 0; /* Size of fragment at EOA */ + haddr_t eoa = HADDR_UNDEF; /* Initial EOA for the file */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI(HADDR_UNDEF) @@ -543,7 +543,8 @@ H5MF_aggr_try_extend(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, } /* end else-if */ } /* end else */ } /* end if */ - else { /* The aggreator is not at end of file */ + else { + /* The aggreator is not at end of file */ /* Check if aggregator has enough internal space to satisfy the extension. */ if(aggr->size >= extra_requested) { /* Extend block into aggregator */ diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index 330fe80..e258677 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -51,15 +51,13 @@ /* File space manager routines */ H5_DLL herr_t H5MF_init_merge_flags(H5F_t *f); -H5_DLL herr_t H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, - hsize_t *meta_size); +H5_DLL herr_t H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_size); H5_DLL herr_t H5MF_close(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5MF_try_close(H5F_t *f, hid_t dxpl_id); /* File space allocation routines */ H5_DLL haddr_t H5MF_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); -H5_DLL haddr_t H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, - hsize_t size); +H5_DLL haddr_t H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); H5_DLL haddr_t H5MF_vfd_alloc(H5F_t *f, hid_t dxpl_id, H5FD_mem_t alloc_type, hsize_t size, hbool_t keep_fragment); H5_DLL herr_t H5MF_xfree(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, @@ -78,7 +76,7 @@ H5_DLL haddr_t H5MF_alloc_tmp(H5F_t *f, hsize_t size); H5_DLL herr_t H5MF_free_aggrs(H5F_t *f, hid_t dxpl_id); H5_DLL htri_t H5MF_aggrs_try_shrink_eoa(H5F_t *f, hid_t dxpl_id); -/* Settling routines */ +/* Free space manager settling routines */ H5_DLL herr_t H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled); H5_DLL herr_t H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled); diff --git a/src/H5O.c b/src/H5O.c index e0c0f0b..1b58703 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -130,11 +130,12 @@ const H5O_msg_class_t *const H5O_msg_class_g[] = { H5O_MSG_AINFO, /*0x0015 Attribute information */ H5O_MSG_REFCOUNT, /*0x0016 Object's ref. count */ H5O_MSG_FSINFO, /*0x0017 Free-space manager info */ - H5O_MSG_UNKNOWN, /*0x0018 Placeholder for unknown message */ + H5O_MSG_MDCI, /*0x0018 Metadata cache image */ + H5O_MSG_UNKNOWN, /*0x0019 Placeholder for unknown message */ #ifdef H5O_ENABLE_BOGUS - H5O_MSG_BOGUS_INVALID, /*0x0019 "Bogus invalid" (for testing) */ + H5O_MSG_BOGUS_INVALID, /*0x001A "Bogus invalid" (for testing) */ #else /* H5O_ENABLE_BOGUS */ - NULL, /*0x0019 "Bogus invalid" (for testing) */ + NULL, /*0x001A "Bogus invalid" (for testing) */ #endif /* H5O_ENABLE_BOGUS */ }; diff --git a/src/H5Opkg.h b/src/H5Opkg.h index ef49535..e1fa0be 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -31,7 +31,7 @@ #define H5O_NMESGS 8 /*initial number of messages */ #define H5O_NCHUNKS 2 /*initial number of chunks */ #define H5O_MIN_SIZE 22 /* Min. obj header data size (must be big enough for a message prefix and a continuation message) */ -#define H5O_MSG_TYPES 26 /* # of types of messages */ +#define H5O_MSG_TYPES 27 /* # of types of messages */ #define H5O_MAX_CRT_ORDER_IDX 65535 /* Max. creation order index value */ /* Versions of object header structure */ @@ -419,12 +419,6 @@ typedef struct H5O_chk_cache_ud_t { } H5O_chk_cache_ud_t; -/* H5O object header inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_OHDR[1]; - -/* H5O object header chunk inherits cache-like properties from H5AC */ -H5_DLLVAR const H5AC_class_t H5AC_OHDR_CHK[1]; - /* Header message ID to class mapping */ H5_DLLVAR const H5O_msg_class_t *const H5O_msg_class_g[H5O_MSG_TYPES]; @@ -544,7 +538,10 @@ H5_DLLVAR const H5O_msg_class_t H5O_MSG_REFCOUNT[1]; /* Free-space Manager Info message. (0x0017) */ H5_DLLVAR const H5O_msg_class_t H5O_MSG_FSINFO[1]; -/* Placeholder for unknown message. (0x0018) */ +/* Metadata Cache Image message. (0x0018) */ +H5_DLLVAR const H5O_msg_class_t H5O_MSG_MDCI[1]; + +/* Placeholder for unknown message. (0x0019) */ H5_DLLVAR const H5O_msg_class_t H5O_MSG_UNKNOWN[1]; diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index f6df874..71c512c 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -69,6 +69,7 @@ typedef struct H5O_t H5O_t; #define H5O_FIRST (-2) /* Operate on first message of type */ /* Flags needed when encoding messages */ +#define H5O_MSG_NO_FLAGS_SET 0x00u #define H5O_MSG_FLAG_CONSTANT 0x01u #define H5O_MSG_FLAG_SHARED 0x02u #define H5O_MSG_FLAG_DONTSHARE 0x04u @@ -204,7 +205,8 @@ typedef struct H5O_copy_t { #define H5O_AINFO_ID 0x0015 /* Attribute info message. */ #define H5O_REFCOUNT_ID 0x0016 /* Reference count message. */ #define H5O_FSINFO_ID 0x0017 /* File space info message. */ -#define H5O_UNKNOWN_ID 0x0018 /* Placeholder message ID for unknown message. */ +#define H5O_MDCI_MSG_ID 0x0018 /* Metadata Cache Image Message */ +#define H5O_UNKNOWN_ID 0x0019 /* Placeholder message ID for unknown message. */ /* (this should never exist in a file) */ /* * Note: Must increment H5O_MSG_TYPES in H5Opkg.h and update H5O_msg_class_g @@ -214,7 +216,7 @@ typedef struct H5O_copy_t { * * (this should never exist in a file) */ -#define H5O_BOGUS_INVALID_ID 0x0019 /* "Bogus invalid" Message. */ +#define H5O_BOGUS_INVALID_ID 0x001A /* "Bogus invalid" Message. */ /* Shared object message types. * Shared objects can be committed, in which case the shared message contains @@ -794,6 +796,16 @@ typedef struct H5O_fsinfo_t { haddr_t fs_addr[H5FD_MEM_NTYPES-1]; /* Addresses of free space managers */ } H5O_fsinfo_t; +/* + * Metadata Cache Image Message. + * Contains base address and length of the metadata cache image. + * (Data structure in memory) + */ +typedef struct H5O_mdci_t { + haddr_t addr; /* address of MDC image block */ + hsize_t size; /* size of MDC image block */ +} H5O_mdci_t; + /* Typedef for "application" iteration operations */ typedef herr_t (*H5O_operator_t)(const void *mesg/*in*/, unsigned idx, void *operator_data/*in,out*/); diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 91a0e03..7ea0fe0 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -225,6 +225,13 @@ #define H5F_ACS_COLL_MD_WRITE_FLAG_ENC H5P__encode_hbool_t #define H5F_ACS_COLL_MD_WRITE_FLAG_DEC H5P__decode_hbool_t #endif /* H5_HAVE_PARALLEL */ +/* Definitions for the initial metadata cache image configuration */ +#define H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE sizeof(H5AC_cache_image_config_t) +#define H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEF H5AC__DEFAULT_CACHE_IMAGE_CONFIG +#define H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_ENC H5P__facc_cache_image_config_enc +#define H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEC H5P__facc_cache_image_config_dec +#define H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_CMP H5P__facc_cache_image_config_cmp + /******************/ /* Local Typedefs */ @@ -279,6 +286,11 @@ static herr_t H5P_facc_mdc_log_location_copy(const char *name, size_t size, void static int H5P_facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t size); static herr_t H5P_facc_mdc_log_location_close(const char *name, size_t size, void *value); +/* Metadata cache image property callbacks */ +static int H5P__facc_cache_image_config_cmp(const void *_config1, const void *_config2, size_t H5_ATTR_UNUSED size); +static herr_t H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size); +static herr_t H5P__facc_cache_image_config_dec(const void **_pp, void *_value); + /*********************/ /* Package Variables */ @@ -346,6 +358,7 @@ static const hbool_t H5F_def_evict_on_close_flag_g = H5F_ACS_EVICT_ON_CLOSE_FLAG static const H5P_coll_md_read_flag_t H5F_def_coll_md_read_flag_g = H5F_ACS_COLL_MD_READ_FLAG_DEF; /* Default setting for the collective metedata read flag */ static const hbool_t H5F_def_coll_md_write_flag_g = H5F_ACS_COLL_MD_WRITE_FLAG_DEF; /* Default setting for the collective metedata write flag */ #endif /* H5_HAVE_PARALLEL */ +static const H5AC_cache_image_config_t H5F_def_mdc_initCacheImageCfg_g = H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEF; /* Default metadata cache image settings */ /*------------------------------------------------------------------------- @@ -555,6 +568,12 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #endif /* H5_HAVE_PARALLEL */ + /* Register the initial metadata cache image configuration */ + if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE, &H5F_def_mdc_initCacheImageCfg_g, + NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEC, + NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_CMP, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_reg_prop() */ @@ -1543,6 +1562,101 @@ done: /*------------------------------------------------------------------------- + * Function: H5Pset_mdc_image_config + * + * Purpose: Set the initial metadata cache image configuration in the + * target FAPL. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: J. Mainzer + * Thursday, June 25, 2015 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*x", plist_id, config_ptr); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* validate the new configuration */ + if(H5AC_validate_cache_image_config(config_ptr) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid metadata cache image configuration") + + /* set the modified metadata cache image config */ + + /* If we ever support multiple versions of H5AC_cache_image_config_t, we + * will have to test the version and do translation here. + */ + + if(H5P_set(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, config_ptr) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set metadata cache image initial config") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Pset_mdc_image_config() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_mdc_image_config + * + * Purpose: Retrieve the metadata cache initial image configuration + * from the target FAPL. + * + * Observe that the function will fail if config_ptr is + * NULL, or if config_ptr->version specifies an unknown + * version of H5AC_cache_image_config_t. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: J. Mainzer + * Friday, June 26, 2015 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*x", plist_id, config_ptr); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* validate the config_ptr */ + if(config_ptr == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.") + + if(config_ptr->version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown image config version.") + + /* If we ever support multiple versions of H5AC_cache_config_t, we + * will have to get the cannonical version here, and then translate + * to the version of the structure supplied. + */ + + /* Get the current initial metadata cache resize configuration */ + if(H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, config_ptr) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, "can't get metadata cache initial image config") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Pget_mdc_image_config() */ + + +/*------------------------------------------------------------------------- * Function: H5Pset_mdc_config * * Purpose: Set the initial metadata cache resize configuration in the @@ -2754,6 +2868,147 @@ done: /*------------------------------------------------------------------------- + * Function: H5P__facc_cache_image_config_cmp + * + * Purpose: Compare two cache image configurations. + * + * Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is + * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. + * + * Programmer: John Mainzer + * June 26, 2015 + * + *------------------------------------------------------------------------- + */ +static int +H5P__facc_cache_image_config_cmp(const void *_config1, const void *_config2, size_t H5_ATTR_UNUSED size) +{ + const H5AC_cache_image_config_t *config1 = (const H5AC_cache_image_config_t *)_config1; /* Create local aliases for values */ + const H5AC_cache_image_config_t *config2 = (const H5AC_cache_image_config_t *)_config2; /* Create local aliases for values */ + int ret_value = 0; /* Return value */ + + FUNC_ENTER_STATIC_NOERR + + /* Check for a property being set */ + if(config1 == NULL && config2 != NULL) HGOTO_DONE(-1); + if(config1 != NULL && config2 == NULL) HGOTO_DONE(1); + + if(config1->version < config2->version) HGOTO_DONE(-1); + if(config1->version > config2->version) HGOTO_DONE(1); + + if(config1->generate_image < config2->generate_image) HGOTO_DONE(-1); + if(config1->generate_image > config2->generate_image) HGOTO_DONE(1); + + if(config1->save_resize_status < config2->save_resize_status) HGOTO_DONE(-1); + if(config1->save_resize_status > config2->save_resize_status) HGOTO_DONE(1); + + if(config1->entry_ageout < config2->entry_ageout) HGOTO_DONE(-1); + if(config1->entry_ageout > config2->entry_ageout) HGOTO_DONE(1); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__facc_cache_image_config_cmp() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__facc_cache_image_config_enc + * + * Purpose: Callback routine which is called whenever the default + * cache image config property in the file creation + * property list is encoded. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: John Mainzer + * June 26, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) +{ + const H5AC_cache_image_config_t *config = (const H5AC_cache_image_config_t *)value; /* Create local aliases for value */ + uint8_t **pp = (uint8_t **)_pp; + + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(value); + + if(NULL != *pp) { + /* Encode type sizes (as a safety check) */ + *(*pp)++ = (uint8_t)sizeof(unsigned); + + INT32ENCODE(*pp, (int32_t)config->version); + + H5_ENCODE_UNSIGNED(*pp, config->generate_image); + + H5_ENCODE_UNSIGNED(*pp, config->save_resize_status); + + INT32ENCODE(*pp, (int32_t)config->entry_ageout); + } /* end if */ + + /* Compute encoded size of fixed-size values */ + *size += (1 + (2 * sizeof(unsigned)) + (2 * sizeof(int32_t))); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5P__facc_cache_image_config_enc() */ + + +/*------------------------------------------------------------------------- + * Function: H5P__facc_cache_image_config_dec + * + * Purpose: Callback routine which is called whenever the default + * cache image config property in the file creation property + * list is decoded. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: John Mainzer + * June 26, 2015 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5P__facc_cache_image_config_dec(const void **_pp, void *_value) +{ + H5AC_cache_image_config_t *config = (H5AC_cache_image_config_t *)_value; + const uint8_t **pp = (const uint8_t **)_pp; + unsigned enc_size; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity checks */ + HDassert(pp); + HDassert(*pp); + HDassert(config); + HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); + + /* Set property to default value */ + HDmemcpy(config, &H5F_def_mdc_initCacheImageCfg_g, sizeof(H5AC_cache_image_config_t)); + + /* Decode type sizes */ + enc_size = *(*pp)++; + if(enc_size != sizeof(unsigned)) + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unsigned value can't be decoded") + + INT32DECODE(*pp, config->version); + + H5_DECODE_UNSIGNED(*pp, config->generate_image); + + H5_DECODE_UNSIGNED(*pp, config->save_resize_status); + + INT32DECODE(*pp, config->entry_ageout); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P__facc_cache_image_config_dec() */ + + +/*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_set * * Purpose: Copies a file image property when it's set for a property list diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index c736d7b..5aa8301 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -365,6 +365,8 @@ H5_DLL herr_t H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collectiv H5_DLL herr_t H5Pset_coll_metadata_write(hid_t plist_id, hbool_t is_collective); H5_DLL herr_t H5Pget_coll_metadata_write(hid_t plist_id, hbool_t *is_collective); #endif /* H5_HAVE_PARALLEL */ +H5_DLL herr_t H5Pset_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr); +H5_DLL herr_t H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr /*out*/); /* Dataset creation property list (DCPL) routines */ H5_DLL herr_t H5Pset_layout(hid_t plist_id, H5D_layout_t layout); diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index 3b13e23..342543d 100644 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -256,8 +256,6 @@ H5FL_ARR_EXTERN(H5SM_index_header_t); H5FL_EXTERN(H5SM_list_t); H5FL_ARR_EXTERN(H5SM_sohm_t); -H5_DLLVAR const H5AC_class_t H5AC_SOHM_TABLE[1]; -H5_DLLVAR const H5AC_class_t H5AC_SOHM_LIST[1]; H5_DLLVAR const H5B2_class_t H5SM_INDEX[1]; /****************************/ diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 63c3a16..b419f06 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -75,8 +75,8 @@ struct timezone { #if (_MSC_VER < 1900) struct timespec { - time_t tv_sec; // Seconds - >= 0 - long tv_nsec; // Nanoseconds - [0, 999999999] + time_t tv_sec; /* Seconds - >= 0 */ + long tv_nsec; /* Nanoseconds - [0, 999999999] */ }; #endif /* MSC_VER < 1900 */ diff --git a/src/Makefile.am b/src/Makefile.am index 939e151..69b54b4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -46,7 +46,8 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5B.c H5Bcache.c H5Bdbg.c \ H5B2.c H5B2cache.c H5B2dbg.c H5B2hdr.c H5B2int.c H5B2internal.c \ H5B2leaf.c H5B2stat.c H5B2test.c \ - H5C.c H5Cdbg.c H5Cepoch.c H5Clog.c H5Cquery.c H5Ctag.c H5Ctest.c \ + H5C.c H5Cdbg.c H5Cepoch.c H5Cimage.c H5Clog.c H5Cprefetched.c \ + H5Cquery.c H5Ctag.c H5Ctest.c \ H5CS.c \ H5D.c H5Dbtree.c H5Dbtree2.c H5Dchunk.c H5Dcompact.c H5Dcontig.c H5Ddbg.c \ H5Ddeprec.c H5Dearray.c H5Defl.c H5Dfarray.c H5Dfill.c H5Dint.c \ @@ -81,7 +82,8 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5MF.c H5MFaggr.c H5MFdbg.c H5MFsection.c \ H5MM.c H5MP.c H5MPtest.c \ H5O.c H5Oainfo.c H5Oalloc.c H5Oattr.c \ - H5Oattribute.c H5Obogus.c H5Obtreek.c H5Ocache.c H5Ochunk.c \ + H5Oattribute.c H5Obogus.c H5Obtreek.c H5Ocache.c H5Ocache_image.c \ + H5Ochunk.c \ H5Ocont.c H5Ocopy.c H5Odbg.c H5Odrvinfo.c H5Odtype.c H5Oefl.c \ H5Ofill.c H5Oflush.c H5Ofsinfo.c H5Oginfo.c \ H5Olayout.c \ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8891af7..9657971 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- @@ -20,21 +20,23 @@ set (TEST_LIB_SOURCES ${HDF5_TEST_SOURCE_DIR}/h5test.c ${HDF5_TEST_SOURCE_DIR}/testframe.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c + ${HDF5_TEST_SOURCE_DIR}/swmr_common.c ) set (TEST_LIB_HEADERS ${HDF5_TEST_SOURCE_DIR}/h5test.h ${HDF5_TEST_SOURCE_DIR}/cache_common.h + ${HDF5_TEST_SOURCE_DIR}/swmr_common.h ) add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") -endif (MSVC) +endif () if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") -endif (MINGW) +endif () target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES @@ -47,10 +49,10 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "ws2_32.lib") - endif (MSVC) + endif () if (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib") - endif (MINGW) + endif () target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES @@ -64,8 +66,8 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - endif (HDF5_ENABLE_THREADSAFE) -endif (BUILD_SHARED_LIBS) + endif () +endif () #----------------------------------------------------------------------------- # If plugin library tests can be tested @@ -110,7 +112,7 @@ endif (BUILD_SHARED_LIBS) "$" "${CMAKE_BINARY_DIR}/testdir1/$" ) - endforeach (test_lib ${TEST_PLUGIN_LIBS}) + endforeach () foreach (test_lib ${TEST2_PLUGIN_LIBS}) set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") @@ -136,7 +138,7 @@ endif (BUILD_SHARED_LIBS) "$" "${CMAKE_BINARY_DIR}/testdir2/$" ) - endforeach (test_lib ${TEST2_PLUGIN_LIBS}) + endforeach () set (testhdf5_SOURCES ${HDF5_TEST_SOURCE_DIR}/testhdf5.c @@ -178,7 +180,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") target_link_libraries (testhdf5-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (testhdf5-shared PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () MACRO (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) @@ -192,8 +194,8 @@ MACRO (ADD_H5_EXE file) TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") target_link_libraries (${file}-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (${file}-shared PROPERTIES FOLDER test) - endif (BUILD_SHARED_LIBS) -ENDMACRO (ADD_H5_EXE file) + endif () +ENDMACRO () set (H5_TESTS cache @@ -223,6 +225,7 @@ set (H5_TESTS objcopy links unlink + twriteorder big mtime fillval @@ -253,15 +256,34 @@ set (H5_TESTS foreach (test ${H5_TESTS}) ADD_H5_EXE(${test}) -endforeach (test ${H5_TESTS}) +endforeach () set (H5_SWMR_TESTS + swmr_addrem_writer swmr_check_compat_vfd + swmr_generator + swmr_reader + swmr_remove_reader + swmr_remove_writer + swmr_sparse_reader + swmr_sparse_writer + swmr_start_write + swmr_writer ) foreach (test ${H5_SWMR_TESTS}) ADD_H5_EXE(${test}) -endforeach (test ${H5_SWMR_TESTS}) +endforeach () + +set (H5_VDS_SWMR_TESTS + vds_swmr_gen + vds_swmr_reader + vds_swmr_writer +) + +foreach (test ${H5_VDS_SWMR_TESTS}) + ADD_H5_EXE(${test}) +endforeach () ############################################################################## ############################################################################## @@ -269,6 +291,26 @@ endforeach (test ${H5_SWMR_TESTS}) ############################################################################## ############################################################################## +#-- Adding test for cache_image +add_executable (cache_image + ${HDF5_TEST_SOURCE_DIR}/cache_image.c + ${HDF5_TEST_SOURCE_DIR}/genall5.c +) +TARGET_NAMING (cache_image STATIC) +TARGET_C_PROPERTIES (cache_image STATIC " " " ") +target_link_libraries (cache_image ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (cache_image PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (cache_image-shared + ${HDF5_TEST_SOURCE_DIR}/cache_image.c + ${HDF5_TEST_SOURCE_DIR}/genall5.c + ) + TARGET_NAMING (cache_image-shared SHARED) + TARGET_C_PROPERTIES (cache_image-shared SHARED " " " ") + target_link_libraries (cache_image-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (cache_image-shared PROPERTIES FOLDER test) +endif () + #-- Adding test for hyperslab add_executable (hyperslab ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) TARGET_NAMING (hyperslab STATIC) @@ -286,8 +328,8 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - endif (HDF5_ENABLE_THREADSAFE) -endif (BUILD_SHARED_LIBS) + endif () +endif () #-- Adding test for ttsafe add_executable (ttsafe @@ -318,21 +360,23 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - endif (HDF5_ENABLE_THREADSAFE) -endif (BUILD_SHARED_LIBS) + endif () +endif () set (H5_CHECK_TESTS error_test err_compat tcheck_version testmeta + atomic_writer + atomic_reader links_env flushrefresh ) foreach (test ${H5_CHECK_TESTS}) ADD_H5_EXE(${test}) -endforeach (test ${H5_CHECK_TESTS}) +endforeach () #-- Adding test for accum_swmr_reader # This has to be copied to the test directory for execve() to find it @@ -347,7 +391,7 @@ set_target_properties (accum_swmr_reader PROPERTIES FOLDER test) set_target_properties (accum PROPERTIES DEPENDS accum_swmr_reader) if (BUILD_SHARED_LIBS) set_target_properties (accum-shared PROPERTIES DEPENDS accum_swmr_reader) -endif (BUILD_SHARED_LIBS) +endif () #-- Adding test for libinfo set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) @@ -355,9 +399,9 @@ file (WRITE ${GREP_RUNNER} "file (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") if (\${TEST_RESULT} STREQUAL \"0\") message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") -else (\${TEST_RESULT} STREQUAL \"0\") +else () message (STATUS \"COMMAND Result: \${TEST_RESULT}\") -endif (\${TEST_RESULT} STREQUAL \"0\") +endif () " ) @@ -370,12 +414,57 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (plugin SHARED " " " ") target_link_libraries (plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (plugin PROPERTIES FOLDER test) -else (BUILD_SHARED_LIBS) +else () add_executable (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) TARGET_NAMING (plugin STATIC) TARGET_C_PROPERTIES (plugin STATIC " " " ") target_link_libraries (plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (plugin PROPERTIES FOLDER test) -endif (BUILD_SHARED_LIBS) +endif () + +############################################################################## +### U S E C A S E S T E S T S +############################################################################## +set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) +add_executable (use_append_chunk ${use_append_chunk_SOURCES}) +TARGET_NAMING (use_append_chunk STATIC) +TARGET_C_PROPERTIES (use_append_chunk STATIC " " " ") +target_link_libraries (use_append_chunk ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (use_append_chunk PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (use_append_chunk-shared ${use_append_chunk_SOURCES}) + TARGET_NAMING (use_append_chunk-shared SHARED) + TARGET_C_PROPERTIES (use_append_chunk-shared SHARED " " " ") + target_link_libraries (use_append_chunk-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (use_append_chunk-shared PROPERTIES FOLDER test) +endif () + +set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) +add_executable (use_append_mchunks ${use_append_mchunks_SOURCES}) +TARGET_NAMING (use_append_mchunks STATIC) +TARGET_C_PROPERTIES (use_append_mchunks STATIC " " " ") +target_link_libraries (use_append_mchunks ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (use_append_mchunks PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (use_append_mchunks-shared ${use_append_mchunks_SOURCES}) + TARGET_NAMING (use_append_mchunks-shared SHARED) + TARGET_C_PROPERTIES (use_append_mchunks-shared SHARED " " " ") + target_link_libraries (use_append_mchunks-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (use_append_mchunks-shared PROPERTIES FOLDER test) +endif () + +set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c) +add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES}) +TARGET_NAMING (use_disable_mdc_flushes STATIC) +TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC " " " ") +target_link_libraries (use_disable_mdc_flushes ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (use_disable_mdc_flushes-shared ${use_disable_mdc_flushes_SOURCES}) + TARGET_NAMING (use_disable_mdc_flushes-shared SHARED) + TARGET_C_PROPERTIES (use_disable_mdc_flushes-shared SHARED " " " ") + target_link_libraries (use_disable_mdc_flushes-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (use_disable_mdc_flushes-shared PROPERTIES FOLDER test) +endif () include (CMakeTests.cmake) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 5b3d0bf..fc8587b 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -13,7 +13,7 @@ if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files") -endif (BUILD_SHARED_LIBS) +endif () if (HDF5_TEST_VFD) set (VFD_LIST @@ -27,14 +27,14 @@ if (HDF5_TEST_VFD) ) if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) - endif (DIRECT_VFD) + endif () foreach (vfdtest ${VFD_LIST}) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") #if (BUILD_SHARED_LIBS) # file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared") - #endif (BUILD_SHARED_LIBS) - endforeach (vfdtest ${VFD_LIST}) -endif (HDF5_TEST_VFD) + #endif () + endforeach () +endif () # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory @@ -56,24 +56,24 @@ if (BUILD_SHARED_LIBS) COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "$" "${PROJECT_BINARY_DIR}/H5TEST-shared/accum_swmr_reader" ) -endif (BUILD_SHARED_LIBS) +endif () foreach (h5_tfile ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST/${h5_tfile}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) -endforeach (h5_tfile ${HDF5_TEST_FILES}) + endif () +endforeach () if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (h5_tfile ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) - endforeach (h5_tfile ${HDF5_TEST_FILES}) - endforeach (vfdtest ${VFD_LIST}) -endif (HDF5_TEST_VFD) + endif () + endforeach () + endforeach () +endif () # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory @@ -90,18 +90,18 @@ foreach (ref_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST/${ref_file}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${ref_file}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) -endforeach (ref_file ${HDF5_REFERENCE_FILES}) + endif () +endforeach () if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (ref_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}/${ref_file}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${ref_file}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) - endforeach (ref_file ${HDF5_REFERENCE_FILES}) - endforeach (vfdtest ${VFD_LIST}) -endif (HDF5_TEST_VFD) + endif () + endforeach () + endforeach () +endif () # -------------------------------------------------------------------- # Copy test files from test/testfiles/plist_files dir to test dir @@ -163,8 +163,8 @@ foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files/${plistfile}" "HDF5_TEST_LIBSH_files") HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files/def_${plistfile}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) -endforeach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) + endif () +endforeach () # -------------------------------------------------------------------- #-- Copy all the HDF5 files from the test directory into the source directory @@ -212,22 +212,22 @@ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST/${h5_file}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST-shared/${h5_file}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) -endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endif () +endforeach () if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}/${h5_file}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}-shared/${h5_file}" "HDF5_TEST_LIBSH_files") - endif (BUILD_SHARED_LIBS) - endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) - endforeach (vfdtest ${VFD_LIST}) -endif (HDF5_TEST_VFD) + endif () + endforeach () + endforeach () +endif () add_custom_target(HDF5_TEST_LIB_files ALL COMMENT "Copying files needed by HDF5_TEST_LIB tests" DEPENDS ${HDF5_TEST_LIB_files_list}) if (BUILD_SHARED_LIBS) add_custom_target(HDF5_TEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_TEST_LIBSH tests" DEPENDS ${HDF5_TEST_LIBSH_files_list}) -endif() +endif () # Remove any output file left over from previous test run add_test (NAME H5TEST-clear-testhdf5-objects @@ -279,8 +279,17 @@ if (HDF5_ENABLE_USING_MEMCHECKER) ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -else (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-testhdf5 COMMAND $) +else () + add_test (NAME H5TEST-testhdf5 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=testhdf5.txt" + #-D "TEST_REFERENCE=testhdf5.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) set_tests_properties (H5TEST-testhdf5 PROPERTIES DEPENDS H5TEST-clear-testhdf5-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" @@ -310,14 +319,23 @@ else (HDF5_ENABLE_USING_MEMCHECKER) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - add_test (NAME H5TEST-shared-testhdf5 COMMAND $) + add_test (NAME H5TEST-shared-testhdf5 COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=testhdf5.txt" + #-D "TEST_REFERENCE=testhdf5.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) set_tests_properties (H5TEST-shared-testhdf5 PROPERTIES DEPENDS H5TEST-shared-clear-testhdf5-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - endif (BUILD_SHARED_LIBS) -endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () +endif () ############################################################################## ############################################################################## @@ -346,6 +364,10 @@ set (test_CLEANFILES layout_extend.h5 zero_chunk.h5 chunk_single.h5 + swmr_non_latest.h5 + earray_hdr_fd.h5 + farray_hdr_fd.h5 + bt2_hdr_fd.h5 storage_size.h5 dls_01_strings.h5 extend.h5 @@ -439,6 +461,7 @@ set (test_CLEANFILES tvltypes.h5 tvlstr.h5 tvlstr2.h5 + twriteorder.dat flush.h5 flush-swmr.h5 noflush.h5 @@ -514,16 +537,24 @@ set (test_CLEANFILES vds_dapl.h5 vds_src_0.h5 vds_src_1.h5 + swmr_data.h5 + use_use_append_chunk.h5 + use_append_mchunks.h5 + use_disable_mdc_flushes.h5 tbogus.h5.copy flushrefresh.h5 flushrefresh_VERIFICATION_START flushrefresh_VERIFICATION_CHECKPOINT1 flushrefresh_VERIFICATION_CHECKPOINT2 flushrefresh_VERIFICATION_DONE + atomic_data accum_swmr_big.h5 ohdr_swmr.h5 + test_swmr*.h5 cache_logging.h5 cache_logging.out + vds_swmr.h5 + vds_swmr_src_*.h5 ) # Remove any output file left over from previous test run @@ -565,6 +596,7 @@ set (H5TEST_TESTS objcopy links unlink + twriteorder big mtime fillval @@ -595,19 +627,37 @@ set (H5TEST_TESTS ) foreach (test ${H5TEST_TESTS}) - if (${test} STREQUAL "big" AND CYGWIN) - add_test (NAME H5TEST-${test} - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" - ) - else (${test} STREQUAL "big" AND CYGWIN) + if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5TEST-${test} COMMAND $) - endif (${test} STREQUAL "big" AND CYGWIN) - set_tests_properties (H5TEST-${test} PROPERTIES - DEPENDS H5TEST-clear-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST - ) -endforeach (test ${H5TEST_TESTS}) + set_tests_properties (H5TEST-${test} PROPERTIES + DEPENDS H5TEST-clear-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + ) + else () + if (${test} STREQUAL "big" AND CYGWIN) + add_test (NAME H5TEST-${test} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" + ) + else () + add_test (NAME H5TEST-${test} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${test}.txt" + #-D "TEST_REFERENCE=${test}.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (H5TEST-${test} PROPERTIES + DEPENDS H5TEST-clear-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + ) + endif () +endforeach () set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1) set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT 1800) @@ -630,22 +680,31 @@ if (BUILD_SHARED_LIBS) add_test (NAME H5TEST-shared-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" ) - else (${test} STREQUAL "big" AND CYGWIN) - add_test (NAME H5TEST-shared-${test} COMMAND $) - endif (${test} STREQUAL "big" AND CYGWIN) + else () + add_test (NAME H5TEST-shared-${test} COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${test}.txt" + #-D "TEST_REFERENCE=${test}.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5TEST-shared-${test} PROPERTIES DEPENDS H5TEST-shared-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - endforeach (test ${H5TEST_TESTS}) + endforeach () set_tests_properties (H5TEST-shared-flush2 PROPERTIES DEPENDS H5TEST-shared-flush1) set_tests_properties (H5TEST-shared-fheap PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-big PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-btree2 PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-objcopy PROPERTIES TIMEOUT 1800) -endif (BUILD_SHARED_LIBS) +endif () ############################################################################## ############################################################################## @@ -662,14 +721,43 @@ if (NOT CYGWIN) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - add_test (NAME H5TEST-cache COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5TEST-cache COMMAND $) + else () + add_test (NAME H5TEST-cache COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cache.txt" + #-D "TEST_REFERENCE=cache.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5TEST-cache PROPERTIES DEPENDS H5TEST-clear-cache-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 1800) -endif (NOT CYGWIN) +endif () + +#-- Adding test for cache_image +add_test ( + NAME H5TEST-clear-cache_image-objects + COMMAND ${CMAKE_COMMAND} + -E remove + cache_image_test.h5 + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST +) +add_test (NAME H5TEST-cache_image COMMAND $) +set_tests_properties (H5TEST-cache_image PROPERTIES + DEPENDS H5TEST-clear-cache_image-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST +) #-- Adding test for err_compat if (HDF5_ENABLE_DEPRECATED_SYMBOLS) @@ -696,7 +784,7 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) +endif () #-- Adding test for error_test add_test (NAME H5TEST-clear-error_test-objects @@ -761,7 +849,7 @@ add_test (NAME H5TEST-testlibinfo if (BUILD_SHARED_LIBS) #-- Adding test for cache - if (NOT CYGWIN) + if (NOT CYGWIN AND NOT WIN32) add_test (NAME H5TEST-shared-clear-cache-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -769,14 +857,27 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - add_test (NAME H5TEST-shared-cache COMMAND $) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5TEST-shared-cache COMMAND $) + else () + add_test (NAME H5TEST-shared-cache COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=cache-shared.txt" + #-D "TEST_REFERENCE=cache-shared.out" + -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () set_tests_properties (H5TEST-shared-cache PROPERTIES DEPENDS H5TEST-shared-clear-cache-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) set_tests_properties (H5TEST-shared-cache PROPERTIES TIMEOUT 1800) - endif (NOT CYGWIN) + endif () #-- Adding test for err_compat if (HDF5_ENABLE_DEPRECATED_SYMBOLS) @@ -803,7 +904,7 @@ if (BUILD_SHARED_LIBS) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) + endif () #-- Adding test for error_test add_test (NAME H5TEST-shared-clear-error_test-objects @@ -865,16 +966,16 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) -endif (BUILD_SHARED_LIBS) +endif () ############################################################################## ### P L U G I N T E S T S ############################################################################## if (WIN32) set (CMAKE_SEP "\;") -else (WIN32) +else () set (CMAKE_SEP ":") -endif (WIN32) +endif () add_test (NAME H5PLUGIN-plugin COMMAND $) set_tests_properties (H5PLUGIN-plugin PROPERTIES @@ -886,6 +987,9 @@ set_tests_properties (H5PLUGIN-plugin PROPERTIES ### S W M R T E S T S ############################################################################## # testflushrefresh.sh: flushrefresh +# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes +# testswmr.sh: swmr* +# testvdsswmr.sh: vds_swmr* ############################################################################## ############################################################################## @@ -953,9 +1057,10 @@ if (HDF5_TEST_VFD) ) if (NOT CYGWIN) set (H5_VFD_TESTS ${H5_VFD_TESTS} big cache) - endif (NOT CYGWIN) + endif () - MACRO (CHECK_VFD_TEST vfdtest vfdname resultcode) + # Windows only macro + macro (CHECK_VFD_TEST vfdtest vfdname resultcode) if (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") if (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) @@ -988,8 +1093,8 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - else (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) + endif () + else () add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}" ) @@ -997,9 +1102,9 @@ if (HDF5_TEST_VFD) add_test (NAME VFD-${vfdname}-${test}-shared COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" ) - endif (BUILD_SHARED_LIBS) - endif(NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) - else (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") + endif () + endif () + else () add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -1029,9 +1134,9 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - endif (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") - else (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") + endif () + endif () + else () add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -1046,7 +1151,7 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS) + if (BUILD_SHARED_LIBS AND NOT ${vfdtest} STREQUAL "cache") add_test (NAME VFD-${vfdname}-${vfdtest}-shared COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -1061,15 +1166,15 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - endif (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") - ENDMACRO (CHECK_VFD_TEST vfdtest vfdname resultcode) + endif () + endif () + endmacro () - MACRO (ADD_VFD_TEST vfdname resultcode) + macro (ADD_VFD_TEST vfdname resultcode) foreach (test ${H5_VFD_TESTS}) if (WIN32) CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) - else (WIN32) + else () add_test (NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -1099,25 +1204,25 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - endif (WIN32) - endforeach (test ${H5_VFD_TESTS}) + endif () + endif () + endforeach () set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1) set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT 1800) if (NOT CYGWIN) set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800) - endif (NOT CYGWIN) + endif () if (BUILD_SHARED_LIBS) set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1800) - if (NOT CYGWIN) + if (NOT CYGWIN AND NOT WIN32) set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) - endif (NOT CYGWIN) - endif (BUILD_SHARED_LIBS) + endif () + endif () if (HDF5_TEST_FHEAP_VFD) add_test (NAME VFD-${vfdname}-fheap COMMAND "${CMAKE_COMMAND}" @@ -1150,16 +1255,16 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif (BUILD_SHARED_LIBS) - endif (HDF5_TEST_FHEAP_VFD) - ENDMACRO (ADD_VFD_TEST) + endif () + endif () + endmacro () # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - endforeach (vfd ${VFD_LIST}) + endforeach () -endif (HDF5_TEST_VFD) +endif () ############################################################################## ############################################################################## @@ -1168,13 +1273,13 @@ endif (HDF5_TEST_VFD) ############################################################################## if (HDF5_BUILD_GENERATORS) - MACRO (ADD_H5_GENERATOR genfile) + macro (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) TARGET_NAMING (${genfile} STATIC) TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/test) - ENDMACRO (ADD_H5_GENERATOR genfile) + endmacro () # generator executables set (H5_GENERATORS @@ -1183,6 +1288,7 @@ if (HDF5_BUILD_GENERATORS) gen_cross gen_deflate gen_filters + gen_idx gen_new_array gen_new_fill gen_new_group @@ -1201,6 +1307,6 @@ if (HDF5_BUILD_GENERATORS) foreach (gen ${H5_GENERATORS}) ADD_H5_GENERATOR (${gen}) - endforeach (gen ${H5_GENERATORS}) + endforeach () -endif (HDF5_BUILD_GENERATORS) +endif () diff --git a/test/Makefile.am b/test/Makefile.am index 37883c4..98cfc42 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -29,10 +29,17 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_builddir)/src # testcheck_version.sh: tcheck_version # tetlinks_env.sh: links_env # testflushrefresh.sh: flushrefresh +# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes +# testswmr.sh: swmr* +# testvdsswmr.sh: vds_swmr* TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh \ - testflushrefresh.sh + testswmr.sh testvdsswmr.sh testflushrefresh.sh test_usecases.sh SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) \ - testflushrefresh.sh + flushrefresh$(EXEEXT) use_append_chunk$(EXEEXT) use_append_mchunks$(EXEEXT) use_disable_mdc_flushes$(EXEEXT) \ + swmr_generator$(EXEEXT) swmr_reader$(EXEEXT) swmr_writer$(EXEEXT) \ + swmr_remove_reader$(EXEEXT) swmr_remove_writer$(EXEEXT) swmr_addrem_writer$(EXEEXT) \ + swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) swmr_start_write$(EXEEXT) \ + vds_swmr_gen$(EXEEXT) vds_swmr_reader$(EXEEXT) vds_swmr_writer$(EXEEXT) if HAVE_SHARED_CONDITIONAL TEST_SCRIPT += test_plugin.sh SCRIPT_DEPEND += plugin$(EXEEXT) @@ -44,11 +51,12 @@ check_SCRIPTS = $(TEST_SCRIPT) # executed, generally most specific tests to least specific tests. # As an exception, long-running tests should occur earlier in the list. # This gives them more time to run when tests are executing in parallel. -TEST_PROG= testhdf5 cache cache_api cache_tagging lheap ohdr stab gheap \ +TEST_PROG= testhdf5 \ + cache cache_api cache_image cache_tagging lheap ohdr stab gheap \ evict_on_close farray earray btree2 fheap \ pool accum hyperslab istore bittests dt_arith \ dtypes dsets cmpd_dset filter_fail extend external efc objcopy links unlink \ - big mtime fillval mount flush1 flush2 app_ref enum \ + twriteorder big mtime fillval mount flush1 flush2 app_ref enum \ set_extent ttsafe enc_dec_plist enc_dec_plist_cross_platform\ getname vfd ntypes dangle dtransform reserved cross_read \ freespace mf vds file_image unregister cache_logging cork swmr @@ -57,15 +65,21 @@ TEST_PROG= testhdf5 cache cache_api cache_tagging lheap ohdr stab gheap \ # error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh. # tcheck_version is used by testcheck_version.sh. # accum_swmr_reader is used by accum.c. +# atomic_writer and atomic_reader are standalone programs. # links_env is used by testlinks_env.sh # flushrefresh is used by testflushrefresh.sh. +# use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh +# swmr_* files (besides swmr.c) are used by testswmr.sh. +# vds_swmr_* files are used by testvdsswmr.sh # 'make check' doesn't run them directly, so they are not included in TEST_PROG. # Also build testmeta, which is used for timings test. It builds quickly, # and this lets automake keep all its test programs in one place. check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ - testmeta accum_swmr_reader \ - links_env flushrefresh \ - swmr_check_compat_vfd + testmeta accum_swmr_reader atomic_writer atomic_reader \ + links_env flushrefresh use_append_chunk use_append_mchunks use_disable_mdc_flushes \ + swmr_generator swmr_start_write swmr_reader swmr_writer swmr_remove_reader \ + swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer \ + swmr_check_compat_vfd vds_swmr_gen vds_swmr_reader vds_swmr_writer if HAVE_SHARED_CONDITIONAL check_PROGRAMS+= plugin endif @@ -77,7 +91,7 @@ endif # --enable-build-all at configure time. # The gen_old_* files can only be compiled with older versions of the library # so do not appear in this list. -BUILD_ALL_PROGS=gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_new_array \ +BUILD_ALL_PROGS=gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_idx gen_new_array \ gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \ gen_nullspace gen_udlinks space_overflow gen_filespace gen_specmetaread \ gen_sizes_lheap gen_file_image gen_plist @@ -106,7 +120,7 @@ else noinst_LTLIBRARIES=libh5test.la endif -libh5test_la_SOURCES=h5test.c testframe.c cache_common.c +libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c # Use libhd5test.la to compile all of the tests LDADD=libh5test.la $(LIBHDF5) @@ -114,6 +128,7 @@ LDADD=libh5test.la $(LIBHDF5) # List the source files for tests that have more than one ttsafe_SOURCES=ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \ ttsafe_acreate.c +cache_image_SOURCES=cache_image.c genall5.c VFD_LIST = sec2 stdio core core_paged split multi family if DIRECT_VFD_CONDITIONAL @@ -153,7 +168,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse stdio.h5 sec2.h5 dtypes[0-9].h5 dtypes1[0].h5 dt_arith[1-2].h5 tattr.h5 \ tselect.h5 mtime.h5 unlink.h5 unicode.h5 coord.h5 \ fillval_[0-9].h5 fillval.raw mount_[0-9].h5 testmeta.h5 ttime.h5 \ - trefer[1-3].h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 \ + trefer[1-3].h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 twriteorder.dat \ flush.h5 flush-swmr.h5 noflush.h5 noflush-swmr.h5 flush_extend.h5 \ flush_extend-swmr.h5 noflush_extend.h5 noflush_extend-swmr.h5 \ enum1.h5 titerate.h5 ttsafe.h5 tarray1.h5 tgenprop.h5 \ @@ -170,19 +185,27 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ file_image_core_test.h5.copy unregister_filter_1.h5 unregister_filter_2.h5 \ vds_virt.h5 vds_dapl.h5 vds_src_[0-1].h5 \ + swmr_data.h5 use_use_append_chunk.h5 use_append_mchunks.h5 use_disable_mdc_flushes.h5 \ flushrefresh.h5 flushrefresh_VERIFICATION_START \ flushrefresh_VERIFICATION_CHECKPOINT1 flushrefresh_VERIFICATION_CHECKPOINT2 \ - flushrefresh_VERIFICATION_DONE accum_swmr_big.h5 ohdr_swmr.h5 \ - cache_logging.h5 cache_logging.out \ - swmr[0-2].h5 + flushrefresh_VERIFICATION_DONE atomic_data accum_swmr_big.h5 ohdr_swmr.h5 \ + test_swmr*.h5 cache_logging.h5 cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 \ + swmr[0-2].h5 swmr_writer.out swmr_writer.log.* swmr_reader.out.* swmr_reader.log.* \ + tbogus.h5.copy cache_image_test.h5 + # Sources for testhdf5 executable testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ tgenprop.c th5o.c th5s.c tcoords.c theap.c tid.c titerate.c tmeta.c tmisc.c \ trefer.c trefstr.c tselect.c tskiplist.c tsohm.c ttime.c ttst.c tunicode.c \ tvlstr.c tvltypes.c +# Sources for Use Cases +use_append_chunk_SOURCES=use_append_chunk.c use_common.c +use_append_mchunks_SOURCES=use_append_mchunks.c use_common.c +use_disable_mdc_flushes_SOURCES=use_disable_mdc_flushes.c + # Temporary files. DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh \ - testflushrefresh.sh + testswmr.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh include $(top_srcdir)/config/conclude.am diff --git a/test/cache.c b/test/cache.c index 2209d8f..87b1272 100644 --- a/test/cache.c +++ b/test/cache.c @@ -19,9 +19,6 @@ * This file contains tests for the cache implemented in * H5C.c */ -#include "h5test.h" -#include "H5Iprivate.h" -#include "H5ACprivate.h" #include "cache_common.h" @@ -118,12 +115,12 @@ static void check_flush_cache__multi_entry(H5F_t * file_ptr); static void check_flush_cache__multi_entry_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, - int spec_size, + unsigned int spec_size, struct flush_cache_test_spec spec[]); static void check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, - int spec_size, + unsigned int spec_size, struct pe_flush_cache_test_spec spec[]); static void check_flush_cache__single_entry(H5F_t * file_ptr); static void check_flush_cache__single_entry_test(H5F_t * file_ptr, @@ -155,9 +152,9 @@ static void check_flush_cache__flush_op_test(H5F_t * file_ptr, unsigned int flush_flags, int spec_size, const struct fo_flush_cache_test_spec spec[], - int init_expected_index_len, + unsigned init_expected_index_len, size_t init_expected_index_size, - int expected_index_len, + unsigned expected_index_len, size_t expected_index_size, int check_size, struct fo_flush_entry_check check[]); @@ -3312,7 +3309,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) { int test_num = 1; unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 8; + unsigned int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3406,7 +3403,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) { int test_num = 2; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - int spec_size = 8; + unsigned int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3500,7 +3497,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) { int test_num = 3; unsigned int flush_flags = H5C__FLUSH_CLEAR_ONLY_FLAG; - int spec_size = 8; + unsigned int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3594,7 +3591,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) { int test_num = 4; unsigned int flush_flags = H5C__FLUSH_MARKED_ENTRIES_FLAG; - int spec_size = 8; + unsigned int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3689,7 +3686,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) int test_num = 5; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG; - int spec_size = 8; + unsigned int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3784,7 +3781,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) int test_num = 6; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG; - int spec_size = 8; + unsigned int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3879,7 +3876,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) int test_num = 7; unsigned int flush_flags = H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG; - int spec_size = 8; + unsigned int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3975,7 +3972,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG; - int spec_size = 8; + unsigned int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -4073,7 +4070,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) ~(H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG); - int spec_size = 8; + unsigned int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -4172,7 +4169,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) { int test_num = 1; unsigned int flush_flags = H5C__NO_FLAGS_SET; - int spec_size = 8; + unsigned int spec_size = 8; struct pe_flush_cache_test_spec spec[8] = { { @@ -4318,7 +4315,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) { int test_num = 2; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - int spec_size = 8; + unsigned int spec_size = 8; struct pe_flush_cache_test_spec spec[8] = { { @@ -4448,7 +4445,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) int test_num = 3; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG; - int spec_size = 8; + unsigned int spec_size = 8; struct pe_flush_cache_test_spec spec[8] = { { @@ -4570,7 +4567,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) int test_num = 4; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG; - int spec_size = 8; + unsigned int spec_size = 8; struct pe_flush_cache_test_spec spec[8] = { { @@ -4701,7 +4698,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG; - int spec_size = 8; + unsigned int spec_size = 8; struct pe_flush_cache_test_spec spec[8] = { { @@ -4845,13 +4842,13 @@ static void check_flush_cache__multi_entry_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, - int spec_size, + unsigned int spec_size, struct flush_cache_test_spec spec[]) { H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; herr_t result; - int i; + unsigned u; size_t total_entry_size = 0; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -4890,43 +4887,43 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, failure_mssg = msg; } - i = 0; - while(pass && (i < spec_size)) + u = 0; + while(pass && (u < spec_size)) { - if((spec[i].entry_num != i) || - (spec[i].entry_type < 0) || - (spec[i].entry_type >= NUMBER_OF_ENTRY_TYPES) || - (spec[i].entry_index < 0) || - (spec[i].entry_index > max_indices[spec[i].entry_type])) { + if(((unsigned)spec[u].entry_num != u) || + (spec[u].entry_type < 0) || + (spec[u].entry_type >= NUMBER_OF_ENTRY_TYPES) || + (spec[u].entry_index < 0) || + (spec[u].entry_index > max_indices[spec[u].entry_type])) { pass = FALSE; HDsnprintf(msg, (size_t)128, - "bad data in spec[%d] on entry to multi entry test #%d.", - i, test_num); + "bad data in spec[%u] on entry to multi entry test #%d.", + u, test_num); failure_mssg = msg; } - i++; + u++; } - i = 0; - while(pass && (i < spec_size)) + u = 0; + while(pass && (u < spec_size)) { - if(spec[i].insert_flag) { + if(spec[u].insert_flag) { - insert_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, - spec[i].flags); + insert_entry(file_ptr, spec[u].entry_type, spec[u].entry_index, + spec[u].flags); } else { - protect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index); + protect_entry(file_ptr, spec[u].entry_type, spec[u].entry_index); - unprotect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, - spec[i].flags); + unprotect_entry(file_ptr, spec[u].entry_type, spec[u].entry_index, + spec[u].flags); } - total_entry_size += entry_sizes[spec[i].entry_type]; + total_entry_size += entry_sizes[spec[u].entry_type]; - i++; + u++; } if(pass) { @@ -4943,36 +4940,36 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, } } - i = 0; - while(pass && (i < spec_size)) + u = 0; + while(pass && (u < spec_size)) { - base_addr = entries[spec[i].entry_type]; - entry_ptr = &(base_addr[spec[i].entry_index]); + base_addr = entries[spec[u].entry_type]; + entry_ptr = &(base_addr[spec[u].entry_index]); - if((entry_ptr->deserialized != spec[i].expected_deserialized) || - (entry_ptr->serialized != spec[i].expected_serialized) || - (entry_ptr->destroyed != spec[i].expected_destroyed)) { + if((entry_ptr->deserialized != spec[u].expected_deserialized) || + (entry_ptr->serialized != spec[u].expected_serialized) || + (entry_ptr->destroyed != spec[u].expected_destroyed)) { #if 0 /* This is useful debugging code. Lets keep it around. */ HDfprintf(stdout, "deslzd = %d(%d), slzd = %d(%d), dest = %d(%d)\n", (int)(entry_ptr->deserialized), - (int)(spec[i].expected_deserialized), + (int)(spec[u].expected_deserialized), (int)(entry_ptr->serialized), - (int)(spec[i].expected_serialized), + (int)(spec[u].expected_serialized), (int)(entry_ptr->destroyed), - (int)(spec[i].expected_destroyed)); + (int)(spec[u].expected_destroyed)); #endif pass = FALSE; HDsnprintf(msg, (size_t)128, - "Bad status on entry %d after flush in multi entry test #%d.", - i, test_num); + "Bad status on entry %u after flush in multi entry test #%d.", + u, test_num); failure_mssg = msg; } - i++; + u++; } if(pass) { @@ -5027,17 +5024,17 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, } } - i = 0; - while(pass && (i < spec_size)) + u = 0; + while(pass && (u < spec_size)) { - base_addr = entries[spec[i].entry_type]; - entry_ptr = &(base_addr[spec[i].entry_index]); + base_addr = entries[spec[u].entry_type]; + entry_ptr = &(base_addr[spec[u].entry_index]); entry_ptr->deserialized = FALSE; entry_ptr->serialized = FALSE; entry_ptr->destroyed = FALSE; - i++; + u++; } return; @@ -5064,13 +5061,13 @@ static void check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, - int spec_size, + unsigned int spec_size, struct pe_flush_cache_test_spec spec[]) { H5C_t *cache_ptr = file_ptr->shared->cache; static char msg[128]; herr_t result; - int i; + unsigned u; int j; size_t total_entry_size = 0; test_entry_t * base_addr; @@ -5110,54 +5107,54 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, failure_mssg = msg; } - i = 0; - while(pass && (i < spec_size)) + u = 0; + while(pass && (u < spec_size)) { - if((spec[i].entry_num != i) || - (spec[i].entry_type < 0) || - (spec[i].entry_type >= NUMBER_OF_ENTRY_TYPES) || - (spec[i].entry_index < 0) || - (spec[i].entry_index > max_indices[spec[i].entry_type]) || - (spec[i].num_pins < 0) || - (spec[i].num_pins > MAX_PINS)) { + if(((unsigned)spec[u].entry_num != u) || + (spec[u].entry_type < 0) || + (spec[u].entry_type >= NUMBER_OF_ENTRY_TYPES) || + (spec[u].entry_index < 0) || + (spec[u].entry_index > max_indices[spec[u].entry_type]) || + (spec[u].num_pins < 0) || + (spec[u].num_pins > MAX_PINS)) { pass = FALSE; HDsnprintf(msg, (size_t)128, - "bad data in spec[%d] on entry to pe multi entry test #%d.", - i, test_num); + "bad data in spec[%u] on entry to pe multi entry test #%d.", + u, test_num); failure_mssg = msg; } - i++; + u++; } - i = 0; - while(pass && (i < spec_size)) + u = 0; + while(pass && (u < spec_size)) { - if(spec[i].insert_flag) { + if(spec[u].insert_flag) { - insert_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, - spec[i].flags); + insert_entry(file_ptr, spec[u].entry_type, spec[u].entry_index, + spec[u].flags); } else { - protect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index); + protect_entry(file_ptr, spec[u].entry_type, spec[u].entry_index); - unprotect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, - spec[i].flags); + unprotect_entry(file_ptr, spec[u].entry_type, spec[u].entry_index, + spec[u].flags); } - total_entry_size += entry_sizes[spec[i].entry_type]; + total_entry_size += entry_sizes[spec[u].entry_type]; - for (j = 0; j < spec[i].num_pins; j++) + for (j = 0; j < spec[u].num_pins; j++) { create_pinned_entry_dependency(file_ptr, - spec[i].entry_type, - spec[i].entry_index, - spec[i].pin_type[j], - spec[i].pin_idx[j]); + spec[u].entry_type, + spec[u].entry_index, + spec[u].pin_type[j], + spec[u].pin_idx[j]); } - i++; + u++; } if(pass) { @@ -5174,36 +5171,36 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, } } - i = 0; - while(pass && (i < spec_size)) + u = 0; + while(pass && (u < spec_size)) { - base_addr = entries[spec[i].entry_type]; - entry_ptr = &(base_addr[spec[i].entry_index]); + base_addr = entries[spec[u].entry_type]; + entry_ptr = &(base_addr[spec[u].entry_index]); - if((entry_ptr->deserialized != spec[i].expected_deserialized) || - (entry_ptr->serialized != spec[i].expected_serialized) || - (entry_ptr->destroyed != spec[i].expected_destroyed)) { + if((entry_ptr->deserialized != spec[u].expected_deserialized) || + (entry_ptr->serialized != spec[u].expected_serialized) || + (entry_ptr->destroyed != spec[u].expected_destroyed)) { #if 0 /* This is useful debugging code. Lets keep it around. */ HDfprintf(stdout, "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", (int)(entry_ptr->deserialized), - (int)(spec[i].expected_deserialized), + (int)(spec[u].expected_deserialized), (int)(entry_ptr->serialized), - (int)(spec[i].expected_serialized), + (int)(spec[u].expected_serialized), (int)(entry_ptr->destroyed), - (int)(spec[i].expected_destroyed)); + (int)(spec[u].expected_destroyed)); #endif pass = FALSE; HDsnprintf(msg, (size_t)128, - "Bad status on entry %d after flush in pe multi entry test #%d.", - i, test_num); + "Bad status on entry %u after flush in pe multi entry test #%d.", + u, test_num); failure_mssg = msg; } - i++; + u++; } if(pass) { @@ -5258,17 +5255,17 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, } } - i = 0; - while(pass && (i < spec_size)) + u = 0; + while(pass && (u < spec_size)) { - base_addr = entries[spec[i].entry_type]; - entry_ptr = &(base_addr[spec[i].entry_index]); + base_addr = entries[spec[u].entry_type]; + entry_ptr = &(base_addr[spec[u].entry_index]); entry_ptr->deserialized = FALSE; entry_ptr->serialized = FALSE; entry_ptr->destroyed = FALSE; - i++; + u++; } return; @@ -5323,9 +5320,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 1; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 2; - int init_expected_index_len = 2; + unsigned init_expected_index_len = 2; size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE; - int expected_index_len = 2; + unsigned expected_index_len = 2; size_t expected_index_size = 2 * PICO_ENTRY_SIZE; struct fo_flush_cache_test_spec spec[2] = { @@ -5430,9 +5427,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 2; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 2; - int init_expected_index_len = 2; + unsigned init_expected_index_len = 2; size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE; - int expected_index_len = 0; + unsigned expected_index_len = 0; size_t expected_index_size = 0; struct fo_flush_cache_test_spec spec[2] = { @@ -5534,9 +5531,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 3; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - int init_expected_index_len = 1; + unsigned init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4; - int expected_index_len = 1; + unsigned expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; struct fo_flush_cache_test_spec spec[1] = { @@ -5612,9 +5609,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 4; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 1; - int init_expected_index_len = 1; + unsigned init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4; - int expected_index_len = 0; + unsigned expected_index_len = 0; size_t expected_index_size = 0; struct fo_flush_cache_test_spec spec[1] = { @@ -5697,9 +5694,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 5; /* and 6 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - int init_expected_index_len = 1; + unsigned init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE; - int expected_index_len = 1; + unsigned expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; struct fo_flush_cache_test_spec spec[1] = { @@ -5814,9 +5811,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 7; /* and 8 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - int init_expected_index_len = 1; + unsigned init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE; - int expected_index_len = 1; + unsigned expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; struct fo_flush_cache_test_spec spec[1] = { @@ -5927,9 +5924,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 9; /* and 10 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - int init_expected_index_len = 1; + unsigned init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2; - int expected_index_len = 1; + unsigned expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4; struct fo_flush_cache_test_spec spec[1] = { @@ -6038,9 +6035,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 11; /* and 12 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - int init_expected_index_len = 1; + unsigned init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2; - int expected_index_len = 1; + unsigned expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4; struct fo_flush_cache_test_spec spec[1] = { @@ -6152,9 +6149,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 13; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - int init_expected_index_len = 1; + unsigned init_expected_index_len = 1; size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE; - int expected_index_len = 3; + unsigned expected_index_len = 3; size_t expected_index_size = 3 * PICO_ENTRY_SIZE; struct fo_flush_cache_test_spec spec[1] = { @@ -6248,9 +6245,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 14; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 1; - int init_expected_index_len = 1; + unsigned init_expected_index_len = 1; size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE; - int expected_index_len = 0; + unsigned expected_index_len = 0; size_t expected_index_size = (size_t)0; struct fo_flush_cache_test_spec spec[1] = { @@ -6341,9 +6338,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 15; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - int init_expected_index_len = 1; + unsigned init_expected_index_len = 1; size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; - int expected_index_len = 3; + unsigned expected_index_len = 3; size_t expected_index_size = VARIABLE_ENTRY_SIZE + (VARIABLE_ENTRY_SIZE / 4) + (VARIABLE_ENTRY_SIZE / 2); @@ -6438,9 +6435,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 16; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 1; - int init_expected_index_len = 1; + unsigned init_expected_index_len = 1; size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; - int expected_index_len = 0; + unsigned expected_index_len = 0; size_t expected_index_size = (size_t)0; struct fo_flush_cache_test_spec spec[1] = { @@ -6531,9 +6528,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 17; /* and 18 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - int init_expected_index_len = 1; + unsigned init_expected_index_len = 1; size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; - int expected_index_len = 3; + unsigned expected_index_len = 3; size_t expected_index_size = VARIABLE_ENTRY_SIZE + (VARIABLE_ENTRY_SIZE / 4) + (VARIABLE_ENTRY_SIZE / 2); @@ -6658,9 +6655,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 19; /* and 20 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - int init_expected_index_len = 1; + unsigned init_expected_index_len = 1; size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; - int expected_index_len = 3; + unsigned expected_index_len = 3; size_t expected_index_size = VARIABLE_ENTRY_SIZE + (VARIABLE_ENTRY_SIZE / 4) + (VARIABLE_ENTRY_SIZE / 2); @@ -6796,9 +6793,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 21; unsigned int flush_flags = H5C__FLUSH_MARKED_ENTRIES_FLAG; int spec_size = 4; - int init_expected_index_len = 4; + unsigned init_expected_index_len = 4; size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (2 * PICO_ENTRY_SIZE); - int expected_index_len = 6; + unsigned expected_index_len = 6; size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (VARIABLE_ENTRY_SIZE / 4) + (VARIABLE_ENTRY_SIZE / 2) + @@ -7007,9 +7004,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 22; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 6; - int init_expected_index_len = 6; + unsigned init_expected_index_len = 6; size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE); - int expected_index_len = 10; + unsigned expected_index_len = 10; size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (2 * (VARIABLE_ENTRY_SIZE / 4)) + (2 * (VARIABLE_ENTRY_SIZE / 2)) + @@ -7276,9 +7273,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 23; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 6; - int init_expected_index_len = 6; + unsigned init_expected_index_len = 6; size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE); - int expected_index_len = 0; + unsigned expected_index_len = 0; size_t expected_index_size = 0; struct fo_flush_cache_test_spec spec[6] = { @@ -7538,9 +7535,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 24; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 3; - int init_expected_index_len = 3; + unsigned init_expected_index_len = 3; size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE; - int expected_index_len = 3; + unsigned expected_index_len = 3; size_t expected_index_size = 3 * PICO_ENTRY_SIZE; struct fo_flush_cache_test_spec spec[3] = { @@ -7671,9 +7668,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 25; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 3; - int init_expected_index_len = 3; + unsigned init_expected_index_len = 3; size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE; - int expected_index_len = 0; + unsigned expected_index_len = 0; size_t expected_index_size = (size_t)0; struct fo_flush_cache_test_spec spec[3] = { @@ -7874,9 +7871,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 26; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 10; - int init_expected_index_len = 10; + unsigned init_expected_index_len = 10; size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE; - int expected_index_len = 13; + unsigned expected_index_len = 13; size_t expected_index_size = 9 * VARIABLE_ENTRY_SIZE; struct fo_flush_cache_test_spec spec[10] = { @@ -8308,9 +8305,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 27; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 10; - int init_expected_index_len = 10; + unsigned init_expected_index_len = 10; size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE; - int expected_index_len = 0; + unsigned expected_index_len = 0; size_t expected_index_size = (size_t)0; struct fo_flush_cache_test_spec spec[10] = { @@ -8667,9 +8664,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 28; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 5; - int init_expected_index_len = 5; + unsigned init_expected_index_len = 5; size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE; - int expected_index_len = 5; + unsigned expected_index_len = 5; size_t expected_index_size = 4 * VARIABLE_ENTRY_SIZE; struct fo_flush_cache_test_spec spec[5] = { @@ -8859,9 +8856,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 29; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 5; - int init_expected_index_len = 5; + unsigned init_expected_index_len = 5; size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE; - int expected_index_len = 0; + unsigned expected_index_len = 0; size_t expected_index_size = 0; struct fo_flush_cache_test_spec spec[5] = { @@ -9070,9 +9067,9 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, unsigned int flush_flags, int spec_size, const struct fo_flush_cache_test_spec spec[], - int init_expected_index_len, + unsigned init_expected_index_len, size_t init_expected_index_size, - int expected_index_len, + unsigned expected_index_len, size_t expected_index_size, int check_size, struct fo_flush_entry_check check[]) @@ -13700,7 +13697,7 @@ check_move_entry(void) { unsigned u; H5F_t * file_ptr = NULL; - struct move_entry_test_spec test_specs[8] = + struct move_entry_test_spec test_specs[4] = { { /* int entry_type = */ PICO_ENTRY_TYPE, @@ -15901,7 +15898,6 @@ check_destroy_pinned_err(void) * should fail. Unpin the entry and flush destroy again -- should * succeed. */ - if(pass) { reset_entries(); @@ -15912,7 +15908,7 @@ check_destroy_pinned_err(void) protect_entry(file_ptr, 0, 0); unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); - if(H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { + if(H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0) { pass = FALSE; failure_mssg = "unexpected failure of prep for file close.\n"; } /* end if */ @@ -15928,9 +15924,8 @@ check_destroy_pinned_err(void) pass = FALSE; failure_mssg = "destroy failed after unpin.\n"; } /* end if */ - else { + else file_ptr->shared->cache = NULL; - } /* end else */ } /* end else */ if(saved_cache != NULL) { @@ -15992,16 +15987,16 @@ check_destroy_protected_err(void) file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); - /* Note: normally this call would go just before the series of - * flushes prior to file close -- in particular, all entries + /* Note: normally this call would go just before the series of + * flushes prior to file close -- in particular, all entries * should be unprotected when this call is made. * * Thus H5C_prep_for_file_close() contains an assert to verify - * this. Since this assert would be triggered by the condition + * this. Since this assert would be triggered by the condition * we are trying to test, put the call to H5C_prep_for_file_close() * prior to the final protect call. */ - if(H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { + if(H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0) { pass = FALSE; failure_mssg = "unexpected failure of prep for file close.\n"; } /* end if */ @@ -16093,7 +16088,7 @@ check_duplicate_insert_err(void) entry_ptr = &(base_addr[0]); result = H5C_insert_entry(file_ptr, H5AC_ind_read_dxpl_id, - &(types[0]), entry_ptr->addr, + types[0], entry_ptr->addr, (void *)entry_ptr, H5C__NO_FLAGS_SET); if(result >= 0) { @@ -16461,7 +16456,7 @@ check_double_protect_err(void) if(pass) { cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, - &(types[0]), entry_ptr->addr, + types[0], entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); if(cache_entry_ptr != NULL) { @@ -16705,7 +16700,7 @@ check_expunge_entry_errs(void) if(pass) { result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, - &(types[0]), entry_ptr->addr, H5C__NO_FLAGS_SET); + types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); if(result > 0) { @@ -16723,7 +16718,7 @@ check_expunge_entry_errs(void) if(pass) { result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, - &(types[0]), entry_ptr->addr, H5C__NO_FLAGS_SET); + types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); if(result > 0) { @@ -16741,7 +16736,7 @@ check_expunge_entry_errs(void) if(pass) { result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, - &(types[0]), entry_ptr->addr, H5C__NO_FLAGS_SET); + types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); if(result < 0) { @@ -16784,7 +16779,6 @@ check_expunge_entry_errs(void) * *------------------------------------------------------------------------- */ - static unsigned check_move_entry_errs(void) { @@ -16806,7 +16800,6 @@ check_move_entry_errs(void) */ if(pass) { - reset_entries(); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); @@ -16819,36 +16812,29 @@ check_move_entry_errs(void) entry_0_0_ptr = &((entries[0])[0]); entry_0_1_ptr = &((entries[0])[1]); entry_1_0_ptr = &((entries[1])[0]); - } + } /* end if */ if(pass) { - - result = H5C_move_entry(cache_ptr, &(types[0]), - entry_0_0_ptr->addr, entry_0_1_ptr->addr); + result = H5C_move_entry(cache_ptr, types[0], entry_0_0_ptr->addr, entry_0_1_ptr->addr); if(result >= 0) { - pass = FALSE; failure_mssg = "move to addr of same type succeeded.\n"; - } - } + } /* end if */ + } /* end if */ if(pass) { - - result = H5C_move_entry(cache_ptr, &(types[0]), - entry_0_0_ptr->addr, entry_1_0_ptr->addr); + result = H5C_move_entry(cache_ptr, types[0], entry_0_0_ptr->addr, entry_1_0_ptr->addr); if(result >= 0) { - pass = FALSE; failure_mssg = "move to addr of different type succeeded.\n"; - } - } + } /* end if */ + } /* end if */ if(pass) takedown_cache(file_ptr, FALSE, FALSE); - /* Allocate a cache, protect an entry R/O, and then call * H5C_move_entry() to move it -- this should fail. * @@ -16857,7 +16843,6 @@ check_move_entry_errs(void) */ if(pass) { - reset_entries(); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); @@ -16865,29 +16850,21 @@ check_move_entry_errs(void) cache_ptr = file_ptr->shared->cache; insert_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); - protect_entry_ro(file_ptr, 0, 0); entry_ptr = &((entries[0])[0]); - - } + } /* end if */ if(pass) { - - result = H5C_move_entry(cache_ptr, &(types[0]), entry_ptr->header.addr, entry_ptr->header.addr + 10); + result = H5C_move_entry(cache_ptr, types[0], entry_ptr->header.addr, entry_ptr->header.addr + 10); if(result >= 0) { - pass = FALSE; - failure_mssg = - "Call to H5C_move_entry on a R/O protected entry succeeded.\n"; - - } else { - + failure_mssg = "Call to H5C_move_entry on a R/O protected entry succeeded.\n"; + } /* end if */ + else unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); - - } - } + } /* end if */ if(pass) takedown_cache(file_ptr, FALSE, FALSE); @@ -16897,8 +16874,7 @@ check_move_entry_errs(void) else { H5_FAILED() - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", - FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); } /* end else */ return (unsigned)!pass; @@ -17179,7 +17155,7 @@ check_protect_ro_rw_err(void) if(pass) { thing_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, - &(types[0]), entry_ptr->addr, + types[0], entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); if(thing_ptr != NULL) { @@ -17272,13 +17248,13 @@ check_protect_retries(void) entry_ptr->verify_ct = 0; cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, - &(types[type]), entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); + types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); if((cache_entry_ptr != (void *)entry_ptr) || (!(entry_ptr->header.is_protected)) || (!(entry_ptr->header.is_read_only)) || (entry_ptr->header.ro_ref_count <= 0) || - (entry_ptr->header.type != &(types[type])) || + (entry_ptr->header.type != types[type]) || (entry_ptr->size != entry_ptr->header.size) || (entry_ptr->addr != entry_ptr->header.addr) || (entry_ptr->verify_ct != entry_ptr->max_verify_ct)) { @@ -17317,7 +17293,7 @@ check_protect_retries(void) entry_ptr->verify_ct = 0; cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, - &(types[type]), entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); + types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); /* H5C_protect() should fail after all retries fail */ if(cache_entry_ptr != NULL) @@ -27433,7 +27409,7 @@ check_auto_cache_resize_aux_fcns(void) size_t max_size; size_t min_clean_size; size_t cur_size; - int32_t cur_num_entries; + uint32_t cur_num_entries; H5C_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C__CURR_AUTO_SIZE_CTL_VER, @@ -28157,8 +28133,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) } if(show_progress) /* 0 */ - HDfprintf(stdout, "\n%s: check point %d -- pass %d\n", - FUNC, checkpoint++, pass); + HDfprintf(stdout, "\n%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); if(pass) { @@ -33718,14 +33693,10 @@ check_metadata_cork(hbool_t fill_via_insertion) reset_entries(); - if(fill_via_insertion) { - - TESTING("to ensure cork/uncork metadata when inserting"); - - } else { - - TESTING("to ensure cork/uncork metadata on protect/unprotect"); - } + if(fill_via_insertion) + TESTING("to ensure cork/uncork metadata when inserting") + else + TESTING("to ensure cork/uncork metadata on protect/unprotect") if(show_progress) /* 0 */ HDfprintf(stdout, "\n%s: check point %d -- pass %d\n", @@ -34580,7 +34551,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) /*------------------------------------------------------------------------- * Function: cedds__H5C_make_space_in_cache() * - * Purpose: Verify that H5C_make_space_in_cache() can handle the + * Purpose: Verify that H5C__make_space_in_cache() can handle the * removal from the cache of the next item in its reverse scan * of the LRU list. * @@ -34590,7 +34561,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) * load an additional entry, triggering the flush of the last * item, and thereby the deletion of the second to last item. * - * H5C_make_space_in_cache() should detect this deletion, and + * H5C__make_space_in_cache() should detect this deletion, and * restart its scan of the LRU from the tail, instead of * examining the now deleted next item up on the LRU. * @@ -34668,7 +34639,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) if(cache_ptr == NULL) { pass = FALSE; - failure_mssg = "cache_ptr NULL on entry to cedds for H5C_make_space_in_cache() test."; + failure_mssg = "cache_ptr NULL on entry to cedds for H5C__make_space_in_cache() test."; } else if((cache_ptr->index_len != 0) || (cache_ptr->index_size != 0)) { @@ -34808,7 +34779,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) * and HET 0, 2, and 3 will be evicted to make room for the new * monster entry (MET, 31). * - * Verify this. If H5C_make_space_in_cache() chokes, failure will + * Verify this. If H5C__make_space_in_cache() chokes, failure will * be detected in protect_entry(). Thus end the "if(pass)" clause * there so the error message will not be overwritten. */ @@ -34971,7 +34942,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) * access the first item in the LRU repeatedly until the * item, and thereby the deletion of the second to last item. * - * H5C_make_space_in_cache() should detect this deletion, and + * H5C__make_space_in_cache() should detect this deletion, and * restart its scan of the LRU from the tail, instead of * examining the now deleted next item up on the LRU. * diff --git a/test/cache_api.c b/test/cache_api.c index 1d3c9cf..710e38f 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -20,9 +20,6 @@ * with the cache implemented in H5C.c */ -#include "h5test.h" -#include "H5Iprivate.h" -#include "H5ACprivate.h" #include "cache_common.h" /* extern declarations */ @@ -2317,19 +2314,12 @@ main(void) nerrs += 1; } - if ( invalid_configs ) { - + if(invalid_configs) HDfree(invalid_configs); - } - - if ( nerrs > 0 ) { + if(nerrs > 0) return EXIT_FAILURE; - - } else { - + else return EXIT_SUCCESS; - } - } /* main() */ diff --git a/test/cache_common.c b/test/cache_common.c index 5151d65..d1bbf10 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -19,9 +19,6 @@ * This file contains common code for tests of the cache * implemented in H5C.c */ -#include "h5test.h" -#include "H5Cprivate.h" -#include "H5Iprivate.h" #include "H5MFprivate.h" #include "H5MMprivate.h" #include "cache_common.h" @@ -288,27 +285,9 @@ const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES] = NOTIFY_ALT_BASE_ADDR }; -const char *entry_type_names[NUMBER_OF_ENTRY_TYPES] = -{ - "pico entries -- 1 B", - "nano entries -- 4 B", - "micro entries -- 16 B", - "tiny entries -- 64 B", - "small entries -- 256 B", - "medium entries -- 1 KB", - "large entries -- 4 KB", - "huge entries -- 16 KB", - "monster entries -- 64 KB", - "variable entries -- 1B - 10KB", - "notify entries -- 1B" -}; - -/* callback table declaration */ - -const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = -{ - { +/* Callback classes */ +static const H5C_class_t pico_class[1] = {{ PICO_ENTRY_TYPE, "pico_entry", H5FD_MEM_DEFAULT, @@ -323,8 +302,9 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = NULL, pico_free_icr, NULL, - }, - { +}}; + +static const H5C_class_t nano_class[1] = {{ NANO_ENTRY_TYPE, "nano_entry", H5FD_MEM_DEFAULT, @@ -339,8 +319,9 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = NULL, nano_free_icr, NULL, - }, - { +}}; + +static const H5C_class_t micro_class[1] = {{ MICRO_ENTRY_TYPE, "micro_entry", H5FD_MEM_DEFAULT, @@ -355,8 +336,9 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = NULL, micro_free_icr, NULL, - }, - { +}}; + +static const H5C_class_t tiny_class[1] = {{ TINY_ENTRY_TYPE, "tiny_entry", H5FD_MEM_DEFAULT, @@ -371,8 +353,9 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = NULL, tiny_free_icr, NULL, - }, - { +}}; + +static const H5C_class_t small_class[1] = {{ SMALL_ENTRY_TYPE, "small_entry", H5FD_MEM_DEFAULT, @@ -387,8 +370,9 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = NULL, small_free_icr, NULL, - }, - { +}}; + +static const H5C_class_t medium_class[1] = {{ MEDIUM_ENTRY_TYPE, "medium_entry", H5FD_MEM_DEFAULT, @@ -403,8 +387,9 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = NULL, medium_free_icr, NULL, - }, - { +}}; + +static const H5C_class_t large_class[1] = {{ LARGE_ENTRY_TYPE, "large_entry", H5FD_MEM_DEFAULT, @@ -419,8 +404,9 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = NULL, large_free_icr, NULL, - }, - { +}}; + +static const H5C_class_t huge_class[1] = {{ HUGE_ENTRY_TYPE, "huge_entry", H5FD_MEM_DEFAULT, @@ -435,8 +421,9 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = NULL, huge_free_icr, NULL, - }, - { +}}; + +static const H5C_class_t monster_class[1] = {{ MONSTER_ENTRY_TYPE, "monster_entry", H5FD_MEM_DEFAULT, @@ -451,8 +438,9 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = NULL, monster_free_icr, NULL, - }, - { +}}; + +static const H5C_class_t variable_class[1] = {{ VARIABLE_ENTRY_TYPE, "variable_entry", H5FD_MEM_DEFAULT, @@ -467,8 +455,9 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = NULL, variable_free_icr, NULL, - }, - { +}}; + +static const H5C_class_t notify_class[1] = {{ NOTIFY_ENTRY_TYPE, "notify_entry", H5FD_MEM_DEFAULT, @@ -483,7 +472,22 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = notify_notify, notify_free_icr, NULL, - } +}}; + +/* callback table declaration */ + +const H5C_class_t *types[NUMBER_OF_ENTRY_TYPES] = { + pico_class, + nano_class, + micro_class, + tiny_class, + small_class, + medium_class, + large_class, + huge_class, + monster_class, + variable_class, + notify_class }; /* address translation functions: */ @@ -3231,8 +3235,8 @@ setup_cache(size_t max_cache_size, if(verbose) HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC); - } - } + } /* end if */ + } /* end if */ if(show_progress) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -3300,7 +3304,7 @@ setup_cache(size_t max_cache_size, cache_ptr = H5C_create(max_cache_size, min_clean_size, (NUMBER_OF_ENTRY_TYPES - 1), - (const char **)entry_type_names, + types, check_write_permitted, TRUE, NULL, @@ -3533,7 +3537,7 @@ expunge_entry(H5F_t * file_ptr, HDassert( ! ( entry_ptr->is_pinned ) ); result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, - &(types[type]), entry_ptr->addr, H5C__NO_FLAGS_SET); + types[type], entry_ptr->addr, H5C__NO_FLAGS_SET); if ( result < 0 ) { @@ -3754,11 +3758,11 @@ insert_entry(H5F_t * file_ptr, } result = H5C_insert_entry(file_ptr, xfer, - &(types[type]), entry_ptr->addr, (void *)entry_ptr, flags); + types[type], entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || ( entry_ptr->header.is_protected ) || - ( entry_ptr->header.type != &(types[type]) ) || + ( entry_ptr->header.type != types[type] ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { @@ -3771,8 +3775,8 @@ insert_entry(H5F_t * file_ptr, HDfprintf(stdout, "entry_ptr->header.is_protected = %d\n", (int)(entry_ptr->header.is_protected)); HDfprintf(stdout, - "entry_ptr->header.type != &(types[type]) = %d\n", - (int)(entry_ptr->header.type != &(types[type]))); + "entry_ptr->header.type != types[type] = %d\n", + (int)(entry_ptr->header.type != types[type])); HDfprintf(stdout, "entry_ptr->size != entry_ptr->header.size = %d\n", (int)(entry_ptr->size != entry_ptr->header.size)); @@ -3855,7 +3859,7 @@ mark_entry_dirty(int32_t type, ( !entry_ptr->header.is_protected && !entry_ptr->header.is_pinned ) || ( entry_ptr->header.is_protected && !entry_ptr->header.dirtied ) || ( !entry_ptr->header.is_protected && !entry_ptr->header.is_dirty ) || - ( entry_ptr->header.type != &(types[type]) ) || + ( entry_ptr->header.type != types[type] ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { @@ -3948,7 +3952,7 @@ move_entry(H5C_t * cache_ptr, mark_flush_dep_dirty(entry_ptr); entry_ptr->action = TEST_ENTRY_ACTION_MOVE; - result = H5C_move_entry(cache_ptr, &(types[type]), old_addr, new_addr); + result = H5C_move_entry(cache_ptr, types[type], old_addr, new_addr); entry_ptr->action = TEST_ENTRY_ACTION_NUL; } @@ -4027,12 +4031,12 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx) } /* end if */ cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, xfer, - &(types[type]), entry_ptr->addr, &entry_ptr->addr, + types[type], entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); if ( ( cache_entry_ptr != (void *)entry_ptr ) || ( !(entry_ptr->header.is_protected) ) || - ( entry_ptr->header.type != &(types[type]) ) || + ( entry_ptr->header.type != types[type] ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { @@ -4049,8 +4053,8 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx) HDfprintf(stdout, "entry_ptr->header.is_protected = %d\n", (int)(entry_ptr->header.is_protected)); HDfprintf(stdout, - "( entry_ptr->header.type != &(types[type]) ) = %d\n", - (int)( entry_ptr->header.type != &(types[type]) )); + "( entry_ptr->header.type != types[type] ) = %d\n", + (int)( entry_ptr->header.type != types[type] )); HDfprintf(stdout, "entry_ptr->size = %d, entry_ptr->header.size = %d\n", (int)(entry_ptr->size), (int)(entry_ptr->header.size)); @@ -4131,13 +4135,13 @@ protect_entry_ro(H5F_t * file_ptr, ( entry_ptr->ro_ref_count > 0 ) ) ); cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, - &(types[type]), entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); + types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); if ( ( cache_entry_ptr != (void *)entry_ptr ) || ( !(entry_ptr->header.is_protected) ) || ( !(entry_ptr->header.is_read_only) ) || ( entry_ptr->header.ro_ref_count <= 0 ) || - ( entry_ptr->header.type != &(types[type]) ) || + ( entry_ptr->header.type != types[type] ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { @@ -4268,7 +4272,7 @@ unpin_entry(int32_t type, if ( ( result < 0 ) || ( entry_ptr->header.pinned_from_client ) || ( entry_ptr->header.is_pinned && !entry_ptr->header.pinned_from_cache ) || - ( entry_ptr->header.type != &(types[type]) ) || + ( entry_ptr->header.type != types[type] ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { @@ -4353,7 +4357,7 @@ unprotect_entry(H5F_t * file_ptr, ( ( entry_ptr->header.is_protected ) && ( ( ! ( entry_ptr->is_read_only ) ) || ( entry_ptr->ro_ref_count <= 0 ) ) ) || - ( entry_ptr->header.type != &(types[type]) ) || + ( entry_ptr->header.type != types[type] ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { @@ -6128,7 +6132,7 @@ check_and_validate_cache_size(hid_t file_id, size_t min_clean_size; size_t expected_cur_size; size_t cur_size; - int32_t expected_cur_num_entries; + uint32_t expected_cur_num_entries; int cur_num_entries; H5F_t * file_ptr = NULL; H5C_t * cache_ptr = NULL; @@ -6434,7 +6438,7 @@ dump_LRU(H5F_t * file_ptr) entry_ptr = cache_ptr->LRU_head_ptr; HDfprintf(stdout, - "\n\nIndex len/size/clean size/dirty size = %d/%lld/%lld/%lld\n", + "\n\nIndex len/size/clean size/dirty size = %u/%lld/%lld/%lld\n", cache_ptr->index_len, (long long)(cache_ptr->index_size), (long long)(cache_ptr->clean_index_size), (long long)(cache_ptr->dirty_index_size)); diff --git a/test/cache_common.h b/test/cache_common.h index befcee4..f003189 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -553,11 +553,10 @@ H5TEST_DLLVAR const int32_t max_indices[NUMBER_OF_ENTRY_TYPES]; H5TEST_DLLVAR const size_t entry_sizes[NUMBER_OF_ENTRY_TYPES]; H5TEST_DLLVAR const haddr_t base_addrs[NUMBER_OF_ENTRY_TYPES]; H5TEST_DLLVAR const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES]; -H5TEST_DLLVAR const char * entry_type_names[NUMBER_OF_ENTRY_TYPES]; /* callback table extern */ -H5TEST_DLLVAR const H5C_class_t types[NUMBER_OF_ENTRY_TYPES]; +H5TEST_DLLVAR const H5C_class_t *types[NUMBER_OF_ENTRY_TYPES]; #ifdef __cplusplus diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 473851e..02ce19b 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -21,11 +21,8 @@ #include "H5Fpkg.h" #include "testhdf5.h" -#include "h5test.h" #include "cache_common.h" -#include "H5Iprivate.h" -#include "H5ACprivate.h" #include "H5HLprivate.h" /* ============ */ @@ -956,9 +953,9 @@ check_dense_attribute_tags(void) int verbose = FALSE; /* verbose file outout */ int i = 0; /* iterator */ hid_t fapl = -1; /* File access property list */ - haddr_t d_tag = 0; /* Dataset tag value */ - haddr_t root_tag = 0; /* Root group tag value */ - char attrname[500]; /* Name of attribute */ + haddr_t d_tag = 0; /* Dataset tag value */ + haddr_t root_tag = 0; /* Root group tag value */ + char attrname[500]; /* Name of attribute */ /* Testing Macro */ TESTING("tag application during dense attribute manipulation"); @@ -1536,6 +1533,7 @@ check_attribute_rename_tags(hid_t fcpl, int type) /* Close and Reopen the file and group */ if ( H5Gclose(gid) < 0 ) TEST_ERROR; if ( H5Fclose(fid) < 0 ) TEST_ERROR; + if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0 ) TEST_ERROR; if ( (gid = H5Gopen2(fid, GROUPNAME, H5P_DEFAULT)) < 0 ) TEST_ERROR; diff --git a/test/dsets.c b/test/dsets.c index d086c58..39b7c22 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -507,7 +507,7 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) TESTING("simple I/O"); - /* Can't run this test with multi-file VFDs */ + /* Can't run this test with multi-file VFDs because of HDopen/read/seek the file directly */ if(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { h5_fixname(FILENAME[4], fapl, filename, sizeof filename); @@ -645,7 +645,7 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl) TESTING("dataset offset with user block"); - /* Can't run this test with multi-file VFDs */ + /* Can't run this test with multi-file VFDs because of HDopen/read/seek the file directly */ if(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { h5_fixname(FILENAME[2], fapl, filename, sizeof filename); @@ -1984,10 +1984,11 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, } } - PASSED(); - /* Get the storage size of the dataset */ if((*dset_size=H5Dget_storage_size(dataset))==0) goto error; + + PASSED(); + /* Clean up objects used for this test */ if(H5Dclose (dataset) < 0) goto error; if(H5Sclose (sid) < 0) goto error; @@ -2932,6 +2933,7 @@ test_nbit_int(hid_t file) PASSED(); return 0; + error: return -1; } diff --git a/test/earray.c b/test/earray.c index 07acbb5..c6f5986 100644 --- a/test/earray.c +++ b/test/earray.c @@ -159,15 +159,6 @@ typedef struct earray_test_t { /* Local prototypes */ -/* Metadata cache (H5AC) callbacks */ -static herr_t earray_cache_test_get_initial_load_size(void *udata, size_t *image_len); -static void *earray_cache_test_deserialize(const void *image_ptr, size_t len, - void *udata_ptr, hbool_t *dirty_ptr); -static herr_t earray_cache_test_image_len(const void *thing, size_t *image_len_ptr); -static herr_t earray_cache_test_serialize(const H5F_t *f, void *image_ptr, - size_t len, void *thing); -static herr_t earray_cache_test_free_icr(void *thing); - /* Local variables */ const char *FILENAME[] = { @@ -182,24 +173,6 @@ char filename_g[EARRAY_FILENAME_LEN]; /* Empty file size */ h5_stat_size_t empty_size_g; -/* H5EA test object inherits cache-like properties from H5AC */ -const H5AC_class_t H5AC_EARRAY_TEST[1] = {{ - /* id */ H5AC_TEST_ID, - /* name */ "earray test", - /* mem_type */ H5FD_MEM_DEFAULT, - /* flags */ H5AC__CLASS_SKIP_READS | H5AC__CLASS_SKIP_WRITES, - /* get_initial_load_size */ earray_cache_test_get_initial_load_size, - /* get_final_load_size */ NULL, - /* verify_chksum */ NULL, - /* deserialize */ earray_cache_test_deserialize, - /* image_len */ earray_cache_test_image_len, - /* pre_serialize */ NULL, - /* serialize */ earray_cache_test_serialize, - /* notify */ NULL, - /* free_icr */ earray_cache_test_free_icr, - /* fsf_size */ NULL, -}}; - /*------------------------------------------------------------------------- * Function: init_cparam @@ -619,225 +592,6 @@ error: /*------------------------------------------------------------------------- - * Function: earray_cache_test_get_initial_load_size() - * - * Purpose: place holder function -- should never be called - * - * A generic discussion of metadata cache callbacks of this type - * may be found in H5Cprivate.h. - * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: John Mainzer - * 8/2/14 - * - *------------------------------------------------------------------------- - */ -static herr_t -earray_cache_test_get_initial_load_size( void *udata, size_t *image_len) -{ - HDassert(udata); - HDassert(image_len); - - /* Should never be called */ - HDassert(0 && "Can't be called!"); - - *image_len = 0; - - return(SUCCEED); -} /* end earray_cache_test_get_initial_load_size() */ - - -/*------------------------------------------------------------------------- - * Function: earray_cache_test_deserialize - * - * Purpose: place holder function -- should never be called. - * - * - * A generic discussion of metadata cache callbacks of this type - * may be found in H5Cprivate.h: - * - * Return: Success: Pointer to in core representation - * Failure: NULL - * - * Programmer: John Mainzer - * 8/2/14 - * - *------------------------------------------------------------------------- - */ -static void * -earray_cache_test_deserialize(const void *image_ptr, - size_t len, - void *udata_ptr, - hbool_t *dirty_ptr) -{ - HDassert(image_ptr); - HDassert(len > 0 ); - HDassert(udata_ptr); - HDassert(dirty_ptr); - - /* Should never be called */ - HDassert(0 && "Can't be called!"); - - return(NULL); -} /* end earray_cache_test_deserialize() */ - - -/*------------------------------------------------------------------------- - * Function: earray_cache_test_image_len - * - * Purpose: test code place holder function -- just set *image_len_ptr to - * one. - * - * - * A generic discussion of metadata cache callbacks of this type - * may be found in H5Cprivate.h: - * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: John Mainzer - * 8/2/14 - * - *------------------------------------------------------------------------- - */ -static herr_t -earray_cache_test_image_len(const void *thing, size_t *image_len_ptr) -{ - HDassert(thing); - HDassert(image_len_ptr); - - /* Set size value */ - /* (hard-code to 1) */ - *image_len_ptr = 1; - - return(SUCCEED); -} /* end earray_cache_test_image_len() */ - - - -/*------------------------------------------------------------------------- - * Function: earray_cache_test_serialize - * - * Purpose: Validate the contents of the instance of earray_test_t. - * - * - * A generic discussion of metadata cache callbacks of this type - * may be found in H5Cprivate.h: - * - * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: John Mainzer - * 8/2/14 - * - *------------------------------------------------------------------------- - */ -static herr_t -earray_cache_test_serialize(const H5F_t *f, - void *image_ptr, - H5_ATTR_UNUSED size_t len, - void *thing) -{ - earray_test_t *test; - - HDassert(f); - HDassert(image_ptr); - HDassert(thing); - test = (earray_test_t *)thing; - HDassert(test); - HDassert(test->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert((const H5AC_class_t *)(test->cache_info.type) == - &(H5AC_EARRAY_TEST[0])); - - /* Check for out of order flush */ - if(test->fd_info->base_obj) - TEST_ERROR - - /* Check which index this entry corresponds to */ - if((uint64_t)0 == test->idx) { - /* Check for out of order flush */ - if(test->fd_info->idx0_obj || test->fd_info->idx0_elem) - TEST_ERROR - - /* Set flag for object flush */ - test->fd_info->idx0_obj = TRUE; - } /* end if */ - else if((uint64_t)1 == test->idx) { - /* Check for out of order flush */ - if(test->fd_info->idx1_obj || test->fd_info->idx1_elem) - TEST_ERROR - - /* Set flag for object flush */ - test->fd_info->idx1_obj = TRUE; - } /* end if */ - else if((uint64_t)10000 == test->idx) { - /* Check for out of order flush */ - if(test->fd_info->idx10000_obj || test->fd_info->idx10000_elem) - TEST_ERROR - - /* Set flag for object flush */ - test->fd_info->idx10000_obj = TRUE; - } /* end if */ - else if((uint64_t)-1 == test->idx) { - /* Set flag for object flush */ - test->fd_info->base_obj = TRUE; - } /* end if */ - - return(SUCCEED); - -error: - return(FAIL); -} /* end earray_cache_test_serialize() */ - - - -/*------------------------------------------------------------------------- - * Function: earray_cache_test_free_icr - * - * Purpose: Destroy an extensible array test object in memory. - * - * - * A generic discussion of metadata cache callbacks of this type - * may be found in H5Cprivate.h: - * - * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: John Mainzer - * 8/2/14 - * - *------------------------------------------------------------------------- - */ -static herr_t -earray_cache_test_free_icr(void *thing) -{ - earray_test_t *test; - - HDassert(thing); - test = (earray_test_t *)thing; - HDassert(test); - - /* the metadata cache sets cache_info.magic to - * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling the - * free_icr routine. Hence the following assert: - */ - - HDassert(test->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); - HDassert((const H5AC_class_t *)(test->cache_info.type) == - &(H5AC_EARRAY_TEST[0])); - - /* Free the shared info itself */ - HDfree(test); - - return(SUCCEED); -} /* end earray_cache_test_free_icr() */ - - -/*------------------------------------------------------------------------- * Function: test_create * * Purpose: Test creating extensible array diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c index 4f0147e..5179e8e 100644 --- a/test/enc_dec_plist.c +++ b/test/enc_dec_plist.c @@ -117,6 +117,11 @@ main(void) 0.2f, (256 * 2048), H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; + H5AC_cache_image_config_t my_cache_image_config = { + H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, + TRUE, + FALSE, + -1}; if(VERBOSE_MED) printf("Encode/Decode DCPLs\n"); @@ -455,6 +460,8 @@ main(void) FAIL_STACK_ERROR if((H5Pset_mdc_config(fapl, &my_cache_config)) < 0) FAIL_STACK_ERROR + if((H5Pset_mdc_image_config(fapl, &my_cache_image_config)) < 0) + FAIL_STACK_ERROR if((H5Pset_core_write_tracking(fapl, TRUE, 1024 * 1024)) < 0) FAIL_STACK_ERROR diff --git a/test/evict_on_close.c b/test/evict_on_close.c index e0a7a73..3986d5a 100644 --- a/test/evict_on_close.c +++ b/test/evict_on_close.c @@ -600,7 +600,7 @@ check_group_layout(hid_t fid, const char *group_name) hid_t gid1 = -1, gid2 = -1; /* group IDs */ H5G_t *grp_ptr = NULL; /* ptr to internal group struct */ haddr_t tag1, tag2; /* MD cache tags for groups */ - int32_t before, during, after; /* cache sizes */ + uint32_t before, during, after; /* cache sizes */ int i; /* iterator */ /* NOTE: The TESTING() macro is called in main() */ @@ -616,7 +616,7 @@ check_group_layout(hid_t fid, const char *group_name) HDprintf("\nCACHE BEFORE GROUP OPEN:\n"); if(H5AC_dump_cache(file_ptr) < 0) TEST_ERROR; - HDprintf("NUMBER OF CACHE ENTRIES: %d\n", before); + HDprintf("NUMBER OF CACHE ENTRIES: %u\n", before); #endif /* Open the main group and get its tag */ @@ -658,7 +658,7 @@ check_group_layout(hid_t fid, const char *group_name) if(H5AC_dump_cache(file_ptr) < 0) TEST_ERROR; HDprintf("MAIN GROUP TAG: %#X\n", tag1); - HDprintf("NUMBER OF CACHE ENTRIES: %d\n", during); + HDprintf("NUMBER OF CACHE ENTRIES: %u\n", during); #endif /* Close the main group */ @@ -672,7 +672,7 @@ check_group_layout(hid_t fid, const char *group_name) HDprintf("\nCACHE AFTER CLOSING GROUPS:\n"); if(H5AC_dump_cache(file_ptr) < 0) TEST_ERROR; - HDprintf("NUMBER OF CACHE ENTRIES: %d\n", after); + HDprintf("NUMBER OF CACHE ENTRIES: %u\n", after); #endif /* Ensure that the cache does not contain entries with the tag */ @@ -718,7 +718,7 @@ check_dset_scheme(hid_t fid, const char *dset_name) H5D_t *dset_ptr = NULL; /* ptr to internal dset struct */ haddr_t tag; /* MD cache tag for dataset */ int *data = NULL; /* buffer for fake data */ - int32_t before, during, after; /* cache sizes */ + uint32_t before, during, after; /* cache sizes */ /* NOTE: The TESTING() macro is called in main() */ @@ -737,7 +737,7 @@ check_dset_scheme(hid_t fid, const char *dset_name) HDprintf("\nCACHE BEFORE DATASET OPEN:\n"); if(H5AC_dump_cache(file_ptr) < 0) TEST_ERROR; - HDprintf("NUMBER OF CACHE ENTRIES: %d\n", before); + HDprintf("NUMBER OF CACHE ENTRIES: %u\n", before); #endif /* Open dataset and get the metadata tag */ @@ -761,7 +761,7 @@ check_dset_scheme(hid_t fid, const char *dset_name) if(H5AC_dump_cache(file_ptr) < 0) TEST_ERROR; HDprintf("TAG: %#X\n", tag); - HDprintf("NUMBER OF CACHE ENTRIES: %d\n", during); + HDprintf("NUMBER OF CACHE ENTRIES: %u\n", during); #endif /* Close the dataset */ @@ -775,7 +775,7 @@ check_dset_scheme(hid_t fid, const char *dset_name) HDprintf("\nCACHE AFTER DATASET CLOSE:\n"); if(H5AC_dump_cache(file_ptr) < 0) TEST_ERROR; - HDprintf("NUMBER OF CACHE ENTRIES: %d\n", after); + HDprintf("NUMBER OF CACHE ENTRIES: %u\n", after); #endif /* Ensure that the cache does not contain entries with the tag */ diff --git a/test/fheap.c b/test/fheap.c index 8e364de..82859d2 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -16360,6 +16360,7 @@ main(void) /* Reset library */ h5_reset(); + fapl = h5_fileaccess(); ExpressMode = GetTestExpress(); if(ExpressMode > 1) @@ -16379,13 +16380,7 @@ main(void) shared_wobj_g[u] = (unsigned char)u; /* Iterate over the testing parameters */ -#ifndef QAK for(curr_test = FHEAP_TEST_NORMAL; curr_test < FHEAP_TEST_NTESTS; H5_INC_ENUM(fheap_test_type_t, curr_test)) { -#else /* QAK */ -HDfprintf(stderr, "Uncomment test loop!\n"); -curr_test = FHEAP_TEST_NORMAL; -/* curr_test = FHEAP_TEST_REOPEN; */ -#endif /* QAK */ /* Clear the testing parameters */ HDmemset(&tparam, 0, sizeof(fheap_test_param_t)); tparam.actual_id_len = HEAP_ID_LEN; @@ -16410,7 +16405,6 @@ curr_test = FHEAP_TEST_NORMAL; } /* end switch */ /* Test fractal heap creation */ -#ifndef QAK nerrors += test_create(fapl, &small_cparam, &tparam); nerrors += test_reopen(fapl, &small_cparam, &tparam); nerrors += test_open_twice(fapl, &small_cparam, &tparam); @@ -16419,23 +16413,12 @@ curr_test = FHEAP_TEST_NORMAL; nerrors += test_filtered_create(fapl, &small_cparam); nerrors += test_size(fapl, &small_cparam); nerrors += test_reopen_hdr(fapl, &small_cparam); -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ -#ifndef QAK2 -#ifndef QAK { fheap_test_fill_t fill; /* Size of objects to fill heap blocks with */ -#ifndef QAK2 /* Filling with different sized objects */ for(fill = FHEAP_TEST_FILL_LARGE; fill < FHEAP_TEST_FILL_N; H5_INC_ENUM(fheap_test_fill_t, fill)) { -#else /* QAK2 */ -HDfprintf(stderr, "Uncomment test loop!\n"); -fill = FHEAP_TEST_FILL_LARGE; -/* fill = FHEAP_TEST_FILL_SINGLE; */ -#endif /* QAK2 */ tparam.fill = fill; /* Set appropriate testing parameters for each test */ @@ -16460,12 +16443,8 @@ fill = FHEAP_TEST_FILL_LARGE; * Test fractal heap managed object insertion */ -#ifndef QAK /* "Weird" sized objects */ nerrors += test_man_insert_weird(fapl, &small_cparam, &tparam); -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ #ifdef ALL_INSERT_TESTS /* "Standard" sized objects, building from simple to complex heaps */ @@ -16501,20 +16480,15 @@ HDfprintf(stderr, "Uncomment tests!\n"); /* If this test fails, uncomment the tests above, which build up to this * level of complexity gradually. -QAK */ -#ifndef QAK if(ExpressMode > 1) printf("***Express test mode on. test_man_start_5th_recursive_indirect is skipped\n"); else nerrors += test_man_start_5th_recursive_indirect(fapl, &small_cparam, &tparam); -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ /* * Test fractal heap object deletion */ /* Simple removal */ -#ifndef QAK nerrors += test_man_remove_bogus(fapl, &small_cparam, &tparam); nerrors += test_man_remove_one(fapl, &small_cparam, &tparam); nerrors += test_man_remove_two(fapl, &small_cparam, &tparam); @@ -16531,12 +16505,7 @@ HDfprintf(stderr, "Uncomment tests!\n"); /* Incremental insert & removal */ tparam.del_dir = FHEAP_DEL_FORWARD; nerrors += test_man_incr_insert_remove(fapl, &small_cparam, &tparam); -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ -#ifndef QAK -#ifndef QAK2 { fheap_test_del_dir_t del_dir; /* Deletion direction */ fheap_test_del_drain_t drain_half; /* Deletion draining */ @@ -16546,19 +16515,10 @@ HDfprintf(stderr, "Uncomment tests!\n"); tparam.del_dir = del_dir; for(drain_half = FHEAP_DEL_DRAIN_ALL; drain_half < FHEAP_DEL_DRAIN_N; H5_INC_ENUM(fheap_test_del_drain_t, drain_half)) { tparam.drain_half = drain_half; -#else /* QAK2 */ -HDfprintf(stderr, "Uncomment test loops!\n"); -/* tparam.del_dir = FHEAP_DEL_FORWARD; */ -/* tparam.del_dir = FHEAP_DEL_REVERSE; */ -tparam.del_dir = FHEAP_DEL_HEAP; -tparam.drain_half = FHEAP_DEL_DRAIN_ALL; -/* tparam.drain_half = FHEAP_DEL_DRAIN_HALF; */ -#endif /* QAK2 */ /* Don't need to test deletion directions when deleting entire heap */ if(tparam.del_dir == FHEAP_DEL_HEAP && tparam.drain_half > FHEAP_DEL_DRAIN_ALL) break; -#ifndef QAK /* Simple insertion patterns */ nerrors += test_man_remove_root_direct(fapl, &small_cparam, &tparam); nerrors += test_man_remove_two_direct(fapl, &small_cparam, &tparam); @@ -16572,11 +16532,7 @@ tparam.drain_half = FHEAP_DEL_DRAIN_ALL; nerrors += test_man_remove_2nd_indirect(fapl, &small_cparam, &tparam); nerrors += test_man_remove_3rd_indirect(fapl, &small_cparam, &tparam); } /* end else */ -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ -#ifndef QAK /* Skip blocks insertion */ /* (covers insertion & deletion of skipped blocks) */ nerrors += test_man_skip_start_block(fapl, &small_cparam, &tparam); @@ -16608,21 +16564,13 @@ HDfprintf(stderr, "Uncomment tests!\n"); nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); nerrors += test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); } /* end else */ -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ -#ifndef QAK /* Fragmented insertion patterns */ /* (covers insertion & deletion of fragmented blocks) */ nerrors += test_man_frag_simple(fapl, &small_cparam, &tparam); nerrors += test_man_frag_direct(fapl, &small_cparam, &tparam); nerrors += test_man_frag_2nd_direct(fapl, &small_cparam, &tparam); nerrors += test_man_frag_3rd_direct(fapl, &small_cparam, &tparam); -#else /* QAK */ - HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ -#ifndef QAK2 } /* end for */ } /* end for */ @@ -16630,22 +16578,12 @@ HDfprintf(stderr, "Uncomment tests!\n"); tparam.drain_half = FHEAP_DEL_DRAIN_ALL; } /* end block */ -#endif /* QAK2 */ -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ -#ifndef QAK2 } /* end for */ -#endif /* QAK2 */ } /* end block */ -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ /* * Test fractal heap 'huge' & 'tiny' object insertion & deletion */ -#ifndef QAK { fheap_test_del_dir_t del_dir; /* Deletion direction */ unsigned id_len; /* Length of heap IDs */ @@ -16687,24 +16625,16 @@ HDfprintf(stderr, "Uncomment tests!\n"); tparam.del_dir = del_dir; /* Test 'huge' object insert & delete */ -#ifndef QAK nerrors += test_huge_insert_one(fapl, &small_cparam, &tparam); nerrors += test_huge_insert_two(fapl, &small_cparam, &tparam); nerrors += test_huge_insert_three(fapl, &small_cparam, &tparam); nerrors += test_huge_insert_mix(fapl, &small_cparam, &tparam); nerrors += test_filtered_huge(fapl, &small_cparam, &tparam); -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ -#ifndef QAK /* Test 'tiny' object insert & delete */ nerrors += test_tiny_insert_one(fapl, &small_cparam, &tparam); nerrors += test_tiny_insert_two(fapl, &small_cparam, &tparam); nerrors += test_tiny_insert_mix(fapl, &small_cparam, &tparam); -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ } /* end for */ } /* end for */ @@ -16712,16 +16642,9 @@ HDfprintf(stderr, "Uncomment tests!\n"); small_cparam.id_len = 0; tparam.actual_id_len = HEAP_ID_LEN; } /* end block */ -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ -#else /* QAK2 */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK2 */ /* Test I/O filter support */ -#ifndef QAK /* Try several different methods of deleting objects */ { fheap_test_del_dir_t del_dir; /* Deletion direction */ @@ -16743,16 +16666,11 @@ HDfprintf(stderr, "Uncomment tests!\n"); tparam.comp = FHEAP_TEST_NO_COMPRESS; } /* end for */ } /* end block */ -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ -#ifndef QAK /* Random object insertion & deletion */ if(ExpressMode > 1) printf("***Express test mode on. Some tests skipped\n"); else { -#ifndef QAK /* Random tests using "small" heap creation parameters */ puts("Using 'small' heap creation parameters"); @@ -16765,11 +16683,7 @@ HDfprintf(stderr, "Uncomment tests!\n"); tparam.del_dir = FHEAP_DEL_HEAP; nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &small_cparam, &tparam); nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &small_cparam, &tparam); -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ -#ifndef QAK /* Random tests using "large" heap creation parameters */ puts("Using 'large' heap creation parameters"); tparam.actual_id_len = LARGE_HEAP_ID_LEN; @@ -16783,18 +16697,11 @@ HDfprintf(stderr, "Uncomment tests!\n"); tparam.del_dir = FHEAP_DEL_HEAP; nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &large_cparam, &tparam); nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &large_cparam, &tparam); -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ /* Reset the "normal" heap ID length */ tparam.actual_id_len = SMALL_HEAP_ID_LEN; } /* end else */ -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ -#ifndef QAK /* Test object writing support */ /* Basic object writing */ @@ -16806,19 +16713,10 @@ HDfprintf(stderr, "Uncomment tests!\n"); /* Reset block compression */ tparam.comp = FHEAP_TEST_NO_COMPRESS; -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ -#ifndef QAK } /* end for */ -#endif /* QAK */ /* Tests that address specific bugs */ -#ifndef QAK nerrors += test_bug1(fapl, &small_cparam, &tparam); -#else /* QAK */ -HDfprintf(stderr, "Uncomment tests!\n"); -#endif /* QAK */ /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); diff --git a/test/fillval.c b/test/fillval.c index 4f7adc1..6eb3565 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -2370,7 +2370,7 @@ main(int argc, char *argv[]) { int nerrors=0, argno, test_contig=1, test_chunk=1, test_compact=1; hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ - unsigned new_format; /* Whether to use the new format or not */ + unsigned new_format; /* Whether to use the new format or not */ if(argc >= 2) { test_contig = test_chunk = test_compact = 0; diff --git a/test/freespace.c b/test/freespace.c index d963a6e..181e6a1 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -1995,7 +1995,8 @@ test_fs_sect_shrink(hid_t fapl) (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR - if (node_found) TEST_ERROR + if (node_found) + TEST_ERROR if(check_stats(f, frsp, &state)) TEST_ERROR @@ -2095,7 +2096,8 @@ test_fs_sect_shrink(hid_t fapl) (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR - if (node_found) TEST_ERROR + if (node_found) + TEST_ERROR /* section A should not be there in free-space */ if((node_found = H5FS_sect_find(f, dxpl_id, frsp, @@ -2238,8 +2240,8 @@ test_fs_sect_change_class(hid_t fapl) TEST_ERROR if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, - TEST_FSPACE_SECT_TYPE_NONE) < 0) - TEST_ERROR + TEST_FSPACE_SECT_TYPE_NONE) < 0) + TEST_ERROR state.serial_sect_count += 1; state.ghost_sect_count -=1; diff --git a/test/gen_plist.c b/test/gen_plist.c index c617ad0..8cb6c00 100644 --- a/test/gen_plist.c +++ b/test/gen_plist.c @@ -81,6 +81,12 @@ main(void) 0.2f, (256 * 2048), H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY}; + H5AC_cache_image_config_t my_cache_image_config = { + H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, + TRUE, + FALSE, + -1}; + /* check endianess */ { @@ -356,6 +362,9 @@ main(void) assert(ret > 0); if((ret = H5Pset_mdc_config(fapl1, &my_cache_config)) < 0) assert(ret > 0); + if((ret = H5Pset_mdc_image_config(fapl1, &my_cache_image_config)) < 0) + assert(ret > 0); + if((ret = H5Pset_core_write_tracking(fapl1, TRUE, (size_t)(1024 * 1024))) < 0) assert(ret > 0); diff --git a/test/h5test.c b/test/h5test.c index 9759fa8..a36d580 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1744,9 +1744,7 @@ error: void h5_send_message(const char *send, const char *arg1, const char *arg2) { - FILE *signalfile; - - HDremove(TMP_SIGNAL_FILE); + FILE *signalfile = NULL; /* Create signal file (which will send signal to some other process) */ signalfile = HDfopen(TMP_SIGNAL_FILE, "w+"); diff --git a/test/links.c b/test/links.c index 182eb6c..3364c7e 100644 --- a/test/links.c +++ b/test/links.c @@ -21,18 +21,22 @@ */ /* + * This file needs to access private information from the H5FD package. + * This file also needs to access the file driver testing code. + */ +#define H5FD_FRIEND /*suppress error about including H5FDpkg */ +#define H5FD_TESTING + +/* * This file needs to access private information from the H5G package. * This file also needs to access the group testing code. */ #define H5G_FRIEND /*suppress error about including H5Gpkg */ #define H5G_TESTING -#define H5FD_FRIEND /*suppress error about including H5FDpkg */ -#define H5FD_TESTING - #include "h5test.h" #include "H5srcdir.h" -#include "H5FDpkg.h" /* File drivers */ +#include "H5FDpkg.h" /* File drivers */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ @@ -820,7 +824,7 @@ long_links(hid_t fapl, hbool_t new_format) static int toomany(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ + hid_t fid = (-1); /* File ID */ hid_t gid = (-1), gid2 = (-1); /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE]; @@ -2623,7 +2627,6 @@ external_link_toomany(hid_t fapl, hbool_t new_format) /* Close first file */ if(H5Fclose(fid) < 0) TEST_ERROR - PASSED(); return 0; diff --git a/test/objcopy.c b/test/objcopy.c index 4166284..0711fb0 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -7200,7 +7200,7 @@ test_copy_ext_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap if(H5Gclose(gid) < 0) TEST_ERROR /* create file to hold external links to the src file */ - if((fid_ext = H5Fcreate(ext_filename, H5F_ACC_TRUNC, H5P_DEFAULT, src_fapl)) < 0) TEST_ERROR + if((fid_ext = H5Fcreate(ext_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* create group in the file that will hold the external link */ if((gid = H5Gcreate2(fid_ext, NAME_GROUP_LINK, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR diff --git a/test/swmr_check_compat_vfd.c b/test/swmr_check_compat_vfd.c index d1134ee..1bbfda3 100644 --- a/test/swmr_check_compat_vfd.c +++ b/test/swmr_check_compat_vfd.c @@ -18,12 +18,13 @@ * * It is intended for use in shell scripts. */ + #include "h5test.h" /* This file needs to access the file driver testing code */ -#define H5FD_FRIEND /*suppress error about including H5FDpkg */ +#define H5FD_FRIEND /*suppress error about including H5FDpkg */ #define H5FD_TESTING -#include "H5FDpkg.h" /* File drivers */ +#include "H5FDpkg.h" /* File drivers */ /*------------------------------------------------------------------------- @@ -53,4 +54,3 @@ main(void) return EXIT_FAILURE; } /* end main() */ - diff --git a/test/testfiles/plist_files/dapl_32be b/test/testfiles/plist_files/dapl_32be index 4df4e7f..4dedda2 100644 Binary files a/test/testfiles/plist_files/dapl_32be and b/test/testfiles/plist_files/dapl_32be differ diff --git a/test/testfiles/plist_files/dapl_32le b/test/testfiles/plist_files/dapl_32le index 4df4e7f..4dedda2 100644 Binary files a/test/testfiles/plist_files/dapl_32le and b/test/testfiles/plist_files/dapl_32le differ diff --git a/test/testfiles/plist_files/dapl_64be b/test/testfiles/plist_files/dapl_64be index 4df4e7f..4dedda2 100644 Binary files a/test/testfiles/plist_files/dapl_64be and b/test/testfiles/plist_files/dapl_64be differ diff --git a/test/testfiles/plist_files/dapl_64le b/test/testfiles/plist_files/dapl_64le index 4df4e7f..4dedda2 100644 Binary files a/test/testfiles/plist_files/dapl_64le and b/test/testfiles/plist_files/dapl_64le differ diff --git a/test/testfiles/plist_files/def_dapl_32be b/test/testfiles/plist_files/def_dapl_32be index c9b7ea9..3df7289 100644 Binary files a/test/testfiles/plist_files/def_dapl_32be and b/test/testfiles/plist_files/def_dapl_32be differ diff --git a/test/testfiles/plist_files/def_dapl_32le b/test/testfiles/plist_files/def_dapl_32le index c9b7ea9..3df7289 100644 Binary files a/test/testfiles/plist_files/def_dapl_32le and b/test/testfiles/plist_files/def_dapl_32le differ diff --git a/test/testfiles/plist_files/def_dapl_64be b/test/testfiles/plist_files/def_dapl_64be index c9b7ea9..3df7289 100644 Binary files a/test/testfiles/plist_files/def_dapl_64be and b/test/testfiles/plist_files/def_dapl_64be differ diff --git a/test/testfiles/plist_files/def_dapl_64le b/test/testfiles/plist_files/def_dapl_64le index c9b7ea9..3df7289 100644 Binary files a/test/testfiles/plist_files/def_dapl_64le and b/test/testfiles/plist_files/def_dapl_64le differ diff --git a/test/testfiles/plist_files/def_dxpl_32be b/test/testfiles/plist_files/def_dxpl_32be index b13f456..3b77a32 100644 Binary files a/test/testfiles/plist_files/def_dxpl_32be and b/test/testfiles/plist_files/def_dxpl_32be differ diff --git a/test/testfiles/plist_files/def_dxpl_32le b/test/testfiles/plist_files/def_dxpl_32le index b13f456..3b77a32 100644 Binary files a/test/testfiles/plist_files/def_dxpl_32le and b/test/testfiles/plist_files/def_dxpl_32le differ diff --git a/test/testfiles/plist_files/def_dxpl_64be b/test/testfiles/plist_files/def_dxpl_64be index b13f456..3b77a32 100644 Binary files a/test/testfiles/plist_files/def_dxpl_64be and b/test/testfiles/plist_files/def_dxpl_64be differ diff --git a/test/testfiles/plist_files/def_dxpl_64le b/test/testfiles/plist_files/def_dxpl_64le index b13f456..3b77a32 100644 Binary files a/test/testfiles/plist_files/def_dxpl_64le and b/test/testfiles/plist_files/def_dxpl_64le differ diff --git a/test/testfiles/plist_files/def_fapl_32be b/test/testfiles/plist_files/def_fapl_32be index 6b6baee..3b35501 100644 Binary files a/test/testfiles/plist_files/def_fapl_32be and b/test/testfiles/plist_files/def_fapl_32be differ diff --git a/test/testfiles/plist_files/def_fapl_32le b/test/testfiles/plist_files/def_fapl_32le index 6b6baee..3b35501 100644 Binary files a/test/testfiles/plist_files/def_fapl_32le and b/test/testfiles/plist_files/def_fapl_32le differ diff --git a/test/testfiles/plist_files/def_fapl_64be b/test/testfiles/plist_files/def_fapl_64be index 6b6baee..3b35501 100644 Binary files a/test/testfiles/plist_files/def_fapl_64be and b/test/testfiles/plist_files/def_fapl_64be differ diff --git a/test/testfiles/plist_files/def_fapl_64le b/test/testfiles/plist_files/def_fapl_64le index 6b6baee..3b35501 100644 Binary files a/test/testfiles/plist_files/def_fapl_64le and b/test/testfiles/plist_files/def_fapl_64le differ diff --git a/test/testfiles/plist_files/dxpl_32be b/test/testfiles/plist_files/dxpl_32be index 5ff2ea0..22fbdc8 100644 Binary files a/test/testfiles/plist_files/dxpl_32be and b/test/testfiles/plist_files/dxpl_32be differ diff --git a/test/testfiles/plist_files/dxpl_32le b/test/testfiles/plist_files/dxpl_32le index 5ff2ea0..22fbdc8 100644 Binary files a/test/testfiles/plist_files/dxpl_32le and b/test/testfiles/plist_files/dxpl_32le differ diff --git a/test/testfiles/plist_files/dxpl_64be b/test/testfiles/plist_files/dxpl_64be index 5ff2ea0..22fbdc8 100644 Binary files a/test/testfiles/plist_files/dxpl_64be and b/test/testfiles/plist_files/dxpl_64be differ diff --git a/test/testfiles/plist_files/dxpl_64le b/test/testfiles/plist_files/dxpl_64le index 5ff2ea0..22fbdc8 100644 Binary files a/test/testfiles/plist_files/dxpl_64le and b/test/testfiles/plist_files/dxpl_64le differ diff --git a/test/testfiles/plist_files/fapl_32be b/test/testfiles/plist_files/fapl_32be index 65e2070..43e5e67 100644 Binary files a/test/testfiles/plist_files/fapl_32be and b/test/testfiles/plist_files/fapl_32be differ diff --git a/test/testfiles/plist_files/fapl_32le b/test/testfiles/plist_files/fapl_32le index 65e2070..43e5e67 100644 Binary files a/test/testfiles/plist_files/fapl_32le and b/test/testfiles/plist_files/fapl_32le differ diff --git a/test/testfiles/plist_files/fapl_64be b/test/testfiles/plist_files/fapl_64be index 65e2070..43e5e67 100644 Binary files a/test/testfiles/plist_files/fapl_64be and b/test/testfiles/plist_files/fapl_64be differ diff --git a/test/testfiles/plist_files/fapl_64le b/test/testfiles/plist_files/fapl_64le index 65e2070..43e5e67 100644 Binary files a/test/testfiles/plist_files/fapl_64le and b/test/testfiles/plist_files/fapl_64le differ diff --git a/test/testfiles/plist_files/fcpl_32be b/test/testfiles/plist_files/fcpl_32be index ffa5242..3ce8bf4 100644 Binary files a/test/testfiles/plist_files/fcpl_32be and b/test/testfiles/plist_files/fcpl_32be differ diff --git a/test/testfiles/plist_files/fcpl_32le b/test/testfiles/plist_files/fcpl_32le index ffa5242..3ce8bf4 100644 Binary files a/test/testfiles/plist_files/fcpl_32le and b/test/testfiles/plist_files/fcpl_32le differ diff --git a/test/testfiles/plist_files/fcpl_64be b/test/testfiles/plist_files/fcpl_64be index ffa5242..3ce8bf4 100644 Binary files a/test/testfiles/plist_files/fcpl_64be and b/test/testfiles/plist_files/fcpl_64be differ diff --git a/test/testfiles/plist_files/fcpl_64le b/test/testfiles/plist_files/fcpl_64le index ffa5242..3ce8bf4 100644 Binary files a/test/testfiles/plist_files/fcpl_64le and b/test/testfiles/plist_files/fcpl_64le differ diff --git a/test/testfiles/plist_files/lapl_32be b/test/testfiles/plist_files/lapl_32be index e9f43e2..f3e9865 100644 Binary files a/test/testfiles/plist_files/lapl_32be and b/test/testfiles/plist_files/lapl_32be differ diff --git a/test/testfiles/plist_files/lapl_32le b/test/testfiles/plist_files/lapl_32le index e9f43e2..f3e9865 100644 Binary files a/test/testfiles/plist_files/lapl_32le and b/test/testfiles/plist_files/lapl_32le differ diff --git a/test/testfiles/plist_files/lapl_64be b/test/testfiles/plist_files/lapl_64be index e9f43e2..f3e9865 100644 Binary files a/test/testfiles/plist_files/lapl_64be and b/test/testfiles/plist_files/lapl_64be differ diff --git a/test/testfiles/plist_files/lapl_64le b/test/testfiles/plist_files/lapl_64le index e9f43e2..f3e9865 100644 Binary files a/test/testfiles/plist_files/lapl_64le and b/test/testfiles/plist_files/lapl_64le differ diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in index 7bfeb60..83b7134 100644 --- a/test/testflushrefresh.sh.in +++ b/test/testflushrefresh.sh.in @@ -118,7 +118,7 @@ until [ $verification_done -eq 1 ]; do # Check to see if we timed out looking for the signal before continuing. if [ $timedout -gt 0 ]; then - echo timed out waiting for signal from test program. + echo "timed out waiting for signal from test program (flush)." break fi @@ -158,7 +158,7 @@ if [ $timedout -eq 0 ]; then # Check to see if we timed out looking for the signal before continuing. if [ $timedout -gt 0 ]; then - echo timed out waiting for signal from test program. + echo "timed out waiting for signal from test program (refresh)." break fi diff --git a/test/tfile.c b/test/tfile.c index 19a2df4..6987493 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -103,14 +103,14 @@ #define USERBLOCK_SIZE ((hsize_t) 512) /* Declarations for test_filespace_*() */ -#define FILENAME_LEN 1024 /* length of file name */ +#define FILENAME_LEN 1024 /* length of file name */ #define CORE_INCREMENT 1024 /* core file */ #define FAMILY_SIZE 1024 /* family file */ -#define DSETNAME "dset" /* Name of dataset */ -#define NELMTS(X) (sizeof(X)/sizeof(X[0])) /* # of elements */ -#define READ_OLD_BUFSIZE 1024 /* Buffer for holding file data */ -#define FILE5 "tfile5.h5" /* Test file */ -#define TEST_THRESHOLD10 10 /* Free space section threshold */ +#define DSETNAME "dset" /* Name of dataset */ +#define NELMTS(X) (sizeof(X)/sizeof(X[0])) /* # of elements */ +#define READ_OLD_BUFSIZE 1024 /* Buffer for holding file data */ +#define FILE5 "tfile5.h5" /* Test file */ +#define TEST_THRESHOLD10 10 /* Free space section threshold */ /* Declaration for test_libver_macros2() */ #define FILE6 "tfile6.h5" /* Test file */ @@ -120,7 +120,8 @@ #define NGROUPS 2 #define NDSETS 4 -const char *OLD_FILENAME[] = { /* Files created under 1.6 branch and 1.8 branch */ +/* Files created under 1.6 branch and 1.8 branch--used in test_filespace_compatible() */ +const char *OLD_FILENAME[] = { "filespace_1_6.h5", /* 1.6 HDF5 file */ "filespace_1_8.h5" /* 1.8 HDF5 file */ }; @@ -888,9 +889,8 @@ test_file_close(void) ret = H5Gclose(group_id3); CHECK(ret, FAIL, "H5Gclose"); break; - - case H5F_CLOSE_DEFAULT: - default: + case H5F_CLOSE_DEFAULT: + default: CHECK(fc_degree, H5F_CLOSE_DEFAULT, "H5Pget_fclose_degree"); break; } @@ -3605,36 +3605,36 @@ static void test_filespace_compatible(void) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ - hid_t fid; /* File id */ - hid_t fcpl; /* File creation property list template */ - hid_t did; /* Dataset id */ - int check[100]; /* Temporary buffer for verifying dataset data */ - int rdbuf[100]; /* Temporary buffer for reading in dataset data */ + hid_t fid = -1; /* File id */ + hid_t did = -1; /* Dataset id */ + hid_t fcpl; /* File creation property list template */ + int check[100]; /* Temporary buffer for verifying dataset data */ + int rdbuf[100]; /* Temporary buffer for reading in dataset data */ uint8_t buf[READ_OLD_BUFSIZE]; /* temporary buffer for reading */ - ssize_t nread; /* Number of bytes read in */ - unsigned i, j; /* Local index variable */ - hssize_t free_space; /* Amount of free space in the file */ - hsize_t threshold; /* Free space section threshold */ + ssize_t nread; /* Number of bytes read in */ + unsigned i, j; /* Local index variable */ + hssize_t free_space; /* Amount of free-space in the file */ + hsize_t threshold; /* Free-space section threshold */ H5F_file_space_type_t strategy; /* File space handling strategy */ - herr_t ret; /* Return value */ + herr_t ret; /* Return value */ /* Output message about test being performed */ - MESSAGE(5, ("Testing File space compatibility for 1.6 and 1.8 files\n")); + MESSAGE(5, ("File space compatibility testing for 1.6 and 1.8 files\n")); for(j = 0; j < NELMTS(OLD_FILENAME); j++) { const char *filename = H5_get_srcdir_filename(OLD_FILENAME[j]); /* Corrected test file name */ - /* Copy old file into test file */ + /* Open and copy the test file into a temporary file */ fd_old = HDopen(filename, O_RDONLY, 0666); CHECK(fd_old, FAIL, "HDopen"); fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, 0666); CHECK(fd_new, FAIL, "HDopen"); /* Copy data */ - while((nread = HDread(fd_old, buf, (size_t)READ_OLD_BUFSIZE)) > 0) { - ssize_t write_err = HDwrite(fd_new, buf, (size_t)nread); - CHECK(write_err, -1, "HDwrite"); - } /* end while */ + while((nread = HDread(fd_old, buf, (size_t)READ_OLD_BUFSIZE)) > 0) { + ssize_t write_err = HDwrite(fd_new, buf, (size_t)nread); + CHECK(write_err, -1, "HDwrite"); + } /* end while */ /* Close the files */ ret = HDclose(fd_old); @@ -3642,7 +3642,7 @@ test_filespace_compatible(void) ret = HDclose(fd_new); CHECK(ret, FAIL, "HDclose"); - /* Open the test file */ + /* Open the temporary test file */ fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); @@ -3651,10 +3651,11 @@ test_filespace_compatible(void) CHECK(free_space, FAIL, "H5Fget_freespace"); VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); - /* Get the file's file creation property list */ + /* Get the file's file creation property list */ + fcpl = H5Fget_create_plist(fid); + CHECK(fcpl, FAIL, "H5Fget_create_plist"); + /* Retrieve the file space handling strategy and threshold */ - fcpl = H5Fget_create_plist(fid); - CHECK(fcpl, FAIL, "H5Fget_create_plist"); ret = H5Pget_file_space(fcpl, &strategy, &threshold); CHECK(ret, FAIL, "H5Pget_file_space"); @@ -3685,13 +3686,13 @@ test_filespace_compatible(void) ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); CHECK(ret, FAIL, "H5Ldelete"); - /* Close the plist */ - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Pclose"); + /* Close the plist */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); /* Re-Open the file */ fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT); @@ -4090,37 +4091,37 @@ test_file(void) /* Output message about test being performed */ MESSAGE(5, ("Testing Low-Level File I/O\n")); - test_file_create(); /* Test file creation(also creation templates)*/ - test_file_open(); /* Test file opening */ - test_file_reopen(); /* Test file reopening */ - test_file_close(); /* Test file close behavior */ - test_get_file_id(); /* Test H5Iget_file_id */ - test_get_obj_ids(); /* Test H5Fget_obj_ids for Jira Issue 8528 */ - test_file_perm(); /* Test file access permissions */ - test_file_perm2(); /* Test file access permission again */ + test_file_create(); /* Test file creation(also creation templates)*/ + test_file_open(); /* Test file opening */ + test_file_reopen(); /* Test file reopening */ + test_file_close(); /* Test file close behavior */ + test_get_file_id(); /* Test H5Iget_file_id */ + test_get_obj_ids(); /* Test H5Fget_obj_ids for Jira Issue 8528 */ + test_file_perm(); /* Test file access permissions */ + test_file_perm2(); /* Test file access permission again */ test_file_freespace(); /* Test file free space information */ - test_file_ishdf5(); /* Test detecting HDF5 files correctly */ - test_file_open_dot(); /* Test opening objects with "." for a name */ - test_file_open_overlap(); /* Test opening files in an overlapping manner */ - test_file_getname(); /* Test basic H5Fget_name() functionality */ - test_file_double_root_open(); /* Test opening root group from two files works properly */ - test_file_double_group_open(); /* Test opening same group from two files works properly */ - test_file_double_dataset_open(); /* Test opening same dataset from two files works properly */ - test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */ + test_file_ishdf5(); /* Test detecting HDF5 files correctly */ + test_file_open_dot(); /* Test opening objects with "." for a name */ + test_file_open_overlap(); /* Test opening files in an overlapping manner */ + test_file_getname(); /* Test basic H5Fget_name() functionality */ + test_file_double_root_open(); /* Test opening root group from two files works properly */ + test_file_double_group_open(); /* Test opening same group from two files works properly */ + test_file_double_dataset_open(); /* Test opening same dataset from two files works properly */ + test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */ test_file_double_file_dataset_open(TRUE); test_file_double_file_dataset_open(FALSE); - test_userblock_file_size(); /* Tests that files created with a userblock have the correct size */ - test_cached_stab_info(); /* Tests that files are created with cached stab info in the superblock */ - test_rw_noupdate(); /* Test to ensure that RW permissions don't write the file unless dirtied */ - test_userblock_alignment(); /* Tests that files created with a userblock and alignment interact properly */ + test_userblock_file_size(); /* Tests that files created with a userblock have the correct size */ + test_cached_stab_info(); /* Tests that files are created with cached stab info in the superblock */ + test_rw_noupdate(); /* Test to ensure that RW permissions don't write the file unless dirtied */ + test_userblock_alignment(); /* Tests that files created with a userblock and alignment interact properly */ test_filespace_sects(); /* Test file free space section information */ test_filespace_info(); /* Test file creation public routines:H5Pget/set_file_space */ - test_filespace_compatible();/* Test compatibility for file space management */ - test_libver_bounds(); /* Test compatibility for file space management */ - test_libver_macros(); /* Test the macros for library version comparison */ - test_libver_macros2(); /* Test the macros for library version comparison */ + test_filespace_compatible(); /* Test compatibility for file space management */ + test_libver_bounds(); /* Test compatibility for file space management */ + test_libver_macros(); /* Test the macros for library version comparison */ + test_libver_macros2(); /* Test the macros for library version comparison */ #ifndef H5_NO_DEPRECATED_SYMBOLS - test_deprec(); /* Test deprecated routines */ + test_deprec(); /* Test deprecated routines */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* test_file() */ diff --git a/test/unlink.c b/test/unlink.c index 660a155..e52699a 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -2440,9 +2440,9 @@ int main(void) { hid_t fapl, fapl2, file; - int nerrors = 0; + int nerrors = 0; char filename[1024]; - unsigned new_format; + unsigned new_format; /* Metadata cache parameters */ int mdc_nelmts; diff --git a/test/vds.c b/test/vds.c index 2fd492a..e6bfeb3 100644 --- a/test/vds.c +++ b/test/vds.c @@ -2812,7 +2812,7 @@ test_basic_io(unsigned config, hid_t fapl) /* Write data directly to source dataset */ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) - TEST_ERROR + TEST_ERROR /* Close srcdset and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -7265,6 +7265,12 @@ test_printf(unsigned config, hid_t fapl) if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR + /* Test H5Pget_virtual_printf_gap() */ + if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) + TEST_ERROR + if(gap_size != (hsize_t)2) + TEST_ERROR + /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) TEST_ERROR @@ -7329,6 +7335,12 @@ test_printf(unsigned config, hid_t fapl) if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR + /* Test H5Pget_virtual_printf_gap() */ + if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) + TEST_ERROR + if(gap_size != (hsize_t)3) + TEST_ERROR + /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) TEST_ERROR @@ -7393,6 +7405,12 @@ test_printf(unsigned config, hid_t fapl) if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR + /* Test H5Pget_virtual_printf_gap() */ + if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) + TEST_ERROR + if(gap_size != (hsize_t)4) + TEST_ERROR + /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) TEST_ERROR @@ -11121,23 +11139,23 @@ error: static int test_dapl_values(hid_t fapl_id) { - hid_t fid = -1; /* file to write to */ - hid_t dcpl_id = -1; /* dataset creation properties */ - hid_t dapl_id1 = -1; /* dataset access properties */ - hid_t dapl_id2 = -1; /* dataset access properties */ - hid_t vds_sid = -1; /* vds data space */ - hid_t src_sid = -1; /* source data space */ - hid_t did1 = -1; /* dataset */ - hid_t did2 = -1; /* dataset */ - hsize_t start; /* hyperslab start */ - hsize_t stride; /* hyperslab count */ - hsize_t count; /* hyperslab count */ - hsize_t block; /* hyperslab count */ - hsize_t dims; /* dataset size */ - hsize_t max_dims; /* dataset max size */ - H5D_vds_view_t view; /* view from dapl */ - hsize_t gap_size; /* gap size from dapl */ - char filename[1024]; /* file names */ + hid_t fid = -1; /* file to write to */ + hid_t dcpl_id = -1; /* dataset creation properties */ + hid_t dapl_id1 = -1; /* dataset access properties */ + hid_t dapl_id2 = -1; /* dataset access properties */ + hid_t vds_sid = -1; /* vds data space */ + hid_t src_sid = -1; /* source data space */ + hid_t did1 = -1; /* dataset */ + hid_t did2 = -1; /* dataset */ + hsize_t start; /* hyperslab start */ + hsize_t stride; /* hyperslab count */ + hsize_t count; /* hyperslab count */ + hsize_t block; /* hyperslab count */ + hsize_t dims; /* dataset size */ + hsize_t max_dims; /* dataset max size */ + H5D_vds_view_t view; /* view from dapl */ + hsize_t gap_size; /* gap size from dapl */ + char filename[1024]; /* file names */ TESTING("H5Dget_access_plist() returns dapl w/ correct values"); @@ -11221,6 +11239,7 @@ test_dapl_values(hid_t fapl_id) if(H5Pget_virtual_printf_gap(dapl_id2, &gap_size) < 0) FAIL_STACK_ERROR if(gap_size != 123) + TEST_ERROR /* Close everything */ if(H5Sclose(vds_sid) < 0) FAIL_STACK_ERROR diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 58135b7..298d326 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TEST_PAR) #----------------------------------------------------------------------------- @@ -54,6 +54,6 @@ set (H5P_TESTS foreach (testp ${H5P_TESTS}) ADD_H5P_EXE(${testp}) -endforeach (testp ${H5P_TESTS}) +endforeach () include (CMakeTests.cmake) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index 3716ee6..7dce6d6 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -9,7 +9,7 @@ add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEX foreach (testp ${H5P_TESTS}) add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) -endforeach (testp ${H5P_TESTS}) +endforeach () # The following will only be correct on windows shared #set_tests_properties (TEST_PAR_t_pflush1 PROPERTIES WILL_FAIL "true") @@ -31,16 +31,16 @@ if (HDF5_TEST_VFD) t_pflush1 t_pflush2 ) - + if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) - endif (DIRECT_VFD) + endif () - MACRO (ADD_VFD_TEST vfdname resultcode) + macro (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) foreach (test ${H5P_VFD_TESTS}) add_test ( - NAME TEST_PAR_VFD-${vfdname}-${test} + NAME TEST_PAR_VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" @@ -50,13 +50,13 @@ if (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) - endforeach (test ${H5P_VFD_TESTS}) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_VFD_TEST) - + endforeach () + endif () + endmacro () + # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - endforeach (vfd ${VFD_LIST}) + endforeach () -endif (HDF5_TEST_VFD) +endif () diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 8753325..bfa4c8f 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -333,7 +333,7 @@ struct mssg_t haddr_t base_addr; unsigned len; int ver; - int count; + unsigned count; unsigned magic; }; @@ -410,7 +410,8 @@ static herr_t datum_notify(H5C_notify_action_t action, void *thing); static herr_t datum_free_icr(void * thing); -#define DATUM_ENTRY_TYPE H5AC_TEST_ID +/* Masquerade as object header entries to the cache */ +#define DATUM_ENTRY_TYPE H5AC_OHDR_ID #define NUMBER_OF_ENTRY_TYPES 1 @@ -434,7 +435,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = { /* id */ DATUM_ENTRY_TYPE, /* name */ "datum", - /* mem_type */ H5FD_MEM_DEFAULT, + /* mem_type */ H5FD_MEM_OHDR, /* flags */ H5AC__CLASS_SKIP_READS | H5AC__CLASS_SKIP_WRITES, /* get_initial_load_size */ datum_get_initial_load_size, /* get_final_load_size */ NULL, @@ -484,8 +485,8 @@ static hbool_t take_down_cache(hid_t fid, H5C_t * cache_ptr); static hbool_t verify_entry_reads(haddr_t addr, int expected_entry_reads); static hbool_t verify_entry_writes(haddr_t addr, int expected_entry_writes); static hbool_t verify_total_reads(int expected_total_reads); -static hbool_t verify_total_writes(int expected_total_writes); -static void verify_writes(int num_writes, haddr_t * written_entries_tbl); +static hbool_t verify_total_writes(unsigned expected_total_writes); +static void verify_writes(unsigned num_writes, haddr_t * written_entries_tbl); static void unlock_entry(H5F_t * file_ptr, int32_t type, unsigned int flags); static void unpin_entry(H5F_t * file_ptr, int32_t idx, hbool_t global, hbool_t dirty, hbool_t via_unprotect); @@ -1213,7 +1214,7 @@ setup_derived_types(void) int result; MPI_Datatype mpi_types[9] = {MPI_INT, MPI_INT, MPI_INT, MPI_LONG, HADDR_AS_MPI_TYPE, MPI_INT, MPI_INT, - MPI_INT, MPI_UNSIGNED}; + MPI_UNSIGNED, MPI_UNSIGNED}; int block_len[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1}; MPI_Aint displs[9]; struct mssg_t sample; /* used to compute displacements */ @@ -4333,15 +4334,13 @@ setup_cache_for_test(hid_t * fid_ptr, * *****************************************************************************/ static void -verify_writes(int num_writes, - haddr_t * written_entries_tbl) +verify_writes(unsigned num_writes, haddr_t *written_entries_tbl) { const hbool_t report = FALSE; hbool_t proceed = TRUE; - int i = 0; + unsigned u = 0; HDassert( world_mpi_rank != world_server_mpi_rank ); - HDassert( num_writes >= 0 ); HDassert( ( num_writes == 0 ) || ( written_entries_tbl != NULL ) ); @@ -4361,15 +4360,12 @@ verify_writes(int num_writes, } } - if ( proceed ) { - + if(proceed) proceed = verify_total_writes(num_writes); - } - while ( ( proceed ) && ( i < num_writes ) ) - { - proceed = verify_entry_writes(written_entries_tbl[i], 1); - i++; + while(proceed && u < num_writes) { + proceed = verify_entry_writes(written_entries_tbl[u], 1); + u++; } /* barrier to ensure that all other processes have finished verifying @@ -4398,12 +4394,12 @@ verify_writes(int num_writes, if ( proceed ) { - HDfprintf(stdout, "%d:%s: verified %d writes.\n", + HDfprintf(stdout, "%d:%s: verified %u writes.\n", world_mpi_rank, FUNC, num_writes); } else { - HDfprintf(stdout, "%d:%s: FAILED to verify %d writes.\n", + HDfprintf(stdout, "%d:%s: FAILED to verify %u writes.\n", world_mpi_rank, FUNC, num_writes); } @@ -4928,10 +4924,10 @@ verify_total_reads(int expected_total_reads) * *****************************************************************************/ static hbool_t -verify_total_writes(int expected_total_writes) +verify_total_writes(unsigned expected_total_writes) { hbool_t success = TRUE; /* will set to FALSE if appropriate. */ - long reported_total_writes; + unsigned reported_total_writes; struct mssg_t mssg; if ( success ) { @@ -4996,7 +4992,7 @@ verify_total_writes(int expected_total_writes) success = FALSE; if ( verbose ) { HDfprintf(stdout, - "%d:%s: reported/expected total writes mismatch (%ld/%ld).\n", + "%d:%s: reported/expected total writes mismatch (%u/%u).\n", world_mpi_rank, FUNC, reported_total_writes, expected_total_writes); } @@ -5318,7 +5314,7 @@ server_smoke_check(void) if ( success ) { - success = verify_total_writes(world_mpi_size - 1); + success = verify_total_writes((unsigned)(world_mpi_size - 1)); } if ( success ) { @@ -5422,7 +5418,7 @@ server_smoke_check(void) if ( success ) { - success = verify_total_writes(world_mpi_size - 1); + success = verify_total_writes((unsigned)(world_mpi_size - 1)); } if ( success ) { diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 4b9b765..4b3b3d5 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- @@ -11,7 +11,7 @@ add_definitions (${HDF_EXTRA_C_FLAGS}) # -------------------------------------------------------------------- if (NOT BUILD_TESTING) add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/lib) -endif (NOT BUILD_TESTING) +endif () #----------------------------------------------------------------------------- # Setup include Directories @@ -24,4 +24,4 @@ add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/src) #-- Add the tests if (BUILD_TESTING) add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/test) -endif (BUILD_TESTING) +endif () diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index bfd1af2..ade7671 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- @@ -63,7 +63,7 @@ if (BUILD_SHARED_LIBS) ) #set_property (TARGET ${HDF5_TOOLS_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS H5DIFF_DEBUG) set (install_targets ${install_targets} ${HDF5_TOOLS_LIBSH_TARGET}) -endif (BUILD_SHARED_LIBS) +endif () ############################################################################## ############################################################################## @@ -89,7 +89,8 @@ install ( if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries) - endif (BUILD_SHARED_LIBS) + endif () + INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries) install ( TARGETS @@ -102,4 +103,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT toolslibraries INCLUDES DESTINATION include ) -endif (HDF5_EXPORTED_TARGETS) +endif () diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 79dc51f..e6ff7e0 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -47,7 +47,7 @@ void do_print_objname (const char *OBJ, const char *path1, const char *path2, di { /* if verbose level is higher than 0, put space line before * displaying any object or symbolic links. This improves - * readability of the output. + * readability of the output. */ if (opts->m_verbose_level >= 1) parallel_print("\n"); @@ -71,7 +71,7 @@ do_print_attrname (const char *attr, const char *path1, const char *path2) * Function: print_warn * * Purpose: check print warning condition. - * Return: + * Return: * 1 if verbose mode * 0 if not verbos mode * Programmer: Jonathan Kim @@ -146,7 +146,7 @@ static void print_incoming_data(void) * * Purpose: check if options are valid * - * Return: + * Return: * 1 : Valid * 0 : Not valid * @@ -189,10 +189,10 @@ out: * * Purpose: check if 'paths' are part of exclude path list * - * Return: + * Return: * 1 - excluded path * 0 - not excluded path - * + * * Programmer: Jonathan Kim * Date: Aug 23, 2010 *------------------------------------------------------------------------*/ @@ -221,11 +221,11 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options { size_t len_grp; - /* check if given path belong to an excluding group, if so + /* check if given path belong to an excluding group, if so * exclude it as well. * This verifies if “/grp1/dset1†is only under “/grp1â€, but - * not under “/grp1xxx/†group. - */ + * not under “/grp1xxx/†group. + */ len_grp = HDstrlen(exclude_path_ptr->obj_path); if (path[len_grp] == '/') { @@ -236,15 +236,15 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options } } /* exclude target is not group, just exclude the object */ - else + else { ret_cmp = HDstrcmp(exclude_path_ptr->obj_path, path); if (ret_cmp == 0) /* found matching object */ { /* excluded non-group object */ ret = 1; - /* remember the type of this maching object. - * if it's group, it can be used for excluding its member + /* remember the type of this maching object. + * if it's group, it can be used for excluding its member * objects in this while() loop */ exclude_path_ptr->obj_type = type; break; /* while */ @@ -339,7 +339,7 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch path2_lp = (info2->paths[curr2].path) + path2_offset; type1_l = info1->paths[curr1].type; type2_l = info2->paths[curr2].type; - + /* criteria is string compare */ cmp = HDstrcmp(path1_lp, path2_lp); @@ -410,7 +410,7 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch if (!is_exclude_path(path2_lp, type2_l, options)) { trav_table_addflags(infile, path2_lp, info2->paths[curr2].type, table); - } + } curr2++; } /* end while */ @@ -424,8 +424,8 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch /*------------------------------------------------------------------------- * Function: trav_grp_objs * - * Purpose: - * Call back function from h5trav_visit(). + * Purpose: + * Call back function from h5trav_visit(). * * Programmer: Jonathan Kim * @@ -437,22 +437,22 @@ static herr_t trav_grp_objs(const char *path, const H5O_info_t *oinfo, trav_info_visit_obj(path, oinfo, already_visited, udata); return 0; -} +} /*------------------------------------------------------------------------- * Function: trav_grp_symlinks * - * Purpose: - * Call back function from h5trav_visit(). + * Purpose: + * Call back function from h5trav_visit(). * Track and extra checkings while visiting all symbolic-links. * * Programmer: Jonathan Kim * * Date: Aug 16, 2010 *------------------------------------------------------------------------*/ -static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, +static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, void *udata) -{ +{ trav_info_t *tinfo = (trav_info_t *)udata; diff_opt_t *opts = (diff_opt_t *)tinfo->opts; int ret; @@ -482,18 +482,18 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) - opts->err_stat = 1; /* make dgangling link is error */ + opts->err_stat = 1; /* make dangling link is error */ goto done; } - /* check if already visit the target object */ - if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path)) + /* check if already visit the target object */ + if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path)) goto done; /* add this link as visited link */ - if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path) < 0) + if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path) < 0) goto done; - + if(h5trav_visit(tinfo->fid, path, TRUE, TRUE, trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { @@ -502,8 +502,8 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, goto done; } break; - - case H5L_TYPE_EXTERNAL: + + case H5L_TYPE_EXTERNAL: ret = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links); /* error */ if (ret < 0) @@ -514,21 +514,21 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) - opts->err_stat = 1; /* make dgangling link is error */ + opts->err_stat = 1; /* make dangling link is error */ goto done; } - if(H5Lunpack_elink_val(lnk_info.trg_path, linfo->u.val_size, NULL, &ext_fname, &ext_path) < 0) + if(H5Lunpack_elink_val(lnk_info.trg_path, linfo->u.val_size, NULL, &ext_fname, &ext_path) < 0) goto done; - /* check if already visit the target object */ - if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path)) + /* check if already visit the target object */ + if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path)) goto done; /* add this link as visited link */ - if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path) < 0) + if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path) < 0) goto done; - + if(h5trav_visit(tinfo->fid, path, TRUE, TRUE, trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { @@ -548,11 +548,11 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, break; } /* end of switch */ -done: +done: if (lnk_info.trg_path) HDfree(lnk_info.trg_path); return 0; -} +} /*------------------------------------------------------------------------- @@ -630,7 +630,7 @@ hsize_t h5diff(const char *fname1, H5E_BEGIN_TRY { /* open file 1 */ - if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) + if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname1); options->err_stat = 1; @@ -639,7 +639,7 @@ hsize_t h5diff(const char *fname1, /* open file 2 */ - if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) + if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname2); options->err_stat = 1; @@ -704,14 +704,14 @@ hsize_t h5diff(const char *fname1, else { /* check if link itself exist */ - if(H5Lexists(file1_id, obj1fullname, H5P_DEFAULT) <= 0) + if(H5Lexists(file1_id, obj1fullname, H5P_DEFAULT) <= 0) { parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1); options->err_stat = 1; goto out; } /* get info from link */ - if(H5Lget_info(file1_id, obj1fullname, &src_linfo1, H5P_DEFAULT) < 0) + if(H5Lget_info(file1_id, obj1fullname, &src_linfo1, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj1fullname); goto out; @@ -719,7 +719,7 @@ hsize_t h5diff(const char *fname1, info1_lp = info1_obj; - /* + /* * check the type of specified path for hard and symbolic links */ if(src_linfo1.type == H5L_TYPE_HARD) @@ -764,14 +764,14 @@ hsize_t h5diff(const char *fname1, else { /* check if link itself exist */ - if(H5Lexists(file2_id, obj2fullname, H5P_DEFAULT) <= 0) + if(H5Lexists(file2_id, obj2fullname, H5P_DEFAULT) <= 0) { parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); options->err_stat = 1; goto out; } /* get info from link */ - if(H5Lget_info(file2_id, obj2fullname, &src_linfo2, H5P_DEFAULT) < 0) + if(H5Lget_info(file2_id, obj2fullname, &src_linfo2, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj2fullname); goto out; @@ -779,7 +779,7 @@ hsize_t h5diff(const char *fname1, info2_lp = info2_obj; - /* + /* * check the type of specified path for hard and symbolic links */ if(src_linfo2.type == H5L_TYPE_HARD) @@ -811,7 +811,7 @@ hsize_t h5diff(const char *fname1, obj2type = H5TRAV_TYPE_UDLINK; trav_info_add(info2_obj, obj2fullname, obj2type); } - } + } } /* if no object specified */ else @@ -830,7 +830,7 @@ hsize_t h5diff(const char *fname1, l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, options->follow_links); /*--------------------------------------------- - * check for following symlinks + * check for following symlinks */ if (options->follow_links) { @@ -915,7 +915,7 @@ hsize_t h5diff(const char *fname1, } } } - else if(l_ret2 < 0) /* fail */ + else if(l_ret2 < 0) /* fail */ { parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); options->err_stat = 1; @@ -936,11 +936,11 @@ hsize_t h5diff(const char *fname1, } } /* end of if follow symlinks */ - /* + /* * If verbose options is not used, don't need to traverse through the list * of objects in the group to display objects information, - * So use h5tools_is_obj_same() to improve performance by skipping - * comparing details of same objects. + * So use h5tools_is_obj_same() to improve performance by skipping + * comparing details of same objects. */ if(!(options->m_verbose || options->m_report)) @@ -1087,10 +1087,10 @@ out: /*------------------------------------------------------------------------- * Function: diff_match * - * Purpose: - * Compare common objects in given groups according to table structure. - * The table structure has flags which can be used to find common objects - * and will be compared. + * Purpose: + * Compare common objects in given groups according to table structure. + * The table structure has flags which can be used to find common objects + * and will be compared. * Common object means same name (absolute path) objects in both location. * * Return: Number of differences found @@ -1126,7 +1126,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, h5difftrace("diff_match start\n"); - /* + /* * if not root, prepare object name to be pre-appended to group path to * make full path */ @@ -1141,8 +1141,8 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, * 2) the graph must match, i.e same names (absolute path) * 3) objects with the same name must be of the same type *------------------------------------------------------------------------- - */ - + */ + /* not valid compare used when --exclude-path option is used */ if (!options->exclude_path) { @@ -1152,7 +1152,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, options->contents = 0; } } - + /* objects in one file and not the other */ for( i = 0; i < table->nobjs; i++) { @@ -1209,7 +1209,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, #endif /* H5_HAVE_ASPRINTF */ /* get index to figure out type of the object in file1 */ - while(info1->paths[idx1].path && + while(info1->paths[idx1].path && (HDstrcmp(obj1_fullpath, info1->paths[idx1].path) != 0)) idx1++; /* get index to figure out type of the object in file2 */ @@ -1226,7 +1226,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, if(!g_Parallel) { nfound += diff(file1_id, obj1_fullpath, - file2_id, obj2_fullpath, + file2_id, obj2_fullpath, options, &argdata); } /* end if */ #ifdef H5_HAVE_PARALLEL @@ -1244,7 +1244,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, */ /*Set up args to pass to worker task. */ - if(HDstrlen(obj1_fullpath) > 255 || + if(HDstrlen(obj1_fullpath) > 255 || HDstrlen(obj2_fullpath) > 255) { printf("The parallel diff only supports object names up to 255 characters\n"); @@ -1401,7 +1401,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, #endif /* H5_HAVE_PARALLEL */ if(obj1_fullpath) HDfree(obj1_fullpath); - if(obj2_fullpath) + if(obj2_fullpath) HDfree(obj2_fullpath); } /* end if */ } /* end for */ @@ -1568,14 +1568,14 @@ hsize_t diff(hid_t file1_id, if(print_warn(options)) linkinfo1.opt.msg_mode = linkinfo2.opt.msg_mode = 1; - /* for symbolic links, take care follow symlink and no dangling link + /* for symbolic links, take care follow symlink and no dangling link * options */ - if (argdata->type[0] == H5TRAV_TYPE_LINK || + if (argdata->type[0] == H5TRAV_TYPE_LINK || argdata->type[0] == H5TRAV_TYPE_UDLINK || - argdata->type[1] == H5TRAV_TYPE_LINK || + argdata->type[1] == H5TRAV_TYPE_LINK || argdata->type[1] == H5TRAV_TYPE_UDLINK ) { - /* + /* * check dangling links for path1 and path2 */ @@ -1586,7 +1586,7 @@ hsize_t diff(hid_t file1_id, { if (options->no_dangle_links) { - /* gangling link is error */ + /* dangling link is error */ if(options->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path1); goto out; @@ -1604,7 +1604,7 @@ hsize_t diff(hid_t file1_id, { if (options->no_dangle_links) { - /* gangling link is error */ + /* dangling link is error */ if(options->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path2); goto out; @@ -1614,7 +1614,7 @@ hsize_t diff(hid_t file1_id, } else if (ret < 0) goto out; - + /* found dangling link */ if (is_dangle_link1 || is_dangle_link2) goto out2; @@ -1637,7 +1637,7 @@ hsize_t diff(hid_t file1_id, if (options->m_verbose||options->m_list_not_cmp) { parallel_print("Not comparable: <%s> is of type %s and <%s> is of type %s\n", - path1, get_type(argdata->type[0]), + path1, get_type(argdata->type[0]), path2, get_type(argdata->type[1])); } options->not_cmp=1; @@ -1648,11 +1648,11 @@ hsize_t diff(hid_t file1_id, } else /* now both object types are same */ object_type = argdata->type[0]; - - /* + + /* * If both points to the same target object, skip comparing details inside * of the objects to improve performance. - * Always check for the hard links, otherwise if follow symlink option is + * Always check for the hard links, otherwise if follow symlink option is * specified. * * Perform this to match the outputs as bypassing. @@ -1672,7 +1672,7 @@ hsize_t diff(hid_t file1_id, { case H5TRAV_TYPE_DATASET: do_print_objname("dataset", path1, path2, options); - break; + break; case H5TRAV_TYPE_NAMED_DATATYPE: do_print_objname("datatype", path1, path2, options); break; @@ -1687,7 +1687,7 @@ hsize_t diff(hid_t file1_id, do_print_objname("external link", path1, path2, options); else do_print_objname ("user defined link", path1, path2, options); - break; + break; case H5TRAV_TYPE_UNKNOWN: default: parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n", @@ -1735,14 +1735,14 @@ hsize_t diff(hid_t file1_id, if (nfound) { do_print_objname("dataset", path1, path2, options); - print_found(nfound); + print_found(nfound); } } /*--------------------------------------------------------- * compare attributes - * if condition refers to cases when the dataset is a + * if condition refers to cases when the dataset is a * referenced object *--------------------------------------------------------- */ @@ -1781,7 +1781,7 @@ hsize_t diff(hid_t file1_id, /*----------------------------------------------------------------- * compare attributes - * the if condition refers to cases when the dataset is a + * the if condition refers to cases when the dataset is a * referenced object *----------------------------------------------------------------- */ @@ -1813,7 +1813,7 @@ hsize_t diff(hid_t file1_id, /*----------------------------------------------------------------- * compare attributes - * the if condition refers to cases when the dataset is a + * the if condition refers to cases when the dataset is a * referenced object *----------------------------------------------------------------- */ @@ -1855,10 +1855,10 @@ hsize_t diff(hid_t file1_id, case H5TRAV_TYPE_UDLINK: { /* Only external links will have a query function registered */ - if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) + if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) { /* If the buffers are the same size, compare them */ - if(linkinfo1.linfo.u.val_size == linkinfo2.linfo.u.val_size) + if(linkinfo1.linfo.u.val_size == linkinfo2.linfo.u.val_size) { ret = HDmemcmp(linkinfo1.trg_path, linkinfo2.trg_path, linkinfo1.linfo.u.val_size); } @@ -1866,7 +1866,7 @@ hsize_t diff(hid_t file1_id, ret = 1; /* if "linkinfo1.trg_path" != "linkinfo2.trg_path" then the links - * are "different" extlinkinfo#.path is combination string of + * are "different" extlinkinfo#.path is combination string of * file_name and obj_name */ nfound = (ret != 0) ? 1 : 0; @@ -1875,7 +1875,7 @@ hsize_t diff(hid_t file1_id, do_print_objname("external link", path1, path2, options); } /* end if */ - else + else { /* If one or both of these links isn't an external link, we can only * compare information from H5Lget_info since we don't have a query @@ -1884,7 +1884,7 @@ hsize_t diff(hid_t file1_id, * If the link classes or the buffer length are not the * same, the links are "different" */ - if((linkinfo1.linfo.type != linkinfo2.linfo.type) || + if((linkinfo1.linfo.type != linkinfo2.linfo.type) || (linkinfo1.linfo.u.val_size != linkinfo2.linfo.u.val_size)) nfound = 1; else @@ -1922,7 +1922,7 @@ out: out2: /*----------------------------------- - * handle dangling link(s) + * handle dangling link(s) */ /* both path1 and path2 are dangling links */ if(is_dangle_link1 && is_dangle_link2) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 9aadffe..e066937 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -130,7 +130,7 @@ typedef struct mcomp_t { unsigned n; /* number of members */ hid_t *ids; /* member type id */ - size_t *offsets; + size_t *offsets; struct mcomp_t **m; /* members */ }mcomp_t; @@ -546,7 +546,7 @@ hsize_t diff_array( void *_mem1, * Recursively call this function for each element * H5T_STRING * compare byte by byte in a cycle from 0 to type_size. this type_size is the - * value obtained by the get_size function but it is the string lenght for + * value obtained by the get_size function but it is the string length for * variable sized strings * H5T_OPAQUE * compare byte by byte in a cycle from 0 to type_size @@ -602,7 +602,7 @@ static hsize_t diff_datum(void *_mem1, /* Fast comparison first for atomic type by memcmp(). * It is OK not to list non-atomic type here because it will not be caught - * by the confition, but it gives more clarity for code planning + * by the condition, but it gives more clarity for code planning */ if (type_class != H5T_REFERENCE && type_class != H5T_COMPOUND && @@ -692,6 +692,13 @@ static hsize_t diff_datum(void *_mem1, * of length of strings. * For now mimic the previous way. */ + h5diffdebug2("diff_datum string size:%d\n",size1); + h5diffdebug2("diff_datum string size:%d\n",size2); + if(size1 != size2) + { + h5difftrace("diff_datum string sizes\n"); + nfound++; + } if(size1 < size2) { size = size1; @@ -712,7 +719,7 @@ static hsize_t diff_datum(void *_mem1, pad = H5Tget_strpad(m_type); - for (u=0; um[u] = (mcomp_t *)HDmalloc(sizeof(mcomp_t)); HDmemset(members->m[u], 0, sizeof(mcomp_t)); get_member_types(members->ids[u], members->m[u]); - } + } } - + return; diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 63f1483..aca8d02 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -89,6 +89,9 @@ hsize_t diff_dataset( hid_t file1_id, obj2_name, options); } + else + goto error; + /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 67585d1..a673d15 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -31,73 +31,73 @@ #include "H5private.h" h5tool_format_t h5tools_dataformat = { -0, /*raw */ - -"", /*fmt_raw */ -"%d", /*fmt_int */ -"%u", /*fmt_uint */ -"%hhd", /*fmt_schar */ -"%u", /*fmt_uchar */ -"%d", /*fmt_short */ -"%u", /*fmt_ushort */ -"%ld", /*fmt_long */ -"%lu", /*fmt_ulong */ -NULL, /*fmt_llong */ -NULL, /*fmt_ullong */ -"%g", /*fmt_double */ -"%g", /*fmt_float */ - -0, /*ascii */ -0, /*str_locale */ -0, /*str_repeat */ - -"[ ", /*arr_pre */ -",", /*arr_sep */ -" ]", /*arr_suf */ -1, /*arr_linebreak */ - -"", /*cmpd_name */ -",\n", /*cmpd_sep */ -"{", /*cmpd_pre */ -"}", /*cmpd_suf */ -"\n", /*cmpd_end */ -NULL, /* cmpd_listv */ - -", ", /*vlen_sep */ -"(", /*vlen_pre */ -")", /*vlen_suf */ -"", /*vlen_end */ - -"%s", /*elmt_fmt */ -",", /*elmt_suf1 */ -" ", /*elmt_suf2 */ - -"", /*idx_n_fmt */ -"", /*idx_sep */ -"", /*idx_fmt */ - -80, /*line_ncols *//*standard default columns */ -0, /*line_per_line */ -"", /*line_pre */ -"%s", /*line_1st */ -"%s", /*line_cont */ -"", /*line_suf */ -"", /*line_sep */ -1, /*line_multi_new */ -" ", /*line_indent */ - -1, /*skip_first */ - -1, /*obj_hidefileno */ -" "H5_PRINTF_HADDR_FMT, /*obj_format */ - -1, /*dset_hidefileno */ -"DATASET %s ", /*dset_format */ -"%s", /*dset_blockformat_pre */ -"%s", /*dset_ptformat_pre */ -"%s", /*dset_ptformat */ -1, /*array indices */ -1 /*escape non printable characters */ + 0, /*raw */ + + "", /*fmt_raw */ + "%d", /*fmt_int */ + "%u", /*fmt_uint */ + "%hhd", /*fmt_schar */ + "%u", /*fmt_uchar */ + "%d", /*fmt_short */ + "%u", /*fmt_ushort */ + "%ld", /*fmt_long */ + "%lu", /*fmt_ulong */ + NULL, /*fmt_llong */ + NULL, /*fmt_ullong */ + "%g", /*fmt_double */ + "%g", /*fmt_float */ + + 0, /*ascii */ + 0, /*str_locale */ + 0, /*str_repeat */ + + "[ ", /*arr_pre */ + ",", /*arr_sep */ + " ]", /*arr_suf */ + 1, /*arr_linebreak */ + + "", /*cmpd_name */ + ",\n", /*cmpd_sep */ + "{", /*cmpd_pre */ + "}", /*cmpd_suf */ + "\n", /*cmpd_end */ + NULL, /* cmpd_listv */ + + ", ", /*vlen_sep */ + "(", /*vlen_pre */ + ")", /*vlen_suf */ + "", /*vlen_end */ + + "%s", /*elmt_fmt */ + ",", /*elmt_suf1 */ + " ", /*elmt_suf2 */ + + "", /*idx_n_fmt */ + "", /*idx_sep */ + "", /*idx_fmt */ + + 80, /*line_ncols *//*standard default columns */ + 0, /*line_per_line */ + "", /*line_pre */ + "%s", /*line_1st */ + "%s", /*line_cont */ + "", /*line_suf */ + "", /*line_sep */ + 1, /*line_multi_new */ + " ", /*line_indent */ + + 1, /*skip_first */ + + 1, /*obj_hidefileno */ + " "H5_PRINTF_HADDR_FMT, /*obj_format */ + + 1, /*dset_hidefileno */ + "DATASET %s ", /*dset_format */ + "%s", /*dset_blockformat_pre */ + "%s", /*dset_ptformat_pre */ + "%s", /*dset_ptformat */ + 1, /*array indices */ + 1 /*escape non printable characters */ }; const h5tools_dump_header_t h5tools_standardformat = { diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt index 5001b26..37680dd 100644 --- a/tools/src/CMakeLists.txt +++ b/tools/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_SRC) #----------------------------------------------------------------------------- diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index 2a33c9e..d1f5f50 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_SRC_H5COPY) #----------------------------------------------------------------------------- @@ -18,6 +18,17 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5copy") set (H5_DEP_EXECUTABLES h5copy) +if (BUILD_SHARED_LIBS) + add_executable (h5copy-shared ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) + TARGET_NAMING (h5copy-shared SHARED) + TARGET_C_PROPERTIES (h5copy-shared SHARED " " " ") + target_link_libraries (h5copy-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5copy-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5copy-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5copy-shared) +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### @@ -27,13 +38,17 @@ set (H5_DEP_EXECUTABLES h5copy) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5copy-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endif () + INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5copy - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) + install ( + TARGETS + ${H5_DEP_EXECUTABLES} + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index 85a24ef..00d93de 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_SRC_H5DIFF) #----------------------------------------------------------------------------- @@ -21,6 +21,20 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5diff") set (H5_DEP_EXECUTABLES h5diff) +if (BUILD_SHARED_LIBS) + add_executable (h5diff-shared + ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c + ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c + ) + TARGET_NAMING (h5diff-shared SHARED) + TARGET_C_PROPERTIES (h5diff-shared SHARED " " " ") + target_link_libraries (h5diff-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5diff-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5diff-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5diff-shared) +endif () + if (H5_HAVE_PARALLEL) add_executable (ph5diff ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c @@ -31,7 +45,7 @@ if (H5_HAVE_PARALLEL) target_link_libraries (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (ph5diff PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};ph5diff") -endif (H5_HAVE_PARALLEL) +endif () ############################################################################## ############################################################################## @@ -42,26 +56,29 @@ endif (H5_HAVE_PARALLEL) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- - -#INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5diff - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) - -if (H5_HAVE_PARALLEL) - - #INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5diff-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endif () + INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) install ( TARGETS - ph5diff + ${H5_DEP_EXECUTABLES} EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) -endif (H5_HAVE_PARALLEL) + + if (H5_HAVE_PARALLEL) + #INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) + + install ( + TARGETS + ph5diff + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) + endif () +endif () diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index ab310db..65a7cdd 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_SRC_H5DUMP) #----------------------------------------------------------------------------- @@ -22,6 +22,21 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump") set (H5_DEP_EXECUTABLES h5dump) +if (BUILD_SHARED_LIBS) + add_executable (h5dump-shared + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.c + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c + ) + TARGET_NAMING (h5dump-shared SHARED) + TARGET_C_PROPERTIES (h5dump-shared SHARED " " " ") + target_link_libraries (h5dump-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5dump-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5dump-shared) +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### @@ -31,13 +46,17 @@ set (H5_DEP_EXECUTABLES h5dump) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5dump-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endif () + INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5dump - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) + install ( + TARGETS + ${H5_DEP_EXECUTABLES} + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 5290c3d..8ed88d2 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -69,7 +69,7 @@ static h5tool_format_t xml_dataformat = { "", /*cmpd_pre */ "", /*cmpd_suf */ "", /*cmpd_end */ - "", /*cmpd_listv */ + NULL, /*cmpd_listv */ " ", /*vlen_sep */ " ", /*vlen_pre */ diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index 957055d..fa3abc0 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_SRC_H5FC) #----------------------------------------------------------------------------- @@ -27,13 +27,14 @@ set (H5_DEP_EXECUTABLES h5format_convert) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- +if (HDF5_EXPORTED_TARGETS) + INSTALL_PROGRAM_PDB (h5format_convert ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5format_convert ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5format_convert - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) + install ( + TARGETS + h5format_convert + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () \ No newline at end of file diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index 97ab4ec..9a61beb 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_SRC_H5IMPORT) #----------------------------------------------------------------------------- @@ -28,13 +28,14 @@ set (H5_DEP_EXECUTABLES h5import) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- +if (HDF5_EXPORTED_TARGETS) + INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5import - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) + install ( + TARGETS + h5import + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index cef54c2..3cca771 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_SRC_H5JAM) #----------------------------------------------------------------------------- @@ -37,13 +37,14 @@ set (H5_DEP_EXECUTABLES #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- - -#INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5jam h5unjam - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) +if (HDF5_EXPORTED_TARGETS) + INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR} toolsapplications) + + install ( + TARGETS + h5jam h5unjam + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index 24e11cc..2e23634 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_SRC_H5LS) #----------------------------------------------------------------------------- @@ -16,9 +16,18 @@ target_link_libraries (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5ls PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5ls") -set (H5_DEP_EXECUTABLES - h5ls -) +set (H5_DEP_EXECUTABLES h5ls) + +if (BUILD_SHARED_LIBS) + add_executable (h5ls-shared ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) + TARGET_NAMING (h5ls-shared SHARED) + TARGET_C_PROPERTIES (h5ls-shared SHARED " " " ") + target_link_libraries (h5ls-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5ls-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5ls-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5ls-shared) +endif () ############################################################################## ############################################################################## @@ -29,13 +38,17 @@ set (H5_DEP_EXECUTABLES #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5ls-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endif () + INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5ls - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) + install ( + TARGETS + ${H5_DEP_EXECUTABLES} + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index cb7f5f6..81e6275 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_SRC_H5REPACK) #----------------------------------------------------------------------------- @@ -29,6 +29,17 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repack") set (H5_DEP_EXECUTABLES h5repack) +if (BUILD_SHARED_LIBS) + add_executable (h5repack-shared ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c) + TARGET_NAMING (h5repack-shared SHARED) + TARGET_C_PROPERTIES (h5repack-shared SHARED " " " ") + target_link_libraries (h5repack-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5repack-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repack-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repack-shared) +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### @@ -38,13 +49,17 @@ set (H5_DEP_EXECUTABLES h5repack) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5repack-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endif () + INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5repack - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) + install ( + TARGETS + ${H5_DEP_EXECUTABLES} + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index ef2085c..c79db1c 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -77,27 +77,29 @@ int h5repack(const char* infile, const char* outfile, pack_opt_t *options) { * *------------------------------------------------------------------------- */ -int h5repack_init(pack_opt_t *options, int verbose, hbool_t latest, - H5F_file_space_type_t strategy, hsize_t threshold) { - int k, n; - - HDmemset(options, 0, sizeof(pack_opt_t)); - options->min_comp = 0; - options->verbose = verbose; - options->latest = latest; - options->layout_g = H5D_LAYOUT_ERROR; - - for (n = 0; n < H5_REPACK_MAX_NFILTERS; n++) { - options->filter_g[n].filtn = -1; - options->filter_g[n].cd_nelmts = 0; - for (k = 0; k < CD_VALUES; k++) - options->filter_g[n].cd_values[k] = 0; - } +int +h5repack_init(pack_opt_t *options, int verbose, hbool_t latest, + H5F_file_space_type_t strategy, hsize_t threshold) +{ + int k, n; + + HDmemset(options, 0, sizeof(pack_opt_t)); + options->min_comp = 0; + options->verbose = verbose; + options->latest = latest; + options->layout_g = H5D_LAYOUT_ERROR; + + for (n = 0; n < H5_REPACK_MAX_NFILTERS; n++) { + options->filter_g[n].filtn = -1; + options->filter_g[n].cd_nelmts = 0; + for (k = 0; k < CD_VALUES; k++) + options->filter_g[n].cd_values[k] = 0; + } options->fs_strategy = strategy; options->fs_threshold = threshold; - return (options_table_init(&(options->op_tbl))); + return (options_table_init(&(options->op_tbl))); } /*------------------------------------------------------------------------- diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 547f61a..1519053 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -84,28 +84,18 @@ static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t * * Date: October, 23, 2003 * - * Modification: - * Peter Cao, June 13, 2007 - * Add "-L, --latest" and other options to pack a file with the latest file format - * - * Peter Cao, September 25, 2007 - * Copy user block when repacking a file - * - * Pedro Vicente, August 20, 2008 - * Add a user block to file if requested - * *------------------------------------------------------------------------- */ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t fidin; - hid_t fidout = -1; - trav_table_t *travt = NULL; - hsize_t ub_size = 0; /* size of user block */ - hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */ - hid_t fapl = H5P_DEFAULT; /* file access property list ID */ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t fidin; + hid_t fidout = -1; + trav_table_t *travt = NULL; + hsize_t ub_size = 0; /* size of user block */ + hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */ + hid_t fapl = H5P_DEFAULT; /* file access property list ID */ /*------------------------------------------------------------------------- * open input file diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 657e1a9..1807056 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -52,8 +52,8 @@ static struct long_options l_opts[] = { { "metadata_block_size", require_arg, 'M' }, { "threshold", require_arg, 't' }, { "alignment", require_arg, 'a' }, - { "infile", require_arg, 'i' }, /* -i for backward compability */ - { "outfile", require_arg, 'o' }, /* -o for backward compability */ + { "infile", require_arg, 'i' }, /* -i for backward compability */ + { "outfile", require_arg, 'o' }, /* -o for backward compability */ { "fs_strategy", require_arg, 'S' }, { "fs_threshold", require_arg, 'T' }, { "enable-error-stack", no_arg, 'E' }, @@ -208,14 +208,12 @@ static void usage(const char *prog) { * Programmer: Quincey Koziol * Saturday, 31. January 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ -static void leave(int ret) { - h5tools_close(); - - HDexit(ret); +static void leave(int ret) +{ + h5tools_close(); + HDexit(ret); } /*------------------------------------------------------------------------- @@ -231,11 +229,10 @@ static void leave(int ret) { * *------------------------------------------------------------------------- */ - static -int read_info(const char *filename, pack_opt_t *options) { - - char stype[10]; +int read_info(const char *filename, pack_opt_t *options) +{ + char stype[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; char comp_info[1024]; FILE *fp = NULL; char c; @@ -368,210 +365,204 @@ done: * *------------------------------------------------------------------------- */ - static -int parse_command_line(int argc, const char **argv, pack_opt_t* options) { - - int opt; - int ret_value = 0; - - /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { - switch ((char) opt) { - - /* -i for backward compability */ - case 'i': - infile = opt_arg; - has_i_o = 1; - break; - - /* -o for backward compability */ - case 'o': - outfile = opt_arg; - has_i_o = 1; - break; - - case 'h': - usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_SUCCESS); - ret_value = -1; - goto done; - - case 'V': - print_version(h5tools_getprogname()); - h5tools_setstatus(EXIT_SUCCESS); - ret_value = -1; - goto done; - - case 'v': - options->verbose = 1; - break; - - case 'f': - /* parse the -f filter option */ - if (h5repack_addfilter(opt_arg, options) < 0) { - error_msg("in parsing filter\n"); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - break; - - case 'l': - /* parse the -l layout option */ - if (h5repack_addlayout(opt_arg, options) < 0) { - error_msg("in parsing layout\n"); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - break; - - case 'm': - options->min_comp = HDstrtoull(opt_arg , NULL, 0); - if ((int) options->min_comp <= 0) { - error_msg("invalid minimum compress size <%s>\n", opt_arg); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - break; - - case 'e': - ret_value = read_info(opt_arg, options); - if (ret_value < 0) - goto done; - break; - - case 'n': - options->use_native = 1; - break; - - case 'L': - options->latest = TRUE; - break; - - case 'c': - options->grp_compact = HDatoi( opt_arg ); - if (options->grp_compact > 0) - options->latest = TRUE; /* must use latest format */ - break; - - case 'd': - options->grp_indexed = HDatoi( opt_arg ); - if (options->grp_indexed > 0) - options->latest = TRUE; /* must use latest format */ - break; - - case 's': - { - int idx = 0; - int ssize = 0; - char *msgPtr = HDstrchr( opt_arg, ':'); - options->latest = TRUE; /* must use latest format */ - if (msgPtr == NULL) { - ssize = HDatoi( opt_arg ); - for (idx = 0; idx < 5; idx++) - options->msg_size[idx] = ssize; - } - else { - char msgType[10]; - HDstrcpy(msgType, msgPtr + 1); - msgPtr[0] = '\0'; - ssize = HDatoi( opt_arg ); - if (HDstrncmp(msgType, "dspace",6) == 0) { - options->msg_size[0] = ssize; - } - else if (HDstrncmp(msgType, "dtype", 5) == 0) { - options->msg_size[1] = ssize; - } - else if (HDstrncmp(msgType, "fill", 4) == 0) { - options->msg_size[2] = ssize; - } - else if (HDstrncmp(msgType, "pline", 5) == 0) { - options->msg_size[3] = ssize; - } - else if (HDstrncmp(msgType, "attr", 4) == 0) { - options->msg_size[4] = ssize; - } - } - } - break; - - case 'u': - options->ublock_filename = opt_arg; - break; - - case 'b': - options->ublock_size = (hsize_t) HDatol( opt_arg ); - break; - - case 'M': - options->meta_block_size = (hsize_t) HDatol( opt_arg ); - break; - - case 't': - options->threshold = (hsize_t) HDatol( opt_arg ); - break; - - case 'a': - options->alignment = HDstrtoull(opt_arg , NULL, 0); - if (options->alignment < 1) { - error_msg("invalid alignment size\n", opt_arg); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - break; - - case 'S': - { - char strategy[MAX_NC_NAME]; - - HDstrcpy(strategy, opt_arg); - if (!HDstrcmp(strategy, "ALL_PERSIST")) - options->fs_strategy = H5F_FILE_SPACE_ALL_PERSIST; - else if (!HDstrcmp(strategy, "ALL")) - options->fs_strategy = H5F_FILE_SPACE_ALL; - else if (!HDstrcmp(strategy, "AGGR_VFD")) - options->fs_strategy = H5F_FILE_SPACE_AGGR_VFD; - else if (!HDstrcmp(strategy, "VFD")) - options->fs_strategy = H5F_FILE_SPACE_VFD; - else { - error_msg("invalid file space management strategy\n", opt_arg); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - } - break; - - case 'T': - options->fs_threshold = (hsize_t) HDatol( opt_arg ); - break; - - case 'E': - enable_error_stack = TRUE; - break; +int parse_command_line(int argc, const char **argv, pack_opt_t* options) +{ + int opt; + int ret_value = 0; + + /* parse command line options */ + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + switch ((char) opt) { + + /* -i for backward compability */ + case 'i': + infile = opt_arg; + has_i_o = 1; + break; + + /* -o for backward compability */ + case 'o': + outfile = opt_arg; + has_i_o = 1; + break; + + case 'h': + usage(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + ret_value = -1; + goto done; - default: - break; - } /* switch */ + case 'V': + print_version(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + ret_value = -1; + goto done; + + case 'v': + options->verbose = 1; + break; + case 'f': + /* parse the -f filter option */ + if (h5repack_addfilter(opt_arg, options) < 0) { + error_msg("in parsing filter\n"); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'l': + /* parse the -l layout option */ + if (h5repack_addlayout(opt_arg, options) < 0) { + error_msg("in parsing layout\n"); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'm': + options->min_comp = HDstrtoull(opt_arg , NULL, 0); + if ((int) options->min_comp <= 0) { + error_msg("invalid minimum compress size <%s>\n", opt_arg); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'e': + ret_value = read_info(opt_arg, options); + if (ret_value < 0) + goto done; + break; + + case 'n': + options->use_native = 1; + break; + + case 'L': + options->latest = TRUE; + break; + + case 'c': + options->grp_compact = HDatoi( opt_arg ); + if (options->grp_compact > 0) + options->latest = TRUE; /* must use latest format */ + break; + + case 'd': + options->grp_indexed = HDatoi( opt_arg ); + if (options->grp_indexed > 0) + options->latest = TRUE; /* must use latest format */ + break; + + case 's': + { + int idx = 0; + int ssize = 0; + char *msgPtr = HDstrchr( opt_arg, ':'); + options->latest = TRUE; /* must use latest format */ + if (msgPtr == NULL) { + ssize = HDatoi( opt_arg ); + for (idx = 0; idx < 5; idx++) + options->msg_size[idx] = ssize; + } + else { + char msgType[10]; + + HDstrcpy(msgType, msgPtr + 1); + msgPtr[0] = '\0'; + ssize = HDatoi( opt_arg ); + if (HDstrncmp(msgType, "dspace",6) == 0) + options->msg_size[0] = ssize; + else if (HDstrncmp(msgType, "dtype", 5) == 0) + options->msg_size[1] = ssize; + else if (HDstrncmp(msgType, "fill", 4) == 0) + options->msg_size[2] = ssize; + else if (HDstrncmp(msgType, "pline", 5) == 0) + options->msg_size[3] = ssize; + else if (HDstrncmp(msgType, "attr", 4) == 0) + options->msg_size[4] = ssize; + } + } + break; + + case 'u': + options->ublock_filename = opt_arg; + break; + + case 'b': + options->ublock_size = (hsize_t) HDatol( opt_arg ); + break; + + case 'M': + options->meta_block_size = (hsize_t) HDatol( opt_arg ); + break; + + case 't': + options->threshold = (hsize_t) HDatol( opt_arg ); + break; + + case 'a': + options->alignment = HDstrtoull(opt_arg , NULL, 0); + if (options->alignment < 1) { + error_msg("invalid alignment size\n", opt_arg); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'S': + { + char strategy[MAX_NC_NAME]; + + HDstrcpy(strategy, opt_arg); + if(!HDstrcmp(strategy, "ALL_PERSIST")) + options->fs_strategy = H5F_FILE_SPACE_ALL_PERSIST; + else if(!HDstrcmp(strategy, "ALL")) + options->fs_strategy = H5F_FILE_SPACE_ALL; + else if(!HDstrcmp(strategy, "AGGR_VFD")) + options->fs_strategy = H5F_FILE_SPACE_AGGR_VFD; + else if(!HDstrcmp(strategy, "VFD")) + options->fs_strategy = H5F_FILE_SPACE_VFD; + else { + error_msg("invalid file space management strategy\n", opt_arg); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + } + break; + + case 'T': + options->fs_threshold = (hsize_t) HDatol( opt_arg ); + break; + + case 'E': + enable_error_stack = TRUE; + break; + + default: + break; + } /* switch */ } /* while */ if (has_i_o == 0) { - /* check for file names to be processed */ - if (argc <= opt_ind || argv[opt_ind + 1] == NULL) { - error_msg("missing file names\n"); - usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - } - } + /* check for file names to be processed */ + if (argc <= opt_ind || argv[opt_ind + 1] == NULL) { + error_msg("missing file names\n"); + usage(h5tools_getprogname()); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + } + } done: - return ret_value; + return ret_value; } /*------------------------------------------------------------------------- @@ -591,16 +582,16 @@ done: * *------------------------------------------------------------------------- */ -int main(int argc, const char **argv) { +int main(int argc, const char **argv) +{ + pack_opt_t options; /*the global options */ H5E_auto2_t func; H5E_auto2_t tools_func; void *edata; void *tools_edata; - pack_opt_t options; /*the global options */ - - h5tools_setprogname(PROGRAMNAME); - h5tools_setstatus(EXIT_SUCCESS); + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); /* Disable error reporting */ H5Eget_auto2(H5E_DEFAULT, &func, &edata); @@ -653,12 +644,12 @@ int main(int argc, const char **argv) { } /* pack it */ - h5tools_setstatus(h5repack(infile, outfile, &options)); + h5tools_setstatus(h5repack(infile, outfile, &options)); done: - /* free tables */ - h5repack_end(&options); + /* free tables */ + h5repack_end(&options); - leave(h5tools_getstatus()); + leave(h5tools_getstatus()); } diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index 004b9e4..6759169 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -47,9 +47,9 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, int k, l, p, q, end_obj = -1, no_param = 0; unsigned j, n; char sobj[MAX_NC_NAME]; - char scomp[10]; - char stype[6]; - char smask[3]; + char scomp[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + char stype[6] = {0, 0, 0, 0, 0, 0}; + char smask[3] = {0, 0, 0}; obj_list_t* obj_list = NULL; unsigned pixels_per_block; @@ -396,6 +396,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, error_msg("invalid filter type in <%s>\n", str); HDexit(EXIT_FAILURE); } + break; } } /*i*/ diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c index 6765c49..58dea03 100644 --- a/tools/src/h5repack/h5repack_verify.c +++ b/tools/src/h5repack/h5repack_verify.c @@ -39,11 +39,6 @@ static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *fil * Programmer: Pedro Vicente, pvn@hdfgroup.org * * Date: December 19, 2003 - * Modified: December, 19, 2007 (exactly 4 years later :-) ) - * Separate into 3 cases - * 1) no filter input, get all datasets and compare DCPLs. TO DO - * 2) filter input on selected datasets, get each one trough OBJ and match - * 3) filter input on all datasets, get all objects and match * *------------------------------------------------------------------------- */ @@ -51,8 +46,8 @@ static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *fil int h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t fidin = -1; /* file ID for input file*/ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t fidin = -1; /* file ID for input file*/ hid_t fidout = -1; /* file ID for output file*/ hid_t did = -1; /* dataset ID */ hid_t pid = -1; /* dataset creation property list ID */ diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index d4e14cb..9762dbb 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_SRC_H5STAT) #----------------------------------------------------------------------------- @@ -18,6 +18,17 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5stat") set (H5_DEP_EXECUTABLES h5stat) +if (BUILD_SHARED_LIBS) + add_executable (h5stat-shared ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) + TARGET_NAMING (h5stat-shared SHARED) + TARGET_C_PROPERTIES (h5stat-shared SHARED " " " ") + target_link_libraries (h5stat-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5stat-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5stat-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5stat-shared) +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### @@ -27,13 +38,17 @@ set (H5_DEP_EXECUTABLES h5stat) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5stat-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) + endif () + INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5stat - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) + install ( + TARGETS + ${H5_DEP_EXECUTABLES} + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 0bda701..1292628 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_SRC_MISC) #----------------------------------------------------------------------------- @@ -50,7 +50,7 @@ set (H5_DEP_EXECUTABLES #----------------------------------------------------------------------------- #if (NOT WIN32) # configure_file (${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) -#endif (NOT WIN32) +#endif () ############################################################################## ############################################################################## @@ -61,15 +61,16 @@ set (H5_DEP_EXECUTABLES #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- +if (HDF5_EXPORTED_TARGETS) + INSTALL_PROGRAM_PDB (h5debug ${HDF5_INSTALL_BIN_DIR} toolsapplications) + INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR} toolsapplications) + INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5debug ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR} toolsapplications) -#INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR} toolsapplications) - -install ( - TARGETS - h5debug h5repart h5mkgrp - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications -) + install ( + TARGETS + h5debug h5repart h5mkgrp + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications + ) +endif () diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt index 608dd6e..a7dd11f 100644 --- a/tools/test/CMakeLists.txt +++ b/tools/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_TEST) #----------------------------------------------------------------------------- diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index 5bab57b..4a519ab 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_TEST_H5COPY) #----------------------------------------------------------------------------- @@ -18,6 +18,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5copygentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () include (CMakeTests.cmake) diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index fe36ca9..42495de 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -24,7 +24,7 @@ foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${listfiles}" NAME) HDFTEST_COPY_FILE("${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5copy_files") - endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach () add_custom_target(h5copy_files ALL COMMENT "Copying files needed by h5copy tests" DEPENDS ${h5copy_files_list}) ############################################################################## @@ -36,7 +36,7 @@ # # Perform h5copy according to passing parmeters # - MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) + macro (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -45,7 +45,7 @@ -E remove ./testfiles/${testname}.out.h5 ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5COPY_F-${testname} @@ -54,10 +54,10 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # resultcode=2 will cause the test to skip the diff test if (NOT ${resultcode} STREQUAL "2") @@ -68,11 +68,11 @@ SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") - endif (${resultcode} STREQUAL "1") - endif (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_F_TEST) + endif () + endif () + endmacro () - MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) + macro (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -81,7 +81,7 @@ -E remove ./testfiles/${testname}.out.h5 ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5COPY-${testname} @@ -90,10 +90,10 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # resultcode=2 will cause the test to skip the diff test if (NOT ${resultcode} STREQUAL "2") @@ -104,11 +104,20 @@ SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - endif (${resultcode} STREQUAL "1") - endif (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_TEST) + endif () + endif () + endmacro () - MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) + macro (ADD_SKIP_H5_TEST testname skipresultfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5COPY-${testname}-${skipresultfile}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname}-${skipresultfile} ${ARGN}" + ) + endif () + endmacro () + + macro (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -117,7 +126,7 @@ -E remove ./testfiles/${testname}.out.h5 ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5COPY-${testname}-prefill @@ -126,10 +135,10 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5COPY-${testname} @@ -145,11 +154,11 @@ SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - endif (${resultcode} STREQUAL "1") - endif (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_TEST2) + endif () + endif () + endmacro () - MACRO (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) + macro (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -158,7 +167,7 @@ -E remove ./testfiles/${testname}.out.h5 ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5COPY_SAME-${testname}-prefill @@ -167,10 +176,10 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () else (HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5COPY_SAME-${testname} @@ -186,25 +195,25 @@ SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") - endif (${resultcode} STREQUAL "1") - endif (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_TEST_SAME) + endif () + endif () + endmacro () # # Similiar to ADD_H5_TEST macro. Compare to outputs from source & target # files instead of checking with h5ls. # - MACRO (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) + macro (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5COPY-CMP-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") - endif (${resultcode} STREQUAL "1") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () # Remove any output file left over from previous test run add_test ( NAME H5COPY-CMP-${testname}-clear-objects @@ -225,8 +234,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_CMP_TEST) + endif () + endmacro () ############################################################################## ############################################################################## @@ -286,18 +295,38 @@ set_tests_properties (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5COPY-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () + +# See which filters are usable (and skip tests for filters we +# don't have). Do this by searching H5pubconf.h to see which +# filters are defined. + +# detect whether the encoder is present. + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif () + + if (H5_HAVE_FILTER_SZIP) + set (USE_FILTER_SZIP "true") + endif () # "Test copying various forms of datasets" ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 -v -s chunk -d chunk) ADD_H5_TEST (compact 0 ${HDF_FILE1}.h5 -v -s compact -d compact) ADD_H5_TEST (compound 0 ${HDF_FILE1}.h5 -v -s compound -d compound) - ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) + + if (USE_FILTER_DEFLATE) + ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) + else () + ADD_H5_TEST (compressed 2 ${HDF_FILE1}.h5 -v -s compressed -d compressed) + endif () + ADD_H5_TEST (named_vl 0 ${HDF_FILE1}.h5 -v -s named_vl -d named_vl) ADD_H5_TEST (nested_vl 0 ${HDF_FILE1}.h5 -v -s nested_vl -d nested_vl) + ADD_H5_TEST (dset_attr 0 ${HDF_FILE1}.h5 -v -s dset_attr -d dset_attr) # "Test copying dataset within group in source file to root of destination" ADD_H5_TEST (simple_top 0 ${HDF_FILE1}.h5 -v -s grp_dsets/simple -d simple_top) @@ -307,24 +336,41 @@ # "Test copying empty, 'full' & 'nested' groups" ADD_H5_TEST (grp_empty 0 ${HDF_FILE1}.h5 -v -s grp_empty -d grp_empty) - ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) - ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) + if (USE_FILTER_DEFLATE) + ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) + ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) + else () + ADD_H5_TEST (grp_dsets 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) + ADD_H5_TEST (grp_nested 2 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) + endif () + ADD_H5_TEST (grp_attr 0 ${HDF_FILE1}.h5 -v -s grp_attr -d grp_attr) # "Test copying dataset within group in source file to group in destination" ADD_H5_TEST2 (simple_group 0 ${HDF_FILE1}.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group) - # "Test copying & renaming group" - ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) - - # "Test copying 'full' group hierarchy into group in destination file" - ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) + if (USE_FILTER_DEFLATE) + # "Test copying & renaming group" + ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) + # "Test copying 'full' group hierarchy into group in destination file" + ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) + else () + # "Test copying & renaming group" + ADD_H5_TEST (grp_rename 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) + # "Test copying 'full' group hierarchy into group in destination file" + ADD_H5_TEST2 (grp_dsets_rename 2 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) + endif () # "Test copying objects into group hier. that doesn't exist yet in destination file" ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B1/simple) ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B2/simple2) ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple) - ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) - ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) + if (USE_FILTER_DEFLATE) + ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) + else () + ADD_H5_TEST (E_F_grp_dsets 2 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested 2 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) + endif () ############# COPY REFERENCES ############## @@ -370,4 +416,8 @@ # - dataset ADD_H5_TEST_SAME (samefile1 0 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp) # - group with some datasets - ADD_H5_TEST_SAME (samefile2 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) + if (USE_FILTER_DEFLATE) + ADD_H5_TEST_SAME (samefile2 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) + else () + ADD_H5_TEST_SAME (samefile2 2 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) + endif () diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in index 6d1478a..dbee089 100644 --- a/tools/test/h5copy/testh5copy.sh.in +++ b/tools/test/h5copy/testh5copy.sh.in @@ -21,6 +21,10 @@ srcdir=@srcdir@ +# Determine which filters are available +USE_FILTER_SZIP="@USE_FILTER_SZIP@" +USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" + # source dirs SRC_TOOLS="$srcdir/../.." SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" @@ -78,7 +82,7 @@ AWK='awk' nerrors=0 verbose=yes -h5haveexitcode=yes # default is yes +h5haveexitcode=yes # default is yes TESTDIR=./testfiles test -d $TESTDIR || mkdir $TESTDIR @@ -111,10 +115,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 @@ -139,13 +143,13 @@ CLEAN_TESTFILES_AND_TESTDIR() # Print a "SKIP" message SKIP() { - TESTING $H5COPY $@ - echo " -SKIP-" + TESTING $H5COPY $@ + echo " -SKIP-" } # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". -TESTING() +TESTING() { SPACES=" " echo "Testing $* $SPACES" |cut -c1-70 |tr -d '\012' @@ -154,7 +158,7 @@ TESTING() # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # -VERIFY() +VERIFY() { SPACES=" " echo "Verifying h5diff output $* $SPACES" | cut -c1-70 | tr -d '\012' @@ -163,7 +167,7 @@ VERIFY() # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # -VERIFY_OUTPUT() +VERIFY_OUTPUT() { SPACES=" " echo "Verifying output files $* $SPACES" | cut -c1-70 | tr -d '\012' @@ -182,7 +186,7 @@ VERIFY_OUTPUT() # $4 is output file # $* everything else arguments for h5copy. -TOOLTEST() +TOOLTEST() { actualout="$TESTDIR/tooltest.actualout" actualerr="$TESTDIR/tooltest.actualerr" @@ -199,7 +203,7 @@ TOOLTEST() fi if [ "$3" = -o ]; then outputfile=$4 - else + else if [ "$1" = -f ]; then outputfile=$6 else @@ -207,7 +211,7 @@ TOOLTEST() fi runh5diff=no fi - + TESTING $H5COPY $@ ( echo "#############################" @@ -223,7 +227,7 @@ TOOLTEST() nerrors="`expr $nerrors + 1`" else echo " PASSED" - + if [ $runh5diff != no ]; then H5DIFFTEST $inputfile $outputfile $7 $9 fi @@ -236,7 +240,7 @@ TOOLTEST() } # TOOLTEST back-to-back -TOOLTEST_PREFILL() +TOOLTEST_PREFILL() { actualout="$TESTDIR/tooltest.actualout" actualerr="$TESTDIR/tooltest.actualerr" @@ -248,21 +252,21 @@ TOOLTEST_PREFILL() fi if [ "$3" = -o ]; then outputfile=$4 - else + else runh5diff=no fi - + grp_name=$5 grp_name2=$6 obj_name=$7 obj_name2=$8 - + TESTING $H5COPY $@ ( echo "#############################" echo " output for '$H5COPY $@'" echo "#############################" - $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name2 + $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name2 ) > $actualout 2> $actualerr RET=$? if [ $RET != 0 ]; then @@ -276,7 +280,7 @@ TOOLTEST_PREFILL() echo "#############################" echo " output for '$H5COPY $@'" echo "#############################" - $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $obj_name -d $obj_name2 + $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $obj_name -d $obj_name2 ) > $actualout 2> $actualerr RET=$? if [ $RET != 0 ]; then @@ -286,11 +290,11 @@ TOOLTEST_PREFILL() nerrors="`expr $nerrors + 1`" else echo " PASSED" - + if [ $runh5diff != no ]; then H5DIFFTEST $inputfile $outputfile $obj_name $obj_name2 fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actualout $actualerr $outputfile @@ -300,7 +304,7 @@ TOOLTEST_PREFILL() } # TOOLTEST back-to-back -TOOLTEST_SAME() +TOOLTEST_SAME() { actualout="$TESTDIR/tooltest.actualout" actualerr="$TESTDIR/tooltest.actualerr" @@ -312,19 +316,19 @@ TOOLTEST_SAME() fi if [ "$3" = -o ]; then outputfile=$4 - else + else runh5diff=no fi - + grp_name=$5 grp_name2=$6 - + TESTING $H5COPY $@ ( echo "#############################" echo " output for '$H5COPY $@'" echo "#############################" - $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name + $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name ) > $actualout 2> $actualerr RET=$? if [ $RET != 0 ]; then @@ -338,7 +342,7 @@ TOOLTEST_SAME() echo "#############################" echo " output for '$H5COPY $@'" echo "#############################" - $RUNSERIAL $H5COPY_BIN -i $outputfile -o $outputfile -v -s $grp_name -d $grp_name2 + $RUNSERIAL $H5COPY_BIN -i $outputfile -o $outputfile -v -s $grp_name -d $grp_name2 ) > $actualout 2> $actualerr RET=$? if [ $RET != 0 ]; then @@ -348,11 +352,11 @@ TOOLTEST_SAME() nerrors="`expr $nerrors + 1`" else echo " PASSED" - + if [ $runh5diff != no ]; then H5DIFFTEST $outputfile $outputfile $grp_name $grp_name2 fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actualout $actualerr $outputfile @@ -389,7 +393,7 @@ CMP_OUTPUT() fi } -TOOLTEST_FAIL() +TOOLTEST_FAIL() { expectout="$TESTDIR/$1" actualout="$TESTDIR/$1.actualout" @@ -433,7 +437,7 @@ TOOLTEST_FAIL() cat $actualout nerrors="`expr $nerrors + 1`" fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then @@ -444,10 +448,10 @@ TOOLTEST_FAIL() # Call the h5diff tool # -H5DIFFTEST() +H5DIFFTEST() { VERIFY $@ - $RUNSERIAL $H5DIFF_BIN -q "$@" + $RUNSERIAL $H5DIFF_BIN -q "$@" RET=$? if [ $RET != 0 ] ; then echo "*FAILED*" @@ -459,10 +463,10 @@ H5DIFFTEST() # Call the h5diff tool with a call that is expected to fail # -H5DIFFTEST_FAIL() +H5DIFFTEST_FAIL() { VERIFY $@ - $RUNSERIAL $H5DIFF_BIN -q "$@" + $RUNSERIAL $H5DIFF_BIN -q "$@" RET=$? if [ $h5haveexitcode = 'yes' -a $RET != 1 ] ; then @@ -478,7 +482,7 @@ H5DIFFTEST_FAIL() # # Assumed arguments: # -COPY_OBJECTS() +COPY_OBJECTS() { TESTFILE="$TESTDIR/h5copytst.h5" @@ -487,7 +491,9 @@ COPY_OBJECTS() TOOLTEST -i $TESTFILE -o $TESTDIR/chunk.out.h5 -v -s chunk -d chunk TOOLTEST -i $TESTFILE -o $TESTDIR/compact.out.h5 -v -s compact -d compact TOOLTEST -i $TESTFILE -o $TESTDIR/compound.out.h5 -v -s compound -d compound +if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST -i $TESTFILE -o $TESTDIR/compressed.out.h5 -v -s compressed -d compressed +fi TOOLTEST -i $TESTFILE -o $TESTDIR/named_vl.out.h5 -v -s named_vl -d named_vl TOOLTEST -i $TESTFILE -o $TESTDIR/nested_vl.out.h5 -v -s nested_vl -d nested_vl TOOLTEST -i $TESTFILE -o $TESTDIR/dset_attr.out.h5 -v -s /dset_attr -d /dset_attr @@ -499,16 +505,19 @@ COPY_OBJECTS() TOOLTEST -i $TESTFILE -o $TESTDIR/dsrename.out.h5 -v -s compound -d rename echo "Test copying empty, 'full' & 'nested' groups" +if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST -i $TESTFILE -o $TESTDIR/grp_empty.out.h5 -v -s grp_empty -d grp_empty +fi TOOLTEST -i $TESTFILE -o $TESTDIR/grp_dsets.out.h5 -v -s grp_dsets -d grp_dsets TOOLTEST -i $TESTFILE -o $TESTDIR/grp_nested.out.h5 -v -s grp_nested -d grp_nested TOOLTEST -i $TESTFILE -o $TESTDIR/grp_attr.out.h5 -v -s grp_attr -d grp_attr +if test $USE_FILTER_DEFLATE = "yes" ; then echo "Test copying dataset within group in source file to group in destination" TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/simple_group.out.h5 grp_dsets grp_dsets /grp_dsets/simple /grp_dsets/simple_group - echo "Test copying & renaming group" TOOLTEST -i $TESTFILE -o $TESTDIR/grp_rename.out.h5 -v -s grp_dsets -d grp_rename +fi echo "Test copying 'full' group hierarchy into group in destination file" TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/grp_dsets_rename.out.h5 grp_dsets grp_rename grp_dsets /grp_rename/grp_dsets @@ -517,15 +526,17 @@ COPY_OBJECTS() TOOLTEST -i $TESTFILE -o $TESTDIR/A_B1_simple.out.h5 -vp -s simple -d /A/B1/simple TOOLTEST -i $TESTFILE -o $TESTDIR/A_B2_simple2.out.h5 -vp -s simple -d /A/B2/simple2 TOOLTEST -i $TESTFILE -o $TESTDIR/C_D_simple.out.h5 -vp -s /grp_dsets/simple -d /C/D/simple +if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST -i $TESTFILE -o $TESTDIR/E_F_grp_dsets.out.h5 -vp -s /grp_dsets -d /E/F/grp_dsets TOOLTEST -i $TESTFILE -o $TESTDIR/G_H_grp_nested.out.h5 -vp -s /grp_nested -d /G/H/grp_nested +fi } # Copy references in various way. # # Assumed arguments: # -COPY_REFERENCES() +COPY_REFERENCES() { TESTFILE="$TESTDIR/h5copy_ref.h5" @@ -538,7 +549,7 @@ COPY_REFERENCES() # # Assumed arguments: # -COPY_EXT_LINKS() +COPY_EXT_LINKS() { TESTFILE="$TESTDIR/h5copy_extlinks_src.h5" @@ -571,7 +582,7 @@ COPY_EXT_LINKS() # # Assumed arguments: # -TEST_MISC() +TEST_MISC() { TESTFILE="$TESTDIR/h5copytst.h5" @@ -579,8 +590,10 @@ TEST_MISC() TOOLTEST_FAIL h5copy_misc1.out -i $TESTFILE -o $TESTDIR/h5copy_misc1.out.h5 -v -s /simple -d /g1/g2/simple echo "Test copying objects to the same file " - TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile1.out.h5 /simple /simple_cp + TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile1.out.h5 /simple /simple_cp +if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile2.out.h5 /grp_dsets /grp_dsets_cp +fi } ############################################################################## @@ -590,7 +603,7 @@ TEST_MISC() COPY_TESTFILES_TO_TESTDIR # Start tests -COPY_OBJECTS +COPY_OBJECTS COPY_REFERENCES COPY_EXT_LINKS TEST_MISC diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index 2507664..f6951a3 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_TEST_H5DIFF) #----------------------------------------------------------------------------- @@ -17,6 +17,34 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5diffgentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () + + #----------------------------------------------------------------------------- + # If plugin library tests can be tested + #----------------------------------------------------------------------------- + set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff") + set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") + set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c) + TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") + target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + + # make plugins dir + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$" + "${CMAKE_BINARY_DIR}/plugins/$" + ) include (CMakeTests.cmake) diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 3687574..ca23677 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -55,6 +55,10 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tmptest2.he5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tmpSingleSiteBethe.reference.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tmpSingleSiteBethe.output.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tudfilter.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tudfilter2.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/diff_strings1.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/diff_strings2.h5 # tools/testfiles/vds ${HDF5_TOOLS_DIR}/testfiles/vds/1_a.h5 ${HDF5_TOOLS_DIR}/testfiles/vds/1_b.h5 @@ -207,6 +211,10 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_518.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_530.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_540.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_60.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_61.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_62.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_63.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_600.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_603.txt @@ -259,6 +267,8 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp1.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp2.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ud.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_udfail.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v1.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v2.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v3.txt @@ -273,6 +283,9 @@ # Make testfiles dir under build dir file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (H5_HAVE_PARALLEL) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles") + endif () # # copy test files from source to build dir @@ -280,6 +293,9 @@ foreach (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) HDFTEST_COPY_FILE("${h5_tstfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5diff_files") + if (H5_HAVE_PARALLEL) + HDFTEST_COPY_FILE("${h5_tstfiles}" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}" "h5diff_files") + endif () endforeach () @@ -290,11 +306,17 @@ foreach (h5_tstfiles ${LIST_WIN_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}w.txt" "${PROJECT_BINARY_DIR}/testfiles/${fname}.txt" "h5diff_files") + if (H5_HAVE_PARALLEL) + HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}w.txt" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}.txt" "h5diff_files") + endif () endforeach () else () foreach (h5_tstfiles ${LIST_WIN_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}.txt" "${PROJECT_BINARY_DIR}/testfiles/${fname}.txt" "h5diff_files") + if (H5_HAVE_PARALLEL) + HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}.txt" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}.txt" "h5diff_files") + endif () endforeach () endif () add_custom_target(h5diff_files ALL COMMENT "Copying files needed by h5diff tests" DEPENDS ${h5diff_files_list}) @@ -305,7 +327,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_TEST resultfile resultcode) + macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DIFF-${resultfile} COMMAND $ ${ARGN}) @@ -316,7 +338,7 @@ if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -329,40 +351,90 @@ -D "TEST_APPEND=EXIT CODE:" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () if (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) endif () - ENDMACRO (ADD_H5_TEST file) + endmacro () - MACRO (ADD_PH5_TEST resultfile resultcode) + macro (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME PH5DIFF-${resultfile} COMMAND $ ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) - set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME PH5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$" -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=P_${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/PAR/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=0" -D "TEST_REFERENCE=${resultfile}.txt" -# -D "TEST_APPEND=EXIT CODE: [0-9]" -# -D "TEST_REF_FILTER=EXIT CODE: 0" - -D "TEST_SKIP_COMPARE=TRUE" - -P "${HDF_RESOURCES_EXT_DIR}/prunTest.cmake" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_REF_APPEND=EXIT CODE: [0-9]" + -D "TEST_REF_FILTER=EXIT CODE: 0" + -D "TEST_SORT_COMPARE=TRUE" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "PH5DIFF-${resultfile}") + endif () + endmacro () + + macro (ADD_H5_UD_TEST testname resultcode resultfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5DIFF_UD-${testname}-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${resultfile}.out + testfiles/${resultfile}.out.err ) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_PH5_TEST file) + if (${resultcode} STREQUAL "2") + add_test ( + NAME H5DIFF_UD-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + else () + add_test ( + NAME H5DIFF_UD-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clearall-objects) + endif () + endmacro () ############################################################################## ############################################################################## @@ -419,6 +491,10 @@ # attrs with verbose option level set (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) set (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) + # strings + set (STRINGS1 diff_strings1.h5) + set (STRINGS2 diff_strings2.h5) + # VDS tests set (FILEV1 1_vds.h5) set (FILEV2 2_vds.h5) @@ -683,6 +759,14 @@ h5diff_530.out.err h5diff_540.out h5diff_540.out.err + h5diff_60.out + h5diff_60.out.err + h5diff_61.out + h5diff_61.out.err + h5diff_62.out + h5diff_62.out.err + h5diff_63.out + h5diff_63.out.err h5diff_600.out h5diff_600.out.err h5diff_601.out @@ -789,9 +873,9 @@ set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5DIFF-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # ############################################################################ # # Common usage @@ -918,6 +1002,13 @@ ADD_H5_TEST (h5diff_58 1 -v ${FILE7} ${FILE8} refreg) # ( HDDFV-7942 ) ADD_H5_TEST (h5diff_59 0 -v ${FILE4} ${FILE4} dset11a dset11b) +# Strings +# ( HDFFV-10128 ) +ADD_H5_TEST (h5diff_60 1 -v ${STRINGS1} ${STRINGS2} string1 string1) +ADD_H5_TEST (h5diff_61 1 -v ${STRINGS1} ${STRINGS2} string2 string2) +ADD_H5_TEST (h5diff_62 1 -v ${STRINGS1} ${STRINGS2} string3 string3) +ADD_H5_TEST (h5diff_63 1 -v ${STRINGS1} ${STRINGS2} string4 string4) + # ############################################################################## # # Error messages # ############################################################################## @@ -1084,8 +1175,7 @@ ADD_H5_TEST (h5diff_103 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/d1 g1/d2) # with --use-system-epsilon for float value. expect less differences -ADD_H5_TEST (h5diff_104 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp1 -g1/fp2) +ADD_H5_TEST (h5diff_104 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp1 g1/fp2) # not comparable -c flag ADD_H5_TEST (h5diff_200 0 ${FILE2} ${FILE2} g2/dset1 g2/dset2) @@ -1376,8 +1466,19 @@ ADD_H5_TEST (h5diff_644 1 -v --use-system-epsilon -d 5 ${FILE1} ${FILE2} /g1/dse ADD_H5_TEST (h5diff_645 1 -v -p 0.05 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) -# VDS +# ############################################################################## +# VDS tests +# ############################################################################## ADD_H5_TEST (h5diff_v1 0 -v ${FILEV1} ${FILEV2}) ADD_H5_TEST (h5diff_v2 0 -r ${FILEV1} ${FILEV2}) ADD_H5_TEST (h5diff_v3 0 -c ${FILEV1} ${FILEV2}) +############################################################################## +### P L U G I N T E S T S +############################################################################## +ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5) +ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5) + +# ############################################################################## +# # END +# ############################################################################## diff --git a/tools/test/h5diff/Makefile.am b/tools/test/h5diff/Makefile.am index c366199..1d700ea 100644 --- a/tools/test/h5diff/Makefile.am +++ b/tools/test/h5diff/Makefile.am @@ -38,6 +38,11 @@ check_PROGRAMS=$(TEST_PROG) check_SCRIPTS=$(TEST_SCRIPT) $(TEST_SCRIPT_PARA) # The parallel test script testph5diff.sh actually depends on testh5diff.sh. SCRIPT_DEPEND=../../src/h5diff/h5diff$(EXEEXT) $(H5PDIFF) ../../src/h5diff/testh5diff.sh +if HAVE_SHARED_CONDITIONAL +if USE_PLUGINS_CONDITIONAL + TEST_SCRIPT += h5diff_plugin.sh +endif +endif # Source files for the program h5diffgentest_SOURCES=h5diffgentest.c @@ -45,9 +50,20 @@ h5diffgentest_SOURCES=h5diffgentest.c # Programs depend on the main HDF5 library and tools library LDADD=$(LIBH5TOOLS) $(LIBHDF5) +if HAVE_SHARED_CONDITIONAL + # Build it as shared library if configure is enabled for shared library. + lib_LTLIBRARIES=libdynlibdiff.la + libdynlibdiff_la_SOURCES=dynlib_diff.c + +install-exec-hook: + $(RM) $(DESTDIR)$(libdir)/*dynlib* +endif + # Temporary files. *.h5 are generated by h5diff. They should # be copied to the testfiles/ directory if update is required CHECK_CLEANFILES+=*.h5 expect_sorted actual_sorted +DISTCLEANFILES=h5diff_plugin.sh + include $(top_srcdir)/config/conclude.am diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 339ff6c..c3b45bc 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -24,9 +24,9 @@ * size of that temporary buffer in bytes. For efficiency's sake, choose the * largest value suitable for your machine (for testing use a small value). */ -/* Maximum size used in a call to malloc for a dataset +/* Maximum size used in a call to malloc for a dataset * NOTE: this value should stay in sync with the value defined in the tools - * library file: h5tools_utils.h + * library file: h5tools_utils.h */ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); @@ -95,6 +95,9 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); /* non-comparable dataset and attribute */ #define NON_COMPARBLES1 "non_comparables1.h5" #define NON_COMPARBLES2 "non_comparables2.h5" +/* string dataset and attribute */ +#define DIFF_STRINGS1 "diff_strings1.h5" +#define DIFF_STRINGS2 "diff_strings2.h5" #define UIMAX 4294967295u /*Maximum value for a variable of type unsigned int */ #define STR_SIZE 3 @@ -159,6 +162,7 @@ static void test_comps_array_vlen (const char *fname, const char *dset, const ch static void test_comps_vlen_arry (const char *fname, const char *dset,const char *attr, int diff, int is_file_new); static void test_data_nocomparables (const char *fname, int diff); static void test_objs_nocomparables (const char *fname1, const char *fname2); +static void test_objs_strings (const char *fname, const char *fname2); /* called by test_attributes() and test_datasets() */ static void write_attr_in(hid_t loc_id,const char* dset_name,hid_t fid,int make_diffs); @@ -214,11 +218,11 @@ int main(void) test_special_datasets(FILE19,0); test_special_datasets(FILE20,1); - /* + /* * Generate 2 files: FILE21 with old format; FILE22 with new format - * Create 2 datasets in each file: - * One dataset: chunked layout, w/o filters, fixed dimension - * One dataset: chunked layout, w/ filters, fixed dimension + * Create 2 datasets in each file: + * One dataset: chunked layout, w/o filters, fixed dimension + * One dataset: chunked layout, w/ filters, fixed dimension */ gen_dataset_idx(FILE21, 0); gen_dataset_idx(FILE22, 1); @@ -244,7 +248,7 @@ int main(void) test_enums(ENUM_INVALID_VALUES); /* ------------------------------------------------- - * Create test files with dataset and attribute with container types + * Create test files with dataset and attribute with container types * (array, vlen) with multiple nested compound types. */ /* file1 */ @@ -259,8 +263,8 @@ int main(void) test_comps_vlen_arry(COMPS_COMPLEX2,"dset4", "attr4", 5, 0); /*------------------------------------------------- - * Create test files with non-comparable dataset and attributes with - * comparable datasets and attributes. All the comparables should display + * Create test files with non-comparable dataset and attributes with + * comparable datasets and attributes. All the comparables should display * differences. */ test_data_nocomparables(NON_COMPARBLES1,0); @@ -269,6 +273,9 @@ int main(void) /* common objects (same name) with different object types. HDFFV-7644 */ test_objs_nocomparables(NON_COMPARBLES1, NON_COMPARBLES2); + /* string dataset and attribute. HDFFV-10028 */ + test_objs_strings(DIFF_STRINGS1, DIFF_STRINGS2); + return 0; } @@ -2120,33 +2127,33 @@ out: * Function: gen_dataset_idx * * Purpose: Create a file with either the new or old format -* Create two datasets in the file: -* one dataset: fixed dimension, chunked layout, w/o filters -* one dataset: fixed dimension, chunked layout, w/ filters +* Create two datasets in the file: +* one dataset: fixed dimension, chunked layout, w/o filters +* one dataset: fixed dimension, chunked layout, w/ filters * *------------------------------------------------------------------------- */ static int gen_dataset_idx(const char *file, int format) { - hid_t fid; /* file id */ - hid_t did, did2; /* dataset id */ - hid_t sid; /* space id */ - hid_t fapl; /* file access property id */ - hid_t dcpl; /* dataset creation property id */ - hsize_t dims[1] = {10}; /* dataset dimension */ - hsize_t c_dims[1] = {2}; /* chunk dimension */ - herr_t status; /* return status */ - int buf[10]; /* data buffer */ - int i; /* local index variable */ + hid_t fid; /* file id */ + hid_t did, did2; /* dataset id */ + hid_t sid; /* space id */ + hid_t fapl; /* file access property id */ + hid_t dcpl; /* dataset creation property id */ + hsize_t dims[1] = {10}; /* dataset dimension */ + hsize_t c_dims[1] = {2}; /* chunk dimension */ + herr_t status; /* return status */ + int buf[10]; /* data buffer */ + int i; /* local index variable */ /* Get a copy of the file aaccess property */ fapl = H5Pcreate(H5P_FILE_ACCESS); /* Set the "use the latest format" bounds for creating objects in the file */ if(format) { - status = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - assert(status >= 0); + status = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + assert(status >= 0); } /* Create a file */ @@ -2155,7 +2162,7 @@ int gen_dataset_idx(const char *file, int format) /* Create data */ for(i = 0; i < 10; i++) - buf[i] = i; + buf[i] = i; /* Set chunk */ dcpl = H5Pcreate(H5P_DATASET_CREATE); @@ -2165,7 +2172,7 @@ int gen_dataset_idx(const char *file, int format) /* Create a 1D dataset */ sid = H5Screate_simple(1, dims, NULL); did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - + /* Write to the dataset */ status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); assert(status >= 0); @@ -4422,8 +4429,8 @@ out: /*------------------------------------------------------------------------- * -* Purpose: -* Create test files with dataset and attribute with container types +* Purpose: +* Create test files with dataset and attribute with container types * (array, vlen) with multiple nested compound types. * * Function: test_comps_array() @@ -4447,7 +4454,7 @@ out: static void test_comps_array (const char *fname, const char *dset, const char *attr,int diff, int is_file_new) { /* sub compound 2 */ - typedef struct { + typedef struct { int i2; float f2; } cmpd2_t; @@ -4469,14 +4476,14 @@ static void test_comps_array (const char *fname, const char *dset, const char *a hid_t tid_attr; hsize_t sdims_dset[] = {SDIM_DSET}; hsize_t sdims_cmpd_arry[] = {SDIM_CMPD_ARRAY}; - int i,j; + int i,j; herr_t ret; /* Generic return value */ /* Initialize array data to write */ for(i=0; i < SDIM_DSET; i++) { wdata[i].i1 = i; - for(j=0; j < SDIM_CMPD_ARRAY; j++) + for(j=0; j < SDIM_CMPD_ARRAY; j++) { wdata[i].cmpd2[j].i2 = i * 10 + diff; wdata[i].cmpd2[j].f2 = (float)i * 10.5F + (float)diff; @@ -4520,7 +4527,7 @@ static void test_comps_array (const char *fname, const char *dset, const char *a /* ------------------- - * Create a dataset + * Create a dataset */ /* Create dataspace for datasets */ sid_dset = H5Screate_simple(1, sdims_dset, NULL); @@ -4562,18 +4569,18 @@ static void test_comps_array (const char *fname, const char *dset, const char *a static void test_comps_vlen (const char * fname, const char *dset, const char *attr, int diff, int is_file_new) { /* sub compound 2 */ - typedef struct { + typedef struct { int i2; float f2; } cmpd2_t; /* top compound 1 */ - typedef struct { + typedef struct { int i1; hvl_t vl; /* VL information for compound2 */ } cmpd1_t; - cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */ + cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */ hid_t fid; /* HDF5 File ID */ hid_t did_dset; /* dataset ID */ @@ -4629,7 +4636,7 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a assert(ret >= 0); /* ------------------------------- - * Create dataset with compound1 + * Create dataset with compound1 */ /* Create dataspace for dataset */ sid_dset = H5Screate_simple(1, sdims_dset, NULL); @@ -4674,11 +4681,11 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a static void test_comps_array_vlen (const char * fname, const char *dset,const char *attr, int diff, int is_file_new) { - typedef struct { + typedef struct { int i3; float f3; } cmpd3_t; - + typedef struct { /* Typedef for compound datatype */ int i2; hvl_t vl; /* VL information to write */ @@ -4817,19 +4824,19 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch static void test_comps_vlen_arry (const char * fname, const char *dset, const char *attr, int diff, int is_file_new) { /* sub compound 3 */ - typedef struct { + typedef struct { int i3; float f3; } cmpd3_t; /* sub compound 2 */ - typedef struct { + typedef struct { int i2; cmpd3_t cmpd3[SDIM_CMPD_ARRAY]; } cmpd2_t; /* top compound 1 */ - typedef struct { + typedef struct { int i1; hvl_t vl; /* VL information for compound2 */ } cmpd1_t; @@ -4910,7 +4917,7 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch assert(ret >= 0); /* ------------------------------- - * Create dataset with compound1 + * Create dataset with compound1 */ /* Create dataspace for dataset */ sid_dset = H5Screate_simple(1, sdims_dset, NULL); @@ -4960,9 +4967,9 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch /*------------------------------------------------------------------------- * Function: test_data_nocomparables * -* Purpose: -* Create test files with non-comparable dataset and attributes with -* comparable datasets and attributes. All the comparables should display +* Purpose: +* Create test files with non-comparable dataset and attributes with +* comparable datasets and attributes. All the comparables should display * differences. * *-------------------------------------------------------------------------*/ @@ -5020,8 +5027,8 @@ static void test_data_nocomparables (const char * fname, int make_diffs) dset_data_ptr2=(int*)&data2; attr_data_ptr1=(int*)&data2; - /* ----------- - * group2 + /* ----------- + * group2 */ dset_data_ptr3=(int*)&data2; /* dset1/attr1 */ @@ -5143,10 +5150,10 @@ static void test_data_nocomparables (const char * fname, int make_diffs) goto out; } - + out: - + /*----------------------------------------------------------------------- * Close IDs *-----------------------------------------------------------------------*/ @@ -5171,9 +5178,9 @@ out: /*------------------------------------------------------------------------- * Function: test_objs_nocomparables * -* Purpose: +* Purpose: * Create test files with common objects (same name) but different object -* types. +* types. * h5diff should show non-comparable output from these common objects. *-------------------------------------------------------------------------*/ static void test_objs_nocomparables(const char *fname1, const char *fname2) @@ -5317,6 +5324,160 @@ out: } +static hid_t mkstr(int size, H5T_str_t pad) { + hid_t type; + + if((type=H5Tcopy(H5T_C_S1)) < 0) return -1; + if(H5Tset_size(type, (size_t)size) < 0) return -1; + if(H5Tset_strpad(type, pad) < 0) return -1; + + return type; +} + +/*------------------------------------------------------------------------- +* Function: test_objs_strings +* +* Purpose: +* Create test files with common objects (same name) but different string +* types. +* h5diff should show differences output from these common objects. +*-------------------------------------------------------------------------*/ +static void test_objs_strings(const char *fname1, const char *fname2) +{ + herr_t status = SUCCEED; + hid_t fid1=0; + hid_t fid2=0; + hid_t dataset=0; + hid_t space=0; + hid_t f_type=0; + hid_t m_type=0; + hsize_t dims1[] = {3, 4}; + char string1A[12][3] = {"s1","s2","s3","s4","s5","s6","s","s","s9", + "s0","s1","s2"}; + char string1B[12][3] = {"s1","s2","s3","s4","s","s","s7","s8","s9", + "s0","s1","s2"}; + + hsize_t dims2[]={20}; + char string2A[20][10] = {"ab cd ef1", "ab cd ef2", "ab cd ef3", "ab cd ef4", + "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", + "ab cd 9", "ab cd 0", "ab cd 1", "ab cd 2", + "ab cd ef3", "ab cd ef4", "ab cd ef5", "ab cd ef6", + "ab cd ef7", "ab cd ef8", "ab cd ef9", "ab cd ef0"}; + char string2B[20][10] = {"ab cd ef1", "ab cd ef2", "ab cd ef3", "ab cd ef4", + "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", + "ab cd ef9", "ab cd ef0", "ab cd ef1", "ab cd ef2", + "ab cd 3", "ab cd 4", "ab cd 5", "ab cd 6", + "ab cd ef7", "ab cd ef8", "ab cd ef9", "ab cd ef0"}; + + hsize_t dims3[] = {27}; + char string3A[27][6] = {"abcd0", "abcd1", "abcd2", "abcd3", + "abcd4", "abcd5", "abcd6", "abcd7", + "abcd8", "abcd9", "abcd0", "abcd1", + "abd2", "abc3", "bcd4", "acd5", + "abcd6", "abcd7", "abcd8", "abcd9", + "abcd0", "abcd1", "abcd2", "abcd3", + "abc4", "abc5", "abc6"}; + char string3B[27][6] = {"abcd0", "abcd1", "abcd2", "abcd3", + "abcd4", "abcd5", "abcd6", "abcd7", + "abcd8", "abcd9", "abcd0", "abcd1", + "abcd2", "abcd3", "abcd4", "abcd5", + "abd6", "abc7", "bcd8", "acd9", + "abcd0", "abcd1", "abcd2", "abcd3", + "abd4", "abd5", "abd6"}; + + hsize_t dims4[] = {3}; + char string4A[3][21] = { "s1234567890123456789", "s1234567890123456789", + "s12345678901234567"}; + char string4B[3][21] = { "s1234567890123456789", "s12345678901234567", + "s1234567890123456789"}; + + /*----------------------------------------------------------------------- + * Create file(s) + *------------------------------------------------------------------------*/ + /* file1 */ + fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) + { + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + status = FAIL; + goto out; + } + + /* file2 */ + fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid2 < 0) + { + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + status = FAIL; + goto out; + } + + /* string 1 : nullterm string */ + space = H5Screate_simple(2, dims1, NULL); + f_type = mkstr(5, H5T_STR_NULLTERM); + m_type = mkstr(3, H5T_STR_NULLTERM); + dataset = H5Dcreate2(fid1, "/string1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string1A); + H5Dclose(dataset); + dataset = H5Dcreate2(fid2, "/string1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string1B); + H5Tclose(m_type); + H5Tclose(f_type); + H5Sclose(space); + H5Dclose(dataset); + + /* string 2 : space pad string */ + space = H5Screate_simple(1, dims2, NULL); + f_type = mkstr(11, H5T_STR_SPACEPAD); + m_type = mkstr(10, H5T_STR_NULLTERM); + dataset = H5Dcreate2(fid1, "/string2", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string2A); + H5Dclose(dataset); + dataset = H5Dcreate2(fid2, "/string2", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string2B); + H5Tclose(m_type); + H5Tclose(f_type); + H5Sclose(space); + H5Dclose(dataset); + + /* string 3 : null pad string */ + space = H5Screate_simple(1, dims3, NULL); + f_type = mkstr(8, H5T_STR_NULLPAD); + m_type = mkstr(6, H5T_STR_NULLTERM); + dataset = H5Dcreate2(fid1, "/string3", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string3A); + H5Dclose(dataset); + dataset = H5Dcreate2(fid2, "/string3", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string3B); + H5Tclose(m_type); + H5Tclose(f_type); + H5Sclose(space); + H5Dclose(dataset); + + /* string 4 : space pad long string */ + space = H5Screate_simple(1, dims4, NULL); + f_type = mkstr(168, H5T_STR_SPACEPAD); + m_type = mkstr(21, H5T_STR_NULLTERM); + dataset = H5Dcreate2(fid1, "/string4", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4A); + H5Dclose(dataset); + dataset = H5Dcreate2(fid2, "/string4", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4B); + H5Tclose(m_type); + H5Tclose(f_type); + H5Sclose(space); + H5Dclose(dataset); + +out: + /*----------------------------------------------------------------------- + * Close IDs + *-----------------------------------------------------------------------*/ + if(fid1) + H5Fclose(fid1); + if(fid2) + H5Fclose(fid2); +} + /*------------------------------------------------------------------------- * Function: write_attr_in * diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index d2f1397..1069ed5 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -124,6 +124,8 @@ $SRC_H5DIFF_TESTFILES/tmptest.he5 $SRC_H5DIFF_TESTFILES/tmptest2.he5 $SRC_H5DIFF_TESTFILES/tmpSingleSiteBethe.reference.h5 $SRC_H5DIFF_TESTFILES/tmpSingleSiteBethe.output.h5 +$SRC_H5DIFF_TESTFILES/diff_strings1.h5 +$SRC_H5DIFF_TESTFILES/diff_strings2.h5 " LIST_HDF5_VDS_TEST_FILES=" @@ -282,6 +284,10 @@ $SRC_H5DIFF_TESTFILES/h5diff_517.txt $SRC_H5DIFF_TESTFILES/h5diff_518.txt $SRC_H5DIFF_TESTFILES/h5diff_530.txt $SRC_H5DIFF_TESTFILES/h5diff_540.txt +$SRC_H5DIFF_TESTFILES/h5diff_60.txt +$SRC_H5DIFF_TESTFILES/h5diff_61.txt +$SRC_H5DIFF_TESTFILES/h5diff_62.txt +$SRC_H5DIFF_TESTFILES/h5diff_63.txt $SRC_H5DIFF_TESTFILES/h5diff_600.txt $SRC_H5DIFF_TESTFILES/h5diff_601.txt $SRC_H5DIFF_TESTFILES/h5diff_603.txt @@ -382,6 +388,21 @@ CLEAN_TESTFILES_AND_TESTDIR() INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then $RM $TESTDIR + else + # files in $LIST_HDF5_VDS_TEST_FILES are copied in from a different + # directory, so when srcdir is the same as destdir and $TESTDIR is + # not deleted, the copy n $TESTDIR of each file from + # $LIST_HDF5_VDS_TEST_FILES will need to be deleted. + for tstfile in $LIST_HDF5_VDS_TEST_FILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + fname=`basename $tstfile` + rm $TESTDIR/$fname + fi + done fi } @@ -638,8 +659,6 @@ TOOLTEST h5diff_28.txt -v h5diff_types.h5 h5diff_types.h5 l1 l2 TOOLTEST h5diff_30.txt -v h5diff_enum_invalid_values.h5 h5diff_enum_invalid_values.h5 dset1 dset2 - - # ############################################################################## # # Dataset datatypes # ############################################################################## @@ -675,6 +694,13 @@ TOOLTEST h5diff_58.txt -v h5diff_dset1.h5 h5diff_dset2.h5 refreg # ( HDDFV-7942 ) TOOLTEST h5diff_59.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset11a dset11b +# Strings +# ( HDFFV-10128 ) +TOOLTEST h5diff_60.txt -v diff_strings1.h5 diff_strings2.h5 string1 string1 +TOOLTEST h5diff_61.txt -v diff_strings1.h5 diff_strings2.h5 string2 string2 +TOOLTEST h5diff_62.txt -v diff_strings1.h5 diff_strings2.h5 string3 string3 +TOOLTEST h5diff_63.txt -v diff_strings1.h5 diff_strings2.h5 string4 string4 + # ############################################################################## # # Error messages # ############################################################################## @@ -746,8 +772,6 @@ TOOLTEST h5diff_618.txt -p 2 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.19: number smaller than smallest difference TOOLTEST h5diff_619.txt -p 0.005 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 - - # ############################################################################## # # -n # ############################################################################## @@ -800,7 +824,6 @@ TOOLTEST h5diff_tmp2.txt tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.referen # ################################################## # attrs with verbose option level # ################################################## - TOOLTEST h5diff_700.txt -v1 h5diff_attr1.h5 h5diff_attr2.h5 TOOLTEST h5diff_701.txt -v2 h5diff_attr1.h5 h5diff_attr2.h5 TOOLTEST h5diff_702.txt --verbose=1 h5diff_attr1.h5 h5diff_attr2.h5 @@ -851,7 +874,6 @@ TOOLTEST h5diff_103.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h # with --use-system-epsilon for float value TOOLTEST h5diff_104.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2 - # not comparable -c flag TOOLTEST h5diff_200.txt h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2 @@ -979,7 +1001,6 @@ TOOLTEST h5diff_424.txt --follow-symlinks -v h5diff_ext2softlink_trg.h5 h5diff_e # extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2" TOOLTEST h5diff_425.txt --follow-symlinks -v h5diff_ext2softlink_src.h5 h5diff_ext2softlink_src.h5 /ext_link_to_slink1 /ext_link_to_slink2 - # ############################################################################## # # Dangling links compare (--follow-symlinks and --no-dangling-links) # ############################################################################## @@ -1130,6 +1151,7 @@ TOOLTEST h5diff_540.txt -v compounds_array_vlen1.h5 compounds_array_vlen2.h5 # ############################################################################## # # Test mutually exclusive options # ############################################################################## +# # Test with -d , -p and --use-system-epsilon. TOOLTEST h5diff_640.txt -v -d 5 -p 0.05 --use-system-epsilon h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 TOOLTEST h5diff_641.txt -v -d 5 -p 0.05 h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 1398aca..89c7534 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_TEST_H5DUMP) #----------------------------------------------------------------------------- @@ -6,6 +6,34 @@ PROJECT (HDF5_TOOLS_TEST_H5DUMP) #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) + #----------------------------------------------------------------------------- + # If plugin library tests can be tested + #----------------------------------------------------------------------------- + set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdump") + set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") + set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_dump.c) + TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") + target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + + # make plugins dir + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$" + "${CMAKE_BINARY_DIR}/plugins/$" + ) + # -------------------------------------------------------------------- # Add the h5dump test executable # -------------------------------------------------------------------- @@ -17,7 +45,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5dumpgentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () include (CMakeTests.cmake) diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index ad3c5ba..ae760bf 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -166,6 +166,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tstring2.ddl ${HDF5_TOOLS_DIR}/testfiles/tstringe.ddl ${HDF5_TOOLS_DIR}/testfiles/tszip.ddl + ${HDF5_TOOLS_DIR}/testfiles/tudfilter.ddl ${HDF5_TOOLS_DIR}/testfiles/tudlink-1.ddl ${HDF5_TOOLS_DIR}/testfiles/tudlink-2.ddl ${HDF5_TOOLS_DIR}/testfiles/tuserfilter.ddl @@ -291,6 +292,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tstr.h5 ${HDF5_TOOLS_DIR}/testfiles/tstr2.h5 ${HDF5_TOOLS_DIR}/testfiles/tstr3.h5 + ${HDF5_TOOLS_DIR}/testfiles/tudfilter.h5 ${HDF5_TOOLS_DIR}/testfiles/tudlink.h5 ${HDF5_TOOLS_DIR}/testfiles/tvldtypes1.h5 ${HDF5_TOOLS_DIR}/testfiles/tvldtypes2.h5 @@ -381,16 +383,16 @@ ############################################################################## ############################################################################## - MACRO (ADD_HELP_TEST testname resultcode) + macro (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${testname} COMMAND $ ${ARGN}) set_tests_properties (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5DUMP-${testname}") - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5DUMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" @@ -402,34 +404,34 @@ -D "TEST_REFERENCE=h5dump-${testname}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_HELP_TEST) + endif () + endmacro () - MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) + macro (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) if (${testtype} STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile} ${ARGN}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else (${testtype} STREQUAL "SKIP") + endif () + else () ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - endif (${testtype} STREQUAL "SKIP") - ENDMACRO (ADD_SKIP_H5_TEST) + endif () + endmacro () - MACRO (ADD_H5_TEST resultfile resultcode) + macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -448,21 +450,21 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST file) + endif () + endmacro () - MACRO (ADD_H5_TEST_N resultfile resultcode) + macro (ADD_H5_TEST_N resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-N-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () add_test ( NAME H5DUMP-N-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -481,21 +483,21 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST_N file) + endif () + endmacro () - MACRO (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) + macro (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -521,21 +523,21 @@ ) set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST_EXPORT file) + endif () + endmacro () - MACRO (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) + macro (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -568,10 +570,10 @@ ) set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST_EXPORT_DDL file) + endif () + endmacro () - MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) + macro (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-output-${resultfile}-clear-objects @@ -592,10 +594,10 @@ ) set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_EXPORT_TEST file) + endif () + endmacro () - MACRO (ADD_H5_MASK_TEST resultfile resultcode) + macro (ADD_H5_MASK_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile} @@ -609,10 +611,10 @@ -D "TEST_MASK_ERROR=true" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_MASK_TEST file) + endif () + endmacro () - MACRO (ADD_H5ERR_MASK_TEST resultfile resultcode) + macro (ADD_H5ERR_MASK_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile} @@ -627,10 +629,10 @@ -D "TEST_MASK_ERROR=true" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5ERR_MASK_TEST file) + endif () + endmacro () - MACRO (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) + macro (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile} @@ -647,10 +649,10 @@ -D "TEST_ENV_VALUE:STRING=${envval}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5ERR_MASK_ENV_TEST) + endif () + endmacro () - MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) + macro (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -677,12 +679,39 @@ add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND h5diff ${testfile} ${resultfile}.h5 /integer /integer) set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST_IMPORT file) + endif () + endmacro () + + macro (ADD_H5_UD_TEST testname resultcode resultfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP_UD-${testname}-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/std/${resultfile}.out + testfiles/std/${resultfile}.out.err + ) + add_test ( + NAME H5DUMP_UD-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5DUMP_UD-${testname} PROPERTIES DEPENDS H5DUMP_UD-${testname}-clearall-objects) + endif () + endmacro () ############################################################################## ############################################################################## -### T H E T E S T S HDF5_ENABLE_USING_MEMCHECKER ### +### T H E T E S T S ### ############################################################################## ############################################################################## @@ -1038,9 +1067,9 @@ set_tests_properties (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5DUMP-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () ADD_HELP_TEST(help 0 -h) @@ -1321,11 +1350,11 @@ # detect whether the encoder is present. if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif (H5_HAVE_FILTER_DEFLATE) + endif () if (H5_HAVE_FILTER_SZIP) set (USE_FILTER_SZIP "true") - endif (H5_HAVE_FILTER_SZIP) + endif () if (USE_FILTER_DEFLATE) # data read internal filters @@ -1333,8 +1362,8 @@ if (HDF5_ENABLE_SZIP_SUPPORT) # data read all filters ADD_H5_TEST (treadfilter 0 --enable-error-stack -d all -d szip tfilters.h5) - endif (HDF5_ENABLE_SZIP_SUPPORT) - endif (USE_FILTER_DEFLATE) + endif () + endif () # test for displaying objects with very long names ADD_H5_TEST (tlonglinks 0 --enable-error-stack tlonglinks.h5) @@ -1369,14 +1398,14 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () # the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () # test for dataset region references ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) @@ -1421,3 +1450,8 @@ # test for non-existing file ADD_H5_TEST (non_existing 1 --enable-error-stack tgroup.h5 non_existing.h5) + +############################################################################## +### P L U G I N T E S T S +############################################################################## +ADD_H5_UD_TEST (h5dump_plugin_test 0 tudfilter --enable-error-stack tudfilter.h5) diff --git a/tools/test/h5dump/CMakeTestsPBITS.cmake b/tools/test/h5dump/CMakeTestsPBITS.cmake index c2ec9cc..770531a 100644 --- a/tools/test/h5dump/CMakeTestsPBITS.cmake +++ b/tools/test/h5dump/CMakeTestsPBITS.cmake @@ -88,18 +88,18 @@ foreach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) get_filename_component(fname "${pbits_h5_file}" NAME) HDFTEST_COPY_FILE("${pbits_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}" "h5dump_pbits_files") - endforeach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) + endforeach () foreach (ddl_pbits ${HDF5_REFERENCE_PBITS}) get_filename_component(fname "${ddl_pbits}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/pbits/${ddl_pbits}" "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}" "h5dump_pbits_files") - endforeach (ddl_pbits ${HDF5_REFERENCE_PBITS}) + endforeach () foreach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) get_filename_component(fname "${ddl_pbits}" NAME) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/errfiles/${ddl_pbits}" "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}" "h5dump_pbits_files") - endforeach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + endforeach () add_custom_target(h5dump_pbits_files ALL COMMENT "Copying files needed by h5dump_pbits tests" DEPENDS ${h5dump_pbits_files_list}) ############################################################################## @@ -108,7 +108,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_PBITS_TEST resultfile resultcode) + macro (ADD_H5_PBITS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) @@ -119,7 +119,7 @@ if (NOT "${last_pbits_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -131,8 +131,8 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_PBITS_TEST file) + endif () + endmacro () ############################################################################## ############################################################################## @@ -256,9 +256,9 @@ set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") if (NOT "${last_pbits_test}" STREQUAL "") set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test}) - endif (NOT "${last_pbits_test}" STREQUAL "") + endif () set (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # test failure handling # Missing file name diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index aa85350..d155e55 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -67,18 +67,18 @@ foreach (vds_h5_file ${HDF5_REFERENCE_TEST_VDS}) get_filename_component(fname "${vds_h5_file}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") - endforeach (vds_h5_file ${HDF5_REFERENCE_TEST_VDS}) + endforeach () foreach (ddl_vds ${HDF5_REFERENCE_VDS}) get_filename_component(fname "${ddl_vds}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") - endforeach (ddl_vds ${HDF5_REFERENCE_VDS}) + endforeach () foreach (ddl_vds ${HDF5_ERROR_REFERENCE_VDS}) get_filename_component(fname "${ddl_vds}" NAME) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/errfiles/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") - endforeach (ddl_vds ${HDF5_ERROR_REFERENCE_VDS}) + endforeach () add_custom_target(h5dump_vds_files ALL COMMENT "Copying files needed by h5dump_vds tests" DEPENDS ${h5dump_vds_files_list}) ############################################################################## @@ -87,7 +87,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_VDS_TEST resultfile resultcode) + macro (ADD_H5_VDS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) @@ -98,7 +98,7 @@ if (NOT "${last_vds_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -110,10 +110,10 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_VDS_TEST file) + endif () + endmacro () - MACRO (ADD_H5_VDS_LAYOUT resultfile resultcode) + macro (ADD_H5_VDS_LAYOUT resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ -p ${ARGN}) @@ -124,7 +124,7 @@ if (NOT "${last_vds_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -137,8 +137,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_VDS_LAYOUT file) + endif () + endmacro () ############################################################################## ############################################################################## @@ -190,9 +190,9 @@ set_tests_properties (H5DUMP_VDS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (NOT "${last_vds_test}" STREQUAL "") set_tests_properties (H5DUMP_VDS-clearall-objects PROPERTIES DEPENDS ${last_vds_test}) - endif (NOT "${last_vds_test}" STREQUAL "") + endif () set (last_VDS_test "H5DUMP_VDS-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # See which filters are usable (and skip tests for filters we # don't have). Do this by searching H5pubconf.h to see which @@ -201,11 +201,11 @@ # detect whether the encoder is present. if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif (H5_HAVE_FILTER_DEFLATE) + endif () if (H5_HAVE_FILTER_SZIP) set (USE_FILTER_SZIP "true") - endif (H5_HAVE_FILTER_SZIP) + endif () # Data read if (USE_FILTER_DEFLATE) @@ -218,7 +218,7 @@ ADD_H5_VDS_TEST (vds-first 0 --vds-view-first-missing --enable-error-stack vds-percival-unlim-maxmin.h5) ADD_H5_VDS_TEST (vds-gap1 0 -d /VDS-Eiger --vds-gap-size=1 --enable-error-stack vds-eiger.h5) ADD_H5_VDS_TEST (vds-gap2 0 --vds-gap-size=2 --enable-error-stack vds-eiger.h5) - endif (USE_FILTER_DEFLATE) + endif () # Layout read if (USE_FILTER_DEFLATE) @@ -230,4 +230,4 @@ ADD_H5_VDS_LAYOUT (tvds_layout-5 0 --enable-error-stack 5_vds.h5) ADD_H5_VDS_LAYOUT (vds_layout-eiger 0 --enable-error-stack vds-eiger.h5) ADD_H5_VDS_LAYOUT (vds_layout-maxmin 0 --enable-error-stack vds-percival-unlim-maxmin.h5) - endif (USE_FILTER_DEFLATE) + endif () diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index 79d3ff8..2e55818 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -130,12 +130,12 @@ foreach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) get_filename_component(fname "${tst_xml_h5_file}" NAME) HDFTEST_COPY_FILE("${tst_xml_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}" "h5dump_xml_files") - endforeach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) + endforeach () foreach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) get_filename_component(fname "${tst_xml_other_file}" NAME) HDFTEST_COPY_FILE("${tst_xml_other_file}" "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}" "h5dump_xml_files") - endforeach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + endforeach () add_custom_target(h5dump_xml_files ALL COMMENT "Copying files needed by h5dump_xml tests" DEPENDS ${h5dump_xml_files_list}) ############################################################################## @@ -144,20 +144,20 @@ ############################################################################## ############################################################################## - MACRO (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) + macro (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) if (${testtype} STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-XML-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else (${testtype} STREQUAL "SKIP") + endif () + else () ADD_XML_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - endif (${testtype} STREQUAL "SKIP") - ENDMACRO (ADD_XML_SKIP_H5_TEST) + endif () + endmacro () - MACRO (ADD_XML_H5_TEST resultfile resultcode) + macro (ADD_XML_H5_TEST resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-XML-${resultfile} COMMAND $ --xml ${ARGN}) set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") @@ -167,7 +167,7 @@ if (NOT "${last_xml_test}" STREQUAL "") set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5DUMP-XML-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -179,8 +179,8 @@ -D "TEST_REFERENCE=${resultfile}.xml" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_XML_H5_TEST file) + endif () + endmacro () ############################################################################## ############################################################################## @@ -326,9 +326,9 @@ set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") if (NOT "${last_xml_test}" STREQUAL "") set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test}) - endif (NOT "${last_xml_test}" STREQUAL "") + endif () set (last_test "H5DUMP-XML-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () ########## test XML ADD_XML_H5_TEST (tall.h5 0 tall.h5) diff --git a/tools/test/h5dump/Makefile.am b/tools/test/h5dump/Makefile.am index aed34ec..a3d1df7 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -30,13 +30,27 @@ TEST_SCRIPT=testh5dump.sh testh5dumppbits.sh testh5dumpvds.sh testh5dumpxml.sh check_PROGRAMS=$(TEST_PROG) binread check_SCRIPTS=$(TEST_SCRIPT) SCRIPT_DEPEND=../../src/h5dump/h5dump$(EXEEXT) +if HAVE_SHARED_CONDITIONAL +if USE_PLUGINS_CONDITIONAL + TEST_SCRIPT += h5dump_plugin.sh +endif +endif # All the programs depend on the hdf5 and h5tools libraries LDADD=$(LIBH5TOOLS) $(LIBHDF5) +if HAVE_SHARED_CONDITIONAL + # Build it as shared library if configure is enabled for shared library. + lib_LTLIBRARIES=libdynlibdump.la + libdynlibdump_la_SOURCES=dynlib_dump.c + +install-exec-hook: + $(RM) $(DESTDIR)$(libdir)/*dynlib* +endif + # Temporary files. *.h5 are generated by h5dumpgentest. They should # copied to the testfiles/ directory if update is required. CHECK_CLEANFILES+=*.h5 *.bin -DISTCLEANFILES=testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh +DISTCLEANFILES=testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh h5dump_plugin.sh include $(top_srcdir)/config/conclude.am diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 335eafa..bf9a698 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -114,6 +114,7 @@ #define FILE81 "tints4dims.h5" #define FILE82 "tcompound_complex2.h5" #define FILE83 "tvlenstr_array.h5" +#define FILE84 "tudfilter.h5" /*------------------------------------------------------------------------- * prototypes @@ -153,6 +154,23 @@ const H5Z_class2_t H5Z_MYFILTER[1] = {{ myfilter, /* The actual filter function */ }}; +#define H5Z_FILTER_DYNLIBUD 300 +#define MULTIPLIER 3 + +static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIBUD, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlibud", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */ +}}; + /* A UD link traversal function. Shouldn't actually be called. */ static hid_t UD_traverse(H5_ATTR_UNUSED const char * link_name, H5_ATTR_UNUSED hid_t cur_group, @@ -379,9 +397,9 @@ typedef struct s1_t { /* Dataset dimensions */ #define F82_DIM32 32 #define F82_RANK 1 -//#define F82_RANK2 2 -//#define F82_RANK3 3 -//#define F82_RANK4 4 +/* #define F82_RANK2 2 */ +/* #define F82_RANK3 3 */ +/* #define F82_RANK4 4 */ /* "File 83" macros */ /* Name of dataset to create in datafile */ @@ -10286,6 +10304,132 @@ static void gent_vlenstr_array(void) H5Fclose(file); } +/*------------------------------------------------------------------------- + * Function: gent_udfilter + * + * Purpose: Generate a file to be used in testing user defined filter plugin3. + *------------------------------------------------------------------------- + */ +static void gent_udfilter(void) +{ + hid_t fid; /* file id */ + hid_t dcpl; /* dataset creation property list */ + hid_t dsid; /* dataset ID */ + hid_t sid; /* dataspace ID */ + hid_t tid; /* datatype ID */ + + hsize_t dims1[RANK] = {DIM1,DIM2}; + hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; + int buf1[DIM1][DIM2]; + int i, j, n, ret; + + for(i=n=0; i=0); + + /* create a space */ + sid = H5Screate_simple(SPACE2_RANK, dims1, NULL); + + dcpl = H5Pcreate(H5P_DATASET_CREATE); + HDassert(dcpl>=0); + + ret = H5Pset_layout(dcpl, H5D_CHUNKED); + HDassert(ret >= 0); + + ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); + HDassert(ret >= 0); + + ret = H5Zregister (H5Z_DYNLIBUD); + HDassert(ret >= 0); + + ret = H5Pset_filter (dcpl, H5Z_FILTER_DYNLIBUD, H5Z_FLAG_MANDATORY, 0, NULL); + HDassert(ret >= 0); + + /* create the dataset */ + dsid = H5Dcreate2(fid, "dynlibud", H5T_STD_I32LE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + HDassert(dsid >= 0); + + /* write */ + ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1); + HDassert(ret >= 0); + + /* close */ + ret = H5Dclose(dsid); + HDassert(ret >= 0); + + /* remove the filters from the dcpl */ + ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); + HDassert(ret >= 0); + + /*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + ret = H5Sclose(sid); + HDassert(ret >= 0); + + ret = H5Pclose(dcpl); + HDassert(ret >= 0); + + ret = H5Fclose(fid); + HDassert(ret >= 0); +} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlibud + * + * Purpose: A dynlibud filter method that multiplies the original value + * during write and divide the original value during read. It + * will be built as a shared library. tools tests will load + * and use this filter as a plugin library. + * + * Return: Success: Data chunk size + * + * Failure: 0 + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + char *int_ptr = (char *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ + + /* Check for the correct number of parameters */ + if(cd_nelmts > 0) + return(0); + + /* Assignment to eliminate unused parameter warning. */ + cd_values = cd_values; + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + /* Subtract the original value with MULTIPLIER */ + while(buf_left > 0) { + char temp = *int_ptr; + *int_ptr = temp - MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); + } /* end while */ + } /* end if */ + else { /*write*/ + /* Add the original value with MULTIPLIER */ + while(buf_left > 0) { + char temp = *int_ptr; + *int_ptr = temp + MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); + } /* end while */ + } /* end else */ + + return nbytes; +} /* end H5Z_filter_dynlibud() */ /*------------------------------------------------------------------------- * Function: main @@ -10383,6 +10527,8 @@ int main(void) gent_intsfourdims(); + gent_udfilter(); + return 0; } diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index 1d18e9a..7e47b13 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_TEST_H5FC) #----------------------------------------------------------------------------- @@ -23,6 +23,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5fc_gentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5fc_gentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () include (CMakeTests.cmake) diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake index 68f9318..4738be5 100644 --- a/tools/test/h5format_convert/CMakeTests.cmake +++ b/tools/test/h5format_convert/CMakeTests.cmake @@ -64,11 +64,11 @@ foreach (ddl_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${ddl_file}" "${PROJECT_BINARY_DIR}/testfiles/${ddl_file}" "h5fc_files") - endforeach (ddl_file ${HDF5_REFERENCE_FILES}) + endforeach () foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5fc_files") - endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach () add_custom_target(h5fc_files ALL COMMENT "Copying files needed by h5fc tests" DEPENDS ${h5fc_files_list}) ############################################################################## @@ -77,7 +77,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_OUTPUT testname resultfile resultcode testfile) + macro (ADD_H5_OUTPUT testname resultfile resultcode testfile) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -87,7 +87,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () if (NOT "${testfile}" STREQUAL "") add_test ( NAME H5FC-${testname}-${testfile}-tmpfile @@ -108,7 +108,7 @@ ) set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile") set (last_test "H5FC-${testname}-${testfile}") - else (NOT "${testfile}" STREQUAL "") + else () add_test ( NAME H5FC-${testname}-NA COMMAND "${CMAKE_COMMAND}" @@ -122,11 +122,11 @@ ) set_tests_properties (H5FC-${testname}-NA PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") set (last_test "H5FC-${testname}-NA") - endif (NOT "${testfile}" STREQUAL "") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_OUTPUT) + endif () + endif () + endmacro () - MACRO (ADD_H5_TEST testname resultcode testfile) + macro (ADD_H5_TEST testname resultcode testfile) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -136,7 +136,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () add_test ( NAME H5FC-${testname}-tmpfile COMMAND ${CMAKE_COMMAND} @@ -156,10 +156,10 @@ ) set_tests_properties (H5FC-${testname} PROPERTIES DEPENDS "H5FC-${testname}-tmpfile") set (last_test "H5FC-${testname}") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST) + endif () + endmacro () - MACRO (ADD_H5_CHECK_IDX dependtest testname) + macro (ADD_H5_CHECK_IDX dependtest testname) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -167,10 +167,10 @@ COMMAND "$" "./testfiles/tmp.h5" "${ARGN}" ) set_tests_properties (H5FC_CHECK_IDX-${testname} PROPERTIES DEPENDS "H5FC-${dependtest}") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_CHECK_IDX) + endif () + endmacro () - MACRO (ADD_H5_TEST_CHECK_IDX testname resultcode testfile) + macro (ADD_H5_TEST_CHECK_IDX testname resultcode testfile) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -180,7 +180,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () add_test ( NAME H5FC-${testname}-tmpfile COMMAND ${CMAKE_COMMAND} @@ -205,10 +205,10 @@ ) set_tests_properties (H5FC_CHECK_IDX-${testname} PROPERTIES DEPENDS "H5FC-${testname}") set (last_test "H5FC_CHECK_IDX-${testname}") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST_CHECK_IDX) + endif () + endmacro () - MACRO (ADD_H5_H5DUMP_CHECK testname) + macro (ADD_H5_H5DUMP_CHECK testname) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -218,7 +218,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () add_test ( NAME H5FC-${testname}-tmpfile COMMAND ${CMAKE_COMMAND} @@ -250,8 +250,8 @@ ) set_tests_properties (H5FC_CHECK_DUMP-${testname} PROPERTIES DEPENDS "H5FC-${testname}") set (last_test "H5FC_CHECK_DUMP-${testname}") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_H5DUMP_CHECK) + endif () + endmacro () ############################################################################## ############################################################################## @@ -324,9 +324,9 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5FC-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # h5format_convert --help # h5format_convert (no options) diff --git a/tools/test/h5format_convert/h5fc_gentest.c b/tools/test/h5format_convert/h5fc_gentest.c index fea7eed..9ef8e6e 100644 --- a/tools/test/h5format_convert/h5fc_gentest.c +++ b/tools/test/h5format_convert/h5fc_gentest.c @@ -44,8 +44,6 @@ const char *FILENAME[] = { #define GROUP "GROUP" -#define DSET_BT1 "DSET_BT1" -#define DSET_NDATA_BT1 "DSET_NDATA_BT1" #define DSET_COMPACT "DSET_COMPACT" #define DSET_CONTIGUOUS "DSET_CONTIGUOUS" @@ -770,6 +768,7 @@ error: H5Dclose(did2); H5Gclose(gid); H5Fclose(fid); + H5Pclose(fapl); H5Pclose(fcpl); } H5E_END_TRY; diff --git a/tools/test/h5format_convert/testh5fc.sh.in b/tools/test/h5format_convert/testh5fc.sh.in index 5384354..24f04d6 100644 --- a/tools/test/h5format_convert/testh5fc.sh.in +++ b/tools/test/h5format_convert/testh5fc.sh.in @@ -180,6 +180,9 @@ CLEAN_TESTFILES_AND_TESTDIR() $RM $TESTDIR else $RM $TESTDIR/$TMPFILE + $RM $TESTDIR/$TMPOUTFILE + $RM $TESTDIR/$TMPCHKFILE + $RM $TESTDIR/$TMPDMPFILE fi } diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index 22491b4..0d23e5d 100644 --- a/tools/test/h5import/CMakeLists.txt +++ b/tools/test/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_TEST_H5IMPORT) #----------------------------------------------------------------------------- diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index eb0b413..15b36fc 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -64,15 +64,15 @@ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (conf_file ${HDF5_REFERENCE_CONF_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/testfiles/${conf_file}" "${PROJECT_BINARY_DIR}/testfiles/${conf_file}" "h5import_files") - endforeach (conf_file ${HDF5_REFERENCE_CONF_FILES}) + endforeach () foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/testfiles/${txt_file}" "${PROJECT_BINARY_DIR}/testfiles/${txt_file}" "h5import_files") - endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) + endforeach () 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 (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach () add_custom_target(h5import_files ALL COMMENT "Copying files needed by h5import tests" DEPENDS ${h5import_files_list}) ############################################################################## @@ -80,14 +80,14 @@ ### T H E T E S T S M A C R O S ### ############################################################################## ############################################################################## - MACRO (ADD_H5_TEST testname importfile conffile testfile) + macro (ADD_H5_TEST testname importfile conffile testfile) # If using memchecker skip macro based tests if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5IMPORT-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -125,10 +125,10 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST testname importfile conffile testfile) + endif () + endmacro () - MACRO (ADD_H5_DUMPTEST testname datasetname testfile) + macro (ADD_H5_DUMPTEST testname datasetname testfile) # If using memchecker skip tests if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -152,7 +152,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - else ("${ARGN}" STREQUAL "BINARY") + else () add_test ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" @@ -164,7 +164,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif ("${ARGN}" STREQUAL "BINARY") + endif () set_tests_properties (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") add_test ( @@ -193,24 +193,24 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) + endif () + endmacro () - MACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) + macro (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5IMPORT-DUMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) + endif () + endmacro () # -------------------------------------------------------------------- # Determine if filter is available for h5diff # -------------------------------------------------------------------- if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif (H5_HAVE_FILTER_DEFLATE) + endif () ############################################################################## ############################################################################## @@ -377,7 +377,7 @@ dtxtstr.h5.dff.err ) set (last_test "H5IMPORT-clear-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5IMPORT-h5importtest-clear-objects @@ -393,7 +393,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5IMPORT-clear-objects") add_test (NAME H5IMPORT-h5importtest COMMAND $) @@ -424,17 +424,17 @@ ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5) if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - else (NOT USE_FILTER_DEFLATE) + else () ADD_H5_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - endif (NOT USE_FILTER_DEFLATE) + endif () # ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " ADD_H5_TEST (BINARY_I8 binin8.bin testfiles/binin8.conf binin8.h5) if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - else (NOT USE_FILTER_DEFLATE) + else () ADD_H5_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - endif (NOT USE_FILTER_DEFLATE) + endif () # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " ADD_H5_TEST (BINARY_I16 binin16.bin testfiles/binin16.conf binin16.h5) diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index d3980c4..562b4f3 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_TEST_H5JAM) #----------------------------------------------------------------------------- @@ -17,7 +17,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5jamgentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () add_executable (getub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/getub.c) TARGET_NAMING (getub STATIC) diff --git a/tools/test/h5jam/CMakeTests.cmake b/tools/test/h5jam/CMakeTests.cmake index 9ed2015..d0ba305 100644 --- a/tools/test/h5jam/CMakeTests.cmake +++ b/tools/test/h5jam/CMakeTests.cmake @@ -23,11 +23,11 @@ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5jam_files") - endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach () foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/testfiles/${txt_file}" "${PROJECT_BINARY_DIR}/testfiles/${txt_file}" "h5jam_files") - endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) + endforeach () add_custom_target(h5jam_files ALL COMMENT "Copying files needed by h5jam tests" DEPENDS ${h5jam_files_list}) ############################################################################## @@ -40,14 +40,14 @@ # TEST_H5JAM_OUTPUT # For the purpose to verify only output & exitcode from h5jam # - MACRO (TEST_H5JAM_OUTPUT expectfile resultcode) + macro (TEST_H5JAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5JAM-${expectfile} COMMAND $ ${ARGN}) if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") - endif (NOT "${resultcode}" STREQUAL "0") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () add_test ( NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" @@ -59,21 +59,21 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (TEST_H5JAM_OUTPUT) + endif () + endmacro () # ============================================================ # TEST_H5UNJAM_OUTPUT # For the purpose to verify only output & exitcode from h5unjam # - MACRO (TEST_H5UNJAM_OUTPUT expectfile resultcode) + macro (TEST_H5UNJAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND $ ${ARGN}) if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") - endif (NOT "${resultcode}" STREQUAL "0") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () add_test ( NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" @@ -85,10 +85,10 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (TEST_H5UNJAM_OUTPUT) + endif () + endmacro () - MACRO (CHECKFILE testname testdepends expected actual) + macro (CHECKFILE testname testdepends expected actual) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -117,10 +117,10 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO(CHECKFILE testname testdepends expected actual) + endif () + endmacro() - MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile) + macro (UNJAMTEST testname setfile infile ufile chkfile outfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5JAM-${testname}-UNJAM-SETUP-clear-objects @@ -145,7 +145,7 @@ add_test (NAME H5JAM-${testname}-UNJAM COMMAND $ -i ${infile} -u ${ufile} -o ${outfile}) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) set (compare_test ${ufile}) - else (NOT "${ufile}" STREQUAL "NONE") + else () if (NOT "${ARGN}" STREQUAL "--delete") add_test ( NAME H5JAM-${testname}-UNJAM @@ -160,12 +160,12 @@ ) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) set (compare_test "${outfile}.ufile.txt") - else (NOT "${ARGN}" STREQUAL "--delete") + else () add_test (NAME H5JAM-${testname}-UNJAM COMMAND $ -i ${infile} -o ${outfile}) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) set (compare_test "") - endif (NOT "${ARGN}" STREQUAL "--delete") - endif (NOT "${ufile}" STREQUAL "NONE") + endif () + endif () if (NOT "${compare_test}" STREQUAL "") add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects @@ -190,7 +190,7 @@ -P "${HDF_RESOURCES_DIR}/userblockTest.cmake" ) set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects) - endif (NOT "${compare_test}" STREQUAL "") + endif () add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_NOUB @@ -207,21 +207,21 @@ ) if (NOT "${compare_test}" STREQUAL "") set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1) - else (NOT "${compare_test}" STREQUAL "") + else () set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) - endif (NOT "${compare_test}" STREQUAL "") + endif () CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO(UNJAMTEST testname infile ufile outfile) + endif () + endmacro() - MACRO (JAMTEST testname jamfile infile chkfile outfile) + macro (JAMTEST testname jamfile infile chkfile outfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5JAM-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test (NAME H5JAM-${testname} COMMAND $ -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) if (NOT HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) @@ -229,7 +229,7 @@ set (compare_orig testfiles/${infile}) if ("${ARGN}" STREQUAL "--clobber") set (compare_orig "") - endif ("${ARGN}" STREQUAL "--clobber") + endif () add_test ( NAME H5JAM-${testname}-CHECK_UB_1-clear-objects @@ -255,10 +255,10 @@ ) set_tests_properties (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (JAMTEST testname jamfile infile outfile) + endif () + endmacro () - MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) + macro (JAMTEST_NONE testname jamfile infile setfile chkfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5JAM-${testname}_NONE-clear-objects @@ -284,7 +284,7 @@ set (compare_orig ${chkfile}.cpy.h5) if ("${ARGN}" STREQUAL "--clobber") set (compare_orig "") - endif ("${ARGN}" STREQUAL "--clobber") + endif () add_test ( NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects @@ -310,8 +310,8 @@ ) set_tests_properties (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) + endif () + endmacro () ############################################################################## ############################################################################## diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt index 48894fb..c21ca92 100644 --- a/tools/test/h5ls/CMakeLists.txt +++ b/tools/test/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_TEST_H5LS) #----------------------------------------------------------------------------- @@ -6,6 +6,34 @@ PROJECT (HDF5_TOOLS_TEST_H5LS) #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) + #----------------------------------------------------------------------------- + # If plugin library tests can be tested + #----------------------------------------------------------------------------- + set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibls") + set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") + set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_ls.c) + TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") + target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + + # make plugins dir + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$" + "${CMAKE_BINARY_DIR}/plugins/$" + ) + include (CMakeTests.cmake) include (CMakeTestsVDS.cmake) diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index a66ae40..d5d0eb1 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -29,6 +29,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tslink.h5 ${HDF5_TOOLS_DIR}/testfiles/tsoftlinks.h5 ${HDF5_TOOLS_DIR}/testfiles/tstr.h5 + ${HDF5_TOOLS_DIR}/testfiles/tudfilter.h5 ${HDF5_TOOLS_DIR}/testfiles/tudlink.h5 ${HDF5_TOOLS_DIR}/testfiles/tvldtypes1.h5 ${HDF5_TOOLS_DIR}/testfiles/tdset_idx.h5 @@ -87,6 +88,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tsaf.ls ${HDF5_TOOLS_DIR}/testfiles/tslink-1.ls ${HDF5_TOOLS_DIR}/testfiles/tstr-1.ls + ${HDF5_TOOLS_DIR}/testfiles/tudfilter.ls ${HDF5_TOOLS_DIR}/testfiles/tudlink-1.ls ${HDF5_TOOLS_DIR}/testfiles/tvldtypes1.ls ${HDF5_TOOLS_DIR}/testfiles/tvldtypes2le.ls @@ -100,7 +102,7 @@ foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${listfiles}" NAME) HDFTEST_COPY_FILE("${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5ls_files") - endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach () add_custom_target(h5ls_files ALL COMMENT "Copying files needed by h5ls tests" DEPENDS ${h5ls_files_list}) ############################################################################## @@ -109,7 +111,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_TEST resultfile resultcode) + macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) @@ -120,7 +122,7 @@ if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -132,8 +134,35 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST file) + endif () + endmacro () + + macro (ADD_H5_UD_TEST testname resultcode resultfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5LS_UD-${testname}-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${resultfile}.out + testfiles/${resultfile}.out.err + ) + add_test ( + NAME H5LS_UD-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ls" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5LS_UD-${testname} PROPERTIES DEPENDS H5LS_UD-${testname}-clearall-objects) + endif () + endmacro () ############################################################################## ############################################################################## @@ -257,9 +286,9 @@ set_tests_properties (H5LS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5LS-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # See which filters are usable (and skip tests for filters we # don't have). Do this by searching H5pubconf.h to see which @@ -268,11 +297,11 @@ # detect whether the encoder is present. if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif (H5_HAVE_FILTER_DEFLATE) + endif () if (H5_HAVE_FILTER_SZIP) set (USE_FILTER_SZIP "true") - endif (H5_HAVE_FILTER_SZIP) + endif () # test the help syntax ADD_H5_TEST (help-1 0 -w80 -h) @@ -383,9 +412,9 @@ # ( HDFFV-7838, ) if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tattrreg_be 0 -w80 -v -d tattrreg.h5) - else (H5_WORDS_BIGENDIAN) + else () ADD_H5_TEST (tattrreg_le 0 -w80 -v -d tattrreg.h5) - endif (H5_WORDS_BIGENDIAN) + endif () # test for non-existing file ADD_H5_TEST (nosuchfile 1 nosuchfile.h5) @@ -393,20 +422,25 @@ # test for variable length data types in verbose mode if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5) - else (H5_WORDS_BIGENDIAN) + else () ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5) - endif (H5_WORDS_BIGENDIAN) + endif () # test for dataset region references data types in verbose mode if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) - else (H5_WORDS_BIGENDIAN) + else () ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) - endif (H5_WORDS_BIGENDIAN) + endif () # test for file with datasets that use Fixed Array chunk indices if (USE_FILTER_DEFLATE) # data read internal filters ADD_H5_TEST (tdset_idx 0 -w80 -d tdset_idx.h5) - endif (USE_FILTER_DEFLATE) + endif () + +############################################################################## +### P L U G I N T E S T S +############################################################################## +ADD_H5_UD_TEST (h5ls_plugin_test 0 tudfilter -w80 -d tudfilter.h5) diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index 72e14a1..0a7a216 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -49,7 +49,7 @@ foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${listfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5ls_vds_files") - endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach () add_custom_target(h5ls_vds_files ALL COMMENT "Copying files needed by h5ls_vds tests" DEPENDS ${h5ls_vds_files_list}) ############################################################################## @@ -58,7 +58,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_VDS_TEST resultfile resultcode) + macro (ADD_H5_VDS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) @@ -69,7 +69,7 @@ if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -81,8 +81,8 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_VDS_TEST file) + endif () + endmacro () ############################################################################## ############################################################################## @@ -124,9 +124,9 @@ set_tests_properties (H5LS_VDS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5LS_VDS-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5LS_VDS-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () ADD_H5_VDS_TEST (tvds-1 0 -w80 -v -S 1_vds.h5) ADD_H5_VDS_TEST (tvds-2 0 -w80 -v -S 2_vds.h5) diff --git a/tools/test/h5ls/Makefile.am b/tools/test/h5ls/Makefile.am index 6f3d3dd..170aa63 100644 --- a/tools/test/h5ls/Makefile.am +++ b/tools/test/h5ls/Makefile.am @@ -27,8 +27,24 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib TEST_SCRIPT=testh5ls.sh testh5lsvds.sh check_SCRIPTS=$(TEST_SCRIPT) SCRIPT_DEPEND=../../src/h5ls/h5ls$(EXEEXT) +if HAVE_SHARED_CONDITIONAL +if USE_PLUGINS_CONDITIONAL + TEST_SCRIPT += h5ls_plugin.sh +endif +endif # All programs depend on the hdf5 and h5tools libraries LDADD=$(LIBH5TOOLS) $(LIBHDF5) +if HAVE_SHARED_CONDITIONAL + # Build it as shared library if configure is enabled for shared library. + lib_LTLIBRARIES=libdynlibls.la + libdynlibls_la_SOURCES=dynlib_ls.c + +install-exec-hook: + $(RM) $(DESTDIR)$(libdir)/*dynlib* +endif + +DISTCLEANFILES=h5ls_plugin.sh + include $(top_srcdir)/config/conclude.am diff --git a/tools/test/h5ls/testh5ls.sh.in b/tools/test/h5ls/testh5ls.sh.in index 15282f6..1b3f67d 100644 --- a/tools/test/h5ls/testh5ls.sh.in +++ b/tools/test/h5ls/testh5ls.sh.in @@ -183,7 +183,7 @@ 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 ." @@ -241,7 +241,7 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err @@ -253,37 +253,37 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test @@ -427,9 +427,9 @@ fi if test $USE_FILTER_DEFLATE = "yes" ; then # data read internal filters TOOLTEST tdset_idx.ls 0 -w80 -d tdset_idx.h5 +else + echo "***skip testing tdset_idx.h5" fi -echo "***skip testing tdset_idx.h5" -TOOLTEST tdset_idx.ls 0 -w80 -d tdset_idx.h5 # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index cecec53..9d67ec3 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_TEST_H5REPACK) #----------------------------------------------------------------------------- diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 576fb58..aa5a1b4 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -17,9 +17,9 @@ if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) - endif (DIRECT_VFD) + endif () - MACRO (ADD_VFD_TEST vfdname resultcode) + macro (ADD_VFD_TEST vfdname resultcode) add_test ( NAME H5REPACK-VFD-${vfdname}-h5repacktest COMMAND "${CMAKE_COMMAND}" @@ -33,10 +33,10 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") - ENDMACRO (ADD_VFD_TEST) - endif (HDF5_TEST_VFD) + endmacro () + endif () # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory @@ -131,7 +131,7 @@ foreach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${h5_file}" NAME) HDFTEST_COPY_FILE("${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5repack_files") - endforeach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach () add_custom_target(h5repack_files ALL COMMENT "Copying files needed by h5repack tests" DEPENDS ${h5repack_files_list}) ############################################################################## @@ -140,7 +140,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_HELP_TEST testname resultcode) + macro (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5REPACK-${testname} COMMAND $ ${ARGN}) @@ -149,7 +149,7 @@ set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) endif () set (last_test "H5REPACK-${testname}") - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5REPACK-h5repack-${testname} COMMAND "${CMAKE_COMMAND}" @@ -161,18 +161,18 @@ -D "TEST_REFERENCE=h5repack-${testname}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_HELP_TEST) + endif () + endmacro () - MACRO (ADD_H5_TEST_OLD testname testtype testfile) + macro (ADD_H5_TEST_OLD testname testtype testfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_OLD-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else ("${testtype}" STREQUAL "SKIP") + endif () + else () add_test ( NAME H5REPACK_OLD-${testname} COMMAND $ ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} @@ -185,18 +185,18 @@ COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) - endif ("${testtype}" STREQUAL "SKIP") - ENDMACRO (ADD_H5_TEST_OLD) + endif () + endmacro () - MACRO (ADD_H5_TEST testname testtype testfile) + macro (ADD_H5_TEST testname testtype testfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else ("${testtype}" STREQUAL "SKIP") + endif () + else () add_test ( NAME H5REPACK-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} @@ -209,24 +209,24 @@ COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) - endif ("${testtype}" STREQUAL "SKIP") - ENDMACRO (ADD_H5_TEST) + endif () + endmacro () - MACRO (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) + macro (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_CMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else ("${testtype}" STREQUAL "SKIP") + endif () + else () # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_CMP-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" @@ -239,22 +239,22 @@ -D "TEST_REFERENCE=${resultfile}-${testname}.tst" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) endif () - endif ("${testtype}" STREQUAL "SKIP") - ENDMACRO (ADD_H5_CMP_TEST) + endif () + endmacro () - MACRO (ADD_H5_MASK_TEST testname testtype resultcode resultfile) + macro (ADD_H5_MASK_TEST testname testtype resultcode resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_MASK-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else ("${testtype}" STREQUAL "SKIP") + endif () + else () # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -273,22 +273,22 @@ -D "TEST_REFERENCE=${resultfile}-${testname}.tst" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS ${last_test}) endif () - endif ("${testtype}" STREQUAL "SKIP") - ENDMACRO (ADD_H5_MASK_TEST) + endif () + endmacro () - MACRO (ADD_H5_DMP_TEST testname testtype resultcode resultfile) + macro (ADD_H5_DMP_TEST testname testtype resultcode resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_DMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else ("${testtype}" STREQUAL "SKIP") + endif () + else () # If using memchecker add tests without using scripts add_test ( NAME H5REPACK_DMP-${testname} @@ -309,19 +309,19 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - endif ("${testtype}" STREQUAL "SKIP") - ENDMACRO (ADD_H5_DMP_TEST) + endif () + endif () + endmacro () - MACRO (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) + macro (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else ("${testtype}" STREQUAL "SKIP") + endif () + else () if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname} @@ -349,7 +349,7 @@ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - else ("${resultcode}" STREQUAL "0") + else () if ("${testfilter}" STREQUAL "CHUNKED") set (nottestfilter "(CONTIGUOUS|COMPACT)") endif () @@ -372,20 +372,20 @@ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - endif ("${resultcode}" STREQUAL "0") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - endif ("${testtype}" STREQUAL "SKIP") - ENDMACRO (ADD_H5_VERIFY_TEST) + endif () + endif () + endif () + endmacro () - MACRO (ADD_H5_VERIFY_VDS testname testtype resultcode testfile testdset testfilter) + macro (ADD_H5_VERIFY_VDS testname testtype resultcode testfile testdset testfilter) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - else ("${testtype}" STREQUAL "SKIP") + endif () + else () if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname} @@ -408,11 +408,11 @@ ) set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}) - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - endif ("${testtype}" STREQUAL "SKIP") - ENDMACRO (ADD_H5_VERIFY_VDS) + endif () + endif () + endmacro () - MACRO (ADD_H5_TEST_META testname testfile) + macro (ADD_H5_TEST_META testname testfile) add_test ( NAME H5REPACK_META-${testname}_N COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 @@ -429,9 +429,9 @@ add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) set_tests_properties (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true") set_tests_properties (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M) - ENDMACRO (ADD_H5_TEST_META) + endmacro () - MACRO (ADD_H5_UD_TEST testname resultcode resultfile) + macro (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -469,8 +469,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_UD_TEST) + endif () + endmacro () ############################################################################## ############################################################################## @@ -708,7 +708,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () ADD_HELP_TEST(help 0 -h) @@ -717,14 +717,14 @@ if (HDF5_ENABLE_SZIP_ENCODING) set (passRegex "yes") set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") - else (HDF5_ENABLE_SZIP_ENCODING) + else () set (passRegex "no") set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - endif (HDF5_ENABLE_SZIP_ENCODING) - else (HDF5_ENABLE_SZIP_SUPPORT) + endif () + else () set (passRegex "no") set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - endif (HDF5_ENABLE_SZIP_SUPPORT) + endif () set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) add_test (NAME H5REPACK-h5repacktest COMMAND $) @@ -748,15 +748,15 @@ set (USE_FILTER_SZIP_ENCODER "no") if (HDF5_ENABLE_SZIP_ENCODING) set (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) - endif (HDF5_ENABLE_SZIP_ENCODING) + endif () if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif (H5_HAVE_FILTER_DEFLATE) + endif () if (H5_HAVE_FILTER_SZIP) set (USE_FILTER_SZIP "true") - endif (H5_HAVE_FILTER_SZIP) + endif () # copy files (these files have no filters) ADD_H5_TEST (fill "TEST" ${FILE0}) @@ -768,10 +768,10 @@ # nested 8bit enum in both deflated and non-deflated datafiles if (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (nested_8bit_enum "TEST" h5repack_nested_8bit_enum.h5) - else (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (nested_8bit_enum "TEST" h5repack_nested_8bit_enum_deflated.h5) - endif (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (nested_8bit_enum "TEST" h5repack_nested_8bit_enum.h5) + else () + ADD_H5_TEST (nested_8bit_enum "TEST" h5repack_nested_8bit_enum_deflated.h5) + endif () # use $FILE4 to write some filters (this file has no filters) @@ -780,7 +780,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (gzip_individual ${TESTTYPE} ${arg}) # gzip for all @@ -788,7 +788,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (gzip_all ${TESTTYPE} ${arg}) # szip with individual object @@ -796,7 +796,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + endif () ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) # szip for all @@ -804,7 +804,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + endif () ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) # shuffle with individual object @@ -828,7 +828,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) # verbose gzip with individual object @@ -836,7 +836,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) ########################################################### @@ -848,7 +848,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + endif () ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) # szip remove @@ -856,7 +856,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + endif () ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) # deflate copy @@ -864,7 +864,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (deflate_copy ${TESTTYPE} ${arg}) # deflate remove @@ -872,7 +872,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (deflate_remove ${TESTTYPE} ${arg}) # shuffle copy @@ -920,7 +920,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER) + endif () ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) #filter conversions @@ -928,14 +928,14 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) set (arg ${FILE7} -f dset_szip:GZIP=1) set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) #limit @@ -943,7 +943,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_DMP_TEST (deflate_limit ${TESTTYPE} 0 ${arg}) #file @@ -951,7 +951,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) ######################################################### @@ -1039,7 +1039,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) @@ -1047,7 +1047,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # several global filters @@ -1055,7 +1055,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST (global_filters ${TESTTYPE} ${arg}) # syntax of -i infile -o outfile @@ -1064,7 +1064,7 @@ set (TESTTYPE "LEGACY") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_TEST_OLD (old_style_layout_short_switches ${TESTTYPE} ${arg}) # add a userblock to file @@ -1080,7 +1080,10 @@ ADD_H5_TEST (upgrade_layout "TEST" ${FILE14}) # test for datum size > H5TOOLS_MALLOCSIZE - ADD_H5_TEST (gt_mallocsize "TEST" ${FILE1} -f GZIP=1) + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif () + ADD_H5_TEST (gt_mallocsize ${TESTTYPE} ${FILE1} -f GZIP=1) # Check repacking file with committed datatypes in odd configurations ADD_H5_TEST (committed_dt "TEST" ${FILE15}) @@ -1114,31 +1117,31 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_VERIFY_VDS (vds_dset_chunk20x10x5 ${TESTTYPE} 0 ${FILEV1} vds_dset CHUNKED -l vds_dset:CHUNK=20x10x5) set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_VERIFY_VDS (vds_chunk2x5x8 ${TESTTYPE} 0 ${FILEV3_1} vds_dset CHUNKED -l vds_dset:CHUNK=2x5x8) set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_VERIFY_VDS (vds_chunk3x6x9 ${TESTTYPE} 0 ${FILEV2} vds_dset CHUNKED -l vds_dset:CHUNK=3x6x9) set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_VERIFY_VDS (vds_compa ${TESTTYPE} 0 ${FILEV4} vds_dset COMPACT -l vds_dset:COMPA) set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif (NOT USE_FILTER_DEFLATE) + endif () ADD_H5_VERIFY_VDS (vds_conti ${TESTTYPE} 0 ${FILEV4} vds_dset CONTIGUOUS -l vds_dset:CONTI) ############################################################################## @@ -1151,12 +1154,12 @@ set (TESTRETVAL 255) if (WIN32) set (TESTRETVAL -1) - endif() + endif () ADD_H5_CMP_TEST (plugin_zero "" "TEST" ${TESTRETVAL} h5repack_layout.h5 -v -f UD=250,0) if (HDF5_TEST_VFD) # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - endforeach (vfd ${VFD_LIST}) - endif (HDF5_TEST_VFD) + endforeach () + endif () diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index 4d3cae8..23e0663 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -29,14 +29,14 @@ TESTNAME=h5repack EXIT_SUCCESS=0 EXIT_FAILURE=1 -H5REPACK=../../src/h5repack/h5repack # The tool name -H5REPACK_BIN=`pwd`/$H5REPACK # The path of the tool binary +H5REPACK=../../src/h5repack/h5repack # The tool name +H5REPACK_BIN=`pwd`/$H5REPACK # The path of the tool binary -H5DIFF=../../src/h5diff/h5diff # The h5diff tool name -H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary +H5DIFF=../../src/h5diff/h5diff # The h5diff tool name +H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary -H5DUMP=../../src/h5dump/h5dump # The h5dump tool name -H5DUMP_BIN=`pwd`/$H5DUMP # The path of the h5dump tool binary +H5DUMP=../../src/h5dump/h5dump # The h5dump tool name +H5DUMP_BIN=`pwd`/$H5DUMP # The path of the h5dump tool binary RM='rm -rf' CMP='cmp' @@ -386,7 +386,7 @@ VERIFY_LAYOUT_VDS() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi # clean up tmp files @@ -1223,27 +1223,27 @@ TOOLTEST_META meta_long h5repack_layout.h5 --metadata_block_size=8192 # layout conversions ############################################################### if test $USE_FILTER_DEFLATE != "yes" ; then - SKIP vds_dset_chunk_20x10x5 + SKIP vds_dset_chunk_20x10x5 else - VERIFY_LAYOUT_VDS vds_dset_chunk_20x10x5 1_vds.h5 vds_dset CHUNKED --layout vds_dset:CHUNK=20x10x5 + VERIFY_LAYOUT_VDS vds_dset_chunk_20x10x5 1_vds.h5 vds_dset CHUNKED --layout vds_dset:CHUNK=20x10x5 fi if test $USE_FILTER_DEFLATE != "yes" ; then - SKIP vds_chunk2x5x8 + SKIP vds_chunk2x5x8 else - VERIFY_LAYOUT_VDS vds_chunk2x5x8 3_1_vds.h5 vds_dset CHUNKED -l vds_dset:CHUNK=2x5x8 + VERIFY_LAYOUT_VDS vds_chunk2x5x8 3_1_vds.h5 vds_dset CHUNKED -l vds_dset:CHUNK=2x5x8 fi if test $USE_FILTER_DEFLATE != "yes" ; then - SKIP vds_chunk3x6x9 + SKIP vds_chunk3x6x9 else - VERIFY_LAYOUT_VDS vds_chunk3x6x9 2_vds.h5 vds_dset CHUNKED -l vds_dset:CHUNK=3x6x9 + VERIFY_LAYOUT_VDS vds_chunk3x6x9 2_vds.h5 vds_dset CHUNKED -l vds_dset:CHUNK=3x6x9 fi if test $USE_FILTER_DEFLATE != "yes" ; then - SKIP vds_compa 4_vds.h5 + SKIP vds_compa 4_vds.h5 else - VERIFY_LAYOUT_VDS vds_compa 4_vds.h5 vds_dset COMPACT -l vds_dset:COMPA + VERIFY_LAYOUT_VDS vds_compa 4_vds.h5 vds_dset COMPACT -l vds_dset:COMPA fi if test $USE_FILTER_DEFLATE != "yes" ; then diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index 82b45fc..abdda08 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -97,7 +97,6 @@ const char *H5REPACK_FILENAMES[] = { /* Name of tool */ #define PROGRAMNAME "h5repacktst" - #define DIM1 40 #define DIM2 20 #define CDIM1 DIM1/2 @@ -192,7 +191,7 @@ int main (void) puts("Testing h5repack:"); /* make the test files */ - TESTING(" generating datasets"); + TESTING(" generating files for testing"); if (make_testfiles() < 0) GOERROR; PASSED(); diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index 98cfed7..10ac5e0 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_TEST_H5STAT) #----------------------------------------------------------------------------- @@ -17,6 +17,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5stat_gentest COMMAND $) - endif (HDF5_BUILD_GENERATORS) + endif () include (CMakeTests.cmake) diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake index 39faca0..f6735d5 100644 --- a/tools/test/h5stat/CMakeTests.cmake +++ b/tools/test/h5stat/CMakeTests.cmake @@ -52,11 +52,11 @@ foreach (ddl_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/testfiles/${ddl_file}" "${PROJECT_BINARY_DIR}/${ddl_file}" "h5stat_files") - endforeach (ddl_file ${HDF5_REFERENCE_FILES}) + endforeach () foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "h5stat_files") - endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach () add_custom_target(h5stat_files ALL COMMENT "Copying files needed by h5stat tests" DEPENDS ${h5stat_files_list}) ############################################################################## @@ -65,16 +65,16 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_TEST resultfile resultcode) + macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5STAT-${resultfile} COMMAND $ ${ARGN}) if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5STAT-${resultfile} @@ -87,8 +87,8 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST file) + endif () + endmacro () ############################################################################## ############################################################################## @@ -167,9 +167,9 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5STAT-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # Test for help flag ADD_H5_TEST (h5stat_help1 0 -h) diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index a53fa73..029d7a9 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_TEST_MISC) #----------------------------------------------------------------------------- @@ -19,7 +19,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) add_subdirectory (${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/vds) - endif (HDF5_BUILD_GENERATORS) + endif () add_executable (h5repart_test ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/repart_test.c) TARGET_NAMING (h5repart_test STATIC) diff --git a/tools/test/misc/CMakeTests.cmake b/tools/test/misc/CMakeTests.cmake index 9835e1e..9ecdeae 100644 --- a/tools/test/misc/CMakeTests.cmake +++ b/tools/test/misc/CMakeTests.cmake @@ -31,7 +31,7 @@ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "h5repart_files") - endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach () add_custom_target(h5repart_files ALL COMMENT "Copying files needed by h5repart tests" DEPENDS ${h5repart_files_list}) set (HDF5_MKGRP_TEST_FILES @@ -56,7 +56,7 @@ foreach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_mkgrp_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}" "h5mkgrp_files") - endforeach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) + endforeach () HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/testfiles/h5mkgrp_help.txt" "${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_help.txt" "h5mkgrp_files") add_custom_target(h5mkgrp_files ALL COMMENT "Copying files needed by h5mkgrp tests" DEPENDS ${h5mkgrp_files_list}) @@ -69,7 +69,7 @@ ############################################################################## ############################################################################## - MACRO (ADD_H5_TEST resultfile resultcode resultoption) + macro (ADD_H5_TEST resultfile resultcode resultoption) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5MKGRP-${resultfile}-clear-objects @@ -78,7 +78,7 @@ ${resultfile}.h5 ) set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif () add_test ( NAME H5MKGRP-${resultfile} @@ -88,8 +88,8 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") - else (HDF5_ENABLE_USING_MEMCHECKER) + endif () + else () set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) add_test ( NAME H5MKGRP-${resultfile}-h5ls @@ -104,13 +104,13 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) + endif () + endmacro () - MACRO (ADD_H5_CMP resultfile resultcode) + macro (ADD_H5_CMP resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND $ ${ARGN}) - else (HDF5_ENABLE_USING_MEMCHECKER) + else () add_test ( NAME H5MKGRP_CMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -130,8 +130,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) - endif (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_CMP resultfile resultcode) + endif () + endmacro () ############################################################################## ############################################################################## @@ -154,7 +154,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5REPART-clearall-objects") # repartition family member size to 20,000 bytes. @@ -192,7 +192,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5CLEAR-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5CLEAR-clearall-objects") # create the output files to be used. @@ -313,9 +313,9 @@ set_tests_properties (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () set (last_test "H5MKGRP-clearall-objects") - endif (HDF5_ENABLE_USING_MEMCHECKER) + endif () # Check that help & version is displayed properly ADD_H5_CMP (h5mkgrp_help 0 "-h") diff --git a/tools/test/misc/Makefile.am b/tools/test/misc/Makefile.am index 1025a8a..fc9e1c1 100644 --- a/tools/test/misc/Makefile.am +++ b/tools/test/misc/Makefile.am @@ -36,7 +36,7 @@ SCRIPT_DEPEND=../../src/misc/h5repart$(EXEEXT) ../../src/misc/h5mkgrp$(EXEEXT) . # Temporary files. *.h5 are generated by h5repart_gentest. They should # copied to the testfiles/ directory if update is required. fst_family*.h5 # and scd_family*.h5 were created by setting the HDF5_NOCLEANUP variable. -CHECK_CLEANFILES+=*.h5 ../testfiles/fst_family*.h5 ../testfiles/scd_family*.h5 +CHECK_CLEANFILES+=*.h5 ../testfiles/fst_family*.h5 ../testfiles/scd_family*.h5 append.log # These were generated by configure. Remove them only when distclean. DISTCLEANFILES=testh5repart.sh testh5clear.sh diff --git a/tools/test/misc/testh5repart.sh.in b/tools/test/misc/testh5repart.sh.in index 2106a1d..9a9dd9a 100644 --- a/tools/test/misc/testh5repart.sh.in +++ b/tools/test/misc/testh5repart.sh.in @@ -43,7 +43,7 @@ SRC_TOOLS="$srcdir/../.." SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" -TESTDIR=./testfiles +TESTDIR=./testrepart test -d $TESTDIR || mkdir -p $TESTDIR # diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index 23dc85c..ec672e5 100644 --- a/tools/test/misc/vds/CMakeLists.txt +++ b/tools/test/misc/vds/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_TEST_MISC_VDS) #----------------------------------------------------------------------------- @@ -12,7 +12,7 @@ MACRO (ADD_H5_GENERATOR genfile) TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/tools) -ENDMACRO (ADD_H5_GENERATOR genfile) +ENDMACRO () # generator executables set (H5_GENERATORS @@ -25,4 +25,4 @@ set (H5_GENERATORS foreach (gen ${H5_GENERATORS}) ADD_H5_GENERATOR (${gen}) -endforeach (gen ${H5_GENERATORS}) +endforeach () diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index bea2d0c..20250c6 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1.0) +cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_TOOLS_TEST_PERFORM ) #----------------------------------------------------------------------------- @@ -40,7 +40,7 @@ if (HDF5_BUILD_PERFORM_STANDALONE) set_property (TARGET h5perf_serial_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) -endif (HDF5_BUILD_PERFORM_STANDALONE) +endif () #-- Adding test for chunk set (chunk_SOURCES @@ -118,7 +118,7 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING) set_property (TARGET h5perf_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) - endif (HDF5_BUILD_PERFORM_STANDALONE) -endif (H5_HAVE_PARALLEL AND BUILD_TESTING) + endif () +endif () include (CMakeTests.cmake) diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake index 0ea40a3..d286988 100644 --- a/tools/test/perform/CMakeTests.cmake +++ b/tools/test/perform/CMakeTests.cmake @@ -27,28 +27,119 @@ add_test ( x-gnuplot ) -add_test (NAME PERFORM_h5perf_serial COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_h5perf_serial COMMAND $) +else () + add_test (NAME PERFORM_h5perf_serial COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=h5perf_serial.txt" + #-D "TEST_REFERENCE=h5perf_serial.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (PERFORM_h5perf_serial PROPERTIES TIMEOUT 1800) if (HDF5_BUILD_PERFORM_STANDALONE) add_test (NAME PERFORM_h5perf_serial_alone COMMAND $) -endif (HDF5_BUILD_PERFORM_STANDALONE) +endif () -add_test (NAME PERFORM_chunk COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_chunk COMMAND $) +else () + add_test (NAME PERFORM_chunk COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=chunk.txt" + #-D "TEST_REFERENCE=chunk.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () -add_test (NAME PERFORM_iopipe COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_iopipe COMMAND $) +else () + add_test (NAME PERFORM_iopipe COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=iopipe.txt" + #-D "TEST_REFERENCE=iopipe.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () -add_test (NAME PERFORM_overhead COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_overhead COMMAND $) +else () + add_test (NAME PERFORM_overhead COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=overhead.txt" + #-D "TEST_REFERENCE=overhead.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () -add_test (NAME PERFORM_perf_meta COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_perf_meta COMMAND $) +else () + add_test (NAME PERFORM_perf_meta COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=perf_meta.txt" + #-D "TEST_REFERENCE=perf_meta.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () -add_test (NAME PERFORM_zip_perf_help COMMAND $ "-h") -add_test (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_zip_perf_help COMMAND $ "-h") +else () + add_test (NAME PERFORM_zip_perf_help COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=zip_perf-h.txt" + #-D "TEST_REFERENCE=zip_perf-h.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) +else () + add_test (NAME PERFORM_zip_perf COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=zip_perf.txt" + #-D "TEST_REFERENCE=zip_perf.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () if (H5_HAVE_PARALLEL) add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) if (HDF5_BUILD_PERFORM_STANDALONE) add_test (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - endif (HDF5_BUILD_PERFORM_STANDALONE) -endif (H5_HAVE_PARALLEL) + endif () +endif () diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c index aceccb0..5bae832 100644 --- a/tools/test/perform/sio_perf.c +++ b/tools/test/perform/sio_perf.c @@ -100,11 +100,7 @@ static const char *progname = "h5perf_serial"; * It seems that only the options that accept additional information * such as dataset size (-e) require the colon next to it. */ -#if 1 static const char *s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:"; -#else -static const char *s_opts = "a:A:bB:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:wx:X:"; -#endif /* 1 */ static struct long_options l_opts[] = { { "align", require_arg, 'a' }, { "alig", require_arg, 'a' }, -- cgit v0.12 From 281c24a5a91b16eaf498e5dd5af783773c228758 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 10 Mar 2017 09:05:36 -0600 Subject: Revert "Merge latest changes from develop" This reverts commit 104d63f25a8cb6e156bc901eb85aafc0b67775ee. --- CMakeFilters.cmake | 54 +- CMakeInstallation.cmake | 146 +- CMakeLists.txt | 330 ++--- CTestConfig.cmake | 4 +- MANIFEST | 59 +- UserMacros.cmake | 7 +- c++/CMakeLists.txt | 8 +- c++/examples/CMakeLists.txt | 12 +- c++/examples/CMakeTests.cmake | 49 +- c++/src/CMakeLists.txt | 9 +- c++/src/H5AbstractDs.cpp | 436 +++--- c++/src/H5AbstractDs.h | 68 +- c++/src/H5ArrayType.cpp | 142 +- c++/src/H5ArrayType.h | 48 +- c++/src/H5AtomType.cpp | 360 ++--- c++/src/H5AtomType.h | 60 +- c++/src/H5Attribute.cpp | 500 +++---- c++/src/H5Attribute.h | 94 +- c++/src/H5Classes.h | 52 +- c++/src/H5CommonFG.cpp | 413 +++--- c++/src/H5CommonFG.h | 68 +- c++/src/H5CompType.cpp | 582 ++++---- c++/src/H5CompType.h | 126 +- c++/src/H5CppDoc.h | 18 +- c++/src/H5DataSet.cpp | 820 +++++----- c++/src/H5DataSet.h | 120 +- c++/src/H5DataSpace.cpp | 793 +++++----- c++/src/H5DataSpace.h | 152 +- c++/src/H5DataType.cpp | 928 ++++++------ c++/src/H5DataType.h | 156 +- c++/src/H5DcreatProp.cpp | 902 +++++------ c++/src/H5DcreatProp.h | 199 +-- c++/src/H5DxferProp.cpp | 578 ++++---- c++/src/H5DxferProp.h | 126 +- c++/src/H5EnumType.cpp | 354 ++--- c++/src/H5EnumType.h | 72 +- c++/src/H5Exception.cpp | 650 ++++---- c++/src/H5Exception.h | 154 +- c++/src/H5FaccProp.cpp | 862 +++++------ c++/src/H5FaccProp.h | 164 +- c++/src/H5FcreatProp.cpp | 365 ++--- c++/src/H5FcreatProp.h | 89 +- c++/src/H5File.cpp | 661 ++++----- c++/src/H5File.h | 125 +- c++/src/H5FloatType.cpp | 402 ++--- c++/src/H5FloatType.h | 66 +- c++/src/H5Group.cpp | 146 +- c++/src/H5Group.h | 58 +- c++/src/H5IdComponent.cpp | 392 ++--- c++/src/H5IdComponent.h | 110 +- c++/src/H5Include.h | 4 +- c++/src/H5IntType.cpp | 168 +-- c++/src/H5IntType.h | 42 +- c++/src/H5LaccProp.cpp | 34 +- c++/src/H5LaccProp.h | 26 +- c++/src/H5Library.cpp | 200 +-- c++/src/H5Library.h | 36 +- c++/src/H5Location.cpp | 1921 ++++++++++++------------ c++/src/H5Location.h | 298 ++-- c++/src/H5Object.cpp | 419 +++--- c++/src/H5Object.h | 136 +- c++/src/H5OcreatProp.cpp | 124 +- c++/src/H5OcreatProp.h | 42 +- c++/src/H5PredType.cpp | 453 +++--- c++/src/H5PredType.h | 328 ++-- c++/src/H5PropList.cpp | 769 +++++----- c++/src/H5PropList.h | 142 +- c++/src/H5StrType.cpp | 326 ++-- c++/src/H5StrType.h | 56 +- c++/src/H5VarLenType.cpp | 96 +- c++/src/H5VarLenType.h | 32 +- c++/test/CMakeLists.txt | 2 +- c++/test/CMakeTests.cmake | 27 +- c++/test/dsets.cpp | 1668 ++++++++++----------- c++/test/h5cpputil.cpp | 142 +- c++/test/h5cpputil.h | 70 +- c++/test/tarray.cpp | 486 +++--- c++/test/tattr.cpp | 2062 +++++++++++++------------- c++/test/tcompound.cpp | 958 ++++++------ c++/test/tdspl.cpp | 124 +- c++/test/testhdf5.cpp | 88 +- c++/test/tfile.cpp | 844 +++++------ c++/test/tfilter.cpp | 90 +- c++/test/th5s.cpp | 575 +++---- c++/test/titerate.cpp | 370 ++--- c++/test/tlinks.cpp | 312 ++-- c++/test/tobject.cpp | 500 +++---- c++/test/trefer.cpp | 1062 ++++++------- c++/test/ttypes.cpp | 622 ++++---- c++/test/tvlstr.cpp | 1022 ++++++------- config/cmake/CMakeFindJavaCommon.cmake | 14 +- config/cmake/ConfigureChecks.cmake | 102 +- config/cmake/FindHDFJAVA.cmake.in | 12 +- config/cmake/FindJNI.cmake | 2 + config/cmake/HDF518_Examples.cmake.in | 80 +- config/cmake/HDF5Macros.cmake | 24 +- config/cmake/HDF5UseFortran.cmake | 285 ++-- config/cmake/HDF5_Examples.cmake.in | 264 ++-- config/cmake/HDF5_Process_Flex_Files.cmake | 4 +- config/cmake/HDFCompilerFlags.cmake | 200 ++- config/cmake/README.txt.cmake.in | 2 +- config/cmake/UseJava.cmake | 2 +- config/cmake/UserMacros/Windows_MT.cmake | 19 +- config/cmake/cacheinit.cmake | 2 - config/cmake/hdf5-config-version.cmake.in | 30 +- config/cmake/hdf5-config.cmake.in | 2 +- config/cmake/jrunTest.cmake | 154 +- config/cmake/scripts/CTestScript.cmake | 379 ++--- config/cmake/scripts/HDF5config.cmake | 209 +-- config/cmake/userblockTest.cmake | 34 +- config/cmake/vfdTest.cmake | 45 +- config/cmake_ext_mod/CheckTypeSize.cmake | 24 +- config/cmake_ext_mod/ConfigureChecks.cmake | 208 +-- config/cmake_ext_mod/FindMPI.cmake | 37 +- config/cmake_ext_mod/FindSZIP.cmake | 44 +- config/cmake_ext_mod/HDFLibMacros.cmake | 43 +- config/cmake_ext_mod/HDFMacros.cmake | 160 +- config/cmake_ext_mod/HDFUseFortran.cmake | 23 +- config/cmake_ext_mod/grepTest.cmake | 20 +- config/cmake_ext_mod/prunTest.cmake | 145 ++ config/cmake_ext_mod/runTest.cmake | 80 +- configure.ac | 14 +- examples/CMakeLists.txt | 12 +- examples/CMakeTests.cmake | 92 +- fortran/CMakeLists.txt | 12 +- fortran/examples/CMakeLists.txt | 16 +- fortran/examples/CMakeTests.cmake | 88 +- fortran/src/CMakeLists.txt | 58 +- fortran/src/Makefile.am | 4 +- fortran/test/CMakeLists.txt | 60 +- fortran/test/CMakeTests.cmake | 124 +- fortran/testpar/CMakeLists.txt | 10 +- hl/CMakeLists.txt | 10 +- hl/c++/CMakeLists.txt | 6 +- hl/c++/examples/CMakeLists.txt | 4 +- hl/c++/examples/CMakeTests.cmake | 17 +- hl/c++/src/CMakeLists.txt | 9 +- hl/c++/test/CMakeLists.txt | 2 +- hl/c++/test/CMakeTests.cmake | 15 +- hl/examples/CMakeLists.txt | 6 +- hl/examples/CMakeTests.cmake | 27 +- hl/fortran/CMakeLists.txt | 6 +- hl/fortran/examples/CMakeLists.txt | 8 +- hl/fortran/examples/CMakeTests.cmake | 17 +- hl/fortran/src/CMakeLists.txt | 44 +- hl/fortran/test/CMakeLists.txt | 10 +- hl/fortran/test/CMakeTests.cmake | 122 +- hl/src/CMakeLists.txt | 9 +- hl/test/CMakeLists.txt | 8 +- hl/test/CMakeTests.cmake | 23 +- hl/tools/CMakeLists.txt | 2 +- hl/tools/gif2h5/CMakeLists.txt | 24 +- hl/tools/h5watch/CMakeLists.txt | 18 +- hl/tools/h5watch/CMakeTests.cmake | 66 +- java/CMakeLists.txt | 12 +- java/examples/CMakeLists.txt | 2 +- java/examples/datasets/CMakeLists.txt | 40 +- java/examples/datasets/H5Ex_D_Chunk.java | 5 +- java/examples/datasets/H5Ex_D_Compact.java | 5 +- java/examples/datasets/runExample.sh.in | 2 - java/examples/datatypes/CMakeLists.txt | 28 +- java/examples/datatypes/runExample.sh.in | 1 - java/examples/groups/CMakeLists.txt | 38 +- java/examples/groups/runExample.sh.in | 8 - java/examples/intro/CMakeLists.txt | 30 +- java/examples/intro/runExample.sh.in | 1 - java/src/CMakeLists.txt | 2 +- java/src/Makefile.am | 1 - java/src/hdf/CMakeLists.txt | 2 +- java/src/hdf/hdf5lib/CMakeLists.txt | 4 +- java/src/hdf/hdf5lib/H5.java | 6 +- java/src/jni/CMakeLists.txt | 10 +- java/src/jni/h5Constants.c | 1222 +++++++-------- java/src/jni/h5dImp.h | 4 +- java/src/jni/h5fImp.h | 8 +- java/src/jni/h5gImp.h | 4 +- java/src/jni/h5oImp.h | 4 +- java/src/jni/h5tImp.h | 4 +- java/test/CMakeLists.txt | 16 +- java/test/JUnit-interface.txt | 3 +- java/test/TestH5Ocopy.java | 1 - java/test/TestH5Pvirtual.java | 5 +- java/test/junit.sh.in | 9 - release_docs/INSTALL_CMake.txt | 308 ++-- release_docs/RELEASE.txt | 1475 ++++++++++++++++-- release_docs/USING_CMake_Examples.txt | 4 +- release_docs/USING_HDF5_CMake.txt | 232 +-- src/CMakeLists.txt | 40 +- src/H5AC.c | 308 ++-- src/H5ACdbg.c | 203 +-- src/H5ACmpio.c | 80 +- src/H5ACpkg.h | 13 +- src/H5ACprivate.h | 69 +- src/H5ACpublic.h | 61 - src/H5B2pkg.h | 9 + src/H5Bpkg.h | 3 + src/H5C.c | 1850 ++++++++++------------- src/H5Cdbg.c | 467 +----- src/H5Cepoch.c | 5 +- src/H5Cmpio.c | 377 +++-- src/H5Cpkg.h | 564 ++----- src/H5Cprivate.h | 481 +----- src/H5Cquery.c | 5 +- src/H5EApkg.h | 15 + src/H5F.c | 74 +- src/H5FApkg.h | 9 + src/H5FDmulti.c | 14 +- src/H5FSpkg.h | 6 + src/H5Fint.c | 67 +- src/H5Fio.c | 2 +- src/H5Fpkg.h | 12 +- src/H5Fprivate.h | 4 - src/H5Fpublic.h | 1 - src/H5Fsuper.c | 58 +- src/H5Gpkg.h | 3 + src/H5HFcache.c | 684 +-------- src/H5HFpkg.h | 9 + src/H5HGpkg.h | 3 + src/H5HLpkg.h | 6 + src/H5MF.c | 193 ++- src/H5MFaggr.c | 15 +- src/H5MFprivate.h | 8 +- src/H5O.c | 7 +- src/H5Opkg.h | 13 +- src/H5Oprivate.h | 16 +- src/H5Pfapl.c | 255 ---- src/H5Ppublic.h | 2 - src/H5SMpkg.h | 2 + src/H5win32defs.h | 4 +- src/Makefile.am | 6 +- test/CMakeLists.txt | 137 +- test/CMakeTests.cmake | 288 ++-- test/Makefile.am | 51 +- test/cache.c | 417 +++--- test/cache_api.c | 16 +- test/cache_common.c | 132 +- test/cache_common.h | 3 +- test/cache_tagging.c | 10 +- test/dsets.c | 10 +- test/earray.c | 246 +++ test/enc_dec_plist.c | 7 - test/evict_on_close.c | 16 +- test/fheap.c | 104 +- test/fillval.c | 2 +- test/freespace.c | 10 +- test/gen_plist.c | 9 - test/h5test.c | 4 +- test/links.c | 15 +- test/objcopy.c | 2 +- test/swmr_check_compat_vfd.c | 6 +- test/testfiles/plist_files/dapl_32be | Bin 186 -> 136 bytes test/testfiles/plist_files/dapl_32le | Bin 186 -> 136 bytes test/testfiles/plist_files/dapl_64be | Bin 186 -> 136 bytes test/testfiles/plist_files/dapl_64le | Bin 186 -> 136 bytes test/testfiles/plist_files/def_dapl_32be | Bin 181 -> 131 bytes test/testfiles/plist_files/def_dapl_32le | Bin 181 -> 131 bytes test/testfiles/plist_files/def_dapl_64be | Bin 181 -> 131 bytes test/testfiles/plist_files/def_dapl_64le | Bin 181 -> 131 bytes test/testfiles/plist_files/def_dxpl_32be | Bin 245 -> 225 bytes test/testfiles/plist_files/def_dxpl_32le | Bin 245 -> 225 bytes test/testfiles/plist_files/def_dxpl_64be | Bin 245 -> 225 bytes test/testfiles/plist_files/def_dxpl_64le | Bin 245 -> 225 bytes test/testfiles/plist_files/def_fapl_32be | Bin 1520 -> 1460 bytes test/testfiles/plist_files/def_fapl_32le | Bin 1520 -> 1460 bytes test/testfiles/plist_files/def_fapl_64be | Bin 1520 -> 1460 bytes test/testfiles/plist_files/def_fapl_64le | Bin 1520 -> 1460 bytes test/testfiles/plist_files/dxpl_32be | Bin 249 -> 229 bytes test/testfiles/plist_files/dxpl_32le | Bin 249 -> 229 bytes test/testfiles/plist_files/dxpl_64be | Bin 249 -> 229 bytes test/testfiles/plist_files/dxpl_64le | Bin 249 -> 229 bytes test/testfiles/plist_files/fapl_32be | Bin 1522 -> 1462 bytes test/testfiles/plist_files/fapl_32le | Bin 1522 -> 1462 bytes test/testfiles/plist_files/fapl_64be | Bin 1522 -> 1462 bytes test/testfiles/plist_files/fapl_64le | Bin 1522 -> 1462 bytes test/testfiles/plist_files/fcpl_32be | Bin 413 -> 413 bytes test/testfiles/plist_files/fcpl_32le | Bin 413 -> 413 bytes test/testfiles/plist_files/fcpl_64be | Bin 413 -> 413 bytes test/testfiles/plist_files/fcpl_64le | Bin 413 -> 413 bytes test/testfiles/plist_files/lapl_32be | Bin 1625 -> 1565 bytes test/testfiles/plist_files/lapl_32le | Bin 1625 -> 1565 bytes test/testfiles/plist_files/lapl_64be | Bin 1625 -> 1565 bytes test/testfiles/plist_files/lapl_64le | Bin 1625 -> 1565 bytes test/testflushrefresh.sh.in | 4 +- test/tfile.c | 123 +- test/unlink.c | 4 +- test/vds.c | 55 +- testpar/CMakeLists.txt | 4 +- testpar/CMakeTests.cmake | 22 +- testpar/t_cache.c | 44 +- tools/CMakeLists.txt | 6 +- tools/lib/CMakeLists.txt | 9 +- tools/lib/h5diff.c | 168 +-- tools/lib/h5diff_array.c | 25 +- tools/lib/h5diff_dset.c | 3 - tools/lib/h5tools_dump.c | 134 +- tools/src/CMakeLists.txt | 2 +- tools/src/h5copy/CMakeLists.txt | 35 +- tools/src/h5diff/CMakeLists.txt | 53 +- tools/src/h5dump/CMakeLists.txt | 39 +- tools/src/h5dump/h5dump_xml.c | 2 +- tools/src/h5format_convert/CMakeLists.txt | 21 +- tools/src/h5import/CMakeLists.txt | 21 +- tools/src/h5jam/CMakeLists.txt | 23 +- tools/src/h5ls/CMakeLists.txt | 39 +- tools/src/h5repack/CMakeLists.txt | 35 +- tools/src/h5repack/h5repack.c | 36 +- tools/src/h5repack/h5repack_copy.c | 24 +- tools/src/h5repack/h5repack_main.c | 425 +++--- tools/src/h5repack/h5repack_parse.c | 7 +- tools/src/h5repack/h5repack_verify.c | 9 +- tools/src/h5stat/CMakeLists.txt | 35 +- tools/src/misc/CMakeLists.txt | 27 +- tools/test/CMakeLists.txt | 2 +- tools/test/h5copy/CMakeLists.txt | 4 +- tools/test/h5copy/CMakeTests.cmake | 152 +- tools/test/h5copy/testh5copy.sh.in | 95 +- tools/test/h5diff/CMakeLists.txt | 32 +- tools/test/h5diff/CMakeTests.cmake | 143 +- tools/test/h5diff/Makefile.am | 16 - tools/test/h5diff/h5diffgentest.c | 263 +--- tools/test/h5diff/testh5diff.sh.in | 36 +- tools/test/h5dump/CMakeLists.txt | 32 +- tools/test/h5dump/CMakeTests.cmake | 150 +- tools/test/h5dump/CMakeTestsPBITS.cmake | 18 +- tools/test/h5dump/CMakeTestsVDS.cmake | 34 +- tools/test/h5dump/CMakeTestsXML.cmake | 26 +- tools/test/h5dump/Makefile.am | 16 +- tools/test/h5dump/h5dumpgentest.c | 152 +- tools/test/h5format_convert/CMakeLists.txt | 4 +- tools/test/h5format_convert/CMakeTests.cmake | 50 +- tools/test/h5format_convert/h5fc_gentest.c | 3 +- tools/test/h5format_convert/testh5fc.sh.in | 3 - tools/test/h5import/CMakeLists.txt | 2 +- tools/test/h5import/CMakeTests.cmake | 44 +- tools/test/h5jam/CMakeLists.txt | 4 +- tools/test/h5jam/CMakeTests.cmake | 68 +- tools/test/h5ls/CMakeLists.txt | 30 +- tools/test/h5ls/CMakeTests.cmake | 66 +- tools/test/h5ls/CMakeTestsVDS.cmake | 14 +- tools/test/h5ls/Makefile.am | 16 - tools/test/h5ls/testh5ls.sh.in | 38 +- tools/test/h5repack/CMakeLists.txt | 2 +- tools/test/h5repack/CMakeTests.cmake | 199 ++- tools/test/h5repack/h5repack.sh.in | 30 +- tools/test/h5repack/h5repacktst.c | 3 +- tools/test/h5stat/CMakeLists.txt | 4 +- tools/test/h5stat/CMakeTests.cmake | 18 +- tools/test/misc/CMakeLists.txt | 4 +- tools/test/misc/CMakeTests.cmake | 32 +- tools/test/misc/Makefile.am | 2 +- tools/test/misc/testh5repart.sh.in | 2 +- tools/test/misc/vds/CMakeLists.txt | 6 +- tools/test/perform/CMakeLists.txt | 8 +- tools/test/perform/CMakeTests.cmake | 111 +- tools/test/perform/sio_perf.c | 4 + 355 files changed, 22358 insertions(+), 25375 deletions(-) create mode 100644 config/cmake_ext_mod/prunTest.cmake diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 700ef15..b7aa77d 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -17,14 +17,14 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (NOT TGZPATH) set (TGZPATH ${HDF5_SOURCE_DIR}) - endif () + endif (NOT TGZPATH) set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME}) set (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME}) - else () + else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") set (ZLIB_USE_EXTERNAL 0) set (SZIP_USE_EXTERNAL 0) - endif () -endif () + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") +endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") #----------------------------------------------------------------------------- # Option for ZLib support @@ -39,9 +39,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) if (ZLIB_FOUND) set (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_LIBRARIES}) - endif () - endif () - endif () + endif (ZLIB_FOUND) + endif (NOT ZLIB_FOUND) + endif (NOT ZLIB_USE_EXTERNAL) if (ZLIB_FOUND) set (H5_HAVE_FILTER_DEFLATE 1) set (H5_HAVE_ZLIB_H 1) @@ -49,33 +49,33 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) set (H5_ZLIB_HEADER "zlib.h") set (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) - else () + else (ZLIB_FOUND) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) set (H5_HAVE_FILTER_DEFLATE 1) set (H5_HAVE_ZLIB_H 1) set (H5_HAVE_LIBZ 1) message (STATUS "Filter ZLIB is built") - else () + else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") message (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") - endif () - endif () - else () + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (ZLIB_FOUND) + else (NOT H5_ZLIB_HEADER) # This project is being called from within another and ZLib is already configured set (H5_HAVE_FILTER_DEFLATE 1) set (H5_HAVE_ZLIB_H 1) set (H5_HAVE_LIBZ 1) - endif () + endif (NOT H5_ZLIB_HEADER) if (H5_HAVE_FILTER_DEFLATE) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") - endif () + endif (H5_HAVE_FILTER_DEFLATE) if (BUILD_SHARED_LIBS) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) - endif () + endif (BUILD_SHARED_LIBS) set (LINK_LIBS ${LINK_LIBS} ${ZLIB_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) message (STATUS "Filter ZLIB is ON") -endif () +endif (HDF5_ENABLE_Z_LIB_SUPPORT) #----------------------------------------------------------------------------- # Option for SzLib support @@ -90,37 +90,37 @@ if (HDF5_ENABLE_SZIP_SUPPORT) if (SZIP_FOUND) set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_LIBRARIES}) - endif () - endif () - endif () + endif (SZIP_FOUND) + endif (NOT SZIP_FOUND) + endif (NOT SZIP_USE_EXTERNAL) if (SZIP_FOUND) set (H5_HAVE_FILTER_SZIP 1) set (H5_HAVE_SZLIB_H 1) set (H5_HAVE_LIBSZ 1) set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIRS} ${SZIP_INCLUDE_DIR}) - else () + else (SZIP_FOUND) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING}) set (H5_HAVE_FILTER_SZIP 1) set (H5_HAVE_SZLIB_H 1) set (H5_HAVE_LIBSZ 1) message (STATUS "Filter SZIP is built") - else () + else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") - endif () - endif () + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (SZIP_FOUND) if (BUILD_SHARED_LIBS) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) - endif () + endif (BUILD_SHARED_LIBS) set (LINK_LIBS ${LINK_LIBS} ${SZIP_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) message (STATUS "Filter SZIP is ON") if (H5_HAVE_FILTER_SZIP) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") - endif () + endif (H5_HAVE_FILTER_SZIP) if (HDF5_ENABLE_SZIP_ENCODING) set (H5_HAVE_SZIP_ENCODER 1) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} ENCODE") - endif () -endif () + endif (HDF5_ENABLE_SZIP_ENCODING) +endif (HDF5_ENABLE_SZIP_SUPPORT) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 3f0f7ca..65d2222 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -8,9 +8,9 @@ if (WIN32) find_program (NSIS_EXECUTABLE NSIS.exe PATHS "$ENV{ProgramFiles}\\NSIS" "$ENV{ProgramFiles${PF_ENV_EXT}}\\NSIS") if(NOT CPACK_WIX_ROOT) file(TO_CMAKE_PATH "$ENV{WIX}" CPACK_WIX_ROOT) - endif () + endif() find_program (WIX_EXECUTABLE candle PATHS "${CPACK_WIX_ROOT}/bin") -endif () +endif (WIN32) #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -21,33 +21,31 @@ if (NOT HDF5_INSTALL_NO_DEVELOPMENT) DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) -endif () +endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (NOT HDF5_EXTERNALLY_CONFIGURED) - if (HDF5_EXPORTED_TARGETS) - install ( - EXPORT ${HDF5_EXPORTED_TARGETS} - DESTINATION ${HDF5_INSTALL_CMAKE_DIR} - FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake - NAMESPACE ${HDF5_PACKAGE}:: - COMPONENT configinstall - ) - endif () - - #----------------------------------------------------------------------------- - # Export all exported targets to the build tree for use by parent project - #----------------------------------------------------------------------------- - if (NOT HDF5_EXTERNALLY_CONFIGURED) - export ( - TARGETS ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES} ${HDF5_UTILS_TO_EXPORT} - FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake - NAMESPACE ${HDF5_PACKAGE}:: - ) - endif () -endif () + install ( + EXPORT ${HDF5_EXPORTED_TARGETS} + DESTINATION ${HDF5_INSTALL_CMAKE_DIR} + FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake + NAMESPACE ${HDF5_PACKAGE}:: + COMPONENT configinstall + ) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) + +#----------------------------------------------------------------------------- +# Export all exported targets to the build tree for use by parent project +#----------------------------------------------------------------------------- +if (NOT HDF5_EXTERNALLY_CONFIGURED) + export ( + TARGETS ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES} ${HDF5_UTILS_TO_EXPORT} + FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake + NAMESPACE ${HDF5_PACKAGE}:: + ) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Set includes needed for build @@ -97,7 +95,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) DESTINATION ${HDF5_INSTALL_CMAKE_DIR} COMPONENT configinstall ) -endif () +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the hdf5-config-version .cmake file for the install directory @@ -112,16 +110,16 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) DESTINATION ${HDF5_INSTALL_CMAKE_DIR} COMPONENT configinstall ) -endif () +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the libhdf5.settings file for the lib info #----------------------------------------------------------------------------- if (H5_WORDS_BIGENDIAN) set (BYTESEX big-endian) -else () +else (H5_WORDS_BIGENDIAN) set (BYTESEX little-endian) -endif () +endif (H5_WORDS_BIGENDIAN) configure_file ( ${HDF_RESOURCES_DIR}/libhdf5.settings.cmake.in ${HDF5_BINARY_DIR}/libhdf5.settings @ONLY @@ -137,10 +135,10 @@ install ( #----------------------------------------------------------------------------- #foreach (libs ${LINK_LIBS}) # set (LIBS "${LIBS} -l${libs}") -#endforeach () +#endforeach (libs ${LINK_LIBS}) #foreach (libs ${HDF5_LIBRARIES_TO_EXPORT}) # set (HDF5LIBS "${HDF5LIBS} -l${libs}") -#endforeach () +#endforeach (libs ${HDF5_LIBRARIES_TO_EXPORT}) #configure_file ( # ${HDF_RESOURCES_DIR}/libhdf5.pc.in # ${HDF5_BINARY_DIR}/CMakeFiles/libhdf5.pc @ONLY @@ -180,8 +178,8 @@ if (HDF5_PACK_EXAMPLES) DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - endif () -endif () + endif (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") +endif (HDF5_PACK_EXAMPLES) #----------------------------------------------------------------------------- # Configure the README.txt file for the binary package @@ -193,7 +191,7 @@ HDF_README_PROPERTIES(HDF5_BUILD_FORTRAN) #----------------------------------------------------------------------------- if (WIN32) configure_file (${HDF5_SOURCE_DIR}/COPYING ${HDF5_BINARY_DIR}/COPYING.txt @ONLY) -endif () +endif (WIN32) #----------------------------------------------------------------------------- # Add Document File(s) to CMake Install @@ -216,7 +214,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${release_files} ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt ) - endif () + endif (WIN32) if (HDF5_PACK_INSTALL_DOCS) set (release_files ${release_files} @@ -229,40 +227,40 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt ) - endif () + endif (WIN32) if (CYGWIN) set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt ) - endif () + endif (CYGWIN) if (HDF5_ENABLE_PARALLEL) set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel ) - endif () - endif () + endif (HDF5_ENABLE_PARALLEL) + endif (HDF5_PACK_INSTALL_DOCS) install ( FILES ${release_files} DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - endif () -endif () + endif (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") +endif (NOT HDF5_EXTERNALLY_CONFIGURED) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if (CMAKE_HOST_UNIX) set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) - else () + else (CMAKE_HOST_UNIX) GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) set (CMAKE_INSTALL_PREFIX "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) set (CMAKE_GENERIC_PROGRAM_FILES) - endif () -endif () + endif (CMAKE_HOST_UNIX) +endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) #----------------------------------------------------------------------------- # Set the cpack variables @@ -272,9 +270,9 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") if (CDASH_LOCAL) set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") - else () + else (CDASH_LOCAL) set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION_STRING}") - endif () + endif (CDASH_LOCAL) set (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") set (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") set (CPACK_PACKAGE_VERSION_PATCH "") @@ -282,13 +280,13 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING") set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") - endif () + endif (EXISTS "${HDF5_SOURCE_DIR}/release_docs") set (CPACK_PACKAGE_RELOCATABLE TRUE) if (OVERRIDE_INSTALL_VERSION) set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${OVERRIDE_INSTALL_VERSION}") - else () + else (OVERRIDE_INSTALL_VERSION) set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}") - endif () + endif (OVERRIDE_INSTALL_VERSION) set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}/hdf.bmp") set (CPACK_GENERATOR "TGZ") @@ -297,7 +295,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) if (NSIS_EXECUTABLE) list (APPEND CPACK_GENERATOR "NSIS") - endif () + endif (NSIS_EXECUTABLE) # Installers for 32- vs. 64-bit CMake: # - Root install directory (displayed to end user at installer-run time) # - "NSIS package/display name" (text used in the installer GUI) @@ -306,10 +304,10 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) if (CMAKE_CL_64) set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} (Win64)") - else () + else (CMAKE_CL_64) set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") - endif () + endif (CMAKE_CL_64) # set the install/unistall icon used for the installer itself # There is a bug in NSI that does not handle full unix paths properly. set (CPACK_NSIS_MUI_ICON "${HDF_RESOURCES_EXT_DIR}\\\\hdf.ico") @@ -319,15 +317,15 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_PACKAGE_NAME}") if (OVERRIDE_INSTALL_VERSION) set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${OVERRIDE_INSTALL_VERSION}") - else () + else (OVERRIDE_INSTALL_VERSION) set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") - endif () + endif (OVERRIDE_INSTALL_VERSION) set (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") set (CPACK_NSIS_MODIFY_PATH ON) if (WIX_EXECUTABLE) list (APPEND CPACK_GENERATOR "WIX") - endif () + endif (WIX_EXECUTABLE) #WiX variables set (CPACK_WIX_UNINSTALL "1") # .. variable:: CPACK_WIX_LICENSE_RTF @@ -370,7 +368,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set(CPACK_WIX_PROPERTY_ARPHELPLINK "${HDF5_PACKAGE_BUGREPORT}") if (BUILD_SHARED_LIBS) set(CPACK_WIX_PATCH_FILE "${HDF_RESOURCES_DIR}/patch.xml") - endif () + endif (BUILD_SHARED_LIBS) elseif (APPLE) list (APPEND CPACK_GENERATOR "STGZ") list (APPEND CPACK_GENERATOR "DragNDrop") @@ -405,8 +403,8 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) FILES ${HDF5_BINARY_DIR}/CMakeFiles/PkgInfo DESTINATION .. ) - endif () - else () + endif (HDF5_PACK_MACOSX_FRAMEWORK AND HDF5_BUILD_FRAMEWORKS) + else (WIN32) list (APPEND CPACK_GENERATOR "STGZ") set (CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}") set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) @@ -444,12 +442,12 @@ The HDF5 data model, file format, API, library, and tools are open and distribut #----------------------------------------------------------------------------- # configure_file ("${HDF5_RESOURCES_DIR}/hdf5.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec" @ONLY IMMEDIATE) # set (CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec") - endif () + endif (WIN32) # By default, do not warn when built on machines using only VS Express: if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) - endif () + endif (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) include (InstallRequiredSystemLibraries) set (CPACK_INSTALL_CMAKE_PROJECTS "${HDF5_BINARY_DIR};HDF5;ALL;/") @@ -459,23 +457,23 @@ The HDF5 data model, file format, API, library, and tools are open and distribut if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) if (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;ALL;/") - else () + else (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/") set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;headers;/") set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;configinstall;/") - endif () - endif () + endif (WIN32) + endif (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) if (SZIP_FOUND AND SZIP_USE_EXTERNAL) if (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;ALL;/") - else () + else (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/") set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;headers;/") set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/") - endif () - endif () - endif () - endif () + endif (WIN32) + endif (SZIP_FOUND AND SZIP_USE_EXTERNAL) + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (HDF5_PACKAGE_EXTLIBS) include (CPack) @@ -539,7 +537,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development INSTALL_TYPES Full Developer ) - endif () + endif (HDF5_BUILD_FORTRAN) if (HDF5_BUILD_CPP_LIB) cpack_add_component (cpplibraries @@ -554,7 +552,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development INSTALL_TYPES Full Developer ) - endif () + endif (HDF5_BUILD_CPP_LIB) if (HDF5_BUILD_TOOLS) cpack_add_component (toolsapplications @@ -575,7 +573,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development INSTALL_TYPES Full Developer ) - endif () + endif (HDF5_BUILD_TOOLS) if (HDF5_BUILD_HL_LIB) cpack_add_component (hllibraries @@ -609,7 +607,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development INSTALL_TYPES Full Developer ) - endif () + endif (HDF5_BUILD_CPP_LIB) if (HDF5_BUILD_FORTRAN) cpack_add_component (hlfortlibraries DISPLAY_NAME "HDF5 HL Fortran Libraries" @@ -617,7 +615,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Runtime INSTALL_TYPES Full Developer User ) - endif () - endif () + endif (HDF5_BUILD_FORTRAN) + endif (HDF5_BUILD_HL_LIB) -endif () +endif (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11c9b53..b59943e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5 C CXX) #----------------------------------------------------------------------------- @@ -76,13 +76,13 @@ endif () # # Override the zlib header file # if (VTK_USE_SYSTEM_ZLIB) # set (H5_ZLIB_HEADER "zlib.h") -# else () +# else (VTK_USE_SYSTEM_ZLIB) # set (H5_ZLIB_HEADER "vtk_zlib.h") # # Set vars that FindZlib would have set if used in sub project # set (ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}") # set (ZLIB_LIBRARIES vtkzlib) -# endif () -# endif () +# endif (VTK_USE_SYSTEM_ZLIB) +# endif (HDF5_ENABLE_Z_LIB_SUPPORT) # # # Add the sub project # add_subdirectory (Utilities/hdf5-1.8) @@ -100,7 +100,7 @@ option (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) mark_as_advanced (HDF5_USE_FOLDERS) if (HDF5_USE_FOLDERS) set_property (GLOBAL PROPERTY USE_FOLDERS ON) -endif () +endif (HDF5_USE_FOLDERS) option (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF) mark_as_advanced (HDF5_NO_PACKAGES) option (ALLOW_UNSUPPORTED "Allow unsupported combinations of configure options" OFF) @@ -201,48 +201,48 @@ set (HDF5_JAVA_LOGGING_SIMPLE_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-simple- if (APPLE) option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE) -endif () +endif (APPLE) if (NOT HDF5_INSTALL_BIN_DIR) set (HDF5_INSTALL_BIN_DIR bin) -endif () +endif (NOT HDF5_INSTALL_BIN_DIR) if (NOT HDF5_INSTALL_LIB_DIR) if (APPLE) if (HDF5_BUILD_FRAMEWORKS) set (HDF5_INSTALL_JAR_DIR ../Java) - else () + else (HDF5_BUILD_FRAMEWORKS) set (HDF5_INSTALL_JAR_DIR lib) - endif () + endif (HDF5_BUILD_FRAMEWORKS) set (HDF5_INSTALL_FMWK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - else () + else (APPLE) set (HDF5_INSTALL_JAR_DIR lib) - endif () + endif (APPLE) set (HDF5_INSTALL_LIB_DIR lib) -endif () +endif (NOT HDF5_INSTALL_LIB_DIR) if (NOT HDF5_INSTALL_INCLUDE_DIR) set (HDF5_INSTALL_INCLUDE_DIR include) -endif () +endif (NOT HDF5_INSTALL_INCLUDE_DIR) if (NOT HDF5_INSTALL_DATA_DIR) if (NOT WIN32) if (APPLE) if (HDF5_BUILD_FRAMEWORKS) set (HDF5_INSTALL_EXTRA_DIR ../SharedSupport) - else () + else (HDF5_BUILD_FRAMEWORKS) set (HDF5_INSTALL_EXTRA_DIR share) - endif () + endif (HDF5_BUILD_FRAMEWORKS) set (HDF5_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - endif () + endif (APPLE) set (HDF5_INSTALL_DATA_DIR share) set (HDF5_INSTALL_CMAKE_DIR share/cmake) - else () + else (NOT WIN32) set (HDF5_INSTALL_DATA_DIR ".") set (HDF5_INSTALL_CMAKE_DIR cmake) - endif () -endif () + endif (NOT WIN32) +endif (NOT HDF5_INSTALL_DATA_DIR) -if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") +if(DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH}) -endif () +endif(DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") #----------------------------------------------------------------------------- # parse the full version number from H5public.h and include in H5_VERS_INFO @@ -268,74 +268,74 @@ string (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_RELEASE ${_lt_vers_am_contents}) -math (EXPR H5_SOVERS_MAJOR ${H5_SOVERS_INTERFACE}-${H5_SOVERS_RELEASE}) +MATH (EXPR H5_SOVERS_MAJOR ${H5_SOVERS_INTERFACE}-${H5_SOVERS_RELEASE}) message (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") string (REGEX MATCH ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_TOOLS_SOVERS_EXISTS ${_lt_vers_am_contents}) -if (H5_TOOLS_SOVERS_EXISTS) +if(H5_TOOLS_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_TOOLS_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_TOOLS_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_RELEASE ${_lt_vers_am_contents}) - math (EXPR H5_TOOLS_SOVERS_MAJOR ${H5_TOOLS_SOVERS_INTERFACE}-${H5_TOOLS_SOVERS_RELEASE}) + MATH (EXPR H5_TOOLS_SOVERS_MAJOR ${H5_TOOLS_SOVERS_INTERFACE}-${H5_TOOLS_SOVERS_RELEASE}) message (STATUS "SOVERSION_TOOLS: ${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") -endif () +endif() string (REGEX REPLACE ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_CXX_SOVERS_EXISTS ${_lt_vers_am_contents}) -if (H5_CXX_SOVERS_EXISTS) +if(H5_CXX_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_CXX_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_RELEASE ${_lt_vers_am_contents}) - math (EXPR H5_CXX_SOVERS_MAJOR ${H5_CXX_SOVERS_INTERFACE}-${H5_CXX_SOVERS_RELEASE}) + MATH (EXPR H5_CXX_SOVERS_MAJOR ${H5_CXX_SOVERS_INTERFACE}-${H5_CXX_SOVERS_RELEASE}) message (STATUS "SOVERSION_CXX: ${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") -endif () +endif() string (REGEX REPLACE ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_F_SOVERS_EXISTS ${_lt_vers_am_contents}) -if (H5_F_SOVERS_EXISTS) +if(H5_F_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_F_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_RELEASE ${_lt_vers_am_contents}) - math (EXPR H5_F_SOVERS_MAJOR ${H5_F_SOVERS_INTERFACE}-${H5_F_SOVERS_RELEASE}) + MATH (EXPR H5_F_SOVERS_MAJOR ${H5_F_SOVERS_INTERFACE}-${H5_F_SOVERS_RELEASE}) message (STATUS "SOVERSION_F: ${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}") -endif () +endif() string (REGEX REPLACE ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_SOVERS_EXISTS ${_lt_vers_am_contents}) -if (H5_HL_SOVERS_EXISTS) +if(H5_HL_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_RELEASE ${_lt_vers_am_contents}) - math (EXPR H5_HL_SOVERS_MAJOR ${H5_HL_SOVERS_INTERFACE}-${H5_HL_SOVERS_RELEASE}) + MATH (EXPR H5_HL_SOVERS_MAJOR ${H5_HL_SOVERS_INTERFACE}-${H5_HL_SOVERS_RELEASE}) message (STATUS "SOVERSION_HL: ${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}") -endif () +endif() string (REGEX REPLACE ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_CXX_SOVERS_EXISTS ${_lt_vers_am_contents}) -if (H5_HL_CXX_SOVERS_EXISTS) +if(H5_HL_CXX_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_CXX_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_RELEASE ${_lt_vers_am_contents}) - math (EXPR H5_HL_CXX_SOVERS_MAJOR ${H5_HL_CXX_SOVERS_INTERFACE}-${H5_HL_CXX_SOVERS_RELEASE}) + MATH (EXPR H5_HL_CXX_SOVERS_MAJOR ${H5_HL_CXX_SOVERS_INTERFACE}-${H5_HL_CXX_SOVERS_RELEASE}) message (STATUS "SOVERSION_HL_CXX: ${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}") -endif () +endif() string (REGEX REPLACE ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_F_SOVERS_EXISTS ${_lt_vers_am_contents}) -if (H5_HL_F_SOVERS_EXISTS) +if(H5_HL_F_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_F_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_RELEASE ${_lt_vers_am_contents}) - math (EXPR H5_HL_F_SOVERS_MAJOR ${H5_HL_F_SOVERS_INTERFACE}-${H5_HL_F_SOVERS_RELEASE}) + MATH (EXPR H5_HL_F_SOVERS_MAJOR ${H5_HL_F_SOVERS_INTERFACE}-${H5_HL_F_SOVERS_RELEASE}) message (STATUS "SOVERSION_HL_F: ${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}") -endif () +endif() string (REGEX REPLACE ".*LT_JAVA_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_JAVA_SOVERS_EXISTS ${_lt_vers_am_contents}) if(H5_JAVA_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_JAVA_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" @@ -344,9 +344,9 @@ if(H5_JAVA_SOVERS_EXISTS) "\\1" H5_JAVA_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_JAVA_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_JAVA_SOVERS_RELEASE ${_lt_vers_am_contents}) - math (EXPR H5_JAVA_SOVERS_MAJOR ${H5_JAVA_SOVERS_INTERFACE}-${H5_JAVA_SOVERS_RELEASE}) + MATH (EXPR H5_JAVA_SOVERS_MAJOR ${H5_JAVA_SOVERS_INTERFACE}-${H5_JAVA_SOVERS_RELEASE}) message (STATUS "SOVERSION_JAVA: ${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}") -endif () +endif() #----------------------------------------------------------------------------- # Basic HDF5 stuff here @@ -358,45 +358,45 @@ set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") if (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") -else () +else (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") -endif () +endif (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") set (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -if (H5_TOOLS_SOVERS_EXISTS) +if(H5_TOOLS_SOVERS_EXISTS) set (HDF5_TOOLS_PACKAGE_SOVERSION "${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") -else () +else() set (HDF5_TOOLS_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif () -if (H5_CXX_SOVERS_EXISTS) +endif() +if(H5_CXX_SOVERS_EXISTS) set (HDF5_CXX_PACKAGE_SOVERSION "${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") -else () +else() set (HDF5_CXX_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif () -if (H5_F_SOVERS_EXISTS) +endif() +if(H5_F_SOVERS_EXISTS) set (HDF5_F_PACKAGE_SOVERSION "${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}") -else () +else() set (HDF5_F_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif () -if (H5_HL_SOVERS_EXISTS) +endif() +if(H5_HL_SOVERS_EXISTS) set (HDF5_HL_PACKAGE_SOVERSION "${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}") -else () +else() set (HDF5_HL_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif () -if (H5_HL_F_SOVERS_EXISTS) +endif() +if(H5_HL_F_SOVERS_EXISTS) set (HDF5_HL_CXX_PACKAGE_SOVERSION "${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}") -else () +else() set (HDF5_HL_CXX_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif () -if (H5_HL_F_SOVERS_EXISTS) +endif() +if(H5_HL_F_SOVERS_EXISTS) set (HDF5_HL_F_PACKAGE_SOVERSION "${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}") -else () +else() set (HDF5_HL_F_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif () -if (H5_JAVA_SOVERS_EXISTS) +endif() +if(H5_JAVA_SOVERS_EXISTS) set (HDF5_PACKAGE_SOVERSION "${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}") -else () +else() set (HDF5_JAVA_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -endif () +endif() set (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") set (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}") set (HDF5_PACKAGE_URL "http://www.hdfgroup.org") @@ -427,19 +427,16 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ) if (WIN32) set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}) - set (CMAKE_PDB_OUTPUT_DIRECTORY - ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files." - ) - else () + else (WIN32) set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - endif () -else () + endif (WIN32) +else (NOT HDF5_EXTERNALLY_CONFIGURED) # if we are externally configured, but the project uses old cmake scripts # this may not be set and utilities like H5detect will fail if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) - endif () -endif () + endif (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Targets built within this project are exported at Install time for use @@ -447,7 +444,7 @@ endif () #----------------------------------------------------------------------------- if (NOT HDF5_EXPORTED_TARGETS) set (HDF5_EXPORTED_TARGETS "hdf5-targets") -endif () +endif (NOT HDF5_EXPORTED_TARGETS) #----------------------------------------------------------------------------- # To include a library in the list exported by the project AT BUILD TIME, @@ -473,17 +470,17 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) #----------------------------------------------------------------------------- if (HDF5_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS) set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries") -endif () +endif (HDF5_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- -# Option to Build Shared and Static libs, default is both +# Option to Build Shared and Static libs, default is static #----------------------------------------------------------------------------- option (BUILD_SHARED_LIBS "Build Shared Libraries" ON) set (H5_ENABLE_SHARED_LIB NO) if (BUILD_SHARED_LIBS) set (H5_ENABLE_SHARED_LIB YES) set (LINK_SHARED_LIBS ${LINK_LIBS}) -endif () +endif (BUILD_SHARED_LIBS) set (H5_ENABLE_STATIC_LIB YES) set (CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -495,8 +492,8 @@ if (BUILD_STATIC_EXECS) if (NOT WIN32) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") - endif () -endif () + endif (NOT WIN32) +endif (BUILD_STATIC_EXECS) #----------------------------------------------------------------------------- # Option to use code coverage @@ -506,7 +503,7 @@ if (HDF5_ENABLE_COVERAGE) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage") -endif () +endif (HDF5_ENABLE_COVERAGE) #----------------------------------------------------------------------------- # Option to indicate using dmalloc @@ -515,7 +512,7 @@ endif () # if (HDF5_ENABLE_USING_DMALLOC) # find_package (DMALLOC) # set (H5_HAVE_DMALLOC DMALLOC_FOUND) -# endif () +# endif (HDF5_ENABLE_USING_DMALLOC) #----------------------------------------------------------------------------- # Option to indicate using a memory checker @@ -523,7 +520,7 @@ endif () option (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) if (HDF5_ENABLE_USING_MEMCHECKER) set (H5_USING_MEMCHECKER 1) -endif () +endif (HDF5_ENABLE_USING_MEMCHECKER) #----------------------------------------------------------------------------- # Option to indicate internal memory allocation sanity checks are enabled @@ -531,7 +528,7 @@ endif () option (HDF5_MEMORY_ALLOC_SANITY_CHECK "Indicate that internal memory allocation sanity checks are enabled" OFF) if (HDF5_MEMORY_ALLOC_SANITY_CHECK) set (H5_MEMORY_ALLOC_SANITY_CHECK 1) -endif () +endif (HDF5_MEMORY_ALLOC_SANITY_CHECK) #----------------------------------------------------------------------------- # Option to use deprecated public API symbols @@ -539,9 +536,9 @@ endif () option (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON) if (HDF5_ENABLE_DEPRECATED_SYMBOLS) set (H5_NO_DEPRECATED_SYMBOLS 0) -else () +else (HDF5_ENABLE_DEPRECATED_SYMBOLS) set (H5_NO_DEPRECATED_SYMBOLS 1) -endif () +endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #----------------------------------------------------------------------------- # When building utility executables that generate other (source) files : @@ -556,24 +553,24 @@ if (WIN32) add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1) add_definitions (-D_CRT_SECURE_NO_WARNINGS) add_definitions (-D_CONSOLE) - endif () -endif () + endif (NOT CYGWIN) +endif (WIN32) if (MSVC) set (CMAKE_MFC_FLAG 0) set (WIN_COMPILE_FLAGS "") set (WIN_LINK_FLAGS "") -endif () +endif (MSVC) set (MAKE_SYSTEM) if (CMAKE_BUILD_TOOL MATCHES "make") set (MAKE_SYSTEM 1) -endif () +endif (CMAKE_BUILD_TOOL MATCHES "make") set (CFG_INIT "/${CMAKE_CFG_INTDIR}") if (MAKE_SYSTEM) set (CFG_INIT "") -endif () +endif (MAKE_SYSTEM) #----------------------------------------------------------------------------- # Add some definitions for Debug Builds @@ -585,19 +582,19 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) # Enable tracing of the API if (HDF5_ENABLE_TRACE) add_definitions (-DH5_DEBUG_API ) - endif () + endif (HDF5_ENABLE_TRACE) # Enable instrumenting of the library's internal operations option (HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF) if (HDF5_ENABLE_INSTRUMENT) set (H5_HAVE_INSTRUMENTED_LIBRARY 1) - endif () + endif (HDF5_ENABLE_INSTRUMENT) mark_as_advanced (HDF5_ENABLE_INSTRUMENT) -else () +else (CMAKE_BUILD_TYPE MATCHES Debug) add_definitions (-DNDEBUG) if (HDF5_ENABLE_TRACE) add_definitions (-DH5_DEBUG_API ) - endif () -endif () + endif (HDF5_ENABLE_TRACE) +endif (CMAKE_BUILD_TYPE MATCHES Debug) #----------------------------------------------------------------------------- # Option to embed library info into executables @@ -605,7 +602,7 @@ endif () option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) if (HDF5_ENABLE_EMBEDDED_LIBINFO) set (H5_HAVE_EMBEDDED_LIBINFO 1) -endif () +endif (HDF5_ENABLE_EMBEDDED_LIBINFO) include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake) @@ -630,10 +627,10 @@ if (HDF5_ENABLE_PARALLEL) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) - else () + else (MPI_C_FOUND) message (STATUS "Parallel libraries not found") - endif () -endif () + endif (MPI_C_FOUND) +endif (HDF5_ENABLE_PARALLEL) # Parallel IO usage requires MPI to be Linked and Included if (H5_HAVE_PARALLEL) @@ -641,8 +638,8 @@ if (H5_HAVE_PARALLEL) set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${MPI_C_LIBRARIES}) if (MPI_C_LINK_FLAGS) set (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") - endif () -endif () + endif (MPI_C_LINK_FLAGS) +endif (H5_HAVE_PARALLEL) set (DEFAULT_API_VERSION "v110") #----------------------------------------------------------------------------- @@ -653,7 +650,7 @@ set (H5_USE_16_API_DEFAULT 0) if (HDF5_USE_16_API_DEFAULT) set (H5_USE_16_API_DEFAULT 1) set (DEFAULT_API_VERSION "v16") -endif () +endif (HDF5_USE_16_API_DEFAULT) #----------------------------------------------------------------------------- # Option to use 1.8.x API @@ -663,7 +660,7 @@ set (H5_USE_18_API_DEFAULT 0) if (HDF5_USE_18_API_DEFAULT) set (H5_USE_18_API_DEFAULT 1) set (DEFAULT_API_VERSION "v18") -endif () +endif (HDF5_USE_18_API_DEFAULT) #----------------------------------------------------------------------------- # Include user macros @@ -684,13 +681,13 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) if (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) - endif () + endif (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) if (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) - endif () - endif () -endif () + endif (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + endif (HDF5_PACKAGE_EXTLIBS) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Option to use threadsafe #----------------------------------------------------------------------------- @@ -702,45 +699,45 @@ if (HDF5_ENABLE_THREADSAFE) if (HDF5_ENABLE_PARALLEL) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ") - else () + else (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ") - endif () - endif () + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_ENABLE_PARALLEL) if (HDF5_BUILD_FORTRAN) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ") - else () + else (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") - endif () - endif () + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_BUILD_FORTRAN) if (HDF5_BUILD_CPP_LIB) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ") - else () + else (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") - endif () - endif () + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_BUILD_CPP_LIB) if (HDF5_BUILD_HL_LIB) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** HL and thread-safety options are not supported **** ") - else () + else (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Allowing unsupported HL and thread-safety options **** ") - endif () - endif () + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_BUILD_HL_LIB) if (H5_HAVE_IOEO) message (STATUS " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") set (H5_HAVE_WIN_THREADS 1) - else () + else (H5_HAVE_IOEO) if (NOT H5_HAVE_PTHREAD_H) message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ") - endif () - endif () + endif (NOT H5_HAVE_PTHREAD_H) + endif (H5_HAVE_IOEO) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads) if (NOT Threads_FOUND) message (STATUS " **** thread-safe package not found - threads still might work **** ") - endif () -endif () + endif (NOT Threads_FOUND) +endif (HDF5_ENABLE_THREADSAFE) # ----------------------------------------------------------------------- # wrapper script variables @@ -758,15 +755,15 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT ADD_DEPENDENCIES (${HDF5_LIB_TARGET} ZLIB) if (BUILD_SHARED_LIBS) add_dependencies (${HDF5_LIBSH_TARGET} ZLIB) - endif () - endif () + endif (BUILD_SHARED_LIBS) + endif (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) if (SZIP_FOUND AND SZIP_USE_EXTERNAL) ADD_DEPENDENCIES (${HDF5_LIB_TARGET} SZIP) if (BUILD_SHARED_LIBS) add_dependencies (${HDF5_LIBSH_TARGET} SZIP) - endif () - endif () -endif () + endif (BUILD_SHARED_LIBS) + endif (SZIP_FOUND AND SZIP_USE_EXTERNAL) +endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") #----------------------------------------------------------------------------- # Dashboard and Testing Settings @@ -783,7 +780,7 @@ if (BUILD_TESTING) if (HDF5_TEST_VFD) option (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) mark_as_advanced (HDF5_TEST_FHEAP_VFD) - endif () + endif (HDF5_TEST_VFD) option (HDF_TEST_EXPRESS "Control testing framework (0-3)" "0") mark_as_advanced (HDF_TEST_EXPRESS) @@ -798,14 +795,14 @@ if (BUILD_TESTING) if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") add_subdirectory (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) add_subdirectory (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test) - endif () + endif (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") if (H5_HAVE_PARALLEL) if (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") add_subdirectory (${HDF5_SOURCE_DIR}/testpar ${PROJECT_BINARY_DIR}/testpar) - endif () - endif () - endif () -endif () + endif (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") + endif (H5_HAVE_PARALLEL) + endif (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Option to build HDF5 Tools @@ -814,8 +811,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools option (HDF5_BUILD_TOOLS "Build HDF5 Tools" ON) if (HDF5_BUILD_TOOLS) add_subdirectory (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools) - endif () -endif () + endif (HDF5_BUILD_TOOLS) +endif (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") #----------------------------------------------------------------------------- # Option to build examples @@ -824,8 +821,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/ex option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" ON) if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) - endif () -endif () + endif (HDF5_BUILD_EXAMPLES) +endif (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") #----------------------------------------------------------------------------- # Option to build High Level API's @@ -835,8 +832,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") if (HDF5_BUILD_HL_LIB) set (H5_INCLUDE_HL 1) add_subdirectory (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl) - endif () -endif () + endif (HDF5_BUILD_HL_LIB) +endif (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") #----------------------------------------------------------------------------- # Option to build Fortran bindings/tests/examples @@ -854,10 +851,10 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for if (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Shared FORTRAN libraries are unsupported **** ") set (SKIP_HDF5_FORTRAN_SHARED ON) - else () + else (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Allowing unsupported Fortran shared libraries **** ") - endif () - endif () + endif (NOT ALLOW_UNSUPPORTED) + endif (BUILD_SHARED_LIBS AND APPLE) option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON) include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake) @@ -874,17 +871,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for if (HDF5_ENABLE_F2003) if (NOT FORTRAN_HAVE_ISO_C_BINDING) set (HDF5_ENABLE_F2003 OFF) - endif () - endif () - - # Parallel IO usage requires MPI to be Linked and Included - if (H5_HAVE_PARALLEL) - set (LINK_Fortran_LIBS ${LINK_LIBS} ${MPI_Fortran_LIBRARIES}) - set (LINK_Fortran_SHARED_LIBS ${LINK_SHARED_LIBS} ${MPI_Fortran_LIBRARIES}) - if (MPI_Fortran_LINK_FLAGS) - set (CMAKE_Fortran_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") - endif () - endif () + endif (NOT FORTRAN_HAVE_ISO_C_BINDING) + endif (HDF5_ENABLE_F2003) # ----------------------------------------------------------------------- # wrapper script variables @@ -896,10 +884,10 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") #-- Build the High Level Fortran source codes add_subdirectory (${HDF5_SOURCE_DIR}/hl/fortran ${PROJECT_BINARY_DIR}/hl/fortran) - endif () - endif () - endif () -endif () + endif (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") + endif (HDF5_BUILD_HL_LIB) + endif (HDF5_BUILD_FORTRAN) +endif (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") #----------------------------------------------------------------------------- # Option to build HDF5 C++ Library @@ -911,22 +899,22 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") if (HDF5_ENABLE_PARALLEL) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive **** ") - else () + else (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Allowing unsupported Parallel and C++ options **** ") - endif () - endif () + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_ENABLE_PARALLEL) if (CMAKE_NO_STD_NAMESPACE) set (H5_NO_STD 1) - endif () + endif (CMAKE_NO_STD_NAMESPACE) add_subdirectory (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) if (HDF5_BUILD_HL_LIB) if (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++") #-- Build the High Level Fortran source codes add_subdirectory (${HDF5_SOURCE_DIR}/hl/c++ ${PROJECT_BINARY_DIR}/hl/c++) - endif () - endif () - endif () -endif () + endif (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++") + endif (HDF5_BUILD_HL_LIB) + endif (HDF5_BUILD_CPP_LIB) +endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") #----------------------------------------------------------------------------- # Check if Fortran's default real is double precision. If it is and HL is @@ -935,8 +923,8 @@ endif () if (HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB) if (NOT FORTRAN_DEFAULT_REAL_NOT_DOUBLE) message (FATAL_ERROR " **** Fortran high-level routines are not supported when the default REAL is DOUBLE PRECISION, use HDF5_BUILD_HL_LIB:BOOL=OFF **** ") - endif () -endif () + endif (NOT FORTRAN_DEFAULT_REAL_NOT_DOUBLE) +endif (HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB) #----------------------------------------------------------------------------- # Option to build HDF5 Java Library @@ -945,8 +933,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/java" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/java") option (HDF5_BUILD_JAVA "Build Java HDF5 Library" OFF) if (HDF5_BUILD_JAVA) add_subdirectory (${HDF5_SOURCE_DIR}/java ${PROJECT_BINARY_DIR}/java) - endif () -endif () + endif (HDF5_BUILD_JAVA) +endif (EXISTS "${HDF5_SOURCE_DIR}/java" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/java") #----------------------------------------------------------------------------- # Generate the H5pubconf.h file containing user settings needed by compilation diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 3f5f380..849d218 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -11,10 +11,10 @@ set (CTEST_DROP_METHOD "http") if (CDASH_LOCAL) set (CTEST_DROP_SITE "cdash-internal.hdfgroup.org") set (CTEST_DROP_LOCATION "/submit.php?project=HDF5Trunk") -else () +else (CDASH_LOCAL) set (CTEST_DROP_SITE "cdash.hdfgroup.org") set (CTEST_DROP_LOCATION "/submit.php?project=HDF5+Trunk") -endif () +endif (CDASH_LOCAL) set (CTEST_DROP_SITE_CDASH TRUE) set (UPDATE_TYPE git) diff --git a/MANIFEST b/MANIFEST index 95c9bbd..b43e7ef 100644 --- a/MANIFEST +++ b/MANIFEST @@ -504,12 +504,10 @@ ./src/H5C.c ./src/H5Cdbg.c ./src/H5Cepoch.c -./src/H5Cimage.c ./src/H5Clog.c ./src/H5Cmodule.h ./src/H5Cmpio.c ./src/H5Cpkg.h -./src/H5Cprefetched.c ./src/H5Cprivate.h ./src/H5Cpublic.h ./src/H5Cquery.c @@ -739,7 +737,6 @@ ./src/H5Obogus.c ./src/H5Obtreek.c ./src/H5Ocache.c -./src/H5Ocache_image.c ./src/H5Ochunk.c ./src/H5Ocont.c ./src/H5Ocopy.c @@ -884,20 +881,13 @@ ./src/libhdf5.settings.in ./src/H5win32defs.h -./test/AtomicWriterReader.txt ./test/COPYING ./test/H5srcdir.h ./test/H5srcdir_str.h.in ./test/Makefile.am -./test/POSIX_Order_Write_Test_Report.docx -./test/POSIX_Order_Write_Test_Report.pdf -./test/SWMR_POSIX_Order_UG.txt -./test/SWMR_UseCase_UG.txt ./test/accum.c ./test/accum_swmr_reader.c ./test/app_ref.c -./test/atomic_reader.c -./test/atomic_writer.c ./test/bad_compound.h5 ./test/be_data.h5 ./test/be_extlink1.h5 @@ -911,7 +901,6 @@ ./test/cache_api.c ./test/cache_common.c ./test/cache_common.h -./test/cache_image.c ./test/cache_logging.c ./test/cache_tagging.c ./test/cmpd_dset.c @@ -957,8 +946,6 @@ ./test/flush1.c ./test/flush2.c ./test/flushrefresh.c -./test/genall5.c -./test/genall5.h ./test/gen_bad_ohdr.c ./test/gen_bad_compound.c ./test/gen_bogus.c @@ -966,7 +953,6 @@ ./test/gen_deflate.c ./test/gen_file_image.c ./test/gen_filespace.c -./test/gen_idx.c ./test/gen_mergemsg.c ./test/gen_new_array.c ./test/gen_new_fill.c @@ -1015,18 +1001,7 @@ ./test/specmetaread.h5 ./test/stab.c ./test/swmr.c -./test/swmr_addrem_writer.c ./test/swmr_check_compat_vfd.c -./test/swmr_common.c -./test/swmr_common.h -./test/swmr_generator.c -./test/swmr_reader.c -./test/swmr_remove_reader.c -./test/swmr_remove_writer.c -./test/swmr_sparse_reader.c -./test/swmr_sparse_writer.c -./test/swmr_start_write.c -./test/swmr_writer.c ./test/tarray.c ./test/tarrold.h5 ./test/tattr.c @@ -1045,10 +1020,7 @@ ./test/testhdf5.h ./test/testlibinfo.sh.in ./test/test_plugin.sh.in -./test/test_usecases.sh.in ./test/testmeta.c -./test/testswmr.sh.in -./test/testvdsswmr.sh.in ./test/tfile.c ./test/tgenprop.c ./test/th5o.c @@ -1079,24 +1051,14 @@ ./test/tunicode.c ./test/tvlstr.c ./test/tvltypes.c -./test/twriteorder.c ./test/unlink.c ./test/unregister.c -./test/use_append_chunk.c -./test/use_append_mchunks.c -./test/use_common.c -./test/use_disable_mdc_flushes.c -./test/use.h ./test/vfd.c ./test/test_filters_le.h5 ./test/test_filters_be.h5 ./test/gen_filters.c ./test/chunk_info.c ./test/vds.c -./test/vds_swmr.h -./test/vds_swmr_gen.c -./test/vds_swmr_reader.c -./test/vds_swmr_writer.c ./test/testfiles/err_compat_1 ./test/testfiles/err_compat_2 @@ -1239,9 +1201,7 @@ ./tools/src/h5dump/h5dump_xml.c ./tools/src/h5dump/h5dump_xml.h ./tools/test/h5dump/Makefile.am -./tools/test/h5dump/dynlib_dump.c ./tools/test/h5dump/h5dumpgentest.c -./tools/test/h5dump/h5dump_plugin.sh.in ./tools/test/h5dump/testh5dump.sh.in ./tools/test/h5dump/testh5dumppbits.sh.in ./tools/test/h5dump/testh5dumpxml.sh.in @@ -1313,9 +1273,7 @@ ./tools/src/h5diff/h5diff_main.c ./tools/src/h5diff/ph5diff_main.c ./tools/test/h5diff/Makefile.am -./tools/test/h5diff/dynlib_diff.c ./tools/test/h5diff/h5diffgentest.c -./tools/test/h5diff/h5diff_plugin.sh.in ./tools/test/h5diff/testh5diff.sh.in ./tools/test/h5diff/testph5diff.sh.in @@ -1396,8 +1354,6 @@ ./tools/src/h5ls/Makefile.am ./tools/src/h5ls/h5ls.c ./tools/test/h5ls/Makefile.am -./tools/test/h5ls/dynlib_ls.c -./tools/test/h5ls/h5ls_plugin.sh.in ./tools/test/h5ls/testh5ls.sh.in ./tools/test/h5ls/testh5lsvds.sh.in @@ -1782,9 +1738,6 @@ ./tools/testfiles/tstring2.ddl ./tools/testfiles/tstringe.ddl ./tools/testfiles/tszip.ddl -./tools/testfiles/tudfilter.ddl -./tools/testfiles/tudfilter.h5 -./tools/testfiles/tudfilter.ls ./tools/testfiles/tudlink.h5 ./tools/testfiles/tudlink.h5.xml ./tools/testfiles/tudlink-1.ddl @@ -2155,10 +2108,6 @@ ./tools/test/h5diff/testfiles/h5diff_57.txt ./tools/test/h5diff/testfiles/h5diff_58.txt ./tools/test/h5diff/testfiles/h5diff_59.txt -./tools/test/h5diff/testfiles/h5diff_60.txt -./tools/test/h5diff/testfiles/h5diff_61.txt -./tools/test/h5diff/testfiles/h5diff_62.txt -./tools/test/h5diff/testfiles/h5diff_63.txt ./tools/test/h5diff/testfiles/h5diff_600.txt ./tools/test/h5diff/testfiles/h5diff_601.txt ./tools/test/h5diff/testfiles/h5diff_603.txt @@ -2361,12 +2310,6 @@ ./tools/test/h5diff/testfiles/tmptest.he5 ./tools/test/h5diff/testfiles/h5diff_tmp2.txt ./tools/test/h5diff/testfiles/tmpSingleSiteBethe.output.h5 -./tools/test/h5diff/testfiles/tudfilter.h5 -./tools/test/h5diff/testfiles/tudfilter2.h5 -./tools/test/h5diff/testfiles/h5diff_ud.txt -./tools/test/h5diff/testfiles/h5diff_udfail.txt -./tools/test/h5diff/testfiles/diff_strings1.h5 -./tools/test/h5diff/testfiles/diff_strings2.h5 #vds ./tools/test/h5diff/testfiles/h5diff_v1.txt ./tools/test/h5diff/testfiles/h5diff_v2.txt @@ -3024,6 +2967,7 @@ ./config/cmake_ext_mod/HDFUseFortran.cmake ./config/cmake_ext_mod/NSIS.InstallOptions.ini.in ./config/cmake_ext_mod/NSIS.template.in +./config/cmake_ext_mod/prunTest.cmake ./config/cmake_ext_mod/runTest.cmake ./config/cmake_ext_mod/version.plist.in @@ -3131,7 +3075,6 @@ # CMake-specific User Scripts ./config/cmake/scripts/CTestScript.cmake ./config/cmake/scripts/HDF5config.cmake -./config/cmake/scripts/HDF5options.cmake # Files generated by autogen ./aclocal.m4 diff --git a/UserMacros.cmake b/UserMacros.cmake index 01e76ed..65ea5d4 100644 --- a/UserMacros.cmake +++ b/UserMacros.cmake @@ -7,15 +7,16 @@ #----------------------------------------------------------------------------- # Option to Build with User Defined Values #----------------------------------------------------------------------------- -macro (MACRO_USER_DEFINED_LIBS) +MACRO (MACRO_USER_DEFINED_LIBS) set (USER_DEFINED_VALUE "FALSE") -endmacro () +ENDMACRO (MACRO_USER_DEFINED_LIBS) #------------------------------------------------------------------------------- option (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) if (BUILD_USER_DEFINED_LIBS) MACRO_USER_DEFINED_LIBS () -endif () +endif (BUILD_USER_DEFINED_LIBS) #----------------------------------------------------------------------------- #------------------- E X A M P L E E N D ----------------------------------- #----------------------------------------------------------------------------- + \ No newline at end of file diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index c9c4815..6f288a0 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_CPP) #----------------------------------------------------------------------------- @@ -25,7 +25,7 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR}) if (H5_HAVE_PARALLEL) add_definitions ("-DMPICH_SKIP_MPICXX") add_definitions ("-DMPICH_IGNORE_CXX_SEEK") -endif () +endif (H5_HAVE_PARALLEL) add_subdirectory (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) @@ -34,11 +34,11 @@ add_subdirectory (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples) -endif () +endif (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- # Build the CPP unit tests #----------------------------------------------------------------------------- if (BUILD_TESTING) add_subdirectory (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test) -endif () +endif (BUILD_TESTING) diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index e5b0b4a..cfcdd8d 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,11 +1,11 @@ -cmake_minimum_required (VERSION 3.2.2) -PROJECT (HDF5_CPP_EXAMPLES) - +cmake_minimum_required (VERSION 3.1.0) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed # with "cpp_ex_". This allows for easier filtering of the examples. # -------------------------------------------------------------------- +PROJECT (HDF5_CPP_EXAMPLES) + #----------------------------------------------------------------------------- # Define examples #----------------------------------------------------------------------------- @@ -38,7 +38,7 @@ foreach (example ${examples}) TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ") target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) -endforeach () +endforeach (example ${examples}) foreach (example ${tutr_examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) @@ -46,8 +46,8 @@ foreach (example ${tutr_examples}) TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ") target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) -endforeach () +endforeach (example ${tutr_examples}) if (BUILD_TESTING) include (CMakeTests.cmake) -endif () +endif (BUILD_TESTING) diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index 8b5c6b9..4db8c68 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -8,7 +8,7 @@ add_test ( NAME CPP_ex-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove Group.h5 SDS.h5 SDScompound.h5 @@ -17,29 +17,16 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "CPP_ex-clear-objects") foreach (example ${examples}) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME CPP_ex_${example} COMMAND $) - else () - add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=cpp_ex_${example}.txt" - #-D "TEST_REFERENCE=cpp_ex_${example}.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME CPP_ex_${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "CPP_ex_${example}") - endforeach () + endforeach (example ${examples}) #the following dependicies are handled by the order of the files # SET_TESTS_PROPERTIES(CPP_ex_readdata PROPERTIES DEPENDS CPP_ex_create) # SET_TESTS_PROPERTIES(CPP_ex_chunks PROPERTIES DEPENDS CPP_ex_extend_ds) @@ -47,7 +34,7 @@ add_test ( NAME CPP_ex_tutr-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove h5tutr_cmprss.h5 h5tutr_dset.h5 h5tutr_extend.h5 @@ -57,30 +44,18 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex_tutr-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "CPP_ex_tutr-clear-objects") - + foreach (example ${tutr_examples}) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME CPP_ex_${example} COMMAND $) - else () - add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=cpp_ex_${example}.txt" - #-D "TEST_REFERENCE=cpp_ex_${example}.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME CPP_ex_${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "CPP_ex_${example}") - endforeach () + endforeach (example ${tutr_examples}) #the following dependicies are handled by the order of the files # SET_TESTS_PROPERTIES(CPP_ex_h5tutr_crtatt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat) # SET_TESTS_PROPERTIES(CPP_ex_h5tutr_rdwt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat) # SET_TESTS_PROPERTIES(CPP_ex_h5tutr_crtgrpd PROPERTIES DEPENDS CPP_ex_h5tutr_crtgrpar) + \ No newline at end of file diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index b147cfa..445d57b 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_CPP_SRC) #----------------------------------------------------------------------------- @@ -104,7 +104,7 @@ if (BUILD_SHARED_LIBS) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_CPP_LIBSH_TARGET}) -endif () +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -124,8 +124,7 @@ install ( if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) - endif () - INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) + endif (BUILD_SHARED_LIBS) install ( TARGETS @@ -138,4 +137,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT cpplibraries INCLUDES DESTINATION include ) -endif () +endif (HDF5_EXPORTED_TARGETS) diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index 621578e..9e76b55 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -34,16 +34,16 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: AbstractDs default constructor -///\brief Default constructor -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs default constructor +///\brief Default constructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AbstractDs::AbstractDs(){} //-------------------------------------------------------------------------- -// Function: AbstractDs default constructor -///\brief Creates an AbstractDs instance using an existing id. -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs default constructor +///\brief Creates an AbstractDs instance using an existing id. +// Programmer Binh-Minh Ribler - 2000 // // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had @@ -54,275 +54,275 @@ AbstractDs::AbstractDs(){} // Mar 2016 -BMR, AbstractDs::AbstractDs(const hid_t ds_id){} //-------------------------------------------------------------------------- -// Function: AbstractDs::getTypeClass -///\brief Returns the class of the datatype that is used by this -/// object, which can be a dataset or an attribute. -///\return Datatype class identifier -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getTypeClass +///\brief Returns the class of the datatype that is used by this +/// object, which can be a dataset or an attribute. +///\return Datatype class identifier +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_class_t AbstractDs::getTypeClass() const { - // Gets the datatype used by this dataset or attribute. - // p_get_type calls either H5Dget_type or H5Aget_type depending on - // which object invokes getTypeClass - hid_t datatype_id; - try { - datatype_id = p_get_type(); // returned value is already validated - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getTypeClass", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getTypeClass", E.getDetailMsg()); - } + // Gets the datatype used by this dataset or attribute. + // p_get_type calls either H5Dget_type or H5Aget_type depending on + // which object invokes getTypeClass + hid_t datatype_id; + try { + datatype_id = p_get_type(); // returned value is already validated + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getTypeClass", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getTypeClass", E.getDetailMsg()); + } - // Gets the class of the datatype and validate it before returning - H5T_class_t type_class = H5Tget_class(datatype_id); + // Gets the class of the datatype and validate it before returning + H5T_class_t type_class = H5Tget_class(datatype_id); - // Close temporary datatype_id - herr_t ret_value = H5Tclose(datatype_id); - if (ret_value < 0) - { - if (fromClass() == "DataSet") - throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed"); - else if (fromClass() == "Attribute") - throw DataTypeIException("Attribute::getTypeClass", "H5Tclose failed"); - } + // Close temporary datatype_id + herr_t ret_value = H5Tclose(datatype_id); + if (ret_value < 0) + { + if (fromClass() == "DataSet") + throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed"); + else if (fromClass() == "Attribute") + throw DataTypeIException("Attribute::getTypeClass", "H5Tclose failed"); + } - // Check on the returned type_class - if (type_class == H5T_NO_CLASS) - { - if (fromClass() == "DataSet") - throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); - else if (fromClass() == "Attribute") - throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); - } - return(type_class); + // Check on the returned type_class + if (type_class == H5T_NO_CLASS) + { + if (fromClass() == "DataSet") + throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); + else if (fromClass() == "Attribute") + throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); + } + return(type_class); } //-------------------------------------------------------------------------- -// Function: AbstractDs::getDataType -///\brief Returns the generic datatype of this abstract dataset, which -/// can be a dataset or an attribute. -///\return DataType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getDataType +///\brief Returns the generic datatype of this abstract dataset, which +/// can be a dataset or an attribute. +///\return DataType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType AbstractDs::getDataType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getDataType. Then, create and - // return the DataType object - try { - DataType datatype; - f_DataType_setId(&datatype, p_get_type()); - return(datatype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getDataType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getDataType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getDataType. Then, create and + // return the DataType object + try { + DataType datatype; + f_DataType_setId(&datatype, p_get_type()); + return(datatype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getDataType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getDataType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getArrayType -///\brief Returns the array datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return ArrayType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: AbstractDs::getArrayType +///\brief Returns the array datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return ArrayType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- ArrayType AbstractDs::getArrayType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getArrayType. Then, create and - // return the ArrayType object - try { - // Create ArrayType and set values this way to work around the - // problem described in the JIRA issue HDFFV-7947 - ArrayType arraytype; - f_DataType_setId(&arraytype, p_get_type()); - return(arraytype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getArrayType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getArrayType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getArrayType. Then, create and + // return the ArrayType object + try { + // Create ArrayType and set values this way to work around the + // problem described in the JIRA issue HDFFV-7947 + ArrayType arraytype; + f_DataType_setId(&arraytype, p_get_type()); + return(arraytype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getArrayType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getArrayType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getCompType -///\brief Returns the compound datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return CompType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getCompType +///\brief Returns the compound datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return CompType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType AbstractDs::getCompType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getCompType. Then, create and - // return the CompType object - try { - CompType comptype; - f_DataType_setId(&comptype, p_get_type()); - return(comptype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getCompType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getCompType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getCompType. Then, create and + // return the CompType object + try { + CompType comptype; + f_DataType_setId(&comptype, p_get_type()); + return(comptype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getCompType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getCompType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getEnumType -///\brief Returns the enumeration datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return EnumType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getEnumType +///\brief Returns the enumeration datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return EnumType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType AbstractDs::getEnumType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getEnumType. Then, create and - // return the EnumType object - try { - EnumType enumtype; - f_DataType_setId(&enumtype, p_get_type()); - return(enumtype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getEnumType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getEnumType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getEnumType. Then, create and + // return the EnumType object + try { + EnumType enumtype; + f_DataType_setId(&enumtype, p_get_type()); + return(enumtype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getEnumType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getEnumType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getIntType -///\brief Returns the integer datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return IntType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getIntType +///\brief Returns the integer datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return IntType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType AbstractDs::getIntType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getIntType. Then, create and - // return the IntType object - try { - IntType inttype; - f_DataType_setId(&inttype, p_get_type()); - return(inttype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getIntType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getIntType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getIntType. Then, create and + // return the IntType object + try { + IntType inttype; + f_DataType_setId(&inttype, p_get_type()); + return(inttype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getIntType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getIntType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getFloatType -///\brief Returns the floating-point datatype of this abstract dataset, -/// which can be a dataset or an attribute. -///\return FloatType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getFloatType +///\brief Returns the floating-point datatype of this abstract dataset, +/// which can be a dataset or an attribute. +///\return FloatType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType AbstractDs::getFloatType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getFloatType. Then, create and - // return the FloatType object - try { - FloatType floatype; - f_DataType_setId(&floatype, p_get_type()); - return(floatype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getFloatType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getFloatType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getFloatType. Then, create and + // return the FloatType object + try { + FloatType floatype; + f_DataType_setId(&floatype, p_get_type()); + return(floatype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getFloatType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getFloatType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getStrType -///\brief Returns the string datatype of this abstract dataset which -/// can be a dataset or an attribute. -///\return StrType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs::getStrType +///\brief Returns the string datatype of this abstract dataset which +/// can be a dataset or an attribute. +///\return StrType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType AbstractDs::getStrType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getStrType. Then, create and - // return the StrType object - try { - StrType strtype; - f_DataType_setId(&strtype, p_get_type()); - return(strtype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getStrType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getStrType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getStrType. Then, create and + // return the StrType object + try { + StrType strtype; + f_DataType_setId(&strtype, p_get_type()); + return(strtype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getStrType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getStrType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs::getVarLenType -///\brief Returns the floating-point datatype of this abstract dataset, -/// which can be a dataset or an attribute. -///\return VarLenType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: AbstractDs::getVarLenType +///\brief Returns the floating-point datatype of this abstract dataset, +/// which can be a dataset or an attribute. +///\return VarLenType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- VarLenType AbstractDs::getVarLenType() const { - // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getVarLenType. Then, create and - // return the VarLenType object - try { - VarLenType varlentype; - f_DataType_setId(&varlentype, p_get_type()); - return(varlentype); - } - catch (DataSetIException& E) { - throw DataTypeIException("DataSet::getVarLenType", E.getDetailMsg()); - } - catch (AttributeIException& E) { - throw DataTypeIException("Attribute::getVarLenType", E.getDetailMsg()); - } + // Gets the id of the datatype used by this dataset or attribute using + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getVarLenType. Then, create and + // return the VarLenType object + try { + VarLenType varlentype; + f_DataType_setId(&varlentype, p_get_type()); + return(varlentype); + } + catch (DataSetIException& E) { + throw DataTypeIException("DataSet::getVarLenType", E.getDetailMsg()); + } + catch (AttributeIException& E) { + throw DataTypeIException("Attribute::getVarLenType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: AbstractDs destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: AbstractDs destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AbstractDs::~AbstractDs() {} diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index eaa9d14..1b4775c 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -37,44 +37,44 @@ class DataSpace; */ class H5_DLLCPP AbstractDs { public: - // Gets a copy the datatype of that this abstract dataset uses. - // Note that this datatype is a generic one and can only be accessed - // via generic member functions, i.e., member functions belong - // to DataType. To get specific datatype, i.e. EnumType, FloatType, - // etc..., use the specific functions, that follow, instead. - DataType getDataType() const; + // Gets a copy the datatype of that this abstract dataset uses. + // Note that this datatype is a generic one and can only be accessed + // via generic member functions, i.e., member functions belong + // to DataType. To get specific datatype, i.e. EnumType, FloatType, + // etc..., use the specific functions, that follow, instead. + DataType getDataType() const; - // Gets a copy of the specific datatype of this abstract dataset. - ArrayType getArrayType() const; - CompType getCompType() const; - EnumType getEnumType() const; - IntType getIntType() const; - FloatType getFloatType() const; - StrType getStrType() const; - VarLenType getVarLenType() const; + // Gets a copy of the specific datatype of this abstract dataset. + ArrayType getArrayType() const; + CompType getCompType() const; + EnumType getEnumType() const; + IntType getIntType() const; + FloatType getFloatType() const; + StrType getStrType() const; + VarLenType getVarLenType() const; - ///\brief Gets the size in memory of this abstract dataset. - virtual size_t getInMemDataSize() const = 0; + ///\brief Gets the size in memory of this abstract dataset. + virtual size_t getInMemDataSize() const = 0; - ///\brief Gets the dataspace of this abstract dataset - pure virtual. - virtual DataSpace getSpace() const = 0; + ///\brief Gets the dataspace of this abstract dataset - pure virtual. + virtual DataSpace getSpace() const = 0; - // Gets the class of the datatype that is used by this abstract - // dataset. - H5T_class_t getTypeClass() const; + // Gets the class of the datatype that is used by this abstract + // dataset. + H5T_class_t getTypeClass() const; - ///\brief Returns the amount of storage size required - pure virtual. - virtual hsize_t getStorageSize() const = 0; + ///\brief Returns the amount of storage size required - pure virtual. + virtual hsize_t getStorageSize() const = 0; - // Returns this class name - pure virtual. - virtual H5std_string fromClass() const = 0; + // Returns this class name - pure virtual. + virtual H5std_string fromClass() const = 0; - // Destructor - virtual ~AbstractDs(); + // Destructor + virtual ~AbstractDs(); protected: - // Default constructor - AbstractDs(); + // Default constructor + AbstractDs(); // *** Deprecation warning *** // The following two constructors are no longer appropriate after the @@ -83,14 +83,14 @@ class H5_DLLCPP AbstractDs { // other will be removed from 1.10 release, and then from 1.8 if its // removal does not raise any problems in two 1.10 releases. - // Mar 2016 -BMR, AbstractDs(const hid_t h5_id); + // Mar 2016 -BMR, AbstractDs(const hid_t h5_id); - // Copy constructor - // AbstractDs( const AbstractDs& original ); + // Copy constructor + // AbstractDs( const AbstractDs& original ); private: - // This member function is implemented by DataSet and Attribute - pure virtual. - virtual hid_t p_get_type() const = 0; + // This member function is implemented by DataSet and Attribute - pure virtual. + virtual hid_t p_get_type() const = 0; }; } #endif // __AbstractDs_H diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 3cdcc0a..ecce591 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -30,95 +30,95 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: ArrayType default constructor -///\brief Default constructor: Creates a stub ArrayType -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType default constructor +///\brief Default constructor: Creates a stub ArrayType +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::ArrayType() : DataType() {} //-------------------------------------------------------------------------- -// Function: ArrayType overloaded constructor -///\brief Creates an ArrayType object using an existing id. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType overloaded constructor +///\brief Creates an ArrayType object using an existing id. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- -ArrayType::ArrayType(const hid_t existing_id) : DataType(existing_id) {} +ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: ArrayType copy constructor -///\brief Copy constructor: makes a copy of the original ArrayType object. -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType copy constructor +///\brief Copy constructor: makes a copy of the original ArrayType object. +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::ArrayType(const ArrayType& original) : DataType(original) {} //-------------------------------------------------------------------------- -// Function: ArrayType overloaded constructor -///\brief Creates a new array data type based on the specified -/// \a base_type. -///\param base_type - IN: Existing datatype -///\param ndims - IN: Rank of the array, [0..H5S_MAX_RANK] -///\param dims - IN: Size of each array dimension -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType overloaded constructor +///\brief Creates a new array data type based on the specified +/// \a base_type. +///\param base_type - IN: Existing datatype +///\param ndims - IN: Rank of the array, [0..H5S_MAX_RANK] +///\param dims - IN: Size of each array dimension +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) : DataType() { // Call C API to create an array data type hid_t new_type_id = H5Tarray_create2(base_type.getId(), ndims, dims); if (new_type_id < 0) - throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed"); + throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed"); // Set the id for this object id = new_type_id; } //-------------------------------------------------------------------------- -// Function: ArrayType overloaded constructor -///\brief Creates an ArrayType instance by opening an HDF5 array datatype -/// given its name, provided as a C character string. -///\param dtype_name - IN: Array type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: ArrayType overloaded constructor +///\brief Creates an ArrayType instance by opening an HDF5 array datatype +/// given its name, provided as a C character string. +///\param dtype_name - IN: Array type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openArrayType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openArrayType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- ArrayType::ArrayType(const H5Location& loc, const char *dtype_name) : DataType() { - id = p_opentype(loc, dtype_name); + id = p_opentype(loc, dtype_name); } //-------------------------------------------------------------------------- -// Function: ArrayType overloaded constructor -///\brief Creates an ArrayType instance by opening an HDF5 array datatype -/// given its name, provided as an \c H5std_string. -///\param dtype_name - IN: Array type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: ArrayType overloaded constructor +///\brief Creates an ArrayType instance by opening an HDF5 array datatype +/// given its name, provided as an \c H5std_string. +///\param dtype_name - IN: Array type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openArrayType(const H5std_string&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openArrayType(const H5std_string&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- ArrayType::ArrayType(const H5Location& loc, const H5std_string& dtype_name) : DataType() { - id = p_opentype(loc, dtype_name.c_str()); + id = p_opentype(loc, dtype_name.c_str()); } //-------------------------------------------------------------------------- -// Function: ArrayType::operator= -///\brief Assignment operator -///\param rhs - IN: Reference to the existing array datatype -///\return Reference to ArrayType instance -///\exception H5::DataTypeIException +// Function: ArrayType::operator= +///\brief Assignment operator +///\param rhs - IN: Reference to the existing array datatype +///\return Reference to ArrayType instance +///\exception H5::DataTypeIException // Description -// Closes the id on the lhs object first with setId, then copies -// each data member from the rhs object. (Issue HDFFV-9562) -// Programmer Binh-Minh Ribler - Mar 2016 +// Closes the id on the lhs object first with setId, then copies +// each data member from the rhs object. (Issue HDFFV-9562) +// Programmer Binh-Minh Ribler - Mar 2016 // Modification //-------------------------------------------------------------------------- ArrayType& ArrayType::operator=(const ArrayType& rhs) @@ -139,14 +139,14 @@ ArrayType& ArrayType::operator=(const ArrayType& rhs) } //-------------------------------------------------------------------------- -// Function: ArrayType::getArrayNDims -///\brief Returns the number of dimensions for an array datatype. -///\return Number of dimensions -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType::getArrayNDims +///\brief Returns the number of dimensions for an array datatype. +///\return Number of dimensions +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May 2004 // Modification -// Apr, 2016 -// Became const. +// Apr, 2016 +// Became const. //-------------------------------------------------------------------------- int ArrayType::getArrayNDims() const { @@ -154,38 +154,38 @@ int ArrayType::getArrayNDims() const int ndims = H5Tget_array_ndims(id); if (ndims < 0) { - throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed"); + throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed"); } return(ndims); } //-------------------------------------------------------------------------- -// Function: ArrayType::getArrayDims -///\brief Retrieves the size of all dimensions of an array datatype. -///\param dims - OUT: Sizes of dimensions -///\return Number of dimensions -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType::getArrayDims +///\brief Retrieves the size of all dimensions of an array datatype. +///\param dims - OUT: Sizes of dimensions +///\return Number of dimensions +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May 2004 // Modification -// Apr, 2016 -// Became const. +// Apr, 2016 +// Became const. //-------------------------------------------------------------------------- int ArrayType::getArrayDims(hsize_t* dims) const { // Get the dimensions int ndims = H5Tget_array_dims2(id, dims); if (ndims < 0) - throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); + throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); // Return the number of dimensions return(ndims); } //-------------------------------------------------------------------------- -// Function: ArrayType destructor -///\brief Properly terminates access to this array datatype. -// Programmer Binh-Minh Ribler - May 2004 +// Function: ArrayType destructor +///\brief Properly terminates access to this array datatype. +// Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ArrayType::~ArrayType() {} diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 15b6bb3..65917ae 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -27,39 +27,39 @@ namespace H5 { */ class H5_DLLCPP ArrayType : public DataType { public: - // Constructor that creates a new array data type based on the - // specified base type. - ArrayType(const DataType& base_type, int ndims, const hsize_t* dims); + // Constructor that creates a new array data type based on the + // specified base type. + ArrayType(const DataType& base_type, int ndims, const hsize_t* dims); - // Assignment operator - ArrayType& operator=(const ArrayType& rhs); + // Assignment operator + ArrayType& operator=(const ArrayType& rhs); - // Constructors that open an array datatype, given a location. - ArrayType(const H5Location& loc, const char* name); - ArrayType(const H5Location& loc, const H5std_string& name); + // Constructors that open an array datatype, given a location. + ArrayType(const H5Location& loc, const char* name); + ArrayType(const H5Location& loc, const H5std_string& name); - // Returns the number of dimensions of this array datatype. - int getArrayNDims() const; - //int getArrayNDims(); // removed 1.8.18 and 1.10.1 + // Returns the number of dimensions of this array datatype. + int getArrayNDims() const; + //int getArrayNDims(); // removed 1.8.18 and 1.10.1 - // Returns the sizes of dimensions of this array datatype. - int getArrayDims(hsize_t* dims) const; - //int getArrayDims(hsize_t* dims); // removed 1.8.18 and 1.10.1 + // Returns the sizes of dimensions of this array datatype. + int getArrayDims(hsize_t* dims) const; + //int getArrayDims(hsize_t* dims); // removed 1.8.18 and 1.10.1 - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("ArrayType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("ArrayType"); } - // Copy constructor: makes copy of the original object. - ArrayType(const ArrayType& original); + // Copy constructor: makes copy of the original object. + ArrayType( const ArrayType& original ); - // Constructor that takes an existing id - ArrayType(const hid_t existing_id); + // Constructor that takes an existing id + ArrayType( const hid_t existing_id ); - // Noop destructor - virtual ~ArrayType(); + // Noop destructor + virtual ~ArrayType(); - // Default constructor - ArrayType(); + // Default constructor + ArrayType(); }; } #endif // __H5ArrayType_H diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 0dc2b1e..22b163a 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -31,265 +31,265 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: AtomType default constructor [protected] -// Purpose Default constructor: creates a stub atomic datatype. -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType default constructor [protected] +// Purpose Default constructor: creates a stub atomic datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AtomType::AtomType() : DataType() {} //-------------------------------------------------------------------------- -// Function: AtomType overloaded constructor [protected] -// Purpose Creates an AtomType object using an existing id. -// Parameter existing_id - IN: Id of an existing datatype -// Exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType overloaded constructor [protected] +// Purpose Creates an AtomType object using an existing id. +// Parameter existing_id - IN: Id of an existing datatype +// Exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -AtomType::AtomType(const hid_t existing_id) : DataType(existing_id) {} +AtomType::AtomType( const hid_t existing_id ) : DataType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: AtomType copy constructor -///\brief Copy constructor: makes a copy of the original AtomType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType copy constructor +///\brief Copy constructor: makes a copy of the original AtomType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -AtomType::AtomType(const AtomType& original) : DataType(original) {} +AtomType::AtomType( const AtomType& original ) : DataType( original ) {} #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: AtomType::setSize -///\brief Sets the total size for an atomic datatype. -///\param size - IN: Size to set -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType::setSize +///\brief Sets the total size for an atomic datatype. +///\param size - IN: Size to set +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setSize(size_t size) const +void AtomType::setSize( size_t size ) const { - // Call C routine H5Tset_size to set the total size - herr_t ret_value = H5Tset_size(id, size); - if (ret_value < 0) - { - throw DataTypeIException(inMemFunc("setSize"), "H5Tset_size failed"); - } + // Call C routine H5Tset_size to set the total size + herr_t ret_value = H5Tset_size( id, size ); + if( ret_value < 0 ) + { + throw DataTypeIException(inMemFunc("setSize"), "H5Tset_size failed"); + } } //-------------------------------------------------------------------------- -// Function: AtomType::getOrder -///\brief Returns the byte order of an atomic datatype. -///\return Byte order, which can be: -/// \li \c H5T_ORDER_LE -/// \li \c H5T_ORDER_BE -/// \li \c H5T_ORDER_VAX -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: AtomType::getOrder +///\brief Returns the byte order of an atomic datatype. +///\return Byte order, which can be: +/// \li \c H5T_ORDER_LE +/// \li \c H5T_ORDER_BE +/// \li \c H5T_ORDER_VAX +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- H5T_order_t AtomType::getOrder() const { - // Call C routine to get the byte ordering - H5T_order_t type_order = H5Tget_order(id); + // Call C routine to get the byte ordering + H5T_order_t type_order = H5Tget_order( id ); - // return a byte order constant if successful - if (type_order == H5T_ORDER_ERROR) - { - throw DataTypeIException(inMemFunc("getOrder"), - "H5Tget_order returns H5T_ORDER_ERROR"); - } - return(type_order); + // return a byte order constant if successful + if( type_order == H5T_ORDER_ERROR ) + { + throw DataTypeIException(inMemFunc("getOrder"), + "H5Tget_order returns H5T_ORDER_ERROR"); + } + return( type_order ); } //-------------------------------------------------------------------------- -// Function: AtomType::getOrder -///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c H5std_string for the buffer that -/// provide the text description of the returned byte order. -/// The text description can be either of the following: -/// "Little endian byte ordering (0)"; -/// "Big endian byte ordering (1)"; -/// "VAX mixed byte ordering (2)"; -///\param order_string - OUT: Text description of the returned byte order -///\return Byte order, which can be: -/// \li \c H5T_ORDER_LE -/// \li \c H5T_ORDER_BE -/// \li \c H5T_ORDER_VAX -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType::getOrder +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the buffer that +/// provide the text description of the returned byte order. +/// The text description can be either of the following: +/// "Little endian byte ordering (0)"; +/// "Big endian byte ordering (1)"; +/// "VAX mixed byte ordering (2)"; +///\param order_string - OUT: Text description of the returned byte order +///\return Byte order, which can be: +/// \li \c H5T_ORDER_LE +/// \li \c H5T_ORDER_BE +/// \li \c H5T_ORDER_VAX +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5T_order_t AtomType::getOrder(H5std_string& order_string) const +H5T_order_t AtomType::getOrder( H5std_string& order_string ) const { - // Call the overloaded to get the type order without text - H5T_order_t type_order = getOrder(); + // Call the overloaded to get the type order without text + H5T_order_t type_order = getOrder(); - // Then provide the text and return the type order - if (type_order == H5T_ORDER_LE) - order_string = "Little endian byte ordering (0)"; - else if (type_order == H5T_ORDER_BE) - order_string = "Big endian byte ordering (1)"; - else if (type_order == H5T_ORDER_VAX) - order_string = "VAX mixed byte ordering (2)"; - return(type_order); + // Then provide the text and return the type order + if( type_order == H5T_ORDER_LE ) + order_string = "Little endian byte ordering (0)"; + else if( type_order == H5T_ORDER_BE ) + order_string = "Big endian byte ordering (1)"; + else if( type_order == H5T_ORDER_VAX ) + order_string = "VAX mixed byte ordering (2)"; + return( type_order ); } //-------------------------------------------------------------------------- -// Function: AtomType::setOrder -///\brief Sets the byte ordering of an atomic datatype. -///\param order - IN: Byte ordering constant, which can be: -/// \li \c H5T_ORDER_LE -/// \li \c H5T_ORDER_BE -/// \li \c H5T_ORDER_VAX -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType::setOrder +///\brief Sets the byte ordering of an atomic datatype. +///\param order - IN: Byte ordering constant, which can be: +/// \li \c H5T_ORDER_LE +/// \li \c H5T_ORDER_BE +/// \li \c H5T_ORDER_VAX +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setOrder(H5T_order_t order) const +void AtomType::setOrder( H5T_order_t order ) const { - // Call C routine to set the byte ordering - herr_t ret_value = H5Tset_order(id, order); - if (ret_value < 0) - { - throw DataTypeIException(inMemFunc("setOrder"), "H5Tset_order failed"); - } + // Call C routine to set the byte ordering + herr_t ret_value = H5Tset_order( id, order ); + if( ret_value < 0 ) + { + throw DataTypeIException(inMemFunc("setOrder"), "H5Tset_order failed"); + } } //-------------------------------------------------------------------------- -// Function: AtomType::getPrecision -///\brief Returns the precision of an atomic datatype. -///\return Number of significant bits -///\exception H5::DataTypeIException +// Function: AtomType::getPrecision +///\brief Returns the precision of an atomic datatype. +///\return Number of significant bits +///\exception H5::DataTypeIException ///\par Description -/// The precision is the number of significant bits which, -/// unless padding is present, is 8 times larger than the -/// value returned by \c DataType::getSize(). -// Programmer Binh-Minh Ribler - 2000 +/// The precision is the number of significant bits which, +/// unless padding is present, is 8 times larger than the +/// value returned by \c DataType::getSize(). +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- size_t AtomType::getPrecision() const { - size_t num_signi_bits = H5Tget_precision(id); // C routine + size_t num_signi_bits = H5Tget_precision( id ); // C routine - // returns number of significant bits if successful - if (num_signi_bits == 0) - { - throw DataTypeIException(inMemFunc("getPrecision"), - "H5Tget_precision returns invalid number of significant bits"); - } - return(num_signi_bits); + // returns number of significant bits if successful + if( num_signi_bits == 0 ) + { + throw DataTypeIException(inMemFunc("getPrecision"), + "H5Tget_precision returns invalid number of significant bits"); + } + return( num_signi_bits ); } //-------------------------------------------------------------------------- -// Function: AtomType::setPrecision -///\brief Sets the precision of an atomic datatype. -///\param precision - IN: Number of bits of precision -///\exception H5::DataTypeIException +// Function: AtomType::setPrecision +///\brief Sets the precision of an atomic datatype. +///\param precision - IN: Number of bits of precision +///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: +/// For information, please see C layer Reference Manuat at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetPrecision -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setPrecision(size_t precision) const +void AtomType::setPrecision( size_t precision ) const { - // Call C routine to set the datatype precision - herr_t ret_value = H5Tset_precision(id, precision); - if (ret_value < 0) - { - throw DataTypeIException(inMemFunc("setPrecision"), "H5Tset_precision failed"); - } + // Call C routine to set the datatype precision + herr_t ret_value = H5Tset_precision( id, precision ); + if( ret_value < 0 ) + { + throw DataTypeIException(inMemFunc("setPrecision"), "H5Tset_precision failed"); + } } //-------------------------------------------------------------------------- -// Function: AtomType::getOffset -///\brief Retrieves the bit offset of the first significant bit. -///\return Offset value -///\exception H5::DataTypeIException +// Function: AtomType::getOffset +///\brief Retrieves the bit offset of the first significant bit. +///\return Offset value +///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: +/// For information, please see C layer Reference Manuat at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetOffset -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Modification -// 12/05/00: due to C API change -// - return type changed from size_t to int -// - offset = -1 when failure occurs vs. 0 +// 12/05/00: due to C API change +// - return type changed from size_t to int +// - offset = -1 when failure occurs vs. 0 //-------------------------------------------------------------------------- int AtomType::getOffset() const { - int offset = H5Tget_offset(id); // C routine + int offset = H5Tget_offset( id ); // C routine - // returns a non-negative offset value if successful - if (offset == -1) - { - throw DataTypeIException(inMemFunc("getOffset"), - "H5Tget_offset returns a negative offset value"); - } - return(offset); + // returns a non-negative offset value if successful + if( offset == -1 ) + { + throw DataTypeIException(inMemFunc("getOffset"), + "H5Tget_offset returns a negative offset value"); + } + return( offset ); } //-------------------------------------------------------------------------- -// Function: AtomType::setOffset -///\brief Sets the bit offset of the first significant bit. -///\param offset - IN: Offset of first significant bit -///\exception H5::DataTypeIException +// Function: AtomType::setOffset +///\brief Sets the bit offset of the first significant bit. +///\param offset - IN: Offset of first significant bit +///\exception H5::DataTypeIException ///\par Description -/// For information, please see C layer Reference Manuat at: +/// For information, please see C layer Reference Manuat at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetOffset -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setOffset(size_t offset) const +void AtomType::setOffset( size_t offset ) const { - // Call C routine to set the bit offset - herr_t ret_value = H5Tset_offset(id, offset); - if (ret_value < 0) - { - throw DataTypeIException(inMemFunc("setOffset"), "H5Tset_offset failed"); - } + // Call C routine to set the bit offset + herr_t ret_value = H5Tset_offset( id, offset ); + if( ret_value < 0 ) + { + throw DataTypeIException(inMemFunc("setOffset"), "H5Tset_offset failed"); + } } //-------------------------------------------------------------------------- -// Function: AtomType::getPad -///\brief Retrieves the padding type of the least and most-significant -/// bit padding. -///\param lsb - OUT: Least-significant bit padding type -///\param msb - OUT: Most-significant bit padding type -///\exception H5::DataTypeIException +// Function: AtomType::getPad +///\brief Retrieves the padding type of the least and most-significant +/// bit padding. +///\param lsb - OUT: Least-significant bit padding type +///\param msb - OUT: Most-significant bit padding type +///\exception H5::DataTypeIException ///\par Description -/// Possible values for \a lsb and \a msb include: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. -/// \li \c H5T_PAD_ONE (1) - Set background to ones. -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. -// Programmer Binh-Minh Ribler - 2000 +/// Possible values for \a lsb and \a msb include: +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. +/// \li \c H5T_PAD_ONE (1) - Set background to ones. +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::getPad(H5T_pad_t& lsb, H5T_pad_t& msb) const +void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const { - // Call C routine to get the padding type - herr_t ret_value = H5Tget_pad(id, &lsb, &msb); - if (ret_value < 0) - { - throw DataTypeIException(inMemFunc("getPad"), "H5Tget_pad failed"); - } + // Call C routine to get the padding type + herr_t ret_value = H5Tget_pad( id, &lsb, &msb ); + if( ret_value < 0 ) + { + throw DataTypeIException(inMemFunc("getPad"), "H5Tget_pad failed"); + } } //-------------------------------------------------------------------------- -// Function: AtomType::setPad -///\brief Sets the least and most-significant bits padding types. -///\param lsb - IN: Least-significant bit padding type -///\param msb - IN: Most-significant bit padding type -///\exception H5::DataTypeIException +// Function: AtomType::setPad +///\brief Sets the least and most-significant bits padding types. +///\param lsb - IN: Least-significant bit padding type +///\param msb - IN: Most-significant bit padding type +///\exception H5::DataTypeIException ///\par Description -/// Valid values for \a lsb and \a msb include: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. -/// \li \c H5T_PAD_ONE (1) - Set background to ones. -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for \a lsb and \a msb include: +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. +/// \li \c H5T_PAD_ONE (1) - Set background to ones. +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void AtomType::setPad(H5T_pad_t lsb, H5T_pad_t msb) const +void AtomType::setPad( H5T_pad_t lsb, H5T_pad_t msb ) const { - // Call C routine to set the padding type - herr_t ret_value = H5Tset_pad(id, lsb, msb); - if (ret_value < 0) - { - throw DataTypeIException(inMemFunc("setPad"), "H5Tset_pad failed"); - } + // Call C routine to set the padding type + herr_t ret_value = H5Tset_pad( id, lsb, msb ); + if( ret_value < 0 ) + { + throw DataTypeIException(inMemFunc("setPad"), "H5Tset_pad failed"); + } } #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: AtomType destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: AtomType destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- AtomType::~AtomType() {} #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index a1e0262..d84b53f 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -30,53 +30,53 @@ namespace H5 { */ class H5_DLLCPP AtomType : public DataType { public: - // Returns the byte order of an atomic datatype. - H5T_order_t getOrder() const; - H5T_order_t getOrder(H5std_string& order_string) const; + // Returns the byte order of an atomic datatype. + H5T_order_t getOrder() const; + H5T_order_t getOrder( H5std_string& order_string ) const; - // Sets the byte ordering of an atomic datatype. - void setOrder(H5T_order_t order) const; + // Sets the byte ordering of an atomic datatype. + void setOrder( H5T_order_t order ) const; - // Retrieves the bit offset of the first significant bit. - // 12/05/00 - changed return type to int from size_t - C API - int getOffset() const; + // Retrieves the bit offset of the first significant bit. + // 12/05/00 - changed return type to int from size_t - C API + int getOffset() const; - // Sets the bit offset of the first significant bit. - void setOffset(size_t offset) const; + // Sets the bit offset of the first significant bit. + void setOffset( size_t offset ) const; - // Retrieves the padding type of the least and most-significant bit padding. - void getPad(H5T_pad_t& lsb, H5T_pad_t& msb) const; + // Retrieves the padding type of the least and most-significant bit padding. + void getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const; - // Sets the least and most-significant bits padding types - void setPad(H5T_pad_t lsb, H5T_pad_t msb) const; + // Sets the least and most-significant bits padding types + void setPad( H5T_pad_t lsb, H5T_pad_t msb ) const; - // Returns the precision of an atomic datatype. - size_t getPrecision() const; + // Returns the precision of an atomic datatype. + size_t getPrecision() const; - // Sets the precision of an atomic datatype. - void setPrecision(size_t precision) const; + // Sets the precision of an atomic datatype. + void setPrecision( size_t precision ) const; - // Sets the total size for an atomic datatype. - void setSize(size_t size) const; + // Sets the total size for an atomic datatype. + void setSize( size_t size ) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("AtomType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("AtomType"); } #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Copy constructor - makes copy of the original object - AtomType(const AtomType& original); + // Copy constructor - makes copy of the original object + AtomType( const AtomType& original ); - // Noop destructor - virtual ~AtomType(); + // Noop destructor + virtual ~AtomType(); #endif // DOXYGEN_SHOULD_SKIP_THIS protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Default constructor - AtomType(); + // Default constructor + AtomType(); - // Constructor that takes an existing id - AtomType(const hid_t existing_id); + // Constructor that takes an existing id + AtomType( const hid_t existing_id ); #endif // DOXYGEN_SHOULD_SKIP_THIS }; } diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 6701f6e..dfd2b28 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -1,7 +1,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * -/* All rights reserved. * + * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * @@ -20,7 +20,7 @@ #endif #include -#include "H5private.h" // for HDfree +#include "H5private.h" // for HDfree #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -44,17 +44,17 @@ using std::endl; class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate //-------------------------------------------------------------------------- -// Function: Attribute default constructor -///\brief Default constructor: Creates a stub attribute -// Programmer Binh-Minh Ribler - May, 2004 +// Function: Attribute default constructor +///\brief Default constructor: Creates a stub attribute +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- Attribute::Attribute() : AbstractDs(), H5Location(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: Attribute copy constructor -///\brief Copy constructor: makes a copy of the original Attribute object. -///\param original - IN: Original Attribute object to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute copy constructor +///\brief Copy constructor: makes a copy of the original Attribute object. +///\param original - IN: Original Attribute object to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute::Attribute(const Attribute& original) : AbstractDs(), H5Location(), id(original.id) { @@ -62,12 +62,12 @@ Attribute::Attribute(const Attribute& original) : AbstractDs(), H5Location(), id } //-------------------------------------------------------------------------- -// Function: Attribute overloaded constructor -///\brief Creates an Attribute object using the id of an existing -/// attribute. -///\param existing_id - IN: Id of an existing attribute -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute overloaded constructor +///\brief Creates an Attribute object using the id of an existing +/// attribute. +///\param existing_id - IN: Id of an existing attribute +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute::Attribute(const hid_t existing_id) : AbstractDs(), H5Location(), id(existing_id) { @@ -75,30 +75,30 @@ Attribute::Attribute(const hid_t existing_id) : AbstractDs(), H5Location(), id(e } //-------------------------------------------------------------------------- -// Function: Attribute::write -///\brief Writes data to this attribute. -///\param mem_type - IN: Attribute datatype (in memory) -///\param buf - IN: Data to be written -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute::write +///\brief Writes data to this attribute. +///\param mem_type - IN: Attribute datatype (in memory) +///\param buf - IN: Data to be written +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Attribute::write(const DataType& mem_type, const void *buf) const +void Attribute::write( const DataType& mem_type, const void *buf ) const { - herr_t ret_value = H5Awrite(id, mem_type.getId(), buf); - if (ret_value < 0) - { - throw AttributeIException("Attribute::write", "H5Awrite failed"); - } + herr_t ret_value = H5Awrite( id, mem_type.getId(), buf ); + if( ret_value < 0 ) + { + throw AttributeIException("Attribute::write", "H5Awrite failed"); + } } //-------------------------------------------------------------------------- -// Function: Attribute::write -///\brief This is an overloaded member function, provided for convenience. -/// It writes a \a H5std_string to this attribute. -///\param mem_type - IN: Attribute datatype (in memory) -///\param strg - IN: Data to be written -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Apr, 2003 +// Function: Attribute::write +///\brief This is an overloaded member function, provided for convenience. +/// It writes a \a H5std_string to this attribute. +///\param mem_type - IN: Attribute datatype (in memory) +///\param strg - IN: Data to be written +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Apr, 2003 //-------------------------------------------------------------------------- void Attribute::write(const DataType& mem_type, const H5std_string& strg) const { @@ -107,7 +107,7 @@ void Attribute::write(const DataType& mem_type, const H5std_string& strg) const htri_t is_variable_len = H5Tis_variable_str(mem_type.getId()); if (is_variable_len < 0) { - throw AttributeIException("Attribute::write", "H5Tis_variable_str failed"); + throw AttributeIException("Attribute::write", "H5Tis_variable_str failed"); } // Convert string to C-string const char* strg_C; @@ -117,55 +117,55 @@ void Attribute::write(const DataType& mem_type, const H5std_string& strg) const // Pass string in differently depends on variable or fixed length if (!is_variable_len) { - ret_value = H5Awrite(id, mem_type.getId(), strg_C); + ret_value = H5Awrite(id, mem_type.getId(), strg_C); } else { - // passing third argument by address - ret_value = H5Awrite(id, mem_type.getId(), &strg_C); + // passing third argument by address + ret_value = H5Awrite(id, mem_type.getId(), &strg_C); } if (ret_value < 0) { - throw AttributeIException("Attribute::write", "H5Awrite failed"); + throw AttributeIException("Attribute::write", "H5Awrite failed"); } } //-------------------------------------------------------------------------- -// Function: Attribute::read -///\brief Reads data from this attribute. -///\param mem_type - IN: Attribute datatype (in memory) -///\param buf - OUT: Buffer for read data -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute::read +///\brief Reads data from this attribute. +///\param mem_type - IN: Attribute datatype (in memory) +///\param buf - OUT: Buffer for read data +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Attribute::read(const DataType& mem_type, void *buf) const +void Attribute::read( const DataType& mem_type, void *buf ) const { - herr_t ret_value = H5Aread(id, mem_type.getId(), buf); - if (ret_value < 0) - { - throw AttributeIException("Attribute::read", "H5Aread failed"); - } + herr_t ret_value = H5Aread( id, mem_type.getId(), buf ); + if( ret_value < 0 ) + { + throw AttributeIException("Attribute::read", "H5Aread failed"); + } } //-------------------------------------------------------------------------- -// Function: Attribute::read -///\brief This is an overloaded member function, provided for convenience. -/// It reads a \a H5std_string from this attribute. -///\param mem_type - IN: Attribute datatype (in memory) -///\param strg - IN: Buffer for read string -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Apr, 2003 +// Function: Attribute::read +///\brief This is an overloaded member function, provided for convenience. +/// It reads a \a H5std_string from this attribute. +///\param mem_type - IN: Attribute datatype (in memory) +///\param strg - IN: Buffer for read string +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Apr, 2003 // Modification -// Mar 2008 -// Corrected a misunderstanding that H5Aread would allocate -// space for the buffer. Obtained the attribute size and -// allocated memory properly. -BMR -// Apr 2009 -// Used getInMemDataSize to get attribute data size. -BMR -// Jul 2009 -// Divided into specific private functions for fixed- and -// variable-len string data: p_read_fixed_len and -// p_read_variable_len. This should improve readability. -BMR +// Mar 2008 +// Corrected a misunderstanding that H5Aread would allocate +// space for the buffer. Obtained the attribute size and +// allocated memory properly. -BMR +// Apr 2009 +// Used getInMemDataSize to get attribute data size. -BMR +// Jul 2009 +// Divided into specific private functions for fixed- and +// variable-len string data: p_read_fixed_len and +// p_read_variable_len. This should improve readability. -BMR //-------------------------------------------------------------------------- void Attribute::read(const DataType& mem_type, H5std_string& strg) const { @@ -188,11 +188,11 @@ void Attribute::read(const DataType& mem_type, H5std_string& strg) const } //-------------------------------------------------------------------------- -// Function: Attribute::getInMemDataSize -///\brief Gets the size in memory of the attribute's data. -///\return Size of data (in memory) -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Apr 2009 +// Function: Attribute::getInMemDataSize +///\brief Gets the size in memory of the attribute's data. +///\return Size of data (in memory) +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Apr 2009 //-------------------------------------------------------------------------- size_t Attribute::getInMemDataSize() const { @@ -200,9 +200,9 @@ size_t Attribute::getInMemDataSize() const // Get the data type of this attribute hid_t mem_type_id = H5Aget_type(id); - if (mem_type_id < 0) + if( mem_type_id < 0 ) { - throw AttributeIException(func, "H5Aget_type failed"); + throw AttributeIException(func, "H5Aget_type failed"); } // Get the data type's size by first getting its native type then getting @@ -210,22 +210,22 @@ size_t Attribute::getInMemDataSize() const hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT); if (native_type < 0) { - throw AttributeIException(func, "H5Tget_native_type failed"); + throw AttributeIException(func, "H5Tget_native_type failed"); } size_t type_size = H5Tget_size(native_type); if (type_size == 0) { - throw AttributeIException(func, "H5Tget_size failed"); + throw AttributeIException(func, "H5Tget_size failed"); } // Close the native type and the datatype of this attribute. if (H5Tclose(native_type) < 0) { - throw DataSetIException(func, "H5Tclose(native_type) failed"); + throw DataSetIException(func, "H5Tclose(native_type) failed"); } if (H5Tclose(mem_type_id) < 0) { - throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); + throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); } // Get number of elements of the attribute by first getting its dataspace @@ -233,18 +233,18 @@ size_t Attribute::getInMemDataSize() const hid_t space_id = H5Aget_space(id); if (space_id < 0) { - throw AttributeIException(func, "H5Aget_space failed"); + throw AttributeIException(func, "H5Aget_space failed"); } hssize_t num_elements = H5Sget_simple_extent_npoints(space_id); if (num_elements < 0) { - throw AttributeIException(func, "H5Sget_simple_extent_npoints failed"); + throw AttributeIException(func, "H5Sget_simple_extent_npoints failed"); } // Close the dataspace if (H5Sclose(space_id) < 0) { - throw DataSetIException(func, "H5Sclose failed"); + throw DataSetIException(func, "H5Sclose failed"); } // Calculate and return the size of the data @@ -253,46 +253,46 @@ size_t Attribute::getInMemDataSize() const } //-------------------------------------------------------------------------- -// Function: Attribute::getSpace -///\brief Gets a copy of the dataspace for this attribute. -///\return Dataspace instance -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute::getSpace +///\brief Gets a copy of the dataspace for this attribute. +///\return Dataspace instance +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace Attribute::getSpace() const { // Calls C function H5Aget_space to get the id of the dataspace - hid_t dataspace_id = H5Aget_space(id); + hid_t dataspace_id = H5Aget_space( id ); // If the dataspace id is valid, create and return the DataSpace object - if (dataspace_id > 0) - { - DataSpace dataspace; - f_DataSpace_setId(&dataspace, dataspace_id); - return(dataspace); - } + if( dataspace_id > 0 ) + { + DataSpace dataspace; + f_DataSpace_setId(&dataspace, dataspace_id); + return(dataspace); + } else - { - throw AttributeIException("Attribute::getSpace", "H5Aget_space failed"); - } + { + throw AttributeIException("Attribute::getSpace", "H5Aget_space failed"); + } } //-------------------------------------------------------------------------- -// Function: Attribute::getName -///\brief Gets the name of this attribute, returning its length. -///\param attr_name - OUT: Buffer for the name string as char* -///\param buf_size - IN: Length of the buffer, default to 0 -///\return Actual length of the attribute name -///\exception H5::AttributeIException +// Function: Attribute::getName +///\brief Gets the name of this attribute, returning its length. +///\param attr_name - OUT: Buffer for the name string as char* +///\param buf_size - IN: Length of the buffer, default to 0 +///\return Actual length of the attribute name +///\exception H5::AttributeIException ///\par Description -/// This function retrieves \a buf_size chars of the attribute's -/// name including null termination. Thus, if the actual length -/// of the name is more than buf_size-1, the retrieved name will -/// be truncated to accommodate the null terminator. -/// To get length of the attribute's name for buffer allocation, -/// an application can call this function passing in NULL for the -/// first argument and ignore the second argument. -// Programmer Binh-Minh Ribler - Mar, 2014 +/// This function retrieves \a buf_size chars of the attribute's +/// name including null termination. Thus, if the actual length +/// of the name is more than buf_size-1, the retrieved name will +/// be truncated to accommodate the null terminator. +/// To get length of the attribute's name for buffer allocation, +/// an application can call this function passing in NULL for the +/// first argument and ignore the second argument. +// Programmer Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- ssize_t Attribute::getName(char* attr_name, size_t buf_size) const { @@ -302,25 +302,25 @@ ssize_t Attribute::getName(char* attr_name, size_t buf_size) const // If H5Aget_name returns a negative value, raise an exception if (name_size < 0) { - throw AttributeIException("Attribute::getName", "H5Aget_name failed"); + throw AttributeIException("Attribute::getName", "H5Aget_name failed"); } else if (name_size == 0) { - throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0"); + throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0"); } // Return length of the name return(name_size); } //-------------------------------------------------------------------------- -// Function: Attribute::getName -///\brief Returns the name of this attribute as an \a H5std_string. -///\return Name of the attribute -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: Attribute::getName +///\brief Returns the name of this attribute as an \a H5std_string. +///\return Name of the attribute +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - May, 2004 // Modification -// Mar 2014 - BMR -// Revised to use the modified getName() above +// Mar 2014 - BMR +// Revised to use the modified getName() above //-------------------------------------------------------------------------- H5std_string Attribute::getName() const { @@ -332,11 +332,11 @@ H5std_string Attribute::getName() const // If H5Aget_name failed, throw exception if (name_size < 0) { - throw AttributeIException("Attribute::getName", "H5Aget_name failed"); + throw AttributeIException("Attribute::getName", "H5Aget_name failed"); } else if (name_size == 0) { - throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0"); + throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0"); } // Attribute's name exists, retrieve it else if (name_size > 0) @@ -359,44 +359,44 @@ H5std_string Attribute::getName() const } //-------------------------------------------------------------------------- -// Function: Attribute::getName -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an integer -/// specifying a desired length to be retrieved of the name. -///\return Name (or part of name) of the attribute -///\param len - IN: Desired length of the name -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute::getName +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an integer +/// specifying a desired length to be retrieved of the name. +///\return Name (or part of name) of the attribute +///\param len - IN: Desired length of the name +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Mar 2014 - BMR -// Revised to use the new getName() below +// Mar 2014 - BMR +// Revised to use the new getName() below //-------------------------------------------------------------------------- H5std_string Attribute::getName(size_t len) const { H5std_string attr_name; ssize_t name_size = getName(attr_name, len); if (name_size < 0) - return(""); + return(""); else - return(attr_name); + return(attr_name); } //-------------------------------------------------------------------------- -// Function: Attribute::getName -///\brief Gets the name of this attribute, returning its length. -///\param attr_name - OUT: Buffer for the name string as \a H5std_string -///\param len - IN: Desired length of the name, default to 0 -///\return Actual length of the attribute name -///\exception H5::AttributeIException +// Function: Attribute::getName +///\brief Gets the name of this attribute, returning its length. +///\param attr_name - OUT: Buffer for the name string as \a H5std_string +///\param len - IN: Desired length of the name, default to 0 +///\return Actual length of the attribute name +///\exception H5::AttributeIException ///\par Description -/// This function retrieves the attribute's name as a string. The -/// buf_size can specify a specific length or default to 0, in -/// which case the entire name will be retrieved. -// Programmer Binh-Minh Ribler - Nov, 2001 +/// This function retrieves the attribute's name as a string. The +/// buf_size can specify a specific length or default to 0, in +/// which case the entire name will be retrieved. +// Programmer Binh-Minh Ribler - Nov, 2001 // Modification -// Mar 2014 - BMR -// Added to replace getName(size_t, H5std_string&) so that it'll -// allow the argument "len" to be skipped. +// Mar 2014 - BMR +// Added to replace getName(size_t, H5std_string&) so that it'll +// allow the argument "len" to be skipped. //-------------------------------------------------------------------------- ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const { @@ -406,7 +406,7 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const if (len == 0) { attr_name = getName(); - name_size = attr_name.length(); + name_size = attr_name.length(); } // If length is provided, get that number of characters in name else @@ -430,33 +430,33 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const } //-------------------------------------------------------------------------- -// Function: Attribute::getName -// Purpose This function is replaced by the previous function, which -// provides more convenient prototype. It will be removed -// in future release. -// Param len - IN: Desired length of the name -// Param attr_name - OUT: Buffer for the name string -// Return Actual length of the attribute name -// Exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Nov, 2001 +// Function: Attribute::getName +// Purpose This function is replaced by the previous function, which +// provides more convenient prototype. It will be removed +// in future release. +// Param len - IN: Desired length of the name +// Param attr_name - OUT: Buffer for the name string +// Return Actual length of the attribute name +// Exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Nov, 2001 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- -//ssize_t Attribute::getName(size_t len, H5std_string& attr_name) const +//ssize_t Attribute::getName( size_t len, H5std_string& attr_name ) const //{ // return (getName(attr_name, len)); //} //-------------------------------------------------------------------------- -// Function: Attribute::getStorageSize -///\brief Returns the amount of storage size required for this attribute. -///\return Size of the storage or 0, for no data -///\exception H5::AttributeIException -// Note: H5Dget_storage_size returns 0 when there is no data. This -// function should have no failure. (from SLU) -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: Attribute::getStorageSize +///\brief Returns the amount of storage size required for this attribute. +///\return Size of the storage or 0, for no data +///\exception H5::AttributeIException +// Note: H5Dget_storage_size returns 0 when there is no data. This +// function should have no failure. (from SLU) +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- hsize_t Attribute::getStorageSize() const { @@ -466,19 +466,19 @@ hsize_t Attribute::getStorageSize() const //-------------------------------------------------------------------------- // Function: Attribute::getId -///\brief Get the id of this attribute -///\return Attribute identifier +///\brief Get the id of this attribute +///\return Attribute identifier // Description: -// Class hierarchy is revised to address bugzilla 1068. Class -// AbstractDS and Attribute are moved out of H5Object. In -// addition, member IdComponent::id is moved into subclasses, and -// IdComponent::getId now becomes pure virtual function. +// Class hierarchy is revised to address bugzilla 1068. Class +// AbstractDS and Attribute are moved out of H5Object. In +// addition, member IdComponent::id is moved into subclasses, and +// IdComponent::getId now becomes pure virtual function. // Programmer Binh-Minh Ribler - May, 2008 // Modification -// Aug 2016 - BMR -// Note that Attribute is now inheriting from H5Location, because -// an attribute id can be used to specify a location in HDF5 -// library. +// Aug 2016 - BMR +// Note that Attribute is now inheriting from H5Location, because +// an attribute id can be used to specify a location in HDF5 +// library. //-------------------------------------------------------------------------- hid_t Attribute::getId() const { @@ -486,36 +486,36 @@ hid_t Attribute::getId() const } //-------------------------------------------------------------------------- -// Function: Attribute::p_get_type (private) -// Purpose Gets the datatype of this attribute. -// Return Id of the datatype -// Exception H5::AttributeIException +// Function: Attribute::p_get_type (private) +// Purpose Gets the datatype of this attribute. +// Return Id of the datatype +// Exception H5::AttributeIException // Description -// This private function is used in AbstractDs. -// Programmer Binh-Minh Ribler - 2000 +// This private function is used in AbstractDs. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hid_t Attribute::p_get_type() const { - hid_t type_id = H5Aget_type(id); - if (type_id > 0) - return(type_id); - else - { - throw AttributeIException("", "H5Aget_type failed"); - } + hid_t type_id = H5Aget_type( id ); + if( type_id > 0 ) + return( type_id ); + else + { + throw AttributeIException("", "H5Aget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: Attribute::p_read_fixed_len (private) -// brief Reads a fixed length \a H5std_string from an attribute. -// param mem_type - IN: Attribute datatype (in memory) -// param strg - IN: Buffer for read string -// exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Jul, 2009 +// Function: Attribute::p_read_fixed_len (private) +// brief Reads a fixed length \a H5std_string from an attribute. +// param mem_type - IN: Attribute datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Jul, 2009 // Modification -// Jul 2009 -// Separated the fixed length case from the original -// Attribute::read +// Jul 2009 +// Separated the fixed length case from the original +// Attribute::read //-------------------------------------------------------------------------- void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const { @@ -527,31 +527,31 @@ void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) c // If there is data, allocate buffer and read it. if (attr_size > 0) { - char *strg_C = new char[attr_size+1]; - herr_t ret_value = H5Aread(id, mem_type.getId(), strg_C); - if (ret_value < 0) - { - delete []strg_C; // de-allocate for fixed-len string - throw AttributeIException("Attribute::read", "H5Aread failed"); - } - // Get string from the C char* and release resource allocated locally - strg_C[attr_size] = '\0'; - strg = strg_C; - delete []strg_C; + char *strg_C = new char[attr_size+1]; + herr_t ret_value = H5Aread(id, mem_type.getId(), strg_C); + if( ret_value < 0 ) + { + delete []strg_C; // de-allocate for fixed-len string + throw AttributeIException("Attribute::read", "H5Aread failed"); + } + // Get string from the C char* and release resource allocated locally + strg_C[attr_size] = '\0'; + strg = strg_C; + delete []strg_C; } } //-------------------------------------------------------------------------- -// Function: Attribute::p_read_variable_len (private) -// brief Reads a variable length \a H5std_string from an attribute. -// param mem_type - IN: Attribute datatype (in memory) -// param strg - IN: Buffer for read string -// exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Jul, 2009 +// Function: Attribute::p_read_variable_len (private) +// brief Reads a variable length \a H5std_string from an attribute. +// param mem_type - IN: Attribute datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Jul, 2009 // Modification -// Jul 2009 -// Separated the variable length case from the original -// Attribute::read. -BMR +// Jul 2009 +// Separated the variable length case from the original +// Attribute::read. -BMR //-------------------------------------------------------------------------- void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg) const { @@ -561,9 +561,9 @@ void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg // Read attribute, no allocation for variable-len string; C library will herr_t ret_value = H5Aread(id, mem_type.getId(), &strg_C); - if (ret_value < 0) + if( ret_value < 0 ) { - throw AttributeIException("Attribute::read", "H5Aread failed"); + throw AttributeIException("Attribute::read", "H5Aread failed"); } // Get string from the C char* and release resource allocated by C API @@ -577,65 +577,65 @@ void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg ///\brief Sets the identifier of this object to a new value. /// ///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails +/// object fails // Description: -// The underlaying reference counting in the C library ensures -// that the current valid id of this object is properly closed. -// Then the object's id is reset to the new id. +// The underlaying reference counting in the C library ensures +// that the current valid id of this object is properly closed. +// Then the object's id is reset to the new id. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Attribute::p_setId(const hid_t new_id) { // handling references to this old id try { - close(); + close(); } catch (Exception& close_error) { - throw AttributeIException("Attribute::p_setId", close_error.getDetailMsg()); + throw AttributeIException("Attribute::p_setId", close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Attribute::close -///\brief Closes this attribute. +// Function: Attribute::close +///\brief Closes this attribute. /// -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void Attribute::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Aclose(id); - if (ret_value < 0) - { - throw AttributeIException("Attribute::close", "H5Aclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Aclose(id); + if( ret_value < 0 ) + { + throw AttributeIException("Attribute::close", "H5Aclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: Attribute destructor -///\brief Properly terminates access to this attribute. -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute destructor +///\brief Properly terminates access to this attribute. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- Attribute::~Attribute() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "Attribute::~Attribute - " << close_error.getDetailMsg() << endl; + cerr << "Attribute::~Attribute - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 0243cd9..c27bbdf 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -32,74 +32,74 @@ namespace H5 { class H5_DLLCPP Attribute : public AbstractDs, public H5Location { public: - // Copy constructor: makes a copy of an existing Attribute object. - Attribute(const Attribute& original); + // Copy constructor: makes a copy of an existing Attribute object. + Attribute( const Attribute& original ); - // Default constructor - Attribute(); + // Default constructor + Attribute(); - // Creates a copy of an existing attribute using the attribute id - Attribute(const hid_t attr_id); + // Creates a copy of an existing attribute using the attribute id + Attribute( const hid_t attr_id ); - // Closes this attribute. - virtual void close(); + // Closes this attribute. + virtual void close(); - // Gets the name of this attribute. - ssize_t getName(char* attr_name, size_t buf_size = 0) const; - H5std_string getName(size_t len) const; - H5std_string getName() const; - ssize_t getName(H5std_string& attr_name, size_t len = 0) const; - // The overloaded function below is replaced by the one above and it - // is kept for backward compatibility purpose. - ssize_t getName(size_t buf_size, H5std_string& attr_name) const; + // Gets the name of this attribute. + ssize_t getName(char* attr_name, size_t buf_size = 0) const; + H5std_string getName(size_t len) const; + H5std_string getName() const; + ssize_t getName(H5std_string& attr_name, size_t len = 0) const; + // The overloaded function below is replaced by the one above and it + // is kept for backward compatibility purpose. + ssize_t getName( size_t buf_size, H5std_string& attr_name ) const; - // Gets a copy of the dataspace for this attribute. - virtual DataSpace getSpace() const; + // Gets a copy of the dataspace for this attribute. + virtual DataSpace getSpace() const; - // Returns the amount of storage size required for this attribute. - virtual hsize_t getStorageSize() const; + // Returns the amount of storage size required for this attribute. + virtual hsize_t getStorageSize() const; - // Returns the in memory size of this attribute's data. - virtual size_t getInMemDataSize() const; + // Returns the in memory size of this attribute's data. + virtual size_t getInMemDataSize() const; - // Reads data from this attribute. - void read(const DataType& mem_type, void *buf) const; - void read(const DataType& mem_type, H5std_string& strg) const; + // Reads data from this attribute. + void read( const DataType& mem_type, void *buf ) const; + void read( const DataType& mem_type, H5std_string& strg ) const; - // Writes data to this attribute. - void write(const DataType& mem_type, const void *buf) const; - void write(const DataType& mem_type, const H5std_string& strg) const; + // Writes data to this attribute. + void write(const DataType& mem_type, const void *buf ) const; + void write(const DataType& mem_type, const H5std_string& strg ) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("Attribute"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("Attribute"); } - // Gets the attribute id. - virtual hid_t getId() const; + // Gets the attribute id. + virtual hid_t getId() const; - // Destructor: properly terminates access to this attribute. - virtual ~Attribute(); + // Destructor: properly terminates access to this attribute. + virtual ~Attribute(); #ifndef DOXYGEN_SHOULD_SKIP_THIS protected: - // Sets the attribute id. - virtual void p_setId(const hid_t new_id); + // Sets the attribute id. + virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 attribute id + hid_t id; // HDF5 attribute id - // This function contains the common code that is used by - // getTypeClass and various API functions getXxxType - // defined in AbstractDs for generic datatype and specific - // sub-types - virtual hid_t p_get_type() const; + // This function contains the common code that is used by + // getTypeClass and various API functions getXxxType + // defined in AbstractDs for generic datatype and specific + // sub-types + virtual hid_t p_get_type() const; - // Reads variable or fixed len strings from this attribute. - void p_read_variable_len(const DataType& mem_type, H5std_string& strg) const; - void p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const; + // Reads variable or fixed len strings from this attribute. + void p_read_variable_len(const DataType& mem_type, H5std_string& strg) const; + void p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const; - // Friend function to set Attribute id. For library use only. - friend void f_Attribute_setId(Attribute* attr, hid_t new_id); + // Friend function to set Attribute id. For library use only. + friend void f_Attribute_setId(Attribute* attr, hid_t new_id); }; } diff --git a/c++/src/H5Classes.h b/c++/src/H5Classes.h index 00066fe..03faa1a 100644 --- a/c++/src/H5Classes.h +++ b/c++/src/H5Classes.h @@ -18,31 +18,31 @@ #define __H5Classes_H namespace H5 { - class Exception; - class IdComponent; - class H5Location; - class H5Object; - class PropList; - class FileCreatPropList; - class FileAccPropList; - class LinkAccPropList; - class DSetCreatPropList; - class DSetMemXferPropList; - class DTypePropList; - class DataType; - class DataSpace; - class AtomType; - class PredType; - class EnumType; - class IntType; - class FloatType; - class StrType; - class CompType; - class AbstractDs; - class DataSet; - class Group; - class H5File; - class Attribute; - class H5Library; + class Exception; + class IdComponent; + class H5Location; + class H5Object; + class PropList; + class FileCreatPropList; + class FileAccPropList; + class LinkAccPropList; + class DSetCreatPropList; + class DSetMemXferPropList; + class DTypePropList; + class DataType; + class DataSpace; + class AtomType; + class PredType; + class EnumType; + class IntType; + class FloatType; + class StrType; + class CompType; + class AbstractDs; + class DataSet; + class Group; + class H5File; + class Attribute; + class H5Library; } #endif // __H5Classes_H diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 5c01055..5f7971f 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -16,7 +16,7 @@ #include #include "H5Include.h" -#include "H5private.h" // for HDstrcpy +#include "H5private.h" // for HDstrcpy #include "H5Exception.h" #include "H5IdComponent.h" #include "H5DataSpace.h" @@ -46,292 +46,293 @@ // December 2000 namespace H5 { +using namespace std; //-------------------------------------------------------------------------- -// Function: CommonFG::openDataType -///\brief Opens the named generic datatype at this location. -///\param name - IN: Name of the datatype to open -///\return DataType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openDataType +///\brief Opens the named generic datatype at this location. +///\param name - IN: Name of the datatype to open +///\return DataType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType CommonFG::openDataType(const char* name) const +DataType CommonFG::openDataType( const char* name ) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - // If the datatype's opening failed, throw an exception - if (type_id < 0) - throwException("openDataType", "H5Topen2 failed"); + // If the datatype's opening failed, throw an exception + if( type_id < 0 ) + throwException("openDataType", "H5Topen2 failed"); - // No failure, create and return the DataType object - DataType data_type(type_id); - return(data_type); + // No failure, create and return the DataType object + DataType data_type(type_id); + return(data_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openDataType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openDataType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType CommonFG::openDataType(const H5std_string& name) const +DataType CommonFG::openDataType( const H5std_string& name ) const { - return(openDataType(name.c_str())); + return( openDataType( name.c_str()) ); } //-------------------------------------------------------------------------- -// Function: CommonFG::openArrayType -///\brief Opens the named array datatype at this location. -///\param name - IN: Name of the array datatype to open -///\return ArrayType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CommonFG::openArrayType +///\brief Opens the named array datatype at this location. +///\param name - IN: Name of the array datatype to open +///\return ArrayType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -ArrayType CommonFG::openArrayType(const char* name) const +ArrayType CommonFG::openArrayType( const char* name ) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if (type_id < 0) - throwException("openArrayType", "H5Topen2 failed"); - - // No failure, create and return the ArrayType object - ArrayType array_type; - f_DataType_setId(&array_type, type_id); - return(array_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if( type_id < 0 ) + throwException("openArrayType", "H5Topen2 failed"); + + // No failure, create and return the ArrayType object + ArrayType array_type; + f_DataType_setId(&array_type, type_id); + return(array_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openArrayType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CommonFG::openArrayType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -ArrayType CommonFG::openArrayType(const H5std_string& name) const +ArrayType CommonFG::openArrayType( const H5std_string& name ) const { - return(openArrayType(name.c_str())); + return( openArrayType( name.c_str()) ); } //-------------------------------------------------------------------------- -// Function: CommonFG::openCompType -///\brief Opens the named compound datatype at this location. -///\param name - IN: Name of the compound datatype to open -///\return CompType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openCompType +///\brief Opens the named compound datatype at this location. +///\param name - IN: Name of the compound datatype to open +///\return CompType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType CommonFG::openCompType(const char* name) const +CompType CommonFG::openCompType( const char* name ) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if (type_id < 0) - throwException("openCompType", "H5Topen2 failed"); - - // No failure, create and return the CompType object - CompType comp_type; - f_DataType_setId(&comp_type, type_id); - return(comp_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if( type_id < 0 ) + throwException("openCompType", "H5Topen2 failed"); + + // No failure, create and return the CompType object + CompType comp_type; + f_DataType_setId(&comp_type, type_id); + return(comp_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openCompType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openCompType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType CommonFG::openCompType(const H5std_string& name) const +CompType CommonFG::openCompType( const H5std_string& name ) const { - return(openCompType(name.c_str())); + return( openCompType( name.c_str()) ); } //-------------------------------------------------------------------------- -// Function: CommonFG::openEnumType -///\brief Opens the named enumeration datatype at this location. -///\param name - IN: Name of the enumeration datatype to open -///\return EnumType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openEnumType +///\brief Opens the named enumeration datatype at this location. +///\param name - IN: Name of the enumeration datatype to open +///\return EnumType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType CommonFG::openEnumType(const char* name) const +EnumType CommonFG::openEnumType( const char* name ) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if (type_id < 0) - throwException("openEnumType", "H5Topen2 failed"); - - // No failure, create and return the EnumType object - EnumType enum_type; - f_DataType_setId(&enum_type, type_id); - return(enum_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if( type_id < 0 ) + throwException("openEnumType", "H5Topen2 failed"); + + // No failure, create and return the EnumType object + EnumType enum_type; + f_DataType_setId(&enum_type, type_id); + return(enum_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openEnumType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openEnumType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType CommonFG::openEnumType(const H5std_string& name) const +EnumType CommonFG::openEnumType( const H5std_string& name ) const { - return(openEnumType(name.c_str())); + return( openEnumType( name.c_str()) ); } //-------------------------------------------------------------------------- -// Function: CommonFG::openIntType -///\brief Opens the named integer datatype at this location. -///\param name - IN: Name of the integer datatype to open -///\return IntType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openIntType +///\brief Opens the named integer datatype at this location. +///\param name - IN: Name of the integer datatype to open +///\return IntType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType CommonFG::openIntType(const char* name) const +IntType CommonFG::openIntType( const char* name ) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if (type_id < 0) - throwException("openIntType", "H5Topen2 failed"); - - // No failure, create and return the IntType object - IntType int_type; - f_DataType_setId(&int_type, type_id); - return(int_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if( type_id < 0 ) + throwException("openIntType", "H5Topen2 failed"); + + // No failure, create and return the IntType object + IntType int_type; + f_DataType_setId(&int_type, type_id); + return(int_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openIntType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openIntType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType CommonFG::openIntType(const H5std_string& name) const +IntType CommonFG::openIntType( const H5std_string& name ) const { - return(openIntType(name.c_str())); + return( openIntType( name.c_str()) ); } //-------------------------------------------------------------------------- -// Function: CommonFG::openFloatType -///\brief Opens the named floating-point datatype at this location. -///\param name - IN: Name of the floating-point datatype to open -///\return FloatType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openFloatType +///\brief Opens the named floating-point datatype at this location. +///\param name - IN: Name of the floating-point datatype to open +///\return FloatType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType CommonFG::openFloatType(const char* name) const +FloatType CommonFG::openFloatType( const char* name ) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if (type_id < 0) - throwException("openFloatType", "H5Topen2 failed"); - - // No failure, create and return the FloatType object - FloatType float_type; - f_DataType_setId(&float_type, type_id); - return(float_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if( type_id < 0 ) + throwException("openFloatType", "H5Topen2 failed"); + + // No failure, create and return the FloatType object + FloatType float_type; + f_DataType_setId(&float_type, type_id); + return(float_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openFloatType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openFloatType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType CommonFG::openFloatType(const H5std_string& name) const +FloatType CommonFG::openFloatType( const H5std_string& name ) const { - return(openFloatType(name.c_str())); + return( openFloatType( name.c_str()) ); } //-------------------------------------------------------------------------- -// Function: CommonFG::openStrType -///\brief Opens the named string datatype at this location. -///\param name - IN: Name of the string datatype to open -///\return StrType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openStrType +///\brief Opens the named string datatype at this location. +///\param name - IN: Name of the string datatype to open +///\return StrType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType CommonFG::openStrType(const char* name) const +StrType CommonFG::openStrType( const char* name ) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if (type_id < 0) - throwException("openStrType", "H5Topen2 failed"); - - // No failure, create and return the StrType object - StrType str_type; - f_DataType_setId(&str_type, type_id); - return(str_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if( type_id < 0 ) + throwException("openStrType", "H5Topen2 failed"); + + // No failure, create and return the StrType object + StrType str_type; + f_DataType_setId(&str_type, type_id); + return(str_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openStrType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: CommonFG::openStrType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType CommonFG::openStrType(const H5std_string& name) const +StrType CommonFG::openStrType( const H5std_string& name ) const { - return(openStrType(name.c_str())); + return( openStrType( name.c_str()) ); } //-------------------------------------------------------------------------- -// Function: CommonFG::openVarLenType -///\brief Opens the named variable length datatype at this location. -///\param name - IN: Name of the variable length datatype to open -///\return VarLenType instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CommonFG::openVarLenType +///\brief Opens the named variable length datatype at this location. +///\param name - IN: Name of the variable length datatype to open +///\return VarLenType instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -VarLenType CommonFG::openVarLenType(const char* name) const +VarLenType CommonFG::openVarLenType( const char* name ) const { - // Call C function H5Topen2 to open the named datatype in this group, - // given either the file or group id - hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); - - // If the datatype's opening failed, throw an exception - if (type_id < 0) - throwException("openVarLenType", "H5Topen2 failed"); - - // No failure, create and return the VarLenType object - VarLenType varlen_type; - f_DataType_setId(&varlen_type, type_id); - return(varlen_type); + // Call C function H5Topen2 to open the named datatype in this group, + // given either the file or group id + hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT); + + // If the datatype's opening failed, throw an exception + if( type_id < 0 ) + throwException("openVarLenType", "H5Topen2 failed"); + + // No failure, create and return the VarLenType object + VarLenType varlen_type; + f_DataType_setId(&varlen_type, type_id); + return(varlen_type); } //-------------------------------------------------------------------------- -// Function: CommonFG::openVarLenType -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CommonFG::openVarLenType +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -VarLenType CommonFG::openVarLenType(const H5std_string& name) const +VarLenType CommonFG::openVarLenType( const H5std_string& name ) const { - return(openVarLenType(name.c_str())); + return( openVarLenType( name.c_str()) ); } #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 588d49a..59f425c 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -32,55 +32,55 @@ class VarLenType; */ class H5_DLLCPP CommonFG { public: - // Opens a generic named datatype in this location. - DataType openDataType(const char* name) const; - DataType openDataType(const H5std_string& name) const; + // Opens a generic named datatype in this location. + DataType openDataType(const char* name) const; + DataType openDataType(const H5std_string& name) const; - // Opens a named array datatype in this location. - ArrayType openArrayType(const char* name) const; - ArrayType openArrayType(const H5std_string& name) const; + // Opens a named array datatype in this location. + ArrayType openArrayType(const char* name) const; + ArrayType openArrayType(const H5std_string& name) const; - // Opens a named compound datatype in this location. - CompType openCompType(const char* name) const; - CompType openCompType(const H5std_string& name) const; + // Opens a named compound datatype in this location. + CompType openCompType(const char* name) const; + CompType openCompType(const H5std_string& name) const; - // Opens a named enumeration datatype in this location. - EnumType openEnumType(const char* name) const; - EnumType openEnumType(const H5std_string& name) const; + // Opens a named enumeration datatype in this location. + EnumType openEnumType(const char* name) const; + EnumType openEnumType(const H5std_string& name) const; - // Opens a named integer datatype in this location. - IntType openIntType(const char* name) const; - IntType openIntType(const H5std_string& name) const; + // Opens a named integer datatype in this location. + IntType openIntType(const char* name) const; + IntType openIntType(const H5std_string& name) const; - // Opens a named floating-point datatype in this location. - FloatType openFloatType(const char* name) const; - FloatType openFloatType(const H5std_string& name) const; + // Opens a named floating-point datatype in this location. + FloatType openFloatType(const char* name) const; + FloatType openFloatType(const H5std_string& name) const; - // Opens a named string datatype in this location. - StrType openStrType(const char* name) const; - StrType openStrType(const H5std_string& name) const; + // Opens a named string datatype in this location. + StrType openStrType(const char* name) const; + StrType openStrType(const H5std_string& name) const; - // Opens a named variable length datatype in this location. - VarLenType openVarLenType(const char* name) const; - VarLenType openVarLenType(const H5std_string& name) const; + // Opens a named variable length datatype in this location. + VarLenType openVarLenType(const char* name) const; + VarLenType openVarLenType(const H5std_string& name) const; #ifndef DOXYGEN_SHOULD_SKIP_THIS - /// For subclasses, H5File and Group, to return the correct - /// object id, i.e. file or group id. - virtual hid_t getLocId() const = 0; + /// For subclasses, H5File and Group, to return the correct + /// object id, i.e. file or group id. + virtual hid_t getLocId() const = 0; - /// For subclasses, H5File and Group, to throw appropriate exception. - virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const = 0; + /// For subclasses, H5File and Group, to throw appropriate exception. + virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const = 0; - // Default constructor. - CommonFG(); + // Default constructor. + CommonFG(); - // Noop destructor. - virtual ~CommonFG(); + // Noop destructor. + virtual ~CommonFG(); protected: - virtual void p_setId(const hid_t new_id) = 0; + virtual void p_setId(const hid_t new_id) = 0; #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 037527f..babda34 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -33,203 +33,203 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: CompType default constructor -///\brief Default constructor: Creates a stub compound datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType default constructor +///\brief Default constructor: Creates a stub compound datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType::CompType() : DataType() {} //-------------------------------------------------------------------------- -// Function: CompType copy constructor -///\brief Copy constructor: makes copy of the original CompType object -///\param original - IN: Original CompType instance -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType copy constructor +///\brief Copy constructor: makes copy of the original CompType object +///\param original - IN: Original CompType instance +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType::CompType(const CompType& original) : DataType(original) {} +CompType::CompType( const CompType& original ) : DataType( original ) {} //-------------------------------------------------------------------------- -// Function: CompType overloaded constructor -///\brief Creates a CompType object using the id of an existing datatype. -///\param existing_id - IN: Id of an existing compound datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType overloaded constructor +///\brief Creates a CompType object using the id of an existing datatype. +///\param existing_id - IN: Id of an existing compound datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType::CompType(const hid_t existing_id) : DataType(existing_id) {} +CompType::CompType( const hid_t existing_id ) : DataType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: CompType overloaded constructor -///\brief Creates an empty compound datatype given a size, in bytes. -///\param size - IN: Number of bytes in the datatype to create -///\exception H5::DataTypeIException +// Function: CompType overloaded constructor +///\brief Creates an empty compound datatype given a size, in bytes. +///\param size - IN: Number of bytes in the datatype to create +///\exception H5::DataTypeIException // Description -// The DataType constructor calls the C API H5Tcreate to create -// the compound datatype. -// Programmer Binh-Minh Ribler - 2000 +// The DataType constructor calls the C API H5Tcreate to create +// the compound datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType::CompType(size_t size) : DataType(H5T_COMPOUND, size) {} +CompType::CompType( size_t size ) : DataType( H5T_COMPOUND, size ) {} //-------------------------------------------------------------------------- -// Function: CompType overloaded constructor -///\brief Gets the compound datatype of the specified dataset. -///\param dataset - IN: Dataset that this enum datatype associates with -///\return CompType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType overloaded constructor +///\brief Gets the compound datatype of the specified dataset. +///\param dataset - IN: Dataset that this enum datatype associates with +///\return CompType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType::CompType(const DataSet& dataset) : DataType() +CompType::CompType( const DataSet& dataset ) : DataType() { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type(dataset.getId()); - - // If the datatype id is invalid, throw exception - if (id < 0) - { - throw DataSetIException("CompType constructor", "H5Dget_type failed"); - } + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type( dataset.getId() ); + + // If the datatype id is invalid, throw exception + if( id < 0 ) + { + throw DataSetIException("CompType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: CompType overloaded constructor -///\brief Creates an CompType instance by opening an HDF5 compound -/// given its name, provided as a C character string. -///\param dtype_name - IN: Compound type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: CompType overloaded constructor +///\brief Creates an CompType instance by opening an HDF5 compound +/// given its name, provided as a C character string. +///\param dtype_name - IN: Compound type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openCompType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openCompType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- CompType::CompType(const H5Location& loc, const char *dtype_name) : DataType() { - id = p_opentype(loc, dtype_name); + id = p_opentype(loc, dtype_name); } //-------------------------------------------------------------------------- -// Function: CompType overloaded constructor -///\brief Creates an CompType instance by opening an HDF5 compound -/// datatype given its name, provided as an \c H5std_string. -///\param dtype_name - IN: Compound type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: CompType overloaded constructor +///\brief Creates an CompType instance by opening an HDF5 compound +/// datatype given its name, provided as an \c H5std_string. +///\param dtype_name - IN: Compound type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openCompType(const H5Location&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openCompType(const H5Location&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- CompType::CompType(const H5Location& loc, const H5std_string& dtype_name) : DataType() { - id = p_opentype(loc, dtype_name.c_str()); + id = p_opentype(loc, dtype_name.c_str()); } //-------------------------------------------------------------------------- -// Function: CompType::getNmembers -///\brief Returns the number of members in this compound datatype. -///\return Number of members -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getNmembers +///\brief Returns the number of members in this compound datatype. +///\return Number of members +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int CompType::getNmembers() const { - int num_members = H5Tget_nmembers(id); - if (num_members < 0) - { - throw DataTypeIException("CompType::getNmembers", - "H5Tget_nmembers returns negative number of members"); - } - return(num_members); + int num_members = H5Tget_nmembers( id ); + if( num_members < 0 ) + { + throw DataTypeIException("CompType::getNmembers", + "H5Tget_nmembers returns negative number of members"); + } + return( num_members ); } //-------------------------------------------------------------------------- -// Function: CompType::getMemberName -///\brief Returns the name of a member in this compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return Name of member -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberName +///\brief Returns the name of a member in this compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return Name of member +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string CompType::getMemberName(unsigned member_num) const +H5std_string CompType::getMemberName( unsigned member_num ) const { - char* member_name_C = H5Tget_member_name(id, member_num); - if (member_name_C == NULL) // NULL means failure + char* member_name_C = H5Tget_member_name( id, member_num ); + if( member_name_C == NULL ) // NULL means failure { - throw DataTypeIException("CompType::getMemberName", - "H5Tget_member_name returns NULL for member name"); + throw DataTypeIException("CompType::getMemberName", + "H5Tget_member_name returns NULL for member name"); } H5std_string member_name = H5std_string(member_name_C); // convert C string to string H5free_memory(member_name_C); // free the C string - return(member_name); // return the member name string + return( member_name ); // return the member name string } //-------------------------------------------------------------------------- -// Function: CompType::getMemberIndex -///\brief Returns the index of a member in this compound datatype. -///\param name - IN: Name of the member -///\return Index of member -///\exception H5::DataTypeIException +// Function: CompType::getMemberIndex +///\brief Returns the index of a member in this compound datatype. +///\param name - IN: Name of the member +///\return Index of member +///\exception H5::DataTypeIException ///\par Description -/// Members are stored in no particular order with numbers 0 -/// through N-1, where N is the value returned by the member -/// function \c CompType::getNmembers. -// Programmer Binh-Minh Ribler - May 16, 2002 +/// Members are stored in no particular order with numbers 0 +/// through N-1, where N is the value returned by the member +/// function \c CompType::getNmembers. +// Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- int CompType::getMemberIndex(const char* name) const { - int member_index = H5Tget_member_index(id, name); - if (member_index < 0) - { - throw DataTypeIException("CompType::getMemberIndex", - "H5Tget_member_index returns negative value"); - } - return(member_index); + int member_index = H5Tget_member_index(id, name); + if( member_index < 0 ) + { + throw DataTypeIException("CompType::getMemberIndex", + "H5Tget_member_index returns negative value"); + } + return( member_index ); } int CompType::getMemberIndex(const H5std_string& name) const { - return(getMemberIndex(name.c_str())); + return(getMemberIndex(name.c_str())); } //-------------------------------------------------------------------------- -// Function: CompType::getMemberOffset -///\brief Returns the byte offset of the beginning of a member with -/// respect to the beginning of the compound data type datum. -///\param member_num - IN: Zero-based index of the member -///\return Byte offset -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberOffset +///\brief Returns the byte offset of the beginning of a member with +/// respect to the beginning of the compound data type datum. +///\param member_num - IN: Zero-based index of the member +///\return Byte offset +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 // Description -/// Members are stored in no particular order with numbers 0 -/// through N-1, where N is the value returned by the member -/// function \c CompType::getNmembers. +/// Members are stored in no particular order with numbers 0 +/// through N-1, where N is the value returned by the member +/// function \c CompType::getNmembers. // -// Note that byte offset being returned as 0 doesn't indicate -// a failure. (According to Quincey) +// Note that byte offset being returned as 0 doesn't indicate +// a failure. (According to Quincey) //-------------------------------------------------------------------------- -size_t CompType::getMemberOffset(unsigned member_num) const +size_t CompType::getMemberOffset( unsigned member_num ) const { - size_t offset = H5Tget_member_offset(id, member_num); - return(offset); + size_t offset = H5Tget_member_offset( id, member_num ); + return( offset ); } //-------------------------------------------------------------------------- -// Function: CompType::getMemberClass -///\brief Gets the type class of the specified member. -///\param member_num - IN: Zero-based index of the member -///\return Type class of the member -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberClass +///\brief Gets the type class of the specified member. +///\param member_num - IN: Zero-based index of the member +///\return Type class of the member +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to use H5Tget_member_class instead. - Jul, 2005 +// Modified to use H5Tget_member_class instead. - Jul, 2005 //-------------------------------------------------------------------------- -H5T_class_t CompType::getMemberClass(unsigned member_num) const +H5T_class_t CompType::getMemberClass( unsigned member_num ) const { - H5T_class_t member_class = H5Tget_member_class(id, member_num); - if (member_class == H5T_NO_CLASS) - { - throw DataTypeIException("CompType::getMemberClass", - "H5Tget_member_class returns H5T_NO_CLASS"); - } - return(member_class); + H5T_class_t member_class = H5Tget_member_class(id, member_num); + if( member_class == H5T_NO_CLASS ) + { + throw DataTypeIException("CompType::getMemberClass", + "H5Tget_member_class returns H5T_NO_CLASS"); + } + return(member_class); } // This private member function calls the C API to get the identifier @@ -238,184 +238,184 @@ H5T_class_t CompType::getMemberClass(unsigned member_num) const // the sub-types. hid_t CompType::p_get_member_type(unsigned member_num) const { - // get the id of the specified member first - hid_t member_type_id = H5Tget_member_type(id, member_num); - if (member_type_id > 0) - return(member_type_id); - else - { - // p_get_member_type is private, caller will catch this exception - // then throw another with appropriate API name - throw DataTypeIException("", "H5Tget_member_type failed"); - } + // get the id of the specified member first + hid_t member_type_id = H5Tget_member_type( id, member_num ); + if( member_type_id > 0 ) + return( member_type_id ); + else + { + // p_get_member_type is private, caller will catch this exception + // then throw another with appropriate API name + throw DataTypeIException("", "H5Tget_member_type failed"); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberDataType -///\brief Returns the generic datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return DataType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberDataType +///\brief Returns the generic datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return DataType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType CompType::getMemberDataType(unsigned member_num) const +DataType CompType::getMemberDataType( unsigned member_num ) const { - try { - DataType datatype; - f_DataType_setId(&datatype, p_get_member_type(member_num)); - return(datatype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberDataType", E.getDetailMsg()); - } + try { + DataType datatype; + f_DataType_setId(&datatype, p_get_member_type(member_num)); + return(datatype); + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberDataType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberArrayType -///\brief Returns the array datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return ArrayType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CompType::getMemberArrayType +///\brief Returns the array datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return ArrayType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -ArrayType CompType::getMemberArrayType(unsigned member_num) const +ArrayType CompType::getMemberArrayType( unsigned member_num ) const { - try { - ArrayType arraytype(p_get_member_type(member_num)); - f_DataType_setId(&arraytype, p_get_member_type(member_num)); - return(arraytype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberArrayType", E.getDetailMsg()); - } + try { + ArrayType arraytype(p_get_member_type(member_num)); + f_DataType_setId(&arraytype, p_get_member_type(member_num)); + return(arraytype); + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberArrayType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberCompType -///\brief Returns the compound datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return CompType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberCompType +///\brief Returns the compound datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return CompType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -CompType CompType::getMemberCompType(unsigned member_num) const +CompType CompType::getMemberCompType( unsigned member_num ) const { try { CompType comptype(p_get_member_type(member_num)); - f_DataType_setId(&comptype, p_get_member_type(member_num)); + f_DataType_setId(&comptype, p_get_member_type(member_num)); return(comptype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberCompType", E.getDetailMsg()); - } + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberCompType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberEnumType -///\brief Returns the enumeration datatype of the specified member in -/// this compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return EnumType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberEnumType +///\brief Returns the enumeration datatype of the specified member in +/// this compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return EnumType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType CompType::getMemberEnumType(unsigned member_num) const +EnumType CompType::getMemberEnumType( unsigned member_num ) const { try { EnumType enumtype(p_get_member_type(member_num)); - f_DataType_setId(&enumtype, p_get_member_type(member_num)); + f_DataType_setId(&enumtype, p_get_member_type(member_num)); return(enumtype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberEnumType", E.getDetailMsg()); - } + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberEnumType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberIntType -///\brief Returns the integer datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return IntType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberIntType +///\brief Returns the integer datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return IntType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType CompType::getMemberIntType(unsigned member_num) const +IntType CompType::getMemberIntType( unsigned member_num ) const { try { IntType inttype(p_get_member_type(member_num)); - f_DataType_setId(&inttype, p_get_member_type(member_num)); + f_DataType_setId(&inttype, p_get_member_type(member_num)); return(inttype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberIntType", E.getDetailMsg()); - } + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberIntType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberFloatType -///\brief Returns the floating-point datatype of the specified member -/// in this compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return FloatType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberFloatType +///\brief Returns the floating-point datatype of the specified member +/// in this compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return FloatType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType CompType::getMemberFloatType(unsigned member_num) const +FloatType CompType::getMemberFloatType( unsigned member_num ) const { try { FloatType floatype(p_get_member_type(member_num)); - f_DataType_setId(&floatype, p_get_member_type(member_num)); + f_DataType_setId(&floatype, p_get_member_type(member_num)); return(floatype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberFloatType", E.getDetailMsg()); - } + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberFloatType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberStrType -///\brief Returns the string datatype of the specified member in this -/// compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return StrType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::getMemberStrType +///\brief Returns the string datatype of the specified member in this +/// compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return StrType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType CompType::getMemberStrType(unsigned member_num) const +StrType CompType::getMemberStrType( unsigned member_num ) const { try { StrType strtype(p_get_member_type(member_num)); - f_DataType_setId(&strtype, p_get_member_type(member_num)); + f_DataType_setId(&strtype, p_get_member_type(member_num)); return(strtype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg()); - } + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: CompType::getMemberVarLenType -///\brief Returns the variable length datatype of the specified member -/// in this compound datatype. -///\param member_num - IN: Zero-based index of the member -///\return VarLenType instance -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: CompType::getMemberVarLenType +///\brief Returns the variable length datatype of the specified member +/// in this compound datatype. +///\param member_num - IN: Zero-based index of the member +///\return VarLenType instance +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -VarLenType CompType::getMemberVarLenType(unsigned member_num) const +VarLenType CompType::getMemberVarLenType( unsigned member_num ) const { try { VarLenType varlentype(p_get_member_type(member_num)); - f_DataType_setId(&varlentype, p_get_member_type(member_num)); + f_DataType_setId(&varlentype, p_get_member_type(member_num)); return(varlentype); - } - catch (DataTypeIException& E) { - throw DataTypeIException("CompType::getMemberVarLenType", E.getDetailMsg()); - } + } + catch (DataTypeIException& E) { + throw DataTypeIException("CompType::getMemberVarLenType", E.getDetailMsg()); + } } /* old style of getMemberType - using overloads; new style above @@ -424,27 +424,27 @@ VarLenType CompType::getMemberVarLenType(unsigned member_num) const May, 2004: These should be reconsidered to provide more convenience. // Returns the datatype of the specified member in this compound datatype. // Several overloading of getMemberType are for different datatypes -void CompType::getMemberType(unsigned member_num, EnumType& enumtype) const +void CompType::getMemberType( unsigned member_num, EnumType& enumtype ) const { p_get_member_type(member_num, enumtype); } -void CompType::getMemberType(unsigned member_num, CompType& comptype) const +void CompType::getMemberType( unsigned member_num, CompType& comptype ) const { p_get_member_type(member_num, comptype); } -void CompType::getMemberType(unsigned member_num, IntType& inttype) const +void CompType::getMemberType( unsigned member_num, IntType& inttype ) const { p_get_member_type(member_num, inttype); } -void CompType::getMemberType(unsigned member_num, FloatType& floatype) const +void CompType::getMemberType( unsigned member_num, FloatType& floatype ) const { p_get_member_type(member_num, floatype); } -void CompType::getMemberType(unsigned member_num, StrType& strtype) const +void CompType::getMemberType( unsigned member_num, StrType& strtype ) const { p_get_member_type(member_num, strtype); } @@ -452,55 +452,55 @@ void CompType::getMemberType(unsigned member_num, StrType& strtype) const */ //-------------------------------------------------------------------------- -// Function: CompType::insertMember -///\brief Inserts a new member to this compound datatype. -///\param name - IN: Name of the new member -///\param offset - IN: Offset in memory structure of the field to insert -///\param new_member - IN: New member to be inserted -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: CompType::insertMember +///\brief Inserts a new member to this compound datatype. +///\param name - IN: Name of the new member +///\param offset - IN: Offset in memory structure of the field to insert +///\param new_member - IN: New member to be inserted +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void CompType::insertMember(const H5std_string& name, size_t offset, const DataType& new_member) const +void CompType::insertMember( const H5std_string& name, size_t offset, const DataType& new_member ) const { - // Convert string to C-string - const char* name_C; - name_C = name.c_str(); // name_C refers to the contents of name as a C-str - - hid_t new_member_id = new_member.getId(); // get new_member id for C API - - // Call C routine H5Tinsert to add the new member - herr_t ret_value = H5Tinsert(id, name_C, offset, new_member_id); - if (ret_value < 0) - { - throw DataTypeIException("CompType::insertMember", "H5Tinsert failed"); - } + // Convert string to C-string + const char* name_C; + name_C = name.c_str(); // name_C refers to the contents of name as a C-str + + hid_t new_member_id = new_member.getId(); // get new_member id for C API + + // Call C routine H5Tinsert to add the new member + herr_t ret_value = H5Tinsert( id, name_C, offset, new_member_id ); + if( ret_value < 0 ) + { + throw DataTypeIException("CompType::insertMember", "H5Tinsert failed"); + } } //-------------------------------------------------------------------------- -// Function: CompType::pack -///\brief Recursively removes padding from within a compound datatype. +// Function: CompType::pack +///\brief Recursively removes padding from within a compound datatype. /// -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CompType::pack() const { - // Calls C routine H5Tpack to remove padding - herr_t ret_value = H5Tpack(id); - if (ret_value < 0) - { - throw DataTypeIException("CompType::pack", "H5Tpack failed"); - } + // Calls C routine H5Tpack to remove padding + herr_t ret_value = H5Tpack( id ); + if( ret_value < 0 ) + { + throw DataTypeIException("CompType::pack", "H5Tpack failed"); + } } //-------------------------------------------------------------------------- -// Function: CompType::setSize -///\brief Sets the total size for this compound datatype. -///\param size - IN: Size to set -///\exception H5::DataTypeIException +// Function: CompType::setSize +///\brief Sets the total size for this compound datatype. +///\param size - IN: Size to set +///\exception H5::DataTypeIException // Note -// H5Tset_size works on atom datatypes and compound datatypes only -// Programmer Binh-Minh Ribler - 2014 +// H5Tset_size works on atom datatypes and compound datatypes only +// Programmer Binh-Minh Ribler - 2014 //-------------------------------------------------------------------------- void CompType::setSize(size_t size) const { @@ -508,7 +508,7 @@ void CompType::setSize(size_t size) const herr_t ret_value = H5Tset_size(id, size); if (ret_value < 0) { - throw DataTypeIException("CompType::setSize", "H5Tset_size failed"); + throw DataTypeIException("CompType::setSize", "H5Tset_size failed"); } } diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 222044d..3337df7 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -27,94 +27,94 @@ namespace H5 { */ class H5_DLLCPP CompType : public DataType { public: - // Default constructor - CompType(); + // Default constructor + CompType(); - // Creates a compound datatype using an existing id - CompType(const hid_t existing_id); + // Creates a compound datatype using an existing id + CompType( const hid_t existing_id ); - // Creates a new compound datatype, given the type's size - CompType(size_t size); // H5Tcreate + // Creates a new compound datatype, given the type's size + CompType( size_t size ); // H5Tcreate - // Gets the compound datatype of the specified dataset - CompType(const DataSet& dataset); // H5Dget_type + // Gets the compound datatype of the specified dataset + CompType( const DataSet& dataset ); // H5Dget_type - // Copy constructor - makes a copy of original object - CompType(const CompType& original); + // Copy constructor - makes a copy of original object + CompType( const CompType& original ); - // Constructors that open a compound datatype, given a location. - CompType(const H5Location& loc, const char* name); - CompType(const H5Location& loc, const H5std_string& name); + // Constructors that open a compound datatype, given a location. + CompType(const H5Location& loc, const char* name); + CompType(const H5Location& loc, const H5std_string& name); - // Returns the type class of the specified member of this compound - // datatype. It provides to the user a way of knowing what type - // to create another datatype of the same class - H5T_class_t getMemberClass(unsigned member_num) const; + // Returns the type class of the specified member of this compound + // datatype. It provides to the user a way of knowing what type + // to create another datatype of the same class + H5T_class_t getMemberClass( unsigned member_num ) const; - // Returns the index of a member in this compound data type. - int getMemberIndex(const char* name) const; - int getMemberIndex(const H5std_string& name) const; + // Returns the index of a member in this compound data type. + int getMemberIndex(const char* name) const; + int getMemberIndex(const H5std_string& name) const; - // Returns the offset of a member of this compound datatype. - size_t getMemberOffset(unsigned memb_no) const; + // Returns the offset of a member of this compound datatype. + size_t getMemberOffset( unsigned memb_no ) const; - // Returns the name of a member of this compound datatype. - H5std_string getMemberName(unsigned member_num) const; + // Returns the name of a member of this compound datatype. + H5std_string getMemberName( unsigned member_num ) const; - // Returns the generic datatype of the specified member in - // this compound datatype. - DataType getMemberDataType(unsigned member_num) const; + // Returns the generic datatype of the specified member in + // this compound datatype. + DataType getMemberDataType( unsigned member_num ) const; - // Returns the array datatype of the specified member in - // this compound datatype. - ArrayType getMemberArrayType(unsigned member_num) const; + // Returns the array datatype of the specified member in + // this compound datatype. + ArrayType getMemberArrayType( unsigned member_num ) const; - // Returns the compound datatype of the specified member in - // this compound datatype. - CompType getMemberCompType(unsigned member_num) const; + // Returns the compound datatype of the specified member in + // this compound datatype. + CompType getMemberCompType( unsigned member_num ) const; - // Returns the enumeration datatype of the specified member in - // this compound datatype. - EnumType getMemberEnumType(unsigned member_num) const; + // Returns the enumeration datatype of the specified member in + // this compound datatype. + EnumType getMemberEnumType( unsigned member_num ) const; - // Returns the integer datatype of the specified member in - // this compound datatype. - IntType getMemberIntType(unsigned member_num) const; + // Returns the integer datatype of the specified member in + // this compound datatype. + IntType getMemberIntType( unsigned member_num ) const; - // Returns the floating-point datatype of the specified member in - // this compound datatype. - FloatType getMemberFloatType(unsigned member_num) const; + // Returns the floating-point datatype of the specified member in + // this compound datatype. + FloatType getMemberFloatType( unsigned member_num ) const; - // Returns the string datatype of the specified member in - // this compound datatype. - StrType getMemberStrType(unsigned member_num) const; + // Returns the string datatype of the specified member in + // this compound datatype. + StrType getMemberStrType( unsigned member_num ) const; - // Returns the variable length datatype of the specified member in - // this compound datatype. - VarLenType getMemberVarLenType(unsigned member_num) const; + // Returns the variable length datatype of the specified member in + // this compound datatype. + VarLenType getMemberVarLenType( unsigned member_num ) const; - // Returns the number of members in this compound datatype. - int getNmembers() const; + // Returns the number of members in this compound datatype. + int getNmembers() const; - // Adds a new member to this compound datatype. - void insertMember(const H5std_string& name, size_t offset, const DataType& new_member) const; + // Adds a new member to this compound datatype. + void insertMember( const H5std_string& name, size_t offset, const DataType& new_member ) const; - // Recursively removes padding from within this compound datatype. - void pack() const; + // Recursively removes padding from within this compound datatype. + void pack() const; - // Sets the total size for this compound datatype. - void setSize(size_t size) const; + // Sets the total size for this compound datatype. + void setSize(size_t size) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("CompType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("CompType"); } - // Noop destructor. - virtual ~CompType(); + // Noop destructor. + virtual ~CompType(); private: - // Contains common code that is used by the member functions - // getMemberXxxType - hid_t p_get_member_type(unsigned member_num) const; + // Contains common code that is used by the member functions + // getMemberXxxType + hid_t p_get_member_type(unsigned member_num) const; }; } #endif // __H5CompType_H diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index afc6ebf..2420586 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -67,34 +67,34 @@ *
*/ -/// This example shows how to create datasets. +/// This example shows how to create datasets. ///\par ///\example create.cpp ///\par -/// This example shows how to write datasets. +/// This example shows how to write datasets. ///\example writedata.cpp ///\par -/// This example shows how to read datasets. +/// This example shows how to read datasets. ///\example readdata.cpp ///\par -/// This example shows how to create a compound datatype, -/// write an array which has the compound datatype to the file, -/// and read back fields' subsets. +/// This example shows how to create a compound datatype, +/// write an array which has the compound datatype to the file, +/// and read back fields' subsets. ///\example compound.cpp ///\par -/// This example shows how to work with extendible datasets. +/// This example shows how to work with extendible datasets. ///\example extend_ds.cpp ///\par -/// This example shows how to read data from a chunked dataset. +/// This example shows how to read data from a chunked dataset. ///\example chunks.cpp ///\par -/// This example shows how to work with groups. +/// This example shows how to work with groups. ///\example h5group.cpp #endif // __H5CppDoc_H diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index a0db328..7c5b994 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -20,7 +20,7 @@ #endif #include -#include "H5private.h" // for HDfree +#include "H5private.h" // for HDfree #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -44,23 +44,23 @@ using std::cerr; using std::endl; //-------------------------------------------------------------------------- -// Function: DataSet default constructor -///\brief Default constructor: creates a stub DataSet. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet default constructor +///\brief Default constructor: creates a stub DataSet. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet::DataSet() : H5Object(), AbstractDs(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: DataSet overloaded constructor -///\brief Creates an DataSet object using the id of an existing dataset. -///\param existing_id - IN: Id of an existing dataset -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet overloaded constructor +///\brief Creates an DataSet object using the id of an existing dataset. +///\param existing_id - IN: Id of an existing dataset +// Programmer Binh-Minh Ribler - 2000 // Description -// incRefCount() is needed here to prevent the id from being closed -// prematurely. That is, when application uses the id of an -// existing DataSet object to create another DataSet object. So, -// when one of those objects is deleted, the id will be closed if -// the reference counter is only 1. +// incRefCount() is needed here to prevent the id from being closed +// prematurely. That is, when application uses the id of an +// existing DataSet object to create another DataSet object. So, +// when one of those objects is deleted, the id will be closed if +// the reference counter is only 1. //-------------------------------------------------------------------------- DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs(), id(existing_id) { @@ -68,10 +68,10 @@ DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs(), id(existin } //-------------------------------------------------------------------------- -// Function: DataSet copy constructor -///\brief Copy constructor: makes a copy of the original DataSet object. -///\param original - IN: DataSet instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet copy constructor +///\brief Copy constructor: makes a copy of the original DataSet object. +///\param original - IN: DataSet instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet::DataSet(const DataSet& original) : H5Object(), AbstractDs(), id(original.id) { @@ -79,22 +79,22 @@ DataSet::DataSet(const DataSet& original) : H5Object(), AbstractDs(), id(origina } //-------------------------------------------------------------------------- -// Function: DataSet overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 location, creates a -/// DataSet object -///\param loc - IN: Dataset reference object is in or location of -/// object that the dataset is located within. -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::DataSetIException +// Function: DataSet overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 location, creates a +/// DataSet object +///\param loc - IN: Dataset reference object is in or location of +/// object that the dataset is located within. +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::DataSetIException ///\par Description -/// \c loc can be DataSet, Group, H5File, or named DataType, that -/// is a datatype that has been named by DataType::commit. -// Programmer Binh-Minh Ribler - Oct, 2006 +/// \c loc can be DataSet, Group, H5File, or named DataType, that +/// is a datatype that has been named by DataType::commit. +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// Jul, 2008 -// Added for application convenience. +// Jul, 2008 +// Added for application convenience. //-------------------------------------------------------------------------- DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), AbstractDs(), id(H5I_INVALID_HID) { @@ -102,18 +102,18 @@ DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, co } //-------------------------------------------------------------------------- -// Function: DataSet overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 attribute, creates a -/// DataSet object -///\param attr - IN: Specifying location where the referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// Function: DataSet overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 attribute, creates a +/// DataSet object +///\param attr - IN: Specifying location where the referenced object is in +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// Jul, 2008 -// Added for application convenience. +// Jul, 2008 +// Added for application convenience. //-------------------------------------------------------------------------- DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), AbstractDs(), id(H5I_INVALID_HID) { @@ -121,26 +121,26 @@ DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, co } //-------------------------------------------------------------------------- -// Function: DataSet::getSpace -///\brief Gets a copy of the dataspace of this dataset. -///\return DataSpace instance -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getSpace +///\brief Gets a copy of the dataspace of this dataset. +///\return DataSpace instance +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace DataSet::getSpace() const { - // Calls C function H5Dget_space to get the id of the dataspace - hid_t dataspace_id = H5Dget_space(id); - - // If the dataspace id is invalid, throw an exception - if (dataspace_id < 0) - { - throw DataSetIException("DataSet::getSpace", "H5Dget_space failed"); - } - //create dataspace object using the existing id then return the object - DataSpace data_space; - f_DataSpace_setId(&data_space, dataspace_id); - return(data_space); + // Calls C function H5Dget_space to get the id of the dataspace + hid_t dataspace_id = H5Dget_space( id ); + + // If the dataspace id is invalid, throw an exception + if( dataspace_id < 0 ) + { + throw DataSetIException("DataSet::getSpace", "H5Dget_space failed"); + } + //create dataspace object using the existing id then return the object + DataSpace data_space; + f_DataSpace_setId(&data_space, dataspace_id); + return( data_space ); } // This private member function calls the C API to get the identifier @@ -148,57 +148,57 @@ DataSpace DataSet::getSpace() const // by the various AbstractDs functions to get the specific datatype. hid_t DataSet::p_get_type() const { - hid_t type_id = H5Dget_type(id); - if (type_id > 0) - return(type_id); - else - { - throw DataSetIException("", "H5Dget_type failed"); - } + hid_t type_id = H5Dget_type( id ); + if( type_id > 0 ) + return( type_id ); + else + { + throw DataSetIException("", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::getCreatePlist -///\brief Gets the dataset creation property list. -///\return DSetCreatPropList instance -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getCreatePlist +///\brief Gets the dataset creation property list. +///\return DSetCreatPropList instance +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList DataSet::getCreatePlist() const { - hid_t create_plist_id = H5Dget_create_plist(id); - if (create_plist_id < 0) - { - throw DataSetIException("DataSet::getCreatePlist", "H5Dget_create_plist failed"); - } - - // create and return the DSetCreatPropList object - DSetCreatPropList create_plist; - f_PropList_setId(&create_plist, create_plist_id); - return(create_plist); + hid_t create_plist_id = H5Dget_create_plist( id ); + if( create_plist_id < 0 ) + { + throw DataSetIException("DataSet::getCreatePlist", "H5Dget_create_plist failed"); + } + + // create and return the DSetCreatPropList object + DSetCreatPropList create_plist; + f_PropList_setId(&create_plist, create_plist_id); + return(create_plist); } //-------------------------------------------------------------------------- -// Function: DataSet::getStorageSize -///\brief Returns the amount of storage required for a dataset. -///\return Size of the storage or 0, for no data -///\exception H5::DataSetIException -// Note: H5Dget_storage_size returns 0 when there is no data. This -// function should have no failure. (from SLU) -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: DataSet::getStorageSize +///\brief Returns the amount of storage required for a dataset. +///\return Size of the storage or 0, for no data +///\exception H5::DataSetIException +// Note: H5Dget_storage_size returns 0 when there is no data. This +// function should have no failure. (from SLU) +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- hsize_t DataSet::getStorageSize() const { - hsize_t storage_size = H5Dget_storage_size(id); - return(storage_size); + hsize_t storage_size = H5Dget_storage_size(id); + return(storage_size); } //-------------------------------------------------------------------------- -// Function: DataSet::getInMemDataSize -///\brief Gets the size in memory of the dataset's data. -///\return Size of data (in memory) -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - Apr 2009 +// Function: DataSet::getInMemDataSize +///\brief Gets the size in memory of the dataset's data. +///\return Size of data (in memory) +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - Apr 2009 //-------------------------------------------------------------------------- size_t DataSet::getInMemDataSize() const { @@ -206,9 +206,9 @@ size_t DataSet::getInMemDataSize() const // Get the data type of this dataset hid_t mem_type_id = H5Dget_type(id); - if (mem_type_id < 0) + if( mem_type_id < 0 ) { - throw DataSetIException(func, "H5Dget_type failed"); + throw DataSetIException(func, "H5Dget_type failed"); } // Get the data type's size by first getting its native type then getting @@ -216,22 +216,22 @@ size_t DataSet::getInMemDataSize() const hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT); if (native_type < 0) { - throw DataSetIException(func, "H5Tget_native_type failed"); + throw DataSetIException(func, "H5Tget_native_type failed"); } size_t type_size = H5Tget_size(native_type); if (type_size == 0) { - throw DataSetIException(func, "H5Tget_size failed"); + throw DataSetIException(func, "H5Tget_size failed"); } // Close the native type and the datatype of this dataset. if (H5Tclose(native_type) < 0) { - throw DataSetIException(func, "H5Tclose(native_type) failed"); + throw DataSetIException(func, "H5Tclose(native_type) failed"); } if (H5Tclose(mem_type_id) < 0) { - throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); + throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); } // Get number of elements of the dataset by first getting its dataspace, @@ -239,18 +239,18 @@ size_t DataSet::getInMemDataSize() const hid_t space_id = H5Dget_space(id); if (space_id < 0) { - throw DataSetIException(func, "H5Dget_space failed"); + throw DataSetIException(func, "H5Dget_space failed"); } hssize_t num_elements = H5Sget_simple_extent_npoints(space_id); if (num_elements < 0) { - throw DataSetIException(func, "H5Sget_simple_extent_npoints failed"); + throw DataSetIException(func, "H5Sget_simple_extent_npoints failed"); } // Close the dataspace if (H5Sclose(space_id) < 0) { - throw DataSetIException(func, "H5Sclose failed"); + throw DataSetIException(func, "H5Sclose failed"); } // Calculate and return the size of the data @@ -259,184 +259,184 @@ size_t DataSet::getInMemDataSize() const } //-------------------------------------------------------------------------- -// Function: DataSet::getOffset -///\brief Returns the address of this dataset in the file. -///\return Address of dataset -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getOffset +///\brief Returns the address of this dataset in the file. +///\return Address of dataset +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- haddr_t DataSet::getOffset() const { - haddr_t ds_addr; // for address of dataset - - ds_addr = H5Dget_offset(id); - if (ds_addr == HADDR_UNDEF) - { - throw DataSetIException("DataSet::getOffset", "H5Dget_offset returned HADDR_UNDEF"); - } - return(ds_addr); + haddr_t ds_addr; // for address of dataset + + ds_addr = H5Dget_offset(id); + if( ds_addr == HADDR_UNDEF ) + { + throw DataSetIException("DataSet::getOffset", "H5Dget_offset returned HADDR_UNDEF"); + } + return(ds_addr); } //-------------------------------------------------------------------------- -// Function: DataSet::getSpaceStatus -///\brief Determines whether space has been allocated for a dataset. -///\param status - OUT: Space allocation status -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getSpaceStatus +///\brief Determines whether space has been allocated for a dataset. +///\param status - OUT: Space allocation status +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::getSpaceStatus(H5D_space_status_t& status) const { - herr_t ret_value = H5Dget_space_status(id, &status); - if (ret_value < 0) - { - throw DataSetIException("DataSet::getSpaceStatus", "H5Dget_space_status failed"); - } + herr_t ret_value = H5Dget_space_status(id, &status); + if( ret_value < 0 ) + { + throw DataSetIException("DataSet::getSpaceStatus", "H5Dget_space_status failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::getVlenBufSize -///\brief Returns the number of bytes required to store VL data. -///\param type - IN: Datatype, which is the datatype for the buffer -///\param space - IN: Selection for the memory buffer -///\return Amount of storage -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getVlenBufSize +///\brief Returns the number of bytes required to store VL data. +///\param type - IN: Datatype, which is the datatype for the buffer +///\param space - IN: Selection for the memory buffer +///\return Amount of storage +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space) const +hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space ) const { - // Obtain identifiers for C API - hid_t type_id = type.getId(); - hid_t space_id = space.getId(); - - hsize_t size; // for amount of storage - - herr_t ret_value = H5Dvlen_get_buf_size(id, type_id, space_id, &size); - if (ret_value < 0) - { - throw DataSetIException("DataSet::getVlenBufSize", "H5Dvlen_get_buf_size failed"); - } - return(size); + // Obtain identifiers for C API + hid_t type_id = type.getId(); + hid_t space_id = space.getId(); + + hsize_t size; // for amount of storage + + herr_t ret_value = H5Dvlen_get_buf_size( id, type_id, space_id, &size ); + if( ret_value < 0 ) + { + throw DataSetIException("DataSet::getVlenBufSize", "H5Dvlen_get_buf_size failed"); + } + return( size ); } //-------------------------------------------------------------------------- -// Function: DataSet::getVlenBufSize -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Return Amount of storage -// Exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::getVlenBufSize +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Return Amount of storage +// Exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- -//hsize_t DataSet::getVlenBufSize(DataType& type, DataSpace& space) const +//hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const //{ // return(getVlenBufSize(type, space)); //} //-------------------------------------------------------------------------- -// Function: DataSet::vlenReclaim -///\brief Reclaims VL datatype memory buffers. -///\param type - IN: Datatype, which is the datatype stored in the buffer -///\param space - IN: Selection for the memory buffer to free the -/// VL datatypes within -///\param xfer_plist - IN: Property list used to create the buffer -///\param buf - IN: Pointer to the buffer to be reclaimed -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::vlenReclaim +///\brief Reclaims VL datatype memory buffers. +///\param type - IN: Datatype, which is the datatype stored in the buffer +///\param space - IN: Selection for the memory buffer to free the +/// VL datatypes within +///\param xfer_plist - IN: Property list used to create the buffer +///\param buf - IN: Pointer to the buffer to be reclaimed +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf) +void DataSet::vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf ) { - // Obtain identifiers for C API - hid_t type_id = type.getId(); - hid_t space_id = space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); - - herr_t ret_value = H5Dvlen_reclaim(type_id, space_id, xfer_plist_id, buf); - if (ret_value < 0) - { - throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed"); - } + // Obtain identifiers for C API + hid_t type_id = type.getId(); + hid_t space_id = space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); + + herr_t ret_value = H5Dvlen_reclaim( type_id, space_id, xfer_plist_id, buf ); + if( ret_value < 0 ) + { + throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::vlenReclaim -///\brief Reclaims VL datatype memory buffers. -///\param type - IN: Datatype, which is the datatype stored in the buffer -///\param space - IN: Selection for the memory buffer to free the -/// VL datatypes within -///\param xfer_plist - IN: Property list used to create the buffer -///\param buf - IN: Pointer to the buffer to be reclaimed -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::vlenReclaim +///\brief Reclaims VL datatype memory buffers. +///\param type - IN: Datatype, which is the datatype stored in the buffer +///\param space - IN: Selection for the memory buffer to free the +/// VL datatypes within +///\param xfer_plist - IN: Property list used to create the buffer +///\param buf - IN: Pointer to the buffer to be reclaimed +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //\parDescription -// This function has better prototype for the users than the -// other, which might be removed at some point. BMR - 2006/12/20 +// This function has better prototype for the users than the +// other, which might be removed at some point. BMR - 2006/12/20 //-------------------------------------------------------------------------- void DataSet::vlenReclaim(void* buf, const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist) { - // Obtain identifiers for C API - hid_t type_id = type.getId(); - hid_t space_id = space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); - - herr_t ret_value = H5Dvlen_reclaim(type_id, space_id, xfer_plist_id, buf); - if (ret_value < 0) - { - throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed"); - } + // Obtain identifiers for C API + hid_t type_id = type.getId(); + hid_t space_id = space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); + + herr_t ret_value = H5Dvlen_reclaim(type_id, space_id, xfer_plist_id, buf); + if (ret_value < 0) + { + throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::read -///\brief Reads raw data from the specified dataset. -///\param buf - IN: Buffer for read data -///\param mem_type - IN: Memory datatype -///\param mem_space - IN: Memory dataspace -///\param file_space - IN: Dataset's dataspace in the file -///\param xfer_plist - IN: Transfer property list for this I/O operation -///\exception H5::DataSetIException +// Function: DataSet::read +///\brief Reads raw data from the specified dataset. +///\param buf - IN: Buffer for read data +///\param mem_type - IN: Memory datatype +///\param mem_space - IN: Memory dataspace +///\param file_space - IN: Dataset's dataspace in the file +///\param xfer_plist - IN: Transfer property list for this I/O operation +///\exception H5::DataSetIException ///\par Description -/// This function reads raw data from this dataset into the -/// buffer \a buf, converting from file datatype and dataspace -/// to memory datatype \a mem_type and dataspace \a mem_space. -// Programmer Binh-Minh Ribler - 2000 +/// This function reads raw data from this dataset into the +/// buffer \a buf, converting from file datatype and dataspace +/// to memory datatype \a mem_type and dataspace \a mem_space. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::read(void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const +void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const { - // Obtain identifiers for C API - hid_t mem_type_id = mem_type.getId(); - hid_t mem_space_id = mem_space.getId(); - hid_t file_space_id = file_space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); - - herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf); - if (ret_value < 0) - { - throw DataSetIException("DataSet::read", "H5Dread failed"); - } + // Obtain identifiers for C API + hid_t mem_type_id = mem_type.getId(); + hid_t mem_space_id = mem_space.getId(); + hid_t file_space_id = file_space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); + + herr_t ret_value = H5Dread( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf ); + if( ret_value < 0 ) + { + throw DataSetIException("DataSet::read", "H5Dread failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::read -///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c H5std_string for the buffer. -///\param strg - IN: Buffer for read data string -///\param mem_type - IN: Memory datatype -///\param mem_space - IN: Memory dataspace -///\param file_space - IN: Dataset's dataspace in the file -///\param xfer_plist - IN: Transfer property list for this I/O operation -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::read +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the buffer. +///\param strg - IN: Buffer for read data string +///\param mem_type - IN: Memory datatype +///\param mem_space - IN: Memory dataspace +///\param file_space - IN: Dataset's dataspace in the file +///\param xfer_plist - IN: Transfer property list for this I/O operation +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Jul 2009 -// Follow the change to Attribute::read and use the following -// private functions to read datasets with fixed- and -// variable-length string: -// DataSet::p_read_fixed_len and -// DataSet::p_read_variable_len +// Jul 2009 +// Follow the change to Attribute::read and use the following +// private functions to read datasets with fixed- and +// variable-length string: +// DataSet::p_read_fixed_len and +// DataSet::p_read_variable_len //-------------------------------------------------------------------------- void DataSet::read(H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const { @@ -465,47 +465,47 @@ void DataSet::read(H5std_string& strg, const DataType& mem_type, const DataSpace } //-------------------------------------------------------------------------- -// Function: DataSet::write -///\brief Writes raw data from an application buffer to a dataset. -///\param buf - IN: Buffer containing data to be written -///\param mem_type - IN: Memory datatype -///\param mem_space - IN: Memory dataspace -///\param file_space - IN: Dataset's dataspace in the file -///\param xfer_plist - IN: Transfer property list for this I/O operation -///\exception H5::DataSetIException +// Function: DataSet::write +///\brief Writes raw data from an application buffer to a dataset. +///\param buf - IN: Buffer containing data to be written +///\param mem_type - IN: Memory datatype +///\param mem_space - IN: Memory dataspace +///\param file_space - IN: Dataset's dataspace in the file +///\param xfer_plist - IN: Transfer property list for this I/O operation +///\exception H5::DataSetIException ///\par Description -/// This function writes raw data from an application buffer -/// \a buf to a dataset, converting from memory datatype -/// \a mem_type and dataspace \a mem_space to file datatype -/// and dataspace. -// Programmer Binh-Minh Ribler - 2000 +/// This function writes raw data from an application buffer +/// \a buf to a dataset, converting from memory datatype +/// \a mem_type and dataspace \a mem_space to file datatype +/// and dataspace. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::write(const void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const +void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const { - // Obtain identifiers for C API - hid_t mem_type_id = mem_type.getId(); - hid_t mem_space_id = mem_space.getId(); - hid_t file_space_id = file_space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); - - herr_t ret_value = H5Dwrite(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf); - if (ret_value < 0) - { - throw DataSetIException("DataSet::write", "H5Dwrite failed"); - } + // Obtain identifiers for C API + hid_t mem_type_id = mem_type.getId(); + hid_t mem_space_id = mem_space.getId(); + hid_t file_space_id = file_space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); + + herr_t ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf ); + if( ret_value < 0 ) + { + throw DataSetIException("DataSet::write", "H5Dwrite failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::write -///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c H5std_string for the buffer. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::write +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the buffer. +// Programmer Binh-Minh Ribler - 2000 // Modification -// Jul 2009 -// Modified to pass the buffer into H5Dwrite properly depending -// whether the dataset has variable- or fixed-length string. +// Jul 2009 +// Modified to pass the buffer into H5Dwrite properly depending +// whether the dataset has variable- or fixed-length string. //-------------------------------------------------------------------------- -void DataSet::write(const H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const +void DataSet::write( const H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const { // Check if this attribute has variable-len string or fixed-len string and // proceed appropriately. @@ -515,11 +515,11 @@ void DataSet::write(const H5std_string& strg, const DataType& mem_type, const Da throw DataSetIException("DataSet::write", "H5Tis_variable_str failed"); } - // Obtain identifiers for C API - hid_t mem_type_id = mem_type.getId(); - hid_t mem_space_id = mem_space.getId(); - hid_t file_space_id = file_space.getId(); - hid_t xfer_plist_id = xfer_plist.getId(); + // Obtain identifiers for C API + hid_t mem_type_id = mem_type.getId(); + hid_t mem_space_id = mem_space.getId(); + hid_t file_space_id = file_space.getId(); + hid_t xfer_plist_id = xfer_plist.getId(); // Convert string to C-string const char* strg_C; @@ -529,12 +529,12 @@ void DataSet::write(const H5std_string& strg, const DataType& mem_type, const Da // Pass string in differently depends on variable or fixed length if (!is_variable_len) { - ret_value = H5Dwrite(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C); + ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C ); } else { // passing string argument by address - ret_value = H5Dwrite(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C); + ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C ); } if (ret_value < 0) { @@ -543,65 +543,65 @@ void DataSet::write(const H5std_string& strg, const DataType& mem_type, const Da } //-------------------------------------------------------------------------- -// Function: DataSet::iterateElems -///\brief Iterates over all selected elements in a dataspace. -///\param buf - IN/OUT: Pointer to the buffer in memory containing the -/// elements to iterate over -///\param type - IN: Datatype for the elements stored in \a buf -///\param space - IN: Dataspace for \a buf. Also contains the selection -/// to iterate over. -///\param op - IN: Function pointer to the routine to be called for -/// each element in \a buf iterated over -///\param op_data - IN/OUT: Pointer to any user-defined data associated -/// with the operation -///\exception H5::DataSetIException -///\note This function may not work correctly yet - it's still -/// under development. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -int DataSet::iterateElems(void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data) +// Function: DataSet::iterateElems +///\brief Iterates over all selected elements in a dataspace. +///\param buf - IN/OUT: Pointer to the buffer in memory containing the +/// elements to iterate over +///\param type - IN: Datatype for the elements stored in \a buf +///\param space - IN: Dataspace for \a buf. Also contains the selection +/// to iterate over. +///\param op - IN: Function pointer to the routine to be called for +/// each element in \a buf iterated over +///\param op_data - IN/OUT: Pointer to any user-defined data associated +/// with the operation +///\exception H5::DataSetIException +///\note This function may not work correctly yet - it's still +/// under development. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data ) { - // Obtain identifiers for C API - hid_t type_id = type.getId(); - hid_t space_id = space.getId(); - herr_t ret_value = H5Diterate(buf, type_id, space_id, op, op_data); - if (ret_value >= 0) - return(ret_value); - else // raise exception when H5Diterate returns a negative value - { - throw DataSetIException("DataSet::iterateElems", "H5Diterate failed"); - } + // Obtain identifiers for C API + hid_t type_id = type.getId(); + hid_t space_id = space.getId(); + herr_t ret_value = H5Diterate( buf, type_id, space_id, op, op_data ); + if( ret_value >= 0 ) + return( ret_value ); + else // raise exception when H5Diterate returns a negative value + { + throw DataSetIException("DataSet::iterateElems", "H5Diterate failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSet::extend -///\brief Extends a dataset with unlimited dimension. -///\param size - IN: Array containing the new magnitude of each dimension -///\exception H5::DataSetIException +// Function: DataSet::extend +///\brief Extends a dataset with unlimited dimension. +///\param size - IN: Array containing the new magnitude of each dimension +///\exception H5::DataSetIException ///\par Description -/// For more information, please see the Description section in -/// C layer Reference Manual at: +/// For more information, please see the Description section in +/// C layer Reference Manual at: ///\par /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Extend -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::extend(const hsize_t* size) const +void DataSet::extend( const hsize_t* size ) const { - herr_t ret_value = H5Dset_extent(id, size); - if (ret_value < 0) // raise exception when H5Dset_extent returns a neg value - throw DataSetIException("DataSet::extend", "H5Dset_extent failed"); + herr_t ret_value = H5Dset_extent( id, size ); + if( ret_value < 0 ) // raise exception when H5Dset_extent returns a neg value + throw DataSetIException("DataSet::extend", "H5Dset_extent failed"); } //-------------------------------------------------------------------------- -// Function: DataSet::fillMemBuf -///\brief Fills a selection in memory with a value. -///\param fill - IN: Pointer to fill value to use - default NULL -///\param fill_type - IN: Datatype of the fill value -///\param buf - IN/OUT: Memory buffer to fill selection within -///\param buf_type - IN: Datatype of the elements in buffer -///\param space - IN: Dataspace describing memory buffer & containing selection to use -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2014 +// Function: DataSet::fillMemBuf +///\brief Fills a selection in memory with a value. +///\param fill - IN: Pointer to fill value to use - default NULL +///\param fill_type - IN: Datatype of the fill value +///\param buf - IN/OUT: Memory buffer to fill selection within +///\param buf_type - IN: Datatype of the elements in buffer +///\param space - IN: Dataspace describing memory buffer & containing selection to use +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2014 // Modification //-------------------------------------------------------------------------- void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const @@ -610,28 +610,28 @@ void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, hid_t buf_type_id = buf_type.getId(); hid_t space_id = space.getId(); herr_t ret_value = H5Dfill(fill, fill_type_id, buf, buf_type_id, space_id); - if (ret_value < 0) + if( ret_value < 0 ) { - throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); + throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); } } //-------------------------------------------------------------------------- -// Function: DataSet::fillMemBuf -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Param fill - IN: Pointer to fill value to use - default NULL -// Param fill_type - IN: Datatype of the fill value -// Param buf - IN/OUT: Memory buffer to fill selection within -// Param buf_type - IN: Datatype of the elements in buffer -// Param space - IN: Dataspace describing memory buffer & containing selection to use -// Exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::fillMemBuf +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Param fill - IN: Pointer to fill value to use - default NULL +// Param fill_type - IN: Datatype of the fill value +// Param buf - IN/OUT: Memory buffer to fill selection within +// Param buf_type - IN: Datatype of the elements in buffer +// Param space - IN: Dataspace describing memory buffer & containing selection to use +// Exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void DataSet::fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space) //{ @@ -639,39 +639,39 @@ void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, //} //-------------------------------------------------------------------------- -// Function: DataSet::fillMemBuf -///\brief Fills a selection in memory with 0. -///\param buf - IN/OUT: Memory buffer to fill selection within -///\param buf_type - IN: Datatype of the elements in buffer -///\param space - IN: Dataspace describing memory buffer & containing selection to use -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet::fillMemBuf +///\brief Fills a selection in memory with 0. +///\param buf - IN/OUT: Memory buffer to fill selection within +///\param buf_type - IN: Datatype of the elements in buffer +///\param space - IN: Dataspace describing memory buffer & containing selection to use +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const { hid_t buf_type_id = buf_type.getId(); hid_t space_id = space.getId(); herr_t ret_value = H5Dfill(NULL, buf_type_id, buf, buf_type_id, space_id); - if (ret_value < 0) + if( ret_value < 0 ) { - throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); + throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed"); } } //-------------------------------------------------------------------------- // Function: DataSet::fillMemBuf -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. // Param buf - IN/OUT: Memory buffer to fill selection within // Param buf_type - IN: Datatype of the elements in buffer // Param space - IN: Dataspace describing memory buffer & containing selection to use -// Exception H5::DataSetIException +// Exception H5::DataSetIException // Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void DataSet::fillMemBuf(void *buf, DataType& buf_type, DataSpace& space) //{ @@ -680,8 +680,8 @@ void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& s //-------------------------------------------------------------------------- // Function: DataSet::getId -///\brief Get the id of this dataset. -///\return DataSet identifier +///\brief Get the id of this dataset. +///\return DataSet identifier // Description: // Class hierarchy is revised to address bugzilla 1068. Class // AbstractDs and Attribute are moved out of H5Object. In @@ -691,19 +691,19 @@ void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& s //-------------------------------------------------------------------------- hid_t DataSet::getId() const { - return(id); + return(id); } //-------------------------------------------------------------------------- -// Function: DataSet::p_read_fixed_len (private) -// brief Reads a fixed length \a H5std_string from a dataset. -// param mem_type - IN: DataSet datatype (in memory) -// param strg - IN: Buffer for read string -// exception H5::DataSetIException -// Programmer Binh-Minh Ribler - Jul, 2009 +// Function: DataSet::p_read_fixed_len (private) +// brief Reads a fixed length \a H5std_string from a dataset. +// param mem_type - IN: DataSet datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::DataSetIException +// Programmer Binh-Minh Ribler - Jul, 2009 // Modification -// Jul 2009 -// Added in follow to the change in Attribute::read +// Jul 2009 +// Added in follow to the change in Attribute::read //-------------------------------------------------------------------------- void DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const { @@ -715,33 +715,33 @@ void DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id // If there is data, allocate buffer and read it. if (data_size > 0) { - char *strg_C = new char [data_size+1]; - HDmemset(strg_C, 0, data_size+1); // clear buffer + char *strg_C = new char [data_size+1]; + HDmemset(strg_C, 0, data_size+1); // clear buffer - herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C); + herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C); - if (ret_value < 0) - { - delete []strg_C; // de-allocate for fixed-len string - throw DataSetIException("DataSet::read", "H5Dread failed for fixed length string"); - } + if( ret_value < 0 ) + { + delete []strg_C; // de-allocate for fixed-len string + throw DataSetIException("DataSet::read", "H5Dread failed for fixed length string"); + } - // Get string from the C char* and release resource allocated locally - strg = strg_C; - delete []strg_C; + // Get string from the C char* and release resource allocated locally + strg = strg_C; + delete []strg_C; } } //-------------------------------------------------------------------------- -// Function: DataSet::p_read_variable_len (private) -// brief Reads a variable length \a H5std_string from an dataset. -// param mem_type - IN: DataSet datatype (in memory) -// param strg - IN: Buffer for read string -// exception H5::DataSetIException -// Programmer Binh-Minh Ribler - Jul, 2009 +// Function: DataSet::p_read_variable_len (private) +// brief Reads a variable length \a H5std_string from an dataset. +// param mem_type - IN: DataSet datatype (in memory) +// param strg - IN: Buffer for read string +// exception H5::DataSetIException +// Programmer Binh-Minh Ribler - Jul, 2009 // Modification -// Jul 2009 -// Added in follow to the change in Attribute::read +// Jul 2009 +// Added in follow to the change in Attribute::read //-------------------------------------------------------------------------- void DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const { @@ -751,9 +751,9 @@ void DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space // Read dataset, no allocation for variable-len string; C library will herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C); - if (ret_value < 0) + if( ret_value < 0 ) { - throw DataSetIException("DataSet::read", "H5Dread failed for variable length string"); + throw DataSetIException("DataSet::read", "H5Dread failed for variable length string"); } // Get string from the C char* and release resource allocated by C API @@ -805,43 +805,43 @@ void f_PropList_setId(PropList* plist, hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataSet::close -///\brief Closes this dataset. +// Function: DataSet::close +///\brief Closes this dataset. /// -///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void DataSet::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Dclose(id); - if (ret_value < 0) - { - throw DataSetIException("DataSet::close", "H5Dclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Dclose( id ); + if( ret_value < 0 ) + { + throw DataSetIException("DataSet::close", "H5Dclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: DataSet destructor -///\brief Properly terminates access to this dataset. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSet destructor +///\brief Properly terminates access to this dataset. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- DataSet::~DataSet() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "DataSet::~DataSet - " << close_error.getDetailMsg() << endl; + cerr << "DataSet::~DataSet - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index 93f9782..ee9ef28 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -31,82 +31,82 @@ namespace H5 { class H5_DLLCPP DataSet : public H5Object, public AbstractDs { public: - // Close this dataset. - virtual void close(); + // Close this dataset. + virtual void close(); - // Extends the dataset with unlimited dimension. - void extend(const hsize_t* size) const; + // Extends the dataset with unlimited dimension. + void extend( const hsize_t* size ) const; - // Fills a selection in memory with a value - void fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const; - //void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 + // Fills a selection in memory with a value + void fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const; + //void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 - // Fills a selection in memory with zero - void fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const; - //void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 + // Fills a selection in memory with zero + void fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const; + //void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 - // Gets the creation property list of this dataset. - DSetCreatPropList getCreatePlist() const; + // Gets the creation property list of this dataset. + DSetCreatPropList getCreatePlist() const; - // Returns the address of this dataset in the file. - haddr_t getOffset() const; + // Returns the address of this dataset in the file. + haddr_t getOffset() const; - // Gets the dataspace of this dataset. - virtual DataSpace getSpace() const; + // Gets the dataspace of this dataset. + virtual DataSpace getSpace() const; - // Determines whether space has been allocated for a dataset. - void getSpaceStatus(H5D_space_status_t& status) const; + // Determines whether space has been allocated for a dataset. + void getSpaceStatus(H5D_space_status_t& status) const; - // Returns the amount of storage size required for this dataset. - virtual hsize_t getStorageSize() const; + // Returns the amount of storage size required for this dataset. + virtual hsize_t getStorageSize() const; - // Returns the in memory size of this attribute's data. - virtual size_t getInMemDataSize() const; + // Returns the in memory size of this attribute's data. + virtual size_t getInMemDataSize() const; - // Returns the number of bytes required to store VL data. - hsize_t getVlenBufSize(const DataType& type, const DataSpace& space) const; - //hsize_t getVlenBufSize(DataType& type, DataSpace& space) const; // removed from 1.8.18 and 1.10.1 + // Returns the number of bytes required to store VL data. + hsize_t getVlenBufSize(const DataType& type, const DataSpace& space ) const; + //hsize_t getVlenBufSize(DataType& type, DataSpace& space) const; // removed from 1.8.18 and 1.10.1 - // Reclaims VL datatype memory buffers. - static void vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf); - static void vlenReclaim(void *buf, const DataType& type, const DataSpace& space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT); + // Reclaims VL datatype memory buffers. + static void vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf ); + static void vlenReclaim(void *buf, const DataType& type, const DataSpace& space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT); - // Reads the data of this dataset and stores it in the provided buffer. - // The memory and file dataspaces and the transferring property list - // can be defaults. - void read(void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const; - void read(H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const; + // Reads the data of this dataset and stores it in the provided buffer. + // The memory and file dataspaces and the transferring property list + // can be defaults. + void read( void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; + void read( H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; - // Writes the buffered data to this dataset. - // The memory and file dataspaces and the transferring property list - // can be defaults. - void write(const void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const; - void write(const H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const; + // Writes the buffered data to this dataset. + // The memory and file dataspaces and the transferring property list + // can be defaults. + void write( const void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; + void write( const H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const; - // Iterates the selected elements in the specified dataspace - not implemented in C++ style yet - int iterateElems(void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data = NULL); + // Iterates the selected elements in the specified dataspace - not implemented in C++ style yet + int iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data = NULL ); - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DataSet"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DataSet"); } - // Creates a dataset by way of dereference. - DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); - DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + // Creates a dataset by way of dereference. + DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); - // Default constructor. - DataSet(); + // Default constructor. + DataSet(); - // Copy constructor. - DataSet(const DataSet& original); + // Copy constructor. + DataSet( const DataSet& original ); - // Creates a copy of an existing DataSet using its id. - DataSet(const hid_t existing_id); + // Creates a copy of an existing DataSet using its id. + DataSet(const hid_t existing_id); // Gets the dataset id. virtual hid_t getId() const; - // Destructor: properly terminates access to this dataset. - virtual ~DataSet(); + // Destructor: properly terminates access to this dataset. + virtual ~DataSet(); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -115,20 +115,20 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 dataset id + hid_t id; // HDF5 dataset id // This function contains the common code that is used by // getTypeClass and various API functions getXxxType // defined in AbstractDs for generic datatype and specific // sub-types - virtual hid_t p_get_type() const; + virtual hid_t p_get_type() const; - // Reads variable or fixed len strings from this dataset. - void p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const; - void p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const; + // Reads variable or fixed len strings from this dataset. + void p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const; + void p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const; - // Friend function to set DataSet id. For library use only. - friend void f_DataSet_setId(DataSet* dset, hid_t new_id); + // Friend function to set DataSet id. For library use only. + friend void f_DataSet_setId(DataSet* dset, hid_t new_id); }; } diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 2587a72..cb479e1 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -38,14 +38,14 @@ using std::endl; DataSpace* DataSpace::ALL_ = 0; //-------------------------------------------------------------------------- -// Function: DataSpace::getConstant -// Creates a DataSpace object representing the HDF5 constant -// H5S_ALL, pointed to by DataSpace::ALL_ -// Exception H5::DataSpaceIException +// Function: DataSpace::getConstant +// Creates a DataSpace object representing the HDF5 constant +// H5S_ALL, pointed to by DataSpace::ALL_ +// Exception H5::DataSpaceIException // Description -// If DataSpace::ALL_ already points to an allocated object, throw -// a DataSpaceIException. This scenario should not happen. -// Programmer Binh-Minh Ribler - 2015 +// If DataSpace::ALL_ already points to an allocated object, throw +// a DataSpaceIException. This scenario should not happen. +// Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- DataSpace* DataSpace::getConstant() { @@ -78,55 +78,55 @@ void DataSpace::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for default dataspace. +// Purpose Constant for default dataspace. //-------------------------------------------------------------------------- const DataSpace& DataSpace::ALL = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataSpace constructor -///\brief Creates a new dataspace given a dataspace type. -///\param type - IN: Type of the dataspace to be created, which -/// currently can be either \c H5S_SCALAR or \c H5S_SIMPLE; -/// default to \c H5S_SCALAR. -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace constructor +///\brief Creates a new dataspace given a dataspace type. +///\param type - IN: Type of the dataspace to be created, which +/// currently can be either \c H5S_SCALAR or \c H5S_SIMPLE; +/// default to \c H5S_SCALAR. +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace::DataSpace(H5S_class_t type) : IdComponent() { - id = H5Screate(type); - if (id < 0) - { - throw DataSpaceIException("DataSpace constructor", "H5Screate failed"); - } + id = H5Screate( type ); + if( id < 0 ) + { + throw DataSpaceIException("DataSpace constructor", "H5Screate failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace overloaded constructor -///\brief Creates a new simple dataspace. -///\param rank - IN: Number of dimensions of dataspace. -///\param dims - IN: An array of the size of each dimension. -///\param maxdims - IN: An array of the maximum size of each dimension. -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace overloaded constructor +///\brief Creates a new simple dataspace. +///\param rank - IN: Number of dimensions of dataspace. +///\param dims - IN: An array of the size of each dimension. +///\param maxdims - IN: An array of the maximum size of each dimension. +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSpace::DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims) : IdComponent() +DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) : IdComponent() { - id = H5Screate_simple(rank, dims, maxdims); - if (id < 0) - { - throw DataSpaceIException("DataSpace constructor", "H5Screate_simple failed"); - } + id = H5Screate_simple( rank, dims, maxdims ); + if( id < 0 ) + { + throw DataSpaceIException("DataSpace constructor", "H5Screate_simple failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace overloaded constructor -///\brief Creates a DataSpace object using the id of an existing -/// dataspace. -///\param existing_id - IN: Id of an existing dataspace -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace overloaded constructor +///\brief Creates a DataSpace object using the id of an existing +/// dataspace. +///\param existing_id - IN: Id of an existing dataspace +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace::DataSpace(const hid_t existing_id) : IdComponent(), id(existing_id) { @@ -134,10 +134,10 @@ DataSpace::DataSpace(const hid_t existing_id) : IdComponent(), id(existing_id) } //-------------------------------------------------------------------------- -// Function: DataSpace copy constructor -///\brief Copy constructor: makes a copy of the original DataSpace object. -///\param original - IN: DataSpace object to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace copy constructor +///\brief Copy constructor: makes a copy of the original DataSpace object. +///\param original - IN: DataSpace object to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace::DataSpace(const DataSpace& original) : IdComponent(), id(original.id) { @@ -145,48 +145,48 @@ DataSpace::DataSpace(const DataSpace& original) : IdComponent(), id(original.id) } //-------------------------------------------------------------------------- -// Function: DataSpace::copy -///\brief Makes a copy of an existing dataspace. -///\param like_space - IN: Dataspace to be copied -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::copy +///\brief Makes a copy of an existing dataspace. +///\param like_space - IN: Dataspace to be copied +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 -//-------------------------------------------------------------------------- -void DataSpace::copy(const DataSpace& like_space) -{ - // If this object has an hdf5 valid id, close it - if (id != H5S_ALL) { - try { - close(); - } - catch (Exception& close_error) { +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 +//-------------------------------------------------------------------------- +void DataSpace::copy( const DataSpace& like_space ) +{ + // If this object has an hdf5 valid id, close it + if( id != H5S_ALL ) { + try { + close(); + } + catch (Exception& close_error) { throw DataSpaceIException("DataSpace::copy", close_error.getDetailMsg()); - } - } // end if + } + } // end if - // call C routine to copy the dataspace - id = H5Scopy(like_space.getId()); + // call C routine to copy the dataspace + id = H5Scopy( like_space.getId() ); - if (id < 0) - throw DataSpaceIException("DataSpace::copy", "H5Scopy failed"); + if( id < 0 ) + throw DataSpaceIException("DataSpace::copy", "H5Scopy failed"); } //-------------------------------------------------------------------------- -// Function: DataSpace::operator= -///\brief Assignment operator. -///\param rhs - IN: Reference to the existing dataspace -///\return Reference to DataSpace instance -///\exception H5::DataSpaceIException +// Function: DataSpace::operator= +///\brief Assignment operator. +///\param rhs - IN: Reference to the existing dataspace +///\return Reference to DataSpace instance +///\exception H5::DataSpaceIException // Description -// Makes a copy of the type on the right hand side and stores -// the new id in the left hand side object. -// Programmer Binh-Minh Ribler - 2000 +// Makes a copy of the type on the right hand side and stores +// the new id in the left hand side object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSpace& DataSpace::operator=(const DataSpace& rhs) +DataSpace& DataSpace::operator=( const DataSpace& rhs ) { if (this != &rhs) copy(rhs); @@ -194,434 +194,435 @@ DataSpace& DataSpace::operator=(const DataSpace& rhs) } //-------------------------------------------------------------------------- -// Function: DataSpace::isSimple -///\brief Determines whether this dataspace is a simple dataspace. -///\return \c true if the dataspace is a simple dataspace, and \c false, -/// otherwise -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::isSimple +///\brief Determines whether this dataspace is a simple dataspace. +///\return \c true if the dataspace is a simple dataspace, and \c false, +/// otherwise +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DataSpace::isSimple () const { - htri_t simple = H5Sis_simple(id); - if (simple > 0) - return true; - else if (simple == 0) - return false; - else - { - throw DataSpaceIException("DataSpace::isSimple", - "H5Sis_simple returns negative value"); - } + htri_t simple = H5Sis_simple( id ); + if( simple > 0 ) + return true; + else if( simple == 0 ) + return false; + else + { + throw DataSpaceIException("DataSpace::isSimple", + "H5Sis_simple returns negative value"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::offsetSimple -///\brief Sets the offset of this simple dataspace. -///\param offset - IN: Offset to position the selection at -///\exception H5::DataSpaceIException +// Function: DataSpace::offsetSimple +///\brief Sets the offset of this simple dataspace. +///\param offset - IN: Offset to position the selection at +///\exception H5::DataSpaceIException ///\par Description -/// This function creates an offset for the selection within -/// an extent, allowing the same shaped selection to be moved -/// to different locations within a dataspace without requiring -/// it to be re-defined. -// Programmer Binh-Minh Ribler - 2000 +/// This function creates an offset for the selection within +/// an extent, allowing the same shaped selection to be moved +/// to different locations within a dataspace without requiring +/// it to be re-defined. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::offsetSimple (const hssize_t* offset) const +void DataSpace::offsetSimple ( const hssize_t* offset ) const { - herr_t ret_value = H5Soffset_simple(id, offset); - if (ret_value < 0) - { - throw DataSpaceIException("DataSpace::offsetSimple", "H5Soffset_simple failed"); - } + herr_t ret_value = H5Soffset_simple( id, offset ); + if( ret_value < 0 ) + { + throw DataSpaceIException("DataSpace::offsetSimple", "H5Soffset_simple failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::getSimpleExtentDims -///\brief Retrieves dataspace dimension size and maximum size. -///\param dims - IN: Name of the new member -///\param maxdims - IN: Pointer to the value of the new member -///\return Number of dimensions, the same value as returned by -/// \c DataSpace::getSimpleExtentNdims() -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSimpleExtentDims +///\brief Retrieves dataspace dimension size and maximum size. +///\param dims - IN: Name of the new member +///\param maxdims - IN: Pointer to the value of the new member +///\return Number of dimensions, the same value as returned by +/// \c DataSpace::getSimpleExtentNdims() +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int DataSpace::getSimpleExtentDims (hsize_t *dims, hsize_t *maxdims) const +int DataSpace::getSimpleExtentDims ( hsize_t *dims, hsize_t *maxdims ) const { - int ndims = H5Sget_simple_extent_dims(id, dims, maxdims); - if (ndims < 0) - { - throw DataSpaceIException("DataSpace::getSimpleExtentDims", - "H5Sget_simple_extent_dims returns negative number of dimensions"); - } - return(ndims); + int ndims = H5Sget_simple_extent_dims( id, dims, maxdims ); + if( ndims < 0 ) + { + throw DataSpaceIException("DataSpace::getSimpleExtentDims", + "H5Sget_simple_extent_dims returns negative number of dimensions"); + } + return( ndims ); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSimpleExtentNdims -///\brief Returns the dimensionality of a dataspace. -///\return Number of dimensions -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSimpleExtentNdims +///\brief Returns the dimensionality of a dataspace. +///\return Number of dimensions +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DataSpace::getSimpleExtentNdims () const { - int ndims = H5Sget_simple_extent_ndims(id); - if (ndims < 0) - { - throw DataSpaceIException("DataSpace::getSimpleExtentNdims", - "H5Sget_simple_extent_ndims returns negative value for dimensionality of the dataspace"); - } - return(ndims); + int ndims = H5Sget_simple_extent_ndims( id ); + if( ndims < 0 ) + { + throw DataSpaceIException("DataSpace::getSimpleExtentNdims", + "H5Sget_simple_extent_ndims returns negative value for dimensionality of the dataspace"); + } + return( ndims ); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSimpleExtentNpoints -///\brief Returns the number of elements in a dataspace. -///\return Number of elements -///\exception H5::DataSpaceIException +// Function: DataSpace::getSimpleExtentNpoints +///\brief Returns the number of elements in a dataspace. +///\return Number of elements +///\exception H5::DataSpaceIException // Modification -// 12/05/00: due to C API change -// return type hssize_t vs. hsize_t -// num_elements = -1 when failure occurs vs. 0 -// Programmer Binh-Minh Ribler - 2000 +// 12/05/00: due to C API change +// return type hssize_t vs. hsize_t +// num_elements = -1 when failure occurs vs. 0 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hssize_t DataSpace::getSimpleExtentNpoints () const { - hssize_t num_elements = H5Sget_simple_extent_npoints(id); - if (num_elements > -1) - return(num_elements); - else - { - throw DataSpaceIException("DataSpace::getSimpleExtentNpoints", - "H5Sget_simple_extent_npoints returns negative value for the number of elements in the dataspace"); - } + hssize_t num_elements = H5Sget_simple_extent_npoints( id ); + + if( num_elements > -1 ) + return( num_elements ); + else + { + throw DataSpaceIException("DataSpace::getSimpleExtentNpoints", + "H5Sget_simple_extent_npoints returns negative value for the number of elements in the dataspace"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::getSimpleExtentType -///\brief Returns the current class of a dataspace. -///\return Class of the dataspace -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSimpleExtentType +///\brief Returns the current class of a dataspace. +///\return Class of the dataspace +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5S_class_t DataSpace::getSimpleExtentType () const { - H5S_class_t class_name = H5Sget_simple_extent_type(id); - if (class_name == H5S_NO_CLASS) - { - throw DataSpaceIException("DataSpace::getSimpleExtentType", - "H5Sget_simple_extent_type returns H5S_NO_CLASS"); - } - return(class_name); + H5S_class_t class_name = H5Sget_simple_extent_type( id ); + if( class_name == H5S_NO_CLASS ) + { + throw DataSpaceIException("DataSpace::getSimpleExtentType", + "H5Sget_simple_extent_type returns H5S_NO_CLASS"); + } + return( class_name ); } //-------------------------------------------------------------------------- -// Function: DataSpace::extentCopy -///\brief Copies the extent of a dataspace. -///\param dest_space - IN: Dataspace to copy from -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::extentCopy +///\brief Copies the extent of a dataspace. +///\param dest_space - IN: Dataspace to copy from +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::extentCopy (const DataSpace& dest_space) const { - hid_t dest_space_id = dest_space.getId(); - herr_t ret_value = H5Sextent_copy(dest_space_id, id); - if (ret_value < 0) - { - throw DataSpaceIException("DataSpace::extentCopy", "H5Sextent_copy failed"); - } + hid_t dest_space_id = dest_space.getId(); + herr_t ret_value = H5Sextent_copy( dest_space_id, id ); + if( ret_value < 0 ) + { + throw DataSpaceIException("DataSpace::extentCopy", "H5Sextent_copy failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::extentCopy -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const. This wrapper will be removed in future release. -// Param dest_space - IN: Dataspace to copy from -// Exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::extentCopy +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const. This wrapper will be removed in future release. +// Param dest_space - IN: Dataspace to copy from +// Exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- -//void DataSpace::extentCopy(DataSpace& dest_space) const +//void DataSpace::extentCopy( DataSpace& dest_space ) const //{ // extentCopy(dest_space); //} //-------------------------------------------------------------------------- -// Function: DataSpace::setExtentSimple -///\brief Sets or resets the size of an existing dataspace. -///\param rank - IN: Rank of the dataspace -///\param current_size - IN: Array containing current size of dataspace -///\param maximum_size - IN: Array containing maximum size of dataspace -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::setExtentSimple +///\brief Sets or resets the size of an existing dataspace. +///\param rank - IN: Rank of the dataspace +///\param current_size - IN: Array containing current size of dataspace +///\param maximum_size - IN: Array containing maximum size of dataspace +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::setExtentSimple(int rank, const hsize_t *current_size, const hsize_t *maximum_size) const +void DataSpace::setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size ) const { - herr_t ret_value; - ret_value = H5Sset_extent_simple(id, rank, current_size, maximum_size); - if (ret_value < 0) - { - throw DataSpaceIException("DataSpace::setExtentSimple", "H5Sset_extent_simple failed"); - } + herr_t ret_value; + ret_value = H5Sset_extent_simple( id, rank, current_size, maximum_size ); + if( ret_value < 0 ) + { + throw DataSpaceIException("DataSpace::setExtentSimple", "H5Sset_extent_simple failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::setExtentNone -///\brief Removes the extent from a dataspace. +// Function: DataSpace::setExtentNone +///\brief Removes the extent from a dataspace. /// -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::setExtentNone () const { - herr_t ret_value = H5Sset_extent_none(id); - if (ret_value < 0) - { - throw DataSpaceIException("DataSpace::setExtentNone", "H5Sset_extent_none failed"); - } + herr_t ret_value = H5Sset_extent_none( id ); + if( ret_value < 0 ) + { + throw DataSpaceIException("DataSpace::setExtentNone", "H5Sset_extent_none failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectNpoints -///\brief Returns the number of elements in a dataspace selection. -///\return Number of elements -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSelectNpoints +///\brief Returns the number of elements in a dataspace selection. +///\return Number of elements +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hssize_t DataSpace::getSelectNpoints () const { - hssize_t num_elements = H5Sget_select_npoints(id); - if (num_elements < 0) - { - throw DataSpaceIException("DataSpace::getSelectNpoints", - "H5Sget_select_npoints returns negative value for number of elements in the dataspace selection"); - } - return(num_elements); + hssize_t num_elements = H5Sget_select_npoints( id ); + if( num_elements < 0 ) + { + throw DataSpaceIException("DataSpace::getSelectNpoints", + "H5Sget_select_npoints returns negative value for number of elements in the dataspace selection"); + } + return( num_elements ); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectHyperNblocks -///\brief Returns number of hyperslab blocks. -///\return Number of hyperslab blocks -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSelectHyperNblocks +///\brief Returns number of hyperslab blocks. +///\return Number of hyperslab blocks +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hssize_t DataSpace::getSelectHyperNblocks () const { - hssize_t num_blocks = H5Sget_select_hyper_nblocks(id); - if (num_blocks < 0) - { - throw DataSpaceIException("DataSpace::getSelectHyperNblocks", - "H5Sget_select_hyper_nblocks returns negative value for the number of hyperslab blocks"); - } - return(num_blocks); + hssize_t num_blocks = H5Sget_select_hyper_nblocks( id ); + if( num_blocks < 0 ) + { + throw DataSpaceIException("DataSpace::getSelectHyperNblocks", + "H5Sget_select_hyper_nblocks returns negative value for the number of hyperslab blocks"); + } + return( num_blocks ); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectHyperBlocklist -///\brief Gets the list of hyperslab blocks currently selected -///\param startblock - IN: Hyperslab block to start with -///\param numblocks - IN: Number of hyperslab blocks to get -///\param buf - IN: List of hyperslab blocks selected -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSelectHyperBlocklist +///\brief Gets the list of hyperslab blocks currently selected +///\param startblock - IN: Hyperslab block to start with +///\param numblocks - IN: Number of hyperslab blocks to get +///\param buf - IN: List of hyperslab blocks selected +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::getSelectHyperBlocklist(hsize_t startblock, hsize_t numblocks, hsize_t *buf) const +void DataSpace::getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const { - herr_t ret_value; - ret_value = H5Sget_select_hyper_blocklist(id, startblock, numblocks, buf); - if (ret_value < 0) - { - throw DataSpaceIException("DataSpace::getSelectHyperBlocklist", - "H5Sget_select_hyper_blocklist failed"); - } + herr_t ret_value; + ret_value = H5Sget_select_hyper_blocklist( id, startblock, numblocks, buf ); + if( ret_value < 0 ) + { + throw DataSpaceIException("DataSpace::getSelectHyperBlocklist", + "H5Sget_select_hyper_blocklist failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectElemNpoints -///\brief Returns the number of element points in the current selection. -///\return Number of element points -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::getSelectElemNpoints +///\brief Returns the number of element points in the current selection. +///\return Number of element points +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hssize_t DataSpace::getSelectElemNpoints () const { - hssize_t num_points = H5Sget_select_elem_npoints(id); - if (num_points < 0) - { - throw DataSpaceIException("DataSpace::getSelectElemNpoints", - "H5Sget_select_elem_npoints failed"); - } - return(num_points); + hssize_t num_points = H5Sget_select_elem_npoints( id ); + if( num_points < 0 ) + { + throw DataSpaceIException("DataSpace::getSelectElemNpoints", + "H5Sget_select_elem_npoints failed"); + } + return( num_points ); } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectElemPointlist -///\brief Gets the list of element points currently selected -///\param startpoint - IN: Element point to start with -///\param numpoints - IN: Number of element points to get -///\param buf - IN: List of element points selected -///\exception H5::DataSpaceIException +// Function: DataSpace::getSelectElemPointlist +///\brief Gets the list of element points currently selected +///\param startpoint - IN: Element point to start with +///\param numpoints - IN: Number of element points to get +///\param buf - IN: List of element points selected +///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElemPointList -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize_t numpoints, hsize_t *buf) const +void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const { - herr_t ret_value; - ret_value = H5Sget_select_elem_pointlist(id, startpoint, numpoints, buf); - if (ret_value < 0) - { - throw DataSpaceIException("DataSpace::getSelectElemPointlist", - "H5Sget_select_elem_pointlist failed"); - } + herr_t ret_value; + ret_value = H5Sget_select_elem_pointlist( id, startpoint, numpoints, buf ); + if( ret_value < 0 ) + { + throw DataSpaceIException("DataSpace::getSelectElemPointlist", + "H5Sget_select_elem_pointlist failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::getSelectBounds -///\brief Gets the bounding box containing the current selection. -///\param start - IN: Starting coordinates of the bounding box -///\param end - IN: Ending coordinates of the bounding box, i.e., -/// the coordinates of the diagonally opposite corner -///\exception H5::DataSpaceIException +// Function: DataSpace::getSelectBounds +///\brief Gets the bounding box containing the current selection. +///\param start - IN: Starting coordinates of the bounding box +///\param end - IN: Ending coordinates of the bounding box, i.e., +/// the coordinates of the diagonally opposite corner +///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectBounds -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end) const +void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const { - herr_t ret_value = H5Sget_select_bounds(id, start, end); - if (ret_value < 0) - { - throw DataSpaceIException("DataSpace::getSelectBounds", - "H5Sget_select_bounds failed"); - } + herr_t ret_value = H5Sget_select_bounds( id, start, end ); + if( ret_value < 0 ) + { + throw DataSpaceIException("DataSpace::getSelectBounds", + "H5Sget_select_bounds failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::selectElements -///\brief Selects array elements to be included in the selection for -/// this dataspace. -///\param op - IN: Operator specifying how the new selection is to be -/// combined with the existing selection for the dataspace -///\param num_elements - IN: Number of elements to be selected -///\param coord - IN: A 2-dimensional array of 0-based values -/// specifying the coordinates of the elements being selected -///\exception H5::DataSpaceIException +// Function: DataSpace::selectElements +///\brief Selects array elements to be included in the selection for +/// this dataspace. +///\param op - IN: Operator specifying how the new selection is to be +/// combined with the existing selection for the dataspace +///\param num_elements - IN: Number of elements to be selected +///\param coord - IN: A 2-dimensional array of 0-based values +/// specifying the coordinates of the elements being selected +///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElements -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::selectElements (H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const +void DataSpace::selectElements ( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const { - herr_t ret_value; - ret_value = H5Sselect_elements(id, op, num_elements, coord); - if (ret_value < 0) - { - throw DataSpaceIException("DataSpace::selectElements", - "H5Sselect_elements failed"); - } + herr_t ret_value; + ret_value = H5Sselect_elements( id, op, num_elements, coord ); + if( ret_value < 0 ) + { + throw DataSpaceIException("DataSpace::selectElements", + "H5Sselect_elements failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::selectAll -///\brief Selects the entire dataspace. +// Function: DataSpace::selectAll +///\brief Selects the entire dataspace. /// -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectAll () const { - herr_t ret_value = H5Sselect_all(id); - if (ret_value < 0) - { - throw DataSpaceIException("DataSpace::selectAll", "H5Sselect_all failed"); - } + herr_t ret_value = H5Sselect_all( id ); + if( ret_value < 0 ) + { + throw DataSpaceIException("DataSpace::selectAll", "H5Sselect_all failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::selectNone -///\brief Resets the selection region to include no elements. +// Function: DataSpace::selectNone +///\brief Resets the selection region to include no elements. /// -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectNone () const { - herr_t ret_value = H5Sselect_none(id); - if (ret_value < 0) - { - throw DataSpaceIException("DataSpace::selectNone", - "H5Sselect_none failed"); - } + herr_t ret_value = H5Sselect_none( id ); + if( ret_value < 0 ) + { + throw DataSpaceIException("DataSpace::selectNone", + "H5Sselect_none failed"); + } } //-------------------------------------------------------------------------- -// Function: DataSpace::selectValid -///\brief Verifies that the selection is within the extent of the -/// dataspace. -///\return \c true if the selection is within the extent of the -/// dataspace, and \c false, otherwise -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::selectValid +///\brief Verifies that the selection is within the extent of the +/// dataspace. +///\return \c true if the selection is within the extent of the +/// dataspace, and \c false, otherwise +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DataSpace::selectValid () const { - htri_t ret_value = H5Sselect_valid(id); - if (ret_value > 0) - return true; - else if (ret_value == 0) - return false; - else - { - throw DataSpaceIException("DataSpace::selectValid", - "H5Sselect_valid returns negative value"); - } -} - -//-------------------------------------------------------------------------- -// Function: DataSpace::selectHyperslab -///\brief Selects a hyperslab region to add to the current selected region. -///\param op - IN: Operation to perform on current selection -///\param count - IN: Number of blocks included in the hyperslab -///\param start - IN: Offset of the start of hyperslab -///\param stride - IN: Hyperslab stride - default to \c NULL -///\param block - IN: Size of block in the hyperslab - default to \c NULL -///\exception H5::DataSpaceIException + htri_t ret_value = H5Sselect_valid( id ); + if( ret_value > 0 ) + return true; + else if( ret_value == 0 ) + return false; + else + { + throw DataSpaceIException("DataSpace::selectValid", + "H5Sselect_valid returns negative value"); + } +} + +//-------------------------------------------------------------------------- +// Function: DataSpace::selectHyperslab +///\brief Selects a hyperslab region to add to the current selected region. +///\param op - IN: Operation to perform on current selection +///\param count - IN: Number of blocks included in the hyperslab +///\param start - IN: Offset of the start of hyperslab +///\param stride - IN: Hyperslab stride - default to \c NULL +///\param block - IN: Size of block in the hyperslab - default to \c NULL +///\exception H5::DataSpaceIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSpace::selectHyperslab(H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block) const +void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block ) const { - herr_t ret_value; - ret_value = H5Sselect_hyperslab(id, op, start, stride, count, block); - if (ret_value < 0) - { - throw DataSpaceIException("DataSpace::selectHyperslab", - "H5Sselect_hyperslab failed"); - } + herr_t ret_value; + ret_value = H5Sselect_hyperslab( id, op, start, stride, count, block ); + if( ret_value < 0 ) + { + throw DataSpaceIException("DataSpace::selectHyperslab", + "H5Sselect_hyperslab failed"); + } } //-------------------------------------------------------------------------- // Function: DataSpace::getId -///\brief Get the id of this dataspace -///\return Dataspace identifier +///\brief Get the id of this dataspace +///\return Dataspace identifier // Modification: -// May 2008 - BMR +// May 2008 - BMR // Class hierarchy is revised to address bugzilla 1068. Class // AbstractDS and Attribute are moved out of H5Object. In // addition, member IdComponent::id is moved into subclasses, and @@ -630,7 +631,7 @@ void DataSpace::selectHyperslab(H5S_seloper_t op, const hsize_t *count, const hs //-------------------------------------------------------------------------- hid_t DataSpace::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -655,49 +656,49 @@ void DataSpace::p_setId(const hid_t new_id) catch (Exception& close_error) { throw DataSpaceIException(inMemFunc("p_setId"), close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataSpace::close -///\brief Closes this dataspace. +// Function: DataSpace::close +///\brief Closes this dataspace. /// -///\exception H5::DataSpaceIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void DataSpace::close() { // check if id is a valid hdf5 object id before trying to close it if (p_valid_id(id)) { - herr_t ret_value = H5Sclose(id); - if (ret_value < 0) - { - throw DataSpaceIException("DataSpace::close", "H5Sclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Sclose(id); + if( ret_value < 0 ) + { + throw DataSpaceIException("DataSpace::close", "H5Sclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: DataSpace destructor -///\brief Properly terminates access to this dataspace. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace destructor +///\brief Properly terminates access to this dataspace. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- DataSpace::~DataSpace() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl; + cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 969e146..e76bc72 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -27,126 +27,126 @@ namespace H5 { */ class H5_DLLCPP DataSpace : public IdComponent { public: - ///\brief Default DataSpace objects - static const DataSpace& ALL; + ///\brief Default DataSpace objects + static const DataSpace& ALL; - // Creates a dataspace object given the space type - DataSpace(H5S_class_t type = H5S_SCALAR); + // Creates a dataspace object given the space type + DataSpace(H5S_class_t type = H5S_SCALAR); - // Creates a simple dataspace - DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL); + // Creates a simple dataspace + DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL); - // Creates a DataSpace object using an existing dataspace id. - DataSpace(const hid_t space_id); + // Creates a DataSpace object using an existing dataspace id. + DataSpace(const hid_t space_id); - // Copy constructor: makes a copy of the original DataSpace object. - DataSpace(const DataSpace& original); + // Copy constructor: makes a copy of the original DataSpace object. + DataSpace(const DataSpace& original); - // Assignment operator - DataSpace& operator=(const DataSpace& rhs); + // Assignment operator + DataSpace& operator=( const DataSpace& rhs ); - // Closes this dataspace. - virtual void close(); + // Closes this dataspace. + virtual void close(); - // Makes copy of an existing dataspace. - void copy(const DataSpace& like_space); + // Makes copy of an existing dataspace. + void copy(const DataSpace& like_space); - // Copies the extent of this dataspace. - void extentCopy(const DataSpace& dest_space) const; - // removed from 1.8.18 and 1.10.1 - //void extentCopy(DataSpace& dest_space) const; + // Copies the extent of this dataspace. + void extentCopy(const DataSpace& dest_space) const; + // removed from 1.8.18 and 1.10.1 + //void extentCopy(DataSpace& dest_space) const; - // Gets the bounding box containing the current selection. - void getSelectBounds(hsize_t* start, hsize_t* end) const; + // Gets the bounding box containing the current selection. + void getSelectBounds( hsize_t* start, hsize_t* end ) const; - // Gets the number of element points in the current selection. - hssize_t getSelectElemNpoints() const; + // Gets the number of element points in the current selection. + hssize_t getSelectElemNpoints() const; - // Retrieves the list of element points currently selected. - void getSelectElemPointlist(hsize_t startpoint, hsize_t numpoints, hsize_t *buf) const; + // Retrieves the list of element points currently selected. + void getSelectElemPointlist( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const; - // Gets the list of hyperslab blocks currently selected. - void getSelectHyperBlocklist(hsize_t startblock, hsize_t numblocks, hsize_t *buf) const; + // Gets the list of hyperslab blocks currently selected. + void getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const; - // Get number of hyperslab blocks. - hssize_t getSelectHyperNblocks() const; + // Get number of hyperslab blocks. + hssize_t getSelectHyperNblocks() const; - // Gets the number of elements in this dataspace selection. - hssize_t getSelectNpoints() const; + // Gets the number of elements in this dataspace selection. + hssize_t getSelectNpoints() const; - // Retrieves dataspace dimension size and maximum size. - int getSimpleExtentDims(hsize_t *dims, hsize_t *maxdims = NULL) const; + // Retrieves dataspace dimension size and maximum size. + int getSimpleExtentDims( hsize_t *dims, hsize_t *maxdims = NULL ) const; - // Gets the dimensionality of this dataspace. - int getSimpleExtentNdims() const; + // Gets the dimensionality of this dataspace. + int getSimpleExtentNdims() const; - // Gets the number of elements in this dataspace. - // 12/05/00 - changed return type to hssize_t from hsize_t - C API - hssize_t getSimpleExtentNpoints() const; + // Gets the number of elements in this dataspace. + // 12/05/00 - changed return type to hssize_t from hsize_t - C API + hssize_t getSimpleExtentNpoints() const; - // Gets the current class of this dataspace. - H5S_class_t getSimpleExtentType() const; + // Gets the current class of this dataspace. + H5S_class_t getSimpleExtentType() const; - // Determines if this dataspace is a simple one. - bool isSimple() const; + // Determines if this dataspace is a simple one. + bool isSimple() const; - // Sets the offset of this simple dataspace. - void offsetSimple(const hssize_t* offset) const; + // Sets the offset of this simple dataspace. + void offsetSimple( const hssize_t* offset ) const; - // Selects the entire dataspace. - void selectAll() const; + // Selects the entire dataspace. + void selectAll() const; - // Selects array elements to be included in the selection for - // this dataspace. - void selectElements(H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const; + // Selects array elements to be included in the selection for + // this dataspace. + void selectElements( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const; - // Selects a hyperslab region to add to the current selected region. - void selectHyperslab(H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL) const; + // Selects a hyperslab region to add to the current selected region. + void selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL ) const; - // Resets the selection region to include no elements. - void selectNone() const; + // Resets the selection region to include no elements. + void selectNone() const; - // Verifies that the selection is within the extent of the dataspace. - bool selectValid() const; + // Verifies that the selection is within the extent of the dataspace. + bool selectValid() const; - // Removes the extent from this dataspace. - void setExtentNone() const; + // Removes the extent from this dataspace. + void setExtentNone() const; - // Sets or resets the size of this dataspace. - void setExtentSimple(int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL) const; + // Sets or resets the size of this dataspace. + void setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL ) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DataSpace"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DataSpace"); } - // Gets the dataspace id. - virtual hid_t getId() const; + // Gets the dataspace id. + virtual hid_t getId() const; - // Deletes the global constant - static void deleteConstants(); + // Deletes the global constant + static void deleteConstants(); - // Destructor: properly terminates access to this dataspace. - virtual ~DataSpace(); + // Destructor: properly terminates access to this dataspace. + virtual ~DataSpace(); #ifndef DOXYGEN_SHOULD_SKIP_THIS protected: - // Sets the dataspace id. - virtual void p_setId(const hid_t new_id); + // Sets the dataspace id. + virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 dataspace id + hid_t id; // HDF5 dataspace id #ifndef DOXYGEN_SHOULD_SKIP_THIS - static DataSpace* ALL_; + static DataSpace* ALL_; - // Creates the global constant - static DataSpace* getConstant(); + // Creates the global constant + static DataSpace* getConstant(); - // Friend function to set DataSpace id. For library use only. - friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id); + // Friend function to set DataSpace id. For library use only. + friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS }; diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index ae48d16..372b2c9 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -46,24 +46,24 @@ using std::cerr; using std::endl; //-------------------------------------------------------------------------- -// Function: DataType default constructor -///\brief Default constructor: Creates a stub datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType default constructor +///\brief Default constructor: Creates a stub datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType::DataType() : H5Object(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: DataType overloaded constructor -///\brief Creates a datatype using an existing datatype's id -///\param existing_id - IN: Id of the existing datatype +// Function: DataType overloaded constructor +///\brief Creates a datatype using an existing datatype's id +///\param existing_id - IN: Id of the existing datatype // Description -// Constructor creates a copy of an existing DataType using -// its id. -// Programmer Binh-Minh Ribler - 2000 +// Constructor creates a copy of an existing DataType using +// its id. +// Programmer Binh-Minh Ribler - 2000 // Modification -// Dec, 2005 -// Removed second argument, "predefined", after changing to the -// new ref counting mechanism that relies on C's ref counting. +// Dec, 2005 +// Removed second argument, "predefined", after changing to the +// new ref counting mechanism that relies on C's ref counting. //-------------------------------------------------------------------------- DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id) { @@ -71,36 +71,36 @@ DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id) } //-------------------------------------------------------------------------- -// Function: DataType overloaded constructor -///\brief Creates a object given its class and size -///\param type_class - IN: Class of datatype to create -///\param size - IN: Number of bytes in the datatype to create -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType overloaded constructor +///\brief Creates a object given its class and size +///\param type_class - IN: Class of datatype to create +///\param size - IN: Number of bytes in the datatype to create +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object() +DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object() { - // Call C routine to create the new datatype - id = H5Tcreate(type_class, size); - if (id < 0) - { - throw DataTypeIException("DataType constructor", "H5Tcreate failed"); - } + // Call C routine to create the new datatype + id = H5Tcreate( type_class, size ); + if( id < 0 ) + { + throw DataTypeIException("DataType constructor", "H5Tcreate failed"); + } } //-------------------------------------------------------------------------- -// Function: DataType overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a -/// DataType object +// Function: DataType overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 group, creates a +/// DataType object ///\param loc - IN: Location referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// Jul, 2008 -// Added for application convenience. +// Jul, 2008 +// Added for application convenience. //-------------------------------------------------------------------------- DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object() { @@ -108,18 +108,18 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, } //-------------------------------------------------------------------------- -// Function: DataType overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a -/// DataType object +// Function: DataType overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 group, creates a +/// DataType object ///\param attr - IN: Specifying location where the referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// Jul, 2008 -// Added for application convenience. +// Jul, 2008 +// Added for application convenience. //-------------------------------------------------------------------------- /* DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) { @@ -128,9 +128,9 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, */ //-------------------------------------------------------------------------- -// Function: DataType copy constructor -///\brief Copy constructor: makes a copy of the original DataType object -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType copy constructor +///\brief Copy constructor: makes a copy of the original DataType object +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType::DataType(const DataType& original) : H5Object(), id(original.id) { @@ -144,32 +144,32 @@ DataType::DataType(const DataType& original) : H5Object(), id(original.id) ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2015 // Description -// Copying the type so that when a predefined type is passed in, -// a copy of it is made, not just a duplicate of the HDF5 id. -// Note: calling DataType::copy will invoke DataType::close() -// unnecessarily and will produce undefined behavior. -// -BMR, Apr 2015 +// Copying the type so that when a predefined type is passed in, +// a copy of it is made, not just a duplicate of the HDF5 id. +// Note: calling DataType::copy will invoke DataType::close() +// unnecessarily and will produce undefined behavior. +// -BMR, Apr 2015 //-------------------------------------------------------------------------- DataType::DataType(const PredType& pred_type) : H5Object() { // Call C routine to copy the datatype - id = H5Tcopy(pred_type.getId()); + id = H5Tcopy( pred_type.getId() ); if (id < 0) - throw DataTypeIException("DataType constructor", "H5Tcopy failed"); + throw DataTypeIException("DataType constructor", "H5Tcopy failed"); } //-------------------------------------------------------------------------- // Function: DataType overloaded constructor ///\brief Creates a DataType instance by opening an HDF5 datatype given -/// its name as a char*. +/// its name as a char*. ///\param dtype_name - IN: Datatype name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openDataType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openDataType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- DataType::DataType(const H5Location& loc, const char *dtype_name) : H5Object() { @@ -178,16 +178,16 @@ DataType::DataType(const H5Location& loc, const char *dtype_name) : H5Object() //-------------------------------------------------------------------------- // Function: DataType overloaded constructor -///\brief Creates a DataType instance by opening an HDF5 datatype given -/// its name as an \c H5std_string. +///\brief Creates a DataType instance by opening an HDF5 datatype given +/// its name as an \c H5std_string. ///\param dtype_name - IN: Datatype name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openDataType(const H5std_string&) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openDataType(const H5std_string&) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- DataType::DataType(const H5Location& loc, const H5std_string& dtype_name) : H5Object() { @@ -195,108 +195,108 @@ DataType::DataType(const H5Location& loc, const H5std_string& dtype_name) : H5Ob } //-------------------------------------------------------------------------- -// Function: DataType::copy -///\brief Copies an existing datatype to this datatype object -///\param like_type - IN: Datatype to be copied -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::copy +///\brief Copies an existing datatype to this datatype object +///\param like_type - IN: Datatype to be copied +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- -void DataType::copy(const DataType& like_type) +void DataType::copy( const DataType& like_type ) { // close the current data type before copying like_type to this object try { - close(); + close(); } catch (Exception& close_error) { - throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg()); + throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg()); } // call C routine to copy the datatype - id = H5Tcopy(like_type.getId()); - if (id < 0) - throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); + id = H5Tcopy( like_type.getId() ); + if( id < 0 ) + throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); } //-------------------------------------------------------------------------- -// Function: DataType::copy -///\brief Copies the datatype of the given dataset to this datatype object -///\param dset - IN: Dataset -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jan, 2007 +// Function: DataType::copy +///\brief Copies the datatype of the given dataset to this datatype object +///\param dset - IN: Dataset +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jan, 2007 ///\par Description -/// The resulted dataset will be transient and modifiable. +/// The resulted dataset will be transient and modifiable. //-------------------------------------------------------------------------- void DataType::copy(const DataSet& dset) { // close the current data type before copying dset's datatype to this object try { - close(); + close(); } catch (Exception& close_error) { - throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg()); + throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg()); } // call C routine to copy the datatype - id = H5Tcopy(dset.getId()); - if (id < 0) - throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); + id = H5Tcopy( dset.getId() ); + if( id < 0 ) + throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed"); } //-------------------------------------------------------------------------- -// Function: DataType::operator= -///\brief Assignment operator -///\param rhs - IN: Reference to the existing datatype -///\return Reference to DataType instance -///\exception H5::DataTypeIException +// Function: DataType::operator= +///\brief Assignment operator +///\param rhs - IN: Reference to the existing datatype +///\return Reference to DataType instance +///\exception H5::DataTypeIException // Description -// Makes a copy of the type on the right hand side and stores -// the new id in the left hand side object. -// Programmer Binh-Minh Ribler - 2000 +// Makes a copy of the type on the right hand side and stores +// the new id in the left hand side object. +// Programmer Binh-Minh Ribler - 2000 // Modification -// Changed operator= to simply copy the id of rhs instead of -// calling H5Tcopy because, when the operator= is invoked, a -// different datatype id is created and it won't have the same -// characteristics as the original one, specifically, if the -// rhs represents a named datatype, "this" would still be a -// transient datatype. -// BMR - Mar, 2015 +// Changed operator= to simply copy the id of rhs instead of +// calling H5Tcopy because, when the operator= is invoked, a +// different datatype id is created and it won't have the same +// characteristics as the original one, specifically, if the +// rhs represents a named datatype, "this" would still be a +// transient datatype. +// BMR - Mar, 2015 //-------------------------------------------------------------------------- -DataType& DataType::operator=(const DataType& rhs) +DataType& DataType::operator=( const DataType& rhs ) { if (this != &rhs) { - setId(rhs.id); + setId(rhs.id); } return(*this); } //-------------------------------------------------------------------------- -// Function: DataType::operator== -///\brief Compares this DataType against the given one to determines -/// whether the two objects refer to the same actual datatype. -///\param compared_type - IN: Reference to the datatype to compare -///\return true if the datatypes are equal, and false, otherwise. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::operator== +///\brief Compares this DataType against the given one to determines +/// whether the two objects refer to the same actual datatype. +///\param compared_type - IN: Reference to the datatype to compare +///\return true if the datatypes are equal, and false, otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -bool DataType::operator==(const DataType& compared_type) const +bool DataType::operator==(const DataType& compared_type ) const { - // Call C routine H5Tequal to determines whether two datatype - // identifiers refer to the same datatype - htri_t ret_value = H5Tequal(id, compared_type.getId()); - if (ret_value > 0) - return true; - else if (ret_value == 0) - return false; - else - { - throw DataTypeIException(inMemFunc("operator=="), "H5Tequal returns negative value"); - } + // Call C routine H5Tequal to determines whether two datatype + // identifiers refer to the same datatype + htri_t ret_value = H5Tequal( id, compared_type.getId() ); + if( ret_value > 0 ) + return true; + else if( ret_value == 0 ) + return false; + else + { + throw DataTypeIException(inMemFunc("operator=="), "H5Tequal returns negative value"); + } } //-------------------------------------------------------------------------- @@ -306,69 +306,69 @@ bool DataType::operator==(const DataType& compared_type) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// This function was introduced in 1.10.1 to be used by the new -// XxxType constructors that were introduced to replace the -// existing functions CommonFG::openXxxType(), which is awkward -// to use. -BMR, Dec 2016 +// This function was introduced in 1.10.1 to be used by the new +// XxxType constructors that were introduced to replace the +// existing functions CommonFG::openXxxType(), which is awkward +// to use. -BMR, Dec 2016 //-------------------------------------------------------------------------- hid_t DataType::p_opentype(const H5Location& loc, const char *dtype_name) const { // Call C function to open the named datatype at this location hid_t ret_value = H5Topen2(loc.getId(), dtype_name, H5P_DEFAULT); if (ret_value < 0) - throw DataTypeIException("DataType constructor", "H5Topen2 failed"); + throw DataTypeIException("DataType constructor", "H5Topen2 failed"); return(ret_value); } //-------------------------------------------------------------------------- -// Function: DataType::p_commit (private) -//\brief Commits a transient datatype to a file, creating a new -// named datatype -//\param loc_id - IN: The id of either a file, group, dataset, named -// datatype, or attribute. -//\param name - IN: Name of the datatype -//\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::p_commit (private) +//\brief Commits a transient datatype to a file, creating a new +// named datatype +//\param loc_id - IN: The id of either a file, group, dataset, named +// datatype, or attribute. +//\param name - IN: Name of the datatype +//\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 // Modification: -// Copied from DataType::commit and made into private function -// to be commonly used by several overloads of DataType::commit. -// BMR - Jan, 2007 +// Copied from DataType::commit and made into private function +// to be commonly used by several overloads of DataType::commit. +// BMR - Jan, 2007 //-------------------------------------------------------------------------- void DataType::p_commit(hid_t loc_id, const char* name) { - // Call C routine to commit the transient datatype - herr_t ret_value = H5Tcommit2(loc_id, name, id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (ret_value < 0) - throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit2 failed"); + // Call C routine to commit the transient datatype + herr_t ret_value = H5Tcommit2(loc_id, name, id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if( ret_value < 0 ) + throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit2 failed"); } //-------------------------------------------------------------------------- -// Function: DataType::commit -///\brief Commits a transient datatype to a file, creating a new -/// named datatype -///\param loc - IN: A location (file, dataset, datatype, or group) -///\param name - IN: Name of the datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jan, 2007 +// Function: DataType::commit +///\brief Commits a transient datatype to a file, creating a new +/// named datatype +///\param loc - IN: A location (file, dataset, datatype, or group) +///\param name - IN: Name of the datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jan, 2007 //-------------------------------------------------------------------------- void DataType::commit(const H5Location& loc, const char* name) { - p_commit(loc.getId(), name); + p_commit(loc.getId(), name); } //-------------------------------------------------------------------------- -// Function: DataType::commit -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Param loc - IN: A location (file, dataset, datatype, or group) -// Param name - IN: Name of the datatype -// Exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jan, 2007 +// Function: DataType::commit +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Param loc - IN: A location (file, dataset, datatype, or group) +// Param name - IN: Name of the datatype +// Exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jan, 2007 // Modification -// Planned for removal. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Planned for removal. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void DataType::commit(H5Location& loc, const char* name) //{ @@ -376,30 +376,30 @@ void DataType::commit(const H5Location& loc, const char* name) //} //-------------------------------------------------------------------------- -// Function: DataType::commit -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::commit +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of the +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::commit(const H5Location& loc, const H5std_string& name) { - p_commit(loc.getId(), name.c_str()); + p_commit(loc.getId(), name.c_str()); } //-------------------------------------------------------------------------- -// Function: DataType::commit -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Param loc - IN: A location (file, dataset, datatype, or group) -// Param name - IN: Name of the datatype -// Exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Jan, 2007 +// Function: DataType::commit +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Param loc - IN: A location (file, dataset, datatype, or group) +// Param name - IN: Name of the datatype +// Exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Jan, 2007 // Modification -// Planned for removal. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Planned for removal. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void DataType::commit(H5Location& loc, const H5std_string& name) //{ @@ -407,340 +407,340 @@ void DataType::commit(const H5Location& loc, const H5std_string& name) //} //-------------------------------------------------------------------------- -// Function: DataType::committed -///\brief Determines whether a datatype is a named type or a -/// transient type. -///\return \c true if the datatype is a named type, and \c false, -/// otherwise. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::committed +///\brief Determines whether a datatype is a named type or a +/// transient type. +///\return \c true if the datatype is a named type, and \c false, +/// otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DataType::committed() const { - // Call C function to determine if a datatype is a named one - htri_t is_committed = H5Tcommitted(id); - if (is_committed > 0) - return true; - else if (is_committed == 0) - return false; - else - { - throw DataTypeIException(inMemFunc("committed"), "H5Tcommitted return negative value"); - } -} - -//-------------------------------------------------------------------------- -// Function: DataType::find -///\brief Finds a conversion function that can handle a conversion -/// from this datatype to the specified datatype, \a dest. -///\param dest - IN: Destination datatype -///\param pcdata - IN: Pointer to type conversion data -///\return Pointer to a suitable conversion function -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -H5T_conv_t DataType::find(const DataType& dest, H5T_cdata_t **pcdata) const -{ - // Call C routine to find the conversion function - H5T_conv_t func = H5Tfind(id, dest.getId(), pcdata); - if (func == NULL) - { - throw DataTypeIException(inMemFunc("find"), "H5Tfind returns a NULL function"); - } - return(func); -} - -//-------------------------------------------------------------------------- -// Function: DataType::convert -///\brief Converts data from this datatype to the specified datatypes. -///\param dest - IN: Destination datatype -///\param nelmts - IN: Size of array \a buf -///\param buf - IN/OUT: Array containing pre- and post-conversion -/// values -///\param background - IN: Optional backgroud buffer -///\param plist - IN: Property list - default to PropList::DEFAULT -///\return Pointer to a suitable conversion function -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void DataType::convert(const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist) const -{ - // Get identifiers for C API - hid_t dest_id = dest.getId(); - hid_t plist_id = plist.getId(); - - // Call C routine H5Tconvert to convert the data - herr_t ret_value; - ret_value = H5Tconvert(id, dest_id, nelmts, buf, background, plist_id); - if (ret_value < 0) - { - throw DataTypeIException(inMemFunc("convert"), "H5Tconvert failed"); - } -} - -//-------------------------------------------------------------------------- -// Function: DataType::lock -///\brief Locks a datatype, making it read-only and non-destructible. + // Call C function to determine if a datatype is a named one + htri_t is_committed = H5Tcommitted( id ); + if (is_committed > 0) + return true; + else if (is_committed == 0) + return false; + else + { + throw DataTypeIException(inMemFunc("committed"), "H5Tcommitted return negative value"); + } +} + +//-------------------------------------------------------------------------- +// Function: DataType::find +///\brief Finds a conversion function that can handle a conversion +/// from this datatype to the specified datatype, \a dest. +///\param dest - IN: Destination datatype +///\param pcdata - IN: Pointer to type conversion data +///\return Pointer to a suitable conversion function +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const +{ + // Call C routine to find the conversion function + H5T_conv_t func = H5Tfind( id, dest.getId(), pcdata ); + if( func == NULL ) + { + throw DataTypeIException(inMemFunc("find"), "H5Tfind returns a NULL function"); + } + return( func ); +} + +//-------------------------------------------------------------------------- +// Function: DataType::convert +///\brief Converts data from this datatype to the specified datatypes. +///\param dest - IN: Destination datatype +///\param nelmts - IN: Size of array \a buf +///\param buf - IN/OUT: Array containing pre- and post-conversion +/// values +///\param background - IN: Optional backgroud buffer +///\param plist - IN: Property list - default to PropList::DEFAULT +///\return Pointer to a suitable conversion function +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DataType::convert( const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist ) const +{ + // Get identifiers for C API + hid_t dest_id = dest.getId(); + hid_t plist_id = plist.getId(); + + // Call C routine H5Tconvert to convert the data + herr_t ret_value; + ret_value = H5Tconvert( id, dest_id, nelmts, buf, background, plist_id ); + if( ret_value < 0 ) + { + throw DataTypeIException(inMemFunc("convert"), "H5Tconvert failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: DataType::lock +///\brief Locks a datatype, making it read-only and non-destructible. /// -///\exception H5::DataTypeIException +///\exception H5::DataTypeIException ///\par Descrition -/// This is normally done by the library for predefined data -/// types so the application doesn't inadvertently change or -/// delete a predefined type. +/// This is normally done by the library for predefined data +/// types so the application doesn't inadvertently change or +/// delete a predefined type. /// -/// Once a data type is locked it can never be unlocked unless -/// the entire library is closed. -// Programmer Binh-Minh Ribler - 2000 +/// Once a data type is locked it can never be unlocked unless +/// the entire library is closed. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::lock() const { - // Call C routine to lock the datatype - herr_t ret_value = H5Tlock(id); - if (ret_value < 0) - { - throw DataTypeIException(inMemFunc("lock"), "H5Tlock failed"); - } + // Call C routine to lock the datatype + herr_t ret_value = H5Tlock( id ); + if( ret_value < 0 ) + { + throw DataTypeIException(inMemFunc("lock"), "H5Tlock failed"); + } } //-------------------------------------------------------------------------- -// Function: DataType::getClass -///\brief Returns the datatype class identifier. -///\return Datatype class identifier -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::getClass +///\brief Returns the datatype class identifier. +///\return Datatype class identifier +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_class_t DataType::getClass() const { - H5T_class_t type_class = H5Tget_class(id); + H5T_class_t type_class = H5Tget_class( id ); - // Return datatype class identifier if successful - if (type_class == H5T_NO_CLASS) - { - throw DataTypeIException(inMemFunc("getClass"), "H5Tget_class returns H5T_NO_CLASS"); - } - return(type_class); + // Return datatype class identifier if successful + if( type_class == H5T_NO_CLASS ) + { + throw DataTypeIException(inMemFunc("getClass"), "H5Tget_class returns H5T_NO_CLASS"); + } + return( type_class ); } //-------------------------------------------------------------------------- -// Function: DataType::getSize -///\brief Returns the size of a datatype. -///\return Datatype size in bytes -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::getSize +///\brief Returns the size of a datatype. +///\return Datatype size in bytes +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- size_t DataType::getSize() const { - // Call C routine to get the datatype size - size_t type_size = H5Tget_size(id); - if (type_size <= 0) // valid data types are never zero size - { - throw DataTypeIException(inMemFunc("getSize"), "H5Tget_size returns invalid datatype size"); - } - return(type_size); + // Call C routine to get the datatype size + size_t type_size = H5Tget_size( id ); + if( type_size <= 0 ) // valid data types are never zero size + { + throw DataTypeIException(inMemFunc("getSize"), "H5Tget_size returns invalid datatype size"); + } + return( type_size ); } //-------------------------------------------------------------------------- -// Function: DataType::getSuper -///\brief Returns the base datatype from which a datatype is derived. -///\return DataType object -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::getSuper +///\brief Returns the base datatype from which a datatype is derived. +///\return DataType object +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType DataType::getSuper() const { - // Call C routine to get the base datatype from which the specified - // datatype is derived. - hid_t base_type_id = H5Tget_super(id); - - // If H5Tget_super returns a valid datatype id, create and return - // the base type, otherwise, raise exception - if (base_type_id > 0) - { - DataType base_type; - base_type.p_setId(base_type_id); - return(base_type); - } - else - { - throw DataTypeIException(inMemFunc("getSuper"), "H5Tget_super failed"); - } -} - -//-------------------------------------------------------------------------- -// Function: DataType::registerFunc -///\brief Registers the specified conversion function. -///\param pers - IN: Conversion option -/// \li \c H5T_PERS_HARD for hard conversion functions -/// \li \c H5T_PERS_SOFT for soft conversion functions. -///\param name - IN: Name displayed in diagnostic output. -///\param dest - IN: Destination datatype. -///\param func - IN: Function to convert between source and -/// destination datatypes. -///\exception H5::DataTypeIException + // Call C routine to get the base datatype from which the specified + // datatype is derived. + hid_t base_type_id = H5Tget_super( id ); + + // If H5Tget_super returns a valid datatype id, create and return + // the base type, otherwise, raise exception + if( base_type_id > 0 ) + { + DataType base_type; + base_type.p_setId(base_type_id); + return(base_type); + } + else + { + throw DataTypeIException(inMemFunc("getSuper"), "H5Tget_super failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: DataType::registerFunc +///\brief Registers the specified conversion function. +///\param pers - IN: Conversion option +/// \li \c H5T_PERS_HARD for hard conversion functions +/// \li \c H5T_PERS_SOFT for soft conversion functions. +///\param name - IN: Name displayed in diagnostic output. +///\param dest - IN: Destination datatype. +///\param func - IN: Function to convert between source and +/// destination datatypes. +///\exception H5::DataTypeIException ///\par Description -/// For more information, please see: +/// For more information, please see: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-Register -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const +void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const { - hid_t dest_id = dest.getId(); // get id of the destination datatype + hid_t dest_id = dest.getId(); // get id of the destination datatype - // Call C routine H5Tregister to register the conversion function - herr_t ret_value = H5Tregister(pers, name, id, dest_id, func); - if (ret_value < 0) - { - throw DataTypeIException(inMemFunc("registerFunc"), "H5Tregister failed"); - } + // Call C routine H5Tregister to register the conversion function + herr_t ret_value = H5Tregister( pers, name, id, dest_id, func ); + if( ret_value < 0 ) + { + throw DataTypeIException(inMemFunc("registerFunc"), "H5Tregister failed"); + } } //-------------------------------------------------------------------------- -// Function: DataType::registerFunc -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::registerFunc +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of the +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const +void DataType::registerFunc( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const { - registerFunc(pers, name.c_str(), dest, func); + registerFunc( pers, name.c_str(), dest, func ); } //-------------------------------------------------------------------------- -// Function: DataType::unregister -///\brief Removes a conversion function from all conversion paths. -///\param pers - IN: Conversion option -/// \li \c H5T_PERS_HARD for hard conversion functions -/// \li \c H5T_PERS_SOFT for soft conversion functions. -///\param name - IN: Name displayed in diagnostic output. -///\param dest - IN: Destination datatype. -///\param func - IN: Function to convert between source and -/// destination datatypes. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::unregister +///\brief Removes a conversion function from all conversion paths. +///\param pers - IN: Conversion option +/// \li \c H5T_PERS_HARD for hard conversion functions +/// \li \c H5T_PERS_SOFT for soft conversion functions. +///\param name - IN: Name displayed in diagnostic output. +///\param dest - IN: Destination datatype. +///\param func - IN: Function to convert between source and +/// destination datatypes. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::unregister(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const +void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const { - hid_t dest_id = dest.getId(); // get id of the dest datatype for C API + hid_t dest_id = dest.getId(); // get id of the dest datatype for C API - // Call C routine H5Tunregister to remove the conversion function - herr_t ret_value = H5Tunregister(pers, name, id, dest_id, func); - if (ret_value < 0) - { - throw DataTypeIException(inMemFunc("unregister"), "H5Tunregister failed"); - } + // Call C routine H5Tunregister to remove the conversion function + herr_t ret_value = H5Tunregister( pers, name, id, dest_id, func ); + if( ret_value < 0 ) + { + throw DataTypeIException(inMemFunc("unregister"), "H5Tunregister failed"); + } } //-------------------------------------------------------------------------- -// Function: DataType::unregister -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::unregister +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of the +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::unregister(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const +void DataType::unregister( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const { - unregister(pers, name.c_str(), dest, func); + unregister( pers, name.c_str(), dest, func ); } //-------------------------------------------------------------------------- -// Function: DataType::setTag -///\brief Tags an opaque datatype. -///\param tag - IN: Descriptive ASCII string with which the opaque -/// datatype is to be tagged. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::setTag +///\brief Tags an opaque datatype. +///\param tag - IN: Descriptive ASCII string with which the opaque +/// datatype is to be tagged. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::setTag(const char* tag) const +void DataType::setTag( const char* tag ) const { - // Call C routine H5Tset_tag to tag an opaque datatype. - herr_t ret_value = H5Tset_tag(id, tag); - if (ret_value < 0) - { - throw DataTypeIException(inMemFunc("setTag"), "H5Tset_tag failed"); - } + // Call C routine H5Tset_tag to tag an opaque datatype. + herr_t ret_value = H5Tset_tag( id, tag ); + if( ret_value < 0 ) + { + throw DataTypeIException(inMemFunc("setTag"), "H5Tset_tag failed"); + } } //-------------------------------------------------------------------------- -// Function: DataType::setTag -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::setTag +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of the +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataType::setTag(const H5std_string& tag) const +void DataType::setTag( const H5std_string& tag ) const { - setTag(tag.c_str()); + setTag( tag.c_str()); } //-------------------------------------------------------------------------- -// Function: DataType::getTag -///\brief Gets the tag associated with an opaque datatype. -///\return Tag associated with the opaque datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType::getTag +///\brief Gets the tag associated with an opaque datatype. +///\return Tag associated with the opaque datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string DataType::getTag() const { - char* tag_Cstr = H5Tget_tag(id); + char* tag_Cstr = H5Tget_tag( id ); // if the tag C-string returned is not NULL, convert it to C++ string // and return it, otherwise, raise an exception - if (tag_Cstr != NULL) + if( tag_Cstr != NULL ) { - H5std_string tag = H5std_string(tag_Cstr); // C string to string object - H5free_memory(tag_Cstr); // free the C string - return (tag); // return the tag + H5std_string tag = H5std_string(tag_Cstr); // C string to string object + H5free_memory(tag_Cstr); // free the C string + return (tag); // return the tag } else { - throw DataTypeIException(inMemFunc("getTag"), "H5Tget_tag returns NULL for tag"); + throw DataTypeIException(inMemFunc("getTag"), "H5Tget_tag returns NULL for tag"); } } //-------------------------------------------------------------------------- -// Function: DataType::detectClass -///\brief Checks whether a datatype contains (or is) a certain type of -/// datatype. -///\return true if this datatype contains or is the specified type, -/// and false, otherwise. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: DataType::detectClass +///\brief Checks whether a datatype contains (or is) a certain type of +/// datatype. +///\return true if this datatype contains or is the specified type, +/// and false, otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- bool DataType::detectClass(H5T_class_t cls) const { - htri_t ret_value = H5Tdetect_class(id, cls); - if (ret_value > 0) - return true; - else if (ret_value == 0) - return false; - else - { - throw DataTypeIException(inMemFunc("detectClass"), - "H5Tdetect_class returns negative value"); - } + htri_t ret_value = H5Tdetect_class(id, cls); + if( ret_value > 0 ) + return true; + else if( ret_value == 0 ) + return false; + else + { + throw DataTypeIException(inMemFunc("detectClass"), + "H5Tdetect_class returns negative value"); + } } //-------------------------------------------------------------------------- -// Function: DataType::isVariableStr -///\brief Check whether this datatype is a variable-length string. -///\return true if this datatype is a variable-length string, and -/// false, otherwise. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: DataType::isVariableStr +///\brief Check whether this datatype is a variable-length string. +///\return true if this datatype is a variable-length string, and +/// false, otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- bool DataType::isVariableStr() const { - htri_t is_varlen_str = H5Tis_variable_str(id); - if (is_varlen_str == 1) - return true; - else if (is_varlen_str == 0) - return false; - else - { - throw DataTypeIException(inMemFunc("isVariableStr"), - "H5Tis_variable_str returns negative value"); - } + htri_t is_varlen_str = H5Tis_variable_str(id); + if( is_varlen_str == 1 ) + return true; + else if( is_varlen_str == 0 ) + return false; + else + { + throw DataTypeIException(inMemFunc("isVariableStr"), + "H5Tis_variable_str returns negative value"); + } } //-------------------------------------------------------------------------- @@ -757,7 +757,7 @@ bool DataType::isVariableStr() const //-------------------------------------------------------------------------- hid_t DataType::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -782,58 +782,58 @@ void DataType::p_setId(const hid_t new_id) catch (Exception& close_error) { throw DataTypeIException(inMemFunc("p_setId"), close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataType::close -///\brief Closes the datatype if it is not a predefined type. +// Function: DataType::close +///\brief Closes the datatype if it is not a predefined type. /// -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void DataType::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Tclose(id); - if (ret_value < 0) - { - throw DataTypeIException(inMemFunc("close"), "H5Tclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Tclose(id); + if( ret_value < 0 ) + { + throw DataTypeIException(inMemFunc("close"), "H5Tclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: DataType destructor -///\brief Properly terminates access to this datatype. -// Programmer Binh-Minh Ribler - 2000 +// Function: DataType destructor +///\brief Properly terminates access to this datatype. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 -// - Added the use of H5CPP_EXITED to terminate the HDF5 library -// and elimiate previous memory leaks. See comments in the -// header file "H5PredType.h" for details. - BMR, Mar 30, 2012 -// - Major re-implementation of the global constants was done -// to avoid relying on the order of the creation and deletion -// of the global constants. Hence, H5CPP_EXITED was removed. -// See Design Notes in "H5PredType.cpp" for details. -// - BMR, Sep 30, 2015 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 +// - Added the use of H5CPP_EXITED to terminate the HDF5 library +// and elimiate previous memory leaks. See comments in the +// header file "H5PredType.h" for details. - BMR, Mar 30, 2012 +// - Major re-implementation of the global constants was done +// to avoid relying on the order of the creation and deletion +// of the global constants. Hence, H5CPP_EXITED was removed. +// See Design Notes in "H5PredType.cpp" for details. +// - BMR, Sep 30, 2015 //-------------------------------------------------------------------------- DataType::~DataType() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl; + cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl; } } } // end namespace diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index fd9c17d..4e904a6 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -30,128 +30,128 @@ namespace H5 { */ class H5_DLLCPP DataType : public H5Object { public: - // Creates a datatype given its class and size - DataType(const H5T_class_t type_class, size_t size); + // Creates a datatype given its class and size + DataType( const H5T_class_t type_class, size_t size ); - // Copy constructor: makes a copy of the original object - DataType(const DataType& original); + // Copy constructor: makes a copy of the original object + DataType( const DataType& original ); - // Creates a copy of a predefined type - DataType(const PredType& pred_type); + // Creates a copy of a predefined type + DataType(const PredType& pred_type); - // Creates a datatype by way of dereference. - DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); -// DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + // Creates a datatype by way of dereference. + DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); +// DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); - // Closes this datatype. - virtual void close(); + // Closes this datatype. + virtual void close(); - // Copies an existing datatype to this datatype object. - void copy(const DataType& like_type); + // Copies an existing datatype to this datatype object. + void copy(const DataType& like_type); - // Copies the datatype of dset to this datatype object. - void copy(const DataSet& dset); + // Copies the datatype of dset to this datatype object. + void copy(const DataSet& dset); - // Returns the datatype class identifier. - H5T_class_t getClass() const; + // Returns the datatype class identifier. + H5T_class_t getClass() const; - // Commits a transient datatype to a file; this datatype becomes - // a named datatype which can be accessed from the location. - void commit(const H5Location& loc, const char* name); - void commit(const H5Location& loc, const H5std_string& name); + // Commits a transient datatype to a file; this datatype becomes + // a named datatype which can be accessed from the location. + void commit(const H5Location& loc, const char* name); + void commit(const H5Location& loc, const H5std_string& name); - // These two overloaded functions are kept for backward compatibility - // only; they missed the const - removed from 1.8.18 and 1.10.1 - //void commit(H5Location& loc, const char* name); - //void commit(H5Location& loc, const H5std_string& name); + // These two overloaded functions are kept for backward compatibility + // only; they missed the const - removed from 1.8.18 and 1.10.1 + //void commit(H5Location& loc, const char* name); + //void commit(H5Location& loc, const H5std_string& name); - // Determines whether this datatype is a named datatype or - // a transient datatype. - bool committed() const; + // Determines whether this datatype is a named datatype or + // a transient datatype. + bool committed() const; // Finds a conversion function that can handle the conversion // this datatype to the given datatype, dest. - H5T_conv_t find(const DataType& dest, H5T_cdata_t **pcdata) const; + H5T_conv_t find( const DataType& dest, H5T_cdata_t **pcdata ) const; - // Converts data from between specified datatypes. - void convert(const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist=PropList::DEFAULT) const; + // Converts data from between specified datatypes. + void convert( const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist=PropList::DEFAULT) const; - // Assignment operator - DataType& operator=(const DataType& rhs); + // Assignment operator + DataType& operator=( const DataType& rhs ); - // Determines whether two datatypes are the same. - bool operator==(const DataType& compared_type) const; + // Determines whether two datatypes are the same. + bool operator==(const DataType& compared_type ) const; - // Locks a datatype. - void lock() const; + // Locks a datatype. + void lock() const; - // Returns the size of a datatype. - size_t getSize() const; + // Returns the size of a datatype. + size_t getSize() const; - // Returns the base datatype from which a datatype is derived. - // Note: not quite right for specific types yet??? - DataType getSuper() const; + // Returns the base datatype from which a datatype is derived. + // Note: not quite right for specific types yet??? + DataType getSuper() const; - // Registers a conversion function. - void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const; - void registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const; + // Registers a conversion function. + void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; + void registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const; - // Removes a conversion function from all conversion paths. - void unregister(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const; - void unregister(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const; + // Removes a conversion function from all conversion paths. + void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; + void unregister( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const; - // Tags an opaque datatype. - void setTag(const char* tag) const; - void setTag(const H5std_string& tag) const; + // Tags an opaque datatype. + void setTag( const char* tag ) const; + void setTag( const H5std_string& tag ) const; - // Gets the tag associated with an opaque datatype. - H5std_string getTag() const; + // Gets the tag associated with an opaque datatype. + H5std_string getTag() const; - // Checks whether this datatype contains (or is) a certain type class. - bool detectClass(H5T_class_t cls) const; + // Checks whether this datatype contains (or is) a certain type class. + bool detectClass(H5T_class_t cls) const; - // Checks whether this datatype is a variable-length string. - bool isVariableStr() const; + // Checks whether this datatype is a variable-length string. + bool isVariableStr() const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DataType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DataType"); } // From CommonFG then H5Location - // Constructors to open a generic named datatype at a given location. - DataType(const H5Location& loc, const char* name); - DataType(const H5Location& loc, const H5std_string& name); + // Constructors to open a generic named datatype at a given location. + DataType(const H5Location& loc, const char* name); + DataType(const H5Location& loc, const H5std_string& name); // End of From CommonFG then H5Location - // Creates a copy of an existing DataType using its id - DataType(const hid_t type_id); + // Creates a copy of an existing DataType using its id + DataType( const hid_t type_id ); - // Default constructor - DataType(); + // Default constructor + DataType(); - // Gets the datatype id. - virtual hid_t getId() const; + // Gets the datatype id. + virtual hid_t getId() const; - // Destructor: properly terminates access to this datatype. - virtual ~DataType(); + // Destructor: properly terminates access to this datatype. + virtual ~DataType(); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - hid_t id; // HDF5 datatype id + hid_t id; // HDF5 datatype id - // Sets the datatype id. - virtual void p_setId(const hid_t new_id); + // Sets the datatype id. + virtual void p_setId(const hid_t new_id); - // Opens a datatype and returns the id. - hid_t p_opentype(const H5Location& loc, const char* dtype_name) const; + // Opens a datatype and returns the id. + hid_t p_opentype(const H5Location& loc, const char* dtype_name) const; #endif // DOXYGEN_SHOULD_SKIP_THIS private: - // Friend function to set DataType id. For library use only. - friend void f_DataType_setId(DataType* dtype, hid_t new_id); + // Friend function to set DataType id. For library use only. + friend void f_DataType_setId(DataType* dtype, hid_t new_id); - void p_commit(hid_t loc_id, const char* name); + void p_commit(hid_t loc_id, const char* name); }; } #endif // __H5DataType_H diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 86d4d9c..8ab38dc 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -40,7 +40,7 @@ DSetCreatPropList* DSetCreatPropList::DEFAULT_ = 0; // Function: DSetCreatPropList::getConstant // Purpose: Creates a DSetCreatPropList object representing the HDF5 // constant H5P_DATASET_CREATE, pointed to by -// DSetCreatPropList::DEFAULT_ +// DSetCreatPropList::DEFAULT_ // exception H5::PropListIException // Description // If DSetCreatPropList::DEFAULT_ already points to an allocated @@ -80,670 +80,670 @@ void DSetCreatPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for dataset creation default property +// Purpose Constant for dataset creation default property //-------------------------------------------------------------------------- const DSetCreatPropList& DSetCreatPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DSetCreatPropList default constructor -///\brief Default constructor: creates a stub dataset creation property list -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList default constructor +///\brief Default constructor: creates a stub dataset creation property list +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList::DSetCreatPropList() : ObjCreatPropList(H5P_DATASET_CREATE) {} //-------------------------------------------------------------------------- -// Function: DSetCreatPropList copy constructor -///\brief Copy constructor: makes a copy of the original -/// DSetCreatPropList object -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList copy constructor +///\brief Copy constructor: makes a copy of the original +/// DSetCreatPropList object +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DSetCreatPropList::DSetCreatPropList(const DSetCreatPropList& orig) : ObjCreatPropList(orig) {} +DSetCreatPropList::DSetCreatPropList( const DSetCreatPropList& orig ) : ObjCreatPropList(orig) {} //-------------------------------------------------------------------------- -// Function: DSetCreatPropList overloaded constructor -///\brief Creates a DSetCreatPropList object using the id of an -/// existing dataset creation property list. -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList overloaded constructor +///\brief Creates a DSetCreatPropList object using the id of an +/// existing dataset creation property list. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList::DSetCreatPropList(const hid_t plist_id) : ObjCreatPropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setChunk -///\brief Sets the size of the chunks used to store a chunked layout -/// dataset. -///\param ndims - IN: Number of dimensions of each chunk -///\param dim - IN: Array containing the size of each chunk -///\exception H5::PropListIException +// Function: DSetCreatPropList::setChunk +///\brief Sets the size of the chunks used to store a chunked layout +/// dataset. +///\param ndims - IN: Number of dimensions of each chunk +///\param dim - IN: Array containing the size of each chunk +///\exception H5::PropListIException ///\par Description -/// The \a ndims parameter currently must have the same value as -/// the rank of the dataset. The values of the \a dim array -/// define the size of the chunks to store the dataset's raw -/// data. As a side-effect, the layout of the dataset will be -/// changed to \c H5D_CHUNKED, if it is not so already. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void DSetCreatPropList::setChunk(int ndims, const hsize_t* dim) const +/// The \a ndims parameter currently must have the same value as +/// the rank of the dataset. The values of the \a dim array +/// define the size of the chunks to store the dataset's raw +/// data. As a side-effect, the layout of the dataset will be +/// changed to \c H5D_CHUNKED, if it is not so already. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const { - herr_t ret_value = H5Pset_chunk(id, ndims, dim); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::setChunk", "H5Pset_chunk failed"); - } + herr_t ret_value = H5Pset_chunk( id, ndims, dim ); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::setChunk", "H5Pset_chunk failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getChunk -///\brief Retrieves the size of the chunks used to store a chunked -/// layout dataset. -///\param max_ndims - IN: Size of \a dim array -///\param dim - OUT: Array to store the chunk dimensions -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::getChunk +///\brief Retrieves the size of the chunks used to store a chunked +/// layout dataset. +///\param max_ndims - IN: Size of \a dim array +///\param dim - OUT: Array to store the chunk dimensions +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int DSetCreatPropList::getChunk(int max_ndims, hsize_t* dim) const +int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const { - int chunk_size = H5Pget_chunk(id, max_ndims, dim); - if (chunk_size < 0) - { - throw PropListIException("DSetCreatPropList::getChunk", - "H5Pget_chunk returns negative chunk size"); - } - return(chunk_size); + int chunk_size = H5Pget_chunk( id, max_ndims, dim ); + if( chunk_size < 0 ) + { + throw PropListIException("DSetCreatPropList::getChunk", + "H5Pget_chunk returns negative chunk size"); + } + return( chunk_size ); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setLayout -///\brief Sets the type of storage used store the raw data for a dataset. -///\param layout - IN: Type of storage layout for raw data -///\exception H5::PropListIException +// Function: DSetCreatPropList::setLayout +///\brief Sets the type of storage used store the raw data for a dataset. +///\param layout - IN: Type of storage layout for raw data +///\exception H5::PropListIException ///\par Description -/// For information on valid layout types, please refer to +/// For information on valid layout types, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLayout -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setLayout(H5D_layout_t layout) const { - herr_t ret_value = H5Pset_layout(id, layout); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::setLayout", - "H5Pset_layout failed"); - } + herr_t ret_value = H5Pset_layout( id, layout ); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::setLayout", + "H5Pset_layout failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getLayout -///\brief Retrieves the layout type of this property list -///\return Layout type, which can be: -/// \li \c H5D_COMPACT - raw data is stored in the object -/// header in the file. -/// \li \c H5D_CONTIGUOUS - raw data is stored separately from the -/// object header in one contiguous chunk in -/// the file. -/// \li \c H5D_CHUNKED - raw data is stored separately from the -/// object header in chunks in separate locations -/// in the file. -///\exception H5::PropListIException +// Function: DSetCreatPropList::getLayout +///\brief Retrieves the layout type of this property list +///\return Layout type, which can be: +/// \li \c H5D_COMPACT - raw data is stored in the object +/// header in the file. +/// \li \c H5D_CONTIGUOUS - raw data is stored separately from the +/// object header in one contiguous chunk in +/// the file. +/// \li \c H5D_CHUNKED - raw data is stored separately from the +/// object header in chunks in separate locations +/// in the file. +///\exception H5::PropListIException ///\par Description -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_layout_t DSetCreatPropList::getLayout() const { - H5D_layout_t layout = H5Pget_layout(id); - if (layout == H5D_LAYOUT_ERROR) - { - throw PropListIException("DSetCreatPropList::getLayout", - "H5Pget_layout returns H5D_LAYOUT_ERROR"); - } - return(layout); + H5D_layout_t layout = H5Pget_layout( id ); + if( layout == H5D_LAYOUT_ERROR ) + { + throw PropListIException("DSetCreatPropList::getLayout", + "H5Pget_layout returns H5D_LAYOUT_ERROR"); + } + return( layout ); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setDeflate -///\brief Sets compression method and compression level -///\param level - IN: Compression level, should [0..9], inclusive -///\exception H5::PropListIException +// Function: DSetCreatPropList::setDeflate +///\brief Sets compression method and compression level +///\param level - IN: Compression level, should [0..9], inclusive +///\exception H5::PropListIException ///\par Description -/// The function sets the compression method for this property -/// list to \c H5D_COMPRESS_DEFLATE and the compression level to -/// \a level. Lower compression levels are faster but result in -/// less compression. -// Programmer Binh-Minh Ribler - 2000 +/// The function sets the compression method for this property +/// list to \c H5D_COMPRESS_DEFLATE and the compression level to +/// \a level. Lower compression levels are faster but result in +/// less compression. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::setDeflate(int level) const +void DSetCreatPropList::setDeflate( int level ) const { - herr_t ret_value = H5Pset_deflate(id, level); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::setDeflate", - "H5Pset_deflate failed"); - } + herr_t ret_value = H5Pset_deflate( id, level ); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::setDeflate", + "H5Pset_deflate failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setSzip -///\brief Sets up for the use of the SZIP compression filter. -///\param options_mask - IN: A bit-mask conveying the desired SZIP -/// options. Valid values are H5_SZIP_EC_OPTION_MASK -/// and H5_SZIP_NN_OPTION_MASK. -///\param pixels_per_block - IN: Number of pixels or data elements in -/// each data block. -///\exception H5::PropListIException +// Function: DSetCreatPropList::setSzip +///\brief Sets up for the use of the SZIP compression filter. +///\param options_mask - IN: A bit-mask conveying the desired SZIP +/// options. Valid values are H5_SZIP_EC_OPTION_MASK +/// and H5_SZIP_NN_OPTION_MASK. +///\param pixels_per_block - IN: Number of pixels or data elements in +/// each data block. +///\exception H5::PropListIException ///\par Description -/// The associate C function sets an SZIP compression filter, -/// H5Z_FILTER_SZIP, for a dataset. For more information about -/// SZIP and usage, please refer to the C layer Reference -/// Manual at: +/// The associate C function sets an SZIP compression filter, +/// H5Z_FILTER_SZIP, for a dataset. For more information about +/// SZIP and usage, please refer to the C layer Reference +/// Manual at: /// http://hdfgroup.org/HDF5/doc/RM_H5P.html#Property-SetSzip -// Programmer Binh-Minh Ribler - Jan, 2007 +// Programmer Binh-Minh Ribler - Jan, 2007 //-------------------------------------------------------------------------- void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_per_block) const { herr_t ret_value = H5Pset_szip(id, options_mask, pixels_per_block); - if (ret_value < 0) + if( ret_value < 0 ) { - throw PropListIException("DSetCreatPropList::setSzip", - "H5Pset_szip failed"); + throw PropListIException("DSetCreatPropList::setSzip", + "H5Pset_szip failed"); } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setNbit -///\brief Sets up for the use of the Nbit compression filter. -///\exception H5::PropListIException +// Function: DSetCreatPropList::setNbit +///\brief Sets up for the use of the Nbit compression filter. +///\exception H5::PropListIException ///\par Description -/// The associate C function sets an Nbit compression filter, -/// H5Z_FILTER_NBIT, for a dataset. For more information about -/// Nbit compression, please refer to the C layer Reference -/// Manual at: +/// The associate C function sets an Nbit compression filter, +/// H5Z_FILTER_NBIT, for a dataset. For more information about +/// Nbit compression, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-setNbit -// Programmer Binh-Minh Ribler - Apr, 2016 +// Programmer Binh-Minh Ribler - Apr, 2016 //-------------------------------------------------------------------------- void DSetCreatPropList::setNbit() const { herr_t ret_value = H5Pset_nbit(id); - if (ret_value < 0) + if( ret_value < 0 ) { - throw PropListIException("DSetCreatPropList::setNbit", - "H5Pset_nbit failed"); + throw PropListIException("DSetCreatPropList::setNbit", + "H5Pset_nbit failed"); } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFillValue -///\brief Sets a dataset fill value -///\param fvalue_type - IN: Data type for the value passed via \a value -///\param value - IN: Pointer to buffer containing the fill value -///\exception H5::PropListIException +// Function: DSetCreatPropList::setFillValue +///\brief Sets a dataset fill value +///\param fvalue_type - IN: Data type for the value passed via \a value +///\param value - IN: Pointer to buffer containing the fill value +///\exception H5::PropListIException ///\par Description -/// The datatype may differ from that of the dataset, but it must -/// be one that the HDF5 library is able to convert \a value to -/// the dataset datatype when the dataset is created. -/// The default fill value is 0 (zero,) which is interpreted -/// according to the actual dataset datatype. +/// The datatype may differ from that of the dataset, but it must +/// be one that the HDF5 library is able to convert \a value to +/// the dataset datatype when the dataset is created. +/// The default fill value is 0 (zero,) which is interpreted +/// according to the actual dataset datatype. ///\par -/// For information on setting fill value, please refer to the -/// C layer Reference Manual at: +/// For information on setting fill value, please refer to the +/// C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFillValue -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::setFillValue(const DataType& fvalue_type, const void* value) const +void DSetCreatPropList::setFillValue( const DataType& fvalue_type, const void* value ) const { - herr_t ret_value = H5Pset_fill_value(id, fvalue_type.getId(), value); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::setFillValue", + herr_t ret_value = H5Pset_fill_value( id, fvalue_type.getId(), value ); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::setFillValue", "H5Pset_fill_value failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFillValue -///\brief Retrieves a dataset fill value -///\param fvalue_type - IN: Data type for the value passed via \a value -///\param value - OUT: Pointer to buffer to hold the retrieved fill value -///\exception H5::PropListIException +// Function: DSetCreatPropList::getFillValue +///\brief Retrieves a dataset fill value +///\param fvalue_type - IN: Data type for the value passed via \a value +///\param value - OUT: Pointer to buffer to hold the retrieved fill value +///\exception H5::PropListIException ///\par Description -/// The fill value is returned through \a value pointer -/// and the memory is allocated by the caller. The fill -/// value will be converted from its current data type to the -/// specified by \a fvalue_type. -// Programmer Binh-Minh Ribler - 2000 +/// The fill value is returned through \a value pointer +/// and the memory is allocated by the caller. The fill +/// value will be converted from its current data type to the +/// specified by \a fvalue_type. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::getFillValue(const DataType& fvalue_type, void* value) const +void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value ) const { - herr_t ret_value = H5Pget_fill_value(id, fvalue_type.getId(), value); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::getFillValue", + herr_t ret_value = H5Pget_fill_value( id, fvalue_type.getId(), value ); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::getFillValue", "H5Pget_fill_value failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::isFillValueDefined -///\brief Check if fill value has been defined for this property +// Function: DSetCreatPropList::isFillValueDefined +///\brief Check if fill value has been defined for this property ///\return -/// \li \c H5D_FILL_VALUE_UNDEFINED =0, -/// \li \c H5D_FILL_VALUE_DEFAULT =1, -/// \li \c H5D_FILL_VALUE_USER_DEFINED =2 -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +/// \li \c H5D_FILL_VALUE_UNDEFINED =0, +/// \li \c H5D_FILL_VALUE_DEFAULT =1, +/// \li \c H5D_FILL_VALUE_USER_DEFINED =2 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_fill_value_t DSetCreatPropList::isFillValueDefined() const { - H5D_fill_value_t status; - herr_t ret_value = H5Pfill_value_defined(id, &status); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::isFillValueDefined", + H5D_fill_value_t status; + herr_t ret_value = H5Pfill_value_defined(id, &status); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::isFillValueDefined", "H5Pfill_value_defined returned H5D_FILL_VALUE_ERROR (-1)"); - } - else - return (status); + } + else + return (status); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFilter -///\brief Adds a filter to the filter pipeline -///\param filter_id - IN: Filter to add -///\param flags - IN: Specifies general properties of the filter -///\param cd_nelmts - IN: Number of elements in cd_values -///\param cd_values - IN: Auxiliary data for the filter -///\exception H5::PropListIException +// Function: DSetCreatPropList::setFilter +///\brief Adds a filter to the filter pipeline +///\param filter_id - IN: Filter to add +///\param flags - IN: Specifies general properties of the filter +///\param cd_nelmts - IN: Number of elements in cd_values +///\param cd_values - IN: Auxiliary data for the filter +///\exception H5::PropListIException ///\par Description -/// The \a flags argument is a bit vector of the field: -/// \c H5Z_FLAG_OPTIONAL(0x0001) +/// The \a flags argument is a bit vector of the field: +/// \c H5Z_FLAG_OPTIONAL(0x0001) ///\par -/// If this bit is set then the filter is optional. If the filter -/// fails during a \c DataSet::write() operation then the filter -/// is just excluded from the pipeline for the chunk for which it -/// failed; the filter will not participate in the pipeline -/// during a \c DataSet::read() of the chunk. If this bit is clear -/// and the filter fails then the entire I/O operation fails. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void DSetCreatPropList::setFilter(H5Z_filter_t filter_id, unsigned int flags, - size_t cd_nelmts, const unsigned int cd_values[]) const +/// If this bit is set then the filter is optional. If the filter +/// fails during a \c DataSet::write() operation then the filter +/// is just excluded from the pipeline for the chunk for which it +/// failed; the filter will not participate in the pipeline +/// during a \c DataSet::read() of the chunk. If this bit is clear +/// and the filter fails then the entire I/O operation fails. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DSetCreatPropList::setFilter( H5Z_filter_t filter_id, unsigned int flags, + size_t cd_nelmts, const unsigned int cd_values[] ) const { - herr_t ret_value = H5Pset_filter(id, filter_id, flags, cd_nelmts, cd_values); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::setFilter", + herr_t ret_value = H5Pset_filter( id, filter_id, flags, cd_nelmts, cd_values ); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::setFilter", "H5Pset_filter failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::removeFilter -///\brief Removes one or more filters -///\param filter_id - IN: Filter to remove -///\exception H5::PropListIException +// Function: DSetCreatPropList::removeFilter +///\brief Removes one or more filters +///\param filter_id - IN: Filter to remove +///\exception H5::PropListIException ///\par Description -/// Deletes a filter from the dataset creation property list; -/// deletes all filters if \a filter_id is \c H5Z_FILTER_NONE. -// Programmer Binh-Minh Ribler - 2000 +/// Deletes a filter from the dataset creation property list; +/// deletes all filters if \a filter_id is \c H5Z_FILTER_NONE. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id) const { - herr_t ret_value = H5Premove_filter(id, filter_id); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::removeFilter", + herr_t ret_value = H5Premove_filter( id, filter_id); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::removeFilter", "H5Premove_filter failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getNfilters -///\brief Returns the number of filters in the pipeline -///\return Number of filters -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::getNfilters +///\brief Returns the number of filters in the pipeline +///\return Number of filters +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DSetCreatPropList::getNfilters() const { - int num_filters = H5Pget_nfilters(id); - if (num_filters < 0) - { - throw PropListIException("DSetCreatPropList::getNfilters", + int num_filters = H5Pget_nfilters( id ); + if( num_filters < 0 ) + { + throw PropListIException("DSetCreatPropList::getNfilters", "H5Pget_nfilters returned negative number of filters"); - } - else - return(num_filters); + } + else + return( num_filters ); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFilter -///\brief Returns information about a filter in a pipeline -///\param filter_number - IN: Filter to get, range [0..N-1], where -/// N is returned by H5Pget_nfilters() -///\param flags - OUT: General properties of the filter -///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number -/// of values defined by the filter -///\param cd_values - OUT: Array to hold the data; allocated by the user -///\param namelen - IN: Length of \a name -///\param name - OUT: Name of the filter -///\param filter_config - OUT: Flags indicating whether filter can encode/decode -///\return Filter id -///\exception H5::PropListIException +// Function: DSetCreatPropList::getFilter +///\brief Returns information about a filter in a pipeline +///\param filter_number - IN: Filter to get, range [0..N-1], where +/// N is returned by H5Pget_nfilters() +///\param flags - OUT: General properties of the filter +///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number +/// of values defined by the filter +///\param cd_values - OUT: Array to hold the data; allocated by the user +///\param namelen - IN: Length of \a name +///\param name - OUT: Name of the filter +///\param filter_config - OUT: Flags indicating whether filter can encode/decode +///\return Filter id +///\exception H5::PropListIException ///\par Description -/// Failure occurs when \a filter_number is out of range. -// Note: the first argument was mistakenly typed as int instead -// of unsigned int, but for backward compatibility, it cannot be -// changed. -BMR (2014/04/15) +/// Failure occurs when \a filter_number is out of range. +// Note: the first argument was mistakenly typed as int instead +// of unsigned int, but for backward compatibility, it cannot be +// changed. -BMR (2014/04/15) //-------------------------------------------------------------------------- H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, - unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, - size_t namelen, char name[], unsigned int& filter_config) const + unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, + size_t namelen, char name[], unsigned int& filter_config) const { - H5Z_filter_t filter_id; - filter_id = H5Pget_filter2(id, filter_number, &flags, &cd_nelmts, - cd_values, namelen, name, &filter_config); - if (filter_id == H5Z_FILTER_ERROR) - throw PropListIException("DSetCreatPropList::getFilter", + H5Z_filter_t filter_id; + filter_id = H5Pget_filter2(id, filter_number, &flags, &cd_nelmts, + cd_values, namelen, name, &filter_config); + if( filter_id == H5Z_FILTER_ERROR ) + throw PropListIException("DSetCreatPropList::getFilter", "H5Pget_filter2 returned H5Z_FILTER_ERROR"); - else - return(filter_id); + else + return(filter_id); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFilterById -///\brief Returns information about a filter in a pipeline given the -/// filter id -///\param filter_id - IN: Filter to get -///\param flags - OUT: General properties of the filter -///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number -/// of values defined by the filter -///\param cd_values - OUT: Array to hold the data; allocated by the user -///\param namelen - IN: Length of \a name -///\param name - OUT: Name of the filter -///\param filter_config - OUT: Flags indicating whether filter can encode/decode -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::getFilterById +///\brief Returns information about a filter in a pipeline given the +/// filter id +///\param filter_id - IN: Filter to get +///\param flags - OUT: General properties of the filter +///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number +/// of values defined by the filter +///\param cd_values - OUT: Array to hold the data; allocated by the user +///\param namelen - IN: Length of \a name +///\param name - OUT: Name of the filter +///\param filter_config - OUT: Flags indicating whether filter can encode/decode +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id, - unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, - size_t namelen, char name[], unsigned int &filter_config) const + unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, + size_t namelen, char name[], unsigned int &filter_config) const { - herr_t ret_value = H5Pget_filter_by_id2(id, filter_id, &flags, &cd_nelmts, - cd_values, namelen, name, &filter_config); - if (ret_value < 0) - throw PropListIException("DSetCreatPropList::getFilterById", + herr_t ret_value = H5Pget_filter_by_id2(id, filter_id, &flags, &cd_nelmts, + cd_values, namelen, name, &filter_config); + if (ret_value < 0) + throw PropListIException("DSetCreatPropList::getFilterById", "H5Pget_filter_by_id2 failed"); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::modifyFilter -///\brief Modifies the specified filter -///\param filter_id - IN: Filter to get -///\param flags - OUT: General properties of the filter -///\param cd_nelmts - IN: Number of elements in \a cd_values -/// \n OUT: Number of values defined by the filter -///\param cd_values - OUT: Array to hold the data; allocated by the user -///\exception H5::PropListIException +// Function: DSetCreatPropList::modifyFilter +///\brief Modifies the specified filter +///\param filter_id - IN: Filter to get +///\param flags - OUT: General properties of the filter +///\param cd_nelmts - IN: Number of elements in \a cd_values +/// \n OUT: Number of values defined by the filter +///\param cd_values - OUT: Array to hold the data; allocated by the user +///\exception H5::PropListIException ///\par Description -/// The \a flags argument is a bit vector of the field: -/// \c H5Z_FLAG_OPTIONAL(0x0001) +/// The \a flags argument is a bit vector of the field: +/// \c H5Z_FLAG_OPTIONAL(0x0001) ///\par -/// If this bit is set then the filter is optional. If the filter -/// fails during a DataSet::write() operation then the filter -/// is just excluded from the pipeline for the chunk for which it -/// failed; the filter will not participate in the pipeline -/// during a DataSet::read() of the chunk. If this bit is clear -/// and the filter fails then the entire I/O operation fails. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void DSetCreatPropList::modifyFilter(H5Z_filter_t filter_id, unsigned int - flags, size_t cd_nelmts, const unsigned int cd_values[]) const +/// If this bit is set then the filter is optional. If the filter +/// fails during a DataSet::write() operation then the filter +/// is just excluded from the pipeline for the chunk for which it +/// failed; the filter will not participate in the pipeline +/// during a DataSet::read() of the chunk. If this bit is clear +/// and the filter fails then the entire I/O operation fails. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DSetCreatPropList::modifyFilter( H5Z_filter_t filter_id, unsigned int + flags, size_t cd_nelmts, const unsigned int cd_values[] ) const { - herr_t ret_value = H5Pmodify_filter(id, filter_id, flags, cd_nelmts, cd_values); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::modifyFilter", + herr_t ret_value = H5Pmodify_filter(id, filter_id, flags, cd_nelmts, cd_values); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::modifyFilter", "H5Pmodify_filter failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::allFiltersAvail -///\brief Queries whether all the filters set in this property list -/// are available currently. -///\return true if all filters available, and false if one or more -/// filters not currently available -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::allFiltersAvail +///\brief Queries whether all the filters set in this property list +/// are available currently. +///\return true if all filters available, and false if one or more +/// filters not currently available +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DSetCreatPropList::allFiltersAvail() const { - htri_t ret_value = H5Pall_filters_avail(id); - if (ret_value > 0) - return true; - else if (ret_value == 0) - return false; - else // Raise exception when H5Pall_filters_avail returns a negative value - { - throw PropListIException("DSetCreatPropList::allFiltersAvail", "H5Pall_filters_avail returned negative value"); - } + htri_t ret_value = H5Pall_filters_avail(id); + if( ret_value > 0 ) + return true; + else if( ret_value == 0 ) + return false; + else // Raise exception when H5Pall_filters_avail returns a negative value + { + throw PropListIException("DSetCreatPropList::allFiltersAvail", "H5Pall_filters_avail returned negative value"); + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setShuffle -///\brief Sets method of the shuffle filter +// Function: DSetCreatPropList::setShuffle +///\brief Sets method of the shuffle filter /// -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// Please refer to the Reference Manual of \c H5Pset_shuffle for -/// details. +/// Please refer to the Reference Manual of \c H5Pset_shuffle for +/// details. /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetShuffle -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setShuffle() const { - herr_t ret_value = H5Pset_shuffle(id); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::setShuffle", + herr_t ret_value = H5Pset_shuffle(id); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::setShuffle", "H5Pset_shuffle failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getAllocTime -///\brief Get space allocation time for this property. -///\return Space allocation time. -///\exception H5::PropListIException +// Function: DSetCreatPropList::getAllocTime +///\brief Get space allocation time for this property. +///\return Space allocation time. +///\exception H5::PropListIException ///\par Description -/// The values of space allocation time can be one of the -/// followings: -/// \li \c H5D_ALLOC_TIME_DEFAULT -/// \li \c H5D_ALLOC_TIME_EARLY -/// \li \c H5D_ALLOC_TIME_LATE -/// \li \c H5D_ALLOC_TIME_INCR -// Programmer Binh-Minh Ribler - 2000 +/// The values of space allocation time can be one of the +/// followings: +/// \li \c H5D_ALLOC_TIME_DEFAULT +/// \li \c H5D_ALLOC_TIME_EARLY +/// \li \c H5D_ALLOC_TIME_LATE +/// \li \c H5D_ALLOC_TIME_INCR +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_alloc_time_t DSetCreatPropList::getAllocTime() const { - H5D_alloc_time_t alloc_time; - herr_t ret_value = H5Pget_alloc_time(id, &alloc_time); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::getAllocTime", + H5D_alloc_time_t alloc_time; + herr_t ret_value = H5Pget_alloc_time(id, &alloc_time); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::getAllocTime", "H5Pget_alloc_time failed"); - } - else - return (alloc_time); + } + else + return (alloc_time); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFillTime -///\brief Gets fill value writing time. -///\return Fill value writing time -///\exception H5::PropListIException +// Function: DSetCreatPropList::getFillTime +///\brief Gets fill value writing time. +///\return Fill value writing time +///\exception H5::PropListIException ///\par Description -/// Valid values for fill value writing time include -/// \li \c H5D_FILL_TIME_NEVER -/// \li \c H5D_FILL_TIME_ALLOC. -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for fill value writing time include +/// \li \c H5D_FILL_TIME_NEVER +/// \li \c H5D_FILL_TIME_ALLOC. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_fill_time_t DSetCreatPropList::getFillTime() const { - H5D_fill_time_t fill_time; - herr_t ret_value = H5Pget_fill_time(id, &fill_time); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::getFillTime", + H5D_fill_time_t fill_time; + herr_t ret_value = H5Pget_fill_time(id, &fill_time); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::getFillTime", "H5Pget_fill_time failed"); - } - else - return (fill_time); + } + else + return (fill_time); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setAllocTime -///\brief Sets space allocation time for dataset during creation. -///\param alloc_time - IN: Allocation time -///\exception H5::PropListIException +// Function: DSetCreatPropList::setAllocTime +///\brief Sets space allocation time for dataset during creation. +///\param alloc_time - IN: Allocation time +///\exception H5::PropListIException ///\par Description -/// Valid values for space allocation time include: -/// \li \c H5D_ALLOC_TIME_DEFAULT -/// \li \c H5D_ALLOC_TIME_EARLY -/// \li \c H5D_ALLOC_TIME_LATE -/// \li \c H5D_ALLOC_TIME_INCR -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for space allocation time include: +/// \li \c H5D_ALLOC_TIME_DEFAULT +/// \li \c H5D_ALLOC_TIME_EARLY +/// \li \c H5D_ALLOC_TIME_LATE +/// \li \c H5D_ALLOC_TIME_INCR +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time) const { - herr_t ret_value = H5Pset_alloc_time(id, alloc_time); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::setAllocTime", + herr_t ret_value = H5Pset_alloc_time(id, alloc_time); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::setAllocTime", "H5Pset_alloc_time failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFillTime -///\brief Sets fill value writing time for dataset. -///\return Fill value writing time -///\exception H5::PropListIException +// Function: DSetCreatPropList::setFillTime +///\brief Sets fill value writing time for dataset. +///\return Fill value writing time +///\exception H5::PropListIException ///\par Description -/// Valid values for fill value writing time include -/// \li \c H5D_FILL_TIME_NEVER -/// \li \c H5D_FILL_TIME_ALLOC. -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for fill value writing time include +/// \li \c H5D_FILL_TIME_NEVER +/// \li \c H5D_FILL_TIME_ALLOC. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time) const { - herr_t ret_value = H5Pset_fill_time(id, fill_time); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::setFillTime", + herr_t ret_value = H5Pset_fill_time(id, fill_time); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::setFillTime", "H5Pset_fill_time failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFletcher32 -///\brief Sets Fletcher32 checksum of EDC for this property list. +// Function: DSetCreatPropList::setFletcher32 +///\brief Sets Fletcher32 checksum of EDC for this property list. /// -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFletcher32() const { - herr_t ret_value = H5Pset_fletcher32(id); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::setFletcher32", + herr_t ret_value = H5Pset_fletcher32(id); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::setFletcher32", "H5Pset_fletcher32 failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setExternal -///\brief Adds an external file to the list of external files -///\param name - IN: Name of the external file -///\param offset - IN: Location where the data starts in the file -///\param size - IN: Number of bytes reserved in the file for the data -///\exception H5::PropListIException +// Function: DSetCreatPropList::setExternal +///\brief Adds an external file to the list of external files +///\param name - IN: Name of the external file +///\param offset - IN: Location where the data starts in the file +///\param size - IN: Number of bytes reserved in the file for the data +///\exception H5::PropListIException ///\par Description -/// If a dataset is splitted across multiple files then the files -/// should be defined in order. The total size of the dataset is -/// the sum of the \a size arguments for all the external files. If -/// the total size is larger than the size of a dataset then the -/// dataset can be extended (provided the data space also allows -/// the extending). -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void DSetCreatPropList::setExternal(const char* name, off_t offset, hsize_t size) const +/// If a dataset is splitted across multiple files then the files +/// should be defined in order. The total size of the dataset is +/// the sum of the \a size arguments for all the external files. If +/// the total size is larger than the size of a dataset then the +/// dataset can be extended (provided the data space also allows +/// the extending). +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t size ) const { - herr_t ret_value = H5Pset_external(id, name, offset, size); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::setExternal", + herr_t ret_value = H5Pset_external( id, name, offset, size ); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::setExternal", "H5Pset_external failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getExternalCount -///\brief Returns the number of external files for a dataset -///\return Number of external files -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetCreatPropList::getExternalCount +///\brief Returns the number of external files for a dataset +///\return Number of external files +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DSetCreatPropList::getExternalCount() const { - int num_ext_files = H5Pget_external_count(id); - if (num_ext_files < 0) - { - throw PropListIException("DSetCreatPropList::getExternalCount", + int num_ext_files = H5Pget_external_count( id ); + if( num_ext_files < 0 ) + { + throw PropListIException("DSetCreatPropList::getExternalCount", "H5Pget_external_count returns negative number of external files"); - } - else - return(num_ext_files); + } + else + return( num_ext_files ); } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getExternal -///\brief Returns information about an external file -///\param idx - IN: Index of the external file, ranges [0-(N-1)] and -/// returned by getExternalCount() -///\param name_size - IN: Maximum length of \a name -///\param name - OUT: Name of the external file -///\param offset - OUT: Location to return an offset value -///\param size - OUT: Location to return the size of the external file data -///\exception H5::PropListIException +// Function: DSetCreatPropList::getExternal +///\brief Returns information about an external file +///\param idx - IN: Index of the external file, ranges [0-(N-1)] and +/// returned by getExternalCount() +///\param name_size - IN: Maximum length of \a name +///\param name - OUT: Name of the external file +///\param offset - OUT: Location to return an offset value +///\param size - OUT: Location to return the size of the external file data +///\exception H5::PropListIException ///\par Description -/// The parameter \a idx ranges [0..N-1] where N is returned by -/// getExternalCount(). At most \a name_size characters are copied -/// into the name array. If the external file name is longer than -/// name_size with the null terminator, the return value is not -/// null terminated (similar to strncpy()). -/// If \a name_size is zero or \a name is a null pointer, the -/// external file name will not be returned. If \a offset or -/// \a size are null pointers then the corresponding information -/// will not be returned. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void DSetCreatPropList::getExternal(unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size) const +/// The parameter \a idx ranges [0..N-1] where N is returned by +/// getExternalCount(). At most \a name_size characters are copied +/// into the name array. If the external file name is longer than +/// name_size with the null terminator, the return value is not +/// null terminated (similar to strncpy()). +/// If \a name_size is zero or \a name is a null pointer, the +/// external file name will not be returned. If \a offset or +/// \a size are null pointers then the corresponding information +/// will not be returned. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DSetCreatPropList::getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const { - herr_t ret_value = H5Pget_external(id, idx, name_size, name, &offset, &size); - if (ret_value < 0) - { - throw PropListIException("DSetCreatPropList::getExternal", + herr_t ret_value = H5Pget_external( id, idx, name_size, name, &offset, &size ); + if( ret_value < 0 ) + { + throw PropListIException("DSetCreatPropList::getExternal", "H5Pget_external failed"); - } + } } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList destructor -///\brief Noop destructor. +// Function: DSetCreatPropList destructor +///\brief Noop destructor. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DSetCreatPropList::~DSetCreatPropList() {} +DSetCreatPropList::~DSetCreatPropList () {} } // end namespace diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 096a3d3..60ce1d5 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -29,87 +29,118 @@ class DataType; */ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { public: - ///\brief Default dataset creation property list. - static const DSetCreatPropList& DEFAULT; - - // Creates a // Creates a dataset creation property list. - DSetCreatPropList(); -hether all the // Queries whether all the filters set in this property list are - // available currently. - bool allFiltersAvail() const; -me for this property. - // Get space allocation time for this property. - H5D_alloc_time_t getAllocTime() const; - creation. - voi // Set space allocation time for dataset during creation. - void setAllocTime(H5D_alloc_time_t alloc_time) const; -ayout dataset. - // Retrieves the size of the chunks used to store a chunked layout dataset. - int getChunk(int max_ndims, hsize_t* dim) const; -d setChunk( i // Sets the size of the chunks used to store a chunked layout dataset. - void setChunk(int ndims, const hsize_t* dim) const; -name_size, ch // Returns information about an external file. - void getExternal(unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size) const; -l value writi // Returns the number of external files for a dataset. - int getExternalCount() const; -taset. - void se // Gets fill value writing time. - H5D_fill_time_t getFillTime() const; -l value. - void // Sets fill value writing time for dataset. - void setFillTime(H5D_fill_time_t fill_time) const; -oid setFillValu // Retrieves a dataset fill value. - void getFillValue(const DataType& fvalue_type, void* value) const; -peline. - H5Z_ // Sets a dataset fill value. - void setFillValue(const DataType& fvalue_type, const void* value) const; -_t namelen, c // Returns information about a filter in a pipeline. - H5Z_filter_t getFilter(int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const; -ues, size_t nam // Returns information about a filter in a pipeline given the filter id. - void getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const; -dataset that us // Gets the layout of the raw data storage of the data that uses this - // property list. - H5D_layout_t getLayout() const; - getNfilters() const; - // Sets the type of storage used to store the raw data for the - // dataset that uses this property list. - void setLayout(H5D_layout_t layout) const; -modifyFilter( H5Z_filt // Returns the number of filters in the pipeline. - int getNfilters() const; -alues[] ) const // Checks if fill value has been defined for this property. - H5D_fill_value_t isFillValueDefined() const; -t; - - // Sets co // Modifies the specified filter. - void modifyFilter(H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[]) const; -st char* name // Remove one or all filters from the filter pipeline. - void removeFilter(H5Z_filter_t filter_id) const; -r_t filter, un // Sets compression method and compression level. - void setDeflate(int level) const; -; - - // Sets F // Adds an external file to the list of external files. - void setExternal(const char* name, off_t offset, hsize_t size) const; -uffle() const // Adds a filter to the filter pipeline. - void setFilter(H5Z_filter_t filter, unsigned int flags = 0, size_t cd_nelmts = 0, const unsigned int cd_values[] = NULL) const; -t; - - ///\brief // Sets Fletcher32 checksum of EDC for this property list. - void setFletcher32() const; -pList"); } - - // // Sets method of the shuffle filter. - void setShuffle() const; - DSetCreatPropL // Sets SZIP compression method. - void setSzip(unsigned int options_mask, unsigned int pixels_per_block) const; -he property lis // Sets N-bit compression method. - void setNbit() const; -destructor. - vi ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DSetCreatPropList"); } -only be used by // Copy constructor: creates a copy of a DSetCreatPropList object. - DSetCreatPropList(const DSetCreatPropList& orig); -tes the global // Creates a copy of an existing dataset creation property list - // using the property list id. - DSetCreatPropList(const hid_t plist_id); -if // __H5DSCreatPropList_H + ///\brief Default dataset creation property list. + static const DSetCreatPropList& DEFAULT; + + // Creates a dataset creation property list. + DSetCreatPropList(); + + // Queries whether all the filters set in this property list are + // available currently. + bool allFiltersAvail() const; + + // Get space allocation time for this property. + H5D_alloc_time_t getAllocTime() const; + + // Set space allocation time for dataset during creation. + void setAllocTime(H5D_alloc_time_t alloc_time) const; + + // Retrieves the size of the chunks used to store a chunked layout dataset. + int getChunk( int max_ndims, hsize_t* dim ) const; + + // Sets the size of the chunks used to store a chunked layout dataset. + void setChunk( int ndims, const hsize_t* dim ) const; + + // Returns information about an external file. + void getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const; + + // Returns the number of external files for a dataset. + int getExternalCount() const; + + // Gets fill value writing time. + H5D_fill_time_t getFillTime() const; + + // Sets fill value writing time for dataset. + void setFillTime(H5D_fill_time_t fill_time) const; + + // Retrieves a dataset fill value. + void getFillValue( const DataType& fvalue_type, void* value ) const; + + // Sets a dataset fill value. + void setFillValue( const DataType& fvalue_type, const void* value ) const; + + // Returns information about a filter in a pipeline. + H5Z_filter_t getFilter(int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const; + + // Returns information about a filter in a pipeline given the filter id. + void getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const; + + // Gets the layout of the raw data storage of the data that uses this + // property list. + H5D_layout_t getLayout() const; + + // Sets the type of storage used to store the raw data for the + // dataset that uses this property list. + void setLayout(H5D_layout_t layout) const; + + // Returns the number of filters in the pipeline. + int getNfilters() const; + + // Checks if fill value has been defined for this property. + H5D_fill_value_t isFillValueDefined() const; + + // Modifies the specified filter. + void modifyFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const; + + // Remove one or all filters from the filter pipeline. + void removeFilter( H5Z_filter_t filter_id) const; + + // Sets compression method and compression level. + void setDeflate( int level ) const; + + // Adds an external file to the list of external files. + void setExternal( const char* name, off_t offset, hsize_t size ) const; + + // Adds a filter to the filter pipeline. + void setFilter( H5Z_filter_t filter, unsigned int flags = 0, size_t cd_nelmts = 0, const unsigned int cd_values[] = NULL) const; + + // Sets Fletcher32 checksum of EDC for this property list. + void setFletcher32() const; + + // Sets method of the shuffle filter. + void setShuffle() const; + + // Sets SZIP compression method. + void setSzip(unsigned int options_mask, unsigned int pixels_per_block) const; + + // Sets N-bit compression method. + void setNbit() const; + + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DSetCreatPropList"); } + + // Copy constructor: creates a copy of a DSetCreatPropList object. + DSetCreatPropList(const DSetCreatPropList& orig); + + // Creates a copy of an existing dataset creation property list + // using the property list id. + DSetCreatPropList(const hid_t plist_id); + + // Noop destructor. + virtual ~DSetCreatPropList(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + + // Deletes the global constant, should only be used by the library + static void deleteConstants(); + + private: + static DSetCreatPropList* DEFAULT_; + + // Creates the global constant, should only be used by the library + static DSetCreatPropList* getConstant(); + +#endif // DOXYGEN_SHOULD_SKIP_THIS +}; +} +#endif // __H5DSCreatPropList_H diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index e018ff2..8746d35 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -15,7 +15,7 @@ #include -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -36,7 +36,7 @@ DSetMemXferPropList* DSetMemXferPropList::DEFAULT_ = 0; // Function: DSetMemXferPropList::getConstant // Creates a DSetMemXferPropList object representing the HDF5 // constant H5P_DATASET_XFER, pointed to by -// DSetMemXferPropList::DEFAULT_ +// DSetMemXferPropList::DEFAULT_ // exception H5::PropListIException // Description // If DSetMemXferPropList::DEFAULT_ already points to an allocated @@ -76,25 +76,25 @@ void DSetMemXferPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for default dataset memory and transfer property list. +// Purpose Constant for default dataset memory and transfer property list. //-------------------------------------------------------------------------- const DSetMemXferPropList& DSetMemXferPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function DSetMemXferPropList default constructor -///\brief Default constructor: creates a stub dataset memory and -/// transfer property list object. -// Programmer Binh-Minh Ribler - 2000 +// Function DSetMemXferPropList default constructor +///\brief Default constructor: creates a stub dataset memory and +/// transfer property list object. +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetMemXferPropList::DSetMemXferPropList() : PropList(H5P_DATASET_XFER) {} //-------------------------------------------------------------------------- -// Function DSetMemXferPropList constructor -///\brief Creates a dataset transfer property list with transform -/// expression. -// Programmer Binh-Minh Ribler - 2000 +// Function DSetMemXferPropList constructor +///\brief Creates a dataset transfer property list with transform +/// expression. +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetMemXferPropList::DSetMemXferPropList(const char* exp) : PropList(H5P_DATASET_XFER) { @@ -102,164 +102,164 @@ DSetMemXferPropList::DSetMemXferPropList(const char* exp) : PropList(H5P_DATASET } //-------------------------------------------------------------------------- -// Function DSetMemXferPropList copy constructor -///\brief Copy constructor: makes a copy of the original -/// DSetMemXferPropList object -///\param original - IN: Original dataset memory and transfer property -/// list object to copy -// Programmer Binh-Minh Ribler - 2000 +// Function DSetMemXferPropList copy constructor +///\brief Copy constructor: makes a copy of the original +/// DSetMemXferPropList object +///\param original - IN: Original dataset memory and transfer property +/// list object to copy +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList& original) : PropList(original ) {} +DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList& original ) : PropList( original ) {} //-------------------------------------------------------------------------- -// Function DSetMemXferPropList overloaded constructor -///\brief Creates a DSetMemXferPropList object using the id of an -/// existing DSetMemXferPropList. -///\param plist_id - IN: Id of an existing dataset memory and transfer -/// property list -// Programmer Binh-Minh Ribler - 2000 +// Function DSetMemXferPropList overloaded constructor +///\brief Creates a DSetMemXferPropList object using the id of an +/// existing DSetMemXferPropList. +///\param plist_id - IN: Id of an existing dataset memory and transfer +/// property list +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetMemXferPropList::DSetMemXferPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setBuffer -///\brief Sets type conversion and background buffers. -///\param size - IN: Size, in bytes, of the type conversion and background buffers -///\param tconv - IN: Pointer to application-allocated type conversion buffer -///\param bkg - IN: Pointer to application-allocated background buffer -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::setBuffer +///\brief Sets type conversion and background buffers. +///\param size - IN: Size, in bytes, of the type conversion and background buffers +///\param tconv - IN: Pointer to application-allocated type conversion buffer +///\param bkg - IN: Pointer to application-allocated background buffer +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setBuffer(size_t size, void* tconv, void* bkg) const +void DSetMemXferPropList::setBuffer( size_t size, void* tconv, void* bkg ) const { - herr_t ret_value = H5Pset_buffer(id, size, tconv, bkg); - if(ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setBuffer", - "H5Pset_buffer failed"); - } + herr_t ret_value = H5Pset_buffer( id, size, tconv, bkg ); + if( ret_value < 0 ) + { + throw PropListIException("DSetMemXferPropList::setBuffer", + "H5Pset_buffer failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getBuffer -///\brief Reads buffer settings. -///\param tconv - OUT: Pointer to application-allocated type conversion buf -///\param bkg - OUT: Pointer to application-allocated background buffer -///\return Buffer size, in bytes -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::getBuffer +///\brief Reads buffer settings. +///\param tconv - OUT: Pointer to application-allocated type conversion buf +///\param bkg - OUT: Pointer to application-allocated background buffer +///\return Buffer size, in bytes +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -size_t DSetMemXferPropList::getBuffer(void** tconv, void** bkg) const +size_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const { - size_t buffer_size = H5Pget_buffer(id, tconv, bkg); - if(buffer_size == 0) - { - throw PropListIException("DSetMemXferPropList::getBuffer", - "H5Pget_buffer returned 0 for buffer size - failure"); - } - return(buffer_size); + size_t buffer_size = H5Pget_buffer( id, tconv, bkg ); + if( buffer_size == 0 ) + { + throw PropListIException("DSetMemXferPropList::getBuffer", + "H5Pget_buffer returned 0 for buffer size - failure"); + } + return( buffer_size ); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setPreserve -///\brief Sets the dataset transfer property list status to true or false. -///\param status - IN: Status to set, true or false -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::setPreserve +///\brief Sets the dataset transfer property list status to true or false. +///\param status - IN: Status to set, true or false +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setPreserve(bool status) const +void DSetMemXferPropList::setPreserve( bool status ) const { - herr_t ret_value = H5Pset_preserve(id, (hbool_t) status); - if(ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setPreserve", - "H5Pset_preserve failed"); - } + herr_t ret_value = H5Pset_preserve( id, (hbool_t) status ); + if( ret_value < 0 ) + { + throw PropListIException("DSetMemXferPropList::setPreserve", + "H5Pset_preserve failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getPreserve -///\brief Checks status of the dataset transfer property list. -///\return Status of the dataset transfer property list -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::getPreserve +///\brief Checks status of the dataset transfer property list. +///\return Status of the dataset transfer property list +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DSetMemXferPropList::getPreserve() const { - int ret_value = H5Pget_preserve(id); - if(ret_value > 0) - return true; - else if(ret_value == 0) - return false; - else - { - throw PropListIException("DSetMemXferPropList::getPreserve", - "H5Pget_preserve returned negative value for status"); - } + int ret_value = H5Pget_preserve( id ); + if( ret_value > 0 ) + return true; + else if( ret_value == 0 ) + return false; + else + { + throw PropListIException("DSetMemXferPropList::getPreserve", + "H5Pget_preserve returned negative value for status"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setBtreeRatios -///\brief Sets B-tree split ratios for a dataset transfer property list. -///\param left - IN: B-tree split ratio for left-most nodes -///\param middle - IN: B-tree split ratio for right-most nodes and lone nodes -///\param right - IN: B-tree split ratio for all other nodes -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::setBtreeRatios +///\brief Sets B-tree split ratios for a dataset transfer property list. +///\param left - IN: B-tree split ratio for left-most nodes +///\param middle - IN: B-tree split ratio for right-most nodes and lone nodes +///\param right - IN: B-tree split ratio for all other nodes +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setBtreeRatios(double left, double middle, double right) const +void DSetMemXferPropList::setBtreeRatios( double left, double middle, double right ) const { - herr_t ret_value = H5Pset_btree_ratios(id, left, middle, right); - if(ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setBtreeRatios", - "H5Pset_btree_ratios failed"); - } + herr_t ret_value = H5Pset_btree_ratios( id, left, middle, right ); + if( ret_value < 0 ) + { + throw PropListIException("DSetMemXferPropList::setBtreeRatios", + "H5Pset_btree_ratios failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getBtreeRatios -///\brief Gets B-tree split ratios for a dataset transfer property list. -///\param left - OUT: B-tree split ratio for left-most nodes -///\param middle - OUT: B-tree split ratio for right-most nodes and lone nodes -///\param right - OUT: B-tree split ratio for all other nodes -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::getBtreeRatios +///\brief Gets B-tree split ratios for a dataset transfer property list. +///\param left - OUT: B-tree split ratio for left-most nodes +///\param middle - OUT: B-tree split ratio for right-most nodes and lone nodes +///\param right - OUT: B-tree split ratio for all other nodes +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::getBtreeRatios(double& left, double& middle, double& right) const +void DSetMemXferPropList::getBtreeRatios( double& left, double& middle, double& right ) const { - herr_t ret_value = H5Pget_btree_ratios(id, &left, &middle, &right); - if(ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::getBtreeRatios", - "H5Pget_btree_ratios failed"); - } + herr_t ret_value = H5Pget_btree_ratios( id, &left, &middle, &right ); + if( ret_value < 0 ) + { + throw PropListIException("DSetMemXferPropList::getBtreeRatios", + "H5Pget_btree_ratios failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setDataTransform -///\brief Sets data transform expression. -///\param expression - IN: null-terminated data transform expression (char*) -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - Mar, 2014 +// Function: DSetMemXferPropList::setDataTransform +///\brief Sets data transform expression. +///\param expression - IN: null-terminated data transform expression (char*) +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- void DSetMemXferPropList::setDataTransform(const char* expression) const { - herr_t ret_value = H5Pset_data_transform(id, expression); - if(ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setDataTransform", - "H5Pset_data_transform failed"); - } + herr_t ret_value = H5Pset_data_transform( id, expression); + if( ret_value < 0 ) + { + throw PropListIException("DSetMemXferPropList::setDataTransform", + "H5Pset_data_transform failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setDataTransform -///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c H5std_string for the expression. -///\param expression - IN: H5std_string data transform expression -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - Mar, 2014 +// Function: DSetMemXferPropList::setDataTransform +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the expression. +///\param expression - IN: H5std_string data transform expression +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- void DSetMemXferPropList::setDataTransform(const H5std_string& expression) const { @@ -267,13 +267,13 @@ void DSetMemXferPropList::setDataTransform(const H5std_string& expression) const } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getDataTransform -///\brief Sets data transform expression. -///\param exp - OUT: buffer for data transform expression (char*) -///\param buf_size - IN: size of buffer for expression, including the -/// null terminator -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - Mar, 2014 +// Function: DSetMemXferPropList::getDataTransform +///\brief Sets data transform expression. +///\param exp - OUT: buffer for data transform expression (char*) +///\param buf_size - IN: size of buffer for expression, including the +/// null terminator +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t buf_size) const { @@ -285,8 +285,8 @@ ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t buf_size) const // H5Pget_data_transform returns a negative value, raise an exception if (exp_len < 0) { - throw PropListIException("DSetMemXferPropList::getDataTransform", - "H5Pget_data_transform failed"); + throw PropListIException("DSetMemXferPropList::getDataTransform", + "H5Pget_data_transform failed"); } // H5Pget_data_transform will put a null terminator at the end of the @@ -298,11 +298,11 @@ ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t buf_size) const } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getDataTransform -///\brief This is an overloaded member function, provided for convenience. -/// It takes no parameter and returns a \c H5std_string for the expression. -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - Mar, 2014 +// Function: DSetMemXferPropList::getDataTransform +///\brief This is an overloaded member function, provided for convenience. +/// It takes no parameter and returns a \c H5std_string for the expression. +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- H5std_string DSetMemXferPropList::getDataTransform() const { @@ -340,226 +340,226 @@ H5std_string DSetMemXferPropList::getDataTransform() const } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getTypeConvCB -///\brief Sets an exception handling callback for datatype conversion -/// for a dataset transfer property list. -///\param op - IN: User's function -///\param user_data - IN: User's data -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getTypeConvCB +///\brief Sets an exception handling callback for datatype conversion +/// for a dataset transfer property list. +///\param op - IN: User's function +///\param user_data - IN: User's data +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setTypeConvCB(H5T_conv_except_func_t op, void *user_data) const +void DSetMemXferPropList::setTypeConvCB( H5T_conv_except_func_t op, void *user_data) const { - herr_t ret_value = H5Pset_type_conv_cb(id, op, user_data); - if(ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setTypeConvCB", - "H5Pset_type_conv_cb failed"); - } + herr_t ret_value = H5Pset_type_conv_cb( id, op, user_data); + if( ret_value < 0 ) + { + throw PropListIException("DSetMemXferPropList::setTypeConvCB", + "H5Pset_type_conv_cb failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getTypeConvCB -///\brief Gets the exception handling callback function and data. -///\param op - IN: Retrieved user function -///\param user_data - IN: Retrieved user data -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getTypeConvCB +///\brief Gets the exception handling callback function and data. +///\param op - IN: Retrieved user function +///\param user_data - IN: Retrieved user data +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void DSetMemXferPropList::getTypeConvCB(H5T_conv_except_func_t *op, void **user_data) const +void DSetMemXferPropList::getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) const { - herr_t ret_value = H5Pget_type_conv_cb(id, op, user_data); - if(ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::getTypeConvCB", - "H5Pget_type_conv_cb failed"); - } + herr_t ret_value = H5Pget_type_conv_cb( id, op, user_data); + if( ret_value < 0 ) + { + throw PropListIException("DSetMemXferPropList::getTypeConvCB", + "H5Pget_type_conv_cb failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setVlenMemManager -///\brief Sets the memory manager for variable-length datatype allocation. -///\param alloc_func - IN: User's allocate routine -///\param alloc_info - IN: User's allocation parameters -///\param free_func - IN: User's free routine -///\param free_info - IN: User's free parameters -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::setVlenMemManager +///\brief Sets the memory manager for variable-length datatype allocation. +///\param alloc_func - IN: User's allocate routine +///\param alloc_info - IN: User's allocation parameters +///\param free_func - IN: User's free routine +///\param free_info - IN: User's free parameters +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setVlenMemManager(H5MM_allocate_t alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info) const +void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info ) const { - herr_t ret_value = H5Pset_vlen_mem_manager(id, alloc_func, alloc_info, - free_func, free_info); - if(ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setVlenMemManager", - "H5Pset_vlen_mem_manager failed"); - } + herr_t ret_value = H5Pset_vlen_mem_manager( id, alloc_func, alloc_info, + free_func, free_info ); + if( ret_value < 0 ) + { + throw PropListIException("DSetMemXferPropList::setVlenMemManager", + "H5Pset_vlen_mem_manager failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setVlenMemManager -///\brief Sets the memory manager for variable-length datatype -/// allocation - system \c malloc and \c free will be used. +// Function: DSetMemXferPropList::setVlenMemManager +///\brief Sets the memory manager for variable-length datatype +/// allocation - system \c malloc and \c free will be used. /// -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetMemXferPropList::setVlenMemManager() const { - setVlenMemManager(NULL, NULL, NULL, NULL); + setVlenMemManager( NULL, NULL, NULL, NULL ); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getVlenMemManager -///\brief Gets the memory manager for variable-length datatype allocation -///\param alloc_func - OUT: User's allocate routine -///\param alloc_info - OUT: User's allocation parameters -///\param free_func - OUT: User's free routine -///\param free_info - OUT: User's free parameters -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList::getVlenMemManager +///\brief Gets the memory manager for variable-length datatype allocation +///\param alloc_func - OUT: User's allocate routine +///\param alloc_info - OUT: User's allocation parameters +///\param free_func - OUT: User's free routine +///\param free_info - OUT: User's free parameters +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetMemXferPropList::getVlenMemManager(H5MM_allocate_t& alloc_func, void** alloc_info, H5MM_free_t& free_func, void** free_info) const +void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** alloc_info, H5MM_free_t& free_func, void** free_info ) const { - herr_t ret_value = H5Pget_vlen_mem_manager(id, &alloc_func, alloc_info, &free_func, free_info); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::getVlenMemManager", - "H5Pget_vlen_mem_manager failed"); - } + herr_t ret_value = H5Pget_vlen_mem_manager( id, &alloc_func, alloc_info, &free_func, free_info ); + if( ret_value < 0 ) + { + throw PropListIException("DSetMemXferPropList::getVlenMemManager", + "H5Pget_vlen_mem_manager failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setSmallDataBlockSize -///\brief Sets the size of a contiguous block reserved for small data. -///\param size - IN: Maximum size, in bytes, of the small data block. -///\exception H5::PropListIException +// Function: DSetMemXferPropList::setSmallDataBlockSize +///\brief Sets the size of a contiguous block reserved for small data. +///\param size - IN: Maximum size, in bytes, of the small data block. +///\exception H5::PropListIException ///\par Description -/// For detail, please refer to the C layer Reference Manual at: +/// For detail, please refer to the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSmallData -// Programmer Binh-Minh Ribler - April, 2004 +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) const { - herr_t ret_value = H5Pset_small_data_block_size(id, size); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setSmallDataBlockSize", - "H5Pset_small_data_block_size failed"); - } + herr_t ret_value = H5Pset_small_data_block_size(id, size); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setSmallDataBlockSize", + "H5Pset_small_data_block_size failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getSmallDataBlockSize -///\brief Returns the current small data block size setting. -///\return Size of the small data block, in bytes -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getSmallDataBlockSize +///\brief Returns the current small data block size setting. +///\return Size of the small data block, in bytes +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hsize_t DSetMemXferPropList::getSmallDataBlockSize() const { - hsize_t size; - herr_t ret_value = H5Pget_small_data_block_size(id, &size); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::getSmallDataBlockSize", - "H5Pget_small_data_block_size failed"); - } - return(size); + hsize_t size; + herr_t ret_value = H5Pget_small_data_block_size(id, &size); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::getSmallDataBlockSize", + "H5Pget_small_data_block_size failed"); + } + return(size); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setHyperVectorSize -///\brief Sets number of I/O vectors to be read/written in hyperslab I/O. +// Function: DSetMemXferPropList::setHyperVectorSize +///\brief Sets number of I/O vectors to be read/written in hyperslab I/O. /// -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// For information, please refer to the C layer Reference -/// Manual at: +/// For information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetHyperVectorSize -// Programmer Binh-Minh Ribler - April, 2004 +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) const { - herr_t ret_value = H5Pset_hyper_vector_size(id, vector_size); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setHyperVectorSize", - "H5Pset_hyper_vector_size failed"); - } + herr_t ret_value = H5Pset_hyper_vector_size(id, vector_size); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setHyperVectorSize", + "H5Pset_hyper_vector_size failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getHyperVectorSize -///\brief Returns the number of I/O vectors to be read/written in -/// hyperslab I/O. -///\return Number of I/O vectors -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getHyperVectorSize +///\brief Returns the number of I/O vectors to be read/written in +/// hyperslab I/O. +///\return Number of I/O vectors +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t DSetMemXferPropList::getHyperVectorSize() const { - size_t vector_size; - herr_t ret_value = H5Pget_hyper_vector_size(id, &vector_size); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::getHyperVectorSize", - "H5Pget_hyper_vector_size failed"); - } - return(vector_size); + size_t vector_size; + herr_t ret_value = H5Pget_hyper_vector_size(id, &vector_size); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::getHyperVectorSize", + "H5Pget_hyper_vector_size failed"); + } + return(vector_size); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::setEDCCheck -///\brief Enables or disables error-detecting for a dataset reading -/// process. -///\param check - IN: Specifies whether error detection is enabled or -/// disabled -///\exception H5::PropListIException +// Function: DSetMemXferPropList::setEDCCheck +///\brief Enables or disables error-detecting for a dataset reading +/// process. +///\param check - IN: Specifies whether error detection is enabled or +/// disabled +///\exception H5::PropListIException ///\par Description -/// The error detection algorithm used is the algorithm previously -/// specified in the corresponding dataset creation property -/// list. This function does not affect the use of error -/// detection in the writing process. +/// The error detection algorithm used is the algorithm previously +/// specified in the corresponding dataset creation property +/// list. This function does not affect the use of error +/// detection in the writing process. ///\par -/// Valid values are as follows: -/// \li \c H5Z_ENABLE_EDC (default) -/// \li \c H5Z_DISABLE_EDC -// Programmer Binh-Minh Ribler - April, 2004 +/// Valid values are as follows: +/// \li \c H5Z_ENABLE_EDC (default) +/// \li \c H5Z_DISABLE_EDC +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check) const { - herr_t ret_value = H5Pset_edc_check(id, check); - if (ret_value < 0) - { - throw PropListIException("DSetMemXferPropList::setEDCCheck", - "H5Pset_edc_check failed"); - } + herr_t ret_value = H5Pset_edc_check(id, check); + if (ret_value < 0) + { + throw PropListIException("DSetMemXferPropList::setEDCCheck", + "H5Pset_edc_check failed"); + } } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList::getEDCCheck -///\brief Determines whether error-detection is enabled for dataset reads. -///\return \c H5Z_ENABLE_EDC or \c H5Z_DISABLE_EDC -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: DSetMemXferPropList::getEDCCheck +///\brief Determines whether error-detection is enabled for dataset reads. +///\return \c H5Z_ENABLE_EDC or \c H5Z_DISABLE_EDC +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5Z_EDC_t DSetMemXferPropList::getEDCCheck() const { - H5Z_EDC_t check = H5Pget_edc_check(id); - if (check < 0) - { - throw PropListIException("DSetMemXferPropList::getEDCCheck", - "H5Pget_edc_check failed"); - } - return(check); + H5Z_EDC_t check = H5Pget_edc_check(id); + if (check < 0) + { + throw PropListIException("DSetMemXferPropList::getEDCCheck", + "H5Pget_edc_check failed"); + } + return(check); } //-------------------------------------------------------------------------- -// Function: DSetMemXferPropList destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: DSetMemXferPropList destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetMemXferPropList::~DSetMemXferPropList() {} diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index f1c363f..42194fb 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -27,93 +27,93 @@ namespace H5 { */ class H5_DLLCPP DSetMemXferPropList : public PropList { public: - ///\brief Default dataset memory and transfer property list. - static const DSetMemXferPropList& DEFAULT; + ///\brief Default dataset memory and transfer property list. + static const DSetMemXferPropList& DEFAULT; - // Creates a dataset memory and transfer property list. - DSetMemXferPropList(); + // Creates a dataset memory and transfer property list. + DSetMemXferPropList(); - // Creates a dataset transform property list. - DSetMemXferPropList(const char* expression); + // Creates a dataset transform property list. + DSetMemXferPropList(const char* expression); - // Sets type conversion and background buffers. - void setBuffer(size_t size, void* tconv, void* bkg) const; + // Sets type conversion and background buffers. + void setBuffer( size_t size, void* tconv, void* bkg ) const; - // Reads buffer settings. - size_t getBuffer(void** tconv, void** bkg) const; + // Reads buffer settings. + size_t getBuffer( void** tconv, void** bkg ) const; - // Sets B-tree split ratios for a dataset transfer property list. - void setBtreeRatios(double left, double middle, double right) const; + // Sets B-tree split ratios for a dataset transfer property list. + void setBtreeRatios( double left, double middle, double right ) const; - // Gets B-tree split ratios for a dataset transfer property list. - void getBtreeRatios(double& left, double& middle, double& right) const; + // Gets B-tree split ratios for a dataset transfer property list. + void getBtreeRatios( double& left, double& middle, double& right ) const; - // Sets data transform expression. - void setDataTransform(const char* expression) const; - void setDataTransform(const H5std_string& expression) const; + // Sets data transform expression. + void setDataTransform(const char* expression) const; + void setDataTransform(const H5std_string& expression) const; - // Gets data transform expression. - ssize_t getDataTransform(char* exp, size_t buf_size=0) const; - H5std_string getDataTransform() const; + // Gets data transform expression. + ssize_t getDataTransform(char* exp, size_t buf_size=0) const; + H5std_string getDataTransform() const; - // Sets the dataset transfer property list status to TRUE or FALSE. - void setPreserve(bool status) const; + // Sets the dataset transfer property list status to TRUE or FALSE. + void setPreserve( bool status ) const; - // Checks status of the dataset transfer property list. - bool getPreserve() const; + // Checks status of the dataset transfer property list. + bool getPreserve() const; - // Sets an exception handling callback for datatype conversion. - void setTypeConvCB(H5T_conv_except_func_t op, void *user_data) const; + // Sets an exception handling callback for datatype conversion. + void setTypeConvCB( H5T_conv_except_func_t op, void *user_data) const; - // Gets the exception handling callback for datatype conversion. - void getTypeConvCB(H5T_conv_except_func_t *op, void **user_data) const; + // Gets the exception handling callback for datatype conversion. + void getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) const; - // Sets the memory manager for variable-length datatype - // allocation in H5Dread and H5Dvlen_reclaim. - void setVlenMemManager(H5MM_allocate_t alloc, void* alloc_info, - H5MM_free_t free, void* free_info) const; + // Sets the memory manager for variable-length datatype + // allocation in H5Dread and H5Dvlen_reclaim. + void setVlenMemManager( H5MM_allocate_t alloc, void* alloc_info, + H5MM_free_t free, void* free_info ) const; - // alloc and free are set to NULL, indicating that system - // malloc and free are to be used. - void setVlenMemManager() const; + // alloc and free are set to NULL, indicating that system + // malloc and free are to be used. + void setVlenMemManager() const; - // Gets the memory manager for variable-length datatype - // allocation in H5Dread and H5Tvlen_reclaim. - void getVlenMemManager(H5MM_allocate_t& alloc, void** alloc_info, - H5MM_free_t& free, void** free_info) const; + // Gets the memory manager for variable-length datatype + // allocation in H5Dread and H5Tvlen_reclaim. + void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info, + H5MM_free_t& free, void** free_info ) const; - // Sets the size of a contiguous block reserved for small data. - void setSmallDataBlockSize(hsize_t size) const; + // Sets the size of a contiguous block reserved for small data. + void setSmallDataBlockSize(hsize_t size) const; - // Returns the current small data block size setting. - hsize_t getSmallDataBlockSize() const; + // Returns the current small data block size setting. + hsize_t getSmallDataBlockSize() const; - // Sets number of I/O vectors to be read/written in hyperslab I/O. - void setHyperVectorSize(size_t vector_size) const; + // Sets number of I/O vectors to be read/written in hyperslab I/O. + void setHyperVectorSize(size_t vector_size) const; - // Returns the number of I/O vectors to be read/written in - // hyperslab I/O. - size_t getHyperVectorSize() const; + // Returns the number of I/O vectors to be read/written in + // hyperslab I/O. + size_t getHyperVectorSize() const; - // Enables or disables error-detecting for a dataset reading - // process. - void setEDCCheck(H5Z_EDC_t check) const; + // Enables or disables error-detecting for a dataset reading + // process. + void setEDCCheck(H5Z_EDC_t check) const; - // Determines whether error-detection is enabled for dataset reads. - H5Z_EDC_t getEDCCheck() const; + // Determines whether error-detection is enabled for dataset reads. + H5Z_EDC_t getEDCCheck() const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("DSetMemXferPropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("DSetMemXferPropList"); } - // Copy constructor: makes a copy of a DSetMemXferPropList object. - DSetMemXferPropList(const DSetMemXferPropList& orig); + // Copy constructor: makes a copy of a DSetMemXferPropList object. + DSetMemXferPropList(const DSetMemXferPropList& orig); - // Creates a copy of an existing dataset memory and transfer - // property list using the property list id. - DSetMemXferPropList(const hid_t plist_id); + // Creates a copy of an existing dataset memory and transfer + // property list using the property list id. + DSetMemXferPropList(const hid_t plist_id); - // Noop destructor - virtual ~DSetMemXferPropList(); + // Noop destructor + virtual ~DSetMemXferPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -121,7 +121,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { static void deleteConstants(); private: - static DSetMemXferPropList* DEFAULT_; + static DSetMemXferPropList* DEFAULT_; // Creates the global constant, should only be used by the library static DSetMemXferPropList* getConstant(); diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 49f60e6..5e1f0bd 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -15,7 +15,7 @@ #include -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -37,230 +37,230 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: EnumType default constructor -///\brief Default constructor: Creates a stub datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType default constructor +///\brief Default constructor: Creates a stub datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType::EnumType() : DataType() {} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Creates an EnumType object using the id of an existing datatype. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType overloaded constructor +///\brief Creates an EnumType object using the id of an existing datatype. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType(const hid_t existing_id) : DataType( existing_id ) {} +EnumType::EnumType( const hid_t existing_id ) : DataType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: EnumType copy constructor -///\brief Copy constructor: makes a copy of the original EnumType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType copy constructor +///\brief Copy constructor: makes a copy of the original EnumType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType(const EnumType& original) : DataType( original ) {} +EnumType::EnumType( const EnumType& original ) : DataType( original ) {} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Creates an empty enumeration datatype given a size, in bytes. -///\param size - IN: Number of bytes in the datatype to create -///\exception H5::DataTypeIException +// Function: EnumType overloaded constructor +///\brief Creates an empty enumeration datatype given a size, in bytes. +///\param size - IN: Number of bytes in the datatype to create +///\exception H5::DataTypeIException // Description -// The DataType constructor calls the C API H5Tcreate to create -// the enum datatype. -// Programmer Binh-Minh Ribler - 2000 +// The DataType constructor calls the C API H5Tcreate to create +// the enum datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType(size_t size) : DataType( H5T_ENUM, size ) {} +EnumType::EnumType( size_t size ) : DataType( H5T_ENUM, size ) {} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Gets the enum datatype of the specified dataset. -///\param dataset - IN: Dataset that this enum datatype associates with -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType overloaded constructor +///\brief Gets the enum datatype of the specified dataset. +///\param dataset - IN: Dataset that this enum datatype associates with +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType(const DataSet& dataset) : DataType() +EnumType::EnumType( const DataSet& dataset ) : DataType() { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type(dataset.getId()); + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type( dataset.getId() ); - // If the datatype id is not valid, throw an exception - if (id < 0) - { - throw DataSetIException("EnumType constructor", "H5Dget_type failed"); - } + // If the datatype id is not valid, throw an exception + if( id < 0 ) + { + throw DataSetIException("EnumType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Creates a new enum datatype based on an integer datatype. -///\param data_type - IN: Base datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType overloaded constructor +///\brief Creates a new enum datatype based on an integer datatype. +///\param data_type - IN: Base datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -EnumType::EnumType(const IntType& data_type) : DataType() +EnumType::EnumType( const IntType& data_type ) : DataType() { - // Calls C function H5Tenum_create to get the id of the datatype - id = H5Tenum_create(data_type.getId()); + // Calls C function H5Tenum_create to get the id of the datatype + id = H5Tenum_create( data_type.getId() ); - // If the datatype id is not valid, throw an exception - if (id < 0) - { - throw DataSetIException("EnumType constructor", "H5Tenum_create failed"); - } + // If the datatype id is not valid, throw an exception + if( id < 0 ) + { + throw DataSetIException("EnumType constructor", "H5Tenum_create failed"); + } } //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Creates an EnumType instance by opening an HDF5 enum datatype -/// given its name, provided as a C character string. -///\param dtype_name - IN: Enum datatype name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: EnumType overloaded constructor +///\brief Creates an EnumType instance by opening an HDF5 enum datatype +/// given its name, provided as a C character string. +///\param dtype_name - IN: Enum datatype name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openEnumType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openEnumType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- EnumType::EnumType(const H5Location& loc, const char *dtype_name) : DataType() { - id = p_opentype(loc, dtype_name); + id = p_opentype(loc, dtype_name); } //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Creates an EnumType instance by opening an HDF5 enum datatype -/// given its name, provided as an \c H5std_string. -///\param dtype_name - IN: Enum datatype name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: EnumType overloaded constructor +///\brief Creates an EnumType instance by opening an HDF5 enum datatype +/// given its name, provided as an \c H5std_string. +///\param dtype_name - IN: Enum datatype name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openEnumType(const H5std_string&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openEnumType(const H5std_string&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- EnumType::EnumType(const H5Location& loc, const H5std_string& dtype_name) : DataType() { - id = p_opentype(loc, dtype_name.c_str()); + id = p_opentype(loc, dtype_name.c_str()); } //-------------------------------------------------------------------------- -// Function: EnumType::insert -///\brief Inserts a new member to this enumeration datatype. -///\param name - IN: Name of the new member -///\param value - IN: Pointer to the value of the new member -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::insert +///\brief Inserts a new member to this enumeration datatype. +///\param name - IN: Name of the new member +///\param value - IN: Pointer to the value of the new member +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::insert(const char* name, void *value) const +void EnumType::insert( const char* name, void *value ) const { - // Calls C routine H5Tenum_insert to insert the new enum datatype member. - herr_t ret_value = H5Tenum_insert(id, name, value); - if (ret_value < 0) - { - throw DataTypeIException("EnumType::insert", "H5Tenum_insert failed"); - } + // Calls C routine H5Tenum_insert to insert the new enum datatype member. + herr_t ret_value = H5Tenum_insert( id, name, value ); + if( ret_value < 0 ) + { + throw DataTypeIException("EnumType::insert", "H5Tenum_insert failed"); + } } //-------------------------------------------------------------------------- -// Function: EnumType::insert -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::insert +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::insert(const H5std_string& name, void *value) const +void EnumType::insert( const H5std_string& name, void *value ) const { - insert(name.c_str(), value); + insert( name.c_str(), value ); } //-------------------------------------------------------------------------- -// Function: EnumType::nameOf -///\brief Returns the symbol name corresponding to a specified member -/// of this enumeration datatype. -///\param value - IN: Pointer to the value of the enum datatype -///\param size - IN: Size for the name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::nameOf +///\brief Returns the symbol name corresponding to a specified member +/// of this enumeration datatype. +///\param value - IN: Pointer to the value of the enum datatype +///\param size - IN: Size for the name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string EnumType::nameOf(void *value, size_t size) const +H5std_string EnumType::nameOf( void *value, size_t size ) const { - char* name_C = new char[size+1]; // temporary C-string for C API - HDmemset(name_C, 0, size+1); // clear buffer + char* name_C = new char[size+1]; // temporary C-string for C API + HDmemset(name_C, 0, size+1); // clear buffer - // Calls C routine H5Tenum_nameof to get the name of the specified enum type - herr_t ret_value = H5Tenum_nameof(id, value, name_C, size); + // Calls C routine H5Tenum_nameof to get the name of the specified enum type + herr_t ret_value = H5Tenum_nameof( id, value, name_C, size ); - // If H5Tenum_nameof returns a negative value, raise an exception, - if (ret_value < 0) - { + // If H5Tenum_nameof returns a negative value, raise an exception, + if( ret_value < 0 ) + { delete []name_C; - throw DataTypeIException("EnumType::nameOf", "H5Tenum_nameof failed"); - } - // otherwise, create the string to hold the datatype name and return it - H5std_string name(name_C); - delete []name_C; - return(name); + throw DataTypeIException("EnumType::nameOf", "H5Tenum_nameof failed"); + } + // otherwise, create the string to hold the datatype name and return it + H5std_string name(name_C); + delete []name_C; + return( name ); } //-------------------------------------------------------------------------- -// Function: EnumType::valueOf -///\brief Retrieves the value corresponding to a member of this -/// enumeration datatype, given the member's name. -///\param name - IN: Name of the queried member -///\param value - OUT: Pointer to the retrieved value -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::valueOf +///\brief Retrieves the value corresponding to a member of this +/// enumeration datatype, given the member's name. +///\param name - IN: Name of the queried member +///\param value - OUT: Pointer to the retrieved value +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::valueOf(const char* name, void *value) const +void EnumType::valueOf( const char* name, void *value ) const { - // Calls C routine H5Tenum_valueof to get the enum datatype value - herr_t ret_value = H5Tenum_valueof(id, name, value); - if (ret_value < 0) - { - throw DataTypeIException("EnumType::valueOf", "H5Tenum_valueof failed"); - } + // Calls C routine H5Tenum_valueof to get the enum datatype value + herr_t ret_value = H5Tenum_valueof( id, name, value ); + if( ret_value < 0 ) + { + throw DataTypeIException("EnumType::valueOf", "H5Tenum_valueof failed"); + } } //-------------------------------------------------------------------------- -// Function: EnumType::valueOf -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of -/// argument \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::valueOf +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of +/// argument \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::valueOf(const H5std_string& name, void *value) const +void EnumType::valueOf( const H5std_string& name, void *value ) const { - valueOf(name.c_str(), value); + valueOf( name.c_str(), value ); } //-------------------------------------------------------------------------- -// Function: EnumType::getMemberIndex -///\brief Returns the index of a member in this enumeration datatype. -///\param name - IN: Name of the queried member -///\return Index of the member if it exists. Index will have the value -/// between 0 and \c N-1, where \c N is the value returned by the -/// member function \c EnumType::getNmembers. -///\exception H5::DataTypeIException +// Function: EnumType::getMemberIndex +///\brief Returns the index of a member in this enumeration datatype. +///\param name - IN: Name of the queried member +///\return Index of the member if it exists. Index will have the value +/// between 0 and \c N-1, where \c N is the value returned by the +/// member function \c EnumType::getNmembers. +///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- int EnumType::getMemberIndex(const char *name) const { - int member_index = H5Tget_member_index(id, name); - if (member_index < 0) - { - throw DataTypeIException("EnumType::getMemberIndex", + int member_index = H5Tget_member_index(id, name); + if( member_index < 0 ) + { + throw DataTypeIException("EnumType::getMemberIndex", "H5Tget_member_index returns negative value"); - } - return(member_index); + } + return( member_index ); } //-------------------------------------------------------------------------- -// Function: EnumType::getMemberIndex -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of -/// argument \a name. +// Function: EnumType::getMemberIndex +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in the type of +/// argument \a name. // Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- int EnumType::getMemberIndex(const H5std_string& name) const @@ -269,46 +269,46 @@ int EnumType::getMemberIndex(const H5std_string& name) const } //-------------------------------------------------------------------------- -// Function: EnumType::getNmembers -///\brief Returns the number of members in this enumeration datatype. -///\return Number of members -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: EnumType::getNmembers +///\brief Returns the number of members in this enumeration datatype. +///\return Number of members +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- int EnumType::getNmembers() const { - int num_members = H5Tget_nmembers(id); - if (num_members < 0) - { - throw DataTypeIException("EnumType::getNmembers", + int num_members = H5Tget_nmembers( id ); + if( num_members < 0 ) + { + throw DataTypeIException("EnumType::getNmembers", "H5Tget_nmembers returns negative number of members"); - } - return(num_members); + } + return( num_members ); } //-------------------------------------------------------------------------- -// Function: EnumType::getMemberValue -///\brief Retrieves the value of a member in this enumeration datatype, -/// given the member's index. -///\param memb_no - IN: Index of the queried member -///\param value - OUT: Pointer to the retrieved value -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType::getMemberValue +///\brief Retrieves the value of a member in this enumeration datatype, +/// given the member's index. +///\param memb_no - IN: Index of the queried member +///\param value - OUT: Pointer to the retrieved value +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void EnumType::getMemberValue(unsigned memb_no, void *value) const +void EnumType::getMemberValue( unsigned memb_no, void *value ) const { - // Call C routine H5Tget_member_value to get the datatype member's value - hid_t ret_value = H5Tget_member_value(id, memb_no, value); - if (ret_value < 0) - { - throw DataTypeIException("EnumType::getMemberValue", "H5Tget_member_value failed"); - } + // Call C routine H5Tget_member_value to get the datatype member's value + hid_t ret_value = H5Tget_member_value( id, memb_no, value ); + if( ret_value < 0 ) + { + throw DataTypeIException("EnumType::getMemberValue", "H5Tget_member_value failed"); + } } //-------------------------------------------------------------------------- -// Function: EnumType destructor -///\brief Properly terminates access to this enum datatype. -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType destructor +///\brief Properly terminates access to this enum datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType::~EnumType() {} diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index 2fbe2cd..054811b 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -28,56 +28,56 @@ namespace H5 { class H5_DLLCPP EnumType : public DataType { public: - // Creates an empty enumeration datatype based on a native signed - // integer type, whose size is given by size. - EnumType(size_t size); + // Creates an empty enumeration datatype based on a native signed + // integer type, whose size is given by size. + EnumType( size_t size ); - // Gets the enum datatype of the specified dataset - EnumType(const DataSet& dataset); // H5Dget_type + // Gets the enum datatype of the specified dataset + EnumType( const DataSet& dataset ); // H5Dget_type - // Creates a new enum datatype based on an integer datatype - EnumType(const IntType& data_type); // H5Tenum_create + // Creates a new enum datatype based on an integer datatype + EnumType( const IntType& data_type ); // H5Tenum_create - // Constructors that open an enum datatype, given a location. - EnumType(const H5Location& loc, const char* name); - EnumType(const H5Location& loc, const H5std_string& name); + // Constructors that open an enum datatype, given a location. + EnumType(const H5Location& loc, const char* name); + EnumType(const H5Location& loc, const H5std_string& name); - // Returns the number of members in this enumeration datatype. - int getNmembers () const; + // Returns the number of members in this enumeration datatype. + int getNmembers () const; - // Returns the index of a member in this enumeration data type. - int getMemberIndex(const char* name) const; - int getMemberIndex(const H5std_string& name) const; + // Returns the index of a member in this enumeration data type. + int getMemberIndex(const char* name) const; + int getMemberIndex(const H5std_string& name) const; - // Returns the value of an enumeration datatype member - void getMemberValue(unsigned memb_no, void *value) const; + // Returns the value of an enumeration datatype member + void getMemberValue( unsigned memb_no, void *value ) const; - // Inserts a new member to this enumeration type. - void insert(const char* name, void *value) const; - void insert(const H5std_string& name, void *value) const; + // Inserts a new member to this enumeration type. + void insert( const char* name, void *value ) const; + void insert( const H5std_string& name, void *value ) const; - // Returns the symbol name corresponding to a specified member - // of this enumeration datatype. - H5std_string nameOf(void *value, size_t size) const; + // Returns the symbol name corresponding to a specified member + // of this enumeration datatype. + H5std_string nameOf( void *value, size_t size ) const; - // Returns the value corresponding to a specified member of this - // enumeration datatype. - void valueOf(const char* name, void *value) const; - void valueOf(const H5std_string& name, void *value) const; + // Returns the value corresponding to a specified member of this + // enumeration datatype. + void valueOf( const char* name, void *value ) const; + void valueOf( const H5std_string& name, void *value ) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("EnumType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("EnumType"); } - // Default constructor - EnumType(); + // Default constructor + EnumType(); - // Creates an enumeration datatype using an existing id - EnumType(const hid_t existing_id); + // Creates an enumeration datatype using an existing id + EnumType( const hid_t existing_id ); - // Copy constructor: makes a copy of the original EnumType object. - EnumType(const EnumType& original); + // Copy constructor: makes a copy of the original EnumType object. + EnumType( const EnumType& original ); - virtual ~EnumType(); + virtual ~EnumType(); }; } #endif // __H5EnumType_H diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 0316f64..335bb20 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -23,207 +23,207 @@ namespace H5 { const char Exception::DEFAULT_MSG[] = "No detailed information provided"; //-------------------------------------------------------------------------- -// Function: Exception default constructor -///\brief Default constructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception default constructor +///\brief Default constructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Exception::Exception() : detail_message(""), func_name("") {} //-------------------------------------------------------------------------- -// Function: Exception overloaded constructor -///\brief Creates an exception with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception overloaded constructor +///\brief Creates an exception with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Exception::Exception(const H5std_string& func, const H5std_string& message) : detail_message(message), func_name(func) {} //-------------------------------------------------------------------------- -// Function: Exception copy constructor -///\brief Copy constructor: makes a copy of the original Exception object. -///\param orig - IN: Exception instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception copy constructor +///\brief Copy constructor: makes a copy of the original Exception object. +///\param orig - IN: Exception instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Exception::Exception(const Exception& orig) : detail_message(orig.detail_message), func_name(orig.func_name) {} +Exception::Exception( const Exception& orig ) : detail_message(orig.detail_message), func_name(orig.func_name) {} //-------------------------------------------------------------------------- -// Function: Exception::getMajorString -///\brief Returns a text string that describes the error -/// specified by a major error number. -///\param err_major - IN: Major error number -///\return Major error string +// Function: Exception::getMajorString +///\brief Returns a text string that describes the error +/// specified by a major error number. +///\param err_major - IN: Major error number +///\return Major error string ///\par Description -/// In the failure case, the string "Invalid major error number" -/// will be returned. -// Programmer Binh-Minh Ribler - 2000 +/// In the failure case, the string "Invalid major error number" +/// will be returned. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string Exception::getMajorString(hid_t err_major) const +H5std_string Exception::getMajorString( hid_t err_major ) const { - // Preliminary call to H5Eget_msg() to get the length of the message - ssize_t mesg_size = H5Eget_msg(err_major, NULL, NULL, 0); - - // If H5Eget_msg() returns a negative value, raise an exception, - if (mesg_size < 0) - throw IdComponentException("Exception::getMajorString", - "H5Eget_msg failed"); - - // Call H5Eget_msg again to get the actual message - char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API - mesg_size = H5Eget_msg(err_major, NULL, mesg_C, mesg_size+1); - - // Check for failure again - if (mesg_size < 0) - { - delete []mesg_C; - throw IdComponentException("Exception::getMajorString", - "H5Eget_msg failed"); - } - - // Convert the C error description and return - H5std_string major_str(mesg_C); - delete []mesg_C; - return(major_str); + // Preliminary call to H5Eget_msg() to get the length of the message + ssize_t mesg_size = H5Eget_msg(err_major, NULL, NULL, 0); + + // If H5Eget_msg() returns a negative value, raise an exception, + if( mesg_size < 0 ) + throw IdComponentException("Exception::getMajorString", + "H5Eget_msg failed"); + + // Call H5Eget_msg again to get the actual message + char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API + mesg_size = H5Eget_msg(err_major, NULL, mesg_C, mesg_size+1); + + // Check for failure again + if( mesg_size < 0 ) + { + delete []mesg_C; + throw IdComponentException("Exception::getMajorString", + "H5Eget_msg failed"); + } + + // Convert the C error description and return + H5std_string major_str(mesg_C); + delete []mesg_C; + return( major_str ); } //-------------------------------------------------------------------------- -// Function: Exception::getMinorString -///\brief Returns a text string that describes the error -/// specified by a minor error number. -///\param err_minor - IN: Minor error number -///\return Minor error string +// Function: Exception::getMinorString +///\brief Returns a text string that describes the error +/// specified by a minor error number. +///\param err_minor - IN: Minor error number +///\return Minor error string ///\par Description -/// In the failure case, the string "Invalid minor error number" -/// will be returned. -// Programmer Binh-Minh Ribler - 2000 +/// In the failure case, the string "Invalid minor error number" +/// will be returned. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string Exception::getMinorString(hid_t err_minor) const +H5std_string Exception::getMinorString( hid_t err_minor ) const { - // Preliminary call to H5Eget_msg() to get the length of the message - ssize_t mesg_size = H5Eget_msg(err_minor, NULL, NULL, 0); - - // If H5Eget_msg() returns a negative value, raise an exception, - if (mesg_size < 0) - throw IdComponentException("Exception::getMinorString", - "H5Eget_msg failed"); - - // Call H5Eget_msg again to get the actual message - char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API - mesg_size = H5Eget_msg(err_minor, NULL, mesg_C, mesg_size+1); - - // Check for failure again - if (mesg_size < 0) - { - delete []mesg_C; - throw IdComponentException("Exception::getMinorString", - "H5Eget_msg failed"); - } - - // Convert the C error description and return - H5std_string minor_str(mesg_C); - delete []mesg_C; - return(minor_str); + // Preliminary call to H5Eget_msg() to get the length of the message + ssize_t mesg_size = H5Eget_msg(err_minor, NULL, NULL, 0); + + // If H5Eget_msg() returns a negative value, raise an exception, + if( mesg_size < 0 ) + throw IdComponentException("Exception::getMinorString", + "H5Eget_msg failed"); + + // Call H5Eget_msg again to get the actual message + char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API + mesg_size = H5Eget_msg(err_minor, NULL, mesg_C, mesg_size+1); + + // Check for failure again + if( mesg_size < 0 ) + { + delete []mesg_C; + throw IdComponentException("Exception::getMinorString", + "H5Eget_msg failed"); + } + + // Convert the C error description and return + H5std_string minor_str(mesg_C); + delete []mesg_C; + return( minor_str ); } //-------------------------------------------------------------------------- -// Function: Exception::setAutoPrint -///\brief Turns on the automatic error printing. -///\param func - IN: Function to be called upon an error condition -///\param client_data - IN: Data passed to the error function +// Function: Exception::setAutoPrint +///\brief Turns on the automatic error printing. +///\param func - IN: Function to be called upon an error condition +///\param client_data - IN: Data passed to the error function ///\par Description -/// When the library is first initialized the auto printing -/// function, \a func, is set to the C API \c H5Eprint and -/// \a client_data is the standard error stream pointer, \c stderr. -/// Automatic stack traversal is always in the \c H5E_WALK_DOWNWARD -/// direction. +/// When the library is first initialized the auto printing +/// function, \a func, is set to the C API \c H5Eprint and +/// \a client_data is the standard error stream pointer, \c stderr. +/// Automatic stack traversal is always in the \c H5E_WALK_DOWNWARD +/// direction. ///\par -/// Users are encouraged to write their own more specific error -/// handlers -// Programmer Binh-Minh Ribler - 2000 +/// Users are encouraged to write their own more specific error +/// handlers +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Exception::setAutoPrint(H5E_auto2_t& func, void* client_data) +void Exception::setAutoPrint( H5E_auto2_t& func, void* client_data ) { - // calls the C API routine H5Eset_auto to set the auto printing to - // the specified function. - herr_t ret_value = H5Eset_auto2(H5E_DEFAULT, func, client_data); - if (ret_value < 0) - throw Exception("Exception::setAutoPrint", "H5Eset_auto failed"); + // calls the C API routine H5Eset_auto to set the auto printing to + // the specified function. + herr_t ret_value = H5Eset_auto2( H5E_DEFAULT, func, client_data ); + if( ret_value < 0 ) + throw Exception( "Exception::setAutoPrint", "H5Eset_auto failed" ); } //-------------------------------------------------------------------------- -// Function: Exception::dontPrint -///\brief Turns off the automatic error printing from the C library. -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::dontPrint +///\brief Turns off the automatic error printing from the C library. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Exception::dontPrint() { - // calls the C API routine H5Eset_auto with NULL parameters to turn - // off the automatic error printing. - herr_t ret_value = H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - if (ret_value < 0) - throw Exception("Exception::dontPrint", "H5Eset_auto failed"); + // calls the C API routine H5Eset_auto with NULL parameters to turn + // off the automatic error printing. + herr_t ret_value = H5Eset_auto2( H5E_DEFAULT, NULL, NULL ); + if( ret_value < 0 ) + throw Exception( "Exception::dontPrint", "H5Eset_auto failed" ); } //-------------------------------------------------------------------------- -// Function: Exception::getAutoPrint -///\brief Retrieves the current settings for the automatic error -/// stack traversal function and its data. -///\param func - OUT: Current setting for the function to be -/// called upon an error condition -///\param client_data - OUT: Current setting for the data passed to -/// the error function -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getAutoPrint +///\brief Retrieves the current settings for the automatic error +/// stack traversal function and its data. +///\param func - OUT: Current setting for the function to be +/// called upon an error condition +///\param client_data - OUT: Current setting for the data passed to +/// the error function +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Exception::getAutoPrint(H5E_auto2_t& func, void** client_data) +void Exception::getAutoPrint( H5E_auto2_t& func, void** client_data ) { - // calls the C API routine H5Eget_auto to get the current setting of - // the automatic error printing - herr_t ret_value = H5Eget_auto2(H5E_DEFAULT, &func, client_data); - if (ret_value < 0) - throw Exception("Exception::getAutoPrint", "H5Eget_auto failed"); + // calls the C API routine H5Eget_auto to get the current setting of + // the automatic error printing + herr_t ret_value = H5Eget_auto2( H5E_DEFAULT, &func, client_data ); + if( ret_value < 0 ) + throw Exception( "Exception::getAutoPrint", "H5Eget_auto failed" ); } //-------------------------------------------------------------------------- -// Function: Exception::clearErrorStack -///\brief Clears the error stack for the current thread. +// Function: Exception::clearErrorStack +///\brief Clears the error stack for the current thread. ///\par Description -/// The stack is also cleared whenever a C API function is -/// called, with certain exceptions (for instance, \c H5Eprint). -// Programmer Binh-Minh Ribler - 2000 +/// The stack is also cleared whenever a C API function is +/// called, with certain exceptions (for instance, \c H5Eprint). +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Exception::clearErrorStack() { - // calls the C API routine H5Eclear to clear the error stack - herr_t ret_value = H5Eclear2(H5E_DEFAULT); - if (ret_value < 0) - throw Exception("Exception::clearErrorStack", "H5Eclear failed"); + // calls the C API routine H5Eclear to clear the error stack + herr_t ret_value = H5Eclear2(H5E_DEFAULT); + if( ret_value < 0 ) + throw Exception( "Exception::clearErrorStack", "H5Eclear failed" ); } //-------------------------------------------------------------------------- -// Function: Exception::walkErrorStack -///\brief Walks the error stack for the current thread, calling the -/// specified function. -///\param direction - IN: Direction in which the error stack is to be walked -///\param func - IN: Function to be called for each error encountered -///\param client_data - IN: Data passed to the error function +// Function: Exception::walkErrorStack +///\brief Walks the error stack for the current thread, calling the +/// specified function. +///\param direction - IN: Direction in which the error stack is to be walked +///\param func - IN: Function to be called for each error encountered +///\param client_data - IN: Data passed to the error function ///\par Description -/// Valid values for \a direction include: -/// \li \c H5E_WALK_UPWARD - begin with the most specific error -/// and end at the API -/// \li \c H5E_WALK_DOWNWARD - begin at the API and end at the -/// inner-most function where the error was first detected +/// Valid values for \a direction include: +/// \li \c H5E_WALK_UPWARD - begin with the most specific error +/// and end at the API +/// \li \c H5E_WALK_DOWNWARD - begin at the API and end at the +/// inner-most function where the error was first detected ///\par -/// The function specified by \a func will be called for each -/// error in the error stack. The \c H5E_walk_t prototype is as -/// follows: +/// The function specified by \a func will be called for each +/// error in the error stack. The \c H5E_walk_t prototype is as +/// follows: ///\code /// typedef herr_t (*H5E_walk_t)(int n, H5E_error_t *err_desc, void *client_data) /// int n - Indexed position of the error in the stack; it begins at zero -/// regardless of stack traversal direction +/// regardless of stack traversal direction /// H5E_error_t *err_desc - Pointer to a data structure describing the -/// error. This structure is listed below. +/// error. This structure is listed below. /// void *client_data - Pointer to client data in the format expected by -/// the user-defined function. +/// the user-defined function. ///\endcode ///\par /// Data structure to describe the error: @@ -238,87 +238,87 @@ void Exception::clearErrorStack() /// const char *desc; //optional supplied description /// } H5E_error2_t; ///\endcode -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void Exception::walkErrorStack(H5E_direction_t direction, H5E_walk2_t func, void* client_data) +void Exception::walkErrorStack( H5E_direction_t direction, H5E_walk2_t func, void* client_data ) { - // calls the C API routine H5Ewalk to walk the error stack - herr_t ret_value = H5Ewalk2(H5E_DEFAULT, direction, func, client_data); - if (ret_value < 0) - throw Exception("Exception::walkErrorStack", "H5Ewalk failed"); + // calls the C API routine H5Ewalk to walk the error stack + herr_t ret_value = H5Ewalk2( H5E_DEFAULT, direction, func, client_data ); + if( ret_value < 0 ) + throw Exception( "Exception::walkErrorStack", "H5Ewalk failed" ); } //-------------------------------------------------------------------------- -// Function: Exception::getDetailMsg -///\brief Returns the detailed message set at the time the exception -/// is thrown. -///\return Text message - \c H5std_string -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getDetailMsg +///\brief Returns the detailed message set at the time the exception +/// is thrown. +///\return Text message - \c H5std_string +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string Exception::getDetailMsg() const { - return(detail_message); + return(detail_message); } //-------------------------------------------------------------------------- -// Function: Exception::getCDetailMsg -///\brief Returns the detailed message set at the time the exception -/// is thrown. -///\return Text message - \c char pointer -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getCDetailMsg +///\brief Returns the detailed message set at the time the exception +/// is thrown. +///\return Text message - \c char pointer +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- const char* Exception::getCDetailMsg() const { - return(detail_message.c_str()); + return(detail_message.c_str()); } //-------------------------------------------------------------------------- -// Function: Exception::getFuncName -///\brief Returns the name of the function, where the exception is thrown. -///\return Text message - \c H5std_string -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getFuncName +///\brief Returns the name of the function, where the exception is thrown. +///\return Text message - \c H5std_string +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string Exception::getFuncName() const { - return(func_name); + return(func_name); } //-------------------------------------------------------------------------- -// Function: Exception::getCFuncName -///\brief Returns the name of the function, where the exception is thrown. -///\return Text message - \c char pointer -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::getCFuncName +///\brief Returns the name of the function, where the exception is thrown. +///\return Text message - \c char pointer +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- const char* Exception::getCFuncName() const { - return(func_name.c_str()); + return(func_name.c_str()); } //-------------------------------------------------------------------------- -// Function: Exception::printErrorStack (static) -///\brief Prints the error stack in a default manner. -///\param stream - IN: File pointer, default to stderr -///\param err_stack - IN: Error stack ID, default to H5E_DEFAULT(0) -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::printErrorStack (static) +///\brief Prints the error stack in a default manner. +///\param stream - IN: File pointer, default to stderr +///\param err_stack - IN: Error stack ID, default to H5E_DEFAULT(0) +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Exception::printErrorStack(FILE* stream, hid_t err_stack) { herr_t ret_value = H5Eprint2(err_stack, stream); - if (ret_value < 0) - throw Exception("Printing error stack", "H5Eprint2 failed"); + if( ret_value < 0 ) + throw Exception( "Printing error stack", "H5Eprint2 failed" ); } //-------------------------------------------------------------------------- -// Function: Exception::printError -// Purpose: Prints the error stack in a default manner. This member -// function is replaced by the static function printErrorStack -// and will be removed from the next major release. -// Parameter stream - IN: File pointer -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception::printError +// Purpose: Prints the error stack in a default manner. This member +// function is replaced by the static function printErrorStack +// and will be removed from the next major release. +// Parameter stream - IN: File pointer +// Programmer Binh-Minh Ribler - 2000 // Description: -// This function can be removed in next major release. -// -BMR, 2014/04/24 -// Removed from documentation. -BMR, 2016/03/23 +// This function can be removed in next major release. +// -BMR, 2014/04/24 +// Removed from documentation. -BMR, 2016/03/23 //-------------------------------------------------------------------------- void Exception::printError(FILE* stream) const { @@ -326,285 +326,285 @@ void Exception::printError(FILE* stream) const } //-------------------------------------------------------------------------- -// Function: Exception destructor -///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Function: Exception destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Exception::~Exception() throw() {} //-------------------------------------------------------------------------- -// Subclass: FileIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: FileIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: FileIException default constructor -///\brief Default constructor. +// Function: FileIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- FileIException::FileIException():Exception(){} //-------------------------------------------------------------------------- -// Function: FileIException overloaded constructor -///\brief Creates a FileIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: FileIException overloaded constructor +///\brief Creates a FileIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- FileIException::FileIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: FileIException destructor -///\brief Noop destructor. +// Function: FileIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- FileIException::~FileIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: GroupIException default constructor -///\brief Default constructor. +// Function: GroupIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- GroupIException::GroupIException():Exception(){} //-------------------------------------------------------------------------- -// Function: GroupIException overloaded constructor -///\brief Creates a GroupIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: GroupIException overloaded constructor +///\brief Creates a GroupIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- GroupIException::GroupIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: GroupIException destructor -///\brief Noop destructor. +// Function: GroupIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- GroupIException::~GroupIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: DataSpaceIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: DataSpaceIException default constructor -///\brief Default constructor. +// Function: DataSpaceIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- DataSpaceIException::DataSpaceIException():Exception(){} //-------------------------------------------------------------------------- -// Function: DataSpaceIException overloaded constructor -///\brief Creates a DataSpaceIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: DataSpaceIException overloaded constructor +///\brief Creates a DataSpaceIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- DataSpaceIException::DataSpaceIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: DataSpaceIException destructor -///\brief Noop destructor. +// Function: DataSpaceIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- DataSpaceIException::~DataSpaceIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: DataTypeIException default constructor -///\brief Default constructor. +// Function: DataTypeIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- DataTypeIException::DataTypeIException():Exception(){} //-------------------------------------------------------------------------- -// Function: DataTypeIException overloaded constructor -///\brief Creates a DataTypeIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: DataTypeIException overloaded constructor +///\brief Creates a DataTypeIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- DataTypeIException::DataTypeIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: DataTypeIException destructor -///\brief Noop destructor. +// Function: DataTypeIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- DataTypeIException::~DataTypeIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: ObjHeaderIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: ObjHeaderIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: ObjHeaderIException default constructor -///\brief Default constructor. +// Function: ObjHeaderIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- ObjHeaderIException::ObjHeaderIException():Exception(){} //-------------------------------------------------------------------------- -// Function: ObjHeaderIException overloaded constructor -///\brief Creates an ObjHeaderIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: ObjHeaderIException overloaded constructor +///\brief Creates an ObjHeaderIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- ObjHeaderIException::ObjHeaderIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: ObjHeaderIException destructor -///\brief Noop destructor. +// Function: ObjHeaderIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- ObjHeaderIException::~ObjHeaderIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: PropListIException default constructor -///\brief Default constructor. +// Function: PropListIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- PropListIException::PropListIException():Exception(){} //-------------------------------------------------------------------------- -// Function: PropListIException overloaded constructor -///\brief Creates a PropListIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: PropListIException overloaded constructor +///\brief Creates a PropListIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- PropListIException::PropListIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: PropListIException destructor -///\brief Noop destructor. +// Function: PropListIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- PropListIException::~PropListIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: DataSetIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: DataSetIException default constructor -///\brief Default constructor. +// Function: DataSetIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- DataSetIException::DataSetIException():Exception(){} //-------------------------------------------------------------------------- -// Function: DataSetIException overloaded constructor -///\brief Creates a DataSetIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: DataSetIException overloaded constructor +///\brief Creates a DataSetIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- DataSetIException::DataSetIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: DataSetIException destructor -///\brief Noop destructor. +// Function: DataSetIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- DataSetIException::~DataSetIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: AttributeIException default constructor -///\brief Default constructor. +// Function: AttributeIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- AttributeIException::AttributeIException():Exception(){} //-------------------------------------------------------------------------- -// Function: AttributeIException overloaded constructor -///\brief Creates an AttributeIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: AttributeIException overloaded constructor +///\brief Creates an AttributeIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- AttributeIException::AttributeIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: AttributeIException destructor -///\brief Noop destructor. +// Function: AttributeIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- AttributeIException::~AttributeIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: ReferenceException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: ReferenceException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: ReferenceException default constructor -///\brief Default constructor. +// Function: ReferenceException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- ReferenceException::ReferenceException():Exception(){} //-------------------------------------------------------------------------- -// Function: ReferenceException overloaded constructor -///\brief Creates a ReferenceException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: ReferenceException overloaded constructor +///\brief Creates a ReferenceException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- ReferenceException::ReferenceException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: ReferenceException destructor -///\brief Noop destructor. +// Function: ReferenceException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- ReferenceException::~ReferenceException() throw() {} //-------------------------------------------------------------------------- -// Subclass: LibraryIException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: LibraryIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: LibraryIException default constructor -///\brief Default constructor. +// Function: LibraryIException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- LibraryIException::LibraryIException():Exception(){} //-------------------------------------------------------------------------- -// Function: LibraryIException overloaded constructor -///\brief Creates a LibraryIException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: LibraryIException overloaded constructor +///\brief Creates a LibraryIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- LibraryIException::LibraryIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: LibraryIException destructor -///\brief Noop destructor. +// Function: LibraryIException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- LibraryIException::~LibraryIException() throw() {} //-------------------------------------------------------------------------- -// Subclass: LocationException -// Programmer Binh-Minh Ribler - 2014 +// Subclass: LocationException +// Programmer Binh-Minh Ribler - 2014 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: LocationException default constructor -///\brief Default constructor. +// Function: LocationException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- LocationException::LocationException():Exception(){} //-------------------------------------------------------------------------- -// Function: LocationException overloaded constructor -///\brief Creates a LocationException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: LocationException overloaded constructor +///\brief Creates a LocationException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- LocationException::LocationException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: LocationException destructor -///\brief Noop destructor. +// Function: LocationException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- LocationException::~LocationException() throw() {} //-------------------------------------------------------------------------- -// Subclass: IdComponentException -// Programmer Binh-Minh Ribler - 2000 +// Subclass: IdComponentException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: IdComponentException default constructor -///\brief Default constructor. +// Function: IdComponentException default constructor +///\brief Default constructor. //-------------------------------------------------------------------------- IdComponentException::IdComponentException(): Exception() {} //-------------------------------------------------------------------------- -// Function: IdComponentException overloaded constructor -///\brief Creates a IdComponentException with the name of the function, -/// in which the failure occurs, and an optional detailed message. -///\param func - IN: Name of the function where failure occurs -///\param message - IN: Message on the failure +// Function: IdComponentException overloaded constructor +///\brief Creates a IdComponentException with the name of the function, +/// in which the failure occurs, and an optional detailed message. +///\param func - IN: Name of the function where failure occurs +///\param message - IN: Message on the failure //-------------------------------------------------------------------------- IdComponentException::IdComponentException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {} //-------------------------------------------------------------------------- -// Function: IdComponentException destructor -///\brief Noop destructor. +// Function: IdComponentException destructor +///\brief Noop destructor. //-------------------------------------------------------------------------- IdComponentException::~IdComponentException() throw() {} diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 1f85711..7112995 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -33,147 +33,147 @@ namespace H5 { */ class H5_DLLCPP Exception { public: - // Creates an exception with a function name where the failure occurs - // and an optional detailed message - Exception(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + // Creates an exception with a function name where the failure occurs + // and an optional detailed message + Exception(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - // Returns a character string that describes the error specified by - // a major error number. - H5std_string getMajorString(hid_t err_major_id) const; + // Returns a character string that describes the error specified by + // a major error number. + H5std_string getMajorString( hid_t err_major_id ) const; - // Returns a character string that describes the error specified by - // a minor error number. - H5std_string getMinorString(hid_t err_minor_id) const; + // Returns a character string that describes the error specified by + // a minor error number. + H5std_string getMinorString( hid_t err_minor_id ) const; - // Returns the detailed message set at the time the exception is thrown - H5std_string getDetailMsg() const; - const char* getCDetailMsg() const; // C string of detailed message - H5std_string getFuncName() const; // function name as a string object - const char* getCFuncName() const; // function name as a char string + // Returns the detailed message set at the time the exception is thrown + H5std_string getDetailMsg() const; + const char* getCDetailMsg() const; // C string of detailed message + H5std_string getFuncName() const; // function name as a string object + const char* getCFuncName() const; // function name as a char string - // Turns on the automatic error printing. - static void setAutoPrint(H5E_auto2_t& func, void* client_data); + // Turns on the automatic error printing. + static void setAutoPrint( H5E_auto2_t& func, void* client_data); - // Turns off the automatic error printing. - static void dontPrint(); + // Turns off the automatic error printing. + static void dontPrint(); - // Retrieves the current settings for the automatic error stack - // traversal function and its data. - static void getAutoPrint(H5E_auto2_t& func, void** client_data); + // Retrieves the current settings for the automatic error stack + // traversal function and its data. + static void getAutoPrint( H5E_auto2_t& func, void** client_data); - // Clears the error stack for the current thread. - static void clearErrorStack(); + // Clears the error stack for the current thread. + static void clearErrorStack(); - // Walks the error stack for the current thread, calling the - // specified function. - static void walkErrorStack(H5E_direction_t direction, - H5E_walk2_t func, void* client_data); + // Walks the error stack for the current thread, calling the + // specified function. + static void walkErrorStack( H5E_direction_t direction, + H5E_walk2_t func, void* client_data); - // Prints the error stack in a default manner. - static void printErrorStack(FILE* stream = stderr, - hid_t err_stack = H5E_DEFAULT); - virtual void printError(FILE* stream = NULL) const; + // Prints the error stack in a default manner. + static void printErrorStack(FILE* stream = stderr, + hid_t err_stack = H5E_DEFAULT); // Static + virtual void printError(FILE* stream = NULL) const; - // Default constructor - Exception(); + // Default constructor + Exception(); - // copy constructor - Exception(const Exception& orig); + // copy constructor + Exception( const Exception& orig); - // virtual Destructor - virtual ~Exception() throw(); + // virtual Destructor + virtual ~Exception() throw(); protected: - // Default value for detail_message - static const char DEFAULT_MSG[]; + // Default value for detail_message + static const char DEFAULT_MSG[]; private: - H5std_string detail_message; - H5std_string func_name; + H5std_string detail_message; + H5std_string func_name; }; class H5_DLLCPP FileIException : public Exception { public: - FileIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - FileIException(); - virtual ~FileIException() throw(); + FileIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + FileIException(); + virtual ~FileIException() throw(); }; class H5_DLLCPP GroupIException : public Exception { public: - GroupIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - GroupIException(); - virtual ~GroupIException() throw(); + GroupIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + GroupIException(); + virtual ~GroupIException() throw(); }; class H5_DLLCPP DataSpaceIException : public Exception { public: - DataSpaceIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - DataSpaceIException(); - virtual ~DataSpaceIException() throw(); + DataSpaceIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + DataSpaceIException(); + virtual ~DataSpaceIException() throw(); }; class H5_DLLCPP DataTypeIException : public Exception { public: - DataTypeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - DataTypeIException(); - virtual ~DataTypeIException() throw(); + DataTypeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + DataTypeIException(); + virtual ~DataTypeIException() throw(); }; class H5_DLLCPP ObjHeaderIException : public Exception { public: - ObjHeaderIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - ObjHeaderIException(); - virtual ~ObjHeaderIException() throw(); + ObjHeaderIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + ObjHeaderIException(); + virtual ~ObjHeaderIException() throw(); }; class H5_DLLCPP PropListIException : public Exception { public: - PropListIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - PropListIException(); - virtual ~PropListIException() throw(); + PropListIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + PropListIException(); + virtual ~PropListIException() throw(); }; class H5_DLLCPP DataSetIException : public Exception { public: - DataSetIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - DataSetIException(); - virtual ~DataSetIException() throw(); + DataSetIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + DataSetIException(); + virtual ~DataSetIException() throw(); }; class H5_DLLCPP AttributeIException : public Exception { public: - AttributeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - AttributeIException(); - virtual ~AttributeIException() throw(); + AttributeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + AttributeIException(); + virtual ~AttributeIException() throw(); }; class H5_DLLCPP ReferenceException : public Exception { public: - ReferenceException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - ReferenceException(); - virtual ~ReferenceException() throw(); + ReferenceException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + ReferenceException(); + virtual ~ReferenceException() throw(); }; class H5_DLLCPP LibraryIException : public Exception { public: - LibraryIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - LibraryIException(); - virtual ~LibraryIException() throw(); + LibraryIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + LibraryIException(); + virtual ~LibraryIException() throw(); }; class H5_DLLCPP LocationException : public Exception { public: - LocationException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - LocationException(); - virtual ~LocationException() throw(); + LocationException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + LocationException(); + virtual ~LocationException() throw(); }; class H5_DLLCPP IdComponentException : public Exception { public: - IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); - IdComponentException(); - virtual ~IdComponentException() throw(); + IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); + IdComponentException(); + virtual ~IdComponentException() throw(); }; } diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index 1ab812c..c3919da 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -63,7 +63,7 @@ FileAccPropList* FileAccPropList::getConstant() //-------------------------------------------------------------------------- // Function: FileAccPropList::deleteConstants -// Purpose Deletes the constant object that FileAccPropList::DEFAULT_ +// Purpose: Deletes the constant object that FileAccPropList::DEFAULT_ // points to. // exception H5::PropListIException // Programmer Binh-Minh Ribler - 2015 @@ -75,271 +75,271 @@ void FileAccPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for default property +// Purpose: Constant for default property //-------------------------------------------------------------------------- const FileAccPropList& FileAccPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Default Constructor -///\brief Creates a file access property list -// Programmer Binh-Minh Ribler - 2000 +// Function: Default Constructor +///\brief Creates a file access property list +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FileAccPropList::FileAccPropList() : PropList(H5P_FILE_ACCESS) {} +FileAccPropList::FileAccPropList() : PropList( H5P_FILE_ACCESS ) {} //-------------------------------------------------------------------------- -// Function: FileAccPropList copy constructor -///\brief Copy Constructor: makes a copy of the original -///\param original - IN: FileAccPropList instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: FileAccPropList copy constructor +///\brief Copy Constructor: makes a copy of the original +///\param original - IN: FileAccPropList instance to copy +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileAccPropList::FileAccPropList(const FileAccPropList& original) : PropList(original) {} //-------------------------------------------------------------------------- -// Function: FileAccPropList overloaded constructor -///\brief Creates a file access property list using the id of an -/// existing one. -// Programmer Binh-Minh Ribler - 2000 +// Function: FileAccPropList overloaded constructor +///\brief Creates a file access property list using the id of an +/// existing one. +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileAccPropList::FileAccPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: FileAccPropList::setStdio -///\brief Modifies this property list to use the \c H5FD_STDIO driver. +// Function: FileAccPropList::setStdio +///\brief Modifies this property list to use the \c H5FD_STDIO driver. /// -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setStdio() const { - herr_t ret_value = H5Pset_fapl_stdio(id); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setStdio", "H5Pset_fapl_stdio failed"); - } + herr_t ret_value = H5Pset_fapl_stdio(id); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::setStdio", "H5Pset_fapl_stdio failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getDriver -///\brief Return the ID of the low-level file driver. -///\return A low-level driver ID which is the same ID used when the -/// driver was set for the property list. The driver ID is -/// only valid as long as the file driver remains registered. -/// Valid driver identifiers can be found at: +// Function: FileAccPropList::getDriver +///\brief Return the ID of the low-level file driver. +///\return A low-level driver ID which is the same ID used when the +/// driver was set for the property list. The driver ID is +/// only valid as long as the file driver remains registered. +/// Valid driver identifiers can be found at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetDriver -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hid_t FileAccPropList::getDriver() const { - hid_t driver = H5Pget_driver(id); - if (driver < 0) - { - throw PropListIException("FileAccPropList::getDriver", "H5Pget_driver failed"); - } + hid_t driver = H5Pget_driver(id); + if (driver < 0) + { + throw PropListIException("FileAccPropList::getDriver", "H5Pget_driver failed"); + } return(driver); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setDriver -///\brief Set file driver for this property list. -///\param new_driver_id - IN: File driver -///\param new_driver_info - IN: Struct containing the driver-specific properites -///\exception H5::PropListIException +// Function: FileAccPropList::setDriver +///\brief Set file driver for this property list. +///\param new_driver_id - IN: File driver +///\param new_driver_info - IN: Struct containing the driver-specific properites +///\exception H5::PropListIException ///\par Description -/// For a list of valid driver identifiers, please see the C -/// layer Reference Manual at: +/// For a list of valid driver identifiers, please see the C +/// layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetDriver -// Programmer Binh-Minh Ribler - April, 2004 +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setDriver(hid_t new_driver_id, const void *new_driver_info) const { - herr_t ret_value = H5Pset_driver(id, new_driver_id, new_driver_info); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setDriver", "H5Pset_driver failed"); - } + herr_t ret_value = H5Pset_driver(id, new_driver_id, new_driver_info); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setDriver", "H5Pset_driver failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setFamilyOffset -///\brief Sets offset for family driver. -///\param offset - IN: offset value -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::setFamilyOffset +///\brief Sets offset for family driver. +///\param offset - IN: offset value +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setFamilyOffset(hsize_t offset) const { - herr_t ret_value = H5Pset_family_offset(id, offset); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setFamilyOffset", "H5Pset_family_offset failed"); - } + herr_t ret_value = H5Pset_family_offset(id, offset); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setFamilyOffset", "H5Pset_family_offset failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getFamilyOffset -///\brief Get offset for family driver. -///\return Offset for family driver -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getFamilyOffset +///\brief Get offset for family driver. +///\return Offset for family driver +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hsize_t FileAccPropList::getFamilyOffset() const { - hsize_t offset; - herr_t ret_value = H5Pget_family_offset(id, &offset); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getFamilyOffset", "H5Pget_family_offset failed"); - } + hsize_t offset; + herr_t ret_value = H5Pget_family_offset(id, &offset); + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getFamilyOffset", "H5Pget_family_offset failed"); + } return(offset); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setCore -///\brief Modifies this file access property list to use the \c H5FD_CORE -/// driver. -///\param increment - IN: Specifies how much memory to increase each -/// time more memory is needed, in bytes -///\param backing_store - IN: Indicating whether to write the file -/// contents to disk when the file is closed -///\exception H5::PropListIException +// Function: FileAccPropList::setCore +///\brief Modifies this file access property list to use the \c H5FD_CORE +/// driver. +///\param increment - IN: Specifies how much memory to increase each +/// time more memory is needed, in bytes +///\param backing_store - IN: Indicating whether to write the file +/// contents to disk when the file is closed +///\exception H5::PropListIException ///\par Description -/// For more details on the use of \c H5FD_CORE driver, please -/// refer to +/// For more details on the use of \c H5FD_CORE driver, please +/// refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplCore -// Programmer Binh-Minh Ribler - April, 2004 +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const { - herr_t ret_value = H5Pset_fapl_core (id, increment, backing_store); - if (ret_value < 0) - { - throw PropListIException ("FileAccPropList::setCore", "H5Pset_fapl_core failed"); - } + herr_t ret_value = H5Pset_fapl_core (id, increment, backing_store); + if (ret_value < 0) + { + throw PropListIException ("FileAccPropList::setCore", "H5Pset_fapl_core failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getCore -///\brief Queries core file driver properties. -///\param increment - OUT: Size of memory increment, in bytes -///\param backing_store - OUT: Indicating whether to write the file -/// contents to disk when the file is closed -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getCore +///\brief Queries core file driver properties. +///\param increment - OUT: Size of memory increment, in bytes +///\param backing_store - OUT: Indicating whether to write the file +/// contents to disk when the file is closed +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::getCore (size_t& increment, hbool_t& backing_store) const { - herr_t ret_value = H5Pget_fapl_core(id, &increment, &backing_store); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getCore", "H5Pget_fapl_core failed"); - } + herr_t ret_value = H5Pget_fapl_core(id, &increment, &backing_store); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::getCore", "H5Pget_fapl_core failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setFamily -///\brief Sets this file access property list to use the family driver. -///\param memb_size - IN: Size in bytes of each file member -///\param memb_plist - IN: File access property list to be used for -/// each family member -///\exception H5::PropListIException +// Function: FileAccPropList::setFamily +///\brief Sets this file access property list to use the family driver. +///\param memb_size - IN: Size in bytes of each file member +///\param memb_plist - IN: File access property list to be used for +/// each family member +///\exception H5::PropListIException ///\par Description -/// Note that \a memb_size is used only when creating a new file. -// Programmer Binh-Minh Ribler - April, 2004 +/// Note that \a memb_size is used only when creating a new file. +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void FileAccPropList::setFamily(hsize_t memb_size, const FileAccPropList& memb_plist) const +void FileAccPropList::setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const { - herr_t ret_value = H5Pset_fapl_family (id, memb_size, memb_plist.getId()); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setFamily", "H5Pset_fapl_family failed"); - } + herr_t ret_value = H5Pset_fapl_family (id, memb_size, memb_plist.getId() ); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::setFamily", "H5Pset_fapl_family failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getFamily -///\brief Returns information about the family file access property -/// list. -///\param memb_size - OUT: Size in bytes of each file member -///\param memb_plist - OUT: Retrieved file access property list for each -/// file member -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getFamily +///\brief Returns information about the family file access property +/// list. +///\param memb_size - OUT: Size in bytes of each file member +///\param memb_plist - OUT: Retrieved file access property list for each +/// file member +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const { - hid_t memb_plist_id; - herr_t ret_value = H5Pget_fapl_family(id, &memb_size, &memb_plist_id); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed"); - } - memb_plist.p_setId(memb_plist_id); + hid_t memb_plist_id; + herr_t ret_value = H5Pget_fapl_family( id, &memb_size, &memb_plist_id ); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed"); + } + memb_plist.p_setId(memb_plist_id); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getFamily -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts and its return value. -///\param memb_size - OUT: Size in bytes of each file member -///\return The file access property list for each file member -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getFamily +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts and its return value. +///\param memb_size - OUT: Size in bytes of each file member +///\return The file access property list for each file member +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const { - hid_t memb_plist_id; - herr_t ret_value = H5Pget_fapl_family(id, &memb_size, &memb_plist_id); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed"); - } - FileAccPropList memb_plist(memb_plist_id); - return(memb_plist); -} - -//-------------------------------------------------------------------------- -// Function: FileAccPropList::setSplit -///\brief Emulates the old split file driver, which stored meta data -/// in one file and raw data in another file. -///\param meta_plist - IN: File access plist for the metadata file -///\param raw_plist - IN: File access plist for the raw data file -///\param meta_ext - IN: Metadata filename extension as \c char* -///\param raw_ext - IN: Raw data filename extension as \c char* -///\exception H5::PropListIException + hid_t memb_plist_id; + herr_t ret_value = H5Pget_fapl_family( id, &memb_size, &memb_plist_id ); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed"); + } + FileAccPropList memb_plist(memb_plist_id); + return(memb_plist); +} + +//-------------------------------------------------------------------------- +// Function: FileAccPropList::setSplit +///\brief Emulates the old split file driver, which stored meta data +/// in one file and raw data in another file. +///\param meta_plist - IN: File access plist for the metadata file +///\param raw_plist - IN: File access plist for the raw data file +///\param meta_ext - IN: Metadata filename extension as \c char* +///\param raw_ext - IN: Raw data filename extension as \c char* +///\exception H5::PropListIException ///\par Description -/// Temporary - For information, please refer to: +/// Temporary - For information, please refer to: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplSplit -// Programmer Binh-Minh Ribler - April, 2004 +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext) const +void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext ) const { - hid_t meta_pid = meta_plist.getId(); - hid_t raw_pid = raw_plist.getId(); - herr_t ret_value = H5Pset_fapl_split(id, meta_ext, meta_pid, raw_ext, raw_pid); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setSplit", "H5Pset_fapl_split failed"); - } + hid_t meta_pid = meta_plist.getId(); + hid_t raw_pid = raw_plist.getId(); + herr_t ret_value = H5Pset_fapl_split( id, meta_ext, meta_pid, raw_ext, raw_pid ); + if( ret_value < 0 ) +{ + throw PropListIException("FileAccPropList::setSplit", "H5Pset_fapl_split failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setSplit -///\brief This is an overloaded member function, provided for convenience. -/// It takes character arguments as \c H5std_string. -///\param meta_plist - IN: File access plist for the metadata file -///\param raw_plist - IN: File access plist for the raw data file -///\param meta_ext - IN: Metadata filename extension as \c H5std_string -///\param raw_ext - IN: Raw data filename extension as \c H5std_string -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::setSplit +///\brief This is an overloaded member function, provided for convenience. +/// It takes character arguments as \c H5std_string. +///\param meta_plist - IN: File access plist for the metadata file +///\param raw_plist - IN: File access plist for the raw data file +///\param meta_ext - IN: Metadata filename extension as \c H5std_string +///\param raw_ext - IN: Raw data filename extension as \c H5std_string +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const H5std_string& meta_ext, const H5std_string& raw_ext) const +void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const H5std_string& meta_ext, const H5std_string& raw_ext ) const { - setSplit(meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str()); + setSplit( meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str() ); } // Stream Virtual File Driver had been removed from the main library. @@ -347,402 +347,402 @@ void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccP // -BMR, March, 2012 //-------------------------------------------------------------------------- -// Function: FileAccPropList::getSieveBufSize -///\brief Returns the current settings for the data sieve buffer size -/// property from this property list. -///\return Data sieve buffer size, in bytes -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getSieveBufSize +///\brief Returns the current settings for the data sieve buffer size +/// property from this property list. +///\return Data sieve buffer size, in bytes +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t FileAccPropList::getSieveBufSize() const { - size_t bufsize; - herr_t ret_value = H5Pget_sieve_buf_size(id, &bufsize); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed"); - } - return(bufsize); + size_t bufsize; + herr_t ret_value = H5Pget_sieve_buf_size(id, &bufsize); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed"); + } + return(bufsize); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setSieveBufSize -///\brief Sets the maximum size of the data sieve buffer. -///\param bufsize - IN: Maximum size, in bytes, of data sieve buffer -///\exception H5::PropListIException +// Function: FileAccPropList::setSieveBufSize +///\brief Sets the maximum size of the data sieve buffer. +///\param bufsize - IN: Maximum size, in bytes, of data sieve buffer +///\exception H5::PropListIException ///\par Description -/// For detail on data sieving, please refer to +/// For detail on data sieving, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSieveBufSize -// Programmer Binh-Minh Ribler - April, 2004 +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setSieveBufSize(size_t bufsize) const { - herr_t ret_value = H5Pset_sieve_buf_size(id, bufsize); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed"); - } + herr_t ret_value = H5Pset_sieve_buf_size(id, bufsize); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setMetaBlockSize -///\brief Sets the minimum size of metadata block allocations. -///\param block_size - IN: Minimum size, in bytes, of metadata -/// block allocations -///\exception H5::PropListIException +// Function: FileAccPropList::setMetaBlockSize +///\brief Sets the minimum size of metadata block allocations. +///\param block_size - IN: Minimum size, in bytes, of metadata +/// block allocations +///\exception H5::PropListIException ///\par Description -/// For more detail, please see the C layer Reference Manual at: +/// For more detail, please see the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMetaBlockSize -// Programmer Binh-Minh Ribler - April, 2004 +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setMetaBlockSize(hsize_t &block_size) const { - herr_t ret_value = H5Pset_meta_block_size(id, block_size); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setMetaBlockSize", "H5Pset_meta_block_size failed"); - } + herr_t ret_value = H5Pset_meta_block_size(id, block_size); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::setMetaBlockSize", "H5Pset_meta_block_size failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getMetaBlockSize -///\brief Returns the current metadata block size setting. -///\return Metadata block size -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getMetaBlockSize +///\brief Returns the current metadata block size setting. +///\return Metadata block size +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hsize_t FileAccPropList::getMetaBlockSize() const { - hsize_t block_size; - herr_t ret_value = H5Pget_meta_block_size(id, &block_size); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getMetaBlockSize", "H5Pget_meta_block_size failed"); - } - return(block_size); + hsize_t block_size; + herr_t ret_value = H5Pget_meta_block_size(id, &block_size); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::getMetaBlockSize", "H5Pget_meta_block_size failed"); + } + return(block_size); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setLog -///\brief Modifies this file access property list to use the logging -/// driver. -///\param logfile - IN: Name of the log file -///\param flags - IN: Flags specifying the types of logging activity -///\param buf_size - IN: Size of the logging buffer -///\exception H5::PropListIException +// Function: FileAccPropList::setLog +///\brief Modifies this file access property list to use the logging +/// driver. +///\param logfile - IN: Name of the log file +///\param flags - IN: Flags specifying the types of logging activity +///\param buf_size - IN: Size of the logging buffer +///\exception H5::PropListIException ///\par Description -/// For detail on \a flags, please refer to +/// For detail on \a flags, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplLog -// Programmer Binh-Minh Ribler - April, 2004 +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setLog(const char *logfile, unsigned flags, size_t buf_size) const { - herr_t ret_value = H5Pset_fapl_log(id, logfile, flags, buf_size); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setLog", "H5Pset_fapl_log failed"); - } + herr_t ret_value = H5Pset_fapl_log(id, logfile, flags, buf_size); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::setLog", "H5Pset_fapl_log failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setLog -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param logfile - IN: Name of the log file - string -///\param flags - IN: Flags specifying the types of logging activity -///\param buf_size - IN: Size of the logging buffer -// Programmer Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::setLog +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param logfile - IN: Name of the log file - string +///\param flags - IN: Flags specifying the types of logging activity +///\param buf_size - IN: Size of the logging buffer +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const { - setLog(logfile.c_str(), flags, buf_size); + setLog(logfile.c_str(), flags, buf_size); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setSec2 -///\brief Modifies this file access property list to use the sec2 -/// driver. +// Function: FileAccPropList::setSec2 +///\brief Modifies this file access property list to use the sec2 +/// driver. /// -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setSec2() const { - herr_t ret_value = H5Pset_fapl_sec2(id); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setSec2", "H5Pset_fapl_sec2 failed"); - } + herr_t ret_value = H5Pset_fapl_sec2(id); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::setSec2", "H5Pset_fapl_sec2 failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setAlignment -///\brief Sets the alignment properties of this property list. -///\param threshold - IN: Threshold value for file object size -///\param alignment - IN: Alignment value -///\exception H5::PropListIException +// Function: FileAccPropList::setAlignment +///\brief Sets the alignment properties of this property list. +///\param threshold - IN: Threshold value for file object size +///\param alignment - IN: Alignment value +///\exception H5::PropListIException ///\par Description -/// The parameter \a threshold must have a non-negative value. -/// Note that setting the threshold value to 0 (zero) has the -/// effect of a special case, forcing everything to be aligned. -/// The parameter \a alignment must have a positive value. +/// The parameter \a threshold must have a non-negative value. +/// Note that setting the threshold value to 0 (zero) has the +/// effect of a special case, forcing everything to be aligned. +/// The parameter \a alignment must have a positive value. /// -/// For detail on \a setting alignment, please refer to +/// For detail on \a setting alignment, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAlignment -// Programmer Binh-Minh Ribler - 2000 +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::setAlignment(hsize_t threshold, hsize_t alignment) const +void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const { - herr_t ret_value = H5Pset_alignment(id, threshold, alignment); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setAlignment", "H5Pset_alignment failed"); - } + herr_t ret_value = H5Pset_alignment( id, threshold, alignment ); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::setAlignment", "H5Pset_alignment failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getAlignment -///\brief Returns the current settings for alignment properties from -/// this property list. -///\param threshold - OUT: Retrieved threshold value for file object size -///\param alignment - OUT: Retrieved alignment value -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FileAccPropList::getAlignment +///\brief Returns the current settings for alignment properties from +/// this property list. +///\param threshold - OUT: Retrieved threshold value for file object size +///\param alignment - OUT: Retrieved alignment value +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::getAlignment(hsize_t &threshold, hsize_t &alignment) const +void FileAccPropList::getAlignment( hsize_t &threshold, hsize_t &alignment ) const { - herr_t ret_value = H5Pget_alignment(id, &threshold, &alignment); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getAlignment", "H5Pget_alignment failed"); - } + herr_t ret_value = H5Pget_alignment( id, &threshold, &alignment ); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::getAlignment", "H5Pget_alignment failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setMultiType -///\brief Sets data type for \c MULTI driver. -///\param dtype - IN: Type of data -///\exception H5::PropListIException +// Function: FileAccPropList::setMultiType +///\brief Sets data type for \c MULTI driver. +///\param dtype - IN: Type of data +///\exception H5::PropListIException ///\par Description -/// More details and valid values for \a dtype can be found at: +/// More details and valid values for \a dtype can be found at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMultiType -// Programmer Binh-Minh Ribler - April, 2004 +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setMultiType(H5FD_mem_t dtype) const { - herr_t ret_value = H5Pset_multi_type(id, dtype); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setMultiType", "H5Pset_multi_type failed"); - } + herr_t ret_value = H5Pset_multi_type(id, dtype); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::setMultiType", "H5Pset_multi_type failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getMultiType -///\brief Returns the data type property for \c MULTI driver. -///\return The data type property -///\exception H5::PropListIException +// Function: FileAccPropList::getMultiType +///\brief Returns the data type property for \c MULTI driver. +///\return The data type property +///\exception H5::PropListIException ///\par Description -/// More details and possible returned values can be found at: +/// More details and possible returned values can be found at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMultiType -// Programmer Binh-Minh Ribler - April, 2004 +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5FD_mem_t FileAccPropList::getMultiType() const { - H5FD_mem_t dtype; - herr_t ret_value = H5Pget_multi_type(id, &dtype); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getMultiType", "H5Pget_multi_type failed"); - } - return(dtype); + H5FD_mem_t dtype; + herr_t ret_value = H5Pget_multi_type(id, &dtype); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::getMultiType", "H5Pget_multi_type failed"); + } + return(dtype); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setCache -///\brief Sets the meta data cache and raw data chunk cache parameters. -///\param mdc_nelmts - IN: Number of elements in the meta data cache -///\param rdcc_nelmts - IN: Number of elements in the raw data chunk cache -///\param rdcc_nbytes - IN: Total size of the raw data chunk cache, in bytes -///\param rdcc_w0 - IN: Preemption policy -///\exception H5::PropListIException +// Function: FileAccPropList::setCache +///\brief Sets the meta data cache and raw data chunk cache parameters. +///\param mdc_nelmts - IN: Number of elements in the meta data cache +///\param rdcc_nelmts - IN: Number of elements in the raw data chunk cache +///\param rdcc_nbytes - IN: Total size of the raw data chunk cache, in bytes +///\param rdcc_w0 - IN: Preemption policy +///\exception H5::PropListIException ///\par Description -/// The argument \a rdcc_w0 should hold a value between 0 and 1 -/// inclusive. This value indicates how much chunks that have -/// been fully read are favored for preemption. A value of zero -/// means fully read chunks are treated no differently than other -/// chunks (the preemption is strictly LRU) while a value of one -/// means fully read chunks are always preempted before other chunks. -// Programmer Binh-Minh Ribler - 2000 +/// The argument \a rdcc_w0 should hold a value between 0 and 1 +/// inclusive. This value indicates how much chunks that have +/// been fully read are favored for preemption. A value of zero +/// means fully read chunks are treated no differently than other +/// chunks (the preemption is strictly LRU) while a value of one +/// means fully read chunks are always preempted before other chunks. +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::setCache(int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0) const +void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const { - herr_t ret_value = H5Pset_cache(id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setCache", "H5Pset_cache failed"); - } + herr_t ret_value = H5Pset_cache( id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0 ); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::setCache", "H5Pset_cache failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getCache -///\brief Queries the meta data cache and raw data chunk cache parameters. -///\param mdc_nelmts - OUT: Number of elements in the meta data cache -///\param rdcc_nelmts - OUT: Number of elements in the raw data chunk cache -///\param rdcc_nbytes - OUT: Total size of the raw data chunk cache, in bytes -///\param rdcc_w0 - OUT: Preemption policy -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FileAccPropList::getCache +///\brief Queries the meta data cache and raw data chunk cache parameters. +///\param mdc_nelmts - OUT: Number of elements in the meta data cache +///\param rdcc_nelmts - OUT: Number of elements in the raw data chunk cache +///\param rdcc_nbytes - OUT: Total size of the raw data chunk cache, in bytes +///\param rdcc_w0 - OUT: Preemption policy +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::getCache(int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0) const +void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const { - herr_t ret_value = H5Pget_cache(id, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getCache", "H5Pget_cache failed"); - } + herr_t ret_value = H5Pget_cache( id, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0 ); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::getCache", "H5Pget_cache failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setFcloseDegree -///\brief Sets the degree for the file close behavior. -///\param degree - IN: -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::setFcloseDegree +///\brief Sets the degree for the file close behavior. +///\param degree - IN: +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree) const { - herr_t ret_value = H5Pset_fclose_degree(id, degree); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setFcloseDegree", "H5Pset_fclose_degree failed"); - } + herr_t ret_value = H5Pset_fclose_degree(id, degree); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::setFcloseDegree", "H5Pset_fclose_degree failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getFcloseDegree -///\brief Returns the degree for the file close behavior. -///\return The degree for the file close behavior -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: FileAccPropList::getFcloseDegree +///\brief Returns the degree for the file close behavior. +///\return The degree for the file close behavior +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5F_close_degree_t FileAccPropList::getFcloseDegree() const { - H5F_close_degree_t degree; - herr_t ret_value = H5Pget_fclose_degree(id, °ree); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getFcloseDegree", "H5Pget_fclose_degree failed"); - } - return(degree); + H5F_close_degree_t degree; + herr_t ret_value = H5Pget_fclose_degree(id, °ree); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::getFcloseDegree", "H5Pget_fclose_degree failed"); + } + return(degree); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setGcReferences -///\brief Sets garbage collecting references flag. -///\param gc_ref - IN: Flag setting reference garbage collection to -/// on (1) or off (0). -///\exception H5::PropListIException +// Function: FileAccPropList::setGcReferences +///\brief Sets garbage collecting references flag. +///\param gc_ref - IN: Flag setting reference garbage collection to +/// on (1) or off (0). +///\exception H5::PropListIException ///\par Description -/// For detail on \a fapl, please refer to +/// For detail on \a fapl, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetGCReferences -// Programmer Binh-Minh Ribler - 2000 +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileAccPropList::setGcReferences(unsigned gc_ref) const +void FileAccPropList::setGcReferences( unsigned gc_ref ) const { - herr_t ret_value = H5Pset_gc_references(id, gc_ref); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::setGcReferences", "H5Pset_gc_references failed"); - } + herr_t ret_value = H5Pset_gc_references( id, gc_ref ); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::setGcReferences", "H5Pset_gc_references failed"); + } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getGcReferences -///\brief Returns the garbage collecting references setting. -///\return Garbage collecting references setting, 0 (off) or 1 (on) -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FileAccPropList::getGcReferences +///\brief Returns the garbage collecting references setting. +///\return Garbage collecting references setting, 0 (off) or 1 (on) +///\exception H5::PropListIException +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- unsigned FileAccPropList::getGcReferences() const { - unsigned gc_ref; + unsigned gc_ref; - // the name of this routine will be changed to H5Pget_gc_references??? - herr_t ret_value = H5Pget_gc_references(id, &gc_ref); - if (ret_value < 0) - { - throw PropListIException("FileAccPropList::getGcReferences", "H5Pget_gc_references failed"); - } - return(gc_ref); + // the name of this routine will be changed to H5Pget_gc_references??? + herr_t ret_value = H5Pget_gc_references( id, &gc_ref ); + if( ret_value < 0 ) + { + throw PropListIException("FileAccPropList::getGcReferences", "H5Pget_gc_references failed"); + } + return( gc_ref ); } //-------------------------------------------------------------------------- -// Function: FileAccPropList::setLibverBounds -///\brief Sets bounds on versions of library format to be used when creating -/// or writing objects. -///\param libver_low - IN: Earliest version of the library that will be -/// used for creating or writing objects -///\param libver_high - IN: Latest version of the library that will be -///\exception H5::PropListIException +// Function: FileAccPropList::setLibverBounds +///\brief Sets bounds on versions of library format to be used when creating +/// or writing objects. +///\param libver_low - IN: Earliest version of the library that will be +/// used for creating or writing objects +///\param libver_high - IN: Latest version of the library that will be +///\exception H5::PropListIException ///\par Description -/// Valid values of \a libver_low are as follows: -/// \li \c H5F_LIBVER_EARLIEST (Default) -/// \li \c H5F_LIBVER_18 -/// \li \c H5F_LIBVER_LATEST +/// Valid values of \a libver_low are as follows: +/// \li \c H5F_LIBVER_EARLIEST (Default) +/// \li \c H5F_LIBVER_18 +/// \li \c H5F_LIBVER_LATEST /// -/// Valid values of \a libver_high are as follows: -/// \li \c H5F_LIBVER_18 -/// \li \c H5F_LIBVER_LATEST (Default) +/// Valid values of \a libver_high are as follows: +/// \li \c H5F_LIBVER_18 +/// \li \c H5F_LIBVER_LATEST (Default) /// -/// For more details, please refer to +/// For more details, please refer to /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLibverBounds -// Programmer Binh-Minh Ribler - March, 2015 +// Programmer: Binh-Minh Ribler - March, 2015 //-------------------------------------------------------------------------- void FileAccPropList::setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const { herr_t ret_value = H5Pset_libver_bounds(id, libver_low, libver_high); if (ret_value < 0) { - throw PropListIException("FileAccPropList::setLibverBounds", "H5Pset_libver_bounds failed"); + throw PropListIException("FileAccPropList::setLibverBounds", "H5Pset_libver_bounds failed"); } } //-------------------------------------------------------------------------- -// Function: FileAccPropList::getLibverBounds -///\brief Gets the current settings for the library version format bounds -/// from a file access property list. -///\param libver_low - OUT: Earliest version of the library that will be -/// used for creating or writing objects -///\param libver_high - OUT: Latest version of the library that will be -/// used for creating or writing objects -///\exception H5::PropListIException +// Function: FileAccPropList::getLibverBounds +///\brief Gets the current settings for the library version format bounds +/// from a file access property list. +///\param libver_low - OUT: Earliest version of the library that will be +/// used for creating or writing objects +///\param libver_high - OUT: Latest version of the library that will be +/// used for creating or writing objects +///\exception H5::PropListIException ///\par Description -/// On success, the argument \a libver_low can have the following -/// values: -/// \li \c H5F_LIBVER_EARLIEST -/// \li \c H5F_LIBVER_18 -/// \li \c H5F_LIBVER_LATEST +/// On success, the argument \a libver_low can have the following +/// values: +/// \li \c H5F_LIBVER_EARLIEST +/// \li \c H5F_LIBVER_18 +/// \li \c H5F_LIBVER_LATEST /// -/// and \a libver_high: -/// \li \c H5F_LIBVER_18 -/// \li \c H5F_LIBVER_LATEST -// Programmer Binh-Minh Ribler - March, 2015 +/// and \a libver_high: +/// \li \c H5F_LIBVER_18 +/// \li \c H5F_LIBVER_LATEST +// Programmer: Binh-Minh Ribler - March, 2015 //-------------------------------------------------------------------------- void FileAccPropList::getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const { herr_t ret_value = H5Pget_libver_bounds(id, &libver_low, &libver_high); - if (ret_value < 0) + if( ret_value < 0 ) { - throw PropListIException("FileAccPropList::getLibverBounds", "H5Pget_libver_bounds failed"); + throw PropListIException("FileAccPropList::getLibverBounds", "H5Pget_libver_bounds failed"); } } //-------------------------------------------------------------------------- -// Function: FileAccPropList destructor -///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Function: FileAccPropList destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileAccPropList::~FileAccPropList() {} diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index ae7c7f9..aec5fcc 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -27,121 +27,121 @@ namespace H5 { */ class H5_DLLCPP FileAccPropList : public PropList { public: - ///\brief Default file access property list. - static const FileAccPropList& DEFAULT; + ///\brief Default file access property list. + static const FileAccPropList& DEFAULT; - // Creates a file access property list. - FileAccPropList(); + // Creates a file access property list. + FileAccPropList(); - // Modifies this property list to use the H5FD_STDIO driver - void setStdio() const; + // Modifies this property list to use the H5FD_STDIO driver + void setStdio() const; - // Set file driver for this property list - void setDriver(hid_t new_driver_id, const void *new_driver_info) const; + // Set file driver for this property list + void setDriver(hid_t new_driver_id, const void *new_driver_info) const; - // Returns a low-level file driver identifier. - hid_t getDriver() const; + // Returns a low-level file driver identifier. + hid_t getDriver() const; - // Sets offset for family driver. - void setFamilyOffset(hsize_t offset) const; + // Sets offset for family driver. + void setFamilyOffset(hsize_t offset) const; - // Gets offset for family driver. - hsize_t getFamilyOffset() const; + // Gets offset for family driver. + hsize_t getFamilyOffset() const; - // Modifies this file access property list to use the sec2 driver. - void setSec2() const; + // Modifies this file access property list to use the sec2 driver. + void setSec2() const; - // Modifies this file access property list to use the H5FD_CORE - // driver. - void setCore (size_t increment, hbool_t backing_store) const; + // Modifies this file access property list to use the H5FD_CORE + // driver. + void setCore (size_t increment, hbool_t backing_store) const; - // Queries H5FD_CORE driver properties. - void getCore (size_t& increment, hbool_t& backing_store) const; + // Queries H5FD_CORE driver properties. + void getCore (size_t& increment, hbool_t& backing_store) const; - // Sets this file access properties list to the family driver. - void setFamily(hsize_t memb_size, const FileAccPropList& memb_plist) const; + // Sets this file access properties list to the family driver. + void setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const; - // Returns information about the family file access property list. - void getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const; - FileAccPropList getFamily(hsize_t& memb_size) const; + // Returns information about the family file access property list. + void getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const; + FileAccPropList getFamily(hsize_t& memb_size) const; - // Emulates the old split file driver, - void setSplit(const FileAccPropList& meta_plist, - const FileAccPropList& raw_plist, - const char* meta_ext = ".meta", - const char* raw_ext = ".raw") const; - void setSplit(const FileAccPropList& meta_plist, - const FileAccPropList& raw_plist, - const H5std_string& meta_ext = ".meta", - const H5std_string& raw_ext = ".raw") const; + // Emulates the old split file driver, + void setSplit(const FileAccPropList& meta_plist, + const FileAccPropList& raw_plist, + const char* meta_ext = ".meta", + const char* raw_ext = ".raw" ) const; + void setSplit(const FileAccPropList& meta_plist, + const FileAccPropList& raw_plist, + const H5std_string& meta_ext = ".meta", + const H5std_string& raw_ext = ".raw") const; - // Sets the maximum size of the data sieve buffer. - void setSieveBufSize(size_t bufsize) const; + // Sets the maximum size of the data sieve buffer. + void setSieveBufSize(size_t bufsize) const; - // Returns the current settings for the data sieve buffer size - // property - size_t getSieveBufSize() const; + // Returns the current settings for the data sieve buffer size + // property + size_t getSieveBufSize() const; - // Sets the minimum size of metadata block allocations. - void setMetaBlockSize(hsize_t &block_size) const; + // Sets the minimum size of metadata block allocations. + void setMetaBlockSize(hsize_t &block_size) const; - // Returns the current metadata block size setting. - hsize_t getMetaBlockSize() const; + // Returns the current metadata block size setting. + hsize_t getMetaBlockSize() const; - // Modifies this file access property list to use the logging driver. - void setLog(const char *logfile, unsigned flags, size_t buf_size) const; - void setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const; + // Modifies this file access property list to use the logging driver. + void setLog(const char *logfile, unsigned flags, size_t buf_size) const; + void setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const; - // Sets alignment properties of this file access property list - void setAlignment(hsize_t threshold = 1, hsize_t alignment = 1) const; + // Sets alignment properties of this file access property list + void setAlignment( hsize_t threshold = 1, hsize_t alignment = 1 ) const; - // Retrieves the current settings for alignment properties from - // this property list. - void getAlignment(hsize_t& threshold, hsize_t& alignment) const; + // Retrieves the current settings for alignment properties from + // this property list. + void getAlignment( hsize_t& threshold, hsize_t& alignment ) const; - // Sets data type for multi driver. - void setMultiType(H5FD_mem_t dtype) const; + // Sets data type for multi driver. + void setMultiType(H5FD_mem_t dtype) const; - // Returns the data type property for MULTI driver. - H5FD_mem_t getMultiType() const; + // Returns the data type property for MULTI driver. + H5FD_mem_t getMultiType() const; - // Sets the meta data cache and raw data chunk cache parameters. - void setCache(int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0) const; + // Sets the meta data cache and raw data chunk cache parameters. + void setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const; - // Queries the meta data cache and raw data chunk cache parameters. - void getCache(int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0) const; + // Queries the meta data cache and raw data chunk cache parameters. + void getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const; - // Sets the degree for the file close behavior. - void setFcloseDegree(H5F_close_degree_t degree) const; + // Sets the degree for the file close behavior. + void setFcloseDegree(H5F_close_degree_t degree) const; - // Returns the degree for the file close behavior. - H5F_close_degree_t getFcloseDegree() const; + // Returns the degree for the file close behavior. + H5F_close_degree_t getFcloseDegree() const; - // Sets garbage collecting references flag. - void setGcReferences(unsigned gc_ref = 0) const; + // Sets garbage collecting references flag. + void setGcReferences( unsigned gc_ref = 0 ) const; - // Returns garbage collecting references setting. - unsigned getGcReferences() const; + // Returns garbage collecting references setting. + unsigned getGcReferences() const; - // Sets bounds on versions of library format to be used when creating - // or writing objects. - void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const; + // Sets bounds on versions of library format to be used when creating + // or writing objects. + void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const; - // Gets the current settings for the library version format bounds. - void getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const; + // Gets the current settings for the library version format bounds. + void getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("FileAccPropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("FileAccPropList"); } - // Copy constructor: creates a copy of a FileAccPropList object. - FileAccPropList(const FileAccPropList& original); + // Copy constructor: creates a copy of a FileAccPropList object. + FileAccPropList( const FileAccPropList& original ); - // Creates a copy of an existing file access property list - // using the property list id. - FileAccPropList (const hid_t plist_id); + // Creates a copy of an existing file access property list + // using the property list id. + FileAccPropList (const hid_t plist_id); - // Noop destructor - virtual ~FileAccPropList(); + // Noop destructor + virtual ~FileAccPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index c490f26..5a99dba 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -33,7 +33,7 @@ FileCreatPropList* FileCreatPropList::DEFAULT_ = 0; //-------------------------------------------------------------------------- // Function: FileCreatPropList::getConstant -// Purpose Creates a FileCreatPropList object representing the HDF5 +// Purpose: Creates a FileCreatPropList object representing the HDF5 // constant H5P_FILE_ACCESS, pointed to by FileCreatPropList::DEFAULT_ // exception H5::PropListIException // Description @@ -62,7 +62,7 @@ FileCreatPropList* FileCreatPropList::getConstant() //-------------------------------------------------------------------------- // Function: FileCreatPropList::deleteConstants -// Purpose Deletes the constant object that FileCreatPropList::DEFAULT_ +// Purpose: Deletes the constant object that FileCreatPropList::DEFAULT_ // points to. // Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- @@ -73,302 +73,231 @@ void FileCreatPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for default property +// Purpose Constant for default property //-------------------------------------------------------------------------- const FileCreatPropList& FileCreatPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: FileCreatPropList default constructor -///\brief Default constructor: Creates a file create property list -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList default constructor +///\brief Default constructor: Creates a file create property list +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FileCreatPropList::FileCreatPropList() : PropList(H5P_FILE_CREATE) {} +FileCreatPropList::FileCreatPropList() : PropList( H5P_FILE_CREATE ) {} //-------------------------------------------------------------------------- -// Function: FileCreatPropList copy constructor -///\brief Copy constructor: makes a copy of the original -/// FileCreatPropList object. -///\param original - IN: FileCreatPropList instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList copy constructor +///\brief Copy constructor: makes a copy of the original +/// FileCreatPropList object. +///\param original - IN: FileCreatPropList instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FileCreatPropList::FileCreatPropList(const FileCreatPropList& original) : PropList( original ) {} +FileCreatPropList::FileCreatPropList( const FileCreatPropList& original ) : PropList( original ) {} //-------------------------------------------------------------------------- -// Function: FileCreatPropList overloaded constructor -///\brief Creates a file creation property list using the id of an -/// existing one. -///\param plist_id - IN: FileCreatPropList id to use -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList overloaded constructor +///\brief Creates a file creation property list using the id of an +/// existing one. +///\param plist_id - IN: FileCreatPropList id to use +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList::FileCreatPropList(const hid_t plist_id) : PropList(plist_id) {} #ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getVersion -///\brief Retrieves version information for various parts of a file. -///\param super - OUT: The file super block. -///\param freelist - OUT: The global free list. -///\param stab - OUT: The root symbol table entry. -///\param shhdr - OUT: Shared object headers. -///\exception H5::PropListIException +// Function: FileCreatPropList::getVersion +///\brief Retrieves version information for various parts of a file. +///\param super - OUT: The file super block. +///\param freelist - OUT: The global free list. +///\param stab - OUT: The root symbol table entry. +///\param shhdr - OUT: Shared object headers. +///\exception H5::PropListIException ///\par Description -/// Any (or even all) of the output arguments can be null pointers. -// Programmer Binh-Minh Ribler - 2000 +/// Any (or even all) of the output arguments can be null pointers. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr) const { - herr_t ret_value = H5Pget_version(id, &super, &freelist, &stab, &shhdr); - if (ret_value < 0) - { - throw PropListIException("FileCreatPropList::getVersion", - "H5Pget_version failed"); - } + herr_t ret_value = H5Pget_version( id, &super, &freelist, &stab, &shhdr ); + if( ret_value < 0 ) + { + throw PropListIException("FileCreatPropList::getVersion", + "H5Pget_version failed"); + } } #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setUserblock -///\brief Sets the user block size field of this file creation property list. -///\param size - IN: User block size to be set, in bytes -///\exception H5::PropListIException +// Function: FileCreatPropList::setUserblock +///\brief Sets the user block size field of this file creation property list. +///\param size - IN: User block size to be set, in bytes +///\exception H5::PropListIException ///\par Description -/// The default user block size is 0; it may be set to any power -/// of 2 equal to 512 or greater (512, 1024, 2048, etc.) -// Programmer Binh-Minh Ribler - 2000 +/// The default user block size is 0; it may be set to any power +/// of 2 equal to 512 or greater (512, 1024, 2048, etc.) +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::setUserblock(hsize_t size) const +void FileCreatPropList::setUserblock( hsize_t size ) const { - herr_t ret_value = H5Pset_userblock(id, size); - if (ret_value < 0) - { - throw PropListIException("FileCreatPropList::setUserblock", - "H5Pset_userblock failed"); - } + herr_t ret_value = H5Pset_userblock( id, size); + if( ret_value < 0 ) + { + throw PropListIException("FileCreatPropList::setUserblock", + "H5Pset_userblock failed"); + } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getUserblock -///\brief Returns the user block size of this file creation property list. -///\return User block size -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList::getUserblock +///\brief Returns the user block size of this file creation property list. +///\return User block size +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hsize_t FileCreatPropList::getUserblock() const { - hsize_t userblock_size; - herr_t ret_value = H5Pget_userblock(id, &userblock_size); - if (ret_value < 0) - { - throw PropListIException("FileCreatPropList::getUserblock", - "H5Pget_userblock failed"); - } - return(userblock_size); + hsize_t userblock_size; + herr_t ret_value = H5Pget_userblock( id, &userblock_size ); + if( ret_value < 0 ) + { + throw PropListIException("FileCreatPropList::getUserblock", + "H5Pget_userblock failed"); + } + return( userblock_size ); } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setSizes -///\brief Sets the byte size of the offsets and lengths used to -/// address objects in an HDF5 file. -///\param sizeof_addr - IN: Size of an object offset in bytes -///\param sizeof_size - IN: Size of an object length in bytes. -///\exception H5::PropListIException +// Function: FileCreatPropList::setSizes +///\brief Sets the byte size of the offsets and lengths used to +/// address objects in an HDF5 file. +///\param sizeof_addr - IN: Size of an object offset in bytes +///\param sizeof_size - IN: Size of an object length in bytes. +///\exception H5::PropListIException ///\par Description -/// For information on setting sizes, please refer to the -/// C layer Reference Manual at: +/// For information on setting sizes, please refer to the +/// C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSizes -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::setSizes(size_t sizeof_addr, size_t sizeof_size) const +void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const { - herr_t ret_value = H5Pset_sizes(id, sizeof_addr, sizeof_size); - if (ret_value < 0) - { - throw PropListIException("FileCreatPropList::setSizes", - "H5Pset_sizes failed"); - } + herr_t ret_value = H5Pset_sizes( id, sizeof_addr, sizeof_size ); + if( ret_value < 0 ) + { + throw PropListIException("FileCreatPropList::setSizes", + "H5Pset_sizes failed"); + } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getSizes -///\brief Retrieves the size of the offsets and lengths used in an -/// HDF5 file. +// Function: FileCreatPropList::getSizes +///\brief Retrieves the size of the offsets and lengths used in an +/// HDF5 file. /// -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::getSizes(size_t& sizeof_addr, size_t& sizeof_size) const +void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const { - herr_t ret_value = H5Pget_sizes(id, &sizeof_addr, &sizeof_size); - if (ret_value < 0) - { - throw PropListIException("FileCreatPropList::getSizes", - "H5Pget_sizes failed"); - } + herr_t ret_value = H5Pget_sizes( id, &sizeof_addr, &sizeof_size ); + if( ret_value < 0 ) + { + throw PropListIException("FileCreatPropList::getSizes", + "H5Pget_sizes failed"); + } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setSymk -///\brief Sets the size of parameters used to control the symbol table -/// nodes. -///\param ik - IN: Symbol table tree rank -///\param lk - IN: Symbol table node size -///\exception H5::PropListIException +// Function: FileCreatPropList::setSymk +///\brief Sets the size of parameters used to control the symbol table +/// nodes. +///\param ik - IN: Symbol table tree rank +///\param lk - IN: Symbol table node size +///\exception H5::PropListIException ///\par Description -/// For information, please see the C layer Reference Manual at: +/// For information, please see the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSymK -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::setSymk(unsigned ik, unsigned lk) const +void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const { - herr_t ret_value = H5Pset_sym_k(id, ik, lk); - if (ret_value < 0) - { - throw PropListIException("FileCreatPropList::setSymk", - "H5Pset_sym_k failed"); - } + herr_t ret_value = H5Pset_sym_k( id, ik, lk ); + if( ret_value < 0 ) + { + throw PropListIException("FileCreatPropList::setSymk", + "H5Pset_sym_k failed"); + } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getSymk -///\brief Retrieves the size of the symbol table B-tree 1/2 rank and -/// the symbol table leaf node 1/2 size. +// Function: FileCreatPropList::getSymk +///\brief Retrieves the size of the symbol table B-tree 1/2 rank and +/// the symbol table leaf node 1/2 size. /// -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// For information, please see +/// For information, please see /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetSymK -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::getSymk(unsigned& ik, unsigned& lk) const +void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const { - herr_t ret_value = H5Pget_sym_k(id, &ik, &lk); - if (ret_value < 0) - { - throw PropListIException("FileCreatPropList::getSymk", - "H5Pget_sym_k failed"); - } + herr_t ret_value = H5Pget_sym_k( id, &ik, &lk ); + if( ret_value < 0 ) + { + throw PropListIException("FileCreatPropList::getSymk", + "H5Pget_sym_k failed"); + } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setIstorek -///\brief Sets the size of the parameter used to control the B-trees -/// for indexing chunked datasets. -///\param ik - IN: 1/2 rank of chunked storage B-tree -///\exception H5::PropListIException +// Function: FileCreatPropList::setIstorek +///\brief Sets the size of the parameter used to control the B-trees +/// for indexing chunked datasets. +///\param ik - IN: 1/2 rank of chunked storage B-tree +///\exception H5::PropListIException ///\par Description -/// For information, please see the C layer Reference Manual at: +/// For information, please see the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetIstoreK -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FileCreatPropList::setIstorek(unsigned ik) const +void FileCreatPropList::setIstorek( unsigned ik ) const { - herr_t ret_value = H5Pset_istore_k(id, ik); - if (ret_value < 0) - { - throw PropListIException("FileCreatPropList::setIstorek", - "H5Pset_istore_k failed"); - } + herr_t ret_value = H5Pset_istore_k( id, ik ); + if( ret_value < 0 ) + { + throw PropListIException("FileCreatPropList::setIstorek", + "H5Pset_istore_k failed"); + } } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getIstorek -///\brief Returns the 1/2 rank of an indexed storage B-tree. -///\return 1/2 rank of chunked storage B-tree -///\exception H5::PropListIException +// Function: FileCreatPropList::getIstorek +///\brief Returns the 1/2 rank of an indexed storage B-tree. +///\return 1/2 rank of chunked storage B-tree +///\exception H5::PropListIException ///\par Description -/// For information, please see +/// For information, please see /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetIstoreK -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- unsigned FileCreatPropList::getIstorek() const { - unsigned ik; - herr_t ret_value = H5Pget_istore_k(id, &ik); - if (ret_value < 0) - { - throw PropListIException("FileCreatPropList::getIstorek", - "H5Pget_istore_k failed"); - } - return(ik); -} - -//-------------------------------------------------------------------------- -// Function: FileCreatPropList::setFileSpace -///\brief Sets the strategy and the threshold value that the library -/// will employ in managing file space. -///\param strategy - IN: Strategy for file space management -///\param threshold - IN: Free-space section threshold. The library -/// default is 1, which is to track all free-space sections. -///\exception H5::PropListIException -///\par Description -/// If the given strategy is zero, the property will not be -/// changed and the existing strategy will be retained. -/// If the given threshold value is zero, the property will not be -/// changed and the existing threshold will be retained. -/// Valid values of \a libver_low are as follows: -/// \li \c H5F_FILE_SPACE_ALL (Default) -/// \li \c H5F_FILE_SPACE_ALL_PERSIST -/// \li \c H5F_FILE_SPACE_AGGR_VFD -/// \li \c H5F_FILE_SPACE_VFD -/// For information, please see the C layer Reference Manual at: -/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFileSpace -// Programmer Binh-Minh Ribler - Feb, 2017 -//-------------------------------------------------------------------------- -void FileCreatPropList::setFileSpace(H5F_file_space_type_t strategy, hsize_t threshold) const -{ - herr_t ret_value = H5Pset_file_space(id, strategy, threshold); - if (ret_value < 0) - { - throw PropListIException("FileCreatPropList::setFileSpace", - "H5Pset_file_space failed"); - } -} - -//-------------------------------------------------------------------------- -// Function: FileCreatPropList::getFileSpaceStrategy -///\brief Returns the strategy that the library uses in managing file space. -///\return The strategy value -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - Feb, 2017 -//-------------------------------------------------------------------------- -H5F_file_space_type_t FileCreatPropList::getFileSpaceStrategy() const -{ - H5F_file_space_type_t strategy = H5F_FILE_SPACE_ALL; - herr_t ret_value = H5Pget_file_space(id, &strategy, NULL); - if (ret_value < 0) - { - throw PropListIException("FileCreatPropList::getFileSpaceStrategy", - "H5Pget_file_space for strategy failed"); - } - return(strategy); -} - -//-------------------------------------------------------------------------- -// Function: FileCreatPropList::getFileSpaceThreshold -///\brief Returns the threshold value that the library uses in tracking -/// free space sections. -///\return The threshold value -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - Feb, 2017 -//-------------------------------------------------------------------------- -hsize_t FileCreatPropList::getFileSpaceThreshold() const -{ - hsize_t threshold = 0; - herr_t ret_value = H5Pget_file_space(id, NULL, &threshold); - if (ret_value < 0) - { - throw PropListIException("FileCreatPropList::getFileSpaceThreshold", - "H5Pget_file_space for threshold failed"); - } - return(threshold); + unsigned ik; + herr_t ret_value = H5Pget_istore_k( id, &ik ); + if( ret_value < 0 ) + { + throw PropListIException("FileCreatPropList::getIstorek", + "H5Pget_istore_k failed"); + } + return( ik ); } //-------------------------------------------------------------------------- -// Function: FileCreatPropList destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: FileCreatPropList destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList::~FileCreatPropList() {} diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 1bbaabf..1ac925e 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -27,78 +27,67 @@ namespace H5 { */ class H5_DLLCPP FileCreatPropList : public PropList { public: - ///\brief Default file creation property list. - static const FileCreatPropList& DEFAULT; + ///\brief Default file creation property list. + static const FileCreatPropList& DEFAULT; - // Creates a file create property list. - FileCreatPropList(); + // Creates a file create property list. + FileCreatPropList(); #ifndef H5_NO_DEPRECATED_SYMBOLS - // Retrieves version information for various parts of a file. - void getVersion(unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr) const; + // Retrieves version information for various parts of a file. + void getVersion( unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr ) const; #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Sets the userblock size field of a file creation property list. - void setUserblock(hsize_t size) const; + // Sets the userblock size field of a file creation property list. + void setUserblock( hsize_t size ) const; - // Gets the size of a user block in this file creation property list. - hsize_t getUserblock() const; + // Gets the size of a user block in this file creation property list. + hsize_t getUserblock() const; - // Retrieves the size-of address and size quantities stored in a - // file according to this file creation property list. - void getSizes(size_t& sizeof_addr, size_t& sizeof_size) const; + // Retrieves the size-of address and size quantities stored in a + // file according to this file creation property list. + void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const; - // Sets file size-of addresses and sizes. - void setSizes(size_t sizeof_addr = 4, size_t sizeof_size = 4) const; + // Sets file size-of addresses and sizes. + void setSizes( size_t sizeof_addr = 4, size_t sizeof_size = 4 ) const; - // Retrieves the size of the symbol table B-tree 1/2 rank and the - // symbol table leaf node 1/2 size. - void getSymk(unsigned& int_nodes_k, unsigned& leaf_nodes_k) const; + // Retrieves the size of the symbol table B-tree 1/2 rank and the + // symbol table leaf node 1/2 size. + void getSymk( unsigned& int_nodes_k, unsigned& leaf_nodes_k ) const; - // Sets the size of parameters used to control the symbol table nodes. - void setSymk(unsigned int_nodes_k, unsigned leaf_nodes_k) const; + // Sets the size of parameters used to control the symbol table nodes. + void setSymk( unsigned int_nodes_k, unsigned leaf_nodes_k ) const; - // Returns the 1/2 rank of an indexed storage B-tree. - unsigned getIstorek() const; + // Returns the 1/2 rank of an indexed storage B-tree. + unsigned getIstorek() const; - // Sets the size of parameter used to control the B-trees for - // indexing chunked datasets. - void setIstorek(unsigned ik) const; + // Sets the size of parameter used to control the B-trees for + // indexing chunked datasets. + void setIstorek( unsigned ik ) const; - // Sets the strategy and the threshold value that the library will - // will employ in managing file space. - void setFileSpace(H5F_file_space_type_t strategy, hsize_t threshold) const; + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("FileCreatPropList"); } - // Returns the strategy that the library uses in managing file space. - H5F_file_space_type_t getFileSpaceStrategy() const; + // Copy constructor: creates a copy of a FileCreatPropList object. + FileCreatPropList(const FileCreatPropList& orig); - // Returns the threshold value that the library uses in tracking free - // space sections. - hsize_t getFileSpaceThreshold() const; + // Creates a copy of an existing file create property list + // using the property list id. + FileCreatPropList (const hid_t plist_id); - ///\brief Returns this class name. - virtual H5std_string fromClass() const { return("FileCreatPropList"); } - - // Copy constructor: creates a copy of a FileCreatPropList object. - FileCreatPropList(const FileCreatPropList& orig); - - // Creates a copy of an existing file create property list - // using the property list id. - FileCreatPropList(const hid_t plist_id); - - // Noop destructor - virtual ~FileCreatPropList(); + // Noop destructor + virtual ~FileCreatPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Deletes the global constant, should only be used by the library - static void deleteConstants(); + // Deletes the global constant, should only be used by the library + static void deleteConstants(); private: - static FileCreatPropList* DEFAULT_; + static FileCreatPropList* DEFAULT_; - // Creates the global constant, should only be used by the library - static FileCreatPropList* getConstant(); + // Creates the global constant, should only be used by the library + static FileCreatPropList* getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index cdb5837..fcf4e1c 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -46,43 +46,43 @@ namespace H5 { //-------------------------------------------------------------------------- // Function H5File default constructor -///\brief Default constructor: creates a stub H5File object. -// Programmer Binh-Minh Ribler - 2000 +///\brief Default constructor: creates a stub H5File object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File() : Group(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: H5File overloaded constructor -///\brief Creates or opens an HDF5 file depending on the parameter flags. -///\param name - IN: Name of the file -///\param flags - IN: File access flags -///\param create_plist - IN: File creation property list, used when -/// modifying default file meta-data. Default to -/// FileCreatPropList::DEFAULT -///\param access_plist - IN: File access property list. Default to -/// FileAccPropList::DEFAULT +// Function: H5File overloaded constructor +///\brief Creates or opens an HDF5 file depending on the parameter flags. +///\param name - IN: Name of the file +///\param flags - IN: File access flags +///\param create_plist - IN: File creation property list, used when +/// modifying default file meta-data. Default to +/// FileCreatPropList::DEFAULT +///\param access_plist - IN: File access property list. Default to +/// FileAccPropList::DEFAULT ///\par Description -/// Valid values of \a flags include: -/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, -/// erasing all data previously stored in -/// the file. -/// \li \c H5F_ACC_EXCL - Fail if file already exists. -/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive -/// \li \c H5F_ACC_RDONLY - Open file as read-only, if it already -/// exists, and fail, otherwise -/// \li \c H5F_ACC_RDWR - Open file for read/write, if it already -/// exists, and fail, otherwise +/// Valid values of \a flags include: +/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, +/// erasing all data previously stored in +/// the file. +/// \li \c H5F_ACC_EXCL - Fail if file already exists. +/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive +/// \li \c H5F_ACC_RDONLY - Open file as read-only, if it already +/// exists, and fail, otherwise +/// \li \c H5F_ACC_RDWR - Open file for read/write, if it already +/// exists, and fail, otherwise ///\par -/// For info on file creation in the case of an already-open file, -/// please refer to the \b Special \b case section in the C layer -/// Reference Manual at: +/// For info on file creation in the case of an already-open file, +/// please refer to the \b Special \b case section in the C layer +/// Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create // Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file -// could not be caught in the applications. Added try block here -// to catch then re-throw it. -BMR 2013/03/21 -// Programmer Binh-Minh Ribler - 2000 +// could not be caught in the applications. Added try block here +// to catch then re-throw it. -BMR 2013/03/21 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) +H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : Group(), id(H5I_INVALID_HID) { try { p_get_file(name, flags, create_plist, access_plist); @@ -92,22 +92,22 @@ H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& cr } //-------------------------------------------------------------------------- -// Function: H5File overloaded constructor -///\brief This is another overloaded constructor. It differs from the -/// above constructor only in the type of the \a name argument. -///\param name - IN: Name of the file - \c H5std_string -///\param flags - IN: File access flags -///\param create_plist - IN: File creation property list, used when -/// modifying default file meta-data. Default to -/// FileCreatPropList::DEFAULT -///\param access_plist - IN: File access property list. Default to -/// FileAccPropList::DEFAULT +// Function: H5File overloaded constructor +///\brief This is another overloaded constructor. It differs from the +/// above constructor only in the type of the \a name argument. +///\param name - IN: Name of the file - \c H5std_string +///\param flags - IN: File access flags +///\param create_plist - IN: File creation property list, used when +/// modifying default file meta-data. Default to +/// FileCreatPropList::DEFAULT +///\param access_plist - IN: File access property list. Default to +/// FileAccPropList::DEFAULT // Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file -// could not be caught in the applications. Added try block here -// to catch then re-throw it. -BMR 2013/03/21 -// Programmer Binh-Minh Ribler - 2000 +// could not be caught in the applications. Added try block here +// to catch then re-throw it. -BMR 2013/03/21 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5File::H5File(const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) +H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : Group(), id(H5I_INVALID_HID) { try { p_get_file(name.c_str(), flags, create_plist, access_plist); @@ -120,21 +120,21 @@ H5File::H5File(const H5std_string& name, unsigned int flags, const FileCreatProp //-------------------------------------------------------------------------- // This function is private and contains common code between the // constructors taking a string or a char* -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Modification -// - removed H5F_ACC_CREAT because H5Fcreate will fail with -// H5F_ACC_CREAT. - BMR, Sep 17, 2014 +// - removed H5F_ACC_CREAT because H5Fcreate will fail with +// H5F_ACC_CREAT. - BMR, Sep 17, 2014 //-------------------------------------------------------------------------- void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) { // These bits only set for creation, so if any of them are set, // create the file. - if (flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC)) + if( flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC)) { hid_t create_plist_id = create_plist.getId(); hid_t access_plist_id = access_plist.getId(); - id = H5Fcreate(name, flags, create_plist_id, access_plist_id); - if (id < 0) // throw an exception when open/create fail + id = H5Fcreate( name, flags, create_plist_id, access_plist_id ); + if( id < 0 ) // throw an exception when open/create fail { throw FileIException("H5File constructor", "H5Fcreate failed"); } @@ -143,8 +143,8 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro else { hid_t access_plist_id = access_plist.getId(); - id = H5Fopen(name, flags, access_plist_id); - if (id < 0) // throw an exception when open/create fail + id = H5Fopen( name, flags, access_plist_id ); + if( id < 0 ) // throw an exception when open/create fail { throw FileIException("H5File constructor", "H5Fopen failed"); } @@ -152,17 +152,17 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro } //-------------------------------------------------------------------------- -// Function: H5File overloaded constructor -///\brief Creates an H5File object using an existing file id. -///\param existing_id - IN: Id of an existing file -// Programmer Binh-Minh Ribler - 2015 +// Function: H5File overloaded constructor +///\brief Creates an H5File object using an existing file id. +///\param existing_id - IN: Id of an existing file +// Programmer Binh-Minh Ribler - 2015 // Description // Mar 29, 2015 -// Added in responding to a request from user Jason Newton. -// However, it is not recommended to use the private member "id" -// in applications. Unlike other situations, where similar -// constructor is needed by the library in order to return -// an object, H5File doesn't need it. -BMR (HDFFV-8766 partially) +// Added in responding to a request from user Jason Newton. +// However, it is not recommended to use the private member "id" +// in applications. Unlike other situations, where similar +// constructor is needed by the library in order to return +// an object, H5File doesn't need it. -BMR (HDFFV-8766 partially) //-------------------------------------------------------------------------- H5File::H5File(hid_t existing_id) : Group() { @@ -173,11 +173,11 @@ H5File::H5File(hid_t existing_id) : Group() #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5File copy constructor -///\brief Copy constructor: makes a copy of the original -/// H5File object. -///\param original - IN: H5File instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File copy constructor +///\brief Copy constructor: makes a copy of the original +/// H5File object. +///\param original - IN: H5File instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File(const H5File& original) : Group() { @@ -186,57 +186,57 @@ H5File::H5File(const H5File& original) : Group() } //-------------------------------------------------------------------------- -// Function: H5File::isHdf5 (static) -///\brief Determines whether a file in HDF5 format. (Static) -///\param name - IN: Name of the file -///\return true if the file is in HDF5 format, and false, otherwise -///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::isHdf5 (static) +///\brief Determines whether a file in HDF5 format. (Static) +///\param name - IN: Name of the file +///\return true if the file is in HDF5 format, and false, otherwise +///\exception H5::FileIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool H5File::isHdf5(const char* name) { - // Calls C routine H5Fis_hdf5 to determine whether the file is in - // HDF5 format. It returns positive value, 0, or negative value - htri_t ret_value = H5Fis_hdf5(name); - if (ret_value > 0) - return true; - else if (ret_value == 0) - return false; - else // Raise exception when H5Fis_hdf5 returns a negative value - { - throw FileIException("H5File::isHdf5", "H5Fis_hdf5 returned negative value"); - } + // Calls C routine H5Fis_hdf5 to determine whether the file is in + // HDF5 format. It returns positive value, 0, or negative value + htri_t ret_value = H5Fis_hdf5( name ); + if( ret_value > 0 ) + return true; + else if( ret_value == 0 ) + return false; + else // Raise exception when H5Fis_hdf5 returns a negative value + { + throw FileIException("H5File::isHdf5", "H5Fis_hdf5 returned negative value"); + } } //-------------------------------------------------------------------------- -// Function: H5File::isHdf5 (static) -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \c H5std_string for \a name. (Static) -///\param name - IN: Name of the file - \c H5std_string -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::isHdf5 (static) +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \c H5std_string for \a name. (Static) +///\param name - IN: Name of the file - \c H5std_string +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -bool H5File::isHdf5(const H5std_string& name) +bool H5File::isHdf5(const H5std_string& name ) { - return(isHdf5( name.c_str())); + return( isHdf5( name.c_str()) ); } //-------------------------------------------------------------------------- -// Function: openFile -///\brief Opens an HDF5 file -///\param name - IN: Name of the file -///\param flags - IN: File access flags -///\param access_plist - IN: File access property list. Default to -/// FileAccPropList::DEFAULT +// Function: openFile +///\brief Opens an HDF5 file +///\param name - IN: Name of the file +///\param flags - IN: File access flags +///\param access_plist - IN: File access property list. Default to +/// FileAccPropList::DEFAULT ///\par Description -/// Valid values of \a flags include: -/// H5F_ACC_RDWR: Open with read/write access. If the file is -/// currently open for read-only access then it -/// will be reopened. Absence of this flag -/// implies read-only access. +/// Valid values of \a flags include: +/// H5F_ACC_RDWR: Open with read/write access. If the file is +/// currently open for read-only access then it +/// will be reopened. Absence of this flag +/// implies read-only access. /// -/// H5F_ACC_RDONLY: Open with read only access. - default +/// H5F_ACC_RDONLY: Open with read only access. - default /// -// Programmer Binh-Minh Ribler - Oct, 2005 +// Programmer Binh-Minh Ribler - Oct, 2005 //-------------------------------------------------------------------------- void H5File::openFile(const char* name, unsigned int flags, const FileAccPropList& access_plist) { @@ -256,14 +256,14 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis } //-------------------------------------------------------------------------- -// Function: H5File::openFile -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \c H5std_string for \a name. -///\param name - IN: Name of the file - \c H5std_string -///\param flags - IN: File access flags -///\param access_plist - IN: File access property list. Default to -/// FileAccPropList::DEFAULT -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::openFile +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \c H5std_string for \a name. +///\param name - IN: Name of the file - \c H5std_string +///\param flags - IN: File access flags +///\param access_plist - IN: File access property list. Default to +/// FileAccPropList::DEFAULT +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAccPropList& access_plist) { @@ -271,21 +271,21 @@ void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAc } //-------------------------------------------------------------------------- -// Function: H5File::reOpen -///\brief Reopens this file. +// Function: H5File::reOpen +///\brief Reopens this file. /// -///\exception H5::FileIException +///\exception H5::FileIException // Description -// If this object has represented another HDF5 file, the previous -// HDF5 file need to be closed first. -// Programmer Binh-Minh Ribler - 2000 +// If this object has represented another HDF5 file, the previous +// HDF5 file need to be closed first. +// Programmer Binh-Minh Ribler - 2000 // Note: This wrapper doesn't seem right regarding the 'id' and should // be investigated. BMR - 2/20/2005 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Feb 20, 2005 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Feb 20, 2005 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- void H5File::reOpen() { @@ -296,148 +296,129 @@ void H5File::reOpen() throw FileIException("H5File::reOpen", close_error.getDetailMsg()); } - // call C routine to reopen the file - Note: not sure about this, - // which id to be the parameter when closing? - id = H5Freopen(id); - if (id < 0) // Raise exception when H5Freopen returns a neg value - throw FileIException("H5File::reOpen", "H5Freopen failed"); + // call C routine to reopen the file - Note: not sure about this, + // which id to be the parameter when closing? + id = H5Freopen( id ); + if( id < 0 ) // Raise exception when H5Freopen returns a neg value + throw FileIException("H5File::reOpen", "H5Freopen failed"); } //-------------------------------------------------------------------------- -// Function: H5File::getCreatePlist -///\brief Returns the creation property list of this file -///\return FileCreatPropList object -///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::getCreatePlist +///\brief Returns the creation property list of this file +///\return FileCreatPropList object +///\exception H5::FileIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileCreatPropList H5File::getCreatePlist() const { - hid_t create_plist_id = H5Fget_create_plist(id); - - // if H5Fget_create_plist returns a valid id, create and return - // the FileCreatPropList object for this property list - if (create_plist_id > 0) - { - FileCreatPropList create_plist(create_plist_id); - return(create_plist); - } - else - { - throw FileIException("H5File::getCreatePlist", "H5Fget_create_plist failed"); - } + hid_t create_plist_id = H5Fget_create_plist( id ); + + // if H5Fget_create_plist returns a valid id, create and return + // the FileCreatPropList object for this property list + if( create_plist_id > 0 ) + { + FileCreatPropList create_plist( create_plist_id ); + return( create_plist ); + } + else + { + throw FileIException("H5File::getCreatePlist", "H5Fget_create_plist failed"); + } } //-------------------------------------------------------------------------- -// Function: H5File::getAccessPlist -///\brief Returns the access property list of this file -///\return FileAccPropList object -///\exception H5::FileIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File::getAccessPlist +///\brief Returns the access property list of this file +///\return FileAccPropList object +///\exception H5::FileIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FileAccPropList H5File::getAccessPlist() const { - hid_t access_plist_id = H5Fget_access_plist(id); + hid_t access_plist_id = H5Fget_access_plist( id ); - // if H5Fget_access_plist returns a valid id, create and return - // the FileAccPropList object for this property list - if (access_plist_id > 0) - { - FileAccPropList access_plist(access_plist_id); + // if H5Fget_access_plist returns a valid id, create and return + // the FileAccPropList object for this property list + if( access_plist_id > 0 ) + { + FileAccPropList access_plist( access_plist_id ); return access_plist; - } - else // Raise an exception - { - throw FileIException("H5File::getAccessPlist", "H5Fget_access_plist failed"); - } + } + else // Raise an exception + { + throw FileIException("H5File::getAccessPlist", "H5Fget_access_plist failed"); + } } //-------------------------------------------------------------------------- -// Function: H5File::getFileInfo -///\brief Retrieves the general information of this file. -/// -///\exception H5::FileIException -///\par Description -/// The retrieved information may include information about -/// superblock extension, free space management, and shared object -// Programmer Binh-Minh Ribler - February 2017 -//-------------------------------------------------------------------------- -void H5File::getFileInfo(H5F_info2_t& file_info) const -{ - herr_t ret_value = H5Fget_info2(id, &file_info); - if (ret_value < 0) - { - throw FileIException("H5File::getFileInfo", "H5Fget_info2 failed"); - } -} - -//-------------------------------------------------------------------------- -// Function: H5File::getFreeSpace -///\brief Returns the amount of free space in the file. -///\return Amount of free space -///\exception H5::FileIException +// Function: H5File::getFreeSpace +///\brief Returns the amount of free space in the file. +///\return Amount of free space +///\exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- hssize_t H5File::getFreeSpace() const { - hssize_t free_space = H5Fget_freespace(id); - if (free_space < 0) - { - throw FileIException("H5File::getFreeSpace", "H5Fget_freespace failed"); - } - return (free_space); + hssize_t free_space = H5Fget_freespace(id); + if( free_space < 0 ) + { + throw FileIException("H5File::getFreeSpace", "H5Fget_freespace failed"); + } + return (free_space); } //-------------------------------------------------------------------------- -// Function: H5File::getObjCount -///\brief Returns the number of opened object IDs (files, datasets, -/// groups and datatypes) in the same file. -///\param types - Type of object to retrieve the count -///\return Number of opened object IDs -///\exception H5::FileIException +// Function: H5File::getObjCount +///\brief Returns the number of opened object IDs (files, datasets, +/// groups and datatypes) in the same file. +///\param types - Type of object to retrieve the count +///\return Number of opened object IDs +///\exception H5::FileIException ///\par Description -/// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only -/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// The valid values for \a types include: +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- ssize_t H5File::getObjCount(unsigned types) const { - ssize_t num_objs = H5Fget_obj_count(id, types); - if (num_objs < 0) - { - throw FileIException("H5File::getObjCount", "H5Fget_obj_count failed"); - } - return (num_objs); + ssize_t num_objs = H5Fget_obj_count(id, types); + if( num_objs < 0 ) + { + throw FileIException("H5File::getObjCount", "H5Fget_obj_count failed"); + } + return (num_objs); } //-------------------------------------------------------------------------- -// Function: H5File::getObjIDs -///\brief Retrieves a list of opened object IDs (files, datasets, -/// groups and datatypes) in the same file. -///\param types - Type of object to retrieve the count -///\param max_objs - Maximum number of object identifiers to place -/// into obj_id_list. -///\param oid_list - List of open object identifiers -///\exception H5::FileIException +// Function: H5File::getObjIDs +///\brief Retrieves a list of opened object IDs (files, datasets, +/// groups and datatypes) in the same file. +///\param types - Type of object to retrieve the count +///\param max_objs - Maximum number of object identifiers to place +/// into obj_id_list. +///\param oid_list - List of open object identifiers +///\exception H5::FileIException ///\par Description -/// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only -/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// The valid values for \a types include: +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // @@ -446,56 +427,56 @@ ssize_t H5File::getObjCount(unsigned types) const //-------------------------------------------------------------------------- void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const { - ssize_t ret_value = H5Fget_obj_ids(id, types, max_objs, oid_list); - if (ret_value < 0) - { - throw FileIException("H5File::getObjIDs", "H5Fget_obj_ids failed"); - } + ssize_t ret_value = H5Fget_obj_ids(id, types, max_objs, oid_list); + if( ret_value < 0 ) + { + throw FileIException("H5File::getObjIDs", "H5Fget_obj_ids failed"); + } } //-------------------------------------------------------------------------- -// Function: H5File::getVFDHandle -///\brief Returns the pointer to the file handle of the low-level file -/// driver. -///\param fapl - File access property list -///\param file_handle - Pointer to the file handle being used by -/// the low-level virtual file driver -///\exception H5::FileIException +// Function: H5File::getVFDHandle +///\brief Returns the pointer to the file handle of the low-level file +/// driver. +///\param fapl - File access property list +///\param file_handle - Pointer to the file handle being used by +/// the low-level virtual file driver +///\exception H5::FileIException ///\par Description -/// For the \c FAMILY or \c MULTI drivers, \a fapl should be -/// defined through the property list functions: -/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver -/// and \c FileAccPropList::setMultiType for the \c MULTI driver. +/// For the \c FAMILY or \c MULTI drivers, \a fapl should be +/// defined through the property list functions: +/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver +/// and \c FileAccPropList::setMultiType for the \c MULTI driver. /// -/// The obtained file handle is dynamic and is valid only while -/// the file remains open; it will be invalid if the file is -/// closed and reopened or opened during a subsequent session. +/// The obtained file handle is dynamic and is valid only while +/// the file remains open; it will be invalid if the file is +/// closed and reopened or opened during a subsequent session. // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const { - hid_t fapl_id = fapl.getId(); - herr_t ret_value = H5Fget_vfd_handle(id, fapl_id, file_handle); - if (ret_value < 0) - { - throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed"); - } + hid_t fapl_id = fapl.getId(); + herr_t ret_value = H5Fget_vfd_handle(id, fapl_id, file_handle); + if( ret_value < 0 ) + { + throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed"); + } } //-------------------------------------------------------------------------- -// Function: H5File::getVFDHandle -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. +// Function: H5File::getVFDHandle +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. // Param fapl - File access property list // Param file_handle - Pointer to the file handle being used by -// the low-level virtual file driver +// the low-level virtual file driver // Exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 // Modification -// Planned for removal. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Planned for removal. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void H5File::getVFDHandle(FileAccPropList& fapl, void **file_handle) const //{ @@ -503,103 +484,103 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const //} //-------------------------------------------------------------------------- -// Function: H5File::getVFDHandle -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param file_handle - Pointer to the file handle being used by -/// the low-level virtual file driver -///\exception H5::FileIException +// Function: H5File::getVFDHandle +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param file_handle - Pointer to the file handle being used by +/// the low-level virtual file driver +///\exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- void H5File::getVFDHandle(void **file_handle) const { - herr_t ret_value = H5Fget_vfd_handle(id, H5P_DEFAULT, file_handle); - if (ret_value < 0) - { - throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed"); - } + herr_t ret_value = H5Fget_vfd_handle(id, H5P_DEFAULT, file_handle); + if( ret_value < 0 ) + { + throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed"); + } } //-------------------------------------------------------------------------- -// Function: H5File::getFileSize -///\brief Returns the file size of the HDF5 file. -///\return File size -///\exception H5::FileIException +// Function: H5File::getFileSize +///\brief Returns the file size of the HDF5 file. +///\return File size +///\exception H5::FileIException ///\par Description -/// This function is called after an existing file is opened in -/// order to learn the true size of the underlying file. +/// This function is called after an existing file is opened in +/// order to learn the true size of the underlying file. // Programmer Raymond Lu - June 24, 2004 //-------------------------------------------------------------------------- hsize_t H5File::getFileSize() const { - hsize_t file_size; - herr_t ret_value = H5Fget_filesize(id, &file_size); - if (ret_value < 0) - { - throw FileIException("H5File::getFileSize", "H5Fget_filesize failed"); - } - return (file_size); + hsize_t file_size; + herr_t ret_value = H5Fget_filesize(id, &file_size); + if (ret_value < 0) + { + throw FileIException("H5File::getFileSize", "H5Fget_filesize failed"); + } + return (file_size); } //-------------------------------------------------------------------------- -// Function: H5File::getId -///\brief Get the id of this file -///\return File identifier -// Modification +// Function: H5File::getId +///\brief Get the id of this file +///\return File identifier +// Modification: // May 2008 - BMR -// Class hierarchy is revised to address bugzilla 1068. Class -// AbstractDS and Attribute are moved out of H5Object. In -// addition, member IdComponent::id is moved into subclasses, and -// IdComponent::getId now becomes pure virtual function. -// Programmer Binh-Minh Ribler - May, 2008 +// Class hierarchy is revised to address bugzilla 1068. Class +// AbstractDS and Attribute are moved out of H5Object. In +// addition, member IdComponent::id is moved into subclasses, and +// IdComponent::getId now becomes pure virtual function. +// Programmer Binh-Minh Ribler - May, 2008 //-------------------------------------------------------------------------- hid_t H5File::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5File::reopen -// Purpose Reopens this file. +// Function: H5File::reopen +// Purpose: Reopens this file. // Exception H5::FileIException // Description -// This function is replaced by the above function reOpen. -// Programmer Binh-Minh Ribler - 2000 +// This function is replaced by the above function reOpen. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::reopen() { - H5File::reOpen(); + H5File::reOpen(); } //-------------------------------------------------------------------------- -// Function: H5File::getLocId -// Purpose Get the id of this file +// Function: H5File::getLocId +// Purpose: Get the id of this file // Description -// This function is a redefinition of CommonFG::getLocId. It -// is used by CommonFG member functions to get the file id. -// Programmer Binh-Minh Ribler - 2000 +// This function is a redefinition of CommonFG::getLocId. It +// is used by CommonFG member functions to get the file id. +// Programmer Binh-Minh Ribler - 2000 // Deprecated: // After HDFFV-9920, the Group's methods can use getId() and getLocId() // is kept for backward compatibility. Aug 18, 2016 -BMR //-------------------------------------------------------------------------- hid_t H5File::getLocId() const { - return(getId()); + return( getId() ); } //-------------------------------------------------------------------------- -// Function: H5File::p_setId (protected) -///\brief Sets the identifier of this object to a new value. +// Function: H5File::p_setId (protected) +///\brief Sets the identifier of this object to a new value. /// -///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails -// Description -// The underlaying reference counting in the C library ensures -// that the current valid id of this object is properly closed. -// Then the object's id is reset to the new id. -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::IdComponentException when the attempt to close the HDF5 +/// object fails +// Description: +// The underlaying reference counting in the C library ensures +// that the current valid id of this object is properly closed. +// Then the object's id is reset to the new id. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::p_setId(const hid_t new_id) { @@ -610,24 +591,24 @@ void H5File::p_setId(const hid_t new_id) catch (Exception& E) { throw FileIException("H5File::p_setId", E.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5File::close -///\brief Closes this HDF5 file. +// Function: H5File::close +///\brief Closes this HDF5 file. /// -///\exception H5::FileIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::FileIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void H5File::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Fclose(id); - if (ret_value < 0) + herr_t ret_value = H5Fclose( id ); + if( ret_value < 0 ) { throw FileIException("H5File::close", "H5Fclose failed"); } @@ -637,34 +618,34 @@ void H5File::close() } //-------------------------------------------------------------------------- -// Function: H5File::throwException -///\brief Throws file exception - initially implemented for CommonFG -///\param func_name - Name of the function where failure occurs -///\param msg - Message describing the failure -///\exception H5::FileIException +// Function: H5File::throwException +///\brief Throws file exception - initially implemented for CommonFG +///\param func_name - Name of the function where failure occurs +///\param msg - Message describing the failure +///\exception H5::FileIException // Description // This function is also used in H5Location implementation so that -// proper exception can be thrown for file or group. The -// "H5File::" will be inserted to indicate the function called is -// an implementation of H5File. -// Programmer Binh-Minh Ribler - 2000 +// proper exception can be thrown for file or group. The +// "H5File::" will be inserted to indicate the function called is +// an implementation of H5File. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::throwException(const H5std_string& func_name, const H5std_string& msg) const { - H5std_string full_name = func_name; - full_name.insert(0, "H5File::"); - throw FileIException(full_name, msg); + H5std_string full_name = func_name; + full_name.insert(0, "H5File::"); + throw FileIException(full_name, msg); } //-------------------------------------------------------------------------- -// Function: H5File destructor -///\brief Properly terminates access to this file. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5File destructor +///\brief Properly terminates access to this file. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Feb 20, 2005 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Feb 20, 2005 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- H5File::~H5File() { diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 5ac9118..dca6c67 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -28,100 +28,97 @@ namespace H5 { */ class H5_DLLCPP H5File : public Group { public: - // Creates or opens an HDF5 file. - H5File(const char* name, unsigned int flags, - const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT); - H5File(const H5std_string& name, unsigned int flags, - const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT); + // Creates or opens an HDF5 file. + H5File( const char* name, unsigned int flags, + const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, + const FileAccPropList& access_plist = FileAccPropList::DEFAULT ); + H5File( const H5std_string& name, unsigned int flags, + const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT, + const FileAccPropList& access_plist = FileAccPropList::DEFAULT ); - // Open the file - void openFile(const H5std_string& name, unsigned int flags, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT); - void openFile(const char* name, unsigned int flags, - const FileAccPropList& access_plist = FileAccPropList::DEFAULT); + // Open the file + void openFile(const H5std_string& name, unsigned int flags, + const FileAccPropList& access_plist = FileAccPropList::DEFAULT); + void openFile(const char* name, unsigned int flags, + const FileAccPropList& access_plist = FileAccPropList::DEFAULT); - // Close this file. - virtual void close(); + // Close this file. + virtual void close(); - // Gets the access property list of this file. - FileAccPropList getAccessPlist() const; + // Gets the access property list of this file. + FileAccPropList getAccessPlist() const; - // Gets the creation property list of this file. - FileCreatPropList getCreatePlist() const; + // Gets the creation property list of this file. + FileCreatPropList getCreatePlist() const; - // Gets general information about this file. - void getFileInfo(H5F_info2_t& file_info) const; + // Retrieves the file size of an opened file. + hsize_t getFileSize() const; - // Returns the amount of free space in the file. - hssize_t getFreeSpace() const; + // Returns the amount of free space in the file. + hssize_t getFreeSpace() const; - // Returns the number of opened object IDs (files, datasets, groups - // and datatypes) in the same file. - ssize_t getObjCount(unsigned types = H5F_OBJ_ALL) const; + // Returns the number of opened object IDs (files, datasets, groups + // and datatypes) in the same file. + ssize_t getObjCount(unsigned types = H5F_OBJ_ALL) const; - // Retrieves a list of opened object IDs (files, datasets, groups - // and datatypes) in the same file. - void getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const; + // Retrieves a list of opened object IDs (files, datasets, groups + // and datatypes) in the same file. + void getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const; - // Returns the pointer to the file handle of the low-level file driver. - void getVFDHandle(void **file_handle) const; - void getVFDHandle(const FileAccPropList& fapl, void **file_handle) const; - //void getVFDHandle(FileAccPropList& fapl, void **file_handle) const; // removed from 1.8.18 and 1.10.1 + // Returns the pointer to the file handle of the low-level file driver. + void getVFDHandle(void **file_handle) const; + void getVFDHandle(const FileAccPropList& fapl, void **file_handle) const; + //void getVFDHandle(FileAccPropList& fapl, void **file_handle) const; // removed from 1.8.18 and 1.10.1 - // Returns the file size of the HDF5 file. - hsize_t getFileSize() const; + // Determines if a file, specified by its name, is in HDF5 format + static bool isHdf5(const char* name ); + static bool isHdf5(const H5std_string& name ); - // Determines if a file, specified by its name, is in HDF5 format - static bool isHdf5(const char* name); - static bool isHdf5(const H5std_string& name); - - // Reopens this file. - void reOpen(); // added for better name + // Reopens this file. + void reOpen(); // added for better name #ifndef DOXYGEN_SHOULD_SKIP_THIS - void reopen(); // obsolete in favor of reOpen() + void reopen(); // obsolete in favor of reOpen() - // Creates an H5File using an existing file id. Not recommended - // in applications. - H5File(hid_t existing_id); + // Creates an H5File using an existing file id. Not recommended + // in applications. + H5File(hid_t existing_id); #endif // DOXYGEN_SHOULD_SKIP_THIS - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("H5File"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("H5File"); } - // Throw file exception. - virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; + // Throw file exception. + virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; - // for CommonFG to get the file id. - virtual hid_t getLocId() const; + // for CommonFG to get the file id. + virtual hid_t getLocId() const; - // Default constructor - H5File(); + // Default constructor + H5File(); - // Copy constructor: makes a copy of the original H5File object. - H5File(const H5File& original); + // Copy constructor: makes a copy of the original H5File object. + H5File(const H5File& original); - // Gets the HDF5 file id. - virtual hid_t getId() const; + // Gets the HDF5 file id. + virtual hid_t getId() const; - // H5File destructor. - virtual ~H5File(); + // H5File destructor. + virtual ~H5File(); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Sets the HDF5 file id. - virtual void p_setId(const hid_t new_id); + // Sets the HDF5 file id. + virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 file id + hid_t id; // HDF5 file id - // This function is private and contains common code between the - // constructors taking a string or a char* - void p_get_file(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist); + // This function is private and contains common code between the + // constructors taking a string or a char* + void p_get_file( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ); }; } diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 5902cbe..73e8072 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -36,73 +36,73 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: FloatType default constructor -///\brief Default constructor: Creates a stub floating-point datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType default constructor +///\brief Default constructor: Creates a stub floating-point datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType::FloatType() {} //-------------------------------------------------------------------------- -// Function: FloatType overloaded constructor -///\brief Creates a floating-point datatype using a predefined type. -///\param pred_type - IN: Predefined datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType overloaded constructor +///\brief Creates a floating-point datatype using a predefined type. +///\param pred_type - IN: Predefined datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType::FloatType(const PredType& pred_type) : AtomType() +FloatType::FloatType( const PredType& pred_type ) : AtomType() { - // use DataType::copy to make a copy of this predefined type - copy(pred_type); + // use DataType::copy to make a copy of this predefined type + copy( pred_type ); } //-------------------------------------------------------------------------- -// Function: FloatType overloaded constructor -///\brief Creates an FloatType object using the id of an existing -/// datatype. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType overloaded constructor +///\brief Creates an FloatType object using the id of an existing +/// datatype. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType::FloatType(const hid_t existing_id) : AtomType( existing_id ) {} +FloatType::FloatType( const hid_t existing_id ) : AtomType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: FloatType copy constructor -///\brief Copy constructor: makes a copy of the original FloatType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType copy constructor +///\brief Copy constructor: makes a copy of the original FloatType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType::FloatType(const FloatType& original) : AtomType( original ){} +FloatType::FloatType( const FloatType& original ) : AtomType( original ){} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor -///\brief Gets the floating-point datatype of the specified dataset -///\param dataset - IN: Dataset that this floating-point datatype -/// associates with -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: EnumType overloaded constructor +///\brief Gets the floating-point datatype of the specified dataset +///\param dataset - IN: Dataset that this floating-point datatype +/// associates with +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -FloatType::FloatType(const DataSet& dataset) : AtomType() +FloatType::FloatType( const DataSet& dataset ) : AtomType() { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type(dataset.getId()); + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type( dataset.getId() ); - if (id < 0) - { - throw DataSetIException("FloatType constructor", "H5Dget_type failed"); - } + if( id < 0 ) + { + throw DataSetIException("FloatType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: FloatType overloaded constructor -///\brief Creates an FloatType instance by opening an HDF5 float datatype -/// given its name, provided as a C character string. -///\param dtype_name - IN: Float type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: FloatType overloaded constructor +///\brief Creates an FloatType instance by opening an HDF5 float datatype +/// given its name, provided as a C character string. +///\param dtype_name - IN: Float type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openFloatType(const char*) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openFloatType(const char*) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- FloatType::FloatType(const H5Location& loc, const char *dtype_name) : AtomType() { @@ -110,213 +110,213 @@ FloatType::FloatType(const H5Location& loc, const char *dtype_name) : AtomType() } //-------------------------------------------------------------------------- -// Function: FloatType overloaded constructor -///\brief Creates an FloatType instance by opening an HDF5 float datatype -/// given its name, provided as an \c H5std_string. -///\param dtype_name - IN: Float type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: FloatType overloaded constructor +///\brief Creates an FloatType instance by opening an HDF5 float datatype +/// given its name, provided as an \c H5std_string. +///\param dtype_name - IN: Float type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openFloatType(const H5std_string&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openFloatType(const H5std_string&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- FloatType::FloatType(const H5Location& loc, const H5std_string& dtype_name) : AtomType() { - id = p_opentype(loc, dtype_name.c_str()); + id = p_opentype(loc, dtype_name.c_str()); } //-------------------------------------------------------------------------- -// Function: FloatType::getFields -///\brief Retrieves floating point datatype bit field information. -///\param spos - OUT: Retrieved floating-point sign bit -///\param epos - OUT: Retrieved exponent bit-position -///\param esize - OUT: Retrieved size of exponent, in bits -///\param mpos - OUT: Retrieved mantissa bit-position -///\param msize - OUT: Retrieved size of mantissa, in bits -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void FloatType::getFields(size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize) const +// Function: FloatType::getFields +///\brief Retrieves floating point datatype bit field information. +///\param spos - OUT: Retrieved floating-point sign bit +///\param epos - OUT: Retrieved exponent bit-position +///\param esize - OUT: Retrieved size of exponent, in bits +///\param mpos - OUT: Retrieved mantissa bit-position +///\param msize - OUT: Retrieved size of mantissa, in bits +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void FloatType::getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const { - herr_t ret_value = H5Tget_fields(id, &spos, &epos, &esize, &mpos, &msize); - if (ret_value < 0) - { - throw DataTypeIException("FloatType::getFields", "H5Tget_fields failed"); - } + herr_t ret_value = H5Tget_fields( id, &spos, &epos, &esize, &mpos, &msize ); + if( ret_value < 0 ) + { + throw DataTypeIException("FloatType::getFields", "H5Tget_fields failed"); + } } //-------------------------------------------------------------------------- -// Function: FloatType::setFields -///\brief Sets locations and sizes of floating point bit fields. -///\param spos - OUT: Sign position, i.e., the bit offset of the -/// floating-point sign bit. -///\param epos - OUT: Exponent bit position -///\param esize - OUT: Size of exponent, in bits -///\param mpos - OUT: Mantissa bit-position -///\param msize - OUT: Size of mantissa, in bits -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -void FloatType::setFields(size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize) const +// Function: FloatType::setFields +///\brief Sets locations and sizes of floating point bit fields. +///\param spos - OUT: Sign position, i.e., the bit offset of the +/// floating-point sign bit. +///\param epos - OUT: Exponent bit position +///\param esize - OUT: Size of exponent, in bits +///\param mpos - OUT: Mantissa bit-position +///\param msize - OUT: Size of mantissa, in bits +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void FloatType::setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const { - herr_t ret_value = H5Tset_fields(id, spos, epos, esize, mpos, msize); - if (ret_value < 0) - { - throw DataTypeIException("FloatType::setFields", "H5Tset_fields failed"); - } + herr_t ret_value = H5Tset_fields( id, spos, epos, esize, mpos, msize ); + if( ret_value < 0 ) + { + throw DataTypeIException("FloatType::setFields", "H5Tset_fields failed"); + } } //-------------------------------------------------------------------------- -// Function: FloatType::getEbias -///\brief Retrieves the exponent bias of a floating-point type. -///\return Exponent bias -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType::getEbias +///\brief Retrieves the exponent bias of a floating-point type. +///\return Exponent bias +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- size_t FloatType::getEbias() const { - size_t ebias = H5Tget_ebias(id); - // Returns the bias if successful - if (ebias == 0) - { - throw DataTypeIException("FloatType::getEbias", "H5Tget_ebias failed - returned exponent bias as 0"); - } - return(ebias); + size_t ebias = H5Tget_ebias( id ); + // Returns the bias if successful + if( ebias == 0 ) + { + throw DataTypeIException("FloatType::getEbias", "H5Tget_ebias failed - returned exponent bias as 0"); + } + return( ebias ); } //-------------------------------------------------------------------------- -// Function: FloatType::setEbias -///\brief Sets the exponent bias of a floating-point type. -///\param ebias - Exponent bias value -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType::setEbias +///\brief Sets the exponent bias of a floating-point type. +///\param ebias - Exponent bias value +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FloatType::setEbias(size_t ebias) const +void FloatType::setEbias( size_t ebias ) const { - herr_t ret_value = H5Tset_ebias(id, ebias); - if (ret_value < 0) - { - throw DataTypeIException("FloatType::setEbias", "H5Tset_ebias failed"); - } + herr_t ret_value = H5Tset_ebias( id, ebias ); + if( ret_value < 0 ) + { + throw DataTypeIException("FloatType::setEbias", "H5Tset_ebias failed"); + } } //-------------------------------------------------------------------------- -// Function: FloatType::getNorm -///\brief Retrieves mantissa normalization of a floating-point datatype. -///\param norm_string - OUT: Text string of the normalization type -///\return Valid normalization type, which can be: -/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored -/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 -/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized -///\exception H5::DataTypeIException +// Function: FloatType::getNorm +///\brief Retrieves mantissa normalization of a floating-point datatype. +///\param norm_string - OUT: Text string of the normalization type +///\return Valid normalization type, which can be: +/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored +/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 +/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized +///\exception H5::DataTypeIException ///\par Description -/// For your convenience, this function also provides the text -/// string of the returned normalization type, via parameter -/// \a norm_string. -// Programmer Binh-Minh Ribler - 2000 +/// For your convenience, this function also provides the text +/// string of the returned normalization type, via parameter +/// \a norm_string. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5T_norm_t FloatType::getNorm(H5std_string& norm_string) const +H5T_norm_t FloatType::getNorm( H5std_string& norm_string ) const { - H5T_norm_t norm = H5Tget_norm(id); // C routine - // Returns a valid normalization type if successful - if (norm == H5T_NORM_ERROR) - { - throw DataTypeIException("FloatType::getNorm", "H5Tget_norm failed - returned H5T_NORM_ERROR"); - } - if (norm == H5T_NORM_IMPLIED) - norm_string = "H5T_NORM_IMPLIED (0)"; - else if (norm == H5T_NORM_MSBSET) - norm_string = "H5T_NORM_MSBSET (1)"; - else if (norm == H5T_NORM_NONE) - norm_string = "H5T_NORM_NONE (2)"; - return(norm); + H5T_norm_t norm = H5Tget_norm( id ); // C routine + // Returns a valid normalization type if successful + if( norm == H5T_NORM_ERROR ) + { + throw DataTypeIException("FloatType::getNorm", "H5Tget_norm failed - returned H5T_NORM_ERROR"); + } + if( norm == H5T_NORM_IMPLIED ) + norm_string = "H5T_NORM_IMPLIED (0)"; + else if( norm == H5T_NORM_MSBSET ) + norm_string = "H5T_NORM_MSBSET (1)"; + else if( norm == H5T_NORM_NONE ) + norm_string = "H5T_NORM_NONE (2)"; + return( norm ); } //-------------------------------------------------------------------------- -// Function: FloatType::setNorm -///\brief Sets the mantissa normalization of a floating-point datatype. -///\param norm - IN: Mantissa normalization type -///\exception H5::DataTypeIException +// Function: FloatType::setNorm +///\brief Sets the mantissa normalization of a floating-point datatype. +///\param norm - IN: Mantissa normalization type +///\exception H5::DataTypeIException ///\par Description -/// Valid values for normalization type include: -/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored -/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 -/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for normalization type include: +/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored +/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 +/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FloatType::setNorm(H5T_norm_t norm) const +void FloatType::setNorm( H5T_norm_t norm ) const { - herr_t ret_value = H5Tset_norm(id, norm); - if (ret_value < 0) - { - throw DataTypeIException("FloatType::setNorm", "H5Tset_norm failed"); - } + herr_t ret_value = H5Tset_norm( id, norm ); + if( ret_value < 0 ) + { + throw DataTypeIException("FloatType::setNorm", "H5Tset_norm failed"); + } } //-------------------------------------------------------------------------- -// Function: FloatType::getInpad -///\brief Retrieves the internal padding type for unused bits in -/// this floating-point datatypes. -///\return Internal padding type, which can be: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros -/// \li \c H5T_PAD_ONE (1) - Set background to ones -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone -///\exception H5::DataTypeIException +// Function: FloatType::getInpad +///\brief Retrieves the internal padding type for unused bits in +/// this floating-point datatypes. +///\return Internal padding type, which can be: +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros +/// \li \c H5T_PAD_ONE (1) - Set background to ones +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone +///\exception H5::DataTypeIException ///\par Description -/// For your convenience, this function also provides the text -/// string of the returned internal padding type, via parameter -/// \a pad_string. -// Programmer Binh-Minh Ribler - 2000 +/// For your convenience, this function also provides the text +/// string of the returned internal padding type, via parameter +/// \a pad_string. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5T_pad_t FloatType::getInpad(H5std_string& pad_string) const +H5T_pad_t FloatType::getInpad( H5std_string& pad_string ) const { - H5T_pad_t pad_type = H5Tget_inpad(id); - // Returns a valid padding type if successful - if (pad_type == H5T_PAD_ERROR) - { - throw DataTypeIException("FloatType::getInpad", "H5Tget_inpad failed - returned H5T_PAD_ERROR"); - } - if (pad_type == H5T_PAD_ZERO) - pad_string = "H5T_PAD_ZERO (0)"; - else if (pad_type == H5T_PAD_ONE) - pad_string = "H5T_PAD_ONE (1)"; - else if (pad_type == H5T_PAD_BACKGROUND) - pad_string = "H5T_PAD_BACKGROUD (2)"; - return(pad_type); + H5T_pad_t pad_type = H5Tget_inpad( id ); + // Returns a valid padding type if successful + if( pad_type == H5T_PAD_ERROR ) + { + throw DataTypeIException("FloatType::getInpad", "H5Tget_inpad failed - returned H5T_PAD_ERROR"); + } + if( pad_type == H5T_PAD_ZERO ) + pad_string = "H5T_PAD_ZERO (0)"; + else if( pad_type == H5T_PAD_ONE ) + pad_string = "H5T_PAD_ONE (1)"; + else if( pad_type == H5T_PAD_BACKGROUND ) + pad_string = "H5T_PAD_BACKGROUD (2)"; + return( pad_type ); } //-------------------------------------------------------------------------- -// Function: FloatType::setInpad -///\brief Fills unused internal floating point bits. -///\param inpad - IN: Internal padding type -///\exception H5::DataTypeIException +// Function: FloatType::setInpad +///\brief Fills unused internal floating point bits. +///\param inpad - IN: Internal padding type +///\exception H5::DataTypeIException ///\par Description -/// If any internal bits of a floating point type are unused -/// (that is, those significant bits which are not part of the -/// sign, exponent, or mantissa), then they will be filled -/// according to the padding value provided by \a inpad. +/// If any internal bits of a floating point type are unused +/// (that is, those significant bits which are not part of the +/// sign, exponent, or mantissa), then they will be filled +/// according to the padding value provided by \a inpad. ///\par -/// Valid values for normalization type include: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros -/// \li \c H5T_PAD_ONE (1) - Set background to ones -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone -// Programmer Binh-Minh Ribler - 2000 +/// Valid values for normalization type include: +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros +/// \li \c H5T_PAD_ONE (1) - Set background to ones +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void FloatType::setInpad(H5T_pad_t inpad) const +void FloatType::setInpad( H5T_pad_t inpad ) const { - herr_t ret_value = H5Tset_inpad(id, inpad); - if (ret_value < 0) - { - throw DataTypeIException("FloatType::setInpad", "H5Tset_inpad failed"); - } + herr_t ret_value = H5Tset_inpad( id, inpad ); + if( ret_value < 0 ) + { + throw DataTypeIException("FloatType::setInpad", "H5Tset_inpad failed"); + } } //-------------------------------------------------------------------------- -// Function: FloatType destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: FloatType destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType::~FloatType() {} diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index 2c925de..1f4b227 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -27,54 +27,54 @@ namespace H5 { */ class H5_DLLCPP FloatType : public AtomType { public: - // Creates a floating-point type using a predefined type. - FloatType(const PredType& pred_type); + // Creates a floating-point type using a predefined type. + FloatType( const PredType& pred_type ); - // Gets the floating-point datatype of the specified dataset. - FloatType(const DataSet& dataset); + // Gets the floating-point datatype of the specified dataset. + FloatType( const DataSet& dataset ); - // Constructors that open an HDF5 float datatype, given a location. - FloatType(const H5Location& loc, const char* name); - FloatType(const H5Location& loc, const H5std_string& name); + // Constructors that open an HDF5 float datatype, given a location. + FloatType(const H5Location& loc, const char* name); + FloatType(const H5Location& loc, const H5std_string& name); - // Retrieves the exponent bias of a floating-point type. - size_t getEbias() const; + // Retrieves the exponent bias of a floating-point type. + size_t getEbias() const; - // Sets the exponent bias of a floating-point type. - void setEbias(size_t ebias) const; + // Sets the exponent bias of a floating-point type. + void setEbias( size_t ebias ) const; - // Retrieves floating point datatype bit field information. - void getFields(size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize) const; + // Retrieves floating point datatype bit field information. + void getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const; - // Sets locations and sizes of floating point bit fields. - void setFields(size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize) const; + // Sets locations and sizes of floating point bit fields. + void setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const; - // Retrieves the internal padding type for unused bits in floating-point datatypes. - H5T_pad_t getInpad(H5std_string& pad_string) const; + // Retrieves the internal padding type for unused bits in floating-point datatypes. + H5T_pad_t getInpad( H5std_string& pad_string ) const; - // Fills unused internal floating point bits. - void setInpad(H5T_pad_t inpad) const; + // Fills unused internal floating point bits. + void setInpad( H5T_pad_t inpad ) const; - // Retrieves mantissa normalization of a floating-point datatype. - H5T_norm_t getNorm(H5std_string& norm_string) const; + // Retrieves mantissa normalization of a floating-point datatype. + H5T_norm_t getNorm( H5std_string& norm_string ) const; - // Sets the mantissa normalization of a floating-point datatype. - void setNorm(H5T_norm_t norm) const; + // Sets the mantissa normalization of a floating-point datatype. + void setNorm( H5T_norm_t norm ) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("FloatType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("FloatType"); } - // Default constructor - FloatType(); + // Default constructor + FloatType(); - // Creates a floating-point datatype using an existing id. - FloatType(const hid_t existing_id); + // Creates a floating-point datatype using an existing id. + FloatType( const hid_t existing_id ); - // Copy constructor: makes a copy of the original FloatType object. - FloatType(const FloatType& original); + // Copy constructor: makes a copy of the original FloatType object. + FloatType( const FloatType& original ); - // Noop destructor. - virtual ~FloatType(); + // Noop destructor. + virtual ~FloatType(); }; } #endif // __H5FloatType_H diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 6b143b5..c976b00 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -46,17 +46,17 @@ namespace H5 { using std::endl; //-------------------------------------------------------------------------- -// Function: Group default constructor -///\brief Default constructor: creates a stub Group. -// Programmer Binh-Minh Ribler - 2000 +// Function: Group default constructor +///\brief Default constructor: creates a stub Group. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group::Group() : H5Object(), CommonFG(), id(H5I_INVALID_HID) {} //-------------------------------------------------------------------------- -// Function: Group copy constructor -///\brief Copy constructor: makes a copy of the original Group object. -///\param original - IN: Original group to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: Group copy constructor +///\brief Copy constructor: makes a copy of the original Group object. +///\param original - IN: Original group to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group::Group(const Group& original) : H5Object(), CommonFG(), id(original.id) { @@ -64,26 +64,26 @@ Group::Group(const Group& original) : H5Object(), CommonFG(), id(original.id) } //-------------------------------------------------------------------------- -// Function: Group::getLocId +// Function: Group::getLocId // Purpose: Get the id of this group -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Description -// This function is a redefinition of CommonFG::getLocId. It -// is used by CommonFG member functions to get the file id. +// This function is a redefinition of CommonFG::getLocId. It +// is used by CommonFG member functions to get the file id. // Deprecated: // After HDFFV-9920, the Group's methods can use getId() and getLocId() // is kept for backward compatibility. Aug 18, 2016 -BMR //-------------------------------------------------------------------------- hid_t Group::getLocId() const { - return(getId()); + return( getId() ); } //-------------------------------------------------------------------------- -// Function: Group overloaded constructor -///\brief Creates a Group object using the id of an existing group. -///\param existing_id - IN: Id of an existing group -// Programmer Binh-Minh Ribler - 2000 +// Function: Group overloaded constructor +///\brief Creates a Group object using the id of an existing group. +///\param existing_id - IN: Id of an existing group +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group::Group(const hid_t existing_id) : H5Object(), CommonFG(), id(existing_id) { @@ -91,17 +91,17 @@ Group::Group(const hid_t existing_id) : H5Object(), CommonFG(), id(existing_id) } //-------------------------------------------------------------------------- -// Function: Group overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a Group object -///\param loc - IN: Specifying location referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException +// Function: Group overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 group, creates a Group object +///\param loc - IN: Specifying location referenced object is in +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException ///\par Description -/// \c obj can be DataSet, Group, or named DataType, that -/// is a datatype that has been named by DataType::commit. -// Programmer Binh-Minh Ribler - Oct, 2006 +/// \c obj can be DataSet, Group, or named DataType, that +/// is a datatype that has been named by DataType::commit. +// Programmer Binh-Minh Ribler - Oct, 2006 //-------------------------------------------------------------------------- Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), CommonFG(), id(H5I_INVALID_HID) { @@ -109,14 +109,14 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const } //-------------------------------------------------------------------------- -// Function: Group overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a Group object -///\param attr - IN: Specifying location where the referenced object is in -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type - default to H5R_OBJECT -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// Function: Group overload constructor - dereference +///\brief Given a reference, ref, to an hdf5 group, creates a Group object +///\param attr - IN: Specifying location where the referenced object is in +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 //-------------------------------------------------------------------------- /* Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) { @@ -126,19 +126,19 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const //-------------------------------------------------------------------------- // Function: Group::getId -///\brief Get the id of this group -///\return Group identifier +///\brief Get the id of this group +///\return Group identifier // Modification: // May 2008 - BMR -// Class hierarchy is revised to address bugzilla 1068. Class -// AbstractDS and Attribute are moved out of H5Object. In -// addition, member IdComponent::id is moved into subclasses, and -// IdComponent::getId now becomes pure virtual function. +// Class hierarchy is revised to address bugzilla 1068. Class +// AbstractDS and Attribute are moved out of H5Object. In +// addition, member IdComponent::id is moved into subclasses, and +// IdComponent::getId now becomes pure virtual function. // Programmer Binh-Minh Ribler - May, 2008 //-------------------------------------------------------------------------- hid_t Group::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -147,11 +147,11 @@ hid_t Group::getId() const ///\brief Sets the identifier of this object to a new value. /// ///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails +/// object fails // Description: -// The underlaying reference counting in the C library ensures -// that the current valid id of this object is properly closed. -// Then the object's id is reset to the new id. +// The underlaying reference counting in the C library ensures +// that the current valid id of this object is properly closed. +// Then the object's id is reset to the new id. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Group::p_setId(const hid_t new_id) @@ -163,24 +163,24 @@ void Group::p_setId(const hid_t new_id) catch (Exception& close_error) { throwException("Group::p_setId", close_error.getDetailMsg()); } - // reset object's id to the given id - id = new_id; + // reset object's id to the given id + id = new_id; } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Group::close -///\brief Closes this group. +// Function: Group::close +///\brief Closes this group. /// -///\exception H5::GroupIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::GroupIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void Group::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Gclose(id); - if (ret_value < 0) + herr_t ret_value = H5Gclose( id ); + if( ret_value < 0 ) { throwException("Group::close", "H5Gclose failed"); } @@ -190,34 +190,34 @@ void Group::close() } //-------------------------------------------------------------------------- -// Function: Group::throwException -///\brief Throws H5::GroupIException. -///\param func_name - Name of the function where failure occurs -///\param msg - Message describing the failure -///\exception H5::GroupIException +// Function: Group::throwException +///\brief Throws H5::GroupIException. +///\param func_name - Name of the function where failure occurs +///\param msg - Message describing the failure +///\exception H5::GroupIException // Description -// This function is also used in H5Location's methods so that -// proper exception can be thrown for file or group. The -// "Group::" will be inserted to indicate the function called is -// an implementation of Group. -// Programmer Binh-Minh Ribler - 2000 +// This function is also used in H5Location's methods so that +// proper exception can be thrown for file or group. The +// "Group::" will be inserted to indicate the function called is +// an implementation of Group. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Group::throwException(const H5std_string& func_name, const H5std_string& msg) const { - H5std_string full_name = func_name; - full_name.insert(0, "Group::"); - throw GroupIException(full_name, msg); + H5std_string full_name = func_name; + full_name.insert(0, "Group::"); + throw GroupIException(full_name, msg); } //-------------------------------------------------------------------------- -// Function: Group destructor -///\brief Properly terminates access to this group. -// Programmer Binh-Minh Ribler - 2000 +// Function: Group destructor +///\brief Properly terminates access to this group. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Feb 20, 2005 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Feb 20, 2005 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- Group::~Group() { diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index 96dc5c1..0a9e975 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -30,53 +30,53 @@ class VarLenType; class H5_DLLCPP Group : public H5Object, public CommonFG { public: - // Group constructor to create a group or file (aka root group). - Group(const char* name, size_t size_hint = 0); - Group(const H5std_string& name, size_t size_hint = 0); + // Group constructor to create a group or file (aka root group). + Group(const char* name, size_t size_hint = 0); + Group(const H5std_string& name, size_t size_hint = 0); - // Group constructor to open a group or file (aka root group). - Group(const char* name); - Group(const H5std_string& name); + // Group constructor to open a group or file (aka root group). + Group(const char* name); + Group(const H5std_string& name); - // Close this group. - virtual void close(); + // Close this group. + virtual void close(); - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("Group"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("Group"); } - // Throw group exception. - virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; + // Throw group exception. + virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; - // for CommonFG to get the file id. - virtual hid_t getLocId() const; + // for CommonFG to get the file id. + virtual hid_t getLocId() const; - // Creates a group by way of dereference. - Group(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + // Creates a group by way of dereference. + Group(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); // Group(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); - // default constructor - Group(); + // default constructor + Group(); - // Copy constructor: makes a copy of the original object - Group(const Group& original); + // Copy constructor: makes a copy of the original object + Group(const Group& original); - // Gets the group id. - virtual hid_t getId() const; + // Gets the group id. + virtual hid_t getId() const; - // Destructor - virtual ~Group(); + // Destructor + virtual ~Group(); - // Creates a copy of an existing group using its id. - Group(const hid_t group_id); + // Creates a copy of an existing group using its id. + Group( const hid_t group_id ); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Sets the group id. - virtual void p_setId(const hid_t new_id); + // Sets the group id. + virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS private: - hid_t id; // HDF5 group id + hid_t id; // HDF5 group id }; } diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 574b28a..f3d916a 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -15,7 +15,7 @@ #include -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5Library.h" @@ -34,21 +34,21 @@ bool IdComponent::H5cppinit = false; bool IdComponent::H5dontAtexit_called = false; //-------------------------------------------------------------------------- -// Function: IdComponent::incRefCount -///\brief Increment reference counter for a given id. -// Programmer Binh-Minh Ribler - May 2005 +// Function: IdComponent::incRefCount +///\brief Increment reference counter for a given id. +// Programmer Binh-Minh Ribler - May 2005 //-------------------------------------------------------------------------- void IdComponent::incRefCount(const hid_t obj_id) const { if (p_valid_id(obj_id)) - if (H5Iinc_ref(obj_id) < 0) - throw IdComponentException(inMemFunc("incRefCount"), "incrementing object ref count failed"); + if (H5Iinc_ref(obj_id) < 0) + throw IdComponentException(inMemFunc("incRefCount"), "incrementing object ref count failed"); } //-------------------------------------------------------------------------- -// Function: IdComponent::incRefCount -///\brief Increment reference counter for the id of this object. -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent::incRefCount +///\brief Increment reference counter for the id of this object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void IdComponent::incRefCount() const { @@ -56,31 +56,31 @@ void IdComponent::incRefCount() const } //-------------------------------------------------------------------------- -// Function: IdComponent::decRefCount -///\brief Decrement reference counter for a given id. -// Programmer Binh-Minh Ribler - May 2005 +// Function: IdComponent::decRefCount +///\brief Decrement reference counter for a given id. +// Programmer Binh-Minh Ribler - May 2005 // Modification: -// Added the check for ref counter to give a little more info -// on why H5Idec_ref fails in some cases - BMR 5/19/2005 +// Added the check for ref counter to give a little more info +// on why H5Idec_ref fails in some cases - BMR 5/19/2005 //-------------------------------------------------------------------------- void IdComponent::decRefCount(const hid_t obj_id) const { if (p_valid_id(obj_id)) - if (H5Idec_ref(obj_id) < 0) - { - if (H5Iget_ref(obj_id) <= 0) - throw IdComponentException(inMemFunc("decRefCount"), - "object ref count is 0 or negative"); - else - throw IdComponentException(inMemFunc("decRefCount"), - "decrementing object ref count failed"); - } + if (H5Idec_ref(obj_id) < 0) + { + if (H5Iget_ref(obj_id) <= 0) + throw IdComponentException(inMemFunc("decRefCount"), + "object ref count is 0 or negative"); + else + throw IdComponentException(inMemFunc("decRefCount"), + "decrementing object ref count failed"); + } } //-------------------------------------------------------------------------- -// Function: IdComponent::decRefCount -///\brief Decrement reference counter for the id of this object. -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent::decRefCount +///\brief Decrement reference counter for the id of this object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void IdComponent::decRefCount() const { @@ -88,28 +88,28 @@ void IdComponent::decRefCount() const } //-------------------------------------------------------------------------- -// Function: IdComponent::getCounter -///\brief Returns the reference counter for a given id. -///\return Reference count -// Programmer Binh-Minh Ribler - May 2005 +// Function: IdComponent::getCounter +///\brief Returns the reference counter for a given id. +///\return Reference count +// Programmer Binh-Minh Ribler - May 2005 //-------------------------------------------------------------------------- int IdComponent::getCounter(const hid_t obj_id) const { int counter = 0; if (p_valid_id(obj_id)) { - counter = H5Iget_ref(obj_id); - if (counter < 0) - throw IdComponentException(inMemFunc("incRefCount"), "getting object ref count failed - negative"); + counter = H5Iget_ref(obj_id); + if (counter < 0) + throw IdComponentException(inMemFunc("incRefCount"), "getting object ref count failed - negative"); } return (counter); } //-------------------------------------------------------------------------- -// Function: IdComponent::getCounter -///\brief Returns the reference counter for the id of this object. -///\return Reference count -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent::getCounter +///\brief Returns the reference counter for the id of this object. +///\return Reference count +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int IdComponent::getCounter() const { @@ -117,43 +117,43 @@ int IdComponent::getCounter() const } //-------------------------------------------------------------------------- -// Function: getHDFObjType (static) -///\brief Given an id, returns the type of the object. -///\return a valid HDF object type, which may be one of the following: -/// \li \c H5I_FILE -/// \li \c H5I_GROUP -/// \li \c H5I_DATATYPE -/// \li \c H5I_DATASPACE -/// \li \c H5I_DATASET -/// \li \c H5I_ATTR -/// \li or \c H5I_BADID, if no valid type can be determined or the -/// input object id is invalid. +// Function: getHDFObjType (static) +///\brief Given an id, returns the type of the object. +///\return a valid HDF object type, which may be one of the following: +/// \li \c H5I_FILE +/// \li \c H5I_GROUP +/// \li \c H5I_DATATYPE +/// \li \c H5I_DATASPACE +/// \li \c H5I_DATASET +/// \li \c H5I_ATTR +/// \li or \c H5I_BADID, if no valid type can be determined or the +/// input object id is invalid. // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id) { if (obj_id <= 0) - return H5I_BADID; // invalid + return H5I_BADID; // invalid H5I_type_t id_type = H5Iget_type(obj_id); if (id_type <= H5I_BADID || id_type >= H5I_NTYPES) - return H5I_BADID; // invalid + return H5I_BADID; // invalid else - return id_type; // valid type + return id_type; // valid type } //-------------------------------------------------------------------------- -// Function: getHDFObjType -///\brief Returns the type of the object. It is an overloaded function -/// of the above function. -///\return a valid HDF object type, which may be one of the following: -/// \li \c H5I_FILE -/// \li \c H5I_GROUP -/// \li \c H5I_DATATYPE -/// \li \c H5I_DATASPACE -/// \li \c H5I_DATASET -/// \li \c H5I_ATTR -/// \li or \c H5I_BADID, if no valid type can be determined or the -/// input object id is invalid. +// Function: getHDFObjType +///\brief Returns the type of the object. It is an overloaded function +/// of the above function. +///\return a valid HDF object type, which may be one of the following: +/// \li \c H5I_FILE +/// \li \c H5I_GROUP +/// \li \c H5I_DATATYPE +/// \li \c H5I_DATASPACE +/// \li \c H5I_DATASET +/// \li \c H5I_ATTR +/// \li or \c H5I_BADID, if no valid type can be determined or the +/// input object id is invalid. // Programmer Binh-Minh Ribler - Mar, 2014 //-------------------------------------------------------------------------- H5I_type_t IdComponent::getHDFObjType() const @@ -162,140 +162,74 @@ H5I_type_t IdComponent::getHDFObjType() const } //-------------------------------------------------------------------------- -// Function: getNumMembers (static) -///\brief Returns the number of members of the given type. -///\return Number of members -///\Description -/// If there is no member of the given type, getNumMembers will -/// return 0. Valid types are: -/// \li \c H5I_FILE (= 1) -/// \li \c H5I_GROUP -/// \li \c H5I_DATATYPE -/// \li \c H5I_DATASPACE -/// \li \c H5I_DATASET -/// \li \c H5I_ATTR -/// \li \c H5I_REFERENCE -/// \li \c H5I_VFL -/// \li \c H5I_GENPROP_CLS -/// \li \c H5I_GENPROP_LST -/// \li \c H5I_ERROR_CLASS -/// \li \c H5I_ERROR_MSG -/// \li \c H5I_ERROR_STACK -// Programmer Binh-Minh Ribler - Feb, 2017 -//-------------------------------------------------------------------------- -hsize_t IdComponent::getNumMembers(H5I_type_t type) -{ - hsize_t nmembers = 0; - herr_t ret_value = H5Inmembers(type, &nmembers); - if (ret_value < 0) - throw IdComponentException("getNumMembers", "H5Inmembers failed"); - else - return(nmembers); -} - -//-------------------------------------------------------------------------- -// Function: typeExists (static) -///\brief Queries if a given type is currently registered with the -/// library. -///\return true if the given type exists, and false, otherwise. -///\Description -/// Valid types are: -/// \li \c H5I_FILE (= 1) -/// \li \c H5I_GROUP -/// \li \c H5I_DATATYPE -/// \li \c H5I_DATASPACE -/// \li \c H5I_DATASET -/// \li \c H5I_ATTR -/// \li \c H5I_REFERENCE -/// \li \c H5I_VFL -/// \li \c H5I_GENPROP_CLS -/// \li \c H5I_GENPROP_LST -/// \li \c H5I_ERROR_CLASS -/// \li \c H5I_ERROR_MSG -/// \li \c H5I_ERROR_STACK -// Programmer Binh-Minh Ribler - Feb, 2017 -//-------------------------------------------------------------------------- -bool IdComponent::typeExists(H5I_type_t type) -{ - // Call C function - htri_t ret_value = H5Itype_exists(type); - if (ret_value > 0) - return true; - else if (ret_value == 0) - return false; - else // Raise exception when H5Itype_exists returns a negative value - throw IdComponentException("typeExists", "H5Itype_exists failed"); -} - -//-------------------------------------------------------------------------- -// Function: IdComponent::operator= -///\brief Assignment operator. -///\param rhs - IN: Reference to the existing object -///\return Reference to IdComponent instance -///\exception H5::IdComponentException when attempt to close the HDF5 -/// object fails +// Function: IdComponent::operator= +///\brief Assignment operator. +///\param rhs - IN: Reference to the existing object +///\return Reference to IdComponent instance +///\exception H5::IdComponentException when attempt to close the HDF5 +/// object fails // Description -// First, close the current valid id of this object. Then -// copy the id from rhs to this object, and increment the -// reference counter of the id to indicate that another object -// is referencing that id. +// First, close the current valid id of this object. Then +// copy the id from rhs to this object, and increment the +// reference counter of the id to indicate that another object +// is referencing that id. // Modification -// 2010/5/9 - BMR -// Removed close() and incRefCount() because setId/p_setId takes -// care of close() and setId takes care incRefCount(). -// Programmer Binh-Minh Ribler - 2000 +// 2010/5/9 - BMR +// Removed close() and incRefCount() because setId/p_setId takes +// care of close() and setId takes care incRefCount(). +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IdComponent& IdComponent::operator=(const IdComponent& rhs) +IdComponent& IdComponent::operator=( const IdComponent& rhs ) { if (this != &rhs) { - // handling references to this id - try { - setId(rhs.getId()); - // Note: a = b, so there are two objects with the same hdf5 id - // that's why incRefCount is needed, and it is called by setId - } - catch (Exception& close_error) { - throw FileIException(inMemFunc("operator="), close_error.getDetailMsg()); - } + // handling references to this id + try { + setId(rhs.getId()); + // Note: a = b, so there are two objects with the same hdf5 id + // that's why incRefCount is needed, and it is called by setId + } + catch (Exception& close_error) { + throw FileIException(inMemFunc("operator="), close_error.getDetailMsg()); + } } return *this; } //-------------------------------------------------------------------------- -// Function: IdComponent::setId -///\brief Sets the identifier of this object to a new value. -///\param new_id - IN: New identifier to be set to -///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails +// Function: IdComponent::setId +///\brief Sets the identifier of this object to a new value. +///\param new_id - IN: New identifier to be set to +///\exception H5::IdComponentException when the attempt to close the HDF5 +/// object fails // Description: -// p_setId ensures that the current valid id of this object is -// properly closed before resetting the object's id to the new id. -// Programmer Binh-Minh Ribler - 2000 +// p_setId ensures that the current valid id of this object is +// properly closed before resetting the object's id to the new id. +// Programmer Binh-Minh Ribler - 2000 // Modification -// 2008/7/23 - BMR -// Changed all subclasses' setId to p_setId and put back setId -// here. p_setId is used in the library where the id provided -// by a C API passed on to user's application in the form of a -// C++ API object, which will be destroyed properly, and so -// p_setId does not call incRefCount. On the other hand, the -// public version setId is used by other applications, in which -// the id passed to setId is that of another C++ API object, so -// setId must call incRefCount. +// 2008/7/23 - BMR +// Changed all subclasses' setId to p_setId and put back setId +// here. p_setId is used in the library where the id provided +// by a C API passed on to user's application in the form of a +// C++ API object, which will be destroyed properly, and so +// p_setId does not call incRefCount. On the other hand, the +// public version setId is used by other applications, in which +// the id passed to setId is that of another C++ API object, so +// setId must call incRefCount. //-------------------------------------------------------------------------- void IdComponent::setId(const hid_t new_id) { - // set to new_id - p_setId(new_id); + // set to new_id + p_setId(new_id); - // increment the reference counter of the new id - incRefCount(); + // increment the reference counter of the new id + incRefCount(); } //-------------------------------------------------------------------------- -// Function: IdComponent destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IdComponent::~IdComponent() {} @@ -306,29 +240,29 @@ IdComponent::~IdComponent() {} #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: IdComponent::inMemFunc -///\brief Makes and returns string "::" -///\param func_name - Name of the function where failure occurs +// Function: IdComponent::inMemFunc +///\brief Makes and returns string "::" +///\param func_name - Name of the function where failure occurs // Description -/// Concatenates the class name of this object with the -/// passed-in function name to create a string that indicates -/// where the failure occurs. The class-name is provided by -/// fromClass(). This string will be used by a base class when -/// an exception is thrown. -// Programmer Binh-Minh Ribler - Aug 6, 2005 +/// Concatenates the class name of this object with the +/// passed-in function name to create a string that indicates +/// where the failure occurs. The class-name is provided by +/// fromClass(). This string will be used by a base class when +/// an exception is thrown. +// Programmer Binh-Minh Ribler - Aug 6, 2005 //-------------------------------------------------------------------------- H5std_string IdComponent::inMemFunc(const char* func_name) const { - H5std_string full_name = func_name; - full_name.insert(0, "::"); - full_name.insert(0, fromClass()); - return (full_name); + H5std_string full_name = func_name; + full_name.insert(0, "::"); + full_name.insert(0, fromClass()); + return (full_name); } //-------------------------------------------------------------------------- -// Function: IdComponent default constructor - private -///\brief Default constructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: IdComponent default constructor - private +///\brief Default constructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IdComponent::IdComponent() { @@ -342,45 +276,45 @@ IdComponent::IdComponent() } //-------------------------------------------------------------------------- -// Function: IdComponent::p_get_file_name (protected) -// Purpose Gets the name of the file, in which this object belongs. -// Exception: H5::IdComponentException +// Function: IdComponent::p_get_file_name (protected) +// Purpose: Gets the name of the file, in which this object belongs. +// Exception: H5::IdComponentException // Description: -// This function is protected so that the user applications can -// only have access to its code via allowable classes, namely, -// Attribute and H5Location subclasses. -// Programmer Binh-Minh Ribler - Jul, 2004 +// This function is protected so that the user applications can +// only have access to its code via allowable classes, namely, +// Attribute and H5Location subclasses. +// Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- H5std_string IdComponent::p_get_file_name() const { - hid_t temp_id = getId(); + hid_t temp_id = getId(); - // Preliminary call to H5Fget_name to get the length of the file name - ssize_t name_size = H5Fget_name(temp_id, NULL, 0); + // Preliminary call to H5Fget_name to get the length of the file name + ssize_t name_size = H5Fget_name(temp_id, NULL, 0); - // If H5Aget_name returns a negative value, raise an exception, - if (name_size < 0) - { - throw IdComponentException("", "H5Fget_name failed"); - } + // If H5Aget_name returns a negative value, raise an exception, + if( name_size < 0 ) + { + throw IdComponentException("", "H5Fget_name failed"); + } - // Call H5Fget_name again to get the actual file name - char* name_C = new char[name_size+1]; // temporary C-string for C API - HDmemset(name_C, 0, name_size+1); // clear buffer + // Call H5Fget_name again to get the actual file name + char* name_C = new char[name_size+1]; // temporary C-string for C API + HDmemset(name_C, 0, name_size+1); // clear buffer - name_size = H5Fget_name(temp_id, name_C, name_size+1); + name_size = H5Fget_name(temp_id, name_C, name_size+1); - // Check for failure again - if (name_size < 0) - { + // Check for failure again + if( name_size < 0 ) + { delete []name_C; - throw IdComponentException("", "H5Fget_name failed"); - } + throw IdComponentException("", "H5Fget_name failed"); + } - // Convert the C file name and return - H5std_string file_name(name_C); - delete []name_C; - return(file_name); + // Convert the C file name and return + H5std_string file_name(name_C); + delete []name_C; + return(file_name); } // @@ -388,22 +322,22 @@ H5std_string IdComponent::p_get_file_name() const // //-------------------------------------------------------------------------- -// Function: p_valid_id -// Purpose Verifies that the given id is a valid id so it can be passed -// into an H5I C function. -// Return true if id is valid, false, otherwise -// Programmer Binh-Minh Ribler - May, 2005 +// Function: p_valid_id +// Purpose: Verifies that the given id is a valid id so it can be passed +// into an H5I C function. +// Return true if id is valid, false, otherwise +// Programmer Binh-Minh Ribler - May, 2005 //-------------------------------------------------------------------------- bool IdComponent::p_valid_id(const hid_t obj_id) { if (obj_id <= 0) - return false; + return false; H5I_type_t id_type = H5Iget_type(obj_id); if (id_type <= H5I_BADID || id_type >= H5I_NTYPES) - return false; + return false; else - return true; + return true; } // Notes about IdComponent::id diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index 6f57364..d3d9b9f 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -30,92 +30,86 @@ class DataSpace; class H5_DLLCPP IdComponent { public: - // Increment reference counter. - void incRefCount(const hid_t obj_id) const; - void incRefCount() const; + // Increment reference counter. + void incRefCount(const hid_t obj_id) const; + void incRefCount() const; - // Decrement reference counter. - void decRefCount(const hid_t obj_id) const; - void decRefCount() const; + // Decrement reference counter. + void decRefCount(const hid_t obj_id) const; + void decRefCount() const; - // Get the reference counter to this identifier. - int getCounter(const hid_t obj_id) const; - int getCounter() const; + // Get the reference counter to this identifier. + int getCounter(const hid_t obj_id) const; + int getCounter() const; - // Returns an HDF5 object type, given the object id. - static H5I_type_t getHDFObjType(const hid_t obj_id); + // Returns an HDF5 object type, given the object id. + static H5I_type_t getHDFObjType(const hid_t obj_id); - // Returns an HDF5 object type of this object. - H5I_type_t getHDFObjType() const; + // Returns an HDF5 object type of this object. + H5I_type_t getHDFObjType() const; - // Returns the number of members in a type. - static hsize_t getNumMembers(H5I_type_t type); + // Assignment operator. + IdComponent& operator=( const IdComponent& rhs ); - // Determines if an type exists. - static bool typeExists(H5I_type_t type); + // Sets the identifier of this object to a new value. + void setId(const hid_t new_id); - // Assignment operator. - IdComponent& operator=(const IdComponent& rhs); + // *** Deprecation warning *** + // The following two constructors are no longer appropriate after the + // data member "id" had been moved to the sub-classes. + // The copy constructor is a noop and is removed in 1.8.15 and the + // other will be removed from 1.10 release, and then from 1.8 if its + // removal does not raise any problems in two 1.10 releases. - // Sets the identifier of this object to a new value. - void setId(const hid_t new_id); - - // *** Deprecation warning *** - // The following two constructors are no longer appropriate after the - // data member "id" had been moved to the sub-classes. - // The copy constructor is a noop and is removed in 1.8.15 and the - // other will be removed from 1.10 release, and then from 1.8 if its - // removal does not raise any problems in two 1.10 releases. - - // Creates an object to hold an HDF5 identifier. - // IdComponent(const hid_t h5_id); - removed from 1.10.1 + // Creates an object to hold an HDF5 identifier. + IdComponent( const hid_t h5_id ); #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Copy constructor: makes copy of the original IdComponent object. - // IdComponent(const IdComponent& original); - removed from 1.8.15 + // Copy constructor: makes copy of the original IdComponent object. + // IdComponent( const IdComponent& original ); - removed from 1.8.15 - // Gets the identifier of this object. - virtual hid_t getId () const = 0; + // Gets the identifier of this object. + virtual hid_t getId () const = 0; - // Pure virtual function for there are various H5*close for the - // subclasses. - virtual void close() = 0; + // Pure virtual function for there are various H5*close for the + // subclasses. + virtual void close() = 0; - // Makes and returns the string "::"; - // is returned by fromClass(). - H5std_string inMemFunc(const char* func_name) const; + // Makes and returns the string "::"; + // is returned by fromClass(). + H5std_string inMemFunc(const char* func_name) const; - ///\brief Returns this class name. - virtual H5std_string fromClass() const { return("IdComponent");} + ///\brief Returns this class name. + virtual H5std_string fromClass() const { return("IdComponent");} #endif // DOXYGEN_SHOULD_SKIP_THIS - // Destructor - virtual ~IdComponent(); + // Destructor + virtual ~IdComponent(); #ifndef DOXYGEN_SHOULD_SKIP_THIS protected: - // Default constructor. - IdComponent(); + // Default constructor. + IdComponent(); - // Gets the name of the file, in which an HDF5 object belongs. - H5std_string p_get_file_name() const; + // Gets the name of the file, in which an HDF5 object belongs. + H5std_string p_get_file_name() const; - // Verifies that the given id is valid. - static bool p_valid_id(const hid_t obj_id); + // Verifies that the given id is valid. + static bool p_valid_id(const hid_t obj_id); - // Sets the identifier of this object to a new value. - this one - // doesn't increment reference count - virtual void p_setId(const hid_t new_id) = 0; + // Sets the identifier of this object to a new value. - this one + // doesn't increment reference count + virtual void p_setId(const hid_t new_id) = 0; - // This flag is used to decide whether H5dont_atexit should be called - static bool H5dontAtexit_called; + // This flag is used to decide whether H5dont_atexit should be called + static bool H5dontAtexit_called; private: - // This flag indicates whether H5Library::initH5cpp has been called - // to register various terminating functions with atexit() + // This flag indicates whether H5Library::initH5cpp has been called + // to register various terminating functions with atexit() static bool H5cppinit; #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Include.h b/c++/src/H5Include.h index ba82d78..1e0e952 100644 --- a/c++/src/H5Include.h +++ b/c++/src/H5Include.h @@ -33,10 +33,10 @@ const bool true = 1; // so re-define them here for now. /* Initial version of the object header format */ -#define H5O_VERSION_1 1 +#define H5O_VERSION_1 1 /* Revised version - leaves out reserved bytes and alignment padding, and adds * magic number as prefix and checksum as suffix for all chunks. */ -#define H5O_VERSION_2 2 +#define H5O_VERSION_2 2 diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index c64dae9..38e2a7d 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -36,72 +36,72 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: IntType default constructor -///\brief Default constructor: Creates a stub integer datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType default constructor +///\brief Default constructor: Creates a stub integer datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::IntType() {} //-------------------------------------------------------------------------- -// Function: IntType copy constructor -///\brief Copy constructor: makes a copy of the original IntType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType copy constructor +///\brief Copy constructor: makes a copy of the original IntType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType::IntType(const IntType& original) : AtomType( original ) {} +IntType::IntType( const IntType& original ) : AtomType( original ) {} //-------------------------------------------------------------------------- -// Function: IntType overloaded constructor -///\brief Creates a integer type using a predefined type -///\param pred_type - IN: Predefined datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType overloaded constructor +///\brief Creates a integer type using a predefined type +///\param pred_type - IN: Predefined datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType::IntType(const PredType& pred_type) : AtomType() +IntType::IntType( const PredType& pred_type ) : AtomType() { - // use DataType::copy to make a copy of this predefined type - copy(pred_type); + // use DataType::copy to make a copy of this predefined type + copy( pred_type ); } //-------------------------------------------------------------------------- -// Function: IntType overloaded constructor -///\brief Creates an integer datatype using the id of an existing -/// datatype. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType overloaded constructor +///\brief Creates an integer datatype using the id of an existing +/// datatype. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType::IntType(const hid_t existing_id) : AtomType( existing_id ) {} +IntType::IntType( const hid_t existing_id ) : AtomType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: IntType overloaded constructor -///\brief Gets the integer datatype of the specified dataset. -///\param dataset - IN: Dataset that this integer datatype associates with -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType overloaded constructor +///\brief Gets the integer datatype of the specified dataset. +///\param dataset - IN: Dataset that this integer datatype associates with +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -IntType::IntType(const DataSet& dataset) : AtomType() +IntType::IntType( const DataSet& dataset ) : AtomType() { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type(dataset.getId()); - - if (id < 0) - { - throw DataSetIException("IntType constructor", "H5Dget_type failed"); - } + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type( dataset.getId() ); + + if( id < 0 ) + { + throw DataSetIException("IntType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: IntType overloaded constructor -///\brief Creates a IntType instance by opening an HDF5 integer datatype -/// given its name as a char*. -///\param dtype_name - IN: Integer type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: IntType overloaded constructor +///\brief Creates a IntType instance by opening an HDF5 integer datatype +/// given its name as a char*. +///\param dtype_name - IN: Integer type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openIntType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openIntType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- IntType::IntType(const H5Location& loc, const char *dtype_name) : AtomType() { @@ -109,17 +109,17 @@ IntType::IntType(const H5Location& loc, const char *dtype_name) : AtomType() } //-------------------------------------------------------------------------- -// Function: IntType overloaded constructor -///\brief Creates a IntType instance by opening an HDF5 integer datatype -/// given its name, provided as an \c H5std_string. -///\param dtype_name - IN: Integer type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: IntType overloaded constructor +///\brief Creates a IntType instance by opening an HDF5 integer datatype +/// given its name, provided as an \c H5std_string. +///\param dtype_name - IN: Integer type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openArrayType(const H5std_string&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openArrayType(const H5std_string&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- IntType::IntType(const H5Location& loc, const H5std_string& dtype_name) : AtomType() { @@ -127,46 +127,46 @@ IntType::IntType(const H5Location& loc, const H5std_string& dtype_name) : AtomTy } //-------------------------------------------------------------------------- -// Function: IntType::getSign -///\brief Retrieves the sign type for an integer type. -///\return Valid sign type -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType::getSign +///\brief Retrieves the sign type for an integer type. +///\return Valid sign type +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_sign_t IntType::getSign() const { - H5T_sign_t type_sign = H5Tget_sign(id); // C routine - - // Returns a valid sign type if no errors - if (type_sign == H5T_SGN_ERROR) - { - throw DataTypeIException("IntType::getSign", - "H5Tget_sign failed - returned H5T_SGN_ERROR for the sign type"); - } - return(type_sign); + H5T_sign_t type_sign = H5Tget_sign( id ); // C routine + + // Returns a valid sign type if no errors + if( type_sign == H5T_SGN_ERROR ) + { + throw DataTypeIException("IntType::getSign", + "H5Tget_sign failed - returned H5T_SGN_ERROR for the sign type"); + } + return( type_sign ); } //-------------------------------------------------------------------------- -// Function: IntType::getSign -///\brief Sets the sign property for an integer type. -///\param sign - IN: Sign type -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType::getSign +///\brief Sets the sign property for an integer type. +///\param sign - IN: Sign type +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void IntType::setSign(H5T_sign_t sign) const +void IntType::setSign( H5T_sign_t sign ) const { - // Call C routine to set the sign property - herr_t ret_value = H5Tset_sign(id, sign); - if (ret_value < 0) - { - throw DataTypeIException("IntType::setSign", "H5Tset_sign failed"); - } + // Call C routine to set the sign property + herr_t ret_value = H5Tset_sign( id, sign ); + if( ret_value < 0 ) + { + throw DataTypeIException("IntType::setSign", "H5Tset_sign failed"); + } } //-------------------------------------------------------------------------- -// Function: IntType destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: IntType destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::~IntType() {} diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index ae4b3df..74786b9 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -27,36 +27,36 @@ namespace H5 { */ class H5_DLLCPP IntType : public AtomType { public: - // Creates an integer type using a predefined type - IntType(const PredType& pred_type); + // Creates an integer type using a predefined type + IntType(const PredType& pred_type); - // Gets the integer datatype of the specified dataset - IntType(const DataSet& dataset); + // Gets the integer datatype of the specified dataset + IntType(const DataSet& dataset); - // Constructors that open an HDF5 integer datatype, given a location. - IntType(const H5Location& loc, const char* name); - IntType(const H5Location& loc, const H5std_string& name); + // Constructors that open an HDF5 integer datatype, given a location. + IntType(const H5Location& loc, const char* name); + IntType(const H5Location& loc, const H5std_string& name); - // Retrieves the sign type for an integer type - H5T_sign_t getSign() const; + // Retrieves the sign type for an integer type + H5T_sign_t getSign() const; - // Sets the sign proprety for an integer type. - void setSign(H5T_sign_t sign) const; + // Sets the sign proprety for an integer type. + void setSign( H5T_sign_t sign ) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("IntType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("IntType"); } - // Default constructor - IntType(); + // Default constructor + IntType(); - // Creates a integer datatype using an existing id - IntType(const hid_t existing_id); + // Creates a integer datatype using an existing id + IntType(const hid_t existing_id); - // Copy constructor: makes copy of IntType object - IntType(const IntType& original); + // Copy constructor: makes copy of IntType object + IntType(const IntType& original); - // Noop destructor. - virtual ~IntType(); + // Noop destructor. + virtual ~IntType(); }; } #endif // __H5IntType_H diff --git a/c++/src/H5LaccProp.cpp b/c++/src/H5LaccProp.cpp index e9adb12..e225b36 100644 --- a/c++/src/H5LaccProp.cpp +++ b/c++/src/H5LaccProp.cpp @@ -47,7 +47,7 @@ LinkAccPropList* LinkAccPropList::getConstant() // Tell the C library not to clean up, H5Library::termH5cpp will call // H5close - more dependency if use H5Library::dontAtExit() if (!IdComponent::H5dontAtexit_called) - { + { (void) H5dont_atexit(); IdComponent::H5dontAtexit_called = true; } @@ -75,39 +75,39 @@ void LinkAccPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose: Constant for default property +// Purpose: Constant for default property //-------------------------------------------------------------------------- const LinkAccPropList& LinkAccPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Default Constructor -///\brief Creates a file access property list -// Programmer Binh-Minh Ribler - 2000 +// Function: Default Constructor +///\brief Creates a file access property list +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -LinkAccPropList::LinkAccPropList() : PropList(H5P_LINK_ACCESS) {} +LinkAccPropList::LinkAccPropList() : PropList( H5P_LINK_ACCESS ) {} //-------------------------------------------------------------------------- -// Function: LinkAccPropList copy constructor -///\brief Copy Constructor: makes a copy of the original -///\param original - IN: LinkAccPropList instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: LinkAccPropList copy constructor +///\brief Copy Constructor: makes a copy of the original +///\param original - IN: LinkAccPropList instance to copy +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- LinkAccPropList::LinkAccPropList(const LinkAccPropList& original) : PropList(original) {} //-------------------------------------------------------------------------- -// Function: LinkAccPropList overloaded constructor -///\brief Creates a file access property list using the id of an -/// existing one. -// Programmer Binh-Minh Ribler - 2000 +// Function: LinkAccPropList overloaded constructor +///\brief Creates a file access property list using the id of an +/// existing one. +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- LinkAccPropList::LinkAccPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: LinkAccPropList destructor -///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Function: LinkAccPropList destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- LinkAccPropList::~LinkAccPropList() {} diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h index 8bcdd64..2a84ffb 100644 --- a/c++/src/H5LaccProp.h +++ b/c++/src/H5LaccProp.h @@ -30,24 +30,24 @@ namespace H5 { */ class H5_DLLCPP LinkAccPropList : public PropList { public: - ///\brief Default file access property list. - static const LinkAccPropList& DEFAULT; + ///\brief Default file access property list. + static const LinkAccPropList& DEFAULT; - // Creates a file access property list. - LinkAccPropList(); + // Creates a file access property list. + LinkAccPropList(); - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("LinkAccPropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("LinkAccPropList"); } - // Copy constructor: creates a copy of a LinkAccPropList object. - LinkAccPropList(const LinkAccPropList& original); + // Copy constructor: creates a copy of a LinkAccPropList object. + LinkAccPropList( const LinkAccPropList& original ); - // Creates a copy of an existing file access property list - // using the property list id. - LinkAccPropList (const hid_t plist_id); + // Creates a copy of an existing file access property list + // using the property list id. + LinkAccPropList (const hid_t plist_id); - // Noop destructor - virtual ~LinkAccPropList(); + // Noop destructor + virtual ~LinkAccPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index dc453b7..0ee6b4d 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -38,46 +38,46 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: H5Library::open (static) -///\brief Initializes the HDF5 library. +// Function: H5Library::open (static) +///\brief Initializes the HDF5 library. /// -///\exception H5::LibraryIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::LibraryIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::open() { - herr_t ret_value = H5open(); - if (ret_value < 0) - { - throw LibraryIException("H5Library::open", "H5open failed"); - } + herr_t ret_value = H5open(); + if( ret_value < 0 ) + { + throw LibraryIException("H5Library::open", "H5open failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Library::close (static) -///\brief Flushes all data to disk, closes files, and cleans up memory. +// Function: H5Library::close (static) +///\brief Flushes all data to disk, closes files, and cleans up memory. /// -///\exception H5::LibraryIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::LibraryIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::close() { - herr_t ret_value = H5close(); - if (ret_value < 0) - { - throw LibraryIException("H5Library::close", "H5close failed"); - } + herr_t ret_value = H5close(); + if( ret_value < 0 ) + { + throw LibraryIException("H5Library::close", "H5close failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Library::dontAtExit (static) -///\brief Instructs library not to install the C \c atexit cleanup routine +// Function: H5Library::dontAtExit (static) +///\brief Instructs library not to install the C \c atexit cleanup routine /// -///\exception H5::LibraryIException -// Programmer Binh-Minh Ribler - 2000 +///\exception H5::LibraryIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Removed the check for failure returned from H5dont_atexit. -// will be fixed to not fail (HDFFV-9540) +// Removed the check for failure returned from H5dont_atexit. +// will be fixed to not fail (HDFFV-9540) //-------------------------------------------------------------------------- void H5Library::dontAtExit() { @@ -85,80 +85,80 @@ void H5Library::dontAtExit() } //-------------------------------------------------------------------------- -// Function: H5Library::getLibVersion (static) -///\brief Returns the HDF library release number. -///\param majnum - OUT: Major version of the library -///\param minnum - OUT: Minor version of the library -///\param relnum - OUT: Release number of the library -///\exception H5::LibraryIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Library::getLibVersion (static) +///\brief Returns the HDF library release number. +///\param majnum - OUT: Major version of the library +///\param minnum - OUT: Minor version of the library +///\param relnum - OUT: Release number of the library +///\exception H5::LibraryIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Library::getLibVersion(unsigned& majnum, unsigned& minnum, unsigned& relnum) +void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum ) { - herr_t ret_value = H5get_libversion(&majnum, &minnum, &relnum); - if (ret_value < 0) - { - throw LibraryIException("H5Library::getLibVersion", "H5get_libversion failed"); - } + herr_t ret_value = H5get_libversion( &majnum, &minnum, &relnum ); + if( ret_value < 0 ) + { + throw LibraryIException("H5Library::getLibVersion", "H5get_libversion failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Library::checkVersion (static) -///\brief Verifies that the arguments match the version numbers -/// compiled into the library -///\param majnum - IN: Major version of the library -///\param minnum - IN: Minor version of the library -///\param relnum - IN: Release number of the library -///\exception H5::LibraryIException +// Function: H5Library::checkVersion (static) +///\brief Verifies that the arguments match the version numbers +/// compiled into the library +///\param majnum - IN: Major version of the library +///\param minnum - IN: Minor version of the library +///\param relnum - IN: Release number of the library +///\exception H5::LibraryIException ///\par Description -/// For information about library version, please refer to -/// the C layer Reference Manual at: +/// For information about library version, please refer to +/// the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-VersCheck -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum) { - herr_t ret_value = H5check_version(majnum, minnum, relnum); - if (ret_value < 0) - { - throw LibraryIException("H5Library::checkVersion", "H5check_version failed"); - } + herr_t ret_value = H5check_version(majnum, minnum, relnum); + if( ret_value < 0 ) + { + throw LibraryIException("H5Library::checkVersion", "H5check_version failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Library::garbageCollect (static) -///\brief Walks through all the garbage collection routines for the -/// library, which are supposed to free any unused memory they -/// have allocated. +// Function: H5Library::garbageCollect (static) +///\brief Walks through all the garbage collection routines for the +/// library, which are supposed to free any unused memory they +/// have allocated. /// -///\exception H5::LibraryIException +///\exception H5::LibraryIException ///\par Description -/// It is not required that H5Library::garbageCollect be called -/// at any particular time; it is only necessary in certain -/// situations, such as when the application has performed actions -/// that cause the library to allocate many objects. The -/// application should call H5Library::garbageCollect if it -/// eventually releases those objects and wants to reduce the -/// memory used by the library from the peak usage required. +/// It is not required that H5Library::garbageCollect be called +/// at any particular time; it is only necessary in certain +/// situations, such as when the application has performed actions +/// that cause the library to allocate many objects. The +/// application should call H5Library::garbageCollect if it +/// eventually releases those objects and wants to reduce the +/// memory used by the library from the peak usage required. ///\par -/// The library automatically garbage collects all the free -/// lists when the application ends. -// Programmer Binh-Minh Ribler - May, 2004 +/// The library automatically garbage collects all the free +/// lists when the application ends. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Library::garbageCollect() { - herr_t ret_value = H5garbage_collect(); - if (ret_value < 0) - { - throw LibraryIException("H5Library::garbageCollect", "H5garbage_collect failed"); - } + herr_t ret_value = H5garbage_collect(); + if( ret_value < 0 ) + { + throw LibraryIException("H5Library::garbageCollect", "H5garbage_collect failed"); + } } //-------------------------------------------------------------------------- // Function: H5Library::initH5cpp (static) ///\brief Initializes C++ library and registers terminating functions at -/// exit. Only for the library functions, not for user-defined -/// functions. +/// exit. Only for the library functions, not for user-defined +/// functions. // Description // initH5cpp registers the following functions with std::atexit(): // termH5cpp() - calls H5close() after all cleanup in @@ -231,45 +231,45 @@ void H5Library::termH5cpp() } //-------------------------------------------------------------------------- -// Function: H5Library::setFreeListLimits (static) -///\brief Sets limits on the different kinds of free lists. -///\param reg_global_lim - IN: Limit on all "regular" free list memory used -///\param reg_list_lim - IN: Limit on memory used in each "regular" free list -///\param arr_global_lim - IN: Limit on all "array" free list memory used -///\param arr_list_lim - IN: Limit on memory used in each "array" free list -///\param blk_global_lim - IN: Limit on all "block" free list memory used -///\param blk_list_lim - IN: Limit on memory used in each "block" free list -///\exception H5::LibraryIException +// Function: H5Library::setFreeListLimits (static) +///\brief Sets limits on the different kinds of free lists. +///\param reg_global_lim - IN: Limit on all "regular" free list memory used +///\param reg_list_lim - IN: Limit on memory used in each "regular" free list +///\param arr_global_lim - IN: Limit on all "array" free list memory used +///\param arr_list_lim - IN: Limit on memory used in each "array" free list +///\param blk_global_lim - IN: Limit on all "block" free list memory used +///\param blk_list_lim - IN: Limit on memory used in each "block" free list +///\exception H5::LibraryIException ///\par Description -/// Setting a value of -1 for a limit means no limit of that type. -/// For more information on free list limits, please refer to C -/// layer Reference Manual at: +/// Setting a value of -1 for a limit means no limit of that type. +/// For more information on free list limits, please refer to C +/// layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-SetFreeListLimits -// Programmer Binh-Minh Ribler - May, 2004 +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, - int arr_global_lim, int arr_list_lim, int blk_global_lim, - int blk_list_lim) + int arr_global_lim, int arr_list_lim, int blk_global_lim, + int blk_list_lim) { - herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim); - if (ret_value < 0) - { - throw LibraryIException("H5Library::setFreeListLimits", "H5set_free_list_limits failed"); - } + herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim); + if( ret_value < 0 ) + { + throw LibraryIException("H5Library::setFreeListLimits", "H5set_free_list_limits failed"); + } } #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Library default constructor - private -///\brief Default constructor: Creates a stub H5Library object -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Library default constructor - private +///\brief Default constructor: Creates a stub H5Library object +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Library::H5Library(){} //-------------------------------------------------------------------------- -// Function: H5Library destructor -///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Library destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Library::~H5Library(){} #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 018ba38..694b052 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -27,32 +27,32 @@ namespace H5 { */ class H5_DLLCPP H5Library { public: - // Initializes the HDF5 library. - static void open(); + // Initializes the HDF5 library. + static void open(); - // Flushes all data to disk, closes files, and cleans up memory. - static void close(); + // Flushes all data to disk, closes files, and cleans up memory. + static void close(); - // Instructs library not to install atexit cleanup routine - static void dontAtExit(); + // Instructs library not to install atexit cleanup routine + static void dontAtExit(); - // Returns the HDF library release number. - static void getLibVersion(unsigned& majnum, unsigned& minnum, unsigned& relnum); + // Returns the HDF library release number. + static void getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum ); - // Verifies that the arguments match the version numbers compiled - // into the library - static void checkVersion(unsigned majnum, unsigned minnum, unsigned relnum); + // Verifies that the arguments match the version numbers compiled + // into the library + static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum ); - // Walks through all the garbage collection routines for the library, - // which are supposed to free any unused memory they have allocated. - static void garbageCollect(); + // Walks through all the garbage collection routines for the library, + // which are supposed to free any unused memory they have allocated. + static void garbageCollect(); - // Sets limits on the different kinds of free lists. - static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int - arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); + // Sets limits on the different kinds of free lists. + static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int + arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); // Initializes C++ library and registers terminating functions at exit. - // Only for the library functions, not for user-defined functions. + // Only for the library functions, not for user-defined functions. static void initH5cpp(void); // Sends request for terminating the HDF5 library. diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 5a0bb73..a3e6738 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -15,7 +15,7 @@ #include -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -40,17 +40,17 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location default constructor (protected) -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location default constructor (protected) +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Location::H5Location() : IdComponent() {} //-------------------------------------------------------------------------- -// Function: H5Location overloaded constructor (protected) -// Purpose Creates an H5Location object using the id of an existing HDF5 -// object. -// Parameters object_id - IN: Id of an existing HDF5 object -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location overloaded constructor (protected) +// Purpose Creates an H5Location object using the id of an existing HDF5 +// object. +// Parameters object_id - IN: Id of an existing HDF5 object +// Programmer Binh-Minh Ribler - 2000 // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had @@ -62,11 +62,11 @@ H5Location::H5Location() : IdComponent() {} // H5Location::H5Location(const hid_t object_id) : IdComponent() {} //-------------------------------------------------------------------------- -// Function: H5Location copy constructor -// Purpose This noop copy constructor is removed as a result of the data -// member "id" being moved down to sub-classes. (Mar 2015) -///\param original - IN: H5Location instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location copy constructor +// Purpose: This noop copy constructor is removed as a result of the data +// member "id" being moved down to sub-classes. (Mar 2015) +///\param original - IN: H5Location instance to copy +// Programmer Binh-Minh Ribler - 2000 // // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had @@ -78,34 +78,34 @@ H5Location::H5Location() : IdComponent() {} #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::exists -///\brief Checks if a link of a given name exists in a location -///\param name - IN: Searched name -///\param lapl - IN: Link access property list -///\exception H5::LocationException -// Programmer Binh-Minh Ribler - Nov, 2016 +// Function: H5Location::exists +///\brief Checks if a link of a given name exists in a location +///\param name - IN: Searched name +///\param lapl - IN: Link access property list +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Nov, 2016 // Modification //-------------------------------------------------------------------------- bool H5Location::exists(const char* name, const LinkAccPropList& lapl) const { htri_t ret_value = H5Lexists(getId(), name, lapl.getId()); if (ret_value > 0) - return true; + return true; else if (ret_value == 0) - return false; + return false; else // Raise exception when H5Lexists returns a negative value { - throwException("exists", "H5Lexists failed"); + throwException("exists", "H5Lexists failed"); } } //-------------------------------------------------------------------------- -// Function: H5Location::exists -///\brief Checks if a link of a given name exists in a location -///\param name - IN: Searched name -///\param lapl - IN: Link access property list -///\exception H5::LocationException -// Programmer Binh-Minh Ribler - Dec, 2016 +// Function: H5Location::exists +///\brief Checks if a link of a given name exists in a location +///\param name - IN: Searched name +///\param lapl - IN: Link access property list +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Dec, 2016 // Modification //-------------------------------------------------------------------------- bool H5Location::exists(const H5std_string& name, const LinkAccPropList& lapl) const @@ -114,156 +114,156 @@ bool H5Location::exists(const H5std_string& name, const LinkAccPropList& lapl) c } //-------------------------------------------------------------------------- -// Function: H5Location::flush -///\brief Flushes all buffers associated with a location to disk. -///\param scope - IN: Specifies the scope of the flushing action, -/// which can be either of these values: -/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file -/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file -///\exception H5::Exception +// Function: H5Location::flush +///\brief Flushes all buffers associated with a location to disk. +///\param scope - IN: Specifies the scope of the flushing action, +/// which can be either of these values: +/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file +/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file +///\exception H5::Exception ///\par Description -/// This location is used to identify the file to be flushed. -// Programmer Binh-Minh Ribler - 2012 +/// This location is used to identify the file to be flushed. +// Programmer Binh-Minh Ribler - 2012 // Modification -// Sep 2012 - BMR -// Moved from H5File/H5Object +// Sep 2012 - BMR +// Moved from H5File/H5Object //-------------------------------------------------------------------------- void H5Location::flush(H5F_scope_t scope) const { - herr_t ret_value = H5Fflush(getId(), scope); - if (ret_value < 0) - { - throw LocationException(inMemFunc("flush"), "H5Fflush failed"); - } + herr_t ret_value = H5Fflush(getId(), scope); + if( ret_value < 0 ) + { + throw LocationException(inMemFunc("flush"), "H5Fflush failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Location::getFileName -///\brief Gets the name of the file, in which this HDF5 object belongs. -///\return File name -///\exception H5::LocationException -// Programmer Binh-Minh Ribler - Jul, 2004 +// Function: H5Location::getFileName +///\brief Gets the name of the file, in which this HDF5 object belongs. +///\return File name +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- H5std_string H5Location::getFileName() const { - try { + try { return(p_get_file_name()); - } - catch (LocationException& E) { - throw FileIException(inMemFunc("getFileName"), E.getDetailMsg()); - } -} - -//-------------------------------------------------------------------------- -// Function: H5Location::setComment -///\brief Sets or resets the comment for an object specified by its name. -///\param name - IN: Name of the object -///\param comment - IN: New comment -///\exception H5::LocationException -///\par Description -/// If \a comment is an empty string or a null pointer, the comment -/// message is removed from the object. -/// Comments should be relatively short, null-terminated, ASCII -/// strings. They can be attached to any object that has an -/// object header, e.g., data sets, groups, named data types, -/// and data spaces, but not symbolic links. -// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) + } + catch (LocationException& E) { + throw FileIException(inMemFunc("getFileName"), E.getDetailMsg()); + } +} + +//-------------------------------------------------------------------------- +// Function: H5Location::setComment +///\brief Sets or resets the comment for an object specified by its name. +///\param name - IN: Name of the object +///\param comment - IN: New comment +///\exception H5::LocationException +///\par Description +/// If \a comment is an empty string or a null pointer, the comment +/// message is removed from the object. +/// Comments should be relatively short, null-terminated, ASCII +/// strings. They can be attached to any object that has an +/// object header, e.g., data sets, groups, named data types, +/// and data spaces, but not symbolic links. +// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) // Modification -// 2007: QAK modified to use H5O APIs; however the first parameter is -// no longer just file or group, this function should be moved -// to another class to accommodate attribute, dataset, and named -// datatype. - BMR +// 2007: QAK modified to use H5O APIs; however the first parameter is +// no longer just file or group, this function should be moved +// to another class to accommodate attribute, dataset, and named +// datatype. - BMR //-------------------------------------------------------------------------- void H5Location::setComment(const char* name, const char* comment) const { - herr_t ret_value = H5Oset_comment_by_name(getId(), name, comment, H5P_DEFAULT); - if (ret_value < 0) - throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed"); + herr_t ret_value = H5Oset_comment_by_name(getId(), name, comment, H5P_DEFAULT); + if( ret_value < 0 ) + throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::setComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name and \a comment. -// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) +// Function: H5Location::setComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name and \a comment. +// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) //-------------------------------------------------------------------------- void H5Location::setComment(const H5std_string& name, const H5std_string& comment) const { - setComment(name.c_str(), comment.c_str()); + setComment(name.c_str(), comment.c_str()); } //-------------------------------------------------------------------------- -// Function: H5Location::setComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it doesn't take -/// an object name. -// Programmer Binh-Minh Ribler - Sep 2013 +// Function: H5Location::setComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it doesn't take +/// an object name. +// Programmer Binh-Minh Ribler - Sep 2013 // Modification //-------------------------------------------------------------------------- void H5Location::setComment(const char* comment) const { - herr_t ret_value = H5Oset_comment_by_name(getId(), ".", comment, H5P_DEFAULT); - if (ret_value < 0) - throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed"); + herr_t ret_value = H5Oset_comment_by_name(getId(), ".", comment, H5P_DEFAULT); + if( ret_value < 0 ) + throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::setComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a comment. -// Programmer Binh-Minh Ribler - Sep 2013 +// Function: H5Location::setComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a comment. +// Programmer Binh-Minh Ribler - Sep 2013 //-------------------------------------------------------------------------- void H5Location::setComment(const H5std_string& comment) const { - setComment(comment.c_str()); + setComment(comment.c_str()); } //-------------------------------------------------------------------------- -// Function: H5Location::removeComment -///\brief Removes the comment from an object specified by its name. -///\param name - IN: Name of the object -///\exception H5::LocationException -// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013) -// 2007: QAK modified to use H5O APIs; however the first parameter is -// no longer just file or group, this function should be moved -// to another class to accommodate attribute, dataset, and named -// datatype. - BMR +// Function: H5Location::removeComment +///\brief Removes the comment from an object specified by its name. +///\param name - IN: Name of the object +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013) +// 2007: QAK modified to use H5O APIs; however the first parameter is +// no longer just file or group, this function should be moved +// to another class to accommodate attribute, dataset, and named +// datatype. - BMR //-------------------------------------------------------------------------- void H5Location::removeComment(const char* name) const { - herr_t ret_value = H5Oset_comment_by_name(getId(), name, NULL, H5P_DEFAULT); - if (ret_value < 0) - throw LocationException(inMemFunc("removeComment"), "H5Oset_comment_by_name failed"); + herr_t ret_value = H5Oset_comment_by_name(getId(), name, NULL, H5P_DEFAULT); + if( ret_value < 0 ) + throw LocationException(inMemFunc("removeComment"), "H5Oset_comment_by_name failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::removeComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013) +// Function: H5Location::removeComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013) //-------------------------------------------------------------------------- void H5Location::removeComment(const H5std_string& name) const { - removeComment (name.c_str()); + removeComment (name.c_str()); } //-------------------------------------------------------------------------- -// Function: H5Location::getComment -///\brief Retrieves the comment for this location, returning its length. -///\param name - IN: Name of the object -///\param buf_size - IN: Length of the comment to retrieve -///\param comment - OUT: Retrieved comment -///\return Actual length of the comment -///\exception H5::LocationException +// Function: H5Location::getComment +///\brief Retrieves the comment for this location, returning its length. +///\param name - IN: Name of the object +///\param buf_size - IN: Length of the comment to retrieve +///\param comment - OUT: Retrieved comment +///\return Actual length of the comment +///\exception H5::LocationException ///\par Description -/// This function retrieves \a buf_size characters of the comment -/// including the null terminator. Thus, if the actual length -/// of the comment is more than buf_size-1, the retrieved comment -/// will be truncated to accommodate the null terminator. -// Programmer Binh-Minh Ribler - Mar 2014 +/// This function retrieves \a buf_size characters of the comment +/// including the null terminator. Thus, if the actual length +/// of the comment is more than buf_size-1, the retrieved comment +/// will be truncated to accommodate the null terminator. +// Programmer Binh-Minh Ribler - Mar 2014 //-------------------------------------------------------------------------- ssize_t H5Location::getComment(const char* name, size_t buf_size, char* comment) const { @@ -274,27 +274,27 @@ ssize_t H5Location::getComment(const char* name, size_t buf_size, char* comment) // If H5Oget_comment_by_name returns a negative value, raise an exception if (comment_len < 0) - { + { throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed"); } // If the comment is longer than the provided buffer size, the C library // will not null terminate it if (static_cast(comment_len) >= buf_size) - comment[buf_size-1] = '\0'; + comment[buf_size-1] = '\0'; // Return the actual comment length, which might be different from buf_size return(comment_len); } //-------------------------------------------------------------------------- -// Function: H5Location::getComment -///\brief Returns the comment as \a string for this location, -/// returning its length. -///\param name - IN: Name of the object -///\param buf_size - IN: Length of the comment to retrieve, default to 0 -///\return Comment string -///\exception H5::LocationException -// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) +// Function: H5Location::getComment +///\brief Returns the comment as \a string for this location, +/// returning its length. +///\param name - IN: Name of the object +///\param buf_size - IN: Length of the comment to retrieve, default to 0 +///\return Comment string +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) //-------------------------------------------------------------------------- H5std_string H5Location::getComment(const char* name, size_t buf_size) const { @@ -307,36 +307,36 @@ H5std_string H5Location::getComment(const char* name, size_t buf_size) const // If H5Oget_comment_by_name returns a negative value, raise an exception if (comment_len < 0) - { + { throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed"); } // If comment exists, calls C routine again to get it else if (comment_len > 0) - { - size_t tmp_len = buf_size; - - // If buffer size is not provided, use comment length - if (tmp_len == 0) - tmp_len = comment_len; - - // Temporary buffer for char* comment - char* comment_C = new char[tmp_len+1]; - HDmemset(comment_C, 0, tmp_len+1); // clear buffer - - // Used overloaded function - ssize_t temp_len = getComment(name, tmp_len+1, comment_C); - if (temp_len < 0) - { - delete []comment_C; - throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed"); - } - - // Convert the C comment to return - comment = comment_C; - - // Clean up resource - delete []comment_C; + { + size_t tmp_len = buf_size; + + // If buffer size is not provided, use comment length + if (tmp_len == 0) + tmp_len = comment_len; + + // Temporary buffer for char* comment + char* comment_C = new char[tmp_len+1]; + HDmemset(comment_C, 0, tmp_len+1); // clear buffer + + // Used overloaded function + ssize_t temp_len = getComment(name, tmp_len+1, comment_C); + if (temp_len < 0) + { + delete []comment_C; + throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed"); + } + + // Convert the C comment to return + comment = comment_C; + + // Clean up resource + delete []comment_C; } // Return the string comment @@ -344,11 +344,11 @@ H5std_string H5Location::getComment(const char* name, size_t buf_size) const } //-------------------------------------------------------------------------- -// Function: H5Location::getComment -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) +// Function: H5Location::getComment +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013) //-------------------------------------------------------------------------- H5std_string H5Location::getComment(const H5std_string& name, size_t buf_size) const { @@ -357,112 +357,112 @@ H5std_string H5Location::getComment(const H5std_string& name, size_t buf_size) c #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::p_reference (protected) -// Purpose Creates a reference to an HDF5 object or a dataset region. +// Function: H5Location::p_reference (protected) +// Purpose Creates a reference to an HDF5 object or a dataset region. // Parameters -// name - IN: Name of the object to be referenced -// dataspace - IN: Dataspace with selection -// ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION -// Exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// name - IN: Name of the object to be referenced +// dataspace - IN: Dataspace with selection +// ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION +// Exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const { - herr_t ret_value = H5Rcreate(ref, getId(), name, ref_type, space_id); - if (ret_value < 0) - { - throw ReferenceException(inMemFunc("reference"), "H5Rcreate failed"); - } + herr_t ret_value = H5Rcreate(ref, getId(), name, ref_type, space_id); + if (ret_value < 0) + { + throw ReferenceException(inMemFunc("reference"), "H5Rcreate failed"); + } } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::reference -///\brief Creates a reference to an HDF5 object or a dataset region. -///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced -///\param dataspace - IN: Dataspace with selection -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference. -/// \li \c H5R_DATASET_REGION - Reference is a dataset region -/// reference. (default) -///\exception H5::ReferenceException -///\note This method is more suitable for a dataset region reference. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::reference +///\brief Creates a reference to an HDF5 object or a dataset region. +///\param ref - IN: Reference pointer +///\param name - IN: Name of the object to be referenced +///\param dataspace - IN: Dataspace with selection +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +/// reference. (default) +///\exception H5::ReferenceException +///\note This method is more suitable for a dataset region reference. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const char* name, const DataSpace& dataspace, H5R_type_t ref_type) const { - try { - p_reference(ref, name, dataspace.getId(), ref_type); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); - } -} - -//-------------------------------------------------------------------------- -// Function: H5Location::reference -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced -///\param dataspace - IN: Dataspace with selection -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference. -/// \li \c H5R_DATASET_REGION - Reference is a dataset region -/// reference. (default) -///\exception H5::ReferenceException -///\note This method is more suitable for a dataset region reference. -// Programmer Binh-Minh Ribler - May, 2004 + try { + p_reference(ref, name, dataspace.getId(), ref_type); + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); + } +} + +//-------------------------------------------------------------------------- +// Function: H5Location::reference +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +///\param ref - IN: Reference pointer +///\param name - IN: Name of the object to be referenced +///\param dataspace - IN: Dataspace with selection +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +/// reference. (default) +///\exception H5::ReferenceException +///\note This method is more suitable for a dataset region reference. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const H5std_string& name, const DataSpace& dataspace, H5R_type_t ref_type) const { - try { - p_reference(ref, name.c_str(), dataspace.getId(), ref_type); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); - } + try { + p_reference(ref, name.c_str(), dataspace.getId(), ref_type); + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: H5Location::reference -///\brief This is an overloaded function, provided for your convenience. -/// It differs from the above function in that it does not take -/// a DataSpace object and the reference type must be specified. -///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference (default) -/// \li \c H5R_DATASET_REGION - Reference is a dataset region -///\exception H5::ReferenceException -///\note This method is more suitable for an object reference. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::reference +///\brief This is an overloaded function, provided for your convenience. +/// It differs from the above function in that it does not take +/// a DataSpace object and the reference type must be specified. +///\param ref - IN: Reference pointer +///\param name - IN: Name of the object to be referenced +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference (default) +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +///\exception H5::ReferenceException +///\note This method is more suitable for an object reference. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const char* name, H5R_type_t ref_type) const { - try { - p_reference(ref, name, -1, ref_type); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); - } + try { + p_reference(ref, name, -1, ref_type); + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("reference"), E.getDetailMsg()); + } } //-------------------------------------------------------------------------- -// Function: H5Location::reference -///\brief This is an overloaded function, provided for your convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for the object's name. -///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced - \c H5std_string -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference (default) -/// \li \c H5R_DATASET_REGION - Reference is a dataset region -///\note This method is more suitable for an object reference. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::reference +///\brief This is an overloaded function, provided for your convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for the object's name. +///\param ref - IN: Reference pointer +///\param name - IN: Name of the object to be referenced - \c H5std_string +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference (default) +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +///\note This method is more suitable for an object reference. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Location::reference(void* ref, const H5std_string& name, H5R_type_t ref_type) const { @@ -471,69 +471,69 @@ void H5Location::reference(void* ref, const H5std_string& name, H5R_type_t ref_t #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::p_dereference (protected) -// Purpose Dereference a ref into an hdf5 object. +// Function: H5Location::p_dereference (protected) +// Purpose Dereference a ref into an hdf5 object. // Parameters -// loc_id - IN: An hdf5 identifier specifying the location of the -// referenced object -// ref - IN: Reference pointer -// ref_type - IN: Reference type -// plist - IN: Property list - default to PropList::DEFAULT -// from_func - IN: Name of the calling function -// Exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// loc_id - IN: An hdf5 identifier specifying the location of the +// referenced object +// ref - IN: Reference pointer +// ref_type - IN: Reference type +// plist - IN: Property list - default to PropList::DEFAULT +// from_func - IN: Name of the calling function +// Exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// May 2008 - BMR -// Moved from IdComponent. +// May 2008 - BMR +// Moved from IdComponent. //-------------------------------------------------------------------------- hid_t H5Location::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const PropList& plist, const char* from_func) { - hid_t plist_id; - if (p_valid_id(plist.getId())) - plist_id = plist.getId(); - else - plist_id = H5P_DEFAULT; + hid_t plist_id; + if (p_valid_id(plist.getId())) + plist_id = plist.getId(); + else + plist_id = H5P_DEFAULT; - hid_t temp_id = H5Rdereference2(loc_id, plist_id, ref_type, ref); - if (temp_id < 0) - { - throw ReferenceException(inMemFunc(from_func), "H5Rdereference failed"); - } + hid_t temp_id = H5Rdereference2(loc_id, plist_id, ref_type, ref); + if (temp_id < 0) + { + throw ReferenceException(inMemFunc(from_func), "H5Rdereference failed"); + } - return(temp_id); + return(temp_id); } #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::dereference -///\brief Dereferences a reference into an HDF5 object, given an HDF5 object. -///\param loc - IN: Location of the referenced object -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// Function: H5Location::dereference +///\brief Dereferences a reference into an HDF5 object, given an HDF5 object. +///\param loc - IN: Location of the referenced object +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// May, 2008 -// Corrected missing parameters. - BMR +// May, 2008 +// Corrected missing parameters. - BMR //-------------------------------------------------------------------------- void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) { - p_setId(p_dereference(loc.getId(), ref, ref_type, plist, "dereference")); + p_setId(p_dereference(loc.getId(), ref, ref_type, plist, "dereference")); } //-------------------------------------------------------------------------- -// Function: H5Location::dereference -///\brief Dereferences a reference into an HDF5 object, given an attribute. -///\param attr - IN: Attribute specifying the location of the referenced object -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - Oct, 2006 +// Function: H5Location::dereference +///\brief Dereferences a reference into an HDF5 object, given an attribute. +///\param attr - IN: Attribute specifying the location of the referenced object +///\param ref - IN: Reference pointer +///\param ref_type - IN: Reference type +///\param plist - IN: Property list - default to PropList::DEFAULT +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - Oct, 2006 // Modification -// May, 2008 -// Corrected missing parameters. - BMR +// May, 2008 +// Corrected missing parameters. - BMR //-------------------------------------------------------------------------- /* void H5Location::dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) { @@ -543,152 +543,153 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t #ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- -// Function: H5Location::getObjType -///\brief Retrieves the type of object that an object reference points to. -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference. -/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. -///\param ref - IN: Reference to query -///\return An object type, which can be one of the following: -/// \li \c H5G_UNKNOWN - A failure occurs. (-1) -/// \li \c H5G_GROUP - Object is a group. -/// \li \c H5G_DATASET - Object is a dataset. -/// \li \c H5G_TYPE Object - is a named datatype -/// \li \c H5G_LINK - Object is a symbolic link. -/// \li \c H5G_UDLINK - Object is a user-defined link. -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::getObjType +///\brief Retrieves the type of object that an object reference points to. +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. +///\param ref - IN: Reference to query +///\return An object type, which can be one of the following: +/// \li \c H5G_UNKNOWN - A failure occurs. (-1) +/// \li \c H5G_GROUP - Object is a group. +/// \li \c H5G_DATASET - Object is a dataset. +/// \li \c H5G_TYPE Object - is a named datatype +/// \li \c H5G_LINK - Object is a symbolic link. +/// \li \c H5G_UDLINK - Object is a user-defined link. +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 // Modification -// Sep 2012: Moved up from H5File, Group, DataSet, and DataType +// Sep 2012: Moved up from H5File, Group, DataSet, and DataType //-------------------------------------------------------------------------- H5G_obj_t H5Location::getObjType(void *ref, H5R_type_t ref_type) const { - try { - return(p_get_obj_type(ref, ref_type)); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("getObjType"), E.getDetailMsg()); - } + try { + return(p_get_obj_type(ref, ref_type)); + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("getObjType"), E.getDetailMsg()); + } } #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::p_get_obj_type (protected) -// Purpose Retrieves the type of object that an object reference points to. +// Function: H5Location::p_get_obj_type (protected) +// Purpose Retrieves the type of object that an object reference points to. // Parameters -// ref - IN: Reference to query -// ref_type - IN: Type of reference to query -// Return An object type, which can be one of the following: -// H5G_UNKNOWN \tFailure occurs (-1) -// H5G_GROUP \tObject is a group. -// H5G_DATASET \tObject is a dataset. -// H5G_TYPE Object \tis a named datatype. -// H5G_LINK \tObject is a symbolic link. -// H5G_UDLINK \tObject is a user-defined link. -// Exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// ref - IN: Reference to query +// ref_type - IN: Type of reference to query +// Return An object type, which can be one of the following: +// H5G_UNKNOWN \tFailure occurs (-1) +// H5G_GROUP \tObject is a group. +// H5G_DATASET \tObject is a dataset. +// H5G_TYPE Object \tis a named datatype. +// H5G_LINK \tObject is a symbolic link. +// H5G_UDLINK \tObject is a user-defined link. +// Exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- H5G_obj_t H5Location::p_get_obj_type(void *ref, H5R_type_t ref_type) const { H5G_obj_t obj_type = H5Rget_obj_type1(getId(), ref_type, ref); + if (obj_type == H5G_UNKNOWN) - { - throw ReferenceException(inMemFunc("getObjType"), "H5Rget_obj_type1 failed"); - } + { + throw ReferenceException(inMemFunc("getObjType"), "H5Rget_obj_type1 failed"); + } return(obj_type); } #endif // DOXYGEN_SHOULD_SKIP_THIS #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- -// Function: H5Location::getRefObjType -///\brief Retrieves the type of object that an object reference points to. -///\param ref - IN: Reference to query -///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT - Reference is an object reference. -/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. -///\return An object type, which can be one of the following: -/// \li \c H5O_TYPE_UNKNOWN - Unknown object type (-1) -/// \li \c H5O_TYPE_GROUP - Object is a group -/// \li \c H5O_TYPE_DATASET - Object is a dataset -/// \li \c H5O_TYPE_NAMED_DATATYPE - Object is a named datatype -/// \li \c H5O_TYPE_NTYPES - Number of different object types -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::getRefObjType +///\brief Retrieves the type of object that an object reference points to. +///\param ref - IN: Reference to query +///\param ref_type - IN: Type of reference to query, valid values are: +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. +///\return An object type, which can be one of the following: +/// \li \c H5O_TYPE_UNKNOWN - Unknown object type (-1) +/// \li \c H5O_TYPE_GROUP - Object is a group +/// \li \c H5O_TYPE_DATASET - Object is a dataset +/// \li \c H5O_TYPE_NAMED_DATATYPE - Object is a named datatype +/// \li \c H5O_TYPE_NTYPES - Number of different object types +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_type) const { - try { + try { return(p_get_ref_obj_type(ref, ref_type)); - } - catch (ReferenceException& E) { - throw ReferenceException(inMemFunc("getRefObjType"), E.getDetailMsg()); - } + } + catch (ReferenceException& E) { + throw ReferenceException(inMemFunc("getRefObjType"), E.getDetailMsg()); + } } #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::p_get_ref_obj_type (protected) -// Purpose Retrieves the type of object that an object reference points to. +// Function: H5Location::p_get_ref_obj_type (protected) +// Purpose Retrieves the type of object that an object reference points to. // Parameters -// ref - IN: Reference to query -// ref_type - IN: Type of reference to query -// Return An object type, which can be one of the following: -// H5O_TYPE_UNKNOWN - Unknown object type (-1) -// H5O_TYPE_GROUP - Object is a group -// H5O_TYPE_DATASET - Object is a dataset -// H5O_TYPE_NAMED_DATATYPE - Object is a named datatype -// H5O_TYPE_NTYPES - Number of object types -// Exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// ref - IN: Reference to query +// ref_type - IN: Type of reference to query +// Return An object type, which can be one of the following: +// H5O_TYPE_UNKNOWN - Unknown object type (-1) +// H5O_TYPE_GROUP - Object is a group +// H5O_TYPE_DATASET - Object is a dataset +// H5O_TYPE_NAMED_DATATYPE - Object is a named datatype +// H5O_TYPE_NTYPES - Number of object types +// Exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- H5O_type_t H5Location::p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const { - H5O_type_t obj_type = H5O_TYPE_UNKNOWN; - herr_t ret_value = H5Rget_obj_type2(getId(), ref_type, ref, &obj_type); - if (ret_value < 0) - { - throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 failed"); - } - if (obj_type == H5O_TYPE_UNKNOWN || obj_type >= H5O_TYPE_NTYPES) - { - throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 returned invalid type"); - } - return(obj_type); + H5O_type_t obj_type = H5O_TYPE_UNKNOWN; + herr_t ret_value = H5Rget_obj_type2(getId(), ref_type, ref, &obj_type); + if (ret_value < 0) + { + throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 failed"); + } + if (obj_type == H5O_TYPE_UNKNOWN || obj_type >= H5O_TYPE_NTYPES) + { + throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 returned invalid type"); + } + return(obj_type); } //-------------------------------------------------------------------------- -// Function: H5Location::getRegion -///\brief Retrieves a dataspace with the region pointed to selected. -///\param ref - IN: Reference to get region of -///\param ref_type - IN: Type of reference to get region of - default -// to H5R_DATASET_REGION -///\return DataSpace object -///\exception H5::ReferenceException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: H5Location::getRegion +///\brief Retrieves a dataspace with the region pointed to selected. +///\param ref - IN: Reference to get region of +///\param ref_type - IN: Type of reference to get region of - default +// to H5R_DATASET_REGION +///\return DataSpace object +///\exception H5::ReferenceException +// Programmer Binh-Minh Ribler - May, 2004 // Modification -// Mar 29, 2015 -// Used friend function to set id for DataSpace instead of the -// existing id constructor or the setId method to avoid incrementing -// ref count, as a work-around for a problem described in the JIRA -// issue HDFFV-7947. -BMR +// Mar 29, 2015 +// Used friend function to set id for DataSpace instead of the +// existing id constructor or the setId method to avoid incrementing +// ref count, as a work-around for a problem described in the JIRA +// issue HDFFV-7947. -BMR //-------------------------------------------------------------------------- DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const { - hid_t space_id = H5Rget_region(getId(), ref_type, ref); - if (space_id < 0) - { - throw ReferenceException(inMemFunc("getRegion"), "H5Rget_region failed"); - } - try { - DataSpace dataspace; - f_DataSpace_setId(&dataspace, space_id); - return(dataspace); - } - catch (DataSpaceIException& E) { - throw ReferenceException(inMemFunc("getRegion"), E.getDetailMsg()); - } + hid_t space_id = H5Rget_region(getId(), ref_type, ref); + if (space_id < 0) + { + throw ReferenceException(inMemFunc("getRegion"), "H5Rget_region failed"); + } + try { + DataSpace dataspace; + f_DataSpace_setId(&dataspace, space_id); + return(dataspace); + } + catch (DataSpaceIException& E) { + throw ReferenceException(inMemFunc("getRegion"), E.getDetailMsg()); + } } @@ -704,11 +705,11 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const // to call the right getId() - although, as the structure of the // library at this time, getId() is basically the IdComponent::getId() // ***Updated: after the classes are rearranged (HDFFV-9920), functions -// in CommonFG are moved to Group, and they can call getId() -// instead of getLocId(). getLocId() is kept for backward -// compatibility on user applications. Aug 18, 2016 -BMR +// in CommonFG are moved to Group, and they can call getId() +// instead of getLocId(). getLocId() is kept for backward +// compatibility on user applications. Aug 18, 2016 -BMR // ***Updated: Moving to Group was a mistake, now to H5Location -// Aug 24, 2016 -BMR +// Aug 24, 2016 -BMR // - when a failure returned by the C API, the functions will call // throwException, which is a pure virtual function and is implemented // by H5File to throw a FileIException and by Group to throw a @@ -721,29 +722,29 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const // is kept in those methods as well. Sep 17, 2016 -BMR //-------------------------------------------------------------------------- -// Function: H5Location::createGroup -///\brief Creates a new group at this location which can be a file -/// or another group. -///\param name - IN: Name of the group to create -///\param size_hint - IN: Indicates the number of bytes to reserve for -/// the names that will appear in the group -///\return Group instance -///\exception H5::FileIException or H5::GroupIException +// Function: H5Location::createGroup +///\brief Creates a new group at this location which can be a file +/// or another group. +///\param name - IN: Name of the group to create +///\param size_hint - IN: Indicates the number of bytes to reserve for +/// the names that will appear in the group +///\return Group instance +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// The optional \a size_hint specifies how much file space to -/// reserve for storing the names that will appear in this new -/// group. If a non-positive value is provided for the \a size_hint -/// then a default size is chosen. -// Programmer Binh-Minh Ribler - 2000 +/// The optional \a size_hint specifies how much file space to +/// reserve for storing the names that will appear in this new +/// group. If a non-positive value is provided for the \a size_hint +/// then a default size is chosen. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group H5Location::createGroup(const char* name, size_t size_hint) const +Group H5Location::createGroup( const char* name, size_t size_hint ) const { // Group creation property list for size hint hid_t gcpl_id = 0; // Set the local heap size hint if (size_hint > 0) - { + { // If the creation of the property list failed, throw an exception if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) throwException("createGroup", "H5Pcreate failed"); @@ -754,351 +755,351 @@ Group H5Location::createGroup(const char* name, size_t size_hint) const } } - // Call C routine H5Gcreate2 to create the named group, giving the - // location id which can be a file id or a group id - hid_t group_id = H5Gcreate2(getId(), name, H5P_DEFAULT, gcpl_id, H5P_DEFAULT); + // Call C routine H5Gcreate2 to create the named group, giving the + // location id which can be a file id or a group id + hid_t group_id = H5Gcreate2(getId(), name, H5P_DEFAULT, gcpl_id, H5P_DEFAULT ); - // Close the group creation property list, if necessary - if(gcpl_id > 0) + // Close the group creation property list, if necessary + if(gcpl_id > 0) H5Pclose(gcpl_id); - // If the creation of the group failed, throw an exception - if (group_id < 0) - throwException("createGroup", "H5Gcreate2 failed"); + // If the creation of the group failed, throw an exception + if( group_id < 0 ) + throwException("createGroup", "H5Gcreate2 failed"); - // No failure, create and return the Group object - Group group; - //group.p_setId(group_id); - H5Location *ptr = &group; - ptr->p_setId(group_id); - return(group); + // No failure, create and return the Group object + Group group; + //group.p_setId(group_id); + H5Location *ptr = &group; + ptr->p_setId(group_id); + return( group ); } //-------------------------------------------------------------------------- -// Function: H5Location::createGroup -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::createGroup +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group H5Location::createGroup(const H5std_string& name, size_t size_hint) const +Group H5Location::createGroup( const H5std_string& name, size_t size_hint ) const { - return(createGroup( name.c_str(), size_hint)); + return( createGroup( name.c_str(), size_hint )); } //-------------------------------------------------------------------------- -// Function: H5Location::openGroup -///\brief Opens an existing group in a location which can be a file -/// or another group. -///\param name - IN: Name of the group to open -///\return Group instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::openGroup +///\brief Opens an existing group in a location which can be a file +/// or another group. +///\param name - IN: Name of the group to open +///\return Group instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group H5Location::openGroup(const char* name) const +Group H5Location::openGroup( const char* name ) const { - // Call C routine H5Gopen2 to open the named group, giving the - // location id which can be a file id or a group id - hid_t group_id = H5Gopen2(getId(), name, H5P_DEFAULT); + // Call C routine H5Gopen2 to open the named group, giving the + // location id which can be a file id or a group id + hid_t group_id = H5Gopen2(getId(), name, H5P_DEFAULT ); - // If the opening of the group failed, throw an exception - if (group_id < 0) - throwException("openGroup", "H5Gopen2 failed"); + // If the opening of the group failed, throw an exception + if( group_id < 0 ) + throwException("openGroup", "H5Gopen2 failed"); - // No failure, create and return the Group object - Group group; - //group.p_setId(group_id); - H5Location *ptr = &group; - ptr->p_setId(group_id); - return(group); + // No failure, create and return the Group object + Group group; + //group.p_setId(group_id); + H5Location *ptr = &group; + ptr->p_setId(group_id); + return( group ); } //-------------------------------------------------------------------------- -// Function: H5Location::openGroup -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::openGroup +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Group H5Location::openGroup(const H5std_string& name) const +Group H5Location::openGroup( const H5std_string& name ) const { - return(openGroup( name.c_str())); + return( openGroup( name.c_str() )); } //-------------------------------------------------------------------------- -// Function: H5Location::createDataSet -///\brief Creates a new dataset at this location. -///\param name - IN: Name of the dataset to create -///\param data_type - IN: Datatype of the dataset -///\param data_space - IN: Dataspace for the dataset -///\param create_plist - IN: Creation properly list for the dataset -///\return DataSet instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::createDataSet +///\brief Creates a new dataset at this location. +///\param name - IN: Name of the dataset to create +///\param data_type - IN: Datatype of the dataset +///\param data_space - IN: Dataspace for the dataset +///\param create_plist - IN: Creation properly list for the dataset +///\return DataSet instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet H5Location::createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist) const +DataSet H5Location::createDataSet( const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const { // Obtain identifiers for C API - hid_t type_id = data_type.getId(); - hid_t space_id = data_space.getId(); - hid_t create_plist_id = create_plist.getId(); + hid_t type_id = data_type.getId(); + hid_t space_id = data_space.getId(); + hid_t create_plist_id = create_plist.getId(); - // Call C routine H5Dcreate2 to create the named dataset - hid_t dataset_id = H5Dcreate2(getId(), name, type_id, space_id, H5P_DEFAULT, create_plist_id, H5P_DEFAULT); + // Call C routine H5Dcreate2 to create the named dataset + hid_t dataset_id = H5Dcreate2(getId(), name, type_id, space_id, H5P_DEFAULT, create_plist_id, H5P_DEFAULT ); - // If the creation of the dataset failed, throw an exception - if (dataset_id < 0) - throwException("createDataSet", "H5Dcreate2 failed"); + // If the creation of the dataset failed, throw an exception + if( dataset_id < 0 ) + throwException("createDataSet", "H5Dcreate2 failed"); - // No failure, create and return the DataSet object - DataSet dataset; - f_DataSet_setId(&dataset, dataset_id); - return(dataset); + // No failure, create and return the DataSet object + DataSet dataset; + f_DataSet_setId(&dataset, dataset_id); + return( dataset ); } //-------------------------------------------------------------------------- -// Function: H5Location::createDataSet -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::createDataSet +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet H5Location::createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist) const +DataSet H5Location::createDataSet( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const { - return(createDataSet( name.c_str(), data_type, data_space, create_plist)); + return( createDataSet( name.c_str(), data_type, data_space, create_plist )); } //-------------------------------------------------------------------------- -// Function: H5Location::openDataSet -///\brief Opens an existing dataset at this location. -///\param name - IN: Name of the dataset to open -///\return DataSet instance -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::openDataSet +///\brief Opens an existing dataset at this location. +///\param name - IN: Name of the dataset to open +///\return DataSet instance +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet H5Location::openDataSet(const char* name) const +DataSet H5Location::openDataSet( const char* name ) const { - // Call C function H5Dopen2 to open the specified dataset, giving - // the location id and the dataset's name - hid_t dataset_id = H5Dopen2(getId(), name, H5P_DEFAULT); + // Call C function H5Dopen2 to open the specified dataset, giving + // the location id and the dataset's name + hid_t dataset_id = H5Dopen2(getId(), name, H5P_DEFAULT ); - // If the dataset's opening failed, throw an exception - if(dataset_id < 0) - throwException("openDataSet", "H5Dopen2 failed"); + // If the dataset's opening failed, throw an exception + if(dataset_id < 0) + throwException("openDataSet", "H5Dopen2 failed"); - // No failure, create and return the DataSet object - DataSet dataset; - f_DataSet_setId(&dataset, dataset_id); - return(dataset); + // No failure, create and return the DataSet object + DataSet dataset; + f_DataSet_setId(&dataset, dataset_id); + return( dataset ); } //-------------------------------------------------------------------------- -// Function: H5Location::openDataSet -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::openDataSet +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataSet H5Location::openDataSet(const H5std_string& name) const +DataSet H5Location::openDataSet( const H5std_string& name ) const { - return(openDataSet( name.c_str())); + return( openDataSet( name.c_str() )); } //-------------------------------------------------------------------------- -// Function: H5Location::link -///\brief Creates a link of the specified type from \a new_name to -/// \a curr_name. -///\param link_type - IN: Link type; possible values are -/// \li \c H5G_LINK_HARD -/// \li \c H5G_LINK_SOFT -///\param curr_name - IN: Name of the existing object if link is a hard -/// link; can be anything for the soft link -///\param new_name - IN: New name for the object -///\exception H5::FileIException or H5::GroupIException +// Function: H5Location::link +///\brief Creates a link of the specified type from \a new_name to +/// \a curr_name. +///\param link_type - IN: Link type; possible values are +/// \li \c H5G_LINK_HARD +/// \li \c H5G_LINK_SOFT +///\param curr_name - IN: Name of the existing object if link is a hard +/// link; can be anything for the soft link +///\param new_name - IN: New name for the object +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// Note that both names are interpreted relative to the -/// specified location. -/// For information on creating hard link and soft link, please -/// refer to the C layer Reference Manual at: +/// Note that both names are interpreted relative to the +/// specified location. +/// For information on creating hard link and soft link, please +/// refer to the C layer Reference Manual at: /// http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateHard and /// http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateSoft -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Modification -// 2007: QAK modified to use H5L APIs - BMR +// 2007: QAK modified to use H5L APIs - BMR //-------------------------------------------------------------------------- -void H5Location::link(H5L_type_t link_type, const char* curr_name, const char* new_name) const +void H5Location::link( H5L_type_t link_type, const char* curr_name, const char* new_name ) const { herr_t ret_value = -1; switch(link_type) { case H5L_TYPE_HARD: - ret_value = H5Lcreate_hard(getId(), curr_name, H5L_SAME_LOC, new_name, H5P_DEFAULT, H5P_DEFAULT); + ret_value = H5Lcreate_hard(getId(), curr_name, H5L_SAME_LOC, new_name, H5P_DEFAULT, H5P_DEFAULT ); break; case H5L_TYPE_SOFT: - ret_value = H5Lcreate_soft(curr_name,getId(), new_name, H5P_DEFAULT, H5P_DEFAULT); + ret_value = H5Lcreate_soft( curr_name,getId(), new_name, H5P_DEFAULT, H5P_DEFAULT ); break; - case H5L_TYPE_ERROR: - case H5L_TYPE_EXTERNAL: - case H5L_TYPE_MAX: + case H5L_TYPE_ERROR: + case H5L_TYPE_EXTERNAL: + case H5L_TYPE_MAX: default: throwException("link", "unknown link type"); break; } /* end switch */ - if (ret_value < 0) - throwException("link", "creating link failed"); + if( ret_value < 0 ) + throwException("link", "creating link failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::link -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a curr_name and \a new_name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::link +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a curr_name and \a new_name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const +void H5Location::link( H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name ) const { - link(link_type, curr_name.c_str(), new_name.c_str()); + link( link_type, curr_name.c_str(), new_name.c_str() ); } //-------------------------------------------------------------------------- -// Function: H5Location::unlink -///\brief Removes the specified name at this location. -///\param name - IN: Name of the object to be removed -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::unlink +///\brief Removes the specified name at this location. +///\param name - IN: Name of the object to be removed +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// 2007: QAK modified to use H5L APIs - BMR +// 2007: QAK modified to use H5L APIs - BMR //-------------------------------------------------------------------------- -void H5Location::unlink(const char* name) const +void H5Location::unlink( const char* name ) const { - herr_t ret_value = H5Ldelete(getId(), name, H5P_DEFAULT); - if (ret_value < 0) - throwException("unlink", "H5Ldelete failed"); + herr_t ret_value = H5Ldelete(getId(), name, H5P_DEFAULT ); + if( ret_value < 0 ) + throwException("unlink", "H5Ldelete failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::unlink -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::unlink +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::unlink(const H5std_string& name) const +void H5Location::unlink( const H5std_string& name ) const { - unlink(name.c_str()); + unlink( name.c_str() ); } //-------------------------------------------------------------------------- -// Function: H5Location::move -///\brief Renames an object at this location. -///\param src - IN: Object's original name -///\param dst - IN: Object's new name -///\exception H5::FileIException or H5::GroupIException +// Function: H5Location::move +///\brief Renames an object at this location. +///\param src - IN: Object's original name +///\param dst - IN: Object's new name +///\exception H5::FileIException or H5::GroupIException ///\note -/// Exercise care in moving groups as it is possible to render -/// data in a file inaccessible with H5Location::move. Please refer -/// to the Group Interface in the HDF5 User's Guide for details at: +/// Exercise care in moving groups as it is possible to render +/// data in a file inaccessible with H5Location::move. Please refer +/// to the Group Interface in the HDF5 User's Guide for details at: /// https://www.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FGroups%2FHDF5_Groups.htm -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 // Modification -// 2007: QAK modified to use H5L APIs - BMR +// 2007: QAK modified to use H5L APIs - BMR //-------------------------------------------------------------------------- -void H5Location::move(const char* src, const char* dst) const +void H5Location::move( const char* src, const char* dst ) const { - herr_t ret_value = H5Lmove(getId(), src, H5L_SAME_LOC, dst, H5P_DEFAULT, H5P_DEFAULT); - if (ret_value < 0) - throwException("move", "H5Lmove failed"); + herr_t ret_value = H5Lmove(getId(), src, H5L_SAME_LOC, dst, H5P_DEFAULT, H5P_DEFAULT ); + if( ret_value < 0 ) + throwException("move", "H5Lmove failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::move -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a src and \a dst. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::move +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a src and \a dst. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::move(const H5std_string& src, const H5std_string& dst) const +void H5Location::move( const H5std_string& src, const H5std_string& dst ) const { - move(src.c_str(), dst.c_str()); + move( src.c_str(), dst.c_str() ); } #ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- -// Function: H5Location::getObjinfo -///\brief Returns information about an object. -///\param name - IN: Name of the object -///\param follow_link - IN: Link flag -///\param statbuf - OUT: Buffer to return information about the object -///\exception H5::FileIException or H5::GroupIException +// Function: H5Location::getObjinfo +///\brief Returns information about an object. +///\param name - IN: Name of the object +///\param follow_link - IN: Link flag +///\param statbuf - OUT: Buffer to return information about the object +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// For more information, please refer to the C layer Reference -/// Manual at: +/// For more information, please refer to the C layer Reference +/// Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5G.html#Group-GetObjinfo -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const +void H5Location::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& statbuf ) const { - herr_t ret_value = H5Gget_objinfo(getId(), name, follow_link, &statbuf); - if (ret_value < 0) - throwException("getObjinfo", "H5Gget_objinfo failed"); + herr_t ret_value = H5Gget_objinfo(getId(), name, follow_link, &statbuf ); + if( ret_value < 0 ) + throwException("getObjinfo", "H5Gget_objinfo failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjinfo -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::getObjinfo +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const +void H5Location::getObjinfo( const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf ) const { - getObjinfo(name.c_str(), follow_link, statbuf); + getObjinfo( name.c_str(), follow_link, statbuf ); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjinfo -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above functions in that it doesn't have -/// the paramemter \a follow_link. -// Programmer Binh-Minh Ribler - Nov, 2005 +// Function: H5Location::getObjinfo +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above functions in that it doesn't have +/// the paramemter \a follow_link. +// Programmer Binh-Minh Ribler - Nov, 2005 // Note: need to modify to use H5Oget_info and H5Lget_info - BMR //-------------------------------------------------------------------------- -void H5Location::getObjinfo(const char* name, H5G_stat_t& statbuf) const +void H5Location::getObjinfo( const char* name, H5G_stat_t& statbuf ) const { - herr_t ret_value = H5Gget_objinfo(getId(), name, 0, &statbuf); - if (ret_value < 0) - throwException("getObjinfo", "H5Gget_objinfo failed"); + herr_t ret_value = H5Gget_objinfo(getId(), name, 0, &statbuf ); + if( ret_value < 0 ) + throwException("getObjinfo", "H5Gget_objinfo failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjinfo -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - Nov, 2005 +// Function: H5Location::getObjinfo +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - Nov, 2005 //-------------------------------------------------------------------------- -void H5Location::getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const +void H5Location::getObjinfo( const H5std_string& name, H5G_stat_t& statbuf ) const { - getObjinfo(name.c_str(), statbuf); + getObjinfo( name.c_str(), statbuf ); } #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- -// Function: H5Location::getLinkval -///\brief Returns the name of the object that the symbolic link points to. -///\param name - IN: Symbolic link to the object -///\param size - IN: Maximum number of characters of value to be returned -///\return Name of the object -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::getLinkval +///\brief Returns the name of the object that the symbolic link points to. +///\param name - IN: Symbolic link to the object +///\param size - IN: Maximum number of characters of value to be returned +///\return Name of the object +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string H5Location::getLinkval(const char* name, size_t size) const +H5std_string H5Location::getLinkval( const char* name, size_t size ) const { H5L_info_t linkinfo; - char *value_C; // value in C string + char *value_C; // value in C string size_t val_size = size; H5std_string value = ""; herr_t ret_value; @@ -1106,81 +1107,81 @@ H5std_string H5Location::getLinkval(const char* name, size_t size) const // if user doesn't provide buffer size, determine it if (size == 0) { - ret_value = H5Lget_info(getId(), name, &linkinfo, H5P_DEFAULT); - if (ret_value < 0) - throwException("getLinkval", "H5Lget_info to find buffer size failed"); + ret_value = H5Lget_info(getId(), name, &linkinfo, H5P_DEFAULT); + if( ret_value < 0 ) + throwException("getLinkval", "H5Lget_info to find buffer size failed"); - val_size = linkinfo.u.val_size; + val_size = linkinfo.u.val_size; } // if link has value, retrieve the value, otherwise, return null string if (val_size > 0) { - value_C = new char[val_size+1]; // temporary C-string for C API - HDmemset(value_C, 0, val_size+1); // clear buffer - - ret_value = H5Lget_val(getId(), name, value_C, val_size, H5P_DEFAULT); - if (ret_value < 0) - { - delete []value_C; - throwException("getLinkval", "H5Lget_val failed"); - } - - value = H5std_string(value_C); - delete []value_C; + value_C = new char[val_size+1]; // temporary C-string for C API + HDmemset(value_C, 0, val_size+1); // clear buffer + + ret_value = H5Lget_val(getId(), name, value_C, val_size, H5P_DEFAULT); + if( ret_value < 0 ) + { + delete []value_C; + throwException("getLinkval", "H5Lget_val failed"); + } + + value = H5std_string(value_C); + delete []value_C; } return(value); } //-------------------------------------------------------------------------- -// Function: H5Location::getLinkval -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::getLinkval +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5std_string H5Location::getLinkval(const H5std_string& name, size_t size) const +H5std_string H5Location::getLinkval( const H5std_string& name, size_t size ) const { - return(getLinkval( name.c_str(), size)); + return( getLinkval( name.c_str(), size )); } //-------------------------------------------------------------------------- -// Function: H5Location::mount -///\brief Mounts the file \a child onto this group. -///\param name - IN: Name of the group -///\param child - IN: File to mount -///\param plist - IN: Property list to use -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2014 (original 2000) +// Function: H5Location::mount +///\brief Mounts the file \a child onto this group. +///\param name - IN: Name of the group +///\param child - IN: File to mount +///\param plist - IN: Property list to use +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2014 (original 2000) //-------------------------------------------------------------------------- -void H5Location::mount(const char* name, const H5File& child, const PropList& plist) const +void H5Location::mount(const char* name, const H5File& child, const PropList& plist ) const { - // Obtain identifiers for C API - hid_t plist_id = plist.getId(); - hid_t child_id = child.getId(); + // Obtain identifiers for C API + hid_t plist_id = plist.getId(); + hid_t child_id = child.getId(); - // Call C routine H5Fmount to do the mouting - herr_t ret_value = H5Fmount(getId(), name, child_id, plist_id); + // Call C routine H5Fmount to do the mouting + herr_t ret_value = H5Fmount(getId(), name, child_id, plist_id ); - // Raise exception if H5Fmount returns negative value - if (ret_value < 0) - throwException("mount", "H5Fmount failed"); + // Raise exception if H5Fmount returns negative value + if( ret_value < 0 ) + throwException("mount", "H5Fmount failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::mount -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Param name - IN: Name of the group -// Param child - IN: File to mount -// Param plist - IN: Property list to use -// Exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::mount +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Param name - IN: Name of the group +// Param child - IN: File to mount +// Param plist - IN: Property list to use +// Exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void H5Location::mount(const char* name, H5File& child, PropList& plist) const //{ @@ -1188,26 +1189,26 @@ void H5Location::mount(const char* name, const H5File& child, const PropList& pl //} //-------------------------------------------------------------------------- -// Function: H5Location::mount -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::mount +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Location::mount(const H5std_string& name, const H5File& child, const PropList& plist) const { - mount(name.c_str(), child, plist); + mount(name.c_str(), child, plist); } //-------------------------------------------------------------------------- -// Function: H5Location::mount -// Purpose This is an overloaded member function, kept for backward -// compatibility. It differs from the above function in that it -// misses const's. This wrapper will be removed in future release. -// Programmer Binh-Minh Ribler - 2014 +// Function: H5Location::mount +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const's. This wrapper will be removed in future release. +// Programmer Binh-Minh Ribler - 2014 // Modification -// Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 -// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- //void H5Location::mount(const H5std_string& name, H5File& child, PropList& plist) const //{ @@ -1215,109 +1216,109 @@ void H5Location::mount(const H5std_string& name, const H5File& child, const Prop //} //-------------------------------------------------------------------------- -// Function: H5Location::unmount -///\brief Unmounts the specified file. -///\param name - IN: Name of the file to unmount -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::unmount +///\brief Unmounts the specified file. +///\param name - IN: Name of the file to unmount +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::unmount(const char* name) const +void H5Location::unmount( const char* name ) const { - // Call C routine H5Fmount to do the mouting - herr_t ret_value = H5Funmount(getId(), name); + // Call C routine H5Fmount to do the mouting + herr_t ret_value = H5Funmount(getId(), name ); - // Raise exception if H5Funmount returns negative value - if (ret_value < 0) - throwException("unmount", "H5Funmount failed"); + // Raise exception if H5Funmount returns negative value + if( ret_value < 0 ) + throwException("unmount", "H5Funmount failed"); } //-------------------------------------------------------------------------- -// Function: H5Location::unmount -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::unmount +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Location::unmount(const H5std_string& name) const +void H5Location::unmount( const H5std_string& name ) const { - unmount(name.c_str()); + unmount( name.c_str() ); } #ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- -// Function: H5Location::iterateElems -///\brief Iterates a user's function over the entries of a group. -///\param name - IN : Name of group to iterate over -///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices -///\param op - IN : User's function to operate on each entry -///\param op_data - IN/OUT: Data associated with the operation -///\return The return value of the first operator that returns non-zero, -/// or zero if all members were processed with no operator -/// returning non-zero. -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::iterateElems +///\brief Iterates a user's function over the entries of a group. +///\param name - IN : Name of group to iterate over +///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices +///\param op - IN : User's function to operate on each entry +///\param op_data - IN/OUT: Data associated with the operation +///\return The return value of the first operator that returns non-zero, +/// or zero if all members were processed with no operator +/// returning non-zero. +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int H5Location::iterateElems(const char* name, int *idx, H5G_iterate_t op , void* op_data) +int H5Location::iterateElems( const char* name, int *idx, H5G_iterate_t op , void* op_data ) { - int ret_value = H5Giterate(getId(), name, idx, op, op_data); - if (ret_value < 0) - { - throwException("iterateElems", "H5Giterate failed"); - } - return(ret_value); + int ret_value = H5Giterate(getId(), name, idx, op, op_data ); + if( ret_value < 0 ) + { + throwException("iterateElems", "H5Giterate failed"); + } + return( ret_value ); } //-------------------------------------------------------------------------- -// Function: H5Location::iterateElems -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location::iterateElems +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int H5Location::iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op , void* op_data) +int H5Location::iterateElems( const H5std_string& name, int *idx, H5G_iterate_t op , void* op_data ) { - return(iterateElems( name.c_str(), idx, op, op_data)); + return( iterateElems( name.c_str(), idx, op, op_data )); } #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- -// Function: H5Location::getNumObjs -///\brief Returns the number of objects in this group. -///\return Number of objects -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - January, 2003 +// Function: H5Location::getNumObjs +///\brief Returns the number of objects in this group. +///\return Number of objects +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- hsize_t H5Location::getNumObjs() const { - H5G_info_t ginfo; // Group information + H5G_info_t ginfo; /* Group information */ - herr_t ret_value = H5Gget_info(getId(), &ginfo); - if(ret_value < 0) - throwException("getNumObjs", "H5Gget_info failed"); - return (ginfo.nlinks); + herr_t ret_value = H5Gget_info(getId(), &ginfo); + if(ret_value < 0) + throwException("getNumObjs", "H5Gget_info failed"); + return (ginfo.nlinks); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjnameByIdx -///\brief Returns the name of an object in this group, given the -/// object's index. -///\param idx - IN: Transient index of the object -///\return Object name -///\exception H5::FileIException or H5::GroupIException +// Function: H5Location::getObjnameByIdx +///\brief Returns the name of an object in this group, given the +/// object's index. +///\param idx - IN: Transient index of the object +///\return Object name +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// The value of idx can be any nonnegative number less than the -/// total number of objects in the group, which is returned by -/// the function \c H5Location::getNumObjs. Note that this is a -/// transient index; thus, an object may have a different index -/// each time the group is opened. -// Programmer Binh-Minh Ribler - Mar, 2005 +/// The value of idx can be any nonnegative number less than the +/// total number of objects in the group, which is returned by +/// the function \c H5Location::getNumObjs. Note that this is a +/// transient index; thus, an object may have a different index +/// each time the group is opened. +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- H5std_string H5Location::getObjnameByIdx(hsize_t idx) const { // call H5Lget_name_by_idx with name as NULL to get its length ssize_t name_len = H5Lget_name_by_idx(getId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, NULL, 0, H5P_DEFAULT); if(name_len < 0) - throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); // now, allocate C buffer to get the name char* name_C = new char[name_len+1]; @@ -1327,8 +1328,8 @@ H5std_string H5Location::getObjnameByIdx(hsize_t idx) const if (name_len < 0) { - delete []name_C; - throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + delete []name_C; + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); } // clean up and return the string @@ -1338,74 +1339,74 @@ H5std_string H5Location::getObjnameByIdx(hsize_t idx) const } //-------------------------------------------------------------------------- -// Function: H5Location::getObjnameByIdx -///\brief Retrieves the name of an object in this group, given the -/// object's index. -///\param idx - IN: Transient index of the object -///\param name - IN/OUT: Retrieved name of the object -///\param size - IN: Length to retrieve -///\return Actual size of the object name or 0, if object has no name -///\exception H5::FileIException or H5::GroupIException +// Function: H5Location::getObjnameByIdx +///\brief Retrieves the name of an object in this group, given the +/// object's index. +///\param idx - IN: Transient index of the object +///\param name - IN/OUT: Retrieved name of the object +///\param size - IN: Length to retrieve +///\return Actual size of the object name or 0, if object has no name +///\exception H5::FileIException or H5::GroupIException ///\par Description -/// The value of idx can be any nonnegative number less than the -/// total number of objects in the group, which is returned by -/// the function \c H5Location::getNumObjs. Note that this is a -/// transient index; thus, an object may have a different index -/// each time the group is opened. -// Programmer Binh-Minh Ribler - January, 2003 +/// The value of idx can be any nonnegative number less than the +/// total number of objects in the group, which is returned by +/// the function \c H5Location::getNumObjs. Note that this is a +/// transient index; thus, an object may have a different index +/// each time the group is opened. +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- ssize_t H5Location::getObjnameByIdx(hsize_t idx, char* name, size_t size) const { - ssize_t name_len = H5Lget_name_by_idx(getId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5P_DEFAULT); - if(name_len < 0) - throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + ssize_t name_len = H5Lget_name_by_idx(getId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5P_DEFAULT); + if(name_len < 0) + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); - return (name_len); + return (name_len); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjnameByIdx -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an -/// \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - January, 2003 +// Function: H5Location::getObjnameByIdx +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes an +/// \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- ssize_t H5Location::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const { - char* name_C = new char[size+1]; // temporary C-string for object name - HDmemset(name_C, 0, size+1); // clear buffer + char* name_C = new char[size+1]; // temporary C-string for object name + HDmemset(name_C, 0, size+1); // clear buffer - // call overloaded function to get the name - ssize_t name_len = getObjnameByIdx(idx, name_C, size+1); - if(name_len < 0) - { + // call overloaded function to get the name + ssize_t name_len = getObjnameByIdx(idx, name_C, size+1); + if(name_len < 0) + { delete []name_C; - throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); - } - - // clean up and return the string - name = H5std_string(name_C); - delete []name_C; - return (name_len); -} - -//-------------------------------------------------------------------------- -// Function: H5Location::childObjType -///\brief Returns the type of an object in this file/group, given the -/// object's name. -///\param objname - IN: Name of the object -///\return Object type, which can have the following values for group, -/// dataset, and named datatype -/// \li \c H5O_TYPE_GROUP -/// \li \c H5O_TYPE_DATASET -/// \li \c H5O_TYPE_NAMED_DATATYPE -/// Refer to the C API documentation for more details: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo -///\exception H5::FileIException or H5::GroupIException -/// Exception will be thrown when: -/// - an error returned by the C API -/// - object type is not one of the valid values above -// Programmer Binh-Minh Ribler - April, 2014 + throwException("getObjnameByIdx", "H5Lget_name_by_idx failed"); + } + + // clean up and return the string + name = H5std_string(name_C); + delete []name_C; + return (name_len); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::childObjType +///\brief Returns the type of an object in this file/group, given the +/// object's name. +///\param objname - IN: Name of the object +///\return Object type, which can have the following values for group, +/// dataset, and named datatype +/// \li \c H5O_TYPE_GROUP +/// \li \c H5O_TYPE_DATASET +/// \li \c H5O_TYPE_NAMED_DATATYPE +/// Refer to the C API documentation for more details: +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo +///\exception H5::FileIException or H5::GroupIException +/// Exception will be thrown when: +/// - an error returned by the C API +/// - object type is not one of the valid values above +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- H5O_type_t H5Location::childObjType(const char* objname) const { @@ -1417,33 +1418,33 @@ H5O_type_t H5Location::childObjType(const char* objname) const // Throw exception if C API returns failure if (ret_value < 0) - throwException("childObjType", "H5Oget_info_by_name failed"); + throwException("childObjType", "H5Oget_info_by_name failed"); // Return a valid type or throw an exception for unknown type else - switch (objinfo.type) - { - case H5O_TYPE_GROUP: - case H5O_TYPE_DATASET: - case H5O_TYPE_NAMED_DATATYPE: - objtype = objinfo.type; - break; - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - throwException("childObjType", "Unknown type of object"); - } + switch (objinfo.type) + { + case H5O_TYPE_GROUP: + case H5O_TYPE_DATASET: + case H5O_TYPE_NAMED_DATATYPE: + objtype = objinfo.type; + break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: + throwException("childObjType", "Unknown type of object"); + } return(objtype); } //-------------------------------------------------------------------------- -// Function: H5Location::childObjType -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \a H5std_string for the object's name. -///\brief Returns the type of an object in this group, given the -/// object's name. -///\param objname - IN: Name of the object (H5std_string&) -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - April, 2014 +// Function: H5Location::childObjType +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \a H5std_string for the object's name. +///\brief Returns the type of an object in this group, given the +/// object's name. +///\param objname - IN: Name of the object (H5std_string&) +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- H5O_type_t H5Location::childObjType(const H5std_string& objname) const { @@ -1453,33 +1454,33 @@ H5O_type_t H5Location::childObjType(const H5std_string& objname) const } //-------------------------------------------------------------------------- -// Function: H5Location::childObjType -///\brief Returns the type of an object in this file/group, given the -/// object's index and its type and order. -///\param index - IN: Position of the object -///\param index_type - IN: Type of the index, default to H5_INDEX_NAME -///\param order - IN: Traversing order, default to H5_ITER_INC -///\param objname - IN: Name of the object, default to "." -///\return Object type, which can have the following values for group, -/// dataset, and named datatype -/// \li \c H5O_TYPE_GROUP -/// \li \c H5O_TYPE_DATASET -/// \li \c H5O_TYPE_NAMED_DATATYPE -/// Refer to the C API documentation for more details: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo -///\exception H5::FileIException or H5::GroupIException -/// Exception will be thrown when: -/// - an error returned by the C API -/// - object type is not one of the valid values above +// Function: H5Location::childObjType +///\brief Returns the type of an object in this file/group, given the +/// object's index and its type and order. +///\param index - IN: Position of the object +///\param index_type - IN: Type of the index, default to H5_INDEX_NAME +///\param order - IN: Traversing order, default to H5_ITER_INC +///\param objname - IN: Name of the object, default to "." +///\return Object type, which can have the following values for group, +/// dataset, and named datatype +/// \li \c H5O_TYPE_GROUP +/// \li \c H5O_TYPE_DATASET +/// \li \c H5O_TYPE_NAMED_DATATYPE +/// Refer to the C API documentation for more details: +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo +///\exception H5::FileIException or H5::GroupIException +/// Exception will be thrown when: +/// - an error returned by the C API +/// - object type is not one of the valid values above // Developer's Notes: -// - this overload uses H5Oget_info_by_idx instead of H5Oget_info_by_name -// like the previous childObjType() -// - index is the required argument so, first -// - objname is last because it's more likely the location is already -// fully specified -// - Leave property list out for now because C API is not using it, it -// can be added later when needed. -// Programmer Binh-Minh Ribler - April, 2014 +// - this overload uses H5Oget_info_by_idx instead of H5Oget_info_by_name +// like the previous childObjType() +// - index is the required argument so, first +// - objname is last because it's more likely the location is already +// fully specified +// - Leave property list out for now because C API is not using it, it +// can be added later when needed. +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- H5O_type_t H5Location::childObjType(hsize_t index, H5_index_t index_type, H5_iter_order_t order, const char* objname) const { @@ -1492,37 +1493,37 @@ H5O_type_t H5Location::childObjType(hsize_t index, H5_index_t index_type, H5_ite // Throw exception if C API returns failure if (ret_value < 0) - throwException("childObjType", "H5Oget_info_by_idx failed"); + throwException("childObjType", "H5Oget_info_by_idx failed"); // Return a valid type or throw an exception for unknown type else - switch (objinfo.type) - { - case H5O_TYPE_GROUP: - case H5O_TYPE_DATASET: - case H5O_TYPE_NAMED_DATATYPE: - objtype = objinfo.type; - break; - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - throwException("childObjType", "Unknown type of object"); - } + switch (objinfo.type) + { + case H5O_TYPE_GROUP: + case H5O_TYPE_DATASET: + case H5O_TYPE_NAMED_DATATYPE: + objtype = objinfo.type; + break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: + throwException("childObjType", "Unknown type of object"); + } return(objtype); } //-------------------------------------------------------------------------- -// Function: H5Location::childObjVersion -///\brief Returns the object header version of an object in this file/group, -/// given the object's name. -///\param objname - IN: Name of the object -///\return Object version, which can have the following values: -/// \li \c H5O_VERSION_1 -/// \li \c H5O_VERSION_2 -///\exception H5::FileIException or H5::GroupIException -/// Exception will be thrown when: -/// - an error returned by the C API -/// - version number is not one of the valid values above -// Programmer Binh-Minh Ribler - April, 2014 +// Function: H5Location::childObjVersion +///\brief Returns the object header version of an object in this file/group, +/// given the object's name. +///\param objname - IN: Name of the object +///\return Object version, which can have the following values: +/// \li \c H5O_VERSION_1 +/// \li \c H5O_VERSION_2 +///\exception H5::FileIException or H5::GroupIException +/// Exception will be thrown when: +/// - an error returned by the C API +/// - version number is not one of the valid values above +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- unsigned H5Location::childObjVersion(const char* objname) const { @@ -1534,26 +1535,26 @@ unsigned H5Location::childObjVersion(const char* objname) const // Throw exception if C API returns failure if (ret_value < 0) - throwException("childObjVersion", "H5Oget_info_by_name failed"); + throwException("childObjVersion", "H5Oget_info_by_name failed"); // Return a valid version or throw an exception for invalid value else { - version = objinfo.hdr.version; - if (version != H5O_VERSION_1 && version != H5O_VERSION_2) - throwException("childObjVersion", "Invalid version for object"); + version = objinfo.hdr.version; + if (version != H5O_VERSION_1 && version != H5O_VERSION_2) + throwException("childObjVersion", "Invalid version for object"); } return(version); } //-------------------------------------------------------------------------- -// Function: H5Location::childObjVersion -///\brief This is an overloaded member function, provided for convenience. -/// It takes an \a H5std_string for the object's name. -///\brief Returns the type of an object in this group, given the -/// object's name. -///\param objname - IN: Name of the object (H5std_string&) -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - April, 2014 +// Function: H5Location::childObjVersion +///\brief This is an overloaded member function, provided for convenience. +/// It takes an \a H5std_string for the object's name. +///\brief Returns the type of an object in this group, given the +/// object's name. +///\param objname - IN: Name of the object (H5std_string&) +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- unsigned H5Location::childObjVersion(const H5std_string& objname) const { @@ -1565,35 +1566,35 @@ unsigned H5Location::childObjVersion(const H5std_string& objname) const #ifndef H5_NO_DEPRECATED_SYMBOLS #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::getObjTypeByIdx -///\brief Returns the type of an object in this group, given the -/// object's index. -///\param idx - IN: Transient index of the object -///\return Object type -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - January, 2003 +// Function: H5Location::getObjTypeByIdx +///\brief Returns the type of an object in this group, given the +/// object's index. +///\param idx - IN: Transient index of the object +///\return Object type +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx) const { H5G_obj_t obj_type = H5Gget_objtype_by_idx(getId(), idx); if (obj_type == H5G_UNKNOWN) - throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); + throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); return (obj_type); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjTypeByIdx -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function because it also provides -/// the returned object type in text (char*) -///\param idx - IN: Transient index of the object -///\param type_name - OUT: Object type in text -///\return Object type -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - May, 2010 +// Function: H5Location::getObjTypeByIdx +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function because it also provides +/// the returned object type in text (char*) +///\param idx - IN: Transient index of the object +///\param type_name - OUT: Object type in text +///\return Object type +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - May, 2010 // Modification -// Modified to use the other function. -BMR, 2016/03/07 +// Modified to use the other function. -BMR, 2016/03/07 //-------------------------------------------------------------------------- H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, char* type_name) const { @@ -1601,32 +1602,32 @@ H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, char* type_name) const return(getObjTypeByIdx(idx, stype_name)); } //-------------------------------------------------------------------------- -// Function: H5Location::getObjTypeByIdx -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function because it also provides -/// the returned object type in text (H5std_string&) -///\param idx - IN: Transient index of the object -///\param type_name - OUT: Object type in text -///\return Object type -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - January, 2003 +// Function: H5Location::getObjTypeByIdx +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function because it also provides +/// the returned object type in text (H5std_string&) +///\param idx - IN: Transient index of the object +///\param type_name - OUT: Object type in text +///\return Object type +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const { H5G_obj_t obj_type = H5Gget_objtype_by_idx(getId(), idx); switch (obj_type) { - case H5G_LINK: type_name = H5std_string("symbolic link"); break; - case H5G_GROUP: type_name = H5std_string("group"); break; - case H5G_DATASET: type_name = H5std_string("dataset"); break; - case H5G_TYPE: type_name = H5std_string("datatype"); break; - case H5G_UNKNOWN: - case H5G_UDLINK: - case H5G_RESERVED_5: - case H5G_RESERVED_6: - case H5G_RESERVED_7: - default: - throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); + case H5G_LINK: type_name = H5std_string("symbolic link"); break; + case H5G_GROUP: type_name = H5std_string("group"); break; + case H5G_DATASET: type_name = H5std_string("dataset"); break; + case H5G_TYPE: type_name = H5std_string("datatype"); break; + case H5G_UNKNOWN: + case H5G_UDLINK: + case H5G_RESERVED_5: + case H5G_RESERVED_6: + case H5G_RESERVED_7: + default: + throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed"); } return (obj_type); } @@ -1644,34 +1645,34 @@ H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) cons //-------------------------------------------------------------------------- void H5Location::throwException(const H5std_string& func_name, const H5std_string& msg) const { - throwException(func_name, msg); + throwException(func_name, msg); } //-------------------------------------------------------------------------- -// Function: f_DataSet_setId - friend +// Function: f_DataSet_setId - friend // Modification: -// Moved to H5CommonFG.cpp after the rearrangement of classes -// -BMR, Dec 2016 +// Moved to H5CommonFG.cpp after the rearrangement of classes +// -BMR, Dec 2016 //-------------------------------------------------------------------------- // end of From H5CommonFG.cpp //-------------------------------------------------------------------------- -// Function: f_Attribute_setId - friend +// Function: f_Attribute_setId - friend // Modification: -// Moved to H5Object.cpp after the rearrangement of classes -// -BMR, Dec 2016 +// Moved to H5Object.cpp after the rearrangement of classes +// -BMR, Dec 2016 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- -// Function: f_DataSpace_setId - friend -// Purpose This function is friend to class H5::DataSpace so that it can -// can set DataSpace::id in order to work around a problem -// described in the JIRA issue HDFFV-7947. -// Applications shouldn't need to use it. -// param dspace - IN/OUT: DataSpace object to be changed -// param new_id - IN: New id to set -// Programmer Binh-Minh Ribler - 2015 +// Function: f_DataSpace_setId - friend +// Purpose: This function is friend to class H5::DataSpace so that it can +// can set DataSpace::id in order to work around a problem +// described in the JIRA issue HDFFV-7947. +// Applications shouldn't need to use it. +// param dspace - IN/OUT: DataSpace object to be changed +// param new_id - IN: New id to set +// Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- void f_DataSpace_setId(DataSpace* dspace, hid_t new_id) { @@ -1679,9 +1680,9 @@ void f_DataSpace_setId(DataSpace* dspace, hid_t new_id) } //-------------------------------------------------------------------------- -// Function: H5Location destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Location destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Location::~H5Location() {} diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 337a2b3..6a449dc 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -17,7 +17,7 @@ #ifndef __H5Location_H #define __H5Location_H -#include "H5Classes.h" // constains forward class declarations +#include "H5Classes.h" // constains forward class declarations namespace H5 { @@ -37,188 +37,188 @@ class H5_DLLCPP LinkAccPropList; class H5_DLLCPP VarLenType; class H5_DLLCPP H5Location : public IdComponent { public: - // Checks if a link of a given name exists in a location - bool exists(const char* name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; - bool exists(const H5std_string& name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + // Checks if a link of a given name exists in a location + bool exists(const char* name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + bool exists(const H5std_string& name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; - // Flushes all buffers associated with this location to disk. - void flush(H5F_scope_t scope) const; + // Flushes all buffers associated with this location to disk. + void flush( H5F_scope_t scope ) const; - // Gets the name of the file, specified by this location. - H5std_string getFileName() const; + // Gets the name of the file, specified by this location. + H5std_string getFileName() const; #ifndef H5_NO_DEPRECATED_SYMBOLS - // Retrieves the type of object that an object reference points to. - H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const; + // Retrieves the type of object that an object reference points to. + H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const; #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Retrieves the type of object that an object reference points to. - H5O_type_t getRefObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const; - // Note: getRefObjType deprecates getObjType, but getObjType's name is - // misleading, so getRefObjType is used in the new function instead. - - // Sets the comment for an HDF5 object specified by its name. - void setComment(const char* name, const char* comment) const; - void setComment(const H5std_string& name, const H5std_string& comment) const; - void setComment(const char* comment) const; - void setComment(const H5std_string& comment) const; - - // Retrieves comment for the HDF5 object specified by its name. - ssize_t getComment(const char* name, size_t buf_size, char* comment) const; - H5std_string getComment(const char* name, size_t buf_size=0) const; - H5std_string getComment(const H5std_string& name, size_t buf_size=0) const; - - // Removes the comment for the HDF5 object specified by its name. - void removeComment(const char* name) const; - void removeComment(const H5std_string& name) const; - - // Creates a reference to a named object or to a dataset region - // in this object. - void reference(void* ref, const char* name, - H5R_type_t ref_type = H5R_OBJECT) const; - void reference(void* ref, const H5std_string& name, - H5R_type_t ref_type = H5R_OBJECT) const; - void reference(void* ref, const char* name, const DataSpace& dataspace, - H5R_type_t ref_type = H5R_DATASET_REGION) const; - void reference(void* ref, const H5std_string& name, const DataSpace& dataspace, - H5R_type_t ref_type = H5R_DATASET_REGION) const; - - // Open a referenced object whose location is specified by either - // a file, an HDF5 object, or an attribute. - void dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); - //void dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); - - // Retrieves a dataspace with the region pointed to selected. - DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; + // Retrieves the type of object that an object reference points to. + H5O_type_t getRefObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const; + // Note: getRefObjType deprecates getObjType, but getObjType's name is + // misleading, so getRefObjType is used in the new function instead. + + // Sets the comment for an HDF5 object specified by its name. + void setComment(const char* name, const char* comment) const; + void setComment(const H5std_string& name, const H5std_string& comment) const; + void setComment(const char* comment) const; + void setComment(const H5std_string& comment) const; + + // Retrieves comment for the HDF5 object specified by its name. + ssize_t getComment(const char* name, size_t buf_size, char* comment) const; + H5std_string getComment(const char* name, size_t buf_size=0) const; + H5std_string getComment(const H5std_string& name, size_t buf_size=0) const; + + // Removes the comment for the HDF5 object specified by its name. + void removeComment(const char* name) const; + void removeComment(const H5std_string& name) const; + + // Creates a reference to a named object or to a dataset region + // in this object. + void reference(void* ref, const char* name, + H5R_type_t ref_type = H5R_OBJECT) const; + void reference(void* ref, const H5std_string& name, + H5R_type_t ref_type = H5R_OBJECT) const; + void reference(void* ref, const char* name, const DataSpace& dataspace, + H5R_type_t ref_type = H5R_DATASET_REGION) const; + void reference(void* ref, const H5std_string& name, const DataSpace& dataspace, + H5R_type_t ref_type = H5R_DATASET_REGION) const; + + // Open a referenced object whose location is specified by either + // a file, an HDF5 object, or an attribute. + void dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + //void dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + + // Retrieves a dataspace with the region pointed to selected. + DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; // From CommonFG - // Creates a new group at this location which can be a file - // or another group. - Group createGroup(const char* name, size_t size_hint = 0) const; - Group createGroup(const H5std_string& name, size_t size_hint = 0) const; - - // Opens an existing group in a location which can be a file - // or another group. - Group openGroup(const char* name) const; - Group openGroup(const H5std_string& name) const; - - // Creates a new dataset in this group. - DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; - DataSet createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; - - // Opens an existing dataset at this location. - DataSet openDataSet(const char* name) const; - DataSet openDataSet(const H5std_string& name) const; - - // Returns the value of a symbolic link. - H5std_string getLinkval(const char* link_name, size_t size=0) const; - H5std_string getLinkval(const H5std_string& link_name, size_t size=0) const; - - // Returns the number of objects in this group. - hsize_t getNumObjs() const; - - // Retrieves the name of an object in this group, given the - // object's index. - H5std_string getObjnameByIdx(hsize_t idx) const; - ssize_t getObjnameByIdx(hsize_t idx, char* name, size_t size) const; - ssize_t getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const; - - // Retrieves the type of an object in this file or group, given the - // object's name - H5O_type_t childObjType(const H5std_string& objname) const; - H5O_type_t childObjType(const char* objname) const; - H5O_type_t childObjType(hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char* objname=".") const; - - // Returns the object header version of an object in this file or group, - // given the object's name. - unsigned childObjVersion(const char* objname) const; - unsigned childObjVersion(const H5std_string& objname) const; + // Creates a new group at this location which can be a file + // or another group. + Group createGroup(const char* name, size_t size_hint = 0) const; + Group createGroup(const H5std_string& name, size_t size_hint = 0) const; + + // Opens an existing group in a location which can be a file + // or another group. + Group openGroup(const char* name) const; + Group openGroup(const H5std_string& name) const; + + // Creates a new dataset in this group. + DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; + DataSet createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const; + + // Opens an existing dataset at this location. + DataSet openDataSet(const char* name) const; + DataSet openDataSet(const H5std_string& name) const; + + // Returns the value of a symbolic link. + H5std_string getLinkval(const char* link_name, size_t size=0) const; + H5std_string getLinkval(const H5std_string& link_name, size_t size=0) const; + + // Returns the number of objects in this group. + hsize_t getNumObjs() const; + + // Retrieves the name of an object in this group, given the + // object's index. + H5std_string getObjnameByIdx(hsize_t idx) const; + ssize_t getObjnameByIdx(hsize_t idx, char* name, size_t size) const; + ssize_t getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const; + + // Retrieves the type of an object in this file or group, given the + // object's name + H5O_type_t childObjType(const H5std_string& objname) const; + H5O_type_t childObjType(const char* objname) const; + H5O_type_t childObjType(hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char* objname=".") const; + + // Returns the object header version of an object in this file or group, + // given the object's name. + unsigned childObjVersion(const char* objname) const; + unsigned childObjVersion(const H5std_string& objname) const; #ifndef H5_NO_DEPRECATED_SYMBOLS - // Returns the type of an object in this group, given the - // object's index. - H5G_obj_t getObjTypeByIdx(hsize_t idx) const; - H5G_obj_t getObjTypeByIdx(hsize_t idx, char* type_name) const; - H5G_obj_t getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const; - - // Returns information about an HDF5 object, given by its name, - // at this location. - void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const; - void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const; - void getObjinfo(const char* name, H5G_stat_t& statbuf) const; - void getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const; - - // Iterates over the elements of this group - not implemented in - // C++ style yet. - int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data); - int iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op, void *op_data); + // Returns the type of an object in this group, given the + // object's index. + H5G_obj_t getObjTypeByIdx(hsize_t idx) const; + H5G_obj_t getObjTypeByIdx(hsize_t idx, char* type_name) const; + H5G_obj_t getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const; + + // Returns information about an HDF5 object, given by its name, + // at this location. + void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const; + void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const; + void getObjinfo(const char* name, H5G_stat_t& statbuf) const; + void getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const; + + // Iterates over the elements of this group - not implemented in + // C++ style yet. + int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data); + int iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op, void *op_data); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Creates a link of the specified type from new_name to current_name; - // both names are interpreted relative to the specified location id. - void link(H5L_type_t link_type, const char* curr_name, const char* new_name) const; - void link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const; + // Creates a link of the specified type from new_name to current_name; + // both names are interpreted relative to the specified location id. + void link(H5L_type_t link_type, const char* curr_name, const char* new_name) const; + void link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const; - // Removes the specified name at this location. - void unlink(const char* name) const; - void unlink(const H5std_string& name) const; + // Removes the specified name at this location. + void unlink(const char* name) const; + void unlink(const H5std_string& name) const; - // Mounts the file 'child' onto this location. - void mount(const char* name, const H5File& child, const PropList& plist) const; - //void mount(const char* name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 - void mount(const H5std_string& name, const H5File& child, const PropList& plist) const; - //void mount(const H5std_string& name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 + // Mounts the file 'child' onto this location. + void mount(const char* name, const H5File& child, const PropList& plist) const; + //void mount(const char* name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 + void mount(const H5std_string& name, const H5File& child, const PropList& plist) const; + //void mount(const H5std_string& name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 - // Unmounts the file named 'name' from this parent location. - void unmount(const char* name) const; - void unmount(const H5std_string& name) const; + // Unmounts the file named 'name' from this parent location. + void unmount(const char* name) const; + void unmount(const H5std_string& name) const; - // Renames an object at this location. - void move(const char* src, const char* dst) const; - void move(const H5std_string& src, const H5std_string& dst) const; + // Renames an object at this location. + void move(const char* src, const char* dst) const; + void move(const H5std_string& src, const H5std_string& dst) const; // end From CommonFG - /// For subclasses, H5File and Group, to throw appropriate exception. - virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; + /// For subclasses, H5File and Group, to throw appropriate exception. + virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; - // Default constructor - H5Location(); + // Default constructor + H5Location(); protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS - // *** Deprecation warning *** - // The following two constructors are no longer appropriate after the - // data member "id" had been moved to the sub-classes. - // The copy constructor is a noop and is removed in 1.8.15 and the - // other will be removed from 1.10 release, and then from 1.8 if its - // removal does not raise any problems in two 1.10 releases. + // *** Deprecation warning *** + // The following two constructors are no longer appropriate after the + // data member "id" had been moved to the sub-classes. + // The copy constructor is a noop and is removed in 1.8.15 and the + // other will be removed from 1.10 release, and then from 1.8 if its + // removal does not raise any problems in two 1.10 releases. - // Creates a copy of an existing object giving the location id. - H5Location(const hid_t loc_id); + // Creates a copy of an existing object giving the location id. + H5Location(const hid_t loc_id); - // Creates a reference to an HDF5 object or a dataset region. - void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const; + // Creates a reference to an HDF5 object or a dataset region. + void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const; - // Dereferences a ref into an HDF5 id. - hid_t p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const PropList& plist, const char* from_func); + // Dereferences a ref into an HDF5 id. + hid_t p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const PropList& plist, const char* from_func); #ifndef H5_NO_DEPRECATED_SYMBOLS - // Retrieves the type of object that an object reference points to. - H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const; + // Retrieves the type of object that an object reference points to. + H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const; #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Retrieves the type of object that an object reference points to. - H5O_type_t p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const; + // Retrieves the type of object that an object reference points to. + H5O_type_t p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const; - // Sets the identifier of this object to a new value. - this one - // doesn't increment reference count - //virtual void p_setId(const hid_t new_id); + // Sets the identifier of this object to a new value. - this one + // doesn't increment reference count + //virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS - // Noop destructor. - virtual ~H5Location(); + // Noop destructor. + virtual ~H5Location(); }; /* end class H5Location */ diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index b5d0f88..48d81f8 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -15,7 +15,7 @@ #include -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -46,25 +46,25 @@ namespace H5 { extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name, const H5A_info_t *ainfo, void *op_data) { - H5std_string s_attr_name = H5std_string(attr_name); + H5std_string s_attr_name = H5std_string( attr_name ); UserData4Aiterate* myData = reinterpret_cast (op_data); - myData->op(*myData->location, s_attr_name, myData->opData); + myData->op( *myData->location, s_attr_name, myData->opData ); return 0; } #endif //-------------------------------------------------------------------------- -// Function: H5Object default constructor (protected) -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object default constructor (protected) +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Object::H5Object() : H5Location() {} //-------------------------------------------------------------------------- -// Function: H5Object overloaded constructor (protected) -// Purpose Creates an H5Object object using the id of an existing HDF5 -// object. -// Parameters object_id - IN: Id of an existing HDF5 object -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object overloaded constructor (protected) +// Purpose Creates an H5Object object using the id of an existing HDF5 +// object. +// Parameters object_id - IN: Id of an existing HDF5 object +// Programmer Binh-Minh Ribler - 2000 // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had // been moved to the sub-classes. It will be removed in 1.10 release. If its @@ -75,11 +75,11 @@ H5Object::H5Object() : H5Location() {} //H5Object::H5Object(const hid_t object_id) : H5Location() {} //-------------------------------------------------------------------------- -// Function: H5Object copy constructor -///\brief Copy constructor: makes a copy of the original H5Object -/// instance. -///\param original - IN: H5Object instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object copy constructor +///\brief Copy constructor: makes a copy of the original H5Object +/// instance. +///\param original - IN: H5Object instance to copy +// Programmer Binh-Minh Ribler - 2000 // *** Deprecation warning *** // This constructor is no longer appropriate because the data member "id" had // been moved to the sub-classes. It is removed from 1.8.15 because it is @@ -103,157 +103,158 @@ void f_Attribute_setId(Attribute* attr, hid_t new_id) } //-------------------------------------------------------------------------- -// Function: H5Object::createAttribute -///\brief Creates an attribute for a group, dataset, or named datatype. -///\param name - IN: Name of the attribute -///\param data_type - IN: Datatype for the attribute -///\param data_space - IN: Dataspace for the attribute - only simple -/// dataspaces are allowed at this time -///\param create_plist - IN: Creation property list - default to -/// PropList::DEFAULT -///\return Attribute instance -///\exception H5::AttributeIException +// Function: H5Object::createAttribute +///\brief Creates an attribute for a group, dataset, or named datatype. +///\param name - IN: Name of the attribute +///\param data_type - IN: Datatype for the attribute +///\param data_space - IN: Dataspace for the attribute - only simple +/// dataspaces are allowed at this time +///\param create_plist - IN: Creation property list - default to +/// PropList::DEFAULT +///\return Attribute instance +///\exception H5::AttributeIException ///\par Description -/// The attribute name specified in \a name must be unique. -/// Attempting to create an attribute with the same name as an -/// existing attribute will raise an exception, leaving the -/// pre-existing attribute intact. To overwrite an existing -/// attribute with a new attribute of the same name, first -/// delete the existing one with \c H5Object::removeAttr, then -/// recreate it with this function. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -Attribute H5Object::createAttribute(const char* name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist) const +/// The attribute name specified in \a name must be unique. +/// Attempting to create an attribute with the same name as an +/// existing attribute will raise an exception, leaving the +/// pre-existing attribute intact. To overwrite an existing +/// attribute with a new attribute of the same name, first +/// delete the existing one with \c H5Object::removeAttr, then +/// recreate it with this function. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +Attribute H5Object::createAttribute( const char* name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const { - hid_t type_id = data_type.getId(); - hid_t space_id = data_space.getId(); - hid_t plist_id = create_plist.getId(); - hid_t attr_id = H5Acreate2(getId(), name, type_id, space_id, plist_id, H5P_DEFAULT); - - // If the attribute id is valid, create and return the Attribute object - if (attr_id > 0) - { - Attribute attr; - f_Attribute_setId(&attr, attr_id); - return(attr); - } - else - throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed"); + hid_t type_id = data_type.getId(); + hid_t space_id = data_space.getId(); + hid_t plist_id = create_plist.getId(); + hid_t attr_id = H5Acreate2(getId(), name, type_id, space_id, plist_id, H5P_DEFAULT ); + + // If the attribute id is valid, create and return the Attribute object + if( attr_id > 0 ) + { + Attribute attr; + f_Attribute_setId(&attr, attr_id); + return( attr ); + } + else + throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed"); } //-------------------------------------------------------------------------- -// Function: H5Object::createAttribute -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::createAttribute +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Object::createAttribute(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist) const +Attribute H5Object::createAttribute( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const { - return(createAttribute( name.c_str(), data_type, data_space, create_plist)); + return( createAttribute( name.c_str(), data_type, data_space, create_plist )); } //-------------------------------------------------------------------------- -// Function: H5Object::openAttribute -///\brief Opens an attribute given its name. -///\param name - IN: Name of the attribute -///\return Attribute instance -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::openAttribute +///\brief Opens an attribute given its name. +///\param name - IN: Name of the attribute +///\return Attribute instance +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Object::openAttribute(const char* name) const +Attribute H5Object::openAttribute( const char* name ) const { - hid_t attr_id = H5Aopen(getId(), name, H5P_DEFAULT); - if (attr_id > 0) - { - Attribute attr; - f_Attribute_setId(&attr, attr_id); - return(attr); - } - else - { - throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen failed"); - } + hid_t attr_id = H5Aopen(getId(), name, H5P_DEFAULT); + if( attr_id > 0 ) + { + Attribute attr; + f_Attribute_setId(&attr, attr_id); + return( attr ); + } + else + { + throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Object::openAttribute -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::openAttribute +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Object::openAttribute(const H5std_string& name) const +Attribute H5Object::openAttribute( const H5std_string& name ) const { - return(openAttribute( name.c_str())); + return( openAttribute( name.c_str()) ); } //-------------------------------------------------------------------------- -// Function: H5Object::openAttribute -///\brief Opens an attribute given its index. -///\param idx - IN: Index of the attribute, a 0-based, non-negative integer -///\return Attribute instance -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::openAttribute +///\brief Opens an attribute given its index. +///\param idx - IN: Index of the attribute, a 0-based, non-negative integer +///\return Attribute instance +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Attribute H5Object::openAttribute(const unsigned int idx) const +Attribute H5Object::openAttribute( const unsigned int idx ) const { - hid_t attr_id = H5Aopen_by_idx(getId(), ".", H5_INDEX_CRT_ORDER, - H5_ITER_INC, static_cast(idx), H5P_DEFAULT, H5P_DEFAULT); - if (attr_id > 0) - { - Attribute attr; - f_Attribute_setId(&attr, attr_id); - return(attr); - } - else - { - throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed"); - } + hid_t attr_id = H5Aopen_by_idx(getId(), ".", H5_INDEX_CRT_ORDER, + H5_ITER_INC, static_cast(idx), H5P_DEFAULT, H5P_DEFAULT); + if( attr_id > 0 ) + { + Attribute attr; + f_Attribute_setId(&attr, attr_id); + return(attr); + } + else + { + throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed"); + } } //-------------------------------------------------------------------------- -// Function: H5Object::iterateAttrs -///\brief Iterates a user's function over all the attributes of an H5 -/// object, which may be a group, dataset or named datatype. -///\param user_op - IN: User's function to operate on each attribute -///\param _idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices -///\param op_data - IN: User's data to pass to user's operator function -///\return Returned value of the last operator if it was non-zero, or -/// zero if all attributes were processed -///\exception H5::AttributeIException +// Function: H5Object::iterateAttrs +///\brief Iterates a user's function over all the attributes of an H5 +/// object, which may be a group, dataset or named datatype. +///\param user_op - IN: User's function to operate on each attribute +///\param _idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices +///\param op_data - IN: User's data to pass to user's operator function +///\return Returned value of the last operator if it was non-zero, or +/// zero if all attributes were processed +///\exception H5::AttributeIException ///\par Description -/// The signature of user_op is -/// void (*)(H5::H5Location&, H5std_string, void*). -/// For information, please refer to the C layer Reference Manual -/// at: +/// The signature of user_op is +/// void (*)(H5::H5Location&, H5std_string, void*). +/// For information, please refer to the C layer Reference Manual +/// at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5A.html#Annot-Iterate -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -int H5Object::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_data) +int H5Object::iterateAttrs( attr_operator_t user_op, unsigned *_idx, void *op_data ) { - // store the user's function and data - UserData4Aiterate* userData = new UserData4Aiterate; - userData->opData = op_data; - userData->op = user_op; - userData->location = this; - - // call the C library routine H5Aiterate2 to iterate the attributes - hsize_t idx = _idx ? static_cast(*_idx) : 0; - int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, - userAttrOpWrpr, reinterpret_cast(userData)); - - // release memory - delete userData; - - if (ret_value >= 0) { - /* Pass back update index value to calling code */ - if (_idx) - *_idx = static_cast(idx); - return(ret_value); - } - else // raise exception when H5Aiterate returns a negative value - throw AttributeIException(inMemFunc("iterateAttrs"), "H5Aiterate2 failed"); + // store the user's function and data + UserData4Aiterate* userData = new UserData4Aiterate; + userData->opData = op_data; + userData->op = user_op; + userData->location = this; + + // call the C library routine H5Aiterate2 to iterate the attributes + hsize_t idx = _idx ? static_cast(*_idx) : 0; + int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, + userAttrOpWrpr, reinterpret_cast(userData)); + + // release memory + delete userData; + + if( ret_value >= 0 ) { + /* Pass back update index value to calling code */ + if (_idx) + *_idx = static_cast(idx); + + return( ret_value ); + } + else // raise exception when H5Aiterate returns a negative value + throw AttributeIException(inMemFunc("iterateAttrs"), "H5Aiterate2 failed"); } //-------------------------------------------------------------------------- @@ -290,106 +291,106 @@ unsigned H5Object::objVersion() const } //-------------------------------------------------------------------------- -// Function: H5Object::getNumAttrs -///\brief Returns the number of attributes attached to this HDF5 object. -///\return Number of attributes -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::getNumAttrs +///\brief Returns the number of attributes attached to this HDF5 object. +///\return Number of attributes +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int H5Object::getNumAttrs() const { - H5O_info_t oinfo; /* Object info */ + H5O_info_t oinfo; /* Object info */ - if(H5Oget_info(getId(), &oinfo) < 0) - throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed"); - else - return(static_cast(oinfo.num_attrs)); + if(H5Oget_info(getId(), &oinfo) < 0) + throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed"); + else + return(static_cast(oinfo.num_attrs)); } //-------------------------------------------------------------------------- -// Function: H5Object::attrExists -///\brief Checks whether the named attribute exists at this location. -///\param name - IN: Name of the attribute to be queried -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2013 +// Function: H5Object::attrExists +///\brief Checks whether the named attribute exists at this location. +///\param name - IN: Name of the attribute to be queried +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2013 //-------------------------------------------------------------------------- bool H5Object::attrExists(const char* name) const { - // Call C routine H5Aexists to determine whether an attribute exists - // at this location, which could be specified by a file, group, dataset, - // or named datatype. - herr_t ret_value = H5Aexists(getId(), name); - if (ret_value > 0) - return true; - else if(ret_value == 0) - return false; - else // Raise exception when H5Aexists returns a negative value - throw AttributeIException(inMemFunc("attrExists"), "H5Aexists failed"); + // Call C routine H5Aexists to determine whether an attribute exists + // at this location, which could be specified by a file, group, dataset, + // or named datatype. + herr_t ret_value = H5Aexists(getId(), name); + if( ret_value > 0 ) + return true; + else if(ret_value == 0) + return false; + else // Raise exception when H5Aexists returns a negative value + throw AttributeIException(inMemFunc("attrExists"), "H5Aexists failed"); } //-------------------------------------------------------------------------- -// Function: H5Object::attrExists -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::attrExists +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool H5Object::attrExists(const H5std_string& name) const { - return(attrExists(name.c_str())); + return(attrExists(name.c_str())); } //-------------------------------------------------------------------------- -// Function: H5Object::removeAttr -///\brief Removes the named attribute from this object. -///\param name - IN: Name of the attribute to be removed -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::removeAttr +///\brief Removes the named attribute from this object. +///\param name - IN: Name of the attribute to be removed +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Object::removeAttr(const char* name) const +void H5Object::removeAttr( const char* name ) const { - herr_t ret_value = H5Adelete(getId(), name); - if (ret_value < 0) - throw AttributeIException(inMemFunc("removeAttr"), "H5Adelete failed"); + herr_t ret_value = H5Adelete(getId(), name); + if( ret_value < 0 ) + throw AttributeIException(inMemFunc("removeAttr"), "H5Adelete failed"); } //-------------------------------------------------------------------------- -// Function: H5Object::removeAttr -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object::removeAttr +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5Object::removeAttr(const H5std_string& name) const +void H5Object::removeAttr( const H5std_string& name ) const { - removeAttr(name.c_str()); + removeAttr( name.c_str() ); } //-------------------------------------------------------------------------- -// Function: H5Object::renameAttr -///\brief Renames the named attribute from this object. -///\param oldname - IN: Name of the attribute to be renamed -///\param newname - IN: New name ame of the attribute -///\exception H5::AttributeIException -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: H5Object::renameAttr +///\brief Renames the named attribute from this object. +///\param oldname - IN: Name of the attribute to be renamed +///\param newname - IN: New name ame of the attribute +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- void H5Object::renameAttr(const char* oldname, const char* newname) const { - herr_t ret_value = H5Arename(getId(), oldname, newname); - if (ret_value < 0) - throw AttributeIException(inMemFunc("renameAttr"), "H5Arename failed"); + herr_t ret_value = H5Arename(getId(), oldname, newname); + if (ret_value < 0) + throw AttributeIException(inMemFunc("renameAttr"), "H5Arename failed"); } //-------------------------------------------------------------------------- -// Function: H5Object::renameAttr -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for the names. -// Programmer Binh-Minh Ribler - Mar, 2005 +// Function: H5Object::renameAttr +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for the names. +// Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- void H5Object::renameAttr(const H5std_string& oldname, const H5std_string& newname) const { - renameAttr (oldname.c_str(), newname.c_str()); + renameAttr (oldname.c_str(), newname.c_str()); } //-------------------------------------------------------------------------- // Function: getObjName @@ -404,11 +405,11 @@ ssize_t H5Object::getObjName(char *obj_name, size_t buf_size) const // If H5Iget_name returns a negative value, raise an exception if (name_size < 0) - { + { throw Exception(inMemFunc("getObjName"), "H5Iget_name failed"); } else if (name_size == 0) - { + { throw Exception(inMemFunc("getObjName"), "Object must have a name, but name length is 0"); } // Return length of the name @@ -432,16 +433,16 @@ H5std_string H5Object::getObjName() const // If H5Iget_name failed, throw exception if (name_size < 0) - { + { throw Exception(inMemFunc("getObjName"), "H5Iget_name failed"); } else if (name_size == 0) - { + { throw Exception(inMemFunc("getObjName"), "Object must have a name, but name length is 0"); } // Object's name exists, retrieve it else if (name_size > 0) - { + { char* name_C = new char[name_size+1]; // temporary C-string HDmemset(name_C, 0, name_size+1); // clear buffer @@ -477,13 +478,13 @@ ssize_t H5Object::getObjName(H5std_string& obj_name, size_t len) const // If no length is provided, get the entire object name if (len == 0) - { + { obj_name = getObjName(); name_size = obj_name.length(); } // If length is provided, get that number of characters in name else - { + { char* name_C = new char[len+1]; // temporary C-string HDmemset(name_C, 0, len+1); // clear buffer @@ -504,9 +505,9 @@ ssize_t H5Object::getObjName(H5std_string& obj_name, size_t len) const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Object destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: H5Object destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5Object::~H5Object() {} #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 866d739..5ea8937 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -24,20 +24,20 @@ namespace H5 { and Group. Modification: - Sept 18, 2012: Added class H5Location in between IdComponent and - H5Object. An H5File now inherits from H5Location. All HDF5 - wrappers in H5Object are moved up to H5Location. H5Object - is left mostly empty for future wrappers that are only for - group, dataset, and named datatype. Note that the reason for - adding H5Location instead of simply moving H5File to be under - H5Object is H5File is not an HDF5 object, and renaming H5Object - to H5Location will risk breaking user applications. - -BMR - Apr 2, 2014: Added wrapper getObjName for H5Iget_name - Sep 21, 2016: Rearranging classes (HDFFV-9920) moved H5A wrappers back - into H5Object. This way, C functions that takes attribute id - can be in H5Location and those that cannot take attribute id - can be in H5Object. + Sept 18, 2012: Added class H5Location in between IdComponent and + H5Object. An H5File now inherits from H5Location. All HDF5 + wrappers in H5Object are moved up to H5Location. H5Object + is left mostly empty for future wrappers that are only for + group, dataset, and named datatype. Note that the reason for + adding H5Location instead of simply moving H5File to be under + H5Object is H5File is not an HDF5 object, and renaming H5Object + to H5Location will risk breaking user applications. + -BMR + Apr 2, 2014: Added wrapper getObjName for H5Iget_name + Sep 21, 2016: Rearranging classes (HDFFV-9920) moved H5A wrappers back + into H5Object. This way, C functions that takes attribute id + can be in H5Location and those that cannot take attribute id + can be in H5Object. Inheritance: H5Location -> IdComponent */ @@ -46,88 +46,88 @@ class H5_DLLCPP H5Object; class H5_DLLCPP Attribute; // Define the operator function pointer for H5Aiterate(). -typedef void (*attr_operator_t)(H5Object& loc/*in*/, +typedef void (*attr_operator_t)( H5Object& loc/*in*/, const H5std_string attr_name/*in*/, void *operator_data/*in,out*/); // User data for attribute iteration class UserData4Aiterate { public: - attr_operator_t op; - void* opData; - H5Object* location; + attr_operator_t op; + void* opData; + H5Object* location; }; class H5_DLLCPP H5Object : public H5Location { public: - // Creates an attribute for the specified object - // PropList is currently not used, so always be default. - Attribute createAttribute(const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; - Attribute createAttribute(const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; + // Creates an attribute for the specified object + // PropList is currently not used, so always be default. + Attribute createAttribute( const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const; + Attribute createAttribute( const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const; - // Given its name, opens the attribute that belongs to an object at - // this location. - Attribute openAttribute(const char* name) const; - Attribute openAttribute(const H5std_string& name) const; + // Given its name, opens the attribute that belongs to an object at + // this location. + Attribute openAttribute( const char* name ) const; + Attribute openAttribute( const H5std_string& name ) const; - // Given its index, opens the attribute that belongs to an object at - // this location. - Attribute openAttribute(const unsigned int idx) const; + // Given its index, opens the attribute that belongs to an object at + // this location. + Attribute openAttribute( const unsigned int idx ) const; - // Iterate user's function over the attributes of this object. - int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL); + // Iterate user's function over the attributes of this object. + int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL); - // Returns the object header version of an object - unsigned objVersion() const; + // Returns the object header version of an object + unsigned objVersion() const; - // Determines the number of attributes belong to this object. - int getNumAttrs() const; + // Determines the number of attributes belong to this object. + int getNumAttrs() const; - // Checks whether the named attribute exists for this object. - bool attrExists(const char* name) const; - bool attrExists(const H5std_string& name) const; + // Checks whether the named attribute exists for this object. + bool attrExists(const char* name) const; + bool attrExists(const H5std_string& name) const; - // Renames the named attribute to a new name. - void renameAttr(const char* oldname, const char* newname) const; - void renameAttr(const H5std_string& oldname, const H5std_string& newname) const; + // Renames the named attribute to a new name. + void renameAttr(const char* oldname, const char* newname) const; + void renameAttr(const H5std_string& oldname, const H5std_string& newname) const; - // Removes the named attribute from this object. - void removeAttr(const char* name) const; - void removeAttr(const H5std_string& name) const; + // Removes the named attribute from this object. + void removeAttr(const char* name) const; + void removeAttr(const H5std_string& name) const; - // Returns an identifier. - virtual hid_t getId() const = 0; + // Returns an identifier. + virtual hid_t getId() const = 0; #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Gets the name of this HDF5 object, i.e., Group, DataSet, or - // DataType. These should have const but are retiring anyway. - ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; - ssize_t getObjName(H5std_string& obj_name, size_t len = 0) const; - H5std_string getObjName() const; + // Gets the name of this HDF5 object, i.e., Group, DataSet, or + // DataType. These should have const but are retiring anyway. + ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; + ssize_t getObjName(H5std_string& obj_name, size_t len = 0) const; + H5std_string getObjName() const; protected: - // Default constructor - H5Object(); + // Default constructor + H5Object(); - // *** Deprecation warning *** - // The following two constructors are no longer appropriate after the - // data member "id" had been moved to the sub-classes. - // The copy constructor is a noop and is removed in 1.8.15 and the - // other will be removed from 1.10 release, and then from 1.8 if its - // removal does not raise any problems in two 1.10 releases. + // *** Deprecation warning *** + // The following two constructors are no longer appropriate after the + // data member "id" had been moved to the sub-classes. + // The copy constructor is a noop and is removed in 1.8.15 and the + // other will be removed from 1.10 release, and then from 1.8 if its + // removal does not raise any problems in two 1.10 releases. - // Creates a copy of an existing object giving the object id - H5Object(const hid_t object_id); + // Creates a copy of an existing object giving the object id + H5Object( const hid_t object_id ); - // Copy constructor: makes copy of an H5Object object. - // H5Object(const H5Object& original); + // Copy constructor: makes copy of an H5Object object. + // H5Object(const H5Object& original); - // Sets the identifier of this object to a new value. - this one - // doesn't increment reference count - virtual void p_setId(const hid_t new_id) = 0; + // Sets the identifier of this object to a new value. - this one + // doesn't increment reference count + virtual void p_setId(const hid_t new_id) = 0; - // Noop destructor. - virtual ~H5Object(); + // Noop destructor. + virtual ~H5Object(); #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index 6fdd9dc..397a96f 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -75,49 +75,49 @@ void ObjCreatPropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose: Constant for default property +// Purpose: Constant for default property //-------------------------------------------------------------------------- const ObjCreatPropList& ObjCreatPropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Default Constructor -///\brief Creates a file access property list -// Programmer Binh-Minh Ribler - 2000 +// Function: Default Constructor +///\brief Creates a file access property list +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- ObjCreatPropList::ObjCreatPropList() : PropList(H5P_OBJECT_CREATE) {} //-------------------------------------------------------------------------- -// Function: ObjCreatPropList copy constructor -///\brief Copy Constructor: makes a copy of the original -///\param original - IN: ObjCreatPropList instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: ObjCreatPropList copy constructor +///\brief Copy Constructor: makes a copy of the original +///\param original - IN: ObjCreatPropList instance to copy +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- ObjCreatPropList::ObjCreatPropList(const ObjCreatPropList& original) : PropList(original) {} //-------------------------------------------------------------------------- -// Function: ObjCreatPropList overloaded constructor -///\brief Creates a file access property list using the id of an -/// existing one. -// Programmer Binh-Minh Ribler - 2000 +// Function: ObjCreatPropList overloaded constructor +///\brief Creates a file access property list using the id of an +/// existing one. +// Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- ObjCreatPropList::ObjCreatPropList(const hid_t plist_id) : PropList(plist_id) {} //-------------------------------------------------------------------------- -// Function: ObjCreatPropList::setAttrPhaseChange -///\brief Sets attribute storage phase change thresholds. -///\param max_compact - IN: Maximum number of attributes to be stored in -/// compact storage. Default to 8 -///\param min_dense - IN: Minimum number of attributes to be stored in -/// dense storage. Default to 6 -///\exception H5::PropListIException +// Function: ObjCreatPropList::setAttrPhaseChange +///\brief Sets attribute storage phase change thresholds. +///\param max_compact - IN: Maximum number of attributes to be stored in +/// compact storage. Default to 8 +///\param min_dense - IN: Minimum number of attributes to be stored in +/// dense storage. Default to 6 +///\exception H5::PropListIException ///\par Description -/// If \c max_compact is set to 0, dense storage will be used. -/// For more detail about on attribute storage, please refer to the -/// C layer Reference Manual at: +/// If \c max_compact is set to 0, dense storage will be used. +/// For more detail about on attribute storage, please refer to the +/// C layer Reference Manual at: /// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrPhaseChange -// Programmer Binh-Minh Ribler - September 2015 +// Programmer: Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact, unsigned min_dense) const { @@ -129,19 +129,19 @@ void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact, unsigned min_den } //-------------------------------------------------------------------------- -// Function: ObjCreatPropList::getAttrPhaseChange -///\brief Gets attribute storage phase change thresholds. -///\param max_compact - OUT: Maximum number of attributes to be stored in -/// compact storage. -///\param min_dense - OUT: Minimum number of attributes to be stored in -/// dense storage. -///\exception H5::PropListIException +// Function: ObjCreatPropList::getAttrPhaseChange +///\brief Gets attribute storage phase change thresholds. +///\param max_compact - OUT: Maximum number of attributes to be stored in +/// compact storage. +///\param min_dense - OUT: Minimum number of attributes to be stored in +/// dense storage. +///\exception H5::PropListIException ///\par Description -/// If \c max_compact is set to 0, dense storage will be used. -/// For more detail about on attribute storage, please refer to the -/// C layer Reference Manual at: +/// If \c max_compact is set to 0, dense storage will be used. +/// For more detail about on attribute storage, please refer to the +/// C layer Reference Manual at: /// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrPhaseChange -// Programmer Binh-Minh Ribler - September 2015 +// Programmer: Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const { @@ -154,23 +154,23 @@ void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_d } //-------------------------------------------------------------------------- -// Function: ObjCreatPropList::setAttrCrtOrder -///\brief Sets tracking and indexing of attribute creation order. -///\param crt_order_flags - IN: Flags specifying whether to track and -/// index attribute creation order. Default: No flag set -///\exception H5::PropListIException +// Function: ObjCreatPropList::setAttrCrtOrder +///\brief Sets tracking and indexing of attribute creation order. +///\param crt_order_flags - IN: Flags specifying whether to track and +/// index attribute creation order. Default: No flag set +///\exception H5::PropListIException ///\par Description -/// Valid flags are: -/// \li \c H5P_CRT_ORDER_TRACKED - Attribute creation order is tracked -/// \li \c H5P_CRT_ORDER_INDEXED - Attribute creation order is -/// indexed (requires H5P_CRT_ORDER_TRACKED). -/// When no flag is set, attribute creation order is neither -/// tracked not indexed. Note that HDF5 currently provides no -/// mechanism to turn on attribute creation order tracking at object -/// creation time and to build the index later. -/// The C layer Reference Manual at can be found at: +/// Valid flags are: +/// \li \c H5P_CRT_ORDER_TRACKED - Attribute creation order is tracked +/// \li \c H5P_CRT_ORDER_INDEXED - Attribute creation order is +/// indexed (requires H5P_CRT_ORDER_TRACKED). +/// When no flag is set, attribute creation order is neither +/// tracked not indexed. Note that HDF5 currently provides no +/// mechanism to turn on attribute creation order tracking at object +/// creation time and to build the index later. +/// The C layer Reference Manual at can be found at: /// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrCreationOrder -// Programmer Binh-Minh Ribler - September 2015 +// Programmer: Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const { @@ -182,18 +182,18 @@ void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const } //-------------------------------------------------------------------------- -// Function: ObjCreatPropList::getAttrCrtOrder -///\brief Gets tracking and indexing settings for attribute -/// creation order. -///\param crt_order_flags - OUT: Flags specifying whether to track and -/// index attribute creation order -///\exception H5::PropListIException +// Function: ObjCreatPropList::getAttrCrtOrder +///\brief Gets tracking and indexing settings for attribute +/// creation order. +///\param crt_order_flags - OUT: Flags specifying whether to track and +/// index attribute creation order +///\exception H5::PropListIException ///\par Description -/// When no flag is set, i.e. crt_order_flags = 0, attribute -/// creation order is neither tracked not indexed. -/// The C layer Reference Manual at can be found at: +/// When no flag is set, i.e. crt_order_flags = 0, attribute +/// creation order is neither tracked not indexed. +/// The C layer Reference Manual at can be found at: /// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrCreationOrder -// Programmer Binh-Minh Ribler - September 2015 +// Programmer: Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- unsigned ObjCreatPropList::getAttrCrtOrder() const { @@ -208,9 +208,9 @@ unsigned ObjCreatPropList::getAttrCrtOrder() const } //-------------------------------------------------------------------------- -// Function: ObjCreatPropList destructor -///\brief Noop destructor -// Programmer Binh-Minh Ribler - 2000 +// Function: ObjCreatPropList destructor +///\brief Noop destructor +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- ObjCreatPropList::~ObjCreatPropList() {} diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index 4858e07..bfba1c4 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -27,37 +27,37 @@ namespace H5 { */ class H5_DLLCPP ObjCreatPropList : public PropList { public: - ///\brief Default object creation property list. - static const ObjCreatPropList& DEFAULT; + ///\brief Default object creation property list. + static const ObjCreatPropList& DEFAULT; - // Creates a object creation property list. - ObjCreatPropList(); + // Creates a object creation property list. + ObjCreatPropList(); - // Sets attribute storage phase change thresholds. - void setAttrPhaseChange(unsigned max_compact = 8, unsigned min_dense = 6) const; + // Sets attribute storage phase change thresholds. + void setAttrPhaseChange(unsigned max_compact = 8, unsigned min_dense = 6) const; - // Gets attribute storage phase change thresholds. - void getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const; + // Gets attribute storage phase change thresholds. + void getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const; - // Sets tracking and indexing of attribute creation order. - void setAttrCrtOrder(unsigned crt_order_flags) const; + // Sets tracking and indexing of attribute creation order. + void setAttrCrtOrder(unsigned crt_order_flags) const; - // Gets tracking and indexing settings for attribute creation order. - unsigned getAttrCrtOrder() const; + // Gets tracking and indexing settings for attribute creation order. + unsigned getAttrCrtOrder() const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("ObjCreatPropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("ObjCreatPropList"); } - // Copy constructor: creates a copy of a ObjCreatPropList object. - ObjCreatPropList(const ObjCreatPropList& original); + // Copy constructor: creates a copy of a ObjCreatPropList object. + ObjCreatPropList( const ObjCreatPropList& original ); - // Creates a copy of an existing object creation property list - // using the property list id. - ObjCreatPropList (const hid_t plist_id); + // Creates a copy of an existing object creation property list + // using the property list id. + ObjCreatPropList (const hid_t plist_id); - // Noop destructor - virtual ~ObjCreatPropList(); + // Noop destructor + virtual ~ObjCreatPropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 03327c8..e2eed18 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -32,14 +32,14 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: PredType overloaded constructor -///\brief Creates a PredType object using the id of an existing -/// predefined datatype. -///\param predtype_id - IN: Id of a predefined datatype +// Function: PredType overloaded constructor +///\brief Creates a PredType object using the id of an existing +/// predefined datatype. +///\param predtype_id - IN: Id of a predefined datatype // Description -// This constructor creates a PredType object by copying -// the provided HDF5 predefined datatype. -// Programmer Binh-Minh Ribler - 2000 +// This constructor creates a PredType object by copying +// the provided HDF5 predefined datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::PredType(const hid_t predtype_id) : AtomType(predtype_id) { @@ -47,69 +47,69 @@ PredType::PredType(const hid_t predtype_id) : AtomType(predtype_id) } //-------------------------------------------------------------------------- -// Function: PredType default constructor -///\brief Default constructor: Creates a stub predefined datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: PredType default constructor +///\brief Default constructor: Creates a stub predefined datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::PredType() : AtomType() {} #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: PredType copy constructor -///\brief Copy constructor: makes a copy of the original PredType object. -///\param original - IN: PredType instance to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: PredType copy constructor +///\brief Copy constructor: makes a copy of the original PredType object. +///\param original - IN: PredType instance to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::PredType(const PredType& original) : AtomType(original) {} //-------------------------------------------------------------------------- -// Function: PredType::operator= -///\brief Assignment operator. -///\param rhs - IN: Reference to the predefined datatype -///\return Reference to PredType instance -///\exception H5::DataTypeIException +// Function: PredType::operator= +///\brief Assignment operator. +///\param rhs - IN: Reference to the predefined datatype +///\return Reference to PredType instance +///\exception H5::DataTypeIException // Description -// Makes a copy of the type on the right hand side and stores -// the new id in the left hand side object. -// Programmer Binh-Minh Ribler - 2000 +// Makes a copy of the type on the right hand side and stores +// the new id in the left hand side object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -PredType& PredType::operator=(const PredType& rhs) +PredType& PredType::operator=( const PredType& rhs ) { if (this != &rhs) - copy(rhs); + copy(rhs); return(*this); } #ifndef DOXYGEN_SHOULD_SKIP_THIS // These dummy functions do not inherit from DataType - they'll // throw an DataTypeIException if invoked. -void PredType::commit(H5Location& loc, const char* name) +void PredType::commit(H5Location& loc, const char* name ) { - throw DataTypeIException("PredType::commit", "Error: Attempted to commit a predefined datatype. Invalid operation!"); + throw DataTypeIException("PredType::commit", "Error: Attempted to commit a predefined datatype. Invalid operation!" ); } -void PredType::commit(H5Location& loc, const H5std_string& name) +void PredType::commit(H5Location& loc, const H5std_string& name ) { - commit(loc, name.c_str()); + commit( loc, name.c_str()); } bool PredType::committed() { - throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype."); + throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype." ); } #endif // DOXYGEN_SHOULD_SKIP_THIS // Default destructor //-------------------------------------------------------------------------- -// Function: PredType destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Function: PredType destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::~PredType() {} /***************************************************************************** - The following section is regarding the global constants PredType, - DataSpace, and PropList. + The following section is regarding the global constants PredType, + DataSpace, and PropList. *****************************************************************************/ @@ -292,18 +292,18 @@ PredType* PredType::NATIVE_UINT_FAST64_; #endif /* H5_SIZEOF_UINT_FAST64_T */ //-------------------------------------------------------------------------- -// Function: PredType::getPredTypes -// Purpose Returns the dummy PredType constant object pointer -// Return: PredType object pointer +// Function: PredType::getPredTypes +// Purpose: Returns the dummy PredType constant object pointer +// Return: PredType object pointer // Description -// If the dummy constant PREDTYPE_CONST_ is not allocated yet, -// call makePredTypes() to allocate all of the PredType constants. -// Otherwise, just simply return the object pointer PREDTYPE_CONST_. +// If the dummy constant PREDTYPE_CONST_ is not allocated yet, +// call makePredTypes() to allocate all of the PredType constants. +// Otherwise, just simply return the object pointer PREDTYPE_CONST_. // -// Note that, there is a similar function to getPredTypes() in -// other classes, that have global constants, is called getConstant(). +// Note that, there is a similar function to getPredTypes() in +// other classes, that have global constants, is called getConstant(). // -// Programmer Binh-Minh Ribler - September 2015 +// Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- PredType* PredType::getPredTypes() { @@ -318,16 +318,16 @@ PredType* PredType::getPredTypes() // If the dummy constant pointer is not allocated, allocate all PredType // constant pointers. Otherwise, throw because it shouldn't be. if (PREDTYPE_CONST_ == 0) - makePredTypes(); + makePredTypes(); else - throw H5::DataTypeIException("PredType::getPredTypes", "PredType::getPredTypes is being invoked on an allocated PREDTYPE_CONST_"); + throw H5::DataTypeIException("PredType::getPredTypes", "PredType::getPredTypes is being invoked on an allocated PREDTYPE_CONST_"); return PREDTYPE_CONST_; } //-------------------------------------------------------------------------- -// Function: PredType::makePredTypes -// Purpose Allocate all PredType constants. -// Programmer Binh-Minh Ribler - September 2015 +// Function: PredType::makePredTypes +// Purpose: Allocate all PredType constants. +// Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void PredType::makePredTypes() { @@ -515,9 +515,9 @@ void PredType::makePredTypes() //-------------------------------------------------------------------------- -// Function: PredType::deleteConstants -// Purpose Deletes all PredType constant pointers. -// Programmer Binh-Minh Ribler - September 2015 +// Function: PredType::deleteConstants +// Purpose: Deletes all PredType constant pointers. +// Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void PredType::deleteConstants() { @@ -891,205 +891,206 @@ const PredType& PredType::NATIVE_UINT_FAST64 = *NATIVE_UINT_FAST64_; } // end namespace /*************************************************************************** - Design Note - =========== + Design Note + =========== September 2015: - The C++ library has several types of global constants from different - classes, such as PropList, PredType, DataSpace, etc... Previously, - these global constants were declared statically and the C++ library used - a constant, called PredType::AtExit, to detect when all the global - contants are destroyed then close the C library (H5close). This method - relied on the order of the constants being created and destroyed and - that PredType constants be the last to be destroyed. In September - 2015, it was recognized that the order in which the global constants were - created and destroyed was actually undefined, thus can be different - between different compilers. This resulted in failure when compilers - destroy PredType constants before others because when PredType::AtExit - was destroyed, the C library was closed, so when the constants of other - classes such as PropList or DataSpace were being deleted, the C library - would not be available. - - These are the classes that have global constants: - + PredType - + DataSpace - + PropList (and its subclasses below) - + FileAccPropList - + FileCreatPropList - + DSetMemXferPropList - + DSetCreatPropList - - The new method includes these main points: - - - The C++ library uses dynamically allocated constants to have the - control in which order the global constants are created/destroyed. - - - The previous static constants are changed to be the references to - the dynamically allocated constants to avoid impact on applications. - - - The first time an IdComponent default constructor is invoked, it - will call the function H5Library::initH5cpp which registers the - terminating functions from each class that has the global constants - so that these functions can destroy those constants at the exit of the - application. IdComponent is a baseclass of any object class that has - an identifier, such as Group, DataSet, DataType,... The classes which - have the global constants are all derived from IdComponent. - - - At the normal termination of the application, each registered function - for each constant type will delete all the allocated constants in - that type class, then a different terminating function, which was also - registered with atexit() by initH5cpp, will call H5close to close the - C library. - - The following list presents the differences between the old and new - methods and the changes implemented for the new method. - - 1. The following items are added to class H5Library: - // Private instance to be created by H5Library only - static H5Library* instance; - - // Returns a singleton H5Library to initialize the global - // constants, invoked in IdComponent default constructor - static H5Library* getInstance(); // public - - // Registers cleanup and terminating functions with atexit(), - // called in IdComponent default constructor - static void initH5cpp(void); // public - - // Calls H5close to terminate the library, registered with - // atexit(), as the last thing to be done. - static void termH5cpp(void); // public - - 2. The following shows the differences between the old and new methods - for allocating the PredType constants. There are more than 100 - constants, but only one is shown here for examples. - - Old Method: - ---------- - // Declaration of the constant - in "H5PredType.h" - static const PredType NATIVE_INT; - - // Definition of the constant - in "H5PredType.cpp" - const PredType PredType::NATIVE_INT(H5T_NATIVE_INT); - - New Method: - ---------- - // Declare pointer for a constant - in "H5PredType.h" - static PredType* NATIVE_INT_; // "H5PredType.h" - - // Change previous constant to reference - in "H5PredType.h" - static const PredType& NATIVE_INT; - - // The assignment of the first static constant, named - // PREDTYPE_CONST, calls makePredTypes() which allocates the - // dynamic memory for every PredType constant. - - // Creates a dynamic PredType object representing a C constant - // - in makePredTypes() - NATIVE_INT_ = new PredType(H5T_NATIVE_INT); - - // Assign the constant reference to the dynamic object - // - in "H5PredType.cpp" - const PredType& PredType::NATIVE_INT = *NATIVE_INT_; - - Functions added to class PredType: - - // Creates the constants - static void makePredTypes(); // private - - // Calls makePredTypes to create the constants and returns - // the dummy constant PREDTYPE_CONST; - static PredType* getPredTypes(); // private - - // Deletes the constants - static void deleteConstants(); // public - - 3. This section shows the differences between the old and new methods - for allocating the DataSpace constant, DataSpace::ALL. + The C++ library has several types of global constants from different + classes, such as PropList, PredType, DataSpace, etc... Previously, + these global constants were declared statically and the C++ library used + a constant, called PredType::AtExit, to detect when all the global + contants are destroyed then close the C library (H5close). This method + relied on the order of the constants being created and destroyed and + that PredType constants be the last to be destroyed. In September + 2015, it was recognized that the order in which the global constants were + created and destroyed was actually undefined, thus can be different + between different compilers. This resulted in failure when compilers + destroy PredType constants before others because when PredType::AtExit + was destroyed, the C library was closed, so when the constants of other + classes such as PropList or DataSpace were being deleted, the C library + would not be available. + + These are the classes that have global constants: + + PredType + + DataSpace + + PropList (and its subclasses below) + + FileAccPropList + + FileCreatPropList + + DSetMemXferPropList + + DSetCreatPropList + + + The new method includes these main points: + + - The C++ library uses dynamically allocated constants to have the + control in which order the global constants are created/destroyed. + + - The previous static constants are changed to be the references to + the dynamically allocated constants to avoid impact on applications. + + - The first time an IdComponent default constructor is invoked, it + will call the function H5Library::initH5cpp which registers the + terminating functions from each class that has the global constants + so that these functions can destroy those constants at the exit of the + application. IdComponent is a baseclass of any object class that has + an identifier, such as Group, DataSet, DataType,... The classes which + have the global constants are all derived from IdComponent. + + - At the normal termination of the application, each registered function + for each constant type will delete all the allocated constants in + that type class, then a different terminating function, which was also + registered with atexit() by initH5cpp, will call H5close to close the + C library. + + The following list presents the differences between the old and new + methods and the changes implemented for the new method. + + 1. The following items are added to class H5Library: + // Private instance to be created by H5Library only + static H5Library* instance; + + // Returns a singleton H5Library to initialize the global + // constants, invoked in IdComponent default constructor + static H5Library* getInstance(); // public + + // Registers cleanup and terminating functions with atexit(), + // called in IdComponent default constructor + static void initH5cpp(void); // public + + // Calls H5close to terminate the library, registered with + // atexit(), as the last thing to be done. + static void termH5cpp(void); // public + + 2. The following shows the differences between the old and new methods + for allocating the PredType constants. There are more than 100 + constants, but only one is shown here for examples. + + Old Method: + ---------- + // Declaration of the constant - in "H5PredType.h" + static const PredType NATIVE_INT; + + // Definition of the constant - in "H5PredType.cpp" + const PredType PredType::NATIVE_INT(H5T_NATIVE_INT); + + New Method: + ---------- + // Declare pointer for a constant - in "H5PredType.h" + static PredType* NATIVE_INT_; // "H5PredType.h" + + // Change previous constant to reference - in "H5PredType.h" + static const PredType& NATIVE_INT; + + // The assignment of the first static constant, named + // PREDTYPE_CONST, calls makePredTypes() which allocates the + // dynamic memory for every PredType constant. + + // Creates a dynamic PredType object representing a C constant + // - in makePredTypes() + NATIVE_INT_ = new PredType(H5T_NATIVE_INT); + + // Assign the constant reference to the dynamic object + // - in "H5PredType.cpp" + const PredType& PredType::NATIVE_INT = *NATIVE_INT_; + + Functions added to class PredType: + + // Creates the constants + static void makePredTypes(); // private + + // Calls makePredTypes to create the constants and returns + // the dummy constant PREDTYPE_CONST; + static PredType* getPredTypes(); // private + + // Deletes the constants + static void deleteConstants(); // public + + 3. This section shows the differences between the old and new methods + for allocating the DataSpace constant, DataSpace::ALL. - Old Method: - ---------- - // Declaration of the constant - in "H5DataSpace.h" - static const DataSpace ALL; + Old Method: + ---------- + // Declaration of the constant - in "H5DataSpace.h" + static const DataSpace ALL; - // Definition of the constant - in "H5DataSpace.cpp" - const DataSpace DataSpace::ALL(H5S_ALL); + // Definition of the constant - in "H5DataSpace.cpp" + const DataSpace DataSpace::ALL(H5S_ALL); - New Method: - ---------- - // Declare pointer for a constant - in "H5DataSpace.h" - static DataSpace* ALL_; // "H5DataSpace.h" + New Method: + ---------- + // Declare pointer for a constant - in "H5DataSpace.h" + static DataSpace* ALL_; // "H5DataSpace.h" - // Change previous constant to reference - in "H5DataSpace.h" - static const DataSpace& ALL; + // Change previous constant to reference - in "H5DataSpace.h" + static const DataSpace& ALL; - // Creates a dynamic DataSpace object representing the C constant - // - in "H5DataSpace.cpp" - ALL_ = new DataSpace(H5S_ALL); + // Creates a dynamic DataSpace object representing the C constant + // - in "H5DataSpace.cpp" + ALL_ = new DataSpace(H5S_ALL); - // Assign the constant reference to the dynamic object - // - in "H5DataSpace.cpp" - const DataSpace& DataSpace::ALL = *ALL_; + // Assign the constant reference to the dynamic object + // - in "H5DataSpace.cpp" + const DataSpace& DataSpace::ALL = *ALL_; - Functions added to class DataSpace: + Functions added to class DataSpace: - // Creates the constant - static DataSpace* getConstant(); // private + // Creates the constant + static DataSpace* getConstant(); // private - // Deletes the constant - static void deleteConstants(); // public + // Deletes the constant + static void deleteConstants(); // public - 4. This section shows the differences between the old and new methods - for allocating the following constants - - PropList constant, PropList::DEFAULT. - - DSetCreatPropList constant, DSetCreatPropList::DEFAULT. - - DSetMemXferPropList constant, DSetMemXferPropList::DEFAULT. - - FileCreatPropList constant, FileCreatPropList::DEFAULT. - - FileAccPropList constant, FileAccPropList::DEFAULT. + 4. This section shows the differences between the old and new methods + for allocating the following constants + - PropList constant, PropList::DEFAULT. + - DSetCreatPropList constant, DSetCreatPropList::DEFAULT. + - DSetMemXferPropList constant, DSetMemXferPropList::DEFAULT. + - FileCreatPropList constant, FileCreatPropList::DEFAULT. + - FileAccPropList constant, FileAccPropList::DEFAULT. - For these constants, the library has the same changes, except the - class names and the HDF5 corresponding constants. Only the items - of PropList are listed, and "PropList" can be replaced by any of - DSetCreatPropList, DSetMemXferPropList, FileCreatPropList, - FileAccPropList for those classes. The HDF5 C constant "H5P_DEFAULT" - can be replaced by any of these respectively: H5P_DATASET_CREATE, - H5P_DATASET_XFER, H5P_FILE_CREATE, and H5P_FILE_ACCESS. + For these constants, the library has the same changes, except the + class names and the HDF5 corresponding constants. Only the items + of PropList are listed, and "PropList" can be replaced by any of + DSetCreatPropList, DSetMemXferPropList, FileCreatPropList, + FileAccPropList for those classes. The HDF5 C constant "H5P_DEFAULT" + can be replaced by any of these respectively: H5P_DATASET_CREATE, + H5P_DATASET_XFER, H5P_FILE_CREATE, and H5P_FILE_ACCESS. - Old Method: - ---------- - // Declaration of the constant - in "H5PropList.h" - static const PropList DEFAULT; + Old Method: + ---------- + // Declaration of the constant - in "H5PropList.h" + static const PropList DEFAULT; - // Definition of the constant - in "H5PropList.cpp" - const PropList PropList::DEFAULT(H5P_DEFAULT); + // Definition of the constant - in "H5PropList.cpp" + const PropList PropList::DEFAULT(H5P_DEFAULT); - New Method: - ---------- - // Declare pointer for a constant - in "H5PropList.h" - static PropList* DEFAULT_; // "H5PropList.h" + New Method: + ---------- + // Declare pointer for a constant - in "H5PropList.h" + static PropList* DEFAULT_; // "H5PropList.h" - // Change previous constant to reference - in "H5PropList.h" - static const PropList& DEFAULT; + // Change previous constant to reference - in "H5PropList.h" + static const PropList& DEFAULT; - // Creates a dynamic PropList object representing the C constant - // - in "H5PropList.cpp" - DEFAULT_ = new PropList(H5P_DEFAULT); + // Creates a dynamic PropList object representing the C constant + // - in "H5PropList.cpp" + DEFAULT_ = new PropList(H5P_DEFAULT); - // Assign the constant reference to the dynamic object - // - in "H5PropList.cpp" - const PropList& PropList::DEFAULT = *DEFAULT_; + // Assign the constant reference to the dynamic object + // - in "H5PropList.cpp" + const PropList& PropList::DEFAULT = *DEFAULT_; - Functions added to class PropList: + Functions added to class PropList: - // Creates the constant - static PropList* getConstant(); // private + // Creates the constant + static PropList* getConstant(); // private - // Deletes the constants - static void deleteConstants(); // public + // Deletes the constants + static void deleteConstants(); // public - The same functions are added to the subclasses of PropList instead of - using PropList's because of the class types and in favor of clarity. + The same functions are added to the subclasses of PropList instead of + using PropList's because of the class types and in favor of clarity. ****************************************************************************/ diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index a8d6e37..750902e 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -30,207 +30,207 @@ namespace H5 { */ class H5_DLLCPP PredType : public AtomType { public: - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("PredType"); } - - // Makes a copy of the predefined type and stores the new - // id in the left hand side object. - PredType& operator=(const PredType& rhs); - - // Copy constructor - makes copy of the original object - PredType(const PredType& original); - - // Noop destructor - virtual ~PredType(); - - /*! \brief This dummy function do not inherit from DataType - it will - throw a DataTypeIException if invoked. - */ - void commit(H5Location& loc, const H5std_string& name); - /*! \brief This dummy function do not inherit from DataType - it will - throw a DataTypeIException if invoked. - */ - void commit(H5Location& loc, const char* name); - /*! \brief This dummy function do not inherit from DataType - it will - throw a DataTypeIException if invoked. - */ - bool committed(); - - ///\brief PredType constants - static const PredType& STD_I8BE; - static const PredType& STD_I8LE; - static const PredType& STD_I16BE; - static const PredType& STD_I16LE; - static const PredType& STD_I32BE; - static const PredType& STD_I32LE; - static const PredType& STD_I64BE; - static const PredType& STD_I64LE; - static const PredType& STD_U8BE; - static const PredType& STD_U8LE; - static const PredType& STD_U16BE; - static const PredType& STD_U16LE; - static const PredType& STD_U32BE; - static const PredType& STD_U32LE; - static const PredType& STD_U64BE; - static const PredType& STD_U64LE; - static const PredType& STD_B8BE; - static const PredType& STD_B8LE; - static const PredType& STD_B16BE; - static const PredType& STD_B16LE; - static const PredType& STD_B32BE; - static const PredType& STD_B32LE; - static const PredType& STD_B64BE; - static const PredType& STD_B64LE; - static const PredType& STD_REF_OBJ; - static const PredType& STD_REF_DSETREG; - - static const PredType& C_S1; - static const PredType& FORTRAN_S1; - - static const PredType& IEEE_F32BE; - static const PredType& IEEE_F32LE; - static const PredType& IEEE_F64BE; - static const PredType& IEEE_F64LE; - - static const PredType& UNIX_D32BE; - static const PredType& UNIX_D32LE; - static const PredType& UNIX_D64BE; - static const PredType& UNIX_D64LE; - - static const PredType& INTEL_I8; - static const PredType& INTEL_I16; - static const PredType& INTEL_I32; - static const PredType& INTEL_I64; - static const PredType& INTEL_U8; - static const PredType& INTEL_U16; - static const PredType& INTEL_U32; - static const PredType& INTEL_U64; - static const PredType& INTEL_B8; - static const PredType& INTEL_B16; - static const PredType& INTEL_B32; - static const PredType& INTEL_B64; - static const PredType& INTEL_F32; - static const PredType& INTEL_F64; - - static const PredType& ALPHA_I8; - static const PredType& ALPHA_I16; - static const PredType& ALPHA_I32; - static const PredType& ALPHA_I64; - static const PredType& ALPHA_U8; - static const PredType& ALPHA_U16; - static const PredType& ALPHA_U32; - static const PredType& ALPHA_U64; - static const PredType& ALPHA_B8; - static const PredType& ALPHA_B16; - static const PredType& ALPHA_B32; - static const PredType& ALPHA_B64; - static const PredType& ALPHA_F32; - static const PredType& ALPHA_F64; - - static const PredType& MIPS_I8; - static const PredType& MIPS_I16; - static const PredType& MIPS_I32; - static const PredType& MIPS_I64; - static const PredType& MIPS_U8; - static const PredType& MIPS_U16; - static const PredType& MIPS_U32; - static const PredType& MIPS_U64; - static const PredType& MIPS_B8; - static const PredType& MIPS_B16; - static const PredType& MIPS_B32; - static const PredType& MIPS_B64; - static const PredType& MIPS_F32; - static const PredType& MIPS_F64; - - static const PredType& NATIVE_CHAR; - static const PredType& NATIVE_SCHAR; - static const PredType& NATIVE_UCHAR; - static const PredType& NATIVE_SHORT; - static const PredType& NATIVE_USHORT; - static const PredType& NATIVE_INT; - static const PredType& NATIVE_UINT; - static const PredType& NATIVE_LONG; - static const PredType& NATIVE_ULONG; - static const PredType& NATIVE_LLONG; - static const PredType& NATIVE_ULLONG; - static const PredType& NATIVE_FLOAT; - static const PredType& NATIVE_DOUBLE; - static const PredType& NATIVE_LDOUBLE; - static const PredType& NATIVE_B8; - static const PredType& NATIVE_B16; - static const PredType& NATIVE_B32; - static const PredType& NATIVE_B64; - static const PredType& NATIVE_OPAQUE; - static const PredType& NATIVE_HSIZE; - static const PredType& NATIVE_HSSIZE; - static const PredType& NATIVE_HERR; - static const PredType& NATIVE_HBOOL; - - static const PredType& NATIVE_INT8; - static const PredType& NATIVE_UINT8; - static const PredType& NATIVE_INT16; - static const PredType& NATIVE_UINT16; - static const PredType& NATIVE_INT32; - static const PredType& NATIVE_UINT32; - static const PredType& NATIVE_INT64; - static const PredType& NATIVE_UINT64; + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("PredType"); } + + // Makes a copy of the predefined type and stores the new + // id in the left hand side object. + PredType& operator=( const PredType& rhs ); + + // Copy constructor - makes copy of the original object + PredType( const PredType& original ); + + // Noop destructor + virtual ~PredType(); + + /*! \brief This dummy function do not inherit from DataType - it will + throw a DataTypeIException if invoked. + */ + void commit(H5Location& loc, const H5std_string& name ); + /*! \brief This dummy function do not inherit from DataType - it will + throw a DataTypeIException if invoked. + */ + void commit(H5Location& loc, const char* name ); + /*! \brief This dummy function do not inherit from DataType - it will + throw a DataTypeIException if invoked. + */ + bool committed(); + + ///\brief PredType constants + static const PredType& STD_I8BE; + static const PredType& STD_I8LE; + static const PredType& STD_I16BE; + static const PredType& STD_I16LE; + static const PredType& STD_I32BE; + static const PredType& STD_I32LE; + static const PredType& STD_I64BE; + static const PredType& STD_I64LE; + static const PredType& STD_U8BE; + static const PredType& STD_U8LE; + static const PredType& STD_U16BE; + static const PredType& STD_U16LE; + static const PredType& STD_U32BE; + static const PredType& STD_U32LE; + static const PredType& STD_U64BE; + static const PredType& STD_U64LE; + static const PredType& STD_B8BE; + static const PredType& STD_B8LE; + static const PredType& STD_B16BE; + static const PredType& STD_B16LE; + static const PredType& STD_B32BE; + static const PredType& STD_B32LE; + static const PredType& STD_B64BE; + static const PredType& STD_B64LE; + static const PredType& STD_REF_OBJ; + static const PredType& STD_REF_DSETREG; + + static const PredType& C_S1; + static const PredType& FORTRAN_S1; + + static const PredType& IEEE_F32BE; + static const PredType& IEEE_F32LE; + static const PredType& IEEE_F64BE; + static const PredType& IEEE_F64LE; + + static const PredType& UNIX_D32BE; + static const PredType& UNIX_D32LE; + static const PredType& UNIX_D64BE; + static const PredType& UNIX_D64LE; + + static const PredType& INTEL_I8; + static const PredType& INTEL_I16; + static const PredType& INTEL_I32; + static const PredType& INTEL_I64; + static const PredType& INTEL_U8; + static const PredType& INTEL_U16; + static const PredType& INTEL_U32; + static const PredType& INTEL_U64; + static const PredType& INTEL_B8; + static const PredType& INTEL_B16; + static const PredType& INTEL_B32; + static const PredType& INTEL_B64; + static const PredType& INTEL_F32; + static const PredType& INTEL_F64; + + static const PredType& ALPHA_I8; + static const PredType& ALPHA_I16; + static const PredType& ALPHA_I32; + static const PredType& ALPHA_I64; + static const PredType& ALPHA_U8; + static const PredType& ALPHA_U16; + static const PredType& ALPHA_U32; + static const PredType& ALPHA_U64; + static const PredType& ALPHA_B8; + static const PredType& ALPHA_B16; + static const PredType& ALPHA_B32; + static const PredType& ALPHA_B64; + static const PredType& ALPHA_F32; + static const PredType& ALPHA_F64; + + static const PredType& MIPS_I8; + static const PredType& MIPS_I16; + static const PredType& MIPS_I32; + static const PredType& MIPS_I64; + static const PredType& MIPS_U8; + static const PredType& MIPS_U16; + static const PredType& MIPS_U32; + static const PredType& MIPS_U64; + static const PredType& MIPS_B8; + static const PredType& MIPS_B16; + static const PredType& MIPS_B32; + static const PredType& MIPS_B64; + static const PredType& MIPS_F32; + static const PredType& MIPS_F64; + + static const PredType& NATIVE_CHAR; + static const PredType& NATIVE_SCHAR; + static const PredType& NATIVE_UCHAR; + static const PredType& NATIVE_SHORT; + static const PredType& NATIVE_USHORT; + static const PredType& NATIVE_INT; + static const PredType& NATIVE_UINT; + static const PredType& NATIVE_LONG; + static const PredType& NATIVE_ULONG; + static const PredType& NATIVE_LLONG; + static const PredType& NATIVE_ULLONG; + static const PredType& NATIVE_FLOAT; + static const PredType& NATIVE_DOUBLE; + static const PredType& NATIVE_LDOUBLE; + static const PredType& NATIVE_B8; + static const PredType& NATIVE_B16; + static const PredType& NATIVE_B32; + static const PredType& NATIVE_B64; + static const PredType& NATIVE_OPAQUE; + static const PredType& NATIVE_HSIZE; + static const PredType& NATIVE_HSSIZE; + static const PredType& NATIVE_HERR; + static const PredType& NATIVE_HBOOL; + + static const PredType& NATIVE_INT8; + static const PredType& NATIVE_UINT8; + static const PredType& NATIVE_INT16; + static const PredType& NATIVE_UINT16; + static const PredType& NATIVE_INT32; + static const PredType& NATIVE_UINT32; + static const PredType& NATIVE_INT64; + static const PredType& NATIVE_UINT64; // LEAST types #if H5_SIZEOF_INT_LEAST8_T != 0 - static const PredType& NATIVE_INT_LEAST8; + static const PredType& NATIVE_INT_LEAST8; #endif /* H5_SIZEOF_INT_LEAST8_T */ #if H5_SIZEOF_UINT_LEAST8_T != 0 - static const PredType& NATIVE_UINT_LEAST8; + static const PredType& NATIVE_UINT_LEAST8; #endif /* H5_SIZEOF_UINT_LEAST8_T */ #if H5_SIZEOF_INT_LEAST16_T != 0 - static const PredType& NATIVE_INT_LEAST16; + static const PredType& NATIVE_INT_LEAST16; #endif /* H5_SIZEOF_INT_LEAST16_T */ #if H5_SIZEOF_UINT_LEAST16_T != 0 - static const PredType& NATIVE_UINT_LEAST16; + static const PredType& NATIVE_UINT_LEAST16; #endif /* H5_SIZEOF_UINT_LEAST16_T */ #if H5_SIZEOF_INT_LEAST32_T != 0 - static const PredType& NATIVE_INT_LEAST32; + static const PredType& NATIVE_INT_LEAST32; #endif /* H5_SIZEOF_INT_LEAST32_T */ #if H5_SIZEOF_UINT_LEAST32_T != 0 - static const PredType& NATIVE_UINT_LEAST32; + static const PredType& NATIVE_UINT_LEAST32; #endif /* H5_SIZEOF_UINT_LEAST32_T */ #if H5_SIZEOF_INT_LEAST64_T != 0 - static const PredType& NATIVE_INT_LEAST64; + static const PredType& NATIVE_INT_LEAST64; #endif /* H5_SIZEOF_INT_LEAST64_T */ #if H5_SIZEOF_UINT_LEAST64_T != 0 - static const PredType& NATIVE_UINT_LEAST64; + static const PredType& NATIVE_UINT_LEAST64; #endif /* H5_SIZEOF_UINT_LEAST64_T */ // FAST types #if H5_SIZEOF_INT_FAST8_T != 0 - static const PredType& NATIVE_INT_FAST8; + static const PredType& NATIVE_INT_FAST8; #endif /* H5_SIZEOF_INT_FAST8_T */ #if H5_SIZEOF_UINT_FAST8_T != 0 - static const PredType& NATIVE_UINT_FAST8; + static const PredType& NATIVE_UINT_FAST8; #endif /* H5_SIZEOF_UINT_FAST8_T */ #if H5_SIZEOF_INT_FAST16_T != 0 - static const PredType& NATIVE_INT_FAST16; + static const PredType& NATIVE_INT_FAST16; #endif /* H5_SIZEOF_INT_FAST16_T */ #if H5_SIZEOF_UINT_FAST16_T != 0 - static const PredType& NATIVE_UINT_FAST16; + static const PredType& NATIVE_UINT_FAST16; #endif /* H5_SIZEOF_UINT_FAST16_T */ #if H5_SIZEOF_INT_FAST32_T != 0 - static const PredType& NATIVE_INT_FAST32; + static const PredType& NATIVE_INT_FAST32; #endif /* H5_SIZEOF_INT_FAST32_T */ #if H5_SIZEOF_UINT_FAST32_T != 0 - static const PredType& NATIVE_UINT_FAST32; + static const PredType& NATIVE_UINT_FAST32; #endif /* H5_SIZEOF_UINT_FAST32_T */ #if H5_SIZEOF_INT_FAST64_T != 0 - static const PredType& NATIVE_INT_FAST64; + static const PredType& NATIVE_INT_FAST64; #endif /* H5_SIZEOF_INT_FAST64_T */ #if H5_SIZEOF_UINT_FAST64_T != 0 - static const PredType& NATIVE_UINT_FAST64; + static const PredType& NATIVE_UINT_FAST64; #endif /* H5_SIZEOF_UINT_FAST64_T */ #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -242,11 +242,11 @@ class H5_DLLCPP PredType : public AtomType { static const PredType& PREDTYPE_CONST; // dummy constant protected: - // Default constructor - PredType(); + // Default constructor + PredType(); - // Creates a pre-defined type using an HDF5 pre-defined constant - PredType(const hid_t predtype_id); // used by the library only + // Creates a pre-defined type using an HDF5 pre-defined constant + PredType( const hid_t predtype_id ); // used by the library only private: // Activates the creation of the PredType global constants diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index c4176c2..f0eb847 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -21,7 +21,7 @@ #include -#include "H5private.h" // for HDmemset +#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -42,7 +42,7 @@ PropList* PropList::DEFAULT_ = 0; //-------------------------------------------------------------------------- // Function: PropList::getConstant -// Purpose Creates a PropList object representing the HDF5 constant +// Purpose: Creates a PropList object representing the HDF5 constant // H5P_DEFAULT, pointed to by PropList::DEFAULT_. // Exception H5::PropListIException // Description @@ -71,7 +71,7 @@ PropList* PropList::getConstant() //-------------------------------------------------------------------------- // Function: PropList::deleteConstants -// Purpose Deletes the constant object that PropList::DEFAULT_ points to. +// Purpose: Deletes the constant object that PropList::DEFAULT_ points to. // Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- void PropList::deleteConstants() @@ -81,24 +81,24 @@ void PropList::deleteConstants() } //-------------------------------------------------------------------------- -// Purpose Constant for default property. +// Purpose Constant for default property. //-------------------------------------------------------------------------- const PropList& PropList::DEFAULT = *getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Default constructor -///\brief Default constructor: creates a stub property list object. -// Programmer Binh-Minh Ribler - 2000 +// Function Default constructor +///\brief Default constructor: creates a stub property list object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PropList::PropList() : IdComponent(), id(H5P_DEFAULT) {} //-------------------------------------------------------------------------- -// Function: PropList copy constructor -///\brief Copy constructor -///\param original - IN: The original property list to copy -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList copy constructor +///\brief Copy constructor +///\param original - IN: The original property list to copy +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PropList::PropList(const PropList& original) : IdComponent(), id(original.id) { @@ -106,166 +106,166 @@ PropList::PropList(const PropList& original) : IdComponent(), id(original.id) } //-------------------------------------------------------------------------- -// Function: PropList overloaded constructor -///\brief Creates a property list using the id of an existing property. -///\param plist_id - IN: Id of the existing property list -///\exception H5::PropListIException +// Function: PropList overloaded constructor +///\brief Creates a property list using the id of an existing property. +///\param plist_id - IN: Id of the existing property list +///\exception H5::PropListIException // Description -// This function creates a new property list if a property -// class is provided or makes a copy of a property list if one -// is given. If the given id is anything else, then set this -// property's id to H5P_DEFAULT. -// Programmer Binh-Minh Ribler - 2000 +// This function creates a new property list if a property +// class is provided or makes a copy of a property list if one +// is given. If the given id is anything else, then set this +// property's id to H5P_DEFAULT. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -PropList::PropList(const hid_t plist_id) : IdComponent() +PropList::PropList( const hid_t plist_id ) : IdComponent() { if (plist_id <= 0) - id = H5P_DEFAULT; + id = H5P_DEFAULT; H5I_type_t id_type = H5Iget_type(plist_id); switch (id_type) { - case H5I_GENPROP_CLS: - // call C routine to create a new property from the given prop class - id = H5Pcreate(plist_id); - if (id < 0) - { - throw PropListIException("PropList constructor", "H5Pcreate failed"); - } - break; - case H5I_GENPROP_LST: - // call C routine to make a copy of the given property list - id = H5Pcopy(plist_id); - if (id < 0) - { - throw PropListIException("PropList constructor", "H5Pcopy failed"); - } - break; - default: - id = H5P_DEFAULT; - break; + case H5I_GENPROP_CLS: + // call C routine to create a new property from the given prop class + id = H5Pcreate(plist_id); + if( id < 0 ) + { + throw PropListIException("PropList constructor", "H5Pcreate failed"); + } + break; + case H5I_GENPROP_LST: + // call C routine to make a copy of the given property list + id = H5Pcopy(plist_id); + if( id < 0 ) + { + throw PropListIException("PropList constructor", "H5Pcopy failed"); + } + break; + default: + id = H5P_DEFAULT; + break; } } //-------------------------------------------------------------------------- -// Function: PropList::copy -///\brief Makes a copy of an existing property list. -///\param like_plist - IN: Reference to the existing property list -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList::copy +///\brief Makes a copy of an existing property list. +///\param like_plist - IN: Reference to the existing property list +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- -void PropList::copy(const PropList& like_plist) +void PropList::copy( const PropList& like_plist ) { // If this object is representing an hdf5 object, close it before // copying like_plist to it try { - close(); + close(); } catch (Exception& close_error) { - throw PropListIException(inMemFunc("copy"), close_error.getDetailMsg()); + throw PropListIException(inMemFunc("copy"), close_error.getDetailMsg()); } // call C routine to copy the property list - id = H5Pcopy(like_plist.getId()); - if (id < 0) - throw PropListIException(inMemFunc("copy"), "H5Pcopy failed"); + id = H5Pcopy( like_plist.getId() ); + if( id < 0 ) + throw PropListIException(inMemFunc("copy"), "H5Pcopy failed"); } //-------------------------------------------------------------------------- -// Function: PropList::operator= -///\brief Assignment operator. -///\param rhs - IN: Reference to the existing property list -///\return Reference to PropList instance -///\exception H5::PropListIException +// Function: PropList::operator= +///\brief Assignment operator. +///\param rhs - IN: Reference to the existing property list +///\return Reference to PropList instance +///\exception H5::PropListIException // Description -// Makes a copy of the property list on the right hand side -// and stores the new id in the left hand side object. -// Programmer Binh-Minh Ribler - 2000 +// Makes a copy of the property list on the right hand side +// and stores the new id in the left hand side object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -PropList& PropList::operator=(const PropList& rhs) +PropList& PropList::operator=( const PropList& rhs ) { if (this != &rhs) - copy(rhs); + copy(rhs); return(*this); } //-------------------------------------------------------------------------- -// Function: PropList::copyProp -///\brief Copies a property from this property list or class to another -///\param dest - IN: Destination property list or class -///\param name - IN: Name of the property to copy - \c char pointer -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: PropList::copyProp +///\brief Copies a property from this property list or class to another +///\param dest - IN: Destination property list or class +///\param name - IN: Name of the property to copy - \c char pointer +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- void PropList::copyProp(PropList& dest, const char *name) const { - hid_t dst_id = dest.getId(); - herr_t ret_value = H5Pcopy_prop(dst_id, id, name); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed"); - } + hid_t dst_id = dest.getId(); + herr_t ret_value = H5Pcopy_prop(dst_id, id, name); + if( ret_value < 0 ) + { + throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::copyProp -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param dest - IN: Destination property list or class -///\param name - IN: Name of the property to copy - \c H5std_string -// Programmer Binh-Minh Ribler - Jul, 2005 +// Function: PropList::copyProp +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param dest - IN: Destination property list or class +///\param name - IN: Name of the property to copy - \c H5std_string +// Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- -void PropList::copyProp(PropList& dest, const H5std_string& name) const +void PropList::copyProp( PropList& dest, const H5std_string& name ) const { - copyProp(dest, name.c_str()); + copyProp( dest, name.c_str()); } //-------------------------------------------------------------------------- -// Function: PropList::copyProp -///\brief Copies a property from one list or class to another - Obsolete -///\param dest - IN: Destination property list or class -///\param src - IN: Source property list or class -///\param name - IN: Name of the property to copy - \c char pointer -///\note This member function will be removed in the next release -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList::copyProp +///\brief Copies a property from one list or class to another - Obsolete +///\param dest - IN: Destination property list or class +///\param src - IN: Source property list or class +///\param name - IN: Name of the property to copy - \c char pointer +///\note This member function will be removed in the next release +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void PropList::copyProp(PropList& dest, PropList& src, const char *name) const +void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const { - hid_t dst_id = dest.getId(); - hid_t src_id = src.getId(); - herr_t ret_value = H5Pcopy_prop(dst_id, src_id, name); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed"); - } + hid_t dst_id = dest.getId(); + hid_t src_id = src.getId(); + herr_t ret_value = H5Pcopy_prop(dst_id, src_id, name); + if( ret_value < 0 ) + { + throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::copyProp -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. - Obsolete -///\param dest - IN: Destination property list or class -///\param src - IN: Source property list or class -///\param name - IN: Name of the property to copy - \c H5std_string -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList::copyProp +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. - Obsolete +///\param dest - IN: Destination property list or class +///\param src - IN: Source property list or class +///\param name - IN: Name of the property to copy - \c H5std_string +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void PropList::copyProp(PropList& dest, PropList& src, const H5std_string& name) const +void PropList::copyProp( PropList& dest, PropList& src, const H5std_string& name ) const { - copyProp(dest, src, name.c_str()); + copyProp( dest, src, name.c_str()); } //-------------------------------------------------------------------------- // Function: PropList::getId -///\brief Get the id of this property list -///\return Property list identifier +///\brief Get the id of this property list +///\return Property list identifier // Description: // Class hierarchy is revised to address bugzilla 1068. Class // AbstractDS and Attribute are moved out of H5Object. In @@ -275,7 +275,7 @@ void PropList::copyProp(PropList& dest, PropList& src, const H5std_string& name) //-------------------------------------------------------------------------- hid_t PropList::getId() const { - return(id); + return(id); } #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -307,441 +307,444 @@ void PropList::p_setId(const hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: PropList::close -///\brief Closes the property list if it is not a default one. +// Function: PropList::close +///\brief Closes the property list if it is not a default one. /// -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - Mar 9, 2005 +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- void PropList::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Pclose(id); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("close"), "H5Pclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Pclose( id ); + if( ret_value < 0 ) + { + throw PropListIException(inMemFunc("close"), "H5Pclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } //-------------------------------------------------------------------------- -// Function: PropList::getClass -///\brief Returns the class of this property list, i.e. \c H5P_FILE_CREATE... -///\return The property list class if it is not equal to \c H5P_ROOT -///\exception H5::PropListIException -// Programmer Binh-Minh Ribler - April, 2004 +// Function: PropList::getClass +///\brief Returns the class of this property list, i.e. \c H5P_FILE_CREATE... +///\return The property list class if it is not equal to \c H5P_ROOT +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- hid_t PropList::getClass() const { - hid_t plist_class = H5Pget_class(id); - if (plist_class == H5P_ROOT) - { - throw PropListIException(inMemFunc("getClass"), - "H5Pget_class failed - returned H5P_ROOT"); - } - return(plist_class); + hid_t plist_class = H5Pget_class( id ); + if( plist_class == H5P_ROOT ) + { + throw PropListIException(inMemFunc("getClass"), + "H5Pget_class failed - returned H5P_ROOT"); + } + return( plist_class ); } //-------------------------------------------------------------------------- -// Function: PropList::propExist -///\brief Queries the existence of a property in a property object. -///\param name - IN: Name of property to check for - \c char pointer -///\return true if the property exists in the property object, and -/// false, otherwise. -///\exception H5::PropListIException +// Function: PropList::propExist +///\brief Query the existance of a property in a property object. +///\param name - IN: Name of property to check for - \c char pointer +///\return true if the property exists in the property object, and +/// false, otherwise. +///\exception H5::PropListIException ///\par Description -/// This routine checks if a property exists within a property -/// list or class. +/// This routine checks if a property exists within a property +/// list or class. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -bool PropList::propExist(const char* name) const -{ - // Calls C routine H5Pexist to determine whether a property exists - // within a property list or class. It returns a positive value, 0, - // or a negative value - htri_t ret_value = H5Pexist(id, name); - if (ret_value > 0) - return true; - else if (ret_value == 0) - return false; - else // Raise exception when H5Pexist returns a negative value - { - throw PropListIException(inMemFunc("propExist"), "H5Pexist failed"); - } -} -//-------------------------------------------------------------------------- -// Function: PropList::propExist -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to check for - \c H5std_string +bool PropList::propExist(const char* name ) const +{ + // Calls C routine H5Pexist to determine whether a property exists + // within a property list or class. It returns a positive value, 0, + // or a negative value + htri_t ret_value = H5Pexist(id, name); + if( ret_value > 0 ) + return true; + else if( ret_value == 0 ) + return false; + else // Raise exception when H5Pexist returns a negative value + { + throw PropListIException(inMemFunc("propExist"), "H5Pexist failed"); + } +} +//-------------------------------------------------------------------------- +// Function: PropList::propExist +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to check for - \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -bool PropList::propExist(const H5std_string& name) const +bool PropList::propExist(const H5std_string& name ) const { - return(propExist( name.c_str())); + return( propExist( name.c_str()) ); } //-------------------------------------------------------------------------- -// Function: PropList::closeClass -///\brief Close a property list class. +// Function: PropList::closeClass +///\brief Close a property list class. /// -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// Releases memory and detaches a class from the property -/// list class hierarchy. +/// Releases memory and detaches a class from the property +/// list class hierarchy. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::closeClass() const { - herr_t ret_value = H5Pclose_class(id); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("closeClass"), "H5Pclose_class failed"); - } + herr_t ret_value = H5Pclose_class(id); + if( ret_value < 0 ) + { + throw PropListIException(inMemFunc("closeClass"), "H5Pclose_class failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::getProperty -///\brief Query the value of a property in a property list. -///\param name - IN: Name of property to query - \c char pointer -///\param value - OUT: Pointer to the buffer for the property value -///\exception H5::PropListIException +// Function: PropList::getProperty +///\brief Query the value of a property in a property list. +///\param name - IN: Name of property to query - \c char pointer +///\param value - OUT: Pointer to the buffer for the property value +///\exception H5::PropListIException ///\par Description -/// Retrieves a copy of the value for a property in a property -/// list. The property name must exist or this routine will -/// throw an exception. +/// Retrieves a copy of the value for a property in a property +/// list. The property name must exist or this routine will +/// throw an exception. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::getProperty(const char* name, void* value) const { - herr_t ret_value = H5Pget(id, name, value); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); - } + herr_t ret_value = H5Pget(id, name, value); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::getProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to query - \c char pointer -///\return The property that is a \c H5std_string. -///\exception H5::PropListIException +// Function: PropList::getProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to query - \c char pointer +///\return The property that is a \c H5std_string. +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5std_string PropList::getProperty(const char* name) const { - // Get property size first - size_t size = getPropSize(name); + // Get property size first + size_t size = getPropSize(name); - // Allocate buffer then get the property - char* prop_strg_C = new char[size+1]; // temporary C-string for C API - HDmemset(prop_strg_C, 0, size+1); // clear buffer + // Allocate buffer then get the property + char* prop_strg_C = new char[size+1]; // temporary C-string for C API + HDmemset(prop_strg_C, 0, size+1); // clear buffer - herr_t ret_value = H5Pget(id, name, prop_strg_C); // call C API + herr_t ret_value = H5Pget(id, name, prop_strg_C); // call C API - // Throw exception if H5Pget returns failure - if (ret_value < 0) - { + // Throw exception if H5Pget returns failure + if (ret_value < 0) + { delete []prop_strg_C; - throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); - } + throw PropListIException(inMemFunc("getProperty"), "H5Pget failed"); + } - // Return propety value as a string after deleting temp C-string - H5std_string prop_strg(prop_strg_C); - delete []prop_strg_C; - return (prop_strg); + // Return propety value as a string after deleting temp C-string + H5std_string prop_strg(prop_strg_C); + delete []prop_strg_C; + return (prop_strg); } //-------------------------------------------------------------------------- -// Function: PropList::getProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to query - \c H5std_string -///\param value - OUT: Pointer to the buffer for the property value +// Function: PropList::getProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to query - \c H5std_string +///\param value - OUT: Pointer to the buffer for the property value // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::getProperty(const H5std_string& name, void* value) const { - getProperty(name.c_str(), value); + getProperty(name.c_str(), value); } //-------------------------------------------------------------------------- -// Function: PropList::getProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to query - \c H5std_string -///\return The property that is a \c H5std_string. +// Function: PropList::getProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to query - \c H5std_string +///\return The property that is a \c H5std_string. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5std_string PropList::getProperty(const H5std_string& name) const { - return (getProperty(name.c_str())); + return (getProperty(name.c_str())); } //-------------------------------------------------------------------------- -// Function: PropList::getPropSize -///\brief Query the size of a property in a property list or class. -///\param name - IN: Name of property to query -///\return Size of the property -///\exception H5::PropListIException +// Function: PropList::getPropSize +///\brief Query the size of a property in a property list or class. +///\param name - IN: Name of property to query +///\return Size of the property +///\exception H5::PropListIException ///\par Description -/// This routine retrieves the size of a property's value -/// in bytes. Zero-sized properties are allowed and the return -/// value will be of 0. This function works for both property -/// lists and classes. +/// This routine retrieves the size of a property's value +/// in bytes. Zero-sized properties are allowed and the return +/// value will be of 0. This function works for both property +/// lists and classes. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t PropList::getPropSize(const char *name) const { - size_t prop_size; - herr_t ret_value = H5Pget_size(id, name, &prop_size); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("getPropSize"), "H5Pget_size failed"); - } - return(prop_size); + size_t prop_size; + herr_t ret_value = H5Pget_size(id, name, &prop_size); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("getPropSize"), "H5Pget_size failed"); + } + return(prop_size); } //-------------------------------------------------------------------------- -// Function: PropList::getPropSize -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to query - \c H5std_string +// Function: PropList::getPropSize +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to query - \c H5std_string /// // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t PropList::getPropSize(const H5std_string& name) const { - return (getPropSize(name.c_str())); + return (getPropSize(name.c_str())); } //-------------------------------------------------------------------------- -// Function: PropList::getClassName -///\brief Return the name of a generic property list class. -///\return A string containing the class name, if success, otherwise, -/// a NULL string. +// Function: PropList::getClassName +///\brief Return the name of a generic property list class. +///\return A string containing the class name, if success, otherwise, +/// a NULL string. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5std_string PropList::getClassName() const { - char* temp_str; - temp_str = H5Pget_class_name(id); - if (temp_str != NULL) - { - H5std_string class_name(temp_str); - H5free_memory(temp_str); - return(class_name); - } - else - return 0; + char* temp_str; + temp_str = H5Pget_class_name(id); // this API specified that temp_str must + // be freed. + + if (temp_str != NULL) + { + H5std_string class_name(temp_str); + H5free_memory(temp_str); + return(class_name); + } + else + return 0; } //-------------------------------------------------------------------------- -// Function: PropList::getNumProps -///\brief Returns the number of properties in this property list or class. -///\return Size of the property. -///\exception H5::PropListIException +// Function: PropList::getNumProps +///\brief Returns the number of properties in this property list or class. +///\return Size of the property. +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- size_t PropList::getNumProps() const { - size_t nprops; - herr_t ret_value = H5Pget_nprops (id, &nprops); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("getNumProps"), "H5Pget_nprops failed"); - } - return (nprops); + size_t nprops; + herr_t ret_value = H5Pget_nprops (id, &nprops); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("getNumProps"), "H5Pget_nprops failed"); + } + return (nprops); } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief Set a property's value in a property list. -///\param name - IN: Name of property to set - \c char pointer -///\param value - IN: Void pointer to the value for the property -///\exception H5::PropListIException +// Function: PropList::setProperty +///\brief Set a property's value in a property list. +///\param name - IN: Name of property to set - \c char pointer +///\param value - IN: Void pointer to the value for the property +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, void* value) const { - herr_t ret_value = H5Pset(id, name, value); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); - } + herr_t ret_value = H5Pset(id, name, value); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to set - \c char pointer -///\param charptr - IN: Char pointer to the value for the property +// Function: PropList::setProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to set - \c char pointer +///\param charptr - IN: Char pointer to the value for the property // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, const char* charptr) const { - herr_t ret_value = H5Pset(id, name, (void*)charptr); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); - } + herr_t ret_value = H5Pset(id, name, (void*)charptr); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to set - \c char pointer -///\param strg - IN: Value for the property is a \c H5std_string +// Function: PropList::setProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to set - \c char pointer +///\param strg - IN: Value for the property is a \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, H5std_string& strg) const { - setProperty(name, strg.c_str()); + setProperty(name, strg.c_str()); } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to set - \c H5std_string -///\param value - IN: Void pointer to the value for the property +// Function: PropList::setProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to set - \c H5std_string +///\param value - IN: Void pointer to the value for the property // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const H5std_string& name, void* value) const { - setProperty(name.c_str(), value); + setProperty(name.c_str(), value); } //-------------------------------------------------------------------------- -// Function: PropList::setProperty -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to set - \c H5std_string -///\param strg - IN: Value for the property is a \c H5std_string +// Function: PropList::setProperty +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to set - \c H5std_string +///\param strg - IN: Value for the property is a \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const H5std_string& name, H5std_string& strg) const { - setProperty(name.c_str(), strg.c_str()); + setProperty(name.c_str(), strg.c_str()); } //-------------------------------------------------------------------------- -// Function: PropList::isAClass -///\brief Determines whether a property list is a certain class. -///\param prop_class - IN: Property class to query -///\return true if the property list is a member of the property list -/// class, and false, otherwise. -///\exception H5::PropListIException +// Function: PropList::isAClass +///\brief Determines whether a property list is a certain class. +///\param prop_class - IN: Property class to query +///\return true if the property list is a member of the property list +/// class, and false, otherwise. +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- bool PropList::isAClass(const PropList& prop_class) const { - htri_t ret_value = H5Pisa_class(id, prop_class.getId()); - if (ret_value > 0) - return true; - else if (ret_value == 0) - return false; - else // Raise exception when H5Pisa_class returns a negative value - { - throw PropListIException(inMemFunc("isAClass"), "H5Pisa_class failed"); - } + htri_t ret_value = H5Pisa_class(id, prop_class.getId()); + if( ret_value > 0 ) + return true; + else if( ret_value == 0 ) + return false; + else // Raise exception when H5Pisa_class returns a negative value + { + throw PropListIException(inMemFunc("isAClass"), "H5Pisa_class failed"); + } + } //-------------------------------------------------------------------------- -// Function: PropList::removeProp -///\brief Removes a property from a property list. -///\param name - IN: Name of property to remove - \c char pointer -///\exception H5::PropListIException +// Function: PropList::removeProp +///\brief Removes a property from a property list. +///\param name - IN: Name of property to remove - \c char pointer +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::removeProp(const char *name) const { - herr_t ret_value = H5Premove(id, name); - if (ret_value < 0) - { - throw PropListIException(inMemFunc("removeProp"), "H5Premove failed"); - } + herr_t ret_value = H5Premove(id, name); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("removeProp"), "H5Premove failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::removeProp -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it -/// accepts. -///\param name - IN: Name of property to remove - \c H5std_string +// Function: PropList::removeProp +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function only in what arguments it +/// accepts. +///\param name - IN: Name of property to remove - \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::removeProp(const H5std_string& name) const { - removeProp(name.c_str()); + removeProp(name.c_str()); } //-------------------------------------------------------------------------- -// Function: PropList::operator== -///\brief Compares this property list or class against the given list or class. -///\param rhs - IN: Reference to the property list to compare -///\return true if the property lists or classes are equal, and -/// false, otherwise. -///\exception H5::PropListIException +// Function: PropList::operator== +///\brief Compares this property list or class against the given list or class. +///\param rhs - IN: Reference to the property list to compare +///\return true if the property lists or classes are equal, and +/// false, otherwise. +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- bool PropList::operator==(const PropList& rhs) const { - htri_t ret_value = H5Pequal(id, rhs.getId()); - if (ret_value > 0) - return true; - else if (ret_value == 0) - return false; - else // Raise exception when H5Pequal returns a negative value - { - throw PropListIException(inMemFunc("operator=="), "H5Pequal failed"); - } + htri_t ret_value = H5Pequal(id, rhs.getId()); + if( ret_value > 0 ) + return true; + else if( ret_value == 0 ) + return false; + else // Raise exception when H5Pequal returns a negative value + { + throw PropListIException(inMemFunc("operator=="), "H5Pequal failed"); + } } //-------------------------------------------------------------------------- -// Function: PropList::getClassParent -///\brief Returns the parent class of a generic property class -///\return The parent class of a property class -///\exception H5::PropListIException +// Function: PropList::getClassParent +///\brief Returns the parent class of a generic property class +///\return The parent class of a property class +///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- PropList PropList::getClassParent() const { - hid_t class_id = H5Pget_class_parent(id); - if (class_id < 0) - { - throw PropListIException(inMemFunc("getClassParent"), "H5Pget_class_parent failed"); - } - PropList pclass(class_id); - return(pclass); + hid_t class_id = H5Pget_class_parent(id); + if (class_id < 0) + { + throw PropListIException(inMemFunc("getClassParent"), "H5Pget_class_parent failed"); + } + PropList pclass(class_id); + return(pclass); } //-------------------------------------------------------------------------- -// Function: PropList destructor -///\brief Properly terminates access to this property list. -// Programmer Binh-Minh Ribler - 2000 +// Function: PropList destructor +///\brief Properly terminates access to this property list. +// Programmer Binh-Minh Ribler - 2000 // Modification -// - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 -// - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- PropList::~PropList() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "PropList::~PropList - " << close_error.getDetailMsg() << endl; + cerr << "PropList::~PropList - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 3977774..faaf68d 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -28,111 +28,111 @@ namespace H5 { */ class H5_DLLCPP PropList : public IdComponent { public: - ///\brief Default property list + ///\brief Default property list static const PropList& DEFAULT; - // Creates a property list of a given type or creates a copy of an - // existing property list giving the property list id. - PropList(const hid_t plist_id); + // Creates a property list of a given type or creates a copy of an + // existing property list giving the property list id. + PropList(const hid_t plist_id); - // Make a copy of the given property list using assignment statement - PropList& operator=(const PropList& rhs); + // Make a copy of the given property list using assignment statement + PropList& operator=( const PropList& rhs ); - // Compares this property list or class against the given list or class. - bool operator==(const PropList& rhs) const; + // Compares this property list or class against the given list or class. + bool operator==(const PropList& rhs) const; - // Close this property list. - virtual void close(); + // Close this property list. + virtual void close(); - // Close a property list class. - void closeClass() const; + // Close a property list class. + void closeClass() const; - // Makes a copy of the given property list. - void copy(const PropList& like_plist); + // Makes a copy of the given property list. + void copy( const PropList& like_plist ); - // Copies a property from this property list or class to another - void copyProp(PropList& dest, const char* name) const; - void copyProp(PropList& dest, const H5std_string& name) const; + // Copies a property from this property list or class to another + void copyProp( PropList& dest, const char* name) const; + void copyProp( PropList& dest, const H5std_string& name) const; - // Copies a property from one property list or property class to another - void copyProp(PropList& dest, PropList& src, const char* name) const; - void copyProp(PropList& dest, PropList& src, const H5std_string& name) const; + // Copies a property from one property list or property class to another + void copyProp( PropList& dest, PropList& src, const char* name) const; + void copyProp( PropList& dest, PropList& src, const H5std_string& name) const; - // Gets the class of this property list, i.e. H5P_FILE_CREATE, - // H5P_FILE_ACCESS, ... - hid_t getClass() const; + // Gets the class of this property list, i.e. H5P_FILE_CREATE, + // H5P_FILE_ACCESS, ... + hid_t getClass() const; - // Return the name of a generic property list class. - H5std_string getClassName() const; + // Return the name of a generic property list class. + H5std_string getClassName() const; - // Returns the parent class of a generic property class. - PropList getClassParent() const; + // Returns the parent class of a generic property class. + PropList getClassParent() const; - // Returns the number of properties in this property list or class. - size_t getNumProps() const; + // Returns the number of properties in this property list or class. + size_t getNumProps() const; - // Query the value of a property in a property list. - void getProperty(const char* name, void* value) const; - void getProperty(const H5std_string& name, void* value) const; - H5std_string getProperty(const char* name) const; - H5std_string getProperty(const H5std_string& name) const; + // Query the value of a property in a property list. + void getProperty(const char* name, void* value) const; + void getProperty(const H5std_string& name, void* value) const; + H5std_string getProperty(const char* name) const; + H5std_string getProperty(const H5std_string& name) const; - // Set a property's value in a property list. - void setProperty(const char* name, void* value) const; - void setProperty(const char* name, const char* charptr) const; - void setProperty(const char* name, H5std_string& strg) const; - void setProperty(const H5std_string& name, void* value) const; - void setProperty(const H5std_string& name, H5std_string& strg) const; + // Set a property's value in a property list. + void setProperty(const char* name, void* value) const; + void setProperty(const char* name, const char* charptr) const; + void setProperty(const char* name, H5std_string& strg) const; + void setProperty(const H5std_string& name, void* value) const; + void setProperty(const H5std_string& name, H5std_string& strg) const; - // Query the size of a property in a property list or class. - size_t getPropSize(const char *name) const; - size_t getPropSize(const H5std_string& name) const; + // Query the size of a property in a property list or class. + size_t getPropSize(const char *name) const; + size_t getPropSize(const H5std_string& name) const; - // Determines whether a property list is a certain class. - bool isAClass(const PropList& prop_class) const; + // Determines whether a property list is a certain class. + bool isAClass(const PropList& prop_class) const; - /// Query the existance of a property in a property object. - bool propExist(const char* name) const; - bool propExist(const H5std_string& name) const; + /// Query the existance of a property in a property object. + bool propExist(const char* name) const; + bool propExist(const H5std_string& name) const; - // Removes a property from a property list. - void removeProp(const char *name) const; - void removeProp(const H5std_string& name) const; + // Removes a property from a property list. + void removeProp(const char *name) const; + void removeProp(const H5std_string& name) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("PropList"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("PropList"); } - // Default constructor: creates a stub PropList object. - PropList(); + // Default constructor: creates a stub PropList object. + PropList(); - // Copy constructor: creates a copy of a PropList object. - PropList(const PropList& original); + // Copy constructor: creates a copy of a PropList object. + PropList(const PropList& original); - // Gets the property list id. - virtual hid_t getId() const; + // Gets the property list id. + virtual hid_t getId() const; - // Destructor: properly terminates access to this property list. - virtual ~PropList(); + // Destructor: properly terminates access to this property list. + virtual ~PropList(); #ifndef DOXYGEN_SHOULD_SKIP_THIS - // Deletes the PropList global constant - static void deleteConstants(); + // Deletes the PropList global constant + static void deleteConstants(); protected: - hid_t id; // HDF5 property list id + hid_t id; // HDF5 property list id - // Sets the property list id. - virtual void p_setId(const hid_t new_id); + // Sets the property list id. + virtual void p_setId(const hid_t new_id); private: - static PropList* DEFAULT_; + static PropList* DEFAULT_; - // Dynamically allocates the PropList global constant - static PropList* getConstant(); + // Dynamically allocates the PropList global constant + static PropList* getConstant(); - // Friend function to set PropList id. For library use only. - friend void f_PropList_setId(PropList* plist, hid_t new_id); + // Friend function to set PropList id. For library use only. + friend void f_PropList_setId(PropList* plist, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS }; diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 54981ab..50c9e45 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -36,247 +36,249 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: StrType default constructor -///\brief Default constructor: Creates a stub string datatype -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType default constructor +///\brief Default constructor: Creates a stub string datatype +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::StrType() : AtomType() {} //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Creates a string datatype using a predefined type. -///\param pred_type - IN: Predefined datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType overloaded constructor +///\brief Creates a string datatype using a predefined type. +///\param pred_type - IN: Predefined datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType::StrType(const PredType& pred_type) : AtomType() +StrType::StrType( const PredType& pred_type ) : AtomType() { - // use DataType::copy to make a copy of this predefined type - copy(pred_type); + // use DataType::copy to make a copy of this predefined type + copy( pred_type ); } //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -// Purpose Creates a string datatype with a specified length -// Param pred_type - IN: String predefined type to replicate. -// Param size - IN: Length of the new string type -// Exception H5::DataTypeIException +// Function: StrType overloaded constructor +// Purpose Creates a string datatype with a specified length +// Param pred_type - IN: String predefined type to replicate. +// Param size - IN: Length of the new string type +// Exception H5::DataTypeIException // Description -// The 1st argument could have been skipped, but this -// constructor will collide with the one that takes an -// existing id. +// The 1st argument could have been skipped, but this +// constructor will collide with the one that takes an +// existing id. // -// Update: replacing the 1st argument with a dummy 0 to -// avoid the clashing problem, that doesn't eliminate the -// the 1st argument but it's simpler for the user to type -// a '0' than PredType::C_S1. - Dec 2, 2005 +// Update: replacing the 1st argument with a dummy 0 to +// avoid the clashing problem, that doesn't eliminate the +// the 1st argument but it's simpler for the user to type +// a '0' than PredType::C_S1. - Dec 2, 2005 // Note -// The use of this constructor can be shortened by using -// its overloaded below as StrType(0, size). -// Programmer Binh-Minh Ribler - 2000 +// The use of this constructor can be shortened by using +// its overloaded below as StrType(0, size). +// Programmer Binh-Minh Ribler - 2000 // Modification -// Planned for removal. -BMR, 2005/12/02 -// Removed from documentation. -BMR, 2016/03/07 +// Planned for removal. -BMR, 2005/12/02 +// Removed from documentation. -BMR, 2016/03/07 //-------------------------------------------------------------------------- -StrType::StrType(const PredType& pred_type, const size_t& size) : AtomType() +StrType::StrType( const PredType& pred_type, const size_t& size ) : AtomType() { - // use DataType::copy to make a copy of the string predefined type - // then set its length - copy(pred_type); - setSize(size); + // use DataType::copy to make a copy of the string predefined type + // then set its length + copy(pred_type); + setSize(size); } //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Creates a string datatype with a specified length -///\param dummy - IN: To simplify calling the previous constructor -/// and avoid prototype clash with another constructor -///\param size - IN: Length of the new string type -///\exception H5::DataTypeIException +// Function: StrType overloaded constructor +///\brief Creates a string datatype with a specified length +///\param dummy - IN: To simplify calling the previous constructor +/// and avoid prototype clash with another constructor +///\param size - IN: Length of the new string type +///\exception H5::DataTypeIException ///\par Description -/// The 1st argument is just a dummy to simplify calling the -/// previous constructor, such as: -/// StrType atype(0, size) instead of -/// StrType atype(PredType::C_S1, size) +/// The 1st argument is just a dummy to simplify calling the +/// previous constructor, such as: +/// StrType atype(0, size) instead of +/// StrType atype(PredType::C_S1, size) // Note -// This constructor replaced the previous one. -// Programmer Binh-Minh Ribler - Nov 28, 2005 +// This constructor replaced the previous one. +// Programmer Binh-Minh Ribler - Nov 28, 2005 //-------------------------------------------------------------------------- -StrType::StrType(const int dummy, const size_t& size) : AtomType() +StrType::StrType( const int dummy, const size_t& size ) : AtomType() { - // use DataType::copy to make a copy of the string predefined type - // then set its length - copy(PredType::C_S1); - setSize(size); + // use DataType::copy to make a copy of the string predefined type + // then set its length + copy(PredType::C_S1); + setSize(size); } //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Creates an StrType object using the id of an existing datatype. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType overloaded constructor +///\brief Creates an StrType object using the id of an existing datatype. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType::StrType(const hid_t existing_id) : AtomType( existing_id ) {} +StrType::StrType( const hid_t existing_id ) : AtomType( existing_id ) {} //-------------------------------------------------------------------------- -// Function: StrType copy constructor -///\brief Copy constructor: makes a copy of the original StrType object. -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType copy constructor +///\brief Copy constructor: makes a copy of the original StrType object. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType::StrType(const StrType& original) : AtomType ( original ) {} +StrType::StrType( const StrType& original ) : AtomType ( original ) {} //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Gets the string datatype of the specified dataset -///\param dataset - IN: Dataset that this string datatype associates with -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType overloaded constructor +///\brief Gets the string datatype of the specified dataset +///\param dataset - IN: Dataset that this string datatype associates with +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -StrType::StrType(const DataSet& dataset) : AtomType () +StrType::StrType( const DataSet& dataset ) : AtomType () { - // Calls C function H5Dget_type to get the id of the datatype - id = H5Dget_type(dataset.getId()); + // Calls C function H5Dget_type to get the id of the datatype + id = H5Dget_type( dataset.getId() ); - if (id < 0) - { - throw DataSetIException("StrType constructor", "H5Dget_type failed"); - } + if( id < 0 ) + { + throw DataSetIException("StrType constructor", "H5Dget_type failed"); + } } //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Creates an StrType instance by opening an HDF5 string datatype -/// given its name, provided as a C character string. -///\param dtype_name - IN: String type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: StrType overloaded constructor +///\brief Creates an StrType instance by opening an HDF5 string datatype +/// given its name, provided as a C character string. +///\param dtype_name - IN: String type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openStrType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openStrType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- StrType::StrType(const H5Location& loc, const char *dtype_name) : AtomType() { - id = p_opentype(loc, dtype_name); + id = p_opentype(loc, dtype_name); } //-------------------------------------------------------------------------- -// Function: StrType overloaded constructor -///\brief Creates an StrType instance by opening an HDF5 string datatype -/// given its name, provided as an \c H5std_string. -///\param dtype_name - IN: String type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: StrType overloaded constructor +///\brief Creates an StrType instance by opening an HDF5 string datatype +/// given its name, provided as an \c H5std_string. +///\param dtype_name - IN: String type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openStrType(const H5std_string&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openStrType(const H5std_string&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- StrType::StrType(const H5Location& loc, const H5std_string& dtype_name) : AtomType() { - id = p_opentype(loc, dtype_name.c_str()); + id = p_opentype(loc, dtype_name.c_str()); } //-------------------------------------------------------------------------- -// Function: StrType::getCset -///\brief Retrieves the character set type of this string datatype. -///\return Character set type, which can be: -/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. +// Function: StrType::getCset +///\brief Retrieves the character set type of this string datatype. +///\return Character set type, which can be: +/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. ///\note -/// ASCII and UTF-8 Unicode are the only currently supported character -/// encodings. Extended ASCII encodings (for example, ISO 8859) are not -/// supported. This encoding policy is not enforced by the HDF5 Library. -/// Using encodings other than ASCII and UTF-8 can lead to compatibility -/// and usability problems. See the C API entry H5Pset_char_encoding for -/// more information. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +/// ASCII and UTF-8 Unicode are the only currently supported character +/// encodings. Extended ASCII encodings (for example, ISO 8859) are not +/// supported. This encoding policy is not enforced by the HDF5 Library. +/// Using encodings other than ASCII and UTF-8 can lead to compatibility +/// and usability problems. See the C API entry H5Pset_char_encoding for +/// more information. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_cset_t StrType::getCset() const { - H5T_cset_t cset = H5Tget_cset(id); + H5T_cset_t cset = H5Tget_cset( id ); - // Returns a valid character set type if successful - if (cset == H5T_CSET_ERROR) - { - throw DataTypeIException("StrType::getCset", "H5Tget_cset failed"); - } - return(cset); + // Returns a valid character set type if successful + if( cset == H5T_CSET_ERROR ) + { + throw DataTypeIException("StrType::getCset", "H5Tget_cset failed"); + } + return( cset ); } //-------------------------------------------------------------------------- -// Function: StrType::setCset -///\brief Sets character set to be used. -///\param cset - IN: character set type, which can be: -/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. +// Function: StrType::setCset +///\brief Sets character set to be used. +///\param cset - IN: character set type, which can be: +/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. ///\note -/// ASCII and UTF-8 Unicode are the only currently supported character -/// encodings. Extended ASCII encodings (for example, ISO 8859) are not -/// supported. This encoding policy is not enforced by the HDF5 Library. -/// Using encodings other than ASCII and UTF-8 can lead to compatibility -/// and usability problems. See the C API entry H5Pset_char_encoding for -/// more information. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +/// ASCII and UTF-8 Unicode are the only currently supported character +/// encodings. Extended ASCII encodings (for example, ISO 8859) are not +/// supported. This encoding policy is not enforced by the HDF5 Library. +/// Using encodings other than ASCII and UTF-8 can lead to compatibility +/// and usability problems. See the C API entry H5Pset_char_encoding for +/// more information. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void StrType::setCset(H5T_cset_t cset) const +void StrType::setCset( H5T_cset_t cset ) const { - herr_t ret_value = H5Tset_cset(id, cset); - if (ret_value < 0) - { - throw DataTypeIException("StrType::setCset", "H5Tset_cset failed"); - } + herr_t ret_value = H5Tset_cset( id, cset ); + + if( ret_value < 0 ) + { + throw DataTypeIException("StrType::setCset", "H5Tset_cset failed"); + } } //-------------------------------------------------------------------------- -// Function: StrType::getStrpad -///\brief Retrieves the storage mechanism for of this string datatype. -///\return String storage mechanism, which can be: -/// \li \c H5T_STR_NULLTERM (0) - Null terminate (as C does) -/// \li \c H5T_STR_NULLPAD (0) - Pad with zeros -/// \li \c H5T_STR_SPACEPAD (0) - pad with spaces (as FORTRAN does) -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType::getStrpad +///\brief Retrieves the storage mechanism for of this string datatype. +///\return String storage mechanism, which can be: +/// \li \c H5T_STR_NULLTERM (0) - Null terminate (as C does) +/// \li \c H5T_STR_NULLPAD (0) - Pad with zeros +/// \li \c H5T_STR_SPACEPAD (0) - pad with spaces (as FORTRAN does) +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5T_str_t StrType::getStrpad() const { - H5T_str_t strpad = H5Tget_strpad(id); + H5T_str_t strpad = H5Tget_strpad( id ); - // Returns a valid string padding type if successful - if (strpad == H5T_STR_ERROR) - { - throw DataTypeIException("StrType::getStrpad", - "H5Tget_strpad failed - returned H5T_STR_ERROR"); - } - return(strpad); + // Returns a valid string padding type if successful + if( strpad == H5T_STR_ERROR ) + { + throw DataTypeIException("StrType::getStrpad", + "H5Tget_strpad failed - returned H5T_STR_ERROR"); + } + return( strpad ); } //-------------------------------------------------------------------------- -// Function: StrType::setStrpad -///\brief Defines the storage mechanism for this string datatype. -///\param strpad - IN: String padding type -///\exception H5::DataTypeIException +// Function: StrType::setStrpad +///\brief Defines the storage mechanism for this string datatype. +///\param strpad - IN: String padding type +///\exception H5::DataTypeIException ///\par Description -/// For detail, please refer to the C layer Reference Manual at: +/// For detail, please refer to the C layer Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetStrpad -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void StrType::setStrpad(H5T_str_t strpad) const +void StrType::setStrpad( H5T_str_t strpad ) const { - herr_t ret_value = H5Tset_strpad(id, strpad); - if (ret_value < 0) - { - throw DataTypeIException("StrType::setStrpad", "H5Tset_strpad failed"); - } + herr_t ret_value = H5Tset_strpad( id, strpad ); + + if( ret_value < 0 ) + { + throw DataTypeIException("StrType::setStrpad", "H5Tset_strpad failed"); + } } //-------------------------------------------------------------------------- -// Function: StrType destructor -///\brief Properly terminates access to this string datatype. -// Programmer Binh-Minh Ribler - 2000 +// Function: StrType destructor +///\brief Properly terminates access to this string datatype. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::~StrType() {} diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index 3272ad3..b920a3b 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -27,48 +27,48 @@ namespace H5 { */ class H5_DLLCPP StrType : public AtomType { public: - // Creates a string type using a predefined type - StrType(const PredType& pred_type); + // Creates a string type using a predefined type + StrType(const PredType& pred_type); - // Creates a string type with specified length - may be obsolete - StrType(const PredType& pred_type, const size_t& size); + // Creates a string type with specified length - may be obsolete + StrType(const PredType& pred_type, const size_t& size); - // Creates a string type with specified length - StrType(const int dummy, const size_t& size); + // Creates a string type with specified length + StrType(const int dummy, const size_t& size); // Gets the string datatype of the specified dataset - StrType(const DataSet& dataset); + StrType(const DataSet& dataset); - // Constructors that open an HDF5 string datatype, given a location. - StrType(const H5Location& loc, const char* name); - StrType(const H5Location& loc, const H5std_string& name); + // Constructors that open an HDF5 string datatype, given a location. + StrType(const H5Location& loc, const char* name); + StrType(const H5Location& loc, const H5std_string& name); - // Retrieves the character set type of this string datatype. - H5T_cset_t getCset() const; + // Retrieves the character set type of this string datatype. + H5T_cset_t getCset() const; - // Sets character set to be used. - void setCset(H5T_cset_t cset) const; + // Sets character set to be used. + void setCset(H5T_cset_t cset) const; - // Retrieves the string padding method for this string datatype. - H5T_str_t getStrpad() const; + // Retrieves the string padding method for this string datatype. + H5T_str_t getStrpad() const; - // Defines the storage mechanism for character strings. - void setStrpad(H5T_str_t strpad) const; + // Defines the storage mechanism for character strings. + void setStrpad(H5T_str_t strpad) const; - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("StrType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("StrType"); } - // default constructor - StrType(); + // default constructor + StrType(); - // Creates a string datatype using an existing id - StrType(const hid_t existing_id); + // Creates a string datatype using an existing id + StrType(const hid_t existing_id); - // Copy constructor - makes a copy of the original object - StrType(const StrType& original); + // Copy constructor - makes a copy of the original object + StrType(const StrType& original); - // Noop destructor. - virtual ~StrType(); + // Noop destructor. + virtual ~StrType(); }; } #endif // __H5StrType_H diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 7f50b9a..5ecc39b 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -30,88 +30,88 @@ namespace H5 { //-------------------------------------------------------------------------- -// Function: VarLenType default constructor -///\brief Default constructor: Creates a stub variable-length datatype. +// Function: VarLenType default constructor +///\brief Default constructor: Creates a stub variable-length datatype. //-------------------------------------------------------------------------- VarLenType::VarLenType() : DataType() {} //-------------------------------------------------------------------------- -// Function: VarLenType overloaded constructor -///\brief Creates an VarLenType object using an existing id. -///\param existing_id - IN: Id of an existing datatype -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - May, 2004 +// Function: VarLenType overloaded constructor +///\brief Creates an VarLenType object using an existing id. +///\param existing_id - IN: Id of an existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::VarLenType(const hid_t existing_id) : DataType(existing_id) {} //-------------------------------------------------------------------------- -// Function: VarLenType copy constructor -///\brief Copy constructor: makes a copy of the original VarLenType object. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: VarLenType copy constructor +///\brief Copy constructor: makes a copy of the original VarLenType object. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::VarLenType(const VarLenType& original) : DataType(original) {} //-------------------------------------------------------------------------- -// Function: VarLenType overloaded constructor -///\brief Creates a new variable-length datatype based on the specified -/// \a base_type. -///\param base_type - IN: Pointer to existing datatype -///\exception H5::DataTypeIException +// Function: VarLenType overloaded constructor +///\brief Creates a new variable-length datatype based on the specified +/// \a base_type. +///\param base_type - IN: Pointer to existing datatype +///\exception H5::DataTypeIException // Description -// DataType passed by pointer to avoid clashing with copy -// constructor. -// Programmer Binh-Minh Ribler - May, 2004 +// DataType passed by pointer to avoid clashing with copy +// constructor. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::VarLenType(const DataType* base_type) : DataType() { - id = H5Tvlen_create(base_type->getId()); - if (id < 0) - { - throw DataTypeIException("VarLenType constructor", + id = H5Tvlen_create(base_type->getId()); + if (id < 0) + { + throw DataTypeIException("VarLenType constructor", "H5Tvlen_create returns negative value"); - } + } } //-------------------------------------------------------------------------- -// Function: VarLenType overloaded constructor -///\brief Creates an VarLenType instance by opening an HDF5 variable -/// length datatype given its name, provided as a C char*. -///\param dtype_name - IN: Variable length type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: VarLenType overloaded constructor +///\brief Creates an VarLenType instance by opening an HDF5 variable +/// length datatype given its name, provided as a C char*. +///\param dtype_name - IN: Variable length type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openVarLenType(const char*) to -// improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openVarLenType(const char*) to +// improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- VarLenType::VarLenType(const H5Location& loc, const char *dtype_name) : DataType() { - id = p_opentype(loc, dtype_name); + id = p_opentype(loc, dtype_name); } //-------------------------------------------------------------------------- -// Function: VarLenType overloaded constructor -///\brief Creates an VarLenType instance by opening an HDF5 variable -/// length datatype given its name, provided as an \c H5std_string. -///\param dtype_name - IN: Variable length type name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 +// Function: VarLenType overloaded constructor +///\brief Creates an VarLenType instance by opening an HDF5 variable +/// length datatype given its name, provided as an \c H5std_string. +///\param dtype_name - IN: Variable length type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the -// existing function CommonFG::openVarLenType(const H5std_string&) -// to improve usability. -// -BMR, Dec 2016 +// In 1.10.1, this constructor was introduced and will replace the +// existing function CommonFG::openVarLenType(const H5std_string&) +// to improve usability. +// -BMR, Dec 2016 //-------------------------------------------------------------------------- VarLenType::VarLenType(const H5Location& loc, const H5std_string& dtype_name) : DataType() { - id = p_opentype(loc, dtype_name.c_str()); + id = p_opentype(loc, dtype_name.c_str()); } //-------------------------------------------------------------------------- -// Function: VarLenType destructor -///\brief Properly terminates access to this datatype. -// Programmer Binh-Minh Ribler - May, 2004 +// Function: VarLenType destructor +///\brief Properly terminates access to this datatype. +// Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::~VarLenType() {} diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index a93f44d..af4f7b7 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -27,28 +27,28 @@ namespace H5 { */ class H5_DLLCPP VarLenType : public DataType { public: - // Constructor that creates a variable-length datatype based - // on the specified base type. - VarLenType(const DataType* base_type); + // Constructor that creates a variable-length datatype based + // on the specified base type. + VarLenType(const DataType* base_type); - ///\brief Returns this class name. - virtual H5std_string fromClass () const { return("VarLenType"); } + ///\brief Returns this class name. + virtual H5std_string fromClass () const { return("VarLenType"); } - // Copy constructor: makes copy of the original object. - VarLenType(const VarLenType& original); + // Copy constructor: makes copy of the original object. + VarLenType( const VarLenType& original ); - // Constructor that takes an existing id - VarLenType(const hid_t existing_id); + // Constructor that takes an existing id + VarLenType( const hid_t existing_id ); - // Constructors that open a variable-length datatype, given a location. - VarLenType(const H5Location& loc, const char* name); - VarLenType(const H5Location& loc, const H5std_string& name); + // Constructors that open a variable-length datatype, given a location. + VarLenType(const H5Location& loc, const char* name); + VarLenType(const H5Location& loc, const H5std_string& name); - // Noop destructor - virtual ~VarLenType(); + // Noop destructor + virtual ~VarLenType(); - // Default constructor - VarLenType(); + // Default constructor + VarLenType(); }; } #endif // __H5VarLenType_H diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 65815f9..75ea500 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_CPP_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index d23a80b..9bcc706 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -20,20 +20,7 @@ add_test ( titerate.h5 ) -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME CPP_testhdf5 COMMAND $) -else () - add_test (NAME CPP_testhdf5 COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=cpp_testhdf5.txt" - #-D "TEST_REFERENCE=cpp_testhdf5.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () +add_test (NAME CPP_testhdf5 COMMAND $) set_tests_properties (CPP_testhdf5 PROPERTIES DEPENDS CPP_testhdf5-clear-objects) if (HDF5_TEST_VFD) @@ -49,9 +36,9 @@ if (HDF5_TEST_VFD) if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) - endif () + endif (DIRECT_VFD) - macro (ADD_VFD_TEST vfdname resultcode) + MACRO (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}") add_test ( @@ -79,12 +66,12 @@ if (HDF5_TEST_VFD) ) set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects) set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT 30) - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - endforeach () + endforeach (vfd ${VFD_LIST}) -endif () +endif (HDF5_TEST_VFD) diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 48a0c4d..8752744 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -16,12 +16,12 @@ /***************************************************************************** FILE dsets.cpp - HDF5 C++ testing the functionalities associated with the - C dataset interface (H5D) + C dataset interface (H5D) EXTERNAL ROUTINES/VARIABLES: These routines are in the test directory of the C library: - h5_reset() -- in h5test.c, resets the library by closing it - h5_fileaccess() -- in h5test.c, returns a file access template + h5_reset() -- in h5test.c, resets the library by closing it + h5_fileaccess() -- in h5test.c, returns a file access template ***************************************************************************/ @@ -34,20 +34,20 @@ using std::cerr; using std::endl; #include -#include "H5Cpp.h" // C++ API header file +#include "H5Cpp.h" // C++ API header file using namespace H5; #include "h5test.h" -#include "h5cpputil.h" // C++ utilility header file +#include "h5cpputil.h" // C++ utilility header file -const H5std_string FILE1("dataset.h5"); -const H5std_string DSET_DEFAULT_NAME("default"); -const H5std_string DSET_DEFAULT_NAME_PATH("/default"); -const H5std_string DSET_CHUNKED_NAME("chunked"); -const H5std_string DSET_SIMPLE_IO_NAME("simple_io"); -const H5std_string DSET_TCONV_NAME("tconv"); -const H5std_string DSET_COMPRESS_NAME("compressed"); -const H5std_string DSET_BOGUS_NAME("bogus"); +const H5std_string FILE1("dataset.h5"); +const H5std_string DSET_DEFAULT_NAME("default"); +const H5std_string DSET_DEFAULT_NAME_PATH("/default"); +const H5std_string DSET_CHUNKED_NAME("chunked"); +const H5std_string DSET_SIMPLE_IO_NAME("simple_io"); +const H5std_string DSET_TCONV_NAME ("tconv"); +const H5std_string DSET_COMPRESS_NAME("compressed"); +const H5std_string DSET_BOGUS_NAME ("bogus"); /* Temporary filter IDs used for testing */ const int H5Z_FILTER_BOGUS = 305; @@ -58,16 +58,16 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, /*------------------------------------------------------------------------- - * Function: test_create + * Function: test_create * - * Purpose Attempts to create a dataset. + * Purpose: Attempts to create a dataset. * - * Return Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer: Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: * @@ -81,125 +81,125 @@ test_create( H5File& file) // Setting this to NULL for cleaning up in failure situations DataSet *dataset = NULL; try { - // Create a data space - hsize_t dims[2]; - dims[0] = 256; - dims[1] = 512; - DataSpace space (2, dims, NULL); - - // Create a dataset using the default dataset creation properties. - // We're not sure what they are, so we won't check. - dataset = new DataSet (file.createDataSet - (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); - - - // Add a comment to the dataset - file.setComment (DSET_DEFAULT_NAME, "This is a dataset"); - - // Close the dataset - delete dataset; - dataset = NULL; - - // Try creating a dataset that already exists. This should fail since a - // dataset can only be created once. If an exception is not thrown for - // this action by createDataSet, then throw an invalid action exception. - try { - dataset = new DataSet (file.createDataSet - (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); - - // continuation here, that means no exception has been thrown - throw InvalidActionException("H5File::createDataSet", "Library allowed overwrite of existing dataset"); - } - catch (FileIException& E) // catching invalid creating dataset - {} // do nothing, exception expected - - // Open the dataset we created above and then close it. This is one - // way to open an existing dataset for accessing. - dataset = new DataSet (file.openDataSet (DSET_DEFAULT_NAME)); - - // Get and verify the name of this dataset, using - // H5std_string getObjName() - H5std_string ds_name = dataset->getObjName(); - verify_val(ds_name, DSET_DEFAULT_NAME_PATH, "DataSet::getObjName", __LINE__, __FILE__); - - // Get and verify the comment from this dataset, using - // H5std_string getComment(const H5std_string& name, ) - H5std_string comment = file.getComment(DSET_DEFAULT_NAME); - verify_val(comment, "This is a dataset", "DataSet::getComment", __LINE__, __FILE__); - - // Close the dataset when accessing is completed - delete dataset; - - // This is another way to open an existing dataset for accessing. - DataSet another_dataset(file.openDataSet (DSET_DEFAULT_NAME)); - - // Try opening a non-existent dataset. This should fail so if an - // exception is not thrown for this action by openDataSet, then - // display failure information and throw an exception. - try { - dataset = new DataSet (file.openDataSet( "does_not_exist" )); - - // continuation here, that means no exception has been thrown - throw InvalidActionException("H5File::openDataSet", "Attempted to open a non-existent dataset"); - } - catch (FileIException& E ) // catching creating non-existent dataset - {} // do nothing, exception expected - - // Create a new dataset that uses chunked storage instead of the default - // layout. - DSetCreatPropList create_parms; - hsize_t csize[2]; - csize[0] = 5; - csize[1] = 100; - create_parms.setChunk( 2, csize ); - - dataset = new DataSet (file.createDataSet(DSET_CHUNKED_NAME, - PredType::NATIVE_DOUBLE, space, create_parms)); - // Note: this one has no error message in C when failure occurs? - - // clean up and return with success - delete dataset; - - PASSED(); - return 0; - } // outer most try block + // Create a data space + hsize_t dims[2]; + dims[0] = 256; + dims[1] = 512; + DataSpace space (2, dims, NULL); + + // Create a dataset using the default dataset creation properties. + // We're not sure what they are, so we won't check. + dataset = new DataSet (file.createDataSet + (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); + + + // Add a comment to the dataset + file.setComment (DSET_DEFAULT_NAME, "This is a dataset"); + + // Close the dataset + delete dataset; + dataset = NULL; + + // Try creating a dataset that already exists. This should fail since a + // dataset can only be created once. If an exception is not thrown for + // this action by createDataSet, then throw an invalid action exception. + try { + dataset = new DataSet (file.createDataSet + (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); + + // continuation here, that means no exception has been thrown + throw InvalidActionException("H5File::createDataSet", "Library allowed overwrite of existing dataset"); + } + catch (FileIException& E) // catching invalid creating dataset + {} // do nothing, exception expected + + // Open the dataset we created above and then close it. This is one + // way to open an existing dataset for accessing. + dataset = new DataSet (file.openDataSet (DSET_DEFAULT_NAME)); + + // Get and verify the name of this dataset, using + // H5std_string getObjName() + H5std_string ds_name = dataset->getObjName(); + verify_val(ds_name, DSET_DEFAULT_NAME_PATH, "DataSet::getObjName", __LINE__, __FILE__); + + // Get and verify the comment from this dataset, using + // H5std_string getComment(const H5std_string& name, ) + H5std_string comment = file.getComment(DSET_DEFAULT_NAME); + verify_val(comment, "This is a dataset", "DataSet::getComment", __LINE__, __FILE__); + + // Close the dataset when accessing is completed + delete dataset; + + // This is another way to open an existing dataset for accessing. + DataSet another_dataset(file.openDataSet (DSET_DEFAULT_NAME)); + + // Try opening a non-existent dataset. This should fail so if an + // exception is not thrown for this action by openDataSet, then + // display failure information and throw an exception. + try { + dataset = new DataSet (file.openDataSet( "does_not_exist" )); + + // continuation here, that means no exception has been thrown + throw InvalidActionException("H5File::openDataSet", "Attempted to open a non-existent dataset"); + } + catch (FileIException& E ) // catching creating non-existent dataset + {} // do nothing, exception expected + + // Create a new dataset that uses chunked storage instead of the default + // layout. + DSetCreatPropList create_parms; + hsize_t csize[2]; + csize[0] = 5; + csize[1] = 100; + create_parms.setChunk( 2, csize ); + + dataset = new DataSet (file.createDataSet + (DSET_CHUNKED_NAME, PredType::NATIVE_DOUBLE, space, create_parms)); + // Note: this one has no error message in C when failure occurs? + + // clean up and return with success + delete dataset; + + PASSED(); + return 0; + } // outer most try block catch (InvalidActionException& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - // clean up and return with failure - if (dataset != NULL) - delete dataset; - return -1; + // clean up and return with failure + if (dataset != NULL) + delete dataset; + return -1; } // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_create", __LINE__, __FILE__); + issue_fail_msg("test_create", __LINE__, __FILE__); - // clean up and return with failure - if (dataset != NULL) - delete dataset; - return -1; + // clean up and return with failure + if (dataset != NULL) + delete dataset; + return -1; } } // test_create /*------------------------------------------------------------------------- - * Function: test_simple_io + * Function: test_simple_io * - * Purpose Tests simple I/O. That is, reading and writing a complete - * multi-dimensional array without data type or data space - * conversions, without compression, and stored contiguously. + * Purpose: Tests simple I/O. That is, reading and writing a complete + * multi-dimensional array without data type or data space + * conversions, without compression, and stored contiguously. * - * Return Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer: Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: * @@ -211,81 +211,81 @@ test_simple_io( H5File& file) SUBTEST("Simple I/O"); - int points[100][200]; - int check[100][200]; - int i, j, n; + int points[100][200]; + int check[100][200]; + int i, j, n; // Initialize the dataset for (i = n = 0; i < 100; i++) { - for (j = 0; j < 200; j++) { - points[i][j] = n++; - } + for (j = 0; j < 200; j++) { + points[i][j] = n++; + } } char* tconv_buf = new char [1000]; try { - // Create the data space - hsize_t dims[2]; - dims[0] = 100; - dims[1] = 200; - DataSpace space (2, dims, NULL); - - // Create a small conversion buffer to test strip mining - DSetMemXferPropList xfer; - - xfer.setBuffer (1000, tconv_buf, NULL); - - // Create the dataset - DataSet dataset (file.createDataSet (DSET_SIMPLE_IO_NAME, PredType::NATIVE_INT, space)); - - // Write the data to the dataset - dataset.write(static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Read the dataset back - dataset.read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < 100; i++) - for (j = 0; j < 200; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("DataSet::read"); - } - - // clean up and return with success - delete [] tconv_buf; - PASSED(); - return 0; + // Create the data space + hsize_t dims[2]; + dims[0] = 100; + dims[1] = 200; + DataSpace space (2, dims, NULL); + + // Create a small conversion buffer to test strip mining + DSetMemXferPropList xfer; + + xfer.setBuffer (1000, tconv_buf, NULL); + + // Create the dataset + DataSet dataset (file.createDataSet (DSET_SIMPLE_IO_NAME, PredType::NATIVE_INT, space)); + + // Write the data to the dataset + dataset.write(static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Read the dataset back + dataset.read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < 100; i++) + for (j = 0; j < 200; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("DataSet::read"); + } + + // clean up and return with success + delete [] tconv_buf; + PASSED(); + return 0; } // end try // catch all dataset, space, plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - // clean up and return with failure - if (tconv_buf) - delete [] tconv_buf; - return -1; + // clean up and return with failure + if (tconv_buf) + delete [] tconv_buf; + return -1; } } // test_simple_io /*------------------------------------------------------------------------- - * Function: test_datasize + * Function: test_datasize * - * Purpose Tests DataSet::getInMemDataSize(). + * Purpose: Tests DataSet::getInMemDataSize(). * - * Return Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer Binh-Minh Ribler - * Thursday, March 22, 2012 + * Programmer: Binh-Minh Ribler + * Thursday, March 22, 2012 * * Modifications: * @@ -297,65 +297,65 @@ test_datasize(FileAccPropList &fapl) SUBTEST("DataSet::getInMemDataSize()"); try { - // Open FILE1. - H5File file(FILE1, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); - - // Open dataset DSET_SIMPLE_IO_NAME. - DataSet dset = file.openDataSet (DSET_SIMPLE_IO_NAME); - - // Get the dataset's dataspace to calculate the size for verification. - DataSpace space(dset.getSpace()); - - // Get the dimension sizes. - hsize_t dims[2]; - int n_dims = space.getSimpleExtentDims(dims); - if (n_dims < 0) - { - throw Exception("test_compression", "DataSpace::getSimpleExtentDims() failed"); - } - - // Calculate the supposed size. Size of each value is int (4), from - // test_simple_io. - size_t expected_size = 4 * dims[0] * dims[1]; - - // getInMemDataSize() returns the in memory size of the data. - size_t ds_size = dset.getInMemDataSize(); - - // Verify the data size. - if (ds_size != expected_size) - { - H5_FAILED(); - cerr << " Expected data size = " << expected_size; - cerr << " but dset.getInMemDataSize() returned " << ds_size << endl; - throw Exception("test_compression", "Failed in testing DataSet::getInMemDataSize()"); - } - - PASSED(); - return 0; + // Open FILE1. + H5File file(FILE1, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); + + // Open dataset DSET_SIMPLE_IO_NAME. + DataSet dset = file.openDataSet (DSET_SIMPLE_IO_NAME); + + // Get the dataset's dataspace to calculate the size for verification. + DataSpace space(dset.getSpace()); + + // Get the dimension sizes. + hsize_t dims[2]; + int n_dims = space.getSimpleExtentDims(dims); + if (n_dims < 0) + { + throw Exception("test_compression", "DataSpace::getSimpleExtentDims() failed"); + } + + // Calculate the supposed size. Size of each value is int (4), from + // test_simple_io. + size_t expected_size = 4 * dims[0] * dims[1]; + + // getInMemDataSize() returns the in memory size of the data. + size_t ds_size = dset.getInMemDataSize(); + + // Verify the data size. + if (ds_size != expected_size) + { + H5_FAILED(); + cerr << " Expected data size = " << expected_size; + cerr << " but dset.getInMemDataSize() returned " << ds_size << endl; + throw Exception("test_compression", "Failed in testing DataSet::getInMemDataSize()"); + } + + PASSED(); + return 0; } // end try // catch all dataset, space, plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - return -1; + return -1; } } // test_datasize /*------------------------------------------------------------------------- - * Function: test_tconv + * Function: test_tconv * - * Purpose Test some simple data type conversion stuff. + * Purpose: Test some simple data type conversion stuff. * - * Return Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer: Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: * @@ -365,7 +365,7 @@ static herr_t test_tconv(H5File& file) { // Prepare buffers for input/output - char *out=NULL, *in=NULL; + char *out=NULL, *in=NULL; out = new char [4*1000000]; // assert (out); - should use exception handler for new - BMR in = new char [4*1000000]; @@ -375,81 +375,81 @@ test_tconv(H5File& file) // Initialize the dataset for (int i = 0; i < 1000000; i++) { - out[i*4+0] = 0x11; - out[i*4+1] = 0x22; - out[i*4+2] = 0x33; - out[i*4+3] = 0x44; + out[i*4+0] = 0x11; + out[i*4+1] = 0x22; + out[i*4+2] = 0x33; + out[i*4+3] = 0x44; } try { - // Create the data space - hsize_t dims[1]; - dims[0] = 1000000; - DataSpace space (1, dims, NULL); - - // Create the data set - DataSet dataset (file.createDataSet (DSET_TCONV_NAME, PredType::STD_I32LE, space)); - - // Write the data to the dataset - dataset.write (static_cast(out), PredType::STD_I32LE); - - // Read data with byte order conversion - dataset.read (static_cast(in), PredType::STD_I32BE); - - // Check - for (int i = 0; i < 1000000; i++) { - if (in[4*i+0]!=out[4*i+3] || - in[4*i+1]!=out[4*i+2] || - in[4*i+2]!=out[4*i+1] || - in[4*i+3]!=out[4*i+0]) - { - throw Exception("DataSet::read", "Read with byte order conversion failed"); - } - } - - // clean up and return with success - delete [] out; - delete [] in; - PASSED(); - return 0; + // Create the data space + hsize_t dims[1]; + dims[0] = 1000000; + DataSpace space (1, dims, NULL); + + // Create the data set + DataSet dataset (file.createDataSet (DSET_TCONV_NAME, PredType::STD_I32LE, space)); + + // Write the data to the dataset + dataset.write (static_cast(out), PredType::STD_I32LE); + + // Read data with byte order conversion + dataset.read (static_cast(in), PredType::STD_I32BE); + + // Check + for (int i = 0; i < 1000000; i++) { + if (in[4*i+0]!=out[4*i+3] || + in[4*i+1]!=out[4*i+2] || + in[4*i+2]!=out[4*i+1] || + in[4*i+3]!=out[4*i+0]) + { + throw Exception("DataSet::read", "Read with byte order conversion failed"); + } + } + + // clean up and return with success + delete [] out; + delete [] in; + PASSED(); + return 0; } // end try // catch all dataset and space exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - // clean up and return with failure - delete [] out; - delete [] in; - return -1; + // clean up and return with failure + delete [] out; + delete [] in; + return -1; } } // test_tconv /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version number */ - H5Z_FILTER_BOGUS, /* Filter id number */ - 1, 1, /* Encode and decode enabled */ - "bogus", /* Filter name for debugging */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version number */ + H5Z_FILTER_BOGUS, /* Filter id number */ + 1, 1, /* Encode and decode enabled */ + "bogus", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - (H5Z_func_t)filter_bogus, /* The actual filter function */ + (H5Z_func_t)filter_bogus, /* The actual filter function */ }}; /*------------------------------------------------------------------------- - * Function: bogus + * Function: bogus * - * Purpose A bogus compression method that doesn't do anything. + * Purpose: A bogus compression method that doesn't do anything. * - * Return Success: Data chunk size + * Return: Success: Data chunk size * - * Failure: 0 + * Failure: 0 * - * Programmer Robb Matzke - * Tuesday, April 21, 1998 + * Programmer: Robb Matzke + * Tuesday, April 21, 1998 * * Modifications: * @@ -466,19 +466,19 @@ filter_bogus(unsigned int flags, size_t cd_nelmts, /*------------------------------------------------------------------------- - * Function: test_compression + * Function: test_compression * - * Purpose Tests dataset compression. If compression is requested when - * it hasn't been compiled into the library (such as when - * updating an existing compressed dataset) then data is sent to - * the file uncompressed but no errors are returned. + * Purpose: Tests dataset compression. If compression is requested when + * it hasn't been compiled into the library (such as when + * updating an existing compressed dataset) then data is sent to + * the file uncompressed but no errors are returned. * - * Return Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer: Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: * @@ -488,266 +488,266 @@ static herr_t test_compression(H5File& file) { #ifndef H5_HAVE_FILTER_DEFLATE - const char *not_supported; + const char *not_supported; not_supported = " Deflate compression is not enabled."; #endif /* H5_HAVE_FILTER_DEFLATE */ - int points[100][200]; - int check[100][200]; - hsize_t i, j, n; + int points[100][200]; + int check[100][200]; + hsize_t i, j, n; // Initialize the dataset for (i = n = 0; i < 100; i++) { - for (j = 0; j < 200; j++) { - points[i][j] = static_cast(n++); - } + for (j = 0; j < 200; j++) { + points[i][j] = static_cast(n++); + } } char* tconv_buf = new char [1000]; DataSet* dataset = NULL; try { - const hsize_t size[2] = {100, 200}; - // Create the data space - DataSpace space1(2, size, NULL); + const hsize_t size[2] = {100, 200}; + // Create the data space + DataSpace space1(2, size, NULL); - // Create a small conversion buffer to test strip mining - DSetMemXferPropList xfer; + // Create a small conversion buffer to test strip mining + DSetMemXferPropList xfer; - xfer.setBuffer (1000, tconv_buf, NULL); + xfer.setBuffer (1000, tconv_buf, NULL); - // Use chunked storage with compression - DSetCreatPropList dscreatplist; + // Use chunked storage with compression + DSetCreatPropList dscreatplist; - const hsize_t chunk_size[2] = {2, 25}; - dscreatplist.setChunk (2, chunk_size); - dscreatplist.setDeflate (6); + const hsize_t chunk_size[2] = {2, 25}; + dscreatplist.setChunk (2, chunk_size); + dscreatplist.setDeflate (6); #ifdef H5_HAVE_FILTER_DEFLATE - SUBTEST("Compression (setup)"); - - // Create the dataset - dataset = new DataSet (file.createDataSet - (DSET_COMPRESS_NAME, PredType::NATIVE_INT, space1, dscreatplist)); - - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 1: Read uninitialized data. It should be zero. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (uninitialized read)"); - - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - for (i=0; i(i) - << "," << static_cast(j) << endl; - throw Exception("test_compression", "Failed in uninitialized read"); - } - } - } - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 2: Test compression by setting up a chunked dataset and writing - * to it. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (write)"); - - for (i=n=0; i(n++); - } - } - - dataset->write (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 3: Try to read the data we just wrote. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (read)"); - - // Read the dataset back - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("test_compression", "Failed in read"); - } - - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 4: Write new data over the top of the old data. The new data is - * random thus not very compressible, and will cause the chunks to move - * around as they grow. We only change values for the left half of the - * dataset although we rewrite the whole thing. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (modify)"); - - for (i=0; iwrite (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Read the dataset back and check it - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("test_compression", "Failed in modify"); - } - - PASSED(); - - /*---------------------------------------------------------------------- - * STEP 5: Close the dataset and then open it and read it again. This - * insures that the compression message is picked up properly from the - * object header. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (re-open)"); - - // close this dataset to reuse the var - delete dataset; - - dataset = new DataSet (file.openDataSet (DSET_COMPRESS_NAME)); - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("test_compression", "Failed in re-open"); - } - - PASSED(); - - - /*---------------------------------------------------------------------- - * STEP 6: Test partial I/O by writing to and then reading from a - * hyperslab of the dataset. The hyperslab does not line up on chunk - * boundaries (we know that case already works from above tests). - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (partial I/O)"); - - const hsize_t hs_size[2] = {4, 50}; - const hsize_t hs_offset[2] = {7, 30}; - for (i = 0; i < hs_size[0]; i++) { - for (j = 0; j < hs_size[1]; j++) { - points[hs_offset[0]+i][hs_offset[1]+j] = rand (); - } - } - space1.selectHyperslab( H5S_SELECT_SET, hs_size, hs_offset ); - dataset->write (static_cast(points), PredType::NATIVE_INT, space1, space1, xfer); - dataset->read (static_cast(check), PredType::NATIVE_INT, space1, space1, xfer); - - // Check that the values read are the same as the values written - for (i=0; i((hs_offset[0]+i)) << - "," << static_cast((hs_offset[1]+j)) << endl; - - cerr << " At original: " << static_cast(points[hs_offset[0]+i][hs_offset[1]+j]) << endl; - cerr << " At returned: " << static_cast(check[hs_offset[0]+i][hs_offset[1]+j]) << endl; - throw Exception("test_compression", "Failed in partial I/O"); - } - } // for j - } // for i - - delete dataset; - dataset = NULL; - - PASSED(); + SUBTEST("Compression (setup)"); + + // Create the dataset + dataset = new DataSet (file.createDataSet + (DSET_COMPRESS_NAME, PredType::NATIVE_INT, space1, dscreatplist)); + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 1: Read uninitialized data. It should be zero. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (uninitialized read)"); + + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + for (i=0; i(i) << "," << + static_cast(j) << endl; + throw Exception("test_compression", "Failed in uninitialized read"); + } + } + } + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 2: Test compression by setting up a chunked dataset and writing + * to it. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (write)"); + + for (i=n=0; i(n++); + } + } + + dataset->write (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 3: Try to read the data we just wrote. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (read)"); + + // Read the dataset back + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("test_compression", "Failed in read"); + } + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 4: Write new data over the top of the old data. The new data is + * random thus not very compressible, and will cause the chunks to move + * around as they grow. We only change values for the left half of the + * dataset although we rewrite the whole thing. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (modify)"); + + for (i=0; iwrite (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Read the dataset back and check it + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("test_compression", "Failed in modify"); + } + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 5: Close the dataset and then open it and read it again. This + * insures that the compression message is picked up properly from the + * object header. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (re-open)"); + + // close this dataset to reuse the var + delete dataset; + + dataset = new DataSet (file.openDataSet (DSET_COMPRESS_NAME)); + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("test_compression", "Failed in re-open"); + } + + PASSED(); + + + /*---------------------------------------------------------------------- + * STEP 6: Test partial I/O by writing to and then reading from a + * hyperslab of the dataset. The hyperslab does not line up on chunk + * boundaries (we know that case already works from above tests). + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (partial I/O)"); + + const hsize_t hs_size[2] = {4, 50}; + const hsize_t hs_offset[2] = {7, 30}; + for (i = 0; i < hs_size[0]; i++) { + for (j = 0; j < hs_size[1]; j++) { + points[hs_offset[0]+i][hs_offset[1]+j] = rand (); + } + } + space1.selectHyperslab( H5S_SELECT_SET, hs_size, hs_offset ); + dataset->write (static_cast(points), PredType::NATIVE_INT, space1, space1, xfer); + dataset->read (static_cast(check), PredType::NATIVE_INT, space1, space1, xfer); + + // Check that the values read are the same as the values written + for (i=0; i((hs_offset[0]+i)) << + "," << static_cast((hs_offset[1]+j)) << endl; + + cerr << " At original: " << static_cast(points[hs_offset[0]+i][hs_offset[1]+j]) << endl; + cerr << " At returned: " << static_cast(check[hs_offset[0]+i][hs_offset[1]+j]) << endl; + throw Exception("test_compression", "Failed in partial I/O"); + } + } // for j + } // for i + + delete dataset; + dataset = NULL; + + PASSED(); #else - SUBTEST("deflate filter"); - SKIPPED(); - cerr << not_supported << endl; + SUBTEST("deflate filter"); + SKIPPED(); + cerr << not_supported << endl; #endif - /*---------------------------------------------------------------------- - * STEP 7: Register an application-defined compression method and use it - * to write and then read the dataset. - *---------------------------------------------------------------------- - */ - SUBTEST("Compression (app-defined method)"); + /*---------------------------------------------------------------------- + * STEP 7: Register an application-defined compression method and use it + * to write and then read the dataset. + *---------------------------------------------------------------------- + */ + SUBTEST("Compression (app-defined method)"); if (H5Zregister (H5Z_BOGUS)<0) - throw Exception("test_compression", "Failed in app-defined method"); - if (H5Pset_filter (dscreatplist.getId(), H5Z_FILTER_BOGUS, 0, 0, NULL)<0) - throw Exception("test_compression", "Failed in app-defined method"); - dscreatplist.setFilter (H5Z_FILTER_BOGUS, 0, 0, NULL); - - DataSpace space2 (2, size, NULL); - dataset = new DataSet (file.createDataSet (DSET_BOGUS_NAME, PredType::NATIVE_INT, space2, dscreatplist)); - - dataset->write (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - - // Check that the values read are the same as the values written - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) - throw Exception("test_compression", "Failed in app-defined method"); - } - - PASSED(); - - /*---------------------------------------------------------------------- - * Cleanup - *---------------------------------------------------------------------- - */ - delete dataset; - delete [] tconv_buf; - return 0; + throw Exception("test_compression", "Failed in app-defined method"); + if (H5Pset_filter (dscreatplist.getId(), H5Z_FILTER_BOGUS, 0, 0, NULL)<0) + throw Exception("test_compression", "Failed in app-defined method"); + dscreatplist.setFilter (H5Z_FILTER_BOGUS, 0, 0, NULL); + + DataSpace space2 (2, size, NULL); + dataset = new DataSet (file.createDataSet (DSET_BOGUS_NAME, PredType::NATIVE_INT, space2, dscreatplist)); + + dataset->write (static_cast(points), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + dataset->read (static_cast(check), PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); + + // Check that the values read are the same as the values written + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + int status = check_values (i, j, points[i][j], check[i][j]); + if (status == -1) + throw Exception("test_compression", "Failed in app-defined method"); + } + + PASSED(); + + /*---------------------------------------------------------------------- + * Cleanup + *---------------------------------------------------------------------- + */ + delete dataset; + delete [] tconv_buf; + return 0; } // end try // catch all dataset, file, space, and plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - - // clean up and return with failure - if (dataset != NULL) - delete dataset; - if (tconv_buf) - delete [] tconv_buf; - return -1; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + + // clean up and return with failure + if (dataset != NULL) + delete dataset; + if (tconv_buf) + delete [] tconv_buf; + return -1; } } // test_compression @@ -755,18 +755,18 @@ test_compression(H5File& file) /*------------------------------------------------------------------------- * Function: test_nbit_methods * - * Purpose Tests setting nbit compression methods. + * Purpose: Tests setting nbit compression methods. * - * Return Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer Binh-Minh Ribler - * Friday, April 22, 2016 + * Programmer: Binh-Minh Ribler + * Friday, April 22, 2016 * *------------------------------------------------------------------------- */ -const H5std_string DSET_NBIT_NAME("nbit_dataset"); +const H5std_string DSET_NBIT_NAME("nbit_dataset"); const hsize_t DIM1 = 2; const hsize_t DIM2 = 5; static herr_t test_nbit_compression(H5File& file) @@ -787,101 +787,101 @@ static herr_t test_nbit_compression(H5File& file) try { - // Define datatypes of members of compound datatype - IntType i_type(PredType::NATIVE_INT); - IntType c_type(PredType::NATIVE_CHAR); - IntType s_type(PredType::NATIVE_SHORT); - - // Create a dataset compound datatype - CompType cmpd(sizeof(s1_t)); - cmpd.insertMember("i", HOFFSET(s1_t, i), i_type); - cmpd.insertMember("c", HOFFSET(s1_t, c), c_type); - cmpd.insertMember("s", HOFFSET(s1_t, s), s_type); - - // Create a memory compound datatype - CompType mem_cmpd(sizeof(s1_t)); - mem_cmpd.insertMember("i", HOFFSET(s1_t, i), i_type); - mem_cmpd.insertMember("c", HOFFSET(s1_t, c), c_type); - mem_cmpd.insertMember("s", HOFFSET(s1_t, s), s_type); - - // Set order of dataset compound datatype - //cmpd.setOrder(H5T_ORDER_BE); only for atomic type? - - // Create the data space - DataSpace space(2, size); - - // Use nbit filter - DSetCreatPropList dscreat; - dscreat.setChunk(2, chunk_size); - dscreat.setNbit(); - - // Create the dataset - DataSet dataset(file.createDataSet(DSET_NBIT_NAME, cmpd, space, dscreat)); - - // Initialize data, assuming size of long long >= size of member datatypes - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - orig_data[i][j].i = static_cast(i * j); - orig_data[i][j].c = static_cast('a' + i); - orig_data[i][j].s = static_cast(i + j); - - // Some even-numbered integer values are negative - if ((i*size[1]+j+1)%2 == 0) { - orig_data[i][j].i = -orig_data[i][j].i; - orig_data[i][j].s = static_cast(-orig_data[i][j].s); - } - } - - // Write to the dataset - dataset.write(static_cast(orig_data), mem_cmpd); - - // Read the dataset back */ - dataset.read(static_cast(new_data), mem_cmpd); - - // Check that the values read are the same as the values written. - for (i = 0; i < size[0]; i++) - for (j = 0; j < size[1]; j++) - { - if((new_data[i][j].i != orig_data[i][j].i) || - (new_data[i][j].c != orig_data[i][j].c) || - (new_data[i][j].s != orig_data[i][j].s)) - { - H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", static_cast(i), static_cast(j)); - } + // Define datatypes of members of compound datatype + IntType i_type(PredType::NATIVE_INT); + IntType c_type(PredType::NATIVE_CHAR); + IntType s_type(PredType::NATIVE_SHORT); + + // Create a dataset compound datatype + CompType cmpd(sizeof(s1_t)); + cmpd.insertMember("i", HOFFSET(s1_t, i), i_type); + cmpd.insertMember("c", HOFFSET(s1_t, c), c_type); + cmpd.insertMember("s", HOFFSET(s1_t, s), s_type); + + // Create a memory compound datatype + CompType mem_cmpd(sizeof(s1_t)); + mem_cmpd.insertMember("i", HOFFSET(s1_t, i), i_type); + mem_cmpd.insertMember("c", HOFFSET(s1_t, c), c_type); + mem_cmpd.insertMember("s", HOFFSET(s1_t, s), s_type); + + // Set order of dataset compound datatype + //cmpd.setOrder(H5T_ORDER_BE); only for atomic type? + + // Create the data space + DataSpace space(2, size); + + // Use nbit filter + DSetCreatPropList dscreat; + dscreat.setChunk(2, chunk_size); + dscreat.setNbit(); + + // Create the dataset + DataSet dataset(file.createDataSet(DSET_NBIT_NAME, cmpd, space, dscreat)); + + // Initialize data, assuming size of long long >= size of member datatypes + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + orig_data[i][j].i = static_cast(i * j); + orig_data[i][j].c = static_cast('a' + i); + orig_data[i][j].s = static_cast(i + j); + + // Some even-numbered integer values are negative + if ((i*size[1]+j+1)%2 == 0) { + orig_data[i][j].i = -orig_data[i][j].i; + orig_data[i][j].s = static_cast(-orig_data[i][j].s); + } + } + + // Write to the dataset + dataset.write(static_cast(orig_data), mem_cmpd); + + // Read the dataset back */ + dataset.read(static_cast(new_data), mem_cmpd); + + // Check that the values read are the same as the values written. + for (i = 0; i < size[0]; i++) + for (j = 0; j < size[1]; j++) + { + if((new_data[i][j].i != orig_data[i][j].i) || + (new_data[i][j].c != orig_data[i][j].c) || + (new_data[i][j].s != orig_data[i][j].s)) + { + H5_FAILED(); + printf(" Read different values than written.\n"); + printf(" At index %lu,%lu\n", static_cast(i), static_cast(j)); + } } - PASSED(); - return 0; + PASSED(); + return 0; } // end try block // catch all dataset, file, space, and plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - return -1; + return -1; } } // test_nbit_compression /*------------------------------------------------------------------------- - * Function: test_multiopen + * Function: test_multiopen * - * Purpose Tests that a bug no longer exists. If a dataset is opened - * twice and one of the handles is used to extend the dataset, - * then the other handle should return the new size when - * queried. + * Purpose: Tests that a bug no longer exists. If a dataset is opened + * twice and one of the handles is used to extend the dataset, + * then the other handle should return the new size when + * queried. * - * Return Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer Binh-Minh Ribler (using C version) - * Saturday, February 17, 2001 + * Programmer: Binh-Minh Ribler (using C version) + * Saturday, February 17, 2001 * * Modifications: * @@ -896,75 +896,74 @@ test_multiopen (H5File& file) DataSpace* space = NULL; try { - // Create a dataset creation property list - DSetCreatPropList dcpl; + // Create a dataset creation property list + DSetCreatPropList dcpl; - // Set chunk size to given size - hsize_t cur_size[1] = {10}; - dcpl.setChunk (1, cur_size); + // Set chunk size to given size + hsize_t cur_size[1] = {10}; + dcpl.setChunk (1, cur_size); - // Create a simple data space with unlimited size - hsize_t max_size[1] = {H5S_UNLIMITED}; - space = new DataSpace (1, cur_size, max_size); + // Create a simple data space with unlimited size + hsize_t max_size[1] = {H5S_UNLIMITED}; + space = new DataSpace (1, cur_size, max_size); - // Create first dataset - DataSet dset1 = file.createDataSet ("multiopen", PredType::NATIVE_INT, *space, dcpl); + // Create first dataset + DataSet dset1 = file.createDataSet ("multiopen", PredType::NATIVE_INT, *space, dcpl); - // Open again the first dataset from the file to another DataSet object. - DataSet dset2 = file.openDataSet ("multiopen"); + // Open again the first dataset from the file to another DataSet object. + DataSet dset2 = file.openDataSet ("multiopen"); - // Relieve the dataspace - delete space; - space = NULL; + // Relieve the dataspace + delete space; + space = NULL; - // Extend the dimensionality of the first dataset - cur_size[0] = 20; - dset1.extend (cur_size); + // Extend the dimensionality of the first dataset + cur_size[0] = 20; + dset1.extend (cur_size); - // Get the size from the second handle - space = new DataSpace (dset2.getSpace()); + // Get the size from the second handle + space = new DataSpace (dset2.getSpace()); - hsize_t tmp_size[1]; - space->getSimpleExtentDims (tmp_size); - if (cur_size[0]!=tmp_size[0]) - { - cerr << " Got " << static_cast(tmp_size[0]) - << " instead of " << static_cast(cur_size[0]) - << "!" << endl; - throw Exception("test_multiopen", "Failed in multi-open with extending"); - } + hsize_t tmp_size[1]; + space->getSimpleExtentDims (tmp_size); + if (cur_size[0]!=tmp_size[0]) + { + cerr << " Got " << static_cast(tmp_size[0]) << " instead of " + << static_cast(cur_size[0]) << "!" << endl; + throw Exception("test_multiopen", "Failed in multi-open with extending"); + } - // clean up and return with success - delete space; - PASSED(); - return 0; + // clean up and return with success + delete space; + PASSED(); + return 0; } // end try block // catch all dataset, file, space, and plist exceptions catch (Exception& E) { - cerr << " FAILED" << endl; - cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - // clean up and return with failure - if (space != NULL) - delete space; - return -1; + // clean up and return with failure + if (space != NULL) + delete space; + return -1; } } // test_multiopen /*------------------------------------------------------------------------- - * Function: test_types + * Function: test_types * - * Purpose Test various types - should be moved to dtypes.cpp + * Purpose: Test various types - should be moved to dtypes.cpp * - * Return Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer Binh-Minh Ribler (using C version) - * February 17, 2001 + * Programmer: Binh-Minh Ribler (using C version) + * February 17, 2001 * * Modifications: * @@ -975,238 +974,239 @@ test_types(H5File& file) { SUBTEST("Various datatypes"); - size_t i; + size_t i; DataSet* dset = NULL; try { - // Create a group in the file that was passed in from the caller - Group grp = file.createGroup ("typetests"); - - /* bitfield_1 */ - unsigned char buf[32]; - hsize_t nelmts = sizeof(buf); - DataType type; - try { // block of bitfield_1 - // test copying a predefined type - type.copy (PredType::STD_B8LE); - - // Test copying a user-defined type using DataType::copy - DataType copied_type; - copied_type.copy(type); - - // Test copying a user-defined type using DataType::operator= - DataType another_copied_type; - another_copied_type = type; - - // Test copying a user-defined int type using DataType::operator= - IntType orig_int(PredType::STD_B8LE); - DataType generic_type; - generic_type = orig_int; - - // Test copying an integer predefined type - IntType new_int_type(PredType::STD_B8LE); - - // Test copying an int predefined type using DataType::operator= - IntType another_int_type; - another_int_type = new_int_type; - - DataSpace space (1, &nelmts); - dset = new DataSet(grp.createDataSet("bitfield_1", type, space)); - - // Fill buffer - for (i=0; i(0xff) ^ static_cast(i); - - // Write data from buf using all default dataspaces and property list - dset->write (buf, type); - - // no failure in bitfield_1, close this dataset - delete dset; - } // end try block of bitfield_1 - - // catch exceptions thrown in try block of bitfield_1 - catch (Exception& E) - { - cerr << " FAILED" << endl; - cerr << " <<< " << "bitfield_1: " << E.getFuncName() - << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - return -1; - } - - /* bitfield_2 */ - nelmts = sizeof(buf)/2; - try { // bitfield_2 block - type.copy (PredType::STD_B16LE); - DataSpace space (1, &nelmts); - dset = new DataSet(grp.createDataSet("bitfield_2", type, space)); - - // Fill buffer - for (i=0; i(0xff) ^ static_cast(i); - - // Write data from buf using all default dataspaces and property - // list; if writing fails, deallocate dset and return. - dset->write (buf, type); - - // no failure in bitfield_2, close this dataset and reset for - // variable reuse - delete dset; - dset = NULL; - } // end try block of bitfield_2 - - // catch exceptions thrown in try block of bitfield_2 - catch (Exception& E) - { - cerr << " FAILED" << endl; - cerr << " <<< " << "bitfield_2: " << E.getFuncName() - << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - throw E; // propagate the exception - } - - /* opaque_1 */ - DataType* optype = NULL; - try { // opaque_1 block - optype = new DataType(H5T_OPAQUE, 1); - nelmts = sizeof(buf); - DataSpace space (1, &nelmts); - optype->setTag ("testing 1-byte opaque type"); - dset = new DataSet(grp.createDataSet("opaque_1", *optype, space)); - - // Fill buffer - for (i=0; i(0xff) ^ static_cast(i); - - // Write data from buf using all default dataspaces and property - // list; if writing fails, deallocate dset and return. - dset->write (buf, *optype); - - // no failure in opaque_1 - delete dset; dset = NULL; - delete optype; optype = NULL; - } // end try block of opaque_1 - - // catch exceptions thrown in try block of opaque_1 - catch (Exception& E) - { - cerr << " FAILED" << endl; - cerr << " <<< " << "opaque_1: " << E.getFuncName() - << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - if (optype != NULL) - delete optype; - throw E; // propagate the exception - } - - /* opaque_2 */ - try { // block opaque_2 - nelmts = sizeof(buf)/4; - DataSpace space (1, &nelmts); - optype = new DataType(H5T_OPAQUE, 4); - optype->setTag ("testing 4-byte opaque type"); - dset = new DataSet(grp.createDataSet("opaque_2", *optype, space)); - - // Fill buffer - for (i=0; i(0xff) ^ static_cast(i); - - // Write data from buf using all default dataspaces and property - // list; if writing fails, deallocate dset and return. - dset->write (buf, *optype); - - // no failure in opaque_1 - delete dset; dset = NULL; - delete optype; optype = NULL; - } //end try block of opaque_2 - - // catch exceptions thrown in try block of opaque_2 - catch (Exception& E) - { - cerr << " FAILED" << endl; - cerr << " <<< " << "opaque_2: " << E.getFuncName() - << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - if (optype != NULL) - delete optype; - throw E; // propagate the exception - } - - PASSED(); - return 0; + // Create a group in the file that was passed in from the caller + Group grp = file.createGroup ("typetests"); + + /* bitfield_1 */ + unsigned char buf[32]; + hsize_t nelmts = sizeof(buf); + DataType type; + try { // block of bitfield_1 + // test copying a predefined type + type.copy (PredType::STD_B8LE); + + // Test copying a user-defined type using DataType::copy + DataType copied_type; + copied_type.copy(type); + + // Test copying a user-defined type using DataType::operator= + DataType another_copied_type; + another_copied_type = type; + + // Test copying a user-defined int type using DataType::operator= + IntType orig_int(PredType::STD_B8LE); + DataType generic_type; + generic_type = orig_int; + + // Test copying an integer predefined type + IntType new_int_type(PredType::STD_B8LE); + + // Test copying an int predefined type using DataType::operator= + IntType another_int_type; + another_int_type = new_int_type; + + DataSpace space (1, &nelmts); + dset = new DataSet(grp.createDataSet("bitfield_1", type, space)); + + // Fill buffer + for (i=0; i(0xff) ^ static_cast(i); + + // Write data from buf using all default dataspaces and property list + dset->write (buf, type); + + // no failure in bitfield_1, close this dataset + delete dset; + } // end try block of bitfield_1 + + // catch exceptions thrown in try block of bitfield_1 + catch (Exception& E) + { + cerr << " FAILED" << endl; + cerr << " <<< " << "bitfield_1: " << E.getFuncName() + << " - " << E.getDetailMsg() << " >>>" << endl << endl; + if (dset != NULL) + delete dset; + return -1; + } + + /* bitfield_2 */ + nelmts = sizeof(buf)/2; + try { // bitfield_2 block + type.copy (PredType::STD_B16LE); + DataSpace space (1, &nelmts); + dset = new DataSet(grp.createDataSet("bitfield_2", type, space)); + + // Fill buffer + for (i=0; i(0xff) ^ static_cast(i); + + // Write data from buf using all default dataspaces and property + // list; if writing fails, deallocate dset and return. + dset->write (buf, type); + + // no failure in bitfield_2, close this dataset and reset for + // variable reuse + delete dset; + dset = NULL; + } // end try block of bitfield_2 + + // catch exceptions thrown in try block of bitfield_2 + catch (Exception& E) + { + cerr << " FAILED" << endl; + cerr << " <<< " << "bitfield_2: " << E.getFuncName() + << " - " << E.getDetailMsg() << " >>>" << endl << endl; + if (dset != NULL) + delete dset; + throw E; // propagate the exception + } + + /* opaque_1 */ + DataType* optype = NULL; + try { // opaque_1 block + optype = new DataType(H5T_OPAQUE, 1); + nelmts = sizeof(buf); + DataSpace space (1, &nelmts); + optype->setTag ("testing 1-byte opaque type"); + dset = new DataSet(grp.createDataSet("opaque_1", *optype, space)); + + // Fill buffer + for (i=0; i(0xff) ^ static_cast(i); + + // Write data from buf using all default dataspaces and property + // list; if writing fails, deallocate dset and return. + dset->write (buf, *optype); + + // no failure in opaque_1 + delete dset; dset = NULL; + delete optype; optype = NULL; + } // end try block of opaque_1 + + // catch exceptions thrown in try block of opaque_1 + catch (Exception& E) + { + cerr << " FAILED" << endl; + cerr << " <<< " << "opaque_1: " << E.getFuncName() + << " - " << E.getDetailMsg() << " >>>" << endl << endl; + if (dset != NULL) + delete dset; + if (optype != NULL) + delete optype; + throw E; // propagate the exception + } + + /* opaque_2 */ + try { // block opaque_2 + nelmts = sizeof(buf)/4; + DataSpace space (1, &nelmts); + optype = new DataType(H5T_OPAQUE, 4); + optype->setTag ("testing 4-byte opaque type"); + dset = new DataSet(grp.createDataSet("opaque_2", *optype, space)); + + // Fill buffer + for (i=0; i(0xff) ^ static_cast(i); + + // Write data from buf using all default dataspaces and property + // list; if writing fails, deallocate dset and return. + dset->write (buf, *optype); + + // no failure in opaque_1 + delete dset; dset = NULL; + delete optype; optype = NULL; + } //end try block of opaque_2 + + // catch exceptions thrown in try block of opaque_2 + catch (Exception& E) + { + cerr << " FAILED" << endl; + cerr << " <<< " << "opaque_2: " << E.getFuncName() + << " - " << E.getDetailMsg() << " >>>" << endl << endl; + if (dset != NULL) + delete dset; + if (optype != NULL) + delete optype; + throw E; // propagate the exception + } + + PASSED(); + return 0; } // end top try block catch (Exception& E) { - return -1; + return -1; } } // test_types /*------------------------------------------------------------------------- - * Function: test_dset + * Function: test_dset * - * Purpose Tests the dataset interface (H5D) + * Purpose: Tests the dataset interface (H5D) * - * Return Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer Binh-Minh Ribler (using C version) - * Friday, January 5, 2001 + * Programmer: Binh-Minh Ribler (using C version) + * Friday, January 5, 2001 * * Modifications: - * Nov 12, 01: - * - moved h5_cleanup to outside of try block because - * dataset.h5 cannot be removed until "file" is out of - * scope and dataset.h5 is closed. - * Feb 20, 05: - * - cleanup_dsets took care of the cleanup now. + * Nov 12, 01: + * - moved h5_cleanup to outside of try block because + * dataset.h5 cannot be removed until "file" is out of + * scope and dataset.h5 is closed. + * Feb 20, 05: + * - cleanup_dsets took care of the cleanup now. * *------------------------------------------------------------------------- */ extern "C" void test_dset() { - hid_t fapl_id; + hid_t fapl_id; fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template - int nerrors=0; // keep track of number of failures occur + + int nerrors=0; // keep track of number of failures occurr try { - // Use the file access template id to create a file access prop. - // list object to pass in H5File::H5File - FileAccPropList fapl(fapl_id); + // Use the file access template id to create a file access prop. + // list object to pass in H5File::H5File + FileAccPropList fapl(fapl_id); - H5File file(FILE1, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); + H5File file(FILE1, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); - // Cause the library to emit initial messages - Group grp = file.createGroup( "emit diagnostics", 0); - grp.setComment("Causes diagnostic messages to be emitted"); + // Cause the library to emit initial messages + Group grp = file.createGroup( "emit diagnostics", 0); + grp.setComment("Causes diagnostic messages to be emitted"); - nerrors += test_create(file) < 0 ? 1:0; - nerrors += test_simple_io(file) < 0 ? 1:0; - nerrors += test_tconv(file) < 0 ? 1:0; - nerrors += test_compression(file) < 0 ? 1:0; - nerrors += test_nbit_compression(file) < 0 ? 1:0; - nerrors += test_multiopen (file) < 0 ? 1:0; - nerrors += test_types(file) < 0 ? 1:0; + nerrors += test_create(file) < 0 ? 1:0; + nerrors += test_simple_io(file) < 0 ? 1:0; + nerrors += test_tconv(file) < 0 ? 1:0; + nerrors += test_compression(file) < 0 ? 1:0; + nerrors += test_nbit_compression(file) < 0 ? 1:0; + nerrors += test_multiopen (file) < 0 ? 1:0; + nerrors += test_types(file) < 0 ? 1:0; - // Close group "emit diagnostics". - grp.close(); + // Close group "emit diagnostics". + grp.close(); - // Close the file before testing data size. - file.close(); + // Close the file before testing data size. + file.close(); - nerrors += test_datasize(fapl) <0 ? 1:0; + nerrors += test_datasize(fapl) <0 ? 1:0; } catch (Exception& E) { - test_report(nerrors, H5std_string(" Dataset")); + test_report(nerrors, H5std_string(" Dataset")); } // Clean up data file @@ -1216,11 +1216,11 @@ void test_dset() /*------------------------------------------------------------------------- * Function: cleanup_dsets * - * Purpose Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return none + * Return: none * - * Programmer (use C version) + * Programmer: (use C version) * * Modifications: * diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index cf7fc2c..95d29a8 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -37,18 +37,18 @@ using namespace H5; #include "h5cpputil.h" // C++ utilility header file /*------------------------------------------------------------------------- - * Function: test_report + * Function: test_report * - * Purpose Prints out the number of errors for the tests indicated - * by 'testname,' if there were any failures occurred. If - * no failure, test_report prints out the tests passed message. + * Purpose: Prints out the number of errors for the tests indicated + * by 'testname,' if there were any failures occurred. If + * no failure, test_report prints out the tests passed message. * - * Return if any failure has occurred: 1 + * Return: if any failure has occurred: 1 * - * if no failure occurs: 0 + * if no failure occurs: 0 * - * Programmer Binh-Minh Ribler (using C code segment for reporting tests) - * Friday, February 6, 2001 + * Programmer: Binh-Minh Ribler (using C code segment for reporting tests) + * Friday, February 6, 2001 * * Modifications: * @@ -59,12 +59,12 @@ int test_report( int nerrors, const H5std_string& testname ) if (nerrors) { nerrors = MAX(1, nerrors); - if (1 == nerrors) - cerr << "***** " << nerrors << testname - << " TEST FAILED! *****" << endl; - else - cerr << "***** " << nerrors << testname - << " TESTS FAILED! *****" << endl; + if (1 == nerrors) + cerr << "***** " << nerrors << testname + << " TEST FAILED! *****" << endl; + else + cerr << "***** " << nerrors << testname + << " TESTS FAILED! *****" << endl; return 1; } else @@ -75,68 +75,68 @@ int test_report( int nerrors, const H5std_string& testname ) } /*------------------------------------------------------------------------- - * Function: issue_fail_msg + * Function: issue_fail_msg * - * Purpose Displays that a function has failed with its location. + * Purpose: Displays that a function has failed with its location. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (copied and modified macro CHECK from C) - * Monday, December 20, 2004 + * Programmer: Binh-Minh Ribler (copied and modified macro CHECK from C) + * Monday, December 20, 2004 * *------------------------------------------------------------------------- */ void issue_fail_msg(const char* where, int line, const char* file_name, - const char* message) + const char* message) { if (GetTestVerbosity()>=VERBO_HI) { - cerr << endl; + cerr << endl; cerr << ">>> FAILED in " << where << " at line " << line << " in " << file_name << " - " << message << endl << endl; } } /*------------------------------------------------------------------------- - * Function: issue_fail_msg + * Function: issue_fail_msg * - * Purpose Displays that a function has failed with its location. + * Purpose: Displays that a function has failed with its location. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (copied and modified macro CHECK from C) - * Monday, December 20, 2004 + * Programmer: Binh-Minh Ribler (copied and modified macro CHECK from C) + * Monday, December 20, 2004 * *------------------------------------------------------------------------- */ void issue_fail_msg(const char* where, int line, const char* file_name, - const char* func_name, const char* message) + const char* func_name, const char* message) { if (GetTestVerbosity()>=VERBO_HI) { - cerr << endl; + cerr << endl; cerr << ">>> FAILED in " << where << ": " << func_name << endl << - " at line " << line << " in " << file_name << endl << - " C library detail: " << message << endl << endl; + " at line " << line << " in " << file_name << endl << + " C library detail: " << message << endl << endl; } } /*------------------------------------------------------------------------- - * Function: check_values + * Function: check_values * - * Purpose Checks a read value against the written value. If they are - * different, the function will print out a message and the - * different values. This function is made to reuse the code - * segment that is used in various places throughout - * the test code. Where the C version of this code segment - * "goto error," this function will return -1. + * Purpose: Checks a read value against the written value. If they are + * different, the function will print out a message and the + * different values. This function is made to reuse the code + * segment that is used in various places throughout + * the test code. Where the C version of this code segment + * "goto error," this function will return -1. * - * Return Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer Binh-Minh Ribler (using C code segment for checking values) - * Friday, February 6, 2001 + * Programmer: Binh-Minh Ribler (using C code segment for checking values) + * Friday, February 6, 2001 * * Modifications: * @@ -146,26 +146,26 @@ int check_values (hsize_t i, hsize_t j, int apoint, int acheck) { if (apoint != acheck) { - cerr << " Read different values than written.\n" << endl; - cerr << " At index " << static_cast(i) << "," << - static_cast(j) << endl; - return -1; + cerr << " Read different values than written.\n" << endl; + cerr << " At index " << static_cast(i) << "," << + static_cast(j) << endl; + return -1; } return 0; } // check_values /*------------------------------------------------------------------------- - * Function: check_values + * Function: check_values * - * Purpose Checks a char string pointer for NULL. If it is NULL, - * the function will print out a message + * Purpose: Checks a char string pointer for NULL. If it is NULL, + * the function will print out a message * - * Return Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer Binh-Minh Ribler (using C code segment for checking values) - * Friday, September 16, 2016 + * Programmer: Binh-Minh Ribler (using C code segment for checking values) + * Friday, September 16, 2016 * *------------------------------------------------------------------------- */ @@ -173,26 +173,26 @@ void check_values(const char *value, const char* msg, int line, const char* file { if (value == NULL) { - cerr << endl; + cerr << endl; cerr << "*** ERROR: " << msg << ", at line " << line << endl; - IncTestNumErrs(); - throw TestFailedException(file_name, msg); + IncTestNumErrs(); + throw TestFailedException(file_name, msg); } } /*------------------------------------------------------------------------- - * Function: verify_val (const char*, const char*,...) + * Function: verify_val (const char*, const char*,...) * - * Purpose Compares two character strings. If they are - * different, the function will print out a message and the - * different values. + * Purpose: Compares two character strings. If they are + * different, the function will print out a message and the + * different values. * - * Return Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer Binh-Minh Ribler - * May 2, 2010 + * Programmer: Binh-Minh Ribler + * May 2, 2010 * * Modifications: * @@ -225,12 +225,12 @@ InvalidActionException::InvalidActionException():Exception(){} //-------------------------------------------------------------------------- // Function: InvalidActionException overloaded constructor // -// Purpose Creates an InvalidActionException with the name of the function, +// Purpose: Creates an InvalidActionException with the name of the function, // which the failure should have occurred but didn't, and a -// message explaining why it should fail. +// message explaining why it should fail. // Parameters -// func - IN: Name of the function where failure should occur -// message - IN: Message +// func - IN: Name of the function where failure should occur +// message - IN: Message //-------------------------------------------------------------------------- InvalidActionException::InvalidActionException(const H5std_string func, const H5std_string message) : Exception(func, message) {} @@ -247,12 +247,12 @@ TestFailedException::TestFailedException():Exception(){} //-------------------------------------------------------------------------- // Function: TestFailedException overloaded constructor // -// Purpose Creates an TestFailedException with the name of the function, +// Purpose: Creates an TestFailedException with the name of the function, // which the failure should have occurred but didn't, and a -// message explaining why it should fail. +// message explaining why it should fail. // Parameters -// func - IN: Name of the function where failure should occur -// message - IN: Message +// func - IN: Name of the function where failure should occur +// message - IN: Message //-------------------------------------------------------------------------- TestFailedException::TestFailedException(const H5std_string func, const H5std_string message) : Exception(func, message) {} diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index 7f92e60..f8aaec7 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -37,22 +37,22 @@ int check_values (hsize_t i, hsize_t j, int apoint, int acheck); void check_values(const char *value, const char* msg, int line, const char* file_name); int test_report (int, const H5std_string&); void issue_fail_msg(const char* where, int line, const char* file_name, - const char* message=""); + const char* message=""); void issue_fail_msg(const char* where, int line, const char* file_name, - const char* func_name, const char* message); + const char* func_name, const char* message); class InvalidActionException : public Exception { public: - InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); - InvalidActionException(); - virtual ~InvalidActionException() throw(); + InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); + InvalidActionException(); + virtual ~InvalidActionException() throw(); }; class TestFailedException : public Exception { public: - TestFailedException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); - TestFailedException(); - virtual ~TestFailedException() throw(); + TestFailedException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); + TestFailedException(); + virtual ~TestFailedException() throw(); }; // Overloaded/Template functions to verify values and display proper info @@ -65,18 +65,18 @@ template { if (GetTestVerbosity()>=VERBO_HI) { - cerr << endl; + cerr << endl; cerr << " Call to routine: " << where << " at line " << line - << " in " << file_name << " had value " << x << endl; + << " in " << file_name << " had value " << x << endl; } if (x != value) { - cerr << endl; + cerr << endl; cerr << "*** UNEXPECTED VALUE from " << where << " should be " - << value << ", but is " << x << " at line " << line - << " in " << file_name << endl; - IncTestNumErrs(); - throw TestFailedException(where, ""); + << value << ", but is " << x << " at line " << line + << " in " << file_name << endl; + IncTestNumErrs(); + throw TestFailedException(where, ""); } } @@ -85,12 +85,12 @@ template { if (x != value) { - cerr << endl; + cerr << endl; cerr << "*** UNEXPECTED VALUE: " << file_name << ":line " << line - << ": " << msg << " different: " << x << ", should be " << value - << endl; - IncTestNumErrs(); - throw TestFailedException(file_name, msg); + << ": " << msg << " different: " << x << ", should be " << value + << endl; + IncTestNumErrs(); + throw TestFailedException(file_name, msg); } } @@ -99,17 +99,17 @@ template { if (GetTestVerbosity()>=VERBO_HI) { - cerr << endl; + cerr << endl; cerr << " Call to routine: " << where << " at line " << line - << " in " << file_name << " had value " << x << endl; + << " in " << file_name << " had value " << x << endl; } if (x == value) { - cerr << endl; + cerr << endl; cerr << "*** UNEXPECTED VALUE from " << where << " should not be " - << value << " at line " << line << " in " << file_name << endl; - IncTestNumErrs(); - throw TestFailedException(where, ""); + << value << " at line " << line << " in " << file_name << endl; + IncTestNumErrs(); + throw TestFailedException(where, ""); } } @@ -118,10 +118,10 @@ template { if (x == value) { - cerr << endl; + cerr << endl; cerr << "*** Function " << msg << " FAILED at line " << line << endl; - IncTestNumErrs(); - throw TestFailedException(file_name, msg); + IncTestNumErrs(); + throw TestFailedException(file_name, msg); } } @@ -130,12 +130,12 @@ template { if (x == value) { - cerr << endl; - cerr << "*** UNEXPECTED FLOAT VALUE: " << file_name << ":line " << line - << ": " << msg << " different: " << x << ", should be " << value - << " (epsilon=" << epsilon << ")" << endl; - IncTestNumErrs(); - throw TestFailedException(file_name, msg); + cerr << endl; + cerr << "*** UNEXPECTED FLOAT VALUE: " << file_name << ":line " << line + << ": " << msg << " different: " << x << ", should be " << value + << " (epsilon=" << epsilon << ")" << endl; + IncTestNumErrs(); + throw TestFailedException(file_name, msg); } } diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index 490772f..f10016f 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -53,12 +53,12 @@ typedef enum int_t { /*------------------------------------------------------------------------- * Function: test_array_compound_array * - * Purpose Tests 1-D array of compound datatypes (with array fields) + * Purpose: Tests 1-D array of compound datatypes (with array fields) * - * Return None. + * Return: None. * - * Programmer Binh-Minh Ribler (using C version) - * January, 2016 + * Programmer: Binh-Minh Ribler (using C version) + * January, 2016 * * Modifications: * @@ -76,7 +76,7 @@ static void test_array_compound_array() hsize_t sdims1[] = {SPACE1_DIM1}; hsize_t tdims1[] = {ARRAY1_DIM1}; int nmemb; // Number of compound members - int ii; // counting variables + int ii; // counting variables hsize_t idxi, idxj, idxk; // dimension indicing variables H5T_class_t mclass; // Datatype class for field @@ -85,193 +85,193 @@ static void test_array_compound_array() for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) { wdata[idxi][idxj].i = idxi * 10 + idxj; for(idxk = 0; idxk < ARRAY1_DIM1; idxk++) - { + { float temp = idxi * 10.0 + idxj * 2.5 + idxk; wdata[idxi][idxj].f[idxk] = temp; - } + } } // end for try { - // Create File - H5File file1(FILENAME, H5F_ACC_TRUNC); + // Create File + H5File file1(FILENAME, H5F_ACC_TRUNC); - // Create dataspace for datasets - DataSpace space(SPACE1_RANK, sdims1, NULL); + // Create dataspace for datasets + DataSpace space(SPACE1_RANK, sdims1, NULL); - /* - * Create an array datatype of compounds, arrtype. Each compound - * datatype, comptype, contains an integer and an array of floats, - * arrfltype. - */ + /* + * Create an array datatype of compounds, arrtype. Each compound + * datatype, comptype, contains an integer and an array of floats, + * arrfltype. + */ - // Create a compound datatype - CompType comptype(sizeof(s1_t)); + // Create a compound datatype + CompType comptype(sizeof(s1_t)); - // Insert integer field - comptype.insertMember("i", HOFFSET(s1_t, i), PredType::NATIVE_INT); + // Insert integer field + comptype.insertMember("i", HOFFSET(s1_t, i), PredType::NATIVE_INT); - // Create an array of floats datatype - ArrayType arrfltype(PredType::NATIVE_FLOAT, ARRAY1_RANK, tdims1); + // Create an array of floats datatype + ArrayType arrfltype(PredType::NATIVE_FLOAT, ARRAY1_RANK, tdims1); - // Insert float array field - comptype.insertMember("f", HOFFSET(s1_t, f), arrfltype); + // Insert float array field + comptype.insertMember("f", HOFFSET(s1_t, f), arrfltype); - // Close array of floats field datatype - arrfltype.close(); + // Close array of floats field datatype + arrfltype.close(); - // Create an array datatype of the compound datatype - ArrayType arrtype(comptype, ARRAY1_RANK, tdims1); + // Create an array datatype of the compound datatype + ArrayType arrtype(comptype, ARRAY1_RANK, tdims1); - // Close compound datatype comptype - comptype.close(); + // Close compound datatype comptype + comptype.close(); - // Create a dataset - DataSet dataset = file1.createDataSet("Dataset1", arrtype, space); + // Create a dataset + DataSet dataset = file1.createDataSet("Dataset1", arrtype, space); - // Write dataset to disk - dataset.write(wdata, arrtype); + // Write dataset to disk + dataset.write(wdata, arrtype); - // Test opening ArrayType with opening constructor (Dec 2016) + // Test opening ArrayType with opening constructor (Dec 2016) - // Commit the arrtype to give it a name - arrtype.commit(file1, ARRAYTYPE_NAME); + // Commit the arrtype to give it a name + arrtype.commit(file1, ARRAYTYPE_NAME); - // Close it, then re-open with the opening constructor - arrtype.close(); - ArrayType named_type(file1, ARRAYTYPE_NAME); + // Close it, then re-open with the opening constructor + arrtype.close(); + ArrayType named_type(file1, ARRAYTYPE_NAME); - // Get and verify the type's name - H5std_string type_name = named_type.getObjName(); - verify_val(type_name, ARRAYTYPE_NAME, "DataType::getObjName tests constructor", __LINE__, __FILE__); - named_type.close(); + // Get and verify the type's name + H5std_string type_name = named_type.getObjName(); + verify_val(type_name, ARRAYTYPE_NAME, "DataType::getObjName tests constructor", __LINE__, __FILE__); + named_type.close(); - // Close all - dataset.close(); - space.close(); - file1.close(); + // Close all + dataset.close(); + space.close(); + file1.close(); - // Re-open file - file1.openFile(FILENAME, H5F_ACC_RDONLY); + // Re-open file + file1.openFile(FILENAME, H5F_ACC_RDONLY); - // Open the dataset - dataset = file1.openDataSet("Dataset1"); + // Open the dataset + dataset = file1.openDataSet("Dataset1"); - /* - * Check the datatype array of compounds - */ + /* + * Check the datatype array of compounds + */ - // Verify that it is an array of compounds - DataType dstype = dataset.getDataType(); - mclass = dstype.getClass(); - verify_val(mclass==H5T_ARRAY, true, "f2_type.getClass", __LINE__, __FILE__); + // Verify that it is an array of compounds + DataType dstype = dataset.getDataType(); + mclass = dstype.getClass(); + verify_val(mclass==H5T_ARRAY, true, "f2_type.getClass", __LINE__, __FILE__); - dstype.close(); + dstype.close(); - // Get the array datatype to check - ArrayType atype_check = dataset.getArrayType(); + // Get the array datatype to check + ArrayType atype_check = dataset.getArrayType(); - // Check the array rank - int ndims = atype_check.getArrayNDims(); - verify_val(ndims, ARRAY1_RANK, "atype_check.getArrayNDims", __LINE__, __FILE__); + // Check the array rank + int ndims = atype_check.getArrayNDims(); + verify_val(ndims, ARRAY1_RANK, "atype_check.getArrayNDims", __LINE__, __FILE__); - // Get the array dimensions - hsize_t rdims1[H5S_MAX_RANK]; - atype_check.getArrayDims(rdims1); + // Get the array dimensions + hsize_t rdims1[H5S_MAX_RANK]; + atype_check.getArrayDims(rdims1); - // Check the array dimensions - for (ii =0; ii FP_EPSILON) - verify_val(read_data2, attr_data5, FP_EPSILON, "Attribute::read", __LINE__, __FILE__); + // Read attribute information + float read_data2=0.0; // Buffer for reading 1st attribute + ds_attr.read(PredType::NATIVE_FLOAT,&read_data2); + if (HDfabs(read_data2 - attr_data5) > FP_EPSILON) + verify_val(read_data2, attr_data5, FP_EPSILON, "Attribute::read", __LINE__, __FILE__); - // Get the dataspace of the attribute - DataSpace att_space = ds_attr.getSpace(); + // Get the dataspace of the attribute + DataSpace att_space = ds_attr.getSpace(); - // Make certain the dataspace is scalar - H5S_class_t space_type = att_space.getSimpleExtentType(); - verify_val(space_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__); + // Make certain the dataspace is scalar + H5S_class_t space_type = att_space.getSimpleExtentType(); + verify_val(space_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_attr_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_scalar_read() @@ -877,65 +877,65 @@ static void test_attr_mult_write() SUBTEST("Multiple Attribute Writing Functions"); try { - // Create file - H5File fid1 (FILE_MULTI, H5F_ACC_TRUNC); + // Create file + H5File fid1 (FILE_MULTI, H5F_ACC_TRUNC); - // Create dataspace for dataset - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - DataSpace ds_space (SPACE1_RANK, dims1); + // Create dataspace for dataset + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + DataSpace ds_space (SPACE1_RANK, dims1); - // Create a dataset - DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space); + // Create a dataset + DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space); - // Create dataspace for 1st attribute - hsize_t dims2[] = {ATTR1_DIM1}; - DataSpace att_space (ATTR1_RANK, dims2); + // Create dataspace for 1st attribute + hsize_t dims2[] = {ATTR1_DIM1}; + DataSpace att_space (ATTR1_RANK, dims2); - // Create 1st attribute for the dataset - Attribute ds_attr = dataset.createAttribute (ATTR1_NAME, PredType::NATIVE_INT, att_space); + // Create 1st attribute for the dataset + Attribute ds_attr = dataset.createAttribute (ATTR1_NAME, PredType::NATIVE_INT, att_space); - // Write attribute information - ds_attr.write (PredType::NATIVE_INT, attr_data1); + // Write attribute information + ds_attr.write (PredType::NATIVE_INT, attr_data1); - // Create dataspace for 2nd attribute - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; - DataSpace att2_space (ATTR2_RANK, dims3); + // Create dataspace for 2nd attribute + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + DataSpace att2_space (ATTR2_RANK, dims3); - // Create 2nd attribute for the dataset - Attribute ds_attr2 = dataset.createAttribute (ATTR2_NAME, PredType::NATIVE_INT, att2_space); + // Create 2nd attribute for the dataset + Attribute ds_attr2 = dataset.createAttribute (ATTR2_NAME, PredType::NATIVE_INT, att2_space); - // Write 2nd attribute information - ds_attr2.write (PredType::NATIVE_INT, attr_data2); + // Write 2nd attribute information + ds_attr2.write (PredType::NATIVE_INT, attr_data2); - // Create dataspace for 3rd attribute - hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; - DataSpace att3_space (ATTR3_RANK, dims4); + // Create dataspace for 3rd attribute + hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; + DataSpace att3_space (ATTR3_RANK, dims4); - // Create 3rd attribute for the dataset - Attribute ds_attr3 = dataset.createAttribute (ATTR3_NAME, PredType::NATIVE_DOUBLE, att3_space); + // Create 3rd attribute for the dataset + Attribute ds_attr3 = dataset.createAttribute (ATTR3_NAME, PredType::NATIVE_DOUBLE, att3_space); - // Try creating an attribute that already exists. This should fail - // since two attributes cannot have the same name. If an exception - // is not thrown for this action by createAttribute, then throw an - // invalid action exception. - try { - Attribute invalid_attr = dataset.createAttribute (ATTR3_NAME, PredType::NATIVE_DOUBLE, att3_space); + // Try creating an attribute that already exists. This should fail + // since two attributes cannot have the same name. If an exception + // is not thrown for this action by createAttribute, then throw an + // invalid action exception. + try { + Attribute invalid_attr = dataset.createAttribute (ATTR3_NAME, PredType::NATIVE_DOUBLE, att3_space); - // continuation here, that means no exception has been thrown - throw InvalidActionException("DataSet::createAttribute", "Attempting to create a duplicate attribute"); - } - catch (AttributeIException& E) // catching invalid creating attribute + // continuation here, that means no exception has been thrown + throw InvalidActionException("DataSet::createAttribute", "Attempting to create a duplicate attribute"); + } + catch (AttributeIException& E) // catching invalid creating attribute {} // do nothing, exception expected - // Write 3rd attribute information - ds_attr3.write (PredType::NATIVE_DOUBLE, attr_data3); + // Write 3rd attribute information + ds_attr3.write (PredType::NATIVE_DOUBLE, attr_data3); - PASSED(); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_attr_mult_write()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_mult_write()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_mult_write() @@ -951,39 +951,39 @@ static void test_attr_mult_read() double read_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3]={{{0}}}; // Buffer for reading 3rd attribute hsize_t i,j,k; - // Output message about test being performed + // Output message about test being performed SUBTEST("Multiple Attribute Reading Functions"); try { - // Open file - H5File fid1(FILE_MULTI, H5F_ACC_RDWR); + // Open file + H5File fid1(FILE_MULTI, H5F_ACC_RDWR); - // Open the dataset - DataSet dataset = fid1.openDataSet(DSET1_NAME); + // Open the dataset + DataSet dataset = fid1.openDataSet(DSET1_NAME); - // Verify the correct number of attributes - int num_attrs = dataset.getNumAttrs(); - verify_val(num_attrs, 3, "DataSet::getNumAttrs", __LINE__, __FILE__); + // Verify the correct number of attributes + int num_attrs = dataset.getNumAttrs(); + verify_val(num_attrs, 3, "DataSet::getNumAttrs", __LINE__, __FILE__); - // Open 1st attribute for the dataset - Attribute attr = dataset.openAttribute((unsigned)0); + // Open 1st attribute for the dataset + Attribute attr = dataset.openAttribute((unsigned)0); - /* Verify Dataspace */ + /* Verify Dataspace */ - // Get the dataspace of the attribute - DataSpace space = attr.getSpace(); + // Get the dataspace of the attribute + DataSpace space = attr.getSpace(); - // Get the rank of the dataspace and verify it - int rank = space.getSimpleExtentNdims(); - verify_val(rank, ATTR1_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + // Get the rank of the dataspace and verify it + int rank = space.getSimpleExtentNdims(); + verify_val(rank, ATTR1_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - // Get the dims of the dataspace and verify them - hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions - int ndims = space.getSimpleExtentDims(dims); - if ((long)dims[0] != (long)ATTR1_DIM1) - TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %d\n",__LINE__,(int)dims[0],ATTR1_DIM1); + // Get the dims of the dataspace and verify them + hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions + int ndims = space.getSimpleExtentDims(dims); + if ((long)dims[0] != (long)ATTR1_DIM1) + TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %d\n",__LINE__,(int)dims[0],ATTR1_DIM1); - /* Verify Datatype */ + /* Verify Datatype */ // Get the class of the datatype that is used by attr H5T_class_t type_class = attr.getTypeClass(); @@ -991,51 +991,51 @@ static void test_attr_mult_read() // Verify that the type is of integer datatype verify_val(type_class, H5T_INTEGER, "Attribute::getTypeClass", __LINE__, __FILE__); - // Get the integer datatype + // Get the integer datatype IntType i_type1 = attr.getIntType(); - // Get and verify the order of this type - H5T_order_t order = i_type1.getOrder(); - verify_val(order, PredType::NATIVE_INT.getOrder(), "DataType::getOrder", __LINE__, __FILE__); + // Get and verify the order of this type + H5T_order_t order = i_type1.getOrder(); + verify_val(order, PredType::NATIVE_INT.getOrder(), "DataType::getOrder", __LINE__, __FILE__); - // Get and verify the size of this type - size_t size = i_type1.getSize(); - verify_val(size, PredType::NATIVE_INT.getSize(), "DataType::getSize", __LINE__, __FILE__); + // Get and verify the size of this type + size_t size = i_type1.getSize(); + verify_val(size, PredType::NATIVE_INT.getSize(), "DataType::getSize", __LINE__, __FILE__); - // Read attribute information - attr.read(PredType::NATIVE_INT, read_data1); + // Read attribute information + attr.read(PredType::NATIVE_INT, read_data1); - // Verify values read in - for(i=0; iopenAttribute(ATTR1_NAME)); + // Open attribute + Attribute *attr2 = new Attribute (dset2->openAttribute(ATTR1_NAME)); - // Read data from the attribute - attr2->read(PredType::NATIVE_INT, &rdata); - verify_val(data, rdata, "Attribute::read", __LINE__, __FILE__); + // Read data from the attribute + attr2->read(PredType::NATIVE_INT, &rdata); + verify_val(data, rdata, "Attribute::read", __LINE__, __FILE__); - // Close attribute and dataset - delete attr2; - delete dset2; + // Close attribute and dataset + delete attr2; + delete dset2; #ifndef H5_NO_DEPRECATED_SYMBOLS - // Check reference count on named datatype - fid1.getObjinfo(TYPE1_NAME, statbuf); - verify_val((int)statbuf.nlink, 3, "DataSet::openAttribute", __LINE__, __FILE__); + // Check reference count on named datatype + fid1.getObjinfo(TYPE1_NAME, statbuf); + verify_val((int)statbuf.nlink, 3, "DataSet::openAttribute", __LINE__, __FILE__); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - } // end of second enclosing + } // end of second enclosing - // Unlink the dataset - fid1.unlink(DSET1_NAME); + // Unlink the dataset + fid1.unlink(DSET1_NAME); #ifndef H5_NO_DEPRECATED_SYMBOLS - // Check reference count on named datatype - fid1.getObjinfo(TYPE1_NAME, statbuf); - verify_val((int)statbuf.nlink, 1, "H5File::unlink", __LINE__, __FILE__); + // Check reference count on named datatype + fid1.getObjinfo(TYPE1_NAME, statbuf); + verify_val((int)statbuf.nlink, 1, "H5File::unlink", __LINE__, __FILE__); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - // Unlink the named datatype - fid1.unlink(TYPE1_NAME); + // Unlink the named datatype + fid1.unlink(TYPE1_NAME); - // Close file - fid1.close(); + // Close file + fid1.close(); - // Check size of file - filesize = h5_get_file_size(FILE_DTYPE.c_str(), H5P_DEFAULT); - verify_val((long)filesize, (long)empty_filesize, "Checking file size", __LINE__, __FILE__); + // Check size of file + filesize = h5_get_file_size(FILE_DTYPE.c_str(), H5P_DEFAULT); + verify_val((long)filesize, (long)empty_filesize, "Checking file size", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_attr_dtype_shared()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_dtype_shared()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_dtype_shared() @@ -1424,116 +1424,116 @@ static void test_string_attr() SUBTEST("I/O on FL and VL String Attributes"); try { - // Create file - H5File fid1(FILE_BASIC, H5F_ACC_RDWR); - - // - // Fixed-lenth string attributes - // - // Create a fixed-length string datatype to refer to. - StrType fls_type(0, ATTR_LEN); - - // Open the root group. - Group root = fid1.openGroup("/"); - - // Create dataspace for the attribute. - DataSpace att_space (H5S_SCALAR); - - /* Test Attribute::write(...,const void *buf) with Fixed len string */ - - // Create an attribute for the root group. - Attribute gr_flattr1 = root.createAttribute(ATTR1_FL_STR_NAME, fls_type, att_space); - - // Write data to the attribute. - gr_flattr1.write(fls_type, ATTRSTR_DATA.c_str()); - - /* Test Attribute::write(...,const H5std_string& strg) with FL string */ - - // Create an attribute for the root group. - Attribute gr_flattr2 = root.createAttribute(ATTR2_FL_STR_NAME, fls_type, att_space); - - // Write data to the attribute. - gr_flattr2.write(fls_type, ATTRSTR_DATA); - - /* Test Attribute::read(...,void *buf) with FL string */ - - // Read and verify the attribute string as a string of chars. - char flstring_att_check[ATTR_LEN]; - gr_flattr1.read(fls_type, flstring_att_check); - if(HDstrcmp(flstring_att_check, ATTRSTR_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), flstring_att_check); - - // Read and verify the attribute string as a string of chars; buffer - // is dynamically allocated. - size_t attr_size = gr_flattr1.getInMemDataSize(); - char *fl_dyn_string_att_check; - fl_dyn_string_att_check = new char[attr_size+1]; - gr_flattr1.read(fls_type, fl_dyn_string_att_check); - if(HDstrcmp(fl_dyn_string_att_check, ATTRSTR_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), fl_dyn_string_att_check); - delete []fl_dyn_string_att_check; - - /* Test Attribute::read(...,H5std_string& strg) with FL string */ - - // Read and verify the attribute string as an std::string. - H5std_string read_flstr1; - gr_flattr1.read(fls_type, read_flstr1); - if (read_flstr1 != ATTRSTR_DATA) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_flstr1=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_flstr1.c_str()); - - // Read and verify the attribute string as a string of chars. - HDstrcpy(flstring_att_check, ""); - gr_flattr2.read(fls_type, flstring_att_check); - if(HDstrcmp(flstring_att_check, ATTRSTR_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), flstring_att_check); - - /* Test Attribute::read(...,H5std_string& strg) with FL string */ - - // Read and verify the attribute string as an std::string. - H5std_string read_flstr2; - gr_flattr2.read(fls_type, read_flstr2); - if (read_flstr2 != ATTRSTR_DATA) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_flstr2=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_flstr2.c_str()); - - // - // Variable-lenth string attributes - // - // Create a variable length string datatype to refer to. - StrType vls_type(0, H5T_VARIABLE); - - // Create an attribute for the root group. - Attribute gr_vlattr = root.createAttribute(ATTR_VL_STR_NAME, vls_type, att_space); - - // Write data to the attribute. - gr_vlattr.write(vls_type, ATTRSTR_DATA); - - /* Test Attribute::read(...,void *buf) with Variable len string */ - // Read and verify the attribute string as a string of chars. - char *string_att_check; - gr_vlattr.read(vls_type, &string_att_check); - if(HDstrcmp(string_att_check, ATTRSTR_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,string_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), string_att_check); - HDfree(string_att_check); - - /* Test Attribute::read(...,H5std_string& strg) with VL string */ - // Read and verify the attribute string as an std::string. - H5std_string read_str; - gr_vlattr.read(vls_type, read_str); - if (read_str != ATTRSTR_DATA) - TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_str=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_str.c_str()); - PASSED(); + // Create file + H5File fid1(FILE_BASIC, H5F_ACC_RDWR); + + // + // Fixed-lenth string attributes + // + // Create a fixed-length string datatype to refer to. + StrType fls_type(0, ATTR_LEN); + + // Open the root group. + Group root = fid1.openGroup("/"); + + // Create dataspace for the attribute. + DataSpace att_space (H5S_SCALAR); + + /* Test Attribute::write(...,const void *buf) with Fixed len string */ + + // Create an attribute for the root group. + Attribute gr_flattr1 = root.createAttribute(ATTR1_FL_STR_NAME, fls_type, att_space); + + // Write data to the attribute. + gr_flattr1.write(fls_type, ATTRSTR_DATA.c_str()); + + /* Test Attribute::write(...,const H5std_string& strg) with FL string */ + + // Create an attribute for the root group. + Attribute gr_flattr2 = root.createAttribute(ATTR2_FL_STR_NAME, fls_type, att_space); + + // Write data to the attribute. + gr_flattr2.write(fls_type, ATTRSTR_DATA); + + /* Test Attribute::read(...,void *buf) with FL string */ + + // Read and verify the attribute string as a string of chars. + char flstring_att_check[ATTR_LEN]; + gr_flattr1.read(fls_type, flstring_att_check); + if(HDstrcmp(flstring_att_check, ATTRSTR_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), flstring_att_check); + + // Read and verify the attribute string as a string of chars; buffer + // is dynamically allocated. + size_t attr_size = gr_flattr1.getInMemDataSize(); + char *fl_dyn_string_att_check; + fl_dyn_string_att_check = new char[attr_size+1]; + gr_flattr1.read(fls_type, fl_dyn_string_att_check); + if(HDstrcmp(fl_dyn_string_att_check, ATTRSTR_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), fl_dyn_string_att_check); + delete []fl_dyn_string_att_check; + + /* Test Attribute::read(...,H5std_string& strg) with FL string */ + + // Read and verify the attribute string as an std::string. + H5std_string read_flstr1; + gr_flattr1.read(fls_type, read_flstr1); + if (read_flstr1 != ATTRSTR_DATA) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_flstr1=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_flstr1.c_str()); + + // Read and verify the attribute string as a string of chars. + HDstrcpy(flstring_att_check, ""); + gr_flattr2.read(fls_type, flstring_att_check); + if(HDstrcmp(flstring_att_check, ATTRSTR_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,flstring_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), flstring_att_check); + + /* Test Attribute::read(...,H5std_string& strg) with FL string */ + + // Read and verify the attribute string as an std::string. + H5std_string read_flstr2; + gr_flattr2.read(fls_type, read_flstr2); + if (read_flstr2 != ATTRSTR_DATA) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_flstr2=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_flstr2.c_str()); + + // + // Variable-lenth string attributes + // + // Create a variable length string datatype to refer to. + StrType vls_type(0, H5T_VARIABLE); + + // Create an attribute for the root group. + Attribute gr_vlattr = root.createAttribute(ATTR_VL_STR_NAME, vls_type, att_space); + + // Write data to the attribute. + gr_vlattr.write(vls_type, ATTRSTR_DATA); + + /* Test Attribute::read(...,void *buf) with Variable len string */ + // Read and verify the attribute string as a string of chars. + char *string_att_check; + gr_vlattr.read(vls_type, &string_att_check); + if(HDstrcmp(string_att_check, ATTRSTR_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,string_att_check=%s\n",__LINE__, ATTRSTR_DATA.c_str(), string_att_check); + HDfree(string_att_check); + + /* Test Attribute::read(...,H5std_string& strg) with VL string */ + // Read and verify the attribute string as an std::string. + H5std_string read_str; + gr_vlattr.read(vls_type, read_str); + if (read_str != ATTRSTR_DATA) + TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,read_str=%s\n",__LINE__, ATTRSTR_DATA.c_str(), read_str.c_str()); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_string_attr()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_string_attr()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_string_attr() /**************************************************************** ** ** test_attr_exists(): Test checking for attribute existence. -** (additional attrExists tests are in test_attr_rename()) +** (additional attrExists tests are in test_attr_rename()) ** ****************************************************************/ static void test_attr_exists() @@ -1542,40 +1542,40 @@ static void test_attr_exists() SUBTEST("Check Attribute Existence"); try { - // Open file. - H5File fid1(FILE_BASIC, H5F_ACC_RDWR); + // Open file. + H5File fid1(FILE_BASIC, H5F_ACC_RDWR); - // Open the root group. - Group root = fid1.openGroup("/"); + // Open the root group. + Group root = fid1.openGroup("/"); - // Check for existence of attribute - bool attr_exists = fid1.attrExists(ATTR1_FL_STR_NAME); - if (attr_exists == false) - throw InvalidActionException("H5File::attrExists", "fid1, ATTR1_FL_STR_NAMEAttribute should exist but does not"); + // Check for existence of attribute + bool attr_exists = fid1.attrExists(ATTR1_FL_STR_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "fid1, ATTR1_FL_STR_NAMEAttribute should exist but does not"); - // Check for existence of attribute - attr_exists = fid1.attrExists(FATTR1_NAME); - if (attr_exists == false) - throw InvalidActionException("H5File::attrExists", "fid1,FATTR2_NAMEAttribute should exist but does not"); + // Check for existence of attribute + attr_exists = fid1.attrExists(FATTR1_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "fid1,FATTR2_NAMEAttribute should exist but does not"); - // Open a group. - Group group = fid1.openGroup(GROUP1_NAME); + // Open a group. + Group group = fid1.openGroup(GROUP1_NAME); - // Check for existence of attribute - attr_exists = group.attrExists(ATTR2_NAME); - if (attr_exists == false) - throw InvalidActionException("H5File::attrExists", "group, ATTR2_NAMEAttribute should exist but does not"); + // Check for existence of attribute + attr_exists = group.attrExists(ATTR2_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "group, ATTR2_NAMEAttribute should exist but does not"); - PASSED(); + PASSED(); } // end try block catch (InvalidActionException& E) { - issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); } catch (Exception& E) { - issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_exists() @@ -1591,100 +1591,100 @@ const unsigned MAX_COMPACT_DEF = 8; const unsigned MIN_DENSE_DEF = 6; static void test_attr_dense_create(FileCreatPropList& fcpl, - FileAccPropList& fapl) + FileAccPropList& fapl) { // Output message about test being performed SUBTEST("Dense Attribute Storage Creation"); try { - // Create file - H5File fid1 (FILE_CRTPROPS, H5F_ACC_TRUNC, fcpl, fapl); + // Create file + H5File fid1 (FILE_CRTPROPS, H5F_ACC_TRUNC, fcpl, fapl); - // Close file - fid1.close(); + // Close file + fid1.close(); - // Get size of file - h5_stat_size_t empty_filesize; // Size of empty file - empty_filesize = h5_get_file_size(FILE_CRTPROPS.c_str(), fapl.getId()); - if (empty_filesize < 0) + // Get size of file + h5_stat_size_t empty_filesize; // Size of empty file + empty_filesize = h5_get_file_size(FILE_CRTPROPS.c_str(), fapl.getId()); + if (empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); - // Re-open file - fid1.openFile(FILE_CRTPROPS, H5F_ACC_RDWR, fapl); + // Re-open file + fid1.openFile(FILE_CRTPROPS, H5F_ACC_RDWR, fapl); - // Create dataspace for dataset - DataSpace ds_space(H5S_SCALAR); + // Create dataspace for dataset + DataSpace ds_space(H5S_SCALAR); - // Create dataset creation property list. - DSetCreatPropList dcpl; + // Create dataset creation property list. + DSetCreatPropList dcpl; - // Create a dataset - DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space, dcpl); + // Create a dataset + DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space, dcpl); - unsigned max_compact = 0, min_dense = 0; + unsigned max_compact = 0, min_dense = 0; - // Retrieve limits for compact/dense attribute storage - dcpl.getAttrPhaseChange(max_compact, min_dense); - verify_val(max_compact, MAX_COMPACT_DEF, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); - verify_val(min_dense, MIN_DENSE_DEF, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); + // Retrieve limits for compact/dense attribute storage + dcpl.getAttrPhaseChange(max_compact, min_dense); + verify_val(max_compact, MAX_COMPACT_DEF, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); + verify_val(min_dense, MIN_DENSE_DEF, "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); - // Set new compact/dense attribute storage limits to some random numbers - dcpl.setAttrPhaseChange(7, 5); + // Set new compact/dense attribute storage limits to some random numbers + dcpl.setAttrPhaseChange(7, 5); - // Retrieve limits for compact/dense attribute storage and verify them - dcpl.getAttrPhaseChange(max_compact, min_dense); - verify_val(max_compact, static_cast(7), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); - verify_val(min_dense, static_cast(5), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); + // Retrieve limits for compact/dense attribute storage and verify them + dcpl.getAttrPhaseChange(max_compact, min_dense); + verify_val(max_compact, static_cast(7), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); + verify_val(min_dense, static_cast(5), "DSetCreatPropList::getAttrPhaseChange",__LINE__,__FILE__); - // Close property list - dcpl.close(); + // Close property list + dcpl.close(); - // H5O_is_attr_dense_test - un-usable + // H5O_is_attr_dense_test - un-usable - // Add attributes, until just before converting to dense storage - char attr_name[NAME_BUF_SIZE]; - unsigned attr_num; - for (attr_num = 0; attr_num < max_compact; attr_num++) - { - // Create attribute - sprintf(attr_name, "attr %02u", attr_num); - Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); + // Add attributes, until just before converting to dense storage + char attr_name[NAME_BUF_SIZE]; + unsigned attr_num; + for (attr_num = 0; attr_num < max_compact; attr_num++) + { + // Create attribute + sprintf(attr_name, "attr %02u", attr_num); + Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); - // Write data to the attribute - attr.write(PredType::NATIVE_UINT, &attr_num); - } // end for + // Write data to the attribute + attr.write(PredType::NATIVE_UINT, &attr_num); + } // end for - // H5O_is_attr_dense_test - un-usable + // H5O_is_attr_dense_test - un-usable - { // Add one more attribute, to push into "dense" storage + { // Add one more attribute, to push into "dense" storage - // Create another attribute - sprintf(attr_name, "attr %02u", attr_num); - Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); + // Create another attribute + sprintf(attr_name, "attr %02u", attr_num); + Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); - // Write data to the attribute - attr.write(PredType::NATIVE_UINT, &attr_num); - } + // Write data to the attribute + attr.write(PredType::NATIVE_UINT, &attr_num); + } - // Attempt to add attribute again, which should fail - try - { - // Create another attribute - sprintf(attr_name, "attr %02u", attr_num); - Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); + // Attempt to add attribute again, which should fail + try + { + // Create another attribute + sprintf(attr_name, "attr %02u", attr_num); + Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); - // continuation here, that means no exception has been thrown - throw InvalidActionException("DataSet::createAttribute", "Maximum number of attributes has been reached"); - } - catch (AttributeIException& E) // catching invalid action + // continuation here, that means no exception has been thrown + throw InvalidActionException("DataSet::createAttribute", "Maximum number of attributes has been reached"); + } + catch (AttributeIException& E) // catching invalid action {} // do nothing, exception expected - PASSED(); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_attr_dense_create()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_dense_create()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_dense_create() @@ -1695,81 +1695,81 @@ static void test_attr_dense_create(FileCreatPropList& fcpl, ** ****************************************************************/ static void test_attr_corder_create_basic(FileCreatPropList& fcpl, - FileAccPropList& fapl) + FileAccPropList& fapl) { // Output message about test being performed SUBTEST("Basic Code for Attributes with Creation Order Info"); try { - // Create file - H5File fid1 (FILE_CRTPROPS, H5F_ACC_TRUNC, fcpl, fapl); - - // Create dataset creation property list. - DSetCreatPropList dcpl; - - // Get creation order indexing on object - unsigned crt_order_flags = 0; - crt_order_flags = dcpl.getAttrCrtOrder(); - verify_val(crt_order_flags, (unsigned)0, "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); - - // Setting invalid combination of a attribute order creation order - // indexing on should fail - try { - dcpl.setAttrCrtOrder(H5P_CRT_ORDER_INDEXED); - - // continuation here, that means no exception has been thrown - throw InvalidActionException("DSetCreatPropList::getAttrCrtOrder", "Indexing cannot be set alone, order tracking is required"); - } - catch (PropListIException& E) // catching invalid action + // Create file + H5File fid1 (FILE_CRTPROPS, H5F_ACC_TRUNC, fcpl, fapl); + + // Create dataset creation property list. + DSetCreatPropList dcpl; + + // Get creation order indexing on object + unsigned crt_order_flags = 0; + crt_order_flags = dcpl.getAttrCrtOrder(); + verify_val(crt_order_flags, (unsigned)0, "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); + + // Setting invalid combination of a attribute order creation order + // indexing on should fail + try { + dcpl.setAttrCrtOrder(H5P_CRT_ORDER_INDEXED); + + // continuation here, that means no exception has been thrown + throw InvalidActionException("DSetCreatPropList::getAttrCrtOrder", "Indexing cannot be set alone, order tracking is required"); + } + catch (PropListIException& E) // catching invalid action {} // do nothing, exception expected - // Set attribute creation order tracking & indexing for object then - // verify them - dcpl.setAttrCrtOrder(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED); - crt_order_flags = dcpl.getAttrCrtOrder(); - verify_val(crt_order_flags, (unsigned)(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED), "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); + // Set attribute creation order tracking & indexing for object then + // verify them + dcpl.setAttrCrtOrder(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED); + crt_order_flags = dcpl.getAttrCrtOrder(); + verify_val(crt_order_flags, (unsigned)(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED), "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); - // Create dataspace for dataset - DataSpace ds_space(H5S_SCALAR); + // Create dataspace for dataset + DataSpace ds_space(H5S_SCALAR); - // Create a dataset - DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space, dcpl); + // Create a dataset + DataSet dataset = fid1.createDataSet(DSET1_NAME, PredType::NATIVE_UCHAR, ds_space, dcpl); - // Close dataspace - ds_space.close(); + // Close dataspace + ds_space.close(); - // Check on dataset's attribute storage status. - // NOTE: Wrappers not available yet (H5O_is_attr_empty_test - // and H5O_is_attr_dense_test) + // Check on dataset's attribute storage status. + // NOTE: Wrappers not available yet (H5O_is_attr_empty_test + // and H5O_is_attr_dense_test) - // Close dataset - dataset.close(); + // Close dataset + dataset.close(); - // Close property list - dcpl.close(); + // Close property list + dcpl.close(); - // Close file - fid1.close(); + // Close file + fid1.close(); - // Re-open file - fid1.openFile(FILE_CRTPROPS, H5F_ACC_RDWR, fapl); + // Re-open file + fid1.openFile(FILE_CRTPROPS, H5F_ACC_RDWR, fapl); - // Open dataset created previously - dataset = fid1.openDataSet(DSET1_NAME); + // Open dataset created previously + dataset = fid1.openDataSet(DSET1_NAME); - // Retrieve dataset creation property list for the dataset - dcpl = dataset.getCreatePlist(); + // Retrieve dataset creation property list for the dataset + dcpl = dataset.getCreatePlist(); - // Query the attribute creation properties - crt_order_flags = dcpl.getAttrCrtOrder(); - verify_val(crt_order_flags, (unsigned)(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED), "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); + // Query the attribute creation properties + crt_order_flags = dcpl.getAttrCrtOrder(); + verify_val(crt_order_flags, (unsigned)(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED), "DSetCreatPropList::getAttrCrtOrder",__LINE__,__FILE__); - PASSED(); + PASSED(); } // end try block catch (Exception& E) { - issue_fail_msg("test_attr_corder_create_basic()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr_corder_create_basic()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr_corder_create_basic() @@ -1814,42 +1814,42 @@ void test_attr() // Set the file access proplist for the type of format if (new_format) { - MESSAGE(7, ("testing with new file format\n")); - curr_fapl = fapl_new; + MESSAGE(7, ("testing with new file format\n")); + curr_fapl = fapl_new; } else { - MESSAGE(7, ("testing with old file format\n")); - curr_fapl = fapl; + MESSAGE(7, ("testing with old file format\n")); + curr_fapl = fapl; } - test_attr_basic_write(); // Test basic H5A writing code - test_attr_getname(); // Test overloads of Attribute::getName - test_attr_rename(); // Test renaming attribute - test_attr_basic_read(); // Test basic H5A reading code + test_attr_basic_write(); // Test basic H5A writing code + test_attr_getname(); // Test overloads of Attribute::getName + test_attr_rename(); // Test renaming attribute + test_attr_basic_read(); // Test basic H5A reading code - test_attr_compound_write(); // Test complex datatype H5A writing code - test_attr_compound_read(); // Test complex datatype H5A reading code + test_attr_compound_write(); // Test complex datatype H5A writing code + test_attr_compound_read(); // Test complex datatype H5A reading code - test_attr_scalar_write(); // Test scalar dataspace H5A writing code - test_attr_scalar_read(); // Test scalar dataspace H5A reading code + test_attr_scalar_write(); // Test scalar dataspace H5A writing code + test_attr_scalar_read(); // Test scalar dataspace H5A reading code - test_attr_mult_write(); // Test writing multiple attributes - test_attr_mult_read(); // Test reading multiple attributes - test_attr_delete(); // Test deleting attributes + test_attr_mult_write(); // Test writing multiple attributes + test_attr_mult_read(); // Test reading multiple attributes + test_attr_delete(); // Test deleting attributes - test_attr_dtype_shared(); // Test using shared datatypes in attributes + test_attr_dtype_shared(); // Test using shared datatypes in attributes - test_string_attr(); // Test read/write string attribute - test_attr_exists(); // Test H5Location::attrExists + test_string_attr(); // Test read/write string attribute + test_attr_exists(); // Test H5Location::attrExists // Test with new format if (new_format) { - // Test dense attribute storage creation + // Test dense attribute storage creation test_attr_dense_create(fcpl, curr_fapl); - // Test create objects with attribute creation info + // Test create objects with attribute creation info test_attr_corder_create_basic(fcpl, curr_fapl); } } // end for @@ -1857,18 +1857,18 @@ void test_attr() catch (Exception& E) { - issue_fail_msg("test_attr()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_attr()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr() /*------------------------------------------------------------------------- - * Function cleanup_attr + * Function: cleanup_attr * - * Purpose Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return none + * Return: none * - * Programmer Albert Cheng + * Programmer: Albert Cheng * July 2, 1998 * * Modifications: diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index ee634c2..f49ebb2 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -34,7 +34,7 @@ using namespace H5; #include "h5cpputil.h" // C++ utilility header file /* Number of elements in each test */ -#define NTESTELEM 100000 +#define NTESTELEM 100000 typedef struct complex_t { double re; @@ -45,11 +45,11 @@ typedef struct complex_t { /*------------------------------------------------------------------------- * Function: test_compound_1 * - * Purpose Tests various things about compound data types. + * Purpose: Tests various things about compound data types. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * January, 2007 * * Modifications: @@ -61,13 +61,13 @@ static void test_compound_1() // Output message about test being performed SUBTEST("Compound Data Types"); try { - // Create an empty compound datatype - CompType complex_type(sizeof(complex_t)); + // Create an empty compound datatype + CompType complex_type(sizeof(complex_t)); - // Add a couple of fields - complex_type.insertMember("real", HOFFSET(complex_t, re), PredType::NATIVE_DOUBLE); - complex_type.insertMember("imaginary", HOFFSET(complex_t, im), PredType::NATIVE_DOUBLE); - PASSED(); + // Add a couple of fields + complex_type.insertMember("real", HOFFSET(complex_t, re), PredType::NATIVE_DOUBLE); + complex_type.insertMember("imaginary", HOFFSET(complex_t, im), PredType::NATIVE_DOUBLE); + PASSED(); } // end of try block catch (Exception& E) @@ -78,15 +78,15 @@ static void test_compound_1() /*------------------------------------------------------------------------- - * Function: test_compound_2 + * Function: test_compound_2 * - * Purpose Tests a compound type conversion where the source and - * destination are the same except for the order of the - * elements. + * Purpose: Tests a compound type conversion where the source and + * destination are the same except for the order of the + * elements. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) + * Programmer: Binh-Minh Ribler (use C version) * January, 2007 * * Modifications: @@ -96,100 +96,100 @@ static void test_compound_1() static void test_compound_2() { typedef struct { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } src_typ_t; typedef struct { - int e, d, c[4], b, a; + int e, d, c[4], b, a; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - const int nelmts = NTESTELEM; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + const int nelmts = NTESTELEM; const hsize_t four = 4; - int i; + int i; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; ArrayType *array_dt = NULL; // Output message about test being performed SUBTEST("Compound Element Reordering"); try { - // Sizes should be the same, but be careful just in case - buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); - for (i=0; ia = i*8+0; - s_ptr->b = i*8+1; - s_ptr->c[0] = i*8+2; - s_ptr->c[1] = i*8+3; - s_ptr->c[2] = i*8+4; - s_ptr->c[3] = i*8+5; - s_ptr->d = i*8+6; - s_ptr->e = i*8+7; - } - memcpy(buf, orig, nelmts*sizeof(src_typ_t)); - - // Build hdf5 datatypes - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType st(sizeof(src_typ_t)); - st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); - st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); - st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); - st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); - st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); + // Sizes should be the same, but be careful just in case + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); + for (i=0; ia = i*8+0; + s_ptr->b = i*8+1; + s_ptr->c[0] = i*8+2; + s_ptr->c[1] = i*8+3; + s_ptr->c[2] = i*8+4; + s_ptr->c[3] = i*8+5; + s_ptr->d = i*8+6; + s_ptr->e = i*8+7; + } + memcpy(buf, orig, nelmts*sizeof(src_typ_t)); + + // Build hdf5 datatypes + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType st(sizeof(src_typ_t)); + st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); + st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); + st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); + st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); delete array_dt; - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType dt(sizeof(dst_typ_t)); - dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); - dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_INT); - dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); - dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_INT); - dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); - - // Perform the conversion - st.convert(dt, (size_t)nelmts, buf, bkg); - - // Compare results - for (i=0; ia != d_ptr->a || - s_ptr->b != d_ptr->b || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->d != d_ptr->d || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - cerr << " i=" << i << endl; - cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b - << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," - << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" - << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; - cerr << " dst={a=" << s_ptr->a << ", b=" << s_ptr->b - << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," - << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" - << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; - } - } - // Release resources - HDfree(buf); - HDfree(bkg); - HDfree(orig); - s_ptr = NULL; - d_ptr = NULL; - st.close(); - dt.close(); - PASSED(); + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType dt(sizeof(dst_typ_t)); + dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); + dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_INT); + dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); + dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_INT); + dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); + + // Perform the conversion + st.convert(dt, (size_t)nelmts, buf, bkg); + + // Compare results + for (i=0; ia != d_ptr->a || + s_ptr->b != d_ptr->b || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->d != d_ptr->d || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + cerr << " i=" << i << endl; + cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b + << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," + << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" + << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; + cerr << " dst={a=" << s_ptr->a << ", b=" << s_ptr->b + << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," + << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" + << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; + } + } + // Release resources + HDfree(buf); + HDfree(bkg); + HDfree(orig); + s_ptr = NULL; + d_ptr = NULL; + st.close(); + dt.close(); + PASSED(); } // end of try block catch (Exception& E) @@ -203,15 +203,15 @@ static void test_compound_2() /*------------------------------------------------------------------------- - * Function: test_compound_3 + * Function: test_compound_3 * - * Purpose Tests compound conversions where the source and destination - * are the same except the destination is missing a couple - * members which appear in the source. + * Purpose: Tests compound conversions where the source and destination + * are the same except the destination is missing a couple + * members which appear in the source. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) + * Programmer: Binh-Minh Ribler (use C version) * January, 2007 * * Modifications: @@ -221,16 +221,16 @@ static void test_compound_2() static void test_compound_3() { typedef struct { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } src_typ_t; typedef struct { - int a, c[4], e; + int a, c[4], e; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - int i; - const int nelmts = NTESTELEM; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + int i; + const int nelmts = NTESTELEM; const hsize_t four = 4; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; ArrayType* array_dt = NULL; @@ -238,85 +238,85 @@ static void test_compound_3() // Output message about test being performed SUBTEST("Compound Datatype Subset Conversions"); try { - /* Initialize */ - buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); - for (i=0; ia = i*8+0; - s_ptr->b = i*8+1; - s_ptr->c[0] = i*8+2; - s_ptr->c[1] = i*8+3; - s_ptr->c[2] = i*8+4; - s_ptr->c[3] = i*8+5; - s_ptr->d = i*8+6; - s_ptr->e = i*8+7; - } - memcpy(buf, orig, nelmts*sizeof(src_typ_t)); - - /* Build hdf5 datatypes */ - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType st(sizeof(src_typ_t)); - st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); - st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); - st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); - st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); - st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); + /* Initialize */ + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); + for (i=0; ia = i*8+0; + s_ptr->b = i*8+1; + s_ptr->c[0] = i*8+2; + s_ptr->c[1] = i*8+3; + s_ptr->c[2] = i*8+4; + s_ptr->c[3] = i*8+5; + s_ptr->d = i*8+6; + s_ptr->e = i*8+7; + } + memcpy(buf, orig, nelmts*sizeof(src_typ_t)); + + /* Build hdf5 datatypes */ + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType st(sizeof(src_typ_t)); + st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); + st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); + st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); + st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); delete array_dt; - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType dt(sizeof(dst_typ_t)); - dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); - dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); - dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); - - /* Perform the conversion */ - st.convert(dt, (size_t)nelmts, buf, bkg); - - /* Compare results */ - for (i=0; ia != d_ptr->a || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - cerr << " i=" << i << endl; - cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b - << ", c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," - << s_ptr->c[2] << "," << s_ptr->c[3] << "], d=" - << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; - cerr << " dst={a=" << d_ptr->a - << ", c=[" << d_ptr->c[0] << "," << d_ptr->c[1] << "," - << d_ptr->c[2] << "," << d_ptr->c[3] << "], e=" - << d_ptr->e << "}" << endl; - } // if - } // for - - /* Release resources */ - HDfree(buf); - HDfree(bkg); - HDfree(orig); - s_ptr = NULL; - d_ptr = NULL; - st.close(); - dt.close(); - PASSED(); + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType dt(sizeof(dst_typ_t)); + dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); + dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); + dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); + + /* Perform the conversion */ + st.convert(dt, (size_t)nelmts, buf, bkg); + + /* Compare results */ + for (i=0; ia != d_ptr->a || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + cerr << " i=" << i << endl; + cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b + << ", c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," + << s_ptr->c[2] << "," << s_ptr->c[3] << "], d=" + << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; + cerr << " dst={a=" << d_ptr->a + << ", c=[" << d_ptr->c[0] << "," << d_ptr->c[1] << "," + << d_ptr->c[2] << "," << d_ptr->c[3] << "], e=" + << d_ptr->e << "}" << endl; + } // if + } // for + + /* Release resources */ + HDfree(buf); + HDfree(bkg); + HDfree(orig); + s_ptr = NULL; + d_ptr = NULL; + st.close(); + dt.close(); + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } if(array_dt) @@ -325,16 +325,16 @@ static void test_compound_3() /*------------------------------------------------------------------------- - * Function: test_compound_4 + * Function: test_compound_4 * - * Purpose Tests compound conversions when the destination has the same - * fields as the source but one or more of the fields are - * smaller. + * Purpose: Tests compound conversions when the destination has the same + * fields as the source but one or more of the fields are + * smaller. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -344,20 +344,20 @@ static void test_compound_4() { typedef struct { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } src_typ_t; typedef struct { - short b; - int a, c[4]; - short d; - int e; + short b; + int a, c[4]; + short d; + int e; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - int i; - const int nelmts = NTESTELEM; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + int i; + const int nelmts = NTESTELEM; const hsize_t four = 4; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; ArrayType* array_dt = NULL; @@ -365,85 +365,85 @@ static void test_compound_4() // Output message about test being performed SUBTEST("Compound Element Shrinking & Reordering"); try { - /* Sizes should be the same, but be careful just in case */ - buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); - for (i=0; ia = i*8+0; - s_ptr->b = (i*8+1) & 0x7fff; - s_ptr->c[0] = i*8+2; - s_ptr->c[1] = i*8+3; - s_ptr->c[2] = i*8+4; - s_ptr->c[3] = i*8+5; - s_ptr->d = (i*8+6) & 0x7fff; - s_ptr->e = i*8+7; - } - memcpy(buf, orig, nelmts*sizeof(src_typ_t)); - - /* Build hdf5 datatypes */ - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType st(sizeof(src_typ_t)); - st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); - st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); - st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); - st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); - st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); + /* Sizes should be the same, but be careful just in case */ + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); + for (i=0; ia = i*8+0; + s_ptr->b = (i*8+1) & 0x7fff; + s_ptr->c[0] = i*8+2; + s_ptr->c[1] = i*8+3; + s_ptr->c[2] = i*8+4; + s_ptr->c[3] = i*8+5; + s_ptr->d = (i*8+6) & 0x7fff; + s_ptr->e = i*8+7; + } + memcpy(buf, orig, nelmts*sizeof(src_typ_t)); + + /* Build hdf5 datatypes */ + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType st(sizeof(src_typ_t)); + st.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_INT); + st.insertMember("c", HOFFSET(src_typ_t, c), *array_dt); + st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_INT); + st.insertMember("e", HOFFSET(src_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); delete array_dt; - array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); - - // Create an empty compound datatype - CompType dt(sizeof(dst_typ_t)); - dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); - dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_SHORT); - dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); - dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_SHORT); - dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); - array_dt->close(); - - /* Perform the conversion */ - st.convert(dt, (size_t)nelmts, buf, bkg); - - /* Compare results */ - for (i=0; ia != d_ptr->a || - s_ptr->b != d_ptr->b || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->d != d_ptr->d || - s_ptr->e != d_ptr->e) - { - H5_FAILED(); - cerr << " i=" << i << endl; - cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b - << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," - << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" - << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; - cerr << " dst={a=" << d_ptr->a << ", b=" << d_ptr->b - << "c=[" << d_ptr->c[0] << "," << d_ptr->c[1] << "," - << d_ptr->c[2] << "," << d_ptr->c[3] << ", d=" - << d_ptr->d << ", e=" << d_ptr->e << "}" << endl; - } // if - } // for - - /* Release resources */ - HDfree(buf); - HDfree(bkg); - HDfree(orig); - s_ptr = NULL; - d_ptr = NULL; - st.close(); - dt.close(); - PASSED(); + array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four); + + // Create an empty compound datatype + CompType dt(sizeof(dst_typ_t)); + dt.insertMember("a", HOFFSET(dst_typ_t, a), PredType::NATIVE_INT); + dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_SHORT); + dt.insertMember("c", HOFFSET(dst_typ_t, c), *array_dt); + dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_SHORT); + dt.insertMember("e", HOFFSET(dst_typ_t, e), PredType::NATIVE_INT); + array_dt->close(); + + /* Perform the conversion */ + st.convert(dt, (size_t)nelmts, buf, bkg); + + /* Compare results */ + for (i=0; ia != d_ptr->a || + s_ptr->b != d_ptr->b || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->d != d_ptr->d || + s_ptr->e != d_ptr->e) + { + H5_FAILED(); + cerr << " i=" << i << endl; + cerr << " src={a=" << s_ptr->a << ", b=" << s_ptr->b + << "c=[" << s_ptr->c[0] << "," << s_ptr->c[1] << "," + << s_ptr->c[2] << "," << s_ptr->c[3] << ", d=" + << s_ptr->d << ", e=" << s_ptr->e << "}" << endl; + cerr << " dst={a=" << d_ptr->a << ", b=" << d_ptr->b + << "c=[" << d_ptr->c[0] << "," << d_ptr->c[1] << "," + << d_ptr->c[2] << "," << d_ptr->c[3] << ", d=" + << d_ptr->d << ", e=" << d_ptr->e << "}" << endl; + } // if + } // for + + /* Release resources */ + HDfree(buf); + HDfree(bkg); + HDfree(orig); + s_ptr = NULL; + d_ptr = NULL; + st.close(); + dt.close(); + PASSED(); } // end of try block catch (Exception& E) @@ -457,17 +457,17 @@ static void test_compound_4() /*------------------------------------------------------------------------- - * Function: test_compound_5 + * Function: test_compound_5 * - * Purpose Many versions of HDF5 have a bug in the optimized compound + * Purpose: Many versions of HDF5 have a bug in the optimized compound * datatype conversion function, H5T_conv_struct_opt(), which * is triggered when the top-level type contains a struct * which must undergo a conversion. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -499,55 +499,55 @@ static void test_compound_5() SUBTEST("Optimized Struct Converter"); try { - /* Build datatypes */ - array_dt = new ArrayType(PredType::NATIVE_SHORT, 1, dims); - CompType short_array(4*sizeof(short)); - short_array.insertMember("_", 0, *array_dt); - array_dt->close(); + /* Build datatypes */ + array_dt = new ArrayType(PredType::NATIVE_SHORT, 1, dims); + CompType short_array(4*sizeof(short)); + short_array.insertMember("_", 0, *array_dt); + array_dt->close(); delete array_dt; - CompType int_array(4*sizeof(int)); - array_dt = new ArrayType(PredType::NATIVE_INT, 1, dims); - int_array.insertMember("_", 0, *array_dt); - array_dt->close(); - - StrType strg(PredType::C_S1, 16); - CompType src_type(sizeof(src_typ_t)); - src_type.insertMember("name", HOFFSET(src_typ_t, name), strg); - src_type.insertMember("tdim", HOFFSET(src_typ_t, tdim), PredType::NATIVE_SHORT); - src_type.insertMember("coll_ids", HOFFSET(src_typ_t, coll_ids), short_array); - - CompType dst_type(sizeof(dst_typ_t)); - dst_type.insertMember("name", HOFFSET(dst_typ_t, name), strg); - dst_type.insertMember("tdim", HOFFSET(dst_typ_t, tdim), PredType::NATIVE_SHORT); - dst_type.insertMember("coll_ids", HOFFSET(dst_typ_t, coll_ids), int_array); - - /* Convert data */ - memcpy(buf, src, sizeof(src)); - src_type.convert(dst_type, (size_t)2, buf, bkg); - dst = (dst_typ_t*)buf; - - /* Cleanup */ - src_type.close(); - dst_type.close(); - strg.close(); - short_array.close(); - int_array.close(); - - /* Check results */ - if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || - src[1].tdim!=dst[1].tdim || - src[1].coll_ids[0]!=dst[1].coll_ids[0] || - src[1].coll_ids[1]!=dst[1].coll_ids[1] || - src[1].coll_ids[2]!=dst[1].coll_ids[2] || - src[1].coll_ids[3]!=dst[1].coll_ids[3]) - { H5_FAILED(); } - - /* Free memory buffers */ - HDfree(buf); - HDfree(bkg); - dst = NULL; - PASSED(); + CompType int_array(4*sizeof(int)); + array_dt = new ArrayType(PredType::NATIVE_INT, 1, dims); + int_array.insertMember("_", 0, *array_dt); + array_dt->close(); + + StrType strg(PredType::C_S1, 16); + CompType src_type(sizeof(src_typ_t)); + src_type.insertMember("name", HOFFSET(src_typ_t, name), strg); + src_type.insertMember("tdim", HOFFSET(src_typ_t, tdim), PredType::NATIVE_SHORT); + src_type.insertMember("coll_ids", HOFFSET(src_typ_t, coll_ids), short_array); + + CompType dst_type(sizeof(dst_typ_t)); + dst_type.insertMember("name", HOFFSET(dst_typ_t, name), strg); + dst_type.insertMember("tdim", HOFFSET(dst_typ_t, tdim), PredType::NATIVE_SHORT); + dst_type.insertMember("coll_ids", HOFFSET(dst_typ_t, coll_ids), int_array); + + /* Convert data */ + memcpy(buf, src, sizeof(src)); + src_type.convert(dst_type, (size_t)2, buf, bkg); + dst = (dst_typ_t*)buf; + + /* Cleanup */ + src_type.close(); + dst_type.close(); + strg.close(); + short_array.close(); + int_array.close(); + + /* Check results */ + if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || + src[1].tdim!=dst[1].tdim || + src[1].coll_ids[0]!=dst[1].coll_ids[0] || + src[1].coll_ids[1]!=dst[1].coll_ids[1] || + src[1].coll_ids[2]!=dst[1].coll_ids[2] || + src[1].coll_ids[3]!=dst[1].coll_ids[3]) + { H5_FAILED(); } + + /* Free memory buffers */ + HDfree(buf); + HDfree(bkg); + dst = NULL; + PASSED(); } // end of try block catch (Exception& E) @@ -561,16 +561,16 @@ static void test_compound_5() /*------------------------------------------------------------------------- - * Function: test_compound_6 + * Function: test_compound_6 * - * Purpose Tests compound conversions when the destination has the same - * fields as the source but one or more of the fields are - * larger. + * Purpose: Tests compound conversions when the destination has the same + * fields as the source but one or more of the fields are + * larger. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -579,72 +579,72 @@ static void test_compound_5() static void test_compound_6() { typedef struct { - short b; - short d; + short b; + short d; } src_typ_t; typedef struct { - long b; - long d; + long b; + long d; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - int i; - const int nelmts = NTESTELEM; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + int i; + const int nelmts = NTESTELEM; unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; // Output message about test being performed SUBTEST("Compound Element Growing"); try { - /* Sizes should be the same, but be careful just in case */ - buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); - for (i=0; ib = (i*8+1) & 0x7fff; - s_ptr->d = (i*8+6) & 0x7fff; - } - memcpy(buf, orig, nelmts*sizeof(src_typ_t)); - - /* Build hdf5 datatypes */ - CompType st(sizeof(src_typ_t)); - st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_SHORT); - st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_SHORT); - - CompType dt(sizeof(dst_typ_t)); - dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_LONG); - dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_LONG); - - /* Perform the conversion */ - st.convert(dt, (size_t)nelmts, buf, bkg); - - /* Compare results */ - for (i=0; ib != d_ptr->b || - s_ptr->d != d_ptr->d) - { - H5_FAILED(); - cerr << " i=" << i << endl; - cerr << " src={b=" << s_ptr->b << ", d=" << s_ptr->d - << "}" << endl; - cerr << " dst={b=" << d_ptr->b << ", d=" << d_ptr->d - << "}" << endl; - } // if - } // for - - /* Release resources */ - HDfree(buf); - HDfree(bkg); - HDfree(orig); - s_ptr = NULL; - d_ptr = NULL; - st.close(); - dt.close(); - PASSED(); + /* Sizes should be the same, but be careful just in case */ + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); + for (i=0; ib = (i*8+1) & 0x7fff; + s_ptr->d = (i*8+6) & 0x7fff; + } + memcpy(buf, orig, nelmts*sizeof(src_typ_t)); + + /* Build hdf5 datatypes */ + CompType st(sizeof(src_typ_t)); + st.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_SHORT); + st.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_SHORT); + + CompType dt(sizeof(dst_typ_t)); + dt.insertMember("b", HOFFSET(dst_typ_t, b), PredType::NATIVE_LONG); + dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_LONG); + + /* Perform the conversion */ + st.convert(dt, (size_t)nelmts, buf, bkg); + + /* Compare results */ + for (i=0; ib != d_ptr->b || + s_ptr->d != d_ptr->d) + { + H5_FAILED(); + cerr << " i=" << i << endl; + cerr << " src={b=" << s_ptr->b << ", d=" << s_ptr->d + << "}" << endl; + cerr << " dst={b=" << d_ptr->b << ", d=" << d_ptr->d + << "}" << endl; + } // if + } // for + + /* Release resources */ + HDfree(buf); + HDfree(bkg); + HDfree(orig); + s_ptr = NULL; + d_ptr = NULL; + st.close(); + dt.close(); + PASSED(); } // end of try block catch (Exception& E) @@ -654,15 +654,15 @@ static void test_compound_6() } // test_compound_6() /*------------------------------------------------------------------------- - * Function: test_compound_7 + * Function: test_compound_7 * - * Purpose Tests inserting fields into compound datatypes when the field - * overlaps the end of the compound datatype. + * Purpose: Tests inserting fields into compound datatypes when the field + * overlaps the end of the compound datatype. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -671,47 +671,47 @@ static void test_compound_6() static void test_compound_7() { typedef struct { - int a; - float b; - long c; + int a; + float b; + long c; } s1_typ_t; typedef struct { - int a; - float b; - long c; - double d; + int a; + float b; + long c; + double d; } s2_typ_t; // Output message about test being performed SUBTEST("Compound Element Insertion"); try { - CompType tid1(sizeof(s1_typ_t)); + CompType tid1(sizeof(s1_typ_t)); - tid1.insertMember("a", HOFFSET(s1_typ_t,a),PredType::NATIVE_INT); - tid1.insertMember("b", HOFFSET(s1_typ_t,b),PredType::NATIVE_FLOAT); - tid1.insertMember("c", HOFFSET(s1_typ_t,c),PredType::NATIVE_LONG); + tid1.insertMember("a", HOFFSET(s1_typ_t,a),PredType::NATIVE_INT); + tid1.insertMember("b", HOFFSET(s1_typ_t,b),PredType::NATIVE_FLOAT); + tid1.insertMember("c", HOFFSET(s1_typ_t,c),PredType::NATIVE_LONG); - size_t type_size = tid1.getSize(); - verify_val(type_size, sizeof(s1_typ_t), "DataType::getSize", __LINE__, __FILE__); + size_t type_size = tid1.getSize(); + verify_val(type_size, sizeof(s1_typ_t), "DataType::getSize", __LINE__, __FILE__); - CompType tid2; - tid2.copy(tid1); + CompType tid2; + tid2.copy(tid1); - type_size = tid2.getSize(); - verify_val_noteq(type_size, sizeof(s2_typ_t), "DataType::getSize", __LINE__, __FILE__); + type_size = tid2.getSize(); + verify_val_noteq(type_size, sizeof(s2_typ_t), "DataType::getSize", __LINE__, __FILE__); - /* Should not be able to insert field past end of compound datatype */ - try { - tid2.insertMember("d", HOFFSET(s2_typ_t, d), PredType::NATIVE_DOUBLE); - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("CompType::insertMember", "Attempted to insert field past end of compound data type."); - } catch (DataTypeIException& err) {} + /* Should not be able to insert field past end of compound datatype */ + try { + tid2.insertMember("d", HOFFSET(s2_typ_t, d), PredType::NATIVE_DOUBLE); + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("CompType::insertMember", "Attempted to insert field past end of compound data type."); + } catch (DataTypeIException& err) {} - /* Release resources */ - tid1.close(); - tid2.close(); - PASSED(); + /* Release resources */ + tid1.close(); + tid2.close(); + PASSED(); } // end of try block catch (Exception& E) @@ -721,13 +721,13 @@ static void test_compound_7() } // test_compound_7() /*------------------------------------------------------------------------- - * Function: test_compound_set_size + * Function: test_compound_set_size * - * Purpose Tests member function setSize() on compound datatype + * Purpose: Tests member function setSize() on compound datatype * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use partial C version test_ooo_order) + * Programmer: Binh-Minh Ribler (use partial C version test_ooo_order) * March, 2014 * * Modifications: @@ -738,7 +738,7 @@ const H5std_string COMPFILE("tcompound_types.h5"); static void test_compound_set_size() { typedef struct { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } src_typ_t; // Output message about test being performed @@ -755,53 +755,53 @@ static void test_compound_set_size() dtype.insertMember("c", HOFFSET(src_typ_t, c), PredType::NATIVE_LONG); dtype.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_DOUBLE); - // Verify that the compound is not packed - // bool packed = dtype.packed(); // not until C library provides API - // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); + // Verify that the compound is not packed + // bool packed = dtype.packed(); // not until C library provides API + // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); - dtype.commit(file, "dtype"); + dtype.commit(file, "dtype"); - // Close the type and file - dtype.close(); - file.close(); + // Close the type and file + dtype.close(); + file.close(); - // Open the file for read/write - file.openFile(COMPFILE, H5F_ACC_RDWR); + // Open the file for read/write + file.openFile(COMPFILE, H5F_ACC_RDWR); - // Open the data type "dtype" - CompType dtype_tmp = file.openCompType("dtype"); + // Open the data type "dtype" + CompType dtype_tmp = file.openCompType("dtype"); - // Make a copy of the data type - dtype.copy(dtype_tmp); + // Make a copy of the data type + dtype.copy(dtype_tmp); - // Verify that the compound is not packed - // packed = dtype_tmp.packed(); // not until C library provides API - // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); + // Verify that the compound is not packed + // packed = dtype_tmp.packed(); // not until C library provides API + // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); - // Expand the type, and verify that it became unpacked - dtype.setSize((size_t)33); - // packed = dtype.packed(); // not until C library provides API - // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); + // Expand the type, and verify that it became unpacked + dtype.setSize((size_t)33); + // packed = dtype.packed(); // not until C library provides API + // verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__); - // Verify setSize() actually set size - size_t new_size = dtype.getSize(); - verify_val(new_size, (size_t)33, "DataType::getSize", __LINE__, __FILE__); + // Verify setSize() actually set size + size_t new_size = dtype.getSize(); + verify_val(new_size, (size_t)33, "DataType::getSize", __LINE__, __FILE__); - // Shrink the type, and verify that it became packed - dtype.setSize((size_t)32); - // packed = dtype.packed(); // not until C library provides API - // verify_val(packed, TRUE, "DataType::packed", __LINE__, __FILE__); + // Shrink the type, and verify that it became packed + dtype.setSize((size_t)32); + // packed = dtype.packed(); // not until C library provides API + // verify_val(packed, TRUE, "DataType::packed", __LINE__, __FILE__); - // Verify setSize() actually set size again - new_size = dtype.getSize(); - verify_val(new_size, (size_t)32, "DataType::getSize", __LINE__, __FILE__); + // Verify setSize() actually set size again + new_size = dtype.getSize(); + verify_val(new_size, (size_t)32, "DataType::getSize", __LINE__, __FILE__); - /* Close types and file */ - dtype_tmp.close(); - dtype.close(); - file.close(); + /* Close types and file */ + dtype_tmp.close(); + dtype.close(); + file.close(); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -811,14 +811,14 @@ static void test_compound_set_size() } // test_compound_set_size() /*------------------------------------------------------------------------- - * Function: test_compound + * Function: test_compound * - * Purpose Main compound datatype testing routine + * Purpose: Main compound datatype testing routine * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler - * January 2007 + * Programmer: Binh-Minh Ribler + * January 2007 * * Modifications: * @@ -830,23 +830,23 @@ void test_compound() // Output message about test being performed MESSAGE(5, ("Testing Compound Data Type operations\n")); - test_compound_1(); // various things about compound data types - test_compound_2(); // compound element reordering - test_compound_3(); // compound datatype subset conversions - test_compound_4(); // compound element shrinking & reordering - test_compound_5(); // optimized struct converter - test_compound_6(); // compound element growing - test_compound_7(); // compound element insertion - test_compound_set_size(); // set size on compound data types + test_compound_1(); // various things about compound data types + test_compound_2(); // compound element reordering + test_compound_3(); // compound datatype subset conversions + test_compound_4(); // compound element shrinking & reordering + test_compound_5(); // optimized struct converter + test_compound_6(); // compound element growing + test_compound_7(); // compound element insertion + test_compound_set_size(); // set size on compound data types } // test_compound() /*------------------------------------------------------------------------- - * Function: cleanup_compound + * Function: cleanup_compound * - * Purpose Cleanup temporary test files - nothing at this time. + * Purpose: Cleanup temporary test files - nothing at this time. * - * Return none + * Return: none * * Modifications: * diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp index f39694b..d733ffe 100644 --- a/c++/test/tdspl.cpp +++ b/c++/test/tdspl.cpp @@ -16,7 +16,7 @@ /***************************************************************************** FILE tdspl.cpp - HDF5 C++ testing the dataset memory and transfer property - list functionality + list functionality ***************************************************************************/ #ifdef OLD_HEADER_FILENAME @@ -45,70 +45,70 @@ static void test_transfplist() SUBTEST("DSetMemXferPropList::set/getDataTransform()"); try { - // Create various data set prop lists and set data transform expression. - DSetMemXferPropList dxpl_c_to_f(c_to_f); - - DSetMemXferPropList dxpl_simple; - dxpl_simple.setDataTransform(simple); - - DSetMemXferPropList dxpl_utrans_inv; - dxpl_utrans_inv.setDataTransform(utrans_inv); - - // - // Make a copy of one of those prop lists then read the data transform - // expression and verify that it's the same as the original. - // - - // Copy the prop list. - DSetMemXferPropList dxpl_c_to_f_copy; - dxpl_c_to_f_copy.copy(dxpl_c_to_f); - - // Find out the length of the transform expression, allocate the buffer - // for it, then read and verify the expression from the copied plist - ssize_t tran_len = dxpl_c_to_f_copy.getDataTransform(NULL); - char *c_to_f_read = (char *)HDmalloc(tran_len+1); - HDmemset(c_to_f_read, 0, tran_len+1); - dxpl_c_to_f_copy.getDataTransform(c_to_f_read, tran_len+1); - verify_val((const char*)c_to_f_read, (const char*)c_to_f, - "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - HDfree(c_to_f_read); - - // - // Read the expression of each of the prop lists and verify the read - // expression - // - - // Get and verify the expression with: - // ssize_t getDataTransform(char* exp, const size_t buf_size [default=0]) - tran_len = dxpl_c_to_f.getDataTransform(NULL); - c_to_f_read = (char *)HDmalloc(tran_len+1); - HDmemset(c_to_f_read, 0, tran_len+1); - dxpl_c_to_f.getDataTransform(c_to_f_read, tran_len+1); - verify_val((const char*)c_to_f_read, (const char*)c_to_f, - "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - HDfree(c_to_f_read); - - // Get and verify the expression with: - // H5std_string DSetMemXferPropList::getDataTransform() - H5std_string simple_read = dxpl_simple.getDataTransform(); - verify_val((const char*)simple_read.c_str(), (const char*)simple, - "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - - // Get and verify the expression with: - // ssize_t getDataTransform(char* exp, const size_t buf_size) - tran_len = dxpl_utrans_inv.getDataTransform(NULL, 0); - char *utrans_inv_read = (char *)HDmalloc(tran_len+1); - HDmemset(utrans_inv_read, 0, tran_len+1); - dxpl_utrans_inv.getDataTransform(utrans_inv_read, tran_len+1); - verify_val((const char*)utrans_inv_read, (const char*)utrans_inv, - "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - HDfree(utrans_inv_read); - - PASSED(); + // Create various data set prop lists and set data transform expression. + DSetMemXferPropList dxpl_c_to_f(c_to_f); + + DSetMemXferPropList dxpl_simple; + dxpl_simple.setDataTransform(simple); + + DSetMemXferPropList dxpl_utrans_inv; + dxpl_utrans_inv.setDataTransform(utrans_inv); + + // + // Make a copy of one of those prop lists then read the data transform + // expression and verify that it's the same as the original. + // + + // Copy the prop list. + DSetMemXferPropList dxpl_c_to_f_copy; + dxpl_c_to_f_copy.copy(dxpl_c_to_f); + + // Find out the length of the transform expression, allocate the buffer + // for it, then read and verify the expression from the copied plist + ssize_t tran_len = dxpl_c_to_f_copy.getDataTransform(NULL); + char *c_to_f_read = (char *)HDmalloc(tran_len+1); + HDmemset(c_to_f_read, 0, tran_len+1); + dxpl_c_to_f_copy.getDataTransform(c_to_f_read, tran_len+1); + verify_val((const char*)c_to_f_read, (const char*)c_to_f, + "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); + HDfree(c_to_f_read); + + // + // Read the expression of each of the prop lists and verify the read + // expression + // + + // Get and verify the expression with: + // ssize_t getDataTransform(char* exp, const size_t buf_size [default=0]) + tran_len = dxpl_c_to_f.getDataTransform(NULL); + c_to_f_read = (char *)HDmalloc(tran_len+1); + HDmemset(c_to_f_read, 0, tran_len+1); + dxpl_c_to_f.getDataTransform(c_to_f_read, tran_len+1); + verify_val((const char*)c_to_f_read, (const char*)c_to_f, + "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); + HDfree(c_to_f_read); + + // Get and verify the expression with: + // H5std_string DSetMemXferPropList::getDataTransform() + H5std_string simple_read = dxpl_simple.getDataTransform(); + verify_val((const char*)simple_read.c_str(), (const char*)simple, + "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); + + // Get and verify the expression with: + // ssize_t getDataTransform(char* exp, const size_t buf_size) + tran_len = dxpl_utrans_inv.getDataTransform(NULL, 0); + char *utrans_inv_read = (char *)HDmalloc(tran_len+1); + HDmemset(utrans_inv_read, 0, tran_len+1); + dxpl_utrans_inv.getDataTransform(utrans_inv_read, tran_len+1); + verify_val((const char*)utrans_inv_read, (const char*)utrans_inv, + "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); + HDfree(utrans_inv_read); + + PASSED(); } catch (Exception& E) { - issue_fail_msg("test_transfplist", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_transfplist", __LINE__, __FILE__, E.getCDetailMsg()); } } diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp index 779c931..28ede6b 100644 --- a/c++/test/testhdf5.cpp +++ b/c++/test/testhdf5.cpp @@ -28,16 +28,16 @@ base functionality testing. EXTERNAL ROUTINES/VARIABLES: - TestInit(...) -- Initialize testing framework - TestInfo(...) -- Print test info - AddTest(...) -- Setup a test function and add it to the list of tests - TestParseCmdLine(...) -- Parse command line arguments - PerformTests() -- Perform requested testing - GetTestSummary() -- Retrieve Summary request value - TestSummary() -- Display test summary - GetTestCleanup() -- Retrieve Cleanup request value - TestCleanup() -- Clean up files from testing - GetTestNumErrs() -- Retrieve the number of testing errors + TestInit(...) -- Initialize testing framework + TestInfo(...) -- Print test info + AddTest(...) -- Setup a test function and add it to the list of tests + TestParseCmdLine(...) -- Parse command line arguments + PerformTests() -- Perform requested testing + GetTestSummary() -- Retrieve Summary request value + TestSummary() -- Display test summary + GetTestCleanup() -- Retrieve Cleanup request value + TestCleanup() -- Clean up files from testing + GetTestNumErrs() -- Retrieve the number of testing errors ***************************************************************************/ #ifdef OLD_HEADER_FILENAME @@ -60,47 +60,47 @@ main(int argc, char *argv[]) { try { - // Turn of the auto-printing when failure occurs so that we can - // handle the errors appropriately since sometime failures are - // caused deliberately and expected. - Exception::dontPrint(); - /* Initialize testing framework */ - TestInit(argv[0], NULL, NULL); - - // testing file creation and opening in tfile.cpp - AddTest("tfile", test_file, cleanup_file, "File I/O Operations", NULL); - // testing dataset functionalities in dset.cpp - AddTest("dsets", test_dset, cleanup_dsets, "Dataset I/O Operations", NULL); - // testing dataspace functionalities in th5s.cpp - AddTest("th5s", test_h5s, cleanup_h5s, "Dataspaces", NULL); - // testing attribute functionalities in tattr.cpp - AddTest("tattr", test_attr, cleanup_attr, "Attributes", NULL); - // testing object functionalities in tobject.cpp - AddTest("tobject", test_object, cleanup_object, "Objects", NULL); - // testing reference functionalities in trefer.cpp - AddTest("trefer", test_reference, cleanup_reference, "References", NULL); - // testing variable-length strings in tvlstr.cpp - AddTest("tvlstr", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL); - AddTest("ttypes", test_types, cleanup_types, "Generic Data Types", NULL); - AddTest("tarray", test_array, cleanup_array, "Array Datatypes", NULL); - AddTest("tcompound", test_compound, cleanup_compound, "Compound Data Types", NULL); - AddTest("tdspl", test_dsproplist, cleanup_dsproplist, "Dataset Property List", NULL); - AddTest("tfilter", test_filters, cleanup_filters, "Various Filters", NULL); - AddTest("tlinks", test_links, cleanup_links, "Various Links", NULL); + // Turn of the auto-printing when failure occurs so that we can + // handle the errors appropriately since sometime failures are + // caused deliberately and expected. + Exception::dontPrint(); + /* Initialize testing framework */ + TestInit(argv[0], NULL, NULL); + + // testing file creation and opening in tfile.cpp + AddTest("tfile", test_file, cleanup_file, "File I/O Operations", NULL); + // testing dataset functionalities in dset.cpp + AddTest("dsets", test_dset, cleanup_dsets, "Dataset I/O Operations", NULL); + // testing dataspace functionalities in th5s.cpp + AddTest("th5s", test_h5s, cleanup_h5s, "Dataspaces", NULL); + // testing attribute functionalities in tattr.cpp + AddTest("tattr", test_attr, cleanup_attr, "Attributes", NULL); + // testing object functionalities in tobject.cpp + AddTest("tobject", test_object, cleanup_object, "Objects", NULL); + // testing reference functionalities in trefer.cpp + AddTest("trefer", test_reference, cleanup_reference, "References", NULL); + // testing variable-length strings in tvlstr.cpp + AddTest("tvlstr", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL); + AddTest("ttypes", test_types, cleanup_types, "Generic Data Types", NULL); + AddTest("tarray", test_array, cleanup_array, "Array Datatypes", NULL); + AddTest("tcompound", test_compound, cleanup_compound, "Compound Data Types", NULL); + AddTest("tdspl", test_dsproplist, cleanup_dsproplist, "Dataset Property List", NULL); + AddTest("tfilter", test_filters, cleanup_filters, "Various Filters", NULL); + AddTest("tlinks", test_links, cleanup_links, "Various Links", NULL); /* Comment out tests that are not done yet. - BMR, Feb 2001 - AddTest("select", test_select, cleanup_select, "Selections", NULL); - AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL); - AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL); + AddTest("select", test_select, cleanup_select, "Selections", NULL); + AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL); + AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL); */ - AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL); + AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL); /* - AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL); - AddTest("id", test_ids, NULL, "User-Created Identifiers", NULL); + AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL); + AddTest("id", test_ids, NULL, "User-Created Identifiers", NULL); Comment out tests that are not done yet */ /* Tentative - BMR 2007/1/12 - AddTest("enum", test_enum, cleanup_enum, "Enum Data Types", NULL); + AddTest("enum", test_enum, cleanup_enum, "Enum Data Types", NULL); */ } catch (Exception& E) diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index 261beab..c7ed933 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -49,7 +49,6 @@ const size_t F2_OFFSET_SIZE = 8; const size_t F2_LENGTH_SIZE = 8; const unsigned F2_SYM_LEAF_K = 8; const unsigned F2_SYM_INTERN_K = 32; -const unsigned F2_ISTORE = 64; const H5std_string FILE2("tfile2.h5"); const hsize_t F3_USERBLOCK_SIZE = (hsize_t)0; @@ -66,20 +65,20 @@ const H5std_string FILE4("tfile4.h5"); /*------------------------------------------------------------------------- * Function: test_file_create * - * Purpose Test file and template creations + * Purpose: Test file and template creations * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) + * Programmer: Binh-Minh Ribler (use C version) * January, 2001 * * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hsize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * January, 2005: C tests' macro VERIFY casts values to 'long' for all + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hsize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. * *------------------------------------------------------------------------- */ @@ -98,81 +97,81 @@ static void test_file_create() // Setting this to NULL for cleaning up in failure situations H5File* file1 = NULL; try { - // Create file FILE1 - file1 = new H5File (FILE1, H5F_ACC_EXCL); - - // Try to create the same file with H5F_ACC_TRUNC. This should fail - // because file1 is the same file and is currently open. - try { - H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "Attempted to create an existing file."); - } - catch (FileIException& E) // catch truncating existing file - {} // do nothing, FAIL expected - - // Close file1 - delete file1; - file1 = NULL; - - // Try again with H5F_ACC_EXCL. This should fail because the file - // already exists from the previous steps. - try { - H5File file2(FILE1, H5F_ACC_EXCL); // should throw E - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "File already exists."); - } - catch (FileIException& E) // catching creating existing file - {} // do nothing, FAIL expected - - // Test create with H5F_ACC_TRUNC. This will truncate the existing file. - file1 = new H5File (FILE1, H5F_ACC_TRUNC); - - // Try to create first file again. This should fail because file1 - // is the same file and is currently open. - try { - H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "H5F_ACC_TRUNC attempt on an opened file."); - } - catch (FileIException& E) // catching truncating opened file - {} // do nothing, FAIL expected - - // Try with H5F_ACC_EXCL. This should fail too because the file already - // exists. - try { - H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "H5F_ACC_EXCL attempt on an existing file."); - } - catch (FileIException& E) // catching H5F_ACC_EXCL on existing file - {} // do nothing, FAIL expected - - // Get the file-creation template - FileCreatPropList tmpl1 = file1->getCreatePlist(); - - hsize_t ublock = tmpl1.getUserblock(); - verify_val((long)ublock, (long)F1_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - - size_t parm1, parm2; // file-creation parameters - tmpl1.getSizes( parm1, parm2); - verify_val(parm1, F1_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - verify_val(parm2, F1_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + // Create file FILE1 + file1 = new H5File (FILE1, H5F_ACC_EXCL); + + // Try to create the same file with H5F_ACC_TRUNC. This should fail + // because file1 is the same file and is currently open. + try { + H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "Attempted to create an existing file."); + } + catch (FileIException& E) // catch truncating existing file + {} // do nothing, FAIL expected + + // Close file1 + delete file1; + file1 = NULL; + + // Try again with H5F_ACC_EXCL. This should fail because the file + // already exists from the previous steps. + try { + H5File file2(FILE1, H5F_ACC_EXCL); // should throw E + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "File already exists."); + } + catch (FileIException& E) // catching creating existing file + {} // do nothing, FAIL expected + + // Test create with H5F_ACC_TRUNC. This will truncate the existing file. + file1 = new H5File (FILE1, H5F_ACC_TRUNC); + + // Try to create first file again. This should fail because file1 + // is the same file and is currently open. + try { + H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "H5F_ACC_TRUNC attempt on an opened file."); + } + catch (FileIException& E) // catching truncating opened file + {} // do nothing, FAIL expected + + // Try with H5F_ACC_EXCL. This should fail too because the file already + // exists. + try { + H5File file3 (FILE1, H5F_ACC_EXCL); // should throw E + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "H5F_ACC_EXCL attempt on an existing file."); + } + catch (FileIException& E) // catching H5F_ACC_EXCL on existing file + {} // do nothing, FAIL expected + + // Get the file-creation template + FileCreatPropList tmpl1 = file1->getCreatePlist(); + + hsize_t ublock = tmpl1.getUserblock(); + verify_val((long)ublock, (long)F1_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); + + size_t parm1, parm2; // file-creation parameters + tmpl1.getSizes( parm1, parm2); + verify_val(parm1, F1_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + verify_val(parm2, F1_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); unsigned iparm1,iparm2; // file-creation parameters tmpl1.getSymk( iparm1, iparm2); verify_val(iparm1, F1_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); verify_val(iparm2, F1_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - // tmpl1 is automatically closed; if error occurs, it'll be - // caught in the catch block + // tmpl1 is automatically closed; if error occurs, it'll be + // caught in the catch block - // Close first file - delete file1; + // Close first file + delete file1; } catch (InvalidActionException& E) { @@ -184,7 +183,7 @@ static void test_file_create() // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); if (file1 != NULL) // clean up delete file1; } @@ -193,79 +192,79 @@ static void test_file_create() FileCreatPropList* tmpl1 = NULL; try { - // Create a new file with a non-standard file-creation template - tmpl1 = new FileCreatPropList; + // Create a new file with a non-standard file-creation template + tmpl1 = new FileCreatPropList; - // Set the new file-creation parameters - tmpl1->setUserblock (F2_USERBLOCK_SIZE); - tmpl1->setSizes( F2_OFFSET_SIZE, F2_LENGTH_SIZE ); - tmpl1->setSymk( F2_SYM_INTERN_K, F2_SYM_LEAF_K ); + // Set the new file-creation parameters + tmpl1->setUserblock (F2_USERBLOCK_SIZE); + tmpl1->setSizes( F2_OFFSET_SIZE, F2_LENGTH_SIZE ); + tmpl1->setSymk( F2_SYM_INTERN_K, F2_SYM_LEAF_K ); - // Try to create second file, with non-standard file-creation template - // params. - H5File file2( FILE2, H5F_ACC_TRUNC, *tmpl1 ); + // Try to create second file, with non-standard file-creation template + // params. + H5File file2( FILE2, H5F_ACC_TRUNC, *tmpl1 ); - // Release file-creation template - delete tmpl1; - tmpl1 = NULL; + // Release file-creation template + delete tmpl1; + tmpl1 = NULL; - // Get the file-creation template - tmpl1 = new FileCreatPropList (file2.getCreatePlist()); + // Get the file-creation template + tmpl1 = new FileCreatPropList (file2.getCreatePlist()); - // Get the file-creation parameters - hsize_t ublock = tmpl1->getUserblock(); - verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); + // Get the file-creation parameters + hsize_t ublock = tmpl1->getUserblock(); + verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - size_t parm1, parm2; // file-creation parameters - tmpl1->getSizes( parm1, parm2); - verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + size_t parm1, parm2; // file-creation parameters + tmpl1->getSizes( parm1, parm2); + verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - unsigned iparm1,iparm2; // file-creation parameters + unsigned iparm1,iparm2; // file-creation parameters tmpl1->getSymk( iparm1, iparm2); verify_val(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); verify_val(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - // Clone the file-creation template - FileCreatPropList tmpl2; - tmpl2.copy (*tmpl1); + // Clone the file-creation template + FileCreatPropList tmpl2; + tmpl2.copy (*tmpl1); - // Release file-creation template - delete tmpl1; - tmpl1 = NULL; + // Release file-creation template + delete tmpl1; + tmpl1 = NULL; - // Set the new file-creation parameter - tmpl2.setUserblock( F3_USERBLOCK_SIZE ); + // Set the new file-creation parameter + tmpl2.setUserblock( F3_USERBLOCK_SIZE ); - // Try to create second file, with non-standard file-creation template - // params - H5File file3( FILE3, H5F_ACC_TRUNC, tmpl2 ); + // Try to create second file, with non-standard file-creation template + // params + H5File file3( FILE3, H5F_ACC_TRUNC, tmpl2 ); - // Get the file-creation template - tmpl1 = new FileCreatPropList (file3.getCreatePlist()); + // Get the file-creation template + tmpl1 = new FileCreatPropList (file3.getCreatePlist()); - // Get the file-creation parameters - ublock = tmpl1->getUserblock(); - verify_val((long)ublock, (long)F3_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); + // Get the file-creation parameters + ublock = tmpl1->getUserblock(); + verify_val((long)ublock, (long)F3_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - tmpl1->getSizes( parm1, parm2); - verify_val(parm1, F3_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - verify_val(parm2, F3_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + tmpl1->getSizes( parm1, parm2); + verify_val(parm1, F3_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + verify_val(parm2, F3_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - tmpl1->getSymk( iparm1, iparm2); - verify_val(iparm1, F3_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - verify_val(iparm2, F3_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); + tmpl1->getSymk( iparm1, iparm2); + verify_val(iparm1, F3_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); + verify_val(iparm2, F3_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - // Release file-creation template - delete tmpl1; - PASSED(); + // Release file-creation template + delete tmpl1; + PASSED(); } // catch all exceptions catch (Exception& E) { - issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); - if (tmpl1 != NULL) // clean up - delete tmpl1; + issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); + if (tmpl1 != NULL) // clean up + delete tmpl1; } } // test_file_create() @@ -273,20 +272,20 @@ static void test_file_create() /*------------------------------------------------------------------------- * Function: test_file_open * - * Purpose Test file accesses + * Purpose: Test file accesses * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) + * Programmer: Binh-Minh Ribler (use C version) * January, 2001 * * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hsize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * January, 2005: C tests' macro VERIFY casts values to 'long' for all + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hsize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. * *------------------------------------------------------------------------- */ @@ -297,53 +296,53 @@ static void test_file_open() try { - // Open first file - H5File file1 (FILE2, H5F_ACC_RDWR ); + // Open first file + H5File file1 (FILE2, H5F_ACC_RDWR ); - // Get the file-creation template - FileCreatPropList tmpl1 = file1.getCreatePlist(); + // Get the file-creation template + FileCreatPropList tmpl1 = file1.getCreatePlist(); - // Get the file-creation parameters - hsize_t ublock = tmpl1.getUserblock(); - verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); + // Get the file-creation parameters + hsize_t ublock = tmpl1.getUserblock(); + verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - size_t parm1, parm2; // file-creation parameters - tmpl1.getSizes( parm1, parm2); - verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + size_t parm1, parm2; // file-creation parameters + tmpl1.getSizes( parm1, parm2); + verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); + verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); unsigned iparm1,iparm2; // file-creation parameters tmpl1.getSymk( iparm1, iparm2); verify_val(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); verify_val(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - // Test H5File constructor with existing file id - H5File file2(file1.getId()); - file1.close(); + // Test H5File constructor with existing file id + H5File file2(file1.getId()); + file1.close(); - // Try truncating the file, and it should fail because the file is - // still opened with file2. - try { - H5File file3 (FILE2, H5F_ACC_TRUNC); // should throw E + // Try truncating the file, and it should fail because the file is + // still opened with file2. + try { + H5File file3 (FILE2, H5F_ACC_TRUNC); // should throw E - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File constructor", "Attempt truncating an opened file."); - } - catch (FileIException& E) // catching H5F_ACC_TRUNC on opened file - {} // do nothing, FAIL expected + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File constructor", "Attempt truncating an opened file."); + } + catch (FileIException& E) // catching H5F_ACC_TRUNC on opened file + {} // do nothing, FAIL expected - // Now, really close the file. - file2.close(); + // Now, really close the file. + file2.close(); - // Truncating should succeed now. - H5File file3(FILE2, H5F_ACC_TRUNC); + // Truncating should succeed now. + H5File file3(FILE2, H5F_ACC_TRUNC); - // Opening another file to file3 object, FILE2 should be closed, so - // the next attempt to truncate FILE2 should succeed. - file3.openFile(FILE1, H5F_ACC_RDONLY); - H5File file4(FILE2, H5F_ACC_TRUNC); + // Opening another file to file3 object, FILE2 should be closed, so + // the next attempt to truncate FILE2 should succeed. + file3.openFile(FILE1, H5F_ACC_RDONLY); + H5File file4(FILE2, H5F_ACC_TRUNC); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -356,11 +355,11 @@ static void test_file_open() /*------------------------------------------------------------------------- * Function: test_file_size * - * Purpose Test file size. + * Purpose: Test file size. * - * Return None + * Return: None * - * Programmer Raymond Lu + * Programmer: Raymond Lu * June, 2004 * * Modifications: @@ -372,7 +371,7 @@ static void test_file_size() // Output message about test being performed SUBTEST("File Size"); - hid_t fapl_id; + hid_t fapl_id; fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template try { @@ -380,13 +379,13 @@ static void test_file_size() // list object to pass in H5File::H5File FileAccPropList fapl(fapl_id); - // Set to sec2 driver. Do we want to test other file drivers? + // Set to sec2 driver. Do we want to test other file drivers? // They're not tested in C++. // File drivers seem not implemented. - // fapl.setSec2(); + // fapl.setSec2(); // Create a file - H5File file4( FILE4, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); + H5File file4( FILE4, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); // Get file size hsize_t file_size = file4.getFileSize(); @@ -395,14 +394,14 @@ static void test_file_size() if (file_size < 1*KB || file_size > 4*KB) issue_fail_msg("test_file_size()", __LINE__, __FILE__, "getFileSize() returned unreasonable value"); - // Get the amount of free space in the file - hssize_t free_space = file4.getFreeSpace(); + // Get the amount of free space in the file + hssize_t free_space = file4.getFreeSpace(); - // Check if it's reasonable. It's 0 now. - if (free_space < 0 || free_space > 4*KB) - issue_fail_msg("test_file_size()", __LINE__, __FILE__, "getFreeSpace returned unreasonable value"); + // Check if it's reasonable. It's 0 now. + if (free_space < 0 || free_space > 4*KB) + issue_fail_msg("test_file_size()", __LINE__, __FILE__, "getFreeSpace returned unreasonable value"); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -411,9 +410,7 @@ static void test_file_size() } // use C test utility routine to close property list. - herr_t ret = H5Pclose(fapl_id); - if (ret < 0) - issue_fail_msg("test_file_size()", __LINE__, __FILE__, "H5Pclose failed"); + H5Pclose(fapl_id); } // test_file_size() @@ -421,25 +418,25 @@ static void test_file_size() /*------------------------------------------------------------------------- * Function: test_file_name * - * Purpose Test getting file's name. + * Purpose: Test getting file's name. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler + * Programmer: Binh-Minh Ribler * July, 2004 * * Modifications: * *------------------------------------------------------------------------- */ -const int RANK = 2; -const int NX = 4; -const int NY = 5; -const H5std_string GROUPNAME ("group"); -const H5std_string DSETNAME ("dataset"); -const H5std_string DATTRNAME ("dataset attribute"); -const H5std_string FATTRNAME ("file attribute"); -const H5std_string DTYPENAME ("compound"); +const int RANK = 2; +const int NX = 4; +const int NY = 5; +const H5std_string GROUPNAME ("group"); +const H5std_string DSETNAME ("dataset"); +const H5std_string DATTRNAME ("dataset attribute"); +const H5std_string FATTRNAME ("file attribute"); +const H5std_string DTYPENAME ("compound"); // Compound datatype typedef struct s1_t { @@ -455,67 +452,68 @@ static void test_file_name() H5std_string file_name; try { // Create a file using default properties. - H5File file4(FILE4, H5F_ACC_TRUNC); + H5File file4(FILE4, H5F_ACC_TRUNC); // Get file name from the file instance. file_name = file4.getFileName(); - verify_val(file_name, FILE4, "H5File::getFileName", __LINE__, __FILE__); + verify_val(file_name, FILE4, "H5File::getFileName", __LINE__, __FILE__); - // Create a group in the root group. - Group group(file4.createGroup(GROUPNAME, 0)); + // Create a group in the root group. + Group group(file4.createGroup(GROUPNAME, 0)); - // Get and verify file name via a group. - file_name = group.getFileName(); - verify_val(file_name, FILE4, "Group::getFileName", __LINE__, __FILE__); + // Get and verify file name via a group. + file_name = group.getFileName(); + verify_val(file_name, FILE4, "Group::getFileName", __LINE__, __FILE__); - // Create the data space. - hsize_t dims[RANK] = {NX, NY}; - DataSpace space(RANK, dims); + // Create the data space. + hsize_t dims[RANK] = {NX, NY}; + DataSpace space(RANK, dims); - // Create a new dataset. - DataSet dataset(file4.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); + // Create a new dataset. + DataSet dataset(file4.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); - // Get and verify file name via a dataset. - file_name = dataset.getFileName(); - verify_val(file_name, FILE4, "DataSet::getFileName", __LINE__, __FILE__); + // Get and verify file name via a dataset. + file_name = dataset.getFileName(); + verify_val(file_name, FILE4, "DataSet::getFileName", __LINE__, __FILE__); - // Create an attribute for the dataset. - Attribute attr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); + // Create an attribute for the dataset. + Attribute attr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); - // Get and verify file name via an attribute. - file_name = attr.getFileName(); - verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); + // Get and verify file name via an attribute. + file_name = attr.getFileName(); + verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); - // Create a compound datatype. - CompType comp_type (sizeof(s1_t)); + // Create a compound datatype. + CompType comp_type (sizeof(s1_t)); - // Insert fields. - comp_type.insertMember("a", HOFFSET(s1_t, a), PredType::NATIVE_INT); - comp_type.insertMember("b", HOFFSET(s1_t, b), PredType::NATIVE_FLOAT); + // Insert fields. + comp_type.insertMember("a", HOFFSET(s1_t, a), PredType::NATIVE_INT); + comp_type.insertMember("b", HOFFSET(s1_t, b), PredType::NATIVE_FLOAT); - // Save it on file. - comp_type.commit(file4, DTYPENAME); + // Save it on file. + comp_type.commit(file4, DTYPENAME); - // Get and verify file name via a committed datatype. - comp_type.getFileName(); - verify_val(file_name, FILE4, "CompType::getFileName", __LINE__, __FILE__); - PASSED(); + // Get and verify file name via a committed datatype. + comp_type.getFileName(); + verify_val(file_name, FILE4, "CompType::getFileName", __LINE__, __FILE__); + PASSED(); } // end of try block catch (Exception& E) { issue_fail_msg("test_file_name()", __LINE__, __FILE__, E.getCDetailMsg()); } + } // test_file_name() -const int RANK1 = 1; -const int ATTR1_DIM1 = 3; -const H5std_string FILE5("tfattrs.h5"); -const H5std_string FATTR1_NAME ("file attribute 1"); -const H5std_string FATTR2_NAME ("file attribute 2"); -int fattr_data[ATTR1_DIM1]={512,-234,98123}; // Test data for file attribute -int dattr_data[ATTR1_DIM1]={256,-123,1000}; // Test data for dataset attribute +const int RANK1 = 1; +const int ATTR1_DIM1 = 3; +const H5std_string FILE5("tfattrs.h5"); +const H5std_string FATTR1_NAME ("file attribute 1"); +const H5std_string FATTR2_NAME ("file attribute 2"); +int fattr_data[ATTR1_DIM1]={512,-234,98123}; /* Test data for file attribute */ +int dattr_data[ATTR1_DIM1]={256,-123,1000}; /* Test data for dataset attribute */ static void test_file_attribute() { @@ -528,89 +526,89 @@ static void test_file_attribute() H5std_string file_name; try { // Create a file using default properties. - H5File file5(FILE5, H5F_ACC_TRUNC); + H5File file5(FILE5, H5F_ACC_TRUNC); - // Create the data space - hsize_t dims[RANK1] = {ATTR1_DIM1}; - DataSpace space(RANK1, dims); + // Create the data space + hsize_t dims[RANK1] = {ATTR1_DIM1}; + DataSpace space(RANK1, dims); - // Create two attributes for the file - Attribute fattr1(file5.createAttribute(FATTR1_NAME, PredType::NATIVE_FLOAT, space)); - Attribute fattr2(file5.createAttribute(FATTR2_NAME, PredType::NATIVE_INT, space)); + // Create two attributes for the file + Attribute fattr1(file5.createAttribute(FATTR1_NAME, PredType::NATIVE_FLOAT, space)); + Attribute fattr2(file5.createAttribute(FATTR2_NAME, PredType::NATIVE_INT, space)); - fattr2.write(PredType::NATIVE_INT, fattr_data); + fattr2.write(PredType::NATIVE_INT, fattr_data); - try { - // Try to create the same attribute again (should fail) - Attribute fattr_dup(file5.createAttribute(FATTR2_NAME, PredType::NATIVE_INT, space)); - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File createAttribute", "Attempted to create an existing attribute."); - } - catch (AttributeIException& E) // catch creating existing attribute - {} // do nothing, FAIL expected + try { + // Try to create the same attribute again (should fail) + Attribute fattr_dup(file5.createAttribute(FATTR2_NAME, PredType::NATIVE_INT, space)); + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File createAttribute", "Attempted to create an existing attribute."); + } + catch (AttributeIException& E) // catch creating existing attribute + {} // do nothing, FAIL expected - // Create a new dataset - DataSet dataset(file5.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); + // Create a new dataset + DataSet dataset(file5.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); - // Create an attribute for the dataset - Attribute dattr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); + // Create an attribute for the dataset + Attribute dattr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); - // Write data to the second file attribute - dattr.write(PredType::NATIVE_INT, dattr_data); + // Write data to the second file attribute + dattr.write(PredType::NATIVE_INT, dattr_data); - // Test flushing out the data from the attribute object + // Test flushing out the data from the attribute object dattr.flush(H5F_SCOPE_GLOBAL); - // Get and verify the number of all objects in the file - // Current: 1 file, 2 file attr, 1 ds, and 1 ds attr. - ssize_t num_objs = file5.getObjCount(H5F_OBJ_ALL); - verify_val(num_objs, 5, "H5File::getObjCount", __LINE__, __FILE__); - - num_objs = file5.getObjCount(H5F_OBJ_GROUP); - verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_GROUP)", __LINE__, __FILE__); - num_objs = file5.getObjCount(H5F_OBJ_DATASET); - verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_DATASET)", __LINE__, __FILE__); - num_objs = file5.getObjCount(H5F_OBJ_ATTR); - verify_val(num_objs, 3, "H5File::getObjCount(H5F_OBJ_ATTR)", __LINE__, __FILE__); - num_objs = file5.getObjCount(H5F_OBJ_DATATYPE); - verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_DATATYPE)", __LINE__, __FILE__); - num_objs = file5.getObjCount(H5F_OBJ_FILE); - verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_FILE)", __LINE__, __FILE__); - - // Get the file name using the attributes - H5std_string fname = fattr1.getFileName(); - verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); - - fname.clear(); - fname = dattr.getFileName(); - verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); - - // Get the class of a file attribute's datatype - H5T_class_t atclass = fattr1.getTypeClass(); - verify_val(atclass, H5T_FLOAT, "Attribute::getTypeClass()", __LINE__, __FILE__); - - // Get and verify the number of attributes attached to a file - int n_attrs = file5.getNumAttrs(); - verify_val(n_attrs, 2, "H5File::getNumAttrs()", __LINE__, __FILE__); - - // Get and verify the number of attributes attached to a dataset - n_attrs = 0; - n_attrs = dataset.getNumAttrs(); - verify_val(n_attrs, 1, "DataSet::getNumAttrs()", __LINE__, __FILE__); - - // Read back attribute's data - HDmemset(rdata, 0, sizeof(rdata)); + // Get and verify the number of all objects in the file + // Current: 1 file, 2 file attr, 1 ds, and 1 ds attr. + ssize_t num_objs = file5.getObjCount(H5F_OBJ_ALL); + verify_val(num_objs, 5, "H5File::getObjCount", __LINE__, __FILE__); + + num_objs = file5.getObjCount(H5F_OBJ_GROUP); + verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_GROUP)", __LINE__, __FILE__); + num_objs = file5.getObjCount(H5F_OBJ_DATASET); + verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_DATASET)", __LINE__, __FILE__); + num_objs = file5.getObjCount(H5F_OBJ_ATTR); + verify_val(num_objs, 3, "H5File::getObjCount(H5F_OBJ_ATTR)", __LINE__, __FILE__); + num_objs = file5.getObjCount(H5F_OBJ_DATATYPE); + verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_DATATYPE)", __LINE__, __FILE__); + num_objs = file5.getObjCount(H5F_OBJ_FILE); + verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_FILE)", __LINE__, __FILE__); + + // Get the file name using the attributes + H5std_string fname = fattr1.getFileName(); + verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); + + fname.clear(); + fname = dattr.getFileName(); + verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); + + // Get the class of a file attribute's datatype + H5T_class_t atclass = fattr1.getTypeClass(); + verify_val(atclass, H5T_FLOAT, "Attribute::getTypeClass()", __LINE__, __FILE__); + + // Get and verify the number of attributes attached to a file + int n_attrs = file5.getNumAttrs(); + verify_val(n_attrs, 2, "H5File::getNumAttrs()", __LINE__, __FILE__); + + // Get and verify the number of attributes attached to a dataset + n_attrs = 0; + n_attrs = dataset.getNumAttrs(); + verify_val(n_attrs, 1, "DataSet::getNumAttrs()", __LINE__, __FILE__); + + // Read back attribute's data + HDmemset(rdata, 0, sizeof(rdata)); dattr.read(PredType::NATIVE_INT, rdata); /* Check results */ for (i = 0; i < ATTR1_DIM1; i++) { if (rdata[i] != dattr_data[i]) { H5_FAILED(); - cerr << endl; + cerr << endl; cerr << "element [" << i << "] is " << rdata[i] << - "but should have been " << dattr_data[i] << endl; + "but should have been " << dattr_data[i] << endl; } } - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -618,30 +616,29 @@ static void test_file_attribute() issue_fail_msg("test_file_attribute()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_file_attribute() - -const H5std_string FILE6("tfile5.h5"); -const H5std_string ROOTGROUP("/"); -const H5std_string GROUP1("/G1"); -const H5std_string SUBGROUP3("/G1/G3"); +const H5std_string FILE6("tfile5.h5"); +const H5std_string ROOTGROUP("/"); +const H5std_string GROUP1("/G1"); +const H5std_string SUBGROUP3("/G1/G3"); /*------------------------------------------------------------------------- - * Function: test_libver_bounds_real + * Function: test_libver_bounds_real * - * Purpose Verify that a file created and modified with the - * specified libver bounds has the specified object header - * versions for the right objects. + * Purpose: Verify that a file created and modified with the + * specified libver bounds has the specified object header + * versions for the right objects. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) - * March, 2015 + * Programmer: Binh-Minh Ribler (use C version) + * March, 2015 * *------------------------------------------------------------------------- */ static void test_libver_bounds_real( - H5F_libver_t libver_create, unsigned oh_vers_create, - H5F_libver_t libver_mod, unsigned oh_vers_mod) + H5F_libver_t libver_create, unsigned oh_vers_create, + H5F_libver_t libver_mod, unsigned oh_vers_mod) { try { @@ -713,12 +710,12 @@ static void test_libver_bounds_real( * * Function: test_libver_bounds * - * Purpose Verify that a file created and modified with various - * libver bounds is handled correctly. + * Purpose: Verify that a file created and modified with various + * libver bounds is handled correctly. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) + * Programmer: Binh-Minh Ribler (use C version) * March 2015 * *------------------------------------------------------------------------- @@ -735,14 +732,16 @@ static void test_libver_bounds() } /* end test_libver_bounds() */ /*------------------------------------------------------------------------- - * Function: test_commonfg + * Function: test_commonfg * - * Purpose Verify that H5File works as a root group. + * Purpose: Verify that a file created and modified with the + * specified libver bounds has the specified object header + * versions for the right objects. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) - * March, 2015 + * Programmer: Binh-Minh Ribler (use C version) + * March, 2015 * *------------------------------------------------------------------------- */ @@ -753,40 +752,40 @@ static void test_commonfg() try { // Create a file using default properties. - H5File file4(FILE4, H5F_ACC_TRUNC); + H5File file4(FILE4, H5F_ACC_TRUNC); - // Try opening the root group. - Group rootgroup(file4.openGroup(ROOTGROUP)); + // Try opening the root group. + Group rootgroup(file4.openGroup(ROOTGROUP)); - // Create a group in the root group. - Group group(rootgroup.createGroup(GROUPNAME, 0)); + // Create a group in the root group. + Group group(rootgroup.createGroup(GROUPNAME, 0)); - // Create the data space. - hsize_t dims[RANK] = {NX, NY}; - DataSpace space(RANK, dims); + // Create the data space. + hsize_t dims[RANK] = {NX, NY}; + DataSpace space(RANK, dims); - // Create a new dataset. - DataSet dataset(group.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); + // Create a new dataset. + DataSet dataset(group.createDataSet (DSETNAME, PredType::NATIVE_INT, space)); - // Get and verify file name via a dataset. - H5std_string file_name = dataset.getFileName(); - verify_val(file_name, FILE4, "DataSet::getFileName", __LINE__, __FILE__); + // Get and verify file name via a dataset. + H5std_string file_name = dataset.getFileName(); + verify_val(file_name, FILE4, "DataSet::getFileName", __LINE__, __FILE__); - // Create an attribute for the dataset. - Attribute attr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); + // Create an attribute for the dataset. + Attribute attr(dataset.createAttribute(DATTRNAME, PredType::NATIVE_INT, space)); - // Get and verify file name via an attribute. - file_name = attr.getFileName(); - verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); + // Get and verify file name via an attribute. + file_name = attr.getFileName(); + verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); - // Create an attribute for the file via root group. - Attribute rootg_attr(rootgroup.createAttribute(FATTRNAME, PredType::NATIVE_INT, space)); + // Create an attribute for the file via root group. + Attribute rootg_attr(rootgroup.createAttribute(FATTRNAME, PredType::NATIVE_INT, space)); - // Get and verify file name via an attribute. - file_name = attr.getFileName(); - verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); + // Get and verify file name via an attribute. + file_name = attr.getFileName(); + verify_val(file_name, FILE4, "Attribute::getFileName", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) @@ -796,133 +795,14 @@ static void test_commonfg() } /* end test_commonfg() */ -const H5std_string FILE7("tfile7.h5"); - -/*------------------------------------------------------------------------- - * Function: test_file_info - * - * Purpose Verify that various properties in a file creation property - * lists are stored correctly in the file and can be retrieved - * when the file is re-opened. - * - * Return None - * - * Programmer Binh-Minh Ribler - * February, 2017 - * - *------------------------------------------------------------------------- - */ -static void test_file_info() -{ - // Output message about test being performed - SUBTEST("File general information"); - - hsize_t in_threshold = 2; // Free space section threshold to set */ - hsize_t out_threshold = 0; // Free space section threshold to get */ - // File space handling strategy - H5F_file_space_type_t in_strategy = H5F_FILE_SPACE_ALL; - // File space handling strategy - H5F_file_space_type_t out_strategy = H5F_FILE_SPACE_DEFAULT; - - try { - // Create a file using default properties. - H5File tempfile(FILE7, H5F_ACC_TRUNC); - - // Get the file's version information. - H5F_info2_t finfo; - tempfile.getFileInfo(finfo); - verify_val(finfo.super.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); - verify_val(finfo.free.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); - verify_val(finfo.sohm.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); - - // Close the file. - tempfile.close(); - - // Create file creation property list. - FileCreatPropList fcpl; - - // Set various file information. - fcpl.setUserblock(F2_USERBLOCK_SIZE); - fcpl.setSizes(F2_OFFSET_SIZE, F2_LENGTH_SIZE); - fcpl.setSymk(F2_SYM_INTERN_K, F2_SYM_LEAF_K); - fcpl.setIstorek(F2_ISTORE); - fcpl.setFileSpace(in_strategy, in_threshold); - - // Creating a file with the non-default file creation property list - // should create a version 1 superblock - - // Create file with custom file creation property list. - H5File file7(FILE7, H5F_ACC_TRUNC, fcpl); - - // Close the file creation property list. - fcpl.close(); - - // Get the file's version information. - file7.getFileInfo(finfo); - verify_val(finfo.super.version, 2, "H5File::getFileInfo", __LINE__, __FILE__); - verify_val(finfo.free.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); - verify_val(finfo.sohm.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); - - // Close the file. - file7.close(); - - // Re-open the file. - file7.openFile(FILE7, H5F_ACC_RDONLY); - - // Get the file's creation property list. - FileCreatPropList fcpl2 = file7.getCreatePlist(); - - // Get the file's version information. - file7.getFileInfo(finfo); - verify_val(finfo.super.version, 2, "H5File::getFileInfo", __LINE__, __FILE__); - verify_val(finfo.free.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); - verify_val(finfo.sohm.version, 0, "H5File::getFileInfo", __LINE__, __FILE__); - - // Retrieve the property values & check them. - hsize_t userblock = fcpl2.getUserblock(); - verify_val(userblock, F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - - size_t off_size = 0, len_size = 0; - fcpl2.getSizes(off_size, len_size); - verify_val(off_size, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - verify_val(len_size, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - - unsigned sym_ik = 0, sym_lk = 0; - fcpl2.getSymk(sym_ik, sym_lk); - verify_val(sym_ik, F2_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - verify_val(sym_lk, F2_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); - - unsigned istore_ik = fcpl2.getIstorek(); - verify_val(istore_ik, F2_ISTORE, "FileCreatPropList::getIstorek", __LINE__, __FILE__); - - /* ret=H5Pget_shared_mesg_nindexes(fcpl2,&nindexes); - CHECK(ret, FAIL, "H5Pget_shared_mesg_nindexes"); - VERIFY(nindexes, MISC11_NINDEXES, "H5Pget_shared_mesg_nindexes"); - */ - - // Get and verify the file space info from the creation property list */ - out_strategy = fcpl2.getFileSpaceStrategy(); - verify_val(static_cast(out_strategy), static_cast(in_strategy), "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__); - - out_threshold = fcpl2.getFileSpaceThreshold(); - verify_val(static_cast(out_threshold), static_cast(in_threshold), "FileCreatPropList::getFileSpaceThreshold", __LINE__, __FILE__); - - PASSED(); - } // end of try block - catch (Exception& E) - { - issue_fail_msg("test_filespace_info()", __LINE__, __FILE__, E.getCDetailMsg()); - } -} /* test_file_info() */ - /*------------------------------------------------------------------------- * Function: test_file * - * Purpose Main file testing routine + * Purpose: Main file testing routine * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) + * Programmer: Binh-Minh Ribler (use C version) * January 2001 * * Modifications: @@ -935,25 +815,24 @@ void test_file() // Output message about test being performed MESSAGE(5, ("Testing File I/O Operations\n")); - test_file_create(); // Test file creation (also creation templates) - test_file_open(); // Test file opening - test_file_size(); // Test file size - test_file_name(); // Test getting file's name - test_file_attribute(); // Test file attribute feature - test_libver_bounds(); // Test format version - test_commonfg(); // Test H5File as a root group - test_file_info(); // Test various file info + test_file_create(); // Test file creation (also creation templates) + test_file_open(); // Test file opening + test_file_size(); // Test file size + test_file_name(); // Test getting file's name + test_file_attribute(); // Test file attribute feature + test_libver_bounds(); // Test format version + test_commonfg(); } // test_file() /*------------------------------------------------------------------------- - * Function: cleanup_file + * Function: cleanup_file * - * Purpose Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return none + * Return: none * - * Programmer (use C version) + * Programmer: (use C version) * * Modifications: * @@ -967,8 +846,7 @@ void cleanup_file() HDremove(FILE1.c_str()); HDremove(FILE2.c_str()); HDremove(FILE3.c_str()); - HDremove(FILE4.c_str()); +// HDremove(FILE4.c_str()); HDremove(FILE5.c_str()); HDremove(FILE6.c_str()); - HDremove(FILE7.c_str()); } // cleanup_file diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 19f5b5a..ee78fe1 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -33,15 +33,15 @@ using namespace H5; #include "h5test.h" #include "h5cpputil.h" // C++ utilility header file -#define DSET_DIM1 100 -#define DSET_DIM2 200 +#define DSET_DIM1 100 +#define DSET_DIM2 200 #define FILTER_CHUNK_DIM1 2 #define FILTER_CHUNK_DIM2 25 // will do this function later or use it as guideline - BMR - 2007/01/26 #if 0 static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl, - int if_fletcher32, int corrupted, hsize_t *dset_size) + int if_fletcher32, int corrupted, hsize_t *dset_size) { cerr << "do nothing right now" << endl; return(0); @@ -58,25 +58,25 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, static size_t filter_bogus(size_t nbytes); /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "bogus", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_BOGUS, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "bogus", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ (H5Z_func_t)filter_bogus, /* The actual filter function */ }}; /*------------------------------------------------------------------------- * Function: filter_bogus * - * Purpose A bogus compression method that doesn't do anything. + * Purpose: A bogus compression method that doesn't do anything. * - * Return Success: Data chunk size + * Return: Success: Data chunk size * - * Failure: 0 + * Failure: 0 * - * Programmer Robb Matzke + * Programmer: Robb Matzke * Tuesday, April 21, 1998 * * Modifications: @@ -95,17 +95,17 @@ filter_bogus(size_t nbytes) } /*------------------------------------------------------------------------- - * Function: test_null_filter + * Function: test_null_filter * - * Purpose Test null I/O filter by itself. + * Purpose: Test null I/O filter by itself. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version, from dsets.c/test_filters) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version, from dsets.c/test_filters) + * January, 2007 * * Modifications: - * Note: H5Z interface is not implemented yet. + * Note: H5Z interface is not implemented yet. * *------------------------------------------------------------------------- */ @@ -118,25 +118,25 @@ static void test_null_filter() // Output message about test being performed SUBTEST("'Null' filter"); try { - //hsize_t null_size; // Size of dataset with null filter + //hsize_t null_size; // Size of dataset with null filter - // Prepare dataset create property list - DSetCreatPropList dsplist; - dsplist.setChunk(2, chunk_size); + // Prepare dataset create property list + DSetCreatPropList dsplist; + dsplist.setChunk(2, chunk_size); - if (H5Zregister (H5Z_BOGUS)<0) + if (H5Zregister (H5Z_BOGUS)<0) throw Exception("test_null_filter", "H5Zregister failed"); - // Set some pretent filter - dsplist.setFilter(H5Z_FILTER_BOGUS); + // Set some pretent filter + dsplist.setFilter(H5Z_FILTER_BOGUS); - // this function is just a stub right now; will work on it later - BMR - //if(test_filter_internal(file,DSET_BOGUS_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&null_size)<0) + // this function is just a stub right now; will work on it later - BMR + //if(test_filter_internal(file,DSET_BOGUS_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&null_size)<0) // throw Exception("test_null_filter", "test_filter_internal failed"); - // Close objects. - dsplist.close(); - PASSED(); + // Close objects. + dsplist.close(); + PASSED(); } // end of try // catch all other exceptions @@ -147,17 +147,17 @@ static void test_null_filter() } // test_null_filter /*------------------------------------------------------------------------- - * Function: test_szip_filter + * Function: test_szip_filter * - * Purpose Test SZIP filter by itself. + * Purpose: Test SZIP filter by itself. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (partly from dsets.c/test_filters) - * January, 2007 + * Programmer: Binh-Minh Ribler (partly from dsets.c/test_filters) + * January, 2007 * * Modifications: - * Note: H5Z interface is not implemented yet. + * Note: H5Z interface is not implemented yet. * *------------------------------------------------------------------------- */ @@ -232,7 +232,7 @@ static void test_szip_filter(H5File& file1) delete[] tconv_buf; } // if szip presents else { - SKIPPED(); + SKIPPED(); } #else /* H5_HAVE_FILTER_SZIP */ @@ -266,9 +266,9 @@ void test_filters() H5File file1(FILE1, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); - // Test basic VL string datatype - test_null_filter(); - test_szip_filter(file1); + // Test basic VL string datatype + test_null_filter(); + test_szip_filter(file1); } catch (Exception& E) { @@ -277,13 +277,13 @@ void test_filters() } // test_filters() /*------------------------------------------------------------------------- - * Function: cleanup_filters + * Function: cleanup_filters * - * Purpose Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return none + * Return: none * - * Programmer Quincey Koziol + * Programmer: Quincey Koziol * September 10, 1999 * * Modifications: diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index a3aafb3..c795c08 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -35,7 +35,7 @@ using namespace H5; #include "h5test.h" #include "h5cpputil.h" // C++ utilility header file -#include "H5srcdir.h" // srcdir querying header file +#include "H5srcdir.h" // srcdir querying header file const H5std_string TESTFILE("th5s.h5"); const H5std_string DATAFILE("th5s1.h5"); @@ -86,123 +86,124 @@ int space5_data = 7; /*------------------------------------------------------------------------- * - * Function: test_h5s_basic + * Function: test_h5s_basic * - * Purpose Test basic H5S (dataspace) code + * Purpose: Test basic H5S (dataspace) code * - * Return none + * Return: none * - * Programmer Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. * April 12, 2011: Raymond Lu - * Starting from the 1.8.7 release, we allow dimension - * size to be zero. So I took out the test against it. + * Starting from the 1.8.7 release, we allow dimension + * size to be zero. So I took out the test against it. *------------------------------------------------------------------------- */ static void test_h5s_basic() { - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3, SPACE2_DIM4}; - hsize_t dims3[H5S_MAX_RANK+1]; - hsize_t tmax[4]; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3, + SPACE2_DIM4}; + hsize_t dims3[H5S_MAX_RANK+1]; + hsize_t tmax[4]; // Output message about test being performed SUBTEST("Dataspace Manipulation"); try { - // Create simple dataspace sid1 - DataSpace sid1 (SPACE1_RANK, dims1 ); - - // Get simple extent npoints of the dataspace sid1 and verify it - hssize_t n; // Number of dataspace elements - n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, (long)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3), - "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - - // Get the logical rank of dataspace sid1 and verify it - int rank; // Logical rank of dataspace - rank = sid1.getSimpleExtentNdims(); - verify_val(rank, SPACE1_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - - // Retrieves dimension size of dataspace sid1 and verify it - int ndims; // Number of dimensions - hsize_t tdims[4]; // Dimension array to test with - ndims = sid1.getSimpleExtentDims( tdims ); - verify_val(ndims, SPACE1_RANK, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - verify_val(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(unsigned)), 0, - "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - - // Create simple dataspace sid2 - hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, SPACE2_MAX4}; - DataSpace sid2 (SPACE2_RANK, dims2, max2); - - // Get simple extent npoints of dataspace sid2 and verify it - n = sid2.getSimpleExtentNpoints(); - verify_val((long)n, (long)(SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4), - "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - - // Get the logical rank of dataspace sid2 and verify it - rank = sid2.getSimpleExtentNdims(); - verify_val(rank, SPACE2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - - // Retrieves dimension size and max size of dataspace sid2 and - // verify them - ndims = sid2.getSimpleExtentDims( tdims, tmax ); - verify_val(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0, - "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - verify_val(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(unsigned)), 0, - "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - - // Check to be sure we can't create a simple data space that has too - // many dimensions. - try { - DataSpace manydims_ds(H5S_MAX_RANK+1, dims3, NULL); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("DataSpace constructor", "Library allowed overwrite of existing dataset"); - } - catch (DataSpaceIException& E) // Simple data space with too many dims - {} // do nothing, exception expected + // Create simple dataspace sid1 + DataSpace sid1 (SPACE1_RANK, dims1 ); + + // Get simple extent npoints of the dataspace sid1 and verify it + hssize_t n; // Number of dataspace elements + n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, (long)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3), + "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + + // Get the logical rank of dataspace sid1 and verify it + int rank; // Logical rank of dataspace + rank = sid1.getSimpleExtentNdims(); + verify_val(rank, SPACE1_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + + // Retrieves dimension size of dataspace sid1 and verify it + int ndims; // Number of dimensions + hsize_t tdims[4]; // Dimension array to test with + ndims = sid1.getSimpleExtentDims( tdims ); + verify_val(ndims, SPACE1_RANK, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + verify_val(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(unsigned)), 0, + "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + + // Create simple dataspace sid2 + hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, SPACE2_MAX4}; + DataSpace sid2 (SPACE2_RANK, dims2, max2); + + // Get simple extent npoints of dataspace sid2 and verify it + n = sid2.getSimpleExtentNpoints(); + verify_val((long)n, (long)(SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4), + "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + + // Get the logical rank of dataspace sid2 and verify it + rank = sid2.getSimpleExtentNdims(); + verify_val(rank, SPACE2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + + // Retrieves dimension size and max size of dataspace sid2 and + // verify them + ndims = sid2.getSimpleExtentDims( tdims, tmax ); + verify_val(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0, + "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + verify_val(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(unsigned)), 0, + "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + + // Check to be sure we can't create a simple data space that has too + // many dimensions. + try { + DataSpace manydims_ds(H5S_MAX_RANK+1, dims3, NULL); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("DataSpace constructor", "Library allowed overwrite of existing dataset"); + } + catch (DataSpaceIException& E) // Simple data space with too many dims + {} // do nothing, exception expected /* - * Try reading a file that has been prepared that has a dataset with a - * higher dimensionality than what the library can handle. - * - * If this test fails and the H5S_MAX_RANK variable has changed, follow - * the instructions in space_overflow.c for regenating the th5s.h5 file. - */ - char *tmp_str = new char[TESTFILE.length()+1]; - strcpy(tmp_str, TESTFILE.c_str()); - const char *testfile = H5_get_srcdir_filename(tmp_str); - delete []tmp_str; - - // Create file - H5File fid1(testfile, H5F_ACC_RDONLY); - - // Try to open the dataset that has higher dimensionality than - // what the library can handle and this operation should fail. - try { - DataSet dset1 = fid1.openDataSet( "dset" ); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5File::openDataSet", "Opening a dataset with higher dimensionality than what the library can handle"); - } - catch (FileIException& E) // catching higher dimensionality dataset - {} // do nothing, exception expected + * Try reading a file that has been prepared that has a dataset with a + * higher dimensionality than what the library can handle. + * + * If this test fails and the H5S_MAX_RANK variable has changed, follow + * the instructions in space_overflow.c for regenating the th5s.h5 file. + */ + char *tmp_str = new char[TESTFILE.length()+1]; + strcpy(tmp_str, TESTFILE.c_str()); + const char *testfile = H5_get_srcdir_filename(tmp_str); + delete []tmp_str; + + // Create file + H5File fid1(testfile, H5F_ACC_RDONLY); + + // Try to open the dataset that has higher dimensionality than + // what the library can handle and this operation should fail. + try { + DataSet dset1 = fid1.openDataSet( "dset" ); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5File::openDataSet", "Opening a dataset with higher dimensionality than what the library can handle"); + } + catch (FileIException& E) // catching higher dimensionality dataset + {} // do nothing, exception expected // CHECK_I(ret, "H5Fclose"); // leave this here, later, fake a failure - // in the p_close see how this will handle it. - BMR + // in the p_close see how this will handle it. - BMR - PASSED(); - } // end of try block + PASSED(); + } // end of try block catch (InvalidActionException& E) { @@ -218,22 +219,22 @@ static void test_h5s_basic() /*------------------------------------------------------------------------- * - * Function: test_h5s_scalar_write + * Function: test_h5s_scalar_write * - * Purpose Test scalar H5S (dataspace) writing code + * Purpose: Test scalar H5S (dataspace) writing code * - * Return none + * Return: none * - * Programmer Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_scalar_write() @@ -242,124 +243,124 @@ static void test_h5s_scalar_write() SUBTEST("Scalar Dataspace Writing"); try { - // Create file - H5File fid1(DATAFILE, H5F_ACC_TRUNC); + // Create file + H5File fid1(DATAFILE, H5F_ACC_TRUNC); - // Create scalar dataspace - DataSpace sid1(SPACE3_RANK, NULL); + // Create scalar dataspace + DataSpace sid1(SPACE3_RANK, NULL); - //n = H5Sget_simple_extent_npoints(sid1); - hssize_t n; // Number of dataspace elements - n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + //n = H5Sget_simple_extent_npoints(sid1); + hssize_t n; // Number of dataspace elements + n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - int rank; // Logical rank of dataspace - rank = sid1.getSimpleExtentNdims(); - verify_val(rank, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + int rank; // Logical rank of dataspace + rank = sid1.getSimpleExtentNdims(); + verify_val(rank, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - // Retrieves dimension size of dataspace sid1 and verify it - int ndims; // Number of dimensions - hsize_t tdims[4]; // Dimension array to test with - ndims = sid1.getSimpleExtentDims( tdims ); - verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + // Retrieves dimension size of dataspace sid1 and verify it + int ndims; // Number of dimensions + hsize_t tdims[4]; // Dimension array to test with + ndims = sid1.getSimpleExtentDims( tdims ); + verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - // Verify extent type - H5S_class_t ext_type; // Extent type - ext_type = sid1.getSimpleExtentType(); - verify_val(ext_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__); + // Verify extent type + H5S_class_t ext_type; // Extent type + ext_type = sid1.getSimpleExtentType(); + verify_val(ext_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__); - // Create and write a dataset - DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); - dataset.write(&space3_data, PredType::NATIVE_UINT); + // Create and write a dataset + DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); + dataset.write(&space3_data, PredType::NATIVE_UINT); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_h5s_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_h5s_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_scalar_write() /*------------------------------------------------------------------------- * - * Function: test_h5s_scalar_read + * Function: test_h5s_scalar_read * - * Purpose Test scalar H5S (dataspace) reading code + * Purpose: Test scalar H5S (dataspace) reading code * - * Return none + * Return: none * - * Programmer Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_scalar_read() { - hsize_t tdims[4]; // Dimension array to test with + hsize_t tdims[4]; // Dimension array to test with // Output message about test being performed SUBTEST("Scalar Dataspace Reading"); try { - // Open file - H5File fid1(DATAFILE, H5F_ACC_RDWR); + // Open file + H5File fid1(DATAFILE, H5F_ACC_RDWR); - // Create a dataset - DataSet dataset = fid1.openDataSet("Dataset1"); + // Create a dataset + DataSet dataset = fid1.openDataSet("Dataset1"); - DataSpace sid1 = dataset.getSpace(); + DataSpace sid1 = dataset.getSpace(); - // Get the number of dataspace elements - hssize_t n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + // Get the number of dataspace elements + hssize_t n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - // Get the logical rank of the dataspace - int ndims = sid1.getSimpleExtentNdims(); - verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + // Get the logical rank of the dataspace + int ndims = sid1.getSimpleExtentNdims(); + verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - ndims = sid1.getSimpleExtentDims(tdims); - verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + ndims = sid1.getSimpleExtentDims(tdims); + verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - // Read data back and verify it - unsigned rdata; // Scalar data read in - dataset.read(&rdata, PredType::NATIVE_UINT); - verify_val(rdata, space3_data, "DataSet::read", __LINE__, __FILE__); + // Read data back and verify it + unsigned rdata; // Scalar data read in + dataset.read(&rdata, PredType::NATIVE_UINT); + verify_val(rdata, space3_data, "DataSet::read", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) { - // all the exceptions caused by negative returned values by C APIs - issue_fail_msg("test_h5s_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); + // all the exceptions caused by negative returned values by C APIs + issue_fail_msg("test_h5s_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_scalar_read() /*------------------------------------------------------------------------- * - * Function: test_h5s_null + * Function: test_h5s_null * - * Purpose Test null H5S (dataspace) code + * Purpose: Test null H5S (dataspace) code * - * Return none + * Return: none * - * Programmer Raymond Lu (using C version) + * Programmer: Raymond Lu (using C version) * May 18, 2004 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_null() @@ -368,53 +369,53 @@ static void test_h5s_null() SUBTEST("Null Dataspace Writing"); try { - // Create file - H5File fid1(DATAFILE, H5F_ACC_TRUNC); + // Create file + H5File fid1(DATAFILE, H5F_ACC_TRUNC); - // Create scalar dataspace - DataSpace sid1(H5S_NULL); + // Create scalar dataspace + DataSpace sid1(H5S_NULL); - hssize_t n; // Number of dataspace elements - n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 0, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + hssize_t n; // Number of dataspace elements + n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 0, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - // Create a dataset - DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); + // Create a dataset + DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); // Try to write nothing to the dataset - dataset.write(&space5_data, PredType::NATIVE_INT); + dataset.write(&space5_data, PredType::NATIVE_INT); // Read the data. Make sure no change to the buffer - dataset.read(&space5_data, PredType::NATIVE_INT); - verify_val(space5_data, 7, "DataSet::read", __LINE__, __FILE__); + dataset.read(&space5_data, PredType::NATIVE_INT); + verify_val(space5_data, 7, "DataSet::read", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_h5s_null()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_h5s_null()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_null() /*------------------------------------------------------------------------- * - * Function: test_h5s_compound_scalar_write + * Function: test_h5s_compound_scalar_write * - * Purpose Test scalar H5S (dataspace) writing for compound - * datatypes + * Purpose: Test scalar H5S (dataspace) writing for compound + * datatypes * - * Return none + * Return: none * - * Programmer Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_compound_scalar_write() @@ -423,135 +424,135 @@ static void test_h5s_compound_scalar_write() SUBTEST("Compound Dataspace Writing"); try { - // Create file - H5File fid1(DATAFILE, H5F_ACC_TRUNC); - - // Create the compound datatype. - CompType tid1(sizeof(struct space4_struct)); - space4_field1_off=HOFFSET(struct space4_struct, c1); - tid1.insertMember(SPACE4_FIELDNAME1, space4_field1_off, - PredType::NATIVE_SCHAR); - space4_field2_off=HOFFSET(struct space4_struct, u); - tid1.insertMember(SPACE4_FIELDNAME2, space4_field2_off, - PredType::NATIVE_UINT); - space4_field3_off=HOFFSET(struct space4_struct, f); - tid1.insertMember(SPACE4_FIELDNAME3, space4_field3_off, - PredType::NATIVE_FLOAT); - space4_field4_off=HOFFSET(struct space4_struct, c2); - tid1.insertMember(SPACE4_FIELDNAME4, space4_field4_off, - PredType::NATIVE_SCHAR); - - // Create scalar dataspace - DataSpace sid1(SPACE3_RANK, NULL); - - // Get the number of dataspace elements - hssize_t n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - - // Get the logical rank of the dataspace - int ndims = sid1.getSimpleExtentNdims(); - verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - - hsize_t tdims[4]; // Dimension array to test with - ndims = sid1.getSimpleExtentDims(tdims); - verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - - // Create and write a dataset - DataSet dataset = fid1.createDataSet("Dataset1", tid1, sid1); - dataset.write(&space4_data, tid1); - - PASSED(); - } // end of try block + // Create file + H5File fid1(DATAFILE, H5F_ACC_TRUNC); + + // Create the compound datatype. + CompType tid1(sizeof(struct space4_struct)); + space4_field1_off=HOFFSET(struct space4_struct, c1); + tid1.insertMember(SPACE4_FIELDNAME1, space4_field1_off, + PredType::NATIVE_SCHAR); + space4_field2_off=HOFFSET(struct space4_struct, u); + tid1.insertMember(SPACE4_FIELDNAME2, space4_field2_off, + PredType::NATIVE_UINT); + space4_field3_off=HOFFSET(struct space4_struct, f); + tid1.insertMember(SPACE4_FIELDNAME3, space4_field3_off, + PredType::NATIVE_FLOAT); + space4_field4_off=HOFFSET(struct space4_struct, c2); + tid1.insertMember(SPACE4_FIELDNAME4, space4_field4_off, + PredType::NATIVE_SCHAR); + + // Create scalar dataspace + DataSpace sid1(SPACE3_RANK, NULL); + + // Get the number of dataspace elements + hssize_t n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + + // Get the logical rank of the dataspace + int ndims = sid1.getSimpleExtentNdims(); + verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + + hsize_t tdims[4]; // Dimension array to test with + ndims = sid1.getSimpleExtentDims(tdims); + verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + + // Create and write a dataset + DataSet dataset = fid1.createDataSet("Dataset1", tid1, sid1); + dataset.write(&space4_data, tid1); + + PASSED(); + } // end of try block catch (Exception& E) { - // all the exceptions caused by negative returned values by C APIs - issue_fail_msg("test_h5s_compound_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg()); + // all the exceptions caused by negative returned values by C APIs + issue_fail_msg("test_h5s_compound_scalar_write()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_compound_scalar_write() /*------------------------------------------------------------------------- * - * Function: test_h5s_compound_scalar_read + * Function: test_h5s_compound_scalar_read * - * Purpose Test scalar H5S (dataspace) reading for compound - * datatypes + * Purpose: Test scalar H5S (dataspace) reading for compound + * datatypes * - * Return none + * Return: none * - * Programmer Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hssize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. *------------------------------------------------------------------------- */ static void test_h5s_compound_scalar_read() { - hsize_t tdims[4]; // Dimension array to test with + hsize_t tdims[4]; // Dimension array to test with // Output message about test being performed SUBTEST("Compound Dataspace Reading"); try { - // Open file - H5File fid1(DATAFILE, H5F_ACC_RDWR); + // Open file + H5File fid1(DATAFILE, H5F_ACC_RDWR); - // Create a dataset - DataSet dataset = fid1.openDataSet("Dataset1"); + // Create a dataset + DataSet dataset = fid1.openDataSet("Dataset1"); - DataSpace sid1 = dataset.getSpace(); + DataSpace sid1 = dataset.getSpace(); - // Get the number of dataspace elements - hssize_t n = sid1.getSimpleExtentNpoints(); - verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); + // Get the number of dataspace elements + hssize_t n = sid1.getSimpleExtentNpoints(); + verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - // Get the logical rank of the dataspace - int ndims = sid1.getSimpleExtentNdims(); - verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); + // Get the logical rank of the dataspace + int ndims = sid1.getSimpleExtentNdims(); + verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - ndims = sid1.getSimpleExtentDims(tdims); - verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); + ndims = sid1.getSimpleExtentDims(tdims); + verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__); - // Get the datatype of this dataset. - CompType type(dataset); + // Get the datatype of this dataset. + CompType type(dataset); - struct space4_struct rdata; // Scalar data read in - dataset.read(&rdata, type); + struct space4_struct rdata; // Scalar data read in + dataset.read(&rdata, type); - // Verify read data - if(HDmemcmp(&space4_data,&rdata,sizeof(struct space4_struct))) - { + // Verify read data + if(HDmemcmp(&space4_data,&rdata,sizeof(struct space4_struct))) + { cerr << "scalar data different: space4_data.c1=" - << space4_data.c1 << ", read_data4.c1=" << rdata.c1 << endl; + << space4_data.c1 << ", read_data4.c1=" << rdata.c1 << endl; cerr << "scalar data different: space4_data.u=" - << space4_data.u << ", read_data4.u=" << rdata.u << endl; + << space4_data.u << ", read_data4.u=" << rdata.u << endl; cerr << "scalar data different: space4_data.f=" - << space4_data.f << ", read_data4.f=" << rdata.f << endl; + << space4_data.f << ", read_data4.f=" << rdata.f << endl; TestErrPrintf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n", - space4_data.c1, rdata.c2); - } // end if - PASSED(); + space4_data.c1, rdata.c2); + } // end if + PASSED(); } // end of try block catch (Exception& E) { - // all the exceptions caused by negative returned values by C APIs - issue_fail_msg("test_h5s_compound_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); + // all the exceptions caused by negative returned values by C APIs + issue_fail_msg("test_h5s_compound_scalar_read()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_compound_scalar_read() /*------------------------------------------------------------------------- * - * Function: test_h5s + * Function: test_h5s * - * Purpose Main dataspace testing routine + * Purpose: Main dataspace testing routine * - * Return none + * Return: none * - * Programmer Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * Mar 2001 * * Modifications: @@ -563,23 +564,23 @@ void test_h5s() // Output message about test being performed MESSAGE(5, ("Testing Dataspaces\n")); - test_h5s_basic(); // Test basic H5S code - test_h5s_scalar_write(); // Test scalar H5S writing code - test_h5s_scalar_read(); // Test scalar H5S reading code - test_h5s_null(); // Test null H5S code - test_h5s_compound_scalar_write(); // Test compound datatype scalar H5S writing code - test_h5s_compound_scalar_read(); // Test compound datatype scalar H5S reading code + test_h5s_basic(); // Test basic H5S code + test_h5s_scalar_write(); // Test scalar H5S writing code + test_h5s_scalar_read(); // Test scalar H5S reading code + test_h5s_null(); // Test null H5S code + test_h5s_compound_scalar_write(); // Test compound datatype scalar H5S writing code + test_h5s_compound_scalar_read(); // Test compound datatype scalar H5S reading code } // test_h5s() /*------------------------------------------------------------------------- - * Function: cleanup_h5s + * Function: cleanup_h5s * - * Purpose Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return none + * Return: none * - * Programmer Albert Cheng + * Programmer: Albert Cheng * July 2, 1998 * * Modifications: diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index fce42fa..7ee2b53 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -49,20 +49,20 @@ using namespace H5; //#define SPACE1_RANK 1 //#define SPACE1_DIM1 4 -const H5std_string FILE_ITERATE("titerate.h5"); -const H5std_string GROUP1("Top Group"); -const H5std_string GROUP1_PATH("/Top Group"); -const H5std_string GROUP1_1("Sub-Group 1.1"); -const H5std_string GROUP1_1_PATH("/Top Group/Sub-Group 1.1"); -const H5std_string GROUP1_2("Sub-Group 1.2"); -const H5std_string GROUP1_2_PATH("/Top Group/Sub-Group 1.2"); -const H5std_string DSET_DEFAULT_NAME("default"); -const H5std_string DSET_IN_FILE("Dataset in File"); -const H5std_string DSET_IN_FILE_PATH("/Dataset in File"); -const H5std_string DSET_IN_GRP1("Dataset in Group 1"); -const H5std_string DSET_IN_GRP1_PATH("/Top Group/Dataset in Group 1"); -const H5std_string DSET_IN_GRP1_2("Dataset in Group 1.2"); -const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset in Group 1.2"); +const H5std_string FILE_ITERATE("titerate.h5"); +const H5std_string GROUP1("Top Group"); +const H5std_string GROUP1_PATH("/Top Group"); +const H5std_string GROUP1_1("Sub-Group 1.1"); +const H5std_string GROUP1_1_PATH("/Top Group/Sub-Group 1.1"); +const H5std_string GROUP1_2("Sub-Group 1.2"); +const H5std_string GROUP1_2_PATH("/Top Group/Sub-Group 1.2"); +const H5std_string DSET_DEFAULT_NAME("default"); +const H5std_string DSET_IN_FILE("Dataset in File"); +const H5std_string DSET_IN_FILE_PATH("/Dataset in File"); +const H5std_string DSET_IN_GRP1("Dataset in Group 1"); +const H5std_string DSET_IN_GRP1_PATH("/Top Group/Dataset in Group 1"); +const H5std_string DSET_IN_GRP1_2("Dataset in Group 1.2"); +const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset in Group 1.2"); typedef enum { RET_ZERO, @@ -127,15 +127,15 @@ liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_ } /* end liter_cb() */ /*------------------------------------------------------------------------- - * Function: test_iter_group + * Function: test_iter_group * - * Purpose Tests group iteration + * Purpose: Tests group iteration * - * Return Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer Binh-Minh Ribler - * Friday, September 9, 2016 + * Programmer: Binh-Minh Ribler + * Friday, September 9, 2016 * * Modifications: * @@ -148,142 +148,142 @@ static void test_iter_group(FileAccPropList& fapl) char name[NAMELEN]; /* temporary name buffer */ char *lnames[NDATASETS + 2];/* Names of the links created */ iter_info info; /* Custom iteration information */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ SUBTEST("Group Iteration"); /* Create the test file with the datasets */ try { - // Create file - H5File file(FILE_ITERATE, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); + // Create file + H5File file(FILE_ITERATE, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); - /* Test iterating over empty group */ - info.command = RET_ZERO; - idx = 0; - ret = H5Literate(file.getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info); - verify_val(ret, SUCCEED, "H5Literate", __LINE__, __FILE__); + /* Test iterating over empty group */ + info.command = RET_ZERO; + idx = 0; + ret = H5Literate(file.getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info); + verify_val(ret, SUCCEED, "H5Literate", __LINE__, __FILE__); - DataType datatype(PredType::NATIVE_INT); + DataType datatype(PredType::NATIVE_INT); - // Create a scalar file space - DataSpace filespace; + // Create a scalar file space + DataSpace filespace; - for (i=0; i< NDATASETS; i++) - { + for (i=0; i< NDATASETS; i++) + { sprintf(name, "Dataset %d", i); - // Create a dataset in the file - DataSet dataset = file.createDataSet(name, datatype, filespace); + // Create a dataset in the file + DataSet dataset = file.createDataSet(name, datatype, filespace); /* Keep a copy of the dataset names */ lnames[i] = HDstrdup(name); check_values(lnames[i], "HDstrdup returns NULL", __LINE__, __FILE__); - } /* end for */ + } /* end for */ - /* Create a group and named datatype under root group for testing */ - Group grp(file.createGroup(GROUP1, 0)); - lnames[NDATASETS] = HDstrdup("grp"); - check_values(lnames[NDATASETS], "HDstrdup returns NULL", __LINE__, __FILE__); + /* Create a group and named datatype under root group for testing */ + Group grp(file.createGroup(GROUP1, 0)); + lnames[NDATASETS] = HDstrdup("grp"); + check_values(lnames[NDATASETS], "HDstrdup returns NULL", __LINE__, __FILE__); - datatype.commit(file, "dtype"); - lnames[NDATASETS + 1] = HDstrdup("dtype"); - check_values(lnames[NDATASETS], "HDstrdup returns NULL", __LINE__, __FILE__); + datatype.commit(file, "dtype"); + lnames[NDATASETS + 1] = HDstrdup("dtype"); + check_values(lnames[NDATASETS], "HDstrdup returns NULL", __LINE__, __FILE__); - /* Sort the dataset names */ - HDqsort(lnames, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); + /* Sort the dataset names */ + HDqsort(lnames, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); - /* Iterate through the datasets in the root group in various ways */ + /* Iterate through the datasets in the root group in various ways */ - // Open data file to read - file.openFile(FILE_ITERATE, H5F_ACC_RDONLY, fapl); + // Open data file to read + file.openFile(FILE_ITERATE, H5F_ACC_RDONLY, fapl); - // Open the root group - Group root_group(file.openGroup("/")); + // Open the root group + Group root_group(file.openGroup("/")); - // Get the number of object in the root group - hsize_t nobjs = root_group.getNumObjs(); - verify_val(nobjs, (hsize_t)(NDATASETS + 2), "H5Gget_info", __LINE__, __FILE__); + // Get the number of object in the root group + hsize_t nobjs = root_group.getNumObjs(); + verify_val(nobjs, (hsize_t)(NDATASETS + 2), "H5Gget_info", __LINE__, __FILE__); - H5std_string obj_name; - for (i = 0; i < nobjs; i++) - { - //H5O_info_t oinfo; /* Object info */ + H5std_string obj_name; + for (i = 0; i < nobjs; i++) + { + //H5O_info_t oinfo; /* Object info */ - obj_name = root_group.getObjnameByIdx(i); + obj_name = root_group.getObjnameByIdx(i); //ret = (herr_t)H5Lget_name_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, dataset_name, (size_t)NAMELEN, H5P_DEFAULT); - //oinfo = root_group.childObjType((hsize_t)i, H5_INDEX_NAME, H5_ITER_INC, "."); + //oinfo = root_group.childObjType((hsize_t)i, H5_INDEX_NAME, H5_ITER_INC, "."); //ret = H5Oget_info_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5P_DEFAULT); - } /* end for */ - - // Attempted to iterate with invalid index, should fail - try { - obj_name = root_group.getObjnameByIdx(NDATASETS + 3); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with invalid index"); - } - catch (GroupIException& invalid_action) // invalid index - {} // do nothing, exception expected - - // Attempted to iterate with negative index, should fail - try { - info.command = RET_ZERO; - idx = (hsize_t)-1; - obj_name = root_group.getObjnameByIdx(idx); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with negative index"); - } - catch (FileIException& invalid_action) // invalid index - {} // do nothing, exception expected - catch (GroupIException& invalid_action) // invalid index - {} // do nothing, exception expected - - /* Test skipping exactly as many entries as in the group */ - try { - info.command = RET_ZERO; - idx = NDATASETS + 2; - obj_name = root_group.getObjnameByIdx(idx); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with negative index"); - } - catch (FileIException& invalid_action) // invalid index - {} // do nothing, exception expected - catch (GroupIException& invalid_action) // invalid index - {} // do nothing, exception expected - - /* Test skipping more entries than are in the group */ - try { - info.command = RET_ZERO; - idx = NDATASETS + 3; - obj_name = root_group.getObjnameByIdx(idx); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with negative index"); - } - catch (FileIException& invalid_action) // invalid index - {} // do nothing, exception expected - catch (GroupIException& invalid_action) // invalid index - {} // do nothing, exception expected - - /* Free the dataset names */ - for(i = 0; i< (NDATASETS + 2); i++) - HDfree(lnames[i]); - - // Everything will be closed as they go out of scope - - PASSED(); - } // try block + } /* end for */ + + // Attempted to iterate with invalid index, should fail + try { + obj_name = root_group.getObjnameByIdx(NDATASETS + 3); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with invalid index"); + } + catch (GroupIException& invalid_action) // invalid index + {} // do nothing, exception expected + + // Attempted to iterate with negative index, should fail + try { + info.command = RET_ZERO; + idx = (hsize_t)-1; + obj_name = root_group.getObjnameByIdx(idx); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with negative index"); + } + catch (FileIException& invalid_action) // invalid index + {} // do nothing, exception expected + catch (GroupIException& invalid_action) // invalid index + {} // do nothing, exception expected + + /* Test skipping exactly as many entries as in the group */ + try { + info.command = RET_ZERO; + idx = NDATASETS + 2; + obj_name = root_group.getObjnameByIdx(idx); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with negative index"); + } + catch (FileIException& invalid_action) // invalid index + {} // do nothing, exception expected + catch (GroupIException& invalid_action) // invalid index + {} // do nothing, exception expected + + /* Test skipping more entries than are in the group */ + try { + info.command = RET_ZERO; + idx = NDATASETS + 3; + obj_name = root_group.getObjnameByIdx(idx); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("Group::getObjnameByIdx", "Attempt to iterate with negative index"); + } + catch (FileIException& invalid_action) // invalid index + {} // do nothing, exception expected + catch (GroupIException& invalid_action) // invalid index + {} // do nothing, exception expected + + /* Free the dataset names */ + for(i = 0; i< (NDATASETS + 2); i++) + HDfree(lnames[i]); + + // Everything will be closed as they go out of scope + + PASSED(); + } // try block // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_iter_group", __LINE__, __FILE__); + issue_fail_msg("test_iter_group", __LINE__, __FILE__); } #if 0 @@ -355,59 +355,59 @@ static void test_iter_group(FileAccPropList& fapl) /**************************************************************** ** ** printelems(): Open an attribute and verify that it has a -** the correct name +** the correct name ** ****************************************************************/ -const H5std_string FILE_NAME("titerate.h5"); -const H5std_string GRP_NAME("/Group_A"); -const H5std_string FDATASET_NAME("file dset"); -const H5std_string GDATASET_NAME("group dset"); -const H5std_string ATTR_NAME("Units"); -const H5std_string FATTR_NAME("F attr"); -const H5std_string GATTR_NAME("G attr"); -const int DIM1 = 2; +const H5std_string FILE_NAME("titerate.h5"); +const H5std_string GRP_NAME("/Group_A"); +const H5std_string FDATASET_NAME( "file dset" ); +const H5std_string GDATASET_NAME( "group dset" ); +const H5std_string ATTR_NAME( "Units" ); +const H5std_string FATTR_NAME( "F attr" ); +const H5std_string GATTR_NAME( "G attr" ); +const int DIM1 = 2; void printelems(const Group& group, const H5std_string& dsname, const H5std_string& atname) { try { - DataSet d1(group.openDataSet(dsname)); - DataSpace s1 = d1.getSpace(); - s1.close(); - d1.close(); - - unsigned idx = 0; - Attribute a1(group.openAttribute(idx)); - H5std_string aname = a1.getName(); + DataSet d1(group.openDataSet(dsname)); + DataSpace s1 = d1.getSpace(); + s1.close(); + d1.close(); + + unsigned idx = 0; + Attribute a1(group.openAttribute(idx)); + H5std_string aname = a1.getName(); verify_val(aname, atname, "printelems", __LINE__, __FILE__); - a1.close(); + a1.close(); } // catch failure caused by the DataSpace operations catch( DataSpaceIException error ) { - error.printError(); + error.printError(); } // catch failure caused by the Group operations catch( GroupIException error ) { - error.printError(); + error.printError(); } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); + error.printError(); } } /*------------------------------------------------------------------------- - * Function: test_HDFFV_9920 + * Function: test_HDFFV_9920 * - * Purpose Tests the fix for HDFFV-9920 + * Purpose: Tests the fix for HDFFV-9920 * - * Programmer Binh-Minh Ribler - * Friday, September 9, 2016 + * Programmer: Binh-Minh Ribler + * Friday, September 9, 2016 * * Modifications: * @@ -420,74 +420,74 @@ static void test_HDFFV_9920() try { - // Create a new file and a group in it - H5File file( FILE_NAME, H5F_ACC_TRUNC ); + // Create a new file and a group in it + H5File file( FILE_NAME, H5F_ACC_TRUNC ); - Group gr1(file.createGroup(GRP_NAME)); + Group gr1(file.createGroup(GRP_NAME)); - // Create the data space for the attribute. - DataSpace dspace = DataSpace (1, dims ); + // Create the data space for the attribute. + DataSpace dspace = DataSpace (1, dims ); - DataSet fds = file.createDataSet(FDATASET_NAME, PredType::STD_I32BE, dspace); - DataSet gds = gr1.createDataSet(GDATASET_NAME, PredType::STD_I32BE, dspace); + DataSet fds = file.createDataSet(FDATASET_NAME, PredType::STD_I32BE, dspace); + DataSet gds = gr1.createDataSet(GDATASET_NAME, PredType::STD_I32BE, dspace); - // Create a file attribute and a group attribute. - Attribute fa1 = file.createAttribute(FATTR_NAME, PredType::STD_I32BE, - dspace); - Attribute ga1 = gr1.createAttribute(GATTR_NAME, PredType::STD_I32BE, - dspace); + // Create a file attribute and a group attribute. + Attribute fa1 = file.createAttribute(FATTR_NAME, PredType::STD_I32BE, + dspace); + Attribute ga1 = gr1.createAttribute(GATTR_NAME, PredType::STD_I32BE, + dspace); - // Write the attribute data. - fa1.write( PredType::NATIVE_INT, attr_data); - ga1.write( PredType::NATIVE_INT, attr_data); + // Write the attribute data. + fa1.write( PredType::NATIVE_INT, attr_data); + ga1.write( PredType::NATIVE_INT, attr_data); - fa1.close(); - ga1.close(); - fds.close(); - gds.close(); + fa1.close(); + ga1.close(); + fds.close(); + gds.close(); - // Verify the attributes have correct names. - printelems(file, FDATASET_NAME, FATTR_NAME); - printelems(gr1, GDATASET_NAME, GATTR_NAME); + // Verify the attributes have correct names. + printelems(file, FDATASET_NAME, FATTR_NAME); + printelems(gr1, GDATASET_NAME, GATTR_NAME); } // end of try block // catch failure caused by the H5File operations catch( DataSpaceIException error ) { - error.printError(); + error.printError(); } // catch failure caused by the H5File operations catch( AttributeIException error ) { - error.printError(); + error.printError(); } // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); + error.printError(); } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); + error.printError(); } } /*------------------------------------------------------------------------- - * Function: test_iterate + * Function: test_iterate * - * Purpose Tests iterate functionality + * Purpose: Tests iterate functionality * - * Return Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer Binh-Minh Ribler - * Tuesday, September 6, 2016 + * Programmer: Binh-Minh Ribler + * Tuesday, September 6, 2016 * * Modifications: * @@ -503,20 +503,20 @@ void test_iterate() FileAccPropList fapl; fapl.setLibverBounds(H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - test_iter_group(fapl); // Test iterating groups - test_HDFFV_9920(); // Test the fix of HDFFV-9920 - //test_iter_attr(fapl); // Test iterating attributes + test_iter_group(fapl); // Test iterating groups + test_HDFFV_9920(); // Test the fix of HDFFV-9920 + //test_iter_attr(fapl); // Test iterating attributes } // test_iterate /*------------------------------------------------------------------------- * Function: cleanup_iterate * - * Purpose Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return none + * Return: none * - * Programmer (use C version) + * Programmer: (use C version) * * Modifications: * diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index c217718..3acf4e1 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -43,9 +43,9 @@ using namespace H5; //#define H5G_TESTING //#include "h5test.h" -//#include "H5Gpkg.h" /* Groups */ -//#include "H5Iprivate.h" /* IDs */ -//#include "H5Lprivate.h" /* Links */ +//#include "H5Gpkg.h" /* Groups */ +//#include "H5Iprivate.h" /* IDs */ +//#include "H5Lprivate.h" /* Links */ /* File for external link test. Created with gen_udlinks.c */ #define LINKED_FILE "be_extlink2.h5" @@ -64,39 +64,39 @@ const char *FILENAME[] = { "links6", /* 9 */ "links7", /* 10 */ "links8", /* 11 */ - "extlinks0", /* 12: main files */ - "tmp/extlinks0", /* 13: */ - "extlinks1", /* 14: target files */ - "tmp/extlinks1", /* 15: */ - "extlinks2", /* 16: */ - "tmp/extlinks2", /* 17: */ - "extlinks3", /* 18: */ - "tmp/extlinks3", /* 19: */ - "extlinks4", /* 20: */ - "tmp/extlinks4", /* 21: */ - "extlinks5", /* 22: */ - "tmp/extlinks6", /* 23: */ - "extlinks7", /* 24: */ - "tmp/extlinks7", /* 25: */ - "tmp/extlinks8", /* 26: */ - "extlinks9", /* 27: */ - "tmp/extlinks9", /* 28: */ - "extlinks10", /* 29: */ /* TESTS for windows */ - "tmp/extlinks10", /* 30: */ - "tmp/extlinks11", /* 31: */ - "tmp/extlinks12", /* 32: */ - "extlinks13", /* 33: */ - "tmp/extlinks13", /* 34: */ - "tmp/extlinks14", /* 35: */ - "tmp/extlinks15", /* 36: */ - "extlinks16A", /* 37: */ /* TESTS for H5P_set_elink_fapl */ - "extlinks16B", /* 38: */ - "extlinks17", /* 39: */ - "extlinks18A", /* 40: */ - "extlinks18B", /* 41: */ - "extlinks19A", /* 42: */ - "extlinks19B", /* 43: */ - "extlinks20", /* 44: */ + "extlinks0", /* 12: main files */ + "tmp/extlinks0", /* 13: */ + "extlinks1", /* 14: target files */ + "tmp/extlinks1", /* 15: */ + "extlinks2", /* 16: */ + "tmp/extlinks2", /* 17: */ + "extlinks3", /* 18: */ + "tmp/extlinks3", /* 19: */ + "extlinks4", /* 20: */ + "tmp/extlinks4", /* 21: */ + "extlinks5", /* 22: */ + "tmp/extlinks6", /* 23: */ + "extlinks7", /* 24: */ + "tmp/extlinks7", /* 25: */ + "tmp/extlinks8", /* 26: */ + "extlinks9", /* 27: */ + "tmp/extlinks9", /* 28: */ + "extlinks10", /* 29: */ /* TESTS for windows */ + "tmp/extlinks10", /* 30: */ + "tmp/extlinks11", /* 31: */ + "tmp/extlinks12", /* 32: */ + "extlinks13", /* 33: */ + "tmp/extlinks13", /* 34: */ + "tmp/extlinks14", /* 35: */ + "tmp/extlinks15", /* 36: */ + "extlinks16A", /* 37: */ /* TESTS for H5P_set_elink_fapl */ + "extlinks16B", /* 38: */ + "extlinks17", /* 39: */ + "extlinks18A", /* 40: */ + "extlinks18B", /* 41: */ + "extlinks19A", /* 42: */ + "extlinks19B", /* 43: */ + "extlinks20", /* 44: */ NULL }; @@ -104,12 +104,12 @@ const char *FILENAME[] = { #define TMPDIR "tmp" -#define FAMILY_SIZE 1024 +#define FAMILY_SIZE 1024 #define CORE_INCREMENT 1024 -#define NUM400 400 +#define NUM400 400 /* do not do check_all_closed() for "ext*" files and "tmp/ext*" */ -#define EXTSTOP 12 +#define EXTSTOP 12 #define LINK_BUF_SIZE 1024 #define NAME_BUF_SIZE 1024 @@ -323,16 +323,16 @@ static const char *FILENAME[] = { /*------------------------------------------------------------------------- - * Function: test_basic_links + * Function: test_basic_links * - * Purpose Test building a file with assorted links. + * Purpose: Test building a file with assorted links. * - * Return Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer Binh-Minh Ribler - * October 16, 2009 + * Programmer: Binh-Minh Ribler + * October 16, 2009 * * Modifications: * @@ -340,114 +340,114 @@ static const char *FILENAME[] = { */ static void test_basic_links(hid_t fapl_id, hbool_t new_format) { - hsize_t size[1] = {1}; - char filename[NAME_BUF_SIZE]; + hsize_t size[1] = {1}; + char filename[NAME_BUF_SIZE]; // Use the file access template id to create a file access prop. list. FileAccPropList fapl(fapl_id); try { - if(new_format) - SUBTEST("Link creation (w/new group format)") - else - SUBTEST("Link creation") + if(new_format) + SUBTEST("Link creation (w/new group format)") + else + SUBTEST("Link creation") - h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); - H5File file(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + H5File file(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl); - // Create simple dataspace - DataSpace scalar (1, size, size); + // Create simple dataspace + DataSpace scalar (1, size, size); - // Create a group then close it by letting the object go out of scope - { - Group group(file.createGroup("grp1", 0)); - } + // Create a group then close it by letting the object go out of scope + { + Group group(file.createGroup("grp1", 0)); + } - // Create a dataset then close it by letting the object go out of scope - { - DataSet dset1(file.createDataSet("dset1", PredType::NATIVE_INT, scalar)); - } + // Create a dataset then close it by letting the object go out of scope + { + DataSet dset1(file.createDataSet("dset1", PredType::NATIVE_INT, scalar)); + } - hid_t file_id = file.getId(); + hid_t file_id = file.getId(); - // Because these are not implemented in the C++ API yet, they are - // used so CommonFG::getLinkval can be tested. - // Create a hard link - if(H5Lcreate_hard( - file_id, "dset1", H5L_SAME_LOC, "grp1/hard1", - H5P_DEFAULT, H5P_DEFAULT) < 0) - throw Exception("test_basic_links", "H5Lcreate_hard failed"); + // Because these are not implemented in the C++ API yet, they are + // used so CommonFG::getLinkval can be tested. + // Create a hard link + if(H5Lcreate_hard( + file_id, "dset1", H5L_SAME_LOC, "grp1/hard1", + H5P_DEFAULT, H5P_DEFAULT) < 0) + throw Exception("test_basic_links", "H5Lcreate_hard failed"); - // Create a symbolic link - if(H5Lcreate_soft( - "/dset1", file_id, "grp1/soft", H5P_DEFAULT, H5P_DEFAULT) < 0) - throw Exception("test_basic_links", "H5Lcreate_soft failed"); + // Create a symbolic link + if(H5Lcreate_soft( + "/dset1", file_id, "grp1/soft", H5P_DEFAULT, H5P_DEFAULT) < 0) + throw Exception("test_basic_links", "H5Lcreate_soft failed"); - // Create a symbolic link to something that doesn't exist - if(H5Lcreate_soft( - "foobar", file_id, "grp1/dangle", H5P_DEFAULT, H5P_DEFAULT) < 0) - throw Exception("test_basic_links", "H5Lcreate_soft failed"); + // Create a symbolic link to something that doesn't exist + if(H5Lcreate_soft( + "foobar", file_id, "grp1/dangle", H5P_DEFAULT, H5P_DEFAULT) < 0) + throw Exception("test_basic_links", "H5Lcreate_soft failed"); - // Create a recursive symbolic link - if(H5Lcreate_soft( - "/grp1/recursive", file_id, "/grp1/recursive", - H5P_DEFAULT, H5P_DEFAULT) < 0) - throw Exception("test_basic_links", "H5Lcreate_soft failed"); + // Create a recursive symbolic link + if(H5Lcreate_soft( + "/grp1/recursive", file_id, "/grp1/recursive", + H5P_DEFAULT, H5P_DEFAULT) < 0) + throw Exception("test_basic_links", "H5Lcreate_soft failed"); - // Verify link values before closing the file + // Verify link values before closing the file - H5std_string softlink_val = file.getLinkval("grp1/soft"); - verify_val(softlink_val, "/dset1", "H5File::getLinkval grp1/soft", __LINE__, __FILE__); + H5std_string softlink_val = file.getLinkval("grp1/soft"); + verify_val(softlink_val, "/dset1", "H5File::getLinkval grp1/soft", __LINE__, __FILE__); - H5std_string dngllink_val = file.getLinkval("grp1/dangle"); - verify_val(dngllink_val, "foobar", "H5File::getLinkval grp1/dangle", __LINE__, __FILE__); + H5std_string dngllink_val = file.getLinkval("grp1/dangle"); + verify_val(dngllink_val, "foobar", "H5File::getLinkval grp1/dangle", __LINE__, __FILE__); - H5std_string reclink_val = file.getLinkval("grp1/recursive"); - verify_val(reclink_val, "/grp1/recursive", "H5File::getLinkval grp1/recursive", __LINE__, __FILE__); + H5std_string reclink_val = file.getLinkval("grp1/recursive"); + verify_val(reclink_val, "/grp1/recursive", "H5File::getLinkval grp1/recursive", __LINE__, __FILE__); } // end of try block catch (Exception& E) { - issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); } // Open the file and check on the links in it try { - // Open the file above - H5File file(filename, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); + // Open the file above + H5File file(filename, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); - // Verify link existence - if(file.exists("dset1", LinkAccPropList::DEFAULT) != TRUE) - throw InvalidActionException("H5File::exists", "dset1 doesn't exist"); - if(file.exists("grp1/soft", LinkAccPropList::DEFAULT) != TRUE) - throw InvalidActionException("H5File::exists", "grp1/soft doesn't exist"); + // Verify link existence + if(file.exists("dset1", LinkAccPropList::DEFAULT) != TRUE) + throw InvalidActionException("H5File::exists", "dset1 doesn't exist"); + if(file.exists("grp1/soft", LinkAccPropList::DEFAULT) != TRUE) + throw InvalidActionException("H5File::exists", "grp1/soft doesn't exist"); - // Verify link values - H5std_string softlink_val = file.getLinkval("grp1/soft"); - verify_val(softlink_val, "/dset1", "H5File::getLinkval grp1/soft", __LINE__, __FILE__); + // Verify link values + H5std_string softlink_val = file.getLinkval("grp1/soft"); + verify_val(softlink_val, "/dset1", "H5File::getLinkval grp1/soft", __LINE__, __FILE__); - H5std_string reclink_val = file.getLinkval("grp1/recursive"); - verify_val(reclink_val, "/grp1/recursive", "H5File::getLinkval grp1/recursive", __LINE__, __FILE__); + H5std_string reclink_val = file.getLinkval("grp1/recursive"); + verify_val(reclink_val, "/grp1/recursive", "H5File::getLinkval grp1/recursive", __LINE__, __FILE__); - PASSED(); + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_basic_links()", __LINE__, __FILE__, E.getCDetailMsg()); } } /*------------------------------------------------------------------------- - * Function: test_links + * Function: test_links * - * Purpose Test links + * Purpose: Test links * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler + * Programmer: Binh-Minh Ribler * October 16, 2009 * *------------------------------------------------------------------------- @@ -455,7 +455,7 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) extern "C" void test_links() { - hid_t fapl_id, fapl2_id; /* File access property lists */ + hid_t fapl_id, fapl2_id; /* File access property lists */ unsigned new_format; /* Whether to use the new format or not */ const char *envval; @@ -469,40 +469,40 @@ void test_links() MESSAGE(5, ("Testing Various Links\n")); try { - /* Copy the file access property list */ - if((fapl2_id = H5Pcopy(fapl_id)) < 0) - throw Exception("test_links", "H5Pcopy failed"); - - /* Set the "use the latest version of the format" bounds for creating objects in the file */ - if(H5Pset_libver_bounds(fapl2_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - throw Exception("test_links", "H5Pset_libver_bounds failed"); - - /* Loop over using new group format */ - for(new_format = FALSE; new_format <= TRUE; new_format++) - { - hid_t my_fapl_id; - - /* Check for FAPL to use */ - if(new_format) - my_fapl_id = fapl2_id; - else - my_fapl_id = fapl_id; - - /* General tests... (on both old & new format groups */ - // FileAccPropList may be passed in instead of fapl id - test_basic_links(my_fapl_id, new_format); + /* Copy the file access property list */ + if((fapl2_id = H5Pcopy(fapl_id)) < 0) + throw Exception("test_links", "H5Pcopy failed"); + + /* Set the "use the latest version of the format" bounds for creating objects in the file */ + if(H5Pset_libver_bounds(fapl2_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + throw Exception("test_links", "H5Pset_libver_bounds failed"); + + /* Loop over using new group format */ + for(new_format = FALSE; new_format <= TRUE; new_format++) + { + hid_t my_fapl_id; + + /* Check for FAPL to use */ + if(new_format) + my_fapl_id = fapl2_id; + else + my_fapl_id = fapl_id; + + /* General tests... (on both old & new format groups */ + // FileAccPropList may be passed in instead of fapl id + test_basic_links(my_fapl_id, new_format); #if 0 // these tests are from the C test links.c and left here for future // implementation of H5L API - nerrors += test_basic_links(fapl_id, new_format) < 0 ? 1 : 0; - nerrors += cklinks(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += new_links(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += ck_new_links(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += long_links(my_fapl, new_format) < 0 ? 1 : 0; - nerrors += toomany(my_fapl, new_format) < 0 ? 1 : 0; - - /* Test new H5L link creation routine */ - nerrors += test_lcpl(my_fapl, new_format); + nerrors += test_basic_links(fapl_id, new_format) < 0 ? 1 : 0; + nerrors += cklinks(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += new_links(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += ck_new_links(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += long_links(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += toomany(my_fapl, new_format) < 0 ? 1 : 0; + + /* Test new H5L link creation routine */ + nerrors += test_lcpl(my_fapl, new_format); nerrors += test_move(my_fapl, new_format); nerrors += test_copy(my_fapl, new_format); nerrors += test_move_preserves(my_fapl, new_format); @@ -579,7 +579,7 @@ void test_links() /* do not do this for files used by external link tests */ nerrors += check_all_closed(my_fapl, new_format, EXTSTOP) < 0 ? 1 : 0; #endif // 0 - } /* end for */ + } /* end for */ #if 0 /* New group revision feature tests */ @@ -609,33 +609,33 @@ void test_links() nerrors += group_info_old(fapl) < 0 ? 1 : 0; #endif - /* Close 2nd FAPL */ - H5Pclose(fapl2_id); + /* Close 2nd FAPL */ + H5Pclose(fapl2_id); - h5_clean_files(FILENAME, fapl_id); + h5_clean_files(FILENAME, fapl_id); - /* Test that external links can be used after a library reset. MUST be - * called last so the reset doesn't interfere with the property lists. This - * routine will delete its own file. */ - /* nerrors += external_reset_register() < 0 ? 1 : 0; + /* Test that external links can be used after a library reset. MUST be + * called last so the reset doesn't interfere with the property lists. This + * routine will delete its own file. */ + /* nerrors += external_reset_register() < 0 ? 1 : 0; */ } catch (Exception& E) { - issue_fail_msg("test_links()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_links()", __LINE__, __FILE__, E.getCDetailMsg()); } } /*------------------------------------------------------------------------- - * Function: cleanup_links + * Function: cleanup_links * - * Purpose Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return none + * Return: none * - * Programmer Binh-Minh Ribler - * October 16, 2009 + * Programmer: Binh-Minh Ribler + * October 16, 2009 * * Modifications: * diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index 6003dd6..325b2b0 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -31,41 +31,41 @@ using namespace H5; #include "h5test.h" #include "h5cpputil.h" // C++ utilility header file -const H5std_string FILE_OBJECTS("tobjects.h5"); -const H5std_string GROUP1("Top Group"); -const H5std_string GROUP1_PATH("/Top Group"); -const H5std_string GROUP1_1("Sub-Group 1.1"); -const H5std_string GROUP1_1_PATH("/Top Group/Sub-Group 1.1"); -const H5std_string GROUP1_2("Sub-Group 1.2"); -const H5std_string GROUP1_2_PATH("/Top Group/Sub-Group 1.2"); -const H5std_string DSET_DEFAULT_NAME("default"); -const H5std_string DSET_IN_FILE("Dataset in File"); -const H5std_string DSET_IN_FILE_PATH("/Dataset in File"); -const H5std_string DSET_IN_GRP1("Dataset_in_Group_1"); -const H5std_string DSET_IN_GRP1_PATH("/Top Group/Dataset_in_Group_1"); -const H5std_string DSET_IN_GRP1_2("Dataset_in_Group_1.2"); -const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset_in_Group_1.2"); +const H5std_string FILE_OBJECTS("tobjects.h5"); +const H5std_string GROUP1("Top Group"); +const H5std_string GROUP1_PATH("/Top Group"); +const H5std_string GROUP1_1("Sub-Group 1.1"); +const H5std_string GROUP1_1_PATH("/Top Group/Sub-Group 1.1"); +const H5std_string GROUP1_2("Sub-Group 1.2"); +const H5std_string GROUP1_2_PATH("/Top Group/Sub-Group 1.2"); +const H5std_string DSET_DEFAULT_NAME("default"); +const H5std_string DSET_IN_FILE("Dataset in File"); +const H5std_string DSET_IN_FILE_PATH("/Dataset in File"); +const H5std_string DSET_IN_GRP1("Dataset_in_Group_1"); +const H5std_string DSET_IN_GRP1_PATH("/Top Group/Dataset_in_Group_1"); +const H5std_string DSET_IN_GRP1_2("Dataset_in_Group_1.2"); +const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset_in_Group_1.2"); /*------------------------------------------------------------------------- - * Function: test_get_objname + * Function: test_get_objname * - * Purpose Tests getting object name of groups and datasets. + * Purpose: Tests getting object name of groups and datasets. * * Description: - * File structure: - * GROUP1 - * GROUP1_1 - * GROUP1_2 - * DSET_IN_GRP1_2 - * DSET_IN_GRP1 - * DSET_IN_FILE + * File structure: + * GROUP1 + * GROUP1_1 + * GROUP1_2 + * DSET_IN_GRP1_2 + * DSET_IN_GRP1 + * DSET_IN_FILE * * - * Return Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer Binh-Minh Ribler - * Friday, March 4, 2014 + * Programmer: Binh-Minh Ribler + * Friday, March 4, 2014 * * Modifications: * @@ -76,104 +76,104 @@ static void test_get_objname() SUBTEST("H5Object::getObjName on Groups and Datasets"); try { - // Create file - H5File file(FILE_OBJECTS, H5F_ACC_TRUNC); + // Create file + H5File file(FILE_OBJECTS, H5F_ACC_TRUNC); - // Create a top group and 2 subgroups - Group grp1 = file.createGroup(GROUP1, 0); - Group grp1_1 = grp1.createGroup(GROUP1_1, 0); - Group grp1_2 = grp1.createGroup(GROUP1_2, 0); + // Create a top group and 2 subgroups + Group grp1 = file.createGroup(GROUP1, 0); + Group grp1_1 = grp1.createGroup(GROUP1_1, 0); + Group grp1_2 = grp1.createGroup(GROUP1_2, 0); - // Get part of the group's name, random length using - // ssize_t getObjName(char* comment, size_t buf_size) + // Get part of the group's name, random length using + // ssize_t getObjName(char* comment, size_t buf_size) - // Get the length of the group's name first - ssize_t name_len = grp1.getObjName(NULL); + // Get the length of the group's name first + ssize_t name_len = grp1.getObjName(NULL); - // Random length is 4 - if (name_len > 4) - { - char* grp1_name = new char[5]; - name_len = grp1.getObjName(grp1_name, 5); - verify_val((const char*)grp1_name, "/Top", "Group::getObjName", __LINE__, __FILE__); - delete []grp1_name; - } + // Random length is 4 + if (name_len > 4) + { + char* grp1_name = new char[5]; + name_len = grp1.getObjName(grp1_name, 5); + verify_val((const char*)grp1_name, "/Top", "Group::getObjName", __LINE__, __FILE__); + delete []grp1_name; + } - // Create a data space - hsize_t dims[2]; - dims[0] = 2; - dims[1] = 5; - DataSpace space (2, dims, NULL); + // Create a data space + hsize_t dims[2]; + dims[0] = 2; + dims[1] = 5; + DataSpace space (2, dims, NULL); - // Create a dataset in the file - DataSet dsinfile = file.createDataSet(DSET_IN_FILE, - PredType::NATIVE_DOUBLE, space); + // Create a dataset in the file + DataSet dsinfile = file.createDataSet(DSET_IN_FILE, + PredType::NATIVE_DOUBLE, space); - // Create a dataset in the group - DataSet dsingrp = grp1.createDataSet(DSET_IN_GRP1, - PredType::NATIVE_INT, space); + // Create a dataset in the group + DataSet dsingrp = grp1.createDataSet(DSET_IN_GRP1, + PredType::NATIVE_INT, space); - // Get and verify the name of each dataset, using - // H5std_string getObjName() and - // ssize_t getObjName(H5std_string& obj_name, size_t len = 0) - H5std_string ds_name = dsinfile.getObjName(); - verify_val(ds_name, DSET_IN_FILE_PATH, "DataSet::getObjName", __LINE__, __FILE__); + // Get and verify the name of each dataset, using + // H5std_string getObjName() and + // ssize_t getObjName(H5std_string& obj_name, size_t len = 0) + H5std_string ds_name = dsinfile.getObjName(); + verify_val(ds_name, DSET_IN_FILE_PATH, "DataSet::getObjName", __LINE__, __FILE__); - name_len = dsingrp.getObjName(ds_name); // default len - verify_val(ds_name, DSET_IN_GRP1_PATH, "DataSet::getObjName", __LINE__, __FILE__); + name_len = dsingrp.getObjName(ds_name); // default len + verify_val(ds_name, DSET_IN_GRP1_PATH, "DataSet::getObjName", __LINE__, __FILE__); - // Close dataset - dsingrp.close(); + // Close dataset + dsingrp.close(); - // Create a dataset in sub-group 1.2 - dsingrp = grp1_2.createDataSet(DSET_IN_GRP1_2, PredType::NATIVE_INT, space); + // Create a dataset in sub-group 1.2 + dsingrp = grp1_2.createDataSet(DSET_IN_GRP1_2, PredType::NATIVE_INT, space); - // Get and verify the name of the dataset that belongs to subgroup - // 1.2, using H5std_string getObjName() - ds_name = dsingrp.getObjName(); - verify_val(ds_name, DSET_IN_GRP1_2_PATH, "DataSet::getObjName", __LINE__, __FILE__); + // Get and verify the name of the dataset that belongs to subgroup + // 1.2, using H5std_string getObjName() + ds_name = dsingrp.getObjName(); + verify_val(ds_name, DSET_IN_GRP1_2_PATH, "DataSet::getObjName", __LINE__, __FILE__); - // Close dataset - dsingrp.close(); + // Close dataset + dsingrp.close(); - // Reopen that same dataset then check the name again with another - // overload: ssize_t getObjName(H5std_string& obj_name, size_t len = 0) - dsingrp = grp1_2.openDataSet(DSET_IN_GRP1_2); - name_len = dsingrp.getObjName(ds_name); - verify_val(ds_name, DSET_IN_GRP1_2_PATH, "DataSet::getObjName", __LINE__, __FILE__); + // Reopen that same dataset then check the name again with another + // overload: ssize_t getObjName(H5std_string& obj_name, size_t len = 0) + dsingrp = grp1_2.openDataSet(DSET_IN_GRP1_2); + name_len = dsingrp.getObjName(ds_name); + verify_val(ds_name, DSET_IN_GRP1_2_PATH, "DataSet::getObjName", __LINE__, __FILE__); - // Everything will be closed as they go out of scope + // Everything will be closed as they go out of scope - PASSED(); - } // try block + PASSED(); + } // try block // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_get_objname", __LINE__, __FILE__); + issue_fail_msg("test_get_objname", __LINE__, __FILE__); } } // test_get_objname /*------------------------------------------------------------------------- - * Function: test_existance + * Function: test_existance * - * Purpose Tests getting object name of groups and datasets. + * Purpose: Tests getting object name of groups and datasets. * * Description: - * File structure: - * GROUP1 - * GROUP1_1 - * GROUP1_2 - * DSET_IN_GRP1_2 - * DSET_IN_GRP1 - * DSET_IN_FILE + * File structure: + * GROUP1 + * GROUP1_1 + * GROUP1_2 + * DSET_IN_GRP1_2 + * DSET_IN_GRP1 + * DSET_IN_FILE * * - * Return Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer Binh-Minh Ribler - * Friday, March 4, 2014 + * Programmer: Binh-Minh Ribler + * Friday, March 4, 2014 * * Modifications: * @@ -184,62 +184,62 @@ static void test_existance() SUBTEST("H5File::exists and Group::exists"); try { - // Open file - H5File file(FILE_OBJECTS, H5F_ACC_RDONLY); + // Open file + H5File file(FILE_OBJECTS, H5F_ACC_RDONLY); - // Check if GROUP1 exists in the file - bool exists = file.exists(GROUP1); + // Check if GROUP1 exists in the file + bool exists = file.exists(GROUP1); - // Open GROUP1 - Group grp1 = file.openGroup(GROUP1); + // Open GROUP1 + Group grp1 = file.openGroup(GROUP1); - // Check if GROUP1_1 and GROUP1_2 exist in GROUP1 - exists = grp1.exists(GROUP1_1); - verify_val(exists, TRUE, "Group::exists GROUP1_1", __LINE__, __FILE__); - exists = grp1.exists(GROUP1_2); - verify_val(exists, TRUE, "Group::exists GROUP1_2", __LINE__, __FILE__); + // Check if GROUP1_1 and GROUP1_2 exist in GROUP1 + exists = grp1.exists(GROUP1_1); + verify_val(exists, TRUE, "Group::exists GROUP1_1", __LINE__, __FILE__); + exists = grp1.exists(GROUP1_2); + verify_val(exists, TRUE, "Group::exists GROUP1_2", __LINE__, __FILE__); - // Check if DSET_IN_GRP1 exists in GROUP1 - exists = grp1.exists(DSET_IN_GRP1); - verify_val(exists, TRUE, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); + // Check if DSET_IN_GRP1 exists in GROUP1 + exists = grp1.exists(DSET_IN_GRP1); + verify_val(exists, TRUE, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); - // Open GROUP1_2 - Group grp1_2 = grp1.openGroup(GROUP1_2); + // Open GROUP1_2 + Group grp1_2 = grp1.openGroup(GROUP1_2); - // Check if DSET_IN_GRP1_2 exists in GROUP1_2 - exists = grp1_2.exists(DSET_IN_GRP1_2); - verify_val(exists, TRUE, "Group::exists DSET_IN_GRP1_2", __LINE__, __FILE__); + // Check if DSET_IN_GRP1_2 exists in GROUP1_2 + exists = grp1_2.exists(DSET_IN_GRP1_2); + verify_val(exists, TRUE, "Group::exists DSET_IN_GRP1_2", __LINE__, __FILE__); - // Check if a dataset exists given dataset as location with full path name - DataSet dset1 = file.openDataSet(DSET_IN_FILE); - exists = dset1.exists("/Top Group/Dataset_in_Group_1"); - verify_val(exists, TRUE, "Group::exists given dataset with full path name", __LINE__, __FILE__); + // Check if a dataset exists given dataset as location with full path name + DataSet dset1 = file.openDataSet(DSET_IN_FILE); + exists = dset1.exists("/Top Group/Dataset_in_Group_1"); + verify_val(exists, TRUE, "Group::exists given dataset with full path name", __LINE__, __FILE__); - exists = grp1_2.exists(DSET_IN_GRP1); - verify_val(exists, FALSE, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); + exists = grp1_2.exists(DSET_IN_GRP1); + verify_val(exists, FALSE, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); - // Everything will be closed as they go out of scope + // Everything will be closed as they go out of scope - PASSED(); - } // try block + PASSED(); + } // try block // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_existance", __LINE__, __FILE__); + issue_fail_msg("test_existance", __LINE__, __FILE__); } } // test_existance /*------------------------------------------------------------------------- - * Function: test_get_objname_ontypes + * Function: test_get_objname_ontypes * - * Purpose Test getting object name from various committed types. + * Purpose: Test getting object name from various committed types. * - * Return Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer Binh-Minh Ribler - * March 4, 2014 + * Programmer: Binh-Minh Ribler + * March 4, 2014 * * Modifications: * @@ -250,97 +250,97 @@ static void test_get_objname_ontypes() SUBTEST("H5Object::getObjName on Committed Datatypes"); try { - // Create a file with default prop lists - H5File file(FILE_OBJECTS, H5F_ACC_RDWR); - - // Create a group - Group grp = file.createGroup ("typetests"); - - // Create a datatype and save it - IntType inttype(PredType::STD_B8LE); - inttype.commit(file, "INT type of STD_B8LE"); - - // Close the type then open it again to test getting its name - inttype.close(); - inttype = file.openIntType("INT type of STD_B8LE"); // deprecated - - // Get and verify its name - H5std_string inttype_name = inttype.getObjName(); - verify_val(inttype_name, "/INT type of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); - - // Close the type then open it again to test getting its name, but - // with the constructor this time - inttype.close(); - IntType std_b8le(file, "INT type of STD_B8LE"); - - // Get and verify its name - H5std_string std_b8le_name = std_b8le.getObjName(); - verify_val(std_b8le_name, "/INT type of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); - - // Make copy of a predefined type and save it - DataType dtype(PredType::STD_B8LE); - dtype.commit(file, "STD_B8LE"); - - // Close the data type and file - dtype.close(); - file.close(); - - // Re-open the file and the data type to test getting its name - file.openFile(FILE_OBJECTS, H5F_ACC_RDWR); - dtype = file.openDataType("STD_B8LE"); // deprecated - - // Get and verify its name - H5std_string type_name = dtype.getObjName(); - verify_val(type_name, "/STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); - - // Close the type and open it again with the constructor then test - // getting its name - dtype.close(); - DataType dtype2(file, "STD_B8LE"); - type_name = dtype2.getObjName(); - verify_val(type_name, "/STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); - - // Test getting type's name from copied type - DataType copied_type; - copied_type.copy(dtype2); - copied_type.commit(file, "copy of STD_B8LE"); - type_name = copied_type.getObjName(); - verify_val(type_name, "/copy of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); - - // Test copying an integer predefined type - IntType new_int_type(PredType::NATIVE_INT); - - // Name this datatype - new_int_type.commit(grp, "IntType NATIVE_INT"); - ssize_t name_len = new_int_type.getObjName(type_name); // default len - verify_val(name_len, (ssize_t)HDstrlen("/typetests/IntType NATIVE_INT"), "DataType::getObjName", __LINE__, __FILE__); - verify_val(type_name, "/typetests/IntType NATIVE_INT", "DataType::getObjName", __LINE__, __FILE__); - - // Close everything or they can be closed when objects go out of scope - dtype2.close(); - copied_type.close(); - new_int_type.close(); - grp.close(); - - PASSED(); + // Create a file with default prop lists + H5File file(FILE_OBJECTS, H5F_ACC_RDWR); + + // Create a group + Group grp = file.createGroup ("typetests"); + + // Create a datatype and save it + IntType inttype(PredType::STD_B8LE); + inttype.commit(file, "INT type of STD_B8LE"); + + // Close the type then open it again to test getting its name + inttype.close(); + inttype = file.openIntType("INT type of STD_B8LE"); // deprecated + + // Get and verify its name + H5std_string inttype_name = inttype.getObjName(); + verify_val(inttype_name, "/INT type of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Close the type then open it again to test getting its name, but + // with the constructor this time + inttype.close(); + IntType std_b8le(file, "INT type of STD_B8LE"); + + // Get and verify its name + H5std_string std_b8le_name = std_b8le.getObjName(); + verify_val(std_b8le_name, "/INT type of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Make copy of a predefined type and save it + DataType dtype(PredType::STD_B8LE); + dtype.commit(file, "STD_B8LE"); + + // Close the data type and file + dtype.close(); + file.close(); + + // Re-open the file and the data type to test getting its name + file.openFile(FILE_OBJECTS, H5F_ACC_RDWR); + dtype = file.openDataType("STD_B8LE"); // deprecated + + // Get and verify its name + H5std_string type_name = dtype.getObjName(); + verify_val(type_name, "/STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Close the type and open it again with the constructor then test + // getting its name + dtype.close(); + DataType dtype2(file, "STD_B8LE"); + type_name = dtype2.getObjName(); + verify_val(type_name, "/STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Test getting type's name from copied type + DataType copied_type; + copied_type.copy(dtype2); + copied_type.commit(file, "copy of STD_B8LE"); + type_name = copied_type.getObjName(); + verify_val(type_name, "/copy of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__); + + // Test copying an integer predefined type + IntType new_int_type(PredType::NATIVE_INT); + + // Name this datatype + new_int_type.commit(grp, "IntType NATIVE_INT"); + ssize_t name_len = new_int_type.getObjName(type_name); // default len + verify_val(name_len, (ssize_t)HDstrlen("/typetests/IntType NATIVE_INT"), "DataType::getObjName", __LINE__, __FILE__); + verify_val(type_name, "/typetests/IntType NATIVE_INT", "DataType::getObjName", __LINE__, __FILE__); + + // Close everything or they can be closed when objects go out of scope + dtype2.close(); + copied_type.close(); + new_int_type.close(); + grp.close(); + + PASSED(); } // end top try block catch (Exception& E) { - issue_fail_msg("test_get_objname_ontypes", __LINE__, __FILE__); + issue_fail_msg("test_get_objname_ontypes", __LINE__, __FILE__); } } // test_get_objname_ontypes /*------------------------------------------------------------------------- - * Function: test_get_objtype + * Function: test_get_objtype * - * Purpose Tests getting object type + * Purpose: Tests getting object type * - * Return Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer Binh-Minh Ribler - * Friday, March 4, 2014 + * Programmer: Binh-Minh Ribler + * Friday, March 4, 2014 * * Modifications: * @@ -351,61 +351,61 @@ static void test_get_objtype() SUBTEST("H5File::childObjType and H5Group::childObjType"); try { - // Open file - H5File file(FILE_OBJECTS, H5F_ACC_RDWR); + // Open file + H5File file(FILE_OBJECTS, H5F_ACC_RDWR); - // Open the top group - Group grp1 = file.openGroup(GROUP1); + // Open the top group + Group grp1 = file.openGroup(GROUP1); - // Create a datatype and save it - DataType dtype(PredType::STD_I32LE); - dtype.commit(grp1, "STD_I32LE"); + // Create a datatype and save it + DataType dtype(PredType::STD_I32LE); + dtype.commit(grp1, "STD_I32LE"); - // Get and verify object type with - // H5O_type_t childObjType(const H5std_string& objname) - H5O_type_t objtype = file.childObjType(DSET_IN_FILE); - verify_val(objtype, H5O_TYPE_DATASET, "DataSet::childObjType", __LINE__, __FILE__); + // Get and verify object type with + // H5O_type_t childObjType(const H5std_string& objname) + H5O_type_t objtype = file.childObjType(DSET_IN_FILE); + verify_val(objtype, H5O_TYPE_DATASET, "DataSet::childObjType", __LINE__, __FILE__); - // Get and verify object type with - // H5O_type_t childObjType(const char* objname) - objtype = grp1.childObjType(GROUP1_1.c_str()); - verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__); + // Get and verify object type with + // H5O_type_t childObjType(const char* objname) + objtype = grp1.childObjType(GROUP1_1.c_str()); + verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__); - // Get and verify object type with - // H5O_type_t childObjType(hsize_t index, H5_index_t index_type, - // H5_iter_order_t order, const char* objname=".") - objtype = grp1.childObjType((hsize_t)1, H5_INDEX_NAME, H5_ITER_INC); - verify_val(objtype, H5O_TYPE_NAMED_DATATYPE, "DataSet::childObjType", __LINE__, __FILE__); + // Get and verify object type with + // H5O_type_t childObjType(hsize_t index, H5_index_t index_type, + // H5_iter_order_t order, const char* objname=".") + objtype = grp1.childObjType((hsize_t)1, H5_INDEX_NAME, H5_ITER_INC); + verify_val(objtype, H5O_TYPE_NAMED_DATATYPE, "DataSet::childObjType", __LINE__, __FILE__); - // Get and verify object type with - // H5O_type_t childObjType(hsize_t index, - // H5_index_t index_type=H5_INDEX_NAME, - // H5_iter_order_t order=H5_ITER_INC, const char* objname=".") - objtype = grp1.childObjType((hsize_t)2); - verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__); + // Get and verify object type with + // H5O_type_t childObjType(hsize_t index, + // H5_index_t index_type=H5_INDEX_NAME, + // H5_iter_order_t order=H5_ITER_INC, const char* objname=".") + objtype = grp1.childObjType((hsize_t)2); + verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__); - // Everything will be closed as they go out of scope + // Everything will be closed as they go out of scope - PASSED(); - } // try block + PASSED(); + } // try block // catch all other exceptions catch (Exception& E) { - issue_fail_msg("test_get_objtype", __LINE__, __FILE__); + issue_fail_msg("test_get_objtype", __LINE__, __FILE__); } } // test_get_objtype /*------------------------------------------------------------------------- - * Function: test_objects + * Function: test_objects * - * Purpose Tests HDF5 object related functionality + * Purpose: Tests HDF5 object related functionality * - * Return Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer Binh-Minh Ribler - * Friday, Mar 4, 2014 + * Programmer: Binh-Minh Ribler + * Friday, Mar 4, 2014 * * Modifications: * @@ -419,7 +419,7 @@ void test_object() test_get_objname(); // Test get object name from groups/datasets test_existance(); // Test check for object existance - test_get_objname_ontypes(); // Test get object name from types + test_get_objname_ontypes(); // Test get object name from types test_get_objtype(); // Test get object type } // test_objects @@ -427,11 +427,11 @@ void test_object() /*------------------------------------------------------------------------- * Function: cleanup_objects * - * Purpose Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return none + * Return: none * - * Programmer (use C version) + * Programmer: (use C version) * * Modifications: * diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index d8a0d5f..9bc2eb0 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -16,7 +16,7 @@ /***************************************************************************** FILE trefer.cpp - HDF5 C++ testing the functionalities associated with the C - Reference interface (H5R) + Reference interface (H5R) ***************************************************************************/ #ifdef OLD_HEADER_FILENAME @@ -79,100 +79,100 @@ test_reference_params(void) H5File* file1 = NULL; try { - hobj_ref_t *wbuf, // buffer to write to disk - *rbuf, // buffer read from disk - *tbuf; // temp. buffer read from disk + hobj_ref_t *wbuf, // buffer to write to disk + *rbuf, // buffer read from disk + *tbuf; // temp. buffer read from disk - // Allocate write & read buffers - int temp_size = MAX(sizeof(unsigned),sizeof(hobj_ref_t)); - wbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); - rbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); - tbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + // Allocate write & read buffers + int temp_size = MAX(sizeof(unsigned),sizeof(hobj_ref_t)); + wbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + rbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + tbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); // Create file FILE1 file1 = new H5File (FILE1, H5F_ACC_TRUNC); - // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; - DataSpace sid1(SPACE1_RANK, dims1); - - // Create a group - Group group = file1->createGroup("Group1"); - - // Set group's comment - group.setComment(".", write_comment); - - // Create a dataset (inside /Group1) - DataSet dataset = group.createDataSet(DSET1_NAME, PredType::NATIVE_UINT, sid1); - - unsigned *tu32; // Temporary pointer to uint32 data - int i; - for (tu32=(unsigned *)wbuf, i=0; icreateDataSet("Dataset3", PredType::STD_REF_OBJ, sid1); - - /* Test parameters to H5Location::reference */ - try { - file1->reference(NULL, "/Group1/Dataset1"); - } catch (ReferenceException& E) {} // We expect this to fail - try { - file1->reference(&wbuf[0], NULL); - } catch (ReferenceException& E) {} // We expect this to fail - try { - file1->reference(&wbuf[0], ""); - } catch (ReferenceException& E) {} // We expect this to fail - try { - file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_MAXTYPE); - } catch (ReferenceException& E) {} // We expect this to fail - try { - file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_DATASET_REGION); - } catch (ReferenceException& E) {} // We expect this to fail - - // Close resources - dataset.close(); - file1->close(); - // Let sid1 go out of scope - - // Free memory buffers - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); - - PASSED(); + // Create dataspace for datasets + hsize_t dims1[] = {SPACE1_DIM1}; + DataSpace sid1(SPACE1_RANK, dims1); + + // Create a group + Group group = file1->createGroup("Group1"); + + // Set group's comment + group.setComment(".", write_comment); + + // Create a dataset (inside /Group1) + DataSet dataset = group.createDataSet(DSET1_NAME, PredType::NATIVE_UINT, sid1); + + unsigned *tu32; // Temporary pointer to uint32 data + int i; + for (tu32=(unsigned *)wbuf, i=0; icreateDataSet("Dataset3", PredType::STD_REF_OBJ, sid1); + + /* Test parameters to H5Location::reference */ + try { + file1->reference(NULL, "/Group1/Dataset1"); + } catch (ReferenceException& E) {} // We expect this to fail + try { + file1->reference(&wbuf[0], NULL); + } catch (ReferenceException& E) {} // We expect this to fail + try { + file1->reference(&wbuf[0], ""); + } catch (ReferenceException& E) {} // We expect this to fail + try { + file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_MAXTYPE); + } catch (ReferenceException& E) {} // We expect this to fail + try { + file1->reference(&wbuf[0], "/Group1/Dataset1", H5R_DATASET_REGION); + } catch (ReferenceException& E) {} // We expect this to fail + + // Close resources + dataset.close(); + file1->close(); + // Let sid1 go out of scope + + // Free memory buffers + HDfree(wbuf); + HDfree(rbuf); + HDfree(tbuf); + + PASSED(); } // end try catch (Exception& E) { - issue_fail_msg("test_reference_param()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + issue_fail_msg("test_reference_param()",__LINE__,__FILE__, + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -182,7 +182,7 @@ test_reference_params(void) /**************************************************************** ** ** test_reference_obj(): Test basic object reference functions -** to various kinds of objects +** to various kinds of objects ** ****************************************************************/ static void test_reference_obj(void) @@ -195,176 +195,176 @@ static void test_reference_obj(void) H5File* file1 = NULL; try { - hobj_ref_t *wbuf, // buffer to write to disk - *rbuf, // buffer read from disk - *tbuf; // temp. buffer read from disk + hobj_ref_t *wbuf, // buffer to write to disk + *rbuf, // buffer read from disk + *tbuf; // temp. buffer read from disk - // Allocate write & read buffers - int temp_size = MAX(sizeof(unsigned),sizeof(hobj_ref_t)); - wbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); - rbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); - tbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + // Allocate write & read buffers + int temp_size = MAX(sizeof(unsigned),sizeof(hobj_ref_t)); + wbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + rbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); + tbuf=(hobj_ref_t*)HDmalloc(temp_size*SPACE1_DIM1); // Create file FILE1 file1 = new H5File (FILE1, H5F_ACC_TRUNC); - // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; - DataSpace sid1(SPACE1_RANK, dims1); + // Create dataspace for datasets + hsize_t dims1[] = {SPACE1_DIM1}; + DataSpace sid1(SPACE1_RANK, dims1); - // Create dataset access property list - PropList dapl(H5P_DATASET_ACCESS); + // Create dataset access property list + PropList dapl(H5P_DATASET_ACCESS); - // Create a group - Group group = file1->createGroup("Group1"); + // Create a group + Group group = file1->createGroup("Group1"); - // Set group's comment - group.setComment(".", write_comment); + // Set group's comment + group.setComment(".", write_comment); - // Create a dataset (inside /Group1) - DataSet dataset = group.createDataSet(DSET1_NAME, PredType::NATIVE_UINT, sid1); + // Create a dataset (inside /Group1) + DataSet dataset = group.createDataSet(DSET1_NAME, PredType::NATIVE_UINT, sid1); - unsigned *tu32; // Temporary pointer to uint32 data - for (tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++) - *tu32++=i*3; // from C test + unsigned *tu32; // Temporary pointer to uint32 data + for (tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++) + *tu32++=i*3; // from C test - // Write selection to disk - dataset.write(wbuf, PredType::NATIVE_UINT); + // Write selection to disk + dataset.write(wbuf, PredType::NATIVE_UINT); - // Close Dataset - dataset.close(); + // Close Dataset + dataset.close(); - // Create another dataset (inside /Group1) - dataset = group.createDataSet("Dataset2", PredType::NATIVE_UCHAR, sid1); + // Create another dataset (inside /Group1) + dataset = group.createDataSet("Dataset2", PredType::NATIVE_UCHAR, sid1); - // Close Dataset - dataset.close(); + // Close Dataset + dataset.close(); - // Create a datatype to refer to - CompType dtype1(sizeof(s1_t)); + // Create a datatype to refer to + CompType dtype1(sizeof(s1_t)); - // Insert fields - dtype1.insertMember(MEMBER1, HOFFSET(s1_t, a), PredType::NATIVE_INT); - dtype1.insertMember(MEMBER2, HOFFSET(s1_t, b), PredType::NATIVE_INT); - dtype1.insertMember(MEMBER3, HOFFSET(s1_t, c), PredType::NATIVE_FLOAT); + // Insert fields + dtype1.insertMember(MEMBER1, HOFFSET(s1_t, a), PredType::NATIVE_INT); + dtype1.insertMember(MEMBER2, HOFFSET(s1_t, b), PredType::NATIVE_INT); + dtype1.insertMember(MEMBER3, HOFFSET(s1_t, c), PredType::NATIVE_FLOAT); - // Save datatype for later - dtype1.commit(group, "Datatype1"); + // Save datatype for later + dtype1.commit(group, "Datatype1"); - // Close datatype and group - dtype1.close(); - group.close(); + // Close datatype and group + dtype1.close(); + group.close(); - // Create a dataset - dataset = file1->createDataSet("Dataset3", PredType::STD_REF_OBJ, sid1); + // Create a dataset + dataset = file1->createDataSet("Dataset3", PredType::STD_REF_OBJ, sid1); - // Create reference to dataset and test getRefObjType - file1->reference(&wbuf[0], "/Group1/Dataset1"); - H5O_type_t refobj_type = dataset.getRefObjType(&wbuf[0], H5R_OBJECT); - verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); + // Create reference to dataset and test getRefObjType + file1->reference(&wbuf[0], "/Group1/Dataset1"); + H5O_type_t refobj_type = dataset.getRefObjType(&wbuf[0], H5R_OBJECT); + verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); - // Create reference to dataset and test getRefObjType - file1->reference(&wbuf[1], "/Group1/Dataset2"); - refobj_type = dataset.getRefObjType(&wbuf[1], H5R_OBJECT); - verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); + // Create reference to dataset and test getRefObjType + file1->reference(&wbuf[1], "/Group1/Dataset2"); + refobj_type = dataset.getRefObjType(&wbuf[1], H5R_OBJECT); + verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); - // Create reference to group - file1->reference(&wbuf[2], "/Group1"); - refobj_type = dataset.getRefObjType(&wbuf[2], H5R_OBJECT); - verify_val(refobj_type, H5O_TYPE_GROUP, "DataSet::getRefObjType",__LINE__,__FILE__); + // Create reference to group + file1->reference(&wbuf[2], "/Group1"); + refobj_type = dataset.getRefObjType(&wbuf[2], H5R_OBJECT); + verify_val(refobj_type, H5O_TYPE_GROUP, "DataSet::getRefObjType",__LINE__,__FILE__); - // Create reference to named datatype - file1->reference(&wbuf[3], "/Group1/Datatype1"); - refobj_type = dataset.getRefObjType(&wbuf[3], H5R_OBJECT); - verify_val(refobj_type, H5O_TYPE_NAMED_DATATYPE, "DataSet::getRefObjType",__LINE__,__FILE__); + // Create reference to named datatype + file1->reference(&wbuf[3], "/Group1/Datatype1"); + refobj_type = dataset.getRefObjType(&wbuf[3], H5R_OBJECT); + verify_val(refobj_type, H5O_TYPE_NAMED_DATATYPE, "DataSet::getRefObjType",__LINE__,__FILE__); - // Write selection to disk - dataset.write(wbuf, PredType::STD_REF_OBJ); + // Write selection to disk + dataset.write(wbuf, PredType::STD_REF_OBJ); - // Close disk dataspace, dataset, and file - sid1.close(); - dataset.close(); - delete file1; + // Close disk dataspace, dataset, and file + sid1.close(); + dataset.close(); + delete file1; - // Re-open the file - file1 = new H5File(FILE1, H5F_ACC_RDWR); + // Re-open the file + file1 = new H5File(FILE1, H5F_ACC_RDWR); - // Open the dataset - dataset = file1->openDataSet("/Dataset3"); + // Open the dataset + dataset = file1->openDataSet("/Dataset3"); - // Read selection from disk - dataset.read(rbuf, PredType::STD_REF_OBJ); + // Read selection from disk + dataset.read(rbuf, PredType::STD_REF_OBJ); - // Dereference dataset object by ctor, from the location where - // 'dataset' is located - DataSet dset2(dataset, &rbuf[0], H5R_OBJECT, dapl); + // Dereference dataset object by ctor, from the location where + // 'dataset' is located + DataSet dset2(dataset, &rbuf[0], H5R_OBJECT, dapl); - // Check information in the referenced dataset - sid1 = dset2.getSpace(); - hssize_t n_elements = sid1.getSimpleExtentNpoints(); - verify_val((long)n_elements, 4, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + // Check information in the referenced dataset + sid1 = dset2.getSpace(); + hssize_t n_elements = sid1.getSimpleExtentNpoints(); + verify_val((long)n_elements, 4, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - // Read from disk - dset2.read(tbuf, PredType::NATIVE_UINT); + // Read from disk + dset2.read(tbuf, PredType::NATIVE_UINT); - for(tu32 = (unsigned *)tbuf, i = 0; i < SPACE1_DIM1; i++, tu32++) - verify_val(*tu32, (uint32_t)(i*3), "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + for(tu32 = (unsigned *)tbuf, i = 0; i < SPACE1_DIM1; i++, tu32++) + verify_val(*tu32, (uint32_t)(i*3), "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - // Close dereferenced dataset - dset2.close(); + // Close dereferenced dataset + dset2.close(); - // Dereference group object from the location where 'dataset' is located - group.dereference(dataset, &rbuf[2]); + // Dereference group object from the location where 'dataset' is located + group.dereference(dataset, &rbuf[2]); - // Get group's comment using - // H5std_string getComment(const char* name, ) - H5std_string read_comment1 = group.getComment(".", 10); - verify_val(read_comment1.c_str(), write_comment, "Group::getComment",__LINE__,__FILE__); + // Get group's comment using + // H5std_string getComment(const char* name, ) + H5std_string read_comment1 = group.getComment(".", 10); + verify_val(read_comment1.c_str(), write_comment, "Group::getComment",__LINE__,__FILE__); - // Test with the old default value - read_comment1 = group.getComment(".", 256); - verify_val(read_comment1.c_str(), write_comment, "Group::getComment",__LINE__,__FILE__); + // Test with the old default value + read_comment1 = group.getComment(".", 256); + verify_val(read_comment1.c_str(), write_comment, "Group::getComment",__LINE__,__FILE__); - // Test that getComment handles failures gracefully, using - // H5std_string getComment(const char* name, ) - try { - H5std_string read_comment_tmp = group.getComment(NULL); - } - catch (Exception& E) {} // We expect this to fail + // Test that getComment handles failures gracefully, using + // H5std_string getComment(const char* name, ) + try { + H5std_string read_comment_tmp = group.getComment(NULL); + } + catch (Exception& E) {} // We expect this to fail - // Close group - group.close(); + // Close group + group.close(); - /* - * Verify correct referenced datatype - */ - // Open datatype object - dtype1.dereference(dataset, &rbuf[3]); + /* + * Verify correct referenced datatype + */ + // Open datatype object + dtype1.dereference(dataset, &rbuf[3]); - // Verify correct datatype + // Verify correct datatype H5T_class_t tclass; tclass = dtype1.getClass(); - verify_val(tclass, H5T_COMPOUND, "DataType::getClass",__LINE__,__FILE__); - int n_members = dtype1.getNmembers(); + verify_val(tclass, H5T_COMPOUND, "DataType::getClass",__LINE__,__FILE__); + int n_members = dtype1.getNmembers(); verify_val(n_members, 3, "CompType::getNmembers",__LINE__,__FILE__); - // Close all objects and file - dtype1.close(); - dataset.close(); - file1->close(); + // Close all objects and file + dtype1.close(); + dataset.close(); + file1->close(); - // Free allocated buffers - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); + // Free allocated buffers + HDfree(wbuf); + HDfree(rbuf); + HDfree(tbuf); - PASSED(); + PASSED(); } // end try catch (Exception& E) { - issue_fail_msg("test_reference_obj()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + issue_fail_msg("test_reference_obj()",__LINE__,__FILE__, + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -376,7 +376,7 @@ static void test_reference_obj(void) ** ** test_reference_group(): Test object reference functionality ** Tests for correct behavior of various routines on -** dereferenced group +** dereferenced group ** ****************************************************************/ #define GROUPNAME "/group" @@ -389,8 +389,8 @@ static void test_reference_obj(void) static void test_reference_group(void) { - hobj_ref_t wref; /* Reference to write */ - hobj_ref_t rref; /* Reference to read */ + hobj_ref_t wref; /* Reference to write */ + hobj_ref_t rref; /* Reference to read */ const H5std_string write_comment="Foo!"; // Comments for group // Output message about test being performed @@ -398,102 +398,102 @@ test_reference_group(void) H5File* file1 = NULL; try { - /* - * Create file with a group and a dataset containing an object - * reference to the group - */ + /* + * Create file with a group and a dataset containing an object + * reference to the group + */ // Create file FILE1 file1 = new H5File (FILE1, H5F_ACC_TRUNC); - // Create scalar dataspace - DataSpace sid1; + // Create scalar dataspace + DataSpace sid1; - // Create a group - Group group = file1->createGroup(GROUPNAME); + // Create a group + Group group = file1->createGroup(GROUPNAME); - /* Create nested groups */ - Group group2 = group.createGroup(GROUPNAME2); - group2.close(); - group2 = group.createGroup(GROUPNAME3); - group2.close(); + /* Create nested groups */ + Group group2 = group.createGroup(GROUPNAME2); + group2.close(); + group2 = group.createGroup(GROUPNAME3); + group2.close(); - // Create bottom dataset - DataSet dset1 = group.createDataSet(DSETNAME2, PredType::NATIVE_INT, sid1); - dset1.close(); + // Create bottom dataset + DataSet dset1 = group.createDataSet(DSETNAME2, PredType::NATIVE_INT, sid1); + dset1.close(); - // Close group 1 - group.close(); + // Close group 1 + group.close(); - // Create dataset - DataSet dset2 = file1->createDataSet(DSETNAME, PredType::STD_REF_OBJ, sid1); + // Create dataset + DataSet dset2 = file1->createDataSet(DSETNAME, PredType::STD_REF_OBJ, sid1); - file1->reference(&wref, GROUPNAME); + file1->reference(&wref, GROUPNAME); - // Write selection to disk - dset2.write(&wref, PredType::STD_REF_OBJ); + // Write selection to disk + dset2.write(&wref, PredType::STD_REF_OBJ); - // Close resources - dset2.close(); - sid1.close(); - file1->close(); + // Close resources + dset2.close(); + sid1.close(); + file1->close(); - /* - * Re-open the file and test deferencing group - */ + /* + * Re-open the file and test deferencing group + */ - // Re-open file + // Re-open file file1->openFile(FILE1, H5F_ACC_RDWR); - // Re-open dataset - dset1 = file1->openDataSet(DSETNAME); + // Re-open dataset + dset1 = file1->openDataSet(DSETNAME); - // Read in the reference - dset1.read(&rref, PredType::STD_REF_OBJ); + // Read in the reference + dset1.read(&rref, PredType::STD_REF_OBJ); - // Dereference to get the group - Group refgroup(dset1, &rref); + // Dereference to get the group + Group refgroup(dset1, &rref); - // Dereference group object the other way - group.dereference(dset1, &rref); + // Dereference group object the other way + group.dereference(dset1, &rref); - /* - * Various queries on the group opened - */ + /* + * Various queries on the group opened + */ - // Check number of objects in the group dereferenced by constructor - hsize_t nobjs = refgroup.getNumObjs(); - verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__); + // Check number of objects in the group dereferenced by constructor + hsize_t nobjs = refgroup.getNumObjs(); + verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__); - // Check number of objects in the group dereferenced by ::reference - nobjs = group.getNumObjs(); - verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__); + // Check number of objects in the group dereferenced by ::reference + nobjs = group.getNumObjs(); + verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__); - // Check getting file name given the group dereferenced via constructor - H5std_string fname = refgroup.getFileName(); - verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); + // Check getting file name given the group dereferenced via constructor + H5std_string fname = refgroup.getFileName(); + verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); - // Check getting file name given the group dereferenced by ::reference - fname = group.getFileName(); - verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); - - // Unlink one of the objects in the dereferenced group, and re-check - refgroup.unlink(GROUPNAME2); - nobjs = refgroup.getNumObjs(); - verify_val(nobjs, (hsize_t)2, "H5Group::getNumObjs",__LINE__,__FILE__); - - // Close resources - group.close(); - refgroup.close(); - dset1.close(); - file1->close(); - - PASSED(); + // Check getting file name given the group dereferenced by ::reference + fname = group.getFileName(); + verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); + + // Unlink one of the objects in the dereferenced group, and re-check + refgroup.unlink(GROUPNAME2); + nobjs = refgroup.getNumObjs(); + verify_val(nobjs, (hsize_t)2, "H5Group::getNumObjs",__LINE__,__FILE__); + + // Close resources + group.close(); + refgroup.close(); + dset1.close(); + file1->close(); + + PASSED(); } // end try catch (Exception& E) { - issue_fail_msg("test_reference_group()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + issue_fail_msg("test_reference_group()",__LINE__,__FILE__, + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -509,283 +509,283 @@ test_reference_group(void) static void test_reference_region_1D(void) { - hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ hsize_t * coords; /* Coordinate buffer */ - hsize_t low[SPACE3_RANK]; /* Selection bounds */ - hsize_t high[SPACE3_RANK]; /* Selection bounds */ + hsize_t low[SPACE3_RANK]; /* Selection bounds */ + hsize_t high[SPACE3_RANK]; /* Selection bounds */ int i; /* counting variables */ // Output message about test being performed SUBTEST("1-D Dataset Region Reference Functions"); try { - hdset_reg_ref_t *wbuf, // buffer to write to disk - *rbuf; // buffer read from disk - uint8_t *dwbuf, // Buffer for writing numeric data to disk - *drbuf; // Buffer for reading numeric data from disk + hdset_reg_ref_t *wbuf, // buffer to write to disk + *rbuf; // buffer read from disk + uint8_t *dwbuf, // Buffer for writing numeric data to disk + *drbuf; // Buffer for reading numeric data from disk - // Allocate write & read buffers - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); - rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); - dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); + // Allocate write & read buffers + wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1); + drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); // Create file FILE1 H5File file1(FILE2, H5F_ACC_TRUNC); - // Create dataspace for datasets - hsize_t dims3[] = {SPACE3_DIM1}; - DataSpace sid3(SPACE3_RANK, dims3); + // Create dataspace for datasets + hsize_t dims3[] = {SPACE3_DIM1}; + DataSpace sid3(SPACE3_RANK, dims3); - // Create dataset access property list - PropList dapl(H5P_DATASET_ACCESS); + // Create dataset access property list + PropList dapl(H5P_DATASET_ACCESS); - // Create a dataset - DataSet dset3 = file1.createDataSet(DSET2_NAME, PredType::STD_U8LE, sid3); + // Create a dataset + DataSet dset3 = file1.createDataSet(DSET2_NAME, PredType::STD_U8LE, sid3); - uint8_t *tu8; // Temporary pointer to uint8 data - for (tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++) - *tu8++ = i * 3; // from C test + uint8_t *tu8; // Temporary pointer to uint8 data + for (tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++) + *tu8++ = i * 3; // from C test - // Write selection to disk - dset3.write(dwbuf, PredType::STD_U8LE); + // Write selection to disk + dset3.write(dwbuf, PredType::STD_U8LE); - // Close Dataset - dset3.close(); + // Close Dataset + dset3.close(); - // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; - DataSpace sid1(SPACE1_RANK, dims1); + // Create dataspace for datasets + hsize_t dims1[] = {SPACE1_DIM1}; + DataSpace sid1(SPACE1_RANK, dims1); - // Create a dataset - DataSet dset1 = file1.createDataSet(DSET1_NAME, PredType::STD_REF_DSETREG, sid1); + // Create a dataset + DataSet dset1 = file1.createDataSet(DSET1_NAME, PredType::STD_REF_DSETREG, sid1); - /* - * Create references and prepare for testing - */ + /* + * Create references and prepare for testing + */ - /* Select 15 2x1 hyperslabs for first reference */ - start[0] = 2; - stride[0] = 5; - count[0] = 15; - block[0] = 2; + /* Select 15 2x1 hyperslabs for first reference */ + start[0] = 2; + stride[0] = 5; + count[0] = 15; + block[0] = 2; - // Select a hyperslab region to add to the current selected region - sid3.selectHyperslab(H5S_SELECT_SET, count, start, stride, block); + // Select a hyperslab region to add to the current selected region + sid3.selectHyperslab(H5S_SELECT_SET, count, start, stride, block); - // Get and verify the number of elements in a dataspace selection - hssize_t nelms = sid3.getSelectNpoints(); - verify_val(nelms, 30, "DataSet::getRefObjType",__LINE__,__FILE__); + // Get and verify the number of elements in a dataspace selection + hssize_t nelms = sid3.getSelectNpoints(); + verify_val(nelms, 30, "DataSet::getRefObjType",__LINE__,__FILE__); - // Store first dataset region - file1.reference(&wbuf[0], "/Dataset2", sid3); + // Store first dataset region + file1.reference(&wbuf[0], "/Dataset2", sid3); - // Get and verify object type - H5O_type_t obj_type = dset1.getRefObjType(&wbuf[0], H5R_DATASET_REGION); - verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); + // Get and verify object type + H5O_type_t obj_type = dset1.getRefObjType(&wbuf[0], H5R_DATASET_REGION); + verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); - /* Select sequence of ten points for second reference */ - coord1[0][0] = 16; - coord1[1][0] = 22; - coord1[2][0] = 38; - coord1[3][0] = 41; - coord1[4][0] = 52; - coord1[5][0] = 63; - coord1[6][0] = 70; - coord1[7][0] = 89; - coord1[8][0] = 97; - coord1[9][0] = 3; - - // Selects array elements to be included in the selection for sid3 - sid3.selectElements(H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1); - - // Get and verify the number of elements in a dataspace selection - nelms = sid3.getSelectNpoints(); - verify_val(nelms, 10, "DataSet::getRefObjType",__LINE__,__FILE__); - - // Store first dataset region - file1.reference(&wbuf[1], "/Dataset2", sid3); - - // Write selection to disk - dset1.write(wbuf, PredType::STD_REF_DSETREG); - - // Close disk dataspace, dataset, and file - sid1.close(); - dset1.close(); - sid3.close(); - file1.close(); - - /* - * Testing various dereference functions - */ - - // Re-open the file - file1.openFile(FILE2, H5F_ACC_RDWR); - - // Open the dataset - dset1 = file1.openDataSet("/Dataset1"); - - // Read selection from disk - dset1.read(rbuf, PredType::STD_REF_DSETREG); - - { // Test DataSet::dereference - dset3.dereference(dset1, &rbuf[0], H5R_DATASET_REGION, dapl); - - // Get and verify object type - obj_type = dset1.getRefObjType(&rbuf[0], H5R_DATASET_REGION); - verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); - - // Get dataspace of dset3 the verify number of elements - sid1 = dset3.getSpace(); - nelms = sid1.getSimpleExtentNpoints(); - verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - } // End of test DataSet::dereference - - { // Test DataSet constructor -by dereference - // Dereference dataset object by ctor, from the location where - // 'dset1' is located - DataSet newds(dset1, &rbuf[0], H5R_DATASET_REGION, dapl); - - // Get dataspace of newds then verify number of elements - sid1 = newds.getSpace(); - nelms = sid1.getSimpleExtentNpoints(); - verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - - // Close objects for this mini test - newds.close(); - sid1.close(); - } // End of test DataSet constructor -by dereference - - // Read from disk - dset3.read(drbuf, PredType::STD_U8LE); - - for(tu8 = (uint8_t *)drbuf, i = 0; i < SPACE3_DIM1; i++, tu8++) - verify_val(*tu8, (uint8_t)(i * 3), "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); - - /* - * Test getting the referenced region - */ - - // Get region - DataSpace reg_sp = dset1.getRegion(&rbuf[0]); - - // Get and verify number of elements in a dataspace selection - nelms = reg_sp.getSelectNpoints(); - verify_val((long)nelms, 30, "DataSpace::getSelectNpoints",__LINE__,__FILE__); - - // Get and verify number of hyperslab blocks - nelms = reg_sp.getSelectHyperNblocks(); - verify_val((long)nelms, 15, "DataSpace::getSelectNpoints",__LINE__,__FILE__); - - /* Allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc(nelms * SPACE3_RANK * sizeof(hsize_t) * 2); - - // Get the list of hyperslab blocks currently selected - reg_sp.getSelectHyperBlocklist((hsize_t)0, (hsize_t)nelms, coords); - - // Verify values in the list - verify_val(coords[0], (hsize_t)2, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[1], (hsize_t)3, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[2], (hsize_t)7, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[3], (hsize_t)8, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[4],(hsize_t)12, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[5],(hsize_t)13, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[6],(hsize_t)17, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[7],(hsize_t)18, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[8],(hsize_t)22, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[9],(hsize_t)23, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[10],(hsize_t)27, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[11],(hsize_t)28, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[12],(hsize_t)32, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[13],(hsize_t)33, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[14],(hsize_t)37, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[15],(hsize_t)38, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[16],(hsize_t)42, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[17],(hsize_t)43, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[18],(hsize_t)47, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[19],(hsize_t)48, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[20],(hsize_t)52, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[21],(hsize_t)53, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[22],(hsize_t)57, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[23],(hsize_t)58, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[24],(hsize_t)62, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[25],(hsize_t)63, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[26],(hsize_t)67, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[27],(hsize_t)68, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[28],(hsize_t)72, "Hyperslab Coordinates",__LINE__,__FILE__); - verify_val(coords[29],(hsize_t)73, "Hyperslab Coordinates",__LINE__,__FILE__); - - HDfree(coords); - - // Check boundaries - reg_sp.getSelectBounds(low, high); - verify_val(low[0],(hsize_t)2, "DataSpace::getSelectBounds",__LINE__,__FILE__); - verify_val(high[0],(hsize_t)73, "DataSpace::getSelectBounds",__LINE__,__FILE__); - - /* Close region space */ - reg_sp.close(); - - /* - * Another test on getting the referenced region - */ - - // Get region - DataSpace elm_sp = dset1.getRegion(&rbuf[1]); - - // Get and verify number of element points in the current selection - hssize_t nelmspts = elm_sp.getSelectElemNpoints(); - verify_val((long)nelmspts, 10, "DataSpace::getSelectNpoints",__LINE__,__FILE__); - - /* Allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc(nelmspts * SPACE3_RANK * sizeof(hsize_t)); - - // Get the list of element points currently selected - elm_sp.getSelectElemPointlist((hsize_t)0, (hsize_t)nelmspts, coords); - - // Verify points - verify_val(coords[0], coord1[0][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[1], coord1[1][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[2], coord1[2][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[3], coord1[3][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[4], coord1[4][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[5], coord1[5][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[6], coord1[6][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[7], coord1[7][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[8], coord1[8][0], "Element Coordinates",__LINE__,__FILE__); - verify_val(coords[9], coord1[9][0], "Element Coordinates",__LINE__,__FILE__); - - HDfree(coords); - - // Check boundaries - elm_sp.getSelectBounds(low, high); - verify_val(low[0],(hsize_t)3, "DataSpace::getSelectBounds",__LINE__,__FILE__); - verify_val(high[0],(hsize_t)97, "DataSpace::getSelectBounds",__LINE__,__FILE__); - - // Close element space - elm_sp.close(); - - // Close resources - sid1.close(); - dset3.close(); - dset1.close(); - file1.close(); - - // Free memory buffers - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); - - PASSED(); + /* Select sequence of ten points for second reference */ + coord1[0][0] = 16; + coord1[1][0] = 22; + coord1[2][0] = 38; + coord1[3][0] = 41; + coord1[4][0] = 52; + coord1[5][0] = 63; + coord1[6][0] = 70; + coord1[7][0] = 89; + coord1[8][0] = 97; + coord1[9][0] = 3; + + // Selects array elements to be included in the selection for sid3 + sid3.selectElements(H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1); + + // Get and verify the number of elements in a dataspace selection + nelms = sid3.getSelectNpoints(); + verify_val(nelms, 10, "DataSet::getRefObjType",__LINE__,__FILE__); + + // Store first dataset region + file1.reference(&wbuf[1], "/Dataset2", sid3); + + // Write selection to disk + dset1.write(wbuf, PredType::STD_REF_DSETREG); + + // Close disk dataspace, dataset, and file + sid1.close(); + dset1.close(); + sid3.close(); + file1.close(); + + /* + * Testing various dereference functions + */ + + // Re-open the file + file1.openFile(FILE2, H5F_ACC_RDWR); + + // Open the dataset + dset1 = file1.openDataSet("/Dataset1"); + + // Read selection from disk + dset1.read(rbuf, PredType::STD_REF_DSETREG); + + { // Test DataSet::dereference + dset3.dereference(dset1, &rbuf[0], H5R_DATASET_REGION, dapl); + + // Get and verify object type + obj_type = dset1.getRefObjType(&rbuf[0], H5R_DATASET_REGION); + verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType",__LINE__,__FILE__); + + // Get dataspace of dset3 the verify number of elements + sid1 = dset3.getSpace(); + nelms = sid1.getSimpleExtentNpoints(); + verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + } // End of test DataSet::dereference + + { // Test DataSet constructor -by dereference + // Dereference dataset object by ctor, from the location where + // 'dset1' is located + DataSet newds(dset1, &rbuf[0], H5R_DATASET_REGION, dapl); + + // Get dataspace of newds then verify number of elements + sid1 = newds.getSpace(); + nelms = sid1.getSimpleExtentNpoints(); + verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + + // Close objects for this mini test + newds.close(); + sid1.close(); + } // End of test DataSet constructor -by dereference + + // Read from disk + dset3.read(drbuf, PredType::STD_U8LE); + + for(tu8 = (uint8_t *)drbuf, i = 0; i < SPACE3_DIM1; i++, tu8++) + verify_val(*tu8, (uint8_t)(i * 3), "DataSpace::getSimpleExtentNpoints",__LINE__,__FILE__); + + /* + * Test getting the referenced region + */ + + // Get region + DataSpace reg_sp = dset1.getRegion(&rbuf[0]); + + // Get and verify number of elements in a dataspace selection + nelms = reg_sp.getSelectNpoints(); + verify_val((long)nelms, 30, "DataSpace::getSelectNpoints",__LINE__,__FILE__); + + // Get and verify number of hyperslab blocks + nelms = reg_sp.getSelectHyperNblocks(); + verify_val((long)nelms, 15, "DataSpace::getSelectNpoints",__LINE__,__FILE__); + + /* Allocate space for the hyperslab blocks */ + coords = (hsize_t *)HDmalloc(nelms * SPACE3_RANK * sizeof(hsize_t) * 2); + + // Get the list of hyperslab blocks currently selected + reg_sp.getSelectHyperBlocklist((hsize_t)0, (hsize_t)nelms, coords); + + // Verify values in the list + verify_val(coords[0], (hsize_t)2, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[1], (hsize_t)3, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[2], (hsize_t)7, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[3], (hsize_t)8, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[4],(hsize_t)12, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[5],(hsize_t)13, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[6],(hsize_t)17, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[7],(hsize_t)18, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[8],(hsize_t)22, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[9],(hsize_t)23, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[10],(hsize_t)27, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[11],(hsize_t)28, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[12],(hsize_t)32, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[13],(hsize_t)33, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[14],(hsize_t)37, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[15],(hsize_t)38, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[16],(hsize_t)42, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[17],(hsize_t)43, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[18],(hsize_t)47, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[19],(hsize_t)48, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[20],(hsize_t)52, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[21],(hsize_t)53, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[22],(hsize_t)57, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[23],(hsize_t)58, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[24],(hsize_t)62, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[25],(hsize_t)63, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[26],(hsize_t)67, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[27],(hsize_t)68, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[28],(hsize_t)72, "Hyperslab Coordinates",__LINE__,__FILE__); + verify_val(coords[29],(hsize_t)73, "Hyperslab Coordinates",__LINE__,__FILE__); + + HDfree(coords); + + // Check boundaries + reg_sp.getSelectBounds(low, high); + verify_val(low[0],(hsize_t)2, "DataSpace::getSelectBounds",__LINE__,__FILE__); + verify_val(high[0],(hsize_t)73, "DataSpace::getSelectBounds",__LINE__,__FILE__); + + /* Close region space */ + reg_sp.close(); + + /* + * Another test on getting the referenced region + */ + + // Get region + DataSpace elm_sp = dset1.getRegion(&rbuf[1]); + + // Get and verify number of element points in the current selection + hssize_t nelmspts = elm_sp.getSelectElemNpoints(); + verify_val((long)nelmspts, 10, "DataSpace::getSelectNpoints",__LINE__,__FILE__); + + /* Allocate space for the hyperslab blocks */ + coords = (hsize_t *)HDmalloc(nelmspts * SPACE3_RANK * sizeof(hsize_t)); + + // Get the list of element points currently selected + elm_sp.getSelectElemPointlist((hsize_t)0, (hsize_t)nelmspts, coords); + + // Verify points + verify_val(coords[0], coord1[0][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[1], coord1[1][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[2], coord1[2][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[3], coord1[3][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[4], coord1[4][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[5], coord1[5][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[6], coord1[6][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[7], coord1[7][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[8], coord1[8][0], "Element Coordinates",__LINE__,__FILE__); + verify_val(coords[9], coord1[9][0], "Element Coordinates",__LINE__,__FILE__); + + HDfree(coords); + + // Check boundaries + elm_sp.getSelectBounds(low, high); + verify_val(low[0],(hsize_t)3, "DataSpace::getSelectBounds",__LINE__,__FILE__); + verify_val(high[0],(hsize_t)97, "DataSpace::getSelectBounds",__LINE__,__FILE__); + + // Close element space + elm_sp.close(); + + // Close resources + sid1.close(); + dset3.close(); + dset1.close(); + file1.close(); + + // Free memory buffers + HDfree(wbuf); + HDfree(rbuf); + HDfree(dwbuf); + HDfree(drbuf); + + PASSED(); } // end try catch (Exception& E) { - issue_fail_msg("test_reference_region_1D()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + issue_fail_msg("test_reference_region_1D()",__LINE__,__FILE__, + E.getCFuncName(), E.getCDetailMsg()); } } /* test_reference_region_1D() */ @@ -823,9 +823,9 @@ void test_reference(void) /**************************************************************** -** Function: cleanup_reference -** Purpose Cleanup temporary test files -** Return none +** Function: cleanup_reference +** Purpose: Cleanup temporary test files +** Return: none ****************************************************************/ extern "C" void cleanup_reference(void) diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 0cc8918..6605c03 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -37,7 +37,7 @@ using namespace H5; * Offset from alinged memory returned by malloc(). This can be used to test * that type conversions handle non-aligned buffers correctly. */ -#define ALIGNMENT 1 +#define ALIGNMENT 1 /* * Define if you want to test alignment code on a machine that doesn't @@ -70,7 +70,7 @@ const char *FILENAME[] = { * endian. If local variable `endian' is H5T_ORDER_BE then the result will * be I, otherwise the result will be Z-(I+1). */ -#define ENDIAN(Z,I) (H5T_ORDER_BE==endian?(I):(Z)-((I)+1)) +#define ENDIAN(Z,I) (H5T_ORDER_BE==endian?(I):(Z)-((I)+1)) typedef enum flt_t { @@ -86,12 +86,12 @@ typedef enum int_t { /*------------------------------------------------------------------------- * Function: test_classes * - * Purpose Test type classes + * Purpose: Test type classes * - * Return None. + * Return: None. * - * Programmer Binh-Minh Ribler (using C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (using C version) + * January, 2007 * * Modifications: * @@ -101,38 +101,38 @@ static void test_classes() { SUBTEST("PredType::getClass()"); try { - // maybe later, int curr_nerrors = GetTestNumErrs(); - - // PredType::NATIVE_INT should be in H5T_INTEGER class - H5T_class_t tcls = PredType::NATIVE_INT.getClass(); - if (H5T_INTEGER!=tcls) { - puts(" Invalid type class for H5T_NATIVE_INT"); - } - - // PredType::NATIVE_DOUBLE should be in H5T_FLOAT class - tcls = PredType::NATIVE_DOUBLE.getClass(); - if (H5T_FLOAT!=tcls) { - verify_val(tcls, H5T_FLOAT, "test_class: invalid type class for NATIVE_DOUBLE -", __LINE__, __FILE__); - } - PASSED(); + // maybe later, int curr_nerrors = GetTestNumErrs(); + + // PredType::NATIVE_INT should be in H5T_INTEGER class + H5T_class_t tcls = PredType::NATIVE_INT.getClass(); + if (H5T_INTEGER!=tcls) { + puts(" Invalid type class for H5T_NATIVE_INT"); + } + + // PredType::NATIVE_DOUBLE should be in H5T_FLOAT class + tcls = PredType::NATIVE_DOUBLE.getClass(); + if (H5T_FLOAT!=tcls) { + verify_val(tcls, H5T_FLOAT, "test_class: invalid type class for NATIVE_DOUBLE -", __LINE__, __FILE__); + } + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_classes", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_classes", __LINE__, __FILE__, E.getCDetailMsg()); } } /*------------------------------------------------------------------------- * Function: test_copy * - * Purpose Test datatype copy functionality + * Purpose: Test datatype copy functionality * - * Return Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer Binh-Minh Ribler (using C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (using C version) + * January, 2007 * * Modifications: * @@ -143,21 +143,21 @@ static void test_copy() SUBTEST("DataType::copy() and DataType::operator="); try { - // Test copying from a predefined datatype using DataType::operator= - DataType assigned_type; - assigned_type = PredType::NATIVE_SHORT; + // Test copying from a predefined datatype using DataType::operator= + DataType assigned_type; + assigned_type = PredType::NATIVE_SHORT; // Test copying a predefined type using DataType::copy - DataType copied_type; + DataType copied_type; copied_type.copy (PredType::STD_B8LE); - // Test copying a user-defined type using DataType::operator= - DataType assigned_usertype; - assigned_usertype = copied_type; + // Test copying a user-defined type using DataType::operator= + DataType assigned_usertype; + assigned_usertype = copied_type; - // Test copying from a user-defined datatype using DataType::copy - DataType copied_usertype; - copied_usertype.copy(copied_type); + // Test copying from a user-defined datatype using DataType::copy + DataType copied_usertype; + copied_usertype.copy(copied_type); // Test copying a user-defined int type using DataType::operator= IntType orig_int(PredType::STD_B8LE); @@ -171,26 +171,26 @@ static void test_copy() IntType another_int_type; another_int_type = new_int_type; - PASSED(); + PASSED(); } catch (Exception& E) { - issue_fail_msg("test_copy", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_copy", __LINE__, __FILE__, E.getCDetailMsg()); } } /*------------------------------------------------------------------------- - * Function: test_query + * Function: test_query * - * Purpose Tests query functions of compound and enumeration types. + * Purpose: Tests query functions of compound and enumeration types. * - * Return Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -203,113 +203,113 @@ const H5std_string EnumT_NAME("Enum_type"); static void test_query() { typedef struct { - int a; - float b; - long c; - double d; + int a; + float b; + long c; + double d; } src_typ_t; - short enum_val; + short enum_val; // Output message about test being performed SUBTEST("Query functions of compound and enumeration types"); try { - // Create File - H5File file(FILENAME[2], H5F_ACC_TRUNC); - - // Create a compound datatype - CompType tid1(sizeof(src_typ_t)); - - tid1.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); - tid1.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_FLOAT); - tid1.insertMember("c", HOFFSET(src_typ_t, c), PredType::NATIVE_LONG); - tid1.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_DOUBLE); - - // Create a enumerate datatype - EnumType tid2(sizeof(short)); - - tid2.insert("RED", (enum_val=0,&enum_val)); - tid2.insert("GREEN", (enum_val=1,&enum_val)); - tid2.insert("BLUE", (enum_val=2,&enum_val)); - tid2.insert("ORANGE", (enum_val=3,&enum_val)); - tid2.insert("YELLOW", (enum_val=4,&enum_val)); - - // Query member number and member index by name, for compound type - int nmembs = tid1.getNmembers(); - verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__); - - int index = tid1.getMemberIndex("c"); - verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__); - - // Query member number and member index by name, for enumeration type. - nmembs = tid2.getNmembers(); - verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__); - - index = tid2.getMemberIndex("ORANGE"); - verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__); - - // Commit compound datatype and close it - tid1.commit(file, CompT_NAME); - tid1.close(); - - // Commit enumeration datatype and close it - tid2.commit(file, EnumT_NAME); - tid2.close(); - - // Open the datatypes for query - - // Deprecated functions - tid1 = file.openCompType(CompT_NAME); - tid1.close(); - tid2 = file.openEnumType(EnumT_NAME); - tid2.close(); - - CompType comptype(file, CompT_NAME); - EnumType enumtype(file, EnumT_NAME); - - // Query member number and member index by name, for compound type - nmembs = comptype.getNmembers(); - verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__); - index = comptype.getMemberIndex("c"); - verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__); - - // Query member number and member index by name, for enumeration type - nmembs = enumtype.getNmembers(); - verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__); - index = enumtype.getMemberIndex("ORANGE"); - verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__); - - // Close datatypes and file - comptype.close(); - enumtype.close(); - file.close(); - - // Try truncating the file to make sure reference counting is good. - // If any references to ids of the accessed types are left unterminated, - // the truncating will fail, because the file will not be closed in - // the file.close() above. - H5File file1(FILENAME[2], H5F_ACC_TRUNC); - - PASSED(); + // Create File + H5File file(FILENAME[2], H5F_ACC_TRUNC); + + // Create a compound datatype + CompType tid1(sizeof(src_typ_t)); + + tid1.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + tid1.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_FLOAT); + tid1.insertMember("c", HOFFSET(src_typ_t, c), PredType::NATIVE_LONG); + tid1.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_DOUBLE); + + // Create a enumerate datatype + EnumType tid2(sizeof(short)); + + tid2.insert("RED", (enum_val=0,&enum_val)); + tid2.insert("GREEN", (enum_val=1,&enum_val)); + tid2.insert("BLUE", (enum_val=2,&enum_val)); + tid2.insert("ORANGE", (enum_val=3,&enum_val)); + tid2.insert("YELLOW", (enum_val=4,&enum_val)); + + // Query member number and member index by name, for compound type + int nmembs = tid1.getNmembers(); + verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__); + + int index = tid1.getMemberIndex("c"); + verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__); + + // Query member number and member index by name, for enumeration type. + nmembs = tid2.getNmembers(); + verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__); + + index = tid2.getMemberIndex("ORANGE"); + verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__); + + // Commit compound datatype and close it + tid1.commit(file, CompT_NAME); + tid1.close(); + + // Commit enumeration datatype and close it + tid2.commit(file, EnumT_NAME); + tid2.close(); + + // Open the datatypes for query + + // Deprecated functions + tid1 = file.openCompType(CompT_NAME); + tid1.close(); + tid2 = file.openEnumType(EnumT_NAME); + tid2.close(); + + CompType comptype(file, CompT_NAME); + EnumType enumtype(file, EnumT_NAME); + + // Query member number and member index by name, for compound type + nmembs = comptype.getNmembers(); + verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__); + index = comptype.getMemberIndex("c"); + verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__); + + // Query member number and member index by name, for enumeration type + nmembs = enumtype.getNmembers(); + verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__); + index = enumtype.getMemberIndex("ORANGE"); + verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__); + + // Close datatypes and file + comptype.close(); + enumtype.close(); + file.close(); + + // Try truncating the file to make sure reference counting is good. + // If any references to ids of the accessed types are left unterminated, + // the truncating will fail, because the file will not be closed in + // the file.close() above. + H5File file1(FILENAME[2], H5F_ACC_TRUNC); + + PASSED(); } // end of try block catch (Exception& E) { - issue_fail_msg("test_query", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_query", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_query /*------------------------------------------------------------------------- - * Function: test_transient + * Function: test_transient * - * Purpose Tests transient datatypes. + * Purpose: Tests transient datatypes. * - * Return Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -318,58 +318,58 @@ static void test_query() const char* filename1 = "dtypes1.h5"; static void test_transient () { - static hsize_t ds_size[2] = {10, 20}; + static hsize_t ds_size[2] = {10, 20}; SUBTEST("Transient datatypes"); try { - // Create the file and the dataspace. - H5File file(filename1, H5F_ACC_TRUNC); - DataSpace space(2, ds_size, ds_size); - - // Copying a predefined type results in a modifiable copy - IntType type(PredType::NATIVE_INT); - type.setPrecision(256); - - // It should not be possible to create an attribute for a transient type - try { - Attribute attr(type.createAttribute("attr1", PredType::NATIVE_INT, space)); - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("H5Object::createAttribute", "Attempted to commit a predefined datatype."); - } catch (AttributeIException& err) {} // do nothing, failure expected - - // Create a dataset from a transient datatype - // type.close(); - put trace in H5Tclose to make sure it's closed - type.copy(PredType::NATIVE_INT); - DataSet dset(file.createDataSet("dset1", type, space)); - - // The type returned from a dataset should not be modifiable - IntType itype(dset); - try { - itype.setPrecision(256); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("PredType::setPrecision", "Dataset datatypes should not be modifiable!"); - } catch (DataTypeIException& err) {} - itype.close(); - - // Get a copy of the dataset's datatype by applying DataType::copy() - // to the dataset. The resulted datatype should be modifiable. - itype.copy(dset); - itype.setPrecision(256); - itype.close(); - - // Close the dataset and reopen it, testing that its type is still - // read-only. (Note that a copy of it is modifiable.) - dset.close(); - dset = file.openDataSet("dset1"); - - // Close objects and file. - dset.close(); - file.close(); - type.close(); - space.close(); - PASSED(); + // Create the file and the dataspace. + H5File file(filename1, H5F_ACC_TRUNC); + DataSpace space(2, ds_size, ds_size); + + // Copying a predefined type results in a modifiable copy + IntType type(PredType::NATIVE_INT); + type.setPrecision(256); + + // It should not be possible to create an attribute for a transient type + try { + Attribute attr(type.createAttribute("attr1", PredType::NATIVE_INT, space)); + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("H5Object::createAttribute", "Attempted to commit a predefined datatype."); + } catch (AttributeIException& err) {} // do nothing, failure expected + + // Create a dataset from a transient datatype + // type.close(); - put trace in H5Tclose to make sure it's closed + type.copy(PredType::NATIVE_INT); + DataSet dset(file.createDataSet("dset1", type, space)); + + // The type returned from a dataset should not be modifiable + IntType itype(dset); + try { + itype.setPrecision(256); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("PredType::setPrecision", "Dataset datatypes should not be modifiable!"); + } catch (DataTypeIException& err) {} + itype.close(); + + // Get a copy of the dataset's datatype by applying DataType::copy() + // to the dataset. The resulted datatype should be modifiable. + itype.copy(dset); + itype.setPrecision(256); + itype.close(); + + // Close the dataset and reopen it, testing that its type is still + // read-only. (Note that a copy of it is modifiable.) + dset.close(); + dset = file.openDataSet("dset1"); + + // Close objects and file. + dset.close(); + file.close(); + type.close(); + space.close(); + PASSED(); } // end of try block catch (Exception& E) { @@ -379,16 +379,16 @@ static void test_transient () /*------------------------------------------------------------------------- - * Function: test_named + * Function: test_named * - * Purpose Tests named datatypes. + * Purpose: Tests named datatypes. * - * Return Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * * Modifications: * @@ -397,141 +397,141 @@ static void test_transient () const H5std_string filename2("dtypes2.h5"); static void test_named () { - static hsize_t ds_size[2] = {10, 20}; - hsize_t i; - unsigned attr_data[10][20]; - DataType *ds_type = NULL; + static hsize_t ds_size[2] = {10, 20}; + hsize_t i; + unsigned attr_data[10][20]; + DataType *ds_type = NULL; SUBTEST("Named datatypes"); try { - // Create the file. - H5File file(filename2, H5F_ACC_TRUNC); + // Create the file. + H5File file(filename2, H5F_ACC_TRUNC); - // Create a simple dataspace. - DataSpace space(2, ds_size, ds_size); + // Create a simple dataspace. + DataSpace space(2, ds_size, ds_size); - // Predefined types cannot be committed. - try { - PredType nativeint(PredType::NATIVE_INT); - nativeint.commit(file, "test_named_1 (should not exist)"); + // Predefined types cannot be committed. + try { + PredType nativeint(PredType::NATIVE_INT); + nativeint.commit(file, "test_named_1 (should not exist)"); - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("PredType::commit", "Attempted to commit a predefined datatype."); - } catch (DataTypeIException& err) {} + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("PredType::commit", "Attempted to commit a predefined datatype."); + } catch (DataTypeIException& err) {} - // Copy a predefined datatype and commit the copy. + // Copy a predefined datatype and commit the copy. IntType itype(PredType::NATIVE_INT); itype.commit(file, "native-int"); - // Test commit passing in const H5File& for prototype with const - try - { - // Create random char type - IntType atype(PredType::NATIVE_UCHAR); + // Test commit passing in const H5File& for prototype with const + try + { + // Create random char type + IntType atype(PredType::NATIVE_UCHAR); - // Creating group, declared as const - const Group const_grp = file.createGroup("GR as loc"); + // Creating group, declared as const + const Group const_grp = file.createGroup("GR as loc"); - // Commit type passing in const group; compilation would fail if - // no matching prototype - atype.commit(const_grp, "random uchar"); - } // end of try block - catch (Exception& E) + // Commit type passing in const group; compilation would fail if + // no matching prototype + atype.commit(const_grp, "random uchar"); + } // end of try block + catch (Exception& E) { - issue_fail_msg("test_named", __LINE__, __FILE__, "Commit at const group"); - } - - // Check that it is committed. - if (itype.committed() == false) - cerr << "IntType::committed() returned false" << endl; - - // We should not be able to modify a type after it has been committed. - try { - itype.setPrecision(256); // attempt an invalid action... - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("IntType::setPrecision", "Attempted to modify a committed datatype."); - } catch (DataTypeIException& err) {} - - // We should not be able to re-commit a committed type - try { - itype.commit(file, "test_named_2 (should not exist)"); - - // Should FAIL but didn't, so throw an invalid action exception - throw InvalidActionException("IntType::commit", "Attempted to re-commit a committed datatype."); - } catch (DataTypeIException& err) {} // do nothing, failure expected - - // It should be possible to define an attribute for the named type - Attribute attr1 = itype.createAttribute("attr1", PredType::NATIVE_UCHAR, space); - for (i=0; icommitted(); - if (!iscommitted) - throw InvalidActionException("IntType::committed()", "Dataset type should be named type!"); - dset.close(); - ds_type->close(); + issue_fail_msg("test_named", __LINE__, __FILE__, "Commit at const group"); + } + + // Check that it is committed. + if (itype.committed() == false) + cerr << "IntType::committed() returned false" << endl; + + // We should not be able to modify a type after it has been committed. + try { + itype.setPrecision(256); // attempt an invalid action... + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("IntType::setPrecision", "Attempted to modify a committed datatype."); + } catch (DataTypeIException& err) {} + + // We should not be able to re-commit a committed type + try { + itype.commit(file, "test_named_2 (should not exist)"); + + // Should FAIL but didn't, so throw an invalid action exception + throw InvalidActionException("IntType::commit", "Attempted to re-commit a committed datatype."); + } catch (DataTypeIException& err) {} // do nothing, failure expected + + // It should be possible to define an attribute for the named type + Attribute attr1 = itype.createAttribute("attr1", PredType::NATIVE_UCHAR, space); + for (i=0; icommitted(); + if (!iscommitted) + throw InvalidActionException("IntType::committed()", "Dataset type should be named type!"); + dset.close(); + ds_type->close(); delete ds_type; - // Reopen the dataset and its type, then make sure the type is - // a named type. - dset = file.openDataSet("dset1"); - ds_type = new DataType(dset.getDataType()); - iscommitted = ds_type->committed(); - if (!iscommitted) - throw InvalidActionException("IntType::committed()", "Dataset type should be named type!"); - - // Close the dataset and create another with the type returned from - // the first dataset. - dset.close(); - dset = file.createDataSet("dset2", *ds_type, space); - ds_type->close(); - dset.close(); + // Reopen the dataset and its type, then make sure the type is + // a named type. + dset = file.openDataSet("dset1"); + ds_type = new DataType(dset.getDataType()); + iscommitted = ds_type->committed(); + if (!iscommitted) + throw InvalidActionException("IntType::committed()", "Dataset type should be named type!"); + + // Close the dataset and create another with the type returned from + // the first dataset. + dset.close(); + dset = file.createDataSet("dset2", *ds_type, space); + ds_type->close(); + dset.close(); delete ds_type; - // Reopen the second dataset and make sure the type is shared - dset = file.openDataSet("dset2"); - ds_type = new DataType(dset.getDataType()); - iscommitted = ds_type->committed(); - if (!iscommitted) - throw InvalidActionException("DataType::iscommitted()", "Dataset type should be named type!"); - ds_type->close(); - - // Get the dataset datatype by applying DataType::copy() to the - // dataset. The resulted datatype should be modifiable. - IntType copied_type; - copied_type.copy(dset); - copied_type.setPrecision(256); - copied_type.close(); - - // Clean up - dset.close(); - itype.close(); - space.close(); - file.close(); - PASSED(); + // Reopen the second dataset and make sure the type is shared + dset = file.openDataSet("dset2"); + ds_type = new DataType(dset.getDataType()); + iscommitted = ds_type->committed(); + if (!iscommitted) + throw InvalidActionException("DataType::iscommitted()", "Dataset type should be named type!"); + ds_type->close(); + + // Get the dataset datatype by applying DataType::copy() to the + // dataset. The resulted datatype should be modifiable. + IntType copied_type; + copied_type.copy(dset); + copied_type.setPrecision(256); + copied_type.close(); + + // Clean up + dset.close(); + itype.close(); + space.close(); + file.close(); + PASSED(); } // end of try block catch (Exception& E) { @@ -565,14 +565,14 @@ void test_types() /*------------------------------------------------------------------------- - * Function: cleanup_types + * Function: cleanup_types * - * Purpose Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return none + * Return: none * - * Programmer Quincey Koziol - * September 10, 1999 + * Programmer: Quincey Koziol + * September 10, 1999 * * Modifications: * @@ -582,5 +582,5 @@ extern "C" void cleanup_types() { for (int i = 0; i < 3; i++) - HDremove(FILENAME[i]); + HDremove(FILENAME[i]); } // cleanup_types diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index 5dee1a2..43dcc0b 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -45,9 +45,9 @@ const hsize_t SPACE1_DIM1 = 4; /**************************************************************** ** ** test_vlstr_alloc_custom(): Test VL datatype custom memory -** allocation routines. This routine just uses malloc to -** allocate the memory and increments the amount of memory -** allocated. It is passed into setVlenMemManager. +** allocation routines. This routine just uses malloc to +** allocate the memory and increments the amount of memory +** allocated. It is passed into setVlenMemManager. ** ** Note: exact copy from the C version. ** (Not used now) @@ -55,9 +55,9 @@ const hsize_t SPACE1_DIM1 = 4; #if 0 // not used now static void *test_vlstr_alloc_custom(size_t size, void *info) { - void *ret_value=NULL; // Pointer to return + void *ret_value=NULL; // Pointer to return size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -67,8 +67,8 @@ static void *test_vlstr_alloc_custom(size_t size, void *info) extra=MAX(sizeof(void *),sizeof(size_t)); if((ret_value=HDmalloc(extra+size))!=NULL) { - *(size_t *)ret_value=size; - *mem_used+=size; + *(size_t *)ret_value=size; + *mem_used+=size; } // end if ret_value = ((unsigned char *)ret_value) + extra; @@ -79,9 +79,9 @@ static void *test_vlstr_alloc_custom(size_t size, void *info) /**************************************************************** ** ** test_vlstr_free_custom(): Test VL datatype custom memory -** allocation routines. This routine just uses free to -** release the memory and decrements the amount of memory -** allocated. It is passed into setVlenMemManager. +** allocation routines. This routine just uses free to +** release the memory and decrements the amount of memory +** allocated. It is passed into setVlenMemManager. ** ** Note: exact copy from the C version. ** (Not used now) @@ -91,7 +91,7 @@ static void test_vlstr_free_custom(void *_mem, void *info) { unsigned char *mem; size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -109,14 +109,14 @@ static void test_vlstr_free_custom(void *_mem, void *info) #endif /*------------------------------------------------------------------------- - * Function: test_vlstring_dataset + * Function: test_vlstring_dataset * - * Purpose Test writing/reading VL strings on datasets. + * Purpose: Test writing/reading VL strings on datasets. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * *------------------------------------------------------------------------- */ @@ -136,89 +136,89 @@ static void test_vlstring_dataset() SUBTEST("VL String on Datasets"); try { - // Open the file - H5File file1(FILENAME, H5F_ACC_TRUNC); + // Open the file + H5File file1(FILENAME, H5F_ACC_TRUNC); - // Create a datatype to refer to. - StrType vlst(0, H5T_VARIABLE); + // Create a datatype to refer to. + StrType vlst(0, H5T_VARIABLE); - // Open the root group. - Group root = file1.openGroup("/"); + // Open the root group. + Group root = file1.openGroup("/"); - // Create dataspace for the dataset. - DataSpace ds_space (H5S_SCALAR); + // Create dataspace for the dataset. + DataSpace ds_space (H5S_SCALAR); - // Create an dataset in the root group. - DataSet dset1 = root.createDataSet(DSET1_NAME, vlst, ds_space); + // Create an dataset in the root group. + DataSet dset1 = root.createDataSet(DSET1_NAME, vlst, ds_space); - // Write data to the dataset. - dset1.write(DSET1_DATA, vlst); + // Write data to the dataset. + dset1.write(DSET1_DATA, vlst); - // Read and verify the dataset string as a string of chars. - dset1.read(&string_ds_check, vlst); - if(HDstrcmp(string_ds_check, DSET1_DATA.c_str())!=0) - TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,string_ds_check=%s\n",__LINE__, DSET1_DATA.c_str(), string_ds_check); + // Read and verify the dataset string as a string of chars. + dset1.read(&string_ds_check, vlst); + if(HDstrcmp(string_ds_check, DSET1_DATA.c_str())!=0) + TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,string_ds_check=%s\n",__LINE__, DSET1_DATA.c_str(), string_ds_check); - HDfree(string_ds_check); // note: no need for std::string test + HDfree(string_ds_check); // note: no need for std::string test string_ds_check = NULL; - // Read and verify the dataset string as an std::string. - H5std_string read_str; - dset1.read(read_str, vlst); - if (read_str != DSET1_DATA) - TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,read_str=%s\n",__LINE__, DSET1_DATA.c_str(), read_str.c_str()); + // Read and verify the dataset string as an std::string. + H5std_string read_str; + dset1.read(read_str, vlst); + if (read_str != DSET1_DATA) + TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,read_str=%s\n",__LINE__, DSET1_DATA.c_str(), read_str.c_str()); - // Close the dataset. - dset1.close(); + // Close the dataset. + dset1.close(); - // Test scalar type dataset with 1 value. - dset1 = root.createDataSet("test_scalar_small", vlst, ds_space); + // Test scalar type dataset with 1 value. + dset1 = root.createDataSet("test_scalar_small", vlst, ds_space); - dynstring_ds_write = (char*)HDcalloc(1, sizeof(char)); - HDmemset(dynstring_ds_write, 'A', 1); + dynstring_ds_write = (char*)HDcalloc(1, sizeof(char)); + HDmemset(dynstring_ds_write, 'A', 1); - // Write data to the dataset, then read it back. - dset1.write(&dynstring_ds_write, vlst); - dset1.read(&string_ds_check, vlst); + // Write data to the dataset, then read it back. + dset1.write(&dynstring_ds_write, vlst); + dset1.read(&string_ds_check, vlst); - // Verify data read. - if(HDstrcmp(string_ds_check,dynstring_ds_write)!=0) - TestErrPrintf("VL string datasets don't match!, dynstring_ds_write=%s, string_ds_check=%s\n",dynstring_ds_write,string_ds_check); - HDfree(string_ds_check); + // Verify data read. + if(HDstrcmp(string_ds_check,dynstring_ds_write)!=0) + TestErrPrintf("VL string datasets don't match!, dynstring_ds_write=%s, string_ds_check=%s\n",dynstring_ds_write,string_ds_check); + HDfree(string_ds_check); string_ds_check = NULL; - dset1.close(); + dset1.close(); - // Open dataset DSET1_NAME again. - dset1 = root.openDataSet(DSET1_NAME); + // Open dataset DSET1_NAME again. + dset1 = root.openDataSet(DSET1_NAME); - // Close dataset and file - dset1.close(); - file1.close(); + // Close dataset and file + dset1.close(); + file1.close(); - PASSED(); + PASSED(); } // end try block // Catch all exceptions. catch (Exception& E) { - issue_fail_msg("test_vlstring_dataset()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_vlstring_dataset()", __LINE__, __FILE__, E.getCDetailMsg()); } if(dynstring_ds_write) HDfree(dynstring_ds_write); if(string_ds_check) - HDfree(string_ds_check); + HDfree(string_ds_check); } // test_vlstring_dataset() /*------------------------------------------------------------------------- - * Function: test_vlstring_array_dataset + * Function: test_vlstring_array_dataset * - * Purpose Test writing/reading VL string array to/from datasets. + * Purpose: Test writing/reading VL string array to/from datasets. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler - * July, 2009 + * Programmer: Binh-Minh Ribler + * July, 2009 * *------------------------------------------------------------------------- */ @@ -235,89 +235,89 @@ static void test_vlstring_array_dataset() H5File* file1 = NULL; try { // Create file. - file1 = new H5File(FILENAME, H5F_ACC_RDWR); + file1 = new H5File(FILENAME, H5F_ACC_RDWR); // Create dataspace for datasets. hsize_t dims1[] = {SPACE1_DIM1}; DataSpace ds_space(SPACE1_RANK, dims1); - // Create a datatype to refer to. - StrType vlst(0, H5T_VARIABLE); - - // Create and write a dataset. - DataSet dataset(file1->createDataSet(DSSTRARR_NAME, vlst, ds_space)); - dataset.write(string_ds_array, vlst); - - // Read and verify the dataset using strings of chars as buffer. - // Note: reading by array of H5std_string doesn't work yet. - char *string_ds_check[SPACE1_DIM1]; - dataset.read(string_ds_check, vlst); - - hsize_t ii; - for (ii = 0; ii < SPACE1_DIM1; ii++) - { - if(HDstrcmp(string_ds_check[ii], string_ds_array[ii])!=0) - TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]); - - HDfree(string_ds_check[ii]); - } - - // Close objects that are no longer needed. - dataset.close(); - ds_space.close(); - - // - // Test with scalar data space. - // - - // Create H5S_SCALAR data space. - DataSpace scalar_space; - - // Create and write another dataset. - DataSet dataset2(file1->createDataSet("Dataset2", vlst, scalar_space)); - char *wdata2 = (char*)HDcalloc(65534, sizeof(char)); - HDmemset(wdata2, 'A', 65533); - dataset2.write(&wdata2, vlst); - - char *rdata2; - dataset2.read(&rdata2, vlst); - if (HDstrcmp(wdata2, rdata2)!=0) - TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, wdata2, rdata2); - - // Release resources from second dataset operation. - scalar_space.close(); - dataset2.close(); - HDfree(wdata2); - HDfree(rdata2); - - // Close objects and file. - dataset2.close(); - vlst.close(); - file1->close(); - - PASSED(); + // Create a datatype to refer to. + StrType vlst(0, H5T_VARIABLE); + + // Create and write a dataset. + DataSet dataset(file1->createDataSet(DSSTRARR_NAME, vlst, ds_space)); + dataset.write(string_ds_array, vlst); + + // Read and verify the dataset using strings of chars as buffer. + // Note: reading by array of H5std_string doesn't work yet. + char *string_ds_check[SPACE1_DIM1]; + dataset.read(string_ds_check, vlst); + + hsize_t ii; + for (ii = 0; ii < SPACE1_DIM1; ii++) + { + if(HDstrcmp(string_ds_check[ii], string_ds_array[ii])!=0) + TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]); + + HDfree(string_ds_check[ii]); + } + + // Close objects that are no longer needed. + dataset.close(); + ds_space.close(); + + // + // Test with scalar data space. + // + + // Create H5S_SCALAR data space. + DataSpace scalar_space; + + // Create and write another dataset. + DataSet dataset2(file1->createDataSet("Dataset2", vlst, scalar_space)); + char *wdata2 = (char*)HDcalloc(65534, sizeof(char)); + HDmemset(wdata2, 'A', 65533); + dataset2.write(&wdata2, vlst); + + char *rdata2; + dataset2.read(&rdata2, vlst); + if (HDstrcmp(wdata2, rdata2)!=0) + TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, wdata2, rdata2); + + // Release resources from second dataset operation. + scalar_space.close(); + dataset2.close(); + HDfree(wdata2); + HDfree(rdata2); + + // Close objects and file. + dataset2.close(); + vlst.close(); + file1->close(); + + PASSED(); } // end try // Catch all exceptions. catch (Exception& E) { - issue_fail_msg("test_vlstring_array_dataset()", __LINE__, __FILE__, E.getCDetailMsg()); + issue_fail_msg("test_vlstring_array_dataset()", __LINE__, __FILE__, E.getCDetailMsg()); } if(file1) - delete file1; + delete file1; } // end test_vlstring_array_dataset() /*------------------------------------------------------------------------- - * Function: test_vlstrings_special + * Function: test_vlstrings_special * - * Purpose Test VL string code for special string cases, nil and - * zero-sized. + * Purpose: Test VL string code for special string cases, nil and + * zero-sized. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * *------------------------------------------------------------------------- */ @@ -331,110 +331,110 @@ static void test_vlstrings_special() SUBTEST("Special VL Strings"); try { - // Create file. - H5File file1(FILENAME, H5F_ACC_TRUNC); + // Create file. + H5File file1(FILENAME, H5F_ACC_TRUNC); // Create dataspace for datasets. hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); - // Create a datatype to refer to. - StrType vlst(0, H5T_VARIABLE); - - // Create a dataset. - DataSet dataset(file1.createDataSet("Dataset3", vlst, sid1)); - - // Read from the dataset before writing data. - dataset.read(rdata, vlst); - - // Check data read in. - hsize_t ii; // counting variable - for (ii=0; iiopenStrType(VLSTR_TYPE); // deprecated + // Try opening datatype again. + vlst = file1->openStrType(VLSTR_TYPE); // deprecated - // Close again and reopen with constructor. - vlst.close(); - StrType vlst1(*file1, VLSTR_TYPE); + // Close again and reopen with constructor. + vlst.close(); + StrType vlst1(*file1, VLSTR_TYPE); - // Close datatype and file. - vlst1.close(); - file1->close(); + // Close datatype and file. + vlst1.close(); + file1->close(); delete file1; - // Open file. - file1 = new H5File(FILENAME, H5F_ACC_RDWR); + // Open file. + file1 = new H5File(FILENAME, H5F_ACC_RDWR); - // Open the variable-length string datatype just created - StrType vlst2(*file1, VLSTR_TYPE); + // Open the variable-length string datatype just created + StrType vlst2(*file1, VLSTR_TYPE); - // Verify character set and padding - cset = vlst2.getCset(); - verify_val(cset, H5T_CSET_ASCII, "StrType::getCset", __LINE__, __FILE__); - pad = vlst2.getStrpad(); - verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__); + // Verify character set and padding + cset = vlst2.getCset(); + verify_val(cset, H5T_CSET_ASCII, "StrType::getCset", __LINE__, __FILE__); + pad = vlst2.getStrpad(); + verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__); - // Close datatype and file - vlst2.close(); - file1->close(); + // Close datatype and file + vlst2.close(); + file1->close(); - PASSED(); + PASSED(); } // end try block // Catch all exceptions. @@ -516,18 +516,18 @@ static void test_vlstring_type() } if(file1) - delete file1; + delete file1; } // end test_vlstring_type() /*------------------------------------------------------------------------- - * Function: test_compact_vlstring + * Function: test_compact_vlstring * - * Purpose Test storing VL strings in compact datasets. + * Purpose: Test storing VL strings in compact datasets. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) - * January, 2007 + * Programmer: Binh-Minh Ribler (use C version) + * January, 2007 * *------------------------------------------------------------------------- */ @@ -537,55 +537,55 @@ static void test_compact_vlstring() SUBTEST("VL Strings on Compact Dataset"); try { - // Create file - H5File file1(FILENAME, H5F_ACC_TRUNC); + // Create file + H5File file1(FILENAME, H5F_ACC_TRUNC); - // Create dataspace for datasets + // Create dataspace for datasets hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); - // Create a datatype to refer to - StrType vlst(0, H5T_VARIABLE); - - // Create dataset create property list and set layout - DSetCreatPropList plist; - plist.setLayout(H5D_COMPACT); - - // Create a dataset - DataSet dataset(file1.createDataSet("Dataset5", vlst, sid1, plist)); - - // Write dataset to disk - const char *wdata[SPACE1_DIM1] = {"one", "two", "three", "four"}; - dataset.write(wdata, vlst); - - // Read dataset from disk - char *rdata[SPACE1_DIM1]; // Information read in - dataset.read(rdata, vlst); - - // Compare data read in - hsize_t i; - for (i=0; i ${TEST}") TRY_RUN (${TEST}_RUN ${TEST}_COMPILE @@ -177,41 +177,41 @@ macro (H5ConversionTests TEST msg) OUTPUT_VARIABLE OUTPUT ) if (${TEST}_COMPILE) - if (${TEST}_RUN MATCHES 0) + if (${TEST}_RUN MATCHES 0) set (${TEST} 1 CACHE INTERNAL ${msg}) message (STATUS "${msg}... yes") - else () + else (${TEST}_RUN MATCHES 0) set (${TEST} "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - endif () - else () + endif (${TEST}_RUN MATCHES 0) + else (${TEST}_COMPILE ) set (${TEST} "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" ) - endif () + endif (${TEST}_COMPILE) - endif () -endmacro () + endif ("${TEST}" MATCHES "^${TEST}$") +ENDMACRO (H5ConversionTests) #----------------------------------------------------------------------------- # Macro to make some of the conversion tests easier to write/read #----------------------------------------------------------------------------- -macro (H5MiscConversionTest VAR TEST msg) +MACRO (H5MiscConversionTest VAR TEST msg) if ("${TEST}" MATCHES "^${TEST}$") if (${VAR}) set (${TEST} 1 CACHE INTERNAL ${msg}) message (STATUS "${msg}... yes") - else () + else (${VAR}) set (${TEST} "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") - endif () - endif () -endmacro () + endif (${VAR}) + endif ("${TEST}" MATCHES "^${TEST}$") +ENDMACRO (H5MiscConversionTest) #----------------------------------------------------------------------------- # Check various conversion capabilities @@ -219,9 +219,9 @@ endmacro () # ---------------------------------------------------------------------- # Set the flag to indicate that the machine is using a special algorithm to convert -# 'long double' to '(unsigned) long' values. (This flag should only be set for -# the IBM Power6 Linux. When the bit sequence of long double is -# 0x4351ccf385ebc8a0bfcc2a3c3d855620, the converted value of (unsigned)long +# 'long double' to '(unsigned) long' values. (This flag should only be set for +# the IBM Power6 Linux. When the bit sequence of long double is +# 0x4351ccf385ebc8a0bfcc2a3c3d855620, the converted value of (unsigned)long # is 0x004733ce17af227f, not the same as the library's conversion to 0x004733ce17af2282. # The machine's conversion gets the correct value. We define the macro and disable # this kind of test until we figure out what algorithm they use. @@ -229,10 +229,10 @@ endmacro () H5ConversionTests (H5_LDOUBLE_TO_LONG_SPECIAL "Checking IF your system converts long double to (unsigned) long values with special algorithm") # ---------------------------------------------------------------------- # Set the flag to indicate that the machine is using a special algorithm -# to convert some values of '(unsigned) long' to 'long double' values. -# (This flag should be off for all machines, except for IBM Power6 Linux, -# when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff..., -# ..., 7fffff..., the compiler uses a unknown algorithm. We define a +# to convert some values of '(unsigned) long' to 'long double' values. +# (This flag should be off for all machines, except for IBM Power6 Linux, +# when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff..., +# ..., 7fffff..., the compiler uses a unknown algorithm. We define a # macro and skip the test for now until we know about the algorithm. # H5ConversionTests (H5_LONG_TO_LDOUBLE_SPECIAL "Checking IF your system can convert (unsigned) long to long double values with special algorithm") @@ -261,7 +261,7 @@ H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restricti # ----------------------------------------------------------------------- # wrapper script variables -# +# set (prefix ${CMAKE_INSTALL_PREFIX}) set (exec_prefix "\${prefix}") set (libdir "${exec_prefix}/lib") @@ -272,4 +272,4 @@ set (CXX ${CMAKE_CXX_COMPILER}) set (FC ${CMAKE_Fortran_COMPILER}) foreach (LINK_LIB ${LINK_LIBS}) set (LIBS "${LIBS} -l${LINK_LIB}") -endforeach () +endforeach (LINK_LIB ${LINK_LIBS}) diff --git a/config/cmake/FindHDFJAVA.cmake.in b/config/cmake/FindHDFJAVA.cmake.in index 25057e6..b822280 100644 --- a/config/cmake/FindHDFJAVA.cmake.in +++ b/config/cmake/FindHDFJAVA.cmake.in @@ -4,18 +4,18 @@ # # Find the HDFJAVA includes and get all installed hdf-java library settings from -# HDFJAVA-config.cmake file : Requires a CMake compatible hdf-java-@HDFJAVA_PACKAGE_VERSION@ or later +# HDFJAVA-config.cmake file : Requires a CMake compatible hdf-java-@HDFJAVA_PACKAGE_VERSION@ or later # for this feature to work. The following vars are set if hdf-java is found. # # HDFJAVA_FOUND - True if found, otherwise all other vars are undefined # HDFJAVA_VERSION_STRING - full version (e.g. @HDFJAVA_PACKAGE_VERSION@) # HDFJAVA_VERSION_MAJOR - major part of version (e.g. @HDFJAVA_PACKAGE_VERSION_MAJOR@) # HDFJAVA_VERSION_MINOR - minor part (e.g. @HDFJAVA_PACKAGE_VERSION_MINOR@) -# +# # Target names that are valid (depending on enabled options) # will be the following # -# +# # To aid in finding HDFJAVA as part of a subproject set # HDFJAVA_ROOT_DIR_HINT to the location where @HDFJAVA_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake lies @@ -60,9 +60,9 @@ if (HDFJAVA_ROOT_DIR) set (HDFJAVA_FOUND "YES") INCLUDE (${HDFJAVA_ROOT_DIR}/@HDFJAVA_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake) set (HDFJAVA_LIBRARIES "${HDFJAVA_LIBRARY}") - set (HDFJAVA_INCLUDE_DIRS + set (HDFJAVA_INCLUDE_DIRS ${HDFJAVA_LIBRARY}/jarhdf-@HDFJAVA_PACKAGE_VERSION@.jar ${HDFJAVA_LIBRARY}/jarhdf5-@HDFJAVA_PACKAGE_VERSION@.jar ) - -endif () + +endif (HDFJAVA_ROOT_DIR) diff --git a/config/cmake/FindJNI.cmake b/config/cmake/FindJNI.cmake index baab2ea..9d755fc 100644 --- a/config/cmake/FindJNI.cmake +++ b/config/cmake/FindJNI.cmake @@ -147,6 +147,8 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES /usr/lib/jvm/java-1.5.0-sun/jre/lib/{libarch} /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/{libarch} # can this one be removed according to #8821 ? Alex /usr/lib/jvm/java-6-openjdk/jre/lib/{libarch} + /usr/lib/jvm/java-7-openjdk/jre/lib/{libarch} + /usr/lib/jvm/java-7-openjdk-{libarch}/jre/lib/{libarch} /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/{libarch} # fedora # Debian specific paths for default JVM /usr/lib/jvm/default-java/jre/lib/{libarch} diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 6aa5e1f..e1cb781 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: @@ -12,7 +12,7 @@ set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) #INSTALLDIR - HDF5-1.8 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATIC_ONLY - Default is YES +#STATIC_LIBRARIES - Default is YES #FORTRAN_LIBRARIES - Default is NO ##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) if(DEFINED CTEST_SCRIPT_ARG) @@ -23,61 +23,61 @@ if(DEFINED CTEST_SCRIPT_ARG) foreach(current_var ${script_args}) if ("${current_var}" MATCHES "^([^=]+)=(.+)$") set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif () - endforeach () -endif () + endif() + endforeach() +endif() if(NOT DEFINED INSTALLDIR) set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") -endif () +endif() if(NOT DEFINED CTEST_CONFIGURATION_TYPE) set(CTEST_CONFIGURATION_TYPE "Release") -endif () +endif() if(NOT DEFINED CTEST_SOURCE_NAME) set(CTEST_SOURCE_NAME "HDF5Examples") -endif () -if(NOT DEFINED STATIC_ONLY) - set(STATICONLYLIBRARIES "YES") -else(NOT DEFINED STATIC_ONLY) - set(STATICONLYLIBRARIES "NO") -endif () +endif() +if(NOT DEFINED STATIC_LIBRARIES) + set(STATICLIBRARIES "YES") +else(NOT DEFINED STATIC_LIBRARIES) + set(STATICLIBRARIES "NO") +endif() if(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "NO") else(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "YES") -endif () +endif() if(NOT DEFINED HDF_LOCAL) set(CDASH_LOCAL "NO") else(NOT HDF_LOCAL) set(CDASH_LOCAL "YES") -endif () +endif() if(NOT DEFINED CTEST_SITE) set(CTEST_SITE "local") -endif () +endif() if(NOT DEFINED CTEST_BUILD_NAME) set(CTEST_BUILD_NAME "examples") -endif () +endif() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) # set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.2.1-Source") -#endif () +#endif() ############################################################################################################### # Adjust the following SET Commands as needed ############################################################################################################### if(WIN32) - if(${STATICONLYLIBRARIES}) + if(${STATICLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif () + endif() set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") else(WIN32) - if(${STATICONLYLIBRARIES}) + if(${STATICLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif () + endif() set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) @@ -86,12 +86,12 @@ else(WIN32) endif(WIN32) if(${FORTRANLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") -else () +else() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") -endif () +endif() if(${CDASH_LOCAL}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") -endif () +endif() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### @@ -111,11 +111,11 @@ if(APPLE) if(NOT NO_MAC_FORTRAN) # Shared fortran is not supported, build static set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else () + else() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif () + endif() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif () +endif() #----------------------------------------------------------------------------- set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") @@ -126,16 +126,16 @@ if(CTEST_USE_TAR_SOURCE) if(WIN32) message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else () + else() message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif () + endif() if(NOT rv EQUAL 0) message(STATUS "extracting... [error-(${rv}) clean up]") file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif () + endif() endif(CTEST_USE_TAR_SOURCE) #----------------------------------------------------------------------------- @@ -154,9 +154,9 @@ ProcessorCount(N) if(NOT N EQUAL 0) if(NOT WIN32) set(CTEST_BUILD_FLAGS -j${N}) - endif () + endif() set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif () +endif() set (CTEST_CONFIGURE_COMMAND "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) @@ -174,27 +174,27 @@ ctest_start (Experimental) ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) if(${res} LESS 0 OR ${res} GREATER 0) file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") -endif () +endif() if(LOCAL_SUBMIT) ctest_submit (PARTS Configure Notes) -endif () +endif() ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND APPEND RETURN_VALUE res NUMBER_ERRORS errval) if(${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") -endif () +endif() if(LOCAL_SUBMIT) ctest_submit (PARTS Build) -endif () +endif() ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) if(${res} LESS 0 OR ${res} GREATER 0) file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") -endif () +endif() if(LOCAL_SUBMIT) ctest_submit (PARTS Test) -endif () +endif() if(${res} LESS 0 OR ${res} GREATER 0) message (FATAL_ERROR "tests FAILED") -endif () +endif() #----------------------------------------------------------------------------- ############################################################################################################## message(STATUS "DONE") \ No newline at end of file diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 747e043..d88e672 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -5,21 +5,21 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype) if (${libtype} MATCHES "SHARED") if (ARGN) set (PACKAGE_SOVERSION ${ARGN}) - else () + else (ARGN) set (PACKAGE_SOVERSION ${HDF5_PACKAGE_SOVERSION}) - endif () + endif (ARGN) if (WIN32) set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) - else () + else (WIN32) set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION}) - endif () + endif (WIN32) set_target_properties (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) if (WIN32) set (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${PACKAGE_SOVERSION}") - else () + else (WIN32) set_target_properties (${libtarget} PROPERTIES SOVERSION ${PACKAGE_SOVERSION}) - endif () - endif () + endif (WIN32) + endif (${libtype} MATCHES "SHARED") HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype}) #-- Apple Specific install_name for libraries @@ -31,7 +31,7 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype) INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} ) - endif () + endif (HDF5_BUILD_WITH_INSTALL_NAME) if (HDF5_BUILD_FRAMEWORKS) if (${libtype} MATCHES "SHARED") # adapt target to build frameworks instead of dylibs @@ -42,8 +42,8 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype) MACOSX_FRAMEWORK_IDENTIFIER org.hdfgroup.${libtarget} MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${HDF5_PACKAGE_VERSION_MAJOR} MACOSX_FRAMEWORK_BUNDLE_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) - endif () - endif () - endif () + endif (${libtype} MATCHES "SHARED") + endif (HDF5_BUILD_FRAMEWORKS) + endif (APPLE) -endmacro () +endmacro (H5_SET_LIB_OPTIONS) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index a419950..eba448c 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -7,7 +7,7 @@ if (${C_HAVE_QUADMATH}) set(HAVE_QUADMATH 1) else () set(HAVE_QUADMATH 0) -endif () +endif() # # This file provides functions for HDF5 specific Fortran support. @@ -18,16 +18,16 @@ ENABLE_LANGUAGE (Fortran) # The provided CMake Fortran macros don't provide a general compile/run function # so this one is used. #----------------------------------------------------------------------------- -macro (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN) +MACRO (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN) # -# if (NOT DEFINED ${RUN_RESULT_VAR}) +# if (NOT DEFINED ${RUN_RESULT_VAR}) message (STATUS "Detecting Fortran ${FUNCTION}") if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - else () + else (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - endif () + endif (CMAKE_REQUIRED_LIBRARIES) file (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90 "${CODE}" @@ -40,7 +40,7 @@ macro (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN) ) set(${RETURN} ${OUTPUT}) - + #message ( "Test result1 ${RETURN} ") #message ( "Test result3 ${RESULT} ") #message ( "Test result2 ${CMAKE_MATCH_0} ") @@ -65,15 +65,15 @@ macro (FORTRAN_RUN FUNCTION CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR RETURN) "${OUTPUT}\n\n") endif () endif () -# endif () -endmacro () +# endif (NOT DEFINED ${RUN_RESULT_VAR}) +ENDMACRO (FORTRAN_RUN) # Read source line beginning at the line matching Input:"START" and ending at the line matching Input:"END" -macro (READ_SOURCE START END RETURN) - file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" CODE) - string (REGEX MATCH "${START}[\\\t\\\n\\\r[].+]*${END}" CODE ${CODE}) - set (RETURN "${CODE}") -endmacro () +MACRO (READ_SOURCE START END RETURN) + file(READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" CODE) + string(REGEX MATCH "${START}[\\\t\\\n\\\r[].+]*${END}" CODE ${CODE}) + set(RETURN "${CODE}") +ENDMACRO (READ_SOURCE START END RETURN) #----------------------------------------------------------------------------- # Check to see C_LONG_DOUBLE is available @@ -85,10 +85,10 @@ CHECK_FORTRAN_FEATURE(c_long_double ) if (${FORTRAN_HAVE_C_LONG_DOUBLE}) - set (FORTRAN_HAVE_C_LONG_DOUBLE 1) + set(FORTRAN_HAVE_C_LONG_DOUBLE 1) else () - set (FORTRAN_HAVE_C_LONG_DOUBLE 0) -endif () + set(FORTRAN_HAVE_C_LONG_DOUBLE 0) +endif() # Check to see C_LONG_DOUBLE is different from C_DOUBLE @@ -98,30 +98,30 @@ CHECK_FORTRAN_FEATURE(c_long_double FORTRAN_C_LONG_DOUBLE_IS_UNIQUE ) if (${FORTRAN_C_LONG_DOUBLE_IS_UNIQUE}) - set (FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 1) + set(FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 1) else () - set (FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 0) -endif () + set(FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 0) +endif() ## Set the sizeof function for use later in the fortran tests -if (FORTRAN_HAVE_STORAGE_SIZE) - set (FC_SIZEOF_A "STORAGE_SIZE(a, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") - set (FC_SIZEOF_B "STORAGE_SIZE(b, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") - set (FC_SIZEOF_C "STORAGE_SIZE(c, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") -elseif (FORTRAN_HAVE_C_SIZEOF) - set (FC_SIZEOF_A "SIZEOF(a)") - set (FC_SIZEOF_B "SIZEOF(b)") - set (FC_SIZEOF_C "SIZEOF(c)") -else () +if(FORTRAN_HAVE_STORAGE_SIZE) + set(FC_SIZEOF_A "STORAGE_SIZE(a, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") + set(FC_SIZEOF_B "STORAGE_SIZE(b, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") + set(FC_SIZEOF_C "STORAGE_SIZE(c, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") +elseif(FORTRAN_HAVE_C_SIZEOF) + set(FC_SIZEOF_A "SIZEOF(a)") + set(FC_SIZEOF_B "SIZEOF(b)") + set(FC_SIZEOF_C "SIZEOF(c)") +else(FORTRAN_HAVE_STORAGE_SIZE) message (FATAL_ERROR "Fortran compiler requires either intrinsic functions SIZEOF or STORAGE_SIZE") -endif () +endif(FORTRAN_HAVE_STORAGE_SIZE) #----------------------------------------------------------------------------- # Determine the available KINDs for REALs and INTEGERs #----------------------------------------------------------------------------- -READ_SOURCE ("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" CODE) -FORTRAN_RUN ("REAL and INTEGER KINDs" +READ_SOURCE("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" CODE) +FORTRAN_RUN("REAL and INTEGER KINDs" "${CODE}" XX YY @@ -134,35 +134,35 @@ FORTRAN_RUN ("REAL and INTEGER KINDs" # dnl -- LINE 4 -- number of valid integer kinds # dnl -- LINE 5 -- number of valid real kinds -file (READ "${CMAKE_BINARY_DIR}/pac_fconftest.out" PROG_OUTPUT) +file(READ "${CMAKE_BINARY_DIR}/pac_fconftest.out" PROG_OUTPUT) # Convert the string to a list of strings by replacing the carriage return with a semicolon -string (REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") +string(REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") -list (GET PROG_OUTPUT 0 pac_validIntKinds) -list (GET PROG_OUTPUT 1 pac_validRealKinds) -list (GET PROG_OUTPUT 2 H5_PAC_FC_MAX_REAL_PRECISION) +list(GET PROG_OUTPUT 0 pac_validIntKinds) +list(GET PROG_OUTPUT 1 pac_validRealKinds) +list(GET PROG_OUTPUT 2 H5_PAC_FC_MAX_REAL_PRECISION) # If the lists are empty then something went wrong. -if (NOT pac_validIntKinds) +if( NOT pac_validIntKinds) message (FATAL_ERROR "Failed to find available INTEGER KINDs for Fortran") -endif () -if (NOT pac_validRealKinds) +endif() +if( NOT pac_validRealKinds) message (FATAL_ERROR "Failed to find available REAL KINDs for Fortran") -endif () -if (NOT H5_PAC_FC_MAX_REAL_PRECISION) +endif() +if( NOT H5_PAC_FC_MAX_REAL_PRECISION) message (FATAL_ERROR "No output from Fortran decimal precision program") -endif () +endif() -set (PAC_FC_ALL_INTEGER_KINDS "\{${pac_validIntKinds}\}") -set (PAC_FC_ALL_REAL_KINDS "\{${pac_validRealKinds}\}") +set(PAC_FC_ALL_INTEGER_KINDS "\{${pac_validIntKinds}\}") +set(PAC_FC_ALL_REAL_KINDS "\{${pac_validRealKinds}\}") -list (GET PROG_OUTPUT 3 NUM_IKIND) -list (GET PROG_OUTPUT 4 NUM_RKIND) +list(GET PROG_OUTPUT 3 NUM_IKIND) +list(GET PROG_OUTPUT 4 NUM_RKIND) -set (PAC_FORTRAN_NUM_INTEGER_KINDS "${NUM_IKIND}") +set(PAC_FORTRAN_NUM_INTEGER_KINDS "${NUM_IKIND}") -set (H5CONFIG_F_NUM_IKIND "INTEGER, PARAMETER :: num_ikinds = ${NUM_IKIND}") -set (H5CONFIG_F_IKIND "INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/${pac_validIntKinds}/)") +set(H5CONFIG_F_NUM_IKIND "INTEGER, PARAMETER :: num_ikinds = ${NUM_IKIND}") +set(H5CONFIG_F_IKIND "INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/${pac_validIntKinds}/)") message (STATUS "....NUMBER OF INTEGER KINDS FOUND ${PAC_FORTRAN_NUM_INTEGER_KINDS}") message (STATUS "....REAL KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}") @@ -175,10 +175,10 @@ message (STATUS "....MAX DECIMAL PRECISION ${H5_PAC_FC_MAX_REAL_PRECISION}") # ********** # INTEGERS # ********** -string (REGEX REPLACE "," ";" VAR "${pac_validIntKinds}") +string(REGEX REPLACE "," ";" VAR "${pac_validIntKinds}") -foreach (KIND ${VAR} ) - set (PROG_SRC +foreach( KIND ${VAR} ) + set(PROG_SRC " PROGRAM main USE ISO_C_BINDING @@ -193,36 +193,37 @@ foreach (KIND ${VAR} ) YY PROG_OUTPUT1 ) - string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") - set (pack_int_sizeof "${pack_int_sizeof} ${PROG_OUTPUT1},") -endforeach () + string(REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") + set(pack_int_sizeof "${pack_int_sizeof} ${PROG_OUTPUT1},") +endforeach(KIND) if (pack_int_sizeof STREQUAL "") message (FATAL_ERROR "Failed to find available INTEGER KINDs for Fortran") -endif () +endif() + +string(STRIP ${pack_int_sizeof} pack_int_sizeof) -string (STRIP ${pack_int_sizeof} pack_int_sizeof) #Remove trailing comma -string (REGEX REPLACE ",$" "" pack_int_sizeof "${pack_int_sizeof}") +string(REGEX REPLACE ",$" "" pack_int_sizeof "${pack_int_sizeof}") #Remove spaces -string (REGEX REPLACE " " "" pack_int_sizeof "${pack_int_sizeof}") +string(REGEX REPLACE " " "" pack_int_sizeof "${pack_int_sizeof}") -set (PAC_FC_ALL_INTEGER_KINDS_SIZEOF "\{${pack_int_sizeof}\}") +set(PAC_FC_ALL_INTEGER_KINDS_SIZEOF "\{${pack_int_sizeof}\}") -message (STATUS "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") +message(STATUS "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") # ********** # REALS # ********** -string (REGEX REPLACE "," ";" VAR "${pac_validRealKinds}") +string(REGEX REPLACE "," ";" VAR "${pac_validRealKinds}") #find the maximum kind of the real -list (LENGTH VAR LEN_VAR) -math (EXPR _LEN "${LEN_VAR}-1") -list (GET VAR ${_LEN} max_real_fortran_kind) +list(LENGTH VAR LEN_VAR) +MATH (EXPR _LEN "${LEN_VAR}-1") +list(GET VAR ${_LEN} max_real_fortran_kind) -foreach (KIND ${VAR} ) - set (PROG_SRC +foreach( KIND ${VAR} ) + set(PROG_SRC " PROGRAM main USE ISO_C_BINDING @@ -232,42 +233,42 @@ foreach (KIND ${VAR} ) END " ) - FORTRAN_RUN ("REAL KIND SIZEOF" ${PROG_SRC} + FORTRAN_RUN("REAL KIND SIZEOF" ${PROG_SRC} XX YY PROG_OUTPUT1 ) - string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") - set (pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},") -endforeach () + string(REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") + set(pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},") +endforeach(KIND) if (pack_int_sizeof STREQUAL "") message (FATAL_ERROR "Failed to find available REAL KINDs for Fortran") -endif () +endif() string(STRIP ${pack_real_sizeof} pack_real_sizeof) #Remove trailing comma -string (REGEX REPLACE ",$" "" pack_real_sizeof "${pack_real_sizeof}") +string(REGEX REPLACE ",$" "" pack_real_sizeof "${pack_real_sizeof}") #Remove spaces -string (REGEX REPLACE " " "" pack_real_sizeof "${pack_real_sizeof}") +string(REGEX REPLACE " " "" pack_real_sizeof "${pack_real_sizeof}") -set (H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${pack_real_sizeof}/)") +set(H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${pack_real_sizeof}/)") -message (STATUS "....FOUND SIZEOF for REAL KINDs \{${pack_real_sizeof}\}") +message(STATUS "....FOUND SIZEOF for REAL KINDs \{${pack_real_sizeof}\}") -set (PAC_FC_ALL_REAL_KINDS_SIZEOF "\{${pack_real_sizeof}\}") +set(PAC_FC_ALL_REAL_KINDS_SIZEOF "\{${pack_real_sizeof}\}") #find the maximum kind of the real -string (REGEX REPLACE "," ";" VAR "${pack_real_sizeof}") -list (LENGTH VAR LEN_VAR) -math (EXPR _LEN "${LEN_VAR}-1") -list (GET VAR ${_LEN} max_real_fortran_sizeof) +string(REGEX REPLACE "," ";" VAR "${pack_real_sizeof}") +list(LENGTH VAR LEN_VAR) +MATH (EXPR _LEN "${LEN_VAR}-1") +list(GET VAR ${_LEN} max_real_fortran_sizeof) #----------------------------------------------------------------------------- # Find sizeof of native kinds #----------------------------------------------------------------------------- -FORTRAN_RUN ("SIZEOF NATIVE KINDs" +FORTRAN_RUN("SIZEOF NATIVE KINDs" " PROGRAM main USE ISO_C_BINDING @@ -276,9 +277,9 @@ FORTRAN_RUN ("SIZEOF NATIVE KINDs" REAL b DOUBLE PRECISION c WRITE(*,*) ${FC_SIZEOF_A} - WRITE(*,*) kind(a) - WRITE(*,*) ${FC_SIZEOF_B} - WRITE(*,*) kind(b) + WRITE(*,*) kind(a) + WRITE(*,*) ${FC_SIZEOF_B} + WRITE(*,*) kind(b) WRITE(*,*) ${FC_SIZEOF_C} WRITE(*,*) kind(c) END @@ -296,63 +297,63 @@ FORTRAN_RUN ("SIZEOF NATIVE KINDs" # dnl -- LINE 6 -- kind of DOUBLE PRECISION # Convert the string to a list of strings by replacing the carriage return with a semicolon -string (REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") +string(REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") -list (GET PROG_OUTPUT 0 PAC_FORTRAN_NATIVE_INTEGER_SIZEOF) -list (GET PROG_OUTPUT 1 PAC_FORTRAN_NATIVE_INTEGER_KIND) -list (GET PROG_OUTPUT 2 PAC_FORTRAN_NATIVE_REAL_SIZEOF) -list (GET PROG_OUTPUT 3 PAC_FORTRAN_NATIVE_REAL_KIND) -list (GET PROG_OUTPUT 4 PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF) -list (GET PROG_OUTPUT 5 PAC_FORTRAN_NATIVE_DOUBLE_KIND) +list(GET PROG_OUTPUT 0 PAC_FORTRAN_NATIVE_INTEGER_SIZEOF) +list(GET PROG_OUTPUT 1 PAC_FORTRAN_NATIVE_INTEGER_KIND) +list(GET PROG_OUTPUT 2 PAC_FORTRAN_NATIVE_REAL_SIZEOF) +list(GET PROG_OUTPUT 3 PAC_FORTRAN_NATIVE_REAL_KIND) +list(GET PROG_OUTPUT 4 PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF) +list(GET PROG_OUTPUT 5 PAC_FORTRAN_NATIVE_DOUBLE_KIND) if (NOT PAC_FORTRAN_NATIVE_INTEGER_SIZEOF) message (FATAL_ERROR "Failed to find SIZEOF NATIVE INTEGER KINDs for Fortran") -endif () +endif() if (NOT PAC_FORTRAN_NATIVE_REAL_SIZEOF) message (FATAL_ERROR "Failed to find SIZEOF NATIVE REAL KINDs for Fortran") -endif () +endif() if (NOT PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF) message (FATAL_ERROR "Failed to find SIZEOF NATIVE DOUBLE KINDs for Fortran") -endif () +endif() if (NOT PAC_FORTRAN_NATIVE_INTEGER_KIND) message (FATAL_ERROR "Failed to find KIND of NATIVE INTEGER for Fortran") -endif () +endif() if (NOT PAC_FORTRAN_NATIVE_REAL_KIND) message (FATAL_ERROR "Failed to find KIND of NATIVE REAL for Fortran") -endif () +endif() if (NOT PAC_FORTRAN_NATIVE_DOUBLE_KIND) message (FATAL_ERROR "Failed to find KIND of NATIVE DOUBLE for Fortran") -endif () +endif() -set (FORTRAN_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) -#set (H5_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) +set(FORTRAN_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) +#set(H5_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) # remove the invalid kind from the list -if (NOT(${SIZEOF___FLOAT128} EQUAL 0)) - if (NOT(${SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) - AND NOT(${FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof}) - # account for the fact that the C compiler can have 16-byte __float128 and the fortran compiler only has 8-byte doubles, - # so we don't want to remove the 8-byte fortran doubles. - AND NOT(${PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF} EQUAL ${max_real_fortran_sizeof})) - message (WARNING " +if(NOT(${SIZEOF___FLOAT128} EQUAL 0)) + if(NOT(${SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) + AND NOT(${FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof}) + # account for the fact that the C compiler can have 16-byte __float128 and the fortran compiler only has 8-byte doubles, + # so we don't want to remove the 8-byte fortran doubles. + AND NOT(${PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF} EQUAL ${max_real_fortran_sizeof})) + message(WARNING " Fortran REAL(KIND=${max_real_fortran_kind}) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size !!! Fortran interfaces will not be generated for REAL(KIND=${max_real_fortran_kind}) !!!") - string (REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS ${PAC_FC_ALL_REAL_KINDS}) - string (REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS_SIZEOF ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) - math (EXPR NUM_RKIND "${NUM_RKIND} - 1") - endif () -endif () + string(REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS ${PAC_FC_ALL_REAL_KINDS}) + string(REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS_SIZEOF ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) + MATH (EXPR NUM_RKIND "${NUM_RKIND} - 1") + endif() +endif(NOT(${SIZEOF___FLOAT128} EQUAL 0)) -set (H5CONFIG_F_NUM_RKIND "INTEGER, PARAMETER :: num_rkinds = ${NUM_RKIND}") +set(H5CONFIG_F_NUM_RKIND "INTEGER, PARAMETER :: num_rkinds = ${NUM_RKIND}") -string (REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS}) -string (REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) -set (H5CONFIG_F_RKIND "INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/${OUT_VAR}/)") +string(REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS}) +string(REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) +set(H5CONFIG_F_RKIND "INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/${OUT_VAR}/)") -string (REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) -string (REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) -set (H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${OUT_VAR}/)") +string(REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) +string(REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) +set(H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${OUT_VAR}/)") ENABLE_LANGUAGE (C) @@ -360,14 +361,14 @@ ENABLE_LANGUAGE (C) # The provided CMake C macros don't provide a general compile/run function # so this one is used. #----------------------------------------------------------------------------- -macro (C_RUN FUNCTION CODE RETURN) +MACRO (C_RUN FUNCTION CODE RETURN) message (STATUS "Detecting C ${FUNCTION}") if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - else () + else (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - endif () + endif (CMAKE_REQUIRED_LIBRARIES) file (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c ${CODE} @@ -379,8 +380,8 @@ macro (C_RUN FUNCTION CODE RETURN) RUN_OUTPUT_VARIABLE OUTPUT ) - set (${RETURN} ${OUTPUT}) - + set(${RETURN} ${OUTPUT}) + #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") #message ( "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ") #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") @@ -404,10 +405,10 @@ macro (C_RUN FUNCTION CODE RETURN) endif () else () message (FATAL_ERROR "Compilation of C ${FUNCTION} - Failed") - endif () -endmacro () + endif() +ENDMACRO (C_RUN) -set (PROG_SRC +set(PROG_SRC " #include #include @@ -425,7 +426,7 @@ set (PROG_SRC #define C_FLT128_DIG 0 #endif #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#define C_LDBL_DIG DECIMAL_DIG +#define C_LDBL_DIG DECIMAL_DIG #else #define C_LDBL_DIG LDBL_DIG #endif @@ -434,33 +435,33 @@ set (PROG_SRC return 1\\\; } " -) + ) -C_RUN ("maximum decimal precision for C" ${PROG_SRC} PROG_OUTPUT) +C_RUN("maximum decimal precision for C" ${PROG_SRC} PROG_OUTPUT) # dnl The output from the above program will be: # dnl -- LINE 1 -- long double decimal precision # dnl -- LINE 2 -- __float128 decimal precision # Convert the string to a list of strings by replacing the carriage return with a semicolon -string (REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") +string(REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") -list (GET PROG_OUTPUT 0 LDBL_DIG) -list (GET PROG_OUTPUT 1 FLT128_DIG) +list(GET PROG_OUTPUT 0 LDBL_DIG) +list(GET PROG_OUTPUT 1 FLT128_DIG) -if (SIZEOF___FLOAT128 EQUAL 0 OR FLT128_DIG EQUAL 0) - set (H5_HAVE_FLOAT128 0) - set (SIZEOF___FLOAT128 0) - set (H5_PAC_C_MAX_REAL_PRECISION ${LDBL_DIG}) +if(SIZEOF___FLOAT128 EQUAL 0 OR FLT128_DIG EQUAL 0) + SET(H5_HAVE_FLOAT128 0) + SET(SIZEOF___FLOAT128 0) + set(H5_PAC_C_MAX_REAL_PRECISION ${LDBL_DIG}) else () set(H5_PAC_C_MAX_REAL_PRECISION ${FLT128_DIG}) -endif () +endif() # Setting definition if there is a 16 byte fortran integer -string (FIND ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF} "16" pos) -if (${pos} EQUAL -1) - set (HAVE_Fortran_INTEGER_SIZEOF_16 0) +string(FIND ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF} "16" pos) +if(${pos} EQUAL -1) + set(HAVE_Fortran_INTEGER_SIZEOF_16 0) else () - set (HAVE_Fortran_INTEGER_SIZEOF_16 1) + set(HAVE_Fortran_INTEGER_SIZEOF_16 1) endif () diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index eadff5f..058dd7a 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: @@ -12,98 +12,98 @@ set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) #INSTALLDIR - HDF5 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATIC_ONLY - Default is YES +#STATIC_LIBRARIES - Default is YES #FORTRAN_LIBRARIES - Default is NO #JAVA_LIBRARIES - Default is NO ##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) -if (DEFINED CTEST_SCRIPT_ARG) +if(DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 # to variables with the respective names set to the respective values - string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach (current_var ${script_args}) + string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach(current_var ${script_args}) if ("${current_var}" MATCHES "^([^=]+)=(.+)$") - set ("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif () - endforeach () -endif () -if (NOT DEFINED INSTALLDIR) - set (INSTALLDIR "@CMAKE_INSTALL_PREFIX@") -endif () -if (NOT DEFINED CTEST_CONFIGURATION_TYPE) - set (CTEST_CONFIGURATION_TYPE "Release") -endif () -if (NOT DEFINED CTEST_SOURCE_NAME) - set (CTEST_SOURCE_NAME "HDF5Examples") -endif () -if (NOT DEFINED STATIC_ONLY) - set (STATICONLYLIBRARIES "YES") -else () - set (STATICONLYLIBRARIES "NO") -endif () -if (NOT DEFINED FORTRAN_LIBRARIES) - set (FORTRANLIBRARIES "NO") -else () - set (FORTRANLIBRARIES "YES") -endif () -if (NOT DEFINED JAVA_LIBRARIES) - set (JAVALIBRARIES "NO") -else () - set (JAVALIBRARIES "YES") -endif () -if (NOT DEFINED HDF_LOCAL) - set (CDASH_LOCAL "NO") -else () - set (CDASH_LOCAL "YES") -endif () + set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif() + endforeach() +endif() +if(NOT DEFINED INSTALLDIR) + set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") +endif() +if(NOT DEFINED CTEST_CONFIGURATION_TYPE) + set(CTEST_CONFIGURATION_TYPE "Release") +endif() +if(NOT DEFINED CTEST_SOURCE_NAME) + set(CTEST_SOURCE_NAME "HDF5Examples") +endif() +if(NOT DEFINED STATIC_LIBRARIES) + set(STATICLIBRARIES "YES") +else(NOT DEFINED STATIC_LIBRARIES) + set(STATICLIBRARIES "NO") +endif() +if(NOT DEFINED FORTRAN_LIBRARIES) + set(FORTRANLIBRARIES "NO") +else(NOT DEFINED FORTRAN_LIBRARIES) + set(FORTRANLIBRARIES "YES") +endif() +if(NOT DEFINED JAVA_LIBRARIES) + set(JAVALIBRARIES "NO") +else(NOT DEFINED JAVA_LIBRARIES) + set(JAVALIBRARIES "YES") +endif() +if(NOT DEFINED HDF_LOCAL) + set(CDASH_LOCAL "NO") +else(NOT HDF_LOCAL) + set(CDASH_LOCAL "YES") +endif() if(NOT DEFINED CTEST_SITE) - set (CTEST_SITE "local") -endif () + set(CTEST_SITE "local") +endif() if(NOT DEFINED CTEST_BUILD_NAME) - set (CTEST_BUILD_NAME "examples") -endif () -set (BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") + set(CTEST_BUILD_NAME "examples") +endif() +set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") #TAR_SOURCE - name of tarfile -#if (NOT DEFINED TAR_SOURCE) -# set (CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") -#endif () +#if(NOT DEFINED TAR_SOURCE) +# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") +#endif() ############################################################################################################### # Adjust the following SET Commands as needed ############################################################################################################### -if (WIN32) - if (${STATICONLYLIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif () - set (ENV{HDF5_DIR} "${INSTALLDIR}/cmake") - set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) - set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else () - if (${STATICONLYLIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif () - set (ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") - set (ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") - set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) - set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif () -if (${FORTRANLIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") -else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") -endif () +if(WIN32) + if(${STATICLIBRARIES}) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") + endif() + set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") + set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) + set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") + set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") +else(WIN32) + if(${STATICLIBRARIES}) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + endif() + set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") + set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") + set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) + set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") + set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +endif(WIN32) +if(${FORTRANLIBRARIES}) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") +else() + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") +endif() if(${JAVALIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") -else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") -endif () + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") +else() + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") +endif() if(${CDASH_LOCAL}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") -endif () -set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") +endif() +set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### # For any comments please contact cdashhelp@hdfgroup.org @@ -113,99 +113,99 @@ set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@H #----------------------------------------------------------------------------- # MAC machines need special option #----------------------------------------------------------------------------- -if (APPLE) +if(APPLE) # Compiler choice - execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set (ENV{CC} "${XCODE_CC}") - set (ENV{CXX} "${XCODE_CXX}") - if (NOT NO_MAC_FORTRAN) + execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set(ENV{CC} "${XCODE_CC}") + set(ENV{CXX} "${XCODE_CXX}") + if(NOT NO_MAC_FORTRAN) # Shared fortran is not supported, build static - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif () + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + else() + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") + endif() + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif() #----------------------------------------------------------------------------- -set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") ## -------------------------- -if (CTEST_USE_TAR_SOURCE) +if(CTEST_USE_TAR_SOURCE) ## Uncompress source if tar or zip file provided ## -------------------------- - if (WIN32) - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else () - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif () + if(WIN32) + message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") + execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else() + message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") + execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif() - if (NOT rv EQUAL 0) - message (STATUS "extracting... [error-(${rv}) clean up]") - file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message (FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif () -endif() + if(NOT rv EQUAL 0) + message(STATUS "extracting... [error-(${rv}) clean up]") + file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") + endif() +endif(CTEST_USE_TAR_SOURCE) #----------------------------------------------------------------------------- ## Clear the build directory ## -------------------------- -set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") - ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) + ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) else () - file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") + file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") endif () # Use multiple CPU cores to build -include (ProcessorCount) -ProcessorCount (N) -if (NOT N EQUAL 0) - if (NOT WIN32) - set (CTEST_BUILD_FLAGS -j${N}) - endif () - set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif () +include(ProcessorCount) +ProcessorCount(N) +if(NOT N EQUAL 0) + if(NOT WIN32) + set(CTEST_BUILD_FLAGS -j${N}) + endif() + set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif() set (CTEST_CONFIGURE_COMMAND "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) #----------------------------------------------------------------------------- ## -- set output to english -set ($ENV{LC_MESSAGES} "en_EN") +set($ENV{LC_MESSAGES} "en_EN") #----------------------------------------------------------------------------- -configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) +configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") ## NORMAL process ## -------------------------- ctest_start (Experimental) ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -if (${res} LESS 0 OR ${res} GREATER 0) - file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") -endif () -if (LOCAL_SUBMIT) +if(${res} LESS 0 OR ${res} GREATER 0) + file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") +endif() +if(LOCAL_SUBMIT) ctest_submit (PARTS Configure Notes) -endif () +endif() ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND APPEND RETURN_VALUE res NUMBER_ERRORS errval) -if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) +if(${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") -endif () -if (LOCAL_SUBMIT) +endif() +if(LOCAL_SUBMIT) ctest_submit (PARTS Build) -endif () +endif() ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) -if (${res} LESS 0 OR ${res} GREATER 0) +if(${res} LESS 0 OR ${res} GREATER 0) file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") -endif () -if (LOCAL_SUBMIT) +endif() +if(LOCAL_SUBMIT) ctest_submit (PARTS Test) -endif () -if (${res} LESS 0 OR ${res} GREATER 0) +endif() +if(${res} LESS 0 OR ${res} GREATER 0) message (FATAL_ERROR "tests FAILED") -endif () +endif() #----------------------------------------------------------------------------- ############################################################################################################## -message (STATUS "DONE") +message(STATUS "DONE") \ No newline at end of file diff --git a/config/cmake/HDF5_Process_Flex_Files.cmake b/config/cmake/HDF5_Process_Flex_Files.cmake index 667ad31..2306e93 100644 --- a/config/cmake/HDF5_Process_Flex_Files.cmake +++ b/config/cmake/HDF5_Process_Flex_Files.cmake @@ -49,7 +49,7 @@ if (FILE_PARSE) message (STATUS "processed pragma in ${FILE_PARSE}") file (READ ${GEN_DIR}/${FILE_PARSE}.h TEST_STREAM) file (WRITE ${FILE_PARSE}.h "${TEST_STREAM}") -endif () +endif (FILE_PARSE) if (FILE_ANALYZE) # Add code that disables warnings in the flex/bison-generated code. @@ -81,4 +81,4 @@ if (FILE_ANALYZE) ") file (APPEND ${FILE_ANALYZE} "${TEST_STREAM}") message (STATUS "processed pragma in ${FILE_ANALYZE}") -endif () +endif (FILE_ANALYZE) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 238e363..665db32 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -12,21 +12,21 @@ if (CMAKE_COMPILER_IS_GNUCC) if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") endif () - endif () -endif () -if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + endif (CMAKE_BUILD_TYPE MATCHES Debug) +endif (CMAKE_COMPILER_IS_GNUCC) +if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_BUILD_TYPE MATCHES Debug) set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") endif () - else () + else (CMAKE_BUILD_TYPE MATCHES Debug) set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt") endif () - endif () -endif () + endif (CMAKE_BUILD_TYPE MATCHES Debug) +endif (CMAKE_COMPILER_IS_GNUCXX) #----------------------------------------------------------------------------- # Option to allow the user to disable compiler warnings @@ -41,22 +41,22 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") - endif () + endif (MSVC) if (WIN32) add_definitions (-D_CRT_SECURE_NO_WARNINGS) - endif () + endif (WIN32) # Borland uses -w- to suppress warnings. if (BORLAND) set (HDF5_WARNINGS_BLOCKED 1) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") - endif () + endif (BORLAND) # Most compilers use -w to suppress warnings. if (NOT HDF5_WARNINGS_BLOCKED) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") - endif () -endif () + endif (NOT HDF5_WARNINGS_BLOCKED) +endif (HDF5_DISABLE_COMPILER_WARNINGS) #----------------------------------------------------------------------------- # CDash is configured to only allow 3000 warnings, so @@ -64,22 +64,10 @@ endif () #----------------------------------------------------------------------------- if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - set (CMAKE_C_FLAGS_5 "${CMAKE_C_FLAGS_5} -Wcast-qual") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs") - else () + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline") + else (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP") - endif () - - #----------------------------------------------------------------------------- - # Option to allow the user to enable developer warnings - #----------------------------------------------------------------------------- - option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF) - if (HDF5_ENABLE_DEV_WARNINGS) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Winline -Waggregate-return") - else () - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter -Wno-inline -Wno-aggregate-return") - endif () - + endif (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") # Append warning flags # Don't use the '-Wtraditional' flag, we're way past having K&R C code # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional") @@ -95,102 +83,75 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) set (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute") # Append warning flags from gcc-3.2* case - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wpacked -Wdisabled-optimization") - if (HDF5_ENABLE_DEV_WARNINGS) - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn") - else () - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wno-missing-noreturn") - endif () + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization") # Enable more format checking flags, beyond the basic -Wformat included # in -Wall - set (H5_CFLAGS1_5 "${H5_CFLAGS1_5} -Wformat=2") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2") + + # The "unreachable code" warning appears to be reliable now... + # (this warning was removed in gcc 4.5+) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wunreachable-code") + endif() # Append warning flags from gcc-3.3* case set (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels") # Append warning flags from gcc-3.4* case - set (H5_CFLAGS1 "${H5_CFLAGS1} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") # Append more extra warning flags that only gcc4.0+ know about set (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") # Append more extra warning flags that only gcc 4.1+ know about - set (H5_CFLAGS2_5 "${H5_CFLAGS2_5} -Wunsafe-loop-optimizations") - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wc++-compat") + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat") # Append more extra warning flags that only gcc 4.2+ know about - set (H5_CFLAGS2_5 "${H5_CFLAGS2_5} -Wstrict-overflow") - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-strict-overflow") + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow") # Append more extra warning flags that only gcc 4.3+ know about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wlogical-op -Wlarger-than=2048 -Wvla") + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla") # Append more extra warning flags that only gcc 4.4+ know about - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") # Append more extra warning flags that only gcc 4.5+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) - set (H5_CFLAGS2_5 "${H5_CFLAGS2_5} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wjump-misses-init -Wunsuffixed-float-constants") - endif () + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") + endif() # Append more extra warning flags that only gcc 4.6+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdouble-promotion -Wtrampolines") - if (HDF5_ENABLE_DEV_WARNINGS) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=const") - else () - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=const") - endif () - endif () - - # The "unreachable code" warning appears to be reliable now... - # (this warning was removed in gcc 4.5+) - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wunreachable-code") - endif () + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") + endif() # Append more extra warning flags that only gcc 4.7+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wstack-usage=8192 -Wvector-operation-performance") - if (HDF5_ENABLE_DEV_WARNINGS) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") - else () - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn") - endif () - endif () + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") + endif() # Append more extra warning flags that only gcc 4.8+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8) - if (HDF5_ENABLE_DEV_WARNINGS) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wsuggest-attribute=format") - else () - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wno-suggest-attribute=format") - endif () - endif () + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wsuggest-attribute=format") + endif() # Append more extra warning flags that only gcc 4.9+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) - set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdate-time -Wopenmp-simd") - endif () + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdate-time -Wopenmp-simd") + endif() # (There was no release of gcc 5.0) # Append more extra warning flags that only gcc 5.1+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1) - set (H5_CFLAGS3 "${H5_CFLAGS3} -Warray-bounds=2 -Wc99-c11-compat") - endif () - - # Append more extra warning flags that only gcc 6.x+ know about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) - set (H5_CFLAGS4 "${H5_CFLAGS4} -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa") - endif () + set (H5_CFLAGS6 "${H5_CFLAGS6} -Warray-bounds=2 -Wc99-c11-compat") + endif() -endif () +endif (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) #----------------------------------------------------------------------------- # Option to allow the user to enable all warnings @@ -198,23 +159,16 @@ endif () option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) if (HDF5_ENABLE_ALL_WARNINGS) if (MSVC) - if (HDF5_ENABLE_DEV_WARNINGS) - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /wd4668") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /wd4668") - else () - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") - endif () - else () + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") + else (MSVC) if (CMAKE_COMPILER_IS_GNUCC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2}") - endif () - endif () -endif () + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") + endif (CMAKE_COMPILER_IS_GNUCC) + endif (MSVC) +endif (HDF5_ENABLE_ALL_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -226,12 +180,12 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") - else () + else (MSVC) if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") - endif () - endif () -endif () + endif (CMAKE_COMPILER_IS_GNUCC) + endif (MSVC) +endif (HDF5_ENABLE_GROUPZERO_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -243,10 +197,10 @@ if (HDF5_ENABLE_GROUPONE_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") - else () + else (MSVC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") - endif () -endif () + endif (MSVC) +endif (HDF5_ENABLE_GROUPONE_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -258,10 +212,10 @@ if (HDF5_ENABLE_GROUPTWO_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") - else () + else (MSVC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") - endif () -endif () + endif (MSVC) +endif (HDF5_ENABLE_GROUPTWO_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -273,10 +227,10 @@ if (HDF5_ENABLE_GROUPTHREE_WARNINGS) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") - else () + else (MSVC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") - endif () -endif () + endif (MSVC) +endif (HDF5_ENABLE_GROUPTHREE_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups @@ -285,8 +239,28 @@ option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) if (HDF5_ENABLE_GROUPFOUR_WARNINGS) if (NOT MSVC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") - endif () -endif () + endif (NOT MSVC) +endif (HDF5_ENABLE_GROUPFOUR_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +option (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) +if (HDF5_ENABLE_GROUPFIVE_WARNINGS) + if (NOT MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}") + endif (NOT MSVC) +endif (HDF5_ENABLE_GROUPFIVE_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +option (HDF5_ENABLE_GROUPSIX_WARNINGS "Enable group six warnings" OFF) +if (HDF5_ENABLE_GROUPSIX_WARNINGS) + if (NOT MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS6}") + endif (NOT MSVC) +endif (HDF5_ENABLE_GROUPSIX_WARNINGS) #----------------------------------------------------------------------------- # This is in here to help some of the GCC based IDES like Eclipse @@ -294,7 +268,7 @@ endif () #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") -endif () -if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) +endif (CMAKE_COMPILER_IS_GNUCC) +if (CMAKE_COMPILER_IS_GNUCXX) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") -endif () +endif (CMAKE_COMPILER_IS_GNUCXX) diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index 1d6ef45..7ab3c35 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -43,7 +43,7 @@ To test the installation with the examples; with the CTEST_CONFIGURATION_TYPE script option. Note that this must be the same as the value used with the -C command line option. The default build configuration is defined to build and use static libraries. - Shared libraries can be used with the STATICONLYLIBRARIES script option set to "NO". + Shared libraries can be used with the STATICLIBRARIES script option set to "NO". Other options can be changed by editing the HDF5_Examples.cmake file. If the defaults are okay, execute from this directory: diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake index 3e74d4f..6391c63 100644 --- a/config/cmake/UseJava.cmake +++ b/config/cmake/UseJava.cmake @@ -1250,7 +1250,7 @@ function(create_javadoc _target) else () set(_overview ${_overview}:${_path}) endif () - endforeach () + endforeach() set(_javadoc_options ${_javadoc_options} -overview ${_overview}) endif () diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index 216a014..a54f22c 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -3,14 +3,14 @@ ######################################################## # To use this option, copy both the macro and option code -# into the root UserMacros.cmake file. +# into the root UserMacros.cmake file. # OR add an include to the root UserMacros.cmake file: # INCLUDE(path_to_file/WINDOWS_MT.cmake) #----------------------------------------------------------------------------- # Option to Build with Static CRT libraries on Windows #------------------------------------------------------------------------------- -macro (TARGET_STATIC_CRT_FLAGS) +MACRO (TARGET_STATIC_CRT_FLAGS) if (MSVC AND NOT BUILD_SHARED_LIBS) foreach (flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE @@ -19,22 +19,23 @@ macro (TARGET_STATIC_CRT_FLAGS) CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) if (${flag_var} MATCHES "/MD") string (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - endif () - endforeach () + endif (${flag_var} MATCHES "/MD") + endforeach (flag_var) foreach (flag_var CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO) if (${flag_var} MATCHES "/libs:dll") string (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") - endif () - endforeach () + endif (${flag_var} MATCHES "/libs:dll") + endforeach (flag_var) set (WIN_COMPILE_FLAGS "") set (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - endif () -endmacro () + endif (MSVC AND NOT BUILD_SHARED_LIBS) +ENDMACRO (TARGET_STATIC_CRT_FLAGS) #----------------------------------------------------------------------------- option (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) if (BUILD_STATIC_CRT_LIBS) TARGET_STATIC_CRT_FLAGS () -endif () +endif (BUILD_STATIC_CRT_LIBS) + \ No newline at end of file diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 5901a78..24ae95c 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -42,8 +42,6 @@ set (HDF5_MEMORY_ALLOC_SANITY_CHECK OFF CACHE BOOL "Indicate that internal memor set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) -set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) - set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index ad1b96d..5911fa7 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -12,36 +12,36 @@ set (PACKAGE_VERSION "@HDF5_VERSION_STRING@") if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) set(PACKAGE_VERSION_COMPATIBLE FALSE) -else () +else() if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") - + # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@ if ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - + # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x - set (PACKAGE_VERSION_COMPATIBLE TRUE) - + set (PACKAGE_VERSION_COMPATIBLE TRUE) + if ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") set (PACKAGE_VERSION_EXACT TRUE) - + if ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") # not using this yet - endif () - endif () - else () - set (PACKAGE_VERSION_COMPATIBLE FALSE) - endif () - endif () -endif () + endif ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") + endif ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") + else ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") + set (PACKAGE_VERSION_COMPATIBLE FALSE) + endif ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") + endif ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") +endif() # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") return() -endif () +endif() # check that the installed version has the same 32/64bit-ness as the one which is currently searching: if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif () +endif() diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index 6dffa6c..41fc726 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -50,7 +50,7 @@ if (${HDF5_PACKAGE_NAME}_BUILD_JAVA) ) set (${HDF5_PACKAGE_NAME}_JAVA_LIBRARY "@PACKAGE_CURRENT_BUILD_DIR@/lib") set (${HDF5_PACKAGE_NAME}_JAVA_LIBRARIES "${${HDF5_PACKAGE_NAME}_JAVA_LIBRARY}") -endif () +endif() #----------------------------------------------------------------------------- # Directories diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 0e0106f..59f4c7b 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -5,44 +5,44 @@ cmake_policy(SET CMP0007 NEW) # arguments checking if (NOT TEST_TESTER) message (FATAL_ERROR "Require TEST_TESTER to be defined") -endif () +endif (NOT TEST_TESTER) if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") -endif () +endif (NOT TEST_PROGRAM) if (NOT TEST_LIBRARY_DIRECTORY) message (STATUS "Require TEST_LIBRARY_DIRECTORY to be defined") -endif () +endif (NOT TEST_LIBRARY_DIRECTORY) if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif () +endif (NOT TEST_FOLDER) if (NOT TEST_OUTPUT) message (FATAL_ERROR "Require TEST_OUTPUT to be defined") -endif () +endif (NOT TEST_OUTPUT) if (NOT TEST_CLASSPATH) message (STATUS "Require TEST_CLASSPATH to be defined") -endif () +endif (NOT TEST_CLASSPATH) if (NOT TEST_REFERENCE) message (FATAL_ERROR "Require TEST_REFERENCE to be defined") -endif () +endif (NOT TEST_REFERENCE) if (NOT TEST_ERRREF) if (NOT SKIP_APPEND) # append error file since skip was not defined set (ERROR_APPEND 1) - endif () -endif () + endif(NOT SKIP_APPEND) +endif (NOT TEST_ERRREF) if (NOT TEST_LOG_LEVEL) set (LOG_LEVEL "info") -else () +else (NOT TEST_LOG_LEVEL) set (LOG_LEVEL "${TEST_LOG_LEVEL}") -endif () +endif (NOT TEST_LOG_LEVEL) message (STATUS "COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=${LOG_LEVEL} -Djava.library.path=\"${TEST_LIBRARY_DIRECTORY}\" -cp \"${TEST_CLASSPATH}\" ${TEST_ARGS} ${TEST_PROGRAM} ${ARGN}") if (WIN32 AND NOT MINGW) set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}") -endif () +endif (WIN32 AND NOT MINGW) # run the test program, capture the stdout/stderr and the result var execute_process ( @@ -64,25 +64,25 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) if (TEST_MASK_FILE) STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}") - endif () + endif (TEST_MASK_FILE) if (NOT ERROR_APPEND) # append error output to the stdout output file file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") - else () + else (NOT ERROR_APPEND) # write back to original .err file file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") - endif () -endif () + endif (NOT ERROR_APPEND) +endif (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) if (TEST_MASK_ERROR) if (NOT TEST_ERRREF) # the error stack has been appended to the output file file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - else () + else (NOT TEST_ERRREF) # the error stack remains in the .err file file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - endif () + endif (NOT TEST_ERRREF) string (REGEX REPLACE "Time:[^\n]+\n" "Time: XXXX\n" TEST_STREAM "${TEST_STREAM}") string (REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") string (REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") @@ -94,16 +94,16 @@ if (TEST_MASK_ERROR) # write back the changes to the original files if (NOT TEST_ERRREF) file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") - else () + else (NOT TEST_ERRREF) file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") - endif () -endif () + endif (NOT TEST_ERRREF) +endif (TEST_MASK_ERROR) # if the return value is !=0 bail out if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) message (STATUS "ERROR OUTPUT: ${TEST_STREAM}") message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != 0.\n${TEST_ERROR}") -endif () +endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) message (STATUS "COMMAND Error: ${TEST_ERROR}") @@ -112,7 +112,7 @@ if (NOT TEST_SKIP_COMPARE) if (WIN32 AND NOT MINGW) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") - endif () + endif (WIN32 AND NOT MINGW) # now compare the output with the reference execute_process ( @@ -120,42 +120,42 @@ if (NOT TEST_SKIP_COMPARE) RESULT_VARIABLE TEST_RESULT ) if (NOT ${TEST_RESULT} STREQUAL 0) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) - list (LENGTH test_ref len_ref) - if (NOT ${len_act} STREQUAL "0") - math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") - set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - endif () - endif () - endforeach () - endif () - if (NOT ${len_act} STREQUAL ${len_ref}) - set (TEST_RESULT 1) - endif () - endif () + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) + list (LENGTH test_ref len_ref) + if (NOT ${len_act} STREQUAL "0") + MATH (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout if (NOT ${TEST_RESULT} STREQUAL 0) message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") - endif () + endif (NOT ${TEST_RESULT} STREQUAL 0) # now compare the .err file with the error reference, if supplied if (TEST_ERRREF) if (WIN32 AND NOT MINGW) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") - endif () + endif (WIN32 AND NOT MINGW) # now compare the error output with the error reference execute_process ( @@ -163,38 +163,38 @@ if (NOT TEST_SKIP_COMPARE) RESULT_VARIABLE TEST_RESULT ) if (NOT ${TEST_RESULT} STREQUAL 0) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) - list (LENGTH test_ref len_ref) - math (EXPR _FP_LEN "${len_ref} - 1") - if (NOT ${len_act} STREQUAL "0") - math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") - set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - endif () - endif () - endforeach () - endif () - if (NOT ${len_act} STREQUAL ${len_ref}) - set (TEST_RESULT 1) - endif () - endif () + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) + list (LENGTH test_ref len_ref) + MATH (EXPR _FP_LEN "${len_ref} - 1") + if (NOT ${len_act} STREQUAL "0") + MATH (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout if (NOT ${TEST_RESULT} STREQUAL 0) message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") - endif () - endif () -endif () + endif (NOT ${TEST_RESULT} STREQUAL 0) + endif (TEST_ERRREF) +endif (NOT TEST_SKIP_COMPARE) if (TEST_GREP_COMPARE) # now grep the output with the reference @@ -205,7 +205,7 @@ if (TEST_GREP_COMPARE) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) if (${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") - endif () + endif (${TEST_RESULT} STREQUAL "0") string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) if (${TEST_EXPECT} STREQUAL "1") @@ -213,9 +213,9 @@ if (TEST_GREP_COMPARE) string (LENGTH "${TEST_MATCH}" TEST_RESULT) if (NOT ${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") - endif () - endif () -endif () + endif (NOT ${TEST_RESULT} STREQUAL "0") + endif (${TEST_EXPECT} STREQUAL "0") +endif (TEST_GREP_COMPARE) # everything went fine... message ("${TEST_PROGRAM} Passed") diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index dca9631..f2675c3 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) ######################################################## # This dashboard is maintained by The HDF Group # For any comments please contact cdashhelp@hdfgroup.org @@ -7,204 +7,225 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) # ----------------------------------------------------------- # -- Get environment # ----------------------------------------------------------- -if (NOT SITE_OS_NAME) +if(NOT SITE_OS_NAME) ## machine name not provided - attempt to discover with uname ## -- set hostname ## -------------------------- - find_program (HOSTNAME_CMD NAMES hostname) - exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) - set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") - find_program (UNAME NAMES uname) - macro (getuname name flag) - exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") - endmacro () + find_program(HOSTNAME_CMD NAMES hostname) + exec_program(${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) + set(CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") + find_program(UNAME NAMES uname) + macro(getuname name flag) + exec_program("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") + endmacro(getuname) - getuname (osname -s) - getuname (osrel -r) - getuname (cpu -m) - message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") + getuname(osname -s) + getuname(osrel -r) + getuname(cpu -m) + message(STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") - set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") - if (SITE_BUILDNAME_SUFFIX) - set (CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}") - endif () - set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") -else () + set(CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") + if(USE_AUTOTOOLS) + set(CTEST_BUILD_NAME "AT-${CTEST_BUILD_NAME}") + endif() + if(SITE_BUILDNAME_SUFFIX) + set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") + endif() + set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") +else(NOT SITE_OS_NAME) ## machine name provided ## -------------------------- - if (CMAKE_HOST_UNIX) + if(CMAKE_HOST_UNIX) set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}") - else () + else() set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") - endif () - if (SITE_BUILDNAME_SUFFIX) + endif() + if(SITE_BUILDNAME_SUFFIX) set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") - endif () - set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") -endif () + endif() + set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") +endif(NOT SITE_OS_NAME) #----------------------------------------------------------------------------- # MAC machines need special option #----------------------------------------------------------------------------- -if (APPLE) +if(APPLE) # Compiler choice - execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set (ENV{CC} "${XCODE_CC}") - set (ENV{CXX} "${XCODE_CXX}") + execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set(ENV{CC} "${XCODE_CC}") + set(ENV{CXX} "${XCODE_CXX}") - if (NOT NO_MAC_FORTRAN) - # Shared fortran is not supported, build static - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - endif () + if(NOT NO_MAC_FORTRAN) + # Shared fortran is not supported, build static + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + else(NOT NO_MAC_FORTRAN) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + endif(NOT NO_MAC_FORTRAN) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif () + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif(APPLE) #----------------------------------------------------------------------------- -set (NEED_REPOSITORY_CHECKOUT 0) -set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -if (CTEST_USE_TAR_SOURCE) +set(NEED_REPOSITORY_CHECKOUT 0) +set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +if(CTEST_USE_TAR_SOURCE) ## Uncompress source if tar file provided ## -------------------------- - if (WIN32) - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else () - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif () + if(WIN32) + message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_USE_TAR_SOURCE}.zip]") + execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else() + message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") + execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif() - if (NOT rv EQUAL 0) - message (STATUS "extracting... [error-(${rv}) clean up]") - file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message (FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") - endif () + if(NOT rv EQUAL 0) + message(STATUS "extracting... [error-(${rv}) clean up]") + file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message(FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") + endif() - file (RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) - set (LOCAL_SKIP_UPDATE "TRUE") -else () - if (LOCAL_UPDATE) - if (CTEST_USE_GIT_SOURCE) - find_program (CTEST_GIT_COMMAND NAMES git git.cmd) - set (CTEST_GIT_UPDATE_OPTIONS) + file(RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) + set(LOCAL_SKIP_UPDATE "TRUE") +else(CTEST_USE_TAR_SOURCE) + if(LOCAL_UPDATE) + if(CTEST_USE_GIT_SOURCE) + find_program(CTEST_GIT_COMMAND NAMES git git.cmd) + set(CTEST_GIT_UPDATE_OPTIONS) - if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") - set (NEED_REPOSITORY_CHECKOUT 1) - endif () + if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set(NEED_REPOSITORY_CHECKOUT 1) + endif() - if (${NEED_REPOSITORY_CHECKOUT}) - if (REPOSITORY_BRANCH) - set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" --single-branch \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") - else () - set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") - endif () - set (CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${CTEST_GIT_options}") - else () - set (CTEST_GIT_options "pull") - endif () - set (CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}") - else () + if(${NEED_REPOSITORY_CHECKOUT}) + if(REPOSITORY_BRANCH) + set(CTEST_GIT_options "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" --single-branch \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") + else() + set(CTEST_GIT_options "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") + endif() + set(CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${CTEST_GIT_options}") + else() + set(CTEST_GIT_options "pull") + endif() + set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}") + else(CTEST_USE_GIT_SOURCE) ## -------------------------- ## use subversion to get source #----------------------------------------------------------------------------- ## cygwin does not handle the find_package() call ## -------------------------- - set (CTEST_UPDATE_COMMAND "SVNCommand") - if (NOT SITE_CYGWIN}) + set(CTEST_UPDATE_COMMAND "SVNCommand") + if(NOT SITE_CYGWIN}) find_package (Subversion) - set (CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}") - set (CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") - else () - set (CTEST_SVN_COMMAND "/usr/bin/svn") - set (CTEST_UPDATE_COMMAND "/usr/bin/svn") - endif () + set(CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}") + set(CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") + else() + set(CTEST_SVN_COMMAND "/usr/bin/svn") + set(CTEST_UPDATE_COMMAND "/usr/bin/svn") + endif() - if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") - set (NEED_REPOSITORY_CHECKOUT 1) - endif () + if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set(NEED_REPOSITORY_CHECKOUT 1) + endif() - if (NOT CTEST_REPO_VERSION) - set (CTEST_REPO_VERSION "HEAD") - endif () - if (${NEED_REPOSITORY_CHECKOUT}) - set (CTEST_CHECKOUT_COMMAND + if(NOT CTEST_REPO_VERSION) + set(CTEST_REPO_VERSION "HEAD") + endif() + if(${NEED_REPOSITORY_CHECKOUT}) + set(CTEST_CHECKOUT_COMMAND "\"${CTEST_SVN_COMMAND}\" co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r ${CTEST_REPO_VERSION}") - else () - if (CTEST_REPO_VERSION) - set (CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}") - endif () - endif () - endif () - endif () -endif () + else() + if(CTEST_REPO_VERSION) + set(CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}") + endif() + endif() + endif(CTEST_USE_GIT_SOURCE) + endif(LOCAL_UPDATE) +endif(CTEST_USE_TAR_SOURCE) #----------------------------------------------------------------------------- ## Clear the build directory ## -------------------------- -set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) -if (NOT EXISTS "${CTEST_BINARY_DIRECTORY}") - file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") -else () - ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) -endif () +set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +if(NOT EXISTS "${CTEST_BINARY_DIRECTORY}") + file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +else() + ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) +endif() # Use multiple CPU cores to build -include (ProcessorCount) -ProcessorCount (N) -if (NOT N EQUAL 0) - if (NOT WIN32) - set (CTEST_BUILD_FLAGS -j${N}) - endif () - set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif () +include(ProcessorCount) +ProcessorCount(N) +if(NOT N EQUAL 0) + if(NOT WIN32) + set(CTEST_BUILD_FLAGS -j${N}) + endif() + set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif() #----------------------------------------------------------------------------- # Send the main script as a note. -list (APPEND CTEST_NOTES_FILES - "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" - "${CMAKE_CURRENT_LIST_FILE}" - "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" -) +if(USE_AUTOTOOLS) + ## autotools builds need to use make and does not use the cacheinit.cmake file + ## -- make command + ## ----------------- + find_program(MAKE NAMES make) + list(APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + ) +else() + list(APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" + ) +endif() #----------------------------------------------------------------------------- # Check for required variables. # -------------------------- -foreach (req +foreach(req CTEST_CMAKE_GENERATOR CTEST_SITE CTEST_BUILD_NAME ) - if (NOT DEFINED ${req}) - message (FATAL_ERROR "The containing script must set ${req}") - endif () -endforeach () + if(NOT DEFINED ${req}) + message(FATAL_ERROR "The containing script must set ${req}") + endif() +endforeach(req) #----------------------------------------------------------------------------- # Initialize the CTEST commands #------------------------------ -if (LOCAL_MEMCHECK_TEST) - find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind) - set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" - ) -else () - if (LOCAL_COVERAGE_TEST) - find_program (CTEST_COVERAGE_COMMAND NAMES gcov) - endif () - set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" - ) -endif () - +if(USE_AUTOTOOLS) + set(CTEST_CONFIGURE_COMMAND "${CTEST_SOURCE_DIRECTORY}/configure ${ADD_BUILD_OPTIONS}") + set(CTEST_BUILD_COMMAND "${MAKE} ${CTEST_BUILD_FLAGS}") + configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) + file(WRITE ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake "ADD_TEST(makecheck \"${MAKE}\" \"${CTEST_BUILD_FLAGS}\" \"-i\" \"check\")") +else(USE_AUTOTOOLS) + if(LOCAL_MEMCHECK_TEST) + find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) + else() + if(LOCAL_COVERAGE_TEST) + find_program(CTEST_COVERAGE_COMMAND NAMES gcov) + endif() + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) + endif() +endif() + #----------------------------------------------------------------------------- ## -- set output to english -set ($ENV{LC_MESSAGES} "en_EN") +set($ENV{LC_MESSAGES} "en_EN") # Print summary information. -foreach (v +foreach(v CTEST_SITE CTEST_BUILD_NAME CTEST_SOURCE_DIRECTORY @@ -217,9 +238,9 @@ foreach (v CTEST_SCRIPT_DIRECTORY CTEST_USE_LAUNCHERS ) - set (vars "${vars} ${v}=[${${v}}]\n") -endforeach () -message (STATUS "Dashboard script configuration:\n${vars}\n") + set(vars "${vars} ${v}=[${${v}}]\n") +endforeach(v) +message(STATUS "Dashboard script configuration:\n${vars}\n") #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- @@ -231,63 +252,63 @@ message (STATUS "Dashboard script configuration:\n${vars}\n") ## -- LOCAL_COVERAGE_TEST executes code coverage process ## -------------------------- ctest_start (${MODEL} TRACK ${MODEL}) - if (LOCAL_UPDATE) + if(LOCAL_UPDATE) ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}") - endif () - configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) + endif() + configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - if (LOCAL_SUBMIT) + if(LOCAL_SUBMIT) ctest_submit (PARTS Update Configure Notes) - endif () - if (${res} LESS 0 OR ${res} GREATER 0) - file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") - endif () + endif() + if(${res} LESS 0 OR ${res} GREATER 0) + file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") + endif() ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval) - if (LOCAL_SUBMIT) + if(LOCAL_SUBMIT) ctest_submit (PARTS Build) - endif () - if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) - file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") - endif () + endif() + if(${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) + file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") + endif() - if (NOT LOCAL_SKIP_TEST) - if (NOT LOCAL_MEMCHECK_TEST) + if(NOT LOCAL_SKIP_TEST) + if(NOT LOCAL_MEMCHECK_TEST) ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) - if (LOCAL_SUBMIT) + if(LOCAL_SUBMIT) ctest_submit (PARTS Test) - endif () - if (${res} LESS 0 OR ${res} GREATER 0) - file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") - endif () - else () + endif() + if(${res} LESS 0 OR ${res} GREATER 0) + file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") + endif() + else() ctest_memcheck (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) - if (LOCAL_SUBMIT) + if(LOCAL_SUBMIT) ctest_submit (PARTS MemCheck) - endif () - endif () - if (LOCAL_COVERAGE_TEST) + endif() + endif() + if(LOCAL_COVERAGE_TEST) ctest_coverage (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) - if (LOCAL_SUBMIT) + if(LOCAL_SUBMIT) ctest_submit (PARTS Coverage) - endif () - endif () - endif () + endif() + endif() + endif(NOT LOCAL_SKIP_TEST) - if (NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE AND NOT LOCAL_SKIP_BUILD) + if(NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE AND NOT LOCAL_SKIP_BUILD) ##----------------------------------------------- ## Package the product ##----------------------------------------------- - execute_process (COMMAND cpack -C ${CTEST_CONFIGURATION_TYPE} -V + execute_process(COMMAND cpack -C ${CTEST_CONFIGURATION_TYPE} -V WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} RESULT_VARIABLE cpackResult OUTPUT_VARIABLE cpackLog ERROR_VARIABLE cpackLog.err ) - file (WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") - if (cpackResult GREATER 0) - file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed packaging: ${cpackResult}:${cpackLog.err} \n") - endif () - endif () + file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") + if(cpackResult GREATER 0) + file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed packaging: ${cpackResult}:${cpackLog.err} \n") + endif() + endif() #----------------------------------------------------------------------------- diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 55fecfb..2b1b097 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -1,10 +1,10 @@ ############################################################################################# ### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### ### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ### -### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -VV -O hdf5.log ### +### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf5.log ### ############################################################################################# -cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) ############################################################################ # Usage: # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log @@ -21,13 +21,13 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) # INSTALLDIR - root folder where hdf5 is installed # CTEST_CONFIGURATION_TYPE - Release, Debug, etc # CTEST_SOURCE_NAME - source folder -# STATIC_ONLY - Build/use static libraries +# STATIC_LIBRARIES - Build/use static libraries # FORTRAN_LIBRARIES - Build/use fortran libraries # JAVA_LIBRARIES - Build/use java libraries # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## -set(CTEST_SOURCE_VERSION 1.10.1) +set(CTEST_SOURCE_VERSION 1.10.0) set(CTEST_SOURCE_VERSEXT "") ############################################################################## @@ -36,7 +36,7 @@ set(CTEST_SOURCE_VERSEXT "") #INSTALLDIR - HDF5-1.10.0 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0 -#STATIC_ONLY - Default is YES +#STATIC_LIBRARIES - Default is YES #FORTRAN_LIBRARIES - Default is NO #JAVA_LIBRARIES - Default is NO #NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac @@ -48,14 +48,14 @@ if(DEFINED CTEST_SCRIPT_ARG) foreach(current_var ${script_args}) if ("${current_var}" MATCHES "^([^=]+)=(.+)$") set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif () - endforeach () -endif () + endif() + endforeach() +endif() # build generator must be defined if(NOT DEFINED BUILD_GENERATOR) message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") -else () +else() if(${BUILD_GENERATOR} STREQUAL "Unix") set(CTEST_CMAKE_GENERATOR "Unix Makefiles") elseif(${BUILD_GENERATOR} STREQUAL "VS2015") @@ -70,10 +70,10 @@ else () set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") elseif(${BUILD_GENERATOR} STREQUAL "VS201264") set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - else () + else() message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") - endif () -endif () + endif() +endif() ################################################################### ### Following Line is one of [Release, RelWithDebInfo, Debug] ##### @@ -83,41 +83,41 @@ set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") if(NOT DEFINED INSTALLDIR) if(WIN32) set(INSTALLDIR "C:/Program Files/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") - else () + else() set(INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") - endif () -endif () + endif() +endif() if(NOT DEFINED CTEST_CONFIGURATION_TYPE) set(CTEST_CONFIGURATION_TYPE "Release") -endif () +endif() if(NOT DEFINED CTEST_SOURCE_NAME) set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") -endif () -if(NOT DEFINED STATIC_ONLY) - set(STATICONLYLIBRARIES "YES") -else () - set(STATICONLYLIBRARIES "NO") -endif () +endif() +if(NOT DEFINED STATIC_LIBRARIES) + set(STATICLIBRARIES "YES") +else() + set(STATICLIBRARIES "NO") +endif() if(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "NO") -else () +else() set(FORTRANLIBRARIES "YES") -endif () +endif() if(NOT DEFINED JAVA_LIBRARIES) set(JAVALIBRARIES "NO") -else () +else() set(JAVALIBRARIES "YES") -endif () +endif() set(CTEST_BINARY_NAME "build") set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") if(WIN32) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else () +else() set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif () +endif() ################################################################### ######### Following describes compiler ############ @@ -148,33 +148,17 @@ if(WIN32) set(SITE_OS_BITS "32") set(SITE_COMPILER_NAME "vs2012") set(SITE_COMPILER_VERSION "11") - endif () + endif() ## Set the following to unique id your computer ## set(CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") -else () - set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +else() ## Set the following to unique id your computer ## if(APPLE) set(CTEST_SITE "MAC.XXXX") - else () + else() set(CTEST_SITE "LINUX.XXXX") - endif () - if(APPLE) - execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set(ENV{CC} "${XCODE_CC}") - set(ENV{CXX} "${XCODE_CXX}") - set(CTEST_USE_LAUNCHERS 1) - set(RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") - set(RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") - set(RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") - set(RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") - set(RR_FLAGS_C "${RR_FLAGS_COMMON}") - set(RR_FLAGS_CXX "${RR_FLAGS_COMMON}") - set(ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") - set(ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") - endif () -endif () + endif() +endif() ################################################################### ################################################################### @@ -194,86 +178,103 @@ set(MODEL "Experimental") #set(LOCAL_NO_PACKAGE "TRUE") ##### Following controls source update ##### #set(LOCAL_UPDATE "TRUE") -set(REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") -set(REPOSITORY_BRANCH "develop") - +set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/trunk") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows #set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") ################################################################### ################################################################### -if(${STATICONLYLIBRARIES}) +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") + +################################################################### +if(${STATICLIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") ######### Following describes computer ############ ## following is optional to describe build ## set(SITE_BUILDNAME_SUFFIX "STATIC") -endif () +endif() ################################################################### + +### uncomment/comment and change the following lines for other configuration options + +#### ext libraries #### +### ext libs from tgz +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}") +### ext libs from svn +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=SVN") +### ext libs on system +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") +### disable ext libs building +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") #### fortran #### if(${FORTRANLIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") - ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") -else () +else() set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") -endif () +endif() #### java #### if(${JAVALIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") -else () +else() set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") -endif () +endif() + +### disable test program builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") + +### disable packaging +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") +### Create install package with external libraries (szip, zlib, jpeg) +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") ### change install prefix -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}") +set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") +set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}") ################################################################### if(WIN32) - set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}") - include(${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake) include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe") - file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi") - file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip") - file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () -else () - set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") - include(${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake) + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() +else() include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) if(APPLE) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - else () + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + else() if(CYGWIN) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - else () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - endif () - endif () -endif () + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + else() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + endif() + endif() +endif() diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 5095b33..0775cbe 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -4,28 +4,28 @@ # arguments checking if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM tellub to be defined") -endif () +endif (NOT TEST_PROGRAM) if (NOT TEST_GET_PROGRAM) message (FATAL_ERROR "Require TEST_GET_PROGRAM getub to be defined") -endif () +endif (NOT TEST_GET_PROGRAM) if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif () +endif (NOT TEST_FOLDER) if (NOT TEST_HFILE) message (FATAL_ERROR "Require TEST_HFILE the hdf file to be defined") -endif () +endif (NOT TEST_HFILE) if (NOT TEST_UFILE) message (FATAL_ERROR "Require TEST_UFILE the ub file to be defined") -endif () +endif (NOT TEST_UFILE) if (NOT TEST_CHECKUB) message (STATUS "Require TEST_CHECKUB - YES or NO - to be defined") -endif () +endif (NOT TEST_CHECKUB) #if (NOT TEST_EXPECT) # message (STATUS "Require TEST_EXPECT to be defined") -#endif () +#endif (NOT TEST_EXPECT) #if (NOT TEST_OFILE) # message (FATAL_ERROR "Require TEST_OFILE the original hdf file to be defined") -#endif () +#endif (NOT TEST_OFILE) set (TEST_U_STRING_LEN 0) set (TEST_O_STRING_LEN 0) @@ -53,11 +53,11 @@ if (TEST_CHECKUB STREQUAL "YES") ) if (NOT ${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") - endif () + endif (NOT ${TEST_RESULT} STREQUAL "0") file (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) - endif () + endif (TEST_OFILE) - math( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) + MATH( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) if (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $s2 $origfile > $cmpfile @@ -73,10 +73,10 @@ if (TEST_CHECKUB STREQUAL "YES") #cat $ufile >> $cmpfile file (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) file (APPEND ${TEST_HFILE}-ub.cmp "${TEST_STREAM}") - else () + else (NOT TEST_O_STRING_LEN STREQUAL "0") file (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) file (WRITE ${TEST_HFILE}-ub.cmp ${TEST_STREAM}) - endif () + endif (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $size $hfile > $tfile EXECUTE_PROCESS ( @@ -99,8 +99,8 @@ if (TEST_CHECKUB STREQUAL "YES") # if the return value is !=${TEST_EXPECT} bail out if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) message (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") - endif () -else () + endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +else (TEST_CHECKUB STREQUAL "YES") # call 'ubsize' to get the size of the user block #ubsize=`$JAM_BIN/tellub $hfile` EXECUTE_PROCESS ( @@ -112,8 +112,8 @@ else () ) if (NOT TEST_H_STRING_LEN STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") - endif () -endif () + endif (NOT TEST_H_STRING_LEN STREQUAL "0") +endif (TEST_CHECKUB STREQUAL "YES") # everything went fine... message ("Passed: The output of CHECK matched expectation") diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index c9b4ecc..10f0a7b 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -4,36 +4,29 @@ # arguments checking if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") -endif () +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif () +endif (NOT TEST_FOLDER) if (NOT TEST_VFD) message (FATAL_ERROR "Require TEST_VFD to be defined") -endif () +endif (NOT TEST_VFD) -if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) - file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) -endif () - -if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) - file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) -endif () - -# if there is not an error reference file add the error output to the stdout file -if (NOT TEST_ERRREF) - set (ERROR_APPEND 1) -endif () +set (ERROR_APPEND 1) message (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") set (ENV{HDF5_DRIVER} "${TEST_VFD}") - # run the test program, capture the stdout/stderr and the result var -execute_process ( +EXECUTE_PROCESS ( COMMAND ${TEST_PROGRAM} ${TEST_ARGS} WORKING_DIRECTORY ${TEST_FOLDER} - RESULT_VARIABLE TEST_RESULT OUTPUT_FILE ${TEST_OUTPUT}_${TEST_VFD}.out ERROR_FILE ${TEST_OUTPUT}_${TEST_VFD}.err OUTPUT_VARIABLE TEST_OUT @@ -42,24 +35,16 @@ execute_process ( message (STATUS "COMMAND Result: ${TEST_RESULT}") -# if the .err file exists and ERRROR_APPEND is enabled if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err TEST_STREAM) file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out "${TEST_STREAM}") -endif () +endif (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err) # if the return value is !=${TEST_EXPECT} bail out if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - if (NOT TEST_NOERRDISPLAY) - if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM) - message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}") - endif () - endif () - message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") -endif () - -message (STATUS "COMMAND Error: ${TEST_ERROR}") + message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) # everything went fine... message ("Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") + diff --git a/config/cmake_ext_mod/CheckTypeSize.cmake b/config/cmake_ext_mod/CheckTypeSize.cmake index d217ac5..5095a27 100644 --- a/config/cmake_ext_mod/CheckTypeSize.cmake +++ b/config/cmake_ext_mod/CheckTypeSize.cmake @@ -7,24 +7,24 @@ # HAVE_${VARIABLE} - does the variable exists or not # -macro (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) +MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) if ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") - set (MACRO_CHECK_TYPE_SIZE_FLAGS + set (MACRO_CHECK_TYPE_SIZE_FLAGS "-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}" ) foreach (def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H HAVE_INTTYPES_H) if ("${def}") set (MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}") - endif () - endforeach () + endif ("${def}") + endforeach (def) message (STATUS "Check size of ${TYPE}") if (CMAKE_REQUIRED_LIBRARIES) - set (CHECK_TYPE_SIZE_ADD_LIBRARIES + set (CHECK_TYPE_SIZE_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" ) - endif () + endif (CMAKE_REQUIRED_LIBRARIES) try_run (${VARIABLE} HAVE_${VARIABLE} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/CheckTypeSize.c @@ -35,16 +35,16 @@ macro (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) if (HAVE_${VARIABLE}) message (STATUS "Check size of ${TYPE} - done") file (APPEND - ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n" ) - else () + else (HAVE_${VARIABLE}) message (STATUS "Check size of ${TYPE} - failed") file (APPEND - ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\n\n" ) - endif () - endif () + endif (HAVE_${VARIABLE}) + endif ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) -endmacro () +ENDMACRO (HDF_CHECK_TYPE_SIZE) diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 2e99c94..5a14990 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -11,9 +11,9 @@ include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) include (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) include (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) -if (CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER_LOADED) +if(CMAKE_CXX_COMPILER) include (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake) -endif () +endif(CMAKE_CXX_COMPILER) #----------------------------------------------------------------------------- # APPLE/Darwin setup @@ -28,29 +28,29 @@ if (APPLE) "variable has been set to a blank value which will build the default architecture for this system.") endif () set (${HDF_PREFIX}_AC_APPLE_UNIVERSAL_BUILD 0) -endif () +endif (APPLE) # Check for Darwin (not just Apple - we also want to catch OpenDarwin) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set (${HDF_PREFIX}_HAVE_DARWIN 1) -endif () +endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Check for Solaris if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") set (${HDF_PREFIX}_HAVE_SOLARIS 1) -endif () +endif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") #----------------------------------------------------------------------------- # This MACRO checks IF the symbol exists in the library and IF it # does, it appends library to the list. #----------------------------------------------------------------------------- set (LINK_LIBS "") -macro (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) +MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE}) if (${VARIABLE}) set (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) - endif () -endmacro () + endif (${VARIABLE}) +ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) # ---------------------------------------------------------------------- # WINDOWS Hard code Values @@ -62,7 +62,7 @@ if (WIN32) set (${HDF_PREFIX}_HAVE_MINGW 1) set (WINDOWS 1) # MinGW tries to imitate Windows set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") - endif () + endif (MINGW) set (${HDF_PREFIX}_HAVE_WIN32_API 1) set (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") if (NOT UNIX AND NOT MINGW) @@ -70,9 +70,9 @@ if (WIN32) set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") if (MSVC) set (${HDF_PREFIX}_HAVE_VISUAL_STUDIO 1) - endif () - endif () -endif () + endif (MSVC) + endif (NOT UNIX AND NOT MINGW) +endif (WIN32) if (WINDOWS) set (${HDF_PREFIX}_HAVE_STDDEF_H 1) @@ -84,20 +84,20 @@ if (WINDOWS) set (${HDF_PREFIX}_HAVE_LONGJMP 1) if (NOT MINGW) set (${HDF_PREFIX}_HAVE_GETHOSTNAME 1) - endif () + endif (NOT MINGW) if (NOT UNIX AND NOT CYGWIN AND NOT MINGW) set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1) - endif () + endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW) set (${HDF_PREFIX}_HAVE_FUNCTION 1) set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1) set (${HDF_PREFIX}_HAVE_TIMEZONE 1) set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1) if (MINGW) set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1) - endif () + endif (MINGW) set (${HDF_PREFIX}_HAVE_LIBWS2_32 1) set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1) -endif () +endif (WINDOWS) # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values @@ -105,7 +105,7 @@ endif () if (CYGWIN) set (${HDF_PREFIX}_HAVE_LSEEK64 0) -endif () +endif (CYGWIN) #----------------------------------------------------------------------------- # Check for the math library "m" @@ -115,7 +115,7 @@ if (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen ${HDF_PREFIX}_HAVE_LIBDL) CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup ${HDF_PREFIX}_HAVE_LIBWS2_32) CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname ${HDF_PREFIX}_HAVE_LIBWSOCK32) -endif () +endif (NOT WINDOWS) # UCB (BSD) compatibility library CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname ${HDF_PREFIX}_HAVE_LIBUCB) @@ -126,20 +126,20 @@ set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) set (USE_INCLUDES "") if (WINDOWS) set (USE_INCLUDES ${USE_INCLUDES} "windows.h") -endif () +endif (WINDOWS) if (NOT WINDOWS) TEST_BIG_ENDIAN (${HDF_PREFIX}_WORDS_BIGENDIAN) -endif () +endif (NOT WINDOWS) # For other specific tests, use this MACRO. -macro (HDF_FUNCTION_TEST OTHER_TEST) +MACRO (HDF_FUNCTION_TEST OTHER_TEST) if ("${HDF_PREFIX}_${OTHER_TEST}" MATCHES "^${HDF_PREFIX}_${OTHER_TEST}$") set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") set (OTHER_TEST_ADD_LIBRARIES) if (CMAKE_REQUIRED_LIBRARIES) set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - endif () + endif (CMAKE_REQUIRED_LIBRARIES) foreach (def HAVE_SYS_TIME_H @@ -149,14 +149,14 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) ) if ("${${HDF_PREFIX}_${def}}") set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") - endif () - endforeach () + endif ("${${HDF_PREFIX}_${def}}") + endforeach (def) if (LARGEFILE) set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - endif () + endif (LARGEFILE) #message (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} @@ -169,16 +169,16 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) if (${OTHER_TEST}) set (${HDF_PREFIX}_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") message (STATUS "Performing Other Test ${OTHER_TEST} - Success") - else () + else (${OTHER_TEST}) message (STATUS "Performing Other Test ${OTHER_TEST} - Failed") set (${HDF_PREFIX}_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing Other Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) - endif () - endif () -endmacro () + endif (${OTHER_TEST}) + endif ("${HDF_PREFIX}_${OTHER_TEST}" MATCHES "^${HDF_PREFIX}_${OTHER_TEST}$") +ENDMACRO (HDF_FUNCTION_TEST) #----------------------------------------------------------------------------- # Check for these functions before the time headers are checked @@ -188,12 +188,12 @@ HDF_FUNCTION_TEST (STDC_HEADERS) #----------------------------------------------------------------------------- # Check IF header file exists and add it to the list. #----------------------------------------------------------------------------- -macro (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) +MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE}) if (${VARIABLE}) set (USE_INCLUDES ${USE_INCLUDES} ${FILE}) - endif () -endmacro () + endif (${VARIABLE}) +ENDMACRO (CHECK_INCLUDE_FILE_CONCAT) #----------------------------------------------------------------------------- # Check for the existence of certain header files @@ -219,8 +219,8 @@ if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) if (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX) set (${HDF_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") set (USE_INCLUDES ${USE_INCLUDES} "stdint.h") - endif () -endif () + endif (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX) +endif (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) # Darwin CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_H) @@ -229,16 +229,16 @@ CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_ CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H) if (NOT CYGWIN) CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H) -endif () +endif (NOT CYGWIN) CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" ${HDF_PREFIX}_HAVE_SYS_TIMEB_H) if (CMAKE_SYSTEM_NAME MATCHES "OSF") CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H) CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" ${HDF_PREFIX}_HAVE_SYS_PROC_H) -else () +else (CMAKE_SYSTEM_NAME MATCHES "OSF") set (${HDF_PREFIX}_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) set (${HDF_PREFIX}_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) -endif () +endif (CMAKE_SYSTEM_NAME MATCHES "OSF") CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H) CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H) @@ -295,29 +295,29 @@ if (NOT WINDOWS) # check should be generalized for all POSIX systems as it # is in the Autotools. if (TEST_LFS_WORKS_COMPILE) - if (TEST_LFS_WORKS_RUN MATCHES 0) + if (TEST_LFS_WORKS_RUN MATCHES 0) set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) set (LARGEFILE 1) set (HDF_EXTRA_FLAGS ${HDF_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) message (STATUS "${msg}... yes") - else () + else (TEST_LFS_WORKS_RUN MATCHES 0) set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - endif () - else () + endif (TEST_LFS_WORKS_RUN MATCHES 0) + else (TEST_LFS_WORKS_COMPILE ) set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) - endif () - endif () + endif (TEST_LFS_WORKS_COMPILE) + endif (HDF_ENABLE_LARGE_FILE) set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_FLAGS}) - endif () -endif () + endif (NOT ${HDF_PREFIX}_HAVE_SOLARIS AND NOT ${HDF_PREFIX}_HAVE_DARWIN) +endif (NOT WINDOWS) add_definitions (${HDF_EXTRA_FLAGS}) @@ -331,7 +331,7 @@ if (NOT WINDOWS OR MINGW) CHECK_FUNCTION_EXISTS (fseeko64 ${HDF_PREFIX}_HAVE_FSEEKO64) CHECK_FUNCTION_EXISTS (ftello64 ${HDF_PREFIX}_HAVE_FTELLO64) CHECK_FUNCTION_EXISTS (ftruncate64 ${HDF_PREFIX}_HAVE_FTRUNCATE64) - endif () + endif (${HDF_PREFIX}_HAVE_OFF64_T) CHECK_FUNCTION_EXISTS (fseeko ${HDF_PREFIX}_HAVE_FSEEKO) CHECK_FUNCTION_EXISTS (ftello ${HDF_PREFIX}_HAVE_FTELLO) @@ -340,13 +340,13 @@ if (NOT WINDOWS OR MINGW) if (HAVE_STAT64_STRUCT) CHECK_FUNCTION_EXISTS (fstat64 ${HDF_PREFIX}_HAVE_FSTAT64) CHECK_FUNCTION_EXISTS (stat64 ${HDF_PREFIX}_HAVE_STAT64) - endif () -endif () + endif (HAVE_STAT64_STRUCT) +endif (NOT WINDOWS OR MINGW) #----------------------------------------------------------------------------- # Check the size in bytes of all the int and float types #----------------------------------------------------------------------------- -macro (HDF_CHECK_TYPE_SIZE type var) +MACRO (HDF_CHECK_TYPE_SIZE type var) set (aType ${type}) set (aVar ${var}) # message (STATUS "Checking size of ${aType} and storing into ${aVar}") @@ -354,8 +354,8 @@ macro (HDF_CHECK_TYPE_SIZE type var) if (NOT ${aVar}) set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") # message (STATUS "Size of ${aType} was NOT Found") - endif () -endmacro () + endif (NOT ${aVar}) +ENDMACRO (HDF_CHECK_TYPE_SIZE) HDF_CHECK_TYPE_SIZE (char ${HDF_PREFIX}_SIZEOF_CHAR) HDF_CHECK_TYPE_SIZE (short ${HDF_PREFIX}_SIZEOF_SHORT) @@ -363,12 +363,12 @@ HDF_CHECK_TYPE_SIZE (int ${HDF_PREFIX}_SIZEOF_INT) HDF_CHECK_TYPE_SIZE (unsigned ${HDF_PREFIX}_SIZEOF_UNSIGNED) if (NOT APPLE) HDF_CHECK_TYPE_SIZE (long ${HDF_PREFIX}_SIZEOF_LONG) -endif () +endif (NOT APPLE) HDF_CHECK_TYPE_SIZE ("long long" ${HDF_PREFIX}_SIZEOF_LONG_LONG) HDF_CHECK_TYPE_SIZE (__int64 ${HDF_PREFIX}_SIZEOF___INT64) if (NOT ${HDF_PREFIX}_SIZEOF___INT64) set (${HDF_PREFIX}_SIZEOF___INT64 0) -endif () +endif (NOT ${HDF_PREFIX}_SIZEOF___INT64) HDF_CHECK_TYPE_SIZE (float ${HDF_PREFIX}_SIZEOF_FLOAT) HDF_CHECK_TYPE_SIZE (double ${HDF_PREFIX}_SIZEOF_DOUBLE) @@ -407,17 +407,17 @@ if (NOT APPLE) HDF_CHECK_TYPE_SIZE (ssize_t ${HDF_PREFIX}_SIZEOF_SSIZE_T) if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T) set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0) - endif () + endif (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T) if (NOT WINDOWS) HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T) - endif () -endif () + endif (NOT WINDOWS) +endif (NOT APPLE) HDF_CHECK_TYPE_SIZE (off_t ${HDF_PREFIX}_SIZEOF_OFF_T) HDF_CHECK_TYPE_SIZE (off64_t ${HDF_PREFIX}_SIZEOF_OFF64_T) if (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) set (${HDF_PREFIX}_SIZEOF_OFF64_T 0) -endif () +endif (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) #----------------------------------------------------------------------------- # Extra C99 types @@ -428,9 +428,9 @@ CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H) if (HAVE_STDBOOL_H) set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h) HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL) -else () +else (HAVE_STDBOOL_H) HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL) -endif () +endif (HAVE_STDBOOL_H) if (NOT WINDOWS) #----------------------------------------------------------------------------- @@ -459,11 +459,11 @@ if (NOT WINDOWS) HAVE_STRUCT_TM_TM_ZONE ) HDF_FUNCTION_TEST (${test}) - endforeach () + endforeach (test) if (NOT CYGWIN AND NOT MINGW) HDF_FUNCTION_TEST (HAVE_TIMEZONE) # HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) - endif () + endif (NOT CYGWIN AND NOT MINGW) # ---------------------------------------------------------------------- # Does the struct stat have the st_blocks field? This field is not Posix. @@ -481,7 +481,7 @@ if (NOT WINDOWS) CHECK_FUNCTION_EXISTS (_scrsize ${HDF_PREFIX}_HAVE__SCRSIZE) if (NOT CYGWIN AND NOT MINGW) CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo ${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO) - endif () + endif (NOT CYGWIN AND NOT MINGW) CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGWINSZ) CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGETD) @@ -490,8 +490,8 @@ if (NOT WINDOWS) # if (NOT CYGWIN AND NOT MINGW) CHECK_FUNCTION_EXISTS (getpwuid ${HDF_PREFIX}_HAVE_GETPWUID) - endif () -endif () + endif (NOT CYGWIN AND NOT MINGW) +endif (NOT WINDOWS) #----------------------------------------------------------------------------- # Check for some functions that are used @@ -539,8 +539,8 @@ CHECK_FUNCTION_EXISTS (vsnprintf ${HDF_PREFIX}_HAVE_VSNPRINTF) if (NOT WINDOWS) if (${HDF_PREFIX}_HAVE_VSNPRINTF) HDF_FUNCTION_TEST (VSNPRINTF_WORKS) - endif () -endif () + endif (${HDF_PREFIX}_HAVE_VSNPRINTF) +endif (NOT WINDOWS) #----------------------------------------------------------------------------- # sigsetjmp is special; may actually be a macro @@ -550,9 +550,9 @@ if (NOT ${HDF_PREFIX}_HAVE_SIGSETJMP) CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" ${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) if (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) set (${HDF_PREFIX}_HAVE_SIGSETJMP 1) - endif () - endif () -endif () + endif (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP) + endif (${HDF_PREFIX}_HAVE_SETJMP_H) +endif (NOT ${HDF_PREFIX}_HAVE_SIGSETJMP) #----------------------------------------------------------------------------- # Check a bunch of other functions @@ -568,17 +568,17 @@ if (NOT WINDOWS) HAVE_SOCKLEN_T ) HDF_FUNCTION_TEST (${test}) - endforeach () -endif () + endforeach (test) +endif (NOT WINDOWS) # For other CXX specific tests, use this MACRO. -macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) +MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) if ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") set (OTHER_TEST_ADD_LIBRARIES) if (CMAKE_REQUIRED_LIBRARIES) set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - endif () + endif (CMAKE_REQUIRED_LIBRARIES) foreach (def HAVE_SYS_TIME_H @@ -588,14 +588,14 @@ macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) ) if ("${${HDF_PREFIX}_${def}}") set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") - endif () - endforeach () + endif ("${${HDF_PREFIX}_${def}}") + endforeach (def) if (LARGEFILE) set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - endif () + endif (LARGEFILE) #message (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} @@ -608,16 +608,16 @@ macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) if (${OTHER_TEST} EQUAL 0) set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") message (STATUS "Performing CXX Test ${OTHER_TEST} - Success") - else () + else (${OTHER_TEST} EQUAL 0) message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) - endif () - endif () -endmacro () + endif (${OTHER_TEST} EQUAL 0) + endif ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") +ENDMACRO (HDF_CXX_FUNCTION_TEST) #----------------------------------------------------------------------------- # Check a bunch of cxx functions @@ -632,8 +632,8 @@ if (CMAKE_CXX_COMPILER_LOADED) CXX_HAVE_OFFSETOF ) HDF_CXX_FUNCTION_TEST (${test}) - endforeach () -endif () + endforeach (test) +endif (CMAKE_CXX_COMPILER_LOADED) #----------------------------------------------------------------------------- # Check if InitOnceExecuteOnce is available @@ -646,21 +646,21 @@ if (WINDOWS) set (CMAKE_REQUIRED_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - endif () + endif (LARGEFILE) set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}") if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - else () + else (CMAKE_REQUIRED_LIBRARIES) set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) - endif () + endif (CMAKE_REQUIRED_LIBRARIES) if (CMAKE_REQUIRED_INCLUDES) set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - else () + else (CMAKE_REQUIRED_INCLUDES) set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) - endif () + endif (CMAKE_REQUIRED_INCLUDES) TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED ${CMAKE_BINARY_DIR} @@ -674,7 +674,7 @@ if (WINDOWS) # if it did not compile make the return value fail code of 1 if (NOT HAVE_IOEO_COMPILED) set (HAVE_IOEO_EXITCODE 1) - endif () + endif (NOT HAVE_IOEO_COMPILED) # if the return value was 0 then it worked if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) set (${HDF_PREFIX}_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") @@ -683,22 +683,22 @@ if (WINDOWS) "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO}\n") - else () + else ("${HAVE_IOEO_EXITCODE}" EQUAL 0) if (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") set (${HDF_PREFIX}_HAVE_IOEO "${HAVE_IOEO_EXITCODE}") - else () + else (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") set (${HDF_PREFIX}_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") - endif () + endif (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") message (STATUS "Performing Test InitOnceExecuteOnce - Failed") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing InitOnceExecuteOnce Test failed with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO_EXITCODE}\n") - endif () - endif () - endif () -endif () + endif ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + endif ("${${HDF_PREFIX}_HAVE_IOEO}" MATCHES "^${${HDF_PREFIX}_HAVE_IOEO}$") + endif (NOT HDF_NO_IOEO_TEST) +endif (WINDOWS) #----------------------------------------------------------------------------- # Determine how 'inline' is used @@ -706,7 +706,7 @@ endif () foreach (inline_test inline __inline__ __inline) string (TOUPPER ${inline_test} INLINE_TEST_MACRO) HDF_FUNCTION_TEST (HAVE_${INLINE_TEST_MACRO}) -endforeach () +endforeach (inline_test) #----------------------------------------------------------------------------- # Check how to print a Long Long integer @@ -717,7 +717,7 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH") if (${HDF_PREFIX}_SIZEOF_LONG_LONG) set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") - endif () + endif (${HDF_PREFIX}_SIZEOF_LONG_LONG) TRY_RUN (${HDF_PREFIX}_PRINTF_LL_TEST_RUN ${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c @@ -729,24 +729,24 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " string(REGEX REPLACE ".*PRINTF_LL_WIDTH=\\[(.*)\\].*" "\\1" ${HDF_PREFIX}_PRINTF_LL "${OUTPUT}") set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${${HDF_PREFIX}_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") set (PRINT_LL_FOUND 1) - else () + else (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0) message ("Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") - endif () - else () + endif (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0) + else (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE) file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed with the following output:\n ${OUTPUT}\n" ) - endif () + endif (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE) if (PRINT_LL_FOUND) message (STATUS "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") - else () + else (PRINT_LL_FOUND) message (STATUS "Checking for appropriate format for 64 bit long: not found") set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll" ) - endif () -endif () + endif (PRINT_LL_FOUND) +endif (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "unknown") # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle converting diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index ff1ead2..1a02f82 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -114,10 +114,9 @@ include(GetPrerequisites) # # Start out with the generic MPI compiler names, as these are most commonly used. -set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r mpicc.bat) +set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) set(_MPI_CXX_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ - mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r - mpicxx.bat) + mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) set(_MPI_Fortran_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r mpif90 mpif90_r mpf90 mpf90_r mpif77 mpif77_r mpf77 mpf77_r) @@ -129,9 +128,9 @@ set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpig77 mpig77_r mpg77 mpg77_r) # Intel MPI compiler names -set(_MPI_Intel_C_COMPILER_NAMES mpiicc mpiicc.bat) -set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC mpiicpc.bat) -set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77 mpiifort.bat) +set(_MPI_Intel_C_COMPILER_NAMES mpiicc) +set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC) +set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) # PGI compiler names set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) @@ -315,9 +314,8 @@ function (interrogate_mpi_compiler lang try_libs) set(MPI_COMPILE_FLAGS_WORK) foreach(FLAG ${MPI_ALL_COMPILE_FLAGS}) - string(REGEX REPLACE "^ " "" FLAG ${FLAG}) if (MPI_COMPILE_FLAGS_WORK) - set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}") + string(APPEND MPI_COMPILE_FLAGS_WORK " ${FLAG}") else() set(MPI_COMPILE_FLAGS_WORK ${FLAG}) endif() @@ -325,13 +323,9 @@ function (interrogate_mpi_compiler lang try_libs) # Extract include paths from compile command line string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") - set(MPI_INCLUDE_PATH_WORK) - foreach(IPATH ${MPI_ALL_INCLUDE_PATHS}) string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH}) string(REPLACE "//" "/" IPATH ${IPATH}) - string(REPLACE "\"" "" IPATH ${IPATH}) - file(TO_CMAKE_PATH "${IPATH}" IPATH) list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH}) endforeach() @@ -369,9 +363,8 @@ function (interrogate_mpi_compiler lang try_libs) string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") set(MPI_LINK_FLAGS_WORK) foreach(FLAG ${MPI_ALL_LINK_FLAGS}) - string(REGEX REPLACE "^ " "" FLAG ${FLAG}) if (MPI_LINK_FLAGS_WORK) - set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}") + string(APPEND MPI_LINK_FLAGS_WORK " ${FLAG}") else() set(MPI_LINK_FLAGS_WORK ${FLAG}) endif() @@ -393,7 +386,8 @@ function (interrogate_mpi_compiler lang try_libs) # in the showme list that can only be found in the implicit # link directories of the compiler. if (DEFINED CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES) - set(MPI_LINK_PATH "${MPI_LINK_PATH};${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}") + string(APPEND MPI_LINK_PATH + ";${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}") endif () # Determine full path names for all of the libraries that one needs @@ -468,11 +462,11 @@ function (interrogate_mpi_compiler lang try_libs) set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) find_path(MPI_HEADER_PATH mpifptr.h HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES include Include include/${MS_MPI_ARCH_DIR} Include/${MS_MPI_ARCH_DIR2} Include/${MS_MPI_ARCH_DIR} include/${MS_MPI_ARCH_DIR2} Inc Inc/${MS_MPI_ARCH_DIR} Inc/${MS_MPI_ARCH_DIR2}) + PATH_SUFFIXES include include/${MS_MPI_ARCH_DIR} include/${MS_MPI_ARCH_DIR2} Inc Inc/${MS_MPI_ARCH_DIR} Inc/${MS_MPI_ARCH_DIR2}) if (MPI_INCLUDE_PATH_WORK AND MPI_HEADER_PATH) list(APPEND MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) - endif () - + endif() + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) find_library(MPI_LIB NAMES fmpi fmpich fmpich2 fmpich2g msmpifec msmpifmc @@ -480,8 +474,8 @@ function (interrogate_mpi_compiler lang try_libs) PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}) if (MPI_LIBRARIES_WORK AND MPI_LIB) list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) - endif () - endif () + endif() + endif() if (NOT MPI_LIBRARIES_WORK) set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND") @@ -630,9 +624,6 @@ foreach (lang C CXX Fortran) try_regular_compiler(${lang} regular_compiler_worked) endif() - # add fortran mpi module path if ENV VAR exists - set (MPI_${lang}_INCLUDE_PATH "${MPI_${lang}_INCLUDE_PATH};$ENV{MPI_FORTRAN_MOD_DIR}") - set(MPI_${lang}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) set(MPI_${lang}_FIND_REQUIRED ${MPI_FIND_REQUIRED}) set(MPI_${lang}_FIND_VERSION ${MPI_FIND_VERSION}) diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake index bb5f8d6..5f0f031 100644 --- a/config/cmake_ext_mod/FindSZIP.cmake +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -24,7 +24,7 @@ # made to remove references to Qt and make this file more generally applicable ######################################################################### -macro (SZIP_ADJUST_LIB_VARS basename) +MACRO (SZIP_ADJUST_LIB_VARS basename) if (${basename}_INCLUDE_DIR) # if only the release version was found, set the debug variable also to the release version @@ -32,37 +32,38 @@ macro (SZIP_ADJUST_LIB_VARS basename) set (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE}) set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE}) set (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE}) - endif () + endif (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) # if only the debug version was found, set the release variable also to the debug version if (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) set (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG}) set (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG}) set (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG}) - endif () + endif (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) # if the generator supports configuration types then set # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) set (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) - else () + else (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) # if there are no configuration types and CMAKE_BUILD_TYPE has no value # then just use the release libraries set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) - endif () + endif (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) set (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) - endif () + endif (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) set (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library") if (${basename}_LIBRARY) set (${basename}_FOUND 1) - endif () - endif () + endif (${basename}_LIBRARY) + + endif (${basename}_INCLUDE_DIR ) # Make variables changeble to the advanced user MARK_AS_ADVANCED (${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ${basename}_INCLUDE_DIR ) -endmacro () +ENDMACRO (SZIP_ADJUST_LIB_VARS) # Look for the header file. @@ -92,10 +93,10 @@ FIND_PATH (SZIP_INCLUDE_DIR if (WIN32) set (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") set (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip") -else () +else (WIN32) set (SZIP_SEARCH_DEBUG_NAMES "sz_d") set (SZIP_SEARCH_RELEASE_NAMES "sz;szip") -endif () +endif (WIN32) # Look for the library. FIND_LIBRARY (SZIP_LIBRARY_DEBUG @@ -119,15 +120,16 @@ if (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) if (SZIP_LIBRARY_DEBUG) get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_DEBUG} PATH) set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - elseif () + elseif (SZIP_LIBRARY_RELEASE) get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_RELEASE} PATH) set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - endif () -else () + endif (SZIP_LIBRARY_DEBUG) + +else (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) set (SZIP_FOUND 0) set (SZIP_LIBRARIES) set (SZIP_INCLUDE_DIRS) -endif () +endif (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) # Report the results. if (NOT SZIP_FOUND) @@ -136,12 +138,12 @@ if (NOT SZIP_FOUND) ) if (NOT SZIP_FIND_QUIETLY) message (STATUS "${SZIP_DIR_MESSAGE}") - else () + else (NOT SZIP_FIND_QUIETLY) if (SZIP_FIND_REQUIRED) message (FATAL_ERROR "SZip was NOT found and is Required by this project") - endif () - endif () -endif () + endif (SZIP_FIND_REQUIRED) + endif (NOT SZIP_FIND_QUIETLY) +endif (NOT SZIP_FOUND) if (SZIP_FOUND) include (CheckSymbolExists) @@ -159,7 +161,7 @@ if (SZIP_FOUND) set (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) # ############################################# -endif () +endif (SZIP_FOUND) if (FIND_SZIP_DEBUG) message (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") @@ -167,4 +169,4 @@ if (FIND_SZIP_DEBUG) message (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}") message (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}") message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") -endif () +endif (FIND_SZIP_DEBUG) diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 9d50f50..2145a3d 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -17,7 +17,6 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) elseif (${compress_type} MATCHES "GIT") @@ -34,7 +33,6 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) elseif (${compress_type} MATCHES "TGZ") @@ -51,10 +49,9 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) - endif () + endif (${compress_type} MATCHES "SVN") externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR) ##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) @@ -71,13 +68,13 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) add_dependencies (JPEG jpeg-shared) set (JPEG_SHARED_LIBRARY "jpeg-shared") set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_shared_LIBRARY}) - endif () + endif (BUILD_SHARED_LIBS) set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") set (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") set (JPEG_FOUND 1) set (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) -endmacro () +endmacro (EXTERNAL_JPEG_LIBRARY) #------------------------------------------------------------------------------- macro (PACKAGE_JPEG_LIBRARY compress_type) @@ -88,8 +85,8 @@ macro (PACKAGE_JPEG_LIBRARY compress_type) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") add_dependencies (JPEG-GenHeader-Copy JPEG) - endif () -endmacro () + endif (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") +endmacro (PACKAGE_JPEG_LIBRARY) #------------------------------------------------------------------------------- macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) @@ -107,7 +104,6 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) @@ -125,7 +121,6 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) @@ -143,11 +138,10 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) - endif () + endif (${compress_type} MATCHES "SVN") externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) ##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) @@ -164,13 +158,13 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) add_dependencies (SZIP szip-shared) set (SZIP_SHARED_LIBRARY "szip-shared") set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_shared_LIBRARY}) - endif () + endif (BUILD_SHARED_LIBS) set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") set (SZIP_FOUND 1) set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) -endmacro () +endmacro (EXTERNAL_SZIP_LIBRARY) #------------------------------------------------------------------------------- macro (PACKAGE_SZIP_LIBRARY compress_type) @@ -181,8 +175,8 @@ macro (PACKAGE_SZIP_LIBRARY compress_type) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") add_dependencies (SZIP-GenHeader-Copy SZIP) - endif () -endmacro () + endif (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") +endmacro (PACKAGE_SZIP_LIBRARY) #------------------------------------------------------------------------------- macro (EXTERNAL_ZLIB_LIBRARY compress_type) @@ -200,7 +194,6 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) elseif (${compress_type} MATCHES "GIT") @@ -217,7 +210,6 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) elseif (${compress_type} MATCHES "TGZ") @@ -234,17 +226,16 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) - endif () + endif (${compress_type} MATCHES "SVN") externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR) if (WIN32) set (ZLIB_LIB_NAME "zlib") - else () + else (WIN32) set (ZLIB_LIB_NAME "z") - endif () + endif (WIN32) ##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target zlib-static add_library(zlib-static STATIC IMPORTED) @@ -259,13 +250,13 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) add_dependencies (ZLIB zlib-shared) set (ZLIB_SHARED_LIBRARY "zlib-shared") set (ZLIB_LIBRARIES ${ZLIB_LIBRARIES} ${ZLIB_SHARED_LIBRARY}) - endif () + endif (BUILD_SHARED_LIBS) set (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") set (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") set (ZLIB_FOUND 1) set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) -endmacro () +endmacro (EXTERNAL_ZLIB_LIBRARY) #------------------------------------------------------------------------------- macro (PACKAGE_ZLIB_LIBRARY compress_type) @@ -276,5 +267,5 @@ macro (PACKAGE_ZLIB_LIBRARY compress_type) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") add_dependencies (ZLIB-GenHeader-Copy ZLIB) - endif () -endmacro () + endif (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") +endmacro (PACKAGE_ZLIB_LIBRARY) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index ecf3be0..1d6b49a 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------- macro (SET_GLOBAL_VARIABLE name value) set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) -endmacro () +endmacro (SET_GLOBAL_VARIABLE) #------------------------------------------------------------------------------- macro (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) @@ -14,7 +14,7 @@ macro (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) -endmacro () +endmacro (IDE_GENERATED_PROPERTIES) #------------------------------------------------------------------------------- macro (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) @@ -31,49 +31,45 @@ macro (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) -endmacro () +endmacro (IDE_SOURCE_PROPERTIES) #------------------------------------------------------------------------------- macro (TARGET_NAMING libtarget libtype) if (${libtype} MATCHES "SHARED") set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}${ARGN}") - endif () -endmacro () + endif (${libtype} MATCHES "SHARED") +endmacro (TARGET_NAMING) #------------------------------------------------------------------------------- macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) if (WIN32 AND MSVC) - get_target_property (target_type ${libtarget} TYPE) - if (${libtype} MATCHES "SHARED") - set (targetfilename $) - else () - get_property (target_name TARGET ${libtarget} PROPERTY OUTPUT_NAME_RELWITHDEBINFO) - set (targetfilename $/${target_name}.pdb) - endif () + get_target_property (target_name ${libtarget} OUTPUT_NAME_RELWITHDEBINFO) install ( FILES - ${targetfilename} + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${target_name}.pdb DESTINATION ${targetdestination} CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - endif () -endmacro () + endif (WIN32 AND MSVC) +endmacro (INSTALL_TARGET_PDB) #------------------------------------------------------------------------------- macro (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) if (WIN32 AND MSVC) + get_target_property (target_name ${progtarget} OUTPUT_NAME_RELWITHDEBINFO) + get_target_property (target_prefix ${progtarget} PREFIX) install ( FILES - $ + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target_prefix}${target_name}.pdb DESTINATION ${targetdestination} CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - endif () -endmacro () + endif (WIN32 AND MSVC) +endmacro (INSTALL_PROGRAM_PDB) #------------------------------------------------------------------------------- macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) @@ -81,19 +77,19 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) if (WIN32) set (LIB_RELEASE_NAME "${libname}") set (LIB_DEBUG_NAME "${libname}_D") - else () + else (WIN32) set (LIB_RELEASE_NAME "${libname}") set (LIB_DEBUG_NAME "${libname}_debug") - endif () - else () + endif (WIN32) + else (${libtype} MATCHES "SHARED") if (WIN32) set (LIB_RELEASE_NAME "lib${libname}") set (LIB_DEBUG_NAME "lib${libname}_D") - else () + else (WIN32) set (LIB_RELEASE_NAME "${libname}") set (LIB_DEBUG_NAME "${libname}_debug") - endif () - endif () + endif (WIN32) + endif (${libtype} MATCHES "SHARED") set_target_properties (${libtarget} PROPERTIES @@ -102,18 +98,6 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME} ) - if (${libtype} MATCHES "STATIC") - if (WIN32) - set_target_properties (${libtarget} - PROPERTIES - COMPILE_PDB_NAME_DEBUG ${LIB_DEBUG_NAME} - COMPILE_PDB_NAME_RELEASE ${LIB_RELEASE_NAME} - COMPILE_PDB_NAME_MINSIZEREL ${LIB_RELEASE_NAME} - COMPILE_PDB_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME} - COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" - ) - endif () - endif () #----- Use MSVC Naming conventions for Shared Libraries if (MINGW AND ${libtype} MATCHES "SHARED") @@ -123,8 +107,9 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) IMPORT_PREFIX "" PREFIX "" ) - endif () -endmacro () + endif (MINGW AND ${libtype} MATCHES "SHARED") + +endmacro (HDF_SET_LIB_OPTIONS) #------------------------------------------------------------------------------- macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) @@ -132,12 +117,12 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") - endif () + endif (${importtype} MATCHES "IMPORT") if (${CMAKE_BUILD_TYPE} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) - else () + else (${CMAKE_BUILD_TYPE} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) - endif () + endif (${CMAKE_BUILD_TYPE} MATCHES "Debug") if (${libtype} MATCHES "SHARED") if (WIN32) @@ -146,74 +131,91 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}.lib" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - else () + else (MINGW) set_target_properties (${libtarget} PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" - ) - endif () - else () + ) + endif (MINGW) + else (WIN32) if (CYGWIN) set_target_properties (${libtarget} PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - else () + else (CYGWIN) set_target_properties (${libtarget} PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_SONAME "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${libversion}" SOVERSION "${libversion}" ) - endif () - endif () - else () + endif (CYGWIN) + endif (WIN32) + else (${libtype} MATCHES "SHARED") if (WIN32 AND NOT MINGW) set_target_properties (${libtarget} PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - else () + else (WIN32 AND NOT MINGW) set_target_properties (${libtarget} PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_STATIC_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - endif () - endif () -endmacro () + endif (WIN32 AND NOT MINGW) + endif (${libtype} MATCHES "SHARED") + +endmacro (HDF_IMPORT_SET_LIB_OPTIONS) #------------------------------------------------------------------------------- macro (TARGET_C_PROPERTIES wintarget libtype addcompileflags addlinkflags) if (MSVC) TARGET_MSVC_PROPERTIES (${wintarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - else () - set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}") - endif () -endmacro () + else (MSVC) + set_target_properties (${wintarget} + PROPERTIES + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "${addlinkflags}" + ) + endif (MSVC) +endmacro (TARGET_C_PROPERTIES) #------------------------------------------------------------------------------- macro (TARGET_MSVC_PROPERTIES wintarget libtype addcompileflags addlinkflags) if (MSVC) - set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}") - endif () -endmacro () + set_target_properties (${wintarget} + PROPERTIES + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "${addlinkflags}" + ) + endif (MSVC) +endmacro (TARGET_MSVC_PROPERTIES) #------------------------------------------------------------------------------- macro (TARGET_FORTRAN_PROPERTIES forttarget libtype addcompileflags addlinkflags) if (WIN32) TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - endif () -endmacro () + endif (WIN32) +endmacro (TARGET_FORTRAN_PROPERTIES) #------------------------------------------------------------------------------- macro (TARGET_FORTRAN_WIN_PROPERTIES forttarget libtype addcompileflags addlinkflags) if (MSVC) if (${libtype} MATCHES "SHARED") - set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}") - else () - set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}") - endif () - endif () -endmacro () + set_target_properties (${forttarget} + PROPERTIES + COMPILE_FLAGS "/dll ${addcompileflags}" + LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" + ) + else (${libtype} MATCHES "SHARED") + set_target_properties (${forttarget} + PROPERTIES + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" + ) + endif (${libtype} MATCHES "SHARED") + endif (MSVC) +endmacro (TARGET_FORTRAN_WIN_PROPERTIES) #----------------------------------------------------------------------------- # Configure the README.txt file for the binary package @@ -226,16 +228,16 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_INSTALL_ENDING "msi") if (CMAKE_CL_64) set (BINARY_SYSTEM_NAME "win64") - else () + else (CMAKE_CL_64) set (BINARY_SYSTEM_NAME "win32") - endif () + endif (CMAKE_CL_64) if (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") set (BINARY_PLATFORM "${BINARY_PLATFORM} 7") elseif (${CMAKE_SYSTEM_VERSION} MATCHES "6.2") set (BINARY_PLATFORM "${BINARY_PLATFORM} 8") elseif (${CMAKE_SYSTEM_VERSION} MATCHES "6.3") set (BINARY_PLATFORM "${BINARY_PLATFORM} 10") - endif () + endif (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") set (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") if (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") @@ -247,36 +249,36 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2013") elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "19.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015") - else () + else (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") - endif () + endif (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") elseif (APPLE) set (BINARY_EXAMPLE_ENDING "tar.gz") set (BINARY_INSTALL_ENDING "dmg") set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") - else () + else (WIN32) set (BINARY_EXAMPLE_ENDING "tar.gz") set (BINARY_INSTALL_ENDING "sh") set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") - endif () + endif (WIN32) if (target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM} / ${CMAKE_Fortran_COMPILER_ID} Fortran") - endif () + endif (target_fortran) if (BUILD_SHARED_LIBS) set (LIB_TYPE "Static and Shared") - else () + else (BUILD_SHARED_LIBS) set (LIB_TYPE "Static") - endif () + endif (BUILD_SHARED_LIBS) configure_file ( ${HDF_RESOURCES_DIR}/README.txt.cmake.in ${CMAKE_BINARY_DIR}/README.txt @ONLY ) -endmacro () +endmacro (HDF_README_PROPERTIES) macro (HDFTEST_COPY_FILE src dest target) add_custom_command( diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index bf254a1..275f2ea 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -26,14 +26,14 @@ set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}") # The provided CMake Fortran macros don't provide a general check function # so this one is used for a sizeof test. #----------------------------------------------------------------------------- -macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) +MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) message (STATUS "Testing Fortran ${FUNCTION}") if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - else () + else (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - endif () + endif (CMAKE_REQUIRED_LIBRARIES) file (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f90 "${CODE}" @@ -63,7 +63,8 @@ macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") endif () -endmacro () + +ENDMACRO (CHECK_FORTRAN_FEATURE) #----------------------------------------------------------------------------- # Configure Checks which require Fortran compilation must go in here @@ -74,7 +75,7 @@ endmacro () #----------------------------------------------------------------------------- # Check for Non-standard extension intrinsic function SIZEOF -set (FORTRAN_HAVE_SIZEOF FALSE) +set(FORTRAN_HAVE_SIZEOF FALSE) CHECK_FORTRAN_FEATURE(sizeof " PROGRAM main @@ -85,7 +86,7 @@ CHECK_FORTRAN_FEATURE(sizeof ) # Check for F2008 standard intrinsic function C_SIZEOF -set (FORTRAN_HAVE_C_SIZEOF FALSE) +set(FORTRAN_HAVE_C_SIZEOF FALSE) CHECK_FORTRAN_FEATURE(c_sizeof " PROGRAM main @@ -111,7 +112,7 @@ CHECK_FORTRAN_FEATURE(storage_size ) # Check for F2008 standard intrinsic module "ISO_FORTRAN_ENV" -set (HAVE_ISO_FORTRAN_ENV FALSE) +set(HAVE_ISO_FORTRAN_ENV FALSE) CHECK_FORTRAN_FEATURE(ISO_FORTRAN_ENV " PROGRAM main @@ -121,7 +122,7 @@ CHECK_FORTRAN_FEATURE(ISO_FORTRAN_ENV HAVE_ISO_FORTRAN_ENV ) -set (FORTRAN_DEFAULT_REAL_NOT_DOUBLE FALSE) +set(FORTRAN_DEFAULT_REAL_NOT_DOUBLE FALSE) CHECK_FORTRAN_FEATURE(RealIsNotDouble " MODULE type_mod @@ -151,7 +152,7 @@ CHECK_FORTRAN_FEATURE(RealIsNotDouble #----------------------------------------------------------------------------- # Checks if the ISO_C_BINDING module meets all the requirements #----------------------------------------------------------------------------- -set (FORTRAN_HAVE_ISO_C_BINDING FALSE) +set(FORTRAN_HAVE_ISO_C_BINDING FALSE) CHECK_FORTRAN_FEATURE(iso_c_binding " PROGRAM main @@ -174,5 +175,5 @@ if (CMAKE_Fortran_COMPILER MATCHES ifort) if (WIN32) set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) - endif () -endif () + endif (WIN32) +endif (CMAKE_Fortran_COMPILER MATCHES ifort) diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index 31c8421..a090057 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -4,25 +4,25 @@ # arguments checking if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") -endif () +endif (NOT TEST_PROGRAM) #if (NOT TEST_ARGS) # message (STATUS "Require TEST_ARGS to be defined") -#endif () +#endif (NOT TEST_ARGS) if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif () +endif (NOT TEST_FOLDER) if (NOT TEST_OUTPUT) message (FATAL_ERROR "Require TEST_OUTPUT to be defined") -endif () +endif (NOT TEST_OUTPUT) #if (NOT TEST_EXPECT) # message (STATUS "Require TEST_EXPECT to be defined") -#endif () +#endif (NOT TEST_EXPECT) if (NOT TEST_FILTER) message (STATUS "Require TEST_FILTER to be defined") -endif () +endif (NOT TEST_FILTER) if (NOT TEST_REFERENCE) message (FATAL_ERROR "Require TEST_REFERENCE to be defined") -endif () +endif (NOT TEST_REFERENCE) message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") @@ -48,7 +48,7 @@ string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) if (${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") -endif () +endif (${TEST_RESULT} STREQUAL "0") string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) if (${TEST_EXPECT} STREQUAL "1") @@ -56,8 +56,8 @@ if (${TEST_EXPECT} STREQUAL "1") string (LENGTH "${TEST_MATCH}" TEST_RESULT) if (NOT ${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") - endif () -endif () + endif (NOT ${TEST_RESULT} STREQUAL "0") +endif (${TEST_EXPECT} STREQUAL "1") # everything went fine... message ("Passed: The output of ${TEST_PROGRAM} matched") diff --git a/config/cmake_ext_mod/prunTest.cmake b/config/cmake_ext_mod/prunTest.cmake new file mode 100644 index 0000000..38ecb7e --- /dev/null +++ b/config/cmake_ext_mod/prunTest.cmake @@ -0,0 +1,145 @@ +# runTest.cmake executes a command and captures the output in a file. File is then compared +# against a reference file. Exit status of command can also be compared. +cmake_policy(SET CMP0007 NEW) + +# arguments checking +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif (NOT TEST_OUTPUT) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +#if (NOT TEST_FILTER) +# message (STATUS "Require TEST_FILTER to be defined") +#endif (NOT TEST_FILTER) +if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + message (FATAL_ERROR "Require TEST_REFERENCE to be defined") +endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + +set (ERROR_APPEND 1) + +message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +if (TEST_ENV_VAR) + set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") +endif (TEST_ENV_VAR) + +# run the test program, capture the stdout/stderr and the result var +EXECUTE_PROCESS ( + COMMAND ${TEST_PROGRAM} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + OUTPUT_FILE ${TEST_OUTPUT} + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_OUT + ERROR_VARIABLE TEST_ERROR +) + +message (STATUS "COMMAND Result: ${TEST_RESULT}") + +file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) +file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") + +if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + +if (TEST_APPEND) + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_ERROR}\n") +endif (TEST_APPEND) + +message (STATUS "COMMAND Error: ${TEST_ERROR}") + +if (TEST_MASK) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (TEST_MASK) + +if (TEST_MASK_MOD) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (TEST_MASK_MOD) + +if (TEST_MASK_ERROR) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (TEST_MASK_ERROR) + +if (TEST_FILTER) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif (TEST_FILTER) + +#if (TEST_REF_FILTER) +# message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") +# file (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) +# STRING(REGEX REPLACE "${TEST_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") +# file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") +#endif (TEST_REF_FILTER) + +if (NOT TEST_SKIP_COMPARE) + if (WIN32 AND NOT MINGW) + file (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") + endif (WIN32 AND NOT MINGW) + + # now compare the output with the reference + EXECUTE_PROCESS ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/P_${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + if (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + LIST (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/P_${TEST_REFERENCE} test_ref) + LIST (LENGTH test_ref len_ref) + if (NOT ${len_act} STREQUAL "0") + MATH (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + LIST (GET test_act ${line} str_act) + LIST (GET test_ref ${line} str_ref) + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) + + message (STATUS "COMPARE Result: ${TEST_RESULT}") + + # again, if return value is !=0 scream and shout + if (NOT ${TEST_RESULT} STREQUAL 0) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match P_${TEST_REFERENCE}") + endif (NOT ${TEST_RESULT} STREQUAL 0) +endif (NOT TEST_SKIP_COMPARE) + +# everything went fine... +message ("Passed: The output of ${TEST_PROGRAM} matches P_${TEST_REFERENCE}") + diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 9a2236e..48e9d03 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -6,6 +6,9 @@ cmake_policy(SET CMP0007 NEW) if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") endif () +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif () if (NOT TEST_FOLDER) message ( FATAL_ERROR "Require TEST_FOLDER to be defined") endif () @@ -15,17 +18,20 @@ endif () if (NOT TEST_EXPECT) message (STATUS "Require TEST_EXPECT to be defined") endif () +#if (NOT TEST_FILTER) +# message (STATUS "Require TEST_FILTER to be defined") +#endif () if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) message (FATAL_ERROR "Require TEST_REFERENCE to be defined") -endif () +endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) -endif () +endif (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) -endif () +endif (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) # if there is not an error reference file add the error output to the stdout file if (NOT TEST_ERRREF) @@ -34,14 +40,6 @@ endif () message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") -if (TEST_LIBRARY_DIRECTORY) - if (WIN32 AND NOT MINGW) - set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") - else () - set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") - endif () -endif () - if (TEST_ENV_VAR) set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") endif () @@ -71,16 +69,6 @@ else () ) endif () -if (TEST_REGEX) - # TEST_REGEX should always be matched - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM}) - string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT) - if (${REGEX_RESULT} STREQUAL "0") - message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}") - endif () -endif () - message (STATUS "COMMAND Result: ${TEST_RESULT}") # if the .err file exists and ERRROR_APPEND is enabled @@ -96,13 +84,7 @@ endif () # if the return value is !=${TEST_EXPECT} bail out if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - if (NOT TEST_NOERRDISPLAY) - if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - message (STATUS "Output :\n${TEST_STREAM}") - endif () - endif () - message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") + message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") endif () message (STATUS "COMMAND Error: ${TEST_ERROR}") @@ -143,22 +125,15 @@ if (TEST_MASK_ERROR) else () file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") endif () -endif () +endif (TEST_MASK_ERROR) # remove text from the output file if (TEST_FILTER) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - string (REGEX REPLACE "${TEST_FILTER}" "${TEST_FILTER_REPLACE}" TEST_STREAM "${TEST_STREAM}") + string (REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif () -if (TEST_REF_FILTER) - #message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") - file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) - STRING(REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") -endif () - # compare output files to references unless this must be skipped if (NOT TEST_SKIP_COMPARE) if (WIN32 AND NOT MINGW) @@ -166,22 +141,11 @@ if (NOT TEST_SKIP_COMPARE) file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") endif () - if (NOT TEST_SORT_COMPARE) - # now compare the output with the reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) - else () - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) - list (SORT v1) - list (SORT v2) - if (NOT v1 STREQUAL v2) - set(TEST_RESULT 1) - endif () - endif () - + # now compare the output with the reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) if (NOT ${TEST_RESULT} STREQUAL 0) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) @@ -211,7 +175,7 @@ if (NOT TEST_SKIP_COMPARE) if (NOT ${len_act} STREQUAL ${len_ref}) set (TEST_RESULT 1) endif () - endif () + endif (NOT ${TEST_RESULT} STREQUAL 0) message (STATUS "COMPARE Result: ${TEST_RESULT}") @@ -250,7 +214,7 @@ if (NOT TEST_SKIP_COMPARE) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () - endforeach () + endforeach (line RANGE 0 ${_FP_LEN}) else () if (${len_act} STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") @@ -258,7 +222,7 @@ if (NOT TEST_SKIP_COMPARE) if (${len_ref} STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () - endif () + endif() if (NOT ${len_act} STREQUAL ${len_ref}) set (TEST_RESULT 1) endif () @@ -270,8 +234,8 @@ if (NOT TEST_SKIP_COMPARE) if (NOT ${TEST_RESULT} STREQUAL 0) message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") endif () - endif () -endif () + endif (TEST_ERRREF) +endif (NOT TEST_SKIP_COMPARE) # everything went fine... message ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") diff --git a/configure.ac b/configure.ac index 2af7988..9f84b0f 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,7 @@ AC_CONFIG_MACRO_DIR([m4]) ## AM_INIT_AUTOMAKE takes a list of options that should be applied to ## every Makefile.am when automake is run. AM_INIT_AUTOMAKE([foreign subdir-objects]) -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # use silent rules where available - automake 1.11 +AM_SILENT_RULES([yes]) ## AM_MAINTAINER_MODE turns off "rebuild rules" that contain dependencies ## for Makefiles, configure, src/H5config.h, etc. If AM_MAINTAINER_MODE @@ -3359,14 +3359,11 @@ AC_CONFIG_FILES([src/libhdf5.settings test/Makefile test/testcheck_version.sh test/testerror.sh - test/testflushrefresh.sh + test/testflushrefresh.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh - test/testswmr.sh test/test_plugin.sh - test/test_usecases.sh - test/testvdsswmr.sh testpar/Makefile tools/Makefile tools/lib/Makefile @@ -3383,19 +3380,16 @@ AC_CONFIG_FILES([src/libhdf5.settings tools/src/h5stat/Makefile tools/test/Makefile tools/test/h5dump/Makefile - tools/test/h5dump/h5dump_plugin.sh tools/test/h5dump/testh5dump.sh tools/test/h5dump/testh5dumppbits.sh tools/test/h5dump/testh5dumpvds.sh tools/test/h5dump/testh5dumpxml.sh tools/test/h5ls/Makefile - tools/test/h5ls/h5ls_plugin.sh tools/test/h5ls/testh5ls.sh tools/test/h5ls/testh5lsvds.sh tools/test/h5import/Makefile tools/test/h5import/h5importtestutil.sh tools/test/h5diff/Makefile - tools/test/h5diff/h5diff_plugin.sh tools/test/h5diff/testh5diff.sh tools/test/h5diff/testph5diff.sh tools/src/h5format_convert/Makefile @@ -3409,7 +3403,7 @@ AC_CONFIG_FILES([src/libhdf5.settings tools/test/h5copy/Makefile tools/test/h5copy/testh5copy.sh tools/test/misc/Makefile - tools/test/misc/testh5clear.sh + tools/test/misc/testh5clear.sh tools/test/misc/testh5mkgrp.sh tools/test/misc/testh5repart.sh tools/test/misc/vds/Makefile @@ -3457,7 +3451,7 @@ AC_CONFIG_FILES([src/libhdf5.settings hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh - hl/tools/h5watch/Makefile + hl/tools/h5watch/Makefile hl/tools/h5watch/testh5watch.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d8eb1a2..8849ce7 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_EXAMPLES) #----------------------------------------------------------------------------- @@ -56,8 +56,8 @@ foreach (example ${examples}) TARGET_C_PROPERTIES (${example}-shared SHARED " " " ") target_link_libraries (${example}-shared ${HDF5_LIBSH_TARGET}) set_target_properties (${example}-shared PROPERTIES FOLDER examples) - endif () -endforeach () + endif (BUILD_SHARED_LIBS) +endforeach (example ${examples}) if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) @@ -71,9 +71,9 @@ if (H5_HAVE_PARALLEL) TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ") target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET}) set_target_properties (ph5example-shared PROPERTIES FOLDER examples) - endif () -endif () + endif (BUILD_SHARED_LIBS) +endif (H5_HAVE_PARALLEL) if (BUILD_TESTING) include (CMakeTests.cmake) -endif () +endif (BUILD_TESTING) diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 3412b22..4a4728e 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -8,19 +8,19 @@ if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5EX-shared") file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared/red ${PROJECT_BINARY_DIR}/H5EX-shared/blue ${PROJECT_BINARY_DIR}/H5EX-shared/u2w) - endif () + endif (BUILD_SHARED_LIBS) # Remove any output file left over from previous test run add_test ( NAME EXAMPLES-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove Attributes.h5 btrees_file.h5 cmprss.h5 default_file.h5 dset.h5 - extend.h5 + extend.h5 extlink_prefix_source.h5 extlink_source.h5 extlink_target.h5 @@ -62,42 +62,29 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "EXAMPLES-clear-objects") foreach (example ${examples}) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME EXAMPLES-${example} COMMAND $) - else () - add_test (NAME EXAMPLES-${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=${example}.txt" - #-D "TEST_REFERENCE=${example}.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME EXAMPLES-${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "EXAMPLES-${example}") - endforeach () + endforeach (example ${examples}) if (BUILD_SHARED_LIBS) # Remove any output file left over from previous test run add_test ( NAME EXAMPLES-shared-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove Attributes.h5 btrees_file.h5 cmprss.h5 default_file.h5 dset.h5 - extend.h5 + extend.h5 extlink_prefix_source.h5 extlink_source.h5 extlink_target.h5 @@ -141,71 +128,32 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-shared-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "EXAMPLES-shared-clear-objects") foreach (example ${examples}) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME EXAMPLES-shared-${example} COMMAND $) - else () - add_test (NAME EXAMPLES-shared-${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=${example}.txt" - #-D "TEST_REFERENCE=${example}.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME EXAMPLES-shared-${example} COMMAND $) set_tests_properties (EXAMPLES-shared-${example} PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-shared-${example} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "EXAMPLES-shared-${example}") - endforeach () - endif () + endforeach (example ${examples}) + endif (BUILD_SHARED_LIBS) ### Windows pops up a modal permission dialog on this test if (H5_HAVE_PARALLEL AND NOT WIN32) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME EXAMPLES-ph5example COMMAND $) - else () - add_test (NAME EXAMPLES-ph5example COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=ph5example.txt" - #-D "TEST_REFERENCE=ph5example.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME EXAMPLES-ph5example COMMAND $) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "EXAMPLES-ph5example") if (BUILD_SHARED_LIBS) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME EXAMPLES-shared-ph5example COMMAND $) - else () - add_test (NAME EXAMPLES-shared-ph5example COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=ph5example-shared.txt" - #-D "TEST_REFERENCE=ph5example-shared.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME EXAMPLES-shared-ph5example COMMAND $) set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "EXAMPLES-shared-ph5example") - endif () - endif () + endif (BUILD_SHARED_LIBS) + endif (H5_HAVE_PARALLEL AND NOT WIN32) diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index f7179cf..c725047 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_F90 C CXX Fortran) if (H5_HAVE_PARALLEL) @@ -6,8 +6,8 @@ if (H5_HAVE_PARALLEL) set (LINK_LIBS ${LINK_LIBS} ${MPI_Fortran_LIBRARIES}) if (MPI_Fortran_LINK_FLAGS) set (CMAKE_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") - endif () -endif () + endif (MPI_Fortran_LINK_FLAGS) +endif (H5_HAVE_PARALLEL) #----------------------------------------------------------------------------- # Traverse source subdirectory @@ -19,7 +19,7 @@ add_subdirectory (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_F90_SOURCE_DIR}/examples ${HDF5_F90_BINARY_DIR}/examples) -endif () +endif (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- # Testing @@ -28,5 +28,5 @@ if (BUILD_TESTING) add_subdirectory (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) if (MPI_Fortran_FOUND) add_subdirectory (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar) - endif () -endif () + endif (MPI_Fortran_FOUND) +endif (BUILD_TESTING) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index a5c3422..aad5f33 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed @@ -66,8 +66,8 @@ foreach (example ${examples}) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endif () -endforeach () + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endforeach (example ${examples}) foreach (example ${F2003_examples}) add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) @@ -97,8 +97,8 @@ foreach (example ${F2003_examples}) FOLDER examples/fortran03 Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endif () -endforeach () + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endforeach (example ${F2003_examples}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) @@ -130,9 +130,9 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endif () -endif () + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) if (BUILD_TESTING) include (CMakeTests.cmake) -endif () +endif (BUILD_TESTING) diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index 5665a2f..34230c8 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -28,7 +28,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "f90_ex-clear-objects") if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test ( @@ -53,97 +53,45 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex-shared-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "f90_ex-shared-clear-objects") - endif () + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) foreach (example ${examples}) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME f90_ex_${example} COMMAND $) - else () - add_test (NAME f90_ex_${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=f90_ex_${example}.txt" - #-D "TEST_REFERENCE=f90_ex_${example}.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME f90_ex_${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "f90_ex_${example}") if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME f90_ex-shared_${example} COMMAND $) - else () - add_test (NAME f90_ex-shared_${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=f90_ex_${example}-shared.txt" - #-D "TEST_REFERENCE=f90_ex_${example}-shared.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME f90_ex-shared_${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") set_tests_properties (f90_ex-shared_${example} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "f90_ex-shared_${example}") - endif () -endforeach () + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endforeach (example ${examples}) if (HDF5_ENABLE_F2003) foreach (example ${F2003_examples}) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME f03_ex_${example} COMMAND $) - else () - add_test (NAME f03_ex_${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=f03_ex_${example}.txt" - #-D "TEST_REFERENCE=f03_ex_${example}.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME f03_ex_${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "f03_ex_${example}") if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME f03_ex-shared_${example} COMMAND $) - else () - add_test (NAME f03_ex-shared_${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=f03_ex_${example}-shared.txt" - #-D "TEST_REFERENCE=f03_ex_${example}-shared.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME f03_ex-shared_${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") set_tests_properties (f03_ex-shared_${example} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "f03_ex-shared_${example}") - endif () - endforeach () -endif () + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + endforeach (example ${F2003_examples}) +endif (HDF5_ENABLE_F2003) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_test (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_test (NAME f90_ex-shared_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - endif () -endif () + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 6d51feb..a74459f 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- @@ -8,16 +8,16 @@ if (WIN32) if (MSVC) if (NOT H5_HAVE_PARALLEL) set (H5_NOPAREXP ";") - endif () + endif (NOT H5_HAVE_PARALLEL) if (NOT HDF5_ENABLE_F2003) set (H5_NOF03EXP ";") - else () + else (NOT HDF5_ENABLE_F2003) set (H5_F03EXP ";") - endif () + endif (NOT HDF5_ENABLE_F2003) configure_file (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY) - endif () - endif () -endif () + endif (MSVC) + endif (BUILD_SHARED_LIBS) +endif (WIN32) # configure for Fortran preprocessor @@ -25,12 +25,12 @@ endif () set (CMAKE_H5_HAVE_PARALLEL 0) if (H5_HAVE_PARALLEL) set (CMAKE_H5_HAVE_PARALLEL 1) -endif () +endif (H5_HAVE_PARALLEL) set (CMAKE_H5_HAVE_FLOAT128 0) if (HAVE_FLOAT128) set (CMAKE_H5_HAVE_FLOAT128 1) -endif () +endif(HAVE_FLOAT128) configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5config_f.inc.cmake ${CMAKE_BINARY_DIR}/H5config_f.inc @ONLY) configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5fort_type_defines.h.in ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h @ONLY) @@ -53,12 +53,12 @@ if (WIN32 AND MSVC) PROPERTIES COMPILE_FLAGS "/MT" ) - endif () + endif (BUILD_SHARED_LIBS) set_target_properties (H5_buildiface PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) -endif () +endif (WIN32 AND MSVC) set_target_properties (H5_buildiface PROPERTIES LINKER_LANGUAGE Fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} @@ -68,15 +68,15 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) - else () + else (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif () -endif () + endif (WIN32) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else () +else (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) -endif () +endif (WIN32) INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) @@ -150,7 +150,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_F90_C_LIBSH_TARGET}) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Fortran Modules @@ -186,7 +186,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) DEPENDS ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 PROPERTIES GENERATED TRUE) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (f90_F_BASE_SOURCES # normal distribution @@ -233,7 +233,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 ) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Add Main fortran library @@ -244,7 +244,7 @@ TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_link_libraries (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES}) -endif () +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} STATIC) set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES @@ -257,7 +257,7 @@ if (WIN32) set_property (TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "HDF5F90_WINDOWS" ) -endif () +endif (WIN32) set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET}) add_dependencies(${HDF5_F90_LIB_TARGET} H5gen) @@ -266,12 +266,12 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") - endif () + endif (WIN32 AND MSVC) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_link_libraries (${HDF5_F90_LIBSH_TARGET} ${MPI_Fortran_LIBRARIES}) - endif () + endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_LIB_NAME} SHARED ${HDF5_F_PACKAGE_SOVERSION}) set_target_properties (${HDF5_F90_LIBSH_TARGET} PROPERTIES @@ -286,10 +286,10 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set_property (TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_DLL;HDF5F90_WINDOWS" ) - endif () + endif (WIN32) set (install_targets ${install_targets} ${HDF5_F90_LIBSH_TARGET}) add_dependencies(${HDF5_F90_LIBSH_TARGET} H5genSH) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -367,7 +367,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) COMPONENT fortheaders ) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects @@ -376,9 +376,7 @@ if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INSTALL_TARGET_PDB (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) #INSTALL_TARGET_PDB (${HDF5_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) - endif () - INSTALL_TARGET_PDB (${HDF5_F90_C_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) - #INSTALL_TARGET_PDB (${HDF5_F90_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) install ( TARGETS @@ -391,4 +389,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT fortlibraries INCLUDES DESTINATION include ) -endif () +endif (HDF5_EXPORTED_TARGETS) diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index 51775db..a271666 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -57,9 +57,9 @@ libhdf5_fortran_la_LIBADD=$(LIBHDF5) # Remove it only when distclean. DISTCLEANFILES=h5fc -# H5fortran_types.F90 and H5f90i.h are automatically generated by +# H5fortran_types.F90 and H5f90i.h are automatically generaed by # H5match_types, and must be cleaned explicitly. -MOSTLYCLEANFILES=H5fortran_types.F90 H5f90i_gen.h H5_gen.F90 +MOSTLYCLEANFILES=H5fortran_types.F90 H5f90i_gen.h # Fortran module files can have different extensions and different names # (e.g., different capitalizations) on different platforms. Write rules diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 1661a10..5b11a0a 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- @@ -21,12 +21,12 @@ if (WIN32 AND MSVC) PROPERTIES COMPILE_FLAGS "/MT" ) - endif () + endif (BUILD_SHARED_LIBS) set_target_properties (H5_test_buildiface PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) -endif () +endif (WIN32 AND MSVC) set_target_properties (H5_test_buildiface PROPERTIES LINKER_LANGUAGE Fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} @@ -36,15 +36,15 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) - else () + else (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif () -endif () + endif (WIN32) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else () +else (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) -endif () +endif (WIN32) INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${MOD_BUILD_DIR}) @@ -79,7 +79,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INTERFACE_INCLUDE_DIRECTORIES "$/include>" INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (CMD $) add_custom_command ( @@ -107,7 +107,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) DEPENDS ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 PROPERTIES GENERATED TRUE) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (HDF5_F90_TF_SOURCES # generated files @@ -126,7 +126,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) tf.F90 ) set_source_files_properties (${HDF5_F90_TF_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_F90_TEST_LIB_TARGET} STATIC ${HDF5_F90_TF_SOURCES}) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} STATIC " " " ") @@ -147,7 +147,7 @@ if (WIN32) set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "HDF5F90_WINDOWS" ) -endif () +endif (WIN32) add_dependencies(${HDF5_F90_TEST_LIB_TARGET} H5testgen) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) @@ -155,7 +155,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) set (SHARED_LINK_FLAGS "/DLL") - endif () + endif (WIN32 AND MSVC) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_C_TEST_LIBSH_TARGET} @@ -176,9 +176,9 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set_property (TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_TEST_DLL;HDF5F90_WINDOWS" ) - endif () + endif (WIN32) add_dependencies(${HDF5_F90_TEST_LIBSH_TARGET} H5testgenSH) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Add Tests @@ -211,7 +211,7 @@ target_link_libraries (testhdf5_fortran ) if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran "ws2_32.lib") -endif () +endif (WIN32 AND MSVC) target_include_directories (testhdf5_fortran PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran @@ -247,7 +247,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran-shared "ws2_32.lib") - endif () + endif (WIN32 AND MSVC) target_include_directories (testhdf5_fortran-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (testhdf5_fortran-shared PROPERTIES LINKER_LANGUAGE Fortran @@ -255,7 +255,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) add_dependencies (testhdf5_fortran-shared ${HDF5_F90_TEST_LIBSH_TARGET}) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for testhdf5_fortran_1_8 add_executable (testhdf5_fortran_1_8 @@ -275,7 +275,7 @@ target_link_libraries (testhdf5_fortran_1_8 ) if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran_1_8 "ws2_32.lib") -endif () +endif (WIN32 AND MSVC) target_include_directories (testhdf5_fortran_1_8 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran @@ -302,7 +302,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran_1_8-shared "ws2_32.lib") - endif () + endif (WIN32 AND MSVC) target_include_directories (testhdf5_fortran_1_8-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (testhdf5_fortran_1_8-shared PROPERTIES LINKER_LANGUAGE Fortran @@ -310,7 +310,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) add_dependencies (testhdf5_fortran_1_8-shared ${HDF5_F90_TEST_LIBSH_TARGET}) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fortranlib_test_F03 add_executable (fortranlib_test_F03 @@ -332,7 +332,7 @@ target_link_libraries (fortranlib_test_F03 ) if (WIN32 AND MSVC) target_link_libraries (fortranlib_test_F03 "ws2_32.lib") -endif () +endif (WIN32 AND MSVC) target_include_directories (fortranlib_test_F03 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran @@ -361,7 +361,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (fortranlib_test_F03-shared "ws2_32.lib") - endif () + endif (WIN32 AND MSVC) target_include_directories (fortranlib_test_F03-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (fortranlib_test_F03-shared PROPERTIES @@ -370,7 +370,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) add_dependencies (fortranlib_test_F03-shared ${HDF5_F90_TEST_LIBSH_TARGET}) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fflush1 add_executable (fflush1 fflush1.F90) @@ -383,7 +383,7 @@ target_link_libraries (fflush1 ) if (WIN32 AND MSVC) target_link_libraries (fflush1 "ws2_32.lib") -endif () +endif (WIN32 AND MSVC) target_include_directories (fflush1 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (fflush1 PROPERTIES LINKER_LANGUAGE Fortran @@ -403,7 +403,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (fflush1-shared "ws2_32.lib") - endif () + endif (WIN32 AND MSVC) target_include_directories (fflush1-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (fflush1-shared PROPERTIES LINKER_LANGUAGE Fortran @@ -411,7 +411,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) add_dependencies (fflush1-shared ${HDF5_F90_TEST_LIBSH_TARGET}) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fflush2 add_executable (fflush2 fflush2.F90) @@ -424,7 +424,7 @@ target_link_libraries (fflush2 ) if (WIN32 AND MSVC) target_link_libraries (fflush2 "ws2_32.lib") -endif () +endif (WIN32 AND MSVC) target_include_directories (fflush2 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (fflush2 PROPERTIES LINKER_LANGUAGE Fortran @@ -444,7 +444,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) if (WIN32 AND MSVC) target_link_libraries (fflush2-shared "ws2_32.lib") - endif () + endif (WIN32 AND MSVC) target_include_directories (fflush2-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (fflush2-shared PROPERTIES LINKER_LANGUAGE Fortran @@ -452,6 +452,6 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) add_dependencies (fflush2-shared ${HDF5_F90_TEST_LIBSH_TARGET}) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) include (CMakeTests.cmake) diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index a282ec6..e91e820 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -6,7 +6,7 @@ ############################################################################## if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/fshared") -endif () +endif (BUILD_SHARED_LIBS) # Remove any output file left over from previous test run add_test ( @@ -49,69 +49,24 @@ add_test ( ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (FORTRAN_testhdf5-clear-objects PROPERTIES DEPENDS ${last_test}) -endif () +endif (NOT "${last_test}" STREQUAL "") set (last_test "FORTRAN_testhdf5-clear-objects") -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME FORTRAN_testhdf5_fortran COMMAND $) -else () - add_test (NAME FORTRAN_testhdf5_fortran COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_REGEX= 0 error.s." - -D "TEST_MATCH= 0 error(s)" - -D "TEST_OUTPUT=testhdf5_fortran.txt" - #-D "TEST_REFERENCE=testhdf5_fortran.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () -#set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") +add_test (NAME FORTRAN_testhdf5_fortran COMMAND $) +set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES DEPENDS FORTRAN_testhdf5-clear-objects) #-- Adding test for testhdf5_fortran_1_8 -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND $) -else () - add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_REGEX= 0 error.s." - -D "TEST_MATCH= 0 error(s)" - -D "TEST_OUTPUT=testhdf5_fortran_1_8.txt" - #-D "TEST_REFERENCE=testhdf5_fortran_1_8.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () -#set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") +add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND $) +set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran) #-- Adding test for fortranlib_test_F03 if (HDF5_ENABLE_F2003) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $) - else () - add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_REGEX= 0 error.s." - -D "TEST_MATCH= 0 error(s)" - -D "TEST_OUTPUT=fortranlib_test_F03.txt" - #-D "TEST_REFERENCE=fortranlib_test_F03.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () -# set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") + add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $) + set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8) -endif () +endif (HDF5_ENABLE_F2003) #-- Adding test for fflush1 add_test (NAME FORTRAN_fflush1 COMMAND $) @@ -164,66 +119,21 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ) set_tests_properties (FORTRAN_testhdf5-shared-clear-objects PROPERTIES DEPENDS FORTRAN_testhdf5-clear-objects) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND $) - else () - add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_REGEX= 0 error.s." - -D "TEST_MATCH= 0 error(s)" - -D "TEST_OUTPUT=testhdf5_fortran.txt" - #-D "TEST_REFERENCE=testhdf5_fortran.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () -# set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") + add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND $) + set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES DEPENDS "FORTRAN_testhdf5_fortran;FORTRAN_testhdf5-shared-clear-objects") #-- Adding test for testhdf5_fortran_1_8 - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND $) - else () - add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_REGEX= 0 error.s." - -D "TEST_MATCH= 0 error(s)" - -D "TEST_OUTPUT=testhdf5_fortran_1_8.txt" - #-D "TEST_REFERENCE=testhdf5_fortran_1_8.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () -# set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") + add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND $) + set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8) #-- Adding test for fortranlib_test_F03 if (HDF5_ENABLE_F2003) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND $) - else () - add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_REGEX= 0 error.s." - -D "TEST_MATCH= 0 error(s)" - -D "TEST_OUTPUT=fortranlib_test_F03.txt" - #-D "TEST_REFERENCE=fortranlib_test_F03.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () -# set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") + add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND $) + set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES DEPENDS FORTRAN_fortranlib_test_F03) - endif () + endif (HDF5_ENABLE_F2003) #-- Adding test for fflush1 add_test (NAME FORTRAN_fflush1-shared COMMAND $) @@ -232,4 +142,4 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for fflush2 add_test (NAME FORTRAN_fflush2-shared COMMAND $) set_tests_properties (FORTRAN_fflush2-shared PROPERTIES DEPENDS FORTRAN_fflush1-shared) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 909cbaf..4f21419 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${MPI_Fortran_INCLUDE_PATH} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Add Tests @@ -18,15 +18,15 @@ add_executable (parallel_test ) TARGET_NAMING (parallel_test STATIC) TARGET_FORTRAN_PROPERTIES (parallel_test STATIC " " " ") -target_link_libraries (parallel_test +target_link_libraries (parallel_test ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} - ${LINK_Fortran_LIBS} + ${MPI_Fortran_LIBRARIES} ) if (WIN32 AND MSVC) target_link_libraries (parallel_test "ws2_32.lib") -endif () +endif (WIN32 AND MSVC) target_include_directories (parallel_test PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (parallel_test PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (parallel_test PROPERTIES FOLDER test/fortran) diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index a47e023..bed8291 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- @@ -17,16 +17,16 @@ add_subdirectory (${HDF5_HL_SOURCE_DIR}/src ${HDF5_HL_BINARY_DIR}/src) #-- Build the High level Tools if (HDF5_BUILD_TOOLS) add_subdirectory (${HDF5_HL_SOURCE_DIR}/tools ${HDF5_HL_BINARY_DIR}/tools) -endif () +endif (HDF5_BUILD_TOOLS) #-- Add High Level Examples if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_HL_SOURCE_DIR}/examples ${HDF5_HL_BINARY_DIR}/examples) -endif () +endif (HDF5_BUILD_EXAMPLES) #-- Build the Unit testing if requested if (NOT HDF5_EXTERNALLY_CONFIGURED) if (BUILD_TESTING) add_subdirectory (${HDF5_HL_SOURCE_DIR}/test ${HDF5_HL_BINARY_DIR}/test) - endif () -endif () + endif (BUILD_TESTING) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 91bfa14..36f4c30 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL_CPP) #----------------------------------------------------------------------------- @@ -11,7 +11,7 @@ add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/src ${HDF5_HL_CPP_BINARY_DIR}/src) # -------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/examples ${HDF5_HL_CPP_BINARY_DIR}/examples) -endif () +endif (HDF5_BUILD_EXAMPLES) # -------------------------------------------------------------------- # Add in the unit tests for the packet table c++ wrapper @@ -19,4 +19,4 @@ endif () if (BUILD_TESTING) add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/test ${HDF5_HL_CPP_BINARY_DIR}/test) -endif () +endif (BUILD_TESTING) diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 33ad1e5..77a50bf 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL_CPP_EXAMPLES) #----------------------------------------------------------------------------- @@ -23,4 +23,4 @@ set_target_properties (ptExampleFL PROPERTIES FOLDER examples/hl/cpp) if (BUILD_TESTING) include (CMakeTests.cmake) -endif () +endif (BUILD_TESTING) diff --git a/hl/c++/examples/CMakeTests.cmake b/hl/c++/examples/CMakeTests.cmake index 86bdd93..bac9fdf 100644 --- a/hl/c++/examples/CMakeTests.cmake +++ b/hl/c++/examples/CMakeTests.cmake @@ -8,22 +8,9 @@ add_test ( NAME HL_CPP_ex_ptExampleFL-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove PTcppexampleFL.h5 ) -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_CPP_ex_ptExampleFL COMMAND $) -else () - add_test (NAME HL_CPP_ex_ptExampleFL COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=ptExampleFL.txt" - #-D "TEST_REFERENCE=ptExampleFL.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () +add_test (NAME HL_CPP_ex_ptExampleFL COMMAND $) set_tests_properties (HL_CPP_ex_ptExampleFL PROPERTIES DEPENDS HL_CPP_ex_ptExampleFL-clear-objects) diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 38604cd..f30e684 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL_CPP_SRC) #----------------------------------------------------------------------------- @@ -42,7 +42,7 @@ if (BUILD_SHARED_LIBS) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_HL_CPP_LIBSH_TARGET}) -endif () +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -62,8 +62,7 @@ install ( if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries) - endif () - INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries) + endif (BUILD_SHARED_LIBS) install ( TARGETS @@ -76,4 +75,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT hlcpplibraries INCLUDES DESTINATION include ) -endif () +endif (HDF5_EXPORTED_TARGETS) diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index a2f9429..de5b363 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL_CPP_TEST) #----------------------------------------------------------------------------- diff --git a/hl/c++/test/CMakeTests.cmake b/hl/c++/test/CMakeTests.cmake index d41f79e..e36b5aa 100644 --- a/hl/c++/test/CMakeTests.cmake +++ b/hl/c++/test/CMakeTests.cmake @@ -4,18 +4,5 @@ ### T E S T I N G ### ############################################################################## ############################################################################## - -if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME HL_CPP_ptableTest COMMAND $) -else () - add_test (NAME HL_CPP_ptableTest COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=hl_ptableTest.txt" - #-D "TEST_REFERENCE=hl_ptableTest.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 1144e0f..f5e6f5e 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL_EXAMPLES ) #----------------------------------------------------------------------------- @@ -32,10 +32,10 @@ foreach (example ${examples}) TARGET_C_PROPERTIES (hl_ex_${example} STATIC " " " ") target_link_libraries (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl) -endforeach () +endforeach (example ${examples}) if (BUILD_TESTING) include (CMakeTests.cmake) -endif () +endif (BUILD_TESTING) diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake index 5645155..6384aa5 100644 --- a/hl/examples/CMakeTests.cmake +++ b/hl/examples/CMakeTests.cmake @@ -12,7 +12,7 @@ set (HDF5_TEST_FILES foreach (h5_file ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "hl_ex_ex_ds1_files") -endforeach () +endforeach (h5_file ${HDF5_TEST_FILES}) add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_ex_ds1 tests" DEPENDS ${hl_ex_ex_ds1_files_list}) # Remove any output file left over from previous test run @@ -46,22 +46,9 @@ add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_ set (last_test "HL_ex-clear-objects") foreach (example ${examples}) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_ex_${example} COMMAND $) - else () - add_test (NAME HL_ex_${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=hl_ex_${example}.txt" - #-D "TEST_REFERENCE=hl_ex_${example}.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (HL_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "HL_ex_${example}") -endforeach () + add_test (NAME HL_ex_${example} COMMAND $) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (HL_ex_${example} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "HL_ex_${example}") +endforeach (example ${examples}) diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index c651ce9..892169c 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL_F90 C CXX Fortran) #----------------------------------------------------------------------------- @@ -11,11 +11,11 @@ add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/examples ${HDF5_HL_F90_BINARY_DIR}/examples) -endif () +endif (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if (BUILD_TESTING) add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/test ${HDF5_HL_F90_BINARY_DIR}/test) -endif () +endif (BUILD_TESTING) diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index dfe6102..87838a0 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- @@ -18,7 +18,7 @@ foreach (example ${examples}) add_executable (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (hl_f90_ex_${example} STATIC) TARGET_FORTRAN_PROPERTIES (hl_f90_ex_${example} STATIC " " " ") - target_link_libraries (hl_f90_ex_${example} + target_link_libraries (hl_f90_ex_${example} ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -27,10 +27,10 @@ foreach (example ${examples}) set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran) -endforeach () +endforeach (example ${examples}) if (BUILD_TESTING) include (CMakeTests.cmake) -endif () +endif (BUILD_TESTING) diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake index b5f5fc6..2c10295 100644 --- a/hl/fortran/examples/CMakeTests.cmake +++ b/hl/fortran/examples/CMakeTests.cmake @@ -16,19 +16,6 @@ add_test ( foreach (example ${examples}) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND $) - else () - add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=hl_f90_ex_${example}.txt" - #-D "TEST_REFERENCE=hl_f90_ex_${example}.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND $) set_tests_properties (HL_FORTRAN_f90_ex_${example} PROPERTIES DEPENDS HL_FORTRAN_f90_ex-clear-objects) -endforeach () +endforeach (example ${examples}) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 345a739..2eaac31 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT(HDF5_HL_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- @@ -7,9 +7,9 @@ if (WIN32) if (BUILD_SHARED_LIBS) if (MSVC) configure_file (${HDF5_HL_F90_SRC_SOURCE_DIR}/hdf5_hl_fortrandll.def.in ${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def @ONLY) - endif () - endif () -endif () + endif (MSVC) + endif (BUILD_SHARED_LIBS) +endif (WIN32) #----------------------------------------------------------------------------- # Generate the H5LT and H5TB REAL APIs @@ -25,12 +25,12 @@ if (WIN32 AND MSVC) PROPERTIES COMPILE_FLAGS "/MT" ) - endif () + endif (BUILD_SHARED_LIBS) set_target_properties (H5HL_buildiface PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) -endif () +endif (WIN32 AND MSVC) set_target_properties (H5HL_buildiface PROPERTIES LINKER_LANGUAGE Fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} @@ -40,15 +40,15 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) - else () + else (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - endif () -endif () + endif (WIN32) +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) if (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${CMAKE_BUILD_TYPE}) -else () +else (WIN32) set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static) -endif () +endif (WIN32) #----------------------------------------------------------------------------- # Setup include Directories @@ -101,7 +101,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) set (install_targets ${install_targets} ${HDF5_HL_F90_C_LIBSH_TARGET}) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Fortran Modules @@ -146,7 +146,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 PROPERTIES GENERATED TRUE ) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (HDF5_HL_F90_F_SOURCES ${HDF5_HL_F90_F_BASE_SOURCES} @@ -166,7 +166,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 ) set_source_files_properties (${HDF5_HL_F90_F_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES}) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} STATIC " " " ") @@ -183,7 +183,7 @@ if (WIN32) set_property (TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "HDF5F90_WINDOWS" ) -endif () +endif (WIN32) set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET}) add_dependencies(${HDF5_HL_F90_LIB_TARGET} H5HLgen) @@ -192,7 +192,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def") - endif () + endif (WIN32 AND MSVC) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIBSH_TARGET}") @@ -208,10 +208,10 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set_property (TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_HDF5_HL_DLL;HDF5F90_WINDOWS" ) - endif () + endif (WIN32) set (install_targets ${install_targets} ${HDF5_HL_F90_LIBSH_TARGET}) add_dependencies(${HDF5_HL_F90_LIBSH_TARGET} H5HLgenSH) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -253,7 +253,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) COMPONENT fortheaders ) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects @@ -262,9 +262,7 @@ if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) - endif () - INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) - #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) install ( TARGETS @@ -277,4 +275,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT hlfortlibraries INCLUDES DESTINATION include ) -endif () +endif (HDF5_EXPORTED_TARGETS) diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 3138173..13cb177 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- @@ -25,7 +25,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for hl_f90_tstlite add_executable (hl_f90_tstlite tstlite.F90) @@ -46,7 +46,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for hl_f90_tstimage add_executable (hl_f90_tstimage tstimage.F90) @@ -67,7 +67,7 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) #-- Adding test for hl_f90_tsttable add_executable (hl_f90_tsttable tsttable.F90) @@ -88,6 +88,6 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) include (CMakeTests.cmake) diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index 3c8a831..c538ae8 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -21,68 +21,16 @@ add_test ( tstds.h5 ) -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_FORTRAN_f90_tstds COMMAND $) -else () - add_test (NAME HL_FORTRAN_f90_tstds COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=hl_f90_tstds.txt" - #-D "TEST_REFERENCE=hl_f90_tstds.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () +add_test (NAME HL_FORTRAN_f90_tstds COMMAND $) set_tests_properties (HL_FORTRAN_f90_tstds PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_FORTRAN_f90_tstlite COMMAND $) -else () - add_test (NAME HL_FORTRAN_f90_tstlite COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=hl_f90_tstlite.txt" - #-D "TEST_REFERENCE=hl_f90_tstlite.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () +add_test (NAME HL_FORTRAN_f90_tstlite COMMAND $) set_tests_properties (HL_FORTRAN_f90_tstlite PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_FORTRAN_f90_tstimage COMMAND $) -else () - add_test (NAME HL_FORTRAN_f90_tstimage COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=hl_f90_tstimage.txt" - #-D "TEST_REFERENCE=hl_f90_tstimage.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () +add_test (NAME HL_FORTRAN_f90_tstimage COMMAND $) set_tests_properties (HL_FORTRAN_f90_tstimage PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_FORTRAN_f90_tsttable COMMAND $) -else () - add_test (NAME HL_FORTRAN_f90_tsttable COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=hl_f90_tsttable.txt" - #-D "TEST_REFERENCE=hl_f90_tsttable.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () +add_test (NAME HL_FORTRAN_f90_tsttable COMMAND $) set_tests_properties (HL_FORTRAN_f90_tsttable PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) @@ -104,67 +52,15 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) PROPERTIES DEPENDS "HL_FORTRAN_f90_tsttable;HL_FORTRAN_f90_tstimage;HL_FORTRAN_f90_tstlite;HL_FORTRAN_f90_tstds" ) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_FORTRAN_f90_tstds-shared COMMAND $) - else () - add_test (NAME HL_FORTRAN_f90_tstds-shared COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=hl_f90_tstds-shared.txt" - #-D "TEST_REFERENCE=hl_f90_tstds-shared.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME HL_FORTRAN_f90_tstds-shared COMMAND $) set_tests_properties (HL_FORTRAN_f90_tstds-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_FORTRAN_f90_tstlite-shared COMMAND $) - else () - add_test (NAME HL_FORTRAN_f90_tstlite-shared COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=hl_f90_tstlite-shared.txt" - #-D "TEST_REFERENCE=hl_f90_tstlite-shared.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME HL_FORTRAN_f90_tstlite-shared COMMAND $) set_tests_properties (HL_FORTRAN_f90_tstlite-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_FORTRAN_f90_tstimage-shared COMMAND $) - else () - add_test (NAME HL_FORTRAN_f90_tstimage-shared COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=hl_f90_tstimage-shared.txt" - #-D "TEST_REFERENCE=hl_f90_tstimage-shared.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME HL_FORTRAN_f90_tstimage-shared COMMAND $) set_tests_properties (HL_FORTRAN_f90_tstimage-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_FORTRAN_f90_tsttable-shared COMMAND $) - else () - add_test (NAME HL_FORTRAN_f90_tsttable-shared COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=hl_f90_tsttable-shared.txt" - #-D "TEST_REFERENCE=hl_f90_tsttable-shared.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME HL_FORTRAN_f90_tsttable-shared COMMAND $) set_tests_properties (HL_FORTRAN_f90_tsttable-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) -endif () +endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 86472fb..0c71583 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL_SRC) #----------------------------------------------------------------------------- @@ -53,7 +53,7 @@ if (BUILD_SHARED_LIBS) ) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIBSH_TARGET}") set (install_targets ${install_targets} ${HDF5_HL_LIBSH_TARGET}) -endif () +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -73,8 +73,7 @@ install ( if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_HL_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries) - endif () - INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries) + endif (BUILD_SHARED_LIBS) install ( TARGETS @@ -87,4 +86,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT hllibraries INCLUDES DESTINATION include ) -endif () +endif (HDF5_EXPORTED_TARGETS) diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 8845505..987c5bb 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed @@ -30,7 +30,7 @@ MACRO (HL_ADD_EXE hl_name) ${HDF5_LIB_TARGET} ) set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) -ENDMACRO () +ENDMACRO (HL_ADD_EXE) MACRO (HL_ADD_SHEXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) @@ -42,7 +42,7 @@ MACRO (HL_ADD_SHEXE hl_name) ${HDF5_LIBSH_TARGET} ) set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) -ENDMACRO () +ENDMACRO (HL_ADD_SHEXE) HL_ADD_EXE (test_lite) HL_ADD_EXE (test_image) @@ -88,6 +88,6 @@ if (HDF5_BUILD_GENERATORS) ${HDF5_LIB_TARGET} ) set_target_properties (hl_gen_test_ld PROPERTIES FOLDER test/hl/gen) -endif () +endif (HDF5_BUILD_GENERATORS) include (CMakeTests.cmake) diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index 211c501..228853d 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -29,34 +29,21 @@ set (HL_REFERENCE_TEST_FILES # -------------------------------------------------------------------- foreach (h5_file ${HL_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_HL_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_HL_TEST_BINARY_DIR}/${h5_file}" "hl_test_files") -endforeach () +endforeach (h5_file ${HL_REFERENCE_TEST_FILES}) add_custom_target(hl_test_files ALL COMMENT "Copying files needed by hl_test tests" DEPENDS ${hl_test_files_list}) # -------------------------------------------------------------------- # Macro used to add a unit test # -------------------------------------------------------------------- -macro (HL_ADD_TEST hl_name) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_${hl_name} COMMAND $) - else () - add_test (NAME HL_${hl_name} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=hl_${hl_name}.txt" - #-D "TEST_REFERENCE=hl_${hl_name}.out" - -D "TEST_FOLDER=${HDF5_HL_TEST_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () +MACRO (HL_ADD_TEST hl_name) + add_test (NAME HL_${hl_name} COMMAND $) if (NOT "${last_test}" STREQUAL "") set_tests_properties (HL_${hl_name} PROPERTIES DEPENDS ${last_test} ENVIRONMENT "srcdir=${HDF5_HL_TEST_BINARY_DIR}" WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR} ) endif () -endmacro () +ENDMACRO (HL_ADD_TEST) # Remove any output file left over from previous test run add_test ( @@ -95,7 +82,7 @@ add_test ( ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (HL_test-clear-objects PROPERTIES DEPENDS ${last_test}) -endif () +endif (NOT "${last_test}" STREQUAL "") set (last_test "HL_test-clear-objects") HL_add_test (test_lite ) diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 9536517..8384b59 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL_TOOLS C CXX) add_subdirectory (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5 ${HDF5_HL_TOOLS_BINARY_DIR}/gif2h5) diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index 9d7a406..9e6e828 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL_TOOLS_GIF2H5) #----------------------------------------------------------------------------- @@ -50,21 +50,19 @@ if (BUILD_TESTING) set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) # add_test (NAME hl_h52gifgentest COMMAND $) - endif () + endif (HDF5_BUILD_GENERATORS) include (CMakeTests.cmake) -endif () +endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -if (HDF5_EXPORTED_TARGETS) - install ( - TARGETS - gif2h5 - h52gif - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications - ) -endif () +install ( + TARGETS + gif2h5 + h52gif + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications +) diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index fde40e3..6d55abc 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_HL_TOOLS_H5WATCH) #----------------------------------------------------------------------------- @@ -49,17 +49,13 @@ if (BUILD_TESTING) set_target_properties (h5watchgentest PROPERTIES FOLDER generator/tools/hl) include (CMakeTests.cmake) -endif () +endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -if (HDF5_EXPORTED_TARGETS) - install ( - TARGETS - h5watch - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications - ) -endif () +install ( + TARGETS + h5watch + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications +) diff --git a/hl/tools/h5watch/CMakeTests.cmake b/hl/tools/h5watch/CMakeTests.cmake index 2242692..3242a72 100644 --- a/hl/tools/h5watch/CMakeTests.cmake +++ b/hl/tools/h5watch/CMakeTests.cmake @@ -56,7 +56,7 @@ foreach (h5watch_file ${H5WATCH_TEST_FILES}) COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_HL_TOOLS_DIR}/testfiles/${h5watch_file} ${dest} ) -endforeach () +endforeach (h5watch_file ${H5WATCH_TEST_FILES}) ############################################################################## ############################################################################## @@ -64,9 +64,21 @@ endforeach () ############################################################################## ############################################################################## - macro (ADD_H5_TEST resultfile resultcode) + MACRO (ADD_H5_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( + NAME H5WATCH_ARGS-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5WATCH_ARGS-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5WATCH_ARGS-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5WATCH_ARGS-${resultfile}-clearall-objects") + add_test ( NAME H5WATCH_ARGS-h5watch-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -77,18 +89,20 @@ endforeach () -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5WATCH_ARGS-h5watch-${resultfile} PROPERTIES DEPENDS ${last_test}) - set (last_test "H5WATCH_ARGS-h5watch-${resultfile}") - endif () - endmacro () + set_tests_properties (H5WATCH_ARGS-h5watch-${resultfile} PROPERTIES DEPENDS H5WATCH_ARGS-${resultfile}-clear-objects) + set (last_test "H5WATCH_ARGS-${resultfile}") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) - macro (ADD_H5_WATCH resultfile resultcode) + MACRO (ADD_H5_WATCH resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5WATCH-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5 + ${resultfile}.out + ${resultfile}.out.err ) set_tests_properties (H5WATCH-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") add_test ( @@ -103,8 +117,8 @@ endforeach () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5WATCH-${resultfile} PROPERTIES DEPENDS H5WATCH-${resultfile}-clear-objects) - endif () - endmacro () + endif (NOTHDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_WATCH resultfile resultcode) ############################################################################## ############################################################################## @@ -116,7 +130,7 @@ endforeach () # supports SWMR. set (SWMR_INCOMPAT ${hl_swmr_check_compat_vfd}) -if (NOT SWMR_INCOMPAT) +IF (NOT SWMR_INCOMPAT) # Remove any output file left over from previous test run add_test ( NAME H5WATCH-clearall-objects @@ -126,7 +140,7 @@ if (NOT SWMR_INCOMPAT) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5WATCH-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5WATCH-clearall-objects") ################################################################################################# @@ -155,23 +169,23 @@ if (NOT SWMR_INCOMPAT) set (last_test "H5WATCH-h5watchgentest") # Test on --help options - ADD_H5_TEST (w-help1 0 --help) + ADD_H5_TEST(w-help1 0 --help) # # Tests on expected failures - ADD_H5_TEST (w-err-dset1 1 WATCH.h5) - ADD_H5_TEST (w-err-dset2 1 WATCH.h5/group/DSET_CMPD) - ADD_H5_TEST (w-err-dset-none 1 WATCH.h5/DSET_NONE) - ADD_H5_TEST (w-err-dset-nomax 1 WATCH.h5/DSET_NOMAX) - ADD_H5_TEST (w-err-file 1 ../WATCH.h5/DSET_CMPD) - ADD_H5_TEST (w-err-width 1 --width=-8 WATCH.h5/DSET_ONE) - ADD_H5_TEST (w-err-poll 1 --polling=-8 WATCH.h5/DSET_ONE) - ADD_H5_TEST (w-err-poll0 1 --polling=0 WATCH.h5/DSET_ONE) + ADD_H5_TEST(w-err-dset1 1 WATCH.h5) + ADD_H5_TEST(w-err-dset2 1 WATCH.h5/group/DSET_CMPD) + ADD_H5_TEST(w-err-dset-none 1 WATCH.h5/DSET_NONE) + ADD_H5_TEST(w-err-dset-nomax 1 WATCH.h5/DSET_NOMAX) + ADD_H5_TEST(w-err-file 1 ../WATCH.h5/DSET_CMPD) + ADD_H5_TEST(w-err-width 1 --width=-8 WATCH.h5/DSET_ONE) + ADD_H5_TEST(w-err-poll 1 --polling=-8 WATCH.h5/DSET_ONE) + ADD_H5_TEST(w-err-poll0 1 --polling=0 WATCH.h5/DSET_ONE) # # Tests on invalid field names via --fields option for a compound typed dataset: DSET_CMPD - ADD_H5_TEST (w-err-cmpd1 1 --fields=fieldx WATCH.h5/DSET_CMPD) - ADD_H5_TEST (w-err-cmpd2 1 --fields=field1,field2. WATCH.h5/DSET_CMPD) - ADD_H5_TEST (w-err-cmpd3 1 --fields=field1,field2, WATCH.h5/DSET_CMPD) - ADD_H5_TEST (w-err-cmpd4 1 --fields=field1,field2.b.k WATCH.h5/DSET_CMPD) - ADD_H5_TEST (w-err-cmpd5 1 --fields=field1 --fields=field2.b.k WATCH.h5/DSET_CMPD) + ADD_H5_TEST(w-err-cmpd1 1 --fields=fieldx WATCH.h5/DSET_CMPD) + ADD_H5_TEST(w-err-cmpd2 1 --fields=field1,field2. WATCH.h5/DSET_CMPD) + ADD_H5_TEST(w-err-cmpd3 1 --fields=field1,field2, WATCH.h5/DSET_CMPD) + ADD_H5_TEST(w-err-cmpd4 1 --fields=field1,field2.b.k WATCH.h5/DSET_CMPD) + ADD_H5_TEST(w-err-cmpd5 1 --fields=field1 --fields=field2.b.k WATCH.h5/DSET_CMPD) # -endif () +ENDIF (NOT SWMR_INCOMPAT) diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index d37a409..706b196 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2.2) +cmake_minimum_required(VERSION 3.1.0) PROJECT ( HDF5_JAVA C Java ) set (CMAKE_MODULE_PATH "${HDF_RESOURCES_DIR};${HDF_RESOURCES_EXT_DIR}") @@ -15,9 +15,9 @@ INCLUDE_DIRECTORIES ( ${JNI_INCLUDE_DIRS} ) if (WIN32) set (HDF_JRE_DIRECTORY "C:/Program Files/Java/jre8") -else () +else (WIN32) set (HDF_JRE_DIRECTORY "/usr/lib/jvm/jre") -endif () +endif (WIN32) #----------------------------------------------------------------------------- # Include the main src and config directories @@ -41,14 +41,14 @@ add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/src ${HDF5_JAVA_BINARY_DIR}/src) #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/examples ${HDF5_JAVA_BINARY_DIR}/examples) -endif () +endif (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if (BUILD_TESTING) add_subdirectory (${HDF5_JAVA_SOURCE_DIR}/test ${HDF5_JAVA_BINARY_DIR}/test) -endif () +endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Add Required Jar(s) @@ -72,4 +72,4 @@ if (HDF5_JAVA_PACK_JRE) DESTINATION ${HDF5_INSTALL_BIN_DIR} USE_SOURCE_PERMISSIONS ) -endif () +endif (HDF5_JAVA_PACK_JRE) diff --git a/java/examples/CMakeLists.txt b/java/examples/CMakeLists.txt index a1a7483..0430bdb 100644 --- a/java/examples/CMakeLists.txt +++ b/java/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDFJAVA_EXAMPLES) add_subdirectory (${HDFJAVA_EXAMPLES_SOURCE_DIR}/datasets datasets) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index d698cfd..3a69359 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDFJAVA_EXAMPLES_DATASETS Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -31,16 +31,16 @@ set (HDF_JAVA_EXAMPLES if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") -else () +else (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") -endif () +endif (WIN32) set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS}") set (CMAKE_JAVA_CLASSPATH ".") foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") -endforeach () +endforeach (CMAKE_INCLUDE_PATH) foreach (example ${HDF_JAVA_EXAMPLES}) file (WRITE ${PROJECT_BINARY_DIR}/${example}_Manifest.txt @@ -52,23 +52,23 @@ foreach (example ${HDF_JAVA_EXAMPLES}) # install_jar (${example} ${HJAVA_INSTALL_DATA_DIR}/examples examples) get_target_property (${example}_CLASSPATH ${example} CLASSDIR) add_dependencies (${example} ${HDF5_JAVA_HDF5_LIB_TARGET}) -endforeach () +endforeach (example ${HDF_JAVA_EXAMPLES}) set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_NOP_JAR}") set (CMAKE_JAVA_CLASSPATH ".") foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}") -endforeach () +endforeach (HDFJAVA_JAR) MACRO (ADD_H5_TEST resultfile resultcode) if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else () + else() set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () - endif () + endif() + endif(CMAKE_BUILD_TYPE MATCHES Debug) add_test ( NAME JAVA_datasets-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -85,16 +85,16 @@ MACRO (ADD_H5_TEST resultfile resultcode) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_datasets-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "JAVA_datasets-${resultfile}") -ENDMACRO () +ENDMACRO (ADD_H5_TEST file) if (BUILD_TESTING) # detect whether the encoder is present. if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif () + endif (H5_HAVE_FILTER_DEFLATE) if (H5_HAVE_FILTER_SZIP) set (USE_FILTER_SZIP "true") @@ -109,17 +109,17 @@ if (BUILD_TESTING) ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.data ) - else () + else (${example} STREQUAL "H5Ex_D_External") add_test ( NAME JAVA_datasets-${example}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ) - endif () + endif (${example} STREQUAL "H5Ex_D_External") if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_datasets-${example}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") add_test ( NAME JAVA_datasets-${example}-copy-objects COMMAND ${CMAKE_COMMAND} @@ -132,10 +132,10 @@ if (BUILD_TESTING) if (${example} STREQUAL "H5Ex_D_Szip") if (USE_FILTER_SZIP) ADD_H5_TEST (${example} 0) - endif () - else () + endif (USE_FILTER_SZIP) + else (${example} STREQUAL "H5Ex_D_Szip") ADD_H5_TEST (${example} 0) - endif () + endif (${example} STREQUAL "H5Ex_D_Szip") - endforeach () -endif () + endforeach (example ${HDF_JAVA_EXAMPLES}) +endif (BUILD_TESTING) diff --git a/java/examples/datasets/H5Ex_D_Chunk.java b/java/examples/datasets/H5Ex_D_Chunk.java index b12b227..7f02e5a 100644 --- a/java/examples/datasets/H5Ex_D_Chunk.java +++ b/java/examples/datasets/H5Ex_D_Chunk.java @@ -44,7 +44,7 @@ public class H5Ex_D_Chunk { // Values for the status of space allocation enum H5D_layout { - H5D_LAYOUT_ERROR(-1), H5D_COMPACT(0), H5D_CONTIGUOUS(1), H5D_CHUNKED(2), H5D_VIRTUAL(3), H5D_NLAYOUTS(4); + H5D_LAYOUT_ERROR(-1), H5D_COMPACT(0), H5D_CONTIGUOUS(1), H5D_CHUNKED(2), H5D_NLAYOUTS(3); private static final Map lookup = new HashMap(); static { @@ -250,9 +250,6 @@ public class H5Ex_D_Chunk { case H5D_CHUNKED: System.out.println("H5D_CHUNKED"); break; - case H5D_VIRTUAL: - System.out.println("H5D_VIRTUAL"); - break; case H5D_LAYOUT_ERROR: break; case H5D_NLAYOUTS: diff --git a/java/examples/datasets/H5Ex_D_Compact.java b/java/examples/datasets/H5Ex_D_Compact.java index 0417c7c..4f1e2f0 100644 --- a/java/examples/datasets/H5Ex_D_Compact.java +++ b/java/examples/datasets/H5Ex_D_Compact.java @@ -38,7 +38,7 @@ public class H5Ex_D_Compact { // Values for the status of space allocation enum H5D_layout { - H5D_LAYOUT_ERROR(-1), H5D_COMPACT(0), H5D_CONTIGUOUS(1), H5D_CHUNKED(2), H5D_VIRTUAL(3), H5D_NLAYOUTS(4); + H5D_LAYOUT_ERROR(-1), H5D_COMPACT(0), H5D_CONTIGUOUS(1), H5D_CHUNKED(2), H5D_NLAYOUTS(3); private static final Map lookup = new HashMap(); static { @@ -212,9 +212,6 @@ public class H5Ex_D_Compact { case H5D_CHUNKED: System.out.println("H5D_CHUNKED"); break; - case H5D_VIRTUAL: - System.out.println("H5D_VIRTUAL"); - break; case H5D_LAYOUT_ERROR: break; case H5D_NLAYOUTS: diff --git a/java/examples/datasets/runExample.sh.in b/java/examples/datasets/runExample.sh.in index 53d8070..440de33 100644 --- a/java/examples/datasets/runExample.sh.in +++ b/java/examples/datasets/runExample.sh.in @@ -161,8 +161,6 @@ CLEAN_DATAFILES_AND_BLDDIR() { $RM $BLDDIR/examples.datasets.H5Ex_D_*.txt $RM $BLDDIR/H5Ex_D_*.out - $RM $BLDDIR/H5Ex_D_*.h5 - $RM $BLDDIR/H5Ex_D_External.data } # Print a line-line message left justified in a field of 70 characters diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 8569b8b..3eae115 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDFJAVA_EXAMPLES_DATATYPES Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -31,16 +31,16 @@ set (HDF_JAVA_EXAMPLES if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") -else () +else (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") -endif () +endif (WIN32) set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS}") set (CMAKE_JAVA_CLASSPATH ".") foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") -endforeach () +endforeach (CMAKE_INCLUDE_PATH) foreach (example ${HDF_JAVA_EXAMPLES}) file (WRITE ${PROJECT_BINARY_DIR}/${example}_Manifest.txt @@ -52,23 +52,23 @@ foreach (example ${HDF_JAVA_EXAMPLES}) # install_jar (${example} ${HJAVA_INSTALL_DATA_DIR}/examples examples) get_target_property (${example}_CLASSPATH ${example} CLASSDIR) add_dependencies (${example} ${HDF5_JAVA_HDF5_LIB_TARGET}) -endforeach () +endforeach (example ${HDF_JAVA_EXAMPLES}) set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_NOP_JAR}") set (CMAKE_JAVA_CLASSPATH ".") foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}") -endforeach () +endforeach (HDFJAVA_JAR) MACRO (ADD_H5_TEST resultfile resultcode) if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else () + else() set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () - endif () + endif() + endif(CMAKE_BUILD_TYPE MATCHES Debug) add_test ( NAME JAVA_datatypes-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -85,9 +85,9 @@ MACRO (ADD_H5_TEST resultfile resultcode) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_datatypes-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "JAVA_datatypes-${resultfile}") -ENDMACRO () +ENDMACRO (ADD_H5_TEST file) if (BUILD_TESTING) foreach (example ${HDF_JAVA_EXAMPLES}) @@ -99,7 +99,7 @@ if (BUILD_TESTING) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_datatypes-${example}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") add_test ( NAME JAVA_datatypes-${example}-copy-objects COMMAND ${CMAKE_COMMAND} @@ -110,5 +110,5 @@ if (BUILD_TESTING) set_tests_properties (JAVA_datatypes-${example}-copy-objects PROPERTIES DEPENDS JAVA_datatypes-${example}-clear-objects) set (last_test "JAVA_datatypes-${example}-copy-objects") ADD_H5_TEST (${example} 0) - endforeach () -endif () + endforeach (example ${HDF_JAVA_EXAMPLES}) +endif (BUILD_TESTING) diff --git a/java/examples/datatypes/runExample.sh.in b/java/examples/datatypes/runExample.sh.in index 5b8816c..1b02774 100644 --- a/java/examples/datatypes/runExample.sh.in +++ b/java/examples/datatypes/runExample.sh.in @@ -158,7 +158,6 @@ CLEAN_DATAFILES_AND_BLDDIR() { $RM $BLDDIR/examples.datatypes.H5Ex_T_*.txt $RM $BLDDIR/H5Ex_T_*.out - $RM $BLDDIR/H5Ex_T_*.h5 } # Print a line-line message left justified in a field of 70 characters diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index bb5f80f..2cab211 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDFJAVA_EXAMPLES_GROUPS Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -20,16 +20,16 @@ set (HDF_JAVA_EXAMPLES if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") -else () +else (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") -endif () +endif (WIN32) set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS}") set (CMAKE_JAVA_CLASSPATH ".") foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") -endforeach () +endforeach (CMAKE_INCLUDE_PATH) foreach (example ${HDF_JAVA_EXAMPLES}) file (WRITE ${PROJECT_BINARY_DIR}/${example}_Manifest.txt @@ -41,14 +41,14 @@ foreach (example ${HDF_JAVA_EXAMPLES}) # install_jar (${example} ${HJAVA_INSTALL_DATA_DIR}/examples examples) get_target_property (${example}_CLASSPATH ${example} CLASSDIR) add_dependencies (${example} ${HDF5_JAVA_HDF5_LIB_TARGET}) -endforeach () +endforeach (example ${HDF_JAVA_EXAMPLES}) set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_NOP_JAR}") set (CMAKE_JAVA_CLASSPATH ".") foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}") -endforeach () +endforeach (HDFJAVA_JAR) set (HDF_JAVA_TEST_FILES h5ex_g_iterate.h5 @@ -57,17 +57,17 @@ set (HDF_JAVA_TEST_FILES foreach (h5_file ${HDF_JAVA_TEST_FILES}) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "H5Ex_G_Visit_files") -endforeach () +endforeach (h5_file ${HDF_JAVA_TEST_FILES}) add_custom_target(H5Ex_G_Visit_files ALL COMMENT "Copying files needed by H5Ex_G_Visit tests" DEPENDS ${H5Ex_G_Visit_files_list}) MACRO (ADD_H5_TEST resultfile resultcode) if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else () + else() set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () - endif () + endif() + endif(CMAKE_BUILD_TYPE MATCHES Debug) add_test ( NAME JAVA_groups-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -84,9 +84,9 @@ MACRO (ADD_H5_TEST resultfile resultcode) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_groups-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "JAVA_groups-${resultfile}") -ENDMACRO () +ENDMACRO (ADD_H5_TEST file) if (BUILD_TESTING) foreach (example ${HDF_JAVA_EXAMPLES}) @@ -99,19 +99,19 @@ if (BUILD_TESTING) ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}1.h5 ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}2.h5 ) - else () + else (${example} STREQUAL "H5Ex_G_Compact") add_test ( NAME JAVA_groups-${example}-clear-h5s COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ) - endif () + endif (${example} STREQUAL "H5Ex_G_Compact") if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_groups-${example}-clear-h5s PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "JAVA_groups-${example}-clear-h5s") - endif () + endif (NOT ${example} STREQUAL "H5Ex_G_Iterate" AND NOT ${example} STREQUAL "H5Ex_G_Visit") add_test ( NAME JAVA_groups-${example}-copy-objects COMMAND ${CMAKE_COMMAND} @@ -121,8 +121,8 @@ if (BUILD_TESTING) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_groups-${example}-copy-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "JAVA_groups-${example}-copy-objects") ADD_H5_TEST (${example} 0) - endforeach () -endif () + endforeach (example ${HDF_JAVA_EXAMPLES}) +endif (BUILD_TESTING) diff --git a/java/examples/groups/runExample.sh.in b/java/examples/groups/runExample.sh.in index 2a3f1c6..665b307 100644 --- a/java/examples/groups/runExample.sh.in +++ b/java/examples/groups/runExample.sh.in @@ -153,14 +153,6 @@ CLEAN_DATAFILES_AND_BLDDIR() { $RM $BLDDIR/examples.groups.H5Ex_G_*.txt $RM $BLDDIR/H5Ex_G_*.out - $RM $BLDDIR/H5Ex_G_*.h5 - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then SDIR=`$DIRNAME $tstfile` - $RM $BLDDIR/h5ex_g_iterate.h5 - $RM $BLDDIR/h5ex_g_visit.h5 - fi } COPY_REFFILES="$LIST_REF_FILES" diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 9dc4dd7..2d0c218 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDFJAVA_EXAMPLES_INTRO Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -20,16 +20,16 @@ set (HDF_JAVA_EXAMPLES if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") -else () +else (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") -endif () +endif (WIN32) set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS}") set (CMAKE_JAVA_CLASSPATH ".") foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") -endforeach () +endforeach (CMAKE_INCLUDE_PATH) foreach (example ${HDF_JAVA_EXAMPLES}) file (WRITE ${PROJECT_BINARY_DIR}/${example}_Manifest.txt @@ -41,14 +41,14 @@ foreach (example ${HDF_JAVA_EXAMPLES}) # install_jar (${example} ${HJAVA_INSTALL_DATA_DIR}/examples examples) get_target_property (${example}_CLASSPATH ${example} CLASSDIR) add_dependencies (${example} ${HDF5_JAVA_HDF5_LIB_TARGET}) -endforeach () +endforeach (example ${HDF_JAVA_EXAMPLES}) set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_NOP_JAR}") set (CMAKE_JAVA_CLASSPATH ".") foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}") -endforeach () +endforeach (HDFJAVA_JAR) foreach (example ${HDF_JAVA_OBJECT_EXAMPLES}) file (WRITE ${PROJECT_BINARY_DIR}/${example}_Manifest.txt @@ -60,16 +60,16 @@ foreach (example ${HDF_JAVA_OBJECT_EXAMPLES}) # install_jar (${example} ${HJAVA_INSTALL_DATA_DIR}/examples examples) get_target_property (${example}_CLASSPATH ${example} CLASSDIR) add_dependencies (${example} ${HDFJAVA_H5_LIB_TARGET}) -endforeach () +endforeach (example ${HDF_JAVA_OBJECT_EXAMPLES}) MACRO (ADD_H5_TEST resultfile resultcode) if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else () + else() set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () - endif () + endif() + endif(CMAKE_BUILD_TYPE MATCHES Debug) add_test ( NAME JAVA_intro-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -86,9 +86,9 @@ MACRO (ADD_H5_TEST resultfile resultcode) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_intro-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "JAVA_intro-${resultfile}") -ENDMACRO () +ENDMACRO (ADD_H5_TEST file) if (BUILD_TESTING) @@ -101,7 +101,7 @@ if (BUILD_TESTING) ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (JAVA_intro-${example}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") add_test ( NAME JAVA_intro-${example}-copy-objects COMMAND ${CMAKE_COMMAND} @@ -112,6 +112,6 @@ if (BUILD_TESTING) set_tests_properties (JAVA_intro-${example}-copy-objects PROPERTIES DEPENDS JAVA_intro-${example}-clear-objects) set (last_test "JAVA_intro-${example}-copy-objects") ADD_H5_TEST (${example} 0) - endforeach () + endforeach (example ${HDF_JAVA_EXAMPLES}) -endif () +endif (BUILD_TESTING) diff --git a/java/examples/intro/runExample.sh.in b/java/examples/intro/runExample.sh.in index 65ca160..a8e65ff 100644 --- a/java/examples/intro/runExample.sh.in +++ b/java/examples/intro/runExample.sh.in @@ -147,7 +147,6 @@ CLEAN_DATAFILES_AND_BLDDIR() { $RM $BLDDIR/examples.intro.H5_*.txt $RM $BLDDIR/H5_*.out - $RM $BLDDIR/H5_*.h5 } # Print a line-line message left justified in a field of 70 characters diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt index 3f93f39..ae78201 100644 --- a/java/src/CMakeLists.txt +++ b/java/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2.2) +cmake_minimum_required(VERSION 3.1.0) PROJECT ( HDF5_JAVA_SRC C Java ) #----------------------------------------------------------------------------- diff --git a/java/src/Makefile.am b/java/src/Makefile.am index d9e6f50..21aa5ec 100644 --- a/java/src/Makefile.am +++ b/java/src/Makefile.am @@ -130,7 +130,6 @@ CLEANFILES = classhdf5_java.stamp $(jarfile) $(JAVAROOT)/$(pkgpath)/callbacks/*. clean: rm -rf $(JAVAROOT)/* rm -f $(jarfile) - rm -rf javadoc rm -f classhdf5_java.stamp diff --git a/java/src/hdf/CMakeLists.txt b/java/src/hdf/CMakeLists.txt index 84bda53..f465da9 100644 --- a/java/src/hdf/CMakeLists.txt +++ b/java/src/hdf/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_JAVA_HDF) add_subdirectory (${HDF5_JAVA_HDF_SOURCE_DIR}/hdf5lib hdf5lib) diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt index c856c04..5362c44 100644 --- a/java/src/hdf/hdf5lib/CMakeLists.txt +++ b/java/src/hdf/hdf5lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_JAVA_HDF_HDF5 Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -105,7 +105,7 @@ add_jar (${HDF5_JAVA_HDF5_LIB_TARGET} OUTPUT_NAME "${HDF5_JAVA_HDF5_LIB_TARGET}- install_jar (${HDF5_JAVA_HDF5_LIB_TARGET} LIBRARY DESTINATION ${HDF5_INSTALL_JAR_DIR} COMPONENT libraries) #if (NOT WIN32) # install_jni_symlink (${HDF5_JAVA_HDF5_LIB_TARGET} ${HDF5_INSTALL_JAR_DIR} libraries) -#endif () +#endif (NOT WIN32) get_target_property (${HDF5_JAVA_HDF5_LIB_TARGET}_JAR_FILE ${HDF5_JAVA_HDF5_LIB_TARGET} JAR_FILE) SET_GLOBAL_VARIABLE (HDF5_JAVA_JARS_TO_EXPORT "${HDF5_JAVA_JARS_TO_EXPORT};${${HDF5_JAVA_HDF5_LIB_TARGET}_JAR_FILE}") diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 02d35ba..6b2af4b 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -151,7 +151,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * layout of the source and destination, and the data for the array passed as a block of bytes, for instance, * *
- *      herr_t H5Dread(long fid, long filetype, long memtype, long memspace,
+ *      herr_t H5Dread(int fid, int filetype, int memtype, int memspace,
  *      void * data);
  * 
* @@ -171,7 +171,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * library. So the function above would be declared: * *
- * public synchronized static native int H5Dread(long fid, long filetype, long memtype, long memspace, Object data);
+ * public synchronized static native int H5Dread(int fid, int filetype, int memtype, int memspace, Object data);
  * 
* OPEN_IDS.addElement(id); @@ -192,7 +192,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * can be accessed as public variables of the Java class, such as: * *
- * long data_type = HDF5CDataTypes.JH5T_NATIVE_INT;
+ * int data_type = HDF5CDataTypes.JH5T_NATIVE_INT;
  * 
* * The Java application uses both types of constants the same way, the only difference is that the diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 9e6c099..9da31ee 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_JAVA_JNI C CXX) set (HDF5_JAVA_JNI_CSRCS @@ -67,8 +67,8 @@ if (WIN32) COMMENT "Copying ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${HDF5_JAVA_JNI_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) add_dependencies (HDF5_JAVA_JNI-Test-Copy ${HDF5_JAVA_JNI_LIB_TARGET}) - endif () -endif () + endif (BUILD_TESTING) +endif (WIN32) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects @@ -79,11 +79,11 @@ if (HDF5_EXPORTED_TARGETS) TARGETS ${HDF5_JAVA_JNI_LIB_TARGET} EXPORT - ${HDF5_EXPORTED_TARGETS} + ${HDF5_JAVA_EXPORTED_TARGETS} LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries RUNTIME DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT libraries INCLUDES DESTINATION include ) -endif () +endif (HDF5_EXPORTED_TARGETS) diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index ccd0b91..976a224 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -28,396 +28,396 @@ extern "C" { #pragma GCC diagnostic ignored "-Wmissing-prototypes" -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1QUARTER_1HADDR_1MAX(JNIEnv *env, jclass cls) { return (hsize_t)HADDR_MAX/4; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1SZIP_1ALLOW_1K13_1OPTION_1MASK(JNIEnv *env, jclass cls) { return H5_SZIP_ALLOW_K13_OPTION_MASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1SZIP_1CHIP_1OPTION_1MASK(JNIEnv *env, jclass cls) { return H5_SZIP_CHIP_OPTION_MASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1SZIP_1EC_1OPTION_1MASK(JNIEnv *env, jclass cls) { return H5_SZIP_EC_OPTION_MASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1SZIP_1MAX_1PIXELS_1PER_1BLOCK(JNIEnv *env, jclass cls) { return H5_SZIP_MAX_PIXELS_PER_BLOCK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1SZIP_1NN_1OPTION_1MASK(JNIEnv *env, jclass cls) { return H5_SZIP_NN_OPTION_MASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1INDEX_1UNKNOWN(JNIEnv *env, jclass cls) { return H5_INDEX_UNKNOWN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1INDEX_1NAME(JNIEnv *env, jclass cls) { return H5_INDEX_NAME; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1INDEX_1CRT_1ORDER(JNIEnv *env, jclass cls) { return H5_INDEX_CRT_ORDER; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1INDEX_1N(JNIEnv *env, jclass cls) { return H5_INDEX_N; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1ITER_1UNKNOWN(JNIEnv *env, jclass cls) { return H5_ITER_UNKNOWN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1ITER_1INC(JNIEnv *env, jclass cls) { return H5_ITER_INC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1ITER_1DEC(JNIEnv *env, jclass cls) { return H5_ITER_DEC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1ITER_1NATIVE(JNIEnv *env, jclass cls) { return H5_ITER_NATIVE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1ITER_1N(JNIEnv *env, jclass cls) { return H5_ITER_N; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5AC_1CURR_1CACHE_1CONFIG_1VERSION(JNIEnv *env, jclass cls) { return H5AC__CURR_CACHE_CONFIG_VERSION; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5AC_1MAX_1TRACE_1FILE_1NAME_1LEN(JNIEnv *env, jclass cls) { return H5AC__MAX_TRACE_FILE_NAME_LEN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5AC_1METADATA_1WRITE_1STRATEGY_1PROCESS_1ZERO_1ONLY(JNIEnv *env, jclass cls) { return H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5AC_1METADATA_1WRITE_1STRATEGY_1DISTRIBUTED(JNIEnv *env, jclass cls) { return H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1incr_1off(JNIEnv *env, jclass cls) { return H5C_incr__off; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1incr_1threshold(JNIEnv *env, jclass cls) { return H5C_incr__threshold; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1flash_1incr_1off(JNIEnv *env, jclass cls) { return H5C_flash_incr__off; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1flash_1incr_1add_1space(JNIEnv *env, jclass cls) { return H5C_flash_incr__add_space; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1decr_1off(JNIEnv *env, jclass cls) { return H5C_decr__off; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1decr_1threshold(JNIEnv *env, jclass cls) { return H5C_decr__threshold; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1decr_1age_1out(JNIEnv *env, jclass cls) { return H5C_decr__age_out; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5C_1decr_1age_1out_1with_1threshold(JNIEnv *env, jclass cls) { return H5C_decr__age_out_with_threshold; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1CHUNK_1IDX_1BTREE(JNIEnv *env, jclass cls) { return H5D_CHUNK_IDX_BTREE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1ALLOC_1TIME_1DEFAULT(JNIEnv *env, jclass cls) { return H5D_ALLOC_TIME_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1ALLOC_1TIME_1EARLY(JNIEnv *env, jclass cls) { return H5D_ALLOC_TIME_EARLY; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1ALLOC_1TIME_1ERROR(JNIEnv *env, jclass cls) { return H5D_ALLOC_TIME_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1ALLOC_1TIME_1INCR(JNIEnv *env, jclass cls) { return H5D_ALLOC_TIME_INCR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1ALLOC_1TIME_1LATE(JNIEnv *env, jclass cls) { return H5D_ALLOC_TIME_LATE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1TIME_1ERROR(JNIEnv *env, jclass cls) { return H5D_FILL_TIME_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1TIME_1ALLOC(JNIEnv *env, jclass cls) { return H5D_FILL_TIME_ALLOC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1TIME_1NEVER(JNIEnv *env, jclass cls) { return H5D_FILL_TIME_NEVER; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1TIME_1IFSET(JNIEnv *env, jclass cls) { return H5D_FILL_TIME_IFSET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1VALUE_1DEFAULT(JNIEnv *env, jclass cls) { return H5D_FILL_VALUE_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1VALUE_1ERROR(JNIEnv *env, jclass cls) { return H5D_FILL_VALUE_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1VALUE_1UNDEFINED(JNIEnv *env, jclass cls) { return H5D_FILL_VALUE_UNDEFINED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1FILL_1VALUE_1USER_1DEFINED(JNIEnv *env, jclass cls) { return H5D_FILL_VALUE_USER_DEFINED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1LAYOUT_1ERROR(JNIEnv *env, jclass cls) { return H5D_LAYOUT_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1CHUNKED(JNIEnv *env, jclass cls) { return H5D_CHUNKED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1COMPACT(JNIEnv *env, jclass cls) { return H5D_COMPACT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1CONTIGUOUS(JNIEnv *env, jclass cls) { return H5D_CONTIGUOUS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VIRTUAL(JNIEnv *env, jclass cls) { return H5D_VIRTUAL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1NLAYOUTS(JNIEnv *env, jclass cls) { return H5D_NLAYOUTS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1SPACE_1STATUS_1ALLOCATED(JNIEnv *env, jclass cls) { return H5D_SPACE_STATUS_ALLOCATED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1SPACE_1STATUS_1ERROR(JNIEnv *env, jclass cls) { return H5D_SPACE_STATUS_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1SPACE_1STATUS_1NOT_1ALLOCATED(JNIEnv *env, jclass cls) { return H5D_SPACE_STATUS_NOT_ALLOCATED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1SPACE_1STATUS_1PART_1ALLOCATED(JNIEnv *env, jclass cls) { return H5D_SPACE_STATUS_PART_ALLOCATED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1ERROR(JNIEnv *env, jclass cls) { return H5D_VDS_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1FIRST_1MISSING(JNIEnv *env, jclass cls) { return H5D_VDS_FIRST_MISSING; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5D_1VDS_1LAST_1AVAILABLE(JNIEnv *env, jclass cls) { return H5D_VDS_LAST_AVAILABLE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ALIGNMENT(JNIEnv *env, jclass cls) { return H5E_ALIGNMENT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ALREADYEXISTS(JNIEnv *env, jclass cls) { return H5E_ALREADYEXISTS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ALREADYINIT(JNIEnv *env, jclass cls) { return H5E_ALREADYINIT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ARGS(JNIEnv *env, jclass cls) { return H5E_ARGS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ATOM(JNIEnv *env, jclass cls) { return H5E_ATOM; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1ATTR(JNIEnv *env, jclass cls) { return H5E_ATTR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADATOM(JNIEnv *env, jclass cls) { return H5E_BADATOM; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADFILE(JNIEnv *env, jclass cls) { return H5E_BADFILE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADGROUP(JNIEnv *env, jclass cls) { return H5E_BADGROUP; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADMESG(JNIEnv *env, jclass cls) { return H5E_BADMESG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADRANGE(JNIEnv *env, jclass cls) { return H5E_BADRANGE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADSELECT(JNIEnv *env, jclass cls) { return H5E_BADSELECT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADSIZE(JNIEnv *env, jclass cls) { return H5E_BADSIZE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADTYPE(JNIEnv *env, jclass cls) { return H5E_BADTYPE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADVALUE(JNIEnv *env, jclass cls) { return H5E_BADVALUE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BTREE(JNIEnv *env, jclass cls) { return H5E_BTREE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CACHE(JNIEnv *env, jclass cls) { return H5E_CACHE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CALLBACK(JNIEnv *env, jclass cls) { return H5E_CALLBACK; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANAPPLY(JNIEnv *env, jclass cls) { return H5E_CANAPPLY; } -/*JNIEXPORT jlong JNICALL +/*JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTALLOC(JNIEnv *env, jclass cls) { return H5E_CANTALLOC; }*/ -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLIP(JNIEnv *env, jclass cls) { return H5E_CANTCLIP; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLOSEFILE(JNIEnv *env, jclass cls) { return H5E_CANTCLOSEFILE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCONVERT(JNIEnv *env, jclass cls) { return H5E_CANTCONVERT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOPY(JNIEnv *env, jclass cls) { return H5E_CANTCOPY; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOUNT(JNIEnv *env, jclass cls) { return H5E_CANTCOUNT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCREATE(JNIEnv *env, jclass cls) { return H5E_CANTCREATE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDEC(JNIEnv *env, jclass cls) { return H5E_CANTDEC; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDECODE(JNIEnv *env, jclass cls) { return H5E_CANTDECODE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDELETE(JNIEnv *env, jclass cls) { return H5E_CANTDELETE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTENCODE(JNIEnv *env, jclass cls) { return H5E_CANTENCODE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFLUSH(JNIEnv *env, jclass cls) { return H5E_CANTFLUSH; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFREE(JNIEnv *env, jclass cls) { return H5E_CANTFREE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGET(JNIEnv *env, jclass cls) { return H5E_CANTGET; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINC(JNIEnv *env, jclass cls) { return H5E_CANTINC; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINIT(JNIEnv *env, jclass cls) { return H5E_CANTINIT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINSERT(JNIEnv *env, jclass cls) { return H5E_CANTINSERT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLIST(JNIEnv *env, jclass cls) { return H5E_CANTLIST; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLOAD(JNIEnv *env, jclass cls) { return H5E_CANTLOAD; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLOCK(JNIEnv *env, jclass cls) { return H5E_CANTLOCK; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTNEXT(JNIEnv *env, jclass cls) { return H5E_CANTNEXT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPENFILE(JNIEnv *env, jclass cls) { return H5E_CANTOPENFILE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPENOBJ(JNIEnv *env, jclass cls) { return H5E_CANTOPENOBJ; } -/*JNIEXPORT jlong JNICALL +/*JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRECV(JNIEnv *env, jclass cls) { return H5E_CANTRECV; }*/ -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREGISTER(JNIEnv *env, jclass cls) { return H5E_CANTREGISTER; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRELEASE(JNIEnv *env, jclass cls) { return H5E_CANTRELEASE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSELECT(JNIEnv *env, jclass cls) { return H5E_CANTSELECT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSET(JNIEnv *env, jclass cls) { return H5E_CANTSET; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSPLIT(JNIEnv *env, jclass cls) { return H5E_CANTSPLIT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNLOCK(JNIEnv *env, jclass cls) { return H5E_CANTUNLOCK; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CLOSEERROR(JNIEnv *env, jclass cls) { return H5E_CLOSEERROR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1COMPLEN(JNIEnv *env, jclass cls) { return H5E_COMPLEN; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1DATASET(JNIEnv *env, jclass cls) { return H5E_DATASET; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1DATASPACE(JNIEnv *env, jclass cls) { return H5E_DATASPACE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1DATATYPE(JNIEnv *env, jclass cls) { return H5E_DATATYPE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1DEFAULT(JNIEnv *env, jclass cls) { return H5E_DEFAULT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1DUPCLASS(JNIEnv *env, jclass cls) { return H5E_DUPCLASS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1EFL(JNIEnv *env, jclass cls) { return H5E_EFL; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1EXISTS(JNIEnv *env, jclass cls) { return H5E_EXISTS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FCNTL(JNIEnv *env, jclass cls) { return H5E_FCNTL; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FILE(JNIEnv *env, jclass cls) { return H5E_FILE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FILEEXISTS(JNIEnv *env, jclass cls) { return H5E_FILEEXISTS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FILEOPEN(JNIEnv *env, jclass cls) { return H5E_FILEOPEN; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FUNC(JNIEnv *env, jclass cls) { return H5E_FUNC; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1HEAP(JNIEnv *env, jclass cls) { return H5E_HEAP; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1INTERNAL(JNIEnv *env, jclass cls) { return H5E_INTERNAL; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1IO(JNIEnv *env, jclass cls) { return H5E_IO; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1LINK(JNIEnv *env, jclass cls) { return H5E_LINK; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1LINKCOUNT(JNIEnv *env, jclass cls) { return H5E_LINKCOUNT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MAJOR(JNIEnv *env, jclass cls) { return H5E_MAJOR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MINOR(JNIEnv *env, jclass cls) { return H5E_MINOR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MOUNT(JNIEnv *env, jclass cls) { return H5E_MOUNT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MPI(JNIEnv *env, jclass cls) { return H5E_MPI; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MPIERRSTR(JNIEnv *env, jclass cls) { return H5E_MPIERRSTR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOFILTER(JNIEnv *env, jclass cls) { return H5E_NOFILTER; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOIDS(JNIEnv *env, jclass cls) { return H5E_NOIDS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NONE_1MAJOR(JNIEnv *env, jclass cls) { return H5E_NONE_MAJOR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NONE_1MINOR(JNIEnv *env, jclass cls) { return H5E_NONE_MINOR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOSPACE(JNIEnv *env, jclass cls) { return H5E_NOSPACE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTCACHED(JNIEnv *env, jclass cls) { return H5E_NOTCACHED; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTFOUND(JNIEnv *env, jclass cls) { return H5E_NOTFOUND; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTHDF5(JNIEnv *env, jclass cls) { return H5E_NOTHDF5; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1OHDR(JNIEnv *env, jclass cls) { return H5E_OHDR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1OVERFLOW(JNIEnv *env, jclass cls) { return H5E_OVERFLOW; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1PLINE(JNIEnv *env, jclass cls) { return H5E_PLINE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1PLIST(JNIEnv *env, jclass cls) { return H5E_PLIST; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1PROTECT(JNIEnv *env, jclass cls) { return H5E_PROTECT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1READERROR(JNIEnv *env, jclass cls) { return H5E_READERROR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1REFERENCE(JNIEnv *env, jclass cls) { return H5E_REFERENCE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1RESOURCE(JNIEnv *env, jclass cls) { return H5E_RESOURCE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1RS(JNIEnv *env, jclass cls) { return H5E_RS; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1SEEKERROR(JNIEnv *env, jclass cls) { return H5E_SEEKERROR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1SETLOCAL(JNIEnv *env, jclass cls) { return H5E_SETLOCAL; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1STORAGE(JNIEnv *env, jclass cls) { return H5E_STORAGE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1SYM(JNIEnv *env, jclass cls) { return H5E_SYM; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1TRUNCATED(JNIEnv *env, jclass cls) { return H5E_TRUNCATED; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1TST(JNIEnv *env, jclass cls) { return H5E_TST; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1UNINITIALIZED(JNIEnv *env, jclass cls) { return H5E_UNINITIALIZED; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1UNSUPPORTED(JNIEnv *env, jclass cls) { return H5E_UNSUPPORTED; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1VERSION(JNIEnv *env, jclass cls) { return H5E_VERSION; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1VFL(JNIEnv *env, jclass cls) { return H5E_VFL; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1WALK_1DOWNWARD(JNIEnv *env, jclass cls) { return H5E_WALK_DOWNWARD; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1WALK_1UPWARD(JNIEnv *env, jclass cls) { return H5E_WALK_UPWARD; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1WRITEERROR(JNIEnv *env, jclass cls) { return H5E_WRITEERROR; } /* Java does not have unsigned native types */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-conversion" -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1CREAT(JNIEnv *env, jclass cls) { return H5F_ACC_CREAT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1EXCL(JNIEnv *env, jclass cls) { return H5F_ACC_EXCL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1RDONLY(JNIEnv *env, jclass cls) { return H5F_ACC_RDONLY; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1RDWR(JNIEnv *env, jclass cls) { return H5F_ACC_RDWR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1TRUNC(JNIEnv *env, jclass cls) { return H5F_ACC_TRUNC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1DEFAULT(JNIEnv *env, jclass cls) { return H5F_ACC_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1SWMR_1READ(JNIEnv *env, jclass cls) { return H5F_ACC_SWMR_READ; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1SWMR_1WRITE(JNIEnv *env, jclass cls) { return H5F_ACC_SWMR_WRITE; } #pragma GCC diagnostic pop -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1DEFAULT(JNIEnv *env, jclass cls) { return H5F_CLOSE_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1SEMI(JNIEnv *env, jclass cls) { return H5F_CLOSE_SEMI; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1STRONG(JNIEnv *env, jclass cls) { return H5F_CLOSE_STRONG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1WEAK(JNIEnv *env, jclass cls) { return H5F_CLOSE_WEAK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1EARLIEST(JNIEnv *env, jclass cls){return H5F_LIBVER_EARLIEST;} -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1LATEST(JNIEnv *env, jclass cls){return H5F_LIBVER_LATEST;} -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1ALL(JNIEnv *env, jclass cls) { return H5F_OBJ_ALL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1ATTR(JNIEnv *env, jclass cls) { return H5F_OBJ_ATTR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1DATASET(JNIEnv *env, jclass cls) { return H5F_OBJ_DATASET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1DATATYPE(JNIEnv *env, jclass cls) { return H5F_OBJ_DATATYPE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1FILE(JNIEnv *env, jclass cls) { return H5F_OBJ_FILE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1GROUP(JNIEnv *env, jclass cls) { return H5F_OBJ_GROUP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1LOCAL(JNIEnv *env, jclass cls) { return H5F_OBJ_LOCAL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1SCOPE_1GLOBAL(JNIEnv *env, jclass cls) { return H5F_SCOPE_GLOBAL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1SCOPE_1LOCAL(JNIEnv *env, jclass cls) { return H5F_SCOPE_LOCAL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1UNLIMITED(JNIEnv *env, jclass cls) { return (jint)H5F_UNLIMITED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1FILE_1SPACE_1DEFAULT(JNIEnv *env, jclass cls) { return H5F_FILE_SPACE_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1FILE_1SPACE_1ALL_1PERSIST(JNIEnv *env, jclass cls) { return H5F_FILE_SPACE_ALL_PERSIST; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1FILE_1SPACE_1ALL(JNIEnv *env, jclass cls) { return H5F_FILE_SPACE_ALL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1FILE_1SPACE_1AGGR_1VFD(JNIEnv *env, jclass cls) { return H5F_FILE_SPACE_AGGR_VFD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1FILE_1SPACE_1VFD(JNIEnv *env, jclass cls) { return H5F_FILE_SPACE_VFD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1FILE_1SPACE_1NTYPES(JNIEnv *env, jclass cls) { return H5F_FILE_SPACE_NTYPES; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1CORE(JNIEnv *env, jclass cls) { return H5FD_CORE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1DIRECT(JNIEnv *env, jclass cls) { #ifdef H5_HAVE_DIRECT return H5FD_DIRECT; @@ -425,19 +425,19 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1DIRECT(JNIEnv *env, jclass cls) { return -1; #endif } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1FAMILY(JNIEnv *env, jclass cls) { return H5FD_FAMILY; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG(JNIEnv *env, jclass cls) { return H5FD_LOG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MPIO(JNIEnv *env, jclass cls) { return H5FD_MPIO; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MULTI(JNIEnv *env, jclass cls) { return H5FD_MULTI; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1SEC2(JNIEnv *env, jclass cls) { return H5FD_SEC2; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1STDIO(JNIEnv *env, jclass cls) { return H5FD_STDIO; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1WINDOWS(JNIEnv *env, jclass cls) { #ifdef H5_HAVE_WINDOWS return H5FD_DIRECT; @@ -445,84 +445,84 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1WINDOWS(JNIEnv *env, jclass cls) { return -1; #endif } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1LOC_1READ(JNIEnv *env, jclass cls) { return H5FD_LOG_LOC_READ; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1LOC_1WRITE(JNIEnv *env, jclass cls) { return H5FD_LOG_LOC_WRITE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1LOC_1SEEK(JNIEnv *env, jclass cls) { return H5FD_LOG_LOC_SEEK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1LOC_1IO(JNIEnv *env, jclass cls) { return H5FD_LOG_LOC_IO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1FILE_1READ(JNIEnv *env, jclass cls) { return H5FD_LOG_FILE_READ; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1FILE_1WRITE(JNIEnv *env, jclass cls) { return H5FD_LOG_FILE_WRITE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1FILE_1IO(JNIEnv *env, jclass cls) { return H5FD_LOG_FILE_IO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1FLAVOR(JNIEnv *env, jclass cls) { return H5FD_LOG_FLAVOR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1NUM_1READ(JNIEnv *env, jclass cls) { return H5FD_LOG_NUM_READ; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1NUM_1WRITE(JNIEnv *env, jclass cls) { return H5FD_LOG_NUM_WRITE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1NUM_1SEEK(JNIEnv *env, jclass cls) { return H5FD_LOG_NUM_SEEK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1NUM_1TRUNCATE(JNIEnv *env, jclass cls) { return H5FD_LOG_NUM_TRUNCATE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1NUM_1IO(JNIEnv *env, jclass cls) { return H5FD_LOG_NUM_IO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1OPEN(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_OPEN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1STAT(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_STAT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1READ(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_READ; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1WRITE(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_WRITE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1SEEK(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_SEEK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1CLOSE(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_CLOSE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1TIME_1IO(JNIEnv *env, jclass cls) { return H5FD_LOG_TIME_IO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1ALLOC(JNIEnv *env, jclass cls) { return H5FD_LOG_ALLOC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG_1ALL(JNIEnv *env, jclass cls) { return H5FD_LOG_ALL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1NOLIST(JNIEnv *env, jclass cls) { return H5FD_MEM_NOLIST; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT(JNIEnv *env, jclass cls) { return H5FD_MEM_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1SUPER(JNIEnv *env, jclass cls) { return H5FD_MEM_SUPER; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1BTREE(JNIEnv *env, jclass cls) { return H5FD_MEM_BTREE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DRAW(JNIEnv *env, jclass cls) { return H5FD_MEM_DRAW; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1GHEAP(JNIEnv *env, jclass cls) { return H5FD_MEM_GHEAP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1LHEAP(JNIEnv *env, jclass cls) { return H5FD_MEM_LHEAP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1OHDR(JNIEnv *env, jclass cls) { return H5FD_MEM_OHDR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1NTYPES(JNIEnv *env, jclass cls) { return H5FD_MEM_NTYPES; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1DEFAULT_1HADDR_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)(HADDR_MAX/H5FD_MEM_NTYPES); } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)0; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1SUPER_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)0; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1BTREE_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)(1 * (HADDR_MAX / (H5FD_MEM_NTYPES-1))); } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1DRAW_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)(2 * (HADDR_MAX / (H5FD_MEM_NTYPES-1))); } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1GHEAP_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)(3 * (HADDR_MAX / (H5FD_MEM_NTYPES-1))); } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1LHEAP_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)(4 * (HADDR_MAX / (H5FD_MEM_NTYPES-1))); } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1OHDR_1SIZE(JNIEnv *env, jclass cls) { return (hsize_t)(5 * (HADDR_MAX / (H5FD_MEM_NTYPES-1))); } @@ -532,769 +532,769 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1MEM_1DEFAULT_1OHDR_1SIZE(JNIEnv *env, jclas */ #ifndef H5_NO_DEPRECATED_SYMBOLS -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1DATASET(JNIEnv *env, jclass cls) { return H5G_DATASET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1GROUP(JNIEnv *env, jclass cls) { return H5G_GROUP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1LINK(JNIEnv *env, jclass cls) { return H5G_LINK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1UDLINK(JNIEnv *env, jclass cls) { return H5G_UDLINK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1RESERVED_15(JNIEnv *env, jclass cls) { return H5G_RESERVED_5; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1RESERVED_16(JNIEnv *env, jclass cls) { return H5G_RESERVED_6; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1RESERVED_17(JNIEnv *env, jclass cls) { return H5G_RESERVED_7; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1TYPE(JNIEnv *env, jclass cls) { return H5G_TYPE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1UNKNOWN(JNIEnv *env, jclass cls) { return H5G_UNKNOWN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1LINK_1ERROR(JNIEnv *env, jclass cls) { return H5G_LINK_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1LINK_1HARD(JNIEnv *env, jclass cls) { return H5G_LINK_HARD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1LINK_1SOFT(JNIEnv *env, jclass cls) { return H5G_LINK_SOFT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1NLIBTYPES(JNIEnv *env, jclass cls) { return H5G_NLIBTYPES; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1NTYPES(JNIEnv *env, jclass cls) { return H5G_NTYPES; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1NUSERTYPES(JNIEnv *env, jclass cls) { return H5G_NUSERTYPES; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1SAME_1LOC(JNIEnv *env, jclass cls) { return H5G_SAME_LOC; } #endif /* H5_NO_DEPRECATED_SYMBOLS */ -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1STORAGE_1TYPE_1UNKNOWN(JNIEnv *env, jclass cls){ return H5G_STORAGE_TYPE_UNKNOWN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1STORAGE_1TYPE_1SYMBOL_1TABLE(JNIEnv *env, jclass cls){ return H5G_STORAGE_TYPE_SYMBOL_TABLE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1STORAGE_1TYPE_1COMPACT(JNIEnv *env, jclass cls){ return H5G_STORAGE_TYPE_COMPACT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5G_1STORAGE_1TYPE_1DENSE(JNIEnv *env, jclass cls){ return H5G_STORAGE_TYPE_DENSE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1UNINIT(JNIEnv *env, jclass cls) { return H5I_UNINIT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1BADID(JNIEnv *env, jclass cls) { return H5I_BADID; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1FILE(JNIEnv *env, jclass cls) { return H5I_FILE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1GROUP(JNIEnv *env, jclass cls) { return H5I_GROUP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1DATATYPE(JNIEnv *env, jclass cls) { return H5I_DATATYPE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1DATASPACE(JNIEnv *env, jclass cls) { return H5I_DATASPACE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1DATASET(JNIEnv *env, jclass cls) { return H5I_DATASET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1ATTR(JNIEnv *env, jclass cls) { return H5I_ATTR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1REFERENCE(JNIEnv *env, jclass cls) { return H5I_REFERENCE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1VFL(JNIEnv *env, jclass cls) { return H5I_VFL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1INVALID_1HID(JNIEnv *env, jclass cls) { return H5I_INVALID_HID; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1GENPROP_1CLS(JNIEnv *env, jclass cls) { return H5I_GENPROP_CLS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1GENPROP_1LST(JNIEnv *env, jclass cls) { return H5I_GENPROP_LST; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1ERROR_1CLASS(JNIEnv *env, jclass cls) { return H5I_ERROR_CLASS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1ERROR_1MSG(JNIEnv *env, jclass cls) { return H5I_ERROR_MSG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1ERROR_1STACK(JNIEnv *env, jclass cls) { return H5I_ERROR_STACK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1NTYPES(JNIEnv *env, jclass cls) { return H5I_NTYPES; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5L_1TYPE_1ERROR(JNIEnv *env, jclass cls) { return H5L_TYPE_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5L_1TYPE_1HARD(JNIEnv *env, jclass cls) { return H5L_TYPE_HARD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5L_1TYPE_1SOFT(JNIEnv *env, jclass cls) { return H5L_TYPE_SOFT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5L_1TYPE_1EXTERNAL(JNIEnv *env, jclass cls) { return H5L_TYPE_EXTERNAL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5L_1TYPE_1MAX(JNIEnv *env, jclass cls) { return H5L_TYPE_MAX; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1COPY_1SHALLOW_1HIERARCHY_1FLAG(JNIEnv *env, jclass cls){return H5O_COPY_SHALLOW_HIERARCHY_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1COPY_1EXPAND_1SOFT_1LINK_1FLAG(JNIEnv *env, jclass cls){return H5O_COPY_EXPAND_SOFT_LINK_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1COPY_1EXPAND_1EXT_1LINK_1FLAG(JNIEnv *env, jclass cls){return H5O_COPY_EXPAND_EXT_LINK_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1COPY_1EXPAND_1REFERENCE_1FLAG(JNIEnv *env, jclass cls){return H5O_COPY_EXPAND_REFERENCE_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1COPY_1WITHOUT_1ATTR_1FLAG(JNIEnv *env, jclass cls){return H5O_COPY_WITHOUT_ATTR_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1COPY_1PRESERVE_1NULL_1FLAG(JNIEnv *env, jclass cls){return H5O_COPY_PRESERVE_NULL_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1NONE_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_NONE_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1SDSPACE_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_SDSPACE_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1DTYPE_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_DTYPE_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1FILL_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_FILL_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1PLINE_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_PLINE_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1ATTR_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_ATTR_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1SHMESG_1ALL_1FLAG(JNIEnv *env, jclass cls){return H5O_SHMESG_ALL_FLAG; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1TYPE_1UNKNOWN(JNIEnv *env, jclass cls) { return H5O_TYPE_UNKNOWN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1TYPE_1GROUP(JNIEnv *env, jclass cls) { return H5O_TYPE_GROUP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1TYPE_1DATASET(JNIEnv *env, jclass cls) { return H5O_TYPE_DATASET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1TYPE_1NAMED_1DATATYPE(JNIEnv *env, jclass cls) { return H5O_TYPE_NAMED_DATATYPE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5O_1TYPE_1NTYPES(JNIEnv *env, jclass cls) { return H5O_TYPE_NTYPES; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1ROOT(JNIEnv *env, jclass cls){return H5P_ROOT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1OBJECT_1CREATE(JNIEnv *env, jclass cls){return H5P_OBJECT_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1FILE_1CREATE(JNIEnv *env, jclass cls){return H5P_FILE_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1FILE_1ACCESS(JNIEnv *env, jclass cls){return H5P_FILE_ACCESS;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATASET_1CREATE(JNIEnv *env, jclass cls){return H5P_DATASET_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATASET_1ACCESS(JNIEnv *env, jclass cls){return H5P_DATASET_ACCESS;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATASET_1XFER(JNIEnv *env, jclass cls){return H5P_DATASET_XFER;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1FILE_1MOUNT(JNIEnv *env, jclass cls){return H5P_FILE_MOUNT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1GROUP_1CREATE(JNIEnv *env, jclass cls){return H5P_GROUP_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1GROUP_1ACCESS(JNIEnv *env, jclass cls){return H5P_GROUP_ACCESS;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATATYPE_1CREATE(JNIEnv *env, jclass cls){return H5P_DATATYPE_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATATYPE_1ACCESS(JNIEnv *env, jclass cls){return H5P_DATATYPE_ACCESS;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1STRING_1CREATE(JNIEnv *env, jclass cls){return H5P_STRING_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1ATTRIBUTE_1CREATE(JNIEnv *env, jclass cls){return H5P_ATTRIBUTE_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1ATTRIBUTE_1ACCESS(JNIEnv *env, jclass cls){return H5P_ATTRIBUTE_ACCESS;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1OBJECT_1COPY(JNIEnv *env, jclass cls){return H5P_OBJECT_COPY;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1LINK_1CREATE(JNIEnv *env, jclass cls){return H5P_LINK_CREATE;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1LINK_1ACCESS(JNIEnv *env, jclass cls){return H5P_LINK_ACCESS;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1FILE_1CREATE_1DEFAULT(JNIEnv *env, jclass cls){return H5P_FILE_CREATE_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1FILE_1ACCESS_1DEFAULT(JNIEnv *env, jclass cls){return H5P_FILE_ACCESS_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATASET_1CREATE_1DEFAULT(JNIEnv *env, jclass cls){return H5P_DATASET_CREATE_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATASET_1ACCESS_1DEFAULT(JNIEnv *env, jclass cls){return H5P_DATASET_ACCESS_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATASET_1XFER_1DEFAULT(JNIEnv *env, jclass cls){return H5P_DATASET_XFER_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1FILE_1MOUNT_1DEFAULT(JNIEnv *env, jclass cls){return H5P_FILE_MOUNT_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1GROUP_1CREATE_1DEFAULT(JNIEnv *env, jclass cls){return H5P_GROUP_CREATE_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1GROUP_1ACCESS_1DEFAULT(JNIEnv *env, jclass cls){return H5P_GROUP_ACCESS_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATATYPE_1CREATE_1DEFAULT(JNIEnv *env, jclass cls){return H5P_DATATYPE_CREATE_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DATATYPE_1ACCESS_1DEFAULT(JNIEnv *env, jclass cls){return H5P_DATATYPE_ACCESS_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1ATTRIBUTE_1CREATE_1DEFAULT(JNIEnv *env, jclass cls){return H5P_ATTRIBUTE_CREATE_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1ATTRIBUTE_1ACCESS_1DEFAULT(JNIEnv *env, jclass cls){return H5P_ATTRIBUTE_ACCESS_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1OBJECT_1COPY_1DEFAULT(JNIEnv *env, jclass cls){return H5P_OBJECT_COPY_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1LINK_1CREATE_1DEFAULT(JNIEnv *env, jclass cls){return H5P_LINK_CREATE_DEFAULT;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1LINK_1ACCESS_1DEFAULT(JNIEnv *env, jclass cls){return H5P_LINK_ACCESS_DEFAULT;} -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1CRT_1ORDER_1TRACKED(JNIEnv *env, jclass cls){return H5P_CRT_ORDER_TRACKED;} -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1CRT_1ORDER_1INDEXED(JNIEnv *env, jclass cls){return H5P_CRT_ORDER_INDEXED;} -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1DEFAULT(JNIEnv *env, jclass cls) { return H5P_DEFAULT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5P_1NO_1CLASS(JNIEnv *env, jclass cls) { return H5P_ROOT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5PL_1TYPE_1ERROR(JNIEnv *env, jclass cls) { return H5PL_TYPE_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5PL_1TYPE_1FILTER(JNIEnv *env, jclass cls) { return H5PL_TYPE_FILTER; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5PL_1FILTER_1PLUGIN(JNIEnv *env, jclass cls) { return H5PL_FILTER_PLUGIN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5PL_1ALL_1PLUGIN(JNIEnv *env, jclass cls) { return H5PL_ALL_PLUGIN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5R_1BADTYPE(JNIEnv *env, jclass cls) { return H5R_BADTYPE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5R_1MAXTYPE(JNIEnv *env, jclass cls) { return H5R_MAXTYPE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5R_1OBJ_1REF_1BUF_1SIZE(JNIEnv *env, jclass cls) { return H5R_OBJ_REF_BUF_SIZE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5R_1DSET_1REG_1REF_1BUF_1SIZE(JNIEnv *env, jclass cls) { return H5R_DSET_REG_REF_BUF_SIZE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5R_1OBJECT(JNIEnv *env, jclass cls) { return H5R_OBJECT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5R_1DATASET_1REGION(JNIEnv *env, jclass cls) { return H5R_DATASET_REGION; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1ALL(JNIEnv *env, jclass cls) { return H5S_ALL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1MAX_1RANK(JNIEnv *env, jclass cls) { return H5S_MAX_RANK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1NO_1CLASS(JNIEnv *env, jclass cls) { return H5S_NO_CLASS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1NULL(JNIEnv *env, jclass cls) { return H5S_NULL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SCALAR(JNIEnv *env, jclass cls) { return H5S_SCALAR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SEL_1ALL(JNIEnv *env, jclass cls) { return H5S_SEL_ALL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SEL_1ERROR(JNIEnv *env, jclass cls) { return H5S_SEL_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SEL_1HYPERSLABS(JNIEnv *env, jclass cls) { return H5S_SEL_HYPERSLABS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SEL_1N(JNIEnv *env, jclass cls) { return H5S_SEL_N; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SEL_1NONE(JNIEnv *env, jclass cls) { return H5S_SEL_NONE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SEL_1POINTS(JNIEnv *env, jclass cls) { return H5S_SEL_POINTS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1AND(JNIEnv *env, jclass cls) { return H5S_SELECT_AND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1APPEND(JNIEnv *env, jclass cls) { return H5S_SELECT_APPEND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1INVALID(JNIEnv *env, jclass cls) { return H5S_SELECT_INVALID; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1NOOP(JNIEnv *env, jclass cls) { return H5S_SELECT_NOOP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1NOTA(JNIEnv *env, jclass cls) { return H5S_SELECT_NOTA; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1NOTB(JNIEnv *env, jclass cls) { return H5S_SELECT_NOTB; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1OR(JNIEnv *env, jclass cls) { return H5S_SELECT_OR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1PREPEND(JNIEnv *env, jclass cls) { return H5S_SELECT_PREPEND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1SET(JNIEnv *env, jclass cls) { return H5S_SELECT_SET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SELECT_1XOR(JNIEnv *env, jclass cls) { return H5S_SELECT_XOR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1SIMPLE(JNIEnv *env, jclass cls) { return H5S_SIMPLE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5S_1UNLIMITED(JNIEnv *env, jclass cls) { return (jint)H5S_UNLIMITED; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1B16(JNIEnv *env, jclass cls) { return H5T_ALPHA_B16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1B32(JNIEnv *env, jclass cls) { return H5T_ALPHA_B32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1B64(JNIEnv *env, jclass cls) { return H5T_ALPHA_B64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1B8(JNIEnv *env, jclass cls) { return H5T_ALPHA_B8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1F32(JNIEnv *env, jclass cls) { return H5T_ALPHA_F32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1F64(JNIEnv *env, jclass cls) { return H5T_ALPHA_F64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1I16(JNIEnv *env, jclass cls) { return H5T_ALPHA_I16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1I32(JNIEnv *env, jclass cls) { return H5T_ALPHA_I32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1I64(JNIEnv *env, jclass cls) { return H5T_ALPHA_I64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1I8(JNIEnv *env, jclass cls) { return H5T_ALPHA_I8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1U16(JNIEnv *env, jclass cls) { return H5T_ALPHA_U16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1U32(JNIEnv *env, jclass cls) { return H5T_ALPHA_U32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1U64(JNIEnv *env, jclass cls) { return H5T_ALPHA_U64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ALPHA_1U8(JNIEnv *env, jclass cls) { return H5T_ALPHA_U8; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ARRAY(JNIEnv *env, jclass cls) { return H5T_ARRAY; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1BITFIELD(JNIEnv *env, jclass cls) { return H5T_BITFIELD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1BKG_1NO(JNIEnv *env, jclass cls) { return H5T_BKG_NO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1BKG_1YES(JNIEnv *env, jclass cls) { return H5T_BKG_YES; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1C_1S1(JNIEnv *env, jclass cls) { return H5T_C_S1; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1COMPOUND(JNIEnv *env, jclass cls) { return H5T_COMPOUND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CONV_1CONV(JNIEnv *env, jclass cls) { return H5T_CONV_CONV; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CONV_1FREE(JNIEnv *env, jclass cls) { return H5T_CONV_FREE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CONV_1INIT(JNIEnv *env, jclass cls) { return H5T_CONV_INIT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1ERROR(JNIEnv *env, jclass cls) { return H5T_CSET_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1ASCII(JNIEnv *env, jclass cls) { return H5T_CSET_ASCII; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1UTF8(JNIEnv *env, jclass cls) { return H5T_CSET_UTF8; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_110(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_10; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_111(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_11; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_112(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_12; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_113(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_13; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_114(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_14; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_115(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_15; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_12(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_2; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_13(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_3; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_14(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_4; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_15(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_5; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_16(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_6; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_17(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_7; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_18(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_8; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1CSET_1RESERVED_19(JNIEnv *env, jclass cls) { return H5T_CSET_RESERVED_9; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1DIR_1ASCEND(JNIEnv *env, jclass cls) { return H5T_DIR_ASCEND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1DIR_1DEFAULT(JNIEnv *env, jclass cls) { return H5T_DIR_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1DIR_1DESCEND(JNIEnv *env, jclass cls) { return H5T_DIR_DESCEND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ENUM(JNIEnv *env, jclass cls) { return H5T_ENUM; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1FLOAT(JNIEnv *env, jclass cls) { return H5T_FLOAT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1FORTRAN_1S1(JNIEnv *env, jclass cls) { return H5T_FORTRAN_S1; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1IEEE_1F32BE(JNIEnv *env, jclass cls) { return H5T_IEEE_F32BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1IEEE_1F32LE(JNIEnv *env, jclass cls) { return H5T_IEEE_F32LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1IEEE_1F64BE(JNIEnv *env, jclass cls) { return H5T_IEEE_F64BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1IEEE_1F64LE(JNIEnv *env, jclass cls) { return H5T_IEEE_F64LE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEGER(JNIEnv *env, jclass cls) { return H5T_INTEGER; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1B16(JNIEnv *env, jclass cls) { return H5T_INTEL_B16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1B32(JNIEnv *env, jclass cls) { return H5T_INTEL_B32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1B64(JNIEnv *env, jclass cls) { return H5T_INTEL_B64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1B8(JNIEnv *env, jclass cls) { return H5T_INTEL_B8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1F32(JNIEnv *env, jclass cls) { return H5T_INTEL_F32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1F64(JNIEnv *env, jclass cls) { return H5T_INTEL_F64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1I16(JNIEnv *env, jclass cls) { return H5T_INTEL_I16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1I32(JNIEnv *env, jclass cls) { return H5T_INTEL_I32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1I64(JNIEnv *env, jclass cls) { return H5T_INTEL_I64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1I8(JNIEnv *env, jclass cls) { return H5T_INTEL_I8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1U16(JNIEnv *env, jclass cls) { return H5T_INTEL_U16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1U32(JNIEnv *env, jclass cls) { return H5T_INTEL_U32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1U64(JNIEnv *env, jclass cls) { return H5T_INTEL_U64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEL_1U8(JNIEnv *env, jclass cls) { return H5T_INTEL_U8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1B16(JNIEnv *env, jclass cls) { return H5T_MIPS_B16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1B32(JNIEnv *env, jclass cls) { return H5T_MIPS_B32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1B64(JNIEnv *env, jclass cls) { return H5T_MIPS_B64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1B8(JNIEnv *env, jclass cls) { return H5T_MIPS_B8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1F32(JNIEnv *env, jclass cls) { return H5T_MIPS_F32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1F64(JNIEnv *env, jclass cls) { return H5T_MIPS_F64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1I16(JNIEnv *env, jclass cls) { return H5T_MIPS_I16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1I32(JNIEnv *env, jclass cls) { return H5T_MIPS_I32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1I64(JNIEnv *env, jclass cls) { return H5T_MIPS_I64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1I8(JNIEnv *env, jclass cls) { return H5T_MIPS_I8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1U16(JNIEnv *env, jclass cls) { return H5T_MIPS_U16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1U32(JNIEnv *env, jclass cls) { return H5T_MIPS_U32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1U64(JNIEnv *env, jclass cls) { return H5T_MIPS_U64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1MIPS_1U8(JNIEnv *env, jclass cls) { return H5T_MIPS_U8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1B16(JNIEnv *env, jclass cls) { return H5T_NATIVE_B16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1B32(JNIEnv *env, jclass cls) { return H5T_NATIVE_B32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1B64(JNIEnv *env, jclass cls) { return H5T_NATIVE_B64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1B8(JNIEnv *env, jclass cls) { return H5T_NATIVE_B8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1CHAR(JNIEnv *env, jclass cls) { return H5T_NATIVE_CHAR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1DOUBLE(JNIEnv *env, jclass cls) { return H5T_NATIVE_DOUBLE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1FLOAT(JNIEnv *env, jclass cls) { return H5T_NATIVE_FLOAT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1HADDR(JNIEnv *env, jclass cls) { return H5T_NATIVE_HADDR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1HBOOL(JNIEnv *env, jclass cls) { return H5T_NATIVE_HBOOL; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1HERR(JNIEnv *env, jclass cls) { return H5T_NATIVE_HERR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1HSIZE(JNIEnv *env, jclass cls) { return H5T_NATIVE_HSIZE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1HSSIZE(JNIEnv *env, jclass cls) { return H5T_NATIVE_HSSIZE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1FAST16(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_FAST16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1FAST32(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_FAST32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1FAST64(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_FAST64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1FAST8(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_FAST8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1LEAST16(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_LEAST16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1LEAST32(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_LEAST32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1LEAST64(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_LEAST64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT_1LEAST8(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT_LEAST8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT16(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT32(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT64(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1INT8(JNIEnv *env, jclass cls) { return H5T_NATIVE_INT8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1LDOUBLE(JNIEnv *env, jclass cls) { return H5T_NATIVE_LDOUBLE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1LLONG(JNIEnv *env, jclass cls) { return H5T_NATIVE_LLONG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1LONG(JNIEnv *env, jclass cls) { return H5T_NATIVE_LONG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1OPAQUE(JNIEnv *env, jclass cls) { return H5T_NATIVE_OPAQUE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1SCHAR(JNIEnv *env, jclass cls) { return H5T_NATIVE_SCHAR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1SHORT(JNIEnv *env, jclass cls) { return H5T_NATIVE_SHORT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UCHAR(JNIEnv *env, jclass cls) { return H5T_NATIVE_UCHAR; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1FAST16(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_FAST16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1FAST32(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_FAST32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1FAST64(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_FAST64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1FAST8(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_FAST8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1LEAST16(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_LEAST16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1LEAST32(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_LEAST32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1LEAST64(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_LEAST64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT_1LEAST8(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT_LEAST8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT16(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT16; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT32(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT32; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT64(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT64; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1UINT8(JNIEnv *env, jclass cls) { return H5T_NATIVE_UINT8; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1ULLONG(JNIEnv *env, jclass cls) { return H5T_NATIVE_ULLONG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1ULONG(JNIEnv *env, jclass cls) { return H5T_NATIVE_ULONG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1USHORT(JNIEnv *env, jclass cls) { return H5T_NATIVE_USHORT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NCLASSES(JNIEnv *env, jclass cls) { return H5T_NCLASSES; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NO_1CLASS(JNIEnv *env, jclass cls) { return H5T_NO_CLASS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NORM_1ERROR(JNIEnv *env, jclass cls) { return H5T_NORM_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NORM_1IMPLIED(JNIEnv *env, jclass cls) { return H5T_NORM_IMPLIED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NORM_1MSBSET(JNIEnv *env, jclass cls) { return H5T_NORM_MSBSET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NORM_1NONE(JNIEnv *env, jclass cls) { return H5T_NORM_NONE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NPAD(JNIEnv *env, jclass cls) { return H5T_NPAD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NSGN(JNIEnv *env, jclass cls) { return H5T_NSGN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1OPAQUE(JNIEnv *env, jclass cls) { return H5T_OPAQUE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1OPAQUE_1TAG_1MAX(JNIEnv *env, jclass cls) { return H5T_OPAQUE_TAG_MAX; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ORDER_1BE(JNIEnv *env, jclass cls) { return H5T_ORDER_BE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ORDER_1ERROR(JNIEnv *env, jclass cls) { return H5T_ORDER_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ORDER_1LE(JNIEnv *env, jclass cls) { return H5T_ORDER_LE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ORDER_1NONE(JNIEnv *env, jclass cls) { return H5T_ORDER_NONE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1ORDER_1VAX(JNIEnv *env, jclass cls) { return H5T_ORDER_VAX; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PAD_1BACKGROUND(JNIEnv *env, jclass cls) { return H5T_PAD_BACKGROUND; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PAD_1ERROR(JNIEnv *env, jclass cls) { return H5T_PAD_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PAD_1ONE(JNIEnv *env, jclass cls) { return H5T_PAD_ONE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PAD_1ZERO(JNIEnv *env, jclass cls) { return H5T_PAD_ZERO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PERS_1DONTCARE(JNIEnv *env, jclass cls) { return H5T_PERS_DONTCARE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PERS_1HARD(JNIEnv *env, jclass cls) { return H5T_PERS_HARD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1PERS_1SOFT(JNIEnv *env, jclass cls) { return H5T_PERS_SOFT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1REFERENCE(JNIEnv *env, jclass cls) { return H5T_REFERENCE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1SGN_12(JNIEnv *env, jclass cls) { return H5T_SGN_2; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1SGN_1ERROR(JNIEnv *env, jclass cls) { return H5T_SGN_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1SGN_1NONE(JNIEnv *env, jclass cls) { return H5T_SGN_NONE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B16BE(JNIEnv *env, jclass cls) { return H5T_STD_B16BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B16LE(JNIEnv *env, jclass cls) { return H5T_STD_B16LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B32BE(JNIEnv *env, jclass cls) { return H5T_STD_B32BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B32LE(JNIEnv *env, jclass cls) { return H5T_STD_B32LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B64BE(JNIEnv *env, jclass cls) { return H5T_STD_B64BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B64LE(JNIEnv *env, jclass cls) { return H5T_STD_B64LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B8BE(JNIEnv *env, jclass cls) { return H5T_STD_B8BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1B8LE(JNIEnv *env, jclass cls) { return H5T_STD_B8LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I16BE(JNIEnv *env, jclass cls) { return H5T_STD_I16BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I16LE(JNIEnv *env, jclass cls) { return H5T_STD_I16LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I32BE(JNIEnv *env, jclass cls) { return H5T_STD_I32BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I32LE(JNIEnv *env, jclass cls) { return H5T_STD_I32LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I64BE(JNIEnv *env, jclass cls) { return H5T_STD_I64BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I64LE(JNIEnv *env, jclass cls) { return H5T_STD_I64LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I8BE(JNIEnv *env, jclass cls) { return H5T_STD_I8BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1I8LE(JNIEnv *env, jclass cls) { return H5T_STD_I8LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1REF_1DSETREG(JNIEnv *env, jclass cls) { return H5T_STD_REF_DSETREG; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1REF_1OBJ(JNIEnv *env, jclass cls) { return H5T_STD_REF_OBJ; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U16BE(JNIEnv *env, jclass cls) { return H5T_STD_U16BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U16LE(JNIEnv *env, jclass cls) { return H5T_STD_U16LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U32BE(JNIEnv *env, jclass cls) { return H5T_STD_U32BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U32LE(JNIEnv *env, jclass cls) { return H5T_STD_U32LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U64BE(JNIEnv *env, jclass cls) { return H5T_STD_U64BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U64LE(JNIEnv *env, jclass cls) { return H5T_STD_U64LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U8BE(JNIEnv *env, jclass cls) { return H5T_STD_U8BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U8LE(JNIEnv *env, jclass cls) { return H5T_STD_U8LE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1ERROR(JNIEnv *env, jclass cls) { return H5T_STR_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1NULLPAD(JNIEnv *env, jclass cls) { return H5T_STR_NULLPAD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1NULLTERM(JNIEnv *env, jclass cls) { return H5T_STR_NULLTERM; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_110(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_10; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_111(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_11; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_112(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_12; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_113(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_13; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_114(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_14; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_115(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_15; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_13(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_3; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_14(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_4; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_15(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_5; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_16(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_6; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_17(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_7; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_18(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_8; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1RESERVED_19(JNIEnv *env, jclass cls) { return H5T_STR_RESERVED_9; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STR_1SPACEPAD(JNIEnv *env, jclass cls) { return H5T_STR_SPACEPAD; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1STRING(JNIEnv *env, jclass cls) { return H5T_STRING; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1TIME(JNIEnv *env, jclass cls) { return H5T_TIME; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1UNIX_1D32BE(JNIEnv *env, jclass cls) { return H5T_UNIX_D32BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1UNIX_1D32LE(JNIEnv *env, jclass cls) { return H5T_UNIX_D32LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1UNIX_1D64BE(JNIEnv *env, jclass cls) { return H5T_UNIX_D64BE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1UNIX_1D64LE(JNIEnv *env, jclass cls) { return H5T_UNIX_D64LE; } -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1VARIABLE(JNIEnv *env, jclass cls) { return (int)H5T_VARIABLE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1VLEN(JNIEnv *env, jclass cls) { return H5T_VLEN; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1CB_1CONT(JNIEnv *env, jclass cls) { return H5Z_CB_CONT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1CB_1ERROR(JNIEnv *env, jclass cls) { return H5Z_CB_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1CB_1FAIL(JNIEnv *env, jclass cls) { return H5Z_CB_FAIL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1CB_1NO(JNIEnv *env, jclass cls) { return H5Z_CB_NO; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1DISABLE_1EDC(JNIEnv *env, jclass cls) { return H5Z_DISABLE_EDC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1ENABLE_1EDC(JNIEnv *env, jclass cls) { return H5Z_ENABLE_EDC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1ERROR_1EDC(JNIEnv *env, jclass cls) { return H5Z_ERROR_EDC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1CONFIG_1DECODE_1ENABLED(JNIEnv *env, jclass cls) { return H5Z_FILTER_CONFIG_DECODE_ENABLED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1CONFIG_1ENCODE_1ENABLED(JNIEnv *env, jclass cls) { return H5Z_FILTER_CONFIG_ENCODE_ENABLED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1DEFLATE(JNIEnv *env, jclass cls) { return H5Z_FILTER_DEFLATE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1ERROR(JNIEnv *env, jclass cls) { return H5Z_FILTER_ERROR; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1FLETCHER32(JNIEnv *env, jclass cls) { return H5Z_FILTER_FLETCHER32; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1MAX(JNIEnv *env, jclass cls) { return H5Z_FILTER_MAX; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1NBIT(JNIEnv *env, jclass cls) {return H5Z_FILTER_NBIT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1NONE(JNIEnv *env, jclass cls) { return H5Z_FILTER_NONE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1RESERVED(JNIEnv *env, jclass cls) { return H5Z_FILTER_RESERVED; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1SCALEOFFSET(JNIEnv *env, jclass cls){ return H5Z_FILTER_SCALEOFFSET; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1SHUFFLE(JNIEnv *env, jclass cls) { return H5Z_FILTER_SHUFFLE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1SZIP(JNIEnv *env, jclass cls) { return H5Z_FILTER_SZIP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FLAG_1DEFMASK(JNIEnv *env, jclass cls) { return H5Z_FLAG_DEFMASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FLAG_1INVMASK(JNIEnv *env, jclass cls) { return H5Z_FLAG_INVMASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FLAG_1MANDATORY(JNIEnv *env, jclass cls) { return H5Z_FLAG_MANDATORY; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FLAG_1OPTIONAL(JNIEnv *env, jclass cls) { return H5Z_FLAG_OPTIONAL; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FLAG_1REVERSE(JNIEnv *env, jclass cls) { return H5Z_FLAG_REVERSE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FLAG_1SKIP_1EDC(JNIEnv *env, jclass cls) { return H5Z_FLAG_SKIP_EDC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1MAX_1NFILTERS(JNIEnv *env, jclass cls) { return H5Z_MAX_NFILTERS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1NO_1EDC(JNIEnv *env, jclass cls) { return H5Z_NO_EDC; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SO_1INT_1MINBITS_1DEFAULT(JNIEnv *env, jclass cls) { return H5Z_SO_INT_MINBITS_DEFAULT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SO_1FLOAT_1DSCALE(JNIEnv *env, jclass cls){return H5Z_SO_FLOAT_DSCALE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SO_1FLOAT_1ESCALE(JNIEnv *env, jclass cls){return H5Z_SO_FLOAT_ESCALE; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SO_1INT(JNIEnv *env, jclass cls){return H5Z_SO_INT; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SHUFFLE_1USER_1NPARMS(JNIEnv *env, jclass cls) { return H5Z_SHUFFLE_USER_NPARMS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SHUFFLE_1TOTAL_1NPARMS(JNIEnv *env, jclass cls) { return H5Z_SHUFFLE_TOTAL_NPARMS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SZIP_1USER_1NPARMS(JNIEnv *env, jclass cls) { return H5Z_SZIP_USER_NPARMS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SZIP_1TOTAL_1NPARMS(JNIEnv *env, jclass cls) { return H5Z_SZIP_TOTAL_NPARMS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SZIP_1PARM_1MASK(JNIEnv *env, jclass cls) { return H5Z_SZIP_PARM_MASK; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SZIP_1PARM_1PPB(JNIEnv *env, jclass cls) { return H5Z_SZIP_PARM_PPB; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SZIP_1PARM_1BPP(JNIEnv *env, jclass cls) { return H5Z_SZIP_PARM_BPP; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SZIP_1PARM_1PPS(JNIEnv *env, jclass cls) { return H5Z_SZIP_PARM_PPS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1NBIT_1USER_1NPARMS(JNIEnv *env, jclass cls) { return H5Z_NBIT_USER_NPARMS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1SCALEOFFSET_1USER_1NPARMS(JNIEnv *env, jclass cls) { return H5Z_SCALEOFFSET_USER_NPARMS; } -JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1ALL(JNIEnv *env, jclass cls) { return H5Z_FILTER_ALL; } #pragma GCC diagnostic pop diff --git a/java/src/jni/h5dImp.h b/java/src/jni/h5dImp.h index eb26265..2a91334 100644 --- a/java/src/jni/h5dImp.h +++ b/java/src/jni/h5dImp.h @@ -353,7 +353,7 @@ Java_hdf_hdf5lib_H5_H5Diterate * Method: H5Dflush * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Dflush (JNIEnv*, jclass, jlong); @@ -362,7 +362,7 @@ Java_hdf_hdf5lib_H5_H5Dflush * Method: H5Drefresh * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Drefresh (JNIEnv*, jclass, jlong); diff --git a/java/src/jni/h5fImp.h b/java/src/jni/h5fImp.h index 396df65..7aff835 100644 --- a/java/src/jni/h5fImp.h +++ b/java/src/jni/h5fImp.h @@ -217,7 +217,7 @@ Java_hdf_hdf5lib_H5_H5Fclear_1elink_1file_1cache * Method: H5Fstart_swmr_write * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Fstart_1swmr_1write (JNIEnv *, jclass, jlong); @@ -226,7 +226,7 @@ Java_hdf_hdf5lib_H5_H5Fstart_1swmr_1write * Method: H5Fstart_mdc_logging * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Fstart_1mdc_1logging (JNIEnv *, jclass, jlong); @@ -235,7 +235,7 @@ Java_hdf_hdf5lib_H5_H5Fstart_1mdc_1logging * Method: H5Fstop_mdc_logging * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Fstop_1mdc_1logging (JNIEnv *, jclass, jlong); @@ -244,7 +244,7 @@ Java_hdf_hdf5lib_H5_H5Fstop_1mdc_1logging * Method: H5Fget_mdc_logging_status * Signature: (J[Z)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Fget_1mdc_1logging_1status (JNIEnv *, jclass, jlong, jbooleanArray); diff --git a/java/src/jni/h5gImp.h b/java/src/jni/h5gImp.h index dce1247..3113689 100644 --- a/java/src/jni/h5gImp.h +++ b/java/src/jni/h5gImp.h @@ -102,7 +102,7 @@ Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx * Method: H5Gflush * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Gflush (JNIEnv*, jclass, jlong); @@ -111,7 +111,7 @@ Java_hdf_hdf5lib_H5_H5Gflush * Method: H5Grefresh * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Grefresh (JNIEnv*, jclass, jlong); diff --git a/java/src/jni/h5oImp.h b/java/src/jni/h5oImp.h index 5d07c29..293dc2e 100644 --- a/java/src/jni/h5oImp.h +++ b/java/src/jni/h5oImp.h @@ -191,7 +191,7 @@ Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx * Method: H5Oflush * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Oflush (JNIEnv*, jclass, jlong); @@ -200,7 +200,7 @@ Java_hdf_hdf5lib_H5_H5Oflush * Method: H5Orefresh * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Orefresh (JNIEnv*, jclass, jlong); diff --git a/java/src/jni/h5tImp.h b/java/src/jni/h5tImp.h index 417d231..e614082 100644 --- a/java/src/jni/h5tImp.h +++ b/java/src/jni/h5tImp.h @@ -613,7 +613,7 @@ Java_hdf_hdf5lib_H5_H5Tconvert * Method: H5Tflush * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Tflush (JNIEnv*, jclass, jlong); @@ -622,7 +622,7 @@ Java_hdf_hdf5lib_H5_H5Tflush * Method: H5Trefresh * Signature: (J)V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Trefresh (JNIEnv*, jclass, jlong); diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 8912b3f..b3a996b 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_JAVA_TEST Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -70,31 +70,31 @@ set (HDF_JAVA_TEST_FILES foreach (h5_file ${HDF_JAVA_TEST_FILES}) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "${HDF5_JAVA_TEST_LIB_TARGET}_files") -endforeach () +endforeach (h5_file ${HDF_JAVA_TEST_FILES}) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/h5ex_g_iterate.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_files") add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_files_list}) if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") -else () +else (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") -endif () +endif (WIN32) set (CMAKE_JAVA_CLASSPATH ".") foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") -endforeach () +endforeach (CMAKE_INCLUDE_PATH) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${HDF5_JAVA_TEST_LIB_TARGET}_JAR_FILE}") set (testfilter "OK (598 tests)") if (CMAKE_BUILD_TYPE MATCHES Debug) if (WIN32) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;") - else () + else() set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;") - endif () -endif () + endif() +endif(CMAKE_BUILD_TYPE MATCHES Debug) add_test ( NAME JUnit-interface-clearall-objects diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index 34ec02a..7fd80f8 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -530,7 +530,6 @@ JUnit version 4.11 .testH5Pvirtual_storage .testH5Pget_selection_source_dataset .testH5Pget_source_filename -.testH5Pset_get_virtual_printf_gap .testH5Pget_virtual_count .testH5Pset_get_virtual_view .testH5Pget_mapping_parameters @@ -638,7 +637,7 @@ JUnit version 4.11 Time: XXXX -OK (636 tests) +OK (635 tests) HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Fopen(): can't set access and transfer property lists diff --git a/java/test/TestH5Ocopy.java b/java/test/TestH5Ocopy.java index cf0fb1f..62dd886 100644 --- a/java/test/TestH5Ocopy.java +++ b/java/test/TestH5Ocopy.java @@ -239,7 +239,6 @@ public class TestH5Ocopy { try {H5.H5Pclose(ocp_plist_id);} catch (Exception ex) {} try {H5.H5Fclose(H5fid2);} catch (Exception ex) {} } - _deleteFile("copy.h5"); } @Test diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java index 15fbd03..9372ae1 100644 --- a/java/test/TestH5Pvirtual.java +++ b/java/test/TestH5Pvirtual.java @@ -220,7 +220,6 @@ public class TestH5Pvirtual { try {H5.H5Dclose(H5did);} catch (Exception ex) {} } assertTrue("testH5Pget_virtual_count: "+num_map, num_map >= 0); - assertEquals(3, num_map); } @Test @@ -407,7 +406,7 @@ public class TestH5Pvirtual { } } - @Test + @Ignore public void testH5Pset_get_virtual_printf_gap() { long ret_val = -1; H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id); @@ -416,7 +415,7 @@ public class TestH5Pvirtual { assertTrue("H5Pget_virtual_printf_gap", ret_val >= 0); assertEquals(0, ret_val); H5.H5Pset_virtual_printf_gap(H5dapl_id, 2); - ret_val = H5.H5Pget_virtual_printf_gap(H5dapl_id); + ret_val = H5.H5Pget_virtual_view(H5dapl_id); assertTrue("H5Pget_virtual_printf_gap", ret_val >= 0); assertEquals(2, ret_val); } diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index 31037ba..a9a71cb 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -183,16 +183,7 @@ CLEAN_DATAFILES_AND_BLDDIR() $RM $BLDDIR/JUnit-interface.out $RM $BLDDIR/JUnit-interface.err $RM $BLDDIR/JUnit-interface.ext - # skip rm if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $RM $BLDDIR/JUnit-interface.ert $RM $BLDDIR/JUnit-interface.txt - fi } # Print a line-line message left justified in a field of 70 characters diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 70ec47f..ee331a8 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -30,7 +30,7 @@ Obtaining HDF5 source code CMake version 1. We suggest you obtain the latest CMake from the Kitware web site. - The HDF5 1.10."X" product requires a minimum CMake version 3.2.2, + The HDF5 1.10."X" product requires a minimum CMake version 3.1.0, where "X" is the current HDF5 release version. Note: @@ -51,7 +51,7 @@ The following files referenced below are available at the HDF web site: http://www.hdfgroup.org/HDF5/release/cmakebuild.html Single compressed file with all the files needed, including source: - hdf5-1.10.X-CMake.zip or hdf5-1.10.X-CMake.tar.gz + hdf5-1.10.0-CMake.zip or hdf5-1.10.0-CMake.tar.gz Individual files ----------------------------------------------- @@ -249,7 +249,7 @@ IV. Further considerations ======================================================================== 1. We suggest you obtain the latest CMake for windows from the Kitware - web site. The HDF5 1.10."X" product requires a minimum CMake version 3.2.2. + web site. The HDF5 1.10."X" product requires a minimum CMake version 3.1.0. 2. If you plan to use Zlib or Szip: A. Download the binary packages and install them in a central location. @@ -263,10 +263,10 @@ IV. Further considerations B. Use source packages from an SVN server by adding the following CMake options: - HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="GIT" - ZLIB_GIT_URL:STRING="http://some_location/zlib" - SZIP_GIT_URL:STRING="http://some_location/szip" - where "some_location" is the URL to the GIT repository. Also set + HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" + ZLIB_SVN_URL:STRING="http://some_location/zlib/trunk" + SZIP_SVN_URL:STRING="http://some_location/szip/trunk" + where "some_location" is the URL to the SVN repository. Also set CMAKE_BUILD_TYPE to the configuration type. C. Use source packages from a compressed file by adding the following @@ -376,10 +376,10 @@ These five steps are described in detail below. * MinGW Makefiles * NMake Makefiles * Unix Makefiles - * Visual Studio 11 2012 - * Visual Studio 11 2012 Win64 * Visual Studio 12 2013 * Visual Studio 12 2013 Win64 + * Visual Studio 11 2012 + * Visual Studio 11 2012 Win64 * Visual Studio 14 2015 * Visual Studio 14 2015 Win64 @@ -396,7 +396,6 @@ These five steps are described in detail below. # EXTERNAL cache entries ######################## set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) - set (HDF5_GENERATE_HEADERS ON CACHE BOOL "Rebuild Generated Files" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) @@ -404,7 +403,7 @@ These five steps are described in detail below. set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) set (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) - set (ALLOW_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) + set (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) set (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) set (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) set (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) @@ -414,16 +413,14 @@ These five steps are described in detail below. set (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) set (HDF5_MEMORY_ALLOC_SANITY_CHECK OFF CACHE BOOL "Indicate that internal memory allocation sanity checks are enabled" FORCE) set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) - set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) - set (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) set (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" FORCE) set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) - set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT SVN TGZ)" FORCE) - set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT SVN TGZ) + set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE) + set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO SVN TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) @@ -480,15 +477,15 @@ These five steps are described in detail below. Release and build the solution. 3.2.1 The external libraries (zlib and szip) can be configured - to allow building the libraries by downloading from an GIT repository. + to allow building the libraries by downloading from an SVN repository. The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT'; by adding the following configuration option: - -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="GIT" + -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" - The options to control the GIT URL (config/cmake/cacheinit.cmake file) are: - ZLIB_GIT_URL:STRING="http://${git_url}/zlib" - SZIP_GIT_URL:STRING="http://${git_url}/szip" - ${git_url} should be changed to your location. Also define CMAKE_BUILD_TYPE + The options to control the SVN URL (config/cmake/cacheinit.cmake file) are: + ZLIB_SVN_URL:STRING="http://${svn_url}/zlib/trunk" + SZIP_SVN_URL:STRING="http://${svn_url}/szip/trunk" + ${svn_url} should be changed to your location. Also define CMAKE_BUILD_TYPE to be the configuration type. 3.2.2 Or the external libraries (zlib and szip) can be configured @@ -528,8 +525,8 @@ These five steps are described in detail below. NOTE: See note 8 of this document for NSIS information. See note 9 of this document for WiX information. - Also, if you are using a Visual Studio Express version or - want to disable the packaging components, set HDF5_NO_PACKAGES + Also, if you are using a Visual Studio Express version or do not + want to enable the packaging components, set HDF5_NO_PACKAGES to ON (on the command line add -DHDF5_NO_PACKAGES:BOOL=ON) 6. The files that support building HDF5 with CMake are all the files in the @@ -566,7 +563,7 @@ The config/cmake/cacheinit.cmake file can override the following values. ---------------- General Build Options --------------------- BUILD_SHARED_LIBS "Build Shared Libraries" ON -BUILD_STATIC_EXECS "Build Static Executables" OFF +BUILD_STATIC_EXECS "Build Static Executabless" OFF BUILD_TESTING "Build HDF5 Unit Testing" ON ---------------- HDF5 Build Options --------------------- @@ -627,9 +624,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT) HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF if (WINDOWS) H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin" -else () +else (WINDOWS) H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin" -endif () +endif (WINDOWS) @@ -650,9 +647,9 @@ build and test process. VIII. Options for Platform Configuration Files ======================================================================== -Below is the HDF5config.cmake and HDF5options.cmake ctest scripts. +Below is the HDF5config.cmake ctest script with extra comments. Execute: - ctest -S HDF5config.cmake,BUILD_GENERATOR=xxx -C Release -VV -O hdf5.log + ctest -S HDF5config.cmake,BUILD_GENERATOR=xxx -C Release -V -O hdf5.log The same scripts can be used on Linux, Mac OSX or a Windows machine by adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. @@ -660,10 +657,10 @@ adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. ############################################################################################# ### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### ### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ### -### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -VV -O hdf5.log ### +### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf5.log ### ############################################################################################# -cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) ############################################################################ # Usage: # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log @@ -680,22 +677,22 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) # INSTALLDIR - root folder where hdf5 is installed # CTEST_CONFIGURATION_TYPE - Release, Debug, etc # CTEST_SOURCE_NAME - source folder -# STATIC_ONLY - Build/use static libraries +# STATIC_LIBRARIES - Build/use static libraries # FORTRAN_LIBRARIES - Build/use fortran libraries # JAVA_LIBRARIES - Build/use java libraries # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## -set(CTEST_SOURCE_VERSION 1.10.1) -set(CTEST_SOURCE_VERSEXT "") +set(CTEST_SOURCE_VERSION 1.10.0) +set(CTEST_SOURCE_VERSEXT "-pre1") ############################################################################## # handle input parameters to script. #BUILD_GENERATOR - which CMake generator to use, required #INSTALLDIR - HDF5-1.10.0 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo -#CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.1 -#STATIC_ONLY - Default is YES +#CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0 +#STATIC_LIBRARIES - Default is YES #FORTRAN_LIBRARIES - Default is NO #JAVA_LIBRARIES - Default is NO #NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac @@ -707,14 +704,14 @@ if(DEFINED CTEST_SCRIPT_ARG) foreach(current_var ${script_args}) if ("${current_var}" MATCHES "^([^=]+)=(.+)$") set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif () - endforeach () -endif () + endif() + endforeach() +endif() # build generator must be defined if(NOT DEFINED BUILD_GENERATOR) message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") -else () +else() if(${BUILD_GENERATOR} STREQUAL "Unix") set(CTEST_CMAKE_GENERATOR "Unix Makefiles") elseif(${BUILD_GENERATOR} STREQUAL "VS2015") @@ -729,54 +726,49 @@ else () set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") elseif(${BUILD_GENERATOR} STREQUAL "VS201264") set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - else () + else() message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") - endif () -endif () - -################################################################### -### Following Line is one of [Release, RelWithDebInfo, Debug] ##### -set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") -################################################################### + endif() +endif() if(NOT DEFINED INSTALLDIR) if(WIN32) - set(INSTALLDIR "C:/Program Files/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") - else () - set(INSTALLDIR "${CTEST_SCRIPT_DIRECTORY}/HDF_Group/HDF5/${CTEST_SOURCE_VERSION}") - endif () -endif () + set(INSTALLDIR "C:\\Program\ Files\\myhdf5") + else() + set(INSTALLDIR "/usr/local/myhdf5") + endif() +endif() if(NOT DEFINED CTEST_CONFIGURATION_TYPE) set(CTEST_CONFIGURATION_TYPE "Release") -endif () +endif() if(NOT DEFINED CTEST_SOURCE_NAME) set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") -endif () -if(NOT DEFINED STATIC_ONLY) - set(STATICONLYLIBRARIES "YES") -else () - set(STATICONLYLIBRARIES "NO") -endif () +endif() +if(NOT DEFINED STATIC_LIBRARIES) + set(STATICLIBRARIES "YES") +else() + set(STATICLIBRARIES "NO") +endif() if(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "NO") -else () +else() set(FORTRANLIBRARIES "YES") -endif () +endif() if(NOT DEFINED JAVA_LIBRARIES) set(JAVALIBRARIES "NO") -else () +else() set(JAVALIBRARIES "YES") -endif () +endif() set(CTEST_BINARY_NAME "build") set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") if(WIN32) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else () +else() set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif () +endif() ################################################################### ######### Following describes compiler ############ @@ -807,33 +799,17 @@ if(WIN32) set(SITE_OS_BITS "32") set(SITE_COMPILER_NAME "vs2012") set(SITE_COMPILER_VERSION "11") - endif () + endif() ## Set the following to unique id your computer ## set(CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") -else () - set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +else() ## Set the following to unique id your computer ## if(APPLE) set(CTEST_SITE "MAC.XXXX") - else () + else() set(CTEST_SITE "LINUX.XXXX") - endif () - if(APPLE) - execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set(ENV{CC} "${XCODE_CC}") - set(ENV{CXX} "${XCODE_CXX}") - set(CTEST_USE_LAUNCHERS 1) - set(RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") - set(RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") - set(RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") - set(RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") - set(RR_FLAGS_C "${RR_FLAGS_COMMON}") - set(RR_FLAGS_CXX "${RR_FLAGS_COMMON}") - set(ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") - set(ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") - endif () -endif () + endif() +endif() ################################################################### ################################################################### @@ -853,128 +829,106 @@ set(MODEL "Experimental") #set(LOCAL_NO_PACKAGE "TRUE") ##### Following controls source update ##### #set(LOCAL_UPDATE "TRUE") -set(REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") -set(REPOSITORY_BRANCH "develop") - +set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/trunk") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows #set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") ################################################################### ################################################################### -if(${STATICONLYLIBRARIES}) +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") + +################################################################### +if(${STATICLIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") ######### Following describes computer ############ ## following is optional to describe build ## set(SITE_BUILDNAME_SUFFIX "STATIC") -endif () -################################################################### -#### fortran #### -if(${FORTRANLIBRARIES}) - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") - ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") -else () - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") -endif () -#### java #### -if(${JAVALIBRARIES}) - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") -else () - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") -endif () - -### change install prefix -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}") - +endif() ################################################################### -if(WIN32) - set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}") - include(${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake) - include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe") - file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi") - file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip") - file(COPY "${CTEST_BINARY_DIRECTORY}\\${BINFILEBASE}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () -else () - set(BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") - include(${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake) - include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) - if(APPLE) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - else () - if(CYGWIN) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - else () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - if(EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif () - endif () - endif () -endif () - -HDF5options.cmake: -############################################################################################# -#### Change default configuration of options in config/cmake/cacheinit.cmake file ### -#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### -############################################################################################# - ### uncomment/comment and change the following lines for other configuration options -############################################################################################# #### ext libraries #### - ### ext libs from tgz set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}") -### ext libs from git -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=GIT") +### ext libs from svn +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=SVN") ### ext libs on system #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") - -### disable ext zlib building +### disable ext libs building #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") -### disable ext szip building #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") +#### fortran #### +if(${FORTRANLIBRARIES}) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") +else() + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") +endif() +#### java #### +if(${JAVALIBRARIES}) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") +else() + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") +endif() -############################################################################################# ### disable test program builds - #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") -############################################################################################# ### disable packaging - #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") ### Create install package with external libraries (szip, zlib, jpeg) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") -############################################################################################# +### change install prefix +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") + +################################################################### + +if(WIN32) + include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() +else() + include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) + if(APPLE) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + else() + if(CYGWIN) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + else() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + endif() + endif() +endif() + ======================================================================== For further assistance, send email to help@hdfgroup.org diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index fdae007..cc77fcb 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -4,34 +4,21 @@ HDF5 version 1.9.236 currently under development INTRODUCTION -This document describes the differences between HDF5-1.10.0-patch1 and -HDF5 1.10.1, and contains information on the platforms tested and known problems in HDF5-1.10.1. +This document describes the differences between HDF5-1.9.0 and +HDF5 1.9.x snapshot, and contains information on the platforms +tested and known problems in HDF5-1.9.x. For more details check the HISTORY*.txt files in the HDF5 source. -Links to HDF5 1.10.1 source code, documentation, and additional materials can be found on The HDF5 web page at: - - https://support.hdfgroup.org/HDF5/ - -The HDF5 1.10.1 release can be obtained from: - - https://support.hdfgroup.org/HDF5/release/obtain5110.html - +Links to HDF5 1.9.x source code can be found on The HDF Group's +development FTP server at the following location: + ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/hdf5/snapshots User documentation for the snapshot can be accessed directly at this location: + http://www.hdfgroup.uiuc.edu/HDF5/doc_dev_snapshot/H5_dev/ - https://support.hdfgroup.org/HDF5/doc1.10/ - -New features in the HDF5-1.10.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New -in 1.10.1?" document: - - https://support.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew1101.html - -All new and modified APIs are listed in detail in the "HDF5 Software Changes -from Release to Release" document, in the section "Release 1.8.19 (current -release) versus Release 1.10.1 +For more information, see the HDF5 home page: - https://support.hdfgroup.org/HDF5/doc1.10/ADGuide/Changes.html + http://www.hdfgroup.org/HDF5/ If you have any questions or comments, please send them to the HDF Help Desk: @@ -42,7 +29,7 @@ CONTENTS - New Features - Support for new platforms and languages -- Bug Fixes since HDF5-1.10.0-patch1 +- Bug Fixes since HDF5-1.8.0 - Supported Platforms - Tested Configuration Features Summary - More Tested Platforms @@ -54,77 +41,1196 @@ New Features Configuration: ------------- - - CMake minimum is now 3.2.2. (ADB 2016/01/10) - + - CMake + Added NAMESPACE hdf5:: to package configuration files + - CMake: change CTEST_BUILD_CONFIGURATION to CTEST_CONFIGURATION_TYPE, which is + recommended by CMake documentation. + HDFFV-9971 (ADB 2016/8/22) + - Java JNI library API wrappers and supporting files added as HDF_JAVA language + option. Both configure and CMake disable this option by default. + HDFFV-9552 (ADB 2016/02/28) + - CMake minimum is now 3.1.0. (ADB 2015/11/14) + - cmakehdf5: configure options added to enable or disable the building of + different API's and testings. See "cmakehdf5 --help" for details. + (AKC - 2014/12/09 HDFFV-8932) + - Autotools: Automake updated to 1.14.1 (ADB - 2014/04/08) + - CMake: Moved minimum CMake version to 2.8.11 which enables better library + include processing. (ADB - 2014/03/26) + - New configuration option added to change the default plugin path. + configure option is --with-default-plugin=location + cmake option is -DH5_DEFAULT_PLUGINDIR:PATH=location + HDFFV-8513. (ADB 2013/09/04) + - Rename FFLAGS to FCFLAGS in configure (ADB 2013/08/13) + - CMake minimum is now 2.8.10. (ADB 2013/01/14) + - A new tool, cmakehdf5, which is a build command script similar to + buildhdf5 is added and is available in the bin directory. + (AKC - 2012/12/12) + - Fixed AIX Fortran compiler flags to use appropriate settings for + debugging, profiling, optimization situations. HDFFV-8069. (AKC + 2012/09/27) + - Updated to latest autotools and changed all hard *.sh scripts to + configure managed *.sh.in files. Removed overloading of autotools + TESTS variable by examples and tests. Renamed configure.in to + configure.ac. (ADB - 2012/08/23 - HDFFV-8129) + - Added code to display the version information of XL fortran and C++ + in the summary of configure. (AKC - 2012/02/28 - HDFFV-7793) + - Configure now generates Makefiles that build in "silent make mode" + by default in which compile and link lines are significantly + simplified for clarity. To override this and view actual compile and + link lines during building, the --disable-silent-rules flag can be used + at configure time, or the 'make' command can be followed by V=1, to + indicate a "verbose" make. (MAM - 2011/4/14). + - Added mpicc and mpif90 as the default C and Fortran compilers for Linux + systems when --enable-parallel is specified but no $CC or $FC is defined. + (AKC - 2011/2/7) + - Added a new configure option, "--enable-unsupported", which can + be used to stop configure from preventing the use of unsupported + configure option combinations, such as c++ in parallel or parallel + HDF5 with threadsafe. Use at your own risk, as it may result in a + library that won't compile or run as expected! + (MAM - 2010/11/17 - Bug 2061) + - PHDF5 changed to use "mpiexec", instead of mpirun, as the default MPI + applications startup command as defined in the MPI-2 definition, section + 4.1. (AKC - 2010/6/11 - Bug 1921) + - Configure now adds appropriate defines for supporting large (64-bit) + files on all systems, where supported, by default, instead of only linux. + This largefile support is controllable with the --enable-largefile + configure option. This is replacing the linux-specific --enable-linux-lfs + option, which has been removed from configure. + (MAM - 2010/05/05 - 1772/1434) + - Upgraded versions of autotools used to generate configuration suite. + We now use Automake 1.11.1, Autoconf 2.65, and Libtool 2.2.6b. + MAM 2010/04/15. + - Added the xlc-* and mpcc_r-* BASENAME patterns to be recognized as IBM + compilers so that the ibm compiler options can be added properly. This + allows non-system-default compiler command names (e.g. xlc-m.n.k.l) be + recognized. AKC 2009/11/26. + - Configuration suite now uses Automake 1.11 and Autoconf 2.64. + MAM 2009/08/11. + - Changed default Gnu fortran compiler from g95 to gfortran since + gfortran is more likely installed with gcc now. -AKC 2009/07/19- + - Added libtool version numbers to generated c++, fortran, and + hl libraries. MAM 2009/04/19. + - Regenerated Makefile.ins using Automake 1.10.2. MAM 2009/04/19. + - Added a Make target of check-all-install to test the correctness of + installing via the prefix= or $DESTDIR options. AKC - 2009/04/14 + - Configuration suite now uses Libtool 2.2.6a. MAM 2008/10/24 + + - Configuration suite now uses Autoconf 2.61, Automake 1.10.1. + MAM 2008/05/05. + + - The new configure option "--disable-sharedlib-rpath" disables + embedding the '-Wl,-rpath' information into executables when + shared libraries are produced, and instead solely relies on the + information in LD_LIBRARY_PATH. (MAM - 2008/05/15) Library: -------- - - + - Java API added new H5Iget_name that returns a string. + The old function, now deprecated, would cause a memory leak and + not return a proper String value. + HDFFV-9972 (ADB 2016/8/22) + - Add support to expand the plugin path value on Windows when the path + includes an environment variable. + HDFFV-9706 (ADB 2016/8/22) + + - H5F_ACC_DEBUG labeled "deprecated" + + The symbol was originally used to emit some extra debugging + informationi in the multi VFD. The underlying functionality + was removed due to disuse in HDF5 1.8.16 though the symbol + remained defined since it was visible in H5Fpublic.h. + + In this release, the symbol has been labeled deprecated and will + not be defined when H5_NO_DEPRECATED_SYMBOLS is defined. + + (DER - 2015-04-30, HDFFV-1074) + + - The library can load filter libraries dynamically during runtime. Users + can set the search path through environment variable HDF5_PLUGIN_PATH + and call H5Pset_filter to enable a dynamic filter. (SLU - 2013/04/08) + - Added new API functions H5Dscatter and H5Dgather to scatter data to and + and gather data from a selection within a memory buffer. + (NAF - 2013/02/05) + - The library now supports the data conversion from enumeration to numeric + (integer and floating-point number) datatypes. See Issue 8221. + (SLU - 2012/10/23) + - The data sieve buffer size was for all the datasets in the file. It + could waste memory if any dataset size is smaller than the sieve buffer + size. Now the library picks the smaller one between the dataset size + and the sieve buffer size from the file access property. See Issue 7934. + (SLU - 2012/4/2) + - I added a new parameter of object access property list to the function + H5Rdereference (Issue 2763). It's called H5Rdereference2 now. The former + H5Rdereference function has been deprecated to H5Rdereference1. (SLU - + 2011/7/18) + - H5Tcreate now supports string type (fixed-length and variable-length). + (SLU - 2011/05/20) + - Added ability to cache files opened through external links. Added new + public functions H5Pset_elink_file_cache_size(), + H5Pget_elink_file_cache_size(), and H5Fclear_elink_file_cache(). + (NAF - 2011/02/17) + - Removed all old code for Metraowerks compilers, bracketed by + __MWERKS__). Metraowerks compiler is long gone. (AKC - 2010/11/17) + - Added support for threadsafety on windows using the windows threads + library. Use the HDF5_ENABLE_THREADSAFE option in CMake while on a + windows platform to enable this functionality. This is supported on + Windows Vista and newer Windows operating systems. (MAM - 2010/09/10) + - When a mandatory filter failed to write data chunks, the dataset + couldn't close (bug 1260). The fix releases all resources and closes + the dataset but returns a failure. (SLU - 2010/9/8) + - H5Tset_order and H5Tget_order now support all data types. A new byte + order H5T_ORDER_MIXED has been added specifically for compound datatype + and its derived type. Please see bug #1934. (SLU - 2010/8/23) + - Improved performance of the chunk cache by avoiding unnecessary b-tree + lookups of chunks already in cache. (NAF - 2010/06/15) + - Greatly improved performance of extending a dataset with early + allocation. (NAF - 2010/03/24 - 1637) + - Added support for filtering densely stored groups. Many of the API + functions related to filters have been extended to support dense groups + as well as datasets. Pipeline messages can now be stored in a group's + object header. (NAF/QAK - 2009/10/8) + - The embedded library information is displayed by H5check_version() if a + version mismatch is detected. Also changed H5check_version() to + suppress the warning message totally if $HDF5_DISABLE_VERSION_CHECK is 2 + or higher. (Old behavior treated 3 or higher the same as 1, that is + print a warning and allows the program to continue. (AKC - 2009/9/28) + - If a user does not care for the extra library information insert + in the executables, he may turn it off by --disable-embedded-libinfo + during configure. (AKC - 2009/9/15) + - Corrected problem where library would re-write the superblock in a file + opened for R/W access, even when no changes were made to the file. + (QAK - 2009/08/20, Bz#1473) + - Separated "factory" free list class from block free lists. These free + lists are dynamically created and manage blocks of a fixed size. + H5set_free_list_limits() will use the same settings specified for block + free lists for factory free lists. (NAF - 2009/04/08) + - Added support for dense attributes to H5Ocopy. (XCao/NAF - 2009/01/29) + - Added H5Pset_elink_cb and H5Pget_elink_cb functions to support a + user-defined callback function for external link traversal. + (NAF - 2009/01/08) + - Added H5Pset_elink_acc_flags and H5Pget_elink_acc_flags functions to + allow the user to specify the file access flags used to open the target + file of an external link. (NAF - 2009/01/08) + - Added H5Pset_chunk_cache() and H5Pget_chunk_cache() functions to allow + individual rdcc configuration for each dataset. Added + H5Dget_access_plist() function to retrieve a dataset access property + list from a dataset. (NAF - 2008/11/12) + - Added H5Iis_valid() function to check if an id is valid without producing + an error message. (NAF - 2008/11/5) + - Added two new public routines: H5Pget_elink_fapl() and + H5Pset_elink_fapl(). (see bug #1247) (VC - 2008/10/13) + - Improved free space tracking in file to be faster. (QAK - 2008/10/06) + - Added 'mounted' field to H5G_info_t struct. (QAK - 2008/07/15) Parallel Library: ----------------- - - + - Add H5Pget_mpio_no_collective_cause() function that retrive reasons + why the collective I/O was broken during read/write IO access. + (JKM - 2012/08/30 HDFFV-8143) + - Special Collective IO (IO when some processes do not contribute to the + IO) and Complex Derived Datatype MPI functionalities are no longer + conditionally enabled in the library by configure. They are always + enabled in order to take advantage of performance boosts from these + behaviors. Older MPI implementations that do not allow for these + functionalities can no longer by used by HDF5. (MAM - 2011/07/08). + - Modified parallel tests to run with arbitrary number of processes. The + modified tests are testphdf5 (parallel dataset access), t_chunk_alloc + (chunk allocation), and t_posix_compliant (posix compliance). The rest of + the parallel tests already use in the code the number of processes + available in the communicator. (CMC - 2009/04/28) Fortran Library: ---------------- - - + + - Added parallel routine H5Pget_mpio_actual_io_mode_f (MSB - 2012/09/27) + + - Added for the C API the Fortran wrapper: + h5ocopy_f (MSB - 2012/03/22) + + + HDF5 Fortran library was enhanced to support Fortran 2003 standard. + The following features are available when the HDF5 library is configured + using --enable-fortran --enable-fortran2003 configure flags AND + if fortran compiler is Fortran2003 compliant: + + - Subroutines overloaded with the C_PTR derived type: + h5pget_f + h5pget_fill_value_f + h5pinsert_f + h5pregister_f + h5pset_f + h5pset_fill_value_f + h5rcreate_f + h5rderefrence_f + h5rget_name_f + h5rget_obj_type_f + - Subroutines overloaded with the C_PTR derived type + and simplified signatures: + h5aread_f + h5awrite_f + h5dread_f + h5dwrite_f + - New subroutines + h5dvlen_reclaim_f + h5literate_by_name_f + h5literate_f + h5ovisit_f + h5tconvert_f + + - Subroutines with additional optional parameters: + h5pcreate_class_f + (EIP - 2011/10/14) + + - Added for the C APIs the Fortran wrappers: + h5dget_access_plist_f + h5iis_valid_f + h5pset_chunk_cache_f + h5pget_chunk_cache_f + (MSB - 2009/04/17) + + C++ Library: ------------ - - + - New member function added + + The assignment operator ArrayType::operator= is added because ArrayType + has pointer data members. + + (BMR, 2016/03/07, HDFFV-9562) + + - New member functions + + Overloaded CommonFG::getObjnameByIdx to take char* for name + + Overloaded CommonFG::getObjTypeByIdx to return type name as a char*. + (BMR - 2010/05/02) + + DataSet::getInMemDataSize() to simplify getting the dataset's + data size in memory. (BMR - 2009/07/26) + - These member functions were added as wrapper for H5Rdereference to + replace the incorrect IdComponent::dereference(). + void H5Object::dereference(H5File& h5file, void* ref) + void H5Object::dereference(H5Object& obj, void* ref) + In addition, these constructors were added to create the associated + objects by way of dereference: + Attribute(H5Object& obj, void* ref); + Attribute(H5File& file, void* ref); + DataSet(H5Object& obj, void* ref); + DataSet(H5File& file, void* ref); + DataType(H5Object& obj, void* ref); + DataType(H5File& file, void* ref); + Group(H5Object& obj, void* ref); + Group(H5File& obj, void* ref); + (BMR - 2008/08/10) + + Tools: ------ - - + - h5repack: Added ability to use plugin filters. HDFFV-8345 (ADB - 2013/09/04). + - h5dump: Added option -N --any_path, which searches the file for paths that + match the search path. HDFFV-7989 (ADB - 2013/08/12). + - h5dump: Added optional arg 0 to -A, which excludes attributes from display. + HDFFV-8134 (ADB - 2013/08/01). + - h5dump: Fixed displaying compression ratio for unknown or user-defined + filters. HDFFV-8344 (XCAO 2013/03/19) + - h5dump: Changed UNKNOWN_FILTER to USER_DEFINED_FILTER for user defined filter. + HDFFV-8346 (XCAO 2013/03/19) + - h5dump: Added capability for "-a" option to show attributes containing "/" + by using an escape character. For example, for a dataset "/dset" + containing attribute "speed(m/h)", use "h5dump -a "/dset/speed(\/h)" + to show the content of the attribute. See details at HDFFV-7523 + (PC -- 2012/03/12) + - h5dump: Added ability to apply command options across multiple files using a + wildcard in the filename. Example; "h5dump -H -d Dataset1 tarr*.h5". + HDFFV-7876 (ADB - 2012/03/12). + - h5repack: Improved performance for big chunked datasets (size > 128MB) + when used with layout (-l) or compression (-f) option. + It would perform much better prior to the improvement, + especially for cases that chunk dimentions looks like + "1024x5x1" (compare to "1x5x1024"). When bigger numbers + are toward front and smaller number is toward back in chunk + dimentions. HDFFV-7862 (JKM - 2012/03/01) + - h5dump: Added new option --no-compact-subset. This option will not + interpret the '[' character as starting the compact form of + subsetting. This is useful when the "h5dump error: unable to + open dataset "datset_name"" message is output because a dataset + name contains a '[' character. HDFFV-7689 (ADB - 2012/01/31) + - h5dump: Corrected schema location: + + (ADB - 2011/08/10) + - h5diff: Added new level for -v (verbose) option. The new levels are + 1 and 2. So -v1 and -v2 can be specified to view more + information about attributes differences. + Bug#2121 (JKM 2011/3/23) + - h5dump: Added new option --enable-error-stack. This option will display + error stack information in the output stream. This is useful + when the "h5dump: Unable to print data" message is output. + (ADB - 2011/02/24) + - h5diff: Add a new flag --exclude-path. Specified path to an object will + be excluded from comparing the two files or two groups. If group + is specified all the member objects will be excluded. + (JKM - 2010/09/16). + - h5ls: Add new flag --no-dangling-links. (refer to --help for details) + (JKM - 2010/06/15) + - h5ls: Add new flag --follow-symlinks. (refer to --help for details) + (JKM - 2010/05/25) + - h5diff: Add new flag --no-dangling-links. (refer to --help for details) + (JKM - 2010/02/10) + - h5diff: Add new flag --follow-symlinks. (refer to --help for details) + (JKM - 2010/01/25) + - h5diff: fix for displaying garbage value on LE machine for BE data. + (JKM - 2009/11/20) + - h5dump: subsetting now allows default for count. Also trailing ; in short form + can be omitted after last specified value. + (ADB - 2009/09/04) + - h5dump/h5ls: now can display data in region references + using new -R, --region flag. + (ADB - 2009/09/04) + - h5diff: new flag, -c, --compare, list objects that are not comparable. + (PVN - 2009/4/10 - 1368) + - h5diff new flag, -N, --nan, avoids NaNs detection. (PVN - 2009/4/10) + - h5dump correctly specifies XML dtd / schema urls (ADB - 2009/4/3 - 1519) + - h5repack now handles group creation order. (PVN - 2009/4/2 - 1402) + - h5dump: added a printing of the compression ratio of uncompressed and compressed + sizes for cases where compression filters are present. (PVN - 2008/05/01) + - h5dump: added an option to allow a user defined formatting string for printf + regarding floating point numbers. (PVN - 2008/05/06) + - h5dump: support for external links, display the object that the external link + points to. (PVN - 2008/05/12) + - h5repack: add a userblock to an HDF5 file during the repack. (PVN - 2008/08/26) + - h5repack: add 2 options that call H5Pset_alignment in the repacked file. (PVN - 2008/08/29) + - h5ls: added capability to traverse through external links when the -r + (recursive) flag is given. (NAF - 2008/09/16) + - h5ls: added -E option to enable traversal of external links. h5ls will + not traverse external links without this flag being set. + (NAF - 2008/10/06) + - h5diff: added support for long double (PVN - 2008/10/28) + - h5dump: binary output defaults to NATIVE with -b optionally accepting + the form of binary output (NATIVE, FILE, BE, LE). (PVN - 2008/10/30) + - h5diff: return 1 for file differences when both file graphs differ by any object. + Error return code was changed to 2 from -1. (PVN - 2008/10/30) + - h5import: TEXTFPE (scientific format) was deprecated. Use TEXTFP + instead (PVN - 2008/10/30) + - h5repack: When user doesn't specify a chunk size, h5repack now defines a default + chunk size as the same size of the size of the hyperslab used to read the chunks. + The size of the hyperslabs are defined as the size of each dimension or a + predefined constant, whatever is smaller. This assures that the chunk + read fits in the chunk cache. (PVN - 2008/11/21) + - h5diff: h5diff treats two INFINITY values different. Fixed by checking (value==expect) + before call ABS(...) at h5diff_array.c This will make that (INF==INF) is true + (INF is treated as an number instead of NaN) (PC -- 2009/07/28) + - h5diff: add option "--use-system-epsilon" to print difference if (|a-b| > EPSILON) + Change default to use strict equality (PC -- 2009/09/12) + High-Level APIs: --------------- - C Packet Table API - ------------------ - - + C Packet Table API + ------------------ + - Replacement of a public function + + The existing function H5PTcreate_fl limits applications to deflate + compression only. The public function H5PTcreate is added to replace + H5PTcreate_fl. H5PTcreate takes a property list ID to provide + flexibility on creation properties. + + hid_t H5PTcreate(hid_t loc_id, const char *dset_name, + hid_t dtype_id, hsize_t chunk_size, hid_t plist_id); + (BMR, 2016/03/04, HDFFV-8623) + + - New public functions + + Two accessor functions were added per HDFFV-8623/patch 003. + /* Returns the ID of the dataset associated with the packet table */ + hid_t H5PTget_dataset(hid_t table_id); + + /* Returns the ID of the datatype the packet table uses */ + hid_t H5PTget_type(hid_t table_id); + (BMR, 2016/03/04, HDFFV-8623) + + - Regarding #ifdef VLPT_REMOVED + + The #ifdef VLPT_REMOVED blocks are removed from the PT library source + except the following cases: + + H5PTis_varlen() is made available again. + + H5PTfree_vlen_readbuff() now became H5PTfree_vlen_buff() + (BMR, 2016/03/04, HDFFV-442) + + C++ Packet Table API + -------------------- + - New constructor + + An overloaded constructor is added to FL_PacketTable and takes a property + list ID to provide flexibility on creation properties. + + FL_PacketTable(hid_t fileID, hid_t plist_id, const char* name, hid_t dtypeID, hsize_t chunkSize); + (BMR, 2016/03/08, HDFFV-8623) + + - New public functions + + Two accessor wrappers to class PacketTable, per HDFFV-8623/patch 004. + /* Returns the ID of the dataset associated with the packet table */ + hid_t PacketTable::GetDataset() + + /* Returns the ID of the datatype the packet table uses */ + hid_t PacketTable::GetDataset() + (BMR, 2016/03/04, HDFFV-8623) + + - Member functions having "char*" as an argument + + Overloaded functions were added to provide "const char*" argument, the + existing version will be deprecated. + (BMR, 2016/03/04) + + - Regarding #ifdef VLPT_REMOVED + + The #ifdef VLPT_REMOVED blocks are removed from the PT library source + except the following cases: + + VL_PacketTable::IsVariableLength() is moved to PacketTable + + VL_PacketTable::FreeReadBuff() now became PacketTable::FreeBuff() + + (BMR, 2016/03/04, HDFFV-442) + + + Internal header file + -------------------- + - A new API function H5DOwrite_chunk. It writes a data chunk directly + into a file bypassing hyperslab selection, data conversion, and + filter pipeline. The user must be careful with the function and + clearly understand the I/O process of the library. + (SLU - 2013/2/11) + - New API: h5ltpath_valid (Fortran: h5ltpath_valid_f) which checks + if a path is correct and determines if a link resolves to a valid + object and checks that the link does not dangle. (MSB- 2012/3/15) + + - Added Fortran wrappers for Dimension Scale APIs. HDFFV-3797 + h5dsset_scale_f + h5dsattach_scale_f + h5dsdetach_scale_f + h5dsis_attached_f + h5dsis_scale_f + h5dsset_label_f + h5dsget_label_f + h5dsget_scale_name_f + h5dsget_num_scales_f + (EIP for SB - 2011/10/13) + + - Table: In version 3.0 of Table, "NROWS" (used to store number of records) was + deprecated (PVN - 2008/11/24) - Internal header file - -------------------- - - - Documentation ------------- Support for new platforms, languages and compilers. ======================================= - - + - Intel V11.1 uses now -O3 optimization in production mode (EIP - 2010/10/08) + - PathScale compilers are recognized and can build the HDF5 library + properly. AKC - 2009/7/28 - + - SunOS 5.11 (emu) 32-bit and 64-bit with Sun C/C++ 5.12 compiler and + Sun Fortran 95 8.6 compiler. (SLU - 2013/04/15) -Bug Fixes since HDF5-1.10.0-patch1 release +Bug Fixes since HDF5-1.8.0 release ================================== Library ------- - - + - Fixed a memory bug that could occur when a message was improperly marked + as sharable on disk. + + (NAF, 2016/07/01, HDFFV-9950) + + - Incorrect usage of list in CMake COMPILE_DEFINITIONS set_property + + The CMake command, set_property with COMPILE_DEFINITIONS property + needs a quoted semi-colon separated list of values. CMake will + transform the list to a series of -D{value} for the compile. + + (ADB - 2014/12/09, HDFV-9041) + + - H5Z.c: H5Zfilter_avail(H5Z_filter_t id) + Added else block if the call to the internal H5Z_filter_avail(id) does not + fail and returns FALSE. This block calls the H5PL_load(H5PL_TYPE_FILTER, (int)id) + function to attempt to dynamically load the filter plugin. + (ADB - 2014/03/03 HDFFV-8629) + - Added const qualifier to source buffer parameters in H5Dgather and + H5D_scatter_func_t (H5Dscatter callback). (NAF - 2013/7/02) + - Fixed an error involving failure to write fill values to the user's + buffer when reading unallocated chunks from datasets that have a + fill value set to H5D_FILL_VALUE_DEFAULT. A consequence of this + was the reporting of spurious data values in h5dump and h5diff + output. + (HDFFV-8247; JP - 2013/05/03) + - Fixed an error that could occur when calling H5Ocopy within an + H5Literate callback (and possibly other situations). + (NAF - 2012/7/25 - HDFFV-5853) + - Fixed an error that would occur when copying an object with attribute + creation order tracked and indexed. (NAF - 2012/3/28 - HDFFV-7762) + - Fixed a bug in H5Ocopy(): When copying an opened object, call the + object's flush class action to ensure that cached data is flushed + so that H5Ocopy will get the correct data. + (VC - 2012/3/27 - HDFFV-7853) + - When an application tries to write or read many small data chunks and + runs out of memory, the library had a seg fault. The fix is to + return the error stack with proper information. (SLU - 2012/3/23. + Issue 7785) + - H5Pset_data_transform had seg fault in some cases like x*-100. It + works correctly now and handles other cases like 100-x or 2/x. + (SLU - 2012/3/15. Issue 7922) + - Fixed rare corruption bugs that could occur when using the new object + header format. (NAF - 2012/3/15 - HDFFV-7879) + - Creating a dataset in a read-only file caused seg fault when the file + is closed. It's fixed. The attemp to create a dataset will fail + with the error stack indicating the file is read-only. (SLU - + 2012/1/25. Issue 7756) + - Fixed a seg fault that could occur when shrinking a dataset with chunks + larger than 1 MB. (NAF - 2011/11/30 - HDFFV-7833) + - Fixed a bug that could cause file corruption when copying named + datatypes to a file using shared messages. (NAF - 2011/11/14) + - Fixed a bug that could cause H5Oget_info to return the wrong address + after copying a named datatype. (NAF - 2011/11/14) + - The library allowed the conversion of strings between ASCII and UTF8 + (Issue 7582). We have corrected it to report an error under this + situation. (SLU - 2011/11/8) + - The library had seg fault when it tried to shrink the size of compound type + through H5Tset_size immediately after the type was created (Issue + 7618). It's fixed now. (SLU - 2011/10/26) + - Fixed a bug that occurred when using H5Ocopy on a committed datatype + containing an attribute using that committed datatype. + (NAF - 2011/10/13 - Issue 5854) + - #ifdef _WIN32 instances changed to #ifdef H5_HAVE_WIN32_API and added + H5_HAVE_VISUAL_STUDIO checks where necessary. CMake only as configure + never set _WIN32. + - CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + discovered 3 problems in tests and tools' library (Issue 7674): + 1. In dsets.c, left shifting an unsigned int for 32 bits or more + caused undefined behavior. + 2. In dt_arith.c, the INIT_INTEGER macro definition has an overflow + when the value is negative minimal and is being subtracted one. + 3. In tools/lib/h5tools_str.c, right shifting an int value for 32 bits + or more caused undefined behavior. + All the problems have been corrected. (SLU - 2011/9/2) + - In v1.6 library, there was EOA for the whole MULTI file saved in the + super block. We took it out in v1.8 library because it's meaningless + for the MULTI file. v1.8 library saves the EOA for the metadata file, + instead. But this caused some backward compatibility problem. + v1.8 library couldn't open the file created with v1.6 library. We + fixed the problem by checking the EOA value to detect the file + created with v1.6 library. (SLU - 2011/6/22) + - When a dataset had filters and reading data failed, the error message + didn't say which filter isn't registered. It's fixed now. + (SLU - 2011/6/3) + - The datatype handler created with H5Tencode/decode used to have the + reference count 0 (zero). I have fixed it. It is 1 (one) now. + (SLU - 2011/2/18) + - Fixed a bug that caused big endian machines to generate corrupt files + when using the scale-offset filter with floating point data or + fill values. Note that such datasets will no longer be readable + by any machine after this patch. (NAF - 2010/02/02 - Bug 2131) + - Retrieving a link's name by index in the case where the link is + external and the file that the link refers to doesn't exist will + now fail gracefully rather than cause a segmentation fault. + (MAM - 2010/11/17) + - Modified library to always cache symbol table information. Libraries + version 1.6.3 have a bug which causes them to require this + information for some operations. (NAF - 2010/09/21 - 1864) + - Fixed a bug that could occur when getting information for a new-style + group that was previously opened through a file handle that was + later closed. (NAF - 2010/09/15) + - Added define check in H5public.h if stdint.h is supported by the C++ + compiler. This define is only available on Windows with VS2010 and + using CMake to build the library. (ADB - 2010/09/13 - Bug 1938) + - H5Eset_current_stack now also closes the error stack to be set as the + default. This is to avoid a potential problem (Bug 1799). + (SLU - 2010/9/7) + - Fixed the bug in the filter's public CAN_APPLY function. The return + value should be htri_t not herr_t (Bug #1239). (SLU - 2010/8/5) + - Fixed a bug in the direct I/O driver that could render files with + certain kinds of unaligned data unreadable or corrupt them. + (NAF - 2010/07/28) + - valgrind reported an error of copying data to itself when a new attribute + is written (Bug #1956). I fixed it by taking out the memcpy step in + the attribute code. (SLU - 2010/07/28) + - Fixed a bug that could cause file corruption when using non-default + sizes of addresses and/or lengths. This bug could also cause + uncorrupted files with this property to be unreadable. This bug + was introduced in 1.8.5. (NAF - 2010/07/16 - 1951) + - Fixed a file corruption bug that could happen when shrinking a + compressed dataset. (NAF - 2010/05/20) + - Fixed some memory leaks in VL datatype conversion when strings are + used as fill values. (MAM - 2010/05/12 - BZ# 1826) + - Fixed a bug when copying objects with NULL references with the + H5O_COPY_EXPAND_REFERENCE_FLAG flag set. (NAF - 2010/04/08 - 1815) + - Files can now be concurrently opened more than once using the core file + driver, as long as the backing store is used. (NAF - 2010/03/09) + - Added support for H5O_COPY_EXPAND_EXT_LINK_FLAG to H5Ocopy. External + links will now be expanded if this flag is set. + (NAF - 2010/03/05 - 1733) + - Fixed a bug where the library, when traversing an external link, would + reopen the source file if nothing else worked. (NAF - 2010/03/05) + - Fixed an intermittent bug in the b-tree code which could be triggered + by expanding and shrinking chunked datasets in certain ways. + (NAF - 2010/02/16) + - H5Tdetect_class said a VL string is a string type. But when it's + in a compound type, it said it's a VL type (Bug #1584). I fixed it + to be consistent. It always return string type. (SLU - 2009/12/10) + - Fixed a bug where writing and deleting many global heap objects (i.e. + variable length data) would render the file unreadable. Previously + created files exhibiting this problem should now be readable. + (NAF - 2009/10/27 - 1483) + - Fixed incorrect return value for H5Pget_preserve. (AKC - 2009/10/08 - 1628) + - Fixed an assertion failure that occurred when H5Ocopy was called on a + dataset using a vlen inside a compound. (NAF - 2009/10/02 - 1597) + - Fixed incorrect return value for H5Pget_filter_by_id1/2 in H5Ppublic.h. + (NAF - 2009/09/25 - 1620) + - Fixed a bug where properties weren't being compared with the registered + compare callback. (NAF - 2009/09/25 - 1555) + - Fixed a bug where H5Pget_fitler_by_id would succeed when called for a + filter that wasn't present. (NAF - 2009/06/25 - 1250) + - Fixed an issue with committed compound datatypes containing a vlen. + Also fixed memory leaks involving committed datatypes. + (NAF - 2009/06/10 - 1593) + - Added versioning to H5Z_class_t struct to allow compatibility with 1.6 + API. (NAF - 2009/04/20 - 1533) + - Fixed a problem with using data transforms with non-native types in the + file. (NAF - 2009/04/20 - 1548) + - Added direct.h include file to windows section of H5private.h + to fix _getcwd() warning. (ADB - 2009/04/14 - 1536) + - Fixed a bug that prevented external links from working after calling + H5close(). (NAF - 2009/04/10 - 1539) + - Modified library to write cached symbol table information to the + superblock, to allow library versions 1.3.0 to 1.6.3 to read files + created by this version. (NAF - 2009/04/08 - 1423) + - Changed skip lists to use a deterministic algorithm. The library should + now never call rand() or srand(). (NAF - 2009/04/08 - 503) + - Fixed a bug where H5Lcopy and H5Lmove wouldn't create intermediate + groups when that property was set. (NAF - 2009/04/07 - 1526) + - Fixed a bug that caused files with a user block to grow by the size of + the user block every time they were opened. + (NAF - 2009/03/26 - 1499) + - Fixed a rare problem that could occur with files using the old (pre 1.4) + array datatype. (NAF - 2009/03/23) + - Modified library to be able to open files with corrupt root group symbol + table messages, and correct these errors if they are found. Such + files can only be successfully opened with write access. + (NAF - 2009/03/23 - 1189) + - Removed the long_long #define and replaced all instances with + "long long". This caused problems with third party products. All + currently supported compliers support the type. (ADB - 2009/03/05) + - Fixed various bugs that could prevent the fill value from being written + in certain rare cases. (NAF - 2009/02/26 - 1469) + - Fixed a bug that prevented more than one dataset chunk from being cached + at a time. (NAF - 2009/02/12 - 1015) + - Fixed an assertion failure caused by opening an attribute multiple times + through multiple file handles. (NAF - 2009/02/12 - 1420) + - Fixed a problem that could prevent the user from adding attributes (or + any object header message) in some circumstances. + (NAF - 2009/02/12 - 1427) + - Fixed a bug that could cause problems when an attribute was added to a + committed datatype using the committed datatype's datatype. + (NAF - 2009/02/12) + - Fixed a bug that could cause problems when copying an object with a + shared message in its own object header. (NAF - 2009/01/29) + - Changed H5Tset_order to properly reject H5T_ORDER_NONE for most + datatypes. (NAF - 2009/01/27 - 1443) + - Fixed a bug where H5Tpack wouldn't remove trailing space from an + otherwise packed compound type. (NAF - 2009/01/14) + - Fixed up some old v2 btree assertions that get run in debug mode that + were previously failing on compilation, and removed some of the + more heavily outdated and non-rewritable ones. (MAM - 2008/12/15) + - Fixed a bug that could cause problems when "automatically" unmounting + multiple files. (NAF - 2008/11/17) + - H5Ovisit and H5Ovisit_by_name will now properly terminate when the + callback function returns a positive value on the starting object. + (NAF - 2008/11/03) + - Fixed an error where a null message could be created that was larger + than could be written to the file. (NAF - 2008/10/23) + - Corrected error with family/split/multi VFD not updating driver info + when "latest" version of the file format used. (QAK - 2008/10/14) + - Corrected alignment+threshold errors to work correctly when metadata + aggregation is enabled. (QAK - 2008/10/06) + - Changed H5Fget_obj_count and H5Fget_obj_ids to ignore objects registered + by the library for internal library use. (NAF - 2008/10/06) + - Fixed potential memory leak during compound conversion. + (NAF - 2008/10/06) + - Changed the return value of H5Fget_obj_count from INT to SSIZE_T. Also + changed the return value of H5Fget_obj_ids from HERR_T to SSIZE_T and + the type of the parameter MAX_OBJS from INT to SIZE_T. (SLU - 2008/09/26) + - Fixed an issue that could cause data to be improperly overwritten + during compound type conversion. (NAF - 2008/09/19) + - Fixed pointer alignment violations that could occur during vlen + conversion. (NAF - 2008/09/16) + - Fixed problem where library could cause a segmentation fault when + an invalid location ID was given to H5Giterate(). (QAK - 2008/08/19) + - Fixed improper shutdown when objects have reference count > 1. The + library now tracks reference count due to the application separately + from that due to internal library routines. (NAF - 2008/08/19) + - Fixed assertion failure caused by incorrect array datatype version. + (NAF - 2008/08/08) + - Fixed an issue where mount point traversal would fail when using + multiple handles for the child. (NAF - 2008/08/07) + - Fixed an issue where mount points were inaccessible when using multiple + file handles for the parent. The mount table is now in the shared + file structure (the parent pointer is still in the top structure). + (NAF - 2008/08/07) + - when an attribute was opened twice and data was written with one of the handles, + the file didn't have the data. It happened because each handle had its own + object structure, and the empty one overwrote the data with fill value. This is + fixed by making some attribute information like the data be shared in the + attribute structure. SLU - 2008/07/22 + - Fixed issue where a group could have a file mounted on it twice. + (QAK - 2008/07/15) + - Fixed a Windows-specific issue in the ohdr test which was causing users + in some timezones to get false errors. This a deficiency in the Windows + mktime() function, and has been handled properly. SJW - 2008/06/19 + - Fixed the problem with the searching of target file for H5Lcreate_external(). + The searching pattern will depend on whether the target file's + pathname is an absolute or a relative path. Please see the description + in the RM for H5Lcreate_external(). (VC - 2008/04/08) + - Fixed possible file corruption bug when encoding datatype + descriptions for compound datatypes whose size was between + 256 & 511 bytes and the file was opened with the "use the + latest format" property enabled (with H5Pset_libver_bounds). + (QAK - 2008/03/13) + - Fixed bug in H5Aget_num_attrs() routine to handle invalid location + ID correctly. (QAK - 2008/03/11) + - H5Dset_extent: when shrinking dimensions, some chunks were not deleted. + (PVN - 2009/01/8) + - Added code to maintain a min_clean_fraction in the metadata cache when + in serial mode. (MAM - 2009/01/9) + + Configuration ------------- - - + - CMake: When CMake commands are executed individually on the command line + and the external filters are being built, the CMAKE_BUILD_TYPE define + must be set to the same value as the configuration + (-DCMAKE_BUILD_TYPE:STRING=Release if using -C Release). This is needed + by the the szip and zlib filter build commands. (ADB - HDFFV-8695) + - CMake: Remove use of XLATE_UTILITY program. (ADB - 2014/03/28 HDFFV-8640) + - CMake: Added missing quotes in setting the CMAKE_EXE_LINKER_FLAGS for the + MPI option. (ADB - 2014/02/27 HDFFV-8674) + - Modified H5detect.c to scan floating point types for padding bits before + analyzing the type further. This should fix problems with gcc 4.8 + (NAF - 2013/09/19 - HDFFV-8523/HDFFV-8500) + - Fixed Makefile issue in which "-Wl," was not properly specified + prior to -rpath when building parallel fortran libraries with + an Intel compiler. (MAM - 2012/03/26) + - Makefiles generated by other packages using h5cc as the compiler + no longer error when 'make' is invoked more than once in order + to 'rebuild' after changes to source. (MAM - 2012/03/26) + - Added --enable-fortran2003 flag to enable Fortran2003 support + in the HDF5 Fortran library. The flag should be used along with the + --enable-fortran flag and takes affect only when Fortran compiler + is Fortran2003 compliant. (EIP - 2011/11/14) + + - In Windows platform, the default VFD, was Windows VFD, is restored back + to the SEC2, aka POSIX, VFD. The Windows VFD is deprecated. HDFFV-7740 + (AKC 2011/09/26) + - Removed config/ibm-aix6.x. All IBM-AIX settings are in one file, + ibm-aix. (AKC - 2011/4/14) + - Shared C libraries are no longer disabled on Mac when Fortran + is enabled. Shared Fortran libraries are still not supported on Mac, + so configure will disable them by default, but this is overridable + with the new --enable-unsupported configure option. The configure + summary has been updated to reflect the fact that the shared-ness of + the C++/Fortran wrapper libraries may not align with the C library. + (MAM - 04/11/2011 - HDFFV-4353). + - Removed recognition of the parallel compilers of LAM(hcc) and + ChMPIon(cmpicc) since we have no access to these two MPI implementations + and cannot verify their correctness. (AKC - 2010/7/14 - Bug 1921) + - Removed the following config files, as we no longer support them: + config/dec-osf*, config/hpux11.00, config/irix5.x, + config/powerpc-ibm-aix4.x config/rs6000-ibm-aix5.x config/unicos* + MAM - 2009/10/08 + - Modified configure and make process to properly preserve user's CFLAGS + (and company) environment variables. Build will now properly use + automake's AM_CFLAGS for any compiler flags set by the configure + process. Configure will no longer modify CFLAGS directly, nor will + setting CFLAGS during make completely replace what configure has set up. + MAM - 2009/10/08 + - Support for TFLOPS, config/intel-osf1, is removed since the TFLOPS + machine has long retired. AKC - 2009/10/06. + - Added $(EXEEXT) extension to H5detect when it's executed in the + src/Makfile to generate H5Tinit.c so it works correctly on platforms + that require the full extension when running executables. + MAM - 2009/10/01 - BZ #1613 + - Configure will now set FC and CXX to "no" when fortran and c++ + are not being compiled, respectively, so configure will not run + some of the compiler tests for these languages when they are not + being used. MAM - 2009/10/01 + - The PathScale compiler (v3.2) was mistaken as gcc v4.2.0 but it fails to + recognize some gcc options. Fixed. (see bug 1301). AKC - 2009/7/28 - + - The --enable-static-exec flag will now properly place the -static flag + on the link line of all installed executables. This will force the + executable to link with static libraries over shared libraries, provided + the static libraries are available. MAM - 2009/08/31 - BZ #1583 + - The --includedir=DIR configuration option now works as intended, and can + be used to specify the location to install C header files. The default + location remains unchanged, residing at ${prefix}/include. + MAM - 2009/03/10 - BZ #1381 + - Configure no longer removes the '-g' flag from CFLAGS when in production + mode if it has been explicitly set in the CFLAGS environment variable + prior to configuration. MAM - 2009/03/09 - BZ #1401. + - Fixed error with 'make check install' failing due to h5dump + needing other tools built first. MAM - 2008/10/24. + - Wpen using shared szip, it is no longer necessary to specify + the path to the shared szip libraries in LD_LIBRARY_PATH. MAM - + 2008/10/24. + - The file libhdf5_fortran.settings is not installed since its content + is included in libhdf5.settings now. AKC - 2008/10/21 + - "make DESTDIR=xxx install" failed to install some tools and files + (e.g., h5cc and fortran modules). Fixed. AKC - 2008/10/8. + - Autotools: An export of LD_LIBRARY_PATH= was + removed from configure and make installcheck was revised to run + scripts installed in share/hdf5_examples to use the installed h5cc, etc. + to compile and run example source files also installed there. Make + installcheck will now fail when a shared szip or other external lib file + cannot be found in the same manner that executables compiled and linked + with h5cc will fail to run when those lib files cannot be found after + install. Make installcheck should pass after setting LD_LIBRARY_PATH to the + szip location. + (LRK - 2014/04/16) Performance ------------- - - - + - Removed program perform/benchpar from the enable-build-all list. The + program will be retired or moved to another location. HDFFV-8156 + (AKC 2012/10/01) + - Retired program perform/mpi-perf. Its purpose has been incorporated + into h5perf before. (AKC 2012/09/20) + - ifdefs added to tests around include unistd.h and function to simulate + getlogin() on Windows. + (ADB - 2011/08/15) + - perf_serial test added to Windows projects and check batch file. + (ADB - 2009/06/11) Fortran -------- - - + - Fixed a typo in return value of the nh5dread_f_c function ( was 1 + instead of 0 on success); fixed the return value to make it consistent + with other Fortran functions; cleaned the code from debug statements. + (EIP - 2012/06/23) + + - Fixed problem writing/reading control characters to a dataset; writing + a string containing: alerts, backspace, carriage_return, form_feed, + horizontal_tab, vertical_tab, new_line is now tested and working. + (MSB - 2012/09/01) + + - Corrected the integer type of H5S_UNLIMITED_F to HSIZE_T (MSB - 2012/09/01) + + - Corrected the number of continuation lines in the src files + to be less then 32 lines for F95 compliance. (MSB - 2012/10/01) Tools ----- - - + - h5dump subsetting fixed for dims greater then two + When a dataset has more then two dimensions, subsetting would incorrectly + calculate the data that needed to be displayed. + Added in block and stride calculation that account for dimensions greater + then two. NOTE: lines that have line breaks inserted because of display + length calculations, may have index info that is incorrect until the next + dimension break. (ADB, 2016/03/04, HDFFV-9698) + - h5repack: h5repack would not attempt to remove UD filters. Added a + check to h5repack for UD filters that checks if the filter can + be dynamically loaded. This will require a change in the library to + add the H5PL_load() to the H5Zfilter_avail(). (ADB - 2014/03/03 HDFFV-8629) + - h5repack: Fixed failure for converting a layout of small chunked dataset + (size < 1K) to contiguous layout. HDFFV-8214 (JKM 2013/03/18) + - h5diff: Fixed to return correct exit code 1 when detect unique extra + attribute. Prior to this fix, h5diff returned exit code 0 indicating + two files are identical. HDFFV-7643 (JKM 2013/02/15) + - h5diff: Improved speed when comparing HDF5 files with lots of + attributes. Much slower performance was identified with release + version from 1.8.7 to 1.8.10 compared to 1.8.6. (JKM 2012/10/19) + - h5repack: "h5repack -f NONE file1.h5 out.h5" command failed if + source file contains chunked dataset and a chunk dim is bigger than + the dataset dim. Another issue is that the command changed max dims + if chunk dim is smaller than the dataset dim. + These issue occurred when dataset size is smaller than 64k (compact + size limit) Fixed both. + HDFFV-8012 (JKM 2012/09/24) + - h5diff: Fixed not to accumulate attribute difference to dataset + difference in verbose mode (-v, -r), which caused incorrect + difference between dataset and group/datatype object if attribute + exist with any differences. This also lead to fix inconsistent + format indicating difference between dataset and group/datatype + object. HDFFV-5919 (JKM 2012/09/05) + - h5diff: Fixed the incorrect result when comparing attribute data + values and the data type has same class but different size. + HDFFV-7942 (JKM 2012/08/15) + - ph5diff: Fixed intermittent hang issue on a certain operation in + parallel mode. It was detected by daily test for comparing + non-comparable objects, but it could have occurred in other + operations depend on machine condition. HDFFV-8003 (JKM 2012/08/01) + - h5diff: Fixed test failure for "make check" due to failure of + copying test files when performed in HDF5 source tree. Also applied + to other tools. + HDFFV-8107 (JKM 2012/08/01) + - h5diff: Fixed the Function COPY_TESTFILES_TO_TESTDIR() of + testh5diff.sh to better report when there is an error in the file + copying. HDFFV-8105 (AKC -2012/07/22) + - h5diff: Fixed not to check and display dangling link status without + --follow-symlinks option. This also improved performance when + comparing lots of external links without the --follow-symlinks + option. HDFFV-7998 (JKM 2012/04/26) + - h5unjam: Fixed sefgault when used -V (show version) option. + HDFFV-8001 (JKM 2012/04/19) + - h5repack: Fixed a failure when change the chunk size of a specified + chunked dataset with unlimited max dims. HDFFV-7993 (JKM 2012/04/11) + - h5diff: Fixed failure for comparing same named object with different + object types in comparing groups. Prior to the fix, h5diff resulted + in error. After the fix, h5diff detects such case as non-comparable + and display messages accordingly. HDFFV-7664 (JKM 2012/03/28) + - h5diff: If unique objects exists only in one file and try to exclude + the unique objects with --exclude-path option, h5diff missed + excluding some objects. + Fixed to exclude objects correctly in such case. + HDFFV-7837 (JKM 2012/03/20) + - h5dump: Added tools library error stack to properly catch error + information generated within the library. + HDFFV-7958 (ADB 2012/03/12) + - h5dump: Dangling links no longer throw error message, change process + when open link fails. + HDFFV-7839 (ADB 2012/03/12) + - h5diff: When two symbolic dangling links are compared with + --follow-symlinks option, the result should be same. It worked for + comparing two files, but didn't work for comparing two objects. + HDFFV-7835 (JKM 2012/03/09) + - h5dump: Refactored code to remove duplicated functions. Split XML + functions from DDL functions. Corrected indentation and formatting + errors. Also fixed subsetting counting overflow (HDFFV-5874). Verified + all tools call tools_init() in main. + HDFFV-7560 (ADB 2012/02/17) + - h5diff: fixed to prevent from displaying error stack message when + comparing the two dangling symlinks with follow-symlinks option. + HDFFV-7836 (JKM 2012/01/13) + - h5repack: fixed memory leak for handling variable length string in + attribute. HDFFV-7840 (JKM 2012/01/06) + - h5ls: fixed segfault when access region reference data in an + attribute. HDFFV-7838 (JKM 2011/12/29) + - h5diff: fixed segfault over non-comparable attribute with different + dimention or rank, along with '-c' option to display details. + HDFFV-7770 (JKM 2011/10/24) + - Fixed h5diff to display all the comparable object and attribute + regardless of non-comparables. HDFFV-7693 (JKM 2011/09/16) + - Fixed h5repack to update values of references(object and region) of + attributes in h5repack for 1) references, 2) ARRAY of references, + 3) VLEN of references, and 4) COMPOUND of references. + (JIRA HDF5 5932) PC -2011/09/14 + - h5diff: fixed segfault over dataset with container types + (array,lven) with multiple nested compound types. + (ex: compound->array->compound, compound->vlen->compound) + HDFFV-7712 JKM (2011/09/01) + - h5repack: added macro to handle failure in H5Dread/write when memory + allocation failed inside the library. (PC -- 2011/08/19) + - Fixed h5jam not to allow specifying an HDF5 formatted file as input + file for -u (user block file) option, because the original HDF5 file + will not be accessible if allows. HDFFV-5941 (JKM 2011/08/15) + - Revised command help pages of h5jam and h5unjam. The descriptions + were not up to date and some were missing. + HDFFV-7515 (JKM 2011/08/15) + - h5repack: h5repack failed to copy dataset if the layout is changed + from chunked with unlimited dims to contiguous. HDFFV-7649 + (PC -- 2011/07/15) + - h5diff: "--delta" option considers two NaN of the same type are + different, which is wrong based on h5diff description in Reference + Manual. HDFFV-7656 (PC -- 2011/07/15) + - Fixed h5diff to display instructive error message and exit with 1 + when mutually exclusive options (-d, -p and --use-system-epsilon) + are used together. HDFFV-7600 (JKM 2011/07/07) + - Fixed h5dump to display the first line of each element into correct + position for multiple dimention array type. + Before this fix, the first line of each element in array were + displayed after the last line of previous element without + moving to the next line (+indentation). + Bug #HDFFV-5878 (JKM 2011/06/15) + - Fixed h5dump to display correct value for H5T_STD_I8LE dataset + on a system (ppc64, linux, Big-Endian, clustering). + Bug #HDFFV-7594 (ABERT & JKM 2011/05/12) + - Fixed h5diff to compare file itself correctly. Previously h5diff + reported either different or not compatible in certain cases even + comparing file itself. This fix also improve performance when + comparing same target objects through verifying the obj&file + addresses before comparing the details in the objects (ex: datasets + or attributes) Bug #HDFFV-5928 (XCAO & JKM 2011/05/06) + - Updated h5dump test case script to prevent entire test failure upon + source directory is read-only. Bug# HDFFV-4342 (JKM 2011/4/12) + - Fixed h5dump displaying incorrect values for H5T_STD_I8BE type data in + attribute on Big-Endian machine. H5T_STD_I8BE is unsigned 8bit type, + so h5dump is supposed to display -2 instead of 254. It worked + correctly on Little-Endian system , but not on Big-Endian system. + Bug #HDFFV-4358 (JKM 2011/04/08) + - Updated to unify option name to '--enable-error-stack' for printing + HDF5 error stack messages for HDF5 tools. h5ls and h5dump for now. + For h5ls, this replaces "-e/--errors" option, which is deprecated. + Bug#2182 (JKM 2011/3/30) + - Fix h5diff for --use-system-epsilon option: the calculation changed + from ( |a - b| / b ) to ( |a - b| ). This was decided for better + performance. Bug#2184 (JKM 2011/3/24) + - Fixed output for H5T_REFERENCE in h5dump. According to the BNF document + the output of a H5T_REFERENCE should be followed by the type; + ::= H5T_REFERENCE { } + ::= H5T_STD_REF_OBJECT | H5T_STD_REF_DSETREG + Previously this was only displayed if the -R option was used. + Bug#1725 (ADB 2011/3/28) + - Fix h5diff issues for #1: h5diff compared attributes correctly only + when two objects have the same number of attributes and attribute + names are identical, #2: didn't display useful information about + attribute difference. Bug#2121 (JKM 2011/3/17) + - Fixed memory leak for h5diff when accessing symbolic links with + --follow-symlink option. Bug#2214 (JKM 2011/3/18) + - Fixed memory leak for h5diff when access variable length string + data. Bug#2216 (JKM 2011/3/18) + - Fixed and improved help page for -a option of h5ls. + Bug#1904 (JKM 2011/3/11) + - Fixed h5dump not to include attribute values in the output file when + h5dump "-y -o output_file" options were used. The problem was introduced + in HDF5 1.8.6 by showing data pointed by region references. (XCAO 2011/3/9) + - Fixed h5copy to be able to copy any object into the same HDF5 file. + Previously h5copy displayed error message when target file is same + as source file. (XCAO 2011/3/8) + - Fixed h5dump for skipping some values for long array type dataset on + Windows. This issue only occurred on Windows due to the different + return behavior from _vsnprintf() funtion. Bug#2161 (JKM 2011/3/3) + - Fixed h5dump for skipping array indices every certain number + when the array type dataset is relatively big. The certain number + varies according to the size of array. Bug#2092 (JKM 2011/2/15). + - Fixed h5diff for the segfault when compares compound datasets + with combination of fixed length string types and vlen string types + in certain orders. bug#2089 (JKM 2010/12/28) + - Improve h5diff performance. 1) use HDmemcmp() before comparing each + elements. 2) replace expensive H5Tequals() calls 3) retrieve datatype + information at dataset level not each element level for compound + datasets + - Fixed h5ls to display nested compound type with curly bracket + when -S (--simple) option is used with -l (--label), so it shows + which member (in curly bracket) belong to which nested compound type + and make the output make sense. bug#1979 (JKM 2010/11/09) + - Fixed h5diff to handle variable-length strings in a compound dataset + correctly. (also variable-length string array in a compound dataset) + Garbage values were displayed when h5diff compared multiple + variable-length strings in a compound type dataset. + Bug#1989 (JKM 2010/10/28) + - Fixed h5copy to fail gracefully when copying object to non-exist + group without -p option. Bug#2040 (JKM 2010/10/18) + - Fixed to compare member objects and groups recursively when two + files or groups are specified to be compared. Bug#1975 + (JKM 2010/9/16) + - Make h5repack be able to convert a layout to COMPACT for small size + dataset as default. bug#1896 (JKM 2010/09/15) + - Change h5ls not to manipulate special characters in object name or + attribute name for smart display. bug#1784 (JKM 2010/06/28) + - Fixed h5ls to return exit code 1 (error) when non-existent file is + specified. bug#1793. (JKM 2010/04/27) + - h5copy failed to copy dangling link when the link is specified + directly. bug#1817. (JKM 2010/04/22) + - h5repack lost attributes from a dataset of reference type. bug#1726. + (JKM 2010/3/25) + - h5repack sets NULL for object reference value for group or + named datatype. bug#1814. (JKM 2010/03/19) + - h5diff: fixed incorrect behavior (hang) in parallel mode when + specify invalid options (ex: -v and -q) (JKM 2010/02/17) + - h5dump/h5ls display buffer resize fixed in tools library. + (ADB - 2009/07/21 - 1520) + - Fixed many problems that could occur when using h5repack with named + datatypes. (NAF - 2009/4/20 - 1516/1466) + - h5dump, h5diff, h5repack were not reading (by hyperslabs) datasets + that have a datatype datum size greater than H5TOOLS_BUFSIZE, a + constant defined as 1024Kb, such as array types with large + dimensions (PVN - 2009/4/1 - 1501) + - h5import: By selecting a compression type, a big endian byte order was being + selected (PVN - 2009/3/11 - 1462) + - zip_perf.c had missing argument on one of the open() calls. Fixed. + (AKC - 2008/12/9) + - h5dump now checks for uniqueness of committed datatypes. + (NAF - 2008/10/15) + - Fixed unnecessary indentation of committed datatypes in h5dump. + (NAF - 2008/10/15) + - Fixed bugs in h5stat:segmemtation fault when printing groups and + print warning message when traversal of objects is unsuccessful. + (see bug #1253) (VC- 2008/10/13) + - Fixed bug in h5ls that prevented relative group listings (like + "h5ls foo.h5/bar") from working correctly (QAK - 2008/06/03) + - Fixed bug in h5diff that prevented datasets & attributes with + variable-length string elements from comparing correctly. + (QAK - 2008/02/28) + - h5import bug on Windows w/binary datasets. fread in windows needs a + binary file to be open with 'rb' instead of 'r' otherwise it + terminates execution if an end of file character is found on the + input file. Besides that the binary file generated needs to be open + with 'wb' , otherwise an end of line character is read twice. + (PVN - 2008/02/19) + - Fixed bug in h5dump that caused binary output to be made only for the first + dataset, when several datasets were requested. (PVN - 2008/04/07) + - h5dump: when doing binary output (-b), the stdout printing of attributes + was done incorrectly. Removed printing of attributes when doing binary + output. PVN - 2008/06/05 + High-Level APIs: - ------ - - + ------ + - Packet Table is updated. + + In the Packet Table C API, there are changes with the following functions, + which had been ifdef'ed out with VLPT_REMOVED since 2006 + * H5PTcreate_vl, is removed from this release + * H5PTfree_vlen_readbuff, is renamed to H5PTfree_vlen_buff + * H5PTis_varlen, is made available again + + Various cleanup: replacing 0/-1 with SUCCEED/FAIL and H5I_BADID with + H5I_INVALID_HID. (BMR, 2016/03/04, HDFFV-442) + + - Fixed problem with H5DSget_scale_name including the NULL terminator in + the size calculation returned by the function. The API does not + include the NULL terminator in the size returned (MSB- 2013/2/10) + + - Fixed problem with H5TBdelete_record destroying all data following the deletion + of a row. (MSB- 2012/7/26) + + - Fixed H5LTget_attribute_string not closing an object identifier when an + error occurs. (MSB- 2012/7/21) + + - Fixed the H5LTdtype_to_text function. It had some memory problems when + dealing with some complicated data types. HDFFVI-7701 (SLU - 2011/10/19) + + - Fixed a bug in H5DSattach_scale, H5DSis_attached and H5DSdetach_scale + caused by using H5Tget_native_type function to determine the native + type for reading REFERENCE_LIST attribute. The bug was exposed + on Mac PPC. + (EIP - 2010/05/22 -1851) + - Fixed a bug in the H5DSdetach_scale function when 0 bytes + were allocated after the last reference to a dim. scale + was removed from the list of references in a VL element of the + DIMENSION_LIST attribute; modified the function to comply + with the Spec: DIMENSION_LIST attribute is deleted now when no + dimension scales left attached. + (EIP - 2010/05/14 -1822) + - Fixed a bug where the H5TB API would forget the order of fields when + added out of offset order. (NAF - 2009/10/27 - 1582) + - H5DSis_attached failed to account for different platform types. Added a + get native type call. (ADB - 2009/9/29 - 1562) + - Dimension scales: The scale index return value in H5DSiterate_scales was not always + incremented. (PVN - 2009/4/8 - 1538) Fortran High-Level APIs: - ------ - - + ------ + + - Lite: The h5ltget_attribute_string_f used to return the C NULL character in the + returned character buffer. The returned Fortran charactor buffer now does + not return the C NULL character. (MSB - 2012/3/23) + - Lite: The h5ltget_dataset_info_f function (gets information about a dataset) + was not correctly returning the dimension array. (PVN - 2009/3/23) + - Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions + had memory problems with the g95 fortran compiler. (PVN � 5/13/2009) 1522 + + + + Documentation ------------- @@ -132,80 +1238,141 @@ Bug Fixes since HDF5-1.10.0-patch1 release F90 APIs -------- - - + - Modified the h5open_f and h5close_f subroutines to not to call H5open + and H5close correspodningly. While the H5open call just adds overhead, + the H5close call called by an Fortran application shuts down the HDF5 + library making it unaccessible to the application. + HDFFV-915 (EIP & SB - 2011/10/13) C++ APIs -------- - - - + - The constructor PropList::PropList(id) was fixed to act properly + according to the nature of 'id'. When 'id' is a property class id, + a new property list will be created. When 'id' id a property list id, + a copy of the property list will be made. (BMR - 2010/5/9) + - The parameters 'size' and 'bufsize' in CommonFG::getLinkval and + CommonFG::getComment, respectively, now have default values for + user's convenience. (BMR - 2009/10/23) + - NULL pointer accessing was fixed, bugzilla 1061. (BMR - 2009/10/05) + - read/write methods of DataSet and Attribute classes were fixed + to handle string correctly. (BMR - 2009/07/26) + - Fixed bug that caused segfaults in Attribute::read. (BMR - 2008/04/20) + - Fixed bug in PropList::getClassName to use portable HDfree instead + of free. (BMR - 2008/04/20) + - Fixed a design bug which allowed an Attribute object to create/modify + attributes (bugzilla #1068). The API class hierarchy was revised + to address the problem. Classes AbstractDS and Attribute are moved + out of H5Object. Class Attribute now multiply inherits from + IdComponent and AbstractDs and class DataSet from H5Object and + AbstractDs. In addition, the data member IdComponent::id was + moved into subclasses: Attribute, DataSet, DataSpace, DataType, + H5File, Group, and PropList. (BMR - 2008/08/10) + - IdComponent::dereference was incorrect and replaced as described + in "New Features" section. + (BMR - 2008/08/10) + Testing ------- - - + - tools/h5diff/testh5diff.sh is run in every "make check", even after it + has passed in the previous run. It should not run again if there is no + code changes. Fixed. (AKC - 2013/07/19 HDFFV-8392) + - In some Mac system, testlibinfo.sh failed with this error: + Check file ../src/.libs/libhdf5.7.dylib + strings: object: ../src/.libs/libhdf5.7.dylib malformed object \ + (unknown load command 15) + The strings command of Mac inspects library files and older + versions of strings may not know newer library format, resulting + in errors. Fixed by sending the library file as stdin to the strings + coommand to avoid this problem. (AKC - 2013/03/08 HDFFV-8305) + + - Fixed a typo in the ERROR macro in test/testhdf5.h. It segmentation + faulted when used before. (AKC - 2013/02/12 HDFFV-8267) + Supported Platforms =================== - - Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + AIX 6.1 xlc 10.1.0.5 + (NASA G-ADA) xlC 10.1.0.5 + xlf90 12.1.0.6 + + Linux 2.6.18-308.13.1.el5PAE GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP i686 i686 i386 compilers for 32-bit applications; + (jam) Version 4.1.2 20080704 (Red Hat 4.1.2-54) + Version 4.8.2 + PGI C, Fortran, C++ Compilers for 32-bit + applications; + Version 13.7-0 + Intel(R) C, C++, Fortran Compiler for 32-bit + applications; + Version 14.0.2 (Build 20140120) + + Linux 2.6.18-371.6.1.el5 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; + (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-54) + Version 4.8.2 + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; + Version 14.0.2 (Build 20140120) + + Linux 2.6.32-431.11.2.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) #1 SMP x86_64 GNU/Linux compilers: - (mayll/platypus) Version 4.4.7 20120313 - Version 4.8.4 + (platypus) Version 4.4.7 20120313 + Version 4.8.2 PGI C, Fortran, C++ for 64-bit target on x86-64; - Version 16.10-0 + Version 13.7-0 Intel(R) C (icc), C++ (icpc), Fortran (icc) compilers: - Version 15.0.3.187 (Build 20150407) - MPICH 3.1.4 compiled with GCC 4.9.3 + Version 14.0.2 (Build 20140120) - Linux 2.6.32-573.18.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + Linux 2.6.32-431.29.2.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) IBM XL C/C++ V13.1 IBM XL Fortran V15.1 - Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) - #1 SMP x86_64 GNU/Linux compilers: - (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) - Version 4.9.3, Version 5.2.0 - Intel(R) C (icc), C++ (icpc), Fortran (icc) - compilers: - Version 15.0.3.187 Build 20150407 - MPICH 3.1.4 compiled with GCC 4.9.3 - + Linux 2.6.32-220.23.1.1chaos Intel C, C++, Fortran Compilers + ch5.x86_64 GNU/Linux Version 12.1.5.339 + (LLNL Aztec) + + IBM Blue Gene/P XL C for Blue Gene/P, bgxlc V9.0 + (LLNL uDawn) XL C++ for Blue Gene/P, bgxlC V9.0 + XL Fortran for Blue Gene/P, bgxlf90 V11.1 + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc (emu) Sun Fortran 95 8.6 SunOS_sparc Sun C++ 5.12 SunOS_sparc - Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Windows 7 Visual Studio 2008 (cmake) + Visual Studio 2010 w/ Intel Fortran 14 (cmake) + Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) - Visual Studio 2015 w/ Intel Fortran 16 (cmake) - Cygwin(CYGWIN_NT-6.1 2.2.1(0.289/5/3) gcc(4.9.3) compiler and gfortran) + Visual Studio 2015 (cmake) + Cygwin(CYGWIN_NT-6.1 1.7.34(0.285/5/3) gcc(4.9.2) compiler and gfortran) (cmake and autotools) - Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Windows 7 x64 Visual Studio 2008 (cmake) + Visual Studio 2010 w/ Intel Fortran 14 (cmake) + Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) - Visual Studio 2015 w/ Intel Fortran 16 (cmake) - - Windows 10 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Visual Studio 2015 (cmake) - Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 16 (cmake) - - Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.1 from Xcode 5.1 - 64-bit gfortran GNU Fortran (GCC) 4.8.2 - (swallow/kite) Intel icc/icpc/ifort version 15.0.3 + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) - Mac OS X Mavericks 10.9.5 Apple clang/clang++ version 6.0 from Xcode 6.2 - 64-bit gfortran GNU Fortran (GCC) 4.9.2 - (wren/quail) Intel icc/icpc/ifort version 15.0.3 + Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) - Mac OS X Yosemite 10.10.5 Apple clang/clang++ version 6.1 from Xcode 7.0 - 64-bit gfortran GNU Fortran (GCC) 4.9.2 - (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + Mac OS X Lion 10.7.3 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.2.1 + 32- and 64-bit g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.2.1 + (duck) gfortran GNU Fortran (GCC) 4.6.2 - Mac OS X El Capitan 10.11.6 Apple clang/clang++ version 7.3.0 from Xcode 7.3 - 64-bit gfortran GNU Fortran (GCC) 5.2.0 - (osx1010dev/osx1010test) Intel icc/icpc/ifort version 16.0.2 + Mac OS X Mountain Lion 10.8.1 cc Apple clang version 4.0 from Xcode 4.5.1 + (owl) c++ Apple clang version 4.0 from Xcode 4.5.1 + gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + gfortran GNU Fortran (GCC) 4.6.2 Tested Configuration Features Summary @@ -229,18 +1396,22 @@ Windows 7 y y/y n y y y Windows 7 x64 y y/y n y y y Windows 7 Cygwin n y/n n y y y Windows 7 x64 Cygwin n y/n n y y y -Windows 10 y y/y n y y y -Windows 10 x64 y y/y n y y y -Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y -Mac OS X Mavericks 10.9.5 64-bit n y/y n y y ? -Mac OS X Yosemite 10.10.5 64-bit n y/y n y y ? -Mac OS X El Capitan 10.11.6 64-bit n y/y n y y ? -CentOS 6.7 Linux 2.6.18 x86_64 GNU n y/y n y y y -CentOS 6.7 Linux 2.6.18 x86_64 Intel n y/y n y y y -CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y -CentOS 7.2 Linux 2.6.32 x86_64 GNU y y/y y y y y -CentOS 7.2 Linux 2.6.32 x86_64 Intel n y/y n y y y -Linux 2.6.32-573.18.1.el6.ppc64 n y/n n y y y +Windows 8 y y/y n y y y +Windows 8 x64 y y/y n y y y +Mac OS X Lion 10.7.3 32-bit n y/y n y y n +Mac OS X Lion 10.7.3 64-bit n y/y n y y y +Mac OS X Mountain Lion 10.8.1 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.1 64-bit n y/y n y y ? +AIX 6.1 32- and 64-bit n y/n n y y y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y/y y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel n y/y n y y y +CentOS 5.9 Linux 2.6.18-308 i686 PGI n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 GNU n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel n y/y n y y y +CentOS 6.4 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.4 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.4 Linux 2.6.32 x86_64 PGI n y/y n y y y +Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y Platform Shared Shared Shared Thread- @@ -251,18 +1422,22 @@ Windows 7 y y y y Windows 7 x64 y y y y Windows 7 Cygwin n n n y Windows 7 x64 Cygwin n n n y -Windows 10 y y y y -Windows 10 x64 y y y y -Mac OS X Mountain Lion 10.8.5 64-bit y n y y -Mac OS X Mavericks 10.9.5 64-bit y n y y -Mac OS X Yosemite 10.10.5 64-bit y n y y -Mac OS X El Capitan 10.11.6 64-bit y n y y -CentOS 6.7 Linux 2.6.18 x86_64 GNU y y y y -CentOS 6.7 Linux 2.6.18 x86_64 Intel y y y n -CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y n -CentOS 7.2 Linux 2.6.32 x86_64 GNU y y y n -CentOS 7.2 Linux 2.6.32 x86_64 Intel y y y n -Linux 2.6.32-573.18.1.el6.ppc64 y y y n +Windows 8 y y y y +Windows 8 x64 y y y y +Mac OS X Lion 10.7.3 32-bit y n y y +Mac OS X Lion 10.7.3 64-bit y n y y +Mac OS X Mountain Lion 10.8.1 64-bit y n y y +Mac OS X Mavericks 10.9.1 64-bit y n y y +AIX 6.1 32- and 64-bit y n n y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n +CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n +CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n +CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n +Linux 2.6.32-431.11.2.el6.ppc64 y y y n Compiler versions for each platform are listed in the preceding "Supported Platforms" table. @@ -272,26 +1447,70 @@ More Tested Platforms ===================== The following platforms are not supported but have been tested for this release. - Linux 2.6.32-573.18.1.el6.ppc64 MPICH mpich 3.1.4 compiled with - #1 SMP ppc64 GNU/Linux IBM XL C/C++ for Linux, V13.1 - (ostrich) and IBM XL Fortran for Linux, V15.1 + Linux 2.6.18-308.13.1.el5PAE MPICH mpich 3.1.2 compiled with + #1 SMP i686 i686 i386 gcc 4.9.1 and gfortran 4.9.1 + (jam) g95 (GCC 4.0.3 (g95 0.94!) + + Linux 2.6.18-431.11.2.el6 MPICH mpich 3.1.2 compiled with + #1 SMP x86_64 GNU/Linux gcc 4.9.1 and gfortran 4.9.1 + (platypus) g95 (GCC 4.0.3 (g95 0.94!) + + FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719 + (loyalty) gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + FreeBSD 8.2-STABLE amd64 gcc 4.2.1 [FreeBSD] 20070719 + (freedom) gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + Debian7.5.0 3.2.0-4-686 #1 SMP Debian 3.2.51-1 i686 GNU/Linux + gcc (Debian 4.7.2-5) 4.7.2 + GNU Fortran (Debian 4.7.2-5) 4.7.2 + (cmake and autotools) + + Debian7.5.0 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux + gcc (Debian 4.7.2-5) 4.7.2 + GNU Fortran (Debian 4.7.2-5) 4.7.2 + (cmake and autotools) - Debian 8.4 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1 x86_64 GNU/Linux - gcc, g++ (Debian 4.9.2-10) 4.9.2 - GNU Fortran (Debian 4.9.2-10) 4.9.2 + Fedora20 3.15.3-200.fc20.i6866 #1 SMP i686 i686 i386 GNU/Linux + gcc (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + GNU Fortran (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) (cmake and autotools) - Fedora 24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux - gcc, g++ (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) - GNU Fortran (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + Fedora20 3.15.3-200.fc20.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + GNU Fortran (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) (cmake and autotools) - Ubuntu 16.04.1 4.4.0-38-generic #57-Ubuntu SMP x86_64 GNU/Linux - gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 - GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 + SUSE 13.1 3.11.10-17-desktop #1 SMP PREEMPT i686 athlon i386 GNU/Linux + gcc (SUSE Linux) 4.8.1 + GNU Fortran (SUSE Linux) 4.8.1 (cmake and autotools) - + SUSE 13.1 3.11.10-17-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.8.1 + GNU Fortran (SUSE Linux) 4.8.1 + (cmake and autotools) + + Ubuntu 14.04 3.13.0-35-generic #62-Ubuntu SMP i686 GNU/Linux + gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + (cmake and autotools) + + Ubuntu 14.04 3.13.0-35-generic #62-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + (cmake and autotools) + + Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 + hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgCC 12.5-0 64-bit target on x86-64 Linux -tp shanghai + + Known Problems ============== * "make check" fails on CYGWIN when building shared lib files is enabled. The diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt index f188ab3..d3618e9 100644 --- a/release_docs/USING_CMake_Examples.txt +++ b/release_docs/USING_CMake_Examples.txt @@ -22,7 +22,7 @@ I. Preconditions 1. We suggest you obtain the latest CMake for windows from the Kitware web site. The HDF5 1.10.x product requires a minimum CMake version - of 3.2.2. + of 3.1.0. 2. You have installed the HDF5 library built with CMake, by executing the HDF Install Utility (the *.msi file in the binary package for @@ -52,7 +52,7 @@ Default installation process: with the CTEST_CONFIGURATION_TYPE script option. Note that this must be the same as the value used with the -C command line option. The default build configuration is defined to build and use static libraries. - Shared libraries can be used with the STATIC_ONLY script option set to "NO". + Shared libraries can be used with the STATIC_LIBRARIES script option set to "NO". Other options can be changed by editing the HDF5_Examples.cmake file. If the defaults are okay, execute from this directory: diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 87ebafc..313af83 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -37,7 +37,7 @@ I. Preconditions 1. We suggest you obtain the latest CMake for windows from the Kitware web site. The HDF5 1.10.x product requires a minimum CMake version - of 3.2.2. + of 3.1.0. 2. You have installed the HDF5 library built with CMake, by executing the HDF Install Utility (the *.msi file in the binary package for @@ -180,7 +180,7 @@ Given the preconditions in section I, create a CMakeLists.txt file at the source root. Include the following text in the file: ########################################################## -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) project (HDF5MyApp C CXX) set (LIB_TYPE STATIC) # or SHARED @@ -227,97 +227,97 @@ NOTE: this file is available at the HDF web site: ctest ======================================================================== -cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) +cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: # ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -V -O test.log ############################################################################################################### -set (CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -set (CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) # handle input parameters to script. #INSTALLDIR - HDF5 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATIC_ONLY - Default is YES +#STATIC_LIBRARIES - Default is YES #FORTRAN_LIBRARIES - Default is NO #JAVA_LIBRARIES - Default is NO ##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) -if (DEFINED CTEST_SCRIPT_ARG) +if(DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 # to variables with the respective names set to the respective values - string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach (current_var ${script_args}) + string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach(current_var ${script_args}) if ("${current_var}" MATCHES "^([^=]+)=(.+)$") set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif () - endforeach () -endif () -if (NOT DEFINED INSTALLDIR) - set (INSTALLDIR "@CMAKE_INSTALL_PREFIX@") -endif () -if (NOT DEFINED CTEST_CONFIGURATION_TYPE) - set (CTEST_CONFIGURATION_TYPE "Release") -endif () -if (NOT DEFINED CTEST_SOURCE_NAME) - set (CTEST_SOURCE_NAME "HDF5Examples") -endif () -if (NOT DEFINED STATIC_ONLY) - set (STATICONLYLIBRARIES "YES") -else () - set (STATICONLYLIBRARIES "NO") -endif () -if (NOT DEFINED FORTRAN_LIBRARIES) - set (FORTRANLIBRARIES "NO") -else () - set (FORTRANLIBRARIES "YES") -endif () -if (NOT DEFINED JAVA_LIBRARIES) - set (JAVALIBRARIES "NO") -else () - set (JAVALIBRARIES "YES") -endif () + endif() + endforeach() +endif() +if(NOT DEFINED INSTALLDIR) + set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") +endif() +if(NOT DEFINED CTEST_CONFIGURATION_TYPE) + set(CTEST_CONFIGURATION_TYPE "Release") +endif() +if(NOT DEFINED CTEST_SOURCE_NAME) + set(CTEST_SOURCE_NAME "HDF5Examples") +endif() +if(NOT DEFINED STATIC_LIBRARIES) + set(STATICLIBRARIES "YES") +else(NOT DEFINED STATIC_LIBRARIES) + set(STATICLIBRARIES "NO") +endif() +if(NOT DEFINED FORTRAN_LIBRARIES) + set(FORTRANLIBRARIES "NO") +else(NOT DEFINED FORTRAN_LIBRARIES) + set(FORTRANLIBRARIES "YES") +endif() +if(NOT DEFINED JAVA_LIBRARIES) + set(JAVALIBRARIES "NO") +else(NOT DEFINED JAVA_LIBRARIES) + set(JAVALIBRARIES "YES") +endif() #TAR_SOURCE - name of tarfile -#if (NOT DEFINED TAR_SOURCE) -# set (CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") -#endif () +#if(NOT DEFINED TAR_SOURCE) +# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") +#endif() ############################################################################################################### # Adjust the following SET Commands as needed ############################################################################################################### -if (WIN32) - if (${STATICONLYLIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif () - set (ENV{HDF5_DIR} "${INSTALLDIR}/cmake") - set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) - set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else (WIN32) - if (${STATICONLYLIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif () - set (ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") - set (ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") - set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) - set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +if(WIN32) + if(${STATICLIBRARIES}) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") + endif() + set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") + set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) + set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") + set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") +else(WIN32) + if(${STATICLIBRARIES}) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + endif() + set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") + set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") + set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) + set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") + set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") endif(WIN32) -if (${FORTRANLIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") -else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") -endif () -if (${JAVALIBRARIES}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") -else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") -endif () -set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") +if(${FORTRANLIBRARIES}) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") +else() + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") +endif() +if(${JAVALIBRARIES}) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") +else() + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF") +endif() +set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### # For any comments please contact cdashhelp@hdfgroup.org @@ -327,90 +327,90 @@ set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@H #----------------------------------------------------------------------------- # MAC machines need special option #----------------------------------------------------------------------------- -if (APPLE) +if(APPLE) # Compiler choice - execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set (ENV{CC} "${XCODE_CC}") - set (ENV{CXX} "${XCODE_CXX}") - if (NOT NO_MAC_FORTRAN) + execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set(ENV{CC} "${XCODE_CC}") + set(ENV{CXX} "${XCODE_CXX}") + if(NOT NO_MAC_FORTRAN) # Shared fortran is not supported, build static - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif () - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif () + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + else() + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") + endif() + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif() #----------------------------------------------------------------------------- -set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") ## -------------------------- -if (CTEST_USE_TAR_SOURCE) +if(CTEST_USE_TAR_SOURCE) ## Uncompress source if tar or zip file provided ## -------------------------- - if (WIN32) - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else () - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif () - - if (NOT rv EQUAL 0) - message (STATUS "extracting... [error-(${rv}) clean up]") - file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message (FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif () -endif () + if(WIN32) + message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") + execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else() + message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") + execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif() + + if(NOT rv EQUAL 0) + message(STATUS "extracting... [error-(${rv}) clean up]") + file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") + endif() +endif(CTEST_USE_TAR_SOURCE) #----------------------------------------------------------------------------- ## Clear the build directory ## -------------------------- -set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") - ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) + ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) else () - file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") + file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") endif () # Use multiple CPU cores to build -include (ProcessorCount) -ProcessorCount (N) -if (NOT N EQUAL 0) - if (NOT WIN32) - set (CTEST_BUILD_FLAGS -j${N}) - endif () - set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif () +include(ProcessorCount) +ProcessorCount(N) +if(NOT N EQUAL 0) + if(NOT WIN32) + set(CTEST_BUILD_FLAGS -j${N}) + endif() + set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif() set (CTEST_CONFIGURE_COMMAND "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) #----------------------------------------------------------------------------- ## -- set output to english -set ($ENV{LC_MESSAGES} "en_EN") +set($ENV{LC_MESSAGES} "en_EN") #----------------------------------------------------------------------------- -configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) +configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") ## NORMAL process ## -------------------------- ctest_start (Experimental) ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}") -if (LOCAL_SUBMIT) +if(LOCAL_SUBMIT) ctest_submit (PARTS Configure Notes) -endif () +endif() ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) -if (LOCAL_SUBMIT) +if(LOCAL_SUBMIT) ctest_submit (PARTS Build) -endif () +endif() ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) -if (LOCAL_SUBMIT) +if(LOCAL_SUBMIT) ctest_submit (PARTS Test) -endif () -if (res GREATER 0) +endif() +if(res GREATER 0) message (FATAL_ERROR "tests FAILED") -endif () +endif() #----------------------------------------------------------------------------- ############################################################################################################## diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ef361b2..55de5ea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- @@ -90,10 +90,8 @@ set (H5C_SOURCES ${HDF5_SRC_DIR}/H5C.c ${HDF5_SRC_DIR}/H5Cdbg.c ${HDF5_SRC_DIR}/H5Cepoch.c - ${HDF5_SRC_DIR}/H5Cimage.c ${HDF5_SRC_DIR}/H5Clog.c ${HDF5_SRC_DIR}/H5Cmpio.c - ${HDF5_SRC_DIR}/H5Cprefetched.c ${HDF5_SRC_DIR}/H5Cquery.c ${HDF5_SRC_DIR}/H5Ctag.c ${HDF5_SRC_DIR}/H5Ctest.c @@ -441,7 +439,6 @@ set (H5O_SOURCES ${HDF5_SRC_DIR}/H5Obogus.c ${HDF5_SRC_DIR}/H5Obtreek.c ${HDF5_SRC_DIR}/H5Ocache.c - ${HDF5_SRC_DIR}/H5Ocache_image.c ${HDF5_SRC_DIR}/H5Ochunk.c ${HDF5_SRC_DIR}/H5Ocont.c ${HDF5_SRC_DIR}/H5Ocopy.c @@ -661,7 +658,7 @@ set (H5Z_SOURCES if (H5_ZLIB_HEADER) SET_PROPERTY(SOURCE ${HDF5_SRC_DIR}/H5Zdeflate.c PROPERTY COMPILE_DEFINITIONS H5_ZLIB_HEADER="${H5_ZLIB_HEADER}") -endif () +endif (H5_ZLIB_HEADER) set (H5Z_HDRS @@ -819,10 +816,10 @@ if (HDF5_GENERATE_HEADERS) COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SRC_DIR}/H5overflow.txt OUTPUT_VARIABLE SCRIPT_OUTPUT ) message(STATUS ${SCRIPT_OUTPUT}) - else () + else (PERL_FOUND) message (STATUS "Cannot generate headers - perl not found") - endif () -endif () + endif (PERL_FOUND) +endif (HDF5_GENERATE_HEADERS) #----------------------------------------------------------------------------- # Setup the H5Detect utility which generates H5Tinit with platform @@ -832,7 +829,7 @@ add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) TARGET_C_PROPERTIES (H5detect STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") -endif () +endif (MSVC OR MINGW) set (CMD $) add_custom_command ( @@ -846,7 +843,7 @@ add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") -endif () +endif (MSVC OR MINGW) set (CMD $) add_custom_command ( @@ -867,10 +864,10 @@ TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_LIB_TARGET} ${LINK_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} dl) -endif () +endif (NOT WIN32) if (H5_HAVE_PARALLEL AND MPI_C_FOUND) target_link_libraries (${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) -endif () +endif (H5_HAVE_PARALLEL AND MPI_C_FOUND) set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) set_target_properties (${HDF5_LIB_TARGET} PROPERTIES @@ -884,7 +881,7 @@ if (HDF5_ENABLE_DEBUG_APIS) COMPILE_DEFINITIONS "H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG" ) -endif () +endif (HDF5_ENABLE_DEBUG_APIS) set (install_targets ${HDF5_LIB_TARGET}) if (BUILD_SHARED_LIBS) @@ -911,10 +908,10 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${HDF5_LIBSH_TARGET} ${LINK_SHARED_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIBSH_TARGET} dl) - endif () + endif (NOT WIN32) if (H5_HAVE_PARALLEL AND MPI_C_FOUND) target_link_libraries (${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) - endif () + endif (H5_HAVE_PARALLEL AND MPI_C_FOUND) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_LIBSH_TARGET} PROPERTIES @@ -929,16 +926,16 @@ if (BUILD_SHARED_LIBS) "H5_HAVE_THREADSAFE" ) target_link_libraries (${HDF5_LIBSH_TARGET} Threads::Threads) - endif () + endif (HDF5_ENABLE_THREADSAFE) if (HDF5_ENABLE_DEBUG_APIS) set_property (TARGET ${HDF5_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG" ) - endif () + endif (HDF5_ENABLE_DEBUG_APIS) set (install_targets ${install_targets} ${HDF5_LIBSH_TARGET}) -endif () +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -953,7 +950,7 @@ if (NOT HDF5_INSTALL_NO_DEVELOPMENT) COMPONENT headers ) -endif () +endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects @@ -961,8 +958,7 @@ endif () if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries) - endif () - INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries) + endif (BUILD_SHARED_LIBS) install ( TARGETS @@ -975,4 +971,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT libraries INCLUDES DESTINATION include ) -endif () +endif (HDF5_EXPORTED_TARGETS) diff --git a/src/H5AC.c b/src/H5AC.c index ee68a6f..117e662 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -107,43 +107,38 @@ hbool_t H5_coll_api_sanity_check_g = false; /* Local Variables */ /*******************/ -/* Metadata entry class list */ - -/* Remember to add new type ID to the H5AC_type_t enum in H5ACprivate.h when - * adding a new class. - */ - -static const H5AC_class_t *const H5AC_class_s[] = { - H5AC_BT, /* ( 0) B-tree nodes */ - H5AC_SNODE, /* ( 1) symbol table nodes */ - H5AC_LHEAP_PRFX, /* ( 2) local heap prefix */ - H5AC_LHEAP_DBLK, /* ( 3) local heap data block */ - H5AC_GHEAP, /* ( 4) global heap */ - H5AC_OHDR, /* ( 5) object header */ - H5AC_OHDR_CHK, /* ( 6) object header chunk */ - H5AC_BT2_HDR, /* ( 7) v2 B-tree header */ - H5AC_BT2_INT, /* ( 8) v2 B-tree internal node */ - H5AC_BT2_LEAF, /* ( 9) v2 B-tree leaf node */ - H5AC_FHEAP_HDR, /* (10) fractal heap header */ - H5AC_FHEAP_DBLOCK, /* (11) fractal heap direct block */ - H5AC_FHEAP_IBLOCK, /* (12) fractal heap indirect block */ - H5AC_FSPACE_HDR, /* (13) free space header */ - H5AC_FSPACE_SINFO, /* (14) free space sections */ - H5AC_SOHM_TABLE, /* (15) shared object header message master table */ - H5AC_SOHM_LIST, /* (16) shared message index stored as a list */ - H5AC_EARRAY_HDR, /* (17) extensible array header */ - H5AC_EARRAY_IBLOCK, /* (18) extensible array index block */ - H5AC_EARRAY_SBLOCK, /* (19) extensible array super block */ - H5AC_EARRAY_DBLOCK, /* (20) extensible array data block */ - H5AC_EARRAY_DBLK_PAGE, /* (21) extensible array data block page */ - H5AC_FARRAY_HDR, /* (22) fixed array header */ - H5AC_FARRAY_DBLOCK, /* (23) fixed array data block */ - H5AC_FARRAY_DBLK_PAGE, /* (24) fixed array data block page */ - H5AC_SUPERBLOCK, /* (25) file superblock */ - H5AC_DRVRINFO, /* (26) driver info block (supplements superblock) */ - H5AC_EPOCH_MARKER, /* (27) epoch marker - always internal to cache */ - H5AC_PROXY_ENTRY, /* (28) cache entry proxy */ - H5AC_PREFETCHED_ENTRY /* (29) prefetched entry - always internal to cache */ +static const char *H5AC_entry_type_names[H5AC_NTYPES] = +{ + "B-tree nodes", + "symbol table nodes", + "local heap prefixes", + "local heap data blocks", + "global heaps", + "object headers", + "object header chunks", + "v2 B-tree headers", + "v2 B-tree internal nodes", + "v2 B-tree leaf nodes", + "fractal heap headers", + "fractal heap direct blocks", + "fractal heap indirect blocks", + "free space headers", + "free space sections", + "shared OH message master table", + "shared OH message index", + "extensible array headers", + "extensible array index blocks", + "extensible array super blocks", + "extensible array data blocks", + "extensible array data block pages", + "fixed array headers", + "fixed array data block", + "fixed array data block pages", + "superblock", + "driver info", + "epoch marker", /* internal to cache only */ + "proxy entry", + "test entry" /* for testing only -- not used for actual files */ }; @@ -371,13 +366,12 @@ H5AC_term_package(void) *------------------------------------------------------------------------- */ herr_t -H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_config_t * image_config_ptr) +H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) { #ifdef H5_HAVE_PARALLEL char prefix[H5C__PREFIX_LEN] = ""; H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ - struct H5C_cache_image_ctl_t int_ci_config = H5C__DEFAULT_CACHE_IMAGE_CTL; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -386,16 +380,11 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co HDassert(f); HDassert(NULL == f->shared->cache); HDassert(config_ptr != NULL) ; - HDassert(image_config_ptr != NULL) ; - HDassert(image_config_ptr->version == H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION); - HDcompile_assert(NELMTS(H5AC_class_s) == H5AC_NTYPES); + HDcompile_assert(NELMTS(H5AC_entry_type_names) == H5AC_NTYPES); HDcompile_assert(H5C__MAX_NUM_TYPE_IDS == H5AC_NTYPES); - /* Validate configurations */ if(H5AC_validate_config(config_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad cache configuration") - if(H5AC_validate_cache_image_config(image_config_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad cache image configuration") #ifdef H5_HAVE_PARALLEL if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { @@ -413,7 +402,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get mpi size") if(NULL == (aux_ptr = H5FL_CALLOC(H5AC_aux_t))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate H5AC auxilary structure") + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate H5AC auxilary structure.") aux_ptr->magic = H5AC__H5AC_AUX_T_MAGIC; aux_ptr->mpi_comm = mpi_comm; @@ -437,16 +426,15 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co aux_ptr->candidate_slist_ptr = NULL; aux_ptr->write_done = NULL; aux_ptr->sync_point_done = NULL; - aux_ptr->p0_image_len = 0; sprintf(prefix, "%d:", mpi_rank); if(mpi_rank == 0) { if(NULL == (aux_ptr->d_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create dirtied entry list") + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create dirtied entry list.") if(NULL == (aux_ptr->c_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cleaned entry list") + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cleaned entry list.") } /* end if */ /* construct the candidate slist for all processes. @@ -454,25 +442,25 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co * will use it in the case of a flush. */ if(NULL == (aux_ptr->candidate_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create candidate entry list") + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create candidate entry list.") if(aux_ptr != NULL) if(aux_ptr->mpi_rank == 0) f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), - H5AC_class_s, + (const char **)H5AC_entry_type_names, H5AC__check_if_write_permitted, TRUE, H5AC__log_flushed_entry, (void *)aux_ptr); else f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), - H5AC_class_s, + (const char **)H5AC_entry_type_names, H5AC__check_if_write_permitted, TRUE, NULL, (void *)aux_ptr); else f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), - H5AC_class_s, + (const char **)H5AC_entry_type_names, H5AC__check_if_write_permitted, TRUE, NULL, NULL); } /* end if */ else { @@ -483,7 +471,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co */ f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1), - H5AC_class_s, + (const char **)H5AC_entry_type_names, H5AC__check_if_write_permitted, TRUE, NULL, NULL); #ifdef H5_HAVE_PARALLEL } /* end else */ @@ -512,20 +500,6 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co if(H5AC_set_cache_auto_resize_config(f->shared->cache, config_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "auto resize configuration failed") - /* don't need to get the current H5C image config here since the - * cache has just been created, and thus f->shared->cache->image_ctl - * must still set to its initial value (H5C__DEFAULT_CACHE_IMAGE_CTL). - * Note that this not true as soon as control returns to the application - * program, as some test code modifies f->shared->cache->image_ctl. - */ - int_ci_config.version = image_config_ptr->version; - int_ci_config.generate_image = image_config_ptr->generate_image; - int_ci_config.save_resize_status = image_config_ptr->save_resize_status; - int_ci_config.entry_ageout = image_config_ptr->entry_ageout; - - if(H5C_set_cache_image_config(f, f->shared->cache, &int_ci_config) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "auto resize configuration failed") - done: #ifdef H5_HAVE_PARALLEL /* if there is a failure, try to tidy up the auxilary structure */ @@ -583,7 +557,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) #if H5AC__TRACE_FILE_ENABLED if(H5AC__close_trace_file(f->shared->cache) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__close_trace_file() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__close_trace_file() failed.") #endif /* H5AC__TRACE_FILE_ENABLED */ if(H5F_USE_MDC_LOGGING(f)) { @@ -597,7 +571,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) #ifdef H5_HAVE_PARALLEL /* destroying the cache, so clear all collective entries */ if(H5C_clear_coll_entries(f->shared->cache, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed.") aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache); if(aux_ptr) @@ -606,7 +580,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) /* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */ if(H5AC__flush_entries(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.") #endif /* H5_HAVE_PARALLEL */ /* Destroy the cache */ @@ -616,18 +590,12 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) #ifdef H5_HAVE_PARALLEL if(aux_ptr != NULL) { - if(aux_ptr->d_slist_ptr != NULL) { - HDassert(H5SL_count(aux_ptr->d_slist_ptr) == 0); + if(aux_ptr->d_slist_ptr != NULL) H5SL_close(aux_ptr->d_slist_ptr); - } /* end if */ - if(aux_ptr->c_slist_ptr != NULL) { - HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0); + if(aux_ptr->c_slist_ptr != NULL) H5SL_close(aux_ptr->c_slist_ptr); - } /* end if */ - if(aux_ptr->candidate_slist_ptr != NULL) { - HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0); + if(aux_ptr->candidate_slist_ptr != NULL) H5SL_close(aux_ptr->candidate_slist_ptr); - } /* end if */ aux_ptr->magic = 0; aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr); } /* end if */ @@ -738,7 +706,7 @@ H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, #endif /* H5AC__TRACE_FILE_ENABLED */ if(H5C_expunge_entry(f, dxpl_id, type, addr, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_expunge_entry() failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_expunge_entry() failed.") done: #if H5AC__TRACE_FILE_ENABLED @@ -808,17 +776,17 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id) #ifdef H5_HAVE_PARALLEL /* flushing the cache, so clear all collective entries */ if(H5C_clear_coll_entries(f->shared->cache, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed.") /* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */ if(H5AC__flush_entries(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.") #endif /* H5_HAVE_PARALLEL */ /* Flush the cache */ /* (Again, in parallel - writes out the superblock) */ if(H5C_flush_cache(f, dxpl_id, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache.") done: #if H5AC__TRACE_FILE_ENABLED @@ -872,11 +840,11 @@ H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status) FUNC_ENTER_NOAPI(FAIL) if((f == NULL) || (!H5F_addr_defined(addr)) || (status == NULL)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry.") if(H5C_get_entry_status(f, addr, NULL, &in_cache, &is_dirty, &is_protected, &is_pinned, &is_corked, &is_flush_dep_parent, &is_flush_dep_child, &image_is_up_to_date) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed.") if(in_cache) { *status |= H5AC_ES__IN_CACHE; @@ -990,7 +958,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add /* Check if we should try to flush */ if(aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold) if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") } /* end if */ } #endif /* H5_HAVE_PARALLEL */ @@ -1010,41 +978,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5AC_load_cache_image_on_next_protect - * - * Purpose: Load the cache image block at the specified location, - * decode it, and insert its contents into the metadata - * cache. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 7/6/15 - * - *------------------------------------------------------------------------- - */ -herr_t -H5AC_load_cache_image_on_next_protect(H5F_t * f, haddr_t addr, hsize_t len, - hbool_t rw) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); - - if(H5C_load_cache_image_on_next_protect(f, addr, len, rw) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "call to H5C_load_cache_image_on_next_protect failed") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_load_cache_image_on_next_protect() */ - - -/*------------------------------------------------------------------------- * Function: H5AC_mark_entry_dirty * * Purpose: Mark a pinned or protected entry as dirty. The target @@ -1397,13 +1330,13 @@ H5_ATTR_UNUSED #endif /* H5_HAVE_PARALLEL */ if(H5C_move_entry(f->shared->cache, type, old_addr, new_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, "H5C_move_entry() failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, "H5C_move_entry() failed.") #ifdef H5_HAVE_PARALLEL /* Check if we should try to flush */ if(NULL != aux_ptr && aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold) if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") #endif /* H5_HAVE_PARALLEL */ done: @@ -1493,7 +1426,7 @@ done: * Function: H5AC_prep_for_file_close * * Purpose: This function should be called just prior to the cache - * flushes at file close. + * flushes at file close. * * The objective of the call is to allow the metadata cache * to do any preparatory work prior to generation of a @@ -1575,7 +1508,7 @@ H5AC_create_flush_dependency(void * parent_thing, void * child_thing) /* Create the flush dependency */ if(H5C_create_flush_dependency(parent_thing, child_thing) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "H5C_create_flush_dependency() failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "H5C_create_flush_dependency() failed.") done: #if H5AC__TRACE_FILE_ENABLED @@ -1676,7 +1609,7 @@ H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, #endif /* H5AC_DO_TAGGING_SANITY_CHECKS */ if(NULL == (thing = H5C_protect(f, dxpl_id, type, addr, udata, flags))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_protect() failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_protect() failed.") #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr != NULL) @@ -1899,7 +1832,7 @@ H5AC_destroy_flush_dependency(void * parent_thing, void * child_thing) /* Destroy the flush dependency */ if(H5C_destroy_flush_dependency(parent_thing, child_thing) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "H5C_destroy_flush_dependency() failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "H5C_destroy_flush_dependency() failed.") done: #if H5AC__TRACE_FILE_ENABLED @@ -2023,18 +1956,18 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, if(deleted && aux_ptr->mpi_rank == 0) if(H5AC__log_deleted_entry((H5AC_info_t *)thing) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5AC__log_deleted_entry() failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5AC__log_deleted_entry() failed.") } /* end if */ #endif /* H5_HAVE_PARALLEL */ if(H5C_unprotect(f, dxpl_id, addr, thing, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5C_unprotect() failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5C_unprotect() failed.") #ifdef H5_HAVE_PARALLEL /* Check if we should try to flush */ if((aux_ptr != NULL) && (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)) if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") #endif /* H5_HAVE_PARALLEL */ done: @@ -2077,22 +2010,22 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, /* Check args */ if((cache_ptr == NULL) || (config_ptr == NULL) || (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr or config_ptr on entry") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr or config_ptr on entry.") #ifdef H5_HAVE_PARALLEL { H5AC_aux_t *aux_ptr; aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); if((aux_ptr != NULL) && (aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad aux_ptr on entry") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad aux_ptr on entry.") } #endif /* H5_HAVE_PARALLEL */ /* Retrieve the configuration */ if(H5C_get_cache_auto_resize_config((const H5C_t *)cache_ptr, &internal_config) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_auto_resize_config() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_auto_resize_config() failed.") if(H5C_get_evictions_enabled((const H5C_t *)cache_ptr, &evictions_enabled) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_resize_enabled() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_resize_enabled() failed.") /* Set the information to return */ if(internal_config.rpt_fcn == NULL) @@ -2161,7 +2094,7 @@ done: */ herr_t H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr, - size_t *cur_size_ptr, uint32_t *cur_num_entries_ptr) + size_t *cur_size_ptr, int32_t *cur_num_entries_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2169,7 +2102,7 @@ H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_s if(H5C_get_cache_size((H5C_t *)cache_ptr, max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_size() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_size() failed.") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2196,7 +2129,7 @@ H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr) FUNC_ENTER_NOAPI(FAIL) if(H5C_get_cache_hit_rate((H5C_t *)cache_ptr, hit_rate_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_hit_rate() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_hit_rate() failed.") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2223,7 +2156,7 @@ H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr) FUNC_ENTER_NOAPI(FAIL) if(H5C_reset_cache_hit_rate_stats((H5C_t *)cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats() failed.") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2272,14 +2205,14 @@ H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config #endif /* H5AC__TRACE_FILE_ENABLED */ if(cache_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad cache_ptr on entry") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad cache_ptr on entry.") #ifdef H5_HAVE_PARALLEL { H5AC_aux_t *aux_ptr; aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); if((aux_ptr != NULL) && (aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad aux_ptr on entry") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad aux_ptr on entry.") } #endif /* H5_HAVE_PARALLEL */ @@ -2291,29 +2224,29 @@ H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config FILE * file_ptr; if(NULL == (file_ptr = H5C_get_trace_file_ptr(cache_ptr))) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_trace_file_ptr() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_trace_file_ptr() failed.") if((!(config_ptr->close_trace_file)) && (file_ptr != NULL)) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Trace file already open") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Trace file already open.") } /* end if */ /* Close & reopen trace file, if requested */ if(config_ptr->close_trace_file) if(H5AC__close_trace_file(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__close_trace_file() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__close_trace_file() failed.") if(config_ptr->open_trace_file) if(H5AC__open_trace_file(cache_ptr, config_ptr->trace_file_name) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "H5AC__open_trace_file() failed") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "H5AC__open_trace_file() failed.") /* Convert external configuration to internal representation */ if(H5AC__ext_config_2_int_config(config_ptr, &internal_config) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed.") /* Set configuration */ if(H5C_set_cache_auto_resize_config(cache_ptr, &internal_config) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_cache_auto_resize_config() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_cache_auto_resize_config() failed.") if(H5C_set_evictions_enabled(cache_ptr, config_ptr->evictions_enabled) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_evictions_enabled() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_evictions_enabled() failed.") #ifdef H5_HAVE_PARALLEL { @@ -2412,9 +2345,9 @@ H5AC_validate_config(H5AC_cache_config_t *config_ptr) /* Check args */ if(config_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL config_ptr on entry") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.") if(config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown config version") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown config version.") /* don't bother to test trace_file_name unless open_trace_file is TRUE */ if(config_ptr->open_trace_file) { @@ -2426,31 +2359,31 @@ H5AC_validate_config(H5AC_cache_config_t *config_ptr) */ name_len = HDstrlen(config_ptr->trace_file_name); if(name_len == 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name is empty") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name is empty.") else if(name_len > H5AC__MAX_TRACE_FILE_NAME_LEN) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name too long") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name too long.") } /* end if */ if((config_ptr->evictions_enabled == FALSE) && ((config_ptr->incr_mode != H5C_incr__off) || (config_ptr->flash_incr_mode != H5C_flash_incr__off) || (config_ptr->decr_mode != H5C_decr__off))) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Can't disable evictions while auto-resize is enabled") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Can't disable evictions while auto-resize is enabled.") if(config_ptr->dirty_bytes_threshold < H5AC__MIN_DIRTY_BYTES_THRESHOLD) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too small") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too small.") else if(config_ptr->dirty_bytes_threshold > H5AC__MAX_DIRTY_BYTES_THRESHOLD) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too big") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too big.") if((config_ptr->metadata_write_strategy != H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY) && (config_ptr->metadata_write_strategy != H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->metadata_write_strategy out of range") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->metadata_write_strategy out of range.") if(H5AC__ext_config_2_int_config(config_ptr, &internal_config) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed.") if(H5C_validate_resize_config(&internal_config, H5C_RESIZE_CFG__VALIDATE_ALL) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "error(s) in new config") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "error(s) in new config.") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2458,61 +2391,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5AC_validate_cache_image_config() - * - * Purpose: Run a sanity check on the contents of the supplied - * instance of H5AC_cache_image_config_t. - * - * Do nothing and return SUCCEED if no errors are detected, - * and flag an error and return FAIL otherwise. - * - * At present, this function operates by packing the data - * from the instance of H5AC_cache_image_config_t into an - * instance of H5C_cache_image_ctl_t, and then calling - * H5C_validate_cache_image_config(). If and when - * H5AC_cache_image_config_t and H5C_cache_image_ctl_t - * diverge, we may have to change this. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 6/25/15 - * - *------------------------------------------------------------------------- - */ -herr_t -H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr) -{ - H5C_cache_image_ctl_t internal_config = H5C__DEFAULT_CACHE_IMAGE_CTL; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check args */ - if(config_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL config_ptr on entry") - - if(config_ptr->version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown image config version") - - /* don't need to get the current H5C image config here since the - * default values of fields not in the H5AC config will always be - * valid. - */ - internal_config.version = config_ptr->version; - internal_config.generate_image = config_ptr->generate_image; - internal_config.save_resize_status = config_ptr->save_resize_status; - internal_config.entry_ageout = config_ptr->entry_ageout; - - if(H5C_validate_cache_image_config(&internal_config) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "error(s) in new cache image config") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_validate_cache_image_config() */ - - -/*------------------------------------------------------------------------- * * Function: H5AC__check_if_write_permitted * @@ -2595,7 +2473,7 @@ H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr, if((ext_conf_ptr == NULL) || (ext_conf_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION) || (int_conf_ptr == NULL)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad ext_conf_ptr or inf_conf_ptr on entry") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad ext_conf_ptr or inf_conf_ptr on entry.") int_conf_ptr->version = H5C__CURR_AUTO_SIZE_CTL_VER; if(ext_conf_ptr->rpt_fcn_enabled) @@ -2662,7 +2540,7 @@ H5AC_ignore_tags(const H5F_t *f) /* Set up a new metadata tag */ if(H5C_ignore_tags(f->shared->cache) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "H5C_ignore_tags() failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "H5C_ignore_tags() failed.") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5ACdbg.c b/src/H5ACdbg.c index 8ca5102..8d99c6f 100644 --- a/src/H5ACdbg.c +++ b/src/H5ACdbg.c @@ -252,207 +252,6 @@ done: /*------------------------------------------------------------------------- * - * Function: H5AC_get_entry_ptr_from_addr() - * - * Purpose: Debugging function that attempts to look up an entry in the - * cache by its file address, and if found, returns a pointer - * to the entry in *entry_ptr_ptr. If the entry is not in the - * cache, *entry_ptr_ptr is set to NULL. - * - * WARNING: This call should be used only in debugging - * routines, and it should be avoided when - * possible. - * - * Further, if we ever multi-thread the cache, - * this routine will have to be either discarded - * or heavily re-worked. - * - * Finally, keep in mind that the entry whose - * pointer is obtained in this fashion may not - * be in a stable state. - * - * Note that this function is only defined if NDEBUG - * is not defined. - * - * As heavy use of this function is almost certainly a - * bad idea, the metadata cache tracks the number of - * successful calls to this function, and (if - * H5C_DO_SANITY_CHECKS is defined) displays any - * non-zero count on cache shutdown. - * - * This function is just a wrapper that calls the H5C - * version of the function. - * - * Return: FAIL if error is detected, SUCCEED otherwise. - * - * Programmer: John Mainzer, 5/30/14 - * - *------------------------------------------------------------------------- - */ -#ifndef NDEBUG -herr_t -H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, void **entry_ptr_ptr) -{ - H5C_t *cache_ptr; /* Ptr to cache */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - cache_ptr = f->shared->cache; - - if(H5C_get_entry_ptr_from_addr(cache_ptr, addr, entry_ptr_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_ptr_from_addr() failed") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_get_entry_ptr_from_addr() */ -#endif /* NDEBUG */ - - -/*------------------------------------------------------------------------- - * Function: H5AC_flush_dependency_exists() - * - * Purpose: Test to see if a flush dependency relationship exists - * between the supplied parent and child. Both parties - * are indicated by addresses so as to avoid the necessity - * of protect / unprotect calls prior to this call. - * - * If either the parent or the child is not in the metadata - * cache, the function sets *fd_exists_ptr to FALSE. - * - * If both are in the cache, the childs list of parents is - * searched for the proposed parent. If the proposed parent - * is found in the childs parent list, the function sets - * *fd_exists_ptr to TRUE. In all other non-error cases, - * the function sets *fd_exists_ptr FALSE. - * - * Return: SUCCEED on success/FAIL on failure. Note that - * *fd_exists_ptr is undefined on failure. - * - * Programmer: John Mainzer - * 9/28/16 - * - *------------------------------------------------------------------------- - */ -#ifndef NDEBUG -herr_t -H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, - hbool_t *fd_exists_ptr) -{ - H5C_t *cache_ptr; /* Ptr to cache */ - herr_t ret_value = FAIL; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - cache_ptr = f->shared->cache; - - ret_value = H5C_flush_dependency_exists(cache_ptr, parent_addr, child_addr, fd_exists_ptr); - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_flush_dependency_exists() */ -#endif /* NDEBUG */ - - -/*------------------------------------------------------------------------- - * - * Function: H5AC_verify_entry_type() - * - * Purpose: Debugging function that attempts to look up an entry in the - * cache by its file address, and if found, test to see if its - * type field contains the expected value. - * - * If the specified entry is in cache, *in_cache_ptr is set - * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending - * on whether the entries type field matches the - * expected_type parameter - * - * If the target entry is not in cache, *in_cache_ptr is - * set to FALSE, and *type_ok_ptr is undefined. - * - * Note that this function is only defined if NDEBUG - * is not defined. - * - * This function is just a wrapper that calls the H5C - * version of the function. - * - * Return: FAIL if error is detected, SUCCEED otherwise. - * - * Programmer: John Mainzer, 5/30/14 - * - * Changes: None. - * - * JRM -- 9/17/16 - * - *------------------------------------------------------------------------- - */ -#ifndef NDEBUG -herr_t -H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, - const H5AC_class_t *expected_type, hbool_t *in_cache_ptr, - hbool_t *type_ok_ptr) -{ - H5C_t * cache_ptr; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - cache_ptr = f->shared->cache; - - if(H5C_verify_entry_type(cache_ptr, addr, expected_type, in_cache_ptr, type_ok_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_verify_entry_type() failed") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_verify_entry_type() */ -#endif /* NDEBUG */ - - -/*------------------------------------------------------------------------- - * Function: H5AC_get_serialization_in_progress - * - * Purpose: Return the current value of - * cache_ptr->serialization_in_progress. - * - * Return: Current value of cache_ptr->serialization_in_progress. - * - * Programmer: John Mainzer - * 8/24/15 - * - *------------------------------------------------------------------------- - */ -#ifndef NDEBUG -hbool_t -H5AC_get_serialization_in_progress(H5F_t *f) -{ - H5C_t * cache_ptr; - hbool_t ret_value = FALSE; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Sanity check */ - HDassert(f); - HDassert(f->shared); - cache_ptr = f->shared->cache; - - /* Set return value */ - ret_value = H5C_get_serialization_in_progress(cache_ptr); - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_get_serialization_in_progress() */ -#endif /* NDEBUG */ - - -/*------------------------------------------------------------------------- - * * Function: H5AC_cache_is_clean() * * Purpose: Debugging function that verifies that all rings in the @@ -475,7 +274,7 @@ hbool_t H5AC_cache_is_clean(const H5F_t *f, H5AC_ring_t inner_ring) { H5C_t *cache_ptr; - hbool_t ret_value = FALSE; /* Return value */ + hbool_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index 945aaba..44ffd9d 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -81,7 +81,7 @@ typedef struct H5AC_addr_list_ud_t { H5AC_aux_t * aux_ptr; /* 'Auxiliary' parallel cache info */ haddr_t * addr_buf_ptr; /* Array to store addresses */ - unsigned u; /* Counter for position in array */ + int i; /* Counter for position in array */ } H5AC_addr_list_ud_t; @@ -90,21 +90,21 @@ typedef struct H5AC_addr_list_ud_t /********************/ static herr_t H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, - unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); + int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); static herr_t H5AC__broadcast_clean_list(H5AC_t *cache_ptr); static herr_t H5AC__construct_candidate_list(H5AC_t *cache_ptr, H5AC_aux_t *aux_ptr, int sync_point_op); static herr_t H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, - unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); + int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); static herr_t H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id); static herr_t H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f, hid_t dxpl_id); -static herr_t H5AC__receive_haddr_list(MPI_Comm mpi_comm, unsigned *num_entries_ptr, +static herr_t H5AC__receive_haddr_list(MPI_Comm mpi_comm, int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); static herr_t H5AC__receive_candidate_list(const H5AC_t *cache_ptr, - unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); + int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); static herr_t H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t dxpl_id); -static herr_t H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, +static herr_t H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, int num_candidates, haddr_t *candidates_list_ptr); static herr_t H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id); static herr_t H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f, hid_t dxpl_id); @@ -151,7 +151,7 @@ H5FL_DEFINE_STATIC(H5AC_slist_entry_t); */ herr_t H5AC__set_sync_point_done_callback(H5C_t * cache_ptr, - void (* sync_point_done)(unsigned num_writes, haddr_t * written_entries_tbl)) + void (* sync_point_done)(int num_writes, haddr_t * written_entries_tbl)) { H5AC_aux_t * aux_ptr; @@ -282,13 +282,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, unsigned *num_entries_ptr, +H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr) { H5AC_aux_t * aux_ptr = NULL; haddr_t * haddr_buf_ptr = NULL; int mpi_result; - unsigned num_entries; + int num_entries; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -310,13 +310,13 @@ H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, unsigned *num_entries_ptr, * receivers can set up buffers to receive them. If there aren't * any, we are done. */ - num_entries = (unsigned)H5SL_count(aux_ptr->candidate_slist_ptr); - if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_UNSIGNED, 0, aux_ptr->mpi_comm))) + num_entries = (int)H5SL_count(aux_ptr->candidate_slist_ptr); + if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) if(num_entries > 0) { size_t buf_size = 0; - unsigned chk_num_entries = 0; + int chk_num_entries = 0; /* convert the candidate list into the format we * are used to receiving from process 0, and also load it @@ -328,7 +328,7 @@ H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, unsigned *num_entries_ptr, HDassert(haddr_buf_ptr != NULL); /* Now broadcast the list of candidate entries */ - buf_size = sizeof(haddr_t) * num_entries; + buf_size = sizeof(haddr_t) * (size_t)num_entries; if(MPI_SUCCESS != (mpi_result = MPI_Bcast((void *)haddr_buf_ptr, (int)buf_size, MPI_BYTE, 0, aux_ptr->mpi_comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) } /* end if */ @@ -378,8 +378,8 @@ H5AC__broadcast_clean_list_cb(void *_item, void H5_ATTR_UNUSED *_key, /* Store the entry's address in the buffer */ addr = slist_entry_ptr->addr; - udata->addr_buf_ptr[udata->u] = addr; - udata->u++; + udata->addr_buf_ptr[udata->i] = addr; + udata->i++; /* now release the entry */ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); @@ -420,7 +420,7 @@ H5AC__broadcast_clean_list(H5AC_t * cache_ptr) haddr_t * addr_buf_ptr = NULL; H5AC_aux_t * aux_ptr; int mpi_result; - unsigned num_entries = 0; + int num_entries = 0; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -437,8 +437,8 @@ H5AC__broadcast_clean_list(H5AC_t * cache_ptr) * receives can set up a buffer to receive them. If there aren't * any, we are done. */ - num_entries = (unsigned)H5SL_count(aux_ptr->c_slist_ptr); - if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_UNSIGNED, 0, aux_ptr->mpi_comm))) + num_entries = (int)H5SL_count(aux_ptr->c_slist_ptr); + if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, aux_ptr->mpi_comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) if(num_entries > 0) { @@ -446,14 +446,14 @@ H5AC__broadcast_clean_list(H5AC_t * cache_ptr) size_t buf_size; /* allocate a buffer to store the list of entry base addresses in */ - buf_size = sizeof(haddr_t) * num_entries; + buf_size = sizeof(haddr_t) * (size_t)num_entries; if(NULL == (addr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for addr buffer") /* Set up user data for callback */ udata.aux_ptr = aux_ptr; udata.addr_buf_ptr = addr_buf_ptr; - udata.u = 0; + udata.i = 0; /* Free all the clean list entries, building the address list in the callback */ /* (Callback also removes the matching entries from the dirtied list) */ @@ -568,8 +568,8 @@ H5AC__copy_candidate_list_to_buffer_cb(void *_item, void H5_ATTR_UNUSED *_key, HDassert(udata); /* Store the entry's address in the buffer */ - udata->addr_buf_ptr[udata->u] = slist_entry_ptr->addr; - udata->u++; + udata->addr_buf_ptr[udata->i] = slist_entry_ptr->addr; + udata->i++; /* now release the entry */ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr); @@ -610,14 +610,14 @@ H5AC__copy_candidate_list_to_buffer_cb(void *_item, void H5_ATTR_UNUSED *_key, *------------------------------------------------------------------------- */ static herr_t -H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, unsigned *num_entries_ptr, +H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr) { H5AC_aux_t * aux_ptr = NULL; H5AC_addr_list_ud_t udata; haddr_t * haddr_buf_ptr = NULL; size_t buf_size; - unsigned num_entries = 0; + int num_entries = 0; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -635,19 +635,19 @@ H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, unsigned *num_entri HDassert(haddr_buf_ptr_ptr != NULL); HDassert(*haddr_buf_ptr_ptr == NULL); - num_entries = (unsigned)H5SL_count(aux_ptr->candidate_slist_ptr); + num_entries = (int)H5SL_count(aux_ptr->candidate_slist_ptr); /* allocate a buffer(s) to store the list of candidate entry * base addresses in */ - buf_size = sizeof(haddr_t) * num_entries; + buf_size = sizeof(haddr_t) * (size_t)num_entries; if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for haddr buffer") /* Set up user data for callback */ udata.aux_ptr = aux_ptr; udata.addr_buf_ptr = haddr_buf_ptr; - udata.u = 0; + udata.i = 0; /* Free all the candidate list entries, building the address list in the callback */ if(H5SL_free(aux_ptr->candidate_slist_ptr, H5AC__copy_candidate_list_to_buffer_cb, &udata) < 0) @@ -1234,7 +1234,7 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id) H5AC_aux_t * aux_ptr; haddr_t * candidates_list_ptr = NULL; int mpi_result; - unsigned num_candidates = 0; + int num_candidates = 0; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1448,12 +1448,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__receive_haddr_list(MPI_Comm mpi_comm, unsigned *num_entries_ptr, +H5AC__receive_haddr_list(MPI_Comm mpi_comm, int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr) { haddr_t * haddr_buf_ptr = NULL; int mpi_result; - unsigned num_entries; + int num_entries; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1468,14 +1468,14 @@ H5AC__receive_haddr_list(MPI_Comm mpi_comm, unsigned *num_entries_ptr, * can set up a buffer to receive them. If there aren't * any, we are done. */ - if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_UNSIGNED, 0, mpi_comm))) + if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&num_entries, 1, MPI_INT, 0, mpi_comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) if(num_entries > 0) { size_t buf_size; /* allocate buffers to store the list of entry base addresses in */ - buf_size = sizeof(haddr_t) * num_entries; + buf_size = sizeof(haddr_t) * (size_t)num_entries; if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for haddr buffer") @@ -1523,7 +1523,7 @@ H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t dxpl_id) H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; haddr_t * haddr_buf_ptr = NULL; - unsigned num_entries = 0; + int num_entries = 0; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1543,7 +1543,7 @@ H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t dxpl_id) if(num_entries > 0) /* mark the indicated entries as clean */ - if(H5C_mark_entries_as_clean(f, dxpl_id, num_entries, haddr_buf_ptr) < 0) + if(H5C_mark_entries_as_clean(f, dxpl_id, (int32_t)num_entries, haddr_buf_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't mark entries clean.") /* if it is defined, call the sync point done callback. Note @@ -1582,7 +1582,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__receive_candidate_list(const H5AC_t *cache_ptr, unsigned *num_entries_ptr, +H5AC__receive_candidate_list(const H5AC_t *cache_ptr, int *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr) { H5AC_aux_t * aux_ptr; @@ -1667,7 +1667,7 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id) H5AC_aux_t * aux_ptr; haddr_t * haddr_buf_ptr = NULL; int mpi_result; - unsigned num_entries = 0; + int num_entries = 0; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2224,11 +2224,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, +H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, int num_candidates, haddr_t *candidates_list_ptr) { H5AC_aux_t * aux_ptr; - unsigned u; + int i; FUNC_ENTER_STATIC_NOERR @@ -2249,12 +2249,12 @@ H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, * cleaned list. However, for this metadata write strategy, * we just want to remove all references to the candidate entries. */ - for(u = 0; u < num_candidates; u++) { + for(i = 0; i < num_candidates; i++) { H5AC_slist_entry_t * d_slist_entry_ptr; H5AC_slist_entry_t * c_slist_entry_ptr; haddr_t addr; - addr = candidates_list_ptr[u]; + addr = candidates_list_ptr[i]; /* addr may be either on the dirtied list, or on the flushed * and still clean list. Remove it. diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index 77ba0ae..dbbd8a0 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -351,12 +351,6 @@ H5FL_EXTERN(H5AC_aux_t); * this verification. The field is set to NULL when the * callback is not needed. * - * The following field supports the metadata cache image feature. - * - * p0_image_len: unsiged integer containing the length of the metadata cache - * image constructed by MPI process 0. This field should be 0 - * if the value is unknown, or if cache image is not enabled. - * ****************************************************************************/ #ifdef H5_HAVE_PARALLEL @@ -404,11 +398,8 @@ typedef struct H5AC_aux_t void (* write_done)(void); - void (* sync_point_done)(unsigned num_writes, + void (* sync_point_done)(int num_writes, haddr_t * written_entries_tbl); - - unsigned p0_image_len; - } H5AC_aux_t; /* struct H5AC_aux_t */ #endif /* H5_HAVE_PARALLEL */ @@ -430,7 +421,7 @@ H5_DLL herr_t H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, H5_DLL herr_t H5AC__flush_entries(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5AC__run_sync_point(H5F_t *f, hid_t dxpl_id, int sync_point_op); H5_DLL herr_t H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, - void (*sync_point_done)(unsigned num_writes, haddr_t *written_entries_tbl)); + void (*sync_point_done)(int num_writes, haddr_t *written_entries_tbl)); H5_DLL herr_t H5AC__set_write_done_callback(H5C_t * cache_ptr, void (* write_done)(void)); #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 1fe6456..3dd6079 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -88,7 +88,7 @@ typedef enum { H5AC_DRVRINFO_ID, /* (26) driver info block (supplements superblock) */ H5AC_EPOCH_MARKER_ID, /* (27) epoch marker - always internal to cache */ H5AC_PROXY_ENTRY_ID, /* (28) cache entry proxy */ - H5AC_PREFETCHED_ENTRY_ID, /* (29) prefetched entry - always internal to cache */ + H5AC_TEST_ID, /* (29) test entry -- not used for actual files */ H5AC_NTYPES /* Number of types, must be last */ } H5AC_type_t; @@ -111,22 +111,14 @@ typedef enum { * use the dump_stats parameter to takedown_cache(), or call * H5C_stats() directly. * JRM -- 4/12/15 - * - * Added the H5AC_DUMP_IMAGE_STATS_ON_CLOSE #define, which works much - * the same way as H5AC_DUMP_STATS_ON_CLOSE. However, the set of stats - * displayed is much smaller, and directed purely at the cache image feature. - * - * JRM -- 11/1/15 */ #if H5C_COLLECT_CACHE_STATS #define H5AC_DUMP_STATS_ON_CLOSE 0 -#define H5AC_DUMP_IMAGE_STATS_ON_CLOSE 0 #else /* H5C_COLLECT_CACHE_STATS */ #define H5AC_DUMP_STATS_ON_CLOSE 0 -#define H5AC_DUMP_IMAGE_STATS_ON_CLOSE 0 #endif /* H5C_COLLECT_CACHE_STATS */ @@ -327,13 +319,7 @@ H5_DLLVAR hid_t H5AC_rawdata_dxpl_id; } #endif /* H5_HAVE_PARALLEL */ -#define H5AC__DEFAULT_CACHE_IMAGE_CONFIG \ -{ \ - /* int32_t version = */ H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, \ - /* hbool_t generate_image = */ FALSE, \ - /* hbool_t save_resize_status = */ FALSE, \ - /* int32_t entry_ageout = */ H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE \ -} + /* * Library prototypes. */ @@ -358,6 +344,7 @@ H5_DLLVAR hid_t H5AC_rawdata_dxpl_id; #define H5AC__TAKE_OWNERSHIP_FLAG H5C__TAKE_OWNERSHIP_FLAG #define H5AC__FLUSH_LAST_FLAG H5C__FLUSH_LAST_FLAG #define H5AC__FLUSH_COLLECTIVELY_FLAG H5C__FLUSH_COLLECTIVELY_FLAG +#define H5AC__EVICT_ALLOW_LAST_PINS_FLAG H5C__EVICT_ALLOW_LAST_PINS_FLAG /* #defines of flags used to report entry status in the @@ -373,44 +360,11 @@ H5_DLLVAR hid_t H5AC_rawdata_dxpl_id; #define H5AC_ES__IS_CORKED 0x0040 #define H5AC_ES__IMAGE_IS_UP_TO_DATE 0x0080 -/* Metadata entry class declarations */ -H5_DLLVAR const H5AC_class_t H5AC_BT[1]; -H5_DLLVAR const H5AC_class_t H5AC_SNODE[1]; -H5_DLLVAR const H5AC_class_t H5AC_LHEAP_PRFX[1]; -H5_DLLVAR const H5AC_class_t H5AC_LHEAP_DBLK[1]; -H5_DLLVAR const H5AC_class_t H5AC_GHEAP[1]; -H5_DLLVAR const H5AC_class_t H5AC_OHDR[1]; -H5_DLLVAR const H5AC_class_t H5AC_OHDR_CHK[1]; -H5_DLLVAR const H5AC_class_t H5AC_BT2_HDR[1]; -H5_DLLVAR const H5AC_class_t H5AC_BT2_INT[1]; -H5_DLLVAR const H5AC_class_t H5AC_BT2_LEAF[1]; -H5_DLLVAR const H5AC_class_t H5AC_FHEAP_HDR[1]; -H5_DLLVAR const H5AC_class_t H5AC_FHEAP_DBLOCK[1]; -H5_DLLVAR const H5AC_class_t H5AC_FHEAP_IBLOCK[1]; -H5_DLLVAR const H5AC_class_t H5AC_FSPACE_HDR[1]; -H5_DLLVAR const H5AC_class_t H5AC_FSPACE_SINFO[1]; -H5_DLLVAR const H5AC_class_t H5AC_SOHM_TABLE[1]; -H5_DLLVAR const H5AC_class_t H5AC_SOHM_LIST[1]; -H5_DLLVAR const H5AC_class_t H5AC_EARRAY_HDR[1]; -H5_DLLVAR const H5AC_class_t H5AC_EARRAY_IBLOCK[1]; -H5_DLLVAR const H5AC_class_t H5AC_EARRAY_SBLOCK[1]; -H5_DLLVAR const H5AC_class_t H5AC_EARRAY_DBLOCK[1]; -H5_DLLVAR const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1]; -H5_DLLVAR const H5AC_class_t H5AC_FARRAY_HDR[1]; -H5_DLLVAR const H5AC_class_t H5AC_FARRAY_DBLOCK[1]; -H5_DLLVAR const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1]; -H5_DLLVAR const H5AC_class_t H5AC_SUPERBLOCK[1]; -H5_DLLVAR const H5AC_class_t H5AC_DRVRINFO[1]; -H5_DLLVAR const H5AC_class_t H5AC_EPOCH_MARKER[1]; -H5_DLLVAR const H5AC_class_t H5AC_PROXY_ENTRY[1]; -H5_DLLVAR const H5AC_class_t H5AC_PREFETCHED_ENTRY[1]; - /* external function declarations: */ H5_DLL herr_t H5AC_init(void); -H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, - H5AC_cache_image_config_t * image_config_ptr); +H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr); H5_DLL herr_t H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status_ptr); H5_DLL herr_t H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, @@ -440,18 +394,13 @@ H5_DLL herr_t H5AC_remove_entry(void *entry); H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr, H5AC_cache_config_t *config_ptr); H5_DLL herr_t H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, - size_t *min_clean_size_ptr, size_t *cur_size_ptr, uint32_t *cur_num_entries_ptr); + size_t *min_clean_size_ptr, size_t *cur_size_ptr, int32_t *cur_num_entries_ptr); H5_DLL herr_t H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr); H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t *cache_ptr); H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr); H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr); -/* Cache image routines */ -H5_DLL herr_t H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, - hsize_t len, hbool_t rw); -H5_DLL herr_t H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr); - /* Tag & Ring routines */ H5_DLL herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag); H5_DLL herr_t H5AC_flush_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hid_t dxpl_id); @@ -484,14 +433,6 @@ H5_DLL herr_t H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr); H5_DLL herr_t H5AC_stats(const H5F_t *f); H5_DLL herr_t H5AC_dump_cache(const H5F_t *f); #ifndef NDEBUG -H5_DLL herr_t H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, - void **entry_ptr_ptr); -H5_DLL herr_t H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, - haddr_t child_addr, hbool_t *fd_exists_ptr); -H5_DLL herr_t H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, - const H5AC_class_t *expected_type, hbool_t *in_cache_ptr, - hbool_t *type_ok_ptr); -H5_DLL hbool_t H5AC_get_serialization_in_progress(H5F_t *f); H5_DLL hbool_t H5AC_cache_is_clean(const H5F_t *f, H5AC_ring_t inner_ring); #endif /* NDEBUG */ /* end debugging functions */ diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index 5fdb3f4..dd16764 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -508,67 +508,6 @@ typedef struct H5AC_cache_config_t } H5AC_cache_config_t; -/**************************************************************************** - * - * structure H5AC_cache_image_config_t - * - * H5AC_cache_image_ctl_t is a public structure intended for use in public - * APIs. At least in its initial incarnation, it is a copy of struct - * H5C_cache_image_ctl_t. - * - * The fields of the structure are discussed individually below: - * - * version: Integer field containing the version number of this version - * of the H5C_image_ctl_t structure. Any instance of - * H5C_image_ctl_t passed to the cache must have a known - * version number, or an error will be flagged. - * - * generate_image: Boolean flag indicating whether a cache image should - * be created on file close. - * - * save_resize_status: Boolean flag indicating whether the cache image - * should include the adaptive cache resize configuration and status. - * Note that this field is ignored at present. - * - * entry_ageout: Integer field indicating the maximum number of - * times a prefetched entry can appear in subsequent cache images. - * This field exists to allow the user to avoid the buildup of - * infrequently used entries in long sequences of cache images. - * - * The value of this field must lie in the range - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100). - * - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit - * is imposed on number of times a prefeteched entry can appear - * in subsequent cache images. - * - * A value of 0 prevents prefetched entries from being included - * in cache images. - * - * Positive integers restrict prefetched entries to the specified - * number of appearances. - * - * Note that the number of subsequent cache images that a prefetched - * entry has appeared in is tracked in an 8 bit field. Thus, while - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its - * current value, any value in excess of 255 will be the functional - * equivalent of H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE. - * - ****************************************************************************/ - -#define H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION 1 - -#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE -1 -#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX 100 - -typedef struct H5AC_cache_image_config_t { - int32_t version; - hbool_t generate_image; - hbool_t save_resize_status; - int32_t entry_ageout; -} H5AC_cache_image_config_t; - #ifdef __cplusplus } #endif diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 71fdfde..7b1ec4d 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -307,6 +307,15 @@ typedef struct H5B2_node_info_test_t { /* Package Private Variables */ /*****************************/ +/* H5B2 header inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_BT2_HDR[1]; + +/* H5B2 internal node inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_BT2_INT[1]; + +/* H5B2 leaf node inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_BT2_LEAF[1]; + /* Declare a free list to manage the H5B2_internal_t struct */ H5FL_EXTERN(H5B2_internal_t); diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index fb93b8a..41e0951 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -73,6 +73,9 @@ typedef struct H5B_cache_ud_t { /* Package Private Variables */ /*****************************/ +/* H5B header inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_BT[1]; + /* Declare a free list to manage the haddr_t sequence information */ H5FL_SEQ_EXTERN(haddr_t); diff --git a/src/H5C.c b/src/H5C.c index 805b4f5..4adee6d 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -46,9 +46,9 @@ * - Change protect/unprotect to lock/unlock. * * - Flush entries in increasing address order in - * H5C__make_space_in_cache(). + * H5C_make_space_in_cache(). * - * - Also in H5C__make_space_in_cache(), use high and low water marks + * - Also in H5C_make_space_in_cache(), use high and low water marks * to reduce the number of I/O calls. * * - When flushing, attempt to combine contiguous entries to reduce @@ -75,7 +75,7 @@ /****************/ #include "H5Cmodule.h" /* This source code file is part of the H5C module */ -#define H5F_FRIEND /* suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ /***********/ @@ -155,17 +155,21 @@ static void * H5C_load_entry(H5F_t * f, haddr_t addr, void * udata); +static herr_t H5C_make_space_in_cache(H5F_t * f, + hid_t dxpl_id, + size_t space_needed, + hbool_t write_permitted); + static herr_t H5C__mark_flush_dep_dirty(H5C_cache_entry_t * entry); static herr_t H5C__mark_flush_dep_clean(H5C_cache_entry_t * entry); -static herr_t H5C__serialize_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring); -static herr_t H5C__serialize_single_entry(H5F_t *f, hid_t dxpl_id, - H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr); - static herr_t H5C__verify_len_eoa(H5F_t *f, const H5C_class_t * type, haddr_t addr, size_t *len, hbool_t actual); +static herr_t H5C__generate_image(H5F_t *f, H5C_t * cache_ptr, H5C_cache_entry_t *entry_ptr, + hid_t dxpl_id); + #if H5C_DO_SLIST_SANITY_CHECKS static hbool_t H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr); @@ -239,7 +243,7 @@ H5C_t * H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, - const H5C_class_t * const * class_table_ptr, + const char * (* type_name_table_ptr), H5C_write_permitted_func_t check_write_permitted, hbool_t write_permitted, H5C_log_flush_func_t log_flush, @@ -257,21 +261,21 @@ H5C_create(size_t max_cache_size, HDassert( max_type_id >= 0 ); HDassert( max_type_id < H5C__MAX_NUM_TYPE_IDS ); - HDassert( class_table_ptr ); + HDassert( type_name_table_ptr ); for ( i = 0; i <= max_type_id; i++ ) { - HDassert( (class_table_ptr)[i] ); - HDassert(HDstrlen((class_table_ptr)[i]->name) > 0); + HDassert( (type_name_table_ptr)[i] ); + HDassert( HDstrlen(( type_name_table_ptr)[i]) > 0 ); } /* end for */ if(NULL == (cache_ptr = H5FL_CALLOC(H5C_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if(NULL == (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list") + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list.") if(NULL == (cache_ptr->tag_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list for tagged entry addresses") + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list for tagged entry addresses.") /* If we get this far, we should succeed. Go ahead and initialize all * the fields. @@ -293,7 +297,7 @@ H5C_create(size_t max_cache_size, cache_ptr->max_type_id = max_type_id; - cache_ptr->class_table_ptr = class_table_ptr; + cache_ptr->type_name_table_ptr = type_name_table_ptr; cache_ptr->max_cache_size = max_cache_size; cache_ptr->min_clean_size = min_clean_size; @@ -385,7 +389,6 @@ H5C_create(size_t max_cache_size, cache_ptr->resize_enabled = FALSE; cache_ptr->cache_full = FALSE; cache_ptr->size_decreased = FALSE; - cache_ptr->resize_in_progress = FALSE; (cache_ptr->resize_ctl).version = H5C__CURR_AUTO_SIZE_CTL_VER; (cache_ptr->resize_ctl).rpt_fcn = NULL; @@ -431,52 +434,28 @@ H5C_create(size_t max_cache_size, ((cache_ptr->epoch_markers)[i]).magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; ((cache_ptr->epoch_markers)[i]).addr = (haddr_t)i; - ((cache_ptr->epoch_markers)[i]).type = H5AC_EPOCH_MARKER; + ((cache_ptr->epoch_markers)[i]).type = &H5C__epoch_marker_class; } - /* Initialize cache image generation on file close related fields. - * Initial value of image_ctl must match H5C__DEFAULT_CACHE_IMAGE_CTL - * in H5Cprivate.h. - */ - cache_ptr->image_ctl.version = H5C__CURR_CACHE_IMAGE_CTL_VER; - cache_ptr->image_ctl.generate_image = FALSE; - cache_ptr->image_ctl.save_resize_status = FALSE; - cache_ptr->image_ctl.entry_ageout = -1; - cache_ptr->image_ctl.flags = H5C_CI__ALL_FLAGS; - - cache_ptr->serialization_in_progress= FALSE; - cache_ptr->load_image = FALSE; - cache_ptr->image_loaded = FALSE; - cache_ptr->delete_image = FALSE; - cache_ptr->image_addr = HADDR_UNDEF; - cache_ptr->image_len = 0; - cache_ptr->image_data_len = 0; - cache_ptr->entries_loaded_counter = 0; cache_ptr->entries_inserted_counter = 0; cache_ptr->entries_relocated_counter = 0; - cache_ptr->entry_fd_height_change_counter = 0; - - cache_ptr->num_entries_in_image = 0; - cache_ptr->image_entries = NULL; - cache_ptr->image_buffer = NULL; /* initialize free space manager related fields: */ cache_ptr->rdfsm_settled = FALSE; cache_ptr->mdfsm_settled = FALSE; - if(H5C_reset_cache_hit_rate_stats(cache_ptr) < 0) + if ( H5C_reset_cache_hit_rate_stats(cache_ptr) != SUCCEED ) { + /* this should be impossible... */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "H5C_reset_cache_hit_rate_stats failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, \ + "H5C_reset_cache_hit_rate_stats failed.") + } H5C_stats__reset(cache_ptr); cache_ptr->prefix[0] = '\0'; /* empty string */ -#ifndef NDEBUG - cache_ptr->get_entry_ptr_from_addr_counter = 0; -#endif /* NDEBUG */ - /* Set return value */ ret_value = cache_ptr; @@ -754,11 +733,6 @@ H5C_prep_for_file_close(H5F_t *f, hid_t dxpl_id) /* Make certain there aren't any protected entries */ HDassert(cache_ptr->pl_len == 0); - /* Prepare cache image */ - if(H5C__prep_image_for_file_close(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cache image") - - done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_prep_for_file_close() */ @@ -801,20 +775,10 @@ H5C_dest(H5F_t * f, hid_t dxpl_id) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(cache_ptr->close_warning_received); -#if H5AC_DUMP_IMAGE_STATS_ON_CLOSE - if(H5C_image_stats(cache_ptr, TRUE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't display cache image stats") -#endif /* H5AC_DUMP_IMAGE_STATS_ON_CLOSE */ - /* Flush and invalidate all cache entries */ if(H5C_flush_invalidate_cache(f, dxpl_id, H5C__NO_FLAGS_SET) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") - /* Generate & write cache image if requested */ - if(cache_ptr->image_ctl.generate_image) - if(H5C__generate_cache_image(f, dxpl_id, cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "Can't generate metadata cache image") - if(cache_ptr->slist_ptr != NULL) { H5SL_close(cache_ptr->slist_ptr); cache_ptr->slist_ptr = NULL; @@ -826,12 +790,6 @@ H5C_dest(H5F_t * f, hid_t dxpl_id) } /* end if */ #ifndef NDEBUG -#if H5C_DO_SANITY_CHECKS - if(cache_ptr->get_entry_ptr_from_addr_counter > 0) - HDfprintf(stdout, "*** %ld calls to H5C_get_entry_ptr_from_add(). ***\n", - cache_ptr->get_entry_ptr_from_addr_counter); -#endif /* H5C_DO_SANITY_CHECKS */ - cache_ptr->magic = 0; #endif /* NDEBUG */ @@ -857,12 +815,14 @@ done: herr_t H5C_evict(H5F_t * f, hid_t dxpl_id) { + H5C_t *cache_ptr = f->shared->cache; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); /* Flush and invalidate all cache entries except the pinned entries */ if(H5C_flush_invalidate_cache(f, dxpl_id, H5C__EVICT_ALLOW_LAST_PINS_FLAG) < 0 ) @@ -908,7 +868,7 @@ H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, #if H5C_DO_EXTREME_SANITY_CHECKS if(H5C_validate_lru_list(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on entry") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on entry.\n") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /* Look for entry in cache */ @@ -922,9 +882,9 @@ H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, /* Check for entry being pinned or protected */ if(entry_ptr->is_protected) - HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "Target entry is protected") + HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "Target entry is protected.") if(entry_ptr->is_pinned) - HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "Target entry is pinned") + HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "Target entry is pinned.") #ifdef H5_HAVE_PARALLEL if(entry_ptr->coll_access) { entry_ptr->coll_access = FALSE; @@ -949,7 +909,7 @@ H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, done: #if H5C_DO_EXTREME_SANITY_CHECKS if(H5C_validate_lru_list(cache_ptr) < 0) - HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on exit") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on exit.\n") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) @@ -1008,12 +968,12 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) { #if H5C_DO_SANITY_CHECKS int i; - uint32_t index_len = 0; + int32_t index_len = 0; size_t index_size = (size_t)0; size_t clean_index_size = (size_t)0; size_t dirty_index_size = (size_t)0; size_t slist_size = (size_t)0; - uint32_t slist_len = 0; + int32_t slist_len = 0; #endif /* H5C_DO_SANITY_CHECKS */ H5C_ring_t ring; H5C_t * cache_ptr; @@ -1060,7 +1020,7 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) if((H5C_validate_protected_entry_list(cache_ptr) < 0) || (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry.\n") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ ignore_protected = ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 ); @@ -1072,7 +1032,7 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) if(destroy) { if(H5C_flush_invalidate_cache(f, dxpl_id, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate failed.") } /* end if */ else { /* flush each ring, starting from the outermost ring and @@ -1080,9 +1040,9 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) */ ring = H5C_RING_USER; while(ring < H5C_RING_NTYPES) { - - /* Only call the free space manager settle routines when close - * warning has been received. + /* only call the free space manager settle routines when close + * warning has been received, and then only when the index is + * non-empty for that ring. */ if(cache_ptr->close_warning_received) { switch(ring) { @@ -1090,20 +1050,36 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) break; case H5C_RING_RDFSM: - /* Settle raw data FSM */ - if(!cache_ptr->rdfsm_settled) - if(H5MF_settle_raw_data_fsm(f, dxpl_id, &cache_ptr->rdfsm_settled) < 0) + if(!cache_ptr->rdfsm_settled) { + hbool_t fsm_settled = FALSE; /* Whether the FSM was actually settled */ + + /* Settle raw data FSM */ + if(H5MF_settle_raw_data_fsm(f, dxpl_id, &fsm_settled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "RD FSM settle failed") + + /* Only set the flag if the FSM was actually settled */ + if(fsm_settled) + cache_ptr->rdfsm_settled = TRUE; + } /* end if */ break; case H5C_RING_MDFSM: - /* Settle metadata FSM */ - if(!cache_ptr->mdfsm_settled) - if(H5MF_settle_meta_data_fsm(f, dxpl_id, &cache_ptr->mdfsm_settled) < 0) + if(!cache_ptr->mdfsm_settled) { + hbool_t fsm_settled = FALSE; /* Whether the FSM was actually settled */ + + /* Settle metadata FSM */ + if(H5MF_settle_meta_data_fsm(f, dxpl_id, &fsm_settled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "MD FSM settle failed") + + /* Only set the flag if the FSM was actually settled */ + if(fsm_settled) + cache_ptr->mdfsm_settled = TRUE; + } /* end if */ break; case H5C_RING_SBE: + break; + case H5C_RING_SB: break; @@ -1114,7 +1090,7 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) } /* end if */ if(H5C_flush_ring(f, dxpl_id, ring, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush ring failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush ring failed.") ring++; } /* end while */ } /* end else */ @@ -1155,6 +1131,7 @@ H5C_flush_to_min_clean(H5F_t * f, hid_t dxpl_id) { H5C_t * cache_ptr; + herr_t result; hbool_t write_permitted; #if 0 /* modified code -- commented out for now */ /* JRM */ int i; @@ -1176,19 +1153,36 @@ H5C_flush_to_min_clean(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - if(cache_ptr->check_write_permitted != NULL) { - if((cache_ptr->check_write_permitted)(f, &write_permitted) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't get write_permitted") - } /* end if */ - else + if ( cache_ptr->check_write_permitted != NULL ) { + + result = (cache_ptr->check_write_permitted)(f, &write_permitted); + + if ( result < 0 ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Can't get write_permitted") + } + } else { + write_permitted = cache_ptr->write_permitted; + } - if(!write_permitted) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cache write is not permitted!?!") + if ( ! write_permitted ) { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "cache write is not permitted!?!\n"); + } #if 1 /* original code */ - if(H5C__make_space_in_cache(f, dxpl_id, (size_t)0, write_permitted) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C__make_space_in_cache failed") + result = H5C_make_space_in_cache(f, + dxpl_id, + (size_t)0, + write_permitted); + + if ( result < 0 ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "H5C_make_space_in_cache failed.") + } #else /* modified code -- commented out for now */ if ( cache_ptr->max_cache_size > cache_ptr->index_size ) { @@ -1226,8 +1220,12 @@ H5C_flush_to_min_clean(H5F_t * f, */ flushed_entries_list = (haddr_t *)H5MM_malloc(sizeof(haddr_t) * (size_t)(cache_ptr->slist_len)); - if(flushed_entries_list == NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for flushed entries list") + + if ( flushed_entries_list == NULL ) { + + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \ + "memory allocation failed for flushed entries list") + } /* Scan the dirty LRU list from tail forward and mark sufficient * entries to free up the necessary space. Keep a list of the @@ -1257,8 +1255,13 @@ H5C_flush_to_min_clean(H5F_t * f, /* Flush the marked entries */ - if(H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_flush_cache failed") + result = H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, + H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG); + + if ( result < 0 ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_flush_cache failed.") + } /* Now touch up the LRU list so as to place the flushed entries in * the order they they would be in if we had flushed them in the @@ -1333,9 +1336,8 @@ H5C_insert_entry(H5F_t * f, hbool_t set_flush_marker; hbool_t write_permitted = TRUE; size_t empty_space; - H5C_cache_entry_t *entry_ptr = NULL; + H5C_cache_entry_t *entry_ptr; H5C_cache_entry_t *test_entry_ptr; - hbool_t entry_tagged = FALSE; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1348,7 +1350,6 @@ H5C_insert_entry(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( type ); - HDassert( type->mem_type == cache_ptr->class_table_ptr[type->id]->mem_type ); HDassert( type->image_len ); HDassert( H5F_addr_defined(addr) ); HDassert( thing ); @@ -1356,10 +1357,14 @@ H5C_insert_entry(H5F_t * f, #if H5C_DO_EXTREME_SANITY_CHECKS /* no need to verify that entry is not already in the index as */ /* we already make that check below. */ - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") + + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed on entry.\n"); + } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ set_flush_marker = ( (flags & H5C__SET_FLUSH_MARKER_FLAG) != 0 ); @@ -1384,9 +1389,9 @@ H5C_insert_entry(H5F_t * f, if(test_entry_ptr != NULL) { if(test_entry_ptr == entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "entry already in cache") + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "entry already in cache.") else - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "duplicate entry in cache") + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "duplicate entry in cache.") } /* end if */ entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; @@ -1453,33 +1458,16 @@ H5C_insert_entry(H5F_t * f, entry_ptr->coll_prev = NULL; #endif /* H5_HAVE_PARALLEL */ - /* initialize cache image related fields */ - entry_ptr->include_in_image = FALSE; - entry_ptr->lru_rank = 0; - entry_ptr->image_dirty = FALSE; - entry_ptr->fd_parent_count = 0; - entry_ptr->fd_parent_addrs = NULL; - entry_ptr->fd_child_count = 0; - entry_ptr->fd_dirty_child_count = 0; - entry_ptr->image_fd_height = 0; - entry_ptr->prefetched = FALSE; - entry_ptr->prefetch_type_id = 0; - entry_ptr->age = 0; -#ifndef NDEBUG /* debugging field */ - entry_ptr->serialization_count = 0; -#endif /* NDEBUG */ - /* Apply tag to newly inserted entry */ if(H5C__tag_entry(cache_ptr, entry_ptr, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Cannot tag metadata entry") - entry_tagged = TRUE; H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) if(cache_ptr->flash_size_increase_possible && (entry_ptr->size > cache_ptr->flash_size_increase_threshold)) if(H5C__flash_increase_cache_size(cache_ptr, 0, entry_ptr->size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C__flash_increase_cache_size failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C__flash_increase_cache_size failed.") if(cache_ptr->index_size >= cache_ptr->max_cache_size) empty_space = 0; @@ -1509,7 +1497,7 @@ H5C_insert_entry(H5F_t * f, /* Note that space_needed is just the amount of space that * needed to insert the new entry without exceeding the cache - * size limit. The subsequent call to H5C__make_space_in_cache() + * size limit. The subsequent call to H5C_make_space_in_cache() * may evict the entries required to free more or less space * depending on conditions. It MAY be less if the cache is * currently undersized, or more if the cache is oversized. @@ -1532,9 +1520,9 @@ H5C_insert_entry(H5F_t * f, * no point in worrying about the third. */ - if(H5C__make_space_in_cache(f, dxpl_id, space_needed, write_permitted) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C__make_space_in_cache failed") - } /* end if */ + if(H5C_make_space_in_cache(f, dxpl_id, space_needed, write_permitted) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C_make_space_in_cache failed.") + } H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL) @@ -1545,10 +1533,10 @@ H5C_insert_entry(H5F_t * f, H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, FAIL) #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed just before done") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed just before done.\n") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /* If the entry's type has a 'notify' callback send a 'after insertion' @@ -1600,16 +1588,12 @@ H5C_insert_entry(H5F_t * f, done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) - HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit.\n") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ - if(ret_value < 0 && entry_tagged) - if(H5C__untag_entry(cache_ptr, entry_ptr) < 0) - HDONE_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove entry from tag list") - FUNC_LEAVE_NOAPI(ret_value) } /* H5C_insert_entry() */ @@ -1931,7 +1915,7 @@ H5C_move_entry(H5C_t * cache_ptr, if((H5C_validate_protected_entry_list(cache_ptr) < 0) || (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry.\n") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ H5C__SEARCH_INDEX(cache_ptr, old_addr, entry_ptr, FAIL) @@ -2035,7 +2019,7 @@ done: if((H5C_validate_protected_entry_list(cache_ptr) < 0) || (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) - HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit.\n") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) @@ -2076,14 +2060,17 @@ H5C_resize_entry(void *thing, size_t new_size) /* Check for usage errors */ if(new_size <= 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "New size is non-positive") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "New size is non-positive.") if(!(entry_ptr->is_pinned || entry_ptr->is_protected)) HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "Entry isn't pinned or protected??") #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed on entry.\n"); + } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /* update for change in entry size if necessary */ @@ -2180,10 +2167,14 @@ H5C_resize_entry(void *thing, size_t new_size) } /* end if */ done: + #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0)) - HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed on exit.\n"); + } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) @@ -2279,10 +2270,13 @@ H5C_pin_protected_entry(void *thing) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed on entry.\n"); + } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2295,11 +2289,15 @@ H5C_pin_protected_entry(void *thing) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") done: + #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) - HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed on exit.\n"); + } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) @@ -2326,6 +2324,32 @@ done: * * Programmer: John Mainzer - 6/2/04 * + * JRM -- 11/13/08 + * Modified function to call H5C_make_space_in_cache() when + * the min_clean_size is violated, not just when there isn't + * enough space for and entry that has just been loaded. + * + * The purpose of this modification is to avoid "metadata + * blizzards" in the write only case. In such instances, + * the cache was allowed to fill with dirty metadata. When + * we finally needed to evict an entry to make space, we had + * to flush out a whole cache full of metadata -- which has + * interesting performance effects. We hope to avoid (or + * perhaps more accurately hide) this effect by maintaining + * the min_clean_size, which should force us to start flushing + * entries long before we actually have to evict something + * to make space. + * + * JRM -- 9/1/14 + * Replace the old rw parameter with the flags parameter. + * This allows H5C_protect to accept flags other than + * H5C__READ_ONLY_FLAG. + * + * Added support for the H5C__FLUSH_LAST_FLAG. + * At present, this flag is only applied if the entry is + * not in cache, and is loaded into the cache as a result of + * this call. + * *------------------------------------------------------------------------- */ void * @@ -2364,22 +2388,16 @@ H5C_protect(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( type ); - HDassert( type->mem_type == cache_ptr->class_table_ptr[type->id]->mem_type ); HDassert( H5F_addr_defined(addr) ); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on entry") -#endif /* H5C_DO_EXTREME_SANITY_CHECKS */ + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { - /* Load the cache image, if requested */ - if(cache_ptr->load_image) { - cache_ptr->load_image = FALSE; - if(H5C__load_cache_image(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "Can't load cache image") - } /* end if */ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on entry.\n") + } +#endif /* H5C_DO_EXTREME_SANITY_CHECKS */ read_only = ( (flags & H5C__READ_ONLY_FLAG) != 0 ); flush_last = ( (flags & H5C__FLUSH_LAST_FLAG) != 0 ); @@ -2410,24 +2428,9 @@ H5C_protect(H5F_t * f, /* first check to see if the target is in cache */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, NULL) - if(entry_ptr != NULL) { + if ( entry_ptr != NULL ) { if(entry_ptr->ring != ring) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "ring type mismatch occured for cache entry") - - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - - if(entry_ptr->prefetched) { - /* This call removes the prefetched entry from the cache, - * and replaces it with an entry deserialized from the - * image of the prefetched entry. - */ - if(H5C__deserialize_prefetched_entry(f, dxpl_id, cache_ptr, &entry_ptr, type, addr, udata) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "can't deserialize prefetched entry") - - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(!entry_ptr->prefetched); - HDassert(entry_ptr->addr == addr); - } /* end if */ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "ring type mismatch occured for cache entry\n") /* Check for trying to load the wrong type of entry from an address */ if(entry_ptr->type != type) @@ -2520,8 +2523,6 @@ H5C_protect(H5F_t * f, HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "can't load entry") entry_ptr = (H5C_cache_entry_t *)thing; - cache_ptr->entries_loaded_counter++; - entry_ptr->ring = ring; #ifdef H5_HAVE_PARALLEL if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI) && entry_ptr->coll_access) @@ -2539,7 +2540,7 @@ H5C_protect(H5F_t * f, ( entry_ptr->size > cache_ptr->flash_size_increase_threshold ) ) { if(H5C__flash_increase_cache_size(cache_ptr, 0, entry_ptr->size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__flash_increase_cache_size failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__flash_increase_cache_size failed.") } if(cache_ptr->index_size >= cache_ptr->max_cache_size) @@ -2548,7 +2549,7 @@ H5C_protect(H5F_t * f, empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; /* try to free up if necceary and if evictions are permitted. Note - * that if evictions are enabled, we will call H5C__make_space_in_cache() + * that if evictions are enabled, we will call H5C_make_space_in_cache() * regardless if the min_free_space requirement is not met. */ if ( ( cache_ptr->evictions_enabled ) && @@ -2583,7 +2584,7 @@ H5C_protect(H5F_t * f, /* Note that space_needed is just the amount of space that * needed to insert the new entry without exceeding the cache - * size limit. The subsequent call to H5C__make_space_in_cache() + * size limit. The subsequent call to H5C_make_space_in_cache() * may evict the entries required to free more or less space * depending on conditions. It MAY be less if the cache is * currently undersized, or more if the cache is oversized. @@ -2610,9 +2611,9 @@ H5C_protect(H5F_t * f, * see no point in worrying about the fourth. */ - if(H5C__make_space_in_cache(f, dxpl_id, space_needed, write_permitted) < 0 ) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__make_space_in_cache failed") - } /* end if */ + if(H5C_make_space_in_cache(f, dxpl_id, space_needed, write_permitted) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_make_space_in_cache failed 1.") + } /* Insert the entry in the hash table. It can't be dirty yet, so * we don't even check to see if it should go in the skip list. @@ -2647,34 +2648,44 @@ H5C_protect(H5F_t * f, */ H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, NULL) + /* Update entries loaded in cache counter */ + cache_ptr->entries_loaded_counter++; + /* Record that the entry was loaded, to trigger a notify callback later */ /* (After the entry is fully added to the cache) */ was_loaded = TRUE; - } /* end else */ + } - HDassert(entry_ptr->addr == addr); - HDassert(entry_ptr->type == type); + HDassert( entry_ptr->addr == addr ); + HDassert( entry_ptr->type == type ); + + if ( entry_ptr->is_protected ) { + + if ( ( read_only ) && ( entry_ptr->is_read_only ) ) { + + HDassert( entry_ptr->ro_ref_count > 0 ); - if(entry_ptr->is_protected) { - if(read_only && entry_ptr->is_read_only) { - HDassert(entry_ptr->ro_ref_count > 0); (entry_ptr->ro_ref_count)++; - } /* end if */ - else - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Target already protected & not read only?!?") - } /* end if */ - else { + + } else { + + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, \ + "Target already protected & not read only?!?.") + } + } else { + H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, NULL) entry_ptr->is_protected = TRUE; if ( read_only ) { + entry_ptr->is_read_only = TRUE; entry_ptr->ro_ref_count = 1; - } /* end if */ + } entry_ptr->dirtied = FALSE; - } /* end else */ + } H5C__UPDATE_CACHE_HIT_RATE_STATS(cache_ptr, hit) @@ -2692,7 +2703,7 @@ H5C_protect(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { if((cache_ptr->check_write_permitted)(f, &write_permitted) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Can't get write_permitted") + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Can't get write_permitted 2") else have_write_permitted = TRUE; } else { @@ -2704,14 +2715,16 @@ H5C_protect(H5F_t * f, } } - if(cache_ptr->resize_enabled && - (cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length)) { + if ( ( cache_ptr->resize_enabled ) && + ( cache_ptr->cache_accesses >= + (cache_ptr->resize_ctl).epoch_length ) ) { if(H5C__auto_adjust_cache_size(f, dxpl_id, write_permitted) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Cache auto-resize failed") - } /* end if */ + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Cache auto-resize failed.") + } + + if ( cache_ptr->size_decreased ) { - if(cache_ptr->size_decreased) { cache_ptr->size_decreased = FALSE; /* check to see if the cache is now oversized due to the cache @@ -2719,7 +2732,7 @@ H5C_protect(H5F_t * f, * bring the cache size down to the current maximum cache size. * * Also, if the min_clean_size requirement is not met, we - * should also call H5C__make_space_in_cache() to bring us + * should also call H5C_make_space_in_cache() to bring us * into complience. */ @@ -2736,10 +2749,10 @@ H5C_protect(H5F_t * f, if(cache_ptr->index_size > cache_ptr->max_cache_size) cache_ptr->cache_full = TRUE; - if(H5C__make_space_in_cache(f, dxpl_id, (size_t)0, write_permitted) < 0 ) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__make_space_in_cache failed") + if(H5C_make_space_in_cache(f, dxpl_id, (size_t)0, write_permitted) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_make_space_in_cache failed 2.") } - } /* end if */ + } } /* If we loaded the entry and the entry's type has a 'notify' callback, send @@ -2776,10 +2789,10 @@ H5C_protect(H5F_t * f, done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) - HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on exit") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on exit.\n") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) @@ -2806,7 +2819,7 @@ H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr) FUNC_ENTER_NOAPI(FAIL) if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad cache_ptr on entry") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad cache_ptr on entry.") cache_ptr->cache_hits = 0; cache_ptr->cache_accesses = 0; @@ -2846,27 +2859,27 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, FUNC_ENTER_NOAPI(FAIL) if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad cache_ptr on entry") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad cache_ptr on entry.") if(config_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "NULL config_ptr on entry") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "NULL config_ptr on entry.") if(config_ptr->version != H5C__CURR_AUTO_SIZE_CTL_VER) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "unknown config version") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "unknown config version.") /* check general configuration section of the config: */ if(H5C_validate_resize_config(config_ptr, H5C_RESIZE_CFG__VALIDATE_GENERAL) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in general configuration fields of new config") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in general configuration fields of new config.") /* check size increase control fields of the config: */ if(H5C_validate_resize_config(config_ptr, H5C_RESIZE_CFG__VALIDATE_INCREMENT) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in the size increase control fields of new config") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in the size increase control fields of new config.") /* check size decrease control fields of the config: */ if(H5C_validate_resize_config(config_ptr, H5C_RESIZE_CFG__VALIDATE_DECREMENT) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in the size decrease control fields of new config") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "error in the size decrease control fields of new config.") /* check for conflicts between size increase and size decrease controls: */ if(H5C_validate_resize_config(config_ptr, H5C_RESIZE_CFG__VALIDATE_INTERACTIONS) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "conflicting threshold fields in new config") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "conflicting threshold fields in new config.") /* will set the increase possible fields to FALSE later if needed */ cache_ptr->size_increase_possible = TRUE; @@ -2886,7 +2899,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, break; default: /* should be unreachable */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown incr_mode?!?!?") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown incr_mode?!?!?.") } /* end switch */ /* logically, this is were configuration for flash cache size increases @@ -2920,7 +2933,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, break; default: /* should be unreachable */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown decr_mode?!?!?") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown decr_mode?!?!?.") } /* end switch */ if(config_ptr->max_size == config_ptr->min_size) { @@ -2976,18 +2989,18 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, if(H5C_reset_cache_hit_rate_stats(cache_ptr) < 0) /* this should be impossible... */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats failed.") /* remove excess epoch markers if any */ if((config_ptr->decr_mode == H5C_decr__age_out_with_threshold) || (config_ptr->decr_mode == H5C_decr__age_out)) { if(cache_ptr->epoch_markers_active > cache_ptr->resize_ctl.epochs_before_eviction) if(H5C__autoadjust__ageout__remove_excess_markers(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't remove excess epoch markers") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't remove excess epoch markers.") } /* end if */ else if(cache_ptr->epoch_markers_active > 0) { if(H5C__autoadjust__ageout__remove_all_markers(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error removing all epoch markers") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error removing all epoch markers.") } /* configure flash size increase facility. We wait until the @@ -3011,7 +3024,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, break; default: /* should be unreachable */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown flash_incr_mode?!?!?") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown flash_incr_mode?!?!?.") break; } /* end switch */ } /* end if */ @@ -3042,7 +3055,7 @@ H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled) FUNC_ENTER_NOAPI(FAIL) if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry.") /* There is no fundamental reason why we should not permit * evictions to be disabled while automatic resize is enabled. @@ -3053,7 +3066,7 @@ H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled) if((evictions_enabled != TRUE) && ((cache_ptr->resize_ctl.incr_mode != H5C_incr__off) || (cache_ptr->resize_ctl.decr_mode != H5C_decr__off))) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't disable evictions when auto resize enabled") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't disable evictions when auto resize enabled.") cache_ptr->evictions_enabled = evictions_enabled; @@ -3148,10 +3161,13 @@ H5C_unpin_entry(void *_entry_ptr) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed on entry.\n"); + } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -3160,14 +3176,19 @@ H5C_unpin_entry(void *_entry_ptr) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry from client") done: + #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) - HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed on exit.\n"); + } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) + } /* H5C_unpin_entry() */ @@ -3254,10 +3275,13 @@ H5C_unprotect(H5F_t * f, was_clean = ! ( entry_ptr->is_dirty ); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed on entry.\n"); + } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /* if the entry has multiple read only protects, just decrement @@ -3414,9 +3438,9 @@ H5C_unprotect(H5F_t * f, /* verify that the target entry is in the cache. */ H5C__SEARCH_INDEX(cache_ptr, addr, test_entry_ptr, FAIL) if(test_entry_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "entry not in hash table?!?") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "entry not in hash table?!?.") else if(test_entry_ptr != entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?.") /* Set the 'free file space' flag for the flush, if needed */ if(free_file_space) @@ -3439,9 +3463,9 @@ H5C_unprotect(H5F_t * f, /* verify that the target entry is in the cache. */ H5C__SEARCH_INDEX(cache_ptr, addr, test_entry_ptr, FAIL) if(test_entry_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "entry not in hash table?!?") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "entry not in hash table?!?.") else if(test_entry_ptr != entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?") + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?.") if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't clear entry") @@ -3452,14 +3476,19 @@ H5C_unprotect(H5F_t * f, H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) done: + #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) { - HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed on exit.\n"); + } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) + } /* H5C_unprotect() */ @@ -3467,20 +3496,23 @@ done: * * Function: H5C_unsettle_entry_ring * - * Purpose: Advise the metadata cache that the specified entry's free space - * manager ring is no longer settled (if it was on entry). + * Purpose: Advise the metadata cache that the specified entry's metadata + * cache manager ring is no longer settled (if it was on entry). * - * If the target free space manager ring is already + * If the target metadata cache manager ring is already * unsettled, do nothing, and return SUCCEED. * - * If the target free space manager ring is settled, and + * If the target metadata cache manager ring is settled, and * we are not in the process of a file shutdown, mark * the ring as unsettled, and return SUCCEED. * - * If the target free space manager is settled, and we + * If the target metadata cache manager is settled, and we * are in the process of a file shutdown, post an error * message, and return FAIL. * + * Note that this function simply passes the call on to + * the metadata cache proper, and returns the result. + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -3560,13 +3592,18 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, FUNC_ENTER_NOAPI(FAIL) - if(config_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "NULL config_ptr on entry") + if ( config_ptr == NULL ) { - if(config_ptr->version != H5C__CURR_AUTO_SIZE_CTL_VER) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown config version") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "NULL config_ptr on entry.") + } + + if ( config_ptr->version != H5C__CURR_AUTO_SIZE_CTL_VER ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown config version.") + } - if((tests & H5C_RESIZE_CFG__VALIDATE_GENERAL) != 0) { + + if ( (tests & H5C_RESIZE_CFG__VALIDATE_GENERAL) != 0 ) { if(config_ptr->max_size > H5C__MAX_MAX_CACHE_SIZE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "max_size too big") @@ -3577,29 +3614,43 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, if(config_ptr->min_size > config_ptr->max_size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "min_size > max_size") - if(config_ptr->set_initial_size && - ((config_ptr->initial_size < config_ptr->min_size) || - (config_ptr->initial_size > config_ptr->max_size))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "initial_size must be in the interval [min_size, max_size]") + if ( ( config_ptr->set_initial_size ) && + ( ( config_ptr->initial_size < config_ptr->min_size ) || + ( config_ptr->initial_size > config_ptr->max_size ) ) ) { + + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ + "initial_size must be in the interval [min_size, max_size]"); + } + + if ( ( config_ptr->min_clean_fraction < (double)0.0f ) || + ( config_ptr->min_clean_fraction > (double)1.0f ) ) { - if((config_ptr->min_clean_fraction < (double)0.0f) || - (config_ptr->min_clean_fraction > (double)1.0f)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "min_clean_fraction must be in the interval [0.0, 1.0]") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ + "min_clean_fraction must be in the interval [0.0, 1.0]"); + } + + if ( config_ptr->epoch_length < H5C__MIN_AR_EPOCH_LENGTH ) { - if(config_ptr->epoch_length < H5C__MIN_AR_EPOCH_LENGTH) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epoch_length too small") + } + + if ( config_ptr->epoch_length > H5C__MAX_AR_EPOCH_LENGTH ) { - if(config_ptr->epoch_length > H5C__MAX_AR_EPOCH_LENGTH) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epoch_length too big") + } } /* H5C_RESIZE_CFG__VALIDATE_GENERAL */ - if((tests & H5C_RESIZE_CFG__VALIDATE_INCREMENT) != 0) { - if((config_ptr->incr_mode != H5C_incr__off) && - (config_ptr->incr_mode != H5C_incr__threshold)) + if ( (tests & H5C_RESIZE_CFG__VALIDATE_INCREMENT) != 0 ) { + + if ( ( config_ptr->incr_mode != H5C_incr__off ) && + ( config_ptr->incr_mode != H5C_incr__threshold ) ) { + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid incr_mode") + } + + if ( config_ptr->incr_mode == H5C_incr__threshold ) { - if(config_ptr->incr_mode == H5C_incr__threshold) { if((config_ptr->lower_hr_threshold < (double)0.0f) || (config_ptr->lower_hr_threshold > (double)1.0f)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "lower_hr_threshold must be in the range [0.0, 1.0]") @@ -3612,24 +3663,33 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, */ } /* H5C_incr__threshold */ - switch(config_ptr->flash_incr_mode) { + switch ( config_ptr->flash_incr_mode ) + { case H5C_flash_incr__off: /* nothing to do here */ break; case H5C_flash_incr__add_space: - if((config_ptr->flash_multiple < (double)0.1f) || - (config_ptr->flash_multiple > (double)10.0f)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "flash_multiple must be in the range [0.1, 10.0]") - if((config_ptr->flash_threshold < (double)0.1f) || - (config_ptr->flash_threshold > (double)1.0f)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "flash_threshold must be in the range [0.1, 1.0]") + if ( ( config_ptr->flash_multiple < (double)0.1f ) || + ( config_ptr->flash_multiple > (double)10.0f ) ) { + + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ + "flash_multiple must be in the range [0.1, 10.0]"); + } + + if ( ( config_ptr->flash_threshold < (double)0.1f ) || + ( config_ptr->flash_threshold > (double)1.0f ) ) { + + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ + "flash_threshold must be in the range [0.1, 1.0]"); + } break; default: - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid flash_incr_mode") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ + "Invalid flash_incr_mode"); break; - } /* end switch */ + } } /* H5C_RESIZE_CFG__VALIDATE_INCREMENT */ @@ -3645,23 +3705,35 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, } if ( config_ptr->decr_mode == H5C_decr__threshold ) { - if(config_ptr->upper_hr_threshold > (double)1.0f) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "upper_hr_threshold must be <= 1.0") - if((config_ptr->decrement > (double)1.0f) || - (config_ptr->decrement < (double)0.0f)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "decrement must be in the interval [0.0, 1.0]") + if ( config_ptr->upper_hr_threshold > (double)1.0f ) { + + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ + "upper_hr_threshold must be <= 1.0"); + } + + if ( ( config_ptr->decrement > (double)1.0f ) || + ( config_ptr->decrement < (double)0.0f ) ) { + + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ + "decrement must be in the interval [0.0, 1.0]"); + } /* no need to check max_decrement as it is a size_t * and thus must be non-negative. */ } /* H5C_decr__threshold */ - if((config_ptr->decr_mode == H5C_decr__age_out) || - (config_ptr->decr_mode == H5C_decr__age_out_with_threshold)) { + if ( ( config_ptr->decr_mode == H5C_decr__age_out ) || + ( config_ptr->decr_mode == H5C_decr__age_out_with_threshold ) + ) { + + if ( config_ptr->epochs_before_eviction < 1 ) { + + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ + "epochs_before_eviction must be positive"); + } - if(config_ptr->epochs_before_eviction < 1) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epochs_before_eviction must be positive") if(config_ptr->epochs_before_eviction > H5C__MAX_EPOCH_MARKERS) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epochs_before_eviction too big") @@ -3675,24 +3747,43 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, */ } /* H5C_decr__age_out || H5C_decr__age_out_with_threshold */ - if(config_ptr->decr_mode == H5C_decr__age_out_with_threshold) { - if((config_ptr->upper_hr_threshold > (double)1.0f) || - (config_ptr->upper_hr_threshold < (double)0.0f)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "upper_hr_threshold must be in the interval [0.0, 1.0]") + if ( config_ptr->decr_mode == H5C_decr__age_out_with_threshold ) { + + if ( ( config_ptr->upper_hr_threshold > (double)1.0f ) || + ( config_ptr->upper_hr_threshold < (double)0.0f ) ) { + + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ + "upper_hr_threshold must be in the interval [0.0, 1.0]"); + } } /* H5C_decr__age_out_with_threshold */ + } /* H5C_RESIZE_CFG__VALIDATE_DECREMENT */ if ( (tests & H5C_RESIZE_CFG__VALIDATE_INTERACTIONS) != 0 ) { - if((config_ptr->incr_mode == H5C_incr__threshold) - && ((config_ptr->decr_mode == H5C_decr__threshold) || - (config_ptr->decr_mode == H5C_decr__age_out_with_threshold)) - && (config_ptr->lower_hr_threshold >= config_ptr->upper_hr_threshold)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "conflicting threshold fields in config") + + if ( ( config_ptr->incr_mode == H5C_incr__threshold ) + && + ( ( config_ptr->decr_mode == H5C_decr__threshold ) + || + ( config_ptr->decr_mode == H5C_decr__age_out_with_threshold ) + ) + && + ( config_ptr->lower_hr_threshold + >= + config_ptr->upper_hr_threshold + ) + ) { + + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ + "conflicting threshold fields in config.") + } } /* H5C_RESIZE_CFG__VALIDATE_INTERACTIONS */ done: + FUNC_LEAVE_NOAPI(ret_value) + } /* H5C_validate_resize_config() */ @@ -3788,7 +3879,6 @@ H5C_create_flush_dependency(void * parent_thing, void * child_thing) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for flush dependency parent list") child_entry->flush_dep_parent_nalloc *= 2; } /* end else */ - cache_ptr->entry_fd_height_change_counter++; } /* end if */ /* Add the dependency to the child's parent array */ @@ -3996,7 +4086,7 @@ H5C__auto_adjust_cache_size(H5F_t * f, hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; - hbool_t reentrant_call = FALSE; + herr_t result; hbool_t inserted_epoch_marker = FALSE; size_t new_max_cache_size = 0; size_t old_max_cache_size = 0; @@ -4016,33 +4106,29 @@ H5C__auto_adjust_cache_size(H5F_t * f, HDassert( (double)0.0f <= (cache_ptr->resize_ctl).min_clean_fraction ); HDassert( (cache_ptr->resize_ctl).min_clean_fraction <= (double)100.0f ); - /* check to see if cache_ptr->resize_in_progress is TRUE. If it, this - * is a re-entrant call via a client callback called in the resize - * process. To avoid an infinite recursion, set reentrant_call to - * TRUE, and goto done. - */ - if(cache_ptr->resize_in_progress) { - reentrant_call = TRUE; - HGOTO_DONE(SUCCEED) - } /* end if */ + if ( !cache_ptr->resize_enabled ) { - cache_ptr->resize_in_progress = TRUE; + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Auto cache resize disabled.") + } - if(!cache_ptr->resize_enabled) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Auto cache resize disabled") + HDassert( ( (cache_ptr->resize_ctl).incr_mode != H5C_incr__off ) || \ + ( (cache_ptr->resize_ctl).decr_mode != H5C_decr__off ) ); - HDassert(((cache_ptr->resize_ctl).incr_mode != H5C_incr__off) || \ - ((cache_ptr->resize_ctl).decr_mode != H5C_decr__off)); + if ( H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED ) { - if(H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate.") + } HDassert( ( (double)0.0f <= hit_rate ) && ( hit_rate <= (double)1.0f ) ); - switch((cache_ptr->resize_ctl).incr_mode) { + switch ( (cache_ptr->resize_ctl).incr_mode ) + { case H5C_incr__off: - if(cache_ptr->size_increase_possible) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "size_increase_possible but H5C_incr__off?!?!?") + if ( cache_ptr->size_increase_possible ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "size_increase_possible but H5C_incr__off?!?!?") + } break; case H5C_incr__threshold: @@ -4092,7 +4178,7 @@ H5C__auto_adjust_cache_size(H5F_t * f, break; default: - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unknown incr_mode") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unknown incr_mode.") } /* If the decr_mode is either age out or age out with threshold, we @@ -4119,10 +4205,17 @@ H5C__auto_adjust_cache_size(H5F_t * f, ) ) { - if(H5C__autoadjust__ageout__insert_new_marker(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't insert new epoch marker") + result = H5C__autoadjust__ageout__insert_new_marker(cache_ptr); + + if ( result != SUCCEED ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "can't insert new epoch marker.") + + } else { - inserted_epoch_marker = TRUE; + inserted_epoch_marker = TRUE; + } } /* don't run the cache size decrease code unless the cache size @@ -4182,18 +4275,32 @@ H5C__auto_adjust_cache_size(H5F_t * f, case H5C_decr__age_out_with_threshold: case H5C_decr__age_out: - if(!inserted_epoch_marker) { - if(!cache_ptr->size_decrease_possible) + if ( ! inserted_epoch_marker ) { + + if ( ! cache_ptr->size_decrease_possible ) { + status = decrease_disabled; - else { - if(H5C__autoadjust__ageout(f, dxpl_id, hit_rate, &status, &new_max_cache_size, write_permitted) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ageout code failed") - } /* end else */ - } /* end if */ + + } else { + + result = H5C__autoadjust__ageout(f, + dxpl_id, + hit_rate, + &status, + &new_max_cache_size, + write_permitted); + + if ( result != SUCCEED ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "ageout code failed.") + } + } + } break; default: - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unknown incr_mode") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unknown incr_mode.") } } @@ -4209,8 +4316,13 @@ H5C__auto_adjust_cache_size(H5F_t * f, ) { /* move last epoch marker to the head of the LRU list */ - if(H5C__autoadjust__ageout__cycle_epoch_marker(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error cycling epoch marker") + result = H5C__autoadjust__ageout__cycle_epoch_marker(cache_ptr); + + if ( result != SUCCEED ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "error cycling epoch marker.") + } } if ( ( status == increase ) || ( status == decrease ) ) { @@ -4251,7 +4363,9 @@ H5C__auto_adjust_cache_size(H5F_t * f, switch ( (cache_ptr->resize_ctl).flash_incr_mode ) { case H5C_flash_incr__off: - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flash_size_increase_possible but H5C_flash_incr__off?!") + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "flash_size_increase_possible but H5C_flash_incr__off?!") break; case H5C_flash_incr__add_space: @@ -4262,13 +4376,15 @@ H5C__auto_adjust_cache_size(H5F_t * f, break; default: /* should be unreachable */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown flash_incr_mode?!?!?") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Unknown flash_incr_mode?!?!?.") break; } } } if ( (cache_ptr->resize_ctl).rpt_fcn != NULL ) { + (*((cache_ptr->resize_ctl).rpt_fcn)) (cache_ptr, H5C__CURR_AUTO_RESIZE_RPT_FCN_VER, @@ -4280,17 +4396,14 @@ H5C__auto_adjust_cache_size(H5F_t * f, new_min_clean_size); } - if(H5C_reset_cache_hit_rate_stats(cache_ptr) < 0) + if ( H5C_reset_cache_hit_rate_stats(cache_ptr) != SUCCEED ) { + /* this should be impossible... */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "H5C_reset_cache_hit_rate_stats failed.") + } done: - /* Sanity checks */ - HDassert(cache_ptr->resize_in_progress); - if(!reentrant_call) - cache_ptr->resize_in_progress = FALSE; - HDassert((!reentrant_call) || (cache_ptr->resize_in_progress)); - FUNC_LEAVE_NOAPI(ret_value) } /* H5C__auto_adjust_cache_size() */ @@ -4323,6 +4436,7 @@ H5C__autoadjust__ageout(H5F_t * f, hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; + herr_t result; size_t test_size; herr_t ret_value = SUCCEED; /* Return value */ @@ -4335,9 +4449,17 @@ H5C__autoadjust__ageout(H5F_t * f, HDassert( ( new_max_cache_size_ptr ) && ( *new_max_cache_size_ptr == 0 ) ); /* remove excess epoch markers if any */ - if(cache_ptr->epoch_markers_active > (cache_ptr->resize_ctl).epochs_before_eviction) - if(H5C__autoadjust__ageout__remove_excess_markers(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't remove excess epoch markers") + if ( cache_ptr->epoch_markers_active > + (cache_ptr->resize_ctl).epochs_before_eviction ) { + + result = H5C__autoadjust__ageout__remove_excess_markers(cache_ptr); + + if ( result != SUCCEED ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "can't remove excess epoch markers.") + } + } if ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) || @@ -4353,7 +4475,7 @@ H5C__autoadjust__ageout(H5F_t * f, /* evict aged out cache entries if appropriate... */ if(H5C__autoadjust__ageout__evict_aged_out_entries(f, dxpl_id, write_permitted) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error flushing aged out entries") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error flushing aged out entries.") /* ... and then reduce cache size if appropriate */ if ( cache_ptr->index_size < cache_ptr->max_cache_size ) { @@ -4435,8 +4557,11 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - if(cache_ptr->epoch_markers_active <= 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "No active epoch markers on entry?!?!?") + if ( cache_ptr->epoch_markers_active <= 0 ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "No active epoch markers on entry?!?!?.") + } /* remove the last marker from both the ring buffer and the LRU list */ @@ -4448,10 +4573,15 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) cache_ptr->epoch_marker_ringbuf_size -= 1; - if(cache_ptr->epoch_marker_ringbuf_size < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow") - if((cache_ptr->epoch_marker_active)[i] != TRUE) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?") + if ( cache_ptr->epoch_marker_ringbuf_size < 0 ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow.") + } + + if ( (cache_ptr->epoch_marker_active)[i] != TRUE ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?") + } H5C__DLL_REMOVE((&((cache_ptr->epoch_markers)[i])), \ (cache_ptr)->LRU_head_ptr, \ @@ -4464,9 +4594,9 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) * the ring buffer. */ - HDassert(((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i); - HDassert(((cache_ptr->epoch_markers)[i]).next == NULL); - HDassert(((cache_ptr->epoch_markers)[i]).prev == NULL); + HDassert( ((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i ); + HDassert( ((cache_ptr->epoch_markers)[i]).next == NULL ); + HDassert( ((cache_ptr->epoch_markers)[i]).prev == NULL ); cache_ptr->epoch_marker_ringbuf_last = (cache_ptr->epoch_marker_ringbuf_last + 1) % @@ -4476,8 +4606,10 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) cache_ptr->epoch_marker_ringbuf_size += 1; - if(cache_ptr->epoch_marker_ringbuf_size > H5C__MAX_EPOCH_MARKERS) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer overflow") + if ( cache_ptr->epoch_marker_ringbuf_size > H5C__MAX_EPOCH_MARKERS ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer overflow.") + } H5C__DLL_PREPEND((&((cache_ptr->epoch_markers)[i])), \ (cache_ptr)->LRU_head_ptr, \ @@ -4539,6 +4671,19 @@ done: * * Programmer: John Mainzer, 11/22/04 * + * Changes: Modified function to detect deletions of entries + * during a scan of the LRU, and where appropriate, + * restart the scan to avoid proceeding with a next + * entry that is no longer in the cache. + * + * Note the absence of checks after flushes of clean + * entries. As a second entry can only be removed by + * by a call to the pre_serialize or serialize callback + * of the first, and as these callbacks will not be called + * on clean entries, no checks are needed. + * + * JRM -- 4/6/15 + * *------------------------------------------------------------------------- */ static herr_t @@ -4630,26 +4775,39 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") } - if(prev_ptr != NULL) { + if ( prev_ptr != NULL ) { + if(corked) /* dirty corked entry is skipped */ entry_ptr = prev_ptr; - else if(restart_scan || (prev_ptr->is_dirty != prev_is_dirty) - || (prev_ptr->next != next_ptr) - || (prev_ptr->is_protected) - || (prev_ptr->is_pinned)) { - /* Something has happened to the LRU -- start over + + else if ( ( restart_scan ) + || + ( prev_ptr->is_dirty != prev_is_dirty ) + || + ( prev_ptr->next != next_ptr ) + || + ( prev_ptr->is_protected ) + || + ( prev_ptr->is_pinned ) ) { + + /* something has happened to the LRU -- start over * from the tail. */ restart_scan = FALSE; entry_ptr = cache_ptr->LRU_tail_ptr; H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) - } /* end else-if */ - else + + } else { + entry_ptr = prev_ptr; - } /* end if */ - else + + } + } else { + entry_ptr = NULL; + + } } /* end while */ /* for now at least, don't bother to maintain the minimum clean size, @@ -4667,9 +4825,9 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, * entry). */ - } /* end if */ - else /* ! write_permitted */ { - /* Since we are not allowed to write, all we can do is evict + } else /* ! write_permitted */ { + + /* since we are not allowed to write, all we can do is evict * any clean entries that we may encounter before we either * hit the eviction size limit, or encounter the epoch marker. * @@ -4682,19 +4840,23 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, * performance implications, but it shouldn't cause any net * slowdown. */ - HDassert(H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS); + + HDassert( H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS ); + entry_ptr = cache_ptr->LRU_tail_ptr; - while(entry_ptr != NULL && - ((entry_ptr->type)->id != H5AC_EPOCH_MARKER_ID) && - (bytes_evicted < eviction_size_limit)) { - HDassert(!(entry_ptr->is_protected)); + + while ( ( entry_ptr != NULL ) && + ( (entry_ptr->type)->id != H5AC_EPOCH_MARKER_ID ) && + ( bytes_evicted < eviction_size_limit ) ) + { + HDassert( ! (entry_ptr->is_protected) ); prev_ptr = entry_ptr->prev; - if(!(entry_ptr->is_dirty)) { + if ( ! (entry_ptr->is_dirty) ) { if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush clean entry") - } /* end if */ + } /* just skip the entry if it is dirty, as we can't do * anything with it now since we can't write. * @@ -4702,15 +4864,21 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, * and thus we needn't test to see if the LRU has been changed * out from under us. */ + entry_ptr = prev_ptr; + } /* end while */ - } /* end else */ + } + + if ( cache_ptr->index_size < cache_ptr->max_cache_size ) { - if(cache_ptr->index_size < cache_ptr->max_cache_size) cache_ptr->cache_full = FALSE; + } done: + FUNC_LEAVE_NOAPI(ret_value) + } /* H5C__autoadjust__ageout__evict_aged_out_entries() */ @@ -4739,16 +4907,23 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - if(cache_ptr->epoch_markers_active >= (cache_ptr->resize_ctl).epochs_before_eviction) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Already have a full complement of markers") + if ( cache_ptr->epoch_markers_active >= + (cache_ptr->resize_ctl).epochs_before_eviction ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Already have a full complement of markers.") + } /* find an unused marker */ i = 0; - while((cache_ptr->epoch_marker_active)[i] && i < H5C__MAX_EPOCH_MARKERS) + while ( ( (cache_ptr->epoch_marker_active)[i] ) && + ( i < H5C__MAX_EPOCH_MARKERS ) ) + { i++; + } if(i >= H5C__MAX_EPOCH_MARKERS) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't find unused marker") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't find unused marker.") HDassert( ((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i ); HDassert( ((cache_ptr->epoch_markers)[i]).next == NULL ); @@ -4766,7 +4941,7 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) if ( cache_ptr->epoch_marker_ringbuf_size > H5C__MAX_EPOCH_MARKERS ) { - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer overflow") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer overflow.") } H5C__DLL_PREPEND((&((cache_ptr->epoch_markers)[i])), \ @@ -4825,11 +5000,15 @@ H5C__autoadjust__ageout__remove_all_markers(H5C_t * cache_ptr) cache_ptr->epoch_marker_ringbuf_size -= 1; - if(cache_ptr->epoch_marker_ringbuf_size < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow") + if ( cache_ptr->epoch_marker_ringbuf_size < 0 ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow.") + } + + if ( (cache_ptr->epoch_marker_active)[i] != TRUE ) { - if((cache_ptr->epoch_marker_active)[i] != TRUE) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?") + } /* remove the epoch marker from the LRU list */ H5C__DLL_REMOVE((&((cache_ptr->epoch_markers)[i])), \ @@ -4887,10 +5066,15 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr) HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - if(cache_ptr->epoch_markers_active <= (cache_ptr->resize_ctl).epochs_before_eviction) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "no excess markers on entry") + if ( cache_ptr->epoch_markers_active <= + (cache_ptr->resize_ctl).epochs_before_eviction ) { - while(cache_ptr->epoch_markers_active > (cache_ptr->resize_ctl).epochs_before_eviction) { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "no excess markers on entry.") + } + + while ( cache_ptr->epoch_markers_active > + (cache_ptr->resize_ctl).epochs_before_eviction ) + { /* get the index of the last epoch marker in the LRU list * and remove it from the ring buffer. */ @@ -4904,10 +5088,15 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr) cache_ptr->epoch_marker_ringbuf_size -= 1; - if(cache_ptr->epoch_marker_ringbuf_size < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow") - if((cache_ptr->epoch_marker_active)[i] != TRUE) + if ( cache_ptr->epoch_marker_ringbuf_size < 0 ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow.") + } + + if ( (cache_ptr->epoch_marker_active)[i] != TRUE ) { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?") + } /* remove the epoch marker from the LRU list */ H5C__DLL_REMOVE((&((cache_ptr->epoch_markers)[i])), \ @@ -4976,8 +5165,11 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, HDassert( new_entry_size > cache_ptr->flash_size_increase_threshold ); HDassert( old_entry_size < new_entry_size ); - if(old_entry_size >= new_entry_size) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "old_entry_size >= new_entry_size") + if ( old_entry_size >= new_entry_size ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "old_entry_size >= new_entry_size") + } space_needed = new_entry_size - old_entry_size; @@ -4990,7 +5182,8 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, switch ( (cache_ptr->resize_ctl).flash_incr_mode ) { case H5C_flash_incr__off: - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flash_size_increase_possible but H5C_flash_incr__off?!") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "flash_size_increase_possible but H5C_flash_incr__off?!") break; case H5C_flash_incr__add_space: @@ -5010,7 +5203,8 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, break; default: /* should be unreachable */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown flash_incr_mode?!?!?") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Unknown flash_incr_mode?!?!?.") break; } @@ -5039,7 +5233,8 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, switch ( (cache_ptr->resize_ctl).flash_incr_mode ) { case H5C_flash_incr__off: - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flash_size_increase_possible but H5C_flash_incr__off?!") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "flash_size_increase_possible but H5C_flash_incr__off?!") break; case H5C_flash_incr__add_space: @@ -5050,7 +5245,8 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, break; default: /* should be unreachable */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown flash_incr_mode?!?!?") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Unknown flash_incr_mode?!?!?.") break; } @@ -5064,8 +5260,10 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, /* get the hit rate for the reporting function. Should still * be good as we havent reset the hit rate statistics. */ - if(H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate") + if ( H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate.") + } (*((cache_ptr->resize_ctl).rpt_fcn)) (cache_ptr, @@ -5078,9 +5276,12 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, new_min_clean_size); } - if(H5C_reset_cache_hit_rate_stats(cache_ptr) < 0) + if ( H5C_reset_cache_hit_rate_stats(cache_ptr) != SUCCEED ) { + /* this should be impossible... */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "H5C_reset_cache_hit_rate_stats failed.") + } } done: @@ -5146,8 +5347,8 @@ H5C_flush_invalidate_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) #if H5C_DO_SANITY_CHECKS { int32_t i; - uint32_t index_len = 0; - uint32_t slist_len = 0; + int32_t index_len = 0; + int32_t slist_len = 0; size_t index_size = (size_t)0; size_t clean_index_size = (size_t)0; size_t dirty_index_size = (size_t)0; @@ -5182,7 +5383,7 @@ H5C_flush_invalidate_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) /* remove ageout markers if present */ if(cache_ptr->epoch_markers_active > 0) if(H5C__autoadjust__ageout__remove_all_markers(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error removing all epoch markers") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error removing all epoch markers.") /* flush invalidate each ring, starting from the outermost ring and * working inward. @@ -5190,7 +5391,7 @@ H5C_flush_invalidate_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) ring = H5C_RING_USER; while(ring < H5C_RING_NTYPES) { if(H5C_flush_invalidate_ring(f, dxpl_id, ring, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate ring failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate ring failed.") ring++; } /* end while */ @@ -5278,7 +5479,7 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, { H5C_t *cache_ptr; hbool_t restart_slist_scan; - uint32_t protected_entries = 0; + int32_t protected_entries = 0; int32_t i; int32_t cur_ring_pel_len; int32_t old_ring_pel_len; @@ -5288,7 +5489,7 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, H5C_cache_entry_t *entry_ptr = NULL; H5C_cache_entry_t *next_entry_ptr = NULL; #if H5C_DO_SANITY_CHECKS - uint32_t initial_slist_len = 0; + int64_t initial_slist_len = 0; size_t initial_slist_size = 0; #endif /* H5C_DO_SANITY_CHECKS */ herr_t ret_value = SUCCEED; @@ -5473,10 +5674,9 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, * everything we can before we flag an error. */ protected_entries++; - } /* end if */ - else if(entry_ptr->is_pinned) { + } else if(entry_ptr->is_pinned) { if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__DURING_FLUSH_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty pinned entry flush failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty pinned entry flush failed.") if(cache_ptr->slist_changed) { /* The slist has been modified by something @@ -5490,10 +5690,10 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, cache_ptr->slist_changed = FALSE; H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr); } /* end if */ - } /* end else-if */ + } /* end if */ else { if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry flush destroy failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry flush destroy failed.") if(cache_ptr->slist_changed) { /* The slist has been modified by something @@ -5522,8 +5722,8 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, */ if(node_ptr == NULL) { - HDassert(cache_ptr->slist_len == (uint32_t)((int32_t)initial_slist_len + cache_ptr->slist_len_increase)); - HDassert(cache_ptr->slist_size == (size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase)); + HDassert(cache_ptr->slist_len == (initial_slist_len + cache_ptr->slist_len_increase)); + HDassert((int64_t)cache_ptr->slist_size == ((int64_t)initial_slist_size + cache_ptr->slist_size_increase)); } /* end if */ #endif /* H5C_DO_SANITY_CHECKS */ @@ -5597,7 +5797,7 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, cache_ptr->entry_watched_for_removal = next_entry_ptr; if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Entry flush destroy failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Entry flush destroy failed.") /* Restart the index list scan if necessary. Must * do this if the next entry is evicted, and also if @@ -5678,9 +5878,9 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, HDassert(protected_entries <= cache_ptr->pl_len); if(protected_entries > 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cache has protected entries") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cache has protected entries.") else if(cur_ring_pel_len > 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't unpin all pinned entries in ring") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't unpin all pinned entries in ring.") done: FUNC_LEAVE_NOAPI(ret_value) @@ -5720,12 +5920,12 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) hbool_t ignore_protected; hbool_t tried_to_flush_protected_entry = FALSE; hbool_t restart_slist_scan; - uint32_t protected_entries = 0; + int32_t protected_entries = 0; H5SL_node_t * node_ptr = NULL; H5C_cache_entry_t * entry_ptr = NULL; H5C_cache_entry_t * next_entry_ptr = NULL; #if H5C_DO_SANITY_CHECKS - uint32_t initial_slist_len = 0; + int64_t initial_slist_len = 0; size_t initial_slist_size = 0; #endif /* H5C_DO_SANITY_CHECKS */ int i; @@ -5744,7 +5944,7 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) if((H5C_validate_protected_entry_list(cache_ptr) < 0) || (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry.\n") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ ignore_protected = ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 ); @@ -5908,7 +6108,7 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) } /* end if */ else { if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (flags | H5C__DURING_FLUSH_FLAG)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry.") if(cache_ptr->slist_changed) { /* The slist has been modified by something @@ -5930,8 +6130,8 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) #if H5C_DO_SANITY_CHECKS /* Verify that the slist size and length are as expected. */ - HDassert((uint32_t)((int32_t)initial_slist_len + cache_ptr->slist_len_increase) == cache_ptr->slist_len); - HDassert((size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase) == cache_ptr->slist_size); + HDassert((initial_slist_len + cache_ptr->slist_len_increase) == cache_ptr->slist_len); + HDassert((size_t)((int64_t)initial_slist_size + cache_ptr->slist_size_increase) == cache_ptr->slist_size); #endif /* H5C_DO_SANITY_CHECKS */ } /* while */ @@ -5983,6 +6183,34 @@ done: * * Programmer: John Mainzer, 5/5/04 * + * Changes: Refactored function to remove the type_ptr parameter. + * + * JRM -- 8/7/14 + * + * Added code to check for slist changes in pre_serialize and + * serialize calls, and set + * cache_ptr->slist_change_in_pre_serialize and + * cache_ptr->slist_change_in_serialize as appropriate. + * + * JRM -- 12/13/14 + * + * Refactored function to delay all modifications of the + * metadata cache data structures until after any calls + * to the pre-serialize or serialize callbacks. + * + * Need to do this, as some pre-serialize or serialize + * calls result in calls to the metadata cache and + * modifications to its data structures. Thus, at the + * time of any such call, the target entry flags and + * the metadata cache must all be consistant. + * + * Also added the entry_size_change_ptr parameter, which + * allows the function to report back any change in the size + * of the entry during the flush. Such size changes may + * occur during the pre-serialize callback. + * + * JRM -- 12/24/14 + * *------------------------------------------------------------------------- */ herr_t @@ -6000,8 +6228,6 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, hbool_t destroy_entry; /* internal flag */ hbool_t generate_image; /* internal flag */ hbool_t was_dirty; - hbool_t suppress_image_entry_writes = FALSE; - hbool_t suppress_image_entry_frees = FALSE; haddr_t entry_addr = HADDR_UNDEF; herr_t ret_value = SUCCEED; /* Return value */ @@ -6014,7 +6240,6 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, HDassert(entry_ptr); HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(entry_ptr->ring != H5C_RING_UNDEFINED); - HDassert(entry_ptr->type); /* setup external flags from the flags parameter */ destroy = ((flags & H5C__FLUSH_INVALIDATE_FLAG) != 0); @@ -6045,64 +6270,44 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, else write_entry = FALSE; - /* if we have received close warning, and we have been instructed to - * generate a metadata cache image, and we have actually constructed - * the entry images, set suppress_image_entry_frees to TRUE. - * - * Set suppress_image_entry_writes to TRUE if indicated by the - * image_ctl flags. - */ - if(cache_ptr->close_warning_received && cache_ptr->image_ctl.generate_image - && cache_ptr->num_entries_in_image > 0 && cache_ptr->image_entries) { - /* Sanity checks */ - HDassert(entry_ptr->image_up_to_date || !(entry_ptr->include_in_image)); - HDassert(entry_ptr->image_ptr || !(entry_ptr->include_in_image)); - HDassert((!clear_only) || !(entry_ptr->include_in_image)); - HDassert((!take_ownership) || !(entry_ptr->include_in_image)); - HDassert((!free_file_space) || !(entry_ptr->include_in_image)); - - suppress_image_entry_frees = TRUE; - - if(cache_ptr->image_ctl.flags & H5C_CI__SUPRESS_ENTRY_WRITES) - suppress_image_entry_writes = TRUE; - } /* end if */ - /* run initial sanity checks */ #if H5C_DO_SANITY_CHECKS if(entry_ptr->in_slist) { HDassert(entry_ptr->is_dirty); if((entry_ptr->flush_marker) && (!entry_ptr->is_dirty)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry in slist failed sanity checks") - } /* end if */ - else { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry in slist failed sanity checks.") + } else { HDassert(!entry_ptr->is_dirty); HDassert(!entry_ptr->flush_marker); if((entry_ptr->is_dirty) || (entry_ptr->flush_marker)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry failed sanity checks") - } /* end else */ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry failed sanity checks.") + } #endif /* H5C_DO_SANITY_CHECKS */ if(entry_ptr->is_protected) { HDassert(!entry_ptr->is_protected); /* Attempt to flush a protected entry -- scream and die. */ - HGOTO_ERROR(H5E_CACHE, H5E_PROTECT, FAIL, "Attempt to flush a protected entry") + HGOTO_ERROR(H5E_CACHE, H5E_PROTECT, FAIL, "Attempt to flush a protected entry.") } /* end if */ - /* Set entry_ptr->flush_in_progress = TRUE and set + /* set entry_ptr->flush_in_progress = TRUE and set * entry_ptr->flush_marker = FALSE * - * We will set flush_in_progress back to FALSE at the end if the + * in the parallel case, do some sanity checking in passing. + */ + HDassert(entry_ptr->type); + + was_dirty = entry_ptr->is_dirty; /* needed later for logging */ + + /* We will set flush_in_progress back to FALSE at the end if the * entry still exists at that point. */ entry_ptr->flush_in_progress = TRUE; entry_ptr->flush_marker = FALSE; - /* Preserve current dirty state for later */ - was_dirty = entry_ptr->is_dirty; - /* The entry is dirty, and we are doing a flush, a flush destroy or have * been requested to generate an image. In those cases, serialize the * entry. @@ -6119,9 +6324,6 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, } /* end if */ if(!(entry_ptr->image_up_to_date)) { - /* Sanity check */ - HDassert(!entry_ptr->prefetched); - /* Generate the entry's image */ if(H5C__generate_image(f, cache_ptr, entry_ptr, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't generate entry's image") @@ -6142,17 +6344,7 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Write when writes are always forbidden!?!?!") #endif /* H5C_DO_SANITY_CHECKS */ - /* Write the image to disk unless the write is suppressed. - * - * This happens if both suppress_image_entry_writes and - * entry_ptr->include_in_image are TRUE, or if the - * H5AC__CLASS_SKIP_WRITES is set in the entry's type. This - * flag should only be used in test code - */ - if((!suppress_image_entry_writes || !entry_ptr->include_in_image) - && (((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0)) { - H5FD_mem_t mem_type = H5FD_MEM_DEFAULT; - + if(((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0) { #ifdef H5_HAVE_PARALLEL if(cache_ptr->coll_write_list) { if(H5SL_insert(cache_ptr->coll_write_list, entry_ptr, &entry_ptr->addr) < 0) @@ -6160,16 +6352,8 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, } /* end if */ else #endif /* H5_HAVE_PARALLEL */ - - if(entry_ptr->prefetched) { - HDassert(entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); - mem_type = cache_ptr->class_table_ptr[entry_ptr->prefetch_type_id]->mem_type; - } /* end if */ - else - mem_type = entry_ptr->type->mem_type; - - if(H5F_block_write(f, mem_type, entry_ptr->addr, entry_ptr->size, dxpl_id, entry_ptr->image_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't write image to file") + if(H5F_block_write(f, entry_ptr->type->mem_type, entry_ptr->addr, entry_ptr->size, dxpl_id, entry_ptr->image_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't write image to file.") } /* end if */ /* if the entry has a notify callback, notify it that we have @@ -6313,29 +6497,10 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, /* Sanity check */ HDassert(0 == entry_ptr->flush_dep_nparents); - /* if both suppress_image_entry_frees and entry_ptr->include_in_image - * are true, simply set entry_ptr->image_ptr to NULL, as we have - * another pointer to the buffer in an instance of H5C_image_entry_t - * in cache_ptr->image_entries. - * - * Otherwise, free the buffer if it exists. - */ - if(suppress_image_entry_frees && entry_ptr->include_in_image) - entry_ptr->image_ptr = NULL; - else if(entry_ptr->image_ptr != NULL) + /* Start by freeing the buffer for the on disk image */ + if(entry_ptr->image_ptr != NULL) entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr); - /* If the entry is not a prefetched entry, verify that the flush - * dependency parents addresses array has been transfered. - * - * If the entry is prefetched, the free_isr routine will dispose of - * the flush dependency parents adresses array if necessary. - */ - if(!entry_ptr->prefetched) { - HDassert(0 == entry_ptr->fd_parent_count); - HDassert(NULL == entry_ptr->fd_parent_addrs); - } /* end if */ - /* Check whether we should free the space in the file that * the entry occupies */ @@ -6419,7 +6584,7 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, HDassert(entry_ptr->image_ptr == NULL); if(entry_ptr->type->free_icr((void *)entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "free_icr callback failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "free_icr callback failed.") } /* end if */ else { HDassert(take_ownership); @@ -6434,11 +6599,12 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, if(cache_ptr->log_flush) if((cache_ptr->log_flush)(cache_ptr, entry_addr, was_dirty, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "log_flush callback failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "log_flush callback failed.") done: HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || ( ! entry_ptr->flush_in_progress ) ); + HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || ( take_ownership ) || ( ! entry_ptr->is_dirty ) ); @@ -6496,14 +6662,14 @@ H5C__verify_len_eoa(H5F_t *f, const H5C_class_t *type, haddr_t addr, /* Check if the amount of data to read will be past the EOA */ if(H5F_addr_gt((addr + *len), eoa)) { if(actual) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "actual len exceeds EOA") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "actual len exceeds EOA.") else /* Trim down the length of the metadata */ *len = (size_t)(eoa - addr); } /* end if */ if(*len <= 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "len not positive after adjustment for EOA") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "len not positive after adjustment for EOA.") done: FUNC_LEAVE_NOAPI(ret_value) @@ -6583,7 +6749,7 @@ H5C_load_entry(H5F_t * f, /* Allocate the buffer for reading the on-disk entry image */ if(NULL == (image = (uint8_t *)H5MM_malloc(len + H5C_IMAGE_EXTRA_SPACE))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "memory allocation failed for on disk image buffer") + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "memory allocation failed for on disk image buffer.") #if H5C_DO_MEMORY_SANITY_CHECKS HDmemcpy(image + len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ @@ -6660,7 +6826,7 @@ H5C_load_entry(H5F_t * f, if(actual_len != len) { /* Verify that the length isn't past the EOA for the file */ if(H5C__verify_len_eoa(f, type, addr, &actual_len, TRUE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "actual_len exceeds EOA") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "actual_len exceeds EOA.") /* Expand buffer to new size */ if(NULL == (new_image = H5MM_realloc(image, actual_len + H5C_IMAGE_EXTRA_SPACE))) @@ -6810,22 +6976,6 @@ H5C_load_entry(H5F_t * f, entry->coll_prev = NULL; #endif /* H5_HAVE_PARALLEL */ - /* initialize cache image related fields */ - entry->include_in_image = FALSE; - entry->lru_rank = 0; - entry->image_dirty = FALSE; - entry->fd_parent_count = 0; - entry->fd_parent_addrs = NULL; - entry->fd_child_count = 0; - entry->fd_dirty_child_count = 0; - entry->image_fd_height = 0; - entry->prefetched = FALSE; - entry->prefetch_type_id = 0; - entry->age = 0; -#ifndef NDEBUG /* debugging field */ - entry->serialization_count = 0; -#endif /* NDEBUG */ - H5C__RESET_CACHE_ENTRY_STATS(entry); ret_value = thing; @@ -6846,7 +6996,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5C__make_space_in_cache + * Function: H5C_make_space_in_cache * * Purpose: Attempt to evict cache entries until the index_size * is at least needed_space below max_cache_size. @@ -6877,19 +7027,53 @@ done: * * Programmer: John Mainzer, 5/14/04 * + * Changes: Modified function to skip over entries with the + * flush_in_progress flag set. If this is not done, + * an infinite recursion is possible if the cache is + * full, and the pre-serialize or serialize routine + * attempts to load another entry. + * + * This error was exposed by a re-factor of the + * H5C__flush_single_entry() routine. However, it was + * a potential bug from the moment that entries were + * allowed to load other entries on flush. + * + * In passing, note that the primary and secondary dxpls + * mentioned in the comment above have been replaced by + * a single dxpl at some point, and thus the discussion + * above is somewhat obsolete. Date of this change is + * unkown. + * + * JRM -- 12/26/14 + * + * Modified function to detect deletions of entries + * during a scan of the LRU, and where appropriate, + * restart the scan to avoid proceeding with a next + * entry that is no longer in the cache. + * + * Note the absence of checks after flushes of clean + * entries. As a second entry can only be removed by + * by a call to the pre_serialize or serialize callback + * of the first, and as these callbacks will not be called + * on clean entries, no checks are needed. + * + * JRM -- 4/6/15 + * *------------------------------------------------------------------------- */ -herr_t -H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, - hbool_t write_permitted) +static herr_t +H5C_make_space_in_cache(H5F_t * f, + hid_t dxpl_id, + size_t space_needed, + hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; #if H5C_COLLECT_CACHE_STATS int32_t clean_entries_skipped = 0; int32_t total_entries_scanned = 0; #endif /* H5C_COLLECT_CACHE_STATS */ - uint32_t entries_examined = 0; - uint32_t initial_list_len; + int32_t entries_examined = 0; + int32_t initial_list_len; size_t empty_space; hbool_t prev_is_dirty = FALSE; hbool_t didnt_flush_entry = FALSE; @@ -6897,27 +7081,33 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, H5C_cache_entry_t * entry_ptr; H5C_cache_entry_t * prev_ptr; H5C_cache_entry_t * next_ptr; - uint32_t num_corked_entries = 0; + int32_t num_corked_entries = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_NOAPI_NOINIT - /* Sanity checks */ - HDassert(f); - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(cache_ptr->index_size == (cache_ptr->clean_index_size + cache_ptr->dirty_index_size)); + HDassert( f ); + HDassert( cache_ptr ); + HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + HDassert( cache_ptr->index_size == + (cache_ptr->clean_index_size + cache_ptr->dirty_index_size) ); if ( write_permitted ) { + restart_scan = FALSE; initial_list_len = cache_ptr->LRU_list_len; entry_ptr = cache_ptr->LRU_tail_ptr; - if(cache_ptr->index_size >= cache_ptr->max_cache_size) + if ( cache_ptr->index_size >= cache_ptr->max_cache_size ) { + empty_space = 0; - else + + } else { + empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; + } + while ( ( ( (cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size @@ -7163,8 +7353,10 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, } done: + FUNC_LEAVE_NOAPI(ret_value) -} /* H5C__make_space_in_cache() */ + +} /* H5C_make_space_in_cache() */ /*------------------------------------------------------------------------- @@ -7974,515 +8166,6 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t * entry, /*------------------------------------------------------------------------- - * Function: H5C__serialize_cache - * - * Purpose: Serialize (i.e. construct an on disk image) for all entries - * in the metadata cache including clean entries. - * - * Note that flush dependencies and "flush me last" flags - * must be observed in the serialization process. - * - * Note also that entries may be loaded, flushed, evicted, - * expunged, relocated, resized, or removed from the cache - * during this process, just as these actions may occur during - * a regular flush. - * - * However, we are given that the cache will contain no protected - * entries on entry to this routine (although entries may be - * briefly protected and then unprotected during the serialize - * process). - * - * The objective of this routine is serialize all entries and - * to force all entries into their actual locations on disk. - * - * The initial need for this routine is to settle all entries - * in the cache prior to construction of the metadata cache - * image so that the size of the cache image can be calculated. - * However, I gather that other uses for the routine are - * under consideration. - * - * Return: Non-negative on success/Negative on failure or if there was - * a request to flush all items and something was protected. - * - * Programmer: John Mainzer - * 7/22/15 - * - *------------------------------------------------------------------------- - */ -herr_t -H5C__serialize_cache(H5F_t *f, hid_t dxpl_id) -{ -#if H5C_DO_SANITY_CHECKS - int i; - uint32_t index_len = 0; - size_t index_size = (size_t)0; - size_t clean_index_size = (size_t)0; - size_t dirty_index_size = (size_t)0; - size_t slist_size = (size_t)0; - uint32_t slist_len = 0; -#endif /* H5C_DO_SANITY_CHECKS */ - H5C_ring_t ring; - H5C_t * cache_ptr; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_PACKAGE - - /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(cache_ptr->slist_ptr); - -#if H5C_DO_SANITY_CHECKS - HDassert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0); - HDassert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->dirty_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->slist_ring_len[H5C_RING_UNDEFINED] == 0); - HDassert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - - for(i = H5C_RING_USER; i < H5C_RING_NTYPES; i++) { - index_len += cache_ptr->index_ring_len[i]; - index_size += cache_ptr->index_ring_size[i]; - clean_index_size += cache_ptr->clean_index_ring_size[i]; - dirty_index_size += cache_ptr->dirty_index_ring_size[i]; - - slist_len += cache_ptr->slist_ring_len[i]; - slist_size += cache_ptr->slist_ring_size[i]; - } /* end for */ - - HDassert(cache_ptr->index_len == index_len); - HDassert(cache_ptr->index_size == index_size); - HDassert(cache_ptr->clean_index_size == clean_index_size); - HDassert(cache_ptr->dirty_index_size == dirty_index_size); - HDassert(cache_ptr->slist_len == slist_len); - HDassert(cache_ptr->slist_size == slist_size); -#endif /* H5C_DO_SANITY_CHECKS */ - -#if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") -#endif /* H5C_DO_EXTREME_SANITY_CHECKS */ - -#ifndef NDEBUG - /* if this is a debug build, set the serialization_count field of - * each entry in the cache to zero before we start the serialization. - * This allows us to detect the case in which any entry is serialized - * more than once (a performance issues), and more importantly, the - * case is which any flush depencency parent is serializes more than - * once (a correctness issue). - */ - { - H5C_cache_entry_t * scan_ptr = NULL; - - scan_ptr = cache_ptr->il_head; - while(scan_ptr != NULL) { - HDassert(scan_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - scan_ptr->serialization_count = 0; - scan_ptr = scan_ptr->il_next; - } /* end while */ - } /* end block */ -#endif /* NDEBUG */ - - /* set cache_ptr->serialization_in_progress to TRUE, and back - * to FALSE at the end of the function. Must maintain this flag - * to support H5C_get_serialization_in_progress(), which is in - * turn required to support sanity checking in some cache - * clients. - */ - HDassert(!cache_ptr->serialization_in_progress); - cache_ptr->serialization_in_progress = TRUE; - - /* Serialize each ring, starting from the outermost ring and - * working inward. - */ - ring = H5C_RING_USER; - while(ring < H5C_RING_NTYPES) { - HDassert(cache_ptr->close_warning_received); - switch(ring) { - case H5C_RING_USER: - break; - - case H5C_RING_RDFSM: - /* Settle raw data FSM */ - if(!cache_ptr->rdfsm_settled) - if(H5MF_settle_raw_data_fsm(f, dxpl_id, &cache_ptr->rdfsm_settled) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "RD FSM settle failed") - break; - - case H5C_RING_MDFSM: - /* Settle metadata FSM */ - if(!cache_ptr->mdfsm_settled) - if(H5MF_settle_meta_data_fsm(f, dxpl_id, &cache_ptr->mdfsm_settled) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "MD FSM settle failed") - break; - - case H5C_RING_SBE: - case H5C_RING_SB: - break; - - default: - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown ring?!?!") - break; - } /* end switch */ - - if(H5C__serialize_ring(f, dxpl_id, ring) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "serialize ring failed") - - ring++; - } /* end while */ - -#ifndef NDEBUG - /* Verify that no entry has been serialized more than once. - * FD parents with multiple serializations should have been caught - * elsewhere, so no specific check for them here. - */ - { - H5C_cache_entry_t * scan_ptr = NULL; - - scan_ptr = cache_ptr->il_head; - while(scan_ptr != NULL) { - HDassert(scan_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(scan_ptr->serialization_count <= 1); - - scan_ptr = scan_ptr->il_next; - } /* end while */ - } /* end block */ -#endif /* NDEBUG */ - -done: - cache_ptr->serialization_in_progress = FALSE; - FUNC_LEAVE_NOAPI(ret_value) -} /* H5C__serialize_cache() */ - - -/*------------------------------------------------------------------------- - * Function: H5C__serialize_ring - * - * Purpose: Serialize the entries contained in the specified cache and - * ring. All entries in rings outside the specified ring - * must have been serialized on entry. - * - * If the cache contains protected entries in the specified - * ring, the function will fail, as protected entries cannot - * be serialized. However all unprotected entries in the - * target ring should be serialized before the function - * returns failure. - * - * If flush dependencies appear in the target ring, the - * function makes repeated passes through the index list - * serializing entries in flush dependency order. - * - * All entries outside the H5C_RING_SBE are marked for - * inclusion in the cache image. Entries in H5C_RING_SBE - * and below are marked for exclusion from the image. - * - * Return: Non-negative on success/Negative on failure or if there was - * a request to flush all items and something was protected. - * - * Programmer: John Mainzer - * 9/11/15 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5C__serialize_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring) -{ - hbool_t done = FALSE; - H5C_t * cache_ptr; - H5C_cache_entry_t * entry_ptr; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_STATIC - - /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(ring > H5C_RING_UNDEFINED); - HDassert(ring < H5C_RING_NTYPES); - - HDassert(cache_ptr->serialization_in_progress); - - /* The objective here is to serialize all entries in the cache ring - * in flush dependency order. - * - * The basic algorithm is to scan the cache index list looking for - * unserialized entries that are either not in a flush dependency - * relationship, or which have no unserialized children. Any such - * entry is serialized and its flush dependency parents (if any) are - * informed -- allowing them to decrement their userialized child counts. - * - * However, this algorithm is complicated by the ability - * of client serialization callbacks to perform operations on - * on the cache which can result in the insertion, deletion, - * relocation, resize, dirty, flush, eviction, or removal (via the - * take ownership flag) of entries. Changes in the flush dependency - * structure are also possible. - * - * On the other hand, the algorithm is simplified by the fact that - * we are serializing, not flushing. Thus, as long as all entries - * are serialized correctly, it doesn't matter if we have to go back - * and serialize an entry a second time. - * - * These possible actions result in the following modfications to - * tha basic algorithm: - * - * 1) In the event of an entry expunge, eviction or removal, we must - * restart the scan as it is possible that the next entry in our - * scan is no longer in the cache. Were we to examine this entry, - * we would be accessing deallocated memory. - * - * 2) A resize, dirty, or insertion of an entry may result in the - * the increment of a flush dependency parent's dirty and/or - * unserialized child count. In the context of serializing the - * the cache, this is a non-issue, as even if we have already - * serialized the parent, it will be marked dirty and its image - * marked out of date if appropriate when the child is serialized. - * - * However, this is a major issue for a flush, as were this to happen - * in a flush, it would violate the invariant that the flush dependency - * feature is intended to enforce. As the metadata cache has no - * control over the behavior of cache clients, it has no way of - * preventing this behaviour. However, it should detect it if at all - * possible. - * - * Do this by maintaining a count of the number of times each entry is - * serialized during a cache serialization. If any flush dependency - * parent is serialized more than once, throw an assertion failure. - * - * 3) An entry relocation will typically change the location of the - * entry in the index list. This shouldn't cause problems as we - * will scan the index list until we make a complete pass without - * finding anything to serialize -- making relocations of either - * the current or next entries irrelevant. - * - * Note that since a relocation may result in our skipping part of - * the index list, we must always do at least one more pass through - * the index list after an entry relocation. - * - * 4) Changes in the flush dependency structure are possible on - * entry insertion, load, expunge, evict, or remove. Destruction - * of a flush dependency has no effect, as it can only relax the - * flush dependencies. Creation of a flush dependency can create - * an unserialized child of a flush dependency parent where all - * flush dependency children were previously serialized. Should - * this child dirty the flush dependency parent when it is serialized, - * the parent will be re-serialized. - * - * Per the discussion of 2) above, this is a non issue for cache - * serialization, and a major problem for cache flush. Using the - * same detection mechanism, throw an assertion failure if this - * condition appears. - * - * Observe that either eviction or removal of entries as a result of - * a serialization is not a problem as long as the flush depencency - * tree does not change beyond the removal of a leaf. - */ - while(!done) { - /* Reset the counters so that we can detect insertions, loads, - * moves, and flush dependency height changes caused by the pre_serialize - * and serialize callbacks. - */ - cache_ptr->entries_loaded_counter = 0; - cache_ptr->entries_inserted_counter = 0; - cache_ptr->entries_relocated_counter = 0; - - done = TRUE; /* set to FALSE if any activity in inner loop */ - entry_ptr = cache_ptr->il_head; - while(entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - - /* Verify that either the entry is already serialized, or - * that it is assigned to either the target or an inner - * ring. - */ - HDassert((entry_ptr->ring >= ring) || (entry_ptr->image_up_to_date)); - - /* Skip flush me last entries or inner ring entries */ - if(!entry_ptr->flush_me_last && entry_ptr->ring == ring) { - - /* if we encounter an unserialized entry in the current - * ring that is not marked flush me last, we are not done. - */ - if(!entry_ptr->image_up_to_date) - done = FALSE; - - /* Serialize the entry if its image is not up to date - * and it has no unserialized flush dependency children. - */ - if(!entry_ptr->image_up_to_date && entry_ptr->flush_dep_nunser_children == 0) { - HDassert(entry_ptr->serialization_count == 0); - - /* Serialize the entry */ - if(H5C__serialize_single_entry(f, dxpl_id, cache_ptr, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "entry serialization failed") - - HDassert(entry_ptr->flush_dep_nunser_children == 0); - HDassert(entry_ptr->serialization_count == 0); - -#ifndef NDEBUG - /* Increment serialization counter (to detect multiple serializations) */ - entry_ptr->serialization_count++; -#endif /* NDEBUG */ - } /* end if */ - } /* end if */ - - /* Check for the cache being perturbed during the entry serialize */ - if((cache_ptr->entries_loaded_counter > 0) || - (cache_ptr->entries_inserted_counter > 0) || - (cache_ptr->entries_relocated_counter > 0)) { - -#if H5C_COLLECT_CACHE_STATS - H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr); -#endif /* H5C_COLLECT_CACHE_STATS */ - - /* Reset the counters */ - cache_ptr->entries_loaded_counter = 0; - cache_ptr->entries_inserted_counter = 0; - cache_ptr->entries_relocated_counter = 0; - - /* Restart scan */ - entry_ptr = cache_ptr->il_head; - } /* end if */ - else - /* Advance to next entry */ - entry_ptr = entry_ptr->il_next; - } /* while ( entry_ptr != NULL ) */ - } /* while ( ! done ) */ - - - /* Reset the counters so that we can detect insertions, loads, - * moves, and flush dependency height changes caused by the pre_serialize - * and serialize callbacks. - */ - cache_ptr->entries_loaded_counter = 0; - cache_ptr->entries_inserted_counter = 0; - cache_ptr->entries_relocated_counter = 0; - - /* At this point, all entries not marked "flush me last" and in - * the current ring or outside it should be serialized and have up - * to date images. Scan the index list again to serialize the - * "flush me last" entries (if they are in the current ring) and to - * verify that all other entries have up to date images. - */ - entry_ptr = cache_ptr->il_head; - while(entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(entry_ptr->ring > H5C_RING_UNDEFINED); - HDassert(entry_ptr->ring < H5C_RING_NTYPES); - HDassert((entry_ptr->ring >= ring) || (entry_ptr->image_up_to_date)); - - if(entry_ptr->ring == ring) { - if(entry_ptr->flush_me_last) { - if(!entry_ptr->image_up_to_date) { - HDassert(entry_ptr->serialization_count == 0); - HDassert(entry_ptr->flush_dep_nunser_children == 0); - - /* Serialize the entry */ - if(H5C__serialize_single_entry(f, dxpl_id, cache_ptr, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "entry serialization failed") - - /* Check for the cache changing */ - if((cache_ptr->entries_loaded_counter > 0) || - (cache_ptr->entries_inserted_counter > 0) || - (cache_ptr->entries_relocated_counter > 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flush_me_last entry serialization triggered restart") - - HDassert(entry_ptr->flush_dep_nunser_children == 0); - HDassert(entry_ptr->serialization_count == 0); -#ifndef NDEBUG - /* Increment serialization counter (to detect multiple serializations) */ - entry_ptr->serialization_count++; -#endif /* NDEBUG */ - } /* end if */ - } /* end if */ - else { - HDassert(entry_ptr->image_up_to_date); - HDassert(entry_ptr->serialization_count <= 1); - HDassert(entry_ptr->flush_dep_nunser_children == 0); - } /* end else */ - } /* if ( entry_ptr->ring == ring ) */ - - entry_ptr = entry_ptr->il_next; - } /* while ( entry_ptr != NULL ) */ - -done: - HDassert(cache_ptr->serialization_in_progress); - FUNC_LEAVE_NOAPI(ret_value) -} /* H5C__serialize_ring() */ - - -/*------------------------------------------------------------------------- - * Function: H5C__serialize_single_entry - * - * Purpose: Serialize the cache entry pointed to by the entry_ptr - * parameter. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer, 7/24/15 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5C__serialize_single_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr, - H5C_cache_entry_t *entry_ptr) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Sanity checks */ - HDassert(f); - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(entry_ptr); - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(!entry_ptr->prefetched); - HDassert(!entry_ptr->image_up_to_date); - HDassert(entry_ptr->is_dirty); - HDassert(!entry_ptr->is_protected); - HDassert(!entry_ptr->flush_in_progress); - HDassert(entry_ptr->type); - - /* Set entry_ptr->flush_in_progress to TRUE so the the target entry - * will not be evicted out from under us. Must set it back to FALSE - * when we are done. - */ - entry_ptr->flush_in_progress = TRUE; - - /* Allocate buffer for the entry image if required. */ - if(NULL == entry_ptr->image_ptr) { - HDassert(entry_ptr->size > 0); - if(NULL == (entry_ptr->image_ptr = H5MM_malloc(entry_ptr->size + H5C_IMAGE_EXTRA_SPACE)) ) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for on disk image buffer") -#if H5C_DO_MEMORY_SANITY_CHECKS - HDmemcpy(((uint8_t *)entry_ptr->image_ptr) + image_size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); -#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ - } /* end if */ - - /* Generate image for entry */ - if(H5C__generate_image(f, cache_ptr, entry_ptr, dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "Can't generate image for cache entry") - - /* Reset the flush_in progress flag */ - entry_ptr->flush_in_progress = FALSE; - -done: - HDassert((ret_value != SUCCEED) || (!entry_ptr->flush_in_progress)); - HDassert((ret_value != SUCCEED) || (entry_ptr->image_up_to_date)); - FUNC_LEAVE_NOAPI(ret_value) -} /* H5C__serialize_single_entry() */ - - -/*------------------------------------------------------------------------- * Function: H5C__generate_image * * Purpose: Serialize an entry and generate its image. @@ -8503,7 +8186,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, hid_t dxpl_id) { @@ -8513,18 +8196,10 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, unsigned serialize_flags = H5C__SERIALIZE_NO_FLAGS_SET; herr_t ret_value = SUCCEED; - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* Sanity check */ - HDassert(f); - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(entry_ptr); - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(!entry_ptr->image_up_to_date); - HDassert(entry_ptr->is_dirty); - HDassert(!entry_ptr->is_protected); - HDassert(entry_ptr->type); /* make note of the entry's current address */ old_addr = entry_ptr->addr; @@ -8538,7 +8213,8 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, /* Check for any flags set in the pre-serialize callback */ if(serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET) { /* Check for unexpected flags from serialize callback */ - if(serialize_flags & ~(H5C__SERIALIZE_RESIZED_FLAG | H5C__SERIALIZE_MOVED_FLAG)) + if(serialize_flags & ~(H5C__SERIALIZE_RESIZED_FLAG | + H5C__SERIALIZE_MOVED_FLAG)) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unknown serialize flag(s)") #ifdef H5_HAVE_PARALLEL @@ -8569,15 +8245,12 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, * tests will be necessary. */ if(cache_ptr->aux_ptr != NULL) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "resize/move in serialize occured in parallel case") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "resize/move in serialize occured in parallel case.") #endif /* If required, resize the buffer and update the entry and the cache * data structures */ if(serialize_flags & H5C__SERIALIZE_RESIZED_FLAG) { - /* Sanity check */ - HDassert(new_len > 0); - /* Allocate a new image buffer */ if(NULL == (entry_ptr->image_ptr = H5MM_realloc(entry_ptr->image_ptr, new_len + H5C_IMAGE_EXTRA_SPACE))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for on disk image buffer") @@ -8588,8 +8261,9 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, /* Update statistics for resizing the entry */ H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_len); - /* Update the hash table for the size change */ - H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_len, entry_ptr, !(entry_ptr->is_dirty)); + /* update the hash table for the size change */ + H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, \ + new_len, entry_ptr, !(entry_ptr->is_dirty)); /* The entry can't be protected since we are in the process of * flushing it. Thus we must update the replacement policy data @@ -8602,11 +8276,10 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, * for the flush or flush destroy yet, the entry should * be in the slist. Thus update it for the size change. */ - HDassert(entry_ptr->is_dirty); HDassert(entry_ptr->in_slist); H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_len); - /* Finally, update the entry for its new size */ + /* finally, update the entry for its new size */ entry_ptr->size = new_len; } /* end if */ @@ -8623,10 +8296,10 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr, FAIL); H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE); - /* Update the entry for its new address */ + /* update the entry for its new address */ entry_ptr->addr = new_addr; - /* And then reinsert in the index and slist */ + /* and then reinsert in the index and slist */ H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL); H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL); } /* end if */ @@ -8643,13 +8316,6 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ entry_ptr->image_up_to_date = TRUE; - /* Propagate the fact that the entry is serialized up the - * flush dependency chain if appropriate. Since the image must - * have been out of date for this function to have been called - * (see assertion on entry), no need to check that -- only check - * for flush dependency parents. - */ - HDassert(entry_ptr->flush_dep_nunser_children == 0); if(entry_ptr->flush_dep_nparents > 0) if(H5C__mark_flush_dep_serialized(entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "Can't propagate serialization status to fd parents") diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index eb5f123..5697bff 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -35,7 +35,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata Cache */ #include "H5Cpkg.h" /* Cache */ #include "H5Eprivate.h" /* Error Handling */ @@ -54,6 +53,10 @@ /* Local Prototypes */ /********************/ +#if 0 /* debugging routines */ +herr_t H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn); +#endif /* debugging routines */ + /*********************/ /* Package Variables */ @@ -101,7 +104,7 @@ H5C_dump_cache(H5C_t * cache_ptr, const char * cache_name) /* First, create a skip list */ if(NULL == (slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create skip list") + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create skip list.") /* Next, scan the index, and insert all entries in the skip list. * Do this, as we want to display cache entries in increasing address @@ -191,7 +194,7 @@ done: * *------------------------------------------------------------------------- */ -#ifndef NDEBUG +#if 0 /* debugging routine */ herr_t H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) { @@ -200,14 +203,14 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) H5C_cache_entry_t * entry_ptr = NULL; H5SL_node_t * node_ptr = NULL; - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_NOAPI(FAIL) HDassert(cache_ptr != NULL); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(calling_fcn != NULL); HDfprintf(stdout, "\n\nDumping metadata cache skip list from %s.\n", calling_fcn); - HDfprintf(stdout, " slist len = %u.\n", cache_ptr->slist_len); + HDfprintf(stdout, " slist len = %d.\n", cache_ptr->slist_len); HDfprintf(stdout, " slist size = %lld.\n", (long long)(cache_ptr->slist_size)); if(cache_ptr->slist_len > 0) { @@ -237,9 +240,9 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) (int)(entry_ptr->is_dirty), entry_ptr->type->name); - HDfprintf(stdout, " node_ptr = 0x%llx, item = %p\n", + HDfprintf(stdout, " node_ptr = 0x%llx, item = 0x%llx\n", (unsigned long long)node_ptr, - H5SL_item(node_ptr)); + (unsigned long long)H5SL_item(node_ptr)); /* increment node_ptr before we delete its target */ node_ptr = H5SL_next(node_ptr); @@ -254,9 +257,10 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) HDfprintf(stdout, "\n\n"); +done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_dump_cache_skip_list() */ -#endif /* NDEBUG */ +#endif /* debugging routine */ /*------------------------------------------------------------------------- @@ -281,7 +285,7 @@ H5C_set_prefix(H5C_t * cache_ptr, char * prefix) if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC) || (prefix == NULL) || (HDstrlen(prefix) >= H5C__PREFIX_LEN)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry.") HDstrncpy(&(cache_ptr->prefix[0]), prefix, (size_t)(H5C__PREFIX_LEN)); @@ -381,7 +385,6 @@ H5C_stats(H5C_t * cache_ptr, size_t aggregate_max_size = 0; int32_t aggregate_max_pins = 0; double hit_rate; - double prefetch_use_rate; double average_successful_search_depth = 0.0f; double average_failed_search_depth = 0.0f; double average_entries_skipped_per_calls_to_msic = 0.0f; @@ -487,12 +490,12 @@ H5C_stats(H5C_t * cache_ptr, average_failed_search_depth); HDfprintf(stdout, - "%s current (max) index size / length = %ld (%ld) / %lu (%lu)\n", + "%s current (max) index size / length = %ld (%ld) / %ld (%ld)\n", cache_ptr->prefix, (long)(cache_ptr->index_size), (long)(cache_ptr->max_index_size), - (unsigned long)(cache_ptr->index_len), - (unsigned long)(cache_ptr->max_index_len)); + (long)(cache_ptr->index_len), + (long)(cache_ptr->max_index_len)); HDfprintf(stdout, "%s current (max) clean/dirty idx size = %ld (%ld) / %ld (%ld)\n", @@ -503,46 +506,46 @@ H5C_stats(H5C_t * cache_ptr, (long)(cache_ptr->max_dirty_index_size)); HDfprintf(stdout, - "%s current (max) slist size / length = %ld (%ld) / %lu (%lu)\n", + "%s current (max) slist size / length = %ld (%ld) / %ld (%ld)\n", cache_ptr->prefix, (long)(cache_ptr->slist_size), (long)(cache_ptr->max_slist_size), - (unsigned long)(cache_ptr->slist_len), - (unsigned long)(cache_ptr->max_slist_len)); + (long)(cache_ptr->slist_len), + (long)(cache_ptr->max_slist_len)); HDfprintf(stdout, - "%s current (max) PL size / length = %ld (%ld) / %lu (%lu)\n", + "%s current (max) PL size / length = %ld (%ld) / %ld (%ld)\n", cache_ptr->prefix, (long)(cache_ptr->pl_size), (long)(cache_ptr->max_pl_size), - (unsigned long)(cache_ptr->pl_len), - (unsigned long)(cache_ptr->max_pl_len)); + (long)(cache_ptr->pl_len), + (long)(cache_ptr->max_pl_len)); HDfprintf(stdout, - "%s current (max) PEL size / length = %ld (%ld) / %lu (%lu)\n", + "%s current (max) PEL size / length = %ld (%ld) / %ld (%ld)\n", cache_ptr->prefix, (long)(cache_ptr->pel_size), (long)(cache_ptr->max_pel_size), - (unsigned long)(cache_ptr->pel_len), - (unsigned long)(cache_ptr->max_pel_len)); + (long)(cache_ptr->pel_len), + (long)(cache_ptr->max_pel_len)); HDfprintf(stdout, - "%s current LRU list size / length = %ld / %lu\n", + "%s current LRU list size / length = %ld / %ld\n", cache_ptr->prefix, (long)(cache_ptr->LRU_list_size), - (unsigned long)(cache_ptr->LRU_list_len)); + (long)(cache_ptr->LRU_list_len)); HDfprintf(stdout, - "%s current clean LRU size / length = %ld / %lu\n", + "%s current clean LRU size / length = %ld / %ld\n", cache_ptr->prefix, (long)(cache_ptr->cLRU_list_size), - (unsigned long)(cache_ptr->cLRU_list_len)); + (long)(cache_ptr->cLRU_list_len)); HDfprintf(stdout, - "%s current dirty LRU size / length = %ld / %lu\n", + "%s current dirty LRU size / length = %ld / %ld\n", cache_ptr->prefix, (long)(cache_ptr->dLRU_list_size), - (unsigned long)(cache_ptr->dLRU_list_len)); + (long)(cache_ptr->dLRU_list_len)); HDfprintf(stdout, "%s Total hits / misses / hit_rate = %ld / %ld / %f\n", @@ -645,38 +648,6 @@ H5C_stats(H5C_t * cache_ptr, (long long)(cache_ptr->LRU_scan_restarts), (long long)(cache_ptr->index_scan_restarts)); - HDfprintf(stdout, - "%s cache image creations/loads/size = %d / %d / %Hu\n", - cache_ptr->prefix, - cache_ptr->images_created, - cache_ptr->images_loaded, - cache_ptr->last_image_size); - - HDfprintf(stdout, - "%s prefetches / dirty prefetches = %lld / %lld\n", - cache_ptr->prefix, - (long long)(cache_ptr->prefetches), - (long long)(cache_ptr->dirty_prefetches)); - - HDfprintf(stdout, - "%s prefetch hits/flushes/evictions = %lld / %lld / %lld\n", - cache_ptr->prefix, - (long long)(cache_ptr->prefetch_hits), - (long long)(cache_ptr->flushes[H5AC_PREFETCHED_ENTRY_ID]), - (long long)(cache_ptr->evictions[H5AC_PREFETCHED_ENTRY_ID])); - - if(cache_ptr->prefetches > 0) - prefetch_use_rate = - (double)100.0f * ((double)(cache_ptr->prefetch_hits)) / - ((double)(cache_ptr->prefetches)); - else - prefetch_use_rate = 0.0f; - - HDfprintf(stdout, - "%s prefetched entry use rate = %lf\n", - cache_ptr->prefix, - prefetch_use_rate); - #if H5C_COLLECT_CACHE_ENTRY_STATS HDfprintf(stdout, "%s aggregate max / min accesses = %d / %d\n", @@ -702,7 +673,7 @@ H5C_stats(H5C_t * cache_ptr, HDfprintf(stdout, "%s Stats on %s:\n", cache_ptr->prefix, - ((cache_ptr->class_table_ptr))[i]->name); + ((cache_ptr->type_name_table_ptr))[i]); if((cache_ptr->hits[i] > 0) || (cache_ptr->misses[i] > 0)) hit_rate = (double)100.0f * ((double)(cache_ptr->hits[i])) / @@ -898,14 +869,6 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr) cache_ptr->LRU_scan_restarts = 0; cache_ptr->index_scan_restarts = 0; - cache_ptr->images_created = 0; - cache_ptr->images_loaded = 0; - cache_ptr->last_image_size = (hsize_t)0; - - cache_ptr->prefetches = 0; - cache_ptr->dirty_prefetches = 0; - cache_ptr->prefetch_hits = 0; - #if H5C_COLLECT_CACHE_ENTRY_STATS for(i = 0; i <= cache_ptr->max_type_id; i++) { cache_ptr->max_accesses[i] = 0; @@ -989,303 +952,6 @@ H5C__dump_entry(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, if(entry_ptr->flush_dep_nchildren) H5C__dump_children(cache_ptr, entry_ptr, FALSE, "Child", indent); } /* end H5C__dump_entry() */ - - -/*------------------------------------------------------------------------- - * Function: H5C_flush_dependency_exists() - * - * Purpose: Test to see if a flush dependency relationship exists - * between the supplied parent and child. Both parties - * are indicated by addresses so as to avoid the necessity - * of protect / unprotect calls prior to this call. - * - * If either the parent or the child is not in the metadata - * cache, the function sets *fd_exists_ptr to FALSE. - * - * If both are in the cache, the childs list of parents is - * searched for the proposed parent. If the proposed parent - * is found in the childs parent list, the function sets - * *fd_exists_ptr to TRUE. In all other non-error cases, - * the function sets *fd_exists_ptr FALSE. - * - * Return: SUCCEED on success/FAIL on failure. Note that - * *fd_exists_ptr is undefined on failure. - * - * Programmer: John Mainzer - * 9/28/16 - * - *------------------------------------------------------------------------- - */ -#ifndef NDEBUG -herr_t -H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child_addr, - hbool_t *fd_exists_ptr) -{ - hbool_t fd_exists = FALSE; /* whether flush dependency exists */ - H5C_cache_entry_t * parent_ptr; /* Ptr to parent entry */ - H5C_cache_entry_t * child_ptr; /* Ptr to child entry */ - hbool_t ret_value = FALSE; /* Return value */ - - FUNC_ENTER_NOAPI(NULL) - - /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(H5F_addr_defined(parent_addr)); - HDassert(H5F_addr_defined(child_addr)); - HDassert(fd_exists_ptr); - - H5C__SEARCH_INDEX(cache_ptr, parent_addr, parent_ptr, FAIL) - H5C__SEARCH_INDEX(cache_ptr, child_addr, child_ptr, FAIL) - - if(parent_ptr && child_ptr) { - HDassert(parent_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(child_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - - if(child_ptr->flush_dep_nparents > 0) { - unsigned u; /* Local index variable */ - - HDassert(child_ptr->flush_dep_parent); - HDassert(child_ptr->flush_dep_parent_nalloc >= child_ptr->flush_dep_nparents); - - for(u = 0; u < child_ptr->flush_dep_nparents; u++) { - if(child_ptr->flush_dep_parent[u] == parent_ptr) { - fd_exists = TRUE; - HDassert(parent_ptr->flush_dep_nchildren > 0); - break; - } /* end if */ - } /* end for */ - } /* end if */ - } /* end if */ - - *fd_exists_ptr = fd_exists; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_flush_dependency_exists() */ -#endif /* NDEBUG */ - - -/*------------------------------------------------------------------------- - * - * Function: H5C_validate_index_list - * - * Purpose: Debugging function that scans the index list for errors. - * - * If an error is detected, the function generates a - * diagnostic and returns FAIL. If no error is detected, - * the function returns SUCCEED. - * - * Return: FAIL if error is detected, SUCCEED otherwise. - * - * Programmer: John Mainzer, 9/16/16 - * - *------------------------------------------------------------------------- - */ -#ifndef NDEBUG -herr_t -H5C_validate_index_list(H5C_t *cache_ptr) -{ - H5C_cache_entry_t * entry_ptr = NULL; - uint32_t len = 0; - int32_t index_ring_len[H5C_RING_NTYPES]; - size_t size = 0; - size_t clean_size = 0; - size_t dirty_size = 0; - size_t index_ring_size[H5C_RING_NTYPES]; - size_t clean_index_ring_size[H5C_RING_NTYPES]; - size_t dirty_index_ring_size[H5C_RING_NTYPES]; - int i; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - - for(i = 0; i < H5C_RING_NTYPES; i++) { - index_ring_len[i] = 0; - index_ring_size[i] = 0; - clean_index_ring_size[i] = 0; - dirty_index_ring_size[i] = 0; - } /* end if */ - - if(((cache_ptr->il_head == NULL) || (cache_ptr->il_tail == NULL)) - && (cache_ptr->il_head != cache_ptr->il_tail)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointer validation failed") - - if((cache_ptr->index_len == 1) && ((cache_ptr->il_head != cache_ptr->il_tail) - || (cache_ptr->il_head == NULL) || (cache_ptr->il_head->size != cache_ptr->index_size))) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointer sanity checks failed") - - if((cache_ptr->index_len >= 1) - && ((cache_ptr->il_head == NULL) - || (cache_ptr->il_head->il_prev != NULL) - || (cache_ptr->il_tail == NULL) - || (cache_ptr->il_tail->il_next != NULL))) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list length sanity checks failed") - - entry_ptr = cache_ptr->il_head; - while(entry_ptr != NULL) { - if((entry_ptr != cache_ptr->il_head) - && ((entry_ptr->il_prev == NULL) || (entry_ptr->il_prev->il_next != entry_ptr))) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointers for entry are invalid") - - if((entry_ptr != cache_ptr->il_tail) - && ((entry_ptr->il_next == NULL) || (entry_ptr->il_next->il_prev != entry_ptr))) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointers for entry are invalid") - - HDassert(entry_ptr->ring > 0); - HDassert(entry_ptr->ring < H5C_RING_NTYPES); - - len++; - index_ring_len[entry_ptr->ring] += 1; - - size += entry_ptr->size; - index_ring_size[entry_ptr->ring] += entry_ptr->size; - - if(entry_ptr->is_dirty) { - dirty_size += entry_ptr->size; - dirty_index_ring_size[entry_ptr->ring] += entry_ptr->size; - } /* end if */ - else { - clean_size += entry_ptr->size; - clean_index_ring_size[entry_ptr->ring] += entry_ptr->size; - } /* end else */ - - entry_ptr = entry_ptr->il_next; - } /* end while */ - - if((cache_ptr->index_len != len) || (cache_ptr->il_len != len) - || (cache_ptr->index_size != size) || (cache_ptr->il_size != size) - || (cache_ptr->clean_index_size != clean_size) - || (cache_ptr->dirty_index_size != dirty_size) - || (clean_size + dirty_size != size)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index, clean and dirty sizes for cache are invalid") - - size = 0; - clean_size = 0; - dirty_size = 0; - for(i = 0; i < H5C_RING_NTYPES; i++) { - size += clean_index_ring_size[i] + dirty_index_ring_size[i]; - clean_size += clean_index_ring_size[i]; - dirty_size += dirty_index_ring_size[i]; - } /* end for */ - - if((cache_ptr->index_size != size) - || (cache_ptr->clean_index_size != clean_size) - || (cache_ptr->dirty_index_size != dirty_size)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index, clean and dirty sizes for cache are invalid") - -done: - if(ret_value != SUCCEED) - HDassert(0); - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_validate_index_list() */ -#endif /* NDEBUG */ - - -/*------------------------------------------------------------------------- - * - * Function: H5C_get_entry_ptr_from_addr() - * - * Purpose: Debugging function that attempts to look up an entry in the - * cache by its file address, and if found, returns a pointer - * to the entry in *entry_ptr_ptr. If the entry is not in the - * cache, *entry_ptr_ptr is set to NULL. - * - * WARNING: This call should be used only in debugging - * routines, and it should be avoided when - * possible. - * - * Further, if we ever multi-thread the cache, - * this routine will have to be either discarded - * or heavily re-worked. - * - * Finally, keep in mind that the entry whose - * pointer is obtained in this fashion may not - * be in a stable state. - * - * Note that this function is only defined if NDEBUG - * is not defined. - * - * As heavy use of this function is almost certainly a - * bad idea, the metadata cache tracks the number of - * successful calls to this function, and (if - * H5C_DO_SANITY_CHECKS is defined) displays any - * non-zero count on cache shutdown. - * - * Return: FAIL if error is detected, SUCCEED otherwise. - * - * Programmer: John Mainzer, 5/30/14 - * - *------------------------------------------------------------------------- - */ -#ifndef NDEBUG -herr_t -H5C_get_entry_ptr_from_addr(H5C_t *cache_ptr, haddr_t addr, void **entry_ptr_ptr) -{ - H5C_cache_entry_t * entry_ptr = NULL; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(H5F_addr_defined(addr)); - HDassert(entry_ptr_ptr); - - H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) - - if(entry_ptr == NULL) - /* the entry doesn't exist in the cache -- report this - * and quit. - */ - *entry_ptr_ptr = NULL; - else { - *entry_ptr_ptr = entry_ptr; - - /* increment call counter */ - (cache_ptr->get_entry_ptr_from_addr_counter)++; - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_get_entry_ptr_from_addr() */ -#endif /* NDEBUG */ - - -/*------------------------------------------------------------------------- - * Function: H5C_get_serialization_in_progress - * - * Purpose: Return the current value of - * cache_ptr->serialization_in_progress. - * - * Return: Current value of cache_ptr->serialization_in_progress. - * - * Programmer: John Mainzer - * 8/24/15 - * - *------------------------------------------------------------------------- - */ -#ifndef NDEBUG -hbool_t -H5C_get_serialization_in_progress(const H5C_t *cache_ptr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Sanity check */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - - FUNC_LEAVE_NOAPI(cache_ptr->serialization_in_progress) -} /* H5C_get_serialization_in_progress() */ -#endif /* NDEBUG */ - - /*------------------------------------------------------------------------- * * Function: H5C_cache_is_clean() @@ -1320,79 +986,12 @@ H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring) while(ring <= inner_ring) { if(cache_ptr->dirty_index_ring_size[ring] > 0) - HGOTO_DONE(FALSE) + ret_value = FALSE; ring++; } /* end while */ -done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_cache_is_clean() */ #endif /* NDEBUG */ - -/*------------------------------------------------------------------------- - * - * Function: H5C_verify_entry_type() - * - * Purpose: Debugging function that attempts to look up an entry in the - * cache by its file address, and if found, test to see if its - * type field contains the expted value. - * - * If the specified entry is in cache, *in_cache_ptr is set - * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending - * on whether the entries type field matches the expected_type - * parameter. - * - * If the target entry is not in cache, *in_cache_ptr is - * set to FALSE, and *type_ok_ptr is undefined. - * - * Note that this function is only defined if NDEBUG - * is not defined. - * - * Return: FAIL if error is detected, SUCCEED otherwise. - * - * Programmer: John Mainzer, 5/30/14 - * - *------------------------------------------------------------------------- - */ -#ifndef NDEBUG -herr_t -H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, - const H5C_class_t *expected_type, hbool_t *in_cache_ptr, - hbool_t *type_ok_ptr) -{ - H5C_cache_entry_t * entry_ptr = NULL; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(H5F_addr_defined(addr)); - HDassert(expected_type); - HDassert(in_cache_ptr); - HDassert(type_ok_ptr); - - H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) - - if(entry_ptr == NULL) - /* the entry doesn't exist in the cache -- report this - * and quit. - */ - *in_cache_ptr = FALSE; - else { - *in_cache_ptr = TRUE; - - if(entry_ptr->prefetched) - *type_ok_ptr = (expected_type->id == entry_ptr->prefetch_type_id); - else - *type_ok_ptr = (expected_type == entry_ptr->type); - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_verify_entry_type() */ -#endif /* NDEBUG */ - diff --git a/src/H5Cepoch.c b/src/H5Cepoch.c index 655d795..e576028 100644 --- a/src/H5Cepoch.c +++ b/src/H5Cepoch.c @@ -92,7 +92,8 @@ static herr_t H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, /*******************/ -const H5AC_class_t H5AC_EPOCH_MARKER[1] = {{ +const H5C_class_t H5C__epoch_marker_class = +{ /* id = */ H5AC_EPOCH_MARKER_ID, /* name = */ "epoch marker", /* mem_type = */ H5FD_MEM_DEFAULT, /* value doesn't matter */ @@ -107,7 +108,7 @@ const H5AC_class_t H5AC_EPOCH_MARKER[1] = {{ /* notify = */ H5C__epoch_marker_notify, /* free_icr = */ H5C__epoch_marker_free_icr, /* fsf_size = */ H5C__epoch_marker_fsf_size, -}}; +}; /*************************************************************************** diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index ebb98b3..ab94879 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -164,13 +164,38 @@ static herr_t H5C__collective_write(H5F_t *f, hid_t dxpl_id); * Programmer: John Mainzer * 3/17/10 * + * Changes: Ported code to detect next entry status changes as the + * the result of a flush from the serial code in the scan of + * the LRU. Also added code to detect and adapt to the + * removal from the cache of the next entry in the scan of + * the LRU. + * + * Note that at present, all of these changes should not + * be required as the operations on entries as they are + * flushed that can cause these condiditions are not premitted + * in the parallel case. However, Quincey indicates that + * this may change, and thus has requested the modification. + * + * Note the assert(FALSE) in the if statement whose body + * restarts the scan of the LRU. As the body of the if + * statement should be unreachable, it should never be + * triggered until the constraints on the parallel case + * are relaxed. Please remove the assertion at that time. + * + * Also added warning on the Pinned Entry List scan, as it + * is potentially subject to the same issue. As there is + * no cognate of this scan in the serial code, I don't have + * a fix to port to it. + * + * JRM -- 4/10/19 + * *------------------------------------------------------------------------- */ herr_t H5C_apply_candidate_list(H5F_t * f, hid_t dxpl_id, H5C_t * cache_ptr, - unsigned num_candidates, + int num_candidates, haddr_t * candidates_list_ptr, int mpi_rank, int mpi_size) @@ -180,19 +205,19 @@ H5C_apply_candidate_list(H5F_t * f, int i; int m; int n; - unsigned first_entry_to_flush; - unsigned last_entry_to_flush; - unsigned entries_to_clear = 0; - unsigned entries_to_flush = 0; - unsigned entries_to_flush_or_clear_last = 0; - unsigned entries_to_flush_collectively = 0; - unsigned entries_cleared = 0; - unsigned entries_flushed = 0; - unsigned entries_delayed = 0; - unsigned entries_flushed_or_cleared_last = 0; - unsigned entries_flushed_collectively = 0; - unsigned entries_examined = 0; - unsigned initial_list_len; + int first_entry_to_flush; + int last_entry_to_flush; + int entries_to_clear = 0; + int entries_to_flush = 0; + int entries_to_flush_or_clear_last = 0; + int entries_to_flush_collectively = 0; + int entries_cleared = 0; + int entries_flushed = 0; + int entries_delayed = 0; + int entries_flushed_or_cleared_last = 0; + int entries_flushed_collectively = 0; + int entries_examined = 0; + int initial_list_len; int * candidate_assignment_table = NULL; haddr_t addr; H5C_cache_entry_t * clear_ptr = NULL; @@ -206,30 +231,29 @@ H5C_apply_candidate_list(H5F_t * f, #if H5C_APPLY_CANDIDATE_LIST__DEBUG char tbl_buf[1024]; #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - /* Sanity checks */ - HDassert(cache_ptr != NULL); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(num_candidates > 0); - HDassert(num_candidates <= cache_ptr->slist_len); - HDassert(candidates_list_ptr != NULL); - HDassert(0 <= mpi_rank); - HDassert(mpi_rank < mpi_size); + HDassert( cache_ptr != NULL ); + HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + HDassert( num_candidates > 0 ); + HDassert( num_candidates <= cache_ptr->slist_len ); + HDassert( candidates_list_ptr != NULL ); + HDassert( 0 <= mpi_rank ); + HDassert( mpi_rank < mpi_size ); #if H5C_APPLY_CANDIDATE_LIST__DEBUG - HDfprintf(stdout, "%s:%d: setting up candidate assignment table.\n", FUNC, mpi_rank); - - HDmemset(tbl_buf, 0, sizeof(tbl_buf)); - + HDfprintf(stdout, "%s:%d: setting up candidate assignment table.\n", + FUNC, mpi_rank); + for ( i = 0; i < 1024; i++ ) tbl_buf[i] = '\0'; sprintf(&(tbl_buf[0]), "candidate list = "); - for(u = 0; u < num_candidates; u++) - sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " 0x%llx", (long long)(*(candidates_list_ptr + u))); + for ( i = 0; i < num_candidates; i++ ) + { + sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " 0x%llx", + (long long)(*(candidates_list_ptr + i))); + } sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n"); - HDfprintf(stdout, "%s", tbl_buf); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ @@ -245,6 +269,7 @@ H5C_apply_candidate_list(H5F_t * f, n = num_candidates / mpi_size; m = num_candidates % mpi_size; HDassert(n >= 0); + if(NULL == (candidate_assignment_table = (int *)H5MM_malloc(sizeof(int) * (size_t)(mpi_size + 1)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for candidate assignment table") @@ -272,8 +297,9 @@ H5C_apply_candidate_list(H5F_t * f, HDassert((candidate_assignment_table[mpi_size - 1] + n) == num_candidates); #if H5C_DO_SANITY_CHECKS - /* Verify that the candidate assignment table has the expected form */ - for(i = 1; i < mpi_size - 1; i++) { + /* verify that the candidate assignment table has the expected form */ + for ( i = 1; i < mpi_size - 1; i++ ) + { int a, b; a = candidate_assignment_table[i] - candidate_assignment_table[i - 1]; @@ -297,71 +323,73 @@ H5C_apply_candidate_list(H5F_t * f, sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n"); HDfprintf(stdout, "%s", tbl_buf); - HDfprintf(stdout, "%s:%d: flush entries [%u, %u].\n", + HDfprintf(stdout, "%s:%d: flush entries [%d, %d].\n", FUNC, mpi_rank, first_entry_to_flush, last_entry_to_flush); HDfprintf(stdout, "%s:%d: marking entries.\n", FUNC, mpi_rank); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ - for(u = 0; u < num_candidates; u++) { - addr = candidates_list_ptr[u]; - HDassert(H5F_addr_defined(addr)); + for(i = 0; i < num_candidates; i++) { + addr = candidates_list_ptr[i]; + HDassert( H5F_addr_defined(addr) ); #if H5C_DO_SANITY_CHECKS - if(u > 0) { - if(last_addr == addr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "duplicate entry in cleaned list") - else if(last_addr > addr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "candidate list not sorted") - } /* end if */ + if ( i > 0 ) { + if ( last_addr == addr ) { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Duplicate entry in cleaned list.\n") + } else if ( last_addr > addr ) { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "candidate list not sorted.\n") + } + } last_addr = addr; #endif /* H5C_DO_SANITY_CHECKS */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) - if(entry_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "listed candidate entry not in cache?!?!?") - if(!entry_ptr->is_dirty) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not dirty?!?!?") - if(entry_ptr->is_protected) + if(entry_ptr == NULL) { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed candidate entry not in cache?!?!?.") + } else if(!entry_ptr->is_dirty) { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not dirty?!?!?.") + } else if ( entry_ptr->is_protected ) { /* For now at least, we can't deal with protected entries. * If we encounter one, scream and die. If it becomes an * issue, we should be able to work around this. */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry is protected?!?!?") - - /* Determine whether the entry is to be cleared or flushed, - * and mark it accordingly. We will scan the protected and - * pinned list shortly, and clear or flush according to these - * markings. - */ - if(u >= first_entry_to_flush && u <= last_entry_to_flush) { - entries_to_flush++; - entry_ptr->flush_immediately = TRUE; - } /* end if */ - else { - entries_to_clear++; - entry_ptr->clear_on_unprotect = TRUE; + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry is protected?!?!?.") + } else { + /* determine whether the entry is to be cleared or flushed, + * and mark it accordingly. We will scan the protected and + * pinned list shortly, and clear or flush according to these + * markings. + */ + if((i >= first_entry_to_flush) && (i <= last_entry_to_flush)) { + entries_to_flush++; + entry_ptr->flush_immediately = TRUE; + } /* end if */ + else { + entries_to_clear++; + entry_ptr->clear_on_unprotect = TRUE; + } /* end else */ + + /* Entries marked as collectively accessed and are in the + candidate list to clear from the cache have to be + removed from the coll list. This is OK since the + candidate list is collective and uniform across all + ranks. */ + if(TRUE == entry_ptr->coll_access) { + entry_ptr->coll_access = FALSE; + H5C__REMOVE_FROM_COLL_LIST(cache_ptr, entry_ptr, FAIL) + } /* end if */ } /* end else */ - - /* Entries marked as collectively accessed and are in the - * candidate list to clear from the cache have to be - * removed from the coll list. This is OK since the - * candidate list is collective and uniform across all - * ranks. - */ - if(entry_ptr->coll_access) { - entry_ptr->coll_access = FALSE; - H5C__REMOVE_FROM_COLL_LIST(cache_ptr, entry_ptr, FAIL) - } /* end if */ } /* end for */ #if H5C_APPLY_CANDIDATE_LIST__DEBUG - HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %u/%u/%u.\n", - FUNC, mpi_rank, num_candidates, entries_to_clear, - entries_to_flush); + HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %d/%d/%d.\n", + FUNC, mpi_rank, (int)num_candidates, (int)entries_to_clear, + (int)entries_to_flush); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ + /* We have now marked all the entries on the candidate list for * either flush or clear -- now scan the LRU and the pinned list * for these entries and do the deed. @@ -558,7 +586,7 @@ H5C_apply_candidate_list(H5F_t * f, } /* end while */ #if H5C_APPLY_CANDIDATE_LIST__DEBUG - HDfprintf(stdout, "%s:%d: entries examined/cleared/flushed = %u/%u/%u.\n", + HDfprintf(stdout, "%s:%d: entries examined/cleared/flushed = %d/%d/%d.\n", FUNC, mpi_rank, entries_examined, entries_cleared, entries_flushed); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ @@ -685,7 +713,7 @@ H5C_apply_candidate_list(H5F_t * f, #if H5C_APPLY_CANDIDATE_LIST__DEBUG HDfprintf(stdout, - "%s:%d: pel entries examined/cleared/flushed = %u/%u/%u.\n", + "%s:%d: pel entries examined/cleared/flushed = %d/%d/%d.\n", FUNC, mpi_rank, entries_examined, entries_cleared, entries_flushed); HDfprintf(stdout, "%s:%d: done.\n", FUNC, mpi_rank); @@ -730,7 +758,7 @@ H5C_apply_candidate_list(H5F_t * f, /* Write collective list */ if(H5C__collective_write(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "can't write metadata collectively") + HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "Can't write metadata collectively") } /* end if */ /* ====================================================================== * @@ -746,11 +774,12 @@ H5C_apply_candidate_list(H5F_t * f, (entries_cleared != entries_to_clear) || (entries_flushed_or_cleared_last != entries_to_flush_or_clear_last) || (entries_flushed_collectively != entries_to_flush_collectively)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry count mismatch") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry count mismatch.") done: if(candidate_assignment_table != NULL) candidate_assignment_table = (int *)H5MM_xfree((void *)candidate_assignment_table); + if(cache_ptr->coll_write_list) { if(H5SL_close(cache_ptr->coll_write_list) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "failed to destroy skip list") @@ -807,7 +836,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) if(space_needed > 0) { /* we have work to do */ H5C_cache_entry_t *entry_ptr; - unsigned nominated_entries_count = 0; + int nominated_entries_count = 0; size_t nominated_entries_size = 0; haddr_t nominated_addr; @@ -828,7 +857,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) nominated_addr = entry_ptr->addr; if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed(1).") nominated_entries_size += entry_ptr->size; nominated_entries_count++; @@ -852,7 +881,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) nominated_addr = entry_ptr->addr; if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed(2).") nominated_entries_size += entry_ptr->size; nominated_entries_count++; @@ -921,7 +950,7 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr) if(space_needed > 0) { /* we have work to do */ H5C_cache_entry_t *entry_ptr; - unsigned nominated_entries_count = 0; + int nominated_entries_count = 0; size_t nominated_entries_size = 0; HDassert( cache_ptr->slist_len > 0 ); @@ -944,7 +973,7 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr) nominated_addr = entry_ptr->addr; if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed.") nominated_entries_size += entry_ptr->size; nominated_entries_count++; @@ -988,28 +1017,51 @@ done: * Programmer: John Mainzer * 7/5/05 * + * Changes: Tidied up code, removeing some old commented out + * code that had been left in pending success of the + * new version. + * + * Note that unlike H5C_apply_candidate_list(), + * H5C_mark_entries_as_clean() makes all its calls to + * H5C__flush_single_entry() with the + * H5C__FLUSH_CLEAR_ONLY_FLAG set. As a result, + * the pre_serialize() and serialize calls are not made. + * + * This then implies that (assuming such actions were + * permitted in the parallel case) no loads, dirties, + * resizes, or removals of other entries can occur as + * a side effect of the flush. Hence, there is no need + * for the checks for entry removal / status change + * that I ported to H5C_apply_candidate_list(). + * + * However, if (in addition to allowing such operations + * in the parallel case), we allow such operations outside + * of the pre_serialize / serialize routines, this may + * cease to be the case -- requiring a review of this + * function. + * *------------------------------------------------------------------------- */ herr_t H5C_mark_entries_as_clean(H5F_t * f, hid_t dxpl_id, - unsigned ce_array_len, + int32_t ce_array_len, haddr_t * ce_array_ptr) { H5C_t * cache_ptr; - unsigned entries_cleared; - unsigned entries_examined; - unsigned initial_list_len; + int entries_cleared; + int entries_examined; + int i; + int initial_list_len; haddr_t addr; #if H5C_DO_SANITY_CHECKS - unsigned pinned_entries_marked = 0; - unsigned protected_entries_marked = 0; - unsigned other_entries_marked = 0; + int pinned_entries_marked = 0; + int protected_entries_marked = 0; + int other_entries_marked = 0; haddr_t last_addr; #endif /* H5C_DO_SANITY_CHECKS */ H5C_cache_entry_t * clear_ptr = NULL; H5C_cache_entry_t * entry_ptr = NULL; - unsigned u; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1024,30 +1076,46 @@ H5C_mark_entries_as_clean(H5F_t * f, HDassert( ce_array_ptr != NULL ); #if H5C_DO_EXTREME_SANITY_CHECKS - if(H5C_validate_protected_entry_list(cache_ptr) < 0 || - H5C_validate_pinned_entry_list(cache_ptr) < 0 || - H5C_validate_lru_list(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed on entry.\n"); + } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ - for(u = 0; u < ce_array_len; u++) { - addr = ce_array_ptr[u]; + for ( i = 0; i < ce_array_len; i++ ) + { + addr = ce_array_ptr[i]; #if H5C_DO_SANITY_CHECKS - if(u == 0) + if ( i == 0 ) { + last_addr = addr; - else { - if(last_addr == addr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Duplicate entry in cleaned list") - if(last_addr > addr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cleaned list not sorted") - } /* end else */ + + } else { + + if ( last_addr == addr ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Duplicate entry in cleaned list.\n"); + + } else if ( last_addr > addr ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "cleaned list not sorted.\n"); + } + } #if H5C_DO_EXTREME_SANITY_CHECKS - if(H5C_validate_protected_entry_list(cache_ptr) < 0 - || H5C_validate_pinned_entry_list(cache_ptr) < 0 - || H5C_validate_lru_list(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed in for loop") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed in for loop.\n"); + } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ #endif /* H5C_DO_SANITY_CHECKS */ @@ -1055,24 +1123,28 @@ H5C_mark_entries_as_clean(H5F_t * f, H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) - if(entry_ptr == NULL) { + if ( entry_ptr == NULL ) { #if H5C_DO_SANITY_CHECKS HDfprintf(stdout, - "H5C_mark_entries_as_clean: entry[%u] = %a not in cache.\n", - u, - addr); + "H5C_mark_entries_as_clean: entry[%d] = %ld not in cache.\n", + (int)i, + (long)addr); #endif /* H5C_DO_SANITY_CHECKS */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not in cache?!?!?") - } /* end if */ - else if(!entry_ptr->is_dirty) { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Listed entry not in cache?!?!?.") + + } else if ( ! entry_ptr->is_dirty ) { + #if H5C_DO_SANITY_CHECKS HDfprintf(stdout, - "H5C_mark_entries_as_clean: entry %a is not dirty!?!\n", - addr); + "H5C_mark_entries_as_clean: entry %ld is not dirty!?!\n", + (long)addr); #endif /* H5C_DO_SANITY_CHECKS */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not dirty?!?!?") - } /* end else-if */ - else { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Listed entry not dirty?!?!?.") + + } else { + /* Mark the entry to be cleared on unprotect. We will * scan the LRU list shortly, and clear all those entries * not currently protected. @@ -1128,25 +1200,31 @@ H5C_mark_entries_as_clean(H5F_t * f, * point. * JRM -- 4/7/15 */ + entries_cleared = 0; entries_examined = 0; initial_list_len = cache_ptr->LRU_list_len; entry_ptr = cache_ptr->LRU_tail_ptr; - while(entry_ptr != NULL && entries_examined <= initial_list_len && - entries_cleared < ce_array_len) { - if(entry_ptr->clear_on_unprotect) { + + while ( ( entry_ptr != NULL ) && + ( entries_examined <= initial_list_len ) && + ( entries_cleared < ce_array_len ) ) + { + if ( entry_ptr->clear_on_unprotect ) { + entry_ptr->clear_on_unprotect = FALSE; clear_ptr = entry_ptr; entry_ptr = entry_ptr->prev; entries_cleared++; if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear entry") - } /* end if */ - else + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry.") + } else { + entry_ptr = entry_ptr->prev; + } entries_examined++; - } /* end while */ + } #if H5C_DO_SANITY_CHECKS HDassert( entries_cleared == other_entries_marked ); @@ -1155,20 +1233,25 @@ H5C_mark_entries_as_clean(H5F_t * f, /* It is also possible that some of the cleared entries are on the * pinned list. Must scan that also. */ + entry_ptr = cache_ptr->pel_head_ptr; - while(entry_ptr != NULL) { - if(entry_ptr->clear_on_unprotect) { + + while ( entry_ptr != NULL ) + { + if ( entry_ptr->clear_on_unprotect ) { + entry_ptr->clear_on_unprotect = FALSE; clear_ptr = entry_ptr; entry_ptr = entry_ptr->next; entries_cleared++; - if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry") - } /* end if */ - else + if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry.") + } else { + entry_ptr = entry_ptr->next; - } /* end while */ + } + } #if H5C_DO_SANITY_CHECKS HDassert( entries_cleared == pinned_entries_marked + other_entries_marked ); @@ -1179,28 +1262,33 @@ H5C_mark_entries_as_clean(H5F_t * f, ( (ce_array_len - entries_cleared) <= cache_ptr->pl_len ) ); #if H5C_DO_SANITY_CHECKS - u = 0; + i = 0; entry_ptr = cache_ptr->pl_head_ptr; while ( entry_ptr != NULL ) { if ( entry_ptr->clear_on_unprotect ) { - u++; + i++; } entry_ptr = entry_ptr->next; } - HDassert( (entries_cleared + u) == ce_array_len ); + HDassert( (entries_cleared + i) == ce_array_len ); #endif /* H5C_DO_SANITY_CHECKS */ done: + #if H5C_DO_EXTREME_SANITY_CHECKS - if(H5C_validate_protected_entry_list(cache_ptr) < 0 - || H5C_validate_pinned_entry_list(cache_ptr) < 0 - || H5C_validate_lru_list(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed on exit.\n"); + } #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) + } /* H5C_mark_entries_as_clean() */ @@ -1221,7 +1309,7 @@ done: herr_t H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial) { - uint32_t clear_cnt; + int32_t clear_cnt; H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; @@ -1411,3 +1499,4 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5C__collective_write() */ #endif /* H5_HAVE_PARALLEL */ + diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 5b923e9..6e37bca 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -209,6 +209,7 @@ if ( ( (entry_ptr) == NULL ) || \ ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (head_ptr) != (tail_ptr) ) \ ) || \ + ( (len) < 0 ) || \ ( ( (len) == 1 ) && \ ( ( (head_ptr) != (tail_ptr) ) || \ ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ @@ -374,6 +375,7 @@ if ( ( (entry_ptr) == NULL ) || \ ( ( ( (hd_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (hd_ptr) != (tail_ptr) ) \ ) || \ + ( (len) < 0 ) || \ ( ( (len) == 1 ) && \ ( ( (hd_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (Size) ) \ @@ -481,7 +483,7 @@ if ( ( (hd_ptr) == NULL ) || \ ) \ ) \ ) { \ - HDassert(0 && "il DLL pre remove SC failed"); \ + HDassert(0 && "il DLL pre remove SC failed"); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "il DLL pre remove SC failed") \ } @@ -492,6 +494,7 @@ if ( ( (entry_ptr) == NULL ) || \ ( ( ( (hd_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (hd_ptr) != (tail_ptr) ) \ ) || \ + ( (len) < 0 ) || \ ( ( (len) == 1 ) && \ ( ( (hd_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (Size) ) \ @@ -503,7 +506,7 @@ if ( ( (entry_ptr) == NULL ) || \ ) \ ) \ ) { \ - HDassert(0 && "IL DLL pre insert SC failed"); \ + HDassert(0 && "IL DLL pre insert SC failed"); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "IL DLL pre insert SC failed") \ } @@ -511,6 +514,7 @@ if ( ( (entry_ptr) == NULL ) || \ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (head_ptr) != (tail_ptr) ) \ ) || \ + ( (len) < 0 ) || \ ( ( (len) == 1 ) && \ ( ( (head_ptr) != (tail_ptr) ) || \ ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ @@ -522,7 +526,7 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ) \ ) \ ) { \ - HDassert(0 && "IL DLL sanity check failed"); \ + HDassert(0 && "IL DLL sanity check failed"); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "IL DLL sanity check failed") \ } @@ -595,6 +599,23 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ * H5C__UPDATE_CACHE_HIT_RATE_STATS(), which is always active as * the cache hit rate stats are always collected and available. * + * Changes: + * + * JRM -- 3/21/06 + * Added / updated macros for pinned entry related stats. + * + * JRM -- 8/9/06 + * More pinned entry stats related updates. + * + * JRM -- 3/31/07 + * Updated H5C__UPDATE_STATS_FOR_PROTECT() to keep stats on + * read and write protects. + * + * MAM -- 1/15/09 + * Created H5C__UPDATE_MAX_INDEX_SIZE_STATS to contain + * common code within macros that update the maximum + * index, clean_index, and dirty_index statistics fields. + * ***********************************************************************/ #define H5C__UPDATE_CACHE_HIT_RATE_STATS(cache_ptr, hit) \ @@ -681,31 +702,6 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ #define H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr) \ ((cache_ptr)->index_scan_restarts)++; -#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr) \ -{ \ - (cache_ptr)->images_created++; \ -} - -#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr) \ -{ \ - /* make sure image len is still good */ \ - HDassert((cache_ptr)->image_len > 0); \ - (cache_ptr)->images_loaded++; \ - (cache_ptr)->last_image_size = (cache_ptr)->image_len; \ -} - -#define H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, dirty) \ -{ \ - (cache_ptr)->prefetches++; \ - if ( dirty ) \ - (cache_ptr)->dirty_prefetches++; \ -} - -#define H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr) \ -{ \ - (cache_ptr)->prefetch_hits++; \ -} - #if H5C_COLLECT_CACHE_ENTRY_STATS #define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) \ @@ -930,10 +926,6 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ #define H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) #define H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) #define H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr) -#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr) -#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr) -#define H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, dirty) -#define H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr) #endif /* H5C_COLLECT_CACHE_STATS */ @@ -1007,7 +999,8 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "pre HT insert SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ + "Pre HT insert SC failed") \ } #define H5C__POST_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) \ @@ -1029,7 +1022,8 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "post HT insert SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ + "Post HT insert SC failed") \ } #define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) \ @@ -1070,7 +1064,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "pre HT remove SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Pre HT remove SC failed") \ } #define H5C__POST_HT_REMOVE_SC(cache_ptr, entry_ptr) \ @@ -1096,7 +1090,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "post HT remove SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Post HT remove SC failed") \ } /* (Keep in sync w/H5C_TEST__PRE_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ @@ -1108,7 +1102,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( ! H5F_addr_defined(Addr) ) || \ ( H5C__HASH_FCN(Addr) < 0 ) || \ ( H5C__HASH_FCN(Addr) >= H5C__HASH_TABLE_LEN ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "pre HT search SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "Pre HT search SC failed") \ } /* (Keep in sync w/H5C_TEST__POST_SUC_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ @@ -1130,7 +1124,8 @@ if ( ( (cache_ptr) == NULL ) || \ ( (entry_ptr)->ht_prev->ht_next != (entry_ptr) ) ) || \ ( ( (entry_ptr)->ht_next != NULL ) && \ ( (entry_ptr)->ht_next->ht_prev != (entry_ptr) ) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "post successful HT search SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ + "Post successful HT search SC failed") \ } /* (Keep in sync w/H5C_TEST__POST_HT_SHIFT_TO_FRONT macro in test/cache_common.h -QAK) */ @@ -1138,7 +1133,8 @@ if ( ( (cache_ptr) == NULL ) || \ if ( ( (cache_ptr) == NULL ) || \ ( ((cache_ptr)->index)[k] != (entry_ptr) ) || \ ( (entry_ptr)->ht_prev != NULL ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "post HT shift to front SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, \ + "Post HT shift to front SC failed") \ } #define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ @@ -1173,7 +1169,8 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "pre HT entry size change SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Pre HT entry size change SC failed") \ } #define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ @@ -1203,7 +1200,8 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "post HT entry size change SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Post HT entry size change SC failed") \ } #define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ @@ -1230,7 +1228,8 @@ if ( \ ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "pre HT update for entry clean SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Pre HT update for entry clean SC failed") \ } #define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ @@ -1257,7 +1256,8 @@ if ( \ ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "pre HT update for entry dirty SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Pre HT update for entry dirty SC failed") \ } #define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ @@ -1273,7 +1273,8 @@ if ( ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "post HT update for entry clean SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Post HT update for entry clean SC failed") \ } #define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ @@ -1289,7 +1290,8 @@ if ( ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "post HT update for entry dirty SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Post HT update for entry dirty SC failed") \ } #else /* H5C_DO_SANITY_CHECKS */ @@ -1590,7 +1592,8 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->slist_size ); \ \ if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) < 0) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), "can't insert entry in skip list") \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ + "Can't insert entry in skip list") \ \ (entry_ptr)->in_slist = TRUE; \ (cache_ptr)->slist_changed = TRUE; \ @@ -1625,7 +1628,8 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->slist_size ); \ \ if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) < 0) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), "can't insert entry in skip list") \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ + "Can't insert entry in skip list") \ \ (entry_ptr)->in_slist = TRUE; \ (cache_ptr)->slist_changed = TRUE; \ @@ -1677,7 +1681,8 @@ if ( ( (cache_ptr)->index_size != \ \ if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ != (entry_ptr) ) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "can't delete entry from skip list") \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \ + "Can't delete entry from skip list.") \ \ HDassert( (cache_ptr)->slist_len > 0 ); \ if(!(during_flush)) \ @@ -1714,7 +1719,8 @@ if ( ( (cache_ptr)->index_size != \ \ if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ != (entry_ptr) ) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "can't delete entry from skip list") \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \ + "Can't delete entry from skip list.") \ \ HDassert( (cache_ptr)->slist_len > 0 ); \ if(!(during_flush)) \ @@ -2233,120 +2239,6 @@ if ( ( (cache_ptr)->index_size != \ /*------------------------------------------------------------------------- * - * Macro: H5C__UPDATE_RP_FOR_INSERT_APPEND - * - * Purpose: Update the replacement policy data structures for an - * insertion of the specified cache entry. - * - * Unlike H5C__UPDATE_RP_FOR_INSERTION below, mark the - * new entry as the LEAST recently used entry, not the - * most recently used. - * - * For now at least, this macro should only be used in - * the reconstruction of the metadata cache from a cache - * image block. - * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. - * - * Return: N/A - * - * Programmer: John Mainzer, 8/15/15 - * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__UPDATE_RP_FOR_INSERT_APPEND(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the tail of the LRU list. */ \ - \ - H5C__DLL_APPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* insert the entry at the tail of the clean or dirty LRU list as \ - * appropriate. \ - */ \ - \ - if ( entry_ptr->is_dirty ) { \ - H5C__AUX_DLL_APPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - } else { \ - H5C__AUX_DLL_APPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ -} - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__UPDATE_RP_FOR_INSERT_APPEND(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( (entry_ptr)->is_pinned ) { \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, (fail_val)) \ - \ - } else { \ - \ - /* modified LRU specific code */ \ - \ - /* insert the entry at the tail of the LRU list. */ \ - \ - H5C__DLL_APPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - - -/*------------------------------------------------------------------------- - * * Macro: H5C__UPDATE_RP_FOR_INSERTION * * Purpose: Update the replacement policy data structures for an @@ -2545,6 +2437,7 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->pel_tail_ptr, \ (cache_ptr)->pel_len, \ (cache_ptr)->pel_size, (fail_val)) \ + HDassert( (cache_ptr)->pel_len >= 0 ); \ \ } else { \ \ @@ -2607,6 +2500,7 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->pel_tail_ptr, \ (cache_ptr)->pel_len, \ (cache_ptr)->pel_size, (fail_val)) \ + HDassert( (cache_ptr)->pel_len >= 0 ); \ \ } else { \ \ @@ -2950,40 +2844,41 @@ if ( ( (cache_ptr)->index_size != \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ (cache_ptr)->pel_tail_ptr, (cache_ptr)->pel_len, \ (cache_ptr)->pel_size, (fail_val)) \ + HDassert( (cache_ptr)->pel_len >= 0 ); \ \ - /* modified LRU specific code */ \ + /* modified LRU specific code */ \ \ - /* insert the entry at the head of the LRU list. */ \ + /* insert the entry at the head of the LRU list. */ \ \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ + H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ + (cache_ptr)->LRU_tail_ptr, \ + (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, (fail_val)) \ \ - /* Similarly, insert the entry at the head of either the clean \ - * or dirty LRU list as appropriate. \ - */ \ + /* Similarly, insert the entry at the head of either the clean \ + * or dirty LRU list as appropriate. \ + */ \ \ - if ( (entry_ptr)->is_dirty ) { \ + if ( (entry_ptr)->is_dirty ) { \ \ - H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, \ - (fail_val)) \ + H5C__AUX_DLL_PREPEND((entry_ptr), \ + (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_tail_ptr, \ + (cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, \ + (fail_val)) \ \ - } else { \ + } else { \ \ - H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, \ - (fail_val)) \ - } \ + H5C__AUX_DLL_PREPEND((entry_ptr), \ + (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_tail_ptr, \ + (cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, \ + (fail_val)) \ + } \ \ - /* End modified LRU specific code. */ \ + /* End modified LRU specific code. */ \ \ } /* H5C__UPDATE_RP_FOR_UNPIN */ @@ -3006,6 +2901,7 @@ if ( ( (cache_ptr)->index_size != \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ (cache_ptr)->pel_tail_ptr, (cache_ptr)->pel_len, \ (cache_ptr)->pel_size, (fail_val)) \ + HDassert( (cache_ptr)->pel_len >= 0 ); \ \ /* modified LRU specific code */ \ \ @@ -3178,22 +3074,22 @@ if ( ( (hd_ptr) == NULL ) || \ ( (len) <= 0 ) || \ ( (Size) < (entry_ptr)->size ) || \ ( ( (Size) == (entry_ptr)->size ) && ( ! ( (len) == 1 ) ) ) || \ - ( ( (entry_ptr)->coll_prev == NULL ) && ( (hd_ptr) != (entry_ptr) ) ) || \ + ( ( (entry_ptr)->coll_prev == NULL ) && ( (hd_ptr) != (entry_ptr) ) ) || \ ( ( (entry_ptr)->coll_next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) || \ ( ( (len) == 1 ) && \ ( ! ( ( (hd_ptr) == (entry_ptr) ) && ( (tail_ptr) == (entry_ptr) ) && \ - ( (entry_ptr)->coll_next == NULL ) && \ - ( (entry_ptr)->coll_prev == NULL ) && \ + ( (entry_ptr)->coll_next == NULL ) && \ + ( (entry_ptr)->coll_prev == NULL ) && \ ( (Size) == (entry_ptr)->size ) \ ) \ ) \ ) \ ) { \ - HDassert(0 && "coll DLL pre remove SC failed"); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "coll DLL pre remove SC failed") \ + HDassert(0 && "coll DLL pre remove SC failed"); \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "coll DLL pre remove SC failed") \ } -#define H5C__COLL_DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ +#define H5C__COLL_DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (head_ptr) != (tail_ptr) ) \ ) || \ @@ -3205,35 +3101,36 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ) \ ) || \ ( ( (len) >= 1 ) && \ - ( ( (head_ptr) == NULL ) || ( (head_ptr)->coll_prev != NULL ) || \ - ( (tail_ptr) == NULL ) || ( (tail_ptr)->coll_next != NULL ) \ + ( ( (head_ptr) == NULL ) || ( (head_ptr)->coll_prev != NULL ) || \ + ( (tail_ptr) == NULL ) || ( (tail_ptr)->coll_next != NULL ) \ ) \ ) \ ) { \ - HDassert(0 && "COLL DLL sanity check failed"); \ + HDassert(0 && "COLL DLL sanity check failed"); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "COLL DLL sanity check failed") \ } #define H5C__COLL_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ if ( ( (entry_ptr) == NULL ) || \ - ( (entry_ptr)->coll_next != NULL ) || \ - ( (entry_ptr)->coll_prev != NULL ) || \ + ( (entry_ptr)->coll_next != NULL ) || \ + ( (entry_ptr)->coll_prev != NULL ) || \ ( ( ( (hd_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (hd_ptr) != (tail_ptr) ) \ ) || \ + ( (len) < 0 ) || \ ( ( (len) == 1 ) && \ ( ( (hd_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (Size) ) \ ) \ ) || \ ( ( (len) >= 1 ) && \ - ( ( (hd_ptr) == NULL ) || ( (hd_ptr)->coll_prev != NULL ) || \ - ( (tail_ptr) == NULL ) || ( (tail_ptr)->coll_next != NULL ) \ + ( ( (hd_ptr) == NULL ) || ( (hd_ptr)->coll_prev != NULL ) || \ + ( (tail_ptr) == NULL ) || ( (tail_ptr)->coll_next != NULL ) \ ) \ ) \ ) { \ - HDassert(0 && "COLL DLL pre insert SC failed"); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "COLL DLL pre insert SC failed") \ + HDassert(0 && "COLL DLL pre insert SC failed"); \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "COLL DLL pre insert SC failed") \ } #else /* H5C_DO_SANITY_CHECKS */ @@ -3536,8 +3433,10 @@ typedef struct H5C_tag_info_t { * types are stored in the type_name_table discussed below, and * indexed by the ids. * - * class_table_ptr: Pointer to an array of H5C_class_t of length - * max_type_id + 1. Entry classes for the cache. + * type_name_table_ptr: Pointer to an array of pointer to char of length + * max_type_id + 1. The strings pointed to by the entries + * in the array are the names of the entry types associated + * with the indexing type IDs. * * max_cache_size: Nominal maximum number of bytes that may be stored in the * cache. This value should be viewed as a soft limit, as the @@ -4087,22 +3986,7 @@ typedef struct H5C_tag_info_t { * * size_decreased: Boolean flag set to TRUE whenever the maximum cache * size is decreased. The flag triggers a call to - * H5C__make_space_in_cache() on the next call to H5C_protect(). - * - * resize_in_progress: As the metadata cache has become re-entrant, it is - * possible that a protect may trigger a call to - * H5C__auto_adjust_cache_size(), which may trigger a flush, - * which may trigger a protect, which will result in another - * call to H5C__auto_adjust_cache_size(). - * - * The resize_in_progress boolean flag is used to detect this, - * and to prevent the infinite recursion that would otherwise - * occur. - * - * Note that this issue is not hypothetical -- this field - * was added 12/29/15 to fix a bug exposed in the testing - * of changes to the file driver info superblock extension - * management code needed to support rings. + * H5C_make_space_in_cache() on the next call to H5C_protect(). * * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration * data for automatic cache resizing. @@ -4179,77 +4063,6 @@ typedef struct H5C_tag_info_t { * this field will be reset every automatic resize epoch. * * - * Metadata cache image management related fields. - * - * image_ctl: Instance of H5C_cache_image_ctl_t containing configuration - * data for generation of a cache image on file close. - * - * serialization_in_progress: Boolean field that is set to TRUE iff - * the cache is in the process of being serialized. This - * field is needed to support the H5C_serialization_in_progress() - * call, which is in turn required for sanity checks in some - * cache clients. - * - * load_image: Boolean flag indicating that the metadata cache image - * superblock extension message exists and should be - * read, and the image block read and decoded on the next - * call to H5C_protect(). - * - * image_loaded: Boolean flag indicating that the metadata cache has - * loaded the metadata cache image as directed by the - * MDC cache image superblock extension message. - * - * delete_image: Boolean flag indicating whether the metadata cache image - * superblock message should be deleted and the cache image - * file space freed after they have been read and decoded. - * - * This flag should be set to TRUE iff the file is opened - * R/W and there is a cache image to be read. - * - * image_addr: haddr_t containing the base address of the on disk - * metadata cache image, or HADDR_UNDEF if that value is - * undefined. Note that this field is used both in the - * construction and write, and the read and decode of - * metadata cache image blocks. - * - * image_len: hsize_t containing the size of the on disk metadata cache - * image, or zero if that value is undefined. Note that this - * field is used both in the construction and write, and the - * read and decode of metadata cache image blocks. - * - * image_data_len: size_t containing the number of bytes of data in the - * on disk metadata cache image, or zero if that value is - * undefined. - * - * In most cases, this value is the same as the image_len - * above. It exists to allow for metadata cache image blocks - * that are larger than the actual image. Thus in all - * cases image_data_len <= image_len. - * - * To create the metadata cache image, we must first serialize all the - * entries in the metadata cache. This is done by a scan of the index. - * As entries must be serialized in increasing flush dependency height - * order, we scan the index repeatedly, once for each flush dependency - * height in increasing order. - * - * This operation is complicated by the fact that entries other the the - * target may be inserted, loaded, relocated, or removed from the cache - * (either by eviction or the take ownership flag) as the result of a - * pre_serialize or serialize callback. While entry removals are not - * a problem for the scan of the index, insertions, loads, and relocations - * are. Hence the entries loaded, inserted, and relocated counters - * listed below have been implemented to allow these conditions to be - * detected and dealt with by restarting the scan. - * - * The serialization operation is further complicated by the fact that - * the flush dependency height of a given entry may increase (as the - * result of an entry load or insert) or decrease (as the result of an - * entry removal -- via either eviction or the take ownership flag). The - * entry_fd_height_change_counter field is maintained to allow detection - * of this condition, and a restart of the scan when it occurs. - * - * Note that all these new fields would work just as well as booleans. - * * entries_loaded_counter: Number of entries loaded into the cache * since the last time this field was reset. * @@ -4259,29 +4072,6 @@ typedef struct H5C_tag_info_t { * entries relocated_counter: Number of entries whose base address has * been changed since the last time this field was reset. * - * entry_fd_height_change_counter: Number of entries whose flush dependency - * height has changed since the last time this field was reset. - * - * The following fields are used assemble the cache image prior to - * writing it to disk. - * - * num_entries_in_image: Unsigned integer field containing the number of entries - * to be copied into the metadata cache image. Note that - * this value will be less than the number of entries in - * the cache, and the superblock and its related entries - * are not written to the metadata cache image. - * - * image_entries: Pointer to a dynamically allocated array of instance of - * H5C_image_entry_t of length num_entries_in_image, or NULL - * if that array does not exist. This array is used to - * assemble entry data to be included in the image, and to - * sort them by flush dependency height and LRU rank. - * - * image_buffer: Pointer to the dynamically allocated buffer of length - * image_len in which the metadata cache image is assembled, - * or NULL if that buffer does not exist. - * - * * Free Space Manager Related fields: * * The free space managers must be informed when we are about to close @@ -4290,10 +4080,10 @@ typedef struct H5C_tag_info_t { * page buffering, this is no longer viable, as we must finalize the on * disk image of all metadata much sooner. * - * This is handled by the H5MF_settle_raw_data_fsm() and - * H5MF_settle_meta_data_FSM() routines. As these calls are expensive, + * This is handled by the H5FS_settle_raw_data_fsm() and + * H5FS_settle_meta_data_fsm() routines. As these calls are expensive, * the following fields are used to track whether the target free space - * managers are clean. + * managers are clean. * * They are also used in sanity checking, as once a free space manager is * settled, it should not become unsettled (i.e. be asked to allocate or @@ -4310,7 +4100,7 @@ typedef struct H5C_tag_info_t { * free space manager metadata. * * mdfsm_settled: Boolean flag indicating whether the meta data free space - * manager is settled -- i.e. whether the correct space has + * manager is settled -- i.e. whether the correct space has * been allocated for it in the file. * * Note that the name of this field is deceptive. In the @@ -4495,63 +4285,23 @@ typedef struct H5C_tag_info_t { * max_pel_size: Largest value attained by the pel_size field in the * current epoch. * - * calls_to_msic: Total number of calls to H5C__make_space_in_cache + * calls_to_msic: Total number of calls to H5C_make_space_in_cache * * total_entries_skipped_in_msic: Number of clean entries skipped while - * enforcing the min_clean_fraction in H5C__make_space_in_cache(). + * enforcing the min_clean_fraction in H5C_make_space_in_cache(). * * total_entries_scanned_in_msic: Number of clean entries skipped while - * enforcing the min_clean_fraction in H5C__make_space_in_cache(). + * enforcing the min_clean_fraction in H5C_make_space_in_cache(). * * max_entries_skipped_in_msic: Maximum number of clean entries skipped - * in any one call to H5C__make_space_in_cache(). + * in any one call to H5C_make_space_in_cache(). * * max_entries_scanned_in_msic: Maximum number of entries scanned over - * in any one call to H5C__make_space_in_cache(). + * in any one call to H5C_make_space_in_cache(). * * entries_scanned_to_make_space: Number of entries scanned only when looking * for entries to evict in order to make space in cache. * - * - * The following fields track statistics on cache images. - * - * images_created: Integer field containing the number of cache images - * created since the last time statistics were reset. - * - * At present, this field must always be either 0 or 1. - * Further, since cache images are only created at file - * close, this field should only be set at that time. - * - * images_loaded: Integer field containing the number of cache images - * loaded since the last time statistics were reset. - * - * At present, this field must always be either 0 or 1. - * Further, since cache images are only loaded at the - * time of the first protect or on file close, this value - * should only change on those events. - * - * last_image_size: Size of the most recently loaded metadata cache image - * loaded into the cache, or zero if no image has been - * loaded. - * - * At present, at most one cache image can be loaded into - * the metadata cache for any given file, and this image - * will be loaded either on the first protect, or on file - * close if no entry is protected before then. - * - * - * Fields for tracking prefetched entries. Note that flushes and evictions - * of prefetched entries are tracked in the flushes and evictions arrays - * discused above. - * - * prefetches: Number of prefetched entries that are loaded to the - * cache. - * - * dirty_prefetches: Number of dirty prefetched entries that are loaded - * into the cache. - * - * prefetch_hits: Number of prefetched entries that are actually used. - * * * As entries are now capable of moving, loading, dirtying, and deleting * other entries in their pre_serialize and serialize callbacks, it has @@ -4622,11 +4372,6 @@ typedef struct H5C_tag_info_t { * field is intended to allow marking of output of with * the processes mpi rank. * - * get_entry_ptr_from_addr_counter: Counter used to track the number of - * times the H5C_get_entry_ptr_from_addr() function has been - * called successfully. This field is only defined when - * NDEBUG is not #defined. - * ****************************************************************************/ struct H5C_t { uint32_t magic; @@ -4637,7 +4382,7 @@ struct H5C_t { FILE * log_file_ptr; void * aux_ptr; int32_t max_type_id; - const H5C_class_t * const *class_table_ptr; + const char * (* type_name_table_ptr); size_t max_cache_size; size_t min_clean_size; H5C_write_permitted_func_t check_write_permitted; @@ -4647,16 +4392,16 @@ struct H5C_t { hbool_t close_warning_received; /* Fields for maintaining [hash table] index of entries */ - uint32_t index_len; + int32_t index_len; size_t index_size; - uint32_t index_ring_len[H5C_RING_NTYPES]; + int32_t index_ring_len[H5C_RING_NTYPES]; size_t index_ring_size[H5C_RING_NTYPES]; size_t clean_index_size; size_t clean_index_ring_size[H5C_RING_NTYPES]; size_t dirty_index_size; size_t dirty_index_ring_size[H5C_RING_NTYPES]; H5C_cache_entry_t * index[H5C__HASH_TABLE_LEN]; - uint32_t il_len; + int32_t il_len; size_t il_size; H5C_cache_entry_t * il_head; H5C_cache_entry_t * il_tail; @@ -4668,15 +4413,15 @@ struct H5C_t { /* Fields for maintaining list of in-order entries, for flushing */ hbool_t slist_changed; - uint32_t slist_len; + int32_t slist_len; size_t slist_size; - uint32_t slist_ring_len[H5C_RING_NTYPES]; + int32_t slist_ring_len[H5C_RING_NTYPES]; size_t slist_ring_size[H5C_RING_NTYPES]; H5SL_t * slist_ptr; - uint32_t num_last_entries; + int32_t num_last_entries; #if H5C_DO_SANITY_CHECKS - int32_t slist_len_increase; - ssize_t slist_size_increase; + int64_t slist_len_increase; + int64_t slist_size_increase; #endif /* H5C_DO_SANITY_CHECKS */ /* Fields for maintaining list of tagged entries */ @@ -4684,38 +4429,38 @@ struct H5C_t { hbool_t ignore_tags; /* Fields for tracking protected entries */ - uint32_t pl_len; + int32_t pl_len; size_t pl_size; H5C_cache_entry_t * pl_head_ptr; H5C_cache_entry_t * pl_tail_ptr; /* Fields for tracking pinned entries */ - uint32_t pel_len; + int32_t pel_len; size_t pel_size; H5C_cache_entry_t * pel_head_ptr; H5C_cache_entry_t * pel_tail_ptr; /* Fields for complete LRU list of entries */ - uint32_t LRU_list_len; + int32_t LRU_list_len; size_t LRU_list_size; H5C_cache_entry_t * LRU_head_ptr; H5C_cache_entry_t * LRU_tail_ptr; /* Fields for clean LRU list of entries */ - uint32_t cLRU_list_len; + int32_t cLRU_list_len; size_t cLRU_list_size; H5C_cache_entry_t * cLRU_head_ptr; H5C_cache_entry_t * cLRU_tail_ptr; /* Fields for dirty LRU list of entries */ - uint32_t dLRU_list_len; + int32_t dLRU_list_len; size_t dLRU_list_size; H5C_cache_entry_t * dLRU_head_ptr; H5C_cache_entry_t * dLRU_tail_ptr; #ifdef H5_HAVE_PARALLEL /* Fields for collective metadata reads */ - uint32_t coll_list_len; + int32_t coll_list_len; size_t coll_list_size; H5C_cache_entry_t * coll_head_ptr; H5C_cache_entry_t * coll_tail_ptr; @@ -4732,7 +4477,6 @@ struct H5C_t { hbool_t resize_enabled; hbool_t cache_full; hbool_t size_decreased; - hbool_t resize_in_progress; H5C_auto_size_ctl_t resize_ctl; /* Fields for epoch markers used in automatic cache size adjustment */ @@ -4748,23 +4492,9 @@ struct H5C_t { int64_t cache_hits; int64_t cache_accesses; - /* fields supporting generation of a cache image on file close */ - H5C_cache_image_ctl_t image_ctl; - hbool_t serialization_in_progress; - hbool_t load_image; - hbool_t image_loaded; - hbool_t delete_image; - haddr_t image_addr; - hsize_t image_len; - hsize_t image_data_len; int64_t entries_loaded_counter; int64_t entries_inserted_counter; int64_t entries_relocated_counter; - int64_t entry_fd_height_change_counter; - uint32_t num_entries_in_image; - H5C_image_entry_t * image_entries; - void * image_buffer; - /* Free Space Manager Related fields */ hbool_t rdfsm_settled; hbool_t mdfsm_settled; @@ -4802,21 +4532,21 @@ struct H5C_t { int64_t total_successful_ht_search_depth; int64_t failed_ht_searches; int64_t total_failed_ht_search_depth; - uint32_t max_index_len; + int32_t max_index_len; size_t max_index_size; size_t max_clean_index_size; size_t max_dirty_index_size; /* Fields for in-order skip list */ - uint32_t max_slist_len; + int32_t max_slist_len; size_t max_slist_size; /* Fields for protected entry list */ - uint32_t max_pl_len; + int32_t max_pl_len; size_t max_pl_size; /* Fields for pinned entry list */ - uint32_t max_pel_len; + int32_t max_pel_len; size_t max_pel_size; /* Fields for tracking 'make space in cache' (msic) operations */ @@ -4832,16 +4562,6 @@ struct H5C_t { int64_t LRU_scan_restarts; int64_t index_scan_restarts; - /* Fields for tracking cache image operations */ - int32_t images_created; - int32_t images_loaded; - hsize_t last_image_size; - - /* Fields for tracking prefetched entries */ - int64_t prefetches; - int64_t dirty_prefetches; - int64_t prefetch_hits; - #if H5C_COLLECT_CACHE_ENTRY_STATS int32_t max_accesses[H5C__MAX_NUM_TYPE_IDS + 1]; int32_t min_accesses[H5C__MAX_NUM_TYPE_IDS + 1]; @@ -4853,10 +4573,6 @@ struct H5C_t { #endif /* H5C_COLLECT_CACHE_STATS */ char prefix[H5C__PREFIX_LEN]; - -#ifndef NDEBUG - int64_t get_entry_ptr_from_addr_counter; -#endif /* NDEBUG */ }; /* Define typedef for tagged cache entry iteration callbacks */ @@ -4867,28 +4583,20 @@ typedef int (*H5C_tag_iter_cb_t)(H5C_cache_entry_t *entry, void *ctx); /* Package Private Variables */ /*****************************/ +/* Metadata cache epoch class */ +H5_DLLVAR const H5C_class_t H5C__epoch_marker_class; + /******************************/ /* Package Private Prototypes */ /******************************/ -H5_DLL herr_t H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5C__deserialize_prefetched_entry(H5F_t *f, hid_t dxpl_id, - H5C_t * cache_ptr, H5C_cache_entry_t** entry_ptr_ptr, - const H5C_class_t * type, haddr_t addr, void * udata); /* General routines */ H5_DLL herr_t H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, unsigned flags); -H5_DLL herr_t H5C__generate_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr); -H5_DLL herr_t H5C__load_cache_image(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5C__mark_flush_dep_serialized(H5C_cache_entry_t * entry_ptr); H5_DLL herr_t H5C__mark_flush_dep_unserialized(H5C_cache_entry_t * entry_ptr); -H5_DLL herr_t H5C__make_space_in_cache(H5F_t * f, hid_t dxpl_id, - size_t space_needed, hbool_t write_permitted); H5_DLL herr_t H5C__flush_marked_entries(H5F_t * f, hid_t dxpl_id); -H5_DLL herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, - H5C_cache_entry_t *entry_ptr, hid_t dxpl_id); -H5_DLL herr_t H5C__serialize_cache(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, hbool_t match_global, H5C_tag_iter_cb_t cb, void *cb_ctx); diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 28eacf2..654ce35 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -114,7 +114,6 @@ /* Cache configuration versions */ #define H5C__CURR_AUTO_SIZE_CTL_VER 1 #define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1 -#define H5C__CURR_CACHE_IMAGE_CTL_VER 1 /* Default configuration settings */ #define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f @@ -995,16 +994,16 @@ typedef int H5C_ring_t; * just before the entry is freed. * * This is necessary, as the LRU list can be changed out - * from under H5C__make_space_in_cache() by the serialize + * from under H5C_make_space_in_cache() by the serialize * callback which may change the size of an existing entry, * and/or load a new entry while serializing the target entry. * * This in turn can cause a recursive call to - * H5C__make_space_in_cache() which may either flush or evict + * H5C_make_space_in_cache() which may either flush or evict * the next entry that the first invocation of that function * was about to examine. * - * The magic field allows H5C__make_space_in_cache() to + * The magic field allows H5C_make_space_in_cache() to * detect this case, and re-start its scan from the bottom * of the LRU when this situation occurs. * @@ -1339,187 +1338,6 @@ typedef int H5C_ring_t; * In either case, when there is no previous item, it should * be NULL. * - * Fields supporting the cache image feature: - * - * The following fields are used to store data about the entry which must - * be stored in the cache image block, but which will typically be either - * lost or heavily altered in the process of serializing the cache and - * preparing its contents to be copied into the cache image block. - * - * Some fields are also used in loading the contents of the metadata cache - * image back into the cache, and in managing such entries until they are - * either protected by the library (at which point they become regular - * entries) or are evicted. See discussion of the prefetched field for - * further details. - * - * include_in_image: Boolean flag indicating whether this entry should - * be included in the metadata cache image. This field should - * always be false prior to the H5C_prep_for_file_close() call. - * During that call, it should be set to TRUE for all entries - * that are to be included in the metadata cache image. At - * present, only the superblock, the superblock extension - * object header and its chunks (if any) are omitted from - * the image. - * - * lru_rank: Rank of the entry in the LRU just prior to file close. - * - * Note that the first entry on the LRU has lru_rank 1, - * and that entries not on the LRU at that time will have - * either lru_rank -1 (if pinned) or 0 (if loaded during - * the process of flushing the cache. - * - * image_dirty: Boolean flag indicating whether the entry should be marked - * as dirty in the metadata cache image. The flag is set to - * TRUE iff the entry is dirty when H5C_prep_for_file_close() - * is called. - * - * fd_parent_count: If the entry is a child in one or more flush dependency - * relationships, this field contains the number of flush - * dependency parents. - * - * In all other cases, the field is set to zero. - * - * Note that while this count is initially taken from the - * flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any parents - * that are not in the image are removed from this count and - * from the fd_parent_addrs array below. - * - * Finally observe that if the entry is dirty and in the - * cache image, and its parent is dirty and not in the cache - * image, then the entry must be removed from the cache image - * to avoid violating the flush dependency flush ordering. - * - * fd_parent_addrs: If the entry is a child in one or more flush dependency - * relationship when H5C_prep_for_file_close() is called, this - * field must contain a pointer to an array of size - * fd_parent_count containing the on disk addresses of the - * parent. - * - * In all other cases, the field is set to NULL. - * - * Note that while this list of addresses is initially taken - * from the flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any parents - * that are not in the image are removed from this list, and - * and from the fd_parent_count above. - * - * Finally observe that if the entry is dirty and in the - * cache image, and its parent is dirty and not in the cache - * image, then the entry must be removed from the cache image - * to avoid violating the flush dependency flush ordering. - * - * fd_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of flush - * dependency children. - * - * In all other cases, the field is set to zero. - * - * Note that while this count is initially taken from the - * flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any children - * that are not in the image are removed from this count. - * - * fd_dirty_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of dirty flush - * dependency children. - * - * In all other cases, the field is set to zero. - * - * Note that while this count is initially taken from the - * flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any dirty - * children that are not in the image are removed from this - * count. - * - * image_fd_height: Flush dependency height of the entry in the cache image. - * - * The flush dependency height of any entry involved in a - * flush dependency relationship is defined to be the - * longest flush dependency path from that entry to an entry - * with no flush depenency children. - * - * Since the image_fd_height is used to order entries in the - * cache image so that fd parents preceed fd children, for - * purposes of this field, and entry is at flush dependency - * level 0 if it either has no children, or if all of its - * children are not in the cache image. - * - * Note that if a child in a flush dependency relationship is - * dirty and in the cache image, and its parent is dirty and - * not in the cache image, then the child must be excluded - * from the cache image to maintain flush ordering. - * - * prefetched: Boolean flag indicating that the on disk image of the entry - * has been loaded into the cache prior any request for the - * entry by the rest of the library. - * - * As of this writing (8/10/15), this can only happen through - * the load of a cache image block, although other scenarios - * are contemplated for the use of this feature. Note that - * unlike the usual prefetch situation, this means that a - * pre fetched entry can be dirty, and/or can be a party to - * flush dependency relationship(s). This complicates matters - * somewhat. - * - * The essential feature of a pre-fetched entry is that it - * consists only of a buffer containing the on disk image of - * the entry. Thus it must be deserialized before it can - * be passed back to the library on a protect call. This - * task is handled by H5C_deserialized_prefetched_entry(). - * In essence, this routine calls the deserialize callback - * provided in the protect call with the on disk image, - * deletes the prefetched entry from the cache, and replaces - * it with the deserialized entry returned by the deserialize - * callback. - * - * Further, if the prefetched entry is a flush dependency parent, - * all its flush dependency children (which must also be - * pre-fetched entries), must be tranfered to the new cache - * entry returned by the deserailization callback. - * - * Finally, if the prefetched entry is a flush dependency child, - * this flush dependency must be destroyed prior to the - * deserialize call. - * - * In addition to the above special processing on the first - * protect call on a prefetched entry (after which is no longer - * a prefetched entry), prefetched entries also require special - * tretment on flush and evict. - * - * On flush, a dirty prefetched entry must simply be written - * to disk and marked clean without any call to any client - * callback. - * - * On eviction, if a prefetched entry is a flush dependency - * child, that flush dependency relationship must be destroyed - * just prior to the eviction. If the flush dependency code - * is working properly, it should be impossible for any entry - * that is a flush dependency parent to be evicted. - * - * prefetch_type_id: Integer field containing the type ID of the prefetched - * entry. This ID must match the ID of the type provided in any - * protect call on the prefetched entry. - * - * The value of this field is undefined in prefetched is FALSE. - * - * age: Number of times a prefetched entry has appeared in - * subsequent cache images. The field exists to allow - * imposition of a limit on how many times a prefetched - * entry can appear in subsequent cache images without being - * converted to a regular entry. - * - * This field must be zero if prefetched is FALSE. - * - * serialization_count: Integer field used to maintain a count of the - * number of times each entry is serialized during cache - * serialization. While no entry should be serialized more than - * once in any serialization call, throw an assertion if any - * flush depencency parent is serialized more than once during - * a single cache serialization. - * - * This is a debugging field, and thus is maintained only if - * NDEBUG is undefined. * * Fields supporting tagged entries: * @@ -1615,23 +1433,6 @@ typedef struct H5C_cache_entry_t { struct H5C_cache_entry_t *coll_prev; #endif /* H5_HAVE_PARALLEL */ - /* fields supporting cache image */ - hbool_t include_in_image; - int32_t lru_rank; - hbool_t image_dirty; - uint64_t fd_parent_count; - haddr_t *fd_parent_addrs; - uint64_t fd_child_count; - uint64_t fd_dirty_child_count; - uint32_t image_fd_height; - hbool_t prefetched; - int prefetch_type_id; - int32_t age; - -#ifndef NDEBUG /* debugging field */ - int serialization_count; -#endif /* NDEBUG */ - /* fields supporting tag lists */ struct H5C_cache_entry_t *tl_next; struct H5C_cache_entry_t *tl_prev; @@ -1646,168 +1447,6 @@ typedef struct H5C_cache_entry_t { #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ } H5C_cache_entry_t; - -/**************************************************************************** - * - * structure H5C_image_entry_t - * - * Instances of the H5C_image_entry_t structure are used to store data on - * metadata cache entries used in the construction of the metadata cache - * image block. In essence this structure is a greatly simplified version - * of H5C_cache_entry_t. - * - * The fields of this structure are discussed individually below: - * - * JRM - 8/5/15 - * - * magic: Unsigned 32 bit integer that must always be set to - * H5C_IMAGE_ENTRY_T_MAGIC when the entry is valid. - * The field must be set to H5C_IMAGE_ENTRY_T_BAD_MAGIC - * just before the entry is freed. - * - * addr: Base address of the cache entry on disk. - * - * size: Length of the cache entry on disk in bytes. - * - * ring: Instance of H5C_ring_t indicating the flush ordering ring - * to which this entry is assigned. - * - * age: Number of times this prefetech entry has appeared in - * the current sequence of cache images. This field is - * initialized to 0 if the instance of H5C_image_entry_t - * is constructed from a regular entry. - * - * If the instance is constructed from a prefetched entry - * currently residing in the metadata cache, the field is - * set to 1 + the age of the prefetched entry, or to - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX if that sum exceeds - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX. - * - * type_id: Integer field containing the type ID of the entry. - * - * lru_rank: Rank of the entry in the LRU just prior to file close. - * - * Note that the first entry on the LRU has lru_rank 1, - * and that entries not on the LRU at that time will have - * either lru_rank -1 (if pinned) or 0 (if loaded during - * the process of flushing the cache. - * - * is_dirty: Boolean flag indicating whether the contents of the cache - * entry has been modified since the last time it was written - * to disk as a regular piece of metadata. - * - * image_fd_height: Flush dependency height of the entry in the cache image. - * - * The flush dependency height of any entry involved in a - * flush dependency relationship is defined to be the - * longest flush dependency path from that entry to an entry - * with no flush depenency children. - * - * Since the image_fd_height is used to order entries in the - * cache image so that fd parents preceed fd children, for - * purposes of this field, an entry is at flush dependency - * level 0 if it either has no children, or if all of its - * children are not in the cache image. - * - * Note that if a child in a flush dependency relationship is - * dirty and in the cache image, and its parent is dirty and - * not in the cache image, then the child must be excluded - * from the cache image to maintain flush ordering. - * - * fd_parent_count: If the entry is a child in one or more flush dependency - * relationships, this field contains the number of flush - * dependency parents. - * - * In all other cases, the field is set to zero. - * - * Note that while this count is initially taken from the - * flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any parents that are - * not in the image are removed from this count and - * from the fd_parent_addrs array below. - * - * Finally observe that if the entry is dirty and in the - * cache image, and its parent is dirty and not in the cache - * image, then the entry must be removed from the cache image - * to avoid violating the flush dependency flush ordering. - * This should have happened before the construction of - * the instance of H5C_image_entry_t. - * - * fd_parent_addrs: If the entry is a child in one or more flush dependency - * relationship when H5C_prep_for_file_close() is called, this - * field must contain a pointer to an array of size - * fd_parent_count containing the on disk addresses of the - * parents. - * - * In all other cases, the field is set to NULL. - * - * Note that while this list of addresses is initially taken - * from the flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any parents that are not - * in the image are removed from this list, and from the - * fd_parent_count above. - * - * Finally observe that if the entry is dirty and in the - * cache image, and its parent is dirty and not in the cache - * image, then the entry must be removed from the cache image - * to avoid violating the flush dependency flush ordering. - * This should have happened before the construction of - * the instance of H5C_image_entry_t. - * - * fd_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of flush - * dependency children. - * - * In all other cases, the field is set to zero. - * - * Note that while this count is initially taken from the - * flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any children - * that are not in the image are removed from this count. - * - * fd_dirty_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of dirty flush - * dependency children. - * - * In all other cases, the field is set to zero. - * - * Note that while this count is initially taken from the - * flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any dirty children - * that are not in the image are removed from this count. - * - * image_ptr: Pointer to void. When not NULL, this field points to a - * dynamically allocated block of size bytes in which the - * on disk image of the metadata cache entry is stored. - * - * If the entry is dirty, the pre-serialize and serialize - * callbacks must be used to update this image before it is - * written to disk - * - * - ****************************************************************************/ - -typedef struct H5C_image_entry_t { - uint32_t magic; - haddr_t addr; - size_t size; - H5C_ring_t ring; - int32_t age; - int32_t type_id; - int32_t lru_rank; - hbool_t is_dirty; - unsigned image_fd_height; - uint64_t fd_parent_count; - haddr_t *fd_parent_addrs; - uint64_t fd_child_count; - uint64_t fd_dirty_child_count; - void *image_ptr; -} H5C_image_entry_t; - /**************************************************************************** * * structure H5C_auto_size_ctl_t @@ -2097,98 +1736,12 @@ typedef struct H5C_auto_size_ctl_t { double empty_reserve; } H5C_auto_size_ctl_t; -/**************************************************************************** - * - * structure H5C_cache_image_ctl_t - * - * Instances of H5C_image_ctl_t are used to get and set the control - * fields for generation of a metadata cache image on file close. - * - * At present control of construction of a cache image is via a FAPL - * property at file open / create. - * - * The fields of the structure are discussed individually below: - * - * version: Integer field containing the version number of this version - * of the H5C_image_ctl_t structure. Any instance of - * H5C_image_ctl_t passed to the cache must have a known - * version number, or an error will be flagged. - * - * generate_image: Boolean flag indicating whether a cache image should - * be created on file close. - * - * save_resize_status: Boolean flag indicating whether the cache image - * should include the adaptive cache resize configuration and status. - * Note that this field is ignored at present. - * - * entry_ageout: Integer field indicating the maximum number of - * times a prefetched entry can appear in subsequent cache images. - * This field exists to allow the user to avoid the buildup of - * infrequently used entries in long sequences of cache images. - * - * The value of this field must lie in the range - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100). - * - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit - * is imposed on number of times a prefeteched entry can appear - * in subsequent cache images. - * - * A value of 0 prevents prefetched entries from being included - * in cache images. - * - * Positive integers restrict prefetched entries to the specified - * number of appearances. - * - * Note that the number of subsequent cache images that a prefetched - * entry has appeared in is tracked in an 8 bit field. Thus, while - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its - * current value, any value in excess of 255 will be the functional - * equivalent of H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE. - * - * flags: Unsigned integer containing flags controling which aspects of the - * cache image functinality is actually executed. The primary impetus - * behind this field is to allow developement of tests for partial - * implementations that will require little if any modification to run - * with the full implementation. In normal operation, all flags should - * be set. - * - ****************************************************************************/ - -#define H5C_CI__GEN_MDCI_SBE_MESG ((unsigned)0x0001) -#define H5C_CI__GEN_MDC_IMAGE_BLK ((unsigned)0x0002) -#define H5C_CI__SUPRESS_ENTRY_WRITES ((unsigned)0x0004) -#define H5C_CI__WRITE_CACHE_IMAGE ((unsigned)0x0008) - -/* This #define must set all defined H5C_CI flags. It is - * used in the default value for instances of H5C_cache_image_ctl_t. - * This value will only be modified in test code. - */ -#define H5C_CI__ALL_FLAGS ((unsigned)0x000F) - -#define H5C__DEFAULT_CACHE_IMAGE_CTL \ -{ \ - /* version = */ H5C__CURR_CACHE_IMAGE_CTL_VER, \ - /* generate_image = */ FALSE, \ - /* save_resize_status = */ FALSE, \ - /* entry_ageout = */ H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE, \ - /* flags = */ H5C_CI__ALL_FLAGS \ -} - -typedef struct H5C_cache_image_ctl_t { - int32_t version; - hbool_t generate_image; - hbool_t save_resize_status; - int32_t entry_ageout; - unsigned flags; -} H5C_cache_image_ctl_t; - /***************************************/ /* Library-private Function Prototypes */ /***************************************/ H5_DLL H5C_t *H5C_create(size_t max_cache_size, size_t min_clean_size, - int max_type_id, const H5C_class_t * const *class_table_ptr, + int max_type_id, const char *(*type_name_table_ptr), H5C_write_permitted_func_t check_write_permitted, hbool_t write_permitted, H5C_log_flush_func_t log_flush, void *aux_ptr); H5_DLL herr_t H5C_set_up_logging(H5C_t *cache_ptr, const char log_location[], hbool_t start_immediately); @@ -2217,11 +1770,9 @@ herr_t H5C_verify_tag(int id, haddr_t tag); H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr); -H5_DLL herr_t H5C_get_cache_image_config(const H5C_t * cache_ptr, - H5C_cache_image_ctl_t *config_ptr); H5_DLL herr_t H5C_get_cache_size(H5C_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, - uint32_t *cur_num_entries_ptr); + int32_t *cur_num_entries_ptr); H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t *cache_ptr, double *hit_rate_ptr); H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t *size_ptr, hbool_t *in_cache_ptr, hbool_t *is_dirty_ptr, @@ -2232,11 +1783,8 @@ H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t *cache_ptr, hbool_t *evictio H5_DLL void * H5C_get_aux_ptr(const H5C_t *cache_ptr); H5_DLL FILE *H5C_get_trace_file_ptr(const H5C_t *cache_ptr); H5_DLL FILE *H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr); -H5_DLL herr_t H5C_image_stats(H5C_t * cache_ptr, hbool_t print_header); H5_DLL herr_t H5C_insert_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags); -H5_DLL herr_t H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, - hsize_t len, hbool_t rw); H5_DLL herr_t H5C_mark_entry_dirty(void *thing); H5_DLL herr_t H5C_mark_entry_clean(void *thing); H5_DLL herr_t H5C_mark_entry_unserialized(void *thing); @@ -2251,8 +1799,6 @@ H5_DLL void * H5C_protect(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, H5_DLL herr_t H5C_reset_cache_hit_rate_stats(H5C_t *cache_ptr); H5_DLL herr_t H5C_resize_entry(void *thing, size_t new_size); H5_DLL herr_t H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr); -H5_DLL herr_t H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, - H5C_cache_image_ctl_t *config_ptr); H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled); H5_DLL herr_t H5C_set_prefix(H5C_t *cache_ptr, char *prefix); H5_DLL herr_t H5C_set_trace_file_ptr(H5C_t *cache_ptr, FILE *trace_file_ptr); @@ -2264,7 +1810,6 @@ H5_DLL herr_t H5C_unpin_entry(void *thing); H5_DLL herr_t H5C_destroy_flush_dependency(void *parent_thing, void *child_thing); H5_DLL herr_t H5C_unprotect(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *thing, unsigned int flags); -H5_DLL herr_t H5C_validate_cache_image_config(H5C_cache_image_ctl_t * ctl_ptr); H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests); H5_DLL herr_t H5C_ignore_tags(H5C_t *cache_ptr); @@ -2274,32 +1819,20 @@ H5_DLL herr_t H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hboo H5_DLL herr_t H5C_get_entry_ring(const H5F_t *f, haddr_t addr, H5C_ring_t *ring); H5_DLL herr_t H5C_unsettle_entry_ring(void *thing); H5_DLL herr_t H5C_remove_entry(void *thing); -H5_DLL herr_t H5C_cache_image_status(H5F_t * f, hbool_t *load_ci_ptr, - hbool_t *write_ci_ptr); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5C_apply_candidate_list(H5F_t *f, hid_t dxpl_id, - H5C_t *cache_ptr, unsigned num_candidates, haddr_t *candidates_list_ptr, + H5C_t *cache_ptr, int num_candidates, haddr_t *candidates_list_ptr, int mpi_rank, int mpi_size); H5_DLL herr_t H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr); H5_DLL herr_t H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr); H5_DLL herr_t H5C_clear_coll_entries(H5C_t * cache_ptr, hbool_t partial); -H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, hid_t dxpl_id, unsigned ce_array_len, +H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, hid_t dxpl_id, int32_t ce_array_len, haddr_t *ce_array_ptr); #endif /* H5_HAVE_PARALLEL */ #ifndef NDEBUG /* debugging functions */ -H5_DLL hbool_t H5C_get_serialization_in_progress(const H5C_t *cache_ptr); H5_DLL hbool_t H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring); -H5_DLL herr_t H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn); -H5_DLL herr_t H5C_get_entry_ptr_from_addr(H5C_t *cache_ptr, haddr_t addr, - void **entry_ptr_ptr); -H5_DLL herr_t H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, - haddr_t child_addr, hbool_t *fd_exists_ptr); -H5_DLL herr_t H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, - const H5C_class_t *expected_type, hbool_t *in_cache_ptr, - hbool_t *type_ok_ptr); -H5_DLL herr_t H5C_validate_index_list(H5C_t *cache_ptr); #endif /* NDEBUG */ #endif /* !_H5Cprivate_H */ diff --git a/src/H5Cquery.c b/src/H5Cquery.c index 33a322d..f5409f7 100644 --- a/src/H5Cquery.c +++ b/src/H5Cquery.c @@ -131,7 +131,7 @@ H5C_get_cache_size(H5C_t * cache_ptr, size_t * max_size_ptr, size_t * min_clean_size_ptr, size_t * cur_size_ptr, - uint32_t * cur_num_entries_ptr) + int32_t * cur_num_entries_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -444,8 +444,7 @@ H5C_get_entry_ring(const H5F_t *f, haddr_t addr, H5C_ring_t *ring) /* Locate the entry at the address */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) - if(entry_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't find entry in index") + HDassert(entry_ptr); /* Return the ring value */ *ring = entry_ptr->ring; diff --git a/src/H5EApkg.h b/src/H5EApkg.h index 7540ff2..093403c 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -378,6 +378,21 @@ typedef struct H5EA__ctx_cb_t { /* Package Private Variables */ /*****************************/ +/* H5EA header inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_EARRAY_HDR[1]; + +/* H5EA index block inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_EARRAY_IBLOCK[1]; + +/* H5EA index block inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_EARRAY_SBLOCK[1]; + +/* H5EA data block inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_EARRAY_DBLOCK[1]; + +/* H5EA data block page inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1]; + /* Internal extensible array testing class */ H5_DLLVAR const H5EA_class_t H5EA_CLS_TEST[1]; diff --git a/src/H5F.c b/src/H5F.c index 5fd3a7d..a43009b 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -445,8 +445,6 @@ done: hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { - hbool_t ci_load = FALSE; /* whether MDC ci load requested */ - hbool_t ci_write = FALSE; /* whether MDC CI write requested */ H5F_t *new_file = NULL; /*file struct for new file */ hid_t dxpl_id = H5AC_ind_read_dxpl_id; /*dxpl used by library */ hid_t ret_value; /*return value */ @@ -492,12 +490,6 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) if(NULL == (new_file = H5F_open(filename, flags, fcpl_id, fapl_id, dxpl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to create file") - /* Check to see if both SWMR and cache image are requested. Fail if so */ - if(H5C_cache_image_status(new_file, &ci_load, &ci_write) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MDC cache image status") - if((ci_load || ci_write) && (flags & (H5F_ACC_SWMR_READ | H5F_ACC_SWMR_WRITE))) - HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "can't have both SWMR and cache image") - /* Get an atom for the file */ if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file") @@ -506,8 +498,9 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) new_file->file_id = ret_value; done: - if(ret_value < 0 && new_file && H5F_try_close(new_file, NULL) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problems closing file") + if(ret_value < 0 && new_file) + if(H5F_close(new_file) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problems closing file") FUNC_LEAVE_API(ret_value) } /* end H5Fcreate() */ @@ -556,8 +549,6 @@ done: hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) { - hbool_t ci_load = FALSE; /* whether MDC ci load requested */ - hbool_t ci_write = FALSE; /* whether MDC CI write requested */ H5F_t *new_file = NULL; /*file struct for new file */ hid_t dxpl_id = H5AC_ind_read_dxpl_id; /*dxpl used by library */ hid_t ret_value; /*return value */ @@ -587,12 +578,6 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) if(NULL == (new_file = H5F_open(filename, flags, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to open file") - /* Check to see if both SWMR and cache image are requested. Fail if so */ - if(H5C_cache_image_status(new_file, &ci_load, &ci_write) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MDC cache image status") - if((ci_load || ci_write) && (flags & (H5F_ACC_SWMR_READ | H5F_ACC_SWMR_WRITE))) - HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "can't have both SWMR and cache image") - /* Get an atom for the file */ if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") @@ -1192,7 +1177,7 @@ H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, int *cur_num_entries_ptr) { H5F_t *file; /* File object for file ID */ - uint32_t cur_num_entries; + int32_t cur_num_entries; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1608,8 +1593,6 @@ done: herr_t H5Fstart_swmr_write(hid_t file_id) { - hbool_t ci_load = FALSE; /* whether MDC ci load requested */ - hbool_t ci_write = FALSE; /* whether MDC CI write requested */ H5F_t *file = NULL; /* File info */ size_t grp_dset_count=0; /* # of open objects: groups & datasets */ size_t nt_attr_count=0; /* # of opened named datatypes + opened attributes */ @@ -1643,12 +1626,6 @@ H5Fstart_swmr_write(hid_t file_id) HDassert(file->shared->sblock->status_flags & H5F_SUPER_WRITE_ACCESS); - /* Check to see if cache image is enabled. Fail if so */ - if(H5C_cache_image_status(file, &ci_load, &ci_write) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MDC cache image status") - if(ci_load || ci_write ) - HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "can't have both SWMR and MDC cache image") - /* Flush data buffers */ if(H5F_flush(file, H5AC_ind_read_dxpl_id, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") @@ -1891,48 +1868,7 @@ H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled, done: FUNC_LEAVE_API(ret_value) -} /* H5Fget_mdc_logging_status() */ - - -/*------------------------------------------------------------------------- - * Function: H5Fset_latest_format - * - * Purpose: Enable switching the "latest format" flag while a file is open. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Monday, September 21, 2015 - *------------------------------------------------------------------------- - */ -herr_t -H5Fset_latest_format(hid_t file_id, hbool_t latest_format) -{ - H5F_t *f; /* File */ - unsigned latest_flags; /* Latest format flags for file */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ib", file_id, latest_format); - - /* Check args */ - if(NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "not a file ID") - - /* Check if the value is changing */ - latest_flags = H5F_USE_LATEST_FLAGS(f, H5F_LATEST_ALL_FLAGS); - if(latest_format != (H5F_LATEST_ALL_FLAGS == latest_flags)) { - /* Call the flush routine, for this file */ - if(H5F_flush(f, H5AC_ind_read_dxpl_id, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") - - /* Toggle the 'latest format' flag */ - H5F_SET_LATEST_FLAGS(f, latest_format ? H5F_LATEST_ALL_FLAGS : 0); - } /* end if */ - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Fset_latest_format() */ +} /* H5Fstop_mdc_logging() */ /*------------------------------------------------------------------------- diff --git a/src/H5FApkg.h b/src/H5FApkg.h index 63eacff..ccef562 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -249,6 +249,15 @@ typedef struct H5FA_dblk_page_cache_ud_t { /* Package Private Variables */ /*****************************/ +/* H5FA header inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_FARRAY_HDR[1]; + +/* H5FA data block inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_FARRAY_DBLOCK[1]; + +/* H5FA data block page inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1]; + /* Internal fixed array testing class */ H5_DLLVAR const H5FA_class_t H5FA_CLS_TEST[1]; diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 7e12869..befcaca 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -1151,18 +1151,14 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) ALL_MEMBERS(mt) { out_mt = mt; - if(f1->memb[mt] && f2->memb[mt]) - break; - if(!cmp) { - if(f1->memb[mt]) - cmp = -1; - else if(f2->memb[mt]) - cmp = 1; + if (f1->memb[mt] && f2->memb[mt]) break; + if (!cmp) { + if (f1->memb[mt]) cmp = -1; + else if (f2->memb[mt]) cmp = 1; } } END_MEMBERS; assert(cmp || out_mt=H5FD_MEM_NTYPES) - return cmp; + if (out_mt>=H5FD_MEM_NTYPES) return cmp; return H5FDcmp(f1->memb[out_mt], f2->memb[out_mt]); } diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index 4411236..f07ffad 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -199,6 +199,12 @@ struct H5FS_t { /* Package Private Variables */ /*****************************/ +/* H5FS header inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_FSPACE_HDR[1]; + +/* H5FS section info inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_FSPACE_SINFO[1]; + /* Declare a free list to manage the H5FS_node_t struct */ H5FL_EXTERN(H5FS_node_t); diff --git a/src/H5Fint.c b/src/H5Fint.c index d122357..8ad97a8 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -188,8 +188,6 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) if(H5P_set(new_plist, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, &(f->coll_md_write)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set collective metadata read flag") #endif /* H5_HAVE_PARALLEL */ - if(H5P_set(new_plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, &(f->shared->mdc_initCacheImageCfg)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set initial metadata cache resize config.") /* Prepare the driver property */ driver_prop.driver_id = f->shared->lf->driver_id; @@ -669,8 +667,6 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t if(H5P_get(plist, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, &(f->coll_md_write)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get collective metadata write flag") #endif /* H5_HAVE_PARALLEL */ - if(H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, &(f->shared->mdc_initCacheImageCfg)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get initial metadata cache resize config") /* Get the VFD values to cache */ f->shared->maxaddr = H5FD_get_maxaddr(lf); @@ -754,7 +750,7 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t * The cache might be created with a different number of elements and * the access property list should be updated to reflect that. */ - if(H5AC_create(f, &(f->shared->mdc_initCacheCfg), &(f->shared->mdc_initCacheImageCfg)) < 0) + if(H5AC_create(f, &(f->shared->mdc_initCacheCfg)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create metadata cache") /* Create the file's "open object" information */ @@ -833,7 +829,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) if((H5F_ACC_RDWR & H5F_INTENT(f)) && flush) if(H5F__flush_phase1(f, dxpl_id) < 0) /* Push error, but keep going*/ - HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush cached data (phase 1)") + HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") /* Notify the metadata cache that the file is about to be closed. * This allows the cache to set up for creating a metadata cache @@ -849,8 +845,8 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) */ if((H5F_ACC_RDWR & H5F_INTENT(f)) && flush) if(H5F__flush_phase2(f, dxpl_id, TRUE) < 0) - /* Push error, but keep going */ - HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush cached data (phase 2)") + /* Push error, but keep going*/ + HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") /* With the shutdown modifications, the contents of the metadata cache * should be clean at this point, with the possible exception of the @@ -869,7 +865,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) } /* end if */ /* With the shutdown modifications, the contents of the metadata cache - * should be clean at this point, with the possible exception of the + * should be clean at this point, with the possible exception of the * the superblock and superblock extension. * * Verify this. @@ -892,21 +888,18 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) * (assuming they are persistent). In this case, closing the * free space managers should have no effect on EOA. * - * -- JRM + * -- JRM */ if(H5F_ACC_RDWR & H5F_INTENT(f)) { if(H5MF_close(f, dxpl_id) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file free space info") - /* at this point, only the superblock and superblock + /* at this point, only the superblock and superblock * extension should be dirty. */ HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); - /* Flush the file again (if requested), as shutting down the - * free space manager may dirty some data structures again. - */ if(flush) { /* Clear status_flags */ f->shared->sblock->status_flags &= (uint8_t)(~H5F_SUPER_WRITE_ACCESS); @@ -921,7 +914,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) * so that the eoa value corresponds to the end of the * space written to in the file. * - * At most, this should change the superblock or the + * At most, this should change the superblock or the * superblock extension messages. */ if(H5MF_free_aggrs(f, dxpl_id) < 0) @@ -933,7 +926,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") - /* at this point, only the superblock and superblock + /* at this point, only the superblock and superblock * extension should be dirty. */ HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); @@ -955,7 +948,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) f->shared->sblock = NULL; } /* end if */ - /* with the possible exception of the superblock and superblock + /* with the possible exception of the superblock and superblock * extension, the metadata cache should be clean at this point. * * Verify this. @@ -1285,10 +1278,6 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, shared = file->shared; lf = shared->lf; - /* Get the file access property list, for future queries */ - if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list") - /* * Read or write the file superblock, depending on whether the file is * empty or not. @@ -1322,6 +1311,10 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read root group") } /* end if */ + /* Get the file access property list, for future queries */ + if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list") + /* * Decide the file close degree. If it's the first time to open the * file, set the degree to access property list value; if it's the @@ -1529,7 +1522,7 @@ H5F__flush_phase2(H5F_t *f, hid_t dxpl_id, hbool_t closing) /* Flush file buffers to disk. */ if(H5FD_flush(f->shared->lf, dxpl_id, closing) < 0) /* Push error, but keep going*/ - HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "low level flush failed") + HDONE_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed") FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__flush_phase2() */ @@ -2678,33 +2671,3 @@ H5F_set_coll_md_read(H5F_t *f, H5P_coll_md_read_flag_t cmr) } /* H5F_set_coll_md_read() */ #endif /* H5_HAVE_PARALLEL */ - -/*------------------------------------------------------------------------- - * Function: H5F_set_latest_flags - * - * Purpose: Set the latest_flags field with a new value. - * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: Quincey Koziol - * 4/26/16 - * - *------------------------------------------------------------------------- - */ -herr_t -H5F_set_latest_flags(H5F_t *f, unsigned flags) -{ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(0 == ((~flags) & H5F_LATEST_ALL_FLAGS)); - - f->shared->latest_flags = flags; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5F_set_latest_flags() */ - diff --git a/src/H5Fio.c b/src/H5Fio.c index afe1278..e215666 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -302,7 +302,7 @@ H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id) #ifndef NDEBUG { unsigned status = 0; - uint32_t cur_num_entries; + int32_t cur_num_entries; /* Retrieve status of the superblock */ if(H5AC_get_entry_status(f, (haddr_t)0, &status) < 0) diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 93a3978..11665f4 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -287,12 +287,6 @@ struct H5F_file_t { /* metadata cache. This structure is */ /* fixed at creation time and should */ /* not change thereafter. */ - H5AC_cache_image_config_t - mdc_initCacheImageCfg; /* initial configuration for the */ - /* generate metadata cache image on */ - /* close option. This structure is */ - /* fixed at creation time and should */ - /* not change thereafter. */ hbool_t use_mdc_logging; /* Set when metadata logging is desired */ hbool_t start_mdc_log_on_access; /* set when mdc logging should */ /* begin on file access/create */ @@ -375,6 +369,9 @@ H5FL_EXTERN(H5F_t); /* Declare a free list to manage the H5F_file_t struct */ H5FL_EXTERN(H5F_file_t); +H5_DLLVAR const H5AC_class_t H5AC_SUPERBLOCK[1]; +H5_DLLVAR const H5AC_class_t H5AC_DRVRINFO[1]; + /******************************/ /* Package Private Prototypes */ @@ -403,8 +400,7 @@ H5_DLL herr_t H5F__super_free(H5F_super_t *sblock); /* Superblock extension related routines */ H5_DLL herr_t H5F_super_ext_open(H5F_t *f, haddr_t ext_addr, H5O_loc_t *ext_ptr); -H5_DLL herr_t H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, - void *mesg, hbool_t may_create, unsigned mesg_flags); +H5_DLL herr_t H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, hbool_t may_create); H5_DLL herr_t H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id); H5_DLL herr_t H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, hbool_t was_created); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 7d288fa..bcc56c6 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -317,7 +317,6 @@ #define H5F_SET_GRP_BTREE_SHARED(F, RC) (((F)->shared->grp_btree_shared = (RC)) ? SUCCEED : FAIL) #define H5F_USE_TMP_SPACE(F) ((F)->shared->use_tmp_space) #define H5F_IS_TMP_ADDR(F, ADDR) (H5F_addr_le((F)->shared->tmp_addr, (ADDR))) -#define H5F_SET_LATEST_FLAGS(F, FL) ((F)->shared->latest_flags = (FL)) #ifdef H5_HAVE_PARALLEL #define H5F_COLL_MD_READ(F) ((F)->coll_md_read) #endif /* H5_HAVE_PARALLEL */ @@ -368,7 +367,6 @@ #define H5F_SET_GRP_BTREE_SHARED(F, RC) (H5F_set_grp_btree_shared((F), (RC))) #define H5F_USE_TMP_SPACE(F) (H5F_use_tmp_space(F)) #define H5F_IS_TMP_ADDR(F, ADDR) (H5F_is_tmp_addr((F), (ADDR))) -#define H5F_SET_LATEST_FLAGS(F, FL) (H5F_set_latest_flags((F), (FL))) #ifdef H5_HAVE_PARALLEL #define H5F_COLL_MD_READ(F) (H5F_coll_md_read(F)) #endif /* H5_HAVE_PARALLEL */ @@ -483,7 +481,6 @@ #define H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME "evict_on_close_flag" /* Whether or not the metadata cache will evict objects on close */ #define H5F_ACS_CORE_WRITE_TRACKING_PAGE_SIZE_NAME "core_write_tracking_page_size" /* The page size in kiB when core VFD write tracking is enabled */ #define H5F_ACS_COLL_MD_WRITE_FLAG_NAME "collective_metadata_write" /* property indicating whether metadata writes are done collectively or not */ -#define H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME "mdc_initCacheImageCfg" /* Initial metadata cache image creation configuration */ /* ======================== File Mount properties ====================*/ #define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ @@ -703,7 +700,6 @@ H5_DLL struct H5UC_t *H5F_grp_btree_shared(const H5F_t *f); H5_DLL herr_t H5F_set_grp_btree_shared(H5F_t *f, struct H5UC_t *rc); H5_DLL hbool_t H5F_use_tmp_space(const H5F_t *f); H5_DLL hbool_t H5F_is_tmp_addr(const H5F_t *f, haddr_t addr); -H5_DLL herr_t H5F_set_latest_flags(H5F_t *f, unsigned flags); #ifdef H5_HAVE_PARALLEL H5_DLL H5P_coll_md_read_flag_t H5F_coll_md_read(const H5F_t *f); H5_DLL void H5F_set_coll_md_read(H5F_t *f, H5P_coll_md_read_flag_t flag); diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index c57a821..a79da75 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -246,7 +246,6 @@ H5_DLL herr_t H5Fstart_swmr_write(hid_t file_id); H5_DLL ssize_t H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info/*out*/); H5_DLL herr_t H5Fclear_elink_file_cache(hid_t file_id); -H5_DLL herr_t H5Fset_latest_format(hid_t file_id, hbool_t latest_format); H5_DLL herr_t H5Fstart_mdc_logging(hid_t file_id); H5_DLL herr_t H5Fstop_mdc_logging(hid_t file_id); H5_DLL herr_t H5Fget_mdc_logging_status(hid_t file_id, diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 3b86dae..893ce26 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -240,7 +240,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5F__update_super_ext_driver_msg(H5F_t *f, hid_t dxpl_id) { H5F_super_t *sblock; /* Pointer to the super block */ @@ -290,7 +290,7 @@ H5F__update_super_ext_driver_msg(H5F_t *f, hid_t dxpl_id) */ drvinfo.len = driver_size; drvinfo.buf = dbuf; - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_DRVINFO_ID, &drvinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0) + if(H5F_super_ext_write_msg(f, dxpl_id, H5O_DRVINFO_ID, &drvinfo, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "unable to update driver info header message") } /* end if driver_size > 0 */ } /* end if !H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO) */ @@ -692,34 +692,6 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id, hbool_t initial_read) f->shared->fs_addr[u] = fsinfo.fs_addr[u-1]; } /* end if */ - /* Check for the extension having a 'metadata cache image' message */ - if((status = H5O_msg_exists(&ext_loc, H5O_MDCI_MSG_ID, dxpl_id)) < 0) - HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header") - if(status) { - hbool_t rw = ((rw_flags & H5AC__READ_ONLY_FLAG) == 0); - H5O_mdci_t mdci_msg; - - /* if the metadata cache image superblock extension message exists, - * read its contents and pass the data on to the metadata cache. - * Given this data, the cache will load and decode the metadata - * cache image block, decoded it and load its contents into the - * the cache on the test protect call. - * - * Further, if the file is opened R/W, the metadata cache will - * delete the metadata cache image superblock extension and free - * the cache image block. Don't do this now as f->shared - * is not fully setup, which complicates matters. - */ - - /* Retrieve the 'metadata cache image message' structure */ - if(NULL == H5O_msg_read(&ext_loc, H5O_MDCI_MSG_ID, &mdci_msg, dxpl_id)) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get metadata cache image message") - - /* Indicate to the cache that there's an image to load on first protect call */ - if(H5AC_load_cache_image_on_next_protect(f, mdci_msg.addr, mdci_msg.size, rw) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTLOAD, FAIL, "call to H5AC_load_cache_image_on_next_protect failed"); - } /* end if */ - /* Close superblock extension */ if(H5F_super_ext_close(f, &ext_loc, dxpl_id, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close file's superblock extension") @@ -765,7 +737,7 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id, hbool_t initial_read) HDassert(f->shared->sblock == NULL); f->shared->sblock = sblock; #endif /* JRM */ - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_DRVINFO_ID, &drvinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0) + if(H5F_super_ext_write_msg(f, dxpl_id, H5O_DRVINFO_ID, &drvinfo, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ @@ -861,7 +833,6 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) H5O_loc_t ext_loc; /* Superblock extension object location */ hbool_t need_ext; /* Whether the superblock extension is needed */ hbool_t ext_created = FALSE; /* Whether the extension has been created */ - hbool_t non_default_fs_settings = FALSE; /* Whether the file has non-default free-space settings */ herr_t ret_value = SUCCEED; /* Return Value */ FUNC_ENTER_PACKAGE_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) @@ -888,11 +859,6 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, &sblock->btree_k[0]) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get rank for btree internal nodes") - /* Check for non-default free-space settings */ - if(!(f->shared->fs_strategy == H5F_FILE_SPACE_STRATEGY_DEF && - f->shared->fs_threshold == H5F_FREE_SPACE_THRESHOLD_DEF)) - non_default_fs_settings = TRUE; - /* Bump superblock version if latest superblock version support is enabled */ if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_SUPERBLOCK)) super_vers = HDF5_SUPERBLOCK_VERSION_LATEST; @@ -902,7 +868,8 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) /* Bump superblock version to create superblock extension for * non-default file space strategy or non-default free-space threshold */ - else if(non_default_fs_settings) + else if(f->shared->fs_strategy != H5F_FILE_SPACE_STRATEGY_DEF || + f->shared->fs_threshold != H5F_FREE_SPACE_THRESHOLD_DEF) super_vers = HDF5_SUPERBLOCK_VERSION_2; /* Check for non-default indexed storage B-tree internal 'K' value * and set the version # of the superblock to 1 if it is a non-default @@ -1019,7 +986,8 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) need_ext = TRUE; } /* end if */ /* Files with non-default free space settings always need the superblock extension */ - else if(non_default_fs_settings) { + else if(f->shared->fs_strategy != H5F_FILE_SPACE_STRATEGY_DEF || + f->shared->fs_threshold != H5F_FREE_SPACE_THRESHOLD_DEF) { HDassert(super_vers >= HDF5_SUPERBLOCK_VERSION_2); need_ext = TRUE; } /* end if */ @@ -1107,8 +1075,9 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) f->shared->drvinfo_sb_msg_exists = TRUE; } /* end if */ - /* Check for non-default free-space info settings */ - if(non_default_fs_settings) { + /* Check for non-default free space settings */ + if(f->shared->fs_strategy != H5F_FILE_SPACE_STRATEGY_DEF || + f->shared->fs_threshold != H5F_FREE_SPACE_THRESHOLD_DEF) { H5FD_mem_t type; /* Memory type for iteration */ H5O_fsinfo_t fsinfo; /* Free space manager info message */ @@ -1396,8 +1365,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, - hbool_t may_create, unsigned mesg_flags) +H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, hbool_t may_create) { H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ @@ -1442,7 +1410,7 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "Message should not exist") /* Create the message with ID in the superblock extension */ - if(H5O_msg_create(&ext_loc, id, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg, dxpl_id) < 0) + if(H5O_msg_create(&ext_loc, id, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, mesg, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to create the message in object header") } /* end if */ else { @@ -1450,7 +1418,7 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "Message should exist") /* Update the message with ID in the superblock extension */ - if(H5O_msg_write(&ext_loc, id, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg, dxpl_id) < 0) + if(H5O_msg_write(&ext_loc, id, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, mesg, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to write the message in object header") } /* end else */ diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 1e8ad31..c994da3 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -312,6 +312,9 @@ typedef struct H5G_copy_file_ud_t { */ H5_DLLVAR H5B_class_t H5B_SNODE[1]; +/* The cache subclass */ +H5_DLLVAR const H5AC_class_t H5AC_SNODE[1]; + /* The v2 B-tree class for indexing 'name' field on links */ H5_DLLVAR const H5B2_class_t H5G_BT2_NAME[1]; diff --git a/src/H5HFcache.c b/src/H5HFcache.c index ffdac9a..302fe04 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -116,17 +116,14 @@ static herr_t H5HF__cache_dblock_free_icr(void *thing); /* Debugging Function Prototypes */ #ifndef NDEBUG -static herr_t H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, - H5HF_hdr_t *hdr, hbool_t *fd_clean, hbool_t *clean); -static herr_t H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, - hid_t dxpl_id, haddr_t fd_parent_addr, H5HF_indirect_t *iblock, - unsigned *iblock_status, hbool_t *fd_clean, hbool_t *clean); -static herr_t H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, - haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, - hbool_t *clean, hbool_t *has_dblocks); -static herr_t H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, - hid_t dxpl_id, haddr_t fd_parent_addr, H5HF_indirect_t *iblock, - hbool_t *fd_clean, hbool_t *clean, hbool_t *has_iblocks); +static herr_t H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, + hbool_t *clean); +static herr_t H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, + H5HF_indirect_t *iblock, unsigned *iblock_status, hbool_t *clean); +static herr_t H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, + H5HF_indirect_t *iblock, hbool_t *clean, hbool_t *has_dblocks); +static herr_t H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, + H5HF_indirect_t *iblock, hbool_t *clean, hbool_t *has_iblocks); #endif /* NDEBUG */ @@ -690,7 +687,6 @@ H5HF__cache_hdr_pre_serialize(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, #ifndef NDEBUG { hbool_t descendants_clean = TRUE; - hbool_t fd_children_clean = TRUE; /* Verify that flush dependencies are working correctly. Do this * by verifying that either: @@ -705,22 +701,10 @@ H5HF__cache_hdr_pre_serialize(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, * constraint is met by default. * * Do this with a call to H5HF__cache_verify_hdr_descendants_clean(). - * - * Note that decendants need not be clean if the pre_serialize call - * is made during a cache serialization instead of an entry or cache - * flush. - * - * Note also that with the recent change in the definition of flush - * dependency, not all decendants need be clean -- only direct flush - * dependency children. - * - * Finally, observe that the H5HF__cache_verify_hdr_descendants_clean() - * call still looks for dirty descendants. At present we do not check - * this value. */ - if(H5HF__cache_verify_hdr_descendants_clean((H5F_t *)f, dxpl_id, hdr, &fd_children_clean, &descendants_clean) < 0) + if(H5HF__cache_verify_hdr_descendants_clean((H5F_t *)f, hdr, &descendants_clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify hdr descendants clean.") - HDassert(fd_children_clean); + HDassert(descendants_clean); } #endif /* NDEBUG */ @@ -1192,9 +1176,8 @@ H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len) * and if so, to move it to real file space before the entry is * serialized. * - * In debug compiles, this function also verifies that all - * immediate flush dependency children of this indirect block - * are either clean or are not in cache. + * In debug compiles, this function also verifies that all children + * of this indirect block are either clean or are not in cache. * * Return: Success: SUCCEED * Failure: FAIL @@ -1234,12 +1217,10 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, #ifndef NDEBUG { hbool_t descendants_clean = TRUE; - hbool_t fd_children_clean = TRUE; unsigned iblock_status = 0; /* verify that flush dependencies are working correctly. Do this - * by verifying that all immediate flush dependency children of this - * iblock are clean. + * by verifying that all children of this iblock are clean. */ if(H5AC_get_entry_status(f, iblock->addr, &iblock_status) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get iblock status") @@ -1249,9 +1230,9 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, * there is no need to check to see if it is pinned or protected, or to * protect it if it is not. */ - if(H5HF__cache_verify_iblock_descendants_clean((H5F_t *)f, dxpl_id, iblock->addr, iblock, &iblock_status, &fd_children_clean, &descendants_clean) < 0) + if(H5HF__cache_verify_iblock_descendants_clean((H5F_t *)f, iblock, &iblock_status, &descendants_clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify descendants clean.") - HDassert(fd_children_clean); + HDassert(descendants_clean); } #endif /* NDEBUG */ @@ -2604,54 +2585,6 @@ done: * instance of H5HF_hdr_t are clean. Set *clean to * TRUE if this is the case, and to FALSE otherwise. * - * Update -- 8/24/15 - * - * With the advent of the metadata cache image feature, it is - * possible for the pre-serialize and serialize calls to be - * invoked outside of a flush. While this serialization - * observes flush dependencies for the order of serialization, - * the entries are not written to disk, and hence dirty entries - * remain dirty. - * - * To address this, updated the sanity checks in this function - * to treat entries whose images are up to date as clean if - * a cache serialization is in progress. - * - * Update -- 9/29/16 - * - * The implementation of flush dependencies has been changed. - * Prior to this change, a flush dependency parent could be - * flushed if and only if all its flush dependency decendants - * were clean. In the new definition, a flush dependency - * parent can be flushed if all its immediate flush dependency - * children are clean, regardless of any other dirty - * decendants. - * - * Further, metadata cache entries are now allowed to have - * multiple flush dependency parents. - * - * This means that the fractal heap is no longer ncessarily - * flushed from the bottom up. - * - * For example, it is now possible for a dirty fractal heap - * header to be flushed before a dirty dblock, as long as the - * there in an interviening iblock, and the header has no - * dirty immediate flush dependency children. - * - * Also, I gather that under some circumstances, a dblock - * will be direct a flush dependency child both of the iblock - * that points to it, and of the fractal heap header. - * - * As a result of these changes, the functionality of these - * sanity checking routines has been modified significantly. - * Instead of scanning the fractal heap from a starting point - * down, and verifying that there were no dirty entries, the - * functions now scan downward from the starting point and - * verify that there are no dirty flush dependency children - * of the specified flush dependency parent. In passing, - * they also walk the data structure, and verify it. - * - * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -2661,10 +2594,9 @@ done: */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, - H5HF_hdr_t *hdr, hbool_t *fd_clean, hbool_t *clean) +H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, + hbool_t *clean) { - hbool_t fd_exists = FALSE; /* whether flush dependency exists. */ haddr_t hdr_addr; /* Address of header */ unsigned hdr_status = 0; /* Header cache entry status */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2676,7 +2608,6 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, HDassert(hdr); HDassert(hdr->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); - HDassert(fd_clean); HDassert(clean); hdr_addr = hdr->cache_info.addr; HDassert(hdr_addr == hdr->heap_addr); @@ -2741,165 +2672,15 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, root_iblock_in_cache = ( (root_iblock_status & H5AC_ES__IN_CACHE) != 0); HDassert(root_iblock_in_cache || (root_iblock == NULL)); - if(!root_iblock_in_cache) { /* we are done */ - *clean = TRUE; - *fd_clean = TRUE; - } /* end if */ - else if((root_iblock_status & H5AC_ES__IS_DIRTY) && - (((root_iblock_status & H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || - (!H5AC_get_serialization_in_progress(f)))) { - *clean = FALSE; - - /* verify that a flush dependency exists between the header and - * the root inode. - */ - if(H5AC_flush_dependency_exists(f, hdr->heap_addr, root_iblock_addr, &fd_exists) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") - HDassert(fd_exists); - - *fd_clean = FALSE; - } /* end else-if */ - else { /* must examine children */ - hbool_t unprotect_root_iblock = FALSE; - - /* At this point, the root iblock may be pinned, protected, - * both, or neither, and we may or may not have a pointer - * to root iblock in memory. - * - * Before we call H5HF__cache_verify_iblock_descendants_clean(), - * we must ensure that the root iblock is either pinned or - * protected or both, and that we have a pointer to it. - * Do this as follows: - */ - if(root_iblock == NULL) { /* we don't have ptr to root iblock */ - if(0 == (root_iblock_status & H5AC_ES__IS_PROTECTED)) { - /* just protect the root iblock -- this will give us - * the pointer we need to proceed, and ensure that - * it is locked into the metadata cache for the - * duration. - * - * Note that the udata is only used in the load callback. - * While the fractal heap makes heavy use of the udata - * in this case, since we know that the entry is in cache, - * we can pass NULL udata. - * - * The tag specified in the dxpl we received - * as a parameter (via dxpl_id) may not be correct. - * Grab the (hopefully) correct tag from the header, - * and load it into the dxpl via the H5_BEGIN_TAG and - * H5_END_TAG macros. Note that any error bracked by - * these macros must be reported with HGOTO_ERROR_TAG. - */ - H5_BEGIN_TAG(dxpl_id, hdr->heap_addr, FAIL) - - if(NULL == (root_iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) - HGOTO_ERROR_TAG(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") - - H5_END_TAG(FAIL) - - unprotect_root_iblock = TRUE; - } /* end if */ - else { - /* the root iblock is protected, and we have no - * legitimate way of getting a pointer to it. - * - * We square this circle by using the - * H5AC_get_entry_ptr_from_addr() to get the needed - * pointer. - * - * WARNING: This call should be used only in debugging - * routines, and it should be avoided there when - * possible. - * - * Further, if we ever multi-thread the cache, - * this routine will have to be either discarded - * or heavily re-worked. - * - * Finally, keep in mind that the entry whose - * pointer is obtained in this fashion may not - * be in a stable state. - * - * Assuming that the flush dependency code is working - * as it should, the only reason for the root iblock to - * be unpinned is if none of its children are in cache. - * This unfortunately means that if it is protected and - * not pinned, the fractal heap is in the process of loading - * or inserting one of its children. The obvious - * implication is that there is a significant chance that - * the root iblock is in an unstable state. - * - * All this suggests that using - * H5AC_get_entry_ptr_from_addr() to obtain the pointer - * to the protected root iblock is questionable here. - * However, since this is test/debugging code, I expect - * that we will use this approach until it causes problems, - * or we think of a better way. - */ - if(H5AC_get_entry_ptr_from_addr(f, root_iblock_addr, (void **)(&root_iblock)) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "H5AC_get_entry_ptr_from_addr() failed.") - HDassert(root_iblock); - } /* end else */ - } /* end if */ - else { /* root_iblock != NULL */ - /* we have the pointer to the root iblock. Protect it - * if it is neither pinned nor protected -- otherwise we - * are ready to go. - */ - H5HF_indirect_t * iblock = NULL; - - if(((root_iblock_status & H5AC_ES__IS_PINNED) == 0) && - ((root_iblock_status & H5AC_ES__IS_PROTECTED) == 0)) { - /* the root iblock is neither pinned nor protected -- hence - * we must protect it before we proceed - * - * Note that the udata is only used in the load callback. - * While the fractal heap makes heavy use of the udata - * in this case, since we know that the entry is in cache, - * we can pass NULL udata. - * - * The tag associated specified in the dxpl we received - * as a parameter (via dxpl_id) may not be correct. - * Grab the (hopefully) correct tag from the header, - * and load it into the dxpl via the H5_BEGIN_TAG and - * H5_END_TAG macros. Note that any error bracked by - * these macros must be reported with HGOTO_ERROR_TAG. - */ - H5_BEGIN_TAG(dxpl_id, hdr->heap_addr, FAIL) - - if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) - HGOTO_ERROR_TAG(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") - - H5_END_TAG(FAIL) - - unprotect_root_iblock = TRUE; - HDassert(iblock == root_iblock); - } /* end if */ - } /* end else */ - - /* at this point, one way or another, the root iblock is locked - * in memory for the duration of the call. Do some sanity checks, - * and then call H5HF__cache_verify_iblock_descendants_clean(). - */ - HDassert(root_iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(root_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - - if(H5HF__cache_verify_iblock_descendants_clean(f, dxpl_id, hdr->heap_addr, root_iblock, &root_iblock_status, fd_clean, clean) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify root iblock & descendants clean.") - - /* Unprotect the root indirect block if required */ - if(unprotect_root_iblock) { - HDassert(root_iblock); - if(H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, root_iblock, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "H5AC_unprotect() faild.") - } /* end if */ - } /* end else */ + if(!root_iblock_in_cache) /* we are done */ + *clean = TRUE; + else if(root_iblock_status & H5AC_ES__IS_DIRTY) + *clean = FALSE; } /* end if */ else if((hdr->man_dtable.curr_root_rows == 0) && (HADDR_UNDEF != hdr->man_dtable.table_addr)) { haddr_t root_dblock_addr; unsigned root_dblock_status = 0; - hbool_t in_cache; - hbool_t type_ok; /* this is scenario 2 -- we have a root dblock */ root_dblock_addr = hdr->man_dtable.table_addr; @@ -2907,48 +2688,25 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get root dblock status") if(root_dblock_status & H5AC_ES__IN_CACHE) { - if(H5AC_verify_entry_type(f, root_dblock_addr, &H5AC_FHEAP_DBLOCK[0], &in_cache, &type_ok) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check dblock type") - HDassert(in_cache); - if(!type_ok) - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock addr doesn't refer to a dblock?!?") - /* If a root dblock is in cache, it must have a flush - * dependency relationship with the header, and it - * may not be the parent in any flush dependency - * relationship. - * - * We don't test this fully, but we will verify that - * the root iblock is a child in a flush dependency - * relationship with the header. + * dependency relationship with the header. */ - if(H5AC_flush_dependency_exists(f, hdr->heap_addr, root_dblock_addr, &fd_exists) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") - if(!fd_exists) - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock is not a flush dep parent of header.") - + if(0 == (root_dblock_status & H5AC_ES__IS_FLUSH_DEP_CHILD)) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock in cache and not a flush dep child.") if(0 != (root_dblock_status & H5AC_ES__IS_FLUSH_DEP_PARENT)) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock in cache and is a flush dep parent.") - *clean = !((root_dblock_status & H5AC_ES__IS_DIRTY) && - (((root_dblock_status & - H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || - (!H5AC_get_serialization_in_progress(f)))); - - *fd_clean = *clean; - } /* end if */ - else { /* root dblock not in cache */ - *fd_clean = TRUE; - *clean = TRUE; - } /* end else */ + if(root_dblock_status & H5AC_ES__IS_DIRTY) + *clean = FALSE; + } /* end if */ + else /* root dblock not in cache */ + *clean = TRUE; } /* end else-if */ - else { - /* this is scenario 3 -- the fractal heap is empty, and we - * have nothing to do. - */ - *fd_clean = TRUE; - *clean = TRUE; - } /* end else */ + else + /* this is scenario 3 -- the fractal heap is empty, and we + * have nothing to do. + */ + *clean = TRUE; done: FUNC_LEAVE_NOAPI(ret_value) @@ -2983,40 +2741,6 @@ done: * H5HF__cache_verify_descendant_iblocks_clean() are * recursive co-routines. * - * Update -- 9/29/16 - * - * The implementation of flush dependencies has been changed. - * Prior to this change, a flush dependency parent could be - * flushed if and only if all its flush dependency decendants - * were clean. In the new definition, a flush dependency - * parent can be flushed if all its immediate flush dependency - * children are clean, regardless of any other dirty - * decendants. - * - * Further, metadata cache entries are now allowed to have - * multiple flush dependency parents. - * - * This means that the fractal heap is no longer ncessarily - * flushed from the bottom up. - * - * For example, it is now possible for a dirty fractal heap - * header to be flushed before a dirty dblock, as long as the - * there in an interviening iblock, and the header has no - * dirty immediate flush dependency children. - * - * Also, I gather that under some circumstances, a dblock - * will be direct a flush dependency child both of the iblock - * that points to it, and of the fractal heap header. - * - * As a result of these changes, the functionality of these - * sanity checking routines has been modified significantly. - * Instead of scanning the fractal heap from a starting point - * down, and verifying that there were no dirty entries, the - * functions now scan downward from the starting point and - * verify that there are no dirty flush dependency children - * of the specified flush dependency parent. In passing, - * they also walk the data structure, and verify it. - * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -3026,9 +2750,8 @@ done: */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, hid_t dxpl_id, - haddr_t fd_parent_addr, H5HF_indirect_t *iblock, unsigned *iblock_status, - hbool_t * fd_clean, hbool_t *clean) +H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, H5HF_indirect_t *iblock, + unsigned *iblock_status, hbool_t *clean) { hbool_t has_dblocks = FALSE; hbool_t has_iblocks = FALSE; @@ -3038,19 +2761,17 @@ H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, hid_t dxpl_id, /* Sanity checks */ HDassert(f); - HDassert(H5F_addr_defined(fd_parent_addr)); HDassert(iblock); HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); HDassert(iblock_status); - HDassert(fd_clean); - HDassert(*fd_clean); - HDassert(clean); /* note that *clean need not be TRUE */ + HDassert(clean); + HDassert(*clean); - if((*fd_clean) && H5HF__cache_verify_iblocks_dblocks_clean(f, fd_parent_addr, iblock, fd_clean, clean, &has_dblocks) < 0) + if((*clean) && H5HF__cache_verify_iblocks_dblocks_clean(f, iblock, clean, &has_dblocks) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify dblocks clean.") - if((*fd_clean) && H5HF__cache_verify_descendant_iblocks_clean(f, dxpl_id, fd_parent_addr, iblock, fd_clean, clean, &has_iblocks) < 0) + if((*clean) && H5HF__cache_verify_descendant_iblocks_clean(f, iblock, clean, &has_iblocks) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify iblocks clean.") /* verify that flush dependency setup is plausible */ @@ -3087,53 +2808,6 @@ done: * during the call. Caller must ensure that this is * the case before the call. * - * Update -- 8/24/15 - * - * With the advent of the metadata cache image feature, it is - * possible for the pre-serialize and serialize calls to be - * invoked outside of a flush. While this serialization - * observes flush dependencies for the order of serialization, - * the entries are not written to disk, and hence dirty entries - * remain dirty. - * - * To address this, updated the sanity checks in this function - * to treat entries whose images are up to date as clean if - * a cache serialization is in progress. - * - * Update -- 9/29/16 - * - * The implementation of flush dependencies has been changed. - * Prior to this change, a flush dependency parent could be - * flushed if and only if all its flush dependency decendants - * were clean. In the new definition, a flush dependency - * parent can be flushed if all its immediate flush dependency - * children are clean, regardless of any other dirty - * decendants. - * - * Further, metadata cache entries are now allowed to have - * multiple flush dependency parents. - * - * This means that the fractal heap is no longer ncessarily - * flushed from the bottom up. - * - * For example, it is now possible for a dirty fractal heap - * header to be flushed before a dirty dblock, as long as the - * there in an interviening iblock, and the header has no - * dirty immediate flush dependency children. - * - * Also, I gather that under some circumstances, a dblock - * will be direct a flush dependency child both of the iblock - * that points to it, and of the fractal heap header. - * - * As a result of these changes, the functionality of these - * sanity checking routines has been modified significantly. - * Instead of scanning the fractal heap from a starting point - * down, and verifying that there were no dirty entries, the - * functions now scan downward from the starting point and - * verify that there are no dirty flush dependency children - * of the specified flush dependency parent. In passing, - * they also walk the data structure, and verify it. - * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -3143,82 +2817,53 @@ done: */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, - H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, - hbool_t *has_dblocks) +H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, H5HF_indirect_t *iblock, + hbool_t *clean, hbool_t *has_dblocks) { unsigned num_direct_rows; unsigned max_dblock_index; unsigned i; - haddr_t iblock_addr; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); - HDassert(H5F_addr_defined(fd_parent_addr)); HDassert(iblock); HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(fd_clean); - HDassert(*fd_clean); - HDassert(clean); /* note that *clean need not be true */ + HDassert(clean); + HDassert(*clean); HDassert(has_dblocks); i = 0; num_direct_rows = MIN(iblock->nrows, iblock->hdr->man_dtable.max_direct_rows); HDassert(num_direct_rows <= iblock->nrows); max_dblock_index = (num_direct_rows * iblock->hdr->man_dtable.cparam.width) - 1; - iblock_addr = iblock->addr; - HDassert(H5F_addr_defined(iblock_addr)); - - while((*fd_clean) && (i <= max_dblock_index)) { + while((*clean) && (i <= max_dblock_index)) { haddr_t dblock_addr; dblock_addr = iblock->ents[i].addr; if(H5F_addr_defined(dblock_addr)) { - hbool_t in_cache; - hbool_t type_ok; - - if(H5AC_verify_entry_type(f, dblock_addr, &H5AC_FHEAP_DBLOCK[0], &in_cache, &type_ok) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check dblock type") - - if(in_cache) { /* dblock is in cache */ - hbool_t fd_exists; - unsigned dblock_status = 0; - - if(!type_ok) - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "dblock addr doesn't refer to a dblock?!?") - - if(H5AC_get_entry_status(f, dblock_addr, &dblock_status) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get dblock status") - - HDassert(dblock_status & H5AC_ES__IN_CACHE); + unsigned dblock_status = 0; + if(H5AC_get_entry_status(f, dblock_addr, &dblock_status) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get dblock status") + if(dblock_status & H5AC_ES__IN_CACHE) { *has_dblocks = TRUE; - if((dblock_status & H5AC_ES__IS_DIRTY) && - (((dblock_status & H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || - (!H5AC_get_serialization_in_progress(f)))) { + if(dblock_status & H5AC_ES__IS_DIRTY) *clean = FALSE; - - if(H5AC_flush_dependency_exists(f, fd_parent_addr, dblock_addr, &fd_exists) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") - - if(fd_exists) - *fd_clean = FALSE; - } /* end if */ - /* If a child dblock is in cache, it must have a flush - * dependency relationship with this iblock. Test this - * here. + /* If a child dblock is in cache, it must have a flush + * dependency relationship with this iblock, and it + * may not be the parent in any flush dependency + * relationship. */ - if(H5AC_flush_dependency_exists(f, iblock_addr, dblock_addr, &fd_exists) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") - - if(!fd_exists) - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "dblock in cache and not a flush dep child of iblock.") + if(0 == (dblock_status & H5AC_ES__IS_FLUSH_DEP_CHILD)) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "dblock in cache and not a flush dep child.") + if(0 != (dblock_status & H5AC_ES__IS_FLUSH_DEP_PARENT)) + HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "dblock in cache and is a flush dep parent.") } /* end if */ } /* end if */ @@ -3251,54 +2896,6 @@ done: * during the call. Caller must ensure that this is * the case before the call. * - * Update -- 8/24/15 - * - * With the advent of the metadata cache image feature, it is - * possible for the pre-serialize and serialize calls to be - * invoked outside of a flush. While this serialization - * observes flush dependencies for the order of serialization, - * the entries are not written to disk, and hence dirty entries - * remain dirty. - * - * To address this, updated the sanity checks in this function - * to treat entries whose images are up to date as clean if - * a cache serialization is in progress. - * - * Update -- 9/29/16 - * - * The implementation of flush dependencies has been changed. - * Prior to this change, a flush dependency parent could be - * flushed if and only if all its flush dependency decendants - * were clean. In the new definition, a flush dependency - * parent can be flushed if all its immediate flush dependency - * children are clean, regardless of any other dirty - * decendants. - * - * Further, metadata cache entries are now allowed to have - * multiple flush dependency parents. - * - * This means that the fractal heap is no longer ncessarily - * flushed from the bottom up. - * - * For example, it is now possible for a dirty fractal heap - * header to be flushed before a dirty dblock, as long as the - * there in an interviening iblock, and the header has no - * dirty immediate flush dependency children. - * - * Also, I gather that under some circumstances, a dblock - * will be direct a flush dependency child both of the iblock - * that points to it, and of the fractal heap header. - * - * As a result of these changes, the functionality of these - * sanity checking routines has been modified significantly. - * Instead of scanning the fractal heap from a starting point - * down, and verifying that there were no dirty entries, the - * functions now scan downward from the starting point and - * verify that there are no dirty flush dependency children - * of the specified flush dependency parent. In passing, - * they also walk the data structure, and verify it. - * - * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -3308,38 +2905,33 @@ done: */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_id, - haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, +H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, H5HF_indirect_t *iblock, hbool_t *clean, hbool_t *has_iblocks) { unsigned first_iblock_index; unsigned last_iblock_index; unsigned num_direct_rows; unsigned i; - haddr_t iblock_addr; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); - HDassert(H5F_addr_defined(fd_parent_addr)); HDassert(iblock); HDassert(iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(fd_clean); - HDassert(*fd_clean); - HDassert(clean); /* note that *clean need not be true */ + HDassert(clean); + HDassert(*clean); HDassert(has_iblocks); num_direct_rows = MIN(iblock->nrows, iblock->hdr->man_dtable.max_direct_rows); HDassert(num_direct_rows <= iblock->nrows); - iblock_addr = iblock->addr; first_iblock_index = num_direct_rows * iblock->hdr->man_dtable.cparam.width; last_iblock_index = (iblock->nrows * iblock->hdr->man_dtable.cparam.width) - 1; i = first_iblock_index; - while((*fd_clean) && (i <= last_iblock_index)) { + while((*clean) && (i <= last_iblock_index)) { haddr_t child_iblock_addr = iblock->ents[i].addr; if(H5F_addr_defined(child_iblock_addr)) { @@ -3349,157 +2941,9 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_id, HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get iblock status") if(child_iblock_status & H5AC_ES__IN_CACHE) { - hbool_t fd_exists; - *has_iblocks = TRUE; - - if((child_iblock_status & H5AC_ES__IS_DIRTY) && - (((child_iblock_status & H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || - (!H5AC_get_serialization_in_progress(f)))) { - - *clean = FALSE; - - if(H5AC_flush_dependency_exists(f, fd_parent_addr, child_iblock_addr, &fd_exists) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") - - if(fd_exists) - *fd_clean = FALSE; - } /* end if */ - - /* if the child iblock is in cache and *fd_clean is TRUE, - * we must continue to explore down the fractal heap tree - * structure to verify that all descendant blocks that are - * flush dependency children of the entry at parent_addr are - * either clean, or not in the metadata cache. We do this - * with a recursive call to - * H5HF__cache_verify_iblock_descendants_clean(). - * However, we can't make this call unless the child iblock - * is somehow locked into the cache -- typically via either - * pinning or protecting. - * - * If the child iblock is pinned, we can look up its pointer - * on the current iblock's pinned child iblock list, and - * and use that pointer in the recursive call. - * - * If the entry is unprotected and unpinned, we simply - * protect it. - * - * If, however, the the child iblock is already protected, - * but not pinned, we have a bit of a problem, as we have - * no legitimate way of looking up its pointer in memory. - * - * To solve this problem, I have added a new metadata cache - * call to obtain the pointer. - * - * WARNING: This call should be used only in debugging - * routines, and it should be avoided there when - * possible. - * - * Further, if we ever multi-thread the cache, - * this routine will have to be either discarded - * or heavily re-worked. - * - * Finally, keep in mind that the entry whose - * pointer is obtained in this fashion may not - * be in a stable state. - * - * Assuming that the flush dependency code is working - * as it should, the only reason for the child entry to - * be unpinned is if none of its children are in cache. - * This unfortunately means that if it is protected and - * not pinned, the fractal heap is in the process of loading - * or inserting one of its children. The obvious implication - * is that there is a significant chance that the child - * iblock is in an unstable state. - * - * All this suggests that using the new call to obtain the - * pointer to the protected child iblock is questionable - * here. However, since this is test/debugging code, I - * expect that we will use this approach until it causes - * problems, or we think of a better way. - */ - if(*fd_clean) { - H5HF_indirect_t *child_iblock = NULL; - hbool_t unprotect_child_iblock = FALSE; - - if(0 == (child_iblock_status & H5AC_ES__IS_PINNED)) { - /* child iblock is not pinned */ - if(0 == (child_iblock_status & H5AC_ES__IS_PROTECTED)) { - /* child iblock is unprotected, and unpinned */ - /* protect it. Note that the udata is only */ - /* used in the load callback. While the */ - /* fractal heap makes heavy use of the udata */ - /* in this case, since we know that the */ - /* entry is in cache, we can pass NULL udata */ - /* */ - /* The tag associated specified in the dxpl */ - /* we received as a parameter (via dxpl_id) */ - /* may not be correct. */ - /* */ - /* Grab the (hopefully) correct tag from the */ - /* parent iblock, and load it into the dxpl */ - /* via the H5_BEGIN_TAG and H5_END_TAG */ - /* macros. Note that any error bracked by */ - /* these macros must be reported with */ - /* HGOTO_ERROR_TAG. */ - - H5_BEGIN_TAG(dxpl_id, iblock->hdr->heap_addr, FAIL) - - if(NULL == (child_iblock = (H5HF_indirect_t *) H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, child_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) - HGOTO_ERROR_TAG(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") - - H5_END_TAG(FAIL) - - unprotect_child_iblock = TRUE; - } /* end if */ - else { - /* child iblock is protected -- use */ - /* H5AC_get_entry_ptr_from_addr() to get a */ - /* pointer to the entry. This is very slimy -- */ - /* come up with a better solution. */ - if(H5AC_get_entry_ptr_from_addr(f, child_iblock_addr, (void **)(&child_iblock)) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "H5AC_get_entry_ptr_from_addr() faild.") - HDassert(child_iblock); - } /* end else */ - } /* end if */ - else { - /* child iblock is pinned -- look it up in the */ - /* parent iblocks child_iblocks array. */ - HDassert(iblock->child_iblocks); - child_iblock = iblock->child_iblocks[i - first_iblock_index]; - } /* end else */ - - /* At this point, one way or another we should have - * a pointer to the child iblock. Verify that we - * that we have the correct one. - */ - HDassert(child_iblock); - HDassert(child_iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(child_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(child_iblock->addr == child_iblock_addr); - - /* now make the recursive call */ - if(H5HF__cache_verify_iblock_descendants_clean(f, dxpl_id, fd_parent_addr, child_iblock, &child_iblock_status, fd_clean, clean) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify child iblock clean.") - - /* if iblock_addr != fd_parent_addr, verify that a flush - * dependency relationship exists between iblock and - * the child iblock. - */ - if(fd_parent_addr != iblock_addr) { - if(H5AC_flush_dependency_exists(f, iblock_addr, child_iblock_addr, &fd_exists) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") - - if(!fd_exists) - HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "iblock is not a flush dep parent of child_iblock.") - } /* end if */ - - /* if we protected the child iblock, unprotect it now */ - if(unprotect_child_iblock) { - if(H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_IBLOCK, child_iblock_addr, child_iblock, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "H5AC_unprotect() faild.") - } /* end if */ - } /* end if */ + if(child_iblock_status & H5AC_ES__IS_DIRTY) + *clean = FALSE; } /* end if */ } /* end if */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 9c1d9a6..6abae65 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -559,6 +559,15 @@ typedef struct H5HF_dblock_cache_ud_t { /* Package Private Variables */ /*****************************/ +/* H5HF header inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_FHEAP_HDR[1]; + +/* H5HF indirect block inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_FHEAP_IBLOCK[1]; + +/* H5HF direct block inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_FHEAP_DBLOCK[1]; + /* The v2 B-tree class for tracking indirectly accessed 'huge' objects */ H5_DLLVAR const H5B2_class_t H5HF_HUGE_BT2_INDIR[1]; diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h index a5c80ea..e566ece 100644 --- a/src/H5HGpkg.h +++ b/src/H5HGpkg.h @@ -40,6 +40,9 @@ /* Package Private Variables */ /*****************************/ +/* The cache subclass */ +H5_DLLVAR const H5AC_class_t H5AC_GHEAP[1]; + /* Declare extern the free list to manage the H5HG_t struct */ H5FL_EXTERN(H5HG_heap_t); diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 06db696..7075b2a 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -39,6 +39,12 @@ /* Package Private Variables */ /*****************************/ +/* The local heap prefix cache subclass */ +H5_DLLVAR const H5AC_class_t H5AC_LHEAP_PRFX[1]; + +/* The local heap data block cache subclass */ +H5_DLLVAR const H5AC_class_t H5AC_LHEAP_DBLK[1]; + /* Declare extern the free list to manage the H5HL_free_t struct */ H5FL_EXTERN(H5HL_free_t); diff --git a/src/H5MF.c b/src/H5MF.c index 23f128f..3ed6d28 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -273,7 +273,7 @@ H5MF__alloc_open(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type) /* Open an existing free space structure for the file */ if(NULL == (f->shared->fs_man[type] = H5FS_open(f, dxpl_id, f->shared->fs_addr[type], NELMTS(classes), classes, f, f->shared->alignment, f->shared->threshold))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space info") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space info") /* Set the state for the free space manager to "open", if it is now */ if(f->shared->fs_man[type]) @@ -419,7 +419,7 @@ H5MF__alloc_close(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type) /* Close an existing free space structure for the file */ if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free space info") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release free space info") f->shared->fs_man[type] = NULL; f->shared->fs_state[type] = H5F_FS_STATE_CLOSED; @@ -548,7 +548,7 @@ HDfprintf(stderr, "%s: Check 2.0\n", FUNC); /* Allocate from the metadata aggregator (or the VFD) */ if(HADDR_UNDEF == (ret_value = H5MF_aggr_vfd_alloc(f, alloc_type, dxpl_id, size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from aggr/vfd") + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from aggr/vfd") done: /* Reset the ring in the DXPL */ @@ -663,7 +663,7 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN /* check arguments */ HDassert(f); if(!H5F_addr_defined(addr) || 0 == size) - HGOTO_DONE(SUCCEED) + HGOTO_DONE(SUCCEED); HDassert(addr != 0); /* Can't deallocate the superblock :-) */ /* Check for attempting to free space that's a 'temporary' file address */ @@ -712,7 +712,7 @@ HDfprintf(stderr, "%s: Trying to avoid starting up free space manager\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Try to shrink the file or absorb the block into a block aggregator */ if((status = H5MF_try_shrink(f, alloc_type, dxpl_id, addr, size)) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL, "can't check for absorbing block") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTMERGE, FAIL, "can't check for absorbing block") else if(status > 0) /* Indicate success */ HGOTO_DONE(SUCCEED) @@ -1222,7 +1222,7 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) if(f->shared->fs_man[type]) { udata.alloc_type = type; if((status = H5FS_sect_try_shrink_eoa(f, dxpl_id, f->shared->fs_man[type], &udata)) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") else if(status > 0) eoa_shrank = TRUE; } /* end if */ @@ -1251,18 +1251,18 @@ done: * Purpose: Handle any tasks required before the metadata cache * can serialize or flush the raw data free space manager * and any metadata free space managers that reside in the - * raw data free space manager ring. + * raw data free space manager ring. * * Specifically, any metadata managers that DON'T handle - * space allocation for free space manager header or section - * info will reside in the raw data free space manager ring. - * As of this writing, the plan is to move to only two free space + * space allocation for free space manager header or section + * info will reside in the raw data free space manager ring. + * As of this writing, the plan is to move to only two free space * managers, one for raw data and one for metadata -- which * means that only the raw data free space manager will reside * in the free space manager ring. However, this has not been * fully implemented yet, so this code must support the * possibilty of multiple metadata free space managers, at most - * two of which handle free space manager header or section info, + * two of which handle free space manager header or section info, * and thus reside in the metadata free space manager ring. * * At present, the task list is: @@ -1271,20 +1271,20 @@ done: * * a) Free both aggregators. Space not at EOA will be * added to the appropriate free space manager. - * + * * The raw data aggregator should not be restarted * after this point. It is possible that the metadata * aggregator will be. - * + * * b) Free all file space currently allocated to free - * space managers. + * space managers. * * c) Delete the free space manager superblock * extension message if allocated. * * This done, reduce the EOA by moving it to just before * the last piece of free memory in the file. - * + * * 2) Ensure that space is allocated for the free space * manager superblock extension message. Must do this * now, before reallocating file space for free space @@ -1309,7 +1309,6 @@ done: * We will allocate space for free space managers involved * in the allocation of file space for free space managers * in H5MF_settle_meta_data_fsm() - * * Return: SUCCEED/FAIL * * Programmer: John Mainzer @@ -1349,16 +1348,16 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* a) Free the space in aggregators: * - * (for space not at EOF, it may be put into free space managers) + * (for space not at EOF, it may be put into free space managers) * - * Do this now so that the raw data FSM (and any other FSM that isn't + * Do this now so that the raw data FSM (and any other FSM that isn't * involved in space allocation for FSMs) will have no further activity. * * Note that while the raw data aggregator should not be restarted during * the close process, this need not be the case for the metadata aggregator. */ if(H5MF_free_aggrs(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free aggregators") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't free aggregators") /* Set the ring type in the DXPL. In most cases, we will * need H5AC_RING_MDFSM first, so initialy set the ring in @@ -1366,29 +1365,29 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * needed. */ if(H5AC_set_ring(dxpl_id, H5AC_RING_MDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value(0)") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value(0)") reset_ring = TRUE; curr_ring = H5AC_RING_MDFSM; /* b) Free the file space (if any) allocated to each free space manager. * - * Do this to facilitate reduction of the size of the file to the - * extent possible. We will re-allocate space to free space managers + * Do this to facilitate reduction of the size of the file to the + * extent possible. We will re-allocate space to free space managers * that have free space to save after this reduction. * * In the case of the raw data free space manager, and any other free * space manager that does not allocate space for free space managers, * allocations should be complete at this point, as all raw data should * have space allocated and be flushed to file at this point. Thus we - * can examine such free space managers and only re-allocate space for + * can examine such free space managers and only re-allocate space for * them if they contain free space. Do this later in this function after * the EOA has been reduced to the extent possible. * - * For free space managers that allocate file space for free space - * managers (usually just a single metadata free space manager, but for - * now at least, free space managers for different types of metadata + * For free space managers that allocate file space for free space + * managers (usually just a single metadata free space manager, but for + * now at least, free space managers for different types of metadata * are possible), the matter is more ticklish due to the self- - * referential nature of the problem. These FSMs are dealt with in + * referential nature of the problem. These FSMs are dealt with in * H5MF_settle_meta_data_fsm(). */ for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) { @@ -1404,8 +1403,8 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) if(!fsm_visited[fsm_type]) { fsm_visited[fsm_type] = TRUE; - /* If there is no active FSM for this type, but such a FSM has - * space allocated in file, open it so that we can free its file + /* If there is no active FSM for this type, but such a FSM has + * space allocated in file, open it so that we can free its file * space. */ if(NULL == f->shared->fs_man[fsm_type]) { @@ -1415,7 +1414,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* Start up FSM for the file memory type */ if(H5MF__alloc_open(f, dxpl_id, fsm_type) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") fsm_opened[fsm_type] = TRUE; } /* end if */ } /* end if */ @@ -1430,14 +1429,14 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) else needed_ring = H5AC_RING_RDFSM; if(needed_ring != curr_ring) { - if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring)< 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value.") curr_ring = needed_ring; } /* end if */ /* Query free space manager info for this type */ if(H5FS_stat_info(f, f->shared->fs_man[fsm_type], &fs_stat) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't get free-space info") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't get free-space info") /* Check if the free space manager has space in the file */ if(H5F_addr_defined(fs_stat.addr) || H5F_addr_defined(fs_stat.sect_addr)) { @@ -1446,7 +1445,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * any free space. */ if(H5FS_free(f, f->shared->fs_man[fsm_type], dxpl_id) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free-space headers") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release free-space headers") f->shared->fs_addr[fsm_type] = HADDR_UNDEF; } /* end if */ } /* end if */ @@ -1457,54 +1456,54 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) } /* end if */ } /* end for */ - /* c) Delete the free space manager superblock extension message + /* c) Delete the free space manager superblock extension message * if allocated. * * Must do this since the routine that writes / creates superblock - * extension messages will choke if the target message is + * extension messages will choke if the target message is * unexpectedly either absent or present. */ if(H5F_addr_defined(f->shared->sblock->ext_addr)) if(H5F_super_ext_remove_msg(f, dxpl_id, H5O_FSINFO_ID) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension") /* As the final element in 1), shrink the EOA for the file */ if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") - - /* 2) Ensure that space is allocated for the free space manager superblock - * extension message. Must do this now, before reallocating file space + + /* 2) Ensure that space is allocated for the free space manager superblock + * extension message. Must do this now, before reallocating file space * for free space managers, as it is possible that this allocation may - * grab the last section in a FSM -- making it unnecessary to + * grab the last section in a FSM -- making it unnecessary to * re-allocate file space for it. * * Do this by writing a free space manager superblock extension message. - * - * Since no free space manager has file space allocated for it, this + * + * Since no free space manager has file space allocated for it, this * message must be invalid since we can't save addresses of FSMs when * those addresses are unknown. This is OK -- we will write the correct * values to the message at free space manager shutdown. */ - for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) - fsinfo.fs_addr[type - 1] = HADDR_UNDEF; + for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) + fsinfo.fs_addr[type-1] = HADDR_UNDEF; fsinfo.strategy = f->shared->fs_strategy; fsinfo.threshold = f->shared->fs_threshold; - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") + if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, TRUE) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") /* 3) Scan all free space managers not involved in allocating * space for free space managers. For each such free space - * manager, test to see if it contains free space. If + * manager, test to see if it contains free space. If * it does, allocate file space for its header and section - * data. If it contains no free space, leave it without - * allocated file space as there is no need to save it to + * data. If it contains no free space, leave it without + * allocated file space as there is no need to save it to * file. * * Note that all free space managers in this class should - * see no further space allocations / deallocations as - * at this point, all raw data allocations should be + * see no further space allocations / deallocations as + * at this point, all raw data allocations should be * finalized, as should all metadata allocations not involving * free space managers. * @@ -1530,11 +1529,11 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) if(needed_ring != curr_ring) { if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring)< 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value.") curr_ring = needed_ring; } /* end if */ - /* Since there can be a many-to-one mapping from memory types + /* Since there can be a many-to-one mapping from memory types * to free space managers, ensure that we don't visit any FSM * more than once. */ @@ -1556,10 +1555,10 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* Query free space manager info for this type */ if(H5FS_stat_info(f, f->shared->fs_man[fsm_type], &fs_stat) < 0 ) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't get free-space info") - /* If the free space manager contains section info, - * allocate space for the header and sinfo (note that + /* If the free space manager contains section info, + * allocate space for the header and sinfo (note that * space must not be allocated at present -- verify * verify this with assertions). */ @@ -1569,18 +1568,18 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* Allocate FSM header */ if(H5FS_alloc_hdr(f, f->shared->fs_man[fsm_type], &f->shared->fs_addr[fsm_type], dxpl_id) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocated free-space header") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, FAIL, "can't allocated free-space header") /* Allocate FSM section info */ HDassert(!H5F_addr_defined(fs_stat.sect_addr)); HDassert(fs_stat.alloc_sect_size == 0); if(H5FS_alloc_sect(f, f->shared->fs_man[fsm_type], dxpl_id) < 0 ) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate free-space section info") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, FAIL, "can't allocate free-space section info") #ifndef NDEBUG /* Re-Query free space manager info for this type */ if(H5FS_stat_info(f, f->shared->fs_man[fsm_type], &fs_stat) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't get free-space info") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't get free-space info") HDassert(H5F_addr_defined(fs_stat.addr)); HDassert(H5F_addr_defined(fs_stat.sect_addr)); @@ -1601,7 +1600,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* Close any opened FSMs */ if(fsm_opened[fsm_type]) { if(H5MF__alloc_close(f, dxpl_id, fsm_type) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't close file free space manager") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't close file free space manager") fsm_opened[fsm_type] = FALSE; } /* end if */ } /* end if */ @@ -1619,7 +1618,7 @@ done: /* Reset the ring in the DXPL */ if(reset_ring) if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* H5MF_settle_raw_data_fsm() */ @@ -1762,7 +1761,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* Set the ring in the dxpl appropriately for subsequent calls */ if(H5AC_set_ring(dxpl_id, H5AC_RING_MDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value") reset_ring = TRUE; #ifndef NDEBUG @@ -1770,7 +1769,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) if(hdr_fspace) { /* Query free space manager info for this type */ if(H5FS_stat_info(f, hdr_fspace, &fs_stat) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get free-space info") HDassert(!H5F_addr_defined(fs_stat.addr)); HDassert(!H5F_addr_defined(fs_stat.sect_addr)); @@ -1781,7 +1780,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) if((sinfo_fspace) && (hdr_fspace != sinfo_fspace)) { /* Query free space manager info for this type */ if(H5FS_stat_info(f, sinfo_fspace, &fs_stat) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get free-space info") HDassert(!H5F_addr_defined(fs_stat.addr)); HDassert(!H5F_addr_defined(fs_stat.sect_addr)); @@ -1789,32 +1788,32 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) } /* end if */ #endif /* NDEBUG */ - /* Free the space in the metadata aggregator. Do this via the + /* Free the space in the metadata aggregator. Do this via the * H5MF_free_aggrs() call. Note that the raw data aggregator must * have already been freed. Sanity checks for this? */ /* (for space not at EOF, it may be put into free space managers) */ if(H5MF_free_aggrs(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free aggregators") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't free aggregators") /* Trying shrinking the EOA for the file */ if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") /* ******************* PROBLEM: ******************** * - * If the file has an alignement other than 1, and if - * the EOA is not a multiple of this alignment, allocating sapce - * for the section via the VFD info has the potential of generating - * a fragment that will be added to the free space manager. This + * If the file has an alignement other than 1, and if + * the EOA is not a multiple of this alignment, allocating sapce + * for the section via the VFD info has the potential of generating + * a fragment that will be added to the free space manager. This * of course undoes everything we have been doing here. * - * Need a way around this. Obvious solution is to force the EOA to - * be a multiple of the alignment. + * Need a way around this. Obvious solution is to force the EOA to + * be a multiple of the alignment. * * Fortunately, alignment is typically 1, so this is a non-issue in - * most cases. In cases where the alignment is not 1, for now we - * have decided to drop the fragment on the floor. + * most cases. In cases where the alignment is not 1, for now we + * have decided to drop the fragment on the floor. * * Eventually, we should fix this by modifying the on disk representations * of free space managers to allow for empty space, so as to bypass the @@ -1824,40 +1823,40 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* HDassert(f->shared->alignment == 1); */ - /* The free space manager(s) that handle space allocations for free - * space managers should be settled now, albeit without file space + /* The free space manager(s) that handle space allocations for free + * space managers should be settled now, albeit without file space * allocated to them. To avoid the possibility of changing the sizes - * of their section info blocks, allocate space for them now at the + * of their section info blocks, allocate space for them now at the * end of file via H5FD_alloc(). * - * In the past, this issue of allocating space without touching the - * free space managers has been deal with by calling - * H5MF_aggr_vfd_alloc(), which in turn calls H5MF_aggr_alloc(). - * This is problematic since (if I read the code correctly) it will - * re-constitute the metadata aggregator, which will add any leftover - * space to one of the free space managers when freed. + * In the past, this issue of allocating space without touching the + * free space managers has been deal with by calling + * H5MF_aggr_vfd_alloc(), which in turn calls H5MF_aggr_alloc(). + * This is problematic since (if I read the code correctly) it will + * re-constitute the metadata aggregator, which will add any left + * over space to one of the free space managers when freed. * * This is a non-starter, since the entire objective is to settle the * free space managers. * - * Hence the decision to call H5FD_alloc() directly. - * - * As discussed in PROBLEM above, if f->shared->alignment is not 1, + * Hence the decision to call H5FD_alloc() directly. + * + * As discussed in PROBLEM above, if f->shared->alignment is not 1, * this has the possibility of generating a fragment of file space * that would typically be inserted into one of the free space managers. * * This is isn't good, but due to schedule pressure, we will just drop - * the fragment on the floor for now. + * the fragement on the floor for now. */ if(hdr_fspace) if(H5FS_alloc_vfd_alloc_hdr_and_section_info(f, dxpl_id, hdr_fspace, &(f->shared->fs_addr[hdr_fsm_alloc_type])) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't vfd allocate hdr FSM file space") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, FAIL, "can't vfd allocate hdr FSM file space") if(sinfo_fspace && (sinfo_fspace != hdr_fspace)) if(H5FS_alloc_vfd_alloc_hdr_and_section_info(f, dxpl_id, sinfo_fspace, &(f->shared->fs_addr[sinfo_fsm_alloc_type])) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't vfd allocate sinfo FSM file space") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, FAIL, "can't vfd allocate sinfo FSM file space") /* Indicate that the FSM was settled successfully */ *fsm_settled = TRUE; @@ -1866,7 +1865,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) done: if(reset_ring) if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value") FUNC_LEAVE_NOAPI(ret_value) } /* H5MF_settle_meta_data_fsm() */ @@ -1928,7 +1927,7 @@ HDfprintf(stderr, "%s: Check 1.0 - f->shared->fs_man[%u] = %p, f->shared->fs_add HDfprintf(stderr, "%s: Before closing free space manager\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free space info") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release free space info") f->shared->fs_man[type] = NULL; f->shared->fs_state[type] = H5F_FS_STATE_CLOSED; } /* end if */ @@ -1956,7 +1955,7 @@ HDfprintf(stderr, "%s: Before deleting free space manager\n", FUNC); /* Delete free space manager for this type */ if(H5FS_delete(f, dxpl_id, tmp_fs_addr) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't delete free space manager") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't delete free space manager") /* Shift [back] to closed state */ HDassert(f->shared->fs_state[type] == H5F_FS_STATE_DELETING); @@ -2114,7 +2113,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); fsinfo.threshold = f->shared->fs_threshold; /* Write the free space manager message -- message must already exist */ - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0) + if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, FALSE) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") /* Final close of free-space managers */ @@ -2137,7 +2136,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); HDassert(f->shared->fs_state[type] == H5F_FS_STATE_OPEN); if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close free space manager") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't close free space manager") f->shared->fs_man[type] = NULL; f->shared->fs_state[type] = H5F_FS_STATE_CLOSED; } /* end if */ diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index 1510645..7b5a298 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -116,15 +116,15 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ /* Get the EOA for the file -- need for sanity check below */ if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, alloc_type))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, HADDR_UNDEF, "Unable to get eoa") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, HADDR_UNDEF, "Unable to get eoa") /* Check for overlap into temporary allocation space */ if(H5F_addr_gt((eoa + size), f->shared->tmp_addr)) - HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, HADDR_UNDEF, "hdr file space alloc will overlap into 'temporary' file space") + HGOTO_ERROR(H5E_FSPACE, H5E_BADRANGE, HADDR_UNDEF, "hdr file space alloc will overlap into 'temporary' file space") /* Allocate space for the header */ if(HADDR_UNDEF == (ret_value = H5FD_alloc(f->shared->lf, dxpl_id, alloc_type, f, size, &eoa_frag_addr, &eoa_frag_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space for hdr") + HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space for hdr") /* Sanity check for overlapping into file's temporary allocation space */ HDassert(H5F_addr_le((ret_value + size), f->shared->tmp_addr)); @@ -232,9 +232,9 @@ haddr_t H5MF_aggr_alloc(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, H5F_blk_aggr_t *other_aggr, H5FD_mem_t type, hsize_t size) { - haddr_t eoa_frag_addr = HADDR_UNDEF; /* Address of fragment at EOA */ - hsize_t eoa_frag_size = 0; /* Size of fragment at EOA */ - haddr_t eoa = HADDR_UNDEF; /* Initial EOA for the file */ + haddr_t eoa_frag_addr = HADDR_UNDEF; /* Address of fragment at EOA */ + hsize_t eoa_frag_size = 0; /* Size of fragment at EOA */ + haddr_t eoa = HADDR_UNDEF; /* Initial EOA for the file */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI(HADDR_UNDEF) @@ -543,8 +543,7 @@ H5MF_aggr_try_extend(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, } /* end else-if */ } /* end else */ } /* end if */ - else { - /* The aggreator is not at end of file */ + else { /* The aggreator is not at end of file */ /* Check if aggregator has enough internal space to satisfy the extension. */ if(aggr->size >= extra_requested) { /* Extend block into aggregator */ diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index e258677..330fe80 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -51,13 +51,15 @@ /* File space manager routines */ H5_DLL herr_t H5MF_init_merge_flags(H5F_t *f); -H5_DLL herr_t H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_size); +H5_DLL herr_t H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, + hsize_t *meta_size); H5_DLL herr_t H5MF_close(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5MF_try_close(H5F_t *f, hid_t dxpl_id); /* File space allocation routines */ H5_DLL haddr_t H5MF_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); -H5_DLL haddr_t H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); +H5_DLL haddr_t H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, + hsize_t size); H5_DLL haddr_t H5MF_vfd_alloc(H5F_t *f, hid_t dxpl_id, H5FD_mem_t alloc_type, hsize_t size, hbool_t keep_fragment); H5_DLL herr_t H5MF_xfree(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, @@ -76,7 +78,7 @@ H5_DLL haddr_t H5MF_alloc_tmp(H5F_t *f, hsize_t size); H5_DLL herr_t H5MF_free_aggrs(H5F_t *f, hid_t dxpl_id); H5_DLL htri_t H5MF_aggrs_try_shrink_eoa(H5F_t *f, hid_t dxpl_id); -/* Free space manager settling routines */ +/* Settling routines */ H5_DLL herr_t H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled); H5_DLL herr_t H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled); diff --git a/src/H5O.c b/src/H5O.c index 1b58703..e0c0f0b 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -130,12 +130,11 @@ const H5O_msg_class_t *const H5O_msg_class_g[] = { H5O_MSG_AINFO, /*0x0015 Attribute information */ H5O_MSG_REFCOUNT, /*0x0016 Object's ref. count */ H5O_MSG_FSINFO, /*0x0017 Free-space manager info */ - H5O_MSG_MDCI, /*0x0018 Metadata cache image */ - H5O_MSG_UNKNOWN, /*0x0019 Placeholder for unknown message */ + H5O_MSG_UNKNOWN, /*0x0018 Placeholder for unknown message */ #ifdef H5O_ENABLE_BOGUS - H5O_MSG_BOGUS_INVALID, /*0x001A "Bogus invalid" (for testing) */ + H5O_MSG_BOGUS_INVALID, /*0x0019 "Bogus invalid" (for testing) */ #else /* H5O_ENABLE_BOGUS */ - NULL, /*0x001A "Bogus invalid" (for testing) */ + NULL, /*0x0019 "Bogus invalid" (for testing) */ #endif /* H5O_ENABLE_BOGUS */ }; diff --git a/src/H5Opkg.h b/src/H5Opkg.h index e1fa0be..ef49535 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -31,7 +31,7 @@ #define H5O_NMESGS 8 /*initial number of messages */ #define H5O_NCHUNKS 2 /*initial number of chunks */ #define H5O_MIN_SIZE 22 /* Min. obj header data size (must be big enough for a message prefix and a continuation message) */ -#define H5O_MSG_TYPES 27 /* # of types of messages */ +#define H5O_MSG_TYPES 26 /* # of types of messages */ #define H5O_MAX_CRT_ORDER_IDX 65535 /* Max. creation order index value */ /* Versions of object header structure */ @@ -419,6 +419,12 @@ typedef struct H5O_chk_cache_ud_t { } H5O_chk_cache_ud_t; +/* H5O object header inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_OHDR[1]; + +/* H5O object header chunk inherits cache-like properties from H5AC */ +H5_DLLVAR const H5AC_class_t H5AC_OHDR_CHK[1]; + /* Header message ID to class mapping */ H5_DLLVAR const H5O_msg_class_t *const H5O_msg_class_g[H5O_MSG_TYPES]; @@ -538,10 +544,7 @@ H5_DLLVAR const H5O_msg_class_t H5O_MSG_REFCOUNT[1]; /* Free-space Manager Info message. (0x0017) */ H5_DLLVAR const H5O_msg_class_t H5O_MSG_FSINFO[1]; -/* Metadata Cache Image message. (0x0018) */ -H5_DLLVAR const H5O_msg_class_t H5O_MSG_MDCI[1]; - -/* Placeholder for unknown message. (0x0019) */ +/* Placeholder for unknown message. (0x0018) */ H5_DLLVAR const H5O_msg_class_t H5O_MSG_UNKNOWN[1]; diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 71c512c..f6df874 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -69,7 +69,6 @@ typedef struct H5O_t H5O_t; #define H5O_FIRST (-2) /* Operate on first message of type */ /* Flags needed when encoding messages */ -#define H5O_MSG_NO_FLAGS_SET 0x00u #define H5O_MSG_FLAG_CONSTANT 0x01u #define H5O_MSG_FLAG_SHARED 0x02u #define H5O_MSG_FLAG_DONTSHARE 0x04u @@ -205,8 +204,7 @@ typedef struct H5O_copy_t { #define H5O_AINFO_ID 0x0015 /* Attribute info message. */ #define H5O_REFCOUNT_ID 0x0016 /* Reference count message. */ #define H5O_FSINFO_ID 0x0017 /* File space info message. */ -#define H5O_MDCI_MSG_ID 0x0018 /* Metadata Cache Image Message */ -#define H5O_UNKNOWN_ID 0x0019 /* Placeholder message ID for unknown message. */ +#define H5O_UNKNOWN_ID 0x0018 /* Placeholder message ID for unknown message. */ /* (this should never exist in a file) */ /* * Note: Must increment H5O_MSG_TYPES in H5Opkg.h and update H5O_msg_class_g @@ -216,7 +214,7 @@ typedef struct H5O_copy_t { * * (this should never exist in a file) */ -#define H5O_BOGUS_INVALID_ID 0x001A /* "Bogus invalid" Message. */ +#define H5O_BOGUS_INVALID_ID 0x0019 /* "Bogus invalid" Message. */ /* Shared object message types. * Shared objects can be committed, in which case the shared message contains @@ -796,16 +794,6 @@ typedef struct H5O_fsinfo_t { haddr_t fs_addr[H5FD_MEM_NTYPES-1]; /* Addresses of free space managers */ } H5O_fsinfo_t; -/* - * Metadata Cache Image Message. - * Contains base address and length of the metadata cache image. - * (Data structure in memory) - */ -typedef struct H5O_mdci_t { - haddr_t addr; /* address of MDC image block */ - hsize_t size; /* size of MDC image block */ -} H5O_mdci_t; - /* Typedef for "application" iteration operations */ typedef herr_t (*H5O_operator_t)(const void *mesg/*in*/, unsigned idx, void *operator_data/*in,out*/); diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 7ea0fe0..91a0e03 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -225,13 +225,6 @@ #define H5F_ACS_COLL_MD_WRITE_FLAG_ENC H5P__encode_hbool_t #define H5F_ACS_COLL_MD_WRITE_FLAG_DEC H5P__decode_hbool_t #endif /* H5_HAVE_PARALLEL */ -/* Definitions for the initial metadata cache image configuration */ -#define H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE sizeof(H5AC_cache_image_config_t) -#define H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEF H5AC__DEFAULT_CACHE_IMAGE_CONFIG -#define H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_ENC H5P__facc_cache_image_config_enc -#define H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEC H5P__facc_cache_image_config_dec -#define H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_CMP H5P__facc_cache_image_config_cmp - /******************/ /* Local Typedefs */ @@ -286,11 +279,6 @@ static herr_t H5P_facc_mdc_log_location_copy(const char *name, size_t size, void static int H5P_facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t size); static herr_t H5P_facc_mdc_log_location_close(const char *name, size_t size, void *value); -/* Metadata cache image property callbacks */ -static int H5P__facc_cache_image_config_cmp(const void *_config1, const void *_config2, size_t H5_ATTR_UNUSED size); -static herr_t H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size); -static herr_t H5P__facc_cache_image_config_dec(const void **_pp, void *_value); - /*********************/ /* Package Variables */ @@ -358,7 +346,6 @@ static const hbool_t H5F_def_evict_on_close_flag_g = H5F_ACS_EVICT_ON_CLOSE_FLAG static const H5P_coll_md_read_flag_t H5F_def_coll_md_read_flag_g = H5F_ACS_COLL_MD_READ_FLAG_DEF; /* Default setting for the collective metedata read flag */ static const hbool_t H5F_def_coll_md_write_flag_g = H5F_ACS_COLL_MD_WRITE_FLAG_DEF; /* Default setting for the collective metedata write flag */ #endif /* H5_HAVE_PARALLEL */ -static const H5AC_cache_image_config_t H5F_def_mdc_initCacheImageCfg_g = H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEF; /* Default metadata cache image settings */ /*------------------------------------------------------------------------- @@ -568,12 +555,6 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #endif /* H5_HAVE_PARALLEL */ - /* Register the initial metadata cache image configuration */ - if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_SIZE, &H5F_def_mdc_initCacheImageCfg_g, - NULL, NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_ENC, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEC, - NULL, NULL, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_CMP, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_reg_prop() */ @@ -1562,101 +1543,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_mdc_image_config - * - * Purpose: Set the initial metadata cache image configuration in the - * target FAPL. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: J. Mainzer - * Thursday, June 25, 2015 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Pset_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", plist_id, config_ptr); - - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - - /* validate the new configuration */ - if(H5AC_validate_cache_image_config(config_ptr) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid metadata cache image configuration") - - /* set the modified metadata cache image config */ - - /* If we ever support multiple versions of H5AC_cache_image_config_t, we - * will have to test the version and do translation here. - */ - - if(H5P_set(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, config_ptr) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set metadata cache image initial config") - -done: - FUNC_LEAVE_API(ret_value) -} /* H5Pset_mdc_image_config() */ - - -/*------------------------------------------------------------------------- - * Function: H5Pget_mdc_image_config - * - * Purpose: Retrieve the metadata cache initial image configuration - * from the target FAPL. - * - * Observe that the function will fail if config_ptr is - * NULL, or if config_ptr->version specifies an unknown - * version of H5AC_cache_image_config_t. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: J. Mainzer - * Friday, June 26, 2015 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", plist_id, config_ptr); - - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - - /* validate the config_ptr */ - if(config_ptr == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.") - - if(config_ptr->version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown image config version.") - - /* If we ever support multiple versions of H5AC_cache_config_t, we - * will have to get the cannonical version here, and then translate - * to the version of the structure supplied. - */ - - /* Get the current initial metadata cache resize configuration */ - if(H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, config_ptr) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, "can't get metadata cache initial image config") - -done: - FUNC_LEAVE_API(ret_value) -} /* H5Pget_mdc_image_config() */ - - -/*------------------------------------------------------------------------- * Function: H5Pset_mdc_config * * Purpose: Set the initial metadata cache resize configuration in the @@ -2868,147 +2754,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5P__facc_cache_image_config_cmp - * - * Purpose: Compare two cache image configurations. - * - * Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is - * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal. - * - * Programmer: John Mainzer - * June 26, 2015 - * - *------------------------------------------------------------------------- - */ -static int -H5P__facc_cache_image_config_cmp(const void *_config1, const void *_config2, size_t H5_ATTR_UNUSED size) -{ - const H5AC_cache_image_config_t *config1 = (const H5AC_cache_image_config_t *)_config1; /* Create local aliases for values */ - const H5AC_cache_image_config_t *config2 = (const H5AC_cache_image_config_t *)_config2; /* Create local aliases for values */ - int ret_value = 0; /* Return value */ - - FUNC_ENTER_STATIC_NOERR - - /* Check for a property being set */ - if(config1 == NULL && config2 != NULL) HGOTO_DONE(-1); - if(config1 != NULL && config2 == NULL) HGOTO_DONE(1); - - if(config1->version < config2->version) HGOTO_DONE(-1); - if(config1->version > config2->version) HGOTO_DONE(1); - - if(config1->generate_image < config2->generate_image) HGOTO_DONE(-1); - if(config1->generate_image > config2->generate_image) HGOTO_DONE(1); - - if(config1->save_resize_status < config2->save_resize_status) HGOTO_DONE(-1); - if(config1->save_resize_status > config2->save_resize_status) HGOTO_DONE(1); - - if(config1->entry_ageout < config2->entry_ageout) HGOTO_DONE(-1); - if(config1->entry_ageout > config2->entry_ageout) HGOTO_DONE(1); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P__facc_cache_image_config_cmp() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__facc_cache_image_config_enc - * - * Purpose: Callback routine which is called whenever the default - * cache image config property in the file creation - * property list is encoded. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: John Mainzer - * June 26, 2015 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) -{ - const H5AC_cache_image_config_t *config = (const H5AC_cache_image_config_t *)value; /* Create local aliases for value */ - uint8_t **pp = (uint8_t **)_pp; - - FUNC_ENTER_STATIC_NOERR - - /* Sanity check */ - HDassert(value); - - if(NULL != *pp) { - /* Encode type sizes (as a safety check) */ - *(*pp)++ = (uint8_t)sizeof(unsigned); - - INT32ENCODE(*pp, (int32_t)config->version); - - H5_ENCODE_UNSIGNED(*pp, config->generate_image); - - H5_ENCODE_UNSIGNED(*pp, config->save_resize_status); - - INT32ENCODE(*pp, (int32_t)config->entry_ageout); - } /* end if */ - - /* Compute encoded size of fixed-size values */ - *size += (1 + (2 * sizeof(unsigned)) + (2 * sizeof(int32_t))); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P__facc_cache_image_config_enc() */ - - -/*------------------------------------------------------------------------- - * Function: H5P__facc_cache_image_config_dec - * - * Purpose: Callback routine which is called whenever the default - * cache image config property in the file creation property - * list is decoded. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: John Mainzer - * June 26, 2015 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5P__facc_cache_image_config_dec(const void **_pp, void *_value) -{ - H5AC_cache_image_config_t *config = (H5AC_cache_image_config_t *)_value; - const uint8_t **pp = (const uint8_t **)_pp; - unsigned enc_size; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(config); - HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - - /* Set property to default value */ - HDmemcpy(config, &H5F_def_mdc_initCacheImageCfg_g, sizeof(H5AC_cache_image_config_t)); - - /* Decode type sizes */ - enc_size = *(*pp)++; - if(enc_size != sizeof(unsigned)) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unsigned value can't be decoded") - - INT32DECODE(*pp, config->version); - - H5_DECODE_UNSIGNED(*pp, config->generate_image); - - H5_DECODE_UNSIGNED(*pp, config->save_resize_status); - - INT32DECODE(*pp, config->entry_ageout); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P__facc_cache_image_config_dec() */ - - -/*------------------------------------------------------------------------- * Function: H5P__facc_file_image_info_set * * Purpose: Copies a file image property when it's set for a property list diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 5aa8301..c736d7b 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -365,8 +365,6 @@ H5_DLL herr_t H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collectiv H5_DLL herr_t H5Pset_coll_metadata_write(hid_t plist_id, hbool_t is_collective); H5_DLL herr_t H5Pget_coll_metadata_write(hid_t plist_id, hbool_t *is_collective); #endif /* H5_HAVE_PARALLEL */ -H5_DLL herr_t H5Pset_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr); -H5_DLL herr_t H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr /*out*/); /* Dataset creation property list (DCPL) routines */ H5_DLL herr_t H5Pset_layout(hid_t plist_id, H5D_layout_t layout); diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index 342543d..3b13e23 100644 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -256,6 +256,8 @@ H5FL_ARR_EXTERN(H5SM_index_header_t); H5FL_EXTERN(H5SM_list_t); H5FL_ARR_EXTERN(H5SM_sohm_t); +H5_DLLVAR const H5AC_class_t H5AC_SOHM_TABLE[1]; +H5_DLLVAR const H5AC_class_t H5AC_SOHM_LIST[1]; H5_DLLVAR const H5B2_class_t H5SM_INDEX[1]; /****************************/ diff --git a/src/H5win32defs.h b/src/H5win32defs.h index b419f06..63c3a16 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -75,8 +75,8 @@ struct timezone { #if (_MSC_VER < 1900) struct timespec { - time_t tv_sec; /* Seconds - >= 0 */ - long tv_nsec; /* Nanoseconds - [0, 999999999] */ + time_t tv_sec; // Seconds - >= 0 + long tv_nsec; // Nanoseconds - [0, 999999999] }; #endif /* MSC_VER < 1900 */ diff --git a/src/Makefile.am b/src/Makefile.am index 69b54b4..939e151 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -46,8 +46,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5B.c H5Bcache.c H5Bdbg.c \ H5B2.c H5B2cache.c H5B2dbg.c H5B2hdr.c H5B2int.c H5B2internal.c \ H5B2leaf.c H5B2stat.c H5B2test.c \ - H5C.c H5Cdbg.c H5Cepoch.c H5Cimage.c H5Clog.c H5Cprefetched.c \ - H5Cquery.c H5Ctag.c H5Ctest.c \ + H5C.c H5Cdbg.c H5Cepoch.c H5Clog.c H5Cquery.c H5Ctag.c H5Ctest.c \ H5CS.c \ H5D.c H5Dbtree.c H5Dbtree2.c H5Dchunk.c H5Dcompact.c H5Dcontig.c H5Ddbg.c \ H5Ddeprec.c H5Dearray.c H5Defl.c H5Dfarray.c H5Dfill.c H5Dint.c \ @@ -82,8 +81,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5MF.c H5MFaggr.c H5MFdbg.c H5MFsection.c \ H5MM.c H5MP.c H5MPtest.c \ H5O.c H5Oainfo.c H5Oalloc.c H5Oattr.c \ - H5Oattribute.c H5Obogus.c H5Obtreek.c H5Ocache.c H5Ocache_image.c \ - H5Ochunk.c \ + H5Oattribute.c H5Obogus.c H5Obtreek.c H5Ocache.c H5Ochunk.c \ H5Ocont.c H5Ocopy.c H5Odbg.c H5Odrvinfo.c H5Odtype.c H5Oefl.c \ H5Ofill.c H5Oflush.c H5Ofsinfo.c H5Oginfo.c \ H5Olayout.c \ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9657971..8891af7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- @@ -20,23 +20,21 @@ set (TEST_LIB_SOURCES ${HDF5_TEST_SOURCE_DIR}/h5test.c ${HDF5_TEST_SOURCE_DIR}/testframe.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c - ${HDF5_TEST_SOURCE_DIR}/swmr_common.c ) set (TEST_LIB_HEADERS ${HDF5_TEST_SOURCE_DIR}/h5test.h ${HDF5_TEST_SOURCE_DIR}/cache_common.h - ${HDF5_TEST_SOURCE_DIR}/swmr_common.h ) add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") -endif () +endif (MSVC) if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") -endif () +endif (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES @@ -49,10 +47,10 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "ws2_32.lib") - endif () + endif (MSVC) if (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib") - endif () + endif (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES @@ -66,8 +64,8 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - endif () -endif () + endif (HDF5_ENABLE_THREADSAFE) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # If plugin library tests can be tested @@ -112,7 +110,7 @@ endif () "$" "${CMAKE_BINARY_DIR}/testdir1/$" ) - endforeach () + endforeach (test_lib ${TEST_PLUGIN_LIBS}) foreach (test_lib ${TEST2_PLUGIN_LIBS}) set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") @@ -138,7 +136,7 @@ endif () "$" "${CMAKE_BINARY_DIR}/testdir2/$" ) - endforeach () + endforeach (test_lib ${TEST2_PLUGIN_LIBS}) set (testhdf5_SOURCES ${HDF5_TEST_SOURCE_DIR}/testhdf5.c @@ -180,7 +178,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") target_link_libraries (testhdf5-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (testhdf5-shared PROPERTIES FOLDER test) -endif () +endif (BUILD_SHARED_LIBS) MACRO (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) @@ -194,8 +192,8 @@ MACRO (ADD_H5_EXE file) TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") target_link_libraries (${file}-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (${file}-shared PROPERTIES FOLDER test) - endif () -ENDMACRO () + endif (BUILD_SHARED_LIBS) +ENDMACRO (ADD_H5_EXE file) set (H5_TESTS cache @@ -225,7 +223,6 @@ set (H5_TESTS objcopy links unlink - twriteorder big mtime fillval @@ -256,34 +253,15 @@ set (H5_TESTS foreach (test ${H5_TESTS}) ADD_H5_EXE(${test}) -endforeach () +endforeach (test ${H5_TESTS}) set (H5_SWMR_TESTS - swmr_addrem_writer swmr_check_compat_vfd - swmr_generator - swmr_reader - swmr_remove_reader - swmr_remove_writer - swmr_sparse_reader - swmr_sparse_writer - swmr_start_write - swmr_writer ) foreach (test ${H5_SWMR_TESTS}) ADD_H5_EXE(${test}) -endforeach () - -set (H5_VDS_SWMR_TESTS - vds_swmr_gen - vds_swmr_reader - vds_swmr_writer -) - -foreach (test ${H5_VDS_SWMR_TESTS}) - ADD_H5_EXE(${test}) -endforeach () +endforeach (test ${H5_SWMR_TESTS}) ############################################################################## ############################################################################## @@ -291,26 +269,6 @@ endforeach () ############################################################################## ############################################################################## -#-- Adding test for cache_image -add_executable (cache_image - ${HDF5_TEST_SOURCE_DIR}/cache_image.c - ${HDF5_TEST_SOURCE_DIR}/genall5.c -) -TARGET_NAMING (cache_image STATIC) -TARGET_C_PROPERTIES (cache_image STATIC " " " ") -target_link_libraries (cache_image ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -set_target_properties (cache_image PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (cache_image-shared - ${HDF5_TEST_SOURCE_DIR}/cache_image.c - ${HDF5_TEST_SOURCE_DIR}/genall5.c - ) - TARGET_NAMING (cache_image-shared SHARED) - TARGET_C_PROPERTIES (cache_image-shared SHARED " " " ") - target_link_libraries (cache_image-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (cache_image-shared PROPERTIES FOLDER test) -endif () - #-- Adding test for hyperslab add_executable (hyperslab ${HDF5_TEST_SOURCE_DIR}/hyperslab.c) TARGET_NAMING (hyperslab STATIC) @@ -328,8 +286,8 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - endif () -endif () + endif (HDF5_ENABLE_THREADSAFE) +endif (BUILD_SHARED_LIBS) #-- Adding test for ttsafe add_executable (ttsafe @@ -360,23 +318,21 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - endif () -endif () + endif (HDF5_ENABLE_THREADSAFE) +endif (BUILD_SHARED_LIBS) set (H5_CHECK_TESTS error_test err_compat tcheck_version testmeta - atomic_writer - atomic_reader links_env flushrefresh ) foreach (test ${H5_CHECK_TESTS}) ADD_H5_EXE(${test}) -endforeach () +endforeach (test ${H5_CHECK_TESTS}) #-- Adding test for accum_swmr_reader # This has to be copied to the test directory for execve() to find it @@ -391,7 +347,7 @@ set_target_properties (accum_swmr_reader PROPERTIES FOLDER test) set_target_properties (accum PROPERTIES DEPENDS accum_swmr_reader) if (BUILD_SHARED_LIBS) set_target_properties (accum-shared PROPERTIES DEPENDS accum_swmr_reader) -endif () +endif (BUILD_SHARED_LIBS) #-- Adding test for libinfo set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) @@ -399,9 +355,9 @@ file (WRITE ${GREP_RUNNER} "file (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") if (\${TEST_RESULT} STREQUAL \"0\") message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") -else () +else (\${TEST_RESULT} STREQUAL \"0\") message (STATUS \"COMMAND Result: \${TEST_RESULT}\") -endif () +endif (\${TEST_RESULT} STREQUAL \"0\") " ) @@ -414,57 +370,12 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (plugin SHARED " " " ") target_link_libraries (plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (plugin PROPERTIES FOLDER test) -else () +else (BUILD_SHARED_LIBS) add_executable (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) TARGET_NAMING (plugin STATIC) TARGET_C_PROPERTIES (plugin STATIC " " " ") target_link_libraries (plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (plugin PROPERTIES FOLDER test) -endif () - -############################################################################## -### U S E C A S E S T E S T S -############################################################################## -set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) -add_executable (use_append_chunk ${use_append_chunk_SOURCES}) -TARGET_NAMING (use_append_chunk STATIC) -TARGET_C_PROPERTIES (use_append_chunk STATIC " " " ") -target_link_libraries (use_append_chunk ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -set_target_properties (use_append_chunk PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (use_append_chunk-shared ${use_append_chunk_SOURCES}) - TARGET_NAMING (use_append_chunk-shared SHARED) - TARGET_C_PROPERTIES (use_append_chunk-shared SHARED " " " ") - target_link_libraries (use_append_chunk-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (use_append_chunk-shared PROPERTIES FOLDER test) -endif () - -set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) -add_executable (use_append_mchunks ${use_append_mchunks_SOURCES}) -TARGET_NAMING (use_append_mchunks STATIC) -TARGET_C_PROPERTIES (use_append_mchunks STATIC " " " ") -target_link_libraries (use_append_mchunks ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -set_target_properties (use_append_mchunks PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (use_append_mchunks-shared ${use_append_mchunks_SOURCES}) - TARGET_NAMING (use_append_mchunks-shared SHARED) - TARGET_C_PROPERTIES (use_append_mchunks-shared SHARED " " " ") - target_link_libraries (use_append_mchunks-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (use_append_mchunks-shared PROPERTIES FOLDER test) -endif () - -set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c) -add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES}) -TARGET_NAMING (use_disable_mdc_flushes STATIC) -TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC " " " ") -target_link_libraries (use_disable_mdc_flushes ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test) -if (BUILD_SHARED_LIBS) - add_executable (use_disable_mdc_flushes-shared ${use_disable_mdc_flushes_SOURCES}) - TARGET_NAMING (use_disable_mdc_flushes-shared SHARED) - TARGET_C_PROPERTIES (use_disable_mdc_flushes-shared SHARED " " " ") - target_link_libraries (use_disable_mdc_flushes-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (use_disable_mdc_flushes-shared PROPERTIES FOLDER test) -endif () +endif (BUILD_SHARED_LIBS) include (CMakeTests.cmake) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index fc8587b..5b3d0bf 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -13,7 +13,7 @@ if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files") -endif () +endif (BUILD_SHARED_LIBS) if (HDF5_TEST_VFD) set (VFD_LIST @@ -27,14 +27,14 @@ if (HDF5_TEST_VFD) ) if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) - endif () + endif (DIRECT_VFD) foreach (vfdtest ${VFD_LIST}) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") #if (BUILD_SHARED_LIBS) # file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared") - #endif () - endforeach () -endif () + #endif (BUILD_SHARED_LIBS) + endforeach (vfdtest ${VFD_LIST}) +endif (HDF5_TEST_VFD) # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory @@ -56,24 +56,24 @@ if (BUILD_SHARED_LIBS) COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "$" "${PROJECT_BINARY_DIR}/H5TEST-shared/accum_swmr_reader" ) -endif () +endif (BUILD_SHARED_LIBS) foreach (h5_tfile ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST/${h5_tfile}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files") - endif () -endforeach () + endif (BUILD_SHARED_LIBS) +endforeach (h5_tfile ${HDF5_TEST_FILES}) if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (h5_tfile ${HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files") - endif () - endforeach () - endforeach () -endif () + endif (BUILD_SHARED_LIBS) + endforeach (h5_tfile ${HDF5_TEST_FILES}) + endforeach (vfdtest ${VFD_LIST}) +endif (HDF5_TEST_VFD) # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory @@ -90,18 +90,18 @@ foreach (ref_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST/${ref_file}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${ref_file}" "HDF5_TEST_LIBSH_files") - endif () -endforeach () + endif (BUILD_SHARED_LIBS) +endforeach (ref_file ${HDF5_REFERENCE_FILES}) if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (ref_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}/${ref_file}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${ref_file}" "HDF5_TEST_LIBSH_files") - endif () - endforeach () - endforeach () -endif () + endif (BUILD_SHARED_LIBS) + endforeach (ref_file ${HDF5_REFERENCE_FILES}) + endforeach (vfdtest ${VFD_LIST}) +endif (HDF5_TEST_VFD) # -------------------------------------------------------------------- # Copy test files from test/testfiles/plist_files dir to test dir @@ -163,8 +163,8 @@ foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files/${plistfile}" "HDF5_TEST_LIBSH_files") HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files/def_${plistfile}" "HDF5_TEST_LIBSH_files") - endif () -endforeach () + endif (BUILD_SHARED_LIBS) +endforeach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) # -------------------------------------------------------------------- #-- Copy all the HDF5 files from the test directory into the source directory @@ -212,22 +212,22 @@ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST/${h5_file}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST-shared/${h5_file}" "HDF5_TEST_LIBSH_files") - endif () -endforeach () + endif (BUILD_SHARED_LIBS) +endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}/${h5_file}" "HDF5_TEST_LIB_files") if (BUILD_SHARED_LIBS) HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}-shared/${h5_file}" "HDF5_TEST_LIBSH_files") - endif () - endforeach () - endforeach () -endif () + endif (BUILD_SHARED_LIBS) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (vfdtest ${VFD_LIST}) +endif (HDF5_TEST_VFD) add_custom_target(HDF5_TEST_LIB_files ALL COMMENT "Copying files needed by HDF5_TEST_LIB tests" DEPENDS ${HDF5_TEST_LIB_files_list}) if (BUILD_SHARED_LIBS) add_custom_target(HDF5_TEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_TEST_LIBSH tests" DEPENDS ${HDF5_TEST_LIBSH_files_list}) -endif () +endif() # Remove any output file left over from previous test run add_test (NAME H5TEST-clear-testhdf5-objects @@ -279,17 +279,8 @@ if (HDF5_ENABLE_USING_MEMCHECKER) ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -else () - add_test (NAME H5TEST-testhdf5 COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=testhdf5.txt" - #-D "TEST_REFERENCE=testhdf5.out" - -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) +else (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5TEST-testhdf5 COMMAND $) set_tests_properties (H5TEST-testhdf5 PROPERTIES DEPENDS H5TEST-clear-testhdf5-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" @@ -319,23 +310,14 @@ else () WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - add_test (NAME H5TEST-shared-testhdf5 COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=testhdf5.txt" - #-D "TEST_REFERENCE=testhdf5.out" - -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) + add_test (NAME H5TEST-shared-testhdf5 COMMAND $) set_tests_properties (H5TEST-shared-testhdf5 PROPERTIES DEPENDS H5TEST-shared-clear-testhdf5-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - endif () -endif () + endif (BUILD_SHARED_LIBS) +endif (HDF5_ENABLE_USING_MEMCHECKER) ############################################################################## ############################################################################## @@ -364,10 +346,6 @@ set (test_CLEANFILES layout_extend.h5 zero_chunk.h5 chunk_single.h5 - swmr_non_latest.h5 - earray_hdr_fd.h5 - farray_hdr_fd.h5 - bt2_hdr_fd.h5 storage_size.h5 dls_01_strings.h5 extend.h5 @@ -461,7 +439,6 @@ set (test_CLEANFILES tvltypes.h5 tvlstr.h5 tvlstr2.h5 - twriteorder.dat flush.h5 flush-swmr.h5 noflush.h5 @@ -537,24 +514,16 @@ set (test_CLEANFILES vds_dapl.h5 vds_src_0.h5 vds_src_1.h5 - swmr_data.h5 - use_use_append_chunk.h5 - use_append_mchunks.h5 - use_disable_mdc_flushes.h5 tbogus.h5.copy flushrefresh.h5 flushrefresh_VERIFICATION_START flushrefresh_VERIFICATION_CHECKPOINT1 flushrefresh_VERIFICATION_CHECKPOINT2 flushrefresh_VERIFICATION_DONE - atomic_data accum_swmr_big.h5 ohdr_swmr.h5 - test_swmr*.h5 cache_logging.h5 cache_logging.out - vds_swmr.h5 - vds_swmr_src_*.h5 ) # Remove any output file left over from previous test run @@ -596,7 +565,6 @@ set (H5TEST_TESTS objcopy links unlink - twriteorder big mtime fillval @@ -627,37 +595,19 @@ set (H5TEST_TESTS ) foreach (test ${H5TEST_TESTS}) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-${test} COMMAND $) - set_tests_properties (H5TEST-${test} PROPERTIES - DEPENDS H5TEST-clear-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + if (${test} STREQUAL "big" AND CYGWIN) + add_test (NAME H5TEST-${test} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" ) - else () - if (${test} STREQUAL "big" AND CYGWIN) - add_test (NAME H5TEST-${test} - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" - ) - else () - add_test (NAME H5TEST-${test} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=${test}.txt" - #-D "TEST_REFERENCE=${test}.out" - -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () - set_tests_properties (H5TEST-${test} PROPERTIES - DEPENDS H5TEST-clear-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST - ) - endif () -endforeach () + else (${test} STREQUAL "big" AND CYGWIN) + add_test (NAME H5TEST-${test} COMMAND $) + endif (${test} STREQUAL "big" AND CYGWIN) + set_tests_properties (H5TEST-${test} PROPERTIES + DEPENDS H5TEST-clear-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + ) +endforeach (test ${H5TEST_TESTS}) set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1) set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT 1800) @@ -680,31 +630,22 @@ if (BUILD_SHARED_LIBS) add_test (NAME H5TEST-shared-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" ) - else () - add_test (NAME H5TEST-shared-${test} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=${test}.txt" - #-D "TEST_REFERENCE=${test}.out" - -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + else (${test} STREQUAL "big" AND CYGWIN) + add_test (NAME H5TEST-shared-${test} COMMAND $) + endif (${test} STREQUAL "big" AND CYGWIN) set_tests_properties (H5TEST-shared-${test} PROPERTIES DEPENDS H5TEST-shared-clear-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - endforeach () + endforeach (test ${H5TEST_TESTS}) set_tests_properties (H5TEST-shared-flush2 PROPERTIES DEPENDS H5TEST-shared-flush1) set_tests_properties (H5TEST-shared-fheap PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-big PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-btree2 PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-objcopy PROPERTIES TIMEOUT 1800) -endif () +endif (BUILD_SHARED_LIBS) ############################################################################## ############################################################################## @@ -721,43 +662,14 @@ if (NOT CYGWIN) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-cache COMMAND $) - else () - add_test (NAME H5TEST-cache COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=cache.txt" - #-D "TEST_REFERENCE=cache.out" - -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME H5TEST-cache COMMAND $) set_tests_properties (H5TEST-cache PROPERTIES DEPENDS H5TEST-clear-cache-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 1800) -endif () - -#-- Adding test for cache_image -add_test ( - NAME H5TEST-clear-cache_image-objects - COMMAND ${CMAKE_COMMAND} - -E remove - cache_image_test.h5 - WORKING_DIRECTORY - ${HDF5_TEST_BINARY_DIR}/H5TEST -) -add_test (NAME H5TEST-cache_image COMMAND $) -set_tests_properties (H5TEST-cache_image PROPERTIES - DEPENDS H5TEST-clear-cache_image-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST -) +endif (NOT CYGWIN) #-- Adding test for err_compat if (HDF5_ENABLE_DEPRECATED_SYMBOLS) @@ -784,7 +696,7 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -endif () +endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test add_test (NAME H5TEST-clear-error_test-objects @@ -849,7 +761,7 @@ add_test (NAME H5TEST-testlibinfo if (BUILD_SHARED_LIBS) #-- Adding test for cache - if (NOT CYGWIN AND NOT WIN32) + if (NOT CYGWIN) add_test (NAME H5TEST-shared-clear-cache-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -857,27 +769,14 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5TEST-shared-cache COMMAND $) - else () - add_test (NAME H5TEST-shared-cache COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=cache-shared.txt" - #-D "TEST_REFERENCE=cache-shared.out" - -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () + add_test (NAME H5TEST-shared-cache COMMAND $) set_tests_properties (H5TEST-shared-cache PROPERTIES DEPENDS H5TEST-shared-clear-cache-objects ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) set_tests_properties (H5TEST-shared-cache PROPERTIES TIMEOUT 1800) - endif () + endif (NOT CYGWIN) #-- Adding test for err_compat if (HDF5_ENABLE_DEPRECATED_SYMBOLS) @@ -904,7 +803,7 @@ if (BUILD_SHARED_LIBS) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - endif () + endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test add_test (NAME H5TEST-shared-clear-error_test-objects @@ -966,16 +865,16 @@ if (BUILD_SHARED_LIBS) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) -endif () +endif (BUILD_SHARED_LIBS) ############################################################################## ### P L U G I N T E S T S ############################################################################## if (WIN32) set (CMAKE_SEP "\;") -else () +else (WIN32) set (CMAKE_SEP ":") -endif () +endif (WIN32) add_test (NAME H5PLUGIN-plugin COMMAND $) set_tests_properties (H5PLUGIN-plugin PROPERTIES @@ -987,9 +886,6 @@ set_tests_properties (H5PLUGIN-plugin PROPERTIES ### S W M R T E S T S ############################################################################## # testflushrefresh.sh: flushrefresh -# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes -# testswmr.sh: swmr* -# testvdsswmr.sh: vds_swmr* ############################################################################## ############################################################################## @@ -1057,10 +953,9 @@ if (HDF5_TEST_VFD) ) if (NOT CYGWIN) set (H5_VFD_TESTS ${H5_VFD_TESTS} big cache) - endif () + endif (NOT CYGWIN) - # Windows only macro - macro (CHECK_VFD_TEST vfdtest vfdname resultcode) + MACRO (CHECK_VFD_TEST vfdtest vfdname resultcode) if (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") if (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) @@ -1093,8 +988,8 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif () - else () + endif (BUILD_SHARED_LIBS) + else (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}" ) @@ -1102,9 +997,9 @@ if (HDF5_TEST_VFD) add_test (NAME VFD-${vfdname}-${test}-shared COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" ) - endif () - endif () - else () + endif (BUILD_SHARED_LIBS) + endif(NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) + else (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -1134,9 +1029,9 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif () - endif () - else () + endif (BUILD_SHARED_LIBS) + endif (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") + else (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -1151,7 +1046,7 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS AND NOT ${vfdtest} STREQUAL "cache") + if (BUILD_SHARED_LIBS) add_test (NAME VFD-${vfdname}-${vfdtest}-shared COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -1166,15 +1061,15 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif () - endif () - endmacro () + endif (BUILD_SHARED_LIBS) + endif (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") + ENDMACRO (CHECK_VFD_TEST vfdtest vfdname resultcode) - macro (ADD_VFD_TEST vfdname resultcode) + MACRO (ADD_VFD_TEST vfdname resultcode) foreach (test ${H5_VFD_TESTS}) if (WIN32) CHECK_VFD_TEST (${test} ${vfdname} ${resultcode}) - else () + else (WIN32) add_test (NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -1204,25 +1099,25 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif () - endif () - endforeach () + endif (BUILD_SHARED_LIBS) + endif (WIN32) + endforeach (test ${H5_VFD_TESTS}) set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1) set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT 1800) if (NOT CYGWIN) set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800) - endif () + endif (NOT CYGWIN) if (BUILD_SHARED_LIBS) set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1800) - if (NOT CYGWIN AND NOT WIN32) + if (NOT CYGWIN) set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) - endif () - endif () + endif (NOT CYGWIN) + endif (BUILD_SHARED_LIBS) if (HDF5_TEST_FHEAP_VFD) add_test (NAME VFD-${vfdname}-fheap COMMAND "${CMAKE_COMMAND}" @@ -1255,16 +1150,16 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared ) - endif () - endif () - endmacro () + endif (BUILD_SHARED_LIBS) + endif (HDF5_TEST_FHEAP_VFD) + ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - endforeach () + endforeach (vfd ${VFD_LIST}) -endif () +endif (HDF5_TEST_VFD) ############################################################################## ############################################################################## @@ -1273,13 +1168,13 @@ endif () ############################################################################## if (HDF5_BUILD_GENERATORS) - macro (ADD_H5_GENERATOR genfile) + MACRO (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) TARGET_NAMING (${genfile} STATIC) TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/test) - endmacro () + ENDMACRO (ADD_H5_GENERATOR genfile) # generator executables set (H5_GENERATORS @@ -1288,7 +1183,6 @@ if (HDF5_BUILD_GENERATORS) gen_cross gen_deflate gen_filters - gen_idx gen_new_array gen_new_fill gen_new_group @@ -1307,6 +1201,6 @@ if (HDF5_BUILD_GENERATORS) foreach (gen ${H5_GENERATORS}) ADD_H5_GENERATOR (${gen}) - endforeach () + endforeach (gen ${H5_GENERATORS}) -endif () +endif (HDF5_BUILD_GENERATORS) diff --git a/test/Makefile.am b/test/Makefile.am index 98cfc42..37883c4 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -29,17 +29,10 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_builddir)/src # testcheck_version.sh: tcheck_version # tetlinks_env.sh: links_env # testflushrefresh.sh: flushrefresh -# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes -# testswmr.sh: swmr* -# testvdsswmr.sh: vds_swmr* TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh \ - testswmr.sh testvdsswmr.sh testflushrefresh.sh test_usecases.sh + testflushrefresh.sh SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) \ - flushrefresh$(EXEEXT) use_append_chunk$(EXEEXT) use_append_mchunks$(EXEEXT) use_disable_mdc_flushes$(EXEEXT) \ - swmr_generator$(EXEEXT) swmr_reader$(EXEEXT) swmr_writer$(EXEEXT) \ - swmr_remove_reader$(EXEEXT) swmr_remove_writer$(EXEEXT) swmr_addrem_writer$(EXEEXT) \ - swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) swmr_start_write$(EXEEXT) \ - vds_swmr_gen$(EXEEXT) vds_swmr_reader$(EXEEXT) vds_swmr_writer$(EXEEXT) + testflushrefresh.sh if HAVE_SHARED_CONDITIONAL TEST_SCRIPT += test_plugin.sh SCRIPT_DEPEND += plugin$(EXEEXT) @@ -51,12 +44,11 @@ check_SCRIPTS = $(TEST_SCRIPT) # executed, generally most specific tests to least specific tests. # As an exception, long-running tests should occur earlier in the list. # This gives them more time to run when tests are executing in parallel. -TEST_PROG= testhdf5 \ - cache cache_api cache_image cache_tagging lheap ohdr stab gheap \ +TEST_PROG= testhdf5 cache cache_api cache_tagging lheap ohdr stab gheap \ evict_on_close farray earray btree2 fheap \ pool accum hyperslab istore bittests dt_arith \ dtypes dsets cmpd_dset filter_fail extend external efc objcopy links unlink \ - twriteorder big mtime fillval mount flush1 flush2 app_ref enum \ + big mtime fillval mount flush1 flush2 app_ref enum \ set_extent ttsafe enc_dec_plist enc_dec_plist_cross_platform\ getname vfd ntypes dangle dtransform reserved cross_read \ freespace mf vds file_image unregister cache_logging cork swmr @@ -65,21 +57,15 @@ TEST_PROG= testhdf5 \ # error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh. # tcheck_version is used by testcheck_version.sh. # accum_swmr_reader is used by accum.c. -# atomic_writer and atomic_reader are standalone programs. # links_env is used by testlinks_env.sh # flushrefresh is used by testflushrefresh.sh. -# use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh -# swmr_* files (besides swmr.c) are used by testswmr.sh. -# vds_swmr_* files are used by testvdsswmr.sh # 'make check' doesn't run them directly, so they are not included in TEST_PROG. # Also build testmeta, which is used for timings test. It builds quickly, # and this lets automake keep all its test programs in one place. check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ - testmeta accum_swmr_reader atomic_writer atomic_reader \ - links_env flushrefresh use_append_chunk use_append_mchunks use_disable_mdc_flushes \ - swmr_generator swmr_start_write swmr_reader swmr_writer swmr_remove_reader \ - swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer \ - swmr_check_compat_vfd vds_swmr_gen vds_swmr_reader vds_swmr_writer + testmeta accum_swmr_reader \ + links_env flushrefresh \ + swmr_check_compat_vfd if HAVE_SHARED_CONDITIONAL check_PROGRAMS+= plugin endif @@ -91,7 +77,7 @@ endif # --enable-build-all at configure time. # The gen_old_* files can only be compiled with older versions of the library # so do not appear in this list. -BUILD_ALL_PROGS=gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_idx gen_new_array \ +BUILD_ALL_PROGS=gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_new_array \ gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \ gen_nullspace gen_udlinks space_overflow gen_filespace gen_specmetaread \ gen_sizes_lheap gen_file_image gen_plist @@ -120,7 +106,7 @@ else noinst_LTLIBRARIES=libh5test.la endif -libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c +libh5test_la_SOURCES=h5test.c testframe.c cache_common.c # Use libhd5test.la to compile all of the tests LDADD=libh5test.la $(LIBHDF5) @@ -128,7 +114,6 @@ LDADD=libh5test.la $(LIBHDF5) # List the source files for tests that have more than one ttsafe_SOURCES=ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \ ttsafe_acreate.c -cache_image_SOURCES=cache_image.c genall5.c VFD_LIST = sec2 stdio core core_paged split multi family if DIRECT_VFD_CONDITIONAL @@ -168,7 +153,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse stdio.h5 sec2.h5 dtypes[0-9].h5 dtypes1[0].h5 dt_arith[1-2].h5 tattr.h5 \ tselect.h5 mtime.h5 unlink.h5 unicode.h5 coord.h5 \ fillval_[0-9].h5 fillval.raw mount_[0-9].h5 testmeta.h5 ttime.h5 \ - trefer[1-3].h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 twriteorder.dat \ + trefer[1-3].h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 \ flush.h5 flush-swmr.h5 noflush.h5 noflush-swmr.h5 flush_extend.h5 \ flush_extend-swmr.h5 noflush_extend.h5 noflush_extend-swmr.h5 \ enum1.h5 titerate.h5 ttsafe.h5 tarray1.h5 tgenprop.h5 \ @@ -185,27 +170,19 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ file_image_core_test.h5.copy unregister_filter_1.h5 unregister_filter_2.h5 \ vds_virt.h5 vds_dapl.h5 vds_src_[0-1].h5 \ - swmr_data.h5 use_use_append_chunk.h5 use_append_mchunks.h5 use_disable_mdc_flushes.h5 \ flushrefresh.h5 flushrefresh_VERIFICATION_START \ flushrefresh_VERIFICATION_CHECKPOINT1 flushrefresh_VERIFICATION_CHECKPOINT2 \ - flushrefresh_VERIFICATION_DONE atomic_data accum_swmr_big.h5 ohdr_swmr.h5 \ - test_swmr*.h5 cache_logging.h5 cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 \ - swmr[0-2].h5 swmr_writer.out swmr_writer.log.* swmr_reader.out.* swmr_reader.log.* \ - tbogus.h5.copy cache_image_test.h5 - + flushrefresh_VERIFICATION_DONE accum_swmr_big.h5 ohdr_swmr.h5 \ + cache_logging.h5 cache_logging.out \ + swmr[0-2].h5 # Sources for testhdf5 executable testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ tgenprop.c th5o.c th5s.c tcoords.c theap.c tid.c titerate.c tmeta.c tmisc.c \ trefer.c trefstr.c tselect.c tskiplist.c tsohm.c ttime.c ttst.c tunicode.c \ tvlstr.c tvltypes.c -# Sources for Use Cases -use_append_chunk_SOURCES=use_append_chunk.c use_common.c -use_append_mchunks_SOURCES=use_append_mchunks.c use_common.c -use_disable_mdc_flushes_SOURCES=use_disable_mdc_flushes.c - # Temporary files. DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh \ - testswmr.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh + testflushrefresh.sh include $(top_srcdir)/config/conclude.am diff --git a/test/cache.c b/test/cache.c index 87b1272..2209d8f 100644 --- a/test/cache.c +++ b/test/cache.c @@ -19,6 +19,9 @@ * This file contains tests for the cache implemented in * H5C.c */ +#include "h5test.h" +#include "H5Iprivate.h" +#include "H5ACprivate.h" #include "cache_common.h" @@ -115,12 +118,12 @@ static void check_flush_cache__multi_entry(H5F_t * file_ptr); static void check_flush_cache__multi_entry_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, - unsigned int spec_size, + int spec_size, struct flush_cache_test_spec spec[]); static void check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, - unsigned int spec_size, + int spec_size, struct pe_flush_cache_test_spec spec[]); static void check_flush_cache__single_entry(H5F_t * file_ptr); static void check_flush_cache__single_entry_test(H5F_t * file_ptr, @@ -152,9 +155,9 @@ static void check_flush_cache__flush_op_test(H5F_t * file_ptr, unsigned int flush_flags, int spec_size, const struct fo_flush_cache_test_spec spec[], - unsigned init_expected_index_len, + int init_expected_index_len, size_t init_expected_index_size, - unsigned expected_index_len, + int expected_index_len, size_t expected_index_size, int check_size, struct fo_flush_entry_check check[]); @@ -3309,7 +3312,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) { int test_num = 1; unsigned int flush_flags = H5C__NO_FLAGS_SET; - unsigned int spec_size = 8; + int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3403,7 +3406,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) { int test_num = 2; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - unsigned int spec_size = 8; + int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3497,7 +3500,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) { int test_num = 3; unsigned int flush_flags = H5C__FLUSH_CLEAR_ONLY_FLAG; - unsigned int spec_size = 8; + int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3591,7 +3594,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) { int test_num = 4; unsigned int flush_flags = H5C__FLUSH_MARKED_ENTRIES_FLAG; - unsigned int spec_size = 8; + int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3686,7 +3689,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) int test_num = 5; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG; - unsigned int spec_size = 8; + int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3781,7 +3784,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) int test_num = 6; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG; - unsigned int spec_size = 8; + int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3876,7 +3879,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) int test_num = 7; unsigned int flush_flags = H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG; - unsigned int spec_size = 8; + int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -3972,7 +3975,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG; - unsigned int spec_size = 8; + int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -4070,7 +4073,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) ~(H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG); - unsigned int spec_size = 8; + int spec_size = 8; struct flush_cache_test_spec spec[8] = { { @@ -4169,7 +4172,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) { int test_num = 1; unsigned int flush_flags = H5C__NO_FLAGS_SET; - unsigned int spec_size = 8; + int spec_size = 8; struct pe_flush_cache_test_spec spec[8] = { { @@ -4315,7 +4318,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) { int test_num = 2; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; - unsigned int spec_size = 8; + int spec_size = 8; struct pe_flush_cache_test_spec spec[8] = { { @@ -4445,7 +4448,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) int test_num = 3; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG; - unsigned int spec_size = 8; + int spec_size = 8; struct pe_flush_cache_test_spec spec[8] = { { @@ -4567,7 +4570,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) int test_num = 4; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG; - unsigned int spec_size = 8; + int spec_size = 8; struct pe_flush_cache_test_spec spec[8] = { { @@ -4698,7 +4701,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG; - unsigned int spec_size = 8; + int spec_size = 8; struct pe_flush_cache_test_spec spec[8] = { { @@ -4842,13 +4845,13 @@ static void check_flush_cache__multi_entry_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, - unsigned int spec_size, + int spec_size, struct flush_cache_test_spec spec[]) { H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; herr_t result; - unsigned u; + int i; size_t total_entry_size = 0; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -4887,43 +4890,43 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, failure_mssg = msg; } - u = 0; - while(pass && (u < spec_size)) + i = 0; + while(pass && (i < spec_size)) { - if(((unsigned)spec[u].entry_num != u) || - (spec[u].entry_type < 0) || - (spec[u].entry_type >= NUMBER_OF_ENTRY_TYPES) || - (spec[u].entry_index < 0) || - (spec[u].entry_index > max_indices[spec[u].entry_type])) { + if((spec[i].entry_num != i) || + (spec[i].entry_type < 0) || + (spec[i].entry_type >= NUMBER_OF_ENTRY_TYPES) || + (spec[i].entry_index < 0) || + (spec[i].entry_index > max_indices[spec[i].entry_type])) { pass = FALSE; HDsnprintf(msg, (size_t)128, - "bad data in spec[%u] on entry to multi entry test #%d.", - u, test_num); + "bad data in spec[%d] on entry to multi entry test #%d.", + i, test_num); failure_mssg = msg; } - u++; + i++; } - u = 0; - while(pass && (u < spec_size)) + i = 0; + while(pass && (i < spec_size)) { - if(spec[u].insert_flag) { + if(spec[i].insert_flag) { - insert_entry(file_ptr, spec[u].entry_type, spec[u].entry_index, - spec[u].flags); + insert_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, + spec[i].flags); } else { - protect_entry(file_ptr, spec[u].entry_type, spec[u].entry_index); + protect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index); - unprotect_entry(file_ptr, spec[u].entry_type, spec[u].entry_index, - spec[u].flags); + unprotect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, + spec[i].flags); } - total_entry_size += entry_sizes[spec[u].entry_type]; + total_entry_size += entry_sizes[spec[i].entry_type]; - u++; + i++; } if(pass) { @@ -4940,36 +4943,36 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, } } - u = 0; - while(pass && (u < spec_size)) + i = 0; + while(pass && (i < spec_size)) { - base_addr = entries[spec[u].entry_type]; - entry_ptr = &(base_addr[spec[u].entry_index]); + base_addr = entries[spec[i].entry_type]; + entry_ptr = &(base_addr[spec[i].entry_index]); - if((entry_ptr->deserialized != spec[u].expected_deserialized) || - (entry_ptr->serialized != spec[u].expected_serialized) || - (entry_ptr->destroyed != spec[u].expected_destroyed)) { + if((entry_ptr->deserialized != spec[i].expected_deserialized) || + (entry_ptr->serialized != spec[i].expected_serialized) || + (entry_ptr->destroyed != spec[i].expected_destroyed)) { #if 0 /* This is useful debugging code. Lets keep it around. */ HDfprintf(stdout, "deslzd = %d(%d), slzd = %d(%d), dest = %d(%d)\n", (int)(entry_ptr->deserialized), - (int)(spec[u].expected_deserialized), + (int)(spec[i].expected_deserialized), (int)(entry_ptr->serialized), - (int)(spec[u].expected_serialized), + (int)(spec[i].expected_serialized), (int)(entry_ptr->destroyed), - (int)(spec[u].expected_destroyed)); + (int)(spec[i].expected_destroyed)); #endif pass = FALSE; HDsnprintf(msg, (size_t)128, - "Bad status on entry %u after flush in multi entry test #%d.", - u, test_num); + "Bad status on entry %d after flush in multi entry test #%d.", + i, test_num); failure_mssg = msg; } - u++; + i++; } if(pass) { @@ -5024,17 +5027,17 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, } } - u = 0; - while(pass && (u < spec_size)) + i = 0; + while(pass && (i < spec_size)) { - base_addr = entries[spec[u].entry_type]; - entry_ptr = &(base_addr[spec[u].entry_index]); + base_addr = entries[spec[i].entry_type]; + entry_ptr = &(base_addr[spec[i].entry_index]); entry_ptr->deserialized = FALSE; entry_ptr->serialized = FALSE; entry_ptr->destroyed = FALSE; - u++; + i++; } return; @@ -5061,13 +5064,13 @@ static void check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, int test_num, unsigned int flush_flags, - unsigned int spec_size, + int spec_size, struct pe_flush_cache_test_spec spec[]) { H5C_t *cache_ptr = file_ptr->shared->cache; static char msg[128]; herr_t result; - unsigned u; + int i; int j; size_t total_entry_size = 0; test_entry_t * base_addr; @@ -5107,54 +5110,54 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, failure_mssg = msg; } - u = 0; - while(pass && (u < spec_size)) + i = 0; + while(pass && (i < spec_size)) { - if(((unsigned)spec[u].entry_num != u) || - (spec[u].entry_type < 0) || - (spec[u].entry_type >= NUMBER_OF_ENTRY_TYPES) || - (spec[u].entry_index < 0) || - (spec[u].entry_index > max_indices[spec[u].entry_type]) || - (spec[u].num_pins < 0) || - (spec[u].num_pins > MAX_PINS)) { + if((spec[i].entry_num != i) || + (spec[i].entry_type < 0) || + (spec[i].entry_type >= NUMBER_OF_ENTRY_TYPES) || + (spec[i].entry_index < 0) || + (spec[i].entry_index > max_indices[spec[i].entry_type]) || + (spec[i].num_pins < 0) || + (spec[i].num_pins > MAX_PINS)) { pass = FALSE; HDsnprintf(msg, (size_t)128, - "bad data in spec[%u] on entry to pe multi entry test #%d.", - u, test_num); + "bad data in spec[%d] on entry to pe multi entry test #%d.", + i, test_num); failure_mssg = msg; } - u++; + i++; } - u = 0; - while(pass && (u < spec_size)) + i = 0; + while(pass && (i < spec_size)) { - if(spec[u].insert_flag) { + if(spec[i].insert_flag) { - insert_entry(file_ptr, spec[u].entry_type, spec[u].entry_index, - spec[u].flags); + insert_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, + spec[i].flags); } else { - protect_entry(file_ptr, spec[u].entry_type, spec[u].entry_index); + protect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index); - unprotect_entry(file_ptr, spec[u].entry_type, spec[u].entry_index, - spec[u].flags); + unprotect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, + spec[i].flags); } - total_entry_size += entry_sizes[spec[u].entry_type]; + total_entry_size += entry_sizes[spec[i].entry_type]; - for (j = 0; j < spec[u].num_pins; j++) + for (j = 0; j < spec[i].num_pins; j++) { create_pinned_entry_dependency(file_ptr, - spec[u].entry_type, - spec[u].entry_index, - spec[u].pin_type[j], - spec[u].pin_idx[j]); + spec[i].entry_type, + spec[i].entry_index, + spec[i].pin_type[j], + spec[i].pin_idx[j]); } - u++; + i++; } if(pass) { @@ -5171,36 +5174,36 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, } } - u = 0; - while(pass && (u < spec_size)) + i = 0; + while(pass && (i < spec_size)) { - base_addr = entries[spec[u].entry_type]; - entry_ptr = &(base_addr[spec[u].entry_index]); + base_addr = entries[spec[i].entry_type]; + entry_ptr = &(base_addr[spec[i].entry_index]); - if((entry_ptr->deserialized != spec[u].expected_deserialized) || - (entry_ptr->serialized != spec[u].expected_serialized) || - (entry_ptr->destroyed != spec[u].expected_destroyed)) { + if((entry_ptr->deserialized != spec[i].expected_deserialized) || + (entry_ptr->serialized != spec[i].expected_serialized) || + (entry_ptr->destroyed != spec[i].expected_destroyed)) { #if 0 /* This is useful debugging code. Lets keep it around. */ HDfprintf(stdout, "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", (int)(entry_ptr->deserialized), - (int)(spec[u].expected_deserialized), + (int)(spec[i].expected_deserialized), (int)(entry_ptr->serialized), - (int)(spec[u].expected_serialized), + (int)(spec[i].expected_serialized), (int)(entry_ptr->destroyed), - (int)(spec[u].expected_destroyed)); + (int)(spec[i].expected_destroyed)); #endif pass = FALSE; HDsnprintf(msg, (size_t)128, - "Bad status on entry %u after flush in pe multi entry test #%d.", - u, test_num); + "Bad status on entry %d after flush in pe multi entry test #%d.", + i, test_num); failure_mssg = msg; } - u++; + i++; } if(pass) { @@ -5255,17 +5258,17 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, } } - u = 0; - while(pass && (u < spec_size)) + i = 0; + while(pass && (i < spec_size)) { - base_addr = entries[spec[u].entry_type]; - entry_ptr = &(base_addr[spec[u].entry_index]); + base_addr = entries[spec[i].entry_type]; + entry_ptr = &(base_addr[spec[i].entry_index]); entry_ptr->deserialized = FALSE; entry_ptr->serialized = FALSE; entry_ptr->destroyed = FALSE; - u++; + i++; } return; @@ -5320,9 +5323,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 1; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 2; - unsigned init_expected_index_len = 2; + int init_expected_index_len = 2; size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE; - unsigned expected_index_len = 2; + int expected_index_len = 2; size_t expected_index_size = 2 * PICO_ENTRY_SIZE; struct fo_flush_cache_test_spec spec[2] = { @@ -5427,9 +5430,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 2; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 2; - unsigned init_expected_index_len = 2; + int init_expected_index_len = 2; size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE; - unsigned expected_index_len = 0; + int expected_index_len = 0; size_t expected_index_size = 0; struct fo_flush_cache_test_spec spec[2] = { @@ -5531,9 +5534,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 3; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - unsigned init_expected_index_len = 1; + int init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4; - unsigned expected_index_len = 1; + int expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; struct fo_flush_cache_test_spec spec[1] = { @@ -5609,9 +5612,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 4; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 1; - unsigned init_expected_index_len = 1; + int init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4; - unsigned expected_index_len = 0; + int expected_index_len = 0; size_t expected_index_size = 0; struct fo_flush_cache_test_spec spec[1] = { @@ -5694,9 +5697,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 5; /* and 6 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - unsigned init_expected_index_len = 1; + int init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 1; + int expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; struct fo_flush_cache_test_spec spec[1] = { @@ -5811,9 +5814,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 7; /* and 8 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - unsigned init_expected_index_len = 1; + int init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 1; + int expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; struct fo_flush_cache_test_spec spec[1] = { @@ -5924,9 +5927,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 9; /* and 10 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - unsigned init_expected_index_len = 1; + int init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2; - unsigned expected_index_len = 1; + int expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4; struct fo_flush_cache_test_spec spec[1] = { @@ -6035,9 +6038,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 11; /* and 12 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - unsigned init_expected_index_len = 1; + int init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2; - unsigned expected_index_len = 1; + int expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4; struct fo_flush_cache_test_spec spec[1] = { @@ -6149,9 +6152,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 13; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - unsigned init_expected_index_len = 1; + int init_expected_index_len = 1; size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE; - unsigned expected_index_len = 3; + int expected_index_len = 3; size_t expected_index_size = 3 * PICO_ENTRY_SIZE; struct fo_flush_cache_test_spec spec[1] = { @@ -6245,9 +6248,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 14; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 1; - unsigned init_expected_index_len = 1; + int init_expected_index_len = 1; size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE; - unsigned expected_index_len = 0; + int expected_index_len = 0; size_t expected_index_size = (size_t)0; struct fo_flush_cache_test_spec spec[1] = { @@ -6338,9 +6341,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 15; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - unsigned init_expected_index_len = 1; + int init_expected_index_len = 1; size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 3; + int expected_index_len = 3; size_t expected_index_size = VARIABLE_ENTRY_SIZE + (VARIABLE_ENTRY_SIZE / 4) + (VARIABLE_ENTRY_SIZE / 2); @@ -6435,9 +6438,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 16; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 1; - unsigned init_expected_index_len = 1; + int init_expected_index_len = 1; size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 0; + int expected_index_len = 0; size_t expected_index_size = (size_t)0; struct fo_flush_cache_test_spec spec[1] = { @@ -6528,9 +6531,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 17; /* and 18 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - unsigned init_expected_index_len = 1; + int init_expected_index_len = 1; size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 3; + int expected_index_len = 3; size_t expected_index_size = VARIABLE_ENTRY_SIZE + (VARIABLE_ENTRY_SIZE / 4) + (VARIABLE_ENTRY_SIZE / 2); @@ -6655,9 +6658,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 19; /* and 20 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 1; - unsigned init_expected_index_len = 1; + int init_expected_index_len = 1; size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 3; + int expected_index_len = 3; size_t expected_index_size = VARIABLE_ENTRY_SIZE + (VARIABLE_ENTRY_SIZE / 4) + (VARIABLE_ENTRY_SIZE / 2); @@ -6793,9 +6796,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 21; unsigned int flush_flags = H5C__FLUSH_MARKED_ENTRIES_FLAG; int spec_size = 4; - unsigned init_expected_index_len = 4; + int init_expected_index_len = 4; size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (2 * PICO_ENTRY_SIZE); - unsigned expected_index_len = 6; + int expected_index_len = 6; size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (VARIABLE_ENTRY_SIZE / 4) + (VARIABLE_ENTRY_SIZE / 2) + @@ -7004,9 +7007,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 22; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 6; - unsigned init_expected_index_len = 6; + int init_expected_index_len = 6; size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE); - unsigned expected_index_len = 10; + int expected_index_len = 10; size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (2 * (VARIABLE_ENTRY_SIZE / 4)) + (2 * (VARIABLE_ENTRY_SIZE / 2)) + @@ -7273,9 +7276,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 23; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 6; - unsigned init_expected_index_len = 6; + int init_expected_index_len = 6; size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE); - unsigned expected_index_len = 0; + int expected_index_len = 0; size_t expected_index_size = 0; struct fo_flush_cache_test_spec spec[6] = { @@ -7535,9 +7538,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 24; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 3; - unsigned init_expected_index_len = 3; + int init_expected_index_len = 3; size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE; - unsigned expected_index_len = 3; + int expected_index_len = 3; size_t expected_index_size = 3 * PICO_ENTRY_SIZE; struct fo_flush_cache_test_spec spec[3] = { @@ -7668,9 +7671,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 25; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 3; - unsigned init_expected_index_len = 3; + int init_expected_index_len = 3; size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE; - unsigned expected_index_len = 0; + int expected_index_len = 0; size_t expected_index_size = (size_t)0; struct fo_flush_cache_test_spec spec[3] = { @@ -7871,9 +7874,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 26; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 10; - unsigned init_expected_index_len = 10; + int init_expected_index_len = 10; size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 13; + int expected_index_len = 13; size_t expected_index_size = 9 * VARIABLE_ENTRY_SIZE; struct fo_flush_cache_test_spec spec[10] = { @@ -8305,9 +8308,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 27; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 10; - unsigned init_expected_index_len = 10; + int init_expected_index_len = 10; size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 0; + int expected_index_len = 0; size_t expected_index_size = (size_t)0; struct fo_flush_cache_test_spec spec[10] = { @@ -8664,9 +8667,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 28; unsigned int flush_flags = H5C__NO_FLAGS_SET; int spec_size = 5; - unsigned init_expected_index_len = 5; + int init_expected_index_len = 5; size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 5; + int expected_index_len = 5; size_t expected_index_size = 4 * VARIABLE_ENTRY_SIZE; struct fo_flush_cache_test_spec spec[5] = { @@ -8856,9 +8859,9 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int test_num = 29; unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; int spec_size = 5; - unsigned init_expected_index_len = 5; + int init_expected_index_len = 5; size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE; - unsigned expected_index_len = 0; + int expected_index_len = 0; size_t expected_index_size = 0; struct fo_flush_cache_test_spec spec[5] = { @@ -9067,9 +9070,9 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, unsigned int flush_flags, int spec_size, const struct fo_flush_cache_test_spec spec[], - unsigned init_expected_index_len, + int init_expected_index_len, size_t init_expected_index_size, - unsigned expected_index_len, + int expected_index_len, size_t expected_index_size, int check_size, struct fo_flush_entry_check check[]) @@ -13697,7 +13700,7 @@ check_move_entry(void) { unsigned u; H5F_t * file_ptr = NULL; - struct move_entry_test_spec test_specs[4] = + struct move_entry_test_spec test_specs[8] = { { /* int entry_type = */ PICO_ENTRY_TYPE, @@ -15898,6 +15901,7 @@ check_destroy_pinned_err(void) * should fail. Unpin the entry and flush destroy again -- should * succeed. */ + if(pass) { reset_entries(); @@ -15908,7 +15912,7 @@ check_destroy_pinned_err(void) protect_entry(file_ptr, 0, 0); unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); - if(H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0) { + if(H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { pass = FALSE; failure_mssg = "unexpected failure of prep for file close.\n"; } /* end if */ @@ -15924,8 +15928,9 @@ check_destroy_pinned_err(void) pass = FALSE; failure_mssg = "destroy failed after unpin.\n"; } /* end if */ - else + else { file_ptr->shared->cache = NULL; + } /* end else */ } /* end else */ if(saved_cache != NULL) { @@ -15987,16 +15992,16 @@ check_destroy_protected_err(void) file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); - /* Note: normally this call would go just before the series of - * flushes prior to file close -- in particular, all entries + /* Note: normally this call would go just before the series of + * flushes prior to file close -- in particular, all entries * should be unprotected when this call is made. * * Thus H5C_prep_for_file_close() contains an assert to verify - * this. Since this assert would be triggered by the condition + * this. Since this assert would be triggered by the condition * we are trying to test, put the call to H5C_prep_for_file_close() * prior to the final protect call. */ - if(H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0) { + if(H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { pass = FALSE; failure_mssg = "unexpected failure of prep for file close.\n"; } /* end if */ @@ -16088,7 +16093,7 @@ check_duplicate_insert_err(void) entry_ptr = &(base_addr[0]); result = H5C_insert_entry(file_ptr, H5AC_ind_read_dxpl_id, - types[0], entry_ptr->addr, + &(types[0]), entry_ptr->addr, (void *)entry_ptr, H5C__NO_FLAGS_SET); if(result >= 0) { @@ -16456,7 +16461,7 @@ check_double_protect_err(void) if(pass) { cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, - types[0], entry_ptr->addr, + &(types[0]), entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); if(cache_entry_ptr != NULL) { @@ -16700,7 +16705,7 @@ check_expunge_entry_errs(void) if(pass) { result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, - types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); + &(types[0]), entry_ptr->addr, H5C__NO_FLAGS_SET); if(result > 0) { @@ -16718,7 +16723,7 @@ check_expunge_entry_errs(void) if(pass) { result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, - types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); + &(types[0]), entry_ptr->addr, H5C__NO_FLAGS_SET); if(result > 0) { @@ -16736,7 +16741,7 @@ check_expunge_entry_errs(void) if(pass) { result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, - types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); + &(types[0]), entry_ptr->addr, H5C__NO_FLAGS_SET); if(result < 0) { @@ -16779,6 +16784,7 @@ check_expunge_entry_errs(void) * *------------------------------------------------------------------------- */ + static unsigned check_move_entry_errs(void) { @@ -16800,6 +16806,7 @@ check_move_entry_errs(void) */ if(pass) { + reset_entries(); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); @@ -16812,29 +16819,36 @@ check_move_entry_errs(void) entry_0_0_ptr = &((entries[0])[0]); entry_0_1_ptr = &((entries[0])[1]); entry_1_0_ptr = &((entries[1])[0]); - } /* end if */ + } if(pass) { - result = H5C_move_entry(cache_ptr, types[0], entry_0_0_ptr->addr, entry_0_1_ptr->addr); + + result = H5C_move_entry(cache_ptr, &(types[0]), + entry_0_0_ptr->addr, entry_0_1_ptr->addr); if(result >= 0) { + pass = FALSE; failure_mssg = "move to addr of same type succeeded.\n"; - } /* end if */ - } /* end if */ + } + } if(pass) { - result = H5C_move_entry(cache_ptr, types[0], entry_0_0_ptr->addr, entry_1_0_ptr->addr); + + result = H5C_move_entry(cache_ptr, &(types[0]), + entry_0_0_ptr->addr, entry_1_0_ptr->addr); if(result >= 0) { + pass = FALSE; failure_mssg = "move to addr of different type succeeded.\n"; - } /* end if */ - } /* end if */ + } + } if(pass) takedown_cache(file_ptr, FALSE, FALSE); + /* Allocate a cache, protect an entry R/O, and then call * H5C_move_entry() to move it -- this should fail. * @@ -16843,6 +16857,7 @@ check_move_entry_errs(void) */ if(pass) { + reset_entries(); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); @@ -16850,21 +16865,29 @@ check_move_entry_errs(void) cache_ptr = file_ptr->shared->cache; insert_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + protect_entry_ro(file_ptr, 0, 0); entry_ptr = &((entries[0])[0]); - } /* end if */ + + } if(pass) { - result = H5C_move_entry(cache_ptr, types[0], entry_ptr->header.addr, entry_ptr->header.addr + 10); + + result = H5C_move_entry(cache_ptr, &(types[0]), entry_ptr->header.addr, entry_ptr->header.addr + 10); if(result >= 0) { + pass = FALSE; - failure_mssg = "Call to H5C_move_entry on a R/O protected entry succeeded.\n"; - } /* end if */ - else + failure_mssg = + "Call to H5C_move_entry on a R/O protected entry succeeded.\n"; + + } else { + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); - } /* end if */ + + } + } if(pass) takedown_cache(file_ptr, FALSE, FALSE); @@ -16874,7 +16897,8 @@ check_move_entry_errs(void) else { H5_FAILED() - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", + FUNC, failure_mssg); } /* end else */ return (unsigned)!pass; @@ -17155,7 +17179,7 @@ check_protect_ro_rw_err(void) if(pass) { thing_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, - types[0], entry_ptr->addr, + &(types[0]), entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); if(thing_ptr != NULL) { @@ -17248,13 +17272,13 @@ check_protect_retries(void) entry_ptr->verify_ct = 0; cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, - types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); + &(types[type]), entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); if((cache_entry_ptr != (void *)entry_ptr) || (!(entry_ptr->header.is_protected)) || (!(entry_ptr->header.is_read_only)) || (entry_ptr->header.ro_ref_count <= 0) || - (entry_ptr->header.type != types[type]) || + (entry_ptr->header.type != &(types[type])) || (entry_ptr->size != entry_ptr->header.size) || (entry_ptr->addr != entry_ptr->header.addr) || (entry_ptr->verify_ct != entry_ptr->max_verify_ct)) { @@ -17293,7 +17317,7 @@ check_protect_retries(void) entry_ptr->verify_ct = 0; cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, - types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); + &(types[type]), entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); /* H5C_protect() should fail after all retries fail */ if(cache_entry_ptr != NULL) @@ -27409,7 +27433,7 @@ check_auto_cache_resize_aux_fcns(void) size_t max_size; size_t min_clean_size; size_t cur_size; - uint32_t cur_num_entries; + int32_t cur_num_entries; H5C_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C__CURR_AUTO_SIZE_CTL_VER, @@ -28133,7 +28157,8 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) } if(show_progress) /* 0 */ - HDfprintf(stdout, "\n%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "\n%s: check point %d -- pass %d\n", + FUNC, checkpoint++, pass); if(pass) { @@ -33693,10 +33718,14 @@ check_metadata_cork(hbool_t fill_via_insertion) reset_entries(); - if(fill_via_insertion) - TESTING("to ensure cork/uncork metadata when inserting") - else - TESTING("to ensure cork/uncork metadata on protect/unprotect") + if(fill_via_insertion) { + + TESTING("to ensure cork/uncork metadata when inserting"); + + } else { + + TESTING("to ensure cork/uncork metadata on protect/unprotect"); + } if(show_progress) /* 0 */ HDfprintf(stdout, "\n%s: check point %d -- pass %d\n", @@ -34551,7 +34580,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) /*------------------------------------------------------------------------- * Function: cedds__H5C_make_space_in_cache() * - * Purpose: Verify that H5C__make_space_in_cache() can handle the + * Purpose: Verify that H5C_make_space_in_cache() can handle the * removal from the cache of the next item in its reverse scan * of the LRU list. * @@ -34561,7 +34590,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) * load an additional entry, triggering the flush of the last * item, and thereby the deletion of the second to last item. * - * H5C__make_space_in_cache() should detect this deletion, and + * H5C_make_space_in_cache() should detect this deletion, and * restart its scan of the LRU from the tail, instead of * examining the now deleted next item up on the LRU. * @@ -34639,7 +34668,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) if(cache_ptr == NULL) { pass = FALSE; - failure_mssg = "cache_ptr NULL on entry to cedds for H5C__make_space_in_cache() test."; + failure_mssg = "cache_ptr NULL on entry to cedds for H5C_make_space_in_cache() test."; } else if((cache_ptr->index_len != 0) || (cache_ptr->index_size != 0)) { @@ -34779,7 +34808,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) * and HET 0, 2, and 3 will be evicted to make room for the new * monster entry (MET, 31). * - * Verify this. If H5C__make_space_in_cache() chokes, failure will + * Verify this. If H5C_make_space_in_cache() chokes, failure will * be detected in protect_entry(). Thus end the "if(pass)" clause * there so the error message will not be overwritten. */ @@ -34942,7 +34971,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) * access the first item in the LRU repeatedly until the * item, and thereby the deletion of the second to last item. * - * H5C__make_space_in_cache() should detect this deletion, and + * H5C_make_space_in_cache() should detect this deletion, and * restart its scan of the LRU from the tail, instead of * examining the now deleted next item up on the LRU. * diff --git a/test/cache_api.c b/test/cache_api.c index 710e38f..1d3c9cf 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -20,6 +20,9 @@ * with the cache implemented in H5C.c */ +#include "h5test.h" +#include "H5Iprivate.h" +#include "H5ACprivate.h" #include "cache_common.h" /* extern declarations */ @@ -2314,12 +2317,19 @@ main(void) nerrs += 1; } - if(invalid_configs) + if ( invalid_configs ) { + HDfree(invalid_configs); + } + + if ( nerrs > 0 ) { - if(nerrs > 0) return EXIT_FAILURE; - else + + } else { + return EXIT_SUCCESS; + } + } /* main() */ diff --git a/test/cache_common.c b/test/cache_common.c index d1bbf10..5151d65 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -19,6 +19,9 @@ * This file contains common code for tests of the cache * implemented in H5C.c */ +#include "h5test.h" +#include "H5Cprivate.h" +#include "H5Iprivate.h" #include "H5MFprivate.h" #include "H5MMprivate.h" #include "cache_common.h" @@ -285,9 +288,27 @@ const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES] = NOTIFY_ALT_BASE_ADDR }; +const char *entry_type_names[NUMBER_OF_ENTRY_TYPES] = +{ + "pico entries -- 1 B", + "nano entries -- 4 B", + "micro entries -- 16 B", + "tiny entries -- 64 B", + "small entries -- 256 B", + "medium entries -- 1 KB", + "large entries -- 4 KB", + "huge entries -- 16 KB", + "monster entries -- 64 KB", + "variable entries -- 1B - 10KB", + "notify entries -- 1B" +}; + -/* Callback classes */ -static const H5C_class_t pico_class[1] = {{ +/* callback table declaration */ + +const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = +{ + { PICO_ENTRY_TYPE, "pico_entry", H5FD_MEM_DEFAULT, @@ -302,9 +323,8 @@ static const H5C_class_t pico_class[1] = {{ NULL, pico_free_icr, NULL, -}}; - -static const H5C_class_t nano_class[1] = {{ + }, + { NANO_ENTRY_TYPE, "nano_entry", H5FD_MEM_DEFAULT, @@ -319,9 +339,8 @@ static const H5C_class_t nano_class[1] = {{ NULL, nano_free_icr, NULL, -}}; - -static const H5C_class_t micro_class[1] = {{ + }, + { MICRO_ENTRY_TYPE, "micro_entry", H5FD_MEM_DEFAULT, @@ -336,9 +355,8 @@ static const H5C_class_t micro_class[1] = {{ NULL, micro_free_icr, NULL, -}}; - -static const H5C_class_t tiny_class[1] = {{ + }, + { TINY_ENTRY_TYPE, "tiny_entry", H5FD_MEM_DEFAULT, @@ -353,9 +371,8 @@ static const H5C_class_t tiny_class[1] = {{ NULL, tiny_free_icr, NULL, -}}; - -static const H5C_class_t small_class[1] = {{ + }, + { SMALL_ENTRY_TYPE, "small_entry", H5FD_MEM_DEFAULT, @@ -370,9 +387,8 @@ static const H5C_class_t small_class[1] = {{ NULL, small_free_icr, NULL, -}}; - -static const H5C_class_t medium_class[1] = {{ + }, + { MEDIUM_ENTRY_TYPE, "medium_entry", H5FD_MEM_DEFAULT, @@ -387,9 +403,8 @@ static const H5C_class_t medium_class[1] = {{ NULL, medium_free_icr, NULL, -}}; - -static const H5C_class_t large_class[1] = {{ + }, + { LARGE_ENTRY_TYPE, "large_entry", H5FD_MEM_DEFAULT, @@ -404,9 +419,8 @@ static const H5C_class_t large_class[1] = {{ NULL, large_free_icr, NULL, -}}; - -static const H5C_class_t huge_class[1] = {{ + }, + { HUGE_ENTRY_TYPE, "huge_entry", H5FD_MEM_DEFAULT, @@ -421,9 +435,8 @@ static const H5C_class_t huge_class[1] = {{ NULL, huge_free_icr, NULL, -}}; - -static const H5C_class_t monster_class[1] = {{ + }, + { MONSTER_ENTRY_TYPE, "monster_entry", H5FD_MEM_DEFAULT, @@ -438,9 +451,8 @@ static const H5C_class_t monster_class[1] = {{ NULL, monster_free_icr, NULL, -}}; - -static const H5C_class_t variable_class[1] = {{ + }, + { VARIABLE_ENTRY_TYPE, "variable_entry", H5FD_MEM_DEFAULT, @@ -455,9 +467,8 @@ static const H5C_class_t variable_class[1] = {{ NULL, variable_free_icr, NULL, -}}; - -static const H5C_class_t notify_class[1] = {{ + }, + { NOTIFY_ENTRY_TYPE, "notify_entry", H5FD_MEM_DEFAULT, @@ -472,22 +483,7 @@ static const H5C_class_t notify_class[1] = {{ notify_notify, notify_free_icr, NULL, -}}; - -/* callback table declaration */ - -const H5C_class_t *types[NUMBER_OF_ENTRY_TYPES] = { - pico_class, - nano_class, - micro_class, - tiny_class, - small_class, - medium_class, - large_class, - huge_class, - monster_class, - variable_class, - notify_class + } }; /* address translation functions: */ @@ -3235,8 +3231,8 @@ setup_cache(size_t max_cache_size, if(verbose) HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC); - } /* end if */ - } /* end if */ + } + } if(show_progress) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -3304,7 +3300,7 @@ setup_cache(size_t max_cache_size, cache_ptr = H5C_create(max_cache_size, min_clean_size, (NUMBER_OF_ENTRY_TYPES - 1), - types, + (const char **)entry_type_names, check_write_permitted, TRUE, NULL, @@ -3537,7 +3533,7 @@ expunge_entry(H5F_t * file_ptr, HDassert( ! ( entry_ptr->is_pinned ) ); result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, - types[type], entry_ptr->addr, H5C__NO_FLAGS_SET); + &(types[type]), entry_ptr->addr, H5C__NO_FLAGS_SET); if ( result < 0 ) { @@ -3758,11 +3754,11 @@ insert_entry(H5F_t * file_ptr, } result = H5C_insert_entry(file_ptr, xfer, - types[type], entry_ptr->addr, (void *)entry_ptr, flags); + &(types[type]), entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || ( entry_ptr->header.is_protected ) || - ( entry_ptr->header.type != types[type] ) || + ( entry_ptr->header.type != &(types[type]) ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { @@ -3775,8 +3771,8 @@ insert_entry(H5F_t * file_ptr, HDfprintf(stdout, "entry_ptr->header.is_protected = %d\n", (int)(entry_ptr->header.is_protected)); HDfprintf(stdout, - "entry_ptr->header.type != types[type] = %d\n", - (int)(entry_ptr->header.type != types[type])); + "entry_ptr->header.type != &(types[type]) = %d\n", + (int)(entry_ptr->header.type != &(types[type]))); HDfprintf(stdout, "entry_ptr->size != entry_ptr->header.size = %d\n", (int)(entry_ptr->size != entry_ptr->header.size)); @@ -3859,7 +3855,7 @@ mark_entry_dirty(int32_t type, ( !entry_ptr->header.is_protected && !entry_ptr->header.is_pinned ) || ( entry_ptr->header.is_protected && !entry_ptr->header.dirtied ) || ( !entry_ptr->header.is_protected && !entry_ptr->header.is_dirty ) || - ( entry_ptr->header.type != types[type] ) || + ( entry_ptr->header.type != &(types[type]) ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { @@ -3952,7 +3948,7 @@ move_entry(H5C_t * cache_ptr, mark_flush_dep_dirty(entry_ptr); entry_ptr->action = TEST_ENTRY_ACTION_MOVE; - result = H5C_move_entry(cache_ptr, types[type], old_addr, new_addr); + result = H5C_move_entry(cache_ptr, &(types[type]), old_addr, new_addr); entry_ptr->action = TEST_ENTRY_ACTION_NUL; } @@ -4031,12 +4027,12 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx) } /* end if */ cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, xfer, - types[type], entry_ptr->addr, &entry_ptr->addr, + &(types[type]), entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); if ( ( cache_entry_ptr != (void *)entry_ptr ) || ( !(entry_ptr->header.is_protected) ) || - ( entry_ptr->header.type != types[type] ) || + ( entry_ptr->header.type != &(types[type]) ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { @@ -4053,8 +4049,8 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx) HDfprintf(stdout, "entry_ptr->header.is_protected = %d\n", (int)(entry_ptr->header.is_protected)); HDfprintf(stdout, - "( entry_ptr->header.type != types[type] ) = %d\n", - (int)( entry_ptr->header.type != types[type] )); + "( entry_ptr->header.type != &(types[type]) ) = %d\n", + (int)( entry_ptr->header.type != &(types[type]) )); HDfprintf(stdout, "entry_ptr->size = %d, entry_ptr->header.size = %d\n", (int)(entry_ptr->size), (int)(entry_ptr->header.size)); @@ -4135,13 +4131,13 @@ protect_entry_ro(H5F_t * file_ptr, ( entry_ptr->ro_ref_count > 0 ) ) ); cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, - types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); + &(types[type]), entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); if ( ( cache_entry_ptr != (void *)entry_ptr ) || ( !(entry_ptr->header.is_protected) ) || ( !(entry_ptr->header.is_read_only) ) || ( entry_ptr->header.ro_ref_count <= 0 ) || - ( entry_ptr->header.type != types[type] ) || + ( entry_ptr->header.type != &(types[type]) ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { @@ -4272,7 +4268,7 @@ unpin_entry(int32_t type, if ( ( result < 0 ) || ( entry_ptr->header.pinned_from_client ) || ( entry_ptr->header.is_pinned && !entry_ptr->header.pinned_from_cache ) || - ( entry_ptr->header.type != types[type] ) || + ( entry_ptr->header.type != &(types[type]) ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { @@ -4357,7 +4353,7 @@ unprotect_entry(H5F_t * file_ptr, ( ( entry_ptr->header.is_protected ) && ( ( ! ( entry_ptr->is_read_only ) ) || ( entry_ptr->ro_ref_count <= 0 ) ) ) || - ( entry_ptr->header.type != types[type] ) || + ( entry_ptr->header.type != &(types[type]) ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { @@ -6132,7 +6128,7 @@ check_and_validate_cache_size(hid_t file_id, size_t min_clean_size; size_t expected_cur_size; size_t cur_size; - uint32_t expected_cur_num_entries; + int32_t expected_cur_num_entries; int cur_num_entries; H5F_t * file_ptr = NULL; H5C_t * cache_ptr = NULL; @@ -6438,7 +6434,7 @@ dump_LRU(H5F_t * file_ptr) entry_ptr = cache_ptr->LRU_head_ptr; HDfprintf(stdout, - "\n\nIndex len/size/clean size/dirty size = %u/%lld/%lld/%lld\n", + "\n\nIndex len/size/clean size/dirty size = %d/%lld/%lld/%lld\n", cache_ptr->index_len, (long long)(cache_ptr->index_size), (long long)(cache_ptr->clean_index_size), (long long)(cache_ptr->dirty_index_size)); diff --git a/test/cache_common.h b/test/cache_common.h index f003189..befcee4 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -553,10 +553,11 @@ H5TEST_DLLVAR const int32_t max_indices[NUMBER_OF_ENTRY_TYPES]; H5TEST_DLLVAR const size_t entry_sizes[NUMBER_OF_ENTRY_TYPES]; H5TEST_DLLVAR const haddr_t base_addrs[NUMBER_OF_ENTRY_TYPES]; H5TEST_DLLVAR const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES]; +H5TEST_DLLVAR const char * entry_type_names[NUMBER_OF_ENTRY_TYPES]; /* callback table extern */ -H5TEST_DLLVAR const H5C_class_t *types[NUMBER_OF_ENTRY_TYPES]; +H5TEST_DLLVAR const H5C_class_t types[NUMBER_OF_ENTRY_TYPES]; #ifdef __cplusplus diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 02ce19b..473851e 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -21,8 +21,11 @@ #include "H5Fpkg.h" #include "testhdf5.h" +#include "h5test.h" #include "cache_common.h" +#include "H5Iprivate.h" +#include "H5ACprivate.h" #include "H5HLprivate.h" /* ============ */ @@ -953,9 +956,9 @@ check_dense_attribute_tags(void) int verbose = FALSE; /* verbose file outout */ int i = 0; /* iterator */ hid_t fapl = -1; /* File access property list */ - haddr_t d_tag = 0; /* Dataset tag value */ - haddr_t root_tag = 0; /* Root group tag value */ - char attrname[500]; /* Name of attribute */ + haddr_t d_tag = 0; /* Dataset tag value */ + haddr_t root_tag = 0; /* Root group tag value */ + char attrname[500]; /* Name of attribute */ /* Testing Macro */ TESTING("tag application during dense attribute manipulation"); @@ -1533,7 +1536,6 @@ check_attribute_rename_tags(hid_t fcpl, int type) /* Close and Reopen the file and group */ if ( H5Gclose(gid) < 0 ) TEST_ERROR; if ( H5Fclose(fid) < 0 ) TEST_ERROR; - if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0 ) TEST_ERROR; if ( (gid = H5Gopen2(fid, GROUPNAME, H5P_DEFAULT)) < 0 ) TEST_ERROR; diff --git a/test/dsets.c b/test/dsets.c index 39b7c22..d086c58 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -507,7 +507,7 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) TESTING("simple I/O"); - /* Can't run this test with multi-file VFDs because of HDopen/read/seek the file directly */ + /* Can't run this test with multi-file VFDs */ if(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { h5_fixname(FILENAME[4], fapl, filename, sizeof filename); @@ -645,7 +645,7 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl) TESTING("dataset offset with user block"); - /* Can't run this test with multi-file VFDs because of HDopen/read/seek the file directly */ + /* Can't run this test with multi-file VFDs */ if(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { h5_fixname(FILENAME[2], fapl, filename, sizeof filename); @@ -1984,11 +1984,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, } } - /* Get the storage size of the dataset */ - if((*dset_size=H5Dget_storage_size(dataset))==0) goto error; - PASSED(); + /* Get the storage size of the dataset */ + if((*dset_size=H5Dget_storage_size(dataset))==0) goto error; /* Clean up objects used for this test */ if(H5Dclose (dataset) < 0) goto error; if(H5Sclose (sid) < 0) goto error; @@ -2933,7 +2932,6 @@ test_nbit_int(hid_t file) PASSED(); return 0; - error: return -1; } diff --git a/test/earray.c b/test/earray.c index c6f5986..07acbb5 100644 --- a/test/earray.c +++ b/test/earray.c @@ -159,6 +159,15 @@ typedef struct earray_test_t { /* Local prototypes */ +/* Metadata cache (H5AC) callbacks */ +static herr_t earray_cache_test_get_initial_load_size(void *udata, size_t *image_len); +static void *earray_cache_test_deserialize(const void *image_ptr, size_t len, + void *udata_ptr, hbool_t *dirty_ptr); +static herr_t earray_cache_test_image_len(const void *thing, size_t *image_len_ptr); +static herr_t earray_cache_test_serialize(const H5F_t *f, void *image_ptr, + size_t len, void *thing); +static herr_t earray_cache_test_free_icr(void *thing); + /* Local variables */ const char *FILENAME[] = { @@ -173,6 +182,24 @@ char filename_g[EARRAY_FILENAME_LEN]; /* Empty file size */ h5_stat_size_t empty_size_g; +/* H5EA test object inherits cache-like properties from H5AC */ +const H5AC_class_t H5AC_EARRAY_TEST[1] = {{ + /* id */ H5AC_TEST_ID, + /* name */ "earray test", + /* mem_type */ H5FD_MEM_DEFAULT, + /* flags */ H5AC__CLASS_SKIP_READS | H5AC__CLASS_SKIP_WRITES, + /* get_initial_load_size */ earray_cache_test_get_initial_load_size, + /* get_final_load_size */ NULL, + /* verify_chksum */ NULL, + /* deserialize */ earray_cache_test_deserialize, + /* image_len */ earray_cache_test_image_len, + /* pre_serialize */ NULL, + /* serialize */ earray_cache_test_serialize, + /* notify */ NULL, + /* free_icr */ earray_cache_test_free_icr, + /* fsf_size */ NULL, +}}; + /*------------------------------------------------------------------------- * Function: init_cparam @@ -592,6 +619,225 @@ error: /*------------------------------------------------------------------------- + * Function: earray_cache_test_get_initial_load_size() + * + * Purpose: place holder function -- should never be called + * + * A generic discussion of metadata cache callbacks of this type + * may be found in H5Cprivate.h. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 8/2/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +earray_cache_test_get_initial_load_size( void *udata, size_t *image_len) +{ + HDassert(udata); + HDassert(image_len); + + /* Should never be called */ + HDassert(0 && "Can't be called!"); + + *image_len = 0; + + return(SUCCEED); +} /* end earray_cache_test_get_initial_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: earray_cache_test_deserialize + * + * Purpose: place holder function -- should never be called. + * + * + * A generic discussion of metadata cache callbacks of this type + * may be found in H5Cprivate.h: + * + * Return: Success: Pointer to in core representation + * Failure: NULL + * + * Programmer: John Mainzer + * 8/2/14 + * + *------------------------------------------------------------------------- + */ +static void * +earray_cache_test_deserialize(const void *image_ptr, + size_t len, + void *udata_ptr, + hbool_t *dirty_ptr) +{ + HDassert(image_ptr); + HDassert(len > 0 ); + HDassert(udata_ptr); + HDassert(dirty_ptr); + + /* Should never be called */ + HDassert(0 && "Can't be called!"); + + return(NULL); +} /* end earray_cache_test_deserialize() */ + + +/*------------------------------------------------------------------------- + * Function: earray_cache_test_image_len + * + * Purpose: test code place holder function -- just set *image_len_ptr to + * one. + * + * + * A generic discussion of metadata cache callbacks of this type + * may be found in H5Cprivate.h: + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 8/2/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +earray_cache_test_image_len(const void *thing, size_t *image_len_ptr) +{ + HDassert(thing); + HDassert(image_len_ptr); + + /* Set size value */ + /* (hard-code to 1) */ + *image_len_ptr = 1; + + return(SUCCEED); +} /* end earray_cache_test_image_len() */ + + + +/*------------------------------------------------------------------------- + * Function: earray_cache_test_serialize + * + * Purpose: Validate the contents of the instance of earray_test_t. + * + * + * A generic discussion of metadata cache callbacks of this type + * may be found in H5Cprivate.h: + * + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 8/2/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +earray_cache_test_serialize(const H5F_t *f, + void *image_ptr, + H5_ATTR_UNUSED size_t len, + void *thing) +{ + earray_test_t *test; + + HDassert(f); + HDassert(image_ptr); + HDassert(thing); + test = (earray_test_t *)thing; + HDassert(test); + HDassert(test->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert((const H5AC_class_t *)(test->cache_info.type) == + &(H5AC_EARRAY_TEST[0])); + + /* Check for out of order flush */ + if(test->fd_info->base_obj) + TEST_ERROR + + /* Check which index this entry corresponds to */ + if((uint64_t)0 == test->idx) { + /* Check for out of order flush */ + if(test->fd_info->idx0_obj || test->fd_info->idx0_elem) + TEST_ERROR + + /* Set flag for object flush */ + test->fd_info->idx0_obj = TRUE; + } /* end if */ + else if((uint64_t)1 == test->idx) { + /* Check for out of order flush */ + if(test->fd_info->idx1_obj || test->fd_info->idx1_elem) + TEST_ERROR + + /* Set flag for object flush */ + test->fd_info->idx1_obj = TRUE; + } /* end if */ + else if((uint64_t)10000 == test->idx) { + /* Check for out of order flush */ + if(test->fd_info->idx10000_obj || test->fd_info->idx10000_elem) + TEST_ERROR + + /* Set flag for object flush */ + test->fd_info->idx10000_obj = TRUE; + } /* end if */ + else if((uint64_t)-1 == test->idx) { + /* Set flag for object flush */ + test->fd_info->base_obj = TRUE; + } /* end if */ + + return(SUCCEED); + +error: + return(FAIL); +} /* end earray_cache_test_serialize() */ + + + +/*------------------------------------------------------------------------- + * Function: earray_cache_test_free_icr + * + * Purpose: Destroy an extensible array test object in memory. + * + * + * A generic discussion of metadata cache callbacks of this type + * may be found in H5Cprivate.h: + * + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: John Mainzer + * 8/2/14 + * + *------------------------------------------------------------------------- + */ +static herr_t +earray_cache_test_free_icr(void *thing) +{ + earray_test_t *test; + + HDassert(thing); + test = (earray_test_t *)thing; + HDassert(test); + + /* the metadata cache sets cache_info.magic to + * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling the + * free_icr routine. Hence the following assert: + */ + + HDassert(test->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); + HDassert((const H5AC_class_t *)(test->cache_info.type) == + &(H5AC_EARRAY_TEST[0])); + + /* Free the shared info itself */ + HDfree(test); + + return(SUCCEED); +} /* end earray_cache_test_free_icr() */ + + +/*------------------------------------------------------------------------- * Function: test_create * * Purpose: Test creating extensible array diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c index 5179e8e..4f0147e 100644 --- a/test/enc_dec_plist.c +++ b/test/enc_dec_plist.c @@ -117,11 +117,6 @@ main(void) 0.2f, (256 * 2048), H5AC__DEFAULT_METADATA_WRITE_STRATEGY}; - H5AC_cache_image_config_t my_cache_image_config = { - H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, - TRUE, - FALSE, - -1}; if(VERBOSE_MED) printf("Encode/Decode DCPLs\n"); @@ -460,8 +455,6 @@ main(void) FAIL_STACK_ERROR if((H5Pset_mdc_config(fapl, &my_cache_config)) < 0) FAIL_STACK_ERROR - if((H5Pset_mdc_image_config(fapl, &my_cache_image_config)) < 0) - FAIL_STACK_ERROR if((H5Pset_core_write_tracking(fapl, TRUE, 1024 * 1024)) < 0) FAIL_STACK_ERROR diff --git a/test/evict_on_close.c b/test/evict_on_close.c index 3986d5a..e0a7a73 100644 --- a/test/evict_on_close.c +++ b/test/evict_on_close.c @@ -600,7 +600,7 @@ check_group_layout(hid_t fid, const char *group_name) hid_t gid1 = -1, gid2 = -1; /* group IDs */ H5G_t *grp_ptr = NULL; /* ptr to internal group struct */ haddr_t tag1, tag2; /* MD cache tags for groups */ - uint32_t before, during, after; /* cache sizes */ + int32_t before, during, after; /* cache sizes */ int i; /* iterator */ /* NOTE: The TESTING() macro is called in main() */ @@ -616,7 +616,7 @@ check_group_layout(hid_t fid, const char *group_name) HDprintf("\nCACHE BEFORE GROUP OPEN:\n"); if(H5AC_dump_cache(file_ptr) < 0) TEST_ERROR; - HDprintf("NUMBER OF CACHE ENTRIES: %u\n", before); + HDprintf("NUMBER OF CACHE ENTRIES: %d\n", before); #endif /* Open the main group and get its tag */ @@ -658,7 +658,7 @@ check_group_layout(hid_t fid, const char *group_name) if(H5AC_dump_cache(file_ptr) < 0) TEST_ERROR; HDprintf("MAIN GROUP TAG: %#X\n", tag1); - HDprintf("NUMBER OF CACHE ENTRIES: %u\n", during); + HDprintf("NUMBER OF CACHE ENTRIES: %d\n", during); #endif /* Close the main group */ @@ -672,7 +672,7 @@ check_group_layout(hid_t fid, const char *group_name) HDprintf("\nCACHE AFTER CLOSING GROUPS:\n"); if(H5AC_dump_cache(file_ptr) < 0) TEST_ERROR; - HDprintf("NUMBER OF CACHE ENTRIES: %u\n", after); + HDprintf("NUMBER OF CACHE ENTRIES: %d\n", after); #endif /* Ensure that the cache does not contain entries with the tag */ @@ -718,7 +718,7 @@ check_dset_scheme(hid_t fid, const char *dset_name) H5D_t *dset_ptr = NULL; /* ptr to internal dset struct */ haddr_t tag; /* MD cache tag for dataset */ int *data = NULL; /* buffer for fake data */ - uint32_t before, during, after; /* cache sizes */ + int32_t before, during, after; /* cache sizes */ /* NOTE: The TESTING() macro is called in main() */ @@ -737,7 +737,7 @@ check_dset_scheme(hid_t fid, const char *dset_name) HDprintf("\nCACHE BEFORE DATASET OPEN:\n"); if(H5AC_dump_cache(file_ptr) < 0) TEST_ERROR; - HDprintf("NUMBER OF CACHE ENTRIES: %u\n", before); + HDprintf("NUMBER OF CACHE ENTRIES: %d\n", before); #endif /* Open dataset and get the metadata tag */ @@ -761,7 +761,7 @@ check_dset_scheme(hid_t fid, const char *dset_name) if(H5AC_dump_cache(file_ptr) < 0) TEST_ERROR; HDprintf("TAG: %#X\n", tag); - HDprintf("NUMBER OF CACHE ENTRIES: %u\n", during); + HDprintf("NUMBER OF CACHE ENTRIES: %d\n", during); #endif /* Close the dataset */ @@ -775,7 +775,7 @@ check_dset_scheme(hid_t fid, const char *dset_name) HDprintf("\nCACHE AFTER DATASET CLOSE:\n"); if(H5AC_dump_cache(file_ptr) < 0) TEST_ERROR; - HDprintf("NUMBER OF CACHE ENTRIES: %u\n", after); + HDprintf("NUMBER OF CACHE ENTRIES: %d\n", after); #endif /* Ensure that the cache does not contain entries with the tag */ diff --git a/test/fheap.c b/test/fheap.c index 82859d2..8e364de 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -16360,7 +16360,6 @@ main(void) /* Reset library */ h5_reset(); - fapl = h5_fileaccess(); ExpressMode = GetTestExpress(); if(ExpressMode > 1) @@ -16380,7 +16379,13 @@ main(void) shared_wobj_g[u] = (unsigned char)u; /* Iterate over the testing parameters */ +#ifndef QAK for(curr_test = FHEAP_TEST_NORMAL; curr_test < FHEAP_TEST_NTESTS; H5_INC_ENUM(fheap_test_type_t, curr_test)) { +#else /* QAK */ +HDfprintf(stderr, "Uncomment test loop!\n"); +curr_test = FHEAP_TEST_NORMAL; +/* curr_test = FHEAP_TEST_REOPEN; */ +#endif /* QAK */ /* Clear the testing parameters */ HDmemset(&tparam, 0, sizeof(fheap_test_param_t)); tparam.actual_id_len = HEAP_ID_LEN; @@ -16405,6 +16410,7 @@ main(void) } /* end switch */ /* Test fractal heap creation */ +#ifndef QAK nerrors += test_create(fapl, &small_cparam, &tparam); nerrors += test_reopen(fapl, &small_cparam, &tparam); nerrors += test_open_twice(fapl, &small_cparam, &tparam); @@ -16413,12 +16419,23 @@ main(void) nerrors += test_filtered_create(fapl, &small_cparam); nerrors += test_size(fapl, &small_cparam); nerrors += test_reopen_hdr(fapl, &small_cparam); +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ +#ifndef QAK2 +#ifndef QAK { fheap_test_fill_t fill; /* Size of objects to fill heap blocks with */ +#ifndef QAK2 /* Filling with different sized objects */ for(fill = FHEAP_TEST_FILL_LARGE; fill < FHEAP_TEST_FILL_N; H5_INC_ENUM(fheap_test_fill_t, fill)) { +#else /* QAK2 */ +HDfprintf(stderr, "Uncomment test loop!\n"); +fill = FHEAP_TEST_FILL_LARGE; +/* fill = FHEAP_TEST_FILL_SINGLE; */ +#endif /* QAK2 */ tparam.fill = fill; /* Set appropriate testing parameters for each test */ @@ -16443,8 +16460,12 @@ main(void) * Test fractal heap managed object insertion */ +#ifndef QAK /* "Weird" sized objects */ nerrors += test_man_insert_weird(fapl, &small_cparam, &tparam); +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ #ifdef ALL_INSERT_TESTS /* "Standard" sized objects, building from simple to complex heaps */ @@ -16480,15 +16501,20 @@ main(void) /* If this test fails, uncomment the tests above, which build up to this * level of complexity gradually. -QAK */ +#ifndef QAK if(ExpressMode > 1) printf("***Express test mode on. test_man_start_5th_recursive_indirect is skipped\n"); else nerrors += test_man_start_5th_recursive_indirect(fapl, &small_cparam, &tparam); +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ /* * Test fractal heap object deletion */ /* Simple removal */ +#ifndef QAK nerrors += test_man_remove_bogus(fapl, &small_cparam, &tparam); nerrors += test_man_remove_one(fapl, &small_cparam, &tparam); nerrors += test_man_remove_two(fapl, &small_cparam, &tparam); @@ -16505,7 +16531,12 @@ main(void) /* Incremental insert & removal */ tparam.del_dir = FHEAP_DEL_FORWARD; nerrors += test_man_incr_insert_remove(fapl, &small_cparam, &tparam); +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ +#ifndef QAK +#ifndef QAK2 { fheap_test_del_dir_t del_dir; /* Deletion direction */ fheap_test_del_drain_t drain_half; /* Deletion draining */ @@ -16515,10 +16546,19 @@ main(void) tparam.del_dir = del_dir; for(drain_half = FHEAP_DEL_DRAIN_ALL; drain_half < FHEAP_DEL_DRAIN_N; H5_INC_ENUM(fheap_test_del_drain_t, drain_half)) { tparam.drain_half = drain_half; +#else /* QAK2 */ +HDfprintf(stderr, "Uncomment test loops!\n"); +/* tparam.del_dir = FHEAP_DEL_FORWARD; */ +/* tparam.del_dir = FHEAP_DEL_REVERSE; */ +tparam.del_dir = FHEAP_DEL_HEAP; +tparam.drain_half = FHEAP_DEL_DRAIN_ALL; +/* tparam.drain_half = FHEAP_DEL_DRAIN_HALF; */ +#endif /* QAK2 */ /* Don't need to test deletion directions when deleting entire heap */ if(tparam.del_dir == FHEAP_DEL_HEAP && tparam.drain_half > FHEAP_DEL_DRAIN_ALL) break; +#ifndef QAK /* Simple insertion patterns */ nerrors += test_man_remove_root_direct(fapl, &small_cparam, &tparam); nerrors += test_man_remove_two_direct(fapl, &small_cparam, &tparam); @@ -16532,7 +16572,11 @@ main(void) nerrors += test_man_remove_2nd_indirect(fapl, &small_cparam, &tparam); nerrors += test_man_remove_3rd_indirect(fapl, &small_cparam, &tparam); } /* end else */ +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ +#ifndef QAK /* Skip blocks insertion */ /* (covers insertion & deletion of skipped blocks) */ nerrors += test_man_skip_start_block(fapl, &small_cparam, &tparam); @@ -16564,13 +16608,21 @@ main(void) nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); nerrors += test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); } /* end else */ +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ +#ifndef QAK /* Fragmented insertion patterns */ /* (covers insertion & deletion of fragmented blocks) */ nerrors += test_man_frag_simple(fapl, &small_cparam, &tparam); nerrors += test_man_frag_direct(fapl, &small_cparam, &tparam); nerrors += test_man_frag_2nd_direct(fapl, &small_cparam, &tparam); nerrors += test_man_frag_3rd_direct(fapl, &small_cparam, &tparam); +#else /* QAK */ + HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ +#ifndef QAK2 } /* end for */ } /* end for */ @@ -16578,12 +16630,22 @@ main(void) tparam.drain_half = FHEAP_DEL_DRAIN_ALL; } /* end block */ +#endif /* QAK2 */ +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ +#ifndef QAK2 } /* end for */ +#endif /* QAK2 */ } /* end block */ +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ /* * Test fractal heap 'huge' & 'tiny' object insertion & deletion */ +#ifndef QAK { fheap_test_del_dir_t del_dir; /* Deletion direction */ unsigned id_len; /* Length of heap IDs */ @@ -16625,16 +16687,24 @@ main(void) tparam.del_dir = del_dir; /* Test 'huge' object insert & delete */ +#ifndef QAK nerrors += test_huge_insert_one(fapl, &small_cparam, &tparam); nerrors += test_huge_insert_two(fapl, &small_cparam, &tparam); nerrors += test_huge_insert_three(fapl, &small_cparam, &tparam); nerrors += test_huge_insert_mix(fapl, &small_cparam, &tparam); nerrors += test_filtered_huge(fapl, &small_cparam, &tparam); +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ +#ifndef QAK /* Test 'tiny' object insert & delete */ nerrors += test_tiny_insert_one(fapl, &small_cparam, &tparam); nerrors += test_tiny_insert_two(fapl, &small_cparam, &tparam); nerrors += test_tiny_insert_mix(fapl, &small_cparam, &tparam); +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ } /* end for */ } /* end for */ @@ -16642,9 +16712,16 @@ main(void) small_cparam.id_len = 0; tparam.actual_id_len = HEAP_ID_LEN; } /* end block */ +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ +#else /* QAK2 */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK2 */ /* Test I/O filter support */ +#ifndef QAK /* Try several different methods of deleting objects */ { fheap_test_del_dir_t del_dir; /* Deletion direction */ @@ -16666,11 +16743,16 @@ main(void) tparam.comp = FHEAP_TEST_NO_COMPRESS; } /* end for */ } /* end block */ +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ +#ifndef QAK /* Random object insertion & deletion */ if(ExpressMode > 1) printf("***Express test mode on. Some tests skipped\n"); else { +#ifndef QAK /* Random tests using "small" heap creation parameters */ puts("Using 'small' heap creation parameters"); @@ -16683,7 +16765,11 @@ main(void) tparam.del_dir = FHEAP_DEL_HEAP; nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &small_cparam, &tparam); nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &small_cparam, &tparam); +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ +#ifndef QAK /* Random tests using "large" heap creation parameters */ puts("Using 'large' heap creation parameters"); tparam.actual_id_len = LARGE_HEAP_ID_LEN; @@ -16697,11 +16783,18 @@ main(void) tparam.del_dir = FHEAP_DEL_HEAP; nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &large_cparam, &tparam); nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &large_cparam, &tparam); +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ /* Reset the "normal" heap ID length */ tparam.actual_id_len = SMALL_HEAP_ID_LEN; } /* end else */ +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ +#ifndef QAK /* Test object writing support */ /* Basic object writing */ @@ -16713,10 +16806,19 @@ main(void) /* Reset block compression */ tparam.comp = FHEAP_TEST_NO_COMPRESS; +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ +#ifndef QAK } /* end for */ +#endif /* QAK */ /* Tests that address specific bugs */ +#ifndef QAK nerrors += test_bug1(fapl, &small_cparam, &tparam); +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); diff --git a/test/fillval.c b/test/fillval.c index 6eb3565..4f7adc1 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -2370,7 +2370,7 @@ main(int argc, char *argv[]) { int nerrors=0, argno, test_contig=1, test_chunk=1, test_compact=1; hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ - unsigned new_format; /* Whether to use the new format or not */ + unsigned new_format; /* Whether to use the new format or not */ if(argc >= 2) { test_contig = test_chunk = test_compact = 0; diff --git a/test/freespace.c b/test/freespace.c index 181e6a1..d963a6e 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -1995,8 +1995,7 @@ test_fs_sect_shrink(hid_t fapl) (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR - if (node_found) - TEST_ERROR + if (node_found) TEST_ERROR if(check_stats(f, frsp, &state)) TEST_ERROR @@ -2096,8 +2095,7 @@ test_fs_sect_shrink(hid_t fapl) (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR - if (node_found) - TEST_ERROR + if (node_found) TEST_ERROR /* section A should not be there in free-space */ if((node_found = H5FS_sect_find(f, dxpl_id, frsp, @@ -2240,8 +2238,8 @@ test_fs_sect_change_class(hid_t fapl) TEST_ERROR if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, - TEST_FSPACE_SECT_TYPE_NONE) < 0) - TEST_ERROR + TEST_FSPACE_SECT_TYPE_NONE) < 0) + TEST_ERROR state.serial_sect_count += 1; state.ghost_sect_count -=1; diff --git a/test/gen_plist.c b/test/gen_plist.c index 8cb6c00..c617ad0 100644 --- a/test/gen_plist.c +++ b/test/gen_plist.c @@ -81,12 +81,6 @@ main(void) 0.2f, (256 * 2048), H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY}; - H5AC_cache_image_config_t my_cache_image_config = { - H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, - TRUE, - FALSE, - -1}; - /* check endianess */ { @@ -362,9 +356,6 @@ main(void) assert(ret > 0); if((ret = H5Pset_mdc_config(fapl1, &my_cache_config)) < 0) assert(ret > 0); - if((ret = H5Pset_mdc_image_config(fapl1, &my_cache_image_config)) < 0) - assert(ret > 0); - if((ret = H5Pset_core_write_tracking(fapl1, TRUE, (size_t)(1024 * 1024))) < 0) assert(ret > 0); diff --git a/test/h5test.c b/test/h5test.c index a36d580..9759fa8 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1744,7 +1744,9 @@ error: void h5_send_message(const char *send, const char *arg1, const char *arg2) { - FILE *signalfile = NULL; + FILE *signalfile; + + HDremove(TMP_SIGNAL_FILE); /* Create signal file (which will send signal to some other process) */ signalfile = HDfopen(TMP_SIGNAL_FILE, "w+"); diff --git a/test/links.c b/test/links.c index 3364c7e..182eb6c 100644 --- a/test/links.c +++ b/test/links.c @@ -21,22 +21,18 @@ */ /* - * This file needs to access private information from the H5FD package. - * This file also needs to access the file driver testing code. - */ -#define H5FD_FRIEND /*suppress error about including H5FDpkg */ -#define H5FD_TESTING - -/* * This file needs to access private information from the H5G package. * This file also needs to access the group testing code. */ #define H5G_FRIEND /*suppress error about including H5Gpkg */ #define H5G_TESTING +#define H5FD_FRIEND /*suppress error about including H5FDpkg */ +#define H5FD_TESTING + #include "h5test.h" #include "H5srcdir.h" -#include "H5FDpkg.h" /* File drivers */ +#include "H5FDpkg.h" /* File drivers */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ @@ -824,7 +820,7 @@ long_links(hid_t fapl, hbool_t new_format) static int toomany(hid_t fapl, hbool_t new_format) { - hid_t fid = (-1); /* File ID */ + hid_t fid = (-1); /* File ID */ hid_t gid = (-1), gid2 = (-1); /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE]; @@ -2627,6 +2623,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format) /* Close first file */ if(H5Fclose(fid) < 0) TEST_ERROR + PASSED(); return 0; diff --git a/test/objcopy.c b/test/objcopy.c index 0711fb0..4166284 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -7200,7 +7200,7 @@ test_copy_ext_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap if(H5Gclose(gid) < 0) TEST_ERROR /* create file to hold external links to the src file */ - if((fid_ext = H5Fcreate(ext_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR + if((fid_ext = H5Fcreate(ext_filename, H5F_ACC_TRUNC, H5P_DEFAULT, src_fapl)) < 0) TEST_ERROR /* create group in the file that will hold the external link */ if((gid = H5Gcreate2(fid_ext, NAME_GROUP_LINK, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR diff --git a/test/swmr_check_compat_vfd.c b/test/swmr_check_compat_vfd.c index 1bbfda3..d1134ee 100644 --- a/test/swmr_check_compat_vfd.c +++ b/test/swmr_check_compat_vfd.c @@ -18,13 +18,12 @@ * * It is intended for use in shell scripts. */ - #include "h5test.h" /* This file needs to access the file driver testing code */ -#define H5FD_FRIEND /*suppress error about including H5FDpkg */ +#define H5FD_FRIEND /*suppress error about including H5FDpkg */ #define H5FD_TESTING -#include "H5FDpkg.h" /* File drivers */ +#include "H5FDpkg.h" /* File drivers */ /*------------------------------------------------------------------------- @@ -54,3 +53,4 @@ main(void) return EXIT_FAILURE; } /* end main() */ + diff --git a/test/testfiles/plist_files/dapl_32be b/test/testfiles/plist_files/dapl_32be index 4dedda2..4df4e7f 100644 Binary files a/test/testfiles/plist_files/dapl_32be and b/test/testfiles/plist_files/dapl_32be differ diff --git a/test/testfiles/plist_files/dapl_32le b/test/testfiles/plist_files/dapl_32le index 4dedda2..4df4e7f 100644 Binary files a/test/testfiles/plist_files/dapl_32le and b/test/testfiles/plist_files/dapl_32le differ diff --git a/test/testfiles/plist_files/dapl_64be b/test/testfiles/plist_files/dapl_64be index 4dedda2..4df4e7f 100644 Binary files a/test/testfiles/plist_files/dapl_64be and b/test/testfiles/plist_files/dapl_64be differ diff --git a/test/testfiles/plist_files/dapl_64le b/test/testfiles/plist_files/dapl_64le index 4dedda2..4df4e7f 100644 Binary files a/test/testfiles/plist_files/dapl_64le and b/test/testfiles/plist_files/dapl_64le differ diff --git a/test/testfiles/plist_files/def_dapl_32be b/test/testfiles/plist_files/def_dapl_32be index 3df7289..c9b7ea9 100644 Binary files a/test/testfiles/plist_files/def_dapl_32be and b/test/testfiles/plist_files/def_dapl_32be differ diff --git a/test/testfiles/plist_files/def_dapl_32le b/test/testfiles/plist_files/def_dapl_32le index 3df7289..c9b7ea9 100644 Binary files a/test/testfiles/plist_files/def_dapl_32le and b/test/testfiles/plist_files/def_dapl_32le differ diff --git a/test/testfiles/plist_files/def_dapl_64be b/test/testfiles/plist_files/def_dapl_64be index 3df7289..c9b7ea9 100644 Binary files a/test/testfiles/plist_files/def_dapl_64be and b/test/testfiles/plist_files/def_dapl_64be differ diff --git a/test/testfiles/plist_files/def_dapl_64le b/test/testfiles/plist_files/def_dapl_64le index 3df7289..c9b7ea9 100644 Binary files a/test/testfiles/plist_files/def_dapl_64le and b/test/testfiles/plist_files/def_dapl_64le differ diff --git a/test/testfiles/plist_files/def_dxpl_32be b/test/testfiles/plist_files/def_dxpl_32be index 3b77a32..b13f456 100644 Binary files a/test/testfiles/plist_files/def_dxpl_32be and b/test/testfiles/plist_files/def_dxpl_32be differ diff --git a/test/testfiles/plist_files/def_dxpl_32le b/test/testfiles/plist_files/def_dxpl_32le index 3b77a32..b13f456 100644 Binary files a/test/testfiles/plist_files/def_dxpl_32le and b/test/testfiles/plist_files/def_dxpl_32le differ diff --git a/test/testfiles/plist_files/def_dxpl_64be b/test/testfiles/plist_files/def_dxpl_64be index 3b77a32..b13f456 100644 Binary files a/test/testfiles/plist_files/def_dxpl_64be and b/test/testfiles/plist_files/def_dxpl_64be differ diff --git a/test/testfiles/plist_files/def_dxpl_64le b/test/testfiles/plist_files/def_dxpl_64le index 3b77a32..b13f456 100644 Binary files a/test/testfiles/plist_files/def_dxpl_64le and b/test/testfiles/plist_files/def_dxpl_64le differ diff --git a/test/testfiles/plist_files/def_fapl_32be b/test/testfiles/plist_files/def_fapl_32be index 3b35501..6b6baee 100644 Binary files a/test/testfiles/plist_files/def_fapl_32be and b/test/testfiles/plist_files/def_fapl_32be differ diff --git a/test/testfiles/plist_files/def_fapl_32le b/test/testfiles/plist_files/def_fapl_32le index 3b35501..6b6baee 100644 Binary files a/test/testfiles/plist_files/def_fapl_32le and b/test/testfiles/plist_files/def_fapl_32le differ diff --git a/test/testfiles/plist_files/def_fapl_64be b/test/testfiles/plist_files/def_fapl_64be index 3b35501..6b6baee 100644 Binary files a/test/testfiles/plist_files/def_fapl_64be and b/test/testfiles/plist_files/def_fapl_64be differ diff --git a/test/testfiles/plist_files/def_fapl_64le b/test/testfiles/plist_files/def_fapl_64le index 3b35501..6b6baee 100644 Binary files a/test/testfiles/plist_files/def_fapl_64le and b/test/testfiles/plist_files/def_fapl_64le differ diff --git a/test/testfiles/plist_files/dxpl_32be b/test/testfiles/plist_files/dxpl_32be index 22fbdc8..5ff2ea0 100644 Binary files a/test/testfiles/plist_files/dxpl_32be and b/test/testfiles/plist_files/dxpl_32be differ diff --git a/test/testfiles/plist_files/dxpl_32le b/test/testfiles/plist_files/dxpl_32le index 22fbdc8..5ff2ea0 100644 Binary files a/test/testfiles/plist_files/dxpl_32le and b/test/testfiles/plist_files/dxpl_32le differ diff --git a/test/testfiles/plist_files/dxpl_64be b/test/testfiles/plist_files/dxpl_64be index 22fbdc8..5ff2ea0 100644 Binary files a/test/testfiles/plist_files/dxpl_64be and b/test/testfiles/plist_files/dxpl_64be differ diff --git a/test/testfiles/plist_files/dxpl_64le b/test/testfiles/plist_files/dxpl_64le index 22fbdc8..5ff2ea0 100644 Binary files a/test/testfiles/plist_files/dxpl_64le and b/test/testfiles/plist_files/dxpl_64le differ diff --git a/test/testfiles/plist_files/fapl_32be b/test/testfiles/plist_files/fapl_32be index 43e5e67..65e2070 100644 Binary files a/test/testfiles/plist_files/fapl_32be and b/test/testfiles/plist_files/fapl_32be differ diff --git a/test/testfiles/plist_files/fapl_32le b/test/testfiles/plist_files/fapl_32le index 43e5e67..65e2070 100644 Binary files a/test/testfiles/plist_files/fapl_32le and b/test/testfiles/plist_files/fapl_32le differ diff --git a/test/testfiles/plist_files/fapl_64be b/test/testfiles/plist_files/fapl_64be index 43e5e67..65e2070 100644 Binary files a/test/testfiles/plist_files/fapl_64be and b/test/testfiles/plist_files/fapl_64be differ diff --git a/test/testfiles/plist_files/fapl_64le b/test/testfiles/plist_files/fapl_64le index 43e5e67..65e2070 100644 Binary files a/test/testfiles/plist_files/fapl_64le and b/test/testfiles/plist_files/fapl_64le differ diff --git a/test/testfiles/plist_files/fcpl_32be b/test/testfiles/plist_files/fcpl_32be index 3ce8bf4..ffa5242 100644 Binary files a/test/testfiles/plist_files/fcpl_32be and b/test/testfiles/plist_files/fcpl_32be differ diff --git a/test/testfiles/plist_files/fcpl_32le b/test/testfiles/plist_files/fcpl_32le index 3ce8bf4..ffa5242 100644 Binary files a/test/testfiles/plist_files/fcpl_32le and b/test/testfiles/plist_files/fcpl_32le differ diff --git a/test/testfiles/plist_files/fcpl_64be b/test/testfiles/plist_files/fcpl_64be index 3ce8bf4..ffa5242 100644 Binary files a/test/testfiles/plist_files/fcpl_64be and b/test/testfiles/plist_files/fcpl_64be differ diff --git a/test/testfiles/plist_files/fcpl_64le b/test/testfiles/plist_files/fcpl_64le index 3ce8bf4..ffa5242 100644 Binary files a/test/testfiles/plist_files/fcpl_64le and b/test/testfiles/plist_files/fcpl_64le differ diff --git a/test/testfiles/plist_files/lapl_32be b/test/testfiles/plist_files/lapl_32be index f3e9865..e9f43e2 100644 Binary files a/test/testfiles/plist_files/lapl_32be and b/test/testfiles/plist_files/lapl_32be differ diff --git a/test/testfiles/plist_files/lapl_32le b/test/testfiles/plist_files/lapl_32le index f3e9865..e9f43e2 100644 Binary files a/test/testfiles/plist_files/lapl_32le and b/test/testfiles/plist_files/lapl_32le differ diff --git a/test/testfiles/plist_files/lapl_64be b/test/testfiles/plist_files/lapl_64be index f3e9865..e9f43e2 100644 Binary files a/test/testfiles/plist_files/lapl_64be and b/test/testfiles/plist_files/lapl_64be differ diff --git a/test/testfiles/plist_files/lapl_64le b/test/testfiles/plist_files/lapl_64le index f3e9865..e9f43e2 100644 Binary files a/test/testfiles/plist_files/lapl_64le and b/test/testfiles/plist_files/lapl_64le differ diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in index 83b7134..7bfeb60 100644 --- a/test/testflushrefresh.sh.in +++ b/test/testflushrefresh.sh.in @@ -118,7 +118,7 @@ until [ $verification_done -eq 1 ]; do # Check to see if we timed out looking for the signal before continuing. if [ $timedout -gt 0 ]; then - echo "timed out waiting for signal from test program (flush)." + echo timed out waiting for signal from test program. break fi @@ -158,7 +158,7 @@ if [ $timedout -eq 0 ]; then # Check to see if we timed out looking for the signal before continuing. if [ $timedout -gt 0 ]; then - echo "timed out waiting for signal from test program (refresh)." + echo timed out waiting for signal from test program. break fi diff --git a/test/tfile.c b/test/tfile.c index 6987493..19a2df4 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -103,14 +103,14 @@ #define USERBLOCK_SIZE ((hsize_t) 512) /* Declarations for test_filespace_*() */ -#define FILENAME_LEN 1024 /* length of file name */ +#define FILENAME_LEN 1024 /* length of file name */ #define CORE_INCREMENT 1024 /* core file */ #define FAMILY_SIZE 1024 /* family file */ -#define DSETNAME "dset" /* Name of dataset */ -#define NELMTS(X) (sizeof(X)/sizeof(X[0])) /* # of elements */ -#define READ_OLD_BUFSIZE 1024 /* Buffer for holding file data */ -#define FILE5 "tfile5.h5" /* Test file */ -#define TEST_THRESHOLD10 10 /* Free space section threshold */ +#define DSETNAME "dset" /* Name of dataset */ +#define NELMTS(X) (sizeof(X)/sizeof(X[0])) /* # of elements */ +#define READ_OLD_BUFSIZE 1024 /* Buffer for holding file data */ +#define FILE5 "tfile5.h5" /* Test file */ +#define TEST_THRESHOLD10 10 /* Free space section threshold */ /* Declaration for test_libver_macros2() */ #define FILE6 "tfile6.h5" /* Test file */ @@ -120,8 +120,7 @@ #define NGROUPS 2 #define NDSETS 4 -/* Files created under 1.6 branch and 1.8 branch--used in test_filespace_compatible() */ -const char *OLD_FILENAME[] = { +const char *OLD_FILENAME[] = { /* Files created under 1.6 branch and 1.8 branch */ "filespace_1_6.h5", /* 1.6 HDF5 file */ "filespace_1_8.h5" /* 1.8 HDF5 file */ }; @@ -889,8 +888,9 @@ test_file_close(void) ret = H5Gclose(group_id3); CHECK(ret, FAIL, "H5Gclose"); break; - case H5F_CLOSE_DEFAULT: - default: + + case H5F_CLOSE_DEFAULT: + default: CHECK(fc_degree, H5F_CLOSE_DEFAULT, "H5Pget_fclose_degree"); break; } @@ -3605,36 +3605,36 @@ static void test_filespace_compatible(void) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ - hid_t fid = -1; /* File id */ - hid_t did = -1; /* Dataset id */ - hid_t fcpl; /* File creation property list template */ - int check[100]; /* Temporary buffer for verifying dataset data */ - int rdbuf[100]; /* Temporary buffer for reading in dataset data */ + hid_t fid; /* File id */ + hid_t fcpl; /* File creation property list template */ + hid_t did; /* Dataset id */ + int check[100]; /* Temporary buffer for verifying dataset data */ + int rdbuf[100]; /* Temporary buffer for reading in dataset data */ uint8_t buf[READ_OLD_BUFSIZE]; /* temporary buffer for reading */ - ssize_t nread; /* Number of bytes read in */ - unsigned i, j; /* Local index variable */ - hssize_t free_space; /* Amount of free-space in the file */ - hsize_t threshold; /* Free-space section threshold */ + ssize_t nread; /* Number of bytes read in */ + unsigned i, j; /* Local index variable */ + hssize_t free_space; /* Amount of free space in the file */ + hsize_t threshold; /* Free space section threshold */ H5F_file_space_type_t strategy; /* File space handling strategy */ - herr_t ret; /* Return value */ + herr_t ret; /* Return value */ /* Output message about test being performed */ - MESSAGE(5, ("File space compatibility testing for 1.6 and 1.8 files\n")); + MESSAGE(5, ("Testing File space compatibility for 1.6 and 1.8 files\n")); for(j = 0; j < NELMTS(OLD_FILENAME); j++) { const char *filename = H5_get_srcdir_filename(OLD_FILENAME[j]); /* Corrected test file name */ - /* Open and copy the test file into a temporary file */ + /* Copy old file into test file */ fd_old = HDopen(filename, O_RDONLY, 0666); CHECK(fd_old, FAIL, "HDopen"); fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, 0666); CHECK(fd_new, FAIL, "HDopen"); /* Copy data */ - while((nread = HDread(fd_old, buf, (size_t)READ_OLD_BUFSIZE)) > 0) { - ssize_t write_err = HDwrite(fd_new, buf, (size_t)nread); - CHECK(write_err, -1, "HDwrite"); - } /* end while */ + while((nread = HDread(fd_old, buf, (size_t)READ_OLD_BUFSIZE)) > 0) { + ssize_t write_err = HDwrite(fd_new, buf, (size_t)nread); + CHECK(write_err, -1, "HDwrite"); + } /* end while */ /* Close the files */ ret = HDclose(fd_old); @@ -3642,7 +3642,7 @@ test_filespace_compatible(void) ret = HDclose(fd_new); CHECK(ret, FAIL, "HDclose"); - /* Open the temporary test file */ + /* Open the test file */ fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); @@ -3651,11 +3651,10 @@ test_filespace_compatible(void) CHECK(free_space, FAIL, "H5Fget_freespace"); VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); - /* Get the file's file creation property list */ - fcpl = H5Fget_create_plist(fid); - CHECK(fcpl, FAIL, "H5Fget_create_plist"); - + /* Get the file's file creation property list */ /* Retrieve the file space handling strategy and threshold */ + fcpl = H5Fget_create_plist(fid); + CHECK(fcpl, FAIL, "H5Fget_create_plist"); ret = H5Pget_file_space(fcpl, &strategy, &threshold); CHECK(ret, FAIL, "H5Pget_file_space"); @@ -3686,13 +3685,13 @@ test_filespace_compatible(void) ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); CHECK(ret, FAIL, "H5Ldelete"); - /* Close the plist */ - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Pclose"); + /* Close the plist */ + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Pclose"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); /* Re-Open the file */ fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT); @@ -4091,37 +4090,37 @@ test_file(void) /* Output message about test being performed */ MESSAGE(5, ("Testing Low-Level File I/O\n")); - test_file_create(); /* Test file creation(also creation templates)*/ - test_file_open(); /* Test file opening */ - test_file_reopen(); /* Test file reopening */ - test_file_close(); /* Test file close behavior */ - test_get_file_id(); /* Test H5Iget_file_id */ - test_get_obj_ids(); /* Test H5Fget_obj_ids for Jira Issue 8528 */ - test_file_perm(); /* Test file access permissions */ - test_file_perm2(); /* Test file access permission again */ + test_file_create(); /* Test file creation(also creation templates)*/ + test_file_open(); /* Test file opening */ + test_file_reopen(); /* Test file reopening */ + test_file_close(); /* Test file close behavior */ + test_get_file_id(); /* Test H5Iget_file_id */ + test_get_obj_ids(); /* Test H5Fget_obj_ids for Jira Issue 8528 */ + test_file_perm(); /* Test file access permissions */ + test_file_perm2(); /* Test file access permission again */ test_file_freespace(); /* Test file free space information */ - test_file_ishdf5(); /* Test detecting HDF5 files correctly */ - test_file_open_dot(); /* Test opening objects with "." for a name */ - test_file_open_overlap(); /* Test opening files in an overlapping manner */ - test_file_getname(); /* Test basic H5Fget_name() functionality */ - test_file_double_root_open(); /* Test opening root group from two files works properly */ - test_file_double_group_open(); /* Test opening same group from two files works properly */ - test_file_double_dataset_open(); /* Test opening same dataset from two files works properly */ - test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */ + test_file_ishdf5(); /* Test detecting HDF5 files correctly */ + test_file_open_dot(); /* Test opening objects with "." for a name */ + test_file_open_overlap(); /* Test opening files in an overlapping manner */ + test_file_getname(); /* Test basic H5Fget_name() functionality */ + test_file_double_root_open(); /* Test opening root group from two files works properly */ + test_file_double_group_open(); /* Test opening same group from two files works properly */ + test_file_double_dataset_open(); /* Test opening same dataset from two files works properly */ + test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */ test_file_double_file_dataset_open(TRUE); test_file_double_file_dataset_open(FALSE); - test_userblock_file_size(); /* Tests that files created with a userblock have the correct size */ - test_cached_stab_info(); /* Tests that files are created with cached stab info in the superblock */ - test_rw_noupdate(); /* Test to ensure that RW permissions don't write the file unless dirtied */ - test_userblock_alignment(); /* Tests that files created with a userblock and alignment interact properly */ + test_userblock_file_size(); /* Tests that files created with a userblock have the correct size */ + test_cached_stab_info(); /* Tests that files are created with cached stab info in the superblock */ + test_rw_noupdate(); /* Test to ensure that RW permissions don't write the file unless dirtied */ + test_userblock_alignment(); /* Tests that files created with a userblock and alignment interact properly */ test_filespace_sects(); /* Test file free space section information */ test_filespace_info(); /* Test file creation public routines:H5Pget/set_file_space */ - test_filespace_compatible(); /* Test compatibility for file space management */ - test_libver_bounds(); /* Test compatibility for file space management */ - test_libver_macros(); /* Test the macros for library version comparison */ - test_libver_macros2(); /* Test the macros for library version comparison */ + test_filespace_compatible();/* Test compatibility for file space management */ + test_libver_bounds(); /* Test compatibility for file space management */ + test_libver_macros(); /* Test the macros for library version comparison */ + test_libver_macros2(); /* Test the macros for library version comparison */ #ifndef H5_NO_DEPRECATED_SYMBOLS - test_deprec(); /* Test deprecated routines */ + test_deprec(); /* Test deprecated routines */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* test_file() */ diff --git a/test/unlink.c b/test/unlink.c index e52699a..660a155 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -2440,9 +2440,9 @@ int main(void) { hid_t fapl, fapl2, file; - int nerrors = 0; + int nerrors = 0; char filename[1024]; - unsigned new_format; + unsigned new_format; /* Metadata cache parameters */ int mdc_nelmts; diff --git a/test/vds.c b/test/vds.c index e6bfeb3..2fd492a 100644 --- a/test/vds.c +++ b/test/vds.c @@ -2812,7 +2812,7 @@ test_basic_io(unsigned config, hid_t fapl) /* Write data directly to source dataset */ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) - TEST_ERROR + TEST_ERROR /* Close srcdset and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -7265,12 +7265,6 @@ test_printf(unsigned config, hid_t fapl) if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - /* Test H5Pget_virtual_printf_gap() */ - if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) - TEST_ERROR - if(gap_size != (hsize_t)2) - TEST_ERROR - /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) TEST_ERROR @@ -7335,12 +7329,6 @@ test_printf(unsigned config, hid_t fapl) if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - /* Test H5Pget_virtual_printf_gap() */ - if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) - TEST_ERROR - if(gap_size != (hsize_t)3) - TEST_ERROR - /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) TEST_ERROR @@ -7405,12 +7393,6 @@ test_printf(unsigned config, hid_t fapl) if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR - /* Test H5Pget_virtual_printf_gap() */ - if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) - TEST_ERROR - if(gap_size != (hsize_t)4) - TEST_ERROR - /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) TEST_ERROR @@ -11139,23 +11121,23 @@ error: static int test_dapl_values(hid_t fapl_id) { - hid_t fid = -1; /* file to write to */ - hid_t dcpl_id = -1; /* dataset creation properties */ - hid_t dapl_id1 = -1; /* dataset access properties */ - hid_t dapl_id2 = -1; /* dataset access properties */ - hid_t vds_sid = -1; /* vds data space */ - hid_t src_sid = -1; /* source data space */ - hid_t did1 = -1; /* dataset */ - hid_t did2 = -1; /* dataset */ - hsize_t start; /* hyperslab start */ - hsize_t stride; /* hyperslab count */ - hsize_t count; /* hyperslab count */ - hsize_t block; /* hyperslab count */ - hsize_t dims; /* dataset size */ - hsize_t max_dims; /* dataset max size */ - H5D_vds_view_t view; /* view from dapl */ - hsize_t gap_size; /* gap size from dapl */ - char filename[1024]; /* file names */ + hid_t fid = -1; /* file to write to */ + hid_t dcpl_id = -1; /* dataset creation properties */ + hid_t dapl_id1 = -1; /* dataset access properties */ + hid_t dapl_id2 = -1; /* dataset access properties */ + hid_t vds_sid = -1; /* vds data space */ + hid_t src_sid = -1; /* source data space */ + hid_t did1 = -1; /* dataset */ + hid_t did2 = -1; /* dataset */ + hsize_t start; /* hyperslab start */ + hsize_t stride; /* hyperslab count */ + hsize_t count; /* hyperslab count */ + hsize_t block; /* hyperslab count */ + hsize_t dims; /* dataset size */ + hsize_t max_dims; /* dataset max size */ + H5D_vds_view_t view; /* view from dapl */ + hsize_t gap_size; /* gap size from dapl */ + char filename[1024]; /* file names */ TESTING("H5Dget_access_plist() returns dapl w/ correct values"); @@ -11239,7 +11221,6 @@ test_dapl_values(hid_t fapl_id) if(H5Pget_virtual_printf_gap(dapl_id2, &gap_size) < 0) FAIL_STACK_ERROR if(gap_size != 123) - TEST_ERROR /* Close everything */ if(H5Sclose(vds_sid) < 0) FAIL_STACK_ERROR diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 298d326..58135b7 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TEST_PAR) #----------------------------------------------------------------------------- @@ -54,6 +54,6 @@ set (H5P_TESTS foreach (testp ${H5P_TESTS}) ADD_H5P_EXE(${testp}) -endforeach () +endforeach (testp ${H5P_TESTS}) include (CMakeTests.cmake) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index 7dce6d6..3716ee6 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -9,7 +9,7 @@ add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEX foreach (testp ${H5P_TESTS}) add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) -endforeach () +endforeach (testp ${H5P_TESTS}) # The following will only be correct on windows shared #set_tests_properties (TEST_PAR_t_pflush1 PROPERTIES WILL_FAIL "true") @@ -31,16 +31,16 @@ if (HDF5_TEST_VFD) t_pflush1 t_pflush2 ) - + if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) - endif () + endif (DIRECT_VFD) - macro (ADD_VFD_TEST vfdname resultcode) + MACRO (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) foreach (test ${H5P_VFD_TESTS}) add_test ( - NAME TEST_PAR_VFD-${vfdname}-${test} + NAME TEST_PAR_VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" @@ -50,13 +50,13 @@ if (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) - endforeach () - endif () - endmacro () - + endforeach (test ${H5P_VFD_TESTS}) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_VFD_TEST) + # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - endforeach () + endforeach (vfd ${VFD_LIST}) -endif () +endif (HDF5_TEST_VFD) diff --git a/testpar/t_cache.c b/testpar/t_cache.c index bfa4c8f..8753325 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -333,7 +333,7 @@ struct mssg_t haddr_t base_addr; unsigned len; int ver; - unsigned count; + int count; unsigned magic; }; @@ -410,8 +410,7 @@ static herr_t datum_notify(H5C_notify_action_t action, void *thing); static herr_t datum_free_icr(void * thing); -/* Masquerade as object header entries to the cache */ -#define DATUM_ENTRY_TYPE H5AC_OHDR_ID +#define DATUM_ENTRY_TYPE H5AC_TEST_ID #define NUMBER_OF_ENTRY_TYPES 1 @@ -435,7 +434,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = { /* id */ DATUM_ENTRY_TYPE, /* name */ "datum", - /* mem_type */ H5FD_MEM_OHDR, + /* mem_type */ H5FD_MEM_DEFAULT, /* flags */ H5AC__CLASS_SKIP_READS | H5AC__CLASS_SKIP_WRITES, /* get_initial_load_size */ datum_get_initial_load_size, /* get_final_load_size */ NULL, @@ -485,8 +484,8 @@ static hbool_t take_down_cache(hid_t fid, H5C_t * cache_ptr); static hbool_t verify_entry_reads(haddr_t addr, int expected_entry_reads); static hbool_t verify_entry_writes(haddr_t addr, int expected_entry_writes); static hbool_t verify_total_reads(int expected_total_reads); -static hbool_t verify_total_writes(unsigned expected_total_writes); -static void verify_writes(unsigned num_writes, haddr_t * written_entries_tbl); +static hbool_t verify_total_writes(int expected_total_writes); +static void verify_writes(int num_writes, haddr_t * written_entries_tbl); static void unlock_entry(H5F_t * file_ptr, int32_t type, unsigned int flags); static void unpin_entry(H5F_t * file_ptr, int32_t idx, hbool_t global, hbool_t dirty, hbool_t via_unprotect); @@ -1214,7 +1213,7 @@ setup_derived_types(void) int result; MPI_Datatype mpi_types[9] = {MPI_INT, MPI_INT, MPI_INT, MPI_LONG, HADDR_AS_MPI_TYPE, MPI_INT, MPI_INT, - MPI_UNSIGNED, MPI_UNSIGNED}; + MPI_INT, MPI_UNSIGNED}; int block_len[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1}; MPI_Aint displs[9]; struct mssg_t sample; /* used to compute displacements */ @@ -4334,13 +4333,15 @@ setup_cache_for_test(hid_t * fid_ptr, * *****************************************************************************/ static void -verify_writes(unsigned num_writes, haddr_t *written_entries_tbl) +verify_writes(int num_writes, + haddr_t * written_entries_tbl) { const hbool_t report = FALSE; hbool_t proceed = TRUE; - unsigned u = 0; + int i = 0; HDassert( world_mpi_rank != world_server_mpi_rank ); + HDassert( num_writes >= 0 ); HDassert( ( num_writes == 0 ) || ( written_entries_tbl != NULL ) ); @@ -4360,12 +4361,15 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl) } } - if(proceed) + if ( proceed ) { + proceed = verify_total_writes(num_writes); + } - while(proceed && u < num_writes) { - proceed = verify_entry_writes(written_entries_tbl[u], 1); - u++; + while ( ( proceed ) && ( i < num_writes ) ) + { + proceed = verify_entry_writes(written_entries_tbl[i], 1); + i++; } /* barrier to ensure that all other processes have finished verifying @@ -4394,12 +4398,12 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl) if ( proceed ) { - HDfprintf(stdout, "%d:%s: verified %u writes.\n", + HDfprintf(stdout, "%d:%s: verified %d writes.\n", world_mpi_rank, FUNC, num_writes); } else { - HDfprintf(stdout, "%d:%s: FAILED to verify %u writes.\n", + HDfprintf(stdout, "%d:%s: FAILED to verify %d writes.\n", world_mpi_rank, FUNC, num_writes); } @@ -4924,10 +4928,10 @@ verify_total_reads(int expected_total_reads) * *****************************************************************************/ static hbool_t -verify_total_writes(unsigned expected_total_writes) +verify_total_writes(int expected_total_writes) { hbool_t success = TRUE; /* will set to FALSE if appropriate. */ - unsigned reported_total_writes; + long reported_total_writes; struct mssg_t mssg; if ( success ) { @@ -4992,7 +4996,7 @@ verify_total_writes(unsigned expected_total_writes) success = FALSE; if ( verbose ) { HDfprintf(stdout, - "%d:%s: reported/expected total writes mismatch (%u/%u).\n", + "%d:%s: reported/expected total writes mismatch (%ld/%ld).\n", world_mpi_rank, FUNC, reported_total_writes, expected_total_writes); } @@ -5314,7 +5318,7 @@ server_smoke_check(void) if ( success ) { - success = verify_total_writes((unsigned)(world_mpi_size - 1)); + success = verify_total_writes(world_mpi_size - 1); } if ( success ) { @@ -5418,7 +5422,7 @@ server_smoke_check(void) if ( success ) { - success = verify_total_writes((unsigned)(world_mpi_size - 1)); + success = verify_total_writes(world_mpi_size - 1); } if ( success ) { diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 4b3b3d5..4b9b765 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- @@ -11,7 +11,7 @@ add_definitions (${HDF_EXTRA_C_FLAGS}) # -------------------------------------------------------------------- if (NOT BUILD_TESTING) add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/lib) -endif () +endif (NOT BUILD_TESTING) #----------------------------------------------------------------------------- # Setup include Directories @@ -24,4 +24,4 @@ add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/src) #-- Add the tests if (BUILD_TESTING) add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/test) -endif () +endif (BUILD_TESTING) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index ade7671..bfd1af2 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- @@ -63,7 +63,7 @@ if (BUILD_SHARED_LIBS) ) #set_property (TARGET ${HDF5_TOOLS_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS H5DIFF_DEBUG) set (install_targets ${install_targets} ${HDF5_TOOLS_LIBSH_TARGET}) -endif () +endif (BUILD_SHARED_LIBS) ############################################################################## ############################################################################## @@ -89,8 +89,7 @@ install ( if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries) - endif () - INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries) + endif (BUILD_SHARED_LIBS) install ( TARGETS @@ -103,4 +102,4 @@ if (HDF5_EXPORTED_TARGETS) FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT toolslibraries INCLUDES DESTINATION include ) -endif () +endif (HDF5_EXPORTED_TARGETS) diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index e6ff7e0..79dc51f 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -47,7 +47,7 @@ void do_print_objname (const char *OBJ, const char *path1, const char *path2, di { /* if verbose level is higher than 0, put space line before * displaying any object or symbolic links. This improves - * readability of the output. + * readability of the output. */ if (opts->m_verbose_level >= 1) parallel_print("\n"); @@ -71,7 +71,7 @@ do_print_attrname (const char *attr, const char *path1, const char *path2) * Function: print_warn * * Purpose: check print warning condition. - * Return: + * Return: * 1 if verbose mode * 0 if not verbos mode * Programmer: Jonathan Kim @@ -146,7 +146,7 @@ static void print_incoming_data(void) * * Purpose: check if options are valid * - * Return: + * Return: * 1 : Valid * 0 : Not valid * @@ -189,10 +189,10 @@ out: * * Purpose: check if 'paths' are part of exclude path list * - * Return: + * Return: * 1 - excluded path * 0 - not excluded path - * + * * Programmer: Jonathan Kim * Date: Aug 23, 2010 *------------------------------------------------------------------------*/ @@ -221,11 +221,11 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options { size_t len_grp; - /* check if given path belong to an excluding group, if so + /* check if given path belong to an excluding group, if so * exclude it as well. * This verifies if “/grp1/dset1†is only under “/grp1â€, but - * not under “/grp1xxx/†group. - */ + * not under “/grp1xxx/†group. + */ len_grp = HDstrlen(exclude_path_ptr->obj_path); if (path[len_grp] == '/') { @@ -236,15 +236,15 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options } } /* exclude target is not group, just exclude the object */ - else + else { ret_cmp = HDstrcmp(exclude_path_ptr->obj_path, path); if (ret_cmp == 0) /* found matching object */ { /* excluded non-group object */ ret = 1; - /* remember the type of this maching object. - * if it's group, it can be used for excluding its member + /* remember the type of this maching object. + * if it's group, it can be used for excluding its member * objects in this while() loop */ exclude_path_ptr->obj_type = type; break; /* while */ @@ -339,7 +339,7 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch path2_lp = (info2->paths[curr2].path) + path2_offset; type1_l = info1->paths[curr1].type; type2_l = info2->paths[curr2].type; - + /* criteria is string compare */ cmp = HDstrcmp(path1_lp, path2_lp); @@ -410,7 +410,7 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch if (!is_exclude_path(path2_lp, type2_l, options)) { trav_table_addflags(infile, path2_lp, info2->paths[curr2].type, table); - } + } curr2++; } /* end while */ @@ -424,8 +424,8 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch /*------------------------------------------------------------------------- * Function: trav_grp_objs * - * Purpose: - * Call back function from h5trav_visit(). + * Purpose: + * Call back function from h5trav_visit(). * * Programmer: Jonathan Kim * @@ -437,22 +437,22 @@ static herr_t trav_grp_objs(const char *path, const H5O_info_t *oinfo, trav_info_visit_obj(path, oinfo, already_visited, udata); return 0; -} +} /*------------------------------------------------------------------------- * Function: trav_grp_symlinks * - * Purpose: - * Call back function from h5trav_visit(). + * Purpose: + * Call back function from h5trav_visit(). * Track and extra checkings while visiting all symbolic-links. * * Programmer: Jonathan Kim * * Date: Aug 16, 2010 *------------------------------------------------------------------------*/ -static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, +static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, void *udata) -{ +{ trav_info_t *tinfo = (trav_info_t *)udata; diff_opt_t *opts = (diff_opt_t *)tinfo->opts; int ret; @@ -482,18 +482,18 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) - opts->err_stat = 1; /* make dangling link is error */ + opts->err_stat = 1; /* make dgangling link is error */ goto done; } - /* check if already visit the target object */ - if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path)) + /* check if already visit the target object */ + if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path)) goto done; /* add this link as visited link */ - if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path) < 0) + if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path) < 0) goto done; - + if(h5trav_visit(tinfo->fid, path, TRUE, TRUE, trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { @@ -502,8 +502,8 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, goto done; } break; - - case H5L_TYPE_EXTERNAL: + + case H5L_TYPE_EXTERNAL: ret = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links); /* error */ if (ret < 0) @@ -514,21 +514,21 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) - opts->err_stat = 1; /* make dangling link is error */ + opts->err_stat = 1; /* make dgangling link is error */ goto done; } - if(H5Lunpack_elink_val(lnk_info.trg_path, linfo->u.val_size, NULL, &ext_fname, &ext_path) < 0) + if(H5Lunpack_elink_val(lnk_info.trg_path, linfo->u.val_size, NULL, &ext_fname, &ext_path) < 0) goto done; - /* check if already visit the target object */ - if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path)) + /* check if already visit the target object */ + if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path)) goto done; /* add this link as visited link */ - if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path) < 0) + if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path) < 0) goto done; - + if(h5trav_visit(tinfo->fid, path, TRUE, TRUE, trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { @@ -548,11 +548,11 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, break; } /* end of switch */ -done: +done: if (lnk_info.trg_path) HDfree(lnk_info.trg_path); return 0; -} +} /*------------------------------------------------------------------------- @@ -630,7 +630,7 @@ hsize_t h5diff(const char *fname1, H5E_BEGIN_TRY { /* open file 1 */ - if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) + if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname1); options->err_stat = 1; @@ -639,7 +639,7 @@ hsize_t h5diff(const char *fname1, /* open file 2 */ - if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) + if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname2); options->err_stat = 1; @@ -704,14 +704,14 @@ hsize_t h5diff(const char *fname1, else { /* check if link itself exist */ - if(H5Lexists(file1_id, obj1fullname, H5P_DEFAULT) <= 0) + if(H5Lexists(file1_id, obj1fullname, H5P_DEFAULT) <= 0) { parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1); options->err_stat = 1; goto out; } /* get info from link */ - if(H5Lget_info(file1_id, obj1fullname, &src_linfo1, H5P_DEFAULT) < 0) + if(H5Lget_info(file1_id, obj1fullname, &src_linfo1, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj1fullname); goto out; @@ -719,7 +719,7 @@ hsize_t h5diff(const char *fname1, info1_lp = info1_obj; - /* + /* * check the type of specified path for hard and symbolic links */ if(src_linfo1.type == H5L_TYPE_HARD) @@ -764,14 +764,14 @@ hsize_t h5diff(const char *fname1, else { /* check if link itself exist */ - if(H5Lexists(file2_id, obj2fullname, H5P_DEFAULT) <= 0) + if(H5Lexists(file2_id, obj2fullname, H5P_DEFAULT) <= 0) { parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); options->err_stat = 1; goto out; } /* get info from link */ - if(H5Lget_info(file2_id, obj2fullname, &src_linfo2, H5P_DEFAULT) < 0) + if(H5Lget_info(file2_id, obj2fullname, &src_linfo2, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj2fullname); goto out; @@ -779,7 +779,7 @@ hsize_t h5diff(const char *fname1, info2_lp = info2_obj; - /* + /* * check the type of specified path for hard and symbolic links */ if(src_linfo2.type == H5L_TYPE_HARD) @@ -811,7 +811,7 @@ hsize_t h5diff(const char *fname1, obj2type = H5TRAV_TYPE_UDLINK; trav_info_add(info2_obj, obj2fullname, obj2type); } - } + } } /* if no object specified */ else @@ -830,7 +830,7 @@ hsize_t h5diff(const char *fname1, l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, options->follow_links); /*--------------------------------------------- - * check for following symlinks + * check for following symlinks */ if (options->follow_links) { @@ -915,7 +915,7 @@ hsize_t h5diff(const char *fname1, } } } - else if(l_ret2 < 0) /* fail */ + else if(l_ret2 < 0) /* fail */ { parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); options->err_stat = 1; @@ -936,11 +936,11 @@ hsize_t h5diff(const char *fname1, } } /* end of if follow symlinks */ - /* + /* * If verbose options is not used, don't need to traverse through the list * of objects in the group to display objects information, - * So use h5tools_is_obj_same() to improve performance by skipping - * comparing details of same objects. + * So use h5tools_is_obj_same() to improve performance by skipping + * comparing details of same objects. */ if(!(options->m_verbose || options->m_report)) @@ -1087,10 +1087,10 @@ out: /*------------------------------------------------------------------------- * Function: diff_match * - * Purpose: - * Compare common objects in given groups according to table structure. - * The table structure has flags which can be used to find common objects - * and will be compared. + * Purpose: + * Compare common objects in given groups according to table structure. + * The table structure has flags which can be used to find common objects + * and will be compared. * Common object means same name (absolute path) objects in both location. * * Return: Number of differences found @@ -1126,7 +1126,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, h5difftrace("diff_match start\n"); - /* + /* * if not root, prepare object name to be pre-appended to group path to * make full path */ @@ -1141,8 +1141,8 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, * 2) the graph must match, i.e same names (absolute path) * 3) objects with the same name must be of the same type *------------------------------------------------------------------------- - */ - + */ + /* not valid compare used when --exclude-path option is used */ if (!options->exclude_path) { @@ -1152,7 +1152,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, options->contents = 0; } } - + /* objects in one file and not the other */ for( i = 0; i < table->nobjs; i++) { @@ -1209,7 +1209,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, #endif /* H5_HAVE_ASPRINTF */ /* get index to figure out type of the object in file1 */ - while(info1->paths[idx1].path && + while(info1->paths[idx1].path && (HDstrcmp(obj1_fullpath, info1->paths[idx1].path) != 0)) idx1++; /* get index to figure out type of the object in file2 */ @@ -1226,7 +1226,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, if(!g_Parallel) { nfound += diff(file1_id, obj1_fullpath, - file2_id, obj2_fullpath, + file2_id, obj2_fullpath, options, &argdata); } /* end if */ #ifdef H5_HAVE_PARALLEL @@ -1244,7 +1244,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, */ /*Set up args to pass to worker task. */ - if(HDstrlen(obj1_fullpath) > 255 || + if(HDstrlen(obj1_fullpath) > 255 || HDstrlen(obj2_fullpath) > 255) { printf("The parallel diff only supports object names up to 255 characters\n"); @@ -1401,7 +1401,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, #endif /* H5_HAVE_PARALLEL */ if(obj1_fullpath) HDfree(obj1_fullpath); - if(obj2_fullpath) + if(obj2_fullpath) HDfree(obj2_fullpath); } /* end if */ } /* end for */ @@ -1568,14 +1568,14 @@ hsize_t diff(hid_t file1_id, if(print_warn(options)) linkinfo1.opt.msg_mode = linkinfo2.opt.msg_mode = 1; - /* for symbolic links, take care follow symlink and no dangling link + /* for symbolic links, take care follow symlink and no dangling link * options */ - if (argdata->type[0] == H5TRAV_TYPE_LINK || + if (argdata->type[0] == H5TRAV_TYPE_LINK || argdata->type[0] == H5TRAV_TYPE_UDLINK || - argdata->type[1] == H5TRAV_TYPE_LINK || + argdata->type[1] == H5TRAV_TYPE_LINK || argdata->type[1] == H5TRAV_TYPE_UDLINK ) { - /* + /* * check dangling links for path1 and path2 */ @@ -1586,7 +1586,7 @@ hsize_t diff(hid_t file1_id, { if (options->no_dangle_links) { - /* dangling link is error */ + /* gangling link is error */ if(options->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path1); goto out; @@ -1604,7 +1604,7 @@ hsize_t diff(hid_t file1_id, { if (options->no_dangle_links) { - /* dangling link is error */ + /* gangling link is error */ if(options->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path2); goto out; @@ -1614,7 +1614,7 @@ hsize_t diff(hid_t file1_id, } else if (ret < 0) goto out; - + /* found dangling link */ if (is_dangle_link1 || is_dangle_link2) goto out2; @@ -1637,7 +1637,7 @@ hsize_t diff(hid_t file1_id, if (options->m_verbose||options->m_list_not_cmp) { parallel_print("Not comparable: <%s> is of type %s and <%s> is of type %s\n", - path1, get_type(argdata->type[0]), + path1, get_type(argdata->type[0]), path2, get_type(argdata->type[1])); } options->not_cmp=1; @@ -1648,11 +1648,11 @@ hsize_t diff(hid_t file1_id, } else /* now both object types are same */ object_type = argdata->type[0]; - - /* + + /* * If both points to the same target object, skip comparing details inside * of the objects to improve performance. - * Always check for the hard links, otherwise if follow symlink option is + * Always check for the hard links, otherwise if follow symlink option is * specified. * * Perform this to match the outputs as bypassing. @@ -1672,7 +1672,7 @@ hsize_t diff(hid_t file1_id, { case H5TRAV_TYPE_DATASET: do_print_objname("dataset", path1, path2, options); - break; + break; case H5TRAV_TYPE_NAMED_DATATYPE: do_print_objname("datatype", path1, path2, options); break; @@ -1687,7 +1687,7 @@ hsize_t diff(hid_t file1_id, do_print_objname("external link", path1, path2, options); else do_print_objname ("user defined link", path1, path2, options); - break; + break; case H5TRAV_TYPE_UNKNOWN: default: parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n", @@ -1735,14 +1735,14 @@ hsize_t diff(hid_t file1_id, if (nfound) { do_print_objname("dataset", path1, path2, options); - print_found(nfound); + print_found(nfound); } } /*--------------------------------------------------------- * compare attributes - * if condition refers to cases when the dataset is a + * if condition refers to cases when the dataset is a * referenced object *--------------------------------------------------------- */ @@ -1781,7 +1781,7 @@ hsize_t diff(hid_t file1_id, /*----------------------------------------------------------------- * compare attributes - * the if condition refers to cases when the dataset is a + * the if condition refers to cases when the dataset is a * referenced object *----------------------------------------------------------------- */ @@ -1813,7 +1813,7 @@ hsize_t diff(hid_t file1_id, /*----------------------------------------------------------------- * compare attributes - * the if condition refers to cases when the dataset is a + * the if condition refers to cases when the dataset is a * referenced object *----------------------------------------------------------------- */ @@ -1855,10 +1855,10 @@ hsize_t diff(hid_t file1_id, case H5TRAV_TYPE_UDLINK: { /* Only external links will have a query function registered */ - if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) + if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) { /* If the buffers are the same size, compare them */ - if(linkinfo1.linfo.u.val_size == linkinfo2.linfo.u.val_size) + if(linkinfo1.linfo.u.val_size == linkinfo2.linfo.u.val_size) { ret = HDmemcmp(linkinfo1.trg_path, linkinfo2.trg_path, linkinfo1.linfo.u.val_size); } @@ -1866,7 +1866,7 @@ hsize_t diff(hid_t file1_id, ret = 1; /* if "linkinfo1.trg_path" != "linkinfo2.trg_path" then the links - * are "different" extlinkinfo#.path is combination string of + * are "different" extlinkinfo#.path is combination string of * file_name and obj_name */ nfound = (ret != 0) ? 1 : 0; @@ -1875,7 +1875,7 @@ hsize_t diff(hid_t file1_id, do_print_objname("external link", path1, path2, options); } /* end if */ - else + else { /* If one or both of these links isn't an external link, we can only * compare information from H5Lget_info since we don't have a query @@ -1884,7 +1884,7 @@ hsize_t diff(hid_t file1_id, * If the link classes or the buffer length are not the * same, the links are "different" */ - if((linkinfo1.linfo.type != linkinfo2.linfo.type) || + if((linkinfo1.linfo.type != linkinfo2.linfo.type) || (linkinfo1.linfo.u.val_size != linkinfo2.linfo.u.val_size)) nfound = 1; else @@ -1922,7 +1922,7 @@ out: out2: /*----------------------------------- - * handle dangling link(s) + * handle dangling link(s) */ /* both path1 and path2 are dangling links */ if(is_dangle_link1 && is_dangle_link2) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index e066937..9aadffe 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -130,7 +130,7 @@ typedef struct mcomp_t { unsigned n; /* number of members */ hid_t *ids; /* member type id */ - size_t *offsets; + size_t *offsets; struct mcomp_t **m; /* members */ }mcomp_t; @@ -546,7 +546,7 @@ hsize_t diff_array( void *_mem1, * Recursively call this function for each element * H5T_STRING * compare byte by byte in a cycle from 0 to type_size. this type_size is the - * value obtained by the get_size function but it is the string length for + * value obtained by the get_size function but it is the string lenght for * variable sized strings * H5T_OPAQUE * compare byte by byte in a cycle from 0 to type_size @@ -602,7 +602,7 @@ static hsize_t diff_datum(void *_mem1, /* Fast comparison first for atomic type by memcmp(). * It is OK not to list non-atomic type here because it will not be caught - * by the condition, but it gives more clarity for code planning + * by the confition, but it gives more clarity for code planning */ if (type_class != H5T_REFERENCE && type_class != H5T_COMPOUND && @@ -692,13 +692,6 @@ static hsize_t diff_datum(void *_mem1, * of length of strings. * For now mimic the previous way. */ - h5diffdebug2("diff_datum string size:%d\n",size1); - h5diffdebug2("diff_datum string size:%d\n",size2); - if(size1 != size2) - { - h5difftrace("diff_datum string sizes\n"); - nfound++; - } if(size1 < size2) { size = size1; @@ -719,7 +712,7 @@ static hsize_t diff_datum(void *_mem1, pad = H5Tget_strpad(m_type); - for (u=0; um[u] = (mcomp_t *)HDmalloc(sizeof(mcomp_t)); HDmemset(members->m[u], 0, sizeof(mcomp_t)); get_member_types(members->ids[u], members->m[u]); - } + } } - + return; diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index aca8d02..63f1483 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -89,9 +89,6 @@ hsize_t diff_dataset( hid_t file1_id, obj2_name, options); } - else - goto error; - /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index a673d15..67585d1 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -31,73 +31,73 @@ #include "H5private.h" h5tool_format_t h5tools_dataformat = { - 0, /*raw */ - - "", /*fmt_raw */ - "%d", /*fmt_int */ - "%u", /*fmt_uint */ - "%hhd", /*fmt_schar */ - "%u", /*fmt_uchar */ - "%d", /*fmt_short */ - "%u", /*fmt_ushort */ - "%ld", /*fmt_long */ - "%lu", /*fmt_ulong */ - NULL, /*fmt_llong */ - NULL, /*fmt_ullong */ - "%g", /*fmt_double */ - "%g", /*fmt_float */ - - 0, /*ascii */ - 0, /*str_locale */ - 0, /*str_repeat */ - - "[ ", /*arr_pre */ - ",", /*arr_sep */ - " ]", /*arr_suf */ - 1, /*arr_linebreak */ - - "", /*cmpd_name */ - ",\n", /*cmpd_sep */ - "{", /*cmpd_pre */ - "}", /*cmpd_suf */ - "\n", /*cmpd_end */ - NULL, /* cmpd_listv */ - - ", ", /*vlen_sep */ - "(", /*vlen_pre */ - ")", /*vlen_suf */ - "", /*vlen_end */ - - "%s", /*elmt_fmt */ - ",", /*elmt_suf1 */ - " ", /*elmt_suf2 */ - - "", /*idx_n_fmt */ - "", /*idx_sep */ - "", /*idx_fmt */ - - 80, /*line_ncols *//*standard default columns */ - 0, /*line_per_line */ - "", /*line_pre */ - "%s", /*line_1st */ - "%s", /*line_cont */ - "", /*line_suf */ - "", /*line_sep */ - 1, /*line_multi_new */ - " ", /*line_indent */ - - 1, /*skip_first */ - - 1, /*obj_hidefileno */ - " "H5_PRINTF_HADDR_FMT, /*obj_format */ - - 1, /*dset_hidefileno */ - "DATASET %s ", /*dset_format */ - "%s", /*dset_blockformat_pre */ - "%s", /*dset_ptformat_pre */ - "%s", /*dset_ptformat */ - 1, /*array indices */ - 1 /*escape non printable characters */ +0, /*raw */ + +"", /*fmt_raw */ +"%d", /*fmt_int */ +"%u", /*fmt_uint */ +"%hhd", /*fmt_schar */ +"%u", /*fmt_uchar */ +"%d", /*fmt_short */ +"%u", /*fmt_ushort */ +"%ld", /*fmt_long */ +"%lu", /*fmt_ulong */ +NULL, /*fmt_llong */ +NULL, /*fmt_ullong */ +"%g", /*fmt_double */ +"%g", /*fmt_float */ + +0, /*ascii */ +0, /*str_locale */ +0, /*str_repeat */ + +"[ ", /*arr_pre */ +",", /*arr_sep */ +" ]", /*arr_suf */ +1, /*arr_linebreak */ + +"", /*cmpd_name */ +",\n", /*cmpd_sep */ +"{", /*cmpd_pre */ +"}", /*cmpd_suf */ +"\n", /*cmpd_end */ +NULL, /* cmpd_listv */ + +", ", /*vlen_sep */ +"(", /*vlen_pre */ +")", /*vlen_suf */ +"", /*vlen_end */ + +"%s", /*elmt_fmt */ +",", /*elmt_suf1 */ +" ", /*elmt_suf2 */ + +"", /*idx_n_fmt */ +"", /*idx_sep */ +"", /*idx_fmt */ + +80, /*line_ncols *//*standard default columns */ +0, /*line_per_line */ +"", /*line_pre */ +"%s", /*line_1st */ +"%s", /*line_cont */ +"", /*line_suf */ +"", /*line_sep */ +1, /*line_multi_new */ +" ", /*line_indent */ + +1, /*skip_first */ + +1, /*obj_hidefileno */ +" "H5_PRINTF_HADDR_FMT, /*obj_format */ + +1, /*dset_hidefileno */ +"DATASET %s ", /*dset_format */ +"%s", /*dset_blockformat_pre */ +"%s", /*dset_ptformat_pre */ +"%s", /*dset_ptformat */ +1, /*array indices */ +1 /*escape non printable characters */ }; const h5tools_dump_header_t h5tools_standardformat = { diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt index 37680dd..5001b26 100644 --- a/tools/src/CMakeLists.txt +++ b/tools/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_SRC) #----------------------------------------------------------------------------- diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index d1f5f50..2a33c9e 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_SRC_H5COPY) #----------------------------------------------------------------------------- @@ -18,17 +18,6 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5copy") set (H5_DEP_EXECUTABLES h5copy) -if (BUILD_SHARED_LIBS) - add_executable (h5copy-shared ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) - TARGET_NAMING (h5copy-shared SHARED) - TARGET_C_PROPERTIES (h5copy-shared SHARED " " " ") - target_link_libraries (h5copy-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (h5copy-shared PROPERTIES FOLDER tools) - set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5copy-shared") - - set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5copy-shared) -endif () - ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### @@ -38,17 +27,13 @@ endif () #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_PROGRAM_PDB (h5copy-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) - endif () - INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) - install ( - TARGETS - ${H5_DEP_EXECUTABLES} - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications - ) -endif () +#INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) + +install ( + TARGETS + h5copy + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications +) diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index 00d93de..85a24ef 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_SRC_H5DIFF) #----------------------------------------------------------------------------- @@ -21,20 +21,6 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5diff") set (H5_DEP_EXECUTABLES h5diff) -if (BUILD_SHARED_LIBS) - add_executable (h5diff-shared - ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c - ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c - ) - TARGET_NAMING (h5diff-shared SHARED) - TARGET_C_PROPERTIES (h5diff-shared SHARED " " " ") - target_link_libraries (h5diff-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (h5diff-shared PROPERTIES FOLDER tools) - set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5diff-shared") - - set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5diff-shared) -endif () - if (H5_HAVE_PARALLEL) add_executable (ph5diff ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c @@ -45,7 +31,7 @@ if (H5_HAVE_PARALLEL) target_link_libraries (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (ph5diff PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};ph5diff") -endif () +endif (H5_HAVE_PARALLEL) ############################################################################## ############################################################################## @@ -56,29 +42,26 @@ endif () #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_PROGRAM_PDB (h5diff-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) - endif () - INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) + +#INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) + +install ( + TARGETS + h5diff + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications +) + +if (H5_HAVE_PARALLEL) + + #INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) install ( TARGETS - ${H5_DEP_EXECUTABLES} + ph5diff EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) - - if (H5_HAVE_PARALLEL) - #INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) - - install ( - TARGETS - ph5diff - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications - ) - endif () -endif () +endif (H5_HAVE_PARALLEL) diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index 65a7cdd..ab310db 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_SRC_H5DUMP) #----------------------------------------------------------------------------- @@ -22,21 +22,6 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump") set (H5_DEP_EXECUTABLES h5dump) -if (BUILD_SHARED_LIBS) - add_executable (h5dump-shared - ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.c - ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c - ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c - ) - TARGET_NAMING (h5dump-shared SHARED) - TARGET_C_PROPERTIES (h5dump-shared SHARED " " " ") - target_link_libraries (h5dump-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (h5dump-shared PROPERTIES FOLDER tools) - set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump-shared") - - set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5dump-shared) -endif () - ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### @@ -46,17 +31,13 @@ endif () #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_PROGRAM_PDB (h5dump-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) - endif () - INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) - install ( - TARGETS - ${H5_DEP_EXECUTABLES} - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications - ) -endif () +#INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) + +install ( + TARGETS + h5dump + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications +) diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 8ed88d2..5290c3d 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -69,7 +69,7 @@ static h5tool_format_t xml_dataformat = { "", /*cmpd_pre */ "", /*cmpd_suf */ "", /*cmpd_end */ - NULL, /*cmpd_listv */ + "", /*cmpd_listv */ " ", /*vlen_sep */ " ", /*vlen_pre */ diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index fa3abc0..957055d 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_SRC_H5FC) #----------------------------------------------------------------------------- @@ -27,14 +27,13 @@ set (H5_DEP_EXECUTABLES h5format_convert) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -if (HDF5_EXPORTED_TARGETS) - INSTALL_PROGRAM_PDB (h5format_convert ${HDF5_INSTALL_BIN_DIR} toolsapplications) - install ( - TARGETS - h5format_convert - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications - ) -endif () \ No newline at end of file +#INSTALL_PROGRAM_PDB (h5format_convert ${HDF5_INSTALL_BIN_DIR} toolsapplications) + +install ( + TARGETS + h5format_convert + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications +) diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index 9a61beb..97ab4ec 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_SRC_H5IMPORT) #----------------------------------------------------------------------------- @@ -28,14 +28,13 @@ set (H5_DEP_EXECUTABLES h5import) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -if (HDF5_EXPORTED_TARGETS) - INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR} toolsapplications) - install ( - TARGETS - h5import - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications - ) -endif () +#INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR} toolsapplications) + +install ( + TARGETS + h5import + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications +) diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index 3cca771..cef54c2 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_SRC_H5JAM) #----------------------------------------------------------------------------- @@ -37,14 +37,13 @@ set (H5_DEP_EXECUTABLES #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -if (HDF5_EXPORTED_TARGETS) - INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR} toolsapplications) - - install ( - TARGETS - h5jam h5unjam - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications - ) -endif () + +#INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR} toolsapplications) + +install ( + TARGETS + h5jam h5unjam + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications +) diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index 2e23634..24e11cc 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_SRC_H5LS) #----------------------------------------------------------------------------- @@ -16,18 +16,9 @@ target_link_libraries (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5ls PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5ls") -set (H5_DEP_EXECUTABLES h5ls) - -if (BUILD_SHARED_LIBS) - add_executable (h5ls-shared ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) - TARGET_NAMING (h5ls-shared SHARED) - TARGET_C_PROPERTIES (h5ls-shared SHARED " " " ") - target_link_libraries (h5ls-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (h5ls-shared PROPERTIES FOLDER tools) - set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5ls-shared") - - set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5ls-shared) -endif () +set (H5_DEP_EXECUTABLES + h5ls +) ############################################################################## ############################################################################## @@ -38,17 +29,13 @@ endif () #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_PROGRAM_PDB (h5ls-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) - endif () - INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) - install ( - TARGETS - ${H5_DEP_EXECUTABLES} - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications - ) -endif () +#INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) + +install ( + TARGETS + h5ls + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications +) diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index 81e6275..cb7f5f6 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_SRC_H5REPACK) #----------------------------------------------------------------------------- @@ -29,17 +29,6 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repack") set (H5_DEP_EXECUTABLES h5repack) -if (BUILD_SHARED_LIBS) - add_executable (h5repack-shared ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c) - TARGET_NAMING (h5repack-shared SHARED) - TARGET_C_PROPERTIES (h5repack-shared SHARED " " " ") - target_link_libraries (h5repack-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (h5repack-shared PROPERTIES FOLDER tools) - set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repack-shared") - - set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repack-shared) -endif () - ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### @@ -49,17 +38,13 @@ endif () #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_PROGRAM_PDB (h5repack-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) - endif () - INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) - install ( - TARGETS - ${H5_DEP_EXECUTABLES} - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications - ) -endif () +#INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) + +install ( + TARGETS + h5repack + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications +) diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index c79db1c..ef2085c 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -77,29 +77,27 @@ int h5repack(const char* infile, const char* outfile, pack_opt_t *options) { * *------------------------------------------------------------------------- */ -int -h5repack_init(pack_opt_t *options, int verbose, hbool_t latest, - H5F_file_space_type_t strategy, hsize_t threshold) -{ - int k, n; - - HDmemset(options, 0, sizeof(pack_opt_t)); - options->min_comp = 0; - options->verbose = verbose; - options->latest = latest; - options->layout_g = H5D_LAYOUT_ERROR; - - for (n = 0; n < H5_REPACK_MAX_NFILTERS; n++) { - options->filter_g[n].filtn = -1; - options->filter_g[n].cd_nelmts = 0; - for (k = 0; k < CD_VALUES; k++) - options->filter_g[n].cd_values[k] = 0; - } +int h5repack_init(pack_opt_t *options, int verbose, hbool_t latest, + H5F_file_space_type_t strategy, hsize_t threshold) { + int k, n; + + HDmemset(options, 0, sizeof(pack_opt_t)); + options->min_comp = 0; + options->verbose = verbose; + options->latest = latest; + options->layout_g = H5D_LAYOUT_ERROR; + + for (n = 0; n < H5_REPACK_MAX_NFILTERS; n++) { + options->filter_g[n].filtn = -1; + options->filter_g[n].cd_nelmts = 0; + for (k = 0; k < CD_VALUES; k++) + options->filter_g[n].cd_values[k] = 0; + } options->fs_strategy = strategy; options->fs_threshold = threshold; - return (options_table_init(&(options->op_tbl))); + return (options_table_init(&(options->op_tbl))); } /*------------------------------------------------------------------------- diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 1519053..547f61a 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -84,18 +84,28 @@ static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t * * Date: October, 23, 2003 * + * Modification: + * Peter Cao, June 13, 2007 + * Add "-L, --latest" and other options to pack a file with the latest file format + * + * Peter Cao, September 25, 2007 + * Copy user block when repacking a file + * + * Pedro Vicente, August 20, 2008 + * Add a user block to file if requested + * *------------------------------------------------------------------------- */ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t fidin; - hid_t fidout = -1; - trav_table_t *travt = NULL; - hsize_t ub_size = 0; /* size of user block */ - hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */ - hid_t fapl = H5P_DEFAULT; /* file access property list ID */ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t fidin; + hid_t fidout = -1; + trav_table_t *travt = NULL; + hsize_t ub_size = 0; /* size of user block */ + hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */ + hid_t fapl = H5P_DEFAULT; /* file access property list ID */ /*------------------------------------------------------------------------- * open input file diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 1807056..657e1a9 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -52,8 +52,8 @@ static struct long_options l_opts[] = { { "metadata_block_size", require_arg, 'M' }, { "threshold", require_arg, 't' }, { "alignment", require_arg, 'a' }, - { "infile", require_arg, 'i' }, /* -i for backward compability */ - { "outfile", require_arg, 'o' }, /* -o for backward compability */ + { "infile", require_arg, 'i' }, /* -i for backward compability */ + { "outfile", require_arg, 'o' }, /* -o for backward compability */ { "fs_strategy", require_arg, 'S' }, { "fs_threshold", require_arg, 'T' }, { "enable-error-stack", no_arg, 'E' }, @@ -208,12 +208,14 @@ static void usage(const char *prog) { * Programmer: Quincey Koziol * Saturday, 31. January 2004 * + * Modifications: + * *------------------------------------------------------------------------- */ -static void leave(int ret) -{ - h5tools_close(); - HDexit(ret); +static void leave(int ret) { + h5tools_close(); + + HDexit(ret); } /*------------------------------------------------------------------------- @@ -229,10 +231,11 @@ static void leave(int ret) * *------------------------------------------------------------------------- */ + static -int read_info(const char *filename, pack_opt_t *options) -{ - char stype[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +int read_info(const char *filename, pack_opt_t *options) { + + char stype[10]; char comp_info[1024]; FILE *fp = NULL; char c; @@ -365,204 +368,210 @@ done: * *------------------------------------------------------------------------- */ -static -int parse_command_line(int argc, const char **argv, pack_opt_t* options) -{ - int opt; - int ret_value = 0; - - /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { - switch ((char) opt) { - - /* -i for backward compability */ - case 'i': - infile = opt_arg; - has_i_o = 1; - break; - - /* -o for backward compability */ - case 'o': - outfile = opt_arg; - has_i_o = 1; - break; - - case 'h': - usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_SUCCESS); - ret_value = -1; - goto done; - - case 'V': - print_version(h5tools_getprogname()); - h5tools_setstatus(EXIT_SUCCESS); - ret_value = -1; - goto done; - - case 'v': - options->verbose = 1; - break; - - case 'f': - /* parse the -f filter option */ - if (h5repack_addfilter(opt_arg, options) < 0) { - error_msg("in parsing filter\n"); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - break; - - case 'l': - /* parse the -l layout option */ - if (h5repack_addlayout(opt_arg, options) < 0) { - error_msg("in parsing layout\n"); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - break; - case 'm': - options->min_comp = HDstrtoull(opt_arg , NULL, 0); - if ((int) options->min_comp <= 0) { - error_msg("invalid minimum compress size <%s>\n", opt_arg); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - break; +static +int parse_command_line(int argc, const char **argv, pack_opt_t* options) { + + int opt; + int ret_value = 0; + + /* parse command line options */ + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + switch ((char) opt) { + + /* -i for backward compability */ + case 'i': + infile = opt_arg; + has_i_o = 1; + break; + + /* -o for backward compability */ + case 'o': + outfile = opt_arg; + has_i_o = 1; + break; + + case 'h': + usage(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + ret_value = -1; + goto done; + + case 'V': + print_version(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + ret_value = -1; + goto done; + + case 'v': + options->verbose = 1; + break; + + case 'f': + /* parse the -f filter option */ + if (h5repack_addfilter(opt_arg, options) < 0) { + error_msg("in parsing filter\n"); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'l': + /* parse the -l layout option */ + if (h5repack_addlayout(opt_arg, options) < 0) { + error_msg("in parsing layout\n"); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'm': + options->min_comp = HDstrtoull(opt_arg , NULL, 0); + if ((int) options->min_comp <= 0) { + error_msg("invalid minimum compress size <%s>\n", opt_arg); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'e': + ret_value = read_info(opt_arg, options); + if (ret_value < 0) + goto done; + break; + + case 'n': + options->use_native = 1; + break; + + case 'L': + options->latest = TRUE; + break; + + case 'c': + options->grp_compact = HDatoi( opt_arg ); + if (options->grp_compact > 0) + options->latest = TRUE; /* must use latest format */ + break; + + case 'd': + options->grp_indexed = HDatoi( opt_arg ); + if (options->grp_indexed > 0) + options->latest = TRUE; /* must use latest format */ + break; + + case 's': + { + int idx = 0; + int ssize = 0; + char *msgPtr = HDstrchr( opt_arg, ':'); + options->latest = TRUE; /* must use latest format */ + if (msgPtr == NULL) { + ssize = HDatoi( opt_arg ); + for (idx = 0; idx < 5; idx++) + options->msg_size[idx] = ssize; + } + else { + char msgType[10]; + HDstrcpy(msgType, msgPtr + 1); + msgPtr[0] = '\0'; + ssize = HDatoi( opt_arg ); + if (HDstrncmp(msgType, "dspace",6) == 0) { + options->msg_size[0] = ssize; + } + else if (HDstrncmp(msgType, "dtype", 5) == 0) { + options->msg_size[1] = ssize; + } + else if (HDstrncmp(msgType, "fill", 4) == 0) { + options->msg_size[2] = ssize; + } + else if (HDstrncmp(msgType, "pline", 5) == 0) { + options->msg_size[3] = ssize; + } + else if (HDstrncmp(msgType, "attr", 4) == 0) { + options->msg_size[4] = ssize; + } + } + } + break; + + case 'u': + options->ublock_filename = opt_arg; + break; + + case 'b': + options->ublock_size = (hsize_t) HDatol( opt_arg ); + break; + + case 'M': + options->meta_block_size = (hsize_t) HDatol( opt_arg ); + break; + + case 't': + options->threshold = (hsize_t) HDatol( opt_arg ); + break; + + case 'a': + options->alignment = HDstrtoull(opt_arg , NULL, 0); + if (options->alignment < 1) { + error_msg("invalid alignment size\n", opt_arg); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'S': + { + char strategy[MAX_NC_NAME]; + + HDstrcpy(strategy, opt_arg); + if (!HDstrcmp(strategy, "ALL_PERSIST")) + options->fs_strategy = H5F_FILE_SPACE_ALL_PERSIST; + else if (!HDstrcmp(strategy, "ALL")) + options->fs_strategy = H5F_FILE_SPACE_ALL; + else if (!HDstrcmp(strategy, "AGGR_VFD")) + options->fs_strategy = H5F_FILE_SPACE_AGGR_VFD; + else if (!HDstrcmp(strategy, "VFD")) + options->fs_strategy = H5F_FILE_SPACE_VFD; + else { + error_msg("invalid file space management strategy\n", opt_arg); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + } + break; + + case 'T': + options->fs_threshold = (hsize_t) HDatol( opt_arg ); + break; + + case 'E': + enable_error_stack = TRUE; + break; - case 'e': - ret_value = read_info(opt_arg, options); - if (ret_value < 0) - goto done; - break; - - case 'n': - options->use_native = 1; - break; - - case 'L': - options->latest = TRUE; - break; - - case 'c': - options->grp_compact = HDatoi( opt_arg ); - if (options->grp_compact > 0) - options->latest = TRUE; /* must use latest format */ - break; - - case 'd': - options->grp_indexed = HDatoi( opt_arg ); - if (options->grp_indexed > 0) - options->latest = TRUE; /* must use latest format */ - break; - - case 's': - { - int idx = 0; - int ssize = 0; - char *msgPtr = HDstrchr( opt_arg, ':'); - options->latest = TRUE; /* must use latest format */ - if (msgPtr == NULL) { - ssize = HDatoi( opt_arg ); - for (idx = 0; idx < 5; idx++) - options->msg_size[idx] = ssize; - } - else { - char msgType[10]; - - HDstrcpy(msgType, msgPtr + 1); - msgPtr[0] = '\0'; - ssize = HDatoi( opt_arg ); - if (HDstrncmp(msgType, "dspace",6) == 0) - options->msg_size[0] = ssize; - else if (HDstrncmp(msgType, "dtype", 5) == 0) - options->msg_size[1] = ssize; - else if (HDstrncmp(msgType, "fill", 4) == 0) - options->msg_size[2] = ssize; - else if (HDstrncmp(msgType, "pline", 5) == 0) - options->msg_size[3] = ssize; - else if (HDstrncmp(msgType, "attr", 4) == 0) - options->msg_size[4] = ssize; - } - } - break; - - case 'u': - options->ublock_filename = opt_arg; - break; - - case 'b': - options->ublock_size = (hsize_t) HDatol( opt_arg ); - break; - - case 'M': - options->meta_block_size = (hsize_t) HDatol( opt_arg ); - break; - - case 't': - options->threshold = (hsize_t) HDatol( opt_arg ); - break; - - case 'a': - options->alignment = HDstrtoull(opt_arg , NULL, 0); - if (options->alignment < 1) { - error_msg("invalid alignment size\n", opt_arg); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - break; - - case 'S': - { - char strategy[MAX_NC_NAME]; - - HDstrcpy(strategy, opt_arg); - if(!HDstrcmp(strategy, "ALL_PERSIST")) - options->fs_strategy = H5F_FILE_SPACE_ALL_PERSIST; - else if(!HDstrcmp(strategy, "ALL")) - options->fs_strategy = H5F_FILE_SPACE_ALL; - else if(!HDstrcmp(strategy, "AGGR_VFD")) - options->fs_strategy = H5F_FILE_SPACE_AGGR_VFD; - else if(!HDstrcmp(strategy, "VFD")) - options->fs_strategy = H5F_FILE_SPACE_VFD; - else { - error_msg("invalid file space management strategy\n", opt_arg); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - goto done; - } - } - break; - - case 'T': - options->fs_threshold = (hsize_t) HDatol( opt_arg ); - break; - - case 'E': - enable_error_stack = TRUE; - break; - - default: - break; + default: + break; } /* switch */ + } /* while */ if (has_i_o == 0) { - /* check for file names to be processed */ - if (argc <= opt_ind || argv[opt_ind + 1] == NULL) { - error_msg("missing file names\n"); - usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_FAILURE); - ret_value = -1; - } - } + /* check for file names to be processed */ + if (argc <= opt_ind || argv[opt_ind + 1] == NULL) { + error_msg("missing file names\n"); + usage(h5tools_getprogname()); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + } + } done: - return ret_value; + return ret_value; } /*------------------------------------------------------------------------- @@ -582,16 +591,16 @@ done: * *------------------------------------------------------------------------- */ -int main(int argc, const char **argv) -{ - pack_opt_t options; /*the global options */ +int main(int argc, const char **argv) { H5E_auto2_t func; H5E_auto2_t tools_func; void *edata; void *tools_edata; - h5tools_setprogname(PROGRAMNAME); - h5tools_setstatus(EXIT_SUCCESS); + pack_opt_t options; /*the global options */ + + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); /* Disable error reporting */ H5Eget_auto2(H5E_DEFAULT, &func, &edata); @@ -644,12 +653,12 @@ int main(int argc, const char **argv) } /* pack it */ - h5tools_setstatus(h5repack(infile, outfile, &options)); + h5tools_setstatus(h5repack(infile, outfile, &options)); done: - /* free tables */ - h5repack_end(&options); + /* free tables */ + h5repack_end(&options); - leave(h5tools_getstatus()); + leave(h5tools_getstatus()); } diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index 6759169..004b9e4 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -47,9 +47,9 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, int k, l, p, q, end_obj = -1, no_param = 0; unsigned j, n; char sobj[MAX_NC_NAME]; - char scomp[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - char stype[6] = {0, 0, 0, 0, 0, 0}; - char smask[3] = {0, 0, 0}; + char scomp[10]; + char stype[6]; + char smask[3]; obj_list_t* obj_list = NULL; unsigned pixels_per_block; @@ -396,7 +396,6 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, error_msg("invalid filter type in <%s>\n", str); HDexit(EXIT_FAILURE); } - break; } } /*i*/ diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c index 58dea03..6765c49 100644 --- a/tools/src/h5repack/h5repack_verify.c +++ b/tools/src/h5repack/h5repack_verify.c @@ -39,6 +39,11 @@ static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *fil * Programmer: Pedro Vicente, pvn@hdfgroup.org * * Date: December 19, 2003 + * Modified: December, 19, 2007 (exactly 4 years later :-) ) + * Separate into 3 cases + * 1) no filter input, get all datasets and compare DCPLs. TO DO + * 2) filter input on selected datasets, get each one trough OBJ and match + * 3) filter input on all datasets, get all objects and match * *------------------------------------------------------------------------- */ @@ -46,8 +51,8 @@ static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *fil int h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t fidin = -1; /* file ID for input file*/ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t fidin = -1; /* file ID for input file*/ hid_t fidout = -1; /* file ID for output file*/ hid_t did = -1; /* dataset ID */ hid_t pid = -1; /* dataset creation property list ID */ diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index 9762dbb..d4e14cb 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_SRC_H5STAT) #----------------------------------------------------------------------------- @@ -18,17 +18,6 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5stat") set (H5_DEP_EXECUTABLES h5stat) -if (BUILD_SHARED_LIBS) - add_executable (h5stat-shared ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) - TARGET_NAMING (h5stat-shared SHARED) - TARGET_C_PROPERTIES (h5stat-shared SHARED " " " ") - target_link_libraries (h5stat-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (h5stat-shared PROPERTIES FOLDER tools) - set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5stat-shared") - - set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5stat-shared) -endif () - ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### @@ -38,17 +27,13 @@ endif () #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS) - INSTALL_PROGRAM_PDB (h5stat-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) - endif () - INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) - install ( - TARGETS - ${H5_DEP_EXECUTABLES} - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications - ) -endif () +#INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) + +install ( + TARGETS + h5stat + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications +) diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 1292628..0bda701 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_SRC_MISC) #----------------------------------------------------------------------------- @@ -50,7 +50,7 @@ set (H5_DEP_EXECUTABLES #----------------------------------------------------------------------------- #if (NOT WIN32) # configure_file (${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) -#endif () +#endif (NOT WIN32) ############################################################################## ############################################################################## @@ -61,16 +61,15 @@ set (H5_DEP_EXECUTABLES #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -if (HDF5_EXPORTED_TARGETS) - INSTALL_PROGRAM_PDB (h5debug ${HDF5_INSTALL_BIN_DIR} toolsapplications) - INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR} toolsapplications) - INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR} toolsapplications) - install ( - TARGETS - h5debug h5repart h5mkgrp - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications - ) -endif () +#INSTALL_PROGRAM_PDB (h5debug ${HDF5_INSTALL_BIN_DIR} toolsapplications) +#INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR} toolsapplications) +#INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR} toolsapplications) + +install ( + TARGETS + h5debug h5repart h5mkgrp + EXPORT + ${HDF5_EXPORTED_TARGETS} + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications +) diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt index a7dd11f..608dd6e 100644 --- a/tools/test/CMakeLists.txt +++ b/tools/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_TEST) #----------------------------------------------------------------------------- diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index 4a519ab..5bab57b 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_TEST_H5COPY) #----------------------------------------------------------------------------- @@ -18,6 +18,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5copygentest COMMAND $) - endif () + endif (HDF5_BUILD_GENERATORS) include (CMakeTests.cmake) diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 42495de..fe36ca9 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -24,7 +24,7 @@ foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${listfiles}" NAME) HDFTEST_COPY_FILE("${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5copy_files") - endforeach () + endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) add_custom_target(h5copy_files ALL COMMENT "Copying files needed by h5copy tests" DEPENDS ${h5copy_files_list}) ############################################################################## @@ -36,7 +36,7 @@ # # Perform h5copy according to passing parmeters # - macro (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) + MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -45,7 +45,7 @@ -E remove ./testfiles/${testname}.out.h5 ) - endif () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5COPY_F-${testname} @@ -54,10 +54,10 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) - endif () - else () + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) # resultcode=2 will cause the test to skip the diff test if (NOT ${resultcode} STREQUAL "2") @@ -68,11 +68,11 @@ SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") - endif () - endif () - endmacro () + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") + ENDMACRO (ADD_H5_F_TEST) - macro (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) + MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -81,7 +81,7 @@ -E remove ./testfiles/${testname}.out.h5 ) - endif () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5COPY-${testname} @@ -90,10 +90,10 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) - endif () - else () + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) # resultcode=2 will cause the test to skip the diff test if (NOT ${resultcode} STREQUAL "2") @@ -104,20 +104,11 @@ SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - endif () - endif () - endmacro () + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") + ENDMACRO (ADD_H5_TEST) - macro (ADD_SKIP_H5_TEST testname skipresultfile) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - add_test ( - NAME H5COPY-${testname}-${skipresultfile}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname}-${skipresultfile} ${ARGN}" - ) - endif () - endmacro () - - macro (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) + MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -126,7 +117,7 @@ -E remove ./testfiles/${testname}.out.h5 ) - endif () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5COPY-${testname}-prefill @@ -135,10 +126,10 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - endif () - else () + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5COPY-${testname} @@ -154,11 +145,11 @@ SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - endif () - endif () - endmacro () + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") + ENDMACRO (ADD_H5_TEST2) - macro (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) + MACRO (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -167,7 +158,7 @@ -E remove ./testfiles/${testname}.out.h5 ) - endif () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5COPY_SAME-${testname}-prefill @@ -176,10 +167,10 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") else (HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5COPY_SAME-${testname} @@ -195,25 +186,25 @@ SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") - endif () - endif () - endmacro () + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") + ENDMACRO (ADD_H5_TEST_SAME) # # Similiar to ADD_H5_TEST macro. Compare to outputs from source & target # files instead of checking with h5ls. # - macro (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) + MACRO (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5COPY-CMP-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) if (${resultcode} STREQUAL "1") set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") - endif () + endif (${resultcode} STREQUAL "1") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) - endif () - else () + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( NAME H5COPY-CMP-${testname}-clear-objects @@ -234,8 +225,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_CMP_TEST) ############################################################################## ############################################################################## @@ -295,38 +286,18 @@ set_tests_properties (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5COPY-clearall-objects") - endif () - -# See which filters are usable (and skip tests for filters we -# don't have). Do this by searching H5pubconf.h to see which -# filters are defined. - -# detect whether the encoder is present. - if (H5_HAVE_FILTER_DEFLATE) - set (USE_FILTER_DEFLATE "true") - endif () - - if (H5_HAVE_FILTER_SZIP) - set (USE_FILTER_SZIP "true") - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) # "Test copying various forms of datasets" ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 -v -s chunk -d chunk) ADD_H5_TEST (compact 0 ${HDF_FILE1}.h5 -v -s compact -d compact) ADD_H5_TEST (compound 0 ${HDF_FILE1}.h5 -v -s compound -d compound) - - if (USE_FILTER_DEFLATE) - ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) - else () - ADD_H5_TEST (compressed 2 ${HDF_FILE1}.h5 -v -s compressed -d compressed) - endif () - + ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) ADD_H5_TEST (named_vl 0 ${HDF_FILE1}.h5 -v -s named_vl -d named_vl) ADD_H5_TEST (nested_vl 0 ${HDF_FILE1}.h5 -v -s nested_vl -d nested_vl) - ADD_H5_TEST (dset_attr 0 ${HDF_FILE1}.h5 -v -s dset_attr -d dset_attr) # "Test copying dataset within group in source file to root of destination" ADD_H5_TEST (simple_top 0 ${HDF_FILE1}.h5 -v -s grp_dsets/simple -d simple_top) @@ -336,41 +307,24 @@ # "Test copying empty, 'full' & 'nested' groups" ADD_H5_TEST (grp_empty 0 ${HDF_FILE1}.h5 -v -s grp_empty -d grp_empty) - if (USE_FILTER_DEFLATE) - ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) - ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) - else () - ADD_H5_TEST (grp_dsets 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) - ADD_H5_TEST (grp_nested 2 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) - endif () - ADD_H5_TEST (grp_attr 0 ${HDF_FILE1}.h5 -v -s grp_attr -d grp_attr) + ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) + ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) # "Test copying dataset within group in source file to group in destination" ADD_H5_TEST2 (simple_group 0 ${HDF_FILE1}.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group) - if (USE_FILTER_DEFLATE) - # "Test copying & renaming group" - ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) - # "Test copying 'full' group hierarchy into group in destination file" - ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) - else () - # "Test copying & renaming group" - ADD_H5_TEST (grp_rename 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) - # "Test copying 'full' group hierarchy into group in destination file" - ADD_H5_TEST2 (grp_dsets_rename 2 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) - endif () + # "Test copying & renaming group" + ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) + + # "Test copying 'full' group hierarchy into group in destination file" + ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) # "Test copying objects into group hier. that doesn't exist yet in destination file" ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B1/simple) ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B2/simple2) ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple) - if (USE_FILTER_DEFLATE) - ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) - ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) - else () - ADD_H5_TEST (E_F_grp_dsets 2 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) - ADD_H5_TEST (G_H_grp_nested 2 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) - endif () + ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) ############# COPY REFERENCES ############## @@ -416,8 +370,4 @@ # - dataset ADD_H5_TEST_SAME (samefile1 0 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp) # - group with some datasets - if (USE_FILTER_DEFLATE) - ADD_H5_TEST_SAME (samefile2 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) - else () - ADD_H5_TEST_SAME (samefile2 2 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) - endif () + ADD_H5_TEST_SAME (samefile2 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in index dbee089..6d1478a 100644 --- a/tools/test/h5copy/testh5copy.sh.in +++ b/tools/test/h5copy/testh5copy.sh.in @@ -21,10 +21,6 @@ srcdir=@srcdir@ -# Determine which filters are available -USE_FILTER_SZIP="@USE_FILTER_SZIP@" -USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" - # source dirs SRC_TOOLS="$srcdir/../.." SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" @@ -82,7 +78,7 @@ AWK='awk' nerrors=0 verbose=yes -h5haveexitcode=yes # default is yes +h5haveexitcode=yes # default is yes TESTDIR=./testfiles test -d $TESTDIR || mkdir $TESTDIR @@ -115,10 +111,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 @@ -143,13 +139,13 @@ CLEAN_TESTFILES_AND_TESTDIR() # Print a "SKIP" message SKIP() { - TESTING $H5COPY $@ - echo " -SKIP-" + TESTING $H5COPY $@ + echo " -SKIP-" } # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". -TESTING() +TESTING() { SPACES=" " echo "Testing $* $SPACES" |cut -c1-70 |tr -d '\012' @@ -158,7 +154,7 @@ TESTING() # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # -VERIFY() +VERIFY() { SPACES=" " echo "Verifying h5diff output $* $SPACES" | cut -c1-70 | tr -d '\012' @@ -167,7 +163,7 @@ VERIFY() # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # -VERIFY_OUTPUT() +VERIFY_OUTPUT() { SPACES=" " echo "Verifying output files $* $SPACES" | cut -c1-70 | tr -d '\012' @@ -186,7 +182,7 @@ VERIFY_OUTPUT() # $4 is output file # $* everything else arguments for h5copy. -TOOLTEST() +TOOLTEST() { actualout="$TESTDIR/tooltest.actualout" actualerr="$TESTDIR/tooltest.actualerr" @@ -203,7 +199,7 @@ TOOLTEST() fi if [ "$3" = -o ]; then outputfile=$4 - else + else if [ "$1" = -f ]; then outputfile=$6 else @@ -211,7 +207,7 @@ TOOLTEST() fi runh5diff=no fi - + TESTING $H5COPY $@ ( echo "#############################" @@ -227,7 +223,7 @@ TOOLTEST() nerrors="`expr $nerrors + 1`" else echo " PASSED" - + if [ $runh5diff != no ]; then H5DIFFTEST $inputfile $outputfile $7 $9 fi @@ -240,7 +236,7 @@ TOOLTEST() } # TOOLTEST back-to-back -TOOLTEST_PREFILL() +TOOLTEST_PREFILL() { actualout="$TESTDIR/tooltest.actualout" actualerr="$TESTDIR/tooltest.actualerr" @@ -252,21 +248,21 @@ TOOLTEST_PREFILL() fi if [ "$3" = -o ]; then outputfile=$4 - else + else runh5diff=no fi - + grp_name=$5 grp_name2=$6 obj_name=$7 obj_name2=$8 - + TESTING $H5COPY $@ ( echo "#############################" echo " output for '$H5COPY $@'" echo "#############################" - $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name2 + $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name2 ) > $actualout 2> $actualerr RET=$? if [ $RET != 0 ]; then @@ -280,7 +276,7 @@ TOOLTEST_PREFILL() echo "#############################" echo " output for '$H5COPY $@'" echo "#############################" - $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $obj_name -d $obj_name2 + $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $obj_name -d $obj_name2 ) > $actualout 2> $actualerr RET=$? if [ $RET != 0 ]; then @@ -290,11 +286,11 @@ TOOLTEST_PREFILL() nerrors="`expr $nerrors + 1`" else echo " PASSED" - + if [ $runh5diff != no ]; then H5DIFFTEST $inputfile $outputfile $obj_name $obj_name2 fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actualout $actualerr $outputfile @@ -304,7 +300,7 @@ TOOLTEST_PREFILL() } # TOOLTEST back-to-back -TOOLTEST_SAME() +TOOLTEST_SAME() { actualout="$TESTDIR/tooltest.actualout" actualerr="$TESTDIR/tooltest.actualerr" @@ -316,19 +312,19 @@ TOOLTEST_SAME() fi if [ "$3" = -o ]; then outputfile=$4 - else + else runh5diff=no fi - + grp_name=$5 grp_name2=$6 - + TESTING $H5COPY $@ ( echo "#############################" echo " output for '$H5COPY $@'" echo "#############################" - $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name + $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name ) > $actualout 2> $actualerr RET=$? if [ $RET != 0 ]; then @@ -342,7 +338,7 @@ TOOLTEST_SAME() echo "#############################" echo " output for '$H5COPY $@'" echo "#############################" - $RUNSERIAL $H5COPY_BIN -i $outputfile -o $outputfile -v -s $grp_name -d $grp_name2 + $RUNSERIAL $H5COPY_BIN -i $outputfile -o $outputfile -v -s $grp_name -d $grp_name2 ) > $actualout 2> $actualerr RET=$? if [ $RET != 0 ]; then @@ -352,11 +348,11 @@ TOOLTEST_SAME() nerrors="`expr $nerrors + 1`" else echo " PASSED" - + if [ $runh5diff != no ]; then H5DIFFTEST $outputfile $outputfile $grp_name $grp_name2 fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actualout $actualerr $outputfile @@ -393,7 +389,7 @@ CMP_OUTPUT() fi } -TOOLTEST_FAIL() +TOOLTEST_FAIL() { expectout="$TESTDIR/$1" actualout="$TESTDIR/$1.actualout" @@ -437,7 +433,7 @@ TOOLTEST_FAIL() cat $actualout nerrors="`expr $nerrors + 1`" fi - + # Clean up output file if test -z "$HDF5_NOCLEANUP"; then @@ -448,10 +444,10 @@ TOOLTEST_FAIL() # Call the h5diff tool # -H5DIFFTEST() +H5DIFFTEST() { VERIFY $@ - $RUNSERIAL $H5DIFF_BIN -q "$@" + $RUNSERIAL $H5DIFF_BIN -q "$@" RET=$? if [ $RET != 0 ] ; then echo "*FAILED*" @@ -463,10 +459,10 @@ H5DIFFTEST() # Call the h5diff tool with a call that is expected to fail # -H5DIFFTEST_FAIL() +H5DIFFTEST_FAIL() { VERIFY $@ - $RUNSERIAL $H5DIFF_BIN -q "$@" + $RUNSERIAL $H5DIFF_BIN -q "$@" RET=$? if [ $h5haveexitcode = 'yes' -a $RET != 1 ] ; then @@ -482,7 +478,7 @@ H5DIFFTEST_FAIL() # # Assumed arguments: # -COPY_OBJECTS() +COPY_OBJECTS() { TESTFILE="$TESTDIR/h5copytst.h5" @@ -491,9 +487,7 @@ COPY_OBJECTS() TOOLTEST -i $TESTFILE -o $TESTDIR/chunk.out.h5 -v -s chunk -d chunk TOOLTEST -i $TESTFILE -o $TESTDIR/compact.out.h5 -v -s compact -d compact TOOLTEST -i $TESTFILE -o $TESTDIR/compound.out.h5 -v -s compound -d compound -if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST -i $TESTFILE -o $TESTDIR/compressed.out.h5 -v -s compressed -d compressed -fi TOOLTEST -i $TESTFILE -o $TESTDIR/named_vl.out.h5 -v -s named_vl -d named_vl TOOLTEST -i $TESTFILE -o $TESTDIR/nested_vl.out.h5 -v -s nested_vl -d nested_vl TOOLTEST -i $TESTFILE -o $TESTDIR/dset_attr.out.h5 -v -s /dset_attr -d /dset_attr @@ -505,19 +499,16 @@ fi TOOLTEST -i $TESTFILE -o $TESTDIR/dsrename.out.h5 -v -s compound -d rename echo "Test copying empty, 'full' & 'nested' groups" -if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST -i $TESTFILE -o $TESTDIR/grp_empty.out.h5 -v -s grp_empty -d grp_empty -fi TOOLTEST -i $TESTFILE -o $TESTDIR/grp_dsets.out.h5 -v -s grp_dsets -d grp_dsets TOOLTEST -i $TESTFILE -o $TESTDIR/grp_nested.out.h5 -v -s grp_nested -d grp_nested TOOLTEST -i $TESTFILE -o $TESTDIR/grp_attr.out.h5 -v -s grp_attr -d grp_attr -if test $USE_FILTER_DEFLATE = "yes" ; then echo "Test copying dataset within group in source file to group in destination" TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/simple_group.out.h5 grp_dsets grp_dsets /grp_dsets/simple /grp_dsets/simple_group + echo "Test copying & renaming group" TOOLTEST -i $TESTFILE -o $TESTDIR/grp_rename.out.h5 -v -s grp_dsets -d grp_rename -fi echo "Test copying 'full' group hierarchy into group in destination file" TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/grp_dsets_rename.out.h5 grp_dsets grp_rename grp_dsets /grp_rename/grp_dsets @@ -526,17 +517,15 @@ fi TOOLTEST -i $TESTFILE -o $TESTDIR/A_B1_simple.out.h5 -vp -s simple -d /A/B1/simple TOOLTEST -i $TESTFILE -o $TESTDIR/A_B2_simple2.out.h5 -vp -s simple -d /A/B2/simple2 TOOLTEST -i $TESTFILE -o $TESTDIR/C_D_simple.out.h5 -vp -s /grp_dsets/simple -d /C/D/simple -if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST -i $TESTFILE -o $TESTDIR/E_F_grp_dsets.out.h5 -vp -s /grp_dsets -d /E/F/grp_dsets TOOLTEST -i $TESTFILE -o $TESTDIR/G_H_grp_nested.out.h5 -vp -s /grp_nested -d /G/H/grp_nested -fi } # Copy references in various way. # # Assumed arguments: # -COPY_REFERENCES() +COPY_REFERENCES() { TESTFILE="$TESTDIR/h5copy_ref.h5" @@ -549,7 +538,7 @@ COPY_REFERENCES() # # Assumed arguments: # -COPY_EXT_LINKS() +COPY_EXT_LINKS() { TESTFILE="$TESTDIR/h5copy_extlinks_src.h5" @@ -582,7 +571,7 @@ COPY_EXT_LINKS() # # Assumed arguments: # -TEST_MISC() +TEST_MISC() { TESTFILE="$TESTDIR/h5copytst.h5" @@ -590,10 +579,8 @@ TEST_MISC() TOOLTEST_FAIL h5copy_misc1.out -i $TESTFILE -o $TESTDIR/h5copy_misc1.out.h5 -v -s /simple -d /g1/g2/simple echo "Test copying objects to the same file " - TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile1.out.h5 /simple /simple_cp -if test $USE_FILTER_DEFLATE = "yes" ; then + TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile1.out.h5 /simple /simple_cp TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile2.out.h5 /grp_dsets /grp_dsets_cp -fi } ############################################################################## @@ -603,7 +590,7 @@ fi COPY_TESTFILES_TO_TESTDIR # Start tests -COPY_OBJECTS +COPY_OBJECTS COPY_REFERENCES COPY_EXT_LINKS TEST_MISC diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index f6951a3..2507664 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_TEST_H5DIFF) #----------------------------------------------------------------------------- @@ -17,34 +17,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5diffgentest COMMAND $) - endif () - - #----------------------------------------------------------------------------- - # If plugin library tests can be tested - #----------------------------------------------------------------------------- - set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff") - set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") - set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - - add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c) - TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) - - # make plugins dir - file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") - #----------------------------------------------------------------------------- - # Copy plugin library to a plugins folder - #----------------------------------------------------------------------------- - add_custom_command ( - TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - "$" - "${CMAKE_BINARY_DIR}/plugins/$" - ) + endif (HDF5_BUILD_GENERATORS) include (CMakeTests.cmake) diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index ca23677..3687574 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -55,10 +55,6 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tmptest2.he5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tmpSingleSiteBethe.reference.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tmpSingleSiteBethe.output.h5 - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tudfilter.h5 - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tudfilter2.h5 - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/diff_strings1.h5 - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/diff_strings2.h5 # tools/testfiles/vds ${HDF5_TOOLS_DIR}/testfiles/vds/1_a.h5 ${HDF5_TOOLS_DIR}/testfiles/vds/1_b.h5 @@ -211,10 +207,6 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_518.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_530.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_540.txt - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_60.txt - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_61.txt - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_62.txt - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_63.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_600.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_603.txt @@ -267,8 +259,6 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp1.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp2.txt - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ud.txt - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_udfail.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v1.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v2.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v3.txt @@ -283,9 +273,6 @@ # Make testfiles dir under build dir file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (H5_HAVE_PARALLEL) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles") - endif () # # copy test files from source to build dir @@ -293,9 +280,6 @@ foreach (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) HDFTEST_COPY_FILE("${h5_tstfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5diff_files") - if (H5_HAVE_PARALLEL) - HDFTEST_COPY_FILE("${h5_tstfiles}" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}" "h5diff_files") - endif () endforeach () @@ -306,17 +290,11 @@ foreach (h5_tstfiles ${LIST_WIN_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}w.txt" "${PROJECT_BINARY_DIR}/testfiles/${fname}.txt" "h5diff_files") - if (H5_HAVE_PARALLEL) - HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}w.txt" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}.txt" "h5diff_files") - endif () endforeach () else () foreach (h5_tstfiles ${LIST_WIN_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}.txt" "${PROJECT_BINARY_DIR}/testfiles/${fname}.txt" "h5diff_files") - if (H5_HAVE_PARALLEL) - HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}.txt" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}.txt" "h5diff_files") - endif () endforeach () endif () add_custom_target(h5diff_files ALL COMMENT "Copying files needed by h5diff tests" DEPENDS ${h5diff_files_list}) @@ -327,7 +305,7 @@ ############################################################################## ############################################################################## - macro (ADD_H5_TEST resultfile resultcode) + MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DIFF-${resultfile} COMMAND $ ${ARGN}) @@ -338,7 +316,7 @@ if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () - else () + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -351,90 +329,40 @@ -D "TEST_APPEND=EXIT CODE:" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) if (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) endif () - endmacro () + ENDMACRO (ADD_H5_TEST file) - macro (ADD_PH5_TEST resultfile resultcode) + MACRO (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME PH5DIFF-${resultfile} COMMAND $ ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) - set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles") + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () - else () + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME PH5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$" -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/PAR/testfiles" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=0" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=P_${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}.txt" - -D "TEST_APPEND=EXIT CODE:" - -D "TEST_REF_APPEND=EXIT CODE: [0-9]" - -D "TEST_REF_FILTER=EXIT CODE: 0" - -D "TEST_SORT_COMPARE=TRUE" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "PH5DIFF-${resultfile}") - endif () - endmacro () - - macro (ADD_H5_UD_TEST testname resultcode resultfile) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5DIFF_UD-${testname}-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${resultfile}.out - testfiles/${resultfile}.out.err +# -D "TEST_APPEND=EXIT CODE: [0-9]" +# -D "TEST_REF_FILTER=EXIT CODE: 0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF_RESOURCES_EXT_DIR}/prunTest.cmake" ) - if (${resultcode} STREQUAL "2") - add_test ( - NAME H5DIFF_UD-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.txt" - -D "TEST_APPEND=EXIT CODE:" - -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - else () - add_test ( - NAME H5DIFF_UD-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.txt" - -D "TEST_APPEND=EXIT CODE:" - -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () - set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clearall-objects) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_PH5_TEST file) ############################################################################## ############################################################################## @@ -491,10 +419,6 @@ # attrs with verbose option level set (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) set (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) - # strings - set (STRINGS1 diff_strings1.h5) - set (STRINGS2 diff_strings2.h5) - # VDS tests set (FILEV1 1_vds.h5) set (FILEV2 2_vds.h5) @@ -759,14 +683,6 @@ h5diff_530.out.err h5diff_540.out h5diff_540.out.err - h5diff_60.out - h5diff_60.out.err - h5diff_61.out - h5diff_61.out.err - h5diff_62.out - h5diff_62.out.err - h5diff_63.out - h5diff_63.out.err h5diff_600.out h5diff_600.out.err h5diff_601.out @@ -873,9 +789,9 @@ set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5DIFF-clearall-objects") - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) # ############################################################################ # # Common usage @@ -1002,13 +918,6 @@ ADD_H5_TEST (h5diff_58 1 -v ${FILE7} ${FILE8} refreg) # ( HDDFV-7942 ) ADD_H5_TEST (h5diff_59 0 -v ${FILE4} ${FILE4} dset11a dset11b) -# Strings -# ( HDFFV-10128 ) -ADD_H5_TEST (h5diff_60 1 -v ${STRINGS1} ${STRINGS2} string1 string1) -ADD_H5_TEST (h5diff_61 1 -v ${STRINGS1} ${STRINGS2} string2 string2) -ADD_H5_TEST (h5diff_62 1 -v ${STRINGS1} ${STRINGS2} string3 string3) -ADD_H5_TEST (h5diff_63 1 -v ${STRINGS1} ${STRINGS2} string4 string4) - # ############################################################################## # # Error messages # ############################################################################## @@ -1175,7 +1084,8 @@ ADD_H5_TEST (h5diff_103 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/d1 g1/d2) # with --use-system-epsilon for float value. expect less differences -ADD_H5_TEST (h5diff_104 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp1 g1/fp2) +ADD_H5_TEST (h5diff_104 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp1 +g1/fp2) # not comparable -c flag ADD_H5_TEST (h5diff_200 0 ${FILE2} ${FILE2} g2/dset1 g2/dset2) @@ -1466,19 +1376,8 @@ ADD_H5_TEST (h5diff_644 1 -v --use-system-epsilon -d 5 ${FILE1} ${FILE2} /g1/dse ADD_H5_TEST (h5diff_645 1 -v -p 0.05 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) -# ############################################################################## -# VDS tests -# ############################################################################## +# VDS ADD_H5_TEST (h5diff_v1 0 -v ${FILEV1} ${FILEV2}) ADD_H5_TEST (h5diff_v2 0 -r ${FILEV1} ${FILEV2}) ADD_H5_TEST (h5diff_v3 0 -c ${FILEV1} ${FILEV2}) -############################################################################## -### P L U G I N T E S T S -############################################################################## -ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5) -ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5) - -# ############################################################################## -# # END -# ############################################################################## diff --git a/tools/test/h5diff/Makefile.am b/tools/test/h5diff/Makefile.am index 1d700ea..c366199 100644 --- a/tools/test/h5diff/Makefile.am +++ b/tools/test/h5diff/Makefile.am @@ -38,11 +38,6 @@ check_PROGRAMS=$(TEST_PROG) check_SCRIPTS=$(TEST_SCRIPT) $(TEST_SCRIPT_PARA) # The parallel test script testph5diff.sh actually depends on testh5diff.sh. SCRIPT_DEPEND=../../src/h5diff/h5diff$(EXEEXT) $(H5PDIFF) ../../src/h5diff/testh5diff.sh -if HAVE_SHARED_CONDITIONAL -if USE_PLUGINS_CONDITIONAL - TEST_SCRIPT += h5diff_plugin.sh -endif -endif # Source files for the program h5diffgentest_SOURCES=h5diffgentest.c @@ -50,20 +45,9 @@ h5diffgentest_SOURCES=h5diffgentest.c # Programs depend on the main HDF5 library and tools library LDADD=$(LIBH5TOOLS) $(LIBHDF5) -if HAVE_SHARED_CONDITIONAL - # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibdiff.la - libdynlibdiff_la_SOURCES=dynlib_diff.c - -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* -endif - # Temporary files. *.h5 are generated by h5diff. They should # be copied to the testfiles/ directory if update is required CHECK_CLEANFILES+=*.h5 expect_sorted actual_sorted -DISTCLEANFILES=h5diff_plugin.sh - include $(top_srcdir)/config/conclude.am diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index c3b45bc..339ff6c 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -24,9 +24,9 @@ * size of that temporary buffer in bytes. For efficiency's sake, choose the * largest value suitable for your machine (for testing use a small value). */ -/* Maximum size used in a call to malloc for a dataset +/* Maximum size used in a call to malloc for a dataset * NOTE: this value should stay in sync with the value defined in the tools - * library file: h5tools_utils.h + * library file: h5tools_utils.h */ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); @@ -95,9 +95,6 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); /* non-comparable dataset and attribute */ #define NON_COMPARBLES1 "non_comparables1.h5" #define NON_COMPARBLES2 "non_comparables2.h5" -/* string dataset and attribute */ -#define DIFF_STRINGS1 "diff_strings1.h5" -#define DIFF_STRINGS2 "diff_strings2.h5" #define UIMAX 4294967295u /*Maximum value for a variable of type unsigned int */ #define STR_SIZE 3 @@ -162,7 +159,6 @@ static void test_comps_array_vlen (const char *fname, const char *dset, const ch static void test_comps_vlen_arry (const char *fname, const char *dset,const char *attr, int diff, int is_file_new); static void test_data_nocomparables (const char *fname, int diff); static void test_objs_nocomparables (const char *fname1, const char *fname2); -static void test_objs_strings (const char *fname, const char *fname2); /* called by test_attributes() and test_datasets() */ static void write_attr_in(hid_t loc_id,const char* dset_name,hid_t fid,int make_diffs); @@ -218,11 +214,11 @@ int main(void) test_special_datasets(FILE19,0); test_special_datasets(FILE20,1); - /* + /* * Generate 2 files: FILE21 with old format; FILE22 with new format - * Create 2 datasets in each file: - * One dataset: chunked layout, w/o filters, fixed dimension - * One dataset: chunked layout, w/ filters, fixed dimension + * Create 2 datasets in each file: + * One dataset: chunked layout, w/o filters, fixed dimension + * One dataset: chunked layout, w/ filters, fixed dimension */ gen_dataset_idx(FILE21, 0); gen_dataset_idx(FILE22, 1); @@ -248,7 +244,7 @@ int main(void) test_enums(ENUM_INVALID_VALUES); /* ------------------------------------------------- - * Create test files with dataset and attribute with container types + * Create test files with dataset and attribute with container types * (array, vlen) with multiple nested compound types. */ /* file1 */ @@ -263,8 +259,8 @@ int main(void) test_comps_vlen_arry(COMPS_COMPLEX2,"dset4", "attr4", 5, 0); /*------------------------------------------------- - * Create test files with non-comparable dataset and attributes with - * comparable datasets and attributes. All the comparables should display + * Create test files with non-comparable dataset and attributes with + * comparable datasets and attributes. All the comparables should display * differences. */ test_data_nocomparables(NON_COMPARBLES1,0); @@ -273,9 +269,6 @@ int main(void) /* common objects (same name) with different object types. HDFFV-7644 */ test_objs_nocomparables(NON_COMPARBLES1, NON_COMPARBLES2); - /* string dataset and attribute. HDFFV-10028 */ - test_objs_strings(DIFF_STRINGS1, DIFF_STRINGS2); - return 0; } @@ -2127,33 +2120,33 @@ out: * Function: gen_dataset_idx * * Purpose: Create a file with either the new or old format -* Create two datasets in the file: -* one dataset: fixed dimension, chunked layout, w/o filters -* one dataset: fixed dimension, chunked layout, w/ filters +* Create two datasets in the file: +* one dataset: fixed dimension, chunked layout, w/o filters +* one dataset: fixed dimension, chunked layout, w/ filters * *------------------------------------------------------------------------- */ static int gen_dataset_idx(const char *file, int format) { - hid_t fid; /* file id */ - hid_t did, did2; /* dataset id */ - hid_t sid; /* space id */ - hid_t fapl; /* file access property id */ - hid_t dcpl; /* dataset creation property id */ - hsize_t dims[1] = {10}; /* dataset dimension */ - hsize_t c_dims[1] = {2}; /* chunk dimension */ - herr_t status; /* return status */ - int buf[10]; /* data buffer */ - int i; /* local index variable */ + hid_t fid; /* file id */ + hid_t did, did2; /* dataset id */ + hid_t sid; /* space id */ + hid_t fapl; /* file access property id */ + hid_t dcpl; /* dataset creation property id */ + hsize_t dims[1] = {10}; /* dataset dimension */ + hsize_t c_dims[1] = {2}; /* chunk dimension */ + herr_t status; /* return status */ + int buf[10]; /* data buffer */ + int i; /* local index variable */ /* Get a copy of the file aaccess property */ fapl = H5Pcreate(H5P_FILE_ACCESS); /* Set the "use the latest format" bounds for creating objects in the file */ if(format) { - status = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - assert(status >= 0); + status = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + assert(status >= 0); } /* Create a file */ @@ -2162,7 +2155,7 @@ int gen_dataset_idx(const char *file, int format) /* Create data */ for(i = 0; i < 10; i++) - buf[i] = i; + buf[i] = i; /* Set chunk */ dcpl = H5Pcreate(H5P_DATASET_CREATE); @@ -2172,7 +2165,7 @@ int gen_dataset_idx(const char *file, int format) /* Create a 1D dataset */ sid = H5Screate_simple(1, dims, NULL); did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - + /* Write to the dataset */ status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); assert(status >= 0); @@ -4429,8 +4422,8 @@ out: /*------------------------------------------------------------------------- * -* Purpose: -* Create test files with dataset and attribute with container types +* Purpose: +* Create test files with dataset and attribute with container types * (array, vlen) with multiple nested compound types. * * Function: test_comps_array() @@ -4454,7 +4447,7 @@ out: static void test_comps_array (const char *fname, const char *dset, const char *attr,int diff, int is_file_new) { /* sub compound 2 */ - typedef struct { + typedef struct { int i2; float f2; } cmpd2_t; @@ -4476,14 +4469,14 @@ static void test_comps_array (const char *fname, const char *dset, const char *a hid_t tid_attr; hsize_t sdims_dset[] = {SDIM_DSET}; hsize_t sdims_cmpd_arry[] = {SDIM_CMPD_ARRAY}; - int i,j; + int i,j; herr_t ret; /* Generic return value */ /* Initialize array data to write */ for(i=0; i < SDIM_DSET; i++) { wdata[i].i1 = i; - for(j=0; j < SDIM_CMPD_ARRAY; j++) + for(j=0; j < SDIM_CMPD_ARRAY; j++) { wdata[i].cmpd2[j].i2 = i * 10 + diff; wdata[i].cmpd2[j].f2 = (float)i * 10.5F + (float)diff; @@ -4527,7 +4520,7 @@ static void test_comps_array (const char *fname, const char *dset, const char *a /* ------------------- - * Create a dataset + * Create a dataset */ /* Create dataspace for datasets */ sid_dset = H5Screate_simple(1, sdims_dset, NULL); @@ -4569,18 +4562,18 @@ static void test_comps_array (const char *fname, const char *dset, const char *a static void test_comps_vlen (const char * fname, const char *dset, const char *attr, int diff, int is_file_new) { /* sub compound 2 */ - typedef struct { + typedef struct { int i2; float f2; } cmpd2_t; /* top compound 1 */ - typedef struct { + typedef struct { int i1; hvl_t vl; /* VL information for compound2 */ } cmpd1_t; - cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */ + cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */ hid_t fid; /* HDF5 File ID */ hid_t did_dset; /* dataset ID */ @@ -4636,7 +4629,7 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a assert(ret >= 0); /* ------------------------------- - * Create dataset with compound1 + * Create dataset with compound1 */ /* Create dataspace for dataset */ sid_dset = H5Screate_simple(1, sdims_dset, NULL); @@ -4681,11 +4674,11 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a static void test_comps_array_vlen (const char * fname, const char *dset,const char *attr, int diff, int is_file_new) { - typedef struct { + typedef struct { int i3; float f3; } cmpd3_t; - + typedef struct { /* Typedef for compound datatype */ int i2; hvl_t vl; /* VL information to write */ @@ -4824,19 +4817,19 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch static void test_comps_vlen_arry (const char * fname, const char *dset, const char *attr, int diff, int is_file_new) { /* sub compound 3 */ - typedef struct { + typedef struct { int i3; float f3; } cmpd3_t; /* sub compound 2 */ - typedef struct { + typedef struct { int i2; cmpd3_t cmpd3[SDIM_CMPD_ARRAY]; } cmpd2_t; /* top compound 1 */ - typedef struct { + typedef struct { int i1; hvl_t vl; /* VL information for compound2 */ } cmpd1_t; @@ -4917,7 +4910,7 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch assert(ret >= 0); /* ------------------------------- - * Create dataset with compound1 + * Create dataset with compound1 */ /* Create dataspace for dataset */ sid_dset = H5Screate_simple(1, sdims_dset, NULL); @@ -4967,9 +4960,9 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch /*------------------------------------------------------------------------- * Function: test_data_nocomparables * -* Purpose: -* Create test files with non-comparable dataset and attributes with -* comparable datasets and attributes. All the comparables should display +* Purpose: +* Create test files with non-comparable dataset and attributes with +* comparable datasets and attributes. All the comparables should display * differences. * *-------------------------------------------------------------------------*/ @@ -5027,8 +5020,8 @@ static void test_data_nocomparables (const char * fname, int make_diffs) dset_data_ptr2=(int*)&data2; attr_data_ptr1=(int*)&data2; - /* ----------- - * group2 + /* ----------- + * group2 */ dset_data_ptr3=(int*)&data2; /* dset1/attr1 */ @@ -5150,10 +5143,10 @@ static void test_data_nocomparables (const char * fname, int make_diffs) goto out; } - + out: - + /*----------------------------------------------------------------------- * Close IDs *-----------------------------------------------------------------------*/ @@ -5178,9 +5171,9 @@ out: /*------------------------------------------------------------------------- * Function: test_objs_nocomparables * -* Purpose: +* Purpose: * Create test files with common objects (same name) but different object -* types. +* types. * h5diff should show non-comparable output from these common objects. *-------------------------------------------------------------------------*/ static void test_objs_nocomparables(const char *fname1, const char *fname2) @@ -5324,160 +5317,6 @@ out: } -static hid_t mkstr(int size, H5T_str_t pad) { - hid_t type; - - if((type=H5Tcopy(H5T_C_S1)) < 0) return -1; - if(H5Tset_size(type, (size_t)size) < 0) return -1; - if(H5Tset_strpad(type, pad) < 0) return -1; - - return type; -} - -/*------------------------------------------------------------------------- -* Function: test_objs_strings -* -* Purpose: -* Create test files with common objects (same name) but different string -* types. -* h5diff should show differences output from these common objects. -*-------------------------------------------------------------------------*/ -static void test_objs_strings(const char *fname1, const char *fname2) -{ - herr_t status = SUCCEED; - hid_t fid1=0; - hid_t fid2=0; - hid_t dataset=0; - hid_t space=0; - hid_t f_type=0; - hid_t m_type=0; - hsize_t dims1[] = {3, 4}; - char string1A[12][3] = {"s1","s2","s3","s4","s5","s6","s","s","s9", - "s0","s1","s2"}; - char string1B[12][3] = {"s1","s2","s3","s4","s","s","s7","s8","s9", - "s0","s1","s2"}; - - hsize_t dims2[]={20}; - char string2A[20][10] = {"ab cd ef1", "ab cd ef2", "ab cd ef3", "ab cd ef4", - "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", - "ab cd 9", "ab cd 0", "ab cd 1", "ab cd 2", - "ab cd ef3", "ab cd ef4", "ab cd ef5", "ab cd ef6", - "ab cd ef7", "ab cd ef8", "ab cd ef9", "ab cd ef0"}; - char string2B[20][10] = {"ab cd ef1", "ab cd ef2", "ab cd ef3", "ab cd ef4", - "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", - "ab cd ef9", "ab cd ef0", "ab cd ef1", "ab cd ef2", - "ab cd 3", "ab cd 4", "ab cd 5", "ab cd 6", - "ab cd ef7", "ab cd ef8", "ab cd ef9", "ab cd ef0"}; - - hsize_t dims3[] = {27}; - char string3A[27][6] = {"abcd0", "abcd1", "abcd2", "abcd3", - "abcd4", "abcd5", "abcd6", "abcd7", - "abcd8", "abcd9", "abcd0", "abcd1", - "abd2", "abc3", "bcd4", "acd5", - "abcd6", "abcd7", "abcd8", "abcd9", - "abcd0", "abcd1", "abcd2", "abcd3", - "abc4", "abc5", "abc6"}; - char string3B[27][6] = {"abcd0", "abcd1", "abcd2", "abcd3", - "abcd4", "abcd5", "abcd6", "abcd7", - "abcd8", "abcd9", "abcd0", "abcd1", - "abcd2", "abcd3", "abcd4", "abcd5", - "abd6", "abc7", "bcd8", "acd9", - "abcd0", "abcd1", "abcd2", "abcd3", - "abd4", "abd5", "abd6"}; - - hsize_t dims4[] = {3}; - char string4A[3][21] = { "s1234567890123456789", "s1234567890123456789", - "s12345678901234567"}; - char string4B[3][21] = { "s1234567890123456789", "s12345678901234567", - "s1234567890123456789"}; - - /*----------------------------------------------------------------------- - * Create file(s) - *------------------------------------------------------------------------*/ - /* file1 */ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); - status = FAIL; - goto out; - } - - /* file2 */ - fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); - status = FAIL; - goto out; - } - - /* string 1 : nullterm string */ - space = H5Screate_simple(2, dims1, NULL); - f_type = mkstr(5, H5T_STR_NULLTERM); - m_type = mkstr(3, H5T_STR_NULLTERM); - dataset = H5Dcreate2(fid1, "/string1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string1A); - H5Dclose(dataset); - dataset = H5Dcreate2(fid2, "/string1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string1B); - H5Tclose(m_type); - H5Tclose(f_type); - H5Sclose(space); - H5Dclose(dataset); - - /* string 2 : space pad string */ - space = H5Screate_simple(1, dims2, NULL); - f_type = mkstr(11, H5T_STR_SPACEPAD); - m_type = mkstr(10, H5T_STR_NULLTERM); - dataset = H5Dcreate2(fid1, "/string2", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string2A); - H5Dclose(dataset); - dataset = H5Dcreate2(fid2, "/string2", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string2B); - H5Tclose(m_type); - H5Tclose(f_type); - H5Sclose(space); - H5Dclose(dataset); - - /* string 3 : null pad string */ - space = H5Screate_simple(1, dims3, NULL); - f_type = mkstr(8, H5T_STR_NULLPAD); - m_type = mkstr(6, H5T_STR_NULLTERM); - dataset = H5Dcreate2(fid1, "/string3", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string3A); - H5Dclose(dataset); - dataset = H5Dcreate2(fid2, "/string3", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string3B); - H5Tclose(m_type); - H5Tclose(f_type); - H5Sclose(space); - H5Dclose(dataset); - - /* string 4 : space pad long string */ - space = H5Screate_simple(1, dims4, NULL); - f_type = mkstr(168, H5T_STR_SPACEPAD); - m_type = mkstr(21, H5T_STR_NULLTERM); - dataset = H5Dcreate2(fid1, "/string4", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4A); - H5Dclose(dataset); - dataset = H5Dcreate2(fid2, "/string4", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4B); - H5Tclose(m_type); - H5Tclose(f_type); - H5Sclose(space); - H5Dclose(dataset); - -out: - /*----------------------------------------------------------------------- - * Close IDs - *-----------------------------------------------------------------------*/ - if(fid1) - H5Fclose(fid1); - if(fid2) - H5Fclose(fid2); -} - /*------------------------------------------------------------------------- * Function: write_attr_in * diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 1069ed5..d2f1397 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -124,8 +124,6 @@ $SRC_H5DIFF_TESTFILES/tmptest.he5 $SRC_H5DIFF_TESTFILES/tmptest2.he5 $SRC_H5DIFF_TESTFILES/tmpSingleSiteBethe.reference.h5 $SRC_H5DIFF_TESTFILES/tmpSingleSiteBethe.output.h5 -$SRC_H5DIFF_TESTFILES/diff_strings1.h5 -$SRC_H5DIFF_TESTFILES/diff_strings2.h5 " LIST_HDF5_VDS_TEST_FILES=" @@ -284,10 +282,6 @@ $SRC_H5DIFF_TESTFILES/h5diff_517.txt $SRC_H5DIFF_TESTFILES/h5diff_518.txt $SRC_H5DIFF_TESTFILES/h5diff_530.txt $SRC_H5DIFF_TESTFILES/h5diff_540.txt -$SRC_H5DIFF_TESTFILES/h5diff_60.txt -$SRC_H5DIFF_TESTFILES/h5diff_61.txt -$SRC_H5DIFF_TESTFILES/h5diff_62.txt -$SRC_H5DIFF_TESTFILES/h5diff_63.txt $SRC_H5DIFF_TESTFILES/h5diff_600.txt $SRC_H5DIFF_TESTFILES/h5diff_601.txt $SRC_H5DIFF_TESTFILES/h5diff_603.txt @@ -388,21 +382,6 @@ CLEAN_TESTFILES_AND_TESTDIR() INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then $RM $TESTDIR - else - # files in $LIST_HDF5_VDS_TEST_FILES are copied in from a different - # directory, so when srcdir is the same as destdir and $TESTDIR is - # not deleted, the copy n $TESTDIR of each file from - # $LIST_HDF5_VDS_TEST_FILES will need to be deleted. - for tstfile in $LIST_HDF5_VDS_TEST_FILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - fname=`basename $tstfile` - rm $TESTDIR/$fname - fi - done fi } @@ -659,6 +638,8 @@ TOOLTEST h5diff_28.txt -v h5diff_types.h5 h5diff_types.h5 l1 l2 TOOLTEST h5diff_30.txt -v h5diff_enum_invalid_values.h5 h5diff_enum_invalid_values.h5 dset1 dset2 + + # ############################################################################## # # Dataset datatypes # ############################################################################## @@ -694,13 +675,6 @@ TOOLTEST h5diff_58.txt -v h5diff_dset1.h5 h5diff_dset2.h5 refreg # ( HDDFV-7942 ) TOOLTEST h5diff_59.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset11a dset11b -# Strings -# ( HDFFV-10128 ) -TOOLTEST h5diff_60.txt -v diff_strings1.h5 diff_strings2.h5 string1 string1 -TOOLTEST h5diff_61.txt -v diff_strings1.h5 diff_strings2.h5 string2 string2 -TOOLTEST h5diff_62.txt -v diff_strings1.h5 diff_strings2.h5 string3 string3 -TOOLTEST h5diff_63.txt -v diff_strings1.h5 diff_strings2.h5 string4 string4 - # ############################################################################## # # Error messages # ############################################################################## @@ -772,6 +746,8 @@ TOOLTEST h5diff_618.txt -p 2 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.19: number smaller than smallest difference TOOLTEST h5diff_619.txt -p 0.005 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 + + # ############################################################################## # # -n # ############################################################################## @@ -824,6 +800,7 @@ TOOLTEST h5diff_tmp2.txt tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.referen # ################################################## # attrs with verbose option level # ################################################## + TOOLTEST h5diff_700.txt -v1 h5diff_attr1.h5 h5diff_attr2.h5 TOOLTEST h5diff_701.txt -v2 h5diff_attr1.h5 h5diff_attr2.h5 TOOLTEST h5diff_702.txt --verbose=1 h5diff_attr1.h5 h5diff_attr2.h5 @@ -874,6 +851,7 @@ TOOLTEST h5diff_103.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h # with --use-system-epsilon for float value TOOLTEST h5diff_104.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2 + # not comparable -c flag TOOLTEST h5diff_200.txt h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2 @@ -1001,6 +979,7 @@ TOOLTEST h5diff_424.txt --follow-symlinks -v h5diff_ext2softlink_trg.h5 h5diff_e # extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2" TOOLTEST h5diff_425.txt --follow-symlinks -v h5diff_ext2softlink_src.h5 h5diff_ext2softlink_src.h5 /ext_link_to_slink1 /ext_link_to_slink2 + # ############################################################################## # # Dangling links compare (--follow-symlinks and --no-dangling-links) # ############################################################################## @@ -1151,7 +1130,6 @@ TOOLTEST h5diff_540.txt -v compounds_array_vlen1.h5 compounds_array_vlen2.h5 # ############################################################################## # # Test mutually exclusive options # ############################################################################## -# # Test with -d , -p and --use-system-epsilon. TOOLTEST h5diff_640.txt -v -d 5 -p 0.05 --use-system-epsilon h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 TOOLTEST h5diff_641.txt -v -d 5 -p 0.05 h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 89c7534..1398aca 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_TEST_H5DUMP) #----------------------------------------------------------------------------- @@ -6,34 +6,6 @@ PROJECT (HDF5_TOOLS_TEST_H5DUMP) #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - #----------------------------------------------------------------------------- - # If plugin library tests can be tested - #----------------------------------------------------------------------------- - set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdump") - set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") - set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - - add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_dump.c) - TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) - - # make plugins dir - file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") - #----------------------------------------------------------------------------- - # Copy plugin library to a plugins folder - #----------------------------------------------------------------------------- - add_custom_command ( - TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - "$" - "${CMAKE_BINARY_DIR}/plugins/$" - ) - # -------------------------------------------------------------------- # Add the h5dump test executable # -------------------------------------------------------------------- @@ -45,7 +17,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5dumpgentest COMMAND $) - endif () + endif (HDF5_BUILD_GENERATORS) include (CMakeTests.cmake) diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index ae760bf..ad3c5ba 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -166,7 +166,6 @@ ${HDF5_TOOLS_DIR}/testfiles/tstring2.ddl ${HDF5_TOOLS_DIR}/testfiles/tstringe.ddl ${HDF5_TOOLS_DIR}/testfiles/tszip.ddl - ${HDF5_TOOLS_DIR}/testfiles/tudfilter.ddl ${HDF5_TOOLS_DIR}/testfiles/tudlink-1.ddl ${HDF5_TOOLS_DIR}/testfiles/tudlink-2.ddl ${HDF5_TOOLS_DIR}/testfiles/tuserfilter.ddl @@ -292,7 +291,6 @@ ${HDF5_TOOLS_DIR}/testfiles/tstr.h5 ${HDF5_TOOLS_DIR}/testfiles/tstr2.h5 ${HDF5_TOOLS_DIR}/testfiles/tstr3.h5 - ${HDF5_TOOLS_DIR}/testfiles/tudfilter.h5 ${HDF5_TOOLS_DIR}/testfiles/tudlink.h5 ${HDF5_TOOLS_DIR}/testfiles/tvldtypes1.h5 ${HDF5_TOOLS_DIR}/testfiles/tvldtypes2.h5 @@ -383,16 +381,16 @@ ############################################################################## ############################################################################## - macro (ADD_HELP_TEST testname resultcode) + MACRO (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${testname} COMMAND $ ${ARGN}) set_tests_properties (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5DUMP-${testname}") - else () + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" @@ -404,34 +402,34 @@ -D "TEST_REFERENCE=h5dump-${testname}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_HELP_TEST) - macro (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) + MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) if (${testtype} STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile} ${ARGN}" ) - endif () - else () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - endif () - endmacro () + endif (${testtype} STREQUAL "SKIP") + ENDMACRO (ADD_SKIP_H5_TEST) - macro (ADD_H5_TEST resultfile resultcode) + MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - endif () + endif (NOT ${resultcode} STREQUAL "0") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - else () + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -450,21 +448,21 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST file) - macro (ADD_H5_TEST_N resultfile resultcode) + MACRO (ADD_H5_TEST_N resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-N-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") - endif () + endif (NOT ${resultcode} STREQUAL "0") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - else () + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-N-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -483,21 +481,21 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST_N file) - macro (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) + MACRO (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - endif () + endif (NOT ${resultcode} STREQUAL "0") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - else () + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -523,21 +521,21 @@ ) set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST_EXPORT file) - macro (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) + MACRO (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - endif () + endif (NOT ${resultcode} STREQUAL "0") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - else () + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -570,10 +568,10 @@ ) set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST_EXPORT_DDL file) - macro (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) + MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-output-${resultfile}-clear-objects @@ -594,10 +592,10 @@ ) set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_EXPORT_TEST file) - macro (ADD_H5_MASK_TEST resultfile resultcode) + MACRO (ADD_H5_MASK_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile} @@ -611,10 +609,10 @@ -D "TEST_MASK_ERROR=true" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_MASK_TEST file) - macro (ADD_H5ERR_MASK_TEST resultfile resultcode) + MACRO (ADD_H5ERR_MASK_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile} @@ -629,10 +627,10 @@ -D "TEST_MASK_ERROR=true" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5ERR_MASK_TEST file) - macro (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) + MACRO (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile} @@ -649,10 +647,10 @@ -D "TEST_ENV_VALUE:STRING=${envval}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5ERR_MASK_ENV_TEST) - macro (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) + MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -679,39 +677,12 @@ add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND h5diff ${testfile} ${resultfile}.h5 /integer /integer) set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) - endif () - endmacro () - - macro (ADD_H5_UD_TEST testname resultcode resultfile) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP_UD-${testname}-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/std/${resultfile}.out - testfiles/std/${resultfile}.out.err - ) - add_test ( - NAME H5DUMP_UD-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ddl" - -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5DUMP_UD-${testname} PROPERTIES DEPENDS H5DUMP_UD-${testname}-clearall-objects) - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST_IMPORT file) ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S HDF5_ENABLE_USING_MEMCHECKER ### ############################################################################## ############################################################################## @@ -1067,9 +1038,9 @@ set_tests_properties (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5DUMP-clearall-objects") - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_HELP_TEST(help 0 -h) @@ -1350,11 +1321,11 @@ # detect whether the encoder is present. if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif () + endif (H5_HAVE_FILTER_DEFLATE) if (H5_HAVE_FILTER_SZIP) set (USE_FILTER_SZIP "true") - endif () + endif (H5_HAVE_FILTER_SZIP) if (USE_FILTER_DEFLATE) # data read internal filters @@ -1362,8 +1333,8 @@ if (HDF5_ENABLE_SZIP_SUPPORT) # data read all filters ADD_H5_TEST (treadfilter 0 --enable-error-stack -d all -d szip tfilters.h5) - endif () - endif () + endif (HDF5_ENABLE_SZIP_SUPPORT) + endif (USE_FILTER_DEFLATE) # test for displaying objects with very long names ADD_H5_TEST (tlonglinks 0 --enable-error-stack tlonglinks.h5) @@ -1398,14 +1369,14 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) - endif () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) # the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) - endif () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) # test for dataset region references ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) @@ -1450,8 +1421,3 @@ # test for non-existing file ADD_H5_TEST (non_existing 1 --enable-error-stack tgroup.h5 non_existing.h5) - -############################################################################## -### P L U G I N T E S T S -############################################################################## -ADD_H5_UD_TEST (h5dump_plugin_test 0 tudfilter --enable-error-stack tudfilter.h5) diff --git a/tools/test/h5dump/CMakeTestsPBITS.cmake b/tools/test/h5dump/CMakeTestsPBITS.cmake index 770531a..c2ec9cc 100644 --- a/tools/test/h5dump/CMakeTestsPBITS.cmake +++ b/tools/test/h5dump/CMakeTestsPBITS.cmake @@ -88,18 +88,18 @@ foreach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) get_filename_component(fname "${pbits_h5_file}" NAME) HDFTEST_COPY_FILE("${pbits_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}" "h5dump_pbits_files") - endforeach () + endforeach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) foreach (ddl_pbits ${HDF5_REFERENCE_PBITS}) get_filename_component(fname "${ddl_pbits}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/pbits/${ddl_pbits}" "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}" "h5dump_pbits_files") - endforeach () + endforeach (ddl_pbits ${HDF5_REFERENCE_PBITS}) foreach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) get_filename_component(fname "${ddl_pbits}" NAME) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/errfiles/${ddl_pbits}" "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}" "h5dump_pbits_files") - endforeach () + endforeach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) add_custom_target(h5dump_pbits_files ALL COMMENT "Copying files needed by h5dump_pbits tests" DEPENDS ${h5dump_pbits_files_list}) ############################################################################## @@ -108,7 +108,7 @@ ############################################################################## ############################################################################## - macro (ADD_H5_PBITS_TEST resultfile resultcode) + MACRO (ADD_H5_PBITS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) @@ -119,7 +119,7 @@ if (NOT "${last_pbits_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) endif () - else () + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -131,8 +131,8 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_PBITS_TEST file) ############################################################################## ############################################################################## @@ -256,9 +256,9 @@ set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") if (NOT "${last_pbits_test}" STREQUAL "") set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test}) - endif () + endif (NOT "${last_pbits_test}" STREQUAL "") set (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects") - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) # test failure handling # Missing file name diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index d155e55..aa85350 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -67,18 +67,18 @@ foreach (vds_h5_file ${HDF5_REFERENCE_TEST_VDS}) get_filename_component(fname "${vds_h5_file}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") - endforeach () + endforeach (vds_h5_file ${HDF5_REFERENCE_TEST_VDS}) foreach (ddl_vds ${HDF5_REFERENCE_VDS}) get_filename_component(fname "${ddl_vds}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") - endforeach () + endforeach (ddl_vds ${HDF5_REFERENCE_VDS}) foreach (ddl_vds ${HDF5_ERROR_REFERENCE_VDS}) get_filename_component(fname "${ddl_vds}" NAME) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/errfiles/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") - endforeach () + endforeach (ddl_vds ${HDF5_ERROR_REFERENCE_VDS}) add_custom_target(h5dump_vds_files ALL COMMENT "Copying files needed by h5dump_vds tests" DEPENDS ${h5dump_vds_files_list}) ############################################################################## @@ -87,7 +87,7 @@ ############################################################################## ############################################################################## - macro (ADD_H5_VDS_TEST resultfile resultcode) + MACRO (ADD_H5_VDS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) @@ -98,7 +98,7 @@ if (NOT "${last_vds_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) endif () - else () + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -110,10 +110,10 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_VDS_TEST file) - macro (ADD_H5_VDS_LAYOUT resultfile resultcode) + MACRO (ADD_H5_VDS_LAYOUT resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ -p ${ARGN}) @@ -124,7 +124,7 @@ if (NOT "${last_vds_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) endif () - else () + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -137,8 +137,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_VDS_LAYOUT file) ############################################################################## ############################################################################## @@ -190,9 +190,9 @@ set_tests_properties (H5DUMP_VDS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (NOT "${last_vds_test}" STREQUAL "") set_tests_properties (H5DUMP_VDS-clearall-objects PROPERTIES DEPENDS ${last_vds_test}) - endif () + endif (NOT "${last_vds_test}" STREQUAL "") set (last_VDS_test "H5DUMP_VDS-clearall-objects") - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) # See which filters are usable (and skip tests for filters we # don't have). Do this by searching H5pubconf.h to see which @@ -201,11 +201,11 @@ # detect whether the encoder is present. if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif () + endif (H5_HAVE_FILTER_DEFLATE) if (H5_HAVE_FILTER_SZIP) set (USE_FILTER_SZIP "true") - endif () + endif (H5_HAVE_FILTER_SZIP) # Data read if (USE_FILTER_DEFLATE) @@ -218,7 +218,7 @@ ADD_H5_VDS_TEST (vds-first 0 --vds-view-first-missing --enable-error-stack vds-percival-unlim-maxmin.h5) ADD_H5_VDS_TEST (vds-gap1 0 -d /VDS-Eiger --vds-gap-size=1 --enable-error-stack vds-eiger.h5) ADD_H5_VDS_TEST (vds-gap2 0 --vds-gap-size=2 --enable-error-stack vds-eiger.h5) - endif () + endif (USE_FILTER_DEFLATE) # Layout read if (USE_FILTER_DEFLATE) @@ -230,4 +230,4 @@ ADD_H5_VDS_LAYOUT (tvds_layout-5 0 --enable-error-stack 5_vds.h5) ADD_H5_VDS_LAYOUT (vds_layout-eiger 0 --enable-error-stack vds-eiger.h5) ADD_H5_VDS_LAYOUT (vds_layout-maxmin 0 --enable-error-stack vds-percival-unlim-maxmin.h5) - endif () + endif (USE_FILTER_DEFLATE) diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index 2e55818..79d3ff8 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -130,12 +130,12 @@ foreach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) get_filename_component(fname "${tst_xml_h5_file}" NAME) HDFTEST_COPY_FILE("${tst_xml_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}" "h5dump_xml_files") - endforeach () + endforeach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) foreach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) get_filename_component(fname "${tst_xml_other_file}" NAME) HDFTEST_COPY_FILE("${tst_xml_other_file}" "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}" "h5dump_xml_files") - endforeach () + endforeach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) add_custom_target(h5dump_xml_files ALL COMMENT "Copying files needed by h5dump_xml tests" DEPENDS ${h5dump_xml_files_list}) ############################################################################## @@ -144,20 +144,20 @@ ############################################################################## ############################################################################## - macro (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) + MACRO (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) if (${testtype} STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-XML-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}" ) - endif () - else () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") ADD_XML_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - endif () - endmacro () + endif (${testtype} STREQUAL "SKIP") + ENDMACRO (ADD_XML_SKIP_H5_TEST) - macro (ADD_XML_H5_TEST resultfile resultcode) + MACRO (ADD_XML_H5_TEST resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-XML-${resultfile} COMMAND $ --xml ${ARGN}) set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") @@ -167,7 +167,7 @@ if (NOT "${last_xml_test}" STREQUAL "") set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) endif () - else () + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-XML-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -179,8 +179,8 @@ -D "TEST_REFERENCE=${resultfile}.xml" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_XML_H5_TEST file) ############################################################################## ############################################################################## @@ -326,9 +326,9 @@ set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") if (NOT "${last_xml_test}" STREQUAL "") set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test}) - endif () + endif (NOT "${last_xml_test}" STREQUAL "") set (last_test "H5DUMP-XML-clearall-objects") - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) ########## test XML ADD_XML_H5_TEST (tall.h5 0 tall.h5) diff --git a/tools/test/h5dump/Makefile.am b/tools/test/h5dump/Makefile.am index a3d1df7..aed34ec 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -30,27 +30,13 @@ TEST_SCRIPT=testh5dump.sh testh5dumppbits.sh testh5dumpvds.sh testh5dumpxml.sh check_PROGRAMS=$(TEST_PROG) binread check_SCRIPTS=$(TEST_SCRIPT) SCRIPT_DEPEND=../../src/h5dump/h5dump$(EXEEXT) -if HAVE_SHARED_CONDITIONAL -if USE_PLUGINS_CONDITIONAL - TEST_SCRIPT += h5dump_plugin.sh -endif -endif # All the programs depend on the hdf5 and h5tools libraries LDADD=$(LIBH5TOOLS) $(LIBHDF5) -if HAVE_SHARED_CONDITIONAL - # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibdump.la - libdynlibdump_la_SOURCES=dynlib_dump.c - -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* -endif - # Temporary files. *.h5 are generated by h5dumpgentest. They should # copied to the testfiles/ directory if update is required. CHECK_CLEANFILES+=*.h5 *.bin -DISTCLEANFILES=testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh h5dump_plugin.sh +DISTCLEANFILES=testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh include $(top_srcdir)/config/conclude.am diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index bf9a698..335eafa 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -114,7 +114,6 @@ #define FILE81 "tints4dims.h5" #define FILE82 "tcompound_complex2.h5" #define FILE83 "tvlenstr_array.h5" -#define FILE84 "tudfilter.h5" /*------------------------------------------------------------------------- * prototypes @@ -154,23 +153,6 @@ const H5Z_class2_t H5Z_MYFILTER[1] = {{ myfilter, /* The actual filter function */ }}; -#define H5Z_FILTER_DYNLIBUD 300 -#define MULTIPLIER 3 - -static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); - -/* This message derives from H5Z */ -const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIBUD, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlibud", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */ -}}; - /* A UD link traversal function. Shouldn't actually be called. */ static hid_t UD_traverse(H5_ATTR_UNUSED const char * link_name, H5_ATTR_UNUSED hid_t cur_group, @@ -397,9 +379,9 @@ typedef struct s1_t { /* Dataset dimensions */ #define F82_DIM32 32 #define F82_RANK 1 -/* #define F82_RANK2 2 */ -/* #define F82_RANK3 3 */ -/* #define F82_RANK4 4 */ +//#define F82_RANK2 2 +//#define F82_RANK3 3 +//#define F82_RANK4 4 /* "File 83" macros */ /* Name of dataset to create in datafile */ @@ -10304,132 +10286,6 @@ static void gent_vlenstr_array(void) H5Fclose(file); } -/*------------------------------------------------------------------------- - * Function: gent_udfilter - * - * Purpose: Generate a file to be used in testing user defined filter plugin3. - *------------------------------------------------------------------------- - */ -static void gent_udfilter(void) -{ - hid_t fid; /* file id */ - hid_t dcpl; /* dataset creation property list */ - hid_t dsid; /* dataset ID */ - hid_t sid; /* dataspace ID */ - hid_t tid; /* datatype ID */ - - hsize_t dims1[RANK] = {DIM1,DIM2}; - hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; - int buf1[DIM1][DIM2]; - int i, j, n, ret; - - for(i=n=0; i=0); - - /* create a space */ - sid = H5Screate_simple(SPACE2_RANK, dims1, NULL); - - dcpl = H5Pcreate(H5P_DATASET_CREATE); - HDassert(dcpl>=0); - - ret = H5Pset_layout(dcpl, H5D_CHUNKED); - HDassert(ret >= 0); - - ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - HDassert(ret >= 0); - - ret = H5Zregister (H5Z_DYNLIBUD); - HDassert(ret >= 0); - - ret = H5Pset_filter (dcpl, H5Z_FILTER_DYNLIBUD, H5Z_FLAG_MANDATORY, 0, NULL); - HDassert(ret >= 0); - - /* create the dataset */ - dsid = H5Dcreate2(fid, "dynlibud", H5T_STD_I32LE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - HDassert(dsid >= 0); - - /* write */ - ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1); - HDassert(ret >= 0); - - /* close */ - ret = H5Dclose(dsid); - HDassert(ret >= 0); - - /* remove the filters from the dcpl */ - ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); - - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - ret = H5Sclose(sid); - HDassert(ret >= 0); - - ret = H5Pclose(dcpl); - HDassert(ret >= 0); - - ret = H5Fclose(fid); - HDassert(ret >= 0); -} - -/*------------------------------------------------------------------------- - * Function: H5Z_filter_dynlibud - * - * Purpose: A dynlibud filter method that multiplies the original value - * during write and divide the original value during read. It - * will be built as a shared library. tools tests will load - * and use this filter as a plugin library. - * - * Return: Success: Data chunk size - * - * Failure: 0 - *------------------------------------------------------------------------- - */ -static size_t -H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, - size_t *buf_size, void **buf) -{ - char *int_ptr = (char *)*buf; /* Pointer to the data values */ - size_t buf_left = *buf_size; /* Amount of data buffer left to process */ - - /* Check for the correct number of parameters */ - if(cd_nelmts > 0) - return(0); - - /* Assignment to eliminate unused parameter warning. */ - cd_values = cd_values; - - if(flags & H5Z_FLAG_REVERSE) { /*read*/ - /* Subtract the original value with MULTIPLIER */ - while(buf_left > 0) { - char temp = *int_ptr; - *int_ptr = temp - MULTIPLIER; - int_ptr++; - buf_left -= sizeof(*int_ptr); - } /* end while */ - } /* end if */ - else { /*write*/ - /* Add the original value with MULTIPLIER */ - while(buf_left > 0) { - char temp = *int_ptr; - *int_ptr = temp + MULTIPLIER; - int_ptr++; - buf_left -= sizeof(*int_ptr); - } /* end while */ - } /* end else */ - - return nbytes; -} /* end H5Z_filter_dynlibud() */ /*------------------------------------------------------------------------- * Function: main @@ -10527,8 +10383,6 @@ int main(void) gent_intsfourdims(); - gent_udfilter(); - return 0; } diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index 7e47b13..1d18e9a 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_TEST_H5FC) #----------------------------------------------------------------------------- @@ -23,6 +23,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5fc_gentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5fc_gentest COMMAND $) - endif () + endif (HDF5_BUILD_GENERATORS) include (CMakeTests.cmake) diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake index 4738be5..68f9318 100644 --- a/tools/test/h5format_convert/CMakeTests.cmake +++ b/tools/test/h5format_convert/CMakeTests.cmake @@ -64,11 +64,11 @@ foreach (ddl_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${ddl_file}" "${PROJECT_BINARY_DIR}/testfiles/${ddl_file}" "h5fc_files") - endforeach () + endforeach (ddl_file ${HDF5_REFERENCE_FILES}) foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5fc_files") - endforeach () + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) add_custom_target(h5fc_files ALL COMMENT "Copying files needed by h5fc tests" DEPENDS ${h5fc_files_list}) ############################################################################## @@ -77,7 +77,7 @@ ############################################################################## ############################################################################## - macro (ADD_H5_OUTPUT testname resultfile resultcode testfile) + MACRO (ADD_H5_OUTPUT testname resultfile resultcode testfile) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -87,7 +87,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") if (NOT "${testfile}" STREQUAL "") add_test ( NAME H5FC-${testname}-${testfile}-tmpfile @@ -108,7 +108,7 @@ ) set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile") set (last_test "H5FC-${testname}-${testfile}") - else () + else (NOT "${testfile}" STREQUAL "") add_test ( NAME H5FC-${testname}-NA COMMAND "${CMAKE_COMMAND}" @@ -122,11 +122,11 @@ ) set_tests_properties (H5FC-${testname}-NA PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") set (last_test "H5FC-${testname}-NA") - endif () - endif () - endmacro () + endif (NOT "${testfile}" STREQUAL "") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_OUTPUT) - macro (ADD_H5_TEST testname resultcode testfile) + MACRO (ADD_H5_TEST testname resultcode testfile) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -136,7 +136,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") add_test ( NAME H5FC-${testname}-tmpfile COMMAND ${CMAKE_COMMAND} @@ -156,10 +156,10 @@ ) set_tests_properties (H5FC-${testname} PROPERTIES DEPENDS "H5FC-${testname}-tmpfile") set (last_test "H5FC-${testname}") - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST) - macro (ADD_H5_CHECK_IDX dependtest testname) + MACRO (ADD_H5_CHECK_IDX dependtest testname) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -167,10 +167,10 @@ COMMAND "$" "./testfiles/tmp.h5" "${ARGN}" ) set_tests_properties (H5FC_CHECK_IDX-${testname} PROPERTIES DEPENDS "H5FC-${dependtest}") - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_CHECK_IDX) - macro (ADD_H5_TEST_CHECK_IDX testname resultcode testfile) + MACRO (ADD_H5_TEST_CHECK_IDX testname resultcode testfile) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -180,7 +180,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") add_test ( NAME H5FC-${testname}-tmpfile COMMAND ${CMAKE_COMMAND} @@ -205,10 +205,10 @@ ) set_tests_properties (H5FC_CHECK_IDX-${testname} PROPERTIES DEPENDS "H5FC-${testname}") set (last_test "H5FC_CHECK_IDX-${testname}") - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST_CHECK_IDX) - macro (ADD_H5_H5DUMP_CHECK testname) + MACRO (ADD_H5_H5DUMP_CHECK testname) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -218,7 +218,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") add_test ( NAME H5FC-${testname}-tmpfile COMMAND ${CMAKE_COMMAND} @@ -250,8 +250,8 @@ ) set_tests_properties (H5FC_CHECK_DUMP-${testname} PROPERTIES DEPENDS "H5FC-${testname}") set (last_test "H5FC_CHECK_DUMP-${testname}") - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_H5DUMP_CHECK) ############################################################################## ############################################################################## @@ -324,9 +324,9 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5FC-clearall-objects") - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) # h5format_convert --help # h5format_convert (no options) diff --git a/tools/test/h5format_convert/h5fc_gentest.c b/tools/test/h5format_convert/h5fc_gentest.c index 9ef8e6e..fea7eed 100644 --- a/tools/test/h5format_convert/h5fc_gentest.c +++ b/tools/test/h5format_convert/h5fc_gentest.c @@ -44,6 +44,8 @@ const char *FILENAME[] = { #define GROUP "GROUP" +#define DSET_BT1 "DSET_BT1" +#define DSET_NDATA_BT1 "DSET_NDATA_BT1" #define DSET_COMPACT "DSET_COMPACT" #define DSET_CONTIGUOUS "DSET_CONTIGUOUS" @@ -768,7 +770,6 @@ error: H5Dclose(did2); H5Gclose(gid); H5Fclose(fid); - H5Pclose(fapl); H5Pclose(fcpl); } H5E_END_TRY; diff --git a/tools/test/h5format_convert/testh5fc.sh.in b/tools/test/h5format_convert/testh5fc.sh.in index 24f04d6..5384354 100644 --- a/tools/test/h5format_convert/testh5fc.sh.in +++ b/tools/test/h5format_convert/testh5fc.sh.in @@ -180,9 +180,6 @@ CLEAN_TESTFILES_AND_TESTDIR() $RM $TESTDIR else $RM $TESTDIR/$TMPFILE - $RM $TESTDIR/$TMPOUTFILE - $RM $TESTDIR/$TMPCHKFILE - $RM $TESTDIR/$TMPDMPFILE fi } diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index 0d23e5d..22491b4 100644 --- a/tools/test/h5import/CMakeLists.txt +++ b/tools/test/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_TEST_H5IMPORT) #----------------------------------------------------------------------------- diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index 15b36fc..eb0b413 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -64,15 +64,15 @@ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (conf_file ${HDF5_REFERENCE_CONF_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/testfiles/${conf_file}" "${PROJECT_BINARY_DIR}/testfiles/${conf_file}" "h5import_files") - endforeach () + endforeach (conf_file ${HDF5_REFERENCE_CONF_FILES}) foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/testfiles/${txt_file}" "${PROJECT_BINARY_DIR}/testfiles/${txt_file}" "h5import_files") - endforeach () + endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) 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 () + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) add_custom_target(h5import_files ALL COMMENT "Copying files needed by h5import tests" DEPENDS ${h5import_files_list}) ############################################################################## @@ -80,14 +80,14 @@ ### T H E T E S T S M A C R O S ### ############################################################################## ############################################################################## - macro (ADD_H5_TEST testname importfile conffile testfile) + MACRO (ADD_H5_TEST testname importfile conffile testfile) # If using memchecker skip macro based tests if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest) endif () - else () + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5IMPORT-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -125,10 +125,10 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST testname importfile conffile testfile) - macro (ADD_H5_DUMPTEST testname datasetname testfile) + MACRO (ADD_H5_DUMPTEST testname datasetname testfile) # If using memchecker skip tests if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -152,7 +152,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - else () + else ("${ARGN}" STREQUAL "BINARY") add_test ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" @@ -164,7 +164,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () + endif ("${ARGN}" STREQUAL "BINARY") set_tests_properties (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") add_test ( @@ -193,24 +193,24 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) - macro (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) + MACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5IMPORT-DUMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" ) - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) # -------------------------------------------------------------------- # Determine if filter is available for h5diff # -------------------------------------------------------------------- if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif () + endif (H5_HAVE_FILTER_DEFLATE) ############################################################################## ############################################################################## @@ -377,7 +377,7 @@ dtxtstr.h5.dff.err ) set (last_test "H5IMPORT-clear-objects") - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5IMPORT-h5importtest-clear-objects @@ -393,7 +393,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5IMPORT-clear-objects") add_test (NAME H5IMPORT-h5importtest COMMAND $) @@ -424,17 +424,17 @@ ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5) if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - else () + else (NOT USE_FILTER_DEFLATE) ADD_H5_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - endif () + endif (NOT USE_FILTER_DEFLATE) # ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " ADD_H5_TEST (BINARY_I8 binin8.bin testfiles/binin8.conf binin8.h5) if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - else () + else (NOT USE_FILTER_DEFLATE) ADD_H5_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - endif () + endif (NOT USE_FILTER_DEFLATE) # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " ADD_H5_TEST (BINARY_I16 binin16.bin testfiles/binin16.conf binin16.h5) diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index 562b4f3..d3980c4 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_TEST_H5JAM) #----------------------------------------------------------------------------- @@ -17,7 +17,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5jamgentest COMMAND $) - endif () + endif (HDF5_BUILD_GENERATORS) add_executable (getub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/getub.c) TARGET_NAMING (getub STATIC) diff --git a/tools/test/h5jam/CMakeTests.cmake b/tools/test/h5jam/CMakeTests.cmake index d0ba305..9ed2015 100644 --- a/tools/test/h5jam/CMakeTests.cmake +++ b/tools/test/h5jam/CMakeTests.cmake @@ -23,11 +23,11 @@ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5jam_files") - endforeach () + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/testfiles/${txt_file}" "${PROJECT_BINARY_DIR}/testfiles/${txt_file}" "h5jam_files") - endforeach () + endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) add_custom_target(h5jam_files ALL COMMENT "Copying files needed by h5jam tests" DEPENDS ${h5jam_files_list}) ############################################################################## @@ -40,14 +40,14 @@ # TEST_H5JAM_OUTPUT # For the purpose to verify only output & exitcode from h5jam # - macro (TEST_H5JAM_OUTPUT expectfile resultcode) + MACRO (TEST_H5JAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5JAM-${expectfile} COMMAND $ ${ARGN}) if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") - endif () - else () + endif (NOT "${resultcode}" STREQUAL "0") + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" @@ -59,21 +59,21 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (TEST_H5JAM_OUTPUT) # ============================================================ # TEST_H5UNJAM_OUTPUT # For the purpose to verify only output & exitcode from h5unjam # - macro (TEST_H5UNJAM_OUTPUT expectfile resultcode) + MACRO (TEST_H5UNJAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND $ ${ARGN}) if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") - endif () - else () + endif (NOT "${resultcode}" STREQUAL "0") + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" @@ -85,10 +85,10 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (TEST_H5UNJAM_OUTPUT) - macro (CHECKFILE testname testdepends expected actual) + MACRO (CHECKFILE testname testdepends expected actual) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -117,10 +117,10 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) - endif () - endmacro() + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO(CHECKFILE testname testdepends expected actual) - macro (UNJAMTEST testname setfile infile ufile chkfile outfile) + MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5JAM-${testname}-UNJAM-SETUP-clear-objects @@ -145,7 +145,7 @@ add_test (NAME H5JAM-${testname}-UNJAM COMMAND $ -i ${infile} -u ${ufile} -o ${outfile}) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) set (compare_test ${ufile}) - else () + else (NOT "${ufile}" STREQUAL "NONE") if (NOT "${ARGN}" STREQUAL "--delete") add_test ( NAME H5JAM-${testname}-UNJAM @@ -160,12 +160,12 @@ ) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) set (compare_test "${outfile}.ufile.txt") - else () + else (NOT "${ARGN}" STREQUAL "--delete") add_test (NAME H5JAM-${testname}-UNJAM COMMAND $ -i ${infile} -o ${outfile}) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) set (compare_test "") - endif () - endif () + endif (NOT "${ARGN}" STREQUAL "--delete") + endif (NOT "${ufile}" STREQUAL "NONE") if (NOT "${compare_test}" STREQUAL "") add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects @@ -190,7 +190,7 @@ -P "${HDF_RESOURCES_DIR}/userblockTest.cmake" ) set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects) - endif () + endif (NOT "${compare_test}" STREQUAL "") add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_NOUB @@ -207,21 +207,21 @@ ) if (NOT "${compare_test}" STREQUAL "") set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1) - else () + else (NOT "${compare_test}" STREQUAL "") set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) - endif () + endif (NOT "${compare_test}" STREQUAL "") CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) - endif () - endmacro() + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO(UNJAMTEST testname infile ufile outfile) - macro (JAMTEST testname jamfile infile chkfile outfile) + MACRO (JAMTEST testname jamfile infile chkfile outfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5JAM-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 ) - endif () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5JAM-${testname} COMMAND $ -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) if (NOT HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) @@ -229,7 +229,7 @@ set (compare_orig testfiles/${infile}) if ("${ARGN}" STREQUAL "--clobber") set (compare_orig "") - endif () + endif ("${ARGN}" STREQUAL "--clobber") add_test ( NAME H5JAM-${testname}-CHECK_UB_1-clear-objects @@ -255,10 +255,10 @@ ) set_tests_properties (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (JAMTEST testname jamfile infile outfile) - macro (JAMTEST_NONE testname jamfile infile setfile chkfile) + MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5JAM-${testname}_NONE-clear-objects @@ -284,7 +284,7 @@ set (compare_orig ${chkfile}.cpy.h5) if ("${ARGN}" STREQUAL "--clobber") set (compare_orig "") - endif () + endif ("${ARGN}" STREQUAL "--clobber") add_test ( NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects @@ -310,8 +310,8 @@ ) set_tests_properties (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) ############################################################################## ############################################################################## diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt index c21ca92..48894fb 100644 --- a/tools/test/h5ls/CMakeLists.txt +++ b/tools/test/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_TEST_H5LS) #----------------------------------------------------------------------------- @@ -6,34 +6,6 @@ PROJECT (HDF5_TOOLS_TEST_H5LS) #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - #----------------------------------------------------------------------------- - # If plugin library tests can be tested - #----------------------------------------------------------------------------- - set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibls") - set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") - set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - - add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_ls.c) - TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) - - # make plugins dir - file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") - #----------------------------------------------------------------------------- - # Copy plugin library to a plugins folder - #----------------------------------------------------------------------------- - add_custom_command ( - TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - "$" - "${CMAKE_BINARY_DIR}/plugins/$" - ) - include (CMakeTests.cmake) include (CMakeTestsVDS.cmake) diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index d5d0eb1..a66ae40 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -29,7 +29,6 @@ ${HDF5_TOOLS_DIR}/testfiles/tslink.h5 ${HDF5_TOOLS_DIR}/testfiles/tsoftlinks.h5 ${HDF5_TOOLS_DIR}/testfiles/tstr.h5 - ${HDF5_TOOLS_DIR}/testfiles/tudfilter.h5 ${HDF5_TOOLS_DIR}/testfiles/tudlink.h5 ${HDF5_TOOLS_DIR}/testfiles/tvldtypes1.h5 ${HDF5_TOOLS_DIR}/testfiles/tdset_idx.h5 @@ -88,7 +87,6 @@ ${HDF5_TOOLS_DIR}/testfiles/tsaf.ls ${HDF5_TOOLS_DIR}/testfiles/tslink-1.ls ${HDF5_TOOLS_DIR}/testfiles/tstr-1.ls - ${HDF5_TOOLS_DIR}/testfiles/tudfilter.ls ${HDF5_TOOLS_DIR}/testfiles/tudlink-1.ls ${HDF5_TOOLS_DIR}/testfiles/tvldtypes1.ls ${HDF5_TOOLS_DIR}/testfiles/tvldtypes2le.ls @@ -102,7 +100,7 @@ foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${listfiles}" NAME) HDFTEST_COPY_FILE("${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5ls_files") - endforeach () + endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) add_custom_target(h5ls_files ALL COMMENT "Copying files needed by h5ls tests" DEPENDS ${h5ls_files_list}) ############################################################################## @@ -111,7 +109,7 @@ ############################################################################## ############################################################################## - macro (ADD_H5_TEST resultfile resultcode) + MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) @@ -122,7 +120,7 @@ if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () - else () + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -134,35 +132,8 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - endmacro () - - macro (ADD_H5_UD_TEST testname resultcode resultfile) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5LS_UD-${testname}-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${resultfile}.out - testfiles/${resultfile}.out.err - ) - add_test ( - NAME H5LS_UD-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ls" - -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5LS_UD-${testname} PROPERTIES DEPENDS H5LS_UD-${testname}-clearall-objects) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST file) ############################################################################## ############################################################################## @@ -286,9 +257,9 @@ set_tests_properties (H5LS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5LS-clearall-objects") - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) # See which filters are usable (and skip tests for filters we # don't have). Do this by searching H5pubconf.h to see which @@ -297,11 +268,11 @@ # detect whether the encoder is present. if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif () + endif (H5_HAVE_FILTER_DEFLATE) if (H5_HAVE_FILTER_SZIP) set (USE_FILTER_SZIP "true") - endif () + endif (H5_HAVE_FILTER_SZIP) # test the help syntax ADD_H5_TEST (help-1 0 -w80 -h) @@ -412,9 +383,9 @@ # ( HDFFV-7838, ) if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tattrreg_be 0 -w80 -v -d tattrreg.h5) - else () + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tattrreg_le 0 -w80 -v -d tattrreg.h5) - endif () + endif (H5_WORDS_BIGENDIAN) # test for non-existing file ADD_H5_TEST (nosuchfile 1 nosuchfile.h5) @@ -422,25 +393,20 @@ # test for variable length data types in verbose mode if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5) - else () + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5) - endif () + endif (H5_WORDS_BIGENDIAN) # test for dataset region references data types in verbose mode if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) - else () + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) - endif () + endif (H5_WORDS_BIGENDIAN) # test for file with datasets that use Fixed Array chunk indices if (USE_FILTER_DEFLATE) # data read internal filters ADD_H5_TEST (tdset_idx 0 -w80 -d tdset_idx.h5) - endif () - + endif (USE_FILTER_DEFLATE) -############################################################################## -### P L U G I N T E S T S -############################################################################## -ADD_H5_UD_TEST (h5ls_plugin_test 0 tudfilter -w80 -d tudfilter.h5) diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index 0a7a216..72e14a1 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -49,7 +49,7 @@ foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${listfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5ls_vds_files") - endforeach () + endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) add_custom_target(h5ls_vds_files ALL COMMENT "Copying files needed by h5ls_vds tests" DEPENDS ${h5ls_vds_files_list}) ############################################################################## @@ -58,7 +58,7 @@ ############################################################################## ############################################################################## - macro (ADD_H5_VDS_TEST resultfile resultcode) + MACRO (ADD_H5_VDS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) @@ -69,7 +69,7 @@ if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () - else () + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -81,8 +81,8 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_VDS_TEST file) ############################################################################## ############################################################################## @@ -124,9 +124,9 @@ set_tests_properties (H5LS_VDS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5LS_VDS-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5LS_VDS-clearall-objects") - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_VDS_TEST (tvds-1 0 -w80 -v -S 1_vds.h5) ADD_H5_VDS_TEST (tvds-2 0 -w80 -v -S 2_vds.h5) diff --git a/tools/test/h5ls/Makefile.am b/tools/test/h5ls/Makefile.am index 170aa63..6f3d3dd 100644 --- a/tools/test/h5ls/Makefile.am +++ b/tools/test/h5ls/Makefile.am @@ -27,24 +27,8 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib TEST_SCRIPT=testh5ls.sh testh5lsvds.sh check_SCRIPTS=$(TEST_SCRIPT) SCRIPT_DEPEND=../../src/h5ls/h5ls$(EXEEXT) -if HAVE_SHARED_CONDITIONAL -if USE_PLUGINS_CONDITIONAL - TEST_SCRIPT += h5ls_plugin.sh -endif -endif # All programs depend on the hdf5 and h5tools libraries LDADD=$(LIBH5TOOLS) $(LIBHDF5) -if HAVE_SHARED_CONDITIONAL - # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibls.la - libdynlibls_la_SOURCES=dynlib_ls.c - -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* -endif - -DISTCLEANFILES=h5ls_plugin.sh - include $(top_srcdir)/config/conclude.am diff --git a/tools/test/h5ls/testh5ls.sh.in b/tools/test/h5ls/testh5ls.sh.in index 1b3f67d..15282f6 100644 --- a/tools/test/h5ls/testh5ls.sh.in +++ b/tools/test/h5ls/testh5ls.sh.in @@ -183,7 +183,7 @@ 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 ." @@ -241,7 +241,7 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err @@ -253,37 +253,37 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test @@ -427,9 +427,9 @@ fi if test $USE_FILTER_DEFLATE = "yes" ; then # data read internal filters TOOLTEST tdset_idx.ls 0 -w80 -d tdset_idx.h5 -else - echo "***skip testing tdset_idx.h5" fi +echo "***skip testing tdset_idx.h5" +TOOLTEST tdset_idx.ls 0 -w80 -d tdset_idx.h5 # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index 9d67ec3..cecec53 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_TEST_H5REPACK) #----------------------------------------------------------------------------- diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index aa5a1b4..576fb58 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -17,9 +17,9 @@ if (DIRECT_VFD) set (VFD_LIST ${VFD_LIST} direct) - endif () + endif (DIRECT_VFD) - macro (ADD_VFD_TEST vfdname resultcode) + MACRO (ADD_VFD_TEST vfdname resultcode) add_test ( NAME H5REPACK-VFD-${vfdname}-h5repacktest COMMAND "${CMAKE_COMMAND}" @@ -33,10 +33,10 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") - endmacro () - endif () + ENDMACRO (ADD_VFD_TEST) + endif (HDF5_TEST_VFD) # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory @@ -131,7 +131,7 @@ foreach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${h5_file}" NAME) HDFTEST_COPY_FILE("${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5repack_files") - endforeach () + endforeach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) add_custom_target(h5repack_files ALL COMMENT "Copying files needed by h5repack tests" DEPENDS ${h5repack_files_list}) ############################################################################## @@ -140,7 +140,7 @@ ############################################################################## ############################################################################## - macro (ADD_HELP_TEST testname resultcode) + MACRO (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5REPACK-${testname} COMMAND $ ${ARGN}) @@ -149,7 +149,7 @@ set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) endif () set (last_test "H5REPACK-${testname}") - else () + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK-h5repack-${testname} COMMAND "${CMAKE_COMMAND}" @@ -161,18 +161,18 @@ -D "TEST_REFERENCE=h5repack-${testname}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_HELP_TEST) - macro (ADD_H5_TEST_OLD testname testtype testfile) + MACRO (ADD_H5_TEST_OLD testname testtype testfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_OLD-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) - endif () - else () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else ("${testtype}" STREQUAL "SKIP") add_test ( NAME H5REPACK_OLD-${testname} COMMAND $ ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} @@ -185,18 +185,18 @@ COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) - endif () - endmacro () + endif ("${testtype}" STREQUAL "SKIP") + ENDMACRO (ADD_H5_TEST_OLD) - macro (ADD_H5_TEST testname testtype testfile) + MACRO (ADD_H5_TEST testname testtype testfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) - endif () - else () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else ("${testtype}" STREQUAL "SKIP") add_test ( NAME H5REPACK-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} @@ -209,24 +209,24 @@ COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) - endif () - endmacro () + endif ("${testtype}" STREQUAL "SKIP") + ENDMACRO (ADD_H5_TEST) - macro (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) + MACRO (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_CMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - endif () - else () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else ("${testtype}" STREQUAL "SKIP") # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_CMP-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) - else () + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" @@ -239,22 +239,22 @@ -D "TEST_REFERENCE=${resultfile}-${testname}.tst" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) endif () - endif () - endmacro () + endif ("${testtype}" STREQUAL "SKIP") + ENDMACRO (ADD_H5_CMP_TEST) - macro (ADD_H5_MASK_TEST testname testtype resultcode resultfile) + MACRO (ADD_H5_MASK_TEST testname testtype resultcode resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_MASK-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - endif () - else () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else ("${testtype}" STREQUAL "SKIP") # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -273,22 +273,22 @@ -D "TEST_REFERENCE=${resultfile}-${testname}.tst" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS ${last_test}) endif () - endif () - endmacro () + endif ("${testtype}" STREQUAL "SKIP") + ENDMACRO (ADD_H5_MASK_TEST) - macro (ADD_H5_DMP_TEST testname testtype resultcode resultfile) + MACRO (ADD_H5_DMP_TEST testname testtype resultcode resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_DMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - endif () - else () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else ("${testtype}" STREQUAL "SKIP") # If using memchecker add tests without using scripts add_test ( NAME H5REPACK_DMP-${testname} @@ -309,19 +309,19 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}") - endif () - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif ("${testtype}" STREQUAL "SKIP") + ENDMACRO (ADD_H5_DMP_TEST) - macro (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) + MACRO (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - endif () - else () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname} @@ -349,7 +349,7 @@ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - else () + else ("${resultcode}" STREQUAL "0") if ("${testfilter}" STREQUAL "CHUNKED") set (nottestfilter "(CONTIGUOUS|COMPACT)") endif () @@ -372,20 +372,20 @@ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - endif () - endif () - endif () - endmacro () + endif ("${resultcode}" STREQUAL "0") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif ("${testtype}" STREQUAL "SKIP") + ENDMACRO (ADD_H5_VERIFY_TEST) - macro (ADD_H5_VERIFY_VDS testname testtype resultcode testfile testdset testfilter) + MACRO (ADD_H5_VERIFY_VDS testname testtype resultcode testfile testdset testfilter) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - endif () - else () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname} @@ -408,11 +408,11 @@ ) set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}) - endif () - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif ("${testtype}" STREQUAL "SKIP") + ENDMACRO (ADD_H5_VERIFY_VDS) - macro (ADD_H5_TEST_META testname testfile) + MACRO (ADD_H5_TEST_META testname testfile) add_test ( NAME H5REPACK_META-${testname}_N COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 @@ -429,9 +429,9 @@ add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) set_tests_properties (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true") set_tests_properties (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M) - endmacro () + ENDMACRO (ADD_H5_TEST_META) - macro (ADD_H5_UD_TEST testname resultcode resultfile) + MACRO (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( @@ -469,8 +469,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") - endif () - endmacro () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_UD_TEST) ############################################################################## ############################################################################## @@ -708,7 +708,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") ADD_HELP_TEST(help 0 -h) @@ -717,14 +717,14 @@ if (HDF5_ENABLE_SZIP_ENCODING) set (passRegex "yes") set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") - else () + else (HDF5_ENABLE_SZIP_ENCODING) set (passRegex "no") set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - endif () - else () + endif (HDF5_ENABLE_SZIP_ENCODING) + else (HDF5_ENABLE_SZIP_SUPPORT) set (passRegex "no") set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - endif () + endif (HDF5_ENABLE_SZIP_SUPPORT) set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) add_test (NAME H5REPACK-h5repacktest COMMAND $) @@ -748,15 +748,15 @@ set (USE_FILTER_SZIP_ENCODER "no") if (HDF5_ENABLE_SZIP_ENCODING) set (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) - endif () + endif (HDF5_ENABLE_SZIP_ENCODING) if (H5_HAVE_FILTER_DEFLATE) set (USE_FILTER_DEFLATE "true") - endif () + endif (H5_HAVE_FILTER_DEFLATE) if (H5_HAVE_FILTER_SZIP) set (USE_FILTER_SZIP "true") - endif () + endif (H5_HAVE_FILTER_SZIP) # copy files (these files have no filters) ADD_H5_TEST (fill "TEST" ${FILE0}) @@ -768,10 +768,10 @@ # nested 8bit enum in both deflated and non-deflated datafiles if (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (nested_8bit_enum "TEST" h5repack_nested_8bit_enum.h5) - else () - ADD_H5_TEST (nested_8bit_enum "TEST" h5repack_nested_8bit_enum_deflated.h5) - endif () + ADD_H5_TEST (nested_8bit_enum "TEST" h5repack_nested_8bit_enum.h5) + else (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (nested_8bit_enum "TEST" h5repack_nested_8bit_enum_deflated.h5) + endif (NOT USE_FILTER_DEFLATE) # use $FILE4 to write some filters (this file has no filters) @@ -780,7 +780,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (gzip_individual ${TESTTYPE} ${arg}) # gzip for all @@ -788,7 +788,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (gzip_all ${TESTTYPE} ${arg}) # szip with individual object @@ -796,7 +796,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) # szip for all @@ -804,7 +804,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) # shuffle with individual object @@ -828,7 +828,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) # verbose gzip with individual object @@ -836,7 +836,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) ########################################################### @@ -848,7 +848,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) # szip remove @@ -856,7 +856,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) # deflate copy @@ -864,7 +864,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_copy ${TESTTYPE} ${arg}) # deflate remove @@ -872,7 +872,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_remove ${TESTTYPE} ${arg}) # shuffle copy @@ -920,7 +920,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER) ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) #filter conversions @@ -928,14 +928,14 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) set (arg ${FILE7} -f dset_szip:GZIP=1) set (TESTTYPE "TEST") if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) #limit @@ -943,7 +943,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_DMP_TEST (deflate_limit ${TESTTYPE} 0 ${arg}) #file @@ -951,7 +951,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) ######################################################### @@ -1039,7 +1039,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) @@ -1047,7 +1047,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # several global filters @@ -1055,7 +1055,7 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (global_filters ${TESTTYPE} ${arg}) # syntax of -i infile -o outfile @@ -1064,7 +1064,7 @@ set (TESTTYPE "LEGACY") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST_OLD (old_style_layout_short_switches ${TESTTYPE} ${arg}) # add a userblock to file @@ -1080,10 +1080,7 @@ ADD_H5_TEST (upgrade_layout "TEST" ${FILE14}) # test for datum size > H5TOOLS_MALLOCSIZE - if (NOT USE_FILTER_DEFLATE) - set (TESTTYPE "SKIP") - endif () - ADD_H5_TEST (gt_mallocsize ${TESTTYPE} ${FILE1} -f GZIP=1) + ADD_H5_TEST (gt_mallocsize "TEST" ${FILE1} -f GZIP=1) # Check repacking file with committed datatypes in odd configurations ADD_H5_TEST (committed_dt "TEST" ${FILE15}) @@ -1117,31 +1114,31 @@ set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_VERIFY_VDS (vds_dset_chunk20x10x5 ${TESTTYPE} 0 ${FILEV1} vds_dset CHUNKED -l vds_dset:CHUNK=20x10x5) set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_VERIFY_VDS (vds_chunk2x5x8 ${TESTTYPE} 0 ${FILEV3_1} vds_dset CHUNKED -l vds_dset:CHUNK=2x5x8) set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_VERIFY_VDS (vds_chunk3x6x9 ${TESTTYPE} 0 ${FILEV2} vds_dset CHUNKED -l vds_dset:CHUNK=3x6x9) set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_VERIFY_VDS (vds_compa ${TESTTYPE} 0 ${FILEV4} vds_dset COMPACT -l vds_dset:COMPA) set (TESTTYPE "TEST") if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") - endif () + endif (NOT USE_FILTER_DEFLATE) ADD_H5_VERIFY_VDS (vds_conti ${TESTTYPE} 0 ${FILEV4} vds_dset CONTIGUOUS -l vds_dset:CONTI) ############################################################################## @@ -1154,12 +1151,12 @@ set (TESTRETVAL 255) if (WIN32) set (TESTRETVAL -1) - endif () + endif() ADD_H5_CMP_TEST (plugin_zero "" "TEST" ${TESTRETVAL} h5repack_layout.h5 -v -f UD=250,0) if (HDF5_TEST_VFD) # Run test with different Virtual File Driver foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - endforeach () - endif () + endforeach (vfd ${VFD_LIST}) + endif (HDF5_TEST_VFD) diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index 23e0663..4d3cae8 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -29,14 +29,14 @@ TESTNAME=h5repack EXIT_SUCCESS=0 EXIT_FAILURE=1 -H5REPACK=../../src/h5repack/h5repack # The tool name -H5REPACK_BIN=`pwd`/$H5REPACK # The path of the tool binary +H5REPACK=../../src/h5repack/h5repack # The tool name +H5REPACK_BIN=`pwd`/$H5REPACK # The path of the tool binary -H5DIFF=../../src/h5diff/h5diff # The h5diff tool name -H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary +H5DIFF=../../src/h5diff/h5diff # The h5diff tool name +H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary -H5DUMP=../../src/h5dump/h5dump # The h5dump tool name -H5DUMP_BIN=`pwd`/$H5DUMP # The path of the h5dump tool binary +H5DUMP=../../src/h5dump/h5dump # The h5dump tool name +H5DUMP_BIN=`pwd`/$H5DUMP # The path of the h5dump tool binary RM='rm -rf' CMP='cmp' @@ -386,7 +386,7 @@ VERIFY_LAYOUT_VDS() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi # clean up tmp files @@ -1223,27 +1223,27 @@ TOOLTEST_META meta_long h5repack_layout.h5 --metadata_block_size=8192 # layout conversions ############################################################### if test $USE_FILTER_DEFLATE != "yes" ; then - SKIP vds_dset_chunk_20x10x5 + SKIP vds_dset_chunk_20x10x5 else - VERIFY_LAYOUT_VDS vds_dset_chunk_20x10x5 1_vds.h5 vds_dset CHUNKED --layout vds_dset:CHUNK=20x10x5 + VERIFY_LAYOUT_VDS vds_dset_chunk_20x10x5 1_vds.h5 vds_dset CHUNKED --layout vds_dset:CHUNK=20x10x5 fi if test $USE_FILTER_DEFLATE != "yes" ; then - SKIP vds_chunk2x5x8 + SKIP vds_chunk2x5x8 else - VERIFY_LAYOUT_VDS vds_chunk2x5x8 3_1_vds.h5 vds_dset CHUNKED -l vds_dset:CHUNK=2x5x8 + VERIFY_LAYOUT_VDS vds_chunk2x5x8 3_1_vds.h5 vds_dset CHUNKED -l vds_dset:CHUNK=2x5x8 fi if test $USE_FILTER_DEFLATE != "yes" ; then - SKIP vds_chunk3x6x9 + SKIP vds_chunk3x6x9 else - VERIFY_LAYOUT_VDS vds_chunk3x6x9 2_vds.h5 vds_dset CHUNKED -l vds_dset:CHUNK=3x6x9 + VERIFY_LAYOUT_VDS vds_chunk3x6x9 2_vds.h5 vds_dset CHUNKED -l vds_dset:CHUNK=3x6x9 fi if test $USE_FILTER_DEFLATE != "yes" ; then - SKIP vds_compa 4_vds.h5 + SKIP vds_compa 4_vds.h5 else - VERIFY_LAYOUT_VDS vds_compa 4_vds.h5 vds_dset COMPACT -l vds_dset:COMPA + VERIFY_LAYOUT_VDS vds_compa 4_vds.h5 vds_dset COMPACT -l vds_dset:COMPA fi if test $USE_FILTER_DEFLATE != "yes" ; then diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index abdda08..82b45fc 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -97,6 +97,7 @@ const char *H5REPACK_FILENAMES[] = { /* Name of tool */ #define PROGRAMNAME "h5repacktst" + #define DIM1 40 #define DIM2 20 #define CDIM1 DIM1/2 @@ -191,7 +192,7 @@ int main (void) puts("Testing h5repack:"); /* make the test files */ - TESTING(" generating files for testing"); + TESTING(" generating datasets"); if (make_testfiles() < 0) GOERROR; PASSED(); diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index 10ac5e0..98cfed7 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_TEST_H5STAT) #----------------------------------------------------------------------------- @@ -17,6 +17,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5stat_gentest COMMAND $) - endif () + endif (HDF5_BUILD_GENERATORS) include (CMakeTests.cmake) diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake index f6735d5..39faca0 100644 --- a/tools/test/h5stat/CMakeTests.cmake +++ b/tools/test/h5stat/CMakeTests.cmake @@ -52,11 +52,11 @@ foreach (ddl_file ${HDF5_REFERENCE_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/testfiles/${ddl_file}" "${PROJECT_BINARY_DIR}/${ddl_file}" "h5stat_files") - endforeach () + endforeach (ddl_file ${HDF5_REFERENCE_FILES}) foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "h5stat_files") - endforeach () + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) add_custom_target(h5stat_files ALL COMMENT "Copying files needed by h5stat tests" DEPENDS ${h5stat_files_list}) ############################################################################## @@ -65,16 +65,16 @@ ############################################################################## ############################################################################## - macro (ADD_H5_TEST resultfile resultcode) + MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5STAT-${resultfile} COMMAND $ ${ARGN}) if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") - endif () + endif (NOT ${resultcode} STREQUAL "0") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5STAT-${resultfile} @@ -87,8 +87,8 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST file) ############################################################################## ############################################################################## @@ -167,9 +167,9 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5STAT-clearall-objects") - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) # Test for help flag ADD_H5_TEST (h5stat_help1 0 -h) diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 029d7a9..a53fa73 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_TEST_MISC) #----------------------------------------------------------------------------- @@ -19,7 +19,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) add_subdirectory (${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/vds) - endif () + endif (HDF5_BUILD_GENERATORS) add_executable (h5repart_test ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/repart_test.c) TARGET_NAMING (h5repart_test STATIC) diff --git a/tools/test/misc/CMakeTests.cmake b/tools/test/misc/CMakeTests.cmake index 9ecdeae..9835e1e 100644 --- a/tools/test/misc/CMakeTests.cmake +++ b/tools/test/misc/CMakeTests.cmake @@ -31,7 +31,7 @@ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "h5repart_files") - endforeach () + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) add_custom_target(h5repart_files ALL COMMENT "Copying files needed by h5repart tests" DEPENDS ${h5repart_files_list}) set (HDF5_MKGRP_TEST_FILES @@ -56,7 +56,7 @@ foreach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_mkgrp_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}" "h5mkgrp_files") - endforeach () + endforeach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/testfiles/h5mkgrp_help.txt" "${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_help.txt" "h5mkgrp_files") add_custom_target(h5mkgrp_files ALL COMMENT "Copying files needed by h5mkgrp tests" DEPENDS ${h5mkgrp_files_list}) @@ -69,7 +69,7 @@ ############################################################################## ############################################################################## - macro (ADD_H5_TEST resultfile resultcode resultoption) + MACRO (ADD_H5_TEST resultfile resultcode resultoption) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5MKGRP-${resultfile}-clear-objects @@ -78,7 +78,7 @@ ${resultfile}.h5 ) set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - endif () + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5MKGRP-${resultfile} @@ -88,8 +88,8 @@ if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - else () + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) add_test ( NAME H5MKGRP-${resultfile}-h5ls @@ -104,13 +104,13 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) - macro (ADD_H5_CMP resultfile resultcode) + MACRO (ADD_H5_CMP resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND $ ${ARGN}) - else () + else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5MKGRP_CMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -130,8 +130,8 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) - endif () - endmacro () + endif (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_CMP resultfile resultcode) ############################################################################## ############################################################################## @@ -154,7 +154,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5REPART-clearall-objects") # repartition family member size to 20,000 bytes. @@ -192,7 +192,7 @@ ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5CLEAR-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5CLEAR-clearall-objects") # create the output files to be used. @@ -313,9 +313,9 @@ set_tests_properties (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () + endif (NOT "${last_test}" STREQUAL "") set (last_test "H5MKGRP-clearall-objects") - endif () + endif (HDF5_ENABLE_USING_MEMCHECKER) # Check that help & version is displayed properly ADD_H5_CMP (h5mkgrp_help 0 "-h") diff --git a/tools/test/misc/Makefile.am b/tools/test/misc/Makefile.am index fc9e1c1..1025a8a 100644 --- a/tools/test/misc/Makefile.am +++ b/tools/test/misc/Makefile.am @@ -36,7 +36,7 @@ SCRIPT_DEPEND=../../src/misc/h5repart$(EXEEXT) ../../src/misc/h5mkgrp$(EXEEXT) . # Temporary files. *.h5 are generated by h5repart_gentest. They should # copied to the testfiles/ directory if update is required. fst_family*.h5 # and scd_family*.h5 were created by setting the HDF5_NOCLEANUP variable. -CHECK_CLEANFILES+=*.h5 ../testfiles/fst_family*.h5 ../testfiles/scd_family*.h5 append.log +CHECK_CLEANFILES+=*.h5 ../testfiles/fst_family*.h5 ../testfiles/scd_family*.h5 # These were generated by configure. Remove them only when distclean. DISTCLEANFILES=testh5repart.sh testh5clear.sh diff --git a/tools/test/misc/testh5repart.sh.in b/tools/test/misc/testh5repart.sh.in index 9a9dd9a..2106a1d 100644 --- a/tools/test/misc/testh5repart.sh.in +++ b/tools/test/misc/testh5repart.sh.in @@ -43,7 +43,7 @@ SRC_TOOLS="$srcdir/../.." SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" -TESTDIR=./testrepart +TESTDIR=./testfiles test -d $TESTDIR || mkdir -p $TESTDIR # diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index ec672e5..23dc85c 100644 --- a/tools/test/misc/vds/CMakeLists.txt +++ b/tools/test/misc/vds/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_TEST_MISC_VDS) #----------------------------------------------------------------------------- @@ -12,7 +12,7 @@ MACRO (ADD_H5_GENERATOR genfile) TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/tools) -ENDMACRO () +ENDMACRO (ADD_H5_GENERATOR genfile) # generator executables set (H5_GENERATORS @@ -25,4 +25,4 @@ set (H5_GENERATORS foreach (gen ${H5_GENERATORS}) ADD_H5_GENERATOR (${gen}) -endforeach () +endforeach (gen ${H5_GENERATORS}) diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index 20250c6..bea2d0c 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2.2) +cmake_minimum_required (VERSION 3.1.0) PROJECT (HDF5_TOOLS_TEST_PERFORM ) #----------------------------------------------------------------------------- @@ -40,7 +40,7 @@ if (HDF5_BUILD_PERFORM_STANDALONE) set_property (TARGET h5perf_serial_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) -endif () +endif (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for chunk set (chunk_SOURCES @@ -118,7 +118,7 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING) set_property (TARGET h5perf_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) - endif () -endif () + endif (HDF5_BUILD_PERFORM_STANDALONE) +endif (H5_HAVE_PARALLEL AND BUILD_TESTING) include (CMakeTests.cmake) diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake index d286988..0ea40a3 100644 --- a/tools/test/perform/CMakeTests.cmake +++ b/tools/test/perform/CMakeTests.cmake @@ -27,119 +27,28 @@ add_test ( x-gnuplot ) -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_h5perf_serial COMMAND $) -else () - add_test (NAME PERFORM_h5perf_serial COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=h5perf_serial.txt" - #-D "TEST_REFERENCE=h5perf_serial.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () +add_test (NAME PERFORM_h5perf_serial COMMAND $) set_tests_properties (PERFORM_h5perf_serial PROPERTIES TIMEOUT 1800) if (HDF5_BUILD_PERFORM_STANDALONE) add_test (NAME PERFORM_h5perf_serial_alone COMMAND $) -endif () +endif (HDF5_BUILD_PERFORM_STANDALONE) -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_chunk COMMAND $) -else () - add_test (NAME PERFORM_chunk COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=chunk.txt" - #-D "TEST_REFERENCE=chunk.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () +add_test (NAME PERFORM_chunk COMMAND $) -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_iopipe COMMAND $) -else () - add_test (NAME PERFORM_iopipe COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=iopipe.txt" - #-D "TEST_REFERENCE=iopipe.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () +add_test (NAME PERFORM_iopipe COMMAND $) -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_overhead COMMAND $) -else () - add_test (NAME PERFORM_overhead COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=overhead.txt" - #-D "TEST_REFERENCE=overhead.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () +add_test (NAME PERFORM_overhead COMMAND $) -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_perf_meta COMMAND $) -else () - add_test (NAME PERFORM_perf_meta COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=perf_meta.txt" - #-D "TEST_REFERENCE=perf_meta.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () +add_test (NAME PERFORM_perf_meta COMMAND $) -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_zip_perf_help COMMAND $ "-h") -else () - add_test (NAME PERFORM_zip_perf_help COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=zip_perf-h.txt" - #-D "TEST_REFERENCE=zip_perf-h.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () -if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) -else () - add_test (NAME PERFORM_zip_perf COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=zip_perf.txt" - #-D "TEST_REFERENCE=zip_perf.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) -endif () +add_test (NAME PERFORM_zip_perf_help COMMAND $ "-h") +add_test (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) if (H5_HAVE_PARALLEL) add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) if (HDF5_BUILD_PERFORM_STANDALONE) add_test (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - endif () -endif () + endif (HDF5_BUILD_PERFORM_STANDALONE) +endif (H5_HAVE_PARALLEL) diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c index 5bae832..aceccb0 100644 --- a/tools/test/perform/sio_perf.c +++ b/tools/test/perform/sio_perf.c @@ -100,7 +100,11 @@ static const char *progname = "h5perf_serial"; * It seems that only the options that accept additional information * such as dataset size (-e) require the colon next to it. */ +#if 1 static const char *s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:"; +#else +static const char *s_opts = "a:A:bB:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:wx:X:"; +#endif /* 1 */ static struct long_options l_opts[] = { { "align", require_arg, 'a' }, { "alig", require_arg, 'a' }, -- cgit v0.12 From 4e11e6dd375c26f2dcd35a5b55c7e7fd76069891 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 29 Mar 2017 09:09:51 -0500 Subject: HDFFV-9655 - Add functions for '@' - untested --- src/H5PL.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/src/H5PL.c b/src/H5PL.c index 898e84b..79aa156 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -104,6 +104,13 @@ typedef const void *(*H5PL_get_plugin_info_t)(void); /* Special symbol to indicate no plugin loading */ #define H5PL_NO_PLUGIN "::" +/* Special symbol to indicate relative path from environment */ +#define H5PL_PLUGIN_ENV_SPECIALCHAR '@' + +/* Maximum size for path to executable */ +#ifndef MAX_EXEC_PATH +#define MAX_EXEC_PATH 2048 +#endif /******************/ /* Local Typedefs */ @@ -154,6 +161,7 @@ static H5PL_table_t *H5PL_table_g = NULL; static char *H5PL_path_table_g[H5PL_MAX_PATH_NUM]; static size_t H5PL_num_paths_g = 0; static hbool_t H5PL_path_found_g = FALSE; +static char *H5PL_executable_path_g = NULL; /* Enable all plugin libraries */ static unsigned int H5PL_plugin_g = H5PL_ALL_PLUGIN; @@ -175,6 +183,7 @@ herr_t H5PL__init_package(void) { char *preload_path; + char *tempbuf; FUNC_ENTER_PACKAGE_NOERR @@ -186,6 +195,36 @@ H5PL__init_package(void) if(!HDstrcmp(preload_path, H5PL_NO_PLUGIN)) H5PL_plugin_g = 0; + /* Retrieve the executable path for use with H5PL_PLUGIN_ENV_SPECIALCHAR + * if the user uses it in a plugin path. + */ + if(NULL == (tempbuf = (char *)H5MM_malloc(MAX_EXEC_PATH))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for executable path") +#if defined(_WIN32) || defined(_WIN64) || defined(H5_HAVE_WIN32_API) + const char PathSep = '\\'; + GetModuleFileName(NULL, tempbuf, MAX_EXEC_PATH); +#elif defined(__APPLE__) + const char PathSep = '/'; + uint32_t size = sizeof(result); + _NSGetExecutablePath(tempbuf, &size); +#else + const char PathSep = '/'; + { + ssize_t count = readlink("/proc/self/exe", tempbuf, MAX_EXEC_PATH); + tempbuf[count] = '\0'; + } +#endif + { + char *bs = strrchr(tempbuf, PathSep); + size_t ncopy = MAX_EXEC_PATH; + if (bs) + ncopy = bs - tempbuf; + tempbuf[ncopy] = '\0'; + } + H5PL_executable_path_g = H5MM_strdup(tempbuf); + if(tempbuf) + tempbuf = (char *)H5MM_xfree(tempbuf); + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5PL__init_package() */ @@ -239,6 +278,10 @@ H5PL_term_package(void) n++; } /* end if */ + /* Free the executable path */ + if(H5PL_executable_path_g) + H5PL_executable_path_g = (char *)H5MM_xfree(H5PL_executable_path_g); + /* Mark the interface as uninitialized */ if(0 == n) H5_PKG_INIT_VAR = FALSE; @@ -247,6 +290,31 @@ H5PL_term_package(void) FUNC_LEAVE_NOAPI(n) } /* end H5PL_term_package() */ +static char* +H5PL_env_strdup(const char *plpath) +{ + char *dl_path = NULL; + if(NULL == plpath) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") + if (*plpath == H5PL_PLUGIN_ENV_SPECIALCHAR) { + char *tempbuf; + int ExecPathLength = strlen(H5PL_executable_path_g); + int PluginPathLength = strlen(plpath); + + if(NULL == (tempbuf = (char *)H5MM_malloc(ExecPathLength + PluginPathLength))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin path") + + HDstrncpy(tempbuf, H5PL_executable_path_g, ExecPathLength); + HDstrncpy(tempbuf+ExecPathLength, s+1, PluginPathLength-1); + tempbuf[ExecPathLength + PluginPathLength] = '\0'; + dl_path = H5MM_strdup(tempbuf); + tempbuf = (char *)H5MM_xfree(tempbuf); + } + else + dl_path = H5MM_strdup(plpath); + return dl_path; +} /* end H5PL_env_strdup() */ + /*------------------------------------------------------------------------- * Function: H5PLset_loading_state -- cgit v0.12 From 588e829b740e600484c965e7d2f90913c45de89f Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 30 Mar 2017 12:58:04 -0500 Subject: Remove debugging statements --- src/H5Dmpio.c | 348 +--------------------------------------------------------- 1 file changed, 6 insertions(+), 342 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 100aa97..af5d44b 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -86,12 +86,6 @@ #define H5D_CHUNK_SELECT_IRREG 2 #define H5D_CHUNK_SELECT_NONE 0 -#define PARALLEL_COMPRESS_DEBUG - -#ifdef PARALLEL_COMPRESS_DEBUG -FILE *debug_file; -#endif - /******************/ /* Local Typedefs */ /******************/ @@ -355,10 +349,10 @@ H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, void **_gathered_array, size_t *_gathered_array_num_entries, int (*sort_func)(const void *, const void *)) { - size_t gathered_array_num_entries = 0; + size_t gathered_array_num_entries = 0; /* The size of the newly-constructed array */ size_t i; - void *gathered_array = NULL; - int *receive_counts_array = NULL; /* Array containing number of entries each process contributes */ + void *gathered_array = NULL; /* The newly-constructed array returned to the caller */ + int *receive_counts_array = NULL; /* Array containing number of entries each process is contributing */ int *displacements_array = NULL; /* Array of displacements where each process places its data in the final array */ int mpi_code, mpi_size; int sendcount; @@ -412,18 +406,6 @@ H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, *_gathered_array = gathered_array; *_gathered_array_num_entries = gathered_array_num_entries; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, " Contents of gathered array:\n"); - HDfprintf(debug_file, "------------------------------\n"); - for (size_t j = 0; j < (size_t) gathered_array_num_entries; j++) { - HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); - HDfprintf(debug_file, "| - Chunk Address: %a\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].new_chunk.offset); - HDfprintf(debug_file, "| - Chunk Length: %zd\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].new_chunk.length); - HDfprintf(debug_file, "| - Address of mspace: %x\n", ((H5D_filtered_collective_io_info_t *) gathered_array)[j].chunk_info.mspace); - } - HDfprintf(debug_file, "------------------------------\n\n"); -#endif - done: if (receive_counts_array) H5MM_free(receive_counts_array); @@ -916,31 +898,11 @@ H5D__chunk_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_ FUNC_ENTER_PACKAGE -#ifdef PARALLEL_COMPRESS_DEBUG - char name[10]; - - snprintf(name, 10, "out - %d", H5F_mpi_get_rank(io_info->dset->oloc.file)); - - debug_file = fopen(name, "a"); - - HDfprintf(debug_file, "**************************\n"); - HDfprintf(debug_file, "* Starting write\n"); - HDfprintf(debug_file, "**************************\n\n"); -#endif - /* Call generic selection operation */ if(H5D__chunk_collective_io(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") done: -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "**************************\n"); - HDfprintf(debug_file, "* Finished write\n"); - HDfprintf(debug_file, "**************************\n\n"); - - fclose(debug_file); -#endif - FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_collective_write() */ @@ -1367,16 +1329,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't construct filtered I/O info list") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Incoming messages from other processes:\n"); - HDfprintf(debug_file, "-----------------------------------------\n"); - for (size_t j = 0; j < chunk_list_num_entries; j++) { - HDfprintf(debug_file, "| Owner of chunk at address %a is expecting messages from %d other processes.\n", - chunk_list[j].old_chunk.offset, chunk_list[j].num_writers - 1); - } - HDfprintf(debug_file, "-----------------------------------------\n\n"); -#endif - if (io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ H5D_chk_idx_info_t index_info; H5D_chunk_ud_t udata; @@ -1394,12 +1346,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in udata.common.storage = index_info.storage; udata.filter_mask = 0; - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Processing chunks:\n"); - HDfprintf(debug_file, "---------------------------------------------------\n"); -#endif - /* Iterate through all the chunks in the collective write operation, * updating each chunk with the data modifications from other processes, * then re-filtering the chunk. @@ -1408,10 +1354,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "---------------------------------------------------\n\n"); -#endif - /* Gather the new chunk sizes to all processes for a collective reallocation * of the chunks in the file. */ @@ -1419,32 +1361,15 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Reallocing chunks:\n"); - HDfprintf(debug_file, "------------------------------\n"); -#endif - /* Collectively re-allocate the modified chunks (from each process) in the file */ for (i = 0; i < collective_chunk_list_num_entries; i++) { hbool_t insert; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Reallocing chunk at address %a with new length of %zd.\n", collective_chunk_list[i].new_chunk.offset, collective_chunk_list[i].new_chunk.length); -#endif - if (H5D__chunk_file_alloc(&index_info, &collective_chunk_list[i].old_chunk, &collective_chunk_list[i].new_chunk, &insert, collective_chunk_list[i].chunk_info.scaled) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Chunk now at address %a.\n|\n", collective_chunk_list[i].new_chunk); -#endif } /* end for */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "------------------------------\n\n"); -#endif - if (NULL == (num_chunks_selected_array = (size_t *) H5MM_malloc((size_t) mpi_size * sizeof(*num_chunks_selected_array)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate num chunks selected array") @@ -1452,15 +1377,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in 1, MPI_UNSIGNED_LONG_LONG, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, " Num Chunks Selected Array\n"); - HDfprintf(debug_file, "------------------------------------\n"); - for (size_t j = 0; j < (size_t) mpi_size; j++) { - HDfprintf(debug_file, "| Process %d has %zd chunks selected.\n", j, num_chunks_selected_array[j]); - } - HDfprintf(debug_file, "------------------------------------\n\n"); -#endif - /* If this process has any chunks selected, create a MPI type for collectively * writing out the chunks to file. Otherwise, the process contributes to the * collective write with a none type. @@ -1508,31 +1424,14 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* Participate in the collective re-insertion of all chunks modified * in this iteration into the chunk index */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Reinserting chunks into chunk index.\n"); - HDfprintf(debug_file, "---------------------------------------\n"); -#endif - for (i = 0; i < collective_chunk_list_num_entries; i++) { udata.chunk_block = collective_chunk_list[i].new_chunk; udata.common.scaled = collective_chunk_list[i].chunk_info.scaled; udata.chunk_idx = collective_chunk_list[i].chunk_info.index; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Reinserting chunk at index %llu.\n", udata.chunk_idx); -#endif - if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Successfully inserted chunk at address %a into the chunk index at index %llu.\n", udata.chunk_block.offset, udata.chunk_idx); -#endif } /* end for */ - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "---------------------------------------\n"); -#endif } /* end if */ done: @@ -1882,7 +1781,6 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i io_info->store = &store; if (io_info->op_type == H5D_IO_OP_READ) { /* Filtered collective read */ - /* XXX: Test with MPI types and collective read to improve performance */ for (i = 0; i < chunk_list_num_entries; i++) if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't process chunk entry") @@ -1905,19 +1803,6 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i udata.common.storage = index_info.storage; udata.filter_mask = 0; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Incoming messages from other processes:\n"); - HDfprintf(debug_file, "-----------------------------------------\n"); - for (size_t k = 0; k < chunk_list_num_entries; k++) { - HDfprintf(debug_file, "| Owner of chunk at address %a is expecting messages from %d other processes.\n", - chunk_list[k].old_chunk.offset, chunk_list[k].num_writers - 1); - } - HDfprintf(debug_file, "-----------------------------------------\n\n"); - - HDfprintf(debug_file, "Processing chunks:\n"); - HDfprintf(debug_file, "---------------------------------------------------\n"); -#endif - /* Retrieve the maximum number of chunks being written among all processes */ if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&chunk_list_num_entries, &max_num_chunks, 1, MPI_UNSIGNED_LONG_LONG, MPI_MAX, io_info->comm))) @@ -1960,35 +1845,17 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Reallocing chunks:\n"); - HDfprintf(debug_file, "------------------------------\n"); -#endif - /* Participate in the collective re-allocation of all chunks modified * in this iteration. */ for (j = 0; j < collective_chunk_list_num_entries; j++) { hbool_t insert = FALSE; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Re-allocing chunk at address %a with new length of %llu bytes.\n", - collective_chunk_list[j].new_chunk.offset, collective_chunk_list[j].new_chunk.length); -#endif - if (H5D__chunk_file_alloc(&index_info, &collective_chunk_list[j].old_chunk, &collective_chunk_list[j].new_chunk, &insert, chunk_list[j].chunk_info.scaled) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Chunk now at address %a.\n|\n", collective_chunk_list[j].new_chunk); -#endif } /* end for */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "------------------------------\n\n"); -#endif - if (NULL == (has_chunk_selected_array = (hbool_t *) H5MM_malloc((size_t) mpi_size * sizeof(*has_chunk_selected_array)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate num chunks selected array") @@ -2010,11 +1877,6 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i * collective array gets updated by the chunk re-allocation */ HDmemcpy(&chunk_list[i].new_chunk, &collective_chunk_list[offset].new_chunk, sizeof(chunk_list[i].new_chunk)); -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "New chunk record after memcpy back to local:\n"); - HDfprintf(debug_file, " - Chunk offset: %a, Chunk length: %lld\n", chunk_list[i].new_chunk.offset, chunk_list[i].new_chunk.length); -#endif - H5_CHECKED_ASSIGN(mpi_type_count, int, chunk_list[i].new_chunk.length, hsize_t); /* Create MPI memory type for writing to chunk */ @@ -2053,32 +1915,15 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Participate in the collective re-insertion of all chunks modified * in this iteration into the chunk index */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "Reinserting chunks into chunk index.\n"); - HDfprintf(debug_file, "---------------------------------------\n"); -#endif - for (j = 0; j < collective_chunk_list_num_entries; j++) { udata.chunk_block = collective_chunk_list[j].new_chunk; udata.common.scaled = collective_chunk_list[j].chunk_info.scaled; udata.chunk_idx = collective_chunk_list[j].chunk_info.index; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Reinserting chunk at index %llu.\n", udata.chunk_idx); -#endif - if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Successfully inserted chunk at address %a into the chunk index at index %llu.\n", udata.chunk_block.offset, udata.chunk_idx); -#endif } /* end for */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "---------------------------------------\n"); -#endif - if (collective_chunk_list){ H5MM_free(collective_chunk_list); collective_chunk_list = NULL; @@ -2714,8 +2559,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ { H5D_filtered_collective_io_info_t *local_info_array = NULL; /* The list of initially select chunks for this process */ H5D_filtered_collective_io_info_t *overlap_info_array = NULL; /* The list of all chunks selected in the operation by all processes */ - /* H5D_mpio_filtered_write_mode_t filtered_write_mode = H5D_MPIO_UNSAFE_FILTERED_WRITE; */ - /* H5P_genplist_t *dx_plist; */ H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__gather_mem */ unsigned char *mod_data = NULL; /* Chunk modification data sent by a process to a chunk's owner */ H5SL_node_t *chunk_node; @@ -2779,50 +2622,8 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ } /* end for */ } /* end if */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, " Contents of local info array\n"); - HDfprintf(debug_file, "------------------------------\n"); - for (size_t j = 0; j < (size_t) num_chunks_selected; j++) { - HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); - HDfprintf(debug_file, "| - Chunk Address: %a\n", local_info_array[j].old_chunk.offset); - HDfprintf(debug_file, "| - Chunk Length: %zd\n", local_info_array[j].old_chunk.length); - HDfprintf(debug_file, "| - Address of mspace: %x\n", local_info_array[j].chunk_info.mspace); - HDfprintf(debug_file, "| - Chunk Selection Type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.mspace)); - HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); - HDfprintf(debug_file, "| - Chunk write status: %s\n", (local_info_array[j].full_overwrite) ? "overwrite" : "update"); - } - HDfprintf(debug_file, "------------------------------\n\n"); - - HDfprintf(debug_file, "Testing mem/file space addresses:\n"); - HDfprintf(debug_file, "-----------------------------------\n"); - - for (size_t j = 0; j < num_chunks_selected; j++) { - HDfprintf(debug_file, "| Testing chunk at address %a.\n", local_info_array[j].old_chunk.offset); - HDfprintf(debug_file, "| Mem Space:\n"); - HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(local_info_array[j].chunk_info.mspace)); - HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(local_info_array[j].chunk_info.mspace)); - HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.mspace)); - HDfprintf(debug_file, "| - Selection type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.mspace)); - HDfprintf(debug_file, "| File Space:\n"); - HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(local_info_array[j].chunk_info.fspace)); - HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(local_info_array[j].chunk_info.fspace)); - HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.fspace)); - HDfprintf(debug_file, "| - Selection type: %d\n|\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.fspace)); - } - - HDfprintf(debug_file, "-----------------------------------\n\n"); -#endif - - /* XXX: Add SAFE_FILTERED_CHUNK_WRITE to property lists */ - /* Get the no overlap property */ - /* if (NULL == (dx_plist = (H5P_genplist_t *) H5I_object(io_info->raw_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") - - if (H5P_get(dx_plist, H5D_MPIO_FILTERED_WRITE_MODE, &filtered_write_mode)) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "couldn't get filtered chunk write mode property") */ - /* Redistribute shared chunks to new owners as necessary */ - if (io_info->op_type == H5D_IO_OP_WRITE /* && (filtered_write_mode != H5D_MPIO_SAFE_FILTERED_WRITE) */) { + if (io_info->op_type == H5D_IO_OP_WRITE) { if (num_chunks_selected) if (NULL == (send_requests = (MPI_Request *) H5MM_malloc(num_chunks_selected * sizeof(*send_requests)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send requests buffer") @@ -2920,10 +2721,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ mod_data_size += (size_t) iter_nelmts * type_info->src_type_size; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Allocing %zd bytes for mod. data buffer.\n", (size_t) mod_data_size); -#endif - if (NULL == (mod_data = (unsigned char *) H5MM_malloc(mod_data_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification send buffer") @@ -2937,27 +2734,11 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") mem_iter_init = TRUE; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Iterating over %lld elements.\n", iter_nelmts); -#endif - /* Collect the modification data into the buffer */ if (!H5D__gather_mem(io_info->u.wbuf, chunk_entry.chunk_info.mspace, mem_iter, (size_t) iter_nelmts, io_info->dxpl_cache, mod_data_p)) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't gather from write buffer") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Mod. Data Buffer:\n"); - HDfprintf(debug_file, "| - ["); - for (size_t j = 0; j < (size_t) iter_nelmts; j++) { - if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) mod_data_p)[j]); - } - HDfprintf(debug_file, "]\n|\n"); - - HDfprintf(debug_file, "| Sending modification data for chunk at address %a to process %d.\n", chunk_entry.old_chunk.offset, new_owner); -#endif - /* Send modification data to new owner */ H5_CHECK_OVERFLOW(mod_data_size, size_t, int) H5_CHECK_OVERFLOW(chunk_entry.chunk_info.index, hsize_t, int) @@ -2965,9 +2746,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ (int) chunk_entry.chunk_info.index, io_info->comm, &send_requests[num_send_requests++]))) HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Mod. data sent.\n|\n"); -#endif if (mod_data) { H5MM_free(mod_data); mod_data = NULL; @@ -2976,10 +2754,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") mem_iter_init = FALSE; } /* end else */ - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Chunk at address %a re-assigned to process %d.\n|\n", chunk_addr, new_owner); -#endif } /* end for */ /* Release old list */ @@ -2988,29 +2762,13 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Local info list becomes modified (redistributed) chunk list */ local_info_array = overlap_info_array; - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "This process now has %d chunks selected after redistribution.\n\n", num_chunks_selected); - - HDfprintf(debug_file, " Contents of local info array (after redistribution)\n"); - HDfprintf(debug_file, "------------------------------\n"); - for (size_t j = 0; j < (size_t) num_chunks_selected; j++) { - HDfprintf(debug_file, "| Chunk Entry %zd:\n", j); - HDfprintf(debug_file, "| - Chunk Address: %a\n", local_info_array[j].old_chunk.offset); - HDfprintf(debug_file, "| - Chunk Length: %zd\n", local_info_array[j].old_chunk.length); - HDfprintf(debug_file, "| - Address of mspace: %x\n", local_info_array[j].chunk_info.fspace); - HDfprintf(debug_file, "| - Chunk Selection Type: %d\n", H5S_GET_SELECT_TYPE(local_info_array[j].chunk_info.fspace)); - HDfprintf(debug_file, "| - Chunk Num Elmts Sel.: %zd\n", H5S_GET_SELECT_NPOINTS(local_info_array[j].chunk_info.fspace)); - } - HDfprintf(debug_file, "------------------------------\n\n"); -#endif } /* end if */ *chunk_list = local_info_array; *num_entries = num_chunks_selected; /* Wait for all async send requests to complete before returning */ - if (/* (filtered_write_mode != H5D_MPIO_SAFE_FILTERED_WRITE) && */ num_send_requests) { + if (num_send_requests) { if (NULL == (send_statuses = (MPI_Status *) H5MM_malloc(num_send_requests * sizeof(*send_statuses)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send statuses buffer") @@ -3086,11 +2844,6 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun /* Ensure the list is sorted in ascending order of offset in the file */ HDqsort(chunk_list, num_entries, sizeof(*chunk_list), H5D__cmp_filtered_collective_io_info_entry); -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "MPI Write type entries:\n"); - HDfprintf(debug_file, "---------------------------------\n"); -#endif - base_buf = chunk_list[0].buf; for (i = 0; i < num_entries; i++) { /* Set up the offset in the file, the length of the chunk data, and the relative @@ -3099,22 +2852,8 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun file_offset_array[i] = (MPI_Aint) chunk_list[i].new_chunk.offset; length_array[i] = (int) chunk_list[i].new_chunk.length; write_buf_array[i] = (MPI_Aint) chunk_list[i].buf - (MPI_Aint) base_buf; - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Type Entry %zd:\n", i); - HDfprintf(debug_file, "| - Offset: %a; Length: %zd\n", file_offset_array[i], length_array[i]); - HDfprintf(debug_file, "| - Write buffer:\n| ["); - for (size_t j = 0; j < (size_t) length_array[i]; j++) { - HDfprintf(debug_file, "%c, ", ((char *) chunk_list[i].buf)[j]); - } - HDfprintf(debug_file, "]\n|\n"); -#endif } /* end for */ -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "---------------------------------\n\n"); -#endif - /* Create memory MPI type */ if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int) num_entries, length_array, write_buf_array, MPI_BYTE, new_mem_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) @@ -3179,10 +2918,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HDassert(io_info); HDassert(type_info); -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Chunk at address %a:\n", chunk_entry->old_chunk.offset); -#endif - /* If this is a read operation or a write operation where the chunk is not being fully * overwritten, enough memory must be allocated to read the filtered chunk from the file. * If this is a write operation where the chunk is being fully overwritten, enough memory @@ -3202,12 +2937,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk chunk_entry->new_chunk.length = buf_size; -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Allocing %zd bytes for chunk data buffer.\n", buf_size); - if (io_info->op_type == H5D_IO_OP_WRITE) - HDfprintf(debug_file, "| - Write type is: %s.\n", (chunk_entry->full_overwrite) ? "overwrite" : "update"); -#endif - if (NULL == (chunk_entry->buf = H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk data buffer") @@ -3215,6 +2944,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk * read from the file and unfiltered. */ if (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) { + /* XXX: Test with MPI types and collective read to improve performance */ if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_entry->old_chunk.offset, buf_size, H5AC_rawdata_dxpl_id, chunk_entry->buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") @@ -3223,19 +2953,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, (size_t *) &chunk_entry->new_chunk.length, &buf_size, &chunk_entry->buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "couldn't unfilter chunk for modifying") - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Read chunk from file.\n"); - - HDfprintf(debug_file, "| - After decompression: Nbytes=%zd; Buf_size=%zd.\n", chunk_entry->new_chunk.length, buf_size); - - HDfprintf(debug_file, "| - Read buf:\n| - ["); - for (size_t j = 0; j < chunk_entry->new_chunk.length / type_info->src_type_size; j++) { - if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) chunk_entry->buf)[j]); - } - HDfprintf(debug_file, "]\n|\n"); -#endif } /* end if */ /* Initialize iterator for memory selection */ @@ -3307,52 +3024,26 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk io_info->comm, &status))) HMPI_GOTO_ERROR(FAIL, "MPI_Probe failed", mpi_code) -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Found message from source %d with tag %d.\n", status.MPI_SOURCE, status.MPI_TAG); -#endif - /* Retrieve the message size */ if (MPI_SUCCESS != (mpi_code = MPI_Get_count(&status, MPI_BYTE, &count))) HMPI_GOTO_ERROR(FAIL, "MPI_Get_count failed", mpi_code) -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Message size is %d bytes.\n", count); -#endif - if ((size_t) count > mod_data_alloced_bytes) { if (NULL == (mod_data = (unsigned char *) H5MM_realloc(mod_data, (size_t) count))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate modification data receive buffer") mod_data_alloced_bytes = (size_t) count; - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Re-alloced buffer.\n"); - HDfprintf(debug_file, "| - New size is: %zu.\n", mod_data_alloced_bytes); -#endif } if (MPI_SUCCESS != (mpi_code = MPI_Recv(mod_data, count, MPI_BYTE, MPI_ANY_SOURCE, (int) chunk_entry->chunk_info.index, io_info->comm, &status))) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mpi_code) -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Received the message.\n"); -#endif - /* Decode the process' chunk file dataspace */ mod_data_p = mod_data; if (NULL == (dataspace = H5S_decode(&mod_data_p))) HGOTO_ERROR(H5E_DATASET, H5E_CANTDECODE, FAIL, "unable to decode dataspace") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Deserialized selection info:\n"); - HDfprintf(debug_file, "| Mem Space:\n"); - HDfprintf(debug_file, "| - Extent Num elements: %zd\n", H5S_GET_EXTENT_NPOINTS(dataspace)); - HDfprintf(debug_file, "| - Extent type: %d\n", H5S_GET_EXTENT_TYPE(dataspace)); - HDfprintf(debug_file, "| - Selection Num elements: %zd\n", H5S_GET_SELECT_NPOINTS(dataspace)); - HDfprintf(debug_file, "| - Selection type: %d\n", H5S_GET_SELECT_TYPE(dataspace)); -#endif - if (H5S_select_iter_init(mem_iter, dataspace, type_info->dst_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") mem_iter_init = TRUE; @@ -3360,20 +3051,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(dataspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Contents of message:\n| ["); - for (size_t j = 0; j < (size_t) iter_nelmts; j++) { - if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((const long *) mod_data_p)[j]); - } - HDfprintf(debug_file, "]\n"); -#endif - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| Iter nelmts=%lld.\n", iter_nelmts); - HDfprintf(debug_file, "| Mem space selected points: %zd.\n| \n", H5S_GET_SELECT_NPOINTS(dataspace)); -#endif - /* Update the chunk data with the received modification data */ if (H5D__scatter_mem(mod_data_p, dataspace, mem_iter, (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf) < 0) @@ -3391,19 +3068,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk } } /* end while */ - -#ifdef PARALLEL_COMPRESS_DEBUG - HDfprintf(debug_file, "| - Chunk Data Buffer:\n"); - HDfprintf(debug_file, "| - ["); - for (size_t j = 0; j < chunk_entry->new_chunk.length / type_info->src_type_size; j++) { - if (j > 0) HDfprintf(debug_file, ", "); - HDfprintf(debug_file, "%lld", ((long *) chunk_entry->buf)[j]); - } - HDfprintf(debug_file, "]\n|\n"); - - HDfprintf(debug_file, "| - About to filter %zd bytes in buffer of size %zd.\n|\n", chunk_entry->new_chunk.length, buf_size); -#endif - /* Filter the chunk */ if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, -- cgit v0.12 From a513e5bf84282a62e725f6de5b8eb229ea36e99d Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 30 Mar 2017 13:29:11 -0500 Subject: Add comments to H5D_filtered_collective_io_info_t data structure Correct comment and error message about retrieving the threshold for performing either Linked-chunk or Multi-chunk I/O --- src/H5Dmpio.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index af5d44b..583abfd 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -95,16 +95,16 @@ typedef struct H5D_chunk_addr_info_t { H5D_chunk_info_t chunk_info; } H5D_chunk_addr_info_t; -/* Information about a chunk when performing collective filtered IO */ +/* Information about a single chunk when performing collective filtered IO */ typedef struct H5D_filtered_collective_io_info_t { - H5D_chunk_info_t chunk_info; - H5F_block_t old_chunk; - H5F_block_t new_chunk; - hbool_t full_overwrite; - size_t io_size; - size_t num_writers; - int owner; - void *buf; + H5D_chunk_info_t chunk_info; /* Info about this chunk, such as chunk index and file and memory dataspace */ + H5F_block_t old_chunk; /* The address in the file and size of this chunk before being filtered */ + H5F_block_t new_chunk; /* The address in the file and size of this chunk after being filtered */ + hbool_t full_overwrite; /* Whether or not this chunk is being fully overwritten */ + size_t io_size; /* Size of the I/O to this chunk */ + size_t num_writers; /* Total number of processes writing to this chunk */ + int owner; /* Process which will be writing to this chunk */ + void *buf; /* Chunk data to be written to file/that has been read from file*/ } H5D_filtered_collective_io_info_t; /********************/ @@ -738,9 +738,9 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") - /* Get the chunk optimization option */ + /* Get the chunk optimization option threshold */ if(H5P_get(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, &one_link_chunk_io_threshold) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't get chunk optimization option") + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't get chunk optimization option threshold value") /* step 1: choose an IO option */ /* If the average number of chunk per process is greater than a threshold, we will do one link chunked IO. */ -- cgit v0.12 From 1488ed344e6c9696a416a0dd23f19c8e70a2a9e8 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 30 Mar 2017 13:40:10 -0500 Subject: Updated comments changed variable name for list containing all chunks in the I/O operation --- src/H5Dmpio.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 583abfd..c3a015d 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -331,8 +331,8 @@ done: /*------------------------------------------------------------------------- * Function: H5D__mpio_array_gather * - * Purpose: Given arrays by MPI ranks, gathers them into a single large - * array which is then distributed back to all ranks. If the + * Purpose: Given arrays by MPI ranks, gathers them into a single array + * which is then distributed back to all ranks. If the * sort_func argument is specified, the list is sorted before * being returned. * @@ -1275,9 +1275,6 @@ if(H5DEBUG(D)) * E. Perform the collective write * F. All processes collectively re-insert each modified * chunk from the gathered array into the chunk index - * 3. If the operation is a read operation - * A. Loop through each chunk in the operation - * I. * * * Return: Non-negative on success/Negative on failure @@ -1414,7 +1411,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in mpi_buf_count = (mem_type_is_derived && file_type_is_derived) ? (hsize_t) 1 : (hsize_t) 0; /* Set up the base storage address for this operation */ - ctg_store.contig.dset_addr = 0; + ctg_store.contig.dset_addr = 0; /* Write address must be set to address 0 */ io_info->store = &ctg_store; /* Perform I/O */ @@ -2558,7 +2555,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ const H5D_chunk_map_t *fm, H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries) { H5D_filtered_collective_io_info_t *local_info_array = NULL; /* The list of initially select chunks for this process */ - H5D_filtered_collective_io_info_t *overlap_info_array = NULL; /* The list of all chunks selected in the operation by all processes */ + H5D_filtered_collective_io_info_t *shared_chunks_info_array = NULL; /* The list of all chunks selected in the operation by all processes */ H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__gather_mem */ unsigned char *mod_data = NULL; /* Chunk modification data sent by a process to a chunk's owner */ H5SL_node_t *chunk_node; @@ -2567,7 +2564,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ hbool_t mem_iter_init = FALSE; size_t num_send_requests = 0; size_t num_chunks_selected; - size_t overlap_info_array_num_entries; + size_t shared_chunks_info_array_num_entries; size_t i; int mpi_rank, mpi_size, mpi_code; herr_t ret_value = SUCCEED; @@ -2632,13 +2629,13 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") if (H5D__mpio_array_gather(io_info, local_info_array, num_chunks_selected, - sizeof(*local_info_array), (void **) &overlap_info_array, &overlap_info_array_num_entries, + sizeof(*local_info_array), (void **) &shared_chunks_info_array, &shared_chunks_info_array_num_entries, H5D__cmp_filtered_collective_io_info_entry) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather array") - for (i = 0, num_chunks_selected = 0, num_send_requests = 0; i < overlap_info_array_num_entries;) { + for (i = 0, num_chunks_selected = 0, num_send_requests = 0; i < shared_chunks_info_array_num_entries;) { H5D_filtered_collective_io_info_t chunk_entry; - haddr_t chunk_addr = overlap_info_array[i].old_chunk.offset; + haddr_t chunk_addr = shared_chunks_info_array[i].old_chunk.offset; size_t total_io_size = 0; size_t num_writers = 0; size_t max_bytes = 0; @@ -2662,22 +2659,22 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ * contributed will be the only one with a valid dataspace selection * on that particular process */ - if (mpi_rank == overlap_info_array[i].owner) - chunk_entry = overlap_info_array[i]; + if (mpi_rank == shared_chunks_info_array[i].owner) + chunk_entry = shared_chunks_info_array[i]; /* Add this chunk entry's IO size to the running total */ - total_io_size += overlap_info_array[i].io_size; + total_io_size += shared_chunks_info_array[i].io_size; /* New owner of the chunk is determined by the process * which is writing the most data to the chunk */ - if (overlap_info_array[i].io_size > max_bytes) { - max_bytes = overlap_info_array[i].io_size; - new_owner = overlap_info_array[i].owner; + if (shared_chunks_info_array[i].io_size > max_bytes) { + max_bytes = shared_chunks_info_array[i].io_size; + new_owner = shared_chunks_info_array[i].owner; } num_writers++; - } while (++i < overlap_info_array_num_entries && overlap_info_array[i].old_chunk.offset == chunk_addr); + } while (++i < shared_chunks_info_array_num_entries && shared_chunks_info_array[i].old_chunk.offset == chunk_addr); if (mpi_rank == new_owner) { hssize_t chunk_npoints; @@ -2700,7 +2697,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ chunk_entry.full_overwrite = (total_io_size >= (hsize_t) chunk_npoints * type_info->dst_type_size) ? TRUE : FALSE; /* New owner takes possession of the chunk */ - overlap_info_array[num_chunks_selected++] = chunk_entry; + shared_chunks_info_array[num_chunks_selected++] = chunk_entry; } /* end if */ else if (chunk_entry.chunk_info.fspace) { unsigned char *mod_data_p = NULL; /* Use second pointer since H5S_encode advances pointer */ @@ -2761,7 +2758,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ H5MM_free(local_info_array); /* Local info list becomes modified (redistributed) chunk list */ - local_info_array = overlap_info_array; + local_info_array = shared_chunks_info_array; } /* end if */ *chunk_list = local_info_array; -- cgit v0.12 From bbc9f1be45539241673942d347beced6da9a5fc5 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Sun, 9 Apr 2017 16:36:19 -0500 Subject: Make array_gather routine more general --- src/H5Dmpio.c | 111 ++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 66 insertions(+), 45 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index c3a015d..826407e 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -145,10 +145,9 @@ static herr_t H5D__mpio_get_sum_chunk(const H5D_io_info_t *io_info, static herr_t H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm, H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries); -static herr_t H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, - size_t local_array_num_entries, size_t array_entry_size, - void **gathered_array, size_t *gathered_array_num_entries, - int (*sort_func)(const void *, const void *)); +static herr_t H5D__mpio_array_gatherv(void *local_array, size_t local_array_num_entries, + size_t array_entry_size, void **gathered_array, size_t *gathered_array_num_entries, + int nprocs, hbool_t allgather, int root, MPI_Comm comm, int (*sort_func)(const void *, const void *)); static herr_t H5D__mpio_filtered_collective_write_type( H5D_filtered_collective_io_info_t *chunk_list, size_t num_entries, MPI_Datatype *new_mem_type, hbool_t *mem_type_derived, @@ -329,46 +328,44 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__mpio_array_gather + * Function: H5D__mpio_array_gatherv * * Purpose: Given arrays by MPI ranks, gathers them into a single array - * which is then distributed back to all ranks. If the - * sort_func argument is specified, the list is sorted before - * being returned. + * which is either gathered to the rank specified by root when + * allgather is false, or is distributed back to all ranks + * when allgather is true. If the sort_func argument is + * specified, the list is sorted before being returned. + * + * If allgather is specified as true, root is ignored. * * Return: Non-negative on success/Negative on failure * * Programmer: Jordan Henderson - * Friday, January 6th, 2016 + * Sunday, April 9th, 2017 * *------------------------------------------------------------------------- */ static herr_t -H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, - size_t local_array_num_entries, size_t array_entry_size, - void **_gathered_array, size_t *_gathered_array_num_entries, - int (*sort_func)(const void *, const void *)) +H5D__mpio_array_gatherv(void *local_array, size_t local_array_num_entries, + size_t array_entry_size, void **_gathered_array, size_t *_gathered_array_num_entries, + int nprocs, hbool_t allgather, int root, MPI_Comm comm, int (*sort_func)(const void *, const void *)) { size_t gathered_array_num_entries = 0; /* The size of the newly-constructed array */ size_t i; void *gathered_array = NULL; /* The newly-constructed array returned to the caller */ int *receive_counts_array = NULL; /* Array containing number of entries each process is contributing */ int *displacements_array = NULL; /* Array of displacements where each process places its data in the final array */ - int mpi_code, mpi_size; + int mpi_code; int sendcount; herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC - HDassert(io_info); HDassert(_gathered_array); HDassert(_gathered_array_num_entries); - if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) - HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") - /* Determine the size of the end result array */ - if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&local_array_num_entries, &gathered_array_num_entries, 1, MPI_INT, MPI_SUM, io_info->comm))) + if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&local_array_num_entries, &gathered_array_num_entries, 1, MPI_INT, MPI_SUM, comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) /* If 0 entries resulted from the collective operation, no one is writing anything */ @@ -376,29 +373,37 @@ H5D__mpio_array_gather(const H5D_io_info_t *io_info, void *local_array, if (NULL == (gathered_array = H5MM_malloc(gathered_array_num_entries * array_entry_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate gathered array") - if (NULL == (receive_counts_array = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*receive_counts_array)))) + if (NULL == (receive_counts_array = (int *) H5MM_malloc((size_t) nprocs * sizeof(*receive_counts_array)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate receive counts array") - if (NULL == (displacements_array = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*displacements_array)))) + if (NULL == (displacements_array = (int *) H5MM_malloc((size_t) nprocs * sizeof(*displacements_array)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate receive displacements array") /* Inform each process of how many entries each other process is contributing to the resulting array */ - if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&local_array_num_entries, 1, MPI_INT, receive_counts_array, 1, MPI_INT, io_info->comm))) + if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&local_array_num_entries, 1, MPI_INT, receive_counts_array, 1, MPI_INT, comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allgather failed", mpi_code) /* Multiply each receive count by the size of the array entry, since the data is sent as bytes */ - for (i = 0; i < (size_t) mpi_size; i++) + for (i = 0; i < (size_t) nprocs; i++) H5_CHECKED_ASSIGN(receive_counts_array[i], int, (size_t) receive_counts_array[i] * array_entry_size, size_t); /* Set receive buffer offsets for MPI_Allgatherv */ displacements_array[0] = 0; - for (i = 1; i < (size_t) mpi_size; i++) + for (i = 1; i < (size_t) nprocs; i++) displacements_array[i] = displacements_array[i - 1] + receive_counts_array[i - 1]; H5_CHECKED_ASSIGN(sendcount, int, local_array_num_entries * array_entry_size, size_t); - if (MPI_SUCCESS != (mpi_code = MPI_Allgatherv(local_array, sendcount, MPI_BYTE, - gathered_array, receive_counts_array, displacements_array, MPI_BYTE, io_info->comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Allgatherv failed", mpi_code) + + if (allgather) { + if (MPI_SUCCESS != (mpi_code = MPI_Allgatherv(local_array, sendcount, MPI_BYTE, + gathered_array, receive_counts_array, displacements_array, MPI_BYTE, comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Allgatherv failed", mpi_code) + } + else { + if (MPI_SUCCESS != (mpi_code = MPI_Gatherv(local_array, sendcount, MPI_BYTE, + gathered_array, receive_counts_array, displacements_array, MPI_BYTE, root, comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Allgatherv failed", mpi_code) + } if (sort_func) HDqsort(gathered_array, gathered_array_num_entries, array_entry_size, sort_func); } /* end if */ @@ -413,7 +418,7 @@ done: H5MM_free(displacements_array); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__mpio_array_gather() */ +} /* end H5D__mpio_array_gatherv() */ /*------------------------------------------------------------------------- @@ -1354,8 +1359,9 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* Gather the new chunk sizes to all processes for a collective reallocation * of the chunks in the file. */ - if (H5D__mpio_array_gather(io_info, chunk_list, chunk_list_num_entries, sizeof(*chunk_list), - (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) + if (H5D__mpio_array_gatherv(chunk_list, chunk_list_num_entries, sizeof(*chunk_list), + (void **) &collective_chunk_list, &collective_chunk_list_num_entries, mpi_size, + true, 0, io_info->comm, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") /* Collectively re-allocate the modified chunks (from each process) in the file */ @@ -1838,8 +1844,9 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Gather the new chunk sizes to all processes for a collective re-allocation * of the chunks in the file */ - if (H5D__mpio_array_gather(io_info, &chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(*chunk_list), - (void **) &collective_chunk_list, &collective_chunk_list_num_entries, NULL) < 0) + if (H5D__mpio_array_gatherv(io_info, &chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(*chunk_list), + (void **) &collective_chunk_list, &collective_chunk_list_num_entries, mpi_size, + true, 0, io_info->comm, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") /* Participate in the collective re-allocation of all chunks modified @@ -2628,9 +2635,9 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(H5S_sel_iter_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") - if (H5D__mpio_array_gather(io_info, local_info_array, num_chunks_selected, - sizeof(*local_info_array), (void **) &shared_chunks_info_array, &shared_chunks_info_array_num_entries, - H5D__cmp_filtered_collective_io_info_entry) < 0) + if (H5D__mpio_array_gather(local_info_array, num_chunks_selected, sizeof(*local_info_array), + (void **) &shared_chunks_info_array, &shared_chunks_info_array_num_entries, mpi_size, + false, 0, H5D__cmp_filtered_collective_io_info_entry) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather array") for (i = 0, num_chunks_selected = 0, num_send_requests = 0; i < shared_chunks_info_array_num_entries;) { @@ -2753,27 +2760,41 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ } /* end else */ } /* end for */ + /* Rank 0 redistributes any shared chunks to new owners as necessary */ + if (mpi_rank == 0) { + + } + /* Release old list */ if (local_info_array) H5MM_free(local_info_array); /* Local info list becomes modified (redistributed) chunk list */ local_info_array = shared_chunks_info_array; + + /* Now that the chunks have been redistributed, each process must send its modification data + * to the new owners of any of the chunks it previously possessed + */ + for (i = 0; i < num_chunks_selected; i++) { + if (mpi_rank != local_info_array[i].owner) { + + } + } /* end for */ + + /* Wait for all async send requests to complete before returning */ + if (num_send_requests) { + if (NULL == (send_statuses = (MPI_Status *) H5MM_malloc(num_send_requests * sizeof(*send_statuses)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send statuses buffer") + + H5_CHECK_OVERFLOW(num_send_requests, size_t, int); + if (MPI_SUCCESS != (mpi_code = MPI_Waitall((int) num_send_requests, send_requests, send_statuses))) + HMPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code) + } } /* end if */ *chunk_list = local_info_array; *num_entries = num_chunks_selected; - /* Wait for all async send requests to complete before returning */ - if (num_send_requests) { - if (NULL == (send_statuses = (MPI_Status *) H5MM_malloc(num_send_requests * sizeof(*send_statuses)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send statuses buffer") - - H5_CHECK_OVERFLOW(num_send_requests, size_t, int); - if (MPI_SUCCESS != (mpi_code = MPI_Waitall((int) num_send_requests, send_requests, send_statuses))) - HMPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code) - } - done: if (send_requests) H5MM_free(send_requests); -- cgit v0.12 From 8a454e941c2c5b9e5d6a4af6f5464d32018cdd90 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Sun, 9 Apr 2017 16:54:51 -0500 Subject: Correct error with usage of array_gather function --- src/H5Dmpio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 826407e..287ac25 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1844,7 +1844,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Gather the new chunk sizes to all processes for a collective re-allocation * of the chunks in the file */ - if (H5D__mpio_array_gatherv(io_info, &chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(*chunk_list), + if (H5D__mpio_array_gatherv(&chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(*chunk_list), (void **) &collective_chunk_list, &collective_chunk_list_num_entries, mpi_size, true, 0, io_info->comm, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") @@ -2635,9 +2635,9 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(H5S_sel_iter_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") - if (H5D__mpio_array_gather(local_info_array, num_chunks_selected, sizeof(*local_info_array), + if (H5D__mpio_array_gatherv(local_info_array, num_chunks_selected, sizeof(*local_info_array), (void **) &shared_chunks_info_array, &shared_chunks_info_array_num_entries, mpi_size, - false, 0, H5D__cmp_filtered_collective_io_info_entry) < 0) + false, 0, io_info->comm, H5D__cmp_filtered_collective_io_info_entry) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather array") for (i = 0, num_chunks_selected = 0, num_send_requests = 0; i < shared_chunks_info_array_num_entries;) { -- cgit v0.12 From b314f57e23ea25b82bebe4f514f14f878436c36f Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Sun, 9 Apr 2017 16:57:02 -0500 Subject: In current implementation, list must be gathered to all --- src/H5Dmpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 287ac25..7dee025 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -2637,7 +2637,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (H5D__mpio_array_gatherv(local_info_array, num_chunks_selected, sizeof(*local_info_array), (void **) &shared_chunks_info_array, &shared_chunks_info_array_num_entries, mpi_size, - false, 0, io_info->comm, H5D__cmp_filtered_collective_io_info_entry) < 0) + true, 0, io_info->comm, H5D__cmp_filtered_collective_io_info_entry) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather array") for (i = 0, num_chunks_selected = 0, num_send_requests = 0; i < shared_chunks_info_array_num_entries;) { -- cgit v0.12 From 7883c0d01b4eadba84697c7bb3322a304d242ed6 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Mon, 10 Apr 2017 09:44:19 -0500 Subject: Add comments --- src/H5Dmpio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 7dee025..e6fbb6a 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -398,12 +398,12 @@ H5D__mpio_array_gatherv(void *local_array, size_t local_array_num_entries, if (MPI_SUCCESS != (mpi_code = MPI_Allgatherv(local_array, sendcount, MPI_BYTE, gathered_array, receive_counts_array, displacements_array, MPI_BYTE, comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allgatherv failed", mpi_code) - } + } /* end if */ else { if (MPI_SUCCESS != (mpi_code = MPI_Gatherv(local_array, sendcount, MPI_BYTE, gathered_array, receive_counts_array, displacements_array, MPI_BYTE, root, comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allgatherv failed", mpi_code) - } + } /* end else */ if (sort_func) HDqsort(gathered_array, gathered_array_num_entries, array_entry_size, sort_func); } /* end if */ @@ -2590,6 +2590,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") + /* Each process builds a local list of the chunks they have selected */ if ((num_chunks_selected = H5SL_count(fm->sel_chunks))) { H5D_chunk_info_t *chunk_info; H5D_chunk_ud_t udata; -- cgit v0.12 From a22597fab45e6c17138d46552e9483f8541d8118 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Mon, 10 Apr 2017 14:59:58 -0500 Subject: Revise first-phase algorithm to only use rank 0 for redistribution --- src/H5Dmpio.c | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 155 insertions(+), 24 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index e6fbb6a..622cdbb 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -103,7 +103,16 @@ typedef struct H5D_filtered_collective_io_info_t { hbool_t full_overwrite; /* Whether or not this chunk is being fully overwritten */ size_t io_size; /* Size of the I/O to this chunk */ size_t num_writers; /* Total number of processes writing to this chunk */ + + struct { + int previous_owner; + int new_owner; + } owners; + +#if 0 int owner; /* Process which will be writing to this chunk */ +#endif + void *buf; /* Chunk data to be written to file/that has been read from file*/ } H5D_filtered_collective_io_info_t; @@ -1353,8 +1362,9 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in * then re-filtering the chunk. */ for (i = 0; i < chunk_list_num_entries; i++) - if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry") + if (mpi_rank == chunk_list[i].owners.new_owner) + if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry") /* Gather the new chunk sizes to all processes for a collective reallocation * of the chunks in the file. @@ -1835,7 +1845,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i */ for (i = 0; i < max_num_chunks; i++) { /* Check if this process has a chunk to work on for this iteration */ - hbool_t have_chunk_to_process = i < chunk_list_num_entries; + hbool_t have_chunk_to_process = (i < chunk_list_num_entries) && (mpi_rank == chunk_list[i].owners.new_owner); if (have_chunk_to_process) if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) @@ -2181,6 +2191,19 @@ H5D__cmp_filtered_collective_io_info_entry(const void *filtered_collective_io_in FUNC_LEAVE_NOAPI(H5F_addr_cmp(addr1, addr2)) } /* end H5D__cmp_filtered_collective_io_info_entry() */ +static int +H5D__cmp_filtered_collective_io_info_entry_owner(const void *filtered_collective_io_info_entry1, const void *filtered_collective_io_info_entry2) +{ + int owner1 = -1, owner2 = -1; + + FUNC_ENTER_STATIC_NOERR + + owner1 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_info_entry1)->owners.previous_owner; + owner2 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_info_entry2)->owners.previous_owner; + + FUNC_LEAVE_NOAPI(owner1 - owner2) +} /* end H5D__cmp_filtered_collective_io_info_entry_owner() */ + /*------------------------------------------------------------------------- * Function: H5D__sort_chunk @@ -2565,14 +2588,13 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ H5D_filtered_collective_io_info_t *shared_chunks_info_array = NULL; /* The list of all chunks selected in the operation by all processes */ H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__gather_mem */ unsigned char *mod_data = NULL; /* Chunk modification data sent by a process to a chunk's owner */ - H5SL_node_t *chunk_node; MPI_Request *send_requests = NULL; /* Array of MPI_Isend chunk modification data send requests */ MPI_Status *send_statuses = NULL; /* Array of MPI_Isend chunk modification send statuses */ hbool_t mem_iter_init = FALSE; - size_t num_send_requests = 0; size_t num_chunks_selected; - size_t shared_chunks_info_array_num_entries; size_t i; + int *send_counts = NULL; + int *send_displacements = NULL; int mpi_rank, mpi_size, mpi_code; herr_t ret_value = SUCCEED; @@ -2594,6 +2616,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if ((num_chunks_selected = H5SL_count(fm->sel_chunks))) { H5D_chunk_info_t *chunk_info; H5D_chunk_ud_t udata; + H5SL_node_t *chunk_node; hssize_t select_npoints; hssize_t chunk_npoints; @@ -2611,7 +2634,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ local_info_array[i].chunk_info = *chunk_info; local_info_array[i].old_chunk = local_info_array[i].new_chunk = udata.chunk_block; local_info_array[i].num_writers = 0; - local_info_array[i].owner = mpi_rank; + local_info_array[i].owners.previous_owner = local_info_array[i].owners.new_owner = mpi_rank; local_info_array[i].buf = NULL; if ((select_npoints = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) @@ -2629,6 +2652,9 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Redistribute shared chunks to new owners as necessary */ if (io_info->op_type == H5D_IO_OP_WRITE) { + size_t shared_chunks_info_array_num_entries = 0; + size_t num_send_requests = 0; + if (num_chunks_selected) if (NULL == (send_requests = (MPI_Request *) H5MM_malloc(num_chunks_selected * sizeof(*send_requests)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send requests buffer") @@ -2638,10 +2664,11 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (H5D__mpio_array_gatherv(local_info_array, num_chunks_selected, sizeof(*local_info_array), (void **) &shared_chunks_info_array, &shared_chunks_info_array_num_entries, mpi_size, - true, 0, io_info->comm, H5D__cmp_filtered_collective_io_info_entry) < 0) + false, 0, io_info->comm, H5D__cmp_filtered_collective_io_info_entry) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather array") - for (i = 0, num_chunks_selected = 0, num_send_requests = 0; i < shared_chunks_info_array_num_entries;) { +#if 0 + for (i = 0, num_chunks_selected = 0; i < shared_chunks_info_array_num_entries;) { H5D_filtered_collective_io_info_t chunk_entry; haddr_t chunk_addr = shared_chunks_info_array[i].old_chunk.offset; size_t total_io_size = 0; @@ -2760,26 +2787,124 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ mem_iter_init = FALSE; } /* end else */ } /* end for */ +#endif /* Rank 0 redistributes any shared chunks to new owners as necessary */ if (mpi_rank == 0) { + if (NULL == (send_counts = (int *) H5MM_calloc((size_t) mpi_size * sizeof(*send_counts)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate send counts buffer") + + if (NULL == (send_displacements = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*send_displacements)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate send displacements buffer") + + for (i = 0; i < shared_chunks_info_array_num_entries;) { + H5D_filtered_collective_io_info_t chunk_entry; + haddr_t last_seen_addr = shared_chunks_info_array[i].old_chunk.offset; + size_t set_begin_index = i; + size_t total_io_size = 0; + size_t max_io_size = 0; + size_t num_writers = 0; + int new_chunk_owner = 0; + + /* Process each set of duplicate entries caused by another process writing to the same chunk */ + do { + chunk_entry = shared_chunks_info_array[i]; - } + send_counts[chunk_entry.owners.previous_owner] += sizeof(chunk_entry); - /* Release old list */ - if (local_info_array) - H5MM_free(local_info_array); + /* Add this chunk entry's I/O size to the running total */ + total_io_size += chunk_entry.io_size; - /* Local info list becomes modified (redistributed) chunk list */ - local_info_array = shared_chunks_info_array; + /* The new owner of the chunk is determined by the process + * which is writing the most data to the chunk + */ + if (chunk_entry.io_size > max_io_size) { + max_io_size = chunk_entry.io_size; + new_chunk_owner = chunk_entry.owners.previous_owner; + } + + num_writers++; + } while (++i < shared_chunks_info_array_num_entries && shared_chunks_info_array[i].old_chunk.offset == last_seen_addr); + + /* Set all of the chunk entries' "new_owner" fields */ + for (; set_begin_index < i; set_begin_index++) { + shared_chunks_info_array[set_begin_index].owners.new_owner = new_chunk_owner; + shared_chunks_info_array[set_begin_index].num_writers = num_writers; + } /* end for */ + } /* end for */ + + /* Sort the new list's in order of previous owner so that each original owner of a chunk + * entry gets that entry back, with the possibly newly-modified "new_owner" field + */ + HDqsort(shared_chunks_info_array, shared_chunks_info_array_num_entries, + sizeof(*shared_chunks_info_array), H5D__cmp_filtered_collective_io_info_entry_owner); + + send_displacements[0] = 0; + for (i = 1; i < (size_t) mpi_size; i++) + send_displacements[i] = send_displacements[i - 1] + send_counts[i - 1]; + } /* end if */ + + /* Scatter the segments of the list back to each process */ + if (MPI_SUCCESS != (mpi_code = MPI_Scatterv(shared_chunks_info_array, send_counts, + send_displacements, MPI_BYTE, local_info_array, num_chunks_selected * sizeof(*local_info_array), + MPI_BYTE, 0, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "unable to scatter shared chunks info buffer", mpi_code) /* Now that the chunks have been redistributed, each process must send its modification data * to the new owners of any of the chunks it previously possessed */ for (i = 0; i < num_chunks_selected; i++) { - if (mpi_rank != local_info_array[i].owner) { + if (mpi_rank != local_info_array[i].owners.new_owner) { + H5D_filtered_collective_io_info_t chunk_entry = local_info_array[i]; + unsigned char *mod_data_p = NULL; + hssize_t iter_nelmts; + size_t mod_data_size; + + /* Determine size of serialized chunk file dataspace, plus the size of + * the data being written + */ + if (H5S_encode(chunk_entry.chunk_info.fspace, &mod_data, &mod_data_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to get encoded dataspace size") - } + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_entry.chunk_info.mspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + + mod_data_size += (size_t) iter_nelmts * type_info->src_type_size; + + if (NULL == (mod_data = (unsigned char *) H5MM_malloc(mod_data_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification send buffer") + + /* Serialize the chunk's file dataspace into the buffer */ + mod_data_p = mod_data; + if (H5S_encode(chunk_entry.chunk_info.fspace, &mod_data_p, &mod_data_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to encode dataspace") + + /* Intialize iterator for memory selection */ + if (H5S_select_iter_init(mem_iter, chunk_entry.chunk_info.mspace, type_info->src_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") + mem_iter_init = TRUE; + + /* Collect the modification data into the buffer */ + if (!H5D__gather_mem(io_info->u.wbuf, chunk_entry.chunk_info.mspace, mem_iter, + (size_t) iter_nelmts, io_info->dxpl_cache, mod_data_p)) + HGOTO_ERROR(H5E_IO, H5E_CANTGATHER, FAIL, "couldn't gather from write buffer") + + /* Send modification data to new owner */ + H5_CHECK_OVERFLOW(mod_data_size, size_t, int) + H5_CHECK_OVERFLOW(chunk_entry.chunk_info.index, hsize_t, int) + if (MPI_SUCCESS != (mpi_code = MPI_Isend(mod_data, (int) mod_data_size, MPI_BYTE, chunk_entry.owners.new_owner, + (int) chunk_entry.chunk_info.index, io_info->comm, &send_requests[num_send_requests++]))) + HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) + + if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release memory selection iterator") + mem_iter_init = FALSE; + + if (mod_data) { + H5MM_free(mod_data); + mod_data = NULL; + } /* end if */ + } /* end if */ } /* end for */ /* Wait for all async send requests to complete before returning */ @@ -2790,13 +2915,17 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ H5_CHECK_OVERFLOW(num_send_requests, size_t, int); if (MPI_SUCCESS != (mpi_code = MPI_Waitall((int) num_send_requests, send_requests, send_statuses))) HMPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code) - } + } /* end if */ } /* end if */ *chunk_list = local_info_array; *num_entries = num_chunks_selected; done: + if (send_counts) + H5MM_free(send_counts); + if (send_displacements) + H5MM_free(send_displacements); if (send_requests) H5MM_free(send_requests); if (send_statuses) @@ -2865,12 +2994,14 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun base_buf = chunk_list[0].buf; for (i = 0; i < num_entries; i++) { - /* Set up the offset in the file, the length of the chunk data, and the relative - * displacement of the chunk data write buffer - */ - file_offset_array[i] = (MPI_Aint) chunk_list[i].new_chunk.offset; - length_array[i] = (int) chunk_list[i].new_chunk.length; - write_buf_array[i] = (MPI_Aint) chunk_list[i].buf - (MPI_Aint) base_buf; + if (chunk_list[i].owners.previous_owner == chunk_list[i].owners.new_owner) { + /* Set up the offset in the file, the length of the chunk data, and the relative + * displacement of the chunk data write buffer + */ + file_offset_array[i] = (MPI_Aint) chunk_list[i].new_chunk.offset; + length_array[i] = (int) chunk_list[i].new_chunk.length; + write_buf_array[i] = (MPI_Aint) chunk_list[i].buf - (MPI_Aint) base_buf; + } } /* end for */ /* Create memory MPI type */ -- cgit v0.12 From cbbd6b0df3fd4f34036a612e5ddb9160df8f5be7 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Tue, 11 Apr 2017 15:57:31 -0500 Subject: Minimize size of H5D_filtered_collective_io_info_t struct --- src/H5Dmpio.c | 306 ++++++++++++++++++++-------------------------------------- 1 file changed, 102 insertions(+), 204 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 622cdbb..9ce6c9e 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -95,25 +95,24 @@ typedef struct H5D_chunk_addr_info_t { H5D_chunk_info_t chunk_info; } H5D_chunk_addr_info_t; -/* Information about a single chunk when performing collective filtered IO */ +/* Information about a single chunk when performing collective filtered I/O */ typedef struct H5D_filtered_collective_io_info_t { - H5D_chunk_info_t chunk_info; /* Info about this chunk, such as chunk index and file and memory dataspace */ - H5F_block_t old_chunk; /* The address in the file and size of this chunk before being filtered */ - H5F_block_t new_chunk; /* The address in the file and size of this chunk after being filtered */ - hbool_t full_overwrite; /* Whether or not this chunk is being fully overwritten */ - size_t io_size; /* Size of the I/O to this chunk */ - size_t num_writers; /* Total number of processes writing to this chunk */ + hsize_t index; /* "Index" of chunk in dataset */ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Scaled coordinates of chunk (in file dataset's dataspace) */ + hbool_t full_overwrite; /* Whether or not this chunk is being fully overwritten */ + size_t num_writers; /* Total number of processes writing to this chunk */ + size_t io_size; /* Size of the I/O to this chunk */ + void *buf; /* Chunk data to be written to file/that has been read from file*/ struct { - int previous_owner; - int new_owner; - } owners; - -#if 0 - int owner; /* Process which will be writing to this chunk */ -#endif + H5F_block_t chunk_current; /* The address in the file and size of this chunk before the I/O and filtering operations */ + H5F_block_t new_chunk; /* The address in the file and size of this chunk after the I/O and filtering operations */ + } chunk_states; - void *buf; /* Chunk data to be written to file/that has been read from file*/ + struct { + int original_owner; /* The process which originally had this chunk selected in the I/O operation */ + int new_owner; /* The process which the chunk has been re-assigned to */ + } owners; } H5D_filtered_collective_io_info_t; /********************/ @@ -162,7 +161,7 @@ static herr_t H5D__mpio_filtered_collective_write_type( MPI_Datatype *new_mem_type, hbool_t *mem_type_derived, MPI_Datatype *new_file_type, hbool_t *file_type_derived); static herr_t H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk_entry, - const H5D_io_info_t *io_info, const H5D_type_info_t *type_info); + const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm); static int H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2); static int H5D__cmp_filtered_collective_io_info_entry(const void *filtered_collective_io_info_entry1, const void *filtered_collective_io_info_entry2); @@ -812,6 +811,8 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf } #endif +io_option = H5D_MULTI_CHUNK_IO; + /* step 2: Go ahead to do IO.*/ switch (io_option) { case H5D_ONE_LINK_CHUNK_IO: @@ -1363,7 +1364,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in */ for (i = 0; i < chunk_list_num_entries; i++) if (mpi_rank == chunk_list[i].owners.new_owner) - if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) + if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry") /* Gather the new chunk sizes to all processes for a collective reallocation @@ -1378,8 +1379,8 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in for (i = 0; i < collective_chunk_list_num_entries; i++) { hbool_t insert; - if (H5D__chunk_file_alloc(&index_info, &collective_chunk_list[i].old_chunk, &collective_chunk_list[i].new_chunk, - &insert, collective_chunk_list[i].chunk_info.scaled) < 0) + if (H5D__chunk_file_alloc(&index_info, &collective_chunk_list[i].chunk_states.chunk_current, + &collective_chunk_list[i].chunk_states.new_chunk, &insert, collective_chunk_list[i].scaled) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") } /* end for */ @@ -1438,9 +1439,9 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in * in this iteration into the chunk index */ for (i = 0; i < collective_chunk_list_num_entries; i++) { - udata.chunk_block = collective_chunk_list[i].new_chunk; - udata.common.scaled = collective_chunk_list[i].chunk_info.scaled; - udata.chunk_idx = collective_chunk_list[i].chunk_info.index; + udata.chunk_block = collective_chunk_list[i].chunk_states.new_chunk; + udata.common.scaled = collective_chunk_list[i].scaled; + udata.chunk_idx = collective_chunk_list[i].index; if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") @@ -1795,7 +1796,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i if (io_info->op_type == H5D_IO_OP_READ) { /* Filtered collective read */ for (i = 0; i < chunk_list_num_entries; i++) - if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) + if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't process chunk entry") } /* end if */ else { /* Filtered collective write */ @@ -1848,7 +1849,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i hbool_t have_chunk_to_process = (i < chunk_list_num_entries) && (mpi_rank == chunk_list[i].owners.new_owner); if (have_chunk_to_process) - if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info) < 0) + if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry") /* Gather the new chunk sizes to all processes for a collective re-allocation @@ -1865,8 +1866,8 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i for (j = 0; j < collective_chunk_list_num_entries; j++) { hbool_t insert = FALSE; - if (H5D__chunk_file_alloc(&index_info, &collective_chunk_list[j].old_chunk, &collective_chunk_list[j].new_chunk, - &insert, chunk_list[j].chunk_info.scaled) < 0) + if (H5D__chunk_file_alloc(&index_info, &collective_chunk_list[j].chunk_states.chunk_current, + &collective_chunk_list[j].chunk_states.new_chunk, &insert, chunk_list[j].scaled) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") } /* end for */ @@ -1889,9 +1890,9 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Collect the new chunk info back to the local copy, since only the record in the * collective array gets updated by the chunk re-allocation */ - HDmemcpy(&chunk_list[i].new_chunk, &collective_chunk_list[offset].new_chunk, sizeof(chunk_list[i].new_chunk)); + HDmemcpy(&chunk_list[i].chunk_states.new_chunk, &collective_chunk_list[offset].chunk_states.new_chunk, sizeof(chunk_list[i].chunk_states.new_chunk)); - H5_CHECKED_ASSIGN(mpi_type_count, int, chunk_list[i].new_chunk.length, hsize_t); + H5_CHECKED_ASSIGN(mpi_type_count, int, chunk_list[i].chunk_states.new_chunk.length, hsize_t); /* Create MPI memory type for writing to chunk */ if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(mpi_type_count, MPI_BYTE, &mem_type_array[i]))) @@ -1910,7 +1911,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i mpi_buf_count = 1; /* Set up the base storage address for this operation */ - ctg_store.contig.dset_addr = chunk_list[i].new_chunk.offset; + ctg_store.contig.dset_addr = chunk_list[i].chunk_states.new_chunk.offset; /* Override the write buffer to point to the address of the * chunk data buffer @@ -1930,9 +1931,9 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i * in this iteration into the chunk index */ for (j = 0; j < collective_chunk_list_num_entries; j++) { - udata.chunk_block = collective_chunk_list[j].new_chunk; - udata.common.scaled = collective_chunk_list[j].chunk_info.scaled; - udata.chunk_idx = collective_chunk_list[j].chunk_info.index; + udata.chunk_block = collective_chunk_list[j].chunk_states.new_chunk; + udata.common.scaled = collective_chunk_list[j].scaled; + udata.chunk_idx = collective_chunk_list[j].index; if ((index_info.storage->ops->insert)(&index_info, &udata, io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk address into index") @@ -2185,8 +2186,8 @@ H5D__cmp_filtered_collective_io_info_entry(const void *filtered_collective_io_in FUNC_ENTER_STATIC_NOERR - addr1 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_info_entry1)->new_chunk.offset; - addr2 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_info_entry2)->new_chunk.offset; + addr1 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_info_entry1)->chunk_states.new_chunk.offset; + addr2 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_info_entry2)->chunk_states.new_chunk.offset; FUNC_LEAVE_NOAPI(H5F_addr_cmp(addr1, addr2)) } /* end H5D__cmp_filtered_collective_io_info_entry() */ @@ -2198,8 +2199,8 @@ H5D__cmp_filtered_collective_io_info_entry_owner(const void *filtered_collective FUNC_ENTER_STATIC_NOERR - owner1 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_info_entry1)->owners.previous_owner; - owner2 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_info_entry2)->owners.previous_owner; + owner1 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_info_entry1)->owners.original_owner; + owner2 = ((const H5D_filtered_collective_io_info_t *) filtered_collective_io_info_entry2)->owners.original_owner; FUNC_LEAVE_NOAPI(owner1 - owner2) } /* end H5D__cmp_filtered_collective_io_info_entry_owner() */ @@ -2584,7 +2585,7 @@ static herr_t H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm, H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries) { - H5D_filtered_collective_io_info_t *local_info_array = NULL; /* The list of initially select chunks for this process */ + H5D_filtered_collective_io_info_t *local_info_array = NULL; /* The list of initially selected chunks for this process */ H5D_filtered_collective_io_info_t *shared_chunks_info_array = NULL; /* The list of all chunks selected in the operation by all processes */ H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__gather_mem */ unsigned char *mod_data = NULL; /* Chunk modification data sent by a process to a chunk's owner */ @@ -2631,11 +2632,13 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") - local_info_array[i].chunk_info = *chunk_info; - local_info_array[i].old_chunk = local_info_array[i].new_chunk = udata.chunk_block; + local_info_array[i].index = chunk_info->index; + local_info_array[i].chunk_states.chunk_current = local_info_array[i].chunk_states.new_chunk = udata.chunk_block; local_info_array[i].num_writers = 0; - local_info_array[i].owners.previous_owner = local_info_array[i].owners.new_owner = mpi_rank; + local_info_array[i].owners.original_owner = local_info_array[i].owners.new_owner = mpi_rank; local_info_array[i].buf = NULL; + + HDmemcpy(local_info_array[i].scaled, chunk_info->scaled, sizeof(chunk_info->scaled)); if ((select_npoints = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") @@ -2667,128 +2670,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ false, 0, io_info->comm, H5D__cmp_filtered_collective_io_info_entry) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather array") -#if 0 - for (i = 0, num_chunks_selected = 0; i < shared_chunks_info_array_num_entries;) { - H5D_filtered_collective_io_info_t chunk_entry; - haddr_t chunk_addr = shared_chunks_info_array[i].old_chunk.offset; - size_t total_io_size = 0; - size_t num_writers = 0; - size_t max_bytes = 0; - int new_owner = 0; - - /* Set the chunk entry's file dataspace to NULL as a sentinel value. - * Any process which is contributing modifications to this chunk will - * obtain a valid file space while processing duplicates below. Any - * process which still has a NULL file space after processing all of - * the duplicate entries for a shared chunk are assumed to not be - * contributing to the chunk and so will not try to access an invalid - * dataspace when processes are sending chunk data to new owners */ - chunk_entry.chunk_info.fspace = NULL; - - /* Process duplicate entries caused by another process writing - * to the same chunk - */ - do { - /* Store the correct chunk entry information in case this process - * becomes the new chunk's owner. The chunk entry that this process - * contributed will be the only one with a valid dataspace selection - * on that particular process - */ - if (mpi_rank == shared_chunks_info_array[i].owner) - chunk_entry = shared_chunks_info_array[i]; - - /* Add this chunk entry's IO size to the running total */ - total_io_size += shared_chunks_info_array[i].io_size; - - /* New owner of the chunk is determined by the process - * which is writing the most data to the chunk - */ - if (shared_chunks_info_array[i].io_size > max_bytes) { - max_bytes = shared_chunks_info_array[i].io_size; - new_owner = shared_chunks_info_array[i].owner; - } - - num_writers++; - } while (++i < shared_chunks_info_array_num_entries && shared_chunks_info_array[i].old_chunk.offset == chunk_addr); - - if (mpi_rank == new_owner) { - hssize_t chunk_npoints; - - /* Make sure the new owner will know how many other processes will - * be sending chunk modification data to it - */ - chunk_entry.num_writers = num_writers; - - /* Set the full chunk overwrite status. It is assumed that this is a full - * overwrite of the chunk if the total IO size is equal to the size of the - * chunk. If the IO size is greater than the size of the chunk, there is an - * overlapping write between processes, meaning there is no guarantee on - * the integrity of data in the write operation. However, this still - * represents a full overwrite of the chunk. - */ - if ((chunk_npoints = H5S_GET_EXTENT_NPOINTS(chunk_entry.chunk_info.fspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - - chunk_entry.full_overwrite = (total_io_size >= (hsize_t) chunk_npoints * type_info->dst_type_size) ? TRUE : FALSE; - - /* New owner takes possession of the chunk */ - shared_chunks_info_array[num_chunks_selected++] = chunk_entry; - } /* end if */ - else if (chunk_entry.chunk_info.fspace) { - unsigned char *mod_data_p = NULL; /* Use second pointer since H5S_encode advances pointer */ - hssize_t iter_nelmts; /* Number of points to iterate over for the send operation */ - size_t mod_data_size; - - /* Not the new owner of this chunk, encode the file space selection and - * modification data into a buffer and send it to the new chunk owner */ - - /* Determine size of serialized chunk memory dataspace plus the size - * of the data being written - */ - if (H5S_encode(chunk_entry.chunk_info.fspace, &mod_data, &mod_data_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to get encoded dataspace size") - - if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_entry.chunk_info.mspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - - mod_data_size += (size_t) iter_nelmts * type_info->src_type_size; - - if (NULL == (mod_data = (unsigned char *) H5MM_malloc(mod_data_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification send buffer") - - /* Serialize the chunk's file dataspace into the buffer */ - mod_data_p = mod_data; - if (H5S_encode(chunk_entry.chunk_info.fspace, &mod_data_p, &mod_data_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to encode dataspace") - - /* Initialize iterator for memory selection */ - if (H5S_select_iter_init(mem_iter, chunk_entry.chunk_info.mspace, type_info->src_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") - mem_iter_init = TRUE; - - /* Collect the modification data into the buffer */ - if (!H5D__gather_mem(io_info->u.wbuf, chunk_entry.chunk_info.mspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, mod_data_p)) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't gather from write buffer") - - /* Send modification data to new owner */ - H5_CHECK_OVERFLOW(mod_data_size, size_t, int) - H5_CHECK_OVERFLOW(chunk_entry.chunk_info.index, hsize_t, int) - if (MPI_SUCCESS != (mpi_code = MPI_Isend(mod_data, (int) mod_data_size, MPI_BYTE, new_owner, - (int) chunk_entry.chunk_info.index, io_info->comm, &send_requests[num_send_requests++]))) - HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) - - if (mod_data) { - H5MM_free(mod_data); - mod_data = NULL; - } - if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") - mem_iter_init = FALSE; - } /* end else */ - } /* end for */ -#endif - /* Rank 0 redistributes any shared chunks to new owners as necessary */ if (mpi_rank == 0) { if (NULL == (send_counts = (int *) H5MM_calloc((size_t) mpi_size * sizeof(*send_counts)))) @@ -2799,7 +2680,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ for (i = 0; i < shared_chunks_info_array_num_entries;) { H5D_filtered_collective_io_info_t chunk_entry; - haddr_t last_seen_addr = shared_chunks_info_array[i].old_chunk.offset; + haddr_t last_seen_addr = shared_chunks_info_array[i].chunk_states.chunk_current.offset; size_t set_begin_index = i; size_t total_io_size = 0; size_t max_io_size = 0; @@ -2810,7 +2691,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ do { chunk_entry = shared_chunks_info_array[i]; - send_counts[chunk_entry.owners.previous_owner] += sizeof(chunk_entry); + send_counts[chunk_entry.owners.original_owner] += sizeof(chunk_entry); /* Add this chunk entry's I/O size to the running total */ total_io_size += chunk_entry.io_size; @@ -2820,11 +2701,11 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ */ if (chunk_entry.io_size > max_io_size) { max_io_size = chunk_entry.io_size; - new_chunk_owner = chunk_entry.owners.previous_owner; + new_chunk_owner = chunk_entry.owners.original_owner; } num_writers++; - } while (++i < shared_chunks_info_array_num_entries && shared_chunks_info_array[i].old_chunk.offset == last_seen_addr); + } while (++i < shared_chunks_info_array_num_entries && shared_chunks_info_array[i].chunk_states.chunk_current.offset == last_seen_addr); /* Set all of the chunk entries' "new_owner" fields */ for (; set_begin_index < i; set_begin_index++) { @@ -2850,23 +2731,33 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ MPI_BYTE, 0, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "unable to scatter shared chunks info buffer", mpi_code) + if (shared_chunks_info_array) { + H5MM_free(shared_chunks_info_array); + shared_chunks_info_array = NULL; + } + /* Now that the chunks have been redistributed, each process must send its modification data * to the new owners of any of the chunks it previously possessed */ for (i = 0; i < num_chunks_selected; i++) { if (mpi_rank != local_info_array[i].owners.new_owner) { H5D_filtered_collective_io_info_t chunk_entry = local_info_array[i]; + H5D_chunk_info_t *chunk_info = NULL; unsigned char *mod_data_p = NULL; hssize_t iter_nelmts; size_t mod_data_size; + + /* Look up the chunk and get its file and memory dataspaces */ + if (NULL == (chunk_info = (H5D_chunk_info_t *) H5SL_search(fm->sel_chunks, &chunk_entry.index))) + HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, FAIL, "can't locate chunk in skip list") /* Determine size of serialized chunk file dataspace, plus the size of * the data being written */ - if (H5S_encode(chunk_entry.chunk_info.fspace, &mod_data, &mod_data_size) < 0) + if (H5S_encode(chunk_info->fspace, &mod_data, &mod_data_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to get encoded dataspace size") - if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_entry.chunk_info.mspace)) < 0) + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") mod_data_size += (size_t) iter_nelmts * type_info->src_type_size; @@ -2876,24 +2767,24 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Serialize the chunk's file dataspace into the buffer */ mod_data_p = mod_data; - if (H5S_encode(chunk_entry.chunk_info.fspace, &mod_data_p, &mod_data_size) < 0) + if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to encode dataspace") /* Intialize iterator for memory selection */ - if (H5S_select_iter_init(mem_iter, chunk_entry.chunk_info.mspace, type_info->src_type_size) < 0) + if (H5S_select_iter_init(mem_iter, chunk_info->mspace, type_info->src_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") mem_iter_init = TRUE; /* Collect the modification data into the buffer */ - if (!H5D__gather_mem(io_info->u.wbuf, chunk_entry.chunk_info.mspace, mem_iter, + if (!H5D__gather_mem(io_info->u.wbuf, chunk_info->mspace, mem_iter, (size_t) iter_nelmts, io_info->dxpl_cache, mod_data_p)) HGOTO_ERROR(H5E_IO, H5E_CANTGATHER, FAIL, "couldn't gather from write buffer") /* Send modification data to new owner */ H5_CHECK_OVERFLOW(mod_data_size, size_t, int) - H5_CHECK_OVERFLOW(chunk_entry.chunk_info.index, hsize_t, int) + H5_CHECK_OVERFLOW(chunk_entry.index, hsize_t, int) if (MPI_SUCCESS != (mpi_code = MPI_Isend(mod_data, (int) mod_data_size, MPI_BYTE, chunk_entry.owners.new_owner, - (int) chunk_entry.chunk_info.index, io_info->comm, &send_requests[num_send_requests++]))) + (int) chunk_entry.index, io_info->comm, &send_requests[num_send_requests++]))) HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) @@ -2922,6 +2813,8 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ *num_entries = num_chunks_selected; done: + if (shared_chunks_info_array) + H5MM_free(shared_chunks_info_array); if (send_counts) H5MM_free(send_counts); if (send_displacements) @@ -2994,12 +2887,12 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun base_buf = chunk_list[0].buf; for (i = 0; i < num_entries; i++) { - if (chunk_list[i].owners.previous_owner == chunk_list[i].owners.new_owner) { + if (chunk_list[i].owners.original_owner == chunk_list[i].owners.new_owner) { /* Set up the offset in the file, the length of the chunk data, and the relative * displacement of the chunk data write buffer */ - file_offset_array[i] = (MPI_Aint) chunk_list[i].new_chunk.offset; - length_array[i] = (int) chunk_list[i].new_chunk.length; + file_offset_array[i] = (MPI_Aint) chunk_list[i].chunk_states.new_chunk.offset; + length_array[i] = (int) chunk_list[i].chunk_states.new_chunk.length; write_buf_array[i] = (MPI_Aint) chunk_list[i].buf - (MPI_Aint) base_buf; } } /* end for */ @@ -3048,19 +2941,20 @@ done: */ static herr_t H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk_entry, - const H5D_io_info_t *io_info, const H5D_type_info_t *type_info) + const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm) { - H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__scatter_mem/H5D__gather_mem */ - unsigned char *mod_data = NULL; /* Chunk modification data sent by a process to a chunk's owner */ - unsigned filter_mask = 0; - hssize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */ - hbool_t mem_iter_init = FALSE; - size_t buf_size; - size_t mod_data_alloced_bytes = 0; - H5S_t *dataspace = NULL; /* Other process' dataspace for the chunk */ - void *tmp_gath_buf = NULL; /* Temporary gather buffer for owner of the chunk to gather into from + H5D_chunk_info_t *chunk_info = NULL; + H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__scatter_mem/H5D__gather_mem */ + unsigned char *mod_data = NULL; /* Chunk modification data sent by a process to a chunk's owner */ + unsigned filter_mask = 0; + hssize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */ + hbool_t mem_iter_init = FALSE; + size_t buf_size; + size_t mod_data_alloced_bytes = 0; + H5S_t *dataspace = NULL; /* Other process' dataspace for the chunk */ + void *tmp_gath_buf = NULL; /* Temporary gather buffer for owner of the chunk to gather into from application write buffer before scattering out to the chunk data buffer */ - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -3068,24 +2962,28 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HDassert(io_info); HDassert(type_info); + /* Look up the chunk and get its file and memory dataspaces */ + if (NULL == (chunk_info = (H5D_chunk_info_t *) H5SL_search(fm->sel_chunks, &chunk_entry->index))) + HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, FAIL, "can't locate chunk in skip list") + /* If this is a read operation or a write operation where the chunk is not being fully * overwritten, enough memory must be allocated to read the filtered chunk from the file. * If this is a write operation where the chunk is being fully overwritten, enough memory * must be allocated for the size of the unfiltered chunk. */ if (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) { - buf_size = chunk_entry->old_chunk.length; + buf_size = chunk_entry->chunk_states.chunk_current.length; } else { hssize_t extent_npoints; - if ((extent_npoints = H5S_GET_EXTENT_NPOINTS(chunk_entry->chunk_info.fspace)) < 0) + if ((extent_npoints = H5S_GET_EXTENT_NPOINTS(chunk_info->fspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") buf_size = (hsize_t) extent_npoints * type_info->src_type_size; } - chunk_entry->new_chunk.length = buf_size; + chunk_entry->chunk_states.new_chunk.length = buf_size; if (NULL == (chunk_entry->buf = H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk data buffer") @@ -3095,13 +2993,13 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk */ if (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) { /* XXX: Test with MPI types and collective read to improve performance */ - if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_entry->old_chunk.offset, + if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_entry->chunk_states.chunk_current.offset, buf_size, H5AC_rawdata_dxpl_id, chunk_entry->buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, - (size_t *) &chunk_entry->new_chunk.length, &buf_size, &chunk_entry->buf) < 0) + (size_t *) &chunk_entry->chunk_states.new_chunk.length, &buf_size, &chunk_entry->buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "couldn't unfilter chunk for modifying") } /* end if */ @@ -3109,11 +3007,11 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") - if (H5S_select_iter_init(mem_iter, chunk_entry->chunk_info.mspace, type_info->src_type_size) < 0) + if (H5S_select_iter_init(mem_iter, chunk_info->mspace, type_info->src_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") mem_iter_init = TRUE; - if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_entry->chunk_info.mspace)) < 0) + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") /* If this is a read operation, scatter the read chunk data to the user's buffer. @@ -3124,7 +3022,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk */ switch (io_info->op_type) { case H5D_IO_OP_READ: - if (H5D__scatter_mem(chunk_entry->buf, chunk_entry->chunk_info.mspace, mem_iter, + if (H5D__scatter_mem(chunk_entry->buf, chunk_info->mspace, mem_iter, (size_t) iter_nelmts, io_info->dxpl_cache, io_info->u.rbuf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't scatter to read buffer") break; @@ -3134,7 +3032,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate temporary gather buffer") /* Gather modification data from the application write buffer into a temporary buffer */ - if (!H5D__gather_mem(io_info->u.wbuf, chunk_entry->chunk_info.mspace, mem_iter, + if (!H5D__gather_mem(io_info->u.wbuf, chunk_info->mspace, mem_iter, (size_t) iter_nelmts, io_info->dxpl_cache, tmp_gath_buf)) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't gather from write buffer") @@ -3143,17 +3041,17 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk mem_iter_init = FALSE; /* Initialize iterator for file selection */ - if (H5S_select_iter_init(mem_iter, chunk_entry->chunk_info.fspace, type_info->dst_type_size) < 0) + if (H5S_select_iter_init(mem_iter, chunk_info->fspace, type_info->dst_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information") mem_iter_init = TRUE; - if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_entry->chunk_info.fspace)) < 0) + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->fspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") /* Scatter the owner's modification data into the chunk data buffer according to * the file space. */ - if (H5D__scatter_mem(tmp_gath_buf, chunk_entry->chunk_info.fspace, mem_iter, + if (H5D__scatter_mem(tmp_gath_buf, chunk_info->fspace, mem_iter, (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't scatter to chunk data buffer") @@ -3169,8 +3067,8 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk int mpi_code; /* Probe for the incoming message from another process */ - H5_CHECK_OVERFLOW(chunk_entry->chunk_info.index, hsize_t, int) - if (MPI_SUCCESS != (mpi_code = MPI_Probe(MPI_ANY_SOURCE, (int) chunk_entry->chunk_info.index, + H5_CHECK_OVERFLOW(chunk_entry->index, hsize_t, int) + if (MPI_SUCCESS != (mpi_code = MPI_Probe(MPI_ANY_SOURCE, (int) chunk_entry->index, io_info->comm, &status))) HMPI_GOTO_ERROR(FAIL, "MPI_Probe failed", mpi_code) @@ -3186,7 +3084,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk } if (MPI_SUCCESS != (mpi_code = MPI_Recv(mod_data, count, MPI_BYTE, MPI_ANY_SOURCE, - (int) chunk_entry->chunk_info.index, io_info->comm, &status))) + (int) chunk_entry->index, io_info->comm, &status))) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mpi_code) /* Decode the process' chunk file dataspace */ @@ -3221,12 +3119,12 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk /* Filter the chunk */ if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, - (size_t *) &chunk_entry->new_chunk.length, &buf_size, &chunk_entry->buf) < 0) + (size_t *) &chunk_entry->chunk_states.new_chunk.length, &buf_size, &chunk_entry->buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 /* Check for the chunk expanding too much to encode in a 32-bit value */ - if (chunk_entry->new_chunk.length > ((size_t) 0xffffffff)) + if (chunk_entry->chunk_states.new_chunk.length > ((size_t) 0xffffffff)) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") #endif -- cgit v0.12 From 78321f10135ce8c9f5375d2dc80f112cb24fb0f9 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 13 Apr 2017 10:37:36 -0500 Subject: Fix link-chunk I/O by tidying up local_info_array --- src/H5Dmpio.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 9ce6c9e..88171c8 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -811,8 +811,6 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf } #endif -io_option = H5D_MULTI_CHUNK_IO; - /* step 2: Go ahead to do IO.*/ switch (io_option) { case H5D_ONE_LINK_CHUNK_IO: @@ -2593,7 +2591,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ MPI_Status *send_statuses = NULL; /* Array of MPI_Isend chunk modification send statuses */ hbool_t mem_iter_init = FALSE; size_t num_chunks_selected; - size_t i; + size_t i, last_assigned_idx; int *send_counts = NULL; int *send_displacements = NULL; int mpi_rank, mpi_size, mpi_code; @@ -2739,7 +2737,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Now that the chunks have been redistributed, each process must send its modification data * to the new owners of any of the chunks it previously possessed */ - for (i = 0; i < num_chunks_selected; i++) { + for (i = 0, last_assigned_idx = 0; i < num_chunks_selected; i++) { if (mpi_rank != local_info_array[i].owners.new_owner) { H5D_filtered_collective_io_info_t chunk_entry = local_info_array[i]; H5D_chunk_info_t *chunk_info = NULL; @@ -2796,8 +2794,13 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ mod_data = NULL; } /* end if */ } /* end if */ + else { + local_info_array[last_assigned_idx++] = local_info_array[i]; + } /* end else */ } /* end for */ + num_chunks_selected = last_assigned_idx; + /* Wait for all async send requests to complete before returning */ if (num_send_requests) { if (NULL == (send_statuses = (MPI_Status *) H5MM_malloc(num_send_requests * sizeof(*send_statuses)))) @@ -2887,14 +2890,12 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun base_buf = chunk_list[0].buf; for (i = 0; i < num_entries; i++) { - if (chunk_list[i].owners.original_owner == chunk_list[i].owners.new_owner) { - /* Set up the offset in the file, the length of the chunk data, and the relative - * displacement of the chunk data write buffer - */ - file_offset_array[i] = (MPI_Aint) chunk_list[i].chunk_states.new_chunk.offset; - length_array[i] = (int) chunk_list[i].chunk_states.new_chunk.length; - write_buf_array[i] = (MPI_Aint) chunk_list[i].buf - (MPI_Aint) base_buf; - } + /* Set up the offset in the file, the length of the chunk data, and the relative + * displacement of the chunk data write buffer + */ + file_offset_array[i] = (MPI_Aint) chunk_list[i].chunk_states.new_chunk.offset; + length_array[i] = (int) chunk_list[i].chunk_states.new_chunk.length; + write_buf_array[i] = (MPI_Aint) chunk_list[i].buf - (MPI_Aint) base_buf; } /* end for */ /* Create memory MPI type */ -- cgit v0.12 From 9363223fb688bfb484acad07f7119eb21f5e3307 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 13 Apr 2017 13:37:56 -0500 Subject: HDFFV-10170 chnage test libs to noinst type --- test/Makefile.am | 5 +---- tools/test/h5repack/Makefile.am | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index a64cd0e..7d4fc7c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -106,15 +106,12 @@ if HAVE_SHARED_CONDITIONAL # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la + noinst_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c libdynlib4_la_SOURCES=dynlib4.c -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* - else # The libh5test library provides common support code for the tests. noinst_LTLIBRARIES=libh5test.la diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index 5c284b3..22c6d96 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -47,12 +47,10 @@ h5repacktst_SOURCES=h5repacktst.c if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibadd.la libdynlibvers.la + noinst_LTLIBRARIES=libdynlibadd.la libdynlibvers.la libdynlibadd_la_SOURCES=dynlib_rpk.c libdynlibvers_la_SOURCES=dynlib_vrpk.c -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* endif # Temporary files. *.h5 are generated by h5repack. They should -- cgit v0.12 From ad99159ad62e05e82dc9f96733d806f3e2d3a6b2 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 13 Apr 2017 15:52:21 -0500 Subject: Fix deadlocking issue --- src/H5Dmpio.c | 156 ++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 98 insertions(+), 58 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 88171c8..8e662ec 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -97,22 +97,28 @@ typedef struct H5D_chunk_addr_info_t { /* Information about a single chunk when performing collective filtered I/O */ typedef struct H5D_filtered_collective_io_info_t { - hsize_t index; /* "Index" of chunk in dataset */ - hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Scaled coordinates of chunk (in file dataset's dataspace) */ - hbool_t full_overwrite; /* Whether or not this chunk is being fully overwritten */ - size_t num_writers; /* Total number of processes writing to this chunk */ - size_t io_size; /* Size of the I/O to this chunk */ - void *buf; /* Chunk data to be written to file/that has been read from file*/ + hsize_t index; /* "Index" of chunk in dataset */ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Scaled coordinates of chunk (in file dataset's dataspace) */ + hbool_t full_overwrite; /* Whether or not this chunk is being fully overwritten */ + size_t num_writers; /* Total number of processes writing to this chunk */ + size_t io_size; /* Size of the I/O to this chunk */ + void *buf; /* Chunk data to be written to file/that has been read from file*/ struct { - H5F_block_t chunk_current; /* The address in the file and size of this chunk before the I/O and filtering operations */ - H5F_block_t new_chunk; /* The address in the file and size of this chunk after the I/O and filtering operations */ + H5F_block_t chunk_current; /* The address in the file and size of this chunk before the I/O and filtering operations */ + H5F_block_t new_chunk; /* The address in the file and size of this chunk after the I/O and filtering operations */ } chunk_states; struct { - int original_owner; /* The process which originally had this chunk selected in the I/O operation */ - int new_owner; /* The process which the chunk has been re-assigned to */ + int original_owner; /* The process which originally had this chunk selected in the I/O operation */ + int new_owner; /* The process which the chunk has been re-assigned to */ } owners; + + struct { + MPI_Request *receive_requests_array; + unsigned char **receive_buffer_array; + int num_receive_requests; + } async_info; } H5D_filtered_collective_io_info_t; /********************/ @@ -2586,7 +2592,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ H5D_filtered_collective_io_info_t *local_info_array = NULL; /* The list of initially selected chunks for this process */ H5D_filtered_collective_io_info_t *shared_chunks_info_array = NULL; /* The list of all chunks selected in the operation by all processes */ H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__gather_mem */ - unsigned char *mod_data = NULL; /* Chunk modification data sent by a process to a chunk's owner */ + unsigned char **mod_data = NULL; /* Array of chunk modification data buffers sent by a process to new chunk owners */ MPI_Request *send_requests = NULL; /* Array of MPI_Isend chunk modification data send requests */ MPI_Status *send_statuses = NULL; /* Array of MPI_Isend chunk modification send statuses */ hbool_t mem_iter_init = FALSE; @@ -2636,6 +2642,10 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ local_info_array[i].owners.original_owner = local_info_array[i].owners.new_owner = mpi_rank; local_info_array[i].buf = NULL; + local_info_array[i].async_info.num_receive_requests = 0; + local_info_array[i].async_info.receive_buffer_array = NULL; + local_info_array[i].async_info.receive_requests_array = NULL; + HDmemcpy(local_info_array[i].scaled, chunk_info->scaled, sizeof(chunk_info->scaled)); if ((select_npoints = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) @@ -2689,7 +2699,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ do { chunk_entry = shared_chunks_info_array[i]; - send_counts[chunk_entry.owners.original_owner] += sizeof(chunk_entry); + send_counts[chunk_entry.owners.original_owner] += (int) sizeof(chunk_entry); /* Add this chunk entry's I/O size to the running total */ total_io_size += chunk_entry.io_size; @@ -2725,7 +2735,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Scatter the segments of the list back to each process */ if (MPI_SUCCESS != (mpi_code = MPI_Scatterv(shared_chunks_info_array, send_counts, - send_displacements, MPI_BYTE, local_info_array, num_chunks_selected * sizeof(*local_info_array), + send_displacements, MPI_BYTE, local_info_array, num_chunks_selected * (int) sizeof(*local_info_array), MPI_BYTE, 0, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "unable to scatter shared chunks info buffer", mpi_code) @@ -2735,24 +2745,31 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ } /* Now that the chunks have been redistributed, each process must send its modification data - * to the new owners of any of the chunks it previously possessed + * to the new owners of any of the chunks it previously possessed. Accordingly, each process + * must also issue asynchronous receives for any messages it may receive for each of the + * chunks it is assigned, in order to avoid potential deadlocking issues. */ + if (num_chunks_selected) + if (NULL == (mod_data = (unsigned char **) H5MM_malloc(num_chunks_selected * sizeof(*mod_data)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate modification data buffer array") + for (i = 0, last_assigned_idx = 0; i < num_chunks_selected; i++) { - if (mpi_rank != local_info_array[i].owners.new_owner) { - H5D_filtered_collective_io_info_t chunk_entry = local_info_array[i]; + H5D_filtered_collective_io_info_t *chunk_entry = &local_info_array[i]; + + if (mpi_rank != chunk_entry->owners.new_owner) { H5D_chunk_info_t *chunk_info = NULL; unsigned char *mod_data_p = NULL; hssize_t iter_nelmts; size_t mod_data_size; /* Look up the chunk and get its file and memory dataspaces */ - if (NULL == (chunk_info = (H5D_chunk_info_t *) H5SL_search(fm->sel_chunks, &chunk_entry.index))) + if (NULL == (chunk_info = (H5D_chunk_info_t *) H5SL_search(fm->sel_chunks, &chunk_entry->index))) HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, FAIL, "can't locate chunk in skip list") /* Determine size of serialized chunk file dataspace, plus the size of * the data being written */ - if (H5S_encode(chunk_info->fspace, &mod_data, &mod_data_size) < 0) + if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to get encoded dataspace size") if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) @@ -2760,11 +2777,11 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ mod_data_size += (size_t) iter_nelmts * type_info->src_type_size; - if (NULL == (mod_data = (unsigned char *) H5MM_malloc(mod_data_size))) + if (NULL == (mod_data[num_send_requests] = (unsigned char *) H5MM_malloc(mod_data_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification send buffer") /* Serialize the chunk's file dataspace into the buffer */ - mod_data_p = mod_data; + mod_data_p = mod_data[num_send_requests]; if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to encode dataspace") @@ -2780,21 +2797,53 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Send modification data to new owner */ H5_CHECK_OVERFLOW(mod_data_size, size_t, int) - H5_CHECK_OVERFLOW(chunk_entry.index, hsize_t, int) - if (MPI_SUCCESS != (mpi_code = MPI_Isend(mod_data, (int) mod_data_size, MPI_BYTE, chunk_entry.owners.new_owner, - (int) chunk_entry.index, io_info->comm, &send_requests[num_send_requests++]))) + H5_CHECK_OVERFLOW(chunk_entry->index, hsize_t, int) + if (MPI_SUCCESS != (mpi_code = MPI_Isend(mod_data[num_send_requests], (int) mod_data_size, MPI_BYTE, + chunk_entry->owners.new_owner, (int) chunk_entry->index, io_info->comm, &send_requests[num_send_requests]))) HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release memory selection iterator") mem_iter_init = FALSE; - if (mod_data) { - H5MM_free(mod_data); - mod_data = NULL; - } /* end if */ + num_send_requests++; } /* end if */ else { + /* Allocate all necessary buffers for an asynchronous receive operation */ + if (chunk_entry->num_writers > 1) { + MPI_Message message; + MPI_Status status; + size_t j; + + chunk_entry->async_info.num_receive_requests = (int) chunk_entry->num_writers - 1; + if (NULL == (chunk_entry->async_info.receive_requests_array = (MPI_Request *) H5MM_malloc(chunk_entry->async_info.num_receive_requests * sizeof(MPI_Request)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate async requests array") + + if (NULL == (chunk_entry->async_info.receive_buffer_array = (unsigned char **) H5MM_malloc(chunk_entry->async_info.num_receive_requests * sizeof(unsigned char *)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate async receive buffers") + + for (j = 0; j < chunk_entry->num_writers - 1; j++) { + int count = 0; + + /* Probe for a particular message from any process, removing that message + * from the receive queue in the process and allocating that much memory + * for the asynchronous receive + */ + if (MPI_SUCCESS != (mpi_code = MPI_Mprobe(MPI_ANY_SOURCE, (int) chunk_entry->index, io_info->comm, &message, &status))) + HMPI_GOTO_ERROR(FAIL, "MPI_Mprobe failed", mpi_code) + + if (MPI_SUCCESS != (mpi_code = MPI_Get_count(&status, MPI_BYTE, &count))) + HMPI_GOTO_ERROR(FAIL, "MPI_Get_count failed", mpi_code) + + if (NULL == (chunk_entry->async_info.receive_buffer_array[j] = (unsigned char *) H5MM_malloc(count * sizeof(char *)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate modification data receive buffer") + + if (MPI_SUCCESS != (mpi_code = MPI_Imrecv(chunk_entry->async_info.receive_buffer_array[j], count, MPI_BYTE, + &message, &chunk_entry->async_info.receive_requests_array[j]))) + HMPI_GOTO_ERROR(FAIL, "MPI_Imrecv failed", mpi_code) + } + } + local_info_array[last_assigned_idx++] = local_info_array[i]; } /* end else */ } /* end for */ @@ -2810,6 +2859,14 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if (MPI_SUCCESS != (mpi_code = MPI_Waitall((int) num_send_requests, send_requests, send_statuses))) HMPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code) } /* end if */ + + /* Now that all async send requests have completed, free up the send + * buffers used in the async operations + */ + for (i = 0; i < num_send_requests; i++) { + if (mod_data[i]) + H5MM_free(mod_data[i]); + } } /* end if */ *chunk_list = local_info_array; @@ -2951,10 +3008,11 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk hssize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */ hbool_t mem_iter_init = FALSE; size_t buf_size; - size_t mod_data_alloced_bytes = 0; + size_t i; H5S_t *dataspace = NULL; /* Other process' dataspace for the chunk */ void *tmp_gath_buf = NULL; /* Temporary gather buffer for owner of the chunk to gather into from application write buffer before scattering out to the chunk data buffer */ + int mpi_code; herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -3060,36 +3118,15 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") mem_iter_init = FALSE; - /* Update the chunk data with any modifications from other processes */ - while (chunk_entry->num_writers > 1) { - const unsigned char *mod_data_p; /* Use second pointer since H5S_decode advances pointer */ - MPI_Status status; - int count; - int mpi_code; - - /* Probe for the incoming message from another process */ - H5_CHECK_OVERFLOW(chunk_entry->index, hsize_t, int) - if (MPI_SUCCESS != (mpi_code = MPI_Probe(MPI_ANY_SOURCE, (int) chunk_entry->index, - io_info->comm, &status))) - HMPI_GOTO_ERROR(FAIL, "MPI_Probe failed", mpi_code) - - /* Retrieve the message size */ - if (MPI_SUCCESS != (mpi_code = MPI_Get_count(&status, MPI_BYTE, &count))) - HMPI_GOTO_ERROR(FAIL, "MPI_Get_count failed", mpi_code) - - if ((size_t) count > mod_data_alloced_bytes) { - if (NULL == (mod_data = (unsigned char *) H5MM_realloc(mod_data, (size_t) count))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate modification data receive buffer") - - mod_data_alloced_bytes = (size_t) count; - } + if (MPI_SUCCESS != (mpi_code = MPI_Waitall(chunk_entry->async_info.num_receive_requests, + chunk_entry->async_info.receive_requests_array, MPI_STATUSES_IGNORE))) + HMPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code) - if (MPI_SUCCESS != (mpi_code = MPI_Recv(mod_data, count, MPI_BYTE, MPI_ANY_SOURCE, - (int) chunk_entry->index, io_info->comm, &status))) - HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mpi_code) + for (i = 0; i < (size_t) chunk_entry->async_info.num_receive_requests; i++) { + const unsigned char *mod_data_p; /* Decode the process' chunk file dataspace */ - mod_data_p = mod_data; + mod_data_p = chunk_entry->async_info.receive_buffer_array[i]; if (NULL == (dataspace = H5S_decode(&mod_data_p))) HGOTO_ERROR(H5E_DATASET, H5E_CANTDECODE, FAIL, "unable to decode dataspace") @@ -3105,8 +3142,6 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk io_info->dxpl_cache, chunk_entry->buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't scatter to write buffer") - chunk_entry->num_writers--; - if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") mem_iter_init = FALSE; @@ -3115,7 +3150,8 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HGOTO_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace") dataspace = NULL; } - } /* end while */ + H5MM_free(chunk_entry->async_info.receive_buffer_array[i]); + } /* Filter the chunk */ if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, @@ -3135,6 +3171,10 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk } /* end switch */ done: + if (chunk_entry->async_info.receive_buffer_array) + H5MM_free(chunk_entry->async_info.receive_buffer_array); + if (chunk_entry->async_info.receive_requests_array) + H5MM_free(chunk_entry->async_info.receive_requests_array); if (mod_data) H5MM_free(mod_data); if (tmp_gath_buf) -- cgit v0.12 From 4651eb738df5d31c62eae1f9fb70b1685c610e0c Mon Sep 17 00:00:00 2001 From: mainzer Date: Fri, 14 Apr 2017 23:44:23 -0500 Subject: Express test mods to test/cache.c Modified test/cache.c to skip the smoke checks with paged aggregation for all express test levels other than 0 Change to src/H5PL.c seems to be the result of autogen.sh. As it seems to be correct, I am checking it in. Tested serial and parallel (debug only) on jelly. --- src/H5PL.c | 2 ++ test/cache.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 91 insertions(+), 17 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index bfa3ace..a083f5a 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -564,6 +564,7 @@ H5PLremove(unsigned int index) unsigned int plindex; FUNC_ENTER_API(FAIL) + H5TRACE1("e", "Iu", index); if(H5PL_num_paths_g == 0) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") if(index >= H5PL_MAX_PATH_NUM) @@ -608,6 +609,7 @@ H5PLget(unsigned int index, char *pathname/*out*/, size_t size) char *dl_path = NULL; FUNC_ENTER_API(FAIL) + H5TRACE3("Zs", "Iuxz", index, pathname, size); if(H5PL_num_paths_g == 0) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") if(index >= H5PL_MAX_PATH_NUM) diff --git a/test/cache.c b/test/cache.c index ba6fb0e..6658c70 100644 --- a/test/cache.c +++ b/test/cache.c @@ -241,10 +241,16 @@ smoke_check_1(int express_test, unsigned paged) H5F_t * file_ptr = NULL; if(paged) - TESTING("smoke check #1 -- all clean, ins, dest, ren, 4/2 MB cache, paged aggregation") + TESTING("smoke check #1P -- all clean, ins, dest, ren, 4/2 MB cache") else TESTING("smoke check #1 -- all clean, ins, dest, ren, 4/2 MB cache") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -442,10 +448,16 @@ smoke_check_2(int express_test, unsigned paged) H5F_t * file_ptr = NULL; if(paged) - TESTING("smoke check #2 -- ~1/2 dirty, ins, dest, ren, 4/2 MB cache, paged aggregation") + TESTING("smoke check #2P -- ~1/2 dirty, ins, dest, ren, 4/2 MB cache") else TESTING("smoke check #2 -- ~1/2 dirty, ins, dest, ren, 4/2 MB cache") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -642,10 +654,16 @@ smoke_check_3(int express_test, unsigned paged) H5F_t * file_ptr = NULL; if(paged) - TESTING("smoke check #3 -- all clean, ins, dest, ren, 2/1 KB cache, paged aggregation") + TESTING("smoke check #3P -- all clean, ins, dest, ren, 2/1 KB cache") else TESTING("smoke check #3 -- all clean, ins, dest, ren, 2/1 KB cache") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -843,10 +861,16 @@ smoke_check_4(int express_test, unsigned paged) H5F_t * file_ptr = NULL; if(paged) - TESTING("smoke check #4 -- ~1/2 dirty, ins, dest, ren, 2/1 KB cache, paged aggregation") + TESTING("smoke check #4P -- ~1/2 dirty, ins, dest, ren, 2/1 KB cache") else TESTING("smoke check #4 -- ~1/2 dirty, ins, dest, ren, 2/1 KB cache") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -1092,10 +1116,16 @@ smoke_check_5(int express_test, unsigned paged) }; if(paged) - TESTING("smoke check #5 -- all clean, ins, prot, unprot, AR cache 1, paged aggregation") + TESTING("smoke check #5P -- all clean, ins, prot, unprot, AR cache 1") else TESTING("smoke check #5 -- all clean, ins, prot, unprot, AR cache 1") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -1330,10 +1360,16 @@ smoke_check_6(int express_test, unsigned paged) }; if(paged) - TESTING("smoke check #6 -- ~1/2 dirty, ins, prot, unprot, AR cache 1, paged aggregation") + TESTING("smoke check #6P -- ~1/2 dirty, ins, prot, unprot, AR cache 1") else TESTING("smoke check #6 -- ~1/2 dirty, ins, prot, unprot, AR cache 1") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + pass = TRUE; switch (express_test) @@ -1569,10 +1605,16 @@ smoke_check_7(int express_test, unsigned paged) }; if(paged) - TESTING("smoke check #7 -- all clean, ins, prot, unprot, AR cache 2, paged aggregation") + TESTING("smoke check #7P -- all clean, ins, prot, unprot, AR cache 2") else TESTING("smoke check #7 -- all clean, ins, prot, unprot, AR cache 2") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -1808,10 +1850,16 @@ smoke_check_8(int express_test, unsigned paged) }; if(paged) - TESTING("smoke check #8 -- ~1/2 dirty, ins, prot, unprot, AR cache 2, paged aggregation") + TESTING("smoke check #8P -- ~1/2 dirty, ins, prot, unprot, AR cache 2") else TESTING("smoke check #8 -- ~1/2 dirty, ins, prot, unprot, AR cache 2") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -2008,10 +2056,16 @@ smoke_check_9(int express_test, unsigned paged) H5C_t * cache_ptr = NULL; if(paged) - TESTING("smoke check #9 -- all clean, ins, dest, ren, 4/2 MB, corked, paged aggregation") + TESTING("smoke check #9P -- all clean, ins, dest, ren, 4/2 MB, corked") else TESTING("smoke check #9 -- all clean, ins, dest, ren, 4/2 MB, corked") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -2330,10 +2384,16 @@ smoke_check_10(int express_test, unsigned paged) H5C_t * cache_ptr = NULL; if(paged) - TESTING("smoke check #10 -- ~1/2 dirty, ins, dest, ren, 4/2 MB, corked, paged aggregation") + TESTING("smoke check #10P -- ~1/2 dirty, ins, dest, ren, 4/2 MB, corked") else TESTING("smoke check #10 -- ~1/2 dirty, ins, dest, ren, 4/2 MB, corked") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -2646,7 +2706,7 @@ express_test, unsigned paged) #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ if(paged) - TESTING("write permitted check -- 1/0 MB cache, paged aggregation") + TESTING("write permitted check -- 1/0 MB cache (paged aggregation)") else TESTING("write permitted check -- 1/0 MB cache") @@ -13329,7 +13389,7 @@ check_multiple_read_protect(unsigned paged) test_entry_t * entry_ptr; if(paged) - TESTING("multiple read only protects on a single entry (paged aggregation)") + TESTING("multiple read only protects on a single entry (paged aggr)") else TESTING("multiple read only protects on a single entry") @@ -15954,7 +16014,7 @@ check_destroy_pinned_err(unsigned paged) H5F_t * file_ptr = NULL; if(paged) - TESTING("destroy cache with permanently pinned entry error (paged aggregation)") + TESTING("destroy cache with permanently pinned entry error (pgd aggr)") else TESTING("destroy cache with permanently pinned entry error") @@ -24438,7 +24498,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) }; if(paged) - TESTING("automatic cache resize epoch marker management (paged aggregation)") + TESTING("automatic cache resize epoch marker management (paged aggr)") else TESTING("automatic cache resize epoch marker management") @@ -28230,13 +28290,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) if(fill_via_insertion) { if(paged) - TESTING("to ensure metadata blizzard absence when inserting (paged aggregation)") + TESTING("to ensure metadata blizzard absence when inserting (pgd aggr)") else TESTING("to ensure metadata blizzard absence when inserting") } /* end if */ else { if(paged) - TESTING("to ensure metadata blizzard absence on protect/unprotect (paged aggregation)") + TESTING("to ensure metadata blizzard absence on protect/unprotect (pa)") else TESTING("to ensure metadata blizzard absence on protect/unprotect") } /* end else */ @@ -34383,7 +34443,7 @@ check_entry_deletions_during_scans(unsigned paged) H5F_t * file_ptr = NULL; if(paged) - TESTING("entry deletion during list scan detection and adaption (paged aggregation)") + TESTING("entry deletion during list scan detection and adaption (par)") else TESTING("entry deletion during list scan detection and adaption") @@ -36394,6 +36454,18 @@ main(void) /* Test with paged aggregation enabled or not */ /* Each test will call setup_cache() which set up the file space strategy according to "paged" */ for(paged = FALSE; paged <= TRUE; paged++) { + + if ( paged ) { + + HDfprintf(stdout, + "\n\nRe-running tests with paged aggregation:\n"); + + if ( express_test > 0 ) + HDfprintf(stdout, " Skipping smoke checks.\n"); + + HDfprintf(stdout, "\n"); + } + nerrs += smoke_check_1(express_test, paged); nerrs += smoke_check_2(express_test, paged); nerrs += smoke_check_3(express_test, paged); -- cgit v0.12 From 6bbc8b69cfe1992d34e28d9f4c532323a412bbdf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 17 Apr 2017 11:32:32 -0500 Subject: HDFFV-10173 fix compile on VS2008 --- src/H5ACpublic.h | 236 +++++++++++++++++++++++++++---------------------------- 1 file changed, 118 insertions(+), 118 deletions(-) diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index 5fdb3f4..ca0e63f 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -70,65 +70,65 @@ extern "C" { * version number, or an error will be flagged. * * rpt_fcn_enabled: Boolean field used to enable and disable the default - * reporting function. This function is invoked every time the - * automatic cache resize code is run, and reports on its activities. + * reporting function. This function is invoked every time the + * automatic cache resize code is run, and reports on its activities. * - * This is a debugging function, and should normally be turned off. + * This is a debugging function, and should normally be turned off. * * open_trace_file: Boolean field indicating whether the trace_file_name - * field should be used to open a trace file for the cache. + * field should be used to open a trace file for the cache. * * *** DEPRECATED *** Use H5Fstart/stop logging functions instead * - * The trace file is a debuging feature that allow the capture of - * top level metadata cache requests for purposes of debugging and/or - * optimization. This field should normally be set to FALSE, as - * trace file collection imposes considerable overhead. + * The trace file is a debuging feature that allow the capture of + * top level metadata cache requests for purposes of debugging and/or + * optimization. This field should normally be set to FALSE, as + * trace file collection imposes considerable overhead. * - * This field should only be set to TRUE when the trace_file_name - * contains the full path of the desired trace file, and either - * there is no open trace file on the cache, or the close_trace_file - * field is also TRUE. + * This field should only be set to TRUE when the trace_file_name + * contains the full path of the desired trace file, and either + * there is no open trace file on the cache, or the close_trace_file + * field is also TRUE. * * close_trace_file: Boolean field indicating whether the current trace - * file (if any) should be closed. + * file (if any) should be closed. * * *** DEPRECATED *** Use H5Fstart/stop logging functions instead * - * See the above comments on the open_trace_file field. This field - * should be set to FALSE unless there is an open trace file on the - * cache that you wish to close. + * See the above comments on the open_trace_file field. This field + * should be set to FALSE unless there is an open trace file on the + * cache that you wish to close. * * trace_file_name: Full path of the trace file to be opened if the - * open_trace_file field is TRUE. + * open_trace_file field is TRUE. * * *** DEPRECATED *** Use H5Fstart/stop logging functions instead * - * In the parallel case, an ascii representation of the mpi rank of - * the process will be appended to the file name to yield a unique - * trace file name for each process. + * In the parallel case, an ascii representation of the mpi rank of + * the process will be appended to the file name to yield a unique + * trace file name for each process. * - * The length of the path must not exceed H5AC__MAX_TRACE_FILE_NAME_LEN - * characters. + * The length of the path must not exceed H5AC__MAX_TRACE_FILE_NAME_LEN + * characters. * * evictions_enabled: Boolean field used to either report the current - * evictions enabled status of the cache, or to set the cache's - * evictions enabled status. - * - * In general, the metadata cache should always be allowed to - * evict entries. However, in some cases it is advantageous to - * disable evictions briefly, and thereby postpone metadata - * writes. However, this must be done with care, as the cache - * can grow quickly. If you do this, re-enable evictions as - * soon as possible and monitor cache size. - * - * At present, evictions can only be disabled if automatic - * cache resizing is also disabled (that is, ( incr_mode == - * H5C_incr__off ) && ( decr_mode == H5C_decr__off )). There - * is no logical reason why this should be so, but it simplifies - * implementation and testing, and I can't think of any reason - * why it would be desireable. If you can think of one, I'll - * revisit the issue. + * evictions enabled status of the cache, or to set the cache's + * evictions enabled status. + * + * In general, the metadata cache should always be allowed to + * evict entries. However, in some cases it is advantageous to + * disable evictions briefly, and thereby postpone metadata + * writes. However, this must be done with care, as the cache + * can grow quickly. If you do this, re-enable evictions as + * soon as possible and monitor cache size. + * + * At present, evictions can only be disabled if automatic + * cache resizing is also disabled (that is, ( incr_mode == + * H5C_incr__off ) && ( decr_mode == H5C_decr__off )). There + * is no logical reason why this should be so, but it simplifies + * implementation and testing, and I can't think of any reason + * why it would be desireable. If you can think of one, I'll + * revisit the issue. * * set_initial_size: Boolean flag indicating whether the size of the * initial size of the cache is to be set to the value given in @@ -368,80 +368,80 @@ extern "C" { * * PHDF5 uses several strategies to prevent such inconsistencies in metadata, * all of which use the fact that the same stream of dirty metadata is seen - * by all processes for purposes of synchronization. This is done by + * by all processes for purposes of synchronization. This is done by * having each process count the number of bytes of dirty metadata generated, - * and then running a "sync point" whenever this count exceeds a user + * and then running a "sync point" whenever this count exceeds a user * specified threshold (see dirty_bytes_threshold below). * - * The current metadata write strategy is indicated by the + * The current metadata write strategy is indicated by the * metadata_write_strategy field. The possible values of this field, along * with the associated metadata write strategies are discussed below. * * dirty_bytes_threshold: Threshold of dirty byte creation used to - * synchronize updates between caches. (See above for outline and - * motivation.) + * synchronize updates between caches. (See above for outline and + * motivation.) * - * This value MUST be consistant across all processes accessing the - * file. This field is ignored unless HDF5 has been compiled for - * parallel. + * This value MUST be consistant across all processes accessing the + * file. This field is ignored unless HDF5 has been compiled for + * parallel. * * metadata_write_strategy: Integer field containing a code indicating the - * desired metadata write strategy. The valid values of this field - * are enumerated and discussed below: + * desired metadata write strategy. The valid values of this field + * are enumerated and discussed below: * * - * H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + * H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: * - * When metadata_write_strategy is set to this value, only process - * zero is allowed to write dirty metadata to disk. All other - * processes must retain dirty metadata until they are informed at - * a sync point that the dirty metadata in question has been written - * to disk. + * When metadata_write_strategy is set to this value, only process + * zero is allowed to write dirty metadata to disk. All other + * processes must retain dirty metadata until they are informed at + * a sync point that the dirty metadata in question has been written + * to disk. * - * When the sync point is reached (or when there is a user generated - * flush), process zero flushes sufficient entries to bring it into - * complience with its min clean size (or flushes all dirty entries in - * the case of a user generated flush), broad casts the list of - * entries just cleaned to all the other processes, and then exits - * the sync point. + * When the sync point is reached (or when there is a user generated + * flush), process zero flushes sufficient entries to bring it into + * complience with its min clean size (or flushes all dirty entries in + * the case of a user generated flush), broad casts the list of + * entries just cleaned to all the other processes, and then exits + * the sync point. * - * Upon receipt of the broadcast, the other processes mark the indicated - * entries as clean, and leave the sync point as well. + * Upon receipt of the broadcast, the other processes mark the indicated + * entries as clean, and leave the sync point as well. * * - * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: * - * In the distributed metadata write strategy, process zero still makes - * the decisions as to what entries should be flushed, but the actual - * flushes are distributed across the processes in the computation to - * the extent possible. + * In the distributed metadata write strategy, process zero still makes + * the decisions as to what entries should be flushed, but the actual + * flushes are distributed across the processes in the computation to + * the extent possible. * - * In this strategy, when a sync point is triggered (either by dirty - * metadata creation or manual flush), all processes enter a barrier. + * In this strategy, when a sync point is triggered (either by dirty + * metadata creation or manual flush), all processes enter a barrier. * - * On the other side of the barrier, process 0 constructs an ordered - * list of the entries to be flushed, and then broadcasts this list - * to the caches in all the processes. + * On the other side of the barrier, process 0 constructs an ordered + * list of the entries to be flushed, and then broadcasts this list + * to the caches in all the processes. * - * All processes then scan the list of entries to be flushed, flushing - * some, and marking the rest as clean. The algorithm for this purpose - * ensures that each entry in the list is flushed exactly once, and - * all are marked clean in each cache. + * All processes then scan the list of entries to be flushed, flushing + * some, and marking the rest as clean. The algorithm for this purpose + * ensures that each entry in the list is flushed exactly once, and + * all are marked clean in each cache. * - * Note that in the case of a flush of the cache, no message passing - * is necessary, as all processes have the same list of dirty entries, - * and all of these entries must be flushed. Thus in this case it is - * sufficient for each process to sort its list of dirty entries after - * leaving the initial barrier, and use this list as if it had been - * received from process zero. + * Note that in the case of a flush of the cache, no message passing + * is necessary, as all processes have the same list of dirty entries, + * and all of these entries must be flushed. Thus in this case it is + * sufficient for each process to sort its list of dirty entries after + * leaving the initial barrier, and use this list as if it had been + * received from process zero. + * + * To avoid possible messages from the past/future, all caches must + * wait until all caches are done before leaving the sync point. * - * To avoid possible messages from the past/future, all caches must - * wait until all caches are done before leaving the sync point. - * ****************************************************************************/ -#define H5AC__CURR_CACHE_CONFIG_VERSION 1 -#define H5AC__MAX_TRACE_FILE_NAME_LEN 1024 +#define H5AC__CURR_CACHE_CONFIG_VERSION 1 +#define H5AC__MAX_TRACE_FILE_NAME_LEN 1024 #define H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY 0 #define H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED 1 @@ -451,9 +451,9 @@ typedef struct H5AC_cache_config_t /* general configuration fields: */ int version; - hbool_t rpt_fcn_enabled; + hbool_t rpt_fcn_enabled; - hbool_t open_trace_file; + hbool_t open_trace_file; hbool_t close_trace_file; char trace_file_name[H5AC__MAX_TRACE_FILE_NAME_LEN + 1]; @@ -512,7 +512,7 @@ typedef struct H5AC_cache_config_t * * structure H5AC_cache_image_config_t * - * H5AC_cache_image_ctl_t is a public structure intended for use in public + * H5AC_cache_image_ctl_t is a public structure intended for use in public * APIs. At least in its initial incarnation, it is a copy of struct * H5C_cache_image_ctl_t. * @@ -526,47 +526,47 @@ typedef struct H5AC_cache_config_t * generate_image: Boolean flag indicating whether a cache image should * be created on file close. * - * save_resize_status: Boolean flag indicating whether the cache image - * should include the adaptive cache resize configuration and status. - * Note that this field is ignored at present. + * save_resize_status: Boolean flag indicating whether the cache image + * should include the adaptive cache resize configuration and status. + * Note that this field is ignored at present. * - * entry_ageout: Integer field indicating the maximum number of - * times a prefetched entry can appear in subsequent cache images. - * This field exists to allow the user to avoid the buildup of - * infrequently used entries in long sequences of cache images. + * entry_ageout: Integer field indicating the maximum number of + * times a prefetched entry can appear in subsequent cache images. + * This field exists to allow the user to avoid the buildup of + * infrequently used entries in long sequences of cache images. * - * The value of this field must lie in the range - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100). + * The value of this field must lie in the range + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100). * - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit - * is imposed on number of times a prefeteched entry can appear - * in subsequent cache images. + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit + * is imposed on number of times a prefeteched entry can appear + * in subsequent cache images. * - * A value of 0 prevents prefetched entries from being included - * in cache images. + * A value of 0 prevents prefetched entries from being included + * in cache images. * - * Positive integers restrict prefetched entries to the specified - * number of appearances. + * Positive integers restrict prefetched entries to the specified + * number of appearances. * - * Note that the number of subsequent cache images that a prefetched - * entry has appeared in is tracked in an 8 bit field. Thus, while - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its - * current value, any value in excess of 255 will be the functional - * equivalent of H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE. + * Note that the number of subsequent cache images that a prefetched + * entry has appeared in is tracked in an 8 bit field. Thus, while + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its + * current value, any value in excess of 255 will be the functional + * equivalent of H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE. * ****************************************************************************/ -#define H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION 1 +#define H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION 1 -#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE -1 -#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX 100 +#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE -1 +#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX 100 typedef struct H5AC_cache_image_config_t { - int32_t version; + int version; hbool_t generate_image; hbool_t save_resize_status; - int32_t entry_ageout; + int entry_ageout; } H5AC_cache_image_config_t; #ifdef __cplusplus -- cgit v0.12 From 7c5a425360d17aa02a9bed31a396e954a9dda898 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 17 Apr 2017 13:19:20 -0500 Subject: ignore java classpath --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7424325..3caf16a 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ src/H5config.h.in src/H5overflow.h src/H5version.h +/.classpath -- cgit v0.12 From e718e2ab319d398ed28d39e6119e9a128990311e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 17 Apr 2017 13:51:45 -0500 Subject: HDFFV-10170 fix command syntax --- test/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.am b/test/Makefile.am index 7d4fc7c..49b251a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -106,7 +106,7 @@ if HAVE_SHARED_CONDITIONAL # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - noinst_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la + noinst_LTLIBRARIES+=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c -- cgit v0.12 From 32b8d5ffc897adae1507c5552383ca25dc6a83b8 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 18 Apr 2017 09:21:36 -0500 Subject: added point to build script repo. --- release_docs/INSTALL_parallel | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/release_docs/INSTALL_parallel b/release_docs/INSTALL_parallel index e4c540c..5a8b603 100644 --- a/release_docs/INSTALL_parallel +++ b/release_docs/INSTALL_parallel @@ -1,6 +1,18 @@ Installation instructions for Parallel HDF5 ------------------------------------------- +0. Use Build Scripts +-------------------- +The HDF Group is accumulating build scripts to handle building parallel HDF5 +on various platforms (Cray, IBM, SGI, etc...). These scripts are being +maintained and updated continuously for current and future systems. The reader +is strongly encouraged to consult the repository at, + +https://github.com/HDFGroup/build_hdf5 + +for building parallel HDF5 on these system. All contributions, additions +and fixes to the repository are welcomed and encouraged. + 1. Overview ----------- -- cgit v0.12 From 9b234d74bb99c8656b5bee137a37edd35d3a6c9a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Apr 2017 10:38:14 -0500 Subject: Add plugin options for libs --- java/src/jni/Makefile.am | 2 +- test/Makefile.am | 4 ++++ tools/test/h5dump/Makefile.am | 4 ++-- tools/test/h5repack/Makefile.am | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/java/src/jni/Makefile.am b/java/src/jni/Makefile.am index 4667407..cf627ef 100644 --- a/java/src/jni/Makefile.am +++ b/java/src/jni/Makefile.am @@ -31,7 +31,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/java/src/jni $(JNIFLAGS) lib_LTLIBRARIES=libhdf5_java.la # Add libtool numbers to the HDF5 Java (JNI) library (from config/lt_vers.am) -libhdf5_java_la_LDFLAGS= -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) +libhdf5_java_la_LDFLAGS = -module -shared -export-dynamic -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) # Source files for the library libhdf5_java_la_SOURCES=exceptionImp.c h5Constants.c nativeData.c h5util.c h5Imp.c \ diff --git a/test/Makefile.am b/test/Makefile.am index 49b251a..376291a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -111,6 +111,10 @@ if HAVE_SHARED_CONDITIONAL libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c libdynlib4_la_SOURCES=dynlib4.c + libdynlib1_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlib2_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic else # The libh5test library provides common support code for the tests. diff --git a/tools/test/h5dump/Makefile.am b/tools/test/h5dump/Makefile.am index a3d1df7..6d8205d 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -41,9 +41,9 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibdump.la + noinst_LTLIBRARIES=libdynlibdump.la libdynlibdump_la_SOURCES=dynlib_dump.c - + libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic install-exec-hook: $(RM) $(DESTDIR)$(libdir)/*dynlib* endif diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index 22c6d96..a15f4a6 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -50,7 +50,8 @@ if HAVE_SHARED_CONDITIONAL noinst_LTLIBRARIES=libdynlibadd.la libdynlibvers.la libdynlibadd_la_SOURCES=dynlib_rpk.c libdynlibvers_la_SOURCES=dynlib_vrpk.c - + libdynlibadd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlibvers_la_LDFLAGS = -avoid-version -module -shared -export-dynamic endif # Temporary files. *.h5 are generated by h5repack. They should -- cgit v0.12 From 0b226bd28beb02165f18a9e3fdc985028ce37946 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Apr 2017 11:04:22 -0500 Subject: HDFFV-10170 undo patch --- test/Makefile.am | 13 ++++++------- tools/test/h5dump/Makefile.am | 3 ++- tools/test/h5repack/Makefile.am | 5 ++++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 376291a..79dc17f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -100,13 +100,13 @@ if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) endif -if HAVE_SHARED_CONDITIONAL - # The libh5test library provides common support code for the tests. - noinst_LTLIBRARIES=libh5test.la +# The libh5test library provides common support code for the tests. +noinst_LTLIBRARIES=libh5test.la +if HAVE_SHARED_CONDITIONAL # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - noinst_LTLIBRARIES+=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la + lib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c @@ -116,9 +116,8 @@ if HAVE_SHARED_CONDITIONAL libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -else - # The libh5test library provides common support code for the tests. - noinst_LTLIBRARIES=libh5test.la +install-exec-hook: + $(RM) $(DESTDIR)$(libdir)/*dynlib* endif libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c diff --git a/tools/test/h5dump/Makefile.am b/tools/test/h5dump/Makefile.am index 6d8205d..8723c65 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -41,9 +41,10 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - noinst_LTLIBRARIES=libdynlibdump.la + lib_LTLIBRARIES=libdynlibdump.la libdynlibdump_la_SOURCES=dynlib_dump.c libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + install-exec-hook: $(RM) $(DESTDIR)$(libdir)/*dynlib* endif diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index a15f4a6..375df47 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -47,11 +47,14 @@ h5repacktst_SOURCES=h5repacktst.c if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - noinst_LTLIBRARIES=libdynlibadd.la libdynlibvers.la + lib_LTLIBRARIES=libdynlibadd.la libdynlibvers.la libdynlibadd_la_SOURCES=dynlib_rpk.c libdynlibvers_la_SOURCES=dynlib_vrpk.c libdynlibadd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic libdynlibvers_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + +install-exec-hook: + $(RM) $(DESTDIR)$(libdir)/*dynlib* endif # Temporary files. *.h5 are generated by h5repack. They should -- cgit v0.12 From 5bbaae4495eb6f2eea309e886bccbc6051b6f534 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Apr 2017 11:44:47 -0500 Subject: java jni lib also needs to avoid the version-info --- java/src/jni/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/jni/Makefile.am b/java/src/jni/Makefile.am index cf627ef..5672864 100644 --- a/java/src/jni/Makefile.am +++ b/java/src/jni/Makefile.am @@ -31,7 +31,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/java/src/jni $(JNIFLAGS) lib_LTLIBRARIES=libhdf5_java.la # Add libtool numbers to the HDF5 Java (JNI) library (from config/lt_vers.am) -libhdf5_java_la_LDFLAGS = -module -shared -export-dynamic -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) +libhdf5_java_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) # Source files for the library libhdf5_java_la_SOURCES=exceptionImp.c h5Constants.c nativeData.c h5util.c h5Imp.c \ -- cgit v0.12 From b7aeefbbc95bb44ee293760461d716d4b5fc0df3 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 18 Apr 2017 13:24:00 -0500 Subject: Fix for DAILYTEST-259 h5clear test failure Deposit the test files in test/misc/testfiles for testh5clear.sh to use instead of depending on h5clear_gentest. Tested on kituo, osx1010test, quail, platypus and ostrich. --- MANIFEST | 11 ++- tools/test/misc/testfiles/h5clear_log_v3.h5 | Bin 0 -> 2048 bytes tools/test/misc/testfiles/h5clear_mdc_image.h5 | Bin 0 -> 23467 bytes tools/test/misc/testfiles/h5clear_sec2_v0.h5 | Bin 0 -> 800 bytes tools/test/misc/testfiles/h5clear_sec2_v2.h5 | Bin 0 -> 830 bytes tools/test/misc/testfiles/h5clear_sec2_v3.h5 | Bin 0 -> 195 bytes tools/test/misc/testfiles/latest_h5clear_log_v3.h5 | Bin 0 -> 2048 bytes .../test/misc/testfiles/latest_h5clear_sec2_v3.h5 | Bin 0 -> 195 bytes tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 | Bin 22048 -> 0 bytes tools/test/misc/testfiles/orig_h5clear_sec2_v0.h5 | Bin 800 -> 0 bytes tools/test/misc/testfiles/orig_h5clear_sec2_v2.h5 | Bin 830 -> 0 bytes tools/test/misc/testfiles/orig_h5clear_sec2_v3.h5 | Bin 195 -> 0 bytes tools/test/misc/testh5clear.sh.in | 84 +++++++++++---------- 13 files changed, 51 insertions(+), 44 deletions(-) create mode 100644 tools/test/misc/testfiles/h5clear_log_v3.h5 create mode 100644 tools/test/misc/testfiles/h5clear_mdc_image.h5 create mode 100644 tools/test/misc/testfiles/h5clear_sec2_v0.h5 create mode 100644 tools/test/misc/testfiles/h5clear_sec2_v2.h5 create mode 100644 tools/test/misc/testfiles/h5clear_sec2_v3.h5 create mode 100644 tools/test/misc/testfiles/latest_h5clear_log_v3.h5 create mode 100644 tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5 delete mode 100644 tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 delete mode 100644 tools/test/misc/testfiles/orig_h5clear_sec2_v0.h5 delete mode 100644 tools/test/misc/testfiles/orig_h5clear_sec2_v2.h5 delete mode 100644 tools/test/misc/testfiles/orig_h5clear_sec2_v3.h5 diff --git a/MANIFEST b/MANIFEST index 5710f6c..5f549f4 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1471,10 +1471,13 @@ ./tools/test/misc/testfiles/h5clear_no_mdc_image.ddl ./tools/test/misc/testfiles/h5clear_open_fail.ddl ./tools/test/misc/testfiles/h5clear_usage.ddl -./tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 -./tools/test/misc/testfiles/orig_h5clear_sec2_v0.h5 -./tools/test/misc/testfiles/orig_h5clear_sec2_v2.h5 -./tools/test/misc/testfiles/orig_h5clear_sec2_v3.h5 +./tools/test/misc/testfiles/h5clear_log_v3.h5 +./tools/test/misc/testfiles/h5clear_mdc_image.h5 +./tools/test/misc/testfiles/h5clear_sec2_v0.h5 +./tools/test/misc/testfiles/h5clear_sec2_v2.h5 +./tools/test/misc/testfiles/h5clear_sec2_v3.h5 +./tools/test/misc/testfiles/latest_h5clear_log_v3.h5 +./tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5 ./tools/test/misc/testfiles/h5mkgrp_help.txt ./tools/test/misc/testfiles/h5mkgrp_version.txt.in ./tools/test/misc/h5perf_gentest.c diff --git a/tools/test/misc/testfiles/h5clear_log_v3.h5 b/tools/test/misc/testfiles/h5clear_log_v3.h5 new file mode 100644 index 0000000..aed33a4 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_log_v3.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_mdc_image.h5 b/tools/test/misc/testfiles/h5clear_mdc_image.h5 new file mode 100644 index 0000000..6ed8b70 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_mdc_image.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_sec2_v0.h5 b/tools/test/misc/testfiles/h5clear_sec2_v0.h5 new file mode 100644 index 0000000..571fd46 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_sec2_v0.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_sec2_v2.h5 b/tools/test/misc/testfiles/h5clear_sec2_v2.h5 new file mode 100644 index 0000000..92833e6 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_sec2_v2.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_sec2_v3.h5 b/tools/test/misc/testfiles/h5clear_sec2_v3.h5 new file mode 100644 index 0000000..9f1e6ce Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_sec2_v3.h5 differ diff --git a/tools/test/misc/testfiles/latest_h5clear_log_v3.h5 b/tools/test/misc/testfiles/latest_h5clear_log_v3.h5 new file mode 100644 index 0000000..da5c426 Binary files /dev/null and b/tools/test/misc/testfiles/latest_h5clear_log_v3.h5 differ diff --git a/tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5 b/tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5 new file mode 100644 index 0000000..e511248 Binary files /dev/null and b/tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5 differ diff --git a/tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 b/tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 deleted file mode 100644 index 310134b..0000000 Binary files a/tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 and /dev/null differ diff --git a/tools/test/misc/testfiles/orig_h5clear_sec2_v0.h5 b/tools/test/misc/testfiles/orig_h5clear_sec2_v0.h5 deleted file mode 100644 index 571fd46..0000000 Binary files a/tools/test/misc/testfiles/orig_h5clear_sec2_v0.h5 and /dev/null differ diff --git a/tools/test/misc/testfiles/orig_h5clear_sec2_v2.h5 b/tools/test/misc/testfiles/orig_h5clear_sec2_v2.h5 deleted file mode 100644 index 92833e6..0000000 Binary files a/tools/test/misc/testfiles/orig_h5clear_sec2_v2.h5 and /dev/null differ diff --git a/tools/test/misc/testfiles/orig_h5clear_sec2_v3.h5 b/tools/test/misc/testfiles/orig_h5clear_sec2_v3.h5 deleted file mode 100644 index 9f1e6ce..0000000 Binary files a/tools/test/misc/testfiles/orig_h5clear_sec2_v3.h5 and /dev/null differ diff --git a/tools/test/misc/testh5clear.sh.in b/tools/test/misc/testh5clear.sh.in index 71d5cad..a31b824 100644 --- a/tools/test/misc/testh5clear.sh.in +++ b/tools/test/misc/testh5clear.sh.in @@ -68,10 +68,13 @@ $SRC_H5CLEAR_TESTFILES/h5clear_usage.ddl $SRC_H5CLEAR_TESTFILES/h5clear_open_fail.ddl $SRC_H5CLEAR_TESTFILES/h5clear_missing_file.ddl $SRC_H5CLEAR_TESTFILES/h5clear_no_mdc_image.ddl -$SRC_H5CLEAR_TESTFILES/orig_h5clear_sec2_v0.h5 -$SRC_H5CLEAR_TESTFILES/orig_h5clear_sec2_v2.h5 -$SRC_H5CLEAR_TESTFILES/orig_h5clear_sec2_v3.h5 -$SRC_H5CLEAR_TESTFILES/mod_h5clear_mdc_image.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_sec2_v0.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_sec2_v2.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_sec2_v3.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_log_v3.h5 +$SRC_H5CLEAR_TESTFILES/latest_h5clear_log_v3.h5 +$SRC_H5CLEAR_TESTFILES/latest_h5clear_sec2_v3.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_mdc_image.h5 " COPY_TESTFILES_TO_TESTDIR() @@ -121,8 +124,8 @@ CLEAN_TESTFILES_AND_TESTDIR() # beginning with the word "Testing". # TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-74 | tr -d '\012' } # $1 is the expected output @@ -226,29 +229,27 @@ COPY_TESTFILES_TO_TESTDIR # "h5clear -h" # "h5clear" (no options, no file) # "h5clear junk.h5" (no options, nonexisting file) -# "h5clear orig_h5clear_sec2_v3.h5" (no options, existing file) +# "h5clear h5clear_sec2_v3.h5" (no options, existing file) # "h5clear -m" (valid 1 option, no file) # "h5clear -s junk.h5" (valid 1 option, nonexisting file) -# "h5clear -m -s junk.h5" (valid 2 options, no file) +# "h5clear -m -s" (valid 2 options, no file) # "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) -# "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) -# "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) +# "h5clear -m h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) +# "h5clear -s -m h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) TOOLTEST_OUT "" -h "" h5clear_usage.ddl TOOLTEST_OUT "" "" "" h5clear_usage.ddl TOOLTEST_OUT junk.h5 "" "" h5clear_usage.ddl -TOOLTEST_OUT $TESTDIR/orig_h5clear_sec2_v3.h5 "" "" h5clear_usage.ddl +TOOLTEST_OUT $TESTDIR/h5clear_sec2_v3.h5 "" "" h5clear_usage.ddl TOOLTEST_OUT "" -m "" h5clear_missing_file.ddl TOOLTEST_OUT junk.h5 -s "" h5clear_open_fail.ddl TOOLTEST_OUT "" -m -s h5clear_missing_file.ddl TOOLTEST_OUT junk.h5 -m -s h5clear_open_fail.ddl -TOOLTEST_OUT $TESTDIR/orig_h5clear_sec2_v2.h5 -m "" h5clear_no_mdc_image.ddl -TOOLTEST_OUT $TESTDIR/orig_h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl +TOOLTEST_OUT $TESTDIR/h5clear_sec2_v2.h5 -m "" h5clear_no_mdc_image.ddl +TOOLTEST_OUT $TESTDIR/h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl # # # # The following are tests to verify the expected exit code from h5clear: -# "h5clear -m h5clear_mdc_image.h5" (valid option, existing file, succeed exit code) -# "h5clear --vers" (valid option, version #, succeed exit code) # "h5clear -k" (invalid 1 option, no file, fail exit code) # "h5clear -k junk.h5" (invalid 1 option, nonexisting file, fail exit code) # "h5clear -l h5clear_sec2_v2.h5" (invalid 1 option, existing file, fail exit code) @@ -258,52 +259,55 @@ TOOLTEST_OUT $TESTDIR/orig_h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl # "h5clear -l -m junk.h5" (invalid/valid 2 options, nonexisting file, fail exit code) # "h5clear -m -k h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code) # "h5clear -l -m h5clear_sec2_v0.h5" (invalid/valid 2 options, existing file, fail exit code) -TOOLTEST h5clear_mdc_image.h5 -m "" $SUCCEED -TOOLTEST "" --vers "" $SUCCEED TOOLTEST "" -k "" $FAIL TOOLTEST junk.h5 -k "" $FAIL TOOLTEST h5clear_sec2_v2.h5 -l "" $FAIL TOOLTEST "" -m -k $FAIL TOOLTEST "" -l -m $FAIL -TOOLTEST junk.h5 -m -l $FAIL +TOOLTEST junk.h5 -m -k $FAIL TOOLTEST junk.h5 -l -m $FAIL -TOOLTEST h5clear_sec2_v0.h5 -m -l $FAIL -TOOLTEST h5clear_sec2_v0.h5 -l -m $FAIL +TOOLTEST $TESTDIR/h5clear_sec2_v0.h5 -m -k $FAIL +TOOLTEST $TESTDIR/h5clear_sec2_v0.h5 -l -m $FAIL +# +# "h5clear --vers" (valid option, version #, succeed exit code) +# "h5clear -m h5clear_mdc_image.h5" (valid option, existing file, succeed exit code) +TOOLTEST "" --vers "" $SUCCEED +TOOLTEST $TESTDIR/h5clear_mdc_image.h5 -m "" $SUCCEED # # # # h5clear_mdc_image.h5 already has cache image removed earlier, verify the expected warning from h5clear: -TOOLTEST_OUT $TESTDIR/mod_h5clear_mdc_image.h5 -m "" h5clear_no_mdc_image.ddl -TOOLTEST_OUT $TESTDIR/mod_h5clear_mdc_image.h5 -s -m h5clear_no_mdc_image.ddl +TOOLTEST_OUT $TESTDIR/h5clear_mdc_image.h5 -m "" h5clear_no_mdc_image.ddl +TOOLTEST_OUT $TESTDIR/h5clear_mdc_image.h5 -s -m h5clear_no_mdc_image.ddl # # # # The following are tests to verify the status_flags field is cleared properly: -OPEN_CHK h5clear_sec2_v3.h5 $FAIL -TOOLTEST h5clear_sec2_v3.h5 -s "" $SUCCEED -OPEN_CHK h5clear_sec2_v3.h5 $SUCCEED +OPEN_CHK $TESTDIR/h5clear_sec2_v3.h5 $FAIL +TOOLTEST $TESTDIR/h5clear_sec2_v3.h5 -s "" $SUCCEED +OPEN_CHK $TESTDIR/h5clear_sec2_v3.h5 $SUCCEED # -OPEN_CHK h5clear_log_v3.h5 $FAIL -TOOLTEST h5clear_log_v3.h5 -s "" $SUCCEED -OPEN_CHK h5clear_log_v3.h5 $SUCCEED +OPEN_CHK $TESTDIR/h5clear_log_v3.h5 $FAIL +TOOLTEST $TESTDIR/h5clear_log_v3.h5 -s "" $SUCCEED +OPEN_CHK $TESTDIR/h5clear_log_v3.h5 $SUCCEED # -OPEN_CHK latest_h5clear_sec2_v3.h5 $FAIL -TOOLTEST latest_h5clear_sec2_v3.h5 -s "" $SUCCEED -OPEN_CHK latest_h5clear_sec2_v3.h5 $SUCCEED +OPEN_CHK $TESTDIR/latest_h5clear_sec2_v3.h5 $FAIL +TOOLTEST $TESTDIR/latest_h5clear_sec2_v3.h5 -s "" $SUCCEED +OPEN_CHK $TESTDIR/latest_h5clear_sec2_v3.h5 $SUCCEED # -OPEN_CHK latest_h5clear_log_v3.h5 $FAIL -TOOLTEST latest_h5clear_log_v3.h5 -s "" $SUCCEED -OPEN_CHK latest_h5clear_log_v3.h5 $SUCCEED +OPEN_CHK $TESTDIR/latest_h5clear_log_v3.h5 $FAIL +TOOLTEST $TESTDIR/latest_h5clear_log_v3.h5 -s "" $SUCCEED +OPEN_CHK $TESTDIR/latest_h5clear_log_v3.h5 $SUCCEED # # File open succeeds for the following 2 test files because the # library does not check status_flags for files with < v3 superblock: -OPEN_CHK h5clear_sec2_v0.h5 $SUCCEED -TOOLTEST h5clear_sec2_v0.h5 -s "" $SUCCEED -OPEN_CHK h5clear_sec2_v0.h5 $SUCCEED +OPEN_CHK $TESTDIR/h5clear_sec2_v0.h5 $SUCCEED +TOOLTEST $TESTDIR/h5clear_sec2_v0.h5 -s "" $SUCCEED +OPEN_CHK $TESTDIR/h5clear_sec2_v0.h5 $SUCCEED # -OPEN_CHK h5clear_sec2_v2.h5 $SUCCEED -TOOLTEST h5clear_sec2_v2.h5 -s "" $SUCCEED -OPEN_CHK h5clear_sec2_v2.h5 $SUCCEED +OPEN_CHK $TESTDIR/h5clear_sec2_v2.h5 $SUCCEED +TOOLTEST $TESTDIR/h5clear_sec2_v2.h5 -s "" $SUCCEED +OPEN_CHK $TESTDIR/h5clear_sec2_v2.h5 $SUCCEED # # # -- cgit v0.12 From 9f1fd68ce2918f9d67a5b93ffa3dee35d21f5848 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Apr 2017 13:27:54 -0500 Subject: LDFLAGS module forces .so lib to be built on osx instead of .dylib --- java/src/jni/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/jni/Makefile.am b/java/src/jni/Makefile.am index 5672864..fdf6608 100644 --- a/java/src/jni/Makefile.am +++ b/java/src/jni/Makefile.am @@ -31,7 +31,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/java/src/jni $(JNIFLAGS) lib_LTLIBRARIES=libhdf5_java.la # Add libtool numbers to the HDF5 Java (JNI) library (from config/lt_vers.am) -libhdf5_java_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) +libhdf5_java_la_LDFLAGS = -avoid-version -shared -export-dynamic -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) # Source files for the library libhdf5_java_la_SOURCES=exceptionImp.c h5Constants.c nativeData.c h5util.c h5Imp.c \ -- cgit v0.12 From 62770c64326f844739c2753bfee49c297f2c7a39 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Apr 2017 14:23:35 -0500 Subject: Update tool dyn lib --- tools/test/h5diff/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/test/h5diff/Makefile.am b/tools/test/h5diff/Makefile.am index 1d700ea..16897c6 100644 --- a/tools/test/h5diff/Makefile.am +++ b/tools/test/h5diff/Makefile.am @@ -54,6 +54,7 @@ if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. lib_LTLIBRARIES=libdynlibdiff.la libdynlibdiff_la_SOURCES=dynlib_diff.c + libdynlibdiff_la_LDFLAGS = -avoid-version -module -shared -export-dynamic install-exec-hook: $(RM) $(DESTDIR)$(libdir)/*dynlib* -- cgit v0.12 From d594cb2cc6d73ef2dd7ddfee689cdda23827e03e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 19 Apr 2017 18:28:21 -0400 Subject: Added code to disable the evict-on-close feature in the parallel library. --- src/H5Pfapl.c | 21 ++++++++++- test/cache_image.c | 8 ++++ test/evict_on_close.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+), 2 deletions(-) diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 7865fdf..8bd53a9 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -4381,7 +4381,19 @@ H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_ *------------------------------------------------------------------------- */ herr_t -H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close) +H5Pset_evict_on_close( +#if defined(H5_HAVE_PARALLEL) && !defined(H5_DEBUG_BUILD) + hid_t H5_ATTR_UNUSED fapl_id, +#else + hid_t fapl_id, +#endif /* H5_HAVE_PARALLEL and !H5_DEBUG_BUILD */ + +#ifdef H5_HAVE_PARALLEL + hbool_t H5_ATTR_UNUSED evict_on_close +#else + hbool_t evict_on_close +#endif /* H5_HAVE_PARALLEL */ +) { H5P_genplist_t *plist; /* property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -4389,6 +4401,7 @@ H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close) FUNC_ENTER_API(FAIL) H5TRACE2("e", "ib", fapl_id, evict_on_close); + /* Compare the property list's class against the other class */ if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not a file access plist") @@ -4397,9 +4410,13 @@ H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close) if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Set values */ +#ifndef H5_HAVE_PARALLEL + /* Set value */ if(H5P_set(plist, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, &evict_on_close) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set evict on close property") +#else + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "evict on close is currently not supported in parallel HDF5") +#endif /* H5_HAVE_PARALLEL */ done: FUNC_LEAVE_API(ret_value) diff --git a/test/cache_image.c b/test/cache_image.c index dfbd02e..31d7705 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -62,7 +62,10 @@ static unsigned cache_image_api_error_check_3(void); static unsigned cache_image_api_error_check_4(void); static unsigned get_free_sections_test(void); + +#ifndef H5_HAVE_PARALLEL static unsigned evict_on_close_test(void); +#endif /* H5_HAVE_PARALLEL */ /****************************************************************************/ @@ -7711,6 +7714,7 @@ get_free_sections_test(void) * *------------------------------------------------------------------------- */ +#ifndef H5_HAVE_PARALLEL static unsigned evict_on_close_test(void) { @@ -8015,6 +8019,7 @@ evict_on_close_test(void) return !pass; } /* evict_on_close_test() */ +#endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- @@ -8066,7 +8071,10 @@ main(void) nerrs += cache_image_api_error_check_4(); nerrs += get_free_sections_test(); + +#ifndef H5_HAVE_PARALLEL nerrs += evict_on_close_test(); +#endif /* H5_HAVE_PARALLEL */ return(nerrs > 0); diff --git a/test/evict_on_close.c b/test/evict_on_close.c index b00c1e4..8196ea1 100644 --- a/test/evict_on_close.c +++ b/test/evict_on_close.c @@ -39,6 +39,12 @@ #include "H5Gpkg.h" #include "H5Ipkg.h" +/* Evict on close is not supported under parallel at this time. + * In the meantime, we just run a simple check that EoC can't be + * enabled in parallel HDF5. + */ +#ifndef H5_HAVE_PARALLEL + /* Uncomment to manually inspect cache states */ /* (Requires debug build of the library) */ /* #define EOC_MANUAL_INSPECTION */ @@ -802,6 +808,7 @@ error: } /* check_dset_scheme() */ + /*------------------------------------------------------------------------- * Function: check_evict_on_close_api() @@ -992,3 +999,96 @@ error: } /* end main() */ +#else + + +/*------------------------------------------------------------------------- + * Function: check_evict_on_close_parallel_fail() + * + * Purpose: Verify that the H5Pset_evict_on_close() call fails in + * parallel HDF5. + * + * Return: SUCCEED/FAIL + * + * Programmer: Dana Robinson + * Spring 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +check_evict_on_close_parallel_fail(void) +{ + hid_t fapl_id = -1; + hbool_t evict_on_close; + herr_t status; + + TESTING("evict on close fails in parallel"); + + /* Create a fapl */ + if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; + + /* Set the evict on close property (should fail)*/ + evict_on_close = TRUE; + H5E_BEGIN_TRY { + status = H5Pset_evict_on_close(fapl_id, evict_on_close); + } H5E_END_TRY; + if(status >= 0) + FAIL_PUTS_ERROR("H5Pset_evict_on_close() did not fail in parallel HDF5."); + + /* close fapl */ + if(H5Pclose(fapl_id) < 0) + TEST_ERROR; + + PASSED(); + return SUCCEED; + +error: + H5_FAILED(); + return FAIL; + +} /* check_evict_on_close_parallel_fail() */ + + +/*------------------------------------------------------------------------- + * Function: main (parallel version) + * + * Return: EXIT_FAILURE/EXIT_SUCCESS + * + * Programmer: Dana Robinson + * Spring 2016 + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + unsigned nerrors = 0; /* number of test errors */ + + HDprintf("Testing evict-on-close cache behavior\n"); + + /* Initialize */ + h5_reset(); + + /* Test that EoC fails in parallel HDF5 */ + nerrors += check_evict_on_close_parallel_fail() < 0 ? 1 : 0; + + if(nerrors) + goto error; + + HDprintf("All evict-on-close tests passed.\n"); + HDprintf("Note that EoC is not supported under parallel so most tests are skipped.\n"); + + return EXIT_SUCCESS; + +error: + + HDprintf("***** %u evict-on-close test%s FAILED! *****\n", + nerrors, nerrors > 1 ? "S" : ""); + + return EXIT_FAILURE; + +} /* main() - parallel */ + +#endif /* H5_HAVE_PARALLEL */ + -- cgit v0.12 From 43e03c548ae2c405b92f95833251683d3eeb1440 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 19 Apr 2017 22:51:39 -0500 Subject: Modifications based on review comments from pull request. Made changes according to review comments and discussion with Allen. --- MANIFEST | 1 + tools/test/misc/h5clear_gentest.c | 118 ++++++++++----------- tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 | Bin 0 -> 22048 bytes tools/test/misc/testh5clear.sh.in | 104 ++++++++++-------- 4 files changed, 117 insertions(+), 106 deletions(-) create mode 100644 tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 diff --git a/MANIFEST b/MANIFEST index 5f549f4..27781b8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1478,6 +1478,7 @@ ./tools/test/misc/testfiles/h5clear_sec2_v3.h5 ./tools/test/misc/testfiles/latest_h5clear_log_v3.h5 ./tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5 +./tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 ./tools/test/misc/testfiles/h5mkgrp_help.txt ./tools/test/misc/testfiles/h5mkgrp_version.txt.in ./tools/test/misc/h5perf_gentest.c diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index f8b6a70..86ea3d2 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -142,7 +142,7 @@ error: * status_flags properly so users can open the files afterwards. * * Return: Success: 0 - * Failure: 1 + * Failure: 1 * * Programmer: Vailin Choi; July 2013 * @@ -167,65 +167,65 @@ main(void) /* Create a copy of the file access property list */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + goto error; /* Copy the file access property list */ if((new_fapl = H5Pcopy(fapl)) < 0) - goto error; + goto error; /* Set to latest library format */ if(H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto error; + goto error; /* Files created within this for loop will have v3 superblock and nonzero status_flags */ for(new_format = FALSE; new_format <= TRUE; new_format++) { - hid_t fapl2, my_fapl; /* File access property lists */ - - /* Set to use the appropriate file access property list */ - if(new_format) - fapl2 = new_fapl; - else - fapl2 = fapl; - /* - * Create a sec2 file - */ - if((my_fapl = H5Pcopy(fapl2)) < 0) - goto error; - /* Create the file */ - sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[0]); - if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) - goto error; - - /* Flush the file */ - if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) - goto error; + hid_t fapl2, my_fapl; /* File access property lists */ + + /* Set to use the appropriate file access property list */ + if(new_format) + fapl2 = new_fapl; + else + fapl2 = fapl; + /* + * Create a sec2 file + */ + if((my_fapl = H5Pcopy(fapl2)) < 0) + goto error; + /* Create the file */ + sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[0]); + if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) + goto error; + + /* Flush the file */ + if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) + goto error; - /* Close the property list */ - if(H5Pclose(my_fapl) < 0) - goto error; - - /* - * Create a log file - */ - /* Create a copy of file access property list */ - if((my_fapl = H5Pcopy(fapl2)) < 0) - goto error; - - /* Setup the fapl for the log driver */ - if(H5Pset_fapl_log(my_fapl, "append.log", (unsigned long long)H5FD_LOG_ALL, (size_t)(4 * KB)) < 0) - goto error; - - /* Create the file */ - sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[1]); - if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) - goto error; - - /* Flush the file */ - if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) - goto error; - - /* Close the property list */ - if(H5Pclose(my_fapl) < 0) - goto error; + /* Close the property list */ + if(H5Pclose(my_fapl) < 0) + goto error; + + /* + * Create a log file + */ + /* Create a copy of file access property list */ + if((my_fapl = H5Pcopy(fapl2)) < 0) + goto error; + + /* Setup the fapl for the log driver */ + if(H5Pset_fapl_log(my_fapl, "append.log", (unsigned long long)H5FD_LOG_ALL, (size_t)(4 * KB)) < 0) + goto error; + + /* Create the file */ + sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[1]); + if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) + goto error; + + /* Flush the file */ + if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) + goto error; + + /* Close the property list */ + if(H5Pclose(my_fapl) < 0) + goto error; } /* end for */ @@ -233,38 +233,38 @@ main(void) * Create a sec2 file with v0 superblock but nonzero status_flags */ if((fid = H5Fcreate(FILENAME[2], H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; /* Flush the file */ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) - goto error; + goto error; /* * Create a sec2 file with v2 superblock but nonzero status_flags */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; + goto error; if(H5Pset_shared_mesg_nindexes(fcpl, 1) < 0) goto error; if(H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 50) < 0) goto error; if((fid = H5Fcreate(FILENAME[3], H5F_ACC_TRUNC, fcpl, fapl)) < 0) - goto error; + goto error; /* Flush the file */ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) - goto error; + goto error; /* Close the property lists */ if(H5Pclose(fapl) < 0) - goto error; + goto error; if(H5Pclose(new_fapl) < 0) - goto error; + goto error; if(H5Pclose(fcpl) < 0) - goto error; + goto error; fflush(stdout); fflush(stderr); diff --git a/tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 b/tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 new file mode 100644 index 0000000..310134b Binary files /dev/null and b/tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 differ diff --git a/tools/test/misc/testh5clear.sh.in b/tools/test/misc/testh5clear.sh.in index a31b824..b855572 100644 --- a/tools/test/misc/testh5clear.sh.in +++ b/tools/test/misc/testh5clear.sh.in @@ -75,6 +75,7 @@ $SRC_H5CLEAR_TESTFILES/h5clear_log_v3.h5 $SRC_H5CLEAR_TESTFILES/latest_h5clear_log_v3.h5 $SRC_H5CLEAR_TESTFILES/latest_h5clear_sec2_v3.h5 $SRC_H5CLEAR_TESTFILES/h5clear_mdc_image.h5 +$SRC_H5CLEAR_TESTFILES/mod_h5clear_mdc_image.h5 " COPY_TESTFILES_TO_TESTDIR() @@ -124,8 +125,8 @@ CLEAN_TESTFILES_AND_TESTDIR() # beginning with the word "Testing". # TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-74 | tr -d '\012' + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' } # $1 is the expected output @@ -164,6 +165,7 @@ TOOLTEST_OUT() { # Run test. TESTING $H5CLEAR $option1 $option2 $fname ( + cd $TESTDIR $RUNSERIAL $H5CLEAR_BIN $option1 $option2 $fname ) >$actual 2>$actual_err cp $actual $actual_sav @@ -184,7 +186,10 @@ TOOLTEST_OUT() { OPEN_CHK() { fname=$1 expected=$2 - $OPENCHK_BIN $fname 2>/dev/null + ( + cd $TESTDIR + $OPENCHK_BIN $fname 2>/dev/null + ) actual=$? if test $actual -ne $expected; then echo "Unexpected return from $OPENCHK" @@ -204,9 +209,11 @@ TOOLTEST() { ret_expected=$4 # TESTING $H5CLEAR $option1 $option2 $fname - fname=$1 # h5clear $option1 $option2 $fname - $RUNSERIAL $H5CLEAR_BIN $option1 $option2 $fname 2>/dev/null 1>/dev/null + ( + cd $TESTDIR + $RUNSERIAL $H5CLEAR_BIN $option1 $option2 $fname 2>/dev/null 1>/dev/null + ) if test $? -ne $ret_expected; then echo "*FAILED*" nerrors=`expr $nerrors + 1` @@ -222,92 +229,95 @@ TOOLTEST() { ############################################################################## # prepare for testing COPY_TESTFILES_TO_TESTDIR +# For Cmake +$CP -f $TESTDIR/h5clear_sec2_v0.h5 $TESTDIR/orig_h5clear_sec2_v0.h5 +$CP -f $TESTDIR/h5clear_sec2_v2.h5 $TESTDIR/orig_h5clear_sec2_v2.h5 +$CP -f $TESTDIR/h5clear_sec2_v3.h5 $TESTDIR/orig_h5clear_sec2_v3.h5 # # # # The following are tests to verify the expected output from h5clear # "h5clear -h" -# "h5clear" (no options, no file) -# "h5clear junk.h5" (no options, nonexisting file) -# "h5clear h5clear_sec2_v3.h5" (no options, existing file) -# "h5clear -m" (valid 1 option, no file) -# "h5clear -s junk.h5" (valid 1 option, nonexisting file) -# "h5clear -m -s" (valid 2 options, no file) -# "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) -# "h5clear -m h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) -# "h5clear -s -m h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) +# "h5clear" (no options, no file) +# "h5clear junk.h5" (no options, nonexisting file) +# "h5clear orig_h5clear_sec2_v3.h5" (no options, existing file) +# "h5clear -m" (valid 1 option, no file) +# "h5clear -s junk.h5" (valid 1 option, nonexisting file) +# "h5clear -m -s" (valid 2 options, no file) +# "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) +# "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) +# "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) TOOLTEST_OUT "" -h "" h5clear_usage.ddl TOOLTEST_OUT "" "" "" h5clear_usage.ddl TOOLTEST_OUT junk.h5 "" "" h5clear_usage.ddl -TOOLTEST_OUT $TESTDIR/h5clear_sec2_v3.h5 "" "" h5clear_usage.ddl +TOOLTEST_OUT orig_h5clear_sec2_v3.h5 "" "" h5clear_usage.ddl TOOLTEST_OUT "" -m "" h5clear_missing_file.ddl TOOLTEST_OUT junk.h5 -s "" h5clear_open_fail.ddl TOOLTEST_OUT "" -m -s h5clear_missing_file.ddl TOOLTEST_OUT junk.h5 -m -s h5clear_open_fail.ddl -TOOLTEST_OUT $TESTDIR/h5clear_sec2_v2.h5 -m "" h5clear_no_mdc_image.ddl -TOOLTEST_OUT $TESTDIR/h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl +TOOLTEST_OUT orig_h5clear_sec2_v2.h5 -m "" h5clear_no_mdc_image.ddl +TOOLTEST_OUT orig_h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl # # # # The following are tests to verify the expected exit code from h5clear: +# "h5clear -m h5clear_mdc_image.h5" (valid option, existing file, succeed exit code) +# "h5clear --vers" (valid option, version #, succeed exit code) # "h5clear -k" (invalid 1 option, no file, fail exit code) # "h5clear -k junk.h5" (invalid 1 option, nonexisting file, fail exit code) # "h5clear -l h5clear_sec2_v2.h5" (invalid 1 option, existing file, fail exit code) # "h5clear -m -k" (valid/invalid 2 options, nofile, fail exit code) # "h5clear -l -m" (invalid/valid 2 options, nofile, fail exit code) -# "h5clear -m -k junk.h5" (valid/invalid 2 options, nonexisting file, fail exit code) +# "h5clear -m -l junk.h5" (valid/invalid 2 options, nonexisting file, fail exit code) # "h5clear -l -m junk.h5" (invalid/valid 2 options, nonexisting file, fail exit code) -# "h5clear -m -k h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code) +# "h5clear -m -l h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code) # "h5clear -l -m h5clear_sec2_v0.h5" (invalid/valid 2 options, existing file, fail exit code) +TOOLTEST h5clear_mdc_image.h5 -m "" $SUCCEED +TOOLTEST "" --vers "" $SUCCEED TOOLTEST "" -k "" $FAIL TOOLTEST junk.h5 -k "" $FAIL TOOLTEST h5clear_sec2_v2.h5 -l "" $FAIL TOOLTEST "" -m -k $FAIL TOOLTEST "" -l -m $FAIL -TOOLTEST junk.h5 -m -k $FAIL +TOOLTEST junk.h5 -m -l $FAIL TOOLTEST junk.h5 -l -m $FAIL -TOOLTEST $TESTDIR/h5clear_sec2_v0.h5 -m -k $FAIL -TOOLTEST $TESTDIR/h5clear_sec2_v0.h5 -l -m $FAIL -# -# "h5clear --vers" (valid option, version #, succeed exit code) -# "h5clear -m h5clear_mdc_image.h5" (valid option, existing file, succeed exit code) -TOOLTEST "" --vers "" $SUCCEED -TOOLTEST $TESTDIR/h5clear_mdc_image.h5 -m "" $SUCCEED +TOOLTEST h5clear_sec2_v0.h5 -m -l $FAIL +TOOLTEST h5clear_sec2_v0.h5 -l -m $FAIL # # # # h5clear_mdc_image.h5 already has cache image removed earlier, verify the expected warning from h5clear: -TOOLTEST_OUT $TESTDIR/h5clear_mdc_image.h5 -m "" h5clear_no_mdc_image.ddl -TOOLTEST_OUT $TESTDIR/h5clear_mdc_image.h5 -s -m h5clear_no_mdc_image.ddl +TOOLTEST_OUT mod_h5clear_mdc_image.h5 -m "" h5clear_no_mdc_image.ddl +TOOLTEST_OUT mod_h5clear_mdc_image.h5 -s -m h5clear_no_mdc_image.ddl # # # # The following are tests to verify the status_flags field is cleared properly: -OPEN_CHK $TESTDIR/h5clear_sec2_v3.h5 $FAIL -TOOLTEST $TESTDIR/h5clear_sec2_v3.h5 -s "" $SUCCEED -OPEN_CHK $TESTDIR/h5clear_sec2_v3.h5 $SUCCEED +OPEN_CHK h5clear_sec2_v3.h5 $FAIL +TOOLTEST h5clear_sec2_v3.h5 -s "" $SUCCEED +OPEN_CHK h5clear_sec2_v3.h5 $SUCCEED # -OPEN_CHK $TESTDIR/h5clear_log_v3.h5 $FAIL -TOOLTEST $TESTDIR/h5clear_log_v3.h5 -s "" $SUCCEED -OPEN_CHK $TESTDIR/h5clear_log_v3.h5 $SUCCEED +OPEN_CHK h5clear_log_v3.h5 $FAIL +TOOLTEST h5clear_log_v3.h5 -s "" $SUCCEED +OPEN_CHK h5clear_log_v3.h5 $SUCCEED # -OPEN_CHK $TESTDIR/latest_h5clear_sec2_v3.h5 $FAIL -TOOLTEST $TESTDIR/latest_h5clear_sec2_v3.h5 -s "" $SUCCEED -OPEN_CHK $TESTDIR/latest_h5clear_sec2_v3.h5 $SUCCEED +OPEN_CHK latest_h5clear_sec2_v3.h5 $FAIL +TOOLTEST latest_h5clear_sec2_v3.h5 -s "" $SUCCEED +OPEN_CHK latest_h5clear_sec2_v3.h5 $SUCCEED # -OPEN_CHK $TESTDIR/latest_h5clear_log_v3.h5 $FAIL -TOOLTEST $TESTDIR/latest_h5clear_log_v3.h5 -s "" $SUCCEED -OPEN_CHK $TESTDIR/latest_h5clear_log_v3.h5 $SUCCEED +OPEN_CHK latest_h5clear_log_v3.h5 $FAIL +TOOLTEST latest_h5clear_log_v3.h5 -s "" $SUCCEED +OPEN_CHK latest_h5clear_log_v3.h5 $SUCCEED # # File open succeeds for the following 2 test files because the # library does not check status_flags for files with < v3 superblock: -OPEN_CHK $TESTDIR/h5clear_sec2_v0.h5 $SUCCEED -TOOLTEST $TESTDIR/h5clear_sec2_v0.h5 -s "" $SUCCEED -OPEN_CHK $TESTDIR/h5clear_sec2_v0.h5 $SUCCEED +OPEN_CHK h5clear_sec2_v0.h5 $SUCCEED +TOOLTEST h5clear_sec2_v0.h5 -s "" $SUCCEED +OPEN_CHK h5clear_sec2_v0.h5 $SUCCEED # -OPEN_CHK $TESTDIR/h5clear_sec2_v2.h5 $SUCCEED -TOOLTEST $TESTDIR/h5clear_sec2_v2.h5 -s "" $SUCCEED -OPEN_CHK $TESTDIR/h5clear_sec2_v2.h5 $SUCCEED +OPEN_CHK h5clear_sec2_v2.h5 $SUCCEED +TOOLTEST h5clear_sec2_v2.h5 -s "" $SUCCEED +OPEN_CHK h5clear_sec2_v2.h5 $SUCCEED # # # -- cgit v0.12 From ea46fbe7c2bb3a8c8972c880f3609be20036d741 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Apr 2017 12:19:28 -0500 Subject: Correct typo of file name --- config/cmake/HDF5_Examples.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 04f72a0..2567bd8 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -87,6 +87,6 @@ if (WIN32) include (${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) include (${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) else () - include (${CTEST_SCRIPT_DIRECTORY}/HDF_Examples_options.cmake) + include (${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake) include (${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) endif () -- cgit v0.12 From 7ee229bceddc1c0cd8d9ba2b7382d6d74ba0527b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Apr 2017 13:45:27 -0500 Subject: Updates to CMake for the changes in the autotools script --- tools/test/misc/CMakeLists.txt | 13 ++--- tools/test/misc/CMakeTestsClear.cmake | 94 +++++++++++++++++++++++++++++------ 2 files changed, 87 insertions(+), 20 deletions(-) diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 97a6f0c..5e3c0a2 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -17,6 +17,13 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5repart_gentest COMMAND $) + add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c) + TARGET_NAMING (h5clear_gentest STATIC) + TARGET_C_PROPERTIES (h5clear_gentest STATIC " " " ") + target_link_libraries (h5clear_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5clear_gentest PROPERTIES FOLDER tools) + #add_test (NAME H5CLEAR-h5clear_gentest COMMAND $) + add_subdirectory (${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/vds) endif () @@ -27,12 +34,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) target_link_libraries (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart_test PROPERTIES FOLDER tools) - add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c) - TARGET_NAMING (h5clear_gentest STATIC) - TARGET_C_PROPERTIES (h5clear_gentest STATIC " " " ") - target_link_libraries (h5clear_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5clear_gentest PROPERTIES FOLDER tools) - add_executable (clear_open_chk ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/clear_open_chk.c) TARGET_NAMING (clear_open_chk STATIC) TARGET_C_PROPERTIES (clear_open_chk STATIC " " " ") diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index a92d523..5f40514 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -8,20 +8,32 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- + set (HDF5_TEST_FILES + h5clear_log_v3.h5 + h5clear_mdc_image.h5 + mod_h5clear_mdc_image.h5 + latest_h5clear_log_v3.h5 + latest_h5clear_sec2_v3.h5 + ) + set (HDF5_SEC2_TEST_FILES + h5clear_sec2_v0.h5 + h5clear_sec2_v2.h5 + h5clear_sec2_v3.h5 + ) set (HDF5_REFERENCE_TEST_FILES h5clear_usage.ddl h5clear_open_fail.ddl h5clear_missing_file.ddl h5clear_no_mdc_image.ddl - orig_h5clear_sec2_v0.h5 - orig_h5clear_sec2_v2.h5 - orig_h5clear_sec2_v3.h5 - mod_h5clear_mdc_image.h5 ) - foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + foreach (h5_file ${HDF5_TEST_FILES} ${HDF5_SEC2_TEST_FILES} ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5clear_files") endforeach () + # make second copy of h5clear_sec2.h5 + foreach (h5_file ${HDF5_SEC2_TEST_FILES}) + HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/orig_${h5_file}" "h5clear_files") + endforeach () # make second copy of mod_h5clear_mdc_image.h5 HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/mod_h5clear_mdc_image.h5" "${PROJECT_BINARY_DIR}/testfiles/mod_h5clear_mdc_image2.h5" "h5clear_files") add_custom_target(h5clear_files ALL COMMENT "Copying files needed by h5clear tests" DEPENDS ${h5clear_files_list}) @@ -73,6 +85,16 @@ macro (ADD_H5_TEST testname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5CLEAR-clear_open_chk-copy_${testname}.h5 + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/${testname}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testname}.h5" + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR-clear_open_chk-copy_${testname}.h5 PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5CLEAR-clear_open_chk-copy_${testname}.h5") # Initial file open fails OR # File open succeeds because the library does not check status_flags for file with < v3 superblock add_test (NAME H5CLEAR-clear_open_chk-${testname}_${resultcode} COMMAND $ ${testname}.h5) @@ -101,6 +123,7 @@ # # # The following are tests to verify the status_flags field is cleared properly: +if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( NAME H5CLEAR-clearall-objects @@ -111,19 +134,66 @@ h5clear_sec2_v0.h5 h5clear_sec2_v2.h5 h5clear_sec2_v3.h5 + orig_h5clear_sec2_v0.h5 + orig_h5clear_sec2_v2.h5 + orig_h5clear_sec2_v3.h5 latest_h5clear_log_v3.h5 latest_h5clear_sec2_v3.h5 + mod_h5clear_mdc_image.h5 + mod_h5clear_mdc_image2.h5 ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5CLEAR-clearall-objects PROPERTIES DEPENDS ${last_test}) endif () set (last_test "H5CLEAR-clearall-objects") - # create the output files to be used. - add_test (NAME H5CLEAR-h5clear_gentest COMMAND $) - set_tests_properties (H5CLEAR-h5clear_gentest PROPERTIES DEPENDS "H5CLEAR-clearall-objects") - set_tests_properties (H5CLEAR-h5clear_gentest PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - set (last_test "H5CLEAR-h5clear_gentest") + foreach (h5_file ${HDF5_TEST_FILES} ${HDF5_SEC2_TEST_FILES}) + add_test ( + NAME H5CLEAR-copy_${h5_file} + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR-copy_${h5_file} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5CLEAR-copy_${h5_file}") + endforeach () + # make second copy of h5clear_sec2.h5 + foreach (h5_file ${HDF5_SEC2_TEST_FILES}) + add_test ( + NAME H5CLEAR-copy_orig_${h5_file} + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/orig_${h5_file}" + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR-copy_orig_${h5_file} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5CLEAR-copy_orig_${h5_file}") + endforeach () + add_test ( + NAME H5CLEAR-copy_mod_h5clear_mdc_image.h5 + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/mod_h5clear_mdc_image.h5" "${PROJECT_BINARY_DIR}/testfiles/mod_h5clear_mdc_image.h5" + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR-copy_mod_h5clear_mdc_image.h5 PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5CLEAR-copy_mod_h5clear_mdc_image.h5") + # make second copy of mod_h5clear_mdc_image.h5 + add_test ( + NAME H5CLEAR-copy_mod_h5clear_mdc_image2.h5 + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/mod_h5clear_mdc_image.h5" "${PROJECT_BINARY_DIR}/testfiles/mod_h5clear_mdc_image2.h5" + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR-copy_mod_h5clear_mdc_image2.h5 PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5CLEAR-copy_mod_h5clear_mdc_image2.h5") +endif() # # @@ -191,7 +261,3 @@ ADD_H5_TEST (latest_h5clear_log_v3 "true") ADD_H5_TEST (h5clear_sec2_v0 "false") ADD_H5_TEST (h5clear_sec2_v2 "false") - - set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} - h5clear_gentest - ) -- cgit v0.12 From 9a7b106d3776a8454b5cb9443f11aae2873cc617 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Apr 2017 14:57:36 -0500 Subject: Correct test options to match autotools script --- tools/test/misc/CMakeTestsClear.cmake | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index 5f40514..41aea4a 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -200,15 +200,15 @@ endif() # # The following are tests to verify the expected output from h5clear # "h5clear -h" -# "h5clear" (no options, no file) -# "h5clear junk.h5" (no options, nonexisting file) -# "h5clear orig_h5clear_sec2_v3.h5" (no options, existing file) -# "h5clear -m" (valid 1 option, no file) -# "h5clear -s junk.h5" (valid 1 option, nonexisting file) -# "h5clear -m -s junk.h5" (valid 2 options, no file) -# "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) -# "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) -# "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) +# "h5clear" (no options, no file) +# "h5clear junk.h5" (no options, nonexisting file) +# "h5clear orig_h5clear_sec2_v3.h5" (no options, existing file) +# "h5clear -m" (valid 1 option, no file) +# "h5clear -s junk.h5" (valid 1 option, nonexisting file) +# "h5clear -m -s" (valid 2 options, no file) +# "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) +# "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) +# "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) ADD_H5_CMP (h5clear_usage_h h5clear_usage 0 "-h") ADD_H5_CMP (h5clear_usage h5clear_usage 1 "") ADD_H5_CMP (h5clear_usage_junk h5clear_usage 1 "" junk.h5) @@ -218,7 +218,7 @@ endif() ADD_H5_CMP (h5clear_missing_file_ms h5clear_missing_file 1 "-m" "-s") ADD_H5_CMP (h5clear_open_fail_ms h5clear_open_fail 1 "-m" "-s" junk.h5) ADD_H5_CMP (h5clear_no_mdc_image_m h5clear_no_mdc_image 0 "-m" orig_h5clear_sec2_v2.h5) - ADD_H5_CMP (h5clear_no_mdc_image_ms h5clear_no_mdc_image 0 "-m" "-s" orig_h5clear_sec2_v0.h5) + ADD_H5_CMP (h5clear_no_mdc_image_ms h5clear_no_mdc_image 0 "-s" "-m" orig_h5clear_sec2_v0.h5) # # # @@ -230,9 +230,9 @@ endif() # "h5clear -l h5clear_sec2_v2.h5" (invalid 1 option, existing file, fail exit code) # "h5clear -m -k" (valid/invalid 2 options, nofile, fail exit code) # "h5clear -l -m" (invalid/valid 2 options, nofile, fail exit code) -# "h5clear -m -k junk.h5" (valid/invalid 2 options, nonexisting file, fail exit code) +# "h5clear -m -l junk.h5" (valid/invalid 2 options, nonexisting file, fail exit code) # "h5clear -l -m junk.h5" (invalid/valid 2 options, nonexisting file, fail exit code) -# "h5clear -m -k h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code) +# "h5clear -m -l h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code) # "h5clear -l -m h5clear_sec2_v0.h5" (invalid/valid 2 options, existing file, fail exit code) ADD_H5_RETTEST (h5clear_mdc_image "false" "-m" h5clear_mdc_image.h5) ADD_H5_RETTEST (h5clear_vers "false" "--vers") @@ -243,14 +243,14 @@ endif() ADD_H5_RETTEST (h5clear_lm "true" "-l" "-m") ADD_H5_RETTEST (h5clear_ml_junk "true" "-m" "-l" junk.h5) ADD_H5_RETTEST (h5clear_lm_junk "true" "-l" "-m" junk.h5) - ADD_H5_RETTEST (h5clear_ml_sec2 "true" "-m" "-l" h5clear_sec2_v2.h5) - ADD_H5_RETTEST (h5clear_lm_sec2 "true" "-l" "-m" h5clear_sec2_v2.h5) + ADD_H5_RETTEST (h5clear_ml_sec2 "true" "-m" "-l" h5clear_sec2_v0.h5) + ADD_H5_RETTEST (h5clear_lm_sec2 "true" "-l" "-m" h5clear_sec2_v0.h5) # # # # h5clear_mdc_image.h5 already has cache image removed earlier, verify the expected warning from h5clear: ADD_H5_CMP (h5clear_mdc_image_m h5clear_no_mdc_image 0 "-m" mod_h5clear_mdc_image.h5) - ADD_H5_CMP (h5clear_mdc_image_sm h5clear_no_mdc_image 0 "-m" "-s" mod_h5clear_mdc_image2.h5) + ADD_H5_CMP (h5clear_mdc_image_sm h5clear_no_mdc_image 0 "-s" "-m" mod_h5clear_mdc_image2.h5) # # # -- cgit v0.12 From 5ed622b9ca432f1b440e8903680695ac83e28301 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 20 Apr 2017 16:11:47 -0400 Subject: The cache_image test shows a skipped message about EoC in parallel. --- src/H5Pfapl.c | 1 - test/cache_image.c | 18 +++++++++--------- test/evict_on_close.c | 1 - 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 8bd53a9..e47a4b0 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -4401,7 +4401,6 @@ H5Pset_evict_on_close( FUNC_ENTER_API(FAIL) H5TRACE2("e", "ib", fapl_id, evict_on_close); - /* Compare the property list's class against the other class */ if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not a file access plist") diff --git a/test/cache_image.c b/test/cache_image.c index 31d7705..378c21e 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -62,10 +62,7 @@ static unsigned cache_image_api_error_check_3(void); static unsigned cache_image_api_error_check_4(void); static unsigned get_free_sections_test(void); - -#ifndef H5_HAVE_PARALLEL static unsigned evict_on_close_test(void); -#endif /* H5_HAVE_PARALLEL */ /****************************************************************************/ @@ -7714,10 +7711,10 @@ get_free_sections_test(void) * *------------------------------------------------------------------------- */ -#ifndef H5_HAVE_PARALLEL static unsigned evict_on_close_test(void) { +#ifndef H5_HAVE_PARALLEL const char * fcn_name = "evict_on_close_test()"; char filename[512]; hbool_t show_progress = FALSE; @@ -7726,9 +7723,16 @@ evict_on_close_test(void) H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; +#endif /* H5_HAVE_PARALLEL */ TESTING("Cache image / evict on close interaction"); +#ifdef H5_HAVE_PARALLEL + SKIPPED(); + HDputs(" EoC not supported in the parallel library."); + return 0; +#else + pass = TRUE; if ( show_progress ) @@ -8017,9 +8021,9 @@ evict_on_close_test(void) FUNC, failure_mssg); return !pass; +#endif /* H5_HAVE_PARALLEL */ } /* evict_on_close_test() */ -#endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- @@ -8071,13 +8075,9 @@ main(void) nerrs += cache_image_api_error_check_4(); nerrs += get_free_sections_test(); - -#ifndef H5_HAVE_PARALLEL nerrs += evict_on_close_test(); -#endif /* H5_HAVE_PARALLEL */ return(nerrs > 0); } /* main() */ - diff --git a/test/evict_on_close.c b/test/evict_on_close.c index 8196ea1..147976b 100644 --- a/test/evict_on_close.c +++ b/test/evict_on_close.c @@ -808,7 +808,6 @@ error: } /* check_dset_scheme() */ - /*------------------------------------------------------------------------- * Function: check_evict_on_close_api() -- cgit v0.12 From 6ef69b7b1748a48c236c60f45a1ee590de7b5194 Mon Sep 17 00:00:00 2001 From: lrknox Date: Thu, 20 Apr 2017 16:51:21 -0500 Subject: Add targets for plugin test libraries to avoid linking to external libs. --- config/conclude.am | 8 +++++--- test/Makefile.am | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/config/conclude.am b/config/conclude.am index 1ba56fb..1932170 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -18,13 +18,14 @@ ## Textually included at the end of most HDF5 Makefiles.am. ## Contains build rules. -# Automake needs to be taught how to build lib, progs, and tests targets. +# Automake needs to be taught how to build lib, pkglib, progs and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to -# be built at certain times. +# be built at certain times. LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) +PKGLIB = $(pkglib_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) @@ -36,6 +37,7 @@ AM_SH_LOG_FLAGS = # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. +build-pkglib: $(PKGLIB) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -43,7 +45,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) +lib pkglib progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/test/Makefile.am b/test/Makefile.am index 79dc17f..004fbfb 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -106,7 +106,7 @@ noinst_LTLIBRARIES=libh5test.la if HAVE_SHARED_CONDITIONAL # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la + pkglib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c @@ -125,6 +125,8 @@ libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c # Use libhd5test.la to compile all of the tests LDADD=libh5test.la $(LIBHDF5) +LIBADD=pkglib_LTLIBRARIES + # List the source files for tests that have more than one ttsafe_SOURCES=ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \ ttsafe_acreate.c @@ -148,6 +150,18 @@ timings _timings: testmeta # The flush1 test must run before the flush2 test flush2.chkexe_: flush1.chkexe_ +libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) + +libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) + +libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) + +libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) + # Temporary files. These files are the ones created by setting the # HDF5_NOCLEANUP environment variable and running `make test' without # specifying a file prefix or low-level driver. Changing the file -- cgit v0.12 From 739f413b7803c1d8fb5d0cbaef6503785a18275c Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 20 Apr 2017 20:19:15 -0400 Subject: Fixed problems that prevent bin/trace from marking up some functions. --- src/H5.c | 6 +++--- src/H5PL.c | 22 ++++++++++++++++------ src/H5Pfapl.c | 14 +------------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/H5.c b/src/H5.c index 41fb3ba..f41459c 100644 --- a/src/H5.c +++ b/src/H5.c @@ -944,7 +944,7 @@ H5allocate_memory(size_t size, hbool_t clear) { void *ret_value = NULL; - FUNC_ENTER_API_NOINIT; + FUNC_ENTER_API_NOINIT H5TRACE2("*x", "zb", size, clear); if(clear) @@ -985,7 +985,7 @@ H5resize_memory(void *mem, size_t size) { void *ret_value = NULL; - FUNC_ENTER_API_NOINIT; + FUNC_ENTER_API_NOINIT H5TRACE2("*x", "*xz", mem, size); ret_value = H5MM_realloc(mem, size); @@ -1009,7 +1009,7 @@ H5resize_memory(void *mem, size_t size) herr_t H5free_memory(void *mem) { - FUNC_ENTER_API_NOINIT; + FUNC_ENTER_API_NOINIT H5TRACE1("e", "*x", mem); /* At this time, it is impossible for this to fail. */ diff --git a/src/H5PL.c b/src/H5PL.c index a083f5a..3eb3392 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -417,12 +417,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLappend(const char* plugin_path) +H5PLappend(const char *plugin_path) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; FUNC_ENTER_API(FAIL) + H5TRACE1("e", "*s", plugin_path); if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) @@ -450,13 +451,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLprepend(const char* plugin_path) +H5PLprepend(const char *plugin_path) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; unsigned int plindex; FUNC_ENTER_API(FAIL) + H5TRACE1("e", "*s", plugin_path); if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) @@ -486,12 +488,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLreplace(const char* plugin_path, unsigned int index) +H5PLreplace(const char *plugin_path, unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; FUNC_ENTER_API(FAIL) + H5TRACE2("e", "*sIu", plugin_path, index); if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") if(index >= H5PL_MAX_PATH_NUM) @@ -520,13 +523,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLinsert(const char* plugin_path, unsigned int index) +H5PLinsert(const char *plugin_path, unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; unsigned int plindex; FUNC_ENTER_API(FAIL) + H5TRACE2("e", "*sIu", plugin_path, index); if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) @@ -636,14 +640,20 @@ done: * * Purpose: Query the size of the current list of plugin paths. * - * Return: Non-negative or success. + * Return: Plugin path size (can't indicate failure due to unsigned type) * *------------------------------------------------------------------------- */ unsigned int H5PLsize(void) { - return (unsigned int)H5PL_num_paths_g; + unsigned int ret_value = (unsigned int)H5PL_num_paths_g; + + FUNC_ENTER_API(0) + H5TRACE0("Iu",""); + +done: + FUNC_LEAVE_API(ret_value) } /* end H5PLsize() */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index e47a4b0..c69f3ef 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -4381,19 +4381,7 @@ H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_ *------------------------------------------------------------------------- */ herr_t -H5Pset_evict_on_close( -#if defined(H5_HAVE_PARALLEL) && !defined(H5_DEBUG_BUILD) - hid_t H5_ATTR_UNUSED fapl_id, -#else - hid_t fapl_id, -#endif /* H5_HAVE_PARALLEL and !H5_DEBUG_BUILD */ - -#ifdef H5_HAVE_PARALLEL - hbool_t H5_ATTR_UNUSED evict_on_close -#else - hbool_t evict_on_close -#endif /* H5_HAVE_PARALLEL */ -) +H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close) { H5P_genplist_t *plist; /* property list pointer */ herr_t ret_value = SUCCEED; /* return value */ -- cgit v0.12 From ae1144f8826dcecc68ec923bb7261f2a8153735c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 21 Apr 2017 10:02:43 -0500 Subject: HDFFV-9655 fix compile and test --- src/H5PL.c | 82 +++++++++++++++++++++++++++++--------------------- test/CMakeTests.cmake | 6 ++++ test/test_plugin.sh.in | 33 ++++++++++++-------- 3 files changed, 74 insertions(+), 47 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 79aa156..0cdbc93 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -105,7 +105,9 @@ typedef const void *(*H5PL_get_plugin_info_t)(void); #define H5PL_NO_PLUGIN "::" /* Special symbol to indicate relative path from environment */ -#define H5PL_PLUGIN_ENV_SPECIALCHAR '@' +/* Restrict usage of special char only for the default path H5_DEFAULT_PLUGINDIR + * or when using the environment variable HDF5_PLUGIN_PATH */ +#define H5PL_PLUGIN_ENV_RELEXEC_CHAR '@' /* Maximum size for path to executable */ #ifndef MAX_EXEC_PATH @@ -128,6 +130,7 @@ typedef struct H5PL_table_t { /* Local Prototypes */ /********************/ +static char *H5PL__env_strdup(const char *plpath); static herr_t H5PL__init_path_table(void); static htri_t H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info); static htri_t H5PL__open(H5PL_type_t pl_type, char *libname, int plugin_id, const void **pl_info); @@ -182,50 +185,54 @@ DESCRIPTION herr_t H5PL__init_package(void) { - char *preload_path; - char *tempbuf; + herr_t ret_value = SUCCEED; /* Return value */ + char *preload_path = NULL; + char *tempbuf = NULL; + char pathsep = '/'; + char *bs = NULL; + size_t ncopy = MAX_EXEC_PATH; - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_PACKAGE /* Retrieve pathnames from HDF5_PLUGIN_PRELOAD if the user sets it * to tell the library to load plugin libraries without search. */ if(NULL != (preload_path = HDgetenv("HDF5_PLUGIN_PRELOAD"))) - /* Special symbal "::" means no plugin during data reading. */ + /* Special symbol "::" means no plugin during data reading. */ if(!HDstrcmp(preload_path, H5PL_NO_PLUGIN)) H5PL_plugin_g = 0; - /* Retrieve the executable path for use with H5PL_PLUGIN_ENV_SPECIALCHAR + /* Retrieve the executable path for use with H5PL_PLUGIN_ENV_RELEXEC_CHAR * if the user uses it in a plugin path. */ if(NULL == (tempbuf = (char *)H5MM_malloc(MAX_EXEC_PATH))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for executable path") -#if defined(_WIN32) || defined(_WIN64) || defined(H5_HAVE_WIN32_API) - const char PathSep = '\\'; +#if defined(_WIN32) || defined(_WIN64) || defined(H5_HAVE_WIN32_API) + pathsep = (char)'\\'; GetModuleFileName(NULL, tempbuf, MAX_EXEC_PATH); #elif defined(__APPLE__) - const char PathSep = '/'; - uint32_t size = sizeof(result); - _NSGetExecutablePath(tempbuf, &size); + pathsep = (char)'/'; + { + uint32_t size = sizeof(tempbuf); + _NSGetExecutablePath(tempbuf, &size); + } #else - const char PathSep = '/'; + pathsep = (char)'/'; { ssize_t count = readlink("/proc/self/exe", tempbuf, MAX_EXEC_PATH); tempbuf[count] = '\0'; } #endif - { - char *bs = strrchr(tempbuf, PathSep); - size_t ncopy = MAX_EXEC_PATH; - if (bs) - ncopy = bs - tempbuf; - tempbuf[ncopy] = '\0'; - } + if ((bs = HDstrrchr(tempbuf, pathsep))) + ncopy = (size_t)(bs - tempbuf); + tempbuf[ncopy] = '\0'; + H5PL_executable_path_g = H5MM_strdup(tempbuf); if(tempbuf) tempbuf = (char *)H5MM_xfree(tempbuf); - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__init_package() */ @@ -291,28 +298,33 @@ H5PL_term_package(void) } /* end H5PL_term_package() */ static char* -H5PL_env_strdup(const char *plpath) +H5PL__env_strdup(const char *plpath) { - char *dl_path = NULL; + char *ret_value = NULL; + + FUNC_ENTER_NOAPI_NOINIT + if(NULL == plpath) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") - if (*plpath == H5PL_PLUGIN_ENV_SPECIALCHAR) { + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, NULL, "no path provided") + if (*plpath == H5PL_PLUGIN_ENV_RELEXEC_CHAR) { char *tempbuf; - int ExecPathLength = strlen(H5PL_executable_path_g); - int PluginPathLength = strlen(plpath); + size_t ExecPathLength = HDstrlen(H5PL_executable_path_g); + size_t PluginPathLength = HDstrlen(plpath); if(NULL == (tempbuf = (char *)H5MM_malloc(ExecPathLength + PluginPathLength))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin path") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, NULL, "can't allocate memory for plugin path") HDstrncpy(tempbuf, H5PL_executable_path_g, ExecPathLength); - HDstrncpy(tempbuf+ExecPathLength, s+1, PluginPathLength-1); + HDstrncpy(tempbuf+ExecPathLength, plpath+2, PluginPathLength-1); tempbuf[ExecPathLength + PluginPathLength] = '\0'; - dl_path = H5MM_strdup(tempbuf); + ret_value = H5MM_strdup(tempbuf); tempbuf = (char *)H5MM_xfree(tempbuf); } else - dl_path = H5MM_strdup(plpath); - return dl_path; + ret_value = H5MM_strdup(plpath); + +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL_env_strdup() */ @@ -730,9 +742,9 @@ H5PLget(unsigned int index) FUNC_ENTER_API(NULL) if(H5PL_num_paths_g == 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, NULL, "no directories in table") if(NULL == (ret_value = H5PL_path_table_g[index])) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, NULL, "no directory path at index") done: FUNC_LEAVE_API(ret_value) @@ -782,9 +794,9 @@ H5PL__init_path_table(void) */ origin_dl_path = HDgetenv("HDF5_PLUGIN_PATH"); if(NULL == origin_dl_path) - dl_path = H5MM_strdup(H5PL_DEFAULT_PATH); + dl_path = H5PL__env_strdup(H5PL_DEFAULT_PATH); else - dl_path = H5MM_strdup(origin_dl_path); + dl_path = H5PL__env_strdup(origin_dl_path); if(NULL == dl_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index f372acf..959fe64 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -996,6 +996,12 @@ set_tests_properties (H5PLUGIN-plugin PROPERTIES WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} ) +add_test (NAME H5PLUGIN-pluginRelative COMMAND $) +set_tests_properties (H5PLUGIN-pluginRelative PROPERTIES + ENVIRONMENT "HDF5_PLUGIN_PATH=@/../testdir1${CMAKE_SEP}@/../testdir2;srcdir=${HDF5_TEST_BINARY_DIR}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} +) + ############################################################################## ### S W M R T E S T S ############################################################################## diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index 1cd87e3..1e6d9d9 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -1,16 +1,16 @@ #! /bin/sh # -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic document set and is -# linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access -# to either file, you may request a copy from help@hdfgroup.org. +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the files COPYING and Copyright.html. COPYING can be found at the root +# of the source code distribution tree; Copyright.html can be found at the +# root level of an installed copy of the electronic document set and is +# linked from the top-level documents page. It can also be found at +# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access +# to either file, you may request a copy from help@hdfgroup.org. # srcdir=@srcdir@ TOP_BUILDDIR=@top_builddir@ @@ -40,7 +40,7 @@ case $(uname) in esac PLUGIN_LIBDIR1=testdir1 PLUGIN_LIBDIR2=testdir2 -CP="cp -p" # Use -p to preserve mode,ownership,timestamps +CP="cp -p" # Use -p to preserve mode,ownership,timestamps RM="rm -rf" # Print a line-line message left justified in a field of 70 characters @@ -87,6 +87,15 @@ if [ $? != 0 ]; then nerrors=`expr $nerrors + 1` fi +# setup plugin path relative to test +ENVCMD="env HDF5_PLUGIN_PATH=@/${PLUGIN_LIBDIR1}:@/${PLUGIN_LIBDIR2}" + +# Run the test +$ENVCMD $TEST_BIN +if [ $? != 0 ]; then + nerrors=`expr $nerrors + 1` +fi + # print results if test $nerrors -ne 0 ; then echo "$nerrors errors encountered" -- cgit v0.12 From 3968c5c3bf16dc23a0a2ff1fa8d6c64dd2f8d32a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 21 Apr 2017 10:07:30 -0500 Subject: Fix parameter form --- src/H5PL.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index a083f5a..9bdd0ba 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -417,7 +417,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLappend(const char* plugin_path) +H5PLappend(const char *plugin_path) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -450,7 +450,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLprepend(const char* plugin_path) +H5PLprepend(const char *plugin_path) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -486,7 +486,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLreplace(const char* plugin_path, unsigned int index) +H5PLreplace(const char *plugin_path, unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -520,7 +520,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLinsert(const char* plugin_path, unsigned int index) +H5PLinsert(const char *plugin_path, unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; -- cgit v0.12 From a995a63085d88e1a633770536efeff5b01569445 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 21 Apr 2017 10:58:32 -0500 Subject: HDFFV-9655 fix test and some warnings --- src/H5PL.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index bca680e..2397bbd 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -333,7 +333,7 @@ H5PL__env_strdup(const char *plpath) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, NULL, "can't allocate memory for plugin path") HDstrncpy(tempbuf, H5PL_executable_path_g, ExecPathLength); - HDstrncpy(tempbuf+ExecPathLength, plpath+2, PluginPathLength-1); + HDstrncpy(tempbuf+ExecPathLength, plpath+1, PluginPathLength-1); tempbuf[ExecPathLength + PluginPathLength] = '\0'; ret_value = H5MM_strdup(tempbuf); tempbuf = (char *)H5MM_xfree(tempbuf); @@ -685,7 +685,7 @@ ssize_t H5PLget(unsigned int index, char *pathname/*out*/, size_t size) { ssize_t ret_value = 0; /* Return value */ - ssize_t len = 0; /* Length of pathname */ + size_t len = 0; /* Length of pathname */ char *dl_path = NULL; FUNC_ENTER_API(FAIL) @@ -704,7 +704,7 @@ H5PLget(unsigned int index, char *pathname/*out*/, size_t size) } /* end if */ /* Set return value */ - ret_value = len; + ret_value = (ssize_t)len; done: FUNC_LEAVE_API(ret_value) -- cgit v0.12 From abdb412d50bcdfc158e6efddc9eb4aba4f8bce1e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 21 Apr 2017 11:04:27 -0500 Subject: file already in list --- tools/test/misc/CMakeTestsClear.cmake | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index 41aea4a..8a93660 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -172,16 +172,6 @@ if (HDF5_ENABLE_USING_MEMCHECKER) endif () set (last_test "H5CLEAR-copy_orig_${h5_file}") endforeach () - add_test ( - NAME H5CLEAR-copy_mod_h5clear_mdc_image.h5 - COMMAND ${CMAKE_COMMAND} - -E copy_if_different - "${PROJECT_SOURCE_DIR}/testfiles/mod_h5clear_mdc_image.h5" "${PROJECT_BINARY_DIR}/testfiles/mod_h5clear_mdc_image.h5" - ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5CLEAR-copy_mod_h5clear_mdc_image.h5 PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5CLEAR-copy_mod_h5clear_mdc_image.h5") # make second copy of mod_h5clear_mdc_image.h5 add_test ( NAME H5CLEAR-copy_mod_h5clear_mdc_image2.h5 -- cgit v0.12 From 7bd516f2ead21e8470cc25c0b664ad6b56c723a0 Mon Sep 17 00:00:00 2001 From: lrknox Date: Fri, 21 Apr 2017 14:32:45 -0500 Subject: Our best effort to build dynamic plugin tests and not install them with "make install". It seems the install-exec-hook doesn't remove the last to be installed. --- config/conclude.am | 9 +++++---- test/Makefile.am | 30 ++++++++++++++---------------- tools/test/h5diff/Makefile.am | 7 +++++-- tools/test/h5dump/Makefile.am | 7 +++++-- tools/test/h5ls/Makefile.am | 9 +++++++-- tools/test/h5repack/Makefile.am | 10 ++++++++-- 6 files changed, 44 insertions(+), 28 deletions(-) diff --git a/config/conclude.am b/config/conclude.am index 1932170..cad55a3 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -18,18 +18,19 @@ ## Textually included at the end of most HDF5 Makefiles.am. ## Contains build rules. -# Automake needs to be taught how to build lib, pkglib, progs and tests targets. +# Automake needs to be taught how to build lib, dyn, progs and tests targets. # These will be filled in automatically for the most part (e.g., # lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and # EXTRA_TEST variables are supplied to allow the user to force targets to # be built at certain times. LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) -PKGLIB = $(pkglib_LTLIBRARIES) +DYN = $(dyn_LTLIBRARIES) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TESTS = $(TEST_PROG) $(TEST_SCRIPT) $(EXTRA_TEST) +dyndir=$(libdir) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) @@ -37,7 +38,7 @@ AM_SH_LOG_FLAGS = # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. -build-pkglib: $(PKGLIB) +build-dyn: $(DYN) build-lib: $(LIB) build-progs: $(LIB) $(PROGS) build-tests: $(LIB) $(PROGS) $(chk_TESTS) @@ -45,7 +46,7 @@ build-tests: $(LIB) $(PROGS) $(chk_TESTS) # General rule for recursive building targets. # BUILT_SOURCES contain targets that need to be built before anything else # in the directory (e.g., for Fortran type detection) -lib pkglib progs tests check-s check-p :: $(BUILT_SOURCES) +lib dyn progs tests check-s check-p :: $(BUILT_SOURCES) @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; @for d in X $(SUBDIRS); do \ if test $$d != X && test $$d != .; then \ diff --git a/test/Makefile.am b/test/Makefile.am index 004fbfb..d5c3511 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -106,7 +106,7 @@ noinst_LTLIBRARIES=libh5test.la if HAVE_SHARED_CONDITIONAL # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - pkglib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la + dyn_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c @@ -116,8 +116,20 @@ if HAVE_SHARED_CONDITIONAL libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic +libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) + +libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) + +libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) + +libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) + install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* + $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c @@ -125,8 +137,6 @@ libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c # Use libhd5test.la to compile all of the tests LDADD=libh5test.la $(LIBHDF5) -LIBADD=pkglib_LTLIBRARIES - # List the source files for tests that have more than one ttsafe_SOURCES=ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \ ttsafe_acreate.c @@ -150,18 +160,6 @@ timings _timings: testmeta # The flush1 test must run before the flush2 test flush2.chkexe_: flush1.chkexe_ -libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) - -libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) - -libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) - -libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) - # Temporary files. These files are the ones created by setting the # HDF5_NOCLEANUP environment variable and running `make test' without # specifying a file prefix or low-level driver. Changing the file diff --git a/tools/test/h5diff/Makefile.am b/tools/test/h5diff/Makefile.am index 16897c6..ad3f4ba 100644 --- a/tools/test/h5diff/Makefile.am +++ b/tools/test/h5diff/Makefile.am @@ -52,12 +52,15 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibdiff.la + dyn_LTLIBRARIES=libdynlibdiff.la libdynlibdiff_la_SOURCES=dynlib_diff.c libdynlibdiff_la_LDFLAGS = -avoid-version -module -shared -export-dynamic +libdynlibdiff.la: $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_DEPENDENCIES) $(EXTRA_libdynlibdiff_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlibdiff_la_LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD) + install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* + $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif # Temporary files. *.h5 are generated by h5diff. They should diff --git a/tools/test/h5dump/Makefile.am b/tools/test/h5dump/Makefile.am index 8723c65..d42afb0 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -41,12 +41,15 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibdump.la + dyn_LTLIBRARIES=libdynlibdump.la libdynlibdump_la_SOURCES=dynlib_dump.c libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic +libdynlibdump.la: $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_DEPENDENCIES) $(EXTRA_libdynlibdump_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlibdump_la_LINK) $(am_libdynlibdump_la_rpath) $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_LIBADD) + install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* + $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif # Temporary files. *.h5 are generated by h5dumpgentest. They should diff --git a/tools/test/h5ls/Makefile.am b/tools/test/h5ls/Makefile.am index 170aa63..e255f01 100644 --- a/tools/test/h5ls/Makefile.am +++ b/tools/test/h5ls/Makefile.am @@ -38,13 +38,18 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibls.la + dyn_LTLIBRARIES=libdynlibls.la libdynlibls_la_SOURCES=dynlib_ls.c + libdynlibls_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + +libdynlibls.la: $(libdynlibls_la_OBJECTS) $(libdynlibls_la_DEPENDENCIES) $(EXTRA_libdynlibls_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlibls_la_LINK) $(am_libdynlibls_la_rpath) $(libdynlibls_la_OBJECTS) $(libdynlibls_la_LIBADD) install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* + $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif + DISTCLEANFILES=h5ls_plugin.sh include $(top_srcdir)/config/conclude.am diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index 375df47..5080222 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -47,16 +47,22 @@ h5repacktst_SOURCES=h5repacktst.c if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibadd.la libdynlibvers.la + dyn_LTLIBRARIES=libdynlibadd.la libdynlibvers.la libdynlibadd_la_SOURCES=dynlib_rpk.c libdynlibvers_la_SOURCES=dynlib_vrpk.c libdynlibadd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic libdynlibvers_la_LDFLAGS = -avoid-version -module -shared -export-dynamic +libdynlibadd.la: $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_DEPENDENCIES) $(EXTRA_libdynlibadd_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlibadd_la_LINK) $(am_libdynlibadd_la_rpath) $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_LIBADD) +libdynlibvers.la: $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_DEPENDENCIES) $(EXTRA_libdynlibvers_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlibvers_la_LINK) $(am_libdynlibvers_la_rpath) $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_LIBADD) + install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* + $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif + # Temporary files. *.h5 are generated by h5repack. They should # copied to the testfiles/ directory if update is required. CHECK_CLEANFILES+=*.h5 *.bin testfiles/h5diff_attr1.h5 testfiles/tfamily*.h5 -- cgit v0.12 From e9b289a3d1d031f594e8c5421144ac44f3d44bcb Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Fri, 21 Apr 2017 18:42:17 -0500 Subject: Fix for HDFFV-10166 h5watch tests fail randomly to match expected output files (1) Re-structure tests to do one "extend" action at a time (2) Re-try test till max limit before final failure --- hl/tools/h5watch/extend_dset.c | 307 ++++++++----------- hl/tools/h5watch/h5watch.c | 494 +++++++++++++++--------------- hl/tools/h5watch/testh5watch.sh.in | 163 +++++----- hl/tools/testfiles/w-ext-cmpd-esc-f1.ddl | 5 - hl/tools/testfiles/w-ext-cmpd-esc-f3.ddl | 5 - hl/tools/testfiles/w-ext-cmpd-esc-ff2.ddl | 10 +- hl/tools/testfiles/w-ext-cmpd-esc.ddl | 12 +- hl/tools/testfiles/w-ext-cmpd-f1.ddl | 10 +- hl/tools/testfiles/w-ext-cmpd-f2.ddl | 5 - hl/tools/testfiles/w-ext-cmpd-ff3.ddl | 8 - hl/tools/testfiles/w-ext-cmpd-label.ddl | 8 - hl/tools/testfiles/w-ext-cmpd-two-f1.ddl | 56 +--- hl/tools/testfiles/w-ext-cmpd-two-f3.ddl | 41 +-- hl/tools/testfiles/w-ext-cmpd-two-ff2.ddl | 47 +-- hl/tools/testfiles/w-ext-cmpd-two.ddl | 66 +--- hl/tools/testfiles/w-ext-cmpd.ddl | 6 - hl/tools/testfiles/w-ext-early.ddl | 9 +- hl/tools/testfiles/w-ext-late.ddl | 8 - hl/tools/testfiles/w-ext-one-d.ddl | 3 - hl/tools/testfiles/w-ext-one-simple.ddl | 9 +- hl/tools/testfiles/w-ext-one.ddl | 5 - hl/tools/testfiles/w-ext-two-d.ddl | 18 +- hl/tools/testfiles/w-ext-two-width.ddl | 42 +-- hl/tools/testfiles/w-ext-two.ddl | 38 +-- 24 files changed, 508 insertions(+), 867 deletions(-) diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index f6b4161..ab086f6 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -34,27 +34,8 @@ /* Size of data buffer */ #define TEST_BUF_SIZE 100 -/* - * Test variations (incremental) for one-dimensional dataset: - * Varies from 10->13->12->12->1->3 - */ -#define ONE_NTESTS 5 -int one_tests[ONE_NTESTS] = {3, -1, 0, -11, 2}; - -/* - * Test variations (incremental) for two-dimensional dataset: - * Varies from {4,10}->{6,12}->{8,1}->{10,1}-> - * {3,3}->{2,2}->{1,2}-> - * {1,4}->{1,3}->{1,3} - */ -#define TWO_NTESTS 9 -int two_tests[TWO_NTESTS][2] = { {2, 2}, {2, -11}, {2, 0}, - {-7, 2}, {-1, -1}, {-1, 0}, - {0, 2}, {0, -1}, {0, 0} - }; - -static herr_t extend_dset_two(const char *file, char *dname); -static herr_t extend_dset_one(const char *file, char *dname); +static herr_t extend_dset_two(const char *file, char *dname, int action1, int action2); +static herr_t extend_dset_one(const char *file, char *dname, int action); /* Data structures for datasets with compound data type */ @@ -85,29 +66,13 @@ typedef struct set_t { /* *********************************************************************** * - * Extending a two-dimensional dataset: - * dims[0] dims[1] - * ------- ------- - * case #1: increase increase - * case #2: increase decrease - * case #3: increase same - * case #4: decrease increase - * case #5: decrease decrease (no action) - * case #6: decrease same (no action) - * case #7: same increase - * case #8: same decrease (no action) - * case #9: same same (no action) - * - * two_tests[TWO_NTESTS][2] = { {2,2}, {2,-11}, {2,0}, - * {-7,2}, {-1,-1}, {-1,0}, - * {0,2}, {0,-1}, {0,0} } - * varies from {4,10}->{6,12}->{8,1}->{10,1}-> - * {3,3}->{2,2}->{1,2}-> - * {1,4}->{1,3}->{1,3} + * Extending a two-dimensional dataset by action1 and action2. + * --action1 and action2 can be a positive # or negative # or 0. + * *********************************************************************** */ static herr_t -extend_dset_two(const char *file, char *dname) +extend_dset_two(const char *file, char *dname, int action1, int action2) { hid_t fid = -1; /* file id */ hid_t fapl = -1; /* file access property list id */ @@ -165,61 +130,57 @@ extend_dset_two(const char *file, char *dname) if(h5_wait_message(READER_MESSAGE) < 0) goto error; - /* Loop through different variations of extending the dataset */ - for(i = 0; i < TWO_NTESTS; i++) { + /* sleep to emulate about 2 seconds of application operation */ + HDsleep(2); - /* sleep to emulate about 2 seconds of application operation */ - HDsleep(2); + /* Get current dimension sizes */ + if(H5LDget_dset_dims(did, cur_dims) < 0) + goto error; - /* Get current dimension sizes */ - if(H5LDget_dset_dims(did, cur_dims) < 0) - goto error; + /* Set up the new extended dimension sizes */ + ext_dims[0] = cur_dims[0] + (hsize_t)action1; + ext_dims[1] = cur_dims[1] + (hsize_t)action2; - /* Set up the new extended dimension sizes */ - ext_dims[0] = cur_dims[0] + (hsize_t)two_tests[i][0]; - ext_dims[1] = cur_dims[1] + (hsize_t)two_tests[i][1]; + /* Extend the dataset */ + if(H5Dset_extent(did, ext_dims) < 0) + goto error; - /* Extend the dataset */ - if(H5Dset_extent(did, ext_dims) < 0) + num_elmts = 1; + for(j = 0; j < (unsigned)ndims; j++) + num_elmts *= (unsigned)ext_dims[j]; + + /* Compound type */ + if(!HDstrcmp(dname, DSET_CMPD_TWO)) { + + HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); + for(j = 0; j < num_elmts; j++) { + cbuf[j].field1 = action1; + cbuf[j].field2.a = action1; + cbuf[j].field2.c = action1; + cbuf[j].field2.b.a = action1; + cbuf[j].field2.b.b = action1; + cbuf[j].field2.b.c = action1; + cbuf[j].field3 = action1; + cbuf[j].field4.a = action1; + cbuf[j].field4.b = action1; + } /* end for */ + + /* Write to the dataset */ + if(H5Dwrite(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0) goto error; - num_elmts = 1; - for(j = 0; j < (unsigned)ndims; j++) - num_elmts *= (unsigned)ext_dims[j]; - - /* Compound type */ - if(!HDstrcmp(dname, DSET_CMPD_TWO)) { - - HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); - for(j = 0; j < num_elmts; j++) { - cbuf[j].field1 = i + 1; - cbuf[j].field2.a = i + 1; - cbuf[j].field2.c = i + 1; - cbuf[j].field2.b.a = i + 1; - cbuf[j].field2.b.b = i + 1; - cbuf[j].field2.b.c = i + 1; - cbuf[j].field3 = i + 1; - cbuf[j].field4.a = i + 1; - cbuf[j].field4.b = i + 1; - } /* end for */ + } else { /* Integer type */ + HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); + for(j = 0; j < num_elmts; j++) + ibuf[j] = action1; - /* Write to the dataset */ - if(H5Dwrite(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0) - goto error; - } else { /* Integer type */ - HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); - for(j = 0; j < num_elmts; j++) - ibuf[j] = (int)(i + 1); - - /* Write to the dataset */ - if(H5Dwrite(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0) - goto error; - } /* end if-else */ - - if(H5Dflush(did) < 0) + /* Write to the dataset */ + if(H5Dwrite(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0) goto error; + } /* end if-else */ - } /* end for TWO_NTESTS */ + if(H5Dflush(did) < 0) + goto error; /* Closing */ if(H5Tclose(dtid) < 0) goto error; @@ -227,8 +188,8 @@ extend_dset_two(const char *file, char *dname) if(H5Pclose(fapl) < 0) goto error; if(H5Fclose(fid) < 0) goto error; - HDfree(ibuf); - HDfree(cbuf); + if(ibuf) HDfree(ibuf); + if(cbuf) HDfree(cbuf); return SUCCEED; @@ -252,21 +213,13 @@ error: /* *********************************************************************** * - * Extending a one-dimensional dataset - * Test cases: - * #1: increase - * #2: decrease - * #3: same - * #4: decrease - * #5: increase - * - * one_tests[ONE_NTESTS] = {3, -1, 0, -11, 2} - * varies from 10->13->12->12->1->3 + * Extending a one-dimensional dataset by action: + * --action can be a positive # or negative # or 0. * *********************************************************************** */ static herr_t -extend_dset_one(const char *file, char *dname) +extend_dset_one(const char *file, char *dname, int action) { hid_t fid = -1; /* file id */ hid_t fapl = -1; /* file access property list id */ @@ -319,80 +272,75 @@ extend_dset_one(const char *file, char *dname) if(h5_wait_message(READER_MESSAGE) < 0) goto error; - /* Loop through different variations of extending the dataset */ - for(i = 0; i < ONE_NTESTS; i++) { + /* sleep to emulate about 2 seconds of application operation */ + HDsleep(2); + + /* Get current dimension sizes */ + if(H5LDget_dset_dims(did, cur_dims) < 0) + goto error; + + /* Set up the new extended dimension sizes */ + ext_dims[0] = cur_dims[0] + (hsize_t)action; - /* sleep to emulate about 2 seconds of application operation */ - HDsleep(2); + /* Extend the dataset */ + if(H5Dset_extent(did, ext_dims) < 0) + goto error; - /* Get current dimension sizes */ - if(H5LDget_dset_dims(did, cur_dims) < 0) - goto error; + /* Write to the new appended region of the dataset */ + if(action > 0) { - /* Set up the new extended dimension sizes */ - ext_dims[0] = cur_dims[0] + (hsize_t)one_tests[i]; + /* Select the extended region */ + offset[0] = cur_dims[0]; + count[0] = (hsize_t)action; + if((sid = H5Dget_space(did)) < 0) + goto error; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) + goto error; - /* Extend the dataset */ - if(H5Dset_extent(did, ext_dims) < 0) + /* Set up memory space and get dataset's datatype */ + if((mid = H5Screate_simple(1, count, NULL)) < 0) goto error; - /* Write to the new appended region of the dataset */ - if(one_tests[i] > 0) { + /* Initialize data for the extended region of the dataset */ + /* Compound type */ + if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { - /* Select the extended region */ - offset[0] = cur_dims[0]; - count[0] = (hsize_t)one_tests[i]; - if((sid = H5Dget_space(did)) < 0) - goto error; - if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) + HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); + for(j = 0; j < (unsigned)action; j++) { + cbuf[j].field1 = j + 1; + cbuf[j].field2.a = j + 2; + cbuf[j].field2.b.a = j + 2; + cbuf[j].field2.b.b = j + 2; + cbuf[j].field2.b.c = j + 2; + cbuf[j].field2.c = j + 2; + + cbuf[j].field3 = j + 3; + + cbuf[j].field4.a = j + 4; + cbuf[j].field4.b = j + 4; + } /* end for */ + + /* Write to the extended region of the dataset */ + if(H5Dwrite(did, dtid, mid, sid, H5P_DEFAULT, cbuf) < 0) goto error; + } else { /* Integer type */ + + HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); + for(j = 0; j < (unsigned)action; j++) + ibuf[j] = (int)j; - /* Set up memory space and get dataset's datatype */ - if((mid = H5Screate_simple(1, count, NULL)) < 0) + /* Write to the extended region of the dataset */ + if(H5Dwrite(did, dtid, mid, sid, H5P_DEFAULT, ibuf) < 0) goto error; + } /* end if-else */ - /* Initialize data for the extended region of the dataset */ - /* Compound type */ - if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { - - HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); - for(j = 0; j < (unsigned)one_tests[i]; j++) { - cbuf[j].field1 = j + 1; - cbuf[j].field2.a = j + 2; - cbuf[j].field2.b.a = j + 2; - cbuf[j].field2.b.b = j + 2; - cbuf[j].field2.b.c = j + 2; - cbuf[j].field2.c = j + 2; - - cbuf[j].field3 = j + 3; - - cbuf[j].field4.a = j + 4; - cbuf[j].field4.b = j + 4; - } /* end for */ - - /* Write to the extended region of the dataset */ - if(H5Dwrite(did, dtid, mid, sid, H5P_DEFAULT, cbuf) < 0) - goto error; - } else { /* Integer type */ - - HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); - for(j = 0; j < (unsigned)one_tests[i]; j++) - ibuf[j] = (int)j; - - /* Write to the extended region of the dataset */ - if(H5Dwrite(did, dtid, mid, sid, H5P_DEFAULT, ibuf) < 0) - goto error; - } /* end if-else */ - - /* Closing */ - if(H5Sclose(sid) < 0) goto error; - if(H5Sclose(mid) < 0) goto error; - } /* end if */ - - if(H5Dflush(did) < 0) - goto error; + /* Closing */ + if(H5Sclose(sid) < 0) goto error; + if(H5Sclose(mid) < 0) goto error; + } /* end if */ - } /* end for ONE_NTESTS */ + if(H5Dflush(did) < 0) + goto error; /* Closing */ if(H5Tclose(dtid) < 0) goto error; @@ -400,8 +348,8 @@ extend_dset_one(const char *file, char *dname) if(H5Pclose(fapl) < 0) goto error; if(H5Fclose(fid) < 0) goto error; - HDfree(ibuf); - HDfree(cbuf); + if(ibuf) HDfree(ibuf); + if(cbuf) HDfree(cbuf); return SUCCEED; @@ -423,30 +371,44 @@ error: return FAIL; } /* end extend_dset_one() */ -/* Usage: extend_dset xx.h5 dname */ + +/* + *********************************************************************** + * + * Usage: extend_dset xx.h5 dname action1 action2 + * --action1 and action2 can be a positive # or negative # or 0. + * + *********************************************************************** + */ int main(int argc, const char *argv[]) { char *dname = NULL; char *fname = NULL; + int action1, action2; - if(argc != 3) { - HDfprintf(stderr, "Should have file name and dataset name to be extended...\n"); + if(argc != 5) { + HDfprintf(stderr, "Should have file name, dataset name, and the extended amount...\n"); goto error; } /* end if */ /* Get the dataset name to be extended */ fname = HDstrdup(argv[1]); dname = HDstrdup(argv[2]); + action1 = HDatoi(argv[3]); + action2 = HDatoi(argv[4]); if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { - if(extend_dset_one(fname, dname) < 0) + if(extend_dset_one(fname, dname, action1) < 0) goto error; - } else if(!HDstrcmp(dname, DSET_ONE) || !HDstrcmp(dname, DSET_ALLOC_LATE) || !HDstrcmp(dname, DSET_ALLOC_EARLY)) { - if(extend_dset_one(fname, dname) < 0) + } else if(!HDstrcmp(dname, DSET_ONE) || + !HDstrcmp(dname, DSET_ALLOC_LATE) || + !HDstrcmp(dname, DSET_ALLOC_EARLY)) { + if(extend_dset_one(fname, dname, action1) < 0) goto error; - } else if(!HDstrcmp(dname, DSET_TWO) || !HDstrcmp(dname, DSET_CMPD_TWO)) { - if(extend_dset_two(fname, dname) < 0) + } else if(!HDstrcmp(dname, DSET_TWO) || + !HDstrcmp(dname, DSET_CMPD_TWO)) { + if(extend_dset_two(fname, dname, action1, action2) < 0) goto error; } else { HDfprintf(stdout, "Dataset cannot be extended...\n"); @@ -462,4 +424,3 @@ error: HDfree(fname); HDexit(EXIT_FAILURE); } /* end main() */ - diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index f37b2b4..7289c58 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -20,29 +20,30 @@ /* * Note: This tool used private routine */ -#define PROGRAMNAME "h5watch" /* Name of tool */ -#define FIELD_SEP "," /* nested field separator */ -#define DEFAULT_RETRY 50 /* number of times to try opening the file */ +#define PROGRAMNAME "h5watch" /* Name of tool */ +#define FIELD_SEP "," /* nested field separator */ +#define DEFAULT_RETRY 50 /* number of times to try opening the file */ /* * Note:(see comments in hl/src/H5LDprivate.h) - * This tool uses private routines H5LD_construct_vector()and H5LD_clean_vector() + * This tool uses private routines H5LD_construct_vector()and H5LD_clean_vector() * This tool uses H5LD_memb_t data structure declared in H5LDprivate.h */ -const char *progname = "h5watch"; /* tool name */ -static char *g_list_of_fields = NULL; /* command line input for "list_of_fields" */ -static char *g_dup_fields = NULL; /* copy of "list_of_fields" */ -static H5LD_memb_t **g_listv = NULL; /* vector info for "list_of_fields" */ +const char *progname = "h5watch"; /* tool name */ +static char *g_list_of_fields = NULL; /* command line input for "list_of_fields" */ +static char *g_dup_fields = NULL; /* copy of "list_of_fields" */ +static H5LD_memb_t **g_listv = NULL; /* vector info for "list_of_fields" */ static hbool_t g_monitor_size_only = FALSE; /* monitor changes in dataset dimension sizes */ static unsigned g_polling_interval = 1; /* polling interval to check appended data */ + static hbool_t g_label = FALSE; /* label compound values */ -static int g_display_width = 80; /* output width in characters */ +static int g_display_width = 80; /* output width in characters */ static hbool_t g_simple_output = FALSE; /* make output more machine-readable */ static unsigned g_retry = DEFAULT_RETRY; /* # of times to try opening the file if somehow file is unstable */ -static hbool_t g_display_hex = FALSE; /* display data in hexadecimal format : LATER */ +static hbool_t g_display_hex = FALSE; /* display data in hexadecimal format : LATER */ static hbool_t g_user_interrupt = FALSE; /* Flag to indicate that user interrupted execution */ static herr_t doprint(hid_t did, hsize_t *start, hsize_t *block, int rank); @@ -109,9 +110,9 @@ static struct long_options l_opts[] = { * Function: doprint() * * Purpose: Prepare to print the dataset's appended data. - * Call the tools library routine h5tools_dump_dset() to do the printing. - * (This routine is mostly copied from dump_dataset_values() in tools/h5ls/h5ls.c - * and modified accordingly). + * Call the tools library routine h5tools_dump_dset() to do the printing. + * (This routine is mostly copied from dump_dataset_values() in tools/h5ls/h5ls.c + * and modified accordingly). * * Return: 0 on success; negative on failure * @@ -234,17 +235,17 @@ doprint(hid_t did, hsize_t *start, hsize_t *block, int rank) * Function: slicendump * * Purpose: To dump the slice for each dimension - * For example: prev_dims[2] = {5, 4}; cur_dims[2] = {7, 8} - * This routine will dump data as follows: - * {0, 3} to {0, 7} (1x4 elements) - * {1, 3} to {0, 7} (1x4 elements) - * {2, 3} to {0, 7} (1x4 elements) - * {3, 3} to {0, 7} (1x4 elements) - * {4, 3} to {0, 7} (1x4 elements) - * {5, 0} to {6, 7} (2x8 elements) - * - * Return: Non-negative on success - * Negative on failure + * For example: prev_dims[2] = {5, 4}; cur_dims[2] = {7, 8} + * This routine will dump data as follows: + * {0, 3} to {0, 7} (1x4 elements) + * {1, 3} to {0, 7} (1x4 elements) + * {2, 3} to {0, 7} (1x4 elements) + * {3, 3} to {0, 7} (1x4 elements) + * {4, 3} to {0, 7} (1x4 elements) + * {5, 0} to {6, 7} (2x8 elements) + * + * Return: Non-negative on success + * Negative on failure * * Programmer: Vailin Choi; August 2010 * @@ -253,9 +254,9 @@ doprint(hid_t did, hsize_t *start, hsize_t *block, int rank) static herr_t slicendump(hid_t did, hsize_t *prev_dims, hsize_t *cur_dims, hsize_t *start, hsize_t *block, int rank, int subrank) { - int i; /* Local index variable */ - int ind; /* Index for the current rank */ - herr_t ret_value = SUCCEED; /* Return value */ + int i; /* Local index variable */ + int ind; /* Index for the current rank */ + herr_t ret_value = SUCCEED; /* Return value */ ind = rank - subrank; @@ -294,13 +295,13 @@ done: * Function: monitor_dataset * * Purpose: To poll a dataset periodically for changes in dimension sizes. - * For dataset with unchanged and/or decreased dimension sizes: - * it just prints the dimension size changes - * For dataset with increase in at least one of its dimension sizes: - * it will print the new appended data to the dataset + * For dataset with unchanged and/or decreased dimension sizes: + * it just prints the dimension size changes + * For dataset with increase in at least one of its dimension sizes: + * it will print the new appended data to the dataset * * Return: Non-negative on success: dataset can be monitored - * Negative on failure: dataset cannot be monitored + * Negative on failure: dataset cannot be monitored * * Programmer: Vailin Choi; August 2010 * @@ -321,95 +322,98 @@ monitor_dataset(hid_t fid, char *dsetname) /* Open the dataset for minitoring */ if((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) { - error_msg("error in opening dataset \"%s\"\n", dsetname); - ret_value = FAIL; - goto done; + error_msg("error in opening dataset \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; } if((sid = H5Dget_space(did)) < 0) { - error_msg("error in getting dataspace id for dataset \"%s\"\n", dsetname); - ret_value = FAIL; - goto done; + error_msg("error in getting dataspace id for dataset \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; } /* Get the dataset's dimension sizes */ if((ndims = H5Sget_simple_extent_dims(sid, prev_dims, NULL)) < 0) { - error_msg("unable to get dimensions sizes for \"%s\"\n", dsetname); - ret_value = FAIL; - goto done; + error_msg("unable to get dimensions sizes for \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; } + HDfflush(stdout); /* Loop until an error occurs or the user interrupts execution */ while(!g_user_interrupt) { - /* Refreshes the dataset */ - if(H5Drefresh(did) < 0) { - ret_value = FAIL; - goto done; - } + /* Refreshes the dataset */ + if(H5Drefresh(did) < 0) { + ret_value = FAIL; + goto done; + } - /* Get the dataset's current dimension sizes */ - if(H5LDget_dset_dims(did, cur_dims) < 0) { - error_msg("unable to get dimension sizes for \"%s\"\n", dsetname); - ret_value = FAIL; - goto done; - } + /* Get the dataset's current dimension sizes */ + if(H5LDget_dset_dims(did, cur_dims) < 0) { + error_msg("unable to get dimension sizes for \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; + } - /* Check the dimension sizes */ - for(i = 0; i < ndims; i++) - if(cur_dims[i] != prev_dims[i]) - break; - - /* at least one dimension has changed */ - if(i != ndims) { - /* Printing changes in dimension sizes */ - for(u = 0; u < ndims; u++) { - HDfprintf(stdout, "dimension %u: %Hu->%Hu", (unsigned)u, prev_dims[u], cur_dims[u]); - if(cur_dims[u] > prev_dims[u]) - HDfprintf(stdout, " (increases)\n"); - else if(cur_dims[u] < prev_dims[u]) - HDfprintf(stdout, " (decreases)\n"); - else - HDfprintf(stdout, " (unchanged)\n"); - } - - /* Printing elements appended to the dataset if there is */ - if(!g_monitor_size_only) { - - /* See if at least one dimension size has increased */ - for(u = 0; u < ndims; u++) { - int j; - hsize_t start[H5S_MAX_RANK]; - hsize_t block[H5S_MAX_RANK]; - - /* Print the new appended data to the dataset */ - if(cur_dims[u] > prev_dims[u]) { - HDfprintf(stdout, " Data:\n"); - - for(j = 0; j < ndims; j++) { - start[j] = 0; - block[j] = 1; - } - - if((ret_value = slicendump(did, prev_dims, cur_dims, start, block, ndims, ndims)) < 0) - goto done; - break; - } - } /* end for */ - } - HDfflush(stdout); - } + /* Check the dimension sizes */ + for(i = 0; i < ndims; i++) + if(cur_dims[i] != prev_dims[i]) + break; + + /* at least one dimension has changed */ + if(i != ndims) { + /* Printing changes in dimension sizes */ + for(u = 0; u < ndims; u++) { + HDfprintf(stdout, "dimension %u: %Hu->%Hu", (unsigned)u, prev_dims[u], cur_dims[u]); + if(cur_dims[u] > prev_dims[u]) + HDfprintf(stdout, " (increases)\n"); + else if(cur_dims[u] < prev_dims[u]) + HDfprintf(stdout, " (decreases)\n"); + else + HDfprintf(stdout, " (unchanged)\n"); + } + + /* Printing elements appended to the dataset if there is */ + if(!g_monitor_size_only) { + + /* See if at least one dimension size has increased */ + for(u = 0; u < ndims; u++) { + int j; + hsize_t start[H5S_MAX_RANK]; + hsize_t block[H5S_MAX_RANK]; + + /* Print the new appended data to the dataset */ + if(cur_dims[u] > prev_dims[u]) { + HDfprintf(stdout, " Data:\n"); + + for(j = 0; j < ndims; j++) { + start[j] = 0; + block[j] = 1; + } + + if((ret_value = slicendump(did, prev_dims, cur_dims, start, block, ndims, ndims)) < 0) + goto done; + break; + } + } /* end for */ + } + HDfflush(stdout); + } - /* Save the current dimension sizes */ - HDmemcpy(prev_dims, cur_dims, (size_t)ndims * sizeof(hsize_t)); + /* Save the current dimension sizes */ + HDmemcpy(prev_dims, cur_dims, (size_t)ndims * sizeof(hsize_t)); - /* Sleep before next monitor */ + /* Sleep before next monitor */ HDsleep(g_polling_interval); } /* end while */ + HDfflush(stdout); + done: /* Closing */ H5E_BEGIN_TRY - H5Dclose(did); + H5Dclose(did); H5E_END_TRY return(ret_value); @@ -419,7 +423,7 @@ done: * Function: process_cmpd_fields * * Purpose: To check whether the fields selected in "g_list_of_fields" - * are valid fields associated with the dataset. + * are valid fields associated with the dataset. * * Return: 0 on success; negative on failure * @@ -430,39 +434,39 @@ done: static herr_t process_cmpd_fields(hid_t fid, char *dsetname) { - hid_t did=-1; /* dataset id */ - hid_t dtid=-1, tid=-1; /* dataset's data type id */ - size_t len; /* number of comma-separated fields in "g_list_of_fields" */ - herr_t ret_value = SUCCEED; /* Return value */ + hid_t did=-1; /* dataset id */ + hid_t dtid=-1, tid=-1; /* dataset's data type id */ + size_t len; /* number of comma-separated fields in "g_list_of_fields" */ + herr_t ret_value = SUCCEED; /* Return value */ HDassert(g_list_of_fields && *g_list_of_fields); /* Open the dataset */ if((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) { - error_msg("error in opening dataset \"%s\"\n", dsetname); - ret_value = FAIL; - goto done; + error_msg("error in opening dataset \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; } /* Get the dataset's datatype */ if(((dtid = H5Dget_type(did)) < 0) || (tid = H5Tget_native_type(dtid, H5T_DIR_DEFAULT)) < 0) { - error_msg("error in getting dataset's datatype\n"); + error_msg("error in getting dataset's datatype\n"); ret_value = FAIL; goto done; } /* Check to make sure that the dataset's datatype is compound type */ if(H5Tget_class(dtid) != H5T_COMPOUND) { - error_msg("dataset should be compound type for \n"); - ret_value = FAIL; - goto done; + error_msg("dataset should be compound type for \n"); + ret_value = FAIL; + goto done; } /* Make a copy of "g_list_of_fields" */ if((g_dup_fields = HDstrdup(g_list_of_fields)) == NULL) { - error_msg("error in duplicating g_list_of_fields\n"); + error_msg("error in duplicating g_list_of_fields\n"); ret_value = FAIL; - goto done; + goto done; } /* Estimate the number of comma-separated fields in "g_list of_fields" */ @@ -470,15 +474,15 @@ process_cmpd_fields(hid_t fid, char *dsetname) /* Allocate memory for a list vector of H5LD_memb_t structures to store "g_list_of_fields" info */ if((g_listv = (H5LD_memb_t **)HDcalloc(len, sizeof(H5LD_memb_t *))) == NULL) { - error_msg("error in allocating memory for H5LD_memb_t\n"); + error_msg("error in allocating memory for H5LD_memb_t\n"); ret_value = FAIL; - goto done; + goto done; } /* Process and store info for "g_listv" */ if(H5LD_construct_vector(g_dup_fields, g_listv, tid) < 0) { - error_msg("error in processing \n"); - ret_value = FAIL; + error_msg("error in processing \n"); + ret_value = FAIL; goto done; } @@ -486,9 +490,9 @@ process_cmpd_fields(hid_t fid, char *dsetname) done: /* Closing */ H5E_BEGIN_TRY - H5Tclose(dtid); - H5Tclose(tid); - H5Dclose(did); + H5Tclose(dtid); + H5Tclose(tid); + H5Dclose(did); H5E_END_TRY return(ret_value); } /* process_cmpd_fields() */ @@ -498,15 +502,13 @@ done: * Function: check_dataset * * Purpose: To check whether a dataset can be monitored: - A chunked dataset with unlimited or max. dimension setting + * A chunked dataset with unlimited or max. dimension setting * * Return: Non-negative on success: dataset can be monitored - * Negative on failure: dataset cannot be monitored + * Negative on failure: dataset cannot be monitored * * Programmer: Vailin Choi; August 2010 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -531,9 +533,9 @@ check_dataset(hid_t fid, char *dsetname) /* Open the dataset */ if((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) { - error_msg("unable to open dataset \"%s\"\n", dsetname); - ret_value = FAIL; - goto done; + error_msg("unable to open dataset \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; } /* Get dataset's creation property list */ @@ -560,28 +562,28 @@ check_dataset(hid_t fid, char *dsetname) /* Get dataset's dataspace */ if((sid = H5Dget_space(did)) < 0) { - error_msg("can't get dataset's dataspace\"%s\"\n", dsetname); - ret_value = FAIL; - goto done; + error_msg("can't get dataset's dataspace\"%s\"\n", dsetname); + ret_value = FAIL; + goto done; } /* Get dimension size of dataset's dataspace */ if((ndims = H5Sget_simple_extent_dims(sid, cur_dims, max_dims)) < 0) { - error_msg("can't get dataspace dimensions for dataset \"%s\"\n", dsetname); - ret_value = FAIL; - goto done; + error_msg("can't get dataspace dimensions for dataset \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; } /* Check whether dataset has unlimited dimension or max. dimension setting */ for(u = 0; u < (unsigned)ndims; u++) if(max_dims[u] == H5S_UNLIMITED || cur_dims[u] != max_dims[u]) { - unlim_max_dims = TRUE; + unlim_max_dims = TRUE; break; } if(!unlim_max_dims) { - error_msg("\"%s\" should have unlimited or max. dimension setting\n", dsetname); - ret_value = FAIL; + error_msg("\"%s\" should have unlimited or max. dimension setting\n", dsetname); + ret_value = FAIL; } done: @@ -589,9 +591,9 @@ done: /* Closing */ H5E_BEGIN_TRY - H5Sclose(sid); - H5Pclose(dcp); - H5Dclose(did); + H5Sclose(sid); + H5Pclose(dcp); + H5Dclose(did); H5E_END_TRY return(ret_value); @@ -607,7 +609,6 @@ done: * * Programmer: Vailin Choi; August 2010 * - * Modifications: * *------------------------------------------------------------------------- */ @@ -629,7 +630,6 @@ leave(int ret) * * Programmer: Vailin Choi; August 2010 * - * Modifications: *------------------------------------------------------------------------- */ static void @@ -685,8 +685,6 @@ usage(const char *prog) * * Programmer: Vailin Choi; August 2010 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -706,7 +704,7 @@ parse_command_line(int argc, const char *argv[]) switch ((char)opt) { case '?': case 'h': /* --help */ - usage(h5tools_getprogname()); + usage(h5tools_getprogname()); leave(EXIT_SUCCESS); case 'V': /* --version */ @@ -715,63 +713,63 @@ parse_command_line(int argc, const char *argv[]) break; case 'w': /* --width=N */ - g_display_width = (int)HDstrtol(opt_arg, NULL, 0); - if(g_display_width < 0) { - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); - } + g_display_width = (int)HDstrtol(opt_arg, NULL, 0); + if(g_display_width < 0) { + usage(h5tools_getprogname()); + leave(EXIT_FAILURE); + } break; case 'd': /* --dim */ - g_monitor_size_only = TRUE; + g_monitor_size_only = TRUE; break; case 'S': /* --simple */ - g_simple_output = TRUE; + g_simple_output = TRUE; break; - case 'l': /* --label */ - g_label = TRUE; + case 'l': /* --label */ + g_label = TRUE; break; case 'p': /* --polling=N */ - /* g_polling_interval = HDstrtod(opt_arg, NULL); */ - if((tmp = (int)HDstrtol(opt_arg, NULL, 10)) <= 0) { - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); - } - g_polling_interval = (unsigned)tmp; + /* g_polling_interval = HDstrtod(opt_arg, NULL); */ + if((tmp = (int)HDstrtol(opt_arg, NULL, 10)) <= 0) { + usage(h5tools_getprogname()); + leave(EXIT_FAILURE); + } + g_polling_interval = (unsigned)tmp; break; case 'f': /* --fields= */ - if(g_list_of_fields == NULL) { - if((g_list_of_fields = HDstrdup(opt_arg)) == NULL) { - error_msg("memory allocation failed (file %s:line %d)\n", - __FILE__, __LINE__); - leave(EXIT_FAILURE); - } - } else { - char *str; - - if((str = HDstrdup(opt_arg)) == NULL) { - error_msg("memory allocation failed (file %s:line %d)\n", - __FILE__, __LINE__); - leave(EXIT_FAILURE); - } - if((g_list_of_fields = (char *)HDrealloc(g_list_of_fields, HDstrlen(g_list_of_fields) + HDstrlen(str) + 2)) == NULL) { - error_msg("memory allocation failed (file %s:line %d)\n", - __FILE__, __LINE__); - leave(EXIT_FAILURE); - - } - HDstrcat(g_list_of_fields, FIELD_SEP); - HDstrcat(g_list_of_fields, str); - } + if(g_list_of_fields == NULL) { + if((g_list_of_fields = HDstrdup(opt_arg)) == NULL) { + error_msg("memory allocation failed (file %s:line %d)\n", + __FILE__, __LINE__); + leave(EXIT_FAILURE); + } + } else { + char *str; + + if((str = HDstrdup(opt_arg)) == NULL) { + error_msg("memory allocation failed (file %s:line %d)\n", + __FILE__, __LINE__); + leave(EXIT_FAILURE); + } + if((g_list_of_fields = (char *)HDrealloc(g_list_of_fields, HDstrlen(g_list_of_fields) + HDstrlen(str) + 2)) == NULL) { + error_msg("memory allocation failed (file %s:line %d)\n", + __FILE__, __LINE__); + leave(EXIT_FAILURE); + + } + HDstrcat(g_list_of_fields, FIELD_SEP); + HDstrcat(g_list_of_fields, str); + } break; default: - usage(h5tools_getprogname()); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } } @@ -780,7 +778,7 @@ parse_command_line(int argc, const char *argv[]) /* check for object to be processed */ if (argc <= opt_ind) { error_msg("missing dataset name\n"); - usage(h5tools_getprogname()); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } } /* parse_command_line() */ @@ -790,7 +788,7 @@ parse_command_line(int argc, const char *argv[]) * Function: catch_signal * * Purpose: The signal handler to catch the signals: - * SIGTERM and SIGINT and exit from h5watch + * SIGTERM and SIGINT and set flag to get out of the main loop * * Return: No return * @@ -820,14 +818,14 @@ static void catch_signal(int H5_ATTR_UNUSED signo) int main(int argc, const char *argv[]) { - char drivername[50]; - char *fname = NULL; - char *dname = NULL; - void *edata; - H5E_auto2_t func; - char *x; - hid_t fid = -1; - hid_t fapl = -1; + char drivername[50]; /* VFD name */ + char *fname = NULL; /* File name */ + char *dname = NULL; /* Dataset name */ + void *edata; /* Error reporting */ + H5E_auto2_t func; /* Error reporting */ + char *x; /* Temporary string pointer */ + hid_t fid = -1; /* File ID */ + hid_t fapl = -1; /* File access property list */ /* Set up tool name and exit status */ h5tools_setprogname(PROGRAMNAME); @@ -842,14 +840,14 @@ main(int argc, const char *argv[]) /* To exit from h5watch for SIGTERM signal */ if(HDsignal(SIGTERM, catch_signal) == SIG_ERR) { - error_msg("An error occurred while setting a signal handler.\n"); - leave(EXIT_FAILURE); + error_msg("An error occurred while setting a signal handler.\n"); + leave(EXIT_FAILURE); } /* To exit from h5watch for SIGINT signal */ if(HDsignal(SIGINT, catch_signal) == SIG_ERR) { error_msg("An error occurred while setting a signal handler.\n"); - leave(EXIT_FAILURE); + leave(EXIT_FAILURE); } /* parse command line options */ @@ -857,7 +855,7 @@ main(int argc, const char *argv[]) if(argc <= opt_ind) { error_msg("missing dataset name\n"); - usage(h5tools_getprogname()); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } @@ -877,9 +875,9 @@ main(int argc, const char *argv[]) * doesn't exist). */ if((fname = HDstrdup(argv[opt_ind])) == NULL) { - error_msg("memory allocation failed (file %s:line %d)\n", - __FILE__, __LINE__); - h5tools_setstatus(EXIT_FAILURE); + error_msg("memory allocation failed (file %s:line %d)\n", + __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); } /* Create a copy of file access property list */ @@ -891,80 +889,80 @@ main(int argc, const char *argv[]) return -1; do { - while(fname && *fname) { - fid = h5tools_fopen(fname, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl, NULL, drivername, sizeof drivername); - - if(fid >= 0) { - HDfprintf(stdout, "Opened \"%s\" with %s driver.\n", fname, drivername); - break; /*success*/ - } /* end if */ - - /* Shorten the file name; lengthen the object name */ - x = dname; - dname = HDstrrchr(fname, '/'); - if(x) - *x = '/'; - if(!dname) - break; - *dname = '\0'; - } /* end while */ + while(fname && *fname) { + fid = h5tools_fopen(fname, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl, NULL, drivername, sizeof drivername); + + if(fid >= 0) { + HDfprintf(stdout, "Opened \"%s\" with %s driver.\n", fname, drivername); + break; /*success*/ + } /* end if */ + + /* Shorten the file name; lengthen the object name */ + x = dname; + dname = HDstrrchr(fname, '/'); + if(x) + *x = '/'; + if(!dname) + break; + *dname = '\0'; + } /* end while */ /* Try opening the file again if somehow unstable */ } while(g_retry-- > 0 && fid == FAIL); if(fid < 0) { - error_msg("unable to open file \"%s\"\n", fname); - if(fname) HDfree(fname); - if(fapl >= 0) H5Pclose(fapl); - leave(EXIT_FAILURE); + error_msg("unable to open file \"%s\"\n", fname); + if(fname) HDfree(fname); + if(fapl >= 0) H5Pclose(fapl); + leave(EXIT_FAILURE); } if(!dname) { - error_msg("no dataset specified\n"); - h5tools_setstatus(EXIT_FAILURE); + error_msg("no dataset specified\n"); + h5tools_setstatus(EXIT_FAILURE); } else { - *dname = '/'; - x = dname; - if((dname = HDstrdup(dname)) == NULL) { - error_msg("memory allocation failed (file %s:line %d)\n", - __FILE__, __LINE__); - h5tools_setstatus(EXIT_FAILURE); - } else { - *x = '\0'; - /* Validate dataset */ - if(check_dataset(fid, dname) < 0) - h5tools_setstatus(EXIT_FAILURE); - /* Validate input "fields" */ - else if(g_list_of_fields && *g_list_of_fields) - if(process_cmpd_fields(fid, dname) < 0) - h5tools_setstatus(EXIT_FAILURE); - } + *dname = '/'; + x = dname; + if((dname = HDstrdup(dname)) == NULL) { + error_msg("memory allocation failed (file %s:line %d)\n", + __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); + } else { + *x = '\0'; + /* Validate dataset */ + if(check_dataset(fid, dname) < 0) + h5tools_setstatus(EXIT_FAILURE); + /* Validate input "fields" */ + else if(g_list_of_fields && *g_list_of_fields) + if(process_cmpd_fields(fid, dname) < 0) + h5tools_setstatus(EXIT_FAILURE); + } } /* If everything is fine, start monitoring the datset */ if(h5tools_getstatus() != EXIT_FAILURE) - if(monitor_dataset(fid, dname) < 0) - h5tools_setstatus(EXIT_FAILURE); + if(monitor_dataset(fid, dname) < 0) + h5tools_setstatus(EXIT_FAILURE); /* Free spaces */ if(fname) HDfree(fname); if(dname) HDfree(dname); if(g_list_of_fields) HDfree(g_list_of_fields); if(g_listv) { - H5LD_clean_vector(g_listv); - HDfree(g_listv); + H5LD_clean_vector(g_listv); + HDfree(g_listv); } if(g_dup_fields) HDfree(g_dup_fields); /* Close the file access property list */ if(fapl >= 0 && H5Pclose(fapl) < 0) { - error_msg("unable to close file access property list\n"); - h5tools_setstatus(EXIT_FAILURE); + error_msg("unable to close file access property list\n"); + h5tools_setstatus(EXIT_FAILURE); } /* Close the file */ if(H5Fclose(fid) < 0) { - error_msg("unable to close file\n"); - h5tools_setstatus(EXIT_FAILURE); + error_msg("unable to close file\n"); + h5tools_setstatus(EXIT_FAILURE); } H5Eset_auto2(H5E_DEFAULT, func, edata); diff --git a/hl/tools/h5watch/testh5watch.sh.in b/hl/tools/h5watch/testh5watch.sh.in index 02f155f..33660b4 100644 --- a/hl/tools/h5watch/testh5watch.sh.in +++ b/hl/tools/h5watch/testh5watch.sh.in @@ -46,6 +46,7 @@ GEN_TEST=h5watchgentest # Generate HDF5 file with various datasets GEN_TEST_BIN=`pwd`/$GEN_TEST # Path of the binary GEN_TEST WATCHFILE=`pwd`/WATCH.h5 # The HDF5 file generated to test h5watch TESTFILE=TEST.h5 # The temporary file (a copy of WATCH.h5) used by tests +TRY_MAX=10 # Try running the test again # # These 3 defines should be the same as the defines in ./extend_dset.c WRITER_MESSAGE=writer_message # The message file created by the "extend" process @@ -118,29 +119,30 @@ TOOLTEST() { exitcode=$? cat $actual_err >> $actual if [ $exitcode -ne $retvalexpect ]; then - $ECHO "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - $ECHO "test returned with exit code $exitcode" - $ECHO "test output: (up to $NLINES lines)" - head -$NLINES $actual - $ECHO "***end of test output***" - $ECHO "" - fi - elif $CMP $expect $actual; then - $ECHO " PASSED" - else $ECHO "*FAILED*" - $ECHO " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' - fi + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + $ECHO "test returned with exit code $exitcode" + $ECHO "test output: (up to $NLINES lines)" + head -$NLINES $actual + $ECHO "***end of test output***" + $ECHO "" + fi + elif $CMP $expect $actual; then + $ECHO " PASSED" + else + $ECHO "*FAILED*" + $ECHO " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then rm -f $actual $actual_err fi } + # # # @@ -150,8 +152,13 @@ TOOLTEST() { # $1 -- the specified dataset to watch and to extend # $2 -- the options to h5watch (can be NULL) # $3 -- expected output from watching the object +# $4 -- action 1 +# $5 -- action 2 # TEST_WATCH() { +try=0 +while [ $try -lt $TRY_MAX ] ; +do cp $WATCHFILE $TESTFILE # Copy the file being watched/extended to a temporary file actual="../testfiles/`basename $3 .ddl`.out" # The actual output expect="$srcdir/../testfiles/$3" # The expected output @@ -165,7 +172,7 @@ TEST_WATCH() { rm -f $WRITER_MESSAGE # Remove the file just to be sure rm -f $READER_MESSAGE # Remove the file just to be sure # - $EXTEND_BIN $TESTFILE $1 & # Extend the dataset; put in background + $EXTEND_BIN $TESTFILE $1 $4 $5& # Extend the dataset; put in background extend_pid=$! # Get "extend" process ID # # Wait for message from "extend_dset" process to start h5watch-- @@ -178,10 +185,10 @@ TEST_WATCH() { do t1=`date +%s` # Get current time in seconds difft=`expr $t1 - $t0` # Calculate the time difference - if [ -e $WRITER_MESSAGE ]; then # If message file is found: + if [ -e $WRITER_MESSAGE ]; then # If message file is found: mexist=1 # indicate the message file is found - rm $WRITER_MESSAGE # remove the message file - break # get out of the while loop + rm $WRITER_MESSAGE # remove the message file + break # get out of the while loop fi done; # @@ -207,7 +214,7 @@ TEST_WATCH() { extend_exit=$? # Collect "extend" process' exit code sleep 1 # Sleep to make sure output is flushed kill $watch_pid # Kill h5watch - wait $watch_pid # Wait for "h5watch" process to complete + wait $watch_pid # Wait for "h5watch" process to complete # if [ $extend_exit -ne 0 ]; then # Error returned from "extend" process $ECHO "*FAILED*" @@ -220,13 +227,21 @@ TEST_WATCH() { $ECHO "" fi elif $CMP $expect $actual; then # Compare actual output with expected output + try=$TRY_MAX $ECHO " PASSED" else - $ECHO "*FAILED*" # Actual and expected outputs are different - $ECHO " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - if test yes = "$verbose"; then - $DIFF $expect $actual |sed 's/^/ /' + try="`expr $try + 1`" + if [ $try -lt $TRY_MAX ]; then + $ECHO "*RETRY" + rm -f $actual + rm -f $TESTFILE + else + $ECHO "*FAILED*" # Actual and expected outputs are different + $ECHO " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + $DIFF $expect $actual |sed 's/^/ /' + fi fi fi # @@ -236,45 +251,45 @@ TEST_WATCH() { rm -f $actual fi fi +done; } - ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # # ################################################################################################# -# # -# WATCH.h5: file with various types of datasets for testing-- # -# The following datasets are chunked, H5D_ALLOC_TIME_INCR, max. dimensional setting: # -# DSET_ONE: one-dimensional dataset # -# DSET_TWO: two-dimensional dataset # -# DSET_CMPD: one-dimensional dataset with compound type # -# DSET_CMPD_ESC: one-dimensional dataset with compound type & escape/separator characters # -# DSET_CMPD_TWO: two-dimensional dataset with compound type # -# # -# The following datasets are one-dimensional, chunked, max. dimension setting: # -# DSET_ALLOC_EARLY: dataset with H5D_ALLOC_TIME_EARLY # -# DSET_ALLOC_LATE: dataset H5D_ALLOC_TIME_LATE # -# # -# The following datasets are one-dimensional: # -# DSET_NONE: fixed dimension setting, contiguous, H5D_ALLOC_TIME_LATE # -# DSET_NOMAX: fixed dimension setting, chunked, H5D_ALLOC_TIME_INCR # -# # +# # +# WATCH.h5: file with various types of datasets for testing-- # +# The following datasets are chunked, H5D_ALLOC_TIME_INCR, max. dimensional setting: # +# DSET_ONE: one-dimensional dataset # +# DSET_TWO: two-dimensional dataset # +# DSET_CMPD: one-dimensional dataset with compound type # +# DSET_CMPD_ESC: one-dimensional dataset with compound type & escape/separator characters # +# DSET_CMPD_TWO: two-dimensional dataset with compound type # +# # +# The following datasets are one-dimensional, chunked, max. dimension setting: # +# DSET_ALLOC_EARLY: dataset with H5D_ALLOC_TIME_EARLY # +# DSET_ALLOC_LATE: dataset H5D_ALLOC_TIME_LATE # +# # +# The following datasets are one-dimensional: # +# DSET_NONE: fixed dimension setting, contiguous, H5D_ALLOC_TIME_LATE # +# DSET_NOMAX: fixed dimension setting, chunked, H5D_ALLOC_TIME_INCR # +# # ################################################################################################# # # ################################################################################################# -# # -# Tests on expected failures: # -# Invalid file name # -# Unable to find dataset, invalid dataset # -# DSET_NONE and DSET_NOMAX # -# Invalid input to options --width and --polling # -# Invalid field names for -f option # -# # +# # +# Tests on expected failures: # +# Invalid file name # +# Unable to find dataset, invalid dataset # +# DSET_NONE and DSET_NOMAX # +# Invalid input to options --width and --polling # +# Invalid field names for -f option # +# # ################################################################################################# # # Generate file with various types of datasets @@ -319,13 +334,13 @@ $GEN_TEST_BIN # TEST.h5/DSET_CMPD_TWO # TEST.h5/DSET_CMPD_ESC # -TEST_WATCH DSET_ONE '' w-ext-one.ddl -TEST_WATCH DSET_ALLOC_EARLY '' w-ext-early.ddl -TEST_WATCH DSET_ALLOC_LATE '' w-ext-late.ddl -TEST_WATCH DSET_CMPD '' w-ext-cmpd.ddl -TEST_WATCH DSET_TWO '' w-ext-two.ddl -TEST_WATCH DSET_CMPD_TWO '' w-ext-cmpd-two.ddl -TEST_WATCH DSET_CMPD_ESC '' w-ext-cmpd-esc.ddl +TEST_WATCH DSET_ONE '' w-ext-one.ddl 3 0 #Increase +TEST_WATCH DSET_ALLOC_EARLY '' w-ext-early.ddl -1 0 #Decrease +TEST_WATCH DSET_ALLOC_LATE '' w-ext-late.ddl 0 0 #Same +TEST_WATCH DSET_CMPD '' w-ext-cmpd.ddl 3 0 #Increase +TEST_WATCH DSET_CMPD_ESC '' w-ext-cmpd-esc.ddl -1 0 #Decrease +TEST_WATCH DSET_TWO '' w-ext-two.ddl 2 2 #Increase, Increase +TEST_WATCH DSET_CMPD_TWO '' w-ext-cmpd-two.ddl 2 -9 #Increase, Decrease # echo "DONE WITH 2nd SET OF TESTS" # @@ -339,25 +354,25 @@ echo "DONE WITH 2nd SET OF TESTS" # TEST.h5/DSET_CMPD with --fields=field1,field2 # TEST.h5/DSET_CMPD with --fields=field2.b,field4 # TEST.h5/DSET_CMPD with --fields=field2.b.a --fields=field2.c -TEST_WATCH DSET_CMPD --fields=field1,field2 w-ext-cmpd-f1.ddl -TEST_WATCH DSET_CMPD --fields=field2.b,field4 w-ext-cmpd-f2.ddl -TEST_WATCH DSET_CMPD '--fields=field2.b.a --fields=field2.c' w-ext-cmpd-ff3.ddl +TEST_WATCH DSET_CMPD --fields=field1,field2 w-ext-cmpd-f1.ddl -9 0 #Decrease +TEST_WATCH DSET_CMPD --fields=field2.b,field4 w-ext-cmpd-f2.ddl 3 0 #Increase +TEST_WATCH DSET_CMPD '--fields=field2.b.a --fields=field2.c' w-ext-cmpd-ff3.ddl 0 0 #Same # # # TEST.h5/DSET_CMP_TWO with --fields=field1,field2 # TEST.h5/DSET_CMPD_TWO with --fields=field2.b --fields=field4 # TEST.h5/DSET_CMPD_TWO with --fields=field2.b.a,field2.c -TEST_WATCH DSET_CMPD_TWO --fields=field1,field2 w-ext-cmpd-two-f1.ddl -TEST_WATCH DSET_CMPD_TWO '--fields=field2.b --fields=field4' w-ext-cmpd-two-ff2.ddl -TEST_WATCH DSET_CMPD_TWO --fields=field2.b.a,field2.c w-ext-cmpd-two-f3.ddl +TEST_WATCH DSET_CMPD_TWO --fields=field1,field2 w-ext-cmpd-two-f1.ddl 2 0 #Increase, Same +TEST_WATCH DSET_CMPD_TWO '--fields=field2.b --fields=field4' w-ext-cmpd-two-ff2.ddl -1 2 #Decrease, Increase +TEST_WATCH DSET_CMPD_TWO --fields=field2.b.a,field2.c w-ext-cmpd-two-f3.ddl -1 -3 #Decrease, Decrease # # # TEST.h5/DSET_CMPD_ESC with --fields=field\,1,field2\. # TEST.h5/DSET_CMPD_ESC with --fields=field2\..\,b --fields=field4\, # TEST.h5/DSET_CMPD_ESC with --fields=field2\..\,b.a,field2\..\\K -TEST_WATCH DSET_CMPD_ESC '--fields=field\,1,field2\.' w-ext-cmpd-esc-f1.ddl -TEST_WATCH DSET_CMPD_ESC '--fields=field2\..\,b --fields=field4\,' w-ext-cmpd-esc-ff2.ddl -TEST_WATCH DSET_CMPD_ESC '--fields=field2\..\,b.a,field2\..\\K' w-ext-cmpd-esc-f3.ddl +TEST_WATCH DSET_CMPD_ESC '--fields=field\,1,field2\.' w-ext-cmpd-esc-f1.ddl 3 0 #Increase +TEST_WATCH DSET_CMPD_ESC '--fields=field2\..\,b --fields=field4\,' w-ext-cmpd-esc-ff2.ddl -1 0 #Decrease +TEST_WATCH DSET_CMPD_ESC '--fields=field2\..\,b.a,field2\..\\K' w-ext-cmpd-esc-f3.ddl 3 0 #Increase # # echo "DONE WITH 3rd SET OF TESTS" @@ -376,11 +391,11 @@ echo "DONE WITH 3rd SET OF TESTS" # TEST.h5/DSET_TWO with --width=60 option # TEST.h5/DSET_CMPD with --label option # TEST.h5/DSET_ONE with --simple option -TEST_WATCH DSET_ONE --dim w-ext-one-d.ddl -TEST_WATCH DSET_TWO --dim w-ext-two-d.ddl -TEST_WATCH DSET_TWO --width=30 w-ext-two-width.ddl -TEST_WATCH DSET_CMPD --label w-ext-cmpd-label.ddl -TEST_WATCH DSET_ONE --simple w-ext-one-simple.ddl +TEST_WATCH DSET_ONE --dim w-ext-one-d.ddl 3 0 #Increase +TEST_WATCH DSET_TWO --dim w-ext-two-d.ddl -2 0 #Decrease, Same +TEST_WATCH DSET_TWO --width=30 w-ext-two-width.ddl 0 2 #Same, Increase +TEST_WATCH DSET_CMPD --label w-ext-cmpd-label.ddl 3 0 #Increase +TEST_WATCH DSET_ONE --simple w-ext-one-simple.ddl 2 0 #I # echo "DONE WITH 4th SET OF TESTS" # diff --git a/hl/tools/testfiles/w-ext-cmpd-esc-f1.ddl b/hl/tools/testfiles/w-ext-cmpd-esc-f1.ddl index d85594d..09255cc 100644 --- a/hl/tools/testfiles/w-ext-cmpd-esc-f1.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-esc-f1.ddl @@ -4,8 +4,3 @@ dimension 0: 10->13 (increases) Data: (10) {1, {2, {2, 2, 2}, 2}}, {2, {3, {3, 3, 3}, 3}}, (12) {3, {4, {4, 4, 4}, 4}} -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) - Data: - (1) {1, {2, {2, 2, 2}, 2}}, {2, {3, {3, 3, 3}, 3}} diff --git a/hl/tools/testfiles/w-ext-cmpd-esc-f3.ddl b/hl/tools/testfiles/w-ext-cmpd-esc-f3.ddl index ab6c294..00ed390 100644 --- a/hl/tools/testfiles/w-ext-cmpd-esc-f3.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-esc-f3.ddl @@ -3,8 +3,3 @@ Monitoring dataset /DSET_CMPD_ESC... dimension 0: 10->13 (increases) Data: (10) {{{2}}, {2}}, {{{3}}, {3}}, {{{4}}, {4}} -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) - Data: - (1) {{{2}}, {2}}, {{{3}}, {3}} diff --git a/hl/tools/testfiles/w-ext-cmpd-esc-ff2.ddl b/hl/tools/testfiles/w-ext-cmpd-esc-ff2.ddl index 039cbf3..9b9a971 100644 --- a/hl/tools/testfiles/w-ext-cmpd-esc-ff2.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-esc-ff2.ddl @@ -1,11 +1,3 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_ESC... -dimension 0: 10->13 (increases) - Data: - (10) {{{2, 2, 2}}, {4, 4}}, {{{3, 3, 3}}, {5, 5}}, {{{4, 4, 4}}, {6, - (12) 6}} -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) - Data: - (1) {{{2, 2, 2}}, {4, 4}}, {{{3, 3, 3}}, {5, 5}} +dimension 0: 10->9 (decreases) diff --git a/hl/tools/testfiles/w-ext-cmpd-esc.ddl b/hl/tools/testfiles/w-ext-cmpd-esc.ddl index 900b3f2..9b9a971 100644 --- a/hl/tools/testfiles/w-ext-cmpd-esc.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-esc.ddl @@ -1,13 +1,3 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_ESC... -dimension 0: 10->13 (increases) - Data: - (10) {1, {2, {2, 2, 2}, 2}, 3, {4, 4}}, - (11) {2, {3, {3, 3, 3}, 3}, 4, {5, 5}}, - (12) {3, {4, {4, 4, 4}, 4}, 5, {6, 6}} -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) - Data: - (1) {1, {2, {2, 2, 2}, 2}, 3, {4, 4}}, {2, {3, {3, 3, 3}, 3}, 4, {5, - (2) 5}} +dimension 0: 10->9 (decreases) diff --git a/hl/tools/testfiles/w-ext-cmpd-f1.ddl b/hl/tools/testfiles/w-ext-cmpd-f1.ddl index 7e0a066..029e4db 100644 --- a/hl/tools/testfiles/w-ext-cmpd-f1.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-f1.ddl @@ -1,11 +1,3 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD... -dimension 0: 10->13 (increases) - Data: - (10) {1, {2, {2, 2, 2}, 2}}, {2, {3, {3, 3, 3}, 3}}, - (12) {3, {4, {4, 4, 4}, 4}} -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) - Data: - (1) {1, {2, {2, 2, 2}, 2}}, {2, {3, {3, 3, 3}, 3}} +dimension 0: 10->1 (decreases) diff --git a/hl/tools/testfiles/w-ext-cmpd-f2.ddl b/hl/tools/testfiles/w-ext-cmpd-f2.ddl index ea69222..362cc94 100644 --- a/hl/tools/testfiles/w-ext-cmpd-f2.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-f2.ddl @@ -4,8 +4,3 @@ dimension 0: 10->13 (increases) Data: (10) {{{2, 2, 2}}, {4, 4}}, {{{3, 3, 3}}, {5, 5}}, {{{4, 4, 4}}, {6, (12) 6}} -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) - Data: - (1) {{{2, 2, 2}}, {4, 4}}, {{{3, 3, 3}}, {5, 5}} diff --git a/hl/tools/testfiles/w-ext-cmpd-ff3.ddl b/hl/tools/testfiles/w-ext-cmpd-ff3.ddl index 84e2919..6a54b97 100644 --- a/hl/tools/testfiles/w-ext-cmpd-ff3.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-ff3.ddl @@ -1,10 +1,2 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD... -dimension 0: 10->13 (increases) - Data: - (10) {{{2}}, {2}}, {{{3}}, {3}}, {{{4}}, {4}} -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) - Data: - (1) {{{2}}, {2}}, {{{3}}, {3}} diff --git a/hl/tools/testfiles/w-ext-cmpd-label.ddl b/hl/tools/testfiles/w-ext-cmpd-label.ddl index 84534ea..394d5a6 100644 --- a/hl/tools/testfiles/w-ext-cmpd-label.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-label.ddl @@ -8,11 +8,3 @@ dimension 0: 10->13 (increases) (11) field4={a=5, b=5}}, (12) {field1=3, field2={a=4, b={a=4, b=4, c=4}, c=4}, field3=5, (12) field4={a=6, b=6}} -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) - Data: - (1) {field1=1, field2={a=2, b={a=2, b=2, c=2}, c=2}, field3=3, - (1) field4={a=4, b=4}}, - (2) {field1=2, field2={a=3, b={a=3, b=3, c=3}, c=3}, field3=4, - (2) field4={a=5, b=5}} diff --git a/hl/tools/testfiles/w-ext-cmpd-two-f1.ddl b/hl/tools/testfiles/w-ext-cmpd-two-f1.ddl index 49abde9..9b4c235 100644 --- a/hl/tools/testfiles/w-ext-cmpd-two-f1.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-two-f1.ddl @@ -1,47 +1,15 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_TWO... dimension 0: 4->6 (increases) -dimension 1: 10->12 (increases) - Data: - (0,10) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}} - (1,10) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}} - (2,10) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}} - (3,10) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}} - (4,0) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}}, - (4,2) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}}, - (4,4) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}}, - (4,6) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}}, - (4,8) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}}, - (4,10) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}}, - (5,0) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}}, - (5,2) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}}, - (5,4) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}}, - (5,6) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}}, - (5,8) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}}, - (5,10) {1, {1, {1, 1, 1}, 1}}, {1, {1, {1, 1, 1}, 1}} -dimension 0: 6->8 (increases) -dimension 1: 12->1 (decreases) - Data: - (6,0) {2, {2, {2, 2, 2}, 2}}, - (7,0) {2, {2, {2, 2, 2}, 2}} -dimension 0: 8->10 (increases) -dimension 1: 1->1 (unchanged) - Data: - (8,0) {3, {3, {3, 3, 3}, 3}}, - (9,0) {3, {3, {3, 3, 3}, 3}} -dimension 0: 10->3 (decreases) -dimension 1: 1->3 (increases) - Data: - (0,1) {4, {4, {4, 4, 4}, 4}}, {4, {4, {4, 4, 4}, 4}} - (1,1) {4, {4, {4, 4, 4}, 4}}, {4, {4, {4, 4, 4}, 4}} - (2,1) {4, {4, {4, 4, 4}, 4}}, {4, {4, {4, 4, 4}, 4}} -dimension 0: 3->2 (decreases) -dimension 1: 3->2 (decreases) -dimension 0: 2->1 (decreases) -dimension 1: 2->2 (unchanged) -dimension 0: 1->1 (unchanged) -dimension 1: 2->4 (increases) - Data: - (0,2) {7, {7, {7, 7, 7}, 7}}, {7, {7, {7, 7, 7}, 7}} -dimension 0: 1->1 (unchanged) -dimension 1: 4->3 (decreases) +dimension 1: 10->10 (unchanged) + Data: + (4,0) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, + (4,2) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, + (4,4) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, + (4,6) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, + (4,8) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, + (5,0) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, + (5,2) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, + (5,4) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, + (5,6) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}}, + (5,8) {2, {2, {2, 2, 2}, 2}}, {2, {2, {2, 2, 2}, 2}} diff --git a/hl/tools/testfiles/w-ext-cmpd-two-f3.ddl b/hl/tools/testfiles/w-ext-cmpd-two-f3.ddl index 0878f35..94b5c99 100644 --- a/hl/tools/testfiles/w-ext-cmpd-two-f3.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-two-f3.ddl @@ -1,41 +1,4 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_TWO... -dimension 0: 4->6 (increases) -dimension 1: 10->12 (increases) - Data: - (0,10) {{{1}}, {1}}, {{{1}}, {1}} - (1,10) {{{1}}, {1}}, {{{1}}, {1}} - (2,10) {{{1}}, {1}}, {{{1}}, {1}} - (3,10) {{{1}}, {1}}, {{{1}}, {1}} - (4,0) {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, - (4,4) {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, - (4,8) {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, - (5,0) {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, - (5,4) {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, - (5,8) {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}}, {{{1}}, {1}} -dimension 0: 6->8 (increases) -dimension 1: 12->1 (decreases) - Data: - (6,0) {{{2}}, {2}}, - (7,0) {{{2}}, {2}} -dimension 0: 8->10 (increases) -dimension 1: 1->1 (unchanged) - Data: - (8,0) {{{3}}, {3}}, - (9,0) {{{3}}, {3}} -dimension 0: 10->3 (decreases) -dimension 1: 1->3 (increases) - Data: - (0,1) {{{4}}, {4}}, {{{4}}, {4}} - (1,1) {{{4}}, {4}}, {{{4}}, {4}} - (2,1) {{{4}}, {4}}, {{{4}}, {4}} -dimension 0: 3->2 (decreases) -dimension 1: 3->2 (decreases) -dimension 0: 2->1 (decreases) -dimension 1: 2->2 (unchanged) -dimension 0: 1->1 (unchanged) -dimension 1: 2->4 (increases) - Data: - (0,2) {{{7}}, {7}}, {{{7}}, {7}} -dimension 0: 1->1 (unchanged) -dimension 1: 4->3 (decreases) +dimension 0: 4->3 (decreases) +dimension 1: 10->7 (decreases) diff --git a/hl/tools/testfiles/w-ext-cmpd-two-ff2.ddl b/hl/tools/testfiles/w-ext-cmpd-two-ff2.ddl index 669547e..482da31 100644 --- a/hl/tools/testfiles/w-ext-cmpd-two-ff2.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-two-ff2.ddl @@ -1,47 +1,8 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_TWO... -dimension 0: 4->6 (increases) +dimension 0: 4->3 (decreases) dimension 1: 10->12 (increases) Data: - (0,10) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}} - (1,10) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}} - (2,10) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}} - (3,10) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}} - (4,0) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}}, - (4,2) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}}, - (4,4) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}}, - (4,6) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}}, - (4,8) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}}, - (4,10) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}}, - (5,0) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}}, - (5,2) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}}, - (5,4) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}}, - (5,6) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}}, - (5,8) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}}, - (5,10) {{{1, 1, 1}}, {1, 1}}, {{{1, 1, 1}}, {1, 1}} -dimension 0: 6->8 (increases) -dimension 1: 12->1 (decreases) - Data: - (6,0) {{{2, 2, 2}}, {2, 2}}, - (7,0) {{{2, 2, 2}}, {2, 2}} -dimension 0: 8->10 (increases) -dimension 1: 1->1 (unchanged) - Data: - (8,0) {{{3, 3, 3}}, {3, 3}}, - (9,0) {{{3, 3, 3}}, {3, 3}} -dimension 0: 10->3 (decreases) -dimension 1: 1->3 (increases) - Data: - (0,1) {{{4, 4, 4}}, {4, 4}}, {{{4, 4, 4}}, {4, 4}} - (1,1) {{{4, 4, 4}}, {4, 4}}, {{{4, 4, 4}}, {4, 4}} - (2,1) {{{4, 4, 4}}, {4, 4}}, {{{4, 4, 4}}, {4, 4}} -dimension 0: 3->2 (decreases) -dimension 1: 3->2 (decreases) -dimension 0: 2->1 (decreases) -dimension 1: 2->2 (unchanged) -dimension 0: 1->1 (unchanged) -dimension 1: 2->4 (increases) - Data: - (0,2) {{{7, 7, 7}}, {7, 7}}, {{{7, 7, 7}}, {7, 7}} -dimension 0: 1->1 (unchanged) -dimension 1: 4->3 (decreases) + (0,10) {{{-1, -1, -1}}, {-1, -1}}, {{{-1, -1, -1}}, {-1, -1}} + (1,10) {{{-1, -1, -1}}, {-1, -1}}, {{{-1, -1, -1}}, {-1, -1}} + (2,10) {{{-1, -1, -1}}, {-1, -1}}, {{{-1, -1, -1}}, {-1, -1}} diff --git a/hl/tools/testfiles/w-ext-cmpd-two.ddl b/hl/tools/testfiles/w-ext-cmpd-two.ddl index a461226..57ffc2c 100644 --- a/hl/tools/testfiles/w-ext-cmpd-two.ddl +++ b/hl/tools/testfiles/w-ext-cmpd-two.ddl @@ -1,67 +1,7 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_CMPD_TWO... dimension 0: 4->6 (increases) -dimension 1: 10->12 (increases) +dimension 1: 10->1 (decreases) Data: - (0,10) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (0,11) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}} - (1,10) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (1,11) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}} - (2,10) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (2,11) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}} - (3,10) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (3,11) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}} - (4,0) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (4,1) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (4,2) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (4,3) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (4,4) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (4,5) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (4,6) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (4,7) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (4,8) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (4,9) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (4,10) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (4,11) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (5,0) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (5,1) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (5,2) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (5,3) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (5,4) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (5,5) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (5,6) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (5,7) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (5,8) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (5,9) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (5,10) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}}, - (5,11) {1, {1, {1, 1, 1}, 1}, 1, {1, 1}} -dimension 0: 6->8 (increases) -dimension 1: 12->1 (decreases) - Data: - (6,0) {2, {2, {2, 2, 2}, 2}, 2, {2, 2}}, - (7,0) {2, {2, {2, 2, 2}, 2}, 2, {2, 2}} -dimension 0: 8->10 (increases) -dimension 1: 1->1 (unchanged) - Data: - (8,0) {3, {3, {3, 3, 3}, 3}, 3, {3, 3}}, - (9,0) {3, {3, {3, 3, 3}, 3}, 3, {3, 3}} -dimension 0: 10->3 (decreases) -dimension 1: 1->3 (increases) - Data: - (0,1) {4, {4, {4, 4, 4}, 4}, 4, {4, 4}}, - (0,2) {4, {4, {4, 4, 4}, 4}, 4, {4, 4}} - (1,1) {4, {4, {4, 4, 4}, 4}, 4, {4, 4}}, - (1,2) {4, {4, {4, 4, 4}, 4}, 4, {4, 4}} - (2,1) {4, {4, {4, 4, 4}, 4}, 4, {4, 4}}, - (2,2) {4, {4, {4, 4, 4}, 4}, 4, {4, 4}} -dimension 0: 3->2 (decreases) -dimension 1: 3->2 (decreases) -dimension 0: 2->1 (decreases) -dimension 1: 2->2 (unchanged) -dimension 0: 1->1 (unchanged) -dimension 1: 2->4 (increases) - Data: - (0,2) {7, {7, {7, 7, 7}, 7}, 7, {7, 7}}, - (0,3) {7, {7, {7, 7, 7}, 7}, 7, {7, 7}} -dimension 0: 1->1 (unchanged) -dimension 1: 4->3 (decreases) + (4,0) {2, {2, {2, 2, 2}, 2}, 2, {2, 2}}, + (5,0) {2, {2, {2, 2, 2}, 2}, 2, {2, 2}} diff --git a/hl/tools/testfiles/w-ext-cmpd.ddl b/hl/tools/testfiles/w-ext-cmpd.ddl index 7e64a14..aac5be3 100644 --- a/hl/tools/testfiles/w-ext-cmpd.ddl +++ b/hl/tools/testfiles/w-ext-cmpd.ddl @@ -5,9 +5,3 @@ dimension 0: 10->13 (increases) (10) {1, {2, {2, 2, 2}, 2}, 3, {4, 4}}, (11) {2, {3, {3, 3, 3}, 3}, 4, {5, 5}}, (12) {3, {4, {4, 4, 4}, 4}, 5, {6, 6}} -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) - Data: - (1) {1, {2, {2, 2, 2}, 2}, 3, {4, 4}}, {2, {3, {3, 3, 3}, 3}, 4, {5, - (2) 5}} diff --git a/hl/tools/testfiles/w-ext-early.ddl b/hl/tools/testfiles/w-ext-early.ddl index 1d963d7..bb72104 100644 --- a/hl/tools/testfiles/w-ext-early.ddl +++ b/hl/tools/testfiles/w-ext-early.ddl @@ -1,10 +1,3 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_ALLOC_EARLY... -dimension 0: 10->13 (increases) - Data: - (10) 0, 1, 2 -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) - Data: - (1) 0, 1 +dimension 0: 10->9 (decreases) diff --git a/hl/tools/testfiles/w-ext-late.ddl b/hl/tools/testfiles/w-ext-late.ddl index f3a7cf2..a6f8265 100644 --- a/hl/tools/testfiles/w-ext-late.ddl +++ b/hl/tools/testfiles/w-ext-late.ddl @@ -1,10 +1,2 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_ALLOC_LATE... -dimension 0: 10->13 (increases) - Data: - (10) 0, 1, 2 -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) - Data: - (1) 0, 1 diff --git a/hl/tools/testfiles/w-ext-one-d.ddl b/hl/tools/testfiles/w-ext-one-d.ddl index 249ff95..673370a 100644 --- a/hl/tools/testfiles/w-ext-one-d.ddl +++ b/hl/tools/testfiles/w-ext-one-d.ddl @@ -1,6 +1,3 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_ONE... dimension 0: 10->13 (increases) -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) diff --git a/hl/tools/testfiles/w-ext-one-simple.ddl b/hl/tools/testfiles/w-ext-one-simple.ddl index 3bf0ef5..5df9dff 100644 --- a/hl/tools/testfiles/w-ext-one-simple.ddl +++ b/hl/tools/testfiles/w-ext-one-simple.ddl @@ -1,13 +1,6 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_ONE... -dimension 0: 10->13 (increases) - Data: - 0 - 1 - 2 -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) +dimension 0: 10->12 (increases) Data: 0 1 diff --git a/hl/tools/testfiles/w-ext-one.ddl b/hl/tools/testfiles/w-ext-one.ddl index c4e75eb..9604020 100644 --- a/hl/tools/testfiles/w-ext-one.ddl +++ b/hl/tools/testfiles/w-ext-one.ddl @@ -3,8 +3,3 @@ Monitoring dataset /DSET_ONE... dimension 0: 10->13 (increases) Data: (10) 0, 1, 2 -dimension 0: 13->12 (decreases) -dimension 0: 12->1 (decreases) -dimension 0: 1->3 (increases) - Data: - (1) 0, 1 diff --git a/hl/tools/testfiles/w-ext-two-d.ddl b/hl/tools/testfiles/w-ext-two-d.ddl index b71a9a6..5c7af0a 100644 --- a/hl/tools/testfiles/w-ext-two-d.ddl +++ b/hl/tools/testfiles/w-ext-two-d.ddl @@ -1,18 +1,4 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_TWO... -dimension 0: 4->6 (increases) -dimension 1: 10->12 (increases) -dimension 0: 6->8 (increases) -dimension 1: 12->1 (decreases) -dimension 0: 8->10 (increases) -dimension 1: 1->1 (unchanged) -dimension 0: 10->3 (decreases) -dimension 1: 1->3 (increases) -dimension 0: 3->2 (decreases) -dimension 1: 3->2 (decreases) -dimension 0: 2->1 (decreases) -dimension 1: 2->2 (unchanged) -dimension 0: 1->1 (unchanged) -dimension 1: 2->4 (increases) -dimension 0: 1->1 (unchanged) -dimension 1: 4->3 (decreases) +dimension 0: 4->2 (decreases) +dimension 1: 10->10 (unchanged) diff --git a/hl/tools/testfiles/w-ext-two-width.ddl b/hl/tools/testfiles/w-ext-two-width.ddl index 52903de..9f09fde 100644 --- a/hl/tools/testfiles/w-ext-two-width.ddl +++ b/hl/tools/testfiles/w-ext-two-width.ddl @@ -1,41 +1,9 @@ Opened "TEST.h5" with sec2 driver. Monitoring dataset /DSET_TWO... -dimension 0: 4->6 (increases) +dimension 0: 4->4 (unchanged) dimension 1: 10->12 (increases) Data: - (0,10) 1, 1 - (1,10) 1, 1 - (2,10) 1, 1 - (3,10) 1, 1 - (4,0) 1, 1, 1, 1, 1, - (4,5) 1, 1, 1, 1, 1, - (4,10) 1, 1, - (5,0) 1, 1, 1, 1, 1, - (5,5) 1, 1, 1, 1, 1, - (5,10) 1, 1 -dimension 0: 6->8 (increases) -dimension 1: 12->1 (decreases) - Data: - (6,0) 2, - (7,0) 2 -dimension 0: 8->10 (increases) -dimension 1: 1->1 (unchanged) - Data: - (8,0) 3, - (9,0) 3 -dimension 0: 10->3 (decreases) -dimension 1: 1->3 (increases) - Data: - (0,1) 4, 4 - (1,1) 4, 4 - (2,1) 4, 4 -dimension 0: 3->2 (decreases) -dimension 1: 3->2 (decreases) -dimension 0: 2->1 (decreases) -dimension 1: 2->2 (unchanged) -dimension 0: 1->1 (unchanged) -dimension 1: 2->4 (increases) - Data: - (0,2) 7, 7 -dimension 0: 1->1 (unchanged) -dimension 1: 4->3 (decreases) + (0,10) 0, 0 + (1,10) 0, 0 + (2,10) 0, 0 + (3,10) 0, 0 diff --git a/hl/tools/testfiles/w-ext-two.ddl b/hl/tools/testfiles/w-ext-two.ddl index 31df8d5..28ff075 100644 --- a/hl/tools/testfiles/w-ext-two.ddl +++ b/hl/tools/testfiles/w-ext-two.ddl @@ -3,35 +3,9 @@ Monitoring dataset /DSET_TWO... dimension 0: 4->6 (increases) dimension 1: 10->12 (increases) Data: - (0,10) 1, 1 - (1,10) 1, 1 - (2,10) 1, 1 - (3,10) 1, 1 - (4,0) 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (5,0) 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 -dimension 0: 6->8 (increases) -dimension 1: 12->1 (decreases) - Data: - (6,0) 2, - (7,0) 2 -dimension 0: 8->10 (increases) -dimension 1: 1->1 (unchanged) - Data: - (8,0) 3, - (9,0) 3 -dimension 0: 10->3 (decreases) -dimension 1: 1->3 (increases) - Data: - (0,1) 4, 4 - (1,1) 4, 4 - (2,1) 4, 4 -dimension 0: 3->2 (decreases) -dimension 1: 3->2 (decreases) -dimension 0: 2->1 (decreases) -dimension 1: 2->2 (unchanged) -dimension 0: 1->1 (unchanged) -dimension 1: 2->4 (increases) - Data: - (0,2) 7, 7 -dimension 0: 1->1 (unchanged) -dimension 1: 4->3 (decreases) + (0,10) 2, 2 + (1,10) 2, 2 + (2,10) 2, 2 + (3,10) 2, 2 + (4,0) 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + (5,0) 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 -- cgit v0.12 From ebb7bc7fadb86c48869439ea9137f1dfc1e1f158 Mon Sep 17 00:00:00 2001 From: lrknox Date: Sat, 22 Apr 2017 15:21:36 -0500 Subject: Comment out failing plugin test until fixed (unexpected .libs in plugin test directory path with '@'). --- test/test_plugin.sh.in | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index 1e6d9d9..37d4462 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -91,19 +91,19 @@ fi ENVCMD="env HDF5_PLUGIN_PATH=@/${PLUGIN_LIBDIR1}:@/${PLUGIN_LIBDIR2}" # Run the test -$ENVCMD $TEST_BIN -if [ $? != 0 ]; then - nerrors=`expr $nerrors + 1` -fi +#$ENVCMD $TEST_BIN +#if [ $? != 0 ]; then +# nerrors=`expr $nerrors + 1` +#fi # print results -if test $nerrors -ne 0 ; then - echo "$nerrors errors encountered" - exit_code=$EXIT_FAILURE -else - echo "All Plugin API tests passed." - exit_code=$EXIT_SUCCESS -fi +#if test $nerrors -ne 0 ; then +# echo "$nerrors errors encountered" +# exit_code=$EXIT_FAILURE +#else +# echo "All Plugin API tests passed." +# exit_code=$EXIT_SUCCESS +#fi # Clean up temporary files/directories and leave $RM $PLUGIN_LIBDIR1 $PLUGIN_LIBDIR2 -- cgit v0.12 From 0e1633c26d3d28cc7612ae52277111a6aa4869da Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Apr 2017 09:03:46 -0500 Subject: Windows ahs one more directory level --- test/CMakeTests.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 86c5cb3..6f15fc4 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -986,8 +986,10 @@ endif () ############################################################################## if (WIN32) set (CMAKE_SEP "\;") + set (BIN_REL_PATH "../../") else () set (CMAKE_SEP ":") + set (BIN_REL_PATH "../") endif () add_test (NAME H5PLUGIN-plugin COMMAND $) @@ -998,7 +1000,7 @@ set_tests_properties (H5PLUGIN-plugin PROPERTIES add_test (NAME H5PLUGIN-pluginRelative COMMAND $) set_tests_properties (H5PLUGIN-pluginRelative PROPERTIES - ENVIRONMENT "HDF5_PLUGIN_PATH=@/../testdir1${CMAKE_SEP}@/../testdir2;srcdir=${HDF5_TEST_BINARY_DIR}" + ENVIRONMENT "HDF5_PLUGIN_PATH=@/${BIN_REL_PATH}testdir1${CMAKE_SEP}@/${BIN_REL_PATH}testdir2;srcdir=${HDF5_TEST_BINARY_DIR}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} ) -- cgit v0.12 From 220388e7351becc927114de19f8a34e78e55a7ed Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Apr 2017 10:50:06 -0500 Subject: Fix path to actual executable location --- test/test_plugin.sh.in | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index 37d4462..a0c9a42 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -88,22 +88,23 @@ if [ $? != 0 ]; then fi # setup plugin path relative to test -ENVCMD="env HDF5_PLUGIN_PATH=@/${PLUGIN_LIBDIR1}:@/${PLUGIN_LIBDIR2}" +# actual executable is in the .libs folder +ENVCMD="env HDF5_PLUGIN_PATH=@/../${PLUGIN_LIBDIR1}:@/../${PLUGIN_LIBDIR2}" # Run the test -#$ENVCMD $TEST_BIN -#if [ $? != 0 ]; then -# nerrors=`expr $nerrors + 1` -#fi +$ENVCMD $TEST_BIN +if [ $? != 0 ]; then + nerrors=`expr $nerrors + 1` +fi # print results -#if test $nerrors -ne 0 ; then -# echo "$nerrors errors encountered" -# exit_code=$EXIT_FAILURE -#else -# echo "All Plugin API tests passed." -# exit_code=$EXIT_SUCCESS -#fi +if test $nerrors -ne 0 ; then + echo "$nerrors errors encountered" + exit_code=$EXIT_FAILURE +else + echo "All Plugin API tests passed." + exit_code=$EXIT_SUCCESS +fi # Clean up temporary files/directories and leave $RM $PLUGIN_LIBDIR1 $PLUGIN_LIBDIR2 -- cgit v0.12 From 6fac0de1582f9b8f9a85893cd269a86203b7fc41 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Apr 2017 15:10:58 -0500 Subject: Revert HDFFV-9655 by disabling test and not using new function. --- src/H5PL.c | 16 +++++++++------- src/H5PLpublic.h | 12 ++++++------ test/test_plugin.sh.in | 15 +++++++++------ 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 2789a5e..ba10e5a 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -720,17 +720,19 @@ done: * * Purpose: Query the size of the current list of plugin paths. * - * Return: Plugin path size (can't indicate failure due to unsigned type) + * Return: Plugin path size * *------------------------------------------------------------------------- */ -unsigned int -H5PLsize(void) +herr_t +H5PLsize(unsigned int *listsize) { - unsigned int ret_value = (unsigned int)H5PL_num_paths_g; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE1("e", "*Iu", listsize); - FUNC_ENTER_API(0) - H5TRACE0("Iu",""); + *listsize = (unsigned int)H5PL_num_paths_g; done: FUNC_LEAVE_API(ret_value) @@ -778,7 +780,7 @@ H5PL__init_path_table(void) /* Check for too many directories in path */ if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") - if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = H5PL__env_strdup(dir))) + if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = H5MM_strdup(dir))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") H5PL_num_paths_g++; dir = HDstrtok(NULL, H5PL_PATH_SEPARATOR); diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 5e4dcae..12cdc87 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -43,14 +43,14 @@ extern "C" { /* plugin state */ H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_type); -H5_DLL herr_t H5PLget_loading_state(unsigned int* plugin_type/*out*/); -H5_DLL herr_t H5PLappend(const char* plugin_path); -H5_DLL herr_t H5PLprepend(const char* plugin_path); -H5_DLL herr_t H5PLreplace(const char* plugin_path, unsigned int index); -H5_DLL herr_t H5PLinsert(const char* plugin_path, unsigned int index); +H5_DLL herr_t H5PLget_loading_state(unsigned int *plugin_type/*out*/); +H5_DLL herr_t H5PLappend(const char *plugin_path); +H5_DLL herr_t H5PLprepend(const char *plugin_path); +H5_DLL herr_t H5PLreplace(const char *plugin_path, unsigned int index); +H5_DLL herr_t H5PLinsert(const char *plugin_path, unsigned int index); H5_DLL herr_t H5PLremove(unsigned int index); H5_DLL ssize_t H5PLget(unsigned int index, char *pathname/*out*/, size_t size); -H5_DLL unsigned int H5PLsize(void); +H5_DLL herr_t H5PLsize(unsigned int *listsize/*out*/); #ifdef __cplusplus } diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index a0c9a42..4cddbb0 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -87,15 +87,18 @@ if [ $? != 0 ]; then nerrors=`expr $nerrors + 1` fi +############################################ +# HDFFV-9655 test for relative path disabled # setup plugin path relative to test # actual executable is in the .libs folder -ENVCMD="env HDF5_PLUGIN_PATH=@/../${PLUGIN_LIBDIR1}:@/../${PLUGIN_LIBDIR2}" - +#ENVCMD="env HDF5_PLUGIN_PATH=@/../${PLUGIN_LIBDIR1}:@/../${PLUGIN_LIBDIR2}" +# # Run the test -$ENVCMD $TEST_BIN -if [ $? != 0 ]; then - nerrors=`expr $nerrors + 1` -fi +#$ENVCMD $TEST_BIN +#if [ $? != 0 ]; then +# nerrors=`expr $nerrors + 1` +#fi +############################################# # print results if test $nerrors -ne 0 ; then -- cgit v0.12 From aafee79e9f34137b3db11e9e76aeb604446c31b7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Apr 2017 15:20:21 -0500 Subject: Changed signature of H5PLgetsize --- java/src/jni/h5plImp.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c index 09a1032..322d5d1 100644 --- a/java/src/jni/h5plImp.c +++ b/java/src/jni/h5plImp.c @@ -213,13 +213,11 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5PLsize (JNIEnv *env, jclass clss) { - int retVal = -1; - - retVal = H5PLsize(); - if (retVal < 0) + unsigned int listsize = 0; + if (H5PLget_loading_state(&listsize) < 0) { h5libraryError(env); - - return (jint)retVal; + } + return (jint)listsize; } /* end Java_hdf_hdf5lib_H5_H5PLsize */ #ifdef __cplusplus -- cgit v0.12 From c2a9c334447da04a1d8424d25e54f9bb1381fe48 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Apr 2017 15:25:36 -0500 Subject: Revert HDFFV-9655 --- test/CMakeTests.cmake | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 6f15fc4..6eee237 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -998,11 +998,15 @@ set_tests_properties (H5PLUGIN-plugin PROPERTIES WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} ) -add_test (NAME H5PLUGIN-pluginRelative COMMAND $) -set_tests_properties (H5PLUGIN-pluginRelative PROPERTIES - ENVIRONMENT "HDF5_PLUGIN_PATH=@/${BIN_REL_PATH}testdir1${CMAKE_SEP}@/${BIN_REL_PATH}testdir2;srcdir=${HDF5_TEST_BINARY_DIR}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} -) +############################################################################## +# HDFFV-9655 relative plugin test disabled +# +#add_test (NAME H5PLUGIN-pluginRelative COMMAND $) +#set_tests_properties (H5PLUGIN-pluginRelative PROPERTIES +# ENVIRONMENT "HDF5_PLUGIN_PATH=@/${BIN_REL_PATH}testdir1${CMAKE_SEP}@/${BIN_REL_PATH}testdir2;srcdir=${HDF5_TEST_BINARY_DIR}" +# WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} +#) +############################################################################## ############################################################################## ### S W M R T E S T S -- cgit v0.12 From c1dc24c143077dcbc95dfc881de09d669133ddd6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Apr 2017 15:31:28 -0500 Subject: Change H5PLsize() signature --- test/plugin.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/test/plugin.c b/test/plugin.c index 2939595..13e87bd 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -733,7 +733,7 @@ test_filter_path_apis(void) if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) TEST_ERROR - ndx = H5PLsize(); + H5PLsize(ndx); TESTING(" remove"); /* Remove all existing paths*/ @@ -743,7 +743,8 @@ test_filter_path_apis(void) TEST_ERROR } /* end if */ /* Verify the table is empty */ - if(H5PLsize() > 0) TEST_ERROR + H5PLsize(ndx); + if(ndx > 0) TEST_ERROR PASSED(); TESTING(" remove (exceed min)"); @@ -764,7 +765,8 @@ test_filter_path_apis(void) } } /* Verify the table is full */ - if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + H5PLsize(ndx); + if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR PASSED(); TESTING(" append (exceed)"); @@ -835,7 +837,8 @@ test_filter_path_apis(void) PASSED(); /* Verify the table is not full */ - if (H5PLsize() != H5PL_MAX_PATH_NUM - 1) TEST_ERROR + H5PLsize(ndx); + if (ndx != H5PL_MAX_PATH_NUM - 1) TEST_ERROR TESTING(" prepend"); /* Prepend one path*/ @@ -846,7 +849,8 @@ test_filter_path_apis(void) } /* Verify the table is full */ - if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + H5PLsize(ndx); + if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were moved */ if(H5PLget(8, pathname, 256) <= 0) TEST_ERROR @@ -880,7 +884,8 @@ test_filter_path_apis(void) } /* Verify the table is full */ - if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + H5PLsize(ndx); + if(ndx) != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were not moved */ if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR @@ -909,7 +914,8 @@ test_filter_path_apis(void) PASSED(); /* Verify the table is not full */ - if(H5PLsize() != 15) TEST_ERROR + H5PLsize(ndx); + if(ndx != 15) TEST_ERROR TESTING(" insert"); /* Insert one path*/ @@ -928,7 +934,8 @@ test_filter_path_apis(void) PASSED(); /* Verify the table is full */ - if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + H5PLsize(ndx); + if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR TESTING(" insert (exceed)"); /* Exceed the max path insert */ -- cgit v0.12 From c08ef4dc5b0050e173b673a8c2ef4efb8244ea11 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Apr 2017 15:34:25 -0500 Subject: Signature change requires a ptr --- test/plugin.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/plugin.c b/test/plugin.c index 13e87bd..cc0c6b8 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -733,7 +733,7 @@ test_filter_path_apis(void) if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) TEST_ERROR - H5PLsize(ndx); + H5PLsize(&ndx); TESTING(" remove"); /* Remove all existing paths*/ @@ -743,7 +743,7 @@ test_filter_path_apis(void) TEST_ERROR } /* end if */ /* Verify the table is empty */ - H5PLsize(ndx); + H5PLsize(&ndx); if(ndx > 0) TEST_ERROR PASSED(); @@ -765,7 +765,7 @@ test_filter_path_apis(void) } } /* Verify the table is full */ - H5PLsize(ndx); + H5PLsize(&ndx); if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR PASSED(); @@ -837,7 +837,7 @@ test_filter_path_apis(void) PASSED(); /* Verify the table is not full */ - H5PLsize(ndx); + H5PLsize(&ndx); if (ndx != H5PL_MAX_PATH_NUM - 1) TEST_ERROR TESTING(" prepend"); @@ -849,7 +849,7 @@ test_filter_path_apis(void) } /* Verify the table is full */ - H5PLsize(ndx); + H5PLsize(&ndx); if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were moved */ @@ -884,7 +884,7 @@ test_filter_path_apis(void) } /* Verify the table is full */ - H5PLsize(ndx); + H5PLsize(&ndx); if(ndx) != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were not moved */ @@ -914,7 +914,7 @@ test_filter_path_apis(void) PASSED(); /* Verify the table is not full */ - H5PLsize(ndx); + H5PLsize(&ndx); if(ndx != 15) TEST_ERROR TESTING(" insert"); @@ -934,7 +934,7 @@ test_filter_path_apis(void) PASSED(); /* Verify the table is full */ - H5PLsize(ndx); + H5PLsize(&ndx); if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR TESTING(" insert (exceed)"); -- cgit v0.12 From bce204f7f3337424d99df0d6c18f701fc9727cb4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Apr 2017 15:36:10 -0500 Subject: Fix typo --- test/plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plugin.c b/test/plugin.c index cc0c6b8..862f99d 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -885,7 +885,7 @@ test_filter_path_apis(void) /* Verify the table is full */ H5PLsize(&ndx); - if(ndx) != H5PL_MAX_PATH_NUM) TEST_ERROR + if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were not moved */ if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR -- cgit v0.12 From c148ad90f0604e67065a1a82a0ade72984672173 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Apr 2017 16:09:39 -0500 Subject: Fix javadoc --- java/src/hdf/hdf5lib/H5.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 23e2a34..5e13fdf 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -2895,7 +2895,8 @@ public class H5 implements java.io.Serializable { * @param file_id * IN: Identifier of the target file. * - * @param mdc_logging_status, the status + * @param mdc_logging_status + * the status * mdc_logging_status[0] = is_enabled, whether logging is enabled * mdc_logging_status[1] = is_currently_logging, whether events are currently being logged * @@ -5813,7 +5814,8 @@ public class H5 implements java.io.Serializable { * * @param fapl_id * IN: File access property list identifier - * @param mdc_log_options, the options + * @param mdc_log_options + * the options * mdc_logging_options[0] = is_enabled, whether logging is enabled * mdc_logging_options[1] = start_on_access, whether the logging begins as soon as the file is opened or created * -- cgit v0.12 From 0fb5ce7ad50664f800ffe7e107e0fb0f90f66e12 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Apr 2017 16:21:42 -0500 Subject: Correct name of native function --- java/src/jni/h5plImp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c index 322d5d1..9b6100e 100644 --- a/java/src/jni/h5plImp.c +++ b/java/src/jni/h5plImp.c @@ -214,7 +214,7 @@ Java_hdf_hdf5lib_H5_H5PLsize (JNIEnv *env, jclass clss) { unsigned int listsize = 0; - if (H5PLget_loading_state(&listsize) < 0) { + if (H5PLsize(&listsize) < 0) { h5libraryError(env); } return (jint)listsize; -- cgit v0.12 From b1a5ba405393da68028cf1c8b159a3abb51d2187 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 25 Apr 2017 02:09:55 -0400 Subject: Updated bin/trace to emit errors and reordered autogen.sh processing so that script failures leave the library in a non-compilable state, making it harder to ignore errors. --- autogen.sh | 63 +++++++++++++++++++++++++++++++++----------------------------- bin/trace | 15 ++++++++++++++- 2 files changed, 48 insertions(+), 30 deletions(-) diff --git a/autogen.sh b/autogen.sh index f3bd774..33779d4 100755 --- a/autogen.sh +++ b/autogen.sh @@ -205,6 +205,39 @@ Darwin*) ;; esac +# Run scripts that process source. +# +# These should be run before the autotools so that failures here block +# compilation. + +# Run trace script +# The trace script adds H5TRACE macros to library source files. It should +# have no effect on files that don't have HDF5 API macros in them. +echo "Running trace script:" +bin/trace src/H5*.c || exit 1 +echo + +# Run make_err +# make_err automatically generates the H5E headers that create error message +# types for HDF5. +echo "Running error generation script:" +bin/make_err src/H5err.txt || exit 1 +echo + +# Run make_vers +# make_vers automatically generates the public headers that define the API version +# macros for HDF5. +echo "Running API version generation script:" +bin/make_vers src/H5vers.txt || exit 1 +echo + +# Run make_overflow +# make_overflow automatically generates macros for detecting overflows for type +# conversion. +echo "Running overflow macro generation script:" +bin/make_overflow src/H5overflow.txt || exit 1 +echo + # Run autotools in order # # When available, we use the --force option to ensure all files are @@ -267,35 +300,7 @@ fi ${autoconf_cmd} || exit 1 echo -# Run scripts that process source. - -# Run trace script -# The trace script adds H5TRACE macros to library source files. It should -# have no effect on files that don't have HDF5 API macros in them. -echo -echo "Running trace script:" -bin/trace src/H5*.c || exit 1 - -# Run make_err -# make_err automatically generates the H5E headers that create error message -# types for HDF5. -echo -echo "Running error generation script:" -bin/make_err src/H5err.txt || exit 1 - -# Run make_vers -# make_vers automatically generates the public headers that define the API version -# macros for HDF5. -echo -echo "Running API version generation script:" -bin/make_vers src/H5vers.txt || exit 1 - -# Run make_overflow -# make_overflow automatically generates macros for detecting overflows for type -# conversion. -echo -echo "Running overflow macro generation script:" -bin/make_overflow src/H5overflow.txt || exit 1 +echo "*** SUCCESS ***" echo exit 0 diff --git a/bin/trace b/bin/trace index 19c8990..ede344c 100755 --- a/bin/trace +++ b/bin/trace @@ -163,6 +163,8 @@ $Source = ""; ############################################################################## # Print an error message. # +my $found_errors = 0; + sub errmesg ($$@) { my ($file, $func, @mesg) = @_; my ($mesg) = join "", @mesg; @@ -172,6 +174,8 @@ sub errmesg ($$@) { $lineno = tr/\n/\n/; } + $found_errors = 1; + print "$file: in function \`$func\':\n"; print "$file:$lineno: $mesg\n"; } @@ -341,4 +345,13 @@ for $file (@ARGV) { } } -printf "Finished processing HDF5 API calls\n" +if ($found_errors eq 1) { + printf "\n"; + printf "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; + printf "*** ERRORS FOUND *** ERRORS FOUND *** ERRORS FOUND ****\n"; + printf "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; + exit 1; +} else { + printf "Finished processing HDF5 API calls\n"; +} + -- cgit v0.12 From 1073ac45efd85f858b11328b0d4f6e7413c5d4d8 Mon Sep 17 00:00:00 2001 From: lrknox Date: Sat, 15 Apr 2017 12:50:10 -0500 Subject: Commit copyright header change for src/H5PLpkg.c which was added after running script to make changes. --- src/H5PLpkg.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index 5cf3096..e356893 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #if !(defined H5PL_FRIEND || defined H5PL_MODULE) -- cgit v0.12 From 89fbe00dec8187305b518d91c3ddb7d910665f79 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Mon, 17 Apr 2017 14:32:16 -0500 Subject: Merge pull request #426 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:hdf5_1_10 to hdf5_1_10 * commit '54957d37f5aa73912763dbb6e308555e863c43f4': Commit copyright header change for src/H5PLpkg.c which was added after running script to make changes. Add new files in release_docs to MANIFEST. Cimmit changes to Makefile.in(s) and H5PL.c that resulted from running autogen.sh. Merge pull request #407 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:hdf5_1_10_1 to hdf5_1_10_1 Change copyright headers to replace url referring to file to be removed and replace it with new url for COPYING file. --- .autom4te.cfg | 10 +- .h5chkright.ini | 10 +- CMakeFilters.cmake | 11 + CMakeInstallation.cmake | 11 + CTestConfig.cmake | 11 + MANIFEST | 14 +- Makefile.am | 10 +- Makefile.dist | 10 +- UserMacros.cmake | 11 + acsite.m4 | 11 +- autogen.sh | 10 +- bin/COPYING | 11 +- bin/bbrelease | 10 +- bin/buildhdf5 | 10 +- bin/checkapi | 10 +- bin/checkposix | 10 +- bin/chkconfigure | 12 +- bin/chkcopyright | 10 +- bin/chkmanifest | 10 +- bin/debug-ohdr | 10 +- bin/dependencies | 10 +- bin/deploy | 10 +- bin/distdep | 10 +- bin/errors | 10 +- bin/gcov_script | 10 +- bin/genparser | 10 +- bin/h5vers | 10 +- bin/iostats | 10 +- bin/locate_sw | 10 +- bin/make_err | 20 +- bin/make_overflow | 20 +- bin/make_vers | 20 +- bin/mkdirs | 10 +- bin/newer | 10 +- bin/output_filter.sh | 10 +- bin/pkgscrpts/h5rmflags | 10 +- bin/pkgscrpts/makeHDF5BinaryTarfiles.pl | 10 +- bin/release | 10 +- bin/restore.sh | 10 +- bin/runtest | 10 +- bin/snapshot | 10 +- bin/snapshot_version | 10 +- bin/switch_maint_mode | 10 +- bin/timekeeper | 10 +- bin/trace | 10 +- bin/yodconfigure | 11 +- c++/COPYING | 11 +- c++/Makefile.am | 10 +- c++/examples/CMakeTests.cmake | 11 + c++/examples/Makefile.am | 10 +- c++/examples/chunks.cpp | 10 +- c++/examples/compound.cpp | 10 +- c++/examples/create.cpp | 10 +- c++/examples/extend_ds.cpp | 10 +- c++/examples/h5group.cpp | 10 +- c++/examples/h5tutr_cmprss.cpp | 10 +- c++/examples/h5tutr_crtatt.cpp | 10 +- c++/examples/h5tutr_crtdat.cpp | 10 +- c++/examples/h5tutr_crtgrp.cpp | 10 +- c++/examples/h5tutr_crtgrpar.cpp | 10 +- c++/examples/h5tutr_crtgrpd.cpp | 10 +- c++/examples/h5tutr_extend.cpp | 10 +- c++/examples/h5tutr_rdwt.cpp | 10 +- c++/examples/h5tutr_subset.cpp | 10 +- c++/examples/readdata.cpp | 10 +- c++/examples/run-c++-ex.sh.in | 10 +- c++/examples/testh5c++.sh.in | 10 +- c++/examples/writedata.cpp | 10 +- c++/src/H5AbstractDs.cpp | 10 +- c++/src/H5AbstractDs.h | 10 +- c++/src/H5Alltypes.h | 10 +- c++/src/H5ArrayType.cpp | 10 +- c++/src/H5ArrayType.h | 10 +- c++/src/H5AtomType.cpp | 10 +- c++/src/H5AtomType.h | 10 +- c++/src/H5Attribute.cpp | 10 +- c++/src/H5Attribute.h | 10 +- c++/src/H5Classes.h | 10 +- c++/src/H5CommonFG.cpp | 10 +- c++/src/H5CommonFG.h | 10 +- c++/src/H5CompType.cpp | 10 +- c++/src/H5CompType.h | 10 +- c++/src/H5Cpp.h | 10 +- c++/src/H5CppDoc.h | 10 +- c++/src/H5DataSet.cpp | 10 +- c++/src/H5DataSet.h | 10 +- c++/src/H5DataSpace.cpp | 10 +- c++/src/H5DataSpace.h | 10 +- c++/src/H5DataType.cpp | 10 +- c++/src/H5DataType.h | 10 +- c++/src/H5DcreatProp.cpp | 10 +- c++/src/H5DcreatProp.h | 10 +- c++/src/H5DxferProp.cpp | 10 +- c++/src/H5DxferProp.h | 10 +- c++/src/H5EnumType.cpp | 10 +- c++/src/H5EnumType.h | 10 +- c++/src/H5Exception.cpp | 10 +- c++/src/H5Exception.h | 10 +- c++/src/H5FaccProp.cpp | 10 +- c++/src/H5FaccProp.h | 10 +- c++/src/H5FcreatProp.cpp | 10 +- c++/src/H5FcreatProp.h | 10 +- c++/src/H5File.cpp | 10 +- c++/src/H5File.h | 10 +- c++/src/H5FloatType.cpp | 10 +- c++/src/H5FloatType.h | 10 +- c++/src/H5Group.cpp | 10 +- c++/src/H5Group.h | 10 +- c++/src/H5IdComponent.cpp | 10 +- c++/src/H5IdComponent.h | 10 +- c++/src/H5Include.h | 10 +- c++/src/H5IntType.cpp | 10 +- c++/src/H5IntType.h | 10 +- c++/src/H5LaccProp.cpp | 10 +- c++/src/H5LaccProp.h | 10 +- c++/src/H5Library.cpp | 10 +- c++/src/H5Library.h | 10 +- c++/src/H5Location.cpp | 10 +- c++/src/H5Location.h | 10 +- c++/src/H5Object.cpp | 10 +- c++/src/H5Object.h | 10 +- c++/src/H5OcreatProp.cpp | 10 +- c++/src/H5OcreatProp.h | 10 +- c++/src/H5PredType.cpp | 10 +- c++/src/H5PredType.h | 10 +- c++/src/H5PropList.cpp | 10 +- c++/src/H5PropList.h | 10 +- c++/src/H5StrType.cpp | 10 +- c++/src/H5StrType.h | 10 +- c++/src/H5VarLenType.cpp | 10 +- c++/src/H5VarLenType.h | 10 +- c++/src/Makefile.am | 10 +- c++/src/h5c++.in | 10 +- c++/src/header.html | 10 +- c++/test/CMakeTests.cmake | 11 + c++/test/H5srcdir_str.h.in | 10 +- c++/test/Makefile.am | 10 +- c++/test/dsets.cpp | 10 +- c++/test/h5cpputil.cpp | 10 +- c++/test/h5cpputil.h | 10 +- c++/test/tarray.cpp | 10 +- c++/test/tattr.cpp | 10 +- c++/test/tcompound.cpp | 10 +- c++/test/tdspl.cpp | 10 +- c++/test/testhdf5.cpp | 10 +- c++/test/tfile.cpp | 10 +- c++/test/tfilter.cpp | 10 +- c++/test/th5s.cpp | 10 +- c++/test/titerate.cpp | 10 +- c++/test/tlinks.cpp | 10 +- c++/test/tobject.cpp | 10 +- c++/test/trefer.cpp | 10 +- c++/test/ttypes.cpp | 10 +- c++/test/tvlstr.cpp | 10 +- config/BlankForm | 10 +- config/COPYING | 11 +- config/Makefile.am.blank | 10 +- config/apple | 10 +- config/cce-fflags | 10 +- config/cce-flags | 10 +- config/cmake/CTestCustom.cmake | 11 + config/cmake/CTestScript.cmake | 11 + config/cmake/ConfigureChecks.cmake | 11 + config/cmake/ConversionTests.c | 11 + config/cmake/FindHDFJAVA.cmake.in | 11 + config/cmake/H5cxx_config.h.in | 11 + config/cmake/H5pubconf.h.in | 11 + config/cmake/HDF518_Examples.cmake.in | 11 + config/cmake/HDF5Macros.cmake | 11 + config/cmake/HDF5UseFortran.cmake | 11 + config/cmake/HDF5_Examples.cmake.in | 11 + config/cmake/HDF5_Examples_options.cmake | 11 + config/cmake/HDF5_Process_Flex_Files.cmake | 11 + config/cmake/HDFCompilerFlags.cmake | 11 + config/cmake/UserMacros/Windows_MT.cmake | 11 + config/cmake/cacheinit.cmake | 11 + config/cmake/hdf5-config-version.cmake.in | 11 + config/cmake/hdf5-config.cmake.in | 11 + config/cmake/jrunTest.cmake | 11 + config/cmake/mccacheinit.cmake | 11 + config/cmake/scripts/CTestScript.cmake | 11 + config/cmake/scripts/HDF5config.cmake | 11 + config/cmake/scripts/HDF5options.cmake | 11 + config/cmake/userblockTest.cmake | 11 + config/cmake/vfdTest.cmake | 11 + config/cmake_ext_mod/CheckTypeSize.cmake | 11 + config/cmake_ext_mod/ConfigureChecks.cmake | 11 + config/cmake_ext_mod/FindSZIP.cmake | 11 + config/cmake_ext_mod/GetTimeOfDayTest.cpp | 11 + config/cmake_ext_mod/HDFCXXTests.cpp | 11 + config/cmake_ext_mod/HDFLibMacros.cmake | 11 + config/cmake_ext_mod/HDFMacros.cmake | 11 + config/cmake_ext_mod/HDFTests.c | 11 + config/cmake_ext_mod/HDFUseFortran.cmake | 11 + config/cmake_ext_mod/grepTest.cmake | 11 + config/cmake_ext_mod/runTest.cmake | 11 + config/commence.am | 10 +- config/conclude.am | 10 +- config/conclude_fc.am | 10 +- config/cygwin | 10 +- config/examples.am | 10 +- config/freebsd | 10 +- config/gnu-cxxflags | 10 +- config/gnu-fflags | 10 +- config/gnu-flags | 10 +- config/ibm-aix | 10 +- config/ibm-flags | 10 +- config/intel-fflags | 10 +- config/intel-flags | 10 +- config/linux-gnu | 10 +- config/linux-gnuaout | 10 +- config/linux-gnulibc1 | 10 +- config/linux-gnulibc2 | 10 +- config/lt_vers.am | 26 +- config/pgi-fflags | 10 +- config/pgi-flags | 10 +- config/site-specific/BlankForm | 10 +- config/solaris | 10 +- configure.ac | 10 +- examples/CMakeTests.cmake | 11 + examples/Makefile.am | 10 +- examples/h5_attribute.c | 10 +- examples/h5_chunk_read.c | 10 +- examples/h5_cmprss.c | 10 +- examples/h5_compound.c | 10 +- examples/h5_crtatt.c | 10 +- examples/h5_crtdat.c | 10 +- examples/h5_crtgrp.c | 10 +- examples/h5_crtgrpar.c | 10 +- examples/h5_crtgrpd.c | 10 +- examples/h5_drivers.c | 10 +- examples/h5_dtransform.c | 10 +- examples/h5_elink_unix2win.c | 10 +- examples/h5_extend.c | 10 +- examples/h5_extend_write.c | 10 +- examples/h5_extlink.c | 10 +- examples/h5_group.c | 10 +- examples/h5_interm_group.c | 10 +- examples/h5_mount.c | 10 +- examples/h5_rdwt.c | 10 +- examples/h5_read.c | 10 +- examples/h5_ref2reg.c | 10 +- examples/h5_reference.c | 10 +- examples/h5_select.c | 10 +- examples/h5_shared_mesg.c | 10 +- examples/h5_subset.c | 10 +- examples/h5_vds-eiger.c | 11 + examples/h5_vds-exc.c | 11 + examples/h5_vds-exclim.c | 11 + examples/h5_vds-percival-unlim-maxmin.c | 11 + examples/h5_vds-percival-unlim.c | 11 + examples/h5_vds-percival.c | 11 + examples/h5_vds-simpleIO.c | 11 + examples/h5_vds.c | 10 +- examples/h5_write.c | 10 +- examples/ph5example.c | 10 +- examples/run-all-ex.sh | 10 +- examples/run-c-ex.sh.in | 10 +- examples/testh5cc.sh.in | 10 +- fortran/COPYING | 11 +- fortran/Makefile.am | 10 +- fortran/examples/CMakeTests.cmake | 11 + fortran/examples/Makefile.am | 10 +- fortran/examples/compound.f90 | 10 +- fortran/examples/compound_complex_fortran2003.f90 | 10 +- fortran/examples/compound_fortran2003.f90 | 10 +- fortran/examples/h5_cmprss.f90 | 10 +- fortran/examples/h5_crtatt.f90 | 10 +- fortran/examples/h5_crtdat.f90 | 10 +- fortran/examples/h5_crtgrp.f90 | 10 +- fortran/examples/h5_crtgrpar.f90 | 10 +- fortran/examples/h5_crtgrpd.f90 | 10 +- fortran/examples/h5_extend.f90 | 10 +- fortran/examples/h5_rdwt.f90 | 10 +- fortran/examples/h5_subset.f90 | 10 +- fortran/examples/hyperslab.f90 | 10 +- fortran/examples/mountexample.f90 | 10 +- fortran/examples/nested_derived_type.f90 | 10 +- fortran/examples/ph5example.f90 | 10 +- fortran/examples/refobjexample.f90 | 10 +- fortran/examples/refregexample.f90 | 10 +- fortran/examples/run-fortran-ex.sh.in | 10 +- fortran/examples/rwdset_fortran2003.f90 | 10 +- fortran/examples/selectele.f90 | 10 +- fortran/examples/testh5fc.sh.in | 10 +- fortran/src/H5Af.c | 10 +- fortran/src/H5Aff.F90 | 10 +- fortran/src/H5Df.c | 10 +- fortran/src/H5Dff.F90 | 10 +- fortran/src/H5Ef.c | 10 +- fortran/src/H5Eff.F90 | 10 +- fortran/src/H5Ff.c | 10 +- fortran/src/H5Fff.F90 | 10 +- fortran/src/H5Gf.c | 10 +- fortran/src/H5Gff.F90 | 10 +- fortran/src/H5If.c | 10 +- fortran/src/H5Iff.F90 | 10 +- fortran/src/H5Lf.c | 10 +- fortran/src/H5Lff.F90 | 10 +- fortran/src/H5Of.c | 10 +- fortran/src/H5Off.F90 | 10 +- fortran/src/H5Pf.c | 10 +- fortran/src/H5Pff.F90 | 10 +- fortran/src/H5Rf.c | 10 +- fortran/src/H5Rff.F90 | 10 +- fortran/src/H5Sf.c | 10 +- fortran/src/H5Sff.F90 | 10 +- fortran/src/H5Tf.c | 10 +- fortran/src/H5Tff.F90 | 10 +- fortran/src/H5Zf.c | 10 +- fortran/src/H5Zff.F90 | 10 +- fortran/src/H5_buildiface.F90 | 20 +- fortran/src/H5_f.c | 10 +- fortran/src/H5_ff.F90 | 10 +- fortran/src/H5config_f.inc.cmake | 11 + fortran/src/H5config_f.inc.in | 11 + fortran/src/H5f90.h | 10 +- fortran/src/H5f90global.F90 | 10 +- fortran/src/H5f90i.h | 10 +- fortran/src/H5f90kit.c | 10 +- fortran/src/H5f90proto.h | 10 +- fortran/src/H5fort_type_defines.h.in | 11 + fortran/src/H5fortkit.F90 | 10 +- fortran/src/H5match_types.c | 30 +- fortran/src/HDF5.F90 | 10 +- fortran/src/Makefile.am | 10 +- fortran/src/h5fc.in | 10 +- fortran/test/CMakeTests.cmake | 11 + fortran/test/H5_test_buildiface.F90 | 20 +- fortran/test/Makefile.am | 10 +- fortran/test/fflush1.F90 | 10 +- fortran/test/fflush2.F90 | 10 +- fortran/test/fortranlib_test.F90 | 10 +- fortran/test/fortranlib_test_1_8.F90 | 10 +- fortran/test/fortranlib_test_F03.F90 | 10 +- fortran/test/t.c | 10 +- fortran/test/t.h | 10 +- fortran/test/tH5A.F90 | 10 +- fortran/test/tH5A_1_8.F90 | 10 +- fortran/test/tH5D.F90 | 10 +- fortran/test/tH5E.F90 | 10 +- fortran/test/tH5E_F03.F90 | 10 +- fortran/test/tH5F.F90 | 10 +- fortran/test/tH5F_F03.F90 | 10 +- fortran/test/tH5G.F90 | 10 +- fortran/test/tH5G_1_8.F90 | 10 +- fortran/test/tH5I.F90 | 10 +- fortran/test/tH5L_F03.F90 | 10 +- fortran/test/tH5MISC_1_8.F90 | 10 +- fortran/test/tH5O.F90 | 10 +- fortran/test/tH5O_F03.F90 | 10 +- fortran/test/tH5P.F90 | 10 +- fortran/test/tH5P_F03.F90 | 10 +- fortran/test/tH5R.F90 | 10 +- fortran/test/tH5S.F90 | 10 +- fortran/test/tH5Sselect.F90 | 10 +- fortran/test/tH5T.F90 | 10 +- fortran/test/tH5T_F03.F90 | 10 +- fortran/test/tH5VL.F90 | 10 +- fortran/test/tH5Z.F90 | 10 +- fortran/test/tHDF5.F90 | 10 +- fortran/test/tHDF5_1_8.F90 | 10 +- fortran/test/tHDF5_F03.F90 | 10 +- fortran/test/tf.F90 | 10 +- fortran/testpar/CMakeTests.cmake | 11 + fortran/testpar/Makefile.am | 10 +- fortran/testpar/hyper.f90 | 10 +- fortran/testpar/mdset.f90 | 10 +- fortran/testpar/ptest.f90 | 10 +- hl/COPYING | 11 +- hl/Makefile.am | 10 +- hl/c++/COPYING | 11 +- hl/c++/Makefile.am | 10 +- hl/c++/examples/CMakeTests.cmake | 11 + hl/c++/examples/Makefile.am | 10 +- hl/c++/examples/ptExampleFL.cpp | 10 +- hl/c++/examples/run-hlc++-ex.sh.in | 10 +- hl/c++/src/H5PacketTable.cpp | 10 +- hl/c++/src/H5PacketTable.h | 10 +- hl/c++/src/Makefile.am | 10 +- hl/c++/test/CMakeTests.cmake | 11 + hl/c++/test/Makefile.am | 10 +- hl/c++/test/ptableTest.cpp | 10 +- hl/c++/test/ptableTest.h | 10 +- hl/examples/CMakeTests.cmake | 11 + hl/examples/Makefile.am | 10 +- hl/examples/ex_ds1.c | 10 +- hl/examples/ex_image1.c | 10 +- hl/examples/ex_image2.c | 10 +- hl/examples/ex_lite1.c | 10 +- hl/examples/ex_lite2.c | 10 +- hl/examples/ex_lite3.c | 10 +- hl/examples/ex_table_01.c | 10 +- hl/examples/ex_table_02.c | 10 +- hl/examples/ex_table_03.c | 10 +- hl/examples/ex_table_04.c | 10 +- hl/examples/ex_table_05.c | 10 +- hl/examples/ex_table_06.c | 10 +- hl/examples/ex_table_07.c | 10 +- hl/examples/ex_table_08.c | 10 +- hl/examples/ex_table_09.c | 10 +- hl/examples/ex_table_10.c | 10 +- hl/examples/ex_table_11.c | 10 +- hl/examples/ex_table_12.c | 10 +- hl/examples/pal_rgb.h | 10 +- hl/examples/ptExampleFL.c | 10 +- hl/examples/run-hl-ex.sh | 10 +- hl/examples/run-hlc-ex.sh.in | 10 +- hl/fortran/COPYING | 11 +- hl/fortran/Makefile.am | 10 +- hl/fortran/examples/CMakeTests.cmake | 11 + hl/fortran/examples/Makefile.am | 10 +- hl/fortran/examples/ex_ds1.f90 | 10 +- hl/fortran/examples/exlite.f90 | 10 +- hl/fortran/examples/run-hlfortran-ex.sh.in | 10 +- hl/fortran/src/H5DSfc.c | 10 +- hl/fortran/src/H5DSff.F90 | 10 +- hl/fortran/src/H5HL_buildiface.F90 | 30 +- hl/fortran/src/H5IMcc.c | 13 +- hl/fortran/src/H5IMcc.h | 10 +- hl/fortran/src/H5IMfc.c | 10 +- hl/fortran/src/H5IMff.F90 | 10 +- hl/fortran/src/H5LTf90proto.h | 10 +- hl/fortran/src/H5LTfc.c | 10 +- hl/fortran/src/H5LTff.F90 | 10 +- hl/fortran/src/H5TBfc.c | 10 +- hl/fortran/src/H5TBff.F90 | 10 +- hl/fortran/src/Makefile.am | 10 +- hl/fortran/test/CMakeTests.cmake | 11 + hl/fortran/test/Makefile.am | 10 +- hl/fortran/test/tstds.F90 | 10 +- hl/fortran/test/tstimage.F90 | 10 +- hl/fortran/test/tstlite.F90 | 10 +- hl/fortran/test/tsttable.F90 | 10 +- hl/src/COPYING | 11 +- hl/src/H5DO.c | 10 +- hl/src/H5DOpublic.h | 10 +- hl/src/H5DS.c | 10 +- hl/src/H5DSprivate.h | 10 +- hl/src/H5DSpublic.h | 10 +- hl/src/H5HLprivate2.h | 10 +- hl/src/H5IM.c | 21 +- hl/src/H5IMprivate.h | 10 +- hl/src/H5IMpublic.h | 10 +- hl/src/H5LD.c | 10 +- hl/src/H5LDprivate.h | 10 +- hl/src/H5LDpublic.h | 10 +- hl/src/H5LT.c | 10 +- hl/src/H5LTanalyze.c | 10 +- hl/src/H5LTanalyze.l | 10 +- hl/src/H5LTparse.y | 10 +- hl/src/H5LTprivate.h | 10 +- hl/src/H5LTpublic.h | 10 +- hl/src/H5PT.c | 10 +- hl/src/H5PTprivate.h | 10 +- hl/src/H5PTpublic.h | 10 +- hl/src/H5TB.c | 10 +- hl/src/H5TBprivate.h | 10 +- hl/src/H5TBpublic.h | 10 +- hl/src/Makefile.am | 10 +- hl/src/hdf5_hl.h | 10 +- hl/test/CMakeTests.cmake | 11 + hl/test/COPYING | 11 +- hl/test/H5srcdir_str.h.in | 10 +- hl/test/Makefile.am | 10 +- hl/test/dectris_hl_perf.c | 10 +- hl/test/gen_test_ds.c | 10 +- hl/test/gen_test_ld.c | 11 + hl/test/h5hltest.h | 10 +- hl/test/pal_rgb.h | 10 +- hl/test/test_ds.c | 10 +- hl/test/test_dset_append.c | 10 +- hl/test/test_dset_opt.c | 10 +- hl/test/test_file_image.c | 10 +- hl/test/test_image.c | 10 +- hl/test/test_ld.c | 10 +- hl/test/test_lite.c | 10 +- hl/test/test_packet.c | 10 +- hl/test/test_packet_vlen.c | 10 +- hl/test/test_table.c | 10 +- hl/tools/COPYING | 11 +- hl/tools/Makefile.am | 10 +- hl/tools/gif2h5/CMakeTests.cmake | 11 + hl/tools/gif2h5/Makefile.am | 10 +- hl/tools/gif2h5/decompress.c | 10 +- hl/tools/gif2h5/gif.h | 10 +- hl/tools/gif2h5/gif2hdf.c | 10 +- hl/tools/gif2h5/gif2mem.c | 10 +- hl/tools/gif2h5/gifread.c | 10 +- hl/tools/gif2h5/h52gifgentst.c | 10 +- hl/tools/gif2h5/h52giftest.sh.in | 10 +- hl/tools/gif2h5/hdf2gif.c | 10 +- hl/tools/gif2h5/hdfgifwr.c | 10 +- hl/tools/gif2h5/writehdf.c | 10 +- hl/tools/h5watch/CMakeTests.cmake | 11 + hl/tools/h5watch/Makefile.am | 10 +- hl/tools/h5watch/extend_dset.c | 10 +- hl/tools/h5watch/h5watch.c | 10 +- hl/tools/h5watch/h5watchgentest.c | 10 +- hl/tools/h5watch/swmr_check_compat_vfd.c | 10 +- hl/tools/h5watch/testh5watch.sh.in | 10 +- java/COPYING | 11 +- java/Makefile.am | 10 +- java/examples/Makefile.am | 10 +- java/examples/datasets/H5Ex_D_Alloc.java | 10 +- java/examples/datasets/H5Ex_D_Checksum.java | 10 +- java/examples/datasets/H5Ex_D_Chunk.java | 10 +- java/examples/datasets/H5Ex_D_Compact.java | 10 +- java/examples/datasets/H5Ex_D_External.java | 10 +- java/examples/datasets/H5Ex_D_FillValue.java | 10 +- java/examples/datasets/H5Ex_D_Gzip.java | 10 +- java/examples/datasets/H5Ex_D_Hyperslab.java | 10 +- java/examples/datasets/H5Ex_D_Nbit.java | 10 +- java/examples/datasets/H5Ex_D_ReadWrite.java | 10 +- java/examples/datasets/H5Ex_D_Shuffle.java | 10 +- java/examples/datasets/H5Ex_D_Sofloat.java | 10 +- java/examples/datasets/H5Ex_D_Soint.java | 10 +- java/examples/datasets/H5Ex_D_Szip.java | 10 +- java/examples/datasets/H5Ex_D_Transform.java | 10 +- java/examples/datasets/H5Ex_D_UnlimitedAdd.java | 10 +- java/examples/datasets/H5Ex_D_UnlimitedGzip.java | 10 +- java/examples/datasets/H5Ex_D_UnlimitedMod.java | 10 +- java/examples/datasets/Makefile.am | 10 +- java/examples/datasets/runExample.sh.in | 10 +- java/examples/datatypes/H5Ex_T_Array.java | 10 +- java/examples/datatypes/H5Ex_T_ArrayAttribute.java | 10 +- java/examples/datatypes/H5Ex_T_Bit.java | 10 +- java/examples/datatypes/H5Ex_T_BitAttribute.java | 10 +- java/examples/datatypes/H5Ex_T_Commit.java | 10 +- java/examples/datatypes/H5Ex_T_Compound.java | 10 +- .../datatypes/H5Ex_T_CompoundAttribute.java | 10 +- java/examples/datatypes/H5Ex_T_Float.java | 10 +- java/examples/datatypes/H5Ex_T_FloatAttribute.java | 10 +- java/examples/datatypes/H5Ex_T_Integer.java | 10 +- .../datatypes/H5Ex_T_IntegerAttribute.java | 10 +- .../examples/datatypes/H5Ex_T_ObjectReference.java | 10 +- .../datatypes/H5Ex_T_ObjectReferenceAttribute.java | 10 +- java/examples/datatypes/H5Ex_T_Opaque.java | 10 +- .../examples/datatypes/H5Ex_T_OpaqueAttribute.java | 10 +- java/examples/datatypes/H5Ex_T_String.java | 10 +- .../examples/datatypes/H5Ex_T_StringAttribute.java | 10 +- java/examples/datatypes/H5Ex_T_VLString.java | 10 +- java/examples/datatypes/Makefile.am | 10 +- java/examples/datatypes/runExample.sh.in | 10 +- java/examples/groups/H5Ex_G_Compact.java | 10 +- java/examples/groups/H5Ex_G_Corder.java | 10 +- java/examples/groups/H5Ex_G_Create.java | 10 +- java/examples/groups/H5Ex_G_Intermediate.java | 10 +- java/examples/groups/H5Ex_G_Iterate.java | 10 +- java/examples/groups/H5Ex_G_Phase.java | 10 +- java/examples/groups/H5Ex_G_Traverse.java | 10 +- java/examples/groups/H5Ex_G_Visit.java | 10 +- java/examples/groups/Makefile.am | 10 +- java/examples/groups/runExample.sh.in | 10 +- java/examples/intro/H5_CreateAttribute.java | 10 +- java/examples/intro/H5_CreateDataset.java | 10 +- java/examples/intro/H5_CreateFile.java | 10 +- java/examples/intro/H5_CreateGroup.java | 10 +- .../intro/H5_CreateGroupAbsoluteRelative.java | 10 +- java/examples/intro/H5_CreateGroupDataset.java | 10 +- java/examples/intro/H5_ReadWrite.java | 10 +- java/examples/intro/Makefile.am | 10 +- java/examples/intro/runExample.sh.in | 10 +- java/src/Makefile.am | 10 +- java/src/hdf/hdf5lib/H5.java | 10 +- java/src/hdf/hdf5lib/HDF5Constants.java | 10 +- java/src/hdf/hdf5lib/HDF5GroupInfo.java | 10 +- java/src/hdf/hdf5lib/HDFArray.java | 10 +- java/src/hdf/hdf5lib/HDFNativeData.java | 10 +- java/src/hdf/hdf5lib/callbacks/Callbacks.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5D_append_t.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5L_iterate_cb.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5O_iterate_cb.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java | 10 +- .../hdf5lib/callbacks/H5P_cls_close_func_cb.java | 10 +- .../hdf5lib/callbacks/H5P_cls_close_func_t.java | 10 +- .../hdf5lib/callbacks/H5P_cls_copy_func_cb.java | 10 +- .../hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java | 10 +- .../hdf5lib/callbacks/H5P_cls_create_func_cb.java | 10 +- .../hdf5lib/callbacks/H5P_cls_create_func_t.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java | 10 +- java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java | 10 +- .../hdf5lib/callbacks/H5P_prp_close_func_cb.java | 10 +- .../hdf5lib/callbacks/H5P_prp_compare_func_cb.java | 10 +- .../hdf5lib/callbacks/H5P_prp_copy_func_cb.java | 10 +- .../hdf5lib/callbacks/H5P_prp_create_func_cb.java | 10 +- .../hdf5lib/callbacks/H5P_prp_delete_func_cb.java | 10 +- .../hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java | 10 +- .../hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java | 10 +- .../hdf/hdf5lib/exceptions/HDF5AtomException.java | 10 +- .../hdf5lib/exceptions/HDF5AttributeException.java | 10 +- .../hdf/hdf5lib/exceptions/HDF5BtreeException.java | 10 +- .../exceptions/HDF5DataFiltersException.java | 10 +- .../exceptions/HDF5DataStorageException.java | 10 +- .../exceptions/HDF5DatasetInterfaceException.java | 10 +- .../HDF5DataspaceInterfaceException.java | 10 +- .../exceptions/HDF5DatatypeInterfaceException.java | 10 +- java/src/hdf/hdf5lib/exceptions/HDF5Exception.java | 10 +- .../exceptions/HDF5ExternalFileListException.java | 10 +- .../exceptions/HDF5FileInterfaceException.java | 10 +- .../exceptions/HDF5FunctionArgumentException.java | 10 +- .../exceptions/HDF5FunctionEntryExitException.java | 10 +- .../hdf/hdf5lib/exceptions/HDF5HeapException.java | 10 +- .../exceptions/HDF5InternalErrorException.java | 10 +- .../hdf/hdf5lib/exceptions/HDF5JavaException.java | 10 +- .../hdf5lib/exceptions/HDF5LibraryException.java | 10 +- .../exceptions/HDF5LowLevelIOException.java | 10 +- .../exceptions/HDF5MetaDataCacheException.java | 10 +- .../exceptions/HDF5ObjectHeaderException.java | 10 +- .../HDF5PropertyListInterfaceException.java | 10 +- .../hdf5lib/exceptions/HDF5ReferenceException.java | 10 +- .../HDF5ResourceUnavailableException.java | 10 +- .../exceptions/HDF5SymbolTableException.java | 10 +- .../hdf/hdf5lib/structs/H5AC_cache_config_t.java | 10 +- java/src/hdf/hdf5lib/structs/H5A_info_t.java | 10 +- java/src/hdf/hdf5lib/structs/H5E_error2_t.java | 10 +- java/src/hdf/hdf5lib/structs/H5F_info2_t.java | 10 +- java/src/hdf/hdf5lib/structs/H5G_info_t.java | 10 +- java/src/hdf/hdf5lib/structs/H5L_info_t.java | 10 +- java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java | 10 +- java/src/hdf/hdf5lib/structs/H5O_info_t.java | 10 +- java/src/hdf/hdf5lib/structs/H5_ih_info_t.java | 10 +- java/src/jni/Makefile.am | 10 +- java/src/jni/exceptionImp.c | 10 +- java/src/jni/exceptionImp.h | 10 +- java/src/jni/h5Constants.c | 10 +- java/src/jni/h5Imp.c | 10 +- java/src/jni/h5Imp.h | 10 +- java/src/jni/h5aImp.c | 10 +- java/src/jni/h5aImp.h | 10 +- java/src/jni/h5dImp.c | 10 +- java/src/jni/h5dImp.h | 10 +- java/src/jni/h5eImp.c | 10 +- java/src/jni/h5eImp.h | 10 +- java/src/jni/h5fImp.c | 10 +- java/src/jni/h5fImp.h | 10 +- java/src/jni/h5gImp.c | 10 +- java/src/jni/h5gImp.h | 10 +- java/src/jni/h5iImp.c | 10 +- java/src/jni/h5iImp.h | 10 +- java/src/jni/h5jni.h | 10 +- java/src/jni/h5lImp.c | 10 +- java/src/jni/h5lImp.h | 10 +- java/src/jni/h5oImp.c | 10 +- java/src/jni/h5oImp.h | 10 +- java/src/jni/h5pImp.c | 10 +- java/src/jni/h5pImp.h | 10 +- java/src/jni/h5plImp.c | 10 +- java/src/jni/h5plImp.h | 10 +- java/src/jni/h5rImp.c | 10 +- java/src/jni/h5rImp.h | 10 +- java/src/jni/h5sImp.c | 10 +- java/src/jni/h5sImp.h | 10 +- java/src/jni/h5tImp.c | 10 +- java/src/jni/h5tImp.h | 10 +- java/src/jni/h5util.c | 10 +- java/src/jni/h5util.h | 10 +- java/src/jni/h5zImp.c | 10 +- java/src/jni/h5zImp.h | 10 +- java/src/jni/nativeData.c | 10 +- java/src/jni/nativeData.h | 10 +- java/test/Makefile.am | 10 +- java/test/TestAll.java | 10 +- java/test/TestH5.java | 10 +- java/test/TestH5A.java | 10 +- java/test/TestH5D.java | 10 +- java/test/TestH5Dparams.java | 10 +- java/test/TestH5Dplist.java | 10 +- java/test/TestH5E.java | 14 +- java/test/TestH5Edefault.java | 10 +- java/test/TestH5Eregister.java | 10 +- java/test/TestH5F.java | 10 +- java/test/TestH5Fbasic.java | 10 +- java/test/TestH5Fparams.java | 10 +- java/test/TestH5Fswmr.java | 10 +- java/test/TestH5G.java | 10 +- java/test/TestH5Gbasic.java | 10 +- java/test/TestH5Giterate.java | 10 +- java/test/TestH5Lbasic.java | 10 +- java/test/TestH5Lcreate.java | 10 +- java/test/TestH5Lparams.java | 10 +- java/test/TestH5Obasic.java | 10 +- java/test/TestH5Ocopy.java | 10 +- java/test/TestH5Ocreate.java | 10 +- java/test/TestH5Oparams.java | 10 +- java/test/TestH5P.java | 10 +- java/test/TestH5PData.java | 10 +- java/test/TestH5PL.java | 10 +- java/test/TestH5Pfapl.java | 10 +- java/test/TestH5Plist.java | 10 +- java/test/TestH5Pvirtual.java | 10 +- java/test/TestH5R.java | 10 +- java/test/TestH5S.java | 10 +- java/test/TestH5Sbasic.java | 10 +- java/test/TestH5T.java | 10 +- java/test/TestH5Tbasic.java | 10 +- java/test/TestH5Tparams.java | 10 +- java/test/TestH5Z.java | 10 +- java/test/junit.sh.in | 10 +- m4/aclocal_cxx.m4 | 10 +- m4/aclocal_fc.f90 | 13 + m4/aclocal_fc.m4 | 10 +- release_docs/COPYING | 11 +- release_docs/HISTORY-1_10.txt | 1367 ++ release_docs/HISTORY-1_8.txt | 12344 +++++++++++++++++++ release_docs/HISTORY-1_8_0-1_10_0.txt | 1742 +++ release_docs/HISTORY-1_9.txt | 6 - src/COPYING | 11 +- src/H5.c | 10 +- src/H5A.c | 10 +- src/H5AC.c | 10 +- src/H5ACdbg.c | 10 +- src/H5AClog.c | 10 +- src/H5ACmodule.h | 10 +- src/H5ACmpio.c | 10 +- src/H5ACpkg.h | 10 +- src/H5ACprivate.h | 10 +- src/H5ACproxy_entry.c | 10 +- src/H5ACpublic.h | 10 +- src/H5Abtree2.c | 10 +- src/H5Adense.c | 10 +- src/H5Adeprec.c | 10 +- src/H5Aint.c | 10 +- src/H5Amodule.h | 10 +- src/H5Apkg.h | 10 +- src/H5Aprivate.h | 10 +- src/H5Apublic.h | 10 +- src/H5Atest.c | 10 +- src/H5B.c | 10 +- src/H5B2.c | 10 +- src/H5B2cache.c | 10 +- src/H5B2dbg.c | 10 +- src/H5B2hdr.c | 10 +- src/H5B2int.c | 10 +- src/H5B2internal.c | 10 +- src/H5B2leaf.c | 10 +- src/H5B2module.h | 10 +- src/H5B2pkg.h | 10 +- src/H5B2private.h | 10 +- src/H5B2public.h | 10 +- src/H5B2stat.c | 10 +- src/H5B2test.c | 10 +- src/H5Bcache.c | 10 +- src/H5Bdbg.c | 10 +- src/H5Bmodule.h | 10 +- src/H5Bpkg.h | 10 +- src/H5Bprivate.h | 10 +- src/H5Bpublic.h | 10 +- src/H5C.c | 10 +- src/H5CS.c | 10 +- src/H5CSprivate.h | 10 +- src/H5Cdbg.c | 10 +- src/H5Cepoch.c | 10 +- src/H5Cimage.c | 10 +- src/H5Clog.c | 10 +- src/H5Cmodule.h | 10 +- src/H5Cmpio.c | 10 +- src/H5Cpkg.h | 10 +- src/H5Cprefetched.c | 10 +- src/H5Cprivate.h | 10 +- src/H5Cpublic.h | 10 +- src/H5Cquery.c | 10 +- src/H5Ctag.c | 10 +- src/H5Ctest.c | 10 +- src/H5D.c | 10 +- src/H5Dbtree.c | 10 +- src/H5Dbtree2.c | 10 +- src/H5Dchunk.c | 10 +- src/H5Dcompact.c | 10 +- src/H5Dcontig.c | 10 +- src/H5Ddbg.c | 10 +- src/H5Ddeprec.c | 10 +- src/H5Dearray.c | 10 +- src/H5Defl.c | 10 +- src/H5Dfarray.c | 10 +- src/H5Dfill.c | 10 +- src/H5Dint.c | 10 +- src/H5Dio.c | 10 +- src/H5Dlayout.c | 10 +- src/H5Dmodule.h | 10 +- src/H5Dmpio.c | 10 +- src/H5Dnone.c | 10 +- src/H5Doh.c | 10 +- src/H5Dpkg.h | 10 +- src/H5Dprivate.h | 10 +- src/H5Dpublic.h | 10 +- src/H5Dscatgath.c | 10 +- src/H5Dselect.c | 10 +- src/H5Dsingle.c | 10 +- src/H5Dtest.c | 10 +- src/H5Dvirtual.c | 10 +- src/H5E.c | 10 +- src/H5EA.c | 10 +- src/H5EAcache.c | 10 +- src/H5EAdbg.c | 10 +- src/H5EAdblkpage.c | 10 +- src/H5EAdblock.c | 10 +- src/H5EAhdr.c | 10 +- src/H5EAiblock.c | 10 +- src/H5EAint.c | 10 +- src/H5EAmodule.h | 10 +- src/H5EApkg.h | 10 +- src/H5EAprivate.h | 10 +- src/H5EAsblock.c | 10 +- src/H5EAstat.c | 10 +- src/H5EAtest.c | 10 +- src/H5Edeprec.c | 10 +- src/H5Eint.c | 10 +- src/H5Emodule.h | 10 +- src/H5Epkg.h | 10 +- src/H5Eprivate.h | 10 +- src/H5Epublic.h | 10 +- src/H5F.c | 10 +- src/H5FA.c | 10 +- src/H5FAcache.c | 10 +- src/H5FAdbg.c | 10 +- src/H5FAdblkpage.c | 10 +- src/H5FAdblock.c | 10 +- src/H5FAhdr.c | 10 +- src/H5FAint.c | 10 +- src/H5FAmodule.h | 10 +- src/H5FApkg.h | 10 +- src/H5FAprivate.h | 10 +- src/H5FAstat.c | 10 +- src/H5FAtest.c | 10 +- src/H5FD.c | 10 +- src/H5FDcore.c | 10 +- src/H5FDcore.h | 10 +- src/H5FDdirect.c | 10 +- src/H5FDdirect.h | 10 +- src/H5FDdrvr_module.h | 10 +- src/H5FDfamily.c | 10 +- src/H5FDfamily.h | 10 +- src/H5FDint.c | 10 +- src/H5FDlog.c | 10 +- src/H5FDlog.h | 10 +- src/H5FDmodule.h | 10 +- src/H5FDmpi.c | 10 +- src/H5FDmpi.h | 10 +- src/H5FDmpio.c | 10 +- src/H5FDmpio.h | 10 +- src/H5FDmulti.c | 10 +- src/H5FDmulti.h | 10 +- src/H5FDpkg.h | 10 +- src/H5FDprivate.h | 10 +- src/H5FDpublic.h | 10 +- src/H5FDsec2.c | 10 +- src/H5FDsec2.h | 10 +- src/H5FDspace.c | 10 +- src/H5FDstdio.c | 10 +- src/H5FDstdio.h | 10 +- src/H5FDtest.c | 10 +- src/H5FDwindows.c | 10 +- src/H5FDwindows.h | 10 +- src/H5FL.c | 10 +- src/H5FLmodule.h | 10 +- src/H5FLprivate.h | 10 +- src/H5FO.c | 10 +- src/H5FOprivate.h | 10 +- src/H5FS.c | 10 +- src/H5FScache.c | 10 +- src/H5FSdbg.c | 10 +- src/H5FSint.c | 10 +- src/H5FSmodule.h | 10 +- src/H5FSpkg.h | 10 +- src/H5FSprivate.h | 10 +- src/H5FSpublic.h | 10 +- src/H5FSsection.c | 10 +- src/H5FSstat.c | 10 +- src/H5FStest.c | 10 +- src/H5Faccum.c | 10 +- src/H5Fcwfs.c | 10 +- src/H5Fdbg.c | 10 +- src/H5Fdeprec.c | 10 +- src/H5Fefc.c | 10 +- src/H5Ffake.c | 10 +- src/H5Fint.c | 10 +- src/H5Fio.c | 10 +- src/H5Fmodule.h | 10 +- src/H5Fmount.c | 10 +- src/H5Fmpi.c | 10 +- src/H5Fpkg.h | 10 +- src/H5Fprivate.h | 10 +- src/H5Fpublic.h | 10 +- src/H5Fquery.c | 10 +- src/H5Fsfile.c | 10 +- src/H5Fspace.c | 10 +- src/H5Fsuper.c | 10 +- src/H5Fsuper_cache.c | 10 +- src/H5Ftest.c | 10 +- src/H5G.c | 10 +- src/H5Gbtree2.c | 10 +- src/H5Gcache.c | 10 +- src/H5Gcompact.c | 10 +- src/H5Gdense.c | 10 +- src/H5Gdeprec.c | 10 +- src/H5Gent.c | 10 +- src/H5Gint.c | 10 +- src/H5Glink.c | 10 +- src/H5Gloc.c | 10 +- src/H5Gmodule.h | 10 +- src/H5Gname.c | 10 +- src/H5Gnode.c | 10 +- src/H5Gobj.c | 10 +- src/H5Goh.c | 10 +- src/H5Gpkg.h | 10 +- src/H5Gprivate.h | 10 +- src/H5Gpublic.h | 10 +- src/H5Groot.c | 10 +- src/H5Gstab.c | 10 +- src/H5Gtest.c | 10 +- src/H5Gtraverse.c | 10 +- src/H5HF.c | 10 +- src/H5HFbtree2.c | 10 +- src/H5HFcache.c | 10 +- src/H5HFdbg.c | 10 +- src/H5HFdblock.c | 10 +- src/H5HFdtable.c | 10 +- src/H5HFhdr.c | 10 +- src/H5HFhuge.c | 10 +- src/H5HFiblock.c | 10 +- src/H5HFiter.c | 10 +- src/H5HFman.c | 10 +- src/H5HFmodule.h | 10 +- src/H5HFpkg.h | 10 +- src/H5HFprivate.h | 10 +- src/H5HFpublic.h | 10 +- src/H5HFsection.c | 10 +- src/H5HFspace.c | 10 +- src/H5HFstat.c | 10 +- src/H5HFtest.c | 10 +- src/H5HFtiny.c | 10 +- src/H5HG.c | 10 +- src/H5HGcache.c | 10 +- src/H5HGdbg.c | 10 +- src/H5HGmodule.h | 10 +- src/H5HGpkg.h | 10 +- src/H5HGprivate.h | 10 +- src/H5HGpublic.h | 10 +- src/H5HGquery.c | 10 +- src/H5HL.c | 10 +- src/H5HLcache.c | 10 +- src/H5HLdbg.c | 10 +- src/H5HLdblk.c | 10 +- src/H5HLint.c | 10 +- src/H5HLmodule.h | 10 +- src/H5HLpkg.h | 10 +- src/H5HLprfx.c | 10 +- src/H5HLprivate.h | 10 +- src/H5HLpublic.h | 10 +- src/H5HP.c | 10 +- src/H5HPprivate.h | 10 +- src/H5I.c | 10 +- src/H5Imodule.h | 10 +- src/H5Ipkg.h | 10 +- src/H5Iprivate.h | 10 +- src/H5Ipublic.h | 10 +- src/H5Itest.c | 10 +- src/H5L.c | 10 +- src/H5Lexternal.c | 10 +- src/H5Lmodule.h | 10 +- src/H5Lpkg.h | 10 +- src/H5Lprivate.h | 10 +- src/H5Lpublic.h | 10 +- src/H5MF.c | 10 +- src/H5MFaggr.c | 10 +- src/H5MFdbg.c | 10 +- src/H5MFmodule.h | 10 +- src/H5MFpkg.h | 10 +- src/H5MFprivate.h | 10 +- src/H5MFsection.c | 10 +- src/H5MM.c | 10 +- src/H5MMprivate.h | 10 +- src/H5MMpublic.h | 10 +- src/H5MP.c | 10 +- src/H5MPmodule.h | 10 +- src/H5MPpkg.h | 10 +- src/H5MPprivate.h | 10 +- src/H5MPtest.c | 10 +- src/H5O.c | 10 +- src/H5Oainfo.c | 10 +- src/H5Oalloc.c | 10 +- src/H5Oattr.c | 10 +- src/H5Oattribute.c | 10 +- src/H5Obogus.c | 10 +- src/H5Obtreek.c | 10 +- src/H5Ocache.c | 10 +- src/H5Ocache_image.c | 10 +- src/H5Ochunk.c | 10 +- src/H5Ocont.c | 10 +- src/H5Ocopy.c | 10 +- src/H5Odbg.c | 10 +- src/H5Odrvinfo.c | 10 +- src/H5Odtype.c | 10 +- src/H5Oefl.c | 10 +- src/H5Ofill.c | 10 +- src/H5Oflush.c | 10 +- src/H5Ofsinfo.c | 10 +- src/H5Oginfo.c | 10 +- src/H5Olayout.c | 10 +- src/H5Olinfo.c | 10 +- src/H5Olink.c | 10 +- src/H5Omessage.c | 10 +- src/H5Omodule.h | 10 +- src/H5Omtime.c | 10 +- src/H5Oname.c | 10 +- src/H5Onull.c | 10 +- src/H5Opkg.h | 10 +- src/H5Opline.c | 10 +- src/H5Oprivate.h | 10 +- src/H5Opublic.h | 10 +- src/H5Orefcount.c | 10 +- src/H5Osdspace.c | 10 +- src/H5Oshared.c | 10 +- src/H5Oshared.h | 10 +- src/H5Oshmesg.c | 10 +- src/H5Ostab.c | 10 +- src/H5Otest.c | 10 +- src/H5Ounknown.c | 10 +- src/H5P.c | 10 +- src/H5PB.c | 10 +- src/H5PBmodule.h | 10 +- src/H5PBpkg.h | 10 +- src/H5PBprivate.h | 10 +- src/H5PL.c | 10 +- src/H5PLextern.h | 10 +- src/H5PLmodule.h | 10 +- src/H5PLprivate.h | 10 +- src/H5PLpublic.h | 10 +- src/H5Pacpl.c | 10 +- src/H5Pdapl.c | 10 +- src/H5Pdcpl.c | 10 +- src/H5Pdeprec.c | 10 +- src/H5Pdxpl.c | 10 +- src/H5Pencdec.c | 10 +- src/H5Pfapl.c | 10 +- src/H5Pfcpl.c | 10 +- src/H5Pfmpl.c | 10 +- src/H5Pgcpl.c | 10 +- src/H5Pint.c | 10 +- src/H5Plapl.c | 10 +- src/H5Plcpl.c | 10 +- src/H5Pmodule.h | 10 +- src/H5Pocpl.c | 10 +- src/H5Pocpypl.c | 10 +- src/H5Ppkg.h | 10 +- src/H5Pprivate.h | 10 +- src/H5Ppublic.h | 10 +- src/H5Pstrcpl.c | 10 +- src/H5Ptest.c | 10 +- src/H5R.c | 10 +- src/H5RS.c | 10 +- src/H5RSprivate.h | 10 +- src/H5Rdeprec.c | 10 +- src/H5Rmodule.h | 10 +- src/H5Rpkg.h | 10 +- src/H5Rprivate.h | 10 +- src/H5Rpublic.h | 10 +- src/H5S.c | 10 +- src/H5SL.c | 10 +- src/H5SLmodule.h | 10 +- src/H5SLprivate.h | 10 +- src/H5SM.c | 10 +- src/H5SMbtree2.c | 10 +- src/H5SMcache.c | 10 +- src/H5SMmessage.c | 10 +- src/H5SMmodule.h | 10 +- src/H5SMpkg.h | 10 +- src/H5SMprivate.h | 10 +- src/H5SMtest.c | 10 +- src/H5ST.c | 10 +- src/H5STprivate.h | 10 +- src/H5Sall.c | 10 +- src/H5Sdbg.c | 10 +- src/H5Shyper.c | 10 +- src/H5Smodule.h | 10 +- src/H5Smpio.c | 10 +- src/H5Snone.c | 10 +- src/H5Spkg.h | 10 +- src/H5Spoint.c | 10 +- src/H5Sprivate.h | 10 +- src/H5Spublic.h | 10 +- src/H5Sselect.c | 10 +- src/H5Stest.c | 10 +- src/H5T.c | 10 +- src/H5TS.c | 10 +- src/H5TSprivate.h | 10 +- src/H5Tarray.c | 10 +- src/H5Tbit.c | 10 +- src/H5Tcommit.c | 10 +- src/H5Tcompound.c | 10 +- src/H5Tconv.c | 10 +- src/H5Tcset.c | 10 +- src/H5Tdbg.c | 10 +- src/H5Tdeprec.c | 10 +- src/H5Tenum.c | 10 +- src/H5Tfields.c | 10 +- src/H5Tfixed.c | 10 +- src/H5Tfloat.c | 10 +- src/H5Tmodule.h | 10 +- src/H5Tnative.c | 10 +- src/H5Toffset.c | 10 +- src/H5Toh.c | 10 +- src/H5Topaque.c | 10 +- src/H5Torder.c | 10 +- src/H5Tpad.c | 10 +- src/H5Tpkg.h | 10 +- src/H5Tprecis.c | 10 +- src/H5Tprivate.h | 10 +- src/H5Tpublic.h | 10 +- src/H5Tstrpad.c | 10 +- src/H5Tvisit.c | 10 +- src/H5Tvlen.c | 10 +- src/H5UC.c | 10 +- src/H5UCprivate.h | 10 +- src/H5VM.c | 10 +- src/H5VMprivate.h | 10 +- src/H5WB.c | 10 +- src/H5WBprivate.h | 10 +- src/H5Z.c | 10 +- src/H5Zdeflate.c | 10 +- src/H5Zfletcher32.c | 10 +- src/H5Zmodule.h | 10 +- src/H5Znbit.c | 10 +- src/H5Zpkg.h | 10 +- src/H5Zprivate.h | 10 +- src/H5Zpublic.h | 10 +- src/H5Zscaleoffset.c | 10 +- src/H5Zshuffle.c | 10 +- src/H5Zszip.c | 10 +- src/H5Ztrans.c | 10 +- src/H5api_adpt.h | 10 +- src/H5checksum.c | 10 +- src/H5dbg.c | 10 +- src/H5detect.c | 20 +- src/H5err.txt | 10 +- src/H5make_libsettings.c | 20 +- src/H5overflow.txt | 10 +- src/H5private.h | 10 +- src/H5public.h | 10 +- src/H5system.c | 10 +- src/H5timer.c | 10 +- src/H5trace.c | 10 +- src/H5vers.txt | 10 +- src/H5win32defs.h | 10 +- src/Makefile.am | 10 +- src/hdf5.h | 10 +- test/CMakeTests.cmake | 11 + test/COPYING | 11 +- test/H5srcdir.h | 10 +- test/H5srcdir_str.h.in | 10 +- test/Makefile.am | 10 +- test/accum.c | 10 +- test/accum_swmr_reader.c | 10 +- test/app_ref.c | 10 +- test/atomic_reader.c | 10 +- test/atomic_writer.c | 10 +- test/big.c | 10 +- test/bittests.c | 10 +- test/btree2.c | 10 +- test/cache.c | 10 +- test/cache_api.c | 10 +- test/cache_common.c | 10 +- test/cache_common.h | 10 +- test/cache_image.c | 10 +- test/cache_logging.c | 10 +- test/cache_tagging.c | 11 +- test/chunk_info.c | 10 +- test/cmpd_dset.c | 10 +- test/cork.c | 11 +- test/cross_read.c | 10 +- test/dangle.c | 10 +- test/dsets.c | 10 +- test/dt_arith.c | 10 +- test/dtransform.c | 10 +- test/dtypes.c | 10 +- test/dynlib1.c | 10 +- test/dynlib2.c | 10 +- test/dynlib3.c | 10 +- test/dynlib4.c | 10 +- test/earray.c | 10 +- test/efc.c | 10 +- test/enc_dec_plist.c | 10 +- test/enc_dec_plist_cross_platform.c | 10 +- test/enum.c | 10 +- test/err_compat.c | 10 +- test/error_test.c | 10 +- test/evict_on_close.c | 10 +- test/extend.c | 10 +- test/external.c | 10 +- test/farray.c | 10 +- test/fheap.c | 10 +- test/file_image.c | 10 +- test/fillval.c | 10 +- test/filter_fail.c | 10 +- test/flush1.c | 10 +- test/flush2.c | 10 +- test/flushrefresh.c | 10 +- test/freespace.c | 10 +- test/gen_bad_compound.c | 10 +- test/gen_bad_ohdr.c | 10 +- test/gen_bogus.c | 10 +- test/gen_cross.c | 10 +- test/gen_deflate.c | 10 +- test/gen_file_image.c | 10 +- test/gen_filespace.c | 10 +- test/gen_filters.c | 10 +- test/gen_mergemsg.c | 10 +- test/gen_new_array.c | 10 +- test/gen_new_fill.c | 10 +- test/gen_new_group.c | 10 +- test/gen_new_mtime.c | 10 +- test/gen_new_super.c | 10 +- test/gen_noencoder.c | 10 +- test/gen_nullspace.c | 10 +- test/gen_old_array.c | 10 +- test/gen_old_group.c | 10 +- test/gen_old_layout.c | 10 +- test/gen_old_mtime.c | 10 +- test/gen_plist.c | 10 +- test/gen_sizes_lheap.c | 10 +- test/gen_specmetaread.c | 10 +- test/gen_udlinks.c | 10 +- test/genall5.c | 10 +- test/genall5.h | 10 +- test/getname.c | 10 +- test/gheap.c | 10 +- test/h5test.c | 10 +- test/h5test.h | 10 +- test/hyperslab.c | 10 +- test/istore.c | 10 +- test/lheap.c | 10 +- test/links.c | 10 +- test/links_env.c | 10 +- test/mf.c | 10 +- test/mount.c | 10 +- test/mtime.c | 10 +- test/ntypes.c | 10 +- test/objcopy.c | 10 +- test/ohdr.c | 10 +- test/page_buffer.c | 10 +- test/plugin.c | 10 +- test/pool.c | 10 +- test/reserved.c | 10 +- test/set_extent.c | 10 +- test/space_overflow.c | 10 +- test/stab.c | 10 +- test/swmr.c | 10 +- test/swmr_addrem_writer.c | 10 +- test/swmr_check_compat_vfd.c | 10 +- test/swmr_common.c | 10 +- test/swmr_common.h | 10 +- test/swmr_generator.c | 10 +- test/swmr_reader.c | 10 +- test/swmr_remove_reader.c | 10 +- test/swmr_remove_writer.c | 10 +- test/swmr_sparse_reader.c | 10 +- test/swmr_sparse_writer.c | 10 +- test/swmr_start_write.c | 10 +- test/swmr_writer.c | 10 +- test/tarray.c | 10 +- test/tattr.c | 10 +- test/tcheck_version.c | 10 +- test/tchecksum.c | 10 +- test/tconfig.c | 10 +- test/tcoords.c | 10 +- test/test_plugin.sh.in | 20 +- test/test_usecases.sh.in | 10 +- test/testcheck_version.sh.in | 10 +- test/testerror.sh.in | 10 +- test/testflushrefresh.sh.in | 10 +- test/testframe.c | 10 +- test/testhdf5.c | 10 +- test/testhdf5.h | 10 +- test/testlibinfo.sh.in | 10 +- test/testlinks_env.sh.in | 10 +- test/testmeta.c | 10 +- test/testswmr.sh.in | 10 +- test/testvdsswmr.sh.in | 10 +- test/tfile.c | 10 +- test/tgenprop.c | 10 +- test/th5o.c | 10 +- test/th5s.c | 10 +- test/theap.c | 10 +- test/tid.c | 10 +- test/titerate.c | 10 +- test/tmeta.c | 10 +- test/tmisc.c | 10 +- test/trefer.c | 10 +- test/trefstr.c | 10 +- test/tselect.c | 10 +- test/tskiplist.c | 10 +- test/tsohm.c | 10 +- test/ttime.c | 10 +- test/ttsafe.c | 10 +- test/ttsafe.h | 10 +- test/ttsafe_acreate.c | 10 +- test/ttsafe_cancel.c | 10 +- test/ttsafe_dcreate.c | 10 +- test/ttsafe_error.c | 10 +- test/ttst.c | 10 +- test/tunicode.c | 10 +- test/tvlstr.c | 10 +- test/tvltypes.c | 10 +- test/twriteorder.c | 10 +- test/unlink.c | 10 +- test/unregister.c | 10 +- test/use.h | 10 +- test/use_append_chunk.c | 10 +- test/use_append_mchunks.c | 10 +- test/use_common.c | 10 +- test/use_disable_mdc_flushes.c | 10 +- test/vds.c | 10 +- test/vds_swmr.h | 10 +- test/vds_swmr_gen.c | 10 +- test/vds_swmr_reader.c | 10 +- test/vds_swmr_writer.c | 10 +- test/vfd.c | 10 +- testpar/CMakeTests.cmake | 11 + testpar/COPYING | 11 +- testpar/Makefile.am | 10 +- testpar/t_cache.c | 10 +- testpar/t_cache_image.c | 10 +- testpar/t_chunk_alloc.c | 10 +- testpar/t_coll_chunk.c | 10 +- testpar/t_dset.c | 10 +- testpar/t_file.c | 10 +- testpar/t_file_image.c | 10 +- testpar/t_filter_read.c | 10 +- testpar/t_init_term.c | 10 +- testpar/t_mdset.c | 10 +- testpar/t_mpi.c | 10 +- testpar/t_pflush1.c | 10 +- testpar/t_pflush2.c | 10 +- testpar/t_ph5basic.c | 10 +- testpar/t_prestart.c | 10 +- testpar/t_prop.c | 10 +- testpar/t_pshutdown.c | 10 +- testpar/t_shapesame.c | 10 +- testpar/t_span_tree.c | 10 +- testpar/testpar.h | 10 +- testpar/testphdf5.c | 10 +- testpar/testphdf5.h | 10 +- tools/COPYING | 11 +- tools/Makefile.am | 10 +- tools/lib/Makefile.am | 10 +- tools/lib/h5diff.c | 10 +- tools/lib/h5diff.h | 10 +- tools/lib/h5diff_array.c | 10 +- tools/lib/h5diff_attr.c | 10 +- tools/lib/h5diff_dset.c | 10 +- tools/lib/h5diff_util.c | 10 +- tools/lib/h5tools.c | 10 +- tools/lib/h5tools.h | 10 +- tools/lib/h5tools_dump.c | 10 +- tools/lib/h5tools_dump.h | 10 +- tools/lib/h5tools_error.h | 10 +- tools/lib/h5tools_filters.c | 10 +- tools/lib/h5tools_ref.c | 10 +- tools/lib/h5tools_ref.h | 10 +- tools/lib/h5tools_str.c | 10 +- tools/lib/h5tools_str.h | 10 +- tools/lib/h5tools_type.c | 10 +- tools/lib/h5tools_utils.c | 10 +- tools/lib/h5tools_utils.h | 10 +- tools/lib/h5trav.c | 10 +- tools/lib/h5trav.h | 10 +- tools/lib/io_timer.c | 10 +- tools/lib/io_timer.h | 10 +- tools/lib/ph5diff.h | 10 +- tools/src/Makefile.am | 10 +- tools/src/h5copy/Makefile.am | 10 +- tools/src/h5copy/h5copy.c | 10 +- tools/src/h5diff/Makefile.am | 10 +- tools/src/h5diff/h5diff_common.c | 10 +- tools/src/h5diff/h5diff_common.h | 10 +- tools/src/h5diff/h5diff_main.c | 10 +- tools/src/h5diff/ph5diff_main.c | 10 +- tools/src/h5dump/Makefile.am | 10 +- tools/src/h5dump/h5dump.c | 10 +- tools/src/h5dump/h5dump.h | 10 +- tools/src/h5dump/h5dump_ddl.c | 10 +- tools/src/h5dump/h5dump_ddl.h | 10 +- tools/src/h5dump/h5dump_defines.h | 10 +- tools/src/h5dump/h5dump_extern.h | 10 +- tools/src/h5dump/h5dump_xml.c | 10 +- tools/src/h5dump/h5dump_xml.h | 10 +- tools/src/h5format_convert/Makefile.am | 10 +- tools/src/h5format_convert/h5format_convert.c | 10 +- tools/src/h5import/Makefile.am | 10 +- tools/src/h5import/h5import.c | 10 +- tools/src/h5import/h5import.h | 10 +- tools/src/h5jam/Makefile.am | 10 +- tools/src/h5jam/h5jam.c | 10 +- tools/src/h5jam/h5unjam.c | 10 +- tools/src/h5ls/Makefile.am | 10 +- tools/src/h5ls/h5ls.c | 10 +- tools/src/h5repack/Makefile.am | 10 +- tools/src/h5repack/h5repack.c | 10 +- tools/src/h5repack/h5repack.h | 10 +- tools/src/h5repack/h5repack_copy.c | 10 +- tools/src/h5repack/h5repack_filters.c | 10 +- tools/src/h5repack/h5repack_main.c | 10 +- tools/src/h5repack/h5repack_opttable.c | 10 +- tools/src/h5repack/h5repack_parse.c | 10 +- tools/src/h5repack/h5repack_refs.c | 10 +- tools/src/h5repack/h5repack_verify.c | 10 +- tools/src/h5stat/Makefile.am | 10 +- tools/src/h5stat/h5stat.c | 10 +- tools/src/misc/Makefile.am | 10 +- tools/src/misc/h5cc.in | 10 +- tools/src/misc/h5clear.c | 10 +- tools/src/misc/h5debug.c | 10 +- tools/src/misc/h5mkgrp.c | 10 +- tools/src/misc/h5redeploy.in | 10 +- tools/src/misc/h5repart.c | 10 +- tools/test/Makefile.am | 10 +- tools/test/h5copy/CMakeTests.cmake | 11 + tools/test/h5copy/Makefile.am | 10 +- tools/test/h5copy/h5copygentest.c | 10 +- tools/test/h5copy/testh5copy.sh.in | 10 +- tools/test/h5diff/CMakeTests.cmake | 11 + tools/test/h5diff/Makefile.am | 10 +- tools/test/h5diff/dynlib_diff.c | 10 +- tools/test/h5diff/h5diff_plugin.sh.in | 10 +- tools/test/h5diff/h5diffgentest.c | 10 +- tools/test/h5diff/testh5diff.sh.in | 10 +- tools/test/h5diff/testph5diff.sh.in | 10 +- tools/test/h5dump/CMakeTests.cmake | 11 + tools/test/h5dump/CMakeTestsPBITS.cmake | 11 + tools/test/h5dump/CMakeTestsVDS.cmake | 11 + tools/test/h5dump/CMakeTestsXML.cmake | 11 + tools/test/h5dump/Makefile.am | 10 +- tools/test/h5dump/binread.c | 10 +- tools/test/h5dump/dynlib_dump.c | 10 +- tools/test/h5dump/h5dump_plugin.sh.in | 10 +- tools/test/h5dump/h5dumpgentest.c | 10 +- tools/test/h5dump/testh5dump.sh.in | 10 +- tools/test/h5dump/testh5dumppbits.sh.in | 10 +- tools/test/h5dump/testh5dumpvds.sh.in | 10 +- tools/test/h5dump/testh5dumpxml.sh.in | 10 +- tools/test/h5format_convert/CMakeTests.cmake | 11 + tools/test/h5format_convert/Makefile.am | 10 +- tools/test/h5format_convert/h5fc_chk_idx.c | 10 +- tools/test/h5format_convert/h5fc_gentest.c | 10 +- tools/test/h5format_convert/testh5fc.sh.in | 10 +- tools/test/h5import/CMakeTests.cmake | 11 + tools/test/h5import/Makefile.am | 10 +- tools/test/h5import/h5importtest.c | 10 +- tools/test/h5import/h5importtestutil.sh.in | 10 +- tools/test/h5jam/CMakeTests.cmake | 11 + tools/test/h5jam/Makefile.am | 10 +- tools/test/h5jam/getub.c | 10 +- tools/test/h5jam/h5jamgentest.c | 10 +- tools/test/h5jam/tellub.c | 10 +- tools/test/h5jam/testh5jam.sh.in | 10 +- tools/test/h5ls/CMakeTests.cmake | 11 + tools/test/h5ls/CMakeTestsVDS.cmake | 11 + tools/test/h5ls/Makefile.am | 10 +- tools/test/h5ls/dynlib_ls.c | 10 +- tools/test/h5ls/h5ls_plugin.sh.in | 10 +- tools/test/h5ls/testh5ls.sh.in | 10 +- tools/test/h5ls/testh5lsvds.sh.in | 10 +- tools/test/h5repack/CMakeTests.cmake | 11 + tools/test/h5repack/Makefile.am | 10 +- tools/test/h5repack/dynlib_rpk.c | 10 +- tools/test/h5repack/dynlib_vrpk.c | 10 +- tools/test/h5repack/h5repack.sh.in | 10 +- tools/test/h5repack/h5repack_plugin.sh.in | 10 +- tools/test/h5repack/h5repacktst.c | 10 +- tools/test/h5repack/testh5repack_detect_szip.c | 10 +- tools/test/h5stat/CMakeTests.cmake | 11 + tools/test/h5stat/Makefile.am | 10 +- tools/test/h5stat/h5stat_gentest.c | 10 +- tools/test/h5stat/testh5stat.sh.in | 10 +- tools/test/misc/CMakeTestsClear.cmake | 11 + tools/test/misc/CMakeTestsMkgrp.cmake | 11 + tools/test/misc/CMakeTestsRepart.cmake | 11 + tools/test/misc/Makefile.am | 10 +- tools/test/misc/clear_open_chk.c | 10 +- tools/test/misc/h5clear_gentest.c | 10 +- tools/test/misc/h5perf_gentest.c | 11 + tools/test/misc/h5repart_gentest.c | 10 +- tools/test/misc/repart_test.c | 10 +- tools/test/misc/talign.c | 10 +- tools/test/misc/testh5clear.sh.in | 10 +- tools/test/misc/testh5mkgrp.sh.in | 10 +- tools/test/misc/testh5repart.sh.in | 10 +- tools/test/misc/vds/Makefile.am | 10 +- tools/test/misc/vds/UC_1.h | 10 +- tools/test/misc/vds/UC_1_one_dim_gen.c | 10 +- tools/test/misc/vds/UC_2.h | 10 +- tools/test/misc/vds/UC_2_two_dims_gen.c | 10 +- tools/test/misc/vds/UC_3.h | 10 +- tools/test/misc/vds/UC_3_gaps_gen.c | 10 +- tools/test/misc/vds/UC_4.h | 10 +- tools/test/misc/vds/UC_4_printf_gen.c | 10 +- tools/test/misc/vds/UC_5.h | 10 +- tools/test/misc/vds/UC_5_stride_gen.c | 10 +- tools/test/misc/vds/UC_common.h | 10 +- tools/test/perform/CMakeTests.cmake | 11 + tools/test/perform/COPYING | 11 +- tools/test/perform/Makefile.am | 10 +- tools/test/perform/build_h5perf_alone.sh | 10 +- tools/test/perform/build_h5perf_serial_alone.sh | 10 +- tools/test/perform/chunk.c | 10 +- tools/test/perform/gen_report.pl | 10 +- tools/test/perform/iopipe.c | 10 +- tools/test/perform/overhead.c | 10 +- tools/test/perform/perf.c | 10 +- tools/test/perform/perf_meta.c | 10 +- tools/test/perform/pio_engine.c | 10 +- tools/test/perform/pio_perf.c | 10 +- tools/test/perform/pio_perf.h | 10 +- tools/test/perform/pio_standalone.c | 10 +- tools/test/perform/pio_standalone.h | 10 +- tools/test/perform/sio_engine.c | 10 +- tools/test/perform/sio_perf.c | 10 +- tools/test/perform/sio_perf.h | 10 +- tools/test/perform/sio_standalone.c | 10 +- tools/test/perform/sio_standalone.h | 10 +- tools/test/perform/zip_perf.c | 10 +- 1530 files changed, 22220 insertions(+), 8768 deletions(-) create mode 100644 release_docs/HISTORY-1_10.txt create mode 100644 release_docs/HISTORY-1_8.txt create mode 100644 release_docs/HISTORY-1_8_0-1_10_0.txt delete mode 100644 release_docs/HISTORY-1_9.txt diff --git a/.autom4te.cfg b/.autom4te.cfg index 7b4dd6b..e7c2ec1 100644 --- a/.autom4te.cfg +++ b/.autom4te.cfg @@ -4,12 +4,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ------------------ ## ## User Preferences. ## diff --git a/.h5chkright.ini b/.h5chkright.ini index 10daeaf..1010dce 100644 --- a/.h5chkright.ini +++ b/.h5chkright.ini @@ -4,12 +4,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # Initialization files for the Copyright Checker, chkcopyright. # Each line is a keyword for action and the rest are values. diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 700ef15..9b66d95 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# include (ExternalProject) #option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT SVN TGZ)" "NO") diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 37f3f70..70638d6 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# include (CMakePackageConfigHelpers) #----------------------------------------------------------------------------- diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 3f5f380..8a20eb4 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ## This file should be placed in the root directory of your project. ## Then modify the CMakeLists.txt file in the root directory of your ## project to incorporate the testing dashboard. diff --git a/MANIFEST b/MANIFEST index 27781b8..35d3c2e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # #------------------------------------------------------------------------------ # This is the list of files that are part of HDF5 source distribution. @@ -433,7 +431,9 @@ ./release_docs/COPYING ./release_docs/HISTORY-1_0-1_8_0_rc3.txt -./release_docs/HISTORY-1_9.txt +./release_docs/HISTORY-1_8.txt +./release_docs/HISTORY-1_10.txt +./release_docs/HISTORY-1_8_0-1_10_0.txt ./release_docs/INSTALL ./release_docs/INSTALL_CMake.txt ./release_docs/INSTALL_Cygwin.txt diff --git a/Makefile.am b/Makefile.am index bbab346..e3e5e3d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/Makefile.dist b/Makefile.dist index e38af21..9edb476 100644 --- a/Makefile.dist +++ b/Makefile.dist @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This Makefile is a stub (copied from Makefile.dist) which will run # configure and then invoke the same target in the new Makefile created diff --git a/UserMacros.cmake b/UserMacros.cmake index 01e76ed..c578c91 100644 --- a/UserMacros.cmake +++ b/UserMacros.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ######################################################## # Include file for user options ######################################################## diff --git a/acsite.m4 b/acsite.m4 index b144962..9d04d1a 100644 --- a/acsite.m4 +++ b/acsite.m4 @@ -1,17 +1,16 @@ dnl ------------------------------------------------------------------------- dnl ------------------------------------------------------------------------- dnl +dnl Copyright by The HDF Group. dnl Copyright by the Board of Trustees of the University of Illinois. dnl All rights reserved. dnl dnl This file is part of HDF5. The full HDF5 copyright notice, including dnl terms governing use, modification, and redistribution, is contained in -dnl the files COPYING and Copyright.html. COPYING can be found at the root -dnl of the source code distribution tree; Copyright.html can be found at the -dnl root level of an installed copy of the electronic HDF5 document set and -dnl is linked from the top-level documents page. It can also be found at -dnl http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have -dnl access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. +dnl the COPYING file, which can be found at the root of the source code +dnl dnl distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +dnl dnl If you do not have access to either file, you may request a copy from +dnl dnl help@hdfgroup.org. dnl dnl Macros for HDF5 Fortran dnl diff --git a/autogen.sh b/autogen.sh index 33779d4..3d33c06 100755 --- a/autogen.sh +++ b/autogen.sh @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic document set and is -# linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access -# to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # A script to reconfigure autotools for HDF5, and to recreate other diff --git a/bin/COPYING b/bin/COPYING index 6903daf..6497ace 100755 --- a/bin/COPYING +++ b/bin/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/bin/bbrelease b/bin/bbrelease index b06b243..395b23c 100755 --- a/bin/bbrelease +++ b/bin/bbrelease @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Make a release of hdf5. diff --git a/bin/buildhdf5 b/bin/buildhdf5 index 3a4b0d3..064000a 100755 --- a/bin/buildhdf5 +++ b/bin/buildhdf5 @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Build HDF5 library by doing configure, make, and tests. # Usage: See USAGE() diff --git a/bin/checkapi b/bin/checkapi index b4a08e8..6882dea 100755 --- a/bin/checkapi +++ b/bin/checkapi @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # require 5.003; diff --git a/bin/checkposix b/bin/checkposix index db47ff3..7ab741c 100755 --- a/bin/checkposix +++ b/bin/checkposix @@ -8,12 +8,10 @@ require 5.003; # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Robb Matzke, matzke@llnl.gov # 30 Aug 1997 diff --git a/bin/chkconfigure b/bin/chkconfigure index abafae8..d03f421 100755 --- a/bin/chkconfigure +++ b/bin/chkconfigure @@ -5,14 +5,12 @@ ## ## This file is part of HDF5. The full HDF5 copyright notice, including ## terms governing use, modification, and redistribution, is contained in -## the files COPYING and Copyright.html. COPYING can be found at the root -## of the source code distribution tree; Copyright.html can be found at the -## root level of an installed copy of the electronic HDF5 document set and -## is linked from the top-level documents page. It can also be found at -## http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have -## access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. +## the COPYING file, which can be found at the root of the source code +## distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +## If you do not have access to either file, you may request a copy from +## help@hdfgroup.org. ## -# Check that all the configure files are properly genernated. +# Check that all the configure files are properly generated. # # Programmer: Albert Cheng # Created Date: 2004/12/07 diff --git a/bin/chkcopyright b/bin/chkcopyright index f6e910d..d67e030 100755 --- a/bin/chkcopyright +++ b/bin/chkcopyright @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Check Copyright notice. diff --git a/bin/chkmanifest b/bin/chkmanifest index a01217d..95eb8f0 100755 --- a/bin/chkmanifest +++ b/bin/chkmanifest @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Check that all the files in MANIFEST exist and (if this is a diff --git a/bin/debug-ohdr b/bin/debug-ohdr index 170919a..5b0a4b3 100755 --- a/bin/debug-ohdr +++ b/bin/debug-ohdr @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # require 5.003; diff --git a/bin/dependencies b/bin/dependencies index a82a3ee..82247da 100755 --- a/bin/dependencies +++ b/bin/dependencies @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # my $depend_file; my $new_depend_file; diff --git a/bin/deploy b/bin/deploy index ef30d21..73f4b25 100755 --- a/bin/deploy +++ b/bin/deploy @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Deploy the HDF5 binary. # diff --git a/bin/distdep b/bin/distdep index 0a22bd1..4643700 100755 --- a/bin/distdep +++ b/bin/distdep @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Usage: $0 [<].depend diff --git a/bin/errors b/bin/errors index 6ce997b..3c99fdc 100755 --- a/bin/errors +++ b/bin/errors @@ -11,12 +11,10 @@ use Text::Tabs; # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Robb Matzke, matzke@llnl.gov # 30 Aug 1997 diff --git a/bin/gcov_script b/bin/gcov_script index ac82189..9a6512d 100755 --- a/bin/gcov_script +++ b/bin/gcov_script @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # A script to generate coverage files for HDF5 using gcov. # Configures, builds, and runs tests in-place; the output files will be placed diff --git a/bin/genparser b/bin/genparser index 71a8ae2..8cf6ec2 100755 --- a/bin/genparser +++ b/bin/genparser @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic document set and is -# linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access -# to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This script runs flex/lex and bison/yacc to generate parser code for diff --git a/bin/h5vers b/bin/h5vers index d564d47..5228903 100755 --- a/bin/h5vers +++ b/bin/h5vers @@ -12,12 +12,10 @@ use strict; # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Robb Matzke # 17 July 1998 diff --git a/bin/iostats b/bin/iostats index f57c0d0..f054b9c 100755 --- a/bin/iostats +++ b/bin/iostats @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Usage: pipe the output of Linux's `strace' program into the stdin of diff --git a/bin/locate_sw b/bin/locate_sw index c9a7924..bab7bd2 100755 --- a/bin/locate_sw +++ b/bin/locate_sw @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Try to locate the software as named in argument. diff --git a/bin/make_err b/bin/make_err index 1b39d53fb..bfe8861 100755 --- a/bin/make_err +++ b/bin/make_err @@ -9,12 +9,10 @@ $indent=4; # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Create error headers @@ -38,12 +36,10 @@ sub print_copyright ($) { print $fh " * *\n"; print $fh " * This file is part of HDF5. The full HDF5 copyright notice, including *\n"; print $fh " * terms governing use, modification, and redistribution, is contained in *\n"; - print $fh " * the files COPYING and Copyright.html. COPYING can be found at the root *\n"; - print $fh " * of the source code distribution tree; Copyright.html can be found at the *\n"; - print $fh " * root level of an installed copy of the electronic HDF5 document set and *\n"; - print $fh " * is linked from the top-level documents page. It can also be found at *\n"; - print $fh " * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *\n"; - print $fh " * access to either file, you may request a copy from help\@hdfgroup.org. *\n"; + print $fh " * the COPYING file, which can be found at the root of the source code *\n"; + print $fh " * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *\n"; + print $fh " * If you do not have access to either file, you may request a copy from *\n"; + print $fh " * help\@hdfgroup.org. *\n"; print $fh " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n"; } diff --git a/bin/make_overflow b/bin/make_overflow index ced486a..ccd640e 100755 --- a/bin/make_overflow +++ b/bin/make_overflow @@ -14,12 +14,10 @@ my @ctypes = ( () ); # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Create assignment overflow #ifdefs @@ -67,12 +65,10 @@ sub print_copyright ($) { print $fh " * *\n"; print $fh " * This file is part of HDF5. The full HDF5 copyright notice, including *\n"; print $fh " * terms governing use, modification, and redistribution, is contained in *\n"; - print $fh " * the files COPYING and Copyright.html. COPYING can be found at the root *\n"; - print $fh " * of the source code distribution tree; Copyright.html can be found at the *\n"; - print $fh " * root level of an installed copy of the electronic HDF5 document set and *\n"; - print $fh " * is linked from the top-level documents page. It can also be found at *\n"; - print $fh " * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *\n"; - print $fh " * access to either file, you may request a copy from help\@hdfgroup.org. *\n"; + print $fh " * the COPYING file, which can be found at the root of the source code *\n"; + print $fh " * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *\n"; + print $fh " * If you do not have access to either file, you may request a copy from *\n"; + print $fh " * help\@hdfgroup.org. *\n"; print $fh " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n"; } diff --git a/bin/make_vers b/bin/make_vers index 0bc3b62..7e7fba1 100755 --- a/bin/make_vers +++ b/bin/make_vers @@ -23,12 +23,10 @@ $indent = 2; # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Create public symbol version headers @@ -52,12 +50,10 @@ sub print_copyright ($) { print $fh " * *\n"; print $fh " * This file is part of HDF5. The full HDF5 copyright notice, including *\n"; print $fh " * terms governing use, modification, and redistribution, is contained in *\n"; - print $fh " * the files COPYING and Copyright.html. COPYING can be found at the root *\n"; - print $fh " * of the source code distribution tree; Copyright.html can be found at the *\n"; - print $fh " * root level of an installed copy of the electronic HDF5 document set and *\n"; - print $fh " * is linked from the top-level documents page. It can also be found at *\n"; - print $fh " * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *\n"; - print $fh " * access to either file, you may request a copy from help\@hdfgroup.org. *\n"; + print $fh " * the COPYING file, which can be found at the root of the source code *\n"; + print $fh " * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *\n"; + print $fh " * If you do not have access to either file, you may request a copy from *\n"; + print $fh " * help\@hdfgroup.org. *\n"; print $fh " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n"; } diff --git a/bin/mkdirs b/bin/mkdirs index 694a754..43972b6 100755 --- a/bin/mkdirs +++ b/bin/mkdirs @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This is a small program which will create directories n-levels deep. # You just call it with something like: diff --git a/bin/newer b/bin/newer index 8ed9f87..8083cae 100755 --- a/bin/newer +++ b/bin/newer @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Compare the modification time of file argument 1 against other file arguments. # Return true (0) if argument 1 is newer than all others, otherwise return diff --git a/bin/output_filter.sh b/bin/output_filter.sh index 35af819..fb59dfd 100644 --- a/bin/output_filter.sh +++ b/bin/output_filter.sh @@ -3,12 +3,10 @@ ## ## This file is part of HDF5. The full HDF5 copyright notice, including ## terms governing use, modification, and redistribution, is contained in -## the files COPYING and Copyright.html. COPYING can be found at the root -## of the source code distribution tree; Copyright.html can be found at the -## root level of an installed copy of the electronic HDF5 document set and -## is linked from the top-level documents page. It can also be found at -## http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -## access to either file, you may request a copy from help@hdfgroup.org. +## the COPYING file, which can be found at the root of the source code +## distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +## If you do not have access to either file, you may request a copy from +## help@hdfgroup.org. # This contains function definitions of output filtering. # This file should only be sourced in by another shell script. diff --git a/bin/pkgscrpts/h5rmflags b/bin/pkgscrpts/h5rmflags index 32b8090..099956c 100755 --- a/bin/pkgscrpts/h5rmflags +++ b/bin/pkgscrpts/h5rmflags @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # ## Remove paths to libraries used to build HDF5 when packaging HDF5 diff --git a/bin/pkgscrpts/makeHDF5BinaryTarfiles.pl b/bin/pkgscrpts/makeHDF5BinaryTarfiles.pl index 32b3049..f4a9ebd 100755 --- a/bin/pkgscrpts/makeHDF5BinaryTarfiles.pl +++ b/bin/pkgscrpts/makeHDF5BinaryTarfiles.pl @@ -7,12 +7,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # # diff --git a/bin/release b/bin/release index 352384f..09c033d 100755 --- a/bin/release +++ b/bin/release @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Make a release of hdf5. diff --git a/bin/restore.sh b/bin/restore.sh index 7f1c7bb..60ac661 100755 --- a/bin/restore.sh +++ b/bin/restore.sh @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic document set and is -# linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access -# to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # A script to clean up the action of autogen.sh diff --git a/bin/runtest b/bin/runtest index 4356db3..2611f09 100755 --- a/bin/runtest +++ b/bin/runtest @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # run the hdf5/bin/snapshot diff --git a/bin/snapshot b/bin/snapshot index cc4bbc9..5c78fc8 100755 --- a/bin/snapshot +++ b/bin/snapshot @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This script should be run nightly from cron. It checks out the source # from the source repository and compares it against the previous diff --git a/bin/snapshot_version b/bin/snapshot_version index 86f7142..8aad05d 100644 --- a/bin/snapshot_version +++ b/bin/snapshot_version @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # default version for snapshot test diff --git a/bin/switch_maint_mode b/bin/switch_maint_mode index 2b62545..fb1568b 100755 --- a/bin/switch_maint_mode +++ b/bin/switch_maint_mode @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Switch AM_MAINTAINER_MODE value in configure.ac # Usage: See USAGE() diff --git a/bin/timekeeper b/bin/timekeeper index 7c50759..14adf2c 100755 --- a/bin/timekeeper +++ b/bin/timekeeper @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## # As a time keeper of the remote daily test process launched by runtest. # It sleeps for a certain time and then wakes up to hangup those processes diff --git a/bin/trace b/bin/trace index ede344c..3f532ab 100755 --- a/bin/trace +++ b/bin/trace @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## require 5.003; $Source = ""; diff --git a/bin/yodconfigure b/bin/yodconfigure index 2bc67e2..44d7d99 100755 --- a/bin/yodconfigure +++ b/bin/yodconfigure @@ -1,16 +1,15 @@ #!/bin/sh # +# Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Fix configure file so that it can launch configure testing executable # via the proper launching command, e.g., yod. (Thus the name yodconfigure diff --git a/c++/COPYING b/c++/COPYING index 6903daf..6497ace 100644 --- a/c++/COPYING +++ b/c++/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/c++/Makefile.am b/c++/Makefile.am index 416060a..94fbefc 100644 --- a/c++/Makefile.am +++ b/c++/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index 8b5c6b9..264a7e7 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/c++/examples/Makefile.am b/c++/examples/Makefile.am index 2408217..51ab8e3 100644 --- a/c++/examples/Makefile.am +++ b/c++/examples/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp index 57b23fd..836c86d 100644 --- a/c++/examples/chunks.cpp +++ b/c++/examples/chunks.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp index 7e14244..2636d8e 100644 --- a/c++/examples/compound.cpp +++ b/c++/examples/compound.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/create.cpp b/c++/examples/create.cpp index 1930987..d4500f9 100644 --- a/c++/examples/create.cpp +++ b/c++/examples/create.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp index f3f9a90..0ecad1f 100644 --- a/c++/examples/extend_ds.cpp +++ b/c++/examples/extend_ds.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp index 58ee44d..3e3ab4d 100644 --- a/c++/examples/h5group.cpp +++ b/c++/examples/h5group.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_cmprss.cpp b/c++/examples/h5tutr_cmprss.cpp index 5460191..ee2c544 100644 --- a/c++/examples/h5tutr_cmprss.cpp +++ b/c++/examples/h5tutr_cmprss.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_crtatt.cpp b/c++/examples/h5tutr_crtatt.cpp index a53bb1c..db34353 100644 --- a/c++/examples/h5tutr_crtatt.cpp +++ b/c++/examples/h5tutr_crtatt.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_crtdat.cpp b/c++/examples/h5tutr_crtdat.cpp index b50b659..e36a215 100644 --- a/c++/examples/h5tutr_crtdat.cpp +++ b/c++/examples/h5tutr_crtdat.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_crtgrp.cpp b/c++/examples/h5tutr_crtgrp.cpp index 41bbf1b..5462cbf 100644 --- a/c++/examples/h5tutr_crtgrp.cpp +++ b/c++/examples/h5tutr_crtgrp.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_crtgrpar.cpp b/c++/examples/h5tutr_crtgrpar.cpp index a050e3c..93bd08d 100644 --- a/c++/examples/h5tutr_crtgrpar.cpp +++ b/c++/examples/h5tutr_crtgrpar.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_crtgrpd.cpp b/c++/examples/h5tutr_crtgrpd.cpp index 12de485..96805a7 100644 --- a/c++/examples/h5tutr_crtgrpd.cpp +++ b/c++/examples/h5tutr_crtgrpd.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_extend.cpp b/c++/examples/h5tutr_extend.cpp index 8f80266..703068a 100644 --- a/c++/examples/h5tutr_extend.cpp +++ b/c++/examples/h5tutr_extend.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_rdwt.cpp b/c++/examples/h5tutr_rdwt.cpp index 5c83dcb..5ab7ccc 100644 --- a/c++/examples/h5tutr_rdwt.cpp +++ b/c++/examples/h5tutr_rdwt.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/h5tutr_subset.cpp b/c++/examples/h5tutr_subset.cpp index bf57713..9ba2104 100644 --- a/c++/examples/h5tutr_subset.cpp +++ b/c++/examples/h5tutr_subset.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp index 74b02f9..fd88776 100644 --- a/c++/examples/readdata.cpp +++ b/c++/examples/readdata.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // diff --git a/c++/examples/run-c++-ex.sh.in b/c++/examples/run-c++-ex.sh.in index eae2782..f0d3e93 100644 --- a/c++/examples/run-c++-ex.sh.in +++ b/c++/examples/run-c++-ex.sh.in @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file: run-c++-ex.sh diff --git a/c++/examples/testh5c++.sh.in b/c++/examples/testh5c++.sh.in index 40d503f..42cb0df 100644 --- a/c++/examples/testh5c++.sh.in +++ b/c++/examples/testh5c++.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5c++ compiler tool # Created: Albert Cheng, 2007/3/14 diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp index c3a5f48..e14e578 100644 --- a/c++/examples/writedata.cpp +++ b/c++/examples/writedata.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index 621578e..b900b90 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index f0859c8..73a18b8 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __AbstractDs_H diff --git a/c++/src/H5Alltypes.h b/c++/src/H5Alltypes.h index df7213a..d67f3fe 100644 --- a/c++/src/H5Alltypes.h +++ b/c++/src/H5Alltypes.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // This header file simply serves as a container to hold the diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index c8bd0fc..9d4a973 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index dd9db51..ffb8712 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5ArrayType_H diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 0dc2b1e..9fe7608 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index f4c70fd..0be3cb5 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5AtomType_H diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index c506906..cbf3029 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 6d6df2c..41e74d9 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Attribute_H diff --git a/c++/src/H5Classes.h b/c++/src/H5Classes.h index 00066fe..f0f6359 100644 --- a/c++/src/H5Classes.h +++ b/c++/src/H5Classes.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Classes_H diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index f3390aa..c9c203a 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 0c7b799..3cbad76 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __CommonFG_H diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 7db2cfe..f7862c9 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 042b59f..018d875 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5CompType_H diff --git a/c++/src/H5Cpp.h b/c++/src/H5Cpp.h index b86e0f3..09914e8 100644 --- a/c++/src/H5Cpp.h +++ b/c++/src/H5Cpp.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Cpp_H diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index afc6ebf..543f49b 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5CppDoc_H diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index a0db328..dd2fd21 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index f9e29ff..2f3eebe 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5DataSet_H diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 2587a72..49b8ea3 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 281e865..c0a1d2b 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5DataSpace_H diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 2795485..57f9361 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index c2ea2a3..32a79fa 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5DataType_H diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 966ca16..67e4a1c 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index f0475eb..5d5714a 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5DSCreatPropList_H diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index e018ff2..4c767cb 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 39d3ba8..4a38bd0 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5DSetMemXferPropList_H diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 9072aab..a96239c 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index cd93eb5..fc8089e 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5EnumType_H diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 0316f64..c9a1323 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 2e68cf0..2cc2dd6 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Exception_H diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index 1ab812c..b414294 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 8e488e5..2563163 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5FileAccPropList_H diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index b3e6b7b..9674c0a 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 6beac02..da620d4 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5FileCreatPropList_H diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index bea4612..3a0b54d 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5File.h b/c++/src/H5File.h index df5cca6..b428a40 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5File_H diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index f573add..6bb3fd6 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index 8affa1a..e84f50b 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5FloatType_H diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 66e2339..994d9ff 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index c8b2961..a7e1f7c 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __Group_H diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 122479f..f9a08cd 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index 0603e5c..baf939e 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __IdComponent_H diff --git a/c++/src/H5Include.h b/c++/src/H5Include.h index ba82d78..a180430 100644 --- a/c++/src/H5Include.h +++ b/c++/src/H5Include.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 3aadcab..fb7e476 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index 1ce05c8..82a7cfd 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5IntType_H diff --git a/c++/src/H5LaccProp.cpp b/c++/src/H5LaccProp.cpp index e457e83..1267286 100644 --- a/c++/src/H5LaccProp.cpp +++ b/c++/src/H5LaccProp.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h index f31c3fc..9772cde 100644 --- a/c++/src/H5LaccProp.h +++ b/c++/src/H5LaccProp.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // Class LinkAccPropList represents the HDF5 file access property list and diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index dc453b7..9293622 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 76b5f82..9b4150e 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Library_H diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 79b353a..e820b0d 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 48fc2b1..a57d3ed 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Location_H diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 359fab2..865d04f 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 53f183e..fdaead2 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5Object_H diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index 9a3af7e..ec6c08e 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index c9c245a..878c67a 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5ObjCreatPropList_H diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 03327c8..53d525c 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 2fd8a6b..2ffc87f 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5PredType_H diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index 0df0a9f..dd7b21a 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 772e96c..154d7b2 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5PropList_H diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index db1cf04..d5fb744 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index aa87bba..abac8de 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5StrType_H diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 64029cc..22e1a66 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index 4dc0eb5..4048a4e 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __H5VarLenType_H diff --git a/c++/src/Makefile.am b/c++/src/Makefile.am index 6274f7b..efe17dc 100644 --- a/c++/src/Makefile.am +++ b/c++/src/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in index 7f3c3ce..00502d9 100644 --- a/c++/src/h5c++.in +++ b/c++/src/h5c++.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # ############################################################################ diff --git a/c++/src/header.html b/c++/src/header.html index c3018d7..cb42565 100644 --- a/c++/src/header.html +++ b/c++/src/header.html @@ -12,12 +12,10 @@ xmlns="http://www.w3.org/TR/REC-html40"> * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index d23a80b..6de801e 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# HDFTEST_COPY_FILE("${HDF5_CPP_TEST_SOURCE_DIR}/th5s.h5" "${PROJECT_BINARY_DIR}/th5s.h5" "cpp_testhdf5_files") add_custom_target(cpp_testhdf5_files ALL COMMENT "Copying files needed by cpp_testhdf5 tests" DEPENDS ${cpp_testhdf5_files_list}) diff --git a/c++/test/H5srcdir_str.h.in b/c++/test/H5srcdir_str.h.in index d472124..bab1df3 100644 --- a/c++/test/H5srcdir_str.h.in +++ b/c++/test/H5srcdir_str.h.in @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* If you are reading this file and it has a '.h' suffix, it was automatically diff --git a/c++/test/Makefile.am b/c++/test/Makefile.am index da0a864..0fc17fc 100644 --- a/c++/test/Makefile.am +++ b/c++/test/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 970f210..a765fb1 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index cf7fc2c..f0c403c 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index 7f92e60..18fd44f 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index 490772f..a1de9c5 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 0fcaf09..d1a0d67 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index ee634c2..3af78c5 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp index f39694b..4aaa93a 100644 --- a/c++/test/tdspl.cpp +++ b/c++/test/tdspl.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp index 779c931..a2a0867 100644 --- a/c++/test/testhdf5.cpp +++ b/c++/test/testhdf5.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index 715bb30..51682a3 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 19f5b5a..5de6590 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index a3aafb3..e99ce99 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index 34e6892..f75d92e 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 0bf6ebf..dc592b3 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index 3c9c1b0..d9f4075 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index c232809..9074154 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index fee4115..f76f780 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index 859867b..d5fea07 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** diff --git a/config/BlankForm b/config/BlankForm index 31116bf..a452f92 100644 --- a/config/BlankForm +++ b/config/BlankForm @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/COPYING b/config/COPYING index 6903daf..6497ace 100644 --- a/config/COPYING +++ b/config/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/config/Makefile.am.blank b/config/Makefile.am.blank index a54c734..b01735b 100644 --- a/config/Makefile.am.blank +++ b/config/Makefile.am.blank @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am diff --git a/config/apple b/config/apple index 5203695..0b15dfe 100644 --- a/config/apple +++ b/config/apple @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/cce-fflags b/config/cce-fflags index 233f9ff..9a1c685 100644 --- a/config/cce-fflags +++ b/config/cce-fflags @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/cce-flags b/config/cce-flags index 8f3b2dc..acab73c 100644 --- a/config/cce-flags +++ b/config/cce-flags @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index d5d96bb..7aff076 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000) # Allow full output to go to CDash set to 0 SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 50000) diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake index d53d7a4..a3779d6 100755 --- a/config/cmake/CTestScript.cmake +++ b/config/cmake/CTestScript.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ######################################################## # For any comments please contact cdashhelp@hdfgroup.org diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 78b4d03..0848e66 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# #----------------------------------------------------------------------------- # Include all the necessary files for macros #----------------------------------------------------------------------------- diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c index b8946a8..082dbd4 100644 --- a/config/cmake/ConversionTests.c +++ b/config/cmake/ConversionTests.c @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef H5_LDOUBLE_TO_LONG_SPECIAL_TEST #include diff --git a/config/cmake/FindHDFJAVA.cmake.in b/config/cmake/FindHDFJAVA.cmake.in index 25057e6..ed2b8c2 100644 --- a/config/cmake/FindHDFJAVA.cmake.in +++ b/config/cmake/FindHDFJAVA.cmake.in @@ -1,4 +1,15 @@ # +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +# # To be used by projects that make use of CMakeified hdf-java # diff --git a/config/cmake/H5cxx_config.h.in b/config/cmake/H5cxx_config.h.in index c4e1c03..82e85c6 100644 --- a/config/cmake/H5cxx_config.h.in +++ b/config/cmake/H5cxx_config.h.in @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* src/H5cxx_config.h.in Created manually. */ /* Define if offsetof extension is present */ diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 55de8f8..8c01dba 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* H5pubconf.h Generated By CMake during the configuration */ #ifndef H5_CONFIG_H_ diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 6aa5e1f..33d3a40 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 747e043..f08349e 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# #------------------------------------------------------------------------------- macro (H5_SET_LIB_OPTIONS libtarget libname libtype) set (LIB_OUT_NAME "${libname}") diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index a419950..3152aaa 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ## Check for non-standard extenstion quadmath.h diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 2567bd8..6918bb3 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake index a8f0c8e..386e99c 100755 --- a/config/cmake/HDF5_Examples_options.cmake +++ b/config/cmake/HDF5_Examples_options.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################################# #### Change default configuration of options in config/cmake/cacheinit.cmake file ### #### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### diff --git a/config/cmake/HDF5_Process_Flex_Files.cmake b/config/cmake/HDF5_Process_Flex_Files.cmake index 667ad31..2595c39 100644 --- a/config/cmake/HDF5_Process_Flex_Files.cmake +++ b/config/cmake/HDF5_Process_Flex_Files.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# # post process flex/bison files message (STATUS "File: ${GEN_DIR} ${FILE_PARSE} ${FILE_ANALYZE}") diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 238e363..5f71f33 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# #----------------------------------------------------------------------------- # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index 216a014..b6cc513 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ######################################################## # Include file for user options ######################################################## diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 5901a78..c923283 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# # This is the CMakeCache file. ######################## diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index ad1b96d..8e16725 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# #----------------------------------------------------------------------------- # HDF5 Version file for install directory #----------------------------------------------------------------------------- diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index 6dffa6c..c54391f 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# #----------------------------------------------------------------------------- # HDF5 Config file for compiling against hdf5 build/install directory #----------------------------------------------------------------------------- diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 67b42fb..7af0590 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# # runTest.cmake executes a command and captures the output in a file. File is then compared # against a reference file. Exit status of command can also be compared. cmake_policy(SET CMP0007 NEW) diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 7dee5b5..1f60a01 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# # This is the CMakeCache file. ######################## diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index cb92933..3cb9a5e 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ######################################################## # This dashboard is maintained by The HDF Group diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 239d517..e500f14 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################################# ### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### ### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ### diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index bbbb8dc..b090434 100755 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################################# #### Change default configuration of options in config/cmake/cacheinit.cmake file ### #### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 5095b33..9af7e5b 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# # userblockTest.cmake executes a command and captures the output in a file. File is then compared # against a reference file. Exit status of command can also be compared. diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index c9b4ecc..67a2566 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# # vfdTest.cmake executes a command and captures the output in a file. Command uses specified VFD. # Exit status of command can also be compared. diff --git a/config/cmake_ext_mod/CheckTypeSize.cmake b/config/cmake_ext_mod/CheckTypeSize.cmake index d217ac5..c14c2f2 100644 --- a/config/cmake_ext_mod/CheckTypeSize.cmake +++ b/config/cmake_ext_mod/CheckTypeSize.cmake @@ -1,4 +1,15 @@ # +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +# # Check if the type exists and determine size of type. if the type # exists, the size will be stored to the variable. # diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index a0ec8e3..56d45f9 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# #----------------------------------------------------------------------------- # Include all the necessary files for macros #----------------------------------------------------------------------------- diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake index bb5f8d6..699be85 100644 --- a/config/cmake_ext_mod/FindSZIP.cmake +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# # - Find SZIP library # - Derived from the FindTiff.cmake that is included with cmake diff --git a/config/cmake_ext_mod/GetTimeOfDayTest.cpp b/config/cmake_ext_mod/GetTimeOfDayTest.cpp index 3b5bf60..5fd7c04 100644 --- a/config/cmake_ext_mod/GetTimeOfDayTest.cpp +++ b/config/cmake_ext_mod/GetTimeOfDayTest.cpp @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #if defined (TRY_SYS_TIME_H) #include /* #include */ diff --git a/config/cmake_ext_mod/HDFCXXTests.cpp b/config/cmake_ext_mod/HDFCXXTests.cpp index f5f6644..1b98092 100644 --- a/config/cmake_ext_mod/HDFCXXTests.cpp +++ b/config/cmake_ext_mod/HDFCXXTests.cpp @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef OLD_HEADER_FILENAME diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 9d50f50..f2e03d7 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# #------------------------------------------------------------------------------- macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) # May need to build JPEG with PIC on x64 machines with gcc diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 3039cfd..48f57e6 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# #------------------------------------------------------------------------------- macro (SET_GLOBAL_VARIABLE name value) set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 648f795..60ac744 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #define SIMPLE_TEST(x) int main(){ x; return 0; } #ifdef HAVE_C99_DESIGNATED_INITIALIZER diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index bf254a1..7bf4d81 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -1,4 +1,15 @@ # +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +# # This file provides functions for Fortran support. # #------------------------------------------------------------------------------- diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index 31c8421..5b0e8fd 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# # grepTest.cmake executes a command and captures the output in a file. File is then compared # against a reference file. Exit status of command can also be compared. diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 9a2236e..3a02614 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# # runTest.cmake executes a command and captures the output in a file. File is then compared # against a reference file. Exit status of command can also be compared. cmake_policy(SET CMP0007 NEW) diff --git a/config/commence.am b/config/commence.am index 1a26a85..5fe21a6 100644 --- a/config/commence.am +++ b/config/commence.am @@ -7,12 +7,10 @@ ## ## This file is part of HDF5. The full HDF5 copyright notice, including ## terms governing use, modification, and redistribution, is contained in -## the files COPYING and Copyright.html. COPYING can be found at the root -## of the source code distribution tree; Copyright.html can be found at the -## root level of an installed copy of the electronic HDF5 document set and -## is linked from the top-level documents page. It can also be found at -## http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -## access to either file, you may request a copy from help@hdfgroup.org. +## the COPYING file, which can be found at the root of the source code +## distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +## If you do not have access to either file, you may request a copy from +## help@hdfgroup.org. ## Textually included in the beginning of every HDF5 Makefile.am diff --git a/config/conclude.am b/config/conclude.am index cad55a3..55b805a 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -7,12 +7,10 @@ ## ## This file is part of HDF5. The full HDF5 copyright notice, including ## terms governing use, modification, and redistribution, is contained in -## the files COPYING and Copyright.html. COPYING can be found at the root -## of the source code distribution tree; Copyright.html can be found at the -## root level of an installed copy of the electronic HDF5 document set and -## is linked from the top-level documents page. It can also be found at -## http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -## access to either file, you may request a copy from help@hdfgroup.org. +## the COPYING file, which can be found at the root of the source code +## distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +## If you do not have access to either file, you may request a copy from +## help@hdfgroup.org. ## Textually included at the end of most HDF5 Makefiles.am. diff --git a/config/conclude_fc.am b/config/conclude_fc.am index 6402412..15d04a7 100644 --- a/config/conclude_fc.am +++ b/config/conclude_fc.am @@ -7,12 +7,10 @@ ## ## This file is part of HDF5. The full HDF5 copyright notice, including ## terms governing use, modification, and redistribution, is contained in -## the files COPYING and Copyright.html. COPYING can be found at the root -## of the source code distribution tree; Copyright.html can be found at the -## root level of an installed copy of the electronic HDF5 document set and -## is linked from the top-level documents page. It can also be found at -## http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -## access to either file, you may request a copy from help@hdfgroup.org. +## the COPYING file, which can be found at the root of the source code +## distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +## If you do not have access to either file, you may request a copy from +## help@hdfgroup.org. ## Textually included at the end of the Fortran HDF5 Makefiles.am. diff --git a/config/cygwin b/config/cygwin index 7423403..6ead871 100644 --- a/config/cygwin +++ b/config/cygwin @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/examples.am b/config/examples.am index 8597a16..247dfa8 100644 --- a/config/examples.am +++ b/config/examples.am @@ -7,12 +7,10 @@ ## ## This file is part of HDF5. The full HDF5 copyright notice, including ## terms governing use, modification, and redistribution, is contained in -## the files COPYING and Copyright.html. COPYING can be found at the root -## of the source code distribution tree; Copyright.html can be found at the -## root level of an installed copy of the electronic HDF5 document set and -## is linked from the top-level documents page. It can also be found at -## http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -## access to either file, you may request a copy from help@hdfgroup.org. +## the COPYING file, which can be found at the root of the source code +## distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +## If you do not have access to either file, you may request a copy from +## help@hdfgroup.org. ## Textually included near the end of HDF5 Makefiles in example directories. ## Contains boilerplate for building, installing, and cleaning example diff --git a/config/freebsd b/config/freebsd index e42ca60..936c29f 100644 --- a/config/freebsd +++ b/config/freebsd @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index 46fd048..e0f2999 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/gnu-fflags b/config/gnu-fflags index 4585735..e92e054 100644 --- a/config/gnu-fflags +++ b/config/gnu-fflags @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/gnu-flags b/config/gnu-flags index 9565303..44ed480 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/ibm-aix b/config/ibm-aix index ef052fb..805ec34 100644 --- a/config/ibm-aix +++ b/config/ibm-aix @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # Configuration file for building on the IBM AIX platforms. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/ibm-flags b/config/ibm-flags index 412817c..881b81c 100644 --- a/config/ibm-flags +++ b/config/ibm-flags @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/intel-fflags b/config/intel-fflags index db9543e..8b1110e 100644 --- a/config/intel-fflags +++ b/config/intel-fflags @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/intel-flags b/config/intel-flags index ee0d054..dad210c 100644 --- a/config/intel-flags +++ b/config/intel-flags @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/linux-gnu b/config/linux-gnu index 912a93b..243b087 100644 --- a/config/linux-gnu +++ b/config/linux-gnu @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This is the same as linux-gnulibc1 diff --git a/config/linux-gnuaout b/config/linux-gnuaout index 912a93b..243b087 100644 --- a/config/linux-gnuaout +++ b/config/linux-gnuaout @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This is the same as linux-gnulibc1 diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 1b4785e..1785e0e 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/linux-gnulibc2 b/config/linux-gnulibc2 index 76526b8..01a0d20 100644 --- a/config/linux-gnulibc2 +++ b/config/linux-gnulibc2 @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/lt_vers.am b/config/lt_vers.am index eb630a7..fcc2a40 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -7,12 +7,10 @@ ## ## This file is part of HDF5. The full HDF5 copyright notice, including ## terms governing use, modification, and redistribution, is contained in -## the files COPYING and Copyright.html. COPYING can be found at the root -## of the source code distribution tree; Copyright.html can be found at the -## root level of an installed copy of the electronic HDF5 document set and -## is linked from the top-level documents page. It can also be found at -## http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -## access to either file, you may request a copy from help@hdfgroup.org. +## the COPYING file, which can be found at the root of the source code +## distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +## If you do not have access to either file, you may request a copy from +## help@hdfgroup.org. ## # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. @@ -69,19 +67,3 @@ LT_TOOLS_VERS_INTERFACE = 1000 LT_TOOLS_VERS_REVISION = 0 LT_TOOLS_VERS_AGE = 0 - -# Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. - - - diff --git a/config/pgi-fflags b/config/pgi-fflags index 08dfe6e..46f861d 100644 --- a/config/pgi-fflags +++ b/config/pgi-fflags @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/pgi-flags b/config/pgi-flags index f6878e6..52828c1 100644 --- a/config/pgi-flags +++ b/config/pgi-flags @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file should be sourced into configure if the compiler is the diff --git a/config/site-specific/BlankForm b/config/site-specific/BlankForm index c31383c..03d421c 100644 --- a/config/site-specific/BlankForm +++ b/config/site-specific/BlankForm @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/config/solaris b/config/solaris index 72d7423..656fee1 100644 --- a/config/solaris +++ b/config/solaris @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # This file is part of the HDF5 build script. It is processed shortly diff --git a/configure.ac b/configure.ac index ca4d4b6..d0aeda9 100644 --- a/configure.ac +++ b/configure.ac @@ -6,12 +6,10 @@ ## ## This file is part of HDF5. The full HDF5 copyright notice, including ## terms governing use, modification, and redistribution, is contained in -## the files COPYING and Copyright.html. COPYING can be found at the root -## of the source code distribution tree; Copyright.html can be found at the -## root level of an installed copy of the electronic HDF5 document set and -## is linked from the top-level documents page. It can also be found at -## http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -## access to either file, you may request a copy from help@hdfgroup.org. +## the COPYING file, which can be found at the root of the source code +## distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +## If you do not have access to either file, you may request a copy from +## help@hdfgroup.org. ## ---------------------------------------------------------------------- ## Initialize configure. diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 3412b22..dd4766a 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/examples/Makefile.am b/examples/Makefile.am index 883b99d..8c6540f 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c index 0ea0153..335f9c2 100644 --- a/examples/h5_attribute.c +++ b/examples/h5_attribute.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_chunk_read.c b/examples/h5_chunk_read.c index 98b0bb4..c3455f4 100644 --- a/examples/h5_chunk_read.c +++ b/examples/h5_chunk_read.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c index 8d365a3..ebc7712 100644 --- a/examples/h5_cmprss.c +++ b/examples/h5_cmprss.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_compound.c b/examples/h5_compound.c index 3fca2a5..b3b3a4a 100644 --- a/examples/h5_compound.c +++ b/examples/h5_compound.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_crtatt.c b/examples/h5_crtatt.c index 5e1378c..ade17ba 100644 --- a/examples/h5_crtatt.c +++ b/examples/h5_crtatt.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_crtdat.c b/examples/h5_crtdat.c index f9327e7..4a876d2 100644 --- a/examples/h5_crtdat.c +++ b/examples/h5_crtdat.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_crtgrp.c b/examples/h5_crtgrp.c index a626ed8..89bddce 100644 --- a/examples/h5_crtgrp.c +++ b/examples/h5_crtgrp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_crtgrpar.c b/examples/h5_crtgrpar.c index e8cf7c3..6f8c6e8 100644 --- a/examples/h5_crtgrpar.c +++ b/examples/h5_crtgrpar.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_crtgrpd.c b/examples/h5_crtgrpd.c index d6a320b..35c4389 100644 --- a/examples/h5_crtgrpd.c +++ b/examples/h5_crtgrpd.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_drivers.c b/examples/h5_drivers.c index 7245794..43c1fc7 100644 --- a/examples/h5_drivers.c +++ b/examples/h5_drivers.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_dtransform.c b/examples/h5_dtransform.c index 71ec10a..0b718ad 100644 --- a/examples/h5_dtransform.c +++ b/examples/h5_dtransform.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_elink_unix2win.c b/examples/h5_elink_unix2win.c index 9c0918c..df52015 100644 --- a/examples/h5_elink_unix2win.c +++ b/examples/h5_elink_unix2win.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* This program demonstrates how to translate an external link created on diff --git a/examples/h5_extend.c b/examples/h5_extend.c index 105e553..6e3cff2 100644 --- a/examples/h5_extend.c +++ b/examples/h5_extend.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_extend_write.c b/examples/h5_extend_write.c index 56bd025..f3f6077 100644 --- a/examples/h5_extend_write.c +++ b/examples/h5_extend_write.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_extlink.c b/examples/h5_extlink.c index e8a24b8..ba632f5 100644 --- a/examples/h5_extlink.c +++ b/examples/h5_extlink.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* This program demonstrates how to create and use "external links" in diff --git a/examples/h5_group.c b/examples/h5_group.c index 6b73210..8e89165 100644 --- a/examples/h5_group.c +++ b/examples/h5_group.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_interm_group.c b/examples/h5_interm_group.c index bd9c7c4..6507fd1 100644 --- a/examples/h5_interm_group.c +++ b/examples/h5_interm_group.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_mount.c b/examples/h5_mount.c index 6da71a1..a2e16c5 100644 --- a/examples/h5_mount.c +++ b/examples/h5_mount.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_rdwt.c b/examples/h5_rdwt.c index 0e290ca..6cd7f0f 100644 --- a/examples/h5_rdwt.c +++ b/examples/h5_rdwt.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_read.c b/examples/h5_read.c index 6fe75be..7fd8ad4 100644 --- a/examples/h5_read.c +++ b/examples/h5_read.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_ref2reg.c b/examples/h5_ref2reg.c index c4e8d3d..dc2964c 100644 --- a/examples/h5_ref2reg.c +++ b/examples/h5_ref2reg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* This program shows how to create, store and dereference references diff --git a/examples/h5_reference.c b/examples/h5_reference.c index 38e6146..32a5f59 100644 --- a/examples/h5_reference.c +++ b/examples/h5_reference.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_select.c b/examples/h5_select.c index ceb9c2c..bbc877c 100644 --- a/examples/h5_select.c +++ b/examples/h5_select.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_shared_mesg.c b/examples/h5_shared_mesg.c index 0c7f2f0..4e1f92a 100644 --- a/examples/h5_shared_mesg.c +++ b/examples/h5_shared_mesg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_subset.c b/examples/h5_subset.c index 66872ea..904d3f8 100644 --- a/examples/h5_subset.c +++ b/examples/h5_subset.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/h5_vds-eiger.c b/examples/h5_vds-eiger.c index ea22243..13b5d93 100644 --- a/examples/h5_vds-eiger.c +++ b/examples/h5_vds-eiger.c @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ This example illustrates the concept of the virtual dataset. diff --git a/examples/h5_vds-exc.c b/examples/h5_vds-exc.c index 039cdb8..aaf1fa8 100644 --- a/examples/h5_vds-exc.c +++ b/examples/h5_vds-exc.c @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ This example illustrates the concept of the virtual dataset. diff --git a/examples/h5_vds-exclim.c b/examples/h5_vds-exclim.c index 4933471..fea096a 100644 --- a/examples/h5_vds-exclim.c +++ b/examples/h5_vds-exclim.c @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ This example illustrates the concept of the virtual dataset. diff --git a/examples/h5_vds-percival-unlim-maxmin.c b/examples/h5_vds-percival-unlim-maxmin.c index a6eecfb..0273bbc 100644 --- a/examples/h5_vds-percival-unlim-maxmin.c +++ b/examples/h5_vds-percival-unlim-maxmin.c @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ This example illustrates the concept of the virtual dataset. diff --git a/examples/h5_vds-percival-unlim.c b/examples/h5_vds-percival-unlim.c index 2496c37..f6a5f50 100644 --- a/examples/h5_vds-percival-unlim.c +++ b/examples/h5_vds-percival-unlim.c @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ This example illustrates the concept of the virtual dataset. diff --git a/examples/h5_vds-percival.c b/examples/h5_vds-percival.c index 757bb69..11a974b 100644 --- a/examples/h5_vds-percival.c +++ b/examples/h5_vds-percival.c @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ This example illustrates the concept of the virtual dataset. diff --git a/examples/h5_vds-simpleIO.c b/examples/h5_vds-simpleIO.c index 6b12dc2..56fa72b 100644 --- a/examples/h5_vds-simpleIO.c +++ b/examples/h5_vds-simpleIO.c @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ This example illustrates the concept of virtual dataset I/O diff --git a/examples/h5_vds.c b/examples/h5_vds.c index 1e502c6..76b849a 100644 --- a/examples/h5_vds.c +++ b/examples/h5_vds.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/examples/h5_write.c b/examples/h5_write.c index 93d40ea..1a7cfe7 100644 --- a/examples/h5_write.c +++ b/examples/h5_write.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/ph5example.c b/examples/ph5example.c index 7a41db2..d718479 100644 --- a/examples/ph5example.c +++ b/examples/ph5example.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/examples/run-all-ex.sh b/examples/run-all-ex.sh index 4ff2c55..878e0f8 100755 --- a/examples/run-all-ex.sh +++ b/examples/run-all-ex.sh @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file: run-hl-ex.sh diff --git a/examples/run-c-ex.sh.in b/examples/run-c-ex.sh.in index 1661344..4d5d594 100644 --- a/examples/run-c-ex.sh.in +++ b/examples/run-c-ex.sh.in @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file: run-c-ex.sh diff --git a/examples/testh5cc.sh.in b/examples/testh5cc.sh.in index d3f1cfc..800d4d4 100644 --- a/examples/testh5cc.sh.in +++ b/examples/testh5cc.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5cc compiler tool # Created: Albert Cheng, 2007/4/11 diff --git a/fortran/COPYING b/fortran/COPYING index 6903daf..6497ace 100644 --- a/fortran/COPYING +++ b/fortran/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/fortran/Makefile.am b/fortran/Makefile.am index 9ddd6dd..38084b9 100644 --- a/fortran/Makefile.am +++ b/fortran/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index 5665a2f..3403571 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am index 5a3b09e..db85c09 100644 --- a/fortran/examples/Makefile.am +++ b/fortran/examples/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/fortran/examples/compound.f90 b/fortran/examples/compound.f90 index 2005f41..f5e91d6 100644 --- a/fortran/examples/compound.f90 +++ b/fortran/examples/compound.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/compound_complex_fortran2003.f90 b/fortran/examples/compound_complex_fortran2003.f90 index 19671f7..6d0f291 100644 --- a/fortran/examples/compound_complex_fortran2003.f90 +++ b/fortran/examples/compound_complex_fortran2003.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example shows how to create an array of a compound datatype which diff --git a/fortran/examples/compound_fortran2003.f90 b/fortran/examples/compound_fortran2003.f90 index a55d1a6..0168177 100644 --- a/fortran/examples/compound_fortran2003.f90 +++ b/fortran/examples/compound_fortran2003.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example shows how to create a compound data type, diff --git a/fortran/examples/h5_cmprss.f90 b/fortran/examples/h5_cmprss.f90 index 9ab28f7..61dd7b0 100644 --- a/fortran/examples/h5_cmprss.f90 +++ b/fortran/examples/h5_cmprss.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example illustrates how to create a compressed dataset. diff --git a/fortran/examples/h5_crtatt.f90 b/fortran/examples/h5_crtatt.f90 index 79bc576..7e287c6 100644 --- a/fortran/examples/h5_crtatt.f90 +++ b/fortran/examples/h5_crtatt.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example shows how to create and write a dataset attribute. diff --git a/fortran/examples/h5_crtdat.f90 b/fortran/examples/h5_crtdat.f90 index 6e4c3a4..dce4408 100644 --- a/fortran/examples/h5_crtdat.f90 +++ b/fortran/examples/h5_crtdat.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/h5_crtgrp.f90 b/fortran/examples/h5_crtgrp.f90 index 278d175..12f07e7 100644 --- a/fortran/examples/h5_crtgrp.f90 +++ b/fortran/examples/h5_crtgrp.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/h5_crtgrpar.f90 b/fortran/examples/h5_crtgrpar.f90 index 4ef008a..341b648 100644 --- a/fortran/examples/h5_crtgrpar.f90 +++ b/fortran/examples/h5_crtgrpar.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/h5_crtgrpd.f90 b/fortran/examples/h5_crtgrpd.f90 index d35f03d..41c1f53 100644 --- a/fortran/examples/h5_crtgrpd.f90 +++ b/fortran/examples/h5_crtgrpd.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/h5_extend.f90 b/fortran/examples/h5_extend.f90 index 315d84f..20b91ff 100644 --- a/fortran/examples/h5_extend.f90 +++ b/fortran/examples/h5_extend.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example extends an HDF5 dataset. It is used in the HDF5 Tutorial. diff --git a/fortran/examples/h5_rdwt.f90 b/fortran/examples/h5_rdwt.f90 index ba05b2f..2fbd85d 100644 --- a/fortran/examples/h5_rdwt.f90 +++ b/fortran/examples/h5_rdwt.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/h5_subset.f90 b/fortran/examples/h5_subset.f90 index 6cb8f7a..ab33c86 100644 --- a/fortran/examples/h5_subset.f90 +++ b/fortran/examples/h5_subset.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example shows how to write and read a hyperslab. diff --git a/fortran/examples/hyperslab.f90 b/fortran/examples/hyperslab.f90 index 7823ff6..d340161 100644 --- a/fortran/examples/hyperslab.f90 +++ b/fortran/examples/hyperslab.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/mountexample.f90 b/fortran/examples/mountexample.f90 index 5bdec2a..4a2821d 100644 --- a/fortran/examples/mountexample.f90 +++ b/fortran/examples/mountexample.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/nested_derived_type.f90 b/fortran/examples/nested_derived_type.f90 index 65e7e75..68354ac 100644 --- a/fortran/examples/nested_derived_type.f90 +++ b/fortran/examples/nested_derived_type.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! This example shows how to create a nested compound data type, diff --git a/fortran/examples/ph5example.f90 b/fortran/examples/ph5example.f90 index a0db200..9d4281e 100644 --- a/fortran/examples/ph5example.f90 +++ b/fortran/examples/ph5example.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! Fortran parallel example. Copied from Tutorial's example program of diff --git a/fortran/examples/refobjexample.f90 b/fortran/examples/refobjexample.f90 index c8622a7..d017598 100644 --- a/fortran/examples/refobjexample.f90 +++ b/fortran/examples/refobjexample.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/refregexample.f90 b/fortran/examples/refregexample.f90 index 68fbd24..ab45598 100644 --- a/fortran/examples/refregexample.f90 +++ b/fortran/examples/refregexample.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/run-fortran-ex.sh.in b/fortran/examples/run-fortran-ex.sh.in index a4d4550..cace1ae 100644 --- a/fortran/examples/run-fortran-ex.sh.in +++ b/fortran/examples/run-fortran-ex.sh.in @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file: run-hlfortran-ex.sh diff --git a/fortran/examples/rwdset_fortran2003.f90 b/fortran/examples/rwdset_fortran2003.f90 index 682676f..36ebf0d 100644 --- a/fortran/examples/rwdset_fortran2003.f90 +++ b/fortran/examples/rwdset_fortran2003.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/selectele.f90 b/fortran/examples/selectele.f90 index dcd2379..4281ea6 100644 --- a/fortran/examples/selectele.f90 +++ b/fortran/examples/selectele.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/examples/testh5fc.sh.in b/fortran/examples/testh5fc.sh.in index cd3b86e..f384909 100644 --- a/fortran/examples/testh5fc.sh.in +++ b/fortran/examples/testh5fc.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5fc compiler tool # Created: Albert Cheng, 2007/3/14 diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index 8f012cf..23dd936 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Aff.F90 b/fortran/src/H5Aff.F90 index 132bf41..827b803 100644 --- a/fortran/src/H5Aff.F90 +++ b/fortran/src/H5Aff.F90 @@ -17,12 +17,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index 57b4d4d..588ea9f 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Dff.F90 b/fortran/src/H5Dff.F90 index cb0b292..3915f72 100644 --- a/fortran/src/H5Dff.F90 +++ b/fortran/src/H5Dff.F90 @@ -17,12 +17,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c index 4b1d4c9..0a2f2a3 100644 --- a/fortran/src/H5Ef.c +++ b/fortran/src/H5Ef.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Eff.F90 b/fortran/src/H5Eff.F90 index 4198321..fcd08ff 100644 --- a/fortran/src/H5Eff.F90 +++ b/fortran/src/H5Eff.F90 @@ -17,12 +17,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index c1cdb91..2d5f6ed 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Fff.F90 b/fortran/src/H5Fff.F90 index 165fba0..a3bef37 100644 --- a/fortran/src/H5Fff.F90 +++ b/fortran/src/H5Fff.F90 @@ -17,12 +17,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index b9c44bb..720bd49 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Gff.F90 b/fortran/src/H5Gff.F90 index 30076a4..0684508 100644 --- a/fortran/src/H5Gff.F90 +++ b/fortran/src/H5Gff.F90 @@ -17,12 +17,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5If.c b/fortran/src/H5If.c index fdab0b6..8222817 100644 --- a/fortran/src/H5If.c +++ b/fortran/src/H5If.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Iff.F90 b/fortran/src/H5Iff.F90 index c91a8aa..351dd4b 100644 --- a/fortran/src/H5Iff.F90 +++ b/fortran/src/H5Iff.F90 @@ -17,12 +17,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c index 0d3aac2..32de037 100644 --- a/fortran/src/H5Lf.c +++ b/fortran/src/H5Lf.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Lff.F90 b/fortran/src/H5Lff.F90 index bc91072..d5bb1d1 100644 --- a/fortran/src/H5Lff.F90 +++ b/fortran/src/H5Lff.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Of.c b/fortran/src/H5Of.c index 9e3ddc4..7d065a5 100644 --- a/fortran/src/H5Of.c +++ b/fortran/src/H5Of.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Off.F90 b/fortran/src/H5Off.F90 index 8d4fb16..243ec29 100644 --- a/fortran/src/H5Off.F90 +++ b/fortran/src/H5Off.F90 @@ -18,12 +18,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 3989512..a114e8b 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index 6ba5aeb..b69d4d0 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c index 9cd9950..6a3181f 100644 --- a/fortran/src/H5Rf.c +++ b/fortran/src/H5Rf.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Rff.F90 b/fortran/src/H5Rff.F90 index 7ba91c4..6d6371b 100644 --- a/fortran/src/H5Rff.F90 +++ b/fortran/src/H5Rff.F90 @@ -17,12 +17,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c index 741bf96..2eae0d9 100644 --- a/fortran/src/H5Sf.c +++ b/fortran/src/H5Sf.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Sff.F90 b/fortran/src/H5Sff.F90 index cb1388e..3434fba 100644 --- a/fortran/src/H5Sff.F90 +++ b/fortran/src/H5Sff.F90 @@ -17,12 +17,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index 9928d0a..c40abae 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Tff.F90 b/fortran/src/H5Tff.F90 index 6b8f896..b63c61d 100644 --- a/fortran/src/H5Tff.F90 +++ b/fortran/src/H5Tff.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5Zf.c b/fortran/src/H5Zf.c index a8cf1c2..7afafd5 100644 --- a/fortran/src/H5Zf.c +++ b/fortran/src/H5Zf.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5Zff.F90 b/fortran/src/H5Zff.F90 index 0259959..848f047 100644 --- a/fortran/src/H5Zff.F90 +++ b/fortran/src/H5Zff.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES! diff --git a/fortran/src/H5_buildiface.F90 b/fortran/src/H5_buildiface.F90 index 4b00d80..d4ebdd3 100644 --- a/fortran/src/H5_buildiface.F90 +++ b/fortran/src/H5_buildiface.F90 @@ -33,12 +33,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! AUTHOR @@ -124,12 +122,10 @@ PROGRAM H5_buildiface '! *',& '! This file is part of HDF5. The full HDF5 copyright notice, including *',& '! terms governing use, modification, and redistribution, is contained in *',& -'! the files COPYING and Copyright.html. COPYING can be found at the root *',& -'! of the source code distribution tree; Copyright.html can be found at the *',& -'! root level of an installed copy of the electronic HDF5 document set and *',& -'! is linked from the top-level documents page. It can also be found at *',& -'! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *',& -'! access to either file, you may request a copy from help@hdfgroup.org. *',& +'! the COPYING file, which can be found at the root of the source code *',& +'! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *',& +'! If you do not have access to either file, you may request a copy from *',& +'! help@hdfgroup.org. *',& '! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *',& '!',& '! AUTHOR',& diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index 860f9cb..352ffab 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -10,12 +10,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index f2036ee..ef89d2f 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/src/H5config_f.inc.cmake b/fortran/src/H5config_f.inc.cmake index f0b3472..f85db6c 100644 --- a/fortran/src/H5config_f.inc.cmake +++ b/fortran/src/H5config_f.inc.cmake @@ -1,3 +1,14 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! All rights reserved. * +! * +! This file is part of HDF5. The full HDF5 copyright notice, including * +! terms governing use, modification, and redistribution, is contained in * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! fortran/src/H5config_f.inc. Generated from fortran/src/H5config_f.inc.in by configure ! Define if we have parallel support diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in index 9f094d2..8921493 100644 --- a/fortran/src/H5config_f.inc.in +++ b/fortran/src/H5config_f.inc.in @@ -1,3 +1,14 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! All rights reserved. * +! * +! This file is part of HDF5. The full HDF5 copyright notice, including * +! terms governing use, modification, and redistribution, is contained in * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! fortran/src/H5config_f.inc. Generated from fortran/src/H5config_f.inc.in by configure ! The script to replace the defines in H5config_f.inc.in is diff --git a/fortran/src/H5f90.h b/fortran/src/H5f90.h index 7082d1d..eabe3d0 100644 --- a/fortran/src/H5f90.h +++ b/fortran/src/H5f90.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index a85ee50..dd2b171 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -28,12 +28,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! AUTHOR diff --git a/fortran/src/H5f90i.h b/fortran/src/H5f90i.h index f3c0160..7d066cd 100644 --- a/fortran/src/H5f90i.h +++ b/fortran/src/H5f90i.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/fortran/src/H5f90kit.c b/fortran/src/H5f90kit.c index c6c874f..6e8c793 100644 --- a/fortran/src/H5f90kit.c +++ b/fortran/src/H5f90kit.c @@ -13,12 +13,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 67f28db..46ef8ef 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/fortran/src/H5fort_type_defines.h.in b/fortran/src/H5fort_type_defines.h.in index 6feed4f..b6a35f9 100644 --- a/fortran/src/H5fort_type_defines.h.in +++ b/fortran/src/H5fort_type_defines.h.in @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* If you are reading this file and it has a '.h' suffix, it was automatically * generated from the '.in' version. Make changes there. */ diff --git a/fortran/src/H5fortkit.F90 b/fortran/src/H5fortkit.F90 index 3062c28..f5eba8a 100644 --- a/fortran/src/H5fortkit.F90 +++ b/fortran/src/H5fortkit.F90 @@ -17,12 +17,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! !***** diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index 2337fb3..7e0b7e8 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -19,12 +19,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** @@ -66,12 +64,10 @@ initCfile(void) * *\n\ * This file is part of HDF5. The full HDF5 copyright notice, including *\n\ * terms governing use, modification, and redistribution, is contained in *\n\ - * the files COPYING and Copyright.html. COPYING can be found at the root *\n\ - * of the source code distribution tree; Copyright.html can be found at the *\n\ - * root level of an installed copy of the electronic HDF5 document set and *\n\ - * is linked from the top-level documents page. It can also be found at *\n\ - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *\n\ - * access to either file, you may request a copy from help@hdfgroup.org. *\n\ + * the COPYING file, which can be found at the root of the source code *\n\ + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *\n\ + * If you do not have access to either file, you may request a copy from *\n\ + * help@hdfgroup.org. *\n\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\ \n\n\ #ifndef _H5f90i_gen_H\n\ @@ -93,12 +89,10 @@ initFfile(void) ! *\n\ ! This file is part of HDF5. The full HDF5 copyright notice, including *\n\ ! terms governing use, modification, and redistribution, is contained in *\n\ -! the files COPYING and Copyright.html. COPYING can be found at the root *\n\ -! of the source code distribution tree; Copyright.html can be found at the *\n\ -! root level of an installed copy of the electronic HDF5 document set and *\n\ -! is linked from the top-level documents page. It can also be found at *\n\ -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *\n\ -! access to either file, you may request a copy from help@hdfgroup.org. *\n\ +! the COPYING file, which can be found at the root of the source code *\n\ +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *\n\ +! If you do not have access to either file, you may request a copy from *\n\ +! help@hdfgroup.org. *\n\ ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\ !\n!\n\ ! This file is automatically generated by H5match_types.c and contains HDF5 Fortran90 type definitions.\n!\n\ diff --git a/fortran/src/HDF5.F90 b/fortran/src/HDF5.F90 index cbe4c83..0370224 100644 --- a/fortran/src/HDF5.F90 +++ b/fortran/src/HDF5.F90 @@ -17,12 +17,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! !***** diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index 51775db..a863a67 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index f8d2182..47642c9 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # ############################################################################ diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index a282ec6..e171e7c 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/fortran/test/H5_test_buildiface.F90 b/fortran/test/H5_test_buildiface.F90 index 8b27a96..636ded4 100644 --- a/fortran/test/H5_test_buildiface.F90 +++ b/fortran/test/H5_test_buildiface.F90 @@ -33,12 +33,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! AUTHOR @@ -82,12 +80,10 @@ PROGRAM H5_test_buildiface '! *',& '! This file is part of HDF5. The full HDF5 copyright notice, including *',& '! terms governing use, modification, and redistribution, is contained in *',& -'! the files COPYING and Copyright.html. COPYING can be found at the root *',& -'! of the source code distribution tree; Copyright.html can be found at the *',& -'! root level of an installed copy of the electronic HDF5 document set and *',& -'! is linked from the top-level documents page. It can also be found at *',& -'! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *',& -'! access to either file, you may request a copy from help@hdfgroup.org. *',& +'! the COPYING file, which can be found at the root of the source code *',& +'! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *',& +'! If you do not have access to either file, you may request a copy from *',& +'! help@hdfgroup.org. *',& '! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *',& '!',& '! AUTHOR',& diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am index 3def26e..8613cf9 100644 --- a/fortran/test/Makefile.am +++ b/fortran/test/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/fortran/test/fflush1.F90 b/fortran/test/fflush1.F90 index ca2550f..bd1f551 100644 --- a/fortran/test/fflush1.F90 +++ b/fortran/test/fflush1.F90 @@ -17,12 +17,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! !***** diff --git a/fortran/test/fflush2.F90 b/fortran/test/fflush2.F90 index 4230832..278f73d 100644 --- a/fortran/test/fflush2.F90 +++ b/fortran/test/fflush2.F90 @@ -17,12 +17,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! !***** diff --git a/fortran/test/fortranlib_test.F90 b/fortran/test/fortranlib_test.F90 index bcf5693..94b084e 100644 --- a/fortran/test/fortranlib_test.F90 +++ b/fortran/test/fortranlib_test.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! !***** diff --git a/fortran/test/fortranlib_test_1_8.F90 b/fortran/test/fortranlib_test_1_8.F90 index 320d661..850cab9 100644 --- a/fortran/test/fortranlib_test_1_8.F90 +++ b/fortran/test/fortranlib_test_1_8.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! !***** diff --git a/fortran/test/fortranlib_test_F03.F90 b/fortran/test/fortranlib_test_F03.F90 index 5f5fd2d..ae12dba 100644 --- a/fortran/test/fortranlib_test_F03.F90 +++ b/fortran/test/fortranlib_test_F03.F90 @@ -15,12 +15,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! !***** diff --git a/fortran/test/t.c b/fortran/test/t.c index fe69143..107e8d5 100644 --- a/fortran/test/t.c +++ b/fortran/test/t.c @@ -14,12 +14,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****** diff --git a/fortran/test/t.h b/fortran/test/t.h index 738aa59..81d2b5d 100644 --- a/fortran/test/t.h +++ b/fortran/test/t.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/fortran/test/tH5A.F90 b/fortran/test/tH5A.F90 index 5b814fa..1e6fdeb 100644 --- a/fortran/test/tH5A.F90 +++ b/fortran/test/tH5A.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! CONTAINS SUBROUTINES diff --git a/fortran/test/tH5A_1_8.F90 b/fortran/test/tH5A_1_8.F90 index c70e288..f2f11aa 100644 --- a/fortran/test/tH5A_1_8.F90 +++ b/fortran/test/tH5A_1_8.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! CONTAINS SUBROUTINES diff --git a/fortran/test/tH5D.F90 b/fortran/test/tH5D.F90 index 183d969..7001b98 100644 --- a/fortran/test/tH5D.F90 +++ b/fortran/test/tH5D.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/test/tH5E.F90 b/fortran/test/tH5E.F90 index 10ecaf6..3cda6e1 100644 --- a/fortran/test/tH5E.F90 +++ b/fortran/test/tH5E.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/test/tH5E_F03.F90 b/fortran/test/tH5E_F03.F90 index 63e70a3..1878966 100644 --- a/fortran/test/tH5E_F03.F90 +++ b/fortran/test/tH5E_F03.F90 @@ -15,12 +15,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! USES diff --git a/fortran/test/tH5F.F90 b/fortran/test/tH5F.F90 index ea8c53f..d91ee9c 100644 --- a/fortran/test/tH5F.F90 +++ b/fortran/test/tH5F.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! CONTAINS SUBROUTINES diff --git a/fortran/test/tH5F_F03.F90 b/fortran/test/tH5F_F03.F90 index 0f08257..8cc6b83 100644 --- a/fortran/test/tH5F_F03.F90 +++ b/fortran/test/tH5F_F03.F90 @@ -15,12 +15,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/test/tH5G.F90 b/fortran/test/tH5G.F90 index 2ba174c..0b6cc1a 100644 --- a/fortran/test/tH5G.F90 +++ b/fortran/test/tH5G.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! CONTAINS SUBROUTINES diff --git a/fortran/test/tH5G_1_8.F90 b/fortran/test/tH5G_1_8.F90 index f894edd..d3be525 100644 --- a/fortran/test/tH5G_1_8.F90 +++ b/fortran/test/tH5G_1_8.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! CONTAINS SUBROUTINES diff --git a/fortran/test/tH5I.F90 b/fortran/test/tH5I.F90 index 97c48c6..5ce37fd 100644 --- a/fortran/test/tH5I.F90 +++ b/fortran/test/tH5I.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! CONTAINS SUBROUTINES diff --git a/fortran/test/tH5L_F03.F90 b/fortran/test/tH5L_F03.F90 index 40afdbc..bdb5c55 100644 --- a/fortran/test/tH5L_F03.F90 +++ b/fortran/test/tH5L_F03.F90 @@ -15,12 +15,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! USES diff --git a/fortran/test/tH5MISC_1_8.F90 b/fortran/test/tH5MISC_1_8.F90 index ba3f095..79fbf3e 100644 --- a/fortran/test/tH5MISC_1_8.F90 +++ b/fortran/test/tH5MISC_1_8.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! !***** diff --git a/fortran/test/tH5O.F90 b/fortran/test/tH5O.F90 index 51e1d64..fa3787e 100644 --- a/fortran/test/tH5O.F90 +++ b/fortran/test/tH5O.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! CONTAINS SUBROUTINES diff --git a/fortran/test/tH5O_F03.F90 b/fortran/test/tH5O_F03.F90 index 834308b..44c4bff 100644 --- a/fortran/test/tH5O_F03.F90 +++ b/fortran/test/tH5O_F03.F90 @@ -15,12 +15,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! !***** diff --git a/fortran/test/tH5P.F90 b/fortran/test/tH5P.F90 index 39d8c1e..563926b 100644 --- a/fortran/test/tH5P.F90 +++ b/fortran/test/tH5P.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! CONTAINS SUBROUTINES diff --git a/fortran/test/tH5P_F03.F90 b/fortran/test/tH5P_F03.F90 index aaf1496..69d493b 100644 --- a/fortran/test/tH5P_F03.F90 +++ b/fortran/test/tH5P_F03.F90 @@ -15,12 +15,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! USES diff --git a/fortran/test/tH5R.F90 b/fortran/test/tH5R.F90 index ef392b4..f7cccfa 100644 --- a/fortran/test/tH5R.F90 +++ b/fortran/test/tH5R.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/test/tH5S.F90 b/fortran/test/tH5S.F90 index 7223772..a4f5f4a 100644 --- a/fortran/test/tH5S.F90 +++ b/fortran/test/tH5S.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/test/tH5Sselect.F90 b/fortran/test/tH5Sselect.F90 index aeb80e9..8415bce 100644 --- a/fortran/test/tH5Sselect.F90 +++ b/fortran/test/tH5Sselect.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES diff --git a/fortran/test/tH5T.F90 b/fortran/test/tH5T.F90 index 1a3a382..a986ba6 100644 --- a/fortran/test/tH5T.F90 +++ b/fortran/test/tH5T.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! CONTAINS SUBROUTINES diff --git a/fortran/test/tH5T_F03.F90 b/fortran/test/tH5T_F03.F90 index c596d31..800e84b 100644 --- a/fortran/test/tH5T_F03.F90 +++ b/fortran/test/tH5T_F03.F90 @@ -15,12 +15,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/fortran/test/tH5VL.F90 b/fortran/test/tH5VL.F90 index 834fbde..7ef9c19 100644 --- a/fortran/test/tH5VL.F90 +++ b/fortran/test/tH5VL.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! CONTAINS SUBROUTINES diff --git a/fortran/test/tH5Z.F90 b/fortran/test/tH5Z.F90 index 4201960..0fd7b1b 100644 --- a/fortran/test/tH5Z.F90 +++ b/fortran/test/tH5Z.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! CONTAINS SUBROUTINES diff --git a/fortran/test/tHDF5.F90 b/fortran/test/tHDF5.F90 index e9e0892..459b74f 100644 --- a/fortran/test/tHDF5.F90 +++ b/fortran/test/tHDF5.F90 @@ -17,12 +17,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! !***** diff --git a/fortran/test/tHDF5_1_8.F90 b/fortran/test/tHDF5_1_8.F90 index 6a3f74b..7e1f862 100644 --- a/fortran/test/tHDF5_1_8.F90 +++ b/fortran/test/tHDF5_1_8.F90 @@ -18,12 +18,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! !***** diff --git a/fortran/test/tHDF5_F03.F90 b/fortran/test/tHDF5_F03.F90 index b3b1885..96959d8 100644 --- a/fortran/test/tHDF5_F03.F90 +++ b/fortran/test/tHDF5_F03.F90 @@ -18,12 +18,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! !***** diff --git a/fortran/test/tf.F90 b/fortran/test/tf.F90 index 26b3e99..4df53bd 100644 --- a/fortran/test/tf.F90 +++ b/fortran/test/tf.F90 @@ -14,12 +14,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! CONTAINS SUBROUTINES diff --git a/fortran/testpar/CMakeTests.cmake b/fortran/testpar/CMakeTests.cmake index 61085e6..5736256 100644 --- a/fortran/testpar/CMakeTests.cmake +++ b/fortran/testpar/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/fortran/testpar/Makefile.am b/fortran/testpar/Makefile.am index 380f475..e597a84 100644 --- a/fortran/testpar/Makefile.am +++ b/fortran/testpar/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/fortran/testpar/hyper.f90 b/fortran/testpar/hyper.f90 index 28c0b53..22f641d 100644 --- a/fortran/testpar/hyper.f90 +++ b/fortran/testpar/hyper.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * diff --git a/fortran/testpar/mdset.f90 b/fortran/testpar/mdset.f90 index 7fe431b..70d2939 100644 --- a/fortran/testpar/mdset.f90 +++ b/fortran/testpar/mdset.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * diff --git a/fortran/testpar/ptest.f90 b/fortran/testpar/ptest.f90 index 82dcc09..14ac3b2 100644 --- a/fortran/testpar/ptest.f90 +++ b/fortran/testpar/ptest.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! diff --git a/hl/COPYING b/hl/COPYING index 6903daf..6497ace 100644 --- a/hl/COPYING +++ b/hl/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/hl/Makefile.am b/hl/Makefile.am index 9f31719..aee1f86 100644 --- a/hl/Makefile.am +++ b/hl/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # # This makefile mostly just reinvokes make in the various subdirectories diff --git a/hl/c++/COPYING b/hl/c++/COPYING index 6903daf..6497ace 100644 --- a/hl/c++/COPYING +++ b/hl/c++/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/hl/c++/Makefile.am b/hl/c++/Makefile.am index 80445f7..1968bf5 100644 --- a/hl/c++/Makefile.am +++ b/hl/c++/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/hl/c++/examples/CMakeTests.cmake b/hl/c++/examples/CMakeTests.cmake index 86bdd93..103ec2b 100644 --- a/hl/c++/examples/CMakeTests.cmake +++ b/hl/c++/examples/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/hl/c++/examples/Makefile.am b/hl/c++/examples/Makefile.am index 7202a96..ce719f5 100644 --- a/hl/c++/examples/Makefile.am +++ b/hl/c++/examples/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/hl/c++/examples/ptExampleFL.cpp b/hl/c++/examples/ptExampleFL.cpp index 27cbd92..26cbf09 100644 --- a/hl/c++/examples/ptExampleFL.cpp +++ b/hl/c++/examples/ptExampleFL.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5PacketTable.h" diff --git a/hl/c++/examples/run-hlc++-ex.sh.in b/hl/c++/examples/run-hlc++-ex.sh.in index 5aa1032..9539724 100644 --- a/hl/c++/examples/run-hlc++-ex.sh.in +++ b/hl/c++/examples/run-hlc++-ex.sh.in @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file: run-hlc++-ex.sh diff --git a/hl/c++/src/H5PacketTable.cpp b/hl/c++/src/H5PacketTable.cpp index c4d7bbf..544df0b 100644 --- a/hl/c++/src/H5PacketTable.cpp +++ b/hl/c++/src/H5PacketTable.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Packet Table wrapper classes diff --git a/hl/c++/src/H5PacketTable.h b/hl/c++/src/H5PacketTable.h index be0b130..2665984 100644 --- a/hl/c++/src/H5PacketTable.h +++ b/hl/c++/src/H5PacketTable.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Packet Table wrapper classes diff --git a/hl/c++/src/Makefile.am b/hl/c++/src/Makefile.am index c78f5fa..363ba3b 100644 --- a/hl/c++/src/Makefile.am +++ b/hl/c++/src/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/hl/c++/test/CMakeTests.cmake b/hl/c++/test/CMakeTests.cmake index d41f79e..785abca 100644 --- a/hl/c++/test/CMakeTests.cmake +++ b/hl/c++/test/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/hl/c++/test/Makefile.am b/hl/c++/test/Makefile.am index c835843..7031c34 100644 --- a/hl/c++/test/Makefile.am +++ b/hl/c++/test/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index c388af3..340912e 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* ptableTest.cpp */ diff --git a/hl/c++/test/ptableTest.h b/hl/c++/test/ptableTest.h index 60b55ca..8af7bff 100644 --- a/hl/c++/test/ptableTest.h +++ b/hl/c++/test/ptableTest.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Test header for Packet Table C++ wrapper API */ diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake index 5645155..166fa7c 100644 --- a/hl/examples/CMakeTests.cmake +++ b/hl/examples/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/hl/examples/Makefile.am b/hl/examples/Makefile.am index ba200ed..29e1a48 100644 --- a/hl/examples/Makefile.am +++ b/hl/examples/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/hl/examples/ex_ds1.c b/hl/examples/ex_ds1.c index 8b7e530..1e0c592 100644 --- a/hl/examples/ex_ds1.c +++ b/hl/examples/ex_ds1.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/hl/examples/ex_image1.c b/hl/examples/ex_image1.c index 18ad903..56a175d 100644 --- a/hl/examples/ex_image1.c +++ b/hl/examples/ex_image1.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/hl/examples/ex_image2.c b/hl/examples/ex_image2.c index b57f1b7..5abf723 100644 --- a/hl/examples/ex_image2.c +++ b/hl/examples/ex_image2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/hl/examples/ex_lite1.c b/hl/examples/ex_lite1.c index 446c803..89f60dc 100644 --- a/hl/examples/ex_lite1.c +++ b/hl/examples/ex_lite1.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/hl/examples/ex_lite2.c b/hl/examples/ex_lite2.c index a696a20..261fc73 100644 --- a/hl/examples/ex_lite2.c +++ b/hl/examples/ex_lite2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/hl/examples/ex_lite3.c b/hl/examples/ex_lite3.c index f409ea4..420cbcb 100644 --- a/hl/examples/ex_lite3.c +++ b/hl/examples/ex_lite3.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/hl/examples/ex_table_01.c b/hl/examples/ex_table_01.c index 1d381ae..f1d0266 100644 --- a/hl/examples/ex_table_01.c +++ b/hl/examples/ex_table_01.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/hl/examples/ex_table_02.c b/hl/examples/ex_table_02.c index 129f87d..923f810 100644 --- a/hl/examples/ex_table_02.c +++ b/hl/examples/ex_table_02.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/hl/examples/ex_table_03.c b/hl/examples/ex_table_03.c index c9f94ce..76a9eae 100644 --- a/hl/examples/ex_table_03.c +++ b/hl/examples/ex_table_03.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/hl/examples/ex_table_04.c b/hl/examples/ex_table_04.c index 01f2869..203114c 100644 --- a/hl/examples/ex_table_04.c +++ b/hl/examples/ex_table_04.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/hl/examples/ex_table_05.c b/hl/examples/ex_table_05.c index 7ed1fec..b43d635 100644 --- a/hl/examples/ex_table_05.c +++ b/hl/examples/ex_table_05.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/hl/examples/ex_table_06.c b/hl/examples/ex_table_06.c index 081347e..0397e83 100644 --- a/hl/examples/ex_table_06.c +++ b/hl/examples/ex_table_06.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/hl/examples/ex_table_07.c b/hl/examples/ex_table_07.c index 3be788f..d9ea444 100644 --- a/hl/examples/ex_table_07.c +++ b/hl/examples/ex_table_07.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/hl/examples/ex_table_08.c b/hl/examples/ex_table_08.c index 5d3659f..a45520d 100644 --- a/hl/examples/ex_table_08.c +++ b/hl/examples/ex_table_08.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5_hl.h" diff --git a/hl/examples/ex_table_09.c b/hl/examples/ex_table_09.c index a4ef611..a9f5f11 100644 --- a/hl/examples/ex_table_09.c +++ b/hl/examples/ex_table_09.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5_hl.h" diff --git a/hl/examples/ex_table_10.c b/hl/examples/ex_table_10.c index 059c7ea..8c4d8ae 100644 --- a/hl/examples/ex_table_10.c +++ b/hl/examples/ex_table_10.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5_hl.h" diff --git a/hl/examples/ex_table_11.c b/hl/examples/ex_table_11.c index 687568c..d6215cb 100644 --- a/hl/examples/ex_table_11.c +++ b/hl/examples/ex_table_11.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5_hl.h" diff --git a/hl/examples/ex_table_12.c b/hl/examples/ex_table_12.c index 125b8be..f287c29 100644 --- a/hl/examples/ex_table_12.c +++ b/hl/examples/ex_table_12.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/hl/examples/pal_rgb.h b/hl/examples/pal_rgb.h index 606137e..f3905b3 100644 --- a/hl/examples/pal_rgb.h +++ b/hl/examples/pal_rgb.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ const unsigned char pal_rgb[256*3] = {255,255,255, diff --git a/hl/examples/ptExampleFL.c b/hl/examples/ptExampleFL.c index 37b5035..ba7a3a0 100644 --- a/hl/examples/ptExampleFL.c +++ b/hl/examples/ptExampleFL.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5_hl.h" diff --git a/hl/examples/run-hl-ex.sh b/hl/examples/run-hl-ex.sh index 5fa97c0..6f736cc 100755 --- a/hl/examples/run-hl-ex.sh +++ b/hl/examples/run-hl-ex.sh @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file: run-hl-ex.sh diff --git a/hl/examples/run-hlc-ex.sh.in b/hl/examples/run-hlc-ex.sh.in index d897a02..b12955f 100644 --- a/hl/examples/run-hlc-ex.sh.in +++ b/hl/examples/run-hlc-ex.sh.in @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file: run-hlc-ex.sh diff --git a/hl/fortran/COPYING b/hl/fortran/COPYING index 6903daf..6497ace 100644 --- a/hl/fortran/COPYING +++ b/hl/fortran/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/hl/fortran/Makefile.am b/hl/fortran/Makefile.am index 646de26..ad18a21 100644 --- a/hl/fortran/Makefile.am +++ b/hl/fortran/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # # This makefile mostly just reinvokes make in the various subdirectories diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake index b5f5fc6..91cb56b 100644 --- a/hl/fortran/examples/CMakeTests.cmake +++ b/hl/fortran/examples/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/hl/fortran/examples/Makefile.am b/hl/fortran/examples/Makefile.am index 997da73..6709fb7 100644 --- a/hl/fortran/examples/Makefile.am +++ b/hl/fortran/examples/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/hl/fortran/examples/ex_ds1.f90 b/hl/fortran/examples/ex_ds1.f90 index d77f8e0..14e2b0c 100644 --- a/hl/fortran/examples/ex_ds1.f90 +++ b/hl/fortran/examples/ex_ds1.f90 @@ -5,12 +5,10 @@ ! * * ! * This file is part of HDF5. The full HDF5 copyright notice, including * ! * terms governing use, modification, and redistribution, is contained in * -! * the files COPYING and Copyright.html. COPYING can be found at the root * -! * of the source code distribution tree; Copyright.html can be found at the * -! * root level of an installed copy of the electronic HDF5 document set and * -! * is linked from the top-level documents page. It can also be found at * -! * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! * access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * PROGRAM example_ds diff --git a/hl/fortran/examples/exlite.f90 b/hl/fortran/examples/exlite.f90 index 916bcb9..90a33fd 100644 --- a/hl/fortran/examples/exlite.f90 +++ b/hl/fortran/examples/exlite.f90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! diff --git a/hl/fortran/examples/run-hlfortran-ex.sh.in b/hl/fortran/examples/run-hlfortran-ex.sh.in index 12f9fec..c8f41f8 100644 --- a/hl/fortran/examples/run-hlfortran-ex.sh.in +++ b/hl/fortran/examples/run-hlfortran-ex.sh.in @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file: run-hlfortran-ex.sh diff --git a/hl/fortran/src/H5DSfc.c b/hl/fortran/src/H5DSfc.c index af054e0..0bb594d 100644 --- a/hl/fortran/src/H5DSfc.c +++ b/hl/fortran/src/H5DSfc.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* This files contains C stubs for H5D Fortran APIs */ diff --git a/hl/fortran/src/H5DSff.F90 b/hl/fortran/src/H5DSff.F90 index 00cf4d8..4f0d040 100644 --- a/hl/fortran/src/H5DSff.F90 +++ b/hl/fortran/src/H5DSff.F90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/hl/fortran/src/H5HL_buildiface.F90 b/hl/fortran/src/H5HL_buildiface.F90 index 15897c3..dda8d56 100644 --- a/hl/fortran/src/H5HL_buildiface.F90 +++ b/hl/fortran/src/H5HL_buildiface.F90 @@ -33,12 +33,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! AUTHOR @@ -114,12 +112,10 @@ PROGRAM H5HL_buildiface '! *',& '! This file is part of HDF5. The full HDF5 copyright notice, including *',& '! terms governing use, modification, and redistribution, is contained in *',& -'! the files COPYING and Copyright.html. COPYING can be found at the root *',& -'! of the source code distribution tree; Copyright.html can be found at the *',& -'! root level of an installed copy of the electronic HDF5 document set and *',& -'! is linked from the top-level documents page. It can also be found at *',& -'! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *',& -'! access to either file, you may request a copy from help@hdfgroup.org. *',& +'! the COPYING file, which can be found at the root of the source code *',& +'! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *',& +'! If you do not have access to either file, you may request a copy from *',& +'! help@hdfgroup.org. *',& '! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *',& '!',& '! AUTHOR',& @@ -584,12 +580,10 @@ PROGRAM H5HL_buildiface '! *',& '! This file is part of HDF5. The full HDF5 copyright notice, including *',& '! terms governing use, modification, and redistribution, is contained in *',& -'! the files COPYING and Copyright.html. COPYING can be found at the root *',& -'! of the source code distribution tree; Copyright.html can be found at the *',& -'! root level of an installed copy of the electronic HDF5 document set and *',& -'! is linked from the top-level documents page. It can also be found at *',& -'! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *',& -'! access to either file, you may request a copy from help@hdfgroup.org. *',& +'! the COPYING file, which can be found at the root of the source code *',& +'! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *',& +'! If you do not have access to either file, you may request a copy from *',& +'! help@hdfgroup.org. *',& '! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *',& '!',& '! AUTHOR',& diff --git a/hl/fortran/src/H5IMcc.c b/hl/fortran/src/H5IMcc.c index ae58fab..c6e4b1b 100644 --- a/hl/fortran/src/H5IMcc.c +++ b/hl/fortran/src/H5IMcc.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5IMcc.h" @@ -314,7 +312,6 @@ out: * the FORTRAN interface where the image buffer is defined as type "integer" * * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: * @@ -408,7 +405,6 @@ herr_t H5IMmake_palettef(hid_t loc_id, * the FORTRAN interface where the image buffer is defined as type "integer" * * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: * @@ -451,7 +447,6 @@ herr_t H5IMget_palettef(hid_t loc_id, * * Comments: * based on HDF5 Image and Palette Specification - * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: * diff --git a/hl/fortran/src/H5IMcc.h b/hl/fortran/src/H5IMcc.h index 0b8a345..a65669d 100644 --- a/hl/fortran/src/H5IMcc.h +++ b/hl/fortran/src/H5IMcc.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5IMCC_H diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c index 7ad50d6..cafd623 100644 --- a/hl/fortran/src/H5IMfc.c +++ b/hl/fortran/src/H5IMfc.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* This files contains C stubs for H5D Fortran APIs */ diff --git a/hl/fortran/src/H5IMff.F90 b/hl/fortran/src/H5IMff.F90 index 4408dda..6646828 100644 --- a/hl/fortran/src/H5IMff.F90 +++ b/hl/fortran/src/H5IMff.F90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index 77f941e..35b08a1 100644 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index a90c24b..0f8a58f 100644 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* This files contains C stubs for H5D Fortran APIs */ diff --git a/hl/fortran/src/H5LTff.F90 b/hl/fortran/src/H5LTff.F90 index 18c36f0..80f6ac5 100644 --- a/hl/fortran/src/H5LTff.F90 +++ b/hl/fortran/src/H5LTff.F90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c index 2bb7c3b..c0d053f 100644 --- a/hl/fortran/src/H5TBfc.c +++ b/hl/fortran/src/H5TBfc.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/fortran/src/H5TBff.F90 b/hl/fortran/src/H5TBff.F90 index 5d1ee35..2575b24 100644 --- a/hl/fortran/src/H5TBff.F90 +++ b/hl/fortran/src/H5TBff.F90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/hl/fortran/src/Makefile.am b/hl/fortran/src/Makefile.am index 7ac18cd..a495e220 100644 --- a/hl/fortran/src/Makefile.am +++ b/hl/fortran/src/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # ## ## Makefile.am diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index 3c8a831..90cc3a3 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/hl/fortran/test/Makefile.am b/hl/fortran/test/Makefile.am index 4013d39..ba672aa 100644 --- a/hl/fortran/test/Makefile.am +++ b/hl/fortran/test/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # ## ## Makefile.am diff --git a/hl/fortran/test/tstds.F90 b/hl/fortran/test/tstds.F90 index f5df4ef..387f524 100644 --- a/hl/fortran/test/tstds.F90 +++ b/hl/fortran/test/tstds.F90 @@ -5,12 +5,10 @@ ! * * ! * This file is part of HDF5. The full HDF5 copyright notice, including * ! * terms governing use, modification, and redistribution, is contained in * -! * the files COPYING and Copyright.html. COPYING can be found at the root * -! * of the source code distribution tree; Copyright.html can be found at the * -! * root level of an installed copy of the electronic HDF5 document set and * -! * is linked from the top-level documents page. It can also be found at * -! * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! * access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * MODULE TSTDS diff --git a/hl/fortran/test/tstimage.F90 b/hl/fortran/test/tstimage.F90 index 7e90664..d6bd1e2 100644 --- a/hl/fortran/test/tstimage.F90 +++ b/hl/fortran/test/tstimage.F90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/hl/fortran/test/tstlite.F90 b/hl/fortran/test/tstlite.F90 index b19ca5a..673807b 100644 --- a/hl/fortran/test/tstlite.F90 +++ b/hl/fortran/test/tstlite.F90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/hl/fortran/test/tsttable.F90 b/hl/fortran/test/tsttable.F90 index 3cf8fed..38cfa86 100644 --- a/hl/fortran/test/tsttable.F90 +++ b/hl/fortran/test/tsttable.F90 @@ -5,12 +5,10 @@ ! * ! This file is part of HDF5. The full HDF5 copyright notice, including * ! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! diff --git a/hl/src/COPYING b/hl/src/COPYING index 6903daf..6497ace 100644 --- a/hl/src/COPYING +++ b/hl/src/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index e2b436a..8db6768 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/src/H5DOpublic.h b/hl/src/H5DOpublic.h index 1e5eb7a..ce0d32e 100644 --- a/hl/src/H5DOpublic.h +++ b/hl/src/H5DOpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5DOpublic_H diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index de6e66c..527c92b 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/src/H5DSprivate.h b/hl/src/H5DSprivate.h index 39c3e74..9d20d48 100644 --- a/hl/src/H5DSprivate.h +++ b/hl/src/H5DSprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5DSprivate_H diff --git a/hl/src/H5DSpublic.h b/hl/src/H5DSpublic.h index 85923f8..615122c 100644 --- a/hl/src/H5DSpublic.h +++ b/hl/src/H5DSpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5DSpublic_H diff --git a/hl/src/H5HLprivate2.h b/hl/src/H5HLprivate2.h index 1b67c70..45591e8 100644 --- a/hl/src/H5HLprivate2.h +++ b/hl/src/H5HLprivate2.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5HLprivate2_H diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 6d08f02..a4818b8 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5IMprivate.h" @@ -31,7 +29,6 @@ * * Comments: * based on HDF5 Image and Palette Specification -* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: * @@ -86,7 +83,6 @@ herr_t H5IMmake_image_8bit( hid_t loc_id, * * Comments: * based on HDF5 Image and Palette Specification -* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Interlace Mode Dimensions in the Dataspace * INTERLACE_PIXEL [height][width][pixel components] @@ -240,7 +236,6 @@ herr_t H5IM_find_palette( hid_t loc_id ) * * Comments: * based on HDF5 Image and Palette Specification -* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: * @@ -422,7 +417,6 @@ out: * * Comments: * based on HDF5 Image and Palette Specification -* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: * @@ -473,7 +467,6 @@ out: * * Comments: * based on HDF5 Image and Palette Specification -* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: * @@ -530,7 +523,6 @@ herr_t H5IMmake_palette( hid_t loc_id, * * Comments: * based on HDF5 Image and Palette Specification -* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * An image (dataset) within an HDF5 file may optionally specify an array of * palettes to be viewed with. The dataset will have an attribute @@ -708,7 +700,6 @@ out: * * Comments: * based on HDF5 Image and Palette Specification -* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: * @@ -901,7 +892,6 @@ out: * * Comments: * based on HDF5 Image and Palette Specification -* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: * @@ -1018,7 +1008,6 @@ out: * * Comments: * based on HDF5 Image and Palette Specification -* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: * @@ -1126,7 +1115,6 @@ out: * * Comments: * based on HDF5 Image and Palette Specification -* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: * @@ -1231,7 +1219,6 @@ out: * * Comments: * based on HDF5 Image and Palette Specification -* http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: * diff --git a/hl/src/H5IMprivate.h b/hl/src/H5IMprivate.h index 0cb37cc..6776c9d 100644 --- a/hl/src/H5IMprivate.h +++ b/hl/src/H5IMprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5IMprivate_H diff --git a/hl/src/H5IMpublic.h b/hl/src/H5IMpublic.h index 6833f02..a95e439 100644 --- a/hl/src/H5IMpublic.h +++ b/hl/src/H5IMpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5IMpublic_H diff --git a/hl/src/H5LD.c b/hl/src/H5LD.c index 4abd740..1669a30 100644 --- a/hl/src/H5LD.c +++ b/hl/src/H5LD.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/src/H5LDprivate.h b/hl/src/H5LDprivate.h index 13e0710..b52928b 100644 --- a/hl/src/H5LDprivate.h +++ b/hl/src/H5LDprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5LDprivate_H diff --git a/hl/src/H5LDpublic.h b/hl/src/H5LDpublic.h index 4844d42..e2bb745 100644 --- a/hl/src/H5LDpublic.h +++ b/hl/src/H5LDpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5LDpublic_H diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index b7e0b4a..0074d02 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index 022e24f..b6a7f58 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -883,12 +883,10 @@ char *H5LTyytext; * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* NOTE! * diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index a0c4f42..b9b492e 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* NOTE! diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y index 80dcc42..66a8556 100644 --- a/hl/src/H5LTparse.y +++ b/hl/src/H5LTparse.y @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* NOTE! diff --git a/hl/src/H5LTprivate.h b/hl/src/H5LTprivate.h index 98ac06e..01c5ee6 100644 --- a/hl/src/H5LTprivate.h +++ b/hl/src/H5LTprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5LTprivate_H diff --git a/hl/src/H5LTpublic.h b/hl/src/H5LTpublic.h index 929c6bd..47be98a 100644 --- a/hl/src/H5LTpublic.h +++ b/hl/src/H5LTpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5LTpublic_H diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index 5f0f94f..07d8bfb 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/src/H5PTprivate.h b/hl/src/H5PTprivate.h index adc2fa9..eec9df7 100644 --- a/hl/src/H5PTprivate.h +++ b/hl/src/H5PTprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5PTprivate_H diff --git a/hl/src/H5PTpublic.h b/hl/src/H5PTpublic.h index 420275a..8a12c8c 100644 --- a/hl/src/H5PTpublic.h +++ b/hl/src/H5PTpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5PTpublic_H diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index bcd3339..a4bcbd4 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/src/H5TBprivate.h b/hl/src/H5TBprivate.h index e2b668d..17306fb 100644 --- a/hl/src/H5TBprivate.h +++ b/hl/src/H5TBprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5TBprivate_H diff --git a/hl/src/H5TBpublic.h b/hl/src/H5TBpublic.h index 874ef20..56aa915 100644 --- a/hl/src/H5TBpublic.h +++ b/hl/src/H5TBpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5TBpublic_H diff --git a/hl/src/Makefile.am b/hl/src/Makefile.am index fef3450..4ef1f5f 100644 --- a/hl/src/Makefile.am +++ b/hl/src/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/hl/src/hdf5_hl.h b/hl/src/hdf5_hl.h index f55aa04..3a7b8ee 100644 --- a/hl/src/hdf5_hl.h +++ b/hl/src/hdf5_hl.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index 211c501..e5eb58e 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/hl/test/COPYING b/hl/test/COPYING index 6903daf..6497ace 100644 --- a/hl/test/COPYING +++ b/hl/test/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/hl/test/H5srcdir_str.h.in b/hl/test/H5srcdir_str.h.in index d472124..bab1df3 100644 --- a/hl/test/H5srcdir_str.h.in +++ b/hl/test/H5srcdir_str.h.in @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* If you are reading this file and it has a '.h' suffix, it was automatically diff --git a/hl/test/Makefile.am b/hl/test/Makefile.am index 80a7802..e16550f 100644 --- a/hl/test/Makefile.am +++ b/hl/test/Makefile.am @@ -4,12 +4,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # ## Makefile.am diff --git a/hl/test/dectris_hl_perf.c b/hl/test/dectris_hl_perf.c index 008bd92..13cfac8 100644 --- a/hl/test/dectris_hl_perf.c +++ b/hl/test/dectris_hl_perf.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c index 2fc8140..f8f1d39 100644 --- a/hl/test/gen_test_ds.c +++ b/hl/test/gen_test_ds.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/hl/test/gen_test_ld.c b/hl/test/gen_test_ld.c index cf7b321..d717a47 100644 --- a/hl/test/gen_test_ld.c +++ b/hl/test/gen_test_ld.c @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" #include "H5LDprivate.h" diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h index 9a5e702..f368b8e 100644 --- a/hl/test/h5hltest.h +++ b/hl/test/h5hltest.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/hl/test/pal_rgb.h b/hl/test/pal_rgb.h index 9610258..4b22bea 100644 --- a/hl/test/pal_rgb.h +++ b/hl/test/pal_rgb.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ const unsigned char pal_rgb[256*3] = {255,255,255, diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 091a98b..91f1505 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c index a5c9abc..d890481 100644 --- a/hl/test/test_dset_append.c +++ b/hl/test/test_dset_append.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index b03ab44..03c467a 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c index 6ff5bf4..a98642c 100644 --- a/hl/test/test_file_image.c +++ b/hl/test/test_file_image.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5hltest.h" diff --git a/hl/test/test_image.c b/hl/test/test_image.c index 8bc6f95..c30b572 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c index df721e6..12a226a 100644 --- a/hl/test/test_ld.c +++ b/hl/test/test_ld.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 6cadd95..763fdb5 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index f577947..7003b26 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c index b152a2c..35bd43a 100644 --- a/hl/test/test_packet_vlen.c +++ b/hl/test/test_packet_vlen.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5hltest.h" diff --git a/hl/test/test_table.c b/hl/test/test_table.c index c9c3c19..0215697 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/tools/COPYING b/hl/tools/COPYING index 6903daf..6497ace 100644 --- a/hl/tools/COPYING +++ b/hl/tools/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/hl/tools/Makefile.am b/hl/tools/Makefile.am index 090c4a6..5d814df 100644 --- a/hl/tools/Makefile.am +++ b/hl/tools/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/hl/tools/gif2h5/CMakeTests.cmake b/hl/tools/gif2h5/CMakeTests.cmake index 8a52f50..61c004e 100644 --- a/hl/tools/gif2h5/CMakeTests.cmake +++ b/hl/tools/gif2h5/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/hl/tools/gif2h5/Makefile.am b/hl/tools/gif2h5/Makefile.am index c82485e..d30d66a 100644 --- a/hl/tools/gif2h5/Makefile.am +++ b/hl/tools/gif2h5/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/hl/tools/gif2h5/decompress.c b/hl/tools/gif2h5/decompress.c index ef2d78a..453db12 100644 --- a/hl/tools/gif2h5/decompress.c +++ b/hl/tools/gif2h5/decompress.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include diff --git a/hl/tools/gif2h5/gif.h b/hl/tools/gif2h5/gif.h index f34a111..ed1cc81 100644 --- a/hl/tools/gif2h5/gif.h +++ b/hl/tools/gif2h5/gif.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/hl/tools/gif2h5/gif2hdf.c b/hl/tools/gif2h5/gif2hdf.c index 8a9e971..2e06d34 100644 --- a/hl/tools/gif2h5/gif2hdf.c +++ b/hl/tools/gif2h5/gif2hdf.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 456a32d..40b5583 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/hl/tools/gif2h5/gifread.c b/hl/tools/gif2h5/gifread.c index 2b4c129..948e112 100644 --- a/hl/tools/gif2h5/gifread.c +++ b/hl/tools/gif2h5/gifread.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include diff --git a/hl/tools/gif2h5/h52gifgentst.c b/hl/tools/gif2h5/h52gifgentst.c index 39e950b..655563c 100644 --- a/hl/tools/gif2h5/h52gifgentst.c +++ b/hl/tools/gif2h5/h52gifgentst.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/tools/gif2h5/h52giftest.sh.in b/hl/tools/gif2h5/h52giftest.sh.in index 90931f2..5643e30 100644 --- a/hl/tools/gif2h5/h52giftest.sh.in +++ b/hl/tools/gif2h5/h52giftest.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # HDF Utilities Test script diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c index 8ed05df..ae63e92 100644 --- a/hl/tools/gif2h5/hdf2gif.c +++ b/hl/tools/gif2h5/hdf2gif.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/hl/tools/gif2h5/hdfgifwr.c b/hl/tools/gif2h5/hdfgifwr.c index 4c52f4c..6f5ab58 100644 --- a/hl/tools/gif2h5/hdfgifwr.c +++ b/hl/tools/gif2h5/hdfgifwr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/hl/tools/gif2h5/writehdf.c b/hl/tools/gif2h5/writehdf.c index b4cca67..b656c36 100644 --- a/hl/tools/gif2h5/writehdf.c +++ b/hl/tools/gif2h5/writehdf.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include diff --git a/hl/tools/h5watch/CMakeTests.cmake b/hl/tools/h5watch/CMakeTests.cmake index 2242692..35e7829 100644 --- a/hl/tools/h5watch/CMakeTests.cmake +++ b/hl/tools/h5watch/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/hl/tools/h5watch/Makefile.am b/hl/tools/h5watch/Makefile.am index b017e09..c60fceb 100644 --- a/hl/tools/h5watch/Makefile.am +++ b/hl/tools/h5watch/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index ab086f6..957db10 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5hltest.h" diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index 7289c58..11514b0 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5tools.h" diff --git a/hl/tools/h5watch/h5watchgentest.c b/hl/tools/h5watch/h5watchgentest.c index 12298ca..c5b76de 100644 --- a/hl/tools/h5watch/h5watchgentest.c +++ b/hl/tools/h5watch/h5watchgentest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/hl/tools/h5watch/swmr_check_compat_vfd.c b/hl/tools/h5watch/swmr_check_compat_vfd.c index 87b87c4..7d11a73 100644 --- a/hl/tools/h5watch/swmr_check_compat_vfd.c +++ b/hl/tools/h5watch/swmr_check_compat_vfd.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Purpose: This is a small program that checks if the HDF5_DRIVER diff --git a/hl/tools/h5watch/testh5watch.sh.in b/hl/tools/h5watch/testh5watch.sh.in index 33660b4..05e66bf 100644 --- a/hl/tools/h5watch/testh5watch.sh.in +++ b/hl/tools/h5watch/testh5watch.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5watch tool # diff --git a/java/COPYING b/java/COPYING index 6903daf..6497ace 100644 --- a/java/COPYING +++ b/java/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/java/Makefile.am b/java/Makefile.am index 10b1e91..7d0e2f0 100644 --- a/java/Makefile.am +++ b/java/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # # This makefile mostly just reinvokes make in the various subdirectories diff --git a/java/examples/Makefile.am b/java/examples/Makefile.am index e685e01..8ca49f2 100644 --- a/java/examples/Makefile.am +++ b/java/examples/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # # This makefile mostly just reinvokes make in the various subdirectories diff --git a/java/examples/datasets/H5Ex_D_Alloc.java b/java/examples/datasets/H5Ex_D_Alloc.java index 69fee38..e40c042 100644 --- a/java/examples/datasets/H5Ex_D_Alloc.java +++ b/java/examples/datasets/H5Ex_D_Alloc.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_Checksum.java b/java/examples/datasets/H5Ex_D_Checksum.java index 3a2f98f..9de09be 100644 --- a/java/examples/datasets/H5Ex_D_Checksum.java +++ b/java/examples/datasets/H5Ex_D_Checksum.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_Chunk.java b/java/examples/datasets/H5Ex_D_Chunk.java index b12b227..3d61e26 100644 --- a/java/examples/datasets/H5Ex_D_Chunk.java +++ b/java/examples/datasets/H5Ex_D_Chunk.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_Compact.java b/java/examples/datasets/H5Ex_D_Compact.java index 0417c7c..17c09f5 100644 --- a/java/examples/datasets/H5Ex_D_Compact.java +++ b/java/examples/datasets/H5Ex_D_Compact.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_External.java b/java/examples/datasets/H5Ex_D_External.java index 5fdc696..bf413ba 100644 --- a/java/examples/datasets/H5Ex_D_External.java +++ b/java/examples/datasets/H5Ex_D_External.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_FillValue.java b/java/examples/datasets/H5Ex_D_FillValue.java index 982d2cb..29cf4e1 100644 --- a/java/examples/datasets/H5Ex_D_FillValue.java +++ b/java/examples/datasets/H5Ex_D_FillValue.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_Gzip.java b/java/examples/datasets/H5Ex_D_Gzip.java index b813367..50f8835 100644 --- a/java/examples/datasets/H5Ex_D_Gzip.java +++ b/java/examples/datasets/H5Ex_D_Gzip.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_Hyperslab.java b/java/examples/datasets/H5Ex_D_Hyperslab.java index 482e2c0..88aa36e 100644 --- a/java/examples/datasets/H5Ex_D_Hyperslab.java +++ b/java/examples/datasets/H5Ex_D_Hyperslab.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_Nbit.java b/java/examples/datasets/H5Ex_D_Nbit.java index f74b675..0263659 100644 --- a/java/examples/datasets/H5Ex_D_Nbit.java +++ b/java/examples/datasets/H5Ex_D_Nbit.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_ReadWrite.java b/java/examples/datasets/H5Ex_D_ReadWrite.java index de94ccb..49bc2e5 100644 --- a/java/examples/datasets/H5Ex_D_ReadWrite.java +++ b/java/examples/datasets/H5Ex_D_ReadWrite.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_Shuffle.java b/java/examples/datasets/H5Ex_D_Shuffle.java index ac3c1b4..c7b7c53 100644 --- a/java/examples/datasets/H5Ex_D_Shuffle.java +++ b/java/examples/datasets/H5Ex_D_Shuffle.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_Sofloat.java b/java/examples/datasets/H5Ex_D_Sofloat.java index 26c8d49..f0a437d 100644 --- a/java/examples/datasets/H5Ex_D_Sofloat.java +++ b/java/examples/datasets/H5Ex_D_Sofloat.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_Soint.java b/java/examples/datasets/H5Ex_D_Soint.java index 7939883..fa4b416 100644 --- a/java/examples/datasets/H5Ex_D_Soint.java +++ b/java/examples/datasets/H5Ex_D_Soint.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_Szip.java b/java/examples/datasets/H5Ex_D_Szip.java index 5258234..8106557 100644 --- a/java/examples/datasets/H5Ex_D_Szip.java +++ b/java/examples/datasets/H5Ex_D_Szip.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_Transform.java b/java/examples/datasets/H5Ex_D_Transform.java index 1f289f3..ada488a 100644 --- a/java/examples/datasets/H5Ex_D_Transform.java +++ b/java/examples/datasets/H5Ex_D_Transform.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_UnlimitedAdd.java b/java/examples/datasets/H5Ex_D_UnlimitedAdd.java index ada8df0..7e8ffaa 100644 --- a/java/examples/datasets/H5Ex_D_UnlimitedAdd.java +++ b/java/examples/datasets/H5Ex_D_UnlimitedAdd.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_UnlimitedGzip.java b/java/examples/datasets/H5Ex_D_UnlimitedGzip.java index c08ceef..42a6efd 100644 --- a/java/examples/datasets/H5Ex_D_UnlimitedGzip.java +++ b/java/examples/datasets/H5Ex_D_UnlimitedGzip.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/H5Ex_D_UnlimitedMod.java b/java/examples/datasets/H5Ex_D_UnlimitedMod.java index 884cad3..b38b233 100644 --- a/java/examples/datasets/H5Ex_D_UnlimitedMod.java +++ b/java/examples/datasets/H5Ex_D_UnlimitedMod.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datasets/Makefile.am b/java/examples/datasets/Makefile.am index 41ba6d1..18100a6 100644 --- a/java/examples/datasets/Makefile.am +++ b/java/examples/datasets/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/java/examples/datasets/runExample.sh.in b/java/examples/datasets/runExample.sh.in index 53d8070..21c3439 100644 --- a/java/examples/datasets/runExample.sh.in +++ b/java/examples/datasets/runExample.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # top_builddir=@top_builddir@ diff --git a/java/examples/datatypes/H5Ex_T_Array.java b/java/examples/datatypes/H5Ex_T_Array.java index 7b7009a..f7f58d2 100644 --- a/java/examples/datatypes/H5Ex_T_Array.java +++ b/java/examples/datatypes/H5Ex_T_Array.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_ArrayAttribute.java b/java/examples/datatypes/H5Ex_T_ArrayAttribute.java index ce97457..b571f0c 100644 --- a/java/examples/datatypes/H5Ex_T_ArrayAttribute.java +++ b/java/examples/datatypes/H5Ex_T_ArrayAttribute.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_Bit.java b/java/examples/datatypes/H5Ex_T_Bit.java index f76c7d5..e46f3b2 100644 --- a/java/examples/datatypes/H5Ex_T_Bit.java +++ b/java/examples/datatypes/H5Ex_T_Bit.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_BitAttribute.java b/java/examples/datatypes/H5Ex_T_BitAttribute.java index a5ab81b..43de4ea 100644 --- a/java/examples/datatypes/H5Ex_T_BitAttribute.java +++ b/java/examples/datatypes/H5Ex_T_BitAttribute.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_Commit.java b/java/examples/datatypes/H5Ex_T_Commit.java index d4e43f9..4108979 100644 --- a/java/examples/datatypes/H5Ex_T_Commit.java +++ b/java/examples/datatypes/H5Ex_T_Commit.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_Compound.java b/java/examples/datatypes/H5Ex_T_Compound.java index f270cb9..c021c18 100644 --- a/java/examples/datatypes/H5Ex_T_Compound.java +++ b/java/examples/datatypes/H5Ex_T_Compound.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_CompoundAttribute.java b/java/examples/datatypes/H5Ex_T_CompoundAttribute.java index 25581d4..971939a 100644 --- a/java/examples/datatypes/H5Ex_T_CompoundAttribute.java +++ b/java/examples/datatypes/H5Ex_T_CompoundAttribute.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_Float.java b/java/examples/datatypes/H5Ex_T_Float.java index 1b5fd9b..f677479 100644 --- a/java/examples/datatypes/H5Ex_T_Float.java +++ b/java/examples/datatypes/H5Ex_T_Float.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_FloatAttribute.java b/java/examples/datatypes/H5Ex_T_FloatAttribute.java index de1dac7..2e706d9 100644 --- a/java/examples/datatypes/H5Ex_T_FloatAttribute.java +++ b/java/examples/datatypes/H5Ex_T_FloatAttribute.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_Integer.java b/java/examples/datatypes/H5Ex_T_Integer.java index 2f365cd..56da623 100644 --- a/java/examples/datatypes/H5Ex_T_Integer.java +++ b/java/examples/datatypes/H5Ex_T_Integer.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_IntegerAttribute.java b/java/examples/datatypes/H5Ex_T_IntegerAttribute.java index c153d99..9de517c 100644 --- a/java/examples/datatypes/H5Ex_T_IntegerAttribute.java +++ b/java/examples/datatypes/H5Ex_T_IntegerAttribute.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_ObjectReference.java b/java/examples/datatypes/H5Ex_T_ObjectReference.java index 8a09f5b..8ce4f7b 100644 --- a/java/examples/datatypes/H5Ex_T_ObjectReference.java +++ b/java/examples/datatypes/H5Ex_T_ObjectReference.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_ObjectReferenceAttribute.java b/java/examples/datatypes/H5Ex_T_ObjectReferenceAttribute.java index e366681..4dc3677 100644 --- a/java/examples/datatypes/H5Ex_T_ObjectReferenceAttribute.java +++ b/java/examples/datatypes/H5Ex_T_ObjectReferenceAttribute.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_Opaque.java b/java/examples/datatypes/H5Ex_T_Opaque.java index eb45686..6b0dc63 100644 --- a/java/examples/datatypes/H5Ex_T_Opaque.java +++ b/java/examples/datatypes/H5Ex_T_Opaque.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_OpaqueAttribute.java b/java/examples/datatypes/H5Ex_T_OpaqueAttribute.java index e42bfe8..6b8d1f8 100644 --- a/java/examples/datatypes/H5Ex_T_OpaqueAttribute.java +++ b/java/examples/datatypes/H5Ex_T_OpaqueAttribute.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_String.java b/java/examples/datatypes/H5Ex_T_String.java index 469172d..7c190b7 100644 --- a/java/examples/datatypes/H5Ex_T_String.java +++ b/java/examples/datatypes/H5Ex_T_String.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_StringAttribute.java b/java/examples/datatypes/H5Ex_T_StringAttribute.java index 49361bc..f9ec155 100644 --- a/java/examples/datatypes/H5Ex_T_StringAttribute.java +++ b/java/examples/datatypes/H5Ex_T_StringAttribute.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/H5Ex_T_VLString.java b/java/examples/datatypes/H5Ex_T_VLString.java index c8892ba..39be3e5 100644 --- a/java/examples/datatypes/H5Ex_T_VLString.java +++ b/java/examples/datatypes/H5Ex_T_VLString.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/datatypes/Makefile.am b/java/examples/datatypes/Makefile.am index 7d95a56..71f7769 100644 --- a/java/examples/datatypes/Makefile.am +++ b/java/examples/datatypes/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/java/examples/datatypes/runExample.sh.in b/java/examples/datatypes/runExample.sh.in index 5b8816c..32e9ade 100644 --- a/java/examples/datatypes/runExample.sh.in +++ b/java/examples/datatypes/runExample.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # top_builddir=@top_builddir@ diff --git a/java/examples/groups/H5Ex_G_Compact.java b/java/examples/groups/H5Ex_G_Compact.java index ca9b6c8..7e20c2a 100644 --- a/java/examples/groups/H5Ex_G_Compact.java +++ b/java/examples/groups/H5Ex_G_Compact.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/groups/H5Ex_G_Corder.java b/java/examples/groups/H5Ex_G_Corder.java index 95790bf..53d0011 100644 --- a/java/examples/groups/H5Ex_G_Corder.java +++ b/java/examples/groups/H5Ex_G_Corder.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ Creating a file with creation properties and traverse the diff --git a/java/examples/groups/H5Ex_G_Create.java b/java/examples/groups/H5Ex_G_Create.java index 1902d86..0e729d5 100644 --- a/java/examples/groups/H5Ex_G_Create.java +++ b/java/examples/groups/H5Ex_G_Create.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/groups/H5Ex_G_Intermediate.java b/java/examples/groups/H5Ex_G_Intermediate.java index a3d620b..f7d5a50 100644 --- a/java/examples/groups/H5Ex_G_Intermediate.java +++ b/java/examples/groups/H5Ex_G_Intermediate.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/groups/H5Ex_G_Iterate.java b/java/examples/groups/H5Ex_G_Iterate.java index d0b4ea4..3c9ca82 100644 --- a/java/examples/groups/H5Ex_G_Iterate.java +++ b/java/examples/groups/H5Ex_G_Iterate.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/groups/H5Ex_G_Phase.java b/java/examples/groups/H5Ex_G_Phase.java index f23d6f2..bfb775b 100644 --- a/java/examples/groups/H5Ex_G_Phase.java +++ b/java/examples/groups/H5Ex_G_Phase.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/groups/H5Ex_G_Traverse.java b/java/examples/groups/H5Ex_G_Traverse.java index b00fe97..2a2cba3 100644 --- a/java/examples/groups/H5Ex_G_Traverse.java +++ b/java/examples/groups/H5Ex_G_Traverse.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/groups/H5Ex_G_Visit.java b/java/examples/groups/H5Ex_G_Visit.java index c2367a6..f91c707 100644 --- a/java/examples/groups/H5Ex_G_Visit.java +++ b/java/examples/groups/H5Ex_G_Visit.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/groups/Makefile.am b/java/examples/groups/Makefile.am index be15b42..08721e0 100644 --- a/java/examples/groups/Makefile.am +++ b/java/examples/groups/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/java/examples/groups/runExample.sh.in b/java/examples/groups/runExample.sh.in index 2a3f1c6..3732e7f 100644 --- a/java/examples/groups/runExample.sh.in +++ b/java/examples/groups/runExample.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # top_builddir=@top_builddir@ diff --git a/java/examples/intro/H5_CreateAttribute.java b/java/examples/intro/H5_CreateAttribute.java index 16c53d6..68749b1 100644 --- a/java/examples/intro/H5_CreateAttribute.java +++ b/java/examples/intro/H5_CreateAttribute.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/intro/H5_CreateDataset.java b/java/examples/intro/H5_CreateDataset.java index a16cfe6..3572a31 100644 --- a/java/examples/intro/H5_CreateDataset.java +++ b/java/examples/intro/H5_CreateDataset.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/intro/H5_CreateFile.java b/java/examples/intro/H5_CreateFile.java index eb9f277..a8c87ea 100644 --- a/java/examples/intro/H5_CreateFile.java +++ b/java/examples/intro/H5_CreateFile.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/intro/H5_CreateGroup.java b/java/examples/intro/H5_CreateGroup.java index 36bd49a..9359605 100644 --- a/java/examples/intro/H5_CreateGroup.java +++ b/java/examples/intro/H5_CreateGroup.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/intro/H5_CreateGroupAbsoluteRelative.java b/java/examples/intro/H5_CreateGroupAbsoluteRelative.java index e0127cc..ddc069f 100644 --- a/java/examples/intro/H5_CreateGroupAbsoluteRelative.java +++ b/java/examples/intro/H5_CreateGroupAbsoluteRelative.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/intro/H5_CreateGroupDataset.java b/java/examples/intro/H5_CreateGroupDataset.java index 0607bbd..bdb0546 100644 --- a/java/examples/intro/H5_CreateGroupDataset.java +++ b/java/examples/intro/H5_CreateGroupDataset.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/intro/H5_ReadWrite.java b/java/examples/intro/H5_ReadWrite.java index 0d73884..5a7dabc 100644 --- a/java/examples/intro/H5_ReadWrite.java +++ b/java/examples/intro/H5_ReadWrite.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /************************************************************ diff --git a/java/examples/intro/Makefile.am b/java/examples/intro/Makefile.am index 3d5757a..95743d9 100644 --- a/java/examples/intro/Makefile.am +++ b/java/examples/intro/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/java/examples/intro/runExample.sh.in b/java/examples/intro/runExample.sh.in index 65ca160..4533a1b 100644 --- a/java/examples/intro/runExample.sh.in +++ b/java/examples/intro/runExample.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # top_builddir=@top_builddir@ diff --git a/java/src/Makefile.am b/java/src/Makefile.am index d9e6f50..64eef0c 100644 --- a/java/src/Makefile.am +++ b/java/src/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # # This makefile mostly just reinvokes make in the various subdirectories diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 5e13fdf..7b5b5c9 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 9773100..8a3d6c8 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/java/src/hdf/hdf5lib/HDF5GroupInfo.java b/java/src/hdf/hdf5lib/HDF5GroupInfo.java index fa33fec..a45cb7c 100644 --- a/java/src/hdf/hdf5lib/HDF5GroupInfo.java +++ b/java/src/hdf/hdf5lib/HDF5GroupInfo.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/java/src/hdf/hdf5lib/HDFArray.java b/java/src/hdf/hdf5lib/HDFArray.java index 55c19e4..529aecb 100644 --- a/java/src/hdf/hdf5lib/HDFArray.java +++ b/java/src/hdf/hdf5lib/HDFArray.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/java/src/hdf/hdf5lib/HDFNativeData.java b/java/src/hdf/hdf5lib/HDFNativeData.java index 66929fb..9637f62 100644 --- a/java/src/hdf/hdf5lib/HDFNativeData.java +++ b/java/src/hdf/hdf5lib/HDFNativeData.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib; diff --git a/java/src/hdf/hdf5lib/callbacks/Callbacks.java b/java/src/hdf/hdf5lib/callbacks/Callbacks.java index 5757eef..9fc961a 100644 --- a/java/src/hdf/hdf5lib/callbacks/Callbacks.java +++ b/java/src/hdf/hdf5lib/callbacks/Callbacks.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java index fa390a2..988c8fb 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java index 4816f8f..51d67d5 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java b/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java index 1b66e34..ead8f73 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java b/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java index dcbd331..8bf6410 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java index bac3dd9..a911a1c 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java index 03bcc20..d049711 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java b/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java index 672d151..afc04ae 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java b/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java index f3f8a39..0be8977 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_cb.java index 5218311..ec71911 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java index b7c25f4..28ffb8a 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_cb.java index 630205f..89cf206 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java index da64f19..1491b09 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java index dcd4ed2..e77d386 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java index 222bd26..0d5ad9e 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java index 0dc8a94..139f877 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java index eed29bb..12c2601 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java index 777e302..e64ec6f 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java index 78973f0..73646f1 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java index 0d98325..5ecb88d 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java index dbbf80d..2e320b4 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java index 3ea44ac..103fe5f 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java index 0daaca5..46477b9 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java index 4e560e2..57994bb5 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java index dc4fee1..8791c22 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java index 9aa27ab..46cd097 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java index bfc7b37..04599a0 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java index c1e9b00..6ac750f 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.callbacks; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5AtomException.java b/java/src/hdf/hdf5lib/exceptions/HDF5AtomException.java index 3309223..850044c 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5AtomException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5AtomException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5AttributeException.java b/java/src/hdf/hdf5lib/exceptions/HDF5AttributeException.java index 8c1a7b8..87b075b 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5AttributeException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5AttributeException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5BtreeException.java b/java/src/hdf/hdf5lib/exceptions/HDF5BtreeException.java index dc82fd9..5118254 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5BtreeException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5BtreeException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5DataFiltersException.java b/java/src/hdf/hdf5lib/exceptions/HDF5DataFiltersException.java index 17fd9db..14ae43f 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5DataFiltersException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5DataFiltersException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5DataStorageException.java b/java/src/hdf/hdf5lib/exceptions/HDF5DataStorageException.java index f22c9ec..721d3ef 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5DataStorageException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5DataStorageException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5DatasetInterfaceException.java b/java/src/hdf/hdf5lib/exceptions/HDF5DatasetInterfaceException.java index e39709d..3c55a6b 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5DatasetInterfaceException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5DatasetInterfaceException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5DataspaceInterfaceException.java b/java/src/hdf/hdf5lib/exceptions/HDF5DataspaceInterfaceException.java index 531202c..c0182ee 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5DataspaceInterfaceException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5DataspaceInterfaceException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5DatatypeInterfaceException.java b/java/src/hdf/hdf5lib/exceptions/HDF5DatatypeInterfaceException.java index 3c0c144..4da074b 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5DatatypeInterfaceException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5DatatypeInterfaceException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java b/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java index 8a83ca1..1b55437 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5ExternalFileListException.java b/java/src/hdf/hdf5lib/exceptions/HDF5ExternalFileListException.java index 62c5dd8..28f5437 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5ExternalFileListException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5ExternalFileListException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5FileInterfaceException.java b/java/src/hdf/hdf5lib/exceptions/HDF5FileInterfaceException.java index 0b63b41..c8dbcea 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5FileInterfaceException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5FileInterfaceException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5FunctionArgumentException.java b/java/src/hdf/hdf5lib/exceptions/HDF5FunctionArgumentException.java index c984aae..e7f20e0 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5FunctionArgumentException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5FunctionArgumentException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5FunctionEntryExitException.java b/java/src/hdf/hdf5lib/exceptions/HDF5FunctionEntryExitException.java index 5dad930..26e836f 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5FunctionEntryExitException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5FunctionEntryExitException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5HeapException.java b/java/src/hdf/hdf5lib/exceptions/HDF5HeapException.java index dfe4ced..a32e2a1 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5HeapException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5HeapException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5InternalErrorException.java b/java/src/hdf/hdf5lib/exceptions/HDF5InternalErrorException.java index 45a836c..25ac572 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5InternalErrorException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5InternalErrorException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5JavaException.java b/java/src/hdf/hdf5lib/exceptions/HDF5JavaException.java index 2db79ef..7c61194 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5JavaException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5JavaException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java index 8b21ff8..5ae977d 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5LowLevelIOException.java b/java/src/hdf/hdf5lib/exceptions/HDF5LowLevelIOException.java index e0a95d0..6d792c3 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5LowLevelIOException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5LowLevelIOException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5MetaDataCacheException.java b/java/src/hdf/hdf5lib/exceptions/HDF5MetaDataCacheException.java index cbc3b75..02f2d33 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5MetaDataCacheException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5MetaDataCacheException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5ObjectHeaderException.java b/java/src/hdf/hdf5lib/exceptions/HDF5ObjectHeaderException.java index 0cdd0d1..2bb6861 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5ObjectHeaderException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5ObjectHeaderException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5PropertyListInterfaceException.java b/java/src/hdf/hdf5lib/exceptions/HDF5PropertyListInterfaceException.java index aa9f668..b1baaad 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5PropertyListInterfaceException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5PropertyListInterfaceException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java b/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java index 2c8c93b..ea4a89a 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5ResourceUnavailableException.java b/java/src/hdf/hdf5lib/exceptions/HDF5ResourceUnavailableException.java index f1c0c60..fc92578 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5ResourceUnavailableException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5ResourceUnavailableException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5SymbolTableException.java b/java/src/hdf/hdf5lib/exceptions/HDF5SymbolTableException.java index 87384d1..b90ce64 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5SymbolTableException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5SymbolTableException.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.exceptions; diff --git a/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java b/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java index 2128d8a..20863dc 100644 --- a/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java +++ b/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.structs; diff --git a/java/src/hdf/hdf5lib/structs/H5A_info_t.java b/java/src/hdf/hdf5lib/structs/H5A_info_t.java index b04a757..a46a495 100644 --- a/java/src/hdf/hdf5lib/structs/H5A_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5A_info_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.structs; diff --git a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java index b7cd60a..257ad05 100644 --- a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java +++ b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.structs; diff --git a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java index 8fbde68..4664b5b 100644 --- a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java +++ b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.structs; diff --git a/java/src/hdf/hdf5lib/structs/H5G_info_t.java b/java/src/hdf/hdf5lib/structs/H5G_info_t.java index daa6808..56c876e 100644 --- a/java/src/hdf/hdf5lib/structs/H5G_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5G_info_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.structs; diff --git a/java/src/hdf/hdf5lib/structs/H5L_info_t.java b/java/src/hdf/hdf5lib/structs/H5L_info_t.java index d43853f..3bbb189 100644 --- a/java/src/hdf/hdf5lib/structs/H5L_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5L_info_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.structs; diff --git a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java index 86cf883..a39c1ed 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.structs; diff --git a/java/src/hdf/hdf5lib/structs/H5O_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_info_t.java index a89aaf0..ac32f6a 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_info_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.structs; diff --git a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java index 450f548..ea36d85 100644 --- a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package hdf.hdf5lib.structs; diff --git a/java/src/jni/Makefile.am b/java/src/jni/Makefile.am index fdf6608..6ded371 100644 --- a/java/src/jni/Makefile.am +++ b/java/src/jni/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c index d0e7790..05c193f 100644 --- a/java/src/jni/exceptionImp.c +++ b/java/src/jni/exceptionImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/exceptionImp.h b/java/src/jni/exceptionImp.h index a9b812d..cb74602 100644 --- a/java/src/jni/exceptionImp.h +++ b/java/src/jni/exceptionImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index ddca853..cd1c2f0 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5Imp.c b/java/src/jni/h5Imp.c index e548363..2eeb075 100644 --- a/java/src/jni/h5Imp.c +++ b/java/src/jni/h5Imp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5Imp.h b/java/src/jni/h5Imp.h index 79ff3e4..756b8bb 100644 --- a/java/src/jni/h5Imp.h +++ b/java/src/jni/h5Imp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c index 5445904..26ec4fc 100644 --- a/java/src/jni/h5aImp.c +++ b/java/src/jni/h5aImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5aImp.h b/java/src/jni/h5aImp.h index 5362ab7..62769fd 100644 --- a/java/src/jni/h5aImp.h +++ b/java/src/jni/h5aImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c index 0bb015e..66efed0 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5dImp.h b/java/src/jni/h5dImp.h index e79c590..3cf24fe 100644 --- a/java/src/jni/h5dImp.h +++ b/java/src/jni/h5dImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c index 05a7848..24ddcbc 100644 --- a/java/src/jni/h5eImp.c +++ b/java/src/jni/h5eImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5eImp.h b/java/src/jni/h5eImp.h index 88bbdc1..051b2ed 100644 --- a/java/src/jni/h5eImp.h +++ b/java/src/jni/h5eImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5fImp.c b/java/src/jni/h5fImp.c index 4f0e569..8cf5252 100644 --- a/java/src/jni/h5fImp.c +++ b/java/src/jni/h5fImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5fImp.h b/java/src/jni/h5fImp.h index 396df65..fcfdedf 100644 --- a/java/src/jni/h5fImp.h +++ b/java/src/jni/h5fImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5gImp.c b/java/src/jni/h5gImp.c index d724475..41ec382 100644 --- a/java/src/jni/h5gImp.c +++ b/java/src/jni/h5gImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5gImp.h b/java/src/jni/h5gImp.h index dce1247..a411658 100644 --- a/java/src/jni/h5gImp.h +++ b/java/src/jni/h5gImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5iImp.c b/java/src/jni/h5iImp.c index 9c946df..47574ca 100644 --- a/java/src/jni/h5iImp.c +++ b/java/src/jni/h5iImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5iImp.h b/java/src/jni/h5iImp.h index 2bf839bc..2c854e6 100644 --- a/java/src/jni/h5iImp.h +++ b/java/src/jni/h5iImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5jni.h b/java/src/jni/h5jni.h index cef3bd0..2970e14 100644 --- a/java/src/jni/h5jni.h +++ b/java/src/jni/h5jni.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c index f7a9df1..bf2d7b1 100644 --- a/java/src/jni/h5lImp.c +++ b/java/src/jni/h5lImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5lImp.h b/java/src/jni/h5lImp.h index 6b2f3e1..3a7d8ea 100644 --- a/java/src/jni/h5lImp.h +++ b/java/src/jni/h5lImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c index a33d1d7..e8abead 100644 --- a/java/src/jni/h5oImp.c +++ b/java/src/jni/h5oImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5oImp.h b/java/src/jni/h5oImp.h index 5d07c29..224f298 100644 --- a/java/src/jni/h5oImp.h +++ b/java/src/jni/h5oImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index c9bd4aa..df8b3c9 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h index 03b0e03..d413f69 100644 --- a/java/src/jni/h5pImp.h +++ b/java/src/jni/h5pImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c index 9b6100e..f064634 100644 --- a/java/src/jni/h5plImp.c +++ b/java/src/jni/h5plImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5plImp.h b/java/src/jni/h5plImp.h index 5326a94..5336621 100644 --- a/java/src/jni/h5plImp.h +++ b/java/src/jni/h5plImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5rImp.c b/java/src/jni/h5rImp.c index 3dcbb8d..b250550 100644 --- a/java/src/jni/h5rImp.c +++ b/java/src/jni/h5rImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5rImp.h b/java/src/jni/h5rImp.h index 1f8d206..e28329b 100644 --- a/java/src/jni/h5rImp.h +++ b/java/src/jni/h5rImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c index 929f6d6..c578ab8 100644 --- a/java/src/jni/h5sImp.c +++ b/java/src/jni/h5sImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5sImp.h b/java/src/jni/h5sImp.h index fd2184d..141e504 100644 --- a/java/src/jni/h5sImp.h +++ b/java/src/jni/h5sImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5tImp.c b/java/src/jni/h5tImp.c index 26f9b5c..7b4af56 100644 --- a/java/src/jni/h5tImp.c +++ b/java/src/jni/h5tImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5tImp.h b/java/src/jni/h5tImp.h index 417d231..374d992 100644 --- a/java/src/jni/h5tImp.h +++ b/java/src/jni/h5tImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 17ed35e..8454815 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5util.h b/java/src/jni/h5util.h index 6194378..434a107 100644 --- a/java/src/jni/h5util.h +++ b/java/src/jni/h5util.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5zImp.c b/java/src/jni/h5zImp.c index 247d1cc..a5e6cd8 100644 --- a/java/src/jni/h5zImp.c +++ b/java/src/jni/h5zImp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/h5zImp.h b/java/src/jni/h5zImp.h index bbdc506..bffe9d8 100644 --- a/java/src/jni/h5zImp.h +++ b/java/src/jni/h5zImp.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/src/jni/nativeData.c b/java/src/jni/nativeData.c index a123e0f..33f4953 100644 --- a/java/src/jni/nativeData.c +++ b/java/src/jni/nativeData.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/java/src/jni/nativeData.h b/java/src/jni/nativeData.h index f8df4ce..e9e1a5d 100644 --- a/java/src/jni/nativeData.h +++ b/java/src/jni/nativeData.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/java/test/Makefile.am b/java/test/Makefile.am index 92ac12d..b7409cf 100644 --- a/java/test/Makefile.am +++ b/java/test/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/java/test/TestAll.java b/java/test/TestAll.java index a4b44c3..de5d333 100644 --- a/java/test/TestAll.java +++ b/java/test/TestAll.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5.java b/java/test/TestH5.java index 4c84988..413e58d 100644 --- a/java/test/TestH5.java +++ b/java/test/TestH5.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5A.java b/java/test/TestH5A.java index fb7b31a..5e1e3f6 100644 --- a/java/test/TestH5A.java +++ b/java/test/TestH5A.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5D.java b/java/test/TestH5D.java index fa051db..372fdba 100644 --- a/java/test/TestH5D.java +++ b/java/test/TestH5D.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Dparams.java b/java/test/TestH5Dparams.java index 2cdd121..a3618f2 100644 --- a/java/test/TestH5Dparams.java +++ b/java/test/TestH5Dparams.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Dplist.java b/java/test/TestH5Dplist.java index eb1669f..6feaa23 100644 --- a/java/test/TestH5Dplist.java +++ b/java/test/TestH5Dplist.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java index 028369d..9a36365 100644 --- a/java/test/TestH5E.java +++ b/java/test/TestH5E.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; @@ -543,8 +541,8 @@ public class TestH5E { } assertFalse("testH5Ewalk:H5Ewalk2 ",((H5E_walk_data)walk_data).walkdata.isEmpty()); assertTrue("testH5Ewalk:H5Ewalk2 "+((H5E_walk_data)walk_data).walkdata.size(),((H5E_walk_data)walk_data).walkdata.size()==3); - assertTrue("testH5Ewalk:H5Ewalk2 "+((wdata)((H5E_walk_data)walk_data).walkdata.get(0)).line,((wdata)((H5E_walk_data)walk_data).walkdata.get(0)).line==3767); - assertTrue("testH5Ewalk:H5Ewalk2 "+((wdata)((H5E_walk_data)walk_data).walkdata.get(1)).line,((wdata)((H5E_walk_data)walk_data).walkdata.get(1)).line==5506); + assertTrue("testH5Ewalk:H5Ewalk2 "+((wdata)((H5E_walk_data)walk_data).walkdata.get(0)).line,((wdata)((H5E_walk_data)walk_data).walkdata.get(0)).line==3765); + assertTrue("testH5Ewalk:H5Ewalk2 "+((wdata)((H5E_walk_data)walk_data).walkdata.get(1)).line,((wdata)((H5E_walk_data)walk_data).walkdata.get(1)).line==5504); assertTrue("testH5Ewalk:H5Ewalk2 "+((wdata)((H5E_walk_data)walk_data).walkdata.get(1)).func_name,((wdata)((H5E_walk_data)walk_data).walkdata.get(1)).func_name.compareToIgnoreCase("H5P_verify_apl_and_dxpl")==0); assertTrue("testH5Ewalk:H5Ewalk2 "+((wdata)((H5E_walk_data)walk_data).walkdata.get(0)).err_desc,((wdata)((H5E_walk_data)walk_data).walkdata.get(0)).err_desc.compareToIgnoreCase("not a property list")==0); assertTrue("testH5Ewalk:H5Ewalk2 "+((wdata)((H5E_walk_data)walk_data).walkdata.get(1)).err_desc,((wdata)((H5E_walk_data)walk_data).walkdata.get(1)).err_desc.compareToIgnoreCase("not the required access property list")==0); diff --git a/java/test/TestH5Edefault.java b/java/test/TestH5Edefault.java index 510aa2f..835ccba 100644 --- a/java/test/TestH5Edefault.java +++ b/java/test/TestH5Edefault.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Eregister.java b/java/test/TestH5Eregister.java index 13e0ca2..742b47f 100644 --- a/java/test/TestH5Eregister.java +++ b/java/test/TestH5Eregister.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5F.java b/java/test/TestH5F.java index 3451187..ac2f70d 100644 --- a/java/test/TestH5F.java +++ b/java/test/TestH5F.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Fbasic.java b/java/test/TestH5Fbasic.java index c08daff..faf0bf7 100644 --- a/java/test/TestH5Fbasic.java +++ b/java/test/TestH5Fbasic.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Fparams.java b/java/test/TestH5Fparams.java index 2d67f3d..fffded1 100644 --- a/java/test/TestH5Fparams.java +++ b/java/test/TestH5Fparams.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Fswmr.java b/java/test/TestH5Fswmr.java index b65ebf2..5ca1a97 100644 --- a/java/test/TestH5Fswmr.java +++ b/java/test/TestH5Fswmr.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5G.java b/java/test/TestH5G.java index 32329bb..1a67990 100644 --- a/java/test/TestH5G.java +++ b/java/test/TestH5G.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Gbasic.java b/java/test/TestH5Gbasic.java index b049e15..6ff7d03 100644 --- a/java/test/TestH5Gbasic.java +++ b/java/test/TestH5Gbasic.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Giterate.java b/java/test/TestH5Giterate.java index 17f594e..06c59e7 100644 --- a/java/test/TestH5Giterate.java +++ b/java/test/TestH5Giterate.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Lbasic.java b/java/test/TestH5Lbasic.java index c35519e..9e832f3 100644 --- a/java/test/TestH5Lbasic.java +++ b/java/test/TestH5Lbasic.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Lcreate.java b/java/test/TestH5Lcreate.java index 2fbd9e3..dcb076d 100644 --- a/java/test/TestH5Lcreate.java +++ b/java/test/TestH5Lcreate.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Lparams.java b/java/test/TestH5Lparams.java index 9a2c204..c8d5f5d 100644 --- a/java/test/TestH5Lparams.java +++ b/java/test/TestH5Lparams.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Obasic.java b/java/test/TestH5Obasic.java index b564089..923d2b1 100644 --- a/java/test/TestH5Obasic.java +++ b/java/test/TestH5Obasic.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Ocopy.java b/java/test/TestH5Ocopy.java index cf0fb1f..e730b9f 100644 --- a/java/test/TestH5Ocopy.java +++ b/java/test/TestH5Ocopy.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Ocreate.java b/java/test/TestH5Ocreate.java index 0edecba..559e12b 100644 --- a/java/test/TestH5Ocreate.java +++ b/java/test/TestH5Ocreate.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Oparams.java b/java/test/TestH5Oparams.java index 9398940..2af190f 100644 --- a/java/test/TestH5Oparams.java +++ b/java/test/TestH5Oparams.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index fa8b525..5aafb5b 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5PData.java b/java/test/TestH5PData.java index 7fc154d..c414d67 100644 --- a/java/test/TestH5PData.java +++ b/java/test/TestH5PData.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5PL.java b/java/test/TestH5PL.java index 759db5f..aa59478 100644 --- a/java/test/TestH5PL.java +++ b/java/test/TestH5PL.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index e888e20..d4a2231 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Plist.java b/java/test/TestH5Plist.java index 024237a..e318cc9 100644 --- a/java/test/TestH5Plist.java +++ b/java/test/TestH5Plist.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java index 15fbd03..40cfbac 100644 --- a/java/test/TestH5Pvirtual.java +++ b/java/test/TestH5Pvirtual.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5R.java b/java/test/TestH5R.java index 72e0bfb..5349855 100644 --- a/java/test/TestH5R.java +++ b/java/test/TestH5R.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5S.java b/java/test/TestH5S.java index 909ab02..985342b 100644 --- a/java/test/TestH5S.java +++ b/java/test/TestH5S.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Sbasic.java b/java/test/TestH5Sbasic.java index 2731a06..3007495 100644 --- a/java/test/TestH5Sbasic.java +++ b/java/test/TestH5Sbasic.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5T.java b/java/test/TestH5T.java index e03b97f..0c68d2e 100644 --- a/java/test/TestH5T.java +++ b/java/test/TestH5T.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Tbasic.java b/java/test/TestH5Tbasic.java index 950f1c7..3c2500b 100644 --- a/java/test/TestH5Tbasic.java +++ b/java/test/TestH5Tbasic.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Tparams.java b/java/test/TestH5Tparams.java index 4ebeea7..53d3a37 100644 --- a/java/test/TestH5Tparams.java +++ b/java/test/TestH5Tparams.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/TestH5Z.java b/java/test/TestH5Z.java index bdf3f1d..31adf22 100644 --- a/java/test/TestH5Z.java +++ b/java/test/TestH5Z.java @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package test; diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index 31037ba..32b0832 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # top_builddir=@top_builddir@ diff --git a/m4/aclocal_cxx.m4 b/m4/aclocal_cxx.m4 index 9d47193..29a0607 100644 --- a/m4/aclocal_cxx.m4 +++ b/m4/aclocal_cxx.m4 @@ -6,12 +6,10 @@ dnl All rights reserved. dnl dnl This file is part of HDF5. The full HDF5 copyright notice, including dnl terms governing use, modification, and redistribution, is contained in -dnl the files COPYING and Copyright.html. COPYING can be found at the root -dnl of the source code distribution tree; Copyright.html can be found at the -dnl root level of an installed copy of the electronic HDF5 document set and -dnl is linked from the top-level documents page. It can also be found at -dnl http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have -dnl access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. +dnl the COPYING file, which can be found at the root of the source code +dnl distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +dnl If you do not have access to either file, you may request a copy from +dnl help@hdfgroup.org dnl dnl ------------------------------------------------------------------------- dnl ------------------------------------------------------------------------- diff --git a/m4/aclocal_fc.f90 b/m4/aclocal_fc.f90 index ddbe9c7..4c58e4e 100644 --- a/m4/aclocal_fc.f90 +++ b/m4/aclocal_fc.f90 @@ -1,3 +1,16 @@ +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! All rights reserved. * +! * +! This file is part of HDF5. The full HDF5 copyright notice, including * +! terms governing use, modification, and redistribution, is contained in * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! ! This file contains all the configure test programs ! used by autotools and cmake. This avoids having to ! duplicate code for both cmake and autotool tests. diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index 2213a7c..0bf3cb1 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -6,12 +6,10 @@ dnl All rights reserved. dnl dnl This file is part of HDF5. The full HDF5 copyright notice, including dnl terms governing use, modification, and redistribution, is contained in -dnl the files COPYING and Copyright.html. COPYING can be found at the root -dnl of the source code distribution tree; Copyright.html can be found at the -dnl root level of an installed copy of the electronic HDF5 document set and -dnl is linked from the top-level documents page. It can also be found at -dnl http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have -dnl access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. +dnl the COPYING file, which can be found at the root of the source code +dnl distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +dnl If you do not have access to either file, you may request a copy from +dnl help@hdfgroup.org dnl dnl ------------------------------------------------------------------------- dnl ------------------------------------------------------------------------- diff --git a/release_docs/COPYING b/release_docs/COPYING index 6903daf..6497ace 100644 --- a/release_docs/COPYING +++ b/release_docs/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/release_docs/HISTORY-1_10.txt b/release_docs/HISTORY-1_10.txt new file mode 100644 index 0000000..03d0e3e --- /dev/null +++ b/release_docs/HISTORY-1_10.txt @@ -0,0 +1,1367 @@ +HDF5 History +============ + +This file contains development history of the HDF5 1.10 branch + +02. Release Information for hdf5-1.10.0-patch1 +01. Release Information for hdf5-1.10.0 + +[Search on the string '%%%%' for section breaks of each release.] + +%%%%1.10.0-patch1%%%% + + +HDF5 version 1.10.0-patch1 released on 2016-05-23 +================================================================================ + +INTRODUCTION + +This document describes the differences between HDF5-1.8 series and +HDF5 1.10.0 releases, and contains information on the platforms +tested. + +Links to HDF5 1.10.0 source code can be found on The HDF Group's +development FTP server at the following location: + + https://www.hdfgroup.org/HDF5/release/obtain5110.html + +User documentation can be accessed directly at this location: + + https://www.hdfgroup.org/HDF5/docNewFeatures/ + +For more information, see the HDF5 home page: + + https://www.hdfgroup.org/HDF5/ + +If you have any questions or comments, please send them to the HDF +Help Desk: + + help@hdfgroup.org + + + +CONTENTS + +- New Features +- Issues Addressed in this Release +- Supported Platforms +- Tested Configuration Features Summary +- More Tested Platforms +- Known Problems and Limitations + + + +New Features +============ +This release supports the following features: + + Configuration + ------------- + - API Compatibility with HDF5 1.8 Flag Was Added + + The 1.10 version of the HDF5 Library can be configured to operate + identically to the 1.8 library with the --with-default-api-version=v18 + configure flag. This allows existing code to be compiled with the 1.10 + library without requiring immediate changes to the application source + code. For addtional configuration options and other details, see + "API Compatibility Macros in HDF5" at + https://www.hdfgroup.org/HDF5/doc/RM/APICompatMacros.html. + + - Autotools Configuration Has Been Extensively Reworked + + The autotools configuration options have been updated to allow more + fine-grained control of the build options and to correct some bugs. + See configure --help for comprehensive information on each option. + + Specific changes: + + * --enable-debug and --enable-production are no longer accepted. + Use --enable-build-mode=(debug | production) instead. These set + appropriate defaults for symbols, optimizations, and other + configuration options. These defaults can be overridden by the + user. + + * Extra debug output messages are no longer enabled with + --enable-debug=. Use --enable-internal-debug= + instead. + + * A new --enable-symbols option allows symbols to be generated + independently of the build mode. --disable-symbols can be used + to strip symbols from the binary. + + * A new --enable-asserts option sets/unsets NDEBUG. This is + independent of the build mode. This also enables some extra + low-overhead debug checks in the library. + + * A new --enable-profiling option sets profiling flags. This is + independent of the build mode. + + * A new --enable-optimization option sets the optimization level. + This is independent of the build mode. + + * Many of these options can take a flags string that will be used + to build the library. This can be useful for specifying custom + optimization flags such as -Os and -Ofast. + + * gnu C++ and Fortran use configure sub-files that update the + build flags and turn on warnings. The increase in warnings when + building these wrapper libraries is due to these flag changes + and not to a decrease in code quality. + + * The option to clear file buffers has been removed. Any buffer that + will eventually be written to disk will now always be memset + to zero. This prevents the previous contents of the buffer from + being written to the disk if the buffer contents are not + completely overwritten, which has security implications. + + - LFS Changes + + The way the autotools handle large file support (LFS) has been + overhauled in this release. + + * We assume ftello and fseeko exist + + * We no longer explicitly use the *64 I/O functions. Instead, we + rely on a mapping provided by _FILE_OFFSET_BITS or its equivalent. + + * _LARGEFILE(64)_SOURCE is no longer exported via AM_CPPFLAGS. + + + + Parallel Library + ----------------- + - Collective Metadata I/O + + Calls for HDF5 metadata can result in many small reads and writes. + On metadata reads, collective metadata I/O can improve performance + by allowing the library to perform optimizations when reading the + metadata by having one rank read the data and broadcasting it to + all other ranks. + + Collective metadata I/O improves metadata write performance through + the construction of an MPI derived datatype that is then written + collectively in a single call. For more information, see + https://www.hdfgroup.org/HDF5/docNewFeatures/NewFeaturesCollectiveMetadataIoDocs.html. + + + + Library + -------- + - Concurrent Access to HDF5 Files - Single Writer/ Multple Reader (SWMR) + + The Single Writer/ Multiple Reader or SWMR feature enables users to + read data concurrently while writing it. Communications between the + processes and file locking are not required. The processes can run + on the same or on different platforms as long as they share a common + file system that is POSIX compliant. For more information, see the + Single-Writer/Multiple-Reader (SWMR) documentation at + https://www.hdfgroup.org/HDF5/docNewFeatures/NewFeaturesSwmrDocs.html. + + - Virtual Dataset (VDS) + + The VDS feature enables data to be accessed across HDF5 files + using standard HDF5 objects such as groups and datasets without + rewriting or rearranging the data. An HDF5 virtual dataset (VDS) + is an HDF5 dataset that is composed of source HDF5 datasets in + a predefined mapping. VDS can be used with the SWMR feature. For + documentation, check + https://www.hdfgroup.org/HDF5/docNewFeatures/NewFeaturesVirtualDatasetDocs.html. + + - Persistent Free File Space Tracking + + Usage patterns when working with an HDF5 file sometimes result in + wasted space within the file. This can also impair access times + when working with the resulting files. The new file space management + feature provides strategies for managing space in a file to improve + performance in both of these areas. For more information, see + https://www.hdfgroup.org/HDF5/docNewFeatures/NewFeaturesFileSpaceMgmtDocs.html. + + - Version 3 Metadata Cache + + The version 3 metadata cache moves management of metadata I/O from + the clients to the metadata cache proper. This change is essential for + SWMR and other features that have yet to be released. + + + + C++ Library + ------------ + - New Member Function Added to H5::ArrayType + + The assignment operator ArrayType::operator= was added because + ArrayType has pointer data members. + + (BMR - 2016/03/07, HDFFV-9562) + + + + Tools + ------ + - h5watch + + The h5watch tool allows users to output new records appended to + a dataset under SWMR access as it grows. The functionality is + similar to the Unix user command "tail" with the follow option, + which outputs appended data as the file grows. For more + information, see + https://www.hdfgroup.org/HDF5/docNewFeatures/NewFeaturesSwmrDocs.html#Tools. + + - h5format_convert + + The h5format_convert tool allows users to convert the indexing + type of a chunked dataset made with a 1.10.x version of the HDF5 + Library when the latest file format is used to the 1.8.x version 1 B-tree indexing + type. For example, datasets created using SWMR access, can be + converted to be accessed by the HDF5 1.18 library and tools. The + tool does not rewrite raw data, but it does rewrite HDF5 metadata. + + + + High-Level APIs + ---------------- + - H5DOappend + + The function appends data to a dataset along a specified dimension. + + + C Packet Table API + ------------------ + - Replacement of a Public Function with H5PTcreate + + The existing function H5PTcreate_fl limits applications so they + can use the deflate compression only. The public function + H5PTcreate has been added to replace H5PTcreate_fl. H5PTcreate + takes a property list identifier to provide flexibility on + creation properties. + + (BMR - 2016/03/04, HDFFV-8623) + + - New Public Functions: H5PTget_dataset and H5PTget_type + + Two accessor functions have been added. H5PTget_dataset returns + the identifier of the dataset associated with the packet table, + and H5PTget_type returns the identifier of the datatype used by + the packet table. + + (BMR, 2016/03/04, HDFFV-8623) + + - Regarding #ifdef VLPT_REMOVED + + The #ifdef VLPT_REMOVED blocks have been removed from the packet + table (PT) library source except for the following functions: + + H5PTis_varlen() has been made available again + + H5PTfree_vlen_readbuff() is now H5PTfree_vlen_buff() + + (BMR - 2016/03/04, HDFFV-442) + + C++ Packet Table API + -------------------- + - New Constructor Added to FL_PacketTable + + An overloaded constructor has been added to FL_PacketTable and + takes a property list identifier to provide flexibility on + creation properties. + + (BMR - 2016/03/08, HDFFV-8623) + + - New Public Functions + + Two accessor wrappers are added to class PacketTable. + PacketTable::GetDataset() returns the identifier of the dataset + associated with the packet table, and PacketTable::GetDatatype() + returns the identifier of the datatype that the packet table uses. + + (BMR - 2016/03/04, HDFFV-8623) + + - Member Functions with "char*" as an Argument + + Overloaded functions were added to provide the "const char*" + argument; the existing version will be deprecated in future + releases. + + (BMR - 2016/03/04, HDFFV-8623) + + - Regarding #ifdef VLPT_REMOVED + + The #ifdef VLPT_REMOVED blocks have been removed from the packet + table library source code except for the following functions: + + VL_PacketTable::IsVariableLength() was moved to PacketTable + + VL_PacketTable::FreeReadBuff() is now PacketTable::FreeBuff() + + (BMR - 2016/03/04, HDFFV-442) + + + + Java Wrapper Library + -------------------- + + The Java HDF5 JNI library has been integrated into the HDF5 repository. + The configure option is "--enable-java", and the CMake option is + HDF5_BUILD_JAVA:BOOL=ON. The package hierarchy has changed from the + HDF5 1.8 JNI, which was "ncsa.hdf.hdflib.hdf5", to HDF5 1.10, + "hdf.hdflib.hdf5". + + A number of new APIs were added including some for VDS and SWMR. + + + + Other Important Changes + ----------------------- + + The hid_t type was changed from 32-bit to a 64-bit value. + + + +Issues Addressed in this Release Since 1.10.0 +============================================= + + - h5diff would return from a compare attributes abnormally if one of the datatypes + was a vlen. This resulted in a memory leak as well as an incorrect report of + attribute comparison. + + Fixed. + (ADB - 2016/04/26, HDFFV-9784) + + - The JUnit-interface test may fail on Solaris platforms. The result of + a test for verifying the content of the error stack to stdout is + in a different order on Solaris then other platforms. + + This test is skipped on Solaris + (ADB - 2016/04/21, HDFFV-9734) + + - When building HDF5 with Java using CMake and specifying Debug for CMAKE_BUILD_TYPE, + there was a missing command argument for the tests of the examples. + + Fixed. + (ADB - 2016/04/21, HDFFV-9743) + + - Changed h5diff to print a warning when a dataset is virtual, enabling + the data to be compared. In addition h5repack failed to copy the data + of a virtual dataset to the new file. Function H5D__get_space_status changed + to correctly determine the H5D_space_status_t allocation value. + + CMake added the Fixed Array indexing tests that were only in the autotools + test scripts. + + Fixed and tests added for vds issues. + (ADB,NAF - 2016/04/21, HDFFV-9756) + + - CMake added the h5format_convert tool and tests that were only in the autotools + build and test scripts. The autotools test script was reworked to allow CMake + to execute the test suite in parallel. + + Also, h5clear tool and tests were added to the misc folder. + + Fixed. + (ADB - 2016/04/21, HDFFV-9766) + + - CMake added the h5watch tool and argument tests that were only in the autotools + build and test scripts. The POSIX only tests were not added to CMake. + + CMake HL tools files were refactored to move the CMake test scripts into each tool folder. + + Fixed. + (ADB - 2016/04/21, HDFFV-9770) + + - Configure fails to detect valid real KINDs on FreeBSD 9.3 (i386) with Fortran enabled. + + Fixed. Added the exponential option to SELECTED_REAL_KIND to distinguish + KINDs of same precision + (MSB - 2016/05/14,HDFFV-9912) + + + - Corrected the f90 H5AWRITE_F integer interface's buf to be INTENT(IN). + (MSB - 2016/05/14) + + - Configure fails in sed command on FreeBSD 9.3 (i386) with Fortran enabled. + + Fixed. + (MSB - 2016/05/14,HDFFV-9912) + + - Compile time error in H5f90global.F90 with IBM XL Fortran 14.1.0.13 on BG/Q with Fortran + enabled. + + Fixed. + (MSB - 2016/05/16,HDFFV-9917) + + - A cmake build with Fortran enabled does not install module h5fortkit + + Fixed. + (MSB - 2016/05/23,HDFFV-9923) + + +Issues Addressed in this Release Since alpha1 +============================================= + + - H5Pget_virtual_printf_gap, H5Pget_virtual_view, H5Pget_efile_prefix + + The correct access property list settings from the + H5Pget_virtual_printf_gap, H5Pget_virtual_view, and + H5Pget_efile_prefix function calls could not be retrieved + using H5Dget_access_plist(). + + Fixed. + + (DER and NAF - 2016/03/14, HDFFV-9716) + + - h5dump + + When h5dump was provided with the name of a non-existing file or + when optional arguments were the last option on the command line, + h5dump would segfault. + + Fixed. + + (ADB 2016/02/28 HDFFV-9639, HDFFV-9684) + + - No Error Message for Corrupt Metadata + + The HDF5 Library did not propagate an error when it encountered + corrupt metadata in an HDF5 file. The issue was fixed for a + specific file provided by a user. If you still see the problem, + please contact help@hdfgroup.org + + Fixed. + + (MC - 2016/02/18, HDFFV-9670) + + - Problem Reading Chunked Datasets with a String Datatype Larger + Than the Chunk Size in Bytes + + When the latest file format was used and when a chunked dataset + was created with a datatype with the size bigger than a chunk + size, the data could not be read back. The issue was reported + for chunked datasets with a string datatype and was confirmed + for other datatypes with the sizes bigger than the chunk size in + bytes. + + Fixed. + + (JM - 2016/02/13, HDFFV-9672) + + - Control over the Location of External Files + + Users were unable to specify the locations of external files. + + Two APIs - H5Pget_efile_prefix and H5Pset_efile_prefix - were + added so that users could specify the locations of external files. + + (DER - 2016/02/04, HDFFV-8740) + + + +Issues Addressed in this Release Since alpha0 +============================================= + - h5format_convert + + The h5format_convert tool did not downgrade the version of the + superblock. + + Fixed. The tool now will downgrade the version of the superblock. + + (EIP 2016/01/11) + + - Crashes with multiple threads: invalid pointers + + It was reported that alpha0 crashed when used with multiple + threads. The issue exists in the HDF5 Library versions 1.8 and + 1.9. The problem is related to a shared file pointer used in some + miscellaneous data structures. The thread-safe library exposed + paths in the library where a file pointer became invalid. + + The alpha1 release contains the fixes for the specific use case + as described in HDFFV-9643. We will keep working on identifying + and fixing other paths in the library with similar problems. + + (EIP - 2016/01/15, HDFFV-9643) + + + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + AIX 6.1 xlc/xlc_r 10.1.0.5 + (NASA G-ADA) xlC/xlC_r 10.1.0.5 + xlf90/xlf90_r 12.1.0.6 + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (mayll/platypus) Version 4.4.7 20120313 (Red Hat 4.4.7-16) + Version 4.9.3, Version 5.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 15.7-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 Build 20150407 + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 2.6.32-573.18.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Version 4.9.3, Version 5.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 Build 20150407 + MPICH 3.1.4 compiled with GCC 4.9.3 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Cygwin(CYGWIN_NT-6.1 2.2.1(0.289/5/3) gcc(4.9.3) compiler and gfortran) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.1 from Xcode 5.1 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (swallow/kite) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Mavericks 10.9.5 Apple clang/clang++ version 6.0 from Xcode 6.2 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (wren/quail) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Yosemite 10.10.5 Apple clang/clang++ version 6.0 from Xcode 7.0 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X El Capitan 10.11.4 Apple clang/clang++ version 7.3.0 from Xcode 7.3 + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +SunOS 5.11 32-bit n y/y n y y y +SunOS 5.11 64-bit n y/y n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/y n y y n +Windows 8.1 n y/y n y y y +Windows 8.1 x64 n y/y n y y y +Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y +Mac OS X Yosemeti 10.10.5 64-bit n y/y n y y y +AIX 6.1 32- and 64-bit n y/n n y y y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y/y y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel n y/y n y y y +Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +SunOS 5.11 32-bit y y y y +SunOS 5.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 8.1 y y y y +Windows 8.1 x64 y y y y +Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +Mac OS X Yosemeti 10.10.5 64-bit y n y y +AIX 6.1 32- and 64-bit y n n y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel y y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel y y y y +Linux 2.6.32-431.11.2.el6.ppc64 y y y y + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.18-431.11.2.el6 g95 (GCC 4.0.3 (g95 0.94!) + #1 SMP x86_64 GNU/Linux + (platypus) + + Windows 7 Visual Studio 2008 (cmake) + + Windows 7 x64 Visual Studio 2008 (cmake) + + Windows 7 x64 Visual Studio 2010 (cmake) with SWMR using GPFS + + Windows 10 Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Windows 10 x64 Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Debian7.5.0 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux + gcc (Debian 4.7.2-5) 4.7.2 + GNU Fortran (Debian 4.7.2-5) 4.7.2 + (cmake and autotools) + + Fedora20 3.15.3-200.fc20.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + GNU Fortran (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + (cmake and autotools) + + SUSE 13.1 3.11.10-17-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.8.1 + GNU Fortran (SUSE Linux) 4.8.1 + (cmake and autotools) + + Ubuntu 14.04 3.13.0-35-generic #62-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + (cmake and autotools) + + hopper.nersc.gov PrgEnv-gnu/5.2.40 + gcc (GCC) 4.9.2 20141030 (Cray Inc.) + GNU Fortran (GCC) 4.9.2 20141030 (Cray Inc.) + g++ (GCC) 4.9.2 20141030 (Cray Inc.) + + + +Known Problems and Limitations +============================== +This section contains the list of known problems and limitations introduced +in this release of HDF5. + +Note: this list is not exhaustive of all known issues discovered in HDF5 +software to date. For a list of significant problems and known workarounds +identified in past releases, please refer to: + +https://www.hdfgroup.org/HDF5/release/known_problems/ + +The HDF Group also maintains a JIRA issue-tracking database which is used to +capture all known issues which are too numerous to reasonably list in this +document. The HDF Group is taking steps to make our JIRA issue database +open to the public, and this section will refer to that database in a future +release. In the meantime, please contact help@hdfgroup.org if you come across +an issue not listed here or at the link above, and we will provide any +information about known workarounds that we have or add it to our list of +known issues if it is a new issue. + + - The flush/refresh test occasionally fails on OS X platforms. This is + being investigated but no fix or workaround is available at this time. + (DER - 2016/03/22, HDFFV-9731) + + - The VDS/SWMR test will fail with a segmentation fault if the library + is built with --enable-using-memchecker. The is due to a VDS shutdown + procedure freeing a shared resource too early when the memory + checker changes are built. This problem does not arise when the + memory checker changes are not used since the internal library free + lists behave differently. The memory checker configure option should + normally only be used under special circumstances so this should not + affect most users. Users should be aware that the --enable-using-memchecker + + VDS combination may cause a segfault, however, so Valgrind et al. may + have to be used with an HDF5 library built without the feature if this + proves to be a problem. + (DER - 2016/03/21, HDFFV-9732) + + - SWMR feature limitations + The SWMR feature will only work if an HDF5 file under SWMR access resides + on a file system that obeys POSIX write() ordering semantics. Because of + this, SWMR will not work on network file systems such as NFS or SMB/Windows + file shares since those systems do not guarantee write odering. SWMR + regression tests are likely to fail if run on a network file system. SWMR + is currently not tested on Windows though it can be tested manually + (some of the SWMR test programs are built by CMake), and there are no + obvious reasons for it to not work on NTFS or GPFS. + (EIP - 2016/03/20, HDFFV-9733) + + - VDS feature limitation + Currently, the path to a VDS source file is interpreted as relative to the + directory where the executable program runs and not to the HDF5 file with + the VDS dataset unless a full path to the source file is specified during + the mapping. + (EIP - 2016/03/20, HDFFV-9724) + + - The H5Lexists API changed behavior in HDF5-1.10 when used with a file handle + and root group name ("/"): + + H5Lexists(fileid, "/") + + In HDF5-1.8 it returns false (0) and in HDF5-1.10 it returns true (1). + The documentation will be updated with information regarding this change. + (LRK - 2016/03/30, HDFFV-8746) + + +%%%%1.10.0%%%% + +HDF5 version 1.10.0 released on 2016-03-30 +================================================================================ + + + +INTRODUCTION + +This document describes the differences between HDF5-1.8 series and +HDF5 1.10.0 releases, and contains information on the platforms +tested. + +Links to HDF5 1.10.0 source code can be found on The HDF Group's +development FTP server at the following location: + + https://www.hdfgroup.org/HDF5/release/obtain5110.html + +User documentation can be accessed directly at this location: + + https://www.hdfgroup.org/HDF5/docNewFeatures/ + +For more information, see the HDF5 home page: + + https://www.hdfgroup.org/HDF5/ + +If you have any questions or comments, please send them to the HDF +Help Desk: + + help@hdfgroup.org + + + +CONTENTS + +- New Features +- Issues Addressed in this Release +- Supported Platforms +- Tested Configuration Features Summary +- More Tested Platforms +- Known Problems and Limitations + + + +New Features +============ +This release supports the following features: + + Configuration + ------------- + - API Compatibility with HDF5 1.8 Flag Was Added + + The 1.10 version of the HDF5 Library can be configured to operate + identically to the 1.8 library with the --with-default-api-version=v18 + configure flag. This allows existing code to be compiled with the 1.10 + library without requiring immediate changes to the application source + code. For addtional configuration options and other details, see + "API Compatibility Macros in HDF5" at + https://www.hdfgroup.org/HDF5/doc/RM/APICompatMacros.html. + + - Autotools Configuration Has Been Extensively Reworked + + The autotools configuration options have been updated to allow more + fine-grained control of the build options and to correct some bugs. + See configure --help for comprehensive information on each option. + + Specific changes: + + * --enable-debug and --enable-production are no longer accepted. + Use --enable-build-mode=(debug | production) instead. These set + appropriate defaults for symbols, optimizations, and other + configuration options. These defaults can be overridden by the + user. + + * Extra debug output messages are no longer enabled with + --enable-debug=. Use --enable-internal-debug= + instead. + + * A new --enable-symbols option allows symbols to be generated + independently of the build mode. --disable-symbols can be used + to strip symbols from the binary. + + * A new --enable-asserts option sets/unsets NDEBUG. This is + independent of the build mode. This also enables some extra + low-overhead debug checks in the library. + + * A new --enable-profiling option sets profiling flags. This is + independent of the build mode. + + * A new --enable-optimization option sets the optimization level. + This is independent of the build mode. + + * Many of these options can take a flags string that will be used + to build the library. This can be useful for specifying custom + optimization flags such as -Os and -Ofast. + + * gnu C++ and Fortran use configure sub-files that update the + build flags and turn on warnings. The increase in warnings when + building these wrapper libraries is due to these flag changes + and not to a decrease in code quality. + + * The option to clear file buffers has been removed. Any buffer that + will eventually be written to disk will now always be memset + to zero. This prevents the previous contents of the buffer from + being written to the disk if the buffer contents are not + completely overwritten, which has security implications. + + - LFS Changes + + The way the autotools handle large file support (LFS) has been + overhauled in this release. + + * We assume ftello and fseeko exist + + * We no longer explicitly use the *64 I/O functions. Instead, we + rely on a mapping provided by _FILE_OFFSET_BITS or its equivalent. + + * _LARGEFILE(64)_SOURCE is no longer exported via AM_CPPFLAGS. + + + + Parallel Library + ----------------- + - Collective Metadata I/O + + Calls for HDF5 metadata can result in many small reads and writes. + On metadata reads, collective metadata I/O can improve performance + by allowing the library to perform optimizations when reading the + metadata by having one rank read the data and broadcasting it to + all other ranks. + + Collective metadata I/O improves metadata write performance through + the construction of an MPI derived datatype that is then written + collectively in a single call. For more information, see + https://www.hdfgroup.org/HDF5/docNewFeatures/NewFeaturesCollectiveMetadataIoDocs.html. + + + + Library + -------- + - Concurrent Access to HDF5 Files - Single Writer/ Multple Reader (SWMR) + + The Single Writer/ Multiple Reader or SWMR feature enables users to + read data concurrently while writing it. Communications between the + processes and file locking are not required. The processes can run + on the same or on different platforms as long as they share a common + file system that is POSIX compliant. For more information, see the + Single-Writer/Multiple-Reader (SWMR) documentation at + https://www.hdfgroup.org/HDF5/docNewFeatures/NewFeaturesSwmrDocs.html. + + - Virtual Dataset (VDS) + + The VDS feature enables data to be accessed across HDF5 files + using standard HDF5 objects such as groups and datasets without + rewriting or rearranging the data. An HDF5 virtual dataset (VDS) + is an HDF5 dataset that is composed of source HDF5 datasets in + a predefined mapping. VDS can be used with the SWMR feature. For + documentation, check + https://www.hdfgroup.org/HDF5/docNewFeatures/NewFeaturesVirtualDatasetDocs.html. + + - Persistent Free File Space Tracking + + Usage patterns when working with an HDF5 file sometimes result in + wasted space within the file. This can also impair access times + when working with the resulting files. The new file space management + feature provides strategies for managing space in a file to improve + performance in both of these areas. For more information, see + https://www.hdfgroup.org/HDF5/docNewFeatures/NewFeaturesFileSpaceMgmtDocs.html. + + - Version 3 Metadata Cache + + The version 3 metadata cache moves management of metadata I/O from + the clients to the metadata cache proper. This change is essential for + SWMR and other features that have yet to be released. + + + + C++ Library + ------------ + - New Member Function Added to H5::ArrayType + + The assignment operator ArrayType::operator= was added because + ArrayType has pointer data members. + + (BMR - 2016/03/07, HDFFV-9562) + + + + Tools + ------ + - h5watch + + The h5watch tool allows users to output new records appended to + a dataset under SWMR access as it grows. The functionality is + similar to the Unix user command "tail" with the follow option, + which outputs appended data as the file grows. For more + information, see + https://www.hdfgroup.org/HDF5/docNewFeatures/NewFeaturesSwmrDocs.html#Tools. + + - h5format_convert + + The h5format_convert tool allows users to convert the indexing + type of a chunked dataset made with a 1.10.x version of the HDF5 + Library when the latest file format is used to the 1.8.x version 1 B-tree indexing + type. For example, datasets created using SWMR access, can be + converted to be accessed by the HDF5 1.18 library and tools. The + tool does not rewrite raw data, but it does rewrite HDF5 metadata. + + + + High-Level APIs + ---------------- + - H5DOappend + + The function appends data to a dataset along a specified dimension. + + + C Packet Table API + ------------------ + - Replacement of a Public Function with H5PTcreate + + The existing function H5PTcreate_fl limits applications so they + can use the deflate compression only. The public function + H5PTcreate has been added to replace H5PTcreate_fl. H5PTcreate + takes a property list identifier to provide flexibility on + creation properties. + + (BMR - 2016/03/04, HDFFV-8623) + + - New Public Functions: H5PTget_dataset and H5PTget_type + + Two accessor functions have been added. H5PTget_dataset returns + the identifier of the dataset associated with the packet table, + and H5PTget_type returns the identifier of the datatype used by + the packet table. + + (BMR, 2016/03/04, HDFFV-8623) + + - Regarding #ifdef VLPT_REMOVED + + The #ifdef VLPT_REMOVED blocks have been removed from the packet + table (PT) library source except for the following functions: + + H5PTis_varlen() has been made available again + + H5PTfree_vlen_readbuff() is now H5PTfree_vlen_buff() + + (BMR - 2016/03/04, HDFFV-442) + + C++ Packet Table API + -------------------- + - New Constructor Added to FL_PacketTable + + An overloaded constructor has been added to FL_PacketTable and + takes a property list identifier to provide flexibility on + creation properties. + + (BMR - 2016/03/08, HDFFV-8623) + + - New Public Functions + + Two accessor wrappers are added to class PacketTable. + PacketTable::GetDataset() returns the identifier of the dataset + associated with the packet table, and PacketTable::GetDatatype() + returns the identifier of the datatype that the packet table uses. + + (BMR - 2016/03/04, HDFFV-8623) + + - Member Functions with "char*" as an Argument + + Overloaded functions were added to provide the "const char*" + argument; the existing version will be deprecated in future + releases. + + (BMR - 2016/03/04, HDFFV-8623) + + - Regarding #ifdef VLPT_REMOVED + + The #ifdef VLPT_REMOVED blocks have been removed from the packet + table library source code except for the following functions: + + VL_PacketTable::IsVariableLength() was moved to PacketTable + + VL_PacketTable::FreeReadBuff() is now PacketTable::FreeBuff() + + (BMR - 2016/03/04, HDFFV-442) + + + + Java Wrapper Library + -------------------- + + The Java HDF5 JNI library has been integrated into the HDF5 repository. + The configure option is "--enable-java", and the CMake option is + HDF5_BUILD_JAVA:BOOL=ON. The package hierarchy has changed from the + HDF5 1.8 JNI, which was "ncsa.hdf.hdflib.hdf5", to HDF5 1.10, + "hdf.hdflib.hdf5". + + A number of new APIs were added including some for VDS and SWMR. + + + + Other Important Changes + ----------------------- + + The hid_t type was changed from 32-bit to a 64-bit value. + + + +Issues Addressed in this Release Since alpha1 +============================================= + + - H5Pget_virtual_printf_gap, H5Pget_virtual_view, H5Pget_efile_prefix + + The correct access property list settings from the + H5Pget_virtual_printf_gap, H5Pget_virtual_view, and + H5Pget_efile_prefix function calls could not be retrieved + using H5Dget_access_plist(). + + Fixed. + + (DER and NAF - 2016/03/14, HDFFV-9716) + + - h5dump + + When h5dump was provided with the name of a non-existing file or + when optional arguments were the last option on the command line, + h5dump would segfault. + + Fixed. + + (ADB 2016/02/28 HDFFV-9639, HDFFV-9684) + + - No Error Message for Corrupt Metadata + + The HDF5 Library did not propagate an error when it encountered + corrupt metadata in an HDF5 file. The issue was fixed for a + specific file provided by a user. If you still see the problem, + please contact help@hdfgroup.org + + Fixed. + + (MC - 2016/02/18, HDFFV-9670) + + - Problem Reading Chunked Datasets with a String Datatype Larger + Than the Chunk Size in Bytes + + When the latest file format was used and when a chunked dataset + was created with a datatype with the size bigger than a chunk + size, the data could not be read back. The issue was reported + for chunked datasets with a string datatype and was confirmed + for other datatypes with the sizes bigger than the chunk size in + bytes. + + Fixed. + + (JM - 2016/02/13, HDFFV-9672) + + - Control over the Location of External Files + + Users were unable to specify the locations of external files. + + Two APIs - H5Pget_efile_prefix and H5Pset_efile_prefix - were + added so that users could specify the locations of external files. + + (DER - 2016/02/04, HDFFV-8740) + + + +Issues Addressed in this Release Since alpha0 +============================================= + - h5format_convert + + The h5format_convert tool did not downgrade the version of the + superblock. + + Fixed. The tool now will downgrade the version of the superblock. + + (EIP 2016/01/11) + + - Crashes with multiple threads: invalid pointers + + It was reported that alpha0 crashed when used with multiple + threads. The issue exists in the HDF5 Library versions 1.8 and + 1.9. The problem is related to a shared file pointer used in some + miscellaneous data structures. The thread-safe library exposed + paths in the library where a file pointer became invalid. + + The alpha1 release contains the fixes for the specific use case + as described in HDFFV-9643. We will keep working on identifying + and fixing other paths in the library with similar problems. + + (EIP - 2016/01/15, HDFFV-9643) + + + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + AIX 6.1 xlc/xlc_r 10.1.0.5 + (NASA G-ADA) xlC/xlC_r 10.1.0.5 + xlf90/xlf90_r 12.1.0.6 + + Linux 2.6.32-573.18.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (mayll/platypus) Version 4.4.7 20120313 (Red Hat 4.4.7-16) + Version 4.9.3, Version 5.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 15.7-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 Build 20150407 + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 2.6.32-504.8.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Version 4.9.3, Version 5.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 Build 20150407 + MPICH 3.1.4 compiled with GCC 4.9.3 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Cygwin(CYGWIN_NT-6.1 2.2.1(0.289/5/3) gcc(4.9.3) compiler and gfortran) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.1 from Xcode 5.1 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (swallow/kite) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Mavericks 10.9.5 Apple clang/clang++ version 6.0 from Xcode 6.2.0 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (wren/quail) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Yosemite 10.10.5 Apple clang/clang++ version 6.0 from Xcode 7.0.0 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X El Capitan 10.11.3 Apple clang/clang++ version 7.0.2 from Xcode 7.0.2 + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +SunOS 5.11 32-bit n y/y n y y y +SunOS 5.11 64-bit n y/y n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/y n y y n +Windows 8.1 n y/y n y y y +Windows 8.1 x64 n y/y n y y y +Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y +Mac OS X Yosemeti 10.10.5 64-bit n y/y n y y y +AIX 6.1 32- and 64-bit n y/n n y y y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y/y y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel n y/y n y y y +Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +SunOS 5.11 32-bit y y y y +SunOS 5.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 8.1 y y y y +Windows 8.1 x64 y y y y +Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +Mac OS X Yosemeti 10.10.5 64-bit y n y y +AIX 6.1 32- and 64-bit y n n y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel y y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel y y y y +Linux 2.6.32-431.11.2.el6.ppc64 y y y y + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.18-431.11.2.el6 g95 (GCC 4.0.3 (g95 0.94!) + #1 SMP x86_64 GNU/Linux + (platypus) + + Windows 7 Visual Studio 2008 (cmake) + + Windows 7 x64 Visual Studio 2008 (cmake) + + Windows 7 x64 Visual Studio 2010 (cmake) with SWMR using GPFS + + Windows 10 Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Windows 10 x64 Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Debian7.5.0 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux + gcc (Debian 4.7.2-5) 4.7.2 + GNU Fortran (Debian 4.7.2-5) 4.7.2 + (cmake and autotools) + + Fedora20 3.15.3-200.fc20.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + GNU Fortran (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + (cmake and autotools) + + SUSE 13.1 3.11.10-17-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.8.1 + GNU Fortran (SUSE Linux) 4.8.1 + (cmake and autotools) + + Ubuntu 14.04 3.13.0-35-generic #62-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + (cmake and autotools) + + hopper.nersc.gov PrgEnv-gnu/5.2.40 + gcc (GCC) 4.9.2 20141030 (Cray Inc.) + GNU Fortran (GCC) 4.9.2 20141030 (Cray Inc.) + g++ (GCC) 4.9.2 20141030 (Cray Inc.) + + + +Known Problems and Limitations +============================== +This section contains the list of known problems and limitations introduced +in this release of HDF5. + +Note: this list is not exhaustive of all known issues discovered in HDF5 +software to date. For a list of significant problems and known workarounds +identified in past releases, please refer to: + +https://www.hdfgroup.org/HDF5/release/known_problems/ + +The HDF Group also maintains a JIRA issue-tracking database which is used to +capture all known issues which are too numerous to reasonably list in this +document. The HDF Group is taking steps to make our JIRA issue database +open to the public, and this section will refer to that database in a future +release. In the meantime, please contact help@hdfgroup.org if you come across +an issue not listed here or at the link above, and we will provide any +information about known workarounds that we have or add it to our list of +known issues if it is a new issue. + + - The JUnit-interface test may fail on Solaris platforms. The result of + a test for verifying the content of the error stack to stdout is + in a different order on Solaris then other platforms. Use make -i option + to test beyond the java/test folder. + (ADB - 2016/03/22, HDFFV-9734) + + - The flush/refresh test occasionally fails on OS X platforms. This is + being investigated but no fix or workaround is available at this time. + (DER - 2016/03/22, HDFFV-9731) + + - The VDS/SWMR test will fail with a segmentation fault if the library + is built with --enable-using-memchecker. The is due to a VDS shutdown + procedure freeing a shared resource too early when the memory + checker changes are built. This problem does not arise when the + memory checker changes are not used since the internal library free + lists behave differently. The memory checker configure option should + normally only be used under special circumstances so this should not + affect most users. Users should be aware that the --enable-using-memchecker + + VDS combination may cause a segfault, however, so Valgrind et al. may + have to be used with an HDF5 library built without the feature if this + proves to be a problem. + (DER - 2016/03/21, HDFFV-9732) + + - SWMR feature limitations + The SWMR feature will only work if an HDF5 file under SWMR access resides + on a file system that obeys POSIX write() ordering semantics. Because of + this, SWMR will not work on network file systems such as NFS or SMB/Windows + file shares since those systems do not guarantee write odering. SWMR + regression tests are likely to fail if run on a network file system. SWMR + is currently not tested on Windows though it can be tested manually + (some of the SWMR test programs are built by CMake), and there are no + obvious reasons for it to not work on NTFS or GPFS. + (EIP - 2016/03/20, HDFFV-9733) + + - VDS feature limitation + Currently, the path to a VDS source file is interpreted as relative to the + directory where the executable program runs and not to the HDF5 file with + the VDS dataset unless a full path to the source file is specified during + the mapping. + (EIP - 2016/03/20, HDFFV-9724) + + - When building HDF5 with Java using CMake and specifying Debug for CMAKE_BUILD_TYPE, + there is a missing command argument for the tests of the examples. + + This error can be avoided by not building Java with Debug, HDF5_BUILD_JAVA:BOOL=OFF, + or not building Examples, HDF5_BUILD_EXAMPLES:BOOL=OFF. + (LRK - 2016/03/30, HDFFV-9743) + + - The H5Lexists API changed behavior in HDF5-1.10 when used with a file handle + and root group name ("/"): + + H5Lexists(fileid, "/") + + In HDF5-1.8 it returns false (0) and in HDF5-1.10 it returns true (1). + The documentation will be updated with information regarding this change. + (LRK - 2016/03/30, HDFFV-8746) + diff --git a/release_docs/HISTORY-1_8.txt b/release_docs/HISTORY-1_8.txt new file mode 100644 index 0000000..4465d06 --- /dev/null +++ b/release_docs/HISTORY-1_8.txt @@ -0,0 +1,12344 @@ +HDF5 History +============ + +This file contains development history of HDF5 1.8 branch + +19. Release Information for hdf5-1.8.17 +18. Release Information for hdf5-1.8.16 +17. Release Information for hdf5-1.8.15 +16. Release Information for hdf5-1.8.14 +15. Release Information for hdf5-1.8.13 +14. Release Information for hdf5-1.8.12 +13. Release Information for hdf5-1.8.11 +12. Release Information for hdf5-1.8.10-patch1 +11. Release Information for hdf5-1.8.10 +10. Release Information for hdf5-1.8.9 +09. Release Information for hdf5-1.8.8 +08. Release Information for hdf5-1.8.7 +07. Release Information for hdf5-1.8.6 +06. Release Information for hdf5-1.8.5 +05. Release Information for hdf5-1.8.4 +04. Release Information for hdf5-1.8.3 +03. Release Information for hdf5-1.8.2 +02. Release Information for hdf5-1.8.1 +01. Release Information for hdf5-1.8.0 + +[Search on the string '%%%%' for section breaks of each release.] + +%%%%1.8.17%%%% + + +HDF5 version 1.8.17 released on 2016-05-10 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.16 and +HDF5-1.8.17-*, and contains information on the platforms tested and +known problems in HDF5-1.8.17-*. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.17 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.17 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.17 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.17 (current +release) versus Release 1.8.16 + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.16 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + + + +New Features +============ + + Configuration + ------------- + - Cmakehdf5: Added Ability to Run Multiple Make Commands + + Added option --njobs to specify up to how many jobs to launch during + build (cmake) and testing (ctest). + + (AKC - 2015/12/13, HDFFV-9612) + + - Cmakehdf5: Added Szip Support and Verbose Option + + Added --with-szlib to support the Szip library; and + --enable/disable-verbose to display all CMake process output. + + (AKC - 2015/11/16, HDFFV-8932 and DAILYTEST-195) + + - CMake minimum is now 3.1.0. (ADB - 2015/11/14) + + - Large File System (LFS) Support has Changed in the Autotools + + We assume that fseeko and ftello exist. + + The *64 I/O functions and types are no longer explicitly used. + We now rely on a mapping provided by _FILE_OFFSET_BITS (or its + equivalent). + + _LARGEFILE(64)_SOURCE is no longer exposed via AM_CPPFLAGS. + + (DER - 2016/03/29, HDFFV-9626 and HDFFV-9541) + + + + Library + ------- + - New API Calls for Searching for External Dataset Storage + + API calls that determine the search path for dataset external + storage were added. H5Pset/get_efile_prefix() API calls were added + to the library. These functions give control over the search path + for dataset external storage that has been configured with + H5Pset_external(). + + Additionally, the HDF5_EXTFILE_PREFIX environment variable can be + used to control the search path. + + (DER - 2016/04/20, HDFFV-8740) + + + + Parallel Library + ---------------- + - None + + + + Tools + ----- + - None + + + + High-Level APIs + --------------- + + C Packet Table API + ------------------ + - Replacement of a Public Function with H5PTcreate + + The existing function H5PTcreate_fl limits applications so they + can use the deflate compression only. The public function + H5PTcreate has been added to replace H5PTcreate_fl. H5PTcreate + takes a property list identifier to provide flexibility on + creation properties. This also removes the following warning: + "deprecated conversion from string constant to "char*" + [-Wwrite-strings]". + + (BMR - 2016/04/25, HDFFV-9708, HDFFV-8615) + + - New Public Functions: H5PTget_dataset and H5PTget_type + + Two accessor functions have been added. H5PTget_dataset returns + the identifier of the dataset associated with the packet table, + and H5PTget_type returns the identifier of the datatype used by + the packet table. + + (BMR - 2016/04/25, HDFFV-8623 patch 3) + + - Regarding #ifdef VLPT_REMOVED + + The #ifdef VLPT_REMOVED blocks have been removed from the packet + table (PT) library source except for the following functions: + + H5PTis_varlen() has been made available again + + H5PTfree_vlen_readbuff() is now H5PTfree_vlen_buff() + + (BMR - 2016/04/25, HDFFV-442) + + C++ Packet Table API + -------------------- + - New Constructor in FL_PacketTable + + An overloaded constructor has been added to FL_PacketTable and + takes a property list identifier to provide flexibility on + creation properties such as compression. + + FL_PacketTable(hid_t fileID, const char* name, hid_t dtypeID, + hsize_t chunkSize = 0, hid_t plistID = H5P_DEFAULT) + + (BMR - 2016/04/25, HDFFV-8623 patch 5) + + - New Member Functions in PacketTable + + Two accessor wrappers were added to class PacketTable. + + PacketTable::GetDataset() returns the identifier of the dataset + associated with the packet table, and PacketTable::GetDatatype() + returns the identifier of the datatype that the packet table uses. + + (BMR - 2016/04/25, HDFFV-8623 patch 4) + + - New Member Functions with "char*" as an Argument + + Overloaded functions were added to provide the "const char*" + argument; the existing version will be deprecated in future + releases. This also removes the following warning: + "deprecated conversion from string constant to "char*" + [-Wwrite-strings]". + + (BMR - 2016/04/25, HDFFV-8623 patch 1, HDFFV-8615) + + - Regarding #ifdef VLPT_REMOVED + + The #ifdef VLPT_REMOVED blocks have been removed from the packet + table library source code except for the following functions: + + VL_PacketTable::IsVariableLength() was moved to PacketTable + + VL_PacketTable::FreeReadBuff() is now PacketTable::FreeBuff() + + (BMR - 2016/04/25, HDFFV-442) + + + + Fortran API + ----------- + - None + + + + C++ API + ------- + - New Member Function in DSetCreatPropList + + DSetCreatPropList::setNbit() was added to setup N-bit compression for + a dataset. + + (BMR - 2016/04/25, HDFFV-8623 patch 7) + + - New Overloaded "const" Member Functions in ArrayType + + The two following functions were added: + ArrayType::getArrayNDims() const + ArrayType::getArrayDims() const + to provide const version, and the non-const version was marked + deprecated. In-memory array information, ArrayType::rank and + ArrayType::dimensions, were removed. This is an implementation + detail and should not affect applications. + + (BMR, 2016/04/25, HDFFV-9725) + + - New member function added + + The assignment operator ArrayType::operator= is added because ArrayType + has pointer data members. + + (BMR, 2016/03/07, HDFFV-9562) + + +Support for New Platforms, Languages, and Compilers +=================================================== + - Mac OS X El Capitan 10.11.4 with compilers Apple clang/clang++ + version 7.3.0 from Xcode 7.3, gfortran GNU Fortran (GCC) 5.2.0 + and Intel icc/icpc/ifort version 16.0.2 + + + +Bug Fixes since HDF5-1.8.16 +=========================== + + Configuration + ------------- + - Updated Linux Language Level Flags to Match the Autotools. Removed + Linux-specific Flags from OS X. + + An addition to the flags simply being out of sync with the Autotools, + the Linux flags were used on OS X builds which led to symbols not being + found. Although this was non-fatal and compilation continued (implicit + definitions were used by the compiler and the symbols resolved at link + time), a large number of warnings were raised. + + Linux changes: + + * CHANGED: _POSIX_C_SOURCE (from 199605 to 200112L) + * ADDED: _GNU_SOURCE + * REMOVED: _BSD_SOURCE + * REMOVED: _DEFAULT_SOURCE + + (DER - 2015/12/08, HDFFV-9627) + + - The --enable-clear-file-buffers configure Option was Non-functional + so the Feature was Always Enabled (its default value). + + Regardless of the configure flag, the setting was always enabled when + the Autotools were used to configure HDF5. This was due to the "no" + option being processed after the "*" option in configure.ac so "*" + matched first. CMake was unaffected. + + The option now works correctly. + + NOTE that builders are always advised to leave this option enabled. + When disabled, buffers that are written to disk may contain the + memory's previous contents, which may include secure information. + The performance overhead of the feature (a single memset call per + allocation) is minimal. + + (DER - 2016/02/03, HDFFV-9676) + + - Added a patch to remove '"'s from arguments for MPI compilers that + were causing errors compiling H5lib_settings.c with SGI MPT. + + (LRK - 2016/04/20, HDFFV-9439) + + Library + ------- + - Fixed shared file pointer problem which caused a crash when running a + program provided by a user. + + (VC - 2016/04/01, HDFFV-9469) + + - Fixed some format string warnings that prevent compiling with + -Werror=format-security on gcc. + + These only appeared in error messages and would not cause problems + under normal operation. + + (DER - 2016/01/13, HDFFV-9640) + + - Fixed a library segmentation fault when accessing a corrupted + file provided by a user. + + (MSC - 2016/02/19, HDFFV-9670) + + + + Parallel Library + ---------------- + - None + + + + Performance + ------------- + - None + + + + Tools + ----- + - h5dump: Sub-setting Fixed for Dimensions Greater than Two + + When a dataset has more than two dimensions, sub-setting would + incorrectly calculate the data that needed to be displayed. + Added in block and stride calculations that account for dimensions + greater than two. NOTE: lines that have line breaks inserted + because of display length calculations may have index info that + is incorrect until the next dimension break. + + (ADB - 2016/03/07, HDFFV-9698) + + - h5dump: Issue with Argument Segmentation Fault + + When an argument with an optional value was at the end of the command + line with a value, h5dump would crash. Reworked check for remaining + arguments. + + (ADB - 2016/03/07, HDFFV-9570, HDFFV-9684) + + - h5dump: Issue with Default Fill Value + + Added all default cases of fill value to the display of fill value. + + (ADB -, 2016/03/07, HDFFV-9241) + + - h5dump: Clarified Help + + Clarified usage of -O F option in h5dump utility help. + + (ADB - 2016/03/07, HDFFV-9066) + + - h5dump: Issue with Double Free Fault + + Added a check for filename not null before calling free(). + + (ADB - 2016/01/27, HDFFV-9639) + + - VS2015 Release Changed how Timezone was Handled + + Created a function, HDget_timezone, in H5system.c. Replaced + timezone variable usage with function call. + + (ADB - 2015/11/02, HDFFV-9550) + + + + Fortran API + ----------- + - None + + + + C++ API + ------- + - Removal of Obsolete Methods + + The overloaded methods which had parameters that should be const + but were not have been removed. + + (BMR - 2016/01/13, HDFFV-9789) + + + + High-Level APIs: + --------------- + - Fixed Memory Leak in Packet Table API + + Applied user's patch to fix memory leak in the creation of a + packet table. + + (BMR - 2016/04/25, HDFFV-9700) + + + + Fortran High-Level APIs: + ------------------------ + - None + + + + Testing + ------- + - None + + + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + AIX 6.1 xlc/xlc_r 10.1.0.5 + (NASA G-ADA) xlC/xlC_r 10.1.0.5 + xlf90/xlf90_r 12.1.0.6 + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus) Version 4.4.7 20120313 + Version 4.9.3, Version 5.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 15.7-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 Build 20150407 + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 2.6.32-504.8.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-229.14.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Version 5.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 Build 20150407 + MPICH 3.1.4 compiled with GCC 4.9.3 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 (cmake) + Cygwin(CYGWIN_NT-6.1 2.2.1(0.289/5/3) gcc(4.9.3) compiler and gfortran) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 (cmake) + + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.1 from Xcode 5.1 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (swallow/kite) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Mavericks 10.9.5 Apple clang/clang++ version 6.0 from Xcode 6.2 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (wren/quail) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Yosemite 10.10.5 Apple clang/clang++ version 6.1 from Xcode 7.0 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X El Capitan 10.11.4 Apple clang/clang++ version 7.3.0 from Xcode 7.3 + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (osx1011dev/ox1011test) Intel icc/icpc/ifort version 16.0.2 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +SunOS 5.11 32-bit n y/y n y y y +SunOS 5.11 64-bit n y/y n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/y n y y n +Windows 8.1 n y/y n y y y +Windows 8.1 x64 n y/y n y y y +Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y +Mac OS X Yosemeti 10.10.5 64-bit n y/y n y y y +AIX 6.1 32- and 64-bit n y/n n y y y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y/y y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel n y/y n y y y +Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +SunOS 5.11 32-bit y y y y +SunOS 5.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 8.1 y y y y +Windows 8.1 x64 y y y y +Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +Mac OS X Yosemeti 10.10.5 64-bit y n y y +AIX 6.1 32- and 64-bit y n n y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel y y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel y y y y +Linux 2.6.32-431.11.2.el6.ppc64 y y y y + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.18-431.11.2.el6 g95 (GCC 4.0.3 (g95 0.94!) + #1 SMP x86_64 GNU/Linux + (platypus) + + Windows 7 Visual Studio 2008 (cmake) + + Windows 7 x64 Visual Studio 2008 (cmake) + + Windows 10 Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Windows 10 x64 Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Debian7.5.0 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux + gcc (Debian 4.7.2-5) 4.7.2 + GNU Fortran (Debian 4.7.2-5) 4.7.2 + (cmake and autotools) + + Fedora20 3.15.3-200.fc20.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + GNU Fortran (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + (cmake and autotools) + + SUSE 13.1 3.11.10-17-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.8.1 + GNU Fortran (SUSE Linux) 4.8.1 + (cmake and autotools) + + Ubuntu 14.04 3.13.0-35-generic #62-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + (cmake and autotools) + + hopper.nersc.gov PrgEnv-gnu/5.2.40 + gcc (GCC) 4.9.2 20141030 (Cray Inc.) + GNU Fortran (GCC) 4.9.2 20141030 (Cray Inc.) + g++ (GCC) 4.9.2 20141030 (Cray Inc.) + + +Known Problems +============== +* On windows platforms in debug configurations, the VFD flush1 tests will fail + with the split and multi VFD drivers. These tests will display a modal debug + dialog which must be answered or wait for the test timeout to expire. + (ADB - 2014/06/23 - HDFFV-8851) + +* CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + catches some undefined behavior in the alignment algorithm of the macro DETECT_I + in H5detect.c (Issue 8147). Since the algorithm is trying to detect the alignment + of integers, ideally the flag -fcatch-undefined-behavior shouldn't to be used for + H5detect.c. In the future, we can separate flags for H5detect.c from the rest of + the library. (SLU - 2013/10/16) + +* Make provided by Solaris fails in "make check". Solaris users should use + gmake to build and install the HDF5 software. (AKC - 2013/10/08 - HDFFV-8534) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD with the + native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the + ports (and probably gcc releases after that). + (QAK - 2012/10/19) + +* The following h5dump test case fails in BG/P machines (and potentially other + machines that use a command script to launch executables): + + h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" + tno-subset.h5 + + This is due to the embedded spaces in the dataset name being interpreted + by the command script launcher as meta-characters, thus passing three + arguments to h5dump's -d flag. The command passes if run by hand, just + not via the test script. + (AKC - 2012/05/03) + +* The STDIO VFD does not work on some architectures, possibly due to 32/64 + bit or large file issues. The basic STDIO VFD test is known to fail on + 64-bit SunOS 5.10 on SPARC when built with -m64 and 32-bit OS X/Darwin + 10.7.0. The STDIO VFD test has been disabled while we investigate and + a fix should appear in a future release. + (DER - 2011/10/14 - HDFFV-8235) + +* h5diff can report inconsistent results when comparing datasets of enum type + that contain invalid values. This is due to how enum types are handled in + the library and will be addressed in a future release. + (DER - 2011/10/14 - HDFFV-7527) + +* The links test can fail under the stdio VFD due to some issues with external + links. This will be investigated and fixed in a future release. + (DER - 2011/10/14 - HDFFV-7768) + +* After the shared library support was fixed for some bugs, it was discovered + that "make prefix=XXX install" no longer works for shared libraries. It + still works correctly for static libraries. Therefore, if you want to + install the HDF5 shared libraries in a location such as /usr/local/hdf5, + you need to specify the location via the --prefix option during configure + time. E.g, ./configure --prefix=/usr/local/hdf5 ... + (AKC - 2011/05/07 - HDFFV-7583) + +* The parallel test, t_shapesame, in testpar/, may run for a long time and may + be terminated by the alarm signal. If that happens, one can increase the + alarm seconds (default is 1200 seconds = 20 minutes) by setting the + environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If + it does, it will waste more time if $HDF5_ALARM_SECONDS is set + to a larger value. + (AKC - 2011/05/07) + +* Shared Fortran libraries are not quite working on AIX. While they are + generated when --enable-shared is specified, the fortran and hl/fortran + tests fail. the issue. HL and C++ shared libraries should now be + working as intended, however. + (MAM - 2011/04/20) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or file systems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + (NAF - 2011/01/19) + +* All the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added in. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as + it is (see bug report #1279). Quincey will make a plan for 1.10. + (SLU - 2010/02/02) + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + (MAM - 2009/11/04) + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + (SLU - 2005/06/30) + + +%%%%1.8.16%%%% + + +HDF5 version 1.8.16 released on 2015-11-10 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.15 and +HDF5-1.8.16, and contains information on the platforms tested and +known problems in HDF5-1.8.16. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.16 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.16 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.16 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.16 (current +release) versus Release 1.8.15": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.15 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + +New Features +============ + + Configuration and Build + ------------- + - The thread-safety + high-level library combination has been marked + as "unsupported" in the Autotools + + The global lock used by the thread-safety feature has never been + raised to the high-level library level, making it possible that + the library state could change if a context switch were to occur in + a high-level library call. Because of this, the combination of + thread-safety and high-level library is officially unsupported by + The HDF Group. + + In the past, although this combination has never been supported, this + was not enforced by the build systems. These changes will cause an + Autotools configure step to fail if --enable-threadsafe and + --enable-hl are combined unless additional options are specified. + Since the high-level library is built by default, this means that + these extra configuration options will need to be used any time + --enable-threadsafe is selected. + + To build with --enable-threadsafe, either: + + 1) Use --disable-hl to disable the high-level library (recommended) + + 2) Use --enable-unsupported to build the high-level library with + the thread-safety feature. + + (DER - 2015/09/10 HDFFV-8719) + + - Using CMake now builds both static and shared libraries. + + The CMake files have been updated to build both static and shared + libraries, with tools only built statically. The packaging of the + libraries and tools will include cmake-config files that allows + projects to choose either shared or static (default) libraries + to be found with the find_package command using the COMPONENTS + keyword and a list of components. The imported libraries will + include any interface specific settings and dependent libraries. + + The default setting for BUILD_SHARED_LIBS has changed from OFF + to ON, which builds both static and shared libraries. The static + libraries are always built because of tools requirements. + + (ADB - 2015/08/24 HDFFV-5881) + + - Inline functions now correctly annotated with Autotools builds. + + The method used to detect the appropriate inline markup scheme was + nonfunctional in Autotools builds. The Autotools have been modified + to correctly detect the compiler's inline markup symbol and apply it + to the source. Note that only a very small number of internal + functions are marked inline so this was not a very big change or + likely to significantly affect performance. + + As a part of this change, the H5_inline symbol no longer appears in + H5pubconf.h. + + (DER - 2015/08/13 HDFFV-9119, HDFFV-9421) + + - Removed obsolete/unmaintained files from config/ + + Several files were removed from the config directory. These files + represent old operating systems, were no longer necessary, and/or + were no longer maintained. configure.ac was updated to reflect the + removed files. + + Removed: + + craynv + dec-flags + hpux11.23 + ia64-linux-gnu + nec-superux14.1 + sv1-cray + x86_64-redstorm-linux-gnu + powerpc-ibm-aix5.x + + As a part of this work, a few lines that deal with locating the + sys/fpu.h header on SGI machines and some OSF/1 configure lines + were also removed. The Solaris config was also renamed to not have + a version number since the version number was ignored by configure + as it applies to all Solaris versions. + + (DER - 2015/09/04 HDFFV-9116) + + - Removed the FP_TO_INTEGER_OVERFLOW_WORKS macro/defines from the library + + This was for working around bugs in the Cray X1 compiler, which is no + longer supported. + + (DER - 2015/09/09 HDFFV-9191) + + - Removed the H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS and + H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS symbols and associated code. + + H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS was a work-around on old 64-bit + SGI and Solaris systems. + + H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS was a work-around for old PGI + compilers on Linux. + + Neither of these were used in any current library code and only appeared + in the dt_arith test. + + (DER - 2015/09/09 HDFFV-9187) + + - Removed CONVERT_DENORMAL_FLOAT symbol and associated code from the + library. + + This was only set in configure files for Cray and NEC computers. These + config files no longer exist so there is no effect on currently + supported platforms. + + (DER - 2015/09/09 HDFFV-9188) + + - Removed _BSD_SOURCE and _DEFAULT_SOURCE from configure.ac + + These are old BSD-compatibility symbols that are no longer needed by + the library. + + (DER - 2015/09/10 HDFFV-9079) + + - Removed HW_FP_TO_LLONG_NOT_WORKS symbol and associated code from the + library. + + This was part of a work-around for the VS.NET 2003 compiler, which is + no longer supported. + + (DER - 2015/09/10 HDFFV-9189) + + - Removed the BAD_LOG2_CODE_GENERATED symbol and associated code from the + library. + + This was an IRIX work-around. + + (DER - 2015/09/11 HDFFV-9195) + + - Decoupled shared object version numbers for wrapper libraries from the + shared object version number for the HDF5 library. These will be + maintained on an individual basis according to the interface changes + specific to these wrapper libraries. + + For HDF5 1.8.16 the shared object version numbers were changed from + 10.0.1 to 10.1.0 for the HDF5 library due to added APIs. For the C++ + wrapper library they were changed from 10.0.1 to 11.0.0 due to changes + in existing APIs. For all other wrapper libraries the versions were + changed from 10.0.1 to 10.0.2 because while the APIs had no changes + there have been changes in code that did not result in changes to their + interfaces. + + (LRK - 2015/10/28) + + Library + ------- + + - H5F_ACC_DEBUG flag for H5Fopen/create: functionality removed + + The symbol was used to emit some extra debugging information + for HDF Group developers in the multi VFD. The underlying + functionality has been removed due to disuse. The symbol + remains defined since it was visible in H5Fpublic.h but it + has been set to zero and has no effect anywhere in the library. + + (DER - 2015-05-02, HDFFV-1074) + + - New public API call: H5is_library_threadsafe() + + This API call indicates if the library was built with thread- + safety enabled. + + (DER - 2015-09-01, HDFFV-9496) + + Parallel Library + ---------------- + - None + + Tools + ----- + - None + + High-Level APIs + --------------- + - None + + Fortran API + ----------- + - None + + + C++ API + ------- + - Class H5::ObjCreatPropList is added for the object creation property + list class. + + Class H5::ObjCreatPropList is derived from H5::PropList and is a + baseclass of H5::DSetCreatPropList. Additional property list classes + will be derived from H5::ObjCreatPropList when they are added to the + library in future releases. + + (BMR, 2015/10/13, Part of HDFFV-9169) + + - New Wrappers for C Functions H5P[s/g]et_attr_phase_change and + H5P[s/g]et_attr_creation_order. + + Wrappers were added to class H5::ObjCreatPropList for the C Functions + H5Pset_attr_phase_change: H5::ObjCreatPropList::setAttrPhaseChange + H5Pget_attr_phase_change: H5::ObjCreatPropList::getAttrPhaseChange + H5Pset_attr_creation_order: H5::ObjCreatPropList::setAttrCrtOrder + H5Pget_attr_creation_order: H5::ObjCreatPropList::getAttrCrtOrder + + (BMR, 2015/10/13, Part of HDFFV-9167 and HDFFV-9169) + + +Support for New Platforms, Languages, and Compilers +=================================================== + - Added VS2015 with Intel Fortran 16 to supported Windows 7 platforms + + +Bug Fixes since HDF5-1.8.15 +=========================== + + Configuration + ------------- + + - CMake test for long long printf format improved + + The CMake configuration test for determining the printf format string + for printing a long long integer was fixed. The test would crash + when executed with VS2015. + + (ADB - 2015-10-21 HDFFV-9488) + + Library + ------- + - VS2015 removed global variable timezone + + The usage of the global variable timezone was modified for VS2015 by + adding an alias to Windows builds. + + (ADB - 2015-10-23 HDFFV-9550) + + - Fix potential error in H5Iclear_type + + If the ID type's close callback could close another ID of the same type, + H5Iclear_type could occasionally run into problems due to the inner + workings of the skip list package. This could potentially cause an + error on library shutdown without calling H5Iclear_type directly. This + issue has been fixed. + + (NAF - 2015-08-12) + + - Fix uninitialized memory in dataspace selection code + + When creating a dataspace with H5Screate and setting the extent with + H5Sextent_copy, the selection offset was not initialized, potentially + causing invalid I/O. There may be other cases where this happened. + Modified the library to always initialize the offset. + + (NAF - 2015-09-08) + + - Truncate file in H5Fflush() if EOA != EOF to avoid file + corruption in certain scenarios + + In the following scenario, the resulting HDF5 file would be + incorrectly corrupted because the truncate operation + was at some point wrongly moved out of the flush operation: + - Create a new file with a single dataset. + - Write parts of the dataset (make sure that some values at + the end of the dataset are not initialized). + - Flush the file. + - Crash the program. + - Try to open the file with h5dump or h5debug, but the + resulting file is corrupted. + + (MSC - 2015-06-15 HDFFV-9418) + + + Parallel Library + ---------------- + - + (XYZ - YYYY/MM/DD HDFFV-####) + + Performance + ------------- + - None + + Tools + ----- + - VS2015 changed the default format for printing of exponents + + VS2015 default format for exponents changed with the elimination + of the leading '0'. CMake now tests for the VS2015 compiler and + adjusts which reference files are used by tests. + + (ADB - 2015-10-23 HDFFV-9550) + + - Fixed h5repack with user-defined filters + + h5repack would throw a buffer overrun exception on Windows when + parsing a user-defined filter ID of 5 digits. A local variable in + the parse routine was not of sufficient size. + + (ADB - 2015/09/01 HDFFV-9515) + + Fortran API + ------------ + - None + + + C++ API + ------ + - Removed memory leaks + + The static global constant objects were changed to constant references + referencing dynamically allocated objects. This ensures that the clean-up + process in the C++ library occurs before the termination of the C library + and prevents memory leaks because the previous global constants were not + properly deleted before the C library termination. + + (BMR, 2015/10/13, HDFFV-9529) + + - Fixed the problem about identifiers being closed prematurely. + + The C++ library needs to increment the ID's reference counter when it is + duplicated in the form of C++ objects, but not when the ID is obtained + from a C function. With this approach, both problems, prematurely + closing ID's and memory leaks due to ID's not being closed, should be + eliminated. + + (BMR, 2015/10/15, HDFFV-7947) + + + High-Level APIs: + ------ + - None + + + Fortran High-Level APIs: + ------------------------ + - None + + + Testing + ------- + - None + + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + AIX 6.1 xlc/xlc_r 10.1.0.5 + (NASA G-ADA) xlC/xlC_r 10.1.0.5 + xlf90/xlf90_r 12.1.0.6 + + Linux 2.6.32-573.3.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus) Version 4.4.7 20120313 + Version 4.8.4, Version 5.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 15.7-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 Build 20150407 + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 2.6.32-504.8.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-229.14.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan) Version 4.8.3 20140911 (Red Hat 4.8.3-9) + Version 5.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 Build 20150407 + MPICH 3.1.4 compiled with GCC 4.9.3 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Cygwin(CYGWIN_NT-6.1 2.2.1(0.289/5/3) gcc(4.9.3) compiler and gfortran) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.1 from Xcode 5.1 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (swallow/kite) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Mavericks 10.9.5 Apple clang/clang++ version 6.0 from Xcode 6.2.0 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (wren/quail) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Yosemite 10.10.5 Apple clang/clang++ version 6.0 from Xcode 7.0.0 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +SunOS 5.11 32-bit n y/y n y y y +SunOS 5.11 64-bit n y/y n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/y n y y n +Windows 8.1 n y/y n y y y +Windows 8.1 x64 n y/y n y y y +Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y +Mac OS X Yosemeti 10.10.5 64-bit n y/y n y y y +AIX 6.1 32- and 64-bit n y/n n y y y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y/y y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel n y/y n y y y +Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +SunOS 5.11 32-bit y y y y +SunOS 5.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 8.1 y y y y +Windows 8.1 x64 y y y y +Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +Mac OS X Yosemeti 10.10.5 64-bit y n y y +AIX 6.1 32- and 64-bit y n n y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel y y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel y y y y +Linux 2.6.32-431.11.2.el6.ppc64 y y y y + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.18-431.11.2.el6 g95 (GCC 4.0.3 (g95 0.94!) + #1 SMP x86_64 GNU/Linux + (platypus) + + Mac OS X El Capitan 10.11 Apple clang/clang++ version 7.0.0 from Xcode 7.0.1 + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (VM) + + Windows 7 Visual Studio 2008 (cmake) + + Windows 7 x64 Visual Studio 2008 (cmake) + + Windows 10 Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Windows 10 x64 Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Debian7.5.0 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux + gcc (Debian 4.7.2-5) 4.7.2 + GNU Fortran (Debian 4.7.2-5) 4.7.2 + (cmake and autotools) + + Fedora20 3.15.3-200.fc20.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + GNU Fortran (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + (cmake and autotools) + + SUSE 13.1 3.11.10-17-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.8.1 + GNU Fortran (SUSE Linux) 4.8.1 + (cmake and autotools) + + Ubuntu 14.04 3.13.0-35-generic #62-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + (cmake and autotools) + + hopper.nersc.gov PrgEnv-gnu/5.2.40 + gcc (GCC) 4.9.2 20141030 (Cray Inc.) + GNU Fortran (GCC) 4.9.2 20141030 (Cray Inc.) + g++ (GCC) 4.9.2 20141030 (Cray Inc.) + + +Known Problems +============== +* On Windows platforms in debug configurations, the VFD flush1 tests will fail + with the split and multi VFD drivers. These tests will display a modal debug + dialog which must be answered or wait for the test timeout to expire. + (ADB - 2014/06/23 - HDFFV-8851) + +* CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + catches some undefined behavior in the alignment algorithm of the macro DETECT_I + in H5detect.c (Issue 8147). Since the algorithm is trying to detect the alignment + of integers, ideally the flag -fcatch-undefined-behavior shouldn't to be used for + H5detect.c. In the future, we can separate flags for H5detect.c from the rest of + the library. (SLU - 2013/10/16) + +* Make provided by Solaris fails in "make check". Solaris users should use + gmake to build and install the HDF5 software. (AKC - 2013/10/08 - HDFFV-8534) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD with the + native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the + ports (and probably gcc releases after that). + (QAK - 2012/10/19) + +* The following h5dump test case fails in BG/P machines (and potentially other + machines that use a command script to launch executables): + + h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" + tno-subset.h5 + + This is due to the embedded spaces in the dataset name being interpreted + by the command script launcher as meta-characters, thus passing three + arguments to h5dump's -d flag. The command passes if run by hand, just + not via the test script. + (AKC - 2012/05/03) + +* The STDIO VFD does not work on some architectures, possibly due to 32/64 + bit or large file issues. The basic STDIO VFD test is known to fail on + 64-bit SunOS 5.10 on SPARC when built with -m64 and 32-bit OS X/Darwin + 10.7.0. The STDIO VFD test has been disabled while we investigate and + a fix should appear in a future release. + (DER - 2011/10/14 - HDFFV-8235) + +* h5diff can report inconsistent results when comparing datasets of enum type + that contain invalid values. This is due to how enum types are handled in + the library and will be addressed in a future release. + (DER - 2011/10/14 - HDFFV-7527) + +* The links test can fail under the stdio VFD due to some issues with external + links. This will be investigated and fixed in a future release. + (DER - 2011/10/14 - HDFFV-7768) + +* After the shared library support was fixed for some bugs, it was discovered + that "make prefix=XXX install" no longer works for shared libraries. It + still works correctly for static libraries. Therefore, if you want to + install the HDF5 shared libraries in a location such as /usr/local/hdf5, + you need to specify the location via the --prefix option during configure + time. E.g, ./configure --prefix=/usr/local/hdf5 ... + (AKC - 2011/05/07 - HDFFV-7583) + +* The parallel test, t_shapesame, in testpar/, may run for a long time and may + be terminated by the alarm signal. If that happens, one can increase the + alarm seconds (default is 1200 seconds = 20 minutes) by setting the + environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If + it does, it will waste more time if $HDF5_ALARM_SECONDS is set + to a larger value. + (AKC - 2011/05/07) + +* Shared Fortran libraries are not quite working on AIX. While they are + generated when --enable-shared is specified, the Fortran and HL/Fortran + tests fail. HL and C++ shared libraries should now be working as intended, + however. + (MAM - 2011/04/20) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or file systems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + (NAF - 2011/01/19) + +* All of the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added in. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as + it is (see bug report #1279). Quincey will make a plan for 1.10. + (SLU - 2010/02/02) + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + (MAM - 2009/11/04) + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian systems. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + (SLU - 2005/06/30) + + +%%%%1.8.15%%%% + + +HDF5 version 1.8.15 released on 2015-05-04 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.14 and +HDF5-1.8.15, and contains information on the platforms tested and +known problems in HDF5-1.8.15. + +Links to the HDF5 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for HDF5 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document at this location: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.14 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Configuration + ------------- + - CMake + + Improvements made to the CMake build system. + + The default options were changed to align with the Autotools configure + defaults. CMake configure files now support components when packaged + with CPack. Windows CPack supports WiX packaging, and will look for + WiX and NSIS in the standard locations. + + The CMake minimum has been changed to 3.1. + + (ADB - 2015/04/01 HDFFV-8074, 8968, 9006) + + - cmakehdf5 for Cmake building. + Added configure options to support the building of Fortran or CXX API, + to enable/disable testings. Use "cmakehdf5 --help" for details. + (AKC - 2014/12/09 HDFFV-8932) + + - Building Shared and Parallel Made Explicit + + When --enable-parallel is specified, configure used to disable + shared by default. + + Removed the restriction for building shared when parallel is + enabled. --disable-shared has to be used explicitly if user + wishes to disable shared libraries. + + (MSC - 2015/02/19 HDFFV-9069) + + - Inferring Parallel Compilers + + configure was trying to infer if a compiler is a parallel + compiler with MPI support and enable parallel even if the user + did not explicitly enable parallel. This should not happen. + + Disabled inferring parallel compilers to enable parallel HDF5 + build. --enable-parallel has to be used explicitly to build + parallel HDF5 regardless of the compiler type being used. + + (MSC - 2015/02/19 HDFFV-9068) + + - Large File Support Configuration Option + + Removed the option to enable or disable large file support. It will + always be enabled. + + (MSC - 2015/02/19 HDFFV-9097) + + - Removed Configuration Feature + + When configure detected that the CodeWarrior compiler was being used it + would define a symbol that caused a test in test/tfile.c to be skipped + due to a broken CodeWarrior open() command. + + Since this only masks the problem instead of fixing it and we don't + support CodeWarrior anyway, this functionality was removed. + + (DER - 2015/02/21, HDFFV-9080) + + - VMS Build/Test Files Have Been Removed + + HDF5 no longer supports VMS, and the files were getting out of date. + Since we have no access to a VMS machine, there is no way for us to + maintain them. + + A Subversion tag was created at: + + https://svn.hdfgroup.uiuc.edu/tags/vms_last_support_1_8 + + immediately before removing the files. + + (DER - 2015-02-26, HDFFV-9147) + + - Removal of --with-default-vfd configure Option + + In theory, this option was intended to allow setting a default + VFD that would be used by the library. In practice, the feature + only accepted the POSIX (SEC2) VFD (already the default) and + the stdio VFD (a demo VFD not intended for production use). The + inability to pass key VFD parameters at configure time limits the + full implementation of this feature, so it was retired. + + (DER - 2015-02-26, HDFFV-9081) + + - Direct VFD configure Behavior + + The configure options for Linux now allow the Direct VFD to build + without passing additional compiler options/defines like _GNU_SOURCE. + Passing --enable-direct-vfd is now all that is needed to enable + the feature. + + The Direct VFD is now disabled by default since it is intended for + specialized audiences. It was previously enabled by default, but the + configure script did not set correct POSIX levels, etc. making this + a moot point. + + Note that the Direct VFD can only be configured on Linux when + the O_DIRECT flag to open()/create() and posix_memalign() function + are available. This is unchanged from previous behavior. + + (DER - 2015-02-26, HDFFV-9057, 7567, 9088, 7566) + + - _POSIX_C_SOURCE, _GNU_SOURCE, and _BSD_SOURCE No Longer Exported + to h5cc and Other Compiler Wrappers + + The _POSIX_C_SOURCE, _GNU_SOURCE, and _BSD_SOURCE definitions are + not required for using API functions and may conflict with user + code requirements. + + (DER - 2015-03-08, HDFFV-9152) + + - Removed the --enable-filters Option from configure + + This option allowed the user to disable selected internal filters, + presumably to make the library smaller. It has been removed since + it saved little space (the internal filters are small with respect + to the overall library size) and was not generally extendible to + the library at large due to the large number of #ifdefs that would + be required. + + Note that this features applied to internal filters such as shuffle + and n-bit and not external filters like gzip or Szip. Those are still + enabled or disabled via their own configure options. + + (DER - 2015-03-08, HDFFV-9086) + + - Removed Obsolete Time Functionality from configure and the C Library + + The library contained some residual functionality from obsolete + time zone handling code. This has been removed, and the configure + checks for the time functions have been cleaned up. + + * Lumped all the time functionality together in configure.ac. + This was previously more spread out due to Solaris issues + with the ordering of certain checks. + + * Removed processing that handles __tm_gmtoff members of struct + tm. (libc-4) + + * Removed BSDgettimeofday(). (IRIX 5.3) + + * Removed timezone struct handling in gettimeofday() (considered + harmful). + + Note that the HDF5 Library stores timestamps in a platform-independent + manner, so old files can still be read. This only affects converting + system time to HDF5 timestamps. + + The library currently uses the tm_gmtoff member of the tm struct + (preferred, if available) or the timezone global variable to + construct HDF5 timestamps. + + (DER - 2015-03-09, HDFFV-9083 and 9085) + + - Added -D_DEFAULT_SOURCE to CPPFLAGS on Linux Systems + + This is the replacement for -D_BSD_SOURCE in versions of glibc since 2.19. + Since both are defined, it should work for all versions of glibc. Defining + both suppresses the warning about defining _BSD_SOURCE. + + (NAF - 2015-04-02, HDFFV-9079) + + Library + ------- + - Added Memory Allocation Functions that Use the Library's Allocator + + HDF5 filters may need to allocate or resize the buffer that is passed + to them from the library. If the filter has been compiled separately + from the library, it and the library may use different memory + allocation libraries for the (re)allocation and free calls. This can + cause heap corruption and crashes. This is particularly a problem on + Windows since each C run-time library is implemented as a separate + shared library, but can also show up on POSIX systems when debug or + high-performance allocation libraries are in use. + + Two new functions (H5allocate_memory() and H5resize_memory()) were + added to the HDF5 C library. These functions have the same semantics as + malloc/calloc and realloc, respectively. Their primary purpose is to + allow filter authors to allocate or resize memory using the same + memory allocation library as the HDF5 library. Filter authors are + highly encouraged to use these new functions in place of malloc, + calloc, and realloc. They should also use the H5free_memory() call when + freeing memory. + + Note that the filters provided with the library (zlib, szip, etc.) do + not experience the problems that these new functions are intended to + fix. This work only applies to third-party filters that are compiled + separately from the library. + + (DER - 2015-04-01, HDFFV-9100) + + - H5Pset_istore_k and H5Pset_sym_k + + These two functions didn't check the value of the input parameter "ik". + When 2*ik exceeded 2 bytes of storage, data was lost in the file; + for example, some chunks would be overwritten. + + Added validation of "ik" to not exceed the max v1 btree entries (2 bytes) + to these two routines. + + (VC - 2015-03-24, HDFFV-9173) + + - Added Functions to Control the Value of H5PL_no_plugin_g without + Using an Environment Variable + + Sometimes it is necessary for an application to disable the use of + dynamically loaded plugin libraries without requiring the library to + be built with plugin support disabled or to set an environment + variable to disable plugin support globally. + + Two new functions (H5PLset_loading_state() and H5PLget_loading_state()) + were added to the HDF5 C Library. These functions require a parameter + that indicates which type of dynamically loaded plugin is enabled or + disabled. + + (ADB - 2015-03-17, HDFFV-8520) + + Parallel Library + ---------------- + - MPI_Finalize and HDF5 Library Shutdown + + Calling HDF5 routines after MPI_Finalize has been closed should + not be done, since those routines might call MPI functions that + would not be possible to do after finalizing the MPI library. + + Attached an attribute destroy callback to MPI_COMM_SELF that + shuts down the HDF5 library when MPI_COMM_SELF is destroyed, + in other words, on MPI_Finalize. This should fix several issues + that users see when they forget to close HDF5 objects before + calling MPI_Finalize(). + + (MSC - 2015/02/25, HDFFV-883) + + Tools + ----- + - None + + High-Level APIs + --------------- + - None + + Fortran API + ----------- + - Added Global Variables + + These new global variables are equivalent to the C definitions + without the '_F': + + H5G_UDLINK_F + H5G_SAME_LOC_F + H5O_TYPE_UNKNOWN_F + H5O_TYPE_GROUP_F + H5O_TYPE_DATASET_F + H5O_NAMED_DATATYPE_F + H5O_TYPE_NTYPES_F + + (MSB - 2015/02/03, HDFFV-9040) + + + C++ API + ------- + - New Wrappers for C Functions H5P[s/g]et_libver_bounds + + Wrappers were added to class H5::FileAccPropList for the + C Functions H5Pget_libver_bounds and H5Pset_libver_bounds. + + (BMR, 2015/04/06, Part of HDFFV-9167) + + - New Wrappers to Get the Object Header's Version + + The following wrappers are added to class H5::CommonFG + Returns the object header version of an object in a file or group, + given the object's name. + + unsigned childObjVersion(const char* objname) const; + unsigned childObjVersion(const H5std_string& objname) const; + + (BMR, 2015/04/06) + + - New DataType Constructor + + Added a DataType constructor that takes a PredType object, and this + constructor will invoke H5Tcopy to generate another datatype id + from a predefined datatype. + + (BMR, 2015/04/06) + + +Support for New Platforms, Languages, and Compilers +=================================================== + - Support for Linux 3.10.0-123.20.1.el7 added (LK - 2015/04/01) + - Support for Mac OS X Yosemite 10.10 added (AKC - 2015/03/04, HDFFV-9007) + - Support for AIX 6.1 added and AIX 5.3 is retired. (AKC - 2015/01/09) + +Bug Fixes since HDF5-1.8.14 +=========================== + + Configuration + ------------- + - Make uninstall generated "test: argument expected". + The error is due to $EXAMPLETOPDIR is used without setting a value first. + + Fixed by assign it with the proper value. + + (AKC - 2015/04/29, HDFFV-9298) + + - Windows Installer Incorrect Display of PATH Environment Variable + + In the Windows installer, the dialog box where the user can elect to + add the product's bin path to the %PATH% environment variable displayed + an incorrect path. This path was missing the C:\Program Files part + and used the POSIX file separator '/' before the bin (/bin, + instead of \bin). + + The dialog box text was changed to simply say that the product's bin + path would be added instead of explicitly displaying the path. + This is in line with most installers. The reason for not fixing the + displayed path instead is that it is difficult to pass the correct + path from CPack to the NSIS installer for display. + + Note that this was never a code issue - it was just a display + problem. The installer always did the right thing when updating the + environment variable. + + (DER - 2014/11/14, HDFFV-9016) + + Library + ------- + - Incorrect Usage of List in CMake COMPILE_DEFINITIONS set_property + + The CMake command set_property with COMPILE_DEFINITIONS property + needs a quoted semi-colon separated list of values. CMake will + transform the list to a series of -D{value} for the compile. + + (ADB - 2014/12/09, HDFV-9041) + + - Fixed Compile Errors on Windows w/ Visual Studio and CMake When + UNICODE is Defined + + The HDF5 Library could not be built on Windows with Visual Studio when + UNICODE was defined. This was due to the incorrect use of the TEXT() + macro and some Win32 API functions that take TCHAR parameters. The faulty + code was a part of the filter plugin functionality. This was a + compile-time error that only affected users who build HDF5 from source + and define UNICODE, usually when HDF5 is being built as a part of a + larger product. There were no run-time effects. + + These errors caused no problems when UNICODE was not defined. HDF5 is + normally not built with UNICODE defined and the binaries were + unaffected. + + The fix was to remove the TEXT() macro and explicitly use the + 'A' form of the Win32 API calls, which expect char strings instead of + wchar_t strings. + + Note that HDF5 currently does not support Unicode file paths on Windows. + + (DER - 2015/02/22, HDFFV-8927) + + - Addition of Error Tracing Functionality to Several C API Calls + + A bug in a text processing script caused API calls that return a + pointer to not receive error tracing macros/functionality. + + The bug has been corrected and error tracing functionality has been + added to the affected API calls. These functions will now correctly + print trace information when library errors are encountered. + + (DER - 2015/02/26, HDFFV-9141) + + - H5Rdereference Now Checks for HADDR_UNDEF or Uninitialized References + + When passed HADDR_UNDEF or uninitialized references, the previous + behavior of H5Rdereference was to continue to process the reference + as a valid address. + + H5Rdereference was changed to return immediately (with an error + message) if the references are HADDR_UNDEF or uninitialized. + + (MSB - 2015/3/10, HDFFV-7959) + + - Fixed Bugs in H5Sextent_copy + + H5Sextent_copy would not free the previous extent, resulting in a memory + leak. Also, H5Sextent_copy would not update the number of elements + selected if the selection was "all", causing various problems. These + issues have been fixed. + + (NAF - 2015/04/02) + + + Parallel Library + ---------------- + - Fixed a Potential Memory Error + + Fixed a potential memory error when performing parallel I/O on a + dataset with a single chunk, and at least one process has nothing + to do. + + (NAF - 2015/02/16) + + - Parallel Test Problem Fixed + + Fixed problem with parallel tests where they failed beyond a + certain number of ranks. All tests should work for any arbitrary + number of ranks. + + (MSC - 2014/11/06, HDFFV-1027,8962,8963) + + - MPE Support + + Enabling MPE was causing HDF5 build to fail. Support for it was + dropped at some point in time. + + Fixed problem with enabling MPE. Users should use the community + maintained MPE on github (http://git.mpich.org/mpe.git/). + + (MSC - 2015/02/20, HDFFV-9135) + + Performance + ------------- + - None + + Tools + ----- + - h5repack crashed on enumerated 8-bit type. + + Previous version 1.8.14 introduced an error that caused the reading + of enumerated 8-bit type nested in compound type to fail. + + Fixed library code responsible for reading the particular type. + (AKC - 2015.03/31, HDFFV-8667) + + - h52gif crashed non-8bit images. + + h52gif crashed if instructed to convert images other than 8bit images. + + h52gif could handle only 8bit images. Added code to detect non-8bit + images and flag them as failure. Update tool document page to reflect + the limit. + (AKC - 2015/03/31, HDFFV-8957) + + - perform/benchpar.c retired. + + benchpar.c has not been built for a long time and its original purpose + is not needed any more. + (AKC - 2014/12/19, HDFFV-8156) + + - Source perform/ directory moved to tools/perform. + The perform directory is moved to tools/perform for easier maintenance. + (AKC - 2014/12/17, HDFFV-9046) + + Fortran API + ------------ + - Fortran Fails with --enable-fortran2003 and Intel 15.x Compilers + + Added BIND(C) to the offending APIs. + + The Fortran Library (--enable-fortran2003) now works using Intel 15.x + without the need for any additional compilers flags. + + (MSB - 2015/1/26, HDFFV-9049) + + - h5tenum_insert_f Does Not Work with Default 8 Byte Integers + (xlf compiler) + + In the Fortran 90 API, 'value' is no longer cast into the C int type. + Therefore, if h5tenum_insert_f is passed an 8 byte integer (via -i8) + then 'value' is written as the same type as the default Fortran + integer type (which can be 8 bytes). + + A new Fortran 2003 API was added which is more in line with the C + API and users are strongly encouraged to use the Fortran 2003 API + instead of the Fortran 90 API. + + SUBROUTINE h5tenum_insert_f(type_id, name, value, hdferr) + INTEGER(HID_T) , INTENT(IN) :: type_id + CHARACTER(LEN=*), INTENT(IN) :: name + TYPE(C_PTR) , INTENT(IN) :: value + INTEGER, INTENT(OUT) :: hdferr + + (MSB - 2015/2/19, HDFFV-8908) + + - Some Fortran APIs Never Returned the Error State + + Some Fortran APIs never returned the error state: they + would always return a positive number. The APIs include + the following: + + h5fget_file_image_f + h5lget_name_by_idx_f + h5oget_comment_by_name_f + + They were corrected to return a negative number as described in + the Reference Manual if an error occurred. + + (MSB - 2015/3/19, HDF5-239) + + - Fixed h5pget_class_f + + h5pget_class_f never correlated the class identifier to the property + list class name as indicated in the HDF5 Reference Manual; it instead + returned a property list class identifier as an INTEGER. The INTEGER + needed to be of type INTEGER(HID_T) to be correct. + + The h5pget_class_f API was changed to return an INTEGER(HID_T) + property list class identifier instead of an INTEGER. This mimics the + intended behavior of the C API. + + (MSB - 2015/3/16, HDFFV5-9162) + + C++ API + ------ + - Combined Two H5File::getObjCount Overloaded Methods + + The following two methods + + ssize_t getObjCount(unsigned types) const; + ssize_t getObjCount() const; + + were combined into one: + + ssize_t getObjCount(unsigned types = H5F_OBJ_ALL) const; + + (BMR - 2015/04/06) + + - Many Warnings Were Removed + + Many warnings such as conversion, unused variables, missing base + class initialization, and initializing base classes in wrong order + were removed. + + (BMR, 2015/04/06) + + - Functionality Deprecation + + The following two constructors of classes AbstractDs, IdComponent, + H5Location, and H5Object are no longer appropriate after the data member + "id" had been moved from IdComponent to the sub-classes in previous + releases. + + (const hid_t h5_id); + (const & original); + + The copy constructors were no-op and removed in 1.8.15. The other + constructors will be removed from 1.10 release, and then from 1.8.17 + if their removal does not cause any problems. + + (BMR, 2015-04-06) + + + High-Level APIs: + ------ + - Suppress Warnings from Flex/Bison-generated Code + + Warning suppression #pragmas, etc. have been added to H5LTparse.c and + H5LTanalyze.c. We have no control over this code since it's created by + a generator. + + (DER - 2015/03/08 - HDFFV-9149) + + - Changed hdf5_hl.h to Include the HDF5 Main Library "hdf5.h" + + User's no longer need to include both hdf5_hl.h and hdf5.h + + (MSB - 2015/2/14, HDFFV-8685) + + + - H5PTcreate_fl Does Not Convert to Memory Datatype + + H5PTcreate_fl now converts to the table's native memory datatype + to fix the problem of handling BE and LE packet tables. + + (MSB - 2015/2/26 - HDFFV-9042) + + - Fix for H5LT Attribute Functions + + H5LT attribute functions fail to create attributes whose name + is a substring of an existing attribute. + + H5LT attribute functions can now create attributes whose name + is a substring of an existing attribute. + + (MSB - 2015/2/24, HDFFV-9132) + + + Fortran High-Level APIs: + ------------------------ + + - Internal Library Fix for Missing Argument Declaration + + In Interface block for h5tbmake_table_c, "max_char_size_field_names" + is listed as an input, but in the argument definitions it is + "INTEGER :: max_char_size". This caused no known problems with the + Fortran HL API. + + Fixed missing argument definition. + + (MSB - 2015/2/18, HDFFV-8559) + + + Testing + ------- + - None + + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + AIX 6.1 xlc/xlc_r 10.1.0.5 + (NASA G-ADA) xlC/xlC_r 10.1.0.5 + xlf90/xlf90_r 12.1.0.6 + + Linux 2.6.18-308.13.1.el5PAE GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP i686 i686 i386 compilers for 32-bit applications; + (jam) Version 4.1.2 20080704 (Red Hat 4.1.2-55) + Version 4.8.4, 4.9.2 + PGI C, Fortran, C++ Compilers for 32-bit + applications; + Version 14.10-0 + Intel(R) C, C++, Fortran Compiler for 32-bit + applications; + Version 15.0.1.133 (Build 20141023) + + Linux 2.6.18-371.6.1.el5 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; + (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-55) + Version 4.8.4, 4.9.2 + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; + Version 15.0.1.133 Build 20141023 + + Linux 2.6.32-431.11.2.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus) Version 4.4.7 20120313 + Version 4.8.2, Version 4.9.2 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 14.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.1.133 Build 20141023 + + Linux 3.10.0-123.20.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (moohan) Version 4.8.2 20140120 (Red Hat 4.8.2-16) + Intel(R) C Intel(R) 64 Compiler XE for + applications running on Intel(R) 64, + Version 15.0.1.133 Build 20141023 + + Linux 2.6.32-431.29.2.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2008 (cmake) + Visual Studio 2010 w/ Intel Fortran 14 (cmake) + Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Cygwin(CYGWIN_NT-6.1 1.7.34(0.285/5/3) gcc(4.9.2) compiler and gfortran) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2008 (cmake) + Visual Studio 2010 w/ Intel Fortran 14 (cmake) + Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.1 from Xcode 5.1 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (swallow/kite) Intel icc/icpc/ifort version 14.0.2 + + Mac OS X Mavericks 10.9.5 Apple clang/clang++ version 6.0 from Xcode 6.1.1 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (wren/quail) Intel icc/icpc/ifort version 14.0.2 + + Mac OS X Yosemite 10.10.2 Apple clang/clang++ version 6.0 from Xcode 6.1.1 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.1 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +SunOS 5.11 32-bit n y/y n y y y +SunOS 5.11 64-bit n y/y n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/y n y y n +Windows 8.1 n y/y n y y y +Windows 8.1 x64 n y/y n y y y +Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y +Mac OS X Yosemeti 10.10.2 64-bit n y/y n y y y +AIX 6.1 32- and 64-bit n y/n n y y y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y/y y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel n y/y n y y y +CentOS 5.9 Linux 2.6.18-308 i686 PGI n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 GNU n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel n y/y n y y y +CentOS 6.4 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.4 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.4 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.0 Linux 3.10.0 x86_64 GNU y y/y y y y y +CentOS 7.0 Linux 3.10.0 x86_64 Intel n y/y n y y y +Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +SunOS 5.11 32-bit y y y y +SunOS 5.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 8.1 y y y y +Windows 8.1 x64 y y y y +Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +Mac OS X Yosemeti 10.10.2 64-bit y n y y +AIX 6.1 32- and 64-bit y n n y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n +CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n +CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n +CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n +CentOS 7.0 Linux 3.10.0 x86_64 GNU y y y n +CentOS 7.0 Linux 3.10.0 x86_64 Intel y y y n +Linux 2.6.32-431.11.2.el6.ppc64 y y y n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.18-308.13.1.el5PAE MPICH mpich 3.1.3 compiled with + #1 SMP i686 i686 i386 gcc 4.9.2 and gfortran 4.9.2 + (jam) g95 (GCC 4.0.3 (g95 0.94!) + + Linux 2.6.18-431.11.2.el6 MPICH mpich 3.1.3 compiled with + #1 SMP x86_64 GNU/Linux gcc 4.9.2 and gfortran 4.9.2 + (platypus) g95 (GCC 4.0.3 (g95 0.94!) + + FreeBSD 8.2-STABLE i386 gcc 4.5.4 [FreeBSD] 20110526 + (loyalty) gcc 4.6.1 20110527 + g++ 4.6.1 20110527 + gfortran 4.6.1 20110527 + + FreeBSD 8.2-STABLE amd64 gcc 4.5.4 [FreeBSD] 20110526 + (freedom) gcc 4.6.1 20110527 + g++ 4.6.1 20110527 + gfortran 4.6.1 20110527 + + Debian7.5.0 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux + gcc (Debian 4.7.2-5) 4.7.2 + GNU Fortran (Debian 4.7.2-5) 4.7.2 + (cmake and autotools) + + Fedora20 3.15.3-200.fc20.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + GNU Fortran (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + (cmake and autotools) + + SUSE 13.1 3.11.10-17-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.8.1 + GNU Fortran (SUSE Linux) 4.8.1 + (cmake and autotools) + + Ubuntu 14.04 3.13.0-35-generic #62-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + (cmake and autotools) + + hopper.nersc.gov PrgEnv-gnu/5.2.40 + gcc (GCC) 4.9.2 20141030 (Cray Inc.) + GNU Fortran (GCC) 4.9.2 20141030 (Cray Inc.) + g++ (GCC) 4.9.2 20141030 (Cray Inc.) + + +Known Problems +============== +* On Windows platforms in debug configurations, the VFD flush1 tests will fail + with the split and multi VFD drivers. These tests will display a modal debug + dialog which must be answered or wait for the test timeout to expire. + (ADB - 2014/06/23 - HDFFV-8851) + +* CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + catches some undefined behavior in the alignment algorithm of the macro DETECT_I + in H5detect.c (Issue 8147). Since the algorithm is trying to detect the alignment + of integers, ideally the flag -fcatch-undefined-behavior shouldn't to be used for + H5detect.c. In the future, we can separate flags for H5detect.c from the rest of + the library. (SLU - 2013/10/16) + +* Make provided by Solaris fails in "make check". Solaris users should use + gmake to build and install the HDF5 software. (AKC - 2013/10/08 - HDFFV-8534) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD with the + native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the + ports (and probably gcc releases after that). + (QAK - 2012/10/19) + +* The following h5dump test case fails in BG/P machines (and potentially other + machines that use a command script to launch executables): + + h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" + tno-subset.h5 + + This is due to the embedded spaces in the dataset name being interpreted + by the command script launcher as meta-characters, thus passing three + arguments to h5dump's -d flag. The command passes if run by hand, just + not via the test script. + (AKC - 2012/05/03) + +* The STDIO VFD does not work on some architectures, possibly due to 32/64 + bit or large file issues. The basic STDIO VFD test is known to fail on + 64-bit SunOS 5.10 on SPARC when built with -m64 and 32-bit OS X/Darwin + 10.7.0. The STDIO VFD test has been disabled while we investigate and + a fix should appear in a future release. + (DER - 2011/10/14 - HDFFV-8235) + +* h5diff can report inconsistent results when comparing datasets of enum type + that contain invalid values. This is due to how enum types are handled in + the library and will be addressed in a future release. + (DER - 2011/10/14 - HDFFV-7527) + +* The links test can fail under the stdio VFD due to some issues with external + links. This will be investigated and fixed in a future release. + (DER - 2011/10/14 - HDFFV-7768) + +* After the shared library support was fixed for some bugs, it was discovered + that "make prefix=XXX install" no longer works for shared libraries. It + still works correctly for static libraries. Therefore, if you want to + install the HDF5 shared libraries in a location such as /usr/local/hdf5, + you need to specify the location via the --prefix option during configure + time. E.g, ./configure --prefix=/usr/local/hdf5 ... + (AKC - 2011/05/07 - HDFFV-7583) + +* The parallel test, t_shapesame, in testpar/, may run for a long time and may + be terminated by the alarm signal. If that happens, one can increase the + alarm seconds (default is 1200 seconds = 20 minutes) by setting the + environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If + it does, it will waste more time if $HDF5_ALARM_SECONDS is set + to a larger value. + (AKC - 2011/05/07) + +* Shared Fortran libraries are not quite working on AIX. While they are + generated when --enable-shared is specified, the fortran and hl/fortran + tests fail. the issue. HL and C++ shared libraries should now be + working as intended, however. + (MAM - 2011/04/20) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or file systems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + (NAF - 2011/01/19) + +* All the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added in. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as + it is (see bug report #1279). Quincey will make a plan for 1.10. + (SLU - 2010/02/02) + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + (MAM - 2009/11/04) + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + (SLU - 2005/06/30) + + +%%%%1.8.14%%%% + + +HDF5 version 1.8.14 released on 2014-11-12 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.13 and +HDF5-1.8.14, and contains information on the platforms tested and +known problems in HDF5-1.8.14. + +All new and modified APIs are listed in the "HDF5 Software Changes +from Release to Release" document along with details about previous +releases at: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +Links to the HDF5 1.8.14 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.14 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.14 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.13 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Configuration + ------------- + - bin/cmakehdf5 configures, builds and installs C, C++, Fortran and High + level API's. (It used to build the C API only). + (AKC 2014/10/17 HDFFV-8932). + + Library + ------- + - None + + Parallel Library + ---------------- + - Chunk Fill Writes Changed to Collective + + Slow performance in chunk fill writes. Chunk fills + in the past were written independently by rank 0 one block + at a time. + + Optimized the chunk fill write algorithm so that all + chunk fill values will be written collectively in a single MPI-IO + call. This should show a great performance improvement when + creating chunked datasets in parallel when the chunk dimensions + are fairly small. + + (MSC - 2014/08/22, HDFFV-8878) + + Tools + ----- + - None + + High-level APIs + --------------- + - None + + Fortran API + ----------- + - None + + C++ API + ------- + - Initialization of Object IDs + + The data member "id" in classes that represent HDF5 objects were + initialized to 0, which caused problem for some users. + + Replaced 0 with H5I_INVALID_HID to initialize these "id"s. For the + PropList class, H5P_DEFAULT is used instead of H5I_INVALID_HID. + + (BMR - 2014/09/30, HDFFV-4259) + + + +Support for New Platforms, Languages, and Compilers +=================================================== + - None + +Bug Fixes since HDF5-1.8.13 +=========================== + + Configuration + ------------- + - CMake and SVN URLs + + The SVN URLs will be different when the HDF Group domain name changes. + + Removed the SVN URL references in the cacheinit.cmake and release_docs files. + + (ADB - 2014/10/27, HDFFV-8953) + + - CMake Packaging + + A Fortran module was not generated if the compiler was not F2003 + compliant. + + Removed the module name from the package list of Fortran modules because + that module was never generated. This was only an issue for Fortran + compliers that are not F2003 compatible. + + (ADB - 2014/10/16, HDFFV-8932) + + - Shared Library Interface Version Number (soname) + + In order to increase the maintainability of HDF5, an architectural + change was made which required the renaming of several public symbols in + H5Ppublic.h. + + The shared libary interface version number ("soname") has been increased + on account of these changes. For a full list of the changed symbols, see + the interface compatibility report, which is available as a link off of + the 'HDF5 Software Changes from Release to Release' document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + + (AKC - 2014/10/03, HDFFV-8937) + + - Configure Settings for Mac OSX Need Defaults for PROD_XXX, DEBUG_XXX, + and PROFILE_XXX + + The configure setting files for Mac OSX (config/apple) did not + have the default settings of PROD_XXX, DEBUG_XXX, PROFILE_XXX. + + Added the default settings. Mac platforms now builds library with + "-O3" optimization when the default clang compiler is used. + + (AKC - 2014/10/01, HDFFV-8933) + + - CMake ConfigureChecks + + Two include files were missing from two C tests. + + Propagated the configure test changes to H5_LDOUBLE_TO_INTEGER_WORKS_TEST + and H5_ULLONG_TO_LDOUBLE_PRECISION_TEST to ConfigureChecks.cmake (added + stdlib.h and string.h in the HDFTests.c file). + + (ADB - 2014/09/02 HDFFV-8845) + + - CMake Parallel Test Missing + + The source file was removed in the previous release but the parallel + test t_posix_compliant was not. + + Removed the t_posix_compliant parallel test from the library. + + (ADB - 2014/8/14 HDFFV-8880) + + - Autotools Reconfigure. Bison. Flex. + + The Bison and Flex files were out of date. + + Bison was upgraded to 2.7, and Flex was upgraded to 2.5.37. The + bin/reconfigure script now will execute Bison and Flex and update + the hl/src files. + + (ADB - 2014/06/16 HDFFV-8709) + + - Autotools Reconfigure. m4. + + The m4 macro processor was out of date. + + Reconfigured Autotools with m4 upgraded to 1.4.17. + + (ADB - 2014/06/12 HDFFV-8743) + + - Autotools: Modified configure to add an entry at the beginning of AM_LDFLAGS + for the hdf5 install directory. Without this entry the relink commands + invoked by "make install" to create libraries dependent on libhdf5.so added + a dependency on the first libhdf5.so found in any directory in AM_LDFLAGS + regardless of its version. (LRK - 2014/10/17 HDFFV-8944) + + - Changed Autotools Build Behavior. Fortran High-level Library. + + The Fortran high-level (HL) library did not compile if the default + size of a REAL is DOUBLE PRECISION; the build would fail during + compilation. + + Configure now checks to see if REAL is DOUBLE PRECISION, Fortran is + enabled, and HL library is enabled. If this is true, then configure + will stop with an error message. + + (MSB - 2014/8/11, HDFFV-8883/HDFFV-889) + + + + Library + ------- + - Fixed Identifier Management Code + + Opening an object returns an identifier; closing the object should + free up the identifier. A problem was found where the identifiers + were not being freed up correctly. + + Fixed the problem so that identifiers that have been used can be + used again after their object has been closed. + + (QAK - 2014/10/16, HDFFV-8930) + + - Removal of DllMain() from Static Windows Builds + + A DllMain() function was added in HDF5 1.8.13 in order to handle + win32 thread cleanup. The preprocessor #ifdefs around the DllMain + function allowed it to be compiled when the static library is built, + which is incorrect behavior that can cause linkage problems in + clients. + + The fix was to change the preprocessor #ifdefs to exclude compiling + DllMain() in static builds. Our DllMain function is now only + compiled when the shared, thread-safe library is built on Windows. + + (DER - 2014/06/13, HDFFV-8837) + + - Enforce Constraint on page_size Parameter in H5Pset_core_write_tracking() + + The reference manual states that the page_size parameter cannot be + zero. + + This change checks the page_size parameter to see it is zero and + returns an error code if it is. + + (DER - 2014/08/11, HDFFV-8891) + + - H5Ldelete_by_idx() fails on non-existent group name. + (MSC - 2014/07/31, HDFFV-8888) + + - H5Ldelete_by_idx() Seg Fault on Non-existent Group Name + + If a non-existent group name was used by H5Ldelete_by_idx(), a + segmentation fault would result. + + Bug was fixed. + + (MSC - 2014/07/31, HDFFV-8888) + + - Bug in Test When Building Parallel HDF5 on PVFS2 + + There was a bug in a test when building Parallel HDF5 on PVFS2. + + The build now uses MPI_File_get_size() instead of stat(). + + (MSC - 2014/07/14, HDFFV-8856) + + - MPI-IO Driver Tried to Allocate Space for Zero-length Dataset + + MPI-IO driver tried to allocate space for zero-length dataset + and asserts. + + Fixed driver and added a regression test. + + (MSC - 2014/07/03, HDFFV-8761) + + + Parallel Library + ---------------- + - None + + Performance + ------------- + - None + + Tools + ----- + - None + + Fortran API + ------- + - SIZEOF Replaced by C_SIZEOF and STORAGE_SIZE. + + The intrinsic function SIZEOF is non-standard and should be replaced with a + standard intrinsic function. + + If the F2008 intrinsic C_SIZEOF and STORAGE_SIZE are available, then they will + be used instead of the non-standard SIZEOF intrinsic, even when the SIZEOF + function is available. + + (MSB - 2014/6/16, HDFFV-8653) + + - Non-functional API: h5pget_fill_value_f + + The Fortran wrapper h5pget_fill_value_f was calling the wrong C API. + + The correct C API, H5Pget_fill_value, is now called by the Fortran + wrapper. + + (MSB - 2014/9/25, HDFFV-8879) + + - Interoperability with C HDF5: H5Literate and h5literate_f + + h5literate_f assumes the return value for the callback function to + be of type int (or int_f in C). However, in the C wrapper the return + value of H5Literate is type herr_t, and this could cause + interoperability issues. + + The callback function should be declared INTEGER(C_INT) for + portability. The tests were updated accordingly. + + (MSB - 2014/9/26, HDFFV-8909) + + - Interoperability with C HDF5: Constant INTEGER Parameters with the + H5FD Interface + + Wrong type cast of constant Fortran INTEGER parameters was used. + + The following parameter constant types were changed from INTEGER to + INTEGER(HID_T) to match the C types: H5FD_CORE, H5FD_FAMILY, H5FD_LOG, + H5FD_MPIO, H5FD_MULTI, H5FD_SEC2, and H5FD_STDIO. + + Other internal 'int' types where changed to 'hid_t'; these are + transparent to the user. + + (MSB - 2014/7/18, HDFFV-8748) + + C++ API + ------ + - Memory Leaks + + There were several potential memory leaks in the library due to + dynamically allocated strings not being freed when failure occurs. + + Applied user's patches to remove these potential memory leaks. + + (BMR - 2014/09/30, HDFFV-8928) + + - Disallow H5F_ACC_CREAT + + H5F_ACC_CREAT was included in the C++ API but the C library does not + allow it at this time. + + Removed this flag from the functions in H5File class. + + (BMR - 2014/09/29, HDFFV-8852) + + - Missing Flags in Documentation: H5F_ACC_RDONLY and H5F_ACC_RDWR + + The H5F_ACC_RDONLY and H5F_ACC_RDWR flags were missing from the + documentation of the H5File constructors. + + These two flags are now included in the documentation for opening + files. + + (BMR - 2014/09/29, HDFFV-8852) + + High-level APIs: + ------ + - Seg Faults in H5TBread_field_name and H5TBread_field_name_f + + When H5TBread_field_name or H5TBread_field_name_f were used to read a + field and if the name of the field was wrong, a segmentation fault + would result. + + Both C and Fortran APIs were fixed so they no longer seg fault if + the name of the field is wrong, and both APIs return a negative + value if the name of the field is wrong. + + (MSB - 2014/09/29, HDFFV-8912) + + - Possible Buffer Overflow in High-level (HL) APIs + + Multiple HL APIs (H5DSis_scale is one example) had issues: + (1) The datatype from the file was re-used as the memory datatype, + and + (2) No effort was made to ensure that strings were actually + null-terminated. + + All of the HL routines now check for NULL pointers, for null-terminated + strings, and to see if string buffers are short enough not to overflow + the buffer. The minimum length of the buffers is now used in strncmp + to avoid overflow. + + (MSB - 2014/9/29, HDFFV-8670) + + - Behavior Change of H5LTdtype_to_text + + If a user buffer was passed in to H5LTdtype_to_text along with the + length, then the function would not truncate at the end of the + buffer, but would exceed the end of the user buffer. + + H5LTdtype_to_text was changed to truncate the string if the user + buffer is too small. + + (MSB - 2014/9/29, HDFFV-8855) + + Fortran High-level APIs: + ------ + - See entry for HDFFV-8912 above. + + Testing + ------- + - A subtest in parallel h5diff (ph5diff) testing was bypassed for the + local Linux 32 machine due to unknown issue in the previous version of + Mpich. The failure no long exists in the current Mpich. Therefore the + bypass is removed. (AKC - 2014/11/03 HDFFV-8954) + + - Fixed incorrect exit code values (was -1) in testframe which is commonly + used by several test programs. (AKC - 2014/07/22 HDFFV-8881) + + - Fixed Incorrect Exit Code Values in Testframe + The testframe which is commonly used by several test programs + had some incorrect exit code values. Fixed the incorrect exit code + values. (AKC - 2014/07/22, HDFFV-8881) + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + AIX 5.3 xlc 10.1.0.5 + (NASA G-ADA) xlC 10.1.0.5 + xlf90 12.1.0.6 + + Linux 2.6.18-308.13.1.el5PAE GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP i686 i686 i386 compilers for 32-bit applications; + (jam) Version 4.1.2 20080704 (Red Hat 4.1.2-54) + Version 4.8.2 + PGI C, Fortran, C++ Compilers for 32-bit + applications; + Version 13.7-0 + Intel(R) C, C++, Fortran Compiler for 32-bit + applications; + Version 14.0.2 (Build 20140120) + + Linux 2.6.18-371.6.1.el5 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; + (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-54) + Version 4.8.2 + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; + Version 14.0.2 (Build 20140120) + + Linux 2.6.32-431.11.2.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus) Version 4.4.7 20120313 + Version 4.8.2 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 13.7-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 14.0.2 (Build 20140120) + + Linux 2.6.32-431.29.2.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2008 (cmake) + Visual Studio 2010 w/ Intel Fortran 14 (cmake) + Visual Studio 2012 w/ Intel Fortran 14 (cmake) + Visual Studio 2013 w/ Intel Fortran 14 (cmake) + Cygwin(CYGWIN_NT-6.1 1.7.32(0.274/5/3) gcc(4.8.3) compiler and gfortran) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2008 (cmake) + Visual Studio 2010 w/ Intel Fortran 14 (cmake) + Visual Studio 2012 w/ Intel Fortran 14 (cmake) + Visual Studio 2013 w/ Intel Fortran 14 (cmake) + + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 14 (cmake) + Visual Studio 2013 w/ Intel Fortran 14 (cmake) + + Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 14 (cmake) + Visual Studio 2013 w/ Intel Fortran 14 (cmake) + + Mac OS X Lion 10.7.5 Apple clang/clang++ version 3.0 from Xcode 4.6.1 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (duck) Intel icc/icpc/ifort version 13.0.3 + + Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.1 from Xcode 5.1 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (swallow/kite) Intel icc/icpc/ifort version 14.0.2 + + Mac OS X Mavericks 10.9.5 Apple clang/clang++ version 6.0 from Xcode 6.0.1 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (wren) Intel icc/icpc/ifort version 14.0.2 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +Solaris2.11 32-bit n y/y n y y y +Solaris2.11 64-bit n y/y n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/y n y y n +Windows 8.1 n y/y n y y y +Windows 8.1 x64 n y/y n y y y +Mac OS X Lion 10.7.5 64-bit n y/y n y y y +Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y ? +AIX 5.3 32- and 64-bit n y/n n y y y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y/y y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel n y/y n y y y +CentOS 5.9 Linux 2.6.18-308 i686 PGI n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 GNU n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel n y/y n y y y +CentOS 6.4 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.4 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.4 Linux 2.6.32 x86_64 PGI n y/y n y y y +Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 8.1 y y y y +Windows 8.1 x64 y y y y +Mac OS X Lion 10.7.5 64-bit y n y y +Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +AIX 5.3 32- and 64-bit y n n y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n +CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n +CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n +CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n +Linux 2.6.32-431.11.2.el6.ppc64 y y y n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.18-308.13.1.el5PAE MPICH mpich 3.1.2 compiled with + #1 SMP i686 i686 i386 gcc 4.9.1 and gfortran 4.9.1 + (jam) g95 (GCC 4.0.3 (g95 0.94!) + + Linux 2.6.18-431.11.2.el6 MPICH mpich 3.1.2 compiled with + #1 SMP x86_64 GNU/Linux gcc 4.9.1 and gfortran 4.9.1 + (platypus) g95 (GCC 4.0.3 (g95 0.94!) + + FreeBSD 8.2-STABLE i386 gcc 4.5.4 [FreeBSD] 20110526 + (loyalty) gcc 4.6.1 20110527 + g++ 4.6.1 20110527 + gfortran 4.6.1 20110527 + + FreeBSD 8.2-STABLE amd64 gcc 4.5.4 [FreeBSD] 20110526 + (freedom) gcc 4.6.1 20110527 + g++ 4.6.1 20110527 + gfortran 4.6.1 20110527 + + Debian7.5.0 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux + gcc (Debian 4.7.2-5) 4.7.2 + GNU Fortran (Debian 4.7.2-5) 4.7.2 + (cmake and autotools) + + Fedora20 3.15.3-200.fc20.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + GNU Fortran (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + (cmake and autotools) + + SUSE 13.1 3.11.10-17-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.8.1 + GNU Fortran (SUSE Linux) 4.8.1 + (cmake and autotools) + + Ubuntu 14.04 3.13.0-35-generic #62-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + (cmake and autotools) + + Cray Linux Environment (CLE) PrgEnv-pgi/4.2.34 + hopper.nersc.gov pgcc 13.6-0 64-bit target on x86-64 Linux -tp istanbul + pgf90 13.6-0 64-bit target on x86-64 Linux -tp istanbul + pgCC 13.6-0 64-bit target on x86-64 Linux -tp istanbul + + +Known Problems +============== +* On cygwin platforms the feature to load dynamic filter libraries only looks + for libraries with the a so extension. Support for cygwin cygxxx.dll libraries + is planned for the next release. + (ADB - 2014/11/04 - HDFFV-8736) + +* On windows platforms in debug configurations, the VFD flush1 tests will fail + with the split and multi VFD drivers. These tests will display a modal debug + dialog which must be answered or wait for the test timeout to expire. + The flush1 and flush2 tests will be skipped under debug for this release. + (ADB - 2014/06/23 - HDFFV-8851) + +* CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + catches some undefined behavior in the alignment algorithm of the macro DETECT_I + in H5detect.c (Issue 8147). Since the algorithm is trying to detect the alignment + of integers, ideally the flag -fcatch-undefined-behavior shouldn't to be used for + H5detect.c. In the future, we can separate flags for H5detect.c from the rest of + the library. (SLU - 2013/10/16) + +* Make provided by Solaris fails in "make check". Solaris users should use + gmake to build and install the HDF5 software. (AKC - 2013/10/08 - HDFFV-8534) + +* The h5dump and h5diff utilities occasionally produce different output + between Linux and Windows systems. This is caused by lower-level library + routines that fail to write fill values to the user's buffer when reading + unallocated chunks from datasets that have a fill value set to + H5D_FILL_VALUE_DEFAULT. Due to platform differences the return of + spurious data values has only been encountered on Windows 32-bit systems. + (Issue HDFFV-8247; JP - 2013/03/27) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD with the + native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the + ports (and probably gcc releases after that). + (QAK - 2012/10/19) + +* The STDIO VFD does not work on some architectures, possibly due to 32/64 + bit or large file issues. The basic STDIO VFD test is known to fail on + 64-bit SunOS 5.10 on SPARC when built with -m64 and 32-bit OS X/Darwin + 10.7.0. The STDIO VFD test has been disabled while we investigate and + a fix should appear in a future release. + (DER - 2011/10/14 - HDFFV-8235) + +* h5diff can report inconsistent results when comparing datasets of enum type + that contain invalid values. This is due to how enum types are handled in + the library and will be addressed in a future release. + (DER - 2011/10/14 - HDFFV-7527) + +* The links test can fail under the stdio VFD due to some issues with external + links. This will be investigated and fixed in a future release. + (DER - 2011/10/14 - HDFFV-7768) + +* After the shared library support was fixed for some bugs, it was discovered + that "make prefix=XXX install" no longer works for shared libraries. It + still works correctly for static libraries. Therefore, if you want to + install the HDF5 shared libraries in a location such as /usr/local/hdf5, + you need to specify the location via the --prefix option during configure + time. E.g, ./configure --prefix=/usr/local/hdf5 ... + (AKC - 2011/05/07 - HDFFV-7583) + +* The parallel test, t_shapesame, in testpar/, may run for a long time and may + be terminated by the alarm signal. If that happens, one can increase the + alarm seconds (default is 1200 seconds = 20 minutes) by setting the + environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If + it does, it will waste more time if $HDF5_ALARM_SECONDS is set + to a larger value. + (AKC - 2011/05/07) + +* Shared Fortran libraries are not quite working on AIX. While they are + generated when --enable-shared is specified, the fortran and hl/fortran + tests fail. We are looking into the issue. HL and C++ shared libraries + should now be working as intended, however. + (MAM - 2011/04/20) + +* The --with-mpe configure option does not work with Mpich2. + (AKC - 2011/03/10) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or file systems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + (NAF - 2011/01/19) + +* All the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added in. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as + it is (see bug report #1279). Quincey will make a plan for 1.10. + (SLU - 2010/02/02) + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + (MAM - 2009/11/04) + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. + (CMC - 2009/04/28) + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + (SLU - 2005/06/30) + + +%%%%1.8.13%%%% + + +HDF5 version 1.8.13 released on 2014-05-05 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.12 and +HDF5-1.8.13, and contains information on the platforms tested and +known problems in HDF5-1.8.13. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.13 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.13 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.13 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.13 (current +release) versus Release 1.8.12": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.12 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Configuration + ------------- + - Autotools: Automake updated to 1.14.1 (ADB - 2014/04/08) + + - CMake: Moved minimum CMake version to 2.8.11 which enables better library + include processing. (ADB - 2014/03/26) + + - When configuring a thread-safe HDF5 Library it is no longer necessary + to specify --enable-threadsafe with --with-pthreads if the Pthreads + library is in a standard location. (DER - 2014/04/11 HDFFV-8693) + + Library + ------- + - Added an H5free_memory API call. This should be used to free memory + that has been allocated by HDF5 API calls. H5Tget_member_name and + H5Pget_class_name are two examples. The main motivation for this call + is Windows, where it is common for application code and the HDF5 Library + to be using different C run-time libraries (CRT). Using the new call + ensures that the same CRT handles both the allocation and free. This + new function can also be useful in any case where the library uses a + different memory manager than the application, such as when a debug + memory manager is in use or when the HDF5 Library is wrapped for use + in a managed language like Python or Java. Fixes HDFFV-7710, 8519, + and 8851. (DER - 2014/04/11) + + - The Core VFD (aka Memory VFD) can now be configured to track dirty + regions in the file and only write out the changed regions on + flush/close. Additionally, a "page aggregation" size can be set that + will aggregate small writes into larger writes. For example, setting + a 1 MiB page aggregation size will logically partition the the + in-memory file into 1 MiB pages that will be written out in their + entirety if even a single byte is dirtied. The feature is controlled + via the new H5Pset/get_core_write_tracking() API call. A new + "core_paged" target has been added to the check-vfd target in + test/Makefile.am that exercises the feature over all HDF5 VFD-aware + tests. (DER - 2014/04/12) + + Parallel Library + ---------------- + - Removed MPI-POSIX VFD, as it wasn't helping anyone and was just + generating support questions. Application developers performing + parallel I/O should always use the MPI-IO VFD. + (QAK - 2014/03/28 HDFFV-8659) + + - Improved parallel I/O support to allow collective I/O on point + selections. (QAK - 2014/03/15) + + Tools + ----- + - None + + High-Level APIs + --------------- + - None + + Fortran API + ----------- + - Wrappers h5pset_file_image_f and h5pget_file_image_f were added to the + library. (MSB - 2014/1/2014) + + C++ API + ------- + - The following new features are added: + + Wrappers to class H5Object to get an object's name (HDFFV-8548). + ssize_t getObjName(char *obj_name, size_t buf_size = 0) + ssize_t getObjName(H5std_string& obj_name, size_t len = 0) + H5std_string getObjName() + + Wrappers to class H5CommonFG to get a child object's type from a + group or file (HDFFV-8367). + H5O_type_t childObjType(const H5std_string& objname) + H5O_type_t childObjType(const char* objname) + H5O_type_t childObjType(hsize_t index, + H5_index_t index_type=H5_INDEX_NAME, + H5_iter_order_t order=H5_ITER_INC, const char* objname=".") + + Wrappers to class DSetMemXferPropList for setting/getting a transform + property list (HDFFV-7907). + DSetMemXferPropList(const char* expression); + void setDataTransform(const char* expression) + void setDataTransform(const H5std_string& expression) + ssize_t getDataTransform(char* exp, size_t buf_size=0) + H5std_string getDataTransform() + + Wrapper to CompType for setting size to compound datatype (HDFFV-8642). + void setSize(size_t size) + + Overloaded functions to provide prototypes that declare constant + arguments const (HDFFV-3384). These include: + DataSet::fillMemBuf + DataSet::getVlenBufSize + DataSpace::extentCopy + DataType::commit + FileAccPropList::setSplit + H5File::getVFDHandle + + Additional overload to class H5Location to get a comment as a char* + ssize_t getComment(const char* name, size_t buf_size, char* comment) + + Additional overloads to class Attribute to get an attribute's name for + convenience: + ssize_t getName(char* attr_name, size_t buf_size=0) + ssize_t getName(H5std_string& attr_name, size_t buf_size=0) + (BMR, 2014/04/15) + + A static wrapper to Exception for printing the error stack without an + instance of Exception + static void printErrorStack(FILE* stream = stderr, + hid_t err_stack = H5E_DEFAULT); + (BMR, 2014/04/25) + + +Support for New Platforms, Languages, and Compilers +=================================================== + Mac OS X 10.6 Snow Leopard is not supported by Apple any more. In view of + the added support of Mac OS X 10.9, Mac OS X 10.6 is retired from HDF5 + supported platforms. (AKC - 2014/03/14 HDFFV-8704) + + Mac OS X 10.9 Mavericks is supported. (AKC - 2014/03/04 HDFFV-8694) + + +Bug Fixes since HDF5-1.8.12 +=========================== + + Configuration + ------------- + - CMake: When CMake commands are executed individually on the command line + and the external filters are being built, the CMAKE_BUILD_TYPE define + must be set to the same value as the configuration + (-DCMAKE_BUILD_TYPE:STRING=Release if using -C Release). This is needed + by the the szip and zlib filter build commands. (ADB - HDFFV-8695) + + - CMake: Removed use of the XLATE_UTILITY program. + (ADB - 2014/03/28 HDFFV-8640) + + - CMake: Added missing quotes in setting the CMAKE_EXE_LINKER_FLAGS for the + MPI option. (ADB - 2014/02/27 HDFFV-8674) + + - CMake: Configuration of the HDF5 C++ or Fortran libraries with the + thread-safety feature. + + C++ and/or Fortran + thread-safe is enforced as a non-supported + configuration. This matches the autotools. (DER - 2014/04/11) + + - CMake: Configuration of static HDF5 C library with the thread-safety + feature. + + Static + thread-safe + Win32 threads is not a supported configuration + due to the inability to automatically clean up thread-local storage. + This is expected to be fixed in a future release. In the meantime, a + work-around that uses internal functionality may allow the combination + to be used without resource leaks. Contact the help desk for more + information. (DER - 2014/04/11) + + - Autotools: Several changes were done to configure and installcheck. + + An export of LD_LIBRARY_PATH= was + removed from configure; make installcheck was revised to run + scripts installed in share/hdf5_examples to use the installed h5cc, etc. + to compile and run example source files also installed there. + + Make installcheck will now fail when a shared szip or other external lib + file cannot be found in the same manner that executables compiled and + linked with h5cc will fail to run when those lib files cannot be found + after install. Make installcheck should pass after setting + LD_LIBRARY_PATH to the szip location. (LRK - 2014/04/16) + + Library + ------- + - A Gnu Make directive (.NOTPARALLEL) is added to fortran/test/Makefile. + + AIX native make does not support this directive and would fail if + parallel make (e.g. make -j4) is used to build the library. AIX users + either do not use parallel make or install Gnu Make to build the library. + (AKC 2014/04/08 HDFFV-8738) + + - H5R.c: H5Rget_name gave an assertion failure if the "name" parameter + was NULL. + + Fixed H5Rget_name to return the size of the buffer needed to read a + name of the referenced object in this case. The size doesn't include + the NULL terminator. H5Rget_name returns negative on failure. + (MSB - 2014/01/22 HDFFV-8620) + + - H5Z.c: H5Zfilter_avail didn't check if a filter was available as a + dynamically loaded filter. The error manifested itself in the h5repack + tool when removing user-defined dynamically loaded filter. + + Added a code to find the filter among the dynamically loaded filters + after the function fails to find it among the registered filters. + (ADB - 2014/03/03 HDFFV-8629) + + - Memory leak: a memory leak was observed in conjunction to the + H5TS_errstk_key_g thread-local variable allocated in the H5E_get_stack + function in H5E.c. + + The shared HDF5 thread-safe library now no longer leaks thread-local + storage resources on Windows with Win32 threads. Currently, there is + no solution for this problem when HDF5 is statically built. We + disabled the build of the static HDF5 thread-safe library with + Win32 threads. (DER - 2014/04/11 HDFFV-8518) + + - H5Dio.c: Improved handling of NULL pointers to H5Dread/H5Dwrite + calls. Credit to Jason Newton (nevion@gmail.com) for the original patch. + + H5Dwrite/read failed when a NULL pointer was passed for a data buffer + and 0 elements were selected. Fixed. (QAK - 2014/04/16 HDFFV-8705) + + - Deprecated API (1_6 API): Improved handling of closing the library and + re-accessing it with a deprecated routine. + + When a program used a deprecated API (for example, H5Gcreate1), + closed the library, and reopened it again to access a group, dataset, + datatype, dataspace, attribute, or property list, HDF5 failed to + provide an identifier for the object. Fixed. + (NAF, QAK - 2014/04/16 HDFFV-8232) + + Parallel Library + ---------------- + - Fixed a missing H5F_Provisional module in HDF5mpio.f90 + (MSB - 2014/2/7 HDFFV-8651) + + Performance + ------------- + - None + + Tools + ----- + - The h5diff tool would report that a datafile compared with an exact + copy of the same datafile had differences. This was due to the issue + below of reading un-written chunks. This problem is also fixed. + (AKC - 2014/05/01 HDFFV-8637) + + - The h5dump and h5diff utilities occasionally produced different output + between Linux and Windows systems. This has been fixed. + + This happened to datasets that used chunked storage, with default fill + values, and some of the chunks had not been written. + When the dataset was read, the library failed to write the default fill + values to parts of the use buffer that were associated with the unwritten + chunks. (JP - 2014/05/01 HDFFV-8247) + + - The compress option is retired from bin/release. + (AKC - 2014/04/25 HDFFV-8755) + + - bin/release has a new option "zip" that produces a release zip file for + the Windows platform. (AKC - 2014/04/24 HDFFV-8433) + + - h5diff: Several failures relating to handling of strings attributes + are fixed. + + The tool crashed or gave an error message when one of the strings had + fixed size type and another variable-length size type. h5diff now flags such + strings as "not comparable". We plan to enhance the tool to handle + strings of the different types in the future releases. + (AKC - 2014/04/18 HDFFV-8625, 8639, 8745) + + - h5repack: h5repack would not remove user-defined filters. + Fixed by modifying h5repack to check if the filter is registered or + can be dynamically loaded. (ADB - 2014/03/03 HDFFV-8629) + + F90 API + ------- + - H5D_CHUNK_CACHE_NSLOTS_DFLT_F and H5D_CHUNK_CACHE_NBYTES_DFLT_F were + changed from the default KIND for INTEGER to INTEGER of KIND size_t. + (MSB - 2014/3/31 HDFFV-8689) + + C++ API + ------ + - Added throw() to all exception destructors. Credit to Jason Newton + (nevion@gmail.com) for the patch. (BMR - 2014/4/15 HDFFV-8623) + - Changed the default value for H5Location::getComment from 256 to 0 + to conform to C function and because it makes more sense. + (BMR - 2014/4/15) + + High-Level APIs: + ------ + - None + + Fortran High-Level APIs: + ------ + - None + + Testing + ------- + - testhdf5 now exits with EXIT_SUCCESS(0) if no errors, else + EXIT_FAILURE(1). (AKC - 2014/01/27 HDFFV-8572) + + - The big test now pays attention to the HDF5_DRIVER environment variable. + Previously, it would run all tests with the family, stdio, and sec2 + virtual file drivers (VFDs) for each VFD in the check-vfd make target, + regardless of the variable setting. It now checks the variable and + either runs the appropriate VFD-specific tests or skips as needed. + This saves much testing time. Fixes HDFFV-8554. (DER - 2014/04/11) + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + AIX 5.3 xlc 10.1.0.5 + (NASA G-ADA) xlC 10.1.0.5 + xlf90 12.1.0.6 + gmake v3.82 + + Linux 2.6.18-308.13.1.el5PAE GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP i686 i686 i386 compilers for 32-bit applications; + (jam) Version 4.1.2 20080704 (Red Hat 4.1.2-54) + Version 4.8.2 + PGI C, Fortran, C++ Compilers for 32-bit + applications; + Version 13.7-0 + Intel(R) C, C++, Fortran Compiler for 32-bit + applications; + Version 14.0.2 (Build 20140120) + + Linux 2.6.18-371.6.1.el5 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; + (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-54) + Version 4.8.2 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 13.7-0 + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; + Version 14.0.2 (Build 20140120) + + Linux 2.6.32-431.11.2.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus) Version 4.4.7 20120313 + Version 4.8.2 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 13.7-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 14.0.2 (Build 20140120) + + Linux 2.6.32-431.11.2.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + IBM XL C/C++ V11.1 + IBM XL Fortran V13.1 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2008 w/ Intel Fortran 14 (cmake) + Visual Studio 2010 w/ Intel Fortran 14 (cmake) + Visual Studio 2012 w/ Intel Fortran 14 (cmake) + Cygwin(CYGWIN_NT-6.1 1.7.28(0.271/5/3) gcc(4.8.2) compiler and gfortran) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 14 (cmake) + Visual Studio 2010 w/ Intel Fortran 14 (cmake) + Visual Studio 2012 w/ Intel Fortran 14 (cmake) + + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 14 (cmake) + + Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 14 (cmake) + + Mac OS X Lion 10.7.3 Apple clang/clang++ version 3.0 from Xcode 4.6.1 + 64-bit gfortran GNU Fortran (GCC) 4.6.2 + (duck) Intel icc/icpc/ifort version 13.0.3 + + Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.0 from Xcode 5.0.2 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (swallow/kite) Intel icc/icpc/ifort version 14.0.2 + + Mac OS X Mavericks 10.9.2 Apple clang/clang++ version 5.1 from Xcode 5.1 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (wren/quail) Intel icc/icpc/ifort version 14.0.2 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +Solaris2.11 32-bit n y/y n y y y +Solaris2.11 64-bit n y/y n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/y n y y y +Windows 8.1 n y/y n y y y +Windows 8.1 x64 n y/y n y y y +Mac OS X Lion 10.7.3 64-bit n y/y n y y y +Mac OS X Mountain Lion 10.8.1 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.1 64-bit n y/y n y y y +AIX 5.3 32- and 64-bit n y/n n y y y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y/y y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel n y/y n y y y +CentOS 5.9 Linux 2.6.18-308 i686 PGI n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 GNU n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel n y/y n y y y +CentOS 6.4 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.4 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.4 Linux 2.6.32 x86_64 PGI n y/y n y y y +Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y +OpenVMS IA64 V8.4 n y/n n y y n + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 8.1 y y y y +Windows 8.1 x64 y y y y +Mac OS X Lion 10.7.3 64-bit y n y y +Mac OS X Mountain Lion 10.8.1 64-bit y n y y +Mac OS X Mavericks 10.9.1 64-bit y n y y +AIX 5.3 32- and 64-bit y n n y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n +CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n +CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n +CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n +Linux 2.6.32-431.11.2.el6.ppc64 y y y n +OpenVMS IA64 V8.4 n n n n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.18-308.13.1.el5PAE MPICH mpich 3.1 compiled with + #1 SMP i686 i686 i386 gcc 4.8.2 and gfortran 4.8.2 + (jam) g95 (GCC 4.0.3 (g95 0.94!) + + Linux 2.6.18-431.11.2.el6 MPICH mpich 3.1 compiled with + #1 SMP x86_64 GNU/Linux gcc 4.8.2 and gfortran 4.8.2 + (platypus) g95 (GCC 4.0.3 (g95 0.94!) + + FreeBSD 8.2-STABLE i386 gcc 4.5.4 [FreeBSD] 20110526 + (loyalty) gcc 4.6.1 20110527 + g++ 4.6.1 20110527 + gfortran 4.6.1 20110527 + + FreeBSD 8.2-STABLE amd64 gcc 4.5.4 [FreeBSD] 20110526 + (freedom) gcc 4.6.1 20110527 + g++ 4.6.1 20110527 + gfortran 4.6.1 20110527 + + Debian7.1.0 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux + gcc (Debian 4.7.2-5) 4.7.2 + GNU Fortran (Debian 4.7.2-5) 4.7.2 + (cmake and autotools) + + Fedora20 3.11.10-301.fc20.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7) + GNU Fortran (GCC) 4.8.2 20130603 (Red Hat 4.8.2-7) + (cmake and autotools) + + SUSE 13.1 3.11.6-4-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.8.1 + GNU Fortran (SUSE Linux) 4.8.1 + (cmake and autotools) + + Ubuntu 13.10 3.11.0-13-generic #20-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.8.1-10ubuntu8) 4.8.1 + GNU Fortran (Ubuntu/Linaro 4.8.1-10ubuntu8) 4.8.1 + (cmake and autotools) + + Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 + hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgCC 12.5-0 64-bit target on x86-64 Linux -tp shanghai + + +Known Problems +============== +* When reading or writing a dataset (H5Dread/H5Dwrite) with a large selection + size (e.g., 2GB ~= 500 million of 4 bytes integers or floating point + numbers), some I/O systems may not be able to process it correctly. + We advise users to find out system limits before using large selections. If + I/O size limits exist, application should use HDF5 partial I/O capabilities + (e.g., H5Sselect_hyperslab(...)) to divide large requests into smaller sizes. + In this case we also advise users not to use chunk storage sizes larger that + 2GB since the HDF5 library performs I/O on the entire chunk. We will work + on the HDF5 library to divide large data requests to smaller I/O requests. + (AKC 2014/05/02 HDFFV-8479) + +* Due to an Intel compiler bug introduced in version 14.0.1, the HDF5 FORTRAN + wrappers do not work with configure option --enable-fortran2003. + However, the option --enable-fortran works with Intel 14.0.1. The compiler + bug was fixed in Intel version 14.0.2 and resolved the issue. + (MSB - 2014/4/15) + +* Due to a PGI compiler bug introduced in versions before 13.3 and versions + after 14.2, the FORTRAN test 'Testing get file image' will fail. + (MSB - 2014/4/15) + +* On CYGWIN, when building the library dynamically, testing will fail on + dynamically loaded filters. The test process will build dynamic filter + libraries with the *.dll.a extension, and the HDF5 Library will be looking + for *.so libraries. Entered as issue HDFFV-8736. (ADB - 2014/04/14) + +* A Gnu Make directive (.NOTPARALLEL) is added to fortran/test/Makefile. + AIX native make does not support this directive and would fail if + parallel make (e.g. make -j4) is used to build the library. AIX users + either do not use parallel make or install Gnu Make to build the library. + (AKC 2014/04/08 HDFFV-8738) + +* CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + catches some undefined behavior in the alignment algorithm of the macro + DETECT_I in H5detect.c. Since the algorithm is trying to detect the alignment + of integers, ideally the flag -fcatch-undefined-behavior should not to be + used for H5detect.c. In the future, we can separate flags for H5detect.c + from the rest of the library. (SLU - 2013/10/16 HDFFV-8147) + +* Make provided by Solaris fails in "make check". Solaris users should use + gmake to build and install the HDF5 software. (AKC - 2013/10/08 - HDFFV-8534) + +* On OpenVMS, two soft conversion functions (H5T__conv_i_f and H5T__conv_f_i) + have bugs. They convert data between floating-point numbers and integers. + But the library's default is hard conversion. The user should avoid + explicitly enabling soft conversion between floating-point numbers and + integers. (Issue VMS-8; SLU - 2013/09/19) + +* On OpenVMS, ZLIB 1.2.8 library doesn't work properly. ZLIB 1.2.5 works + fine. So please use ZLIB 1.2.5 to build HDF5 library. (Issue VMS-5; + SLU 2013/09/19) + +* When building using the Cray compilers on Cray machines, HDF5 + configure mistakenly thinks the compiler is an intel compiler and + sets the -std=c99 flag which breaks configure on Cray. To build HDF5 + properly on a Cray machine, please consult with the instructions in + INSTALL_parallel for building on Hopper. + (MSC - 2013/04/26 - HDFFV-8429) + +* The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It + complains with this message: + "/home/hdf5/src/H5Vprivate.h", line 130: Error: __func__ is not defined. + + The reason is that __func__ is a predefined identifier in C99 standard. The + HDF5 C library uses it in H5private.h. The test ttypes.cpp includes + H5private.h (H5Tpkg.h<-H5Fprivate.h<-H5Vprivate.h<-H5private.h). Sun's 5.9 + C++ compiler doesn't support __func__, thus fails to compile the C++ test. + But Sun's 5.11 C++ compiler does. To check whether your Sun C++ compiler + knows this identifier, try to compile the following simple C++ program: + #include + + int main(void) + { + printf("%s\n", __func__); + return 0; + } + (SLU - 2012/11/5) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD with the + native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the + ports (and probably gcc releases after that). + (QAK - 2012/10/19) + +* The following h5dump test case fails in BG/P machines (and potentially other + machines that use a command script to launch executables): + + h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" + tno-subset.h5 + + This is due to the embedded spaces in the dataset name being interpreted + by the command script launcher as meta-characters, thus passing three + arguments to h5dump's -d flag. The command passes if run by hand, just + not via the test script. + (AKC - 2012/05/03) + +* On hopper, the build failed when RUNSERIAL and RUNPARALLEL are set + to aprun -np X, because the H5lib_settings.c file was not generated + properly. Not setting those environment variables works, because + configure was able to automatically detect that it's a Cray system + and used the proper launch commands when necessary. + (MSC - 2012/04/18) + +* The data conversion test dt_arith.c fails in "long double" to integer + conversion on Ubuntu 11.10 (3.0.0.13 kernel) with GCC 4.6.1 if the library + is built with optimization -O3 or -O2. The older GCC (4.5) or newer kernal + (3.2.2 on Fedora) doesn't have the problem. Users should lower the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of + "configure" like: + + CFLAGS=-O1 ./configure + + This will overwrite the library's default optimization level. + (SLU - 2012/02/07 - HDFFV-7829) + This issue is no longer present on Ubuntu 12.10 (3.5.0 kernel) with + gcc 4.7.2. + +* The STDIO VFD does not work on some architectures, possibly due to 32/64 + bit or large file issues. The basic STDIO VFD test is known to fail on + 64-bit SunOS 5.10 on SPARC when built with -m64 and 32-bit OS X/Darwin + 10.7.0. The STDIO VFD test has been disabled while we investigate and + a fix should appear in a future release. + (DER - 2011/10/14 - HDFFV-8235) + +* h5diff can report inconsistent results when comparing datasets of enum type + that contain invalid values. This is due to how enum types are handled in + the library and will be addressed in a future release. + (DER - 2011/10/14 - HDFFV-7527) + +* The links test can fail under the stdio VFD due to some issues with external + links. This will be investigated and fixed in a future release. + (DER - 2011/10/14 - HDFFV-7768) + +* After the shared library support was fixed for some bugs, it was discovered + that "make prefix=XXX install" no longer works for shared libraries. It + still works correctly for static libraries. Therefore, if you want to + install the HDF5 shared libraries in a location such as /usr/local/hdf5, + you need to specify the location via the --prefix option during configure + time. E.g, ./configure --prefix=/usr/local/hdf5 ... + (AKC - 2011/05/07 - HDFFV-7583) + +* The parallel test, t_shapesame, in testpar/, may run for a long time and may + be terminated by the alarm signal. If that happens, one can increase the + alarm seconds (default is 1200 seconds = 20 minutes) by setting the + environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If + it does, it will waste more time if $HDF5_ALARM_SECONDS is set + to a larger value. + (AKC - 2011/05/07) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD. + (QAK - 2011/04/26) + +* Shared Fortran libraries are not quite working on AIX. While they are + generated when --enable-shared is specified, the fortran and hl/fortran + tests fail. We are looking into the issue. HL and C++ shared libraries + should now be working as intended, however. + (MAM - 2011/04/20) + +* The --with-mpe configure option does not work with Mpich2. + (AKC - 2011/03/10) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or file systems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + (NAF - 2011/01/19) + +* All the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added in. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as + it is (see bug report #1279). Quincey will make a plan for 1.10. + (SLU - 2010/02/02) + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + (MAM - 2009/11/04) + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. + (CMC - 2009/04/28) + +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + (SLU - 2005/06/30) + + +%%%%1.8.12%%%% + + +HDF5 version 1.8.12 released on 2013-11-04 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.11 and +HDF5-1.8.12, and contains information on the platforms tested and +known problems in HDF5-1.8.12. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.12 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.12 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.12 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.12 (current +release) versus Release 1.8.11": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.11 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Configuration + ------------- + - Added a configuration option to change the default plugin path. + The configure option is --with-default-plugindir=location. + The cmake option is -DH5_DEFAULT_PLUGINDIR:PATH=location. + HDFFV-8513. (ADB 2013/09/04) + - Renamed FFLAGS to FCFLAGS in configure. (ADB 2013/08/13) + - CMake can now package a compressed examples file, the default for + Windows binaries from HDF Group. (ADB - 2013/07/22) + + Library + ------- + - None + + Parallel Library + ---------------- + - None + + Tools + ----- + - h5repack: Added the ability to use plugin filters to read and write + files. The option uses the filter number. HDFFV-8345 + (ADB - 2013/09/04). + - h5dump: Added the option -N --any_path, which searches the file for + paths that match the search path. HDFFV-7989 (ADB - 2013/08/12). + - h5dump: Added the optional arg 0 to -A, which excludes attributes + from display. HDFFV-8134 (ADB - 2013/08/01). + + High-Level APIs + --------------- + - None + + Fortran API + ----------- + - None + + C++ API + ------- + - Added tutorial examples to C++/examples. They can be installed by + "make install-examples" and, in the installed directory, they can be + executed by running the script file run-c++-ex.sh. (BMR - 2013/09/28) + - A new class, H5::H5Location, is added to represent the location concept + in the C library. It is a base class to H5::H5File and H5::H5Ojbect, + whose member functions are moved into H5::H5Location. H5::H5File can + now inherent those functions. As a result, an H5::H5File object can have + an attribute. (BMR - 2013/09/27) + - Added wrappers for H5Rget_obj_type2 to retrieve the type of the object + that an object reference points to. (BMR - 2013/09/27) + H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_type) + - Added wrappers for H5Aexist to check whether an attribute exists given + a name. (BMR - 2013/09/27) + bool H5::H5Location::attrExists(const char* name) + bool H5::H5Location::attrExists(const H5std_string& name) + - Added a number of overloaded functions for convenience. (BMR - 2013/09/27) + + +Support for New Platforms, Languages, and Compilers +=================================================== + - None + +Bug Fixes since HDF5-1.8.11 +=========================== + + Configuration + ------------- + - Modified H5detect.c to scan floating point types for padding bits before + analyzing the type further. This should fix problems with gcc 4.8. + (NAF - 2013/09/19 - HDFFV-8523/HDFFV-8500) + - HDF5 rpaths are no longer encoded in the library files when configured + with --disable-sharedlib-rpath. (LRK-2013-09-23 - HDFFV-8276) + + Library + ------- + - Added const qualifier to source buffer parameters in H5Dgather and + H5D_scatter_func_t (H5Dscatter callback). (NAF - 2013/7/09) + + - CMake now creates *.so.{lt_version} files with the same version as + configure. (ADB - 2013/06/05 HDFFV-8437) + + Parallel Library + ---------------- + - None + + Performance + ------------- + - None + + Tools + ----- + - h5dump: Added the option -N --any_path, which searches the file for + paths that match the search path. HDFFV-7989 (ADB - 2013/08/12). + - h5dump: Added the optional arg 0 to -A, which excludes attributes + from display. HDFFV-8134 (ADB - 2013/08/01). + - h5dump correctly exports subsetted data to a file, using the --output + option. (ADB - 2013/06/07 HDFFV-8447) + - h5cc and other compile scripts now default to linking shared libraries + when HDF5 is configured with the --disable-static option. + (LRK - 2013-09-23 - HDFFV-8141) + + F90 API + ------- + - None + + C++ API + ------ + - None + + High-Level APIs: + ------ + - None + + Fortran High-Level APIs: + ------ + - None + + Testing + ------- + - test/big sometimes failed with the message of "file selection+offset not + within extent". This has been fixed. (AKC - 2013/09/28 HDFFV-8271). + - tools/h5diff/testh5diff.sh is run in every "make check", even after it + has passed in the previous run. It should not run again if there are no + code changes. Fixed. (AKC - 2013/07/19 HDFFV-8392) + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + AIX 5.3 xlc 10.1.0.5 + (NASA G-ADA) xlC 10.1.0.5 + xlf90 12.1.0.6 + + Linux 2.6.18-308.13.1.el5PAE GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP i686 i686 i386 compilers for 32-bit applications; + (jam) Version 4.1.2 20080704 (Red Hat 4.1.2-54) + Version 4.8.1 + PGI C, Fortran, C++ Compilers for 32-bit + applications; + Version 13.7-0 + Intel(R) C, C++, Fortran Compiler for 32-bit + applications; + Version 13.1.3 (Build 20130607) + + Linux 2.6.18-308.16.1.el5 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; + (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-54) + Version 4.8.1 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 13.7-0 + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; + Version 13.1.3 (Build 20130607) + + Linux 2.6.32-358.18.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus) Version 4.4.7 20120313 + Version 4.8.1 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 13.7-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 13.1.3 (Build 20130607) + + Linux 2.6.32-358.18.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + IBM XL C/C++ V11.1 + IBM XL Fortran V13.1 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2008 w/ Intel Fortran 11 (cmake) + Visual Studio 2010 w/ Intel Fortran 12 (cmake) + Visual Studio 2012 w/ Intel Fortran 13 (cmake) + Cygwin(CYGWIN_NT-6.1 1.7.15(0.260/5/3) gcc(4.5.3) compiler and gfortran) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 11 (cmake) + Visual Studio 2010 w/ Intel Fortran 12 (cmake) + Visual Studio 2012 w/ Intel Fortran 13 (cmake) + + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 13 (cmake) + + Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 13 (cmake) + + Mac OS X Snow Leopard 10.6.8 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 3.2.6 + Darwin Kernel Version 10.8.0 g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 3.2.6 + 64-bit gfortran GNU Fortran (GCC) 4.6.2 + (fred) Intel C (icc), Fortran (ifort), C++ (icpc) + 12.1 Build 20120928 + + Mac OS X Lion 10.7.3 Apple clang/clang++ version 3.0 from Xcode 4.6.1 + 64-bit gfortran GNU Fortran (GCC) 4.6.2 + (duck) Intel icc/icpc/ifort version 13.0.3 + + Mac OS X Mountain Lion 10.8.1 Apple clang/clang++ version 4.2 from Xcode 4.6.1 + 64-bit gfortran GNU Fortran (GCC) 4.6.2 + (wren) Intel icc/icpc/ifort version 13.0.3 + + OpenVMS IA64 V8.4 HP C V7.3-018 + HP Fortran V8.2-104939-50H96 + HP C++ V7.4-004 + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +Solaris2.11 32-bit n y/y n y y y +Solaris2.11 64-bit n y/y n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/n n y y y +Windows 8.1 n y/y n y y y +Windows 8.1 x64 n y/y n y y y +Mac OS X Snow Leopard 10.6.8 64-bit n y/y n y y y +Mac OS X Lion 10.7.3 64-bit n y/y n y y y +Mac OS X Mountain Lion 10.8.1 64-bit n y/y n y y y +AIX 5.3 32- and 64-bit n y/n n y y y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y/y y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel n y/y n y y y +CentOS 5.9 Linux 2.6.18-308 i686 PGI n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y/y y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 PGI n y/y n y y y +CentOS 6.4 Linux 2.6.32 x86_64 GNU n y/y n y y y +CentOS 6.4 Linux 2.6.32 x86_64 Intel n y/y n y y y +Linux 2.6.32-358.2.1.el6.ppc64 n y/n n y y y +OpenVMS IA64 V8.4 n y/n n y y n + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 8.1 y y y y +Windows 8.1 x64 y y y y +Mac OS X Snow Leopard 10.6.8 64-bit y n y n +Mac OS X Lion 10.7.3 64-bit y n y y +Mac OS X Mountain Lion 10.8.1 64-bit y n y y +AIX 5.3 32- and 64-bit y n n y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n +CentOS 5.9 Linux 2.6.18 x86_64 PGI y y y n +CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n +CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n +Linux 2.6.32-358.2.1.el6.ppc64 y y y n +OpenVMS IA64 V8.4 n n n n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.18-308.13.1.el5PAE MPICH mpich2-1.4.1p1 compiled with + #1 SMP i686 i686 i386 gcc 4.1.2 and gfortran 4.1.2 + (jam) g95 (GCC 4.0.3 (g95 0.94!) + + Linux 2.6.18-308.16.1.el5 MPICH mpich2-1.4.1p1 compiled with + #1 SMP x86_64 GNU/Linux gcc 4.1.2 and gfortran 4.1.2 + (koala) g95 (GCC 4.0.3 (g95 0.94!) + + FreeBSD 8.2-STABLE i386 gcc 4.5.4 [FreeBSD] 20110526 + (loyalty) gcc 4.6.1 20110527 + g++ 4.6.1 20110527 + gfortran 4.6.1 20110527 + + FreeBSD 8.2-STABLE amd64 gcc 4.5.4 [FreeBSD] 20110526 + (freedom) gcc 4.6.1 20110527 + g++ 4.6.1 20110527 + gfortran 4.6.1 20110527 + + Debian7.1.0 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux + gcc (Debian 4.7.2-5) 4.7.2 + GNU Fortran (Debian 4.7.2-5) 4.7.2 + (cmake and autotools) + + Fedora19 3.11.1-200.fc19.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1) + GNU Fortran (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1) + (cmake and autotools) + + SUSE 12.3 3.7.10-1.16-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.7.2 + GNU Fortran (SUSE Linux) 4.7.2 + (cmake and autotools) + + Ubuntu 13.04 3.8.0-30-generic #44-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 + GNU Fortran (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 + (cmake and autotools) + + Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 + hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgCC 12.5-0 64-bit target on x86-64 Linux -tp shanghai + + +Known Problems +============== +* Several HDF5 command-line tools and tests leave behind generated files + that are not cleaned up with "make clean" or "make distclean" when software + is built in place. The issue will be addressed in the 1.8.13 release. We + recommend to use build directory to compile and test HDF5 as described + in the INSTALL file, section 4.2. + +* Source directory names with spaces in them will cause failures in configure + or make on Mac (HDFFV-8152), Linux, and probably all other platforms. If a + configure command with a space is run from a build directory, it will exit + with an error message: "checking whether build environment is sane... + configure: error: unsafe srcdir value: '/scr/lrknox/hdf5 v1.8.12'". If + configure is run inside or below the directory with the space in the name, + libtool will get the directory path from the system, put the part of the + path before the space in the libdir variable in .../src/libhdf5.la, and + then fail to find the nonexistent directory. This is a known libtool issue + and the suggested workaround is to rename the directory without spaces. + (LRK - 2013/10/22) + +* CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + catches some undefined behavior in the alignment algorithm of the macro + DETECT_I in H5detect.c (HDFFV-8147). This issue will be addressed in the + next release. (SLU - 2013/10/16) + +* Running make check for the tools can fail in the tools tests if make was not + run prior. The tests for the tools use other tools in the tests, therefore + all the tools should be built before testing the tools. (ADB - 2013/10/09) + +* Make provided by Solaris fails in "make check". Solaris users should use + gmake to build and install HDF5 software. (AKC - 2013/10/08 - HDFFV-8534) + +* On OpenVMS, two soft conversion functions (H5T__conv_i_f and H5T__conv_f_i) + have bugs. They convert data between floating-point numbers and integers. + But the library's default is hard conversion. The user should avoid + explicitly enabling soft conversion between floating-point numbers and + integers. (Issue VMS-8; SLU - 2013/09/19) + +* On OpenVMS, ZLIB 1.2.8 library doesn't work properly. ZLIB 1.2.5 works + fine. So please use ZLIB 1.2.5 to build HDF5 library. (Issue VMS-5; + SLU 2013/09/19) + +* When building using the Cray compilers on Cray machines, HDF5 + configure mistakenly thinks the compiler is an intel compiler and + sets the -std=c99 flag which breaks configure on Cray. To build HDF5 + properly on a Cray machine, please consult with the instructions in + INSTALL_parallel for building on Hopper. + (MSC - 2013/04/26 - HDFFV-8429) + +* The h5dump and h5diff utilities occasionally produce different output + between Linux and Windows systems. This is caused by lower-level library + routines that fail to write fill values to the user's buffer when reading + unallocated chunks from datasets that have a fill value set to + H5D_FILL_VALUE_DEFAULT. Due to platform differences the return of + spurious data values has only been encountered on Windows 32-bit systems. + (Issue HDFFV-8247; JP - 2013/03/27) + +* The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It + complains with this message: + "/home/hdf5/src/H5Vprivate.h", line 130: Error: __func__ is not defined. + + The reason is that __func__ is a predefined identifier in C99 standard. The + HDF5 C library uses it in H5private.h. The test ttypes.cpp includes + H5private.h (H5Tpkg.h<-H5Fprivate.h<-H5Vprivate.h<-H5private.h). Sun's 5.9 + C++ compiler doesn't support __func__, thus fails to compile the C++ test. + But Sun's 5.11 C++ compiler does. To check whether your Sun C++ compiler + knows this identifier, try to compile the following simple C++ program: + #include + + int main(void) + { + printf("%s\n", __func__); + return 0; + } + (SLU - 2012/11/5) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD with the + native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the + ports (and probably gcc releases after that). + (QAK - 2012/10/19) + +* The following h5dump test case fails in BG/P machines (and potentially other + machines that use a command script to launch executables): + + h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" + tno-subset.h5 + + This is due to the embedded spaces in the dataset name being interpreted + by the command script launcher as meta-characters, thus passing three + arguments to h5dump's -d flag. The command passes if run by hand, just + not via the test script. + (AKC - 2012/05/03) + +* On hopper, the build failed when RUNSERIAL and RUNPARALLEL are set + to aprun -np X, because the H5lib_settings.c file was not generated + properly. Not setting those environment variables works, because + configure was able to automatically detect that it is a Cray system + and used the proper launch commands when necessary. + (MSC - 2012/04/18) + +* The data conversion test dt_arith.c fails in "long double" to integer + conversion on Ubuntu 11.10 (3.0.0.13 kernel) with GCC 4.6.1 if the library + is built with optimization -O3 or -O2. The older GCC (4.5) or newer kernel + (3.2.2 on Fedora) do not have the problem. Users should lower the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of + "configure" like: + + CFLAGS=-O1 ./configure + + This will overwrite the library's default optimization level. + (SLU - 2012/02/07 - HDFFV-7829) + This issue is no longer present on Ubuntu 12.10 (3.5.0 kernel) with + gcc 4.7.2. + +* The STDIO VFD does not work on some architectures, possibly due to 32/64 + bit or large file issues. The basic STDIO VFD test is known to fail on + 64-bit SunOS 5.10 on SPARC when built with -m64 and 32-bit OS X/Darwin + 10.7.0. The STDIO VFD test has been disabled while we investigate and + a fix should appear in a future release. + (DER - 2011/10/14 - HDFFV-8235) + +* h5diff can report inconsistent results when comparing datasets of enum type + that contain invalid values. This is due to how enum types are handled in + the library and will be addressed in a future release. + (DER - 2011/10/14 - HDFFV-7527) + +* The links test can fail under the stdio VFD due to some issues with external + links. This will be investigated and fixed in a future release. + (DER - 2011/10/14 - HDFFV-7768) + +* After the shared library support was fixed for some bugs, it was discovered + that "make prefix=XXX install" no longer works for shared libraries. It + still works correctly for static libraries. Therefore, if you want to + install the HDF5 shared libraries in a location such as /usr/local/hdf5, + you need to specify the location via the --prefix option during configure + time. E.g, ./configure --prefix=/usr/local/hdf5 ... + (AKC - 2011/05/07 - HDFFV-7583) + +* The parallel test, t_shapesame, in testpar/, may run for a long time and may + be terminated by the alarm signal. If that happens, one can increase the + alarm seconds (default is 1200 seconds = 20 minutes) by setting the + environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If + it does, it will waste more time if $HDF5_ALARM_SECONDS is set + to a larger value. + (AKC - 2011/05/07) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD. + (QAK - 2011/04/26) + +* Shared Fortran libraries are not quite working on AIX. While they are + generated when --enable-shared is specified, the fortran and hl/fortran + tests fail. We are looking into the issue. HL and C++ shared libraries + should now be working as intended, however. + (MAM - 2011/04/20) + +* The --with-mpe configure option does not work with Mpich2. + (AKC - 2011/03/10) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or file systems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + (NAF - 2011/01/19) + +* All the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added in. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as + it is (see bug report #1279). Quincey will make a plan for 1.10. + (SLU - 2010/02/02) + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + (MAM - 2009/11/04) + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. + (CMC - 2009/04/28) + +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + (SLU - 2005/06/30) + + +%%%%1.8.11%%%% + + +HDF5 version 1.8.11 released on 2013-05-08 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.10 and +HDF5-1.8.11-*, and contains information on the platforms tested and +known problems in HDF5-1.8.11-*. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.11 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.11 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.11 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.11 (current +release) versus Release 1.8.10": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.10 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Configuration + ------------- + - Libtool version number is changed to 8.0.0 because there are API + changes. See below for details. (AKC - 2013/05/07 HDFFV-8435) + - Mac OS X 10.7 (Lion) and 10.8 (Mountain Lion) uses clang/clang++ as the + default C and C++ compilers. (AKC - 2013/04/19 HDFFV-8245) + - CMake minimum is now 2.8.10. (ADB 2013/1/14) + - A new tool, cmakehdf5, which is a build command script similar to + buildhdf5 is added and is available in the bin directory. + (AKC - 2013/01/16 HDFFV-8336) + + Library + ------- + - The library can load filter libraries dynamically during runtime. Users + can set the search path through environment variable HDF5_PLUGIN_PATH + and call H5Pset_filter to enable a dynamic filter. (SLU - 2013/04/08) + - Added new API functions H5Dscatter and H5Dgather to scatter data to and + and gather data from a selection within a memory buffer. + (NAF - 2013/02/05) + - The library now supports the data conversion from enumeration to numeric + (integer and floating-point number) datatypes. See Issue HDFFV-8221. + (SLU - 2012/10/23) + + Parallel Library + ---------------- + - None + + Tools + ----- + - h5dump: added new option -O or -ddl to output the ddl text to a file. This + is a complement to the -o or --output option, which redirects the data to + a file. HDFFV-8229 (ADB - 2013/2/25) + + High-Level APIs + --------------- + - A new API function, H5DOwrite_chunk. This function writes a data chunk + directly into a file, bypassing hyperslab selection, data conversion, + and the filter pipeline. The user must be careful with the function and + clearly understand the I/O process of the library. (SLU - 2013/2/11) + + Fortran API + ----------- + - New API functions added (MSB - 2013/3/23): + + h5odecr_refcount_f, h5oexists_by_name_f, h5oget_comment_f, + h5oget_comment_by_name_f, h5oincr_refcount_f, h5oopen_by_idx_f, + h5oset_comment_f, h5oset_comment_by_name_f, h5oset_comment_by_name_f + + F2003: h5oget_info_f, h5oget_info_by_idx_f, h5ovisit_by_name_f + + + C++ API + ------- + - None + + +Support for New Platforms, Languages, and Compilers +=================================================== + - SunOS 5.11 (emu) 32-bit and 64-bit with Sun C/C++ 5.12 compiler and + Sun Fortran 95 8.6 compiler. + - Visual Studio 2012 w/ Intel Fortran 13 on Windows 7 + - g95 released new version recently and is tested in this release. + +Bug Fixes since HDF5-1.8.10 +========================== + + Configuration + ------------- + - Fixed Thread-safe configure failure for the AIX platform. + (AKC - 2013/04/19 HDFFV-8390) + - Configure will check the result of header searches before searching for + the library. + Fixes HDFFV-8257 (ADB 2013/03/04) + - HDF does not support building SHARED Fortran libraries on OSX. Added + CMake code to check for this condition. + Fixes HDFFV-8227 (ADB 2013/03/04) + - CMake builds on Windows will no longer use legacy naming for libraries. + The "dll" tag will no longer be added to the name of *.lib and *.dll. + The option HDF_LEGACY_NAMING is now OFF by default. + Fixes HDFFV-8292 (ADB 2013/01/30) + + Library + ------- + - The library now behaves correctly when performing large I/O operations + on Mac OS-X. Previously, single I/O operations > 2 GB would fail + since the Darwin read/write calls cannot handle the number of bytes + that their parameter types imply. + Fixes HDFFV-7975 and HDFFV-8240 (DER 2013/01/07) + - Fixed a bug in the core VFD that causes failures when opening files + > 2 GB. + Fixes HDFFV-8124 and HDFFV-8158 (DER 2013/01/07) + - Fixed a bug where unintialized memory was read during variable-length + type conversion. This caused segfaults in netCDF. Fixes HDFFV-8159. + (DER 2013/03/30) + - Removed the H5Pset/get_dxpl_multi functions from the library. The + intended functionality for them was never fully implemented, and they + have always been fundamentally broken. NOTE: This does not affect + setting the multi VFD or any expected VFD functionality. Multi VFD + usage remains unchanged. + Fixes HDFFV-8296. (DER 2013/03/30) + + Parallel Library + ---------------- + - None + + Performance + ------------- + - None + + Tools + ----- + - h5redeploy is changed to do this by default: + Installation directories: + prefix architecture-independent files. + exec_prefix architecture-dependent files, default is . + libdir libraries, default is /lib. + includedir header files, default is . + This allows users to just change the first line of prefix=<...> and the + effect will change libdir and includedir too. (AKC 2013/04/05 HDFFV-8358) + - h5repack: Fixed failure to convert the layout of a small chunked + dataset (size < 1K) to contiguous layout. HDFFV-8214 (JKM 2013/03/26) + - h5dump: Fixed displaying compression ratio for unknown or user-defined + filters. HDFFV-8344 (XCAO 2013/03/19) + - h5dump: Changed UNKNOWN_FILTER to USER_DEFINED_FILTER for user defined + filter. HDFFV-8346 (XCAO 2013/03/19) + - h5diff: Fixed to return the correct exit code 1 when the program + detects a unique extra attribute. Prior to this fix, h5diff returned + exit code 0 indicating the two files are identical. + HDFFV-7643 (JKM 2013/02/15) + - h5dump: Fixed writing nulls to a binary file when exporting a dataset + with compound string datatype. HDFFV-8169 (ADB 2013/1/31) + - The following h5stat test case failed in BG/P machines (and potentially + other machines that display extra output if an MPI task returns with a + non-zero code.) + Testing h5stat notexist.h5 + The test script was fixed to ignore the extra output. HDFFV-8233 + (AKC - 2012/11/30) + - h5diff: Improved speed when comparing HDF5 files with lots of + attributes. Much slower performance was identified with release versions + from 1.8.7 to 1.8.10 compared to 1.8.6. (JKM 2012/10/19) + + F90 API + ------- + - The integer type of the 'offset' argument in h5pset_external_f and + h5pget_external_f was changed to INTEGER(KIND=OFF_T) to support 8-byte + integers, matching the C type definition of off_t. (MSB - 2013/3/23) + - h5fc updated to recognize .f95, .f03 and .f08 file extensions. + + C++ API + ------ + - The C++ wrappers DSetMemXferPropList::setMulti/getMulti were removed + because the C functions H5Pset/get_dxpl_multi functions are removed + from the library. Fixes HDFFV-8296 by DER. (BMR 2013/03/30) + - An exception thrown by an internal function was not propagating to the + test program during stack unwinding, so it couldn't be caught by the + test, and the program terminated "without an active exception." It + seemed that the problem happened when c_str() was used to generate + an equivalent const char* from a std::string and the resulting string + was passed to the internal function. As a work-around, we added a + try/catch around the the call to the internal function and when the + exception is caught there, it is re-thrown. Fixes HDFFV-8067. + (BMR 2013/03/30) + + High-Level APIs: + ------ + - Fixed a problem with H5DSget_scale_name including the NULL terminator + in the size calculation returned by the function. The API was changed + to NOT include the NULL terminator in the size of name returned + (MSB- 2013/2/10) + + Fortran High-Level APIs: + ------ + - None + + Testing + ------- + - In some Mac systems, testlibinfo.sh failed with this error: + Check file ../src/.libs/libhdf5.7.dylib + strings: object: ../src/.libs/libhdf5.7.dylib malformed object \ + (unknown load command 15) + The strings command of Mac systems inspects library files, and older + versions of strings may not know newer library formats, resulting + in errors. Fixed by sending the library file as stdin to the strings + command to avoid this problem. (AKC - 2013/03/08 HDFFV-8305) + - Fixed a typo in the ERROR macro in test/testhdf5.h. It segmentation + faulted when used before. (AKC - 2013/02/12 HDFFV-8267) + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + AIX 5.3 xlc 10.1.0.5 + (NASA G-ADA) xlC 10.1.0.5 + xlf90 12.1.0.6 + + Linux 2.6.18-308.13.1.el5PAE GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP i686 i686 i386 compilers for 32-bit applications; + (jam) Version 4.1.2 20080704 (Red Hat 4.1.2-54) + Version 4.6.3 + PGI C, Fortran, C++ Compilers for 32-bit + applications; + Version 11.9-0 + Version 12.5-0 + Intel(R) C, C++, Fortran Compiler for 32-bit + applications; + Version 12.1 (Build 20110811) + Version 12.1 (Build 20120212) + + Linux 2.6.18-308.16.1.el5 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; + (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-52) + Version 4.6.3 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 11.9-0 + Version 12.5-0 + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; + Version 12.1 (Build 20110811) + Version 12.1 (Build 20120212) + + Linux 2.6.32-358.2.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus) Version 4.4.7 20120313 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 12.1 20120212 + + Linux 2.6.32-358.2.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + IBM XL C/C++ V11.1 + IBM XL Fortran V13.1 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2008 w/ Intel Fortran 11 (cmake) + Visual Studio 2010 w/ Intel Fortran 12 (cmake) + Visual Studio 2012 w/ Intel Fortran 13 (cmake) + Cygwin(CYGWIN_NT-6.1 1.7.15(0.260/5/3) gcc(4.5.3) compiler and gfortran) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 11 (cmake) + Visual Studio 2010 w/ Intel Fortran 12 (cmake) + Visual Studio 2012 w/ Intel Fortran 13 (cmake) + Cygwin(CYGWIN_NT-6.1 1.7.15(0.260/5/3) gcc(4.5.3) compiler and gfortran) + (cmake and autotools) + + Mac OS X Snow Leopard 10.6.8 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 3.2.6 + Darwin Kernel Version 10.8.0 g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 3.2.6 + 64-bit gfortran GNU Fortran (GCC) 4.6.2 + (fred) Intel C (icc), Fortran (ifort), C++ (icpc) + 12.1 Build 20120928 + + Mac OS X Lion 10.7.3 Apple clang/clang++ version 3.0 from Xcode 4.6.1 + 64-bit gfortran GNU Fortran (GCC) 4.6.2 + (duck) Intel icc/icpc/ifort version 13.0 + + Mac OS X Mountain Lion 10.8.1 Apple clang/clang++ version 4.2 from Xcode 4.6.1 + 64-bit gfortran GNU Fortran (GCC) 4.6.2 + (wren) Intel icc/icpc/ifort version 13.0.1.119 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +Solaris2.11 32-bit n y/y n y y y +Solaris2.11 64-bit n y/n n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/n n y y y +Windows 7 x64 Cygwin n y/n n y y y +Mac OS X Snow Leopard 10.6.8 64-bit n y/y n y y y +Mac OS X Lion 10.7.3 64-bit n y/y n y y y +Mac OS X Mountain Lion 10.8.1 64-bit n y/y n y y y +AIX 5.3 32- and 64-bit n y/n n y y y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y/y y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel n y/y n y y y +CentOS 5.9 Linux 2.6.18-308 i686 PGI n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y/y y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 PGI n y/y n y y y +CentOS 6.4 Linux 2.6.32 x86_64 GNU n y/n n y y y +CentOS 6.4 Linux 2.6.32 x86_64 Intel n y/y n y y y +Linux 2.6.32-358.2.1.el6.ppc64 n y/n n y y y + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 7 x64 Cygwin n n n y +Mac OS X Snow Leopard 10.6.8 64-bit y n y n +Mac OS X Lion 10.7.3 64-bit y n y y +Mac OS X Mountain Lion 10.8.1 64-bit y n y y +AIX 5.3 32- and 64-bit y n n y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n +CentOS 5.9 Linux 2.6.18 x86_64 PGI y y y n +CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n +CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n +Linux 2.6.32-358.2.1.el6.ppc64 y y y n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.18-308.13.1.el5PAE MPICH mpich2-1.4.1p1 compiled with + #1 SMP i686 i686 i386 gcc 4.1.2 and gfortran 4.1.2 + (jam) g95 (GCC 4.0.3 (g95 0.94!) + + Linux 2.6.18-308.16.1.el5 MPICH mpich2-1.4.1p1 compiled with + #1 SMP x86_64 GNU/Linux gcc 4.1.2 and gfortran 4.1.2 + (koala) g95 (GCC 4.0.3 (g95 0.94!) + + FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719 + (loyalty) gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + FreeBSD 8.2-STABLE amd64 gcc 4.2.1 [FreeBSD] 20070719 + (freedom) gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + Debian6.0.7 2.6.32-5-amd64 #1 SMP x86_64 GNU/Linux + gcc (Debian 4.4.5-8) 4.4.5 + GNU Fortran (Debian 4.4.5-8) 4.4.5 + (cmake and autotools) + + Fedora18 3.7.9-205.fc18.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8) + GNU Fortran (GCC) 4.7.2 20120507 (Red Hat 4.7.2-8) + (cmake and autotools) + + SUSE 12.3 3.7.10-1.1-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.7.2 + GNU Fortran (SUSE Linux) 4.7.2 + (cmake and autotools) + + Ubuntu 12.10 3.5.0-25-generic #39-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 + GNU Fortran (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 + (cmake and autotools) + + Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 + hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgCC 12.5-0 64-bit target on x86-64 Linux -tp shanghai + + +Known Problems +============== + +* When building using the Cray compilers on Cray machines, HDF5 + configure mistakenly thinks the compiler is an intel compiler and + sets the -std=c99 flag which breaks configure on Cray. To build HDF5 + properly on a Cray machine, please consult with the instructions in + INSTALL_parallel for building on Hopper. + (MSC - 2013/04/26 - HDFFV-8429) + +* The h5dump and h5diff utilities occasionally produce different output + between Linux and Windows systems. This is caused by lower-level library + routines that fail to write fill values to the user's buffer when reading + unallocated chunks from datasets that have a fill value set to + H5D_FILL_VALUE_DEFAULT. Due to platform differences the return of + spurious data values has only been encountered on Windows 32-bit systems. + (Issue HDFFV-8247; JP - 2013/03/27) + +* The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It + complains with this message: + "/home/hdf5/src/H5Vprivate.h", line 130: Error: __func__ is not defined. + + The reason is that __func__ is a predefined identifier in C99 standard. The + HDF5 C library uses it in H5private.h. The test ttypes.cpp includes + H5private.h (H5Tpkg.h<-H5Fprivate.h<-H5Vprivate.h<-H5private.h). Sun's 5.9 + C++ compiler doesn't support __func__, thus fails to compile the C++ test. + But Sun's 5.11 C++ compiler does. To check whether your Sun C++ compiler + knows this identifier, try to compile the following simple C++ program: + #include + + int main(void) + { + printf("%s\n", __func__); + return 0; + } + (SLU - 2012/11/5) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD with the + native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the + ports (and probably gcc releases after that). + (QAK - 2012/10/19) + +* The following h5dump test case fails in BG/P machines (and potentially other + machines that use a command script to launch executables): + + h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" + tno-subset.h5 + + This is due to the embedded spaces in the dataset name being interpreted + by the command script launcher as meta-characters, thus passing three + arguments to h5dump's -d flag. The command passes if run by hand, just + not via the test script. + (AKC - 2012/05/03) + +* On hopper, the build failed when RUNSERIAL and RUNPARALLEL are set + to aprun -np X, because the H5lib_settings.c file was not generated + properly. Not setting those environment variables works, because + configure was able to automatically detect that it's a Cray system + and used the proper launch commands when necessary. + (MSC - 2012/04/18) + +* The data conversion test dt_arith.c fails in "long double" to integer + conversion on Ubuntu 11.10 (3.0.0.13 kernel) with GCC 4.6.1 if the library + is built with optimization -O3 or -O2. The older GCC (4.5) or newer kernal + (3.2.2 on Fedora) doesn't have the problem. Users should lower the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of + "configure" like: + + CFLAGS=-O1 ./configure + + This will overwrite the library's default optimization level. + (SLU - 2012/02/07 - HDFFV-7829) + This issue is no longer present on Ubuntu 12.10 (3.5.0 kernel) with + gcc 4.7.2. + +* The STDIO VFD does not work on some architectures, possibly due to 32/64 + bit or large file issues. The basic STDIO VFD test is known to fail on + 64-bit SunOS 5.10 on SPARC when built with -m64 and 32-bit OS X/Darwin + 10.7.0. The STDIO VFD test has been disabled while we investigate and + a fix should appear in a future release. + (DER - 2011/10/14 - HDFFV-8235) + +* h5diff can report inconsistent results when comparing datasets of enum type + that contain invalid values. This is due to how enum types are handled in + the library and will be addressed in a future release. + (DER - 2011/10/14 - HDFFV-7527) + +* The links test can fail under the stdio VFD due to some issues with external + links. This will be investigated and fixed in a future release. + (DER - 2011/10/14 - HDFFV-7768) + +* After the shared library support was fixed for some bugs, it was discovered + that "make prefix=XXX install" no longer works for shared libraries. It + still works correctly for static libraries. Therefore, if you want to + install the HDF5 shared libraries in a location such as /usr/local/hdf5, + you need to specify the location via the --prefix option during configure + time. E.g, ./configure --prefix=/usr/local/hdf5 ... + (AKC - 2011/05/07 - HDFFV-7583) + +* The parallel test, t_shapesame, in testpar/, may run for a long time and may + be terminated by the alarm signal. If that happens, one can increase the + alarm seconds (default is 1200 seconds = 20 minutes) by setting the + environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If + it does, it will waste more time if $HDF5_ALARM_SECONDS is set + to a larger value. + (AKC - 2011/05/07) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD. + (QAK - 2011/04/26) + +* Shared Fortran libraries are not quite working on AIX. While they are + generated when --enable-shared is specified, the fortran and hl/fortran + tests fail. We are looking into the issue. HL and C++ shared libraries + should now be working as intended, however. + (MAM - 2011/04/20) + +* The --with-mpe configure option does not work with Mpich2. + (AKC - 2011/03/10) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or file systems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + (NAF - 2011/01/19) + +* The library's test dt_arith.c showed a compiler's rounding problem on + Cygwin when converting from unsigned long long to long double. The + library's own conversion works fine. We defined a macro for Cygwin to + skip this test until we can solve the problem. + (SLU - 2010/05/05 - HDFFV-1264) + +* All the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added in. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as + it is (see bug report #1279). Quincey will make a plan for 1.10. + (SLU - 2010/02/02) + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + (MAM - 2009/11/04) + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. + (CMC - 2009/04/28) + +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + (SLU - 2005/06/30) + + +%%%%1.8.10-patch1%%%% + + +HDF5 version 1.8.10-patch1 released on 2013-01-22 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.9 and +HDF5 1.8.10, and contains information on the platforms tested and +known problems in HDF5-1.8.10. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.10 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.10 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.10 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.10 (current +release) versus Release 1.8.9": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.10 +- Bug Fixes since HDF5-1.8.9 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Configuration + ------------- + - A new tool, cmakehdf5, which is a build command script similar to + buildhdf5 is added and is available in the bin directory. + (AKC - 2013/01/21) + + Library + ------- + - Updated to latest autotools and changed all hard *.sh scripts to + configure managed *.sh.in files. Removed overloading of autotools + TESTS variable by examples and tests. Renamed configure.in to + configure.ac. (ADB - 2012/08/23 - HDFFV-8129) + - The data sieve buffer size was set for all the datasets in the file. It + could waste memory if any dataset size is smaller than the sieve buffer + size. Now the library picks the smaller one between the dataset size + and the sieve buffer size from the file access property. See Issue 7934. + (SLU - 2012/4/11) + + Parallel Library + ---------------- + - Added the H5Pget_mpio_no_collective_cause() function that retrieves + reasons why the collective I/O was broken during read/write IO access. + (JKM - 2012/08/30 HDFFV-8143) + + - Added H5Pget_mpio_actual_io_mode_f (MSB - 2012/09/27) + + Tools + ----- + - h5import: Changed to allow the use of h5dump output as input files to + h5import. h5dump must include the "-p" option to print the properties; + configuration file is captured output of h5dump. The restrictions are + that only one dataset with a simple datatype (integer, floating-point, + or string) can be processed. Integers and floating-point imports from + h5dump must use the "binary" option for the data file. The string version + uses the h5dump "-y --width=1" options to disable the indexing printouts, + print single columns, and obviously NOT use the "binary" option. + (ADB - 2012/07/19 HDFFV-721) + + High-Level APIs + --------------- + - None + + Fortran API + ----------- + - Fixed a typo in return value of the nh5dread_f_c function (was 1 + instead of 0 on success); fixed the return value to make it consistent + with other Fortran functions; cleaned debug statements from the code. + (EIP - 2012/06/23) + + C++ API + ------- + - None + + +Support for New Platforms, Languages, and Compilers +=================================================== + - None + +Bug Fixes since HDF5-1.8.10 +=========================== + Library + ------- + - The library now behaves correctly when performing large I/O operations on + Mac OS-X. Previously, single I/O operations > 2 GB would fail since the + Darwin read/write calls cannot handle the number of bytes that their + parameter types imply. + Fixes HDFFV-7975 and HDFFV-8240 (DER - 07 JAN 2013) + - Fixed a bug in the core VFD that cause failures when opening files > 2 GB. + Fixes HDFFV-8124 and HDFFV-8158 (DER - 07 JAN 2013) + + Tools + ----- + - The following h5stat test case failed in BG/P machines (and potentially + other machines that display extra output if an MPI task returns with a + non-zero code.) + Testing h5stat notexist.h5 + The test script was fixed to ignore the extra output. + HDFFV-8233 (AKC - 2012/12/17) + - h5diff: Fixed slowness when comparing HDF5 files with many attributes. + Much slower performance was identified with later release version + (from 1.8.7 to 1.8.10) compared to 1.8.6. The issue was introduced + from fixing an attribute related bug for 1.8.7 release in the past. + HDFFV-8145 (JKM 2012/12/13) + + Testing + ------- + - None + +Bug Fixes since HDF5-1.8.9 +========================== + + Configuration + ------------- + - Fixed configure --enable-production to not use -O optimization for Lion + and Mountain Lion systems when gcc (i686-apple-darwin11-llvm-gcc-4.2 + (GCC) 4.2.1) is used. Somehow the -O optimization will cause some of + the hard conversion code in test/dt_arith.c to fail. HDFFV-8017. + (AKC - 2012/10/10) + - Fixed AIX Fortran compiler flags to use appropriate settings for + debugging, profiling, and optimization situations. HDFFV-8069. + (AKC 2012/09/27) + + Library + ------- + - Fixed a memory leak exposed when inserting/removing a property + from a property list several times. HDFFV-8022. (MSC 2012/05/18) + - The file_image test will fail in the "initial file image and callbacks in + the core VFD" sub-test if the source directory is read-only as the test + fails to create its test files in the build directory. This has been + fixed. HDFFV-8009 (AKC - 2012/07/06) + + + Parallel Library + ---------------- + - The MPI-POSIX VFD was updated to include the POSIX and Windows + correctness features added that had already been added to the other VFDs. + HDFFV-8058/7845. (DER 2012/09/17) + + Performance + ------------- + - Removed program perform/benchpar from the enable-build-all list. The + program will be retired or moved to another location. HDFFV-8156 + (AKC 2012/10/01) + - Retired program perform/mpi-perf. Its purpose has been incorporated + into h5perf. (AKC 2012/09/21) + + Tools + ----- + - h5repack: "h5repack -f NONE file1.h5 out.h5" command failed if + source file contains chunked dataset and a chunk dim is bigger than + the dataset dim. Another issue is that the command changed max dims + if chunk dim is smaller than the dataset dim. These issue occurred + when dataset size is smaller than 64k (compact size limit) Fixed both. + HDFFV-8012 (JKM 2012/09/24) + - h5diff: Fixed the counter in verbose mode (-v, -r) so that it will no + longer add together the differences between datasets and the differences + between attributes of those datasets. This change makes the output of + verbose mode consistent for datasets, groups, and committed datatypes. + HDFFV-5919 (JKM 2012/09/10) + - h5diff: Fixed the incorrect result when comparing attribute data + values and the data type has the same class but different sizes. + HDFFV-7942 (JKM 2012/08/15) + - h5dump: Replaced single element fwrite with block writes. + HDFFV-1208 (ADB 2012/08/13) + - h5diff: Fixed test failure for "make check" due to failure of + copying test files when performed in HDF5 source tree. Also applied + to other tools. HDFFV-8107 (JKM 2012/08/01) + - ph5diff: Fixed intermittent hang issue on a certain operation in + parallel mode. It was detected by daily test for comparing + non-comparable objects, but it could have occurred in other + operations depending on machine condition. HDFFV-8003 (JKM 2012/08/01) + - h5diff: Fixed the function COPY_TESTFILES_TO_TESTDIR() of testh5diff.sh + to better report when there is an error in the file copying. + HDFFV-8105 (AKC 2012/07/22) + - h5dump: Fixed the sort by name display to maintain correct parent/child + relationships between ascending/descending order. + HDFFV-8095 (ADB 2012/07/12) + - h5dump: Fixed the display by creation order when using option -n + (print contents). + HDFFV-5942 (ADB 2012/07/09) + - h5dump: Changed to allow H5T_CSET_UTF8 to be displayed in h5dump output. + Used technique similar to what was done in h5ls (matches library + options). + HDFFV-7999 (ADB 2012/05/23) + - h5diff: Fixed the tool so that it will not check and display the status + of dangling links without setting the --follow-symlinks option. This + also improved performance when comparing lots of external links without + the --follow-symlinks option. + HDFFV-7998 (JKM 2012/04/26) + + F90 API + ------- + + - Fixed a typo in return value of the nh5dread_f_c function (was 1 + instead of 0 on success); fixed the return value to make it consistent + with other Fortran functions; cleaned debug statements from the code. + (EIP - 2012/06/23) + + - Fixed a problem writing/reading control characters to a dataset; writing + a string containing alerts, backspace, carriage_return, form_feed, + horizontal_tab, vertical_tab, or new_line is now tested and working. + (MSB - 2012/09/01) + + - Corrected the integer type of H5S_UNLIMITED_F to HSIZE_T (MSB - 2012/09/01) + + - Corrected the number of continuation lines in the src files + to be less than 32 lines for F95 compliance. (MSB - 2012/10/01) + + C++ API + ------ + - None + + High-Level APIs: + ------ + + - Fixed problem with H5TBdelete_record destroying all data following the + deletion of a row. (MSB- 2012/7/26) + + - Fixed H5LTget_attribute_string not closing an object identifier when an + error occurs. (MSB- 2012/7/21) + + - Corrected the return type of H5TBAget_fill from herr_t to htri_t to + reflect that a return value of 1 indicates that a fill value is + present, 0 indicates a fill value is not present, and <0 indicates an + error. + + Fortran High-Level APIs: + ------ + - None + +Supported Platforms +=================== + AIX 5.3 xlc 10.1.0.5 + (NASA G-ADA) xlC 10.1.0.5 + xlf90 12.1.0.6 + + Linux 2.6.18-308.13.1.el5PAE GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP i686 i686 i386 compilers for 32-bit applications; + (jam) Version 4.1.2 20080704 (Red Hat 4.1.2-52) + Version 4.6.3 + PGI C, Fortran, C++ Compilers for 32-bit + applications; + Version 11.9-0 + Intel(R) C, C++, Fortran Compiler for 32-bit + applications; + Version 12.1 + MPICH mpich2-1.4.1p1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + Linux 2.6.18-308.16.1.el5 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers for 32-bit applications; + (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-52) + Version 4.6.3 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 11.9-0 + Version 12.5-0 + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; + Version 12.1 (Build 20110811) + Version 12.1 (Build 20120212) + MPICH mpich2-1.4.1p1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + Linux 2.6.32-220.7.1.el6.ppc64 gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.6 20110731 + (ostrich) GNU Fortran (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) + + Linux 2.6.32-220.23.1.1chaos Intel C, C++, Fortran Compilers + ch5.x86_64 GNU/Linux Version 12.1.5.339 + (LLNL Aztec) + + IBM Blue Gene/P XL C for Blue Gene/P, bgxlc V9.0 + (LLNL uDawn) XL C++ for Blue Gene/P, bgxlC V9.0 + XL Fortran for Blue Gene/P, bgxlf90 V11.1 + + SunOS 5.10 32- and 64-bit Sun C 5.9 Sun OS_sparc Patch 124867-16 + (linew) Sun Fortran 95 8.3 Sun OS_sparc Patch 127000-13 + Sun C++ 5.9 Sun OS_sparc Patch 124863-26 + Sun C 5.11 SunOS_sparc + Sun Fortran 95 8.5 SunOS_sparc + Sun C++ 5.11 SunOS_sparc + + Windows XP Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + + Windows XP x64 Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + + Windows 7 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 w/ Intel Fortran 12 (cmake) + Cygwin(CYGWIN_NT-6.1 1.7.15(0.260/5/3) gcc(4.5.3) compiler and gfortran) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 w/ Intel Fortran 12 (cmake) + Cygwin(CYGWIN_NT-6.1 1.7.15(0.260/5/3) gcc(4.5.3) compiler and gfortran) + (cmake and autotools) + + Mac OS X Snow Leopard 10.6.8 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 3.2.6 + Darwin Kernel Version 10.8.0 g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 3.2.6 + (fred) gfortran GNU Fortran (GCC) 4.6.2 + Intel C (icc), Fortran (ifort), C++ (icpc) + 12.1.0.038 Build 20110811 + + Mac OS X Snow Leopard 10.6.8 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 3.2.6 + Darwin Kernel Version 10.8.0 g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 3.2.6 + Intel 32-bit gfortran GNU Fortran (GCC) 4.6.1 + (tejeda) Intel C (icc), Fortran (ifort), C++ (icpc) + 12.1.0.038 Build 20110811 + + Mac OS X Lion 10.7.3 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.2.1 + 32- and 64-bit g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.2.1 + (duck) gfortran GNU Fortran (GCC) 4.6.2 + + Mac OS X Mountain Lion 10.8.1 cc Apple clang version 4.0 from Xcode 4.5.1 + (owl) c++ Apple clang version 4.0 from Xcode 4.5.1 + gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + gfortran GNU Fortran (GCC) 4.6.2 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +Solaris2.10 32-bit n y/y n y y y +Solaris2.10 64-bit n y/n n y y y +Windows 7 y y/n n y y y +Windows 7 x64 y y/n n y y y +Mac OS X Snow Leopard 10.6.8 32-bit n y/y n y y n +Mac OS X Snow Leopard 10.6.8 64-bit n y/y n y y y +Mac OS X Lion 10.7.3 32-bit n y/y n y y n +Mac OS X Lion 10.7.3 64-bit n y/y n y y y +Mac OS X Mountain Lion 10.8.1 64-bit n y/n n y y n +AIX 5.3 32- and 64-bit y y/n y y y y +CentOS 5.5 Linux 2.6.18-308 i686 GNU y y/y y y y y +CentOS 5.5 Linux 2.6.18-308 i686 Intel n y/y n y y y +CentOS 5.5 Linux 2.6.18-308 i686 PGI n y/y n y y y +CentOS 5.5 Linux 2.6.18 x86_64 GNU y y/y y y y y +CentOS 5.5 Linux 2.6.18 x86_64 Intel n y/y n y y y +CentOS 5.5 Linux 2.6.18 x86_64 PGI n y/y n y y y +Linux 2.6.32-220.7.1.el6.ppc64 n y/n n y y y + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit n n n n +Windows 7 y y y y +Windows 7 x64 y y y y +Mac OS X Snow Leopard 10.6.8 32-bit y n y n +Mac OS X Snow Leopard 10.6.8 64-bit y n y n +Mac OS X Lion 10.7.3 32-bit y n y y +Mac OS X Lion 10.7.3 64-bit y n y y +Mac OS X Mountain Lion 10.8.1 64-bit y n y y +AIX 5.3 32- and 64-bit n n n y +CentOS 5.5 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.5 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.5 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.5 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.5 Linux 2.6.18 x86_64 Intel y y y n +CentOS 5.5 Linux 2.6.18 x86_64 PGI y y y n +Linux 2.6.32-220.7.1.el6.ppc64 y y y n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719 + (loyalty) gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + FreeBSD 8.2-STABLE amd64 gcc 4.2.1 [FreeBSD] 20070719 + (freedom) gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + Debian6.0.3 2.6.32-5-686 #1 SMP i686 GNU/Linux + gcc (Debian 4.4.5-8) 4.4.5 + GNU Fortran (Debian 4.4.5-8) 4.4.5 + (cmake and autotools) + + Debian6.0.3 2.6.32-5-amd64 #1 SMP x86_64 GNU/Linux + gcc (Debian 4.4.5-8) 4.4.5 + GNU Fortran (Debian 4.4.5-8) 4.4.5 + (cmake and autotools) + + Fedora17 3.5.2-1.fc17.i6866 #1 SMP i686 i686 i386 GNU/Linux + gcc (GCC) 4.7.0 20120507 (Red Hat 4.7.0-5) + GNU Fortran (GCC) 4.7.0 20120507 (Red Hat 4.7.0-5) + (cmake and autotools) + + Fedora17 3.5.2-1.fc17.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.7.0 20120507 (Red Hat 4.7.0-5) + GNU Fortran (GCC) 4.7.0 20120507 (Red Hat 4.7.0-5) + (cmake and autotools) + + SUSE 12.2 3.4.6-2.10-desktop #1 SMP PREEMPT i686 i686 i386 GNU/Linux + gcc (SUSE Linux) 4.7.1 + GNU Fortran (SUSE Linux) 4.7.1 + (cmake and autotools) + + SUSE 12.2 3.4.6-2.10-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.7.1 + GNU Fortran (SUSE Linux) 4.7.1 + (cmake and autotools) + + Ubuntu 12.04 3.2.0-29-generic #46-Ubuntu SMP i686 GNU/Linux + gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 + GNU Fortran (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 + (cmake and autotools) + + Ubuntu 12.04 3.2.0-29-generic #46-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 + GNU Fortran (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 + (cmake and autotools) + (Use optimization level -O1) + + Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 + hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgCC 12.5-0 64-bit target on x86-64 Linux -tp shanghai + + +Known Problems +============== +* The C++ and FORTRAN bindings are not currently working on FreeBSD with the + native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the + ports (and probably gcc releases after that). + (QAK - 2012/10/19) + +* The following h5dump test case fails in BG/P machines (and potentially other + machines that use a command script to launch executables): + + h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" + tno-subset.h5 + + This is due to the embedded spaces in the dataset name being interpreted + by the command script launcher as meta-characters, thus passing three + arguments to h5dump's -d flag. The command passes if run by hand, just + not via the test script. + (AKC - 2012/05/03) + +* On hopper, the build failed when RUNSERIAL and RUNPARALLEL are set + to aprun -np X, because the H5lib_settings.c file was not generated + properly. Not setting those environment variables works, because + configure was able to automatically detect that it's a Cray system + and used the proper launch commands when necessary. + (MSC - 2012/04/18) + +* The data conversion test dt_arith.c fails in "long double" to integer + conversion on Ubuntu 11.10 (3.0.0.13 kernal) with GCC 4.6.1 if the library + is built with optimization -O3 or -O2. The older GCC (4.5) or newer kernal + (3.2.2 on Fedora) doesn't have the problem. Users should lower the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of + "configure" like: + + CFLAGS=-O1 ./configure + + This will overwrite the library's default optimization level. + (SLU - 2012/02/07 - HDFFV-7829) + +* The STDIO VFD does not work on some architectures, possibly due to 32/64 + bit or large file issues. The basic STDIO VFD test is known to fail on + 64-bit SunOS 5.10 on SPARC when built with -m64 and 32-bit OS X/Darwin + 10.7.0. The STDIO VFD test has been disabled while we investigate and + a fix should appear in a future release. + (DER - 2011/10/14 - HDFFV-8235) + +* h5diff can report inconsistent results when comparing datasets of enum type + that contain invalid values. This is due to how enum types are handled in + the library and will be addressed in a future release. + (DER - 2011/10/14 - HDFFV-7527) + +* The links test can fail under the stdio VFD due to some issues with external + links. This will be investigated and fixed in a future release. + (DER - 2011/10/14 - HDFFV-7768) + +* After the shared library support was fixed for some bugs, it was discovered + that "make prefix=XXX install" no longer works for shared libraries. It + still works correctly for static libraries. Therefore, if you want to + install the HDF5 shared libraries in a location such as /usr/local/hdf5, + you need to specify the location via the --prefix option during configure + time. E.g, ./configure --prefix=/usr/local/hdf5 ... + (AKC - 2011/05/07 - HDFFV-7583) + +* The parallel test, t_shapesame, in testpar/, may run for a long time and may + be terminated by the alarm signal. If that happens, one can increase the + alarm seconds (default is 1200 seconds = 20 minutes) by setting the + environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If + it does, it will waste more time if $HDF5_ALARM_SECONDS is set + to a larger value. + (AKC - 2011/05/07) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD. + (QAK - 2011/04/26) + +* Shared Fortran libraries are not quite working on AIX. While they are + generated when --enable-shared is specified, the fortran and hl/fortran + tests fail. We are looking into the issue. HL and C++ shared libraries + should now be working as intended, however. + (MAM - 2011/04/20) + +* The --with-mpe configure option does not work with Mpich2. + (AKC - 2011/03/10) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or file systems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + (NAF - 2011/01/19) + +* The library's test dt_arith.c showed a compiler's rounding problem on + Cygwin when converting from unsigned long long to long double. The + library's own conversion works fine. We defined a macro for Cygwin to + skip this test until we can solve the problem. + (SLU - 2010/05/05 - HDFFV-1264) + +* All the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added in. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as + it is (see bug report #1279). Quincey will make a plan for 1.10. + (SLU - 2010/02/02) + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + (MAM - 2009/11/04) + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. + (CMC - 2009/04/28) + +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + (SLU - 2005/06/30) + + +%%%%1.8.10%%%% + + +HDF5 version 1.8.10 released on 2012-10-26 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.9 and +HDF5 1.8.10, and contains information on the platforms tested and +known problems in HDF5-1.8.10. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.10 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.10 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.10 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.10 (current +release) versus Release 1.8.9": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.9 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Configuration + ------------- + - None + + Library + ------- + - Updated to latest autotools and changed all hard *.sh scripts to + configure managed *.sh.in files. Removed overloading of autotools + TESTS variable by examples and tests. Renamed configure.in to + configure.ac. (ADB - 2012/08/23 - HDFFV-8129) + - The data sieve buffer size was set for all the datasets in the file. It + could waste memory if any dataset size is smaller than the sieve buffer + size. Now the library picks the smaller one between the dataset size + and the sieve buffer size from the file access property. See Issue 7934. + (SLU - 2012/4/11) + + Parallel Library + ---------------- + - Added the H5Pget_mpio_no_collective_cause() function that retrieves + reasons why the collective I/O was broken during read/write IO access. + (JKM - 2012/08/30 HDFFV-8143) + + - Added H5Pget_mpio_actual_io_mode_f (MSB - 2012/09/27) + + Tools + ----- + - h5import: Changed to allow the use of h5dump output as input files to + h5import. h5dump must include the "-p" option to print the properties; + configuration file is captured output of h5dump. The restrictions are + that only one dataset with a simple datatype (integer, floating-point, + or string) can be processed. Integers and floating-point imports from + h5dump must use the "binary" option for the data file. The string version + uses the h5dump "-y --width=1" options to disable the indexing printouts, + print single columns, and obviously NOT use the "binary" option. + (ADB - 2012/07/19 HDFFV-721) + + High-Level APIs + --------------- + - None + + Fortran API + ----------- + - Fixed a typo in return value of the nh5dread_f_c function (was 1 + instead of 0 on success); fixed the return value to make it consistent + with other Fortran functions; cleaned debug statements from the code. + (EIP - 2012/06/23) + + C++ API + ------- + - None + + +Support for New Platforms, Languages, and Compilers +=================================================== + - None + +Bug Fixes since HDF5-1.8.9 +========================== + + Configuration + ------------- + - Fixed configure --enable-production to not use -O optimization for Lion + and Mountain Lion systems when gcc (i686-apple-darwin11-llvm-gcc-4.2 + (GCC) 4.2.1) is used. Somehow the -O optimization will cause some of + the hard conversion code in test/dt_arith.c to fail. HDFFV-8017. + (AKC - 2012/10/10) + - Fixed AIX Fortran compiler flags to use appropriate settings for + debugging, profiling, and optimization situations. HDFFV-8069. + (AKC 2012/09/27) + + Library + ------- + - Fixed a memory leak exposed when inserting/removing a property + from a property list several times. HDFFV-8022. (MSC 2012/05/18) + - The file_image test will fail in the "initial file image and callbacks in + the core VFD" sub-test if the source directory is read-only as the test + fails to create its test files in the build directory. This has been + fixed. HDFFV-8009 (AKC - 2012/07/06) + + + Parallel Library + ---------------- + - The MPI-POSIX VFD was updated to include the POSIX and Windows + correctness features added that had already been added to the other VFDs. + HDFFV-8058/7845. (DER 2012/09/17) + + Performance + ------------- + - Removed program perform/benchpar from the enable-build-all list. The + program will be retired or moved to another location. HDFFV-8156 + (AKC 2012/10/01) + - Retired program perform/mpi-perf. Its purpose has been incorporated + into h5perf. (AKC 2012/09/21) + + Tools + ----- + - h5repack: "h5repack -f NONE file1.h5 out.h5" command failed if + source file contains chunked dataset and a chunk dim is bigger than + the dataset dim. Another issue is that the command changed max dims + if chunk dim is smaller than the dataset dim. These issue occurred + when dataset size is smaller than 64k (compact size limit) Fixed both. + HDFFV-8012 (JKM 2012/09/24) + - h5diff: Fixed the counter in verbose mode (-v, -r) so that it will no + longer add together the differences between datasets and the differences + between attributes of those datasets. This change makes the output of + verbose mode consistent for datasets, groups, and committed datatypes. + HDFFV-5919 (JKM 2012/09/10) + - h5diff: Fixed the incorrect result when comparing attribute data + values and the data type has the same class but different sizes. + HDFFV-7942 (JKM 2012/08/15) + - h5dump: Replaced single element fwrite with block writes. + HDFFV-1208 (ADB 2012/08/13) + - h5diff: Fixed test failure for "make check" due to failure of + copying test files when performed in HDF5 source tree. Also applied + to other tools. HDFFV-8107 (JKM 2012/08/01) + - ph5diff: Fixed intermittent hang issue on a certain operation in + parallel mode. It was detected by daily test for comparing + non-comparable objects, but it could have occurred in other + operations depending on machine condition. HDFFV-8003 (JKM 2012/08/01) + - h5diff: Fixed the function COPY_TESTFILES_TO_TESTDIR() of testh5diff.sh + to better report when there is an error in the file copying. + HDFFV-8105 (AKC 2012/07/22) + - h5dump: Fixed the sort by name display to maintain correct parent/child + relationships between ascending/descending order. + HDFFV-8095 (ADB 2012/07/12) + - h5dump: Fixed the display by creation order when using option -n + (print contents). + HDFFV-5942 (ADB 2012/07/09) + - h5dump: Changed to allow H5T_CSET_UTF8 to be displayed in h5dump output. + Used technique similar to what was done in h5ls (matches library + options). + HDFFV-7999 (ADB 2012/05/23) + - h5diff: Fixed the tool so that it will not check and display the status + of dangling links without setting the --follow-symlinks option. This + also improved performance when comparing lots of external links without + the --follow-symlinks option. + HDFFV-7998 (JKM 2012/04/26) + + F90 API + ------- + + - Fixed a typo in return value of the nh5dread_f_c function (was 1 + instead of 0 on success); fixed the return value to make it consistent + with other Fortran functions; cleaned debug statements from the code. + (EIP - 2012/06/23) + + - Fixed a problem writing/reading control characters to a dataset; writing + a string containing alerts, backspace, carriage_return, form_feed, + horizontal_tab, vertical_tab, or new_line is now tested and working. + (MSB - 2012/09/01) + + - Corrected the integer type of H5S_UNLIMITED_F to HSIZE_T (MSB - 2012/09/01) + + - Corrected the number of continuation lines in the src files + to be less than 32 lines for F95 compliance. (MSB - 2012/10/01) + + C++ API + ------ + - None + + High-Level APIs: + ------ + + - Fixed problem with H5TBdelete_record destroying all data following the + deletion of a row. (MSB- 2012/7/26) + + - Fixed H5LTget_attribute_string not closing an object identifier when an + error occurs. (MSB- 2012/7/21) + + - Corrected the return type of H5TBAget_fill from herr_t to htri_t to + reflect that a return value of 1 indicates that a fill value is + present, 0 indicates a fill value is not present, and <0 indicates an + error. + + Fortran High-Level APIs: + ------ + - None + +Supported Platforms +=================== + AIX 5.3 xlc 10.1.0.5 + (NASA G-ADA) xlC 10.1.0.5 + xlf90 12.1.0.6 + + Linux 2.6.18-308.13.1.el5PAE GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP i686 i686 i386 compilers for 32-bit applications; + (jam) Version 4.1.2 20080704 (Red Hat 4.1.2-52) + Version 4.6.3 + PGI C, Fortran, C++ Compilers for 32-bit + applications; + Version 11.9-0 + Intel(R) C, C++, Fortran Compiler for 32-bit + applications; + Version 12.1 + MPICH mpich2-1.4.1p1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + Linux 2.6.18-308.16.1.el5 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers for 32-bit applications; + (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-52) + Version 4.6.3 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 11.9-0 + Version 12.5-0 + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; + Version 12.1 (Build 20110811) + Version 12.1 (Build 20120212) + MPICH mpich2-1.4.1p1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + Linux 2.6.32-220.7.1.el6.ppc64 gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.6 20110731 + (ostrich) GNU Fortran (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) + + Linux 2.6.32-220.23.1.1chaos Intel C, C++, Fortran Compilers + ch5.x86_64 GNU/Linux Version 12.1.5.339 + (LLNL Aztec) + + IBM Blue Gene/P XL C for Blue Gene/P, bgxlc V9.0 + (LLNL uDawn) XL C++ for Blue Gene/P, bgxlC V9.0 + XL Fortran for Blue Gene/P, bgxlf90 V11.1 + + SunOS 5.10 32- and 64-bit Sun C 5.9 Sun OS_sparc Patch 124867-16 + (linew) Sun Fortran 95 8.3 Sun OS_sparc Patch 127000-13 + Sun C++ 5.9 Sun OS_sparc Patch 124863-26 + Sun C 5.11 SunOS_sparc + Sun Fortran 95 8.5 SunOS_sparc + Sun C++ 5.11 SunOS_sparc + + Windows XP Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + + Windows XP x64 Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + + Windows 7 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 w/ Intel Fortran 12 (cmake) + Cygwin(CYGWIN_NT-6.1 1.7.15(0.260/5/3) gcc(4.5.3) compiler and gfortran) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 w/ Intel Fortran 12 (cmake) + Cygwin(CYGWIN_NT-6.1 1.7.15(0.260/5/3) gcc(4.5.3) compiler and gfortran) + (cmake and autotools) + + Mac OS X Snow Leopard 10.6.8 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 3.2.6 + Darwin Kernel Version 10.8.0 g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 3.2.6 + (fred) gfortran GNU Fortran (GCC) 4.6.2 + Intel C (icc), Fortran (ifort), C++ (icpc) + 12.1.0.038 Build 20110811 + + Mac OS X Snow Leopard 10.6.8 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 3.2.6 + Darwin Kernel Version 10.8.0 g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 3.2.6 + Intel 32-bit gfortran GNU Fortran (GCC) 4.6.1 + (tejeda) Intel C (icc), Fortran (ifort), C++ (icpc) + 12.1.0.038 Build 20110811 + + Mac OS X Lion 10.7.3 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.2.1 + 32- and 64-bit g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.2.1 + (duck) gfortran GNU Fortran (GCC) 4.6.2 + + Mac OS X Mountain Lion 10.8.1 cc Apple clang version 4.0 from Xcode 4.5.1 + (owl) c++ Apple clang version 4.0 from Xcode 4.5.1 + gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + gfortran GNU Fortran (GCC) 4.6.2 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +Solaris2.10 32-bit n y/y n y y y +Solaris2.10 64-bit n y/n n y y y +Windows 7 y y/n n y y y +Windows 7 x64 y y/n n y y y +Mac OS X Snow Leopard 10.6.8 32-bit n y/y n y y n +Mac OS X Snow Leopard 10.6.8 64-bit n y/y n y y y +Mac OS X Lion 10.7.3 32-bit n y/y n y y n +Mac OS X Lion 10.7.3 64-bit n y/y n y y y +Mac OS X Mountain Lion 10.8.1 64-bit n y/n n y y n +AIX 5.3 32- and 64-bit y y/n y y y y +CentOS 5.5 Linux 2.6.18-308 i686 GNU y y/y y y y y +CentOS 5.5 Linux 2.6.18-308 i686 Intel n y/y n y y y +CentOS 5.5 Linux 2.6.18-308 i686 PGI n y/y n y y y +CentOS 5.5 Linux 2.6.18 x86_64 GNU y y/y y y y y +CentOS 5.5 Linux 2.6.18 x86_64 Intel n y/y n y y y +CentOS 5.5 Linux 2.6.18 x86_64 PGI n y/y n y y y +Linux 2.6.32-220.7.1.el6.ppc64 n y/n n y y y + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit n n n n +Windows 7 y y y y +Windows 7 x64 y y y y +Mac OS X Snow Leopard 10.6.8 32-bit y n y n +Mac OS X Snow Leopard 10.6.8 64-bit y n y n +Mac OS X Lion 10.7.3 32-bit y n y y +Mac OS X Lion 10.7.3 64-bit y n y y +Mac OS X Mountain Lion 10.8.1 64-bit y n y y +AIX 5.3 32- and 64-bit n n n y +CentOS 5.5 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.5 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.5 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.5 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.5 Linux 2.6.18 x86_64 Intel y y y n +CentOS 5.5 Linux 2.6.18 x86_64 PGI y y y n +Linux 2.6.32-220.7.1.el6.ppc64 y y y n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719 + (loyalty) gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + FreeBSD 8.2-STABLE amd64 gcc 4.2.1 [FreeBSD] 20070719 + (freedom) gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + Debian6.0.3 2.6.32-5-686 #1 SMP i686 GNU/Linux + gcc (Debian 4.4.5-8) 4.4.5 + GNU Fortran (Debian 4.4.5-8) 4.4.5 + (cmake and autotools) + + Debian6.0.3 2.6.32-5-amd64 #1 SMP x86_64 GNU/Linux + gcc (Debian 4.4.5-8) 4.4.5 + GNU Fortran (Debian 4.4.5-8) 4.4.5 + (cmake and autotools) + + Fedora17 3.5.2-1.fc17.i6866 #1 SMP i686 i686 i386 GNU/Linux + gcc (GCC) 4.7.0 20120507 (Red Hat 4.7.0-5) + GNU Fortran (GCC) 4.7.0 20120507 (Red Hat 4.7.0-5) + (cmake and autotools) + + Fedora17 3.5.2-1.fc17.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.7.0 20120507 (Red Hat 4.7.0-5) + GNU Fortran (GCC) 4.7.0 20120507 (Red Hat 4.7.0-5) + (cmake and autotools) + + SUSE 12.2 3.4.6-2.10-desktop #1 SMP PREEMPT i686 i686 i386 GNU/Linux + gcc (SUSE Linux) 4.7.1 + GNU Fortran (SUSE Linux) 4.7.1 + (cmake and autotools) + + SUSE 12.2 3.4.6-2.10-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.7.1 + GNU Fortran (SUSE Linux) 4.7.1 + (cmake and autotools) + + Ubuntu 12.04 3.2.0-29-generic #46-Ubuntu SMP i686 GNU/Linux + gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 + GNU Fortran (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 + (cmake and autotools) + + Ubuntu 12.04 3.2.0-29-generic #46-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 + GNU Fortran (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 + (cmake and autotools) + (Use optimization level -O1) + + Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 + hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgCC 12.5-0 64-bit target on x86-64 Linux -tp shanghai + + +Known Problems +============== +* The following h5stat test case fails in BG/P machines (and potentially other + machines that display extra output if an MPI task returns with a non-zero + code.) + Testing h5stat notexist.h5 + + The test actually runs and passes as expected. It is the extra output from + the MPI process that causes the test script to fail. This will be fixed + in the next release. (AKC - 2012/10/25 - HDFFV-8233) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD with the + native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the + ports (and probably gcc releases after that). + (QAK - 2012/10/19) + +* The following h5dump test case fails in BG/P machines (and potentially other + machines that use a command script to launch executables): + + h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" + tno-subset.h5 + + This is due to the embedded spaces in the dataset name being interpreted + by the command script launcher as meta-characters, thus passing three + arguments to h5dump's -d flag. The command passes if run by hand, just + not via the test script. + (AKC - 2012/05/03) + +* On hopper, the build failed when RUNSERIAL and RUNPARALLEL are set + to aprun -np X, because the H5lib_settings.c file was not generated + properly. Not setting those environment variables works, because + configure was able to automatically detect that it's a Cray system + and used the proper launch commands when necessary. + (MSC - 2012/04/18) + +* The data conversion test dt_arith.c fails in "long double" to integer + conversion on Ubuntu 11.10 (3.0.0.13 kernal) with GCC 4.6.1 if the library + is built with optimization -O3 or -O2. The older GCC (4.5) or newer kernal + (3.2.2 on Fedora) doesn't have the problem. Users should lower the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of + "configure" like: + + CFLAGS=-O1 ./configure + + This will overwrite the library's default optimization level. + (SLU - 2012/02/07 - HDFFV-7829) + +* The STDIO VFD does not work on some architectures, possibly due to 32/64 + bit or large file issues. The basic STDIO VFD test is known to fail on + 64-bit SunOS 5.10 on SPARC when built with -m64 and 32-bit OS X/Darwin + 10.7.0. The STDIO VFD test has been disabled while we investigate and + a fix should appear in a future release. + (DER - 2011/10/14 - HDFFV-8235) + +* h5diff can report inconsistent results when comparing datasets of enum type + that contain invalid values. This is due to how enum types are handled in + the library and will be addressed in a future release. + (DER - 2011/10/14 - HDFFV-7527) + +* The links test can fail under the stdio VFD due to some issues with external + links. This will be investigated and fixed in a future release. + (DER - 2011/10/14 - HDFFV-7768) + +* After the shared library support was fixed for some bugs, it was discovered + that "make prefix=XXX install" no longer works for shared libraries. It + still works correctly for static libraries. Therefore, if you want to + install the HDF5 shared libraries in a location such as /usr/local/hdf5, + you need to specify the location via the --prefix option during configure + time. E.g, ./configure --prefix=/usr/local/hdf5 ... + (AKC - 2011/05/07 - HDFFV-7583) + +* The parallel test, t_shapesame, in testpar/, may run for a long time and may + be terminated by the alarm signal. If that happens, one can increase the + alarm seconds (default is 1200 seconds = 20 minutes) by setting the + environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If + it does, it will waste more time if $HDF5_ALARM_SECONDS is set + to a larger value. + (AKC - 2011/05/07) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD. + (QAK - 2011/04/26) + +* Shared Fortran libraries are not quite working on AIX. While they are + generated when --enable-shared is specified, the fortran and hl/fortran + tests fail. We are looking into the issue. HL and C++ shared libraries + should now be working as intended, however. + (MAM - 2011/04/20) + +* The --with-mpe configure option does not work with Mpich2. + (AKC - 2011/03/10) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or file systems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + (NAF - 2011/01/19) + +* The library's test dt_arith.c showed a compiler's rounding problem on + Cygwin when converting from unsigned long long to long double. The + library's own conversion works fine. We defined a macro for Cygwin to + skip this test until we can solve the problem. + (SLU - 2010/05/05 - HDFFV-1264) + +* All the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added in. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as + it is (see bug report #1279). Quincey will make a plan for 1.10. + (SLU - 2010/02/02) + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + (MAM - 2009/11/04) + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. + (CMC - 2009/04/28) + +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + (SLU - 2005/06/30) + + +%%%%1.8.9%%%% + + +HDF5 version 1.8.9 released on 2012-05-09 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.8 and +HDF5 1.8.9. It also contains information on the platforms tested and +known problems in HDF5-1.8.9. + +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.9 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.9 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.9 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.9 (current +release) versus Release 1.8.8": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.8 +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + + Configuration + ------------- + - None + + Library + ------- + - Added new feature to merge committed datatypes when copying objects, + using new H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG, modified by new API + routines: H5Padd_merge_committed_dtype_path(), + H5Pfree_merge_committed_dtype_paths(), H5Pset_mcdt_search_cb() and + H5Pget_mcdt_search_cb(). (QAK - 2012/03/30) + - Added new feature which allows working with files in memory in the + same ways files are worked with on disk. New API routines include + H5Pset_file_image, H5Pget_file_image, H5Pset_file_image_callbacks, + H5Pget_file_image_callbacks, H5Fget_file_image, and + H5LTopen_file_image. (QAK - 2012/04/17) + + Parallel Library + ---------------- + - Corrected memory allocation error in MPI datatype construction code. + (QAK - 2012/04/23) + - Add two new routines to set/get the atomicity parameter in the + MPI library to perform atomic operations. Some file systems (for + example PVFS2) do not support atomic updates, so those routines + would not be supported. (MSC - 2012/03/27 - HDFFV-7961) + + Tools + ----- + - h5repack: Added ability to set the metadata block size of the output + file, with the '-M'/'--metadata_block_size' command line parameter. + (QAK - 2012/03/30) + - h5stat: Added ability to display a summary of the file space usage for a + file, with the '-S'/'--summary' command line parameter. (QAK - 2012/03/28) + - h5dump: Added capability for "-a" option to show attributes containing "/" + by using an escape character. For example, for a dataset "/dset" + containing attribute "speed(m/h)", use "h5dump -a "/dset/speed(\/h)" + to show the content of the attribute. (PC - 2012/03/12 - HDFFV-7523) + - h5dump: Added ability to apply command options across multiple files using a + wildcard in the filename. Unix example; "h5dump -H -d Dataset1 tarr*.h5". + Cross platform example; "h5dump -H -d Dataset1 tarray1.h5 tarray2.h5 tarray3.h5". + (ADB - 2012/03/12 - HDFFV-7876). + - h5dump: Added new option --no-compact-subset. This option will not + interpret the '[' character as starting the compact form of + subsetting. This is useful when the "h5dump error: unable to + open dataset "datset_name"" message is output because a dataset + name contains a '[' character. (ADB - 2012/03/05 - HDFFV-7689). + - h5repack: Improved performance for big chunked datasets (size > 128MB) + when used with the layout (-l) or compression (-f) options. + Before this change, repacking datasets with chunks with a large first + dimension would take extremely long. For example, repacking a dataset + with chunk dimensions of 1024x5x1 might take many hours to process + while changing a dataset with chunk dimensions set to 1x5x1024 + might take under an hour. After this change, processing the dataset + with chunk dimensions of 1024x5x1 takes about 15 minutes, and processing + a dataset with chunk dimensions of 1x5x1024 takes about 14 minutes. + (JKM - 2012/03/01 - HDFFV-7862) + + High-Level APIs + --------------- + - New API: H5LTpath_valid (Fortran: h5ltpath_valid_f) checks + if a path is correct, determines if a link resolves to a valid + object, and checks that the link does not dangle. (MSB - 2012/03/15) + + Fortran API + ----------- + + - Added for the C API the Fortran wrapper: + h5ocopy_f (MSB - 2012/03/22) + + C++ API + ------- + - None + + +Support for New Platforms, Languages, and Compilers +=================================================== + - None + +Bug Fixes since HDF5-1.8.8 +========================== + + Configuration + ------------- + - Fixed Makefile issue in which "-Wl," was not properly specified + prior to -rpath when building parallel Fortran libraries with + an Intel compiler. (MAM - 2012/03/26) + - Makefiles generated by other packages using h5cc as the compiler + no longer error when 'make' is invoked more than once in order + to 'rebuild' after changes to source. (MAM - 2012/03/26) + - Added code to display the version information of XL Fortran and C++ + in the summary of configure. (AKC - 2012/02/28 - HDFFV-7793) + - Updated all CMakeLists.txt files to indicate the minimum CMake version is + the current standard of 2.8.6 (ADB - 2011/12/05 - HDFFV-7854) + + Library + ------- + - Windows and STDIO correctness changes have been propagated from the SEC2 + and old Windows drivers to the STDIO VFD. (DER - 2012/03/30 - HDFFV-7917) + - Fixed an error that would occur when copying an object with attribute + creation order tracked and indexed. (NAF - 2012/03/28 - HDFFV-7762) + - Fixed a bug in H5Ocopy(): When copying an opened object, call the + object's flush class action to ensure that cached data is flushed so + that H5Ocopy will get the correct data. (VC - 2012/03/27 - HDFFV-7853) + - The istore test will now skip the sparse 50x50x50 test when the VFD does + not support sparse files on that platform. The most important platforms + on which this will be skipped are Windows (NTFS sparse files are not + supported) and Mac OS-X (HFS sparse files are not supported). This + fixes CTest timeout issues on Windows. (DER - 2012/03/27 - HDFFV-7769) + - Windows and POSIX correctness changes have been propagated from the SEC2 + VFD to the Core VFD. This mainly affects file operations on the + driver's backing store and fixes a problem on Windows where large files + could not be read. (DER - 2012/03/27 - HDFFV-7916 - HDFFV-7603) + - When an application tries to write or read many small data chunks and + runs out of memory, the library had a segmentation fault. The fix is to + return the error stack with proper information. + (SLU - 2012/03/23 - HDFFV-7785) + - H5Pset_data_transform had a segmentation fault in some cases like x*-100. + It works correctly now and handles other cases like 100-x or 2/x. + (SLU - 2012/03/15 - HDFFV-7922) + - Fixed rare corruption bugs that could occur when using the new object + header format. (NAF - 2012/03/15 - HDFFV-7879) + - Fixed an error that occurred when creating a contiguous dataset with a + zero-sized dataspace and space allocation time set to 'early'. + (QAK - 2012/03/12) + - Changed Windows thread creation to use _beginthread() instead of + CreateThread(). Threads created by the latter can be killed in + low-memory situations. (DER - 2012/02/10 - HDFFV-7780) + - Creating a dataset in a read-only file caused a segmentation fault when + the file is closed. It's fixed. The attempt to create a dataset will + fail with an error indicating the file is read-only. + (SLU - 2012/01/25 - HDFFV-7756) + - Fixed a segmentation fault that could occur when shrinking a dataset + with chunks larger than 1 MB. (NAF - 2011/11/30 - HDFFV-7833) + - Fixed a bug that could cause H5Oget_info to return the wrong address + after copying a committed (named) datatype. (NAF - 2011/11/14) + - The library allowed the conversion of strings between ASCII and UTF8 + We have corrected it to report an error under this situation. + (SLU - 2011/11/8 - HDFFV-7582) + - Fixed a segmentation fault when the library tried to shrink the size + of a compound datatype through H5Tset_size immediately after the + datatype was created. (SLU - 2011/11/4 - HDFFV-7618) + + Parallel Library + ---------------- + - None + + Tools + ----- + - h5unjam: Fixed a segmentation fault that occurred when h5unjam was used + with the -V (show version) option. (JKM - 2012/04/19 - HDFFV-8001) + - h5repack: Fixed a failure that occurred when repacking the chunk size + of a specified chunked dataset with unlimited max dims. + (JKM - 2012/04/11 - HDFFV-7993) + - h5diff: Fixed a failure when comparing groups. Before the fix, if an + object in a group was compared with an object in another group where + both had the same name but the object type was different, then h5diff + would fail. After the fix, h5diff detects such cases as non-comparable + and displays appropriate error messages. + (JKM - 2012/03/28 - HDFFV-7644) + - h5diff: If unique objects exist only in one file and if h5diff is set to + exclude the unique objects with the --exclude-path option, then h5diff + might miss excluding some objects. This was fixed to correctly exclude + objects. (JKM - 2012/03/20 - HDFFV-7837) + - h5diff: When two symbolic dangling links are compared with the + --follow-symlinks option, the result should be the same. This worked when + comparing two files, but didn't work when comparing two objects. + h5diff now works when comparing two objects. + (JKM - 2012/03/09 - HDFFV-7835) + - h5dump: Added the tools library error stack to properly catch error + information generated within the library. (ADB - 2012/03/12 - HDFFV-7958) + - h5dump: Changed the process where an open link used to fail. Now dangling + links no longer throw error messages. (ADB - 2012/03/12 - HDFFV-7839) + - h5dump: Refactored code to remove duplicated functions. Split XML + functions from DDL functions. Corrected indentation and formatting + errors. Also fixed subsetting counting overflow (HDFFV-5874). Verified + all tools call tools_init() in main. The USER_BLOCK data now correctly + displays within the SUPER_BLOCK info. NOTE: WHITESPACE IN THE OUTPUT + HAS CHANGED. (ADB - 2012/02/17 - HDFFV-7560) + - h5diff: Fixed to prevent from displaying error stack message when + comparing two dangling symbolic links with the follow-symlinks option. + (JKM - 2012/01/13 - HDFFV-7836) + - h5repack: Fixed a memory leak that occurred with the handling of + variable length strings in attributes. + (JKM - 2012/01/10 - HDFFV-7840) + - h5ls: Fixed a segmentation fault that occurred when accessing region + reference data in an attribute. (JKM - 2012/01/06 - HDFFV-7838) + + F90 API + ------- + - None + + C++ API + ------ + - None + + High-Level APIs: + ------ + - None + + Fortran High-Level APIs: + ------ + - h5ltget_attribute_string_f: The h5ltget_attribute_string_f used to return + the C NULL character in the returned character buffer. The returned + charactor buffer now does not return the C NULL character; the buffer + is blank-padded if needed. (MSB - 2012/03/23) + + +Platforms Tested +================ +The following platforms and compilers have been tested for this release. + + AIX 5.3 xlc 10.1.0.5 + (NASA G-ADA) xlC 10.1.0.5 + xlf90 12.1.0.6 + + FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719 + (loyalty) g++ 4.2.1 [FreeBSD] 20070719 + gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + FreeBSD 8.2-STABLE amd64 gcc 4.2.1 [FreeBSD] 20070719 + (freedom) g++ 4.2.1 [FreeBSD] 20070719 + gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + Linux 2.6.18-194.3.1.el5PAE GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP i686 i686 i386 compilers for 32-bit applications; + (jam) Version 4.1.2 20080704 (Red Hat 4.1.2-52) + Version 4.5.2 + PGI C, Fortran, C++ Compilers for 32-bit + applications; + Version 11.8-0 + Version 11.9-0 + Intel(R) C, C++, Fortran Compiler for 32-bit + applications; + Version 12.0 + Version 12.1 + MPICH mpich2-1.3.1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + Linux 2.6.18-308.1.1.el5 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers for 32-bit applications; + (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-52) + Version 4.5.2 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 11.9-0 (64-bit) + Version 11.8-0 (32-bit) + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; + Version 12.0 + Version 12.1 + MPICH mpich2-1.3.1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + Linux 2.6.32-220.7.1.el6.ppc64 gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.6 20110731 + (ostrich) GNU Fortran (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) + + Linux 2.6.18-108chaos Intel C, C++, Fortran Compilers Version 11.1 + #1 SMP x86_64 GNU/Linux + (LLNL Aztec) + + IBM Blue Gene/P XL C for Blue Gene/P, bgxlc V9.0 + (LLNL uDawn) XL C++ for Blue Gene/P, bgxlC V9.0 + XL Fortran for Blue Gene/P, bgxlf0 V11.1 + + SunOS 5.10 32- and 64-bit Sun C 5.9 Sun OS_sparc Patch 124867-16 + (linew) Sun Fortran 95 8.3 Sun OS_sparc Patch 127000-13 + Sun C++ 5.9 Sun OS_sparc Patch 124863-26 + Sun C 5.11 SunOS_sparc + Sun Fortran 95 8.5 SunOS_sparc + Sun C++ 5.11 SunOS_sparc + + SGI Altix UV Intel(R) C, Fortran Compilers + SGI ProPack 7 Linux Version 11.1 20100806 + 2.6.32.24-0.2.1.2230.2.PTF- SGI MPT 2.02 + default #1 SMP + (NCSA ember) + + Dell NVIDIA Cluster Intel(R) C, Fortran Compilers + Red Hat Enterprise Linux 6 Version 12.0.4 20110427 + 2.6.32-131.4.1.el6.x86_64 mvapich2 1.7rc1-intel-12.0.4 + (NCSA forge) + + Windows XP Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 w/ Intel Fortran 12 (cmake) + + Windows XP x64 Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 w/ Intel Fortran 12 (cmake) + + Windows 7 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 w/ Intel Fortran 12 (cmake) + Cygwin(1.7.9 native gcc(4.5.3) compiler and gfortran) + + Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 w/ Intel Fortran 12 (cmake) + Cygwin(1.7.9 native gcc(4.5.3) compiler and gfortran) + + Mac OS X Snow Leopard 10.6.8 i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (gcc) + Darwin Kernel Version 10.8.0 i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (g++) + Intel 64-bit (Apple Inc. build 5666) (dot 3) + (fred) GNU Fortan (GCC) 4.6.1 (gfortran) + Intel C (icc), Fortran (ifort), C++ (icpc) + 12.1.0.038 Build 20110811 + + Mac OS X Snow Leopard 10.6.8 i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (gcc) + Darwin Kernel Version 10.8.0 i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (g++) + Intel 32-bit (Apple Inc. build 5666) (dot 3) + (tejeda) GNU Fortran (GCC) 4.6.1 (gfortran) + Intel C (icc), Fortran (ifort), C++ (icpc) + 12.1.0.038 Build 20110811 + + Mac OS X Lion 10.7.3 GCC 4.2.1 gcc + 32- and 64-bit GNU Fortran (GCC) 4.6.1 gfortran + (duck) GCC 4.2.1. g++ + + Debian6.0.3 2.6.32-5-686 #1 SMP i686 GNU/Linux + gcc (Debian 4.4.5-8) 4.4.5 + GNU Fortran (Debian 4.4.5-8) 4.4.5 + + Debian6.0.3 2.6.32-5-amd64 #1 SMP x86_64 GNU/Linux + gcc (Debian 4.4.5-8) 4.4.5 + GNU Fortran (Debian 4.4.5-8) 4.4.5 + + Fedora16 3.2.9-2.fc16.i6866 #1 SMP i686 i686 i386 GNU/Linux + gcc (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1) + GNU Fortran (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1) + + Fedora16 3.2.9-2.fc16.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1) + GNU Fortran (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1) + + SUSE 12.1 3.1.9-1.4-desktop #1 SMP PREEMPT i686 i686 i386 GNU/Linux + gcc (SUSE Linux) 4.6.2 + GNU Fortran (SUSE Linux) 4.6.2 + + SUSE 12.1 3.1.9-1.4-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.6.2 + GNU Fortran (SUSE Linux) 4.6.2 + + Ubuntu 11.10 3.0.0-16-generic #29-Ubuntu SMP i686 GNU/Linux + gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 + GNU Fortran (Ubuntu/Linaro 4.6.4-9ubuntu3) 4.6.1 + + Ubuntu 11.10 3.0.0-16-generic #29-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 + GNU Fortran (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 + + Cray Linux Environment (CLE) PrgEnv-pgi 2.2.74 + hopper.nersc.gov pgcc 11.9-0 64-bit target on x86-64 Linux -tp k8e + pgf90 11.9-0 64-bit target on x86-64 Linux -tp k8e + pgCC 11.9-0 64-bit target on x86-64 Linux -tp k8e + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +Solaris2.10 32-bit n y n y y y +Solaris2.10 64-bit n y n y y y +Windows XP n y(4) n y y y +Windows XP x64 n y(4) n y y y +Windows Vista n y(4) n y y y +Windows Vista x64 n y(4) n y y y +Mac OS X Snow Leopard 10.6.8 32-bit n y n y y n +Mac OS X Snow Leopard 10.6.8 64-bit n y n y y y +Mac OS X Lion 10.7.3 32-bit n y n y y n +Mac OS X Lion 10.7.3 64-bit n y n y y y +AIX 5.3 32- and 64-bit y y y y y y +FreeBSD 8.2-STABLE 32&64 bit n x n x y y +CentOS 5.5 Linux 2.6.18-194 i686 GNU (1)W y y(2) y y y y +CentOS 5.5 Linux 2.6.18-194 i686 Intel W n y n y y y +CentOS 5.5 Linux 2.6.18-194 i686 PGI W n y n y y y +CentOS 5.5 Linux 2.6.18 x86_64 GNU (1) W y y(3) y y y y +CentOS 5.5 Linux 2.6.18 x86_64 Intel W n y n y y y +CentOS 5.5 Linux 2.6.18 x86_64 PGI W n y n y y y +Linux 2.6.32-220.7.1.el6.ppc64 n y n y y y +SGI ProPack 7 Linux 2.6.32.24 y y y y y y +Red Hat Enterprise Linux 6 y y y y y y +CLE hopper.nersc.gov y y(3) y y y n + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit n n n n +Windows XP y y(4) y n +Windows XP x64 y y(4) y n +Windows Vista y y(4) y y +Windows Vista x64 y y(4) y y +Mac OS X Snow Leopard 10.6.8 32-bit y n y n +Mac OS X Snow Leopard 10.6.8 64-bit y n y n +Mac OS X Lion 10.7.3 32-bit y n y y +Mac OS X Lion 10.7.3 64-bit y n y y +AIX 5.3 32- and 64-bit n n n y +FreeBSD 8.2-STABLE 32&64 bit y x x y +CentOS 5.5 Linux 2.6.18-194 i686 GNU (1)W y y(2) y y +CentOS 5.5 Linux 2.6.18-194 i686 Intel W y y y n +CentOS 5.5 Linux 2.6.18-194 i686 PGI W y y y n +CentOS 5.5 Linux 2.6.18 x86_64 GNU (1) W y y y y +CentOS 5.5 Linux 2.6.18 x86_64 Intel W y y y n +CentOS 5.5 Linux 2.6.18 x86_64 PGI W y y y n +Linux 2.6.32-220.7.1.el6.ppc64 y y y n +SGI ProPack 7 Linux 2.6.32.24 y y y n +Red Hat Enterprise Linux 6 y y y n +CLE hopper.nersc.gov n n n n + + (1) Fortran compiled with gfortran. + (2) With PGI and Absoft compilers. + (3) With PGI compiler for Fortran. + (4) Using Visual Studio 2008 w/ Intel Fortran 10.1 (Cygwin shared libraries are not supported) + (5) C and C++ shared libraries will not be built when Fortran is enabled. + Compiler versions for each platform are listed in the preceding + "Platforms Tested" table. + + +Known Problems +============== +* The h5repacktst test fails on AIX 32-bit because the test uses more + memory than the default amount. The failure message typically looks like: + + "time: 0551-010 The process was stopped abnormally. Try again." + + This is an issue with the test only and does not represent a problem with + the library. To allow the test to pass, request more memory when testing + via appropriate command such as: + + $ env LDR_CNRTL=MAXDATA=0x20000000@DSA make check + + (AKC - 2012/05/09 - HDFFV-8016) + +* The file_image test will fail in the "initial file image and callbacks in + the core VFD" sub-test if the source directory is read-only as the test + fails to create its test files in the build directory. This will be + resolved in a future release. + (AKC - 2012/05/05 - HDFFV-8009) + +* The dt_arith test reports several errors involving "long double" on + Mac OS X 10.7 Lion when any level of optimization is enabled. The test does + not fail in debug mode. This will be addressed in a future release. + (SLU - 2012/05/08) + +* The following h5dump test case fails in BG/P machines (and potentially other + machines that use a command script to launch executables): + + h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" + tno-subset.h5 + + This is due to the embedded spaces in the dataset name being interpreted + by the command script launcher as meta-characters, thus passing three + arguments to h5dump's -d flag. The command passes if run by hand, just + not via the test script. + (AKC - 2012/05/03) + +* The ph5diff (parallel h5diff) tool can intermittently hang in parallel mode + when comparing two HDF5 files that contain objects with the same names but + with different object types. + (JKM - 2012/04/27) + +* On hopper, the build failed when RUNSERIAL and RUNPARALLEL are set + to aprun -np X, because the H5lib_settings.c file was not generated + properly. Not setting those environment variables works, because + configure was able to automatically detect that it's a Cray system + and used the proper launch commands when necessary. + (MSC - 2012/04/18) + +* The data conversion test dt_arith.c fails in "long double" to integer + conversion on Ubuntu 11.10 (3.0.0.13 kernal) with GCC 4.6.1 if the library + is built with optimization -O3 or -O2. The older GCC (4.5) or newer kernal + (3.2.2 on Fedora) doesn't have the problem. Users should lower the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of + "configure" like: + + CFLAGS=-O1 ./configure + + This will overwrite the library's default optimization level. + (SLU - 2012/02/07 - HDFFV-7829) + +* The STDIO VFD does not work on some architectures, possibly due to 32/64 + bit or large file issues. The basic STDIO VFD test is known to fail on + 64-bit SunOS 5.10 on SPARC when built with -m64 and 32-bit OS X/Darwin + 10.7.0. The STDIO VFD test has been disabled while we investigate and + a fix should appear in a future release. + (DER - 2011/10/14) + +* h5diff can report inconsistent results when comparing datasets of enum type + that contain invalid values. This is due to how enum types are handled in + the library and will be addressed in a future release. + (DER - 2011/10/14 - HDFFV-7527) + +* The links test can fail under the stdio VFD due to some issues with external + links. This will be investigated and fixed in a future release. + (DER - 2011/10/14 - HDFFV-7768) + +* After the shared library support was fixed for some bugs, it was discovered + that "make prefix=XXX install" no longer works for shared libraries. It + still works correctly for static libraries. Therefore, if you want to + install the HDF5 shared libraries in a location such as /usr/local/hdf5, + you need to specify the location via the --prefix option during configure + time. E.g, ./configure --prefix=/usr/local/hdf5 ... + (AKC - 2011/05/07 - HDFFV-7583) + +* The parallel test, t_shapesame, in testpar/, may run for a long time and may + be terminated by the alarm signal. If that happens, one can increase the + alarm seconds (default is 1200 seconds = 20 minutes) by setting the + environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If + it does, it will waste more time if $HDF5_ALARM_SECONDS is set + to a larger value. + (AKC - 2011/05/07) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD. + (QAK - 2011/04/26) + +* Shared Fortran libraries are not quite working on AIX. While they are + generated when --enable-shared is specified, the fortran and hl/fortran + tests fail. We are looking into the issue. HL and C++ shared libraries + should now be working as intended, however. + (MAM - 2011/04/20) + +* The --with-mpe configure option does not work with Mpich2. + (AKC - 2011/03/10) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or file systems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + (NAF - 2011/01/19) + +* The library's test dt_arith.c showed a compiler's rounding problem on + Cygwin when converting from unsigned long long to long double. The + library's own conversion works fine. We defined a macro for Cygwin to + skip this test until we can solve the problem. + (SLU - 2010/05/05 - HDFFV-1264) + +* All the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added in. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as + it is (see bug report #1279). Quincey will make a plan for 1.10. + (SLU - 2010/02/02) + +* MinGW has a missing libstdc++.dll.a library file and will not successfully link + C++ applications/tests. Do not use the enable-cxx configure option. Read all of + the INSTALL_MINGW.txt file for all restrictions. + (ADB - 2009/11/11) + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + (MAM - 2009/11/04) + +* The PathScale MPI implementation, accessing a Panasas file system, would + cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file does not + exist. This is due to the MPI_File_open() call failing if the mode has + the MPI_MODE_EXCL bit set. + (AKC - 2009/08/11 - HDFFV-988) + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. + (CMC - 2009/04/28) + +* For Red Storm, a Cray XT3 system, the tools/h5ls/testh5ls.sh and + tools/h5copy/testh5copy.sh will fail some of its sub-tests. These sub-tests + are expected to fail and should exit with a non-zero code but the yod + command does not propagate the exit code of the executables. Yod always + returns 0 if it can launch the executable. The test suite shell expects + a non-zero for this particular test, therefore it concludes the test has + failed when it receives 0 from yod. Skip all the "failing" test for now + by changing them as following. + + ======== Original tools/h5ls/testh5ls.sh ========= + TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ======== Change to =============================== + echo SKIP TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ================================================== + + ======== Original tools/h5copy/testh5copy.sh ========= + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + H5LSTEST $FILEOUT + ======== Change to =============================== + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + echo SKIP H5LSTEST $FILEOUT + ================================================== + (AKC - 2008/11/10) + +* For Red Storm, a Cray XT3 system, the yod command sometimes gives the + message, "yod allocation delayed for node recovery". This interferes with + test suites that do not expect to see this message. See the section of "Red + Storm" in file INSTALL_parallel for a way to deal with this problem. + (AKC - 2008/05/28) + +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be + verified with t_mpi test under testpar. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + (SLU - 2005/06/30) + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command `poe'. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. + Lastly, request IBM to provide a means to run poe without the debug socket. + (AKC - 2004/12/08) + + +%%%%1.8.8%%%% + + +HDF5 version 1.8.8 released on 2011-11-15 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.7 and +HDF5 1.8.8, and contains information on the platforms tested and +known problems in HDF5-1.8.8. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.8 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.8 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.8 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.8 (current +release) versus Release 1.8.7": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.7 +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + + Configuration + ------------- + - Added the --enable-fortran2003 flag to enable Fortran2003 support + in the HDF5 Fortran library. The flag should be used along with the + --enable-fortran flag and takes affect only when the Fortran compiler + is Fortran2003 compliant. (EIP - 2011/11/14) + - Added checks for clock_gettime and mach/mach_time.h to both configure and + CMake. This will support the move from gettimeofday to clock_gettime's + monotonic timer in the profiling code in a future release. + (DER - 2011/10/12) + + Library + ------- + - The Windows VFD code has been removed with the exception of the functions + which set it (H5Pset_fapl_windows, for example). Setting the Windows + VFD now really sets the SEC2 VFD. The WINDOWS_MAX_BUF and + WINDOWS_USE_STDIO configuration options and #defines have also been + removed. NOTE: Since the Windows VFD was a clone of the SEC2 VFD, this + change should be transparent to users. + (DER - 2011/10/12 - HDFFV-7740, HDFFV-7744) + - H5Tcreate now supports the string type (fixed-length and variable- + length). (SLU - 2011/05/20) + + Parallel Library + ---------------- + - Added new H5Pget_mpio_actual_chunk_opt_mode and + H5Pget_mpio_actual_io_mode API routines for querying whether/how + a collective I/O operation completed. (QAK - 2011/10/12) + + Tools + ----- + - None + + High-Level APIs + --------------- + - Added the following Fortran wrappers for the Dimension Scale APIs: + h5dsset_scale_f + h5dsattach_scale_f + h5dsdetach_scale_f + h5dsis_attached_f + h5dsis_scale_f + h5dsset_label_f + h5dsget_label_f + h5dsget_scale_name_f + h5dsget_num_scales_f + (EIP for SB - 2011/10/13 - HDFFV-3797) + + Fortran API + ----------- + - The HDF5 Fortran library was enhanced to support the Fortran 2003 standard. + The following features are available when the HDF5 library is configured + using the --enable-fortran and --enable-fortran2003 configure flags AND + if the Fortran compiler is Fortran 2003 compliant: + + - Subroutines overloaded with the C_PTR derived type: + h5pget_f + h5pget_fill_value_f + h5pinsert_f + h5pregister_f + h5pset_f + h5pset_fill_value_f + h5rcreate_f + h5rderefrence_f + h5rget_name_f + h5rget_obj_type_f + - Subroutines overloaded with the C_PTR derived type + and simplified signatures: + h5aread_f + h5awrite_f + h5dread_f + h5dwrite_f + - New subroutines + h5dvlen_reclaim_f + h5literate_by_name_f + h5literate_f + h5ovisit_f + h5tconvert_f + h5pset_nbit_f + h5pset_scaleoffset_f + - Subroutines with additional optional parameters: + h5pcreate_class_f + (EIP - 2011/10/14) + + C++ API + ------- + - None + + +Support for New Platforms, Languages, and Compilers +=================================================== + - None + +Bug Fixes since HDF5-1.8.7 +========================== + + Configuration + ------------- + - Changed the size of H5_SIZEOF_OFF_T to 4 bytes (was 8) in the VMS + h5pubconf.h based on the output of a test program. (DER - 2011/10/12) + - The Windows and VMS versions of H5pubconf.h were brought into sync with + the linux/posix version. (DER - 2011/10/12) + - Fixed a bug in the bin/trace Perl script where API functions + that take a variable number of arguments were not processed for + trace statement fixup. (DER - 2011/08/25) + - The --enable-h5dump-packed-bits configure option has been removed. + The h5dump code that this option conditionally enabled is now always + compiled into h5dump. Please refer to the h5dump reference manual for + usage of the packed bits feature. (MAM - 2011/06/23 - HDFFV-7592) + - Configure now uses the same flags and symbols in its tests that are + used to build the library. (DER - 2011/05/24) + + Library + ------- + - Corrected the error when copying attributes between files which are using + different versions of the file format. (QAK - 2011/10/20 - HDFFV-7718) + - Corrected the error when loading local heaps from the file, which could + cause the size of the local heap's data block to increase dramatically. + (QAK - 2011/10/14 - HDFFV-7767) + - An application does not need to do H5O_move_msgs_forward() when writing + attributes. Tests were checked into the performance suite. + (VC - 2011/10/13 - HDFFV-7640) + - Fixed a bug that occurred when using H5Ocopy on a committed datatype + containing an attribute using that committed datatype. + (NAF - 2011/10/13 - HDFFV-5854) + - Added generic VFD I/O types to the SEC2 and log VFDs to ensure correct + I/O sizes (and remove compiler warnings) between Windows and true POSIX + systems. (DER - 2011/10/12) + - Corrected some Windows behavior in the SEC2 and log VFDs. This mainly + involved datatype correctness fixes, Windows API call error checks, + and adding the volume serial number to the VFD cmp functions. + (DER - 2011/10/12) + - Converted post-checks for the appropriate POSIX I/O sizes to pre-checks + in order to avoid platform-specific or undefined behavior. + (DER - 2011/10/12) + - #ifdef _WIN32 instances have been changed to #ifdef H5_HAVE_WIN32_API. + H5_HAVE_VISUAL_STUDIO checks have been added where necessary. This is in + CMake only as configure never sets _WIN32. (ADB - 2011/09/12) + - CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + discovered 3 problems in tests and tools' library: + 1. In dsets.c, left shifting an unsigned int for 32 bits or more + caused undefined behavior. + 2. In dt_arith.c, the INIT_INTEGER macro definition has an overflow + when the value is a negative minimal and is being subtracted from one. + 3. In tools/lib/h5tools_str.c, right shifting an int value for 32 bits + or more caused undefined behavior. + All the problems have been corrected. (SLU - 2011/09/02 - HDFFV-7674) + - H5Epush2() now has the correct trace functionality (this is related to the + bin/trace Perl script bug noted in the configure section). + (DER - 2011/08/25) + - Corrected mismatched function name typo of h5pget_dxpl_mpio_c and + h5pfill_value_defined_c. (AKC - 2011/08/22 - HDFFV-7641) + - Corrected an internal error in the library where objects that use committed + (named) datatypes and were accessed from two different file IDs could confuse + the two and cause erroneous failures. (QAK - 2011/07/18 - HDFFV-7638) + - In v1.6 of the library, there was an EOA for the whole MULTI file saved in the + super block. We took it out in v1.8 of the library because it's meaningless + for the MULTI file. v1.8 of the library saves the EOA for the metadata file + instead, but this caused a backward compatibility problem. + A v1.8 library couldn't open the file created with the v1.6 library. We + fixed the problem by checking the EOA value to detect the file + created with v1.6 library. (SLU - 2011/06/22) + - When a dataset had filters and reading data failed, the error message + didn't say which filter wasn't registered. It's fixed now. (SLU - 2011/06/03) + + Parallel Library + ---------------- + - The Special Collective IO (IO when some processes do not contribute to the + IO) and the Complex Derived Datatype MPI functionalities are no longer + conditionally enabled in the library by configure. They are always + enabled in order to take advantage of performance boosts from these + behaviors. Older MPI implementations that do not allow for these + functionalities can no longer by used by HDF5. + (MAM - 2011/07/08 - HDFFV-7639). + + Tools + ----- + - h5diff: fixed segfault over non-comparable attribute with different + dimention or rank, along with '-c' option to display details. + (JKM - 2011/10/24 - HDFFV-7770) + - Fixed h5diff to display all the comparable objects and attributes + regardless of detecting non-comparables. (JKM - 2011/09/16 - HDFFV-7693) + - Fixed h5repack to update the values of references(object and region) of + attributes in h5repack for 1) references, 2) arrays of references, + 3) variable-length references, and 4) compound references. + (PC - 2011/09/14 - HDFFV-5932) + - h5diff: fixed a segfault over a dataset with container types + array and variable-length (vlen) along with multiple nested compound types. + Example: compound->array->compound, compound->vlen->compound. + (JKM - 2011/09/01 - HDFFV-7712) + - h5repack: added macro to handle a failure in H5Dread/write when memory + allocation failed inside the library. (PC - 2011/08/19) + - Fixed h5jam to not to allow the specifying of an HDF5 formatted file as + an input file for the -u (user block file) option. The original HDF5 file + would not be accessible if this behavior was allowed. + (JKM - 2011/08/19 - HDFFV-5941) + - Revised the command help pages of h5jam and h5unjam. The descriptions + were not up to date and some were missing. + (JKM - 2011/08/15 - HDFFV-7515) + - Fixed h5dump to correct the schema location: + + (ADB - 2011/08/10) + - h5repack: h5repack failed to copy a dataset if the layout is changed + from chunked with unlimited dimensions to contiguous. + (PC - 2011/07/15 - HDFFV-7649) + - Fixed h5diff: the "--delta" option considers two NaN of the same type + are different. This is wrong based on the h5diff description in the + Reference Manual. (PC - 2011/07/15 - HDFFV-7656) + - Fixed h5diff to display an instructive error message and exit with + an instructive error message when mutually exclusive options + (-d, -p and --use-system-epsilon) are used together. + (JKM - 2011/07/07 - HDFFV-7600) + - Fixed h5dump so that it displays the first line of each element in correct + position for multiple dimention array types. Before this fix, + the first line of each element in an array was + displayed after the last line of previous element without + moving to the next line (+indentation). + (JKM - 2011/06/15 - HDFFV-5878) + - Fixed h5dump so that it will display the correct value for + H5T_STD_I8LE datasets on the Blue-gene system (ppc64, linux, Big-Endian, + clustering). (AKC & JKM - 2011/05/12 - HDFFV-7594) + - Fixed h5diff to compare a file to itself correctly. Previously h5diff + reported either the files were different or not compatible in certain + cases even when comparing a file to itself. This fix also improves + performance when comparing the same target objects through verifying + the object and file addresses before comparing the details + in the objects. Examples of details are datasets and attributes. + (XCAO & JKM - 2011/05/06 - HDFFV-5928) + + F90 API + ------- + - Modified the h5open_f and h5close_f subroutines to not to call H5open + and H5close correspondingly. While the H5open call just adds overhead, + the H5close call called by a Fortran application shuts down the HDF5 + library. This makes the library inaccessible to the application. + (EIP & SB - 2011/10/13 - HDFFV-915) + - Fixed h5tget_tag_f where the length of the C string was used to + repack the C string into the Fortran string. This lead to memory + corruption in the calling program. (SB - 2011/07/26) + - Added defined constants: + H5T_ORDER_MIXED_F (HDFFV-2767) + H5Z_SO_FLOAT_DSCALE_F + H5Z_SO_FLOAT_ESCALE_F + H5Z_SO_INT_F + H5Z_SO_INT_MINBITS_DEFAULT_F + H5O_TYPE_UNKNOWN_F + H5O_TYPE_GROUP_F + H5O_TYPE_DATASET_F + H5O_TYPE_NAMED_DATATYPE_F + H5O_TYPE_NTYPES_F + + C++ API + ------ + - None + + High-Level APIs: + ------ + - Fixed the H5LTdtype_to_text function. It had some memory problems when + dealing with some complicated data types. (SLU - 2011/10/19 - HDFFV-7701) + - Fixed H5DSset_label seg faulting when retrieving the length of a + dimension label that was not set. (SB - 2011/08/07 - HDFFV-7673) + - Fixed a dimension scale bug where if you create a dimscale, attach two + datasets to it, and then unattach them, you get an error if they are + unattached in order, but no error if you unattach them in reverse order. + (SB - 2011/06/07 - HDFFV-7605) + + Fortran High-Level APIs: + ------ + - None + + +Platforms Tested +================ +The following platforms and compilers have been tested for this release. + + AIX 5.3 xlc 10.1.0.5 + (NASA G-ADA) xlC 10.1.0.5 + xlf90 12.1.0.6 + + FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719 + (loyalty) g++ 4.2.1 [FreeBSD] 20070719 + gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + FreeBSD 8.2-STABLE amd64 gcc 4.2.1 [FreeBSD] 20070719 + (freedom) g++ 4.2.1 [FreeBSD] 20070719 + gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + IBM Blue Gene/P bgxlc 9.0.0.9 + (LLNL uDawn) bgxlf90 11.1.0.7 + bgxlC 9.0.0.9 + + Linux 2.6.16.60-0.54.5-smp Intel(R) C, C++, Fortran Compilers + x86_64 Version 11.1 20090630 + (INL Icestorm) + + Linux 2.6.18-194.el5 x86_64 Intel(R) C, C++, Fortran Compilers + (INL Fission) Version 12.0.2 20110112 + + Linux 2.6.18-108chaos x86_64 Intel(R) C, C++, Fortran Compilers + (LLNL Aztec) Version 11.1 20090630 + + Linux 2.6.18-194.3.1.el5PAE gcc (GCC) 4.1.2 and 4.4.2 + #1 SMP i686 i686 i386 GNU Fortran (GCC) 4.1.2 20080704 + (jam) (Red Hat 4.1.2-48) and 4.4.2 + PGI C, Fortran, C++ 10.4-0 32-bit + PGI C, Fortran, C++ 10.6-0 32-bit + Intel(R) C Compiler for 32-bit + applications, Version 11.1 + Intel(R) C++ Compiler for 32-bit + applications, Version 11.1 + Intel(R) Fortran Compiler for 32-bit + applications, Version 11.1 + MPICH mpich2-1.3.1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + Linux 2.6.18-238.12.1.el5 gcc 4.1.2 and 4.4.2 + #1 SMP x86_64 GNU/Linux GNU Fortran (GCC) 4.1.2 20080704 + (koala) (Red Hat 4.1.2-46) and 4.4.2 + tested for both 32- and 64-bit binaries + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64, + Version 11.1. + PGI C, Fortran, C++ Version 9.0-4 + for 64-bit target on x86-64 + MPICH mpich2-1.3.1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + SGI Altix UV Intel(R) C, Fortran Compilers + SGI ProPack 7 Linux Version 11.1 20100806 + 2.6.32.24-0.2.1.2230.2.PTF- SGI MPT 2.02 + default #1 SMP + (NCSA ember) + + Dell NVIDIA Cluster Intel(R) C, Fortran Compilers + Red Hat Enterprise Linux 6 Version 12.0.4 20110427 + 2.6.32-131.4.1.el6.x86_64 mvapich2 1.7rc1-intel-12.0.4 + (NCSA forge) + + SunOS 5.10 32- and 64-bit Sun C 5.11 SunOS_sparc 2010/08/13 + Sun Fortran 95 8.5 SunOS_sparc 2010/08/13 + Sun C++ 5.11 SunOS_sparc 2010/08/13 + + Windows XP Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 (cmake) + Cygwin(1.7.9 native gcc(4.5.3) compiler and gfortran) + + Windows XP x64 Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 (cmake) + Cygwin(1.7.9 native gcc(4.5.3) compiler and gfortran) + + Windows Vista Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + + Windows Vista x64 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + + Windows 7 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + + Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + + Mac OS X 10.8.0 (Intel 64-bit) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) + Darwin Kernel Version 10.8.0 GNU Fortran (GCC) 4.6.1 + Intel C, C++ and Fortran compilers 12.1.0 + + Mac OS X 10.8.0 (Intel 32-bit) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) + Darwin Kernel Version 10.8.0 GNU Fortran (GCC) version 4.6.1 + Intel C, C++ and Fortran compilers 12.1.0 + + Fedora 12 2.6.32.16-150.fc12.ppc64 #1 SMP ppc64 GNU/Linux + gcc (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10) + GNU Fortran (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10) + + Debian6.0.3 2.6.32-5-686 #1 SMP i686 GNU/Linux + gcc (Debian 4.4.5-8) 4.4.5 + GNU Fortran (Debian 4.4.5-8) 4.4.5 + + Debian6.0.3 2.6.32-5-amd64 #1 SMP x86_64 GNU/Linux + gcc (Debian 4.4.5-8) 4.4.5 + GNU Fortran (Debian 4.4.5-8) 4.4.5 + + Fedora15 2.6.40.6-0.fc15.i686.PAE #1 SMP i686 i686 i386 GNU/Linux + gcc (GCC) 4.6.1 20110908 (Red Hat 4.6.1-9) + GNU Fortran (GCC) 4.6.1 20110908 (Red Hat 4.6.1-9) + + Fedora15 2.6.40.6-0.fc15.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.6.1 20110908 (Red Hat 4.6.1-9) + GNU Fortran (GCC) 4.6.1 20110908 (Red Hat 4.6.1-9) + + SUSE 11.4 2.6.37.6-0.7-desktop #1 SMP PREEMPT i686 i686 i386 GNU/Linux + gcc (SUSE Linux) 4.5.1 20101208 + GNU Fortran (SUSE Linux) 4.5.1 20101208 + + SUSE 11.4 2.6.37.6-0.7-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.5.1 20101208 + GNU Fortran (SUSE Linux) 4.5.1 20101208 + + Ubuntu 11.10 3.0.0-12-generic #20-Ubuntu SMP i686 GNU/Linux + gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 + GNU Fortran (Ubuntu/Linaro 4.6.4-9ubuntu3) 4.6.1 + + Ubuntu 11.10 3.0.0-12-generic #20-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 + GNU Fortran (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 + + OpenVMS Alpha 8.3 HP C V7.3-009 + HP Fortran V8.2-104679-48H9K + HP C++ V7.3-009 + + Cray Linux Environment (CLE) PrgEnv-pgi 2.2.74 + hopper.nersc.gov pgcc 11.7-0 64-bit target on x86-64 Linux -tp k8e + franklin.nersc.gov pgf90 11.7-0 64-bit target on x86-64 Linux -tp k8e + pgCC 11.7-0 64-bit target on x86-64 Linux -tp k8e + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +Solaris2.10 32-bit n y n y y y +Solaris2.10 64-bit n y n y y y +Windows XP n y(4) n y y y +Windows XP x64 n y(4) n y y y +Windows Vista n y(4) n y y y +Windows Vista x64 n y(4) n y y y +OpenVMS Alpha n y n y y n +Mac OS X 10.8 Intel 32-bit n y n y y y +Mac OS X 10.8 Intel 64-bit n y n y y y +AIX 5.3 32- and 64-bit n y n y y y +FreeBSD 8.2-STABLE 32&64 bit n x n x y y +CentOS 5.5 Linux 2.6.18-194 i686 GNU (1)W y y(2) y y y y +CentOS 5.5 Linux 2.6.18-194 i686 Intel W n y n y y n +CentOS 5.5 Linux 2.6.18-194 i686 PGI W n y n y y n +CentOS 5.5 Linux 2.6.16 x86_64 GNU (1) W y y(3) y y y y +CentOS 5.5 Linux 2.6.16 x86_64 Intel W n y n y y n +CentOS 5.5 Linux 2.6.16 x86_64 PGI W n y n y y y +Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 n y n y y y +SGI ProPack 7 Linux 2.6.32.24 y y y y y y +Red Hat Enterprise Linux 6 y y y y y y +CLE hopper.nersc.gov y y(3) y y y n +CLE franklin.nersc.gov y y(3) y y y n + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +Windows XP y y(4) y n +Windows XP x64 y y(4) y n +Windows Vista y y(4) y y +Windows Vista x64 y y(4) y y +OpenVMS Alpha n n n n +Mac OS X 10.8 Intel 32-bit y(5) n y n +Mac OS X 10.8 Intel 64-bit y(5) n y n +AIX 5.3 32- and 64-bit n n n y +FreeBSD 8.2-STABLE 32&64 bit y x x y +CentOS 5.5 Linux 2.6.18-128 i686 GNU (1)W y y(2) y y +CentOS 5.5 Linux 2.6.18-128 i686 Intel W y y y n +CentOS 5.5 Linux 2.6.18-128 i686 PGI W y y y n +CentOS 5.5 Linux 2.6.16 x86_64 GNU (1) W y y y y +CentOS 5.5 Linux 2.6.16 x86_64 Intel W y y y n +CentOS 5.5 Linux 2.6.16 x86_64 PGI W y y y n +Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 y y y y +SGI ProPack 7 Linux 2.6.32.24 y y y n +Red Hat Enterprise Linux 6 y y y n +CLE hopper.nersc.gov n n n n +CLE franklin.nersc.gov n n n n + + (1) Fortran compiled with gfortran. + (2) With PGI and Absoft compilers. + (3) With PGI compiler for Fortran. + (4) Using Visual Studio 2008 w/ Intel Fortran 10.1 (Cygwin shared libraries are not supported) + (5) C and C++ shared libraries will not be built when Fortran is enabled. + Compiler versions for each platform are listed in the preceding + "Platforms Tested" table. + + +Known Problems +============== + +* The STDIO VFD does not work on some architectures, possibly due to 32/64 + bit or large file issues. The basic STDIO VFD test is known to fail on + 64-bit SunOS 5.10 on SPARC when built with -m64 and 32-bit OS X/Darwin + 10.7.0. The STDIO VFD test has been disabled while we investigate and + a fix should appear in a future release, possibly 1.8.9. + (DER - 2011/10/14) + +* h5diff can report inconsistent results when comparing datasets of enum type + that contain invalid values. This is due to how enum types are handled in + the library and will be addressed in the next release. + (DER - 2011/10/14 - HDFFV-7527) + +* The links test can fail under the stdio VFD due to some issues with external + links. This will be investigated and fixed in a future release. + (DER - 2011/10/14 - HDFFV-7768) + +* After the shared library support was fixed for some bugs, it was discovered + that "make prefix=XXX install" no longer works for shared libraries. It + still works correctly for static libraries. Therefore, if you want to + install the HDF5 shared libraries in a location such as /usr/local/hdf5, + you need to specify the location via the --prefix option during configure + time. E.g, ./configure --prefix=/usr/local/hdf5 ... + (AKC - 2011/05/07 - HDFFV-7583) + +* The parallel test, t_shapesame, in testpar/, may run for a long time and may + be terminated by the alarm signal. If that happens, one can increase the + alarm seconds (default is 1200 seconds = 20 minutes) by setting the + environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If + it does, it will waste more time if $HDF5_ALARM_SECONDS is set + to a larger value. (AKC - 2011/05/07) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD. + (QAK - 2011/04/26) + +* Shared Fortran libraries are not quite working on AIX. While they are + generated when --enable-shared is specified, the fortran and hl/fortran + tests fail. We are looking into the issue. HL and C++ shared libraries + should now be working as intended, however. (MAM - 2011/04/20) + +* The --with-mpe configure option does not work with Mpich2. (AKC - 2011/03/10) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or file systems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + (NAF - 2011/01/19) + +* The library's test dt_arith.c showed a compiler's rounding problem on + Cygwin when converting from unsigned long long to long double. The + library's own conversion works fine. We defined a macro for Cygwin to + skip this test until we can solve the problem. + (SLU - 2010/05/05 - HDFFV-1264) + +* All the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added in. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as + it is (see bug report #1279). Quincey will make a plan for 1.10. + (SLU - 2010/02/02) + +* MinGW has a missing libstdc++.dll.a library file and will not successfully link + C++ applications/tests. Do not use the enable-cxx configure option. Read all of + the INSTALL_MINGW.txt file for all restrictions. (ADB - 2009/11/11) + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + (MAM - 2009/11/04) + +* The PathScale MPI implementation, accessing a Panasas file system, would + cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file does not + exist. This is due to the MPI_File_open() call failing if the mode has + the MPI_MODE_EXCL bit set. (AKC - 2009/08/11 - HDFFV-988) + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. (CMC - 2009/04/28) + +* For Red Storm, a Cray XT3 system, the tools/h5ls/testh5ls.sh and + tools/h5copy/testh5copy.sh will fail some of its sub-tests. These sub-tests + are expected to fail and should exit with a non-zero code but the yod + command does not propagate the exit code of the executables. Yod always + returns 0 if it can launch the executable. The test suite shell expects + a non-zero for this particular test, therefore it concludes the test has + failed when it receives 0 from yod. Skip all the "failing" test for now + by changing them as following. + + ======== Original tools/h5ls/testh5ls.sh ========= + TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ======== Change to =============================== + echo SKIP TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ================================================== + + ======== Original tools/h5copy/testh5copy.sh ========= + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + H5LSTEST $FILEOUT + ======== Change to =============================== + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + echo SKIP H5LSTEST $FILEOUT + ================================================== + (AKC - 2008/11/10) + +* For Red Storm, a Cray XT3 system, the yod command sometimes gives the + message, "yod allocation delayed for node recovery". This interferes with + test suites that do not expect to see this message. See the section of "Red + Storm" in file INSTALL_parallel for a way to deal with this problem. + (AKC - 2008/05/28) + +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be + verified with t_mpi test under testpar. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + (SLU - 2005/06/30) + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command `poe'. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. + Lastly, request IBM to provide a means to run poe without the debug socket. + (AKC - 2004/12/08) + + +%%%%1.8.7%%%% + + +HDF5 version 1.8.7 released on Tue May 10 09:24:44 CDT 2011 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.6 and +HDF5 1.8.7, and contains information on the platforms tested and +known problems in HDF5-1.8.7. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.7 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.7 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.7 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.7 (current +release) versus Release 1.8.6": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.6 +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + + Configuration + ------------- + - Configure now generates Makefiles that build in "silent make mode" + by default in which compile and link lines are significantly + simplified for clarity. To override this and view actual compile and + link lines during building, the --disable-silent-rules flag can be used + at configure time, or the 'make' command can be followed by V=1, to + indicate a "verbose" make. (MAM - 2011/4/14). + - Added mpicc and mpif90 as the default C and Fortran compilers for Linux + systems when --enable-parallel is specified but no $CC or $FC is defined. + (AKC - 2011/2/7) + - Added a new configure option, "--enable-unsupported", which can + be used to stop configure from preventing the use of unsupported + configure option combinations, such as c++ in parallel or Fortran + with threadsafe. Use at your own risk, as it may result in a + library that won't compile or run as expected! + (MAM - 2010/11/17 - Bug 2061) + + Library + ------- + - The library allows the dimension size of a dataspace to be zero. In + the past, the library would allow this only if the maximal dimension + size was unlimited. Now there is no such restriction, but no data + can be written to this kind of dataset. (SLU - 2011/4/20) + - We added two new macros, H5_VERSION_GE and H5_VERSION_LE, to let users + compare certain version numbers with the library being used. (SLU - + 2011/4/20) + - Added ability to cache files opened through external links. Added new + public functions H5Pset_elink_file_cache_size(), + H5Pget_elink_file_cache_size(), and H5Fclear_elink_file_cache(). + (NAF - 2011/02/17) + - Finished implementing all options for 'log' VFD. (QAK - 2011/1/25) + - Removed all old code for Metrowerks compilers, bracketed by + __MWERKS__). Metrowerks compiler is long gone. (AKC - 2010/11/17) + + Parallel Library + ---------------- + - None + + Tools + ----- + - h5diff: Added new "verbose with levels" option, '-vN, --verbose=N'. + The old '-v, --verbose' option is deprecated but remains available; + it is exactly equivalent to '-v0, --verbose=0'. + The new levels 1 ('-v1' or '--verbose=1') and 2 ('-v2' or + '--verbose=2') can be specified to view more information regarding + attributes differences. Bug #2121 (JKM 2011/3/23) + - h5dump: Added new option --enable-error-stack. This option will + display error stack information in the output stream. This is + useful when the "h5dump: Unable to print data" message is output. + (ADB - 2011/03/03) + + High-Level APIs + --------------- + - Fortran LT make datasets routines (H5LTmake_dataset_f, + h5ltmake_dataset_int_f, h5ltmake_dataset_float_f, h5ltmake_dataset_double_f) + and LT read datasets routines (h5ltread_dataset_f,h5ltread_dataset_int_f, + h5ltread_dataset_float_f, 5ltread_dataset_double_f) can now handle + 4-dimensional to 7-dimensional rank datasets. HDFFV-1217 (MSB-2011/4/24/2011) + + F90 API + ------- + - None + + C++ API + ------- + - None + + +Support for New Platforms, Languages, and Compilers +=================================================== + - Intel V11.1 uses now -O3 optimization in production mode (EIP - 2010/10/08) + + + +Bug Fixes since HDF5-1.8.6 +========================== + + Configuration + ------------- + - Shared C++ and HL libraries on AIX should now be working correctly. + Note that Fortran shared libraries are still not working on AIX. + (See the Known Problems section, below). (MAM - 2011/4/20) + - Removed config/ibm-aix6.x. All IBM-AIX settings are in one file, + ibm-aix. (AKC - 2011/4/14) + - Shared C libraries are no longer disabled on Mac when Fortran + is enabled. Shared Fortran libraries are still not supported on Mac, + so configure will disable them by default, but this is overrideable + with the new --enable-unsupported configure option. The configure + summary has been updated to reflect the fact that the shared-ness of + the C++/Fortran wrapper libraries may not align with the C library. + (MAM - 2011/04/11 - HDFFV-4353). + + Library + ------- + - Changed assertion failure when decoding a compound datatype with no + fields into a normal error failure. Also prohibit using this sort + of datatype for creating an attribute (as is already the case for + datasets and committed (named) datatypes). (QAK - 2011/04/15, Jira + issue #HDFFV-2766) + - Tell the VFL flush call that the file will be closing, allowing + the VFDs to avoid sync'ing the file (particularly valuable in parallel). + (QAK - 2011/03/09) + - The datatype handler created with H5Tencode/decode used to have the + reference count 0 (zero); it now has the reference count 1 (one). + (SLU - 2011/2/18) + - Fixed the definition of H5_HAVE_GETTIMEOFDAY on Windows so that + HDgettimeofday() is defined and works properly. Bug HDFFV-5931 + (DER - 2011/04/14) + - Added basic VFD tests for the Windows, STDIO and log VFD tests. + (DER - 2011/04/11) + + Parallel Library + ---------------- + - None + + Tools + ----- + - Updated h5dump test case script to prevent entire test failure when + source directory is read-only. Bug #HDFFV-4342 (JKM 2011/4/12) + - Fixed h5dump displaying incorrect values for H5T_STD_I8BE type data in + attribute on Big-Endian machine. H5T_STD_I8BE is unsigned 8bit type, + so h5dump is supposed to display -2 instead of 254. It worked correctly + on Little-Endian system , but not on Big-Endian system. Bug #HDFFV-4358 + (JKM 04/08/2011) + - Updated some HDF5 tools to standardize the option name as + '--enable-error-stack' for printing HDF5 error stack messages. h5ls and + h5dump have been updated. For h5ls, this replaces "-e/--errors" option, + which is deprecated. For h5dump, this is a new option. Bug #2182 + (JKM 2011/3/30) + - Fixed the h5diff --use-system-epsilon option. The formula used in the + calculation was changed from ( |a - b| / b ) to ( |a - b| ). + This was done to improve performance. Bug #2184 (JKM 2011/3/24) + - Fixed output for H5T_REFERENCE in h5dump. According to the BNF document + the output of a H5T_REFERENCE should be followed by the type; + ::= H5T_REFERENCE { } + ::= H5T_STD_REF_OBJECT | H5T_STD_REF_DSETREG + Previously this was only displayed if the -R option was used. + Bug #1725 (ADB 2011/3/28) + - Fixed two h5diff issues. 1) h5diff compared attributes correctly only + when two objects had the same number of attributes and the attribute + names were identical. 2) h5diff did not display useful information about + attribute differences. Bug #2121 (JKM 2011/3/17) + - Fixed a memory leak in h5diff that occurred when accessing symbolic links + with the --follow-symlink option. Bug #2214 (JKM 2011/3/18) + - Fixed a memory leak in h5diff that occurred when accessing variable length + string data. Bug #2216 (JKM 2011/3/18) + - Fixed and improved the help page for h5ls -a, --address option. + Bug #1904 (JKM 2011/3/11) + - Fixed h5copy to enable copying an object into the same HDF5 file. + Previously h5copy displayed an error message when the target file + was the same as the source file. (XCAO 2011/3/8) + - Fixed an h5dump problem that caused the tool to skip some data elements + in large datasets with a large array datatype on Windows. This issue + arose only on Windows due to the different return behavior of the + _vsnprintf() function. Bug #2161 (JKM 2011/3/3) + - Fixed h5dump which was skipping some array indices in large datasets + with a relatively large array datatype. The interval of skipped indices + varied according to the size of the array. Bug #2092 (JKM 2011/2/15) + - Fixed h5diff which was segfaulting when comparing compound datasets + with a combination of fixed-length string datatypes and variable-length + string datatypes in certain orders. Bug #2089 (JKM 2010/12/28) + - Improved h5diff performance. 1) Now use HDmemcmp() before comparing two + elements. 2) Replace expensive H5Tequals() calls. 3) Retrieve datatype + information at dataset level, not at each element level for compound + datasets. HDFFV-7516 (JKM 2011/4/18) + - Fixed h5ls to display nested compound types with curly brackets + when -S (--simple) option is used with -l (--label), so it shows + which members (in curly brackets) belong to which nested compound type, + making the output clearer. Bug #1979 (JKM 2010/11/09) + - Fixed h5diff to handle variable-length strings in a compound dataset + and variable-length string arrays in a compound dataset correctly. + Garbage values were previously displayed when h5diff compared multiple + variable-length strings in a compound type dataset. + Bug #1989 (JKM 2010/10/28) + - Fixed h5copy to fail gracefully when copying an object to a non- + existing group without the -p option. Bug #2040 (JKM 2010/10/18) + + F90 API + ------ + - None + + C++ API + ------ + - None + + High-Level APIs: + ------ + - None + + Fortran High-Level APIs: + ------ + - h5tbmake_table_f: Fixed error in passing an array of characters with different + length field names. + - h5tget_field_info_f: Fixed error with packing the C strings into a Fortran + array of strings. Added optional argument called 'maxlen_out' which returns + the maximum string character length in a field name element. + Bug HDFFV-1255 (MSB- 4/17/2011) + + + + +Platforms Tested +================ +The following platforms and compilers have been tested for this release. + + AIX 6.1 xlc 11.1.0.3 + (NCSA BP) xlC 11.1.0.3 + xlf90 13.1.0.3 + mpcc_r 11.1.0.3 + mpxlf90_r 13.1.0.3 + + FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719 + (loyalty) g++ 4.2.1 [FreeBSD] 20070719 + gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + FreeBSD 8.2-STABLE amd64 gcc 4.2.1 [FreeBSD] 20070719 + (freedom) g++ 4.2.1 [FreeBSD] 20070719 + gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + Linux 2.6.18-194.3.1.el5PAE gcc (GCC) 4.1.2 and 4.4.2 + #1 SMP i686 i686 i386 G95 (GCC 4.0.3 (g95 0.93!) Apr 21 2010) + (jam) GNU Fortran (GCC) 4.1.2 20080704 + (Red Hat 4.1.2-48) and 4.4.2 + PGI C, Fortran, C++ 10.4-0 32-bit + PGI C, Fortran, C++ 10.6-0 32-bit + Intel(R) C Compiler for 32-bit + applications, Version 11.1 + Intel(R) C++ Compiler for 32-bit + applications, Version 11.1 + Intel(R) Fortran Compiler for 32-bit + applications, Version 11.1 + Absoft 32-bit Fortran 95 10.0.7 + MPICH mpich2-1.3.1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + Linux 2.6.18-194.17.1.el5 gcc 4.1.2 and 4.4.2 + #1 SMP x86_64 GNU/Linux G95 (GCC 4.0.3 (g95 0.93!) Apr 21 2010) + (amani) tested for both 32- and 64-bit binaries + GNU Fortran (GCC) 4.1.2 20080704 + (Red Hat 4.1.2-46) and 4.4.2 + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64, + Version 11.1. + PGI C, Fortran, C++ Version 9.0-4 + for 64-bit target on x86-64 + MPICH mpich2-1.3.1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + SGI ProPack 7 Linux Intel(R) C++ Version 11.1 20100806 + 2.6.32.24-0.2.1.2230.2.PTF- Intel(R) Fortran Version 11.1 20100806 + default #1 SMP SGI MPT 2.01 + SGI Altix UV + (NCSA ember) + + SunOS 5.10 32- and 64-bit Sun C 5.9 Sun OS_sparc Patch 124867-16 + (linew) Sun Fortran 95 8.3 Sun OS_sparc Patch 127000-13 + Sun C++ 5.9 Sun OS_sparc Patch 124863-26 + Sun C 5.10 SunOS_sparc Patch 141861-07 + Sun Fortran 95 8.4 SunOS_sparc Patch 128231-06 + Sun C++ 5.10 SunOS_sparc 128228-11 + + Intel Xeon Linux 2.6.18- gcc 4.2.4 + 92.1.10.el5_lustre.1.6.6smp- Intel(R) C++ Version 10.1.017 + perfctr #8 SMP Intel(R) Fortran Compiler Version 10.1.017 + (NCSA abe) Open MPI 1.3.2 + MVAPICH2-1.5.1_pgi-10.8 + + Windows XP Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 (cmake) + Cygwin(1.7.7 native gcc(4.3.4) compiler and gfortran) + + Windows XP x64 Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 (cmake) + Cygwin(1.7.7 native gcc(4.3.4) compiler and gfortran) + + Windows Vista Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + + Windows Vista x64 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + + Windows 7 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + + Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + + Mac OS X 10.7.0 (Intel 64-bit) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 + Darwin Kernel Version 10.7.0 GNU Fortran (GCC) 4.6.0 20101106 (experimental) + Intel C, C++ and Fortran compilers 12.0.1.122 20101110 + + Mac OS X 10.7.0 (Intel 32-bit) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) + Darwin Kernel Version 10.7.0 GNU Fortran (GCC) version 4.4.0 20090123 (experimental) + [trunk revision 143587] + + Fedora 12 2.6.32.16-150.fc12.ppc64 #1 SMP ppc64 GNU/Linux + gcc (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10) + GNU Fortran (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10) + + Debian6.01 2.6.32-5-686 #1 SMP i686 GNU/Linux + gcc (Debian 4.4.5-8) 4.4.5 + GNU Fortran (Debian 4.4.5-8) 4.4.5 + + Debian6.01 2.6.32-5-amd64 #1 SMP x86_64 GNU/Linux + gcc (Debian 4.4.5-8) 4.4.5 + GNU Fortran (Debian 4.4.5-8) 4.4.5 + + Fedora14 2.6.35.12-88.fc14.i686.PAE #1 SMP i686 i686 i386 GNU/Linux + gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) + GNU Fortran (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) + + Fedora14 2.6.35.12-88.fc14.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) + GNU Fortran (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) + + SUSE 11.4 2.6.37.1-1.2-desktop #1 SMP PREEMPT i686 i686 i386 GNU/Linux + gcc (SUSE Linux) 4.5.1 20101208 + GNU Fortran (SUSE Linux) 4.5.1 20101208 + + SUSE 11.4 2.6.37.1-1.2-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.5.1 20101208 + GNU Fortran (SUSE Linux) 4.5.1 20101208 + + Ubuntu 10.10 2.6.35-28-generic #50-Ubuntu SMP i686 GNU/Linux + gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 + GNU Fortran (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 + + Ubuntu 10.10 2.6.35-28-generic #50-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 + GNU Fortran (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 + + OpenVMS Alpha 8.3 HP C V7.3-009 + HP Fortran V8.2-104679-48H9K + HP C++ V7.3-009 + +Tested Configuration Features Summary +======================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +Solaris2.10 32-bit n y n y y y +Solaris2.10 64-bit n y n y y y +Windows XP n y(4) n y y y +Windows XP x64 n y(4) n y y y +Windows Vista n y(4) n y y y +Windows Vista x64 n y(4) n y y y +OpenVMS Alpha n y n y y n +Mac OS X 10.7 Intel 32-bit n y n y y y +Mac OS X 10.7 Intel 64-bit n y n y y y +AIX 6.1 32- and 64-bit y y y y y y +FreeBSD 8.2-STABLE 32&64 bit n x n x y y +CentOS 5.5 Linux 2.6.18-194 i686 GNU (1)W y y(2) y y y y +CentOS 5.5 Linux 2.6.18-194 i686 Intel W n y n y y n +CentOS 5.5 Linux 2.6.18-194 i686 PGI W n y n y y n +CentOS 5.5 Linux 2.6.16 x86_64 GNU (1) W y y(3) y y y y +CentOS 5.5 Linux 2.6.16 x86_64 Intel W n y n y y n +CentOS 5.5 Linux 2.6.16 x86_64 PGI W n y n y y y +RedHat EL4 2.6.18 Xeon Lustre C y y y y y n +Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 n y n y y y +SGI Linux 2.6.32.19 y y y y y y + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +Windows XP y y(4) y n +Windows XP x64 y y(4) y n +Windows Vista y y(4) y y +Windows Vista x64 y y(4) y y +OpenVMS Alpha n n n n +Mac OS X 10.7 Intel 32-bit y(5) n y n +Mac OS X 10.7 Intel 64-bit y(5) n y n +AIX 6.1 32- and 64-bit n n n y +FreeBSD 8.2-STABLE 32&64 bit y x x y +CentOS 5.5 Linux 2.6.18-128 i686 GNU (1)W y y(2) y y +CentOS 5.5 Linux 2.6.18-128 i686 Intel W y y y n +CentOS 5.5 Linux 2.6.18-128 i686 PGI W y y y n +CentOS 5.5 Linux 2.6.16 x86_64 GNU (1) W y y y y +CentOS 5.5 Linux 2.6.16 x86_64 Intel W y y y n +CentOS 5.5 Linux 2.6.16 x86_64 PGI W y y y n +RedHat EL4 2.6.18 Xeon Lustre C y y y n +Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 y y y y +SGI Linux 2.6.32.19 y y y y + + (1) Fortran compiled with gfortran. + (2) With PGI and Absoft compilers. + (3) With PGI compiler for Fortran. + (4) Using Visual Studio 2008 w/ Intel Fortran 10.1 (Cygwin shared libraries are not supported) + (5) C and C++ shared libraries will not be built when Fortran is enabled. + Compiler versions for each platform are listed in the preceding + "Platforms Tested" table. + + +Known Problems +============== +* After the shared library support was fixed for some bugs, it was discovered + that "make prefix=XXX install" no longer works for shared libraries. It + still works correctly for static libraries. Therefore, if you want to + install the HDF5 shared libraries in a location such as /usr/local/hdf5, + you need to specify the location via the --prefix option during configure + time. E.g, ./configure --prefix=/usr/local/hdf5 ... + (AKC - 2011/05/07 HDFFV-7583) + +* The parallel test, t_shapesame, in testpar/, may run for a long time and may + be terminated by the alarm signal. If that happens, one can increase the + alarm seconds (default is 1200 seconds = 20 minutes) by setting the + environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If + it does, it will waste more time if $HDF5_ALARM_SECONDS is set + to a larger value. (AKC - 2011/05/07) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD. + (QAK - 2011/04/26) + +* Shared Fortran libraries are not quite working on AIX. While they are + generated when --enable-shared is specified, the fortran and hl/fortran + tests fail. We are looking into the issue. HL and C++ shared libraries + should now be working as intended, however. (MAM - 2011/04/20) + +* The --with-mpe configure option does not work with Mpich2. AKC - 2011/03/10 + +* If parallel gmake (e.g., gmake -j 4) is used, the "gmake clean" command + sometimes fails in the perform directory due to the attempt to remove the + executable of h5perf or h5perf_serial by two "parallel" commands. This error + has no consequence on the functionality of the HDF5 library or install. It + is fixed in the next release. AKC - 2011/01/25 + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or file systems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + +* The library's test dt_arith.c showed a compiler's rounding problem on + Cygwin when converting from unsigned long long to long double. The + library's own conversion works fine. We defined a macro for Cygwin to + skip this test until we can solve the problem. Please see bug #1813. + SLU - 2010/5/5 + +* All the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added in. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as + it is (see bug report #1279). Quincey will make a plan for 1.10. + SLU - 2010/2/2 + +* MinGW has a missing libstdc++.dll.a library file and will not successfully link + C++ applications/tests. Do not use the enable-cxx configure option. Read all of + the INSTALL_MINGW.txt file for all restrictions. ADB - 2009/11/11 + +* The PathScale MPI implementation, accessing a Panasas file system, would + cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file does not + exist. This is due to the MPI_File_open() call failing if the mode has + the MPI_MODE_EXCL bit set. (See bug 1468 for details.) AKC - 2009/8/11 + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. CMC - 2009/04/28 + +* For Red Storm, a Cray XT3 system, the tools/h5ls/testh5ls.sh and + tools/h5copy/testh5copy.sh will fail some of its sub-tests. These sub-tests + are expected to fail and should exit with a non-zero code but the yod + command does not propagate the exit code of the executables. Yod always + returns 0 if it can launch the executable. The test suite shell expects + a non-zero for this particular test, therefore it concludes the test has + failed when it receives 0 from yod. Skip all the "failing" test for now + by changing them as following. + + ======== Original tools/h5ls/testh5ls.sh ========= + TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ======== Change to =============================== + echo SKIP TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ================================================== + + ======== Original tools/h5copy/testh5copy.sh ========= + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + H5LSTEST $FILEOUT + ======== Change to =============================== + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + echo SKIP H5LSTEST $FILEOUT + ================================================== + AKC - 2008/11/10 + +* For Red Storm, a Cray XT3 system, the yod command sometimes gives the + message, "yod allocation delayed for node recovery". This interferes with + test suites that do not expect to see this message. See the section of "Red + Storm" in file INSTALL_parallel for a way to deal with this problem. + AKC - 2008/05/28 + +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be + verified with t_mpi test under testpar. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + SLU - 2005/6/30 + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command `poe'. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. + Lastly, request IBM to provide a means to run poe without the debug socket. + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + +* There is also a configure error on Altix machines that incorrectly reports + when a version of Szip without an encoder is being used. + +* On cobalt, an SGI Altix SMP ia64 system, Intel compiler version 10.1 (which + is the default on that system) does not work properly and results in + failures during make check (in a static build) and make installcheck (during + a shared build). This appears to be a compiler optimization problem. + Reducing optimization by setting CFLAGS to -O1 or below resolves the issue. + Alternatively, using a newer version of the compiler (11.0) also works as + intended. MAM - 2010/06/01 + +* h5diff will not report enum value differences when one or both of the values + is not a valid enumeration value. The source of this bug has been identified + and it will be fixed in 1.8.8. DER - 2011/04/27 + + +%%%%1.8.6%%%% + + +HDF5 version 1.8.6 released on Mon Feb 14 10:26:30 CST 2011 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.5 and +HDF5 1.8.6, and contains information on the platforms tested and +known problems in HDF5-1.8.6. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.6 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.6 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.6 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.6 (current +release) versus Release 1.8.5": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.5 +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + + Configuration + ------------- + - CMake: Improved CPack packaging, added parallel commands, improved + configuration options (better similarity to configure), added more + tests, better support for use in external cmake projects. + (ADB - 2010/10/07) + - The default configuration setting for official releases is + --enable-production. For unofficial releases, the default configuration + setting has been --disable-production. (AKC - 2010/05/28) + Library + ------- + - Added support for thread safety on Windows using the Windows threads + library. Use the HDF5_ENABLE_THREADSAFE option in CMake on a Windows + platform to enable this functionality. This is supported on Windows + Vista and newer Windows operating systems. (MAM - 2010/09/10) + - H5Tset_order and H5Tget_order now support all datatypes. A new byte + order, H5T_ORDER_MIXED, has been added specifically for a compound + datatype and its derived type. (SLU - 2010/8/23) + - Improved performance of metadata I/O by changing the default algorithm + to perform I/O from all processes (instead of just process 0) when using + parallel I/O drivers. (QAK - 2010/07/19) + - Improved performance of I/O on datasets with the same shape, but + different rank. (QAK - 2010/07/19) + - Improved performance of the chunk cache by avoiding unnecessary b-tree + lookups of chunks already in cache. (NAF - 2010/06/15) + + Parallel Library + ---------------- + - None + + Tools + ----- + - h5diff: Added a new flag: --exclude-path. The specified path to an + object will be excluded when comparing two files or two groups. If a + group is specified to be excluded, all member objects of that group + will be excluded. (JKM - 2010/09/16). + - h5ls: Added a new flag: --no-dangling-links. See --help output for + details. (JKM - 2010/06/15) + - h5ls: Added a new flag --follow-symlinks. See --help output for + details. (JKM - 2010/05/25) + + High-Level APIs + --------------- + - None + + F90 API + ------- + - None + + C++ API + ------- + - None + + +Support for New Platforms, Languages, and Compilers +=================================================== + - Sun C and C++ 5.10 and Sun Fortran 95 8.4. + - Mac OS X 10.6.4 with gcc 4.2.1 and gfortran 4.6 + + +Bug Fixes since HDF5-1.8.5 +========================== + + Configuration + ------------- + - The default number of MPI processes for testing purposes has been + changed from 3 to 6. (AKC - 2010/11/11) + - Some tests in tools/h5repack may fail in AIX systems when -q32 mode is + used. The error is caused by not requesting enough memory in default. + Added "env LDR_CNTRL=MAXDATA=0x20000000@DSA" into the $RUNSERIAL and + $RUNPARALLE in the AIX config file so that executables are tested with + more memory. (AKC - 2010/11/11) + - Removed recognition of the parallel compilers of LAM(hcc) and + ChMPIon(cmpicc) since we have no access to these two MPI implementations + and cannot verify their correctness. (AKC - 2010/07/14 - Bug 1921) + - PHDF5 was changed to use "mpiexec" instead of mpirun as the default + MPI applications startup command as defined in the MPI-2 definition, + section 4.1. (AKC - 2010/06/11 - Bug 1921) + + Library + ------- + - Fixed a bug that caused big endian machines to generate corrupt files + when using the scale-offset filter with floating point data or fill + values. Note that such datasets will no longer be readable by any + by any machine after this patch. (NAF - 2010/02/02 - Bug 2131) + - Retrieving a link's name by index in the case where the link is external + and the file that the link refers to doesn't exist will now fail + gracefully rather than cause a segmentation fault. (MAM - 2010/11/17) + - Modified metadata accumulator to better track accumulated dirty metadata + in an effort to reduce unnecessary I/O in certain situations and to + fix some other corner cases which were prone to error. (MAM - 2010/10/15) + - Added a new set of unit tests that are run during 'make check' to verify + the behavior of the metadata accumulator. (MAM - 2010/10/15) + - Modified library to always cache symbol table information. Libraries + from version 1.6.3 and earler have a bug which causes them to require + this information for some operations. (NAF - 2010/09/21 - Bug 1864) + - Fixed a bug where the library could generate an assertion/core dump when + a file that had been created with H5Pset_libver_bounds(fapl, + H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) but didn't have a superblock + extension was later reopened. (QAK - 2010/09/16 - Bug 1968) + - Fixed a bug that could occur when getting information for a new-style + group that was previously opened through a file handle that was later + closed. (NAF - 2010/09/15) + - Added define check in H5public.h if stdint.h is supported by the C++ + compiler. This define is only available on Windows with VS2010 and using + CMake to build the library. (ADB - 2010/09/13 - Bug 1938) + - When a mandatory filter failed to write data chunks, the dataset + couldn't close (bug 1260). The fix releases all resources and closes + the dataset but returns a failure. (SLU - 2010/09/08) + - H5Eset_current_stack now also closes the error stack set as the + default. This is to avoid a potential problem. + (SLU - 2010/09/07 - Bug 1799) + - Corrected situation where 1-D chunked dataset could get created by an + application without calling H5Pset_chunk(). H5Pset_chunk is now + required for creating all chunked datasets. (QAK - 2010/09/02) + - Fixed many memory issues that valgrind exposed. (QAK - 2010/08/24) + - Fixed the bug in the filter's public CAN_APPLY function. The return + value should be htri_t not herr_t. (SLU - 2010/08/05 - Bug 1239) + - Fixed the STDIO VFD to use fseeko64 instead of fseek64 for 64-bit I/O + support. (AKC - 2010/7/30) + - Fixed a bug in the direct I/O driver that could render files with certain + kinds of unaligned data unreadable or corrupt them. (NAF - 2010/07/28) + - valgrind reported an error of copying data to itself when a new attribute + is written. Fixed by taking out the memcpy step in the attribute code. + (SLU - 2010/07/28 - Bug 1956) + - Corrected various issues in the MPI datatype creation code which could + cause resource leaks or incorrect behavior (and may improve the + performance as well). (QAK - 2010/07/19) + - Fixed a bug that could cause file corruption when using non-default sizes + of addresses and/or lengths. This bug could also cause uncorrupted files + with this property to be unreadable. This bug was introduced in 1.8.5. + (NAF - 2010/07/16 - Bug 1951) + + Parallel Library + ---------------- + - None + + Tools + ----- + - Fixed h5diff to compare member objects and groups recursively when + two files or groups are compared. (JKM - 2010/9/16 - Bug 1975) + - Fixed h5repack to be able to convert a dataset to COMPACT layout. + (JKM - 2010/09/15 - Bug 1896) + - Changed h5ls to not interpret special characters in object or attribute + names for output. (JKM - 2010/06/28 - Bug 1784) + - Revised the order of arguments for h5cc, h5fc, h5c++, h5pcc and h5pfc. + CPPFLAGS, CFLAGS, LDFLAGS, and LIBS have been duplicated with an H5BLD_ + prefix to put the flags and paths from the hdf5 build in the correct + places and allow the script user to add entries in CPPFLAGS, CFLAGS, + LDFLAGS, and LIBS that will take precedence over those from the hdf5 + build. The user can make these entries persistent by editing + CFLAGSBASE, CPPFLAGSBASE, LDFLAGSBASE, and LIBSBASE near the top of + the script or temporary by setting HDF5_CFLAGS, HDF5_CPPFLAGS, + HDF5_LDFLAGS, or HDF5_LIBS in the environment. The new order of + arguments in these scripts is $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS + $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args + $shared_link. (LRK - 2010/10/25 - Bug 1973) + + F90 API + ------ + - None + + C++ API + ------ + - None + + High-Level APIs: + ------ + - None + + Fortran High-Level APIs: + ------ + - None + + +Platforms Tested +================ +The following platforms and compilers have been tested for this release. + + AIX 6.1 xlc 11.1.0.3 + (NCSA BP) xlC 11.1.0.3 + xlf 13.1.0.3 + mpcc_r 11.1.0.3 + mpxlf_r 13.1.0.3 + + FreeBSD 6.3-STABLE i386 gcc 3.4.6 [FreeBSD] 20060305 + (duty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.4.5 20100803 + g++ 4.4.5 20100803 + gfortran 4.4.5 20100803 + + FreeBSD 6.3-STABLE amd64 gcc 3.4.6 [FreeBSD] 20060305 + (liberty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.4.5 20100803 + g++ 4.4.5 20100803 + gfortran 4.4.5 20100803 + + Linux 2.6.18-194.3.1.el5PAE gcc (GCC) 4.1.2 and 4.4.2 + #1 SMP i686 i686 i386 G95 (GCC 4.0.3 (g95 0.93!) Apr 21 2010) + (jam) GNU Fortran (GCC) 4.1.2 20080704 + (Red Hat 4.1.2-48) and 4.4.2 + PGI C, Fortran, C++ 10.4-0 32-bit + PGI C, Fortran, C++ 10.6-0 32-bit + Intel(R) C Compiler for 32-bit + applications, Version 11.1 + Intel(R) C++ Compiler for 32-bit + applications, Version 11.1 + Intel(R) Fortran Compiler for 32-bit + applications, Version 11.1 + Absoft 32-bit Fortran 95 10.0.7 + MPICH mpich2-1.3.1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + Linux 2.6.18-194.17.1.el5 gcc 4.1.2 and 4.4.2 + #1 SMP x86_64 GNU/Linux G95 (GCC 4.0.3 (g95 0.93!) Apr 21 2010) + (amani) tested for both 32- and 64-bit binaries + GNU Fortran (GCC) 4.1.2 20080704 + (Red Hat 4.1.2-46) and 4.4.2 + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64, + Version 11.1. + PGI C, Fortran, C++ Version 9.0-4 + for 64-bit target on x86-64 + MPICH mpich2-1.3.1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + SGI ProPack 7 Linux Intel(R) C++ Version 11.1 20100806 + 2.6.32.19-0.3.1.1982.0.PTF- Intel(R) Fortran Version 11.1 20100806 + default #1 SMP SGI MPT 2.01 + SGI Altix UV + (NCSA ember) + + SunOS 5.10 32- and 64-bit Sun C 5.9 Sun OS_sparc Patch 124867-16 + (linew) Sun Fortran 95 8.3 Sun OS_sparc Patch 127000-13 + Sun C++ 5.9 Sun OS_sparc Patch 124863-62 + Sun C 5.10 SunOS_sparc Patch 141861-07 + Sun Fortran 95 8.4 SunOS_sparc Patch 128231-06 + Sun C++ 5.10 SunOS_sparc 128228-11 + + Intel Xeon Linux 2.6.18- gcc 4.2.4 + 92.1.10.el5_lustre.1.6.6smp- Intel(R) C++ Version 10.1.017 + perfctr #8 SMP Intel(R) Fortran Compiler Version 10.1.017 + (NCSA abe) Open MPI 1.3.2 + MVAPICH2-1.5.1_pgi-10.8 + + Windows XP Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 (cmake) + Cygwin(1.7.7 native gcc(4.3.4) compiler and gfortran) + + Windows XP x64 Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + Visual Studio 2010 (cmake) + Cygwin(1.7.7 native gcc(4.3.4) compiler and gfortran) + + Windows Vista Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + + Windows Vista x64 Visual Studio 2008 w/ Intel Fortran 10.1 (project files) + Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + + Windows 7 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + + Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) + + Mac OS X 10.6.3 (Intel 64-bit) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 + Darwin Kernel Version 10.3.1 GNU Fortran (GCC) 4.5.0 20090910 + Intel C, C++ and Fortran compilers 11.1 20100806 + + Mac OS X 10.6.4 (Intel 32-bit) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 + Darwin Kernel Version 10.4.0 GNU Fortran (GCC) 4.6.0 20101106 + Intel C, C++ and Fortran compilers 12.0.0 20101110 + + Mac OS X 10.6.4 (Intel 64-bit) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659) + Darwin Kernel Version 10.6.0 GNU Fortran (GCC) 4.5.0 20090910 + Intel C, C++ and Fortran compilers 11.1 20100806 + + Fedora 12 2.6.32.16-150.fc12.ppc64 #1 SMP ppc64 GNU/Linux + gcc (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10) + GNU Fortran (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10) + + Debian5.06 2.6.26-2-686 #1 SMP i686 GNU/Linux + gcc (Debian 4.3.2-1.1) 4.3.2 + GNU Fortran (Debian 4.3.2-1.1) 4.3.2 + + Debian5.06 2.6.26-2-amd64 #1 SMP x86_64 GNU/Linux + gcc (Debian 4.3.2-1.1) 4.3.2 + GNU Fortran (Debian 4.3.2-1.1) 4.3.2 + + Fedora14 2.6.35.6-48.fc14.i686.PAE #1 SMP i686 i686 i386 GNU/Linux + gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) + GNU Fortran (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) + + Fedora14 2.6.35.6-48.fc14.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) + GNU Fortran (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) + + SUSE 11.3 2.6.34.7-0.7-desktop #1 SMP PREEMPT i686 i686 i386 GNU/Linux + gcc (SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292] + GNU Fortran (SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292] + + SUSE 11.3 2.6.34.7-0.7-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292] + GNU Fortran (SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292] + + Ubuntu 10.10 2.6.35-25-generic #44-Ubuntu SMP i686 GNU/Linux + gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 + GNU Fortran (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 + + Ubuntu 10.10 2.6.35-25-generic #44-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 + GNU Fortran (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 + + OpenVMS Alpha 8.3 HP C V7.3-009 + HP Fortran V8.2-104679-48H9K + HP C++ V7.3-009 + +Tested Configuration Features Summary +======================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +Solaris2.10 32-bit n y n y y y +Solaris2.10 64-bit n y n y y y +Windows XP n y(4) n y y y +Windows XP x64 n y(4) n y y y +Windows Vista n y(4) n y y y +Windows Vista x64 n y(4) n y y y +OpenVMS Alpha n y n y y n +Mac OS X 10.6 Intel n y n y y y +AIX 6.1 32- and 64-bit y y y y y y +FreeBSD 6.3-STABLE 32&64 bit n y n y y y +CentOS 5.5 Linux 2.6.18-194 i686 GNU (1)W y y(2) y y y y +CentOS 5.5 Linux 2.6.18-194 i686 Intel W n y n y y n +CentOS 5.5 Linux 2.6.18-194 i686 PGI W n y n y y n +CentOS 5.5 Linux 2.6.16 x86_64 GNU (1) W y y(3) y y y y +CentOS 5.5 Linux 2.6.16 x86_64 Intel W n y n y y n +CentOS 5.5 Linux 2.6.16 x86_64 PGI W n y n y y y +RedHat EL4 2.6.18 Xeon Lustre C y y y y y n +Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 n y n y y y +SGI Linux 2.6.32.19 y y y y y y + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +Windows XP y y(4) y n +Windows XP x64 y y(4) y n +Windows Vista y y(4) y y +Windows Vista x64 y y(4) y y +OpenVMS Alpha n n n n +Mac OS X 10.6 y(5) n y n +AIX 6.1 32- and 64-bit n n n y +FreeBSD 6.3-STABLE 32&64 bit y n y y +CentOS 5.5 Linux 2.6.18-128 i686 GNU (1)W y y(2) y y +CentOS 5.5 Linux 2.6.18-128 i686 Intel W y y y n +CentOS 5.5 Linux 2.6.18-128 i686 PGI W y y y n +CentOS 5.5 Linux 2.6.16 x86_64 GNU (1) W y y y y +CentOS 5.5 Linux 2.6.16 x86_64 Intel W y y y n +CentOS 5.5 Linux 2.6.16 x86_64 PGI W y y y n +RedHat EL4 2.6.18 Xeon Lustre C y y y n +Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 y y y y +SGI Linux 2.6.32.19 y y y y + + (1) Fortran compiled with gfortran. + (2) With PGI and Absoft compilers. + (3) With PGI compiler for Fortran. + (4) Using Visual Studio 2008 w/ Intel Fortran 10.1 (Cygwin shared libraries are not supported) + (5) C and C++ shared libraries will not be built when Fortran is enabled. + Compiler versions for each platform are listed in the preceding + "Platforms Tested" table. + + +Known Problems +============== +* examples/run-all-ex.sh does not work on Cygwin. (NAF - 2011/02/11) + +* Parallel test, t_shapesame in testpar, is rather unstable as it continues to + have occasional errors in AIX and quite often in NCSA Abe. It is being built + but it is not run automatically in the "make check" command. One would have to + run it by hand to see if it works in a particular machine. AKC - 2011/01/28 + +* Although OpenVMS Alpha is supported, there are several problems with the C + test suite - getname.c, lheap.c, lheap.c, mtime.c, and stab.c. The test + suite for h5diff also fails. These failures are from the tests, not the + library. We have fixed these failures. But it's too late to put the fixes + into this release. If you install the 1.8.6 library, it should still work + despite of these test failures. If you want the working copy without any + test failure, you can request it from us. SLU - 2011/01/26 + +* If parallel gmake (e.g., gmake -j 4) is used, the "gmake clean" command + sometimes fails in the perform directory due to the attempt to remove the + executable of h5perf or h5perf_serial by two "parallel" commands. This error + has no consequence on the functionality of the HDF5 library or install. It + is fixed in the next release. AKC - 2011/01/25 + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or filesystems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + +* The h5diff tool can display garbage values when variable-length strings in + a compound type dataset are compared. This also occurs with variable-length + string arrays in a compound type dataset. See bug #1989. This will be fixed + in the next release. JKM - 2010/11/05 + +* The AIX --enable-shared setting does not quite work. It can produce a shared + library, but there cannot be more than one shared library that is + interlinked. This means that the high level APIs will not work which is not + very useful. We hope to have a solution in the next release. + (AKC - 2010/10/15) + +* H5Eset_auto can cause a seg fault for a library API call if the application + compiles with -DH5_USE_16_API (see bug 1707). It will be fixed in the + next release. SLU - 2010/10/5 + +* The library's test dt_arith.c showed a compiler's rounding problem on + Cygwin when converting an unsigned long long to a long double. The + library's own conversion works fine. We defined a macro for Cygwin to + skip this test until we can solve the problem. Please see bug #1813. + SLU - 2010/5/5 + +* All the VFL drivers aren't backwardly compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. A new parameter was added to the + get_eoa and set_eoa callback functions, and a new callback function + get_type_map was added. The public function H5FDrealloc was taken out in + 1.8. The problem only happens when users define their own driver for 1.6 + and try to plug in a 1.8 library. This will be fixed in 1.10. SLU - 2010/2/2 + +* MinGW has a missing libstdc++.dll.a library file and will not successfully link + C++ applications/tests. Do not use the enable-cxx configure option. Read all of + the INSTALL_MINGW.txt file for all restrictions. ADB - 2009/11/11 + +* The PathScale MPI implementation, accessing a Panasas file system, would + cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file does not + exist. This is due to the MPI_File_open() call failing if the amode has + the MPI_MODE_EXCL bit set. (See bug 1468 for details.) AKC - 2009/8/11 + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. CMC - 2009/04/28 + +* For Red Storm, a Cray XT3 system, the tools/h5ls/testh5ls.sh and + tools/h5copy/testh5copy.sh will fail some of their sub-tests. These + sub-tests are expected to fail and should exit with a non-zero code but + the yod command does not propagate the exit code of the executables. Yod + always returns 0 if it can launch the executable. The test suite shell + expects a non-zero for this particular test. Therefore, it concludes the + test has failed when it receives 0 from yod. To skip all the "failing" + tests for now, change them as shown below. + + ======== Original tools/h5ls/testh5ls.sh ========= + TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ======== Change to =============================== + echo SKIP TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ================================================== + + ======== Original tools/h5copy/testh5copy.sh ========= + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + H5LSTEST $FILEOUT + ======== Change to =============================== + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + echo SKIP H5LSTEST $FILEOUT + ================================================== + AKC - 2008/11/10 + +* For Red Storm, a Cray XT3 system, the yod command sometimes gives the + message "yod allocation delayed for node recovery." This interferes + with test suites that do not expect to see this message. See the "Red Storm" + section in file INSTALL_parallel for a way to deal with this problem. + AKC - 2008/05/28 + +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use the -mp -O1 compilation flags to build the libraries. A higher level + of optimization causes failures in several HDF5 library tests. + +* On mpich 1.2.5 and 1.2.6 on a system using four processors, if more than + two processes contribute no I/O and the application asks to do collective + I/O, we have found that a simple collective write will sometimes hang. This + can be verified with the t_mpi test under testpar. + +* A dataset created or rewritten with a v1.6.3 or later library cannot be + read with the v1.6.2 or earlier library when the Fletcher32 EDC filter + is enabled. There was a bug in the calculation of the Fletcher32 checksum + in the library before v1.6.3; the checksum value was not consistent + between big-endian and little-endian systems. This bug was fixed in + Release 1.6.3. However, after fixing the bug, the checksum value was no + longer the same as before on little-endian system. Library releases after + 1.6.4 can still read datasets created or rewritten with an HDF5 library of + v1.6.2 or earlier. SLU - 2005/6/30 + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command `poe'. To + work around this, set the environment variable MP_INFOLEVEL to 0 to + minimize the messages and run the tests again. The tests may fail with + messages like "The socket name is already in use", but HDF5 does not use + sockets. This failure is due to problems with the poe command trying to + set up the debug socket. To resolve this problem, check to see whether + there are any old /tmp/s.pedb.* files around. These are sockets used by + the poe command and left behind if the command failed at some point. To + resolve this, ask your system administrator to remove the + old/tmp/s.pedb.* files, and then ask IBM to provide a means to run poe + without the debug socket. + +* The --enable-static-exec configure flag will only statically link + libraries if the static version of that library is present. If only the + shared version of a library exists (i.e., most system libraries on + Solaris, AIX, and Mac, for example, only have shared versions), the flag + should still result in a successful compilation, but note that the + installed executables will not be fully static. Thus, the only guarantee + on these systems is that the executable is statically linked with just + the HDF5 library. + +* On an SGI Altix SMP ia64 system, the Intel compiler version 10.1 (which + is the default on that system) does not work properly and results in + failures during the make check (in a static build) and the make + installcheck (in a shared build). This appears to be a compiler + optimization problem. Reducing the optimization by setting CFLAGS to + -O1 or below resolves the issue. Using a newer version of the compiler + (11.0) avoids the issue. MAM - 2010/06/01 + +* On solaris systems, when running the examples with the scripts installed in + .../share/hdf5_examples, two of the c tests, h5_extlink and h5_elink_unix2win + may fail or generate HDF5 errors because the script commands in c/run-c-ex.sh + fail to create test directories red, blue, and u2w. Moving the '!' in lines + 67, 70, 73 of run-c-ex.sh will fix the problem. For example the script command + "if ! test -d red; then" will work on solaris if changed to + "if test ! -d red; then". + + +%%%%1.8.5%%%% + + +HDF5 version 1.8.5 released on Fri Jun 4 13:27:31 CDT 2010 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.4 and HDF5 1.8.5, and +contains information on the platforms tested and known problems in HDF5-1.8.5. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt +in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.5 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.5 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.5 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.5 (current +release) versus Release 1.8.4": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.4 +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + + Configuration + ------------- + - CMake Early Access: This release adds support for building HDF5 using + the CMake system. Initial work has targeted Windows, but other platforms + can be used. See the CMake.TXT file for more information. Version + 2.8.1 of CMake is required. + - Configure now adds appropriate defines for supporting large (64-bit) + files on all systems, where supported, by default, instead of only Linux. + This large file support is controllable with the --enable-largefile + configure option. The Linux-specific --enable-linux-lfs option has been + deprecated in favor of this new option. Please note that specifying + --disable-large does NOT attempt to "turn off" largefile support if it + is natively supported by the compiler, but rather just disables + configure from actively trying to add any additional compiler flags. + (MAM - 2010/05/05 - Bug # 1772/1434) + - Fixed an signal handling mask error in H5detect that might result in + SIGBUS or SIGSEGV failures in some platforms such as Linux on Sparc. + (AKC - 2010/4/28 - Bug # 1764) + - Fixed various "strict aliasing" problems, allowing higher levels + of compiler optimization (in particular, allowing '-O3' to work + with recent versions of GCC). (QAK - 2010/04/26) + - Upgraded versions of autotools used to generate configuration suite. + We now use Automake 1.11.1, Autoconf 2.65, and Libtool 2.2.6b. + (MAM - 2010/04/15) + - Added the xlc-* and mpcc_r-* BASENAME patterns to be recognized as IBM + compilers so that the IBM compiler options can be added properly. This + allows non-system-default compiler command names (e.g. xlc-m.n.k.l) be + recognized. (AKC - 2009/11/26) + + Library + ------- + - Performance is substantially improved when extending a dataset with early + allocation. (NAF - 2010/03/24 - Bug # 1637) + - Added support for filtering densely stored groups. Many of the API + functions related to filters have been extended to support dense groups + as well as datasets. Pipeline messages can now be stored in a group's + object header. (NAF/QAK - 2009/11/3) + + Parallel Library + ---------------- + - None + + Tools + ----- + - h5dump: Added the new packed bits feature which prints packed bits stored + in an integer dataset. (AKC/ADB - 2010/5/7) + - h5diff: Fixed incorrect behavior (hang) in parallel mode when specifying + invalid options (ex: -v and -q). (JKM - 2010/02/17) + - h5diff: Added new flag --no-dangling-links (see --help for details). + (JKM - 2010/02/10) + - h5diff: Added new flag --follow-symlinks (see --help for details). + (JKM - 2010/01/25) + - h5diff: Added a fix to correct the display of garbage values when + displaying big-endian data on a little-endian machine. (JKM - 2009/11/20) + + High-Level APIs + --------------- + - None + + F90 API + ------- + - None + + C++ API + ------- + - New member functions + + Overloaded CommonFG::getObjnameByIdx to take char* for name. + + Overloaded CommonFG::getObjTypeByIdx to return type name as a char*. + (BMR - 2010/05/10) + + Added DataSet::getInMemDataSize() to simplify getting the dataset's + data size in memory. (BMR - 2009/07/26) + + +Support for New Platforms, Languages, and Compilers +=================================================== + - AIX 6.1 has been added. (AKC - 2010/1/4) + + +Bug Fixes since HDF5-1.8.4 +========================== + + Configuration + ------------- + - Fixed various "strict aliasing" problems, allowing higher levels + of compiler optimization (in particular, allowing '-O3' to work + with recent versions of GCC). (QAK - 2010/04/26) + + Library + ------- + - Fixed a file corruption bug that could happen when shrinking a compressed + dataset. (NAF - 2010/05/20) + - Fixed some memory leaks in VL datatype conversion when strings are + used as fill values. (MAM - 2010/05/12 - Bug # 1826) + - Fixed an H5Rcreate failure when passing in a -1 for the dataspace + identifier. (ADB - 2010/4/28) + - Fixed a bug when copying objects with NULL references with the + H5O_COPY_EXPAND_REFERENCE_FLAG flag set. (NAF - 2010/04/08 - Bug # 1815) + - Added a mechanism to the H5I interface to save returned object identifier + structures for immediate re-use if needed. This addresses a potential + performance issue by delaying the case when the next identifier to be + registered has grown so large that it wraps around and needs to be + checked to see whether it is available for distribution. + (MAM - 2010/03/15 - Bug # 1730) + - Files can now be concurrently opened more than once using the core file + driver, as long as the backing store is used. (NAF - 2010/03/09) + - Added support for H5O_COPY_EXPAND_EXT_LINK_FLAG to H5Ocopy. External + links will now be expanded if this flag is set. + (NAF - 2010/03/05 - Bug # 1733) + - Fixed a bug where the library, when traversing an external link, would + reopen the source file if nothing else worked. (NAF - 2010/03/05) + - Fixed a bug where fractal heap identifiers for attributes and shared + object header messages could be incorrectly encoded in the file for + files created on big-endian platforms. + Please see http://www.hdfgroup.org/HDF5/release/known_problems if you + suspect you have a file with this problem. + (QAK - 2010/02/23 - Bug # 1755) + - Fixed an intermittent bug in the b-tree code which could be triggered + by expanding and shrinking chunked datasets in certain ways. + (NAF - 2010/02/16) + - H5Tdetect_class said a VL string is a string type. But when it's in + a compound type, it said it's a VL type. THis has been fixed to be + consistent; it now always returns a string type. + (SLU - 2009/12/10 - Bug # 1584) + - Allow "child" files from external links to be correctly located when + relative to a "parent" file that is opened through a symbolic link. + (QAK - 2009/12/01) + + Parallel Library + ---------------- + - Parallel mode in AIX will fail some of the testcheck_version.sh tests + where it treats "exit(134) the same as if process 0 had received an abort + signal. Fixed. (AKC - 2009/11/3) + + Tools + ----- + - Fixed h5ls to return exit code 1 (error) when a non-existent file is + specified. (JKM - 2010/04/27 - Bug # 1793) + - Fixed h5copy failure when copying a dangling link that is specified + directly. (JKM - 2010/04/22 - Bug # 1817) + - Fixed an h5repack failure that lost attributes from a dataset of + reference type. (JKM - 2010/3/25 - Bug # 1726) + - Fixed h5repack error that set NULL for object reference values for + datasets, groups, or named datatypes. (JKM - 2010/03/19 - Bug # 1814) + + F90 API + ------ + - None + + C++ API + ------ + - The constructor PropList::PropList(id) was fixed to act properly + according to the nature of 'id'. When 'id' is a property class + identifier, a new property list will be created. When 'id' is a + property list identifier, a copy of the property list will be made. + (BMR - 2010/5/9) + - The parameters 'size' and 'bufsize' in CommonFG::getLinkval and + CommonFG::getComment, respectively, now have default values for the + user's convenience. (BMR - 2009/10/23) + - NULL pointer accessing was fixed. (BMR - 2009/10/05 - Bug # 1061) + - Read/write methods of DataSet and Attribute classes were fixed + to handle string correctly. (BMR - 2009/07/26) + + High-Level APIs: + ------ + - Fixed a bug in H5DSattach_scale, H5DSis_attached, and H5DSdetach_scale + caused by using the H5Tget_native_type function to determine the native + type for reading the REFERENCE_LIST attribute. This bug was exposed + on Mac PPC. (EIP - 2010/05/22 - Bug # 1851) + - Fixed a bug in the H5DSdetach_scale function when 0 bytes were + allocated after the last reference to a dimension scale was removed + from the list of references in a VL element of the DIMENSION_LIST + attribute. Modified the function to comply with the specification: + the DIMENSION_LIST attribute is now deleted when no dimension scales + are left attached. (EIP - 2010/05/14 - Bug # 1822) + + Fortran High-Level APIs: + ------ + - None + + +Platforms Tested +================ +The following platforms and compilers have been tested for this release. + + AIX 5.3 xlc 7.0.0.9, 8.0.0.20, 9.0.0.4 + (LLNL Up) xlC 7.0.0.9, 8.0.0.20, 9.0.0.4 + xlf 9.1.0.9, 10.1.0.9, 11.1.0.7 + mpcc_r 7.0.0.9 + mpxlf_r 09.01.0000.0008 + + AIX 6.1 xlc 10.1.0.6 + (NCSA BP) xlC 10.1.0.6 + xlf 12.1.0.7 + + Cray XT3 (2.1.56) cc (pgcc) 10.0-0 + (SNL red storm) ftn (pgf90) 10.0-0 + CC (pgCC) 10.0-0 + + FreeBSD 6.3-STABLE i386 gcc 3.4.6 [FreeBSD] 20060305 + (duty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.3.4 20090419 + g++ 4.3.4 20090419 + gfortran 4.3.4 20090419 + + FreeBSD 6.3-STABLE amd64 gcc 3.4.6 [FreeBSD] 20060305 + (liberty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.4.1 20090421 + g++ 4.4.1 20090421 + gfortran 4.4.1 20090421 + + Linux 2.6.18-128.1.6.el5xen gcc (GCC) 4.1.2 20080704 and 4.4.2 + #1 SMP i686 i686 i386 GNU Fortran (GCC) 4.1.2 20080704 and 4.4.2 + (jam) g++ (GCC) 4.1.2 20080704 and 4.4.2 + G95 (GCC 4.0.3 (g95 0.93!) Apr 21 2010) + Absoft 32-bit Fortran 95 10.0.7 + PGI C, Fortran, C++ 10.4-0 32-bit + Intel(R) C, C++, Fortran Compilers for 32-bit + applications, Version 11.1 Build 20090827 + MPICH mpich2-1.0.8 compiled with + gcc 4.1.2 and GNU Fortran (GCC) 4.1.2 + + Linux 2.6.18-164.el5 #1 SMP gcc 4.1.2 20080704 and gcc 4.4.2 + x86_64 GNU/Linux GNU Fortran (GCC) 4.1.2 20080704 and 4.4.2 + (amani) g++ (GCC) 4.1.2 20080704 and 4.4.2 + G95 (GCC 4.0.3 (g95 0.93!) Apr 21 2010) + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64, + Version 11.1 Build 20090827. + PGI C, Fortran, C++ Version 10.4-0 + for 32 & 64-bit target on x86-64 + MPICH mpich2-1.0.8 compiled with + gcc 4.1.2 and GNU Fortran (GCC) 4.1.2 + + Linux 2.6.16.54-0.2.5 #1 Intel(R) C++ Version 11.0.074 + SGI Altix SMP ia64 Intel(R) Fortran Itanium(R) Version 11.0.074 + (cobalt) SGI MPI 1.38 + + SunOS 5.10 32- and 64-bit Sun C 5.9 SunOS_sparc Patch 124867-14 + (linew) Sun Fortran 95 8.3 SunOS_sparc + Patch 127000-13 + Sun C++ 5.9 SunOS_sparc Patch 124863-23 + + Intel Xeon Linux 2.6.18- Intel(R) C++ Version 10.0.026 + 92.1.10.el5_lustre.1.6.6smp- Intel(R) Fortran Compiler Version 10.0.026 + perfctr #7 SMP Open MPI 1.2.2 + (abe) MVAPICH2-0.9.8p28p2patched-intel-ofed-1.2 + compiled with icc v10.0.026 and ifort 10.0.026 + + Linux 2.6.18-76chaos #1 SMP Intel(R) C, C++, Fortran Compilers for + SMP x86_64 GNU/Linux applications running on Intel(R) 64, + (SNL Glory) Versions 11.1. + + Windows XP Visual Studio 2008 w/ Intel Fortran 10.1 + Cygwin(1.7.5 native gcc(4.3.4) compiler and + gfortran) + + Windows XP x64 Visual Studio 2008 w/ Intel Fortran 10.1 + + Windows Vista Visual Studio 2008 w/ Intel Fortran 10.1 + + Windows Vista x64 Visual Studio 2008 w/ Intel Fortran 10.1 + + MAC OS 10.6.3 (Intel) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 + (pahra) GNU Fortran (GCC) 4.5.0 20090910 + i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 + Intel C, C++ and Fortran compilers 11.1 + + MAC OS 10.5.8 (Intel) i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 + (tejeda) + + MAC OS 10.5 (PPC) powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 + (juniper-w) + + OpenVMS Alpha V8.3 HP C V7.3-009 + HP C++ V7.3-009 + HP Fortran V8.0-1-104669-48GBT + +Supported Configuration Features Summary +======================================== + + In the tables below + y = tested and supported + n = not supported or not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +Solaris2.10 32-bit n y n y y y +Solaris2.10 64-bit n y n y y y +Windows XP n y(4) n(4) y y y +Windows XP x64 n y(4) n(4) y y y +Windows Vista n y(4) n(4) y y y +Windows Vista x64 n y(4) n(4) y y y +Mac OS X 10.5 PPC n n n n y n +Mac OS X 10.5 Intel n y n y y y +Mac OS X 10.6 Intel n y n y y y +AIX 5.3 32- and 64-bit n y n y y n +AIX 6.1 32- and 64-bit n y n y y n +FreeBSD 6.3-STABLE 32&64 bit n y n y y y +RedHat EL4 2.6.9-42 i686 GNU (1) W y y y y y y +RedHat EL5 2.6.18-128 i686 GNU (1)W y y(2) y y y y +RedHat EL5 2.6.18-128 i686 Intel W n y n y y n +RedHat EL5 2.6.18-128 i686 PGI W n y n y y n +SuSe Linux 2.6.16 x86_64 GNU (1) W y y(3) y y y y +SuSe Linux 2.6.16 x86_64 Intel W n y n y y n +SuSe Linux 2.6.16 x86_64 PGI W n y n y y y +SuSe Linux 2.6.16 SGI Altix ia64 C y y y y y y +RedHat EL4 2.6.18 Xeon Lustre C y y y y y n +Cray XT3 2.1.56 y y y y y n +OpenVMS Alpha V8.3 n y n y y n + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +Windows XP y y(4) y n +Windows XP x64 y y(4) y n +Windows Vista y y(4) y n +Windows Vista x64 y y(4) y n +Mac OS X 10.5 PPC y n n n +Mac OS X 10.5 (Intel) y(5) n y n +Mac OS X 10.6 (Intel) y(5) n y n +AIX 5.3 32- and 64-bit n n n n +AIX 6.1 32- and 64-bit n n n n +FreeBSD 6.3-STABLE 32&64 bit y n y y +RedHat EL4 2.6.9-42 i686 GNU (1) W y y y y +RedHat EL5 2.6.18-128 i686 GNU (1)W y y(2) y y +RedHat EL5 2.6.18-128 i686 Intel W y y y n +RedHat EL5 2.6.18-128 i686 PGI W y y y n +SuSe Linux 2.6.16 x86_64 GNU (1) W y y y y +SuSe Linux 2.6.16 x86_64 Intel W y y y n +SuSe Linux 2.6.16 x86_64 PGI W y y y n +SuSe Linux 2.6.16 SGI Altix ia64 C y n +RedHat EL4 2.6.18 Xeon Lustre C y y y n +Cray XT3 2.1.56 n n n n +OpenVMS Alpha V8.3 n n n n + + (1) Fortran compiled with g95. + (2) With PGI and Absoft compilers. + (3) With PGI compiler for Fortran. + (4) Using Visual Studio 2008. (Cygwin shared libraries are not + supported.) + (5) Shared C and C++ are disabled when Fortran is configured in. + Compiler versions for each platform are listed in the preceding + "Platforms Tested" table. + + +Known Problems +============== +* The library's test dt_arith.c exposed a compiler's rounding problem on + Cygwin when converting from unsigned long long to long double. The + library's own conversion works correctly. A macro is defined for Cygwin + to skip this test until we can solve the problem. (Please see bug #1813.) + SLU - 2010/5/5 + +* All the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is a new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug it into a 1.8 library. This affects a very small + number of users. (See bug report #1279.) SLU - 2010/2/2 + +* MinGW has a missing libstdc++.dll.a library file and will not successfully + link C++ applications/tests. Do not use the enable-cxx configure option. + Read all of the INSTALL_MINGW.txt file for all restrictions. + ADB - 2009/11/11 + +* Some tests in tools/h5repack may fail in AIX systems when -q32 mode is used. + The error is due to insufficient memory requested. Request a large amount + of runtime memory by setting the following environment variable for more + memory. + LDR_CNTRL=MAXDATA=0x20000000@DSA + AKC - 2009/10/31 + +* The PathScale MPI implementation, accessing a Panasas file system, would + cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file is not + existing. This is due to the MPI_File_open() call failing if the amode has + the MPI_MODE_EXCL bit set. (See bug 1468 for details.) AKC - 2009/8/11 + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. CMC - 2009/04/28 + +* For gcc v4.3 and v4.4, with production mode, if -O3 is used, H5Tinit.c + would fail to compile. Actually bad H5Tinit.c is produced. If -O (same + as -O1) is used, H5Tinit.c compiled okay but test/dt_arith would fail. + When -O0 (no optimizatio) is used, H5Tinit.c compilete okay and all + tests passed. Therefore, -O0 is imposed for v4.3 and v4.4 of gcc. + AKC - 2009/04/20 + +* For Red Storm, a Cray XT3 system, the tools/h5ls/testh5ls.sh and + tools/h5copy/testh5copy.sh will fail some of its sub-tests. These sub-tests + are expected to fail and should exit with a non-zero code but the yod + command does not propagate the exit code of the executables. Yod always + returns 0 if it can launch the executable. The test suite shell expects + a non-zero for this particular test, therefore it concludes the test has + failed when it receives 0 from yod. Skip all the "failing" test for now + by changing them as following. + + ======== Original tools/h5ls/testh5ls.sh ========= + TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ======== Change to =============================== + echo SKIP TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ================================================== + + ======== Original tools/h5copy/testh5copy.sh ========= + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + H5LSTEST $FILEOUT + ======== Change to =============================== + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + echo SKIP H5LSTEST $FILEOUT + ================================================== + AKC - 2008/11/10 + +* For Red Storm, a Cray XT3 system, the yod command sometimes gives the + message, "yod allocation delayed for node recovery". This interferes with + test suites that do not expect seeing this message. See the section of "Red + Storm" in file INSTALL_parallel for a way to deal with this problem. + AKC - 2008/05/28 + +* On Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be + verified with t_mpi test under testpar. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + SLU - 2005/6/30 + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command `poe'. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + + The tests may fail with messages like "The socket name is already in use," + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. + Lastly, request IBM to provide a means to run poe without the debug socket. + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + +* There is also a configure error on Altix machines that incorrectly reports + when a version of Szip without an encoder is being used. + +* On FREE-BSD systems when shared libraries are disabled, make install fails + in install-examples with the error '"Makefile", line 635: Need an operator'. + When this error occurs removing or commenting out the line "export + LD_LIBRARY_PATH=$(LL_PATH)" (line 635 in examples/Makefile) will allow make + install to finish installing examples. The problem will be fixed in the + next release. LRK - 2010/05/26 + +* On cobalt, an SGI Altix SMP ia64 system, Intel compiler version 10.1 (which + is the default on that system) does not work properly and results in + failures during make check (in a static build) and make installcheck (during + a shared build). This appears to be a compiler optimization problem. + Reducing optimization by setting CFLAGS to -O1 or below resolves the issue. + Alternatively, using a newer version of the compiler (11.0) also works as + intended. MAM - 2010/06/01 + + +%%%%1.8.4%%%% + + +HDF5 version 1.8.4 released on Tue Nov 10 15:33:14 CST 2009 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.3 and +HDF5 1.8.4, and contains information on the platforms tested and +known problems in HDF5-1.8.4 +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.4 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.4 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.4 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.4 (current +release) versus Release 1.8.3": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.3 +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + + Configuration + ------------- + - Configuration suite now uses Automake 1.11 and Autoconf 2.64. + MAM 2009/08/31. + - Changed default Gnu fortran compiler from g95 to gfortran since + gfortran is more likely installed with gcc now. -AKC 2009/07/19- + + Library + ------- + - The embedded library information is displayed by H5check_version() if a + version mismatch is detected. Also changed H5check_version() to + suppress the warning message totally if $HDF5_DISABLE_VERSION_CHECK is 2 + or higher. (Old behavior treated 3 or higher the same as 1, that is + print a warning and allows the program to continue. (AKC - 2009/9/28) + - If a user does not care for the extra library information insert + in the executables, he may turn it off by --disable-embedded-libinfo + during configure. (AKC - 2009/9/15) + + Parallel Library + ---------------- + - None + + Tools + ----- + - h5diff: h5diff treats two INFINITY values different. Fixed by checking + (value==expect) before call ABS(...) at h5diff_array.c. This will make + that (INF==INF) is true (INF is treated as an number instead of NaN) + (PC -- 2009/07/28) + - h5diff: add option "--use-system-epsilon" to print difference if + (|a-b| > EPSILON). + Change default to use strict equality (PC -- 2009/09/12) + + High-Level APIs + --------------- + - None + + F90 API + ------- + - Added H5Oopen_by_addr_f MSB - 9/14/09 + + C++ API + ------- + - None + + +Support for New Platforms, Languages, and Compilers +=================================================== + - PathScale compilers are recognized and can build the HDF5 library + properly. AKC - 2009/7/28 - + + +Bug Fixes since HDF5-1.8.3 +========================== + + Configuration + ------------- + - Removed the following config files, as we no longer support them: + config/dec-osf*, config/hpux11.00, config/irix5.x, + config/powerpc-ibm-aix4.x config/rs6000-ibm-aix5.x config/unicos* + MAM - 2009/10/08 + - Modified configure and make process to properly preserve user's CFLAGS + (and company) environment variables. Build will now properly use + automake's AM_CFLAGS for any compiler flags set by the configure + process. Configure will no longer modify CFLAGS directly, nor will + setting CFLAGS during make completely replace what configure has set up. + MAM - 2009/10/08 + - Support for TFLOPS, config/intel-osf1, is removed since the TFLOPS + machine has long retired. AKC - 2009/10/06. + - Added $(EXEEXT) extension to H5detect when it's executed in the + src/Makefile to generate H5Tinit.c so it works correctly on platforms + that require the full extension when running executables. + MAM - 2009/10/01 - BZ #1613 + - Configure will now set FC and CXX to "no" when fortran and c++ + are not being compiled, respectively, so configure will not run + some of the compiler tests for these languages when they are not + being used. MAM - 2009/10/01 + - The --enable-static-exec flag will now properly place the -static flag + on the link line of all installed executables. This will force the + executable to link with static libraries over shared libraries, provided + the static libraries are available. MAM - 2009/08/31 - BZ #1583 + - The PathScale compiler (v3.2) was mistaken as gcc v4.2.0 but it fails to + recognize some gcc options. Fixed. (see bug 1301). AKC - 2009/7/28 - + + Library + ------- + - Fixed a bug where writing and deleting many global heap objects (i.e. + variable length data) would render the file unreadable. Previously + created files exhibiting this problem should now be readable. + NAF - 2009/10/27 - 1483 + - Fixed error in library's internal caching mechanisms which could cause + an assertion failure (and attendent core dump) when encountering an + unusually formatted file. (QAK - 2009/10/13) + - Fixed incorrect return value for H5Pget_preserve. AKC - 2009/10/08 - 1628 + - Fixed an assertion failure that occurred when H5Ocopy was called on a + dataset using a vlen inside a compound. NAF - 2009/10/02 - 1597 + - Fixed incorrect return value for H5Pget_filter_by_id1/2 in H5Ppublic.h. + NAF - 2009/09/25 - 1620 + - Fixed a bug where properties weren't being compared with the registered + compare callback. NAF - 2009/09/25 - 1555 + - Corrected problem where library would re-write the superblock in a file + opened for R/W access, even when no changes were made to the file. + (QAK - 2009/08/20, Bz#1473) + - Fixed a bug where H5Pget_filter_by_id would succeed when called for a + filter that wasn't present. NAF - 2009/06/25 - 1250 + - Fixed an issue with committed compound datatypes containing a vlen. Also + fixed memory leaks involving committed datatypes. NAF - 2009/06/10 - 1593 + + Parallel Library + ---------------- + - None + + Tools + ----- + - h5dump/h5ls display buffer resize fixed in tools library. + ADB - 2009/7/21 - 1520 + - perf_serial test added to Windows projects and check batch file. + ADB - 2009/06/11 -1504 + + + F90 API + ------ + - Fixed bug in h5lget_info_by_idx_f by adding missing arguments, + consequently changing the API. New API is: + + SUBROUTINE h5lget_info_by_idx_f(loc_id, group_name, index_field, order, n, & + link_type, f_corder_valid, corder, cset, address, val_size, hdferr, lapl_id) + + MSB - 2009/9/17 - 1652 + + - Corrected the values for the H5L_flags FORTRAN constants: + H5L_LINK_ERROR_F, H5L_LINK_HARD_F, H5L_LINK_SOFT_F, H5L_LINK_EXTERNAL_F + MSB - 2009-09-17 - 1653 + + - Added FORTRAN equivalent of C constant H5T_ORDER_NONE: H5T_ORDER_NONE_F + MSB - 2009-9-24 - 1471 + + C++ API + ------ + - None + + High-Level APIs: + ------ + - Fixed a bug where the H5TB API would forget the order of fields when added + out of offset order. NAF - 2009/10/27 - 1582 + - H5DSis_attached failed to account for different platform types. Added a + get native type call. ADB - 2009/9/29 - 1562 + + Fortran High-Level APIs: + ------ + - Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions + had memory problems with the g95 fortran compiler. (PVN � 5/13/2009) 1522 + + + +Platforms Tested +================ +The following platforms and compilers have been tested for this release. + + AIX 5.3 xlc 7.0.0.8 + (LLNL Up) xlf 09.01.0000.0008 + xlC 7.0.0.8 + mpcc_r 7.0.0.8 + mpxlf_r 09.01.0000.0008 + + Cray XT3 (2.0.41) cc (pgcc) 7.1-4 + (SNL red storm) ftn (pgf90) 7.1-4 + CC (pgCC) 7.1-4 + + FreeBSD 6.3-STABLE i386 gcc 3.4.6 [FreeBSD] 20060305 + (duty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.3.5 20091004 + g++ 4.3.5 20091004 + gfortran 4.3.5 20091004 + + FreeBSD 6.3-STABLE amd64 gcc 3.4.6 [FreeBSD] 20060305 + (liberty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.4.2 20091006 + g++ 4.4.2 20091006 + gfortran 4.4.2 20091006 + + Linux 2.6.18-164.el5 gcc (GCC) 4.1.2 20080704 + #1 SMP i686 i686 i386 G95 (GCC 4.0.3 (g95 0.92!) Jun 24 2009) + (jam) GNU Fortran (GCC) 4.1.2 20080704 + (Red Hat 4.1.2-46) + PGI C, Fortran, C++ 8.0-5 32-bit + PGI C, Fortran, C++ 8.0-1 32-bit + Intel(R) C Compiler for 32-bit + applications, Versions 11.0, 11.1 + Intel(R) C++ Compiler for 32-bit + applications, Version 11.0, 11.1 + Intel(R) Fortran Compiler for 32-bit + applications, Version 11.0, 11.1 + Absoft 32-bit Fortran 95 10.0.7 + MPICH mpich2-1.0.8 compiled with + gcc (GCC) 4.1.2 and G95 + (GCC 4.0.3 (g95 0.92!) + + Linux 2.6.18-164.el5 #1 SMP gcc 4.1.2 20080704 + x86_64 GNU/Linux G95 (GCC 4.0.3 (g95 0.92!) Jun 24 2009) + (amani) tested for both 32- and 64-bit binaries + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64, + Versions 11.1. + PGI C, Fortran, C++ Version 9.0-4 + for 64-bit target on x86-64 + gcc 4.1.2 and G95 (GCC 4.0.3 (g95 0.92!) + MPICH mpich2-1.0.8 compiled with + gcc 4.1.2 and G95 (GCC 4.0.3 (g95 0.92!) + GNU Fortran (GCC) 4.1.2 20080704 + (Red Hat 4.1.2-46) + + + Linux 2.6.16.60-0.42.5 #1 Intel(R) C++ Version 10.1.017 + SGI Altix SMP ia64 Intel(R) Fortran Itanium(R) Version 10.1.017 + (cobalt) SGI MPI 1.38 + + SunOS 5.10 32- and 64-bit Sun C 5.9 SunOS_sparc Patch 124867-11 2009/04/30 + (linew) Sun Fortran 95 8.3 SunOS_sparc + Patch 127000-11 2009/10/06 + Sun C++ 5.9 SunOS_sparc + Patch 124863-16 2009/09/15 + + Intel Xeon Linux 2.6.18- Intel(R) C++ Version 10.0.026 + 92.1.10.el5_lustre.1.6.6smp- Intel(R) Fortran Compiler Version 10.0.026 + perfctr #6 SMP Open MPI 1.2.2 + (abe) MVAPICH2-0.9.8p28p2patched-intel-ofed-1.2 + compiled with icc v10.0.026 and ifort 10.0.026 + + IA-64 Linux 2.4.21-309.tg1 gcc (GCC) 3.2.2 + #1 SMP ia64 Intel(R) C++ Version 8.1.037 + (NCSA tg-login) Intel(R) Fortran Compiler Version 8.1.033 + mpich-gm-1.2.7p1..16-intel-8.1.037-r1 + + Linux 2.6.9-55.0.9.EL_lustre Intel(R) C, C++, Fortran Compilers for + .1.4.11.1smp #1 SMP applications running on Intel(R) 64, + SMP x86_64 GNU/Linux Versions 10.1. + (SNL Thunderbird) + + Linux 2.6.18-76chaos #1 SMP Intel(R) C, C++, Fortran Compilers for + SMP x86_64 GNU/Linux applications running on Intel(R) 64, + (SNL Glory) Versions 10.1. + + Windows XP Visual Studio 2005 w/ Intel Fortran 9.1 + Cygwin(native gcc compiler and g95) + + Windows XP x64 Visual Studio 2005 w/ Intel Fortran 9.1 + + Windows Vista Visual Studio 2005 w/ Intel Fortran 9.1 + + Windows Vista x64 Visual Studio 2005 w/ Intel Fortran 9.1 + + MAC OS 10.5.6 (Intel) i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 + GNU Fortran (GCC) 4.3.0 20070810 + G95 (GCC 4.0.3 (g95 0.91!) Apr 24 2008) + Intel C, C++ and Fortran compilers 10.1 + + +Supported Configuration Features Summary +======================================== + + In the tables below + y = tested and supported + n = not supported or not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +Solaris2.10 32-bit n y n y y y +Solaris2.10 64-bit n y n y y y +Windows XP n y(4) n(4) y y y +Windows XP x64 n y(4) n(4) y y y +Windows Vista n n n y y y +Mac OS X 10.5 Intel n y n y y y +AIX 5.3 32- and 64-bit n y n y y n +FreeBSD 6.3-STABLE 32&64 bit n y n y y y +RedHat EL5 2.6.18-164 i686 GNU (1)W y y(2) y y y y +RedHat EL5 2.6.18-164 i686 Intel W n y n y y n +RedHat EL5 2.6.18-164 i686 PGI W n y n y y n +RedHat EL5 2.6.18-164 x86_64 GNU(1)W y y(3) y y y y +RedHat EL5 2.6.18-164 x86_64 IntelW n y n y y n +RedHat EL5 2.6.18-164 x86_64 PGI W n y n y y y +SuSe Linux 2.6.16 SGI Altix ia64 C y y y y y y +RedHat EL4 2.6.18 Xeon Lustre C y y y y y n +SuSe Linux 2.4.21 ia64 Intel C y y y y y n +Cray XT3 2.0.62 y y y y y n + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +Windows XP y y(4) y y +Windows XP x64 y y(4) y y +Windows Vista y n n y +Mac OS X 10.5 y n y n +AIX 5.3 32- and 64-bit n n n n +FreeBSD 6.3-STABLE 32&64 bit y y y y +RedHat EL5 2.6.18-164 i686 GNU (1)W y y(2) y y +RedHat EL5 2.6.18-164 i686 Intel W y y y n +RedHat EL5 2.6.18-164 i686 PGI W y y y n +RedHat EL5 2.6.18-164 x86_64 GNU(1)W y y y y +RedHat EL5 2.6.18-164 x86_64 IntelW y y y n +RedHat EL5 2.6.18-164 x86_64 PGI W y y y n +SuSe Linux 2.6.16 SGI Altix ia64 C y n +RedHat EL4 2.6.18 Xeon Lustre C y y y n +SuSe Linux 2.4.21 ia64 Intel C y y y n +Cray XT3 2.0.62 n n n n + + (1) Fortran compiled with g95. + (2) With PGI and Absoft compilers. + (3) With PGI compiler for Fortran. + (4) Using Visual Studio 2005 or Cygwin + Compiler versions for each platform are listed in the preceding + "Platforms Tested" table. + + +Known Problems +============== +* Parallel mode in AIX will fail some of the testcheck_version.sh tests where + it treats "exit(134) the same as if process 0 had received an abort signal. + This is fixed and will be available in the next release. AKC - 2009/11/3 + +* Some tests in tools/h5repack may fail in AIX systems when -q32 mode is used. + The error is due to insufficient memory requested. Request a large amount + of runtime memory by setting the following environment variable for more + memory. + LDR_CNTRL=MAXDATA=0x20000000@DSA + AKC - 2009/10/31 + +* The PathScale MPI implementation, accessing a Panasas file system, would + cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file is not + existing. This is due to the MPI_File_open() call failing if the amode has + the MPI_MODE_EXCL bit set. (See bug 1468 for details.) AKC - 2009/8/11 + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. CMC - 2009/04/28 + +* There is a known issue in which HDF5 will change the timestamp on a file + simply by opening it with read/write permissions, even if the file is not + modified in any way. This is due to the way in which HDF5 manages the file + superblock. A fix is currently underway and should be included in the 1.8.4 + release of HDF5. MAM - 2009/04/28 + +* For gcc v4.3 and v4.4, with production mode, if -O3 is used, H5Tinit.c + would fail to compile. Actually bad H5Tinit.c is produced. If -O (same + as -O1) is used, H5Tinit.c compiled okay but test/dt_arith would fail. + When -O0 (no optimizatio) is used, H5Tinit.c compilete okay and all + tests passed. Therefore, -O0 is imposed for v4.3 and v4.4 of gcc. + AKC - 2009/04/20 + +* For Red Storm, a Cray XT3 system, the tools/h5ls/testh5ls.sh and + tools/h5copy/testh5copy.sh will fail some of its sub-tests. These sub-tests + are expected to fail and should exit with a non-zero code but the yod + command does not propagate the exit code of the executables. Yod always + returns 0 if it can launch the executable. The test suite shell expects + a non-zero for this particular test, therefore it concludes the test has + failed when it receives 0 from yod. Skip all the "failing" test for now + by changing them as following. + + ======== Original tools/h5ls/testh5ls.sh ========= + TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ======== Change to =============================== + echo SKIP TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ================================================== + + ======== Original tools/h5copy/testh5copy.sh ========= + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + H5LSTEST $FILEOUT + ======== Change to =============================== + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + echo SKIP H5LSTEST $FILEOUT + ================================================== + AKC - 2008/11/10 + +* For Red Storm, a Cray XT3 system, the yod command sometimes gives the + message, "yod allocation delayed for node recovery". This interferes with + test suites that do not expect seeing this message. See the section of "Red + Storm" in file INSTALL_parallel for a way to deal with this problem. + AKC - 2008/05/28 + +* On Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be + verified with t_mpi test under testpar. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + SLU - 2005/6/30 + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command `poe'. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. + Lastly, request IBM to provide a means to run poe without the debug socket. + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + +* There is also a configure error on Altix machines that incorrectly reports + when a version of Szip without an encoder is being used. + +%%%%1.8.3%%%% + + +HDF5 version 1.8.3 released on Mon May 4 09:21:00 CDT 2009 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.2 and +HDF5 1.8.3, and contains information on the platforms tested and +known problems in HDF5-1.8.3. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.3 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.3 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.3 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.3 (current +release) versus Release 1.8.2": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.2 +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + + Configuration + ------------- + - Added libtool version numbers to generated c++, fortran, and + hl libraries. MAM 2009/04/19. + - Regenerated Makefile.ins using Automake 1.10.2. MAM 2009/04/19. + - Added a Make target of check-all-install to test the correctness of + installing via the prefix= or $DESTDIR options. AKC - 2009/04/14 + + Library + ------- + - Embed the content of libhdf5.settings into the hdf5 executables + so that an "orphaned" executables can display (via the Unix + strings command, for example) the library settings used to build + the executables. This is a prototype implementation. Improvement will + be added in next release. AKC - 2009/04/20 + - Separated "factory" free list class from block free lists. These free + lists are dynamically created and manage blocks of a fixed size. + H5set_free_list_limits() will use the same settings specified for block + free lists for factory free lists. NAF - 2009/04/08 + - Added support for dense attributes to H5Ocopy. XCao/NAF - 2009/01/29 + - Added H5Pset_elink_cb and H5Pget_elink_cb functions to support a + user-defined callback function for external link traversal. + NAF - 2009/01/08 + - Added H5Pset_elink_acc_flags and H5Pget_elink_acc_flags functions to + allow the user to specify the file access flags used to open the target + file of an external link. NAF - 2009/01/08 + - Added H5Pset_chunk_cache() and H5Pget_chunk_cache() functions to allow + individual rdcc configuration for each dataset. Added + H5Dget_access_plist() function to retrieve a dataset access property + list from a dataset. NAF - 2008/11/12 + - Added H5Iis_valid() function to check if an id is valid without + producing an error message. NAF - 2008/11/5 + - Added code to maintain a min_clean_fraction in the metadata cache when + in serial mode. MAM - 2009/01/9 + + Parallel Library + ---------------- + - Modified parallel tests to run with arbitrary number of processes. The + modified tests are testphdf5 (parallel dataset access), t_chunk_alloc + (chunk allocation), and t_posix_compliant (posix compliance). The rest of + the parallel tests already use in the code the number of processes + available in the communicator. (CMC - 2009/04/28) + + Tools + ----- + - h5diff new flag, -c, --compare, list objects that are not comparable. + PVN - 2009/4/2 - 1368 + - h5diff new flag, -N, --nan, avoids NaNs detection. PVN - 2009/4/2 + - h5dump correctly specifies XML dtd / schema urls ADB - 2009/4/3 - 1519 + - h5repack now handles group creation order. PVN - 2009/4/2 - 1402 + - h5repack: When user doesn't specify a chunk size, h5repack now + defines a default chunk size as the same size of the size of the + hyperslab used to read the chunks. The size of the hyperslabs are + defined as the size of each dimension or a predefined constant, + whatever is smaller. This assures that the chunk read fits in the + chunk cache. PVN - 2008/11/21 + + High-Level APIs + --------------- + - Table: In version 3.0 of Table, the writing of the "NROWS" attribute + (used to store number of records) was deprecated. PVN - 2008/11/24 + + F90 API + ------- + - Added for the C APIs the Fortran wrappers: + h5dget_access_plist_f + h5iis_valid_f + h5pset_chunk_cache_f + h5pget_chunk_cache_f + MSB - 2009/04/17 + + C++ API + ------- + - None + + +Support for New Platforms, Languages, and Compilers +=================================================== + + +Bug Fixes since HDF5-1.8.2 +========================== + + Configuration + ------------- + - The --includedir=DIR configuration option now works as intended, and + can be used to specify the location to install C header files. The + default location remains unchanged, residing at ${prefix}/include. + MAM - 2009/03/10 - BZ #1381 + - Configure no longer removes the '-g' flag from CFLAGS when in production + mode if it has been explicitly set in the CFLAGS environment variable + prior to configuration. MAM - 2009/03/09 - BZ #1401 + + Library + ------- + - Added versioning to H5Z_class_t struct to allow compatibility with 1.6 + API. NAF - 2009/04/20 - 1533 + - Fixed a problem with using data transforms with non-native types in the + file. NAF - 2009/04/20 - 1548 + - Added direct.h include file to windows section of H5private.h + to fix _getcwd() warning. ADB - 2009/04/14 - 1536 + - Fixed a bug that prevented external links from working after calling + H5close(). NAF - 2009/04/10 - 1539 + - Modified library to write cached symbol table information to the + superblock, to allow library versions 1.3.0 to 1.6.3 to read files created + by this version. NAF - 2009/04/08 - 1423 + - Changed skip lists to use a deterministic algorithm. The library should + now never call rand() or srand(). NAF - 2009/04/08 - 503 + - Fixed a bug where H5Lcopy and H5Lmove wouldn't create intermediate groups + when that property was set. NAF - 2009/04/07 - 1526 + - Fixed a bug that caused files with a user block to grow by the size of the + user block every time they were opened. NAF - 2009/03/26 - 1499 + - Fixed a rare problem that could occur with files using the old (pre 1.4) + array datatype. NAF - 2009/03/23 + - Modified library to be able to open files with corrupt root group symbol + table messages, and correct these errors if they are found. Such files + can only be successfully opened with write access. NAF - 2009/03/23 - 1189 + - Removed the long_long #define and replaced all instances with + "long long". This caused problems with third party products. All + currently supported compliers support the type. ADB - 2009/03/05 + - Fixed various bugs that could prevent the fill value from being written + in certain rare cases. NAF - 2009/02/26 - 1469 + - Fixed a bug that prevented more than one dataset chunk from being cached + at a time. NAF - 2009/02/12 - 1015 + - Fixed an assertion failure caused by opening an attribute multiple times + through multiple file handles. NAF - 2009/02/12 - 1420 + - Fixed a problem that could prevent the user from adding attributes (or any + object header message) in some circumstances. NAF - 2009/02/12 - 1427 + - Fixed a bug that could cause problems when an attribute was added to a + committed datatype using the committed datatype's datatype. + NAF - 2009/02/12 + - Fixed a bug that could cause problems when copying an object with a shared + message in its own object header. NAF - 2009/01/29 + - Changed H5Tset_order to properly reject H5T_ORDER_NONE for most datatypes. + NAF - 2009/01/27 - 1443 + - Fixed a bug where H5Tpack wouldn't remove trailing space from an otherwise + packed compound type. NAF - 2009/01/14 + - Fixed up some old v2 btree assertions that get run in debug mode that + were previously failing on compilation, and removed some of the + more heavily outdated and non-rewritable ones. MAM - 2008/12/15 + - Fixed a bug that could cause problems when "automatically" unmounting + multiple files. NAF - 2008/11/17 + - H5Dset_extent: when shrinking dimensions, some chunks were not deleted. + PVN - 2009/01/8 + + Parallel Library + ---------------- + - None + + Tools + ----- + - Fixed many problems that could occur when using h5repack with named + datatypes. NAF - 2009/4/20 - 1516/1466 + - h5dump, h5diff, h5repack were not reading (by hyperslabs) datasets + that have a datatype datum size greater than H5TOOLS_BUFSIZE, a constant + defined as 1024Kb, such as array types with large dimensions. + PVN - 2009/4/1 - 1501 + - h5import: By selecting a compression type, a big endian byte order + was being selected. PVN - 2009/3/11 - 1462 + - zip_perf.c had missing argument on one of the open() calls. Fixed. + AKC - 2008/12/9 + + F90 API + ------ + - None + + C++ API + ------ + - None + + High-Level APIs: + ------ + - Dimension scales: The scale index return value in H5DSiterate_scales + was not always incremented. PVN - 2009/4/8 - 1538 + + Fortran High-Level APIs: + ------ + - Lite: The h5ltget_dataset_info_f function (gets information about + a dataset) was not correctly returning the dimension array + PVN - 2009/3/23 + + +Platforms Tested +================ +The following platforms and compilers have been tested for this release. + + AIX 5.3 xlc 7.0.0.8 + (LLNL Up) xlf 09.01.0000.0008 + xlC 7.0.0.8 + mpcc_r 7.0.0.8 + mpxlf_r 09.01.0000.0008 + + Cray XT3 (2.0.41) cc (pgcc) 7.1-4 + (SNL red storm) ftn (pgf90) 7.1-4 + CC (pgCC) 7.1-4 + + FreeBSD 6.3-STABLE i386 gcc 3.4.6 [FreeBSD] 20060305 + (duty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.3.4 20090419 + g++ 4.3.4 20090419 + gfortran 4.3.4 20090419 + + FreeBSD 6.3-STABLE amd64 gcc 3.4.6 [FreeBSD] 20060305 + (liberty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.4.1 20090421 + g++ 4.4.1 20090421 + gfortran 4.4.1 20090421 + + IRIX64 6.5 (64 & n32) MIPSpro cc 7.4.4m + F90 MIPSpro 7.4.4m + C++ MIPSpro cc 7.4.4m + + Linux 2.6.18-128.1.6.el5xen gcc (GCC) 4.1.2 + #1 SMP i686 i686 i386 G95 (GCC 4.0.3 (g95 0.92!) Feb 4 2009) + (jam) PGI C, Fortran, C++ 7.2-1 32-bit + PGI C, Fortran, C++ 8.0-1 32-bit + Intel(R) C Compiler for 32-bit + applications, Versions 10.1, 11.0 + Intel(R) C++ Compiler for 32-bit + applications, Version 10.1, 11.0 + Intel(R) Fortran Compiler for 32-bit + applications, Version 10.1, 11.0 + Absoft 32-bit Fortran 95 10.0.7 + MPICH mpich2-1.0.8 compiled with + gcc 4.1.2 and G95 (GCC 4.0.3 (g95 0.92!) + + Linux 2.6.9-42.0.10.ELsmp #1 gcc (GCC) 3.4.6 + SMP i686 i686 i386 G95 (GCC 4.0.3 (g95 0.92!) Feb 4 2009) + (kagiso) MPICH mpich2-1.0.8 compiled with + gcc 3.4.6 and G95 (GCC 4.0.3 (g95 0.92!) + + Linux 2.6.16.60-0.37-smp #1 gcc 4.1.2 + SMP x86_64 GNU/Linux G95 (GCC 4.0.3 (g95 0.92!) Feb 4 2009) + (smirom) Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64, + Versions 10.1, 11.0. + PGI C, Fortran, C++ Version 7.2-1, 8.0-1 + for 64-bit target on x86-64 + gcc 4.1.2 and G95 (GCC 4.0.3 (g95 0.92!) + MPICH mpich2-1.0.8 compiled with + gcc 4.1.2 and G95 (GCC 4.0.3 (g95 0.92!) + tested for both 32- and 64-bit binaries + + Linux 2.6.16.54-0.2.5 #1 Intel(R) C++ Version 10.1.017 + SGI Altix SMP ia64 Intel(R) Fortran Itanium(R) Version 10.1.017 + (cobalt) SGI MPI 1.38 + + SunOS 5.10 32- and 64-bit Sun WorkShop 6 update 2 C 5.9 Patch 124867-09 + (linew) Sun WorkShop 6 update 2 Fortran 95 8.3 + Patch 127000-07 + Sun WorkShop 6 update 2 C++ 5.8 + Patch 124863-11 + + Intel Xeon Linux 2.6.18- gcc 3.4.6 20060404 + 92.1.10.el5_lustre.1.6.6smp- Intel(R) C++ Version 10.0.026 + perfctr #2 SMP Intel(R) Fortran Compiler Version 10.0.026 + (abe) Open MPI 1.2.2 + MVAPICH2-0.9.8p28p2patched-intel-ofed-1.2 + compiled with icc v10.0.026 and ifort 10.0.026 + + IA-64 Linux 2.4.21-309.tg1 gcc (GCC) 3.2.2 + #1 SMP ia64 Intel(R) C++ Version 8.1.037 + (NCSA tg-login) Intel(R) Fortran Compiler Version 8.1.033 + mpich-gm-1.2.7p1..16-intel-8.1.037-r1 + + Linux 2.6.9-55.0.9.EL_lustre Intel(R) C, C++, Fortran Compilers for + .1.4.11.1smp #1 SMP applications running on Intel(R) 64, + SMP x86_64 GNU/Linux Versions 9.1. + (SNL Spirit) + + Linux 2.6.9-55.0.9.EL_lustre Intel(R) C, C++, Fortran Compilers for + .1.4.11.1smp #1 SMP applications running on Intel(R) 64, + SMP x86_64 GNU/Linux Versions 10.1. + (SNL Thunderbird) + + Linux 2.6.18-63chaos #1 SMP Intel(R) C, C++, Fortran Compilers for + SMP x86_64 GNU/Linux applications running on Intel(R) 64, + (SNL Glory) Versions 10.1. + + Linux 2.6.18-63chaos #1 SMP Intel(R) C, C++, Fortran Compilers for + SMP x86_64 GNU/Linux applications running on Intel(R) 64, + (LLNL Zeus) Versions 9.1. + gcc/gfortran/g++ (GCC) 4.1.2. + + Windows XP Visual Studio .NET + Visual Studio 2005 w/ Intel Fortran 9.1 + Cygwin(native gcc compiler and g95) + + Windows XP x64 Visual Studio 2005 w/ Intel Fortran 9.1 + + Windows Vista Visual Studio 2005 + + MAC OS 10.5.6 (Intel) i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 + GNU Fortran (GCC) 4.3.0 20070810 + G95 (GCC 4.0.3 (g95 0.91!) Apr 24 2008) + Intel C, C++ and Fortran compilers 10.1 + + +Supported Configuration Features Summary +======================================== + + In the tables below + y = tested and supported + n = not supported or not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +Solaris2.10 32-bit n y n y y y +Solaris2.10 64-bit n y n y y y +IRIX64_6.5 32-bit n n n n y y +IRIX64_6.5 64-bit n y y y y y +Windows XP n y(4) n(4) y y y +Windows XP x64 n y(4) n(4) y y y +Windows Vista n n n y y y +Mac OS X 10.5 Intel n y n y y y +AIX 5.3 32- and 64-bit n y n y y n +FreeBSD 6.3-STABLE 32&64 bit n y n y y y +RedHat EL4 2.6.9-42 i686 GNU (1) W y y y y y y +RedHat EL5 2.6.18-128 i686 GNU (1)W y y(2) y y y y +RedHat EL5 2.6.18-128 i686 Intel W n y n y y n +RedHat EL5 2.6.18-128 i686 PGI W n y n y y n +SuSe Linux 2.6.16 x86_64 GNU (1) W y y(3) y y y y +SuSe Linux 2.6.16 x86_64 Intel W n y n y y n +SuSe Linux 2.6.16 x86_64 PGI W n y n y y y +SuSe Linux 2.6.16 SGI Altix ia64 C y y y y y y +RedHat EL4 2.6.18 Xeon Lustre C y y y y y n +SuSe Linux 2.4.21 ia64 Intel C y y y y y n +Cray XT3 2.0.41 y y y y y n + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +IRIX64_6.5 32-bit y dna y y +IRIX64_6.5 64-bit y y n y +Windows XP y y(4) y y +Windows XP x64 y y(4) y y +Windows Vista y n n y +Mac OS X 10.5 y n y n +AIX 5.3 32- and 64-bit n n n n +FreeBSD 6.3-STABLE 32&64 bit y n y y +RedHat EL4 2.6.9-42 i686 GNU (1) W y y y y +RedHat EL5 2.6.18-128 i686 GNU (1)W y y(2) y y +RedHat EL5 2.6.18-128 i686 Intel W y y y n +RedHat EL5 2.6.18-128 i686 PGI W y y y n +SuSe Linux 2.6.16 x86_64 GNU (1) W y y y y +SuSe Linux 2.6.16 x86_64 Intel W y y y n +SuSe Linux 2.6.16 x86_64 PGI W y y y n +SuSe Linux 2.6.16 SGI Altix ia64 C y n +RedHat EL4 2.6.18 Xeon Lustre C y y y n +SuSe Linux 2.4.21 ia64 Intel C y y y n +Cray XT3 2.0.41 n n n n + + (1) Fortran compiled with g95. + (2) With PGI and Absoft compilers. + (3) With PGI compiler for Fortran. + (4) Using Visual Studio 2005 or Cygwin + Compiler versions for each platform are listed in the preceding + "Platforms Tested" table. + + +Known Problems +============== +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. CMC - 2009/04/28 + +* There is a known issue in which HDF5 will change the timestamp on a file + simply by opening it with read/write permissions, even if the file is not + modified in any way. This is due to the way in which HDF5 manages the file + superblock. A fix is currently underway and should be included in the 1.8.4 + release of HDF5. MAM - 2009/04/28 + +* For gcc v4.3 and v4.4, with production mode, if -O3 is used, H5Tinit.c + would fail to compile. Actually bad H5Tinit.c is produced. If -O (same + as -O1) is used, H5Tinit.c compiled okay but test/dt_arith would fail. + When -O0 (no optimizatio) is used, H5Tinit.c compilete okay and all + tests passed. Therefore, -O0 is imposed for v4.3 and v4.4 of gcc. + AKC - 2009/04/20 + +* For Red Storm, a Cray XT3 system, the tools/h5ls/testh5ls.sh and + tools/h5copy/testh5copy.sh will fail some of its sub-tests. These sub-tests + are expected to fail and should exit with a non-zero code but the yod + command does not propagate the exit code of the executables. Yod always + returns 0 if it can launch the executable. The test suite shell expects + a non-zero for this particular test, therefore it concludes the test has + failed when it receives 0 from yod. Skip all the "failing" test for now + by changing them as following. + + ======== Original tools/h5ls/testh5ls.sh ========= + TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ======== Change to =============================== + echo SKIP TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ================================================== + + ======== Original tools/h5copy/testh5copy.sh ========= + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + H5LSTEST $FILEOUT + ======== Change to =============================== + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + echo SKIP H5LSTEST $FILEOUT + ================================================== + AKC - 2008/11/10 + +* For Red Storm, a Cray XT3 system, the yod command sometimes gives the + message, "yod allocation delayed for node recovery". This interferes with + test suites that do not expect seeing this message. See the section of "Red + Storm" in file INSTALL_parallel for a way to deal with this problem. + AKC - 2008/05/28 + +* We have discovered two problems when running collective IO parallel HDF5 + tests with chunking storage on the ChaMPIon MPI compiler on tungsten, a + Linux cluster at NCSA. + + Under some complex selection cases: + 1) MPI_Get_element returns the wrong value. + 2) MPI_Type_struct also generates the wrong derived datatype and corrupt + data may be generated. + These issues arise only when turning on collective IO with chunking storage + with some complex selections. We have not found these problems on other + MPI-IO compilers. If you encounter these problems, you may use independent + IO instead. + + To avoid this behavior, change the following line in your code + H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + to + H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT); + KY - 2007/08/24 + +* On Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* For LLNL, uP: both serial and parallel tests pass. + Zeus: Serial tests pass but parallel tests fail with a known problem in MPI. + ubgl: Serial tests pass but parallel tests fail. + +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be + verified with t_mpi test under testpar. + +* On IRIX6.5, when the C compiler version is greater than 7.4, complicated + MPI derived datatype code will work. However, the user should increase + the value of the MPI_TYPE_MAX environment variable to some appropriate value + to use collective irregular selection code. For example, the current + parallel HDF5 test needs to raise MPI_TYPE_MAX to 200,000 to pass the test. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + SLU - 2005/6/30 + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command `poe'. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. + Lastly, request IBM to provide a means to run poe without the debug socket. + +* The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system libraries on + Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on IBM SP2 platforms for serial mode. The parallel mode works fine with + this option. + + It is suggested that you do not use this option on these platforms + during configuration. + +* There is also a configure error on Altix machines that incorrectly reports + when a version of Szip without an encoder is being used. + +* Information about building with PGI and Intel compilers is available in + the INSTALL file sections 4.7 and 4.8. + + +%%%%1.8.2%%%% + + +HDF5 version 1.8.2 released on Mon Nov 10 15:43:09 CST 2008 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.1 and HDF5 1.8.2, +and contains information on the platforms tested and known problems in +HDF5-1.8.2. For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.2 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.2 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.2 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.2 (current +release) versus Release 1.8.1": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.8.1 +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + + Configuration + ------------- + - Upgraded libtool to version 2.2.6a. (MAM - 2008/10/15). + + Library + ------- + - Added two new public routines: H5Pget_elink_fapl() and + H5Pset_elink_fapl(). (see bug #1247) (VC - 2008/10/13) + - Improved free space tracking in file to be faster. (QAK - 2008/10/06) + - Added 'mounted' field to H5G_info_t struct. (QAK - 2008/07/15) + + Parallel Library + ---------------- + - None + + Tools + ----- + - h5repack: added new options -u and -b to add a userblock to an HDF5 + file during the repack. (PVN - 2008/08/26) + - h5repack: added options -t and -a to call H5Pset_alignment while + creating a repacked file. (PVN - 2008/08/29) + - h5ls: added capability to traverse through external links when the -r + (recursive) flag is given. (NAF - 2008/09/16) + - h5ls: added -E option to enable traversal of external links. + h5ls will not traverse external links without this flag being set. + (NAF - 2008/10/06) + - h5dump: when -b flag is used without a keyword after it, binary + output defaults to NATIVE. MEMORY keyword was deprecated + and replaced by NATIVE keyword. (PVN - 2008/10/30) + - h5diff: returns 1 when file graphs differ by any object. + Error return code was changed to 2 from -1. (PVN - 2008/10/30) + - h5import: TEXTFPE (scientific format) was deprecated. Use TEXTFP + instead (PVN - 2008/10/30) + + + + F90 API + ------ + - Added optional parameter 'mounted' to H5Gget_info_f, + H5Gget_info_by_idx_f, H5Gget_info_by_name_f (MSB - 2008/09/24) + - Added H5Tget_native_type_f (MSB - 2008/09/30) + + + C++ API + ------ + - These member functions were added as wrapper for H5Rdereference to + replace the incorrect IdComponent::dereference(). + void H5Object::dereference(H5Object& obj, void* ref, + H5R_type_t ref_type=H5R_OBJECT) + void H5Object::dereference(H5File& h5file, void* ref, + H5R_type_t ref_type=H5R_OBJECT) + void H5Object::dereference(Attribute& obj, void* ref, + H5R_type_t ref_type=H5R_OBJECT) + + In addition, these constructors were added to create the associated + objects by way of dereference: + DataSet(H5Object& obj, void* ref, H5R_type_t ref_type=H5R_OBJECT) + DataSet(H5File& file, void* ref, H5R_type_t ref_type=H5R_OBJECT) + DataSet(Attribute& attr, void* ref, H5R_type_t ref_type=H5R_OBJECT) + Group(H5Object& obj, void* ref, H5R_type_t ref_type=H5R_OBJECT) + Group(H5File& obj, void* ref, H5R_type_t ref_type=H5R_OBJECT) + Group(Attribute& attr, void* ref, H5R_type_t ref_type=H5R_OBJECT) + DataType(H5Object& obj, void* ref, H5R_type_t ref_type=H5R_OBJECT) + DataType(H5File& file, void* ref, H5R_type_t ref_type=H5R_OBJECT) + DataType(Attribute& attr, void* ref, H5R_type_t ref_type=H5R_OBJECT) + (BMR - 2008/10/29) + + +Support for New Platforms, Languages, and Compilers +=================================================== + - Intel 10.1 is supported on Mac OS X 10.5.4. + Note: + When Fortran is enabled, configure automatically + disables the build of shared libraries (i.e., only + static C and C++ HDF5 libraries will be built + along with the static HDF5 Fortran library). + Intel 10.1 C and C++ compilers require + "-no-multibyte-chars" compilation flag due to the known + bug in the compilers. + (EIP - 2008/10/30) + + +Bug Fixes since HDF5-1.8.1 +========================== + + Configuration + ------------- + - Fixed error with 'make check install' failing due to h5dump + needing other tools built first. (MAM - 2008/10/15). + - When using shared szip, it is no longer necessary to specify + the path to the shared szip libraries in LD_LIBRARY_PATH. + (MAM - 2008/10/15). + - The file libhdf5_fortran.settings is not installed since its content + is included in libhdf5.settings now. (AKC - 2008/10/21) + - "make DESTDIR=xxx install" failed to install some tools and files + (e.g., h5cc and fortran modules). Fixed. (AKC - 2008/10/8). + + Library + ------- + - H5Ovisit and H5Ovisit_by_name will now properly terminate when the + callback function returns a positive value on the starting object. + (NAF - 2008/11/03) + - Fixed an error where a null message could be created that was larger + than could be written to the file. (NAF - 2008/10/23) + - Corrected error with family/split/multi VFD not updating driver info + when "latest" version of the file format used. (QAK - 2008/10/14) + - Corrected alignment+threshold errors to work correctly when metadata + aggregation is enabled. (QAK - 2008/10/06) + - Changed H5Fget_obj_count and H5Fget_obj_ids to ignore objects + registered by the library for internal library use. + (NAF - 2008/10/06) + - Fixed potential memory leak during compound conversion. + (NAF - 2008/10/06) + - Changed the return value of H5Fget_obj_count from INT to SSIZE_T. + Also changed the return value of H5Fget_obj_ids from HERR_T to + SSIZE_T and the type of the parameter MAX_OBJS from INT to SIZE_T. + (SLU - 2008/09/26) + - Fixed an issue that could cause data to be improperly overwritten + during compound type conversion. (NAF - 2008/09/19) + - Fixed pointer alignment violations that could occur during vlen + conversion. (NAF - 2008/09/16) + - Fixed problem where library could cause a segmentation fault when + an invalid location ID was given to H5Giterate(). (QAK - 2008/08/19) + - Fixed improper shutdown when objects have reference count > 1. The + library now tracks reference count due to the application separately + from that due to internal library routines. (NAF - 2008/08/19) + - Fixed assertion failure caused by incorrect array datatype version. + (NAF - 2008/08/08) + - Fixed an issue where mount point traversal would fail when using + multiple handles for the child. (NAF - 2008/08/07) + - Fixed an issue where mount points were inaccessible when using + multiple file handles for the parent. The mount table is now in + the shared file structure (the parent pointer is still in the + top structure). (NAF - 2008/08/07) + - Fixed assertion failure caused by incorrect array datatype version. + (NAF - 2008/08/04) + - Fixed issue where a group could have a file mounted on it twice. + (QAK - 2008/07/15) + - When an attribute was opened twice and data was written with + one of the handles, the file didn't have the data. It happened + because each handle had its own object structure, and the empty + one overwrote the data with fill value. This is fixed by making + some attribute information like the data be shared in the + attribute structure. (SLU - 2008/07/07) + - Fixed a Windows-specific issue in the ohdr test which was causing + users in some timezones to get false errors. This a deficiency in + the Windows mktime() function, and has been handled properly. + (SJW - 2008/06/19) + + Parallel Library + ---------------- + - None + + Tools + ----- + - h5dump now checks for uniqueness of committed datatypes. + (NAF - 2008/10/15) + - Fixed unnecessary indentation of committed datatypes in h5dump. + (NAF - 2008/10/15) + - Fixed bugs in h5stat: segmemtation fault when printing groups and + print warning message when traversal of objects is unsuccessful. + (see bug #1253) (VC- 2008/10/13) + - Fixed bug in h5ls that prevented relative group listings (like + "h5ls foo.h5/bar") from working correctly (QAK - 2008/06/03) + - h5dump: when doing binary output (-b), the stdout printing of + attributes was done incorrectly. Removed printing of attributes + when doing binary output. (PVN - 2008/06/05) + + + F90 API + ------ + - h5sselect_elements_f: Added additional operators H5S_SELECT_APPEND + and H5S_SELECT_PREPEND (MSB - 2008/09/30) + - h5sget_select_elem_pointlist: Fixed list of returned points by + rearranging the point list correctly by accounting for C + conventions. (MSB - 2008/09/30) + - h5sget_select_hyper_blocklist_f: Fixed error in transposed dimension + of arrays.(MSB - 2008/9/30) + - h5sget_select_bounds_f: Swapped array bounds to account for C and + Fortran reversed array notation (MSB - 2008/9/30) + - Changed to initializing string to a blank character instead of a + null type in tH5P.f90 to fix compiling error using AIX 5.3.0 + (MSB - 2008/7/29) + - Fixed missing commas in H5test_kind.f90 detected by NAG compiler + (MSB - 2008/7/29) + - Fixed passing and array to a scalar in tH5A_1_8.f90 detected by + NAG compiler (MSB - 2008/7/29) + - Added the ability of the test programs to use the status of + HDF5_NOCLEANUP to determine if the *.h5 files should be removed + or not after the tests are completed (MSB - 2008/10/1) + - In nh5tget_offset_c: (MSB 9/12/2008) + If offset was equal to 0 it returned the error code of -1, + this was changed to return an error code of -1 when the offset + value is < 0. + - Uses intrinsic Fortran function SIZEOF if available when detecting + type of INTEGERs and REALs in H5test_kind.f90 (MSB - 2008/9/3) + - Put the DOUBLE PRECISION interfaces in a separate module and + added a USE statement for the module. The interfaces are + included/excluded depending on the state of FORTRAN_DEFAULT_REAL + is DBLE_F which detects if the default REAL is DOUBLE PRECISION. + This allows the library to be compiled with -r8 Fortran flag + without the user needing to edit the source code. + (MSB - 200/8/27) + - Enable building shared library for fortran by adding the flag -fPIC + to the compile flags for versions of Intel Fortran compiler >=9 + (MSB - 2008/8/26) + + C++ API + ------ + - Fixed a design bug which allowed an Attribute object to create/modify + attributes (bugzilla #1068). The API class hierarchy was revised + to address the problem. Classes AbstractDS and Attribute are moved + out of H5Object. Class Attribute now multiply inherits from + IdComponent and AbstractDs and class DataSet from H5Object and + AbstractDs. In addition, the data member IdComponent::id was + moved into subclasses: Attribute, DataSet, DataSpace, DataType, + H5File, Group, and PropList. (BMR - 2008/05/20) + - IdComponent::dereference was incorrect and replaced as described + in "New Features" section. + (BMR - 2008/10/29) + + +Platforms Tested +================ +The following platforms and compilers have been tested for this release. + + AIX 5.3 xlc 7.0.0.8 + xlf 09.01.0000.0008 + xlC 7.0.0.8 + mpcc_r 7.0.0.8 + mpxlf_r 09.01.0000.0008 + + Cray XT3 (2.0.41) cc (pgcc) 7.1-4 + (red storm) ftn (pgf90) 7.1-4 + CC (pgCC) 7.1-4 + + FreeBSD 6.3-STABLE i386 gcc 3.4.6 [FreeBSD] 20060305 + (duty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.2.5 20080702 + g++ 4.2.5 20080702 + gfortran 4.2.5 20080702 + + FreeBSD 6.3-STABLE amd64 gcc 3.4.6 [FreeBSD] 20060305 + (liberty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.2.5 20080702 + g++ 4.2.5 20080702 + gfortran 4.2.5 20080702 + + IRIX64 6.5 (64 & n32) MIPSpro cc 7.4.4m + F90 MIPSpro 7.4.4m + C++ MIPSpro cc 7.4.4m + + Linux 2.6.9-42.0.10.ELsmp #1 gcc (GCC) 3.4.6 + SMP i686 i386 G95 (GCC 4.0.3 (g95 0.92!) April 18 2007) + (kagiso) PGI C, Fortran, C++ 7.2-1 32-bit + Intel(R) C Compiler for 32-bit + applications, Version 10.1 + Intel(R) C++ Compiler for 32-bit + applications, Version 10.1 + Intel(R) Fortran Compiler for 32-bit + applications, Version 10.1 + Absoft 32-bit Fortran 95 10.0.4 + MPICH mpich-1.2.7 compiled with + gcc 3.4.6 and G95 (GCC 4.0.3 (g95 0.92!) + MPICH mpich2-1.0.6p1 compiled with + gcc 3.4.6 and G95 (GCC 4.0.3 (g95 0.92!) + + Linux 2.6.16.46-0.14-smp #1 Intel(R) C++ for Intel(R) EM64T + SMP x86_64 GNU/Linux Ver. 10.1.013 + (smirom) Intel(R) Fortran Intel(R) EM64T + Ver. 10.1.013 + PGI C, Fortran, C++ Version 7.2-1 + for 64-bit target on x86-64 + MPICH mpich-1.2.7 compiled with + gcc 4.1.2 and G95 (GCC 4.0.3 (g95 0.92!) + MPICH mpich2-1.0.7 compiled with + gcc 4.1.2 and G95 (GCC 4.0.3 (g95 0.92!) + tested for both 32- and 64-bit binaries + + Linux 2.6.16.54-0.2.5 #1 Intel(R) C++ Version 10.1.017 + Altix SMP ia64 Intel(R) Fortran Itanium(R) Version 10.1.017 + (cobalt) SGI MPI 1.16 + + SunOS 5.10 32- and 64-bit Sun WorkShop 6 update 2 C 5.8 + (linew) Sun WorkShop 6 update 2 Fortran 95 8.2 + Sun WorkShop 6 update 2 C++ 5.8 + Patch 121019-06 + + Xeon Linux 2.6.9-42.0.10.EL_lustre-1.4.10.1smp + (abe) Intel(R) C++ Version 10.0.026 + Intel(R) Fortran Compiler Version 10.0.026 + Open MPI 1.2.2 + MVAPICH2-0.9.8p28p2patched-intel-ofed-1.2 + compiled with icc v10.0.026 and + ifort 10.0.026 + + IA-64 Linux 2.4.21-309.tg1 #1 SMP + ia64 gcc (GCC) 3.2.2 + (NCSA tg-login) Intel(R) C++ Version 8.1.037 + Intel(R) Fortran Compiler Version 8.1.033 + mpich-gm-1.2.7p1..16-intel-8.1.037-r1 + + Intel 64 Linux 2.6.9-42.0.10.EL_lustre-1.4.10.1smp + (abe) gcc 3.4.6 20060404 + Intel(R) C++ Version 10.0 + Intel (R) Fortran Compiler Version 10.0 + mvapich2-0.9.8p2patched-intel-ofed-1.2 + + Windows XP Visual Studio .NET + Visual Studio 2005 w/ Intel Fortran 9.1 + Cygwin(native gcc compiler and g95) + + Windows XP x64 Visual Studio 2005 w/ Intel Fortran 9.1 + + Windows Vista Visual Studio 2005 + + MAC OS 10.5.4 (Intel) i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 + GNU Fortran (GCC) 4.3.0 20070810 + G95 (GCC 4.0.3 (g95 0.91!) Apr 24 2008) + Intel C, C++ and Fortran compilers 10.1 + + +Supported Configuration Features Summary +======================================== + + In the tables below + y = tested and supported + n = not supported or not tested in this release + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +Solaris2.10 32-bit n y n y y y +Solaris2.10 64-bit n y n y y y +IRIX64_6.5 32-bit n n n n y y +IRIX64_6.5 64-bit n y y y y y +Windows XP n y(15) n(15) y y y +Windows XP x64 n y(15) n(15) y y y +Windows Vista n n n y y y +Mac OS X 10.5 Intel n y n y y y +AIX 5.3 32- and 64-bit n y n y y n +FreeBSD 6.3-STABLE +32&64 bit n y n y y y +RedHat EL4 (3) W y(1) y(10) y(1) y y y +RedHat EL4 Intel (3) W n y n y y n +RedHat EL4 PGI (3) W n y n y y n +SuSe x86_64 gcc(3,12) W y(2) y(11) y(2) y y y +SuSe x86_64 Int(3,12) W n y(13) n y y n +SuSe x86_64 PGI(3,12) W n y(8) n y y y +Linux 2.6 SuSE ia64 C + Intel (3,7) y y y y y n +Linux 2.6 SGI Altix + ia64 Intel (3) y y y y y y +Linux 2.6 RHEL C + Lustre Intel (5) y(4) y y(4) y y n +Cray XT3 2.0.41 y y y y y n + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +IRIX64_6.5 32-bit y dna y y +IRIX64_6.5 64-bit y y n y +Windows XP y y(15) y y +Windows XP x64 y y(15) y y +Windows Vista y n n y +Mac OS X 10.5 y n y n +AIX 5.3 32- and 64-bit n n n n +FreeBSD 6.2 32&64 bit y n y y +RedHat EL4 (3) W y y(10) y y +RedHat EL4 Intel (3) W y y y n +RedHat EL4 PGI (3) W y y y n +SuSe x86_64 GNU(3,12) W y y y y +SuSe x86_64 Int(3,12) W y y y n +SuSe x86_64 PGI(3,12) W y y y n +Linux 2.4 SuSE C + ia64 C Intel (7) y y y n +Linux 2.4 SGI Altix C + ia64 Intel y n +Linux 2.6 RHEL C + Lustre Intel (5) y y y n +Cray XT3 2.0.41 n n n n + + Notes: (1) Using mpich2 1.0.6. + (2) Using mpich2 1.0.7. + (3) Linux 2.6 with GNU, Intel, and PGI compilers, as indicated. + W or C indicates workstation or cluster, respectively. + (4) Using mvapich2 0.9.8. + (5) Linux 2.6.9-42.0.10. Xeon cluster with ELsmp_perfctr_lustre + and Intel compilers + (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp_perfctr_lustre + and Intel compilers + (7) Linux 2.4.21, SuSE_292.till. Ia64 cluster with Intel compilers + (8) pgf90 + (9) With Compaq Visual Fortran 6.6c compiler. + (10) With PGI and Absoft compilers. + (11) PGI and Intel compilers for both C and Fortran + (12) AMD Opteron x86_64 + (13) ifort + (14) Yes with C and Fortran, but not with C++ + (15) Using Visual Studio 2005 or Cygwin + (16) Not tested for this release. + Compiler versions for each platform are listed in the preceding + "Platforms Tested" table. + + +Known Problems +============== +* For Red Storm, a Cray XT3 system, the tools/h5ls/testh5ls.sh and + tools/h5copy/testh5copy.sh will fail some of its sub-tests. These sub-tests + are expected to fail and should exit with a non-zero code but the yod + command does not propagate the exit code of the executables. Yod always + returns 0 if it can launch the executable. The test suite shell expects + a non-zero for this particular test, therefore it concludes the test has + failed when it receives 0 from yod. Skip all the "failing" test for now + by changing them as following. + + ======== Original tools/h5ls/testh5ls.sh ========= + TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ======== Change to =============================== + echo SKIP TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ================================================== + + ======== Original tools/h5copy/testh5copy.sh ========= + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + H5LSTEST $FILEOUT + ======== Change to =============================== + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + echo SKIP TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + echo SKIP H5LSTEST $FILEOUT + ================================================== + AKC - 2008/11/10 + +* For Red Storm, a Cray XT3 system, the yod command sometimes gives the + message, "yod allocation delayed for node recovery". This interferes with + test suites that do not expect seeing this message. See the section of "Red + Storm" in file INSTALL_parallel for a way to deal with this problem. + AKC - 2008/05/28 + +* We have discovered two problems when running collective IO parallel HDF5 + tests with chunking storage on the ChaMPIon MPI compiler on tungsten, a + Linux cluster at NCSA. + + Under some complex selection cases: + 1) MPI_Get_element returns the wrong value. + 2) MPI_Type_struct also generates the wrong derived datatype and corrupt + data may be generated. + These issues arise only when turning on collective IO with chunking storage + with some complex selections. We have not found these problems on other + MPI-IO compilers. If you encounter these problems, you may use independent + IO instead. + + To avoid this behavior, change the following line in your code + H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + to + H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT); + + KY - 2007/08/24 + +* On Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* For LLNL, uP: both serial and parallel tests pass. + Zeus: Serial tests pass but parallel tests fail with a known problem in MPI. + ubgl: Serial tests pass but parallel tests fail. + +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be + verified with t_mpi test under testpar. + +* On IRIX6.5, when the C compiler version is greater than 7.4, complicated + MPI derived datatype code will work. However, the user should increase + the value of the MPI_TYPE_MAX environment variable to some appropriate value + to use collective irregular selection code. For example, the current + parallel HDF5 test needs to raise MPI_TYPE_MAX to 200,000 to pass the test. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + SLU - 2005/6/30 + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command `poe'. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. + Lastly, request IBM to provide a means to run poe without the debug socket. + +* The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system libraries on + Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on IBM SP2 platforms for serial mode. The parallel mode works fine with + this option. + + It is suggested that you do not use this option on these platforms + during configuration. + +* There is also a configure error on Altix machines that incorrectly reports + when a version of Szip without an encoder is being used. + +* Information about building with PGI and Intel compilers is available in + the INSTALL file sections 4.7 and 4.8. + + + + +%%%%1.8.1%%%% + + +HDF5 version 1.8.1 released on Thu May 29 15:28:55 CDT 2008 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between the HDF5-1.8.1 release +and HDF5 1.8.0, and contains information on the platforms tested and known +problems in HDF5-1.8.1. For more details, see the files +HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory +of the HDF5 source. + +Links to the HDF5 1.8.1 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.1 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.1 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.1 (current +release) versus Release 1.8.0": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.8.0 +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + + Configuration + ------------- + - The lib/libhdf5.settings file contains much more configure + information. (AKC - 2008/05/18) + + - The new configure option "--disable-sharedlib-rpath" disables + embedding the '-Wl,-rpath' information into executables when + shared libraries are produced, and instead solely relies on the + information in LD_LIBRARY_PATH. (MAM - 2008/05/15) + + - Configuration suite now uses Autoconf 2.61, Automake 1.10.1, and + Libtool 2.2.2 (MAM - 2008/05/01) + + Source code distribution + ======================== + + Library + ------- + - None + + Parallel Library + ---------------- + - None + + Tools + ----- + - h5repack: Reinstated the -i and -o command line flags to specify + input and output files. h5repack now understands both the old + syntax (with -i and -o) and the new syntax introduced in Release + 1.8.0. (PVN - 2008/05/23) + - h5dump: Added support for external links, displaying the object that + an external link points to. (PVN - 2008/05/12) + - h5dump: Added an option, -m, to allow user-defined formatting in the + output of floating point numbers. (PVN - 2008/05/06) + - h5dump, in output of the -p option: Added effective data compression + ratio to the dataset storage layout output when a compression filter + has been applied to a dataset. (PVN - 2008/05/01) + + F90 API + ------ + New H5A, H5G, H5L, H5O, and H5P APIs to enable 1.8 features were + added. See "Release 1.8.1 (current release) versus Release 1.8.0" in + the document "HDF5 Software Changes from Release to Release" + (http://hdfgroup.org/HDF5/doc/ADGuide/Changes.html) for the + complete list of the new APIs. + + C++ API + ------ + - None + + +Support for New Platforms, Languages, and Compilers +=================================================== + - Both serial and parallel HDF5 are supported for the Red Storm machine + which is a Cray XT3 system. + + - The Fortran library will work correctly if compiled with the -i8 + flag. This has been tested with the g95, PGI and Intel Fortran + compilers. + + +Bug Fixes since HDF5-1.8.0 +========================== + + Configuration + ------------- + - None + + Source code distribution + ======================== + + Library + ------- + - Chunking: Chunks greater than 4GB are disallowed. + (QAK - 2008/05/16) + - Fixed the problem with searching for a target file when following + an external link. The search pattern will depend on whether the + target file's pathname is an absolute or a relative path. + Please see the H5Lcreate_external description in the "HDF5 + Reference Manual" (http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html). + (VC - 2008/04/08) + - Fixed possible file corruption bug when encoding datatype + descriptions for compound datatypes whose size was between + 256 and 511 bytes and the file was opened with the "use the + latest format" property enabled (with H5Pset_libver_bounds). + (QAK - 2008/03/13) + - Fixed bug in H5Aget_num_attrs() routine to correctly handle an + invalid location identifier. (QAK - 2008/03/11) + + Parallel Library + ---------------- + - None + + Tools + ----- + - Fixed bug in h5diff that prevented datasets and attributes with + variable-length string elements from comparing correctly. + (QAK - 2008/02/28) + - Fixed bug in h5dump that caused binary output to be made only for + the first dataset, when several datasets were requested. + (PVN - 2008/04/07) + + F90 API + ------ + - The h5tset(get)_fields subroutines were missing the parameter to + specify a sign position; fixed. (EIP - 2008/05/23) + - Many APIs were fixed to work with the 8-byte integers in Fortran vs. + 4-byte integers in C. This change is trasparent to user applications. + + C++ API + ------ + - The class hierarchy was revised to address the problem reported + in bugzilla #1068, Attribute should not be derived from base + class H5Object. Classes AbstractDS was moved out of H5Object. + Class Attribute now multiply inherits from IdComponent and + AbstractDs and class DataSet from H5Object and AbstractDs. + In addition, data member IdComponent::id was moved into subclasses: + Attribute, DataSet, DataSpace, DataType, H5File, Group, and PropList. + (BMR - 2008/05/20) + - IdComponent::dereference was incorrect; it was changed from: + void IdComponent::dereference(IdComponent& obj, void* ref) + to: + void H5Object::dereference(H5File& h5file, void* ref) + void H5Object::dereference(H5Object& obj, void* ref) + (BMR - 2008/05/20) + - Revised Attribute::write and Attribute::read wrappers to handle + memory allocation/deallocation properly. (bugzilla 1045) + (BMR - 2008/05/20) + + +Platforms Tested +================ +The following platforms and compilers have been tested for this release. + + Cray XT3 (2.0.41) cc (pgcc) 7.1-4 + (red storm) ftn (pgf90) 7.1-4 + CC (pgCC) 7.1-4 + mpicc 1.0.2 + mpif90 1.0.2 + + FreeBSD 6.2-STABLE i386 gcc 3.4.6 [FreeBSD] 20060305 + (duty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.2.1 20080123 + g++ 4.2.1 20080123 + gfortran 4.2.1 20070620 + + FreeBSD 6.2-STABLE amd64 gcc 3.4.6 [FreeBSD] 20060305 + (liberty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.2.1 20080123 + g++ 4.2.1 20080123 + gfortran 4.2.1 20080123 + + IRIX64 6.5 (64 & n32) MIPSpro cc 7.4.4m + F90 MIPSpro 7.4.4m + C++ MIPSpro cc 7.4.4m + + Linux 2.6.9 (RHEL4) Intel 10.0 compilers + (abe.ncsa.uiuc.edu) + + Linux 2.4.21-47 gcc 3.2.3 20030502 + (osage) + + Linux 2.6.9-42.0.10 gcc,g++ 3.4.6 20060404, G95 (GCC 4.0.3) + (kagiso) PGI 7.1-6 (pgcc, pgf90, pgCC) + Intel 9.1 (icc, ifort, icpc) + + Linux 2.6.16.27 x86_64 AMD gcc 4.1.0 (SuSE Linux), g++ 4.1.0, + (smirom) g95 (GCC 4.0.3) + PGI 7.1-6 (pgcc, pgf90, pgCC) + Intel 9.1 (icc, ifort, icpc) + + Linux 2.6.5-7.252.1-rtgfx #1 Intel(R) C++ Version 9.0 + SMP ia64 Intel(R) Fortran Itanium(R) Version 9.0 + (cobalt) SGI MPI + + SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 + (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 95 6.2 + Sun WorkShop 6 update 2 C++ 5.3 + + SunOS 5.10 cc: Sun C 5.8 + (linew) f90: Sun Fortran 95 8.2 + CC: Sun C++ 5.8 + + Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre + (tungsten) gcc 3.2.2 20030222 + Intel(R) C++ Version 9.0 + Intel(R) Fortran Compiler Version 9.0 + + IA-64 Linux 2.4.21.SuSE_309.tg1 ia64 + (NCSA tg-login) gcc 3.2.2 + Intel(R) C++ Version 8.1 + Intel(R) Fortran Compiler Version 8.1 + mpich-gm-1.2.6..14b-intel-r2 + + Intel 64 Linux 2.6.9-42.0.10.EL_lustre-1.4.10.1smp + (abe) gcc 3.4.6 20060404 + Intel(R) C++ Version 10.0 + Intel (R) Fortran Compiler Version 10.0 + mvapich2-0.9.8p2patched-intel-ofed-1.2 + + Windows XP Visual Studio .NET + Visual Studio 2005 w/ Intel Fortran 9.1 + Cygwin(native gcc compiler and g95) + MinGW(native gcc compiler and g95) + + Windows XP x64 Visual Studio 2005 w/ Intel Fortran 9.1 + + Windows Vista Visual Studio 2005 + + MAC OS 10.5.2 (Intel) i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 + GNU Fortran (GCC) 4.3.0 20070810 + G95 (GCC 4.0.3 (g95 0.91!) Apr 24 2008) + + +Supported Configuration Features Summary +======================================== + + In the tables below + y = tested and supported + n = not supported or not tested in this release + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +SunOS5.10 64-bit n y n y y y +SunOS5.10 32-bit n y n y y y +IRIX64_6.5 64-bit n y y y y y +IRIX64_6.5 32-bit n n n n y y +Windows XP n y(15) n(15) y y y +Windows XP x64 n y(15) n(15) y y y +Windows Vista n n n y y y +Mac OS X 10.5 Intel n y n y y y +FreeBSD 4.11 n n n y y y +RedHat EL3 W (3) y(1) y(10) y(1) y y y +RedHat EL3 W Intel (3) n y n y y n +RedHat EL3 W PGI (3) n y n y y n +SuSe x86_64 gcc (3,12) y(2) y(11) y(2) y y y +SuSe x86_64 Int (3,12) n y(13) n y y n +SuSe x86_64 PGI (3,12) n y(8) n y y y +Linux 2.4 Xeon C + Lustre Intel (3,6) n y n y y n +Linux 2.6 SuSE ia64 C + Intel (3,7) y y y y y n +Linux 2.6 SGI Altix + ia64 Intel (3) y y y y y y +Linux 2.6 RHEL C + Lustre Intel (5) y(4) y y(4) y y n +Cray XT3 2.0.41 y y y y y n + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 64-bit y y y y +Solaris2.10 32-bit y y y y +IRIX64_6.5 64-bit y y n y +IRIX64_6.5 32-bit y dna y y +Windows XP y y(15) y y +Windows XP x64 y y(15) y y +Windows Vista y n n y +Mac OS X 10.3 y n +FreeBSD 4.11 y n y y +RedHat EL3 W (3) y y(10) y y +RedHat EL3 W Intel (3) y y y n +RedHat EL3 W PGI (3) y y y n +SuSe x86_64 W GNU (3,12) y y y y +SuSe x86_64 W Int (3,12) y y y n +SuSe x86_64 W PGI (3,12) y y y n +Linux 2.4 Xeon C + Lustre Intel (6) y y y n +Linux 2.4 SuSE + ia64 C Intel (7) y y y n +Linux 2.4 SGI Altix + ia64 Intel y n +Linux 2.6 RHEL C + Lustre Intel (5) y y y n +Cray XT3 2.0.41 n n n n n + + Notes: (1) Using mpich2 1.0.6. + (2) Using mpich2 1.0.7. + (3) Linux 2.6 with GNU, Intel, and PGI compilers, as indicated. + W or C indicates workstation or cluster, respectively. + (4) Using mvapich2 0.9.8. + (5) Linux 2.6.9-42.0.10. Xeon cluster with ELsmp_perfctr_lustre + and Intel compilers + (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp_perfctr_lustre + and Intel compilers + (7) Linux 2.4.21, SuSE_292.till. Ia64 cluster with Intel compilers + (8) pgf90 + (9) With Compaq Visual Fortran 6.6c compiler. + (10) With PGI and Absoft compilers. + (11) PGI and Intel compilers for both C and Fortran + (12) AMD Opteron x86_64 + (13) ifort + (14) Yes with C and Fortran, but not with C++ + (15) Using Visual Studio 2005 or Cygwin + (16) Not tested for this release. + Compiler versions for each platform are listed in the preceding + "Platforms Tested" table. + + +Known Problems +============== +* For Red Storm, a Cray XT3 system, the yod command sometimes gives the + message, "yod allocation delayed for node recovery". This interferes with + test suites that do not expect seeing this message. See the section of "Red + Storm" in file INSTALL_parallel for a way to deal with this problem. + AKC - 2008/05/28 + +* For Red Storm, a Cray XT3 system, the tools/h5ls/testh5ls.sh will fail on + the test "Testing h5ls -w80 -r -g tgroup.h5" fails. This test is + expected to fail and exit with a non-zero code but the yod command does + not propagate the exit code of the executables. Yod always returns 0 if it + can launch the executable. The test suite shell expects a non-zero for + this particular test, therefore it concludes the test has failed when it + receives 0 from yod. To bypass this problem for now, change the following + lines in the tools/h5ls/testh5ls.sh. + ======== Original ========= + # The following combination of arguments is expected to return an error message + # and return value 1 + TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ======== Skip the test ========= + echo SKIP TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 + ======== end of bypass ======== + AKC - 2008/05/28 + +* We have discovered two problems when running collective IO parallel HDF5 + tests with chunking storage on the ChaMPIon MPI compiler on tungsten, a + Linux cluster at NCSA. + + Under some complex selection cases: + 1) MPI_Get_element returns the wrong value. + 2) MPI_Type_struct also generates the wrong derived datatype and corrupt + data may be generated. + These issues arise only when turning on collective IO with chunking storage + with some complex selections. We have not found these problems on other + MPI-IO compilers. If you encounter these problems, you may use independent + IO instead. + + To avoid this behavior, change the following line in your code + H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + to + H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT); + + KY - 2007/08/24 + +* For SNL, spirit/liberty/thunderbird: The serial tests pass but parallel + tests failed with MPI-IO file locking message. AKC - 2007/6/25 + +* On Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* For LLNL, uP: both serial and parallel tests pass. + Zeus: Serial tests pass but parallel tests fail with a known problem in MPI. + ubgl: Serial tests pass but parallel tests fail. + +* Configuring with --enable-debug=all produces compiler errors on most + platforms: Users who want to run HDF5 in debug mode should use + --enable-debug rather than --enable-debug=all to enable debugging + information on most modules. + +* On Mac OS 10.4, test/dt_arith.c has some errors in conversion from long + double to (unsigned) long long and from (unsigned) long long to long double. + +* On Altix SGI with Intel 9.0, testmeta.c would not compile with -O3 + optimization flag. + +* On VAX, the Scaleoffset filter is not supported. The Scaleoffset filter + supports only the IEEE standard for floating-point data; it cannot be applied + to HDF5 data generated on VAX. + +* On Cray X1, a lone colon on the command line of h5dump --xml (as in + the testh5dumpxml.sh script) is misinterpereted by the operating system + and causes an error. + +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be + verified with t_mpi test under testpar. + +* On IRIX6.5, when the C compiler version is greater than 7.4, complicated + MPI derived datatype code will work. However, the user should increase + the value of the MPI_TYPE_MAX environment variable to some appropriate value + to use collective irregular selection code. For example, the current + parallel HDF5 test needs to raise MPI_TYPE_MAX to 200,000 to pass the test. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + SLU - 2005/6/30 + +* For version 6 (6.02 and 6.04) of the Portland Group compiler on the AMD + Opteron processor, there is a bug in the compiler for optimization(-O2). + The library failed in several tests, all related to the MULTI driver. + The problem has been reported to the vendor. + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command `poe'. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. + Lastly, request IBM to provide a means to run poe without the debug socket. + +* The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system libraries on + Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on IBM SP2 platforms for serial mode. The parallel mode works fine with + this option. + + It is suggested that you do not use this option on these platforms + during configuration. + +* With the gcc 2.95.2 compiler, HDF5 uses the `-ansi' flag during + compilation. The ANSI version of the compiler complains about not being + able to handle the `long long' datatype with the warning: + + warning: ANSI C does not support `long long' + + This warning is innocuous and can be safely ignored. + +* The ./dsets tests fail on the TFLOPS machine if the test program, + dsets.c, is compiled with the -O option. The HDF5 library still works + correctly with the -O option. The test program works fine if it is + compiled with -O1 or -O0. Only -O (same as -O2) causes the test + program to fail. + +* Not all platforms behave correctly with Szip's shared libraries. Szip is + disabled in these cases, and a message is relayed at configure time. Static + libraries should be working on all systems that support Szip and should be + used when shared libraries are unavailable. + + There is also a configure error on Altix machines that incorrectly reports + when a version of Szip without an encoder is being used. + +* On some platforms that use Intel and Absoft compilers to build the HDF5 + Fortran library, compilation may fail for fortranlib_test.f90, fflush1.f90 + and fflush2.f90 complaining about the exit subroutine. Comment out the line + IF (total_error .ne. 0) CALL exit (total_error). + +* Information about building with PGI and Intel compilers is available in + the INSTALL file sections 4.7 and 4.8. + +* On at least one system, SDSC DataStar, the scheduler (in this case + LoadLeveler) sends job status updates to standard error when you run + any executable that was compiled with the parallel compilers. + + This causes problems when running "make check" on parallel builds, as + many of the tool tests function by saving the output from test runs, + and comparing it to an exemplar. + + The best solution is to reconfigure the target system so it no longer + inserts the extra text. However, this may not be practical. + + In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to + the configure and build. This will cause "make check" to continue after + detecting errors in the tool tests. However, in the case of SDSC DataStar, + it also leaves you with some 150 "failed" tests to examine by hand. + + A second solution is to write a script to run serial tests and filter + out the text added by the scheduler. A sample script used on SDSC + DataStar is given below, but you will probably have to customize it + for your installation. + + Observe that the basic idea is to insert the script as the first item + on the command line which executes the the test. The script then + executes the test and filters out the offending text before passing + it on. + + #!/bin/csh + + set STDOUT_FILE=~/bin/serial_filter.stdout + set STDERR_FILE=~/bin/serial_filter.stderr + + rm -f $STDOUT_FILE $STDERR_FILE + + ($* > $STDOUT_FILE) >& $STDERR_FILE + + set RETURN_VALUE=$status + + cat $STDOUT_FILE + + tail +3 $STDERR_FILE + + exit $RETURN_VALUE + + You get the HDF5 make files and test scipts to execute your filter script + by setting the environment variable "RUNSERIAL" to the full path of the + script prior to running configure for parallel builds. Remember to + "unsetenv RUNSERIAL" before running configure for a serial build. + + Note that the RUNSERIAL environment variable exists so that we can + prefix serial runs as necessary on the target system. On DataStar, + no prefix is necessary. However on an MPICH system, the prefix might + have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to + get the serial tests to run at all. + + In such cases, you will have to include the regular prefix in your + filter script. + +* H5Ocopy() does not copy reg_ref attributes correctly when shared-message + is turn on. The value of the reference in the destination attriubte is + wrong. This H5Ocopy problem will affect the h5copy tool. + +* In the C++ API, it appears that there are bugs in Attribute::write/read + and DataSet::write/read for fixed- and variable-len strings. The problems + are being worked on and a patch will be provided when the fixes are + available. + + +%%%%1.8.0%%%% + + +HDF5 version 1.8.0 released on Tue Feb 12 20:41:19 CST 2008 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between the HDF5-1.6.x release series +and HDF5 1.8.0, and contains information on the platforms tested and known +problems in HDF5-1.8.0. For more details, see the HISTORY-1_0-1_8_0_rc3.txt +file in the +release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.0 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + http://www.hdfgroup.org/products/hdf5/ + +The HDF5 1.8.0 release can be obtained from: + + http://www.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for 1.8.0 can be accessed directly at this location: + + http://www.hdfgroup.org/HDF5/doc/ + +New features in 1.8.0, including brief general descriptions of some new +and modified APIs, are described in the "What's New in 1.8.0?" document: + + http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.0 (current +release) versus Release 1.6.x": + + http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Removed Feature +- Support for new platforms and languages +- Bug Fixes since HDF5-1.6.0 +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + + HDF5 Release 1.8.0 is a major release with many changes and new features. + + New format and interface features discussed in the "What's New in + HDF5 1.8.0" document include the following: + + Enhanced group object management + Enhanced attribute management and more efficient meta data handling + Expanded datatype features + Creation order tracking and indexing + Improved meta data caching and cache control + UTF-8 encoding + New I/O filters: n-bit and scale+offset compression + New link (H5L) and object (H5O) interfaces and features + External and user-defined links + New high-level APIs: + HDF5 Packet Table (H5PT) and HDF5 Dimension Scale (H5DS) + C++ and Fortran interfaces for older high-level APIs: + H5Lite (H5LT), H5Image (H5IM), and H5Table (H5TB) + New and improved tools + And more... + + http://hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + + + New APIs associated with these features, other interface changes + (e.g., ENUM and struct definitions), and new library configuration flags + are listed in the "Release 1.8.0 (current release) versus Release 1.6.x" + section of "HDF5 Software Changes from Release to Release." + + http://hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +Compatibility +------------- + Many HDF5 users and user communities have existing applications that + they may wish to port to Release 1.8.0. Alternatively, some users may + wish to take advantage of Release 1.8.0's improved performance without + having to port such applications. To facilitate managing application + compatibility and porting applications from release to release, the HDF + Team has implemented the following features: + Individually-configurable macros that selectively map common + interface names to the old and new interfaces + Library configuration options to configure the macro mappings + + Two related documents accompany this release: + "API Compatibility Macros in HDF5" discusses the specifics of the + new individually-configurable macros and library configuration + options. + http://hdfgroup.org/HDF5/doc/RM/APICompatMacros.html + + "New Features in HDF5 Release 1.8.0 and Backward/Forward Format + Compatibility Issues" discusses each new feature with regard to + its impact on format compatibility. + http://hdfgroup.org/HDF5/doc/ADGuide/CompatFormat180.html + +Referenced documents +-------------------- + http://hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + "What's New in HDF5 1.8.0" + + http://hdfgroup.org/HDF5/doc/ADGuide/Changes.html + The "Release 1.8.0 (current release) versus Release 1.6.x " + section in "HDF5 Software Changes from Release to Release" + + http://hdfgroup.org/HDF5/doc/RM/APICompatMacros.html + "API Compatibility Macros in HDF5" + + http://hdfgroup.org/HDF5/doc/ADGuide/CompatFormat180.html + "New Features in HDF5 Release 1.8.0 and Backward/Forward Format + Compatibility Issues" + + +Removed Feature +=============== +The stream virtual file driver (H5FD_STREAM) have been removed in this +release. This affects the functions H5Pset_fapl_stream and H5Pget_fapl_stream +and the constant H5FD_STREAM. + +This virtual file driver will be available at +http://hdf5-addons.origo.ethz.ch/. Note that at the time of this release, +the transition is still in progress; the necessary integration tools may +not be available when HDF5 Release 1.8.0 first comes out. + + +Support for New Platforms, Languages, and Compilers +=================================================== + - Support for Open VMS 7.3 was added. + + +Bug Fixes since HDF5-1.6.0 +========================== + This release contains numerous bug fixes. For details, see the + "Changes from 1.6.0 to 1.8.0-rc3" section of the HISTORY.txt file for + this release. + + +Platforms Tested +================ +The following platforms and compilers have been tested for for this release. + + AIX 5.2 (32/64 bit) xlc 8.0.0.11 + xlC 8.0 + xlf 10.01.0000.0 + mpcc_r 6.0.0.8 + mpxlf_r 8.1.1.7 + + FreeBSD 6.2-STABLE i386 gcc 3.4.6 [FreeBSD] 20060305 + (duty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.2.1 20080123 + g++ 4.2.1 20080123 + gfortran 4.2.1 20070620 + + FreeBSD 6.2-STABLE amd64 gcc 3.4.6 [FreeBSD] 20060305 + (liberty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.2.1 20080123 + g++ 4.2.1 20080123 + gfortran 4.2.1 20080123 + + IRIX64 6.5 (64 & n32) MIPSpro cc 7.4.4m + F90 MIPSpro 7.4.4m + C++ MIPSpro cc 7.4.4m + + Linux 2.6.9 (RHEL4) Intel 10.0 compilers + (abe.ncsa.uiuc.edu) + + Linux 2.4.21-47 gcc 3.2.3 20030502 + (osage) + + Linux 2.6.9-42.0.10 gcc 3.4.6 20060404 + (kagiso) PGI 7.0-7 (pgcc, pgf90, pgCC) + Intel 9.1 (icc, ifort, icpc) + + Linux 2.6.16.27 x86_64 AMD gcc 4.1.0 (SuSE Linux), g++ 4.1.0, + (smirom) g95 (GCC 4.0.3) + PGI 6.2-5 (pgcc, pgf90, pgCC) + Intel 9.1 (icc, iort, icpc) + + Linux 2.6.5-7.252.1-rtgfx #1 Intel(R) C++ Version 9.0 + SMP ia64 Intel(R) Fortran Itanium(R) Version 9.0 + (cobalt) SGI MPI + + SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 + (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 95 6.2 + Sun WorkShop 6 update 2 C++ 5.3 + + SunOS 5.10 cc: Sun C 5.8 + (linew) f90: Sun Fortran 95 8.2 + CC: Sun C++ 5.8 + + Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre + (tungsten) gcc 3.2.2 20030222 + Intel(R) C++ Version 9.0 + Intel(R) Fortran Compiler Version 9.0 + + IA-64 Linux 2.4.21.SuSE_292.til1 ia64 + (NCSA tg-login) gcc 3.2.2 + Intel(R) C++ Version 8.1 + Intel(R) Fortran Compiler Version 8.1 + mpich-gm-1.2.5..10-intel-r2 + + Windows XP Visual Studio .NET + Visual Studio 2005 w/ Intel Fortran 9.1 + Cygwin(native gcc compiler and g95) + MinGW(native gcc compiler and g95) + + Windows XP x64 Visual Studio 2005 w/ Intel Fortran 9.1 + + Windows Vista Visual Studio 2005 + + MAC OS 10.4 (Intel) gcc i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 + G95 (GCC 4.0.3 (g95 0.91!) Nov 21 2006) + + Alpha Open VMS 7.3 Compaq C V6.5-001-48BCD + HP Fortran V7.6-3276 + Compaq C++ V6.5-004 + + +Supported Configuration Features Summary +======================================== + + In the tables below + y = tested and supported + n = not supported or not tested in this release + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +SunOS5.8 64-bit n y n y y y +SunOS5.8 32-bit n y n y y y +SunOS5.10 64-bit y(1) y n y y y +SunOS5.10 32-bit y(1) y n y y y +IRIX64_6.5 64-bit n y y y y y +IRIX64_6.5 32-bit n n n n y y +AIX-5.2 32-bit y y y y y y +AIX-5.2 64-bit y y y y y y +Windows XP n y(15) n(15) y y y +Windows XP x64 n y(15) n(15) y y y +Windows Vista n n n y y y +Mac OS X 10.4 PowerPC n n +Mac OS X 10.4 Intel n y n y y y +FreeBSD 4.11 n n n y y y +RedHat EL3 W (3) y(1a) y(10) y(1a) y y y +RedHat EL3 W Intel (3) n y n y y n +RedHat EL3 W PGI (3) n y n y y n +SuSe x86_64 gcc (3,12) y(1a) y(11) n y y y +SuSe x86_64 Int (3,12) n y(13) n y y n +SuSe x86_64 PGI (3,12) n y(8) n y y y +Linux 2.4 Xeon C + Lustre Intel (3,6) n y n y y n +Linux 2.6 SuSE ia64 C + Intel (3,7) y y y y y n +Linux 2.6 SGI Altix + ia64 Intel (3) y y y y y y +Alpha OpenVMS 7.3.2 n y n y n n + + + +Platform Shared Shared Shared static- Thread- + C libs F90 libs C++ libs exec safe +Solaris2.8 64-bit y y y x y +Solaris2.8 32-bit y y y x y +Solaris2.10 64-bit y x y +Solaris2.10 32-bit y x y +IRIX64_6.5 64-bit y y n y y +IRIX64_6.5 32-bit y dna y y y +AIX-5.2 & 5.3 32-bit n n n y n +AIX-5.2 & 5.3 64-bit n n n y n +Windows XP y y(15) y y y +Windows XP x64 y y(15) y y y +Windows Vista y n n y y +Mac OS X 10.3 y y n +FreeBSD 4.11 y n y y y +RedHat EL3 W (3) y y(10) y y y +RedHat EL3 W Intel (3) y y y y n +RedHat EL3 W PGI (3) y y y y n +SuSe x86_64 W GNU (3,12) y y y y y +SuSe x86_64 W Int (3,12) y y y y(14) n +SuSe x86_64 W PGI (3,12) y y y y(14) n +Linux 2.4 Xeon C + Lustre Intel (6) y y y y n +Linux 2.4 SuSE + ia64 C Intel (7) y y y y n +Linux 2.4 SGI Altix + ia64 Intel y y n +Alpha OpenVMS 7.3.2 n n n y n + + Notes: (1) Using mpich 1.2.6. + (1a) Using mpich2 1.0.6. + (2) Using mpt and mpich 1.2.6. + (3) Linux 2.6 with GNU, Intel, and PGI compilers, as indicated. + W or C indicates workstation or cluster, respectively. + + (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp_perfctr_lustre + and Intel compilers + (7) Linux 2.4.21, SuSE_292.till. Ia64 cluster with Intel +compilers + (8) pgf90 + (9) With Compaq Visual Fortran 6.6c compiler. + (10) With PGI and Absoft compilers. + (11) PGI and Intel compilers for both C and Fortran + (12) AMD Opteron x86_64 + (13) ifort + (14) Yes with C and Fortran, but not with C++ + (15) Using Visual Studio 2005 or Cygwin + (16) Not tested for this release. + Compiler versions for each platform are listed in the preceding + "Platforms Tested" table. + + +Known Problems +============== +* We have discovered two problems when running collective IO parallel HDF5 + tests with chunking storage on the ChaMPIon MPI compiler on tungsten, a + Linux cluster at NCSA. + + Under some complex selection cases: + 1) MPI_Get_element returns the wrong value. + 2) MPI_Type_struct also generates the wrong derived datatype and corrupt + data may be generated. + These issues arise only when turning on collective IO with chunking storage + with some complex selections. We have not found these problems on other + MPI-IO compilers. If you encounter these problems, you may use independent + IO instead. + + To avoid this behavior, change the following line in your code + H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + + to + H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT); + + KY - 2007/08/24 + +* For SNL, spirit/liberty/thunderbird: The serial tests pass but parallel + tests failed with MPI-IO file locking message. AKC - 2007/6/25 + +* On Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. + +* For SNL, Red Storm: Only parallel HDF5 is supported. The serial tests pass + when run against the parallel library; the parallel tests also pass, but + with lots of non-fatal error messages. + +* For LLNL, uP: both serial and parallel tests pass. + Zeus: Serial tests pass but parallel tests fail with a known problem in MPI. + ubgl: Serial tests pass but parallel tests fail. + +* On SUN 5.10 C++, testing fails in the "Testing Shared Datatypes with + Attributes" test. + +* Configuring with --enable-debug=all produces compiler errors on most + platforms: Users who want to run HDF5 in debug mode should use + --enable-debug rather than --enable-debug=all to enable debugging + information on most modules. + +* On Mac OS 10.4, test/dt_arith.c has some errors in conversion from long + double to (unsigned) long long and from (unsigned) long long to long double. + +* On Altix SGI with Intel 9.0, testmeta.c would not compile with -O3 + optimization flag. + +* On VAX, the Scaleoffset filter is not supported. The filter cannot be + applied to HDF5 data generated on VAX. The Scaleoffset filter only supports + the IEEE standard for floating-point data. + +* On Cray X1, a lone colon on the command line of h5dump --xml (as in + the testh5dumpxml.sh script) is misinterpereted by the operating system + and causes an error. + +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be + verified with t_mpi test under testpar. + +* On IRIX6.5, when the C compiler version is greater than 7.4, complicated + MPI derived datatype code will work. However, the user should increase + the value of the MPI_TYPE_MAX environment variable to some appropriate value + to use collective irregular selection code. For example, the current + parallel HDF5 test needs to raise MPI_TYPE_MAX to 200,000 to pass the test. + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculating code of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + SLU - 2005/6/30 + +* For version 6 (6.02 and 6.04) of the Portland Group compiler on the AMD + Opteron processor, there is a bug in the compiler for optimization(-O2). + The library failed in several tests, all related to the MULTI driver. + The problem has been reported to the vendor. + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command `poe'. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. + Lastly, request IBM to provide a means to run poe without the debug socket. + +* The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system libraries on + Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on IBM SP2 platform for the serial mode. The parallel mode works fine with + this option. + + It is suggested that you do not use this option on these platforms + during configuration. + +* With the gcc 2.95.2 compiler, HDF5 uses the `-ansi' flag during + compilation. The ANSI version of the compiler complains about not being + able to handle the `long long' datatype with the warning: + + warning: ANSI C does not support `long long' + + This warning is innocuous and can be safely ignored. + +* The ./dsets tests fail on the TFLOPS machine if the test program, + dsets.c, is compiled with the -O option. The HDF5 library still works + correctly with the -O option. The test program works fine if it is + compiled with -O1 or -O0. Only -O (same as -O2) causes the test + program to fail. + +* Not all platforms behave correctly with Szip's shared libraries. Szip is + disabled in these cases, and a message is relayed at configure time. Static + libraries should be working on all systems that support Szip and should be + used when shared libraries are unavailable. + + There is also a configure error on Altix machines that incorrectly reports + when a version of Szip without an encoder is being used. + +* On some platforms that use Intel and Absoft compilers to build the HDF5 + Fortran library, compilation may fail for fortranlib_test.f90, fflush1.f90 + and fflush2.f90 complaining about the exit subroutine. Comment out the line + IF (total_error .ne. 0) CALL exit (total_error). + +* Information about building with PGI and Intel compilers is available in + the INSTALL file sections 4.7 and 4.8. + +* On at least one system, SDSC DataStar, the scheduler (in this case + LoadLeveler) sends job status updates to standard error when you run + any executable that was compiled with the parallel compilers. + + This causes problems when running "make check" on parallel builds, as + many of the tool tests function by saving the output from test runs, + and comparing it to an exemplar. + + The best solution is to reconfigure the target system so it no longer + inserts the extra text. However, this may not be practical. + + In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to + the configure and build. This will cause "make check" to continue after + detecting errors in the tool tests. However, in the case of SDSC DataStar, + it also leaves you with some 150 "failed" tests to examine by hand. + + A second solution is to write a script to run serial tests and filter + out the text added by the scheduler. A sample script used on SDSC + DataStar is given below, but you will probably have to customize it + for your installation. + + Observe that the basic idea is to insert the script as the first item + on the command line which executes the the test. The script then + executes the test and filters out the offending text before passing + it on. + + #!/bin/csh + + set STDOUT_FILE=~/bin/serial_filter.stdout + set STDERR_FILE=~/bin/serial_filter.stderr + + rm -f $STDOUT_FILE $STDERR_FILE + + ($* > $STDOUT_FILE) >& $STDERR_FILE + + set RETURN_VALUE=$status + + cat $STDOUT_FILE + + tail +3 $STDERR_FILE + + exit $RETURN_VALUE + + You get the HDF5 make files and test scipts to execute your filter script + by setting the environment variable "RUNSERIAL" to the full path of the + script prior to running configure for parallel builds. Remember to + "unsetenv RUNSERIAL" before running configure for a serial build. + + Note that the RUNSERIAL environment variable exists so that we can + can prefix serial runs as necessary on the target system. On DataStar, + no prefix is necessary. However on an MPICH system, the prefix might + have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to + get the serial tests to run at all. + + In such cases, you will have to include the regular prefix in your + filter script. + +* H5Ocopy() does not copy reg_ref attributes correctly when shared-message + is turn on. The value of the reference in the destination attriubte is + wrong. This H5Ocopy problem will affect the h5copy tool. + diff --git a/release_docs/HISTORY-1_8_0-1_10_0.txt b/release_docs/HISTORY-1_8_0-1_10_0.txt new file mode 100644 index 0000000..a364274 --- /dev/null +++ b/release_docs/HISTORY-1_8_0-1_10_0.txt @@ -0,0 +1,1742 @@ +HDF5 HISTORY +============= + + +INTRODUCTION + +This document describes the development history between the HDF5-1.8.0 and +HDF5 1.10.0 releases. For more iformation see the SVN log. + +Information about supported and tested platforms is provided for historical +reasons only and may not be accurate. + + +For more information, see the HDF5 home page: + + http://www.hdfgroup.org/HDF5/ + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS + +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.8.0 +- Supported Platforms +- Tested Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Configuration: + ------------- + - Java JNI library API wrappers and supporting files added as HDF_JAVA language + option. Both configure and CMake disable this option by default. + HDFFV-9552 (ADB 2016/02.28) + - CMake minimum is now 3.1.0. (ADB 2015/11/14) + - cmakehdf5: configure options added to enable or disable the building of + different API's and testings. See "cmakehdf5 --help" for details. + (AKC - 2014/12/09 HDFFV-8932) + - Autotools: Automake updated to 1.14.1 (ADB - 2014/04/08) + - CMake: Moved minimum CMake version to 2.8.11 which enables better library + include processing. (ADB - 2014/03/26) + - New configuration option added to change the default plugin path. + configure option is --with-default-plugin=location + cmake option is -DH5_DEFAULT_PLUGINDIR:PATH=location + HDFFV-8513. (ADB 2013/09/04) + - Rename FFLAGS to FCFLAGS in configure (ADB 2013/08/13) + - CMake minimum is now 2.8.10. (ADB 2013/01/14) + - A new tool, cmakehdf5, which is a build command script similar to + buildhdf5 is added and is available in the bin directory. + (AKC - 2012/12/12) + - Fixed AIX Fortran compiler flags to use appropriate settings for + debugging, profiling, optimization situations. HDFFV-8069. (AKC + 2012/09/27) + - Updated to latest autotools and changed all hard *.sh scripts to + configure managed *.sh.in files. Removed overloading of autotools + TESTS variable by examples and tests. Renamed configure.in to + configure.ac. (ADB - 2012/08/23 - HDFFV-8129) + - Added code to display the version information of XL fortran and C++ + in the summary of configure. (AKC - 2012/02/28 - HDFFV-7793) + - Configure now generates Makefiles that build in "silent make mode" + by default in which compile and link lines are significantly + simplified for clarity. To override this and view actual compile and + link lines during building, the --disable-silent-rules flag can be used + at configure time, or the 'make' command can be followed by V=1, to + indicate a "verbose" make. (MAM - 2011/4/14). + - Added mpicc and mpif90 as the default C and Fortran compilers for Linux + systems when --enable-parallel is specified but no $CC or $FC is defined. + (AKC - 2011/2/7) + - Added a new configure option, "--enable-unsupported", which can + be used to stop configure from preventing the use of unsupported + configure option combinations, such as c++ in parallel or parallel + HDF5 with threadsafe. Use at your own risk, as it may result in a + library that won't compile or run as expected! + (MAM - 2010/11/17 - Bug 2061) + - PHDF5 changed to use "mpiexec", instead of mpirun, as the default MPI + applications startup command as defined in the MPI-2 definition, section + 4.1. (AKC - 2010/6/11 - Bug 1921) + - Configure now adds appropriate defines for supporting large (64-bit) + files on all systems, where supported, by default, instead of only linux. + This largefile support is controllable with the --enable-largefile + configure option. This is replacing the linux-specific --enable-linux-lfs + option, which has been removed from configure. + (MAM - 2010/05/05 - 1772/1434) + - Upgraded versions of autotools used to generate configuration suite. + We now use Automake 1.11.1, Autoconf 2.65, and Libtool 2.2.6b. + MAM 2010/04/15. + - Added the xlc-* and mpcc_r-* BASENAME patterns to be recognized as IBM + compilers so that the ibm compiler options can be added properly. This + allows non-system-default compiler command names (e.g. xlc-m.n.k.l) be + recognized. AKC 2009/11/26. + - Configuration suite now uses Automake 1.11 and Autoconf 2.64. + MAM 2009/08/11. + - Changed default Gnu fortran compiler from g95 to gfortran since + gfortran is more likely installed with gcc now. -AKC 2009/07/19- + - Added libtool version numbers to generated c++, fortran, and + hl libraries. MAM 2009/04/19. + - Regenerated Makefile.ins using Automake 1.10.2. MAM 2009/04/19. + - Added a Make target of check-all-install to test the correctness of + installing via the prefix= or $DESTDIR options. AKC - 2009/04/14 + - Configuration suite now uses Libtool 2.2.6a. MAM 2008/10/24 + + - Configuration suite now uses Autoconf 2.61, Automake 1.10.1. + MAM 2008/05/05. + + - The new configure option "--disable-sharedlib-rpath" disables + embedding the '-Wl,-rpath' information into executables when + shared libraries are produced, and instead solely relies on the + information in LD_LIBRARY_PATH. (MAM - 2008/05/15) + + Library: + -------- + + - Virtual Dataset feature was added + (NAF - 2015-10-05, VDS-193) + + - H5F_ACC_DEBUG labeled "deprecated" + + The symbol was originally used to emit some extra debugging + informationi in the multi VFD. The underlying functionality + was removed due to disuse in HDF5 1.8.16 though the symbol + remained defined since it was visible in H5Fpublic.h. + + In this release, the symbol has been labeled deprecated and will + not be defined when H5_NO_DEPRECATED_SYMBOLS is defined. + + (DER - 2015-04-30, HDFFV-1074) + + - The library can load filter libraries dynamically during runtime. Users + can set the search path through environment variable HDF5_PLUGIN_PATH + and call H5Pset_filter to enable a dynamic filter. (SLU - 2013/04/08) + - Added new API functions H5Dscatter and H5Dgather to scatter data to and + and gather data from a selection within a memory buffer. + (NAF - 2013/02/05) + - The library now supports the data conversion from enumeration to numeric + (integer and floating-point number) datatypes. See Issue 8221. + (SLU - 2012/10/23) + - The data sieve buffer size was for all the datasets in the file. It + could waste memory if any dataset size is smaller than the sieve buffer + size. Now the library picks the smaller one between the dataset size + and the sieve buffer size from the file access property. See Issue 7934. + (SLU - 2012/4/2) + - I added a new parameter of object access property list to the function + H5Rdereference (Issue 2763). It's called H5Rdereference2 now. The former + H5Rdereference function has been deprecated to H5Rdereference1. (SLU - + 2011/7/18) + - H5Tcreate now supports string type (fixed-length and variable-length). + (SLU - 2011/05/20) + - Added ability to cache files opened through external links. Added new + public functions H5Pset_elink_file_cache_size(), + H5Pget_elink_file_cache_size(), and H5Fclear_elink_file_cache(). + (NAF - 2011/02/17) + - Removed all old code for Metraowerks compilers, bracketed by + __MWERKS__). Metraowerks compiler is long gone. (AKC - 2010/11/17) + - Added support for threadsafety on windows using the windows threads + library. Use the HDF5_ENABLE_THREADSAFE option in CMake while on a + windows platform to enable this functionality. This is supported on + Windows Vista and newer Windows operating systems. (MAM - 2010/09/10) + - When a mandatory filter failed to write data chunks, the dataset + couldn't close (bug 1260). The fix releases all resources and closes + the dataset but returns a failure. (SLU - 2010/9/8) + - H5Tset_order and H5Tget_order now support all data types. A new byte + order H5T_ORDER_MIXED has been added specifically for compound datatype + and its derived type. Please see bug #1934. (SLU - 2010/8/23) + - Improved performance of the chunk cache by avoiding unnecessary b-tree + lookups of chunks already in cache. (NAF - 2010/06/15) + - Greatly improved performance of extending a dataset with early + allocation. (NAF - 2010/03/24 - 1637) + - Added support for filtering densely stored groups. Many of the API + functions related to filters have been extended to support dense groups + as well as datasets. Pipeline messages can now be stored in a group's + object header. (NAF/QAK - 2009/10/8) + - The embedded library information is displayed by H5check_version() if a + version mismatch is detected. Also changed H5check_version() to + suppress the warning message totally if $HDF5_DISABLE_VERSION_CHECK is 2 + or higher. (Old behavior treated 3 or higher the same as 1, that is + print a warning and allows the program to continue. (AKC - 2009/9/28) + - If a user does not care for the extra library information insert + in the executables, he may turn it off by --disable-embedded-libinfo + during configure. (AKC - 2009/9/15) + - Corrected problem where library would re-write the superblock in a file + opened for R/W access, even when no changes were made to the file. + (QAK - 2009/08/20, Bz#1473) + - Separated "factory" free list class from block free lists. These free + lists are dynamically created and manage blocks of a fixed size. + H5set_free_list_limits() will use the same settings specified for block + free lists for factory free lists. (NAF - 2009/04/08) + - Added support for dense attributes to H5Ocopy. (XCao/NAF - 2009/01/29) + - Added H5Pset_elink_cb and H5Pget_elink_cb functions to support a + user-defined callback function for external link traversal. + (NAF - 2009/01/08) + - Added H5Pset_elink_acc_flags and H5Pget_elink_acc_flags functions to + allow the user to specify the file access flags used to open the target + file of an external link. (NAF - 2009/01/08) + - Added H5Pset_chunk_cache() and H5Pget_chunk_cache() functions to allow + individual rdcc configuration for each dataset. Added + H5Dget_access_plist() function to retrieve a dataset access property + list from a dataset. (NAF - 2008/11/12) + - Added H5Iis_valid() function to check if an id is valid without producing + an error message. (NAF - 2008/11/5) + - Added two new public routines: H5Pget_elink_fapl() and + H5Pset_elink_fapl(). (see bug #1247) (VC - 2008/10/13) + - Improved free space tracking in file to be faster. (QAK - 2008/10/06) + - Added 'mounted' field to H5G_info_t struct. (QAK - 2008/07/15) + + Parallel Library: + ----------------- + - Add H5Pget_mpio_no_collective_cause() function that retrive reasons + why the collective I/O was broken during read/write IO access. + (JKM - 2012/08/30 HDFFV-8143) + - Special Collective IO (IO when some processes do not contribute to the + IO) and Complex Derived Datatype MPI functionalities are no longer + conditionally enabled in the library by configure. They are always + enabled in order to take advantage of performance boosts from these + behaviors. Older MPI implementations that do not allow for these + functionalities can no longer by used by HDF5. (MAM - 2011/07/08). + - Modified parallel tests to run with arbitrary number of processes. The + modified tests are testphdf5 (parallel dataset access), t_chunk_alloc + (chunk allocation), and t_posix_compliant (posix compliance). The rest of + the parallel tests already use in the code the number of processes + available in the communicator. (CMC - 2009/04/28) + + Fortran Library: + ---------------- + + - Added parallel routine H5Pget_mpio_actual_io_mode_f (MSB - 2012/09/27) + + - Added for the C API the Fortran wrapper: + h5ocopy_f (MSB - 2012/03/22) + + + HDF5 Fortran library was enhanced to support Fortran 2003 standard. + The following features are available when the HDF5 library is configured + using --enable-fortran --enable-fortran2003 configure flags AND + if fortran compiler is Fortran2003 compliant: + + - Subroutines overloaded with the C_PTR derived type: + h5pget_f + h5pget_fill_value_f + h5pinsert_f + h5pregister_f + h5pset_f + h5pset_fill_value_f + h5rcreate_f + h5rderefrence_f + h5rget_name_f + h5rget_obj_type_f + - Subroutines overloaded with the C_PTR derived type + and simplified signatures: + h5aread_f + h5awrite_f + h5dread_f + h5dwrite_f + - New subroutines + h5dvlen_reclaim_f + h5literate_by_name_f + h5literate_f + h5ovisit_f + h5tconvert_f + + - Subroutines with additional optional parameters: + h5pcreate_class_f + (EIP - 2011/10/14) + + - Added for the C APIs the Fortran wrappers: + h5dget_access_plist_f + h5iis_valid_f + h5pset_chunk_cache_f + h5pget_chunk_cache_f + (MSB - 2009/04/17) + + + + C++ Library: + ------------ + - New member function added + + The assignment operator ArrayType::operator= is added because ArrayType + has pointer data members. + + (BMR, 2016/03/07, HDFFV-9562) + + - New member functions + + Overloaded CommonFG::getObjnameByIdx to take char* for name + + Overloaded CommonFG::getObjTypeByIdx to return type name as a char*. + (BMR - 2010/05/02) + + DataSet::getInMemDataSize() to simplify getting the dataset's + data size in memory. (BMR - 2009/07/26) + - These member functions were added as wrapper for H5Rdereference to + replace the incorrect IdComponent::dereference(). + void H5Object::dereference(H5File& h5file, void* ref) + void H5Object::dereference(H5Object& obj, void* ref) + In addition, these constructors were added to create the associated + objects by way of dereference: + Attribute(H5Object& obj, void* ref); + Attribute(H5File& file, void* ref); + DataSet(H5Object& obj, void* ref); + DataSet(H5File& file, void* ref); + DataType(H5Object& obj, void* ref); + DataType(H5File& file, void* ref); + Group(H5Object& obj, void* ref); + Group(H5File& obj, void* ref); + (BMR - 2008/08/10) + + + + Tools: + ------ + - h5repack: Added ability to use plugin filters. HDFFV-8345 (ADB - 2013/09/04). + - h5dump: Added option -N --any_path, which searches the file for paths that + match the search path. HDFFV-7989 (ADB - 2013/08/12). + - h5dump: Added optional arg 0 to -A, which excludes attributes from display. + HDFFV-8134 (ADB - 2013/08/01). + - h5dump: Fixed displaying compression ratio for unknown or user-defined + filters. HDFFV-8344 (XCAO 2013/03/19) + - h5dump: Changed UNKNOWN_FILTER to USER_DEFINED_FILTER for user defined filter. + HDFFV-8346 (XCAO 2013/03/19) + - h5dump: Added capability for "-a" option to show attributes containing "/" + by using an escape character. For example, for a dataset "/dset" + containing attribute "speed(m/h)", use "h5dump -a "/dset/speed(\/h)" + to show the content of the attribute. See details at HDFFV-7523 + (PC -- 2012/03/12) + - h5dump: Added ability to apply command options across multiple files using a + wildcard in the filename. Example; "h5dump -H -d Dataset1 tarr*.h5". + HDFFV-7876 (ADB - 2012/03/12). + - h5repack: Improved performance for big chunked datasets (size > 128MB) + when used with layout (-l) or compression (-f) option. + It would perform much better prior to the improvement, + especially for cases that chunk dimentions looks like + "1024x5x1" (compare to "1x5x1024"). When bigger numbers + are toward front and smaller number is toward back in chunk + dimentions. HDFFV-7862 (JKM - 2012/03/01) + - h5dump: Added new option --no-compact-subset. This option will not + interpret the '[' character as starting the compact form of + subsetting. This is useful when the "h5dump error: unable to + open dataset "datset_name"" message is output because a dataset + name contains a '[' character. HDFFV-7689 (ADB - 2012/01/31) + - h5dump: Corrected schema location: + + (ADB - 2011/08/10) + - h5diff: Added new level for -v (verbose) option. The new levels are + 1 and 2. So -v1 and -v2 can be specified to view more + information about attributes differences. + Bug#2121 (JKM 2011/3/23) + - h5dump: Added new option --enable-error-stack. This option will display + error stack information in the output stream. This is useful + when the "h5dump: Unable to print data" message is output. + (ADB - 2011/02/24) + - h5diff: Add a new flag --exclude-path. Specified path to an object will + be excluded from comparing the two files or two groups. If group + is specified all the member objects will be excluded. + (JKM - 2010/09/16). + - h5ls: Add new flag --no-dangling-links. (refer to --help for details) + (JKM - 2010/06/15) + - h5ls: Add new flag --follow-symlinks. (refer to --help for details) + (JKM - 2010/05/25) + - h5diff: Add new flag --no-dangling-links. (refer to --help for details) + (JKM - 2010/02/10) + - h5diff: Add new flag --follow-symlinks. (refer to --help for details) + (JKM - 2010/01/25) + - h5diff: fix for displaying garbage value on LE machine for BE data. + (JKM - 2009/11/20) + - h5dump: subsetting now allows default for count. Also trailing ; in short form + can be omitted after last specified value. + (ADB - 2009/09/04) + - h5dump/h5ls: now can display data in region references + using new -R, --region flag. + (ADB - 2009/09/04) + - h5diff: new flag, -c, --compare, list objects that are not comparable. + (PVN - 2009/4/10 - 1368) + - h5diff new flag, -N, --nan, avoids NaNs detection. (PVN - 2009/4/10) + - h5dump correctly specifies XML dtd / schema urls (ADB - 2009/4/3 - 1519) + - h5repack now handles group creation order. (PVN - 2009/4/2 - 1402) + - h5dump: added a printing of the compression ratio of uncompressed and compressed + sizes for cases where compression filters are present. (PVN - 2008/05/01) + - h5dump: added an option to allow a user defined formatting string for printf + regarding floating point numbers. (PVN - 2008/05/06) + - h5dump: support for external links, display the object that the external link + points to. (PVN - 2008/05/12) + - h5repack: add a userblock to an HDF5 file during the repack. (PVN - 2008/08/26) + - h5repack: add 2 options that call H5Pset_alignment in the repacked file. (PVN - 2008/08/29) + - h5ls: added capability to traverse through external links when the -r + (recursive) flag is given. (NAF - 2008/09/16) + - h5ls: added -E option to enable traversal of external links. h5ls will + not traverse external links without this flag being set. + (NAF - 2008/10/06) + - h5diff: added support for long double (PVN - 2008/10/28) + - h5dump: binary output defaults to NATIVE with -b optionally accepting + the form of binary output (NATIVE, FILE, BE, LE). (PVN - 2008/10/30) + - h5diff: return 1 for file differences when both file graphs differ by any object. + Error return code was changed to 2 from -1. (PVN - 2008/10/30) + - h5import: TEXTFPE (scientific format) was deprecated. Use TEXTFP + instead (PVN - 2008/10/30) + - h5repack: When user doesn't specify a chunk size, h5repack now defines a default + chunk size as the same size of the size of the hyperslab used to read the chunks. + The size of the hyperslabs are defined as the size of each dimension or a + predefined constant, whatever is smaller. This assures that the chunk + read fits in the chunk cache. (PVN - 2008/11/21) + - h5diff: h5diff treats two INFINITY values different. Fixed by checking (value==expect) + before call ABS(...) at h5diff_array.c This will make that (INF==INF) is true + (INF is treated as an number instead of NaN) (PC -- 2009/07/28) + - h5diff: add option "--use-system-epsilon" to print difference if (|a-b| > EPSILON) + Change default to use strict equality (PC -- 2009/09/12) + + + High-Level APIs: + --------------- + + C Packet Table API + ------------------ + - Replacement of a public function + + The existing function H5PTcreate_fl limits applications to deflate + compression only. The public function H5PTcreate is added to replace + H5PTcreate_fl. H5PTcreate takes a property list ID to provide + flexibility on creation properties. + + hid_t H5PTcreate(hid_t loc_id, const char *dset_name, + hid_t dtype_id, hsize_t chunk_size, hid_t plist_id); + (BMR, 2016/03/04, HDFFV-8623) + + - New public functions + + Two accessor functions were added per HDFFV-8623/patch 003. + /* Returns the ID of the dataset associated with the packet table */ + hid_t H5PTget_dataset(hid_t table_id); + + /* Returns the ID of the datatype the packet table uses */ + hid_t H5PTget_type(hid_t table_id); + (BMR, 2016/03/04, HDFFV-8623) + + - Regarding #ifdef VLPT_REMOVED + + The #ifdef VLPT_REMOVED blocks are removed from the PT library source + except the following cases: + + H5PTis_varlen() is made available again. + + H5PTfree_vlen_readbuff() now became H5PTfree_vlen_buff() + (BMR, 2016/03/04, HDFFV-442) + + C++ Packet Table API + -------------------- + - New constructor + + An overloaded constructor is added to FL_PacketTable and takes a property + list ID to provide flexibility on creation properties. + + FL_PacketTable(hid_t fileID, hid_t plist_id, const char* name, hid_t dtypeID, hsize_t chunkSize); + (BMR, 2016/03/08, HDFFV-8623) + + - New public functions + + Two accessor wrappers to class PacketTable, per HDFFV-8623/patch 004. + /* Returns the ID of the dataset associated with the packet table */ + hid_t PacketTable::GetDataset() + + /* Returns the ID of the datatype the packet table uses */ + hid_t PacketTable::GetDataset() + (BMR, 2016/03/04, HDFFV-8623) + + - Member functions having "char*" as an argument + + Overloaded functions were added to provide "const char*" argument, the + existing version will be deprecated. + (BMR, 2016/03/04) + + - Regarding #ifdef VLPT_REMOVED + + The #ifdef VLPT_REMOVED blocks are removed from the PT library source + except the following cases: + + VL_PacketTable::IsVariableLength() is moved to PacketTable + + VL_PacketTable::FreeReadBuff() now became PacketTable::FreeBuff() + + (BMR, 2016/03/04, HDFFV-442) + + + Internal header file + -------------------- + - A new API function H5DOwrite_chunk. It writes a data chunk directly + into a file bypassing hyperslab selection, data conversion, and + filter pipeline. The user must be careful with the function and + clearly understand the I/O process of the library. + (SLU - 2013/2/11) + - New API: h5ltpath_valid (Fortran: h5ltpath_valid_f) which checks + if a path is correct and determines if a link resolves to a valid + object and checks that the link does not dangle. (MSB- 2012/3/15) + + - Added Fortran wrappers for Dimension Scale APIs. HDFFV-3797 + h5dsset_scale_f + h5dsattach_scale_f + h5dsdetach_scale_f + h5dsis_attached_f + h5dsis_scale_f + h5dsset_label_f + h5dsget_label_f + h5dsget_scale_name_f + h5dsget_num_scales_f + (EIP for SB - 2011/10/13) + + - Table: In version 3.0 of Table, "NROWS" (used to store number of records) was + deprecated (PVN - 2008/11/24) + + Documentation + ------------- + +Support for new platforms, languages and compilers. +======================================= + - Intel V11.1 uses now -O3 optimization in production mode (EIP - 2010/10/08) + - PathScale compilers are recognized and can build the HDF5 library + properly. AKC - 2009/7/28 - + - SunOS 5.11 (emu) 32-bit and 64-bit with Sun C/C++ 5.12 compiler and + Sun Fortran 95 8.6 compiler. (SLU - 2013/04/15) + +Bug Fixes since HDF5-1.8.0 release +================================== + + Library + ------- + - Incorrect usage of list in CMake COMPILE_DEFINITIONS set_property + + The CMake command, set_property with COMPILE_DEFINITIONS property + needs a quoted semi-colon separated list of values. CMake will + transform the list to a series of -D{value} for the compile. + + (ADB - 2014/12/09, HDFV-9041) + + - H5Z.c: H5Zfilter_avail(H5Z_filter_t id) + Added else block if the call to the internal H5Z_filter_avail(id) does not + fail and returns FALSE. This block calls the H5PL_load(H5PL_TYPE_FILTER, (int)id) + function to attempt to dynamically load the filter plugin. + (ADB - 2014/03/03 HDFFV-8629) + - Added const qualifier to source buffer parameters in H5Dgather and + H5D_scatter_func_t (H5Dscatter callback). (NAF - 2013/7/02) + - Fixed an error involving failure to write fill values to the user's + buffer when reading unallocated chunks from datasets that have a + fill value set to H5D_FILL_VALUE_DEFAULT. A consequence of this + was the reporting of spurious data values in h5dump and h5diff + output. + (HDFFV-8247; JP - 2013/05/03) + - Fixed an error that could occur when calling H5Ocopy within an + H5Literate callback (and possibly other situations). + (NAF - 2012/7/25 - HDFFV-5853) + - Fixed an error that would occur when copying an object with attribute + creation order tracked and indexed. (NAF - 2012/3/28 - HDFFV-7762) + - Fixed a bug in H5Ocopy(): When copying an opened object, call the + object's flush class action to ensure that cached data is flushed + so that H5Ocopy will get the correct data. + (VC - 2012/3/27 - HDFFV-7853) + - When an application tries to write or read many small data chunks and + runs out of memory, the library had a seg fault. The fix is to + return the error stack with proper information. (SLU - 2012/3/23. + Issue 7785) + - H5Pset_data_transform had seg fault in some cases like x*-100. It + works correctly now and handles other cases like 100-x or 2/x. + (SLU - 2012/3/15. Issue 7922) + - Fixed rare corruption bugs that could occur when using the new object + header format. (NAF - 2012/3/15 - HDFFV-7879) + - Creating a dataset in a read-only file caused seg fault when the file + is closed. It's fixed. The attemp to create a dataset will fail + with the error stack indicating the file is read-only. (SLU - + 2012/1/25. Issue 7756) + - Fixed a seg fault that could occur when shrinking a dataset with chunks + larger than 1 MB. (NAF - 2011/11/30 - HDFFV-7833) + - Fixed a bug that could cause file corruption when copying named + datatypes to a file using shared messages. (NAF - 2011/11/14) + - Fixed a bug that could cause H5Oget_info to return the wrong address + after copying a named datatype. (NAF - 2011/11/14) + - The library allowed the conversion of strings between ASCII and UTF8 + (Issue 7582). We have corrected it to report an error under this + situation. (SLU - 2011/11/8) + - The library had seg fault when it tried to shrink the size of compound type + through H5Tset_size immediately after the type was created (Issue + 7618). It's fixed now. (SLU - 2011/10/26) + - Fixed a bug that occurred when using H5Ocopy on a committed datatype + containing an attribute using that committed datatype. + (NAF - 2011/10/13 - Issue 5854) + - #ifdef _WIN32 instances changed to #ifdef H5_HAVE_WIN32_API and added + H5_HAVE_VISUAL_STUDIO checks where necessary. CMake only as configure + never set _WIN32. + - CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + discovered 3 problems in tests and tools' library (Issue 7674): + 1. In dsets.c, left shifting an unsigned int for 32 bits or more + caused undefined behavior. + 2. In dt_arith.c, the INIT_INTEGER macro definition has an overflow + when the value is negative minimal and is being subtracted one. + 3. In tools/lib/h5tools_str.c, right shifting an int value for 32 bits + or more caused undefined behavior. + All the problems have been corrected. (SLU - 2011/9/2) + - In v1.6 library, there was EOA for the whole MULTI file saved in the + super block. We took it out in v1.8 library because it's meaningless + for the MULTI file. v1.8 library saves the EOA for the metadata file, + instead. But this caused some backward compatibility problem. + v1.8 library couldn't open the file created with v1.6 library. We + fixed the problem by checking the EOA value to detect the file + created with v1.6 library. (SLU - 2011/6/22) + - When a dataset had filters and reading data failed, the error message + didn't say which filter isn't registered. It's fixed now. + (SLU - 2011/6/3) + - The datatype handler created with H5Tencode/decode used to have the + reference count 0 (zero). I have fixed it. It is 1 (one) now. + (SLU - 2011/2/18) + - Fixed a bug that caused big endian machines to generate corrupt files + when using the scale-offset filter with floating point data or + fill values. Note that such datasets will no longer be readable + by any machine after this patch. (NAF - 2010/02/02 - Bug 2131) + - Retrieving a link's name by index in the case where the link is + external and the file that the link refers to doesn't exist will + now fail gracefully rather than cause a segmentation fault. + (MAM - 2010/11/17) + - Modified library to always cache symbol table information. Libraries + version 1.6.3 have a bug which causes them to require this + information for some operations. (NAF - 2010/09/21 - 1864) + - Fixed a bug that could occur when getting information for a new-style + group that was previously opened through a file handle that was + later closed. (NAF - 2010/09/15) + - Added define check in H5public.h if stdint.h is supported by the C++ + compiler. This define is only available on Windows with VS2010 and + using CMake to build the library. (ADB - 2010/09/13 - Bug 1938) + - H5Eset_current_stack now also closes the error stack to be set as the + default. This is to avoid a potential problem (Bug 1799). + (SLU - 2010/9/7) + - Fixed the bug in the filter's public CAN_APPLY function. The return + value should be htri_t not herr_t (Bug #1239). (SLU - 2010/8/5) + - Fixed a bug in the direct I/O driver that could render files with + certain kinds of unaligned data unreadable or corrupt them. + (NAF - 2010/07/28) + - valgrind reported an error of copying data to itself when a new attribute + is written (Bug #1956). I fixed it by taking out the memcpy step in + the attribute code. (SLU - 2010/07/28) + - Fixed a bug that could cause file corruption when using non-default + sizes of addresses and/or lengths. This bug could also cause + uncorrupted files with this property to be unreadable. This bug + was introduced in 1.8.5. (NAF - 2010/07/16 - 1951) + - Fixed a file corruption bug that could happen when shrinking a + compressed dataset. (NAF - 2010/05/20) + - Fixed some memory leaks in VL datatype conversion when strings are + used as fill values. (MAM - 2010/05/12 - BZ# 1826) + - Fixed a bug when copying objects with NULL references with the + H5O_COPY_EXPAND_REFERENCE_FLAG flag set. (NAF - 2010/04/08 - 1815) + - Files can now be concurrently opened more than once using the core file + driver, as long as the backing store is used. (NAF - 2010/03/09) + - Added support for H5O_COPY_EXPAND_EXT_LINK_FLAG to H5Ocopy. External + links will now be expanded if this flag is set. + (NAF - 2010/03/05 - 1733) + - Fixed a bug where the library, when traversing an external link, would + reopen the source file if nothing else worked. (NAF - 2010/03/05) + - Fixed an intermittent bug in the b-tree code which could be triggered + by expanding and shrinking chunked datasets in certain ways. + (NAF - 2010/02/16) + - H5Tdetect_class said a VL string is a string type. But when it's + in a compound type, it said it's a VL type (Bug #1584). I fixed it + to be consistent. It always return string type. (SLU - 2009/12/10) + - Fixed a bug where writing and deleting many global heap objects (i.e. + variable length data) would render the file unreadable. Previously + created files exhibiting this problem should now be readable. + (NAF - 2009/10/27 - 1483) + - Fixed incorrect return value for H5Pget_preserve. (AKC - 2009/10/08 - 1628) + - Fixed an assertion failure that occurred when H5Ocopy was called on a + dataset using a vlen inside a compound. (NAF - 2009/10/02 - 1597) + - Fixed incorrect return value for H5Pget_filter_by_id1/2 in H5Ppublic.h. + (NAF - 2009/09/25 - 1620) + - Fixed a bug where properties weren't being compared with the registered + compare callback. (NAF - 2009/09/25 - 1555) + - Fixed a bug where H5Pget_fitler_by_id would succeed when called for a + filter that wasn't present. (NAF - 2009/06/25 - 1250) + - Fixed an issue with committed compound datatypes containing a vlen. + Also fixed memory leaks involving committed datatypes. + (NAF - 2009/06/10 - 1593) + - Added versioning to H5Z_class_t struct to allow compatibility with 1.6 + API. (NAF - 2009/04/20 - 1533) + - Fixed a problem with using data transforms with non-native types in the + file. (NAF - 2009/04/20 - 1548) + - Added direct.h include file to windows section of H5private.h + to fix _getcwd() warning. (ADB - 2009/04/14 - 1536) + - Fixed a bug that prevented external links from working after calling + H5close(). (NAF - 2009/04/10 - 1539) + - Modified library to write cached symbol table information to the + superblock, to allow library versions 1.3.0 to 1.6.3 to read files + created by this version. (NAF - 2009/04/08 - 1423) + - Changed skip lists to use a deterministic algorithm. The library should + now never call rand() or srand(). (NAF - 2009/04/08 - 503) + - Fixed a bug where H5Lcopy and H5Lmove wouldn't create intermediate + groups when that property was set. (NAF - 2009/04/07 - 1526) + - Fixed a bug that caused files with a user block to grow by the size of + the user block every time they were opened. + (NAF - 2009/03/26 - 1499) + - Fixed a rare problem that could occur with files using the old (pre 1.4) + array datatype. (NAF - 2009/03/23) + - Modified library to be able to open files with corrupt root group symbol + table messages, and correct these errors if they are found. Such + files can only be successfully opened with write access. + (NAF - 2009/03/23 - 1189) + - Removed the long_long #define and replaced all instances with + "long long". This caused problems with third party products. All + currently supported compliers support the type. (ADB - 2009/03/05) + - Fixed various bugs that could prevent the fill value from being written + in certain rare cases. (NAF - 2009/02/26 - 1469) + - Fixed a bug that prevented more than one dataset chunk from being cached + at a time. (NAF - 2009/02/12 - 1015) + - Fixed an assertion failure caused by opening an attribute multiple times + through multiple file handles. (NAF - 2009/02/12 - 1420) + - Fixed a problem that could prevent the user from adding attributes (or + any object header message) in some circumstances. + (NAF - 2009/02/12 - 1427) + - Fixed a bug that could cause problems when an attribute was added to a + committed datatype using the committed datatype's datatype. + (NAF - 2009/02/12) + - Fixed a bug that could cause problems when copying an object with a + shared message in its own object header. (NAF - 2009/01/29) + - Changed H5Tset_order to properly reject H5T_ORDER_NONE for most + datatypes. (NAF - 2009/01/27 - 1443) + - Fixed a bug where H5Tpack wouldn't remove trailing space from an + otherwise packed compound type. (NAF - 2009/01/14) + - Fixed up some old v2 btree assertions that get run in debug mode that + were previously failing on compilation, and removed some of the + more heavily outdated and non-rewritable ones. (MAM - 2008/12/15) + - Fixed a bug that could cause problems when "automatically" unmounting + multiple files. (NAF - 2008/11/17) + - H5Ovisit and H5Ovisit_by_name will now properly terminate when the + callback function returns a positive value on the starting object. + (NAF - 2008/11/03) + - Fixed an error where a null message could be created that was larger + than could be written to the file. (NAF - 2008/10/23) + - Corrected error with family/split/multi VFD not updating driver info + when "latest" version of the file format used. (QAK - 2008/10/14) + - Corrected alignment+threshold errors to work correctly when metadata + aggregation is enabled. (QAK - 2008/10/06) + - Changed H5Fget_obj_count and H5Fget_obj_ids to ignore objects registered + by the library for internal library use. (NAF - 2008/10/06) + - Fixed potential memory leak during compound conversion. + (NAF - 2008/10/06) + - Changed the return value of H5Fget_obj_count from INT to SSIZE_T. Also + changed the return value of H5Fget_obj_ids from HERR_T to SSIZE_T and + the type of the parameter MAX_OBJS from INT to SIZE_T. (SLU - 2008/09/26) + - Fixed an issue that could cause data to be improperly overwritten + during compound type conversion. (NAF - 2008/09/19) + - Fixed pointer alignment violations that could occur during vlen + conversion. (NAF - 2008/09/16) + - Fixed problem where library could cause a segmentation fault when + an invalid location ID was given to H5Giterate(). (QAK - 2008/08/19) + - Fixed improper shutdown when objects have reference count > 1. The + library now tracks reference count due to the application separately + from that due to internal library routines. (NAF - 2008/08/19) + - Fixed assertion failure caused by incorrect array datatype version. + (NAF - 2008/08/08) + - Fixed an issue where mount point traversal would fail when using + multiple handles for the child. (NAF - 2008/08/07) + - Fixed an issue where mount points were inaccessible when using multiple + file handles for the parent. The mount table is now in the shared + file structure (the parent pointer is still in the top structure). + (NAF - 2008/08/07) + - when an attribute was opened twice and data was written with one of the handles, + the file didn't have the data. It happened because each handle had its own + object structure, and the empty one overwrote the data with fill value. This is + fixed by making some attribute information like the data be shared in the + attribute structure. SLU - 2008/07/22 + - Fixed issue where a group could have a file mounted on it twice. + (QAK - 2008/07/15) + - Fixed a Windows-specific issue in the ohdr test which was causing users + in some timezones to get false errors. This a deficiency in the Windows + mktime() function, and has been handled properly. SJW - 2008/06/19 + - Fixed the problem with the searching of target file for H5Lcreate_external(). + The searching pattern will depend on whether the target file's + pathname is an absolute or a relative path. Please see the description + in the RM for H5Lcreate_external(). (VC - 2008/04/08) + - Fixed possible file corruption bug when encoding datatype + descriptions for compound datatypes whose size was between + 256 & 511 bytes and the file was opened with the "use the + latest format" property enabled (with H5Pset_libver_bounds). + (QAK - 2008/03/13) + - Fixed bug in H5Aget_num_attrs() routine to handle invalid location + ID correctly. (QAK - 2008/03/11) + - H5Dset_extent: when shrinking dimensions, some chunks were not deleted. + (PVN - 2009/01/8) + - Added code to maintain a min_clean_fraction in the metadata cache when + in serial mode. (MAM - 2009/01/9) + + + + Configuration + ------------- + - CMake: When CMake commands are executed individually on the command line + and the external filters are being built, the CMAKE_BUILD_TYPE define + must be set to the same value as the configuration + (-DCMAKE_BUILD_TYPE:STRING=Release if using -C Release). This is needed + by the the szip and zlib filter build commands. (ADB - HDFFV-8695) + - CMake: Remove use of XLATE_UTILITY program. (ADB - 2014/03/28 HDFFV-8640) + - CMake: Added missing quotes in setting the CMAKE_EXE_LINKER_FLAGS for the + MPI option. (ADB - 2014/02/27 HDFFV-8674) + - Modified H5detect.c to scan floating point types for padding bits before + analyzing the type further. This should fix problems with gcc 4.8 + (NAF - 2013/09/19 - HDFFV-8523/HDFFV-8500) + - Fixed Makefile issue in which "-Wl," was not properly specified + prior to -rpath when building parallel fortran libraries with + an Intel compiler. (MAM - 2012/03/26) + - Makefiles generated by other packages using h5cc as the compiler + no longer error when 'make' is invoked more than once in order + to 'rebuild' after changes to source. (MAM - 2012/03/26) + - Added --enable-fortran2003 flag to enable Fortran2003 support + in the HDF5 Fortran library. The flag should be used along with the + --enable-fortran flag and takes affect only when Fortran compiler + is Fortran2003 compliant. (EIP - 2011/11/14) + + - In Windows platform, the default VFD, was Windows VFD, is restored back + to the SEC2, aka POSIX, VFD. The Windows VFD is deprecated. HDFFV-7740 + (AKC 2011/09/26) + - Removed config/ibm-aix6.x. All IBM-AIX settings are in one file, + ibm-aix. (AKC - 2011/4/14) + - Shared C libraries are no longer disabled on Mac when Fortran + is enabled. Shared Fortran libraries are still not supported on Mac, + so configure will disable them by default, but this is overridable + with the new --enable-unsupported configure option. The configure + summary has been updated to reflect the fact that the shared-ness of + the C++/Fortran wrapper libraries may not align with the C library. + (MAM - 04/11/2011 - HDFFV-4353). + - Removed recognition of the parallel compilers of LAM(hcc) and + ChMPIon(cmpicc) since we have no access to these two MPI implementations + and cannot verify their correctness. (AKC - 2010/7/14 - Bug 1921) + - Removed the following config files, as we no longer support them: + config/dec-osf*, config/hpux11.00, config/irix5.x, + config/powerpc-ibm-aix4.x config/rs6000-ibm-aix5.x config/unicos* + MAM - 2009/10/08 + - Modified configure and make process to properly preserve user's CFLAGS + (and company) environment variables. Build will now properly use + automake's AM_CFLAGS for any compiler flags set by the configure + process. Configure will no longer modify CFLAGS directly, nor will + setting CFLAGS during make completely replace what configure has set up. + MAM - 2009/10/08 + - Support for TFLOPS, config/intel-osf1, is removed since the TFLOPS + machine has long retired. AKC - 2009/10/06. + - Added $(EXEEXT) extension to H5detect when it's executed in the + src/Makfile to generate H5Tinit.c so it works correctly on platforms + that require the full extension when running executables. + MAM - 2009/10/01 - BZ #1613 + - Configure will now set FC and CXX to "no" when fortran and c++ + are not being compiled, respectively, so configure will not run + some of the compiler tests for these languages when they are not + being used. MAM - 2009/10/01 + - The PathScale compiler (v3.2) was mistaken as gcc v4.2.0 but it fails to + recognize some gcc options. Fixed. (see bug 1301). AKC - 2009/7/28 - + - The --enable-static-exec flag will now properly place the -static flag + on the link line of all installed executables. This will force the + executable to link with static libraries over shared libraries, provided + the static libraries are available. MAM - 2009/08/31 - BZ #1583 + - The --includedir=DIR configuration option now works as intended, and can + be used to specify the location to install C header files. The default + location remains unchanged, residing at ${prefix}/include. + MAM - 2009/03/10 - BZ #1381 + - Configure no longer removes the '-g' flag from CFLAGS when in production + mode if it has been explicitly set in the CFLAGS environment variable + prior to configuration. MAM - 2009/03/09 - BZ #1401. + - Fixed error with 'make check install' failing due to h5dump + needing other tools built first. MAM - 2008/10/24. + - Wpen using shared szip, it is no longer necessary to specify + the path to the shared szip libraries in LD_LIBRARY_PATH. MAM - + 2008/10/24. + - The file libhdf5_fortran.settings is not installed since its content + is included in libhdf5.settings now. AKC - 2008/10/21 + - "make DESTDIR=xxx install" failed to install some tools and files + (e.g., h5cc and fortran modules). Fixed. AKC - 2008/10/8. + - Autotools: An export of LD_LIBRARY_PATH= was + removed from configure and make installcheck was revised to run + scripts installed in share/hdf5_examples to use the installed h5cc, etc. + to compile and run example source files also installed there. Make + installcheck will now fail when a shared szip or other external lib file + cannot be found in the same manner that executables compiled and linked + with h5cc will fail to run when those lib files cannot be found after + install. Make installcheck should pass after setting LD_LIBRARY_PATH to the + szip location. + (LRK - 2014/04/16) + + Performance + ------------- + - Removed program perform/benchpar from the enable-build-all list. The + program will be retired or moved to another location. HDFFV-8156 + (AKC 2012/10/01) + - Retired program perform/mpi-perf. Its purpose has been incorporated + into h5perf before. (AKC 2012/09/20) + - ifdefs added to tests around include unistd.h and function to simulate + getlogin() on Windows. + (ADB - 2011/08/15) + - perf_serial test added to Windows projects and check batch file. + (ADB - 2009/06/11) + Fortran + -------- + - Fixed a typo in return value of the nh5dread_f_c function ( was 1 + instead of 0 on success); fixed the return value to make it consistent + with other Fortran functions; cleaned the code from debug statements. + (EIP - 2012/06/23) + + - Fixed problem writing/reading control characters to a dataset; writing + a string containing: alerts, backspace, carriage_return, form_feed, + horizontal_tab, vertical_tab, new_line is now tested and working. + (MSB - 2012/09/01) + + - Corrected the integer type of H5S_UNLIMITED_F to HSIZE_T (MSB - 2012/09/01) + + - Corrected the number of continuation lines in the src files + to be less then 32 lines for F95 compliance. (MSB - 2012/10/01) + + Tools + ----- + - h5dump subsetting fixed for dims greater then two + When a dataset has more then two dimensions, subsetting would incorrectly + calculate the data that needed to be displayed. + Added in block and stride calculation that account for dimensions greater + then two. NOTE: lines that have line breaks inserted because of display + length calculations, may have index info that is incorrect until the next + dimension break. (ADB, 2016/03/04, HDFFV-9698) + - h5repack: h5repack would not attempt to remove UD filters. Added a + check to h5repack for UD filters that checks if the filter can + be dynamically loaded. This will require a change in the library to + add the H5PL_load() to the H5Zfilter_avail(). (ADB - 2014/03/03 HDFFV-8629) + - h5repack: Fixed failure for converting a layout of small chunked dataset + (size < 1K) to contiguous layout. HDFFV-8214 (JKM 2013/03/18) + - h5diff: Fixed to return correct exit code 1 when detect unique extra + attribute. Prior to this fix, h5diff returned exit code 0 indicating + two files are identical. HDFFV-7643 (JKM 2013/02/15) + - h5diff: Improved speed when comparing HDF5 files with lots of + attributes. Much slower performance was identified with release + version from 1.8.7 to 1.8.10 compared to 1.8.6. (JKM 2012/10/19) + - h5repack: "h5repack -f NONE file1.h5 out.h5" command failed if + source file contains chunked dataset and a chunk dim is bigger than + the dataset dim. Another issue is that the command changed max dims + if chunk dim is smaller than the dataset dim. + These issue occurred when dataset size is smaller than 64k (compact + size limit) Fixed both. + HDFFV-8012 (JKM 2012/09/24) + - h5diff: Fixed not to accumulate attribute difference to dataset + difference in verbose mode (-v, -r), which caused incorrect + difference between dataset and group/datatype object if attribute + exist with any differences. This also lead to fix inconsistent + format indicating difference between dataset and group/datatype + object. HDFFV-5919 (JKM 2012/09/05) + - h5diff: Fixed the incorrect result when comparing attribute data + values and the data type has same class but different size. + HDFFV-7942 (JKM 2012/08/15) + - ph5diff: Fixed intermittent hang issue on a certain operation in + parallel mode. It was detected by daily test for comparing + non-comparable objects, but it could have occurred in other + operations depend on machine condition. HDFFV-8003 (JKM 2012/08/01) + - h5diff: Fixed test failure for "make check" due to failure of + copying test files when performed in HDF5 source tree. Also applied + to other tools. + HDFFV-8107 (JKM 2012/08/01) + - h5diff: Fixed the Function COPY_TESTFILES_TO_TESTDIR() of + testh5diff.sh to better report when there is an error in the file + copying. HDFFV-8105 (AKC -2012/07/22) + - h5diff: Fixed not to check and display dangling link status without + --follow-symlinks option. This also improved performance when + comparing lots of external links without the --follow-symlinks + option. HDFFV-7998 (JKM 2012/04/26) + - h5unjam: Fixed sefgault when used -V (show version) option. + HDFFV-8001 (JKM 2012/04/19) + - h5repack: Fixed a failure when change the chunk size of a specified + chunked dataset with unlimited max dims. HDFFV-7993 (JKM 2012/04/11) + - h5diff: Fixed failure for comparing same named object with different + object types in comparing groups. Prior to the fix, h5diff resulted + in error. After the fix, h5diff detects such case as non-comparable + and display messages accordingly. HDFFV-7664 (JKM 2012/03/28) + - h5diff: If unique objects exists only in one file and try to exclude + the unique objects with --exclude-path option, h5diff missed + excluding some objects. + Fixed to exclude objects correctly in such case. + HDFFV-7837 (JKM 2012/03/20) + - h5dump: Added tools library error stack to properly catch error + information generated within the library. + HDFFV-7958 (ADB 2012/03/12) + - h5dump: Dangling links no longer throw error message, change process + when open link fails. + HDFFV-7839 (ADB 2012/03/12) + - h5diff: When two symbolic dangling links are compared with + --follow-symlinks option, the result should be same. It worked for + comparing two files, but didn't work for comparing two objects. + HDFFV-7835 (JKM 2012/03/09) + - h5dump: Refactored code to remove duplicated functions. Split XML + functions from DDL functions. Corrected indentation and formatting + errors. Also fixed subsetting counting overflow (HDFFV-5874). Verified + all tools call tools_init() in main. + HDFFV-7560 (ADB 2012/02/17) + - h5diff: fixed to prevent from displaying error stack message when + comparing the two dangling symlinks with follow-symlinks option. + HDFFV-7836 (JKM 2012/01/13) + - h5repack: fixed memory leak for handling variable length string in + attribute. HDFFV-7840 (JKM 2012/01/06) + - h5ls: fixed segfault when access region reference data in an + attribute. HDFFV-7838 (JKM 2011/12/29) + - h5diff: fixed segfault over non-comparable attribute with different + dimention or rank, along with '-c' option to display details. + HDFFV-7770 (JKM 2011/10/24) + - Fixed h5diff to display all the comparable object and attribute + regardless of non-comparables. HDFFV-7693 (JKM 2011/09/16) + - Fixed h5repack to update values of references(object and region) of + attributes in h5repack for 1) references, 2) ARRAY of references, + 3) VLEN of references, and 4) COMPOUND of references. + (JIRA HDF5 5932) PC -2011/09/14 + - h5diff: fixed segfault over dataset with container types + (array,lven) with multiple nested compound types. + (ex: compound->array->compound, compound->vlen->compound) + HDFFV-7712 JKM (2011/09/01) + - h5repack: added macro to handle failure in H5Dread/write when memory + allocation failed inside the library. (PC -- 2011/08/19) + - Fixed h5jam not to allow specifying an HDF5 formatted file as input + file for -u (user block file) option, because the original HDF5 file + will not be accessible if allows. HDFFV-5941 (JKM 2011/08/15) + - Revised command help pages of h5jam and h5unjam. The descriptions + were not up to date and some were missing. + HDFFV-7515 (JKM 2011/08/15) + - h5repack: h5repack failed to copy dataset if the layout is changed + from chunked with unlimited dims to contiguous. HDFFV-7649 + (PC -- 2011/07/15) + - h5diff: "--delta" option considers two NaN of the same type are + different, which is wrong based on h5diff description in Reference + Manual. HDFFV-7656 (PC -- 2011/07/15) + - Fixed h5diff to display instructive error message and exit with 1 + when mutually exclusive options (-d, -p and --use-system-epsilon) + are used together. HDFFV-7600 (JKM 2011/07/07) + - Fixed h5dump to display the first line of each element into correct + position for multiple dimention array type. + Before this fix, the first line of each element in array were + displayed after the last line of previous element without + moving to the next line (+indentation). + Bug #HDFFV-5878 (JKM 2011/06/15) + - Fixed h5dump to display correct value for H5T_STD_I8LE dataset + on a system (ppc64, linux, Big-Endian, clustering). + Bug #HDFFV-7594 (ABERT & JKM 2011/05/12) + - Fixed h5diff to compare file itself correctly. Previously h5diff + reported either different or not compatible in certain cases even + comparing file itself. This fix also improve performance when + comparing same target objects through verifying the obj&file + addresses before comparing the details in the objects (ex: datasets + or attributes) Bug #HDFFV-5928 (XCAO & JKM 2011/05/06) + - Updated h5dump test case script to prevent entire test failure upon + source directory is read-only. Bug# HDFFV-4342 (JKM 2011/4/12) + - Fixed h5dump displaying incorrect values for H5T_STD_I8BE type data in + attribute on Big-Endian machine. H5T_STD_I8BE is unsigned 8bit type, + so h5dump is supposed to display -2 instead of 254. It worked + correctly on Little-Endian system , but not on Big-Endian system. + Bug #HDFFV-4358 (JKM 2011/04/08) + - Updated to unify option name to '--enable-error-stack' for printing + HDF5 error stack messages for HDF5 tools. h5ls and h5dump for now. + For h5ls, this replaces "-e/--errors" option, which is deprecated. + Bug#2182 (JKM 2011/3/30) + - Fix h5diff for --use-system-epsilon option: the calculation changed + from ( |a - b| / b ) to ( |a - b| ). This was decided for better + performance. Bug#2184 (JKM 2011/3/24) + - Fixed output for H5T_REFERENCE in h5dump. According to the BNF document + the output of a H5T_REFERENCE should be followed by the type; + ::= H5T_REFERENCE { } + ::= H5T_STD_REF_OBJECT | H5T_STD_REF_DSETREG + Previously this was only displayed if the -R option was used. + Bug#1725 (ADB 2011/3/28) + - Fix h5diff issues for #1: h5diff compared attributes correctly only + when two objects have the same number of attributes and attribute + names are identical, #2: didn't display useful information about + attribute difference. Bug#2121 (JKM 2011/3/17) + - Fixed memory leak for h5diff when accessing symbolic links with + --follow-symlink option. Bug#2214 (JKM 2011/3/18) + - Fixed memory leak for h5diff when access variable length string + data. Bug#2216 (JKM 2011/3/18) + - Fixed and improved help page for -a option of h5ls. + Bug#1904 (JKM 2011/3/11) + - Fixed h5dump not to include attribute values in the output file when + h5dump "-y -o output_file" options were used. The problem was introduced + in HDF5 1.8.6 by showing data pointed by region references. (XCAO 2011/3/9) + - Fixed h5copy to be able to copy any object into the same HDF5 file. + Previously h5copy displayed error message when target file is same + as source file. (XCAO 2011/3/8) + - Fixed h5dump for skipping some values for long array type dataset on + Windows. This issue only occurred on Windows due to the different + return behavior from _vsnprintf() funtion. Bug#2161 (JKM 2011/3/3) + - Fixed h5dump for skipping array indices every certain number + when the array type dataset is relatively big. The certain number + varies according to the size of array. Bug#2092 (JKM 2011/2/15). + - Fixed h5diff for the segfault when compares compound datasets + with combination of fixed length string types and vlen string types + in certain orders. bug#2089 (JKM 2010/12/28) + - Improve h5diff performance. 1) use HDmemcmp() before comparing each + elements. 2) replace expensive H5Tequals() calls 3) retrieve datatype + information at dataset level not each element level for compound + datasets + - Fixed h5ls to display nested compound type with curly bracket + when -S (--simple) option is used with -l (--label), so it shows + which member (in curly bracket) belong to which nested compound type + and make the output make sense. bug#1979 (JKM 2010/11/09) + - Fixed h5diff to handle variable-length strings in a compound dataset + correctly. (also variable-length string array in a compound dataset) + Garbage values were displayed when h5diff compared multiple + variable-length strings in a compound type dataset. + Bug#1989 (JKM 2010/10/28) + - Fixed h5copy to fail gracefully when copying object to non-exist + group without -p option. Bug#2040 (JKM 2010/10/18) + - Fixed to compare member objects and groups recursively when two + files or groups are specified to be compared. Bug#1975 + (JKM 2010/9/16) + - Make h5repack be able to convert a layout to COMPACT for small size + dataset as default. bug#1896 (JKM 2010/09/15) + - Change h5ls not to manipulate special characters in object name or + attribute name for smart display. bug#1784 (JKM 2010/06/28) + - Fixed h5ls to return exit code 1 (error) when non-existent file is + specified. bug#1793. (JKM 2010/04/27) + - h5copy failed to copy dangling link when the link is specified + directly. bug#1817. (JKM 2010/04/22) + - h5repack lost attributes from a dataset of reference type. bug#1726. + (JKM 2010/3/25) + - h5repack sets NULL for object reference value for group or + named datatype. bug#1814. (JKM 2010/03/19) + - h5diff: fixed incorrect behavior (hang) in parallel mode when + specify invalid options (ex: -v and -q) (JKM 2010/02/17) + - h5dump/h5ls display buffer resize fixed in tools library. + (ADB - 2009/07/21 - 1520) + - Fixed many problems that could occur when using h5repack with named + datatypes. (NAF - 2009/4/20 - 1516/1466) + - h5dump, h5diff, h5repack were not reading (by hyperslabs) datasets + that have a datatype datum size greater than H5TOOLS_BUFSIZE, a + constant defined as 1024Kb, such as array types with large + dimensions (PVN - 2009/4/1 - 1501) + - h5import: By selecting a compression type, a big endian byte order was being + selected (PVN - 2009/3/11 - 1462) + - zip_perf.c had missing argument on one of the open() calls. Fixed. + (AKC - 2008/12/9) + - h5dump now checks for uniqueness of committed datatypes. + (NAF - 2008/10/15) + - Fixed unnecessary indentation of committed datatypes in h5dump. + (NAF - 2008/10/15) + - Fixed bugs in h5stat:segmemtation fault when printing groups and + print warning message when traversal of objects is unsuccessful. + (see bug #1253) (VC- 2008/10/13) + - Fixed bug in h5ls that prevented relative group listings (like + "h5ls foo.h5/bar") from working correctly (QAK - 2008/06/03) + - Fixed bug in h5diff that prevented datasets & attributes with + variable-length string elements from comparing correctly. + (QAK - 2008/02/28) + - h5import bug on Windows w/binary datasets. fread in windows needs a + binary file to be open with 'rb' instead of 'r' otherwise it + terminates execution if an end of file character is found on the + input file. Besides that the binary file generated needs to be open + with 'wb' , otherwise an end of line character is read twice. + (PVN - 2008/02/19) + - Fixed bug in h5dump that caused binary output to be made only for the first + dataset, when several datasets were requested. (PVN - 2008/04/07) + - h5dump: when doing binary output (-b), the stdout printing of attributes + was done incorrectly. Removed printing of attributes when doing binary + output. PVN - 2008/06/05 + + + High-Level APIs: + ------ + - Packet Table is updated. + + In the Packet Table C API, there are changes with the following functions, + which had been ifdef'ed out with VLPT_REMOVED since 2006 + * H5PTcreate_vl, is removed from this release + * H5PTfree_vlen_readbuff, is renamed to H5PTfree_vlen_buff + * H5PTis_varlen, is made available again + + Various cleanup: replacing 0/-1 with SUCCEED/FAIL and H5I_BADID with + H5I_INVALID_HID. (BMR, 2016/03/04, HDFFV-442) + + - Fixed problem with H5DSget_scale_name including the NULL terminator in + the size calculation returned by the function. The API does not + include the NULL terminator in the size returned (MSB- 2013/2/10) + + - Fixed problem with H5TBdelete_record destroying all data following the deletion + of a row. (MSB- 2012/7/26) + + - Fixed H5LTget_attribute_string not closing an object identifier when an + error occurs. (MSB- 2012/7/21) + + - Fixed the H5LTdtype_to_text function. It had some memory problems when + dealing with some complicated data types. HDFFVI-7701 (SLU - 2011/10/19) + + - Fixed a bug in H5DSattach_scale, H5DSis_attached and H5DSdetach_scale + caused by using H5Tget_native_type function to determine the native + type for reading REFERENCE_LIST attribute. The bug was exposed + on Mac PPC. + (EIP - 2010/05/22 -1851) + - Fixed a bug in the H5DSdetach_scale function when 0 bytes + were allocated after the last reference to a dim. scale + was removed from the list of references in a VL element of the + DIMENSION_LIST attribute; modified the function to comply + with the Spec: DIMENSION_LIST attribute is deleted now when no + dimension scales left attached. + (EIP - 2010/05/14 -1822) + - Fixed a bug where the H5TB API would forget the order of fields when + added out of offset order. (NAF - 2009/10/27 - 1582) + - H5DSis_attached failed to account for different platform types. Added a + get native type call. (ADB - 2009/9/29 - 1562) + - Dimension scales: The scale index return value in H5DSiterate_scales was not always + incremented. (PVN - 2009/4/8 - 1538) + + Fortran High-Level APIs: + ------ + + - Lite: The h5ltget_attribute_string_f used to return the C NULL character in the + returned character buffer. The returned Fortran charactor buffer now does + not return the C NULL character. (MSB - 2012/3/23) + - Lite: The h5ltget_dataset_info_f function (gets information about a dataset) + was not correctly returning the dimension array. (PVN - 2009/3/23) + - Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions + had memory problems with the g95 fortran compiler. (PVN � 5/13/2009) 1522 + + + + + + Documentation + ------------- + + + F90 APIs + -------- + - Modified the h5open_f and h5close_f subroutines to not to call H5open + and H5close correspodningly. While the H5open call just adds overhead, + the H5close call called by an Fortran application shuts down the HDF5 + library making it unaccessible to the application. + HDFFV-915 (EIP & SB - 2011/10/13) + + + C++ APIs + -------- + - The constructor PropList::PropList(id) was fixed to act properly + according to the nature of 'id'. When 'id' is a property class id, + a new property list will be created. When 'id' id a property list id, + a copy of the property list will be made. (BMR - 2010/5/9) + - The parameters 'size' and 'bufsize' in CommonFG::getLinkval and + CommonFG::getComment, respectively, now have default values for + user's convenience. (BMR - 2009/10/23) + - NULL pointer accessing was fixed, bugzilla 1061. (BMR - 2009/10/05) + - read/write methods of DataSet and Attribute classes were fixed + to handle string correctly. (BMR - 2009/07/26) + - Fixed bug that caused segfaults in Attribute::read. (BMR - 2008/04/20) + - Fixed bug in PropList::getClassName to use portable HDfree instead + of free. (BMR - 2008/04/20) + - Fixed a design bug which allowed an Attribute object to create/modify + attributes (bugzilla #1068). The API class hierarchy was revised + to address the problem. Classes AbstractDS and Attribute are moved + out of H5Object. Class Attribute now multiply inherits from + IdComponent and AbstractDs and class DataSet from H5Object and + AbstractDs. In addition, the data member IdComponent::id was + moved into subclasses: Attribute, DataSet, DataSpace, DataType, + H5File, Group, and PropList. (BMR - 2008/08/10) + - IdComponent::dereference was incorrect and replaced as described + in "New Features" section. + (BMR - 2008/08/10) + + Testing + ------- + - tools/h5diff/testh5diff.sh is run in every "make check", even after it + has passed in the previous run. It should not run again if there is no + code changes. Fixed. (AKC - 2013/07/19 HDFFV-8392) + - In some Mac system, testlibinfo.sh failed with this error: + Check file ../src/.libs/libhdf5.7.dylib + strings: object: ../src/.libs/libhdf5.7.dylib malformed object \ + (unknown load command 15) + The strings command of Mac inspects library files and older + versions of strings may not know newer library format, resulting + in errors. Fixed by sending the library file as stdin to the strings + coommand to avoid this problem. (AKC - 2013/03/08 HDFFV-8305) + + - Fixed a typo in the ERROR macro in test/testhdf5.h. It segmentation + faulted when used before. (AKC - 2013/02/12 HDFFV-8267) + + +Supported Platforms +=================== + AIX 6.1 xlc 10.1.0.5 + (NASA G-ADA) xlC 10.1.0.5 + xlf90 12.1.0.6 + + Linux 2.6.18-308.13.1.el5PAE GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP i686 i686 i386 compilers for 32-bit applications; + (jam) Version 4.1.2 20080704 (Red Hat 4.1.2-54) + Version 4.8.2 + PGI C, Fortran, C++ Compilers for 32-bit + applications; + Version 13.7-0 + Intel(R) C, C++, Fortran Compiler for 32-bit + applications; + Version 14.0.2 (Build 20140120) + + Linux 2.6.18-371.6.1.el5 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; + (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-54) + Version 4.8.2 + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; + Version 14.0.2 (Build 20140120) + + Linux 2.6.32-431.11.2.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus) Version 4.4.7 20120313 + Version 4.8.2 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 13.7-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 14.0.2 (Build 20140120) + + Linux 2.6.32-431.29.2.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 2.6.32-220.23.1.1chaos Intel C, C++, Fortran Compilers + ch5.x86_64 GNU/Linux Version 12.1.5.339 + (LLNL Aztec) + + IBM Blue Gene/P XL C for Blue Gene/P, bgxlc V9.0 + (LLNL uDawn) XL C++ for Blue Gene/P, bgxlC V9.0 + XL Fortran for Blue Gene/P, bgxlf90 V11.1 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2008 (cmake) + Visual Studio 2010 w/ Intel Fortran 14 (cmake) + Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 (cmake) + Cygwin(CYGWIN_NT-6.1 1.7.34(0.285/5/3) gcc(4.9.2) compiler and gfortran) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2008 (cmake) + Visual Studio 2010 w/ Intel Fortran 14 (cmake) + Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 (cmake) + + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + + Mac OS X Lion 10.7.3 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.2.1 + 32- and 64-bit g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.2.1 + (duck) gfortran GNU Fortran (GCC) 4.6.2 + + Mac OS X Mountain Lion 10.8.1 cc Apple clang version 4.0 from Xcode 4.5.1 + (owl) c++ Apple clang version 4.0 from Xcode 4.5.1 + gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + gfortran GNU Fortran (GCC) 4.6.2 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +Solaris2.11 32-bit n y/y n y y y +Solaris2.11 64-bit n y/n n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/n n y y y +Windows 7 x64 Cygwin n y/n n y y y +Windows 8 y y/y n y y y +Windows 8 x64 y y/y n y y y +Mac OS X Lion 10.7.3 32-bit n y/y n y y n +Mac OS X Lion 10.7.3 64-bit n y/y n y y y +Mac OS X Mountain Lion 10.8.1 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.1 64-bit n y/y n y y ? +AIX 6.1 32- and 64-bit n y/n n y y y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y/y y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel n y/y n y y y +CentOS 5.9 Linux 2.6.18-308 i686 PGI n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 GNU n y/y n y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel n y/y n y y y +CentOS 6.4 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.4 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.4 Linux 2.6.32 x86_64 PGI n y/y n y y y +Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 7 x64 Cygwin n n n y +Windows 8 y y y y +Windows 8 x64 y y y y +Mac OS X Lion 10.7.3 32-bit y n y y +Mac OS X Lion 10.7.3 64-bit y n y y +Mac OS X Mountain Lion 10.8.1 64-bit y n y y +Mac OS X Mavericks 10.9.1 64-bit y n y y +AIX 6.1 32- and 64-bit y n n y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n +CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n +CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n +CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n +Linux 2.6.32-431.11.2.el6.ppc64 y y y n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.18-308.13.1.el5PAE MPICH mpich 3.1.2 compiled with + #1 SMP i686 i686 i386 gcc 4.9.1 and gfortran 4.9.1 + (jam) g95 (GCC 4.0.3 (g95 0.94!) + + Linux 2.6.18-431.11.2.el6 MPICH mpich 3.1.2 compiled with + #1 SMP x86_64 GNU/Linux gcc 4.9.1 and gfortran 4.9.1 + (platypus) g95 (GCC 4.0.3 (g95 0.94!) + + FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719 + (loyalty) gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + FreeBSD 8.2-STABLE amd64 gcc 4.2.1 [FreeBSD] 20070719 + (freedom) gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + Debian7.5.0 3.2.0-4-686 #1 SMP Debian 3.2.51-1 i686 GNU/Linux + gcc (Debian 4.7.2-5) 4.7.2 + GNU Fortran (Debian 4.7.2-5) 4.7.2 + (cmake and autotools) + + Debian7.5.0 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux + gcc (Debian 4.7.2-5) 4.7.2 + GNU Fortran (Debian 4.7.2-5) 4.7.2 + (cmake and autotools) + + Fedora20 3.15.3-200.fc20.i6866 #1 SMP i686 i686 i386 GNU/Linux + gcc (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + GNU Fortran (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + (cmake and autotools) + + Fedora20 3.15.3-200.fc20.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + GNU Fortran (GCC) 4.8.3 20140624 (Red Hat 4.8.3-1) + (cmake and autotools) + + SUSE 13.1 3.11.10-17-desktop #1 SMP PREEMPT i686 athlon i386 GNU/Linux + gcc (SUSE Linux) 4.8.1 + GNU Fortran (SUSE Linux) 4.8.1 + (cmake and autotools) + + SUSE 13.1 3.11.10-17-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.8.1 + GNU Fortran (SUSE Linux) 4.8.1 + (cmake and autotools) + + Ubuntu 14.04 3.13.0-35-generic #62-Ubuntu SMP i686 GNU/Linux + gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + (cmake and autotools) + + Ubuntu 14.04 3.13.0-35-generic #62-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 + (cmake and autotools) + + Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 + hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai + pgCC 12.5-0 64-bit target on x86-64 Linux -tp shanghai + + +Known Problems +============== +* "make check" fails on CYGWIN when building shared lib files is enabled. The + default on Cygwin has been changed to disable shared. It can be enabled with + the --enable-shared configure option but is likely to fail "make check" + with GCC compilers. (LK -2015/04/16) + +* CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + catches some undefined behavior in the alignment algorithm of the macro DETECT_I + in H5detect.c (Issue 8147). Since the algorithm is trying to detect the alignment + of integers, ideally the flag -fcatch-undefined-behavior shouldn't to be used for + H5detect.c. In the future, we can separate flags for H5detect.c from the rest of + the library. (SLU - 2013/10/16) + +* The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It + complains with this message: + "/home/hdf5/src/H5Vprivate.h", line 130: Error: __func__ is not defined. + + The reason is that __func__ is a predefined identifier in C99 standard. The + HDF5 C library uses it in H5private.h. The test ttypes.cpp includes + H5private.h (H5Tpkg.h<-H5Fprivate.h<-H5Vprivate.h<-H5private.h). Sun's 5.9 + C++ compiler doesn't support __func__, thus fails to compile the C++ test. + But 5.11 C++ compiler does. To check whether your Sun C++ compiler knows this + identifier, try to compile the following simple C++ program: + #include + + int main(void) + { + printf("%s\n", __func__); + return 0; + } + (SLU - 2012/11/5) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD with the + native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the + ports (and probably gcc releases after that). + (QAK - 2012/10/19) + +* The data conversion test dt_arith.c has failures (segmentation fault) from + "long double" to other datatypes during hard conversion when the library + is built with the default GCC 4.2.1 on Mac Lion system. It only happens + with optimization (-O3, -O2, and -O1). Some newer versions of GCC do not + have this problem. Users should disable optimization or try newer version + of GCC. (Issue 8017. SLU - 2012/6/12) + +* The data conversion test dt_arith.c fails in "long double" to integer + conversion on Ubuntu 11.10 (3.0.0.13 kernal) with GCC 4.6.1 if the library + is built with optimization -O3 or -O2. The older GCC (4.5) or newer kernal + (3.2.2 on Fedora) doesn't have the problem. Users should lower down the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of + "configure" like: + + CFLAGS=-O1 ./configure + + It will overwrite the library's default optimization level. (Issue 7829. + SLU - 2012/2/7) + +* --with-mpe configure option does not work with Mpich2. AKC - 2011/03/10) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or filesystems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + +* Parallel mode in AIX will fail some of the testcheck_version.sh tests where + it treats "exit(134) the same as if process 0 had received an abort signal. + This is fixed and will be available in the next release. AKC - 2009/11/3 + +* The PathScale MPI implementation, accessing a Panasas file system, would + cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file is not + existing. This is due to the MPI_File_open() call failing if the amode has + the MPI_MODE_EXCL bit set. (See bug 1468 for details.) AKC - 2009/8/11 + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. (CMC - 2009/04/28) + +* For SNL, spirit/liberty/thunderbird: The serial tests pass but parallel + tests failed with MPI-IO file locking message. AKC - 2007/6/25. +* On Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers use + -mp -O1 compilation flags to build the libraries. Higher level of optimization + causes failures in several HDF5 library tests. +* For HPUX 11.23 many tools tests failed for 64-bit version when linked to the + shared libraries (tested for 1.8.0-beta2) +* For SNL, Red Storm: only paralle HDF5 is supported. The serial tests pass + and the parallel tests also pass with lots of non-fatal error messages. +* on SUN 5.10 C++ test fails in the "Testing Shared Datatypes with Attributes" test +* configuring with --enable-debug=all produces compiler errors on most + platforms. Users who want to run HDF5 in debug mode should use + --enable-debug rather than --enable-debug=all to enable debugging + information on most modules. +* On Mac OS 10.4, test/dt_arith.c has some errors in conversion from long + double to (unsigned) long long and from (unsigned)long long to long double. +* On Altix SGI with Intel 9.0 testmeta.c would not compile with -O3 + optimization flag. +* On VAX, Scaleoffset filter isn't supported. The filter cannot be applied to + HDF5 data generated on VAX. Scaleoffset filter only supports IEEE standard + for floating-point data. +* On Cray X1, a lone colon on the command line of h5dump --xml (as in + the testh5dumpxml.sh script) is misinterpereted by the operating system + and causes an error. +* On mpich 1.2.5 and 1.2.6, we found that if more than two processes + contribute no IO and the application asks to do IO with collective, we found + that when using 4 processors, a simple collective write will be hung + sometimes. This can be verified with t_mpi test under testpar. +* The dataset created or rewritten with the v1.6.3 library or after can't + be read with the v1.6.2 library or before when Fletcher32 EDC(filter) is + enabled. There was a bug in the calculating code of the Fletcher32 + checksum in the library before v1.6.3. The checksum value wasn't consistent + between big-endian and little-endian systems. This bug was fixed in + Release 1.6.3. However, after fixing the bug, the checksum value is no + longer the same as before on little-endian system. The library release + after 1.6.4 can still read the dataset created or rewritten with the library + of v1.6.2 or before. SLU - 2005/6/30 +* For the version 6(6.02 and 6.04) of Portland Group compiler on AMD Opteron + processor, there's a bug in the compiler for optimization(-O2). The library + failed in several tests but all related to multi driver. The problem has + been reported to the vendor. +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command poe. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + The tests may fail with messages like "The socket name is already + in use". HDF5 does not use sockets (except for stream-VFD). This is + due to problems of the poe command trying to set up the debug socket. + Check if there are many old /tmp/s.pedb.* staying around. These are + sockets used by the poe command and left behind due to failed commands. + Ask your system administrator to clean them out. Lastly, request IBM + to provide a mean to run poe without the debug socket. + +* The C++ library's tests fails when compiling with PGI C++ compiler. The + workaround until the problem is correctly handled is to use the + flag "--instantiate=local" prior to the configure and build steps, as: + setenv CXX "pgCC --instantiate=local" for pgCC 5.02 and higher + + +* The stream-vfd test uses ip port 10007 for testing. If another + application is already using that port address, the test will hang + indefinitely and has to be terminated by the kill command. To try the + test again, change the port address in test/stream_test.c to one not + being used in the host. + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + +* With the gcc 2.95.2 compiler, HDF 5 uses the `-ansi' flag during + compilation. The ANSI version of the compiler complains about not being + able to handle the `long long' datatype with the warning: + + warning: ANSI C does not support `long long' + + This warning is innocuous and can be safely ignored. + +* Certain platforms give false negatives when testing h5ls: + - Cray J90 and Cray T90IEEE give errors during testing when displaying + some floating-point values. These are benign differences due to + the different precision in the values displayed and h5ls appears to + be dumping floating-point numbers correctly. + +* Not all platforms behave correctly with szip's shared libraries. Szip is + disabled in these cases, and a message is relayed at configure time. Static + libraries should be working on all systems that support szip, and should be + used when shared libraries are unavailable. There is also a configure error + on Altix machines that incorrectly reports when a version of szip without + an encoder is being used. + +* On some platforms that use Intel and Absoft compilers to build HDF5 fortran library, + compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 + complaining about exit subroutine. Comment out the line + IF (total_error .ne. 0) CALL exit (total_error) + +* Information about building with PGI and Intel compilers is available in + INSTALL file sections 5.7 and 5.8 + +* On at least one system, (SDSC DataStar), the scheduler (in this case + LoadLeveler) sends job status updates to standard error when you run + any executable that was compiled with the parallel compilers. + + This causes problems when running "make check" on parallel builds, as + many of the tool tests function by saving the output from test runs, + and comparing it to an exemplar. + + The best solution is to reconfigure the target system so it no longer + inserts the extra text. However, this may not be practical. + + In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to + the configure and build. This will cause "make check" to continue after + detecting errors in the tool tests. However, in the case of SDSC DataStar, + it also leaves you with some 150 "failed" tests to examine by hand. + + A second solution is to write a script to run serial tests and filter + out the text added by the scheduler. A sample script used on SDSC + DataStar is given below, but you will probably have to customize it + for your installation. + + Observe that the basic idea is to insert the script as the first item + on the command line which executes the the test. The script then + executes the test and filters out the offending text before passing + it on. + + #!/bin/csh + + set STDOUT_FILE=~/bin/serial_filter.stdout + set STDERR_FILE=~/bin/serial_filter.stderr + + rm -f $STDOUT_FILE $STDERR_FILE + + ($* > $STDOUT_FILE) >& $STDERR_FILE + + set RETURN_VALUE=$status + + cat $STDOUT_FILE + + tail +3 $STDERR_FILE + + exit $RETURN_VALUE + + You get the HDF make files and test scipts to execute your filter script + by setting the environment variable "RUNSERIAL" to the full path of the + script prior to running configure for parallel builds. Remember to + "unsetenv RUNSERIAL" before running configure for a serial build. + + Note that the RUNSERIAL environment variable exists so that we can + can prefix serial runs as necessary on the target system. On DataStar, + no prefix is necessary. However on an MPICH system, the prefix might + have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to + get the serial tests to run at all. + + In such cases, you will have to include the regular prefix in your + filter script. + +* H5Ocopy() does not copy reg_ref attributes correctly when shared-message + is turn on. The value of the reference in the destination attriubte is + wrong. This H5Ocopy problem will affect h5copy tool + diff --git a/release_docs/HISTORY-1_9.txt b/release_docs/HISTORY-1_9.txt deleted file mode 100644 index 8e7648a..0000000 --- a/release_docs/HISTORY-1_9.txt +++ /dev/null @@ -1,6 +0,0 @@ - HDF5 HISTORY - ============ - This file contains history of the HDF5 1.9 branch - - CONTENTS - diff --git a/src/COPYING b/src/COPYING index 6903daf..6497ace 100644 --- a/src/COPYING +++ b/src/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/src/H5.c b/src/H5.c index f41459c..1068fc6 100644 --- a/src/H5.c +++ b/src/H5.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5A.c b/src/H5A.c index e5a7ae5..cf48232 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5AC.c b/src/H5AC.c index e2271c5..4223158 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5ACdbg.c b/src/H5ACdbg.c index 6073288..c6d71a8 100644 --- a/src/H5ACdbg.c +++ b/src/H5ACdbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5AClog.c b/src/H5AClog.c index 780373e..51a2050 100644 --- a/src/H5AClog.c +++ b/src/H5AClog.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5ACmodule.h b/src/H5ACmodule.h index a8dba59..e218b31 100644 --- a/src/H5ACmodule.h +++ b/src/H5ACmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index 945aaba..d03c17b 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index 77ba0ae..ea7f0bf 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index a724394..b9e2a60 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5ACproxy_entry.c b/src/H5ACproxy_entry.c index cee9b72..105a531 100644 --- a/src/H5ACproxy_entry.c +++ b/src/H5ACproxy_entry.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index ca0e63f..654a877 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index a9c77d2..ed67e0f 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Adense.c b/src/H5Adense.c index 3dc3a42..b1903a4 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index a4713a7..9221254 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Aint.c b/src/H5Aint.c index e31cd83..160c7fb 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Amodule.h b/src/H5Amodule.h index e347fe1..8ed056b 100644 --- a/src/H5Amodule.h +++ b/src/H5Amodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 5858147..6d5a83a 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Aprivate.h b/src/H5Aprivate.h index 6b62692..b285920 100644 --- a/src/H5Aprivate.h +++ b/src/H5Aprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Apublic.h b/src/H5Apublic.h index 99ca90e..586940b 100644 --- a/src/H5Apublic.h +++ b/src/H5Apublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Atest.c b/src/H5Atest.c index 3dcca87..b923637 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5B.c b/src/H5B.c index 2c49c81..e64a695 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5B2.c b/src/H5B2.c index e9f6150..7e679cd 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5B2cache.c b/src/H5B2cache.c index e9b6a41..2e1d37b 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index 19ca89a..3890ae0 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 251a33d..ab017c6 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5B2int.c b/src/H5B2int.c index 47100fd..c72bc98 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5B2internal.c b/src/H5B2internal.c index e74ae59..1716c44 100644 --- a/src/H5B2internal.c +++ b/src/H5B2internal.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c index 4f8b8e6..d900761 100644 --- a/src/H5B2leaf.c +++ b/src/H5B2leaf.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5B2module.h b/src/H5B2module.h index 0fc30a5..35c982c 100644 --- a/src/H5B2module.h +++ b/src/H5B2module.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 71fdfde..e24d2eb 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5B2private.h b/src/H5B2private.h index 161e25e..e4bbffa 100644 --- a/src/H5B2private.h +++ b/src/H5B2private.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5B2public.h b/src/H5B2public.h index 43ec5d7..6e0b964 100644 --- a/src/H5B2public.h +++ b/src/H5B2public.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5B2stat.c b/src/H5B2stat.c index da721c6..df99ad5 100644 --- a/src/H5B2stat.c +++ b/src/H5B2stat.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5B2test.c b/src/H5B2test.c index aec2aba..c10e5a8 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5Bcache.c b/src/H5Bcache.c index b2be829..a0a75c8 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c index b22264d..3881b44 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Bmodule.h b/src/H5Bmodule.h index 6800b26..bc46752 100644 --- a/src/H5Bmodule.h +++ b/src/H5Bmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index fb93b8a..14dce4f 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index 02fb82c..cb038ec 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Bpublic.h b/src/H5Bpublic.h index 0016996..1764f61 100644 --- a/src/H5Bpublic.h +++ b/src/H5Bpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5C.c b/src/H5C.c index 2ba9f2d..e6770ec 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5CS.c b/src/H5CS.c index 477b5f9..0a3dcce 100644 --- a/src/H5CS.c +++ b/src/H5CS.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5CSprivate.h b/src/H5CSprivate.h index ab7f993..467dd9d 100644 --- a/src/H5CSprivate.h +++ b/src/H5CSprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index 85f25b3..4a08d9b 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Cepoch.c b/src/H5Cepoch.c index 655d795..f8507a9 100644 --- a/src/H5Cepoch.c +++ b/src/H5Cepoch.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Cimage.c b/src/H5Cimage.c index d60ee05..debd30c 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Clog.c b/src/H5Clog.c index e3e4388..3353619 100644 --- a/src/H5Clog.c +++ b/src/H5Clog.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Cmodule.h b/src/H5Cmodule.h index 2c39eab..534404d 100644 --- a/src/H5Cmodule.h +++ b/src/H5Cmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 0d1a3ff..a75cd88 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 90a84c4..fdb14a5 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Cprefetched.c b/src/H5Cprefetched.c index 9b11006..6237d57 100644 --- a/src/H5Cprefetched.c +++ b/src/H5Cprefetched.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 5c5a666..5335f80 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Cpublic.h b/src/H5Cpublic.h index 39ebbe3..62107d9 100644 --- a/src/H5Cpublic.h +++ b/src/H5Cpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Cquery.c b/src/H5Cquery.c index 5108013..6c927b0 100644 --- a/src/H5Cquery.c +++ b/src/H5Cquery.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Ctag.c b/src/H5Ctag.c index 0170ce9..a9b2ec0 100644 --- a/src/H5Ctag.c +++ b/src/H5Ctag.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Ctest.c b/src/H5Ctest.c index 876b63a..2cd0a5d 100644 --- a/src/H5Ctest.c +++ b/src/H5Ctest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5D.c b/src/H5D.c index 44e4baa..6f69ee4 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 8ef14b9..8177e13 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index f687a5d..2e19392 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 63e692f..ce684a0 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 224a1d1..2578975 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index a24abe6..0ee4d28 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c index a6c130e..b1efb20 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index c6a03c2..8d9461c 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 240afb7..1df0a58 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5Defl.c b/src/H5Defl.c index 387cbe3..5536ba3 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index 6b95e12..d183a8c 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Vailin Choi diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 50c964b..922ac98 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Dint.c b/src/H5Dint.c index 2048e49..1813ca6 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5Dio.c b/src/H5Dio.c index f5087da..dfd3f17 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index cb2eca2..c2fb5c2 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5Dmodule.h b/src/H5Dmodule.h index 9b0c411..b259b69 100644 --- a/src/H5Dmodule.h +++ b/src/H5Dmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 441cc96..0389c72 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Dnone.c b/src/H5Dnone.c index 0cadac2..97ec5d6 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Vailin Choi diff --git a/src/H5Doh.c b/src/H5Doh.c index 5cdf4bc..9abbdff 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index f54a9f2..8a4711f 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index ea2b8c8..5d565bb 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 81ae67d..fe408b2 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 55111f0..4625c7a 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5Dselect.c b/src/H5Dselect.c index 53829e5..b4d0515 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c index 04b8971..e999449 100644 --- a/src/H5Dsingle.c +++ b/src/H5Dsingle.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Vailin Choi diff --git a/src/H5Dtest.c b/src/H5Dtest.c index 56f14f7..2fc71a0 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index c85b1e9..3be2353 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5E.c b/src/H5E.c index aa4511b..741f0dd 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5EA.c b/src/H5EA.c index e35a4ed..c524d49 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 894b31a..def38af 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index ef45881..e67a5a8 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c index 927dcb6..2b07356 100644 --- a/src/H5EAdblkpage.c +++ b/src/H5EAdblkpage.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index c288c69..7df0ee9 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 76d8733..92d7c4d 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c index a3723c5..e25e3ef 100644 --- a/src/H5EAiblock.c +++ b/src/H5EAiblock.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5EAint.c b/src/H5EAint.c index 9f910d0..2baf1f4 100644 --- a/src/H5EAint.c +++ b/src/H5EAint.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5EAmodule.h b/src/H5EAmodule.h index 405b232..d3e06b7 100644 --- a/src/H5EAmodule.h +++ b/src/H5EAmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5EApkg.h b/src/H5EApkg.h index 7540ff2..e162fab 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5EAprivate.h b/src/H5EAprivate.h index 66d88e0..cda1d46 100644 --- a/src/H5EAprivate.h +++ b/src/H5EAprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c index 2fa87e0..4e291c0 100644 --- a/src/H5EAsblock.c +++ b/src/H5EAsblock.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5EAstat.c b/src/H5EAstat.c index 0c27681..72c4d14 100644 --- a/src/H5EAstat.c +++ b/src/H5EAstat.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 905aa7f..422ea68 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5Edeprec.c b/src/H5Edeprec.c index 1a13c01..f579773 100644 --- a/src/H5Edeprec.c +++ b/src/H5Edeprec.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Eint.c b/src/H5Eint.c index 8eea147..110c6bb 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Emodule.h b/src/H5Emodule.h index d624409..2d1bcd0 100644 --- a/src/H5Emodule.h +++ b/src/H5Emodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Epkg.h b/src/H5Epkg.h index 3af653a..90f4f80 100644 --- a/src/H5Epkg.h +++ b/src/H5Epkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index db413e3..57e7485 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 17a35d9..3eae2da 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5F.c b/src/H5F.c index aef9d1d..78fce2a 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5FA.c b/src/H5FA.c index 90144e7..d421eec 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 40117a7..19fdb74 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index 2dc51c5..7444eae 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FAdblkpage.c b/src/H5FAdblkpage.c index 09278f8..baf4286 100644 --- a/src/H5FAdblkpage.c +++ b/src/H5FAdblkpage.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FAdblock.c b/src/H5FAdblock.c index 440447d..432bf58 100644 --- a/src/H5FAdblock.c +++ b/src/H5FAdblock.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 52b90d1..6809f02 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FAint.c b/src/H5FAint.c index 331227b..9d3bce8 100644 --- a/src/H5FAint.c +++ b/src/H5FAint.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FAmodule.h b/src/H5FAmodule.h index e46b071..f675faf 100644 --- a/src/H5FAmodule.h +++ b/src/H5FAmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FApkg.h b/src/H5FApkg.h index 63eacff..6f0a43a 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FAprivate.h b/src/H5FAprivate.h index 612f3a2..1e44126 100644 --- a/src/H5FAprivate.h +++ b/src/H5FAprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FAstat.c b/src/H5FAstat.c index 72fa0de..3c06855 100644 --- a/src/H5FAstat.c +++ b/src/H5FAstat.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FAtest.c b/src/H5FAtest.c index 091f284..3c6d8e4 100644 --- a/src/H5FAtest.c +++ b/src/H5FAtest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FD.c b/src/H5FD.c index 96d1230..dcfaa6d 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 9090679..d100a8b 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDcore.h b/src/H5FDcore.h index 16cce89..5fe2912 100644 --- a/src/H5FDcore.h +++ b/src/H5FDcore.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 2034ba0..1487cda 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDdirect.h b/src/H5FDdirect.h index 5ceb91f..805f3be 100644 --- a/src/H5FDdirect.h +++ b/src/H5FDdirect.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDdrvr_module.h b/src/H5FDdrvr_module.h index 8bb83a1..59a419e 100644 --- a/src/H5FDdrvr_module.h +++ b/src/H5FDdrvr_module.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 4c4cad0..98ece84 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDfamily.h b/src/H5FDfamily.h index 80969c3..1584cf6 100644 --- a/src/H5FDfamily.h +++ b/src/H5FDfamily.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDint.c b/src/H5FDint.c index 0809ac8..bc322d6 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FDlog.c b/src/H5FDlog.c index f320946..75333c2 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDlog.h b/src/H5FDlog.h index 11044e2..a69bb18 100644 --- a/src/H5FDlog.h +++ b/src/H5FDlog.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDmodule.h b/src/H5FDmodule.h index 6358e86..ea1a9fd 100644 --- a/src/H5FDmodule.h +++ b/src/H5FDmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index bf4e03a..16be455 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h index 784fe70..2d62c79 100644 --- a/src/H5FDmpi.h +++ b/src/H5FDmpi.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 9417d46..ace91f8 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h index 858e8ba..6ee0a1a 100644 --- a/src/H5FDmpio.h +++ b/src/H5FDmpio.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 0ab7fc5..8ae23d2 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h index e819e74..0bd5718 100644 --- a/src/H5FDmulti.h +++ b/src/H5FDmulti.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDpkg.h b/src/H5FDpkg.h index 45bcfd8..31dcf8d 100644 --- a/src/H5FDpkg.h +++ b/src/H5FDpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index fb7c43c..0fc2135 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 883b28d..3032e8a 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 0ca5efb..26913e2 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDsec2.h b/src/H5FDsec2.h index 0c62597..a4ade0b 100644 --- a/src/H5FDsec2.h +++ b/src/H5FDsec2.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDspace.c b/src/H5FDspace.c index 0ad3cf0..e451d6b 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 13f728e..5023af3 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke diff --git a/src/H5FDstdio.h b/src/H5FDstdio.h index 8281705..f99aacf 100644 --- a/src/H5FDstdio.h +++ b/src/H5FDstdio.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FDtest.c b/src/H5FDtest.c index fc9188b..f528dfb 100644 --- a/src/H5FDtest.c +++ b/src/H5FDtest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FDwindows.c b/src/H5FDwindows.c index 8dd7555..76c4f18 100644 --- a/src/H5FDwindows.c +++ b/src/H5FDwindows.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5private.h" /* Generic Functions */ diff --git a/src/H5FDwindows.h b/src/H5FDwindows.h index 7a9d2cf..5cf68a1 100644 --- a/src/H5FDwindows.h +++ b/src/H5FDwindows.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FL.c b/src/H5FL.c index db51809..0e67414 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FLmodule.h b/src/H5FLmodule.h index cfa585c..48b8d2b 100644 --- a/src/H5FLmodule.h +++ b/src/H5FLmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index f44d359..4aa44f9 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FO.c b/src/H5FO.c index a77e268..627ee64 100644 --- a/src/H5FO.c +++ b/src/H5FO.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FOprivate.h b/src/H5FOprivate.h index 4648f02..aa85c29 100644 --- a/src/H5FOprivate.h +++ b/src/H5FOprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FS.c b/src/H5FS.c index a433fbb..b789dfd 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FScache.c b/src/H5FScache.c index ddc66fd..628fba0 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index fbdeb70..450216b 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FSint.c b/src/H5FSint.c index 60cedd5..1a41172 100644 --- a/src/H5FSint.c +++ b/src/H5FSint.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FSmodule.h b/src/H5FSmodule.h index b435b79..b2869dd 100644 --- a/src/H5FSmodule.h +++ b/src/H5FSmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index ab97955..df1d92f 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h index 74f9dcb..c0467a6 100644 --- a/src/H5FSprivate.h +++ b/src/H5FSprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FSpublic.h b/src/H5FSpublic.h index 87debe8..3090d0d 100644 --- a/src/H5FSpublic.h +++ b/src/H5FSpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 49ff003..8f911a4 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FSstat.c b/src/H5FSstat.c index 3200849..e2ad5bb 100644 --- a/src/H5FSstat.c +++ b/src/H5FSstat.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5FStest.c b/src/H5FStest.c index 06f5166..5ab0219 100644 --- a/src/H5FStest.c +++ b/src/H5FStest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 7f3bb39..e84cfda 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Fcwfs.c b/src/H5Fcwfs.c index 32c73b0..04b86d2 100644 --- a/src/H5Fcwfs.c +++ b/src/H5Fcwfs.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c index 11accc6..535b43d 100644 --- a/src/H5Fdbg.c +++ b/src/H5Fdbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index 4a3bce0..03f5df8 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Fefc.c b/src/H5Fefc.c index 42bf5d8..5652d15 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Ffake.c b/src/H5Ffake.c index e191003..6072f2e 100644 --- a/src/H5Ffake.c +++ b/src/H5Ffake.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5Fmodule.h" /* This source code file is part of the H5F module */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 444d409..fe532b2 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5Fio.c b/src/H5Fio.c index 6d23995..81fa514 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h index 4bb2506..0481512 100644 --- a/src/H5Fmodule.h +++ b/src/H5Fmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 859b9d6..3cd5c21 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5Fmodule.h" /* This source code file is part of the H5F module */ diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 60593a8..2ce454a 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 4dd9e20..7a5c126 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 8ef353a..6f68a62 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 84c0d38..1594cb2 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 34fe8f9..41cf4d2 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c index 4fb9cd9..e0c830b 100644 --- a/src/H5Fsfile.c +++ b/src/H5Fsfile.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5Fmodule.h" /* This source code file is part of the H5F module */ diff --git a/src/H5Fspace.c b/src/H5Fspace.c index 53570f6..0962f69 100644 --- a/src/H5Fspace.c +++ b/src/H5Fspace.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 58ef9bb..7c70a64 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index fa893e1..76866db 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Ftest.c b/src/H5Ftest.c index e3760b7..dd69b1e 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5G.c b/src/H5G.c index 1a18dc0..10eb5ed 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index ff7e200..71d15e5 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Gcache.c b/src/H5Gcache.c index d153560..65115a5 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c index 41ca4f5..d5698a8 100644 --- a/src/H5Gcompact.c +++ b/src/H5Gcompact.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Gdense.c b/src/H5Gdense.c index e8fa237..4ae6800 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index a775c58..228fb9c 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Gent.c b/src/H5Gent.c index f64eaf0..b781fae 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Gint.c b/src/H5Gint.c index 72cc1a4..6d33716 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Glink.c b/src/H5Glink.c index 5a195c8..d246ee7 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 3fcbd09..c011cdf 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Gmodule.h b/src/H5Gmodule.h index 52ac067..19ea982 100644 --- a/src/H5Gmodule.h +++ b/src/H5Gmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Gname.c b/src/H5Gname.c index aff9d31..7b53668 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 89d1df8..20924ee 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 92ad0af..d2dc83b 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Goh.c b/src/H5Goh.c index bde540c..977fc2d 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 1e8ad31..76bf08b 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 2ef99fd..c48e687 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index 9d8ade5..ab6f200 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Groot.c b/src/H5Groot.c index ba25f31..fbc4f1a 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Gstab.c b/src/H5Gstab.c index ed3dd84..a239cfe 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 0e0a897..7271cdc 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index d6c90e4..ff1206e 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HF.c b/src/H5HF.c index efd57ae..6c09969 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index d4a30b8..2d35368 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFcache.c b/src/H5HFcache.c index ffdac9a..f957e2e 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 40191e5..279de1e 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index b34534c..4496962 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c index 3ceb6f5..563e8c5 100644 --- a/src/H5HFdtable.c +++ b/src/H5HFdtable.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 42857c0..2f01ce6 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index 94433c4..b2a1e68 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index bb31002..11abce0 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFiter.c b/src/H5HFiter.c index 55a8532..54246d2 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFman.c b/src/H5HFman.c index cff4395..2b88b50 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFmodule.h b/src/H5HFmodule.h index e3274ce..dd6576a 100644 --- a/src/H5HFmodule.h +++ b/src/H5HFmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 9c1d9a6..d03c1222 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h index 441ad3e..8cf4b3c 100644 --- a/src/H5HFprivate.h +++ b/src/H5HFprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFpublic.h b/src/H5HFpublic.h index 78b367b..82cfc21 100644 --- a/src/H5HFpublic.h +++ b/src/H5HFpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFsection.c b/src/H5HFsection.c index b113ca1..42c12ec 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5HFspace.c b/src/H5HFspace.c index 20057e4..41954fc 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HFstat.c b/src/H5HFstat.c index 303b1f4..e38a9b1 100644 --- a/src/H5HFstat.c +++ b/src/H5HFstat.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5HFtest.c b/src/H5HFtest.c index 4b97194..1b1f688 100644 --- a/src/H5HFtest.c +++ b/src/H5HFtest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c index 711ceb9..79462e9 100644 --- a/src/H5HFtiny.c +++ b/src/H5HFtiny.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HG.c b/src/H5HG.c index e8eb2eb..893be80 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5HGcache.c b/src/H5HGcache.c index a83c22b..50b2669 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index 6013de5..6dd94f5 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5HGmodule.h b/src/H5HGmodule.h index aa34f29..1c68206 100644 --- a/src/H5HGmodule.h +++ b/src/H5HGmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h index a5c80ea..47760bf 100644 --- a/src/H5HGpkg.h +++ b/src/H5HGpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5HGprivate.h b/src/H5HGprivate.h index 0c0aa69..19dcaa4 100644 --- a/src/H5HGprivate.h +++ b/src/H5HGprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5HGpublic.h b/src/H5HGpublic.h index 01cd60c..fcec593 100644 --- a/src/H5HGpublic.h +++ b/src/H5HGpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5HGquery.c b/src/H5HGquery.c index d07edcc..35abc2e 100644 --- a/src/H5HGquery.c +++ b/src/H5HGquery.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5HL.c b/src/H5HL.c index 9af1119..fa577c3 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 3668d81..926f787 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index fc8f5d3..3533a39 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5HLdblk.c b/src/H5HLdblk.c index f90562b..684d7f9 100644 --- a/src/H5HLdblk.c +++ b/src/H5HLdblk.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HLint.c b/src/H5HLint.c index 5b547cf..e625f3d 100644 --- a/src/H5HLint.c +++ b/src/H5HLint.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HLmodule.h b/src/H5HLmodule.h index b38c077..b0fd750 100644 --- a/src/H5HLmodule.h +++ b/src/H5HLmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 06db696..770b7c0 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5HLprfx.c b/src/H5HLprfx.c index ed1c4db..41c254a 100644 --- a/src/H5HLprfx.c +++ b/src/H5HLprfx.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index e2bf29c..054d396 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HLpublic.h b/src/H5HLpublic.h index 6dc1828..143bb78 100644 --- a/src/H5HLpublic.h +++ b/src/H5HLpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5HP.c b/src/H5HP.c index 78e9e5b..4ef5662 100644 --- a/src/H5HP.c +++ b/src/H5HP.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5HPprivate.h b/src/H5HPprivate.h index 8db5b21..041c2b9 100644 --- a/src/H5HPprivate.h +++ b/src/H5HPprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5I.c b/src/H5I.c index 0fe9782..ce4ecdc 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Imodule.h b/src/H5Imodule.h index 19cc9a4..60bda5a 100644 --- a/src/H5Imodule.h +++ b/src/H5Imodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h index 0a6ae8c..16d7d67 100644 --- a/src/H5Ipkg.h +++ b/src/H5Ipkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index c916f31..25cea4f 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*----------------------------------------------------------------------------- diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 3bf3c66..896f82f 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Itest.c b/src/H5Itest.c index 506ca87..e7bd2a7 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5L.c b/src/H5L.c index ecdf8a2..469a86c 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 7f59e50..b4a173f 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5Lmodule.h b/src/H5Lmodule.h index e665c81..cba4de4 100644 --- a/src/H5Lmodule.h +++ b/src/H5Lmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Lpkg.h b/src/H5Lpkg.h index bb8534b..39e3197 100644 --- a/src/H5Lpkg.h +++ b/src/H5Lpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h index 1c8690b..dd243a6 100644 --- a/src/H5Lprivate.h +++ b/src/H5Lprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index ff2322f..9d1643e 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5MF.c b/src/H5MF.c index 87c910c..e54d809 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index de98bf1..7c05e0d 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 817ea00..49cfbfc 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5MFmodule.h b/src/H5MFmodule.h index 6e5f8ad..53daabf 100644 --- a/src/H5MFmodule.h +++ b/src/H5MFmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h index c4a0819..b95a6db 100644 --- a/src/H5MFpkg.h +++ b/src/H5MFpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index 70322c3..bfeaa33 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 617cb59..0dd26b3 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5MM.c b/src/H5MM.c index daef7b1..ee3b28f 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5MMprivate.h b/src/H5MMprivate.h index 14bd28d..0524601 100644 --- a/src/H5MMprivate.h +++ b/src/H5MMprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5MMpublic.h b/src/H5MMpublic.h index bfcb807..4e54c33 100644 --- a/src/H5MMpublic.h +++ b/src/H5MMpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5MP.c b/src/H5MP.c index 50fc598..8c9b411 100644 --- a/src/H5MP.c +++ b/src/H5MP.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5MPmodule.h b/src/H5MPmodule.h index ca6c405..27f7706 100644 --- a/src/H5MPmodule.h +++ b/src/H5MPmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5MPpkg.h b/src/H5MPpkg.h index e724146..29a25fa 100644 --- a/src/H5MPpkg.h +++ b/src/H5MPpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5MPprivate.h b/src/H5MPprivate.h index 3fa312c..009cb50 100644 --- a/src/H5MPprivate.h +++ b/src/H5MPprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5MPtest.c b/src/H5MPtest.c index 3f218db..b3f2e24 100644 --- a/src/H5MPtest.c +++ b/src/H5MPtest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5O.c b/src/H5O.c index 1b58703..152e6cc 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 44c6611..d8298a4 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 40c9c38..3512d3e 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 064c4cb..cb802ea 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #define H5A_FRIEND /*suppress error about including H5Apkg */ diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 71f54eb..2223564 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Obogus.c b/src/H5Obogus.c index d1085c8..a3531ed 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index ac6fe37..4fd0577 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 19b91f8..8f4c155 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index bea99a2..29b2503 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index 50be171..dbc894c 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Ocont.c b/src/H5Ocont.c index 63002c5..b002a32 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index ddf375c..597af63 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Odbg.c b/src/H5Odbg.c index 827f40c..483c5fd 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index 2fdf494..b9dea26 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 7ccf328..a1c24b6 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5Omodule.h" /* This source code file is part of the H5O module */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 149c8b2..0456b00 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 745d027..5419762 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke diff --git a/src/H5Oflush.c b/src/H5Oflush.c index e399c6c..2d93221 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 37ec627..89dc8ee 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index 9cd0dc1..468e07a 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Olayout.c b/src/H5Olayout.c index b7a2584..838a80f 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index 62e63d4..cac4ed1 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Olink.c b/src/H5Olink.c index fd4ee88..77872ad 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 7e6463a..158701b 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Omodule.h b/src/H5Omodule.h index a8f1301..df3ab56 100644 --- a/src/H5Omodule.h +++ b/src/H5Omodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Omtime.c b/src/H5Omtime.c index c61fa66..7e7baea 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke diff --git a/src/H5Oname.c b/src/H5Oname.c index 6c4f76f..6292883 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Onull.c b/src/H5Onull.c index 258f695..5697455 100644 --- a/src/H5Onull.c +++ b/src/H5Onull.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Opkg.h b/src/H5Opkg.h index e1fa0be..b0c67d1 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #if !(defined H5O_FRIEND || defined H5O_MODULE) diff --git a/src/H5Opline.c b/src/H5Opline.c index 95a82b5..2e52dbb 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 0a4ed74..0f798b2 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Opublic.h b/src/H5Opublic.h index dec7b5b..8d6dda4 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index ff7dfee..af68417 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 28021de..3fe5652 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5Omodule.h" /* This source code file is part of the H5O module */ diff --git a/src/H5Oshared.c b/src/H5Oshared.c index 25baa88..db2d0cc 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Oshared.h b/src/H5Oshared.h index e8d620a..2465e65 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index a506ce2..1cbfb05 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/src/H5Ostab.c b/src/H5Ostab.c index bb39e58..5c840a6 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Otest.c b/src/H5Otest.c index 8f8980a..f0deade 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5Ounknown.c b/src/H5Ounknown.c index 546e839..1b3a997 100644 --- a/src/H5Ounknown.c +++ b/src/H5Ounknown.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5P.c b/src/H5P.c index 254c3a9..49bea0a 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5PB.c b/src/H5PB.c index 575903d..52576f8 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5PBmodule.h b/src/H5PBmodule.h index 35da3f6..c8aabb6 100644 --- a/src/H5PBmodule.h +++ b/src/H5PBmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5PBpkg.h b/src/H5PBpkg.h index 976f18d..6b9168b 100644 --- a/src/H5PBpkg.h +++ b/src/H5PBpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #if !(defined H5PB_FRIEND || defined H5PB_MODULE) diff --git a/src/H5PBprivate.h b/src/H5PBprivate.h index 7dd4071..e6f2874 100644 --- a/src/H5PBprivate.h +++ b/src/H5PBprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5PL.c b/src/H5PL.c index ba10e5a..62f879b 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5PLextern.h b/src/H5PLextern.h index 3264435..7547ad7 100644 --- a/src/H5PLextern.h +++ b/src/H5PLextern.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5PLmodule.h b/src/H5PLmodule.h index 0339737..b441aed 100644 --- a/src/H5PLmodule.h +++ b/src/H5PLmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index 77e115b..0ab8f8c 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Raymond Lu diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 12cdc87..9ce1fca 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Raymond Lu diff --git a/src/H5Pacpl.c b/src/H5Pacpl.c index bfed332..4368dd6 100644 --- a/src/H5Pacpl.c +++ b/src/H5Pacpl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index aa58dc4..3b0a8c5 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 1237bfc..3b4c159 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index d225dfa..7f96333 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 4a3eb72..fdb402f 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index 1bcd19c..73c48d7 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index c69f3ef..1b0a4b9 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index c778801..5383aae 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Pfmpl.c b/src/H5Pfmpl.c index de9fa3b..e858a79 100644 --- a/src/H5Pfmpl.c +++ b/src/H5Pfmpl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index f028f7a..6f1fab1 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Pint.c b/src/H5Pint.c index 8e9a9bc..fe17a19 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5Plapl.c b/src/H5Plapl.c index a0ec7f1..18b81ac 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c index f6e7793..6508a82 100644 --- a/src/H5Plcpl.c +++ b/src/H5Plcpl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Pmodule.h b/src/H5Pmodule.h index ddf7c0f..d5c471a 100644 --- a/src/H5Pmodule.h +++ b/src/H5Pmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index 27044d5..0393f7f 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index faa2a04..47bba05 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Ppkg.h b/src/H5Ppkg.h index 7d29f3d..13463ae 100644 --- a/src/H5Ppkg.h +++ b/src/H5Ppkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 29fb919..a468464 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 50b9eb0..55b3877 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c index 5a09cd7..fb91356 100644 --- a/src/H5Pstrcpl.c +++ b/src/H5Pstrcpl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Ptest.c b/src/H5Ptest.c index f6cc97e..475a164 100644 --- a/src/H5Ptest.c +++ b/src/H5Ptest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5R.c b/src/H5R.c index 43b0a91..73c1d55 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5RS.c b/src/H5RS.c index 5bbdabd..0a3fff0 100644 --- a/src/H5RS.c +++ b/src/H5RS.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5RSprivate.h b/src/H5RSprivate.h index 757e0e4..f69624a 100644 --- a/src/H5RSprivate.h +++ b/src/H5RSprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index 9461327..109bbb4 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Rmodule.h b/src/H5Rmodule.h index 6799483..2eaf050 100644 --- a/src/H5Rmodule.h +++ b/src/H5Rmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Rpkg.h b/src/H5Rpkg.h index 8ed8d65..6d5036b 100644 --- a/src/H5Rpkg.h +++ b/src/H5Rpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Rprivate.h b/src/H5Rprivate.h index 60df636..7efa225 100644 --- a/src/H5Rprivate.h +++ b/src/H5Rprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Rpublic.h b/src/H5Rpublic.h index e990661..446b7cd 100644 --- a/src/H5Rpublic.h +++ b/src/H5Rpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5S.c b/src/H5S.c index 2fab71a..dd390d9 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5SL.c b/src/H5SL.c index f9d7654..c0934ca 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5SLmodule.h b/src/H5SLmodule.h index d5bfbc2..34f08a1 100644 --- a/src/H5SLmodule.h +++ b/src/H5SLmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5SLprivate.h b/src/H5SLprivate.h index 856099b..1393a25 100644 --- a/src/H5SLprivate.h +++ b/src/H5SLprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5SM.c b/src/H5SM.c index 221409d..d5ede7e 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index 0110c1e..f0c4963 100644 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 455dd1a..f0b469a 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5SMmessage.c b/src/H5SMmessage.c index 92b6a75..7df9f8f 100644 --- a/src/H5SMmessage.c +++ b/src/H5SMmessage.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5SMmodule.h b/src/H5SMmodule.h index b6991b6..656c7dd 100644 --- a/src/H5SMmodule.h +++ b/src/H5SMmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index 342543d..6dea7ae 100644 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5SMprivate.h b/src/H5SMprivate.h index 57afacf..8f9f533 100644 --- a/src/H5SMprivate.h +++ b/src/H5SMprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5SMtest.c b/src/H5SMtest.c index 798203d..6a4b63a 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5ST.c b/src/H5ST.c index 09c4600..dd5b63c 100644 --- a/src/H5ST.c +++ b/src/H5ST.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* TERNARY SEARCH TREE ALGS diff --git a/src/H5STprivate.h b/src/H5STprivate.h index 9b49b07..07e9afe 100644 --- a/src/H5STprivate.h +++ b/src/H5STprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Sall.c b/src/H5Sall.c index fb6b45f..710727b 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Sdbg.c b/src/H5Sdbg.c index b69604c..c9103f7 100644 --- a/src/H5Sdbg.c +++ b/src/H5Sdbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 5231c6e..e6e6cff 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Smodule.h b/src/H5Smodule.h index d4d94f2..962f0a2 100644 --- a/src/H5Smodule.h +++ b/src/H5Smodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 1f97bc8..c24c455 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Snone.c b/src/H5Snone.c index 3492325..104b0bb 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Spkg.h b/src/H5Spkg.h index e57650a..315af29 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 1531bac..251a063 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index d00b5be..60e0630 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Spublic.h b/src/H5Spublic.h index 721c4bf..5ed6249 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 2968bed..c34e1cc 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5Stest.c b/src/H5Stest.c index e1f4b61..a7bee2b 100644 --- a/src/H5Stest.c +++ b/src/H5Stest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/src/H5T.c b/src/H5T.c index 0fb8b91..5e4171d 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5TS.c b/src/H5TS.c index 7d46e95..a0ca134 100644 --- a/src/H5TS.c +++ b/src/H5TS.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* private headers */ diff --git a/src/H5TSprivate.h b/src/H5TSprivate.h index 5394b77..e5c41af 100644 --- a/src/H5TSprivate.h +++ b/src/H5TSprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Tarray.c b/src/H5Tarray.c index 4b2c7cf..beccfdb 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tbit.c b/src/H5Tbit.c index a6b917f..12d1fd1 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 3ded7af..c28b508 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index 1342770..169c146 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 23ccd98..84a997e 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tcset.c b/src/H5Tcset.c index 95658ed..186e598 100644 --- a/src/H5Tcset.c +++ b/src/H5Tcset.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index 8a10cc6..f434543 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index a769b72..c506ec1 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Tenum.c b/src/H5Tenum.c index e80d748..f5263ed 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tfields.c b/src/H5Tfields.c index 8818a73..be62d85 100644 --- a/src/H5Tfields.c +++ b/src/H5Tfields.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c index 62b8e79..bc1d84d 100644 --- a/src/H5Tfixed.c +++ b/src/H5Tfixed.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tfloat.c b/src/H5Tfloat.c index b8b1c07..85e8f30 100644 --- a/src/H5Tfloat.c +++ b/src/H5Tfloat.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tmodule.h b/src/H5Tmodule.h index bfaab5e6..d2ab08c 100644 --- a/src/H5Tmodule.h +++ b/src/H5Tmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 9dbce09..6304500 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Toffset.c b/src/H5Toffset.c index cc45d8e..668e730 100644 --- a/src/H5Toffset.c +++ b/src/H5Toffset.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Toh.c b/src/H5Toh.c index 9c8ad80..01cefe1 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5Topaque.c b/src/H5Topaque.c index 9cc22c9..4e8f1d4 100644 --- a/src/H5Topaque.c +++ b/src/H5Topaque.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Torder.c b/src/H5Torder.c index 6c9c55c..877316d 100644 --- a/src/H5Torder.c +++ b/src/H5Torder.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tpad.c b/src/H5Tpad.c index e636a84..c96f42a 100644 --- a/src/H5Tpad.c +++ b/src/H5Tpad.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 49b0ea0..d075127 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index be85491..59bac8b 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 7efcb41..f2da62e 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index df7ad41..fc3e4ee 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tstrpad.c b/src/H5Tstrpad.c index 2cd1db4..fa084f1 100644 --- a/src/H5Tstrpad.c +++ b/src/H5Tstrpad.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tvisit.c b/src/H5Tvisit.c index d732fb3..c706dee 100644 --- a/src/H5Tvisit.c +++ b/src/H5Tvisit.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index d198d50..00e61e5 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5UC.c b/src/H5UC.c index 5762cc5..2277818 100644 --- a/src/H5UC.c +++ b/src/H5UC.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5UCprivate.h b/src/H5UCprivate.h index a702c03..c451f31 100644 --- a/src/H5UCprivate.h +++ b/src/H5UCprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5VM.c b/src/H5VM.c index c546609..4c0b837 100644 --- a/src/H5VM.c +++ b/src/H5VM.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index cbe108a..4d71b29 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5WB.c b/src/H5WB.c index 978ded4..8a85a3a 100644 --- a/src/H5WB.c +++ b/src/H5WB.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5WBprivate.h b/src/H5WBprivate.h index cfa3fcb..4460808 100644 --- a/src/H5WBprivate.h +++ b/src/H5WBprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5Z.c b/src/H5Z.c index 0be0bbe..ef34d7c 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5Zmodule.h" /* This source code file is part of the H5Z module */ diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 15aac27..34fdfec 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index 9ff85cc..4cd77ef 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Zmodule.h b/src/H5Zmodule.h index fa0ef8f..97e158c 100644 --- a/src/H5Zmodule.h +++ b/src/H5Zmodule.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 7a41d16..373eb37 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5Zmodule.h" /* This source code file is part of the H5Z module */ diff --git a/src/H5Zpkg.h b/src/H5Zpkg.h index aa2ffe2..2aa17f2 100644 --- a/src/H5Zpkg.h +++ b/src/H5Zpkg.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #if !(defined H5Z_FRIEND || defined H5Z_MODULE) diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index 73d85ac..fe182ad 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index 8daa5f4..f6b313e 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 1cca9b1..b86d785 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5Zmodule.h" /* This source code file is part of the H5Z module */ diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index 4cf6adf..1fef1c1 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5Zmodule.h" /* This source code file is part of the H5Z module */ diff --git a/src/H5Zszip.c b/src/H5Zszip.c index 557e923..dd35859 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5Zmodule.h" /* This source code file is part of the H5Z module */ diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index f30f0b2..d4b59a6 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5Zmodule.h" /* This source code file is part of the H5Z module */ diff --git a/src/H5api_adpt.h b/src/H5api_adpt.h index 910bef9..0ff0f74 100644 --- a/src/H5api_adpt.h +++ b/src/H5api_adpt.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5checksum.c b/src/H5checksum.c index 48e4ce5..64d527e 100644 --- a/src/H5checksum.c +++ b/src/H5checksum.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5dbg.c b/src/H5dbg.c index 2039a51..dd50034 100644 --- a/src/H5dbg.c +++ b/src/H5dbg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5detect.c b/src/H5detect.c index 94e841e..75a1dba 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*keep this declaration near the top of this file -RPM*/ @@ -22,12 +20,10 @@ static const char *FileHeader = "\n\ * *\n\ * This file is part of HDF5. The full HDF5 copyright notice, including *\n\ * terms governing use, modification, and redistribution, is contained in *\n\ - * the files COPYING and Copyright.html. COPYING can be found at the root *\n\ - * of the source code distribution tree; Copyright.html can be found at the *\n\ - * root level of an installed copy of the electronic HDF5 document set and *\n\ - * is linked from the top-level documents page. It can also be found at *\n\ - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *\n\ - * access to either file, you may request a copy from help@hdfgroup.org. *\n\ + * the COPYING file, which can be found at the root of the source code *\n\ + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *\n\ + * If you do not have access to either file, you may request a copy from *\n\ + * help@hdfgroup.org. *\n\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"; /* * diff --git a/src/H5err.txt b/src/H5err.txt index ffa9315..3f5801f 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -4,12 +4,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file is used to generate the various headers that are needed for the diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c index fa00c64..1892806 100644 --- a/src/H5make_libsettings.c +++ b/src/H5make_libsettings.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*keep this declaration near the top of this file -RPM*/ @@ -22,12 +20,10 @@ static const char *FileHeader = "\n\ * *\n\ * This file is part of HDF5. The full HDF5 copyright notice, including *\n\ * terms governing use, modification, and redistribution, is contained in *\n\ - * the files COPYING and Copyright.html. COPYING can be found at the root *\n\ - * of the source code distribution tree; Copyright.html can be found at the *\n\ - * root level of an installed copy of the electronic HDF5 document set and *\n\ - * is linked from the top-level documents page. It can also be found at *\n\ - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *\n\ - * access to either file, you may request a copy from help@hdfgroup.org. *\n\ + * the COPYING file, which can be found at the root of the source code *\n\ + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *\n\ + * If you do not have access to either file, you may request a copy from *\n\ + * help@hdfgroup.org. *\n\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"; /* * diff --git a/src/H5overflow.txt b/src/H5overflow.txt index 3e9f069..a9e5099 100644 --- a/src/H5overflow.txt +++ b/src/H5overflow.txt @@ -4,12 +4,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file is used to generate the headers that is needed for detecting diff --git a/src/H5private.h b/src/H5private.h index 61ecc5b..c588154 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke diff --git a/src/H5public.h b/src/H5public.h index cab90aa..40e6e6e 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5system.c b/src/H5system.c index 1f92e19..7e25540 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5timer.c b/src/H5timer.c index f36681e..0ba8bd1 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5trace.c b/src/H5trace.c index 48c357a..9fb8a72 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/src/H5vers.txt b/src/H5vers.txt index 07d2c4b..0303bf5 100644 --- a/src/H5vers.txt +++ b/src/H5vers.txt @@ -4,12 +4,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # This file is used to generate the various headers that are needed for diff --git a/src/H5win32defs.h b/src/H5win32defs.h index e005b51..0149faa 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Scott Wegner diff --git a/src/Makefile.am b/src/Makefile.am index 59df4c2..0b664a7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/src/hdf5.h b/src/hdf5.h index 7a10507..fc4541a 100644 --- a/src/hdf5.h +++ b/src/hdf5.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 6eee237..fe8f261 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/test/COPYING b/test/COPYING index 6903daf..6497ace 100644 --- a/test/COPYING +++ b/test/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/test/H5srcdir.h b/test/H5srcdir.h index 2f04295..32fe8c9 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/H5srcdir_str.h.in b/test/H5srcdir_str.h.in index d472124..bab1df3 100644 --- a/test/H5srcdir_str.h.in +++ b/test/H5srcdir_str.h.in @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* If you are reading this file and it has a '.h' suffix, it was automatically diff --git a/test/Makefile.am b/test/Makefile.am index d5c3511..b274302 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/test/accum.c b/test/accum.c index d134bbc..d76c866 100644 --- a/test/accum.c +++ b/test/accum.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Mike McGreevy diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c index d98fe70..c1a238d 100644 --- a/test/accum_swmr_reader.c +++ b/test/accum_swmr_reader.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5test.h" diff --git a/test/app_ref.c b/test/app_ref.c index 4b72bcb..3ef3fef 100644 --- a/test/app_ref.c +++ b/test/app_ref.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/atomic_reader.c b/test/atomic_reader.c index 94d9c74..3e3a20a 100644 --- a/test/atomic_reader.c +++ b/test/atomic_reader.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- * diff --git a/test/atomic_writer.c b/test/atomic_writer.c index ec1e8c9..218d4da 100644 --- a/test/atomic_writer.c +++ b/test/atomic_writer.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/test/big.c b/test/big.c index 0505e54..3685821 100644 --- a/test/big.c +++ b/test/big.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/bittests.c b/test/bittests.c index cf83ead..ccd725c 100644 --- a/test/bittests.c +++ b/test/bittests.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/btree2.c b/test/btree2.c index ea16583..ec3e20e 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/test/cache.c b/test/cache.c index 6658c70..3df8156 100644 --- a/test/cache.c +++ b/test/cache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer diff --git a/test/cache_api.c b/test/cache_api.c index 867f055..7c0ffa3 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer diff --git a/test/cache_common.c b/test/cache_common.c index 52dbb52..69bc26a 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer diff --git a/test/cache_common.h b/test/cache_common.h index f17c16b..8999e44 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer diff --git a/test/cache_image.c b/test/cache_image.c index 378c21e..58b0b8f 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer diff --git a/test/cache_logging.c b/test/cache_logging.c index 9190a8a..b4ed53b 100644 --- a/test/cache_logging.c +++ b/test/cache_logging.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Purpose: Tests the metadata cache logging framework */ diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 957187b..99ab49c 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -1,14 +1,13 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Mike McGreevy diff --git a/test/chunk_info.c b/test/chunk_info.c index 68bf774..1f19963 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index b44a847..5d6cfc7 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/cork.c b/test/cork.c index 6cca163..8c685ee 100644 --- a/test/cork.c +++ b/test/cork.c @@ -1,14 +1,13 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Vailin Choi diff --git a/test/cross_read.c b/test/cross_read.c index 8df81f0..5d5ef07 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/dangle.c b/test/dangle.c index 4c8ce6b..1717d12 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/dsets.c b/test/dsets.c index c090174..ef58509 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/dt_arith.c b/test/dt_arith.c index c5c14c87..c7f2986 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/dtransform.c b/test/dtransform.c index 2769771..0381bb8 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5test.h" diff --git a/test/dtypes.c b/test/dtypes.c index c3a8066..7e8047d 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/dynlib1.c b/test/dynlib1.c index 1ccc33a..e9137fb 100644 --- a/test/dynlib1.c +++ b/test/dynlib1.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Programmer: Raymond Lu diff --git a/test/dynlib2.c b/test/dynlib2.c index 0d8be2b..2574d4d 100644 --- a/test/dynlib2.c +++ b/test/dynlib2.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Programmer: Raymond Lu diff --git a/test/dynlib3.c b/test/dynlib3.c index e509a52..8871321 100644 --- a/test/dynlib3.c +++ b/test/dynlib3.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Programmer: Raymond Lu diff --git a/test/dynlib4.c b/test/dynlib4.c index 8da0270..06d90ff 100644 --- a/test/dynlib4.c +++ b/test/dynlib4.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Purpose: Tests the plugin module (H5PL) diff --git a/test/earray.c b/test/earray.c index c6f5986..1058565 100644 --- a/test/earray.c +++ b/test/earray.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/test/efc.c b/test/efc.c index 57a600d..bd008c8 100644 --- a/test/efc.c +++ b/test/efc.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Neil Fortner diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c index 5179e8e..36db2d0 100644 --- a/test/enc_dec_plist.c +++ b/test/enc_dec_plist.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/enc_dec_plist_cross_platform.c b/test/enc_dec_plist_cross_platform.c index a5d5552..5511828 100644 --- a/test/enc_dec_plist_cross_platform.c +++ b/test/enc_dec_plist_cross_platform.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/enum.c b/test/enum.c index 29b702d..4e20713 100644 --- a/test/enum.c +++ b/test/enum.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/err_compat.c b/test/err_compat.c index 7779ddc..eee150b 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/error_test.c b/test/error_test.c index b150656..9c39065 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/evict_on_close.c b/test/evict_on_close.c index 147976b..6536837 100644 --- a/test/evict_on_close.c +++ b/test/evict_on_close.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/extend.c b/test/extend.c index 68f0d7c..e5c3cb3 100644 --- a/test/extend.c +++ b/test/extend.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/external.c b/test/external.c index 35207bd..9502586 100644 --- a/test/external.c +++ b/test/external.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/farray.c b/test/farray.c index e84bfae..f9f97bf 100644 --- a/test/farray.c +++ b/test/farray.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/fheap.c b/test/fheap.c index e741aad..4be6cb9 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/test/file_image.c b/test/file_image.c index dd0a483..90b3233 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/fillval.c b/test/fillval.c index 6eb3565..ea13de0 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/filter_fail.c b/test/filter_fail.c index f165d8a..76b3106 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/flush1.c b/test/flush1.c index 4f63093..bdbd731 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/flush2.c b/test/flush2.c index ce3b3e7..9fdf6c1 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/flushrefresh.c b/test/flushrefresh.c index e0a7484..f35ed5e 100644 --- a/test/flushrefresh.c +++ b/test/flushrefresh.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * /* * Programmer: Mike McGreevy diff --git a/test/freespace.c b/test/freespace.c index 2bf9111..39c5688 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Tests for free-space manager diff --git a/test/gen_bad_compound.c b/test/gen_bad_compound.c index b864195..c52eb95 100644 --- a/test/gen_bad_compound.c +++ b/test/gen_bad_compound.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_bad_ohdr.c b/test/gen_bad_ohdr.c index 6d50230..36ba64a 100644 --- a/test/gen_bad_ohdr.c +++ b/test/gen_bad_ohdr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_bogus.c b/test/gen_bogus.c index fdd8744..ec29eb9 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_cross.c b/test/gen_cross.c index af39f69..cf3fc35 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_deflate.c b/test/gen_deflate.c index 3a9370d..3409a81 100644 --- a/test/gen_deflate.c +++ b/test/gen_deflate.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_file_image.c b/test/gen_file_image.c index 0637473..9607cc2 100644 --- a/test/gen_file_image.c +++ b/test/gen_file_image.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_filespace.c b/test/gen_filespace.c index 52715ae..4397836 100644 --- a/test/gen_filespace.c +++ b/test/gen_filespace.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/test/gen_filters.c b/test/gen_filters.c index f506602..fa66078 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5test.h" diff --git a/test/gen_mergemsg.c b/test/gen_mergemsg.c index 5df5674..f158d57 100644 --- a/test/gen_mergemsg.c +++ b/test/gen_mergemsg.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_new_array.c b/test/gen_new_array.c index c78644d..27f162c 100644 --- a/test/gen_new_array.c +++ b/test/gen_new_array.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_new_fill.c b/test/gen_new_fill.c index 4ba85ad..5bdbf73 100644 --- a/test/gen_new_fill.c +++ b/test/gen_new_fill.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_new_group.c b/test/gen_new_group.c index b998913..6924291 100644 --- a/test/gen_new_group.c +++ b/test/gen_new_group.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_new_mtime.c b/test/gen_new_mtime.c index d7a0f32..b44d567 100644 --- a/test/gen_new_mtime.c +++ b/test/gen_new_mtime.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_new_super.c b/test/gen_new_super.c index f6d15f4..f6ce589 100644 --- a/test/gen_new_super.c +++ b/test/gen_new_super.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_noencoder.c b/test/gen_noencoder.c index 46a2036..e6ac9cf 100644 --- a/test/gen_noencoder.c +++ b/test/gen_noencoder.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/test/gen_nullspace.c b/test/gen_nullspace.c index 8349a5c..9d76deb 100644 --- a/test/gen_nullspace.c +++ b/test/gen_nullspace.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_old_array.c b/test/gen_old_array.c index a4162f2..3fab657 100644 --- a/test/gen_old_array.c +++ b/test/gen_old_array.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_old_group.c b/test/gen_old_group.c index 1b33cea..d109329 100644 --- a/test/gen_old_group.c +++ b/test/gen_old_group.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_old_layout.c b/test/gen_old_layout.c index 312ee58..56c3e4e 100644 --- a/test/gen_old_layout.c +++ b/test/gen_old_layout.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_old_mtime.c b/test/gen_old_mtime.c index ca6012a..cbe3bdc 100644 --- a/test/gen_old_mtime.c +++ b/test/gen_old_mtime.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_plist.c b/test/gen_plist.c index 5c54ce8..41f232d 100644 --- a/test/gen_plist.c +++ b/test/gen_plist.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_sizes_lheap.c b/test/gen_sizes_lheap.c index de7e261..81742df 100644 --- a/test/gen_sizes_lheap.c +++ b/test/gen_sizes_lheap.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_specmetaread.c b/test/gen_specmetaread.c index f489119..d06bd59 100644 --- a/test/gen_specmetaread.c +++ b/test/gen_specmetaread.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gen_udlinks.c b/test/gen_udlinks.c index 55abab0..e48d0e8 100644 --- a/test/gen_udlinks.c +++ b/test/gen_udlinks.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/genall5.c b/test/genall5.c index 8a1e853..a48f14b 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer diff --git a/test/genall5.h b/test/genall5.h index 70b5a6f..1dce195 100644 --- a/test/genall5.h +++ b/test/genall5.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer diff --git a/test/getname.c b/test/getname.c index e6d26ce..c3f3c54 100644 --- a/test/getname.c +++ b/test/getname.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/gheap.c b/test/gheap.c index eafc49d..7564afa 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/h5test.c b/test/h5test.c index a36d580..2d77dc8 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/h5test.h b/test/h5test.h index e79f2b1..0e23255 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/hyperslab.c b/test/hyperslab.c index 065d001..c28d872 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke diff --git a/test/istore.c b/test/istore.c index f6b83c9..8dc5efd 100644 --- a/test/istore.c +++ b/test/istore.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke diff --git a/test/lheap.c b/test/lheap.c index 61323a9..f5b7f77 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/links.c b/test/links.c index e3bbdb2..2d1ef03 100644 --- a/test/links.c +++ b/test/links.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/links_env.c b/test/links_env.c index efc7c1e..b32fb32 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/mf.c b/test/mf.c index 160fb92..3197989 100644 --- a/test/mf.c +++ b/test/mf.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/mount.c b/test/mount.c index 2502bbe..d2c0d21 100644 --- a/test/mount.c +++ b/test/mount.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/mtime.c b/test/mtime.c index 88ed31c..38e3960 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/ntypes.c b/test/ntypes.c index bb6c973..b6f4de7 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/objcopy.c b/test/objcopy.c index 0711fb0..b7f5673 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/ohdr.c b/test/ohdr.c index 2ac9866..faec835 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Robb Matzke diff --git a/test/page_buffer.c b/test/page_buffer.c index 54a25d6..853ef93 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/plugin.c b/test/plugin.c index 862f99d..8b4324d 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Programmer: Raymond Lu diff --git a/test/pool.c b/test/pool.c index 7d80096..1851d6e 100644 --- a/test/pool.c +++ b/test/pool.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol diff --git a/test/reserved.c b/test/reserved.c index bb6d328..d8d0c59 100644 --- a/test/reserved.c +++ b/test/reserved.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5test.h" diff --git a/test/set_extent.c b/test/set_extent.c index 052a35a..b9536e5 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/space_overflow.c b/test/space_overflow.c index f0e5e1d..15be9ba 100644 --- a/test/space_overflow.c +++ b/test/space_overflow.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/stab.c b/test/stab.c index 00aee21..97abc16 100644 --- a/test/stab.c +++ b/test/stab.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/swmr.c b/test/swmr.c index 780eb0f..399a9ec 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c index d3b5829..51caa3d 100644 --- a/test/swmr_addrem_writer.c +++ b/test/swmr_addrem_writer.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/test/swmr_check_compat_vfd.c b/test/swmr_check_compat_vfd.c index 1bbfda3..1589f6e 100644 --- a/test/swmr_check_compat_vfd.c +++ b/test/swmr_check_compat_vfd.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Purpose: This is a small program that checks if the HDF5_DRIVER diff --git a/test/swmr_common.c b/test/swmr_common.c index ac17ddd..a0d79e3 100644 --- a/test/swmr_common.c +++ b/test/swmr_common.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/test/swmr_common.h b/test/swmr_common.h index a2cee71..99d1cb2 100644 --- a/test/swmr_common.h +++ b/test/swmr_common.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _SWMR_COMMON_H diff --git a/test/swmr_generator.c b/test/swmr_generator.c index a87879f..1c2ec04 100644 --- a/test/swmr_generator.c +++ b/test/swmr_generator.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/test/swmr_reader.c b/test/swmr_reader.c index 79ac107..e181d3a 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index 689b010..11649e3 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c index ddf7ede..82c2f8b 100644 --- a/test/swmr_remove_writer.c +++ b/test/swmr_remove_writer.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index f755cd2..3c98f48 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c index 13b21c2..e46f54c 100644 --- a/test/swmr_sparse_writer.c +++ b/test/swmr_sparse_writer.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c index ab639fb..2d5c3f9 100644 --- a/test/swmr_start_write.c +++ b/test/swmr_start_write.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/test/swmr_writer.c b/test/swmr_writer.c index 8f6be19..ee7e32e 100644 --- a/test/swmr_writer.c +++ b/test/swmr_writer.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/test/tarray.c b/test/tarray.c index 4a87981..a35b8a3 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tattr.c b/test/tattr.c index 6f55081..3b0c90e 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tcheck_version.c b/test/tcheck_version.c index 5808680..574d7c9 100644 --- a/test/tcheck_version.c +++ b/test/tcheck_version.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/tchecksum.c b/test/tchecksum.c index cf519c0..febaacc 100644 --- a/test/tchecksum.c +++ b/test/tchecksum.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/test/tconfig.c b/test/tconfig.c index 1604c61..a9f3378 100644 --- a/test/tconfig.c +++ b/test/tconfig.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tcoords.c b/test/tcoords.c index 306c6b2..d729d4b 100644 --- a/test/tcoords.c +++ b/test/tcoords.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index 4cddbb0..c90a978 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -1,16 +1,14 @@ #! /bin/sh # -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic document set and is -# linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access -# to either file, you may request a copy from help@hdfgroup.org. +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # srcdir=@srcdir@ TOP_BUILDDIR=@top_builddir@ diff --git a/test/test_usecases.sh.in b/test/test_usecases.sh.in index a1fda0e..8bc2078 100644 --- a/test/test_usecases.sh.in +++ b/test/test_usecases.sh.in @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests the use cases of swmr features. # diff --git a/test/testcheck_version.sh.in b/test/testcheck_version.sh.in index ed9845e..a5641f5 100644 --- a/test/testcheck_version.sh.in +++ b/test/testcheck_version.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the H5check_version function. diff --git a/test/testerror.sh.in b/test/testerror.sh.in index 7c03414..734b051 100644 --- a/test/testerror.sh.in +++ b/test/testerror.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for test_error and err_compat diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in index d894cee..ca46dcb 100644 --- a/test/testflushrefresh.sh.in +++ b/test/testflushrefresh.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # # Test script for the flush/evict single objects feature. diff --git a/test/testframe.c b/test/testframe.c index c2db235..21f9ea3 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/testhdf5.c b/test/testhdf5.c index 0e7303e..713cccf 100644 --- a/test/testhdf5.c +++ b/test/testhdf5.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/testhdf5.h b/test/testhdf5.h index 62dadde..2cbe6c6 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/testlibinfo.sh.in b/test/testlibinfo.sh.in index b7aa6c4..1dd744b 100644 --- a/test/testlibinfo.sh.in +++ b/test/testlibinfo.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # diff --git a/test/testlinks_env.sh.in b/test/testlinks_env.sh.in index 7120430..94e6c7e 100644 --- a/test/testlinks_env.sh.in +++ b/test/testlinks_env.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Test for external link with environment variable: HDF5_EXT_PREFIX diff --git a/test/testmeta.c b/test/testmeta.c index e1d12e6..b97eb68 100644 --- a/test/testmeta.c +++ b/test/testmeta.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/testswmr.sh.in b/test/testswmr.sh.in index f70d083..f81a7d7 100644 --- a/test/testswmr.sh.in +++ b/test/testswmr.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the swmr feature. # diff --git a/test/testvdsswmr.sh.in b/test/testvdsswmr.sh.in index 3ada67b..32af072 100644 --- a/test/testvdsswmr.sh.in +++ b/test/testvdsswmr.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the swmr feature using virtual datasets. # diff --git a/test/tfile.c b/test/tfile.c index 7edc40c..7274c82 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tgenprop.c b/test/tgenprop.c index e6f9692..0e6b5c9 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/th5o.c b/test/th5o.c index c2c4034..4baac20 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/th5s.c b/test/th5s.c index 664c23a..c63320a 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/theap.c b/test/theap.c index 9c509a1..3c23025 100644 --- a/test/theap.c +++ b/test/theap.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/tid.c b/test/tid.c index 6570b1c..494ee60 100644 --- a/test/tid.c +++ b/test/tid.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Test user-created identifiers (hid_t's) and identifier types. */ diff --git a/test/titerate.c b/test/titerate.c index 3004d62..aad62c9 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tmeta.c b/test/tmeta.c index 43fdeac..7eeb493 100644 --- a/test/tmeta.c +++ b/test/tmeta.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tmisc.c b/test/tmisc.c index 6012588..dc69e18 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/trefer.c b/test/trefer.c index 433239a..05c0130 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/trefstr.c b/test/trefstr.c index dd76cc1..40ce344 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/tselect.c b/test/tselect.c index 9230d8b..85c21bb 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tskiplist.c b/test/tskiplist.c index f30948e..b9b00df 100644 --- a/test/tskiplist.c +++ b/test/tskiplist.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/tsohm.c b/test/tsohm.c index 9d56fcc..133b196 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/ttime.c b/test/ttime.c index 16acd3e..2eb2117 100644 --- a/test/ttime.c +++ b/test/ttime.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/ttsafe.c b/test/ttsafe.c index bfd24ba..ae4d7c5 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/ttsafe.h b/test/ttsafe.h index f2e9e86..6cf449f 100644 --- a/test/ttsafe.h +++ b/test/ttsafe.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c index cc3f405..42d0851 100644 --- a/test/ttsafe_acreate.c +++ b/test/ttsafe_acreate.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /******************************************************************** diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c index 7f8cd53..4bbb326 100644 --- a/test/ttsafe_cancel.c +++ b/test/ttsafe_cancel.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /******************************************************************** diff --git a/test/ttsafe_dcreate.c b/test/ttsafe_dcreate.c index df51f72..65051c7 100644 --- a/test/ttsafe_dcreate.c +++ b/test/ttsafe_dcreate.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /******************************************************************** diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index a2f25db..889d64b 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /******************************************************************** diff --git a/test/ttst.c b/test/ttst.c index a7c43a2..b26d582 100644 --- a/test/ttst.c +++ b/test/ttst.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/tunicode.c b/test/tunicode.c index 2bba9ae..85f5af0 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Unicode test */ diff --git a/test/tvlstr.c b/test/tvlstr.c index dbc3083..7b520f2 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/tvltypes.c b/test/tvltypes.c index d00519d..5121a66 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/twriteorder.c b/test/twriteorder.c index 58690f6..0e1d0d4 100644 --- a/test/twriteorder.c +++ b/test/twriteorder.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** diff --git a/test/unlink.c b/test/unlink.c index e52699a..f5754f8 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/unregister.c b/test/unregister.c index 878270f..a4bf24e 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Programmer: Raymond Lu diff --git a/test/use.h b/test/use.h index 6664610..0885cc5 100644 --- a/test/use.h +++ b/test/use.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c index 2b1b631..005eb51 100644 --- a/test/use_append_chunk.c +++ b/test/use_append_chunk.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c index f9ce41b..9ee37cb 100644 --- a/test/use_append_mchunks.c +++ b/test/use_append_mchunks.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * diff --git a/test/use_common.c b/test/use_common.c index a18601c..908cac9 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5test.h" diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c index 2915cc3..340f578 100644 --- a/test/use_disable_mdc_flushes.c +++ b/test/use_disable_mdc_flushes.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/vds.c b/test/vds.c index e6bfeb3..c9b7a1b 100644 --- a/test/vds.c +++ b/test/vds.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/test/vds_swmr.h b/test/vds_swmr.h index c043fd6..a8e4d50 100644 --- a/test/vds_swmr.h +++ b/test/vds_swmr.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef VDS_SWMR_H diff --git a/test/vds_swmr_gen.c b/test/vds_swmr_gen.c index 60f081e..24c6131 100644 --- a/test/vds_swmr_gen.c +++ b/test/vds_swmr_gen.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5test.h" diff --git a/test/vds_swmr_reader.c b/test/vds_swmr_reader.c index 7ef2e90..1de0cc5 100644 --- a/test/vds_swmr_reader.c +++ b/test/vds_swmr_reader.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5test.h" diff --git a/test/vds_swmr_writer.c b/test/vds_swmr_writer.c index abf0124..7824aa0 100644 --- a/test/vds_swmr_writer.c +++ b/test/vds_swmr_writer.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/test/vfd.c b/test/vfd.c index a215264..1932d2c 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index 7dce6d6..6e2b05e 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/testpar/COPYING b/testpar/COPYING index 6903daf..6497ace 100644 --- a/testpar/COPYING +++ b/testpar/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/testpar/Makefile.am b/testpar/Makefile.am index 3889630..b87c1df 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/testpar/t_cache.c b/testpar/t_cache.c index bfa4c8f..700e993 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index f65b248..524a63f 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c index 05fd2fc..2340ae0 100644 --- a/testpar/t_chunk_alloc.c +++ b/testpar/t_chunk_alloc.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index ab9de09..c6fa3d4 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "testphdf5.h" diff --git a/testpar/t_dset.c b/testpar/t_dset.c index ceacb3a..b952bf3 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_file.c b/testpar/t_file.c index 4a923d4..1b6978f 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_file_image.c b/testpar/t_file_image.c index a2246b6..62db11a 100644 --- a/testpar/t_file_image.c +++ b/testpar/t_file_image.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c index 44f3f11..4556b01 100644 --- a/testpar/t_filter_read.c +++ b/testpar/t_filter_read.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_init_term.c b/testpar/t_init_term.c index 824f773..933fbd2 100644 --- a/testpar/t_init_term.c +++ b/testpar/t_init_term.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index 39cfbbc..5d989bb 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "testphdf5.h" diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index c234257..3d501c9 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c index 1bcfeb8..0782f3d 100644 --- a/testpar/t_pflush1.c +++ b/testpar/t_pflush1.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c index f9f8459..2051f4e 100644 --- a/testpar/t_pflush2.c +++ b/testpar/t_pflush2.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 76eeaef..574591c 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_prestart.c b/testpar/t_prestart.c index fab4a7c..719d150 100644 --- a/testpar/t_prestart.c +++ b/testpar/t_prestart.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_prop.c b/testpar/t_prop.c index 2cc0f5e..d5efa94 100644 --- a/testpar/t_prop.c +++ b/testpar/t_prop.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_pshutdown.c b/testpar/t_pshutdown.c index be9734f..def7071 100644 --- a/testpar/t_pshutdown.c +++ b/testpar/t_pshutdown.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index 3675824..d81d2be 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index f1487eb..a42df95 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/testpar.h b/testpar/testpar.h index 2c99103..84c073f 100644 --- a/testpar/testpar.h +++ b/testpar/testpar.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* common definitions used by all parallel test programs. */ diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index a58452e..87d9056 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 0cf5857..322cb9b 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* common definitions used by all parallel hdf5 test programs. */ diff --git a/tools/COPYING b/tools/COPYING index 6903daf..6497ace 100644 --- a/tools/COPYING +++ b/tools/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/tools/Makefile.am b/tools/Makefile.am index cd97069..b0c33ed 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/lib/Makefile.am b/tools/lib/Makefile.am index e8fc6a1..f07dff7 100644 --- a/tools/lib/Makefile.am +++ b/tools/lib/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index e6ff7e0..afb36d9 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 04b640f..0226e83 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef H5DIFF_H__ diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index e066937..49f41dc 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5private.h" diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index b29e360..5642a9b 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5private.h" diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index aca8d02..d8eadda 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5private.h" diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 985a47d..7d6580c 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5private.h" diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index bfcbfb8..86dca8b 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 38739c8..2bafdfc 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index a673d15..381a253 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h index b05f226..dc79f43 100644 --- a/tools/lib/h5tools_dump.h +++ b/tools/lib/h5tools_dump.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index 749157e..136c5ed 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 486d1c6..6ee58c5 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5private.h" diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 8c869c8..85850e3 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/tools/lib/h5tools_ref.h b/tools/lib/h5tools_ref.h index 7ddb91a..b7bd9a3 100644 --- a/tools/lib/h5tools_ref.h +++ b/tools/lib/h5tools_ref.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef H5TOOLS_REF_H__ diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 358e993..88f6cc5 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h index 6173b89..a5045ac 100644 --- a/tools/lib/h5tools_str.h +++ b/tools/lib/h5tools_str.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c index 8a56d29..dcc994e 100644 --- a/tools/lib/h5tools_type.c +++ b/tools/lib/h5tools_type.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5private.h" diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 0884945..c361e25 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index f7ab65b..a31ba3a 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 66beb0d..3d55f2d 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index 352a9e5..c2ad9b7 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef H5TRAV_H__ diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c index 6053ce9..e3318e9 100644 --- a/tools/lib/io_timer.c +++ b/tools/lib/io_timer.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* changes: * rename pio_timer.c as io_timer.c; diff --git a/tools/lib/io_timer.h b/tools/lib/io_timer.h index 4ce0733..48b6c87 100644 --- a/tools/lib/io_timer.h +++ b/tools/lib/io_timer.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef IO_TIMER__ diff --git a/tools/lib/ph5diff.h b/tools/lib/ph5diff.h index 2a75228..9628d45 100644 --- a/tools/lib/ph5diff.h +++ b/tools/lib/ph5diff.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _PH5DIFF_H__ diff --git a/tools/src/Makefile.am b/tools/src/Makefile.am index 358ac6b..beceee5 100644 --- a/tools/src/Makefile.am +++ b/tools/src/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/src/h5copy/Makefile.am b/tools/src/h5copy/Makefile.am index b2cdf92..d67fafc 100644 --- a/tools/src/h5copy/Makefile.am +++ b/tools/src/h5copy/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 5371a21..390b93e 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5private.h" diff --git a/tools/src/h5diff/Makefile.am b/tools/src/h5diff/Makefile.am index a5af3f2..3957e59 100644 --- a/tools/src/h5diff/Makefile.am +++ b/tools/src/h5diff/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 2453ffc..5437803 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/tools/src/h5diff/h5diff_common.h b/tools/src/h5diff/h5diff_common.h index 5b1317f..e5dfe3f 100644 --- a/tools/src/h5diff/h5diff_common.h +++ b/tools/src/h5diff/h5diff_common.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef H5DIFFCOMMON_H__ diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index cdaca29..92a1610 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index a26b6e9..bfeb408 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/tools/src/h5dump/Makefile.am b/tools/src/h5dump/Makefile.am index dc43065..86109d5 100644 --- a/tools/src/h5dump/Makefile.am +++ b/tools/src/h5dump/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index 562cfd5..b53c212 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include diff --git a/tools/src/h5dump/h5dump.h b/tools/src/h5dump/h5dump.h index 8224c02..211fd14 100644 --- a/tools/src/h5dump/h5dump.h +++ b/tools/src/h5dump/h5dump.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef H5DUMP_H__ #define H5DUMP_H__ diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c index c78f325..8ce6cd6 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include diff --git a/tools/src/h5dump/h5dump_ddl.h b/tools/src/h5dump/h5dump_ddl.h index 2b3f61e..ae01086 100644 --- a/tools/src/h5dump/h5dump_ddl.h +++ b/tools/src/h5dump/h5dump_ddl.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef H5DUMP_DDL_H__ diff --git a/tools/src/h5dump/h5dump_defines.h b/tools/src/h5dump/h5dump_defines.h index 2be2dcc..7a9d4c0 100644 --- a/tools/src/h5dump/h5dump_defines.h +++ b/tools/src/h5dump/h5dump_defines.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef H5DUMP_DEFINES_H__ #define H5DUMP_DEFINES_H__ diff --git a/tools/src/h5dump/h5dump_extern.h b/tools/src/h5dump/h5dump_extern.h index 8fef1b9..22aca73 100644 --- a/tools/src/h5dump/h5dump_extern.h +++ b/tools/src/h5dump/h5dump_extern.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef H5DUMP_EXTERN_H__ #define H5DUMP_EXTERN_H__ diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 8ed88d2..49d1ba8 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include diff --git a/tools/src/h5dump/h5dump_xml.h b/tools/src/h5dump/h5dump_xml.h index c1d6c62..3c59917 100644 --- a/tools/src/h5dump/h5dump_xml.h +++ b/tools/src/h5dump/h5dump_xml.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef H5DUMP_XML_H__ #define H5DUMP_XML_H__ diff --git a/tools/src/h5format_convert/Makefile.am b/tools/src/h5format_convert/Makefile.am index 35f9e68..2b36949 100644 --- a/tools/src/h5format_convert/Makefile.am +++ b/tools/src/h5format_convert/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index 8ce28dd..2bfe280 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/src/h5import/Makefile.am b/tools/src/h5import/Makefile.am index 2eae9ec..4623eb5 100644 --- a/tools/src/h5import/Makefile.am +++ b/tools/src/h5import/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index d1aab0c..c71aeef 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/tools/src/h5import/h5import.h b/tools/src/h5import/h5import.h index c242483..c69a542 100644 --- a/tools/src/h5import/h5import.h +++ b/tools/src/h5import/h5import.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/src/h5jam/Makefile.am b/tools/src/h5jam/Makefile.am index e244625..4c44b08 100644 --- a/tools/src/h5jam/Makefile.am +++ b/tools/src/h5jam/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index ae45714..61de604 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index 8f88398..1cc8cb3 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" diff --git a/tools/src/h5ls/Makefile.am b/tools/src/h5ls/Makefile.am index dfa8bb6..07279c1 100644 --- a/tools/src/h5ls/Makefile.am +++ b/tools/src/h5ls/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 88bab20..8e28d82 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/src/h5repack/Makefile.am b/tools/src/h5repack/Makefile.am index 31d368d..c71e65b 100644 --- a/tools/src/h5repack/Makefile.am +++ b/tools/src/h5repack/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index c09dee6..d047612 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/tools/src/h5repack/h5repack.h b/tools/src/h5repack/h5repack.h index 5ad0b80..e36f0ef 100644 --- a/tools/src/h5repack/h5repack.h +++ b/tools/src/h5repack/h5repack.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 45d52bf..604e85f 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index e21b829..804727b 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 07c2b7d..339dc83 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5tools.h" diff --git a/tools/src/h5repack/h5repack_opttable.c b/tools/src/h5repack/h5repack_opttable.c index 8c98b76..93e34b3 100644 --- a/tools/src/h5repack/h5repack_opttable.c +++ b/tools/src/h5repack/h5repack_opttable.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index 6759169..a9a890d 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index f0f32c3..2c38d94 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c index 1022d7a..7e79aa7 100644 --- a/tools/src/h5repack/h5repack_verify.c +++ b/tools/src/h5repack/h5repack_verify.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" diff --git a/tools/src/h5stat/Makefile.am b/tools/src/h5stat/Makefile.am index b4d81de..c228b48 100644 --- a/tools/src/h5stat/Makefile.am +++ b/tools/src/h5stat/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index f99bab0..6aee7a8 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/tools/src/misc/Makefile.am b/tools/src/misc/Makefile.am index ad3dae9b..64c5ee5 100644 --- a/tools/src/misc/Makefile.am +++ b/tools/src/misc/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/src/misc/h5cc.in b/tools/src/misc/h5cc.in index 1645855..9c4e3ca 100644 --- a/tools/src/misc/h5cc.in +++ b/tools/src/misc/h5cc.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## # This tool is adapted from the mpicc command of the MPICH Software. diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index 5c33b72..e3b989d 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index ae64952..72f826e 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index aa6057f..597b6b3 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/tools/src/misc/h5redeploy.in b/tools/src/misc/h5redeploy.in index 6b6ef87..242459a 100644 --- a/tools/src/misc/h5redeploy.in +++ b/tools/src/misc/h5redeploy.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # ## Update HDF5 compiler tools after the HDF5 software has been installed ## diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index e44c957..911e0c6 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/Makefile.am b/tools/test/Makefile.am index db09003..19bb047 100644 --- a/tools/test/Makefile.am +++ b/tools/test/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 42495de..2536ef3 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/h5copy/Makefile.am b/tools/test/h5copy/Makefile.am index becb55f..5fda4a0 100644 --- a/tools/test/h5copy/Makefile.am +++ b/tools/test/h5copy/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index 7669702..ed41998 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in index dbee089..ace3981 100644 --- a/tools/test/h5copy/testh5copy.sh.in +++ b/tools/test/h5copy/testh5copy.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5copy tool # diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index ca23677..f6cd2dd 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/h5diff/Makefile.am b/tools/test/h5diff/Makefile.am index ad3f4ba..922dddc 100644 --- a/tools/test/h5diff/Makefile.am +++ b/tools/test/h5diff/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/test/h5diff/dynlib_diff.c b/tools/test/h5diff/dynlib_diff.c index d80777d..571452e 100644 --- a/tools/test/h5diff/dynlib_diff.c +++ b/tools/test/h5diff/dynlib_diff.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Purpose: Tests the plugin module (H5PL) diff --git a/tools/test/h5diff/h5diff_plugin.sh.in b/tools/test/h5diff/h5diff_plugin.sh.in index ffd2ea1..0390c40 100644 --- a/tools/test/h5diff/h5diff_plugin.sh.in +++ b/tools/test/h5diff/h5diff_plugin.sh.in @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic document set and is -# linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access -# to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # srcdir=@srcdir@ TOP_BUILDDIR=@top_builddir@ diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index c3b45bc..cc7b057 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 1069ed5..86658e2 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5diff tool # diff --git a/tools/test/h5diff/testph5diff.sh.in b/tools/test/h5diff/testph5diff.sh.in index ca212a1..b726a80 100644 --- a/tools/test/h5diff/testph5diff.sh.in +++ b/tools/test/h5diff/testph5diff.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # srcdir=@srcdir@ diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index ae760bf..f17b116 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/h5dump/CMakeTestsPBITS.cmake b/tools/test/h5dump/CMakeTestsPBITS.cmake index 770531a..986f1a1 100644 --- a/tools/test/h5dump/CMakeTestsPBITS.cmake +++ b/tools/test/h5dump/CMakeTestsPBITS.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index d155e55..310f9ce 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index 2e55818..c353e48 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/h5dump/Makefile.am b/tools/test/h5dump/Makefile.am index d42afb0..64d2d7c 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/test/h5dump/binread.c b/tools/test/h5dump/binread.c index 74db92c..6165cd8 100644 --- a/tools/test/h5dump/binread.c +++ b/tools/test/h5dump/binread.c @@ -6,12 +6,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/tools/test/h5dump/dynlib_dump.c b/tools/test/h5dump/dynlib_dump.c index d80777d..571452e 100644 --- a/tools/test/h5dump/dynlib_dump.c +++ b/tools/test/h5dump/dynlib_dump.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Purpose: Tests the plugin module (H5PL) diff --git a/tools/test/h5dump/h5dump_plugin.sh.in b/tools/test/h5dump/h5dump_plugin.sh.in index d19981e..e7ac564 100644 --- a/tools/test/h5dump/h5dump_plugin.sh.in +++ b/tools/test/h5dump/h5dump_plugin.sh.in @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic document set and is -# linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access -# to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # srcdir=@srcdir@ TOP_BUILDDIR=@top_builddir@ diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index afcf405..48bc27d 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index 14d753c..cf5f246 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5dump tool diff --git a/tools/test/h5dump/testh5dumppbits.sh.in b/tools/test/h5dump/testh5dumppbits.sh.in index 92247d3..3b9b078 100644 --- a/tools/test/h5dump/testh5dumppbits.sh.in +++ b/tools/test/h5dump/testh5dumppbits.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5dump tool with packed bits type files diff --git a/tools/test/h5dump/testh5dumpvds.sh.in b/tools/test/h5dump/testh5dumpvds.sh.in index 459d506..63c0d85 100644 --- a/tools/test/h5dump/testh5dumpvds.sh.in +++ b/tools/test/h5dump/testh5dumpvds.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5dump tool with vds type files diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index 638a710..5a69845 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5dump tool diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake index 4738be5..3e423da 100644 --- a/tools/test/h5format_convert/CMakeTests.cmake +++ b/tools/test/h5format_convert/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/h5format_convert/Makefile.am b/tools/test/h5format_convert/Makefile.am index f67b2ce..eb2d5af 100644 --- a/tools/test/h5format_convert/Makefile.am +++ b/tools/test/h5format_convert/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/test/h5format_convert/h5fc_chk_idx.c b/tools/test/h5format_convert/h5fc_chk_idx.c index 3a87594..8369668 100644 --- a/tools/test/h5format_convert/h5fc_chk_idx.c +++ b/tools/test/h5format_convert/h5fc_chk_idx.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/h5format_convert/h5fc_gentest.c b/tools/test/h5format_convert/h5fc_gentest.c index aea84f8..8c873be 100644 --- a/tools/test/h5format_convert/h5fc_gentest.c +++ b/tools/test/h5format_convert/h5fc_gentest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/h5format_convert/testh5fc.sh.in b/tools/test/h5format_convert/testh5fc.sh.in index 24f04d6..c3056e8 100644 --- a/tools/test/h5format_convert/testh5fc.sh.in +++ b/tools/test/h5format_convert/testh5fc.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5format_convert tool # diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index 15b36fc..27c736a 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/h5import/Makefile.am b/tools/test/h5import/Makefile.am index f238f77..7c5371c 100644 --- a/tools/test/h5import/Makefile.am +++ b/tools/test/h5import/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c index 38fd75b..135b8e4 100644 --- a/tools/test/h5import/h5importtest.c +++ b/tools/test/h5import/h5importtest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/tools/test/h5import/h5importtestutil.sh.in b/tools/test/h5import/h5importtestutil.sh.in index 1a9a3fc..3bbe37b 100644 --- a/tools/test/h5import/h5importtestutil.sh.in +++ b/tools/test/h5import/h5importtestutil.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5import tool diff --git a/tools/test/h5jam/CMakeTests.cmake b/tools/test/h5jam/CMakeTests.cmake index d0ba305..ae6d440 100644 --- a/tools/test/h5jam/CMakeTests.cmake +++ b/tools/test/h5jam/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/h5jam/Makefile.am b/tools/test/h5jam/Makefile.am index 068f437..c07aeb2 100644 --- a/tools/test/h5jam/Makefile.am +++ b/tools/test/h5jam/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index 4e02e6b..7cfde36 100644 --- a/tools/test/h5jam/getub.c +++ b/tools/test/h5jam/getub.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5private.h" diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c index a12b17a..8648f07 100644 --- a/tools/test/h5jam/h5jamgentest.c +++ b/tools/test/h5jam/h5jamgentest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c index b4f87af..fad14b7 100644 --- a/tools/test/h5jam/tellub.c +++ b/tools/test/h5jam/tellub.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/tools/test/h5jam/testh5jam.sh.in b/tools/test/h5jam/testh5jam.sh.in index fb6d9e2..d3d7a9a 100644 --- a/tools/test/h5jam/testh5jam.sh.in +++ b/tools/test/h5jam/testh5jam.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5jam/h5unjam tools diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index d5d0eb1..5f61eab 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index 0a7a216..4a665a5 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/h5ls/Makefile.am b/tools/test/h5ls/Makefile.am index e255f01..9773ee5 100644 --- a/tools/test/h5ls/Makefile.am +++ b/tools/test/h5ls/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/test/h5ls/dynlib_ls.c b/tools/test/h5ls/dynlib_ls.c index d80777d..571452e 100644 --- a/tools/test/h5ls/dynlib_ls.c +++ b/tools/test/h5ls/dynlib_ls.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Purpose: Tests the plugin module (H5PL) diff --git a/tools/test/h5ls/h5ls_plugin.sh.in b/tools/test/h5ls/h5ls_plugin.sh.in index 24b6198..34114d8 100644 --- a/tools/test/h5ls/h5ls_plugin.sh.in +++ b/tools/test/h5ls/h5ls_plugin.sh.in @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic document set and is -# linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access -# to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # srcdir=@srcdir@ TOP_BUILDDIR=@top_builddir@ diff --git a/tools/test/h5ls/testh5ls.sh.in b/tools/test/h5ls/testh5ls.sh.in index 1b3f67d..31877d9 100644 --- a/tools/test/h5ls/testh5ls.sh.in +++ b/tools/test/h5ls/testh5ls.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5ls tool diff --git a/tools/test/h5ls/testh5lsvds.sh.in b/tools/test/h5ls/testh5lsvds.sh.in index b5c6aac..ddb1632 100644 --- a/tools/test/h5ls/testh5lsvds.sh.in +++ b/tools/test/h5ls/testh5lsvds.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5ls tool diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 2bcad83..04e405f 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index 5080222..b3cfc88 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/test/h5repack/dynlib_rpk.c b/tools/test/h5repack/dynlib_rpk.c index 3469e58..29c3eae 100644 --- a/tools/test/h5repack/dynlib_rpk.c +++ b/tools/test/h5repack/dynlib_rpk.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Programmer: Raymond Lu diff --git a/tools/test/h5repack/dynlib_vrpk.c b/tools/test/h5repack/dynlib_vrpk.c index 8da0270..06d90ff 100644 --- a/tools/test/h5repack/dynlib_vrpk.c +++ b/tools/test/h5repack/dynlib_vrpk.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Purpose: Tests the plugin module (H5PL) diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index 23e0663..c943b22 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5repack tool # diff --git a/tools/test/h5repack/h5repack_plugin.sh.in b/tools/test/h5repack/h5repack_plugin.sh.in index 0b28f78..c9fe53c 100644 --- a/tools/test/h5repack/h5repack_plugin.sh.in +++ b/tools/test/h5repack/h5repack_plugin.sh.in @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic document set and is -# linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access -# to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # srcdir=@srcdir@ TOP_BUILDDIR=@top_builddir@ diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index 69e576d..3b82383 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * -* the files COPYING and Copyright.html. COPYING can be found at the root * -* of the source code distribution tree; Copyright.html can be found at the * -* root level of an installed copy of the electronic HDF5 document set and * -* is linked from the top-level documents page. It can also be found at * -* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -* access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" diff --git a/tools/test/h5repack/testh5repack_detect_szip.c b/tools/test/h5repack/testh5repack_detect_szip.c index e91b2f7..e08d5ab 100644 --- a/tools/test/h5repack/testh5repack_detect_szip.c +++ b/tools/test/h5repack/testh5repack_detect_szip.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake index ea602ba..cd52886 100644 --- a/tools/test/h5stat/CMakeTests.cmake +++ b/tools/test/h5stat/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/h5stat/Makefile.am b/tools/test/h5stat/Makefile.am index 630e896..dd251f8 100644 --- a/tools/test/h5stat/Makefile.am +++ b/tools/test/h5stat/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/test/h5stat/h5stat_gentest.c b/tools/test/h5stat/h5stat_gentest.c index 804f418..0f696d0 100644 --- a/tools/test/h5stat/h5stat_gentest.c +++ b/tools/test/h5stat/h5stat_gentest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/h5stat/testh5stat.sh.in b/tools/test/h5stat/testh5stat.sh.in index e94f9bd..c4a52c3 100644 --- a/tools/test/h5stat/testh5stat.sh.in +++ b/tools/test/h5stat/testh5stat.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5stat tool # diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index 8a93660..7eba4a1 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/misc/CMakeTestsMkgrp.cmake b/tools/test/misc/CMakeTestsMkgrp.cmake index 2a54a0e..7011b19 100644 --- a/tools/test/misc/CMakeTestsMkgrp.cmake +++ b/tools/test/misc/CMakeTestsMkgrp.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/misc/CMakeTestsRepart.cmake b/tools/test/misc/CMakeTestsRepart.cmake index a1549ec..37da903 100644 --- a/tools/test/misc/CMakeTestsRepart.cmake +++ b/tools/test/misc/CMakeTestsRepart.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/misc/Makefile.am b/tools/test/misc/Makefile.am index fc9e1c1..f2d2489 100644 --- a/tools/test/misc/Makefile.am +++ b/tools/test/misc/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/test/misc/clear_open_chk.c b/tools/test/misc/clear_open_chk.c index 23f58bf..3a61385 100644 --- a/tools/test/misc/clear_open_chk.c +++ b/tools/test/misc/clear_open_chk.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" #include "H5private.h" diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 86ea3d2..326109c 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" #include "H5private.h" diff --git a/tools/test/misc/h5perf_gentest.c b/tools/test/misc/h5perf_gentest.c index 50c18c1..3784278 100644 --- a/tools/test/misc/h5perf_gentest.c +++ b/tools/test/misc/h5perf_gentest.c @@ -1,3 +1,14 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** This test generates attributes, groups, and datasets of many types. It creates a large number of attributes, groups, and datasets by specifying diff --git a/tools/test/misc/h5repart_gentest.c b/tools/test/misc/h5repart_gentest.c index 8a34694..5c1ff87 100644 --- a/tools/test/misc/h5repart_gentest.c +++ b/tools/test/misc/h5repart_gentest.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/misc/repart_test.c b/tools/test/misc/repart_test.c index e6da779..372f46a 100644 --- a/tools/test/misc/repart_test.c +++ b/tools/test/misc/repart_test.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c index be373e7..7ca1f92 100644 --- a/tools/test/misc/talign.c +++ b/tools/test/misc/talign.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/misc/testh5clear.sh.in b/tools/test/misc/testh5clear.sh.in index b855572..2966b2c 100644 --- a/tools/test/misc/testh5clear.sh.in +++ b/tools/test/misc/testh5clear.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5clear tool # diff --git a/tools/test/misc/testh5mkgrp.sh.in b/tools/test/misc/testh5mkgrp.sh.in index 9252934..3990bd2 100644 --- a/tools/test/misc/testh5mkgrp.sh.in +++ b/tools/test/misc/testh5mkgrp.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5mkgrp tool # diff --git a/tools/test/misc/testh5repart.sh.in b/tools/test/misc/testh5repart.sh.in index 9a9dd9a..594d37e 100644 --- a/tools/test/misc/testh5repart.sh.in +++ b/tools/test/misc/testh5repart.sh.in @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Tests for the h5repart tool diff --git a/tools/test/misc/vds/Makefile.am b/tools/test/misc/vds/Makefile.am index 89aed64..73c335f 100644 --- a/tools/test/misc/vds/Makefile.am +++ b/tools/test/misc/vds/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/test/misc/vds/UC_1.h b/tools/test/misc/vds/UC_1.h index 2150cfa..9d1f758 100644 --- a/tools/test/misc/vds/UC_1.h +++ b/tools/test/misc/vds/UC_1.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef UC_1_H diff --git a/tools/test/misc/vds/UC_1_one_dim_gen.c b/tools/test/misc/vds/UC_1_one_dim_gen.c index f47b982..b997280 100644 --- a/tools/test/misc/vds/UC_1_one_dim_gen.c +++ b/tools/test/misc/vds/UC_1_one_dim_gen.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/misc/vds/UC_2.h b/tools/test/misc/vds/UC_2.h index fe3f350..a3ee0f7 100644 --- a/tools/test/misc/vds/UC_2.h +++ b/tools/test/misc/vds/UC_2.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef UC_2_H diff --git a/tools/test/misc/vds/UC_2_two_dims_gen.c b/tools/test/misc/vds/UC_2_two_dims_gen.c index d08cc5f..bd70fda 100644 --- a/tools/test/misc/vds/UC_2_two_dims_gen.c +++ b/tools/test/misc/vds/UC_2_two_dims_gen.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/misc/vds/UC_3.h b/tools/test/misc/vds/UC_3.h index 0654a48..0c26dfb 100644 --- a/tools/test/misc/vds/UC_3.h +++ b/tools/test/misc/vds/UC_3.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef UC_3_H diff --git a/tools/test/misc/vds/UC_3_gaps_gen.c b/tools/test/misc/vds/UC_3_gaps_gen.c index 7cb208b..e6e7226 100644 --- a/tools/test/misc/vds/UC_3_gaps_gen.c +++ b/tools/test/misc/vds/UC_3_gaps_gen.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/misc/vds/UC_4.h b/tools/test/misc/vds/UC_4.h index bfcafed..5dba4fb 100644 --- a/tools/test/misc/vds/UC_4.h +++ b/tools/test/misc/vds/UC_4.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef UC_4_H diff --git a/tools/test/misc/vds/UC_4_printf_gen.c b/tools/test/misc/vds/UC_4_printf_gen.c index d067d47..b328046 100644 --- a/tools/test/misc/vds/UC_4_printf_gen.c +++ b/tools/test/misc/vds/UC_4_printf_gen.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/misc/vds/UC_5.h b/tools/test/misc/vds/UC_5.h index 96b2af3..3f8fe41 100644 --- a/tools/test/misc/vds/UC_5.h +++ b/tools/test/misc/vds/UC_5.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef UC_5_H diff --git a/tools/test/misc/vds/UC_5_stride_gen.c b/tools/test/misc/vds/UC_5_stride_gen.c index 38d24a6..a105bbd 100644 --- a/tools/test/misc/vds/UC_5_stride_gen.c +++ b/tools/test/misc/vds/UC_5_stride_gen.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/misc/vds/UC_common.h b/tools/test/misc/vds/UC_common.h index 0e61016..962a091 100644 --- a/tools/test/misc/vds/UC_common.h +++ b/tools/test/misc/vds/UC_common.h @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef USE_CASE_COMMON_H diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake index d286988..2933563 100644 --- a/tools/test/perform/CMakeTests.cmake +++ b/tools/test/perform/CMakeTests.cmake @@ -1,3 +1,14 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################## ############################################################################## diff --git a/tools/test/perform/COPYING b/tools/test/perform/COPYING index 6903daf..6497ace 100644 --- a/tools/test/perform/COPYING +++ b/tools/test/perform/COPYING @@ -5,12 +5,9 @@ The files and subdirectories in this directory are part of HDF5. The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the files COPYING - and Copyright.html. COPYING can be found at the root of the source - code distribution tree; Copyright.html can be found at the root - level of an installed copy of the electronic HDF5 document set and - is linked from the top-level documents page. It can also be found - at http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not - have access to either file, you may request a copy from + modification, and redistribution, is contained in the COPYING file + which can be found at the root of the source code distribution tree + or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do + not have access to either file, you may request a copy from help@hdfgroup.org. diff --git a/tools/test/perform/Makefile.am b/tools/test/perform/Makefile.am index 1af0e7f..5a89a66 100644 --- a/tools/test/perform/Makefile.am +++ b/tools/test/perform/Makefile.am @@ -5,12 +5,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. ## ## Makefile.am ## Run automake to generate a Makefile.in from this file. diff --git a/tools/test/perform/build_h5perf_alone.sh b/tools/test/perform/build_h5perf_alone.sh index b65e863..30d272f 100644 --- a/tools/test/perform/build_h5perf_alone.sh +++ b/tools/test/perform/build_h5perf_alone.sh @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Name: build_h5perf_alone.sh # diff --git a/tools/test/perform/build_h5perf_serial_alone.sh b/tools/test/perform/build_h5perf_serial_alone.sh index 2566609..099e7f9 100644 --- a/tools/test/perform/build_h5perf_serial_alone.sh +++ b/tools/test/perform/build_h5perf_serial_alone.sh @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # Name: build_h5perf_serial_alone.sh # diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c index b1419ee..804f88e 100644 --- a/tools/test/perform/chunk.c +++ b/tools/test/perform/chunk.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/perform/gen_report.pl b/tools/test/perform/gen_report.pl index 285f5d7..34b3a83 100644 --- a/tools/test/perform/gen_report.pl +++ b/tools/test/perform/gen_report.pl @@ -6,12 +6,10 @@ # # This file is part of HDF5. The full HDF5 copyright notice, including # terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. # # diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index fd62d37..eac099b 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c index 98093c7..81f9de6 100644 --- a/tools/test/perform/overhead.c +++ b/tools/test/perform/overhead.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c index 7b9590c..b421328 100644 --- a/tools/test/perform/perf.c +++ b/tools/test/perform/perf.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c index 2c3a19c..c24e598 100644 --- a/tools/test/perform/perf_meta.c +++ b/tools/test/perform/perf_meta.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/perform/pio_engine.c b/tools/test/perform/pio_engine.c index ab11efd..1c0d621 100644 --- a/tools/test/perform/pio_engine.c +++ b/tools/test/perform/pio_engine.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c index c1bfadb..597629e 100644 --- a/tools/test/perform/pio_perf.c +++ b/tools/test/perform/pio_perf.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/perform/pio_perf.h b/tools/test/perform/pio_perf.h index 89cf3a8..b595c90 100644 --- a/tools/test/perform/pio_perf.h +++ b/tools/test/perform/pio_perf.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef PIO_PERF_H__ diff --git a/tools/test/perform/pio_standalone.c b/tools/test/perform/pio_standalone.c index 475c678..bd5fb6f 100644 --- a/tools/test/perform/pio_standalone.c +++ b/tools/test/perform/pio_standalone.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h index f088c93..66ca05a 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef PIO_STANDALONE_H__ diff --git a/tools/test/perform/sio_engine.c b/tools/test/perform/sio_engine.c index 2a5efb6..4fead3f 100644 --- a/tools/test/perform/sio_engine.c +++ b/tools/test/perform/sio_engine.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c index 2201b99..e77b99e 100644 --- a/tools/test/perform/sio_perf.c +++ b/tools/test/perform/sio_perf.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/tools/test/perform/sio_perf.h b/tools/test/perform/sio_perf.h index 5d9358d..366b791 100644 --- a/tools/test/perform/sio_perf.h +++ b/tools/test/perform/sio_perf.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef SIO_PERF_H__ diff --git a/tools/test/perform/sio_standalone.c b/tools/test/perform/sio_standalone.c index d92ed30..dfdbc55 100644 --- a/tools/test/perform/sio_standalone.c +++ b/tools/test/perform/sio_standalone.c @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index 83dffa2..8d6d110 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -4,12 +4,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef SIO_STANDALONE_H__ diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index d9b1fa2..0636d3b 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* =========================================================================== -- cgit v0.12 From 2420df5a85c64a20d98165c5b8c891899b31da83 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 25 Apr 2017 16:34:52 -0500 Subject: HDFFV-10170 revert entire change --- src/H5PL.c | 86 +++----------------------------------------------------------- 1 file changed, 3 insertions(+), 83 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 62f879b..65d6c91 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -120,15 +120,6 @@ typedef const void *(*H5PL_get_plugin_info_t)(void); /* Special symbol to indicate no plugin loading */ #define H5PL_NO_PLUGIN "::" -/* Special symbol to indicate relative path from environment */ -/* Restrict usage of special char only for the default path H5_DEFAULT_PLUGINDIR - * or when using the environment variable HDF5_PLUGIN_PATH */ -#define H5PL_PLUGIN_ENV_RELEXEC_CHAR '@' - -/* Maximum size for path to executable */ -#ifndef MAX_EXEC_PATH -#define MAX_EXEC_PATH 2048 -#endif /******************/ /* Local Typedefs */ @@ -146,7 +137,6 @@ typedef struct H5PL_table_t { /* Local Prototypes */ /********************/ -static char *H5PL__env_strdup(const char *plpath); static herr_t H5PL__init_path_table(void); static htri_t H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info); static htri_t H5PL__open(H5PL_type_t pl_type, char *libname, int plugin_id, const void **pl_info); @@ -180,7 +170,6 @@ static H5PL_table_t *H5PL_table_g = NULL; static char *H5PL_path_table_g[H5PL_MAX_PATH_NUM]; static size_t H5PL_num_paths_g = 0; static hbool_t H5PL_path_found_g = FALSE; -static char *H5PL_executable_path_g = NULL; /* Enable all plugin libraries */ static unsigned int H5PL_plugin_g = H5PL_ALL_PLUGIN; @@ -201,14 +190,9 @@ DESCRIPTION herr_t H5PL__init_package(void) { - herr_t ret_value = SUCCEED; /* Return value */ - char *preload_path = NULL; - char *tempbuf = NULL; - char pathsep = '/'; - char *bs = NULL; - size_t ncopy = MAX_EXEC_PATH; + char *preload_path; - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_NOERR /* Retrieve pathnames from HDF5_PLUGIN_PRELOAD if the user sets it * to tell the library to load plugin libraries without search. @@ -218,37 +202,7 @@ H5PL__init_package(void) if(!HDstrcmp(preload_path, H5PL_NO_PLUGIN)) H5PL_plugin_g = 0; - /* Retrieve the executable path for use with H5PL_PLUGIN_ENV_RELEXEC_CHAR - * if the user uses it in a plugin path. - */ - if(NULL == (tempbuf = (char *)H5MM_malloc(MAX_EXEC_PATH))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for executable path") -#if defined(_WIN32) || defined(_WIN64) || defined(H5_HAVE_WIN32_API) - pathsep = (char)'\\'; - GetModuleFileName(NULL, tempbuf, MAX_EXEC_PATH); -#elif defined(__APPLE__) - pathsep = (char)'/'; - { - uint32_t size = sizeof(tempbuf); - _NSGetExecutablePath(tempbuf, &size); - } -#else - pathsep = (char)'/'; - { - ssize_t count = readlink("/proc/self/exe", tempbuf, MAX_EXEC_PATH); - tempbuf[count] = '\0'; - } -#endif - if ((bs = HDstrrchr(tempbuf, pathsep))) - ncopy = (size_t)(bs - tempbuf); - tempbuf[ncopy] = '\0'; - - H5PL_executable_path_g = H5MM_strdup(tempbuf); - if(tempbuf) - tempbuf = (char *)H5MM_xfree(tempbuf); - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5PL__init_package() */ @@ -301,10 +255,6 @@ H5PL_term_package(void) n++; } /* end if */ - /* Free the executable path */ - if(H5PL_executable_path_g) - H5PL_executable_path_g = (char *)H5MM_xfree(H5PL_executable_path_g); - /* Mark the interface as uninitialized */ if(0 == n) H5_PKG_INIT_VAR = FALSE; @@ -313,36 +263,6 @@ H5PL_term_package(void) FUNC_LEAVE_NOAPI(n) } /* end H5PL_term_package() */ -static char* -H5PL__env_strdup(const char *plpath) -{ - char *ret_value = NULL; - - FUNC_ENTER_NOAPI_NOINIT - - if(NULL == plpath) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, NULL, "no path provided") - if (*plpath == H5PL_PLUGIN_ENV_RELEXEC_CHAR) { - char *tempbuf; - size_t ExecPathLength = HDstrlen(H5PL_executable_path_g); - size_t PluginPathLength = HDstrlen(plpath); - - if(NULL == (tempbuf = (char *)H5MM_malloc(ExecPathLength + PluginPathLength))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, NULL, "can't allocate memory for plugin path") - - HDstrncpy(tempbuf, H5PL_executable_path_g, ExecPathLength); - HDstrncpy(tempbuf+ExecPathLength, plpath+1, PluginPathLength-1); - tempbuf[ExecPathLength + PluginPathLength] = '\0'; - ret_value = H5MM_strdup(tempbuf); - tempbuf = (char *)H5MM_xfree(tempbuf); - } - else - ret_value = H5MM_strdup(plpath); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5PL_env_strdup() */ - /*------------------------------------------------------------------------- * Function: H5PLset_loading_state -- cgit v0.12 From cb8e82a53d91067b16deba7ebc76307a336b0f02 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 25 Apr 2017 18:08:53 -0500 Subject: Incorporate patch from GE Healthcare (HDFFV-9934) This is the same patch that had already been integrated to 1.8 branch (pull request #387). Tested on moohan, ostrich, platypus, emu, osx1010test, quail, kituo, mayll. --- hl/src/H5DO.c | 81 ++++++++- hl/src/H5DOpublic.h | 6 + hl/test/test_dset_opt.c | 461 +++++++++++++++++++++++++++++++++++++++--------- src/H5D.c | 40 +++++ src/H5Dchunk.c | 282 ++++++++++++++++++++++++++--- src/H5Dio.c | 149 +++++++++++----- src/H5Dpkg.h | 3 + src/H5Dpublic.h | 6 + src/H5Pdxpl.c | 28 +++ 9 files changed, 898 insertions(+), 158 deletions(-) diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index 8db6768..22d40fc 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -32,7 +32,7 @@ * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu - * 30 July 2012 + * 30 July 2012 * *------------------------------------------------------------------------- */ @@ -60,7 +60,7 @@ H5DOwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *o /* If the user passed in a default DXPL, create one to pass to H5Dwrite() */ if(H5P_DEFAULT == dxpl_id) { - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) goto done; created_dxpl = TRUE; } /* end if */ @@ -87,16 +87,87 @@ done: if(H5Pclose(dxpl_id) < 0) ret_value = FAIL; } /* end if */ - else + else { /* Reset the direct write flag on user DXPL */ + do_direct_write = FALSE; if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &do_direct_write) < 0) ret_value = FAIL; + } return(ret_value); } /* end H5DOwrite_chunk() */ -/* +/*------------------------------------------------------------------------- + * Function: H5DOread_chunk + * + * Purpose: Reads an entire chunk from the file directly. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Matthew Strong (GE Healthcare) + * 14 February 2016 + * + *--------------------------------------------------------------------------- + */ +herr_t +H5DOread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters, + void *buf) +{ + hbool_t created_dxpl = FALSE; /* Whether we created a DXPL */ + hbool_t do_direct_read = TRUE; /* Flag for direct writes */ + herr_t ret_value = FAIL; /* Return value */ + + /* Check arguments */ + if(dset_id < 0) + goto done; + if(!buf) + goto done; + if(!offset) + goto done; + if(!filters) + goto done; + + /* If the user passed in a default DXPL, create one to pass to H5Dwrite() */ + if(H5P_DEFAULT == dxpl_id) { + if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto done; + created_dxpl = TRUE; + } /* end if */ + + /* Set direct write parameters */ + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, &do_direct_read) < 0) + goto done; + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, &offset) < 0) + goto done; + + /* Read chunk */ + if(H5Dread(dset_id, 0, H5S_ALL, H5S_ALL, dxpl_id, buf) < 0) + goto done; + /* Get the filter mask */ + if(H5Pget(dxpl_id, H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, filters) < 0) + goto done; + + /* Indicate success */ + ret_value = SUCCEED; + +done: + if(created_dxpl) { + if(H5Pclose(dxpl_id) < 0) + ret_value = FAIL; + } /* end if */ + else { + /* Reset the direct read flag on user DXPL */ + do_direct_read = FALSE; + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, &do_direct_read) < 0) + ret_value = FAIL; + } + + return(ret_value); +} /* end H5DOread_chunk() */ + + +/*------------------------------------------------------------------------- * Function: H5DOappend() * * Purpose: To append elements to a dataset. @@ -122,6 +193,8 @@ done: * ret_value = FAIL; * goto done; * } + * + *------------------------------------------------------------------------- */ herr_t H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, diff --git a/hl/src/H5DOpublic.h b/hl/src/H5DOpublic.h index ce0d32e..d5c8de4 100644 --- a/hl/src/H5DOpublic.h +++ b/hl/src/H5DOpublic.h @@ -28,6 +28,12 @@ extern "C" { H5_HLDLL herr_t H5DOwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, size_t data_size, const void *buf); +H5_HLDLL herr_t H5DOread_chunk(hid_t dset_id, /*in*/ + hid_t dxpl_id, /*in*/ + const hsize_t *offset, /*in*/ + uint32_t *filters, /*out*/ + void *buf); /*out*/ + H5_HLDLL herr_t H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t memtype, const void *buf); diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index 03c467a..d3a6b5c 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -76,11 +76,10 @@ const H5Z_class2_t H5Z_BOGUS2[1] = {{ /*------------------------------------------------------------------------- * Function: test_direct_chunk_write * - * Purpose: Test the basic functionality of H5DOwrite_chunk + * Purpose: Test the basic functionality of H5DOwrite_chunk/H5DOread_chunk * * Return: Success: 0 - * - * Failure: 1 + * Failure: 1 * * Programmer: Raymond Lu * 30 November 2012 @@ -103,24 +102,31 @@ test_direct_chunk_write (hid_t file) int i, j, n; unsigned filter_mask = 0; + unsigned read_filter_mask = 0; int direct_buf[CHUNK_NX][CHUNK_NY]; int check_chunk[CHUNK_NX][CHUNK_NY]; hsize_t offset[2] = {0, 0}; size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); const Bytef *z_src = (const Bytef*)(direct_buf); - Bytef *z_dst; /*destination buffer */ + Bytef *z_dst; /*destination buffer */ uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); uLong z_src_nbytes = (uLong)buf_size; - int aggression = 9; /* Compression aggression setting */ - void *outbuf = NULL; /* Pointer to new buffer */ + int aggression = 9; /* Compression aggression setting */ + void *outbuf = NULL; /* Pointer to new buffer */ + + /* For H5DOread_chunk() */ + void *readbuf = NULL; /* Buffer for reading data */ + const Bytef *pt_readbuf; /* Point to the buffer for data read */ + hsize_t read_chunk_nbytes; /* Size of chunk on disk */ + int read_dst_buf[CHUNK_NX][CHUNK_NY]; /* Buffer to hold un-compressed data */ hsize_t start[2]; /* Start of hyperslab */ hsize_t stride[2]; /* Stride of hyperslab */ hsize_t count[2]; /* Block count */ hsize_t block[2]; /* Block sizes */ - TESTING("basic functionality of H5DOwrite_chunk"); + TESTING("basic functionality of H5DOwrite_chunk/H5DOread_chunk"); /* * Create the data space with unlimited dimensions. @@ -151,26 +157,76 @@ test_direct_chunk_write (hid_t file) cparms, H5P_DEFAULT)) < 0) goto error; - /* Initialize the dataset */ - for(i = n = 0; i < NX; i++) - for(j = 0; j < NY; j++) - data[i][j] = n++; - if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; + HDmemset(data, 0, sizeof(data)); + /* Initialize data for the first chunk */ + for(i = n = 0; i < CHUNK_NX; i++) + for(j = 0; j < CHUNK_NY; j++) + data[i][j] = n++; + /* - * Write the data for the dataset. It should stay in the chunk cache. - * It will be evicted from the cache by the H5DOwrite_chunk calls. - */ + * Write the data for the dataset. */ if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, data)) < 0) goto error; + if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) + goto error; + + if(H5Dclose(dataset) < 0) + goto error; + + if((dataset = H5Dopen2(file, DATASETNAME1, H5P_DEFAULT)) < 0) + goto error; + + offset[0] = offset[1] = 0; + + /* Get the size of the compressed chunk */ + ret = H5Dget_chunk_storage_size(dataset, offset, &read_chunk_nbytes); + + readbuf = HDmalloc(read_chunk_nbytes); + pt_readbuf = (const Bytef *)readbuf; + + /* Test to use H5DOread_chunk() to read the chunk back */ + if((status = H5DOread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, readbuf)) < 0) + goto error; + + /* uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) */ + ret = uncompress((Bytef *)read_dst_buf, (uLongf *)&buf_size, pt_readbuf, (uLong)read_chunk_nbytes); + + /* Check for various zlib errors */ + if(Z_BUF_ERROR == ret) { + HDfprintf(stderr, "error: not enough room in output buffer"); + goto error; + } else if(Z_MEM_ERROR == ret) { + HDfprintf(stderr, "error: not enough memory"); + goto error; + } else if(Z_OK != ret) { + HDfprintf(stderr, "error: corrupted input data"); + goto error; + } + + /* Check that the values read are the same as the values written */ + for(i = 0; i < CHUNK_NX; i++) { + for(j = 0; j < CHUNK_NY; j++) { + if(data[i][j] != read_dst_buf[i][j]) { + printf(" 1. Read different values than written."); + printf(" At index %d,%d\n", i, j); + printf(" data=%d, read_dst_buf=%d\n", data[i][j], read_dst_buf[i][j]); + goto error; + } + } + } + + if(readbuf) + HDfree(readbuf); + /* Initialize data for one chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) - direct_buf[i][j] = n++; + direct_buf[i][j] = n++; /* Allocate output (compressed) buffer */ outbuf = HDmalloc(z_dst_nbytes); @@ -181,18 +237,18 @@ test_direct_chunk_write (hid_t file) /* Check for various zlib errors */ if(Z_BUF_ERROR == ret) { - fprintf(stderr, "overflow"); + HDfprintf(stderr, "overflow"); goto error; } else if(Z_MEM_ERROR == ret) { - fprintf(stderr, "deflate memory error"); + HDfprintf(stderr, "deflate memory error"); goto error; } else if(Z_OK != ret) { - fprintf(stderr, "other deflate error"); + HDfprintf(stderr, "other deflate error"); goto error; } - /* Write the compressed chunk data repeatedly to cover all the chunks in the - * dataset, using the direct writing function. */ + /* Write the compressed chunk data repeatedly to cover all the chunks in the + * dataset, using the direct writing function. */ for(i=0; ishared->layout.type) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") + + /* Call private function */ + if(H5D__get_chunk_storage_size(dset, H5P_DATASET_XFER_DEFAULT, offset, chunk_nbytes) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get storage size of chunk") + +done: + FUNC_LEAVE_API(ret_value); +} diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index ce684a0..4905a70 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -303,6 +303,9 @@ static herr_t H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, H5D_chunk_coll_info_t *chunk_info, size_t chunk_size, const void *fill_buf); #endif /* H5_HAVE_PARALLEL */ +static int +H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata); + /*********************/ /* Package Variables */ /*********************/ @@ -369,8 +372,7 @@ H5FL_EXTERN(H5S_sel_iter_t); /*------------------------------------------------------------------------- * Function: H5D__chunk_direct_write * - * Purpose: Internal routine to write a chunk - * directly into the file. + * Purpose: Internal routine to write a chunk directly into the file. * * Return: Non-negative on success/Negative on failure * @@ -408,7 +410,7 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, /* Allocate dataspace and initialize it if it hasn't been. */ if(!(*layout->ops->is_space_alloc)(&layout->storage)) { - /* Allocate storage */ + /* Allocate storage */ if(H5D__alloc_storage(&io_info, H5D_ALLOC_WRITE, FALSE, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage") } @@ -465,7 +467,7 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") if(H5D__chunk_cache_evict(dset, io_info.md_dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], FALSE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") + HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") } /* end if */ /* Write the data to the file */ @@ -491,6 +493,244 @@ done: /*------------------------------------------------------------------------- + * Function: H5D__chunk_direct_read + * + * Purpose: Internal routine to read a chunk directly from the file. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Matthew Strong (GE Healthcare) + * 14 February 2016 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, + uint32_t* filters, void *buf) +{ + const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* raw data chunk cache */ + H5D_chunk_ud_t udata; /* User data for querying chunk info */ + hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ + H5D_io_info_t io_info; /* to hold the dset and two dxpls (meta and raw data) */ + H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ + H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ + hbool_t md_dxpl_generated = FALSE; /* bool to indicate whether we should free the md_dxpl_id at exit */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_TAG(dxpl_id, dset->oloc.addr, FAIL) + + /* Check args */ + HDassert(dset && H5D_CHUNKED == layout->type); + HDassert(offset); + HDassert(filters); + HDassert(buf); + + io_info.dset = dset; + io_info.raw_dxpl_id = dxpl_id; + io_info.md_dxpl_id = dxpl_id; + + /* set the dxpl IO type for sanity checking at the FD layer */ +#ifdef H5_DEBUG_BUILD + if(H5D_set_io_info_dxpls(&io_info, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't set metadata and raw data dxpls") + md_dxpl_generated = TRUE; +#endif /* H5_DEBUG_BUILD */ + + /* Allocate dataspace and initialize it if it hasn't been. */ + if(!(*layout->ops->is_space_alloc)(&layout->storage)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "storage is not initialized") + + /* Calculate the index of this chunk */ + H5VM_chunk_scaled(dset->shared->ndims, offset, layout->u.chunk.dim, scaled); + scaled[dset->shared->ndims] = 0; + + /* Reset fields about the chunk we are looking for */ + udata.filter_mask = 0; + udata.chunk_block.offset = HADDR_UNDEF; + udata.chunk_block.length = 0; + udata.idx_hint = UINT_MAX; + + /* Find out the file address of the chunk */ + if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") + + /* Sanity check */ + HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || + (!H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); + + /* Check if the requested chunk exists in the chunk cache */ + if(UINT_MAX != udata.idx_hint) { + H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; + + /* Sanity checks */ + HDassert(udata.idx_hint < rdcc->nslots); + HDassert(rdcc->slot[udata.idx_hint]); + + /* If the cached chunk is dirty, it must be flushed to get accurate size */ + if( ent->dirty == TRUE ) { + + /* Fill the DXPL cache values for later use */ + if(H5D__get_dxpl_cache(io_info.raw_dxpl_id, &dxpl_cache) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") + + /* Flush the chunk to disk and clear the cache entry */ + if(H5D__chunk_cache_evict(dset, io_info.md_dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") + + /* Reset fields about the chunk we are looking for */ + udata.filter_mask = 0; + udata.chunk_block.offset = HADDR_UNDEF; + udata.chunk_block.length = 0; + udata.idx_hint = UINT_MAX; + + /* Get the new file address / chunk size after flushing */ + if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") + } + } + + /* Make sure the address of the chunk is returned. */ + if(!H5F_addr_defined(udata.chunk_block.offset)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunk address isn't defined") + + /* Read the chunk data into the supplied buffer */ + if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, udata.chunk_block.length, io_info.raw_dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") + + /* Return the filter mask */ + *filters = udata.filter_mask; + +done: +#ifdef H5_DEBUG_BUILD + if(md_dxpl_generated && H5I_dec_ref(io_info.md_dxpl_id) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't close metadata dxpl") +#endif /* H5_DEBUG_BUILD */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__chunk_direct_read() */ + + +/*------------------------------------------------------------------------- + * Function: H5D__get_chunk_storage_size + * + * Purpose: Internal routine to read the storage size of a chunk on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Matthew Strong (GE Healthcare) + * 20 October 2016 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, hsize_t *storage_size) +{ + const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* raw data chunk cache */ + hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ + H5D_io_info_t io_info; /* to hold the dset and two dxpls (meta and raw data) */ + H5D_chunk_ud_t udata; /* User data for querying chunk info */ + H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ + H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ + hbool_t md_dxpl_generated = FALSE; /* bool to indicate whether we should free the md_dxpl_id at exit */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_TAG(dxpl_id, dset->oloc.addr, FAIL) + + /* Check args */ + HDassert(dset && H5D_CHUNKED == layout->type); + HDassert(offset); + HDassert(storage_size); + + io_info.dset = dset; + io_info.raw_dxpl_id = dxpl_id; + io_info.md_dxpl_id = dxpl_id; + + /* set the dxpl IO type for sanity checking at the FD layer */ +#ifdef H5_DEBUG_BUILD + if(H5D_set_io_info_dxpls(&io_info, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't set metadata and raw data dxpls") + md_dxpl_generated = TRUE; +#endif /* H5_DEBUG_BUILD */ + + /* Allocate dataspace and initialize it if it hasn't been. */ + if(!(*layout->ops->is_space_alloc)(&layout->storage)) { + *storage_size = 0; + HGOTO_DONE(SUCCEED) + } + + /* Calculate the index of this chunk */ + H5VM_chunk_scaled(dset->shared->ndims, offset, layout->u.chunk.dim, scaled); + scaled[dset->shared->ndims] = 0; + + /* Reset fields about the chunk we are looking for */ + udata.chunk_block.offset = HADDR_UNDEF; + udata.chunk_block.length = 0; + udata.idx_hint = UINT_MAX; + + /* Find out the file address of the chunk */ + if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") + + /* Sanity check */ + HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || + (!H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); + + /* The requested chunk is not in cache or on disk */ + if(!H5F_addr_defined(udata.chunk_block.offset) && UINT_MAX == udata.idx_hint) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunk storage is not allocated") + + /* Check if there are filters registered to the dataset */ + if( dset->shared->dcpl_cache.pline.nused > 0 ) { + /* Check if the requested chunk exists in the chunk cache */ + if(UINT_MAX != udata.idx_hint) { + /* Sanity checks */ + HDassert(udata.idx_hint < rdcc->nslots); + HDassert(rdcc->slot[udata.idx_hint]); + H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; + + /* If the cached chunk is dirty, it must be flushed to get accurate size */ + if( ent->dirty == TRUE ) { + /* Fill the DXPL cache values for later use */ + if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") + + /* Flush the chunk to disk and clear the cache entry */ + if(H5D__chunk_cache_evict(dset, io_info.md_dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") + + /* Reset fields about the chunk we are looking for */ + udata.chunk_block.offset = HADDR_UNDEF; + udata.chunk_block.length = 0; + udata.idx_hint = UINT_MAX; + + /* Get the new file address / chunk size after flushing */ + if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") + } + } + + /* Make sure the address of the chunk is returned. */ + if(!H5F_addr_defined(udata.chunk_block.offset)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunk address isn't defined") + + /* Return the chunk size on disk */ + *storage_size = udata.chunk_block.length; + } + /* There are no filters registered, return the chunk size from the storage layout */ + else + *storage_size = dset->shared->layout.u.chunk.size; + +done: +#ifdef H5_DEBUG_BUILD + if(md_dxpl_generated && H5I_dec_ref(io_info.md_dxpl_id) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't close metadata dxpl") +#endif /* H5_DEBUG_BUILD */ + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__get_chunk_storage_size */ + + +/*------------------------------------------------------------------------- * Function: H5D__chunk_set_info_real * * Purpose: Internal routine to set the information about chunks for a dataset @@ -519,22 +759,22 @@ H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, /* Compute the # of chunks in dataset dimensions */ for(u = 0, layout->nchunks = 1, layout->max_nchunks = 1; u < ndims; u++) { /* Round up to the next integer # of chunks, to accomodate partial chunks */ - layout->chunks[u] = ((curr_dims[u] + layout->dim[u]) - 1) / layout->dim[u]; + layout->chunks[u] = ((curr_dims[u] + layout->dim[u]) - 1) / layout->dim[u]; if(H5S_UNLIMITED == max_dims[u]) layout->max_chunks[u] = H5S_UNLIMITED; else layout->max_chunks[u] = ((max_dims[u] + layout->dim[u]) - 1) / layout->dim[u]; /* Accumulate the # of chunks */ - layout->nchunks *= layout->chunks[u]; - layout->max_nchunks *= layout->max_chunks[u]; + layout->nchunks *= layout->chunks[u]; + layout->max_nchunks *= layout->max_chunks[u]; } /* end for */ /* Get the "down" sizes for each dimension */ if(H5VM_array_down(ndims, layout->chunks, layout->down_chunks) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute 'down' chunk size value") if(H5VM_array_down(ndims, layout->max_chunks, layout->max_down_chunks) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute 'down' chunk size value") + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute 'down' chunk size value") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2383,14 +2623,14 @@ H5D__chunk_dest(H5D_t *dset, hid_t dxpl_id) /* Flush all the cached chunks */ for(ent = rdcc->head; ent; ent = next) { - next = ent->next; - if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) - nerrors++; + next = ent->next; + if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) + nerrors++; } /* end for */ /* Continue even if there are failures. */ if(nerrors) - HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") + HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") /* Release cache structures */ if(rdcc->slot) @@ -2997,27 +3237,27 @@ H5D__chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t HDassert(ent->idx < rdcc->nslots); if(flush) { - /* Flush */ - if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) - HDONE_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer") + /* Flush */ + if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) + HDONE_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer") } /* end if */ else { /* Don't flush, just free chunk */ - if(ent->chunk != NULL) - ent->chunk = (uint8_t *)H5D__chunk_mem_xfree(ent->chunk, + if(ent->chunk != NULL) + ent->chunk = (uint8_t *)H5D__chunk_mem_xfree(ent->chunk, ((ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS) ? NULL : &(dset->shared->dcpl_cache.pline))); } /* end else */ /* Unlink from list */ if(ent->prev) - ent->prev->next = ent->next; + ent->prev->next = ent->next; else - rdcc->head = ent->next; + rdcc->head = ent->next; if(ent->next) - ent->next->prev = ent->prev; + ent->next->prev = ent->prev; else - rdcc->tail = ent->prev; + rdcc->tail = ent->prev; ent->prev = ent->next = NULL; /* Unlink from temporary list */ diff --git a/src/H5Dio.c b/src/H5Dio.c index dfd3f17..572e6cf 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -125,9 +125,13 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf/*out*/) { H5D_t *dset = NULL; - const H5S_t *mem_space = NULL; - const H5S_t *file_space = NULL; - herr_t ret_value = SUCCEED; /* Return value */ + const H5S_t *mem_space = NULL; + const H5S_t *file_space = NULL; + H5P_genplist_t *plist; /* Property list pointer */ + hsize_t *direct_offset = NULL; + hbool_t direct_read = FALSE; + uint32_t direct_filters = 0; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "iiiiix", dset_id, mem_type_id, mem_space_id, file_space_id, @@ -135,28 +139,29 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, /* check arguments */ if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if(NULL == dset->oloc.file) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if(mem_space_id < 0 || file_space_id < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if(H5S_ALL != mem_space_id) { - if(NULL == (mem_space = (const H5S_t *)H5I_object_verify(mem_space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") + if(NULL == (mem_space = (const H5S_t *)H5I_object_verify(mem_space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") - /* Check for valid selection */ - if(H5S_SELECT_VALID(mem_space) != TRUE) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent") + /* Check for valid selection */ + if(H5S_SELECT_VALID(mem_space) != TRUE) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent") } /* end if */ + if(H5S_ALL != file_space_id) { - if(NULL == (file_space = (const H5S_t *)H5I_object_verify(file_space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") + if(NULL == (file_space = (const H5S_t *)H5I_object_verify(file_space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") - /* Check for valid selection */ - if(H5S_SELECT_VALID(file_space) != TRUE) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent") + /* Check for valid selection */ + if(H5S_SELECT_VALID(file_space) != TRUE) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent") } /* end if */ /* Get the default dataset transfer property list if the user didn't provide one */ @@ -166,9 +171,55 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") - /* read raw data */ - if(H5D__read(dset, mem_type_id, mem_space, file_space, plist_id, buf/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") + /* Get the dataset transfer property list */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") + + /* Retrieve the 'direct read' flag */ + if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, &direct_read) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting flag for direct chunk read") + + if(direct_read) { + unsigned u; + hsize_t dims[H5O_LAYOUT_NDIMS]; + hsize_t internal_offset[H5O_LAYOUT_NDIMS]; + + if(H5D_CHUNKED != dset->shared->layout.type) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") + + /* Get the direct chunk offset property */ + if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, &direct_offset) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting direct offset from xfer properties") + + /* The library's chunking code requires the offset terminates with a zero. So transfer the + * offset array to an internal offset array */ + for(u = 0; u < dset->shared->ndims; u++) { + /* Make sure the offset doesn't exceed the dataset's dimensions */ + if(direct_offset[u] > dset->shared->curr_dims[u]) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset exceeds dimensions of dataset") + + /* Make sure the offset fall right on a chunk's boundary */ + if(direct_offset[u] % dset->shared->layout.u.chunk.dim[u]) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset doesn't fall on chunks's boundary") + + internal_offset[u] = direct_offset[u]; + } /* end for */ + + /* Terminate the offset with a zero */ + internal_offset[dset->shared->ndims] = 0; + + /* Read the raw chunk */ + if(H5D__chunk_direct_read(dset, plist_id, internal_offset, &direct_filters, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read chunk directly") + /* Set the chunk filter mask property */ + if(H5P_set(plist, H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, &direct_filters) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error setting filter mask xfer property") + } + else { + /* read raw data */ + if(H5D__read(dset, mem_type_id, mem_space, file_space, plist_id, buf/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") + } done: FUNC_LEAVE_API(ret_value) @@ -245,28 +296,28 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, /* Check dataspace selections if this is not a direct write */ if(!direct_write) { if(mem_space_id < 0 || file_space_id < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") - - if(H5S_ALL != mem_space_id) { - if(NULL == (mem_space = (const H5S_t *)H5I_object_verify(mem_space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") - - /* Check for valid selection */ - if(H5S_SELECT_VALID(mem_space) != TRUE) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "memory selection+offset not within extent") - } /* end if */ - if(H5S_ALL != file_space_id) { - if(NULL == (file_space = (const H5S_t *)H5I_object_verify(file_space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") - - /* Check for valid selection */ - if(H5S_SELECT_VALID(file_space) != TRUE) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "file selection+offset not within extent") - } /* end if */ + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + + if(H5S_ALL != mem_space_id) { + if(NULL == (mem_space = (const H5S_t *)H5I_object_verify(mem_space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + + /* Check for valid selection */ + if(H5S_SELECT_VALID(mem_space) != TRUE) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "memory selection+offset not within extent") + } /* end if */ + if(H5S_ALL != file_space_id) { + if(NULL == (file_space = (const H5S_t *)H5I_object_verify(file_space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + + /* Check for valid selection */ + if(H5S_SELECT_VALID(file_space) != TRUE) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "file selection+offset not within extent") + } /* end if */ } if(H5D__pre_write(dset, direct_write, mem_type_id, mem_space, file_space, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't prepare for writing data") + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't prepare for writing data") done: FUNC_LEAVE_API(ret_value) @@ -300,15 +351,15 @@ H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, uint32_t direct_filters; hsize_t *direct_offset; uint32_t direct_datasize; - hsize_t internal_offset[H5O_LAYOUT_NDIMS]; - unsigned u; /* Local index variable */ + hsize_t internal_offset[H5O_LAYOUT_NDIMS]; + unsigned u; /* Local index variable */ /* Get the dataset transfer property list */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") if(H5D_CHUNKED != dset->shared->layout.type) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") /* Retrieve parameters for direct chunk write */ if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &direct_filters) < 0) @@ -318,19 +369,19 @@ H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &direct_datasize) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting data size for direct chunk write") - /* The library's chunking code requires the offset terminates with a zero. So transfer the + /* The library's chunking code requires the offset terminates with a zero. So transfer the * offset array to an internal offset array */ - for(u = 0; u < dset->shared->ndims; u++) { - /* Make sure the offset doesn't exceed the dataset's dimensions */ + for(u = 0; u < dset->shared->ndims; u++) { + /* Make sure the offset doesn't exceed the dataset's dimensions */ if(direct_offset[u] > dset->shared->curr_dims[u]) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset exceeds dimensions of dataset") + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset exceeds dimensions of dataset") /* Make sure the offset fall right on a chunk's boundary */ - if(direct_offset[u] % dset->shared->layout.u.chunk.dim[u]) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset doesn't fall on chunks's boundary") + if(direct_offset[u] % dset->shared->layout.u.chunk.dim[u]) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset doesn't fall on chunks's boundary") - internal_offset[u] = direct_offset[u]; - } /* end for */ + internal_offset[u] = direct_offset[u]; + } /* end for */ /* Terminate the offset with a zero */ internal_offset[dset->shared->ndims] = 0; @@ -342,7 +393,7 @@ H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, else { /* Normal write */ /* write raw data */ if(H5D__write(dset, mem_type_id, mem_space, file_space, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") } /* end else */ done: diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 8a4711f..b123b81 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -578,6 +578,7 @@ H5_DLL herr_t H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, H5_DLL herr_t H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]); H5_DLL herr_t H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size); +H5_DLL herr_t H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, hsize_t *storage_size); H5_DLL haddr_t H5D__get_offset(const H5D_t *dset); H5_DLL void *H5D__vlen_get_buf_size_alloc(size_t size, void *info); H5_DLL herr_t H5D__vlen_get_buf_size(void *elem, hid_t type_id, unsigned ndim, @@ -685,6 +686,8 @@ H5_DLL herr_t H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *store); H5_DLL herr_t H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsize_t *offset, uint32_t data_size, const void *buf); +H5_DLL herr_t H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, + uint32_t *filters, void *buf); #ifdef H5D_CHUNK_DEBUG H5_DLL herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers); #endif /* H5D_CHUNK_DEBUG */ diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index fe408b2..baa844a 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -40,6 +40,11 @@ #define H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME "direct_chunk_filters" #define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME "direct_chunk_offset" #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME "direct_chunk_datasize" + +/* Property names for H5LTDdirect_chunk_read */ +#define H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME "direct_chunk_read_flag" +#define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME "direct_chunk_read_offset" +#define H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME "direct_chunk_read_filters" /*******************/ /* Public Typedefs */ @@ -146,6 +151,7 @@ H5_DLL hid_t H5Dget_type(hid_t dset_id); H5_DLL hid_t H5Dget_create_plist(hid_t dset_id); H5_DLL hid_t H5Dget_access_plist(hid_t dset_id); H5_DLL hsize_t H5Dget_storage_size(hid_t dset_id); +H5_DLL herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_bytes); H5_DLL haddr_t H5Dget_offset(hid_t dset_id); H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf/*out*/); diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index fdb402f..3c53c15 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -169,6 +169,13 @@ #define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_DEF NULL #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_SIZE sizeof(uint32_t) #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF 0 +/* Definitions for properties of direct chunk read */ +#define H5D_XFER_DIRECT_CHUNK_READ_FLAG_SIZE sizeof(hbool_t) +#define H5D_XFER_DIRECT_CHUNK_READ_FLAG_DEF FALSE +#define H5D_XFER_DIRECT_CHUNK_READ_FILTERS_SIZE sizeof(uint32_t) +#define H5D_XFER_DIRECT_CHUNK_READ_FILTERS_DEF 0 +#define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_SIZE sizeof(hsize_t *) +#define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_DEF NULL /* Ring type - private property */ #define H5AC_XFER_RING_SIZE sizeof(unsigned) #define H5AC_XFER_RING_DEF H5AC_RING_USER @@ -293,6 +300,9 @@ static const hbool_t H5D_def_direct_chunk_flag_g = H5D_XFER_DIRECT_CHUNK_WRITE_F static const uint32_t H5D_def_direct_chunk_filters_g = H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_DEF; /* Default value for the filters of direct chunk write */ static const hsize_t *H5D_def_direct_chunk_offset_g = H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_DEF; /* Default value for the offset of direct chunk write */ static const uint32_t H5D_def_direct_chunk_datasize_g = H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF; /* Default value for the datasize of direct chunk write */ +static const hbool_t direct_chunk_read_flag = H5D_XFER_DIRECT_CHUNK_READ_FLAG_DEF; /* Default value for the flag of direct chunk read */ +static const hsize_t *direct_chunk_read_offset = H5D_XFER_DIRECT_CHUNK_READ_OFFSET_DEF; /* Default value for the offset of direct chunk read */ +static const uint32_t direct_chunk_read_filters = H5D_XFER_DIRECT_CHUNK_READ_FILTERS_DEF; /* Default value for the filters of direct chunk read */ static const H5AC_ring_t H5D_ring_g = H5AC_XFER_RING_DEF; /* Default value for the cache entry ring type */ #ifdef H5_DEBUG_BUILD static const H5FD_dxpl_type_t H5D_dxpl_type_g = H5FD_NOIO_DXPL; /* Default value for the dxpl type */ @@ -497,6 +507,24 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register the property of flag for direct chunk read */ + /* (Note: this property should not have an encode/decode callback) */ + if(H5P_register_real(pclass, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, H5D_XFER_DIRECT_CHUNK_READ_FLAG_SIZE, &direct_chunk_read_flag, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the property of filter for direct chunk read */ + /* (Note: this property should not have an encode/decode callback) */ + if(H5P_register_real(pclass, H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, H5D_XFER_DIRECT_CHUNK_READ_FILTERS_SIZE, &direct_chunk_read_filters, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the property of offset for direct chunk read */ + /* (Note: this property should not have an encode/decode callback) */ + if(H5P_register_real(pclass, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_SIZE, &direct_chunk_read_offset, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register the ring property (private) */ if(H5P_register_real(pclass, H5AC_RING_NAME, H5AC_XFER_RING_SIZE, &H5D_ring_g, NULL, NULL, NULL, H5AC_XFER_RING_ENC, H5AC_XFER_RING_DEC, -- cgit v0.12 From bacb45b38ae8513024baf2dfe08c8918625489e2 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 26 Apr 2017 14:00:34 -0500 Subject: Modifications based on pull request review. Made couple changes based on the review comments. --- hl/src/H5DO.c | 4 ++-- src/H5D.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index 22d40fc..99cf2f7 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -94,7 +94,7 @@ done: ret_value = FAIL; } - return(ret_value); + return ret_value; } /* end H5DOwrite_chunk() */ @@ -163,7 +163,7 @@ done: ret_value = FAIL; } - return(ret_value); + return ret_value; } /* end H5DOread_chunk() */ diff --git a/src/H5D.c b/src/H5D.c index a6de952..fc2024a 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -1126,4 +1126,4 @@ H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_n done: FUNC_LEAVE_API(ret_value); -} +} /* H5Dget_chunk_storage_size() */ -- cgit v0.12 From a302f508a51ba9fe109aaacda24601d5c458fe8d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 27 Apr 2017 08:52:34 -0500 Subject: Change position of declaration to top of block --- src/H5Dchunk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 4905a70..2523c5d 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -684,10 +684,11 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h if( dset->shared->dcpl_cache.pline.nused > 0 ) { /* Check if the requested chunk exists in the chunk cache */ if(UINT_MAX != udata.idx_hint) { + H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; + /* Sanity checks */ HDassert(udata.idx_hint < rdcc->nslots); HDassert(rdcc->slot[udata.idx_hint]); - H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; /* If the cached chunk is dirty, it must be flushed to get accurate size */ if( ent->dirty == TRUE ) { -- cgit v0.12 From 80d57c242a15edd983673e9bad4e966c72975289 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 27 Apr 2017 15:18:18 -0400 Subject: Set the HDF5_GENERATE_HEADERS CMake option to default to ON and removed the option from the CMake cache init files. Fixes HDFFV-10184 --- config/cmake/cacheinit.cmake | 2 -- config/cmake/mccacheinit.cmake | 2 -- release_docs/INSTALL_CMake.txt | 3 +-- src/CMakeLists.txt | 2 +- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index c923283..6a66c8a 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -17,8 +17,6 @@ set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) -set (HDF5_GENERATE_HEADERS ON CACHE BOOL "Rebuild Generated Files" FORCE) - set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 1f60a01..3f0dd4f 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -17,8 +17,6 @@ set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) -set (HDF5_GENERATE_HEADERS ON CACHE BOOL "Rebuild Generated Files" FORCE) - set (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE) set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 4c4460e..7cb0225 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -396,7 +396,6 @@ These five steps are described in detail below. # EXTERNAL cache entries ######################## set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) - set (HDF5_GENERATE_HEADERS ON CACHE BOOL "Rebuild Generated Files" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) @@ -592,7 +591,7 @@ HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF HDF5_ENABLE_TRACE "Enable API tracing capability" OFF HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF -HDF5_GENERATE_HEADERS "Rebuild Generated Files" OFF +HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON HDF5_JAVA_PACK_JRE "Package a JRE installer directory" OFF HDF5_MEMORY_ALLOC_SANITY_CHECK "Indicate that internal memory allocation sanity checks are enabled" OFF HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e2acd30..178c954 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -816,7 +816,7 @@ set (H5_GENERATED_HEADERS ${HDF5_SRC_DIR}/H5overflow.h ) -option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" OFF) +option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON) if (HDF5_GENERATE_HEADERS) set_source_files_properties(${H5_GENERATED_HEADERS} PROPERTIES GENERATED TRUE) find_package (Perl) -- cgit v0.12 From 0bf41bec5aab468036f32afb287f224d266edf7a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 27 Apr 2017 16:32:38 -0500 Subject: Add extra files to be copied --- config/cmake/README.txt.cmake.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index 1d6ef45..ceeda49 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -35,6 +35,8 @@ To test the installation with the examples; Create a directory to run the examples. Copy HDF5Examples folder to this directory. Copy HDF5_Examples.cmake to this directory. + Copy HDF5_Examples_options.cmake to this directory. + Copy CTestScript.cmake to this directory. The default source folder is defined as "HDF5Examples". It can be changed with the CTEST_SOURCE_NAME script option. The default installation folder is defined as "@CMAKE_INSTALL_PREFIX@". @@ -44,7 +46,7 @@ To test the installation with the examples; be the same as the value used with the -C command line option. The default build configuration is defined to build and use static libraries. Shared libraries can be used with the STATICONLYLIBRARIES script option set to "NO". - Other options can be changed by editing the HDF5_Examples.cmake file. + Other options can be changed by editing the HDF5_Examples_options.cmake file. If the defaults are okay, execute from this directory: ctest -S HDF5_Examples.cmake -C Release -V -O test.log -- cgit v0.12 From d3b664b6a79508d78974a347a9d450e72defb76b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 28 Apr 2017 08:11:29 -0700 Subject: Changed the Windows POSIX open() file permissions to be correct according to MSDN. Partial fix for HDFFV-9630. --- src/H5Defl.c | 4 ++-- src/H5FDcore.c | 6 +++--- src/H5FDdirect.c | 2 +- src/H5FDlog.c | 2 +- src/H5FDsec2.c | 2 +- src/H5private.h | 18 ++++++++++++++++++ src/H5win32defs.h | 3 ++- test/big.c | 6 +++--- test/btree2.c | 8 ++++---- test/dsets.c | 4 ++-- test/external.c | 8 ++++---- test/file_image.c | 6 +++--- test/fillval.c | 2 +- test/h5test.c | 4 ++-- test/istore.c | 2 +- test/tfile.c | 12 ++++++------ test/twriteorder.c | 4 ++-- tools/src/h5jam/h5jam.c | 8 ++++---- 18 files changed, 60 insertions(+), 41 deletions(-) diff --git a/src/H5Defl.c b/src/H5Defl.c index 5536ba3..93bf2b2 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -288,7 +288,7 @@ H5D__efl_read(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t size HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed") if(H5_combine_path(dset->shared->extfile_prefix, efl->slot[u].name, &full_name) < 0) HGOTO_ERROR(H5E_EFL, H5E_NOSPACE, FAIL, "can't build external file name") - if((fd = HDopen(full_name, O_RDONLY, 0)) < 0) + if((fd = HDopen(full_name, O_RDONLY, H5_POSIX_OPEN_MODE_0000)) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file") if(HDlseek(fd, (HDoff_t)(efl->slot[u].offset + (HDoff_t)skip), SEEK_SET) < 0) HGOTO_ERROR(H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file") @@ -380,7 +380,7 @@ H5D__efl_write(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t siz HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed") if(H5_combine_path(dset->shared->extfile_prefix, efl->slot[u].name, &full_name) < 0) HGOTO_ERROR(H5E_EFL, H5E_NOSPACE, FAIL, "can't build external file name") - if((fd = HDopen(full_name, O_CREAT | O_RDWR, 0666)) < 0) { + if((fd = HDopen(full_name, O_CREAT | O_RDWR, H5_POSIX_OPEN_MODE_0666)) < 0) { if(HDaccess(full_name, F_OK) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "external raw data file does not exist") else diff --git a/src/H5FDcore.c b/src/H5FDcore.c index d100a8b..6c22f69 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -638,7 +638,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr ((file_image_info.buffer == NULL) && (file_image_info.size == 0))); HDmemset(&sb, 0, sizeof(sb)); if((file_image_info.buffer != NULL) && !(H5F_ACC_CREAT & flags)) { - if(HDopen(name, o_flags, 0666) >= 0) + if(HDopen(name, o_flags, H5_POSIX_OPEN_MODE_0666) >= 0) HGOTO_ERROR(H5E_FILE, H5E_FILEEXISTS, NULL, "file already exists") /* If backing store is requested, create and stat the file @@ -646,7 +646,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr * technically an open. */ if(fa->backing_store) { - if((fd = HDopen(name, o_flags | O_CREAT, 0666)) < 0) + if((fd = HDopen(name, o_flags | O_CREAT, H5_POSIX_OPEN_MODE_0666)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to create file") if(HDfstat(fd, &sb) < 0) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file") @@ -656,7 +656,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr * store is off is when the backing_store flag is off and H5F_ACC_CREAT is * on. */ else if(fa->backing_store || !(H5F_ACC_CREAT & flags)) { - if((fd = HDopen(name, o_flags, 0666)) < 0) + if((fd = HDopen(name, o_flags, H5_POSIX_OPEN_MODE_0666)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") if(HDfstat(fd, &sb) < 0) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file") diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 1487cda..79a5e8a 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -487,7 +487,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd o_flags |= O_DIRECT; /* Open the file */ - if ((fd=HDopen(name, o_flags, 0666))<0) + if ((fd=HDopen(name, o_flags, H5_POSIX_OPEN_MODE_0666))<0) HSYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") if (HDfstat(fd, &sb)<0) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 75333c2..6e5a57b 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -520,7 +520,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HDgettimeofday(&timeval_start, NULL); #endif /* H5_HAVE_GETTIMEOFDAY */ /* Open the file */ - if((fd = HDopen(name, o_flags, 0666)) < 0) { + if((fd = HDopen(name, o_flags, H5_POSIX_OPEN_MODE_0666)) < 0) { int myerrno = errno; HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file: name = '%s', errno = %d, error message = '%s', flags = %x, o_flags = %x", name, myerrno, HDstrerror(myerrno), flags, (unsigned)o_flags); diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 26913e2..71657b6 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -341,7 +341,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) o_flags |= O_EXCL; /* Open the file */ - if((fd = HDopen(name, o_flags, 0666)) < 0) { + if((fd = HDopen(name, o_flags, H5_POSIX_OPEN_MODE_0666)) < 0) { int myerrno = errno; HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file: name = '%s', errno = %d, error message = '%s', flags = %x, o_flags = %x", name, myerrno, HDstrerror(myerrno), flags, (unsigned)o_flags); } /* end if */ diff --git a/src/H5private.h b/src/H5private.h index c588154..fc15e99 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -495,6 +495,24 @@ # define H5_POSIX_MAX_IO_BYTES SSIZET_MAX #endif +/* POSIX I/O mode used as the fourth parameter to open/_open + * when creating a new file (O_CREAT is set). + * + * It's a little awkward to put the Unix file permissions + * in the symbol name, but that is what is most important + * and we only need the symbol to handle Windows' less-capable + * system. + */ +#if defined(H5_HAVE_WIN32_API) +# define H5_POSIX_OPEN_MODE_0666 (_S_IREAD | _S_IWRITE) +# define H5_POSIX_OPEN_MODE_0644 _S_IREAD +# define H5_POSIX_OPEN_MODE_0000 0 +#else +# define H5_POSIX_OPEN_MODE_0666 0666 +# define H5_POSIX_OPEN_MODE_0644 0644 +# define H5_POSIX_OPEN_MODE_0000 0000 +#endif + /* * A macro to portably increment enumerated types. */ diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 0149faa..771b6fc 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -48,7 +48,8 @@ typedef __int64 h5_stat_size_t; #define HDnanosleep(N, O) Wnanosleep(N, O) #define HDoff_t __int64 /* _O_BINARY must be set in Windows to avoid CR-LF <-> LF EOL - * transformations when performing I/O. + * transformations when performing I/O. Note that this will + * produce Unix-style text files, though. */ #define HDopen(S,F,M) _open(S,F|_O_BINARY,M) #define HDread(F,M,Z) _read(F,M,Z) diff --git a/test/big.c b/test/big.c index 3685821..274c00b 100644 --- a/test/big.c +++ b/test/big.c @@ -172,7 +172,7 @@ is_sparse(void) int fd; h5_stat_t sb; - if ((fd=HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) return 0; + if ((fd=HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_OPEN_MODE_0666)) < 0) return 0; if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0; if (5!=HDwrite(fd, "hello", (size_t)5)) return 0; if (HDclose(fd) < 0) return 0; @@ -210,7 +210,7 @@ supports_big(void) int fd = -1; fsizes_t fsize = NO_FILE; - if((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) + if((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_OPEN_MODE_0666)) < 0) goto error; /* Write a few byte at the beginning */ @@ -293,7 +293,7 @@ enough_room(hid_t fapl) /* Create files */ for (i=0; ifree_src == H5FD_FILE_IMAGE_OP_FILE_CLOSE, "Free callback came from wrong sourc in core close"); /* Create file image buffer */ - fd = HDopen(copied_filename, O_RDONLY, 0666); + fd = HDopen(copied_filename, O_RDONLY, H5_POSIX_OPEN_MODE_0666); VERIFY(fd > 0, "open failed"); ret = HDfstat(fd, &sb); VERIFY(ret == 0, "fstat failed"); @@ -814,7 +814,7 @@ test_get_file_image(const char * test_banner, HDsnprintf(member_file_name, 1024, file_name, i); /* open the test file using standard I/O calls */ - fd = HDopen(member_file_name, O_RDONLY, 0666); + fd = HDopen(member_file_name, O_RDONLY, H5_POSIX_OPEN_MODE_0666); VERIFY(fd >= 0, "HDopen() failed."); if(size_remaining >= FAMILY_SIZE ){ @@ -862,7 +862,7 @@ test_get_file_image(const char * test_banner, VERIFY(file_image_ptr != NULL, "HDmalloc(2) failed."); /* open the test file using standard I/O calls */ - fd = HDopen(file_name, O_RDONLY, 0666); + fd = HDopen(file_name, O_RDONLY, H5_POSIX_OPEN_MODE_0666); VERIFY(fd >= 0, "HDopen() failed."); if(user) { diff --git a/test/fillval.c b/test/fillval.c index ea13de0..8f1f53d 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -1890,7 +1890,7 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) hsize_t nelmts; nelmts = max_size[0]*max_size[1]*max_size[2]*max_size[3]*max_size[4]; - if((fd=HDopen(FILE_NAME_RAW, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0 || + if((fd=HDopen(FILE_NAME_RAW, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_OPEN_MODE_0666)) < 0 || HDclose(fd) < 0) goto error; if(H5Pset_external(dcpl, FILE_NAME_RAW, (off_t)0, (hsize_t)nelmts*sizeof(int)) < 0) goto error; diff --git a/test/h5test.c b/test/h5test.c index 2d77dc8..a5cd674 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1596,9 +1596,9 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) goto error; /* Copy old file into temporary file */ - if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0) + if((fd_old = HDopen(filename, O_RDONLY, H5_POSIX_OPEN_MODE_0666)) < 0) goto error; - if((fd_new = HDopen(local_copy_name, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) + if((fd_new = HDopen(local_copy_name, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_OPEN_MODE_0666)) < 0) goto error; /* Copy data */ diff --git a/test/istore.c b/test/istore.c index 8dc5efd..18cf1de 100644 --- a/test/istore.c +++ b/test/istore.c @@ -73,7 +73,7 @@ is_sparse(void) int fd; h5_stat_t sb; - if ((fd=HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) return 0; + if ((fd=HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_OPEN_MODE_0666)) < 0) return 0; if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0; if (5!=HDwrite(fd, "hello", (size_t)5)) return 0; if (HDclose(fd) < 0) return 0; diff --git a/test/tfile.c b/test/tfile.c index 7274c82..2d26874 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1611,7 +1611,7 @@ test_file_ishdf5(void) /* Create non-HDF5 file and check it */ - fd=HDopen(FILE1, O_RDWR|O_CREAT|O_TRUNC, 0666); + fd=HDopen(FILE1, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_OPEN_MODE_0666); CHECK(fd, FAIL, "HDopen"); /* Initialize information to write */ @@ -2657,7 +2657,7 @@ cal_chksum(const char *file, uint32_t *chksum) herr_t ret; /* Generic return value */ /* Open the file */ - fdes = HDopen(file, O_RDONLY, 0); + fdes = HDopen(file, O_RDONLY, H5_POSIX_OPEN_MODE_0000); CHECK(fdes, FAIL, "HDopen"); /* Retrieve the file's size */ @@ -2720,7 +2720,7 @@ test_rw_noupdate(void) /* Calculate checksum for the file */ ret = cal_chksum(FILE1, &chksum1); - CHECK(ret, FAIL, "HDopen"); + CHECK(ret, FAIL, "cal_chksum"); /* Open and close File With Read/Write Permission */ fid = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); @@ -2732,7 +2732,7 @@ test_rw_noupdate(void) /* Calculate checksum for the file */ ret = cal_chksum(FILE1, &chksum2); - CHECK(ret, FAIL, "HDopen"); + CHECK(ret, FAIL, "cal_chksum"); /* The two checksums are the same, i.e. the file is not changed */ VERIFY(chksum1, chksum2, "Checksum"); @@ -4340,9 +4340,9 @@ test_filespace_compatible(void) const char *filename = H5_get_srcdir_filename(OLD_FILENAME[j]); /* Corrected test file name */ /* Open and copy the test file into a temporary file */ - fd_old = HDopen(filename, O_RDONLY, 0666); + fd_old = HDopen(filename, O_RDONLY, H5_POSIX_OPEN_MODE_0666); CHECK(fd_old, FAIL, "HDopen"); - fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, 0666); + fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_OPEN_MODE_0666); CHECK(fd_new, FAIL, "HDopen"); /* Copy data */ diff --git a/test/twriteorder.c b/test/twriteorder.c index 0e1d0d4..3ecd3e0 100644 --- a/test/twriteorder.c +++ b/test/twriteorder.c @@ -231,7 +231,7 @@ int create_wo_file(void) int ret_code; /* Create the data file */ - if ((write_fd_g = HDopen(DATAFILE, O_RDWR|O_TRUNC|O_CREAT, 0664)) < 0) { + if ((write_fd_g = HDopen(DATAFILE, O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_OPEN_MODE_0666)) < 0) { printf("WRITER: error from open\n"); return -1; } @@ -297,7 +297,7 @@ int read_wo_file(void) char buffer[BLOCKSIZE_DFT]; /* Open the data file */ - if ((read_fd = HDopen(DATAFILE, O_RDONLY, 0)) < 0) { + if ((read_fd = HDopen(DATAFILE, O_RDONLY, H5_POSIX_OPEN_MODE_0000)) < 0) { printf("READER: error from open\n"); return -1; } diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index 61de604..f41f8dc 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -292,7 +292,7 @@ main (int argc, const char *argv[]) H5Pclose(plist); H5Fclose(ifile); - ufid = HDopen(ub_file, O_RDONLY, 0); + ufid = HDopen(ub_file, O_RDONLY, H5_POSIX_OPEN_MODE_0000); if(ufid < 0) { error_msg("unable to open user block file \"%s\"\n", ub_file); leave (EXIT_FAILURE); @@ -307,7 +307,7 @@ main (int argc, const char *argv[]) fsize = (off_t)sbuf.st_size; - h5fid = HDopen(input_file, O_RDONLY, 0); + h5fid = HDopen(input_file, O_RDONLY, H5_POSIX_OPEN_MODE_0000); if(h5fid < 0) { error_msg("unable to open HDF5 file for read \"%s\"\n", input_file); HDclose (ufid); @@ -325,7 +325,7 @@ main (int argc, const char *argv[]) h5fsize = (hsize_t)sbuf2.st_size; if (output_file == NULL) { - ofid = HDopen (input_file, O_WRONLY, 0); + ofid = HDopen (input_file, O_WRONLY, H5_POSIX_OPEN_MODE_0000); if (ofid < 0) { error_msg("unable to open output file \"%s\"\n", output_file); @@ -335,7 +335,7 @@ main (int argc, const char *argv[]) } } else { - ofid = HDopen (output_file, O_WRONLY | O_CREAT | O_TRUNC, 0644); + ofid = HDopen (output_file, O_WRONLY | O_CREAT | O_TRUNC, H5_POSIX_OPEN_MODE_0644); if (ofid < 0) { error_msg("unable to create output file \"%s\"\n", output_file); -- cgit v0.12 From be49a9422654ac9eec07ffe3599b4a7f7561cdb6 Mon Sep 17 00:00:00 2001 From: lrknox Date: Fri, 28 Apr 2017 16:37:22 -0500 Subject: Comment out install-exec-hooks to remove libdynlib* files. Allen did the same for hdf5_1_10 and hdf5_1_10_1 because the hooks don't reliably work. In the develop branch they are causing make install failures because the autotools' install commands sometimes attempt to chmod these files when they no longer exist. --- test/Makefile.am | 4 ++-- tools/test/h5diff/Makefile.am | 4 ++-- tools/test/h5dump/Makefile.am | 4 ++-- tools/test/h5ls/Makefile.am | 4 ++-- tools/test/h5repack/Makefile.am | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index b274302..20b63f6 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -126,8 +126,8 @@ libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_li libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) -install-exec-hook: - $(RM) $(DESTDIR)$(dyndir)/*dynlib* +#install-exec-hook: +# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c diff --git a/tools/test/h5diff/Makefile.am b/tools/test/h5diff/Makefile.am index 922dddc..5721aaa 100644 --- a/tools/test/h5diff/Makefile.am +++ b/tools/test/h5diff/Makefile.am @@ -57,8 +57,8 @@ if HAVE_SHARED_CONDITIONAL libdynlibdiff.la: $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_DEPENDENCIES) $(EXTRA_libdynlibdiff_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibdiff_la_LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD) -install-exec-hook: - $(RM) $(DESTDIR)$(dyndir)/*dynlib* +#install-exec-hook: +# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif # Temporary files. *.h5 are generated by h5diff. They should diff --git a/tools/test/h5dump/Makefile.am b/tools/test/h5dump/Makefile.am index 64d2d7c..df97396 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -46,8 +46,8 @@ if HAVE_SHARED_CONDITIONAL libdynlibdump.la: $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_DEPENDENCIES) $(EXTRA_libdynlibdump_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibdump_la_LINK) $(am_libdynlibdump_la_rpath) $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_LIBADD) -install-exec-hook: - $(RM) $(DESTDIR)$(dyndir)/*dynlib* +#install-exec-hook: +# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif # Temporary files. *.h5 are generated by h5dumpgentest. They should diff --git a/tools/test/h5ls/Makefile.am b/tools/test/h5ls/Makefile.am index 9773ee5..8ace14d 100644 --- a/tools/test/h5ls/Makefile.am +++ b/tools/test/h5ls/Makefile.am @@ -43,8 +43,8 @@ if HAVE_SHARED_CONDITIONAL libdynlibls.la: $(libdynlibls_la_OBJECTS) $(libdynlibls_la_DEPENDENCIES) $(EXTRA_libdynlibls_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibls_la_LINK) $(am_libdynlibls_la_rpath) $(libdynlibls_la_OBJECTS) $(libdynlibls_la_LIBADD) -install-exec-hook: - $(RM) $(DESTDIR)$(dyndir)/*dynlib* +#install-exec-hook: +# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index b3cfc88..da2a3c3 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -56,8 +56,8 @@ libdynlibadd.la: $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_DEPENDENCIES) $(EX libdynlibvers.la: $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_DEPENDENCIES) $(EXTRA_libdynlibvers_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibvers_la_LINK) $(am_libdynlibvers_la_rpath) $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_LIBADD) -install-exec-hook: - $(RM) $(DESTDIR)$(dyndir)/*dynlib* +#install-exec-hook: +# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif -- cgit v0.12 From 734aebc39538039c6e81db63edd68eb3a2029cd2 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 28 Apr 2017 18:13:22 -0400 Subject: Rework of the POSIX file open permissions and macros to clean up HDopen() calls. Also fixed a minor const warning in the core VFD. --- src/H5Defl.c | 4 ++-- src/H5FDcore.c | 10 +++++----- src/H5FDdirect.c | 2 +- src/H5FDlog.c | 2 +- src/H5FDsec2.c | 2 +- src/H5private.h | 21 ++++----------------- src/H5win32defs.h | 5 ++++- test/big.c | 6 +++--- test/btree2.c | 8 ++++---- test/dsets.c | 4 ++-- test/enc_dec_plist_cross_platform.c | 4 ++-- test/external.c | 8 ++++---- test/file_image.c | 6 +++--- test/fillval.c | 2 +- test/gen_plist.c | 14 +++++++------- test/h5test.c | 4 ++-- test/istore.c | 2 +- test/links.c | 12 ++++++------ test/tfile.c | 8 ++++---- test/twriteorder.c | 12 ++++++------ tools/src/h5jam/h5jam.c | 8 ++++---- tools/src/h5repack/h5repack_copy.c | 6 +++--- tools/src/misc/h5repart.c | 24 ++++++++++++------------ tools/test/h5jam/h5jamgentest.c | 2 +- tools/test/h5repack/h5repacktst.c | 6 +++--- 25 files changed, 86 insertions(+), 96 deletions(-) diff --git a/src/H5Defl.c b/src/H5Defl.c index 93bf2b2..ebe7689 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -288,7 +288,7 @@ H5D__efl_read(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t size HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed") if(H5_combine_path(dset->shared->extfile_prefix, efl->slot[u].name, &full_name) < 0) HGOTO_ERROR(H5E_EFL, H5E_NOSPACE, FAIL, "can't build external file name") - if((fd = HDopen(full_name, O_RDONLY, H5_POSIX_OPEN_MODE_0000)) < 0) + if((fd = HDopen(full_name, O_RDONLY)) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file") if(HDlseek(fd, (HDoff_t)(efl->slot[u].offset + (HDoff_t)skip), SEEK_SET) < 0) HGOTO_ERROR(H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file") @@ -380,7 +380,7 @@ H5D__efl_write(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t siz HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed") if(H5_combine_path(dset->shared->extfile_prefix, efl->slot[u].name, &full_name) < 0) HGOTO_ERROR(H5E_EFL, H5E_NOSPACE, FAIL, "can't build external file name") - if((fd = HDopen(full_name, O_CREAT | O_RDWR, H5_POSIX_OPEN_MODE_0666)) < 0) { + if((fd = HDopen(full_name, O_CREAT | O_RDWR, H5_POSIX_CREATE_MODE_RW)) < 0) { if(HDaccess(full_name, F_OK) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "external raw data file does not exist") else diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 6c22f69..43d5894 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -598,7 +598,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr { int o_flags; H5FD_core_t *file = NULL; - H5FD_core_fapl_t *fa = NULL; + const H5FD_core_fapl_t *fa = NULL; H5P_genplist_t *plist; /* Property list pointer */ #ifdef H5_HAVE_WIN32_API struct _BY_HANDLE_FILE_INFORMATION fileinfo; @@ -620,7 +620,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr HDassert(H5P_DEFAULT != fapl_id); if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") - if(NULL == (fa = (H5FD_core_fapl_t *)H5P_peek_driver_info(plist))) + if(NULL == (fa = (const H5FD_core_fapl_t *)H5P_peek_driver_info(plist))) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info") /* Build the open flags */ @@ -638,7 +638,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr ((file_image_info.buffer == NULL) && (file_image_info.size == 0))); HDmemset(&sb, 0, sizeof(sb)); if((file_image_info.buffer != NULL) && !(H5F_ACC_CREAT & flags)) { - if(HDopen(name, o_flags, H5_POSIX_OPEN_MODE_0666) >= 0) + if(HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW) >= 0) HGOTO_ERROR(H5E_FILE, H5E_FILEEXISTS, NULL, "file already exists") /* If backing store is requested, create and stat the file @@ -646,7 +646,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr * technically an open. */ if(fa->backing_store) { - if((fd = HDopen(name, o_flags | O_CREAT, H5_POSIX_OPEN_MODE_0666)) < 0) + if((fd = HDopen(name, o_flags | O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to create file") if(HDfstat(fd, &sb) < 0) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file") @@ -656,7 +656,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr * store is off is when the backing_store flag is off and H5F_ACC_CREAT is * on. */ else if(fa->backing_store || !(H5F_ACC_CREAT & flags)) { - if((fd = HDopen(name, o_flags, H5_POSIX_OPEN_MODE_0666)) < 0) + if((fd = HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") if(HDfstat(fd, &sb) < 0) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file") diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 79a5e8a..060947e 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -487,7 +487,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd o_flags |= O_DIRECT; /* Open the file */ - if ((fd=HDopen(name, o_flags, H5_POSIX_OPEN_MODE_0666))<0) + if ((fd = HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW))<0) HSYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") if (HDfstat(fd, &sb)<0) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 6e5a57b..bccf3cc 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -520,7 +520,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HDgettimeofday(&timeval_start, NULL); #endif /* H5_HAVE_GETTIMEOFDAY */ /* Open the file */ - if((fd = HDopen(name, o_flags, H5_POSIX_OPEN_MODE_0666)) < 0) { + if((fd = HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW)) < 0) { int myerrno = errno; HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file: name = '%s', errno = %d, error message = '%s', flags = %x, o_flags = %x", name, myerrno, HDstrerror(myerrno), flags, (unsigned)o_flags); diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 71657b6..3bbf592 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -341,7 +341,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) o_flags |= O_EXCL; /* Open the file */ - if((fd = HDopen(name, o_flags, H5_POSIX_OPEN_MODE_0666)) < 0) { + if((fd = HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW)) < 0) { int myerrno = errno; HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file: name = '%s', errno = %d, error message = '%s', flags = %x, o_flags = %x", name, myerrno, HDstrerror(myerrno), flags, (unsigned)o_flags); } /* end if */ diff --git a/src/H5private.h b/src/H5private.h index fc15e99..ca4ebcf 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -495,22 +495,13 @@ # define H5_POSIX_MAX_IO_BYTES SSIZET_MAX #endif -/* POSIX I/O mode used as the fourth parameter to open/_open +/* POSIX I/O mode used as the third parameter to open/_open * when creating a new file (O_CREAT is set). - * - * It's a little awkward to put the Unix file permissions - * in the symbol name, but that is what is most important - * and we only need the symbol to handle Windows' less-capable - * system. */ #if defined(H5_HAVE_WIN32_API) -# define H5_POSIX_OPEN_MODE_0666 (_S_IREAD | _S_IWRITE) -# define H5_POSIX_OPEN_MODE_0644 _S_IREAD -# define H5_POSIX_OPEN_MODE_0000 0 +# define H5_POSIX_CREATE_MODE_RW (_S_IREAD | _S_IWRITE) #else -# define H5_POSIX_OPEN_MODE_0666 0666 -# define H5_POSIX_OPEN_MODE_0644 0644 -# define H5_POSIX_OPEN_MODE_0000 0000 +# define H5_POSIX_CREATE_MODE_RW 0666 #endif /* @@ -1135,11 +1126,7 @@ typedef off_t h5_stat_size_t; #define HDnanosleep(N, O) nanosleep(N, O) #endif /* HDnanosleep */ #ifndef HDopen - #ifdef _O_BINARY - #define HDopen(S,F,M) open(S,F|_O_BINARY,M) - #else - #define HDopen(S,F,M) open(S,F,M) - #endif + #define HDopen(F,...) open(F,__VA_ARGS__) #endif /* HDopen */ #ifndef HDopendir #define HDopendir(S) opendir(S) diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 771b6fc..97f7179 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -50,8 +50,11 @@ typedef __int64 h5_stat_size_t; /* _O_BINARY must be set in Windows to avoid CR-LF <-> LF EOL * transformations when performing I/O. Note that this will * produce Unix-style text files, though. + * + * Also note that the variadic macro is using a VC++ extension + * where the comma is dropped if nothing is passed to the ellipsis. */ -#define HDopen(S,F,M) _open(S,F|_O_BINARY,M) +#define HDopen(S,F,...) _open(S, F | _O_BINARY, __VA_ARGS__) #define HDread(F,M,Z) _read(F,M,Z) #define HDrmdir(S) _rmdir(S) #define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,(Z>1?Z:2)) diff --git a/test/big.c b/test/big.c index 274c00b..fe52aef 100644 --- a/test/big.c +++ b/test/big.c @@ -172,7 +172,7 @@ is_sparse(void) int fd; h5_stat_t sb; - if ((fd=HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_OPEN_MODE_0666)) < 0) return 0; + if ((fd = HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) return 0; if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0; if (5!=HDwrite(fd, "hello", (size_t)5)) return 0; if (HDclose(fd) < 0) return 0; @@ -210,7 +210,7 @@ supports_big(void) int fd = -1; fsizes_t fsize = NO_FILE; - if((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_OPEN_MODE_0666)) < 0) + if((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) goto error; /* Write a few byte at the beginning */ @@ -293,7 +293,7 @@ enough_room(hid_t fapl) /* Create files */ for (i=0; ifree_src == H5FD_FILE_IMAGE_OP_FILE_CLOSE, "Free callback came from wrong sourc in core close"); /* Create file image buffer */ - fd = HDopen(copied_filename, O_RDONLY, H5_POSIX_OPEN_MODE_0666); + fd = HDopen(copied_filename, O_RDONLY); VERIFY(fd > 0, "open failed"); ret = HDfstat(fd, &sb); VERIFY(ret == 0, "fstat failed"); @@ -814,7 +814,7 @@ test_get_file_image(const char * test_banner, HDsnprintf(member_file_name, 1024, file_name, i); /* open the test file using standard I/O calls */ - fd = HDopen(member_file_name, O_RDONLY, H5_POSIX_OPEN_MODE_0666); + fd = HDopen(member_file_name, O_RDONLY); VERIFY(fd >= 0, "HDopen() failed."); if(size_remaining >= FAMILY_SIZE ){ @@ -862,7 +862,7 @@ test_get_file_image(const char * test_banner, VERIFY(file_image_ptr != NULL, "HDmalloc(2) failed."); /* open the test file using standard I/O calls */ - fd = HDopen(file_name, O_RDONLY, H5_POSIX_OPEN_MODE_0666); + fd = HDopen(file_name, O_RDONLY); VERIFY(fd >= 0, "HDopen() failed."); if(user) { diff --git a/test/fillval.c b/test/fillval.c index 8f1f53d..8c8e902 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -1890,7 +1890,7 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) hsize_t nelmts; nelmts = max_size[0]*max_size[1]*max_size[2]*max_size[3]*max_size[4]; - if((fd=HDopen(FILE_NAME_RAW, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_OPEN_MODE_0666)) < 0 || + if((fd = HDopen(FILE_NAME_RAW, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0 || HDclose(fd) < 0) goto error; if(H5Pset_external(dcpl, FILE_NAME_RAW, (off_t)0, (hsize_t)nelmts*sizeof(int)) < 0) goto error; diff --git a/test/gen_plist.c b/test/gen_plist.c index 41f232d..62693bd 100644 --- a/test/gen_plist.c +++ b/test/gen_plist.c @@ -463,23 +463,23 @@ encode_plist(hid_t plist_id, int little_endian, int word_length, const char *fil /* Generate filename */ if((ret = HDsnprintf(filename, sizeof(filename), "%s%d%s", filename_prefix, word_length, little_endian ? "le" : "be")) < 0) - assert(ret > 0); + HDassert(ret > 0); /* first call to encode returns only the size of the buffer needed */ if((ret = H5Pencode(plist_id, NULL, &temp_size)) < 0) - assert(ret > 0); + HDassert(ret > 0); temp_buf = (void *)HDmalloc(temp_size); - assert(temp_buf); + HDassert(temp_buf); if((ret = H5Pencode(plist_id, temp_buf, &temp_size)) < 0) - assert(ret > 0); + HDassert(ret > 0); - fd = HDopen(filename, O_RDWR | O_CREAT | O_TRUNC, 0666); - assert(fd > 0); + fd = HDopen(filename, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW); + HDassert(fd > 0); write_size = HDwrite(fd, temp_buf, temp_size); - assert(write_size == (ssize_t)temp_size); + HDassert(write_size == (ssize_t)temp_size); HDclose(fd); diff --git a/test/h5test.c b/test/h5test.c index a5cd674..8db4388 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1596,9 +1596,9 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) goto error; /* Copy old file into temporary file */ - if((fd_old = HDopen(filename, O_RDONLY, H5_POSIX_OPEN_MODE_0666)) < 0) + if((fd_old = HDopen(filename, O_RDONLY)) < 0) goto error; - if((fd_new = HDopen(local_copy_name, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_OPEN_MODE_0666)) < 0) + if((fd_new = HDopen(local_copy_name, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) goto error; /* Copy data */ diff --git a/test/istore.c b/test/istore.c index 18cf1de..c401e87 100644 --- a/test/istore.c +++ b/test/istore.c @@ -73,7 +73,7 @@ is_sparse(void) int fd; h5_stat_t sb; - if ((fd=HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_OPEN_MODE_0666)) < 0) return 0; + if ((fd = HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) return 0; if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0; if (5!=HDwrite(fd, "hello", (size_t)5)) return 0; if (HDclose(fd) < 0) return 0; diff --git a/test/links.c b/test/links.c index 2d1ef03..7b3e37d 100644 --- a/test/links.c +++ b/test/links.c @@ -3730,7 +3730,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) TESTING("H5Pset/get_elink_fapl() with same physical layout") if((HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) || (NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))) - TEST_ERROR + TEST_ERROR /* * set up name for main file: @@ -3780,7 +3780,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) /* Create external link to target file: ext_link->extlinks17:/A/Dataset */ if(H5Lcreate_external(filename2, "/A/Dataset", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) - TEST_ERROR + TEST_ERROR /* create fapl to be a "core" file without backing store */ if(H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, FALSE) < 0) @@ -3793,9 +3793,9 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) /* try to open the external linked target dataset */ did = H5Dopen2(fid, "ext_link", dapl_id); if(did < 0) { - H5_FAILED(); - HDputs(" Should succeed in opening the target dataset"); - goto error; + H5_FAILED(); + HDputs(" Should succeed in opening the target dataset"); + goto error; } /* Initialize the dataset */ @@ -3805,7 +3805,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) /* Write the data to the dataset */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) - TEST_ERROR + TEST_ERROR if(H5Pclose(dapl_id) < 0) TEST_ERROR if(H5Dclose(did) < 0) TEST_ERROR diff --git a/test/tfile.c b/test/tfile.c index 2d26874..50e3341 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1611,7 +1611,7 @@ test_file_ishdf5(void) /* Create non-HDF5 file and check it */ - fd=HDopen(FILE1, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_OPEN_MODE_0666); + fd = HDopen(FILE1, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW); CHECK(fd, FAIL, "HDopen"); /* Initialize information to write */ @@ -2657,7 +2657,7 @@ cal_chksum(const char *file, uint32_t *chksum) herr_t ret; /* Generic return value */ /* Open the file */ - fdes = HDopen(file, O_RDONLY, H5_POSIX_OPEN_MODE_0000); + fdes = HDopen(file, O_RDONLY); CHECK(fdes, FAIL, "HDopen"); /* Retrieve the file's size */ @@ -4340,9 +4340,9 @@ test_filespace_compatible(void) const char *filename = H5_get_srcdir_filename(OLD_FILENAME[j]); /* Corrected test file name */ /* Open and copy the test file into a temporary file */ - fd_old = HDopen(filename, O_RDONLY, H5_POSIX_OPEN_MODE_0666); + fd_old = HDopen(filename, O_RDONLY); CHECK(fd_old, FAIL, "HDopen"); - fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_OPEN_MODE_0666); + fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW); CHECK(fd_new, FAIL, "HDopen"); /* Copy data */ diff --git a/test/twriteorder.c b/test/twriteorder.c index 3ecd3e0..4c86636 100644 --- a/test/twriteorder.c +++ b/test/twriteorder.c @@ -231,9 +231,9 @@ int create_wo_file(void) int ret_code; /* Create the data file */ - if ((write_fd_g = HDopen(DATAFILE, O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_OPEN_MODE_0666)) < 0) { - printf("WRITER: error from open\n"); - return -1; + if ((write_fd_g = HDopen(DATAFILE, O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) { + HDprintf("WRITER: error from open\n"); + return -1; } blkaddr=0; /* write it to partition 0 */ @@ -297,9 +297,9 @@ int read_wo_file(void) char buffer[BLOCKSIZE_DFT]; /* Open the data file */ - if ((read_fd = HDopen(DATAFILE, O_RDONLY, H5_POSIX_OPEN_MODE_0000)) < 0) { - printf("READER: error from open\n"); - return -1; + if ((read_fd = HDopen(DATAFILE, O_RDONLY)) < 0) { + HDprintf("READER: error from open\n"); + return -1; } /* keep reading the initial block address until it is non-zero before proceeding. */ while (blkaddr == 0){ diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index f41f8dc..a403cf1 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -292,7 +292,7 @@ main (int argc, const char *argv[]) H5Pclose(plist); H5Fclose(ifile); - ufid = HDopen(ub_file, O_RDONLY, H5_POSIX_OPEN_MODE_0000); + ufid = HDopen(ub_file, O_RDONLY); if(ufid < 0) { error_msg("unable to open user block file \"%s\"\n", ub_file); leave (EXIT_FAILURE); @@ -307,7 +307,7 @@ main (int argc, const char *argv[]) fsize = (off_t)sbuf.st_size; - h5fid = HDopen(input_file, O_RDONLY, H5_POSIX_OPEN_MODE_0000); + h5fid = HDopen(input_file, O_RDONLY); if(h5fid < 0) { error_msg("unable to open HDF5 file for read \"%s\"\n", input_file); HDclose (ufid); @@ -325,7 +325,7 @@ main (int argc, const char *argv[]) h5fsize = (hsize_t)sbuf2.st_size; if (output_file == NULL) { - ofid = HDopen (input_file, O_WRONLY, H5_POSIX_OPEN_MODE_0000); + ofid = HDopen(input_file, O_WRONLY); if (ofid < 0) { error_msg("unable to open output file \"%s\"\n", output_file); @@ -335,7 +335,7 @@ main (int argc, const char *argv[]) } } else { - ofid = HDopen (output_file, O_WRONLY | O_CREAT | O_TRUNC, H5_POSIX_OPEN_MODE_0644); + ofid = HDopen(output_file, O_WRONLY | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW); if (ofid < 0) { error_msg("unable to create output file \"%s\"\n", output_file); diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 604e85f..e7c3bfe 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -1471,9 +1471,9 @@ static int copy_user_block(const char *infile, const char *outfile, HDassert(size > 0); /* Open files */ - if ((infid = HDopen(infile, O_RDONLY, 0)) < 0) + if ((infid = HDopen(infile, O_RDONLY)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDopen failed"); - if ((outfid = HDopen(outfile, O_WRONLY, 0644)) < 0) + if ((outfid = HDopen(outfile, O_WRONLY)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDopen failed"); /* Copy the userblock from the input file to the output file */ @@ -1565,7 +1565,7 @@ void print_user_block(const char *filename, hid_t fid) } /* open file */ - if((fh = HDopen(filename, O_RDONLY, 0)) < 0) { + if((fh = HDopen(filename, O_RDONLY)) < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed"); } diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index 911e0c6..4432621 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -262,9 +262,9 @@ main (int argc, char *argv[]) sprintf (src_name, src_gen_name, src_membno); src_is_family = strcmp (src_name, src_gen_name); - if ((src=HDopen(src_name, O_RDONLY,0))<0) { - perror (src_name); - exit (EXIT_FAILURE); + if ((src = HDopen(src_name, O_RDONLY)) < 0) { + HDperror(src_name); + HDexit(EXIT_FAILURE); } if (HDfstat(src, &sb)<0) { @@ -282,9 +282,9 @@ main (int argc, char *argv[]) sprintf (dst_name, dst_gen_name, dst_membno); dst_is_family = strcmp (dst_name, dst_gen_name); - if ((dst=HDopen (dst_name, O_RDWR|O_CREAT|O_TRUNC, 0666))<0) { - perror (dst_name); - exit (EXIT_FAILURE); + if ((dst = HDopen(dst_name, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) { + HDperror(dst_name); + HDexit(EXIT_FAILURE); } if (verbose) fprintf (stderr, "> %s\n", dst_name); @@ -363,9 +363,9 @@ main (int argc, char *argv[]) break; } sprintf (src_name, src_gen_name, ++src_membno); - if ((src=HDopen (src_name, O_RDONLY,0))<0 && ENOENT==errno) { - dst_offset = dst_offset + (off_t)n; - break; + if ((src = HDopen(src_name, O_RDONLY)) < 0 && ENOENT == errno) { + dst_offset = dst_offset + (off_t)n; + break; } else if (src<0) { perror (src_name); exit (EXIT_FAILURE); @@ -410,9 +410,9 @@ main (int argc, char *argv[]) } HDclose (dst); sprintf (dst_name, dst_gen_name, ++dst_membno); - if ((dst=HDopen (dst_name, O_RDWR|O_CREAT|O_TRUNC, 0666))<0) { - perror (dst_name); - exit (EXIT_FAILURE); + if ((dst = HDopen(dst_name, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) { + HDperror(dst_name); + HDexit(EXIT_FAILURE); } dst_offset = 0; need_seek = FALSE; diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c index 8648f07..d713bb9 100644 --- a/tools/test/h5jam/h5jamgentest.c +++ b/tools/test/h5jam/h5jamgentest.c @@ -277,7 +277,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill) HDassert(ub_size <= BUF_SIZE); - fd = HDopen(filename, O_RDWR, 0); + fd = HDopen(filename, O_RDWR); HDassert(fd >= 0); /* fill buf with pattern */ diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index 3b82383..09183f1 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -3755,7 +3755,7 @@ make_userblock(void) ub[u] = (char)('a' + (char)(u % 26)); /* Re-open HDF5 file, as "plain" file */ - if((fd = HDopen(FNAME16, O_WRONLY, 0644)) < 0) + if((fd = HDopen(FNAME16, O_WRONLY)) < 0) goto out; /* Write userblock data */ @@ -3819,7 +3819,7 @@ verify_userblock( const char* filename) /* Re-open HDF5 file, as "plain" file */ - if((fd = HDopen(filename, O_RDONLY, 0)) < 0) + if((fd = HDopen(filename, O_RDONLY)) < 0) goto out; /* Read userblock data */ @@ -3868,7 +3868,7 @@ make_userblock_file(void) ub[u] = (char)('a' + (char)(u % 26)); /* open file */ - if((fd = HDopen(FNAME_UB,O_WRONLY|O_CREAT|O_TRUNC, 0644 )) < 0) + if((fd = HDopen(FNAME_UB, O_WRONLY|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) goto out; /* write userblock data */ -- cgit v0.12 From d367d397e3380d325154a97f5718642d0657db70 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Mon, 1 May 2017 10:01:53 -0500 Subject: Separate shared chunks redistribution code out to its own function --- src/H5Dmpio.c | 452 +++++++++++++++++++++++++++++++--------------------------- src/H5err.txt | 1 + 2 files changed, 246 insertions(+), 207 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 8e662ec..0f3d09e 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -159,6 +159,9 @@ static herr_t H5D__mpio_get_sum_chunk(const H5D_io_info_t *io_info, static herr_t H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm, H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries); +static herr_t H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm, + H5D_filtered_collective_io_info_t *local_chunk_array, size_t *local_chunk_array_num_entries); static herr_t H5D__mpio_array_gatherv(void *local_array, size_t local_array_num_entries, size_t array_entry_size, void **gathered_array, size_t *gathered_array_num_entries, int nprocs, hbool_t allgather, int root, MPI_Comm comm, int (*sort_func)(const void *, const void *)); @@ -2590,17 +2593,9 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ const H5D_chunk_map_t *fm, H5D_filtered_collective_io_info_t **chunk_list, size_t *num_entries) { H5D_filtered_collective_io_info_t *local_info_array = NULL; /* The list of initially selected chunks for this process */ - H5D_filtered_collective_io_info_t *shared_chunks_info_array = NULL; /* The list of all chunks selected in the operation by all processes */ - H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__gather_mem */ - unsigned char **mod_data = NULL; /* Array of chunk modification data buffers sent by a process to new chunk owners */ - MPI_Request *send_requests = NULL; /* Array of MPI_Isend chunk modification data send requests */ - MPI_Status *send_statuses = NULL; /* Array of MPI_Isend chunk modification send statuses */ - hbool_t mem_iter_init = FALSE; size_t num_chunks_selected; - size_t i, last_assigned_idx; - int *send_counts = NULL; - int *send_displacements = NULL; - int mpi_rank, mpi_size, mpi_code; + size_t i; + int mpi_rank; herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -2614,8 +2609,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") - if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) - HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") /* Each process builds a local list of the chunks they have selected */ if ((num_chunks_selected = H5SL_count(fm->sel_chunks))) { @@ -2662,236 +2655,281 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ } /* end if */ /* Redistribute shared chunks to new owners as necessary */ - if (io_info->op_type == H5D_IO_OP_WRITE) { - size_t shared_chunks_info_array_num_entries = 0; - size_t num_send_requests = 0; - - if (num_chunks_selected) - if (NULL == (send_requests = (MPI_Request *) H5MM_malloc(num_chunks_selected * sizeof(*send_requests)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send requests buffer") - - if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(H5S_sel_iter_t)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") - - if (H5D__mpio_array_gatherv(local_info_array, num_chunks_selected, sizeof(*local_info_array), - (void **) &shared_chunks_info_array, &shared_chunks_info_array_num_entries, mpi_size, - false, 0, io_info->comm, H5D__cmp_filtered_collective_io_info_entry) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather array") - - /* Rank 0 redistributes any shared chunks to new owners as necessary */ - if (mpi_rank == 0) { - if (NULL == (send_counts = (int *) H5MM_calloc((size_t) mpi_size * sizeof(*send_counts)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate send counts buffer") - - if (NULL == (send_displacements = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*send_displacements)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate send displacements buffer") - - for (i = 0; i < shared_chunks_info_array_num_entries;) { - H5D_filtered_collective_io_info_t chunk_entry; - haddr_t last_seen_addr = shared_chunks_info_array[i].chunk_states.chunk_current.offset; - size_t set_begin_index = i; - size_t total_io_size = 0; - size_t max_io_size = 0; - size_t num_writers = 0; - int new_chunk_owner = 0; - - /* Process each set of duplicate entries caused by another process writing to the same chunk */ - do { - chunk_entry = shared_chunks_info_array[i]; - - send_counts[chunk_entry.owners.original_owner] += (int) sizeof(chunk_entry); - - /* Add this chunk entry's I/O size to the running total */ - total_io_size += chunk_entry.io_size; - - /* The new owner of the chunk is determined by the process - * which is writing the most data to the chunk - */ - if (chunk_entry.io_size > max_io_size) { - max_io_size = chunk_entry.io_size; - new_chunk_owner = chunk_entry.owners.original_owner; - } - - num_writers++; - } while (++i < shared_chunks_info_array_num_entries && shared_chunks_info_array[i].chunk_states.chunk_current.offset == last_seen_addr); - - /* Set all of the chunk entries' "new_owner" fields */ - for (; set_begin_index < i; set_begin_index++) { - shared_chunks_info_array[set_begin_index].owners.new_owner = new_chunk_owner; - shared_chunks_info_array[set_begin_index].num_writers = num_writers; - } /* end for */ - } /* end for */ + if (io_info->op_type == H5D_IO_OP_WRITE) + if (H5D__chunk_redistribute_shared_chunks(io_info, type_info, fm, local_info_array, &num_chunks_selected) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTDISTRIBUTE, FAIL, "unable to redistribute shared chunks") - /* Sort the new list's in order of previous owner so that each original owner of a chunk - * entry gets that entry back, with the possibly newly-modified "new_owner" field - */ - HDqsort(shared_chunks_info_array, shared_chunks_info_array_num_entries, - sizeof(*shared_chunks_info_array), H5D__cmp_filtered_collective_io_info_entry_owner); + *chunk_list = local_info_array; + *num_entries = num_chunks_selected; - send_displacements[0] = 0; - for (i = 1; i < (size_t) mpi_size; i++) - send_displacements[i] = send_displacements[i - 1] + send_counts[i - 1]; - } /* end if */ +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__construct_filtered_io_info_list() */ - /* Scatter the segments of the list back to each process */ - if (MPI_SUCCESS != (mpi_code = MPI_Scatterv(shared_chunks_info_array, send_counts, - send_displacements, MPI_BYTE, local_info_array, num_chunks_selected * (int) sizeof(*local_info_array), - MPI_BYTE, 0, io_info->comm))) - HMPI_GOTO_ERROR(FAIL, "unable to scatter shared chunks info buffer", mpi_code) - - if (shared_chunks_info_array) { - H5MM_free(shared_chunks_info_array); - shared_chunks_info_array = NULL; - } - - /* Now that the chunks have been redistributed, each process must send its modification data - * to the new owners of any of the chunks it previously possessed. Accordingly, each process - * must also issue asynchronous receives for any messages it may receive for each of the - * chunks it is assigned, in order to avoid potential deadlocking issues. - */ - if (num_chunks_selected) - if (NULL == (mod_data = (unsigned char **) H5MM_malloc(num_chunks_selected * sizeof(*mod_data)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate modification data buffer array") - - for (i = 0, last_assigned_idx = 0; i < num_chunks_selected; i++) { - H5D_filtered_collective_io_info_t *chunk_entry = &local_info_array[i]; - - if (mpi_rank != chunk_entry->owners.new_owner) { - H5D_chunk_info_t *chunk_info = NULL; - unsigned char *mod_data_p = NULL; - hssize_t iter_nelmts; - size_t mod_data_size; - - /* Look up the chunk and get its file and memory dataspaces */ - if (NULL == (chunk_info = (H5D_chunk_info_t *) H5SL_search(fm->sel_chunks, &chunk_entry->index))) - HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, FAIL, "can't locate chunk in skip list") - - /* Determine size of serialized chunk file dataspace, plus the size of - * the data being written - */ - if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to get encoded dataspace size") + +/*------------------------------------------------------------------------- + * Function: H5D__chunk_redistribute_shared_chunks + * + * Purpose: + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jordan Henderson + * Monday, May 1, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + const H5D_chunk_map_t *fm, H5D_filtered_collective_io_info_t *local_chunk_array, size_t *local_chunk_array_num_entries) +{ + H5D_filtered_collective_io_info_t *shared_chunks_info_array = NULL; /* The list of all chunks selected in the operation by all processes */ + H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__gather_mem */ + unsigned char **mod_data = NULL; /* Array of chunk modification data buffers sent by a process to new chunk owners */ + MPI_Request *send_requests = NULL; /* Array of MPI_Isend chunk modification data send requests */ + MPI_Status *send_statuses = NULL; /* Array of MPI_Isend chunk modification send statuses */ + hbool_t mem_iter_init = FALSE; + size_t shared_chunks_info_array_num_entries = 0; + size_t num_send_requests = 0; + size_t i, last_assigned_idx; + int *send_counts = NULL; + int *send_displacements = NULL; + int mpi_rank, mpi_size, mpi_code; + herr_t ret_value = SUCCEED; - if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + FUNC_ENTER_STATIC - mod_data_size += (size_t) iter_nelmts * type_info->src_type_size; + HDassert(io_info); + HDassert(type_info); + HDassert(local_chunk_array_num_entries); - if (NULL == (mod_data[num_send_requests] = (unsigned char *) H5MM_malloc(mod_data_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification send buffer") + if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") + if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") - /* Serialize the chunk's file dataspace into the buffer */ - mod_data_p = mod_data[num_send_requests]; - if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to encode dataspace") + if (*local_chunk_array_num_entries) + if (NULL == (send_requests = (MPI_Request *) H5MM_malloc(*local_chunk_array_num_entries * sizeof(*send_requests)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send requests buffer") - /* Intialize iterator for memory selection */ - if (H5S_select_iter_init(mem_iter, chunk_info->mspace, type_info->src_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") - mem_iter_init = TRUE; + if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(H5S_sel_iter_t)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") - /* Collect the modification data into the buffer */ - if (!H5D__gather_mem(io_info->u.wbuf, chunk_info->mspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, mod_data_p)) - HGOTO_ERROR(H5E_IO, H5E_CANTGATHER, FAIL, "couldn't gather from write buffer") + if (H5D__mpio_array_gatherv(local_chunk_array, *local_chunk_array_num_entries, sizeof(*local_chunk_array), + (void **) &shared_chunks_info_array, &shared_chunks_info_array_num_entries, mpi_size, + false, 0, io_info->comm, H5D__cmp_filtered_collective_io_info_entry) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather array") - /* Send modification data to new owner */ - H5_CHECK_OVERFLOW(mod_data_size, size_t, int) - H5_CHECK_OVERFLOW(chunk_entry->index, hsize_t, int) - if (MPI_SUCCESS != (mpi_code = MPI_Isend(mod_data[num_send_requests], (int) mod_data_size, MPI_BYTE, - chunk_entry->owners.new_owner, (int) chunk_entry->index, io_info->comm, &send_requests[num_send_requests]))) - HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) + /* Rank 0 redistributes any shared chunks to new owners as necessary */ + if (mpi_rank == 0) { + if (NULL == (send_counts = (int *) H5MM_calloc((size_t) mpi_size * sizeof(*send_counts)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate send counts buffer") - if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release memory selection iterator") - mem_iter_init = FALSE; + if (NULL == (send_displacements = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*send_displacements)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate send displacements buffer") - num_send_requests++; - } /* end if */ - else { - /* Allocate all necessary buffers for an asynchronous receive operation */ - if (chunk_entry->num_writers > 1) { - MPI_Message message; - MPI_Status status; - size_t j; - - chunk_entry->async_info.num_receive_requests = (int) chunk_entry->num_writers - 1; - if (NULL == (chunk_entry->async_info.receive_requests_array = (MPI_Request *) H5MM_malloc(chunk_entry->async_info.num_receive_requests * sizeof(MPI_Request)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate async requests array") - - if (NULL == (chunk_entry->async_info.receive_buffer_array = (unsigned char **) H5MM_malloc(chunk_entry->async_info.num_receive_requests * sizeof(unsigned char *)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate async receive buffers") - - for (j = 0; j < chunk_entry->num_writers - 1; j++) { - int count = 0; - - /* Probe for a particular message from any process, removing that message - * from the receive queue in the process and allocating that much memory - * for the asynchronous receive - */ - if (MPI_SUCCESS != (mpi_code = MPI_Mprobe(MPI_ANY_SOURCE, (int) chunk_entry->index, io_info->comm, &message, &status))) - HMPI_GOTO_ERROR(FAIL, "MPI_Mprobe failed", mpi_code) - - if (MPI_SUCCESS != (mpi_code = MPI_Get_count(&status, MPI_BYTE, &count))) - HMPI_GOTO_ERROR(FAIL, "MPI_Get_count failed", mpi_code) - - if (NULL == (chunk_entry->async_info.receive_buffer_array[j] = (unsigned char *) H5MM_malloc(count * sizeof(char *)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate modification data receive buffer") - - if (MPI_SUCCESS != (mpi_code = MPI_Imrecv(chunk_entry->async_info.receive_buffer_array[j], count, MPI_BYTE, - &message, &chunk_entry->async_info.receive_requests_array[j]))) - HMPI_GOTO_ERROR(FAIL, "MPI_Imrecv failed", mpi_code) - } + for (i = 0; i < shared_chunks_info_array_num_entries;) { + H5D_filtered_collective_io_info_t chunk_entry; + haddr_t last_seen_addr = shared_chunks_info_array[i].chunk_states.chunk_current.offset; + size_t set_begin_index = i; + size_t total_io_size = 0; + size_t max_io_size = 0; + size_t num_writers = 0; + int new_chunk_owner = 0; + + /* Process each set of duplicate entries caused by another process writing to the same chunk */ + do { + chunk_entry = shared_chunks_info_array[i]; + + send_counts[chunk_entry.owners.original_owner] += (int) sizeof(chunk_entry); + + /* Add this chunk entry's I/O size to the running total */ + total_io_size += chunk_entry.io_size; + + /* The new owner of the chunk is determined by the process + * which is writing the most data to the chunk + */ + if (chunk_entry.io_size > max_io_size) { + max_io_size = chunk_entry.io_size; + new_chunk_owner = chunk_entry.owners.original_owner; } - local_info_array[last_assigned_idx++] = local_info_array[i]; - } /* end else */ + num_writers++; + } while (++i < shared_chunks_info_array_num_entries && shared_chunks_info_array[i].chunk_states.chunk_current.offset == last_seen_addr); + + /* Set all of the chunk entries' "new_owner" fields */ + for (; set_begin_index < i; set_begin_index++) { + shared_chunks_info_array[set_begin_index].owners.new_owner = new_chunk_owner; + shared_chunks_info_array[set_begin_index].num_writers = num_writers; + } /* end for */ } /* end for */ - num_chunks_selected = last_assigned_idx; + /* Sort the new list in order of previous owner so that each original owner of a chunk + * entry gets that entry back, with the possibly newly-modified "new_owner" field + */ + HDqsort(shared_chunks_info_array, shared_chunks_info_array_num_entries, + sizeof(*shared_chunks_info_array), H5D__cmp_filtered_collective_io_info_entry_owner); + + send_displacements[0] = 0; + for (i = 1; i < (size_t) mpi_size; i++) + send_displacements[i] = send_displacements[i - 1] + send_counts[i - 1]; + } /* end if */ - /* Wait for all async send requests to complete before returning */ - if (num_send_requests) { - if (NULL == (send_statuses = (MPI_Status *) H5MM_malloc(num_send_requests * sizeof(*send_statuses)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send statuses buffer") + /* Scatter the segments of the list back to each process */ + if (MPI_SUCCESS != (mpi_code = MPI_Scatterv(shared_chunks_info_array, send_counts, + send_displacements, MPI_BYTE, local_chunk_array, *local_chunk_array_num_entries * (int) sizeof(*local_chunk_array), + MPI_BYTE, 0, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "unable to scatter shared chunks info buffer", mpi_code) - H5_CHECK_OVERFLOW(num_send_requests, size_t, int); - if (MPI_SUCCESS != (mpi_code = MPI_Waitall((int) num_send_requests, send_requests, send_statuses))) - HMPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code) + if (shared_chunks_info_array) { + H5MM_free(shared_chunks_info_array); + shared_chunks_info_array = NULL; + } + + /* Now that the chunks have been redistributed, each process must send its modification data + * to the new owners of any of the chunks it previously possessed. Accordingly, each process + * must also issue asynchronous receives for any messages it may receive for each of the + * chunks it is assigned, in order to avoid potential deadlocking issues. + */ + if (*local_chunk_array_num_entries) + if (NULL == (mod_data = (unsigned char **) H5MM_malloc(*local_chunk_array_num_entries * sizeof(*mod_data)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate modification data buffer array") + + for (i = 0, last_assigned_idx = 0; i < *local_chunk_array_num_entries; i++) { + H5D_filtered_collective_io_info_t *chunk_entry = &local_chunk_array[i]; + + if (mpi_rank != chunk_entry->owners.new_owner) { + H5D_chunk_info_t *chunk_info = NULL; + unsigned char *mod_data_p = NULL; + hssize_t iter_nelmts; + size_t mod_data_size; + + /* Look up the chunk and get its file and memory dataspaces */ + if (NULL == (chunk_info = (H5D_chunk_info_t *) H5SL_search(fm->sel_chunks, &chunk_entry->index))) + HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, FAIL, "can't locate chunk in skip list") + + /* Determine size of serialized chunk file dataspace, plus the size of + * the data being written + */ + if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to get encoded dataspace size") + + if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + + mod_data_size += (size_t) iter_nelmts * type_info->src_type_size; + + if (NULL == (mod_data[num_send_requests] = (unsigned char *) H5MM_malloc(mod_data_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk modification send buffer") + + /* Serialize the chunk's file dataspace into the buffer */ + mod_data_p = mod_data[num_send_requests]; + if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to encode dataspace") + + /* Intialize iterator for memory selection */ + if (H5S_select_iter_init(mem_iter, chunk_info->mspace, type_info->src_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") + mem_iter_init = TRUE; + + /* Collect the modification data into the buffer */ + if (!H5D__gather_mem(io_info->u.wbuf, chunk_info->mspace, mem_iter, + (size_t) iter_nelmts, io_info->dxpl_cache, mod_data_p)) + HGOTO_ERROR(H5E_IO, H5E_CANTGATHER, FAIL, "couldn't gather from write buffer") + + /* Send modification data to new owner */ + H5_CHECK_OVERFLOW(mod_data_size, size_t, int) + H5_CHECK_OVERFLOW(chunk_entry->index, hsize_t, int) + if (MPI_SUCCESS != (mpi_code = MPI_Isend(mod_data[num_send_requests], (int) mod_data_size, MPI_BYTE, + chunk_entry->owners.new_owner, (int) chunk_entry->index, io_info->comm, &send_requests[num_send_requests]))) + HMPI_GOTO_ERROR(FAIL, "MPI_Isend failed", mpi_code) + + if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release memory selection iterator") + mem_iter_init = FALSE; + + num_send_requests++; } /* end if */ + else { + /* Allocate all necessary buffers for an asynchronous receive operation */ + if (chunk_entry->num_writers > 1) { + MPI_Message message; + MPI_Status status; + size_t j; - /* Now that all async send requests have completed, free up the send - * buffers used in the async operations - */ - for (i = 0; i < num_send_requests; i++) { - if (mod_data[i]) - H5MM_free(mod_data[i]); - } - } /* end if */ + chunk_entry->async_info.num_receive_requests = (int) chunk_entry->num_writers - 1; + if (NULL == (chunk_entry->async_info.receive_requests_array = (MPI_Request *) H5MM_malloc(chunk_entry->async_info.num_receive_requests * sizeof(MPI_Request)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate async requests array") - *chunk_list = local_info_array; - *num_entries = num_chunks_selected; + if (NULL == (chunk_entry->async_info.receive_buffer_array = (unsigned char **) H5MM_malloc(chunk_entry->async_info.num_receive_requests * sizeof(unsigned char *)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate async receive buffers") + + for (j = 0; j < chunk_entry->num_writers - 1; j++) { + int count = 0; + + /* Probe for a particular message from any process, removing that message + * from the receive queue in the process and allocating that much memory + * for the asynchronous receive + */ + if (MPI_SUCCESS != (mpi_code = MPI_Mprobe(MPI_ANY_SOURCE, (int) chunk_entry->index, io_info->comm, &message, &status))) + HMPI_GOTO_ERROR(FAIL, "MPI_Mprobe failed", mpi_code) + + if (MPI_SUCCESS != (mpi_code = MPI_Get_count(&status, MPI_BYTE, &count))) + HMPI_GOTO_ERROR(FAIL, "MPI_Get_count failed", mpi_code) + + if (NULL == (chunk_entry->async_info.receive_buffer_array[j] = (unsigned char *) H5MM_malloc(count * sizeof(char *)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate modification data receive buffer") + + if (MPI_SUCCESS != (mpi_code = MPI_Imrecv(chunk_entry->async_info.receive_buffer_array[j], count, MPI_BYTE, + &message, &chunk_entry->async_info.receive_requests_array[j]))) + HMPI_GOTO_ERROR(FAIL, "MPI_Imrecv failed", mpi_code) + } /* end for */ + } /* end if */ + + local_chunk_array[last_assigned_idx++] = local_chunk_array[i]; + } /* end else */ + } /* end for */ + + *local_chunk_array_num_entries = last_assigned_idx; + + /* Wait for all async send requests to complete before returning */ + if (num_send_requests) { + if (NULL == (send_statuses = (MPI_Status *) H5MM_malloc(num_send_requests * sizeof(*send_statuses)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send statuses buffer") + + H5_CHECK_OVERFLOW(num_send_requests, size_t, int); + if (MPI_SUCCESS != (mpi_code = MPI_Waitall((int) num_send_requests, send_requests, send_statuses))) + HMPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code) + } /* end if */ done: - if (shared_chunks_info_array) - H5MM_free(shared_chunks_info_array); - if (send_counts) - H5MM_free(send_counts); - if (send_displacements) - H5MM_free(send_displacements); + /* Now that all async send requests have completed, free up the send + * buffers used in the async operations + */ + for (i = 0; i < num_send_requests; i++) { + if (mod_data[i]) + H5MM_free(mod_data[i]); + } + if (send_requests) H5MM_free(send_requests); if (send_statuses) H5MM_free(send_statuses); + if (send_counts) + H5MM_free(send_counts); + if (send_displacements) + H5MM_free(send_displacements); if (mod_data) H5MM_free(mod_data); if (mem_iter_init && H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") if (mem_iter) H5MM_free(mem_iter); + if (shared_chunks_info_array) + H5MM_free(shared_chunks_info_array); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__construct_filtered_io_info_list() */ +} /* end H5D__chunk_redistribute_shared_chunks() */ /*------------------------------------------------------------------------- diff --git a/src/H5err.txt b/src/H5err.txt index b2ff3bd..c60065c 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -247,6 +247,7 @@ MINOR, MPI, H5E_MPIERRSTR, MPI Error String MINOR, MPI, H5E_CANTRECV, Can't receive data MINOR, MPI, H5E_CANTGATHER, Can't gather data MINOR, MPI, H5E_NO_INDEPENDENT, Can't perform independent IO +MINOR, MPI, H5E_CANTDISTRIBUTE, Can't distribute shared chunks # Heap errors MINOR, HEAP, H5E_CANTRESTORE, Can't restore condition -- cgit v0.12 From 92759cc3b9f67f0ca913f190bd9bc5a5249455be Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Mon, 1 May 2017 10:51:32 -0500 Subject: Revise shared chunks redistribution algorithm --- src/H5Dmpio.c | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 0f3d09e..065e19b 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -2683,19 +2683,20 @@ static herr_t H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm, H5D_filtered_collective_io_info_t *local_chunk_array, size_t *local_chunk_array_num_entries) { - H5D_filtered_collective_io_info_t *shared_chunks_info_array = NULL; /* The list of all chunks selected in the operation by all processes */ - H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__gather_mem */ - unsigned char **mod_data = NULL; /* Array of chunk modification data buffers sent by a process to new chunk owners */ - MPI_Request *send_requests = NULL; /* Array of MPI_Isend chunk modification data send requests */ - MPI_Status *send_statuses = NULL; /* Array of MPI_Isend chunk modification send statuses */ - hbool_t mem_iter_init = FALSE; - size_t shared_chunks_info_array_num_entries = 0; - size_t num_send_requests = 0; - size_t i, last_assigned_idx; - int *send_counts = NULL; - int *send_displacements = NULL; - int mpi_rank, mpi_size, mpi_code; - herr_t ret_value = SUCCEED; + H5D_filtered_collective_io_info_t *shared_chunks_info_array = NULL; /* The list of all chunks selected in the operation by all processes */ + H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__gather_mem */ + unsigned char **mod_data = NULL; /* Array of chunk modification data buffers sent by a process to new chunk owners */ + MPI_Request *send_requests = NULL; /* Array of MPI_Isend chunk modification data send requests */ + MPI_Status *send_statuses = NULL; /* Array of MPI_Isend chunk modification send statuses */ + hbool_t mem_iter_init = FALSE; + size_t shared_chunks_info_array_num_entries = 0; + size_t num_send_requests = 0; + size_t *num_assigned_chunks_array = NULL; + size_t i, last_assigned_idx; + int *send_counts = NULL; + int *send_displacements = NULL; + int mpi_rank, mpi_size, mpi_code; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -2728,14 +2729,15 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty if (NULL == (send_displacements = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*send_displacements)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate send displacements buffer") + if (NULL == (num_assigned_chunks_array = (size_t *) H5MM_calloc((size_t) mpi_size * sizeof(*num_assigned_chunks_array)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate number of assigned chunks array") + for (i = 0; i < shared_chunks_info_array_num_entries;) { H5D_filtered_collective_io_info_t chunk_entry; haddr_t last_seen_addr = shared_chunks_info_array[i].chunk_states.chunk_current.offset; size_t set_begin_index = i; - size_t total_io_size = 0; - size_t max_io_size = 0; size_t num_writers = 0; - int new_chunk_owner = 0; + int new_chunk_owner = shared_chunks_info_array[i].owners.original_owner; /* Process each set of duplicate entries caused by another process writing to the same chunk */ do { @@ -2743,16 +2745,12 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty send_counts[chunk_entry.owners.original_owner] += (int) sizeof(chunk_entry); - /* Add this chunk entry's I/O size to the running total */ - total_io_size += chunk_entry.io_size; - /* The new owner of the chunk is determined by the process - * which is writing the most data to the chunk + * writing to the chunk which currently has the least amount + * of chunks assigned to it */ - if (chunk_entry.io_size > max_io_size) { - max_io_size = chunk_entry.io_size; + if (num_assigned_chunks_array[chunk_entry.owners.original_owner] < num_assigned_chunks_array[new_chunk_owner]) new_chunk_owner = chunk_entry.owners.original_owner; - } num_writers++; } while (++i < shared_chunks_info_array_num_entries && shared_chunks_info_array[i].chunk_states.chunk_current.offset == last_seen_addr); @@ -2762,6 +2760,8 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty shared_chunks_info_array[set_begin_index].owners.new_owner = new_chunk_owner; shared_chunks_info_array[set_begin_index].num_writers = num_writers; } /* end for */ + + num_assigned_chunks_array[new_chunk_owner]++; } /* end for */ /* Sort the new list in order of previous owner so that each original owner of a chunk @@ -2925,6 +2925,8 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "couldn't release selection iterator") if (mem_iter) H5MM_free(mem_iter); + if (num_assigned_chunks_array) + H5MM_free(num_assigned_chunks_array); if (shared_chunks_info_array) H5MM_free(shared_chunks_info_array); -- cgit v0.12 From 7608b264e4a0325589ba6300ca9666ce83d88b37 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 May 2017 12:36:02 -0500 Subject: Make test scripts fail if result files are created --- tools/test/h5copy/testh5copy.sh.in | 2 + tools/test/h5diff/h5diff_plugin.sh.in | 2 + tools/test/h5diff/testh5diff.sh.in | 2 + tools/test/h5dump/h5dump_plugin.sh.in | 2 + tools/test/h5dump/testh5dump.sh.in | 46 +++- tools/test/h5dump/testh5dumppbits.sh.in | 22 +- tools/test/h5dump/testh5dumpvds.sh.in | 8 + tools/test/h5dump/testh5dumpxml.sh.in | 14 +- tools/test/h5jam/testh5jam.sh.in | 438 ++++++++++++++++---------------- tools/test/h5ls/h5ls_plugin.sh.in | 30 ++- tools/test/h5ls/testh5ls.sh.in | 36 +-- tools/test/h5ls/testh5lsvds.sh.in | 34 +-- tools/test/h5repack/h5repack.sh.in | 38 +-- tools/test/h5stat/testh5stat.sh.in | 60 ++--- tools/test/misc/testh5mkgrp.sh.in | 32 ++- 15 files changed, 418 insertions(+), 348 deletions(-) diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in index ace3981..203bfef 100644 --- a/tools/test/h5copy/testh5copy.sh.in +++ b/tools/test/h5copy/testh5copy.sh.in @@ -381,6 +381,8 @@ CMP_OUTPUT() # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else diff --git a/tools/test/h5diff/h5diff_plugin.sh.in b/tools/test/h5diff/h5diff_plugin.sh.in index 0390c40..212f5d6 100644 --- a/tools/test/h5diff/h5diff_plugin.sh.in +++ b/tools/test/h5diff/h5diff_plugin.sh.in @@ -242,6 +242,8 @@ TOOLTEST() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" elif test $h5haveexitcode = 'yes' -a -z "$pmode"; then diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 86658e2..d769c23 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -502,6 +502,8 @@ TOOLTEST() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" elif test $h5haveexitcode = 'yes' -a -z "$pmode"; then diff --git a/tools/test/h5dump/h5dump_plugin.sh.in b/tools/test/h5dump/h5dump_plugin.sh.in index e7ac564..6a00a16 100644 --- a/tools/test/h5dump/h5dump_plugin.sh.in +++ b/tools/test/h5dump/h5dump_plugin.sh.in @@ -196,6 +196,8 @@ TOOLTEST() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual > /dev/null 2>&1 ; then echo " PASSED" else diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index cf5f246..d6eab4e 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -487,6 +487,8 @@ TOOLTEST() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $xCMP $expect $actual > /dev/null 2>&1 ; then echo " PASSED" else @@ -529,11 +531,15 @@ TOOLTEST2() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if [ ! -f $expectdata ]; then # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expectdata $actualdata; then echo " PASSED" else @@ -584,16 +590,22 @@ TOOLTEST2A() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if [ ! -f $expectdata ]; then # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" elif $DIFF $expectdata $actualdata; then if [ ! -f $expectmeta ]; then # Create the expect meta file if it doesn't yet exist. echo " CREATED" cp $actualmeta $expectmeta + echo " Expected metafile (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expectmeta $actualmeta; then echo " PASSED" else @@ -645,6 +657,8 @@ TOOLTEST2B() { # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expectdata $actualdata; then echo " PASSED" else @@ -700,6 +714,8 @@ TOOLTEST3() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -757,15 +773,17 @@ TOOLTEST4() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if $CMP $expect_err $actual_ext; then echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else echo "*FAILED*" echo " Expected result (*.ddl) differs from actual result (*.out)" @@ -821,15 +839,17 @@ TOOLTEST5() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if $CMP $expect_err $actual_ext; then echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else echo "*FAILED*" echo " Expected result (*.ddl) differs from actual result (*.out)" @@ -863,6 +883,8 @@ TOOLTEST_HELP() { # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actual $expect-CREATED + echo " Expected output (*.txt) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else diff --git a/tools/test/h5dump/testh5dumppbits.sh.in b/tools/test/h5dump/testh5dumppbits.sh.in index 3b9b078..9cf5c99 100644 --- a/tools/test/h5dump/testh5dumppbits.sh.in +++ b/tools/test/h5dump/testh5dumppbits.sh.in @@ -241,6 +241,8 @@ TOOLTEST() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -282,11 +284,15 @@ TOOLTEST2() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if [ ! -f $expectdata ]; then # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expectdata $actualdata; then echo " PASSED" else @@ -348,6 +354,8 @@ TOOLTEST3() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -404,15 +412,17 @@ TOOLTEST4() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if $CMP $expect_err $actual_ext; then echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else echo "*FAILED*" echo " Expected result (*.ddl) differs from actual result (*.out)" diff --git a/tools/test/h5dump/testh5dumpvds.sh.in b/tools/test/h5dump/testh5dumpvds.sh.in index 63c0d85..f89234e 100644 --- a/tools/test/h5dump/testh5dumpvds.sh.in +++ b/tools/test/h5dump/testh5dumpvds.sh.in @@ -220,6 +220,8 @@ TOOLTEST() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -261,11 +263,15 @@ TOOLTEST2() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then if [ ! -f $expectdata ]; then # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expectdata $actualdata; then echo " PASSED" else @@ -327,6 +333,8 @@ TOOLTEST3() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index 5a69845..a33f5bc 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -202,10 +202,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 @@ -263,7 +263,9 @@ TOOLTEST() { if [ ! -f $expect ]; then # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actual $expect + cp $actual $expect + echo " Expected result (*.xml) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -279,7 +281,7 @@ TOOLTEST() { fi } -# Print a "SKIP" message +# Print a "SKIP" message SKIP() { TESTING $DUMPER $@ echo " -SKIP-" @@ -345,7 +347,7 @@ TOOLTEST tsaf.h5.xml --xml tsaf.h5 TOOLTEST tempty.h5.xml --xml tempty.h5 TOOLTEST tnamed_dtype_attr.h5.xml --xml tnamed_dtype_attr.h5 ##Test dataset and attribute of null space. Commented out: -## wait until the XML schema is updated for null space. +## wait until the XML schema is updated for null space. ##TOOLTEST tnullspace.h5.xml --xml tnulspace.h5 # other options for xml @@ -356,7 +358,7 @@ TOOLTEST tempty-nons.h5.xml --xml -X ":" tempty.h5 TOOLTEST tempty-nons-2.h5.xml --xml --xml-ns=":" tempty.h5 ## Some of these combinations are syntactically correct but -## the URLs are dummies +## the URLs are dummies TOOLTEST tempty-ns.h5.xml --xml -X "thing:" tempty.h5 TOOLTEST tempty-ns-2.h5.xml --xml --xml-ns="thing:" tempty.h5 TOOLTEST tempty-nons-uri.h5.xml --xml --xml-ns=":" --xml-dtd="http://somewhere.net" tempty.h5 diff --git a/tools/test/h5jam/testh5jam.sh.in b/tools/test/h5jam/testh5jam.sh.in index d3d7a9a..3ae180b 100644 --- a/tools/test/h5jam/testh5jam.sh.in +++ b/tools/test/h5jam/testh5jam.sh.in @@ -107,10 +107,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 @@ -154,19 +154,19 @@ SKIP() { echo " -SKIP-" } -# +# # COMPARE_FILES a.h5 b.h5 -# Compare two files, skipping the first line. This is used to +# Compare two files, skipping the first line. This is used to # compare the output of the dumper, skipping the file name which # is different. # The result is stored in 'compval'. # cmpval=0; COMPARE_FILES() { - $AWK 'NR > 1' $1 > $1.cmp - $AWK 'NR > 1' $2 > $2.cmp - $CMP $1.cmp $2.cmp - cmpval=$? + $AWK 'NR > 1' $1 > $1.cmp + $AWK 'NR > 1' $2 > $2.cmp + $CMP $1.cmp $2.cmp + cmpval=$? rm -f $1.cmp $2.cmp } @@ -174,10 +174,10 @@ COMPARE_FILES() { # Clean up named files. CLEANUP() { if test -z "$HDF5_NOCLEANUP"; then - for i in $* - do - rm -f $i - done + for i in $* + do + rm -f $i + done fi } @@ -190,7 +190,7 @@ CLEANUP() { # the "cat" command. # SETUP() { - cat < $1 > $2 + cat < $1 > $2 } # @@ -233,7 +233,7 @@ CHECKFILE() { } # -# CHECK_UB file.h5 user_block_file origfile.h5 +# CHECK_UB file.h5 user_block_file origfile.h5 # # Check the user block in 'file.h5' is the same as # 'user_block' (allowing for padding). @@ -243,73 +243,73 @@ CHECKFILE() { # and the test file compared to: # cat compare_ub user_block_file. # -# This test uses './getub' to extract the user block from +# This test uses './getub' to extract the user block from # 'file.h5', which is compared to the file described above. # # The result is set in variable 'result1'. # result1=0; CHECK_UB_1() { - hfile="$1" - ufile="$2" - - # check for third argument (the original file) - origfile=""; - if [ -n "$3" ]; - then - origfile="$3" - fi - - # find the length of the user block to check - s1=`cat $ufile | wc -c | sed -e 's/ //g'` - if [ "$s1" = "0" ]; - then - echo "File "$ufile" is empty" - result1=1; - fi - - # Get the size of the original user block, if any. - if [ -n "$origfile" ]; - then - # 'tellub' calls H5Fget_user_block to get the size - # of the user block - s2=`$JAM_BIN/tellub $origfile` - if [ "$s2" = "0" ]; - then - size=$s1; - cmpfile=$ufile - else - cmpfile="tt2" - size=`expr $s2 + $s1` - $JAM_BIN/getub -c $s2 $origfile > $cmpfile - cat $ufile >> $cmpfile - fi - else - # assume no user block - s2="0" - size=$s1; - cmpfile=$ufile - fi - - # Extract 'size' bytes from the front of 'hfile' - # Compare to 'cmpfile', result is set in result1 - tfile="tt1" - $JAM_BIN/getub -c $size $hfile > $tfile - res=`cmp $cmpfile $tfile` - if [ "$?" != "0" ]; - then - echo $res - result1=1; - else - result1=0; - fi - - # clean up - rm -f $tfile - if [ "$s2" != "0" ] ; - then - rm -f $cmpfile - fi + hfile="$1" + ufile="$2" + + # check for third argument (the original file) + origfile=""; + if [ -n "$3" ]; + then + origfile="$3" + fi + + # find the length of the user block to check + s1=`cat $ufile | wc -c | sed -e 's/ //g'` + if [ "$s1" = "0" ]; + then + echo "File "$ufile" is empty" + result1=1; + fi + + # Get the size of the original user block, if any. + if [ -n "$origfile" ]; + then + # 'tellub' calls H5Fget_user_block to get the size + # of the user block + s2=`$JAM_BIN/tellub $origfile` + if [ "$s2" = "0" ]; + then + size=$s1; + cmpfile=$ufile + else + cmpfile="tt2" + size=`expr $s2 + $s1` + $JAM_BIN/getub -c $s2 $origfile > $cmpfile + cat $ufile >> $cmpfile + fi + else + # assume no user block + s2="0" + size=$s1; + cmpfile=$ufile + fi + + # Extract 'size' bytes from the front of 'hfile' + # Compare to 'cmpfile', result is set in result1 + tfile="tt1" + $JAM_BIN/getub -c $size $hfile > $tfile + res=`cmp $cmpfile $tfile` + if [ "$?" != "0" ]; + then + echo $res + result1=1; + else + result1=0; + fi + + # clean up + rm -f $tfile + if [ "$s2" != "0" ] ; + then + rm -f $cmpfile + fi } @@ -321,25 +321,25 @@ CHECK_UB_1() { result2=0; CHECK_NOUB() { - hfile="$1" - - # call 'ubsize' to get the size of the user block - ubsize=`$JAM_BIN/tellub $hfile` - - if [ "$?" != "0" ]; - then - # error - result2=1; - else - if [ "$ubsize" = "0" ]; - then - # pass - result2=0; - else - # fail - result2=1; - fi - fi + hfile="$1" + + # call 'ubsize' to get the size of the user block + ubsize=`$JAM_BIN/tellub $hfile` + + if [ "$?" != "0" ]; + then + # error + result2=1; + else + if [ "$ubsize" = "0" ]; + then + # pass + result2=0; + else + # fail + result2=1; + fi + fi } # JAMTEST user_block file.h5 [--clobber] [ofile.h5] @@ -351,119 +351,119 @@ CHECK_NOUB() { # 3. check the user block is correct in the output (Check_UB) # If the user block is correct, print "PASSED", else "*FAILED*" JAMTEST() { - ufile="$1" - ifile="$2" - compare_test="" # the file to test - compare_orig="" # the comparison to test against - cleanup="" - - # sort out the arguments for the test and the check - do_clobber="no" - if [ "$3" = "--clobber" ]; - then - # clobber overwrites any existing user block - do_clobber="yes" - clobber="--clobber" - compare_orig="" - if [ -z "$4" ]; - then - # output goes to infile, compare ubfile to infile - ofile="" - compare_test="$ifile" - else - # output goes to $4, compare ofile to ubfile - ofile="$4" - compare_test="$ofile" - fi - else - clobber="" - # add user block to existing ub, if any - if [ -z "$3" ]; - then - # output goes to infile, compare ubfile to infile - ofile="" - compare_test="$ifile" - cp $ifile xxofile.h5 - compare_orig="xxofile.h5" - cleanup="$cleanup $compare_orig" - else - # output goes to $3, compare ofile to ubfile - ofile="$3" - compare_test="$ofile" - compare_orig="$ifile" - fi - fi - - # call 'jam' with the appropriate arguments - if [ -n "$ofile" ]; - then - TESTING h5jam -u `basename $ufile` -i `basename $ifile` -o `basename $ofile` $clobber - $JAM_BIN/$JAM -u $ufile -i $ifile -o $ofile $clobber - else - TESTING jam -u `basename $ufile` -i `basename $ifile` $clobber - $JAM_BIN/$JAM -u $ufile -i $ifile $clobber - fi - - #echo "CHECK_UB_1 $compare_test $ufile $compare_orig" - CHECK_UB_1 $compare_test $ufile $compare_orig - - if [ "$result1" = "0" ] ; - then - echo " PASSED" - else - echo " *FAILED*" - nerrors="`expr $nerrors + 1`" - fi - CLEANUP $cleanup + ufile="$1" + ifile="$2" + compare_test="" # the file to test + compare_orig="" # the comparison to test against + cleanup="" + + # sort out the arguments for the test and the check + do_clobber="no" + if [ "$3" = "--clobber" ]; + then + # clobber overwrites any existing user block + do_clobber="yes" + clobber="--clobber" + compare_orig="" + if [ -z "$4" ]; + then + # output goes to infile, compare ubfile to infile + ofile="" + compare_test="$ifile" + else + # output goes to $4, compare ofile to ubfile + ofile="$4" + compare_test="$ofile" + fi + else + clobber="" + # add user block to existing ub, if any + if [ -z "$3" ]; + then + # output goes to infile, compare ubfile to infile + ofile="" + compare_test="$ifile" + cp $ifile xxofile.h5 + compare_orig="xxofile.h5" + cleanup="$cleanup $compare_orig" + else + # output goes to $3, compare ofile to ubfile + ofile="$3" + compare_test="$ofile" + compare_orig="$ifile" + fi + fi + + # call 'jam' with the appropriate arguments + if [ -n "$ofile" ]; + then + TESTING h5jam -u `basename $ufile` -i `basename $ifile` -o `basename $ofile` $clobber + $JAM_BIN/$JAM -u $ufile -i $ifile -o $ofile $clobber + else + TESTING jam -u `basename $ufile` -i `basename $ifile` $clobber + $JAM_BIN/$JAM -u $ufile -i $ifile $clobber + fi + + #echo "CHECK_UB_1 $compare_test $ufile $compare_orig" + CHECK_UB_1 $compare_test $ufile $compare_orig + + if [ "$result1" = "0" ] ; + then + echo " PASSED" + else + echo " *FAILED*" + nerrors="`expr $nerrors + 1`" + fi + CLEANUP $cleanup } - + # UNJAMTEST file.h5 [- | --delete] ofile # # Test the 'unjam' tool # ###fix the working directory here and in jamtest UNJAMTEST () { - infile="$1" - ofile="$3" - if [ "$2" = "-" ]; - then - uofile="uofile" - TESTING h5unjam -i `basename $infile` -o `basename $ofile` "> "`basename $uofile` - $JAM_BIN/$UNJAM -i $infile -o $ofile > $uofile - else - if [ "$2" = "--delete" ]; - then - uofile="none" - TESTING h5unjam -i `basename $infile` -o `basename $ofile` --delete - $JAM_BIN/$UNJAM -i $infile -o $ofile --delete - - else - uofile="$2" - TESTING h5unjam -i `basename $infile` -u `basename $uofile` -o `basename $ofile` - $JAM_BIN/$UNJAM -i $infile -u $uofile -o $ofile - fi - fi - - result1=0 - result2=0 - cleanup="" - if [ "$uofile" != "none" ]; - then - # sets result1 - CHECK_UB_1 $infile $uofile - CLEANUP $uofile - fi - - # sets result2 - CHECK_NOUB $ofile - - if [ "$result1" = "0" -a "$result2" = "0" ]; - then - echo " PASSED" - else - echo " *FAILED*" - nerrors="`expr $nerrors + 1`" - fi + infile="$1" + ofile="$3" + if [ "$2" = "-" ]; + then + uofile="uofile" + TESTING h5unjam -i `basename $infile` -o `basename $ofile` "> "`basename $uofile` + $JAM_BIN/$UNJAM -i $infile -o $ofile > $uofile + else + if [ "$2" = "--delete" ]; + then + uofile="none" + TESTING h5unjam -i `basename $infile` -o `basename $ofile` --delete + $JAM_BIN/$UNJAM -i $infile -o $ofile --delete + + else + uofile="$2" + TESTING h5unjam -i `basename $infile` -u `basename $uofile` -o `basename $ofile` + $JAM_BIN/$UNJAM -i $infile -u $uofile -o $ofile + fi + fi + + result1=0 + result2=0 + cleanup="" + if [ "$uofile" != "none" ]; + then + # sets result1 + CHECK_UB_1 $infile $uofile + CLEANUP $uofile + fi + + # sets result2 + CHECK_NOUB $ofile + + if [ "$result1" = "0" -a "$result2" = "0" ]; + then + echo " PASSED" + else + echo " *FAILED*" + nerrors="`expr $nerrors + 1`" + fi } @@ -500,28 +500,30 @@ TOOLTEST_OUTPUT() { STDOUT_FILTER $actual cp $actual_err $actual_err_sav STDERR_FILTER $actual_err - # combine stderr to stdout for output compare + # combine stderr to stdout for output compare cat $actual_err >> $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect - rm -f $actual $actual_sav $actual_err $actual_err_sav + echo " Expected result (*.ls) missing" + nerrors="`expr $nerrors + 1`" + rm -f $actual $actual_sav $actual_err $actual_err_sav elif $CMP $expect $actual; then echo " PASSED" - rm -f $actual $actual_sav $actual_err $actual_err_sav + rm -f $actual $actual_sav $actual_err $actual_err_sav else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test @@ -550,19 +552,19 @@ CHECKFILE $TESTDIR/tall.h5 ta5.h5 CLEANUP ta5.h5 SETUP $TESTDIR/tall.h5 ta6.h5 -JAMTEST $TESTDIR/u10.txt ta6.h5 +JAMTEST $TESTDIR/u10.txt ta6.h5 CHECKFILE $TESTDIR/tall.h5 ta6.h5 CLEANUP ta6.h5 SETUP $TESTDIR/tall.h5 ta7.h5 -JAMTEST $TESTDIR/u511.txt ta7.h5 +JAMTEST $TESTDIR/u511.txt ta7.h5 CHECKFILE $TESTDIR/tall.h5 ta7.h5 CLEANUP ta7.h5 SETUP $TESTDIR/tall.h5 ta8.h5 -JAMTEST $TESTDIR/u512.txt ta8.h5 +JAMTEST $TESTDIR/u512.txt ta8.h5 CHECKFILE $TESTDIR/tall.h5 ta8.h5 CLEANUP ta8.h5 SETUP $TESTDIR/tall.h5 ta9.h5 -JAMTEST $TESTDIR/u513.txt ta9.h5 +JAMTEST $TESTDIR/u513.txt ta9.h5 CHECKFILE $TESTDIR/tall.h5 ta9.h5 CLEANUP ta9.h5 @@ -592,29 +594,29 @@ JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub513.h5 tax9.h5 CHECKFILE $TESTDIR/tall.h5 tax9.h5 CLEANUP tax9.h5 -JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub.h5 --clobber taz2.h5 +JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub.h5 --clobber taz2.h5 CHECKFILE $TESTDIR/tall.h5 taz2.h5 CLEANUP taz2.h5 JAMTEST $TESTDIR/u511.txt $TESTDIR/twithub.h5 --clobber taz3.h5 CHECKFILE $TESTDIR/tall.h5 taz3.h5 CLEANUP taz3.h5 -JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub.h5 --clobber taz4.h5 +JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub.h5 --clobber taz4.h5 CHECKFILE $TESTDIR/tall.h5 taz4.h5 CLEANUP taz4.h5 -JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub.h5 --clobber taz5.h5 +JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub.h5 --clobber taz5.h5 CHECKFILE $TESTDIR/tall.h5 taz5.h5 CLEANUP taz5.h5 -JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub513.h5 --clobber taz6.h5 +JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub513.h5 --clobber taz6.h5 CHECKFILE $TESTDIR/tall.h5 taz6.h5 CLEANUP taz6.h5 JAMTEST $TESTDIR/u511.txt $TESTDIR/twithub513.h5 --clobber taz7.h5 CHECKFILE $TESTDIR/tall.h5 taz7.h5 CLEANUP taz7.h5 -JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub513.h5 --clobber taz8.h5 +JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub513.h5 --clobber taz8.h5 CHECKFILE $TESTDIR/tall.h5 taz8.h5 CLEANUP taz8.h5 -JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub513.h5 --clobber taz9.h5 +JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub513.h5 --clobber taz9.h5 CHECKFILE $TESTDIR/tall.h5 taz9.h5 CLEANUP taz9.h5 @@ -653,7 +655,7 @@ CHECKFILE $TESTDIR/tall.h5 tay9.h5 CLEANUP tay9.h5 #--------------------------------- -# Testing h5unjam +# Testing h5unjam #--------------------------------- # help page TOOLTEST_OUTPUT UNJAM h5unjam-help.txt 0 -h diff --git a/tools/test/h5ls/h5ls_plugin.sh.in b/tools/test/h5ls/h5ls_plugin.sh.in index 34114d8..c89269d 100644 --- a/tools/test/h5ls/h5ls_plugin.sh.in +++ b/tools/test/h5ls/h5ls_plugin.sh.in @@ -184,7 +184,7 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $ENVCMD $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err @@ -196,31 +196,33 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ls) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } diff --git a/tools/test/h5ls/testh5ls.sh.in b/tools/test/h5ls/testh5ls.sh.in index 31877d9..a88ae88 100644 --- a/tools/test/h5ls/testh5ls.sh.in +++ b/tools/test/h5ls/testh5ls.sh.in @@ -181,7 +181,7 @@ 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 ." @@ -239,7 +239,7 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err @@ -251,37 +251,39 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ls) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test diff --git a/tools/test/h5ls/testh5lsvds.sh.in b/tools/test/h5ls/testh5lsvds.sh.in index ddb1632..eb44367 100644 --- a/tools/test/h5ls/testh5lsvds.sh.in +++ b/tools/test/h5ls/testh5lsvds.sh.in @@ -187,7 +187,7 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err @@ -199,37 +199,39 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ls) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index c943b22..08f670b 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -177,7 +177,7 @@ 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 ." @@ -373,6 +373,8 @@ VERIFY_LAYOUT_VDS() # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual > /dev/null 2>&1 ; then echo " PASSED" else @@ -384,7 +386,7 @@ VERIFY_LAYOUT_VDS() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi # clean up tmp files @@ -539,11 +541,11 @@ TOOLTEST1() ) RET=$? if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" - DIFFTEST $infile $outfile + echo " PASSED" + DIFFTEST $infile $outfile fi rm -f $outfile } @@ -570,11 +572,11 @@ TOOLTESTV() ) >$actual 2>$actual_err RET=$? if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" - DIFFTEST $infile $outfile + echo " PASSED" + DIFFTEST $infile $outfile fi # display output compare @@ -635,6 +637,8 @@ TOOLTESTM() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect + echo " Expected result (*.tst) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -646,7 +650,7 @@ TOOLTESTM() { # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -760,11 +764,11 @@ TOOLTEST_META() # verify sizes. MESSAGE "Verify the sizes of both output files ($size1 vs $size2)" if [ $size1 -lt $size2 ]; then - # pass - echo " PASSED" + # pass + echo " PASSED" else - #fail - echo "*FAILED*" + #fail + echo "*FAILED*" nerrors="`expr $nerrors + 1`" fi @@ -791,6 +795,8 @@ TOOLTEST_HELP() { # Create the expect data file if it doesn't yet exist. echo " CREATED" cp $actual $expect-CREATED + echo " Expected result (*.txt) missing" + nerrors="`expr $nerrors + 1`" elif cmp -s $expect $actual; then echo " PASSED" else @@ -838,7 +844,7 @@ USE_FILTER_SZIP_ENCODER=`$RUNSERIAL $H5DETECTSZIP_BIN` fi ############################################################################## -### T H E T E S T S +### T H E T E S T S ############################################################################## # prepare for test COPY_TESTFILES_TO_TESTDIR diff --git a/tools/test/h5stat/testh5stat.sh.in b/tools/test/h5stat/testh5stat.sh.in index c4a52c3..ca7ca4c 100644 --- a/tools/test/h5stat/testh5stat.sh.in +++ b/tools/test/h5stat/testh5stat.sh.in @@ -14,8 +14,8 @@ # Tests for the h5stat tool # # Modifcations: -# Vailin Choi; July 2013 -# Add tests for -l, -m, -a options +# Vailin Choi; July 2013 +# Add tests for -l, -m, -a options # srcdir=@srcdir@ @@ -132,10 +132,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 @@ -199,9 +199,11 @@ TOOLTEST() { cat $actual_err >> $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -220,15 +222,15 @@ TOOLTEST() { # Print a "SKIP" message SKIP() { - TESTING $STAT $@ - echo " -SKIP-" + TESTING $STAT $@ + echo " -SKIP-" } - + ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test @@ -252,7 +254,7 @@ TOOLTEST h5stat_filters-dT.ddl -dT h5stat_filters.h5 TOOLTEST h5stat_filters-UD.ddl -D h5stat_filters.h5 TOOLTEST h5stat_filters-UT.ddl -T h5stat_filters.h5 # -# h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c +# h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c # as of release 1.8.7-snap0 (on a 64-bit machine) TOOLTEST h5stat_tsohm.ddl h5stat_tsohm.h5 # h5stat_newgrat.h5 is generated by h5stat_gentest.c @@ -262,36 +264,36 @@ TOOLTEST h5stat_newgrat-UA.ddl -A h5stat_newgrat.h5 # h5stat_idx.h5 is generated by h5stat_gentest.c TOOLTEST h5stat_idx.ddl h5stat_idx.h5 # -# Tests for -l (--links) option on h5stat_threshold.h5: -# -l 0 (incorrect threshold value) -# -g -l 8 -# --links=8 -# --links=20 -g +# Tests for -l (--links) option on h5stat_threshold.h5: +# -l 0 (incorrect threshold value) +# -g -l 8 +# --links=8 +# --links=20 -g TOOLTEST h5stat_err1_links.ddl -l 0 h5stat_threshold.h5 TOOLTEST h5stat_links1.ddl -g -l 8 h5stat_threshold.h5 TOOLTEST h5stat_links2.ddl --links=8 h5stat_threshold.h5 TOOLTEST h5stat_links3.ddl --links=20 -g h5stat_threshold.h5 # -# Tests for -l (--links) option on h5stat_newgrat.h5: -# -g -# -g -l 40000 +# Tests for -l (--links) option on h5stat_newgrat.h5: +# -g +# -g -l 40000 TOOLTEST h5stat_links4.ddl -g h5stat_newgrat.h5 TOOLTEST h5stat_links5.ddl -g -l 40000 h5stat_newgrat.h5 # # Tests for -m (--dims) option on h5stat_threshold.h5 -# -d --dims=-1 (incorrect threshold value) -# -gd -m 5 -# -d --di=15 +# -d --dims=-1 (incorrect threshold value) +# -gd -m 5 +# -d --di=15 TOOLTEST h5stat_err1_dims.ddl -d --dims=-1 h5stat_threshold.h5 TOOLTEST h5stat_dims1.ddl -gd -m 5 h5stat_threshold.h5 TOOLTEST h5stat_dims2.ddl -d --di=15 h5stat_threshold.h5 # # Tests for -a option on h5stat_threshold.h5 -# -a -2 (incorrect threshold value) -# --numattrs (without threshold value) -# -AS -a 10 -# -a 1 -# -A --numattrs=25 +# -a -2 (incorrect threshold value) +# --numattrs (without threshold value) +# -AS -a 10 +# -a 1 +# -A --numattrs=25 TOOLTEST h5stat_err1_numattrs.ddl -a -2 h5stat_threshold.h5 TOOLTEST h5stat_err2_numattrs.ddl --numattrs h5stat_threshold.h5 TOOLTEST h5stat_numattrs1.ddl -AS -a 10 h5stat_threshold.h5 @@ -299,7 +301,7 @@ TOOLTEST h5stat_numattrs2.ddl -a 1 h5stat_threshold.h5 TOOLTEST h5stat_numattrs3.ddl -A --numattrs=25 h5stat_threshold.h5 # # Tests for -a option on h5stat_newgrat.h5 -# -A -a 100 +# -A -a 100 TOOLTEST h5stat_numattrs4.ddl -A -a 100 h5stat_newgrat.h5 # diff --git a/tools/test/misc/testh5mkgrp.sh.in b/tools/test/misc/testh5mkgrp.sh.in index 3990bd2..3ad1f71 100644 --- a/tools/test/misc/testh5mkgrp.sh.in +++ b/tools/test/misc/testh5mkgrp.sh.in @@ -98,7 +98,7 @@ COPY_TESTFILES_TO_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 @@ -122,7 +122,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". -TESTING() +TESTING() { SPACES=" " echo "Testing $* $SPACES" |cut -c1-70 |tr -d '\012' @@ -134,7 +134,7 @@ TESTING() # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # -VERIFY_H5LS() +VERIFY_H5LS() { SPACES=" " echo "Verifying h5ls file structure $* $SPACES" | cut -c1-70 | tr -d '\012' @@ -146,7 +146,7 @@ VERIFY_H5LS() # Assumed arguments: # $* arguments for h5mkgrp. -TOOLTEST() +TOOLTEST() { TESTING $H5MKGRP $@ ( @@ -171,7 +171,7 @@ TOOLTEST() # Call the h5ls tool to verify the correct output data in the destination file # -H5LSTEST() +H5LSTEST() { expect="$TESTDIR/`basename $1 .h5`.ls" actual="$TESTDIR/`basename $1 .h5`.out" @@ -191,9 +191,11 @@ H5LSTEST() STDERR_FILTER $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ls) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -215,7 +217,7 @@ H5LSTEST() # $1 is test file name # $2 is h5mkgrp options # $* are groups to create -RUNTEST() +RUNTEST() { FILEOUT=$1 shift @@ -244,7 +246,7 @@ RUNTEST() # $1 is test expected output file # $2 is h5mkgrp options # $* are groups to create -CMPTEST() +CMPTEST() { FILEOUT=$1 expect="$TESTDIR/`basename $1 .h5`.txt" @@ -260,11 +262,13 @@ CMPTEST() $RUNSERIAL $H5MKGRP_BIN $@ ) >$actual 2>$actual_err cat $actual_err >> $actual - + if [ ! -f $expect ]; then # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect + echo " CREATED" + cp $actual $expect + echo " Expected result (*.txt) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then echo " PASSED" else @@ -302,7 +306,7 @@ RUNTEST h5mkgrp_several_v.h5 "-v" one two RUNTEST h5mkgrp_several_p.h5 "-p" one two RUNTEST h5mkgrp_several_l.h5 "-l" one two -# Create various nested groups +# Create various nested groups RUNTEST h5mkgrp_nested_p.h5 "-p" /one/two RUNTEST h5mkgrp_nested_lp.h5 "-lp" /one/two RUNTEST h5mkgrp_nested_mult_p.h5 "-p" /one/two /three/four -- cgit v0.12 From bcaf579ac4f0dba23b58c80a693ca40e5909b321 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 May 2017 15:54:40 -0500 Subject: Add test file to list and fix test typo --- tools/test/h5dump/testh5dump.sh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index d6eab4e..acd7e28 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -97,6 +97,7 @@ $SRC_H5DUMP_TESTFILES/tattrintsize.h5 $SRC_H5DUMP_TESTFILES/tattrreg.h5 $SRC_H5DUMP_TESTFILES/tbigdims.h5 $SRC_H5DUMP_TESTFILES/tbinary.h5 +$SRC_H5DUMP_TESTFILES/tbitopaque.h5 $SRC_H5DUMP_TESTFILES/tchar.h5 $SRC_H5DUMP_TESTFILES/tcmpdattrintsize.h5 $SRC_H5DUMP_TESTFILES/tcmpdintsize.h5 @@ -217,6 +218,7 @@ $SRC_H5DUMP_TESTFILES/tbin3.ddl $SRC_H5DUMP_TESTFILES/tbin4.ddl $SRC_H5DUMP_TESTFILES/tbinregR.ddl $SRC_H5DUMP_TESTFILES/tbigdims.ddl +$SRC_H5DUMP_TESTFILES/tbitopaque.ddl $SRC_H5DUMP_TESTFILES/tboot1.ddl $SRC_H5DUMP_TESTFILES/tboot2.ddl $SRC_H5DUMP_TESTFILES/tboot2A.ddl @@ -1058,7 +1060,7 @@ TOOLTEST tcomp-2.ddl --enable-error-stack -N /type1 --any_path /type2 --any_path TOOLTEST4 tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5 # test complicated compound datatype TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5 -TOOLTEST tcompound_complex.ddl --enable-error-stack tcompound_complex2.h5 +TOOLTEST tcompound_complex2.ddl --enable-error-stack tcompound_complex2.h5 # tests for bitfields and opaque data types TOOLTEST tbitnopaque.ddl --enable-error-stack tbitnopaque.h5 -- cgit v0.12 From 006e56802196ee6a43261aec7027815ad24ad3db Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 May 2017 11:41:47 -0500 Subject: Remove duplicate defines --- tools/test/perform/pio_standalone.h | 9 --------- tools/test/perform/sio_standalone.h | 9 --------- 2 files changed, 18 deletions(-) diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h index 66ca05a..a40cff8 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -189,15 +189,6 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDoff_t off_t #endif -#ifndef H5_HAVE_WIN32_API -/* These definitions differ in Windows and are defined in - * H5win32defs for that platform. - */ -typedef struct stat h5_stat_t; -typedef off_t h5_stat_size_t; -#define HDoff_t off_t -#endif /* H5_HAVE_WIN32_API */ - #define HDftell(F) ftell(F) #define HDftruncate(F,L) ftruncate(F,L) #define HDfwrite(M,Z,N,F) fwrite(M,Z,N,F) diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index 8d6d110..e73a6b5 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -211,15 +211,6 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDoff_t off_t #endif -#ifndef H5_HAVE_WIN32_API -/* These definitions differ in Windows and are defined in - * H5win32defs for that platform. - */ -typedef struct stat h5_stat_t; -typedef off_t h5_stat_size_t; -#define HDoff_t off_t -#endif /* H5_HAVE_WIN32_API */ - #define HDftell(F) ftell(F) #define HDftruncate(F,L) ftruncate(F,L) #define HDfwrite(M,Z,N,F) fwrite(M,Z,N,F) -- cgit v0.12 From 412f68103ecc9e75a895dd057ad28d0e456f3a58 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 May 2017 13:31:48 -0500 Subject: Use correct var types for data --- tools/test/h5dump/h5dumpgentest.c | 37 +++++++++++++++++++------------------ tools/testfiles/tbitnopaque.ddl | 32 ++++++++++++++++---------------- tools/testfiles/tbitnopaque.h5 | Bin 8240 -> 8240 bytes 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 48bc27d..169eddb 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -9717,18 +9717,19 @@ static void gent_bitnopaquefields(void) /* Compound datatype */ typedef struct s_t { - unsigned char a; - unsigned int b; - unsigned long c; - unsigned long long d; + uint8_t a; + uint16_t b; + uint32_t c; + uint64_t d; } s_t; + hid_t file, grp=-1, type=-1, space=-1, dset=-1; size_t i; hsize_t nelmts = F80_DIM32; - unsigned char buf[F80_DIM32]; /* bitfield, opaque */ - unsigned int buf2[F80_DIM32]; /* bitfield, opaque */ - unsigned long buf3[F80_DIM32]; /* bitfield, opaque */ - unsigned long long buf4[F80_DIM32]; /* bitfield, opaque */ + uint8_t buf[F80_DIM32]; /* bitfield, opaque */ + uint16_t buf2[F80_DIM32]; /* bitfield, opaque */ + uint32_t buf3[F80_DIM32]; /* bitfield, opaque */ + uint64_t buf4[F80_DIM32]; /* bitfield, opaque */ s_t buf5[F80_DIM32]; /* compound */ file = H5Fcreate(FILE80, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -9739,7 +9740,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for (i = 0; i < nelmts; i++) { - buf[i] = (unsigned char)0xff ^ (unsigned char)i; + buf[i] = (uint8_t)0xff ^ (uint8_t)i; } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); H5Dclose(dset); @@ -9754,7 +9755,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for (i = 0; i < nelmts; i++) { - buf2[i] = (unsigned int)0xffff ^ (unsigned int)(i * 16); + buf2[i] = (uint16_t)0xffff ^ (uint16_t)(i * 16); } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2); H5Dclose(dset); @@ -9769,7 +9770,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "bitfield_3", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for (i = 0; i < nelmts; i++) { - buf3[i] = (unsigned long)0xffffffff ^ (unsigned long)(i * 32); + buf3[i] = (uint32_t)0xffffffff ^ (uint32_t)(i * 32); } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf3); H5Dclose(dset); @@ -9784,7 +9785,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "bitfield_4", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for (i = 0; i < nelmts; i++) { - buf4[i] = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64); + buf4[i] = (uint64_t)0xffffffffffffffff ^ (uint64_t)(i * 64); } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf4); H5Dclose(dset); @@ -9804,7 +9805,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "opaque_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for(i = 0; i < nelmts; i++) - buf[i] = (unsigned char)0xff ^ (unsigned char)i; + buf[i] = (uint8_t)0xff ^ (uint8_t)i; H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); H5Dclose(dset); } @@ -9820,7 +9821,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "opaque_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for(i = 0; i < nelmts; i++) - buf2[i] = (unsigned int)0xffff ^ (unsigned int)(i * 16); + buf2[i] = (uint16_t)0xffff ^ (uint16_t)(i * 16); H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2); H5Dclose(dset); @@ -9843,10 +9844,10 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for(i = 0; i < nelmts; i++) { - buf5[i].a = (unsigned char)0xff ^ (unsigned char)i; - buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16); - buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32); - buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64); + buf5[i].a = (uint8_t)0xff ^ (uint8_t)i; + buf5[i].b = (uint16_t)0xffff ^ (uint16_t)(i * 16); + buf5[i].c = (uint32_t)0xffffffff ^ (uint32_t)(i * 32); + buf5[i].d = (uint64_t)0xffffffffffffffff ^ (uint64_t)(i * 64); } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); diff --git a/tools/testfiles/tbitnopaque.ddl b/tools/testfiles/tbitnopaque.ddl index 9000463..0c59c0b 100644 --- a/tools/testfiles/tbitnopaque.ddl +++ b/tools/testfiles/tbitnopaque.ddl @@ -15,24 +15,24 @@ GROUP "/" { DATATYPE H5T_STD_B16LE DATASPACE SIMPLE { ( 32 ) / ( 32 ) } DATA { - (0): ff:ff, 00:00, ef:ff, 00:00, df:ff, 00:00, cf:ff, 00:00, bf:ff, - (9): 00:00, af:ff, 00:00, 9f:ff, 00:00, 8f:ff, 00:00, 7f:ff, 00:00, - (18): 6f:ff, 00:00, 5f:ff, 00:00, 4f:ff, 00:00, 3f:ff, 00:00, 2f:ff, - (27): 00:00, 1f:ff, 00:00, 0f:ff, 00:00 + (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, + (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, + (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, + (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe } } DATASET "bitfield_3" { DATATYPE H5T_STD_B32LE DATASPACE SIMPLE { ( 32 ) / ( 32 ) } DATA { - (0): ff:ff:ff:ff, 00:00:00:00, df:ff:ff:ff, 00:00:00:00, - (4): bf:ff:ff:ff, 00:00:00:00, 9f:ff:ff:ff, 00:00:00:00, - (8): 7f:ff:ff:ff, 00:00:00:00, 5f:ff:ff:ff, 00:00:00:00, - (12): 3f:ff:ff:ff, 00:00:00:00, 1f:ff:ff:ff, 00:00:00:00, - (16): ff:fe:ff:ff, 00:00:00:00, df:fe:ff:ff, 00:00:00:00, - (20): bf:fe:ff:ff, 00:00:00:00, 9f:fe:ff:ff, 00:00:00:00, - (24): 7f:fe:ff:ff, 00:00:00:00, 5f:fe:ff:ff, 00:00:00:00, - (28): 3f:fe:ff:ff, 00:00:00:00, 1f:fe:ff:ff, 00:00:00:00 + (0): ff:ff:ff:ff, df:ff:ff:ff, bf:ff:ff:ff, 9f:ff:ff:ff, + (4): 7f:ff:ff:ff, 5f:ff:ff:ff, 3f:ff:ff:ff, 1f:ff:ff:ff, + (8): ff:fe:ff:ff, df:fe:ff:ff, bf:fe:ff:ff, 9f:fe:ff:ff, + (12): 7f:fe:ff:ff, 5f:fe:ff:ff, 3f:fe:ff:ff, 1f:fe:ff:ff, + (16): ff:fd:ff:ff, df:fd:ff:ff, bf:fd:ff:ff, 9f:fd:ff:ff, + (20): 7f:fd:ff:ff, 5f:fd:ff:ff, 3f:fd:ff:ff, 1f:fd:ff:ff, + (24): ff:fc:ff:ff, df:fc:ff:ff, bf:fc:ff:ff, 9f:fc:ff:ff, + (28): 7f:fc:ff:ff, 5f:fc:ff:ff, 3f:fc:ff:ff, 1f:fc:ff:ff } } DATASET "bitfield_4" { @@ -282,10 +282,10 @@ GROUP "/" { } DATASPACE SIMPLE { ( 32 ) / ( 32 ) } DATA { - (0): ff:ff, 00:00, ef:ff, 00:00, df:ff, 00:00, cf:ff, 00:00, bf:ff, - (9): 00:00, af:ff, 00:00, 9f:ff, 00:00, 8f:ff, 00:00, 7f:ff, 00:00, - (18): 6f:ff, 00:00, 5f:ff, 00:00, 4f:ff, 00:00, 3f:ff, 00:00, 2f:ff, - (27): 00:00, 1f:ff, 00:00, 0f:ff, 00:00 + (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, + (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, + (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, + (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe } } } diff --git a/tools/testfiles/tbitnopaque.h5 b/tools/testfiles/tbitnopaque.h5 index 2b1f23d..089a86d 100644 Binary files a/tools/testfiles/tbitnopaque.h5 and b/tools/testfiles/tbitnopaque.h5 differ -- cgit v0.12 From c90f72a0d44ab53d16e0c7979363565dff30cf24 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 May 2017 16:42:22 -0500 Subject: Correct name of file to copy --- tools/test/h5dump/testh5dump.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index acd7e28..f652c9e 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -97,7 +97,7 @@ $SRC_H5DUMP_TESTFILES/tattrintsize.h5 $SRC_H5DUMP_TESTFILES/tattrreg.h5 $SRC_H5DUMP_TESTFILES/tbigdims.h5 $SRC_H5DUMP_TESTFILES/tbinary.h5 -$SRC_H5DUMP_TESTFILES/tbitopaque.h5 +$SRC_H5DUMP_TESTFILES/tbitnopaque.h5 $SRC_H5DUMP_TESTFILES/tchar.h5 $SRC_H5DUMP_TESTFILES/tcmpdattrintsize.h5 $SRC_H5DUMP_TESTFILES/tcmpdintsize.h5 -- cgit v0.12 From 9076e74d38f10d9d71a41ceeb118777468b6b530 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 5 May 2017 10:05:59 -0500 Subject: Fix name to copy --- tools/test/h5dump/testh5dump.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index f652c9e..7edaedd 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -218,7 +218,7 @@ $SRC_H5DUMP_TESTFILES/tbin3.ddl $SRC_H5DUMP_TESTFILES/tbin4.ddl $SRC_H5DUMP_TESTFILES/tbinregR.ddl $SRC_H5DUMP_TESTFILES/tbigdims.ddl -$SRC_H5DUMP_TESTFILES/tbitopaque.ddl +$SRC_H5DUMP_TESTFILES/tbitnopaque.ddl $SRC_H5DUMP_TESTFILES/tboot1.ddl $SRC_H5DUMP_TESTFILES/tboot2.ddl $SRC_H5DUMP_TESTFILES/tboot2A.ddl -- cgit v0.12 From e2ad2751dc0b72f6581cd3b41576a07211b62e9b Mon Sep 17 00:00:00 2001 From: lrknox Date: Thu, 4 May 2017 17:14:38 -0500 Subject: Update release_docs/HISTORY-1_10.txt and RELEASE.txt after HDF5 1.10.1 release. --- release_docs/HISTORY-1_10.txt | 734 ++++++++++++++++++++++++++++++++++++++++++ release_docs/RELEASE.txt | 391 ++++------------------ 2 files changed, 790 insertions(+), 335 deletions(-) diff --git a/release_docs/HISTORY-1_10.txt b/release_docs/HISTORY-1_10.txt index 03d0e3e..52eb273 100644 --- a/release_docs/HISTORY-1_10.txt +++ b/release_docs/HISTORY-1_10.txt @@ -3,11 +3,745 @@ HDF5 History This file contains development history of the HDF5 1.10 branch +03. Release Information for hdf5-1.10.1 02. Release Information for hdf5-1.10.0-patch1 01. Release Information for hdf5-1.10.0 [Search on the string '%%%%' for section breaks of each release.] +%%%%1.10.1%%%% + +HDF5 version 1.10.1 released on 2017-04-27 +================================================================================ + +INTRODUCTION + +This document describes the differences between HDF5-1.10.0-patch1 and +HDF5 1.10.1, and contains information on the platforms tested and known +problems in HDF5-1.10.1. For more details check the HISTORY*.txt files +in the HDF5 source. + +Links to HDF5 1.10.1 source code, documentation, and additional materials can +be found on The HDF5 web page at: + + https://support.hdfgroup.org/HDF5/ + +The HDF5 1.10.1 release can be obtained from: + + https://support.hdfgroup.org/HDF5/release/obtain5.html + +User documentation for the snapshot can be accessed directly at this location: + + https://support.hdfgroup.org/HDF5/doc/ + +New features in the HDF5-1.10.x release series, including brief general +descriptions of some new and modified APIs, are described in the "New Features +in HDF5 Release 1.10" document: + + https://support.hdfgroup.org/HDF5/docNewFeatures/index.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 10.1 (current +release) versus Release 1.10.0 + + https://support.hdfgroup.org/HDF5/doc/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS + +- Major New Features Introduced in HDF5 1.10.1 +- Other New Features and Enhancements +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.10.0-patch1 +- Supported Platforms +- Tested Configuration Features Summary +- More Tested Platforms +- Known Problems + + +Major New Features Introduced in HDF5 1.10.1 +============================================ + +For links to the RFCs and documentation in this section please view +https://support.hdfgroup.org/HDF5/docNewFeatures in a web browser. + +________________________________________ +Metadata Cache Image +________________________________________ + + HDF5 metadata is typically small, and scattered throughout the HDF5 file. + This can affect performance, particularly on large HPC systems. The + Metadata Cache Image feature can improve performance by writing the + metadata cache in a single block on file close, and then populating the + cache with the contents of this block on file open, thus avoiding the many + small I/O operations that would otherwise be required on file open and + close. See the RFC for complete details regarding this feature. Also, + see the Fine Tuning the Metadata Cache documentation. + + At present, metadata cache images may not be generated by parallel + applications. Parallel applications can read files with metadata cache + images, but since this is a collective operation, a deadlock is possible + if one or more processes do not participate. + +________________________________________ +Metadata Cache Evict on Close +________________________________________ + + The HDF5 library's metadata cache is fairly conservative about holding on + to HDF5 object metadata (object headers, chunk index structures, etc.), + which can cause the cache size to grow, resulting in memory pressure on + an application or system. The "evict on close" property will cause all + metadata for an object to be evicted from the cache as long as metadata + is not referenced from any other open object. See the Fine Tuning the + Metadata Cache documentation for information on the APIs. + + At present, evict on close is disabled in parallel builds. + +________________________________________ +Paged Aggregation +________________________________________ + + The current HDF5 file space allocation accumulates small pieces of metadata + and raw data in aggregator blocks which are not page aligned and vary + widely in sizes. The paged aggregation feature was implemented to provide + efficient paged access of these small pieces of metadata and raw data. + See the RFC for details. Also, see the File Space Management documentation. + +________________________________________ +Page Buffering +________________________________________ + + Small and random I/O accesses on parallel file systems result in poor + performance for applications. Page buffering in conjunction with paged + aggregation can improve performance by giving an application control of + minimizing HDF5 I/O requests to a specific granularity and alignment. + See the RFC for details. Also, see the Page Buffering documentation. + + At present, page buffering is disabled in parallel builds. + + + +Other New Features and Enhancements +=================================== + + Library + ------- + - Added a mechanism for disabling the SWMR file locking scheme. + + The file locking calls used in HDF5 1.10.0 (including patch1) + will fail when the underlying file system does not support file + locking or where locks have been disabled. To disable all file + locking operations, an environment variable named + HDF5_USE_FILE_LOCKING can be set to the five-character string + 'FALSE'. This does not fundamentally change HDF5 library + operation (aside from initial file open/create, SWMR is lock-free), + but users will have to be more careful about opening files + to avoid problematic access patterns (i.e.: multiple writers) + that the file locking was designed to prevent. + + Additionally, the error message that is emitted when file lock + operations set errno to ENOSYS (typical when file locking has been + disabled) has been updated to describe the problem and potential + resolution better. + + (DER, 2016/10/26, HDFFV-9918) + + - The return type of H5Pget_driver_info() has been changed from void * + to const void *. + + The pointer returned by this function points to internal library + memory and should not be freed by the user. + + (DER, 2016/11/04, HDFFV-10017) + + - The direct I/O VFD has been removed from the list of VFDs that + support SWMR. + + This configuration was never officially tested and several SWMR + tests fail when this VFD is set. + + (DER, 2016/11/03, HDFFV-10169) + + Configuration: + -------------- + - The minimum version of CMake required to build HDF5 is now 3.2.2. + + (ADB, 2017/01/10) + + - An --enable/disable-developer-warnings option has been added to + configure. + + This disables warnings that do not indicate poor code quality such + as -Winline and gcc's -Wsuggest-attribute. Developer warnings are + disabled by default. + + (DER, 2017/01/10) + + - A bin/restore.sh script was added that reverts autogen.sh processing. + + (DER, 2016/11/08) + + - CMake: Added NAMESPACE hdf5:: to package configuration files to allow + projects using installed HDF5 binaries built with CMake to link with + them without specifying the HDF5 library location via IMPORTED_LOCATION. + + (ABD, 2016/10/17, HDFFV-10003) + + - CMake: Changed the CTEST_BUILD_CONFIGURATION option to + CTEST_CONFIGURATION_TYPE as recommended by the CMake documentation. + + (ABD, 2016/10/17, HDFFV-9971) + + + Fortran Library: + ---------------- + + - The HDF5 Fortran library can now be compiled with the NAG compiler. + + (MSB, 2017/2/10, HDFFV-9973) + + + C++ Library: + ------------ + + - The following C++ API wrappers have been added to the C++ Library: + + // Sets/Gets the strategy and the threshold value that the library + // will employ in managing file space. + FileCreatPropList::setFileSpaceStrategy - H5Pset_file_space_strategy + FileCreatPropList::getFileSpaceStrategy - H5Pget_file_space_strategy + + // Sets/Gets the file space page size for paged aggregation. + FileCreatPropList::setFileSpacePagesize - H5Pset_file_space_page_size + FileCreatPropList::getFileSpacePagesize - H5Pget_file_space_page_size + + // Checks if the given ID is valid. + IdComponent::isValid - H5Iis_valid + + // Sets/Gets the number of soft or user-defined links that can be + // traversed before a failure occurs. + LinkAccPropList::setNumLinks - H5Pset_nlinks + LinkAccPropList::getNumLinks - H5Pget_nlinks + + // Returns a copy of the creation property list of a datatype. + DataType::getCreatePlist - H5Tget_create_plist + + // Opens/Closes an object within a group or a file, regardless of object + // type + Group::getObjId - H5Oopen + Group::closeObjId - H5Oclose + + // Maps elements of a virtual dataset to elements of the source dataset. + DSetCreatPropList::setVirtual - H5Pset_virtual + + // Gets general information about this file. + H5File::getFileInfo - H5Fget_info2 + + // Returns the number of members in a type. + IdComponent::getNumMembers - H5Inmembers + + // Determines if an element type exists. + IdComponent::typeExists - H5Itype_exists + + // Determines if an object exists. + H5Location::exists - H5Lexists. + + // Returns the header version of an HDF5 object. + H5Object::objVersion - H5Oget_info for version + + (BMR, 2017/03/20, HDFFV-10004, HDFFV-10139, HDFFV-10145) + + - New exception: ObjHeaderIException for H5O interface. + + (BMR, 2017/03/15, HDFFV-10145) + + - New class LinkAccPropList for link access property list, to be used by + wrappers of H5Lexists. + + (BMR, 2017/01/04, HDFFV-10145) + + - New constructors to open datatypes in ArrayType, CompType, DataType, + EnumType, FloatType, IntType, StrType, and VarLenType. + + (BMR, 2016/12/26, HDFFV-10056) + + - New member functions: + + DSetCreatPropList::setNbit() to setup N-bit compression for a dataset. + + ArrayType::getArrayNDims() const + ArrayType::getArrayDims() const + both to replace the non-const versions. + + (BMR, 2016/04/25, HDFFV-8623, HDFFV-9725) + + + Tools: + ------ + - The following options have been added to h5clear: + -s: clear the status_flags field in the file's superblock + -m: Remove the metadata cache image from the file + + (QAK, 2017/03/22, PR#361) + + + High-Level APIs: + --------------- + - Added New Fortran 2003 API for h5tbmake_table_f. + + (MSB, 2017/02/10, HDFFV-8486) + + + +Support for New Platforms, Languages, and Compilers +=================================================== + + - Added NAG compiler + + + +Bug Fixes since HDF5-1.10.0-patch1 release +================================== + + Library + ------- + - Outdated data structure was used in H5D_CHUNK_DEBUG blocks, causing + compilation errors when H5D_CHUNK_DEBUG was defined. This is fixed. + + (BMR, 2017/04/04, HDFFV-8089) + + - SWMR implementation in the HDF5 1.10.0 and 1.10.0-patch1 releases has a + broken metadata flush dependency that manifested itself with the following + error at the end of the HDF5 error stack: + + H5Dint.c line 846 in H5D__swmr_setup(): dataspace chunk index must be 0 + for SWMR access, chunkno = 1 + major: Dataset + minor: Bad value + + It was also reported at https://github.com/areaDetector/ADCore/issues/203 + + The flush dependency is fixed in this release. + + - Changed the plugins dlopen option from RTLD_NOW to RTLD_LAZY + + (ABD, 2016/12/12, PR#201) + + - A number of issues were fixed when reading/writing from/to corrupted + files to ensure that the library fails gracefully in these cases: + + * Writing to a corrupted file that has an object message which is + incorrectly marked as sharable on disk results in a buffer overflow / + invalid write instead of a clean error message. + + * Decoding data from a corrupted file with a dataset encoded with the + H5Z_NBIT decoding can result in a code execution vulnerability under + the context of the application using the HDF5 library. + + * When decoding an array datatype from a corrupted file, the HDF5 library + fails to return an error in production if the number of dimensions + decoded is greater than the maximum rank. + + * When decoding an "old style" array datatype from a corrupted file, the + HDF5 library fails to return an error in production if the number of + dimensions decoded is greater than the maximum rank. + + (NAF, 2016/10/06, HDFFV-9950, HDFFV-9951, HDFFV-9992, HDFFV-9993) + + - Fixed an error that would occur when copying an object with an attribute + which is a compound datatype consisting of a variable length string. + + (VC, 2016/08/24, HDFFV-7991) + + - H5DOappend will no longer fail if a dataset has no append callback + registered. + + (VC, 2016/08/14, HDFFV-9960) + + - Fixed an issue where H5Pset_alignment could result in misaligned blocks + with some input combinations, causing an assertion failure in debug mode. + + (NAF, 2016/08/11, HDFFV-9948) + + - Fixed a problem where a plugin compiled into a DLL in the default plugin + directory could not be found by the HDF5 library at runtime on Windows + when the HDF5_PLUGIN_PATH environment variable was not set. + + (ABD, 2016/08/01, HDFFV-9706) + + - Fixed an error that would occur when calling H5Adelete on an attribute + which is attached to an externally linked object in the target file and + whose datatype is a committed datatype in the main file. + + (VC, 2016/07/06, HDFFV-9940) + + - (a) Throw an error instead of assertion when v1 btree level hits the 1 + byte limit. + (b) Modifications to better handle error recovery when conversion by + h5format_convert fails. + + (VC, 2016/05/29, HDFFV-9434) + + - Fixed a memory leak where an array used by the library to track SWMR + read retries was unfreed. + + The leaked memory was small (on the order of a few tens of ints) and + allocated per-file. The memory was allocated (and lost) only when a + file was opened for SWMR access. + + (DER, 2016/04/27, HDFFV-9786) + + - Fixed a memory leak that could occur when opening a file for the first + time (including creating) and the call fails. + + This occurred when the file-driver-specific info was not cleaned up. + The amount of memory leaked varied with the file driver, but would + normally be less than 1 kB. + + (DER, 2016/12/06, HDFFV-10168) + + - Fixed a failure in collective metadata writes. + + This failure only appeared when collective metadata writes + were enabled (via H5Pset_coll_metadata_write()). + + (JRM, 2017/04/10, HDFFV-10055) + + + Parallel Library + ---------------- + - Fixed a bug that could occur when allocating a chunked dataset in parallel + with an alignment set and an alignment threshold greater than the chunk + size but less than or equal to the raw data aggregator size. + + (NAF, 2016/08/11, HDFFV-9969) + + + Configuration + ------------- + - Configuration will check for the strtoll and strtoull functions + before using alternatives + + (ABD, 2017/03/17, PR#340) + + - CMake uses a Windows pdb directory variable if available and + will generate both static and shared pdb files. + + (ABD, 2017/02/06, HDFFV-9875) + + - CMake now builds shared versions of tools. + + (ABD, 2017/02/01, HDFFV-10123) + + - Makefiles and test scripts have been updated to correctly remove files + created when running "make check" and to avoid removing any files under + source control. In-source builds followed by "make clean" and "make + distclean" should result in the original source files. + (LRK, 2017/01/17, HDFFV-10099) + + - The tools directory has been divided into two separate source and test + directories. This resolves a build dependency and, as a result, + 'make check' will no longer fail in the tools directory if 'make' was + not executed first. + + (ABD, 2016/10/27, HDFFV-9719) + + - CMake: Fixed a timeout error that would occasionally occur when running + the virtual file driver tests simultaneously due to test directory + and file name collisions. + + (ABD, 2016/09/19, HDFFV-9431) + + - CMake: Fixed a command length overflow error by converting custom + commands inside CMakeTest.cmake files into regular dependencies and + targets. + + (ABD, 2016/07/12, HDFFV-9939) + + - Fixed a problem preventing HDF5 to be built on 32-bit CYGWIN by + condensing cygwin configuration files into a single file and + removing outdated compiler settings. + + (ABD, 2016/07/12, HDFFV-9946) + + + Fortran + -------- + - Changed H5S_ALL_F from INTEGER to INTEGER(HID_T) + + (MSB, 2016/10/14, HDFFV-9987) + + + Tools + ----- + - h5diff now correctly ignores strpad in comparing strings. + + (ABD, 2017/03/03, HDFFV-10128) + + - h5repack now correctly parses the command line filter options. + + (ABD, 2017/01/24, HDFFV-10046) + + - h5diff now correctly returns an error when it cannot read data due + to an unavailable filter plugin. + + (ADB 2017/01/18, HDFFV-9994 ) + + - Fixed an error in the compiler wrapper scripts (h5cc, h5fc, et al.) + in which they would erroneously drop the file argument specified via + the -o flag when the -o flag was specified before the -c flag on the + command line, resulting in a failure to compile. + + (LRK, 2016/11/04, HDFFV-9938, HDFFV-9530) + + - h5repack User Defined (UD) filter parameters were not parsed correctly. + + The UD filter parameters were not being parsed correctly. Reworked coding + section to parse the correct values and verify number of parameters. + + (ABD, 2016/10/19, HDFFV-9996, HDFFV-9974, HDFFV-9515, HDFFV-9039) + + - h5repack allows the --enable-error-stack option on the command line. + + (ADB, 2016/08/08, HDFFV-9775) + + + C++ APIs + -------- + - The member function H5Location::getNumObjs() is moved to + class Group because the objects are in a group or a file only, + and H5Object::getNumAttrs to H5Location to get the number of + attributes at a given location. + + (BMR, 2017/03/17, PR#466) + + - Due to the change in the C API, the overloaded functions of + PropList::setProperty now need const for some arguments. They are + planned for deprecation and are replaced by new versions with proper + consts. + + (BMR, 2017/03/17, PR#344) + + - The high-level API Packet Table (PT) did not write data correctly when + the datatype is a compound type that has string type as one of the + members. This problem started in 1.8.15, after the fix of HDFFV-9042 + was applied, which caused the Packet Table to use native type to access + the data. It should be up to the application to specify whether the + buffer to be read into memory is in the machine's native architecture. + Thus, the PT is fixed to not use native type but to make a copy of the + user's provided datatype during creation or the packet table's datatype + during opening. If an application wishes to use native type to read the + data, then the application will request that. However, the Packet Table + doesn't provide a way to specify memory datatype in this release. This + feature will be available in future releases. + + (BMR, 2016/10/27, HDFFV-9758) + + - The obsolete macros H5_NO_NAMESPACE and H5_NO_STD have been removed from + the HDF5 C++ API library. + + (BMR, 2016/10/23, HDFFV-9532) + + - The problem where a user-defined function cannot access both, attribute + and dataset, using only one argument is now fixed. + + (BMR, 2016/10/11, HDFFV-9920) + + - In-memory array information, ArrayType::rank and + ArrayType::dimensions, were removed. This is an implementation + detail and should not affect applications. + + (BMR, 2016/04/25, HDFFV-9725) + + + Testing + ------- + - Fixed a problem that caused tests using SWMR to occasionally fail when + running "make check" using parallel make. + + (LRK, 2016/03/22, PR#338, PR#346, PR#358) + + +Supported Platforms +=================== + + Linux 2.6.32-573.18.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 + (Red Hat 4.4.7-4) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Version 4.9.3, Version 5.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 Build 20150407 + MPICH 3.1.4 compiled with GCC 4.9.3 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Visual Studio 2015 w/ MSMPI 8 (cmake) + Cygwin(CYGWIN_NT-6.1 2.8.0(0.309/5/3) + gcc and gfortran compilers (GCC 5.4.0) + (cmake and autotools) + + Windows 10 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Cygwin(CYGWIN_NT-6.1 2.8.0(0.309/5/3) + gcc and gfortran compilers (GCC 5.4.0) + (cmake and autotools) + + Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.1 from Xcode 5.1 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (swallow/kite) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Mavericks 10.9.5 Apple clang/clang++ version 6.0 from Xcode 6.2 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (wren/quail) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Yosemite 10.10.5 Apple clang/clang++ version 6.1 from Xcode 7.0 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X El Capitan 10.11.6 Apple clang/clang++ version 7.3 from Xcode 7.3 + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 16.0.2 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +Solaris2.11 32-bit n y/y n y y y +Solaris2.11 64-bit n y/n n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y y y y y +Windows 7 Cygwin n y/n n y y y +Windows 7 x64 Cygwin n y/n n y y y +Windows 10 y y/y n y y y +Windows 10 x64 y y/y n y y y +Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y +Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y +Mac OS X El Capitan 10.11.6 64-bit n y/y n y y y +CentOS 7.2 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.2 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 7.2 Linux 2.6.32 x86_64 Intel n y/y n y y y +Linux 2.6.32-573.18.1.el6.ppc64 n y/y n y y y + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 7 x64 Cygwin n n n y +Windows 10 y y y y +Windows 10 x64 y y y y +Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +Mac OS X Yosemite 10.10.5 64-bit y n y y +Mac OS X El Capitan 10.11.6 64-bit y n y y +CentOS 7.2 Linux 2.6.32 x86_64 PGI y y y n +CentOS 7.2 Linux 2.6.32 x86_64 GNU y y y y +CentOS 7.2 Linux 2.6.32 x86_64 Intel y y y n +Linux 2.6.32-573.18.1.el6.ppc64 y y y n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== + +The following platforms are not supported but have been tested for this release. + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (mayll/platypus) Version 4.4.7 20120313 + Version 4.8.4 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 16.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 (Build 20150407) + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 3.10.0-327.18.2.el7 GNU C (gcc) and C++ (g++) compilers + #1 SMP x86_64 GNU/Linux Version 4.8.5 20150623 (Red Hat 4.8.5-4) + (jelly) with NAG Fortran Compiler Release 6.1(Tozai) + Intel(R) C (icc) and C++ (icpc) compilers + Version 15.0.3.187 (Build 20150407) + with NAG Fortran Compiler Release 6.1(Tozai) + + Linux 2.6.32-573.18.1.el6.ppc64 MPICH mpich 3.1.4 compiled with + #1 SMP ppc64 GNU/Linux IBM XL C/C++ for Linux, V13.1 + (ostrich) and IBM XL Fortran for Linux, V15.1 + + Debian 8.4 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1 x86_64 GNU/Linux + gcc, g++ (Debian 4.9.2-10) 4.9.2 + GNU Fortran (Debian 4.9.2-10) 4.9.2 + (cmake and autotools) + + Fedora 24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc, g++ (GCC) 6.1.1 20160621 + (Red Hat 6.1.1-3) + GNU Fortran (GCC) 6.1.1 20160621 + (Red Hat 6.1.1-3) + (cmake and autotools) + + Ubuntu 16.04.1 4.4.0-38-generic #57-Ubuntu SMP x86_64 GNU/Linux + gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) + 5.4.0 20160609 + GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) + 5.4.0 20160609 + (cmake and autotools) + + +Known Problems +============== + + At present, metadata cache images may not be generated by parallel + applications. Parallel applications can read files with metadata cache + images, but since this is a collective operation, a deadlock is possible + if one or more processes do not participate. + + Known problems in previous releases can be found in the HISTORY*.txt files + in the HDF5 source. Please report any new problems found to + help@hdfgroup.org. + + %%%%1.10.0-patch1%%%% diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index be8cec8..01b2558 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -4,8 +4,8 @@ HDF5 version 1.11.0 currently under development INTRODUCTION -This document describes the differences between HDF5-1.10.0-patch1 and -HDF5 1.10.1, and contains information on the platforms tested and known problems in HDF5-1.10.1. +This document describes the differences between HDF5-1.10.1 and HDF5 1.10.2, and +contains information on the platforms tested and known problems in HDF5-1.10.1. For more details check the HISTORY*.txt files in the HDF5 source. @@ -15,23 +15,23 @@ Links to HDF5 1.10.1 source code, documentation, and additional materials can be The HDF5 1.10.1 release can be obtained from: - https://support.hdfgroup.org/HDF5/release/obtain5110.html + https://support.hdfgroup.org/HDF5/release/obtain5.html User documentation for the snapshot can be accessed directly at this location: - https://support.hdfgroup.org/HDF5/doc1.10/ + https://support.hdfgroup.org/HDF5/doc/ New features in the HDF5-1.10.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New -in 1.10.1?" document: +descriptions of some new and modified APIs, are described in the "New Features +in HDF5 1.10" document: - https://support.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew1101.html +https://support.hdfgroup.org/HDF5/docNewFeatures/index.html All new and modified APIs are listed in detail in the "HDF5 Software Changes -from Release to Release" document, in the section "Release 1.8.19 (current -release) versus Release 1.10.1 +from Release to Release" document, in the section "Release 1.10.1 (current +release) versus Release 1.10.0 - https://support.hdfgroup.org/HDF5/doc1.10/ADGuide/Changes.html + https://support.hdfgroup.org/HDF5/doc/ADGuide/Changes.html If you have any questions or comments, please send them to the HDF Help Desk: @@ -54,37 +54,11 @@ New Features Configuration: ------------- - - CMake minimum is now 3.2.2. - (ADB 2017/01/10) - - - Tools folder is separated into source and test folders. This - allows autotools to skip the make command and just execute - the make check command. - (HDFFV-9719 ADB 2016/10/27) + - Library: -------- - - Paged Aggregation - - This is one of the file space management strategies. This strategy - aggregates small metadata and raw data allocations into constant-sized - well-aligned pages, which are suitable for page caching. Paged - aggregation together with the page buffering feature will allow efficient - I/O accesses. - - - Page Buffering - - The page buffering layer in the HDF5 library absorbs small accesses to - the file system. Each page in memory corresponds to a page allocated in - the file. Access to the file system is then performed as a single page - or multiple of pages, if they are contiguous. This ensures that small - accesses to the file system are avoided while providing another caching - layer for improved I/O performance. This feature works in conjunction - with the paged aggregation feature. - - - Filter plugin API added to access the table of paths to search for a - library. Java interface expanded with wrappers for the new functions. - (HDFFV-10143 ADB 2017/04/04) + - Parallel Library: ----------------- @@ -100,17 +74,15 @@ New Features Tools: ------ - - Add options to h5clear: - -s: clear the status_flags field in the file's superblock - -m: Remove the metadata cache image from the file - (Pull Request #361 QK 2017/03/22) + - High-Level APIs: --------------- + - C Packet Table API ------------------ - - + - Internal header file -------------------- @@ -118,51 +90,26 @@ New Features Documentation ------------- + - Support for new platforms, languages and compilers. ======================================= - -Bug Fixes since HDF5-1.10.0-patch1 release +Bug Fixes since HDF5-1.10.1 release ================================== Library ------- - - Changed the plugins dlopen option from RTLD_NOW to RTLD_LAZY - (PR 201 ADB 2016/12/12) - - - Fix error when copying dataset with attribute which is a compound datatype - consisting of a variable length string. - (HDFFV-7991 VC 2016/08/19, 2016/08/21, 2016/08/24) - - - H5DOappend will not fail if a dataset has no append callback registered. - (HDFFV-9960 VC 2016/08/05, 2016/08/14) - - - Fix the problem where the committed datatype's file location is different - from the file location of an attribute with that committed datatype. - (HDFFV-9940 VC 2016/07/03, 2016/07/06) - - - (a) Throw an error instead of assertion when v1 btree level hits the 1 byte limit. - (b) Modifications to better handle error recovery when conversion by - h5format_convert fails. - (HDFFV-9434 VC 2016/05/29) + - Configuration ------------- - - Configuration will check for the strtoll and strtoull functions - before using alternatives - (PR 340 ADB 2017/03/17) - - - CMake uses a Windows pdb directory variable if available and - will generate both static and shared pdb files. - (HDFFV-9875 ADB 2017/02/06) - - - CMake now builds shared versions of tools. - (HDFFV-10123 ADB 2017/02/01) + - Performance ------------- - - + - Fortran -------- @@ -170,18 +117,7 @@ Bug Fixes since HDF5-1.10.0-patch1 release Tools ----- - - h5diff correctly ignores strpad in comparing strings. - (HDFFV-10128 ADB 2017/03/03) - - - h5repack now correctly parses the command line filter options. - (HDFFV-10046 ADB 2017/01/24) - - - h5diff correctly indicates error when it cannot read data due - to an unavailable filter plugin. - (HDFFV-9994 ADB 2017/01/18) - - - h5repack allows the --enable-error-stack option on the command line. - (HDFFV-775 ADB 2016/08/08) + - High-Level APIs: ------ @@ -193,18 +129,16 @@ Bug Fixes since HDF5-1.10.0-patch1 release Documentation ------------- - + - F90 APIs -------- - - C++ APIs -------- - - Testing ------- - @@ -339,6 +273,25 @@ More Tested Platforms ===================== The following platforms are not supported but have been tested for this release. + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (mayll/platypus) Version 4.4.7 20120313 + Version 4.8.4 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 16.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 (Build 20150407) + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 3.10.0-327.18.2.el7 GNU C (gcc) and C++ (g++) compilers + #1 SMP x86_64 GNU/Linux Version 4.8.5 20150623 (Red Hat 4.8.5-4) + (jelly) with NAG Fortran Compiler Release 6.1(Tozai) + Intel(R) C (icc) and C++ (icpc) compilers + Version 15.0.3.187 (Build 20150407) + with NAG Fortran Compiler Release 6.1(Tozai) + Linux 2.6.32-573.18.1.el6.ppc64 MPICH mpich 3.1.4 compiled with #1 SMP ppc64 GNU/Linux IBM XL C/C++ for Linux, V13.1 (ostrich) and IBM XL Fortran for Linux, V15.1 @@ -349,261 +302,29 @@ The following platforms are not supported but have been tested for this release. (cmake and autotools) Fedora 24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux - gcc, g++ (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) - GNU Fortran (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + gcc, g++ (GCC) 6.1.1 20160621 + (Red Hat 6.1.1-3) + GNU Fortran (GCC) 6.1.1 20160621 + (Red Hat 6.1.1-3) (cmake and autotools) Ubuntu 16.04.1 4.4.0-38-generic #57-Ubuntu SMP x86_64 GNU/Linux - gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 - GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 + gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) + 5.4.0 20160609 + GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) + 5.4.0 20160609 (cmake and autotools) Known Problems ============== -* "make check" fails on CYGWIN when building shared lib files is enabled. The - default on Cygwin has been changed to disable shared. It can be enabled with - the --enable-shared configure option but is likely to fail "make check" - with GCC compilers. (LK -2015/04/16) - -* CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv - catches some undefined behavior in the alignment algorithm of the macro DETECT_I - in H5detect.c (Issue 8147). Since the algorithm is trying to detect the alignment - of integers, ideally the flag -fcatch-undefined-behavior shouldn't to be used for - H5detect.c. In the future, we can separate flags for H5detect.c from the rest of - the library. (SLU - 2013/10/16) - -* The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It - complains with this message: - "/home/hdf5/src/H5Vprivate.h", line 130: Error: __func__ is not defined. - - The reason is that __func__ is a predefined identifier in C99 standard. The - HDF5 C library uses it in H5private.h. The test ttypes.cpp includes - H5private.h (H5Tpkg.h<-H5Fprivate.h<-H5Vprivate.h<-H5private.h). Sun's 5.9 - C++ compiler doesn't support __func__, thus fails to compile the C++ test. - But 5.11 C++ compiler does. To check whether your Sun C++ compiler knows this - identifier, try to compile the following simple C++ program: - #include - - int main(void) - { - printf("%s\n", __func__); - return 0; - } - (SLU - 2012/11/5) - -* The C++ and FORTRAN bindings are not currently working on FreeBSD with the - native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the - ports (and probably gcc releases after that). - (QAK - 2012/10/19) - -* The data conversion test dt_arith.c has failures (segmentation fault) from - "long double" to other datatypes during hard conversion when the library - is built with the default GCC 4.2.1 on Mac Lion system. It only happens - with optimization (-O3, -O2, and -O1). Some newer versions of GCC do not - have this problem. Users should disable optimization or try newer version - of GCC. (Issue 8017. SLU - 2012/6/12) - -* The data conversion test dt_arith.c fails in "long double" to integer - conversion on Ubuntu 11.10 (3.0.0.13 kernal) with GCC 4.6.1 if the library - is built with optimization -O3 or -O2. The older GCC (4.5) or newer kernal - (3.2.2 on Fedora) doesn't have the problem. Users should lower down the - optimization level (-O1 or -O0) by defining CFLAGS in the command line of - "configure" like: - - CFLAGS=-O1 ./configure - - It will overwrite the library's default optimization level. (Issue 7829. - SLU - 2012/2/7) - -* --with-mpe configure option does not work with Mpich2. AKC - 2011/03/10) - -* While working on the 1.8.6 release of HDF5, a bug was discovered that can - occur when reading from a dataset in parallel shortly after it has been - written to collectively. The issue was exposed by a new test in the parallel - HDF5 test suite, but had existed before that. We believe the problem lies with - certain MPI implementations and/or filesystems. - - We have provided a pure MPI test program, as well as a standalone HDF5 - program, that can be used to determine if this is an issue on your system. - They should be run across multiple nodes with a varying number of processes. - These programs can be found at: - http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ - -* Parallel mode in AIX will fail some of the testcheck_version.sh tests where - it treats "exit(134) the same as if process 0 had received an abort signal. - This is fixed and will be available in the next release. AKC - 2009/11/3 - -* The PathScale MPI implementation, accessing a Panasas file system, would - cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file is not - existing. This is due to the MPI_File_open() call failing if the amode has - the MPI_MODE_EXCL bit set. (See bug 1468 for details.) AKC - 2009/8/11 - -* Parallel tests failed with 16 processes with data inconsistency at testphdf5 - / dataset_readAll. Parallel tests also failed with 32 and 64 processes with - collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks - with MPI IO. (CMC - 2009/04/28) - -* For SNL, spirit/liberty/thunderbird: The serial tests pass but parallel - tests failed with MPI-IO file locking message. AKC - 2007/6/25. -* On Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers use - -mp -O1 compilation flags to build the libraries. Higher level of optimization - causes failures in several HDF5 library tests. -* For HPUX 11.23 many tools tests failed for 64-bit version when linked to the - shared libraries (tested for 1.8.0-beta2) -* For SNL, Red Storm: only paralle HDF5 is supported. The serial tests pass - and the parallel tests also pass with lots of non-fatal error messages. -* on SUN 5.10 C++ test fails in the "Testing Shared Datatypes with Attributes" test -* configuring with --enable-debug=all produces compiler errors on most - platforms. Users who want to run HDF5 in debug mode should use - --enable-debug rather than --enable-debug=all to enable debugging - information on most modules. -* On Mac OS 10.4, test/dt_arith.c has some errors in conversion from long - double to (unsigned) long long and from (unsigned)long long to long double. -* On Altix SGI with Intel 9.0 testmeta.c would not compile with -O3 - optimization flag. -* On VAX, Scaleoffset filter isn't supported. The filter cannot be applied to - HDF5 data generated on VAX. Scaleoffset filter only supports IEEE standard - for floating-point data. -* On Cray X1, a lone colon on the command line of h5dump --xml (as in - the testh5dumpxml.sh script) is misinterpereted by the operating system - and causes an error. -* On mpich 1.2.5 and 1.2.6, we found that if more than two processes - contribute no IO and the application asks to do IO with collective, we found - that when using 4 processors, a simple collective write will be hung - sometimes. This can be verified with t_mpi test under testpar. -* The dataset created or rewritten with the v1.6.3 library or after can't - be read with the v1.6.2 library or before when Fletcher32 EDC(filter) is - enabled. There was a bug in the calculating code of the Fletcher32 - checksum in the library before v1.6.3. The checksum value wasn't consistent - between big-endian and little-endian systems. This bug was fixed in - Release 1.6.3. However, after fixing the bug, the checksum value is no - longer the same as before on little-endian system. The library release - after 1.6.4 can still read the dataset created or rewritten with the library - of v1.6.2 or before. SLU - 2005/6/30 -* For the version 6(6.02 and 6.04) of Portland Group compiler on AMD Opteron - processor, there's a bug in the compiler for optimization(-O2). The library - failed in several tests but all related to multi driver. The problem has - been reported to the vendor. -* On IBM AIX systems, parallel HDF5 mode will fail some tests with error - messages like "INFO: 0031-XXX ...". This is from the command poe. - Set the environment variable MP_INFOLEVEL to 0 to minimize the messages - and run the tests again. - The tests may fail with messages like "The socket name is already - in use". HDF5 does not use sockets (except for stream-VFD). This is - due to problems of the poe command trying to set up the debug socket. - Check if there are many old /tmp/s.pedb.* staying around. These are - sockets used by the poe command and left behind due to failed commands. - Ask your system administrator to clean them out. Lastly, request IBM - to provide a mean to run poe without the debug socket. - -* The C++ library's tests fails when compiling with PGI C++ compiler. The - workaround until the problem is correctly handled is to use the - flag "--instantiate=local" prior to the configure and build steps, as: - setenv CXX "pgCC --instantiate=local" for pgCC 5.02 and higher - - -* The stream-vfd test uses ip port 10007 for testing. If another - application is already using that port address, the test will hang - indefinitely and has to be terminated by the kill command. To try the - test again, change the port address in test/stream_test.c to one not - being used in the host. - -* The --enable-static-exec configure flag will only statically link libraries - if the static version of that library is present. If only the shared version - of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, - for example, only have shared versions), the flag should still result in a - successful compilation, but note that the installed executables will not be - fully static. Thus, the only guarantee on these systems is that the - executable is statically linked with just the HDF5 library. - -* With the gcc 2.95.2 compiler, HDF 5 uses the `-ansi' flag during - compilation. The ANSI version of the compiler complains about not being - able to handle the `long long' datatype with the warning: - - warning: ANSI C does not support `long long' - - This warning is innocuous and can be safely ignored. - -* Certain platforms give false negatives when testing h5ls: - - Cray J90 and Cray T90IEEE give errors during testing when displaying - some floating-point values. These are benign differences due to - the different precision in the values displayed and h5ls appears to - be dumping floating-point numbers correctly. - -* Not all platforms behave correctly with szip's shared libraries. Szip is - disabled in these cases, and a message is relayed at configure time. Static - libraries should be working on all systems that support szip, and should be - used when shared libraries are unavailable. There is also a configure error - on Altix machines that incorrectly reports when a version of szip without - an encoder is being used. - -* On some platforms that use Intel and Absoft compilers to build HDF5 fortran library, - compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 - complaining about exit subroutine. Comment out the line - IF (total_error .ne. 0) CALL exit (total_error) - -* Information about building with PGI and Intel compilers is available in - INSTALL file sections 5.7 and 5.8 - -* On at least one system, (SDSC DataStar), the scheduler (in this case - LoadLeveler) sends job status updates to standard error when you run - any executable that was compiled with the parallel compilers. - - This causes problems when running "make check" on parallel builds, as - many of the tool tests function by saving the output from test runs, - and comparing it to an exemplar. - - The best solution is to reconfigure the target system so it no longer - inserts the extra text. However, this may not be practical. - - In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to - the configure and build. This will cause "make check" to continue after - detecting errors in the tool tests. However, in the case of SDSC DataStar, - it also leaves you with some 150 "failed" tests to examine by hand. - - A second solution is to write a script to run serial tests and filter - out the text added by the scheduler. A sample script used on SDSC - DataStar is given below, but you will probably have to customize it - for your installation. - - Observe that the basic idea is to insert the script as the first item - on the command line which executes the the test. The script then - executes the test and filters out the offending text before passing - it on. - - #!/bin/csh - - set STDOUT_FILE=~/bin/serial_filter.stdout - set STDERR_FILE=~/bin/serial_filter.stderr - - rm -f $STDOUT_FILE $STDERR_FILE - - ($* > $STDOUT_FILE) >& $STDERR_FILE - - set RETURN_VALUE=$status - - cat $STDOUT_FILE - - tail +3 $STDERR_FILE - - exit $RETURN_VALUE - - You get the HDF make files and test scipts to execute your filter script - by setting the environment variable "RUNSERIAL" to the full path of the - script prior to running configure for parallel builds. Remember to - "unsetenv RUNSERIAL" before running configure for a serial build. - - Note that the RUNSERIAL environment variable exists so that we can - can prefix serial runs as necessary on the target system. On DataStar, - no prefix is necessary. However on an MPICH system, the prefix might - have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to - get the serial tests to run at all. - In such cases, you will have to include the regular prefix in your - filter script. + At present, metadata cache images may not be generated by parallel + applications. Parallel applications can read files with metadata cache + images, but since this is a collective operation, a deadlock is possible + if one or more processes do not participate. -* H5Ocopy() does not copy reg_ref attributes correctly when shared-message - is turn on. The value of the reference in the destination attriubte is - wrong. This H5Ocopy problem will affect h5copy tool + Known problems in previous releases can be found in the HISTORY*.txt files + in the HDF5 source. Please report any new problems found to + help@hdfgroup.org. -- cgit v0.12 From 28f4873e7fc93de865c3e180f09d7221569f64ff Mon Sep 17 00:00:00 2001 From: lrknox Date: Fri, 5 May 2017 10:47:23 -0500 Subject: Update one missed version string. --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 01b2558..c670066 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -42,7 +42,7 @@ CONTENTS - New Features - Support for new platforms and languages -- Bug Fixes since HDF5-1.10.0-patch1 +- Bug Fixes since HDF5-1.10.1 - Supported Platforms - Tested Configuration Features Summary - More Tested Platforms -- cgit v0.12 From 6d0d9d46dab559c04bba0b8810a3e0630ce44ad2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 5 May 2017 16:54:28 -0500 Subject: Fix typo in name of ddl file in command --- tools/test/h5repack/h5repack.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index 08f670b..e479031 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -1229,7 +1229,7 @@ TOOLTEST_META meta_long h5repack_layout.h5 --metadata_block_size=8192 if test $USE_FILTER_DEFLATE != "yes" ; then SKIP vds_dset_chunk_20x10x5 else - VERIFY_LAYOUT_VDS vds_dset_chunk_20x10x5 1_vds.h5 vds_dset CHUNKED --layout vds_dset:CHUNK=20x10x5 + VERIFY_LAYOUT_VDS vds_dset_chunk20x10x5 1_vds.h5 vds_dset CHUNKED --layout vds_dset:CHUNK=20x10x5 fi if test $USE_FILTER_DEFLATE != "yes" ; then -- cgit v0.12 From 6a4f1187ccef6fd092cf70154e7ffa33f4c2f648 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Sat, 6 May 2017 23:40:44 -0500 Subject: Fix for the two issues reported in HDFFV-10051: (1) Repeated open/close of a compact dataset fails due to the increment of ndims in the dataset structure for every open. --This is done only for chunked dataset via H5D__chunk_set_sizes(). (2) layout "dirty" flag for a compact dataset is not reset properly after flushing the data at dataset close. --Reset the "dirty" flag before flushing the message to the object header via H5O_msg_write(). Tested on moohan, kituo, platypus, ostrich, osx1010test, quail, emu. --- src/H5Dcompact.c | 2 +- src/H5Dlayout.c | 12 +++++- test/dsets.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 130 insertions(+), 3 deletions(-) diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 2578975..e542e71 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -368,9 +368,9 @@ H5D__compact_flush(H5D_t *dset, hid_t dxpl_id) /* Check if the buffered compact information is dirty */ if(dset->shared->layout.storage.u.compact.dirty) { + dset->shared->layout.storage.u.compact.dirty = FALSE; if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") - dset->shared->layout.storage.u.compact.dirty = FALSE; } /* end if */ done: diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index c2fb5c2..ec18e86 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -593,6 +593,7 @@ herr_t H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t *plist) { htri_t msg_exists; /* Whether a particular type of message exists */ + hbool_t layout_copied = FALSE; /* Flag to indicate that layout message was copied */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -622,6 +623,7 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t */ if(NULL == H5O_msg_read(&(dataset->oloc), H5O_LAYOUT_ID, &(dataset->shared->layout), dxpl_id)) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read data layout message") + layout_copied = TRUE; /* Check for external file list message (which might not exist) */ if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_EFL_ID, dxpl_id)) < 0) @@ -655,10 +657,16 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout") /* Set chunk sizes */ - if(H5D__chunk_set_sizes(dataset) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unable to set chunk sizes") + if(H5D_CHUNKED == dataset->shared->layout.type) { + if(H5D__chunk_set_sizes(dataset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unable to set chunk sizes") + } done: + if(ret_value < 0 && layout_copied) { + if(H5O_msg_reset(H5O_LAYOUT_ID, &dataset->shared->layout) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout info") + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__layout_oh_read() */ diff --git a/test/dsets.c b/test/dsets.c index ef58509..a561ef48 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -25,13 +25,16 @@ #define H5FD_TESTING #define H5Z_FRIEND /*suppress error about including H5Zpkg */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ #include "h5test.h" #include "H5srcdir.h" #include "H5Dpkg.h" #include "H5FDpkg.h" #include "H5VMprivate.h" +#include "H5Iprivate.h" #include "H5Zpkg.h" +#include "H5Dpkg.h" #ifdef H5_HAVE_SZLIB_H # include "szlib.h" #endif @@ -12637,7 +12640,122 @@ error: } /* dls_01_main() */ +/*------------------------------------------------------------------------- + * Function: test_compact_open_close_dirty + * + * Purpose: Verify that the two issues reported in HDFFV-10051 are fixed: + * (1) Repeated open/close of a compact dataset fails due to the + * increment of ndims in the dataset structure for every open. + * (2) layout "dirty" flag for a compact dataset is not reset + * properly after flushing the data at dataset close. + * The test for issue #1 is based on compactoc.c attached + * to the jira issue HDFFV-10051 + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Vailin Choi; April 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_compact_open_close_dirty(hid_t fapl) +{ + hid_t fid = -1; /* File ID */ + hid_t did = -1; /* Dataset ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t dcpl = -1; /* Dataset creation property list */ + hsize_t dims[1] = {10}; /* Dimension */ + int wbuf[10]; /* Data buffer */ + char filename[FILENAME_BUF_SIZE]; /* Filename */ + int i; /* Local index variable */ + H5D_t *dset = NULL; /* Internal dataset pointer */ + + TESTING("compact dataset repeated open/close and dirty flag"); + + /* Create a file */ + h5_fixname(FILENAME[1], fapl, filename, sizeof filename); + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Initialize data */ + for(i = 0; i < 10; i++) + wbuf[i] = i; + + /* Create dataspace */ + if((sid = H5Screate_simple(1, dims, NULL)) < 0) + TEST_ERROR + + /* Set compact layout */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + if(H5Pset_layout(dcpl, H5D_COMPACT) < 0) + TEST_ERROR + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) + TEST_ERROR + + /* Create a compact dataset */ + if((did = H5Dcreate2(fid, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Write to the dataset */ + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) + TEST_ERROR + /* Close the dataset */ + if(H5Dclose(did) < 0) + TEST_ERROR + + /* Verify the repeated open/close of the dataset will not fail */ + for(i = 0; i < 20;i++) { + H5E_BEGIN_TRY { + did = H5Dopen (fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT); + } H5E_END_TRY; + if(did < 0) + TEST_ERROR + if(H5Dclose(did) < 0) + TEST_ERROR + } + + /* Open the dataset */ + if((did = H5Dopen2(fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Get the internal dataset pointer */ + if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) + TEST_ERROR + + /* Verify that the "dirty" flag is false */ + if(dset->shared->layout.storage.u.compact.dirty) + TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) TEST_ERROR + + /* Close the dataspace */ + if(H5Sclose(sid) < 0) + TEST_ERROR + + /* Close the dataset creation property list */ + if(H5Pclose(dcpl) < 0) + TEST_ERROR + + /* Close the file */ + if(H5Fclose(fid) < 0) + TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Sclose(sid); + H5Pclose(dcpl); + H5Dclose(did); + H5Fclose(fid); + } H5E_END_TRY; + return -1; +} /* test_compact_open_close_dirty() */ /*------------------------------------------------------------------------- @@ -12759,6 +12877,7 @@ main(void) nerrors += (test_simple_io(envval, my_fapl) < 0 ? 1 : 0); nerrors += (test_compact_io(my_fapl) < 0 ? 1 : 0); nerrors += (test_max_compact(my_fapl) < 0 ? 1 : 0); + nerrors += (test_compact_open_close_dirty(my_fapl) < 0 ? 1 : 0); nerrors += (test_conv_buffer(file) < 0 ? 1 : 0); nerrors += (test_tconv(file) < 0 ? 1 : 0); nerrors += (test_filters(file, my_fapl) < 0 ? 1 : 0); -- cgit v0.12 From d436db6c6efdfe7e9dbe06a642715116ef0eb5e3 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 8 May 2017 22:14:20 -0500 Subject: Fix for the two issues reported in HDFFV-10051 Modifications made based on the review comments from pull request #494 Tested on moohan, mayll, kituo, platypus, ostrich, osx1010test, quail, emu. --- src/H5Dcompact.c | 4 +++- src/H5Dtest.c | 41 +++++++++++++++++++++++++++++++++++++++++ test/dsets.c | 19 ++++++------------- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index e542e71..99a25b6 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -369,8 +369,10 @@ H5D__compact_flush(H5D_t *dset, hid_t dxpl_id) /* Check if the buffered compact information is dirty */ if(dset->shared->layout.storage.u.compact.dirty) { dset->shared->layout.storage.u.compact.dirty = FALSE; - if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) + if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) { + dset->shared->layout.storage.u.compact.dirty = TRUE; HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") + } } /* end if */ done: diff --git a/src/H5Dtest.c b/src/H5Dtest.c index 2fc71a0..c2b6199 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -142,6 +142,47 @@ done: /*-------------------------------------------------------------------------- NAME + H5D__layout_compact_dirty_test + PURPOSE + Determine the "dirty" flag of a compact layout for a dataset's layout information + USAGE + herr_t H5D__layout_compact_dirty_test(did, dirty) + hid_t did; IN: Dataset to query + hbool_t *dirty; OUT: Pointer to location to place "dirty" info + RETURNS + Non-negative on success, negative on failure + DESCRIPTION + Checks the "dirty" flag of a compact dataset. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +herr_t +H5D__layout_compact_dirty_test(hid_t did, hbool_t *dirty) +{ + H5D_t *dset; /* Pointer to dataset to query */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_PACKAGE + + /* Check args */ + if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) + HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") + + if(dirty) { + HDassert(dset->shared->layout.type == H5D_COMPACT); + *dirty = dset->shared->layout.storage.u.compact.dirty; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D__layout_compact_dirty_test() */ + + +/*-------------------------------------------------------------------------- + NAME H5D__layout_type_test PURPOSE Determine the storage layout type for a dataset diff --git a/test/dsets.c b/test/dsets.c index a561ef48..ad014a6 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -17,24 +17,16 @@ * * Purpose: Tests the dataset interface (H5D) */ - -#define H5D_FRIEND /*suppress error about including H5Dpkg */ -#define H5D_TESTING - #define H5FD_FRIEND /*suppress error about including H5FDpkg */ #define H5FD_TESTING #define H5Z_FRIEND /*suppress error about including H5Zpkg */ -#define H5D_FRIEND /*suppress error about including H5Dpkg */ #include "h5test.h" #include "H5srcdir.h" -#include "H5Dpkg.h" #include "H5FDpkg.h" #include "H5VMprivate.h" -#include "H5Iprivate.h" #include "H5Zpkg.h" -#include "H5Dpkg.h" #ifdef H5_HAVE_SZLIB_H # include "szlib.h" #endif @@ -12669,7 +12661,7 @@ test_compact_open_close_dirty(hid_t fapl) int wbuf[10]; /* Data buffer */ char filename[FILENAME_BUF_SIZE]; /* Filename */ int i; /* Local index variable */ - H5D_t *dset = NULL; /* Internal dataset pointer */ + hbool_t dirty; /* The dirty flag */ TESTING("compact dataset repeated open/close and dirty flag"); @@ -12721,16 +12713,17 @@ test_compact_open_close_dirty(hid_t fapl) if((did = H5Dopen2(fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT)) < 0) TEST_ERROR - /* Get the internal dataset pointer */ - if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) + /* Retrieve the "dirty" flag from the compact dataset layout */ + if(H5D__layout_compact_dirty_test(did, &dirty) < 0) TEST_ERROR /* Verify that the "dirty" flag is false */ - if(dset->shared->layout.storage.u.compact.dirty) + if(dirty) TEST_ERROR /* Close the dataset */ - if(H5Dclose(did) < 0) TEST_ERROR + if(H5Dclose(did) < 0) + TEST_ERROR /* Close the dataspace */ if(H5Sclose(sid) < 0) -- cgit v0.12 From 5263bc9029dcf06779a0ec2b89688912443a4bfa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 May 2017 10:41:00 -0500 Subject: HDFFV-10186 Whitespace changes Mostly replacing tabs with spaces Removed empty mod sections --- src/H5T.c | 2830 +++++++++++++++++++++++------------------------ tools/lib/h5diff_util.c | 10 +- tools/lib/h5tools.c | 74 +- 3 files changed, 1431 insertions(+), 1483 deletions(-) diff --git a/src/H5T.c b/src/H5T.c index 5e4171d..2433137 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -22,24 +22,24 @@ /* Module Setup */ /****************/ -#include "H5Tmodule.h" /* This source code file is part of the H5T module */ +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* Files */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5FOprivate.h" /* File objects */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5Tpkg.h" /* Datatypes */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* Files */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5FOprivate.h" /* File objects */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5Tpkg.h" /* Datatypes */ /* Check for header needed for SGI floating-point code */ #ifdef H5_HAVE_SYS_FPU_H @@ -63,209 +63,209 @@ */ /* Define the code template for bitfields for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_BITFIELD_CORE { \ - dt->shared->type = H5T_BITFIELD; \ +#define H5T_INIT_TYPE_BITFIELD_CORE { \ + dt->shared->type = H5T_BITFIELD; \ } /* Define the code template for times for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_TIME_CORE { \ - dt->shared->type = H5T_TIME; \ +#define H5T_INIT_TYPE_TIME_CORE { \ + dt->shared->type = H5T_TIME; \ } /* Define the code template for types which reset the offset for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_OFFSET_CORE { \ - dt->shared->u.atomic.offset = 0; \ +#define H5T_INIT_TYPE_OFFSET_CORE { \ + dt->shared->u.atomic.offset = 0; \ } /* Define common code for all numeric types (floating-point & int, signed & unsigned) */ -#define H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) { \ - dt->shared->u.atomic.order = ENDIANNESS; \ - dt->shared->u.atomic.offset = 0; \ - dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO; \ - dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO; \ +#define H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) { \ + dt->shared->u.atomic.order = ENDIANNESS; \ + dt->shared->u.atomic.offset = 0; \ + dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO; \ + dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO; \ } /* Define the code templates for standard floats for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_FLOAT_COMMON(ENDIANNESS) { \ - H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ - dt->shared->u.atomic.u.f.sign = 31; \ - dt->shared->u.atomic.u.f.epos = 23; \ - dt->shared->u.atomic.u.f.esize = 8; \ - dt->shared->u.atomic.u.f.ebias = 0x7f; \ - dt->shared->u.atomic.u.f.mpos = 0; \ - dt->shared->u.atomic.u.f.msize = 23; \ - dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ - dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ +#define H5T_INIT_TYPE_FLOAT_COMMON(ENDIANNESS) { \ + H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ + dt->shared->u.atomic.u.f.sign = 31; \ + dt->shared->u.atomic.u.f.epos = 23; \ + dt->shared->u.atomic.u.f.esize = 8; \ + dt->shared->u.atomic.u.f.ebias = 0x7f; \ + dt->shared->u.atomic.u.f.mpos = 0; \ + dt->shared->u.atomic.u.f.msize = 23; \ + dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ + dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ } -#define H5T_INIT_TYPE_FLOATLE_CORE { \ - H5T_INIT_TYPE_FLOAT_COMMON(H5T_ORDER_LE) \ +#define H5T_INIT_TYPE_FLOATLE_CORE { \ + H5T_INIT_TYPE_FLOAT_COMMON(H5T_ORDER_LE) \ } -#define H5T_INIT_TYPE_FLOATBE_CORE { \ - H5T_INIT_TYPE_FLOAT_COMMON(H5T_ORDER_BE) \ +#define H5T_INIT_TYPE_FLOATBE_CORE { \ + H5T_INIT_TYPE_FLOAT_COMMON(H5T_ORDER_BE) \ } /* Define the code templates for standard doubles for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_DOUBLE_COMMON(ENDIANNESS) { \ - H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ - dt->shared->u.atomic.u.f.sign = 63; \ - dt->shared->u.atomic.u.f.epos = 52; \ - dt->shared->u.atomic.u.f.esize = 11; \ - dt->shared->u.atomic.u.f.ebias = 0x03ff; \ - dt->shared->u.atomic.u.f.mpos = 0; \ - dt->shared->u.atomic.u.f.msize = 52; \ - dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ - dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ +#define H5T_INIT_TYPE_DOUBLE_COMMON(ENDIANNESS) { \ + H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ + dt->shared->u.atomic.u.f.sign = 63; \ + dt->shared->u.atomic.u.f.epos = 52; \ + dt->shared->u.atomic.u.f.esize = 11; \ + dt->shared->u.atomic.u.f.ebias = 0x03ff; \ + dt->shared->u.atomic.u.f.mpos = 0; \ + dt->shared->u.atomic.u.f.msize = 52; \ + dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ + dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ } -#define H5T_INIT_TYPE_DOUBLELE_CORE { \ - H5T_INIT_TYPE_DOUBLE_COMMON(H5T_ORDER_LE) \ +#define H5T_INIT_TYPE_DOUBLELE_CORE { \ + H5T_INIT_TYPE_DOUBLE_COMMON(H5T_ORDER_LE) \ } -#define H5T_INIT_TYPE_DOUBLEBE_CORE { \ - H5T_INIT_TYPE_DOUBLE_COMMON(H5T_ORDER_BE) \ +#define H5T_INIT_TYPE_DOUBLEBE_CORE { \ + H5T_INIT_TYPE_DOUBLE_COMMON(H5T_ORDER_BE) \ } /* Define the code templates for VAX float for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_FLOATVAX_CORE { \ - H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_VAX) \ - dt->shared->u.atomic.u.f.sign = 31; \ - dt->shared->u.atomic.u.f.epos = 23; \ - dt->shared->u.atomic.u.f.esize = 8; \ - dt->shared->u.atomic.u.f.ebias = 0x81; \ - dt->shared->u.atomic.u.f.mpos = 0; \ - dt->shared->u.atomic.u.f.msize = 23; \ - dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ - dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ - dt->shared->version = H5O_DTYPE_VERSION_3; \ +#define H5T_INIT_TYPE_FLOATVAX_CORE { \ + H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_VAX) \ + dt->shared->u.atomic.u.f.sign = 31; \ + dt->shared->u.atomic.u.f.epos = 23; \ + dt->shared->u.atomic.u.f.esize = 8; \ + dt->shared->u.atomic.u.f.ebias = 0x81; \ + dt->shared->u.atomic.u.f.mpos = 0; \ + dt->shared->u.atomic.u.f.msize = 23; \ + dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ + dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ + dt->shared->version = H5O_DTYPE_VERSION_3; \ } /* Define the code templates for VAX double for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_DOUBLEVAX_CORE { \ - H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_VAX) \ - dt->shared->u.atomic.u.f.sign = 63; \ - dt->shared->u.atomic.u.f.epos = 52; \ - dt->shared->u.atomic.u.f.esize = 11; \ - dt->shared->u.atomic.u.f.ebias = 0x0401; \ - dt->shared->u.atomic.u.f.mpos = 0; \ - dt->shared->u.atomic.u.f.msize = 52; \ - dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ - dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ - dt->shared->version = H5O_DTYPE_VERSION_3; \ +#define H5T_INIT_TYPE_DOUBLEVAX_CORE { \ + H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_VAX) \ + dt->shared->u.atomic.u.f.sign = 63; \ + dt->shared->u.atomic.u.f.epos = 52; \ + dt->shared->u.atomic.u.f.esize = 11; \ + dt->shared->u.atomic.u.f.ebias = 0x0401; \ + dt->shared->u.atomic.u.f.mpos = 0; \ + dt->shared->u.atomic.u.f.msize = 52; \ + dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ + dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ + dt->shared->version = H5O_DTYPE_VERSION_3; \ } /* Define the code templates for standard signed integers for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_SINT_COMMON(ENDIANNESS) { \ - H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ - dt->shared->u.atomic.u.i.sign = H5T_SGN_2; \ +#define H5T_INIT_TYPE_SINT_COMMON(ENDIANNESS) { \ + H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ + dt->shared->u.atomic.u.i.sign = H5T_SGN_2; \ } -#define H5T_INIT_TYPE_SINTLE_CORE { \ - H5T_INIT_TYPE_SINT_COMMON(H5T_ORDER_LE) \ +#define H5T_INIT_TYPE_SINTLE_CORE { \ + H5T_INIT_TYPE_SINT_COMMON(H5T_ORDER_LE) \ } -#define H5T_INIT_TYPE_SINTBE_CORE { \ - H5T_INIT_TYPE_SINT_COMMON(H5T_ORDER_BE) \ +#define H5T_INIT_TYPE_SINTBE_CORE { \ + H5T_INIT_TYPE_SINT_COMMON(H5T_ORDER_BE) \ } /* Define the code templates for standard unsigned integers for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_UINT_COMMON(ENDIANNESS) { \ - H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ - dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE; \ +#define H5T_INIT_TYPE_UINT_COMMON(ENDIANNESS) { \ + H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ + dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE; \ } -#define H5T_INIT_TYPE_UINTLE_CORE { \ - H5T_INIT_TYPE_UINT_COMMON(H5T_ORDER_LE) \ +#define H5T_INIT_TYPE_UINTLE_CORE { \ + H5T_INIT_TYPE_UINT_COMMON(H5T_ORDER_LE) \ } -#define H5T_INIT_TYPE_UINTBE_CORE { \ - H5T_INIT_TYPE_UINT_COMMON(H5T_ORDER_BE) \ +#define H5T_INIT_TYPE_UINTBE_CORE { \ + H5T_INIT_TYPE_UINT_COMMON(H5T_ORDER_BE) \ } /* Define a macro for common code for all newly allocate datatypes */ -#define H5T_INIT_TYPE_ALLOC_COMMON(TYPE) { \ - dt->sh_loc.type = H5O_SHARE_TYPE_UNSHARED; \ - dt->shared->type = TYPE; \ +#define H5T_INIT_TYPE_ALLOC_COMMON(TYPE) { \ + dt->sh_loc.type = H5O_SHARE_TYPE_UNSHARED; \ + dt->shared->type = TYPE; \ } /* Define the code templates for opaque for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_OPAQ_CORE { \ - H5T_INIT_TYPE_ALLOC_COMMON(H5T_OPAQUE) \ - dt->shared->u.opaque.tag = H5MM_xstrdup(""); \ +#define H5T_INIT_TYPE_OPAQ_CORE { \ + H5T_INIT_TYPE_ALLOC_COMMON(H5T_OPAQUE) \ + dt->shared->u.opaque.tag = H5MM_xstrdup(""); \ } /* Define the code templates for strings for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_STRING_COMMON { \ - H5T_INIT_TYPE_ALLOC_COMMON(H5T_STRING) \ - H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_NONE) \ - dt->shared->u.atomic.u.s.cset = H5F_DEFAULT_CSET; \ +#define H5T_INIT_TYPE_STRING_COMMON { \ + H5T_INIT_TYPE_ALLOC_COMMON(H5T_STRING) \ + H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_NONE) \ + dt->shared->u.atomic.u.s.cset = H5F_DEFAULT_CSET; \ } -#define H5T_INIT_TYPE_CSTRING_CORE { \ - H5T_INIT_TYPE_STRING_COMMON \ - dt->shared->u.atomic.u.s.pad = H5T_STR_NULLTERM; \ +#define H5T_INIT_TYPE_CSTRING_CORE { \ + H5T_INIT_TYPE_STRING_COMMON \ + dt->shared->u.atomic.u.s.pad = H5T_STR_NULLTERM; \ } -#define H5T_INIT_TYPE_FORSTRING_CORE { \ - H5T_INIT_TYPE_STRING_COMMON \ - dt->shared->u.atomic.u.s.pad = H5T_STR_SPACEPAD; \ +#define H5T_INIT_TYPE_FORSTRING_CORE { \ + H5T_INIT_TYPE_STRING_COMMON \ + dt->shared->u.atomic.u.s.pad = H5T_STR_SPACEPAD; \ } /* Define the code templates for references for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_REF_COMMON { \ - H5T_INIT_TYPE_ALLOC_COMMON(H5T_REFERENCE) \ - H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_NONE) \ +#define H5T_INIT_TYPE_REF_COMMON { \ + H5T_INIT_TYPE_ALLOC_COMMON(H5T_REFERENCE) \ + H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_NONE) \ } -#define H5T_INIT_TYPE_OBJREF_CORE { \ - H5T_INIT_TYPE_REF_COMMON \ - dt->shared->force_conv = TRUE; \ - dt->shared->u.atomic.u.r.rtype = H5R_OBJECT; \ - dt->shared->u.atomic.u.r.loc = H5T_LOC_MEMORY; \ +#define H5T_INIT_TYPE_OBJREF_CORE { \ + H5T_INIT_TYPE_REF_COMMON \ + dt->shared->force_conv = TRUE; \ + dt->shared->u.atomic.u.r.rtype = H5R_OBJECT; \ + dt->shared->u.atomic.u.r.loc = H5T_LOC_MEMORY; \ } -#define H5T_INIT_TYPE_REGREF_CORE { \ - H5T_INIT_TYPE_REF_COMMON \ - dt->shared->u.atomic.u.r.rtype = H5R_DATASET_REGION; \ +#define H5T_INIT_TYPE_REGREF_CORE { \ + H5T_INIT_TYPE_REF_COMMON \ + dt->shared->u.atomic.u.r.rtype = H5R_DATASET_REGION; \ } /* Define the code templates for the "SIZE_TMPL" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_SET_SIZE(SIZE) { \ - dt->shared->size = SIZE; \ - dt->shared->u.atomic.prec = 8 * SIZE; \ +#define H5T_INIT_TYPE_SET_SIZE(SIZE) { \ + dt->shared->size = SIZE; \ + dt->shared->u.atomic.prec = 8 * SIZE; \ } -#define H5T_INIT_TYPE_NOSET_SIZE(SIZE) { \ +#define H5T_INIT_TYPE_NOSET_SIZE(SIZE) { \ } /* Define the code templates for the "CRT_TMPL" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_COPY_CREATE(BASE) { \ - /* Base off of existing datatype */ \ - if(NULL == (dt = H5T_copy(BASE, H5T_COPY_TRANSIENT))) \ +#define H5T_INIT_TYPE_COPY_CREATE(BASE) { \ + /* Base off of existing datatype */ \ + if(NULL == (dt = H5T_copy(BASE, H5T_COPY_TRANSIENT))) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "duplicating base type failed") \ } -#define H5T_INIT_TYPE_ALLOC_CREATE(BASE) { \ - /* Allocate new datatype info */ \ - if(NULL == (dt = H5T__alloc())) \ +#define H5T_INIT_TYPE_ALLOC_CREATE(BASE) { \ + /* Allocate new datatype info */ \ + if(NULL == (dt = H5T__alloc())) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "memory allocation failed") \ } -#define H5T_INIT_TYPE(GUTS,GLOBAL,CRT_TMPL,BASE,SIZE_TMPL,SIZE) { \ - /* Get new datatype struct */ \ - H5_GLUE3(H5T_INIT_TYPE_,CRT_TMPL,_CREATE)(BASE) \ - \ - /* Adjust information for all types */ \ - dt->shared->state = H5T_STATE_IMMUTABLE; \ - H5_GLUE3(H5T_INIT_TYPE_,SIZE_TMPL,_SIZE)(SIZE) \ - \ - /* Adjust information for this type */ \ - H5_GLUE3(H5T_INIT_TYPE_, GUTS, _CORE) \ - \ - /* Atomize result */ \ - if((GLOBAL = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) \ +#define H5T_INIT_TYPE(GUTS,GLOBAL,CRT_TMPL,BASE,SIZE_TMPL,SIZE) { \ + /* Get new datatype struct */ \ + H5_GLUE3(H5T_INIT_TYPE_,CRT_TMPL,_CREATE)(BASE) \ + \ + /* Adjust information for all types */ \ + dt->shared->state = H5T_STATE_IMMUTABLE; \ + H5_GLUE3(H5T_INIT_TYPE_,SIZE_TMPL,_SIZE)(SIZE) \ + \ + /* Adjust information for this type */ \ + H5_GLUE3(H5T_INIT_TYPE_, GUTS, _CORE) \ + \ + /* Atomize result */ \ + if((GLOBAL = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") \ } @@ -279,9 +279,9 @@ /* Local Prototypes */ /********************/ static herr_t H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, - H5T_t *dst, H5T_conv_t func, hid_t dxpl_id); + H5T_t *dst, H5T_conv_t func, hid_t dxpl_id); static herr_t H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, - H5T_t *dst, H5T_conv_t func, hid_t dxpl_id, hbool_t api_call); + H5T_t *dst, H5T_conv_t func, hid_t dxpl_id, hbool_t api_call); static htri_t H5T_compiler_conv(H5T_t *src, H5T_t *dst); static herr_t H5T_set_size(H5T_t *dt, size_t size); @@ -308,103 +308,103 @@ hbool_t H5_PKG_INIT_VAR = FALSE; * If more of these are added, the new ones must be added to the list of * types to reset in H5T_term_package(). */ -hid_t H5T_IEEE_F32BE_g = FAIL; -hid_t H5T_IEEE_F32LE_g = FAIL; -hid_t H5T_IEEE_F64BE_g = FAIL; -hid_t H5T_IEEE_F64LE_g = FAIL; - -hid_t H5T_VAX_F32_g = FAIL; -hid_t H5T_VAX_F64_g = FAIL; - -hid_t H5T_STD_I8BE_g = FAIL; -hid_t H5T_STD_I8LE_g = FAIL; -hid_t H5T_STD_I16BE_g = FAIL; -hid_t H5T_STD_I16LE_g = FAIL; -hid_t H5T_STD_I32BE_g = FAIL; -hid_t H5T_STD_I32LE_g = FAIL; -hid_t H5T_STD_I64BE_g = FAIL; -hid_t H5T_STD_I64LE_g = FAIL; -hid_t H5T_STD_U8BE_g = FAIL; -hid_t H5T_STD_U8LE_g = FAIL; -hid_t H5T_STD_U16BE_g = FAIL; -hid_t H5T_STD_U16LE_g = FAIL; -hid_t H5T_STD_U32BE_g = FAIL; -hid_t H5T_STD_U32LE_g = FAIL; -hid_t H5T_STD_U64BE_g = FAIL; -hid_t H5T_STD_U64LE_g = FAIL; -hid_t H5T_STD_B8BE_g = FAIL; -hid_t H5T_STD_B8LE_g = FAIL; -hid_t H5T_STD_B16BE_g = FAIL; -hid_t H5T_STD_B16LE_g = FAIL; -hid_t H5T_STD_B32BE_g = FAIL; -hid_t H5T_STD_B32LE_g = FAIL; -hid_t H5T_STD_B64BE_g = FAIL; -hid_t H5T_STD_B64LE_g = FAIL; -hid_t H5T_STD_REF_OBJ_g = FAIL; -hid_t H5T_STD_REF_DSETREG_g = FAIL; - -hid_t H5T_UNIX_D32BE_g = FAIL; -hid_t H5T_UNIX_D32LE_g = FAIL; -hid_t H5T_UNIX_D64BE_g = FAIL; -hid_t H5T_UNIX_D64LE_g = FAIL; - -hid_t H5T_C_S1_g = FAIL; - -hid_t H5T_FORTRAN_S1_g = FAIL; - -hid_t H5T_NATIVE_SCHAR_g = FAIL; -hid_t H5T_NATIVE_UCHAR_g = FAIL; -hid_t H5T_NATIVE_SHORT_g = FAIL; -hid_t H5T_NATIVE_USHORT_g = FAIL; -hid_t H5T_NATIVE_INT_g = FAIL; -hid_t H5T_NATIVE_UINT_g = FAIL; -hid_t H5T_NATIVE_LONG_g = FAIL; -hid_t H5T_NATIVE_ULONG_g = FAIL; -hid_t H5T_NATIVE_LLONG_g = FAIL; -hid_t H5T_NATIVE_ULLONG_g = FAIL; -hid_t H5T_NATIVE_FLOAT_g = FAIL; -hid_t H5T_NATIVE_DOUBLE_g = FAIL; +hid_t H5T_IEEE_F32BE_g = FAIL; +hid_t H5T_IEEE_F32LE_g = FAIL; +hid_t H5T_IEEE_F64BE_g = FAIL; +hid_t H5T_IEEE_F64LE_g = FAIL; + +hid_t H5T_VAX_F32_g = FAIL; +hid_t H5T_VAX_F64_g = FAIL; + +hid_t H5T_STD_I8BE_g = FAIL; +hid_t H5T_STD_I8LE_g = FAIL; +hid_t H5T_STD_I16BE_g = FAIL; +hid_t H5T_STD_I16LE_g = FAIL; +hid_t H5T_STD_I32BE_g = FAIL; +hid_t H5T_STD_I32LE_g = FAIL; +hid_t H5T_STD_I64BE_g = FAIL; +hid_t H5T_STD_I64LE_g = FAIL; +hid_t H5T_STD_U8BE_g = FAIL; +hid_t H5T_STD_U8LE_g = FAIL; +hid_t H5T_STD_U16BE_g = FAIL; +hid_t H5T_STD_U16LE_g = FAIL; +hid_t H5T_STD_U32BE_g = FAIL; +hid_t H5T_STD_U32LE_g = FAIL; +hid_t H5T_STD_U64BE_g = FAIL; +hid_t H5T_STD_U64LE_g = FAIL; +hid_t H5T_STD_B8BE_g = FAIL; +hid_t H5T_STD_B8LE_g = FAIL; +hid_t H5T_STD_B16BE_g = FAIL; +hid_t H5T_STD_B16LE_g = FAIL; +hid_t H5T_STD_B32BE_g = FAIL; +hid_t H5T_STD_B32LE_g = FAIL; +hid_t H5T_STD_B64BE_g = FAIL; +hid_t H5T_STD_B64LE_g = FAIL; +hid_t H5T_STD_REF_OBJ_g = FAIL; +hid_t H5T_STD_REF_DSETREG_g = FAIL; + +hid_t H5T_UNIX_D32BE_g = FAIL; +hid_t H5T_UNIX_D32LE_g = FAIL; +hid_t H5T_UNIX_D64BE_g = FAIL; +hid_t H5T_UNIX_D64LE_g = FAIL; + +hid_t H5T_C_S1_g = FAIL; + +hid_t H5T_FORTRAN_S1_g = FAIL; + +hid_t H5T_NATIVE_SCHAR_g = FAIL; +hid_t H5T_NATIVE_UCHAR_g = FAIL; +hid_t H5T_NATIVE_SHORT_g = FAIL; +hid_t H5T_NATIVE_USHORT_g = FAIL; +hid_t H5T_NATIVE_INT_g = FAIL; +hid_t H5T_NATIVE_UINT_g = FAIL; +hid_t H5T_NATIVE_LONG_g = FAIL; +hid_t H5T_NATIVE_ULONG_g = FAIL; +hid_t H5T_NATIVE_LLONG_g = FAIL; +hid_t H5T_NATIVE_ULLONG_g = FAIL; +hid_t H5T_NATIVE_FLOAT_g = FAIL; +hid_t H5T_NATIVE_DOUBLE_g = FAIL; #if H5_SIZEOF_LONG_DOUBLE !=0 -hid_t H5T_NATIVE_LDOUBLE_g = FAIL; +hid_t H5T_NATIVE_LDOUBLE_g = FAIL; #endif -hid_t H5T_NATIVE_B8_g = FAIL; -hid_t H5T_NATIVE_B16_g = FAIL; -hid_t H5T_NATIVE_B32_g = FAIL; -hid_t H5T_NATIVE_B64_g = FAIL; -hid_t H5T_NATIVE_OPAQUE_g = FAIL; -hid_t H5T_NATIVE_HADDR_g = FAIL; -hid_t H5T_NATIVE_HSIZE_g = FAIL; -hid_t H5T_NATIVE_HSSIZE_g = FAIL; -hid_t H5T_NATIVE_HERR_g = FAIL; -hid_t H5T_NATIVE_HBOOL_g = FAIL; - -hid_t H5T_NATIVE_INT8_g = FAIL; -hid_t H5T_NATIVE_UINT8_g = FAIL; -hid_t H5T_NATIVE_INT_LEAST8_g = FAIL; -hid_t H5T_NATIVE_UINT_LEAST8_g = FAIL; -hid_t H5T_NATIVE_INT_FAST8_g = FAIL; -hid_t H5T_NATIVE_UINT_FAST8_g = FAIL; - -hid_t H5T_NATIVE_INT16_g = FAIL; -hid_t H5T_NATIVE_UINT16_g = FAIL; -hid_t H5T_NATIVE_INT_LEAST16_g = FAIL; -hid_t H5T_NATIVE_UINT_LEAST16_g = FAIL; -hid_t H5T_NATIVE_INT_FAST16_g = FAIL; -hid_t H5T_NATIVE_UINT_FAST16_g = FAIL; - -hid_t H5T_NATIVE_INT32_g = FAIL; -hid_t H5T_NATIVE_UINT32_g = FAIL; -hid_t H5T_NATIVE_INT_LEAST32_g = FAIL; -hid_t H5T_NATIVE_UINT_LEAST32_g = FAIL; -hid_t H5T_NATIVE_INT_FAST32_g = FAIL; -hid_t H5T_NATIVE_UINT_FAST32_g = FAIL; - -hid_t H5T_NATIVE_INT64_g = FAIL; -hid_t H5T_NATIVE_UINT64_g = FAIL; -hid_t H5T_NATIVE_INT_LEAST64_g = FAIL; -hid_t H5T_NATIVE_UINT_LEAST64_g = FAIL; -hid_t H5T_NATIVE_INT_FAST64_g = FAIL; -hid_t H5T_NATIVE_UINT_FAST64_g = FAIL; +hid_t H5T_NATIVE_B8_g = FAIL; +hid_t H5T_NATIVE_B16_g = FAIL; +hid_t H5T_NATIVE_B32_g = FAIL; +hid_t H5T_NATIVE_B64_g = FAIL; +hid_t H5T_NATIVE_OPAQUE_g = FAIL; +hid_t H5T_NATIVE_HADDR_g = FAIL; +hid_t H5T_NATIVE_HSIZE_g = FAIL; +hid_t H5T_NATIVE_HSSIZE_g = FAIL; +hid_t H5T_NATIVE_HERR_g = FAIL; +hid_t H5T_NATIVE_HBOOL_g = FAIL; + +hid_t H5T_NATIVE_INT8_g = FAIL; +hid_t H5T_NATIVE_UINT8_g = FAIL; +hid_t H5T_NATIVE_INT_LEAST8_g = FAIL; +hid_t H5T_NATIVE_UINT_LEAST8_g = FAIL; +hid_t H5T_NATIVE_INT_FAST8_g = FAIL; +hid_t H5T_NATIVE_UINT_FAST8_g = FAIL; + +hid_t H5T_NATIVE_INT16_g = FAIL; +hid_t H5T_NATIVE_UINT16_g = FAIL; +hid_t H5T_NATIVE_INT_LEAST16_g = FAIL; +hid_t H5T_NATIVE_UINT_LEAST16_g = FAIL; +hid_t H5T_NATIVE_INT_FAST16_g = FAIL; +hid_t H5T_NATIVE_UINT_FAST16_g = FAIL; + +hid_t H5T_NATIVE_INT32_g = FAIL; +hid_t H5T_NATIVE_UINT32_g = FAIL; +hid_t H5T_NATIVE_INT_LEAST32_g = FAIL; +hid_t H5T_NATIVE_UINT_LEAST32_g = FAIL; +hid_t H5T_NATIVE_INT_FAST32_g = FAIL; +hid_t H5T_NATIVE_UINT_FAST32_g = FAIL; + +hid_t H5T_NATIVE_INT64_g = FAIL; +hid_t H5T_NATIVE_UINT64_g = FAIL; +hid_t H5T_NATIVE_INT_LEAST64_g = FAIL; +hid_t H5T_NATIVE_UINT_LEAST64_g = FAIL; +hid_t H5T_NATIVE_INT_FAST64_g = FAIL; +hid_t H5T_NATIVE_UINT_FAST64_g = FAIL; /* * Alignment constraints for native types. These are initialized at run time @@ -412,45 +412,45 @@ hid_t H5T_NATIVE_UINT_FAST64_g = FAIL; * datatype or C structures, which are different from the alignments for memory * address below this group of variables. */ -size_t H5T_NATIVE_SCHAR_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_UCHAR_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_SHORT_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_USHORT_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_INT_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_LONG_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_ULONG_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_LLONG_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_ULLONG_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_FLOAT_COMP_ALIGN_g = 0; -size_t H5T_NATIVE_DOUBLE_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_SCHAR_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_UCHAR_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_SHORT_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_USHORT_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_INT_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_LONG_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_ULONG_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_LLONG_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_ULLONG_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_FLOAT_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_DOUBLE_COMP_ALIGN_g = 0; #if H5_SIZEOF_LONG_DOUBLE !=0 -size_t H5T_NATIVE_LDOUBLE_COMP_ALIGN_g = 0; +size_t H5T_NATIVE_LDOUBLE_COMP_ALIGN_g = 0; #endif -size_t H5T_POINTER_COMP_ALIGN_g = 0; -size_t H5T_HVL_COMP_ALIGN_g = 0; -size_t H5T_HOBJREF_COMP_ALIGN_g = 0; -size_t H5T_HDSETREGREF_COMP_ALIGN_g = 0; +size_t H5T_POINTER_COMP_ALIGN_g = 0; +size_t H5T_HVL_COMP_ALIGN_g = 0; +size_t H5T_HOBJREF_COMP_ALIGN_g = 0; +size_t H5T_HDSETREGREF_COMP_ALIGN_g = 0; /* * Alignment constraints for native types. These are initialized at run time * in H5Tinit.c */ -size_t H5T_NATIVE_SCHAR_ALIGN_g = 0; -size_t H5T_NATIVE_UCHAR_ALIGN_g = 0; -size_t H5T_NATIVE_SHORT_ALIGN_g = 0; -size_t H5T_NATIVE_USHORT_ALIGN_g = 0; -size_t H5T_NATIVE_INT_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_ALIGN_g = 0; -size_t H5T_NATIVE_LONG_ALIGN_g = 0; -size_t H5T_NATIVE_ULONG_ALIGN_g = 0; -size_t H5T_NATIVE_LLONG_ALIGN_g = 0; -size_t H5T_NATIVE_ULLONG_ALIGN_g = 0; -size_t H5T_NATIVE_FLOAT_ALIGN_g = 0; -size_t H5T_NATIVE_DOUBLE_ALIGN_g = 0; +size_t H5T_NATIVE_SCHAR_ALIGN_g = 0; +size_t H5T_NATIVE_UCHAR_ALIGN_g = 0; +size_t H5T_NATIVE_SHORT_ALIGN_g = 0; +size_t H5T_NATIVE_USHORT_ALIGN_g = 0; +size_t H5T_NATIVE_INT_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_ALIGN_g = 0; +size_t H5T_NATIVE_LONG_ALIGN_g = 0; +size_t H5T_NATIVE_ULONG_ALIGN_g = 0; +size_t H5T_NATIVE_LLONG_ALIGN_g = 0; +size_t H5T_NATIVE_ULLONG_ALIGN_g = 0; +size_t H5T_NATIVE_FLOAT_ALIGN_g = 0; +size_t H5T_NATIVE_DOUBLE_ALIGN_g = 0; #if H5_SIZEOF_LONG_DOUBLE !=0 -size_t H5T_NATIVE_LDOUBLE_ALIGN_g = 0; +size_t H5T_NATIVE_LDOUBLE_ALIGN_g = 0; #endif /* @@ -458,40 +458,40 @@ size_t H5T_NATIVE_LDOUBLE_ALIGN_g = 0; * H5Tinit.c if the types are provided by the system. Otherwise we set their * values to 0 here (no alignment calculated). */ -size_t H5T_NATIVE_INT8_ALIGN_g = 0; -size_t H5T_NATIVE_UINT8_ALIGN_g = 0; -size_t H5T_NATIVE_INT_LEAST8_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_LEAST8_ALIGN_g = 0; -size_t H5T_NATIVE_INT_FAST8_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_FAST8_ALIGN_g = 0; - -size_t H5T_NATIVE_INT16_ALIGN_g = 0; -size_t H5T_NATIVE_UINT16_ALIGN_g = 0; -size_t H5T_NATIVE_INT_LEAST16_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_LEAST16_ALIGN_g = 0; -size_t H5T_NATIVE_INT_FAST16_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_FAST16_ALIGN_g = 0; - -size_t H5T_NATIVE_INT32_ALIGN_g = 0; -size_t H5T_NATIVE_UINT32_ALIGN_g = 0; -size_t H5T_NATIVE_INT_LEAST32_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_LEAST32_ALIGN_g = 0; -size_t H5T_NATIVE_INT_FAST32_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_FAST32_ALIGN_g = 0; - -size_t H5T_NATIVE_INT64_ALIGN_g = 0; -size_t H5T_NATIVE_UINT64_ALIGN_g = 0; -size_t H5T_NATIVE_INT_LEAST64_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_LEAST64_ALIGN_g = 0; -size_t H5T_NATIVE_INT_FAST64_ALIGN_g = 0; -size_t H5T_NATIVE_UINT_FAST64_ALIGN_g = 0; +size_t H5T_NATIVE_INT8_ALIGN_g = 0; +size_t H5T_NATIVE_UINT8_ALIGN_g = 0; +size_t H5T_NATIVE_INT_LEAST8_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_LEAST8_ALIGN_g = 0; +size_t H5T_NATIVE_INT_FAST8_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_FAST8_ALIGN_g = 0; + +size_t H5T_NATIVE_INT16_ALIGN_g = 0; +size_t H5T_NATIVE_UINT16_ALIGN_g = 0; +size_t H5T_NATIVE_INT_LEAST16_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_LEAST16_ALIGN_g = 0; +size_t H5T_NATIVE_INT_FAST16_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_FAST16_ALIGN_g = 0; + +size_t H5T_NATIVE_INT32_ALIGN_g = 0; +size_t H5T_NATIVE_UINT32_ALIGN_g = 0; +size_t H5T_NATIVE_INT_LEAST32_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_LEAST32_ALIGN_g = 0; +size_t H5T_NATIVE_INT_FAST32_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_FAST32_ALIGN_g = 0; + +size_t H5T_NATIVE_INT64_ALIGN_g = 0; +size_t H5T_NATIVE_UINT64_ALIGN_g = 0; +size_t H5T_NATIVE_INT_LEAST64_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_LEAST64_ALIGN_g = 0; +size_t H5T_NATIVE_INT_FAST64_ALIGN_g = 0; +size_t H5T_NATIVE_UINT_FAST64_ALIGN_g = 0; /* Useful floating-point values for conversion routines */ /* (+/- Inf for all floating-point types) */ -float H5T_NATIVE_FLOAT_POS_INF_g = 0.0f; -float H5T_NATIVE_FLOAT_NEG_INF_g = 0.0f; -double H5T_NATIVE_DOUBLE_POS_INF_g = (double)0.0f; -double H5T_NATIVE_DOUBLE_NEG_INF_g = (double)0.0f; +float H5T_NATIVE_FLOAT_POS_INF_g = 0.0f; +float H5T_NATIVE_FLOAT_NEG_INF_g = 0.0f; +double H5T_NATIVE_DOUBLE_POS_INF_g = (double)0.0f; +double H5T_NATIVE_DOUBLE_NEG_INF_g = (double)0.0f; /* Declare the free list for H5T_t's and H5T_shared_t's */ H5FL_DEFINE(H5T_t); @@ -507,12 +507,12 @@ H5FL_DEFINE(H5T_shared_t); * which is used as the key by which the `entries' array is sorted. */ static struct { - int npaths; /*number of paths defined */ - size_t apaths; /*number of paths allocated */ - H5T_path_t **path; /*sorted array of path pointers */ - int nsoft; /*number of soft conversions defined */ - size_t asoft; /*number of soft conversions allocated */ - H5T_soft_t *soft; /*unsorted array of soft conversions */ + int npaths; /*number of paths defined */ + size_t apaths; /*number of paths allocated */ + H5T_path_t **path; /*sorted array of path pointers */ + int nsoft; /*number of soft conversions defined */ + size_t asoft; /*number of soft conversions allocated */ + H5T_soft_t *soft; /*unsorted array of soft conversions */ } H5T_g; /* Declare the free list for H5T_path_t's */ @@ -520,10 +520,10 @@ H5FL_DEFINE_STATIC(H5T_path_t); /* Datatype ID class */ static const H5I_class_t H5I_DATATYPE_CLS[1] = {{ - H5I_DATATYPE, /* ID class value */ - 0, /* Class flags */ - 8, /* # of reserved IDs for class */ - (H5I_free_t)H5T_close /* Callback routine for closing objects of this class */ + H5I_DATATYPE, /* ID class value */ + 0, /* Class flags */ + 8, /* # of reserved IDs for class */ + (H5I_free_t)H5T_close /* Callback routine for closing objects of this class */ }}; /* Flag indicating "top" of interface has been initialized */ @@ -532,14 +532,14 @@ static hbool_t H5T_top_package_initialize_s = FALSE; /*------------------------------------------------------------------------- - * Function: H5T_init + * Function: H5T_init * - * Purpose: Initialize the interface from some other package. + * Purpose: Initialize the interface from some other package. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, December 16, 1998 * *------------------------------------------------------------------------- @@ -558,15 +558,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__init_inf + * Function: H5T__init_inf * - * Purpose: Initialize the +/- Infinity floating-poing values for type + * Purpose: Initialize the +/- Infinity floating-poing values for type * conversion. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, November 22, 2003 * *------------------------------------------------------------------------- @@ -574,12 +574,12 @@ done: static herr_t H5T__init_inf(void) { - H5T_t *dst_p; /* Datatype type operate on */ - H5T_atomic_t *dst; /* Datatype's atomic info */ - uint8_t *d; /* Pointer to value to set */ - size_t half_size; /* Half the type size */ - size_t u; /* Local index value */ - herr_t ret_value = SUCCEED; /* Return value */ + H5T_t *dst_p; /* Datatype type operate on */ + H5T_atomic_t *dst; /* Datatype's atomic info */ + uint8_t *d; /* Pointer to value to set */ + size_t half_size; /* Half the type size */ + size_t u; /* Local index value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -707,26 +707,26 @@ H5T__init_package(void) H5T_t *std_u32be=NULL; /* Datatype structure for unsigned 32-bit big-endian integer */ H5T_t *std_u64le=NULL; /* Datatype structure for unsigned 64-bit little-endian integer */ H5T_t *std_u64be=NULL; /* Datatype structure for unsigned 64-bit big-endian integer */ - H5T_t *dt = NULL; - H5T_t *fixedpt=NULL; /* Datatype structure for native int */ - H5T_t *floatpt=NULL; /* Datatype structure for native float */ - H5T_t *string=NULL; /* Datatype structure for C string */ - H5T_t *bitfield=NULL; /* Datatype structure for bitfield */ - H5T_t *compound=NULL; /* Datatype structure for compound objects */ - H5T_t *enum_type=NULL; /* Datatype structure for enum objects */ - H5T_t *vlen=NULL; /* Datatype structure for vlen objects */ - H5T_t *array=NULL; /* Datatype structure for array objects */ - H5T_t *objref=NULL; /* Datatype structure for object reference objects */ + H5T_t *dt = NULL; + H5T_t *fixedpt=NULL; /* Datatype structure for native int */ + H5T_t *floatpt=NULL; /* Datatype structure for native float */ + H5T_t *string=NULL; /* Datatype structure for C string */ + H5T_t *bitfield=NULL; /* Datatype structure for bitfield */ + H5T_t *compound=NULL; /* Datatype structure for compound objects */ + H5T_t *enum_type=NULL; /* Datatype structure for enum objects */ + H5T_t *vlen=NULL; /* Datatype structure for vlen objects */ + H5T_t *array=NULL; /* Datatype structure for array objects */ + H5T_t *objref=NULL; /* Datatype structure for object reference objects */ hsize_t dim[1]={1}; /* Dimension info for array datatype */ - herr_t status; + herr_t status; unsigned copied_dtype=1; /* Flag to indicate whether datatype was copied or allocated (for error cleanup) */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Initialize the atom group for the file IDs */ if(H5I_register_type(H5I_DATATYPE_CLS) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Make certain there aren't too many classes of datatypes defined */ /* Only 16 (numbered 0-15) are supported in the current file format */ @@ -737,7 +737,7 @@ H5T__init_package(void) * the library configuration by H5detect. */ if(H5T__init_native() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Get the atomic datatype structures needed by the initialization code below */ if(NULL == (native_schar = (H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g))) @@ -982,13 +982,13 @@ H5T__init_package(void) fixedpt = native_int; floatpt = native_float; if (NULL == (compound = H5T__create(H5T_COMPOUND, (size_t)1))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if (NULL == (enum_type = H5T__create(H5T_ENUM, (size_t)1))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if (NULL == (vlen = H5T__vlen_create(native_int))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if (NULL == (array = H5T__array_create(native_int, 1, dim))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") status = 0; status |= H5T_register(H5T_PERS_SOFT, "i_i", fixedpt, fixedpt, H5T__conv_i_i, H5AC_noio_dxpl_id, FALSE); @@ -1247,7 +1247,7 @@ H5T__init_package(void) status |= H5T__init_inf(); if(status < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function(s)") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function(s)") /* Register datatype creation property class properties here. See similar * code in H5D__init_package(), etc. for example. @@ -1295,15 +1295,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__unlock_cb + * Function: H5T__unlock_cb * - * Purpose: Clear the immutable flag for a datatype. This function is - * called when the library is closing in order to unlock all - * registered datatypes and thus make them free-able. + * Purpose: Clear the immutable flag for a datatype. This function is + * called when the library is closing in order to unlock all + * registered datatypes and thus make them free-able. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, April 27, 1998 * *------------------------------------------------------------------------- @@ -1311,16 +1311,15 @@ done: static int H5T__unlock_cb(void *_dt, hid_t H5_ATTR_UNUSED id, void *_udata) { - H5T_t *dt = (H5T_t *)_dt; - int *n = (int *)_udata; + H5T_t *dt = (H5T_t *)_dt; + int *n = (int *)_udata; FUNC_ENTER_STATIC_NOERR HDassert(dt && dt->shared); if(H5T_STATE_IMMUTABLE==dt->shared->state) { - dt->shared->state = H5T_STATE_RDONLY; - + dt->shared->state = H5T_STATE_RDONLY; (*n)++; } /* end if */ @@ -1329,15 +1328,15 @@ H5T__unlock_cb(void *_dt, hid_t H5_ATTR_UNUSED id, void *_udata) /*------------------------------------------------------------------------- - * Function: H5T_top_term_package + * Function: H5T_top_term_package * - * Purpose: Close the "top" of the interface, releasing IDs, etc. + * Purpose: Close the "top" of the interface, releasing IDs, etc. * - * Return: Success: Positive if any action might have caused a - * change in some other interface; zero otherwise. - * Failure: Negative + * Return: Success: Positive if any action might have caused a + * change in some other interface; zero otherwise. + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 10, 2015 * *------------------------------------------------------------------------- @@ -1345,13 +1344,13 @@ H5T__unlock_cb(void *_dt, hid_t H5_ATTR_UNUSED id, void *_udata) int H5T_top_term_package(void) { - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5T_top_package_initialize_s) { - /* Unregister all conversion functions */ - if(H5T_g.path) { + /* Unregister all conversion functions */ + if(H5T_g.path) { int i, nprint = 0; for(i = 0; i < H5T_g.npaths; i++) { @@ -1367,9 +1366,9 @@ H5T_top_term_package(void) #ifdef H5T_DEBUG if (H5DEBUG(T)) { fprintf(H5DEBUG(T), "H5T: conversion function " - "0x%08lx failed to free private data for " - "%s (ignored)\n", - (unsigned long)(path->func), path->name); + "0x%08lx failed to free private data for " + "%s (ignored)\n", + (unsigned long)(path->func), path->name); } /* end if */ #endif H5E_clear_stack(NULL); /*ignore the error*/ @@ -1395,118 +1394,118 @@ H5T_top_term_package(void) n++; } /* end if */ - /* Unlock all datatypes, then free them */ - /* note that we are ignoring the return value from H5I_iterate() */ + /* Unlock all datatypes, then free them */ + /* note that we are ignoring the return value from H5I_iterate() */ /* Also note that we are incrementing 'n' in the callback */ - H5I_iterate(H5I_DATATYPE, H5T__unlock_cb, &n, FALSE); + H5I_iterate(H5I_DATATYPE, H5T__unlock_cb, &n, FALSE); /* Release all datatype IDs */ - if(H5I_nmembers(H5I_DATATYPE) > 0) { - (void)H5I_clear_type(H5I_DATATYPE, FALSE, FALSE); + if(H5I_nmembers(H5I_DATATYPE) > 0) { + (void)H5I_clear_type(H5I_DATATYPE, FALSE, FALSE); n++; /*H5I*/ - } /* end if */ + } /* end if */ /* Reset all the datatype IDs */ if(H5T_IEEE_F32BE_g > 0) { - H5T_IEEE_F32BE_g = FAIL; - H5T_IEEE_F32LE_g = FAIL; - H5T_IEEE_F64BE_g = FAIL; - H5T_IEEE_F64LE_g = FAIL; - - H5T_STD_I8BE_g = FAIL; - H5T_STD_I8LE_g = FAIL; - H5T_STD_I16BE_g = FAIL; - H5T_STD_I16LE_g = FAIL; - H5T_STD_I32BE_g = FAIL; - H5T_STD_I32LE_g = FAIL; - H5T_STD_I64BE_g = FAIL; - H5T_STD_I64LE_g = FAIL; - H5T_STD_U8BE_g = FAIL; - H5T_STD_U8LE_g = FAIL; - H5T_STD_U16BE_g = FAIL; - H5T_STD_U16LE_g = FAIL; - H5T_STD_U32BE_g = FAIL; - H5T_STD_U32LE_g = FAIL; - H5T_STD_U64BE_g = FAIL; - H5T_STD_U64LE_g = FAIL; - H5T_STD_B8BE_g = FAIL; - H5T_STD_B8LE_g = FAIL; - H5T_STD_B16BE_g = FAIL; - H5T_STD_B16LE_g = FAIL; - H5T_STD_B32BE_g = FAIL; - H5T_STD_B32LE_g = FAIL; - H5T_STD_B64BE_g = FAIL; - H5T_STD_B64LE_g = FAIL; - H5T_STD_REF_OBJ_g = FAIL; - H5T_STD_REF_DSETREG_g = FAIL; - - H5T_UNIX_D32BE_g = FAIL; - H5T_UNIX_D32LE_g = FAIL; - H5T_UNIX_D64BE_g = FAIL; - H5T_UNIX_D64LE_g = FAIL; - - H5T_C_S1_g = FAIL; - - H5T_FORTRAN_S1_g = FAIL; - - H5T_NATIVE_SCHAR_g = FAIL; - H5T_NATIVE_UCHAR_g = FAIL; - H5T_NATIVE_SHORT_g = FAIL; - H5T_NATIVE_USHORT_g = FAIL; - H5T_NATIVE_INT_g = FAIL; - H5T_NATIVE_UINT_g = FAIL; - H5T_NATIVE_LONG_g = FAIL; - H5T_NATIVE_ULONG_g = FAIL; - H5T_NATIVE_LLONG_g = FAIL; - H5T_NATIVE_ULLONG_g = FAIL; - H5T_NATIVE_FLOAT_g = FAIL; - H5T_NATIVE_DOUBLE_g = FAIL; + H5T_IEEE_F32BE_g = FAIL; + H5T_IEEE_F32LE_g = FAIL; + H5T_IEEE_F64BE_g = FAIL; + H5T_IEEE_F64LE_g = FAIL; + + H5T_STD_I8BE_g = FAIL; + H5T_STD_I8LE_g = FAIL; + H5T_STD_I16BE_g = FAIL; + H5T_STD_I16LE_g = FAIL; + H5T_STD_I32BE_g = FAIL; + H5T_STD_I32LE_g = FAIL; + H5T_STD_I64BE_g = FAIL; + H5T_STD_I64LE_g = FAIL; + H5T_STD_U8BE_g = FAIL; + H5T_STD_U8LE_g = FAIL; + H5T_STD_U16BE_g = FAIL; + H5T_STD_U16LE_g = FAIL; + H5T_STD_U32BE_g = FAIL; + H5T_STD_U32LE_g = FAIL; + H5T_STD_U64BE_g = FAIL; + H5T_STD_U64LE_g = FAIL; + H5T_STD_B8BE_g = FAIL; + H5T_STD_B8LE_g = FAIL; + H5T_STD_B16BE_g = FAIL; + H5T_STD_B16LE_g = FAIL; + H5T_STD_B32BE_g = FAIL; + H5T_STD_B32LE_g = FAIL; + H5T_STD_B64BE_g = FAIL; + H5T_STD_B64LE_g = FAIL; + H5T_STD_REF_OBJ_g = FAIL; + H5T_STD_REF_DSETREG_g = FAIL; + + H5T_UNIX_D32BE_g = FAIL; + H5T_UNIX_D32LE_g = FAIL; + H5T_UNIX_D64BE_g = FAIL; + H5T_UNIX_D64LE_g = FAIL; + + H5T_C_S1_g = FAIL; + + H5T_FORTRAN_S1_g = FAIL; + + H5T_NATIVE_SCHAR_g = FAIL; + H5T_NATIVE_UCHAR_g = FAIL; + H5T_NATIVE_SHORT_g = FAIL; + H5T_NATIVE_USHORT_g = FAIL; + H5T_NATIVE_INT_g = FAIL; + H5T_NATIVE_UINT_g = FAIL; + H5T_NATIVE_LONG_g = FAIL; + H5T_NATIVE_ULONG_g = FAIL; + H5T_NATIVE_LLONG_g = FAIL; + H5T_NATIVE_ULLONG_g = FAIL; + H5T_NATIVE_FLOAT_g = FAIL; + H5T_NATIVE_DOUBLE_g = FAIL; #if H5_SIZEOF_LONG_DOUBLE !=0 - H5T_NATIVE_LDOUBLE_g = FAIL; + H5T_NATIVE_LDOUBLE_g = FAIL; #endif - H5T_NATIVE_B8_g = FAIL; - H5T_NATIVE_B16_g = FAIL; - H5T_NATIVE_B32_g = FAIL; - H5T_NATIVE_B64_g = FAIL; - H5T_NATIVE_OPAQUE_g = FAIL; - H5T_NATIVE_HADDR_g = FAIL; - H5T_NATIVE_HSIZE_g = FAIL; - H5T_NATIVE_HSSIZE_g = FAIL; - H5T_NATIVE_HERR_g = FAIL; - H5T_NATIVE_HBOOL_g = FAIL; - - H5T_NATIVE_INT8_g = FAIL; - H5T_NATIVE_UINT8_g = FAIL; - H5T_NATIVE_INT_LEAST8_g = FAIL; - H5T_NATIVE_UINT_LEAST8_g = FAIL; - H5T_NATIVE_INT_FAST8_g = FAIL; - H5T_NATIVE_UINT_FAST8_g = FAIL; - - H5T_NATIVE_INT16_g = FAIL; - H5T_NATIVE_UINT16_g = FAIL; - H5T_NATIVE_INT_LEAST16_g = FAIL; - H5T_NATIVE_UINT_LEAST16_g = FAIL; - H5T_NATIVE_INT_FAST16_g = FAIL; - H5T_NATIVE_UINT_FAST16_g = FAIL; - - H5T_NATIVE_INT32_g = FAIL; - H5T_NATIVE_UINT32_g = FAIL; - H5T_NATIVE_INT_LEAST32_g = FAIL; - H5T_NATIVE_UINT_LEAST32_g = FAIL; - H5T_NATIVE_INT_FAST32_g = FAIL; - H5T_NATIVE_UINT_FAST32_g = FAIL; - - H5T_NATIVE_INT64_g = FAIL; - H5T_NATIVE_UINT64_g = FAIL; - H5T_NATIVE_INT_LEAST64_g = FAIL; - H5T_NATIVE_UINT_LEAST64_g = FAIL; - H5T_NATIVE_INT_FAST64_g = FAIL; - H5T_NATIVE_UINT_FAST64_g = FAIL; + H5T_NATIVE_B8_g = FAIL; + H5T_NATIVE_B16_g = FAIL; + H5T_NATIVE_B32_g = FAIL; + H5T_NATIVE_B64_g = FAIL; + H5T_NATIVE_OPAQUE_g = FAIL; + H5T_NATIVE_HADDR_g = FAIL; + H5T_NATIVE_HSIZE_g = FAIL; + H5T_NATIVE_HSSIZE_g = FAIL; + H5T_NATIVE_HERR_g = FAIL; + H5T_NATIVE_HBOOL_g = FAIL; + + H5T_NATIVE_INT8_g = FAIL; + H5T_NATIVE_UINT8_g = FAIL; + H5T_NATIVE_INT_LEAST8_g = FAIL; + H5T_NATIVE_UINT_LEAST8_g = FAIL; + H5T_NATIVE_INT_FAST8_g = FAIL; + H5T_NATIVE_UINT_FAST8_g = FAIL; + + H5T_NATIVE_INT16_g = FAIL; + H5T_NATIVE_UINT16_g = FAIL; + H5T_NATIVE_INT_LEAST16_g = FAIL; + H5T_NATIVE_UINT_LEAST16_g = FAIL; + H5T_NATIVE_INT_FAST16_g = FAIL; + H5T_NATIVE_UINT_FAST16_g = FAIL; + + H5T_NATIVE_INT32_g = FAIL; + H5T_NATIVE_UINT32_g = FAIL; + H5T_NATIVE_INT_LEAST32_g = FAIL; + H5T_NATIVE_UINT_LEAST32_g = FAIL; + H5T_NATIVE_INT_FAST32_g = FAIL; + H5T_NATIVE_UINT_FAST32_g = FAIL; + + H5T_NATIVE_INT64_g = FAIL; + H5T_NATIVE_UINT64_g = FAIL; + H5T_NATIVE_INT_LEAST64_g = FAIL; + H5T_NATIVE_UINT_LEAST64_g = FAIL; + H5T_NATIVE_INT_FAST64_g = FAIL; + H5T_NATIVE_UINT_FAST64_g = FAIL; n++; } /* end if */ - /* Mark "top" of interface as closed */ + /* Mark "top" of interface as closed */ if(0 == n) H5T_top_package_initialize_s = FALSE; } /* end if */ @@ -1516,19 +1515,19 @@ H5T_top_term_package(void) /*------------------------------------------------------------------------- - * Function: H5T_term_package + * Function: H5T_term_package * - * Purpose: Close this interface. + * Purpose: Close this interface. * - * Note: Finishes shutting down the interface, after - * H5T_top_term_package() is called + * Note: Finishes shutting down the interface, after + * H5T_top_term_package() is called * - * Return: Success: Positive if any action might have caused a - * change in some other interface; zero - * otherwise. - * Failure: Negative + * Return: Success: Positive if any action might have caused a + * change in some other interface; zero + * otherwise. + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, November 20, 1998 * *------------------------------------------------------------------------- @@ -1536,7 +1535,7 @@ H5T_top_term_package(void) int H5T_term_package(void) { - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1546,9 +1545,9 @@ H5T_term_package(void) HDassert(FALSE == H5T_top_package_initialize_s); /* Destroy the datatype object id group */ - n += (H5I_dec_type_ref(H5I_DATATYPE) > 0); + n += (H5I_dec_type_ref(H5I_DATATYPE) > 0); - /* Mark interface as closed */ + /* Mark interface as closed */ if(0 == n) H5_PKG_INIT_VAR = FALSE; } /* end if */ @@ -1558,47 +1557,44 @@ H5T_term_package(void) /*------------------------------------------------------------------------- - * Function: H5Tcreate + * Function: H5Tcreate * - * Purpose: Create a new type and initialize it to reasonable values. - * The type is a member of type class TYPE and is SIZE bytes. + * Purpose: Create a new type and initialize it to reasonable values. + * The type is a member of type class TYPE and is SIZE bytes. * - * Return: Success: A new type identifier. + * Return: Success: A new type identifier. * - * Failure: Negative + * Failure: Negative * * Errors: - * ARGS BADVALUE Invalid size. - * DATATYPE CANTINIT Can't create type. - * DATATYPE CANTREGISTER Can't register datatype atom. - * - * Programmer: Robb Matzke - * Friday, December 5, 1997 - * - * Modifications: + * ARGS BADVALUE Invalid size. + * DATATYPE CANTINIT Can't create type. + * DATATYPE CANTREGISTER Can't register datatype atom. * + * Programmer: Robb Matzke + * Friday, December 5, 1997 *------------------------------------------------------------------------- */ hid_t H5Tcreate(H5T_class_t type, size_t size) { - H5T_t *dt = NULL; /* New datatype constructed */ - hid_t ret_value; /* Return value */ + H5T_t *dt = NULL; /* New datatype constructed */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("i", "Ttz", type, size); /* check args. We support string (fixed-size or variable-length) now. */ if(size <= 0 && size != H5T_VARIABLE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size must be positive") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size must be positive") /* create the type */ if(NULL == (dt = H5T__create(type, size))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create type") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create type") /* Get an ID for the datatype */ if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype ID") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype ID") done: FUNC_LEAVE_API(ret_value) @@ -1606,35 +1602,35 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tcopy + * Function: H5Tcopy * - * Purpose: Copies a datatype. The resulting datatype is not locked. - * The datatype should be closed when no longer needed by - * calling H5Tclose(). + * Purpose: Copies a datatype. The resulting datatype is not locked. + * The datatype should be closed when no longer needed by + * calling H5Tclose(). * - * Return: Success: The ID of a new datatype. + * Return: Success: The ID of a new datatype. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 * * Modifications: * - * Robb Matzke, 4 Jun 1998 - * The returned type is always transient and unlocked. If the TYPE_ID - * argument is a dataset instead of a datatype then this function - * returns a transient, modifiable datatype which is a copy of the - * dataset's datatype. + * Robb Matzke, 4 Jun 1998 + * The returned type is always transient and unlocked. If the TYPE_ID + * argument is a dataset instead of a datatype then this function + * returns a transient, modifiable datatype which is a copy of the + * dataset's datatype. * *------------------------------------------------------------------------- */ hid_t H5Tcopy(hid_t type_id) { - H5T_t *dt; /* Pointer to the datatype to copy */ - H5T_t *new_dt = NULL; - hid_t ret_value; /* Return value */ + H5T_t *dt; /* Pointer to the datatype to copy */ + H5T_t *new_dt = NULL; + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", type_id); @@ -1648,7 +1644,7 @@ H5Tcopy(hid_t type_id) case H5I_DATASET: { - H5D_t *dset; /* Dataset for datatype */ + H5D_t *dset; /* Dataset for datatype */ /* The argument is a dataset handle */ if(NULL == (dset = (H5D_t *)H5I_object(type_id))) @@ -1678,11 +1674,11 @@ H5Tcopy(hid_t type_id) /* Copy datatype */ if(NULL == (new_dt = H5T_copy(dt, H5T_COPY_TRANSIENT))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy"); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy"); /* Atomize result */ if((ret_value = H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") done: if(ret_value < 0) @@ -1694,23 +1690,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tclose - * - * Purpose: Frees a datatype and all associated memory. + * Function: H5Tclose * - * Return: Non-negative on success/Negative on failure + * Purpose: Frees a datatype and all associated memory. * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 - * - * Modifications: + * Return: Non-negative on success/Negative on failure * + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 *------------------------------------------------------------------------- */ herr_t H5Tclose(hid_t type_id) { - H5T_t *dt; /* Pointer to datatype to close */ + H5T_t *dt; /* Pointer to datatype to close */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1718,13 +1711,13 @@ H5Tclose(hid_t type_id) /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_STATE_IMMUTABLE == dt->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "immutable datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "immutable datatype") /* When the reference count reaches zero the resources are freed */ if(H5I_dec_app_ref(type_id) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id") + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id") done: FUNC_LEAVE_API(ret_value) @@ -1732,34 +1725,34 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tequal + * Function: H5Tequal * - * Purpose: Determines if two datatypes are equal. + * Purpose: Determines if two datatypes are equal. * - * Return: Success: TRUE if equal, FALSE if unequal + * Return: Success: TRUE if equal, FALSE if unequal * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Wednesday, December 10, 1997 + * Programmer: Robb Matzke + * Wednesday, December 10, 1997 * *------------------------------------------------------------------------- */ htri_t H5Tequal(hid_t type1_id, hid_t type2_id) { - const H5T_t *dt1; /* Pointer to first datatype */ - const H5T_t *dt2; /* Pointer to second datatype */ - htri_t ret_value; /* Return value */ + const H5T_t *dt1; /* Pointer to first datatype */ + const H5T_t *dt2; /* Pointer to second datatype */ + htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("t", "ii", type1_id, type2_id); /* check args */ if(NULL == (dt1 = (H5T_t *)H5I_object_verify(type1_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(NULL == (dt2 = (H5T_t *)H5I_object_verify(type2_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") ret_value = (0 == H5T_cmp(dt1, dt2, FALSE)) ? TRUE : FALSE; @@ -1769,33 +1762,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tlock + * Function: H5Tlock * - * Purpose: Locks a type, making it read only and non-destructable. This - * is normally done by the library for predefined datatypes so - * the application doesn't inadvertently change or delete a - * predefined type. + * Purpose: Locks a type, making it read only and non-destructable. This + * is normally done by the library for predefined datatypes so + * the application doesn't inadvertently change or delete a + * predefined type. * - * Once a datatype is locked it can never be unlocked unless - * the entire library is closed. + * Once a datatype is locked it can never be unlocked unless + * the entire library is closed. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Friday, January 9, 1998 + * Programmer: Robb Matzke + * Friday, January 9, 1998 * * Modifications: * - * Robb Matzke, 1 Jun 1998 - * It is illegal to lock a named datatype since we must allow named - * types to be closed (to release file resources) but locking a type - * prevents that. + * Robb Matzke, 1 Jun 1998 + * It is illegal to lock a named datatype since we must allow named + * types to be closed (to release file resources) but locking a type + * prevents that. *------------------------------------------------------------------------- */ herr_t H5Tlock(hid_t type_id) { - H5T_t *dt; /* Datatype to operate on */ + H5T_t *dt; /* Datatype to operate on */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1803,12 +1796,12 @@ H5Tlock(hid_t type_id) /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_STATE_NAMED==dt->shared->state || H5T_STATE_OPEN==dt->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to lock named datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to lock named datatype") if(H5T_lock(dt, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype") done: FUNC_LEAVE_API(ret_value) @@ -1816,24 +1809,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tget_class + * Function: H5Tget_class * - * Purpose: Returns the datatype class identifier for datatype TYPE_ID. + * Purpose: Returns the datatype class identifier for datatype TYPE_ID. * - * Return: Success: One of the non-negative datatype class - * constants. + * Return: Success: One of the non-negative datatype class constants. * - * Failure: H5T_NO_CLASS (Negative) + * Failure: H5T_NO_CLASS (Negative) * - * Programmer: Robb Matzke - * Monday, December 8, 1997 + * Programmer: Robb Matzke + * Monday, December 8, 1997 * *------------------------------------------------------------------------- */ H5T_class_t H5Tget_class(hid_t type_id) { - H5T_t *dt; /* Pointer to datatype */ + H5T_t *dt; /* Pointer to datatype */ H5T_class_t ret_value; /* Return value */ FUNC_ENTER_API(H5T_NO_CLASS) @@ -1841,7 +1833,7 @@ H5Tget_class(hid_t type_id) /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a datatype") /* Set return value */ ret_value = H5T_get_class(dt, FALSE); @@ -1852,17 +1844,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_get_class + * Function: H5T_get_class * - * Purpose: Returns the data type class identifier for a datatype ptr. + * Purpose: Returns the data type class identifier for a datatype ptr. * - * Return: Success: One of the non-negative data type class - * constants. + * Return: Success: One of the non-negative data type class constants. * - * Failure: H5T_NO_CLASS (Negative) + * Failure: H5T_NO_CLASS (Negative) * - * Programmer: Robb Matzke - * Monday, December 8, 1997 + * Programmer: Robb Matzke + * Monday, December 8, 1997 * * Modifications: * Broke out from H5Tget_class - QAK - 6/4/99 @@ -1881,7 +1872,8 @@ H5T_get_class(const H5T_t *dt, htri_t internal) /* Externally, a VL string is a string; internally, a VL string is a VL. */ if(internal) { ret_value=dt->shared->type; - } else { + } + else { if(H5T_IS_VL_STRING(dt->shared)) ret_value=H5T_STRING; else @@ -1894,24 +1886,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tdetect_class - * - * Purpose: Check whether a datatype contains (or is) a certain type of - * datatype. + * Function: H5Tdetect_class * - * Return: TRUE (1) or FALSE (0) on success/Negative on failure + * Purpose: Check whether a datatype contains (or is) a certain type of + * datatype. * - * Programmer: Quincey Koziol - * Wednesday, November 29, 2000 - * - * Modifications: + * Return: TRUE (1) or FALSE (0) on success/Negative on failure * + * Programmer: Quincey Koziol + * Wednesday, November 29, 2000 *------------------------------------------------------------------------- */ htri_t H5Tdetect_class(hid_t type, H5T_class_t cls) { - H5T_t *dt; /* Datatype to query */ + H5T_t *dt; /* Datatype to query */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1933,15 +1922,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_detect_class + * Function: H5T_detect_class * - * Purpose: Check whether a datatype contains (or is) a certain type of - * datatype. + * Purpose: Check whether a datatype contains (or is) a certain type of + * datatype. * - * Return: TRUE (1) or FALSE (0) on success/Negative on failure + * Return: TRUE (1) or FALSE (0) on success/Negative on failure * - * Programmer: Quincey Koziol - * Wednesday, November 29, 2000 + * Programmer: Quincey Koziol + * Wednesday, November 29, 2000 * * Modifications: * Raymond Lu @@ -1957,7 +1946,7 @@ done: htri_t H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api) { - unsigned i; + unsigned i; htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2018,21 +2007,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tis_variable_str + * Function: H5Tis_variable_str * - * Purpose: Check whether a datatype is a variable-length string + * Purpose: Check whether a datatype is a variable-length string * - * Return: TRUE (1) or FALSE (0) on success/Negative on failure + * Return: TRUE (1) or FALSE (0) on success/Negative on failure * - * Programmer: Raymond Lu - * November 4, 2002 + * Programmer: Raymond Lu + * November 4, 2002 * *------------------------------------------------------------------------- */ htri_t H5Tis_variable_str(hid_t dtype_id) { - H5T_t *dt; /* Datatype to query */ + H5T_t *dt; /* Datatype to query */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2052,14 +2041,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_is_variable_str + * Function: H5T_is_variable_str * - * Purpose: Check whether a datatype is a variable-length string + * Purpose: Check whether a datatype is a variable-length string * - * Return: TRUE (1) or FALSE (0) on success/Negative on failure + * Return: TRUE (1) or FALSE (0) on success/Negative on failure * - * Programmer: Quincey Koziol - * October 17, 2007 + * Programmer: Quincey Koziol + * October 17, 2007 * *------------------------------------------------------------------------- */ @@ -2073,33 +2062,33 @@ H5T_is_variable_str(const H5T_t *dt) /*------------------------------------------------------------------------- - * Function: H5Tget_size + * Function: H5Tget_size * - * Purpose: Determines the total size of a datatype in bytes. + * Purpose: Determines the total size of a datatype in bytes. * - * Return: Success: Size of the datatype in bytes. The size of - * datatype is the size of an instance of that - * datatype. + * Return: Success: Size of the datatype in bytes. The size of + * datatype is the size of an instance of that + * datatype. * - * Failure: 0 (valid datatypes are never zero size) + * Failure: 0 (valid datatypes are never zero size) * - * Programmer: Robb Matzke - * Monday, December 8, 1997 + * Programmer: Robb Matzke + * Monday, December 8, 1997 * *------------------------------------------------------------------------- */ size_t H5Tget_size(hid_t type_id) { - H5T_t *dt; /* Datatype to query */ - size_t ret_value; /* Return value */ + H5T_t *dt; /* Datatype to query */ + size_t ret_value; /* Return value */ FUNC_ENTER_API(0) H5TRACE1("z", "i", type_id); /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") /* size */ ret_value = H5T_GET_SIZE(dt); @@ -2110,33 +2099,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tset_size + * Function: H5Tset_size * - * Purpose: Sets the total size in bytes for a datatype (this operation - * is not permitted on reference datatypes). If the size is - * decreased so that the significant bits of the datatype - * extend beyond the edge of the new size, then the `offset' - * property is decreased toward zero. If the `offset' becomes - * zero and the significant bits of the datatype still hang - * over the edge of the new size, then the number of significant - * bits is decreased. + * Purpose: Sets the total size in bytes for a datatype (this operation + * is not permitted on reference datatypes). If the size is + * decreased so that the significant bits of the datatype + * extend beyond the edge of the new size, then the `offset' + * property is decreased toward zero. If the `offset' becomes + * zero and the significant bits of the datatype still hang + * over the edge of the new size, then the number of significant + * bits is decreased. * - * Adjusting the size of an H5T_STRING automatically sets the - * precision to 8*size. + * Adjusting the size of an H5T_STRING automatically sets the + * precision to 8*size. * - * All datatypes have a positive size. + * All datatypes have a positive size. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Wednesday, January 7, 1998 + * Programmer: Robb Matzke + * Wednesday, January 7, 1998 * *------------------------------------------------------------------------- */ herr_t H5Tset_size(hid_t type_id, size_t size) { - H5T_t *dt; /* Datatype to modify */ + H5T_t *dt; /* Datatype to modify */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2144,21 +2133,21 @@ H5Tset_size(hid_t type_id, size_t size) /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_STATE_TRANSIENT!=dt->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only") + HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only") if(size <= 0 && size != H5T_VARIABLE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size must be positive") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size must be positive") if(size == H5T_VARIABLE && !H5T_IS_STRING(dt->shared)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "only strings may be variable length") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "only strings may be variable length") if(H5T_ENUM == dt->shared->type && dt->shared->u.enumer.nmembs > 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined") if(H5T_REFERENCE == dt->shared->type) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for this datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for this datatype") /* Modify the datatype */ if(H5T_set_size(dt, size) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set size for datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set size for datatype") done: FUNC_LEAVE_API(ret_value) @@ -2166,38 +2155,35 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tget_super + * Function: H5Tget_super * - * Purpose: Returns the type from which TYPE is derived. In the case of - * an enumeration type the return value is an integer type. + * Purpose: Returns the type from which TYPE is derived. In the case of + * an enumeration type the return value is an integer type. * - * Return: Success: Type ID for base datatype. + * Return: Success: Type ID for base datatype. * - * Failure: negative + * Failure: negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, December 23, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ hid_t H5Tget_super(hid_t type) { - H5T_t *dt; /* Datatype to query */ - H5T_t *super = NULL; /* Supertype */ - hid_t ret_value; /* Return value */ + H5T_t *dt; /* Datatype to query */ + H5T_t *super = NULL; /* Supertype */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", type); if(NULL == (dt = (H5T_t *)H5I_object_verify(type,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(NULL == (super = H5T_get_super(dt))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "not a datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "not a datatype") if((ret_value = H5I_register(H5I_DATATYPE, super, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register parent datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register parent datatype") done: if(ret_value < 0) @@ -2209,36 +2195,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_get_super + * Function: H5T_get_super * - * Purpose: Private function for H5Tget_super. Returns the type from - * which TYPE is derived. In the case of an enumeration type - * the return value is an integer type. + * Purpose: Private function for H5Tget_super. Returns the type from + * which TYPE is derived. In the case of an enumeration type + * the return value is an integer type. * - * Return: Success: Data type for base data type. + * Return: Success: Data type for base data type. * - * Failure: NULL + * Failure: NULL * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * October 9, 2002 - * - * Modifications: - * *------------------------------------------------------------------------- */ H5T_t * H5T_get_super(const H5T_t *dt) { - H5T_t *ret_value=NULL; + H5T_t *ret_value=NULL; FUNC_ENTER_NOAPI(NULL) HDassert(dt); if (!dt->shared->parent) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "not a derived data type"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "not a derived data type"); if (NULL==(ret_value=H5T_copy(dt->shared->parent, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy parent data type"); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy parent data type"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2246,37 +2229,34 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_register - * - * Purpose: Register a hard or soft conversion function for a data type - * conversion path. The path is specified by the source and - * destination data types SRC_ID and DST_ID (for soft functions - * only the class of these types is important). If FUNC is a - * hard function then it replaces any previous path; if it's a - * soft function then it replaces all existing paths to which it - * applies and is used for any new path to which it applies as - * long as that path doesn't have a hard function. + * Function: H5T_register * - * Return: Non-negative on success/Negative on failure + * Purpose: Register a hard or soft conversion function for a data type + * conversion path. The path is specified by the source and + * destination data types SRC_ID and DST_ID (for soft functions + * only the class of these types is important). If FUNC is a + * hard function then it replaces any previous path; if it's a + * soft function then it replaces all existing paths to which it + * applies and is used for any new path to which it applies as + * long as that path doesn't have a hard function. * - * Programmer: Robb Matzke - * Friday, January 9, 1998 - * - * Modifications: + * Return: Non-negative on success/Negative on failure * + * Programmer: Robb Matzke + * Friday, January 9, 1998 *------------------------------------------------------------------------- */ static herr_t H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, - H5T_conv_t func, hid_t dxpl_id, hbool_t api_call) + H5T_conv_t func, hid_t dxpl_id, hbool_t api_call) { - hid_t tmp_sid=-1, tmp_did=-1;/*temporary data type IDs */ - H5T_path_t *old_path=NULL; /*existing conversion path */ - H5T_path_t *new_path=NULL; /*new conversion path */ - H5T_cdata_t cdata; /*temporary conversion data */ - int nprint=0; /*number of paths shut down */ - int i; /*counter */ - herr_t ret_value=SUCCEED; /*return value */ + hid_t tmp_sid = -1, tmp_did = -1; /*temporary data type IDs */ + H5T_path_t *old_path = NULL; /*existing conversion path */ + H5T_path_t *new_path = NULL; /*new conversion path */ + H5T_cdata_t cdata; /*temporary conversion data */ + int nprint=0; /*number of paths shut down */ + int i; /*counter */ + herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_NOAPI_NOINIT @@ -2304,7 +2284,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, for(i = 0; i < H5T_g.npaths; i++) if(new_path != H5T_g.path[i]) H5T_g.path[i]->cdata.recalc = TRUE; - } /* end if */ + } /* end if */ } /* end if */ else { /* Add function to end of soft list */ @@ -2375,11 +2355,11 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, if ((old_path->func)(tmp_sid, tmp_did, &(old_path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id)<0) { #ifdef H5T_DEBUG - if (H5DEBUG(T)) { - fprintf (H5DEBUG(T), "H5T: conversion function 0x%08lx " - "failed to free private data for %s (ignored)\n", - (unsigned long)(old_path->func), old_path->name); - } + if (H5DEBUG(T)) { + fprintf (H5DEBUG(T), "H5T: conversion function 0x%08lx " + "failed to free private data for %s (ignored)\n", + (unsigned long)(old_path->func), old_path->name); + } #endif } /* end if */ H5T_close(old_path->src); @@ -2392,23 +2372,23 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, tmp_sid = tmp_did = -1; /* We don't care about any failures during the freeing process */ - H5E_clear_stack(NULL); + H5E_clear_stack(NULL); } /* end for */ } /* end else */ done: if(ret_value < 0) { - if(new_path) { - if(new_path->src) - H5T_close(new_path->src); - if(new_path->dst) - H5T_close(new_path->dst); - new_path = H5FL_FREE(H5T_path_t, new_path); - } /* end if */ - if(tmp_sid >= 0) - H5I_dec_ref(tmp_sid); - if(tmp_did >= 0) - H5I_dec_ref(tmp_did); + if(new_path) { + if(new_path->src) + H5T_close(new_path->src); + if(new_path->dst) + H5T_close(new_path->dst); + new_path = H5FL_FREE(H5T_path_t, new_path); + } /* end if */ + if(tmp_sid >= 0) + H5I_dec_ref(tmp_sid); + if(tmp_did >= 0) + H5I_dec_ref(tmp_did); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -2416,50 +2396,50 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tregister + * Function: H5Tregister * - * Purpose: Register a hard or soft conversion function for a data type - * conversion path. The path is specified by the source and - * destination data types SRC_ID and DST_ID (for soft functions - * only the class of these types is important). If FUNC is a - * hard function then it replaces any previous path; if it's a - * soft function then it replaces all existing paths to which it - * applies and is used for any new path to which it applies as - * long as that path doesn't have a hard function. + * Purpose: Register a hard or soft conversion function for a data type + * conversion path. The path is specified by the source and + * destination data types SRC_ID and DST_ID (for soft functions + * only the class of these types is important). If FUNC is a + * hard function then it replaces any previous path; if it's a + * soft function then it replaces all existing paths to which it + * applies and is used for any new path to which it applies as + * long as that path doesn't have a hard function. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Friday, January 9, 1998 + * Programmer: Robb Matzke + * Friday, January 9, 1998 * *------------------------------------------------------------------------- */ herr_t H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, - H5T_conv_t func) + H5T_conv_t func) { - H5T_t *src; /*source data type descriptor */ - H5T_t *dst; /*destination data type desc */ - herr_t ret_value = SUCCEED; /*return value */ + H5T_t *src; /*source data type descriptor */ + H5T_t *dst; /*destination data type desc */ + herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "Te*siix", pers, name, src_id, dst_id, func); /* Check args */ if(H5T_PERS_HARD != pers && H5T_PERS_SOFT != pers) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid function persistence") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid function persistence") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "conversion must have a name for debugging") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "conversion must have a name for debugging") if(NULL == (src = (H5T_t *)H5I_object_verify(src_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") if(NULL == (dst = (H5T_t *)H5I_object_verify(dst_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") if(!func) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no conversion function specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no conversion function specified") /* Go register the function */ if(H5T_register(pers, name, src, dst, func, H5AC_noio_dxpl_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register conversion function") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register conversion function") done: FUNC_LEAVE_API(ret_value) @@ -2467,18 +2447,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_unregister + * Function: H5T_unregister * - * Purpose: Removes conversion paths that match the specified criteria. - * All arguments are optional. Missing arguments are wild cards. - * The special no-op path cannot be removed. + * Purpose: Removes conversion paths that match the specified criteria. + * All arguments are optional. Missing arguments are wild cards. + * The special no-op path cannot be removed. * - * Return: Succeess: non-negative + * Return: Succeess: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Robb Matzke - * Tuesday, January 13, 1998 + * Programmer: Robb Matzke + * Tuesday, January 13, 1998 * * Modifications: * Adapted to non-API function - QAK, 11/17/99 @@ -2487,12 +2467,12 @@ done: */ static herr_t H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, - H5T_conv_t func, hid_t dxpl_id) + H5T_conv_t func, hid_t dxpl_id) { - H5T_path_t *path = NULL; /*conversion path */ - H5T_soft_t *soft = NULL; /*soft conversion information */ - int nprint = 0; /*number of paths shut down */ - int i; /*counter */ + H5T_path_t *path = NULL; /*conversion path */ + H5T_soft_t *soft = NULL; /*soft conversion information */ + int nprint = 0; /*number of paths shut down */ + int i; /*counter */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2566,27 +2546,27 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /*------------------------------------------------------------------------- - * Function: H5Tunregister + * Function: H5Tunregister * - * Purpose: Removes conversion paths that match the specified criteria. - * All arguments are optional. Missing arguments are wild cards. - * The special no-op path cannot be removed. + * Purpose: Removes conversion paths that match the specified criteria. + * All arguments are optional. Missing arguments are wild cards. + * The special no-op path cannot be removed. * - * Return: Succeess: non-negative + * Return: Succeess: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Robb Matzke - * Tuesday, January 13, 1998 + * Programmer: Robb Matzke + * Tuesday, January 13, 1998 * *------------------------------------------------------------------------- */ herr_t H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, - H5T_conv_t func) + H5T_conv_t func) { - H5T_t *src = NULL, *dst = NULL; /* Datatype descriptors */ - herr_t ret_value = SUCCEED; /* Return value */ + H5T_t *src = NULL, *dst = NULL; /* Datatype descriptors */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "Te*siix", pers, name, src_id, dst_id, func); @@ -2606,29 +2586,29 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tfind + * Function: H5Tfind * - * Purpose: Finds a conversion function that can handle a conversion from - * type SRC_ID to type DST_ID. The PCDATA argument is a pointer - * to a pointer to type conversion data which was created and - * initialized by the type conversion function of this path - * when the conversion function was installed on the path. + * Purpose: Finds a conversion function that can handle a conversion from + * type SRC_ID to type DST_ID. The PCDATA argument is a pointer + * to a pointer to type conversion data which was created and + * initialized by the type conversion function of this path + * when the conversion function was installed on the path. * - * Return: Success: A pointer to a suitable conversion function. + * Return: Success: A pointer to a suitable conversion function. * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke - * Tuesday, January 13, 1998 + * Programmer: Robb Matzke + * Tuesday, January 13, 1998 * *------------------------------------------------------------------------- */ H5T_conv_t H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) { - H5T_t *src, *dst; - H5T_path_t *path; - H5T_conv_t ret_value; /* Return value */ + H5T_t *src, *dst; + H5T_path_t *path; + H5T_conv_t ret_value; /* Return value */ FUNC_ENTER_API(NULL) H5TRACE3("x", "ii**x", src_id, dst_id, pcdata); @@ -2636,13 +2616,13 @@ H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) /* Check args */ if(NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)) || NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") if(!pcdata) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no address to receive cdata pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no address to receive cdata pointer") /* Find it */ if(NULL == (path = H5T_path_find(src, dst, NULL, NULL, H5AC_noio_dxpl_id, FALSE))) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "conversion function not found") + HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "conversion function not found") if(pcdata) *pcdata = &(path->cdata); @@ -2656,27 +2636,27 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tcompiler_conv + * Function: H5Tcompiler_conv * - * Purpose: Finds out whether the library's conversion function from - * type src_id to type dst_id is a compiler (hard) conversion. - * A hard conversion uses compiler's casting; a soft conversion - * uses the library's own conversion function. + * Purpose: Finds out whether the library's conversion function from + * type src_id to type dst_id is a compiler (hard) conversion. + * A hard conversion uses compiler's casting; a soft conversion + * uses the library's own conversion function. * - * Return: TRUE: hard conversion. - * FALSE: soft conversion. - * FAIL: failed. + * Return: TRUE: hard conversion. + * FALSE: soft conversion. + * FAIL: failed. * - * Programmer: Raymond Lu - * Friday, Sept 2, 2005 + * Programmer: Raymond Lu + * Friday, Sept 2, 2005 * *------------------------------------------------------------------------- */ htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id) { - H5T_t *src, *dst; - htri_t ret_value; /* Return value */ + H5T_t *src, *dst; + htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("t", "ii", src_id, dst_id); @@ -2684,11 +2664,11 @@ H5Tcompiler_conv(hid_t src_id, hid_t dst_id) /* Check args */ if(NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)) || NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") /* Find it */ if((ret_value = H5T_compiler_conv(src, dst)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") + HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") done: FUNC_LEAVE_API(ret_value) @@ -2696,35 +2676,35 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tconvert - * - * Purpose: Convert NELMTS elements from type SRC_ID to type DST_ID. The - * source elements are packed in BUF and on return the - * destination will be packed in BUF. That is, the conversion - * is performed in place. The optional background buffer is an - * array of NELMTS values of destination type which are merged - * with the converted values to fill in cracks (for instance, - * BACKGROUND might be an array of structs with the `a' and `b' - * fields already initialized and the conversion of BUF supplies - * the `c' and `d' field values). The PLIST_ID a dataset transfer - * property list which is passed to the conversion functions. (It's - * currently only used to pass along the VL datatype custom allocation - * information -QAK 7/1/99) - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke + * Function: H5Tconvert + * + * Purpose: Convert NELMTS elements from type SRC_ID to type DST_ID. The + * source elements are packed in BUF and on return the + * destination will be packed in BUF. That is, the conversion + * is performed in place. The optional background buffer is an + * array of NELMTS values of destination type which are merged + * with the converted values to fill in cracks (for instance, + * BACKGROUND might be an array of structs with the `a' and `b' + * fields already initialized and the conversion of BUF supplies + * the `c' and `d' field values). The PLIST_ID a dataset transfer + * property list which is passed to the conversion functions. (It's + * currently only used to pass along the VL datatype custom allocation + * information -QAK 7/1/99) + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke * Wednesday, June 10, 1998 * *------------------------------------------------------------------------- */ herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, - void *background, hid_t dxpl_id) + void *background, hid_t dxpl_id) { - H5T_path_t *tpath; /*type conversion info */ - H5T_t *src, *dst; /*unatomized types */ - herr_t ret_value = SUCCEED; /* Return value */ + H5T_path_t *tpath; /* type conversion info */ + H5T_t *src, *dst; /* unatomized types */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "iiz*x*xi", src_id, dst_id, nelmts, buf, background, dxpl_id); @@ -2732,7 +2712,7 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, /* Check args */ if(NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)) || NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") if(H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; else @@ -2741,7 +2721,7 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, /* Find the conversion function */ if(NULL == (tpath = H5T_path_find(src, dst, NULL, NULL, dxpl_id, FALSE))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst data types") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst data types") if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, buf, background, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed") @@ -2752,17 +2732,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tencode + * Function: H5Tencode * - * Purpose: Given an datatype ID, converts the object description into - * binary in a buffer. + * Purpose: Given an datatype ID, converts the object description into + * binary in a buffer. * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu + * Programmer: Raymond Lu * July 14, 2004 * *------------------------------------------------------------------------- @@ -2778,13 +2757,13 @@ H5Tencode(hid_t obj_id, void *buf, size_t *nalloc) /* Check argument and retrieve object */ if(NULL == (dtype = (H5T_t *)H5I_object_verify(obj_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(nalloc == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL pointer for buffer size") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL pointer for buffer size") /* Go encode the datatype */ if(H5T_encode(dtype, (unsigned char *)buf, nalloc) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype") done: FUNC_LEAVE_API(ret_value) @@ -2792,24 +2771,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Tdecode + * Function: H5Tdecode * - * Purpose: Decode a binary object description and return a new object - * handle. + * Purpose: Decode a binary object description and return a new object + * handle. * - * Return: Success: datatype ID(non-negative) + * Return: Success: datatype ID(non-negative) * - * Failure: negative + * Failure: negative * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu + * Programmer: Raymond Lu * July 14, 2004 * * Modification:Raymond Lu - * songyulu@hdfgroup.org * 17 February 2011 * I changed the value for the APP_REF parameter of H5I_register - * from FALSE to TRUE. + * from FALSE to TRUE. *------------------------------------------------------------------------- */ hid_t @@ -2823,15 +2800,15 @@ H5Tdecode(const void *buf) /* Check args */ if(buf == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "empty buffer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "empty buffer") /* Create datatype by decoding buffer */ if(NULL == (dt = H5T_decode((const unsigned char *)buf))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "can't decode object") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "can't decode object") /* Register the type and return the ID */ if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type") done: FUNC_LEAVE_API(ret_value) @@ -2844,17 +2821,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_encode + * Function: H5T_encode * - * Purpose: Private function for H5Tencode. Converts an object - * description into binary in a buffer. + * Purpose: Private function for H5Tencode. Converts an object + * description into binary in a buffer. * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu + * Programmer: Raymond Lu * July 14, 2004 * *------------------------------------------------------------------------- @@ -2870,11 +2846,11 @@ H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc) /* Allocate "fake" file structure */ if(NULL == (f = H5F_fake_alloc((uint8_t)0))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct") /* Find out the size of buffer needed */ if((buf_size = H5O_msg_raw_size(f, H5O_DTYPE_ID, TRUE, obj)) == 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "can't find datatype size") + HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "can't find datatype size") /* Don't encode if buffer size isn't big enough or buffer is empty */ if(!buf || *nalloc < (buf_size + 1 + 1)) @@ -2901,17 +2877,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_decode + * Function: H5T_decode * - * Purpose: Private function for H5Tdecode. Reconstructs a binary - * description of datatype and returns a new object handle. + * Purpose: Private function for H5Tdecode. Reconstructs a binary + * description of datatype and returns a new object handle. * - * Return: Success: datatype ID(non-negative) + * Return: Success: datatype ID(non-negative) * - * Failure: negative + * Failure: negative * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu + * Programmer: Raymond Lu * July 14, 2004 * *------------------------------------------------------------------------- @@ -2926,19 +2901,19 @@ H5T_decode(const unsigned char *buf) /* Allocate "fake" file structure */ if(NULL == (f = H5F_fake_alloc((uint8_t)0))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, NULL, "can't allocate fake file struct") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, NULL, "can't allocate fake file struct") /* Decode the type of the information */ if(*buf++ != H5O_DTYPE_ID) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADMESG, NULL, "not an encoded datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_BADMESG, NULL, "not an encoded datatype") /* Decode the version of the datatype information */ if(*buf++ != H5T_ENCODE_VERSION) - HGOTO_ERROR(H5E_DATATYPE, H5E_VERSION, NULL, "unknown version of encoded datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_VERSION, NULL, "unknown version of encoded datatype") /* Decode the serialized datatype message */ if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, H5AC_noio_dxpl_id, NULL, H5O_DTYPE_ID, buf))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode object") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode object") /* Mark datatype as being in memory now */ if(H5T_set_loc(ret_value, NULL, H5T_LOC_MEMORY) < 0) @@ -2954,18 +2929,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__create + * Function: H5T__create * - * Purpose: Creates a new data type and initializes it to reasonable - * values. The new data type is SIZE bytes and an instance of - * the class TYPE. + * Purpose: Creates a new data type and initializes it to reasonable + * values. The new data type is SIZE bytes and an instance of + * the class TYPE. * - * Return: Success: Pointer to the new type. + * Return: Success: Pointer to the new type. * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke - * Friday, December 5, 1997 + * Programmer: Robb Matzke + * Friday, December 5, 1997 * * Modifications: * Raymond Lu @@ -2989,16 +2964,16 @@ H5T__create(H5T_class_t type, size_t size) { H5T_t *origin_dt = NULL; - if(NULL == (origin_dt = (H5T_t *)H5I_object(H5T_C_S1))) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, NULL, "can't get structure for string type") + if(NULL == (origin_dt = (H5T_t *)H5I_object(H5T_C_S1))) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, NULL, "can't get structure for string type") - /* Copy the default string datatype */ - if(NULL == (dt = H5T_copy(origin_dt, H5T_COPY_TRANSIENT))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy"); + /* Copy the default string datatype */ + if(NULL == (dt = H5T_copy(origin_dt, H5T_COPY_TRANSIENT))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy"); - /* Modify the datatype */ - if(H5T_set_size(dt, size) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to set size for string type") + /* Modify the datatype */ + if(H5T_set_size(dt, size) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to set size for string type") } break; @@ -3083,35 +3058,35 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_copy + * Function: H5T_copy * - * Purpose: Copies datatype OLD_DT. The resulting data type is not - * locked and is a transient type. + * Purpose: Copies datatype OLD_DT. The resulting data type is not + * locked and is a transient type. * - * Return: Success: Pointer to a new copy of the OLD_DT argument. + * Return: Success: Pointer to a new copy of the OLD_DT argument. * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke - * Thursday, December 4, 1997 + * Programmer: Robb Matzke + * Thursday, December 4, 1997 * * Modifications: * - * Robb Matzke, 4 Jun 1998 - * Added the METHOD argument. If it's H5T_COPY_TRANSIENT then the - * result will be an unlocked transient type. Otherwise if it's - * H5T_COPY_ALL then the result is a named type if the original is a - * named type, but the result is not opened. Finally, if it's - * H5T_COPY_REOPEN and the original type is a named type then the result - * is a named type and the type object header is opened again. The - * H5T_COPY_REOPEN method is used when returning a named type to the - * application. + * Robb Matzke, 4 Jun 1998 + * Added the METHOD argument. If it's H5T_COPY_TRANSIENT then the + * result will be an unlocked transient type. Otherwise if it's + * H5T_COPY_ALL then the result is a named type if the original is a + * named type, but the result is not opened. Finally, if it's + * H5T_COPY_REOPEN and the original type is a named type then the result + * is a named type and the type object header is opened again. The + * H5T_COPY_REOPEN method is used when returning a named type to the + * application. * - * Robb Matzke, 22 Dec 1998 - * Now able to copy enumeration data types. + * Robb Matzke, 22 Dec 1998 + * Now able to copy enumeration data types. * * Robb Matzke, 20 May 1999 - * Now able to copy opaque types. + * Now able to copy opaque types. * * Pedro Vicente, 21 Sep 2002 * Added a deep copy of the symbol table entry @@ -3121,11 +3096,11 @@ done: H5T_t * H5T_copy(H5T_t *old_dt, H5T_copy_t method) { - H5T_t *new_dt = NULL, *tmp = NULL; + H5T_t *new_dt = NULL, *tmp = NULL; H5T_shared_t *reopened_fo = NULL; - unsigned i; - char *s; - H5T_t *ret_value = NULL; /* Return value */ + unsigned i; + char *s; + H5T_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -3207,7 +3182,8 @@ H5T_copy(H5T_t *old_dt, H5T_copy_t method) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINC, NULL, "can't increment object count") } /* end else */ new_dt->shared->state = H5T_STATE_OPEN; - } else if(H5T_STATE_IMMUTABLE == old_dt->shared->state) { + } + else if(H5T_STATE_IMMUTABLE == old_dt->shared->state) { new_dt->shared->state = H5T_STATE_RDONLY; } break; @@ -3225,71 +3201,71 @@ H5T_copy(H5T_t *old_dt, H5T_copy_t method) switch(new_dt->shared->type) { case H5T_COMPOUND: { - ssize_t accum_change = 0; /* Amount of change in the offset of the fields */ - - /* - * Copy all member fields to new type, then overwrite the - * name and type fields of each new member with copied values. - * That is, H5T_copy() is a deep copy. - */ - /* Only malloc if space has been allocated for members - NAF */ - if(new_dt->shared->u.compnd.nalloc > 0) { - new_dt->shared->u.compnd.memb = (H5T_cmemb_t *)H5MM_malloc(new_dt->shared->u.compnd.nalloc * - sizeof(H5T_cmemb_t)); - if (NULL==new_dt->shared->u.compnd.memb) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - - HDmemcpy(new_dt->shared->u.compnd.memb, old_dt->shared->u.compnd.memb, - new_dt->shared->u.compnd.nmembs * sizeof(H5T_cmemb_t)); - } /* end if */ + ssize_t accum_change = 0; /* Amount of change in the offset of the fields */ - for(i = 0; i < new_dt->shared->u.compnd.nmembs; i++) { - unsigned j; - int old_match; - - s = new_dt->shared->u.compnd.memb[i].name; - new_dt->shared->u.compnd.memb[i].name = H5MM_xstrdup(s); - tmp = H5T_copy (old_dt->shared->u.compnd.memb[i].type, method); - new_dt->shared->u.compnd.memb[i].type = tmp; - HDassert(tmp != NULL); - - /* Range check against compound member's offset */ - if ((accum_change < 0) && ((ssize_t) new_dt->shared->u.compnd.memb[i].offset < accum_change)) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, NULL, "invalid field size in datatype"); - - /* Apply the accumulated size change to the offset of the field */ - new_dt->shared->u.compnd.memb[i].offset += (size_t) accum_change; - - if(old_dt->shared->u.compnd.sorted != H5T_SORT_VALUE) { - for(old_match = -1, j = 0; j < old_dt->shared->u.compnd.nmembs; j++) { - if(!HDstrcmp(new_dt->shared->u.compnd.memb[i].name, old_dt->shared->u.compnd.memb[j].name)) { - old_match = (int) j; - break; - } /* end if */ - } /* end for */ - - /* check if we couldn't find a match */ - if(old_match < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "fields in datatype corrupted"); + /* + * Copy all member fields to new type, then overwrite the + * name and type fields of each new member with copied values. + * That is, H5T_copy() is a deep copy. + */ + /* Only malloc if space has been allocated for members - NAF */ + if(new_dt->shared->u.compnd.nalloc > 0) { + new_dt->shared->u.compnd.memb = + (H5T_cmemb_t *)H5MM_malloc(new_dt->shared->u.compnd.nalloc * sizeof(H5T_cmemb_t)); + if (NULL == new_dt->shared->u.compnd.memb) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + + HDmemcpy(new_dt->shared->u.compnd.memb, old_dt->shared->u.compnd.memb, + new_dt->shared->u.compnd.nmembs * sizeof(H5T_cmemb_t)); } /* end if */ - else - old_match = (int) i; - /* If the field changed size, add that change to the accumulated size change */ - if(new_dt->shared->u.compnd.memb[i].type->shared->size != old_dt->shared->u.compnd.memb[old_match].type->shared->size) { - /* Adjust the size of the member */ - new_dt->shared->u.compnd.memb[i].size = (old_dt->shared->u.compnd.memb[old_match].size*tmp->shared->size)/old_dt->shared->u.compnd.memb[old_match].type->shared->size; + for(i = 0; i < new_dt->shared->u.compnd.nmembs; i++) { + unsigned j; + int old_match; + + s = new_dt->shared->u.compnd.memb[i].name; + new_dt->shared->u.compnd.memb[i].name = H5MM_xstrdup(s); + tmp = H5T_copy (old_dt->shared->u.compnd.memb[i].type, method); + new_dt->shared->u.compnd.memb[i].type = tmp; + HDassert(tmp != NULL); + + /* Range check against compound member's offset */ + if ((accum_change < 0) && ((ssize_t) new_dt->shared->u.compnd.memb[i].offset < accum_change)) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, NULL, "invalid field size in datatype"); + + /* Apply the accumulated size change to the offset of the field */ + new_dt->shared->u.compnd.memb[i].offset += (size_t) accum_change; + + if(old_dt->shared->u.compnd.sorted != H5T_SORT_VALUE) { + for(old_match = -1, j = 0; j < old_dt->shared->u.compnd.nmembs; j++) { + if(!HDstrcmp(new_dt->shared->u.compnd.memb[i].name, old_dt->shared->u.compnd.memb[j].name)) { + old_match = (int) j; + break; + } /* end if */ + } /* end for */ + + /* check if we couldn't find a match */ + if(old_match < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "fields in datatype corrupted"); + } /* end if */ + else + old_match = (int) i; + + /* If the field changed size, add that change to the accumulated size change */ + if(new_dt->shared->u.compnd.memb[i].type->shared->size != old_dt->shared->u.compnd.memb[old_match].type->shared->size) { + /* Adjust the size of the member */ + new_dt->shared->u.compnd.memb[i].size = (old_dt->shared->u.compnd.memb[old_match].size*tmp->shared->size)/old_dt->shared->u.compnd.memb[old_match].type->shared->size; - accum_change += (ssize_t) (new_dt->shared->u.compnd.memb[i].type->shared->size - old_dt->shared->u.compnd.memb[old_match].type->shared->size); - } /* end if */ - } /* end for */ + accum_change += (ssize_t) (new_dt->shared->u.compnd.memb[i].type->shared->size - old_dt->shared->u.compnd.memb[old_match].type->shared->size); + } /* end if */ + } /* end for */ - /* Range check against datatype size */ - if ((accum_change < 0) && ((ssize_t) new_dt->shared->size < accum_change)) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, NULL, "invalid field size in datatype"); + /* Range check against datatype size */ + if ((accum_change < 0) && ((ssize_t) new_dt->shared->size < accum_change)) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, NULL, "invalid field size in datatype"); - /* Apply the accumulated size change to the size of the compound struct */ - new_dt->shared->size += (size_t) accum_change; + /* Apply the accumulated size change to the size of the compound struct */ + new_dt->shared->size += (size_t) accum_change; } break; @@ -3299,14 +3275,14 @@ H5T_copy(H5T_t *old_dt, H5T_copy_t method) * of each new member with copied values. That is, H5T_copy() is a * deep copy. */ - new_dt->shared->u.enumer.name = (char **)H5MM_malloc(new_dt->shared->u.enumer.nalloc * - sizeof(char*)); - new_dt->shared->u.enumer.value = (uint8_t *)H5MM_malloc(new_dt->shared->u.enumer.nalloc * - new_dt->shared->size); + new_dt->shared->u.enumer.name = + (char **)H5MM_malloc(new_dt->shared->u.enumer.nalloc * sizeof(char*)); + new_dt->shared->u.enumer.value = + (uint8_t *)H5MM_malloc(new_dt->shared->u.enumer.nalloc * new_dt->shared->size); if(NULL == new_dt->shared->u.enumer.value) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); HDmemcpy(new_dt->shared->u.enumer.value, old_dt->shared->u.enumer.value, - new_dt->shared->u.enumer.nmembs * new_dt->shared->size); + new_dt->shared->u.enumer.nmembs * new_dt->shared->size); for(i = 0; i < new_dt->shared->u.enumer.nmembs; i++) { s = old_dt->shared->u.enumer.name[i]; new_dt->shared->u.enumer.name[i] = H5MM_xstrdup(s); @@ -3390,22 +3366,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_lock + * Function: H5T_lock * - * Purpose: Lock a transient data type making it read-only. If IMMUTABLE - * is set then the type cannot be closed except when the library - * itself closes. + * Purpose: Lock a transient data type making it read-only. If IMMUTABLE + * is set then the type cannot be closed except when the library + * itself closes. * - * This function is a no-op if the type is not transient or if - * the type is already read-only or immutable. + * This function is a no-op if the type is not transient or if + * the type is already read-only or immutable. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 4, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3439,14 +3412,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__alloc + * Function: H5T__alloc * - * Purpose: Allocates a new H5T_t structure, initializing it correctly. + * Purpose: Allocates a new H5T_t structure, initializing it correctly. * - * Return: Pointer to new H5T_t on success/NULL on failure + * Return: Pointer to new H5T_t on success/NULL on failure * - * Programmer: Quincey Koziol - * Monday, August 29, 2005 + * Programmer: Quincey Koziol + * Monday, August 29, 2005 * *------------------------------------------------------------------------- */ @@ -3486,23 +3459,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__free + * Function: H5T__free * - * Purpose: Frees all memory associated with a datatype, but does not - * free the H5T_t or H5T_shared_t structures (which should - * be done in H5T_close). + * Purpose: Frees all memory associated with a datatype, but does not + * free the H5T_t or H5T_shared_t structures (which should + * be done in H5T_close). * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Monday, January 6, 2003 + * Programmer: Quincey Koziol + * Monday, January 6, 2003 * *------------------------------------------------------------------------- */ herr_t H5T__free(H5T_t *dt) { - unsigned i; + unsigned i; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -3535,7 +3508,7 @@ H5T__free(H5T_t *dt) * Don't free locked datatypes. */ if(H5T_STATE_IMMUTABLE==dt->shared->state) - HGOTO_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to close immutable datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to close immutable datatype") /* Close the datatype */ switch(dt->shared->type) { @@ -3578,7 +3551,7 @@ H5T__free(H5T_t *dt) /* Close the parent */ HDassert(dt->shared->parent != dt); if(dt->shared->parent && H5T_close(dt->shared->parent) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close parent data type") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close parent data type") dt->shared->parent = NULL; done: @@ -3587,22 +3560,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_close + * Function: H5T_close * - * Purpose: Frees a data type and all associated memory. If the data - * type is locked then nothing happens. + * Purpose: Frees a data type and all associated memory. If the data + * type is locked then nothing happens. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Monday, December 8, 1997 + * Programmer: Robb Matzke + * Monday, December 8, 1997 * *------------------------------------------------------------------------- */ herr_t H5T_close(H5T_t *dt) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3612,16 +3585,16 @@ H5T_close(H5T_t *dt) dt->shared->fo_count--; if(dt->shared->state != H5T_STATE_OPEN || dt->shared->fo_count == 0) { - /* Uncork cache entries with object address tag for named datatype only */ - if(dt->shared->state == H5T_STATE_OPEN && dt->shared->fo_count == 0) { - hbool_t corked; /* Whether the named datatype is corked or not */ - - if(H5AC_cork(dt->oloc.file, dt->oloc.addr, H5AC__GET_CORKED, &corked) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve an object's cork status") - if(corked) - if(H5AC_cork(dt->oloc.file, dt->oloc.addr, H5AC__UNCORK, NULL) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTUNCORK, FAIL, "unable to uncork an object") - } /* end if */ + /* Uncork cache entries with object address tag for named datatype only */ + if(dt->shared->state == H5T_STATE_OPEN && dt->shared->fo_count == 0) { + hbool_t corked; /* Whether the named datatype is corked or not */ + + if(H5AC_cork(dt->oloc.file, dt->oloc.addr, H5AC__GET_CORKED, &corked) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve an object's cork status") + if(corked) + if(H5AC_cork(dt->oloc.file, dt->oloc.addr, H5AC__UNCORK, NULL) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTUNCORK, FAIL, "unable to uncork an object") + } /* end if */ if(H5T__free(dt) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free datatype"); @@ -3666,40 +3639,40 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_set_size + * Function: H5T_set_size * - * Purpose: Sets the total size in bytes for a data type (this operation - * is not permitted on reference data types). If the size is - * decreased so that the significant bits of the data type - * extend beyond the edge of the new size, then the `offset' - * property is decreased toward zero. If the `offset' becomes - * zero and the significant bits of the data type still hang - * over the edge of the new size, then the number of significant - * bits is decreased. + * Purpose: Sets the total size in bytes for a data type (this operation + * is not permitted on reference data types). If the size is + * decreased so that the significant bits of the data type + * extend beyond the edge of the new size, then the `offset' + * property is decreased toward zero. If the `offset' becomes + * zero and the significant bits of the data type still hang + * over the edge of the new size, then the number of significant + * bits is decreased. * - * Adjusting the size of an H5T_STRING automatically sets the - * precision to 8*size. + * Adjusting the size of an H5T_STRING automatically sets the + * precision to 8*size. * - * All data types have a positive size. + * All data types have a positive size. * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: nagative + * Failure: nagative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 22, 1998 * * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived data types. + * Robb Matzke, 22 Dec 1998 + * Also works with derived data types. * *------------------------------------------------------------------------- */ static herr_t H5T_set_size(H5T_t *dt, size_t size) { - size_t prec, offset; - herr_t ret_value=SUCCEED; /* Return value */ + size_t prec, offset; + herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -3718,7 +3691,8 @@ H5T_set_size(H5T_t *dt, size_t size) dt->shared->size = dt->shared->parent->shared->size * dt->shared->u.array.nelem; else if(dt->shared->type!=H5T_VLEN) dt->shared->size = dt->shared->parent->shared->size; - } else { + } + else { if (H5T_IS_ATOMIC(dt->shared)) { offset = dt->shared->u.atomic.offset; prec = dt->shared->u.atomic.prec; @@ -3731,7 +3705,8 @@ H5T_set_size(H5T_t *dt, size_t size) offset = 8 * size - prec; if (prec > 8*size) prec = 8 * size; - } else { + } + else { prec = offset = 0; } @@ -3745,28 +3720,28 @@ H5T_set_size(H5T_t *dt, size_t size) case H5T_COMPOUND: /* If decreasing size, check the last member isn't being cut. */ - if(sizeshared->size) { + if(size < dt->shared->size) { int num_membs = 0; - unsigned i, max_index=0; - size_t memb_offset, max_offset=0; + unsigned i, max_index = 0; + size_t memb_offset, max_offset = 0; size_t max_size; - if((num_membs = H5T_get_nmembers(dt))<0) + if((num_membs = H5T_get_nmembers(dt)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to get number of members"); if(num_membs) { - for(i=0; i<(unsigned)num_membs; i++) { - memb_offset = H5T_get_member_offset(dt, i); - if(memb_offset > max_offset) { - max_offset = memb_offset; - max_index = i; - } - } - - max_size = H5T__get_member_size(dt, max_index); - - if(size<(max_offset+max_size)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size shrinking will cut off last member "); + for(i = 0; i < (unsigned)num_membs; i++) { + memb_offset = H5T_get_member_offset(dt, i); + if(memb_offset > max_offset) { + max_offset = memb_offset; + max_index = i; + } + } + + max_size = H5T__get_member_size(dt, max_index); + + if(size < (max_offset + max_size)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size shrinking will cut off last member "); } /* Compound must not have been packed previously */ @@ -3779,10 +3754,10 @@ H5T_set_size(H5T_t *dt, size_t size) case H5T_STRING: /* Convert string to variable-length datatype */ - if(size==H5T_VARIABLE) { - H5T_t *base = NULL; /* base data type */ - H5T_cset_t tmp_cset; /* Temp. cset info */ - H5T_str_t tmp_strpad; /* Temp. strpad info */ + if(size == H5T_VARIABLE) { + H5T_t *base = NULL; /* base data type */ + H5T_cset_t tmp_cset; /* Temp. cset info */ + H5T_str_t tmp_strpad; /* Temp. strpad info */ /* Get a copy of unsigned char type as the base/parent type */ if(NULL == (base = (H5T_t *)H5I_object(H5T_NATIVE_UCHAR))) @@ -3794,14 +3769,14 @@ H5T_set_size(H5T_t *dt, size_t size) /* * Force conversions (i.e. memory to memory conversions - * should duplicate data, not point to the same VL strings) + * should duplicate data, not point to the same VL strings) */ dt->shared->force_conv = TRUE; - /* Before we mess with the info in the union, extract the - * values we need */ - tmp_cset=dt->shared->u.atomic.u.s.cset; - tmp_strpad=dt->shared->u.atomic.u.s.pad; + /* Before we mess with the info in the union, extract the + * values we need */ + tmp_cset = dt->shared->u.atomic.u.s.cset; + tmp_strpad = dt->shared->u.atomic.u.s.pad; /* This is a string, not a sequence */ dt->shared->u.vlen.type = H5T_VLEN_STRING; @@ -3814,7 +3789,8 @@ H5T_set_size(H5T_t *dt, size_t size) if (H5T_set_loc(dt, NULL, H5T_LOC_MEMORY)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location"); - } else { + } + else { prec = 8 * size; offset = 0; } /* end else */ @@ -3848,7 +3824,7 @@ H5T_set_size(H5T_t *dt, size_t size) } /* Commit (if we didn't convert this type to a VL string) */ - if(dt->shared->type!=H5T_VLEN) { + if(dt->shared->type != H5T_VLEN) { dt->shared->size = size; if (H5T_IS_ATOMIC(dt->shared)) { dt->shared->u.atomic.offset = offset; @@ -3867,21 +3843,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_get_size - * - * Purpose: Determines the total size of a data type in bytes. + * Function: H5T_get_size * - * Return: Success: Size of the data type in bytes. The size of - * the data type is the size of an instance of - * that data type. + * Purpose: Determines the total size of a data type in bytes. * - * Failure: 0 (valid data types are never zero size) + * Return: Success: Size of the data type in bytes. The size of + * the data type is the size of an instance of + * that data type. * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 - * - * Modifications: + * Failure: 0 (valid data types are never zero size) * + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 *------------------------------------------------------------------------- */ size_t @@ -3898,30 +3871,30 @@ H5T_get_size(const H5T_t *dt) /*------------------------------------------------------------------------- - * Function: H5T_cmp + * Function: H5T_cmp * - * Purpose: Compares two data types. + * Purpose: Compares two data types. * - * Return: Success: 0 if DT1 and DT2 are equal. - * <0 if DT1 is less than DT2. - * >0 if DT1 is greater than DT2. + * Return: Success: 0 if DT1 and DT2 are equal. + * <0 if DT1 is less than DT2. + * >0 if DT1 is greater than DT2. * - * Failure: 0, never fails + * Failure: 0, never fails * - * Programmer: Robb Matzke - * Wednesday, December 10, 1997 + * Programmer: Robb Matzke + * Wednesday, December 10, 1997 * *------------------------------------------------------------------------- */ int H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) { - unsigned *idx1 = NULL, *idx2 = NULL; - size_t base_size; - hbool_t swapped; - unsigned u; - int tmp; - int ret_value = 0; + unsigned *idx1 = NULL, *idx2 = NULL; + size_t base_size; + hbool_t swapped; + unsigned u; + int tmp; + int ret_value = 0; FUNC_ENTER_NOAPI(0) @@ -3949,10 +3922,10 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) if(!dt1->shared->parent && dt2->shared->parent) HGOTO_DONE(1); if(dt1->shared->parent) { - tmp = H5T_cmp(dt1->shared->parent, dt2->shared->parent, superset); - if(tmp < 0) + tmp = H5T_cmp(dt1->shared->parent, dt2->shared->parent, superset); + if(tmp < 0) HGOTO_DONE(-1); - if(tmp > 0) + if(tmp > 0) HGOTO_DONE(1); } /* end if */ @@ -4003,7 +3976,7 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) #ifdef H5T_DEBUG /* I don't quite trust the code above yet :-) --RPM */ - for (u=0; ushared->u.compnd.nmembs-1; u++) { + for(u=0; ushared->u.compnd.nmembs-1; u++) { HDassert(HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name, dt1->shared->u.compnd.memb[idx1[u + 1]].name)); HDassert(HDstrcmp(dt2->shared->u.compnd.memb[idx2[u]].name, @@ -4012,24 +3985,24 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) #endif /* Compare the members */ - for (u=0; ushared->u.compnd.nmembs; u++) { + for(u=0; ushared->u.compnd.nmembs; u++) { tmp = HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name, dt2->shared->u.compnd.memb[idx2[u]].name); - if (tmp < 0) + if(tmp < 0) HGOTO_DONE(-1); - if (tmp > 0) + if(tmp > 0) HGOTO_DONE(1); - if (dt1->shared->u.compnd.memb[idx1[u]].offset < dt2->shared->u.compnd.memb[idx2[u]].offset) HGOTO_DONE(-1); - if (dt1->shared->u.compnd.memb[idx1[u]].offset > dt2->shared->u.compnd.memb[idx2[u]].offset) HGOTO_DONE(1); + if(dt1->shared->u.compnd.memb[idx1[u]].offset < dt2->shared->u.compnd.memb[idx2[u]].offset) HGOTO_DONE(-1); + if(dt1->shared->u.compnd.memb[idx1[u]].offset > dt2->shared->u.compnd.memb[idx2[u]].offset) HGOTO_DONE(1); - if (dt1->shared->u.compnd.memb[idx1[u]].size < dt2->shared->u.compnd.memb[idx2[u]].size) HGOTO_DONE(-1); - if (dt1->shared->u.compnd.memb[idx1[u]].size > dt2->shared->u.compnd.memb[idx2[u]].size) HGOTO_DONE(1); + if(dt1->shared->u.compnd.memb[idx1[u]].size < dt2->shared->u.compnd.memb[idx2[u]].size) HGOTO_DONE(-1); + if(dt1->shared->u.compnd.memb[idx1[u]].size > dt2->shared->u.compnd.memb[idx2[u]].size) HGOTO_DONE(1); tmp = H5T_cmp(dt1->shared->u.compnd.memb[idx1[u]].type, dt2->shared->u.compnd.memb[idx2[u]].type, superset); - if (tmp < 0) HGOTO_DONE(-1); - if (tmp > 0) HGOTO_DONE(1); + if(tmp < 0) HGOTO_DONE(-1); + if(tmp > 0) HGOTO_DONE(1); } break; @@ -4042,13 +4015,13 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) * more members than dt1 */ if(superset) { - if (dt1->shared->u.enumer.nmembs > dt2->shared->u.enumer.nmembs) + if(dt1->shared->u.enumer.nmembs > dt2->shared->u.enumer.nmembs) HGOTO_DONE(1); } /* end if */ else { - if (dt1->shared->u.enumer.nmembs < dt2->shared->u.enumer.nmembs) + if(dt1->shared->u.enumer.nmembs < dt2->shared->u.enumer.nmembs) HGOTO_DONE(-1); - if (dt1->shared->u.enumer.nmembs > dt2->shared->u.enumer.nmembs) + if(dt1->shared->u.enumer.nmembs > dt2->shared->u.enumer.nmembs) HGOTO_DONE(1); } /* end else */ @@ -4056,15 +4029,15 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) if(NULL == (idx1 = (unsigned *)H5MM_malloc(dt1->shared->u.enumer.nmembs * sizeof(unsigned))) || NULL == (idx2 = (unsigned *)H5MM_malloc(dt2->shared->u.enumer.nmembs * sizeof(unsigned)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed"); - for (u=0; ushared->u.enumer.nmembs; u++) + for(u=0; ushared->u.enumer.nmembs; u++) idx1[u] = u; if(dt1->shared->u.enumer.nmembs > 1) { int i; for (i = (int) dt1->shared->u.enumer.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { int j; - for (j = 0, swapped = FALSE; j < i; j++) - if (HDstrcmp(dt1->shared->u.enumer.name[idx1[j]], + for(j = 0, swapped = FALSE; j < i; j++) + if(HDstrcmp(dt1->shared->u.enumer.name[idx1[j]], dt1->shared->u.enumer.name[idx1[j+1]]) > 0) { unsigned tmp_idx = idx1[j]; idx1[j] = idx1[j+1]; @@ -4073,16 +4046,16 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) } } } - for (u=0; ushared->u.enumer.nmembs; u++) + for(u=0; ushared->u.enumer.nmembs; u++) idx2[u] = u; if(dt2->shared->u.enumer.nmembs > 1) { int i; - for (i = (int) dt2->shared->u.enumer.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { + for(i = (int) dt2->shared->u.enumer.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { int j; - for (j = 0, swapped = FALSE; j < i; j++) - if (HDstrcmp(dt2->shared->u.enumer.name[idx2[j]], + for(j = 0, swapped = FALSE; j < i; j++) + if(HDstrcmp(dt2->shared->u.enumer.name[idx2[j]], dt2->shared->u.enumer.name[idx2[j+1]]) > 0) { unsigned tmp_idx = idx2[j]; idx2[j] = idx2[j+1]; @@ -4094,7 +4067,7 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) #ifdef H5T_DEBUG /* I don't quite trust the code above yet :-) --RPM */ - for (u=0; ushared->u.enumer.nmembs-1; u++) { + for(u=0; ushared->u.enumer.nmembs-1; u++) { HDassert(HDstrcmp(dt1->shared->u.enumer.name[idx1[u]], dt1->shared->u.enumer.name[idx1[u+1]])); HDassert(HDstrcmp(dt2->shared->u.enumer.name[idx2[u]], @@ -4104,12 +4077,12 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) /* Compare the members */ base_size = dt1->shared->parent->shared->size; - for (u=0; ushared->u.enumer.nmembs; u++) { + for(u=0; ushared->u.enumer.nmembs; u++) { unsigned idx = 0; if(superset) { unsigned lt = 0, rt; /* Final, left & right key indices */ - int cmp = 1; /* Key comparison value */ + int cmp = 1; /* Key comparison value */ /* If a superset is allowed, dt2 may have more members * than dt1, so binary search for matching member name in @@ -4117,18 +4090,18 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) */ rt = dt2->shared->u.enumer.nmembs; - while (lt < rt && cmp) { + while(lt < rt && cmp) { idx = (lt + rt) / 2; /* compare */ - if ((cmp = HDstrcmp(dt1->shared->u.enumer.name[idx1[u]], + if((cmp = HDstrcmp(dt1->shared->u.enumer.name[idx1[u]], dt2->shared->u.enumer.name[idx2[idx]] ) ) < 0) rt = idx; else lt = idx+1; } /* Leave, if we couldn't find match */ - if (cmp) + if(cmp) HGOTO_DONE(-1); } /* end if */ else { @@ -4147,8 +4120,8 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) tmp = HDmemcmp(dt1->shared->u.enumer.value+idx1[u]*base_size, dt2->shared->u.enumer.value+idx2[idx]*base_size, base_size); - if (tmp<0) HGOTO_DONE(-1); - if (tmp>0) HGOTO_DONE(1); + if(tmp<0) HGOTO_DONE(-1); + if(tmp>0) HGOTO_DONE(1); } break; @@ -4159,29 +4132,32 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) HDassert(dt2->shared->u.vlen.loc>=H5T_LOC_BADLOC && dt2->shared->u.vlen.locshared->u.vlen.type==H5T_VLEN_SEQUENCE && + if(dt1->shared->u.vlen.type==H5T_VLEN_SEQUENCE && dt2->shared->u.vlen.type==H5T_VLEN_STRING) { HGOTO_DONE(-1); - } else if (dt1->shared->u.vlen.type==H5T_VLEN_STRING && + } + else if(dt1->shared->u.vlen.type==H5T_VLEN_STRING && dt2->shared->u.vlen.type==H5T_VLEN_SEQUENCE) { HGOTO_DONE(1); } /* Arbitrarily sort VL datatypes in memory before disk */ - if (dt1->shared->u.vlen.loc==H5T_LOC_MEMORY && + if(dt1->shared->u.vlen.loc==H5T_LOC_MEMORY && dt2->shared->u.vlen.loc==H5T_LOC_DISK) { HGOTO_DONE(-1); - } else if (dt1->shared->u.vlen.loc==H5T_LOC_DISK && + } + else if(dt1->shared->u.vlen.loc==H5T_LOC_DISK && dt2->shared->u.vlen.loc==H5T_LOC_MEMORY) { HGOTO_DONE(1); - } else if (dt1->shared->u.vlen.loc==H5T_LOC_BADLOC && + } + else if(dt1->shared->u.vlen.loc==H5T_LOC_BADLOC && dt2->shared->u.vlen.loc!=H5T_LOC_BADLOC) { HGOTO_DONE(1); } /* Don't allow VL types in different files to compare as equal */ - if (dt1->shared->u.vlen.f < dt2->shared->u.vlen.f) + if(dt1->shared->u.vlen.f < dt2->shared->u.vlen.f) HGOTO_DONE(-1); - if (dt1->shared->u.vlen.f > dt2->shared->u.vlen.f) + if(dt1->shared->u.vlen.f > dt2->shared->u.vlen.f) HGOTO_DONE(1); break; @@ -4191,22 +4167,22 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) break; case H5T_ARRAY: - if (dt1->shared->u.array.ndims < dt2->shared->u.array.ndims) + if(dt1->shared->u.array.ndims < dt2->shared->u.array.ndims) HGOTO_DONE(-1); - if (dt1->shared->u.array.ndims > dt2->shared->u.array.ndims) + if(dt1->shared->u.array.ndims > dt2->shared->u.array.ndims) HGOTO_DONE(1); - for (u=0; ushared->u.array.ndims; u++) { - if (dt1->shared->u.array.dim[u] < dt2->shared->u.array.dim[u]) + for(u=0; ushared->u.array.ndims; u++) { + if(dt1->shared->u.array.dim[u] < dt2->shared->u.array.dim[u]) HGOTO_DONE(-1); - if (dt1->shared->u.array.dim[u] > dt2->shared->u.array.dim[u]) + if(dt1->shared->u.array.dim[u] > dt2->shared->u.array.dim[u]) HGOTO_DONE(1); } tmp = H5T_cmp(dt1->shared->parent, dt2->shared->parent, superset); - if (tmp < 0) + if(tmp < 0) HGOTO_DONE(-1); - if (tmp > 0) + if(tmp > 0) HGOTO_DONE(1); break; @@ -4222,62 +4198,62 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) /* * Atomic datatypes... */ - if (dt1->shared->u.atomic.order < dt2->shared->u.atomic.order) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.order > dt2->shared->u.atomic.order) HGOTO_DONE(1); + if(dt1->shared->u.atomic.order < dt2->shared->u.atomic.order) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.order > dt2->shared->u.atomic.order) HGOTO_DONE(1); - if (dt1->shared->u.atomic.prec < dt2->shared->u.atomic.prec) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.prec > dt2->shared->u.atomic.prec) HGOTO_DONE(1); + if(dt1->shared->u.atomic.prec < dt2->shared->u.atomic.prec) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.prec > dt2->shared->u.atomic.prec) HGOTO_DONE(1); - if (dt1->shared->u.atomic.offset < dt2->shared->u.atomic.offset) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.offset > dt2->shared->u.atomic.offset) HGOTO_DONE(1); + if(dt1->shared->u.atomic.offset < dt2->shared->u.atomic.offset) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.offset > dt2->shared->u.atomic.offset) HGOTO_DONE(1); - if (dt1->shared->u.atomic.lsb_pad < dt2->shared->u.atomic.lsb_pad) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.lsb_pad > dt2->shared->u.atomic.lsb_pad) HGOTO_DONE(1); + if(dt1->shared->u.atomic.lsb_pad < dt2->shared->u.atomic.lsb_pad) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.lsb_pad > dt2->shared->u.atomic.lsb_pad) HGOTO_DONE(1); - if (dt1->shared->u.atomic.msb_pad < dt2->shared->u.atomic.msb_pad) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.msb_pad > dt2->shared->u.atomic.msb_pad) HGOTO_DONE(1); + if(dt1->shared->u.atomic.msb_pad < dt2->shared->u.atomic.msb_pad) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.msb_pad > dt2->shared->u.atomic.msb_pad) HGOTO_DONE(1); switch (dt1->shared->type) { case H5T_INTEGER: - if (dt1->shared->u.atomic.u.i.sign < dt2->shared->u.atomic.u.i.sign) + if(dt1->shared->u.atomic.u.i.sign < dt2->shared->u.atomic.u.i.sign) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.i.sign > dt2->shared->u.atomic.u.i.sign) + if(dt1->shared->u.atomic.u.i.sign > dt2->shared->u.atomic.u.i.sign) HGOTO_DONE(1); break; case H5T_FLOAT: - if (dt1->shared->u.atomic.u.f.sign < dt2->shared->u.atomic.u.f.sign) + if(dt1->shared->u.atomic.u.f.sign < dt2->shared->u.atomic.u.f.sign) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.sign > dt2->shared->u.atomic.u.f.sign) + if(dt1->shared->u.atomic.u.f.sign > dt2->shared->u.atomic.u.f.sign) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.epos < dt2->shared->u.atomic.u.f.epos) + if(dt1->shared->u.atomic.u.f.epos < dt2->shared->u.atomic.u.f.epos) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.epos > dt2->shared->u.atomic.u.f.epos) + if(dt1->shared->u.atomic.u.f.epos > dt2->shared->u.atomic.u.f.epos) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.esize < dt2->shared->u.atomic.u.f.esize) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.esize > dt2->shared->u.atomic.u.f.esize) HGOTO_DONE(1); + if(dt1->shared->u.atomic.u.f.esize < dt2->shared->u.atomic.u.f.esize) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.u.f.esize > dt2->shared->u.atomic.u.f.esize) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.ebias < dt2->shared->u.atomic.u.f.ebias) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.ebias > dt2->shared->u.atomic.u.f.ebias) HGOTO_DONE(1); + if(dt1->shared->u.atomic.u.f.ebias < dt2->shared->u.atomic.u.f.ebias) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.u.f.ebias > dt2->shared->u.atomic.u.f.ebias) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.mpos < dt2->shared->u.atomic.u.f.mpos) + if(dt1->shared->u.atomic.u.f.mpos < dt2->shared->u.atomic.u.f.mpos) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.mpos > dt2->shared->u.atomic.u.f.mpos) + if(dt1->shared->u.atomic.u.f.mpos > dt2->shared->u.atomic.u.f.mpos) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.msize < dt2->shared->u.atomic.u.f.msize) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.msize > dt2->shared->u.atomic.u.f.msize) HGOTO_DONE(1); + if(dt1->shared->u.atomic.u.f.msize < dt2->shared->u.atomic.u.f.msize) HGOTO_DONE(-1); + if(dt1->shared->u.atomic.u.f.msize > dt2->shared->u.atomic.u.f.msize) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.norm < dt2->shared->u.atomic.u.f.norm) + if(dt1->shared->u.atomic.u.f.norm < dt2->shared->u.atomic.u.f.norm) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.norm > dt2->shared->u.atomic.u.f.norm) + if(dt1->shared->u.atomic.u.f.norm > dt2->shared->u.atomic.u.f.norm) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.f.pad < dt2->shared->u.atomic.u.f.pad) + if(dt1->shared->u.atomic.u.f.pad < dt2->shared->u.atomic.u.f.pad) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.f.pad > dt2->shared->u.atomic.u.f.pad) + if(dt1->shared->u.atomic.u.f.pad > dt2->shared->u.atomic.u.f.pad) HGOTO_DONE(1); break; @@ -4287,14 +4263,14 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) break; case H5T_STRING: - if (dt1->shared->u.atomic.u.s.cset < dt2->shared->u.atomic.u.s.cset) + if(dt1->shared->u.atomic.u.s.cset < dt2->shared->u.atomic.u.s.cset) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.s.cset > dt2->shared->u.atomic.u.s.cset) + if(dt1->shared->u.atomic.u.s.cset > dt2->shared->u.atomic.u.s.cset) HGOTO_DONE(1); - if (dt1->shared->u.atomic.u.s.pad < dt2->shared->u.atomic.u.s.pad) + if(dt1->shared->u.atomic.u.s.pad < dt2->shared->u.atomic.u.s.pad) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.s.pad > dt2->shared->u.atomic.u.s.pad) + if(dt1->shared->u.atomic.u.s.pad > dt2->shared->u.atomic.u.s.pad) HGOTO_DONE(1); break; @@ -4304,16 +4280,16 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) break; case H5T_REFERENCE: - if (dt1->shared->u.atomic.u.r.rtype < dt2->shared->u.atomic.u.r.rtype) + if(dt1->shared->u.atomic.u.r.rtype < dt2->shared->u.atomic.u.r.rtype) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.r.rtype > dt2->shared->u.atomic.u.r.rtype) + if(dt1->shared->u.atomic.u.r.rtype > dt2->shared->u.atomic.u.r.rtype) HGOTO_DONE(1); switch(dt1->shared->u.atomic.u.r.rtype) { case H5R_OBJECT: - if (dt1->shared->u.atomic.u.r.loc < dt2->shared->u.atomic.u.r.loc) + if(dt1->shared->u.atomic.u.r.loc < dt2->shared->u.atomic.u.r.loc) HGOTO_DONE(-1); - if (dt1->shared->u.atomic.u.r.loc > dt2->shared->u.atomic.u.r.loc) + if(dt1->shared->u.atomic.u.r.loc > dt2->shared->u.atomic.u.r.loc) HGOTO_DONE(1); break; @@ -4357,29 +4333,29 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_path_find + * Function: H5T_path_find * - * Purpose: Finds the path which converts type SRC_ID to type DST_ID, - * creating a new path if necessary. If FUNC is non-zero then - * it is set as the hard conversion function for that path - * regardless of whether the path previously existed. Changing - * the conversion function of a path causes statistics to be - * reset to zero after printing them. The NAME is used only - * when creating a new path and is just for debugging. + * Purpose: Finds the path which converts type SRC_ID to type DST_ID, + * creating a new path if necessary. If FUNC is non-zero then + * it is set as the hard conversion function for that path + * regardless of whether the path previously existed. Changing + * the conversion function of a path causes statistics to be + * reset to zero after printing them. The NAME is used only + * when creating a new path and is just for debugging. * - * If SRC and DST are both null pointers then the special no-op - * conversion path is used. This path is always stored as the - * first path in the path table. + * If SRC and DST are both null pointers then the special no-op + * conversion path is used. This path is always stored as the + * first path in the path table. * - * Return: Success: Pointer to the path, valid until the path - * database is modified. + * Return: Success: Pointer to the path, valid until the path + * database is modified. * - * Failure: NULL if the path does not exist and no - * function can be found to apply to the new - * path. + * Failure: NULL if the path does not exist and no + * function can be found to apply to the new + * path. * - * Programmer: Robb Matzke - * Tuesday, January 13, 1998 + * Programmer: Robb Matzke + * Tuesday, January 13, 1998 * * Modifications: * Added a parameter IS_API to indicate whether to an API @@ -4397,16 +4373,16 @@ H5T_path_t * H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, H5T_conv_t func, hid_t dxpl_id, hbool_t is_api) { - int lt, rt; /*left and right edges */ - int md; /*middle */ - int cmp; /*comparison result */ - int old_npaths; /* Previous number of paths in table */ - H5T_path_t *table = NULL; /*path existing in the table */ - H5T_path_t *path = NULL; /*new path */ - hid_t src_id = -1, dst_id = -1; /*src and dst type identifiers */ - int i; /*counter */ - int nprint = 0; /*lines of output printed */ - H5T_path_t *ret_value = NULL; /* Return value */ + int lt, rt; /* left and right edges */ + int md; /* middle */ + int cmp; /* comparison result */ + int old_npaths; /* Previous number of paths in table */ + H5T_path_t *table = NULL; /* path existing in the table */ + H5T_path_t *path = NULL; /* new path */ + hid_t src_id = -1, dst_id = -1; /* src and dst type identifiers */ + int i; /* counter */ + int nprint = 0; /* lines of output printed */ + H5T_path_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -4420,23 +4396,23 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * Make sure the first entry in the table is the no-op conversion path. */ if(0 == H5T_g.npaths) { - if(NULL == (H5T_g.path = (H5T_path_t **)H5MM_malloc(128 * sizeof(H5T_path_t *)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for type conversion path table") - H5T_g.apaths = 128; - if(NULL == (H5T_g.path[0] = H5FL_CALLOC(H5T_path_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for no-op conversion path") + if(NULL == (H5T_g.path = (H5T_path_t **)H5MM_malloc(128 * sizeof(H5T_path_t *)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for type conversion path table") + H5T_g.apaths = 128; + if(NULL == (H5T_g.path[0] = H5FL_CALLOC(H5T_path_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for no-op conversion path") HDsnprintf(H5T_g.path[0]->name, sizeof(H5T_g.path[0]->name), "no-op"); - H5T_g.path[0]->func = H5T__conv_noop; - H5T_g.path[0]->cdata.command = H5T_CONV_INIT; - if(H5T__conv_noop((hid_t)FAIL, (hid_t)FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + H5T_g.path[0]->func = H5T__conv_noop; + H5T_g.path[0]->cdata.command = H5T_CONV_INIT; + if(H5T__conv_noop((hid_t)FAIL, (hid_t)FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { #ifdef H5T_DEBUG - if(H5DEBUG(T)) - fprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n"); + if(H5DEBUG(T)) + fprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n"); #endif - H5E_clear_stack(NULL); /*ignore the error*/ - } /* end if */ - H5T_g.path[0]->is_noop = TRUE; - H5T_g.npaths = 1; + H5E_clear_stack(NULL); /*ignore the error*/ + } /* end if */ + H5T_g.path[0]->is_noop = TRUE; + H5T_g.npaths = 1; } /* end if */ /* @@ -4449,28 +4425,28 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * are set */ if(src->shared->force_conv == FALSE && dst->shared->force_conv == FALSE && 0 == H5T_cmp(src, dst, TRUE)) { - table = H5T_g.path[0]; - cmp = 0; - md = 0; + table = H5T_g.path[0]; + cmp = 0; + md = 0; } /* end if */ else { - lt = md = 1; - rt = H5T_g.npaths; - cmp = -1; - - while(cmp && lt < rt) { - md = (lt + rt) / 2; - HDassert(H5T_g.path[md]); - cmp = H5T_cmp(src, H5T_g.path[md]->src, FALSE); - if(0 == cmp) + lt = md = 1; + rt = H5T_g.npaths; + cmp = -1; + + while(cmp && lt < rt) { + md = (lt + rt) / 2; + HDassert(H5T_g.path[md]); + cmp = H5T_cmp(src, H5T_g.path[md]->src, FALSE); + if(0 == cmp) cmp = H5T_cmp(dst, H5T_g.path[md]->dst, FALSE); - if(cmp < 0) - rt = md; - else if(cmp > 0) - lt = md + 1; - else - table = H5T_g.path[md]; - } /* end while */ + if(cmp < 0) + rt = md; + else if(cmp > 0) + lt = md + 1; + else + table = H5T_g.path[md]; + } /* end while */ } /* end else */ /* Keep a record of the number of paths in the table, in case one of the @@ -4486,21 +4462,21 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * create a new path and add the new function to the path. */ if(!table || (table && func && is_api) || (table && !table->is_hard && func && !is_api)) { - if(NULL == (path = H5FL_CALLOC(H5T_path_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for type conversion path") - if(name && *name) { - HDstrncpy(path->name, name, (size_t)H5T_NAMELEN); - path->name[H5T_NAMELEN - 1] = '\0'; + if(NULL == (path = H5FL_CALLOC(H5T_path_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for type conversion path") + if(name && *name) { + HDstrncpy(path->name, name, (size_t)H5T_NAMELEN); + path->name[H5T_NAMELEN - 1] = '\0'; } /* end if */ - else - HDsnprintf(path->name, sizeof(path->name), "NONAME"); - if(NULL == (path->src = H5T_copy(src, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy datatype for conversion path") + else + HDsnprintf(path->name, sizeof(path->name), "NONAME"); + if(NULL == (path->src = H5T_copy(src, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy datatype for conversion path") if(NULL == (path->dst = H5T_copy(dst, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy datatype for conversion path") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy datatype for conversion path") } /* end if */ else - path = table; + path = table; /* * If a hard conversion function is specified and none is defined for the @@ -4509,22 +4485,22 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * and initialize its conversion data. */ if(func && (!table || (table && is_api) || (table && !table->is_hard && !is_api))) { - HDassert(path != table); - HDassert(NULL == path->func); - if(path->src && (src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), FALSE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register source conversion type for query") - if(path->dst && (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), FALSE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register destination conversion type for query") - path->cdata.command = H5T_CONV_INIT; - if((func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to initialize conversion function") - if(src_id >= 0) + HDassert(path != table); + HDassert(NULL == path->func); + if(path->src && (src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), FALSE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register source conversion type for query") + if(path->dst && (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), FALSE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register destination conversion type for query") + path->cdata.command = H5T_CONV_INIT; + if((func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to initialize conversion function") + if(src_id >= 0) H5I_dec_ref(src_id); - if(dst_id >= 0) + if(dst_id >= 0) H5I_dec_ref(dst_id); - src_id = dst_id = -1; - path->func = func; - path->is_hard = TRUE; + src_id = dst_id = -1; + path->func = func; + path->is_hard = TRUE; } /* end if */ /* @@ -4535,29 +4511,29 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, */ HDassert(path->func || (src && dst)); for(i = H5T_g.nsoft - 1; i >= 0 && !path->func; --i) { - if(src->shared->type != H5T_g.soft[i].src || dst->shared->type != H5T_g.soft[i].dst) - continue; - if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), FALSE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register src conversion type for query") - if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), FALSE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register dst conversion type for query") - path->cdata.command = H5T_CONV_INIT; - if((H5T_g.soft[i].func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { - HDmemset(&(path->cdata), 0, sizeof(H5T_cdata_t)); - H5E_clear_stack(H5E_DEFAULT); /*ignore the error*/ - } /* end if */ + if(src->shared->type != H5T_g.soft[i].src || dst->shared->type != H5T_g.soft[i].dst) + continue; + if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), FALSE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register src conversion type for query") + if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), FALSE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register dst conversion type for query") + path->cdata.command = H5T_CONV_INIT; + if((H5T_g.soft[i].func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + HDmemset(&(path->cdata), 0, sizeof(H5T_cdata_t)); + H5E_clear_stack(H5E_DEFAULT); /*ignore the error*/ + } /* end if */ else { - HDstrncpy(path->name, H5T_g.soft[i].name, (size_t)H5T_NAMELEN); - path->name[H5T_NAMELEN - 1] = '\0'; - path->func = H5T_g.soft[i].func; - path->is_hard = FALSE; - } /* end else */ - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); - src_id = dst_id = -1; + HDstrncpy(path->name, H5T_g.soft[i].name, (size_t)H5T_NAMELEN); + path->name[H5T_NAMELEN - 1] = '\0'; + path->func = H5T_g.soft[i].func; + path->is_hard = FALSE; + } /* end else */ + H5I_dec_ref(src_id); + H5I_dec_ref(dst_id); + src_id = dst_id = -1; } /* end for */ if(!path->func) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "no appropriate function for conversion path") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "no appropriate function for conversion path") /* Check if paths were inserted into the table through a recursive call * and re-compute the correct location for this path if so. - QAK, 1/26/02 @@ -4584,34 +4560,35 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, /* Replace an existing table entry or add a new entry */ if(table && path != table) { - HDassert(table == H5T_g.path[md]); - H5T__print_stats(table, &nprint/*in,out*/); - table->cdata.command = H5T_CONV_FREE; - if((table->func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + HDassert(table == H5T_g.path[md]); + H5T__print_stats(table, &nprint/*in,out*/); + table->cdata.command = H5T_CONV_FREE; + if((table->func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { #ifdef H5T_DEBUG - if(H5DEBUG(T)) { - fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free " - "failed for %s (ignored)\n", - (unsigned long)(path->func), path->name); - } /* end if */ + if(H5DEBUG(T)) { + fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free " + "failed for %s (ignored)\n", + (unsigned long)(path->func), path->name); + } /* end if */ #endif - H5E_clear_stack(NULL); /*ignore the failure*/ - } /* end if */ - if(table->src) + H5E_clear_stack(NULL); /*ignore the failure*/ + } /* end if */ + if(table->src) H5T_close(table->src); - if(table->dst) + if(table->dst) H5T_close(table->dst); table = H5FL_FREE(H5T_path_t, table); - table = path; - H5T_g.path[md] = path; - } else if(path != table) { - HDassert(cmp); + table = path; + H5T_g.path[md] = path; + } + else if(path != table) { + HDassert(cmp); if((size_t)H5T_g.npaths >= H5T_g.apaths) { size_t na = MAX(128, 2 * H5T_g.apaths); H5T_path_t **x; if(NULL == (x = (H5T_path_t **)H5MM_realloc(H5T_g.path, na * sizeof(H5T_path_t*)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") H5T_g.apaths = na; H5T_g.path = x; } /* end if */ @@ -4619,8 +4596,8 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, md++; HDmemmove(H5T_g.path + md + 1, H5T_g.path + md, (size_t) (H5T_g.npaths - md) * sizeof(H5T_path_t*)); H5T_g.npaths++; - H5T_g.path[md] = path; - table = path; + H5T_g.path[md] = path; + table = path; } /* end else-if */ /* Set the flag to indicate both source and destination types are compound types @@ -4633,9 +4610,9 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, done: if(!ret_value && path && path != table) { - if(path->src) + if(path->src) H5T_close(path->src); - if(path->dst) + if(path->dst) H5T_close(path->dst); path = H5FL_FREE(H5T_path_t, path); } /* end if */ @@ -4649,20 +4626,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_path_noop - * - * Purpose: Is the path the special no-op path? The no-op function can be - * set by the application and there might be more than one no-op - * path in a multi-threaded application if one thread is using - * the no-op path when some other thread changes its definition. + * Function: H5T_path_noop * - * Return: TRUE/FALSE (can't fail) + * Purpose: Is the path the special no-op path? The no-op function can be + * set by the application and there might be more than one no-op + * path in a multi-threaded application if one thread is using + * the no-op path when some other thread changes its definition. * - * Programmer: Quincey Koziol - * Thursday, May 8, 2003 - * - * Modifications: + * Return: TRUE/FALSE (can't fail) * + * Programmer: Quincey Koziol + * Thursday, May 8, 2003 *------------------------------------------------------------------------- */ hbool_t @@ -4677,12 +4651,12 @@ H5T_path_noop(const H5T_path_t *p) /*------------------------------------------------------------------------- - * Function: H5T_path_compound_subset + * Function: H5T_path_compound_subset * - * Purpose: Checks if the source and destination types are both compound. - * Tells whether whether the source members are a subset of - * destination, and the order is the same, and no conversion - * is needed. For example: + * Purpose: Checks if the source and destination types are both compound. + * Tells whether whether the source members are a subset of + * destination, and the order is the same, and no conversion + * is needed. For example: * struct source { struct destination { * TYPE1 A; --> TYPE1 A; * TYPE2 B; --> TYPE2 B; @@ -4691,11 +4665,11 @@ H5T_path_noop(const H5T_path_t *p) * TYPE5 E; * }; * - * Return: A pointer to the subset info struct in p, or NULL if there are - * no compounds. Points directly into the H5T_path_t structure. + * Return: A pointer to the subset info struct in p, or NULL if there are + * no compounds. Points directly into the H5T_path_t structure. * - * Programmer: Raymond Lu - * 8 June 2007 + * Programmer: Raymond Lu + * 8 June 2007 * * Modifications: Neil Fortner * 19 September 2008 @@ -4721,17 +4695,14 @@ H5T_path_compound_subset(const H5T_path_t *p) /*------------------------------------------------------------------------- - * Function: H5T_path_bkg + * Function: H5T_path_bkg * - * Purpose: Get the "background" flag for the conversion path. + * Purpose: Get the "background" flag for the conversion path. * - * Return: Background flag (can't fail) - * - * Programmer: Quincey Koziol - * Thursday, May 8, 2003 - * - * Modifications: + * Return: Background flag (can't fail) * + * Programmer: Quincey Koziol + * Thursday, May 8, 2003 *------------------------------------------------------------------------- */ H5T_bkg_t @@ -4746,34 +4717,31 @@ H5T_path_bkg(const H5T_path_t *p) /*------------------------------------------------------------------------- - * Function: H5T_compiler_conv - * - * Purpose: Private function for H5Tcompiler_conv. Finds out whether the - * library's conversion function from type SRC to type DST - * is a hard conversion. - * - * Return: TRUE: hard conversion. - * FALSE: soft conversion. - * FAIL: function failed. + * Function: H5T_compiler_conv * - * Programmer: Raymond Lu - * Friday, Sept 2, 2005 + * Purpose: Private function for H5Tcompiler_conv. Finds out whether the + * library's conversion function from type SRC to type DST + * is a hard conversion. * - * Modifications: + * Return: TRUE: hard conversion. + * FALSE: soft conversion. + * FAIL: function failed. * + * Programmer: Raymond Lu + * Friday, Sept 2, 2005 *------------------------------------------------------------------------- */ static htri_t H5T_compiler_conv(H5T_t *src, H5T_t *dst) { - H5T_path_t *path; - htri_t ret_value = FAIL; /* Return value */ + H5T_path_t *path; + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Find it */ if (NULL==(path=H5T_path_find(src, dst, NULL, NULL, H5AC_noio_dxpl_id, FALSE))) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") + HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") ret_value = (htri_t)path->is_hard; @@ -4783,28 +4751,28 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_convert + * Function: H5T_convert * - * Purpose: Call a conversion function to convert from source to - * destination data type and accumulate timing statistics. + * Purpose: Call a conversion function to convert from source to + * destination data type and accumulate timing statistics. * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 15, 1998 * * Modifications: - * Robb Matzke, 1999-06-16 - * The timers are updated only if H5T debugging is enabled at - * runtime in addition to compile time. + * Robb Matzke, 1999-06-16 + * The timers are updated only if H5T debugging is enabled at + * runtime in addition to compile time. * - * Robb Matzke, 1999-06-16 - * Added support for non-zero strides. If BUF_STRIDE is non-zero - * then convert one value at each memory location advancing - * BUF_STRIDE bytes each time; otherwise assume both source and - * destination values are packed. + * Robb Matzke, 1999-06-16 + * Added support for non-zero strides. If BUF_STRIDE is non-zero + * then convert one value at each memory location advancing + * BUF_STRIDE bytes each time; otherwise assume both source and + * destination values are packed. * * Quincey Koziol, 1999-07-01 * Added dataset transfer properties, to allow custom VL @@ -4825,11 +4793,11 @@ done: */ herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, - size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, + size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist) { #ifdef H5T_DEBUG - H5_timer_t timer; + H5_timer_t timer; #endif herr_t ret_value=SUCCEED; /* Return value */ @@ -4841,12 +4809,12 @@ H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, tpath->cdata.command = H5T_CONV_CONV; if ((tpath->func)(src_id, dst_id, &(tpath->cdata), nelmts, buf_stride, bkg_stride, buf, bkg, dset_xfer_plist)<0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "data type conversion failed"); + HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "data type conversion failed"); #ifdef H5T_DEBUG if (H5DEBUG(T)) { - H5_timer_end(&(tpath->stats.timer), &timer); - tpath->stats.ncalls++; - tpath->stats.nelmts += nelmts; + H5_timer_end(&(tpath->stats.timer), &timer); + tpath->stats.ncalls++; + tpath->stats.nelmts += nelmts; } #endif @@ -4856,14 +4824,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_oloc + * Function: H5T_oloc * - * Purpose: Returns a pointer to the object location for a named datatype. + * Purpose: Returns a pointer to the object location for a named datatype. * - * Return: Success: Ptr directly into named datatype - * Failure: NULL + * Return: Success: Ptr directly into named datatype + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, June 5, 1998 * *------------------------------------------------------------------------- @@ -4897,14 +4865,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_nameof + * Function: H5T_nameof * - * Purpose: Returns a pointer to the path for a named datatype. + * Purpose: Returns a pointer to the path for a named datatype. * - * Return: Success: Ptr directly into named datatype - * Failure: NULL + * Return: Success: Ptr directly into named datatype + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, September 12, 2005 * *------------------------------------------------------------------------- @@ -4947,9 +4915,6 @@ done: * * Programmer: Raymond Lu * Friday, Dec 7, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ htri_t @@ -4980,9 +4945,6 @@ done: * * Programmer: Pedro Vicente * Tuesday, Sep 3, 2002 - * - * Modifications: - * *------------------------------------------------------------------------- */ htri_t @@ -5005,9 +4967,9 @@ done: * Function: H5T_convert_committed_datatype * * Purpose: To convert the committed datatype "dt" to a transient embedded - * type if the file location associated with the committed datatype is - * different from the parameter "f". - * "f" is the file location where the dataset or attribute will be created. + * type if the file location associated with the committed datatype is + * different from the parameter "f". + * "f" is the file location where the dataset or attribute will be created. * * Notes: See HDFFV-9940 * @@ -5046,25 +5008,17 @@ done: /*-------------------------------------------------------------------------- - NAME - H5T_get_ref_type - PURPOSE - Retrieves the type of reference for a datatype - USAGE - H5R_type_t H5Tget_ref_type(dt) - H5T_t *dt; IN: datatype pointer for the reference datatype - - RETURNS - Success: A reference type defined in H5Rpublic.h - Failure: H5R_BADTYPE - DESCRIPTION - Given a reference datatype object, this function returns the reference type - of the datatype. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ + * Function: H5T_get_ref_type + * + * Purpose: Retrieves the type of reference for a datatype + * H5T_t *dt; IN: datatype pointer for the reference datatype + * + * Return: Success: A reference type defined in H5Rpublic.h + * Failure: H5R_BADTYPE + * Notes: Given a reference datatype object, this function returns the reference type + * of the datatype. + *-------------------------------------------------------------------------- + */ H5R_type_t H5T_get_ref_type(const H5T_t *dt) { @@ -5083,26 +5037,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_is_sensible - * - * Purpose: Determines if a data type is sensible to store on disk - * (i.e. not partially initialized) - * - * Return: Success: TRUE, FALSE + * Function: H5T_is_sensible * - * Failure: Negative + * Purpose: Determines if a data type is sensible to store on disk + * (i.e. not partially initialized) * - * Programmer: Quincey Koziol - * Tuesday, June 11, 2002 + * Return: Success: TRUE, FALSE * - * Modifications: + * Failure: Negative * + * Programmer: Quincey Koziol + * Tuesday, June 11, 2002 *------------------------------------------------------------------------- */ htri_t H5T_is_sensible(const H5T_t *dt) { - htri_t ret_value = FAIL; /* Return value */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -5166,18 +5117,15 @@ done: DESCRIPTION Recursively descends any VL or compound datatypes to mark all VL datatypes as either on disk or in memory. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ + -------------------------------------------------------------------------- + */ htri_t H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) { - htri_t changed; /* Whether H5T_set_loc changed the type (even if the size didn't change) */ - htri_t ret_value = 0; /* Indicate that success, but no location change */ - unsigned i; /* Local index variable */ - size_t old_size; /* Previous size of a field */ + htri_t changed; /* Whether H5T_set_loc changed the type (even if the size didn't change) */ + htri_t ret_value = 0; /* Indicate that success, but no location change */ + unsigned i; /* Local index variable */ + size_t old_size; /* Previous size of a field */ FUNC_ENTER_NOAPI(FAIL) @@ -5211,53 +5159,53 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) case H5T_COMPOUND: /* Check each field and recurse on VL, compound and array type */ { - ssize_t accum_change = 0; /* Amount of change in the offset of the fields */ + ssize_t accum_change = 0; /* Amount of change in the offset of the fields */ - /* Sort the fields based on offsets */ - H5T__sort_value(dt, NULL); + /* Sort the fields based on offsets */ + H5T__sort_value(dt, NULL); - for (i=0; ishared->u.compnd.nmembs; i++) { - H5T_t *memb_type; /* Member's datatype pointer */ + for (i = 0; i < dt->shared->u.compnd.nmembs; i++) { + H5T_t *memb_type; /* Member's datatype pointer */ - /* Range check against compound member's offset */ - if ((accum_change < 0) && ((ssize_t) dt->shared->u.compnd.memb[i].offset < accum_change)) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype"); + /* Range check against compound member's offset */ + if ((accum_change < 0) && ((ssize_t) dt->shared->u.compnd.memb[i].offset < accum_change)) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype"); - /* Apply the accumulated size change to the offset of the field */ - dt->shared->u.compnd.memb[i].offset += (size_t) accum_change; + /* Apply the accumulated size change to the offset of the field */ + dt->shared->u.compnd.memb[i].offset += (size_t) accum_change; - /* Set the member type pointer (for convenience) */ - memb_type=dt->shared->u.compnd.memb[i].type; + /* Set the member type pointer (for convenience) */ + memb_type = dt->shared->u.compnd.memb[i].type; - /* Recurse if it's VL, compound, enum or array */ - /* (If the force_conv flag is _not_ set, the type cannot change in size, so don't recurse) */ - if(memb_type->shared->force_conv && H5T_IS_COMPLEX(memb_type->shared->type)) { - /* Keep the old field size for later */ - old_size=memb_type->shared->size; + /* Recurse if it's VL, compound, enum or array */ + /* (If the force_conv flag is _not_ set, the type cannot change in size, so don't recurse) */ + if(memb_type->shared->force_conv && H5T_IS_COMPLEX(memb_type->shared->type)) { + /* Keep the old field size for later */ + old_size = memb_type->shared->size; - /* Mark the VL, compound, enum or array type */ - if((changed=H5T_set_loc(memb_type,f,loc))<0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); - if(changed>0) - ret_value=changed; + /* Mark the VL, compound, enum or array type */ + if((changed = H5T_set_loc(memb_type,f,loc)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); + if(changed > 0) + ret_value = changed; - /* Check if the field changed size */ - if(old_size != memb_type->shared->size) { - /* Adjust the size of the member */ - dt->shared->u.compnd.memb[i].size = (dt->shared->u.compnd.memb[i].size*memb_type->shared->size)/old_size; + /* Check if the field changed size */ + if(old_size != memb_type->shared->size) { + /* Adjust the size of the member */ + dt->shared->u.compnd.memb[i].size = (dt->shared->u.compnd.memb[i].size*memb_type->shared->size)/old_size; - /* Add that change to the accumulated size change */ - accum_change += (ssize_t) (memb_type->shared->size - old_size); + /* Add that change to the accumulated size change */ + accum_change += (ssize_t) (memb_type->shared->size - old_size); + } /* end if */ } /* end if */ - } /* end if */ - } /* end for */ + } /* end for */ - /* Range check against datatype size */ - if ((accum_change < 0) && ((ssize_t) dt->shared->size < accum_change)) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype"); + /* Range check against datatype size */ + if ((accum_change < 0) && ((ssize_t) dt->shared->size < accum_change)) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype"); - /* Apply the accumulated size change to the datatype */ - dt->shared->size += (size_t) accum_change; + /* Apply the accumulated size change to the datatype */ + dt->shared->size += (size_t) accum_change; } break; @@ -5265,29 +5213,29 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) /* Recurse if it's VL, compound, enum or array */ /* (If the force_conv flag is _not_ set, the type cannot change in size, so don't recurse) */ if(dt->shared->parent->shared->force_conv && H5T_IS_COMPLEX(dt->shared->parent->shared->type)) { - if((changed=H5T_set_loc(dt->shared->parent,f,loc))<0) + if((changed = H5T_set_loc(dt->shared->parent,f,loc)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); - if(changed>0) - ret_value=changed; + if(changed > 0) + ret_value = changed; } /* end if */ /* Mark this VL sequence */ if((changed = H5T__vlen_set_loc(dt, f, loc)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); - if(changed>0) - ret_value=changed; + if(changed > 0) + ret_value = changed; break; case H5T_REFERENCE: /* Only need to change location of object references */ - if(dt->shared->u.atomic.u.r.rtype==H5R_OBJECT) { + if(dt->shared->u.atomic.u.r.rtype == H5R_OBJECT) { /* Mark this reference */ - if(loc!=dt->shared->u.atomic.u.r.loc) { + if(loc != dt->shared->u.atomic.u.r.loc) { /* Set the location */ dt->shared->u.atomic.u.r.loc = loc; /* Indicate that the location changed */ - ret_value=TRUE; + ret_value = TRUE; } /* end if */ } /* end if */ break; @@ -5356,11 +5304,11 @@ done: * Purpose: H5T__visit callback to Upgrade the version of a datatype * (if there's any benefit to doing so) * - * Note: The behavior below is tightly coupled with the "better" + * Note: The behavior below is tightly coupled with the "better" * encodings for datatype messages in the datatype message * encoding routine. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Thursday, July 19, 2007 @@ -5415,7 +5363,7 @@ H5T_upgrade_version_cb(H5T_t *dt, void *op_value) * doing so) and recursively apply to compound members and/or * parent datatypes. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Thursday, July 19, 2007 @@ -5446,7 +5394,7 @@ done: * * Purpose: Set the encoding for a datatype to the latest version. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Thursday, July 19, 2007 @@ -5557,7 +5505,7 @@ H5Tflush(hid_t type_id) FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", type_id); - + /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") @@ -5590,7 +5538,7 @@ H5Trefresh(hid_t type_id) { H5T_t * dt = NULL; herr_t ret_value = SUCCEED; /* return value */ - + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", type_id); diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 7d6580c..1032d1b 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -33,15 +33,15 @@ print_dimensions (int rank, hsize_t *dims) { int i; - if ( rank <= 0 ) + if ( rank <= 0 ) { parallel_print("H5S_SCALAR" ); } - else + else { if (!dims) parallel_print("dimension is NULL"); - else + else { parallel_print("["); for ( i = 0; i < rank-1; i++) @@ -351,12 +351,12 @@ void print_found(hsize_t nfound) /*----------------------------------------------------------------- * Function: match_up_memsize - * + * * Purpose: match smaller memory size up to bigger memory size *------------------------------------------------------------------ */ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, - hid_t *m_tid1, hid_t *m_tid2, + hid_t *m_tid1, hid_t *m_tid2, size_t *m_size1, size_t *m_size2) { herr_t ret = SUCCEED; diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 86dca8b..2cc02e8 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -277,16 +277,16 @@ h5tools_set_attr_output_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { - rawattrstream = f; - retvalue = SUCCEED; - } + if ((f = HDfopen(fname, "wb")) != NULL) { + rawattrstream = f; + retvalue = SUCCEED; + } } else { - if ((f = HDfopen(fname, "w")) != NULL) { - rawattrstream = f; - retvalue = SUCCEED; - } + if ((f = HDfopen(fname, "w")) != NULL) { + rawattrstream = f; + retvalue = SUCCEED; + } } } else { @@ -319,26 +319,26 @@ h5tools_set_input_file(const char *fname, int is_bin) if (HDfclose(rawinstream)) HDperror("closing rawinstream"); else - rawinstream = NULL; + rawinstream = NULL; } /* First check if filename is string "NULL" */ if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "rb")) != NULL) { - rawinstream = f; - retvalue = SUCCEED; - } + if ((f = HDfopen(fname, "rb")) != NULL) { + rawinstream = f; + retvalue = SUCCEED; + } } else { - if ((f = HDfopen(fname, "r")) != NULL) { - rawinstream = f; - retvalue = SUCCEED; - } + if ((f = HDfopen(fname, "r")) != NULL) { + rawinstream = f; + retvalue = SUCCEED; + } } } else { - rawinstream = NULL; + rawinstream = NULL; retvalue = SUCCEED; } @@ -373,16 +373,16 @@ h5tools_set_output_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { - rawoutstream = f; - retvalue = SUCCEED; - } + if ((f = HDfopen(fname, "wb")) != NULL) { + rawoutstream = f; + retvalue = SUCCEED; + } } else { - if ((f = HDfopen(fname, "w")) != NULL) { - rawoutstream = f; - retvalue = SUCCEED; - } + if ((f = HDfopen(fname, "w")) != NULL) { + rawoutstream = f; + retvalue = SUCCEED; + } } } else { @@ -421,21 +421,21 @@ h5tools_set_error_file(const char *fname, int is_bin) /* First check if filename is string "NULL" */ if (fname != NULL) { /* binary output */ - if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { - rawerrorstream = f; - retvalue = SUCCEED; - } + if (is_bin) { + if ((f = HDfopen(fname, "wb")) != NULL) { + rawerrorstream = f; + retvalue = SUCCEED; + } } else { - if ((f = HDfopen(fname, "w")) != NULL) { - rawerrorstream = f; - retvalue = SUCCEED; - } - } + if ((f = HDfopen(fname, "w")) != NULL) { + rawerrorstream = f; + retvalue = SUCCEED; + } + } } else { - rawerrorstream = NULL; + rawerrorstream = NULL; retvalue = SUCCEED; } -- cgit v0.12 From 4f36f613a6de09d8ec197b7e5a4a72dbdb9417a2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 May 2017 16:52:05 -0500 Subject: HDFFV-10186 Whitespace change Mostly tabs to spaces Remove Modifications comments --- hl/tools/gif2h5/gif2mem.c | 6 +- tools/lib/h5tools_type.c | 1 - tools/src/h5dump/h5dump_xml.c | 446 +++++++++----------- tools/src/h5repack/h5repack.c | 843 ++++++++++++++++++------------------- tools/src/h5repack/h5repack_copy.c | 215 +++++----- tools/src/h5repack/h5repack_refs.c | 38 +- tools/test/misc/talign.c | 4 +- 7 files changed, 746 insertions(+), 807 deletions(-) diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 40b5583..55aae86 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -218,7 +218,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) PlainTextCount++; if (PlainTextCount > PlainTextArray) - PlainTextArray = (BYTE)((PlainTextArray << 1) + 1); + PlainTextArray = (BYTE)((PlainTextArray << 1) + 1); if (!(gifPlainText = (GIFPLAINTEXT **)realloc(gifPlainText , sizeof(GIFPLAINTEXT *) * PlainTextArray))) { printf("Out of memory!"); @@ -240,7 +240,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) CommentCount++; if (CommentCount > CommentArray) - CommentArray = (BYTE)((CommentArray << 1) + 1); + CommentArray = (BYTE)((CommentArray << 1) + 1); if (!(gifComment = (GIFCOMMENT **)realloc(gifComment , sizeof(GIFCOMMENT *) * CommentArray))) { printf("Out of memory!"); @@ -305,7 +305,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) ApplicationCount++; if (ApplicationCount > ApplicationArray) - ApplicationArray = (BYTE)((ApplicationArray << 1) + 1); + ApplicationArray = (BYTE)((ApplicationArray << 1) + 1); if (!(gifApplication = (GIFAPPLICATION **)realloc(gifApplication , sizeof(GIFAPPLICATION *) * ApplicationArray))) { printf("Out of memory!"); diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c index dcc994e..8c5592f 100644 --- a/tools/lib/h5tools_type.c +++ b/tools/lib/h5tools_type.c @@ -46,7 +46,6 @@ h5tools_get_native_type(hid_t type) return(p_type); } - /*------------------------------------------------------------------------- * Function: h5tools_get_little_endian_type * diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 49d1ba8..f4ec353 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -108,7 +108,7 @@ static h5tool_format_t xml_dataformat = { /* internal functions */ -static int xml_name_to_XID(const char *, char *, int , int ); +static int xml_name_to_XID(const char *, char *, int , int ); /* internal functions used by XML option */ static void xml_print_datatype(hid_t, unsigned); @@ -122,34 +122,26 @@ static char *xml_escape_the_name(const char *); * Function: xml_dump_all_cb * * Purpose: function callback called by H5Literate, - * displays everything in the specified object + * displays everything in the specified object * * Return: Success: SUCCEED * * Failure: FAIL * * Programmer: Ruey-Hsia Li - * - * Modifications: - * RMcG, November 2000 - * Added XML support. Also, optionally checks the op_data argument - * - * PVN, May 2008 - * Dump external links - * *------------------------------------------------------------------------- */ static herr_t xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR_UNUSED *op_data) { - hid_t obj; - herr_t ret = SUCCEED; - char *obj_path = NULL; /* Full path of object */ - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + hid_t obj; + herr_t ret = SUCCEED; + char *obj_path = NULL; /* Full path of object */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + hsize_t curr_pos = 0; /* total data element position */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -157,7 +149,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -180,7 +172,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ if(!obj_path) { ret = FAIL; goto done; - } + } HDstrcpy(obj_path, prefix); HDstrcat(obj_path, "/"); @@ -268,7 +260,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ ret = FAIL; H5Dclose(obj); goto done; - } + } else if(found_obj->displayed) { /* the XML version */ char *t_obj_path = xml_escape_the_name(obj_path); @@ -330,14 +322,14 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ H5Dclose(obj); goto done; - } + } else found_obj->displayed = TRUE; } /* end if */ dump_function_table->dump_dataset_function(obj, name, NULL); H5Dclose(obj); - } + } else { error_msg("unable to dump dataset \"%s\"\n", name); h5tools_setstatus(EXIT_FAILURE); @@ -350,7 +342,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ error_msg("unable to dump datatype \"%s\"\n", name); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; - } + } else { dump_function_table->dump_named_datatype_function(obj, name); H5Tclose(obj); @@ -377,7 +369,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ error_msg("unable to get link value\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; - } + } else { /* print the value of a soft link */ /* XML */ @@ -426,7 +418,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ parentxid, /* Parents */ t_prefix); /* H5ParentPaths */ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } + } else { /* dangling link -- omit from xml attributes */ ctx.need_prefix = TRUE; @@ -510,7 +502,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ parentxid, /* Parents */ t_prefix); /* H5ParentPaths */ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - + HDfree(t_prefix); HDfree(t_name); HDfree(t_filename); @@ -556,7 +548,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ parentxid, /* Parents */ t_prefix); /* H5ParentPaths */ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - + HDfree(t_prefix); HDfree(t_name); HDfree(t_obj_path); @@ -598,18 +590,18 @@ xml_name_to_XID(const char *str , char *outstr, int outlen, int gen) objno = ref_path_table_gen_fake(str); sprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno); return 0; - } + } else { return 1; } } - } + } else { if (gen) { objno = ref_path_table_gen_fake(str); sprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno); return 0; - } + } else { return 1; } @@ -636,9 +628,6 @@ static const char *apos = "'"; * Return: The revised string. * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static char * @@ -691,23 +680,23 @@ xml_escape_the_name(const char *str) if (*cp == '\'') { HDstrncpy(ncp, apos, ncp_len); esc_len = HDstrlen(apos); - } + } else if (*cp == '<') { HDstrncpy(ncp, lt, ncp_len); esc_len = HDstrlen(lt); - } + } else if (*cp == '>') { HDstrncpy(ncp, gt, ncp_len); esc_len = HDstrlen(gt); - } + } else if (*cp == '\"') { HDstrncpy(ncp, quote, ncp_len); esc_len = HDstrlen(quote); - } + } else if (*cp == '&') { HDstrncpy(ncp, amp, ncp_len); esc_len = HDstrlen(amp); - } + } else { *ncp = *cp; esc_len = 1; @@ -730,9 +719,6 @@ xml_escape_the_name(const char *str) * Return: The revised string. * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static char * @@ -838,9 +824,6 @@ xml_escape_the_string(const char *str, int slen) * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -865,12 +848,12 @@ xml_print_datatype(hid_t type, unsigned in_group) size_t mpos; size_t msize; int nmembs; - htri_t is_vlstr=FALSE; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ - h5tool_format_t *outputformat = &xml_dataformat; - h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + htri_t is_vlstr = FALSE; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -878,7 +861,7 @@ xml_print_datatype(hid_t type, unsigned in_group) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -923,7 +906,7 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"/%s\"/>", xmlnsprefix, dtxid); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } + } else { /* point to the NDT by name */ char *t_objname = xml_escape_the_name(found_obj->objname); @@ -939,7 +922,7 @@ xml_print_datatype(hid_t type, unsigned in_group) HDfree(t_objname); } HDfree(dtxid); - } + } else { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -950,7 +933,7 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); h5tools_setstatus(EXIT_FAILURE); } - } + } else { switch (H5Tget_class(type)) { case H5T_INTEGER: @@ -988,9 +971,9 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_str_append(&buffer, "ERROR_UNKNOWN"); break; } /* end switch */ - + h5tools_str_append(&buffer, "\" Sign=\""); - + switch (sgn) { case H5T_SGN_NONE: h5tools_str_append(&buffer, "false"); @@ -1004,7 +987,7 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_str_append(&buffer, "ERROR_UNKNOWN"); break; } /* end switch */ - + h5tools_str_append(&buffer, "\" Size=\""); sz = H5Tget_size(type); h5tools_str_append(&buffer, "%lu", (unsigned long)sz); @@ -1043,7 +1026,7 @@ xml_print_datatype(hid_t type, unsigned in_group) /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sFloatType ByteOrder=\"",xmlnsprefix); - + switch (ord) { case H5T_ORDER_LE: h5tools_str_append(&buffer, "LE"); @@ -1060,7 +1043,7 @@ xml_print_datatype(hid_t type, unsigned in_group) default: h5tools_str_append(&buffer, "ERROR_UNKNOWN"); } /* end switch */ - + h5tools_str_append(&buffer, "\" Size=\""); sz = H5Tget_size(type); h5tools_str_append(&buffer, "%lu", (unsigned long)sz); @@ -1182,7 +1165,7 @@ xml_print_datatype(hid_t type, unsigned in_group) /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sBitfieldType ByteOrder=\"",xmlnsprefix); - + switch (ord) { case H5T_ORDER_LE: h5tools_str_append(&buffer, "LE"); @@ -1197,7 +1180,7 @@ xml_print_datatype(hid_t type, unsigned in_group) default: h5tools_str_append(&buffer, "ERROR_UNKNOWN"); } /* end switch */ - + size = H5Tget_size(type); h5tools_str_append(&buffer, "\" Size=\"%lu\"/>", (unsigned long)size); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -1559,19 +1542,16 @@ xml_print_datatype(hid_t type, unsigned in_group) * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ void xml_dump_datatype(hid_t type) { - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + hsize_t curr_pos = 0; /* total data element position */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -1579,7 +1559,7 @@ xml_dump_datatype(hid_t type) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -1629,7 +1609,7 @@ xml_dump_datatype(hid_t type) h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"%s\"/>", xmlnsprefix, dtxid); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } + } else { /* pointer to a named datatype already in XML */ char *t_objname = xml_escape_the_name(found_obj->objname); @@ -1645,7 +1625,7 @@ xml_dump_datatype(hid_t type) HDfree(t_objname); } HDfree(dtxid); - } + } else { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -1692,25 +1672,22 @@ xml_dump_datatype(hid_t type) * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ void xml_dump_dataspace(hid_t space) { - hsize_t size[H5DUMP_MAX_RANK]; - hsize_t maxsize[H5DUMP_MAX_RANK]; - int i; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + hsize_t size[H5DUMP_MAX_RANK]; + hsize_t maxsize[H5DUMP_MAX_RANK]; + int i; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ - - int ndims = H5Sget_simple_extent_dims(space, size, maxsize); - H5S_class_t space_type = H5Sget_simple_extent_type(space); + hsize_t curr_pos = 0; /* total data element position */ + + int ndims = H5Sget_simple_extent_dims(space, size, maxsize); + H5S_class_t space_type = H5Sget_simple_extent_type(space); /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -1718,7 +1695,7 @@ xml_dump_dataspace(hid_t space) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -1784,7 +1761,7 @@ xml_dump_dataspace(hid_t space) h5tools_str_append(&buffer, "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" MaxDimSize=\"UNLIMITED\"/>", xmlnsprefix,size[i]); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } + } else if (maxsize[i] == (hsize_t) 0) { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -1794,7 +1771,7 @@ xml_dump_dataspace(hid_t space) h5tools_str_append(&buffer, "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" MaxDimSize=\"%" H5_PRINTF_LL_WIDTH "u\"/>", xmlnsprefix,size[i], size[i]); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } + } else { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -1868,9 +1845,6 @@ xml_dump_dataspace(hid_t space) * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -1886,19 +1860,19 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, int status = -1; void *buf = NULL; hsize_t curr_pos = 0; /* total data element position */ - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + /* Print all the values. */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); - + string_dataformat = *outputformat; if (fp_format) { @@ -1922,7 +1896,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); @@ -1932,14 +1906,14 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.indent_level--; - + dump_indent += COL; ctx.indent_level++; @@ -1957,7 +1931,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, datactx.cur_column = ctx.cur_column; status = h5tools_dump_dset(rawoutstream, outputformat, &datactx, obj_id, NULL); } - } + } else { /* Attribute data */ type = H5Aget_type(obj_id); @@ -1970,10 +1944,10 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, */ status = xml_print_refs(obj_id, ATTRIBUTE_DATA); H5Tclose(type); - } + } else if (H5Tget_class(type) == H5T_STRING) { status = xml_print_strs(obj_id, ATTRIBUTE_DATA); - } + } else { /* all other data */ /* VL data special information */ unsigned int vl_data = 0; /* contains VL datatypes */ @@ -1995,7 +1969,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)))); HDassert(buf); - + if (H5Aread(obj_id, p_type, buf) >= 0) { h5tools_context_t datactx; HDmemset(&datactx, 0, sizeof(datactx)); @@ -2020,7 +1994,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "Unable to print data."); @@ -2036,7 +2010,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.indent_level++; ctx.need_prefix = TRUE; - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); @@ -2046,7 +2020,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2063,9 +2037,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, * Return: herr_t * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2077,11 +2048,11 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED hid_t space = -1; H5S_class_t space_type; hsize_t curr_pos = 0; /* total data element position */ - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - + char *t_aname = xml_escape_the_name(attr_name); /* setup */ @@ -2090,7 +2061,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -2110,7 +2081,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sAttribute Name=\"%s\">", xmlnsprefix, t_aname); @@ -2146,7 +2117,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); @@ -2154,7 +2125,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); @@ -2162,7 +2133,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); @@ -2170,7 +2141,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); @@ -2178,7 +2149,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2191,7 +2162,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED case H5T_COMPOUND: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); @@ -2202,7 +2173,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED case H5T_REFERENCE: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); @@ -2210,7 +2181,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED if (!H5Tequal(type, H5T_STD_REF_OBJ)) { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); @@ -2218,7 +2189,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); @@ -2227,7 +2198,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED else { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); @@ -2237,7 +2208,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2246,7 +2217,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2256,7 +2227,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED case H5T_VLEN: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); @@ -2271,7 +2242,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); @@ -2279,7 +2250,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", H5Tget_class(type)); @@ -2287,7 +2258,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); @@ -2295,7 +2266,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2308,7 +2279,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED * Or dataspace is H5S_NULL. */ ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); @@ -2318,7 +2289,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); @@ -2328,7 +2299,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2343,7 +2314,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); @@ -2358,7 +2329,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, ""); @@ -2368,14 +2339,14 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); h5tools_str_close(&buffer); - + h5tools_setstatus(EXIT_FAILURE); return FAIL; } @@ -2389,17 +2360,14 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED * Return: herr_t * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ void xml_dump_named_datatype(hid_t type, const char *name) { hsize_t curr_pos = 0; /* total data element position */ - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; char *tmp; @@ -2420,7 +2388,7 @@ xml_dump_named_datatype(hid_t type, const char *name) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -2458,7 +2426,7 @@ xml_dump_named_datatype(hid_t type, const char *name) ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNamedDataType Name=\"%s\" OBJ-XID=\"%s\" " @@ -2467,13 +2435,13 @@ xml_dump_named_datatype(hid_t type, const char *name) name, dtxid, parentxid, HDstrcmp(prefix,"") ? t_prefix : "/"); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } + } else { H5O_info_t oinfo; /* Object info */ ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNamedDataType Name=\"%s\" OBJ-XID=\"%s\" " @@ -2496,7 +2464,7 @@ xml_dump_named_datatype(hid_t type, const char *name) error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); h5tools_setstatus(EXIT_FAILURE); goto done; - } + } else if(found_obj->displayed) { /* We have already printed this named datatype, print it as a * NamedDatatypePtr @@ -2505,29 +2473,29 @@ xml_dump_named_datatype(hid_t type, const char *name) char *t_objname = xml_escape_the_name(found_obj->objname); ctx.indent_level++; - + xml_name_to_XID(found_obj->objname, pointerxid, (int)sizeof(pointerxid), 1); ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sNamedDatatypePtr OBJ-XID=\"%s\" H5Path=\"%s\"/>", xmlnsprefix, pointerxid, t_objname); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - + ctx.indent_level--; ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "", xmlnsprefix); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); HDfree(t_objname); goto done; - } + } else found_obj->displayed = TRUE; } @@ -2538,7 +2506,7 @@ xml_dump_named_datatype(hid_t type, const char *name) ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix); @@ -2549,10 +2517,10 @@ xml_dump_named_datatype(hid_t type, const char *name) xml_print_datatype(type,1); ctx.indent_level--; dump_indent -= COL; - + ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); @@ -2563,7 +2531,7 @@ xml_dump_named_datatype(hid_t type, const char *name) ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - + /* Render the element */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "",xmlnsprefix); @@ -2589,11 +2557,6 @@ done: * Return: void * * Programmer: REMcG - * - * Modifications: - * Pedro Vicente, October 9, 2007 - * added parameters to H5A(L)iterate to allow for other iteration orders - * *------------------------------------------------------------------------- */ void @@ -2611,11 +2574,11 @@ xml_dump_group(hid_t gid, const char *name) char *cp = NULL; char *tmp = NULL; char *par = NULL; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ - h5tool_format_t *outputformat = &xml_dataformat; - h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ if ((gcpl_id = H5Gget_create_plist(gid)) < 0) { error_msg("error in getting group creation property list ID\n"); @@ -2645,7 +2608,7 @@ xml_dump_group(hid_t gid, const char *name) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -2733,7 +2696,7 @@ xml_dump_group(hid_t gid, const char *name) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); HDfree(t_objname); HDfree(par_name); - + ctx.indent_level++; t_objname = xml_escape_the_name(found_obj->objname);/* point to the NDT by name */ @@ -2751,7 +2714,7 @@ xml_dump_group(hid_t gid, const char *name) xmlnsprefix, ptrstr, t_objname, parentxid, par_name); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - + ctx.indent_level--; HDfree(t_objname); @@ -2797,7 +2760,7 @@ xml_dump_group(hid_t gid, const char *name) found_obj->displayed = TRUE; /* 1. do all the attributes of the group */ - + ctx.indent_level++; dump_indent += COL; @@ -2880,7 +2843,7 @@ xml_dump_group(hid_t gid, const char *name) HDfree(parentxid); /* 1. do all the attributes of the group */ - + ctx.indent_level++; dump_indent += COL; @@ -2936,7 +2899,7 @@ xml_dump_group(hid_t gid, const char *name) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); h5tools_str_close(&buffer); - + if(par) HDfree(par); if(tmp) @@ -2951,27 +2914,24 @@ xml_dump_group(hid_t gid, const char *name) * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static int xml_print_refs(hid_t did, int source) { - herr_t e; - hid_t type = -1; - hid_t space = -1; - hssize_t ssiz = -1; - hsize_t i; - size_t tsiz; - hobj_ref_t *refbuf = NULL; - char *buf = NULL; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + herr_t e; + hid_t type = -1; + hid_t space = -1; + hssize_t ssiz = -1; + hsize_t i; + size_t tsiz; + hobj_ref_t *refbuf = NULL; + char *buf = NULL; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + hsize_t curr_pos = 0; /* total data element position */ if (source == DATASET_DATA) { type = H5Dget_type(did); @@ -3031,7 +2991,7 @@ xml_print_refs(hid_t did, int source) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -3085,7 +3045,7 @@ xml_print_refs(hid_t did, int source) H5Tclose(type); H5Sclose(space); return SUCCEED; - + error: if(buf) HDfree(buf); @@ -3105,30 +3065,27 @@ error: * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static int xml_print_strs(hid_t did, int source) { - herr_t e; - hid_t type = -1; - hid_t space = -1; - hssize_t ssiz = -1; - htri_t is_vlstr = FALSE; - size_t tsiz = 0; - hsize_t i; - size_t str_size = 0; - char *bp = NULL; - char *onestring = NULL; - void *buf = NULL; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + herr_t e; + hid_t type = -1; + hid_t space = -1; + hssize_t ssiz = -1; + htri_t is_vlstr = FALSE; + size_t tsiz = 0; + hsize_t i; + size_t str_size = 0; + char *bp = NULL; + char *onestring = NULL; + void *buf = NULL; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + hsize_t curr_pos = 0; /* total data element position */ if (source == DATASET_DATA) type = H5Dget_type(did); @@ -3184,7 +3141,7 @@ xml_print_strs(hid_t did, int source) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -3252,7 +3209,7 @@ xml_print_strs(hid_t did, int source) H5Tclose(type); H5Sclose(space); return SUCCEED; - + error: if(buf) HDfree(buf); @@ -3273,26 +3230,23 @@ error: * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static void check_filters(hid_t dcpl) { - int nfilt; - int i; - H5Z_filter_t filter; - char namebuf[120]; - size_t cd_nelmts = 20; - unsigned int cd_values[20]; - unsigned int flags; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + int nfilt; + int i; + H5Z_filter_t filter; + char namebuf[120]; + size_t cd_nelmts = 20; + unsigned int cd_values[20]; + unsigned int flags; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + hsize_t curr_pos = 0; /* total data element position */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -3300,7 +3254,7 @@ check_filters(hid_t dcpl) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -3423,16 +3377,16 @@ check_filters(hid_t dcpl) static void xml_dump_fill_value(hid_t dcpl, hid_t type) { - size_t sz; - size_t i; - hsize_t space; - void *buf; - char *name; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + size_t sz; + size_t i; + hsize_t space; + void *buf; + char *name; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + hsize_t curr_pos = 0; /* total data element position */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -3440,7 +3394,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -3452,7 +3406,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) string_dataformat.line_ncols = 65535; string_dataformat.line_per_line = 1; } - else + else string_dataformat.line_ncols = h5tools_nCols; string_dataformat.do_escape = display_escape; @@ -3764,11 +3718,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) * Return: void * * Programmer: REMcG - * - * Modifications: - * Pedro Vicente, October 9, 2007 - * added parameters to H5Aiterate2 to allow for other iteration orders - * *------------------------------------------------------------------------- */ void @@ -3791,11 +3740,11 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s char *t_prefix; unsigned attr_crt_order_flags; h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ + h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ - + hsize_t curr_pos = 0; /* total data element position */ + char *rstr = (char*) HDmalloc((size_t)100); char *pstr = (char*) HDmalloc((size_t)100); @@ -3814,7 +3763,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s t_name = xml_escape_the_name(name); t_tmp = xml_escape_the_name(tmp); t_prefix = xml_escape_the_name(prefix); - + string_dataformat = *outputformat; if (fp_format) { @@ -3925,7 +3874,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level--; dump_indent -= COL; - + ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -4376,9 +4325,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s * Return: void * * Programmer: REMcG - * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -4392,11 +4338,11 @@ xml_print_enum(hid_t type) size_t dst_size; /*destination value type size */ unsigned i; /*miscellaneous counters */ size_t j; - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t ctx; /* print context */ - h5tool_format_t *outputformat = &xml_dataformat; - h5tool_format_t string_dataformat; - hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -4404,7 +4350,7 @@ xml_print_enum(hid_t type) HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - + string_dataformat = *outputformat; if (fp_format) { @@ -4455,11 +4401,11 @@ xml_print_enum(hid_t type) if (H5T_SGN_NONE == H5Tget_sign(type)) { native = H5T_NATIVE_ULLONG; - } + } else { native = H5T_NATIVE_LLONG; } - } + } else { dst_size = H5Tget_size(type); } @@ -4530,11 +4476,11 @@ xml_print_enum(hid_t type) for (j = 0; j < dst_size; j++) h5tools_str_append(&buffer, "%02x", value[i * dst_size + j]); - } + } else if (H5T_SGN_NONE == H5Tget_sign(native)) { h5tools_str_append(&buffer,"%" H5_PRINTF_LL_WIDTH "u", *((unsigned long long *) ((void *) (value + i * dst_size)))); - } + } else { h5tools_str_append(&buffer,"%" H5_PRINTF_LL_WIDTH "d", *((long long *) ((void *) (value + i * dst_size)))); diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index d047612..6f50cbc 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -51,19 +51,19 @@ static int have_request(pack_opt_t *options); *------------------------------------------------------------------------- */ int h5repack(const char* infile, const char* outfile, pack_opt_t *options) { - /* check input */ - if (check_options(options) < 0) - return -1; + /* check input */ + if (check_options(options) < 0) + return -1; - /* check for objects in input that are in the file */ - if (check_objects(infile, options) < 0) - return -1; + /* check for objects in input that are in the file */ + if (check_objects(infile, options) < 0) + return -1; - /* copy the objects */ - if (copy_objects(infile, outfile, options) < 0) - return -1; + /* copy the objects */ + if (copy_objects(infile, outfile, options) < 0) + return -1; - return 0; + return 0; } /*------------------------------------------------------------------------- @@ -105,7 +105,7 @@ h5repack_init(pack_opt_t *options, int verbose, hbool_t latest) */ int h5repack_end(pack_opt_t *options) { - return options_table_free(options->op_tbl); + return options_table_free(options->op_tbl); } /*------------------------------------------------------------------------- @@ -121,10 +121,10 @@ int h5repack_end(pack_opt_t *options) { int h5repack_addfilter(const char* str, pack_opt_t *options) { - obj_list_t *obj_list = NULL; /* one object list for the -f and -l option entry */ - filter_info_t filter; /* filter info for the current -f option entry */ - unsigned n_objs; /* number of objects in the current -f or -l option entry */ - int is_glb; /* is the filter global */ + obj_list_t *obj_list = NULL; /* one object list for the -f and -l option entry */ + filter_info_t filter; /* filter info for the current -f option entry */ + unsigned n_objs; /* number of objects in the current -f or -l option entry */ + int is_glb; /* is the filter global */ /* parse the -f option */ if (NULL == (obj_list = parse_filter(str, &n_objs, &filter, options, &is_glb))) @@ -163,10 +163,10 @@ int h5repack_addlayout(const char* str, pack_opt_t *options) { obj_list_t *obj_list = NULL; /*one object list for the -t and -c option entry */ - unsigned n_objs; /*number of objects in the current -t or -c option entry */ - pack_info_t pack; /*info about layout to extract from parse */ - int j; - int ret_value = -1; + unsigned n_objs; /*number of objects in the current -t or -c option entry */ + pack_info_t pack; /*info about layout to extract from parse */ + int j; + int ret_value = -1; init_packobject(&pack); @@ -232,62 +232,62 @@ h5repack_addlayout(const char* str, pack_opt_t *options) *------------------------------------------------------------------------- */ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, - named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options) { - named_dt_t *dt = *named_dt_head_p; /* Stack pointer */ - named_dt_t *dt_ret = NULL; /* Datatype to return */ - H5O_info_t oinfo; /* Object info of input dtype */ - hid_t ret_value = -1; /* The identifier of the named dtype in the out file */ - - if (H5Oget_info(type_in, &oinfo) < 0) - goto done; - - if (*named_dt_head_p) { - /* Stack already exists, search for the datatype */ - while (dt && dt->addr_in != oinfo.addr) - dt = dt->next; - - dt_ret = dt; - } - else { - /* Create the stack */ - size_t i; - - for (i = 0; i < travt->nobjs; i++) { - if (travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) { - /* Push onto the stack */ - if (NULL == (dt = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) { - goto done; - } - dt->next = *named_dt_head_p; - *named_dt_head_p = dt; - - /* Update the address and id */ - dt->addr_in = travt->objs[i].objno; - dt->id_out = -1; - - /* Check if this type is the one requested */ - if (oinfo.addr == dt->addr_in) { - HDassert(!dt_ret); - dt_ret = dt; - } /* end if */ - } /* end if */ - } /* end for */ - } /* end else */ - - /* Handle the case that the requested datatype was not found. This is - * possible if the datatype was committed anonymously in the input file. */ - if (!dt_ret) { - /* Push the new datatype onto the stack */ - if (NULL == (dt_ret = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) { - goto done; - } - dt_ret->next = *named_dt_head_p; - *named_dt_head_p = dt_ret; + named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options) { + named_dt_t *dt = *named_dt_head_p; /* Stack pointer */ + named_dt_t *dt_ret = NULL; /* Datatype to return */ + H5O_info_t oinfo; /* Object info of input dtype */ + hid_t ret_value = -1; /* The identifier of the named dtype in the out file */ - /* Update the address and id */ - dt_ret->addr_in = oinfo.addr; - dt_ret->id_out = -1; - } /* end if */ + if (H5Oget_info(type_in, &oinfo) < 0) + goto done; + + if (*named_dt_head_p) { + /* Stack already exists, search for the datatype */ + while (dt && dt->addr_in != oinfo.addr) + dt = dt->next; + + dt_ret = dt; + } + else { + /* Create the stack */ + size_t i; + + for (i = 0; i < travt->nobjs; i++) { + if (travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) { + /* Push onto the stack */ + if (NULL == (dt = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) { + goto done; + } + dt->next = *named_dt_head_p; + *named_dt_head_p = dt; + + /* Update the address and id */ + dt->addr_in = travt->objs[i].objno; + dt->id_out = -1; + + /* Check if this type is the one requested */ + if (oinfo.addr == dt->addr_in) { + HDassert(!dt_ret); + dt_ret = dt; + } /* end if */ + } /* end if */ + } /* end for */ + } /* end else */ + + /* Handle the case that the requested datatype was not found. This is + * possible if the datatype was committed anonymously in the input file. */ + if (!dt_ret) { + /* Push the new datatype onto the stack */ + if (NULL == (dt_ret = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) { + goto done; + } + dt_ret->next = *named_dt_head_p; + *named_dt_head_p = dt_ret; + + /* Update the address and id */ + dt_ret->addr_in = oinfo.addr; + dt_ret->id_out = -1; + } /* end if */ /* If the requested datatype does not yet exist in the output file, copy it * anonymously */ @@ -302,17 +302,17 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, goto done; } /* end if */ - /* Set return value */ - ret_value = dt_ret->id_out; + /* Set return value */ + ret_value = dt_ret->id_out; - /* Increment the ref count on id_out, because the calling function will try - * to close it */ - if(H5Iinc_ref(ret_value) < 0) { - ret_value = -1; - } + /* Increment the ref count on id_out, because the calling function will try + * to close it */ + if(H5Iinc_ref(ret_value) < 0) { + ret_value = -1; + } done: - return (ret_value); + return (ret_value); } /* end copy_named_datatype */ /*------------------------------------------------------------------------- @@ -327,22 +327,22 @@ done: *------------------------------------------------------------------------- */ int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) { - named_dt_t *dt = *named_dt_head_p; - int ret_value = -1; + named_dt_t *dt = *named_dt_head_p; + int ret_value = -1; - while (dt) { - /* Pop the datatype off the stack and free it */ - if (H5Tclose(dt->id_out) < 0 && !ignore_err) - goto done; - dt = dt->next; - HDfree(*named_dt_head_p); - *named_dt_head_p = dt; - } /* end while */ + while (dt) { + /* Pop the datatype off the stack and free it */ + if (H5Tclose(dt->id_out) < 0 && !ignore_err) + goto done; + dt = dt->next; + HDfree(*named_dt_head_p); + *named_dt_head_p = dt; + } /* end while */ - ret_value = 0; + ret_value = 0; done: - return (ret_value); + return (ret_value); } /* end named_datatype_free */ /*------------------------------------------------------------------------- @@ -363,25 +363,25 @@ done: */ int copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, - trav_table_t *travt, pack_opt_t *options) + trav_table_t *travt, pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t attr_id = -1; /* attr ID */ - hid_t attr_out = -1; /* attr ID */ - hid_t space_id = -1; /* space ID */ - hid_t ftype_id = -1; /* file type ID */ - hid_t wtype_id = -1; /* read/write type ID */ - size_t msize; /* size of type */ - void *buf = NULL; /* data buffer */ - hsize_t nelmts; /* number of elements in dataset */ - int rank; /* rank of dataset */ - htri_t is_named; /* Whether the datatype is named */ - hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ - char name[255]; - H5O_info_t oinfo; /* object info */ - int j; - unsigned u; - hbool_t is_ref = 0; + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t attr_id = -1; /* attr ID */ + hid_t attr_out = -1; /* attr ID */ + hid_t space_id = -1; /* space ID */ + hid_t ftype_id = -1; /* file type ID */ + hid_t wtype_id = -1; /* read/write type ID */ + size_t msize; /* size of type */ + void *buf = NULL; /* data buffer */ + hsize_t nelmts; /* number of elements in dataset */ + int rank; /* rank of dataset */ + htri_t is_named; /* Whether the datatype is named */ + hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ + char name[255]; + H5O_info_t oinfo; /* object info */ + int j; + unsigned u; + hbool_t is_ref = 0; H5T_class_t type_class = -1; if (H5Oget_info(loc_in, &oinfo) < 0) @@ -568,193 +568,188 @@ done: * Programmer: pvn@ncsa.uiuc.edu * * Date: September, 22, 2003 - * - * Modification: - * Peter Cao, July 9, 2007 - * Add "-L, --latest" and other options to pack a file with the latest file format - * *------------------------------------------------------------------------- */ static int check_options(pack_opt_t *options) { - unsigned int i; - int k, j, has_cp = 0, has_ck = 0; - char slayout[30]; - - /*------------------------------------------------------------------------- - * objects to layout - *------------------------------------------------------------------------- - */ - if (options->verbose && have_request(options) /* only print if requested */) { - printf("Objects to modify layout are...\n"); - if (options->all_layout == 1) { - switch (options->layout_g) { - case H5D_COMPACT: - strcpy(slayout, "compact"); - break; - case H5D_CONTIGUOUS: - strcpy(slayout, "contiguous"); - break; - case H5D_CHUNKED: - strcpy(slayout, "chunked"); - break; - case H5D_VIRTUAL: - strcpy(slayout, "virtual"); - break; - case H5D_LAYOUT_ERROR: - case H5D_NLAYOUTS: - error_msg("invalid layout\n"); - return -1; - default: - strcpy(slayout, "invalid layout\n"); - return -1; - } - printf(" Apply %s layout to all\n", slayout); - if (H5D_CHUNKED == options->layout_g) { - printf("with dimension ["); - for (j = 0; j < options->chunk_g.rank; j++) - printf("%d ", (int) options->chunk_g.chunk_lengths[j]); - printf("]\n"); - } - } - }/* verbose */ - - for (i = 0; i < options->op_tbl->nelems; i++) { - char* name = options->op_tbl->objs[i].path; - - if (options->op_tbl->objs[i].chunk.rank > 0) { - if (options->verbose) { - printf(" <%s> with chunk size ", name); - for (k = 0; k < options->op_tbl->objs[i].chunk.rank; k++) - printf("%d ", - (int) options->op_tbl->objs[i].chunk.chunk_lengths[k]); - printf("\n"); - } - has_ck = 1; - } - else if (options->op_tbl->objs[i].chunk.rank == -2) { - if (options->verbose) - printf(" <%s> %s\n", name, "NONE (contigous)"); - has_ck = 1; - } - } - - if (options->all_layout == 1 && has_ck) { - error_msg( - "invalid chunking input: 'all' option\ + unsigned int i; + int k, j, has_cp = 0, has_ck = 0; + char slayout[30]; + + /*------------------------------------------------------------------------- + * objects to layout + *------------------------------------------------------------------------- + */ + if (options->verbose && have_request(options) /* only print if requested */) { + printf("Objects to modify layout are...\n"); + if (options->all_layout == 1) { + switch (options->layout_g) { + case H5D_COMPACT: + strcpy(slayout, "compact"); + break; + case H5D_CONTIGUOUS: + strcpy(slayout, "contiguous"); + break; + case H5D_CHUNKED: + strcpy(slayout, "chunked"); + break; + case H5D_VIRTUAL: + strcpy(slayout, "virtual"); + break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: + error_msg("invalid layout\n"); + return -1; + default: + strcpy(slayout, "invalid layout\n"); + return -1; + } + printf(" Apply %s layout to all\n", slayout); + if (H5D_CHUNKED == options->layout_g) { + printf("with dimension ["); + for (j = 0; j < options->chunk_g.rank; j++) + printf("%d ", (int) options->chunk_g.chunk_lengths[j]); + printf("]\n"); + } + } + }/* verbose */ + + for (i = 0; i < options->op_tbl->nelems; i++) { + char* name = options->op_tbl->objs[i].path; + + if (options->op_tbl->objs[i].chunk.rank > 0) { + if (options->verbose) { + printf(" <%s> with chunk size ", name); + for (k = 0; k < options->op_tbl->objs[i].chunk.rank; k++) + printf("%d ", + (int) options->op_tbl->objs[i].chunk.chunk_lengths[k]); + printf("\n"); + } + has_ck = 1; + } + else if (options->op_tbl->objs[i].chunk.rank == -2) { + if (options->verbose) + printf(" <%s> %s\n", name, "NONE (contigous)"); + has_ck = 1; + } + } + + if (options->all_layout == 1 && has_ck) { + error_msg( + "invalid chunking input: 'all' option\ is present with other objects\n"); - return -1; - } - - /*------------------------------------------------------------------------- - * objects to filter - *------------------------------------------------------------------------- - */ - - if (options->verbose && have_request(options) /* only print if requested */) { - printf("Objects to apply filter are...\n"); - if (options->all_filter == 1) { - for (k = 0; k < options->n_filter_g; k++) { - H5Z_filter_t filtn = options->filter_g[k].filtn; - switch (filtn) { - case H5Z_FILTER_NONE: - printf(" Uncompress all\n"); - break; - case H5Z_FILTER_SHUFFLE: - case H5Z_FILTER_FLETCHER32: - printf(" All with %s\n", get_sfilter(filtn)); - break; - case H5Z_FILTER_SZIP: - case H5Z_FILTER_DEFLATE: - printf(" All with %s, parameter %d\n", get_sfilter(filtn), - options->filter_g[k].cd_values[0]); - break; - default: - printf(" User Defined %d\n", filtn); - break; - } /* k */ - }; - } - } /* verbose */ - - for (i = 0; i < options->op_tbl->nelems; i++) { - pack_info_t pack = options->op_tbl->objs[i]; - char* name = pack.path; - - for (j = 0; j < pack.nfilters; j++) { - if (options->verbose) { - printf(" <%s> with %s filter\n", name, - get_sfilter(pack.filter[j].filtn)); - } - - has_cp = 1; - - } /* j */ - } /* i */ - - if (options->all_filter == 1 && has_cp) { - error_msg( - "invalid compression input: 'all' option\ + return -1; + } + + /*------------------------------------------------------------------------- + * objects to filter + *------------------------------------------------------------------------- + */ + + if (options->verbose && have_request(options) /* only print if requested */) { + printf("Objects to apply filter are...\n"); + if (options->all_filter == 1) { + for (k = 0; k < options->n_filter_g; k++) { + H5Z_filter_t filtn = options->filter_g[k].filtn; + switch (filtn) { + case H5Z_FILTER_NONE: + printf(" Uncompress all\n"); + break; + case H5Z_FILTER_SHUFFLE: + case H5Z_FILTER_FLETCHER32: + printf(" All with %s\n", get_sfilter(filtn)); + break; + case H5Z_FILTER_SZIP: + case H5Z_FILTER_DEFLATE: + printf(" All with %s, parameter %d\n", get_sfilter(filtn), + options->filter_g[k].cd_values[0]); + break; + default: + printf(" User Defined %d\n", filtn); + break; + } /* k */ + }; + } + } /* verbose */ + + for (i = 0; i < options->op_tbl->nelems; i++) { + pack_info_t pack = options->op_tbl->objs[i]; + char* name = pack.path; + + for (j = 0; j < pack.nfilters; j++) { + if (options->verbose) { + printf(" <%s> with %s filter\n", name, + get_sfilter(pack.filter[j].filtn)); + } + + has_cp = 1; + + } /* j */ + } /* i */ + + if (options->all_filter == 1 && has_cp) { + error_msg( + "invalid compression input: 'all' option\ is present with other objects\n"); - return -1; - } - - /*------------------------------------------------------------------------- - * check options for the latest format - *------------------------------------------------------------------------- - */ - - if (options->grp_compact < 0) { - error_msg( - "invalid maximum number of links to store as header messages\n"); - return -1; - } - if (options->grp_indexed < 0) { - error_msg( - "invalid minimum number of links to store in the indexed format\n"); - return -1; - } - if (options->grp_indexed > options->grp_compact) { - error_msg( - "minimum indexed size is greater than the maximum compact size\n"); - return -1; - } - for (i = 0; i < 8; i++) { - if (options->msg_size[i] < 0) { - error_msg("invalid shared message size\n"); - return -1; - } - } - - /*-------------------------------------------------------------------------------- - * verify new user userblock options; file name must be present - *--------------------------------------------------------------------------------- - */ - if (options->ublock_filename != NULL && options->ublock_size == 0) { - if (options->verbose) { - printf( - "Warning: user block size missing for file %s. Assigning a default size of 1024...\n", - options->ublock_filename); - options->ublock_size = 1024; - } - } - - if (options->ublock_filename == NULL && options->ublock_size != 0) { - error_msg("file name missing for user block\n", - options->ublock_filename); - return -1; - } - - /*-------------------------------------------------------------------------------- - * verify alignment options; threshold is zero default but alignment not - *--------------------------------------------------------------------------------- - */ - - if (options->alignment == 0 && options->threshold != 0) { - error_msg("alignment for H5Pset_alignment missing\n"); - return -1; - } - - return 0; + return -1; + } + + /*------------------------------------------------------------------------- + * check options for the latest format + *------------------------------------------------------------------------- + */ + + if (options->grp_compact < 0) { + error_msg( + "invalid maximum number of links to store as header messages\n"); + return -1; + } + if (options->grp_indexed < 0) { + error_msg( + "invalid minimum number of links to store in the indexed format\n"); + return -1; + } + if (options->grp_indexed > options->grp_compact) { + error_msg( + "minimum indexed size is greater than the maximum compact size\n"); + return -1; + } + for (i = 0; i < 8; i++) { + if (options->msg_size[i] < 0) { + error_msg("invalid shared message size\n"); + return -1; + } + } + + /*-------------------------------------------------------------------------------- + * verify new user userblock options; file name must be present + *--------------------------------------------------------------------------------- + */ + if (options->ublock_filename != NULL && options->ublock_size == 0) { + if (options->verbose) { + printf( + "Warning: user block size missing for file %s. Assigning a default size of 1024...\n", + options->ublock_filename); + options->ublock_size = 1024; + } + } + + if (options->ublock_filename == NULL && options->ublock_size != 0) { + error_msg("file name missing for user block\n", + options->ublock_filename); + return -1; + } + + /*-------------------------------------------------------------------------------- + * verify alignment options; threshold is zero default but alignment not + *--------------------------------------------------------------------------------- + */ + + if (options->alignment == 0 && options->threshold != 0) { + error_msg("alignment for H5Pset_alignment missing\n"); + return -1; + } + + return 0; } /*------------------------------------------------------------------------- @@ -772,119 +767,119 @@ static int check_options(pack_opt_t *options) { *------------------------------------------------------------------------- */ static int check_objects(const char* fname, pack_opt_t *options) { - hid_t fid; - unsigned int i; - trav_table_t *travt = NULL; - - /* nothing to do */ - if (options->op_tbl->nelems == 0) - return 0; - - /*------------------------------------------------------------------------- - * open the file - *------------------------------------------------------------------------- - */ - if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) - < 0) { - printf("<%s>: %s\n", fname, H5FOPENERROR); - return -1; - } - - /*------------------------------------------------------------------------- - * get the list of objects in the file - *------------------------------------------------------------------------- - */ - - /* init table */ - trav_table_init(&travt); - - /* get the list of objects in the file */ - if (h5trav_gettable(fid, travt) < 0) - goto out; - - /*------------------------------------------------------------------------- - * compare with user supplied list - *------------------------------------------------------------------------- - */ - - if (options->verbose) - printf("Opening file <%s>. Searching for objects to modify...\n", - fname); - - for (i = 0; i < options->op_tbl->nelems; i++) { - char* name = options->op_tbl->objs[i].path; - if (options->verbose) - printf(" <%s>", name); - - /* the input object names are present in the file and are valid */ - if (h5trav_getindext(name, travt) < 0) { - error_msg("%s Could not find <%s> in file <%s>. Exiting...\n", - (options->verbose ? "\n" : ""), name, fname); - goto out; - } - if (options->verbose) - printf("...Found\n"); - - /* check for extra filter conditions */ - switch (options->op_tbl->objs[i].filter->filtn) { - /* chunk size must be smaller than pixels per block */ - case H5Z_FILTER_SZIP: - { - int j; - hsize_t csize = 1; - unsigned ppb = options->op_tbl->objs[i].filter->cd_values[0]; - hsize_t dims[H5S_MAX_RANK]; - int rank; - hid_t did; - hid_t sid; - - if (options->op_tbl->objs[i].chunk.rank > 0) { - rank = options->op_tbl->objs[i].chunk.rank; - for (j = 0; j < rank; j++) - csize *= options->op_tbl->objs[i].chunk.chunk_lengths[j]; - } - else { - if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) - goto out; - if ((sid = H5Dget_space(did)) < 0) - goto out; - if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) - goto out; - HDmemset(dims, 0, sizeof dims); - if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) - goto out; - for (j = 0; j < rank; j++) - csize *= dims[j]; - if (H5Sclose(sid) < 0) - goto out; - if (H5Dclose(did) < 0) - goto out; - } - - if (csize < ppb) { - printf( - " \n"); - goto out; - } - } - break; - default: - break; - } - } /* i */ - - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - H5Fclose(fid); - trav_table_free(travt); - return 0; + hid_t fid; + unsigned int i; + trav_table_t *travt = NULL; + + /* nothing to do */ + if (options->op_tbl->nelems == 0) + return 0; + + /*------------------------------------------------------------------------- + * open the file + *------------------------------------------------------------------------- + */ + if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) + < 0) { + printf("<%s>: %s\n", fname, H5FOPENERROR); + return -1; + } + + /*------------------------------------------------------------------------- + * get the list of objects in the file + *------------------------------------------------------------------------- + */ + + /* init table */ + trav_table_init(&travt); + + /* get the list of objects in the file */ + if (h5trav_gettable(fid, travt) < 0) + goto out; + + /*------------------------------------------------------------------------- + * compare with user supplied list + *------------------------------------------------------------------------- + */ + + if (options->verbose) + printf("Opening file <%s>. Searching for objects to modify...\n", + fname); + + for (i = 0; i < options->op_tbl->nelems; i++) { + char* name = options->op_tbl->objs[i].path; + if (options->verbose) + printf(" <%s>", name); + + /* the input object names are present in the file and are valid */ + if (h5trav_getindext(name, travt) < 0) { + error_msg("%s Could not find <%s> in file <%s>. Exiting...\n", + (options->verbose ? "\n" : ""), name, fname); + goto out; + } + if (options->verbose) + printf("...Found\n"); + + /* check for extra filter conditions */ + switch (options->op_tbl->objs[i].filter->filtn) { + /* chunk size must be smaller than pixels per block */ + case H5Z_FILTER_SZIP: + { + int j; + hsize_t csize = 1; + unsigned ppb = options->op_tbl->objs[i].filter->cd_values[0]; + hsize_t dims[H5S_MAX_RANK]; + int rank; + hid_t did; + hid_t sid; + + if (options->op_tbl->objs[i].chunk.rank > 0) { + rank = options->op_tbl->objs[i].chunk.rank; + for (j = 0; j < rank; j++) + csize *= options->op_tbl->objs[i].chunk.chunk_lengths[j]; + } + else { + if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) + goto out; + if ((sid = H5Dget_space(did)) < 0) + goto out; + if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) + goto out; + HDmemset(dims, 0, sizeof dims); + if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) + goto out; + for (j = 0; j < rank; j++) + csize *= dims[j]; + if (H5Sclose(sid) < 0) + goto out; + if (H5Dclose(did) < 0) + goto out; + } + + if (csize < ppb) { + printf( + " \n"); + goto out; + } + } + break; + default: + break; + } + } /* i */ + + /*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + H5Fclose(fid); + trav_table_free(travt); + return 0; out: - H5Fclose(fid); - trav_table_free(travt); - return -1; + H5Fclose(fid); + trav_table_free(travt); + return -1; } /*------------------------------------------------------------------------- @@ -900,10 +895,10 @@ out: */ static int have_request(pack_opt_t *options) { - if (options->all_filter || options->all_layout || options->op_tbl->nelems) - return 1; + if (options->all_filter || options->all_layout || options->op_tbl->nelems) + return 1; - return 0; + return 0; } @@ -918,21 +913,21 @@ static int have_request(pack_opt_t *options) { */ static const char* get_sfilter(H5Z_filter_t filtn) { - if (filtn == H5Z_FILTER_NONE) - return "NONE"; - else if (filtn == H5Z_FILTER_DEFLATE) - return "GZIP"; - else if (filtn == H5Z_FILTER_SZIP) - return "SZIP"; - else if (filtn == H5Z_FILTER_SHUFFLE) - return "SHUFFLE"; - else if (filtn == H5Z_FILTER_FLETCHER32) - return "FLETCHER32"; - else if (filtn == H5Z_FILTER_NBIT) - return "NBIT"; - else if (filtn == H5Z_FILTER_SCALEOFFSET) - return "SOFF"; - else - return "UD"; + if (filtn == H5Z_FILTER_NONE) + return "NONE"; + else if (filtn == H5Z_FILTER_DEFLATE) + return "GZIP"; + else if (filtn == H5Z_FILTER_SZIP) + return "SZIP"; + else if (filtn == H5Z_FILTER_SHUFFLE) + return "SHUFFLE"; + else if (filtn == H5Z_FILTER_FLETCHER32) + return "FLETCHER32"; + else if (filtn == H5Z_FILTER_NBIT) + return "NBIT"; + else if (filtn == H5Z_FILTER_SCALEOFFSET) + return "SOFF"; + else + return "UD"; } diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 604e85f..5ec77a7 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -31,7 +31,7 @@ */ /* size of buffer/# of bytes to xfer at a time when copying userblock */ -#define USERBLOCK_XFER_SIZE 512 +#define USERBLOCK_XFER_SIZE 512 /* check H5Dread()/H5Dwrite() error, e.g. memory allocation error inside the library. */ #define CHECK_H5DRW_ERROR(_fun, _fail, _did, _mtid, _msid, _fsid, _pid, _buf) { \ @@ -52,12 +52,12 @@ *------------------------------------------------------------------------- */ static int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], - size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p); + size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p); static void print_dataset_info(hid_t dcpl_id, char *objname, double per, int pr); static int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, - pack_opt_t *options); + pack_opt_t *options); static int copy_user_block(const char *infile, const char *outfile, - hsize_t size); + hsize_t size); #if defined (H5REPACK_DEBUG_USER_BLOCK) static void print_user_block(const char *filename, hid_t fid); #endif @@ -65,18 +65,19 @@ static herr_t walk_error_callback(unsigned n, const H5E_error2_t *err_desc, void /* get the major number from the error stack. */ static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t *err_desc, void *udata) { - if (err_desc) - *((hid_t *) udata) = err_desc->maj_num; + if (err_desc) + *((hid_t *) udata) = err_desc->maj_num; - return 0; + return 0; } /*------------------------------------------------------------------------- * Function: copy_objects * - * Purpose: duplicate all HDF5 objects in the file + * Purpose: duplicate all HDF5 objects in the file * - * Return: 0, ok, -1 no + * Return: 0, ok, + * -1 no * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -87,21 +88,21 @@ static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; /* no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hid_t fidin; hid_t fidout = -1; trav_table_t *travt = NULL; - hsize_t ub_size = 0; /* size of user block */ - hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */ - hid_t fapl = H5P_DEFAULT; /* file access property list ID */ - H5F_fspace_strategy_t set_strategy; /* Strategy to be set in outupt file */ - hbool_t set_persist; /* Persist free-space status to be set in output file */ - hsize_t set_threshold; /* Free-space section threshold to be set in output file */ - hsize_t set_pagesize; /* File space page size to be set in output file */ - H5F_fspace_strategy_t in_strategy; /* Strategy from input file */ - hbool_t in_persist; /* Persist free-space status from input file */ - hsize_t in_threshold; /* Free-space section threshold from input file */ - hsize_t in_pagesize; /* File space page size from input file */ + hsize_t ub_size = 0; /* size of user block */ + hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */ + hid_t fapl = H5P_DEFAULT; /* file access property list ID */ + H5F_fspace_strategy_t set_strategy; /* Strategy to be set in outupt file */ + hbool_t set_persist; /* Persist free-space status to be set in output file */ + hsize_t set_threshold; /* Free-space section threshold to be set in output file */ + hsize_t set_pagesize; /* File space page size to be set in output file */ + H5F_fspace_strategy_t in_strategy; /* Strategy from input file */ + hbool_t in_persist; /* Persist free-space status from input file */ + hsize_t in_threshold; /* Free-space section threshold from input file */ + hsize_t in_pagesize; /* File space page size from input file */ /*------------------------------------------------------------------------- * open input file @@ -126,17 +127,17 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); } - /* If the -S option is not set, get "strategy" from the input file */ - if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) { - error_msg("failed to retrieve file space strategy\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + /* If the -S option is not set, get "strategy" from the input file */ + if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) { + error_msg("failed to retrieve file space strategy\n"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + } - /* If the -G option is not set, get "pagesize" from the input file */ - if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) { - error_msg("failed to retrieve file space threshold\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + /* If the -G option is not set, get "pagesize" from the input file */ + if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) { + error_msg("failed to retrieve file space threshold\n"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + } if (H5Pclose(fcpl_in) < 0) { error_msg("failed to close property list\n"); @@ -295,9 +296,9 @@ print_user_block(fnamein, fidin); } /*------------------------------------------------------------------------- - * Set file space information - *------------------------------------------------------------------------- - */ + * Set file space information + *------------------------------------------------------------------------- + */ /* either use the FCPL already created or create a new one */ if (fcpl == H5P_DEFAULT) { @@ -323,7 +324,7 @@ print_user_block(fnamein, fidin); set_persist = FS_PERSIST_DEF; else if(options->fs_persist != 0) /* Set "persist" as specified by user */ set_persist = (hbool_t)options->fs_persist; - + if(options->fs_threshold == -1) /* A "0" threshold is specified by user */ set_threshold = (hsize_t)0; else if(options->fs_threshold != 0) /* Set threshold as specified by user */ @@ -331,7 +332,7 @@ print_user_block(fnamein, fidin); /* Set file space information as specified */ if(H5Pset_file_space_strategy(fcpl, set_strategy, set_persist, set_threshold) < 0) { - error_msg("failed to set file space strategy\n"); + error_msg("failed to set file space strategy\n"); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); } @@ -343,7 +344,7 @@ print_user_block(fnamein, fidin); if(set_pagesize != FS_PAGESIZE_DEF) /* Set non-default file space page size as specified */ if(H5Pset_file_space_page_size(fcpl, set_pagesize) < 0) { error_msg("failed to set file space page size\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); } /*------------------------------------------------------------------------- @@ -490,10 +491,10 @@ done: int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - int k; + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int k; H5D_layout_t dset_layout; - int rank_chunk; + int rank_chunk; hsize_t dims_chunk[H5S_MAX_RANK]; hsize_t size_chunk = 1; hsize_t nchunk_fit; /* number of chunks that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ @@ -705,36 +706,36 @@ done: */ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, - pack_opt_t *options) /* repack options */ + pack_opt_t *options) /* repack options */ { int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t grp_in = -1; /* group ID */ - hid_t grp_out = -1; /* group ID */ - hid_t dset_in = -1; /* read dataset ID */ + hid_t grp_in = -1; /* group ID */ + hid_t grp_out = -1; /* group ID */ + hid_t dset_in = -1; /* read dataset ID */ hid_t dset_out = -1; /* write dataset ID */ - hid_t gcpl_in = -1; /* group creation property list */ + hid_t gcpl_in = -1; /* group creation property list */ hid_t gcpl_out = -1; /* group creation property list */ - hid_t type_in = -1; /* named type ID */ + hid_t type_in = -1; /* named type ID */ hid_t type_out = -1; /* named type ID */ - hid_t dcpl_in = -1; /* dataset creation property list ID */ + hid_t dcpl_in = -1; /* dataset creation property list ID */ hid_t dcpl_out = -1; /* dataset creation property list ID */ hid_t f_space_id = -1; /* file space ID */ hid_t ftype_id = -1; /* file type ID */ hid_t wtype_id = -1; /* read/write type ID */ named_dt_t *named_dt_head = NULL; /* Pointer to the stack of named datatypes copied */ - size_t msize; /* size of type */ - hsize_t nelmts; /* number of elements in dataset */ + size_t msize; /* size of type */ + hsize_t nelmts; /* number of elements in dataset */ H5D_space_status_t space_status; /* determines whether space has been allocated for the dataset */ - int rank; /* rank of dataset */ + int rank; /* rank of dataset */ hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ - hsize_t dsize_in; /* input dataset size before filter */ - hsize_t dsize_out; /* output dataset size after filter */ - int apply_s; /* flag for apply filter to small dataset sizes */ - int apply_f; /* flag for apply filter to return error on H5Dcreate */ - void *buf = NULL; /* buffer for raw data */ + hsize_t dsize_in; /* input dataset size before filter */ + hsize_t dsize_out; /* output dataset size after filter */ + int apply_s; /* flag for apply filter to small dataset sizes */ + int apply_f; /* flag for apply filter to return error on H5Dcreate */ + void *buf = NULL; /* buffer for raw data */ void *hslab_buf = NULL; /* hyperslab buffer for raw data */ - int has_filter; /* current object has a filter */ - int req_filter; /* there was a request for a filter */ + int has_filter; /* current object has a filter */ + int req_filter; /* there was a request for a filter */ int req_obj_layout = 0; /* request layout to current object */ unsigned crt_order_flags; /* group creation order flag */ unsigned i; @@ -1349,20 +1350,19 @@ done: * *------------------------------------------------------------------------- */ -static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, - int pr) +static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr) { - char strfilter[255]; + char strfilter[255]; #if defined (PRINT_DEBUG ) - char temp[255]; + char temp[255]; #endif - int nfilters; /* number of filters */ - unsigned filt_flags; /* filter flags */ - H5Z_filter_t filtn; /* filter identification number */ - unsigned cd_values[20]; /* filter client data values */ - size_t cd_nelmts; /* filter client number of values */ - char f_objname[256]; /* filter objname */ - int i; + int nfilters; /* number of filters */ + unsigned filt_flags; /* filter flags */ + H5Z_filter_t filtn; /* filter identification number */ + unsigned cd_values[20]; /* filter client data values */ + size_t cd_nelmts; /* filter client number of values */ + char f_objname[256]; /* filter objname */ + int i; HDstrcpy(strfilter, "\0"); @@ -1461,10 +1461,9 @@ static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, * *------------------------------------------------------------------------- */ -static int copy_user_block(const char *infile, const char *outfile, - hsize_t size) +static int copy_user_block(const char *infile, const char *outfile, hsize_t size) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ int infid = -1, outfid = -1; /* File descriptors */ /* User block must be any power of 2 equal to 512 or greater (512, 1024, 2048, etc.) */ @@ -1541,67 +1540,67 @@ done: static void print_user_block(const char *filename, hid_t fid) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - int fh; /* file handle */ - hsize_t ub_size; /* user block size */ - hsize_t size; /* size read */ - hid_t fcpl; /* file creation property list ID for HDF5 file */ - int i; - - /* get user block size */ - if(( fcpl = H5Fget_create_plist(fid)) < 0) { - error_msg("failed to retrieve file creation property list\n"); + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int fh; /* file handle */ + hsize_t ub_size; /* user block size */ + hsize_t size; /* size read */ + hid_t fcpl; /* file creation property list ID for HDF5 file */ + int i; + + /* get user block size */ + if(( fcpl = H5Fget_create_plist(fid)) < 0) { + error_msg("failed to retrieve file creation property list\n"); HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Fget_create_plist failed"); } - if(H5Pget_userblock(fcpl, &ub_size) < 0) { - error_msg("failed to retrieve userblock size\n"); + if(H5Pget_userblock(fcpl, &ub_size) < 0) { + error_msg("failed to retrieve userblock size\n"); HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pget_userblock failed"); } - if(H5Pclose(fcpl) < 0) { - error_msg("failed to close property list\n"); + if(H5Pclose(fcpl) < 0) { + error_msg("failed to close property list\n"); HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pclose failed"); } - /* open file */ - if((fh = HDopen(filename, O_RDONLY, 0)) < 0) { + /* open file */ + if((fh = HDopen(filename, O_RDONLY, 0)) < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed"); } - size = ub_size; + size = ub_size; - /* read file */ - while(size > 0) { - ssize_t nread; /* # of bytes read */ - char rbuf[USERBLOCK_XFER_SIZE]; /* buffer for reading */ + /* read file */ + while(size > 0) { + ssize_t nread; /* # of bytes read */ + char rbuf[USERBLOCK_XFER_SIZE]; /* buffer for reading */ - /* read buffer */ - if(size > USERBLOCK_XFER_SIZE) - nread = HDread(fh, rbuf, (size_t)USERBLOCK_XFER_SIZE); - else - nread = HDread(fh, rbuf, (size_t)size); + /* read buffer */ + if(size > USERBLOCK_XFER_SIZE) + nread = HDread(fh, rbuf, (size_t)USERBLOCK_XFER_SIZE); + else + nread = HDread(fh, rbuf, (size_t)size); - for(i = 0; i < nread; i++) { + for(i = 0; i < nread; i++) { - printf("%c ", rbuf[i]); + printf("%c ", rbuf[i]); - } - printf("\n"); + } + printf("\n"); - if(nread < 0) { + if(nread < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "nread < 0"); } - /* update size of userblock left to transfer */ - size -= nread; - } + /* update size of userblock left to transfer */ + size -= nread; + } done: - if(fh > 0) - HDclose(fh); + if(fh > 0) + HDclose(fh); - return; + return; } #endif diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index 2c38d94..3245af0 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -25,7 +25,7 @@ static const char* MapIdToName(hid_t refobj_id,trav_table_t *travt); static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options, trav_table_t *travt, hid_t fidout); static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, - hid_t fid_out, void *ref_out, trav_table_t *travt); + hid_t fid_out, void *ref_out, trav_table_t *travt); /*------------------------------------------------------------------------- * Function: do_copy_refobjs @@ -425,13 +425,13 @@ done: * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Modifier: xcao@hdfgroup.org, 9/12/2011 - * Update values of references(object and region) for the following types: + * Update values of references(object and region) for the following types: * 1) References, * 2) ARRAY of reference, * 3) VLEN of references. * 4) COMPOUND of references. * This function does not handle references in other complicated structures, - * such as references in nested compound datatypes. + * such as references in nested compound datatypes. * * Date: October, 28, 2003 * @@ -472,7 +472,7 @@ static int copy_refs_attr(hid_t loc_in, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info failed"); for(u = 0; u < (unsigned)oinfo.num_attrs; u++) { - is_ref = is_ref_vlen = is_ref_array = is_ref_comp = 0; + is_ref = is_ref_vlen = is_ref_array = is_ref_comp = 0; /* open attribute */ if((attr_id = H5Aopen_by_idx(loc_in, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -528,9 +528,9 @@ static int copy_refs_attr(hid_t loc_in, } H5Tclose(mtid); } - - /* if compound don't contain reference type member, free the above - * mallocs. Otherwise there can be memory leaks by the 'continue' + + /* if compound don't contain reference type member, free the above + * mallocs. Otherwise there can be memory leaks by the 'continue' * statement below. */ if (!ref_comp_field_n) { if (ref_comp_index) { @@ -539,7 +539,7 @@ static int copy_refs_attr(hid_t loc_in, } if (ref_comp_size) { - HDfree(ref_comp_size); + HDfree(ref_comp_size); ref_comp_size = NULL; } } @@ -588,7 +588,7 @@ static int copy_refs_attr(hid_t loc_in, array_rank = (unsigned)H5Tget_array_ndims(mtype_id); H5Tget_array_dims2(mtype_id, array_dims); for(j = 0; j #include -/*#include *//* Required for unlink() */ +/*#include *//* Required for unlink() */ #include "hdf5.h" #include "H5private.h" @@ -106,7 +106,7 @@ int main(void) H5Tclose(array_dt); plist = H5Pcreate(H5P_DATASET_XFER); - if((error = H5Pset_preserve(plist, 1)) < 0) + if((error = H5Pset_preserve(plist, 1)) < 0) goto out; /* -- cgit v0.12 From 8482314d7db83c47947af8ca50457cdb1ddae366 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 9 May 2017 17:30:20 -0500 Subject: Fix for HDFFV-10051 Fix missing declaration for H5D__layout_compact_dirty_test(). Tested on mayll and osx1010test. --- src/H5Dpkg.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index b123b81..a6857b9 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -777,6 +777,7 @@ H5_DLL htri_t H5D__mpio_opt_possible(const H5D_io_info_t *io_info, #ifdef H5D_TESTING H5_DLL herr_t H5D__layout_version_test(hid_t did, unsigned *version); H5_DLL herr_t H5D__layout_contig_size_test(hid_t did, hsize_t *size); +H5_DLL herr_t H5D__layout_compact_dirty_test(hid_t did, hbool_t *dirty); H5_DLL herr_t H5D__layout_idx_type_test(hid_t did, H5D_chunk_index_t *idx_type); H5_DLL herr_t H5D__layout_type_test(hid_t did, H5D_layout_t *layout_type); H5_DLL herr_t H5D__current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused); -- cgit v0.12 From e4e261173f85de6f83651abd6950793d7b930a20 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 May 2017 10:12:19 -0500 Subject: HDFFV-10186 more whitespace formatting --- hl/tools/gif2h5/gif2mem.c | 6 +- tools/lib/h5tools_str.c | 454 +++++++++++++++++++----------------------- tools/src/h5dump/h5dump_xml.c | 6 +- tools/src/h5repack/h5repack.c | 44 ++-- 4 files changed, 229 insertions(+), 281 deletions(-) diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 55aae86..0308783 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -218,7 +218,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) PlainTextCount++; if (PlainTextCount > PlainTextArray) - PlainTextArray = (BYTE)((PlainTextArray << 1) + 1); + PlainTextArray = (BYTE)((PlainTextArray << 1) + 1); if (!(gifPlainText = (GIFPLAINTEXT **)realloc(gifPlainText , sizeof(GIFPLAINTEXT *) * PlainTextArray))) { printf("Out of memory!"); @@ -240,7 +240,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) CommentCount++; if (CommentCount > CommentArray) - CommentArray = (BYTE)((CommentArray << 1) + 1); + CommentArray = (BYTE)((CommentArray << 1) + 1); if (!(gifComment = (GIFCOMMENT **)realloc(gifComment , sizeof(GIFCOMMENT *) * CommentArray))) { printf("Out of memory!"); @@ -305,7 +305,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) ApplicationCount++; if (ApplicationCount > ApplicationArray) - ApplicationArray = (BYTE)((ApplicationArray << 1) + 1); + ApplicationArray = (BYTE)((ApplicationArray << 1) + 1); if (!(gifApplication = (GIFAPPLICATION **)realloc(gifApplication , sizeof(GIFAPPLICATION *) * ApplicationArray))) { printf("Out of memory!"); diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 88f6cc5..b7a2c1e 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -23,24 +23,24 @@ #include #include "H5private.h" -#include "h5tools.h" /*for h5tool_format_t structure */ +#include "h5tools.h" /* for h5tool_format_t structure */ #include "h5tools_ref.h" -#include "h5tools_str.h" /*function prototypes */ +#include "h5tools_str.h" /* function prototypes */ /* Copied from hl/src/H5LDprivate.h */ /* Info about the list of comma-separated compound fields */ typedef struct H5LD_memb_t { - size_t tot_offset; - size_t last_tsize; - hid_t last_tid; - char **names; + size_t tot_offset; + size_t last_tsize; + hid_t last_tid; + char **names; } H5LD_memb_t; /* * If REPEAT_VERBOSE is defined then character strings will be printed so * that repeated character sequences like "AAAAAAAAAA" are displayed as * - * 'A' repeates 9 times + * 'A' repeats 9 times * * Otherwise the format is more Perl-like * @@ -61,15 +61,12 @@ void h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *in * Function: h5tools_str_close * * Purpose: Closes a string by releasing it's memory and setting the size - * information to zero. + * information to zero. * * Return: void * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -85,17 +82,14 @@ h5tools_str_close(h5tools_str_t *str) * Function: h5tools_str_len * * Purpose: Returns the length of the string, not counting the null - * terminator. + * terminator. * * Return: Success: Length of string * - * Failure: 0 + * Failure: 0 * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ H5_ATTR_PURE size_t @@ -108,43 +102,34 @@ h5tools_str_len(h5tools_str_t *str) * Function: h5tools_str_append * * Purpose: Formats variable arguments according to printf() format - * string and appends the result to variable length string STR. + * string and appends the result to variable length string STR. * * Return: Success: Pointer to buffer containing result. * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * - * Major change: need to check results of vsnprintf to - * handle errors, empty format, and overflows. - * - * Programmer: REMcG Matzke - * June 16, 2004 - * *------------------------------------------------------------------------- */ char * h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) { - va_list ap; + va_list ap; /* Make sure we have some memory into which to print */ - if (!str->s || str->nalloc <= 0) + if(!str->s || str->nalloc <= 0) h5tools_str_reset(str); - if (HDstrlen(fmt) == 0) + if(HDstrlen(fmt) == 0) /* nothing to print */ return str->s; /* Format the arguments and append to the value already in `str' */ - while (1) { + while(1) { /* How many bytes available for new value, counting the new NUL */ + int nchars = -1; size_t avail = str->nalloc - str->len; - int nchars = -1; HDva_start(ap, fmt); nchars = HDvsnprintf(str->s + str->len, avail, fmt, ap); @@ -161,11 +146,11 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) * to lack of buffer size, so try one more time after realloc more * buffer size before return NULL. */ - if (nchars < 0) + if(nchars < 0) /* failure, such as bad format */ return NULL; - if ((size_t) nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s")))) { + if((size_t) nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s")))) { /* Truncation return value as documented by C99, or zero return value with either of the * following conditions, each of which indicates that the proper C99 return value probably * should have been positive when the format string is @@ -191,24 +176,21 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) * Function: h5tools_str_reset * * Purpose: Reset the string to the empty value. If no memory is - * allocated yet then initialize the h5tools_str_t struct. + * allocated yet then initialize the h5tools_str_t struct. * * Return: Success: Ptr to the buffer which contains a null - * character as the first element. + * character as the first element. * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ char * h5tools_str_reset(h5tools_str_t *str/*in,out*/) { - if (!str->s || str->nalloc <= 0) { + if(!str->s || str->nalloc <= 0) { str->nalloc = STR_INIT_LEN; str->s = (char*)HDmalloc(str->nalloc); HDassert(str->s); @@ -226,19 +208,16 @@ h5tools_str_reset(h5tools_str_t *str/*in,out*/) * * Return: Success: Pointer to the string * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ char * h5tools_str_trunc(h5tools_str_t *str/*in,out*/, size_t size) { - if (size < str->len) { + if(size < str->len) { str->len = size; str->s[size] = '\0'; } @@ -250,41 +229,38 @@ h5tools_str_trunc(h5tools_str_t *str/*in,out*/, size_t size) * Function: h5tools_str_fmt * * Purpose: Reformat a string contents beginning at character START - * according to printf format FMT. FMT should contain no format - * specifiers except possibly the `%s' variety. For example, if - * the input string is `hello' and the format is "<<%s>>" then - * the output value will be "<>". + * according to printf format FMT. FMT should contain no format + * specifiers except possibly the `%s' variety. For example, if + * the input string is `hello' and the format is "<<%s>>" then + * the output value will be "<>". * * Return: Success: A pointer to the resulting string. * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ char * h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) { - char _temp[1024], *temp = _temp; + char _temp[1024], *temp = _temp; HDassert(str); HDassert(fmt); /* If the format string is simply "%s" then don't bother doing anything */ - if (!HDstrcmp(fmt, "%s")) + if(!HDstrcmp(fmt, "%s")) return str->s; /* * Save the input value if there is a `%' anywhere in FMT. Otherwise * don't bother because we don't need a temporary copy. */ - if (HDstrchr(fmt, '%')) { + if(HDstrchr(fmt, '%')) { size_t n = sizeof(_temp); - if (str->len - start + 1 > n) { + if(str->len - start + 1 > n) { n = str->len - start + 1; temp = (char*)HDmalloc(n); HDassert(temp); @@ -298,7 +274,7 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) h5tools_str_append(str, fmt, temp); /* Free the temp buffer if we allocated one */ - if (temp != _temp) + if(temp != _temp) HDfree(temp); return str->s; @@ -311,37 +287,34 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) * * Return: Success: Pointer to the prefix. * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Thursday, July 23, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ char * h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, hsize_t elmtno, unsigned ndims, h5tools_context_t *ctx) { - size_t i = 0; - hsize_t curr_pos = elmtno; + size_t i = 0; + hsize_t curr_pos = elmtno; h5tools_str_reset(str); - if (ndims > 0) { + if(ndims > 0) { /* * Calculate the number of elements represented by a unit change in a * certain index position. */ - for (i = 0; i < (size_t) ndims; i++) { + for(i = 0; i < (size_t) ndims; i++) { ctx->pos[i] = curr_pos / ctx->acc[i]; curr_pos -= ctx->acc[i] * ctx->pos[i]; } HDassert(curr_pos == 0); /* Print the index values */ - for (i = 0; i < (size_t) ndims; i++) { + for(i = 0; i < (size_t) ndims; i++) { if (i) h5tools_str_append(str, "%s", OPT(info->idx_sep, ",")); @@ -350,10 +323,8 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, } } - else { - /* Scalar */ + else /* Scalar */ h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t) 0); - } /* Add prefix and suffix to the index */ return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: ")); @@ -377,21 +348,21 @@ h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, hsize_t elmtno, hsize_t *ptdata, unsigned ndims, hsize_t max_idx[], h5tools_context_t *ctx) { - hsize_t p_prod[H5S_MAX_RANK]; - size_t i = 0; - hsize_t curr_pos = elmtno; + size_t i = 0; + hsize_t curr_pos = elmtno; + hsize_t p_prod[H5S_MAX_RANK]; h5tools_str_reset(str); - if (ndims > 0) { + if(ndims > 0) { /* * Calculate the number of elements represented by a unit change in a * certain index position. */ - for (i = ndims - 1, p_prod[ndims - 1] = 1; i > 0; --i) + for(i = ndims - 1, p_prod[ndims - 1] = 1; i > 0; --i) p_prod[i - 1] = (max_idx[i]) * p_prod[i]; - for (i = 0; i < (size_t) ndims; i++) { + for(i = 0; i < (size_t) ndims; i++) { if(curr_pos > 0) { ctx->pos[i] = curr_pos / p_prod[i]; curr_pos -= p_prod[i] * ctx->pos[i]; @@ -402,18 +373,16 @@ h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, } /* Print the index values */ - for (i = 0; i < (size_t) ndims; i++) { - if (i) + for(i = 0; i < (size_t) ndims; i++) { + if(i) h5tools_str_append(str, "%s", OPT(info->idx_sep, ",")); h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t) ctx->pos[i]); } } /* if (ndims > 0) */ - else { - /* Scalar */ + else /* Scalar */ h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t) 0); - } /* Add prefix and suffix to the index */ return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: ")); @@ -449,7 +418,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, /* Start coordinates */ h5tools_str_append(str, "%s%s ", info->line_indent, START); - for (j = 0; j < ndims; j++) + for(j = 0; j < ndims; j++) h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", start[j]); h5tools_str_append(str, ")"); h5tools_str_append(str, "%s", "\n"); @@ -457,7 +426,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, /* Stride coordinates */ h5tools_str_append(str, "%s ", STRIDE); - for (j = 0; j < ndims; j++) + for(j = 0; j < ndims; j++) h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", stride[j]); h5tools_str_append(str, ")"); h5tools_str_append(str, "%s", "\n"); @@ -465,7 +434,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, /* Count coordinates */ h5tools_str_append(str, "%s ", COUNT); - for (j = 0; j < ndims; j++) { + for(j = 0; j < ndims; j++) { if(count[j] == H5S_UNLIMITED) h5tools_str_append(str, "%s%s", j ? "," : "(","H5S_UNLIMITED"); else @@ -477,7 +446,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, /* Block coordinates */ h5tools_str_append(str, "%s ", BLOCK); - for (j = 0; j < ndims; j++) { + for(j = 0; j < ndims; j++) { if(block[j] == H5S_UNLIMITED) h5tools_str_append(str, "%s%s", j ? "," : "(","H5S_UNLIMITED"); else @@ -494,8 +463,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, * * Return: none * - * In/Out: - * h5tools_str_t *str + * In/Out: h5tools_str_t *str *------------------------------------------------------------------------- */ void @@ -512,12 +480,12 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, } H5E_END_TRY; /* Print block information */ - if (snblocks > 0) { + if(snblocks > 0) { + hsize_t alloc_size; hsize_t nblocks; hsize_t *ptdata; - hsize_t alloc_size; + hsize_t u; unsigned ndims = (unsigned)H5Sget_simple_extent_ndims(rspace); - hsize_t u; nblocks = (hsize_t)snblocks; alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); @@ -525,17 +493,17 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, ptdata = (hsize_t *)HDmalloc((size_t) alloc_size); H5Sget_select_hyper_blocklist(rspace, (hsize_t)0, nblocks, ptdata); - for (u = 0; u < nblocks; u++) { + for(u = 0; u < nblocks; u++) { unsigned v; h5tools_str_append(str, info->dset_blockformat_pre, u ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long)u); /* Start coordinates and opposite corner */ - for (v = 0; v < ndims; v++) + for(v = 0; v < ndims; v++) h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : "(", ptdata[u * 2 * ndims + v]); - for (v = 0; v < ndims; v++) + for(v = 0; v < ndims; v++) h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : ")-(", ptdata[u * 2 * ndims + v + ndims]); @@ -554,8 +522,7 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, * * Return: none * - * In/Out: - * h5tools_str_t *str + * In/Out: h5tools_str_t *str *------------------------------------------------------------------------- */ void @@ -573,11 +540,11 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, /* Print point information */ if (snpoints > 0) { - hsize_t npoints; hsize_t alloc_size; + hsize_t npoints; hsize_t *ptdata; - unsigned ndims = (unsigned)H5Sget_simple_extent_ndims(rspace); - hsize_t u; + hsize_t u; + unsigned ndims = (unsigned)H5Sget_simple_extent_ndims(rspace); npoints = (hsize_t)snpoints; alloc_size = npoints * ndims * sizeof(ptdata[0]); @@ -585,13 +552,13 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, ptdata = (hsize_t *)HDmalloc((size_t) alloc_size); H5Sget_select_elem_pointlist(rspace, (hsize_t)0, npoints, ptdata); - for (u = 0; u < npoints; u++) { + for(u = 0; u < npoints; u++) { unsigned v; h5tools_str_append(str, info->dset_ptformat_pre, u ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long)u); - for (v = 0; v < ndims; v++) + for(v = 0; v < ndims; v++) h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : "(", (ptdata[u * ndims + v])); @@ -614,16 +581,16 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, static void h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch) { - if (info->str_locale == ESCAPE_HTML) { - if (ch <= ' ' || ch > '~') + if(info->str_locale == ESCAPE_HTML) { + if(ch <= ' ' || ch > '~') h5tools_str_append(str, "%%%02x", ch); else h5tools_str_append(str, "%c", ch); } else { - switch (ch) { + switch(ch) { case '"': - if (!info->do_escape) + if(!info->do_escape) h5tools_str_append(str, "\""); else h5tools_str_append(str, "\\\""); @@ -635,19 +602,19 @@ h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch) h5tools_str_append(str, "\\\\"); break; case '\b': - if (!info->do_escape) + if(!info->do_escape) h5tools_str_append(str, "\b"); else h5tools_str_append(str, "\\b"); break; case '\f': - if (!info->do_escape) + if(!info->do_escape) h5tools_str_append(str, "\f"); else h5tools_str_append(str, "\\f"); break; case '\n': - if (!info->do_escape) { + if(!info->do_escape) { h5tools_str_append(str, "\n"); h5tools_str_append(str, " "); } @@ -655,7 +622,7 @@ h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch) h5tools_str_append(str, "\\n"); break; case '\r': - if (!info->do_escape) { + if(!info->do_escape) { h5tools_str_append(str, "\r"); h5tools_str_append(str, " "); } @@ -663,13 +630,13 @@ h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch) h5tools_str_append(str, "\\r"); break; case '\t': - if (!info->do_escape) + if(!info->do_escape) h5tools_str_append(str, "\t"); else h5tools_str_append(str, "\\t"); break; default: - if (isprint(ch)) + if(isprint(ch)) h5tools_str_append(str, "%c", ch); else h5tools_str_append(str, "\\%03o", ch); @@ -685,7 +652,7 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, unsigned u, indentlevel = 0; /* Write new prefix */ - if (ctx->indent_level > 0) + if(ctx->indent_level > 0) indentlevel = ctx->indent_level; else /* @@ -696,7 +663,7 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, */ indentlevel = ctx->default_indent_level; - for (u = 0; u < indentlevel; u++) + for(u = 0; u < indentlevel; u++) h5tools_str_append(str, "%s", OPT(info->line_indent, "")); } @@ -738,7 +705,7 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, * added H5T_NATIVE_LDOUBLE case * * Vailin Choi; August 2010 - * Modified to handle printing of selected compound fields for h5watch. + * Modified to handle printing of selected compound fields for h5watch. * * Raymond Lu, 2011-09-01 * CLANG compiler complained about the line (about 800): @@ -765,7 +732,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai H5T_class_t type_class; /* Build default formats for long long types */ - if (!fmt_llong[0]) { + if(!fmt_llong[0]) { HDsnprintf(fmt_llong, sizeof(fmt_llong), "%%%sd", H5_PRINTF_LL_WIDTH); HDsnprintf(fmt_ullong, sizeof(fmt_ullong), "%%%su", H5_PRINTF_LL_WIDTH); } @@ -775,33 +742,31 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai nsize = H5Tget_size(type); nsign = H5Tget_sign(type); - if (info->raw) { + if(info->raw) { size_t i; - if (1 == nsize) { + if(1 == nsize) h5tools_str_append(str, OPT(info->fmt_raw, "0x%02x"), ucp_vp[0]); - } - else { - for (i = 0; i < nsize; i++) { - if (i) + else + for(i = 0; i < nsize; i++) { + if(i) h5tools_str_append(str, ":"); h5tools_str_append(str, OPT(info->fmt_raw, "%02x"), ucp_vp[i]); } - } } else { if((type_class = H5Tget_class(type)) < 0) return NULL; switch (type_class) { case H5T_FLOAT: - if (sizeof(float) == nsize) { + if(sizeof(float) == nsize) { /* if (H5Tequal(type, H5T_NATIVE_FLOAT)) */ float tempfloat; HDmemcpy(&tempfloat, vp, sizeof(float)); h5tools_str_append(str, OPT(info->fmt_float, "%g"), (double)tempfloat); } - else if (sizeof(double) == nsize) { + else if(sizeof(double) == nsize) { /* if (H5Tequal(type, H5T_NATIVE_DOUBLE)) */ double tempdouble; @@ -809,7 +774,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_double, "%g"), tempdouble); #if H5_SIZEOF_LONG_DOUBLE !=0 } - else if (sizeof(long double) == nsize) { + else if(sizeof(long double) == nsize) { /* if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) */ long double templdouble; @@ -822,15 +787,15 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai case H5T_STRING: { unsigned int i; - char quote = '\0'; - char *s; + char quote = '\0'; + char *s; quote = '\0'; - if (H5Tis_variable_str(type)) { + if(H5Tis_variable_str(type)) { /* cp_vp is the pointer into the struct where a `char*' is stored. So we have * to dereference the pointer to get the `char*' to pass to HDstrlen(). */ s = *(char**) cp_vp; - if (s != NULL) size = HDstrlen(s); + if(s != NULL) size = HDstrlen(s); } else { s = cp_vp; @@ -839,10 +804,10 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai pad = H5Tget_strpad(type); /* Check for NULL pointer for string */ - if (s == NULL) + if(s == NULL) h5tools_str_append(str, "NULL"); else { - for (i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) { + for(i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) { unsigned j = 1; /* @@ -850,7 +815,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai * threshold is zero then that means it can repeat any number * of times. */ - if (info->str_repeat > 0) while (i + j < size && s[i] == s[i + j]) + if(info->str_repeat > 0) while (i + j < size && s[i] == s[i + j]) j++; /* @@ -859,14 +824,14 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai * the characters, then make sure the character to be repeated is * in it's own quote. */ - if (info->str_repeat > 0 && j > info->str_repeat) { - if (quote) + if(info->str_repeat > 0 && j > info->str_repeat) { + if(quote) h5tools_str_append(str, "%c", quote); quote = '\''; h5tools_str_append(str, "%s%c", i ? " " : "", quote); } - else if (!quote) { + else if(!quote) { quote = '"'; h5tools_str_append(str, "%s%c", i ? " " : "", quote); } @@ -875,7 +840,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_print_char(str, info, s[i]); /* Print the repeat count */ - if (info->str_repeat && j > info->str_repeat) { + if(info->str_repeat && j > info->str_repeat) { #ifdef REPEAT_VERBOSE h5tools_str_append(str, "%c repeats %d times", quote, j - 1); #else @@ -886,10 +851,10 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } } - if (quote) + if(quote) h5tools_str_append(str, "%c", quote); - if (i == 0) + if(i == 0) /*empty string*/ h5tools_str_append(str, "\"\""); } /* end else */ @@ -897,15 +862,15 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai break; case H5T_INTEGER: - if (sizeof(char) == nsize) { - if (info->ascii) + if(sizeof(char) == nsize) { + if(info->ascii) h5tools_print_char(str, info, (char) (*ucp_vp)); else if(H5T_SGN_NONE == nsign) { unsigned char tempuchar; HDmemcpy(&tempuchar, ucp_vp, sizeof(unsigned char)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned char)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(unsigned char)) tempuchar = 0; else tempuchar = (unsigned char)((unsigned long long)(tempuchar >> packed_data_offset) & packed_data_mask); @@ -916,8 +881,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai signed char tempchar; HDmemcpy(&tempchar, cp_vp, sizeof(char)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(char)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(char)) tempchar = 0; else tempchar = (signed char)((unsigned long long)(tempchar >> packed_data_offset) & packed_data_mask); @@ -925,13 +890,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_schar, "%hhd"), tempchar); } } /* end if (sizeof(char) == nsize) */ - else if (sizeof(int) == nsize) { + else if(sizeof(int) == nsize) { if(H5T_SGN_NONE == nsign) { - unsigned int tempuint; + unsigned int tempuint; HDmemcpy(&tempuint, vp, sizeof(unsigned int)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned int)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(unsigned int)) tempuint = 0; else tempuint = (unsigned)((tempuint >> packed_data_offset) & packed_data_mask); @@ -939,11 +904,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_uint, "%u"), tempuint); } else { - int tempint; + int tempint; HDmemcpy(&tempint, vp, sizeof(int)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(int)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(int)) tempint = 0; else tempint = (int)((unsigned long long)(tempint >> packed_data_offset) & packed_data_mask); @@ -951,13 +916,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_int, "%d"), tempint); } } /* end if (sizeof(int) == nsize) */ - else if (sizeof(short) == nsize) { + else if(sizeof(short) == nsize) { if(H5T_SGN_NONE == nsign) { unsigned short tempushort; HDmemcpy(&tempushort, vp, sizeof(unsigned short)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned short)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(unsigned short)) tempushort = 0; else tempushort = (unsigned short)((unsigned long long)(tempushort >> packed_data_offset) & packed_data_mask); @@ -968,8 +933,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai short tempshort; HDmemcpy(&tempshort, vp, sizeof(short)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(short)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(short)) tempshort = 0; else tempshort = (short)((unsigned long long)(tempshort >> packed_data_offset) & packed_data_mask); @@ -977,13 +942,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_short, "%hd"), tempshort); } } /* end if (sizeof(short) == nsize) */ - else if (sizeof(long) == nsize) { + else if(sizeof(long) == nsize) { if(H5T_SGN_NONE == nsign) { - unsigned long tempulong; + unsigned long tempulong; HDmemcpy(&tempulong, vp, sizeof(unsigned long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned long)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(unsigned long)) tempulong = 0; else tempulong = (tempulong >> packed_data_offset) & packed_data_mask; @@ -991,11 +956,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_ulong, "%lu"), tempulong); } else { - long templong; + long templong; HDmemcpy(&templong, vp, sizeof(long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(long)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(long)) templong = 0; else templong = (long)((unsigned long long)(templong >> packed_data_offset) & packed_data_mask); @@ -1004,13 +969,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } } /* end if (sizeof(long) == nsize) */ #if H5_SIZEOF_LONG != H5_SIZEOF_LONG_LONG - else if (sizeof(long long) == nsize) { + else if(sizeof(long long) == nsize) { if(H5T_SGN_NONE == nsign) { unsigned long long tempullong; HDmemcpy(&tempullong, vp, sizeof(unsigned long long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned long long)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(unsigned long long)) tempullong = 0; else tempullong = (tempullong >> packed_data_offset) & packed_data_mask; @@ -1018,11 +983,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_ullong, fmt_ullong), tempullong); } else { - long long templlong; + long long templlong; HDmemcpy(&templlong, vp, sizeof(long long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(long long)) + if(packed_bits_num) { + if(packed_data_offset >= 8 * sizeof(long long)) templlong = 0; else templlong = (templlong >> packed_data_offset) & packed_data_mask; @@ -1035,31 +1000,31 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai case H5T_COMPOUND: if(ctx->cmpd_listv) { /* there is */ - int save_indent_level; /* The indentation level */ - size_t curr_field; /* Current field to display */ - int i = 0, x = 0; /* Local index variable */ - H5LD_memb_t **listv; /* Vector of information for */ + int save_indent_level; /* The indentation level */ + size_t curr_field; /* Current field to display */ + int i = 0, x = 0; /* Local index variable */ + H5LD_memb_t **listv; /* Vector of information for */ - listv = ctx->cmpd_listv; + listv = ctx->cmpd_listv; ctx->cmpd_listv = NULL; h5tools_str_append(str, "%s", OPT(info->cmpd_pre, "{")); - /* + /* * Go through the vector containing info about the comma-separated list of - * compound fields and then members in each field: - * put in "{", "}", ",", member name and value accordingly. + * compound fields and then members in each field: + * put in "{", "}", ",", member name and value accordingly. */ save_indent_level = ctx->indent_level; for(curr_field = 0; listv[curr_field] != NULL; curr_field++) { - if (curr_field) + if(curr_field) h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", "OPTIONAL_LINE_BREAK)); - else + else h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); if(info->arr_linebreak) h5tools_str_indent(str, info, ctx); - + /* Process members of each field */ for(i = 0; listv[curr_field]->names[i] != NULL; i++) { h5tools_str_append(str, OPT(info->cmpd_name, ""), listv[curr_field]->names[i]); @@ -1084,7 +1049,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai ctx->cmpd_listv = info->cmpd_listv; - } else { + } + else { unsigned nmembs; unsigned j; @@ -1093,13 +1059,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai ctx->indent_level++; - for (j = 0; j < nmembs; j++) { - if (j) + for(j = 0; j < nmembs; j++) { + if(j) h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", "OPTIONAL_LINE_BREAK)); else h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); - if (info->arr_linebreak) + if(info->arr_linebreak) h5tools_str_indent(str, info, ctx); /* The name */ @@ -1117,7 +1083,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } ctx->indent_level--; - if (info->arr_linebreak) { + if(info->arr_linebreak) { h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); h5tools_str_indent(str, info, ctx); } @@ -1129,27 +1095,24 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai { char enum_name[1024]; - if (H5Tenum_nameof(type, vp, enum_name, sizeof enum_name) >= 0) { + if(H5Tenum_nameof(type, vp, enum_name, sizeof enum_name) >= 0) h5tools_str_append(str, h5tools_escape(enum_name, sizeof(enum_name))); - } else { size_t i; - if (1 == nsize) { + if(1 == nsize) h5tools_str_append(str, "0x%02x", ucp_vp[0]); - } - else { - for (i = 0; i < nsize; i++) + else + for(i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); - } } } break; case H5T_REFERENCE: - if (h5tools_str_is_zero(vp, nsize)) + if(h5tools_str_is_zero(vp, nsize)) h5tools_str_append(str, "NULL"); else { - if (nsize == H5R_DSET_REG_REF_BUF_SIZE) { + if(nsize == H5R_DSET_REG_REF_BUF_SIZE) { /* if (H5Tequal(type, H5T_STD_REF_DSETREG)) */ h5tools_str_sprint_region(str, info, container, vp); } @@ -1159,14 +1122,14 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai * Object references -- show the type and OID of the referenced * object. */ - H5O_info_t oi; + H5O_info_t oi; const char *path; obj = H5Rdereference2(container, H5P_DEFAULT, H5R_OBJECT, vp); H5Oget_info(obj, &oi); /* Print object type and close object */ - switch (oi.type) { + switch(oi.type) { case H5O_TYPE_GROUP: h5tools_str_append(str, H5_TOOLS_GROUP); break; @@ -1188,14 +1151,14 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai H5Oclose(obj); /* Print OID */ - if (info->obj_hidefileno) + if(info->obj_hidefileno) h5tools_str_append(str, info->obj_format, oi.addr); else h5tools_str_append(str, info->obj_format, oi.fileno, oi.addr); /* Print name */ path = lookup_ref_path(*(haddr_t *) vp); - if (path) { + if(path) { h5tools_str_append(str, " "); h5tools_str_append(str, path); h5tools_str_append(str, " "); @@ -1206,8 +1169,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai case H5T_ARRAY: { - int k, ndims; - hsize_t i, dims[H5S_MAX_RANK], temp_nelmts; + int k, ndims; + hsize_t i, dims[H5S_MAX_RANK], temp_nelmts; static int is_next_arry_elmt = 0; /* Get the array's base datatype for each element */ @@ -1218,7 +1181,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); /* Calculate the number of array elements */ - for (k = 0, nelmts = 1; k < ndims; k++) { + for(k = 0, nelmts = 1; k < ndims; k++) { temp_nelmts = nelmts; temp_nelmts *= dims[k]; HDassert(temp_nelmts == (hsize_t) ((size_t) temp_nelmts)); @@ -1229,18 +1192,18 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai ctx->indent_level++; - for (i = 0; i < nelmts; i++) { - if (i) + for(i = 0; i < nelmts; i++) { + if(i) h5tools_str_append(str, "%s", OPT(info->arr_sep, "," OPTIONAL_LINE_BREAK)); - if (info->arr_linebreak && i && i % dims[ndims - 1] == 0) { + if(info->arr_linebreak && i && i % dims[ndims - 1] == 0) { h5tools_str_append(str, "%s", "\n"); h5tools_str_indent(str, info, ctx); } /* end if */ - else if (i && info->arr_sep) { + else if(i && info->arr_sep) { /* if next element begin, add next line with indent */ - if (is_next_arry_elmt) { + if(is_next_arry_elmt) { is_next_arry_elmt = 0; h5tools_str_append(str, "%s", "\n "); @@ -1281,21 +1244,21 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai /* Get the number of sequence elements */ nelmts = ((hvl_t *) cp_vp)->len; - for (i = 0; i < nelmts; i++) { - if (i) h5tools_str_append(str, "%s", OPT(info->vlen_sep, "," OPTIONAL_LINE_BREAK)); + for(i = 0; i < nelmts; i++) { + if(i) h5tools_str_append(str, "%s", OPT(info->vlen_sep, "," OPTIONAL_LINE_BREAK)); #ifdef LATER /* Need to fix so VL data breaks at correct location on end of line -QAK */ - if (info->arr_linebreak && h5tools_str_len(str)>=info->line_ncols) { + if(info->arr_linebreak && h5tools_str_len(str)>=info->line_ncols) { int x; h5tools_str_append(str, "%s", "\n"); /* need to indent some more here */ - if (ctx->indent_level >= 0) + if(ctx->indent_level >= 0) h5tools_str_append(str, "%s", OPT(info->line_pre, "")); - for (x = 0; x < ctx->indent_level + 1; x++) + for(x = 0; x < ctx->indent_level + 1; x++) h5tools_str_append(str,"%s",OPT(info->line_indent,"")); } /* end if */ #endif /* LATER */ @@ -1319,13 +1282,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai { /* All other types get printed as hexadecimal */ size_t i; - if (1 == nsize) { + if(1 == nsize) h5tools_str_append(str, "0x%02x", ucp_vp[0]); - } - else { - for (i = 0; i < nsize; i++) + else + for(i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); - } } break; @@ -1352,14 +1313,14 @@ void h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, hid_t container, void *vp) { - hid_t obj, region; - char ref_name[1024]; + hid_t obj, region; + char ref_name[1024]; H5S_sel_type region_type; obj = H5Rdereference2(container, H5P_DEFAULT, H5R_DATASET_REGION, vp); - if (obj >= 0) { + if(obj >= 0) { region = H5Rget_region(container, H5R_DATASET_REGION, vp); - if (region >= 0) { + if(region >= 0) { H5Rget_name(obj, H5R_DATASET_REGION, vp, (char*) ref_name, 1024); h5tools_str_append(str, info->dset_format, ref_name); @@ -1381,33 +1342,30 @@ h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, } /*------------------------------------------------------------------------- - * Function: h5tools_escape + * Function: h5tools_escape * - * Purpose: Changes all "funny" characters in S into standard C escape - * sequences. + * Purpose: Changes all "funny" characters in S into standard C escape + * sequences. * - * Return: Success: S + * Return: Success: S * - * Failure: NULL if the buffer would overflow. The + * Failure: NULL if the buffer would overflow. The * buffer has as many left-to-right escapes as * possible before overflow would have happened. * * Programmer: Robb Matzke * Monday, April 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static char * h5tools_escape(char *s/*in,out*/, size_t size) { - register size_t i; - size_t n = HDstrlen(s); + register size_t i; const char *escape; - char octal[8]; + char octal[8]; + size_t n = HDstrlen(s); - for (i = 0; i < n; i++) { + for(i = 0; i < n; i++) { switch (s[i]) { case '\'': escape = "\\\'"; @@ -1443,21 +1401,20 @@ h5tools_escape(char *s/*in,out*/, size_t size) escape = "\\v"; break; default: - if (!isprint(s[i])) { + if(!isprint(s[i])) { HDsnprintf(octal, sizeof(octal), "\\%03o", (unsigned char) s[i]); escape = octal; } - else { + else escape = NULL; - } break; } - if (escape) { + if(escape) { size_t esc_size = HDstrlen(escape); - if (n + esc_size + 1 > size) + if(n + esc_size + 1 > size) /*would overflow*/ return NULL; @@ -1474,15 +1431,12 @@ h5tools_escape(char *s/*in,out*/, size_t size) /*------------------------------------------------------------------------- * Function: h5tools_str_is_zero * - * Purpose: Determines if memory is initialized to all zero bytes. + * Purpose: Determines if memory is initialized to all zero bytes. * - * Return: TRUE if all bytes are zero; FALSE otherwise + * Return: TRUE if all bytes are zero; FALSE otherwise * * Programmer: Robb Matzke * Monday, June 7, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static hbool_t @@ -1490,8 +1444,8 @@ h5tools_str_is_zero(const void *_mem, size_t size) { const unsigned char *mem = (const unsigned char *) _mem; - while (size-- > 0) - if (mem[size]) + while(size-- > 0) + if(mem[size]) return FALSE; return TRUE; @@ -1516,11 +1470,11 @@ h5tools_str_is_zero(const void *_mem, size_t size) char * h5tools_str_replace ( const char *string, const char *substr, const char *replacement ) { - char *tok = NULL; + char *tok = NULL; char *newstr = NULL; - char *head = NULL; - - if(substr == NULL || replacement == NULL) + char *head = NULL; + + if(substr == NULL || replacement == NULL) return HDstrdup(string); newstr = HDstrdup(string); head = newstr; @@ -1531,8 +1485,8 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac newstr = (char *)HDmalloc(HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement) + 1); if(newstr == NULL) { - HDfree(oldstr); - return NULL; + HDfree(oldstr); + return NULL; } HDmemcpy(newstr, oldstr, (size_t)(tok - oldstr)); HDmemcpy(newstr + (tok - oldstr), replacement, HDstrlen(replacement)); diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index f4ec353..c29ea5d 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -136,8 +136,8 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ { hid_t obj; herr_t ret = SUCCEED; - char *obj_path = NULL; /* Full path of object */ - h5tools_str_t buffer; /* string into which to render */ + char *obj_path = NULL; /* Full path of object */ + h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; @@ -1951,7 +1951,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, else { /* all other data */ /* VL data special information */ unsigned int vl_data = 0; /* contains VL datatypes */ - + p_type = h5tools_get_native_type(type); /* Check if we have VL data in the dataset's datatype */ diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 6f50cbc..7c8e055 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -236,7 +236,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t *dt = *named_dt_head_p; /* Stack pointer */ named_dt_t *dt_ret = NULL; /* Datatype to return */ H5O_info_t oinfo; /* Object info of input dtype */ - hid_t ret_value = -1; /* The identifier of the named dtype in the out file */ + hid_t ret_value = -1; /* The identifier of the named dtype in the out file */ if (H5Oget_info(type_in, &oinfo) < 0) goto done; @@ -255,9 +255,8 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, for (i = 0; i < travt->nobjs; i++) { if (travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) { /* Push onto the stack */ - if (NULL == (dt = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) { + if (NULL == (dt = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) goto done; - } dt->next = *named_dt_head_p; *named_dt_head_p = dt; @@ -278,9 +277,8 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, * possible if the datatype was committed anonymously in the input file. */ if (!dt_ret) { /* Push the new datatype onto the stack */ - if (NULL == (dt_ret = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) { + if (NULL == (dt_ret = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) goto done; - } dt_ret->next = *named_dt_head_p; *named_dt_head_p = dt_ret; @@ -289,27 +287,26 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, dt_ret->id_out = -1; } /* end if */ - /* If the requested datatype does not yet exist in the output file, copy it - * anonymously */ - if (dt_ret->id_out < 0) { - if (options->use_native == 1) - dt_ret->id_out = h5tools_get_native_type(type_in); - else - dt_ret->id_out = H5Tcopy(type_in); - if (dt_ret->id_out < 0) - goto done; - if (H5Tcommit_anon(fidout, dt_ret->id_out, H5P_DEFAULT, H5P_DEFAULT) < 0) - goto done; - } /* end if */ + /* If the requested datatype does not yet exist in the output file, copy it + * anonymously */ + if (dt_ret->id_out < 0) { + if (options->use_native == 1) + dt_ret->id_out = h5tools_get_native_type(type_in); + else + dt_ret->id_out = H5Tcopy(type_in); + if (dt_ret->id_out < 0) + goto done; + if (H5Tcommit_anon(fidout, dt_ret->id_out, H5P_DEFAULT, H5P_DEFAULT) < 0) + goto done; + } /* end if */ /* Set return value */ ret_value = dt_ret->id_out; /* Increment the ref count on id_out, because the calling function will try * to close it */ - if(H5Iinc_ref(ret_value) < 0) { + if(H5Iinc_ref(ret_value) < 0) ret_value = -1; - } done: return (ret_value); @@ -466,7 +463,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, int nmembers = H5Tget_nmembers(wtype_id); for (j = 0; j < nmembers; j++) { - hid_t mtid = H5Tget_member_type(wtype_id, (unsigned) j); + hid_t mtid = H5Tget_member_type(wtype_id, (unsigned)j); H5T_class_t mtclass = H5Tget_class(mtid); H5Tclose(mtid); @@ -477,16 +474,13 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, } /* for (j=0; i Date: Wed, 10 May 2017 10:59:13 -0500 Subject: HDFFV-10186 Add endianess to bitfield and fix tests --- .gitattributes | 3 +- MANIFEST | 3 +- hl/tools/gif2h5/gif2mem.c | 4 +- java/src/jni/h5util.c | 32 +++- src/H5T.c | 29 +++- tools/lib/h5diff_attr.c | 4 +- tools/lib/h5diff_dset.c | 4 +- tools/lib/h5diff_util.c | 27 +++- tools/lib/h5tools.c | 2 +- tools/lib/h5tools.h | 1 - tools/lib/h5tools_dump.c | 8 +- tools/lib/h5tools_str.c | 6 +- tools/lib/h5tools_type.c | 24 ++- tools/src/h5dump/h5dump_xml.c | 2 +- tools/src/h5ls/h5ls.c | 2 +- tools/src/h5repack/h5repack.c | 4 +- tools/src/h5repack/h5repack_copy.c | 2 +- tools/src/h5repack/h5repack_refs.c | 8 +- tools/test/h5dump/CMakeTests.cmake | 15 +- tools/test/h5dump/testh5dump.sh.in | 9 +- tools/test/misc/talign.c | 35 +---- tools/testfiles/tbitnopaque.ddl | 293 ------------------------------------- tools/testfiles/tbitnopaque_be.ddl | 293 +++++++++++++++++++++++++++++++++++++ tools/testfiles/tbitnopaque_le.ddl | 293 +++++++++++++++++++++++++++++++++++++ 24 files changed, 727 insertions(+), 376 deletions(-) delete mode 100644 tools/testfiles/tbitnopaque.ddl create mode 100644 tools/testfiles/tbitnopaque_be.ddl create mode 100644 tools/testfiles/tbitnopaque_le.ddl diff --git a/.gitattributes b/.gitattributes index d18f9b9..3c7dae1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -726,7 +726,8 @@ tools/testfiles/tattrreg.h5 -text tools/testfiles/tbigdims.h5 -text tools/testfiles/tbinary.h5 -text tools/testfiles/tbitfields.h5 -text -tools/testfiles/tbitnopaque.ddl -text +tools/testfiles/tbitnopaque_be.ddl -text +tools/testfiles/tbitnopaque_le.ddl -text tools/testfiles/tbitnopaque.h5 -text svneol=unset#application/x-hdf tools/testfiles/tchar.h5 -text tools/testfiles/tcmpdattrintsize.h5 -text diff --git a/MANIFEST b/MANIFEST index 35d3c2e..9e7fa72 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1629,7 +1629,8 @@ ./tools/testfiles/tbinregR.exp ./tools/testfiles/tbinregR.ddl ./tools/testfiles/tbitfields.h5 -./tools/testfiles/tbitnopaque.ddl +./tools/testfiles/tbitnopaque_be.ddl +./tools/testfiles/tbitnopaque_le.ddl ./tools/testfiles/tbitnopaque.h5 ./tools/testfiles/tboot1.ddl ./tools/testfiles/tboot2.ddl diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 0308783..ec029ea 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -325,7 +325,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) break; default: - printf("Unknown Extension Label: 0x%02x\n", Label); + printf("Unknown Extension Label: %#02x\n", Label); break; } @@ -333,7 +333,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) default: fprintf(stderr, - "Unknown Block Separator Character: 0x%02x\n", Identifier); + "Unknown Block Separator Character: %#02x\n", Identifier); } } } diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 8454815..bd9fc0f 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -350,7 +350,7 @@ h5str_sprintf this_str = (char*)HDmalloc(4 * (nll + 1)); if (1 == nll) { - sprintf(this_str, "0x%02x", ucptr[0]); + sprintf(this_str, "%#02x", ucptr[0]); } else { for (i = 0; i < (int)nll; i++) @@ -481,7 +481,7 @@ h5str_sprintf this_str = (char*)HDmalloc(4 * (nll + 1)); if (1 == nll) { - sprintf(this_str, "0x%02x", ucptr[0]); + sprintf(this_str, "%#02x", ucptr[0]); } else { for (i = 0; i < (int)nll; i++) @@ -1051,8 +1051,20 @@ h5str_get_little_endian_type p_type=H5Tcopy(H5T_IEEE_F64LE); break; - case H5T_TIME: case H5T_BITFIELD: + { + if ( size == 1) + p_type=H5Tcopy(H5T_STD_B8LE); + else if ( size == 2) + p_type=H5Tcopy(H5T_STD_B16LE); + else if ( size == 4) + p_type=H5Tcopy(H5T_STD_B32LE); + else if ( size == 8) + p_type=H5Tcopy(H5T_STD_B64LE); + } + break; + + case H5T_TIME: case H5T_OPAQUE: case H5T_STRING: case H5T_COMPOUND: @@ -1122,8 +1134,20 @@ h5str_get_big_endian_type p_type=H5Tcopy(H5T_IEEE_F64BE); break; - case H5T_TIME: case H5T_BITFIELD: + { + if ( size == 1) + p_type=H5Tcopy(H5T_STD_B8BE); + else if ( size == 2) + p_type=H5Tcopy(H5T_STD_B16BE); + else if ( size == 4) + p_type=H5Tcopy(H5T_STD_B32BE); + else if ( size == 8) + p_type=H5Tcopy(H5T_STD_B64BE); + } + break; + + case H5T_TIME: case H5T_OPAQUE: case H5T_STRING: case H5T_COMPOUND: diff --git a/src/H5T.c b/src/H5T.c index 2433137..a525cd5 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -67,6 +67,19 @@ dt->shared->type = H5T_BITFIELD; \ } +#define H5T_INIT_TYPE_BITFIELD_COMMON(ENDIANNESS) { \ + H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ + H5T_INIT_TYPE_BITFIELD_CORE; \ +} + +#define H5T_INIT_TYPE_BITFIELDLE_CORE { \ + H5T_INIT_TYPE_BITFIELD_COMMON(H5T_ORDER_LE) \ +} + +#define H5T_INIT_TYPE_BITFIELDBE_CORE { \ + H5T_INIT_TYPE_BITFIELD_COMMON(H5T_ORDER_BE) \ +} + /* Define the code template for times for the "GUTS" in the H5T_INIT_TYPE macro */ #define H5T_INIT_TYPE_TIME_CORE { \ dt->shared->type = H5T_TIME; \ @@ -896,29 +909,29 @@ H5T__init_package(void) */ /* little-endian (order is irrelevant) 8-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B8LE_g, COPY, std_u8le, NOSET, -) + H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B8LE_g, COPY, std_u8le, NOSET, -) bitfield=dt; /* Keep type for later */ /* big-endian (order is irrelevant) 8-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B8BE_g, COPY, std_u8be, NOSET, -) + H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B8BE_g, COPY, std_u8be, NOSET, -) /* Little-endian 16-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B16LE_g, COPY, std_u16le, NOSET, -) + H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B16LE_g, COPY, std_u16le, NOSET, -) /* Big-endian 16-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B16BE_g, COPY, std_u16be, NOSET, -) + H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B16BE_g, COPY, std_u16be, NOSET, -) /* Little-endian 32-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B32LE_g, COPY, std_u32le, NOSET, -) + H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B32LE_g, COPY, std_u32le, NOSET, -) /* Big-endian 32-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B32BE_g, COPY, std_u32be, NOSET, -) + H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B32BE_g, COPY, std_u32be, NOSET, -) /* Little-endian 64-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B64LE_g, COPY, std_u64le, NOSET, -) + H5T_INIT_TYPE(BITFIELDLE, H5T_STD_B64LE_g, COPY, std_u64le, NOSET, -) /* Big-endian 64-bit bitfield */ - H5T_INIT_TYPE(BITFIELD, H5T_STD_B64BE_g, COPY, std_u64be, NOSET, -) + H5T_INIT_TYPE(BITFIELDBE, H5T_STD_B64BE_g, COPY, std_u64be, NOSET, -) /*------------------------------------------------------------ * The Unix architecture for dates and times. diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 5642a9b..004672e 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -395,9 +395,9 @@ hsize_t diff_attr(hid_t loc1_id, continue; } - if((mtype1_id = h5tools_get_native_type(ftype1_id)) < 0) + if((mtype1_id = H5Tget_native_type(ftype1_id, H5T_DIR_DEFAULT)) < 0) goto error; - if((mtype2_id = h5tools_get_native_type(ftype2_id)) < 0) + if((mtype2_id = H5Tget_native_type(ftype2_id, H5T_DIR_DEFAULT)) < 0) goto error; if((msize1 = H5Tget_size(mtype1_id)) == 0) goto error; diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index d8eadda..9f70299 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -329,10 +329,10 @@ hsize_t diff_datasetid( hid_t did1, *------------------------------------------------------------------------- */ h5difftrace("check for memory type and sizes\n"); - if ((m_tid1=h5tools_get_native_type(f_tid1)) < 0) + if ((m_tid1=H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0) goto error; - if ((m_tid2=h5tools_get_native_type(f_tid2)) < 0) + if ((m_tid2=H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0) goto error; m_size1 = H5Tget_size( m_tid1 ); diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 1032d1b..6a512ac 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -156,9 +156,30 @@ void print_type(hid_t type) } break; + case H5T_BITFIELD: + if (H5Tequal(type, H5T_STD_B8BE)) { + parallel_print("H5T_STD_B8BE"); + } else if (H5Tequal(type, H5T_STD_B8LE)) { + parallel_print("H5T_STD_B8LE"); + } else if (H5Tequal(type, H5T_STD_B16BE)) { + parallel_print("H5T_STD_B16BE"); + } else if (H5Tequal(type, H5T_STD_B16LE)) { + parallel_print("H5T_STD_B16LE"); + } else if (H5Tequal(type, H5T_STD_B32BE)) { + parallel_print("H5T_STD_B32BE"); + } else if (H5Tequal(type, H5T_STD_B32LE)) { + parallel_print("H5T_STD_B32LE"); + } else if (H5Tequal(type, H5T_STD_B64BE)) { + parallel_print("H5T_STD_B64BE"); + } else if (H5Tequal(type, H5T_STD_B64LE)) { + parallel_print("H5T_STD_B64LE"); + } else { + parallel_print("undefined bitfield"); + } + break; + case H5T_TIME: case H5T_STRING: - case H5T_BITFIELD: case H5T_OPAQUE: case H5T_COMPOUND: case H5T_REFERENCE: @@ -367,7 +388,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, { H5Tclose( *m_tid1 ); - if(( (*m_tid1) = h5tools_get_native_type(f_tid2_id)) < 0) + if(( (*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) { ret = FAIL; goto out; @@ -378,7 +399,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, else { H5Tclose(*m_tid2); - if(( (*m_tid2) = h5tools_get_native_type(f_tid1_id)) < 0) + if(( (*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) { ret = FAIL; goto out; diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 2cc02e8..a74fdd2 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1322,6 +1322,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t case H5T_INTEGER: case H5T_FLOAT: case H5T_ENUM: + case H5T_BITFIELD: block_index = block_nelmts * size; while(block_index > 0) { size_t bytes_in = 0; /* # of bytes to write */ @@ -1488,7 +1489,6 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t break; case H5T_TIME: - case H5T_BITFIELD: case H5T_OPAQUE: for (block_index = 0; block_index < block_nelmts; block_index++) { mem = ((unsigned char*)_mem) + block_index * size; diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 2bafdfc..c5e750a 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -586,7 +586,6 @@ H5TOOLS_DLL int h5tools_set_output_file(const char *fname, int is_bin); H5TOOLS_DLL int h5tools_set_error_file(const char *fname, int is_bin); H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver, char *drivername, size_t drivername_len); -H5TOOLS_DLL hid_t h5tools_get_native_type(hid_t type); H5TOOLS_DLL hid_t h5tools_get_little_endian_type(hid_t type); H5TOOLS_DLL hid_t h5tools_get_big_endian_type(hid_t type); H5TOOLS_DLL htri_t h5tools_detect_vlen(hid_t tid); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 381a253..1a57512 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -1795,7 +1795,7 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t * else if (bin_form == 3) p_type = h5tools_get_big_endian_type(f_type); else - p_type = h5tools_get_native_type(f_type); + p_type = H5Tget_native_type(f_type, H5T_DIR_DEFAULT); if (p_type < 0) goto done; @@ -2957,7 +2957,7 @@ h5tools_print_fill_value(h5tools_str_t *buffer/*in,out*/, const h5tool_format_t hid_t n_type; void *buf = NULL; - n_type = h5tools_get_native_type(type_id); + n_type = H5Tget_native_type(type_id, H5T_DIR_DEFAULT); size = H5Tget_size(n_type); buf = HDmalloc(size); @@ -3785,7 +3785,7 @@ void h5tools_print_packed_bits(h5tools_str_t *buffer, hid_t type) { unsigned packed_bits_size = 0; - hid_t n_type = h5tools_get_native_type(type); + hid_t n_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); if(H5Tget_class(n_type) == H5T_INTEGER) { if(H5Tequal(n_type, H5T_NATIVE_SCHAR) == TRUE) @@ -4043,7 +4043,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, unsigned int vl_data = 0; /* contains VL datatypes */ type = H5Aget_type(obj_id); - p_type = h5tools_get_native_type(type); + p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); ndims = H5Sget_simple_extent_dims(space, size, NULL); diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index b7a2c1e..7396e8c 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -746,7 +746,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai size_t i; if(1 == nsize) - h5tools_str_append(str, OPT(info->fmt_raw, "0x%02x"), ucp_vp[0]); + h5tools_str_append(str, OPT(info->fmt_raw, "%#02x"), ucp_vp[0]); else for(i = 0; i < nsize; i++) { if(i) @@ -1100,7 +1100,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else { size_t i; if(1 == nsize) - h5tools_str_append(str, "0x%02x", ucp_vp[0]); + h5tools_str_append(str, "%#02x", ucp_vp[0]); else for(i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); @@ -1283,7 +1283,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai /* All other types get printed as hexadecimal */ size_t i; if(1 == nsize) - h5tools_str_append(str, "0x%02x", ucp_vp[0]); + h5tools_str_append(str, "%#02x", ucp_vp[0]); else for(i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c index 8c5592f..b57e274 100644 --- a/tools/lib/h5tools_type.c +++ b/tools/lib/h5tools_type.c @@ -100,8 +100,18 @@ h5tools_get_little_endian_type(hid_t tid) p_type=H5Tcopy(H5T_IEEE_F64LE); break; - case H5T_TIME: case H5T_BITFIELD: + if ( size == 1) + p_type=H5Tcopy(H5T_STD_B8LE); + else if ( size == 2) + p_type=H5Tcopy(H5T_STD_B16LE); + else if ( size == 4) + p_type=H5Tcopy(H5T_STD_B32LE); + else if ( size == 8) + p_type=H5Tcopy(H5T_STD_B64LE); + break; + + case H5T_TIME: case H5T_OPAQUE: case H5T_STRING: case H5T_COMPOUND: @@ -177,8 +187,18 @@ h5tools_get_big_endian_type(hid_t tid) p_type=H5Tcopy(H5T_IEEE_F64BE); break; - case H5T_TIME: case H5T_BITFIELD: + if ( size == 1) + p_type=H5Tcopy(H5T_STD_B8BE); + else if ( size == 2) + p_type=H5Tcopy(H5T_STD_B16BE); + else if ( size == 4) + p_type=H5Tcopy(H5T_STD_B32BE); + else if ( size == 8) + p_type=H5Tcopy(H5T_STD_B64BE); + break; + + case H5T_TIME: case H5T_OPAQUE: case H5T_STRING: case H5T_COMPOUND: diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index c29ea5d..1c3978d 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -1952,7 +1952,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, /* VL data special information */ unsigned int vl_data = 0; /* contains VL datatypes */ - p_type = h5tools_get_native_type(type); + p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); /* Check if we have VL data in the dataset's datatype */ if (h5tools_detect_vlen(p_type) == TRUE) diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 8e28d82..8c18794 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -1620,7 +1620,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain if(hexdump_g) p_type = H5Tcopy(type); else - p_type = h5tools_get_native_type(type); + p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); if(p_type >= 0) { /* VL data special information */ diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 7c8e055..3c9ce90 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -291,7 +291,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, * anonymously */ if (dt_ret->id_out < 0) { if (options->use_native == 1) - dt_ret->id_out = h5tools_get_native_type(type_in); + dt_ret->id_out = H5Tget_native_type(type_in, H5T_DIR_DEFAULT); else dt_ret->id_out = H5Tcopy(type_in); if (dt_ret->id_out < 0) @@ -422,7 +422,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, } /* end if */ else { if (options->use_native == 1) - wtype_id = h5tools_get_native_type(ftype_id); + wtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT); else wtype_id = H5Tcopy(ftype_id); } /* end else */ diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 5ec77a7..ec3e287 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -916,7 +916,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, /* wtype_id will have already been set if using a named dtype */ if (!is_named) { if (options->use_native == 1) - wtype_id = h5tools_get_native_type(ftype_id); + wtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT); else wtype_id = H5Tcopy(ftype_id); } /* end if */ diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index 3245af0..408142c 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -126,8 +126,8 @@ int do_copy_refobjs(hid_t fidin, for(k = 0; k < rank; k++) nelmts *= dims[k]; - if((mtype_id = h5tools_get_native_type(ftype_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_get_native_type failed"); + if((mtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); if((msize = H5Tget_size(mtype_id)) == 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); @@ -484,8 +484,8 @@ static int copy_refs_attr(hid_t loc_in, type_class = H5Tget_class(ftype_id); - if((mtype_id = h5tools_get_native_type(ftype_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_get_native_type failed"); + if((mtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); if((msize = H5Tget_size(mtype_id)) == 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index f17b116..ae4649a 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -62,7 +62,8 @@ ${HDF5_TOOLS_DIR}/testfiles/tbin4.ddl ${HDF5_TOOLS_DIR}/testfiles/tbinregR.ddl ${HDF5_TOOLS_DIR}/testfiles/tbigdims.ddl - ${HDF5_TOOLS_DIR}/testfiles/tbitnopaque.ddl + ${HDF5_TOOLS_DIR}/testfiles/tbitnopaque_be.ddl + ${HDF5_TOOLS_DIR}/testfiles/tbitnopaque_le.ddl ${HDF5_TOOLS_DIR}/testfiles/tboot1.ddl ${HDF5_TOOLS_DIR}/testfiles/tboot2.ddl ${HDF5_TOOLS_DIR}/testfiles/tboot2A.ddl @@ -810,8 +811,10 @@ tbinregR.out.err tbigdims.out tbigdims.out.err - tbitnopaque.out - tbitnopaque.out.err + tbitnopaque_be.out + tbitnopaque_be.out.err + tbitnopaque_le.out + tbitnopaque_le.out.err tboot1.out tboot1.out.err tboot2.out @@ -1172,7 +1175,11 @@ ADD_H5_TEST (tcomp-4 0 --enable-error-stack tcompound_complex.h5) ADD_H5_TEST (tcompound_complex2 0 --enable-error-stack tcompound_complex2.h5) # tests for bitfields and opaque data types - ADD_H5_TEST (tbitnopaque 0 --enable-error-stack tbitnopaque.h5) + if (H5_WORDS_BIGENDIAN) + ADD_H5_TEST (tbitnopaque_be 0 --enable-error-stack tbitnopaque.h5) + else () + ADD_H5_TEST (tbitnopaque_le 0 --enable-error-stack tbitnopaque.h5) + endif () #test for the nested compound type ADD_H5_TEST (tnestcomp-1 0 --enable-error-stack tnestedcomp.h5) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index 7edaedd..ef6c4d8 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -218,7 +218,8 @@ $SRC_H5DUMP_TESTFILES/tbin3.ddl $SRC_H5DUMP_TESTFILES/tbin4.ddl $SRC_H5DUMP_TESTFILES/tbinregR.ddl $SRC_H5DUMP_TESTFILES/tbigdims.ddl -$SRC_H5DUMP_TESTFILES/tbitnopaque.ddl +$SRC_H5DUMP_TESTFILES/tbitnopaque_be.ddl +$SRC_H5DUMP_TESTFILES/tbitnopaque_le.ddl $SRC_H5DUMP_TESTFILES/tboot1.ddl $SRC_H5DUMP_TESTFILES/tboot2.ddl $SRC_H5DUMP_TESTFILES/tboot2A.ddl @@ -1062,7 +1063,11 @@ TOOLTEST4 tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5 TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5 TOOLTEST tcompound_complex2.ddl --enable-error-stack tcompound_complex2.h5 # tests for bitfields and opaque data types -TOOLTEST tbitnopaque.ddl --enable-error-stack tbitnopaque.h5 +if test $WORDS_BIGENDIAN != "yes"; then +TOOLTEST tbitnopaque_le.ddl --enable-error-stack tbitnopaque.h5 +else +TOOLTEST tbitnopaque_be.ddl --enable-error-stack tbitnopaque.h5 +fi #test for the nested compound type TOOLTEST tnestcomp-1.ddl --enable-error-stack tnestedcomp.h5 diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c index d905e37..9a72557 100644 --- a/tools/test/misc/talign.c +++ b/tools/test/misc/talign.c @@ -86,8 +86,7 @@ int main(void) H5Tinsert(cmp, "Not Ok", sizeof(fok) + sizeof(string5), array_dt); H5Tclose(array_dt); - fix = h5tools_get_native_type(cmp); - + fix = H5Tget_native_type(cmp, H5T_DIR_DEFAULT); cmp1 = H5Tcreate(H5T_COMPOUND, sizeof(fok)); cdim[0] = sizeof(fok) / sizeof(float); @@ -208,35 +207,3 @@ out: return result; } -/*------------------------------------------------------------------------- - * Function: h5tools_get_native_type - * - * Purpose: Wrapper around H5Tget_native_type() to work around - * Problems with bitfields. - * - * Return: Success: datatype ID - * - * Failure: FAIL - * - * Programmer: Quincey Koziol - * Tuesday, October 5, 2004 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -hid_t -h5tools_get_native_type(hid_t type) -{ - hid_t p_type; - H5T_class_t type_class; - - type_class = H5Tget_class(type); - if(type_class==H5T_BITFIELD) - p_type=H5Tcopy(type); - else - p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT); - - return(p_type); -} - diff --git a/tools/testfiles/tbitnopaque.ddl b/tools/testfiles/tbitnopaque.ddl deleted file mode 100644 index 0c59c0b..0000000 --- a/tools/testfiles/tbitnopaque.ddl +++ /dev/null @@ -1,293 +0,0 @@ -HDF5 "tbitnopaque.h5" { -GROUP "/" { - GROUP "bittypetests" { - DATASET "bitfield_1" { - DATATYPE H5T_STD_B8LE - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, - (10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, - (20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, - (30): 0xe1, 0xe0 - } - } - DATASET "bitfield_2" { - DATATYPE H5T_STD_B16LE - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, - (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, - (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, - (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe - } - } - DATASET "bitfield_3" { - DATATYPE H5T_STD_B32LE - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): ff:ff:ff:ff, df:ff:ff:ff, bf:ff:ff:ff, 9f:ff:ff:ff, - (4): 7f:ff:ff:ff, 5f:ff:ff:ff, 3f:ff:ff:ff, 1f:ff:ff:ff, - (8): ff:fe:ff:ff, df:fe:ff:ff, bf:fe:ff:ff, 9f:fe:ff:ff, - (12): 7f:fe:ff:ff, 5f:fe:ff:ff, 3f:fe:ff:ff, 1f:fe:ff:ff, - (16): ff:fd:ff:ff, df:fd:ff:ff, bf:fd:ff:ff, 9f:fd:ff:ff, - (20): 7f:fd:ff:ff, 5f:fd:ff:ff, 3f:fd:ff:ff, 1f:fd:ff:ff, - (24): ff:fc:ff:ff, df:fc:ff:ff, bf:fc:ff:ff, 9f:fc:ff:ff, - (28): 7f:fc:ff:ff, 5f:fc:ff:ff, 3f:fc:ff:ff, 1f:fc:ff:ff - } - } - DATASET "bitfield_4" { - DATATYPE H5T_STD_B64LE - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): ff:ff:ff:ff:ff:ff:ff:ff, bf:ff:ff:ff:ff:ff:ff:ff, - (2): 7f:ff:ff:ff:ff:ff:ff:ff, 3f:ff:ff:ff:ff:ff:ff:ff, - (4): ff:fe:ff:ff:ff:ff:ff:ff, bf:fe:ff:ff:ff:ff:ff:ff, - (6): 7f:fe:ff:ff:ff:ff:ff:ff, 3f:fe:ff:ff:ff:ff:ff:ff, - (8): ff:fd:ff:ff:ff:ff:ff:ff, bf:fd:ff:ff:ff:ff:ff:ff, - (10): 7f:fd:ff:ff:ff:ff:ff:ff, 3f:fd:ff:ff:ff:ff:ff:ff, - (12): ff:fc:ff:ff:ff:ff:ff:ff, bf:fc:ff:ff:ff:ff:ff:ff, - (14): 7f:fc:ff:ff:ff:ff:ff:ff, 3f:fc:ff:ff:ff:ff:ff:ff, - (16): ff:fb:ff:ff:ff:ff:ff:ff, bf:fb:ff:ff:ff:ff:ff:ff, - (18): 7f:fb:ff:ff:ff:ff:ff:ff, 3f:fb:ff:ff:ff:ff:ff:ff, - (20): ff:fa:ff:ff:ff:ff:ff:ff, bf:fa:ff:ff:ff:ff:ff:ff, - (22): 7f:fa:ff:ff:ff:ff:ff:ff, 3f:fa:ff:ff:ff:ff:ff:ff, - (24): ff:f9:ff:ff:ff:ff:ff:ff, bf:f9:ff:ff:ff:ff:ff:ff, - (26): 7f:f9:ff:ff:ff:ff:ff:ff, 3f:f9:ff:ff:ff:ff:ff:ff, - (28): ff:f8:ff:ff:ff:ff:ff:ff, bf:f8:ff:ff:ff:ff:ff:ff, - (30): 7f:f8:ff:ff:ff:ff:ff:ff, 3f:f8:ff:ff:ff:ff:ff:ff - } - } - } - GROUP "cmpdtypetests" { - DATASET "compound_1" { - DATATYPE H5T_COMPOUND { - H5T_STD_B8LE "a"; - H5T_STD_B16LE "b"; - H5T_STD_B32LE "c"; - H5T_STD_B64LE "d"; - } - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): { - 0xff, - ff:ff, - ff:ff:ff:ff, - ff:ff:ff:ff:ff:ff:ff:ff - }, - (1): { - 0xfe, - ef:ff, - df:ff:ff:ff, - bf:ff:ff:ff:ff:ff:ff:ff - }, - (2): { - 0xfd, - df:ff, - bf:ff:ff:ff, - 7f:ff:ff:ff:ff:ff:ff:ff - }, - (3): { - 0xfc, - cf:ff, - 9f:ff:ff:ff, - 3f:ff:ff:ff:ff:ff:ff:ff - }, - (4): { - 0xfb, - bf:ff, - 7f:ff:ff:ff, - ff:fe:ff:ff:ff:ff:ff:ff - }, - (5): { - 0xfa, - af:ff, - 5f:ff:ff:ff, - bf:fe:ff:ff:ff:ff:ff:ff - }, - (6): { - 0xf9, - 9f:ff, - 3f:ff:ff:ff, - 7f:fe:ff:ff:ff:ff:ff:ff - }, - (7): { - 0xf8, - 8f:ff, - 1f:ff:ff:ff, - 3f:fe:ff:ff:ff:ff:ff:ff - }, - (8): { - 0xf7, - 7f:ff, - ff:fe:ff:ff, - ff:fd:ff:ff:ff:ff:ff:ff - }, - (9): { - 0xf6, - 6f:ff, - df:fe:ff:ff, - bf:fd:ff:ff:ff:ff:ff:ff - }, - (10): { - 0xf5, - 5f:ff, - bf:fe:ff:ff, - 7f:fd:ff:ff:ff:ff:ff:ff - }, - (11): { - 0xf4, - 4f:ff, - 9f:fe:ff:ff, - 3f:fd:ff:ff:ff:ff:ff:ff - }, - (12): { - 0xf3, - 3f:ff, - 7f:fe:ff:ff, - ff:fc:ff:ff:ff:ff:ff:ff - }, - (13): { - 0xf2, - 2f:ff, - 5f:fe:ff:ff, - bf:fc:ff:ff:ff:ff:ff:ff - }, - (14): { - 0xf1, - 1f:ff, - 3f:fe:ff:ff, - 7f:fc:ff:ff:ff:ff:ff:ff - }, - (15): { - 0xf0, - 0f:ff, - 1f:fe:ff:ff, - 3f:fc:ff:ff:ff:ff:ff:ff - }, - (16): { - 0xef, - ff:fe, - ff:fd:ff:ff, - ff:fb:ff:ff:ff:ff:ff:ff - }, - (17): { - 0xee, - ef:fe, - df:fd:ff:ff, - bf:fb:ff:ff:ff:ff:ff:ff - }, - (18): { - 0xed, - df:fe, - bf:fd:ff:ff, - 7f:fb:ff:ff:ff:ff:ff:ff - }, - (19): { - 0xec, - cf:fe, - 9f:fd:ff:ff, - 3f:fb:ff:ff:ff:ff:ff:ff - }, - (20): { - 0xeb, - bf:fe, - 7f:fd:ff:ff, - ff:fa:ff:ff:ff:ff:ff:ff - }, - (21): { - 0xea, - af:fe, - 5f:fd:ff:ff, - bf:fa:ff:ff:ff:ff:ff:ff - }, - (22): { - 0xe9, - 9f:fe, - 3f:fd:ff:ff, - 7f:fa:ff:ff:ff:ff:ff:ff - }, - (23): { - 0xe8, - 8f:fe, - 1f:fd:ff:ff, - 3f:fa:ff:ff:ff:ff:ff:ff - }, - (24): { - 0xe7, - 7f:fe, - ff:fc:ff:ff, - ff:f9:ff:ff:ff:ff:ff:ff - }, - (25): { - 0xe6, - 6f:fe, - df:fc:ff:ff, - bf:f9:ff:ff:ff:ff:ff:ff - }, - (26): { - 0xe5, - 5f:fe, - bf:fc:ff:ff, - 7f:f9:ff:ff:ff:ff:ff:ff - }, - (27): { - 0xe4, - 4f:fe, - 9f:fc:ff:ff, - 3f:f9:ff:ff:ff:ff:ff:ff - }, - (28): { - 0xe3, - 3f:fe, - 7f:fc:ff:ff, - ff:f8:ff:ff:ff:ff:ff:ff - }, - (29): { - 0xe2, - 2f:fe, - 5f:fc:ff:ff, - bf:f8:ff:ff:ff:ff:ff:ff - }, - (30): { - 0xe1, - 1f:fe, - 3f:fc:ff:ff, - 7f:f8:ff:ff:ff:ff:ff:ff - }, - (31): { - 0xe0, - 0f:fe, - 1f:fc:ff:ff, - 3f:f8:ff:ff:ff:ff:ff:ff - } - } - } - } - GROUP "opaquetypetests" { - DATASET "opaque_1" { - DATATYPE H5T_OPAQUE { - OPAQUE_TAG "1-byte opaque type"; - } - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, - (10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, - (20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, - (30): 0xe1, 0xe0 - } - } - DATASET "opaque_2" { - DATATYPE H5T_OPAQUE { - OPAQUE_TAG "2-byte opaque type"; - } - DATASPACE SIMPLE { ( 32 ) / ( 32 ) } - DATA { - (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, - (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, - (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, - (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe - } - } - } -} -} diff --git a/tools/testfiles/tbitnopaque_be.ddl b/tools/testfiles/tbitnopaque_be.ddl new file mode 100644 index 0000000..b57cd21 --- /dev/null +++ b/tools/testfiles/tbitnopaque_be.ddl @@ -0,0 +1,293 @@ +HDF5 "./tools/test/h5dump/testfiles/std/tbitnopaque.h5" { +GROUP "/" { + GROUP "bittypetests" { + DATASET "bitfield_1" { + DATATYPE H5T_STD_B8LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, + (10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, + (20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, + (30): 0xe1, 0xe0 + } + } + DATASET "bitfield_2" { + DATATYPE H5T_STD_B16LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff, ff:ef, ff:df, ff:cf, ff:bf, ff:af, ff:9f, ff:8f, ff:7f, + (9): ff:6f, ff:5f, ff:4f, ff:3f, ff:2f, ff:1f, ff:0f, fe:ff, fe:ef, + (18): fe:df, fe:cf, fe:bf, fe:af, fe:9f, fe:8f, fe:7f, fe:6f, fe:5f, + (27): fe:4f, fe:3f, fe:2f, fe:1f, fe:0f + } + } + DATASET "bitfield_3" { + DATATYPE H5T_STD_B32LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff:ff:ff, ff:ff:ff:df, ff:ff:ff:bf, ff:ff:ff:9f, + (4): ff:ff:ff:7f, ff:ff:ff:5f, ff:ff:ff:3f, ff:ff:ff:1f, + (8): ff:ff:fe:ff, ff:ff:fe:df, ff:ff:fe:bf, ff:ff:fe:9f, + (12): ff:ff:fe:7f, ff:ff:fe:5f, ff:ff:fe:3f, ff:ff:fe:1f, + (16): ff:ff:fd:ff, ff:ff:fd:df, ff:ff:fd:bf, ff:ff:fd:9f, + (20): ff:ff:fd:7f, ff:ff:fd:5f, ff:ff:fd:3f, ff:ff:fd:1f, + (24): ff:ff:fc:ff, ff:ff:fc:df, ff:ff:fc:bf, ff:ff:fc:9f, + (28): ff:ff:fc:7f, ff:ff:fc:5f, ff:ff:fc:3f, ff:ff:fc:1f + } + } + DATASET "bitfield_4" { + DATATYPE H5T_STD_B64LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff:ff:ff:ff:ff:ff:ff, ff:ff:ff:ff:ff:ff:ff:bf, + (2): ff:ff:ff:ff:ff:ff:ff:7f, ff:ff:ff:ff:ff:ff:ff:3f, + (4): ff:ff:ff:ff:ff:ff:fe:ff, ff:ff:ff:ff:ff:ff:fe:bf, + (6): ff:ff:ff:ff:ff:ff:fe:7f, ff:ff:ff:ff:ff:ff:fe:3f, + (8): ff:ff:ff:ff:ff:ff:fd:ff, ff:ff:ff:ff:ff:ff:fd:bf, + (10): ff:ff:ff:ff:ff:ff:fd:7f, ff:ff:ff:ff:ff:ff:fd:3f, + (12): ff:ff:ff:ff:ff:ff:fc:ff, ff:ff:ff:ff:ff:ff:fc:bf, + (14): ff:ff:ff:ff:ff:ff:fc:7f, ff:ff:ff:ff:ff:ff:fc:3f, + (16): ff:ff:ff:ff:ff:ff:fb:ff, ff:ff:ff:ff:ff:ff:fb:bf, + (18): ff:ff:ff:ff:ff:ff:fb:7f, ff:ff:ff:ff:ff:ff:fb:3f, + (20): ff:ff:ff:ff:ff:ff:fa:ff, ff:ff:ff:ff:ff:ff:fa:bf, + (22): ff:ff:ff:ff:ff:ff:fa:7f, ff:ff:ff:ff:ff:ff:fa:3f, + (24): ff:ff:ff:ff:ff:ff:f9:ff, ff:ff:ff:ff:ff:ff:f9:bf, + (26): ff:ff:ff:ff:ff:ff:f9:7f, ff:ff:ff:ff:ff:ff:f9:3f, + (28): ff:ff:ff:ff:ff:ff:f8:ff, ff:ff:ff:ff:ff:ff:f8:bf, + (30): ff:ff:ff:ff:ff:ff:f8:7f, ff:ff:ff:ff:ff:ff:f8:3f + } + } + } + GROUP "cmpdtypetests" { + DATASET "compound_1" { + DATATYPE H5T_COMPOUND { + H5T_STD_B8LE "a"; + H5T_STD_B16LE "b"; + H5T_STD_B32LE "c"; + H5T_STD_B64LE "d"; + } + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): { + 0xff, + ff:ff, + ff:ff:ff:ff, + ff:ff:ff:ff:ff:ff:ff:ff + }, + (1): { + 0xfe, + ff:ef, + ff:ff:ff:df, + ff:ff:ff:ff:ff:ff:ff:bf + }, + (2): { + 0xfd, + ff:df, + ff:ff:ff:bf, + ff:ff:ff:ff:ff:ff:ff:7f + }, + (3): { + 0xfc, + ff:cf, + ff:ff:ff:9f, + ff:ff:ff:ff:ff:ff:ff:3f + }, + (4): { + 0xfb, + ff:bf, + ff:ff:ff:7f, + ff:ff:ff:ff:ff:ff:fe:ff + }, + (5): { + 0xfa, + ff:af, + ff:ff:ff:5f, + ff:ff:ff:ff:ff:ff:fe:bf + }, + (6): { + 0xf9, + ff:9f, + ff:ff:ff:3f, + ff:ff:ff:ff:ff:ff:fe:7f + }, + (7): { + 0xf8, + ff:8f, + ff:ff:ff:1f, + ff:ff:ff:ff:ff:ff:fe:3f + }, + (8): { + 0xf7, + ff:7f, + ff:ff:fe:ff, + ff:ff:ff:ff:ff:ff:fd:ff + }, + (9): { + 0xf6, + ff:6f, + ff:ff:fe:df, + ff:ff:ff:ff:ff:ff:fd:bf + }, + (10): { + 0xf5, + ff:5f, + ff:ff:fe:bf, + ff:ff:ff:ff:ff:ff:fd:7f + }, + (11): { + 0xf4, + ff:4f, + ff:ff:fe:9f, + ff:ff:ff:ff:ff:ff:fd:3f + }, + (12): { + 0xf3, + ff:3f, + ff:ff:fe:7f, + ff:ff:ff:ff:ff:ff:fc:ff + }, + (13): { + 0xf2, + ff:2f, + ff:ff:fe:5f, + ff:ff:ff:ff:ff:ff:fc:bf + }, + (14): { + 0xf1, + ff:1f, + ff:ff:fe:3f, + ff:ff:ff:ff:ff:ff:fc:7f + }, + (15): { + 0xf0, + ff:0f, + ff:ff:fe:1f, + ff:ff:ff:ff:ff:ff:fc:3f + }, + (16): { + 0xef, + fe:ff, + ff:ff:fd:ff, + ff:ff:ff:ff:ff:ff:fb:ff + }, + (17): { + 0xee, + fe:ef, + ff:ff:fd:df, + ff:ff:ff:ff:ff:ff:fb:bf + }, + (18): { + 0xed, + fe:df, + ff:ff:fd:bf, + ff:ff:ff:ff:ff:ff:fb:7f + }, + (19): { + 0xec, + fe:cf, + ff:ff:fd:9f, + ff:ff:ff:ff:ff:ff:fb:3f + }, + (20): { + 0xeb, + fe:bf, + ff:ff:fd:7f, + ff:ff:ff:ff:ff:ff:fa:ff + }, + (21): { + 0xea, + fe:af, + ff:ff:fd:5f, + ff:ff:ff:ff:ff:ff:fa:bf + }, + (22): { + 0xe9, + fe:9f, + ff:ff:fd:3f, + ff:ff:ff:ff:ff:ff:fa:7f + }, + (23): { + 0xe8, + fe:8f, + ff:ff:fd:1f, + ff:ff:ff:ff:ff:ff:fa:3f + }, + (24): { + 0xe7, + fe:7f, + ff:ff:fc:ff, + ff:ff:ff:ff:ff:ff:f9:ff + }, + (25): { + 0xe6, + fe:6f, + ff:ff:fc:df, + ff:ff:ff:ff:ff:ff:f9:bf + }, + (26): { + 0xe5, + fe:5f, + ff:ff:fc:bf, + ff:ff:ff:ff:ff:ff:f9:7f + }, + (27): { + 0xe4, + fe:4f, + ff:ff:fc:9f, + ff:ff:ff:ff:ff:ff:f9:3f + }, + (28): { + 0xe3, + fe:3f, + ff:ff:fc:7f, + ff:ff:ff:ff:ff:ff:f8:ff + }, + (29): { + 0xe2, + fe:2f, + ff:ff:fc:5f, + ff:ff:ff:ff:ff:ff:f8:bf + }, + (30): { + 0xe1, + fe:1f, + ff:ff:fc:3f, + ff:ff:ff:ff:ff:ff:f8:7f + }, + (31): { + 0xe0, + fe:0f, + ff:ff:fc:1f, + ff:ff:ff:ff:ff:ff:f8:3f + } + } + } + } + GROUP "opaquetypetests" { + DATASET "opaque_1" { + DATATYPE H5T_OPAQUE { + OPAQUE_TAG "1-byte opaque type"; + } + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, + (10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, + (20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, + (30): 0xe1, 0xe0 + } + } + DATASET "opaque_2" { + DATATYPE H5T_OPAQUE { + OPAQUE_TAG "2-byte opaque type"; + } + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, + (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, + (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, + (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe + } + } + } +} +} diff --git a/tools/testfiles/tbitnopaque_le.ddl b/tools/testfiles/tbitnopaque_le.ddl new file mode 100644 index 0000000..0c59c0b --- /dev/null +++ b/tools/testfiles/tbitnopaque_le.ddl @@ -0,0 +1,293 @@ +HDF5 "tbitnopaque.h5" { +GROUP "/" { + GROUP "bittypetests" { + DATASET "bitfield_1" { + DATATYPE H5T_STD_B8LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, + (10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, + (20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, + (30): 0xe1, 0xe0 + } + } + DATASET "bitfield_2" { + DATATYPE H5T_STD_B16LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, + (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, + (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, + (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe + } + } + DATASET "bitfield_3" { + DATATYPE H5T_STD_B32LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff:ff:ff, df:ff:ff:ff, bf:ff:ff:ff, 9f:ff:ff:ff, + (4): 7f:ff:ff:ff, 5f:ff:ff:ff, 3f:ff:ff:ff, 1f:ff:ff:ff, + (8): ff:fe:ff:ff, df:fe:ff:ff, bf:fe:ff:ff, 9f:fe:ff:ff, + (12): 7f:fe:ff:ff, 5f:fe:ff:ff, 3f:fe:ff:ff, 1f:fe:ff:ff, + (16): ff:fd:ff:ff, df:fd:ff:ff, bf:fd:ff:ff, 9f:fd:ff:ff, + (20): 7f:fd:ff:ff, 5f:fd:ff:ff, 3f:fd:ff:ff, 1f:fd:ff:ff, + (24): ff:fc:ff:ff, df:fc:ff:ff, bf:fc:ff:ff, 9f:fc:ff:ff, + (28): 7f:fc:ff:ff, 5f:fc:ff:ff, 3f:fc:ff:ff, 1f:fc:ff:ff + } + } + DATASET "bitfield_4" { + DATATYPE H5T_STD_B64LE + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff:ff:ff:ff:ff:ff:ff, bf:ff:ff:ff:ff:ff:ff:ff, + (2): 7f:ff:ff:ff:ff:ff:ff:ff, 3f:ff:ff:ff:ff:ff:ff:ff, + (4): ff:fe:ff:ff:ff:ff:ff:ff, bf:fe:ff:ff:ff:ff:ff:ff, + (6): 7f:fe:ff:ff:ff:ff:ff:ff, 3f:fe:ff:ff:ff:ff:ff:ff, + (8): ff:fd:ff:ff:ff:ff:ff:ff, bf:fd:ff:ff:ff:ff:ff:ff, + (10): 7f:fd:ff:ff:ff:ff:ff:ff, 3f:fd:ff:ff:ff:ff:ff:ff, + (12): ff:fc:ff:ff:ff:ff:ff:ff, bf:fc:ff:ff:ff:ff:ff:ff, + (14): 7f:fc:ff:ff:ff:ff:ff:ff, 3f:fc:ff:ff:ff:ff:ff:ff, + (16): ff:fb:ff:ff:ff:ff:ff:ff, bf:fb:ff:ff:ff:ff:ff:ff, + (18): 7f:fb:ff:ff:ff:ff:ff:ff, 3f:fb:ff:ff:ff:ff:ff:ff, + (20): ff:fa:ff:ff:ff:ff:ff:ff, bf:fa:ff:ff:ff:ff:ff:ff, + (22): 7f:fa:ff:ff:ff:ff:ff:ff, 3f:fa:ff:ff:ff:ff:ff:ff, + (24): ff:f9:ff:ff:ff:ff:ff:ff, bf:f9:ff:ff:ff:ff:ff:ff, + (26): 7f:f9:ff:ff:ff:ff:ff:ff, 3f:f9:ff:ff:ff:ff:ff:ff, + (28): ff:f8:ff:ff:ff:ff:ff:ff, bf:f8:ff:ff:ff:ff:ff:ff, + (30): 7f:f8:ff:ff:ff:ff:ff:ff, 3f:f8:ff:ff:ff:ff:ff:ff + } + } + } + GROUP "cmpdtypetests" { + DATASET "compound_1" { + DATATYPE H5T_COMPOUND { + H5T_STD_B8LE "a"; + H5T_STD_B16LE "b"; + H5T_STD_B32LE "c"; + H5T_STD_B64LE "d"; + } + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): { + 0xff, + ff:ff, + ff:ff:ff:ff, + ff:ff:ff:ff:ff:ff:ff:ff + }, + (1): { + 0xfe, + ef:ff, + df:ff:ff:ff, + bf:ff:ff:ff:ff:ff:ff:ff + }, + (2): { + 0xfd, + df:ff, + bf:ff:ff:ff, + 7f:ff:ff:ff:ff:ff:ff:ff + }, + (3): { + 0xfc, + cf:ff, + 9f:ff:ff:ff, + 3f:ff:ff:ff:ff:ff:ff:ff + }, + (4): { + 0xfb, + bf:ff, + 7f:ff:ff:ff, + ff:fe:ff:ff:ff:ff:ff:ff + }, + (5): { + 0xfa, + af:ff, + 5f:ff:ff:ff, + bf:fe:ff:ff:ff:ff:ff:ff + }, + (6): { + 0xf9, + 9f:ff, + 3f:ff:ff:ff, + 7f:fe:ff:ff:ff:ff:ff:ff + }, + (7): { + 0xf8, + 8f:ff, + 1f:ff:ff:ff, + 3f:fe:ff:ff:ff:ff:ff:ff + }, + (8): { + 0xf7, + 7f:ff, + ff:fe:ff:ff, + ff:fd:ff:ff:ff:ff:ff:ff + }, + (9): { + 0xf6, + 6f:ff, + df:fe:ff:ff, + bf:fd:ff:ff:ff:ff:ff:ff + }, + (10): { + 0xf5, + 5f:ff, + bf:fe:ff:ff, + 7f:fd:ff:ff:ff:ff:ff:ff + }, + (11): { + 0xf4, + 4f:ff, + 9f:fe:ff:ff, + 3f:fd:ff:ff:ff:ff:ff:ff + }, + (12): { + 0xf3, + 3f:ff, + 7f:fe:ff:ff, + ff:fc:ff:ff:ff:ff:ff:ff + }, + (13): { + 0xf2, + 2f:ff, + 5f:fe:ff:ff, + bf:fc:ff:ff:ff:ff:ff:ff + }, + (14): { + 0xf1, + 1f:ff, + 3f:fe:ff:ff, + 7f:fc:ff:ff:ff:ff:ff:ff + }, + (15): { + 0xf0, + 0f:ff, + 1f:fe:ff:ff, + 3f:fc:ff:ff:ff:ff:ff:ff + }, + (16): { + 0xef, + ff:fe, + ff:fd:ff:ff, + ff:fb:ff:ff:ff:ff:ff:ff + }, + (17): { + 0xee, + ef:fe, + df:fd:ff:ff, + bf:fb:ff:ff:ff:ff:ff:ff + }, + (18): { + 0xed, + df:fe, + bf:fd:ff:ff, + 7f:fb:ff:ff:ff:ff:ff:ff + }, + (19): { + 0xec, + cf:fe, + 9f:fd:ff:ff, + 3f:fb:ff:ff:ff:ff:ff:ff + }, + (20): { + 0xeb, + bf:fe, + 7f:fd:ff:ff, + ff:fa:ff:ff:ff:ff:ff:ff + }, + (21): { + 0xea, + af:fe, + 5f:fd:ff:ff, + bf:fa:ff:ff:ff:ff:ff:ff + }, + (22): { + 0xe9, + 9f:fe, + 3f:fd:ff:ff, + 7f:fa:ff:ff:ff:ff:ff:ff + }, + (23): { + 0xe8, + 8f:fe, + 1f:fd:ff:ff, + 3f:fa:ff:ff:ff:ff:ff:ff + }, + (24): { + 0xe7, + 7f:fe, + ff:fc:ff:ff, + ff:f9:ff:ff:ff:ff:ff:ff + }, + (25): { + 0xe6, + 6f:fe, + df:fc:ff:ff, + bf:f9:ff:ff:ff:ff:ff:ff + }, + (26): { + 0xe5, + 5f:fe, + bf:fc:ff:ff, + 7f:f9:ff:ff:ff:ff:ff:ff + }, + (27): { + 0xe4, + 4f:fe, + 9f:fc:ff:ff, + 3f:f9:ff:ff:ff:ff:ff:ff + }, + (28): { + 0xe3, + 3f:fe, + 7f:fc:ff:ff, + ff:f8:ff:ff:ff:ff:ff:ff + }, + (29): { + 0xe2, + 2f:fe, + 5f:fc:ff:ff, + bf:f8:ff:ff:ff:ff:ff:ff + }, + (30): { + 0xe1, + 1f:fe, + 3f:fc:ff:ff, + 7f:f8:ff:ff:ff:ff:ff:ff + }, + (31): { + 0xe0, + 0f:fe, + 1f:fc:ff:ff, + 3f:f8:ff:ff:ff:ff:ff:ff + } + } + } + } + GROUP "opaquetypetests" { + DATASET "opaque_1" { + DATATYPE H5T_OPAQUE { + OPAQUE_TAG "1-byte opaque type"; + } + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, + (10): 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, + (20): 0xeb, 0xea, 0xe9, 0xe8, 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, + (30): 0xe1, 0xe0 + } + } + DATASET "opaque_2" { + DATATYPE H5T_OPAQUE { + OPAQUE_TAG "2-byte opaque type"; + } + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): ff:ff, ef:ff, df:ff, cf:ff, bf:ff, af:ff, 9f:ff, 8f:ff, 7f:ff, + (9): 6f:ff, 5f:ff, 4f:ff, 3f:ff, 2f:ff, 1f:ff, 0f:ff, ff:fe, ef:fe, + (18): df:fe, cf:fe, bf:fe, af:fe, 9f:fe, 8f:fe, 7f:fe, 6f:fe, 5f:fe, + (27): 4f:fe, 3f:fe, 2f:fe, 1f:fe, 0f:fe + } + } + } +} +} -- cgit v0.12 From 772e6e9a7f5a5b01cfb6198830a41a4a0323a0a2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 May 2017 11:00:37 -0500 Subject: Fix reference file contents --- tools/testfiles/tbitnopaque_be.ddl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testfiles/tbitnopaque_be.ddl b/tools/testfiles/tbitnopaque_be.ddl index b57cd21..b0de7c4 100644 --- a/tools/testfiles/tbitnopaque_be.ddl +++ b/tools/testfiles/tbitnopaque_be.ddl @@ -1,4 +1,4 @@ -HDF5 "./tools/test/h5dump/testfiles/std/tbitnopaque.h5" { +HDF5 "tbitnopaque.h5" { GROUP "/" { GROUP "bittypetests" { DATASET "bitfield_1" { -- cgit v0.12 From dd45c3694ffc423170b513f8be339d5bc4484476 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 May 2017 11:09:55 -0500 Subject: HDFFV-10186 braces formatting --- tools/lib/h5diff_util.c | 131 ++++++++++++++++++++++-------------------------- 1 file changed, 59 insertions(+), 72 deletions(-) diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 6a512ac..454f993 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -33,19 +33,14 @@ print_dimensions (int rank, hsize_t *dims) { int i; - if ( rank <= 0 ) - { + if( rank <= 0 ) parallel_print("H5S_SCALAR" ); - } - else - { + else { if (!dims) parallel_print("dimension is NULL"); - else - { + else { parallel_print("["); - for ( i = 0; i < rank-1; i++) - { + for ( i = 0; i < rank-1; i++) { parallel_print(HSIZE_T_FORMAT, dims[i]); parallel_print("x"); } @@ -74,108 +69,104 @@ print_dimensions (int rank, hsize_t *dims) */ void print_type(hid_t type) { - switch (H5Tget_class(type)) - { + switch (H5Tget_class(type)) { case H5T_INTEGER: - if (H5Tequal(type, H5T_STD_I8BE)) { + if(H5Tequal(type, H5T_STD_I8BE)) parallel_print("H5T_STD_I8BE"); - } else if (H5Tequal(type, H5T_STD_I8LE)) { + else if(H5Tequal(type, H5T_STD_I8LE)) parallel_print("H5T_STD_I8LE"); - } else if (H5Tequal(type, H5T_STD_I16BE)) { + else if(H5Tequal(type, H5T_STD_I16BE)) parallel_print("H5T_STD_I16BE"); - } else if (H5Tequal(type, H5T_STD_I16LE)) { + else if(H5Tequal(type, H5T_STD_I16LE)) parallel_print("H5T_STD_I16LE"); - } else if (H5Tequal(type, H5T_STD_I32BE)) { + else if(H5Tequal(type, H5T_STD_I32BE)) parallel_print("H5T_STD_I32BE"); - } else if (H5Tequal(type, H5T_STD_I32LE)) { + else if(H5Tequal(type, H5T_STD_I32LE)) parallel_print("H5T_STD_I32LE"); - } else if (H5Tequal(type, H5T_STD_I64BE)) { + else if(H5Tequal(type, H5T_STD_I64BE)) parallel_print("H5T_STD_I64BE"); - } else if (H5Tequal(type, H5T_STD_I64LE)) { + else if(H5Tequal(type, H5T_STD_I64LE)) parallel_print("H5T_STD_I64LE"); - } else if (H5Tequal(type, H5T_STD_U8BE)) { + else if(H5Tequal(type, H5T_STD_U8BE)) parallel_print("H5T_STD_U8BE"); - } else if (H5Tequal(type, H5T_STD_U8LE)) { + else if(H5Tequal(type, H5T_STD_U8LE)) parallel_print("H5T_STD_U8LE"); - } else if (H5Tequal(type, H5T_STD_U16BE)) { + else if(H5Tequal(type, H5T_STD_U16BE)) parallel_print("H5T_STD_U16BE"); - } else if (H5Tequal(type, H5T_STD_U16LE)) { + else if(H5Tequal(type, H5T_STD_U16LE)) parallel_print("H5T_STD_U16LE"); - } else if (H5Tequal(type, H5T_STD_U32BE)) { + else if(H5Tequal(type, H5T_STD_U32BE)) parallel_print("H5T_STD_U32BE"); - } else if (H5Tequal(type, H5T_STD_U32LE)) { + else if(H5Tequal(type, H5T_STD_U32LE)) parallel_print("H5T_STD_U32LE"); - } else if (H5Tequal(type, H5T_STD_U64BE)) { + else if(H5Tequal(type, H5T_STD_U64BE)) parallel_print("H5T_STD_U64BE"); - } else if (H5Tequal(type, H5T_STD_U64LE)) { + else if(H5Tequal(type, H5T_STD_U64LE)) parallel_print("H5T_STD_U64LE"); - } else if (H5Tequal(type, H5T_NATIVE_SCHAR)) { + else if(H5Tequal(type, H5T_NATIVE_SCHAR)) parallel_print("H5T_NATIVE_SCHAR"); - } else if (H5Tequal(type, H5T_NATIVE_UCHAR)) { + else if(H5Tequal(type, H5T_NATIVE_UCHAR)) parallel_print("H5T_NATIVE_UCHAR"); - } else if (H5Tequal(type, H5T_NATIVE_SHORT)) { + else if(H5Tequal(type, H5T_NATIVE_SHORT)) parallel_print("H5T_NATIVE_SHORT"); - } else if (H5Tequal(type, H5T_NATIVE_USHORT)) { + else if(H5Tequal(type, H5T_NATIVE_USHORT)) parallel_print("H5T_NATIVE_USHORT"); - } else if (H5Tequal(type, H5T_NATIVE_INT)) { + else if(H5Tequal(type, H5T_NATIVE_INT)) parallel_print("H5T_NATIVE_INT"); - } else if (H5Tequal(type, H5T_NATIVE_UINT)) { + else if(H5Tequal(type, H5T_NATIVE_UINT)) parallel_print("H5T_NATIVE_UINT"); - } else if (H5Tequal(type, H5T_NATIVE_LONG)) { + else if(H5Tequal(type, H5T_NATIVE_LONG)) parallel_print("H5T_NATIVE_LONG"); - } else if (H5Tequal(type, H5T_NATIVE_ULONG)) { + else if(H5Tequal(type, H5T_NATIVE_ULONG)) parallel_print("H5T_NATIVE_ULONG"); - } else if (H5Tequal(type, H5T_NATIVE_LLONG)) { + else if(H5Tequal(type, H5T_NATIVE_LLONG)) parallel_print("H5T_NATIVE_LLONG"); - } else if (H5Tequal(type, H5T_NATIVE_ULLONG)) { + else if(H5Tequal(type, H5T_NATIVE_ULLONG)) parallel_print("H5T_NATIVE_ULLONG"); - } else { + else parallel_print("undefined integer"); - } break; case H5T_FLOAT: - if (H5Tequal(type, H5T_IEEE_F32BE)) { + if(H5Tequal(type, H5T_IEEE_F32BE)) parallel_print("H5T_IEEE_F32BE"); - } else if (H5Tequal(type, H5T_IEEE_F32LE)) { + else if(H5Tequal(type, H5T_IEEE_F32LE)) parallel_print("H5T_IEEE_F32LE"); - } else if (H5Tequal(type, H5T_IEEE_F64BE)) { + else if(H5Tequal(type, H5T_IEEE_F64BE)) parallel_print("H5T_IEEE_F64BE"); - } else if (H5Tequal(type, H5T_IEEE_F64LE)) { + else if(H5Tequal(type, H5T_IEEE_F64LE)) parallel_print("H5T_IEEE_F64LE"); - } else if (H5Tequal(type, H5T_NATIVE_FLOAT)) { + else if(H5Tequal(type, H5T_NATIVE_FLOAT)) parallel_print("H5T_NATIVE_FLOAT"); - } else if (H5Tequal(type, H5T_NATIVE_DOUBLE)) { + else if(H5Tequal(type, H5T_NATIVE_DOUBLE)) parallel_print("H5T_NATIVE_DOUBLE"); #if H5_SIZEOF_LONG_DOUBLE !=0 - } else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) { + else if(H5Tequal(type, H5T_NATIVE_LDOUBLE)) parallel_print("H5T_NATIVE_LDOUBLE"); #endif - } else { + else parallel_print("undefined float"); - } break; case H5T_BITFIELD: - if (H5Tequal(type, H5T_STD_B8BE)) { + if(H5Tequal(type, H5T_STD_B8BE)) parallel_print("H5T_STD_B8BE"); - } else if (H5Tequal(type, H5T_STD_B8LE)) { + else if(H5Tequal(type, H5T_STD_B8LE)) parallel_print("H5T_STD_B8LE"); - } else if (H5Tequal(type, H5T_STD_B16BE)) { + else if(H5Tequal(type, H5T_STD_B16BE)) parallel_print("H5T_STD_B16BE"); - } else if (H5Tequal(type, H5T_STD_B16LE)) { + else if(H5Tequal(type, H5T_STD_B16LE)) parallel_print("H5T_STD_B16LE"); - } else if (H5Tequal(type, H5T_STD_B32BE)) { + else if(H5Tequal(type, H5T_STD_B32BE)) parallel_print("H5T_STD_B32BE"); - } else if (H5Tequal(type, H5T_STD_B32LE)) { + else if(H5Tequal(type, H5T_STD_B32LE)) parallel_print("H5T_STD_B32LE"); - } else if (H5Tequal(type, H5T_STD_B64BE)) { + else if(H5Tequal(type, H5T_STD_B64BE)) parallel_print("H5T_STD_B64BE"); - } else if (H5Tequal(type, H5T_STD_B64LE)) { + else if(H5Tequal(type, H5T_STD_B64LE)) parallel_print("H5T_STD_B64LE"); - } else { + else parallel_print("undefined bitfield"); - } break; case H5T_TIME: @@ -210,16 +201,16 @@ diff_basename(const char *name) { size_t i; - if (name == NULL) + if(name == NULL) return NULL; /* Find the end of the base name */ i = HDstrlen(name); - while (i > 0 && '/' == name[i - 1]) + while(i > 0 && '/' == name[i - 1]) --i; /* Skip backward over base name */ - while (i > 0 && '/' != name[i - 1]) + while(i > 0 && '/' != name[i - 1]) --i; return(name+i); @@ -277,7 +268,7 @@ get_type(h5trav_type_t type) H5_ATTR_PURE const char* get_sign(H5T_sign_t sign) { - switch (sign) + switch(sign) { case H5T_SGN_NONE: return "H5T_SGN_NONE"; @@ -312,7 +303,7 @@ get_sign(H5T_sign_t sign) H5_ATTR_PURE const char* get_class(H5T_class_t tclass) { - switch (tclass) { + switch(tclass) { case H5T_TIME: return("H5T_TIME"); @@ -382,14 +373,11 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, { herr_t ret = SUCCEED; - if( (*m_size1) != (*m_size2) ) - { - if( (*m_size1) < (*m_size2) ) - { + if((*m_size1) != (*m_size2)) { + if((*m_size1) < (*m_size2)) { H5Tclose( *m_tid1 ); - if(( (*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) - { + if(((*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) { ret = FAIL; goto out; } @@ -399,8 +387,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, else { H5Tclose(*m_tid2); - if(( (*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) - { + if(((*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) { ret = FAIL; goto out; } @@ -408,7 +395,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, *m_size2 = H5Tget_size(*m_tid2); } /* end else */ } /* end if */ - HDassert( (*m_size1) == (*m_size2) ); + HDassert((*m_size1) == (*m_size2)); out: return ret; -- cgit v0.12 From 7dc0c79c543321b1a22a35926b90f10cb3ad8e9c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 May 2017 12:20:15 -0500 Subject: HDFFV-10186 - h5tools_str_append is not printf --- tools/lib/h5tools_str.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 7396e8c..b7a2c1e 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -746,7 +746,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai size_t i; if(1 == nsize) - h5tools_str_append(str, OPT(info->fmt_raw, "%#02x"), ucp_vp[0]); + h5tools_str_append(str, OPT(info->fmt_raw, "0x%02x"), ucp_vp[0]); else for(i = 0; i < nsize; i++) { if(i) @@ -1100,7 +1100,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else { size_t i; if(1 == nsize) - h5tools_str_append(str, "%#02x", ucp_vp[0]); + h5tools_str_append(str, "0x%02x", ucp_vp[0]); else for(i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); @@ -1283,7 +1283,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai /* All other types get printed as hexadecimal */ size_t i; if(1 == nsize) - h5tools_str_append(str, "%#02x", ucp_vp[0]); + h5tools_str_append(str, "0x%02x", ucp_vp[0]); else for(i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); -- cgit v0.12 From ec0935a924a84b18b29473b4fcec7c3f4e1aca76 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 May 2017 12:45:06 -0500 Subject: HDFFV-10186 xml test also needs endianess aware files --- MANIFEST | 3 +- tools/test/h5dump/CMakeTestsXML.cmake | 15 +++-- tools/test/h5dump/testh5dumpxml.sh.in | 9 ++- tools/testfiles/tbitfields.h5.xml | 103 ---------------------------------- tools/testfiles/tbitfields_be.h5.xml | 103 ++++++++++++++++++++++++++++++++++ tools/testfiles/tbitfields_le.h5.xml | 103 ++++++++++++++++++++++++++++++++++ 6 files changed, 226 insertions(+), 110 deletions(-) delete mode 100644 tools/testfiles/tbitfields.h5.xml create mode 100644 tools/testfiles/tbitfields_be.h5.xml create mode 100644 tools/testfiles/tbitfields_le.h5.xml diff --git a/MANIFEST b/MANIFEST index 9e7fa72..e448a44 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2080,7 +2080,8 @@ ./tools/testfiles/tarray6.h5.xml ./tools/testfiles/tarray7.h5.xml ./tools/testfiles/tattr.h5.xml -./tools/testfiles/tbitfields.h5.xml +./tools/testfiles/tbitfields_be.h5.xml +./tools/testfiles/tbitfields_le.h5.xml ./tools/testfiles/tcompound.h5.xml ./tools/testfiles/tcompound2.h5.xml ./tools/testfiles/tcompound_complex.h5.xml diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index c353e48..92e08a0 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -81,7 +81,8 @@ ${HDF5_TOOLS_DIR}/testfiles/tarray6.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tarray7.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tattr.h5.xml - ${HDF5_TOOLS_DIR}/testfiles/tbitfields.h5.xml + ${HDF5_TOOLS_DIR}/testfiles/tbitfields_be.h5.xml + ${HDF5_TOOLS_DIR}/testfiles/tbitfields_le.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tcompound_complex.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tcompound.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tcompound2.h5.xml @@ -221,8 +222,10 @@ tarray7.h5.out.err tattr.h5.out tattr.h5.out.err - tbitfields.h5.out - tbitfields.h5.out.err + tbitfields_be.h5.out + tbitfields_be.h5.out.err + tbitfields_le.h5.out + tbitfields_le.h5.out.err tcompound.h5.out tcompound.h5.out.err tcompound2.h5.out @@ -344,7 +347,11 @@ ########## test XML ADD_XML_H5_TEST (tall.h5 0 tall.h5) ADD_XML_H5_TEST (tattr.h5 0 tattr.h5) - ADD_XML_H5_TEST (tbitfields.h5 0 tbitfields.h5) + if (H5_WORDS_BIGENDIAN) + ADD_XML_H5_TEST (tbitfields_be.h5 0 tbitfields.h5) + else () + ADD_XML_H5_TEST (tbitfields_le.h5 0 tbitfields.h5) + endif () ADD_XML_H5_TEST (tcompound.h5 0 tcompound.h5) ADD_XML_H5_TEST (tcompound2.h5 0 tcompound2.h5) ADD_XML_H5_TEST (tdatareg.h5 0 tdatareg.h5) diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index a33f5bc..d0fad63 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -124,7 +124,8 @@ $SRC_H5DUMP_TESTFILES/tarray3.h5.xml $SRC_H5DUMP_TESTFILES/tarray6.h5.xml $SRC_H5DUMP_TESTFILES/tarray7.h5.xml $SRC_H5DUMP_TESTFILES/tattr.h5.xml -$SRC_H5DUMP_TESTFILES/tbitfields.h5.xml +$SRC_H5DUMP_TESTFILES/tbitfields_be.h5.xml +$SRC_H5DUMP_TESTFILES/tbitfields_le.h5.xml $SRC_H5DUMP_TESTFILES/tcompound_complex.h5.xml $SRC_H5DUMP_TESTFILES/tcompound.h5.xml $SRC_H5DUMP_TESTFILES/tcompound2.h5.xml @@ -299,7 +300,11 @@ COPY_TESTFILES_TO_TESTDIR # test XML TOOLTEST tall.h5.xml --xml tall.h5 TOOLTEST tattr.h5.xml --xml tattr.h5 -TOOLTEST tbitfields.h5.xml --xml tbitfields.h5 +if test $WORDS_BIGENDIAN != "yes"; then +TOOLTEST tbitfields_le.h5.xml --xml tbitfields.h5 +else +TOOLTEST tbitfields_be.h5.xml --xml tbitfields.h5 +fi TOOLTEST tcompound.h5.xml --xml tcompound.h5 TOOLTEST tcompound2.h5.xml --xml tcompound2.h5 TOOLTEST tdatareg.h5.xml --xml tdatareg.h5 diff --git a/tools/testfiles/tbitfields.h5.xml b/tools/testfiles/tbitfields.h5.xml deleted file mode 100644 index c8ba026..0000000 --- a/tools/testfiles/tbitfields.h5.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - 0xff - 0xfe - 0xfd - 0xfc - 0xfb - 0xfa - 0xf9 - 0xf8 - 0xf7 - 0xf6 - 0xf5 - 0xf4 - 0xf3 - 0xf2 - 0xf1 - 0xf0 - 0xef - 0xee - 0xed - 0xec - 0xeb - 0xea - 0xe9 - 0xe8 - 0xe7 - 0xe6 - 0xe5 - 0xe4 - 0xe3 - 0xe2 - 0xe1 - 0xe0 - - - - - - - - - - - - - - - - - - - - - - - - - ff:fe - fd:fc - fb:fa - f9:f8 - f7:f6 - f5:f4 - f3:f2 - f1:f0 - ef:ee - ed:ec - eb:ea - e9:e8 - e7:e6 - e5:e4 - e3:e2 - e1:e0 - - - - - - diff --git a/tools/testfiles/tbitfields_be.h5.xml b/tools/testfiles/tbitfields_be.h5.xml new file mode 100644 index 0000000..26bbd91 --- /dev/null +++ b/tools/testfiles/tbitfields_be.h5.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 0xff + 0xfe + 0xfd + 0xfc + 0xfb + 0xfa + 0xf9 + 0xf8 + 0xf7 + 0xf6 + 0xf5 + 0xf4 + 0xf3 + 0xf2 + 0xf1 + 0xf0 + 0xef + 0xee + 0xed + 0xec + 0xeb + 0xea + 0xe9 + 0xe8 + 0xe7 + 0xe6 + 0xe5 + 0xe4 + 0xe3 + 0xe2 + 0xe1 + 0xe0 + + + + + + + + + + + + + + + + + + + + + + + + + fe:ff + fc:fd + fa:fb + f8:f9 + f6:f7 + f4:f5 + f2:f3 + f0:f1 + ee:ef + ec:ed + ea:eb + e8:e9 + e6:e7 + e4:e5 + e2:e3 + e0:e1 + + + + + + diff --git a/tools/testfiles/tbitfields_le.h5.xml b/tools/testfiles/tbitfields_le.h5.xml new file mode 100644 index 0000000..c8ba026 --- /dev/null +++ b/tools/testfiles/tbitfields_le.h5.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 0xff + 0xfe + 0xfd + 0xfc + 0xfb + 0xfa + 0xf9 + 0xf8 + 0xf7 + 0xf6 + 0xf5 + 0xf4 + 0xf3 + 0xf2 + 0xf1 + 0xf0 + 0xef + 0xee + 0xed + 0xec + 0xeb + 0xea + 0xe9 + 0xe8 + 0xe7 + 0xe6 + 0xe5 + 0xe4 + 0xe3 + 0xe2 + 0xe1 + 0xe0 + + + + + + + + + + + + + + + + + + + + + + + + + ff:fe + fd:fc + fb:fa + f9:f8 + f7:f6 + f5:f4 + f3:f2 + f1:f0 + ef:ee + ed:ec + eb:ea + e9:e8 + e7:e6 + e5:e4 + e3:e2 + e1:e0 + + + + + + -- cgit v0.12 From c8a5520d3aa3a526460c81507f2f985dc534b14f Mon Sep 17 00:00:00 2001 From: lrknox Date: Wed, 10 May 2017 14:44:58 -0500 Subject: Call to H5Dopen has H5dopen2 arguments at line 12704 of test/dsets.c - changed to H5Dopen2 to fix failure with --with-default-api-version=v16 configure option. --- test/dsets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dsets.c b/test/dsets.c index ad014a6..ba0ad82 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -12701,7 +12701,7 @@ test_compact_open_close_dirty(hid_t fapl) /* Verify the repeated open/close of the dataset will not fail */ for(i = 0; i < 20;i++) { H5E_BEGIN_TRY { - did = H5Dopen (fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT); + did = H5Dopen2 (fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT); } H5E_END_TRY; if(did < 0) TEST_ERROR -- cgit v0.12 From 0cb8152b8e97d659e076b42340509c41b3919754 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 11 May 2017 09:03:21 -0500 Subject: HDFFV-10186 Need to pull the flag into the script --- tools/test/h5dump/testh5dump.sh.in | 2 ++ tools/test/h5dump/testh5dumpxml.sh.in | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index ef6c4d8..1136742 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -42,6 +42,8 @@ AWK='awk' # Skip plugin module to test missing filter ENVCMD="env HDF5_PLUGIN_PRELOAD=::" +WORDS_BIGENDIAN="@WORDS_BIGENDIAN@" + nerrors=0 verbose=yes diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index d0fad63..5f62946 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -30,6 +30,8 @@ DIRNAME='dirname' LS='ls' AWK='awk' +WORDS_BIGENDIAN="@WORDS_BIGENDIAN@" + nerrors=0 verbose=yes -- cgit v0.12 From f95ef72a5e9827dfa63e4722938a58a8c9d686c0 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 11 May 2017 23:31:57 -0400 Subject: Merged HDFFV-10187 direct chunk overwrite bugfix to develop from 1.10 branch. --- hl/test/test_dset_opt.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++ src/H5Dchunk.c | 16 ++++--- 2 files changed, 125 insertions(+), 5 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index d3a6b5c..b868a2a 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -32,6 +32,7 @@ #define DATASETNAME4 "data_conv" #define DATASETNAME5 "contiguous_dset" #define DATASETNAME6 "invalid_argue" +#define DATASETNAME7 "overwrite_chunk" #define RANK 2 #define NX 16 #define NY 16 @@ -46,6 +47,13 @@ #define ADD_ON 7 #define FACTOR 3 +/* Constants for the overwrite test */ +#define OVERWRITE_NDIMS 3 +#define OVERWRITE_CHUNK_NX 3 +#define OVERWRITE_CHUNK_2NX 6 +#define OVERWRITE_CHUNK_NY 2 +#define OVERWRITE_VALUE 42 + /* Local prototypes for filter functions */ static size_t filter_bogus1(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); @@ -499,6 +507,111 @@ error: #endif /* H5_HAVE_FILTER_DEFLATE */ /*------------------------------------------------------------------------- + * Function: test_direct_chunk_overwrite_data + * + * Purpose: Test overwriting a chunk with new data. + * + * Return: Success: 0 + * Failure: 1 + * + * Programmer: Dana Robinson + * Spring 2017 + * + *------------------------------------------------------------------------- + */ +static int +test_direct_chunk_overwrite_data(hid_t fid) +{ + size_t buf_size = OVERWRITE_CHUNK_NX * OVERWRITE_CHUNK_NY * sizeof(int16_t); + int16_t data_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_NX]; + int16_t overwrite_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_NX]; + uint32_t filter_mask = 0; + hid_t tid = H5T_NATIVE_UINT16; + hid_t dcpl_id = -1; + hid_t sid = -1; + hid_t did = -1; + uint16_t fill_value = 0; + hsize_t dset_dims[] = {1, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_2NX}; + hsize_t dset_max_dims[] = {H5S_UNLIMITED, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_2NX}; + hsize_t chunk_dims[] = {1, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_NX}; + hsize_t offset[] = {0, 0, 0}; + hsize_t i, j; + int16_t n; + int16_t read_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_2NX]; + + TESTING("overwriting existing data with H5DOwrite_chunk"); + + /* Create the dataset's data space */ + if ((sid = H5Screate_simple(OVERWRITE_NDIMS, dset_dims, dset_max_dims)) < 0) + FAIL_STACK_ERROR + + /* Set chunk size and filll value */ + if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + FAIL_STACK_ERROR + if (H5Pset_fill_value(dcpl_id, tid, &fill_value) < 0) + FAIL_STACK_ERROR + if (H5Pset_chunk(dcpl_id, OVERWRITE_NDIMS, chunk_dims) < 0) + FAIL_STACK_ERROR + + /* Create dataset */ + if ((did = H5Dcreate2(fid, DATASETNAME7, tid, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Initialize data buffers */ + n = 0; + for (i = 0; i < OVERWRITE_CHUNK_NY; i++) { + for (j = 0; j < OVERWRITE_CHUNK_NX; j++) { + data_buf[i][j] = n++; + overwrite_buf[i][j] = OVERWRITE_VALUE; + } + } + + /* Write chunk data using the direct write function. */ + if (H5DOwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, buf_size, data_buf) < 0) + FAIL_STACK_ERROR + + /* Write second chunk. */ + offset[2] = OVERWRITE_CHUNK_NX; + if (H5DOwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, buf_size, data_buf) < 0) + FAIL_STACK_ERROR + + /* Overwrite first chunk. */ + offset[2] = 0; + if (H5DOwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, buf_size, overwrite_buf) < 0) + FAIL_STACK_ERROR + + /* Read the data back out */ + if (H5Dread(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) + FAIL_STACK_ERROR + + /* Ensure that the data are correct in chunk 1 */ + for (i = 0; i < OVERWRITE_CHUNK_NY; i++) + for (j = 0; j < OVERWRITE_CHUNK_NX; j++) { + if (read_buf[i][j] != OVERWRITE_VALUE) + TEST_ERROR + } + + if (H5Pclose(dcpl_id) < 0) + FAIL_STACK_ERROR + if (H5Sclose(sid) < 0) + FAIL_STACK_ERROR + if (H5Dclose(did) < 0) + FAIL_STACK_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Pclose(dcpl_id); + H5Sclose(sid); + H5Dclose(did); + } H5E_END_TRY; + + return 1; +} /* end test_direct_chunk_overwrite_data() */ + +/*------------------------------------------------------------------------- * Function: test_skip_compress_write1 * * Purpose: Test skipping compression filter when it is the only filter @@ -1409,6 +1522,7 @@ int main( void ) #ifdef H5_HAVE_FILTER_DEFLATE nerrors += test_direct_chunk_write(file_id); #endif /* H5_HAVE_FILTER_DEFLATE */ + nerrors += test_direct_chunk_overwrite_data(file_id); nerrors += test_skip_compress_write1(file_id); nerrors += test_skip_compress_write2(file_id); nerrors += test_data_conv(file_id); diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 2523c5d..f02c69f 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -445,11 +445,17 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, /* Set up the size of chunk for user data */ udata.chunk_block.length = data_size; - /* Create the chunk it if it doesn't exist, or reallocate the chunk - * if its size changed. - */ - if(H5D__chunk_file_alloc(&idx_info, &old_chunk, &udata.chunk_block, &need_insert, scaled) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") + if (0 == idx_info.pline->nused && H5F_addr_defined(old_chunk.offset)) { + /* If there are no filters and we are overwriting the chunk we can just set values */ + need_insert = FALSE; + } + else { + /* Otherwise, create the chunk it if it doesn't exist, or reallocate the chunk + * if its size has changed. + */ + if (H5D__chunk_file_alloc(&idx_info, &old_chunk, &udata.chunk_block, &need_insert, scaled) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") + } /* Make sure the address of the chunk is returned. */ if(!H5F_addr_defined(udata.chunk_block.offset)) -- cgit v0.12 From 7078993d63aab4e239e4ae9c970b4b19d38352fa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 12 May 2017 14:40:39 -0500 Subject: HDFFV-10128 Fix null term strings --- tools/lib/h5diff_array.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 49f41dc..bb2cd8a 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -623,6 +623,7 @@ static hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ case H5T_COMPOUND: + h5difftrace("diff_datum H5T_COMPOUND\n"); nmembs = members->n; @@ -655,18 +656,19 @@ static hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ case H5T_STRING: - + h5difftrace("diff_datum H5T_STRING\n"); { - H5T_str_t pad; char *s; char *s1; char *s2; size_t size1; size_t size2; - + H5T_str_t pad = H5Tget_strpad(m_type); + /* if variable length string */ if(H5Tis_variable_str(m_type)) { + h5difftrace("diff_datum H5T_STRING variable\n"); /* Get pointer to first string */ s1 = *(char**) mem1; size1 = HDstrlen(s1); @@ -674,6 +676,15 @@ static hsize_t diff_datum(void *_mem1, s2 = *(char**) mem2; size2 = HDstrlen(s2); } + else if (H5T_STR_NULLTERM == pad) { + h5difftrace("diff_datum H5T_STRING null term\n"); + /* Get pointer to first string */ + s1 = (char*) mem1; + size1 = HDstrlen(s1); + /* Get pointer to second string */ + s2 = (char*) mem2; + size2 = HDstrlen(s2); + } else { /* Get pointer to first string */ @@ -714,9 +725,6 @@ static hsize_t diff_datum(void *_mem1, /* try fast compare first */ if (HDmemcmp(s1, s2, size)==0) break; - - pad = H5Tget_strpad(m_type); - for (u=0; u Date: Mon, 15 May 2017 10:25:15 -0500 Subject: Incorporate additional code changes for the H5DOread_chunk patch from GE Heathcare (HDFFV-9934) This is the similar set of changes that was checked in to 1.8 branch: Incorporate the code changes that were missing from the original patch: (1) Additional tests in hl/test/test_dset_opt.c (2) Fix in src/H5Dchunk.c for direct access when an entry is in chunk cache but not dirty Tested on platypus, ostrich, kituo, mayll, osx1010test, moohan, quail, emu. --- hl/test/test_dset_opt.c | 1188 +++++++++++++++++++++++++++++++++-------------- src/H5Dchunk.c | 43 +- 2 files changed, 859 insertions(+), 372 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index b868a2a..4b5fa19 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -26,6 +26,7 @@ #define FILE_NAME "test_dectris.h5" +/* Datasets for Direct Write tests */ #define DATASETNAME1 "direct_write" #define DATASETNAME2 "skip_one_filter" #define DATASETNAME3 "skip_two_filters" @@ -33,13 +34,20 @@ #define DATASETNAME5 "contiguous_dset" #define DATASETNAME6 "invalid_argue" #define DATASETNAME7 "overwrite_chunk" +/* Datasets for Direct Read tests */ +#define DATASETNAME8 "disabled_chunk_cache" +#define DATASETNAME9 "flush_chunk_cache" +#define DATASETNAME10 "read_w_valid_cache" +#define DATASETNAME11 "unallocated_chunk" +#define DATASETNAME12 "unfiltered_data" + #define RANK 2 #define NX 16 #define NY 16 #define CHUNK_NX 4 #define CHUNK_NY 4 -#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*(double)1.001F)+12) +#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*1.001)+12) /* Temporary filter IDs used for testing */ #define H5Z_FILTER_BOGUS1 305 @@ -84,10 +92,10 @@ const H5Z_class2_t H5Z_BOGUS2[1] = {{ /*------------------------------------------------------------------------- * Function: test_direct_chunk_write * - * Purpose: Test the basic functionality of H5DOwrite_chunk/H5DOread_chunk + * Purpose: Test the basic functionality of H5DOwrite_chunk * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * * Programmer: Raymond Lu * 30 November 2012 @@ -110,31 +118,24 @@ test_direct_chunk_write (hid_t file) int i, j, n; unsigned filter_mask = 0; - unsigned read_filter_mask = 0; int direct_buf[CHUNK_NX][CHUNK_NY]; int check_chunk[CHUNK_NX][CHUNK_NY]; hsize_t offset[2] = {0, 0}; size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); const Bytef *z_src = (const Bytef*)(direct_buf); - Bytef *z_dst; /*destination buffer */ + Bytef *z_dst = NULL; /*destination buffer */ uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size); uLong z_src_nbytes = (uLong)buf_size; - int aggression = 9; /* Compression aggression setting */ - void *outbuf = NULL; /* Pointer to new buffer */ - - /* For H5DOread_chunk() */ - void *readbuf = NULL; /* Buffer for reading data */ - const Bytef *pt_readbuf; /* Point to the buffer for data read */ - hsize_t read_chunk_nbytes; /* Size of chunk on disk */ - int read_dst_buf[CHUNK_NX][CHUNK_NY]; /* Buffer to hold un-compressed data */ + int aggression = 9; /* Compression aggression setting */ + void *outbuf = NULL; /* Pointer to new buffer */ hsize_t start[2]; /* Start of hyperslab */ hsize_t stride[2]; /* Stride of hyperslab */ hsize_t count[2]; /* Block count */ hsize_t block[2]; /* Block sizes */ - TESTING("basic functionality of H5DOwrite_chunk/H5DOread_chunk"); + TESTING("basic functionality of H5DOwrite_chunk"); /* * Create the data space with unlimited dimensions. @@ -165,76 +166,26 @@ test_direct_chunk_write (hid_t file) cparms, H5P_DEFAULT)) < 0) goto error; + /* Initialize the dataset */ + for(i = n = 0; i < NX; i++) + for(j = 0; j < NY; j++) + data[i][j] = n++; + if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; - HDmemset(data, 0, sizeof(data)); - /* Initialize data for the first chunk */ - for(i = n = 0; i < CHUNK_NX; i++) - for(j = 0; j < CHUNK_NY; j++) - data[i][j] = n++; - /* - * Write the data for the dataset. */ + * Write the data for the dataset. It should stay in the chunk cache. + * It will be evicted from the cache by the H5DOwrite_chunk calls. + */ if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, data)) < 0) goto error; - if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) - goto error; - - if(H5Dclose(dataset) < 0) - goto error; - - if((dataset = H5Dopen2(file, DATASETNAME1, H5P_DEFAULT)) < 0) - goto error; - - offset[0] = offset[1] = 0; - - /* Get the size of the compressed chunk */ - ret = H5Dget_chunk_storage_size(dataset, offset, &read_chunk_nbytes); - - readbuf = HDmalloc(read_chunk_nbytes); - pt_readbuf = (const Bytef *)readbuf; - - /* Test to use H5DOread_chunk() to read the chunk back */ - if((status = H5DOread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, readbuf)) < 0) - goto error; - - /* uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) */ - ret = uncompress((Bytef *)read_dst_buf, (uLongf *)&buf_size, pt_readbuf, (uLong)read_chunk_nbytes); - - /* Check for various zlib errors */ - if(Z_BUF_ERROR == ret) { - HDfprintf(stderr, "error: not enough room in output buffer"); - goto error; - } else if(Z_MEM_ERROR == ret) { - HDfprintf(stderr, "error: not enough memory"); - goto error; - } else if(Z_OK != ret) { - HDfprintf(stderr, "error: corrupted input data"); - goto error; - } - - /* Check that the values read are the same as the values written */ - for(i = 0; i < CHUNK_NX; i++) { - for(j = 0; j < CHUNK_NY; j++) { - if(data[i][j] != read_dst_buf[i][j]) { - printf(" 1. Read different values than written."); - printf(" At index %d,%d\n", i, j); - printf(" data=%d, read_dst_buf=%d\n", data[i][j], read_dst_buf[i][j]); - goto error; - } - } - } - - if(readbuf) - HDfree(readbuf); - /* Initialize data for one chunk */ for(i = n = 0; i < CHUNK_NX; i++) for(j = 0; j < CHUNK_NY; j++) - direct_buf[i][j] = n++; + direct_buf[i][j] = n++; /* Allocate output (compressed) buffer */ outbuf = HDmalloc(z_dst_nbytes); @@ -255,8 +206,8 @@ test_direct_chunk_write (hid_t file) goto error; } - /* Write the compressed chunk data repeatedly to cover all the chunks in the - * dataset, using the direct writing function. */ + /* Write the compressed chunk data repeatedly to cover all the chunks in the + * dataset, using the direct writing function. */ for(i=0; islot[udata.idx_hint]; + hbool_t flush; /* Sanity checks */ HDassert(udata.idx_hint < rdcc->nslots); HDassert(rdcc->slot[udata.idx_hint]); - /* If the cached chunk is dirty, it must be flushed to get accurate size */ - if( ent->dirty == TRUE ) { + flush = (ent->dirty == TRUE) ? TRUE : FALSE; - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(io_info.raw_dxpl_id, &dxpl_cache) < 0) + /* Fill the DXPL cache values for later use */ + if(H5D__get_dxpl_cache(io_info.raw_dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Flush the chunk to disk and clear the cache entry */ - if(H5D__chunk_cache_evict(dset, io_info.md_dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") + /* Flush the chunk to disk and clear the cache entry */ + if(H5D__chunk_cache_evict(dset, io_info.md_dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], flush) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") - /* Reset fields about the chunk we are looking for */ - udata.filter_mask = 0; - udata.chunk_block.offset = HADDR_UNDEF; - udata.chunk_block.length = 0; - udata.idx_hint = UINT_MAX; + /* Reset fields about the chunk we are looking for */ + udata.filter_mask = 0; + udata.chunk_block.offset = HADDR_UNDEF; + udata.chunk_block.length = 0; + udata.idx_hint = UINT_MAX; - /* Get the new file address / chunk size after flushing */ - if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") - } + /* Get the new file address / chunk size after flushing */ + if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") } /* Make sure the address of the chunk is returned. */ @@ -648,6 +649,8 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h HDassert(offset); HDassert(storage_size); + *storage_size = 0; + io_info.dset = dset; io_info.raw_dxpl_id = dxpl_id; io_info.md_dxpl_id = dxpl_id; @@ -660,10 +663,8 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h #endif /* H5_DEBUG_BUILD */ /* Allocate dataspace and initialize it if it hasn't been. */ - if(!(*layout->ops->is_space_alloc)(&layout->storage)) { - *storage_size = 0; + if(!(*layout->ops->is_space_alloc)(&layout->storage)) HGOTO_DONE(SUCCEED) - } /* Calculate the index of this chunk */ H5VM_chunk_scaled(dset->shared->ndims, offset, layout->u.chunk.dim, scaled); @@ -2955,7 +2956,7 @@ H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *scaled, /* Check for chunk in cache */ if(dset->shared->cache.chunk.nslots > 0) { /* Determine the chunk's location in the hash table */ - idx = H5D__chunk_hash_val(dset->shared, scaled); + idx = H5D__chunk_hash_val(dset->shared, scaled); /* Get the chunk cache entry for that location */ ent = dset->shared->cache.chunk.slot[idx]; @@ -2979,7 +2980,7 @@ H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *scaled, udata->idx_hint = idx; udata->chunk_block.offset = ent->chunk_block.offset; udata->chunk_block.length = ent->chunk_block.length;; - udata->chunk_idx = ent->chunk_idx; + udata->chunk_idx = ent->chunk_idx; } /* end if */ else { /* Invalidate idx_hint, to signal that the chunk is not in cache */ -- cgit v0.12 From 56c3ec98207bb6c4b3e6a7b9523c2a1e849879c3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 15 May 2017 12:33:58 -0500 Subject: HDFFV-10128 add test to check null term Test is another dataset --- tools/lib/h5diff_array.c | 87 ++++++++++++++++----------- tools/test/h5diff/CMakeTests.cmake | 2 +- tools/test/h5diff/h5diffgentest.c | 28 +++++++++ tools/test/h5diff/testfiles/diff_strings1.h5 | Bin 4464 -> 4640 bytes tools/test/h5diff/testfiles/diff_strings2.h5 | Bin 4464 -> 4640 bytes tools/test/h5diff/testfiles/h5diff_tmp1.txt | 14 ++++- 6 files changed, 94 insertions(+), 37 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index bb2cd8a..0a9d18a 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -658,16 +658,17 @@ static hsize_t diff_datum(void *_mem1, case H5T_STRING: h5difftrace("diff_datum H5T_STRING\n"); { - char *s; - char *s1; - char *s2; - size_t size1; - size_t size2; - H5T_str_t pad = H5Tget_strpad(m_type); - + char *s = NULL; + char *sx = NULL; + char *s1 = NULL; + char *s2 = NULL; + size_t size1; + size_t size2; + size_t sizex; + H5T_str_t pad = H5Tget_strpad(m_type); + /* if variable length string */ - if(H5Tis_variable_str(m_type)) - { + if(H5Tis_variable_str(m_type)) { h5difftrace("diff_datum H5T_STRING variable\n"); /* Get pointer to first string */ s1 = *(char**) mem1; @@ -685,8 +686,7 @@ static hsize_t diff_datum(void *_mem1, s2 = (char*) mem2; size2 = HDstrlen(s2); } - else - { + else { /* Get pointer to first string */ s1 = (char *)mem1; size1 = H5Tget_size(m_type); @@ -703,42 +703,59 @@ static hsize_t diff_datum(void *_mem1, */ h5diffdebug2("diff_datum string size:%d\n",size1); h5diffdebug2("diff_datum string size:%d\n",size2); - if(size1 != size2) - { + if(size1 != size2) { h5difftrace("diff_datum string sizes\n"); nfound++; } - if(size1 < size2) - { + if(size1 < size2) { size = size1; s = s1; + sizex = size2; + sx = s2; } - else - { + else { size = size2; s = s2; + sizex = size1; + sx = s1; } /* check for NULL pointer for string */ - if(s!=NULL) - { + if(s!=NULL) { /* try fast compare first */ - if (HDmemcmp(s1, s2, size)==0) - break; - for (u=0; u> and > +3 differences found +attribute: > and > +1 differences found +attribute: > and > +1 differences found +attribute: > and > +1 differences found +attribute: > and > +1 differences found +attribute: > and > +1 differences found -------------------------------- Some objects are not comparable -------------------------------- Use -c for a list of objects. -EXIT CODE: 0 +EXIT CODE: 1 -- cgit v0.12 From 2e6d95a1a1dd32a6809b4a584e07b4803b3e4c5d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 16 May 2017 00:27:30 -0400 Subject: Updated the gnu-flags config file to remove gcc 3.x and 4.0 configurations as well as other minor rework and cleanup. --- config/gnu-flags | 695 +++++++------------------------------------------------ 1 file changed, 88 insertions(+), 607 deletions(-) diff --git a/config/gnu-flags b/config/gnu-flags index 44ed480..74cf76f 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -91,13 +91,27 @@ case "$cc_vendor-$cc_version" in ;; esac - # General - H5_CFLAGS="$H5_CFLAGS $arch -std=c99 -pedantic -Wall -W -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs" + # General flags + # + # Note that some of the flags listed here really should be developer + # flags (listed in a separate variable, below) but we put them here + # because they are not raised by the current code and we'd like to + # know if they do start showing up. + # + # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) + # warnings that are emitted. If you need it, add it from the + # environment variable at configure time. + H5_CFLAGS="$H5_CFLAGS $arch -std=c99 -pedantic -Wall -Wextra -Wbad-function-cast -Wc++-compat -Wcast-align" + H5_CFLAGS="$H5_CFLAGS -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal" + H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs" + H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith" + H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum" + H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros-Wunsafe -loop-optimizations -Wwrite-strings" # Production # NDEBUG is handled explicitly by the configure script case "$cc_vendor-$cc_version" in - gcc-[34].*) + gcc-4.*) PROD_CFLAGS= ;; gcc-[56].*) @@ -112,7 +126,7 @@ case "$cc_vendor-$cc_version" in # Debug # NDEBUG is handled explicitly by the configure script - # -g is hanled by the symbols flags + # -g is handled by the symbols flags case "$cc_vendor-$cc_version" in gcc-[56].*) DEBUG_CFLAGS="-ftrapv -fno-common" @@ -121,11 +135,10 @@ case "$cc_vendor-$cc_version" in DEBUG_CFLAGS= ;; esac - #DEBUG_CFLAGS="-fsanitize=undefined" # Developer warnings (suggestions from gcc, not code problems) - DEVELOPER_WARNING_CFLAGS="-Winline -Waggregate-return" - NO_DEVELOPER_WARNING_CFLAGS="-Wno-inline -Wno-aggregate-return" + DEVELOPER_WARNING_CFLAGS="-Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn" + NO_DEVELOPER_WARNING_CFLAGS="-Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn" # Symbols NO_SYMBOLS_CFLAGS="-s" @@ -136,7 +149,7 @@ case "$cc_vendor-$cc_version" in # Optimization case "$cc_vendor-$cc_version" in - gcc-[34].*) + gcc-4.*) HIGH_OPT_CFLAGS="-O3" DEBUG_OPT_CFLAGS= ;; @@ -151,10 +164,6 @@ case "$cc_vendor-$cc_version" in esac NO_OPT_CFLAGS="-O0" - # Try out the new "stack protector" feature introduced in gcc 4.1 - # (We should also think about adding some of the other memory protection options) - #DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all" - # Flags are set cc_flags_set=yes ;; @@ -170,375 +179,169 @@ case "$cc_vendor-$cc_version" in # include and break it out into it's own section, like the other versions # below. -QAK gcc-6*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wnormalized" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - # Append more extra warning flags that only gcc 4.6+ know about + # Append warning flags that only gcc 4.6+ knows about H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" - # Append more extra warning flags that only gcc 4.7+ know about + # Append warning flags that only gcc 4.7+ knows about H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" - # Append more extra warning flags that only gcc 4.8+ know about + # Append warning flags that only gcc 4.8+ knows about DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format" - # Append more extra warning flags that only gcc 4.9+ know about + # Append warning flags that only gcc 4.9+ knows about H5_CFLAGS="$H5_CFLAGS -Wdate-time" - # Append more extra warning flags that only gcc 5.x+ know about + # Append warning flags that only gcc 5.x+ knows about H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat" - # Append more extra warning flags that only gcc 6.x+ know about + # Append warning flags that only gcc 6.x+ knows about H5_CFLAGS="$H5_CFLAGS -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa" ;; gcc-5*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wnormalized" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - # Append more extra warning flags that only gcc 4.6+ know about + # Append warning flags that only gcc 4.6+ knows about H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" - # Append more extra warning flags that only gcc 4.7+ know about + # Append warning flags that only gcc 4.7+ knows about H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" - # Append more extra warning flags that only gcc 4.8+ know about + # Append warning flags that only gcc 4.8+ knows about DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format" - # Append more extra warning flags that only gcc 4.9+ know about + # Append warning flags that only gcc 4.9+ knows about H5_CFLAGS="$H5_CFLAGS -Wdate-time" - # Append more extra warning flags that only gcc 5.x+ know about + # Append warning flags that only gcc 5.x+ knows about H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat" ;; gcc-4.9*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - # Append more extra warning flags that only gcc 4.6+ know about + # Append warning flags that only gcc 4.6+ knows about H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" - # Append more extra warning flags that only gcc 4.7+ know about + # Append warning flags that only gcc 4.7+ knows about H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" - # Append more extra warning flags that only gcc 4.8+ know about + # Append warning flags that only gcc 4.8+ knows about DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format" - # Append more extra warning flags that only gcc 4.9+ know about + # Append warning flags that only gcc 4.9+ knows about H5_CFLAGS="$H5_CFLAGS -Wdate-time" ;; gcc-4.8*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init" - # Append more extra warning flags that only gcc 4.6+ know about + # Append warning flags that only gcc 4.6+ knows about H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" - # Append more extra warning flags that only gcc 4.7+ know about + # Append warning flags that only gcc 4.7+ knows about H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" - # Append more extra warning flags that only gcc 4.8+ know about + # Append warning flags that only gcc 4.8+ knows about DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format" ;; gcc-4.7*) - # Append warning flags - # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # H5_CFLAGS="$H5_CFLAGS -Wtraditional" - # Don't use the '-Wtraditional-conversion' flag, there's too many warnings - # from GCC's assert macro - # H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - # (this warning was removed in gcc 4.5+) - #H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - # Append more extra warning flags that only gcc 4.6+ know about + # Append warning flags that only gcc 4.6+ knows about H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" - # Append more extra warning flags that only gcc 4.7+ know about + # Append warning flags that only gcc 4.7+ knows about H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" @@ -548,57 +351,22 @@ case "$cc_vendor-$cc_version" in # Disable warnings about using 'long long' type H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - # (this warning was removed in gcc 4.5+) - #H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" - # Append more extra warning flags that only gcc 4.6+ know about + # Append warning flags that only gcc 4.6+ knows about H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" @@ -608,54 +376,19 @@ case "$cc_vendor-$cc_version" in # Disable warnings about using 'long long' type H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - # (this warning was removed in gcc 4.5+) - #H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" - # Append more extra warning flags that only gcc 4.5+ know about + # Append warning flags that only gcc 4.5+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" ;; @@ -663,50 +396,16 @@ case "$cc_vendor-$cc_version" in # Disable warnings about using 'long long' type H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow" - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" - # Append more extra warning flags that only gcc 4.4+ know about + # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" ;; @@ -714,44 +413,15 @@ case "$cc_vendor-$cc_version" in # Disable warnings about using 'long long' type H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning appears to be reliable now... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" + # Append warning flags that only gcc 4.1+ knows about + # -Wvolatile-register-var was later incorporated into -Wall and + # needs to be specified explicitly for gcc 4.1-4.3. + H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var" - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wvolatile-register-var" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow" - # Append more extra warning flags that only gcc 4.3+ know about + # Append warning flags that only gcc 4.3+ knows about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK @@ -762,41 +432,12 @@ case "$cc_vendor-$cc_version" in # Disable warnings about using 'long long' type H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" + # Append warning flags that only gcc 4.1+ knows about + # -Wvolatile-register-var was later incorporated into -Wall and + # needs to be specified explicitly for gcc 4.1-4.3. + H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var" - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wvolatile-register-var" - - # Append more extra warning flags that only gcc 4.2+ know about + # Append warning flags that only gcc 4.2+ knows about H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow" ;; @@ -804,172 +445,12 @@ case "$cc_vendor-$cc_version" in # Disable warnings about using 'long long' type H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # Enable more format checking flags, beyond the basic -Wformat included - # in -Wall - H5_CFLAGS="$H5_CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - - # Append more extra warning flags that only gcc 4.1+ know about - H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wvolatile-register-var" - ;; - - gcc-4.0*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append warning flags from gcc-3.4* case - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" - - # Append more extra warning flags that only gcc 4.0+ know about - H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" - ;; - - gcc-3.4*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - - # Append warning flags from gcc-3.3* case - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - - # Append more extra warning flags that only gcc3.4+ know about - H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" - - # Replace old -W flag with new -Wextra flag - H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" + # Append warning flags that only gcc 4.1+ knows about + # -Wvolatile-register-var was later incorporated into -Wall and + # needs to be specified explicitly for gcc 4.1-4.3. + H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var" ;; - gcc-3.3*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append warning flags from gcc-3.2* case - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - - # Append more extra warning flags that only gcc3.3+ know about - H5_CFLAGS="$H5_CFLAGS -Wendif-labels" - ;; - - gcc-3.2*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - - # Append warning flags from gcc-3* case - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - - # Append more extra warning flags that only gcc3.2+ know about - H5_CFLAGS="$H5_CFLAGS -Wpacked -Wdisabled-optimization" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wmissing-noreturn" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-missing-noreturn" - - # The "format=2" warning generates too many warnings about valid - # usage in the library. - #CFLAGS="$CFLAGS -Wformat=2" - - # The "unreachable code" warning does not appear to be reliable yet... - #CFLAGS="$CFLAGS -Wunreachable-code" - ;; - - gcc-3*) - # Disable warnings about using 'long long' type - H5_CFLAGS="$H5_CFLAGS -Wno-long-long" - - # Append some extra warning flags that only gcc3+ know about - # (don't use -Wpadded flag for normal builds, many of the warnings its - # issuing can't be fixed and they are making it hard to detect other, - # more important warnings) - #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" - H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" - ;; esac # Clear cc info if no flags set -- cgit v0.12 From 4f0b92bdd5d35395b3ee0d90a84133032b85e8ff Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 16 May 2017 09:28:49 -0500 Subject: HDFFV-10128 Fixed string length with no null fixed --- tools/lib/h5diff_array.c | 9 +++++++-- tools/test/h5diff/CMakeTests.cmake | 2 +- tools/test/h5diff/testfiles/h5diff_tmp1.txt | 14 +------------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 0a9d18a..499d5eb 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -665,6 +665,7 @@ static hsize_t diff_datum(void *_mem1, size_t size1; size_t size2; size_t sizex; + size_t size_mtype = H5Tget_size(m_type); H5T_str_t pad = H5Tget_strpad(m_type); /* if variable length string */ @@ -682,17 +683,21 @@ static hsize_t diff_datum(void *_mem1, /* Get pointer to first string */ s1 = (char*) mem1; size1 = HDstrlen(s1); + if (size1 > size_mtype) + size1 = size_mtype; /* Get pointer to second string */ s2 = (char*) mem2; size2 = HDstrlen(s2); + if (size2 > size_mtype) + size2 = size_mtype; } else { /* Get pointer to first string */ s1 = (char *)mem1; - size1 = H5Tget_size(m_type); + size1 = size_mtype; /* Get pointer to second string */ s2 = (char *)mem2; - size2 = H5Tget_size(m_type); + size2 = size_mtype; } /* diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 5759c2b..f6cd2dd 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -1130,7 +1130,7 @@ ADD_H5_TEST (h5diff_631 0 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp18 g1/f # ############################################################################## ADD_H5_TEST (h5diff_70 1 -v ${FILE5} ${FILE6}) # temporary test to verify HDF5-8625 -ADD_H5_TEST (h5diff_tmp1 1 tmptest2.he5 tmptest.he5) +ADD_H5_TEST (h5diff_tmp1 0 tmptest2.he5 tmptest.he5) # temporary test to verify HDF5-8639 ADD_H5_TEST (h5diff_tmp2 1 tmpSingleSiteBethe.output.h5 tmpSingleSiteBethe.reference.h5) diff --git a/tools/test/h5diff/testfiles/h5diff_tmp1.txt b/tools/test/h5diff/testfiles/h5diff_tmp1.txt index e2bb247..40e3fb6 100644 --- a/tools/test/h5diff/testfiles/h5diff_tmp1.txt +++ b/tools/test/h5diff/testfiles/h5diff_tmp1.txt @@ -1,17 +1,5 @@ -attribute: > and > -3 differences found -attribute: > and > -1 differences found -attribute: > and > -1 differences found -attribute: > and > -1 differences found -attribute: > and > -1 differences found -attribute: > and > -1 differences found -------------------------------- Some objects are not comparable -------------------------------- Use -c for a list of objects. -EXIT CODE: 1 +EXIT CODE: 0 -- cgit v0.12 From 71637634ac96b6167b384ebb461ce3b9ea66b4f8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 16 May 2017 10:16:44 -0500 Subject: HDFFV-9995 Clarify help text --- tools/src/h5diff/h5diff_common.c | 45 ++++++++++++++++-------------- tools/test/h5diff/testfiles/h5diff_10.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_600.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_603.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_606.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_612.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_615.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_621.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_622.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_623.txt | 21 ++++++++------ tools/test/h5diff/testfiles/h5diff_624.txt | 21 ++++++++------ 11 files changed, 144 insertions(+), 111 deletions(-) diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 5437803..0537b9f 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -56,7 +56,7 @@ static struct long_options l_opts[] = { static void check_options(diff_opt_t* options) { /*-------------------------------------------------------------- - * check for mutually exclusive options + * check for mutually exclusive options *--------------------------------------------------------------*/ /* check between -d , -p, --use-system-epsilon. @@ -127,13 +127,13 @@ void parse_command_line(int argc, h5diff_exit(EXIT_SUCCESS); case 'v': options->m_verbose = 1; - /* This for loop is for handling style like + /* This for loop is for handling style like * -v, -v1, --verbose, --verbose=1. */ for (i = 1; i < argc; i++) - { - /* - * short opt + { + /* + * short opt */ if (!strcmp (argv[i], "-v")) /* no arg */ { @@ -145,10 +145,10 @@ void parse_command_line(int argc, { options->m_verbose_level = atoi(&argv[i][2]); break; - } + } - /* - * long opt + /* + * long opt */ if (!strcmp (argv[i], "--verbose")) /* no arg */ { @@ -177,7 +177,7 @@ void parse_command_line(int argc, break; case 'E': options->exclude_path = 1; - + /* create linked list of excluding objects */ if( (exclude_node = (struct exclude_path_list*) HDmalloc(sizeof(struct exclude_path_list))) == NULL) { @@ -189,8 +189,8 @@ void parse_command_line(int argc, exclude_node->obj_path = (char*)opt_arg; exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN; exclude_prev = exclude_head; - - if (NULL == exclude_head) + + if (NULL == exclude_head) { exclude_head = exclude_node; exclude_head->next = NULL; @@ -202,7 +202,7 @@ void parse_command_line(int argc, exclude_node->next = NULL; exclude_prev->next = exclude_node; - } + } break; case 'd': options->d=1; @@ -458,7 +458,7 @@ check_d_input( const char *str ) void usage(void) { - printf("usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] \n"); + printf("usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]\n"); printf(" file1 File name of the first HDF5 file\n"); printf(" file2 File name of the second HDF5 file\n"); printf(" [obj1] Name of an HDF5 object, in absolute path\n"); @@ -519,19 +519,22 @@ void usage(void) printf(" -n C, --count=C\n"); printf(" Print differences up to C. C must be a positive integer.\n"); printf(" -d D, --delta=D\n"); - printf(" Print difference if (|a-b| > D). D must be a positive number.\n"); + printf(" Print difference if (|a-b| > D). D must be a positive number. Where a\n"); + printf(" is the data point value in file1 and b is the data point value in file2.\n"); printf(" Can not use with '-p' or '--use-system-epsilon'.\n"); printf(" -p R, --relative=R\n"); - printf(" Print difference if (|(a-b)/b| > R). R must be a positive number.\n"); + printf(" Print difference if (|(a-b)/b| > R). R must be a positive number. Where a\n"); + printf(" is the data point value in file1 and b is the data point value in file2.\n"); printf(" Can not use with '-d' or '--use-system-epsilon'.\n"); printf(" --use-system-epsilon\n"); - printf(" Print difference if (|a-b| > EPSILON), EPSILON is system defined value.\n"); + printf(" Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a\n"); + printf(" is the data point value in file1 and b is the data point value in file2.\n"); printf(" If the system epsilon is not defined,one of the following predefined\n"); printf(" values will be used:\n"); printf(" FLT_EPSILON = 1.19209E-07 for floating-point type\n"); printf(" DBL_EPSILON = 2.22045E-16 for double precision type\n"); printf(" Can not use with '-p' or '-d'.\n"); - printf(" --exclude-path \"path\" \n"); + printf(" --exclude-path \"path\"\n"); printf(" Exclude the specified path to an object when comparing files or groups.\n"); printf(" If a group is excluded, all member objects will also be excluded.\n"); printf(" The specified path is excluded wherever it occurs.\n"); @@ -570,15 +573,15 @@ void usage(void) printf("\n"); printf(" Object comparison:\n"); - printf(" 1) Groups \n"); + printf(" 1) Groups\n"); printf(" First compares the names of member objects (relative path, from the\n"); printf(" specified group) and generates a report of objects that appear in only\n"); printf(" one group or in both groups. Common objects are then compared recursively.\n"); - printf(" 2) Datasets \n"); + printf(" 2) Datasets\n"); printf(" Array rank and dimensions, datatypes, and data values are compared.\n"); - printf(" 3) Datatypes \n"); + printf(" 3) Datatypes\n"); printf(" The comparison is based on the return value of H5Tequal.\n"); - printf(" 4) Symbolic links \n"); + printf(" 4) Symbolic links\n"); printf(" The paths to the target objects are compared.\n"); printf(" (The option --follow-symlinks overrides the default behavior when\n"); printf(" symbolic links are compared.).\n"); diff --git a/tools/test/h5diff/testfiles/h5diff_10.txt b/tools/test/h5diff/testfiles/h5diff_10.txt index a699f00..0a0ee22 100644 --- a/tools/test/h5diff/testfiles/h5diff_10.txt +++ b/tools/test/h5diff/testfiles/h5diff_10.txt @@ -1,4 +1,4 @@ -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -59,19 +59,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -106,15 +109,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_600.txt b/tools/test/h5diff/testfiles/h5diff_600.txt index 3c3ad9f..4362711 100644 --- a/tools/test/h5diff/testfiles/h5diff_600.txt +++ b/tools/test/h5diff/testfiles/h5diff_600.txt @@ -1,4 +1,4 @@ -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -59,19 +59,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -106,15 +109,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_603.txt b/tools/test/h5diff/testfiles/h5diff_603.txt index 087764a..9ab3204 100644 --- a/tools/test/h5diff/testfiles/h5diff_603.txt +++ b/tools/test/h5diff/testfiles/h5diff_603.txt @@ -1,5 +1,5 @@ <-d -4> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_606.txt b/tools/test/h5diff/testfiles/h5diff_606.txt index c31a67e..afe0e72 100644 --- a/tools/test/h5diff/testfiles/h5diff_606.txt +++ b/tools/test/h5diff/testfiles/h5diff_606.txt @@ -1,5 +1,5 @@ <-d 0x1> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_612.txt b/tools/test/h5diff/testfiles/h5diff_612.txt index 05318bd..97a1747 100644 --- a/tools/test/h5diff/testfiles/h5diff_612.txt +++ b/tools/test/h5diff/testfiles/h5diff_612.txt @@ -1,5 +1,5 @@ <-p -4> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_615.txt b/tools/test/h5diff/testfiles/h5diff_615.txt index fd756b3..78770f0 100644 --- a/tools/test/h5diff/testfiles/h5diff_615.txt +++ b/tools/test/h5diff/testfiles/h5diff_615.txt @@ -1,5 +1,5 @@ <-p 0x1> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_621.txt b/tools/test/h5diff/testfiles/h5diff_621.txt index fd8c680..b2a5881 100644 --- a/tools/test/h5diff/testfiles/h5diff_621.txt +++ b/tools/test/h5diff/testfiles/h5diff_621.txt @@ -1,5 +1,5 @@ <-n -4> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_622.txt b/tools/test/h5diff/testfiles/h5diff_622.txt index f0d38af..66a3025 100644 --- a/tools/test/h5diff/testfiles/h5diff_622.txt +++ b/tools/test/h5diff/testfiles/h5diff_622.txt @@ -1,5 +1,5 @@ <-n 0> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_623.txt b/tools/test/h5diff/testfiles/h5diff_623.txt index 4ab66a5..f9258d1 100644 --- a/tools/test/h5diff/testfiles/h5diff_623.txt +++ b/tools/test/h5diff/testfiles/h5diff_623.txt @@ -1,5 +1,5 @@ <-n u> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). diff --git a/tools/test/h5diff/testfiles/h5diff_624.txt b/tools/test/h5diff/testfiles/h5diff_624.txt index f5e7ee3..57a4ddd 100644 --- a/tools/test/h5diff/testfiles/h5diff_624.txt +++ b/tools/test/h5diff/testfiles/h5diff_624.txt @@ -1,5 +1,5 @@ <-n 0x1> is not a valid option -usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] +usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] file1 File name of the first HDF5 file file2 File name of the second HDF5 file [obj1] Name of an HDF5 object, in absolute path @@ -60,19 +60,22 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] -n C, --count=C Print differences up to C. C must be a positive integer. -d D, --delta=D - Print difference if (|a-b| > D). D must be a positive number. + Print difference if (|a-b| > D). D must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-p' or '--use-system-epsilon'. -p R, --relative=R - Print difference if (|(a-b)/b| > R). R must be a positive number. + Print difference if (|(a-b)/b| > R). R must be a positive number. Where a + is the data point value in file1 and b is the data point value in file2. Can not use with '-d' or '--use-system-epsilon'. --use-system-epsilon - Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a + is the data point value in file1 and b is the data point value in file2. If the system epsilon is not defined,one of the following predefined values will be used: FLT_EPSILON = 1.19209E-07 for floating-point type DBL_EPSILON = 2.22045E-16 for double precision type Can not use with '-p' or '-d'. - --exclude-path "path" + --exclude-path "path" Exclude the specified path to an object when comparing files or groups. If a group is excluded, all member objects will also be excluded. The specified path is excluded wherever it occurs. @@ -107,15 +110,15 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] common objects. Object comparison: - 1) Groups + 1) Groups First compares the names of member objects (relative path, from the specified group) and generates a report of objects that appear in only one group or in both groups. Common objects are then compared recursively. - 2) Datasets + 2) Datasets Array rank and dimensions, datatypes, and data values are compared. - 3) Datatypes + 3) Datatypes The comparison is based on the return value of H5Tequal. - 4) Symbolic links + 4) Symbolic links The paths to the target objects are compared. (The option --follow-symlinks overrides the default behavior when symbolic links are compared.). -- cgit v0.12 From 3ee87f72add3e46a751806def2721afd7218b910 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 16 May 2017 15:56:51 -0500 Subject: HDFFV-9055 Handle H5T_ARRAY types Create variables just for diff_array function Whitespace updates --- tools/lib/h5diff_dset.c | 428 +++++++++++++++++++----------------------------- 1 file changed, 171 insertions(+), 257 deletions(-) diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 9f70299..2ac93ab 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -44,6 +44,7 @@ hsize_t diff_dataset( hid_t file1_id, hid_t dcpl2 = -1; hsize_t nfound = 0; + h5difftrace("diff_dataset start\n"); /*------------------------------------------------------------------------- * open the handles *------------------------------------------------------------------------- @@ -52,13 +53,11 @@ hsize_t diff_dataset( hid_t file1_id, H5E_BEGIN_TRY { /* Open the datasets */ - if((did1 = H5Dopen2(file1_id, obj1_name, H5P_DEFAULT)) < 0) - { + if((did1 = H5Dopen2(file1_id, obj1_name, H5P_DEFAULT)) < 0) { parallel_print("Cannot open dataset <%s>\n", obj1_name); goto error; } - if((did2 = H5Dopen2(file2_id, obj2_name, H5P_DEFAULT)) < 0) - { + if((did2 = H5Dopen2(file2_id, obj2_name, H5P_DEFAULT)) < 0) { parallel_print("Cannot open dataset <%s>\n", obj2_name); goto error; } @@ -78,15 +77,9 @@ hsize_t diff_dataset( hid_t file1_id, * 2) the internal filters might be turned off *------------------------------------------------------------------------- */ - if ((h5tools_canreadf((options->m_verbose?obj1_name:NULL),dcpl1)==1) && - (h5tools_canreadf((options->m_verbose?obj2_name:NULL),dcpl2)==1)) - { - nfound=diff_datasetid(did1, - did2, - obj1_name, - obj2_name, - options); - } + if ((h5tools_canreadf((options->m_verbose ? obj1_name : NULL), dcpl1) == 1) && + (h5tools_canreadf((options->m_verbose ? obj2_name : NULL), dcpl2) == 1)) + nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, options); else goto error; @@ -94,20 +87,12 @@ hsize_t diff_dataset( hid_t file1_id, * close *------------------------------------------------------------------------- */ - /* disable error reporting */ - H5E_BEGIN_TRY { - H5Pclose(dcpl1); - H5Pclose(dcpl2); - H5Dclose(did1); - H5Dclose(did2); - /* enable error reporting */ - } H5E_END_TRY; - - - return nfound; + goto done; error: - options->err_stat=1; + options->err_stat = 1; + +done: /* disable error reporting */ H5E_BEGIN_TRY { H5Pclose(dcpl1); @@ -117,6 +102,7 @@ error: /* enable error reporting */ } H5E_END_TRY; + h5difftrace("diff_dataset end\n"); return nfound; } @@ -188,20 +174,24 @@ hsize_t diff_datasetid( hid_t did1, hid_t sid2=-1; hid_t f_tid1=-1; hid_t f_tid2=-1; + hid_t dam_tid=-1; /* m_tid for diff_array function */ hid_t m_tid1=-1; hid_t m_tid2=-1; hid_t dcpl1 = -1; hid_t dcpl2 = -1; H5D_layout_t stl1 = -1; H5D_layout_t stl2 = -1; + size_t dam_size; /* m_size for diff_array function */ size_t m_size1; size_t m_size2; H5T_sign_t sign1; H5T_sign_t sign2; int rank1; int rank2; + hsize_t danelmts; /* nelmts for diff_array function */ hsize_t nelmts1; hsize_t nelmts2; + hsize_t *dadims; /* dims for diff_array function */ hsize_t dims1[H5S_MAX_RANK]; hsize_t dims2[H5S_MAX_RANK]; hsize_t maxdim1[H5S_MAX_RANK]; @@ -223,30 +213,29 @@ hsize_t diff_datasetid( hid_t did1, h5difftrace("diff_datasetid start\n"); /* Get the dataspace handle */ - if ( (sid1 = H5Dget_space(did1)) < 0 ) + if((sid1 = H5Dget_space(did1)) < 0) goto error; /* Get rank */ - if ( (rank1 = H5Sget_simple_extent_ndims(sid1)) < 0 ) + if((rank1 = H5Sget_simple_extent_ndims(sid1)) < 0) goto error; /* Get the dataspace handle */ - if ( (sid2 = H5Dget_space(did2)) < 0 ) + if((sid2 = H5Dget_space(did2)) < 0 ) goto error; /* Get rank */ - if ( (rank2 = H5Sget_simple_extent_ndims(sid2)) < 0 ) + if((rank2 = H5Sget_simple_extent_ndims(sid2)) < 0) goto error; /* Get dimensions */ - if ( H5Sget_simple_extent_dims(sid1,dims1,maxdim1) < 0 ) + if(H5Sget_simple_extent_dims(sid1, dims1, maxdim1) < 0) goto error; /* Get dimensions */ - if ( H5Sget_simple_extent_dims(sid2,dims2,maxdim2) < 0 ) - { + if(H5Sget_simple_extent_dims(sid2, dims2, maxdim2) < 0) goto error; - } + h5diffdebug3("rank: %ld - %ld\n", rank1, rank2); /*------------------------------------------------------------------------- * get the file data type @@ -254,15 +243,12 @@ hsize_t diff_datasetid( hid_t did1, */ /* Get the data type */ - if ( (f_tid1 = H5Dget_type(did1)) < 0 ) + if((f_tid1 = H5Dget_type(did1)) < 0) goto error; /* Get the data type */ - if ( (f_tid2 = H5Dget_type(did2)) < 0 ) - { + if((f_tid2 = H5Dget_type(did2)) < 0) goto error; - } - /*------------------------------------------------------------------------- * get the storage layout type @@ -284,22 +270,20 @@ hsize_t diff_datasetid( hid_t did1, */ h5difftrace("check for empty datasets\n"); - storage_size1=H5Dget_storage_size(did1); - storage_size2=H5Dget_storage_size(did2); + storage_size1 = H5Dget_storage_size(did1); + storage_size2 = H5Dget_storage_size(did2); + h5diffdebug3("storage size: %ld - %ld\n", storage_size1, storage_size2); - if (storage_size1==0 || storage_size2==0) - { - if (stl1==H5D_VIRTUAL || stl2==H5D_VIRTUAL) - { - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) + if(storage_size1 == 0 || storage_size2 == 0) { + if(stl1 == H5D_VIRTUAL || stl2 == H5D_VIRTUAL) { + if((options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) parallel_print("Warning: <%s> or <%s> is a virtual dataset\n", obj1_name, obj2_name); } - else - { - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) + else { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) parallel_print("Not comparable: <%s> or <%s> is an empty dataset\n", obj1_name, obj2_name); - can_compare=0; - options->not_cmp=1; + can_compare = 0; + options->not_cmp = 1; } } @@ -307,72 +291,59 @@ hsize_t diff_datasetid( hid_t did1, * check for comparable TYPE and SPACE *------------------------------------------------------------------------- */ - - if (diff_can_type(f_tid1, - f_tid2, - rank1, - rank2, - dims1, - dims2, - maxdim1, - maxdim2, - obj1_name, - obj2_name, - options, - 0)!=1) - { - can_compare=0; - } + if (diff_can_type(f_tid1, f_tid2, rank1, rank2, + dims1, dims2, maxdim1, maxdim2, + obj1_name, obj2_name, + options, 0) != 1) + can_compare = 0; /*------------------------------------------------------------------------- * memory type and sizes *------------------------------------------------------------------------- */ h5difftrace("check for memory type and sizes\n"); - if ((m_tid1=H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0) + if((m_tid1 = H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0) goto error; - if ((m_tid2=H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0) + if((m_tid2 = H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0) goto error; - m_size1 = H5Tget_size( m_tid1 ); - m_size2 = H5Tget_size( m_tid2 ); + m_size1 = H5Tget_size(m_tid1); + m_size2 = H5Tget_size(m_tid2); + h5diffdebug3("type size: %ld - %ld\n", m_size1, m_size2); /*------------------------------------------------------------------------- * check for different signed/unsigned types *------------------------------------------------------------------------- */ - if (can_compare) - { + if(can_compare) { h5difftrace("can_compare for sign\n"); - sign1=H5Tget_sign(m_tid1); - sign2=H5Tget_sign(m_tid2); - if ( sign1 != sign2 ) - { + sign1 = H5Tget_sign(m_tid1); + sign2 = H5Tget_sign(m_tid2); + if(sign1 != sign2) { h5difftrace("sign1 != sign2\n"); - if ((options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) - { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1)); parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2)); } - can_compare=0; - options->not_cmp=1; + can_compare = 0; + options->not_cmp = 1; } } /* Check if type is either VLEN-data or VLEN-string to reclaim any * VLEN memory buffer later */ - if( TRUE == h5tools_detect_vlen(m_tid1) ) + if(TRUE == h5tools_detect_vlen(m_tid1)) vl_data = TRUE; /*------------------------------------------------------------------------ * only attempt to compare if possible *------------------------------------------------------------------------- */ - if(can_compare) /* it is possible to compare */ - { + if(can_compare) { /* it is possible to compare */ h5difftrace("can_compare attempt\n"); + H5T_class_t tclass = H5Tget_class(f_tid1); /*----------------------------------------------------------------- * get number of elements @@ -386,19 +357,44 @@ hsize_t diff_datasetid( hid_t did1, for(i = 0; i < rank2; i++) nelmts2 *= dims2[i]; + h5diffdebug3("nelmts: %ld - %ld\n", nelmts1, nelmts2); HDassert(nelmts1 == nelmts2); - /*----------------------------------------------------------------- - * "upgrade" the smaller memory size - *------------------------------------------------------------------ - */ - h5difftrace("upgrade the smaller memory size?\n"); - - if (FAIL == match_up_memsize (f_tid1, f_tid2, - &m_tid1, &m_tid2, - &m_size1, &m_size2)) - goto error; - + if(tclass != H5T_ARRAY) { + /*----------------------------------------------------------------- + * "upgrade" the smaller memory size + *------------------------------------------------------------------ + */ + h5difftrace("upgrade the smaller memory size?\n"); + if (FAIL == match_up_memsize (f_tid1, f_tid2, + &m_tid1, &m_tid2, + &m_size1, &m_size2)) + goto error; + h5diffdebug3("m_size: %ld - %ld\n", m_size1, m_size2); + dadims = dims1; + dam_size = m_size1; + dam_tid = m_tid1; + danelmts = nelmts1; + need = (size_t)(nelmts1 * m_size1); /* bytes needed */ + } + else { + h5diffdebug3("Array dims: %d - %d\n", dims1[0], dims2[0]); + /* Compare the smallest array, but create the largest buffer */ + if(m_size1 <= m_size2) { + dadims = dims1; + dam_size = m_size1; + dam_tid = m_tid1; + danelmts = nelmts1; + need = (size_t)(nelmts2 * m_size2); /* bytes needed */ + } + else { + dadims = dims2; + dam_size = m_size2; + dam_tid = m_tid2; + danelmts = nelmts2; + need = (size_t)(nelmts1 * m_size1); /* bytes needed */ + } + } /* print names */ if(obj1_name) name1 = diff_basename(obj1_name); @@ -410,7 +406,6 @@ hsize_t diff_datasetid( hid_t did1, * read/compare *----------------------------------------------------------------- */ - need = (size_t)(nelmts1 * m_size1); /* bytes needed */ if(need < H5TOOLS_MALLOCSIZE) { buf1 = HDmalloc(need); buf2 = HDmalloc(need); @@ -420,12 +415,13 @@ hsize_t diff_datasetid( hid_t did1, h5difftrace("buf1 != NULL && buf2 != NULL\n"); if(H5Dread(did1, m_tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1) < 0) goto error; + h5difftrace("H5Dread did2\n"); if(H5Dread(did2, m_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2) < 0) goto error; /* array diff */ - nfound = diff_array(buf1, buf2, nelmts1, (hsize_t)0, rank1, dims1, - options, name1, name2, m_tid1, did1, did2); + nfound = diff_array(buf1, buf2, danelmts, (hsize_t)0, rank1, dadims, + options, name1, name2, dam_tid, did1, did2); /* reclaim any VL memory, if necessary */ if(vl_data) { @@ -433,10 +429,9 @@ hsize_t diff_datasetid( hid_t did1, H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); } /* end if */ } /* end if */ - else /* possibly not enough memory, read/compare by hyperslabs */ - { - size_t p_type_nbytes = m_size1; /*size of memory type */ - hsize_t p_nelmts = nelmts1; /*total selected elmts */ + else { /* possibly not enough memory, read/compare by hyperslabs */ + size_t p_type_nbytes = dam_size; /*size of memory type */ + hsize_t p_nelmts = danelmts; /*total selected elmts */ hsize_t elmtno; /*counter */ int carry; /*counter carry value */ @@ -462,7 +457,7 @@ hsize_t diff_datasetid( hid_t did1, if(size == 0) /* datum size > H5TOOLS_BUFSIZE */ size = 1; - sm_size[i - 1] = MIN(dims1[i - 1], size); + sm_size[i - 1] = MIN(dadims[i - 1], size); sm_nbytes *= sm_size[i - 1]; HDassert(sm_nbytes > 0); } /* end for */ @@ -490,7 +485,7 @@ hsize_t diff_datasetid( hid_t did1, /* calculate the hyperslab size */ if(rank1 > 0) { for(i = 0, hs_nelmts = 1; i < rank1; i++) { - hs_size[i] = MIN(dims1[i] - hs_offset[i], sm_size[i]); + hs_size[i] = MIN(dadims[i] - hs_offset[i], sm_size[i]); hs_nelmts *= hs_size[i]; } /* end for */ if(H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) @@ -503,15 +498,15 @@ hsize_t diff_datasetid( hid_t did1, else hs_nelmts = 1; - if(H5Dread(did1,m_tid1,sm_space,sid1,H5P_DEFAULT,sm_buf1) < 0) + if(H5Dread(did1, m_tid1, sm_space, sid1, H5P_DEFAULT, sm_buf1) < 0) goto error; - if(H5Dread(did2,m_tid2,sm_space,sid2,H5P_DEFAULT,sm_buf2) < 0) + if(H5Dread(did2, m_tid2, sm_space, sid2, H5P_DEFAULT, sm_buf2) < 0) goto error; /* get array differences. in the case of hyperslab read, increment the number of differences - found in each hyperslab and pass the position at the beggining for printing */ + found in each hyperslab and pass the position at the beginning for printing */ nfound += diff_array(sm_buf1, sm_buf2, hs_nelmts, elmtno, rank1, - dims1, options, name1, name2, m_tid1, did1, did2); + dadims, options, name1, name2, dam_tid, did1, did2); /* reclaim any VL memory, if necessary */ if(vl_data) { @@ -522,7 +517,7 @@ hsize_t diff_datasetid( hid_t did1, /* calculate the next hyperslab offset */ for(i = rank1, carry = 1; i > 0 && carry; --i) { hs_offset[i - 1] += hs_size[i - 1]; - if(hs_offset[i - 1] == dims1[i - 1]) + if(hs_offset[i - 1] == dadims[i - 1]) hs_offset[i - 1] = 0; else carry = 0; @@ -574,37 +569,33 @@ error: options->err_stat=1; /* free */ - if (buf1!=NULL) - { + if(buf1 != NULL) { /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); HDfree(buf1); - buf1=NULL; + buf1 = NULL; } - if (buf2!=NULL) - { + if(buf2 != NULL) { /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); HDfree(buf2); - buf2=NULL; + buf2 = NULL; } - if (sm_buf1!=NULL) - { + if(sm_buf1 != NULL) { /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1); HDfree(sm_buf1); - sm_buf1=NULL; + sm_buf1 = NULL; } - if (sm_buf2!=NULL) - { + if(sm_buf2 != NULL) { /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf2); HDfree(sm_buf2); - sm_buf2=NULL; + sm_buf2 = NULL; } /* disable error reporting */ @@ -652,75 +643,55 @@ int diff_can_type( hid_t f_tid1, /* file data type */ diff_opt_t *options, int is_compound) { - - H5T_class_t tclass1; H5T_class_t tclass2; - int maxdim_diff=0; /* maximum dimensions are different */ - int dim_diff=0; /* current dimensions are different */ + int maxdim_diff = 0; /* maximum dimensions are different */ + int dim_diff = 0; /* current dimensions are different */ int i; - int can_compare = 1; /* return value */ + int can_compare = 1; /* return value */ + h5difftrace("diff_can_type start\n"); /*------------------------------------------------------------------------- * check for the same class *------------------------------------------------------------------------- */ - - if ((tclass1=H5Tget_class(f_tid1)) < 0) + if((tclass1 = H5Tget_class(f_tid1)) < 0) return -1; - - if ((tclass2=H5Tget_class(f_tid2)) < 0) + if((tclass2 = H5Tget_class(f_tid2)) < 0) return -1; - if ( tclass1 != tclass2 ) - { - - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) - { - - if ( is_compound ) - { - + if(tclass1 != tclass2) { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if(is_compound) { parallel_print("Not comparable: <%s> has a class %s and <%s> has a class %s\n", - obj1_name, get_class(tclass1), - obj2_name, get_class(tclass2) ); - + obj1_name, get_class(tclass1), + obj2_name, get_class(tclass2)); } - - else - - { - + else { parallel_print("Not comparable: <%s> is of class %s and <%s> is of class %s\n", - obj1_name, get_class(tclass1), - obj2_name, get_class(tclass2) ); - + obj1_name, get_class(tclass1), + obj2_name, get_class(tclass2)); } - } - - can_compare = 0; options->not_cmp = 1; - return can_compare; + goto done; } /*------------------------------------------------------------------------- * check for non supported classes *------------------------------------------------------------------------- */ - - HDassert(tclass1==tclass2); - switch (tclass1) - { + HDassert(tclass1 == tclass2); + switch (tclass1) { case H5T_TIME: - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> and <%s> are of class %s\n", - obj1_name,obj2_name,get_class(tclass2) ); + obj1_name, obj2_name, get_class(tclass2)); } /* end if */ can_compare = 0; options->not_cmp = 1; - return can_compare; + goto done; case H5T_INTEGER: case H5T_FLOAT: @@ -735,6 +706,7 @@ int diff_can_type( hid_t f_tid1, /* file data type */ case H5T_NO_CLASS: case H5T_NCLASSES: default: + h5diffdebug2("diff_can_type class - %s\n", get_class(tclass1)); break; } /* end switch */ @@ -742,17 +714,11 @@ int diff_can_type( hid_t f_tid1, /* file data type */ * check for equal file datatype; warning only *------------------------------------------------------------------------- */ - - if ( (H5Tequal(f_tid1, f_tid2)==0) && - (options->m_verbose) && obj1_name && obj2_name) - { - + if((H5Tequal(f_tid1, f_tid2) == 0) && (options->m_verbose) && obj1_name && obj2_name) { H5T_class_t cl = H5Tget_class(f_tid1); - parallel_print("Warning: different storage datatype\n"); - if ( cl == H5T_INTEGER || cl == H5T_FLOAT ) - { + if(cl == H5T_INTEGER || cl == H5T_FLOAT) { parallel_print("<%s> has file datatype ", obj1_name); print_type(f_tid1); parallel_print("\n"); @@ -760,110 +726,85 @@ int diff_can_type( hid_t f_tid1, /* file data type */ print_type(f_tid2); parallel_print("\n"); } - - - } /*------------------------------------------------------------------------- * check for the same rank *------------------------------------------------------------------------- */ - - - if ( rank1 != rank2 ) - { - - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) - { + if(rank1 != rank2) { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); - print_dimensions(rank1,dims1); + print_dimensions(rank1, dims1); parallel_print(", max dimensions "); - print_dimensions(rank1,maxdim1); + print_dimensions(rank1, maxdim1); parallel_print("\n" ); parallel_print("and <%s> has rank %d, dimensions ", obj2_name, rank2); - print_dimensions(rank2,dims2); + print_dimensions(rank2, dims2); parallel_print(", max dimensions "); - print_dimensions(rank2,maxdim2); + print_dimensions(rank2, maxdim2); parallel_print("\n"); } - can_compare = 0; options->not_cmp = 1; - return can_compare; + goto done; } /*------------------------------------------------------------------------- * check for different dimensions *------------------------------------------------------------------------- */ - - HDassert(rank1==rank2); - for ( i=0; im_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) - { + if(dim_diff == 1) { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); - print_dimensions(rank1,dims1); - if (maxdim1 && maxdim2) - { + print_dimensions(rank1, dims1); + if(maxdim1 && maxdim2) { parallel_print(", max dimensions "); - print_dimensions(rank1,maxdim1); + print_dimensions(rank1, maxdim1); parallel_print("\n" ); parallel_print("and <%s> has rank %d, dimensions ", obj2_name, rank2); - print_dimensions(rank2,dims2); + print_dimensions(rank2, dims2); parallel_print(", max dimensions "); - print_dimensions(rank2,maxdim2); + print_dimensions(rank2, maxdim2); parallel_print("\n"); } } - - can_compare = 0; options->not_cmp = 1; - return can_compare; - - - + goto done; } /*------------------------------------------------------------------------- * maximum dimensions; just give a warning *------------------------------------------------------------------------- */ - if (maxdim1 && maxdim2 && maxdim_diff==1 && obj1_name ) - { - if (options->m_verbose) { + if(maxdim1 && maxdim2 && maxdim_diff == 1 && obj1_name) { + if(options->m_verbose) { parallel_print( "Warning: different maximum dimensions\n"); parallel_print("<%s> has max dimensions ", obj1_name); - print_dimensions(rank1,maxdim1); + print_dimensions(rank1, maxdim1); parallel_print("\n"); parallel_print("<%s> has max dimensions ", obj2_name); - print_dimensions(rank2,maxdim2); + print_dimensions(rank2, maxdim2); parallel_print("\n"); } } - - if ( tclass1 == H5T_COMPOUND ) - { - + if(tclass1 == H5T_COMPOUND) { int nmembs1; int nmembs2; int j; @@ -873,67 +814,40 @@ int diff_can_type( hid_t f_tid1, /* file data type */ nmembs1 = H5Tget_nmembers(f_tid1); nmembs2 = H5Tget_nmembers(f_tid2); - if ( nmembs1 != nmembs2 ) - { - - if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) - { + if(nmembs1 != nmembs2) { + if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has %d members ", obj1_name, nmembs1); parallel_print("<%s> has %d members ", obj2_name, nmembs2); parallel_print("\n"); } - can_compare = 0; options->not_cmp = 1; - return can_compare; + goto done; } - for (j = 0; j < nmembs1; j++) - { + for (j = 0; j < nmembs1; j++) { memb_type1 = H5Tget_member_type(f_tid1, (unsigned)j); memb_type2 = H5Tget_member_type(f_tid2, (unsigned)j); - if (diff_can_type(memb_type1, - memb_type2, - rank1, - rank2, - dims1, - dims2, - maxdim1, - maxdim2, - obj1_name, - obj2_name, - options, - 1)!=1) - { + if (diff_can_type(memb_type1, memb_type2, rank1, rank2, + dims1, dims2, maxdim1, maxdim2, obj1_name, obj2_name, + options, 1) != 1) { can_compare = 0; options->not_cmp = 1; H5Tclose(memb_type1); H5Tclose(memb_type2); - return can_compare; + goto done; } - H5Tclose(memb_type1); H5Tclose(memb_type2); - } - - - - - } - - - - - +done: + h5diffdebug2("diff_can_type end - %d\n", can_compare); return can_compare; } - - /*------------------------------------------------------------------------- * Function: print_sizes * -- cgit v0.12 From 23d9fe26495904dcaa1489bd4d4f8a698d87511e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 17 May 2017 10:06:17 -0500 Subject: HDFFV-9055 add test files --- MANIFEST | 3 +++ tools/test/h5diff/CMakeTests.cmake | 16 ++++++++++++++++ tools/test/h5diff/h5diffgentest.c | 19 ++++++++++--------- tools/test/h5diff/testfiles/h5diff_800.txt | 12 ++++++++++++ tools/test/h5diff/testfiles/h5diff_801.txt | 13 +++++++++++++ tools/test/h5diff/testfiles/h5diff_dset3.h5 | Bin 0 -> 23416 bytes 6 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 tools/test/h5diff/testfiles/h5diff_800.txt create mode 100644 tools/test/h5diff/testfiles/h5diff_801.txt create mode 100644 tools/test/h5diff/testfiles/h5diff_dset3.h5 diff --git a/MANIFEST b/MANIFEST index e448a44..dde7632 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2240,6 +2240,8 @@ ./tools/test/h5diff/testfiles/h5diff_709.txt ./tools/test/h5diff/testfiles/h5diff_710.txt ./tools/test/h5diff/testfiles/h5diff_80.txt +./tools/test/h5diff/testfiles/h5diff_800.txt +./tools/test/h5diff/testfiles/h5diff_801.txt ./tools/test/h5diff/testfiles/h5diff_90.txt ./tools/test/h5diff/testfiles/h5diff_100.txt ./tools/test/h5diff/testfiles/h5diff_101.txt @@ -2350,6 +2352,7 @@ ./tools/test/h5diff/testfiles/h5diff_basic2.h5 ./tools/test/h5diff/testfiles/h5diff_dset1.h5 ./tools/test/h5diff/testfiles/h5diff_dset2.h5 +./tools/test/h5diff/testfiles/h5diff_dset3.h5 ./tools/test/h5diff/testfiles/h5diff_dtypes.h5 ./tools/test/h5diff/testfiles/h5diff_empty.h5 ./tools/test/h5diff/testfiles/h5diff_hyper1.h5 diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index f6cd2dd..72dda6b 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -28,6 +28,7 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset2.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset3.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_hyper1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_hyper2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_empty.h5 @@ -275,6 +276,8 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_709.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_710.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_80.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_800.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_801.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp1.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp2.txt @@ -464,6 +467,7 @@ set (FILE6 h5diff_attr2.h5) set (FILE7 h5diff_dset1.h5) set (FILE8 h5diff_dset2.h5) + set (FILE8A h5diff_dset3.h5) set (FILE9 h5diff_hyper1.h5) set (FILE10 h5diff_hyper2.h5) set (FILE11 h5diff_empty.h5) @@ -872,6 +876,10 @@ h5diff_710.out.err h5diff_80.out h5diff_80.out.err + h5diff_800.out + h5diff_800.out.err + h5diff_801.out + h5diff_801.out.err h5diff_90.out h5diff_90.out.err h5diff_v1.out @@ -1478,6 +1486,14 @@ ADD_H5_TEST (h5diff_645 1 -v -p 0.05 --use-system-epsilon ${FILE1} ${FILE2} /g1/ ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) # ############################################################################## +# # Test array variances +# ############################################################################## +# +# Test with -d , -p and --use-system-epsilon. +ADD_H5_TEST (h5diff_800 1 -v ${FILE7} ${FILE8} /g1/array /g1/array) +ADD_H5_TEST (h5diff_801 1 -v ${FILE7} ${FILE8A} /g1/array /g1/array) + +# ############################################################################## # VDS tests # ############################################################################## ADD_H5_TEST (h5diff_v1 0 -v ${FILEV1} ${FILEV2}) diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 4a929ae..6a84365 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -48,6 +48,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); #define FILE6 "h5diff_attr2.h5" #define FILE7 "h5diff_dset1.h5" #define FILE8 "h5diff_dset2.h5" +#define FILE8A "h5diff_dset3.h5" #define FILE9 "h5diff_hyper1.h5" #define FILE10 "h5diff_hyper2.h5" #define FILE11 "h5diff_empty.h5" @@ -197,6 +198,7 @@ int main(void) /* generate 2 files, the second call creates a similar file with differences */ test_datasets(FILE7,0); test_datasets(FILE8,1); + test_datasets(FILE8A,2); /* generate 2 files, the second call creates a similar file with differences */ test_hyperslab(FILE9,0); @@ -1328,7 +1330,7 @@ int test_datasets(const char *file, herr_t status; int buf[2]={1,2}; - if(make_diffs) + if(make_diffs > 0) memset(buf, 0, sizeof buf); /* Create a file */ @@ -1399,9 +1401,8 @@ int test_special_datasets(const char *file, /* Create a dataset with zero dimension size in one file but the other one * has a dataset with a non-zero dimension size */ - if(make_diffs) { + if(make_diffs) dims[1] = SPACE1_DIM2 + 4; - } sid = H5Screate_simple(SPACE1_RANK, dims, NULL); did = H5Dcreate2(fid, "dset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -5470,12 +5471,12 @@ static void test_objs_strings(const char *fname1, const char *fname2) string4A[0][10] = 0; string4A[0][11] = 0; string4B[0][10] = 0; - + string4A[1][10] = 0; string4A[1][11] = 'Z'; string4B[1][10] = 0; string4B[1][11] = 'x'; - + string4A[2][10] = 0; string4B[2][10] = 0; string4B[2][11] = 'a'; @@ -6641,6 +6642,9 @@ void write_dset_in(hid_t loc_id, int buf73[4][3][2]; /* integer */ float buf83[4][3][2]; /* float */ + if(make_diffs == 2) { + dimarray[0] = 4; + } /*------------------------------------------------------------------------- * H5S_SCALAR @@ -6649,11 +6653,8 @@ void write_dset_in(hid_t loc_id, - if ( make_diffs ) - { - + if(make_diffs) scalar_data = 1; - } /* create a space */ sid = H5Screate(H5S_SCALAR); diff --git a/tools/test/h5diff/testfiles/h5diff_800.txt b/tools/test/h5diff/testfiles/h5diff_800.txt new file mode 100644 index 0000000..e43e7b4 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_800.txt @@ -0,0 +1,12 @@ +dataset: and +size: [2] [2] +position array array difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 0 ] 2 0 2 +[ 0 ] 3 0 3 +[ 1 ] 4 0 4 +[ 1 ] 5 0 5 +[ 1 ] 6 0 6 +6 differences found +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_801.txt b/tools/test/h5diff/testfiles/h5diff_801.txt new file mode 100644 index 0000000..043e7e3 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_801.txt @@ -0,0 +1,13 @@ +dataset: and +Warning: different storage datatype +size: [2] [2] +position array array difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 0 ] 2 0 2 +[ 0 ] 3 0 3 +[ 1 ] 4 0 4 +[ 1 ] 5 0 5 +[ 1 ] 6 0 6 +6 differences found +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_dset3.h5 b/tools/test/h5diff/testfiles/h5diff_dset3.h5 new file mode 100644 index 0000000..7a1f3dd Binary files /dev/null and b/tools/test/h5diff/testfiles/h5diff_dset3.h5 differ -- cgit v0.12 From 71c223c082f1777046419f98e6159bda2cb59cc9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 17 May 2017 13:09:13 -0500 Subject: Move execeutable command after declaration --- tools/lib/h5diff_dset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 2ac93ab..991ef48 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -342,8 +342,8 @@ hsize_t diff_datasetid( hid_t did1, *------------------------------------------------------------------------- */ if(can_compare) { /* it is possible to compare */ - h5difftrace("can_compare attempt\n"); H5T_class_t tclass = H5Tget_class(f_tid1); + h5difftrace("can_compare attempt\n"); /*----------------------------------------------------------------- * get number of elements -- cgit v0.12 From fcc56184f1699fc1d35b042acb1388cc76b8ea16 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 17 May 2017 15:09:13 -0500 Subject: Whitespace --- tools/test/h5copy/h5copygentest.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index ed41998..bda0686 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -33,12 +33,12 @@ #define DATASET_COMPRESSED "compressed" #define DATASET_NAMED_VL "named_vl" #define DATASET_NESTED_VL "nested_vl" -#define DATASET_ATTR "dset_attr" -#define ATTR "attr" +#define DATASET_ATTR "dset_attr" +#define ATTR "attr" #define GROUP_EMPTY "grp_empty" #define GROUP_DATASETS "grp_dsets" #define GROUP_NESTED "grp_nested" -#define GROUP_ATTR "grp_attr" +#define GROUP_ATTR "grp_attr" /* Obj reference */ #define OBJ_REF_DS "Dset1" @@ -327,8 +327,8 @@ static void gent_nested_vl(hid_t loc_id) * Function: gent_att_compound_vlstr * * Purpose: Generate a dataset and a group. - * Both has an attribute with a compound datatype consisting - * of a variable length string + * Both has an attribute with a compound datatype consisting + * of a variable length string * *------------------------------------------------------------------------- */ @@ -347,7 +347,7 @@ static void gent_att_compound_vlstr(hid_t loc_id) hid_t vl_str_tid = -1; /* Variable length datatype ID */ hid_t cmpd_tid = -1; /* Compound datatype ID */ hid_t null_sid = -1; /* Null dataspace ID */ - s1 buf; /* Buffer */ + s1 buf; /* Buffer */ buf.i = 9; buf.v = "ThisIsAString"; -- cgit v0.12 From 9b8ffee145e41abf35d57c747ff8e1a6ba3aaa89 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 18 May 2017 09:12:47 -0500 Subject: Added note about 9055 and 10128, 9995 not needed --- release_docs/RELEASE.txt | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index c670066..8fb56cc 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -74,15 +74,15 @@ New Features Tools: ------ - - + - High-Level APIs: --------------- - - + - C Packet Table API ------------------ - - + - Internal header file -------------------- @@ -105,7 +105,7 @@ Bug Fixes since HDF5-1.10.1 release Configuration ------------- - - + - Performance ------------- @@ -117,7 +117,9 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- - - + - Improved h5diff compare of strings and arrays. + + (ADB, 2017/05/18, HDFFV-9055, HDFFV-10128) High-Level APIs: ------ @@ -302,16 +304,16 @@ The following platforms are not supported but have been tested for this release. (cmake and autotools) Fedora 24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux - gcc, g++ (GCC) 6.1.1 20160621 + gcc, g++ (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) - GNU Fortran (GCC) 6.1.1 20160621 + GNU Fortran (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) (cmake and autotools) Ubuntu 16.04.1 4.4.0-38-generic #57-Ubuntu SMP x86_64 GNU/Linux - gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) + gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 - GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) + GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 (cmake and autotools) -- cgit v0.12 From e60bf13c76e8e9bc831d4a47d22631f201383560 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 18 May 2017 15:35:05 -0500 Subject: HDFFV-9055 Correct file generator --- tools/test/h5diff/h5diffgentest.c | 2 +- tools/test/h5diff/testfiles/h5diff_58.txt | 2 +- tools/test/h5diff/testfiles/h5diff_80.txt | 2 +- tools/test/h5diff/testfiles/h5diff_dset1.h5 | Bin 23624 -> 23416 bytes tools/test/h5diff/testfiles/h5diff_dset2.h5 | Bin 23624 -> 23416 bytes tools/test/h5diff/testfiles/h5diff_dset3.h5 | Bin 23416 -> 23416 bytes 6 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 6a84365..708f371 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -7237,7 +7237,7 @@ void write_dset_in(hid_t loc_id, n=1; for (i = 0; i < 24; i++) { - for (j = 0; j < (int)dimarray[0]; j++) { + for (j = 0; j < 3; j++) { if (make_diffs) buf63[i][j]=0; else buf63[i][j]=n++; } diff --git a/tools/test/h5diff/testfiles/h5diff_58.txt b/tools/test/h5diff/testfiles/h5diff_58.txt index 768dd97..d27a0c9 100644 --- a/tools/test/h5diff/testfiles/h5diff_58.txt +++ b/tools/test/h5diff/testfiles/h5diff_58.txt @@ -1,5 +1,5 @@ dataset: and -Referenced dataset 10720 10720 +Referenced dataset 10784 10784 ------------------------------------------------------------ Region blocks block #0 (2,2)-(7,7) (0,0)-(2,2) diff --git a/tools/test/h5diff/testfiles/h5diff_80.txt b/tools/test/h5diff/testfiles/h5diff_80.txt index 5957d72..836e073 100644 --- a/tools/test/h5diff/testfiles/h5diff_80.txt +++ b/tools/test/h5diff/testfiles/h5diff_80.txt @@ -865,7 +865,7 @@ position vlen3D vlen3D difference [ 3 2 1 ] 59 0 59 59 differences found dataset: and -Referenced dataset 10720 10720 +Referenced dataset 10784 10784 ------------------------------------------------------------ Region blocks block #0 (2,2)-(7,7) (0,0)-(2,2) diff --git a/tools/test/h5diff/testfiles/h5diff_dset1.h5 b/tools/test/h5diff/testfiles/h5diff_dset1.h5 index 123e141..fefd86a 100644 Binary files a/tools/test/h5diff/testfiles/h5diff_dset1.h5 and b/tools/test/h5diff/testfiles/h5diff_dset1.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_dset2.h5 b/tools/test/h5diff/testfiles/h5diff_dset2.h5 index 3ae6993..598e481 100644 Binary files a/tools/test/h5diff/testfiles/h5diff_dset2.h5 and b/tools/test/h5diff/testfiles/h5diff_dset2.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_dset3.h5 b/tools/test/h5diff/testfiles/h5diff_dset3.h5 index 7a1f3dd..893c135 100644 Binary files a/tools/test/h5diff/testfiles/h5diff_dset3.h5 and b/tools/test/h5diff/testfiles/h5diff_dset3.h5 differ -- cgit v0.12 From 2b2a1d605e0f556fcdf38345420047b5776c7ba2 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 18 May 2017 16:32:26 -0500 Subject: Fix for shared fortran libraries on mac (HDFFV-2772). --- configure.ac | 6 ++---- fortran/test/fortranlib_test.F90 | 6 +++--- fortran/test/fortranlib_test_1_8.F90 | 6 +++--- fortran/test/fortranlib_test_F03.F90 | 6 +++--- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index d0aeda9..458a3d2 100644 --- a/configure.ac +++ b/configure.ac @@ -919,12 +919,10 @@ if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then AC_MSG_CHECKING([if shared Fortran libraries are supported]) H5_FORTRAN_SHARED="yes" - ## Disable fortran shared libraries on Mac. (MAM - 03/30/11) - + ## tell libtool to do the right thing with COMMON symbols case "`uname`" in Darwin*) - H5_FORTRAN_SHARED="no" - CHECK_WARN="Shared Fortran libraries not currently supported on Mac." + H5_LDFLAGS="$H5_LDFLAGS -Wl,-commons,use_dylibs" ;; esac diff --git a/fortran/test/fortranlib_test.F90 b/fortran/test/fortranlib_test.F90 index 94b084e..8d5b32b 100644 --- a/fortran/test/fortranlib_test.F90 +++ b/fortran/test/fortranlib_test.F90 @@ -50,11 +50,11 @@ PROGRAM fortranlibtest IF(total_error .EQ. 0) THEN WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") - WRITE(*, '(I1)', advance="NO") majnum + WRITE(*, '(I0)', advance="NO") majnum WRITE(*, '(".")', advance="NO") - WRITE(*, '(I1)', advance="NO") minnum + WRITE(*, '(I0)', advance="NO") minnum WRITE(*, '(" release ")', advance="NO") - WRITE(*, '(I3)') relnum + WRITE(*, '(I0)') relnum ELSE total_error = total_error + 1 ENDIF diff --git a/fortran/test/fortranlib_test_1_8.F90 b/fortran/test/fortranlib_test_1_8.F90 index 850cab9..1306da5 100644 --- a/fortran/test/fortranlib_test_1_8.F90 +++ b/fortran/test/fortranlib_test_1_8.F90 @@ -46,11 +46,11 @@ PROGRAM fortranlibtest CALL h5get_libversion_f(majnum, minnum, relnum, total_error) IF(total_error .EQ. 0) THEN WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") - WRITE(*, '(I1)', advance="NO") majnum + WRITE(*, '(I0)', advance="NO") majnum WRITE(*, '(".")', advance="NO") - WRITE(*, '(I1)', advance="NO") minnum + WRITE(*, '(I0)', advance="NO") minnum WRITE(*, '(" release ")', advance="NO") - WRITE(*, '(I3)') relnum + WRITE(*, '(I0)') relnum ELSE total_error = total_error + 1 ENDIF diff --git a/fortran/test/fortranlib_test_F03.F90 b/fortran/test/fortranlib_test_F03.F90 index ae12dba..9a74120 100644 --- a/fortran/test/fortranlib_test_F03.F90 +++ b/fortran/test/fortranlib_test_F03.F90 @@ -47,11 +47,11 @@ PROGRAM fortranlibtest_F03 CALL h5get_libversion_f(majnum, minnum, relnum, total_error) IF(total_error .EQ. 0) THEN WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") - WRITE(*, '(I1)', advance="NO") majnum + WRITE(*, '(I0)', advance="NO") majnum WRITE(*, '(".")', advance="NO") - WRITE(*, '(I1)', advance="NO") minnum + WRITE(*, '(I0)', advance="NO") minnum WRITE(*, '(" release ")', advance="NO") - WRITE(*, '(I3)') relnum + WRITE(*, '(I0)') relnum ELSE total_error = total_error + 1 ENDIF -- cgit v0.12 From 973aebe25f87b84ff6dd3d9eca51b76643090564 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 19 May 2017 11:35:07 -0500 Subject: Add debug trace commands --- tools/lib/h5diff_attr.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 004672e..74607da 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -91,7 +91,7 @@ static void table_attrs_free( table_attrs_t *table ) /*------------------------------------------------------------------------- * Function: table_attr_mark_exist * - * Purpose: mark given attribute name to table as sign of exsit + * Purpose: mark given attribute name to table as sign of exist * * Parameter: * - exist [IN] @@ -155,6 +155,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t unsigned i; table_attrs_t *table_lp = NULL; + h5difftrace("build_match_list_attrs start\n"); if(H5Oget_info(loc1_id, &oinfo1) < 0) goto error; if(H5Oget_info(loc2_id, &oinfo2) < 0) @@ -162,6 +163,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t table_attrs_init( &table_lp ); + h5diffdebug3("build_match_list_attrs: %ld - %ld\n", curr1 < oinfo1.num_attrs, curr2 < oinfo2.num_attrs); /*-------------------------------------------------- * build the list @@ -226,6 +228,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t /* get name */ if(H5Aget_name(attr1_id, (size_t)ATTR_NAME_MAX, name1) < 0) goto error; + h5diffdebug2("build_match_list_attrs #1 name - %s\n", name1); table_attr_mark_exist(infile, name1, table_lp); table_lp->nattrs_only1++; @@ -247,6 +250,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t /* get name */ if(H5Aget_name(attr2_id, (size_t)ATTR_NAME_MAX, name2) < 0) goto error; + h5diffdebug2("build_match_list_attrs #2 name - %s\n", name2); table_attr_mark_exist(infile, name2, table_lp); table_lp->nattrs_only2++; @@ -278,6 +282,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t *table_out = table_lp; + h5difftrace("build_match_list_attrs end\n"); return 0; error: @@ -286,6 +291,7 @@ error: if (0 < attr2_id) H5Aclose(attr2_id); + h5difftrace("build_match_list_attrs end with error\n"); return -1; } @@ -322,8 +328,8 @@ hsize_t diff_attr(hid_t loc1_id, hid_t space2_id=-1; /* space ID */ hid_t ftype1_id=-1; /* file data type ID */ hid_t ftype2_id=-1; /* file data type ID */ - int vstrtype1=0; /* ftype1 is a variable string */ - int vstrtype2=0; /* ftype2 is a variable string */ + int vstrtype1=0; /* ftype1 is a variable string */ + int vstrtype2=0; /* ftype2 is a variable string */ hid_t mtype1_id=-1; /* memory data type ID */ hid_t mtype2_id=-1; /* memory data type ID */ size_t msize1; /* memory size of memory type */ @@ -346,12 +352,15 @@ hsize_t diff_attr(hid_t loc1_id, hsize_t nfound_total = 0; int j; - table_attrs_t * match_list_attrs = NULL; + table_attrs_t *match_list_attrs = NULL; + h5difftrace("diff_attr start\n"); + if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, options) < 0) goto error; /* if detect any unique extra attr */ if(match_list_attrs->nattrs_only1 || match_list_attrs->nattrs_only2) { + h5difftrace("diff_attr attributes only in one file\n"); /* exit will be 1 */ options->contents = 0; } @@ -359,6 +368,7 @@ hsize_t diff_attr(hid_t loc1_id, for(u = 0; u < (unsigned)match_list_attrs->nattrs; u++) { if((match_list_attrs->attrs[u].exist[0]) && (match_list_attrs->attrs[u].exist[1])) { name1 = name2 = match_list_attrs->attrs[u].name; + h5diffdebug2("diff_attr name - %s\n", name1); /*-------------- * attribute 1 */ @@ -370,6 +380,7 @@ hsize_t diff_attr(hid_t loc1_id, if((attr2_id = H5Aopen(loc2_id, name2, H5P_DEFAULT)) < 0) goto error; + h5difftrace("diff_attr got attributes\n"); /* get the datatypes */ if((ftype1_id = H5Aget_type(attr1_id)) < 0) goto error; @@ -556,6 +567,7 @@ hsize_t diff_attr(hid_t loc1_id, table_attrs_free(match_list_attrs); + h5difftrace("diff_attr end\n"); return nfound_total; error: @@ -584,6 +596,7 @@ error: } H5E_END_TRY; options->err_stat = 1; + h5difftrace("diff_attr end with error\n"); return nfound_total; } -- cgit v0.12 From 14c286d51a13658ea26673efa3f197af06757cee Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 19 May 2017 14:58:34 -0700 Subject: Fixed HDFFV-10214: * Updated comments in the library to accurately reflect the semantics of the H5FD_FEAT_POSIX_COMPAT_HANDLE flag. * Removed the check for the POSIX compatible handle feature flag when determining if a VFD supports SWMR. Partial work for HDFFV-10197: * Added a new H5FD_FEAT_DEFAULT_VFD_COMPATIBLE feature flag that is set when a VFD creates output that is compatible with the default VFD. Will be used in the testing but might also be generally useful to users. --- src/H5FDcore.c | 8 +++++--- src/H5FDdirect.c | 1 + src/H5FDlog.c | 3 ++- src/H5FDmpio.c | 9 +++++---- src/H5FDpublic.h | 8 ++++++++ src/H5FDsec2.c | 3 ++- src/H5FDstdio.c | 9 +++++---- src/H5Fint.c | 4 ---- 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index d100a8b..b980b7e 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -982,9 +982,11 @@ H5FD__core_query(const H5FD_t * _file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_ALLOW_FILE_IMAGE; /* OK to use file image feature with this VFD */ *flags |= H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS; /* OK to use file image callbacks with this VFD */ - /* If the backing store is open, a POSIX file handle is available */ - if(file && file->fd >= 0 && file->backing_store) - *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ + /* These feature flags are only applicable if the backing store is enabled */ + if(file && file->fd >= 0 && file->backing_store) { + *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* get_handle callback returns a POSIX file descriptor */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ + } } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 1487cda..7a4c99c 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -698,6 +698,7 @@ H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ } FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 75333c2..7c6bbd4 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -895,8 +895,9 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ - *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ + *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* get_handle callback returns a POSIX file descriptor */ *flags |= H5FD_FEAT_SUPPORTS_SWMR_IO; /* VFD supports the single-writer/multiple-readers (SWMR) pattern */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ /* Check for flags that are set by h5repart */ if(file && file->fam_to_sec2) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index ace91f8..f594d8e 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1150,10 +1150,11 @@ H5FD_mpio_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags /* out /* Set the VFL feature flags that this driver supports */ if(flags) { *flags=0; - *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ - *flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ - *flags|=H5FD_FEAT_HAS_MPI; /* This driver uses MPI */ - *flags|=H5FD_FEAT_ALLOCATE_EARLY; /* Allocate space early instead of late */ + *flags |= H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ + *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_HAS_MPI; /* This driver uses MPI */ + *flags |= H5FD_FEAT_ALLOCATE_EARLY; /* Allocate space early instead of late */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 3032e8a..45b1237 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -250,6 +250,14 @@ typedef enum H5F_mem_t H5FD_mem_t; * This is specifically used for the multi/split driver. */ #define H5FD_FEAT_PAGED_AGGR 0x00004000 + /* + * Defining H5FD_FEAT_DEFAULT_VFD_COMPATIBLE for a VFL driver + * that creates a file which is compatible with the default VFD. + * Generally, this means that the VFD creates a single file that follows + * the canonical HDF5 file format. + */ +#define H5FD_FEAT_DEFAULT_VFD_COMPATIBLE 0x00008000 + /* Forward declaration */ typedef struct H5FD_t H5FD_t; diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 26913e2..b6385fb 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -527,8 +527,9 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ - *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ + *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* get_handle callback returns a POSIX file descriptor */ *flags |= H5FD_FEAT_SUPPORTS_SWMR_IO; /* VFD supports the single-writer/multiple-readers (SWMR) pattern */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ /* Check for flags that are set by h5repart */ if(file && file->fam_to_sec2) diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 5023af3..861c6a6 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -555,10 +555,11 @@ H5FD_stdio_query(const H5FD_t *_f, unsigned long /*OUT*/ *flags) */ if(flags) { *flags = 0; - *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ - *flags|=H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ - *flags|=H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ - *flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ + *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ + *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ + *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ } return 0; diff --git a/src/H5Fint.c b/src/H5Fint.c index fe532b2..e52d539 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -715,10 +715,6 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t if(!H5F_HAS_FEATURE(f, H5FD_FEAT_SUPPORTS_SWMR_IO) && (H5F_INTENT(f) & (H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ))) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "must use a SWMR-compatible VFD when SWMR is specified") - /* Require a POSIX compatible VFD to use SWMR feature */ - /* (It's reasonable to try to expand this to other VFDs eventually -QAK) */ - if(!H5F_HAS_FEATURE(f, H5FD_FEAT_POSIX_COMPAT_HANDLE) && (H5F_INTENT(f) & (H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ))) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "must use POSIX compatible VFD with SWMR write access") if(H5FD_get_fs_type_map(lf, f->shared->fs_type_map) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get free space type mapping from VFD") if(H5MF_init_merge_flags(f) < 0) -- cgit v0.12 From cdcef539a3d359c8a7082923b947d920d738cd56 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 22 May 2017 13:10:40 -0500 Subject: HDFFV-8611 change h5repack to save the root group creation order Added test and new arguments to control the the input file parsing. --- MANIFEST | 1 + tools/lib/h5tools.c | 4 + tools/lib/h5tools.h | 4 + tools/src/h5dump/h5dump.h | 4 - tools/src/h5dump/h5dump_extern.h | 4 - tools/src/h5repack/h5repack.c | 2 + tools/src/h5repack/h5repack.h | 24 +++--- tools/src/h5repack/h5repack_copy.c | 39 +++++++--- tools/src/h5repack/h5repack_main.c | 87 ++++++++++++++++++++-- tools/src/h5repack/h5repack_verify.c | 17 +++-- tools/test/h5repack/CMakeTests.cmake | 9 ++- .../h5repack/testfiles/crtorder.tordergr.h5.ddl | 36 +++++++++ tools/test/h5repack/testfiles/h5repack-help.txt | 4 + 13 files changed, 191 insertions(+), 44 deletions(-) create mode 100644 tools/test/h5repack/testfiles/crtorder.tordergr.h5.ddl diff --git a/MANIFEST b/MANIFEST index dde7632..c34e614 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2432,6 +2432,7 @@ ./tools/test/h5repack/testfiles/h5repack_soffset.h5 ./tools/test/h5repack/testfiles/h5repack_szip.h5 ./tools/test/h5repack/testfiles/ublock.bin +./tools/test/h5repack/testfiles/crtorder.tordergr.h5.ddl ./tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl ./tools/test/h5repack/testfiles/plugin_none.h5repack_layout.UD.h5.tst ./tools/test/h5repack/testfiles/plugin_test.h5repack_layout.h5.tst diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index a74fdd2..22fd863 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -51,6 +51,10 @@ unsigned packed_data_length; /* length of packed bits to display */ unsigned long long packed_data_mask; /* mask in which packed bits to display */ int enable_error_stack= FALSE; /* re-enable error stack */ +/* sort parameters */ +H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */ +H5_iter_order_t sort_order = H5_ITER_INC; /*sort_order [ascending | descending] */ + /* module-scoped variables */ static int h5tools_init_g; /* if h5tools lib has been initialized */ diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index c5e750a..3d38dd0 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -568,6 +568,10 @@ H5TOOLS_DLLVAR int oid_output; /* oid output */ H5TOOLS_DLLVAR int data_output; /* data output */ H5TOOLS_DLLVAR int attr_data_output; /* attribute data output */ +/* sort parameters */ +H5TOOLS_DLLVAR H5_index_t sort_by; /*sort_by [creation_order | name] */ +H5TOOLS_DLLVAR H5_iter_order_t sort_order; /*sort_order [ascending | descending] */ + /* things to display or which are set via command line parameters */ H5TOOLS_DLLVAR int enable_error_stack; /* re-enable error stack */ diff --git a/tools/src/h5dump/h5dump.h b/tools/src/h5dump/h5dump.h index 211fd14..801f60d 100644 --- a/tools/src/h5dump/h5dump.h +++ b/tools/src/h5dump/h5dump.h @@ -78,10 +78,6 @@ int include_attrs = TRUE; /* Display attributes */ int display_vds_first = FALSE; /* vds display to all by default*/ int vds_gap_size = 0; /* vds skip missing files default is none */ -/* sort parameters */ -H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */ -H5_iter_order_t sort_order = H5_ITER_INC; /*sort_order [ascending | descending] */ - #define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */ #define PACKED_BITS_SIZE_MAX (8*sizeof(long long)) /* Maximum bits size of integer types of packed-bits */ /* mask list for packed bits */ diff --git a/tools/src/h5dump/h5dump_extern.h b/tools/src/h5dump/h5dump_extern.h index 22aca73..00d3bd2 100644 --- a/tools/src/h5dump/h5dump_extern.h +++ b/tools/src/h5dump/h5dump_extern.h @@ -77,10 +77,6 @@ extern int include_attrs; /* Display attributes */ extern int display_vds_first; /* vds display to first missing */ extern int vds_gap_size; /* vds skip missing files */ -/* sort parameters */ -extern H5_index_t sort_by; /*sort_by [creation_order | name] */ -extern H5_iter_order_t sort_order; /*sort_order [ascending | descending] */ - #define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */ #define PACKED_BITS_SIZE_MAX 8*sizeof(long long) /* Maximum bits size of integer types of packed-bits */ /* mask list for packed bits */ diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 3c9ce90..bc8527b 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -784,6 +784,8 @@ static int check_objects(const char* fname, pack_opt_t *options) { *------------------------------------------------------------------------- */ + /* Initialize indexing options */ + h5trav_set_index(sort_by, sort_order); /* init table */ trav_table_init(&travt); diff --git a/tools/src/h5repack/h5repack.h b/tools/src/h5repack/h5repack.h index e36f0ef..e5ae03f 100644 --- a/tools/src/h5repack/h5repack.h +++ b/tools/src/h5repack/h5repack.h @@ -29,10 +29,10 @@ #define MAX_COMPACT_DSIZE 64512 /* max data size for compact layout. -1k for header size */ /* File space default information */ -#define FS_PAGESIZE_DEF 4096 -#define FS_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR -#define FS_PERSIST_DEF FALSE -#define FS_THRESHOLD_DEF 1 +#define FS_PAGESIZE_DEF 4096 +#define FS_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR +#define FS_PERSIST_DEF FALSE +#define FS_THRESHOLD_DEF 1 /*------------------------------------------------------------------------- @@ -120,10 +120,10 @@ typedef struct { hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */ hsize_t threshold; /* alignment threshold for H5Pset_alignment */ hsize_t alignment; /* alignment for H5Pset_alignment */ - H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */ - int fs_persist; /* Free space section threshold */ - long fs_threshold; /* Free space section threshold */ - long long fs_pagesize; /* File space page size */ + H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */ + int fs_persist; /* Free space section threshold */ + long fs_threshold; /* Free space section threshold */ + long long fs_pagesize; /* File space page size */ } pack_opt_t; @@ -150,10 +150,10 @@ int h5repack_end(pack_opt_t *options); int h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options); int h5repack_cmp_pl(const char *fname1, const char *fname2); -/* Note: The below copy_named_datatype(), named_datatype_free(), copy_attr() - * and struct named_dt_t were located in h5repack_copy.c as static prior to - * bugfix1726. - * Made shared functions as copy_attr() was needed in h5repack_refs.c. +/* Note: The below copy_named_datatype(), named_datatype_free(), copy_attr() + * and struct named_dt_t were located in h5repack_copy.c as static prior to + * bugfix1726. + * Made shared functions as copy_attr() was needed in h5repack_refs.c. * However copy_attr() may be obsoleted when H5Acopy is available and put back * others to static in h5repack_copy.c. */ diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index ec3e287..42fedbc 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -103,6 +103,7 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) hbool_t in_persist; /* Persist free-space status from input file */ hsize_t in_threshold; /* Free-space section threshold from input file */ hsize_t in_pagesize; /* File space page size from input file */ + unsigned crt_order_flags; /* group creation order flag */ /*------------------------------------------------------------------------- * open input file @@ -116,6 +117,8 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) /* get user block size and file space strategy/persist/threshold */ { hid_t fcpl_in; /* file creation property list ID for input file */ + hid_t grp_in = -1; /* group ID */ + hid_t gcpl_in = -1; /* group creation property list */ if ((fcpl_in = H5Fget_create_plist(fidin)) < 0) { error_msg("failed to retrieve file creation property list\n"); @@ -127,17 +130,28 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); } - /* If the -S option is not set, get "strategy" from the input file */ - if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) { - error_msg("failed to retrieve file space strategy\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + /* If the -S option is not set, get "strategy" from the input file */ + if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) { + error_msg("failed to retrieve file space strategy\n"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + } - /* If the -G option is not set, get "pagesize" from the input file */ - if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) { - error_msg("failed to retrieve file space threshold\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + /* If the -G option is not set, get "pagesize" from the input file */ + if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) { + error_msg("failed to retrieve file space threshold\n"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + } + /* open root group */ + if ((grp_in = H5Gopen2(fidin, "/", H5P_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); + + /* get root group creation property list */ + if ((gcpl_in = H5Gget_create_plist(grp_in)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gget_create_plist failed"); + + /* query and set the group creation properties */ + if (H5Pget_link_creation_order(gcpl_in, &crt_order_flags) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_link_creation_order failed"); if (H5Pclose(fcpl_in) < 0) { error_msg("failed to close property list\n"); @@ -309,6 +323,9 @@ print_user_block(fnamein, fidin); } } + if(H5Pset_link_creation_order(fcpl, crt_order_flags ) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_link_creation_order failed"); + /* Set file space info to those from input file */ set_strategy = in_strategy; set_persist = in_persist; @@ -375,6 +392,8 @@ print_user_block(fnamein, fidin); *------------------------------------------------------------------------- */ + /* Initialize indexing options */ + h5trav_set_index(sort_by, sort_order); /* init table */ trav_table_init(&travt); diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 339dc83..31b1e14 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -31,7 +31,7 @@ const char *outfile = NULL; * Command-line options: The user can specify short or long-named * parameters. */ -static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:M:t:a:i:o:S:P:T:G:E"; +static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:M:t:a:i:o:S:P:T:G:q:z:E"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "version", no_arg, 'V' }, @@ -56,6 +56,8 @@ static struct long_options l_opts[] = { { "fs_persist", require_arg, 'P' }, { "fs_threshold", require_arg, 'T' }, { "fs_pagesize", require_arg, 'G' }, + { "sort_by", require_arg, 'q' }, + { "sort_order", require_arg, 'z' }, { "enable-error-stack", no_arg, 'E' }, { NULL, 0, '\0' } }; @@ -90,6 +92,8 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " -M A, --metadata_block_size=A Metadata block size for H5Pset_meta_block_size\n"); PRINTVALSTREAM(rawoutstream, " -t T, --threshold=T Threshold value for H5Pset_alignment\n"); PRINTVALSTREAM(rawoutstream, " -a A, --alignment=A Alignment value for H5Pset_alignment\n"); + PRINTVALSTREAM(rawoutstream, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n"); + PRINTVALSTREAM(rawoutstream, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n"); PRINTVALSTREAM(rawoutstream, " -f FILT, --filter=FILT Filter type\n"); PRINTVALSTREAM(rawoutstream, " -l LAYT, --layout=LAYT Layout type\n"); PRINTVALSTREAM(rawoutstream, " -S FS_STRATEGY, --fs_strategy=FS_STRATEGY File space management strategy for H5Pset_file_space_strategy\n"); @@ -103,6 +107,8 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " U - is a filename.\n"); PRINTVALSTREAM(rawoutstream, " T - is an integer\n"); PRINTVALSTREAM(rawoutstream, " A - is an integer greater than zero\n"); + PRINTVALSTREAM(rawoutstream, " Q - is the sort index type for the input file. It can be \"name\" or \"creation_order\" (default)\n"); + PRINTVALSTREAM(rawoutstream, " Z - is the sort order type for the input file. It can be \"descending\" or \"ascending\" (default)\n"); PRINTVALSTREAM(rawoutstream, " B - is the user block size, any value that is 512 or greater and is\n"); PRINTVALSTREAM(rawoutstream, " a power of 2 (1024 default)\n"); PRINTVALSTREAM(rawoutstream, " F - is the shared object header message type, any of fs_persist = HDatoi( opt_arg ); + options->fs_persist = HDatoi(opt_arg); if(options->fs_persist == 0) /* To distinguish the "specified" zero value */ options->fs_persist = -1; break; case 'T': - options->fs_threshold = HDatol( opt_arg ); + options->fs_threshold = HDatol(opt_arg); if(options->fs_threshold == 0) /* To distinguish the "specified" zero value */ options->fs_threshold = -1; @@ -570,12 +622,30 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) options->fs_pagesize = HDstrtoll(opt_arg, NULL, 0); if(options->fs_pagesize == 0) /* To distinguish the "specified" zero value */ - options->fs_pagesize = -1; + options->fs_pagesize = -1; break; - case 'E': - enable_error_stack = TRUE; - break; + case 'q': + if((sort_by = set_sort_by(opt_arg)) < 0) { + error_msg(" failed to set sort by form <%s>\n", opt_arg); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'z': + if((sort_order = set_sort_order(opt_arg)) < 0) { + error_msg(" failed to set sort order form <%s>\n", opt_arg); + h5tools_setstatus(EXIT_FAILURE); + ret_value = -1; + goto done; + } + break; + + case 'E': + enable_error_stack = TRUE; + break; default: break; @@ -644,6 +714,9 @@ int main(int argc, const char **argv) /* initialize options */ h5repack_init(&options, 0, FALSE); + /* Initialize default indexing options */ + sort_by = H5_INDEX_CRT_ORDER; + if (parse_command_line(argc, argv, &options) < 0) goto done; diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c index 7e79aa7..4ff4875 100644 --- a/tools/src/h5repack/h5repack_verify.c +++ b/tools/src/h5repack/h5repack_verify.c @@ -55,11 +55,11 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options trav_table_t *travt = NULL; int ok = 1; hid_t fcpl_in = -1; /* file creation property for input file */ - hid_t fcpl_out = -1; /* file creation property for output file */ - H5F_fspace_strategy_t in_strategy, out_strategy; /* file space handling strategy for in/output file */ - hbool_t in_persist, out_persist; /* free-space persist status for in/output file */ - hsize_t in_threshold, out_threshold; /* free-space section threshold for in/output file */ - hsize_t in_pagesize, out_pagesize; /* file space page size for input/output file */ + hid_t fcpl_out = -1; /* file creation property for output file */ + H5F_fspace_strategy_t in_strategy, out_strategy; /* file space handling strategy for in/output file */ + hbool_t in_persist, out_persist; /* free-space persist status for in/output file */ + hsize_t in_threshold, out_threshold; /* free-space section threshold for in/output file */ + hsize_t in_pagesize, out_pagesize; /* file space page size for input/output file */ /* open the output file */ if((fidout = H5Fopen(out_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) @@ -122,6 +122,8 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options if(options->all_filter == 1 || options->all_layout == 1) { + /* Initialize indexing options */ + h5trav_set_index(sort_by, sort_order); /* init table */ trav_table_init(&travt); @@ -455,6 +457,9 @@ int h5repack_cmp_pl(const char *fname1, * get file table list of objects *------------------------------------------------------------------------- */ + /* Initialize indexing options */ + h5trav_set_index(sort_by, sort_order); + /* init table */ trav_table_init(&trav); if(h5trav_gettable(fid1, trav) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed"); @@ -643,7 +648,7 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) { case H5Z_FILTER_NONE: - break; + break; case H5Z_FILTER_SHUFFLE: /* 1 private client value is returned by DCPL */ diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 04e405f..897209c 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -90,6 +90,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tfamily00008.h5 ${HDF5_TOOLS_DIR}/testfiles/tfamily00009.h5 ${HDF5_TOOLS_DIR}/testfiles/tfamily00010.h5 + ${HDF5_TOOLS_DIR}/testfiles/tordergr.h5 # tools/testfiles/vds ${HDF5_TOOLS_DIR}/testfiles/vds/1_a.h5 ${HDF5_TOOLS_DIR}/testfiles/vds/1_b.h5 @@ -137,6 +138,7 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/4_vds.h5-vds_compa-v.ddl ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/4_vds.h5-vds_conti-v.ddl ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_zero.tst + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/crtorder.tordergr.h5.ddl ) foreach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) @@ -312,7 +314,7 @@ NAME H5REPACK_DMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-pH;out-${testname}.${resultfile}" + -D "TEST_ARGS:STRING=-q;creation_order;-pH;out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}-${testname}.out" -D "TEST_EXPECT=${resultcode}" @@ -965,6 +967,11 @@ endif () ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) +#crtorder + set (arg tordergr.h5 -L) + set (TESTTYPE "TEST") + ADD_H5_DMP_TEST (crtorder ${TESTTYPE} 0 ${arg}) + ######################################################### # layout options (these files have no filters) ######################################################### diff --git a/tools/test/h5repack/testfiles/crtorder.tordergr.h5.ddl b/tools/test/h5repack/testfiles/crtorder.tordergr.h5.ddl new file mode 100644 index 0000000..870d154 --- /dev/null +++ b/tools/test/h5repack/testfiles/crtorder.tordergr.h5.ddl @@ -0,0 +1,36 @@ +HDF5 "out-crtorder.tordergr.h5" { +GROUP "/" { + GROUP "2" { + GROUP "a" { + GROUP "a1" { + } + GROUP "a2" { + GROUP "a21" { + } + GROUP "a22" { + } + } + } + GROUP "b" { + } + GROUP "c" { + } + } + GROUP "1" { + GROUP "c" { + } + GROUP "b" { + } + GROUP "a" { + GROUP "a1" { + } + GROUP "a2" { + GROUP "a22" { + } + GROUP "a21" { + } + } + } + } +} +} diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt index 69b1644..65edd89 100644 --- a/tools/test/h5repack/testfiles/h5repack-help.txt +++ b/tools/test/h5repack/testfiles/h5repack-help.txt @@ -17,6 +17,8 @@ usage: h5repack [OPTIONS] file1 file2 -M A, --metadata_block_size=A Metadata block size for H5Pset_meta_block_size -t T, --threshold=T Threshold value for H5Pset_alignment -a A, --alignment=A Alignment value for H5Pset_alignment + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z -f FILT, --filter=FILT Filter type -l LAYT, --layout=LAYT Layout type -S FS_STRATEGY, --fs_strategy=FS_STRATEGY File space management strategy for H5Pset_file_space_strategy @@ -30,6 +32,8 @@ usage: h5repack [OPTIONS] file1 file2 U - is a filename. T - is an integer A - is an integer greater than zero + Q - is the sort index type for the input file. It can be "name" or "creation_order" (default) + Z - is the sort order type for the input file. It can be "descending" or "ascending" (default) B - is the user block size, any value that is 512 or greater and is a power of 2 (1024 default) F - is the shared object header message type, any of Date: Mon, 22 May 2017 13:24:53 -0500 Subject: Remove obsolete function --- tools/lib/h5tools_type.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c index b57e274..ae7160b 100644 --- a/tools/lib/h5tools_type.c +++ b/tools/lib/h5tools_type.c @@ -15,38 +15,6 @@ #include "h5tools.h" /*------------------------------------------------------------------------- - * Function: h5tools_get_native_type - * - * Purpose: Wrapper around H5Tget_native_type() to work around - * Problems with bitfields. - * - * Return: Success: datatype ID - * - * Failure: FAIL - * - * Programmer: Quincey Koziol - * Tuesday, October 5, 2004 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -hid_t -h5tools_get_native_type(hid_t type) -{ - hid_t p_type; - H5T_class_t type_class; - - type_class = H5Tget_class(type); - if(type_class==H5T_BITFIELD) - p_type=H5Tcopy(type); - else - p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT); - - return(p_type); -} - -/*------------------------------------------------------------------------- * Function: h5tools_get_little_endian_type * * Purpose: Get a little endian type from a file type -- cgit v0.12 From 0f81f23d69f64d2a508200e6f927e977333c8ba1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 22 May 2017 13:55:15 -0500 Subject: HDFFV-8611 add autotools test --- tools/test/h5repack/h5repack.sh.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index e479031..bc6b527 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -113,6 +113,7 @@ $SRC_TOOLS_TESTFILES/tfamily00007.h5 $SRC_TOOLS_TESTFILES/tfamily00008.h5 $SRC_TOOLS_TESTFILES/tfamily00009.h5 $SRC_TOOLS_TESTFILES/tfamily00010.h5 +$SRC_TOOLS_TESTFILES/tordergr.h5 $SRC_TOOLS_TESTFILES/vds/1_a.h5 $SRC_TOOLS_TESTFILES/vds/1_b.h5 $SRC_TOOLS_TESTFILES/vds/1_c.h5 @@ -143,6 +144,7 @@ $SRC_H5REPACK_TESTFILES/h5repack-help.txt $SRC_H5REPACK_TESTFILES/h5repack_ext.bin $SRC_H5REPACK_TESTFILES/ublock.bin $SRC_H5REPACK_TESTFILES/h5repack.info +$SRC_H5REPACK_TESTFILES/crtorder.tordergr.h5.ddl $SRC_H5REPACK_TESTFILES/deflate_limit.h5repack_layout.h5.ddl $SRC_H5REPACK_TESTFILES/h5repack_layout.h5.ddl $SRC_H5REPACK_TESTFILES/h5repack_filters.h5-gzip_verbose_filters.tst @@ -684,7 +686,7 @@ TOOLTEST_DUMP() VERIFY h5dump output $@ ( cd $TESTDIR - $RUNSERIAL $H5DUMP_BIN -pH $outfile + $RUNSERIAL $H5DUMP_BIN -q creation_order -pH $outfile ) >$actual 2>$actual_err cat $actual_err >> $actual @@ -1051,6 +1053,10 @@ else TOOLTEST deflate_file $arg fi +#crtorder +arg="tordergr.h5 -L" +TOOLTEST_DUMP crtorder $arg + ######################################################### # layout options (these files have no filters) ######################################################### -- cgit v0.12 From 97ac37592b75b1f799f9b24a71ced0fa85925086 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 22 May 2017 15:45:17 -0500 Subject: Fix for shared fortran libraries on mac (HDFFV-2772). --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index 458a3d2..d8e9b9e 100644 --- a/configure.ac +++ b/configure.ac @@ -3482,6 +3482,12 @@ chmod 755 tools/src/misc/h5cc if test "X$HDF_FORTRAN" = "Xyes"; then chmod 755 fortran/src/h5fc + ## tell libtool to pass the correct argument linker, needed only for intel compiler. + case "`uname`" in + Darwin*) + cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv libtool.tmp libtool && chmod 755 libtool + ;; + esac fi if test "X$HDF_CXX" = "Xyes"; then -- cgit v0.12 From 6301d5a6cb7527f7f2eed0d60d1faaf154ed9976 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 22 May 2017 16:03:56 -0500 Subject: Fix for shared fortran libraries on mac (HDFFV-2772). --- configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d8e9b9e..b6f37bc 100644 --- a/configure.ac +++ b/configure.ac @@ -3482,10 +3482,11 @@ chmod 755 tools/src/misc/h5cc if test "X$HDF_FORTRAN" = "Xyes"; then chmod 755 fortran/src/h5fc - ## tell libtool to pass the correct argument linker, needed only for intel compiler. + ## tell libtool to pass the correct argument linker, needed only for intel compiler. This script + ## replaces the 3rd occurance, which is for Fortran, of wl="" with wl="-Wl," case "`uname`" in Darwin*) - cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv libtool.tmp libtool && chmod 755 libtool + cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool ;; esac fi -- cgit v0.12 From 69ccaee00a2778c7334587b6f6d51e16ff674ec9 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 23 May 2017 09:53:59 -0500 Subject: add documention comments for shared Fortran Fix on OSX --- configure.ac | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index b6f37bc..9695fe3 100644 --- a/configure.ac +++ b/configure.ac @@ -918,12 +918,13 @@ H5_FORTRAN_SHARED="no" if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then AC_MSG_CHECKING([if shared Fortran libraries are supported]) H5_FORTRAN_SHARED="yes" - - ## tell libtool to do the right thing with COMMON symbols + ## tell libtool to do the right thing with COMMON symbols, this fixes + ## corrupt values with COMMON and EQUIVALENCE when building shared + ## Fortran libraries on OSX with gnu and Intel compilers (HDFFV-2772). case "`uname`" in Darwin*) H5_LDFLAGS="$H5_LDFLAGS -Wl,-commons,use_dylibs" - ;; + ;; esac ## Report results of check(s) @@ -3482,8 +3483,9 @@ chmod 755 tools/src/misc/h5cc if test "X$HDF_FORTRAN" = "Xyes"; then chmod 755 fortran/src/h5fc - ## tell libtool to pass the correct argument linker, needed only for intel compiler. This script - ## replaces the 3rd occurance, which is for Fortran, of wl="" with wl="-Wl," + ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler + ## on OS X, which is needed when building shared libraries on OS X. This script + ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772) case "`uname`" in Darwin*) cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool -- cgit v0.12 From 8f25e21e105c2ed625c60e92f4d24ac4c0965219 Mon Sep 17 00:00:00 2001 From: Frank Willmore Date: Tue, 23 May 2017 10:14:35 -0700 Subject: enabled MPI error handling --- src/H5FDmpi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index fdc4eca..2b10151 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -278,6 +278,11 @@ H5FD_mpi_comm_info_dup(MPI_Comm comm, MPI_Info info, MPI_Comm *comm_new, MPI_Inf info_dup = info; } + /* Set MPI_ERRORS_RETURN on comm_dup so that MPI failures are not fatal, + and return codes can be checked and handled. May 23, 2017 FTW */ + if (MPI_SUCCESS != (mpi_code = MPI_Errhandler_set(comm_dup, MPI_ERRORS_RETURN))) + HMPI_GOTO_ERROR(FAIL, "MPI_Errhandler_set failed", mpi_code) + /* copy them to the return arguments */ *comm_new = comm_dup; *info_new = info_dup; -- cgit v0.12 From 364fe58feab9ae7296b204df2ecce388975da57e Mon Sep 17 00:00:00 2001 From: Frank Willmore Date: Tue, 23 May 2017 10:20:37 -0700 Subject: cleanup --- this_is_a_test | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 this_is_a_test diff --git a/this_is_a_test b/this_is_a_test deleted file mode 100644 index e69de29..0000000 -- cgit v0.12 From 57ab1e7d6945c45107ebdd945bb89951ec90b8f1 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 23 May 2017 17:14:21 -0500 Subject: add linking flag to cmake, does not fix the issue, still disabled shared with fortran --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce91052..b84cc7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -851,6 +851,11 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for option (SKIP_HDF5_FORTRAN_SHARED "Do not build the fortran shared libraries" OFF) if (HDF5_BUILD_FORTRAN) if (BUILD_SHARED_LIBS AND APPLE) + # Tell cmake to do the right thing with COMMON symbols, this fixes + # corrupt values with COMMON and EQUIVALENCE when building shared + # Fortran libraries on OSX with gnu and Intel compilers (HDFFV-2772). + # *** NOTE: Fix does not work with Cmake. *** + # set (HDF5_LINKER_FLAGS "-Wl,-commons,use_dylibs") if (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Shared FORTRAN libraries are unsupported **** ") set (SKIP_HDF5_FORTRAN_SHARED ON) -- cgit v0.12 From 1ee90786196c10c2c616a9fb4b8b1f92ebefa1f2 Mon Sep 17 00:00:00 2001 From: Frank Willmore Date: Tue, 23 May 2017 19:01:52 -0700 Subject: updated MPI error handling call for MPICH2 standard --- src/H5FDmpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 2b10151..3f0160e 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -280,7 +280,7 @@ H5FD_mpi_comm_info_dup(MPI_Comm comm, MPI_Info info, MPI_Comm *comm_new, MPI_Inf /* Set MPI_ERRORS_RETURN on comm_dup so that MPI failures are not fatal, and return codes can be checked and handled. May 23, 2017 FTW */ - if (MPI_SUCCESS != (mpi_code = MPI_Errhandler_set(comm_dup, MPI_ERRORS_RETURN))) + if (MPI_SUCCESS != (mpi_code = MPI_Comm_set_errhandler(comm_dup, MPI_ERRORS_RETURN))) HMPI_GOTO_ERROR(FAIL, "MPI_Errhandler_set failed", mpi_code) /* copy them to the return arguments */ -- cgit v0.12 From e3b22b8fa45697d6f73330b33cd201c37e0335d6 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 24 May 2017 06:51:45 -0400 Subject: Initialized IDs to -1 and minor code tidy. --- test/swmr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/swmr.c b/test/swmr.c index 399a9ec..5b50d63 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -116,12 +116,12 @@ static int test_multiple_same(hid_t in_fapl, hbool_t new_format); static int test_metadata_read_attempts(hid_t in_fapl) { - hid_t fapl; /* File access property list */ - hid_t file_fapl; /* The file's access property list */ - hid_t fid, fid1, fid2; /* File IDs */ - unsigned attempts; /* The # of read attempts */ - char filename[NAME_BUF_SIZE]; /* File name */ - herr_t ret; /* Generic return value */ + hid_t fapl = -1; /* File access property list */ + hid_t file_fapl = -1; /* The file's access property list */ + hid_t fid = -1, fid1 = -1, fid2 = -1; /* File IDs */ + unsigned attempts; /* The # of read attempts */ + char filename[NAME_BUF_SIZE]; /* File name */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ TESTING("H5Pget/set_metadata_read_attempts()"); -- cgit v0.12 From e5a57c97aa43d6c76d1bb1fe64d24aaa0bbbb7d3 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 24 May 2017 07:44:18 -0400 Subject: * Made H5FD_driver_query() a private function instead of static. * Moved H5FD_driver_query() to H5FDint.c. * Minor typo fixes in H5I.c. * Updated swmr.c to check the VFD feature flags and skip the retries test when the VFD is not compatible with H5P_DEFAULT. --- src/H5FD.c | 37 ------------------------------------- src/H5FDint.c | 37 +++++++++++++++++++++++++++++++++++++ src/H5FDprivate.h | 1 + src/H5I.c | 4 ++-- test/swmr.c | 36 ++++++++++++++++++++++++++++++------ 5 files changed, 70 insertions(+), 45 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index dcfaa6d..d3cb77c 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -62,7 +62,6 @@ /********************/ static herr_t H5FD_free_cls(H5FD_class_t *cls); static int H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/); -static int H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/); /*********************/ /* Package Variables */ @@ -1085,42 +1084,6 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) /*------------------------------------------------------------------------- -* Function: H5FD_driver_query -* -* Purpose: Similar to H5FD_query(), but intended for cases when we don't -* have a file available (e.g. before one is opened). Since we -* can't use the file to get the driver, the driver is passed in -* as a parameter. -* -* Return: Success: non-negative -* Failure: negative -* -* Programmer: Jacob Gruber -* Wednesday, August 17, 2011 -* -*------------------------------------------------------------------------- -*/ -static int -H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/) -{ - int ret_value = 0; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(driver); - HDassert(flags); - - /* Check for the driver to query and then query it */ - if(driver->query) - ret_value = (driver->query)(NULL, flags); - else - *flags = 0; - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_driver_query() */ - - -/*------------------------------------------------------------------------- * Function: H5FDalloc * * Purpose: Allocates SIZE bytes of memory from the FILE. The memory will diff --git a/src/H5FDint.c b/src/H5FDint.c index bc322d6..ccf0f2e 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -433,3 +433,40 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_get_eof() */ + +/*------------------------------------------------------------------------- +* Function: H5FD_driver_query +* +* Purpose: Similar to H5FD_query(), but intended for cases when we don't +* have a file available (e.g. before one is opened). Since we +* can't use the file to get the driver, the driver is passed in +* as a parameter. +* +* Return: Success: non-negative +* Failure: negative +* +* Programmer: Jacob Gruber +* Wednesday, August 17, 2011 +* +*------------------------------------------------------------------------- +*/ +int +H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/) +{ + int ret_value = 0; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(driver); + HDassert(flags); + + /* Check for the driver to query and then query it */ + if(driver->query) + ret_value = (driver->query)(NULL, flags); + else + *flags = 0; + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD_driver_query() */ + + diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 0fc2135..589e391 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -153,6 +153,7 @@ H5_DLL H5FD_t *H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); H5_DLL herr_t H5FD_close(H5FD_t *file); H5_DLL int H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2); +H5_DLL int H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/); H5_DLL haddr_t H5FD_alloc(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, struct H5F_t *f, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size); H5_DLL herr_t H5FD_free(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, struct H5F_t *f, diff --git a/src/H5I.c b/src/H5I.c index ce4ecdc..42edf58 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -888,7 +888,7 @@ H5I_subst(hid_t id, const void *new_object) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end if */ +} /* end H5I_subst() */ /*------------------------------------------------------------------------- @@ -920,7 +920,7 @@ H5I_object(hid_t id) } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end if */ +} /* end H5I_object() */ /*------------------------------------------------------------------------- diff --git a/test/swmr.c b/test/swmr.c index 5b50d63..9239ca2 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -116,16 +116,40 @@ static int test_multiple_same(hid_t in_fapl, hbool_t new_format); static int test_metadata_read_attempts(hid_t in_fapl) { - hid_t fapl = -1; /* File access property list */ - hid_t file_fapl = -1; /* The file's access property list */ - hid_t fid = -1, fid1 = -1, fid2 = -1; /* File IDs */ - unsigned attempts; /* The # of read attempts */ - char filename[NAME_BUF_SIZE]; /* File name */ - herr_t ret; /* Generic return value */ + hid_t fapl = -1; /* File access property list */ + hid_t file_fapl = -1; /* The file's access property list */ + hid_t fid = -1, fid1 = -1, fid2 = -1; /* File IDs */ + hid_t driver_id = -1; /* ID for this VFD */ + H5FD_class_t *driver = NULL; /* Pointer to VFD class struct */ + unsigned long driver_flags = 0; /* VFD feature flags */ + hbool_t compat_w_default_vfd; /* current VFD compat w/ H5P_DEFAULT? */ + unsigned attempts; /* The # of read attempts */ + char filename[NAME_BUF_SIZE]; /* File name */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ TESTING("H5Pget/set_metadata_read_attempts()"); + /* Check if the driver is compatible with the default VFD. + * Most of the tests will attempt to create and open files with both the + * VFD specified in the passed-in fapl and the default VFD. Since this + * will clearly not work with VFDs that are not compatible with the default + * fapl (e.g.: split/multi), we just skip this entire test. + */ + if ((driver_id = H5Pget_driver(in_fapl)) < 0) + FAIL_STACK_ERROR + if (NULL == (driver = (H5FD_class_t *)H5I_object_verify(driver_id, H5I_VFL))) + FAIL_STACK_ERROR + if (H5FD_driver_query(driver, &driver_flags) < 0) + FAIL_STACK_ERROR + compat_w_default_vfd = (driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE) ? TRUE : FALSE; + + if (!compat_w_default_vfd) { + SKIPPED() + HDputs(" The current VFD is not compatible with the default VFD."); + return 0; + } + /* Get a copy of the parameter fapl */ if((fapl = H5Pcopy(in_fapl)) < 0) FAIL_STACK_ERROR -- cgit v0.12 From 479f326a267ca5ffacc2012f33674c66cf2907d8 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 24 May 2017 09:41:26 -0400 Subject: * Added new public H5FDdriver_query() API call. * Changed return type of H5FD_driver_query() to herr_t. * Updated swmr.c to use H5FDdriver_query() instead of the private call. * Added some flags tests to vfd.c. --- src/H5FD.c | 42 +++++++++++++++++++++++++++++++++++++++++- src/H5FDint.c | 8 +++----- src/H5FDprivate.h | 2 +- src/H5FDpublic.h | 3 +++ test/swmr.c | 5 +---- test/vfd.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 97 insertions(+), 11 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index d3cb77c..67cf963 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -789,7 +789,8 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "file driver has no `open' method") /* Query driver flag */ - H5FD_driver_query(driver, &driver_flags); + if(H5FD_driver_query(driver, &driver_flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't query VFD flags") /* Get initial file image info */ if(H5P_peek(plist, H5F_ACS_FILE_IMAGE_INFO_NAME, &file_image_info) < 0) @@ -2039,3 +2040,42 @@ H5FD_set_paged_aggr(H5FD_t *file, hbool_t paged) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_set_paged_aggr() */ + + +/*------------------------------------------------------------------------- +* Function: H5FDdriver_query +* +* Purpose: Similar to H5FD_query(), but intended for cases when we don't +* have a file available (e.g. before one is opened). Since we +* can't use the file to get the driver, the driver ID is passed +* in as a parameter. +* +* Return: SUCCEED/FAIL +* +* Programmer: Jacob Gruber +* Wednesday, August 17, 2011 +* +*------------------------------------------------------------------------- +*/ +herr_t +H5FDdriver_query(hid_t driver_id, unsigned long *flags/*out*/) +{ + H5FD_class_t *driver = NULL; /* Pointer to VFD class struct */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "ix", driver_id, flags); + + if(NULL == flags) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "flags parameter cannot be NULL") + + /* Check for the driver to query and then query it */ + if (NULL == (driver = (H5FD_class_t *)H5I_object_verify(driver_id, H5I_VFL))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a VFL ID") + if (H5FD_driver_query(driver, flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "driver flag query failed") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5FDdriver_query() */ + diff --git a/src/H5FDint.c b/src/H5FDint.c index ccf0f2e..52fbc23 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -442,18 +442,17 @@ done: * can't use the file to get the driver, the driver is passed in * as a parameter. * -* Return: Success: non-negative -* Failure: negative +* Return: SUCCEED/FAIL * * Programmer: Jacob Gruber * Wednesday, August 17, 2011 * *------------------------------------------------------------------------- */ -int +herr_t H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/) { - int ret_value = 0; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -469,4 +468,3 @@ H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/) FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_driver_query() */ - diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 589e391..e758951 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -153,7 +153,7 @@ H5_DLL H5FD_t *H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); H5_DLL herr_t H5FD_close(H5FD_t *file); H5_DLL int H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2); -H5_DLL int H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/); +H5_DLL herr_t H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/); H5_DLL haddr_t H5FD_alloc(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, struct H5F_t *f, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size); H5_DLL herr_t H5FD_free(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, struct H5F_t *f, diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 45b1237..514d1bf 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -384,6 +384,9 @@ H5_DLL herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing); H5_DLL herr_t H5FDlock(H5FD_t *file, hbool_t rw); H5_DLL herr_t H5FDunlock(H5FD_t *file); +/* Allows querying a VFD ID for features before the file is opened */ +H5_DLL herr_t H5FDdriver_query(hid_t driver_id, unsigned long *flags/*out*/); + #ifdef __cplusplus } #endif diff --git a/test/swmr.c b/test/swmr.c index 9239ca2..3b1bd09 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -120,7 +120,6 @@ test_metadata_read_attempts(hid_t in_fapl) hid_t file_fapl = -1; /* The file's access property list */ hid_t fid = -1, fid1 = -1, fid2 = -1; /* File IDs */ hid_t driver_id = -1; /* ID for this VFD */ - H5FD_class_t *driver = NULL; /* Pointer to VFD class struct */ unsigned long driver_flags = 0; /* VFD feature flags */ hbool_t compat_w_default_vfd; /* current VFD compat w/ H5P_DEFAULT? */ unsigned attempts; /* The # of read attempts */ @@ -138,9 +137,7 @@ test_metadata_read_attempts(hid_t in_fapl) */ if ((driver_id = H5Pget_driver(in_fapl)) < 0) FAIL_STACK_ERROR - if (NULL == (driver = (H5FD_class_t *)H5I_object_verify(driver_id, H5I_VFL))) - FAIL_STACK_ERROR - if (H5FD_driver_query(driver, &driver_flags) < 0) + if (H5FDdriver_query(driver_id, &driver_flags) < 0) FAIL_STACK_ERROR compat_w_default_vfd = (driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE) ? TRUE : FALSE; diff --git a/test/vfd.c b/test/vfd.c index 1932d2c..213cd9c 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -86,6 +86,8 @@ test_sec2(void) hid_t fid = -1; /* file ID */ hid_t fapl_id = -1; /* file access property list ID */ hid_t fapl_id_out = -1; /* from H5Fget_access_plist */ + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; /* filename */ void *os_file_handle = NULL; /* OS file handle */ hsize_t file_size; /* file size */ @@ -102,6 +104,28 @@ test_sec2(void) if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) TEST_ERROR; + /* Check that the VFD feature flags are correct */ + if ((driver_id = H5Pget_driver(fapl_id)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_POSIX_COMPAT_HANDLE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA + | H5FD_FEAT_ACCUMULATE_METADATA + | H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA + | H5FD_FEAT_POSIX_COMPAT_HANDLE + | H5FD_FEAT_SUPPORTS_SWMR_IO + | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) + TEST_ERROR + /* Retrieve the access property list... */ if((fapl_id_out = H5Fget_access_plist(fid)) < 0) TEST_ERROR; @@ -174,6 +198,8 @@ test_core(void) hid_t fid = -1; /* file ID */ hid_t fapl_id = -1; /* file access property list ID */ hid_t fapl_id_out = -1; /* from H5Fget_access_plist */ + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ hid_t did = -1; /* dataset ID */ hid_t sid = -1; /* dataspace ID */ char filename[1024]; /* filename */ @@ -219,6 +245,28 @@ test_core(void) if(HDaccess(filename, F_OK) != -1) FAIL_PUTS_ERROR("file created when backing store set to FALSE"); + /* Check that the VFD feature flags are correct. + * Note that the H5FDdriver_query() API call does not require a file + * so backing-store related flags will not be returned here. + */ + if ((driver_id = H5Pget_driver(fapl_id)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ALLOW_FILE_IMAGE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA + | H5FD_FEAT_ACCUMULATE_METADATA + | H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA + | H5FD_FEAT_ALLOW_FILE_IMAGE + | H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS)) + TEST_ERROR /************************************************************************ * Check basic core VFD operation and properties. This is done with the -- cgit v0.12 From 8807f918b9b00916efa822dda0301d3aa9debd80 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 24 May 2017 16:13:12 -0400 Subject: Added missing casts for the return value of H5I_object_verify(). --- src/H5S.c | 2 +- src/H5Shyper.c | 12 ++++++------ src/H5Zszip.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/H5S.c b/src/H5S.c index dd390d9..9ac40a7 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -1544,7 +1544,7 @@ H5Sencode(hid_t obj_id, void *buf, size_t *nalloc) H5TRACE3("e", "i*x*z", obj_id, buf, nalloc); /* Check argument and retrieve object */ - if (NULL==(dspace=(H5S_t *)H5I_object_verify(obj_id, H5I_DATASPACE))) + if (NULL == (dspace = (H5S_t *)H5I_object_verify(obj_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") if(H5S_encode(dspace, (unsigned char **)&buf, nalloc)<0) diff --git a/src/H5Shyper.c b/src/H5Shyper.c index e6e6cff..9263cd8 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -7571,7 +7571,7 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], H5TRACE6("e", "iSs*h*h*h*h", space_id, op, start, stride, count, block); /* Check args */ - if (NULL == (space=H5I_object_verify(space_id, H5I_DATASPACE))) + if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if (H5S_SCALAR==H5S_GET_EXTENT_TYPE(space)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_SCALAR space") @@ -7640,7 +7640,7 @@ H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], H5TRACE6("i", "iSs*h*h*h*h", space_id, op, start, stride, count, block); /* Check args */ - if (NULL == (space=H5I_object_verify(space_id, H5I_DATASPACE))) + if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if(start==NULL || count==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab not specified") @@ -7768,9 +7768,9 @@ H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id) H5TRACE3("i", "iSsi", space1_id, op, space2_id); /* Check args */ - if (NULL == (space1=H5I_object_verify(space1_id, H5I_DATASPACE))) + if (NULL == (space1 = (H5S_t *)H5I_object_verify(space1_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") - if (NULL == (space2=H5I_object_verify(space2_id, H5I_DATASPACE))) + if (NULL == (space2 = (H5S_t *)H5I_object_verify(space2_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") if(!(op>H5S_SELECT_NOOP && opH5S_SELECT_NOOP && op Date: Thu, 25 May 2017 06:45:53 -0400 Subject: Fixed many minor warnings. --- hl/test/test_dset_opt.c | 2 +- hl/test/test_packet_vlen.c | 77 +++++++------- hl/tools/h5watch/extend_dset.c | 60 +++++------ src/H5Dint.c | 200 ++++++++++++++++++----------------- src/H5Dio.c | 1 - src/H5FDspace.c | 2 - src/H5MFdbg.c | 50 ++++----- src/H5MFsection.c | 2 +- src/H5Ocache_image.c | 2 +- test/flushrefresh.c | 1 + test/mf.c | 4 + test/plugin.c | 8 +- test/swmr_remove_writer.c | 2 +- test/use_common.c | 14 ++- tools/lib/h5diff_array.c | 12 +-- tools/src/h5repack/h5repack_verify.c | 2 +- 16 files changed, 225 insertions(+), 214 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index 4b5fa19..383a87a 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -47,7 +47,7 @@ #define CHUNK_NX 4 #define CHUNK_NY 4 -#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*1.001)+12) +#define DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s))*H5_DOUBLE(1.001))+H5_DOUBLE(12.0)) /* Temporary filter IDs used for testing */ #define H5Z_FILTER_BOGUS1 305 diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c index 35bd43a..1d6231e 100644 --- a/hl/test/test_packet_vlen.c +++ b/hl/test/test_packet_vlen.c @@ -928,64 +928,60 @@ error: /* An error has occurred. Clean up and exit. */ * 2016/01/27 -BMR *------------------------------------------------------------------------- */ -static herr_t verify_accessors(hid_t fid, const char *table_name, herr_t expected_value) +static herr_t verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type) { - hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */ - hid_t dset_id=H5I_INVALID_HID; /* Dataset associated with the pt */ - hid_t dtype_id=H5I_INVALID_HID; /* Dataset identifier */ + hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */ + hid_t dset_id = H5I_INVALID_HID; /* Dataset associated with the pt */ + hid_t dtype_id = H5I_INVALID_HID; /* Dataset identifier */ char buf[NAME_BUF_SIZE]; ssize_t name_size; - herr_t is_varlen = 0; - herr_t ret = FAIL; /* Returned status from a callee */ + htri_t vlen_check_result = -1; /* Open the named packet table. */ - ptable = H5PTopen(fid, table_name); - if (ptable < 0) - goto error; + if((ptable = H5PTopen(fid, table_name)) < 0) + goto error; /* Get the associated dataset ID. */ - dset_id = H5PTget_dataset(ptable); - if (dset_id < 0) - goto error; + if((dset_id = H5PTget_dataset(ptable)) < 0) + goto error; /* Check if the packet table's name matches its associated dataset's. */ *buf = '\0'; - name_size = H5Iget_name(dset_id, (char*)buf, NAME_BUF_SIZE); - if (name_size < 0) - goto error; + if((name_size = H5Iget_name(dset_id, (char*)buf, NAME_BUF_SIZE)) < 0) + goto error; VERIFY(HDstrcmp(buf, table_name), "Names of dataset and packet table don't match"); /* Get the packet table's datatype ID */ - dtype_id = H5PTget_type(ptable); - if (dtype_id < 0) - goto error; + if((dtype_id = H5PTget_type(ptable)) < 0) + goto error; /* Check if the type class matches that of the packet table. */ - is_varlen = H5Tdetect_class(dtype_id, H5T_VLEN); - if (is_varlen == FAIL) /* failure occurred */ - goto error; - else if (is_varlen == expected_value) /* length types match */ - ret = SUCCEED; - else /* length types don't match */ - { - /* Give lengthtype "fixed-length" or "variable-length" depending on the - expected_value passed in, then print the error message. */ - char lenthtype[20]; - HDstrcpy(lenthtype, "fixed-length"); - if (expected_value == 1) - HDstrcpy(lenthtype, "variable-length"); - fprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype); - ret = FAIL; + if((vlen_check_result = H5Tdetect_class(dtype_id, H5T_VLEN)) < 0) + goto error; + + /* Check if length types match */ + if (vlen_check_result != (htri_t)uses_vlen_type) { + /* Give lengthtype "fixed-length" or "variable-length" depending on the + * expected_value passed in, then print the error message. + */ + char lenthtype[20]; + if (uses_vlen_type == TRUE) + HDstrcpy(lenthtype, "variable-length"); + else + HDstrcpy(lenthtype, "fixed-length"); + HDfprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype); + goto error; } /* Close the packet table */ if (H5PTclose(ptable) < 0) - goto error; + goto error; return SUCCEED; error: /* An error has occurred. Clean up and exit. */ - if (H5PTis_valid(ptable) > 0) H5PTclose(ptable); + if (H5PTis_valid(ptable) > 0) + H5PTclose(ptable); H5_FAILED(); return FAIL; } /* verify_accessors */ @@ -1010,25 +1006,26 @@ static int test_accessors(void) /* Open the file */ fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT); if (fid < 0) - goto error; + goto error; ret = verify_accessors(fid, PT_VLEN_ATOMIC, TRUE); if (ret < 0) - goto error; + goto error; ret = verify_accessors(fid, PT_FIXED_LEN, FALSE); if (ret < 0) - goto error; + goto error; /* Close the file */ if (H5Fclose(fid) < 0) - goto error; + goto error; PASSED(); return SUCCEED; error: /* An error has occurred. Clean up and exit. */ - if (fid > 0) H5Fclose(fid); + if (fid > 0) + H5Fclose(fid); H5_FAILED(); return FAIL; } /* test_accessors */ diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 957db10..4299586 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -78,7 +78,7 @@ extend_dset_two(const char *file, char *dname, int action1, int action2) hid_t sid = -1; /* dataspace id */ hid_t dtid = -1; /* dataset's datatype id */ int ndims; /* # of dimension sizes */ - unsigned i, j; /* local index variable */ + unsigned i; /* local index variable */ hsize_t ext_dims[2]; /* new dimension sizes after extension */ hsize_t cur_dims[2]; /* current dimension sizes */ size_t dtype_size; /* size of the dataset's datatype */ @@ -144,23 +144,23 @@ extend_dset_two(const char *file, char *dname, int action1, int action2) goto error; num_elmts = 1; - for(j = 0; j < (unsigned)ndims; j++) - num_elmts *= (unsigned)ext_dims[j]; + for(i = 0; i < (unsigned)ndims; i++) + num_elmts *= (unsigned)ext_dims[i]; /* Compound type */ if(!HDstrcmp(dname, DSET_CMPD_TWO)) { HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); - for(j = 0; j < num_elmts; j++) { - cbuf[j].field1 = action1; - cbuf[j].field2.a = action1; - cbuf[j].field2.c = action1; - cbuf[j].field2.b.a = action1; - cbuf[j].field2.b.b = action1; - cbuf[j].field2.b.c = action1; - cbuf[j].field3 = action1; - cbuf[j].field4.a = action1; - cbuf[j].field4.b = action1; + for(i = 0; i < num_elmts; i++) { + cbuf[i].field1 = action1; + cbuf[i].field2.a = action1; + cbuf[i].field2.c = action1; + cbuf[i].field2.b.a = action1; + cbuf[i].field2.b.b = action1; + cbuf[i].field2.b.c = action1; + cbuf[i].field3 = action1; + cbuf[i].field4.a = action1; + cbuf[i].field4.b = action1; } /* end for */ /* Write to the dataset */ @@ -169,8 +169,8 @@ extend_dset_two(const char *file, char *dname, int action1, int action2) } else { /* Integer type */ HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); - for(j = 0; j < num_elmts; j++) - ibuf[j] = action1; + for(i = 0; i < num_elmts; i++) + ibuf[i] = action1; /* Write to the dataset */ if(H5Dwrite(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0) @@ -225,7 +225,7 @@ extend_dset_one(const char *file, char *dname, int action) hid_t dtid = -1; /* dataset's datatype id */ hid_t sid = -1; /* dataspace id */ hid_t mid = -1; /* memory space id */ - unsigned i, j; /* local index variable */ + unsigned i; /* local index variable */ hsize_t cur_dims[1]; /* current dimension sizes */ hsize_t ext_dims[1]; /* new dimension sizes after extension */ hsize_t offset[1]; /* starting offsets of appended data */ @@ -304,18 +304,18 @@ extend_dset_one(const char *file, char *dname, int action) if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); - for(j = 0; j < (unsigned)action; j++) { - cbuf[j].field1 = j + 1; - cbuf[j].field2.a = j + 2; - cbuf[j].field2.b.a = j + 2; - cbuf[j].field2.b.b = j + 2; - cbuf[j].field2.b.c = j + 2; - cbuf[j].field2.c = j + 2; - - cbuf[j].field3 = j + 3; - - cbuf[j].field4.a = j + 4; - cbuf[j].field4.b = j + 4; + for(i = 0; i < (unsigned)action; i++) { + cbuf[i].field1 = i + 1; + cbuf[i].field2.a = i + 2; + cbuf[i].field2.b.a = i + 2; + cbuf[i].field2.b.b = i + 2; + cbuf[i].field2.b.c = i + 2; + cbuf[i].field2.c = i + 2; + + cbuf[i].field3 = i + 3; + + cbuf[i].field4.a = i + 4; + cbuf[i].field4.b = i + 4; } /* end for */ /* Write to the extended region of the dataset */ @@ -324,8 +324,8 @@ extend_dset_one(const char *file, char *dname, int action) } else { /* Integer type */ HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); - for(j = 0; j < (unsigned)action; j++) - ibuf[j] = (int)j; + for(i = 0; i < (unsigned)action; i++) + ibuf[i] = (int)i; /* Write to the extended region of the dataset */ if(H5Dwrite(did, dtid, mid, sid, H5P_DEFAULT, ibuf) < 0) diff --git a/src/H5Dint.c b/src/H5Dint.c index 1813ca6..08b3eb8 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -3004,10 +3004,10 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) { H5D_chk_idx_info_t new_idx_info; /* Index info for the new layout */ H5D_chk_idx_info_t idx_info; /* Index info for the current layout */ - H5O_layout_t newlayout; /* The new layout */ - hbool_t init_new_index = FALSE; /* Indicate that the new chunk index is initialized */ + H5O_layout_t *newlayout = NULL; /* The new layout */ + hbool_t init_new_index = FALSE; /* Indicate that the new chunk index is initialized */ hbool_t delete_old_layout = FALSE; /* Indicate that the old layout message is deleted */ - hbool_t add_new_layout = FALSE; /* Indicate that the new layout message is added */ + hbool_t add_new_layout = FALSE; /* Indicate that the new layout message is added */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) @@ -3017,121 +3017,127 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) switch(dataset->shared->layout.type) { case H5D_CHUNKED: - HDassert(dataset->shared->layout.u.chunk.idx_type != H5D_CHUNK_IDX_BTREE); - - /* Set up the current index info */ - idx_info.f = dataset->oloc.file; - idx_info.dxpl_id = dxpl_id; - idx_info.pline = &dataset->shared->dcpl_cache.pline; - idx_info.layout = &dataset->shared->layout.u.chunk; - idx_info.storage = &dataset->shared->layout.storage.u.chunk; - - /* Copy the current layout info to the new layout */ - HDmemcpy(&newlayout, &dataset->shared->layout, sizeof(H5O_layout_t)); - - /* Set up info for version 1 B-tree in the new layout */ - newlayout.version = H5O_LAYOUT_VERSION_3; - newlayout.storage.u.chunk.idx_type = H5D_CHUNK_IDX_BTREE; - newlayout.storage.u.chunk.idx_addr = HADDR_UNDEF; - newlayout.storage.u.chunk.ops = H5D_COPS_BTREE; - newlayout.storage.u.chunk.u.btree.shared = NULL; - - /* Set up the index info to version 1 B-tree */ - new_idx_info.f = dataset->oloc.file; - new_idx_info.dxpl_id = dxpl_id; - new_idx_info.pline = &dataset->shared->dcpl_cache.pline; - new_idx_info.layout = &newlayout.u.chunk; - new_idx_info.storage = &newlayout.storage.u.chunk; - - /* Initialize version 1 B-tree */ - if(new_idx_info.storage->ops->init && - (new_idx_info.storage->ops->init)(&new_idx_info, dataset->shared->space, dataset->oloc.addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information") - init_new_index = TRUE; - - /* If the current chunk index exists */ - if(H5F_addr_defined(idx_info.storage->idx_addr)) { - - /* Create v1 B-tree chunk index */ - if((new_idx_info.storage->ops->create)(&new_idx_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create chunk index") - - /* Iterate over the chunks in the current index and insert the chunk addresses - * into the version 1 B-tree chunk index */ - if(H5D__chunk_format_convert(dataset, &idx_info, &new_idx_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate/convert chunk index") - } /* end if */ + HDassert(dataset->shared->layout.u.chunk.idx_type != H5D_CHUNK_IDX_BTREE); + + if(NULL == (newlayout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") + + /* Set up the current index info */ + idx_info.f = dataset->oloc.file; + idx_info.dxpl_id = dxpl_id; + idx_info.pline = &dataset->shared->dcpl_cache.pline; + idx_info.layout = &dataset->shared->layout.u.chunk; + idx_info.storage = &dataset->shared->layout.storage.u.chunk; + + /* Copy the current layout info to the new layout */ + HDmemcpy(newlayout, &dataset->shared->layout, sizeof(H5O_layout_t)); + + /* Set up info for version 1 B-tree in the new layout */ + newlayout->version = H5O_LAYOUT_VERSION_3; + newlayout->storage.u.chunk.idx_type = H5D_CHUNK_IDX_BTREE; + newlayout->storage.u.chunk.idx_addr = HADDR_UNDEF; + newlayout->storage.u.chunk.ops = H5D_COPS_BTREE; + newlayout->storage.u.chunk.u.btree.shared = NULL; + + /* Set up the index info to version 1 B-tree */ + new_idx_info.f = dataset->oloc.file; + new_idx_info.dxpl_id = dxpl_id; + new_idx_info.pline = &dataset->shared->dcpl_cache.pline; + new_idx_info.layout = &(newlayout->u).chunk; + new_idx_info.storage = &(newlayout->storage).u.chunk; + + /* Initialize version 1 B-tree */ + if(new_idx_info.storage->ops->init && (new_idx_info.storage->ops->init)(&new_idx_info, dataset->shared->space, dataset->oloc.addr) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information") + init_new_index = TRUE; + + /* If the current chunk index exists */ + if(H5F_addr_defined(idx_info.storage->idx_addr)) { + + /* Create v1 B-tree chunk index */ + if((new_idx_info.storage->ops->create)(&new_idx_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create chunk index") + + /* Iterate over the chunks in the current index and insert the chunk addresses + * into the version 1 B-tree chunk index + */ + if(H5D__chunk_format_convert(dataset, &idx_info, &new_idx_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate/convert chunk index") + } /* end if */ - /* Delete the old "current" layout message */ - if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete layout message") + /* Delete the old "current" layout message */ + if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE, dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete layout message") - delete_old_layout = TRUE; + delete_old_layout = TRUE; - /* Append the new layout message to the object header */ - if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &newlayout, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout header message") + /* Append the new layout message to the object header */ + if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, newlayout, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout header message") - add_new_layout = TRUE; + add_new_layout = TRUE; - /* Release the old (current) chunk index */ - if(idx_info.storage->ops->dest && (idx_info.storage->ops->dest)(&idx_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") + /* Release the old (current) chunk index */ + if(idx_info.storage->ops->dest && (idx_info.storage->ops->dest)(&idx_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") - /* Copy the new layout to the dataset's layout */ - HDmemcpy(&dataset->shared->layout, &newlayout, sizeof(H5O_layout_t)); + /* Copy the new layout to the dataset's layout */ + HDmemcpy(&dataset->shared->layout, newlayout, sizeof(H5O_layout_t)); - break; + break; - case H5D_CONTIGUOUS: + case H5D_CONTIGUOUS: case H5D_COMPACT: - HDassert(dataset->shared->layout.version > H5O_LAYOUT_VERSION_DEFAULT); - dataset->shared->layout.version = H5O_LAYOUT_VERSION_DEFAULT; - if(H5O_msg_write(&(dataset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dataset->shared->layout), dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") - break; + HDassert(dataset->shared->layout.version > H5O_LAYOUT_VERSION_DEFAULT); + dataset->shared->layout.version = H5O_LAYOUT_VERSION_DEFAULT; + if(H5O_msg_write(&(dataset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dataset->shared->layout), dxpl_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") + break; - case H5D_VIRTUAL: - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "virtual dataset layout not supported") + case H5D_VIRTUAL: + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "virtual dataset layout not supported") case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset layout type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset layout type") - default: - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown dataset layout type") + default: + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown dataset layout type") } /* end switch */ done: if(ret_value < 0 && dataset->shared->layout.type == H5D_CHUNKED) { - /* Remove new layout message */ - if(add_new_layout) - if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE, dxpl_id) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete layout message") - - /* Add back old layout message */ - if(delete_old_layout) - if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &dataset->shared->layout, dxpl_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to add layout header message") - - /* Clean up v1 b-tree chunk index */ - if(init_new_index) { - if(H5F_addr_defined(new_idx_info.storage->idx_addr)) { - /* Check for valid address i.e. tag */ - if(!H5F_addr_defined(dataset->oloc.addr)) - HDONE_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "address undefined") - - /* Expunge from cache all v1 B-tree type entries associated with tag */ - if(H5AC_expunge_tag_type_metadata(dataset->oloc.file, dxpl_id, dataset->oloc.addr, H5AC_BT_ID, H5AC__NO_FLAGS_SET)) - HDONE_ERROR(H5E_DATASET, H5E_CANTEXPUNGE, FAIL, "unable to expunge index metadata") - } /* end if */ + /* Remove new layout message */ + if(add_new_layout) + if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE, dxpl_id) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete layout message") + + /* Add back old layout message */ + if(delete_old_layout) + if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &dataset->shared->layout, dxpl_id) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to add layout header message") + + /* Clean up v1 b-tree chunk index */ + if(init_new_index) { + if(H5F_addr_defined(new_idx_info.storage->idx_addr)) { + /* Check for valid address i.e. tag */ + if(!H5F_addr_defined(dataset->oloc.addr)) + HDONE_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "address undefined") + + /* Expunge from cache all v1 B-tree type entries associated with tag */ + if(H5AC_expunge_tag_type_metadata(dataset->oloc.file, dxpl_id, dataset->oloc.addr, H5AC_BT_ID, H5AC__NO_FLAGS_SET)) + HDONE_ERROR(H5E_DATASET, H5E_CANTEXPUNGE, FAIL, "unable to expunge index metadata") + } /* end if */ - /* Delete v1 B-tree chunk index */ - if(new_idx_info.storage->ops->dest && (new_idx_info.storage->ops->dest)(&new_idx_info) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") - } /* end if */ + /* Delete v1 B-tree chunk index */ + if(new_idx_info.storage->ops->dest && (new_idx_info.storage->ops->dest)(&new_idx_info) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") + } /* end if */ } /* end if */ + if(newlayout != NULL) + newlayout = (H5O_layout_t *)H5MM_xfree(newlayout); + FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* end H5D__format_convert() */ diff --git a/src/H5Dio.c b/src/H5Dio.c index 572e6cf..1766422 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -181,7 +181,6 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(direct_read) { unsigned u; - hsize_t dims[H5O_LAYOUT_NDIMS]; hsize_t internal_offset[H5O_LAYOUT_NDIMS]; if(H5D_CHUNKED != dset->shared->layout.type) diff --git a/src/H5FDspace.c b/src/H5FDspace.c index e451d6b..0af755f 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -99,9 +99,7 @@ H5FL_DEFINE(H5FD_free_t); static haddr_t H5FD_extend(H5FD_t *file, H5FD_mem_t type, hsize_t size) { - hsize_t orig_size = size; /* Original allocation size */ haddr_t eoa; /* Address of end-of-allocated space */ - hsize_t extra; /* Extra space to allocate, to align request */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 49cfbfc..1ae902f 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -156,7 +156,7 @@ herr_t H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, FILE *stream, int indent, int fwidth) { herr_t ret_value = SUCCEED; /* Return value */ - H5FD_mem_t type; /* Memory type for iteration */ + H5F_mem_page_t type; /* Memory type for iteration */ FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) @@ -168,31 +168,31 @@ H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, FILE *stream, int ind HDassert(indent >= 0); HDassert(fwidth >= 0); - for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) - if(H5F_addr_eq(f->shared->fs_addr[type], fs_addr)) { - if(!f->shared->fs_man[type]) + for(type = H5F_MEM_PAGE_DEFAULT; type < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, type)) + if(H5F_addr_eq(f->shared->fs_addr[type], fs_addr)) { + if(!f->shared->fs_man[type]) if(H5MF_open_fstype(f, dxpl_id, type) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") - - if(f->shared->fs_man[type]) { - H5MF_debug_iter_ud_t udata; /* User data for callbacks */ - - /* Prepare user data for section iteration callback */ - udata.fspace = f->shared->fs_man[type]; - udata.stream = stream; - udata.indent = indent; - udata.fwidth = fwidth; - - /* Iterate over all the free space sections */ - if(H5FS_sect_iterate(f, dxpl_id, f->shared->fs_man[type], H5MF_sects_debug_cb, &udata) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") - - /* Close the free space information */ - if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") - } /* end if */ - break; - } /* end if */ + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") + + if(f->shared->fs_man[type]) { + H5MF_debug_iter_ud_t udata; /* User data for callbacks */ + + /* Prepare user data for section iteration callback */ + udata.fspace = f->shared->fs_man[type]; + udata.stream = stream; + udata.indent = indent; + udata.fwidth = fwidth; + + /* Iterate over all the free space sections */ + if(H5FS_sect_iterate(f, dxpl_id, f->shared->fs_man[type], H5MF_sects_debug_cb, &udata) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") + + /* Close the free space information */ + if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") + } /* end if */ + break; + } /* end if */ done: FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 0dd26b3..02fc2d9 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -360,7 +360,7 @@ H5MF_sect_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, static H5FS_section_info_t * H5MF_sect_split(H5FS_section_info_t *sect, hsize_t frag_size) { - H5MF_free_section_t *ret_value; /* Return value */ + H5MF_free_section_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index 29b2503..a427b49 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -323,7 +323,7 @@ H5O__mdci_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) * time constraints, I don't want to go there now. */ if(H5F_FIRST_ALLOC_DEALLOC(f)) { - HDassert(HADDR_UNDEF !=H5F_EOA_PRE_FSM_FSALLOC(f)); + HDassert(HADDR_UNDEF != H5F_EOA_PRE_FSM_FSALLOC(f)); HDassert(H5F_addr_ge(mesg->addr, H5F_EOA_PRE_FSM_FSALLOC(f))); if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") diff --git a/test/flushrefresh.c b/test/flushrefresh.c index f35ed5e..0775dee 100644 --- a/test/flushrefresh.c +++ b/test/flushrefresh.c @@ -9,6 +9,7 @@ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Programmer: Mike McGreevy diff --git a/test/mf.c b/test/mf.c index 3197989..60b74c4 100644 --- a/test/mf.c +++ b/test/mf.c @@ -138,8 +138,10 @@ static unsigned test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new static unsigned test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); static unsigned test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); static unsigned test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); +#ifdef PB_OUT static unsigned test_mf_fs_persist_split(void); static unsigned test_mf_fs_persist_multi(void); +#endif static unsigned test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl); static unsigned test_page_small(const char *env_h5_drvr, hid_t fapl); static unsigned test_page_large(const char *env_h5_drvr, hid_t fapl); @@ -6091,6 +6093,7 @@ error: * Verify that the file's free-space manager(s) are persistent for a split-file *------------------------------------------------------------------------- */ +#ifdef PB_OUT static unsigned test_mf_fs_persist_split(void) { @@ -6716,6 +6719,7 @@ error: } H5E_END_TRY; return(1); } /* test_mf_fs_persist_multi() */ +#endif /* PB_OUT */ /* *------------------------------------------------------------------------- diff --git a/test/plugin.c b/test/plugin.c index 8b4324d..1254e9a 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -574,7 +574,9 @@ test_noread_with_filters(hid_t file) /* disable filter plugin */ if(H5PLget_loading_state(&plugin_state) < 0) TEST_ERROR - plugin_state = plugin_state & ~H5PL_FILTER_PLUGIN; + + plugin_state = plugin_state & (unsigned)(~H5PL_FILTER_PLUGIN); + if(H5PLset_loading_state(plugin_state) < 0) TEST_ERROR if((dset = H5Dopen2(file, DSET_DYNLIB1_NAME, H5P_DEFAULT)) < 0) TEST_ERROR @@ -672,8 +674,8 @@ static herr_t test_groups_with_filters(hid_t file) { herr_t ret_value = -1; - hid_t gid; - hid_t group; + hid_t gid = -1; + hid_t group = -1; int i; char gname[256]; diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c index 82c2f8b..43743d9 100644 --- a/test/swmr_remove_writer.c +++ b/test/swmr_remove_writer.c @@ -187,7 +187,7 @@ remove_records(hid_t fid, unsigned verbose, unsigned long nshrinks, unsigned lon symbol->nrecords = 0; else symbol->nrecords -= remove_size; - dim[1] = symbol->nrecords; + dim[1] = symbol->nrecords; if(H5Dset_extent(symbol->dsid, dim) < 0) return -1; diff --git a/test/use_common.c b/test/use_common.c index 908cac9..5aa6692 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -48,6 +48,8 @@ parse_option(int argc, char * const argv[]) { int ret_value=0; int c; + int use_swmr; /* Need an int to detect errors */ + /* command line options: See function usage for a description */ const char *nagg_options = "f:hi:l:n:s:y:z:"; @@ -96,11 +98,13 @@ parse_option(int argc, char * const argv[]) }; break; case 's': /* use swmr file open mode */ - if ((UC_opts.use_swmr = HDatoi(optarg)) < 0) { - fprintf(stderr, "swmr value should be 0(no) or 1(yes)\n"); - usage(progname_g); - Hgoto_error(-1); - }; + use_swmr = HDatoi(optarg); + if (use_swmr != 0 && use_swmr != 1) { + HDfprintf(stderr, "swmr value should be 0(no) or 1(yes)\n"); + usage(progname_g); + Hgoto_error(-1); + } + UC_opts.use_swmr = (hbool_t)use_swmr; break; case 'y': /* Number of planes per chunk */ if ((UC_opts.chunkplanes = HDstrtoul(optarg, NULL, 0)) <= 0) { diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 499d5eb..0b1a96e 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -140,7 +140,7 @@ typedef struct mcomp_t static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id,hid_t region1_id, hid_t region2_id, diff_opt_t *options); static hbool_t all_zero(const void *_mem, size_t size); static int ull2float(unsigned long long ull_value, float *f_value); -static hsize_t character_compare(char *mem1,char *mem2,hsize_t i,unsigned u,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); +static hsize_t character_compare(char *mem1,char *mem2,hsize_t i,size_t u,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); static hsize_t character_compare_opt(unsigned char *mem1,unsigned char *mem2,hsize_t i,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); static hbool_t equal_float(float value, float expected, diff_opt_t *options); static hbool_t equal_double(double value, double expected, diff_opt_t *options); @@ -149,7 +149,7 @@ static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t #endif static int print_data(diff_opt_t *options); static void print_pos(int *ph,int pp,hsize_t curr_pos,hsize_t *acc,hsize_t *pos,int rank,hsize_t *dims,const char *obj1,const char *obj2 ); -static void print_char_pos(int *ph,int pp,hsize_t curr_pos,unsigned u,hsize_t *acc,hsize_t *pos,int rank,hsize_t *dims,const char *obj1,const char *obj2 ); +static void print_char_pos(int *ph,int pp,hsize_t curr_pos,size_t u,hsize_t *acc,hsize_t *pos,int rank,hsize_t *dims,const char *obj1,const char *obj2 ); static void h5diff_print_char(char ch); static hsize_t diff_datum(void *_mem1, void *_mem2, @@ -575,7 +575,7 @@ static hsize_t diff_datum(void *_mem1, { unsigned char *mem1 = (unsigned char*)_mem1; unsigned char *mem2 = (unsigned char*)_mem2; - unsigned u; + size_t u; hid_t memb_type; size_t type_size; H5T_sign_t type_sign; @@ -2813,7 +2813,7 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, - unsigned u, + size_t u, int rank, hsize_t *dims, hsize_t *acc, @@ -5906,7 +5906,7 @@ static void print_char_pos( int *ph, /* print header */ int pp, /* print percentage */ hsize_t curr_pos, - unsigned u, + size_t u, hsize_t *acc, hsize_t *pos, int rank, @@ -5944,7 +5944,7 @@ void print_char_pos( int *ph, /* print header */ } else { - parallel_print("%u", (unsigned)u); + parallel_print("%zu", u); } parallel_print("]" ); } diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c index 4ff4875..1a0dab7 100644 --- a/tools/src/h5repack/h5repack_verify.c +++ b/tools/src/h5repack/h5repack_verify.c @@ -249,7 +249,7 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options * the same as the input file's strategy. */ if(options->fs_strategy) { - if(out_strategy != (options->fs_strategy == (-1) ? 0 : options->fs_strategy)) { + if(out_strategy != (options->fs_strategy == (H5F_fspace_strategy_t)-1 ? 0 : options->fs_strategy)) { error_msg("file space strategy not set as unexpected\n"); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected"); } -- cgit v0.12 From 18ae45027c40ecf539260216a04ba1cfdf8b50d9 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 25 May 2017 08:42:18 -0400 Subject: Fixed additional minor warnings. --- test/dsets.c | 3 +++ tools/test/h5copy/h5copygentest.c | 2 +- tools/test/h5diff/h5diffgentest.c | 41 ++++++++++++++++++--------------------- tools/test/h5dump/h5dumpgentest.c | 2 +- tools/test/h5repack/h5repacktst.c | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index ba0ad82..12d2e83 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -17,6 +17,8 @@ * * Purpose: Tests the dataset interface (H5D) */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#define H5D_TESTING #define H5FD_FRIEND /*suppress error about including H5FDpkg */ #define H5FD_TESTING @@ -24,6 +26,7 @@ #include "h5test.h" #include "H5srcdir.h" +#include "H5Dpkg.h" #include "H5FDpkg.h" #include "H5VMprivate.h" #include "H5Zpkg.h" diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index bda0686..d4d6a08 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -336,7 +336,7 @@ static void gent_att_compound_vlstr(hid_t loc_id) { typedef struct { /* Compound structure for the attribute */ int i; - char *v; + const char *v; } s1; hsize_t dim[1] = {1}; /* Dimension size */ hid_t sid = -1; /* Dataspace ID */ diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 708f371..459a37e 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -3632,8 +3632,8 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int char *str_vlen_repeat; /* vlen string */ char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ } comp1_t; @@ -3645,9 +3645,9 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ char *str_vlen_repeat; /* vlen string */ char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ } comp2_t; @@ -3660,8 +3660,8 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int char *str_vlen_repeat; /* vlen string */ char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ } comp3_t; /* compound4 datatype */ @@ -3672,16 +3672,16 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ char *str_vlen_repeat; /* vlen string */ char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ } comp4_t; /* compound5 datatype */ typedef struct comp5_t { - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char *str_vlen; /* vlen string */ @@ -3693,9 +3693,9 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* compound6 datatype */ typedef struct comp6_t { - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char *str_vlen; /* vlen string */ char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ @@ -3708,8 +3708,8 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int { char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ char *str_vlen; /* vlen string */ @@ -3720,9 +3720,9 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int typedef struct comp8_t { char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ char *str_vlen; /* vlen string */ char str_fixlen_repeat[FIXLEN_STR_SIZE]; /* fixed len string */ @@ -3734,8 +3734,8 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int { char str_array_fixlen[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ char str_fixlen_array_again[FIXLEN_STR_ARRY_DIM][FIXLEN_STR_ARRY_SIZE]; /* fixed len string array */ - char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ - char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_array_vlen[VLEN_STR_ARRY_DIM]; /* vlen string array */ + const char *str_vlen_array_again[VLEN_STR_ARRY_DIM]; /* vlen string array */ char str_fixlen[FIXLEN_STR_SIZE]; /* fixed len string */ int int_data1; hobj_ref_t objref1; /* reference */ @@ -3768,7 +3768,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int hid_t sid_vlen_str_array=0; /* dataspace ID */ hid_t tid_vlen_str_array_pre=0; /* datatype ID */ hid_t tid_vlen_str_array=0; /* datatype ID */ - char *vlen_str_array_buf[VLEN_STR_ARRY_DIM]= { + const char *vlen_str_array_buf[VLEN_STR_ARRY_DIM]= { "1 - Variable length string Array", "2 - Testing variable length string array in compound type", "3 - Four score and seven\n years ago our forefathers brought forth on this continent a new nation," @@ -5343,7 +5343,6 @@ static hid_t mkstr(int size, H5T_str_t pad) { *-------------------------------------------------------------------------*/ static void test_objs_strings(const char *fname1, const char *fname2) { - herr_t status = SUCCEED; hid_t fid1=0; hid_t fid2=0; hid_t dataset=0; @@ -5398,7 +5397,6 @@ static void test_objs_strings(const char *fname1, const char *fname2) if (fid1 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); - status = FAIL; goto out; } @@ -5407,7 +5405,6 @@ static void test_objs_strings(const char *fname1, const char *fname2) if (fid2 < 0) { fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); - status = FAIL; goto out; } diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 169eddb..55a754d 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -3479,7 +3479,7 @@ static void gent_array8(void) unsigned int i; /* Allocate data buffer */ - wdata = HDmalloc(F64_DIM1 * sizeof(int)); + wdata = (int *)HDmalloc(F64_DIM1 * sizeof(int)); HDassert(wdata); /* diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index 3b82383..efce43f 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -266,7 +266,7 @@ int main (void) fname = H5REPACK_FSPACE_FNAMES[j]; if(h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - pack_options.fs_strategy = -1; /* "FSM_AGGR" specified via -S FSM_AGGR */ + pack_options.fs_strategy = (H5F_fspace_strategy_t)-1; /* "FSM_AGGR" specified via -S FSM_AGGR */ pack_options.fs_threshold = -1; /* "0" specified via -T 0 */ if(h5repack(fname, FSPACE_OUT, &pack_options) < 0) GOERROR; -- cgit v0.12 From 65e2e8f87cc9b5235b19faefa23f76c2c6ea6da9 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 25 May 2017 09:06:49 -0400 Subject: A few more warnings fixed. --- test/tfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/tfile.c b/test/tfile.c index 7274c82..c59e756 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -4929,9 +4929,9 @@ test_libver_bounds(void) static void test_libver_macros(void) { - unsigned major = H5_VERS_MAJOR; - unsigned minor = H5_VERS_MINOR; - unsigned release = H5_VERS_RELEASE; + int major = H5_VERS_MAJOR; + int minor = H5_VERS_MINOR; + int release = H5_VERS_RELEASE; /* Output message about test being performed */ MESSAGE(5, ("Testing macros for library version comparison\n")); -- cgit v0.12 From a33859d6774f73c0bb31386eedfde2aaf222427b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 25 May 2017 09:24:24 -0400 Subject: Minor type fixes to h5watch. --- hl/tools/h5watch/extend_dset.c | 22 +++++++++++----------- hl/tools/h5watch/h5watchgentest.c | 16 ++++++++-------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 4299586..4dcf25e 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -38,24 +38,24 @@ static herr_t extend_dset_one(const char *file, char *dname, int action); /* Data structures for datasets with compound data type */ typedef struct sub22_t { - unsigned int a; - unsigned int b; - unsigned int c; + int a; + int b; + int c; } sub22_t; typedef struct sub2_t { - unsigned int a; + int a; sub22_t b; - unsigned int c; + int c; } sub2_t; typedef struct sub4_t { - unsigned int a; - unsigned int b; + int a; + int b; } sub4_t; typedef struct set_t { - unsigned int field1; + int field1; sub2_t field2; double field3; sub4_t field4; @@ -225,7 +225,7 @@ extend_dset_one(const char *file, char *dname, int action) hid_t dtid = -1; /* dataset's datatype id */ hid_t sid = -1; /* dataspace id */ hid_t mid = -1; /* memory space id */ - unsigned i; /* local index variable */ + int i; /* local index variable */ hsize_t cur_dims[1]; /* current dimension sizes */ hsize_t ext_dims[1]; /* new dimension sizes after extension */ hsize_t offset[1]; /* starting offsets of appended data */ @@ -304,7 +304,7 @@ extend_dset_one(const char *file, char *dname, int action) if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); - for(i = 0; i < (unsigned)action; i++) { + for(i = 0; i < action; i++) { cbuf[i].field1 = i + 1; cbuf[i].field2.a = i + 2; cbuf[i].field2.b.a = i + 2; @@ -324,7 +324,7 @@ extend_dset_one(const char *file, char *dname, int action) } else { /* Integer type */ HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); - for(i = 0; i < (unsigned)action; i++) + for(i = 0; i < action; i++) ibuf[i] = (int)i; /* Write to the extended region of the dataset */ diff --git a/hl/tools/h5watch/h5watchgentest.c b/hl/tools/h5watch/h5watchgentest.c index c5b76de..18e15fc 100644 --- a/hl/tools/h5watch/h5watchgentest.c +++ b/hl/tools/h5watch/h5watchgentest.c @@ -58,24 +58,24 @@ /* Data structures for datasets with compound types */ typedef struct sub22_t { - unsigned int a; - unsigned int b; - unsigned int c; + int a; + int b; + int c; } sub22_t; typedef struct sub2_t { - unsigned int a; + int a; sub22_t b; - unsigned int c; + int c; } sub2_t; typedef struct sub4_t { - unsigned int a; - unsigned int b; + int a; + int b; } sub4_t; typedef struct set_t { - unsigned int field1; + int field1; sub2_t field2; double field3; sub4_t field4; -- cgit v0.12 From 291b107d4d56528082db5344d8783941154e8374 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 25 May 2017 09:47:20 -0400 Subject: Minor warning fixes in the tools. --- tools/lib/h5tools.h | 2 +- tools/lib/h5tools_str.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 3d38dd0..6383df5 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -522,7 +522,7 @@ typedef struct h5tools_context_t { hsize_t acc[H5S_MAX_RANK]; /* accumulator position */ hsize_t pos[H5S_MAX_RANK]; /* matrix position */ hsize_t sm_pos; /* current stripmine element position */ - struct H5LD_memb_t **cmpd_listv; /* h5watch: vector containing info about the list of compound fields to be printed */ + const struct H5LD_memb_t * const *cmpd_listv; /* h5watch: vector containing info about the list of compound fields to be printed */ } h5tools_context_t; typedef struct subset_d { diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index b7a2c1e..fa15785 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1000,10 +1000,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai case H5T_COMPOUND: if(ctx->cmpd_listv) { /* there is */ - int save_indent_level; /* The indentation level */ + unsigned save_indent_level; /* The indentation level */ size_t curr_field; /* Current field to display */ - int i = 0, x = 0; /* Local index variable */ - H5LD_memb_t **listv; /* Vector of information for */ + int i = 0; /* Local index variable */ + unsigned x = 0; /* Local index variable */ + const H5LD_memb_t * const *listv; /* Vector of information for */ listv = ctx->cmpd_listv; ctx->cmpd_listv = NULL; -- cgit v0.12 From 1b74c5ca95efa3ebc14bb98ca48e4bf052398a81 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 25 May 2017 10:11:26 -0400 Subject: More minor warning fixes. --- src/H5Ofsinfo.c | 2 +- test/mf.c | 2 ++ test/swmr_remove_reader.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 89dc8ee..4d62f49 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -85,7 +85,7 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t); *------------------------------------------------------------------------- */ static void * -H5O_fsinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_fsinfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_fsinfo_t *fsinfo = NULL; /* File space info message */ diff --git a/test/mf.c b/test/mf.c index 60b74c4..fea5ee2 100644 --- a/test/mf.c +++ b/test/mf.c @@ -45,8 +45,10 @@ #define TBLOCK_SIZE4 4 #define TBLOCK_SIZE5 5 #define TBLOCK_SIZE6 6 +#ifdef PB_OUT #define TBLOCK_SIZE7 7 #define TBLOCK_SIZE8 8 +#endif /* PB_OUT */ #define TBLOCK_SIZE10 10 #define TBLOCK_SIZE11 11 #define TBLOCK_SIZE20 20 diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index 11649e3..1fae5e7 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -227,7 +227,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, /* Determine the offset of the symbol, within level 0 symbols */ /* (level 0 symbols are the most common symbols) */ - offset = (unsigned)(HDrandom() % symbol_count[0]); + offset = (unsigned)HDrandom() % symbol_count[0]; sym_com[v] = &symbol_info[0][offset]; /* Emit informational message */ -- cgit v0.12 From 57f0a296c0b727e3d86cea312ba46efc98d76227 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 25 May 2017 10:25:30 -0400 Subject: Minor warning fix. --- tools/test/h5dump/h5dumpgentest.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 55a754d..44c4369 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -10318,7 +10318,6 @@ static void gent_udfilter(void) hid_t dcpl; /* dataset creation property list */ hid_t dsid; /* dataset ID */ hid_t sid; /* dataspace ID */ - hid_t tid; /* datatype ID */ hsize_t dims1[RANK] = {DIM1,DIM2}; hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; -- cgit v0.12 From db2da9f4b4b582d644d4b2e976040fce4dd1d665 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 25 May 2017 15:57:18 -0500 Subject: Reduce warnings --- java/src/jni/h5Constants.c | 1 + java/src/jni/h5lImp.c | 2 +- java/src/jni/h5pImp.c | 4 ++-- java/src/jni/h5plImp.c | 8 ++++---- java/src/jni/h5sImp.c | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index cd1c2f0..d4511e1 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -24,6 +24,7 @@ extern "C" { #include #include "hdf5.h" +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmissing-prototypes" JNIEXPORT jlong JNICALL diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c index bf2d7b1..ac71845 100644 --- a/java/src/jni/h5lImp.c +++ b/java/src/jni/h5lImp.c @@ -457,7 +457,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1value_1by_1idx } /* end if */ else { buf_size = infobuf.u.val_size; - if(buf_size < 0) { + if(buf_size == 0) { h5libraryError(env); } /* end if */ else { diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index df8b3c9..dcfcd82 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5127,8 +5127,8 @@ Java_hdf_hdf5lib_H5_H5Pget_1mdc_1log_1options else { /* get the length of the filename */ H5Pget_mdc_log_options((hid_t)fapl_id, &is_enabled, NULL, &location_size, &start_on_access); - if (location_size < 0) { - h5badArgument(env, "H5Pget_mdc_log_options: location_size < 0"); + if (location_size == 0) { + h5badArgument(env, "H5Pget_mdc_log_options: location_size is 0"); }/* end if */ else if (location_size > 0) { location_size++; /* add extra space for the null terminator */ diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c index f064634..ffd5b7a 100644 --- a/java/src/jni/h5plImp.c +++ b/java/src/jni/h5plImp.c @@ -68,7 +68,7 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5PLappend (JNIEnv *env, jclass clss, jobjectArray plugin_path) { - char *aName; + const char *aName; herr_t retVal = -1; PIN_JAVA_STRING(plugin_path, aName); @@ -90,7 +90,7 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5PLprepend (JNIEnv *env, jclass clss, jobjectArray plugin_path) { - char *aName; + const char *aName; herr_t retVal = -1; PIN_JAVA_STRING(plugin_path, aName); @@ -113,7 +113,7 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5PLreplace (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index) { - char *aName; + const char *aName; herr_t retVal = -1; PIN_JAVA_STRING(plugin_path, aName); @@ -136,7 +136,7 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5PLinsert (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index) { - char *aName; + const char *aName; herr_t retVal = -1; PIN_JAVA_STRING(plugin_path, aName); diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c index c578ab8..10f69eb 100644 --- a/java/src/jni/h5sImp.c +++ b/java/src/jni/h5sImp.c @@ -1206,8 +1206,8 @@ Java_hdf_hdf5lib_H5_H5Sencode if (status < 0) { h5libraryError(env); } /* end else if */ - else if (buf_size < 0) { - h5badArgument(env, "H5Sencode: buf_size < 0"); + else if (buf_size == 0) { + h5badArgument(env, "H5Sencode: buf_size = 0"); } /* end if */ else { bufPtr = (unsigned char*)HDcalloc((size_t) 1, buf_size); -- cgit v0.12 From d809de2ebe1c9f4f2cf60e3a79bf6dcc27adc68a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 26 May 2017 11:16:20 -0500 Subject: Note HDFFV-8611 change --- release_docs/RELEASE.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 8fb56cc..7ff4036 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -117,6 +117,11 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - Improved h5repack by retaining creation order and adding + arguments to set the order and index direction. + + (ADB, 2017/05/26, HDFFV-8611) + - Improved h5diff compare of strings and arrays. (ADB, 2017/05/18, HDFFV-9055, HDFFV-10128) -- cgit v0.12 From 742e1d5541a488ca1a1772c05833c16a6a73d3ab Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 26 May 2017 12:56:55 -0400 Subject: Fixed misplaced space in config/gnu-flags. --- config/gnu-flags | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/gnu-flags b/config/gnu-flags index 74cf76f..b4d5e8d 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -106,7 +106,7 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs" H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith" H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum" - H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros-Wunsafe -loop-optimizations -Wwrite-strings" + H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings" # Production # NDEBUG is handled explicitly by the configure script -- cgit v0.12 From 7f6443cc0d1b3d09f104b076ecc5ced758d3c1a1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 26 May 2017 13:05:18 -0500 Subject: Enhanced the release note using 'Writing Notes in a RELEASE.txt File' --- release_docs/RELEASE.txt | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7ff4036..b6ef74f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -117,14 +117,29 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- - - Improved h5repack by retaining creation order and adding - arguments to set the order and index direction. + - h5repack - (ADB, 2017/05/26, HDFFV-8611) + h5repack did not maintain the creation order flag of the root + group. - - Improved h5diff compare of strings and arrays. + Improved h5repack by reading the creation order and applying the + flag to the new root group. Also added arguments to set the + order and index direction, which applys to the traversing of the + original file, on the command line. - (ADB, 2017/05/18, HDFFV-9055, HDFFV-10128) + (ADB - 2017/05/26, HDFFV-8611) + + - h5diff + + h5diff failed to account for strpad type and null terminators + of char strings. Also, h5diff failed to account for string length + differences and would give a different result depending on file + order in the command line. + + Improved h5diff compare of strings and arrays by adding a check for + string lengths and if the strpad was null filled. + + (ADB - 2017/05/18, HDFFV-9055, HDFFV-10128) High-Level APIs: ------ -- cgit v0.12 From b6de142cf4a863787dceaa333684615fc190d6d5 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 26 May 2017 14:56:23 -0400 Subject: Chagned gfortran40 to gfortran in a few config files. --- config/freebsd | 4 ++-- config/gnu-fflags | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/freebsd b/config/freebsd index 936c29f..9a9348b 100644 --- a/config/freebsd +++ b/config/freebsd @@ -34,8 +34,8 @@ fi if test "X-" = "X-$FC"; then case $CC_BASENAME in gcc*|pgcc*) - FC=gfortran40 - FC_BASENAME=gfortran40 + FC=gfortran + FC_BASENAME=gfortran ;; icc*) FC=ifort diff --git a/config/gnu-fflags b/config/gnu-fflags index e92e054..6b5e6a1 100644 --- a/config/gnu-fflags +++ b/config/gnu-fflags @@ -71,7 +71,7 @@ if test "X-gfortran" = "X-$f9x_vendor"; then #esac # General - FC_BASENAME=gfortran40 + FC_BASENAME=gfortran F9XSUFFIXFLAG="" FSEARCH_DIRS="" H5_FCFLAGS="$H5_FCFLAGS -pedantic -Wall -Wextra -Wunderflow -Wimplicit-interface -Wsurprising" -- cgit v0.12 From c059e6ecf7bafc6b5c1c9b8a39e8515e23f52303 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 26 May 2017 13:59:00 -0500 Subject: Spelling --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b6ef74f..e52913f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -124,7 +124,7 @@ Bug Fixes since HDF5-1.10.1 release Improved h5repack by reading the creation order and applying the flag to the new root group. Also added arguments to set the - order and index direction, which applys to the traversing of the + order and index direction, which applies to the traversing of the original file, on the command line. (ADB - 2017/05/26, HDFFV-8611) -- cgit v0.12 From 13d3d4bd0e0b799aa9c3a9b45e445d1f52294d47 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 26 May 2017 18:22:07 -0400 Subject: Added feature flag checks for a few other VFDs in test/vfd.c. --- test/vfd.c | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 116 insertions(+), 10 deletions(-) diff --git a/test/vfd.c b/test/vfd.c index 213cd9c..f8e5761 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -101,9 +101,6 @@ test_sec2(void) TEST_ERROR; h5_fixname(FILENAME[0], fapl_id, filename, sizeof(filename)); - if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) - TEST_ERROR; - /* Check that the VFD feature flags are correct */ if ((driver_id = H5Pget_driver(fapl_id)) < 0) TEST_ERROR @@ -126,6 +123,9 @@ test_sec2(void) | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) + TEST_ERROR; + /* Retrieve the access property list... */ if((fapl_id_out = H5Fget_access_plist(fid)) < 0) TEST_ERROR; @@ -234,16 +234,10 @@ test_core(void) if(HDaccess(filename, F_OK) != -1) if(HDremove(filename) < 0) FAIL_PUTS_ERROR("unable to remove backing store file"); + /* Create and close file w/ backing store off */ if(H5Pset_fapl_core(fapl_id, (size_t)CORE_INCREMENT, FALSE) < 0) TEST_ERROR; - if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) - TEST_ERROR; - if(H5Fclose(fid) < 0) - TEST_ERROR; - /* Check for the backing store file */ - if(HDaccess(filename, F_OK) != -1) - FAIL_PUTS_ERROR("file created when backing store set to FALSE"); /* Check that the VFD feature flags are correct. * Note that the H5FDdriver_query() API call does not require a file @@ -268,6 +262,14 @@ test_core(void) | H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS)) TEST_ERROR + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) + TEST_ERROR; + if(H5Fclose(fid) < 0) + TEST_ERROR; + /* Check for the backing store file */ + if(HDaccess(filename, F_OK) != -1) + FAIL_PUTS_ERROR("file created when backing store set to FALSE"); + /************************************************************************ * Check basic core VFD operation and properties. This is done with the * backing store on so a file will be created for later use. @@ -843,6 +845,8 @@ test_family(void) { hid_t file=-1, fapl=-1, fapl2=-1, space=-1, dset=-1; hid_t access_fapl = -1; + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; char dname[]="dataset"; unsigned int i, j; @@ -860,6 +864,22 @@ test_family(void) TEST_ERROR; h5_fixname(FILENAME[2], fapl, filename, sizeof(filename)); + /* Check that the VFD feature flags are correct */ + if ((driver_id = H5Pget_driver(fapl)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA + | H5FD_FEAT_ACCUMULATE_METADATA + | H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA)) + TEST_ERROR + if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; @@ -1144,6 +1164,8 @@ test_multi(void) hid_t file=-1, fapl=-1, fapl2=-1, dset=-1, space=-1; hid_t root=-1, attr=-1, aspace=-1, atype=-1; hid_t access_fapl = -1; + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; int *fhandle2=NULL, *fhandle=NULL; hsize_t file_size; @@ -1200,6 +1222,22 @@ test_multi(void) TEST_ERROR; h5_fixname(FILENAME[4], fapl, filename, sizeof filename); + /* Check that the VFD feature flags are correct */ + if ((driver_id = H5Pget_driver(fapl)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_USE_ALLOC_SIZE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_PAGED_AGGR)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA + | H5FD_FEAT_USE_ALLOC_SIZE + | H5FD_FEAT_PAGED_AGGR)) + TEST_ERROR + if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; @@ -1532,6 +1570,8 @@ test_log(void) hid_t file = -1; hid_t fapl = -1; hid_t access_fapl = -1; + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; int *fhandle = NULL; hsize_t file_size = 0; @@ -1547,6 +1587,28 @@ test_log(void) TEST_ERROR; h5_fixname(FILENAME[6], fapl, filename, sizeof filename); + /* Check that the VFD feature flags are correct */ + if ((driver_id = H5Pget_driver(fapl)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_POSIX_COMPAT_HANDLE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA + | H5FD_FEAT_ACCUMULATE_METADATA + | H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA + | H5FD_FEAT_POSIX_COMPAT_HANDLE + | H5FD_FEAT_SUPPORTS_SWMR_IO + | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) + TEST_ERROR + /* Create the test file */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; @@ -1619,6 +1681,8 @@ test_stdio(void) hid_t file = -1; hid_t fapl = -1; hid_t access_fapl = -1; + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; FILE *fhandle = NULL; hsize_t file_size = 0; @@ -1632,6 +1696,24 @@ test_stdio(void) TEST_ERROR; h5_fixname(FILENAME[7], fapl, filename, sizeof filename); + /* Check that the VFD feature flags are correct */ + if ((driver_id = H5Pget_driver(fapl)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA + | H5FD_FEAT_ACCUMULATE_METADATA + | H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA + | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) + TEST_ERROR + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; @@ -1706,6 +1788,8 @@ test_windows(void) hid_t file = -1; hid_t fapl = -1; hid_t access_fapl = -1; + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; int *fhandle = NULL; hsize_t file_size = 0; @@ -1728,6 +1812,28 @@ test_windows(void) TEST_ERROR; h5_fixname(FILENAME[8], fapl, filename, sizeof filename); + /* Check that the VFD feature flags are correct */ + if ((driver_id = H5Pget_driver(fapl_id)) < 0) + TEST_ERROR + if (H5FDdriver_query(driver_id, &driver_flags) < 0) + TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_ACCUMULATE_METADATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DATA_SIEVE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_AGGREGATE_SMALLDATA)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_POSIX_COMPAT_HANDLE)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO)) TEST_ERROR + if(!(driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) TEST_ERROR + /* Check for extra flags not accounted for above */ + if(driver_flags != (H5FD_FEAT_AGGREGATE_METADATA + | H5FD_FEAT_ACCUMULATE_METADATA + | H5FD_FEAT_DATA_SIEVE + | H5FD_FEAT_AGGREGATE_SMALLDATA + | H5FD_FEAT_POSIX_COMPAT_HANDLE + | H5FD_FEAT_SUPPORTS_SWMR_IO + | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE)) + TEST_ERROR + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; -- cgit v0.12 From 86de942cf51c832dfda4ed47ca081138c091cb39 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 May 2017 11:16:11 -0500 Subject: Added toolset and intel checks --- config/cmake/CTestScript.cmake | 6 +++++- config/cmake/HDF5_Examples.cmake.in | 3 +++ config/cmake_ext_mod/HDFMacros.cmake | 39 ++++++++++++++++++++++-------------- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake index a3779d6..c59b10c 100755 --- a/config/cmake/CTestScript.cmake +++ b/config/cmake/CTestScript.cmake @@ -117,8 +117,12 @@ endif () #----------------------------------------------------------------------------- # Initialize the CTEST commands #------------------------------ +set(CTEST_CONFIGURE_TOOLSET "") +if(CMAKE_GENERATOR_TOOLSET) + set(CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}") +endif() set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) #----------------------------------------------------------------------------- diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 6918bb3..0f53aa1 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -17,6 +17,9 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################################################### set (CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +if () + set (CMAKE_GENERATOR_TOOLSET "@GENERATOR_TOOLSET@" +endif () set (CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) # handle input parameters to script. diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 48f57e6..602b6bf 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -247,21 +247,30 @@ macro (HDF_README_PROPERTIES target_fortran) elseif (${CMAKE_SYSTEM_VERSION} MATCHES "6.3") set (BINARY_PLATFORM "${BINARY_PLATFORM} 10") endif () - set (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") - if (${CMAKE_C_COMPILER_VERSION} MATCHES "^16.*") - set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") - elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^15.*") - set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2008") - elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^17.*") - set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2012") - elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^18.*") - set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2013") - elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.*") - set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015") - elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^20.*") - set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2017") - else () - set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") + if (CMAKE_C_COMPILER_ID MATCHES "Intel") + set (BINARY_PLATFORM "${BINARY_PLATFORM} Intel") + if (${CMAKE_C_COMPILER_VERSION} MATCHES "^17.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel 17") + else () + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using Intel ${CMAKE_C_COMPILER_VERSION}") + endif () + elseif (CMAKE_C_COMPILER_ID MATCHES "MSVC") + set (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") + if (${CMAKE_C_COMPILER_VERSION} MATCHES "^16.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^15.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2008") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^17.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2012") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^18.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2013") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^19.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "^20.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2017") + else () + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") + endif () endif () elseif (APPLE) set (BINARY_EXAMPLE_ENDING "tar.gz") -- cgit v0.12 From 9905db41ee8e061303410f91474a1acea6ad6ceb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 30 May 2017 11:33:21 -0500 Subject: Synchronize cmake files --- config/cmake/HDF518_Examples.cmake.in | 205 +++++++++------------------------- config/cmake/HDF5_Examples.cmake.in | 126 ++++++++++----------- 2 files changed, 113 insertions(+), 218 deletions(-) diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 33d3a40..4f61563 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -17,92 +17,79 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################################################### set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +if() + set(CMAKE_GENERATOR_TOOLSET "@GENERATOR_TOOLSET@" +endif() set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) # handle input parameters to script. #INSTALLDIR - HDF5-1.8 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo -#CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATIC_ONLY - Default is YES -#FORTRAN_LIBRARIES - Default is NO -##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) +#CTEST_SOURCE_NAME - name of source folder; HDF5Examples if(DEFINED CTEST_SCRIPT_ARG) - # transform ctest script arguments of the form - # script.ctest,var1=value1,var2=value2 - # to variables with the respective names set to the respective values - string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach(current_var ${script_args}) - if ("${current_var}" MATCHES "^([^=]+)=(.+)$") - set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif () - endforeach () -endif () -if(NOT DEFINED INSTALLDIR) - set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") -endif () + # transform ctest script arguments of the form + # script.ctest,var1=value1,var2=value2 + # to variables with the respective names set to the respective values + string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach(current_var ${script_args}) + if("${current_var}" MATCHES "^([^=]+)=(.+)$") + set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif() + endforeach() +endif() + +################################################################### +### Following Line is one of [Release, RelWithDebInfo, Debug] ##### +set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") if(NOT DEFINED CTEST_CONFIGURATION_TYPE) - set(CTEST_CONFIGURATION_TYPE "Release") -endif () + set(CTEST_CONFIGURATION_TYPE "Release") +endif() +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}") +################################################################## + +if(NOT DEFINED INSTALLDIR) + set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") +endif() + if(NOT DEFINED CTEST_SOURCE_NAME) - set(CTEST_SOURCE_NAME "HDF5Examples") -endif () -if(NOT DEFINED STATIC_ONLY) - set(STATICONLYLIBRARIES "YES") -else(NOT DEFINED STATIC_ONLY) - set(STATICONLYLIBRARIES "NO") -endif () -if(NOT DEFINED FORTRAN_LIBRARIES) - set(FORTRANLIBRARIES "NO") -else(NOT DEFINED FORTRAN_LIBRARIES) - set(FORTRANLIBRARIES "YES") -endif () + set(CTEST_SOURCE_NAME "HDF5Examples") +endif() + if(NOT DEFINED HDF_LOCAL) - set(CDASH_LOCAL "NO") -else(NOT HDF_LOCAL) - set(CDASH_LOCAL "YES") -endif () + set(CDASH_LOCAL "NO") +else() + set(CDASH_LOCAL "YES") +endif() if(NOT DEFINED CTEST_SITE) - set(CTEST_SITE "local") -endif () + set(CTEST_SITE "local") +endif() if(NOT DEFINED CTEST_BUILD_NAME) - set(CTEST_BUILD_NAME "examples") -endif () + set(CTEST_BUILD_NAME "examples") +endif() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) # set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.2.1-Source") -#endif () +#endif() ############################################################################################################### -# Adjust the following SET Commands as needed -############################################################################################################### if(WIN32) - if(${STATICONLYLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif () + set(SITE_OS_NAME "Windows") set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else(WIN32) - if(${STATICONLYLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif () +else() set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif(WIN32) -if(${FORTRANLIBRARIES}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") -else () - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") -endif () +endif() if(${CDASH_LOCAL}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") -endif () +endif() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### @@ -110,102 +97,10 @@ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HD # ############################################################################################################### -#----------------------------------------------------------------------------- -# MAC machines need special option -#----------------------------------------------------------------------------- -if(APPLE) - # Compiler choice - execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set(ENV{CC} "${XCODE_CC}") - set(ENV{CXX} "${XCODE_CXX}") - if(NOT NO_MAC_FORTRAN) - # Shared fortran is not supported, build static - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else () - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif () - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif () - -#----------------------------------------------------------------------------- -set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -## -------------------------- -if(CTEST_USE_TAR_SOURCE) - ## Uncompress source if tar or zip file provided - ## -------------------------- - if(WIN32) - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else () - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif () - - if(NOT rv EQUAL 0) - message(STATUS "extracting... [error-(${rv}) clean up]") - file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif () -endif(CTEST_USE_TAR_SOURCE) - -#----------------------------------------------------------------------------- -## Clear the build directory -## -------------------------- -set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) -if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") - ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) -else () - file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") -endif () - -# Use multiple CPU cores to build -include(ProcessorCount) -ProcessorCount(N) -if(NOT N EQUAL 0) - if(NOT WIN32) - set(CTEST_BUILD_FLAGS -j${N}) - endif () - set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif () -set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" -) - -#----------------------------------------------------------------------------- -## -- set output to english -set($ENV{LC_MESSAGES} "en_EN") - -#----------------------------------------------------------------------------- -configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) -ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") -## NORMAL process -## -------------------------- -ctest_start (Experimental) -ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -if(${res} LESS 0 OR ${res} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") -endif () -if(LOCAL_SUBMIT) - ctest_submit (PARTS Configure Notes) -endif () -ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND APPEND RETURN_VALUE res NUMBER_ERRORS errval) -if(${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") -endif () -if(LOCAL_SUBMIT) - ctest_submit (PARTS Build) -endif () -ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) -if(${res} LESS 0 OR ${res} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") -endif () -if(LOCAL_SUBMIT) - ctest_submit (PARTS Test) -endif () -if(${res} LESS 0 OR ${res} GREATER 0) - message (FATAL_ERROR "tests FAILED") -endif () -#----------------------------------------------------------------------------- -############################################################################################################## -message(STATUS "DONE") \ No newline at end of file +if(WIN32) + include(${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) + include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) +else() + include(${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake) + include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) +endif() diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 0f53aa1..08456ce 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -13,94 +13,94 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: -# ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -V -O test.log +# ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -VV -O test.log ############################################################################################################### -set (CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -if () - set (CMAKE_GENERATOR_TOOLSET "@GENERATOR_TOOLSET@" -endif () -set (CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +if() + set(CMAKE_GENERATOR_TOOLSET "@GENERATOR_TOOLSET@" +endif() +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) # handle input parameters to script. #INSTALLDIR - HDF5 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF5Examples -if (DEFINED CTEST_SCRIPT_ARG) +if(DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 # to variables with the respective names set to the respective values - string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach (current_var ${script_args}) - if ("${current_var}" MATCHES "^([^=]+)=(.+)$") - set ("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif () - endforeach () -endif () + string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach(current_var ${script_args}) + if("${current_var}" MATCHES "^([^=]+)=(.+)$") + set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif() + endforeach() +endif() ################################################################### ### Following Line is one of [Release, RelWithDebInfo, Debug] ##### -set (CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") -if (NOT DEFINED CTEST_CONFIGURATION_TYPE) - set (CTEST_CONFIGURATION_TYPE "Release") -endif () -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}") +set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") +if(NOT DEFINED CTEST_CONFIGURATION_TYPE) + set(CTEST_CONFIGURATION_TYPE "Release") +endif() +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}") ################################################################## -if (NOT DEFINED INSTALLDIR) - set (INSTALLDIR "@CMAKE_INSTALL_PREFIX@") -endif () +if(NOT DEFINED INSTALLDIR) + set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") +endif() -if (NOT DEFINED CTEST_SOURCE_NAME) - set (CTEST_SOURCE_NAME "HDF5Examples") -endif () +if(NOT DEFINED CTEST_SOURCE_NAME) + set(CTEST_SOURCE_NAME "HDF5Examples") +endif() -if (NOT DEFINED HDF_LOCAL) - set (CDASH_LOCAL "NO") -else () - set (CDASH_LOCAL "YES") -endif () +if(NOT DEFINED HDF_LOCAL) + set(CDASH_LOCAL "NO") +else() + set(CDASH_LOCAL "YES") +endif() if(NOT DEFINED CTEST_SITE) - set (CTEST_SITE "local") -endif () -if (NOT DEFINED CTEST_BUILD_NAME) - set (CTEST_BUILD_NAME "examples") -endif () -set (BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") + set(CTEST_SITE "local") +endif() +if(NOT DEFINED CTEST_BUILD_NAME) + set(CTEST_BUILD_NAME "examples") +endif() +set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") #TAR_SOURCE - name of tarfile -#if (NOT DEFINED TAR_SOURCE) -# set (CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.5-Source") -#endif () +#if(NOT DEFINED TAR_SOURCE) +# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.5-Source") +#endif() ############################################################################################################### -if (WIN32) - set (SITE_OS_NAME "Windows") - set (ENV{HDF5_DIR} "${INSTALLDIR}/cmake") - set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) - set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else () - set (ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") - set (ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") - set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) - set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif () -if (${CDASH_LOCAL}) - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") -endif () -set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") +if(WIN32) + set(SITE_OS_NAME "Windows") + set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") + set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) + set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") + set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") +else() + set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") + set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") + set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) + set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") + set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +endif() +if(${CDASH_LOCAL}) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") +endif() +set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### # For any comments please contact cdashhelp@hdfgroup.org # ############################################################################################################### -if (WIN32) - include (${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) - include (${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) -else () - include (${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake) - include (${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) -endif () +if(WIN32) + include(${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) + include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) +else() + include(${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake) + include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) +endif() -- cgit v0.12 From 5efda2babf7f4bd7424d147e20b72b0f227f1704 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 30 May 2017 16:33:20 -0700 Subject: Fixed typo in vfd.c from 'updated VFD feature flag' checkin. --- test/vfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/vfd.c b/test/vfd.c index f8e5761..5d5ebfc 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -1813,7 +1813,7 @@ test_windows(void) h5_fixname(FILENAME[8], fapl, filename, sizeof filename); /* Check that the VFD feature flags are correct */ - if ((driver_id = H5Pget_driver(fapl_id)) < 0) + if ((driver_id = H5Pget_driver(fapl)) < 0) TEST_ERROR if (H5FDdriver_query(driver_id, &driver_flags) < 0) TEST_ERROR -- cgit v0.12 From 0a3f8239e65b9405634560bc5e648247748bcdfa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 2 Jun 2017 11:44:51 -0500 Subject: Add toolset option --- config/cmake/HDF518_Examples.cmake.in | 4 ++-- config/cmake/HDF5_Examples.cmake.in | 4 ++-- config/cmake/hdf5-config.cmake.in | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 4f61563..6af0b09 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -17,8 +17,8 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################################################### set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -if() - set(CMAKE_GENERATOR_TOOLSET "@GENERATOR_TOOLSET@" +if("@CMAKE_GENERATOR_TOOLSET@") + set(CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") endif() set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 08456ce..d137b37 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -17,8 +17,8 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################################################### set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -if() - set(CMAKE_GENERATOR_TOOLSET "@GENERATOR_TOOLSET@" +if("@CMAKE_GENERATOR_TOOLSET@") + set(CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") endif() set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index c54391f..904c083 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -44,6 +44,7 @@ set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) set (${HDF5_PACKAGE_NAME}_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) set (${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@) set (${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES @HDF5_LIBRARIES_TO_EXPORT@) +set (${HDF5_PACKAGE_NAME}_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") #----------------------------------------------------------------------------- # Dependencies -- cgit v0.12 From 1ccb1b3c1f1dd844944d81f193149b0ebb51e5b8 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 6 Jun 2017 14:07:09 -0400 Subject: Made some H5O_layout_t stack allocations dynamic (quiets warnings). --- src/H5Dchunk.c | 13 +++++++++---- src/H5Dearray.c | 12 +++++++++--- src/H5Dfarray.c | 12 +++++++++--- src/H5Dint.c | 37 +++++++++++++++++++++---------------- src/H5Doh.c | 44 +++++++++++++++++++++++++------------------- src/H5Z.c | 21 +++++++++++++-------- 6 files changed, 86 insertions(+), 53 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 33fc036..59227de 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -5443,7 +5443,7 @@ herr_t H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ - H5O_layout_t layout; /* Dataset layout message */ + H5O_layout_t *layout = NULL; /* Dataset layout message */ hbool_t layout_read = FALSE; /* Whether the layout message was read from the file */ H5O_pline_t pline; /* I/O pipeline message */ hbool_t pline_read = FALSE; /* Whether the I/O pipeline message was read from the file */ @@ -5474,7 +5474,9 @@ H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) if((exists = H5O_msg_exists_oh(oh, H5O_LAYOUT_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to check for object header message") else if(exists) { - if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_LAYOUT_ID, &layout)) + if(NULL == (layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_LAYOUT_ID, layout)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout message") layout_read = TRUE; } /* end else if */ @@ -5485,7 +5487,7 @@ H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) idx_info.f = f; idx_info.dxpl_id = dxpl_id; idx_info.pline = &pline; - idx_info.layout = &layout.u.chunk; + idx_info.layout = &layout->u.chunk; idx_info.storage = &storage->u.chunk; /* Delete the chunked storage information in the file */ @@ -5498,9 +5500,12 @@ done: if(H5O_msg_reset(H5O_PLINE_ID, &pline) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset I/O pipeline message") if(layout_read) - if(H5O_msg_reset(H5O_LAYOUT_ID, &layout) < 0) + if(H5O_msg_reset(H5O_LAYOUT_ID, layout) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout message") + if(layout) + layout = (H5O_layout_t *)H5MM_xfree(layout); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_delete() */ diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 1df0a58..8fea75f 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -37,6 +37,7 @@ #include "H5EAprivate.h" /* Extensible arrays */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File space management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vector functions */ @@ -629,7 +630,7 @@ H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) H5D_earray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */ H5O_loc_t obj_loc; /* Pointer to an object's location */ hbool_t obj_opened = FALSE; /* Flag to indicate that the object header was opened */ - H5O_layout_t layout; /* Layout message */ + H5O_layout_t *layout = NULL; /* Layout message */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -653,7 +654,9 @@ H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) obj_opened = TRUE; /* Read the layout message */ - if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout, dxpl_id)) + if(NULL == (layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't get memory for layout") + if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, layout, dxpl_id)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info") /* close the object header */ @@ -662,7 +665,7 @@ H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) /* Create user data */ dbg_ctx->f = f; - dbg_ctx->chunk_size = layout.u.chunk.size; + dbg_ctx->chunk_size = layout->u.chunk.size; /* Set return value */ ret_value = dbg_ctx; @@ -681,6 +684,9 @@ done: } /* end if */ } /* end if */ + if(layout) + layout = (H5O_layout_t *)H5MM_xfree(layout); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__earray_crt_dbg_context() */ diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index d183a8c..b4bd6d6 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -36,6 +36,7 @@ #include "H5FAprivate.h" /* Fixed arrays */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File space management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vector functions */ @@ -469,7 +470,7 @@ H5D__farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) H5D_farray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */ H5O_loc_t obj_loc; /* Pointer to an object's location */ hbool_t obj_opened = FALSE; /* Flag to indicate that the object header was opened */ - H5O_layout_t layout; /* Layout message */ + H5O_layout_t *layout = NULL; /* Layout message */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -493,7 +494,9 @@ H5D__farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) obj_opened = TRUE; /* Read the layout message */ - if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout, dxpl_id)) + if(NULL == (layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't get memory for layout") + if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, layout, dxpl_id)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info") /* close the object header */ @@ -502,7 +505,7 @@ H5D__farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) /* Create user data */ dbg_ctx->f = f; - dbg_ctx->chunk_size = layout.u.chunk.size; + dbg_ctx->chunk_size = layout->u.chunk.size; /* Set return value */ ret_value = dbg_ctx; @@ -521,6 +524,9 @@ done: } /* end if */ } /* end if */ + if(layout) + layout = (H5O_layout_t *)H5MM_xfree(layout); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__farray_crt_dbg_context() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 08b3eb8..1da9d12 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -3302,7 +3302,7 @@ H5D_get_create_plist(H5D_t *dset) { H5P_genplist_t *dcpl_plist; /* Dataset's DCPL */ H5P_genplist_t *new_plist; /* Copy of dataset's DCPL */ - H5O_layout_t copied_layout; /* Layout to tweak */ + H5O_layout_t *copied_layout = NULL; /* Layout to tweak */ H5O_fill_t copied_fill; /* Fill value to tweak */ H5O_efl_t copied_efl; /* External file list to tweak */ hid_t new_dcpl_id = FAIL; @@ -3325,39 +3325,41 @@ H5D_get_create_plist(H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object creation info") /* Get the layout property */ - if(H5P_peek(new_plist, H5D_CRT_LAYOUT_NAME, &copied_layout) < 0) + if(NULL == (copied_layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(H5P_peek(new_plist, H5D_CRT_LAYOUT_NAME, copied_layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout") /* Reset layout values set when dataset is created */ - copied_layout.ops = NULL; - switch(copied_layout.type) { + copied_layout->ops = NULL; + switch(copied_layout->type) { case H5D_COMPACT: - copied_layout.storage.u.compact.buf = H5MM_xfree(copied_layout.storage.u.compact.buf); - HDmemset(&copied_layout.storage.u.compact, 0, sizeof(copied_layout.storage.u.compact)); + copied_layout->storage.u.compact.buf = H5MM_xfree(copied_layout->storage.u.compact.buf); + HDmemset(&copied_layout->storage.u.compact, 0, sizeof(copied_layout->storage.u.compact)); break; case H5D_CONTIGUOUS: - copied_layout.storage.u.contig.addr = HADDR_UNDEF; - copied_layout.storage.u.contig.size = 0; + copied_layout->storage.u.contig.addr = HADDR_UNDEF; + copied_layout->storage.u.contig.size = 0; break; case H5D_CHUNKED: /* Reset chunk size */ - copied_layout.u.chunk.size = 0; + copied_layout->u.chunk.size = 0; /* Reset index info, if the chunk ops are set */ - if(copied_layout.storage.u.chunk.ops) - /* Reset address and pointer of the array struct for the chunked storage index */ - if(H5D_chunk_idx_reset(&copied_layout.storage.u.chunk, TRUE) < 0) + if(copied_layout->storage.u.chunk.ops) + /* Reset address and pointer of the array struct for the chunked storage index */ + if(H5D_chunk_idx_reset(&copied_layout->storage.u.chunk, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to reset chunked storage index in dest") /* Reset chunk index ops */ - copied_layout.storage.u.chunk.ops = NULL; + copied_layout->storage.u.chunk.ops = NULL; break; case H5D_VIRTUAL: - copied_layout.storage.u.virt.serial_list_hobjid.addr = HADDR_UNDEF; - copied_layout.storage.u.virt.serial_list_hobjid.idx = 0; + copied_layout->storage.u.virt.serial_list_hobjid.addr = HADDR_UNDEF; + copied_layout->storage.u.virt.serial_list_hobjid.idx = 0; break; case H5D_LAYOUT_ERROR: @@ -3367,7 +3369,7 @@ H5D_get_create_plist(H5D_t *dset) } /* end switch */ /* Set back the (possibly modified) layout property to property list */ - if(H5P_poke(new_plist, H5D_CRT_LAYOUT_NAME, &copied_layout) < 0) + if(H5P_poke(new_plist, H5D_CRT_LAYOUT_NAME, copied_layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set layout") /* Get the fill value property */ @@ -3459,6 +3461,9 @@ done: if(H5I_dec_app_ref(new_dcpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to close temporary object") + if(copied_layout) + copied_layout = (H5O_layout_t *)H5MM_xfree(copied_layout); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_get_create_plist() */ diff --git a/src/H5Doh.c b/src/H5Doh.c index 9abbdff..cd70c56 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -27,6 +27,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ #include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ @@ -359,12 +360,12 @@ done: static herr_t H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) { - H5O_layout_t layout; /* Data storage layout message */ - H5O_efl_t efl; /* External File List message */ + H5O_layout_t *layout = NULL; /* Data storage layout message */ + H5O_efl_t efl; /* External File List message */ hbool_t layout_read = FALSE; /* Whether the layout message was read */ hbool_t efl_read = FALSE; /* Whether the external file list message was read */ - htri_t exists; /* Flag if header message of interest exists */ - herr_t ret_value = SUCCEED; /* Return value */ + htri_t exists; /* Flag if header message of interest exists */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -376,22 +377,24 @@ H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * HDassert(bh_info); /* Get the layout message from the object header */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_LAYOUT_ID, &layout)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find layout message") + if(NULL == (layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_LAYOUT_ID, layout)) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find layout message") layout_read = TRUE; /* Check for chunked dataset storage */ - if(layout.type == H5D_CHUNKED && H5D__chunk_is_space_alloc(&layout.storage)) { + if(layout->type == H5D_CHUNKED && H5D__chunk_is_space_alloc(&(layout->storage))) { /* Get size of chunk index */ - if(H5D__chunk_bh_info(loc, dxpl_id, oh, &layout, &(bh_info->index_size)) < 0) + if(H5D__chunk_bh_info(loc, dxpl_id, oh, layout, &(bh_info->index_size)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine chunked dataset btree info") } /* end if */ - else if(layout.type == H5D_VIRTUAL - && (layout.storage.u.virt.serial_list_hobjid.addr != HADDR_UNDEF)) { + else if(layout->type == H5D_VIRTUAL + && (layout->storage.u.virt.serial_list_hobjid.addr != HADDR_UNDEF)) { size_t virtual_heap_size; /* Get size of global heap object for virtual dataset */ - if(H5HG_get_obj_size(loc->file, dxpl_id, &(layout.storage.u.virt.serial_list_hobjid), &virtual_heap_size) < 0) + if(H5HG_get_obj_size(loc->file, dxpl_id, &(layout->storage.u.virt.serial_list_hobjid), &virtual_heap_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get global heap size for virtual dataset mapping") /* Return heap size */ @@ -400,29 +403,32 @@ H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * /* Check for External File List message in the object header */ if((exists = H5O_msg_exists_oh(oh, H5O_EFL_ID)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for EFL message") + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for EFL message") - if(exists && H5D__efl_is_space_alloc(&layout.storage)) { + if(exists && H5D__efl_is_space_alloc(&(layout->storage))) { /* Start with clean EFL info */ HDmemset(&efl, 0, sizeof(efl)); - /* Get External File List message from the object header */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_EFL_ID, &efl)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find EFL message") + /* Get External File List message from the object header */ + if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_EFL_ID, &efl)) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find EFL message") efl_read = TRUE; - /* Get size of local heap for EFL message's file list */ - if(H5D__efl_bh_info(loc->file, dxpl_id, &efl, &(bh_info->heap_size)) < 0) + /* Get size of local heap for EFL message's file list */ + if(H5D__efl_bh_info(loc->file, dxpl_id, &efl, &(bh_info->heap_size)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine EFL heap info") } /* end if */ done: /* Free messages, if they've been read in */ - if(layout_read && H5O_msg_reset(H5O_LAYOUT_ID, &layout) < 0) + if(layout_read && H5O_msg_reset(H5O_LAYOUT_ID, layout) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset data storage layout message") if(efl_read && H5O_msg_reset(H5O_EFL_ID, &efl) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset external file list message") + if(layout) + layout = (H5O_layout_t *)H5MM_xfree(layout); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__dset_bh_info() */ diff --git a/src/H5Z.c b/src/H5Z.c index ef34d7c..de84a9e 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -811,8 +811,9 @@ done: static herr_t H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) { - hid_t space_id = -1; /* ID for dataspace describing chunk */ - herr_t ret_value = SUCCEED; /* Return value */ + hid_t space_id = -1; /* ID for dataspace describing chunk */ + H5O_layout_t *dcpl_layout = NULL; /* Dataset's layout information */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -822,18 +823,20 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type /* Check if the property list is non-default */ if(dcpl_id != H5P_DATASET_CREATE_DEFAULT) { H5P_genplist_t *dc_plist; /* Dataset creation property list object */ - H5O_layout_t dcpl_layout; /* Dataset's layout information */ + + if(NULL == (dcpl_layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") /* Get dataset creation property list object */ if(NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") /* Peek at the layout information */ - if(H5P_peek(dc_plist, H5D_CRT_LAYOUT_NAME, &dcpl_layout) < 0) + if(H5P_peek(dc_plist, H5D_CRT_LAYOUT_NAME, dcpl_layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve layout") /* Check if the dataset is chunked */ - if(H5D_CHUNKED == dcpl_layout.type) { + if(H5D_CHUNKED == dcpl_layout->type) { H5O_pline_t dcpl_pline; /* Object's I/O pipeline information */ /* Get I/O pipeline information */ @@ -847,9 +850,9 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type size_t u; /* Local index variable */ /* Create a data space for a chunk & set the extent */ - for(u = 0; u < dcpl_layout.u.chunk.ndims; u++) - chunk_dims[u] = dcpl_layout.u.chunk.dim[u]; - if(NULL == (space = H5S_create_simple(dcpl_layout.u.chunk.ndims, chunk_dims, NULL))) + for(u = 0; u < dcpl_layout->u.chunk.ndims; u++) + chunk_dims[u] = dcpl_layout->u.chunk.dim[u]; + if(NULL == (space = H5S_create_simple(dcpl_layout->u.chunk.ndims, chunk_dims, NULL))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Get ID for dataspace to pass to filter routines */ @@ -868,6 +871,8 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type done: if(space_id > 0 && H5I_dec_ref(space_id) < 0) HDONE_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") + if(dcpl_layout) + dcpl_layout = (H5O_layout_t *)H5MM_xfree(dcpl_layout); FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_prepare_prelude_callback_dcpl() */ -- cgit v0.12 From 390b5a9febece77f236f4361983c4ef9dbeb394d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 7 Jun 2017 13:38:27 -0400 Subject: Updated H5O_layout_t dynamic work to use the H5FL interface. --- src/H5Dchunk.c | 7 +++++-- src/H5Dearray.c | 10 ++++++---- src/H5Dfarray.c | 8 +++++--- src/H5Dint.c | 7 +++++-- src/H5Doh.c | 8 +++++--- src/H5Omessage.c | 10 +++++----- src/H5Z.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++--------- 7 files changed, 79 insertions(+), 28 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 59227de..a927736 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -368,6 +368,9 @@ H5FL_BLK_DEFINE_STATIC(chunk); /* Declare extern free list to manage the H5S_sel_iter_t struct */ H5FL_EXTERN(H5S_sel_iter_t); +/* Declare a free list to manage the H5O_layout_t struct */ +H5FL_DEFINE_STATIC(H5O_layout_t); + /*------------------------------------------------------------------------- * Function: H5D__chunk_direct_write @@ -5474,7 +5477,7 @@ H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) if((exists = H5O_msg_exists_oh(oh, H5O_LAYOUT_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to check for object header message") else if(exists) { - if(NULL == (layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_LAYOUT_ID, layout)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout message") @@ -5504,7 +5507,7 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout message") if(layout) - layout = (H5O_layout_t *)H5MM_xfree(layout); + layout = H5FL_FREE(H5O_layout_t, layout); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_delete() */ diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 8fea75f..bbff8b8 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -37,7 +37,6 @@ #include "H5EAprivate.h" /* Extensible arrays */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File space management */ -#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vector functions */ @@ -215,10 +214,13 @@ const H5EA_class_t H5EA_CLS_FILT_CHUNK[1]={{ /*******************/ /* Declare a free list to manage the H5D_earray_ctx_t struct */ -/* Declare a free list to manage the H5D_earray_ctx_ud_t struct */ H5FL_DEFINE_STATIC(H5D_earray_ctx_t); + +/* Declare a free list to manage the H5D_earray_ctx_ud_t struct */ H5FL_DEFINE_STATIC(H5D_earray_ctx_ud_t); +/* Declare a free list to manage the H5O_layout_t struct */ +H5FL_DEFINE_STATIC(H5O_layout_t); /*------------------------------------------------------------------------- @@ -654,7 +656,7 @@ H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) obj_opened = TRUE; /* Read the layout message */ - if(NULL == (layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't get memory for layout") if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, layout, dxpl_id)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info") @@ -685,7 +687,7 @@ done: } /* end if */ if(layout) - layout = (H5O_layout_t *)H5MM_xfree(layout); + layout = H5FL_FREE(H5O_layout_t, layout); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__earray_crt_dbg_context() */ diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index b4bd6d6..62c4150 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -36,7 +36,6 @@ #include "H5FAprivate.h" /* Fixed arrays */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File space management */ -#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vector functions */ @@ -218,6 +217,9 @@ H5FL_DEFINE_STATIC(H5D_farray_ctx_t); /* Declare a free list to manage the H5D_farray_ctx_ud_t struct */ H5FL_DEFINE_STATIC(H5D_farray_ctx_ud_t); +/* Declare a free list to manage the H5O_layout_t struct */ +H5FL_DEFINE_STATIC(H5O_layout_t); + /*------------------------------------------------------------------------- * Function: H5D__farray_crt_context @@ -494,7 +496,7 @@ H5D__farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) obj_opened = TRUE; /* Read the layout message */ - if(NULL == (layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't get memory for layout") if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, layout, dxpl_id)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info") @@ -525,7 +527,7 @@ done: } /* end if */ if(layout) - layout = (H5O_layout_t *)H5MM_xfree(layout); + layout = H5FL_FREE(H5O_layout_t, layout); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__farray_crt_dbg_context() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 1da9d12..f1ba594 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -104,6 +104,9 @@ H5FL_EXTERN(H5D_chunk_info_t); /* Declare extern the free list to manage blocks of type conversion data */ H5FL_BLK_EXTERN(type_conv); +/* Declare a free list to manage the H5O_layout_t struct */ +H5FL_DEFINE_STATIC(H5O_layout_t); + /* Define a static "default" dataset structure to use to initialize new datasets */ static H5D_shared_t H5D_def_dset; @@ -3325,7 +3328,7 @@ H5D_get_create_plist(H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object creation info") /* Get the layout property */ - if(NULL == (copied_layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + if(NULL == (copied_layout = H5FL_CALLOC(H5O_layout_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") if(H5P_peek(new_plist, H5D_CRT_LAYOUT_NAME, copied_layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout") @@ -3462,7 +3465,7 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to close temporary object") if(copied_layout) - copied_layout = (H5O_layout_t *)H5MM_xfree(copied_layout); + copied_layout = H5FL_FREE(H5O_layout_t, copied_layout); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_get_create_plist() */ diff --git a/src/H5Doh.c b/src/H5Doh.c index cd70c56..bd83780 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -27,7 +27,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ #include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ @@ -88,6 +87,9 @@ const H5O_obj_class_t H5O_OBJ_DATASET[1] = {{ /* Declare a free list to manage the H5D_copy_file_ud_t struct */ H5FL_DEFINE(H5D_copy_file_ud_t); +/* Declare a free list to manage the H5O_layout_t struct */ +H5FL_DEFINE_STATIC(H5O_layout_t); + /*------------------------------------------------------------------------- * Function: H5O__dset_get_copy_file_udata @@ -377,7 +379,7 @@ H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * HDassert(bh_info); /* Get the layout message from the object header */ - if(NULL == (layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_LAYOUT_ID, layout)) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find layout message") @@ -427,7 +429,7 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset external file list message") if(layout) - layout = (H5O_layout_t *)H5MM_xfree(layout); + layout = H5FL_FREE(H5O_layout_t, layout); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__dset_bh_info() */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 158701b..90c2b23 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -732,12 +732,12 @@ H5O_msg_free_real(const H5O_msg_class_t *type, void *msg_native) /*------------------------------------------------------------------------- * Function: H5O_msg_copy * - * Purpose: Copies a message. If MESG is is the null pointer then a null - * pointer is returned with no error. + * Purpose: Copies a message. If MESG is is the null pointer then a null + * pointer is returned with no error. * - * Return: Success: Ptr to the new message + * Return: Success: Ptr to the new message * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Thursday, May 21, 1998 @@ -748,7 +748,7 @@ void * H5O_msg_copy(unsigned type_id, const void *mesg, void *dst) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - void *ret_value = NULL; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) diff --git a/src/H5Z.c b/src/H5Z.c index de84a9e..be8c0ed 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -11,13 +11,21 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/****************/ +/* Module Setup */ +/****************/ + #include "H5Zmodule.h" /* This source code file is part of the H5Z module */ +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5Dprivate.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ @@ -30,7 +38,16 @@ # include "szlib.h" #endif -/* Local typedefs */ + +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + #ifdef H5Z_DEBUG typedef struct H5Z_stats_t { struct { @@ -55,19 +72,41 @@ typedef enum { /* Package initialization variable */ hbool_t H5_PKG_INIT_VAR = FALSE; -/* Local variables */ + +/********************/ +/* Local Prototypes */ +/********************/ +static int H5Z_find_idx(H5Z_filter_t id); +static int H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t obj_id, void *key); +static int H5Z__check_unregister_group_cb(void *obj_ptr, hid_t obj_id, void *key); +static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key); + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + static size_t H5Z_table_alloc_g = 0; static size_t H5Z_table_used_g = 0; static H5Z_class2_t *H5Z_table_g = NULL; + #ifdef H5Z_DEBUG static H5Z_stats_t *H5Z_stat_table_g = NULL; #endif /* H5Z_DEBUG */ -/* Local functions */ -static int H5Z_find_idx(H5Z_filter_t id); -static int H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t obj_id, void *key); -static int H5Z__check_unregister_group_cb(void *obj_ptr, hid_t obj_id, void *key); -static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key); +/* Declare a free list to manage the H5O_layout_t struct */ +H5FL_DEFINE_STATIC(H5O_layout_t); + /*------------------------------------------------------------------------- @@ -824,7 +863,7 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type if(dcpl_id != H5P_DATASET_CREATE_DEFAULT) { H5P_genplist_t *dc_plist; /* Dataset creation property list object */ - if(NULL == (dcpl_layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + if(NULL == (dcpl_layout = H5FL_CALLOC(H5O_layout_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") /* Get dataset creation property list object */ @@ -872,7 +911,7 @@ done: if(space_id > 0 && H5I_dec_ref(space_id) < 0) HDONE_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") if(dcpl_layout) - dcpl_layout = (H5O_layout_t *)H5MM_xfree(dcpl_layout); + dcpl_layout = H5FL_FREE(H5O_layout_t, dcpl_layout); FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_prepare_prelude_callback_dcpl() */ -- cgit v0.12 From d391d8a690b4d595709e1274882fb5e5e0559f9e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 7 Jun 2017 18:10:48 -0400 Subject: * Made STATIC free lists EXTERN for H5O_layout_t. * Made all non-global instances of H5O_layout_t in H5Pdcpl.c dynamic. --- src/H5Dchunk.c | 2 +- src/H5Dearray.c | 2 +- src/H5Dfarray.c | 2 +- src/H5Dint.c | 2 +- src/H5Doh.c | 2 +- src/H5Pdcpl.c | 409 +++++++++++++++++++++++++++++++++----------------------- src/H5Z.c | 2 +- 7 files changed, 251 insertions(+), 170 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index a927736..317039d 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -369,7 +369,7 @@ H5FL_BLK_DEFINE_STATIC(chunk); H5FL_EXTERN(H5S_sel_iter_t); /* Declare a free list to manage the H5O_layout_t struct */ -H5FL_DEFINE_STATIC(H5O_layout_t); +H5FL_EXTERN(H5O_layout_t); /*------------------------------------------------------------------------- diff --git a/src/H5Dearray.c b/src/H5Dearray.c index bbff8b8..a45d546 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -220,7 +220,7 @@ H5FL_DEFINE_STATIC(H5D_earray_ctx_t); H5FL_DEFINE_STATIC(H5D_earray_ctx_ud_t); /* Declare a free list to manage the H5O_layout_t struct */ -H5FL_DEFINE_STATIC(H5O_layout_t); +H5FL_EXTERN(H5O_layout_t); /*------------------------------------------------------------------------- diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index 62c4150..486fb54 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -218,7 +218,7 @@ H5FL_DEFINE_STATIC(H5D_farray_ctx_t); H5FL_DEFINE_STATIC(H5D_farray_ctx_ud_t); /* Declare a free list to manage the H5O_layout_t struct */ -H5FL_DEFINE_STATIC(H5O_layout_t); +H5FL_EXTERN(H5O_layout_t); /*------------------------------------------------------------------------- diff --git a/src/H5Dint.c b/src/H5Dint.c index f1ba594..c13a7a1 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -105,7 +105,7 @@ H5FL_EXTERN(H5D_chunk_info_t); H5FL_BLK_EXTERN(type_conv); /* Declare a free list to manage the H5O_layout_t struct */ -H5FL_DEFINE_STATIC(H5O_layout_t); +H5FL_EXTERN(H5O_layout_t); /* Define a static "default" dataset structure to use to initialize new datasets */ static H5D_shared_t H5D_def_dset; diff --git a/src/H5Doh.c b/src/H5Doh.c index bd83780..b371519 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -88,7 +88,7 @@ const H5O_obj_class_t H5O_OBJ_DATASET[1] = {{ H5FL_DEFINE(H5D_copy_file_ud_t); /* Declare a free list to manage the H5O_layout_t struct */ -H5FL_DEFINE_STATIC(H5O_layout_t); +H5FL_EXTERN(H5O_layout_t); /*------------------------------------------------------------------------- diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 3b4c159..ea4a05a 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -200,6 +200,8 @@ const H5P_libclass_t H5P_CLS_DCRT[1] = {{ /* Declare extern the free list to manage blocks of type conversion data */ H5FL_BLK_EXTERN(type_conv); +/* Declare a free list to manage the H5O_layout_t struct */ +H5FL_EXTERN(H5O_layout_t); /***************************/ /* Local Private Variables */ @@ -292,7 +294,7 @@ H5P__dcrt_layout_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *na size_t H5_ATTR_UNUSED size, void *value) { H5O_layout_t *layout = (H5O_layout_t *)value; /* Create local aliases for values */ - H5O_layout_t new_layout; + H5O_layout_t *new_layout = NULL; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -301,13 +303,18 @@ H5P__dcrt_layout_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *na HDassert(value); /* Make copy of layout */ - if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, &new_layout)) + if(NULL == (new_layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, new_layout)) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy layout") /* Copy new layout message over old one */ - *layout = new_layout; + *layout = *new_layout; done: + if(new_layout) + new_layout = H5FL_FREE(H5O_layout_t, new_layout); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dcrt_layout_set() */ @@ -330,7 +337,7 @@ H5P__dcrt_layout_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *na size_t H5_ATTR_UNUSED size, void *value) { H5O_layout_t *layout = (H5O_layout_t *)value; /* Create local aliases for values */ - H5O_layout_t new_layout; + H5O_layout_t *new_layout = NULL; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -339,13 +346,18 @@ H5P__dcrt_layout_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *na HDassert(value); /* Make copy of layout */ - if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, &new_layout)) + if(NULL == (new_layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, new_layout)) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy layout") /* Copy new layout message over old one */ - *layout = new_layout; + *layout = *new_layout; done: + if(new_layout) + new_layout = H5FL_FREE(H5O_layout_t, new_layout); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dcrt_layout_get() */ @@ -504,7 +516,7 @@ static herr_t H5P__dcrt_layout_dec(const void **_pp, void *value) { const H5O_layout_t *layout; /* Storage layout */ - H5O_layout_t tmp_layout; /* Temporary local layout structure */ + H5O_layout_t *tmp_layout = NULL; /* Temporary local layout structure */ H5D_layout_t type; /* Layout type */ const uint8_t **pp = (const uint8_t **)_pp; herr_t ret_value = SUCCEED; /* Return value */ @@ -543,16 +555,20 @@ H5P__dcrt_layout_dec(const void **_pp, void *value) else { /* chunk layout structure is encoded*/ unsigned u; /* Local index variable */ + /* Allocate temporary layout */ + if(NULL == (tmp_layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for temp layout") + /* Initialize to default values */ - tmp_layout = H5D_def_layout_chunk_g; + *tmp_layout = H5D_def_layout_chunk_g; /* Set rank & dimensions */ - tmp_layout.u.chunk.ndims = (unsigned)ndims; + tmp_layout->u.chunk.ndims = (unsigned)ndims; for(u = 0; u < ndims; u++) - UINT32DECODE(*pp, tmp_layout.u.chunk.dim[u]) + UINT32DECODE(*pp, tmp_layout->u.chunk.dim[u]) /* Point at the newly set up struct */ - layout = &tmp_layout; + layout = tmp_layout; } /* end else */ } break; @@ -571,82 +587,86 @@ H5P__dcrt_layout_dec(const void **_pp, void *value) size_t tmp_size; size_t u; /* Local index variable */ + /* Allocate temporary layout */ + if(NULL == (tmp_layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for temp layout") + /* Initialize to default values */ - tmp_layout = H5D_def_layout_virtual_g; + *tmp_layout = H5D_def_layout_virtual_g; /* Allocate entry list */ - if(NULL == (tmp_layout.storage.u.virt.list = (H5O_storage_virtual_ent_t *)H5MM_calloc((size_t)nentries * sizeof(H5O_storage_virtual_ent_t)))) + if(NULL == (tmp_layout->storage.u.virt.list = (H5O_storage_virtual_ent_t *)H5MM_calloc((size_t)nentries * sizeof(H5O_storage_virtual_ent_t)))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate heap block") - tmp_layout.storage.u.virt.list_nalloc = (size_t)nentries; - tmp_layout.storage.u.virt.list_nused = (size_t)nentries; + tmp_layout->storage.u.virt.list_nalloc = (size_t)nentries; + tmp_layout->storage.u.virt.list_nused = (size_t)nentries; /* Decode each entry */ for(u = 0; u < (size_t)nentries; u++) { /* Source file name */ tmp_size = HDstrlen((const char *)*pp) + 1; - if(NULL == (tmp_layout.storage.u.virt.list[u].source_file_name = (char *)H5MM_malloc(tmp_size))) + if(NULL == (tmp_layout->storage.u.virt.list[u].source_file_name = (char *)H5MM_malloc(tmp_size))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate memory for source file name") - (void)HDmemcpy(tmp_layout.storage.u.virt.list[u].source_file_name, *pp, tmp_size); + (void)HDmemcpy(tmp_layout->storage.u.virt.list[u].source_file_name, *pp, tmp_size); *pp += tmp_size; /* Source dataset name */ tmp_size = HDstrlen((const char *)*pp) + 1; - if(NULL == (tmp_layout.storage.u.virt.list[u].source_dset_name = (char *)H5MM_malloc(tmp_size))) + if(NULL == (tmp_layout->storage.u.virt.list[u].source_dset_name = (char *)H5MM_malloc(tmp_size))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate memory for source dataset name") - (void)HDmemcpy(tmp_layout.storage.u.virt.list[u].source_dset_name, *pp, tmp_size); + (void)HDmemcpy(tmp_layout->storage.u.virt.list[u].source_dset_name, *pp, tmp_size); *pp += tmp_size; /* Source selection */ - if(NULL == (tmp_layout.storage.u.virt.list[u].source_select = H5S_decode(pp))) + if(NULL == (tmp_layout->storage.u.virt.list[u].source_select = H5S_decode(pp))) HGOTO_ERROR(H5E_PLIST, H5E_CANTDECODE, FAIL, "can't decode source space selection") - tmp_layout.storage.u.virt.list[u].source_space_status = H5O_VIRTUAL_STATUS_USER; + tmp_layout->storage.u.virt.list[u].source_space_status = H5O_VIRTUAL_STATUS_USER; /* Virtual selection */ - if(NULL == (tmp_layout.storage.u.virt.list[u].source_dset.virtual_select = H5S_decode(pp))) + if(NULL == (tmp_layout->storage.u.virt.list[u].source_dset.virtual_select = H5S_decode(pp))) HGOTO_ERROR(H5E_PLIST, H5E_CANTDECODE, FAIL, "can't decode virtual space selection") - tmp_layout.storage.u.virt.list[u].virtual_space_status = H5O_VIRTUAL_STATUS_USER; + tmp_layout->storage.u.virt.list[u].virtual_space_status = H5O_VIRTUAL_STATUS_USER; /* Parse source file and dataset names for "printf" * style format specifiers */ - if(H5D_virtual_parse_source_name(tmp_layout.storage.u.virt.list[u].source_file_name, &tmp_layout.storage.u.virt.list[u].parsed_source_file_name, &tmp_layout.storage.u.virt.list[u].psfn_static_strlen, &tmp_layout.storage.u.virt.list[u].psfn_nsubs) < 0) + if(H5D_virtual_parse_source_name(tmp_layout->storage.u.virt.list[u].source_file_name, &tmp_layout->storage.u.virt.list[u].parsed_source_file_name, &tmp_layout->storage.u.virt.list[u].psfn_static_strlen, &tmp_layout->storage.u.virt.list[u].psfn_nsubs) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't parse source file name") - if(H5D_virtual_parse_source_name(tmp_layout.storage.u.virt.list[u].source_dset_name, &tmp_layout.storage.u.virt.list[u].parsed_source_dset_name, &tmp_layout.storage.u.virt.list[u].psdn_static_strlen, &tmp_layout.storage.u.virt.list[u].psdn_nsubs) < 0) + if(H5D_virtual_parse_source_name(tmp_layout->storage.u.virt.list[u].source_dset_name, &tmp_layout->storage.u.virt.list[u].parsed_source_dset_name, &tmp_layout->storage.u.virt.list[u].psdn_static_strlen, &tmp_layout->storage.u.virt.list[u].psdn_nsubs) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't parse source dataset name") /* Set source names in source_dset struct */ - if((tmp_layout.storage.u.virt.list[u].psfn_nsubs == 0) - && (tmp_layout.storage.u.virt.list[u].psdn_nsubs == 0)) { - if(tmp_layout.storage.u.virt.list[u].parsed_source_file_name) - tmp_layout.storage.u.virt.list[u].source_dset.file_name = tmp_layout.storage.u.virt.list[u].parsed_source_file_name->name_segment; + if((tmp_layout->storage.u.virt.list[u].psfn_nsubs == 0) + && (tmp_layout->storage.u.virt.list[u].psdn_nsubs == 0)) { + if(tmp_layout->storage.u.virt.list[u].parsed_source_file_name) + tmp_layout->storage.u.virt.list[u].source_dset.file_name = tmp_layout->storage.u.virt.list[u].parsed_source_file_name->name_segment; else - tmp_layout.storage.u.virt.list[u].source_dset.file_name = tmp_layout.storage.u.virt.list[u].source_file_name; - if(tmp_layout.storage.u.virt.list[u].parsed_source_dset_name) - tmp_layout.storage.u.virt.list[u].source_dset.dset_name = tmp_layout.storage.u.virt.list[u].parsed_source_dset_name->name_segment; + tmp_layout->storage.u.virt.list[u].source_dset.file_name = tmp_layout->storage.u.virt.list[u].source_file_name; + if(tmp_layout->storage.u.virt.list[u].parsed_source_dset_name) + tmp_layout->storage.u.virt.list[u].source_dset.dset_name = tmp_layout->storage.u.virt.list[u].parsed_source_dset_name->name_segment; else - tmp_layout.storage.u.virt.list[u].source_dset.dset_name = tmp_layout.storage.u.virt.list[u].source_dset_name; + tmp_layout->storage.u.virt.list[u].source_dset.dset_name = tmp_layout->storage.u.virt.list[u].source_dset_name; } /* end if */ /* unlim_dim fields */ - tmp_layout.storage.u.virt.list[u].unlim_dim_source = H5S_get_select_unlim_dim(tmp_layout.storage.u.virt.list[u].source_select); - tmp_layout.storage.u.virt.list[u].unlim_dim_virtual = H5S_get_select_unlim_dim(tmp_layout.storage.u.virt.list[u].source_dset.virtual_select); - tmp_layout.storage.u.virt.list[u].unlim_extent_source = HSIZE_UNDEF; - tmp_layout.storage.u.virt.list[u].unlim_extent_virtual = HSIZE_UNDEF; - tmp_layout.storage.u.virt.list[u].clip_size_source = HSIZE_UNDEF; - tmp_layout.storage.u.virt.list[u].clip_size_virtual = HSIZE_UNDEF; + tmp_layout->storage.u.virt.list[u].unlim_dim_source = H5S_get_select_unlim_dim(tmp_layout->storage.u.virt.list[u].source_select); + tmp_layout->storage.u.virt.list[u].unlim_dim_virtual = H5S_get_select_unlim_dim(tmp_layout->storage.u.virt.list[u].source_dset.virtual_select); + tmp_layout->storage.u.virt.list[u].unlim_extent_source = HSIZE_UNDEF; + tmp_layout->storage.u.virt.list[u].unlim_extent_virtual = HSIZE_UNDEF; + tmp_layout->storage.u.virt.list[u].clip_size_source = HSIZE_UNDEF; + tmp_layout->storage.u.virt.list[u].clip_size_virtual = HSIZE_UNDEF; /* Clipped selections */ - if(tmp_layout.storage.u.virt.list[u].unlim_dim_virtual < 0) { - tmp_layout.storage.u.virt.list[u].source_dset.clipped_source_select = tmp_layout.storage.u.virt.list[u].source_select; - tmp_layout.storage.u.virt.list[u].source_dset.clipped_virtual_select = tmp_layout.storage.u.virt.list[u].source_dset.virtual_select; + if(tmp_layout->storage.u.virt.list[u].unlim_dim_virtual < 0) { + tmp_layout->storage.u.virt.list[u].source_dset.clipped_source_select = tmp_layout->storage.u.virt.list[u].source_select; + tmp_layout->storage.u.virt.list[u].source_dset.clipped_virtual_select = tmp_layout->storage.u.virt.list[u].source_dset.virtual_select; } /* end if */ /* Update min_dims */ - if(H5D_virtual_update_min_dims(&tmp_layout, u) < 0) + if(H5D_virtual_update_min_dims(tmp_layout, u) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to update virtual dataset minimum dimensions") } /* end for */ /* Point at the newly set up struct */ - layout = &tmp_layout; + layout = tmp_layout; } /* end else */ } /* end block */ break; @@ -661,6 +681,9 @@ H5P__dcrt_layout_dec(const void **_pp, void *value) HDmemcpy(value, layout, sizeof(H5O_layout_t)); done: + if(tmp_layout) + tmp_layout = H5FL_FREE(H5O_layout_t, tmp_layout); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dcrt_layout_dec() */ @@ -716,7 +739,7 @@ H5P__dcrt_layout_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED siz void *value) { H5O_layout_t *layout = (H5O_layout_t *)value; /* Create local aliases for values */ - H5O_layout_t new_layout; + H5O_layout_t *new_layout = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -724,13 +747,18 @@ H5P__dcrt_layout_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED siz HDassert(layout); /* Make copy of layout */ - if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, &new_layout)) + if(NULL == (new_layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, new_layout)) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy layout") /* Set new layout message directly into property list */ - *layout = new_layout; + *layout = *new_layout; done: + if(new_layout) + new_layout = H5FL_FREE(H5O_layout_t, new_layout); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dcrt_layout_copy() */ @@ -1917,21 +1945,14 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for - * generic property list. - * *------------------------------------------------------------------------- */ H5D_layout_t H5Pget_layout(hid_t plist_id) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t layout; /* Layout property */ - H5D_layout_t ret_value; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t *layout = NULL; /* Layout property */ + H5D_layout_t ret_value; /* Return value */ FUNC_ENTER_API(H5D_LAYOUT_ERROR) H5TRACE1("Dl", "i", plist_id); @@ -1941,13 +1962,18 @@ H5Pget_layout(hid_t plist_id) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5D_LAYOUT_ERROR, "can't find object for ID") /* Peek at layout property */ - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5D_LAYOUT_ERROR, "can't get memory for layout") + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5D_LAYOUT_ERROR, "can't get layout") /* Set return value */ - ret_value = layout.type; + ret_value = layout->type; done: + if(layout) + layout = H5FL_FREE(H5O_layout_t, layout); + FUNC_LEAVE_API(ret_value) } /* ed H5Pget_layout() */ @@ -1979,11 +2005,11 @@ done: herr_t H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t chunk_layout; /* Layout information for setting chunk info */ - uint64_t chunk_nelmts; /* Number of elements in chunk */ - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t *chunk_layout = NULL; /* Layout information for setting chunk info */ + uint64_t chunk_nelmts; /* Number of elements in chunk */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "iIs*[a1]h", plist_id, ndims, dim); @@ -2006,8 +2032,10 @@ H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]) #endif /* H5_HAVE_C99_DESIGNATED_INITIALIZER */ /* Verify & initialize property's chunk dims */ - HDmemcpy(&chunk_layout, &H5D_def_layout_chunk_g, sizeof(H5D_def_layout_chunk_g)); - HDmemset(&chunk_layout.u.chunk.dim, 0, sizeof(chunk_layout.u.chunk.dim)); + if(NULL == (chunk_layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + HDmemcpy(chunk_layout, &H5D_def_layout_chunk_g, sizeof(H5D_def_layout_chunk_g)); + HDmemset(chunk_layout->u.chunk.dim, 0, sizeof(chunk_layout->u.chunk.dim)); chunk_nelmts = 1; for(u = 0; u < (unsigned)ndims; u++) { if(dim[u] == 0) @@ -2017,7 +2045,7 @@ H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]) chunk_nelmts *= dim[u]; if(chunk_nelmts > (uint64_t)0xffffffff) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "number of elements in chunk must be < 4GB") - chunk_layout.u.chunk.dim[u] = (uint32_t)dim[u]; /* Store user's chunk dimensions */ + chunk_layout->u.chunk.dim[u] = (uint32_t)dim[u]; /* Store user's chunk dimensions */ } /* end for */ /* Get the plist structure */ @@ -2025,11 +2053,14 @@ H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Set chunk information in property list */ - chunk_layout.u.chunk.ndims = (unsigned)ndims; - if(H5P__set_layout(plist, &chunk_layout) < 0) + chunk_layout->u.chunk.ndims = (unsigned)ndims; + if(H5P__set_layout(plist, chunk_layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set layout") done: + if(chunk_layout) + chunk_layout = H5FL_FREE(H5O_layout_t, chunk_layout); + FUNC_LEAVE_API(ret_value) } /* end H5Pset_chunk() */ @@ -2061,9 +2092,9 @@ done: int H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t layout; /* Layout information */ - int ret_value; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t *layout = NULL; /* Layout information */ + int ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("Is", "iIsx", plist_id, max_ndims, dim); @@ -2073,23 +2104,28 @@ H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Peek at the layout property */ - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_CHUNKED != layout.type) + if(H5D_CHUNKED != layout->type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a chunked storage layout") if(dim) { unsigned u; /* Local index variable */ /* Get the dimension sizes */ - for(u = 0; u < layout.u.chunk.ndims && u < (unsigned)max_ndims; u++) - dim[u] = layout.u.chunk.dim[u]; + for(u = 0; u < layout->u.chunk.ndims && u < (unsigned)max_ndims; u++) + dim[u] = layout->u.chunk.dim[u]; } /* end if */ /* Set the return value */ - ret_value = (int)layout.u.chunk.ndims; + ret_value = (int)layout->u.chunk.ndims; done: + if(layout) + layout = H5FL_FREE(H5O_layout_t, layout); + FUNC_LEAVE_API(ret_value) } /* end H5Pget_chunk() */ @@ -2118,15 +2154,15 @@ herr_t H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, const char *src_dset_name, hid_t src_space_id) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t virtual_layout; /* Layout information for setting virtual info */ - H5S_t *vspace; /* Virtual dataset space selection */ - H5S_t *src_space; /* Source dataset space selection */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t *virtual_layout = NULL; /* Layout information for setting virtual info */ + H5S_t *vspace; /* Virtual dataset space selection */ + H5S_t *src_space; /* Source dataset space selection */ H5O_storage_virtual_ent_t *old_list = NULL; /* List pointer previously on property list */ - H5O_storage_virtual_ent_t *ent = NULL; /* Convenience pointer to new VDS entry */ - hbool_t retrieved_layout = FALSE; /* Whether the layout has been retrieved */ - hbool_t free_list = FALSE; /* Whether to free the list of virtual entries */ - herr_t ret_value = SUCCEED; /* Return value */ + H5O_storage_virtual_ent_t *ent = NULL; /* Convenience pointer to new VDS entry */ + hbool_t retrieved_layout = FALSE; /* Whether the layout has been retrieved */ + hbool_t free_list = FALSE; /* Whether to free the list of virtual entries */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "ii*s*si", dcpl_id, vspace_id, src_file_name, src_dset_name, @@ -2160,41 +2196,43 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Get the current layout */ - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &virtual_layout) < 0) + if(NULL == (virtual_layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for virtual layout") + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, virtual_layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get layout") retrieved_layout = TRUE; /* If the layout was not already virtual, Start with default virtual layout. * Otherwise, add the mapping to the current list. */ - if(virtual_layout.type == H5D_VIRTUAL) + if(virtual_layout->type == H5D_VIRTUAL) /* Save old list pointer for error recovery */ - old_list = virtual_layout.storage.u.virt.list; + old_list = virtual_layout->storage.u.virt.list; else { /* Reset the old layout */ - if(H5O_msg_reset(H5O_LAYOUT_ID, &virtual_layout) < 0) + if(H5O_msg_reset(H5O_LAYOUT_ID, virtual_layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTRESET, FAIL, "can't release layout message") /* Copy the default virtual layout */ - HDmemcpy(&virtual_layout, &H5D_def_layout_virtual_g, sizeof(H5D_def_layout_virtual_g)); + HDmemcpy(virtual_layout, &H5D_def_layout_virtual_g, sizeof(H5D_def_layout_virtual_g)); /* Sanity check */ - HDassert(virtual_layout.storage.u.virt.list_nalloc == 0); + HDassert(virtual_layout->storage.u.virt.list_nalloc == 0); } /* end else */ /* Expand list if necessary */ - if(virtual_layout.storage.u.virt.list_nused == virtual_layout.storage.u.virt.list_nalloc) { + if(virtual_layout->storage.u.virt.list_nused == virtual_layout->storage.u.virt.list_nalloc) { H5O_storage_virtual_ent_t *x; /* Pointer to the new list */ - size_t new_alloc = MAX(H5D_VIRTUAL_DEF_LIST_SIZE, virtual_layout.storage.u.virt.list_nalloc * 2); + size_t new_alloc = MAX(H5D_VIRTUAL_DEF_LIST_SIZE, virtual_layout->storage.u.virt.list_nalloc * 2); /* Expand size of entry list */ - if(NULL == (x = (H5O_storage_virtual_ent_t *)H5MM_realloc(virtual_layout.storage.u.virt.list, new_alloc * sizeof(H5O_storage_virtual_ent_t)))) + if(NULL == (x = (H5O_storage_virtual_ent_t *)H5MM_realloc(virtual_layout->storage.u.virt.list, new_alloc * sizeof(H5O_storage_virtual_ent_t)))) HGOTO_ERROR(H5E_PLIST, H5E_RESOURCE, FAIL, "can't reallocate virtual dataset mapping list") - virtual_layout.storage.u.virt.list = x; - virtual_layout.storage.u.virt.list_nalloc = new_alloc; + virtual_layout->storage.u.virt.list = x; + virtual_layout->storage.u.virt.list_nalloc = new_alloc; } /* end if */ /* Add virtual dataset mapping entry */ - ent = &virtual_layout.storage.u.virt.list[virtual_layout.storage.u.virt.list_nused]; + ent = &virtual_layout->storage.u.virt.list[virtual_layout->storage.u.virt.list_nused]; HDmemset(ent, 0, sizeof(H5O_storage_virtual_ent_t)); /* Clear before starting to set up */ if(NULL == (ent->source_dset.virtual_select = H5S_copy(vspace, FALSE, TRUE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy virtual selection") @@ -2236,19 +2274,19 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid mapping entry") /* Update min_dims */ - if(H5D_virtual_update_min_dims(&virtual_layout, virtual_layout.storage.u.virt.list_nused) < 0) + if(H5D_virtual_update_min_dims(virtual_layout, virtual_layout->storage.u.virt.list_nused) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to update virtual dataset minimum dimensions") /* Finish adding entry */ - virtual_layout.storage.u.virt.list_nused++; + virtual_layout->storage.u.virt.list_nused++; done: /* Set VDS layout information in property list */ /* (Even on faliure, so there's not a mangled layout struct in the list) */ if(retrieved_layout) { - if(H5P_poke(plist, H5D_CRT_LAYOUT_NAME, &virtual_layout) < 0) { + if(H5P_poke(plist, H5D_CRT_LAYOUT_NAME, virtual_layout) < 0) { HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set layout") - if(old_list != virtual_layout.storage.u.virt.list) + if(old_list != virtual_layout->storage.u.virt.list) free_list = TRUE; } /* end if */ } /* end if */ @@ -2274,9 +2312,12 @@ done: /* Free list if necessary */ if(free_list) - virtual_layout.storage.u.virt.list = (H5O_storage_virtual_ent_t *)H5MM_xfree(virtual_layout.storage.u.virt.list); + virtual_layout->storage.u.virt.list = (H5O_storage_virtual_ent_t *)H5MM_xfree(virtual_layout->storage.u.virt.list); } /* end if */ + if(virtual_layout) + virtual_layout = H5FL_FREE(H5O_layout_t, virtual_layout); + FUNC_LEAVE_API(ret_value) } /* end H5Pset_virtual() */ @@ -2298,9 +2339,9 @@ done: herr_t H5Pget_virtual_count(hid_t dcpl_id, size_t *count/*out*/) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t layout; /* Layout information */ - herr_t ret_value = SUCCEED; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t *layout = NULL; /* Layout information */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", dcpl_id, count); @@ -2311,16 +2352,21 @@ H5Pget_virtual_count(hid_t dcpl_id, size_t *count/*out*/) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_VIRTUAL != layout.type) + if(H5D_VIRTUAL != layout->type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") /* Return the number of mappings */ - *count = layout.storage.u.virt.list_nused; + *count = layout->storage.u.virt.list_nused; } /* end if */ done: + if(layout) + layout = H5FL_FREE(H5O_layout_t, layout); + FUNC_LEAVE_API(ret_value) } /* end H5Pget_virtual_count() */ @@ -2344,10 +2390,10 @@ done: hid_t H5Pget_virtual_vspace(hid_t dcpl_id, size_t index) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t layout; /* Layout information */ - H5S_t *space = NULL; /* Dataspace pointer */ - hid_t ret_value; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t *layout = NULL; /* Layout information */ + H5S_t *space = NULL; /* Dataspace pointer */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("i", "iz", dcpl_id, index); @@ -2357,16 +2403,18 @@ H5Pget_virtual_vspace(hid_t dcpl_id, size_t index) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_VIRTUAL != layout.type) + if(H5D_VIRTUAL != layout->type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") /* Get the virtual space */ - if(index >= layout.storage.u.virt.list_nused) + if(index >= layout->storage.u.virt.list_nused) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") - HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); - if(NULL == (space = H5S_copy(layout.storage.u.virt.list[index].source_dset.virtual_select, FALSE, TRUE))) + HDassert(layout->storage.u.virt.list_nused <= layout->storage.u.virt.list_nalloc); + if(NULL == (space = H5S_copy(layout->storage.u.virt.list[index].source_dset.virtual_select, FALSE, TRUE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy virtual selection") /* Register ID */ @@ -2379,6 +2427,9 @@ done: if(H5S_close(space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release source selection") + if(layout) + layout = H5FL_FREE(H5O_layout_t, layout); + FUNC_LEAVE_API(ret_value) } /* end H5Pget_virtual_vspace() */ @@ -2402,10 +2453,10 @@ done: hid_t H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t layout; /* Layout information */ - H5S_t *space = NULL; /* Dataspace pointer */ - hid_t ret_value = FAIL; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t *layout = NULL; /* Layout information */ + H5S_t *space = NULL; /* Dataspace pointer */ + hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("i", "iz", dcpl_id, index); @@ -2415,33 +2466,35 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_VIRTUAL != layout.type) + if(H5D_VIRTUAL != layout->type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") /* Check index */ - if(index >= layout.storage.u.virt.list_nused) + if(index >= layout->storage.u.virt.list_nused) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") - HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); + HDassert(layout->storage.u.virt.list_nused <= layout->storage.u.virt.list_nalloc); /* Attempt to open source dataset and patch extent if extent status is not * H5O_VIRTUAL_STATUS_CORRECT? -NAF */ /* If source space status is H5O_VIRTUAL_STATUS_INVALID, patch with bounds * of selection */ - if((H5O_VIRTUAL_STATUS_INVALID == layout.storage.u.virt.list[index].source_space_status) - && (layout.storage.u.virt.list[index].unlim_dim_source < 0)) { + if((H5O_VIRTUAL_STATUS_INVALID == layout->storage.u.virt.list[index].source_space_status) + && (layout->storage.u.virt.list[index].unlim_dim_source < 0)) { hsize_t bounds_start[H5S_MAX_RANK]; hsize_t bounds_end[H5S_MAX_RANK]; int rank; int i; /* Get rank of source space */ - if((rank = H5S_GET_EXTENT_NDIMS(layout.storage.u.virt.list[index].source_select)) < 0) + if((rank = H5S_GET_EXTENT_NDIMS(layout->storage.u.virt.list[index].source_select)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get source space rank") /* Get bounds of selection */ - if(H5S_SELECT_BOUNDS(layout.storage.u.virt.list[index].source_select, bounds_start, bounds_end) < 0) + if(H5S_SELECT_BOUNDS(layout->storage.u.virt.list[index].source_select, bounds_start, bounds_end) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get selection bounds") /* Adjust bounds to extent */ @@ -2449,15 +2502,15 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index) bounds_end[i]++; /* Set extent */ - if(H5S_set_extent_simple(layout.storage.u.virt.list[index].source_select, (unsigned)rank, bounds_end, NULL) < 0) + if(H5S_set_extent_simple(layout->storage.u.virt.list[index].source_select, (unsigned)rank, bounds_end, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set source space extent") /* Update source space status */ - layout.storage.u.virt.list[index].source_space_status = H5O_VIRTUAL_STATUS_SEL_BOUNDS; + layout->storage.u.virt.list[index].source_space_status = H5O_VIRTUAL_STATUS_SEL_BOUNDS; } /* end if */ /* Get the source space */ - if(NULL == (space = H5S_copy(layout.storage.u.virt.list[index].source_select, FALSE, TRUE))) + if(NULL == (space = H5S_copy(layout->storage.u.virt.list[index].source_select, FALSE, TRUE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy source selection") /* Register ID */ @@ -2470,6 +2523,9 @@ done: if(H5S_close(space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release source selection") + if(layout) + layout = H5FL_FREE(H5O_layout_t, layout); + FUNC_LEAVE_API(ret_value) } /* end H5Pget_virtual_srcspace() */ @@ -2508,7 +2564,7 @@ H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name/*out*/, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t layout; /* Layout information */ + H5O_layout_t *layout = NULL; /* Layout information */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2519,21 +2575,26 @@ H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name/*out*/, HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_VIRTUAL != layout.type) + if(H5D_VIRTUAL != layout->type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") /* Get the virtual filename */ - if(index >= layout.storage.u.virt.list_nused) + if(index >= layout->storage.u.virt.list_nused) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") - HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); - HDassert(layout.storage.u.virt.list[index].source_file_name); + HDassert(layout->storage.u.virt.list_nused <= layout->storage.u.virt.list_nalloc); + HDassert(layout->storage.u.virt.list[index].source_file_name); if(name && (size > 0)) - (void)HDstrncpy(name, layout.storage.u.virt.list[index].source_file_name, size); - ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[index].source_file_name); + (void)HDstrncpy(name, layout->storage.u.virt.list[index].source_file_name, size); + ret_value = (ssize_t)HDstrlen(layout->storage.u.virt.list[index].source_file_name); done: + if(layout) + layout = H5FL_FREE(H5O_layout_t, layout); + FUNC_LEAVE_API(ret_value) } /* end H5Pget_virtual_filename() */ @@ -2571,7 +2632,7 @@ H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name/*out*/, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t layout; /* Layout information */ + H5O_layout_t *layout = NULL; /* Layout information */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2582,21 +2643,26 @@ H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name/*out*/, HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_VIRTUAL != layout.type) + if(H5D_VIRTUAL != layout->type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") /* Get the virtual filename */ - if(index >= layout.storage.u.virt.list_nused) + if(index >= layout->storage.u.virt.list_nused) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") - HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); - HDassert(layout.storage.u.virt.list[index].source_dset_name); + HDassert(layout->storage.u.virt.list_nused <= layout->storage.u.virt.list_nalloc); + HDassert(layout->storage.u.virt.list[index].source_dset_name); if(name && (size > 0)) - (void)HDstrncpy(name, layout.storage.u.virt.list[index].source_dset_name, size); - ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[index].source_dset_name); + (void)HDstrncpy(name, layout->storage.u.virt.list[index].source_dset_name, size); + ret_value = (ssize_t)HDstrlen(layout->storage.u.virt.list[index].source_dset_name); done: + if(layout) + layout = H5FL_FREE(H5O_layout_t, layout); + FUNC_LEAVE_API(ret_value) } /* end H5Pget_virtual_dsetname() */ @@ -2618,7 +2684,7 @@ herr_t H5Pset_chunk_opts(hid_t plist_id, unsigned options) { H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t layout; /* Layout information for setting chunk info */ + H5O_layout_t *layout = NULL; /* Layout information for setting chunk info */ uint8_t layout_flags = 0; /* "options" translated into layout message flags format */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2643,9 +2709,11 @@ H5Pset_chunk_opts(hid_t plist_id, unsigned options) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_CHUNKED != layout.type) + if(H5D_CHUNKED != layout->type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a chunked storage layout") /* Translate options into flags that can be used with the layout message */ @@ -2655,15 +2723,18 @@ H5Pset_chunk_opts(hid_t plist_id, unsigned options) /* Update the layout message, including the version (if necessary) */ /* This probably isn't the right way to do this, and should be changed once * this branch gets the "real" way to set the layout version */ - layout.u.chunk.flags = layout_flags; - if(layout.version < H5O_LAYOUT_VERSION_4) - layout.version = H5O_LAYOUT_VERSION_4; + layout->u.chunk.flags = layout_flags; + if(layout->version < H5O_LAYOUT_VERSION_4) + layout->version = H5O_LAYOUT_VERSION_4; /* Set layout value */ - if(H5P_poke(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + if(H5P_poke(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set layout") done: + if(layout) + layout = H5FL_FREE(H5O_layout_t, layout); + FUNC_LEAVE_API(ret_value) } /* end H5Pset_chunk_opts() */ @@ -2683,8 +2754,8 @@ done: herr_t H5Pget_chunk_opts(hid_t plist_id, unsigned *options) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t layout; /* Layout information for setting chunk info */ + H5P_genplist_t *plist = NULL; /* Property list pointer */ + H5O_layout_t *layout = NULL; /* Layout information for getting chunk info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2704,20 +2775,25 @@ H5Pget_chunk_opts(hid_t plist_id, unsigned *options) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_CHUNKED != layout.type) + if(H5D_CHUNKED != layout->type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a chunked storage layout") if(options) { /* Translate options from flags that can be used with the layout message * to those known to the public */ *options = 0; - if(layout.u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) + if(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) *options |= H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS; } /* end if */ done: + if(layout) + layout = H5FL_FREE(H5O_layout_t, layout); + FUNC_LEAVE_API(ret_value) } /* end H5Pget_chunk_opts() */ @@ -3526,6 +3602,7 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) { H5P_genplist_t *plist; /* Property list pointer */ H5O_fill_t fill; /* Fill value property to modify */ + H5O_layout_t *layout = NULL; /* Type of storage layout */ unsigned alloc_time_state; /* State of allocation time property */ herr_t ret_value = SUCCEED; /* return value */ @@ -3538,18 +3615,19 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) /* Get the property list structure */ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Check for resetting to default for layout type */ if(alloc_time == H5D_ALLOC_TIME_DEFAULT) { - H5O_layout_t layout; /* Type of storage layout */ /* Peek at the storage layout */ - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) + if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get layout") /* Set the default based on layout */ - switch(layout.type) { + switch(layout->type) { case H5D_COMPACT: alloc_time = H5D_ALLOC_TIME_EARLY; break; @@ -3593,6 +3671,9 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set space allocation time") done: + if(layout) + layout = H5FL_FREE(H5O_layout_t, layout); + FUNC_LEAVE_API(ret_value) } /* H5Pset_alloc_time() */ diff --git a/src/H5Z.c b/src/H5Z.c index be8c0ed..f1fe8df 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -105,7 +105,7 @@ static H5Z_stats_t *H5Z_stat_table_g = NULL; #endif /* H5Z_DEBUG */ /* Declare a free list to manage the H5O_layout_t struct */ -H5FL_DEFINE_STATIC(H5O_layout_t); +H5FL_EXTERN(H5O_layout_t); -- cgit v0.12 From 1ccdb2e23f1c55835aee315e92736c6aed06faf8 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 9 Jun 2017 12:19:50 -0500 Subject: fixed check output string to match test --- fortran/test/tH5P_F03.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fortran/test/tH5P_F03.F90 b/fortran/test/tH5P_F03.F90 index 69d493b..b44540b 100644 --- a/fortran/test/tH5P_F03.F90 +++ b/fortran/test/tH5P_F03.F90 @@ -972,7 +972,7 @@ SUBROUTINE test_vds(total_error) ! Get source file name CALL H5Pget_virtual_filename_f(dcpl, INT(i-1, size_t), SRC_FILE_LEN_EXACT, error, nsize) - CALL check("H5Pget_virtual_count_f", error, total_error) + CALL check("H5Pget_virtual_filename_f", error, total_error) IF(nsize.NE.LEN(SRC_FILE_LEN_EXACT))THEN PRINT*,"virtual filenname size is incorrect" -- cgit v0.12 From 005bf26ff83fcd28255a77fb9bbb4a64495cb4a2 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 9 Jun 2017 18:09:08 -0400 Subject: Revert "Merge pull request #567 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:develop to develop" This reverts commit 4242753848c44ab3b5d226e66225eac2f64db314, reversing changes made to b0e79fe6dd20ec7aa1b3e5f0f8b370639a4ef5bd. --- src/H5Dchunk.c | 16 +-- src/H5Dearray.c | 16 +-- src/H5Dfarray.c | 14 +- src/H5Dint.c | 40 +++--- src/H5Doh.c | 46 +++---- src/H5Omessage.c | 10 +- src/H5Pdcpl.c | 409 ++++++++++++++++++++++--------------------------------- src/H5Z.c | 74 ++-------- 8 files changed, 230 insertions(+), 395 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 317039d..33fc036 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -368,9 +368,6 @@ H5FL_BLK_DEFINE_STATIC(chunk); /* Declare extern free list to manage the H5S_sel_iter_t struct */ H5FL_EXTERN(H5S_sel_iter_t); -/* Declare a free list to manage the H5O_layout_t struct */ -H5FL_EXTERN(H5O_layout_t); - /*------------------------------------------------------------------------- * Function: H5D__chunk_direct_write @@ -5446,7 +5443,7 @@ herr_t H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ - H5O_layout_t *layout = NULL; /* Dataset layout message */ + H5O_layout_t layout; /* Dataset layout message */ hbool_t layout_read = FALSE; /* Whether the layout message was read from the file */ H5O_pline_t pline; /* I/O pipeline message */ hbool_t pline_read = FALSE; /* Whether the I/O pipeline message was read from the file */ @@ -5477,9 +5474,7 @@ H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) if((exists = H5O_msg_exists_oh(oh, H5O_LAYOUT_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to check for object header message") else if(exists) { - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_LAYOUT_ID, layout)) + if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_LAYOUT_ID, &layout)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout message") layout_read = TRUE; } /* end else if */ @@ -5490,7 +5485,7 @@ H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) idx_info.f = f; idx_info.dxpl_id = dxpl_id; idx_info.pline = &pline; - idx_info.layout = &layout->u.chunk; + idx_info.layout = &layout.u.chunk; idx_info.storage = &storage->u.chunk; /* Delete the chunked storage information in the file */ @@ -5503,12 +5498,9 @@ done: if(H5O_msg_reset(H5O_PLINE_ID, &pline) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset I/O pipeline message") if(layout_read) - if(H5O_msg_reset(H5O_LAYOUT_ID, layout) < 0) + if(H5O_msg_reset(H5O_LAYOUT_ID, &layout) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout message") - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_delete() */ diff --git a/src/H5Dearray.c b/src/H5Dearray.c index a45d546..1df0a58 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -214,13 +214,10 @@ const H5EA_class_t H5EA_CLS_FILT_CHUNK[1]={{ /*******************/ /* Declare a free list to manage the H5D_earray_ctx_t struct */ -H5FL_DEFINE_STATIC(H5D_earray_ctx_t); - /* Declare a free list to manage the H5D_earray_ctx_ud_t struct */ +H5FL_DEFINE_STATIC(H5D_earray_ctx_t); H5FL_DEFINE_STATIC(H5D_earray_ctx_ud_t); -/* Declare a free list to manage the H5O_layout_t struct */ -H5FL_EXTERN(H5O_layout_t); /*------------------------------------------------------------------------- @@ -632,7 +629,7 @@ H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) H5D_earray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */ H5O_loc_t obj_loc; /* Pointer to an object's location */ hbool_t obj_opened = FALSE; /* Flag to indicate that the object header was opened */ - H5O_layout_t *layout = NULL; /* Layout message */ + H5O_layout_t layout; /* Layout message */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -656,9 +653,7 @@ H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) obj_opened = TRUE; /* Read the layout message */ - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't get memory for layout") - if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, layout, dxpl_id)) + if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout, dxpl_id)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info") /* close the object header */ @@ -667,7 +662,7 @@ H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) /* Create user data */ dbg_ctx->f = f; - dbg_ctx->chunk_size = layout->u.chunk.size; + dbg_ctx->chunk_size = layout.u.chunk.size; /* Set return value */ ret_value = dbg_ctx; @@ -686,9 +681,6 @@ done: } /* end if */ } /* end if */ - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__earray_crt_dbg_context() */ diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index 486fb54..d183a8c 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -217,9 +217,6 @@ H5FL_DEFINE_STATIC(H5D_farray_ctx_t); /* Declare a free list to manage the H5D_farray_ctx_ud_t struct */ H5FL_DEFINE_STATIC(H5D_farray_ctx_ud_t); -/* Declare a free list to manage the H5O_layout_t struct */ -H5FL_EXTERN(H5O_layout_t); - /*------------------------------------------------------------------------- * Function: H5D__farray_crt_context @@ -472,7 +469,7 @@ H5D__farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) H5D_farray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */ H5O_loc_t obj_loc; /* Pointer to an object's location */ hbool_t obj_opened = FALSE; /* Flag to indicate that the object header was opened */ - H5O_layout_t *layout = NULL; /* Layout message */ + H5O_layout_t layout; /* Layout message */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -496,9 +493,7 @@ H5D__farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) obj_opened = TRUE; /* Read the layout message */ - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't get memory for layout") - if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, layout, dxpl_id)) + if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout, dxpl_id)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info") /* close the object header */ @@ -507,7 +502,7 @@ H5D__farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) /* Create user data */ dbg_ctx->f = f; - dbg_ctx->chunk_size = layout->u.chunk.size; + dbg_ctx->chunk_size = layout.u.chunk.size; /* Set return value */ ret_value = dbg_ctx; @@ -526,9 +521,6 @@ done: } /* end if */ } /* end if */ - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__farray_crt_dbg_context() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index c13a7a1..08b3eb8 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -104,9 +104,6 @@ H5FL_EXTERN(H5D_chunk_info_t); /* Declare extern the free list to manage blocks of type conversion data */ H5FL_BLK_EXTERN(type_conv); -/* Declare a free list to manage the H5O_layout_t struct */ -H5FL_EXTERN(H5O_layout_t); - /* Define a static "default" dataset structure to use to initialize new datasets */ static H5D_shared_t H5D_def_dset; @@ -3305,7 +3302,7 @@ H5D_get_create_plist(H5D_t *dset) { H5P_genplist_t *dcpl_plist; /* Dataset's DCPL */ H5P_genplist_t *new_plist; /* Copy of dataset's DCPL */ - H5O_layout_t *copied_layout = NULL; /* Layout to tweak */ + H5O_layout_t copied_layout; /* Layout to tweak */ H5O_fill_t copied_fill; /* Fill value to tweak */ H5O_efl_t copied_efl; /* External file list to tweak */ hid_t new_dcpl_id = FAIL; @@ -3328,41 +3325,39 @@ H5D_get_create_plist(H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object creation info") /* Get the layout property */ - if(NULL == (copied_layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(H5P_peek(new_plist, H5D_CRT_LAYOUT_NAME, copied_layout) < 0) + if(H5P_peek(new_plist, H5D_CRT_LAYOUT_NAME, &copied_layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout") /* Reset layout values set when dataset is created */ - copied_layout->ops = NULL; - switch(copied_layout->type) { + copied_layout.ops = NULL; + switch(copied_layout.type) { case H5D_COMPACT: - copied_layout->storage.u.compact.buf = H5MM_xfree(copied_layout->storage.u.compact.buf); - HDmemset(&copied_layout->storage.u.compact, 0, sizeof(copied_layout->storage.u.compact)); + copied_layout.storage.u.compact.buf = H5MM_xfree(copied_layout.storage.u.compact.buf); + HDmemset(&copied_layout.storage.u.compact, 0, sizeof(copied_layout.storage.u.compact)); break; case H5D_CONTIGUOUS: - copied_layout->storage.u.contig.addr = HADDR_UNDEF; - copied_layout->storage.u.contig.size = 0; + copied_layout.storage.u.contig.addr = HADDR_UNDEF; + copied_layout.storage.u.contig.size = 0; break; case H5D_CHUNKED: /* Reset chunk size */ - copied_layout->u.chunk.size = 0; + copied_layout.u.chunk.size = 0; /* Reset index info, if the chunk ops are set */ - if(copied_layout->storage.u.chunk.ops) - /* Reset address and pointer of the array struct for the chunked storage index */ - if(H5D_chunk_idx_reset(&copied_layout->storage.u.chunk, TRUE) < 0) + if(copied_layout.storage.u.chunk.ops) + /* Reset address and pointer of the array struct for the chunked storage index */ + if(H5D_chunk_idx_reset(&copied_layout.storage.u.chunk, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to reset chunked storage index in dest") /* Reset chunk index ops */ - copied_layout->storage.u.chunk.ops = NULL; + copied_layout.storage.u.chunk.ops = NULL; break; case H5D_VIRTUAL: - copied_layout->storage.u.virt.serial_list_hobjid.addr = HADDR_UNDEF; - copied_layout->storage.u.virt.serial_list_hobjid.idx = 0; + copied_layout.storage.u.virt.serial_list_hobjid.addr = HADDR_UNDEF; + copied_layout.storage.u.virt.serial_list_hobjid.idx = 0; break; case H5D_LAYOUT_ERROR: @@ -3372,7 +3367,7 @@ H5D_get_create_plist(H5D_t *dset) } /* end switch */ /* Set back the (possibly modified) layout property to property list */ - if(H5P_poke(new_plist, H5D_CRT_LAYOUT_NAME, copied_layout) < 0) + if(H5P_poke(new_plist, H5D_CRT_LAYOUT_NAME, &copied_layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set layout") /* Get the fill value property */ @@ -3464,9 +3459,6 @@ done: if(H5I_dec_app_ref(new_dcpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to close temporary object") - if(copied_layout) - copied_layout = H5FL_FREE(H5O_layout_t, copied_layout); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_get_create_plist() */ diff --git a/src/H5Doh.c b/src/H5Doh.c index b371519..9abbdff 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -87,9 +87,6 @@ const H5O_obj_class_t H5O_OBJ_DATASET[1] = {{ /* Declare a free list to manage the H5D_copy_file_ud_t struct */ H5FL_DEFINE(H5D_copy_file_ud_t); -/* Declare a free list to manage the H5O_layout_t struct */ -H5FL_EXTERN(H5O_layout_t); - /*------------------------------------------------------------------------- * Function: H5O__dset_get_copy_file_udata @@ -362,12 +359,12 @@ done: static herr_t H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) { - H5O_layout_t *layout = NULL; /* Data storage layout message */ - H5O_efl_t efl; /* External File List message */ + H5O_layout_t layout; /* Data storage layout message */ + H5O_efl_t efl; /* External File List message */ hbool_t layout_read = FALSE; /* Whether the layout message was read */ hbool_t efl_read = FALSE; /* Whether the external file list message was read */ - htri_t exists; /* Flag if header message of interest exists */ - herr_t ret_value = SUCCEED; /* Return value */ + htri_t exists; /* Flag if header message of interest exists */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -379,24 +376,22 @@ H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * HDassert(bh_info); /* Get the layout message from the object header */ - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_LAYOUT_ID, layout)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find layout message") + if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_LAYOUT_ID, &layout)) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find layout message") layout_read = TRUE; /* Check for chunked dataset storage */ - if(layout->type == H5D_CHUNKED && H5D__chunk_is_space_alloc(&(layout->storage))) { + if(layout.type == H5D_CHUNKED && H5D__chunk_is_space_alloc(&layout.storage)) { /* Get size of chunk index */ - if(H5D__chunk_bh_info(loc, dxpl_id, oh, layout, &(bh_info->index_size)) < 0) + if(H5D__chunk_bh_info(loc, dxpl_id, oh, &layout, &(bh_info->index_size)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine chunked dataset btree info") } /* end if */ - else if(layout->type == H5D_VIRTUAL - && (layout->storage.u.virt.serial_list_hobjid.addr != HADDR_UNDEF)) { + else if(layout.type == H5D_VIRTUAL + && (layout.storage.u.virt.serial_list_hobjid.addr != HADDR_UNDEF)) { size_t virtual_heap_size; /* Get size of global heap object for virtual dataset */ - if(H5HG_get_obj_size(loc->file, dxpl_id, &(layout->storage.u.virt.serial_list_hobjid), &virtual_heap_size) < 0) + if(H5HG_get_obj_size(loc->file, dxpl_id, &(layout.storage.u.virt.serial_list_hobjid), &virtual_heap_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get global heap size for virtual dataset mapping") /* Return heap size */ @@ -405,32 +400,29 @@ H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * /* Check for External File List message in the object header */ if((exists = H5O_msg_exists_oh(oh, H5O_EFL_ID)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for EFL message") + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for EFL message") - if(exists && H5D__efl_is_space_alloc(&(layout->storage))) { + if(exists && H5D__efl_is_space_alloc(&layout.storage)) { /* Start with clean EFL info */ HDmemset(&efl, 0, sizeof(efl)); - /* Get External File List message from the object header */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_EFL_ID, &efl)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find EFL message") + /* Get External File List message from the object header */ + if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_EFL_ID, &efl)) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find EFL message") efl_read = TRUE; - /* Get size of local heap for EFL message's file list */ - if(H5D__efl_bh_info(loc->file, dxpl_id, &efl, &(bh_info->heap_size)) < 0) + /* Get size of local heap for EFL message's file list */ + if(H5D__efl_bh_info(loc->file, dxpl_id, &efl, &(bh_info->heap_size)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine EFL heap info") } /* end if */ done: /* Free messages, if they've been read in */ - if(layout_read && H5O_msg_reset(H5O_LAYOUT_ID, layout) < 0) + if(layout_read && H5O_msg_reset(H5O_LAYOUT_ID, &layout) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset data storage layout message") if(efl_read && H5O_msg_reset(H5O_EFL_ID, &efl) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset external file list message") - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__dset_bh_info() */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 90c2b23..158701b 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -732,12 +732,12 @@ H5O_msg_free_real(const H5O_msg_class_t *type, void *msg_native) /*------------------------------------------------------------------------- * Function: H5O_msg_copy * - * Purpose: Copies a message. If MESG is is the null pointer then a null - * pointer is returned with no error. + * Purpose: Copies a message. If MESG is is the null pointer then a null + * pointer is returned with no error. * - * Return: Success: Ptr to the new message + * Return: Success: Ptr to the new message * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Thursday, May 21, 1998 @@ -748,7 +748,7 @@ void * H5O_msg_copy(unsigned type_id, const void *mesg, void *dst) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - void *ret_value = NULL; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index ea4a05a..3b4c159 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -200,8 +200,6 @@ const H5P_libclass_t H5P_CLS_DCRT[1] = {{ /* Declare extern the free list to manage blocks of type conversion data */ H5FL_BLK_EXTERN(type_conv); -/* Declare a free list to manage the H5O_layout_t struct */ -H5FL_EXTERN(H5O_layout_t); /***************************/ /* Local Private Variables */ @@ -294,7 +292,7 @@ H5P__dcrt_layout_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *na size_t H5_ATTR_UNUSED size, void *value) { H5O_layout_t *layout = (H5O_layout_t *)value; /* Create local aliases for values */ - H5O_layout_t *new_layout = NULL; + H5O_layout_t new_layout; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -303,18 +301,13 @@ H5P__dcrt_layout_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *na HDassert(value); /* Make copy of layout */ - if(NULL == (new_layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, new_layout)) + if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, &new_layout)) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy layout") /* Copy new layout message over old one */ - *layout = *new_layout; + *layout = new_layout; done: - if(new_layout) - new_layout = H5FL_FREE(H5O_layout_t, new_layout); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dcrt_layout_set() */ @@ -337,7 +330,7 @@ H5P__dcrt_layout_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *na size_t H5_ATTR_UNUSED size, void *value) { H5O_layout_t *layout = (H5O_layout_t *)value; /* Create local aliases for values */ - H5O_layout_t *new_layout = NULL; + H5O_layout_t new_layout; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -346,18 +339,13 @@ H5P__dcrt_layout_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *na HDassert(value); /* Make copy of layout */ - if(NULL == (new_layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, new_layout)) + if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, &new_layout)) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy layout") /* Copy new layout message over old one */ - *layout = *new_layout; + *layout = new_layout; done: - if(new_layout) - new_layout = H5FL_FREE(H5O_layout_t, new_layout); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dcrt_layout_get() */ @@ -516,7 +504,7 @@ static herr_t H5P__dcrt_layout_dec(const void **_pp, void *value) { const H5O_layout_t *layout; /* Storage layout */ - H5O_layout_t *tmp_layout = NULL; /* Temporary local layout structure */ + H5O_layout_t tmp_layout; /* Temporary local layout structure */ H5D_layout_t type; /* Layout type */ const uint8_t **pp = (const uint8_t **)_pp; herr_t ret_value = SUCCEED; /* Return value */ @@ -555,20 +543,16 @@ H5P__dcrt_layout_dec(const void **_pp, void *value) else { /* chunk layout structure is encoded*/ unsigned u; /* Local index variable */ - /* Allocate temporary layout */ - if(NULL == (tmp_layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for temp layout") - /* Initialize to default values */ - *tmp_layout = H5D_def_layout_chunk_g; + tmp_layout = H5D_def_layout_chunk_g; /* Set rank & dimensions */ - tmp_layout->u.chunk.ndims = (unsigned)ndims; + tmp_layout.u.chunk.ndims = (unsigned)ndims; for(u = 0; u < ndims; u++) - UINT32DECODE(*pp, tmp_layout->u.chunk.dim[u]) + UINT32DECODE(*pp, tmp_layout.u.chunk.dim[u]) /* Point at the newly set up struct */ - layout = tmp_layout; + layout = &tmp_layout; } /* end else */ } break; @@ -587,86 +571,82 @@ H5P__dcrt_layout_dec(const void **_pp, void *value) size_t tmp_size; size_t u; /* Local index variable */ - /* Allocate temporary layout */ - if(NULL == (tmp_layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for temp layout") - /* Initialize to default values */ - *tmp_layout = H5D_def_layout_virtual_g; + tmp_layout = H5D_def_layout_virtual_g; /* Allocate entry list */ - if(NULL == (tmp_layout->storage.u.virt.list = (H5O_storage_virtual_ent_t *)H5MM_calloc((size_t)nentries * sizeof(H5O_storage_virtual_ent_t)))) + if(NULL == (tmp_layout.storage.u.virt.list = (H5O_storage_virtual_ent_t *)H5MM_calloc((size_t)nentries * sizeof(H5O_storage_virtual_ent_t)))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate heap block") - tmp_layout->storage.u.virt.list_nalloc = (size_t)nentries; - tmp_layout->storage.u.virt.list_nused = (size_t)nentries; + tmp_layout.storage.u.virt.list_nalloc = (size_t)nentries; + tmp_layout.storage.u.virt.list_nused = (size_t)nentries; /* Decode each entry */ for(u = 0; u < (size_t)nentries; u++) { /* Source file name */ tmp_size = HDstrlen((const char *)*pp) + 1; - if(NULL == (tmp_layout->storage.u.virt.list[u].source_file_name = (char *)H5MM_malloc(tmp_size))) + if(NULL == (tmp_layout.storage.u.virt.list[u].source_file_name = (char *)H5MM_malloc(tmp_size))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate memory for source file name") - (void)HDmemcpy(tmp_layout->storage.u.virt.list[u].source_file_name, *pp, tmp_size); + (void)HDmemcpy(tmp_layout.storage.u.virt.list[u].source_file_name, *pp, tmp_size); *pp += tmp_size; /* Source dataset name */ tmp_size = HDstrlen((const char *)*pp) + 1; - if(NULL == (tmp_layout->storage.u.virt.list[u].source_dset_name = (char *)H5MM_malloc(tmp_size))) + if(NULL == (tmp_layout.storage.u.virt.list[u].source_dset_name = (char *)H5MM_malloc(tmp_size))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate memory for source dataset name") - (void)HDmemcpy(tmp_layout->storage.u.virt.list[u].source_dset_name, *pp, tmp_size); + (void)HDmemcpy(tmp_layout.storage.u.virt.list[u].source_dset_name, *pp, tmp_size); *pp += tmp_size; /* Source selection */ - if(NULL == (tmp_layout->storage.u.virt.list[u].source_select = H5S_decode(pp))) + if(NULL == (tmp_layout.storage.u.virt.list[u].source_select = H5S_decode(pp))) HGOTO_ERROR(H5E_PLIST, H5E_CANTDECODE, FAIL, "can't decode source space selection") - tmp_layout->storage.u.virt.list[u].source_space_status = H5O_VIRTUAL_STATUS_USER; + tmp_layout.storage.u.virt.list[u].source_space_status = H5O_VIRTUAL_STATUS_USER; /* Virtual selection */ - if(NULL == (tmp_layout->storage.u.virt.list[u].source_dset.virtual_select = H5S_decode(pp))) + if(NULL == (tmp_layout.storage.u.virt.list[u].source_dset.virtual_select = H5S_decode(pp))) HGOTO_ERROR(H5E_PLIST, H5E_CANTDECODE, FAIL, "can't decode virtual space selection") - tmp_layout->storage.u.virt.list[u].virtual_space_status = H5O_VIRTUAL_STATUS_USER; + tmp_layout.storage.u.virt.list[u].virtual_space_status = H5O_VIRTUAL_STATUS_USER; /* Parse source file and dataset names for "printf" * style format specifiers */ - if(H5D_virtual_parse_source_name(tmp_layout->storage.u.virt.list[u].source_file_name, &tmp_layout->storage.u.virt.list[u].parsed_source_file_name, &tmp_layout->storage.u.virt.list[u].psfn_static_strlen, &tmp_layout->storage.u.virt.list[u].psfn_nsubs) < 0) + if(H5D_virtual_parse_source_name(tmp_layout.storage.u.virt.list[u].source_file_name, &tmp_layout.storage.u.virt.list[u].parsed_source_file_name, &tmp_layout.storage.u.virt.list[u].psfn_static_strlen, &tmp_layout.storage.u.virt.list[u].psfn_nsubs) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't parse source file name") - if(H5D_virtual_parse_source_name(tmp_layout->storage.u.virt.list[u].source_dset_name, &tmp_layout->storage.u.virt.list[u].parsed_source_dset_name, &tmp_layout->storage.u.virt.list[u].psdn_static_strlen, &tmp_layout->storage.u.virt.list[u].psdn_nsubs) < 0) + if(H5D_virtual_parse_source_name(tmp_layout.storage.u.virt.list[u].source_dset_name, &tmp_layout.storage.u.virt.list[u].parsed_source_dset_name, &tmp_layout.storage.u.virt.list[u].psdn_static_strlen, &tmp_layout.storage.u.virt.list[u].psdn_nsubs) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't parse source dataset name") /* Set source names in source_dset struct */ - if((tmp_layout->storage.u.virt.list[u].psfn_nsubs == 0) - && (tmp_layout->storage.u.virt.list[u].psdn_nsubs == 0)) { - if(tmp_layout->storage.u.virt.list[u].parsed_source_file_name) - tmp_layout->storage.u.virt.list[u].source_dset.file_name = tmp_layout->storage.u.virt.list[u].parsed_source_file_name->name_segment; + if((tmp_layout.storage.u.virt.list[u].psfn_nsubs == 0) + && (tmp_layout.storage.u.virt.list[u].psdn_nsubs == 0)) { + if(tmp_layout.storage.u.virt.list[u].parsed_source_file_name) + tmp_layout.storage.u.virt.list[u].source_dset.file_name = tmp_layout.storage.u.virt.list[u].parsed_source_file_name->name_segment; else - tmp_layout->storage.u.virt.list[u].source_dset.file_name = tmp_layout->storage.u.virt.list[u].source_file_name; - if(tmp_layout->storage.u.virt.list[u].parsed_source_dset_name) - tmp_layout->storage.u.virt.list[u].source_dset.dset_name = tmp_layout->storage.u.virt.list[u].parsed_source_dset_name->name_segment; + tmp_layout.storage.u.virt.list[u].source_dset.file_name = tmp_layout.storage.u.virt.list[u].source_file_name; + if(tmp_layout.storage.u.virt.list[u].parsed_source_dset_name) + tmp_layout.storage.u.virt.list[u].source_dset.dset_name = tmp_layout.storage.u.virt.list[u].parsed_source_dset_name->name_segment; else - tmp_layout->storage.u.virt.list[u].source_dset.dset_name = tmp_layout->storage.u.virt.list[u].source_dset_name; + tmp_layout.storage.u.virt.list[u].source_dset.dset_name = tmp_layout.storage.u.virt.list[u].source_dset_name; } /* end if */ /* unlim_dim fields */ - tmp_layout->storage.u.virt.list[u].unlim_dim_source = H5S_get_select_unlim_dim(tmp_layout->storage.u.virt.list[u].source_select); - tmp_layout->storage.u.virt.list[u].unlim_dim_virtual = H5S_get_select_unlim_dim(tmp_layout->storage.u.virt.list[u].source_dset.virtual_select); - tmp_layout->storage.u.virt.list[u].unlim_extent_source = HSIZE_UNDEF; - tmp_layout->storage.u.virt.list[u].unlim_extent_virtual = HSIZE_UNDEF; - tmp_layout->storage.u.virt.list[u].clip_size_source = HSIZE_UNDEF; - tmp_layout->storage.u.virt.list[u].clip_size_virtual = HSIZE_UNDEF; + tmp_layout.storage.u.virt.list[u].unlim_dim_source = H5S_get_select_unlim_dim(tmp_layout.storage.u.virt.list[u].source_select); + tmp_layout.storage.u.virt.list[u].unlim_dim_virtual = H5S_get_select_unlim_dim(tmp_layout.storage.u.virt.list[u].source_dset.virtual_select); + tmp_layout.storage.u.virt.list[u].unlim_extent_source = HSIZE_UNDEF; + tmp_layout.storage.u.virt.list[u].unlim_extent_virtual = HSIZE_UNDEF; + tmp_layout.storage.u.virt.list[u].clip_size_source = HSIZE_UNDEF; + tmp_layout.storage.u.virt.list[u].clip_size_virtual = HSIZE_UNDEF; /* Clipped selections */ - if(tmp_layout->storage.u.virt.list[u].unlim_dim_virtual < 0) { - tmp_layout->storage.u.virt.list[u].source_dset.clipped_source_select = tmp_layout->storage.u.virt.list[u].source_select; - tmp_layout->storage.u.virt.list[u].source_dset.clipped_virtual_select = tmp_layout->storage.u.virt.list[u].source_dset.virtual_select; + if(tmp_layout.storage.u.virt.list[u].unlim_dim_virtual < 0) { + tmp_layout.storage.u.virt.list[u].source_dset.clipped_source_select = tmp_layout.storage.u.virt.list[u].source_select; + tmp_layout.storage.u.virt.list[u].source_dset.clipped_virtual_select = tmp_layout.storage.u.virt.list[u].source_dset.virtual_select; } /* end if */ /* Update min_dims */ - if(H5D_virtual_update_min_dims(tmp_layout, u) < 0) + if(H5D_virtual_update_min_dims(&tmp_layout, u) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to update virtual dataset minimum dimensions") } /* end for */ /* Point at the newly set up struct */ - layout = tmp_layout; + layout = &tmp_layout; } /* end else */ } /* end block */ break; @@ -681,9 +661,6 @@ H5P__dcrt_layout_dec(const void **_pp, void *value) HDmemcpy(value, layout, sizeof(H5O_layout_t)); done: - if(tmp_layout) - tmp_layout = H5FL_FREE(H5O_layout_t, tmp_layout); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dcrt_layout_dec() */ @@ -739,7 +716,7 @@ H5P__dcrt_layout_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED siz void *value) { H5O_layout_t *layout = (H5O_layout_t *)value; /* Create local aliases for values */ - H5O_layout_t *new_layout = NULL; + H5O_layout_t new_layout; herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -747,18 +724,13 @@ H5P__dcrt_layout_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED siz HDassert(layout); /* Make copy of layout */ - if(NULL == (new_layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, new_layout)) + if(NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, &new_layout)) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy layout") /* Set new layout message directly into property list */ - *layout = *new_layout; + *layout = new_layout; done: - if(new_layout) - new_layout = H5FL_FREE(H5O_layout_t, new_layout); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dcrt_layout_copy() */ @@ -1945,14 +1917,21 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * + * Modifications: + * + * Raymond Lu + * Tuesday, October 2, 2001 + * Changed the way to check parameter and get property for + * generic property list. + * *------------------------------------------------------------------------- */ H5D_layout_t H5Pget_layout(hid_t plist_id) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t *layout = NULL; /* Layout property */ - H5D_layout_t ret_value; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t layout; /* Layout property */ + H5D_layout_t ret_value; /* Return value */ FUNC_ENTER_API(H5D_LAYOUT_ERROR) H5TRACE1("Dl", "i", plist_id); @@ -1962,18 +1941,13 @@ H5Pget_layout(hid_t plist_id) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5D_LAYOUT_ERROR, "can't find object for ID") /* Peek at layout property */ - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5D_LAYOUT_ERROR, "can't get memory for layout") - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5D_LAYOUT_ERROR, "can't get layout") /* Set return value */ - ret_value = layout->type; + ret_value = layout.type; done: - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_API(ret_value) } /* ed H5Pget_layout() */ @@ -2005,11 +1979,11 @@ done: herr_t H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t *chunk_layout = NULL; /* Layout information for setting chunk info */ - uint64_t chunk_nelmts; /* Number of elements in chunk */ - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t chunk_layout; /* Layout information for setting chunk info */ + uint64_t chunk_nelmts; /* Number of elements in chunk */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "iIs*[a1]h", plist_id, ndims, dim); @@ -2032,10 +2006,8 @@ H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]) #endif /* H5_HAVE_C99_DESIGNATED_INITIALIZER */ /* Verify & initialize property's chunk dims */ - if(NULL == (chunk_layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - HDmemcpy(chunk_layout, &H5D_def_layout_chunk_g, sizeof(H5D_def_layout_chunk_g)); - HDmemset(chunk_layout->u.chunk.dim, 0, sizeof(chunk_layout->u.chunk.dim)); + HDmemcpy(&chunk_layout, &H5D_def_layout_chunk_g, sizeof(H5D_def_layout_chunk_g)); + HDmemset(&chunk_layout.u.chunk.dim, 0, sizeof(chunk_layout.u.chunk.dim)); chunk_nelmts = 1; for(u = 0; u < (unsigned)ndims; u++) { if(dim[u] == 0) @@ -2045,7 +2017,7 @@ H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]) chunk_nelmts *= dim[u]; if(chunk_nelmts > (uint64_t)0xffffffff) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "number of elements in chunk must be < 4GB") - chunk_layout->u.chunk.dim[u] = (uint32_t)dim[u]; /* Store user's chunk dimensions */ + chunk_layout.u.chunk.dim[u] = (uint32_t)dim[u]; /* Store user's chunk dimensions */ } /* end for */ /* Get the plist structure */ @@ -2053,14 +2025,11 @@ H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Set chunk information in property list */ - chunk_layout->u.chunk.ndims = (unsigned)ndims; - if(H5P__set_layout(plist, chunk_layout) < 0) + chunk_layout.u.chunk.ndims = (unsigned)ndims; + if(H5P__set_layout(plist, &chunk_layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set layout") done: - if(chunk_layout) - chunk_layout = H5FL_FREE(H5O_layout_t, chunk_layout); - FUNC_LEAVE_API(ret_value) } /* end H5Pset_chunk() */ @@ -2092,9 +2061,9 @@ done: int H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t *layout = NULL; /* Layout information */ - int ret_value; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t layout; /* Layout information */ + int ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("Is", "iIsx", plist_id, max_ndims, dim); @@ -2104,28 +2073,23 @@ H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Peek at the layout property */ - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_CHUNKED != layout->type) + if(H5D_CHUNKED != layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a chunked storage layout") if(dim) { unsigned u; /* Local index variable */ /* Get the dimension sizes */ - for(u = 0; u < layout->u.chunk.ndims && u < (unsigned)max_ndims; u++) - dim[u] = layout->u.chunk.dim[u]; + for(u = 0; u < layout.u.chunk.ndims && u < (unsigned)max_ndims; u++) + dim[u] = layout.u.chunk.dim[u]; } /* end if */ /* Set the return value */ - ret_value = (int)layout->u.chunk.ndims; + ret_value = (int)layout.u.chunk.ndims; done: - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_API(ret_value) } /* end H5Pget_chunk() */ @@ -2154,15 +2118,15 @@ herr_t H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, const char *src_dset_name, hid_t src_space_id) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t *virtual_layout = NULL; /* Layout information for setting virtual info */ - H5S_t *vspace; /* Virtual dataset space selection */ - H5S_t *src_space; /* Source dataset space selection */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t virtual_layout; /* Layout information for setting virtual info */ + H5S_t *vspace; /* Virtual dataset space selection */ + H5S_t *src_space; /* Source dataset space selection */ H5O_storage_virtual_ent_t *old_list = NULL; /* List pointer previously on property list */ - H5O_storage_virtual_ent_t *ent = NULL; /* Convenience pointer to new VDS entry */ - hbool_t retrieved_layout = FALSE; /* Whether the layout has been retrieved */ - hbool_t free_list = FALSE; /* Whether to free the list of virtual entries */ - herr_t ret_value = SUCCEED; /* Return value */ + H5O_storage_virtual_ent_t *ent = NULL; /* Convenience pointer to new VDS entry */ + hbool_t retrieved_layout = FALSE; /* Whether the layout has been retrieved */ + hbool_t free_list = FALSE; /* Whether to free the list of virtual entries */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "ii*s*si", dcpl_id, vspace_id, src_file_name, src_dset_name, @@ -2196,43 +2160,41 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Get the current layout */ - if(NULL == (virtual_layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for virtual layout") - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, virtual_layout) < 0) + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &virtual_layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get layout") retrieved_layout = TRUE; /* If the layout was not already virtual, Start with default virtual layout. * Otherwise, add the mapping to the current list. */ - if(virtual_layout->type == H5D_VIRTUAL) + if(virtual_layout.type == H5D_VIRTUAL) /* Save old list pointer for error recovery */ - old_list = virtual_layout->storage.u.virt.list; + old_list = virtual_layout.storage.u.virt.list; else { /* Reset the old layout */ - if(H5O_msg_reset(H5O_LAYOUT_ID, virtual_layout) < 0) + if(H5O_msg_reset(H5O_LAYOUT_ID, &virtual_layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTRESET, FAIL, "can't release layout message") /* Copy the default virtual layout */ - HDmemcpy(virtual_layout, &H5D_def_layout_virtual_g, sizeof(H5D_def_layout_virtual_g)); + HDmemcpy(&virtual_layout, &H5D_def_layout_virtual_g, sizeof(H5D_def_layout_virtual_g)); /* Sanity check */ - HDassert(virtual_layout->storage.u.virt.list_nalloc == 0); + HDassert(virtual_layout.storage.u.virt.list_nalloc == 0); } /* end else */ /* Expand list if necessary */ - if(virtual_layout->storage.u.virt.list_nused == virtual_layout->storage.u.virt.list_nalloc) { + if(virtual_layout.storage.u.virt.list_nused == virtual_layout.storage.u.virt.list_nalloc) { H5O_storage_virtual_ent_t *x; /* Pointer to the new list */ - size_t new_alloc = MAX(H5D_VIRTUAL_DEF_LIST_SIZE, virtual_layout->storage.u.virt.list_nalloc * 2); + size_t new_alloc = MAX(H5D_VIRTUAL_DEF_LIST_SIZE, virtual_layout.storage.u.virt.list_nalloc * 2); /* Expand size of entry list */ - if(NULL == (x = (H5O_storage_virtual_ent_t *)H5MM_realloc(virtual_layout->storage.u.virt.list, new_alloc * sizeof(H5O_storage_virtual_ent_t)))) + if(NULL == (x = (H5O_storage_virtual_ent_t *)H5MM_realloc(virtual_layout.storage.u.virt.list, new_alloc * sizeof(H5O_storage_virtual_ent_t)))) HGOTO_ERROR(H5E_PLIST, H5E_RESOURCE, FAIL, "can't reallocate virtual dataset mapping list") - virtual_layout->storage.u.virt.list = x; - virtual_layout->storage.u.virt.list_nalloc = new_alloc; + virtual_layout.storage.u.virt.list = x; + virtual_layout.storage.u.virt.list_nalloc = new_alloc; } /* end if */ /* Add virtual dataset mapping entry */ - ent = &virtual_layout->storage.u.virt.list[virtual_layout->storage.u.virt.list_nused]; + ent = &virtual_layout.storage.u.virt.list[virtual_layout.storage.u.virt.list_nused]; HDmemset(ent, 0, sizeof(H5O_storage_virtual_ent_t)); /* Clear before starting to set up */ if(NULL == (ent->source_dset.virtual_select = H5S_copy(vspace, FALSE, TRUE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy virtual selection") @@ -2274,19 +2236,19 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid mapping entry") /* Update min_dims */ - if(H5D_virtual_update_min_dims(virtual_layout, virtual_layout->storage.u.virt.list_nused) < 0) + if(H5D_virtual_update_min_dims(&virtual_layout, virtual_layout.storage.u.virt.list_nused) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to update virtual dataset minimum dimensions") /* Finish adding entry */ - virtual_layout->storage.u.virt.list_nused++; + virtual_layout.storage.u.virt.list_nused++; done: /* Set VDS layout information in property list */ /* (Even on faliure, so there's not a mangled layout struct in the list) */ if(retrieved_layout) { - if(H5P_poke(plist, H5D_CRT_LAYOUT_NAME, virtual_layout) < 0) { + if(H5P_poke(plist, H5D_CRT_LAYOUT_NAME, &virtual_layout) < 0) { HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set layout") - if(old_list != virtual_layout->storage.u.virt.list) + if(old_list != virtual_layout.storage.u.virt.list) free_list = TRUE; } /* end if */ } /* end if */ @@ -2312,12 +2274,9 @@ done: /* Free list if necessary */ if(free_list) - virtual_layout->storage.u.virt.list = (H5O_storage_virtual_ent_t *)H5MM_xfree(virtual_layout->storage.u.virt.list); + virtual_layout.storage.u.virt.list = (H5O_storage_virtual_ent_t *)H5MM_xfree(virtual_layout.storage.u.virt.list); } /* end if */ - if(virtual_layout) - virtual_layout = H5FL_FREE(H5O_layout_t, virtual_layout); - FUNC_LEAVE_API(ret_value) } /* end H5Pset_virtual() */ @@ -2339,9 +2298,9 @@ done: herr_t H5Pget_virtual_count(hid_t dcpl_id, size_t *count/*out*/) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t *layout = NULL; /* Layout information */ - herr_t ret_value = SUCCEED; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t layout; /* Layout information */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", dcpl_id, count); @@ -2352,21 +2311,16 @@ H5Pget_virtual_count(hid_t dcpl_id, size_t *count/*out*/) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_VIRTUAL != layout->type) + if(H5D_VIRTUAL != layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") /* Return the number of mappings */ - *count = layout->storage.u.virt.list_nused; + *count = layout.storage.u.virt.list_nused; } /* end if */ done: - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_API(ret_value) } /* end H5Pget_virtual_count() */ @@ -2390,10 +2344,10 @@ done: hid_t H5Pget_virtual_vspace(hid_t dcpl_id, size_t index) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t *layout = NULL; /* Layout information */ - H5S_t *space = NULL; /* Dataspace pointer */ - hid_t ret_value; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t layout; /* Layout information */ + H5S_t *space = NULL; /* Dataspace pointer */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("i", "iz", dcpl_id, index); @@ -2403,18 +2357,16 @@ H5Pget_virtual_vspace(hid_t dcpl_id, size_t index) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_VIRTUAL != layout->type) + if(H5D_VIRTUAL != layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") /* Get the virtual space */ - if(index >= layout->storage.u.virt.list_nused) + if(index >= layout.storage.u.virt.list_nused) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") - HDassert(layout->storage.u.virt.list_nused <= layout->storage.u.virt.list_nalloc); - if(NULL == (space = H5S_copy(layout->storage.u.virt.list[index].source_dset.virtual_select, FALSE, TRUE))) + HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); + if(NULL == (space = H5S_copy(layout.storage.u.virt.list[index].source_dset.virtual_select, FALSE, TRUE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy virtual selection") /* Register ID */ @@ -2427,9 +2379,6 @@ done: if(H5S_close(space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release source selection") - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_API(ret_value) } /* end H5Pget_virtual_vspace() */ @@ -2453,10 +2402,10 @@ done: hid_t H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index) { - H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t *layout = NULL; /* Layout information */ - H5S_t *space = NULL; /* Dataspace pointer */ - hid_t ret_value = FAIL; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t layout; /* Layout information */ + H5S_t *space = NULL; /* Dataspace pointer */ + hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("i", "iz", dcpl_id, index); @@ -2466,35 +2415,33 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_VIRTUAL != layout->type) + if(H5D_VIRTUAL != layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") /* Check index */ - if(index >= layout->storage.u.virt.list_nused) + if(index >= layout.storage.u.virt.list_nused) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") - HDassert(layout->storage.u.virt.list_nused <= layout->storage.u.virt.list_nalloc); + HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); /* Attempt to open source dataset and patch extent if extent status is not * H5O_VIRTUAL_STATUS_CORRECT? -NAF */ /* If source space status is H5O_VIRTUAL_STATUS_INVALID, patch with bounds * of selection */ - if((H5O_VIRTUAL_STATUS_INVALID == layout->storage.u.virt.list[index].source_space_status) - && (layout->storage.u.virt.list[index].unlim_dim_source < 0)) { + if((H5O_VIRTUAL_STATUS_INVALID == layout.storage.u.virt.list[index].source_space_status) + && (layout.storage.u.virt.list[index].unlim_dim_source < 0)) { hsize_t bounds_start[H5S_MAX_RANK]; hsize_t bounds_end[H5S_MAX_RANK]; int rank; int i; /* Get rank of source space */ - if((rank = H5S_GET_EXTENT_NDIMS(layout->storage.u.virt.list[index].source_select)) < 0) + if((rank = H5S_GET_EXTENT_NDIMS(layout.storage.u.virt.list[index].source_select)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get source space rank") /* Get bounds of selection */ - if(H5S_SELECT_BOUNDS(layout->storage.u.virt.list[index].source_select, bounds_start, bounds_end) < 0) + if(H5S_SELECT_BOUNDS(layout.storage.u.virt.list[index].source_select, bounds_start, bounds_end) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get selection bounds") /* Adjust bounds to extent */ @@ -2502,15 +2449,15 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index) bounds_end[i]++; /* Set extent */ - if(H5S_set_extent_simple(layout->storage.u.virt.list[index].source_select, (unsigned)rank, bounds_end, NULL) < 0) + if(H5S_set_extent_simple(layout.storage.u.virt.list[index].source_select, (unsigned)rank, bounds_end, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set source space extent") /* Update source space status */ - layout->storage.u.virt.list[index].source_space_status = H5O_VIRTUAL_STATUS_SEL_BOUNDS; + layout.storage.u.virt.list[index].source_space_status = H5O_VIRTUAL_STATUS_SEL_BOUNDS; } /* end if */ /* Get the source space */ - if(NULL == (space = H5S_copy(layout->storage.u.virt.list[index].source_select, FALSE, TRUE))) + if(NULL == (space = H5S_copy(layout.storage.u.virt.list[index].source_select, FALSE, TRUE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy source selection") /* Register ID */ @@ -2523,9 +2470,6 @@ done: if(H5S_close(space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release source selection") - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_API(ret_value) } /* end H5Pget_virtual_srcspace() */ @@ -2564,7 +2508,7 @@ H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name/*out*/, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t *layout = NULL; /* Layout information */ + H5O_layout_t layout; /* Layout information */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2575,26 +2519,21 @@ H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name/*out*/, HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_VIRTUAL != layout->type) + if(H5D_VIRTUAL != layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") /* Get the virtual filename */ - if(index >= layout->storage.u.virt.list_nused) + if(index >= layout.storage.u.virt.list_nused) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") - HDassert(layout->storage.u.virt.list_nused <= layout->storage.u.virt.list_nalloc); - HDassert(layout->storage.u.virt.list[index].source_file_name); + HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); + HDassert(layout.storage.u.virt.list[index].source_file_name); if(name && (size > 0)) - (void)HDstrncpy(name, layout->storage.u.virt.list[index].source_file_name, size); - ret_value = (ssize_t)HDstrlen(layout->storage.u.virt.list[index].source_file_name); + (void)HDstrncpy(name, layout.storage.u.virt.list[index].source_file_name, size); + ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[index].source_file_name); done: - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_API(ret_value) } /* end H5Pget_virtual_filename() */ @@ -2632,7 +2571,7 @@ H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name/*out*/, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t *layout = NULL; /* Layout information */ + H5O_layout_t layout; /* Layout information */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2643,26 +2582,21 @@ H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name/*out*/, HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_VIRTUAL != layout->type) + if(H5D_VIRTUAL != layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") /* Get the virtual filename */ - if(index >= layout->storage.u.virt.list_nused) + if(index >= layout.storage.u.virt.list_nused) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") - HDassert(layout->storage.u.virt.list_nused <= layout->storage.u.virt.list_nalloc); - HDassert(layout->storage.u.virt.list[index].source_dset_name); + HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); + HDassert(layout.storage.u.virt.list[index].source_dset_name); if(name && (size > 0)) - (void)HDstrncpy(name, layout->storage.u.virt.list[index].source_dset_name, size); - ret_value = (ssize_t)HDstrlen(layout->storage.u.virt.list[index].source_dset_name); + (void)HDstrncpy(name, layout.storage.u.virt.list[index].source_dset_name, size); + ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[index].source_dset_name); done: - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_API(ret_value) } /* end H5Pget_virtual_dsetname() */ @@ -2684,7 +2618,7 @@ herr_t H5Pset_chunk_opts(hid_t plist_id, unsigned options) { H5P_genplist_t *plist; /* Property list pointer */ - H5O_layout_t *layout = NULL; /* Layout information for setting chunk info */ + H5O_layout_t layout; /* Layout information for setting chunk info */ uint8_t layout_flags = 0; /* "options" translated into layout message flags format */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2709,11 +2643,9 @@ H5Pset_chunk_opts(hid_t plist_id, unsigned options) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_CHUNKED != layout->type) + if(H5D_CHUNKED != layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a chunked storage layout") /* Translate options into flags that can be used with the layout message */ @@ -2723,18 +2655,15 @@ H5Pset_chunk_opts(hid_t plist_id, unsigned options) /* Update the layout message, including the version (if necessary) */ /* This probably isn't the right way to do this, and should be changed once * this branch gets the "real" way to set the layout version */ - layout->u.chunk.flags = layout_flags; - if(layout->version < H5O_LAYOUT_VERSION_4) - layout->version = H5O_LAYOUT_VERSION_4; + layout.u.chunk.flags = layout_flags; + if(layout.version < H5O_LAYOUT_VERSION_4) + layout.version = H5O_LAYOUT_VERSION_4; /* Set layout value */ - if(H5P_poke(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) + if(H5P_poke(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set layout") done: - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_API(ret_value) } /* end H5Pset_chunk_opts() */ @@ -2754,8 +2683,8 @@ done: herr_t H5Pget_chunk_opts(hid_t plist_id, unsigned *options) { - H5P_genplist_t *plist = NULL; /* Property list pointer */ - H5O_layout_t *layout = NULL; /* Layout information for getting chunk info */ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_layout_t layout; /* Layout information for setting chunk info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2775,25 +2704,20 @@ H5Pget_chunk_opts(hid_t plist_id, unsigned *options) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Retrieve the layout property */ - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout") - if(H5D_CHUNKED != layout->type) + if(H5D_CHUNKED != layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a chunked storage layout") if(options) { /* Translate options from flags that can be used with the layout message * to those known to the public */ *options = 0; - if(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) + if(layout.u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) *options |= H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS; } /* end if */ done: - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_API(ret_value) } /* end H5Pget_chunk_opts() */ @@ -3602,7 +3526,6 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) { H5P_genplist_t *plist; /* Property list pointer */ H5O_fill_t fill; /* Fill value property to modify */ - H5O_layout_t *layout = NULL; /* Type of storage layout */ unsigned alloc_time_state; /* State of allocation time property */ herr_t ret_value = SUCCEED; /* return value */ @@ -3615,19 +3538,18 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) /* Get the property list structure */ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Check for resetting to default for layout type */ if(alloc_time == H5D_ALLOC_TIME_DEFAULT) { + H5O_layout_t layout; /* Type of storage layout */ /* Peek at the storage layout */ - if(NULL == (layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") - if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, layout) < 0) + if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get layout") /* Set the default based on layout */ - switch(layout->type) { + switch(layout.type) { case H5D_COMPACT: alloc_time = H5D_ALLOC_TIME_EARLY; break; @@ -3671,9 +3593,6 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set space allocation time") done: - if(layout) - layout = H5FL_FREE(H5O_layout_t, layout); - FUNC_LEAVE_API(ret_value) } /* H5Pset_alloc_time() */ diff --git a/src/H5Z.c b/src/H5Z.c index f1fe8df..ef34d7c 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -11,21 +11,13 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/****************/ -/* Module Setup */ -/****************/ - #include "H5Zmodule.h" /* This source code file is part of the H5Z module */ -/***********/ -/* Headers */ -/***********/ #include "H5private.h" /* Generic Functions */ #include "H5Dprivate.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File */ -#include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ @@ -38,16 +30,7 @@ # include "szlib.h" #endif - -/****************/ -/* Local Macros */ -/****************/ - - -/******************/ -/* Local Typedefs */ -/******************/ - +/* Local typedefs */ #ifdef H5Z_DEBUG typedef struct H5Z_stats_t { struct { @@ -72,41 +55,19 @@ typedef enum { /* Package initialization variable */ hbool_t H5_PKG_INIT_VAR = FALSE; - -/********************/ -/* Local Prototypes */ -/********************/ -static int H5Z_find_idx(H5Z_filter_t id); -static int H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t obj_id, void *key); -static int H5Z__check_unregister_group_cb(void *obj_ptr, hid_t obj_id, void *key); -static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key); - - -/*********************/ -/* Package Variables */ -/*********************/ - - -/*****************************/ -/* Library Private Variables */ -/*****************************/ - - -/*******************/ -/* Local Variables */ -/*******************/ - +/* Local variables */ static size_t H5Z_table_alloc_g = 0; static size_t H5Z_table_used_g = 0; static H5Z_class2_t *H5Z_table_g = NULL; - #ifdef H5Z_DEBUG static H5Z_stats_t *H5Z_stat_table_g = NULL; #endif /* H5Z_DEBUG */ -/* Declare a free list to manage the H5O_layout_t struct */ -H5FL_EXTERN(H5O_layout_t); - +/* Local functions */ +static int H5Z_find_idx(H5Z_filter_t id); +static int H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t obj_id, void *key); +static int H5Z__check_unregister_group_cb(void *obj_ptr, hid_t obj_id, void *key); +static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key); /*------------------------------------------------------------------------- @@ -850,9 +811,8 @@ done: static herr_t H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) { - hid_t space_id = -1; /* ID for dataspace describing chunk */ - H5O_layout_t *dcpl_layout = NULL; /* Dataset's layout information */ - herr_t ret_value = SUCCEED; /* Return value */ + hid_t space_id = -1; /* ID for dataspace describing chunk */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -862,20 +822,18 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type /* Check if the property list is non-default */ if(dcpl_id != H5P_DATASET_CREATE_DEFAULT) { H5P_genplist_t *dc_plist; /* Dataset creation property list object */ - - if(NULL == (dcpl_layout = H5FL_CALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout") + H5O_layout_t dcpl_layout; /* Dataset's layout information */ /* Get dataset creation property list object */ if(NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") /* Peek at the layout information */ - if(H5P_peek(dc_plist, H5D_CRT_LAYOUT_NAME, dcpl_layout) < 0) + if(H5P_peek(dc_plist, H5D_CRT_LAYOUT_NAME, &dcpl_layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve layout") /* Check if the dataset is chunked */ - if(H5D_CHUNKED == dcpl_layout->type) { + if(H5D_CHUNKED == dcpl_layout.type) { H5O_pline_t dcpl_pline; /* Object's I/O pipeline information */ /* Get I/O pipeline information */ @@ -889,9 +847,9 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type size_t u; /* Local index variable */ /* Create a data space for a chunk & set the extent */ - for(u = 0; u < dcpl_layout->u.chunk.ndims; u++) - chunk_dims[u] = dcpl_layout->u.chunk.dim[u]; - if(NULL == (space = H5S_create_simple(dcpl_layout->u.chunk.ndims, chunk_dims, NULL))) + for(u = 0; u < dcpl_layout.u.chunk.ndims; u++) + chunk_dims[u] = dcpl_layout.u.chunk.dim[u]; + if(NULL == (space = H5S_create_simple(dcpl_layout.u.chunk.ndims, chunk_dims, NULL))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Get ID for dataspace to pass to filter routines */ @@ -910,8 +868,6 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type done: if(space_id > 0 && H5I_dec_ref(space_id) < 0) HDONE_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") - if(dcpl_layout) - dcpl_layout = H5FL_FREE(H5O_layout_t, dcpl_layout); FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_prepare_prelude_callback_dcpl() */ -- cgit v0.12 From 980d5b4266133490192ceb10ea13e320532c6f03 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Sat, 10 Jun 2017 19:40:19 -0500 Subject: Fix for HDFFV-7853 H5Ocopy doesn't work with open identifiers Changes made so that raw data for dataset objects are copied from cached info when possible instead of flushing objects to file and read them back in again. --- src/H5Dchunk.c | 147 ++++++++++---- src/H5Dcompact.c | 8 +- src/H5Dcontig.c | 55 ++++-- src/H5Ocopy.c | 32 +-- src/H5Oprivate.h | 1 + test/objcopy.c | 592 ++++++++++++++++++++++++++++++++++++++++++++----------- 6 files changed, 630 insertions(+), 205 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 33fc036..d693466 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -188,6 +188,10 @@ typedef struct H5D_chunk_it_ud3_t { /* needed for copy object pointed by refs */ H5O_copy_t *cpy_info; /* Copy options */ + + /* needed for getting raw data from chunk cache */ + hbool_t chunk_in_cache; + uint8_t *chunk; /* the unfiltered chunk data */ } H5D_chunk_it_ud3_t; /* Callback info for iteration to dump index */ @@ -2280,8 +2284,8 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, void *chunk = NULL; /* Pointer to locked chunk buffer */ htri_t cacheable; /* Whether the chunk is cacheable */ - /* Set chunk's [scaled] coordinates */ - io_info->store->chunk.scaled = chunk_info->scaled; + /* Set chunk's [scaled] coordinates */ + io_info->store->chunk.scaled = chunk_info->scaled; /* Determine if we should use the chunk cache */ if((cacheable = H5D__chunk_cacheable(io_info, udata.chunk_block.offset, FALSE)) < 0) @@ -2796,7 +2800,7 @@ H5D__chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *uda /* Retrieve the information from the cache */ udata->chunk_block.offset = last->addr; udata->chunk_block.length = last->nbytes; - udata->chunk_idx = last->chunk_idx; + udata->chunk_idx = last->chunk_idx; udata->filter_mask = last->filter_mask; /* Indicate that the data was found */ @@ -3065,19 +3069,19 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t buf = ent->chunk; if(ent->dirty) { - H5D_chk_idx_info_t idx_info; /* Chunked index info */ + H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_chunk_ud_t udata; /* pass through B-tree */ hbool_t must_alloc = FALSE; /* Whether the chunk must be allocated */ - hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ + hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ /* Set up user data for index callbacks */ udata.common.layout = &dset->shared->layout.u.chunk; udata.common.storage = &dset->shared->layout.storage.u.chunk; - udata.common.scaled = ent->scaled; + udata.common.scaled = ent->scaled; udata.chunk_block.offset = ent->chunk_block.offset; udata.chunk_block.length = dset->shared->layout.u.chunk.size; udata.filter_mask = 0; - udata.chunk_idx = ent->chunk_idx; + udata.chunk_idx = ent->chunk_idx; /* Should the chunk be filtered before writing it to disk? */ if(dset->shared->dcpl_cache.pline.nused @@ -3155,8 +3159,8 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t /* Create the chunk it if it doesn't exist, or reallocate the chunk * if its size changed. */ - if(H5D__chunk_file_alloc(&idx_info, &(ent->chunk_block), &udata.chunk_block, &need_insert, ent->scaled) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk on chunk level") + if(H5D__chunk_file_alloc(&idx_info, &(ent->chunk_block), &udata.chunk_block, &need_insert, ent->scaled) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk on chunk level") /* Update the chunk entry's info, in case it was allocated or relocated */ ent->chunk_block.offset = udata.chunk_block.offset; @@ -3170,7 +3174,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data to file") /* Insert the chunk record into the index */ - if(need_insert && dset->shared->layout.storage.u.chunk.ops->insert) + if(need_insert && dset->shared->layout.storage.u.chunk.ops->insert) if((dset->shared->layout.storage.u.chunk.ops->insert)(&idx_info, &udata, dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk addr into index") @@ -3644,7 +3648,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, chunk_addr, my_chunk_alloc, io_info->raw_dxpl_id, chunk) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "unable to read raw data chunk") - if(old_pline && old_pline->nused) { + if(old_pline && old_pline->nused) { if(H5Z_pipeline(old_pline, H5Z_FLAG_REVERSE, &(udata->filter_mask), io_info->dxpl_cache->err_detect, @@ -3733,14 +3737,14 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, if(NULL == (ent = H5FL_CALLOC(H5D_rdcc_ent_t))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't allocate raw data chunk entry") - ent->edge_chunk_state = disable_filters ? H5D_RDCC_DISABLE_FILTERS : 0; - if(udata->new_unfilt_chunk) - ent->edge_chunk_state |= H5D_RDCC_NEWLY_DISABLED_FILTERS; + ent->edge_chunk_state = disable_filters ? H5D_RDCC_DISABLE_FILTERS : 0; + if(udata->new_unfilt_chunk) + ent->edge_chunk_state |= H5D_RDCC_NEWLY_DISABLED_FILTERS; /* Initialize the new entry */ ent->chunk_block.offset = chunk_addr; ent->chunk_block.length = chunk_alloc; - ent->chunk_idx = udata->chunk_idx; + ent->chunk_idx = udata->chunk_idx; HDmemcpy(ent->scaled, udata->common.scaled, sizeof(hsize_t) * layout->u.chunk.ndims); H5_CHECKED_ASSIGN(ent->rd_count, uint32_t, chunk_size, size_t); H5_CHECKED_ASSIGN(ent->wr_count, uint32_t, chunk_size, size_t); @@ -3761,8 +3765,8 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, } /* end if */ else rdcc->head = rdcc->tail = ent; - ent->tmp_next = NULL; - ent->tmp_prev = NULL; + ent->tmp_next = NULL; + ent->tmp_prev = NULL; } /* end if */ else @@ -5658,11 +5662,22 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5Z_cb_t cb_struct; /* Filter failure callback struct */ int ret_value = H5_ITER_CONT; /* Return value */ + FUNC_ENTER_STATIC /* Get 'size_t' local value for number of bytes in chunk */ H5_CHECKED_ASSIGN(nbytes, size_t, chunk_rec->nbytes, uint32_t); + /* Check for filtered chunks */ + /* Check for an edge chunk that is not filtered */ + if(pline && pline->nused) { + must_filter = TRUE; + if( (udata->common.layout->flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) && + (H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, udata->common.layout->dim, + chunk_rec->scaled, udata->dset_dims)) ) + must_filter = FALSE; + } + /* Check parameter for type conversion */ if(udata->do_convert) { if(H5T_detect_class(udata->dt_src, H5T_VLEN, FALSE) > 0) @@ -5673,19 +5688,6 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy dataset elements") } /* end if */ - /* Check for filtered chunks */ - if((is_vlen || fix_ref) && pline && pline->nused) { - /* Check if we should disable filters on this chunk */ - if(udata->common.layout->flags - & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) { - /* Check if the chunk is an edge chunk, and disable filters if so */ - if(!H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, udata->common.layout->dim, chunk_rec->scaled, udata->dset_dims)) - must_filter = TRUE; - } /* end if */ - else - must_filter = TRUE; - } /* end if */ - /* Resize the buf if it is too small to hold the data */ if(nbytes > buf_size) { void *new_buf; /* New buffer for data */ @@ -5708,12 +5710,51 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) udata->buf_size = buf_size = nbytes; } /* end if */ - /* read chunk data from the source file */ - if(H5F_block_read(udata->file_src, H5FD_MEM_DRAW, chunk_rec->chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") + if(udata->chunk_in_cache && udata->chunk) { + HDassert(!H5F_addr_defined(chunk_rec->chunk_addr)); + HDmemcpy(buf, udata->chunk, nbytes); + udata->chunk = NULL; + } else { + H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ + unsigned idx; /* Index of chunk in cache, if present */ + unsigned u; /* Counter */ + H5D_shared_t *shared_fo = udata->cpy_info->shared_fo; + + /* See if the written chunk is in the chunk cache */ + if(shared_fo && shared_fo->cache.chunk.nslots > 0) { + /* Determine the chunk's location in the hash table */ + idx = H5D__chunk_hash_val(shared_fo, chunk_rec->scaled); + + /* Get the chunk cache entry for that location */ + ent = shared_fo->cache.chunk.slot[idx]; + if(ent) { + /* Speculatively set the 'found' flag */ + udata->chunk_in_cache = TRUE; + + /* Verify that the cache entry is the correct chunk */ + for(u = 0; u < shared_fo->ndims; u++) + if(chunk_rec->scaled[u] != ent->scaled[u]) { + udata->chunk_in_cache = FALSE; + break; + } /* end if */ + } /* end if */ + } /* end if */ + + if(udata->chunk_in_cache) { + HDassert(H5F_addr_defined(chunk_rec->chunk_addr)); + HDassert(H5F_addr_defined(ent->chunk_block.offset)); + + H5_CHECKED_ASSIGN(nbytes, size_t, shared_fo->layout.u.chunk.size, uint32_t); + HDmemcpy(buf, ent->chunk, nbytes); + } else { + /* read chunk data from the source file */ + if(H5F_block_read(udata->file_src, H5FD_MEM_DRAW, chunk_rec->chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") + } + } - /* Need to uncompress variable-length & reference data elements */ - if(must_filter) { + /* Need to uncompress filtered variable-length & reference data elements that are not found in chunk cache */ + if(must_filter && (is_vlen || fix_ref) && !udata->chunk_in_cache) { unsigned filter_mask = chunk_rec->filter_mask; cb_struct.func = NULL; /* no callback function when failed */ @@ -5777,8 +5818,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) udata_dst.chunk_block.length = chunk_rec->nbytes; udata_dst.filter_mask = chunk_rec->filter_mask; - /* Need to compress variable-length & reference data elements before writing to file */ - if(must_filter) { + /* Need to compress variable-length or reference data elements or a chunk found in cache before writing to file */ + if(must_filter && (is_vlen || fix_ref || udata->chunk_in_cache) ) { if(H5Z_pipeline(pline, 0, &(udata_dst.filter_mask), H5Z_NO_EDC, cb_struct, &nbytes, &buf_size, &buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 @@ -5787,12 +5828,14 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, H5_ITER_ERROR, "chunk too large for 32-bit length") #endif /* H5_SIZEOF_SIZE_T > 4 */ H5_CHECKED_ASSIGN(udata_dst.chunk_block.length, uint32_t, nbytes, size_t); - udata->buf = buf; - udata->buf_size = buf_size; + udata->buf = buf; + udata->buf_size = buf_size; } /* end if */ + udata->chunk_in_cache = FALSE; + udata_dst.chunk_idx = H5VM_array_offset_pre(udata_dst.common.layout->ndims - 1, - udata_dst.common.layout->max_down_chunks, udata_dst.common.scaled); + udata_dst.common.layout->max_down_chunks, udata_dst.common.scaled); /* Allocate chunk in the file */ if(H5D__chunk_file_alloc(udata->idx_info_dst, NULL, &udata_dst.chunk_block, &need_insert, udata_dst.common.scaled) < 0) @@ -6047,11 +6090,35 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, udata.dset_ndims = (unsigned)sndims; udata.dset_dims = curr_dims; udata.cpy_info = cpy_info; + udata.chunk_in_cache = FALSE; + udata.chunk = NULL; /* Iterate over chunks to copy data */ if((storage_src->ops->iterate)(&idx_info_src, H5D__chunk_copy_cb, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk index to copy data") + /* Iterate over the chunk cache to copy data for chunks with undefined address */ + if(udata.cpy_info->shared_fo) { + H5D_rdcc_ent_t *ent, *next; + H5D_chunk_rec_t chunk_rec; + H5D_shared_t *shared_fo = (H5D_shared_t *)udata.cpy_info->shared_fo; + + chunk_rec.nbytes = layout_src->size; + chunk_rec.filter_mask = 0; + chunk_rec.chunk_addr = HADDR_UNDEF; + + for(ent = shared_fo->cache.chunk.head; ent; ent = next) { + if(!H5F_addr_defined(ent->chunk_block.offset)) { + HDmemcpy(chunk_rec.scaled, ent->scaled, sizeof(chunk_rec.scaled)); + udata.chunk = ent->chunk; + udata.chunk_in_cache = TRUE; + if(H5D__chunk_copy_cb(&chunk_rec, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy chunk data in cache") + } + next = ent->next; + } /* end for */ + } + /* I/O buffers may have been re-allocated */ buf = udata.buf; bkg = udata.bkg; diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 99a25b6..041d28f 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -420,7 +420,7 @@ H5D__compact_dest(H5D_t *dset, hid_t H5_ATTR_UNUSED dxpl_id) *------------------------------------------------------------------------- */ herr_t -H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst, +H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_dst, H5O_storage_compact_t *storage_dst, H5T_t *dt_src, H5O_copy_t *cpy_info, hid_t dxpl_id) { @@ -431,6 +431,8 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst void *bkg = NULL; /* Temporary buffer for copying data */ void *reclaim_buf = NULL; /* Buffer for reclaiming data */ hid_t buf_sid = -1; /* ID for buffer dataspace */ + H5D_shared_t *shared_fo = cpy_info->shared_fo; /* Pointer to the shared struct for dataset object */ + H5O_storage_compact_t *storage_src = _storage_src; /* Pointer to storage_src */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -443,6 +445,10 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst HDassert(storage_dst->buf); HDassert(dt_src); + /* If the dataset is open in the file, point to "layout" in the shared struct */ + if(shared_fo != NULL) + storage_src = &(shared_fo->layout.storage.u.compact); + /* Create datatype ID for src datatype, so it gets freed */ if((tid_src = H5I_register(H5I_DATATYPE, dt_src, FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register source file datatype") diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 0ee4d28..86de017 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -31,17 +31,18 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Dpkg.h" /* Dataset functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* Files */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MFprivate.h" /* File memory management */ -#include "H5Oprivate.h" /* Object headers */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5VMprivate.h" /* Vector and array functions */ +#include "H5private.h" /* Generic Functions */ +#include "H5Dpkg.h" /* Dataset functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* Files */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MFprivate.h" /* File memory management */ +#include "H5FOprivate.h" /* File objects */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5VMprivate.h" /* Vector and array functions */ /****************/ @@ -1362,6 +1363,10 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, hsize_t buf_dim[1] = {0}; /* Dimension for buffer */ hbool_t is_vlen = FALSE; /* Flag to indicate that VL type conversion should occur */ hbool_t fix_ref = FALSE; /* Flag to indicate that ref values should be fixed */ + H5D_shared_t *shared_fo = cpy_info->shared_fo; /* Pointer to the shared struct for dataset object */ + hbool_t try_sieve = FALSE; /* Try to get data from the sieve buffer */ + haddr_t sieve_start = HADDR_UNDEF; /* Start location of sieve buffer */ + haddr_t sieve_end = HADDR_UNDEF; /* End locations of sieve buffer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1485,6 +1490,16 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, /* Loop over copying data */ addr_src = storage_src->addr; addr_dst = storage_dst->addr; + + /* If data sieving is enabled and the dataset is open in the file, + set up to copy data out of the sieve buffer if deemed possible later */ + if(H5F_HAS_FEATURE(f_src, H5FD_FEAT_DATA_SIEVE) && + shared_fo && shared_fo->cache.contig.sieve_buf) { + try_sieve = TRUE; + sieve_start = shared_fo->cache.contig.sieve_loc; + sieve_end = sieve_start + shared_fo->cache.contig.sieve_size; + } + while(total_src_nbytes > 0) { /* Check if we should reduce the number of bytes to transfer */ if(total_src_nbytes < src_nbytes) { @@ -1510,14 +1525,20 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, dst_nbytes = mem_nbytes = src_nbytes; } /* end if */ - /* Read raw data from source file - use raw dxpl because passed in one is metadata */ - if(H5F_block_read(f_src, H5FD_MEM_DRAW, addr_src, src_nbytes, H5AC_rawdata_dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to read raw data") + /* If the entire copy is within the sieve buffer, copy data from the sieve buffer */ + if(try_sieve && (addr_src >= sieve_start) && ((addr_src + src_nbytes -1) < sieve_end)) { + unsigned char *base_sieve_buf = shared_fo->cache.contig.sieve_buf + (addr_src - sieve_start); + + HDmemcpy(buf, base_sieve_buf, src_nbytes); + } else + /* Read raw data from source file - use raw dxpl because passed in one is metadata */ + if(H5F_block_read(f_src, H5FD_MEM_DRAW, addr_src, src_nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to read raw data") /* Perform datatype conversion, if necessary */ if(is_vlen) { /* Convert from source file to memory */ - if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Copy into another buffer, to reclaim memory later */ @@ -1527,13 +1548,13 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, HDmemset(bkg, 0, buf_size); /* Convert from memory to destination file */ - if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Reclaim space from variable length data */ if(H5D_vlen_reclaim(tid_mem, buf_space, dxpl_id, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to reclaim variable-length data") - } /* end if */ + } /* end if */ else if(fix_ref) { /* Check for expanding references */ if(cpy_info->expand_ref) { diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 597af63..aa2a9e0 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -347,36 +347,8 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, if(NULL == (obj_class = H5O_obj_class(oloc_src, dxpl_id))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") - /* Check if the object at the address is already open in the file */ - if(H5FO_opened(oloc_src->file, oloc_src->addr) != NULL) { - H5G_loc_t tmp_loc; /* Location of object */ - H5O_loc_t tmp_oloc; /* Location of object */ - H5G_name_t tmp_path; /* Object's path */ - void *obj_ptr = NULL; /* Object pointer */ - hid_t tmp_id = -1; /* Object ID */ - - tmp_loc.oloc = &tmp_oloc; - tmp_loc.path = &tmp_path; - tmp_oloc.file = oloc_src->file; - tmp_oloc.addr = oloc_src->addr; - tmp_oloc.holding_file = FALSE; - H5G_name_reset(tmp_loc.path); - - /* Get a temporary ID */ - if((tmp_id = obj_class->open(&tmp_loc, H5P_DEFAULT, dxpl_id, FALSE)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to open object") - - /* Get object pointer */ - obj_ptr = H5I_object(tmp_id); - - /* Flush the object */ - if(obj_class->flush && obj_class->flush(obj_ptr, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object") - - /* Release the temporary ID */ - if(tmp_id != -1 && H5I_dec_app_ref(tmp_id)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to close temporary ID") - } /* end if */ + /* Set the pointer to the shared struct for the object if opened in the file */ + cpy_info->shared_fo = H5FO_opened(oloc_src->file, oloc_src->addr); /* Get source object header */ if(NULL == (oh_src = H5O_protect(oloc_src, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 0f798b2..563f8fa 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -174,6 +174,7 @@ typedef struct H5O_copy_t { H5SL_t *dst_dt_list; /* Skip list to hold committed datatypes in dest file */ hbool_t dst_dt_list_complete; /* Whether the destination datatype list is complete (i.e. not only populated with "suggestions" from H5Padd_merge_committed_dtype_path) */ H5O_t *oh_dst; /* The destination object header */ + void *shared_fo; /* The shared pointer for the object */ H5O_mcdt_search_cb_t mcdt_cb; /* The callback to invoke before searching the global list of committed datatypes at destination */ void *mcdt_ud; /* User data passed to callback */ } H5O_copy_t; diff --git a/test/objcopy.c b/test/objcopy.c index b7f5673..216d111 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -2200,6 +2200,9 @@ error: * Purpose: Create a simple dataset in SRC file and copy it to DST file * (Note: dataset has no data) * + * Note: The parameter "test_open" is added to test for H5Ocopy when + * the dataset is open in the file (HDFFV-7853). + * * Return: Success: 0 * Failure: number of errors * @@ -2209,7 +2212,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) +test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, hbool_t test_open) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -2218,7 +2221,11 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; - TESTING("H5Ocopy(): empty contiguous dataset"); + if(test_open) { + TESTING("H5Ocopy(): empty and openend contiguous dataset"); + } else { + TESTING("H5Ocopy(): empty contiguous dataset"); + } /* Initialize the filenames */ h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); @@ -2246,15 +2253,18 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h /* attach attributes to the dataset */ if(test_copy_attach_attributes(did, H5T_NATIVE_INT) < 0) TEST_ERROR - /* close the dataset */ - if(H5Dclose(did) < 0) TEST_ERROR + if(!test_open) { - /* close the SRC file */ - if(H5Fclose(fid_src) < 0) TEST_ERROR + /* close the dataset */ + if(H5Dclose(did) < 0) TEST_ERROR + /* close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR - /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR + /* open the source file with read-only */ + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR + + } /* create destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR @@ -2265,8 +2275,10 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h /* copy the dataset from SRC to DST */ if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR - /* open the dataset for copy */ - if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if(!test_open) { + /* open the dataset for copy */ + if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + } /* open the destination dataset */ if((did2 = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR @@ -3890,6 +3902,9 @@ error: * * Purpose: Create a compressed, chunked dataset in SRC file and copy it to DST file * + * Note: The parameter "test_open" is added to test for H5Ocopy when + * the dataset is open in the file (HDFFV-7853). + * * Return: Success: 0 * Failure: number of errors * @@ -3902,7 +3917,7 @@ error: */ static int test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, - hid_t dst_fapl) + hid_t dst_fapl, hbool_t test_open) { #ifdef H5_HAVE_FILTER_DEFLATE hid_t fid_src = -1, fid_dst = -1; /* File IDs */ @@ -3917,7 +3932,11 @@ test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, char dst_filename[NAME_BUF_SIZE]; #endif /* H5_HAVE_FILTER_DEFLATE */ - TESTING("H5Ocopy(): compressed dataset with no edge filters"); + if(test_open) { + TESTING("H5Ocopy(): compressed and opened dataset with no edge filters"); + } else { + TESTING("H5Ocopy(): compressed dataset with no edge filters"); + } #ifndef H5_HAVE_FILTER_DEFLATE SKIPPED(); @@ -3966,15 +3985,19 @@ test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* attach attributes to the dataset */ if(test_copy_attach_attributes(did, H5T_NATIVE_INT) < 0) TEST_ERROR - /* close the dataset */ - if(H5Dclose(did) < 0) TEST_ERROR + if(!test_open) { - /* close the SRC file */ - if(H5Fclose(fid_src) < 0) TEST_ERROR + /* close the dataset */ + if(H5Dclose(did) < 0) TEST_ERROR + /* close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR - /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR + + /* open the source file with read-only */ + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR + + } /* create destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR @@ -3985,8 +4008,10 @@ test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* copy the dataset from SRC to DST */ if(H5Ocopy(fid_src, NAME_DATASET_CHUNKED, fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR - /* open the dataset for copy */ - if((did = H5Dopen2(fid_src, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR + if(!test_open) { + /* open the dataset for copy */ + if((did = H5Dopen2(fid_src, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR + } /* open the destination dataset */ if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR @@ -4034,6 +4059,9 @@ error: * * Purpose: Create a compact dataset in SRC file and copy it to DST file * + * Note: The parameter "test_open" is added to test for H5Ocopy when + * the dataset is open in the file (HDFFV-7853). + * * Return: Success: 0 * Failure: number of errors * @@ -4043,7 +4071,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) +test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, hbool_t test_open) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -4055,7 +4083,11 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; - TESTING("H5Ocopy(): compact dataset"); + if(test_open) { + TESTING("H5Ocopy(): compact and opened dataset"); + } else { + TESTING("H5Ocopy(): compact dataset"); + } /* set initial data values */ for (i=0; i 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 dd567df97b3b2332477d1726094b9647f9daea71 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 12 Jun 2017 15:37:32 -0400 Subject: Added -fno-omit-frame-pointer to gcc flags when symbols when building with debugging symbols. --- config/gnu-flags | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/gnu-flags b/config/gnu-flags index b4d5e8d..2f2e428 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -142,7 +142,7 @@ case "$cc_vendor-$cc_version" in # Symbols NO_SYMBOLS_CFLAGS="-s" - SYMBOLS_CFLAGS="-g" + SYMBOLS_CFLAGS="-g -fno-omit-frame-pointer" # Profile PROFILE_CFLAGS="-pg" -- 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 From 27b3b4b208f73f07f14c5f7a288ba1d1545854f9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 19 Jun 2017 09:15:19 -0500 Subject: Synch with CMake original code --- config/cmake/CMakeFindJavaCommon.cmake | 27 ++++++++----------------- config/cmake/FindJNI.cmake | 2 -- config/cmake/UseJava.cmake | 36 ++++++++++++++++++++-------------- java/CMakeLists.txt | 2 ++ 4 files changed, 31 insertions(+), 36 deletions(-) diff --git a/config/cmake/CMakeFindJavaCommon.cmake b/config/cmake/CMakeFindJavaCommon.cmake index fe6ee82..eabb622 100644 --- a/config/cmake/CMakeFindJavaCommon.cmake +++ b/config/cmake/CMakeFindJavaCommon.cmake @@ -1,41 +1,30 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details. -#============================================================================= -# Copyright 2013-2014 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) # Do not include this module directly from code outside CMake! set(_JAVA_HOME "") if(JAVA_HOME AND IS_DIRECTORY "${JAVA_HOME}") set(_JAVA_HOME "${JAVA_HOME}") set(_JAVA_HOME_EXPLICIT 1) -else () +else() set(_ENV_JAVA_HOME "") if(DEFINED ENV{JAVA_HOME}) file(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _ENV_JAVA_HOME) - endif () + endif() if(_ENV_JAVA_HOME AND IS_DIRECTORY "${_ENV_JAVA_HOME}") set(_JAVA_HOME "${_ENV_JAVA_HOME}") set(_JAVA_HOME_EXPLICIT 1) - else () + else() set(_CMD_JAVA_HOME "") if(APPLE AND EXISTS /usr/libexec/java_home) execute_process(COMMAND /usr/libexec/java_home OUTPUT_VARIABLE _CMD_JAVA_HOME OUTPUT_STRIP_TRAILING_WHITESPACE) - endif () + endif() if(_CMD_JAVA_HOME AND IS_DIRECTORY "${_CMD_JAVA_HOME}") set(_JAVA_HOME "${_CMD_JAVA_HOME}") set(_JAVA_HOME_EXPLICIT 0) - endif () + endif() unset(_CMD_JAVA_HOME) - endif () + endif() unset(_ENV_JAVA_HOME) -endif () +endif() diff --git a/config/cmake/FindJNI.cmake b/config/cmake/FindJNI.cmake index c82d308..1e6daf6 100644 --- a/config/cmake/FindJNI.cmake +++ b/config/cmake/FindJNI.cmake @@ -345,5 +345,3 @@ set(JNI_INCLUDE_DIRS ${JAVA_AWT_INCLUDE_PATH} ) -message ("JNI_LIBRARIES=${JNI_LIBRARIES}") -message ("JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}") diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake index 3e74d4f..9b3bf02 100644 --- a/config/cmake/UseJava.cmake +++ b/config/cmake/UseJava.cmake @@ -243,21 +243,23 @@ # # :: # -# install_jar_exports(TARGETS jar1 [jar2 ...] -# FILE export_filename -# DESTINATION destination [COMPONENT component]) +# install_jar_exports(TARGETS jars... +# [NAMESPACE ] +# FILE +# DESTINATION [COMPONENT ]) # -# This command installs a target export file export_filename for the named jar -# targets to the given DESTINATION. Its function is similar to that of -# install(EXPORTS). +# This command installs a target export file ```` for the named jar +# targets to the given ``DESTINATION``. Its function is similar to that of +# :command:`install(EXPORTS ...)`. # # :: # -# export_jars(TARGETS jar1 [jar2 ...] -# FILE export_filename) +# export_jars(TARGETS jars... +# [NAMESPACE ] +# FILE ) # -# This command writes a target export file export_filename for the named jar -# targets. Its function is similar to that of export(). +# This command writes a target export file ```` for the named jar +# targets. Its function is similar to that of :command:`export(...)`. # # :: # @@ -425,10 +427,12 @@ endfunction() function(__java_export_jar VAR TARGET PATH) get_target_property(_jarpath ${TARGET} JAR_FILE) get_filename_component(_jarname ${_jarpath} NAME) + set(_target "${_jar_NAMESPACE}${TARGET}") __java_lcat(${VAR} - "# Create imported target ${TARGET}" - "add_custom_target(${TARGET})" - "set_target_properties(${TARGET} PROPERTIES" + "# Create imported target ${_target}" + "add_library(${_target} IMPORTED STATIC)" + "set_target_properties(${_target} PROPERTIES" + " IMPORTED_LOCATION \"${PATH}/${_jarname}\"" " JAR_FILE \"${PATH}/${_jarname}\")" "" ) @@ -1402,7 +1406,7 @@ function(export_jars) # Parse and validate arguments cmake_parse_arguments(_export_jars "" - "FILE" + "FILE;NAMESPACE" "TARGETS" ${ARGN} ) @@ -1412,6 +1416,7 @@ function(export_jars) if (NOT _export_jars_TARGETS) message(SEND_ERROR "export_jars: TARGETS must be specified.") endif() + set(_jar_NAMESPACE "${_export_jars_NAMESPACE}") # Set content of generated exports file string(REPLACE ";" " " __targets__ "${_export_jars_TARGETS}") @@ -1434,7 +1439,7 @@ function(install_jar_exports) # Parse and validate arguments cmake_parse_arguments(_install_jar_exports "" - "FILE;DESTINATION;COMPONENT" + "FILE;DESTINATION;COMPONENT;NAMESPACE" "TARGETS" ${ARGN} ) @@ -1447,6 +1452,7 @@ function(install_jar_exports) if (NOT _install_jar_exports_TARGETS) message(SEND_ERROR "install_jar_exports: TARGETS must be specified.") endif() + set(_jar_NAMESPACE "${_install_jar_exports_NAMESPACE}") if (_install_jar_exports_COMPONENT) set (_COMPONENT COMPONENT ${_install_jar_exports_COMPONENT}) diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index d37a409..68860be 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -10,6 +10,8 @@ include (${HDF_RESOURCES_DIR}/UseJava.cmake) message (STATUS "JAVA: JAVA_HOME=$ENV{JAVA_HOME} JAVA_ROOT=$ENV{JAVA_ROOT}") find_package (JNI) +message ("JNI_LIBRARIES=${JNI_LIBRARIES}") +message ("JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}") INCLUDE_DIRECTORIES ( ${JNI_INCLUDE_DIRS} ) -- cgit v0.12 From d1ec663ad20bb057ff959b79ef8a2d8727867315 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 19 Jun 2017 09:31:03 -0500 Subject: Correct name of options variable --- config/cmake/HDF5_Examples.cmake.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index d137b37..bede701 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -66,7 +66,7 @@ endif() if(NOT DEFINED CTEST_BUILD_NAME) set(CTEST_BUILD_NAME "examples") endif() -set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) @@ -88,9 +88,9 @@ else() set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") endif() if(${CDASH_LOCAL}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") endif() -set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### # For any comments please contact cdashhelp@hdfgroup.org -- cgit v0.12 From 00f4456e70c7e53226085b4a96d3bab3fd0074f0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 19 Jun 2017 16:43:44 -0500 Subject: HDFFV-10219 - disable h5dump tests until h5import NATIVE is fixed --- tools/test/h5dump/CMakeTests.cmake | 4 ++-- tools/test/h5dump/testh5dump.sh.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index ae4649a..0a72709 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -1412,14 +1412,14 @@ ADD_H5_EXPORT_TEST (tstr2bin6 tstr2.h5 0 --enable-error-stack -d /g6/dset6 -b -o) # NATIVE default. the NATIVE test can be validated with h5import/h5diff - ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) +# ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) endif () # the NATIVE test can be validated with h5import/h5diff - ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) +# ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index 1136742..f0c01e6 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -1291,7 +1291,7 @@ IMPORTTEST out1.bin -c out3.h5import -o out1.h5 DIFFTEST tbinary.h5 out1.h5 /integer /integer # Same but use h5dump as input to h5import IMPORTTEST out1.bin -c tbin1.ddl -o out1D.h5 -DIFFTEST tbinary.h5 out1D.h5 /integer /integer +#DIFFTEST tbinary.h5 out1D.h5 /integer /integer TOOLTEST tbin2.ddl --enable-error-stack -b BE -d float -o out2.bin tbinary.h5 @@ -1301,7 +1301,7 @@ IMPORTTEST out3.bin -c out3.h5import -o out3.h5 DIFFTEST tbinary.h5 out3.h5 /integer /integer # Same but use h5dump as input to h5import IMPORTTEST out3.bin -c tbin3.ddl -o out3D.h5 -DIFFTEST tbinary.h5 out3D.h5 /integer /integer +#DIFFTEST tbinary.h5 out3D.h5 /integer /integer TOOLTEST tbin4.ddl --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5 -- cgit v0.12 From 14e52dcfa926b19c3940e3efda938a1eacf332de Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Jun 2017 16:09:32 -0500 Subject: Set default of var to NATIVE --- tools/lib/h5tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 22fd863..3729cac 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -40,7 +40,7 @@ FILE *rawinstream = NULL; /* should initialize to stdin but gcc moa FILE *rawoutstream = NULL; /* should initialize to stdout but gcc moans about it */ FILE *rawerrorstream = NULL; /* should initialize to stderr but gcc moans about it */ int bin_output; /* binary output */ -int bin_form; /* binary form */ +int bin_form = 0; /* binary form, default NATIVE */ int region_output; /* region output */ int oid_output; /* oid output */ int data_output; /* data output */ -- cgit v0.12 From 6b2f384a3cd6c4ff4334fe6b590aad1ea9e1178f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Jun 2017 16:40:39 -0500 Subject: HDFFV-10219 default input binary to NATIVE --- tools/src/h5import/h5import.c | 28 +++++++++++++++++++++++----- tools/src/h5import/h5import.h | 1 + tools/test/h5import/CMakeTests.cmake | 4 ++-- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 1afb383..36a8c21 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -524,9 +524,11 @@ static int readIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in16 = swap_int16(temp16); else +*/ *in16 = temp16; #ifdef H5DEBUGIMPORT printf("readIntegerData %d (0x%.8X)\n", *in16, temp16); @@ -558,9 +560,11 @@ static int readIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* 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); @@ -594,9 +598,11 @@ static int readIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in64 = swap_int64(temp64); else +*/ *in64 = temp64; #ifdef H5DEBUGIMPORT printf("readIntegerData %d (0x%.8X)\n", *in64, temp64); @@ -688,9 +694,11 @@ static int readUIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* 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); @@ -722,9 +730,11 @@ static int readUIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* 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); @@ -758,9 +768,11 @@ static int readUIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* 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); @@ -836,9 +848,11 @@ static int readFloatData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *bfp32 = swap_uint32(temp32); else +*/ *bfp32 = temp32; #ifdef H5DEBUGIMPORT printf("readFloatData %ld (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32); @@ -886,9 +900,11 @@ static int readFloatData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *bfp64 = swap_uint64(temp64); else +*/ *bfp64 = temp64; #ifdef H5DEBUGIMPORT printf("readFloatData %ld (0x%.16lX)\n", *bfp64, temp64); @@ -1423,6 +1439,7 @@ static int processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif + in->inputArchitecture = 0; /* default to NATIVE */ if ((strm = HDfopen(infile, "r")) == NULL) { (void) HDfprintf(stderr, err1, infile); @@ -2110,6 +2127,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 inputArchitecture=%d\n", in->inputArchitecture); printf("h5dump inputByteOrder=%d\n", in->inputByteOrder); printf("h5dump rank=%d\n", in->rank); printf("h5dump outputClass=%d\n", in->outputClass); @@ -4107,8 +4125,8 @@ hid_t createInputDataType(struct Input *in) if (in->h5dumpInput) { switch (in->inputClass) { case 4: - switch (in->outputArchitecture) { - case 0: /* NATIVE */ + switch (in->inputArchitecture) { + case 0: /*NATIVE*/ switch (in->inputSize) { case 8: new_type = H5Tcopy(H5T_NATIVE_CHAR); @@ -4147,7 +4165,7 @@ hid_t createInputDataType(struct Input *in) } break; - case 1: /* STD */ + case 1: /*STD*/ switch (in->inputSize) { case 8: switch (in->inputByteOrder) { @@ -4230,7 +4248,7 @@ hid_t createInputDataType(struct Input *in) break; case 3: - switch (in->outputArchitecture) { + switch (in->inputArchitecture) { case 0: switch (in->inputSize) { case 32: @@ -4315,7 +4333,7 @@ hid_t createInputDataType(struct Input *in) break; case 7: - switch (in->outputArchitecture) { + switch (in->inputArchitecture) { case 0: switch (in->inputSize) { case 8: diff --git a/tools/src/h5import/h5import.h b/tools/src/h5import/h5import.h index b27b944..c55717d 100644 --- a/tools/src/h5import/h5import.h +++ b/tools/src/h5import/h5import.h @@ -83,6 +83,7 @@ struct Input struct path_info path; int inputClass; int inputSize; + int inputArchitecture; int inputByteOrder; int rank; hsize_t* sizeOfDimension; diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index 20aad47..3c65b0b 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -171,7 +171,7 @@ NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;FILE;testfiles/${testfile}" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;NATIVE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.dmp" -D "TEST_EXPECT=0" @@ -244,7 +244,7 @@ NAME H5IMPORT_SUB-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;${testname}.bin;-b;FILE;testfiles/${testfile}" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;${testname}.bin;-b;NATIVE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${testname}.dmp" -D "TEST_EXPECT=0" -- cgit v0.12 From e526ff9dc664ef6f020c0bac1a21adcfbeb6a17d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 26 Jun 2017 09:36:28 -0500 Subject: HDFFV-10219 change subset to use BINARY mode for h5dump --- 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 fba4517..fc07530 100644 --- a/tools/test/h5import/h5importtestutil.sh.in +++ b/tools/test/h5import/h5importtestutil.sh.in @@ -268,7 +268,7 @@ fi TOOLTEST5() { err=0 -$RUNSERIAL $DUMPER_BIN -p -d $3 $4 -o d-$1.bin -b FILE tmp_testfiles/$2 > d-$1.dmp +$RUNSERIAL $DUMPER_BIN -p -d $3 $4 -o d-$1.bin -b NATIVE 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 -- cgit v0.12 From c325dd2a6512ce02287771bfbbe9b81d65b3fd6f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 26 Jun 2017 09:38:30 -0500 Subject: HDFFV-10219 another mode change --- 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 fc07530..7dff689 100644 --- a/tools/test/h5import/h5importtestutil.sh.in +++ b/tools/test/h5import/h5importtestutil.sh.in @@ -204,7 +204,7 @@ fi TOOLTEST2() { err=0 -$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -b FILE tmp_testfiles/$2 > d$2.dmp +$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -b NATIVE 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 -- cgit v0.12 From d85aeb770496a08d1e0ce9fcabbfc54f15f44864 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 27 Jun 2017 14:35:16 -0400 Subject: Fixed a comment in configure.ac --- configure.ac | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 9695fe3..3eaf293 100644 --- a/configure.ac +++ b/configure.ac @@ -1251,10 +1251,11 @@ AC_ARG_WITH([fnord], ]) ## ---------------------------------------------------------------------- -## Is the dmalloc present? It has a header file `dmalloc.h' and a library -## `-ldmalloc' and their locations might be specified with the `--with-dmalloc' -## command-line switch. The value is an include path and/or a library path. -## If the library path is specified then it must be preceded by a comma. +## Is dmalloc (debug malloc library) requested? It has a header file +## `dmalloc.h' and a library `-ldmalloc' and their locations might be +## specified with the `--with-dmalloc' command-line switch. The value +## is an include path and/or a library path. If the library path is +## specified then it must be preceded by a comma. ## AC_SUBST([HAVE_DMALLOC]) -- cgit v0.12 From 373de3f95feaa3d1a06a351a634109a7828cdb6e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 28 Jun 2017 16:36:26 -0700 Subject: Added awk processing to remove extraneous whitespace from H5_ flags in configure. --- configure.ac | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.ac b/configure.ac index 3eaf293..cc91682 100644 --- a/configure.ac +++ b/configure.ac @@ -3352,6 +3352,14 @@ fi ## AM_CONDITIONAL([HAVE_SHARED_CONDITIONAL], [test "X$enable_shared" = "Xyes"]) +## The H5 flags go through multiple rounds of processing, which can introduce +## extra whitespace. Trim this for nicer output in the settings file. +H5_LDFLAGS=$(echo "$H5_LDFLAGS" | awk '$1=$1') +H5_CPPFLAGS=$(echo "$H5_CPPFLAGS" | awk '$1=$1') +H5_CFLAGS=$(echo "$H5_CFLAGS" | awk '$1=$1') +H5_FCFLAGS=$(echo "$H5_FCFLAGS" | awk '$1=$1') +H5_CXXFLAGS=$(echo "$H5_CXXFLAGS" | awk '$1=$1') + AC_CONFIG_FILES([src/libhdf5.settings Makefile src/Makefile -- cgit v0.12 From cbca178410215a1fd60e3de85c4810487e327f8d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 28 Jun 2017 16:49:58 -0700 Subject: Updated the --enable-debug/production handling in configure.ac so that it more reliably indicates that the configure option can no longer be used. Previously, using --enable-debug="", etc. would not trigger an error (even though such usage is unlikely). --- configure.ac | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index cc91682..4decf82 100644 --- a/configure.ac +++ b/configure.ac @@ -1941,26 +1941,17 @@ AC_DEFINE_UNQUOTED([PRINTF_LL_WIDTH], ["$hdf5_cv_printf_ll"], [Width for printf() for type `long long' or `__int64', use `ll']) ## ---------------------------------------------------------------------- -## Deprecate old ways of determining debug/production build -## These can probably be removed in the future (1.10.1?) +## Remove old ways of determining debug/production build. +## These were used in 1.8.x and earlier. We should probably keep these checks +## around to help people migrate to 1.10.x and newer versions. ## AC_ARG_ENABLE([debug], - [AS_HELP_STRING([--enable-debug], - [DEPRECATED: use --enable-build-mode=debug])], - [DEPRECATED_DEBUG=$enableval]) - -if test "X-$DEPRECATED_DEBUG" != "X-" ; then - AC_MSG_ERROR([--enable-debug is deprecated, use --enable-build-mode=debug instead.]) -fi + [AS_HELP_STRING([--enable-debug], [DEPRECATED: use --enable-build-mode=debug])], + [AC_MSG_ERROR([--enable-debug is deprecated, use --enable-build-mode=debug instead.])]) AC_ARG_ENABLE([production], - [AS_HELP_STRING([--enable-production], - [DEPRECATED: use --enable-build-mode=production])], - [DEPRECATED_PRODUCTION=$enableval]) - -if test "X-$DEPRECATED_PRODUCTION" != "X-" ; then - AC_MSG_ERROR([--enable-production is deprecated, use --enable-build-mode=production instead.]) -fi + [AS_HELP_STRING([--enable-production], [DEPRECATED: use --enable-build-mode=production])], + [AC_MSG_ERROR([--enable-production is deprecated, use --enable-build-mode=production instead.])]) ## ---------------------------------------------------------------------- -- cgit v0.12 From 8c347d794a06b8b57c407499e1a441cc0f415380 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 28 Jun 2017 17:30:45 -0700 Subject: Fixed a bug in autotools Fortran processing where a test for the presence of a C long double type always returned true. --- configure.ac | 6 +++--- m4/aclocal_fc.f90 | 2 +- m4/aclocal_fc.m4 | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 3eaf293..189eb0c 100644 --- a/configure.ac +++ b/configure.ac @@ -585,11 +585,11 @@ if test "X$HDF_FORTRAN" = "Xyes"; then AC_DEFINE([FORTRAN_HAVE_STORAGE_SIZE], [1], [Define if we have Fortran intrinsic STORAGE_SIZE]) fi - if test "X$HAVE_C_SIZEOF_FORTRAN" = "Xyes"; then + if test "X$HAVE_C_SIZEOF_FORTRAN" = "Xyes"; then AC_DEFINE([FORTRAN_HAVE_C_SIZEOF], [1], [Define if we have Fortran intrinsic C_SIZEOF]) fi - if test "X$HAVE_SIZEOF_FORTRAN" = "Xyes"; then + if test "X$HAVE_SIZEOF_FORTRAN" = "Xyes"; then AC_DEFINE([FORTRAN_HAVE_SIZEOF], [1], [Define if we have Fortran intrinsic SIZEOF]) fi @@ -604,7 +604,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ## Is C_LONG_DOUBLE different from C_DOUBLE FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="0" - if test "X$FORTRAN_HAVE_C_LONG_DOUBLE"; then + if test "$FORTRAN_HAVE_C_LONG_DOUBLE" = "1"; then PAC_PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE if test "X$C_LONG_DOUBLE_IS_UNIQUE_FORTRAN" = "Xyes"; then FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="1" diff --git a/m4/aclocal_fc.f90 b/m4/aclocal_fc.f90 index 4c58e4e..664a3c6 100644 --- a/m4/aclocal_fc.f90 +++ b/m4/aclocal_fc.f90 @@ -58,7 +58,7 @@ END PROGRAM PROG_FC_HAVE_F2003_REQUIREMENTS !---- START ----- Check to see C_LONG_DOUBLE is different from C_DOUBLE MODULE type_mod USE ISO_C_BINDING - INTERFACE h5t + INTERFACE h5t MODULE PROCEDURE h5t_c_double MODULE PROCEDURE h5t_c_long_double END INTERFACE diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index 0bf3cb1..ab45bbc 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -476,4 +476,3 @@ rm -f pac_Cconftest.out ],[]) ]) - -- cgit v0.12 From 804a88fafdca3d6a76312ab01ac4d6d5b103e9dc Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Thu, 29 Jun 2017 01:11:44 -0500 Subject: Fix for HDFFV-10160 Modifications to fix the assertion/abort failure when the application does not close the file. --- MANIFEST | 2 + configure.ac | 1 + src/H5.c | 7 +++ src/H5FSint.c | 26 +++++++++ src/H5FSprivate.h | 3 + test/CMakeLists.txt | 1 + test/CMakeTests.cmake | 17 ++++++ test/Makefile.am | 12 ++-- test/filenotclosed.c | 128 ++++++++++++++++++++++++++++++++++++++++++ test/test_filenotclosed.sh.in | 40 +++++++++++++ 10 files changed, 232 insertions(+), 5 deletions(-) create mode 100644 test/filenotclosed.c create mode 100644 test/test_filenotclosed.sh.in diff --git a/MANIFEST b/MANIFEST index b890352..475b674 100644 --- a/MANIFEST +++ b/MANIFEST @@ -956,6 +956,7 @@ ./test/filespace_1_8.h5 ./test/filespace_1_6.h5 ./test/freespace.c +./test/filenotclosed.c ./test/file_image.c ./test/file_image_core_test.h5 ./test/fill_old.h5 @@ -1057,6 +1058,7 @@ ./test/testcheck_version.sh.in ./test/testerror.sh.in ./test/testlinks_env.sh.in +./test/test_filenotclosed.sh.in ./test/testflushrefresh.sh.in ./test/testframe.c ./test/testhdf5.c diff --git a/configure.ac b/configure.ac index 4decf82..d31dd6d 100644 --- a/configure.ac +++ b/configure.ac @@ -3361,6 +3361,7 @@ AC_CONFIG_FILES([src/libhdf5.settings test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh + test/test_filenotclosed.sh test/testswmr.sh test/test_plugin.sh test/test_usecases.sh diff --git a/src/H5.c b/src/H5.c index 1068fc6..59984dc 100644 --- a/src/H5.c +++ b/src/H5.c @@ -29,6 +29,7 @@ #include "H5Pprivate.h" /* Property lists */ #include "H5SLprivate.h" /* Skip lists */ #include "H5Tprivate.h" /* Datatypes */ +#include "H5FSprivate.h" /* File free space */ /****************/ /* Local Macros */ @@ -204,6 +205,10 @@ H5_init_library(void) * property classes. * The link interface needs to be initialized so that link property lists * have their properties registered. + * The FS module needs to be initialized as a result of the fix for HDFFV-10160: + * It might not be initialized during normal file open. + * When the application does not close the file, routines in the module might + * be called via H5_term_library() when shutting down the file. */ if(H5E_init() < 0) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize error interface") @@ -217,6 +222,8 @@ H5_init_library(void) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize metadata caching interface") if(H5L_init() < 0) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize link interface") + if(H5FS_init() < 0) + HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize FS interface") /* Debugging? */ H5_debug_mask("-all"); diff --git a/src/H5FSint.c b/src/H5FSint.c index 1a41172..4297291 100644 --- a/src/H5FSint.c +++ b/src/H5FSint.c @@ -77,6 +77,32 @@ /*******************/ +/*------------------------------------------------------------------------- + * Function: H5FS_init + * + * Purpose: Initialize the interface in case it is unable to initialize + * itself soon enough. + * + * Return: Success: non-negative + * Failure: negative + * + * Programmer: Quincey Koziol + * Saturday, March 4, 2000 + * + *------------------------------------------------------------------------- + */ +herr_t +H5FS_init(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + /* FUNC_ENTER() does all the work */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FS_init() */ + /*------------------------------------------------------------------------- * Function: H5FS__create_flush_depend diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h index c0467a6..247d75c 100644 --- a/src/H5FSprivate.h +++ b/src/H5FSprivate.h @@ -175,6 +175,9 @@ H5FL_SEQ_EXTERN(H5FS_section_class_t); /* Library-private Function Prototypes */ /***************************************/ +/* Package initialization routine */ +H5_DLL herr_t H5FS_init(void); + /* Free space manager routines */ H5_DLL H5FS_t *H5FS_create(H5F_t *f, hid_t dxpl_id, haddr_t *fs_addr, const H5FS_create_t *fs_create, uint16_t nclasses, diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d7965cb..8522c1d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -373,6 +373,7 @@ set (H5_CHECK_TESTS atomic_reader links_env flushrefresh + filenotclosed ) foreach (test ${H5_CHECK_TESTS}) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index fe8f261..5f0d386 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -570,6 +570,7 @@ set (test_CLEANFILES flushrefresh_VERIFICATION_CHECKPOINT1 flushrefresh_VERIFICATION_CHECKPOINT2 flushrefresh_VERIFICATION_DONE + filenotclosed.h5 atomic_data accum_swmr_big.h5 ohdr_swmr.h5 @@ -783,6 +784,22 @@ set_tests_properties (H5TEST-cache_image PROPERTIES WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) +#-- Adding test for filenotclosed +add_test ( + NAME H5TEST-clear-filenotclosed-objects + COMMAND ${CMAKE_COMMAND} + -E remove + filenotclosed.h5 + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST +) +add_test (NAME H5TEST-filenotclosed COMMAND $) +set_tests_properties (H5TEST-filenotclosed PROPERTIES + DEPENDS H5TEST-clear-filenotclosed-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST +) + #-- Adding test for err_compat if (HDF5_ENABLE_DEPRECATED_SYMBOLS) add_test (NAME H5TEST-clear-err_compat-objects diff --git a/test/Makefile.am b/test/Makefile.am index 20b63f6..f64b6d8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -25,14 +25,15 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_builddir)/src # testerror.sh: err_compat, error_test # testlibinfo.sh: # testcheck_version.sh: tcheck_version -# tetlinks_env.sh: links_env +# testlinks_env.sh: links_env +# test_filenotclosed.sh: filenotclosed.c # testflushrefresh.sh: flushrefresh # test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes # testswmr.sh: swmr* # testvdsswmr.sh: vds_swmr* -TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh \ +TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_filenotclosed.sh\ testswmr.sh testvdsswmr.sh testflushrefresh.sh test_usecases.sh -SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) \ +SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) test_filenotclosed$(EXEEXT) \ flushrefresh$(EXEEXT) use_append_chunk$(EXEEXT) use_append_mchunks$(EXEEXT) use_disable_mdc_flushes$(EXEEXT) \ swmr_generator$(EXEEXT) swmr_reader$(EXEEXT) swmr_writer$(EXEEXT) \ swmr_remove_reader$(EXEEXT) swmr_remove_writer$(EXEEXT) swmr_addrem_writer$(EXEEXT) \ @@ -65,6 +66,7 @@ TEST_PROG= testhdf5 \ # accum_swmr_reader is used by accum.c. # atomic_writer and atomic_reader are standalone programs. # links_env is used by testlinks_env.sh +# filenotclosed is used by test_filenotclosed.sh # flushrefresh is used by testflushrefresh.sh. # use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh # swmr_* files (besides swmr.c) are used by testswmr.sh. @@ -74,7 +76,7 @@ TEST_PROG= testhdf5 \ # and this lets automake keep all its test programs in one place. check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ testmeta accum_swmr_reader atomic_writer atomic_reader \ - links_env flushrefresh use_append_chunk use_append_mchunks use_disable_mdc_flushes \ + links_env filenotclosed flushrefresh use_append_chunk use_append_mchunks use_disable_mdc_flushes \ swmr_generator swmr_start_write swmr_reader swmr_writer swmr_remove_reader \ swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer \ swmr_check_compat_vfd vds_swmr_gen vds_swmr_reader vds_swmr_writer @@ -216,6 +218,6 @@ use_disable_mdc_flushes_SOURCES=use_disable_mdc_flushes.c # Temporary files. DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh \ - testswmr.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh + testswmr.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh test_filenotclosed.sh include $(top_srcdir)/config/conclude.am diff --git a/test/filenotclosed.c b/test/filenotclosed.c new file mode 100644 index 0000000..f91f4bc --- /dev/null +++ b/test/filenotclosed.c @@ -0,0 +1,128 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: Test to verify that the assertion/abort failure is fixed when the + * application does not close the file. (See HDFFV-10160) + */ + + +#include "h5test.h" + +#define FILENAME "filenotclosed" +#define DATASET "dset" + +/*------------------------------------------------------------------------- + * Function: catch_signal + * + * Purpose: The signal handler to catch the SIGABRT signal. + * + * Return: No return + * + * Programmer: Vailin Choi + * + *------------------------------------------------------------------------- + */ +static void catch_signal(int H5_ATTR_UNUSED signo) +{ + HDexit(1); +} /* catch_signal() */ + + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: Test to verify the following problem described in HDFFV-10160 is fixed: + * "a.out: H5Fint.c:1679: H5F_close: Assertion `f->file_id > 0' failed." + * + * Return: Success: exit(EXIT_SUCCESS) + * Failure: exit(EXIT_FAILURE) + * + * Programmer: Vailin Choi; June 2017 + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + hid_t fapl = -1; /* File access property lists */ + hid_t fid = -1; /* File ID */ + hid_t did = -1; /* Dataset ID */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t sid = -1; /* Dataspace ID */ + hsize_t cur_dim[1] = {5}; /* Current dimension sizes */ + hsize_t max_dim[1] = {H5S_UNLIMITED}; /* Maximum dimension sizes */ + hsize_t chunk_dim[1] = {10}; /* Chunk dimension sizes */ + int buf[5] = {1, 2, 3, 4, 5}; /* The data to be written to the dataset */ + char filename[100]; /* File name */ + const char *env_h5_drvr; /* File Driver value from environment */ + + h5_reset(); + + /* To exit from the file for SIGABRT signal */ + if(HDsignal(SIGABRT, catch_signal) == SIG_ERR) + TEST_ERROR + + fapl = h5_fileaccess(); + h5_fixname(FILENAME, fapl, filename, sizeof(filename)); + + /* Set to latest format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + TEST_ERROR + + /* Create the file */ + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR + + /* Create the dcpl and set the chunk size */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + if(H5Pset_chunk(dcpl, 1, chunk_dim) < 0) + TEST_ERROR + + /* Create the dataspace */ + if((sid = H5Screate_simple(1, cur_dim, max_dim)) < 0) + TEST_ERROR + + /* Create the dataset */ + if((did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Write to the dataset */ + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + TEST_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) + TEST_ERROR + + /* Close the dataspace */ + if(H5Sclose(sid) < 0) + TEST_ERROR + + /* Close the property lists */ + if(H5Pclose(dcpl) < 0) + TEST_ERROR + if(H5Pclose(fapl) < 0) + TEST_ERROR + + /* The file is not closed. */ + /* The library will call H5_term_library to shut down the library. */ + + HDexit(EXIT_SUCCESS); + +error: + HDputs("*** TEST FAILED ***"); + HDexit(EXIT_FAILURE); +} diff --git a/test/test_filenotclosed.sh.in b/test/test_filenotclosed.sh.in new file mode 100644 index 0000000..09129c5 --- /dev/null +++ b/test/test_filenotclosed.sh.in @@ -0,0 +1,40 @@ +#! /bin/sh +# +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +# Test to verify that the assertion/abort failure is fixed when the application +# does not close the file. (See HDFFV-10160) + +srcdir=@srcdir@ + +nerrors=0 + +############################################################################## +############################################################################## +### T H E T E S T ### +############################################################################## +############################################################################## + +echo "Testing file not closed assertion/abort failure" +TEST_NAME=filenotclosed # The test name +TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary +# +# Run the test +$RUNSERIAL $TEST_BIN >/dev/null 2>&1 +exitcode=$? +if [ $exitcode -eq 0 ]; then + echo "Test PASSED" +else + nerrors="`expr $nerrors + 1`" + echo "***Error encountered***" +fi +exit $nerrors -- cgit v0.12 From 95bbd396ff782fff44baff9b7e9f60ff32344801 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 29 Jun 2017 15:45:36 -0500 Subject: Removed compiler flag cleanup since Solaris chokes on it. --- configure.ac | 8 -------- 1 file changed, 8 deletions(-) diff --git a/configure.ac b/configure.ac index dd8d8b1..4595655 100644 --- a/configure.ac +++ b/configure.ac @@ -3343,14 +3343,6 @@ fi ## AM_CONDITIONAL([HAVE_SHARED_CONDITIONAL], [test "X$enable_shared" = "Xyes"]) -## The H5 flags go through multiple rounds of processing, which can introduce -## extra whitespace. Trim this for nicer output in the settings file. -H5_LDFLAGS=$(echo "$H5_LDFLAGS" | awk '$1=$1') -H5_CPPFLAGS=$(echo "$H5_CPPFLAGS" | awk '$1=$1') -H5_CFLAGS=$(echo "$H5_CFLAGS" | awk '$1=$1') -H5_FCFLAGS=$(echo "$H5_FCFLAGS" | awk '$1=$1') -H5_CXXFLAGS=$(echo "$H5_CXXFLAGS" | awk '$1=$1') - AC_CONFIG_FILES([src/libhdf5.settings Makefile src/Makefile -- cgit v0.12 From a2b7560aa6fa960b2aecddeab331b2b13d485d4f Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 29 Jun 2017 14:25:18 -0700 Subject: Partial removal of NDEBUG ifdefs from the library. --- src/H5.c | 4 ++-- src/H5ACprivate.h | 4 ++-- src/H5Aint.c | 5 +---- src/H5Apkg.h | 7 ------- src/H5B.c | 10 ++-------- src/H5Bprivate.h | 10 +++------- src/H5Cpkg.h | 6 +++--- src/H5Cprivate.h | 24 ++++++++++++------------ src/H5Dvirtual.c | 7 ++++--- src/H5EA.c | 13 ++++++++----- src/H5Fio.c | 4 ++-- src/H5Fpkg.h | 9 --------- src/H5HLprivate.h | 7 ------- src/H5Oalloc.c | 7 ++++--- src/H5Opkg.h | 14 +++++++------- src/H5SM.c | 27 +++++++++++++++------------ src/H5Tpkg.h | 7 ------- src/H5private.h | 22 +++++++++++----------- 18 files changed, 76 insertions(+), 111 deletions(-) diff --git a/src/H5.c b/src/H5.c index 1068fc6..6d1c2d8 100644 --- a/src/H5.c +++ b/src/H5.c @@ -359,9 +359,9 @@ H5_term_library(void) if(func) { fprintf(stderr, "HDF5: infinite loop closing library\n"); fprintf(stderr, " %s\n", loop); -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD HDabort(); -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ } /* end if */ } /* end if */ diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index b9e2a60..02fd36f 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -485,7 +485,7 @@ H5_DLL herr_t H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr); /* Debugging functions */ H5_DLL herr_t H5AC_stats(const H5F_t *f); -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD H5_DLL herr_t H5AC_dump_cache(const H5F_t *f); H5_DLL herr_t H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, void **entry_ptr_ptr); @@ -496,7 +496,7 @@ H5_DLL herr_t H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, hbool_t *type_ok_ptr); H5_DLL hbool_t H5AC_get_serialization_in_progress(H5F_t *f); H5_DLL hbool_t H5AC_cache_is_clean(const H5F_t *f, H5AC_ring_t inner_ring); -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* H5_DEBUG_BUILD */ /* end debugging functions */ #endif /* !_H5ACprivate_H */ diff --git a/src/H5Aint.c b/src/H5Aint.c index 160c7fb..f3654ef 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -314,7 +314,7 @@ H5A__open_common(const H5G_loc_t *loc, H5A_t *attr) HDassert(loc); HDassert(attr); -#if defined(H5_USING_MEMCHECKER) || !defined(NDEBUG) +#if defined(H5_USING_MEMCHECKER) || defined(H5_DEBUG_BUILD) /* Clear object location */ if(H5O_loc_reset(&(attr->oloc)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to reset location") @@ -1710,10 +1710,7 @@ H5A_attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, break; default: - HDassert("unknown attribute op type" && 0); -#ifdef NDEBUG HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unsupported attribute op type") -#endif /* NDEBUG */ } /* end switch */ /* Increment the number of entries passed through */ diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 6d5a83a..961c102 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -26,13 +26,6 @@ #ifndef _H5Apkg_H #define _H5Apkg_H -/* - * Define this to enable debugging. - */ -#ifdef NDEBUG -# undef H5A_DEBUG -#endif - /* Get package's private header */ #include "H5Aprivate.h" diff --git a/src/H5B.c b/src/H5B.c index e64a695..724182e 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -991,14 +991,8 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "internal error: likely corrupt key values") #endif /* H5_STRICT_FORMAT_CHECKS */ } else if(cmp) { - /* - * We couldn't figure out which branch to follow out of this node. THIS - * IS A MAJOR PROBLEM THAT NEEDS TO BE FIXED --rpm. - */ - HDassert("INTERNAL HDF5 ERROR (contact rpm)" && 0); -#ifdef NDEBUG - HDabort(); -#endif /* NDEBUG */ + /* We couldn't determine which branch to follow out of this node. */ + HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "unable to find a way out of this node") } else if(bt->level > 0) { /* * Follow a branch out of this node to another subtree. diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index cb038ec..0dcc924 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -39,14 +39,10 @@ /**************************/ /* - * Feature: Define this constant if you want to check B-tree consistency - * after each B-tree operation. Note that this slows down the - * library considerably! Debugging the B-tree depends on assert() - * being enabled. + * NOTE: Define H5B_DEBUG if you want to check B-tree consistency + * after each B-tree operation. Note that this slows down the + * library considerably! */ -#ifdef NDEBUG -# undef H5B_DEBUG -#endif /****************************/ diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index fdb14a5..00e0d62 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -4670,7 +4670,7 @@ typedef struct H5C_tag_info_t { * get_entry_ptr_from_addr_counter: Counter used to track the number of * times the H5C_get_entry_ptr_from_addr() function has been * called successfully. This field is only defined when - * NDEBUG is not #defined. + * H5_DEBUG_BUILD is #defined. * ****************************************************************************/ struct H5C_t { @@ -4903,9 +4903,9 @@ struct H5C_t { char prefix[H5C__PREFIX_LEN]; -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD int64_t get_entry_ptr_from_addr_counter; -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ }; /* Define typedef for tagged cache entry iteration callbacks */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 5335f80..2b60147 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -207,20 +207,20 @@ #define H5C__UPDATE_PAGE_BUFFER_FLAG 0x40000 /* Set during parallel I/O */ /* Debugging/sanity checking/statistics settings */ -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD #define H5C_DO_SANITY_CHECKS 1 #define H5C_DO_SLIST_SANITY_CHECKS 0 #define H5C_DO_TAGGING_SANITY_CHECKS 1 #define H5C_DO_EXTREME_SANITY_CHECKS 0 -#else /* NDEBUG */ +#else /* H5_DEBUG_BUILD */ /* With rare execptions, the following defines should be set - * to 0 if NDEBUG is defined + * to 0 if not using a debug build. */ #define H5C_DO_SANITY_CHECKS 0 #define H5C_DO_SLIST_SANITY_CHECKS 0 #define H5C_DO_TAGGING_SANITY_CHECKS 0 #define H5C_DO_EXTREME_SANITY_CHECKS 0 -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ /* Cork actions: cork/uncork/get cork status of an object */ #define H5C__SET_CORK 0x1 @@ -242,11 +242,11 @@ * debug mode, and 0 in production mode.. */ -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD #define H5C_COLLECT_CACHE_STATS 1 -#else /* NDEBUG */ +#else /* H5_DEBUG_BUILD */ #define H5C_COLLECT_CACHE_STATS 0 -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ /* H5C_COLLECT_CACHE_ENTRY_STATS controls collection of statistics * in individual cache entries. @@ -1559,7 +1559,7 @@ typedef int H5C_ring_t; * a single cache serialization. * * This is a debugging field, and thus is maintained only if - * NDEBUG is undefined. + * H5_DEBUG_BUILD is defined. * * Fields supporting tagged entries: * @@ -1669,9 +1669,9 @@ typedef struct H5C_cache_entry_t { int32_t age; hbool_t prefetched_dirty; -#ifndef NDEBUG /* debugging field */ +#ifdef H5_DEBUG_BUILD /* debugging field */ int serialization_count; -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ /* fields supporting tag lists */ struct H5C_cache_entry_t *tl_next; @@ -2332,7 +2332,7 @@ H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, hid_t dxpl_id, unsigned ce_arr haddr_t *ce_array_ptr); #endif /* H5_HAVE_PARALLEL */ -#ifndef NDEBUG /* debugging functions */ +#ifdef H5_DEBUG_BUILD /* debugging functions */ H5_DLL herr_t H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name); H5_DLL herr_t H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name); H5_DLL hbool_t H5C_get_serialization_in_progress(const H5C_t *cache_ptr); @@ -2349,7 +2349,7 @@ H5_DLL herr_t H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_class_t *expected_type, hbool_t *in_cache_ptr, hbool_t *type_ok_ptr); H5_DLL herr_t H5C_validate_index_list(H5C_t *cache_ptr); -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ #endif /* !_H5Cprivate_H */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 3be2353..a864729 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -2510,7 +2510,7 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, type_info->mem_type, fill_space, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "filling buf failed") -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD /* Make sure the total number of elements written (including fill * values) >= nelmts */ { @@ -2523,9 +2523,10 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Verify number of elements is correct. Note that since we * don't check for overlap we can't assert that these are equal */ - HDassert((tot_nelmts + (hsize_t)select_nelmts) >= nelmts); + if((tot_nelmts + (hsize_t)select_nelmts) < nelmts) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "number of elements is incorrect") } /* end block */ -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ } /* end if */ } /* end if */ diff --git a/src/H5EA.c b/src/H5EA.c index c524d49..ae11077 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -877,7 +877,7 @@ H5EA_close(H5EA_t *ea, hid_t dxpl_id)) if(pending_delete) { H5EA_hdr_t *hdr; /* Another pointer to extensible array header */ -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD { unsigned hdr_status = 0; /* Header's status in the metadata cache */ @@ -886,11 +886,14 @@ H5EA_close(H5EA_t *ea, hid_t dxpl_id)) H5E_THROW(H5E_CANTGET, "unable to check metadata cache status for extensible array header") /* Sanity checks on header */ - HDassert(hdr_status & H5AC_ES__IN_CACHE); - HDassert(hdr_status & H5AC_ES__IS_PINNED); - HDassert(!(hdr_status & H5AC_ES__IS_PROTECTED)); + if(!(hdr_status & H5AC_ES__IN_CACHE)) + H5E_THROW(H5E_BADVALUE, "extensible array header not in cache") + if(!(hdr_status & H5AC_ES__IS_PINNED)) + H5E_THROW(H5E_BADVALUE, "extensible array header not pinned") + if(hdr_status & H5AC_ES__IS_PROTECTED) + H5E_THROW(H5E_BADVALUE, "extensible array header is incorrectly protected") } -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ /* Lock the array header into memory */ /* (OK to pass in NULL for callback context, since we know the header must be in the cache) */ diff --git a/src/H5Fio.c b/src/H5Fio.c index 81fa514..2dc0b70 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -298,7 +298,7 @@ H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id) if(H5AC_evict(f, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "unable to evict all except pinned entries") -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD { unsigned status = 0; uint32_t cur_num_entries; @@ -319,7 +319,7 @@ H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id) if(cur_num_entries != 1) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "number of cache entries is not correct") } -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ done: FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 7a5c126..2fde183 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -43,15 +43,6 @@ #include "H5PBprivate.h" /* Page buffer */ #include "H5UCprivate.h" /* Reference counted object functions */ - -/* - * Feature: Define this constant on the compiler command-line if you want to - * see some debugging messages on the debug stream. - */ -#ifdef NDEBUG -# undef H5F_DEBUG -#endif - /* Superblock status flags */ #define H5F_SUPER_WRITE_ACCESS 0x01 #define H5F_SUPER_FILE_OK 0x02 diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index 054d396..5ada884 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -32,13 +32,6 @@ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Fprivate.h" /* File access */ -/* - * Feature: Define H5HL_DEBUG on the compiler command line if you want to - * enable diagnostic messages from this layer. - */ -#ifdef NDEBUG -# undef H5HL_DEBUG -#endif #define H5HL_ALIGN(X) ((((unsigned)X)+7)&(unsigned)(~0x07)) /* align on 8-byte boundary */ diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 3512d3e..945c8ca 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -127,7 +127,7 @@ H5O_add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, hbool_t *chk_dirtied, HDassert(new_gap_loc); HDassert(new_gap_size); -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD if(chunkno > 0) { unsigned chk_proxy_status = 0; /* Object header chunk proxy entry cache status */ @@ -136,9 +136,10 @@ if(chunkno > 0) { HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check metadata cache status for object header chunk proxy") /* Make certain that object header is protected */ - HDassert(chk_proxy_status & H5AC_ES__IS_PROTECTED); + if(!(chk_proxy_status & H5AC_ES__IS_PROTECTED)) + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "chunk proxy is not protected") } /* end if */ -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ /* Check for existing null message in chunk */ merged_with_null = FALSE; diff --git a/src/H5Opkg.h b/src/H5Opkg.h index b0c67d1..e0fd496 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -171,11 +171,11 @@ #define H5O_DECODEIO_DIRTY 0x02u /* OUT: message has been changed */ /* Macro to incremend ndecode_dirtied (only if we are debugging) */ -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD #define INCR_NDECODE_DIRTIED(OH) (OH)->ndecode_dirtied++; -#else /* NDEBUG */ +#else /* H5_DEBUG_BUILD */ #define INCR_NDECODE_DIRTIED(OH) ; -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ /* Load native information for a message, if it's not already present */ /* (Only works for messages with decode callback) */ @@ -193,11 +193,11 @@ if((ioflags & H5O_DECODEIO_DIRTY) && (H5F_get_intent((F)) & H5F_ACC_RDWR)) { \ (MSG)->dirty = TRUE; \ /* Increment the count of messages dirtied by decoding, but */ \ - /* only ifndef NDEBUG */ \ + /* only debugging */ \ INCR_NDECODE_DIRTIED(OH) \ } \ \ - /* Set the message's "shared info", if it's shareable */ \ + /* Set the message's "shared info", if it's shareable */ \ if((MSG)->flags & H5O_MSG_FLAG_SHAREABLE) { \ HDassert(msg_type->share_flags & H5O_SHARE_IS_SHARABLE); \ H5O_UPDATE_SHARED((H5O_shared_t *)(MSG)->native, H5O_SHARE_TYPE_HERE, (F), msg_type->id, (MSG)->crt_idx, (OH)->chunk[0].addr) \ @@ -292,9 +292,9 @@ struct H5O_t { * versions of the library) */ #endif /* H5O_ENABLE_BAD_MESG_COUNT */ -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD size_t ndecode_dirtied; /* Number of messages dirtied by decoding */ -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ /* Chunk management information (not stored) */ size_t rc; /* Reference count of [continuation] chunks using this structure */ diff --git a/src/H5SM.c b/src/H5SM.c index d5ede7e..f2d883d 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -527,16 +527,17 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) if(H5HF_get_heap_addr(fheap, &(header->heap_addr)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGETSIZE, FAIL, "can't get fractal heap address") -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD { size_t fheap_id_len; /* Size of a fractal heap ID */ /* Sanity check ID length */ if(H5HF_get_id_len(fheap, &fheap_id_len) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length") - HDassert(fheap_id_len == H5O_FHEAP_ID_LEN); + if(fheap_id_len != H5O_FHEAP_ID_LEN) + HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "incorrect fractal heap ID length") } -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ done: /* Release resources */ @@ -1057,7 +1058,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, unsigned cache_flags = H5AC__NO_FLAGS_SET; ssize_t index_num; htri_t tri_ret; -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD unsigned deferred_type = -1u; #endif htri_t ret_value = TRUE; @@ -1069,13 +1070,13 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, * holds true; otherwise we can leave now if it wasn't shared in the DEFER * pass. */ if(defer_flags & H5SM_WAS_DEFERRED) -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD deferred_type = ((H5O_shared_t *)mesg)->type; -#else /* NDEBUG */ +#else /* H5_DEBUG_BUILD */ if((((H5O_shared_t *)mesg)->type != H5O_SHARE_TYPE_HERE) && (((H5O_shared_t *)mesg)->type != H5O_SHARE_TYPE_SOHM)) HGOTO_DONE(FALSE); -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ /* "trivial" sharing checks */ if(mesg_flags && (*mesg_flags & H5O_MSG_FLAG_DONTSHARE)) @@ -1130,16 +1131,18 @@ done: HDassert((ret_value != TRUE) || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_HERE || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_SOHM); -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD /* If we previously deferred this operation, make sure the saved message - * type is the same as the one we get here. */ + * type is the same as the one we get here. + */ if(defer_flags & H5SM_WAS_DEFERRED) - HDassert(deferred_type == ((H5O_shared_t *)mesg)->type); -#endif /* NDEBUG */ + if(deferred_type != ((H5O_shared_t *)mesg)->type) + HDONE_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "deferred type doesn't match") +#endif /* H5_DEBUG_BUILD */ /* Release the master SOHM table */ if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") + HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* end H5SM_try_share() */ diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index d075127..01beee6 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -26,13 +26,6 @@ #ifndef _H5Tpkg_H #define _H5Tpkg_H -/* - * Define this to enable debugging. - */ -#ifdef NDEBUG -# undef H5T_DEBUG -#endif - /* Get package's private header */ #include "H5Tprivate.h" diff --git a/src/H5private.h b/src/H5private.h index ca4ebcf..d2c02e1 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1559,20 +1559,20 @@ extern char *strdup(const char *s); /* * A macro for detecting over/under-flow when casting between types */ -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD #define H5_CHECK_OVERFLOW(var, vartype, casttype) \ { \ casttype _tmp_overflow = (casttype)(var); \ HDassert((var) == (vartype)_tmp_overflow); \ } -#else /* NDEBUG */ +#else /* H5_DEBUG_BUILD */ #define H5_CHECK_OVERFLOW(var, vartype, casttype) -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ /* * A macro for detecting over/under-flow when assigning between types */ -#ifndef NDEBUG +#ifdef H5_DEBUG_BUILD #define ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) \ { \ srctype _tmp_src = (srctype)(src); \ @@ -1626,10 +1626,10 @@ extern char *strdup(const char *s); #define H5_CHECKED_ASSIGN(dst, dsttype, src, srctype) \ H5_GLUE4(ASSIGN_,srctype,_TO_,dsttype)(dst,dsttype,src,srctype)\ -#else /* NDEBUG */ +#else /* H5_DEBUG_BUILD */ #define H5_CHECKED_ASSIGN(dst, dsttype, src, srctype) \ (dst) = (dsttype)(src); -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ #if defined(H5_HAVE_WINDOW_PATH) @@ -1974,23 +1974,23 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ #define H5_PACKAGE_INIT(pkg_init, err) #endif /* H5_MY_PKG */ - -#ifndef NDEBUG +/* Check the function name (requires assert()) */ +#if defined(H5_DEBUG_BUILD) && !defined(NDEBUG) #define FUNC_ENTER_CHECK_NAME(asrt) \ { \ static hbool_t func_check = FALSE; \ \ if(!func_check) { \ /* Check function naming status */ \ - HDassert(asrt && "Function naming conventions are incorrect - check H5_IS_API|PUB|PRIV|PKG macros in H5private.h (this is usually due to an incorrect number of underscores)"); \ + HDassert(asrt && "Function naming conventions are incorrect - check H5_IS_API|PUB|PRIV|PKG macros in H5private.h (this is usually due to an incorrect number of underscores in a new or changed function name)"); \ \ /* Don't check again */ \ func_check = TRUE; \ } /* end if */ \ } /* end scope */ -#else /* NDEBUG */ +#else /* H5_DEBUG_BUILD */ #define FUNC_ENTER_CHECK_NAME(asrt) -#endif /* NDEBUG */ +#endif /* H5_DEBUG_BUILD */ #define FUNC_ENTER_COMMON(asrt) \ -- cgit v0.12 From d2c7df4ac005e461df3a486791560821ab7b4585 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 29 Jun 2017 14:43:10 -0700 Subject: Revert "Partial removal of NDEBUG ifdefs from the library." This reverts commit a2b7560aa6fa960b2aecddeab331b2b13d485d4f. --- src/H5.c | 4 ++-- src/H5ACprivate.h | 4 ++-- src/H5Aint.c | 5 ++++- src/H5Apkg.h | 7 +++++++ src/H5B.c | 10 ++++++++-- src/H5Bprivate.h | 10 +++++++--- src/H5Cpkg.h | 6 +++--- src/H5Cprivate.h | 24 ++++++++++++------------ src/H5Dvirtual.c | 7 +++---- src/H5EA.c | 13 +++++-------- src/H5Fio.c | 4 ++-- src/H5Fpkg.h | 9 +++++++++ src/H5HLprivate.h | 7 +++++++ src/H5Oalloc.c | 7 +++---- src/H5Opkg.h | 14 +++++++------- src/H5SM.c | 27 ++++++++++++--------------- src/H5Tpkg.h | 7 +++++++ src/H5private.h | 22 +++++++++++----------- 18 files changed, 111 insertions(+), 76 deletions(-) diff --git a/src/H5.c b/src/H5.c index 6d1c2d8..1068fc6 100644 --- a/src/H5.c +++ b/src/H5.c @@ -359,9 +359,9 @@ H5_term_library(void) if(func) { fprintf(stderr, "HDF5: infinite loop closing library\n"); fprintf(stderr, " %s\n", loop); -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG HDabort(); -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ } /* end if */ } /* end if */ diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 02fd36f..b9e2a60 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -485,7 +485,7 @@ H5_DLL herr_t H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr); /* Debugging functions */ H5_DLL herr_t H5AC_stats(const H5F_t *f); -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG H5_DLL herr_t H5AC_dump_cache(const H5F_t *f); H5_DLL herr_t H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, void **entry_ptr_ptr); @@ -496,7 +496,7 @@ H5_DLL herr_t H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, hbool_t *type_ok_ptr); H5_DLL hbool_t H5AC_get_serialization_in_progress(H5F_t *f); H5_DLL hbool_t H5AC_cache_is_clean(const H5F_t *f, H5AC_ring_t inner_ring); -#endif /* H5_DEBUG_BUILD */ /* end debugging functions */ +#endif /* NDEBUG */ /* end debugging functions */ #endif /* !_H5ACprivate_H */ diff --git a/src/H5Aint.c b/src/H5Aint.c index f3654ef..160c7fb 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -314,7 +314,7 @@ H5A__open_common(const H5G_loc_t *loc, H5A_t *attr) HDassert(loc); HDassert(attr); -#if defined(H5_USING_MEMCHECKER) || defined(H5_DEBUG_BUILD) +#if defined(H5_USING_MEMCHECKER) || !defined(NDEBUG) /* Clear object location */ if(H5O_loc_reset(&(attr->oloc)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to reset location") @@ -1710,7 +1710,10 @@ H5A_attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, break; default: + HDassert("unknown attribute op type" && 0); +#ifdef NDEBUG HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unsupported attribute op type") +#endif /* NDEBUG */ } /* end switch */ /* Increment the number of entries passed through */ diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 961c102..6d5a83a 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -26,6 +26,13 @@ #ifndef _H5Apkg_H #define _H5Apkg_H +/* + * Define this to enable debugging. + */ +#ifdef NDEBUG +# undef H5A_DEBUG +#endif + /* Get package's private header */ #include "H5Aprivate.h" diff --git a/src/H5B.c b/src/H5B.c index 724182e..e64a695 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -991,8 +991,14 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "internal error: likely corrupt key values") #endif /* H5_STRICT_FORMAT_CHECKS */ } else if(cmp) { - /* We couldn't determine which branch to follow out of this node. */ - HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "unable to find a way out of this node") + /* + * We couldn't figure out which branch to follow out of this node. THIS + * IS A MAJOR PROBLEM THAT NEEDS TO BE FIXED --rpm. + */ + HDassert("INTERNAL HDF5 ERROR (contact rpm)" && 0); +#ifdef NDEBUG + HDabort(); +#endif /* NDEBUG */ } else if(bt->level > 0) { /* * Follow a branch out of this node to another subtree. diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index 0dcc924..cb038ec 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -39,10 +39,14 @@ /**************************/ /* - * NOTE: Define H5B_DEBUG if you want to check B-tree consistency - * after each B-tree operation. Note that this slows down the - * library considerably! + * Feature: Define this constant if you want to check B-tree consistency + * after each B-tree operation. Note that this slows down the + * library considerably! Debugging the B-tree depends on assert() + * being enabled. */ +#ifdef NDEBUG +# undef H5B_DEBUG +#endif /****************************/ diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 00e0d62..fdb14a5 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -4670,7 +4670,7 @@ typedef struct H5C_tag_info_t { * get_entry_ptr_from_addr_counter: Counter used to track the number of * times the H5C_get_entry_ptr_from_addr() function has been * called successfully. This field is only defined when - * H5_DEBUG_BUILD is #defined. + * NDEBUG is not #defined. * ****************************************************************************/ struct H5C_t { @@ -4903,9 +4903,9 @@ struct H5C_t { char prefix[H5C__PREFIX_LEN]; -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG int64_t get_entry_ptr_from_addr_counter; -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ }; /* Define typedef for tagged cache entry iteration callbacks */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 2b60147..5335f80 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -207,20 +207,20 @@ #define H5C__UPDATE_PAGE_BUFFER_FLAG 0x40000 /* Set during parallel I/O */ /* Debugging/sanity checking/statistics settings */ -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG #define H5C_DO_SANITY_CHECKS 1 #define H5C_DO_SLIST_SANITY_CHECKS 0 #define H5C_DO_TAGGING_SANITY_CHECKS 1 #define H5C_DO_EXTREME_SANITY_CHECKS 0 -#else /* H5_DEBUG_BUILD */ +#else /* NDEBUG */ /* With rare execptions, the following defines should be set - * to 0 if not using a debug build. + * to 0 if NDEBUG is defined */ #define H5C_DO_SANITY_CHECKS 0 #define H5C_DO_SLIST_SANITY_CHECKS 0 #define H5C_DO_TAGGING_SANITY_CHECKS 0 #define H5C_DO_EXTREME_SANITY_CHECKS 0 -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ /* Cork actions: cork/uncork/get cork status of an object */ #define H5C__SET_CORK 0x1 @@ -242,11 +242,11 @@ * debug mode, and 0 in production mode.. */ -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG #define H5C_COLLECT_CACHE_STATS 1 -#else /* H5_DEBUG_BUILD */ +#else /* NDEBUG */ #define H5C_COLLECT_CACHE_STATS 0 -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ /* H5C_COLLECT_CACHE_ENTRY_STATS controls collection of statistics * in individual cache entries. @@ -1559,7 +1559,7 @@ typedef int H5C_ring_t; * a single cache serialization. * * This is a debugging field, and thus is maintained only if - * H5_DEBUG_BUILD is defined. + * NDEBUG is undefined. * * Fields supporting tagged entries: * @@ -1669,9 +1669,9 @@ typedef struct H5C_cache_entry_t { int32_t age; hbool_t prefetched_dirty; -#ifdef H5_DEBUG_BUILD /* debugging field */ +#ifndef NDEBUG /* debugging field */ int serialization_count; -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ /* fields supporting tag lists */ struct H5C_cache_entry_t *tl_next; @@ -2332,7 +2332,7 @@ H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, hid_t dxpl_id, unsigned ce_arr haddr_t *ce_array_ptr); #endif /* H5_HAVE_PARALLEL */ -#ifdef H5_DEBUG_BUILD /* debugging functions */ +#ifndef NDEBUG /* debugging functions */ H5_DLL herr_t H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name); H5_DLL herr_t H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name); H5_DLL hbool_t H5C_get_serialization_in_progress(const H5C_t *cache_ptr); @@ -2349,7 +2349,7 @@ H5_DLL herr_t H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_class_t *expected_type, hbool_t *in_cache_ptr, hbool_t *type_ok_ptr); H5_DLL herr_t H5C_validate_index_list(H5C_t *cache_ptr); -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ #endif /* !_H5Cprivate_H */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index a864729..3be2353 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -2510,7 +2510,7 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, type_info->mem_type, fill_space, io_info->md_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "filling buf failed") -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG /* Make sure the total number of elements written (including fill * values) >= nelmts */ { @@ -2523,10 +2523,9 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Verify number of elements is correct. Note that since we * don't check for overlap we can't assert that these are equal */ - if((tot_nelmts + (hsize_t)select_nelmts) < nelmts) - HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "number of elements is incorrect") + HDassert((tot_nelmts + (hsize_t)select_nelmts) >= nelmts); } /* end block */ -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ } /* end if */ } /* end if */ diff --git a/src/H5EA.c b/src/H5EA.c index ae11077..c524d49 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -877,7 +877,7 @@ H5EA_close(H5EA_t *ea, hid_t dxpl_id)) if(pending_delete) { H5EA_hdr_t *hdr; /* Another pointer to extensible array header */ -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG { unsigned hdr_status = 0; /* Header's status in the metadata cache */ @@ -886,14 +886,11 @@ H5EA_close(H5EA_t *ea, hid_t dxpl_id)) H5E_THROW(H5E_CANTGET, "unable to check metadata cache status for extensible array header") /* Sanity checks on header */ - if(!(hdr_status & H5AC_ES__IN_CACHE)) - H5E_THROW(H5E_BADVALUE, "extensible array header not in cache") - if(!(hdr_status & H5AC_ES__IS_PINNED)) - H5E_THROW(H5E_BADVALUE, "extensible array header not pinned") - if(hdr_status & H5AC_ES__IS_PROTECTED) - H5E_THROW(H5E_BADVALUE, "extensible array header is incorrectly protected") + HDassert(hdr_status & H5AC_ES__IN_CACHE); + HDassert(hdr_status & H5AC_ES__IS_PINNED); + HDassert(!(hdr_status & H5AC_ES__IS_PROTECTED)); } -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ /* Lock the array header into memory */ /* (OK to pass in NULL for callback context, since we know the header must be in the cache) */ diff --git a/src/H5Fio.c b/src/H5Fio.c index 2dc0b70..81fa514 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -298,7 +298,7 @@ H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id) if(H5AC_evict(f, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "unable to evict all except pinned entries") -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG { unsigned status = 0; uint32_t cur_num_entries; @@ -319,7 +319,7 @@ H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id) if(cur_num_entries != 1) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "number of cache entries is not correct") } -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ done: FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 2fde183..7a5c126 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -43,6 +43,15 @@ #include "H5PBprivate.h" /* Page buffer */ #include "H5UCprivate.h" /* Reference counted object functions */ + +/* + * Feature: Define this constant on the compiler command-line if you want to + * see some debugging messages on the debug stream. + */ +#ifdef NDEBUG +# undef H5F_DEBUG +#endif + /* Superblock status flags */ #define H5F_SUPER_WRITE_ACCESS 0x01 #define H5F_SUPER_FILE_OK 0x02 diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index 5ada884..054d396 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -32,6 +32,13 @@ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Fprivate.h" /* File access */ +/* + * Feature: Define H5HL_DEBUG on the compiler command line if you want to + * enable diagnostic messages from this layer. + */ +#ifdef NDEBUG +# undef H5HL_DEBUG +#endif #define H5HL_ALIGN(X) ((((unsigned)X)+7)&(unsigned)(~0x07)) /* align on 8-byte boundary */ diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 945c8ca..3512d3e 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -127,7 +127,7 @@ H5O_add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, hbool_t *chk_dirtied, HDassert(new_gap_loc); HDassert(new_gap_size); -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG if(chunkno > 0) { unsigned chk_proxy_status = 0; /* Object header chunk proxy entry cache status */ @@ -136,10 +136,9 @@ if(chunkno > 0) { HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check metadata cache status for object header chunk proxy") /* Make certain that object header is protected */ - if(!(chk_proxy_status & H5AC_ES__IS_PROTECTED)) - HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "chunk proxy is not protected") + HDassert(chk_proxy_status & H5AC_ES__IS_PROTECTED); } /* end if */ -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ /* Check for existing null message in chunk */ merged_with_null = FALSE; diff --git a/src/H5Opkg.h b/src/H5Opkg.h index e0fd496..b0c67d1 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -171,11 +171,11 @@ #define H5O_DECODEIO_DIRTY 0x02u /* OUT: message has been changed */ /* Macro to incremend ndecode_dirtied (only if we are debugging) */ -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG #define INCR_NDECODE_DIRTIED(OH) (OH)->ndecode_dirtied++; -#else /* H5_DEBUG_BUILD */ +#else /* NDEBUG */ #define INCR_NDECODE_DIRTIED(OH) ; -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ /* Load native information for a message, if it's not already present */ /* (Only works for messages with decode callback) */ @@ -193,11 +193,11 @@ if((ioflags & H5O_DECODEIO_DIRTY) && (H5F_get_intent((F)) & H5F_ACC_RDWR)) { \ (MSG)->dirty = TRUE; \ /* Increment the count of messages dirtied by decoding, but */ \ - /* only debugging */ \ + /* only ifndef NDEBUG */ \ INCR_NDECODE_DIRTIED(OH) \ } \ \ - /* Set the message's "shared info", if it's shareable */ \ + /* Set the message's "shared info", if it's shareable */ \ if((MSG)->flags & H5O_MSG_FLAG_SHAREABLE) { \ HDassert(msg_type->share_flags & H5O_SHARE_IS_SHARABLE); \ H5O_UPDATE_SHARED((H5O_shared_t *)(MSG)->native, H5O_SHARE_TYPE_HERE, (F), msg_type->id, (MSG)->crt_idx, (OH)->chunk[0].addr) \ @@ -292,9 +292,9 @@ struct H5O_t { * versions of the library) */ #endif /* H5O_ENABLE_BAD_MESG_COUNT */ -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG size_t ndecode_dirtied; /* Number of messages dirtied by decoding */ -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ /* Chunk management information (not stored) */ size_t rc; /* Reference count of [continuation] chunks using this structure */ diff --git a/src/H5SM.c b/src/H5SM.c index f2d883d..d5ede7e 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -527,17 +527,16 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) if(H5HF_get_heap_addr(fheap, &(header->heap_addr)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGETSIZE, FAIL, "can't get fractal heap address") -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG { size_t fheap_id_len; /* Size of a fractal heap ID */ /* Sanity check ID length */ if(H5HF_get_id_len(fheap, &fheap_id_len) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length") - if(fheap_id_len != H5O_FHEAP_ID_LEN) - HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "incorrect fractal heap ID length") + HDassert(fheap_id_len == H5O_FHEAP_ID_LEN); } -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ done: /* Release resources */ @@ -1058,7 +1057,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, unsigned cache_flags = H5AC__NO_FLAGS_SET; ssize_t index_num; htri_t tri_ret; -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG unsigned deferred_type = -1u; #endif htri_t ret_value = TRUE; @@ -1070,13 +1069,13 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, * holds true; otherwise we can leave now if it wasn't shared in the DEFER * pass. */ if(defer_flags & H5SM_WAS_DEFERRED) -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG deferred_type = ((H5O_shared_t *)mesg)->type; -#else /* H5_DEBUG_BUILD */ +#else /* NDEBUG */ if((((H5O_shared_t *)mesg)->type != H5O_SHARE_TYPE_HERE) && (((H5O_shared_t *)mesg)->type != H5O_SHARE_TYPE_SOHM)) HGOTO_DONE(FALSE); -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ /* "trivial" sharing checks */ if(mesg_flags && (*mesg_flags & H5O_MSG_FLAG_DONTSHARE)) @@ -1131,18 +1130,16 @@ done: HDassert((ret_value != TRUE) || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_HERE || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_SOHM); -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG /* If we previously deferred this operation, make sure the saved message - * type is the same as the one we get here. - */ + * type is the same as the one we get here. */ if(defer_flags & H5SM_WAS_DEFERRED) - if(deferred_type != ((H5O_shared_t *)mesg)->type) - HDONE_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "deferred type doesn't match") -#endif /* H5_DEBUG_BUILD */ + HDassert(deferred_type == ((H5O_shared_t *)mesg)->type); +#endif /* NDEBUG */ /* Release the master SOHM table */ if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") + HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* end H5SM_try_share() */ diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 01beee6..d075127 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -26,6 +26,13 @@ #ifndef _H5Tpkg_H #define _H5Tpkg_H +/* + * Define this to enable debugging. + */ +#ifdef NDEBUG +# undef H5T_DEBUG +#endif + /* Get package's private header */ #include "H5Tprivate.h" diff --git a/src/H5private.h b/src/H5private.h index d2c02e1..ca4ebcf 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1559,20 +1559,20 @@ extern char *strdup(const char *s); /* * A macro for detecting over/under-flow when casting between types */ -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG #define H5_CHECK_OVERFLOW(var, vartype, casttype) \ { \ casttype _tmp_overflow = (casttype)(var); \ HDassert((var) == (vartype)_tmp_overflow); \ } -#else /* H5_DEBUG_BUILD */ +#else /* NDEBUG */ #define H5_CHECK_OVERFLOW(var, vartype, casttype) -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ /* * A macro for detecting over/under-flow when assigning between types */ -#ifdef H5_DEBUG_BUILD +#ifndef NDEBUG #define ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) \ { \ srctype _tmp_src = (srctype)(src); \ @@ -1626,10 +1626,10 @@ extern char *strdup(const char *s); #define H5_CHECKED_ASSIGN(dst, dsttype, src, srctype) \ H5_GLUE4(ASSIGN_,srctype,_TO_,dsttype)(dst,dsttype,src,srctype)\ -#else /* H5_DEBUG_BUILD */ +#else /* NDEBUG */ #define H5_CHECKED_ASSIGN(dst, dsttype, src, srctype) \ (dst) = (dsttype)(src); -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ #if defined(H5_HAVE_WINDOW_PATH) @@ -1974,23 +1974,23 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ #define H5_PACKAGE_INIT(pkg_init, err) #endif /* H5_MY_PKG */ -/* Check the function name (requires assert()) */ -#if defined(H5_DEBUG_BUILD) && !defined(NDEBUG) + +#ifndef NDEBUG #define FUNC_ENTER_CHECK_NAME(asrt) \ { \ static hbool_t func_check = FALSE; \ \ if(!func_check) { \ /* Check function naming status */ \ - HDassert(asrt && "Function naming conventions are incorrect - check H5_IS_API|PUB|PRIV|PKG macros in H5private.h (this is usually due to an incorrect number of underscores in a new or changed function name)"); \ + HDassert(asrt && "Function naming conventions are incorrect - check H5_IS_API|PUB|PRIV|PKG macros in H5private.h (this is usually due to an incorrect number of underscores)"); \ \ /* Don't check again */ \ func_check = TRUE; \ } /* end if */ \ } /* end scope */ -#else /* H5_DEBUG_BUILD */ +#else /* NDEBUG */ #define FUNC_ENTER_CHECK_NAME(asrt) -#endif /* H5_DEBUG_BUILD */ +#endif /* NDEBUG */ #define FUNC_ENTER_COMMON(asrt) \ -- cgit v0.12 From b6944aeb2abfdab1d0522e065e298945eefa2fe7 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 30 Jun 2017 18:35:09 -0700 Subject: Added a test for VFD IDs to testhdf5. This required adding some code to generate a fake VFD class to pass to H5FDregister(). Also, a bunch of whitespace and comment tidying. --- src/H5FD.c | 279 +++++++++++--------------------------------------------- src/H5Ipublic.h | 34 +++---- test/h5test.c | 100 ++++++++++++++++++++ test/h5test.h | 1 + test/tmisc.c | 69 +++++++++++--- 5 files changed, 226 insertions(+), 257 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index 67cf963..9f62065 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -12,14 +12,11 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Monday, July 26, 1999 - * - * Purpose: The Virtual File Layer as described in documentation. - * This is the greatest common denominator for all types of - * storage access whether a file, memory, network, etc. This - * layer usually just dispatches the request to an actual - * file driver layer. + * Purpose: The Virtual File Layer as described in documentation. + * This is the greatest common denominator for all types of + * storage access whether a file, memory, network, etc. This + * layer usually just dispatches the request to an actual + * file driver layer. */ /****************/ @@ -112,9 +109,6 @@ static const H5I_class_t H5I_VFL_CLS[1] = {{ * Return: Success: Non-negative * Failure: Negative * - * Programmer: Robb Matzke - * Monday, July 26, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -147,9 +141,6 @@ done: * otherwise. * Failure: Never fails. * - * Programmer: Robb Matzke - * Friday, February 19, 1999 - * *------------------------------------------------------------------------- */ int @@ -189,11 +180,6 @@ H5FD_term_package(void) * * Failure: Negative * - * Programmer: Robb Matzke - * Monday, July 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -221,26 +207,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDregister - * - * Purpose: Registers a new file driver as a member of the virtual file - * driver class. Certain fields of the class struct are - * required and that is checked here so it doesn't have to be - * checked every time the field is accessed. - * - * Return: Success: A file driver ID which is good until the - * library is closed or the driver is - * unregistered. + * Function: H5FDregister * - * Failure: A negative value. + * Purpose: Registers a new file driver as a member of the virtual file + * driver class. Certain fields of the class struct are + * required and that is checked here so it doesn't have to be + * checked every time the field is accessed. * - * Programmer: Robb Matzke - * Monday, July 26, 1999 + * Return: Success: A file driver ID which is good until the + * library is closed or the driver is + * unregistered. * - * Modifications: - * Copied guts of function into H5FD_register - * Quincey Koziol - * Friday, January 30, 2004 + * Failure: A negative value. * *------------------------------------------------------------------------- */ @@ -255,18 +233,18 @@ H5FDregister(const H5FD_class_t *cls) /* Check arguments */ if(!cls) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "null class pointer is disallowed") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "null class pointer is disallowed") if(!cls->open || !cls->close) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`open' and/or `close' methods are not defined") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`open' and/or `close' methods are not defined") if(!cls->get_eoa || !cls->set_eoa) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eoa' and/or `set_eoa' methods are not defined") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eoa' and/or `set_eoa' methods are not defined") if(!cls->get_eof) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eof' method is not defined") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eof' method is not defined") if(!cls->read || !cls->write) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`read' and/or `write' method is not defined") - for (type=H5FD_MEM_DEFAULT; typefl_map[type]fl_map[type]>=H5FD_MEM_NTYPES) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid free-list mapping") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`read' and/or `write' method is not defined") + for (type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,type)) + if(cls->fl_map[type] < H5FD_MEM_NOLIST || cls->fl_map[type] >= H5FD_MEM_NTYPES) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid free-list mapping") /* Create the new class ID */ if((ret_value=H5FD_register(cls, sizeof(H5FD_class_t), TRUE)) < 0) @@ -278,29 +256,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_register - * - * Purpose: Registers a new file driver as a member of the virtual file - * driver class. Certain fields of the class struct are - * required and that is checked here so it doesn't have to be - * checked every time the field is accessed. - * - * Return: Success: A file driver ID which is good until the - * library is closed or the driver is - * unregistered. + * Function: H5FD_register * - * Failure: A negative value. + * Purpose: Registers a new file driver as a member of the virtual file + * driver class. Certain fields of the class struct are + * required and that is checked here so it doesn't have to be + * checked every time the field is accessed. * - * Programmer: Robb Matzke - * Monday, July 26, 1999 + * Return: Success: A file driver ID which is good until the + * library is closed or the driver is + * unregistered. * - * Modifications: - * Broke into public and internal routines & added 'size' - * parameter to internal routine, which allows us to create - * sub-classes of H5FD_class_t for internal support (see the - * MPI drivers, etc.) - * Quincey Koziol - * January 30, 2004 + * Failure: A negative value. * *------------------------------------------------------------------------- */ @@ -325,7 +292,7 @@ H5FD_register(const void *_cls, size_t size, hbool_t app_ref) /* Copy the class structure so the caller can reuse or free it */ if(NULL == (saved = (H5FD_class_t *)H5MM_malloc(size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for file driver class struct") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for file driver class struct") HDmemcpy(saved, cls, size); /* Create the new class ID */ @@ -342,19 +309,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDunregister - * - * Purpose: Removes a driver ID from the library. This in no way affects - * file access property lists which have been defined to use - * this driver or files which are already opened under this - * driver. + * Function: H5FDunregister * - * Return: Success: Non-negative + * Purpose: Removes a driver ID from the library. This in no way affects + * file access property lists which have been defined to use + * this driver or files which are already opened under this + * driver. * - * Failure: Negative + * Return: Success: Non-negative * - * Programmer: Robb Matzke - * Monday, July 26, 1999 + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -394,9 +358,6 @@ done: * * Failure: NULL * - * Programmer: Robb Matzke - * Friday, August 20, 1999 - * *------------------------------------------------------------------------- */ H5FD_class_t * @@ -442,11 +403,6 @@ done: * Failure: 0 if an error occurs or if the driver has no * data to store in the superblock. * - * Programmer: Robb Matzke - * Monday, August 16, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ hsize_t @@ -480,11 +436,6 @@ done: * * Failure: Negative * - * Programmer: Robb Matzke - * Monday, August 16, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -511,9 +462,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Robb Matzke - * Monday, August 16, 1999 - * *------------------------------------------------------------------------- */ static herr_t @@ -542,9 +490,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Friday, July 19, 2013 - * *------------------------------------------------------------------------- */ herr_t @@ -592,9 +537,6 @@ done: * Failure: NULL, including when the file has no * properties. * - * Programmer: Robb Matzke - * Friday, August 13, 1999 - * *------------------------------------------------------------------------- */ void * @@ -622,9 +564,6 @@ done: * Return: Success: non-negative * Failure: negative * - * Programmer: Robb Matzke - * Tuesday, August 3, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -706,11 +645,6 @@ done: * * Failure: NULL * - * Programmer: Robb Matzke - * Tuesday, July 27, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ H5FD_t * @@ -745,16 +679,6 @@ done: * * Failure: NULL * - * Programmer: Robb Matzke - * Wednesday, August 4, 1999 - * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ H5FD_t * @@ -861,9 +785,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Robb Matzke - * Tuesday, July 27, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -893,9 +814,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Robb Matzke - * Wednesday, August 4, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -944,11 +862,6 @@ done: * comparison callback then the file pointers * themselves are compared. * - * Programmer: Robb Matzke - * Tuesday, July 27, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -975,11 +888,6 @@ done: * * Failure: Must never fail. * - * Programmer: Robb Matzke - * Wednesday, August 4, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -1025,11 +933,6 @@ done: * * Failure: negative * - * Programmer: Quincey Koziol - * Friday, August 25, 2000 - * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -1059,9 +962,6 @@ done: * * Failure: negative * - * Programmer: Quincey Koziol - * Friday, August 25, 2000 - * *------------------------------------------------------------------------- */ static int @@ -1118,9 +1018,6 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) * * Failure: The undefined address HADDR_UNDEF * - * Programmer: Robb Matzke - * Tuesday, July 27, 1999 - * *------------------------------------------------------------------------- */ haddr_t @@ -1170,11 +1067,6 @@ done: * * Failure: Negative * - * Programmer: Robb Matzke - * Wednesday, July 28, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -1207,16 +1099,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDget_eoa - * - * Purpose: Returns the address of the first byte after the last - * allocated memory in the file. + * Function: H5FDget_eoa * - * Return: Success: First byte after allocated memory. - * Failure: HADDR_UNDEF + * Purpose: Returns the address of the first byte after the last + * allocated memory in the file. * - * Programmer: Robb Matzke - * Friday, July 30, 1999 + * Return: Success: First byte after allocated memory. + * Failure: HADDR_UNDEF * *------------------------------------------------------------------------- */ @@ -1230,13 +1119,13 @@ H5FDget_eoa(H5FD_t *file, H5FD_mem_t type) /* Check args */ if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") if(type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file type") /* The real work */ if(HADDR_UNDEF == (ret_value = H5FD_get_eoa(file, type))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eoa request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eoa request failed") /* (Note compensating for base address subtraction in internal routine) */ ret_value += file->base_addr; @@ -1265,9 +1154,6 @@ done: * Return: Success: Non-negative * Failure: Negative, no side effect * - * Programmer: Robb Matzke - * Friday, July 30, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -1280,16 +1166,16 @@ H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr) /* Check args */ if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") if(type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file type") if(!H5F_addr_defined(addr) || addr > file->maxaddr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid end-of-address value") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid end-of-address value") /* The real work */ /* (Note compensating for base address addition in internal routine) */ if(H5FD_set_eoa(file, type, addr - file->base_addr) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file set eoa request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file set eoa request failed") done: FUNC_LEAVE_API(ret_value) @@ -1315,11 +1201,6 @@ done: * * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke - * Thursday, July 29, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ haddr_t @@ -1332,11 +1213,11 @@ H5FDget_eof(H5FD_t *file, H5FD_mem_t type) /* Check arguments */ if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") /* The real work */ if(HADDR_UNDEF == (ret_value = H5FD_get_eof(file, type))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed") /* (Note compensating for base address subtraction in internal routine) */ ret_value += file->base_addr; @@ -1354,9 +1235,6 @@ done: * Return: Success: The maximum address allowed in the file. * Failure: HADDR_UNDEF * - * Programmer: Quincey Koziol - * Thursday, January 3, 2008 - * *------------------------------------------------------------------------- */ haddr_t @@ -1384,9 +1262,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Tuesday, January 8, 2008 - * *------------------------------------------------------------------------- */ herr_t @@ -1412,8 +1287,6 @@ H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags) * Return: Success: Non-negative * Failure: Negative * - * Programmer: Vailin Choi; Oct 2013 - * *------------------------------------------------------------------------- */ herr_t @@ -1438,9 +1311,6 @@ H5FD_set_feature_flags(H5FD_t *file, unsigned long feature_flags) * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Thursday, January 17, 2008 - * *------------------------------------------------------------------------- */ herr_t @@ -1483,9 +1353,6 @@ done: * * Failure: Negative. The contents of BUF is undefined. * - * Programmer: Robb Matzke - * Thursday, July 29, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -1548,9 +1415,6 @@ done: * * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, July 29, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -1613,10 +1477,6 @@ done: * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Modifications: - * Quincey Koziol, May 20, 2002 - * Added 'closing' parameter - * *------------------------------------------------------------------------- */ herr_t @@ -1653,9 +1513,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Robb Matzke - * Wednesday, August 4, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -1683,9 +1540,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Thursday, January 31, 2008 - * *------------------------------------------------------------------------- */ herr_t @@ -1722,9 +1576,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Thursday, January 31, 2008 - * *------------------------------------------------------------------------- */ herr_t @@ -1752,8 +1603,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Vailin Choi; March 2015 - * *------------------------------------------------------------------------- */ herr_t @@ -1786,8 +1635,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Vailin Choi; May 2013 - * *------------------------------------------------------------------------- */ herr_t @@ -1815,8 +1662,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Vailin Choi; March 2015 - * *------------------------------------------------------------------------- */ herr_t @@ -1848,8 +1693,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Vailin Choi; May 2013 - * *------------------------------------------------------------------------- */ herr_t @@ -1878,9 +1721,6 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * March 27, 2002 - * *------------------------------------------------------------------------- */ herr_t @@ -1909,8 +1749,6 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum) * Programmer: Raymond Lu * Sep. 16, 2002 * - * Modifications: - * *-------------------------------------------------------------------------- */ herr_t @@ -1972,9 +1810,6 @@ done: * * Return: Non-negative if succeed; negative if fails. * - * Programmer: Quincey Koziol - * Jan. 17, 2008 - * *-------------------------------------------------------------------------- */ herr_t @@ -2000,9 +1835,6 @@ H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr) * Return: Success: The absolute base address of the file * Failure: The undefined address (HADDR_UNDEF) * - * Programmer: Quincey Koziol - * Sept. 10, 2009 - * *-------------------------------------------------------------------------- */ haddr_t @@ -2024,8 +1856,6 @@ H5FD_get_base_addr(const H5FD_t *file) * * Return: Non-negative if succeed; negative if fails. * - * Programmer: Vailin Choi; April 2013 - * *-------------------------------------------------------------------------- */ herr_t @@ -2052,9 +1882,6 @@ H5FD_set_paged_aggr(H5FD_t *file, hbool_t paged) * * Return: SUCCEED/FAIL * -* Programmer: Jacob Gruber -* Wednesday, August 17, 2011 -* *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 896f82f..831874b 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -28,26 +28,26 @@ * fail otherwise). * * When adding types here, add a section to the 'misc19' test in test/tmisc.c - * to verify that the H5I{inc|dec|get}_ref() routines work correctly with in. + * to verify that the H5I{inc|dec|get}_ref() routines work correctly with it. * */ typedef enum H5I_type_t { - H5I_UNINIT = (-2), /*uninitialized type */ - H5I_BADID = (-1), /*invalid Type */ - H5I_FILE = 1, /*type ID for File objects */ - H5I_GROUP, /*type ID for Group objects */ - H5I_DATATYPE, /*type ID for Datatype objects */ - H5I_DATASPACE, /*type ID for Dataspace objects */ - H5I_DATASET, /*type ID for Dataset objects */ - H5I_ATTR, /*type ID for Attribute objects */ - H5I_REFERENCE, /*type ID for Reference objects */ - H5I_VFL, /*type ID for virtual file layer */ - H5I_GENPROP_CLS, /*type ID for generic property list classes */ - H5I_GENPROP_LST, /*type ID for generic property lists */ - H5I_ERROR_CLASS, /*type ID for error classes */ - H5I_ERROR_MSG, /*type ID for error messages */ - H5I_ERROR_STACK, /*type ID for error stacks */ - H5I_NTYPES /*number of library types, MUST BE LAST! */ + H5I_UNINIT = (-2), /* uninitialized type */ + H5I_BADID = (-1), /* invalid Type */ + H5I_FILE = 1, /* type ID for File objects */ + H5I_GROUP, /* type ID for Group objects */ + H5I_DATATYPE, /* type ID for Datatype objects */ + H5I_DATASPACE, /* type ID for Dataspace objects */ + H5I_DATASET, /* type ID for Dataset objects */ + H5I_ATTR, /* type ID for Attribute objects */ + H5I_REFERENCE, /* type ID for Reference objects */ + H5I_VFL, /* type ID for virtual file layer */ + H5I_GENPROP_CLS, /* type ID for generic property list classes */ + H5I_GENPROP_LST, /* type ID for generic property lists */ + H5I_ERROR_CLASS, /* type ID for error classes */ + H5I_ERROR_MSG, /* type ID for error messages */ + H5I_ERROR_STACK, /* type ID for error stacks */ + H5I_NTYPES /* number of library types, MUST BE LAST! */ } H5I_type_t; /* Type of atoms to return to users */ diff --git a/test/h5test.c b/test/h5test.c index 8db4388..af45589 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -104,6 +104,68 @@ static herr_t h5_errors(hid_t estack, void *client_data); static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix, char *fullname, size_t size, hbool_t nest_printf); + + +/* A non-usable VFD class and its functions. + * + * Usable for testing things like ID handling where we shouldn't mess with the real VFDs. + */ +static H5FD_t *dummy_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); +static H5FD_t *dummy_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { return NULL; } + +static herr_t dummy_vfd_close(H5FD_t *_file); +static herr_t dummy_vfd_close(H5FD_t H5_ATTR_UNUSED *_file) { return FAIL; } + +static haddr_t dummy_vfd_get_eoa(const H5FD_t *file, H5FD_mem_t type); +static haddr_t dummy_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; } + +static herr_t dummy_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static herr_t dummy_vfd_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t H5_ATTR_UNUSED addr) { return FAIL; } + +static haddr_t dummy_vfd_get_eof(const H5FD_t *file, H5FD_mem_t type); +static haddr_t dummy_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; } + +static herr_t dummy_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); +static herr_t dummy_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf) { return FAIL; } + +static herr_t dummy_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); +static herr_t dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { return FAIL; } + +static H5FD_class_t dummy_vfd_class_g = { + "fake", /* name */ + 1, /* maxaddr */ + H5F_CLOSE_WEAK, /* fc_degree */ + NULL, /* terminate */ + NULL, /* sb_size */ + NULL, /* sb_encode */ + NULL, /* sb_decode */ + 0, /* fapl_size */ + NULL, /* fapl_get */ + NULL, /* fapl_copy */ + NULL, /* fapl_free */ + 0, /* dxpl_size */ + NULL, /* dxpl_copy */ + NULL, /* dxpl_free */ + dummy_vfd_open, /* open */ + dummy_vfd_close, /* close */ + NULL, /* cmp */ + NULL, /* query */ + NULL, /* get_type_map */ + NULL, /* alloc */ + NULL, /* free */ + dummy_vfd_get_eoa, /* get_eoa */ + dummy_vfd_set_eoa, /* set_eoa */ + dummy_vfd_get_eof, /* get_eof */ + NULL, /* get_handle */ + dummy_vfd_read, /* read */ + dummy_vfd_write, /* write */ + NULL, /* flush */ + NULL, /* truncate */ + NULL, /* lock */ + NULL, /* unlock */ + H5FD_FLMAP_DEFAULT /* fl_map */ +}; + /*------------------------------------------------------------------------- * Function: h5_errors @@ -1828,3 +1890,41 @@ error: return FAIL; } /* h5_wait_message() */ +/*------------------------------------------------------------------------- + * Function: h5_get_dummy_vfd_class() + * + * Purpose: Returns a disposable, generally non-functional, + * VFD class struct. + * + * In some of the test code, we need a disposable VFD but + * we don't want to mess with the real VFDs and we also + * don't have access to the internals of the real VFDs (which + * use static globals and functions) to easily duplicate + * them (e.g.: for testing VFD ID handling). + * + * This API call will return a pointer to a VFD class that + * can be used to construct a test VFD using H5FDregister(). + * + * Return: Success: A pointer to a VFD class struct + * Failure: NULL + * + *------------------------------------------------------------------------- + */ +H5FD_class_t * +h5_get_dummy_vfd_class(void) +{ + H5FD_class_t *vfd_class = NULL; + + if(NULL == (vfd_class = (H5FD_class_t *)HDmalloc(sizeof(H5FD_class_t)))) + TEST_ERROR; + + HDmemcpy(vfd_class, &dummy_vfd_class_g, sizeof(H5FD_class_t)); + + return vfd_class; + +error: + if(vfd_class) + HDfree(vfd_class); + return NULL; +} /* h5_get_dummy_vfd_class */ + diff --git a/test/h5test.h b/test/h5test.h index 0e23255..ce5c64d 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -136,6 +136,7 @@ H5TEST_DLL h5_stat_size_t h5_get_file_size(const char *filename, hid_t fapl); H5TEST_DLL int print_func(const char *format, ...); H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_copy_name); H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl); +H5TEST_DLL H5FD_class_t *h5_get_dummy_vfd_class(void); /* Functions that will replace VFD-dependent functions that violate * the single responsibility principle. Unlike their predecessors, diff --git a/test/tmisc.c b/test/tmisc.c index dc69e18..cc6a6aa 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -29,7 +29,7 @@ #include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" -#include "H5Dpkg.h" /* Datasets */ +#include "H5Dpkg.h" /* Datasets */ /* Definitions for misc. test #1 */ #define MISC1_FILE "tmisc1.h5" @@ -2984,19 +2984,21 @@ test_misc18(void) static void test_misc19(void) { - hid_t fid; /* File ID */ - hid_t sid; /* 'Space ID */ - hid_t did; /* Dataset ID */ - hid_t tid; /* 'Type ID */ - hid_t aid; /* Attribute ID */ - hid_t plid; /* Property List ID */ - hid_t pcid; /* Property Class ID */ - hid_t gid; /* Group ID */ - hid_t ecid; /* Error Class ID */ - hid_t emid; /* Error Message ID */ - hid_t esid; /* Error Stack ID */ - int rc; /* Reference count */ - herr_t ret; /* Generic return value */ + hid_t fid = -1; /* File ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hid_t tid = -1; /* Datatype ID */ + hid_t aid = -1; /* Attribute ID */ + hid_t plid = -1; /* Property List ID */ + hid_t pcid = -1; /* Property Class ID */ + hid_t gid = -1; /* Group ID */ + hid_t ecid = -1; /* Error Class ID */ + hid_t emid = -1; /* Error Message ID */ + hid_t esid = -1; /* Error Stack ID */ + hid_t vfdid = -1; /* Virtual File Driver ID */ + H5FD_class_t *vfd_cls = NULL; /* VFD class */ + int rc; /* Reference count */ + herr_t ret; /* Generic return value */ /* Check H5I operations on files */ @@ -3406,6 +3408,45 @@ test_misc19(void) } H5E_END_TRY; VERIFY(ret, FAIL, "H5Eclose_stack"); + +/* Check H5I operations on virtual file drivers */ + + /* Get a VFD class to register */ + vfd_cls = h5_get_dummy_vfd_class(); + CHECK(vfd_cls, NULL, "h5_get_dummy_vfd_class"); + + /* Register a virtual file driver */ + vfdid = H5FDregister(vfd_cls); + CHECK(vfdid, FAIL, "H5FDregister"); + + /* Check the reference count */ + rc = H5Iget_ref(vfdid); + VERIFY(rc, 1, "H5Iget_ref"); + + /* Increment the reference count */ + rc = H5Iinc_ref(vfdid); + VERIFY(rc, 2, "H5Iinc_ref"); + + /* Unregister the VFD normally */ + ret = H5FDunregister(vfdid); + CHECK(ret, FAIL, "H5FDunregister"); + + /* Check the reference count */ + rc = H5Iget_ref(vfdid); + VERIFY(rc, 1, "H5Iget_ref"); + + /* Unregister the VFD by decrementing the reference count */ + rc = H5Idec_ref(vfdid); + VERIFY(rc, 0, "H5Idec_ref"); + + /* Try unregistering the VFD again (should fail) */ + H5E_BEGIN_TRY { + ret = H5FDunregister(vfdid); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5FDunregister"); + +/* Check H5I operations on references */ + } /* end test_misc19() */ /**************************************************************** -- cgit v0.12 From 0d6930d3c2c66798033c3c5c47beb969082fea12 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 30 Jun 2017 20:53:56 -0700 Subject: Purged the unused H5I_REFERENCE from the library. --- c++/src/H5IdComponent.cpp | 2 - java/src/hdf/hdf5lib/HDF5Constants.java | 3 -- java/src/jni/h5Constants.c | 2 - src/H5.c | 1 - src/H5Adeprec.c | 1 - src/H5F.c | 1 - src/H5Fint.c | 1 - src/H5Gloc.c | 3 -- src/H5Gname.c | 1 - src/H5Gtest.c | 1 - src/H5Ipublic.h | 1 - src/H5O.c | 2 - src/H5Oflush.c | 37 ++++++++-------- src/H5R.c | 78 ++------------------------------- src/H5T.c | 1 - src/H5private.h | 1 - src/H5trace.c | 8 ---- test/links.c | 2 - test/tfile.c | 1 - test/tmisc.c | 2 - 20 files changed, 22 insertions(+), 127 deletions(-) diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index f9a08cd..457f594 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -174,7 +174,6 @@ H5I_type_t IdComponent::getHDFObjType() const /// \li \c H5I_DATASPACE /// \li \c H5I_DATASET /// \li \c H5I_ATTR -/// \li \c H5I_REFERENCE /// \li \c H5I_VFL /// \li \c H5I_GENPROP_CLS /// \li \c H5I_GENPROP_LST @@ -227,7 +226,6 @@ bool IdComponent::isValid(hid_t an_id) /// \li \c H5I_DATASPACE /// \li \c H5I_DATASET /// \li \c H5I_ATTR -/// \li \c H5I_REFERENCE /// \li \c H5I_VFL /// \li \c H5I_GENPROP_CLS /// \li \c H5I_GENPROP_LST diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 8a3d6c8..b216d03 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -309,7 +309,6 @@ public class HDF5Constants { public static final int H5I_GROUP = H5I_GROUP(); public static final int H5I_INVALID_HID = H5I_INVALID_HID(); public static final int H5I_NTYPES = H5I_NTYPES(); - public static final int H5I_REFERENCE = H5I_REFERENCE(); public static final int H5I_UNINIT = H5I_UNINIT(); public static final int H5I_VFL = H5I_VFL(); @@ -1196,8 +1195,6 @@ public class HDF5Constants { private static native final int H5I_NTYPES(); - private static native final int H5I_REFERENCE(); - private static native final int H5I_UNINIT(); private static native final int H5I_VFL(); diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index d4511e1..1b97655 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -590,8 +590,6 @@ Java_hdf_hdf5lib_HDF5Constants_H5I_1DATASET(JNIEnv *env, jclass cls) { return H5 JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1ATTR(JNIEnv *env, jclass cls) { return H5I_ATTR; } JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5I_1REFERENCE(JNIEnv *env, jclass cls) { return H5I_REFERENCE; } -JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1VFL(JNIEnv *env, jclass cls) { return H5I_VFL; } JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1INVALID_1HID(JNIEnv *env, jclass cls) { return H5I_INVALID_HID; } diff --git a/src/H5.c b/src/H5.c index 59984dc..f7826d4 100644 --- a/src/H5.c +++ b/src/H5.c @@ -306,7 +306,6 @@ H5_term_library(void) pending += DOWN(A_top); pending += DOWN(D_top); pending += DOWN(G_top); - pending += DOWN(R_top); pending += DOWN(S_top); pending += DOWN(T_top); diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index 9221254..c37dc3c 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -318,7 +318,6 @@ H5Aget_num_attrs(hid_t loc_id) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5F.c b/src/H5F.c index 78fce2a..8131f53 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -679,7 +679,6 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) case H5I_UNINIT: case H5I_BADID: case H5I_DATASPACE: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Fint.c b/src/H5Fint.c index e52d539..512439f 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -452,7 +452,6 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) case H5I_BADID: case H5I_FILE: case H5I_DATASPACE: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Gloc.c b/src/H5Gloc.c index c011cdf..8548b92 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -240,9 +240,6 @@ H5G_loc(hid_t loc_id, H5G_loc_t *loc) } /* end case */ break; - case H5I_REFERENCE: - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of reference") - case H5I_UNINIT: case H5I_BADID: case H5I_VFL: diff --git a/src/H5Gname.c b/src/H5Gname.c index 7b53668..a90821c 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -835,7 +835,6 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 7271cdc..8a7f8c4 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -553,7 +553,6 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 831874b..3ac2257 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -40,7 +40,6 @@ typedef enum H5I_type_t { H5I_DATASPACE, /* type ID for Dataspace objects */ H5I_DATASET, /* type ID for Dataset objects */ H5I_ATTR, /* type ID for Attribute objects */ - H5I_REFERENCE, /* type ID for Reference objects */ H5I_VFL, /* type ID for virtual file layer */ H5I_GENPROP_CLS, /* type ID for generic property list classes */ H5I_GENPROP_LST, /* type ID for generic property lists */ diff --git a/src/H5O.c b/src/H5O.c index 152e6cc..79aaddf 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -1081,7 +1081,6 @@ H5Oclose(hid_t object_id) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: @@ -2628,7 +2627,6 @@ H5O_get_loc(hid_t object_id) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 2d93221..387e0ff 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -370,40 +370,39 @@ H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_ type = H5I_get_type(oid); switch(type) { - case(H5I_GROUP): + case H5I_GROUP: /* Re-open the group */ if(NULL == (object = H5G_open(obj_loc, dxpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") break; - case(H5I_DATATYPE): + case H5I_DATATYPE: /* Re-open the named datatype */ if(NULL == (object = H5T_open(obj_loc, dxpl_id))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype") break; - case(H5I_DATASET): + case H5I_DATASET: /* Re-open the dataset */ if(NULL == (object = H5D_open(obj_loc, H5P_DATASET_ACCESS_DEFAULT, dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") - if(!start_swmr) /* No need to handle multiple opens when H5Fstart_swmr_write() */ - if(H5D_mult_refresh_reopen((H5D_t *)object, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to finish refresh for dataset") + if(!start_swmr) /* No need to handle multiple opens when H5Fstart_swmr_write() */ + if(H5D_mult_refresh_reopen((H5D_t *)object, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to finish refresh for dataset") break; - case(H5I_UNINIT): - case(H5I_BADID): - case(H5I_FILE): - case(H5I_DATASPACE): - case(H5I_ATTR): - case(H5I_REFERENCE): - case(H5I_VFL): - case(H5I_GENPROP_CLS): - case(H5I_GENPROP_LST): - case(H5I_ERROR_CLASS): - case(H5I_ERROR_MSG): - case(H5I_ERROR_STACK): - case(H5I_NTYPES): + case H5I_UNINIT: + case H5I_BADID: + case H5I_FILE: + case H5I_DATASPACE: + case H5I_ATTR: + case H5I_VFL: + case H5I_GENPROP_CLS: + case H5I_GENPROP_LST: + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + case H5I_NTYPES: default: HGOTO_ERROR(H5E_ARGS, H5E_CANTRELEASE, FAIL, "not a valid file object ID (dataset, group, or datatype)") break; diff --git a/src/H5R.c b/src/H5R.c index 73c1d55..dc012e8 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -71,17 +71,6 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /* Local Variables */ /*******************/ -/* Reference ID class */ -static const H5I_class_t H5I_REFERENCE_CLS[1] = {{ - H5I_REFERENCE, /* ID class value */ - 0, /* Class flags */ - 0, /* # of reserved IDs for class */ - NULL /* Callback routine for closing objects of this class */ -}}; - -/* Flag indicating "top" of interface has been initialized */ -static hbool_t H5R_top_package_initialize_s = FALSE; - /*-------------------------------------------------------------------------- @@ -103,13 +92,6 @@ H5R__init_package(void) FUNC_ENTER_NOAPI_NOINIT - /* Initialize the atom group for the file IDs */ - if(H5I_register_type(H5I_REFERENCE_CLS) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to initialize interface") - - /* Mark "top" of interface as initialized, too */ - H5R_top_package_initialize_s = TRUE; - done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__init_package() */ @@ -117,46 +99,6 @@ done: /*-------------------------------------------------------------------------- NAME - H5R_top_term_package - PURPOSE - Terminate various H5R objects - USAGE - void H5R_top_term_package() - RETURNS - void - DESCRIPTION - Release IDs for the atom group, deferring full interface shutdown - until later (in H5R_term_package). - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - Can't report errors... - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -int -H5R_top_term_package(void) -{ - int n = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if(H5R_top_package_initialize_s) { - if(H5I_nmembers(H5I_REFERENCE) > 0) { - (void)H5I_clear_type(H5I_REFERENCE, FALSE, FALSE); - n++; /*H5I*/ - } /* end if */ - - /* Mark closed */ - if(0 == n) - H5R_top_package_initialize_s = FALSE; - } /* end if */ - - FUNC_LEAVE_NOAPI(n) -} /* end H5R_top_term_package() */ - - -/*-------------------------------------------------------------------------- - NAME H5R_term_package PURPOSE Terminate various H5R objects @@ -178,24 +120,12 @@ H5R_top_term_package(void) int H5R_term_package(void) { - int n = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_PKG_INIT_VAR) { - /* Sanity checks */ - HDassert(0 == H5I_nmembers(H5I_REFERENCE)); - HDassert(FALSE == H5R_top_package_initialize_s); - - /* Destroy the reference id group */ - n += (H5I_dec_type_ref(H5I_REFERENCE) > 0); - - /* Mark closed */ - if(0 == n) - H5_PKG_INIT_VAR = FALSE; - } /* end if */ + if(H5_PKG_INIT_VAR) + H5_PKG_INIT_VAR = FALSE; - FUNC_LEAVE_NOAPI(n) + FUNC_LEAVE_NOAPI(0) } /* end H5R_term_package() */ @@ -741,7 +671,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create dataspace") /* Atomize */ - if((ret_value = H5I_register (H5I_DATASPACE, space, TRUE)) < 0) + if((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom") done: diff --git a/src/H5T.c b/src/H5T.c index a525cd5..2f59767 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1673,7 +1673,6 @@ H5Tcopy(hid_t type_id) case H5I_GROUP: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5private.h b/src/H5private.h index ca4ebcf..ff45cec 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2593,7 +2593,6 @@ H5_DLL int H5L_term_package(void); H5_DLL int H5P_term_package(void); H5_DLL int H5PL_term_package(void); H5_DLL int H5R_term_package(void); -H5_DLL int H5R_top_term_package(void); H5_DLL int H5S_term_package(void); H5_DLL int H5S_top_term_package(void); H5_DLL int H5SL_term_package(void); diff --git a/src/H5trace.c b/src/H5trace.c index 9fb8a72..e2a746b 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -1320,10 +1320,6 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "%ld (attr)", (long)obj); break; - case H5I_REFERENCE: - fprintf(out, "%ld (reference)", (long)obj); - break; - case H5I_VFL: fprintf(out, "%ld (file driver)", (long)obj); break; @@ -1501,10 +1497,6 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "H5I_ATTR"); break; - case H5I_REFERENCE: - fprintf(out, "H5I_REFERENCE"); - break; - case H5I_VFL: fprintf(out, "H5I_VFL"); break; diff --git a/test/links.c b/test/links.c index 7b3e37d..2d9bb0d 100644 --- a/test/links.c +++ b/test/links.c @@ -7743,7 +7743,6 @@ done: case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: @@ -7830,7 +7829,6 @@ done: case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/test/tfile.c b/test/tfile.c index 533bb24..20b41e0 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1393,7 +1393,6 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, case H5I_DATATYPE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/test/tmisc.c b/test/tmisc.c index cc6a6aa..587a937 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -3445,8 +3445,6 @@ test_misc19(void) } H5E_END_TRY; VERIFY(ret, FAIL, "H5FDunregister"); -/* Check H5I operations on references */ - } /* end test_misc19() */ /**************************************************************** -- cgit v0.12 From d342358a3b1acd5712b3c136c3985db414f6f673 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 30 Jun 2017 21:06:29 -0700 Subject: Added missing free() call to test_misc19(). --- test/tmisc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/tmisc.c b/test/tmisc.c index 587a937..bec80b2 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -3445,6 +3445,8 @@ test_misc19(void) } H5E_END_TRY; VERIFY(ret, FAIL, "H5FDunregister"); + HDfree(vfd_cls); + } /* end test_misc19() */ /**************************************************************** -- cgit v0.12 From 76b9a0e7eff83db3ed69080f62b95ae568f7129e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Jul 2017 12:54:14 -0700 Subject: * Reverted removal of H5I_REFERENCE to avoid breaking binary compatibility. * Added a quick H5I_REFERENCE smoke check to test_misc19() in tmisc.c. --- c++/src/H5IdComponent.cpp | 2 + c++/src/H5PropList.cpp | 18 ++++++++ java/src/hdf/hdf5lib/HDF5Constants.java | 3 ++ java/src/jni/h5Constants.c | 2 + src/H5.c | 1 + src/H5Adeprec.c | 1 + src/H5F.c | 1 + src/H5Fint.c | 1 + src/H5Gloc.c | 3 ++ src/H5Gname.c | 1 + src/H5Gtest.c | 1 + src/H5I.c | 4 +- src/H5Ipublic.h | 3 ++ src/H5O.c | 2 + src/H5Oflush.c | 1 + src/H5R.c | 76 +++++++++++++++++++++++++++++++-- src/H5T.c | 1 + src/H5private.h | 1 + src/H5trace.c | 8 ++++ test/links.c | 2 + test/tfile.c | 1 + test/tmisc.c | 29 +++++++++++++ 22 files changed, 157 insertions(+), 5 deletions(-) diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 457f594..284c6c5 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -174,6 +174,7 @@ H5I_type_t IdComponent::getHDFObjType() const /// \li \c H5I_DATASPACE /// \li \c H5I_DATASET /// \li \c H5I_ATTR +/// \li \c H5I_REFERENCE (DEPRECATED) /// \li \c H5I_VFL /// \li \c H5I_GENPROP_CLS /// \li \c H5I_GENPROP_LST @@ -226,6 +227,7 @@ bool IdComponent::isValid(hid_t an_id) /// \li \c H5I_DATASPACE /// \li \c H5I_DATASET /// \li \c H5I_ATTR +/// \li \c H5I_REFERENCE (DEPRECATED) /// \li \c H5I_VFL /// \li \c H5I_GENPROP_CLS /// \li \c H5I_GENPROP_LST diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index dd7b21a..16a6316 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -138,6 +138,24 @@ PropList::PropList(const hid_t plist_id) : IdComponent() throw PropListIException("PropList constructor", "H5Pcopy failed"); } break; + /* These should really be error cases, but changing that breaks + * the stated behavior and causes test failures. + * (DER, July 2017) + */ + case H5I_BADID: + case H5I_FILE: + case H5I_GROUP: + case H5I_DATATYPE: + case H5I_DATASPACE: + case H5I_DATASET: + case H5I_ATTR: + case H5I_REFERENCE: + case H5I_VFL: + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + case H5I_NTYPES: + case H5I_UNINIT: default: id = H5P_DEFAULT; break; diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index b216d03..8a3d6c8 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -309,6 +309,7 @@ public class HDF5Constants { public static final int H5I_GROUP = H5I_GROUP(); public static final int H5I_INVALID_HID = H5I_INVALID_HID(); public static final int H5I_NTYPES = H5I_NTYPES(); + public static final int H5I_REFERENCE = H5I_REFERENCE(); public static final int H5I_UNINIT = H5I_UNINIT(); public static final int H5I_VFL = H5I_VFL(); @@ -1195,6 +1196,8 @@ public class HDF5Constants { private static native final int H5I_NTYPES(); + private static native final int H5I_REFERENCE(); + private static native final int H5I_UNINIT(); private static native final int H5I_VFL(); diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index 1b97655..d4511e1 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -590,6 +590,8 @@ Java_hdf_hdf5lib_HDF5Constants_H5I_1DATASET(JNIEnv *env, jclass cls) { return H5 JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1ATTR(JNIEnv *env, jclass cls) { return H5I_ATTR; } JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5I_1REFERENCE(JNIEnv *env, jclass cls) { return H5I_REFERENCE; } +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1VFL(JNIEnv *env, jclass cls) { return H5I_VFL; } JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1INVALID_1HID(JNIEnv *env, jclass cls) { return H5I_INVALID_HID; } diff --git a/src/H5.c b/src/H5.c index f7826d4..59984dc 100644 --- a/src/H5.c +++ b/src/H5.c @@ -306,6 +306,7 @@ H5_term_library(void) pending += DOWN(A_top); pending += DOWN(D_top); pending += DOWN(G_top); + pending += DOWN(R_top); pending += DOWN(S_top); pending += DOWN(T_top); diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index c37dc3c..9221254 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -318,6 +318,7 @@ H5Aget_num_attrs(hid_t loc_id) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5F.c b/src/H5F.c index 8131f53..78fce2a 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -679,6 +679,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) case H5I_UNINIT: case H5I_BADID: case H5I_DATASPACE: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Fint.c b/src/H5Fint.c index 512439f..e52d539 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -452,6 +452,7 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) case H5I_BADID: case H5I_FILE: case H5I_DATASPACE: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 8548b92..c011cdf 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -240,6 +240,9 @@ H5G_loc(hid_t loc_id, H5G_loc_t *loc) } /* end case */ break; + case H5I_REFERENCE: + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of reference") + case H5I_UNINIT: case H5I_BADID: case H5I_VFL: diff --git a/src/H5Gname.c b/src/H5Gname.c index a90821c..7b53668 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -835,6 +835,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 8a7f8c4..7271cdc 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -553,6 +553,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5I.c b/src/H5I.c index 42edf58..b8e47a2 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -451,9 +451,9 @@ H5I_nmembers(H5I_type_t type) FUNC_ENTER_NOAPI(FAIL) if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") if(NULL == (type_ptr = H5I_id_type_list_g[type]) || type_ptr->init_count <= 0) - HGOTO_DONE(0); + HGOTO_DONE(0); /* Set return value */ H5_CHECKED_ASSIGN(ret_value, int64_t, type_ptr->id_count, uint64_t); diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 3ac2257..c737bbe 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -30,6 +30,8 @@ * When adding types here, add a section to the 'misc19' test in test/tmisc.c * to verify that the H5I{inc|dec|get}_ref() routines work correctly with it. * + * NOTE: H5I_REFERENCE is not used by the library and has been deprecated + * with a tentative removal version of 1.12.0. (DER, July 2017) */ typedef enum H5I_type_t { H5I_UNINIT = (-2), /* uninitialized type */ @@ -40,6 +42,7 @@ typedef enum H5I_type_t { H5I_DATASPACE, /* type ID for Dataspace objects */ H5I_DATASET, /* type ID for Dataset objects */ H5I_ATTR, /* type ID for Attribute objects */ + H5I_REFERENCE, /* *DEPRECATED* type ID for Reference objects */ H5I_VFL, /* type ID for virtual file layer */ H5I_GENPROP_CLS, /* type ID for generic property list classes */ H5I_GENPROP_LST, /* type ID for generic property lists */ diff --git a/src/H5O.c b/src/H5O.c index 79aaddf..152e6cc 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -1081,6 +1081,7 @@ H5Oclose(hid_t object_id) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: @@ -2627,6 +2628,7 @@ H5O_get_loc(hid_t object_id) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 387e0ff..9764f56 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -396,6 +396,7 @@ H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_ case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5R.c b/src/H5R.c index dc012e8..c2a10ce 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -71,6 +71,17 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /* Local Variables */ /*******************/ +/* Reference ID class */ +static const H5I_class_t H5I_REFERENCE_CLS[1] = {{ + H5I_REFERENCE, /* ID class value */ + 0, /* Class flags */ + 0, /* # of reserved IDs for class */ + NULL /* Callback routine for closing objects of this class */ +}}; + +/* Flag indicating "top" of interface has been initialized */ +static hbool_t H5R_top_package_initialize_s = FALSE; + /*-------------------------------------------------------------------------- @@ -92,6 +103,13 @@ H5R__init_package(void) FUNC_ENTER_NOAPI_NOINIT +/* Initialize the atom group for the file IDs */ + if(H5I_register_type(H5I_REFERENCE_CLS) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to initialize interface") + + /* Mark "top" of interface as initialized, too */ + H5R_top_package_initialize_s = TRUE; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__init_package() */ @@ -99,6 +117,46 @@ done: /*-------------------------------------------------------------------------- NAME + H5R_top_term_package + PURPOSE + Terminate various H5R objects + USAGE + void H5R_top_term_package() + RETURNS + void + DESCRIPTION + Release IDs for the atom group, deferring full interface shutdown + until later (in H5R_term_package). + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Can't report errors... + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +int +H5R_top_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5R_top_package_initialize_s) { + if(H5I_nmembers(H5I_REFERENCE) > 0) { + (void)H5I_clear_type(H5I_REFERENCE, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ + + /* Mark closed */ + if(0 == n) + H5R_top_package_initialize_s = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* end H5R__init_package() */ + + +/*-------------------------------------------------------------------------- + NAME H5R_term_package PURPOSE Terminate various H5R objects @@ -120,12 +178,24 @@ done: int H5R_term_package(void) { + int n = 0; + FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_PKG_INIT_VAR) - H5_PKG_INIT_VAR = FALSE; + if(H5_PKG_INIT_VAR) { + /* Sanity checks */ + HDassert(0 == H5I_nmembers(H5I_REFERENCE)); + HDassert(FALSE == H5R_top_package_initialize_s); + + /* Destroy the reference id group */ + n += (H5I_dec_type_ref(H5I_REFERENCE) > 0); + + /* Mark closed */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; + } - FUNC_LEAVE_NOAPI(0) + FUNC_LEAVE_NOAPI(n) } /* end H5R_term_package() */ diff --git a/src/H5T.c b/src/H5T.c index 2f59767..a525cd5 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1673,6 +1673,7 @@ H5Tcopy(hid_t type_id) case H5I_GROUP: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5private.h b/src/H5private.h index ff45cec..ca4ebcf 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2593,6 +2593,7 @@ H5_DLL int H5L_term_package(void); H5_DLL int H5P_term_package(void); H5_DLL int H5PL_term_package(void); H5_DLL int H5R_term_package(void); +H5_DLL int H5R_top_term_package(void); H5_DLL int H5S_term_package(void); H5_DLL int H5S_top_term_package(void); H5_DLL int H5SL_term_package(void); diff --git a/src/H5trace.c b/src/H5trace.c index e2a746b..9fb8a72 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -1320,6 +1320,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "%ld (attr)", (long)obj); break; + case H5I_REFERENCE: + fprintf(out, "%ld (reference)", (long)obj); + break; + case H5I_VFL: fprintf(out, "%ld (file driver)", (long)obj); break; @@ -1497,6 +1501,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "H5I_ATTR"); break; + case H5I_REFERENCE: + fprintf(out, "H5I_REFERENCE"); + break; + case H5I_VFL: fprintf(out, "H5I_VFL"); break; diff --git a/test/links.c b/test/links.c index 2d9bb0d..7b3e37d 100644 --- a/test/links.c +++ b/test/links.c @@ -7743,6 +7743,7 @@ done: case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: @@ -7829,6 +7830,7 @@ done: case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/test/tfile.c b/test/tfile.c index 20b41e0..533bb24 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1393,6 +1393,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, case H5I_DATATYPE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/test/tmisc.c b/test/tmisc.c index bec80b2..22ae558 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -30,6 +30,7 @@ #include "testhdf5.h" #include "H5srcdir.h" #include "H5Dpkg.h" /* Datasets */ +#include "H5Iprivate.h" /* IDs, can be removed when H5I_REFERENCE is gone */ /* Definitions for misc. test #1 */ #define MISC1_FILE "tmisc1.h5" @@ -3447,6 +3448,34 @@ test_misc19(void) HDfree(vfd_cls); +/* Check H5I operations on references */ + + /* Reference IDs are not used by the library so there's no + * way of testing if incr/decr, etc. work. Instead, just + * do a quick smoke check to ensure that a couple of basic + * calls return sane values. + * + * H5I_REFERENCE has been declared deprecated with a tentative + * removal version of HDF5 1.12.0. + * + * Delete this entire block when H5I_REFERENCE no longer exists. + * + * The H5Iprivate.h header was included to support H5I_nmembers() + * so that can also probably be removed as well. + */ +{ + htri_t tf; /* Boolean generic return */ + int64_t num_members; /* Number of members in type */ + + tf = H5Itype_exists(H5I_REFERENCE); + VERIFY(tf, TRUE, "H5Itype_exists"); + + num_members = 999; + num_members = H5I_nmembers(H5I_REFERENCE); + VERIFY(num_members, 0, "H5Inmembers"); + +} /* end block */ + } /* end test_misc19() */ /**************************************************************** -- cgit v0.12 From dfceb84d4756a15540b5b08826ea98c13c1399e8 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Jul 2017 13:00:11 -0700 Subject: Fixed a minor comment typo in H5R.c --- src/H5R.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5R.c b/src/H5R.c index c2a10ce..78a77e2 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -152,7 +152,7 @@ H5R_top_term_package(void) } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* end H5R__init_package() */ +} /* end H5R_top_term_package() */ /*-------------------------------------------------------------------------- -- cgit v0.12 From 9a749a64f06187bc5ae17e848eab9aacdfc57f8a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Jul 2017 13:01:58 -0700 Subject: More minor whitespace cleanup --- src/H5R.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/H5R.c b/src/H5R.c index 78a77e2..b000183 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -103,7 +103,7 @@ H5R__init_package(void) FUNC_ENTER_NOAPI_NOINIT -/* Initialize the atom group for the file IDs */ + /* Initialize the atom group for the file IDs */ if(H5I_register_type(H5I_REFERENCE_CLS) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to initialize interface") @@ -144,7 +144,7 @@ H5R_top_term_package(void) if(H5I_nmembers(H5I_REFERENCE) > 0) { (void)H5I_clear_type(H5I_REFERENCE, FALSE, FALSE); n++; /*H5I*/ - } /* end if */ + } /* end if */ /* Mark closed */ if(0 == n) @@ -193,7 +193,7 @@ H5R_term_package(void) /* Mark closed */ if(0 == n) H5_PKG_INIT_VAR = FALSE; - } + } /* end if */ FUNC_LEAVE_NOAPI(n) } /* end H5R_term_package() */ -- cgit v0.12 From 5d6ed0b298e3a40051a975a466820030360e8a31 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Jul 2017 14:26:53 -0700 Subject: Turned off unused parameter warnings in gcc for Java constants. None of the constant functions use their parameters, so emitting warnings for them generates a large amount of noise. Since these are trivial wrappers, marking them up with H5_ATTR_UNUSED would be a huge waste of time. --- java/src/jni/h5Constants.c | 1 + 1 file changed, 1 insertion(+) diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index d4511e1..f6f8bfa 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -26,6 +26,7 @@ extern "C" { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmissing-prototypes" +#pragma GCC diagnostic ignored "-Wunused-parameter" JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1QUARTER_1HADDR_1MAX(JNIEnv *env, jclass cls) { return (hsize_t)HADDR_MAX/4; } -- cgit v0.12 From 1e1403cf1d959d5a88b2ff595096ee52af26db58 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 5 Jul 2017 01:27:40 -0500 Subject: Skip HDFFV-10160 filenotclosed test for split/multi driver Temporary skip this test for split/multi driver. Further investigation to resolve the failure is needed. Please enter the commit message for your changes. Lines starting --- test/filenotclosed.c | 18 ++++++++++++++++++ test/test_filenotclosed.sh.in | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/test/filenotclosed.c b/test/filenotclosed.c index f91f4bc..d1f468a 100644 --- a/test/filenotclosed.c +++ b/test/filenotclosed.c @@ -66,6 +66,24 @@ main(void) int buf[5] = {1, 2, 3, 4, 5}; /* The data to be written to the dataset */ char filename[100]; /* File name */ const char *env_h5_drvr; /* File Driver value from environment */ + hbool_t contig_addr_vfd; /* Contiguous address vfd */ + + /* Get the VFD to use */ + env_h5_drvr = HDgetenv("HDF5_DRIVER"); + if(env_h5_drvr == NULL) + env_h5_drvr = "nomatch"; + + /* Skip test when using VFDs that has different address spaces for each + * type of metadata allocation. + * Further investigation is needed to resolve the test failure with the + * split/multi driver. Please see HDFFV-10160. + */ + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + if(!contig_addr_vfd) { + SKIPPED(); + puts(" Temporary skipped for a spilt/multi driver"); + HDexit(EXIT_SUCCESS); + } h5_reset(); diff --git a/test/test_filenotclosed.sh.in b/test/test_filenotclosed.sh.in index 09129c5..0b43c5b 100644 --- a/test/test_filenotclosed.sh.in +++ b/test/test_filenotclosed.sh.in @@ -29,7 +29,8 @@ TEST_NAME=filenotclosed # The test name TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary # # Run the test -$RUNSERIAL $TEST_BIN >/dev/null 2>&1 +#$RUNSERIAL $TEST_BIN >/dev/null 2>&1 +$RUNSERIAL $TEST_BIN 2>&1 exitcode=$? if [ $exitcode -eq 0 ]; then echo "Test PASSED" -- cgit v0.12 From 4e121c3913d0031913738a6d3a5d8ac4ec8aa2f1 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 5 Jul 2017 08:34:45 -0500 Subject: Add remaining documentation/comments --- src/H5Dmpio.c | 77 +++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 23 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index d2c5267..a5899d4 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -113,9 +113,9 @@ typedef struct H5D_filtered_collective_io_info_t { } owners; struct { - MPI_Request *receive_requests_array; - unsigned char **receive_buffer_array; - int num_receive_requests; + MPI_Request *receive_requests_array; /* Array of receive requests posted to receive chunk modification data from other processes */ + unsigned char **receive_buffer_array; /* Array of receive buffers to store chunk modification data from other processes */ + int num_receive_requests; /* Number of entries in the receive_requests_array and receive_buffer_array arrays */ } async_info; } H5D_filtered_collective_io_info_t; @@ -348,7 +348,10 @@ done: * Purpose: Given arrays by MPI ranks, gathers them into a single array * which is either gathered to the rank specified by root when * allgather is false, or is distributed back to all ranks - * when allgather is true. If the sort_func argument is + * when allgather is true. The number of processes + * participating in the gather operation should be specified + * for nprocs and the MPI communicator to use should be + * specified for comm. If the sort_func argument is * specified, the list is sorted before being returned. * * If allgather is specified as true, root is ignored. @@ -1266,10 +1269,10 @@ if(H5DEBUG(D)) * 1. Construct a list of selected chunks in the collective IO * operation * A. If any chunk is being written to by more than 1 - * process, the process writing the most data to the - * chunk will take ownership of the chunk (the first - * process seen that is writing the most data becomes - * the new owner in the case of ties) + * process, the process writing to the chunk which + * currently has the least amount of chunks assigned + * to it becomes the new owner (in the case of ties, + * the lowest MPI rank becomes the new owner) * 2. If the operation is a write operation * A. Loop through each chunk in the operation * I. If this is not a full overwrite of the chunk @@ -1461,7 +1464,7 @@ done: H5MM_free(chunk_list[i].buf); H5MM_free(chunk_list); - } + } /* end if */ if (num_chunks_selected_array) H5MM_free(num_chunks_selected_array); @@ -1700,10 +1703,10 @@ done: * 1. Construct a list of selected chunks in the collective IO * operation * A. If any chunk is being written to by more than 1 - * process, the process writing the most data to the - * chunk will take ownership of the chunk (the first - * process seen that is writing the most data becomes - * the new owner in the case of ties) + * process, the process writing to the chunk which + * currently has the least amount of chunks assigned + * to it becomes the new owner (in the case of ties, + * the lowest MPI rank becomes the new owner) * 2. If the operation is a read operation * A. Loop through each chunk in the operation * I. Read the chunk from the file @@ -1947,11 +1950,11 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i if (collective_chunk_list){ H5MM_free(collective_chunk_list); collective_chunk_list = NULL; - } + } /* end if */ if (has_chunk_selected_array){ H5MM_free(has_chunk_selected_array); has_chunk_selected_array = NULL; - } + } /* end if */ } /* end for */ /* Free the MPI file and memory types, if they were derived */ @@ -1973,7 +1976,7 @@ done: H5MM_free(chunk_list[i].buf); H5MM_free(chunk_list); - } + } /* end if */ if (collective_chunk_list) H5MM_free(collective_chunk_list); @@ -2197,6 +2200,23 @@ H5D__cmp_filtered_collective_io_info_entry(const void *filtered_collective_io_in FUNC_LEAVE_NOAPI(H5F_addr_cmp(addr1, addr2)) } /* end H5D__cmp_filtered_collective_io_info_entry() */ + +/*------------------------------------------------------------------------- + * Function: H5D__cmp_filtered_collective_io_info_entry_owner + * + * Purpose: Routine to compare filtered collective chunk io info + * entries's original owner fields + * + * Description: Callback for qsort() to compare filtered collective chunk + * io info entries's original owner fields + * + * Return: -1, 0, 1 + * + * Programmer: Jordan Henderson + * Monday, Apr. 10th, 2017 + * + *------------------------------------------------------------------------- + */ static int H5D__cmp_filtered_collective_io_info_entry_owner(const void *filtered_collective_io_info_entry1, const void *filtered_collective_io_info_entry2) { @@ -2575,7 +2595,8 @@ done: * Purpose: Constructs a list of entries which contain the necessary * information for inter-process communication when performing * collective io on filtered chunks. This list is used by - * every process in operations that must be collectively done + * each process when performing I/O on locally selected chunks + * and also in operations that must be collectively done * on every chunk, such as chunk re-allocation, insertion of * chunks into the chunk index, etc. * @@ -2668,7 +2689,17 @@ done: /*------------------------------------------------------------------------- * Function: H5D__chunk_redistribute_shared_chunks * - * Purpose: + * Purpose: When performing a collective write on a Dataset with + * filters applied, this function is used to redistribute any + * chunks which are selected by more than one process, so as + * to preserve file integrity after the write by ensuring + * that any shared chunks are only modified by one process. + * + * The current implementation simply hands the list off to + * rank 0, which then scans the list and for each shared + * chunk, it redistributes the chunk to the process writing + * to the chunk which currently has the least amount of chunks + * assigned to it. * * Return: Non-negative on success/Negative on failure * @@ -2782,7 +2813,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty if (shared_chunks_info_array) { H5MM_free(shared_chunks_info_array); shared_chunks_info_array = NULL; - } + } /* end if */ /* Now that the chunks have been redistributed, each process must send its modification data * to the new owners of any of the chunks it previously possessed. Accordingly, each process @@ -2907,7 +2938,7 @@ done: for (i = 0; i < num_send_requests; i++) { if (mod_data[i]) H5MM_free(mod_data[i]); - } + } /* end for */ if (send_requests) H5MM_free(send_requests); @@ -3070,7 +3101,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk */ if (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) { buf_size = chunk_entry->chunk_states.chunk_current.length; - } + } /* end if */ else { hssize_t extent_npoints; @@ -3078,7 +3109,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") buf_size = (hsize_t) extent_npoints * type_info->src_type_size; - } + } /* end else */ chunk_entry->chunk_states.new_chunk.length = buf_size; @@ -3189,7 +3220,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk dataspace = NULL; } H5MM_free(chunk_entry->async_info.receive_buffer_array[i]); - } + } /* end for */ /* Filter the chunk */ if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, -- cgit v0.12 From 3ce78d0d8d8bb23e887ccd694b86dfcd5c96176c Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 5 Jul 2017 08:40:09 -0500 Subject: Add comment for full overwrite special case --- src/H5Dmpio.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index a5899d4..e818c3f 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -2664,6 +2664,14 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") local_info_array[i].io_size = (size_t) select_npoints * type_info->src_type_size; + /* XXX: Currently the full overwrite status of a chunk is only obtained on a per-process + * basis. This means that if the total selection in the chunk, as determined by the combination + * of selections of all of the processes interested in the chunk, covers the entire chunk, + * the performance optimization of not reading the chunk from the file is still valid, but + * is not applied in the current implementation. Something like an appropriately placed + * MPI_Allreduce or a running total of the number of chunk points selected during chunk + * redistribution should suffice for implementing this case - JTH. + */ if ((chunk_npoints = H5S_GET_EXTENT_NPOINTS(chunk_info->fspace)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") local_info_array[i].full_overwrite = -- cgit v0.12 From a2cdec5ab3313b67212676830ed8b1fdac2e6eef Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 5 Jul 2017 08:48:24 -0500 Subject: Remove use of H5E_CANTDISTRIBUTE error --- src/H5Dmpio.c | 2 +- src/H5err.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index e818c3f..5e2ee6a 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -2684,7 +2684,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ /* Redistribute shared chunks to new owners as necessary */ if (io_info->op_type == H5D_IO_OP_WRITE) if (H5D__chunk_redistribute_shared_chunks(io_info, type_info, fm, local_info_array, &num_chunks_selected) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTDISTRIBUTE, FAIL, "unable to redistribute shared chunks") + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to redistribute shared chunks") *chunk_list = local_info_array; *num_entries = num_chunks_selected; diff --git a/src/H5err.txt b/src/H5err.txt index 1c70f1f..d771956 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -245,7 +245,6 @@ MINOR, MPI, H5E_MPIERRSTR, MPI Error String MINOR, MPI, H5E_CANTRECV, Can't receive data MINOR, MPI, H5E_CANTGATHER, Can't gather data MINOR, MPI, H5E_NO_INDEPENDENT, Can't perform independent IO -MINOR, MPI, H5E_CANTDISTRIBUTE, Can't distribute shared chunks # Heap errors MINOR, HEAP, H5E_CANTRESTORE, Can't restore condition -- cgit v0.12 From 0f78b954f28ebccd1f3b482f7ef5f3bee8817b7b Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 5 Jul 2017 10:38:37 -0500 Subject: Add comment for memory copy possibly not being necessary anymore for Multi-Chunk I/O --- src/H5Dmpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 5e2ee6a..1bd68dd 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1898,6 +1898,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Collect the new chunk info back to the local copy, since only the record in the * collective array gets updated by the chunk re-allocation */ + /* XXX: This step may no longer be necessary */ HDmemcpy(&chunk_list[i].chunk_states.new_chunk, &collective_chunk_list[offset].chunk_states.new_chunk, sizeof(chunk_list[i].chunk_states.new_chunk)); H5_CHECKED_ASSIGN(mpi_type_count, int, chunk_list[i].chunk_states.new_chunk.length, hsize_t); -- cgit v0.12 From 191147ec90d72619632a24242c003ecb3bccfffd Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 5 Jul 2017 09:35:24 -0700 Subject: * Yanked the smoke check that was recently introduced to test the unused H5I_REFERENCE ID type in test_misc19(). This fails when running testhdf5 and skipping the reference test since the H5R package won't be initialized. H5I_REFERENCE will be going away soon and the ID type is unused so there's really no point to doing anything to test it. * Cleaned up test_misc13(), which is a basic test of userblock functionality, to not emit warnings due to the large global array. --- test/tmisc.c | 282 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 140 insertions(+), 142 deletions(-) diff --git a/test/tmisc.c b/test/tmisc.c index 22ae558..708ca9b 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -30,7 +30,6 @@ #include "testhdf5.h" #include "H5srcdir.h" #include "H5Dpkg.h" /* Datasets */ -#include "H5Iprivate.h" /* IDs, can be removed when H5I_REFERENCE is gone */ /* Definitions for misc. test #1 */ #define MISC1_FILE "tmisc1.h5" @@ -179,17 +178,12 @@ typedef struct #define MISC13_GROUP1_NAME "Group1" #define MISC13_GROUP2_NAME "Group2" #define MISC13_DTYPE_NAME "Datatype" -#define MISC13_RANK 2 -#define MISC13_DIM1 20 -#define MISC13_DIM2 30 +#define MISC13_RANK 1 +#define MISC13_DIM1 600 #define MISC13_CHUNK_DIM1 10 -#define MISC13_CHUNK_DIM2 15 #define MISC13_USERBLOCK_SIZE 512 #define MISC13_COPY_BUF_SIZE 4096 -unsigned m13_data[MISC13_DIM1][MISC13_DIM2]; /* Data to write to dataset */ -unsigned m13_rdata[MISC13_DIM1][MISC13_DIM2]; /* Data read from dataset */ - /* Definitions for misc. test #14 */ #define MISC14_FILE "tmisc14.h5" #define MISC14_DSET1_NAME "Dataset1" @@ -2084,38 +2078,36 @@ test_misc12(void) /* Various routines for misc. 13 test */ static void -init_data(void) +misc13_init_data(unsigned *original_data) { - unsigned u,v; /* Local index variables */ + unsigned u; - for(u=0; u= 0); CHECK(ret, FAIL, "H5Fclose"); -} + +} /* end misc13_create_hdf_file() */ static void -insert_user_block(const char *old_name, const char *new_name,const char *str,size_t size) +misc13_insert_user_block(const char *old_name, const char *new_name, const char *str, size_t size) { - FILE *new_fp, *old_fp; /* Pointers to new & old files */ - void *user_block; /* Pointer to user block to write to file */ - void *copy_buf; /* Pointer to buffer for copying data */ + FILE *new_fp = NULL; /* Pointers to new & old files */ + FILE *old_fp = NULL; + void *user_block = NULL; /* Pointer to user block to write to file */ + void *copy_buf = NULL; /* Pointer to buffer for copying data */ size_t written; /* Amount of data written to new file */ size_t read_in; /* Amount of data read in from old file */ int ret; /* Generic status value */ @@ -2264,10 +2267,10 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz CHECK(user_block, NULL, "HDcalloc"); /* Copy in the user block data */ - HDmemcpy(user_block,str,strlen(str)); + HDmemcpy(user_block, str, strlen(str)); /* Open the new file */ - new_fp=HDfopen(new_name,"wb"); + new_fp = HDfopen(new_name,"wb"); CHECK(new_fp, NULL, "HDfopen"); /* Write the user block to the new file */ @@ -2275,7 +2278,7 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz VERIFY(written, size, "HDfwrite"); /* Open the old file */ - old_fp=HDfopen(old_name,"rb"); + old_fp = HDfopen(old_name,"rb"); CHECK(old_fp, NULL, "HDfopen"); /* Allocate space for the copy buffer */ @@ -2287,14 +2290,14 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz /* Write the data to the new file */ written = HDfwrite(copy_buf, (size_t)1, read_in, new_fp); VERIFY(written, read_in, "HDfwrite"); - } /* end while */ + } /* Close the old file */ - ret=HDfclose(old_fp); + ret = HDfclose(old_fp); VERIFY(ret, 0, "HDfclose"); /* Close the new file */ - ret=HDfclose(new_fp); + ret = HDfclose(new_fp); VERIFY(ret, 0, "HDfclose"); /* Free the copy buffer */ @@ -2302,81 +2305,84 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz /* Free the user block */ HDfree(user_block); -} + +} /* end misc13_insert_user_block() */ static void -verify_file(const char *name, hsize_t blk_size, unsigned check_new_data) +misc13_verify_file(const char *name, const unsigned *data, hsize_t userblock_size, + hbool_t check_for_new_dataset) { - hid_t fid; /* File ID */ - hid_t gid,gid2; /* Group IDs */ - hid_t tid; /* Datatype ID */ - hid_t fcpl; /* File creation property list ID */ - hsize_t userblock; /* Userblock size retrieved from FCPL */ - herr_t ret; /* Generic return value */ + hid_t fid = -1; /* File ID */ + hid_t gid1 = -1; /* Group IDs */ + hid_t gid2 = -1; /* Group IDs */ + hid_t tid = -1; /* Datatype ID */ + hid_t fcplid = -1; /* File creation property list ID */ + hsize_t ub_size_out; /* Userblock size retrieved from FCPL */ + herr_t ret; /* Generic return value */ /* Open the file */ - fid=H5Fopen(name, H5F_ACC_RDONLY, H5P_DEFAULT); + fid = H5Fopen(name, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); /* Get the file's FCPL */ - fcpl=H5Fget_create_plist(fid); - CHECK(fcpl, FAIL, "H5Fget_create_plist"); + fcplid = H5Fget_create_plist(fid); + CHECK(fcplid, FAIL, "H5Fget_create_plist"); /* Get the user block size for the file */ - ret=H5Pget_userblock(fcpl,&userblock); + ret = H5Pget_userblock(fcplid, &ub_size_out); CHECK(ret, FAIL, "H5Pget_userblock"); /* Check the userblock size */ - VERIFY(userblock, blk_size, "H5Pget_userblock"); + VERIFY(userblock_size, ub_size_out, "H5Pget_userblock"); /* Close the FCPL */ - ret = H5Pclose(fcpl); + ret = H5Pclose(fcplid); CHECK(ret, FAIL, "H5Pclose"); /* Verify the contiguous dataset in the root group */ - verify_dataset(fid,MISC13_DSET1_NAME); + misc13_verify_dataset(fid, MISC13_DSET1_NAME, data); /* Verify the chunked dataset in the root group */ - verify_dataset(fid,MISC13_DSET2_NAME); + misc13_verify_dataset(fid, MISC13_DSET2_NAME, data); /* Verify the "new" contiguous dataset in the root group, if asked */ - if(check_new_data) - verify_dataset(fid,MISC13_DSET3_NAME); + if(check_for_new_dataset) + misc13_verify_dataset(fid, MISC13_DSET3_NAME, data); /* Open the named datatype in the root group */ tid = H5Topen2(fid, MISC13_DTYPE_NAME, H5P_DEFAULT); CHECK(tid, FAIL, "H5Topen2"); /* Verify the type is correct */ - VERIFY(H5Tequal(tid,H5T_NATIVE_INT), TRUE, "H5Tequal"); + VERIFY(H5Tequal(tid, H5T_NATIVE_INT), TRUE, "H5Tequal"); /* Close named datatype */ - ret=H5Tclose(tid); + ret = H5Tclose(tid); CHECK(ret, FAIL, "H5Tclose"); /* Open the first group */ - gid = H5Gopen2(fid, MISC13_GROUP1_NAME, H5P_DEFAULT); - CHECK(gid, FAIL, "H5Gopen2"); + gid1 = H5Gopen2(fid, MISC13_GROUP1_NAME, H5P_DEFAULT); + CHECK(gid1, FAIL, "H5Gopen2"); /* Verify the contiguous dataset in the first group */ - verify_dataset(gid,MISC13_DSET1_NAME); + misc13_verify_dataset(gid1, MISC13_DSET1_NAME, data); /* Verify the chunked dataset in the first group */ - verify_dataset(gid,MISC13_DSET2_NAME); + misc13_verify_dataset(gid1, MISC13_DSET2_NAME, data); /* Open the named datatype in the first group */ - tid = H5Topen2(gid,MISC13_DTYPE_NAME, H5P_DEFAULT); + tid = H5Topen2(gid1, MISC13_DTYPE_NAME, H5P_DEFAULT); CHECK(tid, FAIL, "H5Topen2"); /* Verify the type is correct */ - VERIFY(H5Tequal(tid,H5T_NATIVE_INT), TRUE, "H5Tequal"); + VERIFY(H5Tequal(tid, H5T_NATIVE_INT), TRUE, "H5Tequal"); /* Close named datatype */ - ret=H5Tclose(tid); + ret = H5Tclose(tid); CHECK(ret, FAIL, "H5Tclose"); /* Open the second group */ - gid2 = H5Gopen2(gid, MISC13_GROUP2_NAME, H5P_DEFAULT); + gid2 = H5Gopen2(gid1, MISC13_GROUP2_NAME, H5P_DEFAULT); CHECK(gid2, FAIL, "H5Gopen2"); /* Close the second group */ @@ -2384,31 +2390,33 @@ verify_file(const char *name, hsize_t blk_size, unsigned check_new_data) CHECK(ret, FAIL, "H5Gclose"); /* Close the first group */ - ret = H5Gclose(gid); + ret = H5Gclose(gid1); CHECK(ret, FAIL, "H5Gclose"); /* Close the file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); -} + +} /* end misc13_verify_file() */ static void -add_to_new_file(const char *name) +misc13_add_to_new_file(const char *name, const unsigned *data) { - hid_t fid; /* File ID */ + hid_t fid = -1; /* File ID */ herr_t ret; /* Generic return value */ /* Open the file */ - fid=H5Fopen(name, H5F_ACC_RDWR, H5P_DEFAULT); + fid = H5Fopen(name, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); /* Create new contiguous dataset in root group */ - create_dataset(fid, MISC13_DSET3_NAME, H5P_DEFAULT); + misc13_create_dataset(fid, MISC13_DSET3_NAME, H5P_DEFAULT, data); /* Close the file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); -} + +} /* end misc13_add_to_new_file() */ /**************************************************************** ** @@ -2419,26 +2427,44 @@ add_to_new_file(const char *name) static void test_misc13(void) { + unsigned *data = NULL; /* Data to write to dataset */ + hsize_t userblock_size; /* Correct size of userblock */ + hbool_t check_for_new_dataset; /* Whether to check for the post-userblock-creation dataset */ + + /* Create a data buffer for the datasets */ + data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); + CHECK(data, NULL, "HDcalloc"); + /* Initialize data to write */ - init_data(); + misc13_init_data(data); /* Create first file, with no user block */ - create_hdf_file(MISC13_FILE_1); + misc13_create_hdf_file(MISC13_FILE_1, data); /* Verify file contents are correct */ - verify_file(MISC13_FILE_1,(hsize_t)0,0); + userblock_size = 0; + check_for_new_dataset = FALSE; + misc13_verify_file(MISC13_FILE_1, data, userblock_size, check_for_new_dataset); /* Create a new file by inserting a user block in front of the first file */ - insert_user_block(MISC13_FILE_1, MISC13_FILE_2, "Test String", (size_t)MISC13_USERBLOCK_SIZE); + misc13_insert_user_block(MISC13_FILE_1, MISC13_FILE_2, "Test String", (size_t)MISC13_USERBLOCK_SIZE); /* Verify file contents are still correct */ - verify_file(MISC13_FILE_2,(hsize_t)MISC13_USERBLOCK_SIZE,0); + userblock_size = MISC13_USERBLOCK_SIZE; + check_for_new_dataset = FALSE; + misc13_verify_file(MISC13_FILE_2, data, userblock_size, check_for_new_dataset); /* Make certain we can modify the new file */ - add_to_new_file(MISC13_FILE_2); + misc13_add_to_new_file(MISC13_FILE_2, data); /* Verify file contents are still correct */ - verify_file(MISC13_FILE_2,(hsize_t)MISC13_USERBLOCK_SIZE,1); + userblock_size = MISC13_USERBLOCK_SIZE; + check_for_new_dataset = TRUE; + misc13_verify_file(MISC13_FILE_2, data, userblock_size, check_for_new_dataset); + + /* Free the dataset buffer */ + HDfree(data); + } /* end test_misc13() */ /**************************************************************** @@ -3448,34 +3474,6 @@ test_misc19(void) HDfree(vfd_cls); -/* Check H5I operations on references */ - - /* Reference IDs are not used by the library so there's no - * way of testing if incr/decr, etc. work. Instead, just - * do a quick smoke check to ensure that a couple of basic - * calls return sane values. - * - * H5I_REFERENCE has been declared deprecated with a tentative - * removal version of HDF5 1.12.0. - * - * Delete this entire block when H5I_REFERENCE no longer exists. - * - * The H5Iprivate.h header was included to support H5I_nmembers() - * so that can also probably be removed as well. - */ -{ - htri_t tf; /* Boolean generic return */ - int64_t num_members; /* Number of members in type */ - - tf = H5Itype_exists(H5I_REFERENCE); - VERIFY(tf, TRUE, "H5Itype_exists"); - - num_members = 999; - num_members = H5I_nmembers(H5I_REFERENCE); - VERIFY(num_members, 0, "H5Inmembers"); - -} /* end block */ - } /* end test_misc19() */ /**************************************************************** -- cgit v0.12 From 0531d92d742d77a8b635f89bf9e8564d88dd4c84 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 5 Jul 2017 14:36:54 -0500 Subject: Add prototype for H5D__cmp_filtered_collective_io_info_entry_owner --- src/H5Dmpio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 1bd68dd..942f633 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -172,6 +172,8 @@ static herr_t H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io static int H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2); static int H5D__cmp_filtered_collective_io_info_entry(const void *filtered_collective_io_info_entry1, const void *filtered_collective_io_info_entry2); +static int H5D__cmp_filtered_collective_io_info_entry_owner(const void *filtered_collective_io_info_entry1, + const void *filtered_collective_io_info_entry2); /*********************/ -- cgit v0.12 From 47a4cd816cff5e1223f66614e150777f9dca7af0 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Wed, 5 Jul 2017 15:53:19 -0400 Subject: Commit changes needed for pull request --- testpar/t_bigio.c | 2097 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2097 insertions(+) create mode 100644 testpar/t_bigio.c diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c new file mode 100644 index 0000000..2f80e45 --- /dev/null +++ b/testpar/t_bigio.c @@ -0,0 +1,2097 @@ + +#include "hdf5.h" +#include "testphdf5.h" +#include "H5Dprivate.h" /* For Chunk tests */ + +// int TestVerbosity = VERBO_LO; /* Default Verbosity is Low */ + +/* Constants definitions */ +#define MAX_ERR_REPORT 10 /* Maximum number of errors reported */ + +/* Define some handy debugging shorthands, routines, ... */ +/* debugging tools */ + +#define MAINPROCESS (!mpi_rank) /* define process 0 as main process */ + +/* Constants definitions */ +#define RANK 2 + +#define IN_ORDER 1 +#define OUT_OF_ORDER 2 + +#define DATASET1 "DSET1" +#define DATASET2 "DSET2" +#define DATASET3 "DSET3" +#define DATASET4 "DSET4" +#define DATASET5 "DSET5" +#define DXFER_COLLECTIVE_IO 0x1 /* Collective IO*/ +#define DXFER_INDEPENDENT_IO 0x2 /* Independent IO collectively */ +#define DXFER_BIGCOUNT 536870916 + +#define HYPER 1 +#define POINT 2 +#define ALL 3 + +/* Dataset data type. Int's can be easily octo dumped. */ +typedef hsize_t B_DATATYPE; + +int facc_type = FACC_MPIO; /*Test file access type */ +int dxfer_coll_type = DXFER_COLLECTIVE_IO; +size_t bigcount = DXFER_BIGCOUNT; +char filename[20] = "bigio_test.h5"; +int nerrors = 0; +int mpi_size, mpi_rank; + +hsize_t space_dim1 = SPACE_DIM1 * 256; // 4096 +hsize_t space_dim2 = SPACE_DIM2; + +static void coll_chunktest(const char* filename, int chunk_factor, int select_factor, + int api_option, int file_selection, int mem_selection, int mode); +hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type); + +/* + * Setup the coordinates for point selection. + */ +static void +set_coords(hsize_t start[], + hsize_t count[], + hsize_t stride[], + hsize_t block[], + size_t num_points, + hsize_t coords[], + int order) +{ + hsize_t i,j, k = 0, m ,n, s1 ,s2; + + if(OUT_OF_ORDER == order) + k = (num_points * RANK) - 1; + else if(IN_ORDER == order) + k = 0; + + s1 = start[0]; + s2 = start[1]; + + for(i = 0 ; i < count[0]; i++) + for(j = 0 ; j < count[1]; j++) + for(m = 0 ; m < block[0]; m++) + for(n = 0 ; n < block[1]; n++) + if(OUT_OF_ORDER == order) { + coords[k--] = s2 + (stride[1] * j) + n; + coords[k--] = s1 + (stride[0] * i) + m; + } + else if(IN_ORDER == order) { + coords[k++] = s1 + stride[0] * i + m; + coords[k++] = s2 + stride[1] * j + n; + } +} + +/* + * Fill the dataset with trivial data for testing. + * Assume dimension rank is 2 and data is stored contiguous. + */ +static void +fill_datasets(hsize_t start[], hsize_t block[], B_DATATYPE * dataset) +{ + B_DATATYPE *dataptr = dataset; + hsize_t i, j; + + /* put some trivial data in the data_array */ + for (i=0; i < block[0]; i++){ + for (j=0; j < block[1]; j++){ + *dataptr = (B_DATATYPE)((i+start[0])*100 + (j+start[1]+1)); + dataptr++; + } + } +} + +/* + * Setup the coordinates for point selection. + */ +void point_set(hsize_t start[], + hsize_t count[], + hsize_t stride[], + hsize_t block[], + size_t num_points, + hsize_t coords[], + int order) +{ + hsize_t i,j, k = 0, m ,n, s1 ,s2; + + HDcompile_assert(RANK == 2); + + if(OUT_OF_ORDER == order) + k = (num_points * RANK) - 1; + else if(IN_ORDER == order) + k = 0; + + s1 = start[0]; + s2 = start[1]; + + for(i = 0 ; i < count[0]; i++) + for(j = 0 ; j < count[1]; j++) + for(m = 0 ; m < block[0]; m++) + for(n = 0 ; n < block[1]; n++) + if(OUT_OF_ORDER == order) { + coords[k--] = s2 + (stride[1] * j) + n; + coords[k--] = s1 + (stride[0] * i) + m; + } + else if(IN_ORDER == order) { + coords[k++] = s1 + stride[0] * i + m; + coords[k++] = s2 + stride[1] * j + n; + } + + if(VERBOSE_MED) { + printf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n", + (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], + (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1], + (unsigned long)(block[0] * block[1] * count[0] * count[1])); + k = 0; + for(i = 0; i < num_points ; i++) { + printf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]); + k += 2; + } + } +} + +/* + * Print the content of the dataset. + */ +static void +dataset_print(hsize_t start[], hsize_t block[], B_DATATYPE * dataset) +{ + B_DATATYPE *dataptr = dataset; + hsize_t i, j; + + /* print the column heading */ + printf("%-8s", "Cols:"); + for (j=0; j < block[1]; j++){ + printf("%3lu ", (unsigned long)(start[1]+j)); + } + printf("\n"); + + /* print the slab data */ + for (i=0; i < block[0]; i++){ + printf("Row %2lu: ", (unsigned long)(i+start[0])); + for (j=0; j < block[1]; j++){ + printf("%llu ", *dataptr++); + } + printf("\n"); + } +} + + +/* + * Print the content of the dataset. + */ +static int +verify_data(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], B_DATATYPE *dataset, B_DATATYPE *original) +{ + hsize_t i, j; + int vrfyerrs; + + /* print it if VERBOSE_MED */ + if(VERBOSE_MED) { + printf("verify_data dumping:::\n"); + printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n", + (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], + (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]); + printf("original values:\n"); + dataset_print(start, block, original); + printf("compared values:\n"); + dataset_print(start, block, dataset); + } + + vrfyerrs = 0; + for (i=0; i < block[0]; i++){ + for (j=0; j < block[1]; j++){ + if(*dataset != *original){ + if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){ + printf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %llu, got %llu\n", + (unsigned long)i, (unsigned long)j, + (unsigned long)(i+start[0]), (unsigned long)(j+start[1]), + *(original), *(dataset)); + } + dataset++; + original++; + } + } + } + if(vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED) + printf("[more errors ...]\n"); + if(vrfyerrs) + printf("%d errors found in verify_data\n", vrfyerrs); + return(vrfyerrs); +} + +/* Set up the selection */ +static void +ccslab_set(int mpi_rank, + int mpi_size, + hsize_t start[], + hsize_t count[], + hsize_t stride[], + hsize_t block[], + int mode) +{ + + switch (mode){ + + case BYROW_CONT: + /* Each process takes a slabs of rows. */ + block[0] = 1; + block[1] = 1; + stride[0] = 1; + stride[1] = 1; + count[0] = space_dim1; + count[1] = space_dim2; + start[0] = mpi_rank*count[0]; + start[1] = 0; + + break; + + case BYROW_DISCONT: + /* Each process takes several disjoint blocks. */ + block[0] = 1; + block[1] = 1; + stride[0] = 3; + stride[1] = 3; + count[0] = space_dim1/(stride[0]*block[0]); + count[1] = (space_dim2)/(stride[1]*block[1]); + start[0] = space_dim1*mpi_rank; + start[1] = 0; + + break; + + case BYROW_SELECTNONE: + /* Each process takes a slabs of rows, there are + no selections for the last process. */ + block[0] = 1; + block[1] = 1; + stride[0] = 1; + stride[1] = 1; + count[0] = ((mpi_rank >= MAX(1,(mpi_size-2)))?0:space_dim1); + count[1] = space_dim2; + start[0] = mpi_rank*count[0]; + start[1] = 0; + + break; + + case BYROW_SELECTUNBALANCE: + /* The first one-third of the number of processes only + select top half of the domain, The rest will select the bottom + half of the domain. */ + + block[0] = 1; + count[0] = 2; + stride[0] = space_dim1*mpi_size/4+1; + block[1] = space_dim2; + count[1] = 1; + start[1] = 0; + stride[1] = 1; + if((mpi_rank *3)<(mpi_size*2)) start[0] = mpi_rank; + else start[0] = 1 + space_dim1*mpi_size/2 + (mpi_rank-2*mpi_size/3); + break; + + case BYROW_SELECTINCHUNK: + /* Each process will only select one chunk */ + + block[0] = 1; + count[0] = 1; + start[0] = mpi_rank*space_dim1; + stride[0]= 1; + block[1] = space_dim2; + count[1] = 1; + stride[1]= 1; + start[1] = 0; + + break; + + default: + /* Unknown mode. Set it to cover the whole dataset. */ + block[0] = space_dim1*mpi_size; + block[1] = space_dim2; + stride[0] = block[0]; + stride[1] = block[1]; + count[0] = 1; + count[1] = 1; + start[0] = 0; + start[1] = 0; + + break; + } + if (VERBOSE_MED){ + printf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n", + (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], + (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1], + (unsigned long)(block[0]*block[1]*count[0]*count[1])); + } +} + + +/* + * Fill the dataset with trivial data for testing. + * Assume dimension rank is 2. + */ +static void +ccdataset_fill(hsize_t start[], + hsize_t stride[], + hsize_t count[], + hsize_t block[], + DATATYPE * dataset, + int mem_selection) +{ + DATATYPE *dataptr = dataset; + DATATYPE *tmptr; + hsize_t i,j,k1,k2,k=0; + /* put some trivial data in the data_array */ + tmptr = dataptr; + + /* assign the disjoint block (two-dimensional)data array value + through the pointer */ + + for (k1 = 0; k1 < count[0]; k1++) { + for(i = 0; i < block[0]; i++) { + for(k2 = 0; k2 < count[1]; k2++) { + for(j = 0;j < block[1]; j++) { + + if (ALL != mem_selection) { + dataptr = tmptr + ((start[0]+k1*stride[0]+i)*space_dim2+ + start[1]+k2*stride[1]+j); + } + else { + dataptr = tmptr + k; + k++; + } + + *dataptr = (DATATYPE)(k1+k2+i+j); + } + } + } + } +} + +/* + * Print the first block of the content of the dataset. + */ +static void +ccdataset_print(hsize_t start[], + hsize_t block[], + DATATYPE * dataset) + +{ + DATATYPE *dataptr = dataset; + hsize_t i, j; + + /* print the column heading */ + printf("Print only the first block of the dataset\n"); + printf("%-8s", "Cols:"); + for (j=0; j < block[1]; j++){ + printf("%3lu ", (unsigned long)(start[1]+j)); + } + printf("\n"); + + /* print the slab data */ + for (i=0; i < block[0]; i++){ + printf("Row %2lu: ", (unsigned long)(i+start[0])); + for (j=0; j < block[1]; j++){ + printf("%03d ", *dataptr++); + } + printf("\n"); + } +} + +/* + * Print the content of the dataset. + */ +static int +ccdataset_vrfy(hsize_t start[], + hsize_t count[], + hsize_t stride[], + hsize_t block[], + DATATYPE *dataset, + DATATYPE *original, + int mem_selection) +{ + hsize_t i, j,k1,k2,k=0; + int vrfyerrs; + DATATYPE *dataptr,*oriptr; + + /* print it if VERBOSE_MED */ + if (VERBOSE_MED) { + printf("dataset_vrfy dumping:::\n"); + printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n", + (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], + (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]); + printf("original values:\n"); + ccdataset_print(start, block, original); + printf("compared values:\n"); + ccdataset_print(start, block, dataset); + } + + vrfyerrs = 0; + + for (k1=0;k1 MAX_ERR_REPORT && !VERBOSE_MED) + printf("[more errors ...]\n"); + if (vrfyerrs) + printf("%d errors found in ccdataset_vrfy\n", vrfyerrs); + return(vrfyerrs); +} + +/* + * Example of using the parallel HDF5 library to create two datasets + * in one HDF5 file with collective parallel access support. + * The Datasets are of sizes (number-of-mpi-processes x dim0) x dim1. + * Each process controls only a slab of size dim0 x dim1 within each + * dataset. [Note: not so yet. Datasets are of sizes dim0xdim1 and + * each process controls a hyperslab within.] + */ + +static void +dataset_big_write(void) +{ + + hid_t xfer_plist; /* Dataset transfer properties list */ + hid_t sid; /* Dataspace ID */ + hid_t file_dataspace; /* File dataspace ID */ + hid_t mem_dataspace; /* memory dataspace ID */ + hid_t dataset; + hid_t datatype; /* Datatype ID */ + hsize_t dims[RANK]; /* dataset dim sizes */ + hsize_t start[RANK]; /* for hyperslab setting */ + hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ + hsize_t block[RANK]; /* for hyperslab setting */ + hsize_t *coords = NULL; + int i; + herr_t ret; /* Generic return value */ + hid_t fid; /* HDF5 file ID */ + hid_t acc_tpl; /* File access templates */ + hsize_t h; + size_t num_points; + B_DATATYPE * wdata; + + + /* allocate memory for data buffer */ + wdata = (B_DATATYPE *)malloc(bigcount*sizeof(B_DATATYPE)); + VRFY((wdata != NULL), "wdata malloc succeeded"); + + /* setup file access template */ + acc_tpl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((acc_tpl >= 0), "H5P_FILE_ACCESS"); + H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); + + /* 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), ""); + + + /* Each process takes a slabs of rows. */ + printf("\nTesting Dataset1 write by ROW\n"); + /* Create a large dataset */ + dims[0] = bigcount; + dims[1] = mpi_size; + sid = H5Screate_simple (RANK, dims, NULL); + VRFY((sid >= 0), "H5Screate_simple succeeded"); + dataset = H5Dcreate2(fid, DATASET1, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); + H5Sclose(sid); + + block[0] = dims[0]/mpi_size; + block[1] = dims[1]; + stride[0] = block[0]; + stride[1] = block[1]; + count[0] = 1; + count[1] = 1; + start[0] = mpi_rank*block[0]; + start[1] = 0; + + /* create a file dataspace independently */ + file_dataspace = H5Dget_space (dataset); + 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 independently */ + mem_dataspace = H5Screate_simple (RANK, block, NULL); + VRFY((mem_dataspace >= 0), ""); + + /* fill the local slab with some trivial data */ + fill_datasets(start, block, wdata); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + dataset_print(start, block, wdata); + } + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* write data collectively */ + MESG("writeAll by Row"); + { + int j,k =0; + for (i=0; i < block[0]; i++){ + for (j=0; j < block[1]; j++){ + if(k < 10) { + printf("%lld ", wdata[k]); + k++; + } + } + } + printf("\n"); + } + + ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, + xfer_plist, wdata); + VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + ret = H5Dclose(dataset); + VRFY((ret >= 0), "H5Dclose1 succeeded"); + + + + /* Each process takes a slabs of cols. */ + printf("\nTesting Dataset2 write by COL\n"); + /* Create a large dataset */ + dims[0] = bigcount; + dims[1] = mpi_size; + sid = H5Screate_simple (RANK, dims, NULL); + VRFY((sid >= 0), "H5Screate_simple succeeded"); + dataset = H5Dcreate2(fid, DATASET2, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); + H5Sclose(sid); + + block[0] = dims[0]; + block[1] = dims[1]/mpi_size; + stride[0] = block[0]; + stride[1] = block[1]; + count[0] = 1; + count[1] = 1; + start[0] = 0; + start[1] = mpi_rank*block[1]; + + /* create a file dataspace independently */ + file_dataspace = H5Dget_space (dataset); + 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 independently */ + mem_dataspace = H5Screate_simple (RANK, block, NULL); + VRFY((mem_dataspace >= 0), ""); + + /* fill the local slab with some trivial data */ + fill_datasets(start, block, wdata); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + dataset_print(start, block, wdata); + } + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* write data collectively */ + MESG("writeAll by Col"); + { + int j,k =0; + for (i=0; i < block[0]; i++){ + for (j=0; j < block[1]; j++){ + if(k < 10) { + printf("%lld ", wdata[k]); + k++; + } + } + } + printf("\n"); + } + + ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, + xfer_plist, wdata); + VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + ret = H5Dclose(dataset); + VRFY((ret >= 0), "H5Dclose1 succeeded"); + + + + /* ALL selection */ + printf("\nTesting Dataset3 write select ALL proc 0, NONE others\n"); + /* Create a large dataset */ + dims[0] = bigcount; + dims[1] = 1; + sid = H5Screate_simple (RANK, dims, NULL); + VRFY((sid >= 0), "H5Screate_simple succeeded"); + dataset = H5Dcreate2(fid, DATASET3, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); + H5Sclose(sid); + + /* create a file dataspace independently */ + file_dataspace = H5Dget_space (dataset); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + if(MAINPROCESS) { + ret = H5Sselect_all(file_dataspace); + VRFY((ret >= 0), "H5Sset_all succeeded"); + } + else { + ret = H5Sselect_none(file_dataspace); + VRFY((ret >= 0), "H5Sset_none succeeded"); + } + + /* create a memory dataspace independently */ + mem_dataspace = H5Screate_simple (RANK, dims, NULL); + VRFY((mem_dataspace >= 0), ""); + if(!MAINPROCESS) { + ret = H5Sselect_none(mem_dataspace); + VRFY((ret >= 0), "H5Sset_none succeeded"); + } + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* fill the local slab with some trivial data */ + fill_datasets(start, dims, wdata); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + } + + /* write data collectively */ + MESG("writeAll by process 0"); + { + int j,k =0; + for (i=0; i < block[0]; i++){ + for (j=0; j < block[1]; j++){ + if(k < 10) { + printf("%lld ", wdata[k]); + k++; + } + } + } + printf("\n"); + } + + ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, + xfer_plist, wdata); + VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + ret = H5Dclose(dataset); + VRFY((ret >= 0), "H5Dclose1 succeeded"); + + /* Point selection */ + printf("\nTesting Dataset4 write point selection\n"); + /* Create a large dataset */ + dims[0] = bigcount; + dims[1] = mpi_size * 4; + sid = H5Screate_simple (RANK, dims, NULL); + VRFY((sid >= 0), "H5Screate_simple succeeded"); + dataset = H5Dcreate2(fid, DATASET4, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); + H5Sclose(sid); + + block[0] = dims[0]/2; + block[1] = 2; + stride[0] = dims[0]/2; + stride[1] = 2; + count[0] = 1; + count[1] = 1; + start[0] = 0; + start[1] = dims[1]/mpi_size * mpi_rank; + + num_points = bigcount; + + coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); + VRFY((coords != NULL), "coords malloc succeeded"); + + set_coords (start, count, stride, block, num_points, coords, IN_ORDER); + /* create a file dataspace */ + file_dataspace = H5Dget_space (dataset); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + if(coords) free(coords); + + fill_datasets(start, block, wdata); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + dataset_print(start, block, wdata); + } + + /* create a memory dataspace */ + mem_dataspace = H5Screate_simple (1, &bigcount, NULL); + VRFY((mem_dataspace >= 0), ""); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, + xfer_plist, wdata); + VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + ret = H5Dclose(dataset); + VRFY((ret >= 0), "H5Dclose1 succeeded"); + + /* Irregular selection */ + /* Need larger memory for data buffer */ + free(wdata); +#if 0 + wdata = (B_DATATYPE *)malloc(bigcount*4*sizeof(B_DATATYPE)); + VRFY((wdata != NULL), "wdata malloc succeeded"); + + printf("\nTesting Dataset5 write irregular selection\n"); + /* Create a large dataset */ + dims[0] = bigcount/6; + dims[1] = mpi_size * 4; + sid = H5Screate_simple (RANK, dims, NULL); + VRFY((sid >= 0), "H5Screate_simple succeeded"); + dataset = H5Dcreate2(fid, DATASET5, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); + H5Sclose(sid); + + /* first select 1 col in this procs splice */ + block[0] = dims[0]; + block[1] = 1; + stride[0] = block[0]; + stride[1] = block[1]; + count[0] = 1; + count[1] = 1; + start[0] = 0; + start[1] = mpi_rank * 4; + + /* create a file dataspace */ + file_dataspace = H5Dget_space (dataset); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + + dims[1] = 4; + /* create a memory dataspace */ + mem_dataspace = H5Screate_simple (RANK, dims, NULL); + VRFY((mem_dataspace >= 0), ""); + + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + start[1] = 0; + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + /* select every other row in the process splice and OR it with + the col selection to create an irregular selection */ + for(h=0 ; h= 0), "H5Sset_hyperslab succeeded"); + + start[1] = 0; + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_OR, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + } + printf("Setting up for collective transfer\n"); + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* fill the local slab with some trivial data */ + fill_datasets(start, dims, wdata); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + } + + ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, + xfer_plist, wdata); + VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + ret = H5Dclose(dataset); + VRFY((ret >= 0), "H5Dclose1 succeeded"); + + free(wdata); +#endif + H5Fclose(fid); +} + +/* + * Example of using the parallel HDF5 library to read two datasets + * in one HDF5 file with collective parallel access support. + * The Datasets are of sizes (number-of-mpi-processes x dim0) x dim1. + * Each process controls only a slab of size dim0 x dim1 within each + * dataset. [Note: not so yet. Datasets are of sizes dim0xdim1 and + * each process controls a hyperslab within.] + */ + +static void +dataset_big_read(void) +{ + hid_t fid; /* HDF5 file ID */ + hid_t acc_tpl; /* File access templates */ + hid_t xfer_plist; /* Dataset transfer properties list */ + hid_t file_dataspace; /* File dataspace ID */ + hid_t mem_dataspace; /* memory dataspace ID */ + hid_t dataset; + B_DATATYPE *rdata = NULL; /* data buffer */ + B_DATATYPE *wdata = NULL; /* expected data buffer */ + hsize_t dims[RANK]; /* dataset dim sizes */ + hsize_t start[RANK]; /* for hyperslab setting */ + hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ + hsize_t block[RANK]; /* for hyperslab setting */ + int i,j,k; + hsize_t h; + size_t num_points; + hsize_t *coords = NULL; + herr_t ret; /* Generic return value */ + + /* allocate memory for data buffer */ + rdata = (B_DATATYPE *)malloc(bigcount*sizeof(B_DATATYPE)); + VRFY((rdata != NULL), "rdata malloc succeeded"); + wdata = (B_DATATYPE *)malloc(bigcount*sizeof(B_DATATYPE)); + VRFY((wdata != NULL), "wdata malloc succeeded"); + + memset(rdata, 0, bigcount*sizeof(B_DATATYPE)); + + /* setup file access template */ + acc_tpl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((acc_tpl >= 0), "H5P_FILE_ACCESS"); + H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); + + /* open the file collectively */ + fid=H5Fopen(filename,H5F_ACC_RDONLY,acc_tpl); + VRFY((fid >= 0), "H5Fopen succeeded"); + + /* Release file-access template */ + ret = H5Pclose(acc_tpl); + VRFY((ret >= 0), ""); + + + printf("\nRead Testing Dataset1 by COL\n"); + dataset = H5Dopen2(fid, DATASET1, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dopen2 succeeded"); + + dims[0] = bigcount; + dims[1] = mpi_size; + /* Each process takes a slabs of cols. */ + block[0] = dims[0]; + block[1] = dims[1]/mpi_size; + stride[0] = block[0]; + stride[1] = block[1]; + count[0] = 1; + count[1] = 1; + start[0] = 0; + start[1] = mpi_rank*block[1]; + + /* create a file dataspace independently */ + file_dataspace = H5Dget_space (dataset); + 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 independently */ + mem_dataspace = H5Screate_simple (RANK, block, NULL); + VRFY((mem_dataspace >= 0), ""); + + /* fill dataset with test data */ + fill_datasets(start, block, wdata); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + } + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, + xfer_plist, rdata); + VRFY((ret >= 0), "H5Dread dataset1 succeeded"); + + { + for (i=0; i < block[0]; i++){ + for (j=0; j < block[1]; j++){ + if(k < 10) { + printf("%lld ", rdata[k]); + k++; + } + } + } + printf("\n"); + } + + /* verify the read data with original expected data */ + ret = verify_data(start, count, stride, block, rdata, wdata); + if(ret) {fprintf(stderr, "verify failed\n"); exit(1);} + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + ret = H5Dclose(dataset); + VRFY((ret >= 0), "H5Dclose1 succeeded"); + + + printf("\nRead Testing Dataset2 by ROW\n"); + memset(rdata, 0, bigcount*sizeof(B_DATATYPE)); + dataset = H5Dopen2(fid, DATASET2, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dopen2 succeeded"); + + dims[0] = bigcount; + dims[1] = mpi_size; + /* Each process takes a slabs of rows. */ + block[0] = dims[0]/mpi_size; + block[1] = dims[1]; + stride[0] = block[0]; + stride[1] = block[1]; + count[0] = 1; + count[1] = 1; + start[0] = mpi_rank*block[0]; + start[1] = 0; + + /* create a file dataspace independently */ + file_dataspace = H5Dget_space (dataset); + 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 independently */ + mem_dataspace = H5Screate_simple (RANK, block, NULL); + VRFY((mem_dataspace >= 0), ""); + + /* fill dataset with test data */ + fill_datasets(start, block, wdata); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + } + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, + xfer_plist, rdata); + VRFY((ret >= 0), "H5Dread dataset2 succeeded"); + + { + for (i=0; i < block[0]; i++){ + for (j=0; j < block[1]; j++){ + if(k < 10) { + printf("%lld ", rdata[k]); + k++; + } + } + } + printf("\n"); + } + + /* verify the read data with original expected data */ + ret = verify_data(start, count, stride, block, rdata, wdata); + if(ret) {fprintf(stderr, "verify failed\n"); exit(1);} + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + ret = H5Dclose(dataset); + VRFY((ret >= 0), "H5Dclose1 succeeded"); + + + printf("\nRead Testing Dataset3 read select ALL proc 0, NONE others\n"); + memset(rdata, 0, bigcount*sizeof(B_DATATYPE)); + dataset = H5Dopen2(fid, DATASET3, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dopen2 succeeded"); + + dims[0] = bigcount; + dims[1] = 1; + + /* create a file dataspace independently */ + file_dataspace = H5Dget_space (dataset); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + if(MAINPROCESS) { + ret = H5Sselect_all(file_dataspace); + VRFY((ret >= 0), "H5Sset_all succeeded"); + } + else { + ret = H5Sselect_none(file_dataspace); + VRFY((ret >= 0), "H5Sset_none succeeded"); + } + + /* create a memory dataspace independently */ + mem_dataspace = H5Screate_simple (RANK, dims, NULL); + VRFY((mem_dataspace >= 0), ""); + if(!MAINPROCESS) { + ret = H5Sselect_none(mem_dataspace); + VRFY((ret >= 0), "H5Sset_none succeeded"); + } + + /* fill dataset with test data */ + fill_datasets(start, dims, wdata); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + } + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, + xfer_plist, rdata); + VRFY((ret >= 0), "H5Dread dataset3 succeeded"); + + { + for (i=0; i < block[0]; i++){ + for (j=0; j < block[1]; j++){ + if(k < 10) { + printf("%lld ", rdata[k]); + k++; + } + } + } + printf("\n"); + } + + if(MAINPROCESS) { + /* verify the read data with original expected data */ + ret = verify_data(start, count, stride, block, rdata, wdata); + if(ret) {fprintf(stderr, "verify failed\n"); exit(1);} + } + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + ret = H5Dclose(dataset); + VRFY((ret >= 0), "H5Dclose1 succeeded"); + + printf("\nRead Testing Dataset4 with Point selection\n"); + dataset = H5Dopen2(fid, DATASET4, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dopen2 succeeded"); + + dims[0] = bigcount; + dims[1] = mpi_size * 4; + + block[0] = dims[0]/2; + block[1] = 2; + stride[0] = dims[0]/2; + stride[1] = 2; + count[0] = 1; + count[1] = 1; + start[0] = 0; + start[1] = dims[1]/mpi_size * mpi_rank; + + fill_datasets(start, block, wdata); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + dataset_print(start, block, wdata); + } + + num_points = bigcount; + + coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); + VRFY((coords != NULL), "coords malloc succeeded"); + + set_coords (start, count, stride, block, num_points, coords, IN_ORDER); + /* create a file dataspace */ + file_dataspace = H5Dget_space (dataset); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + if(coords) free(coords); + + /* create a memory dataspace */ + mem_dataspace = H5Screate_simple (1, &bigcount, NULL); + VRFY((mem_dataspace >= 0), ""); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, + xfer_plist, rdata); + VRFY((ret >= 0), "H5Dread dataset1 succeeded"); + + ret = verify_data(start, count, stride, block, rdata, wdata); + if(ret) {fprintf(stderr, "verify failed\n"); exit(1);} + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + ret = H5Dclose(dataset); + VRFY((ret >= 0), "H5Dclose1 succeeded"); + + printf("\nRead Testing Dataset5 with Irregular selection\n"); + /* Need larger memory for data buffer */ + free(wdata); + free(rdata); +#if 0 + wdata = (B_DATATYPE *)malloc(bigcount*4*sizeof(B_DATATYPE)); + VRFY((wdata != NULL), "wdata malloc succeeded"); + rdata = (B_DATATYPE *)malloc(bigcount*4*sizeof(B_DATATYPE)); + VRFY((rdata != NULL), "rdata malloc succeeded"); + + dataset = H5Dopen2(fid, DATASET5, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dopen2 succeeded"); + + dims[0] = bigcount; + dims[1] = mpi_size * 4; + + /* first select 1 col in this proc splice */ + block[0] = dims[0]; + block[1] = 1; + stride[0] = block[0]; + stride[1] = block[1]; + count[0] = 1; + count[1] = 1; + start[0] = 0; + start[1] = mpi_rank * 4; + + /* get file dataspace */ + file_dataspace = H5Dget_space (dataset); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + + /* create a memory dataspace */ + dims[1] = 4; + mem_dataspace = H5Screate_simple (RANK, dims, NULL); + VRFY((mem_dataspace >= 0), ""); + + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + start[1] = 0; + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + /* select every other row in the process splice and OR it with + the col selection to create an irregular selection */ + for(h=0 ; h= 0), "H5Sset_hyperslab succeeded"); + + start[1] = 0; + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_OR, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + //fprintf(stderr, "%d: %d - %d\n", mpi_rank, (int)h, (int)H5Sget_select_npoints(mem_dataspace)); + } + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, + xfer_plist, rdata); + VRFY((ret >= 0), "H5Dread dataset1 succeeded"); + + /* fill dataset with test data */ + fill_datasets(start, dims, wdata); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + } + + + + /* verify the read data with original expected data */ + block[0] = dims[0]; + block[1] = 1; + stride[0] = block[0]; + stride[1] = block[1]; + count[0] = 1; + count[1] = 1; + start[0] = 0; + start[1] = 0; + ret = verify_data(start, count, stride, block, rdata, wdata); + if(ret) {fprintf(stderr, "verify failed\n"); exit(1);} + + for(h=0 ; h= 0), "H5Dclose1 succeeded"); + + H5Fclose(fid); + + /* release data buffers */ + if(rdata) free(rdata); + if(wdata) free(wdata); +#endif +} /* dataset_large_readAll */ + + +/* + * Create the appropriate File access property list + */ +hid_t +create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) +{ + hid_t ret_pl = -1; + herr_t ret; /* generic return value */ + int mpi_rank; /* mpi variables */ + + /* need the rank for error checking macros */ + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + + ret_pl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((ret_pl >= 0), "H5P_FILE_ACCESS"); + + if (l_facc_type == FACC_DEFAULT) + return (ret_pl); + + if (l_facc_type == FACC_MPIO){ + /* set Parallel access with communicator */ + ret = H5Pset_fapl_mpio(ret_pl, comm, info); + VRFY((ret >= 0), ""); + ret = H5Pset_all_coll_metadata_ops(ret_pl, TRUE); + VRFY((ret >= 0), ""); + ret = H5Pset_coll_metadata_write(ret_pl, TRUE); + VRFY((ret >= 0), ""); + return(ret_pl); + } + + if (l_facc_type == (FACC_MPIO | FACC_SPLIT)){ + hid_t mpio_pl; + + mpio_pl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((mpio_pl >= 0), ""); + /* set Parallel access with communicator */ + ret = H5Pset_fapl_mpio(mpio_pl, comm, info); + VRFY((ret >= 0), ""); + + /* setup file access template */ + ret_pl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((ret_pl >= 0), ""); + /* set Parallel access with communicator */ + ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl); + VRFY((ret >= 0), "H5Pset_fapl_split succeeded"); + H5Pclose(mpio_pl); + return(ret_pl); + } + + /* unknown file access types */ + return (ret_pl); +} + + +/*------------------------------------------------------------------------- + * Function: coll_chunk1 + * + * Purpose: Wrapper to test the collective chunk IO for regular JOINT + selection with a single chunk + * + * Return: Success: 0 + * + * Failure: -1 + * + * Programmer: Unknown + * July 12th, 2004 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ + +/* ------------------------------------------------------------------------ + * Descriptions for the selection: One big singluar selection inside one chunk + * Two dimensions, + * + * dim1 = space_dim1(5760)*mpi_size + * dim2 = space_dim2(3) + * chunk_dim1 = dim1 + * chunk_dim2 = dim2 + * block = 1 for all dimensions + * stride = 1 for all dimensions + * count0 = space_dim1(5760) + * count1 = space_dim2(3) + * start0 = mpi_rank*space_dim1 + * start1 = 0 + * ------------------------------------------------------------------------ + */ + +void +coll_chunk1(void) +{ + if (MAINPROCESS) + printf("coll_chunk1\n"); + + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, HYPER, IN_ORDER); +} + + +/*------------------------------------------------------------------------- + * Function: coll_chunk2 + * + * Purpose: Wrapper to test the collective chunk IO for regular DISJOINT + selection with a single chunk + * + * Return: Success: 0 + * + * Failure: -1 + * + * Programmer: Unknown + * July 12th, 2004 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ + + /* ------------------------------------------------------------------------ + * Descriptions for the selection: many disjoint selections inside one chunk + * Two dimensions, + * + * dim1 = space_dim1*mpi_size(5760) + * dim2 = space_dim2(3) + * chunk_dim1 = dim1 + * chunk_dim2 = dim2 + * block = 1 for all dimensions + * stride = 3 for all dimensions + * count0 = space_dim1/stride0(5760/3) + * count1 = space_dim2/stride(3/3 = 1) + * start0 = mpi_rank*space_dim1 + * start1 = 0 + * + * ------------------------------------------------------------------------ + */ +void +coll_chunk2(void) +{ + if (MAINPROCESS) + printf("coll_chunk2\n"); + + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, HYPER, IN_ORDER); +} + + +/*------------------------------------------------------------------------- + * Function: coll_chunk3 + * + * Purpose: Wrapper to test the collective chunk IO for regular JOINT + selection with at least number of 2*mpi_size chunks + * + * Return: Success: 0 + * + * Failure: -1 + * + * Programmer: Unknown + * July 12th, 2004 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ + +/* ------------------------------------------------------------------------ + * Descriptions for the selection: one singular selection accross many chunks + * Two dimensions, Num of chunks = 2* mpi_size + * + * dim1 = space_dim1*mpi_size + * dim2 = space_dim2(3) + * chunk_dim1 = space_dim1 + * chunk_dim2 = dim2/2 + * block = 1 for all dimensions + * stride = 1 for all dimensions + * count0 = space_dim1 + * count1 = space_dim2(3) + * start0 = mpi_rank*space_dim1 + * start1 = 0 + * + * ------------------------------------------------------------------------ + */ + +void +coll_chunk3(void) +{ + if (MAINPROCESS) + printf("coll_chunk3\n"); + + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, HYPER, IN_ORDER); +} + + +//------------------------------------------------------------------------- +// Borrowed/Modified (slightly) from t_coll_chunk.c +/*------------------------------------------------------------------------- + * Function: coll_chunktest + * + * Purpose: The real testing routine for regular selection of collective + chunking storage + testing both write and read, + If anything fails, it may be read or write. There is no + separation test between read and write. + * + * Return: Success: 0 + * + * Failure: -1 + * + * Modifications: + * Remove invalid temporary property checkings for API_LINK_HARD and + * API_LINK_TRUE cases. + * Programmer: Jonathan Kim + * Date: 2012-10-10 + * + * Programmer: Unknown + * July 12th, 2004 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ + +static void +coll_chunktest(const char* filename, + int chunk_factor, + int select_factor, + int api_option, + int file_selection, + int mem_selection, + int mode) +{ + hid_t file, dataset, file_dataspace, mem_dataspace; + hid_t acc_plist,xfer_plist,crp_plist; + + hsize_t dims[RANK], chunk_dims[RANK]; + int* data_array1 = NULL; + int* data_origin1 = NULL; + + hsize_t start[RANK],count[RANK],stride[RANK],block[RANK]; + +#ifdef H5_HAVE_INSTRUMENTED_LIBRARY + unsigned prop_value; +#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ + + herr_t status; + MPI_Comm comm = MPI_COMM_WORLD; + MPI_Info info = MPI_INFO_NULL; + + size_t num_points; /* for point selection */ + hsize_t *coords = NULL; /* for point selection */ + hsize_t current_dims; /* for point selection */ + int i; + + /* Create the data space */ + + acc_plist = create_faccess_plist(comm,info,facc_type); + VRFY((acc_plist >= 0),""); + + file = H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_plist); + VRFY((file >= 0),"H5Fcreate succeeded"); + + status = H5Pclose(acc_plist); + VRFY((status >= 0),""); + + /* setup dimensionality object */ + dims[0] = space_dim1*mpi_size; + dims[1] = space_dim2; + + /* allocate memory for data buffer */ + data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + + /* set up dimensions of the slab this process accesses */ + ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); + + /* set up the coords array selection */ + num_points = block[0] * block[1] * count[0] * count[1]; + coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + VRFY((coords != NULL), "coords malloc succeeded"); + point_set(start, count, stride, block, num_points, coords, mode); + + file_dataspace = H5Screate_simple(2, dims, NULL); + VRFY((file_dataspace >= 0), "file dataspace created succeeded"); + + if(ALL != mem_selection) { + mem_dataspace = H5Screate_simple(2, dims, NULL); + VRFY((mem_dataspace >= 0), "mem dataspace created succeeded"); + } + else { + current_dims = num_points; + mem_dataspace = H5Screate_simple (1, ¤t_dims, NULL); + VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + } + + crp_plist = H5Pcreate(H5P_DATASET_CREATE); + VRFY((crp_plist >= 0),""); + + /* Set up chunk information. */ + chunk_dims[0] = dims[0]/chunk_factor; + + /* to decrease the testing time, maintain bigger chunk size */ + (chunk_factor == 1) ? (chunk_dims[1] = space_dim2) : (chunk_dims[1] = space_dim2/2); + status = H5Pset_chunk(crp_plist, 2, chunk_dims); + VRFY((status >= 0),"chunk creation property list succeeded"); + + dataset = H5Dcreate2(file, DSET_COLLECTIVE_CHUNK_NAME, H5T_NATIVE_INT, + file_dataspace, H5P_DEFAULT, crp_plist, H5P_DEFAULT); + VRFY((dataset >= 0),"dataset created succeeded"); + + status = H5Pclose(crp_plist); + VRFY((status >= 0), ""); + + /*put some trivial data in the data array */ + ccdataset_fill(start, stride, count,block, data_array1, mem_selection); + + MESG("data_array initialized"); + + switch (file_selection) { + case HYPER: + status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(file_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(file_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } + + switch (mem_selection) { + case HYPER: + status = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(mem_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(mem_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } + + /* set up the collective transfer property list */ + xfer_plist = H5Pcreate(H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + + status = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((status>= 0),"MPIO collective transfer property succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + status = H5Pset_dxpl_mpio_collective_opt(xfer_plist, H5FD_MPIO_INDIVIDUAL_IO); + VRFY((status>= 0),"set independent IO collectively succeeded"); + } + + switch(api_option){ + case API_LINK_HARD: + status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_ONE_IO); + VRFY((status>= 0),"collective chunk optimization succeeded"); + break; + + case API_MULTI_HARD: + status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_MULTI_IO); + VRFY((status>= 0),"collective chunk optimization succeeded "); + break; + + case API_LINK_TRUE: + status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,2); + VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); + break; + + case API_LINK_FALSE: + status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,6); + VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); + break; + + case API_MULTI_COLL: + status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */ + VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); + status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,50); + VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded"); + break; + + case API_MULTI_IND: + status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */ + VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); + status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,100); + VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded"); + break; + + default: + ; + } + +#ifdef H5_HAVE_INSTRUMENTED_LIBRARY + if(facc_type == FACC_MPIO) { + switch(api_option) { + case API_LINK_HARD: + prop_value = H5D_XFER_COLL_CHUNK_DEF; + status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, + NULL, NULL, NULL, NULL, NULL, NULL); + VRFY((status >= 0),"testing property list inserted succeeded"); + break; + + case API_MULTI_HARD: + prop_value = H5D_XFER_COLL_CHUNK_DEF; + status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, + NULL, NULL, NULL, NULL, NULL, NULL); + VRFY((status >= 0),"testing property list inserted succeeded"); + break; + + case API_LINK_TRUE: + prop_value = H5D_XFER_COLL_CHUNK_DEF; + status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, + NULL, NULL, NULL, NULL, NULL, NULL); + VRFY((status >= 0),"testing property list inserted succeeded"); + break; + + case API_LINK_FALSE: + prop_value = H5D_XFER_COLL_CHUNK_DEF; + status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, + NULL, NULL, NULL, NULL, NULL, NULL); + VRFY((status >= 0),"testing property list inserted succeeded"); + break; + + case API_MULTI_COLL: + prop_value = H5D_XFER_COLL_CHUNK_DEF; + status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, + NULL, NULL, NULL, NULL, NULL, NULL); + VRFY((status >= 0),"testing property list inserted succeeded"); + break; + + case API_MULTI_IND: + prop_value = H5D_XFER_COLL_CHUNK_DEF; + status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, + NULL, NULL, NULL, NULL, NULL, NULL); + VRFY((status >= 0),"testing property list inserted succeeded"); + break; + + default: + ; + } + } +#endif + + /* write data collectively */ + status = H5Dwrite(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((status >= 0),"dataset write succeeded"); + +#ifdef H5_HAVE_INSTRUMENTED_LIBRARY + if(facc_type == FACC_MPIO) { + switch(api_option){ + case API_LINK_HARD: + status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_HARD_NAME,&prop_value); + VRFY((status >= 0),"testing property list get succeeded"); + VRFY((prop_value == 0),"API to set LINK COLLECTIVE IO directly succeeded"); + break; + + case API_MULTI_HARD: + status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME,&prop_value); + VRFY((status >= 0),"testing property list get succeeded"); + VRFY((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO optimization succeeded"); + break; + + case API_LINK_TRUE: + status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME,&prop_value); + VRFY((status >= 0),"testing property list get succeeded"); + VRFY((prop_value == 0),"API to set LINK COLLECTIVE IO succeeded"); + break; + + case API_LINK_FALSE: + status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME,&prop_value); + VRFY((status >= 0),"testing property list get succeeded"); + VRFY((prop_value == 0),"API to set LINK IO transferring to multi-chunk IO succeeded"); + break; + + case API_MULTI_COLL: + status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME,&prop_value); + VRFY((status >= 0),"testing property list get succeeded"); + VRFY((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO with optimization succeeded"); + break; + + case API_MULTI_IND: + status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME,&prop_value); + VRFY((status >= 0),"testing property list get succeeded"); + VRFY((prop_value == 0),"API to set MULTI-CHUNK IO transferring to independent IO succeeded"); + break; + + default: + ; + } + } +#endif + + status = H5Dclose(dataset); + VRFY((status >= 0),""); + + status = H5Pclose(xfer_plist); + VRFY((status >= 0),"property list closed"); + + status = H5Sclose(file_dataspace); + VRFY((status >= 0),""); + + status = H5Sclose(mem_dataspace); + VRFY((status >= 0),""); + + + status = H5Fclose(file); + VRFY((status >= 0),""); + + if (data_array1) HDfree(data_array1); + + /* Use collective read to verify the correctness of collective write. */ + + /* allocate memory for data buffer */ + data_array1 = (int *)HDmalloc(dims[0]*dims[1]*sizeof(int)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + + /* allocate memory for data buffer */ + data_origin1 = (int *)HDmalloc(dims[0]*dims[1]*sizeof(int)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); + + acc_plist = create_faccess_plist(comm, info, facc_type); + VRFY((acc_plist >= 0),"MPIO creation property list succeeded"); + + file = H5Fopen(filename,H5F_ACC_RDONLY,acc_plist); + VRFY((file >= 0),"H5Fcreate succeeded"); + + status = H5Pclose(acc_plist); + VRFY((status >= 0),""); + + /* open the collective dataset*/ + dataset = H5Dopen2(file, DSET_COLLECTIVE_CHUNK_NAME, H5P_DEFAULT); + VRFY((dataset >= 0), ""); + + /* set up dimensions of the slab this process accesses */ + ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); + + /* obtain the file and mem dataspace*/ + file_dataspace = H5Dget_space (dataset); + VRFY((file_dataspace >= 0), ""); + + if (ALL != mem_selection) { + mem_dataspace = H5Dget_space (dataset); + VRFY((mem_dataspace >= 0), ""); + } + else { + current_dims = num_points; + mem_dataspace = H5Screate_simple (1, ¤t_dims, NULL); + VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + } + + switch (file_selection) { + case HYPER: + status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(file_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(file_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } + + switch (mem_selection) { + case HYPER: + status = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(mem_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(mem_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } + + /* fill dataset with test data */ + ccdataset_fill(start, stride,count,block, data_origin1, mem_selection); + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0),""); + + status = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((status>= 0),"MPIO collective transfer property succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + status = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((status>= 0),"set independent IO collectively succeeded"); + } + + status = H5Dread(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((status >=0),"dataset read succeeded"); + + /* verify the read data with original expected data */ + status = ccdataset_vrfy(start, count, stride, block, data_array1, data_origin1, mem_selection); + if (status) nerrors++; + + status = H5Pclose(xfer_plist); + VRFY((status >= 0),"property list closed"); + + /* close dataset collectively */ + status=H5Dclose(dataset); + VRFY((status >= 0), "H5Dclose"); + + /* release all IDs created */ + status = H5Sclose(file_dataspace); + VRFY((status >= 0),"H5Sclose"); + + status = H5Sclose(mem_dataspace); + VRFY((status >= 0),"H5Sclose"); + + /* close the file collectively */ + status = H5Fclose(file); + VRFY((status >= 0),"H5Fclose"); + + /* release data buffers */ + if(coords) HDfree(coords); + if(data_array1) HDfree(data_array1); + if(data_origin1) HDfree(data_origin1); + +} + + + + + +int main(int argc, char **argv) +{ + + hsize_t newsize = 1048576; + hsize_t oldsize = H5S_mpio_set_bigio_count(newsize); + if (newsize != oldsize) { + bigcount = newsize * 2; + } + + MPI_Init(&argc, &argv); + MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + + dataset_big_write(); + MPI_Barrier(MPI_COMM_WORLD); + + dataset_big_read(); + MPI_Barrier(MPI_COMM_WORLD); + + oldsize = H5S_mpio_set_bigio_count(16384); + + coll_chunk1(); + MPI_Barrier(MPI_COMM_WORLD); + coll_chunk2(); + MPI_Barrier(MPI_COMM_WORLD); + coll_chunk3(); + MPI_Barrier(MPI_COMM_WORLD); + + MPI_Finalize(); + + return 0; +} + -- cgit v0.12 From 64d33e5e6e4b4270a3982c1be384cb41a0aa4c3b Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Wed, 5 Jul 2017 16:19:57 -0400 Subject: Commited changes to the development branch here to allow a pull request to be published --- src/H5Smpio.c | 504 ++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 458 insertions(+), 46 deletions(-) diff --git a/src/H5Smpio.c b/src/H5Smpio.c index c24c455..7319a80 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -33,7 +33,7 @@ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ #include "H5Spkg.h" /* Dataspaces */ -#include "H5VMprivate.h" /* Vector and array functions */ +#include "H5VMprivate.h" /* Vector and array functions */ #ifdef H5_HAVE_PARALLEL @@ -55,9 +55,42 @@ static herr_t H5S_mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, hbool_t *is_derived_type); static herr_t H5S_obtain_datatype(const hsize_t down[], H5S_hyper_span_t* span, const MPI_Datatype *elmt_type, MPI_Datatype *span_type, size_t elmt_size); +static herr_t H5S_mpio_create_large_type (hsize_t, MPI_Aint, MPI_Datatype , MPI_Datatype *); + #define H5S_MPIO_INITIAL_ALLOC_COUNT 256 +#define TWO_GIG_LIMIT 2147483648 + +#ifndef H5S_MAX_MPI_COUNT +#define H5S_MAX_MPI_COUNT 536870911 /* (2^29)-1 */ +#endif + +static hsize_t bigio_count = H5S_MAX_MPI_COUNT; + +/*------------------------------------------------------------------------- + * Function: H5S_mpio_set_bigio_count + * + * Purpose: Allow us to programatically change the switch point + * when we utilize derived datatypes. This is of + * particular interest for allowing nightly testing + * + * Return: the current/previous value of bigio_count. + * + * Programmer: Richard Warren, March 10, 2017 + * + *------------------------------------------------------------------------- + */ +hsize_t +H5S_mpio_set_bigio_count(hsize_t new_count) +{ + hsize_t orig_count = bigio_count; + if ((new_count > 0) && (new_count < TWO_GIG_LIMIT)) { + bigio_count = new_count; + } + return orig_count; +} + /*------------------------------------------------------------------------- * Function: H5S_mpio_all_type @@ -72,6 +105,11 @@ static herr_t H5S_obtain_datatype(const hsize_t down[], H5S_hyper_span_t* span, * *is_derived_type 0 if MPI primitive type, 1 if derived * * Programmer: rky 980813 + * Modifications: + * Mohamad Chaarawi + * Adding support for large datatypes (beyond the limit of a + * 32 bit integer. + * * *------------------------------------------------------------------------- */ @@ -95,11 +133,22 @@ H5S_mpio_all_type(const H5S_t *space, size_t elmt_size, H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t); total_bytes = (hsize_t)elmt_size * nelmts; - - /* fill in the return values */ - *new_type = MPI_BYTE; - H5_CHECKED_ASSIGN(*count, int, total_bytes, hsize_t); - *is_derived_type = FALSE; + /* Verify that the size can be expressed as a 32 bit integer */ + if(bigio_count >= total_bytes) { + /* fill in the return values */ + *new_type = MPI_BYTE; + H5_CHECKED_ASSIGN(*count, int, total_bytes, hsize_t); + *is_derived_type = FALSE; + } + else { + /* Create a LARGE derived datatype for this transfer */ + if (H5S_mpio_create_large_type (total_bytes, 0, MPI_BYTE, new_type) < 0) { + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, + "couldn't create a large datatype from the all selection") + } + *count = 1; + *is_derived_type = TRUE; + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -167,27 +216,103 @@ H5S_mpio_create_point_datatype (size_t elmt_size, hsize_t num_points, HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) elmt_type_created = TRUE; + /* Check whether standard or BIGIO processing will be employeed */ + if(bigio_count >= num_points) { #if MPI_VERSION >= 3 - /* Create an MPI datatype for the whole point selection */ - if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block((int)num_points, 1, disp, elmt_type, new_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_indexed_block failed", mpi_code) + /* Create an MPI datatype for the whole point selection */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block((int)num_points, 1, disp, elmt_type, new_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_indexed_block failed", mpi_code) #else - /* Allocate block sizes for MPI datatype call */ - if(NULL == (blocks = (int *)H5MM_malloc(sizeof(int) * num_points))) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of blocks") + /* Allocate block sizes for MPI datatype call */ + if(NULL == (blocks = (int *)H5MM_malloc(sizeof(int) * num_points))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of blocks") - for(u = 0; u < num_points; u++) - blocks[u] = 1; + for(u = 0; u < num_points; u++) + blocks[u] = 1; - /* Create an MPI datatype for the whole point selection */ - if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)num_points, blocks, disp, elmt_type, new_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_indexed_block failed", mpi_code) + /* Create an MPI datatype for the whole point selection */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)num_points, blocks, disp, elmt_type, new_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_indexed_block failed", mpi_code) #endif - /* Commit MPI datatype for later use */ - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + /* Commit MPI datatype for later use */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + } + else { + /* use LARGE_DATATYPE:: + * We'll create an hindexed_block type for every 2G point count and then combine + * those and any remaining points into a single large datatype. + */ + int total_types, i; + int remaining_points; + int num_big_types; + hsize_t leftover; + + int *inner_blocks; + MPI_Aint *inner_disps; + MPI_Datatype *inner_types = NULL; + + /* Calculate how many Big MPI datatypes are needed to represent the buffer */ + num_big_types = (int)(num_points/bigio_count); + + leftover = (hsize_t)num_points - (hsize_t)num_big_types * (hsize_t)bigio_count; + H5_CHECKED_ASSIGN(remaining_points, int, leftover, hsize_t); + + total_types = (int)(remaining_points) ? (num_big_types + 1) : num_big_types; + + /* Allocate array if MPI derived types needed */ + if(NULL == (inner_types = (MPI_Datatype *)H5MM_malloc((sizeof(MPI_Datatype) * (size_t)total_types)))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of blocks") + + if(NULL == (inner_blocks = (int *)H5MM_malloc(sizeof(int) * (size_t)total_types))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of blocks") + + if(NULL == (inner_disps = (MPI_Aint *)H5MM_malloc(sizeof(MPI_Aint) * (size_t)total_types))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of blocks") + + for(i=0 ; i= elmt_size) { + /* Use a single MPI datatype that has a 32 bit size */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE, &inner_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + } + else { + /* Create the compound datatype for this operation (> 2GB) */ + if (H5S_mpio_create_large_type (elmt_size, 0, MPI_BYTE, &inner_type) < 0) { + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, + "couldn't ccreate a large inner datatype in hyper selection") + } + } /******************************************************* * Construct the type by walking the hyperslab dims @@ -645,30 +790,93 @@ H5S_mpio_hyper_type(const H5S_t *space, size_t elmt_size, *******************************************************/ for(i = ((int)rank) - 1; i >= 0; --i) { #ifdef H5S_DEBUG - if(H5DEBUG(S)) - HDfprintf(H5DEBUG(S), "%s: Dimension i=%d \n" - "start=%Hd count=%Hu block=%Hu stride=%Hu, xtent=%Hu max_xtent=%d\n", - FUNC, i, d[i].start, d[i].count, d[i].block, d[i].strid, d[i].xtent, max_xtent[i]); + if(H5DEBUG(S)) + HDfprintf(H5DEBUG(S), "%s: Dimension i=%d \n" + "start=%Hd count=%Hu block=%Hu stride=%Hu, xtent=%Hu max_xtent=%d\n", + FUNC, i, d[i].start, d[i].count, d[i].block, d[i].strid, d[i].xtent, max_xtent[i]); #endif #ifdef H5S_DEBUG - if(H5DEBUG(S)) - HDfprintf(H5DEBUG(S), "%s: i=%d Making vector-type \n", FUNC,i); + if(H5DEBUG(S)) + HDfprintf(H5DEBUG(S), "%s: i=%d Making vector-type \n", FUNC,i); #endif /**************************************** * Build vector type of the selection. ****************************************/ - mpi_code = MPI_Type_vector((int)(d[i].count), /* count */ - (int)(d[i].block), /* blocklength */ - (int)(d[i].strid), /* stride */ - inner_type, /* old type */ - &outer_type); /* new type */ + if (bigio_count >= d[i].count && + bigio_count >= d[i].block && + bigio_count >= d[i].strid) { + + /* All the parameters fit into 32 bit integers so create the vector type normally */ + mpi_code = MPI_Type_vector((int)(d[i].count), /* count */ + (int)(d[i].block), /* blocklength */ + (int)(d[i].strid), /* stride */ + inner_type, /* old type */ + &outer_type); /* new type */ + + MPI_Type_free(&inner_type); + if(mpi_code != MPI_SUCCESS) + HMPI_GOTO_ERROR(FAIL, "couldn't create MPI vector type", mpi_code) + } + else { + /* Things get a bit more complicated and require LARGE_DATATYPE processing + * There are two MPI datatypes that need to be created: + * 1) an internal contiguous block; and + * 2) a collection of elements where an element is a contiguous block(1). + * Remember that the input arguments to the MPI-IO functions use integer + * values to represent element counts. We ARE allowed however, in the + * more recent MPI implementations to use constructed datatypes whereby + * the total number of bytes in a transfer could be : + * (2GB-1)number_of_blocks * the_datatype_extent. + */ + + MPI_Aint stride_in_bytes, inner_extent; + MPI_Datatype block_type; + + /* create a contiguous datatype inner_type x number of BLOCKS. + * Again we need to check that the number of BLOCKS can fit into + * a 32 bit integer */ + if (bigio_count < d[i].block) { + if (H5S_mpio_create_large_type(d[i].block, 0, inner_type, + &block_type) < 0) { + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, + "couldn't ccreate a large block datatype in hyper selection") + } + } + else { + if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)d[i].block, + inner_type, + &block_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + } - MPI_Type_free(&inner_type); - if(mpi_code != MPI_SUCCESS) - HMPI_GOTO_ERROR(FAIL, "couldn't create MPI vector type", mpi_code) + MPI_Type_extent (inner_type, &inner_extent); + stride_in_bytes = inner_extent * (MPI_Aint)d[i].strid; - /**************************************** + /* If the element count is larger than what a 32 bit integer can hold, + * we call the large type creation function to handle that + */ + if (bigio_count < d[i].count) { + if (H5S_mpio_create_large_type (d[i].count, stride_in_bytes, block_type, + &outer_type) < 0) { + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, + "couldn't create a large outer datatype in hyper selection") + } + } + /* otherwise a regular create_hvector will do */ + else { + mpi_code = MPI_Type_create_hvector((int)d[i].count, /* count */ + 1, /* blocklength */ + stride_in_bytes, /* stride in bytes*/ + block_type, /* old type */ + &outer_type); /* new type */ + if(MPI_SUCCESS != mpi_code) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + } + MPI_Type_free(&block_type); + MPI_Type_free(&inner_type); + } + /**************************************** * Then build the dimension type as (start, vector type, xtent). ****************************************/ /* calculate start and extent values of this dimension */ @@ -752,6 +960,10 @@ done: * * Programmer: kyang * + * Modifications: + * Mohamad Chaarawi + * Adding support for large datatypes (beyond the limit of a + * 32 bit integer. *------------------------------------------------------------------------- */ static herr_t @@ -774,8 +986,17 @@ H5S_mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, HDassert(space->select.sel_info.hslab->span_lst->head); /* Create the base type for an element */ - if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE, &elmt_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + if (bigio_count >= elmt_size) { + if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE, &elmt_type))) { + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + } + } + else { + if (H5S_mpio_create_large_type (elmt_size, 0, MPI_BYTE, &elmt_type) < 0) { + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, + "couldn't create a large element datatype in span_hyper selection") + } + } elmt_type_is_derived = TRUE; /* Compute 'down' sizes for each dimension */ @@ -821,14 +1042,15 @@ static herr_t H5S_obtain_datatype(const hsize_t *down, H5S_hyper_span_t *span, const MPI_Datatype *elmt_type, MPI_Datatype *span_type, size_t elmt_size) { - size_t alloc_count; /* Number of span tree nodes allocated at this level */ - size_t outercount; /* Number of span tree nodes at this level */ + size_t alloc_count = 0; /* Number of span tree nodes allocated at this level */ + size_t outercount = 0; /* Number of span tree nodes at this level */ MPI_Datatype *inner_type = NULL; hbool_t inner_types_freed = FALSE; /* Whether the inner_type MPI datatypes have been freed */ hbool_t span_type_valid = FALSE; /* Whether the span_type MPI datatypes is valid */ + hbool_t large_block = FALSE; /* Wether the block length is larger than 32 bit integer */ int *blocklen = NULL; MPI_Aint *disp = NULL; - H5S_hyper_span_t *tspan; /* Temporary pointer to span tree node */ + H5S_hyper_span_t *tspan = NULL; /* Temporary pointer to span tree node */ int mpi_code; /* MPI return status code */ herr_t ret_value = SUCCEED; /* Return value */ @@ -870,14 +1092,70 @@ H5S_obtain_datatype(const hsize_t *down, H5S_hyper_span_t *span, disp[outercount] = (MPI_Aint)elmt_size * tspan->low; H5_CHECK_OVERFLOW(tspan->nelem, hsize_t, int) blocklen[outercount] = (int)tspan->nelem; - tspan = tspan->next; + + if (bigio_count < blocklen[outercount]) { + large_block = TRUE; /* at least one block type is large, so set this flag to true */ + } + outercount++; } /* end while */ - if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)outercount, blocklen, disp, *elmt_type, span_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) - span_type_valid = TRUE; + /* Everything fits into integers, so cast them and use hindexed */ + if (bigio_count >= outercount && large_block == FALSE) { + + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)outercount, blocklen, disp, *elmt_type, span_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) + span_type_valid = TRUE; + } + else { /* LARGE_DATATYPE:: Something doesn't fit into a 32 bit integer */ + size_t i; + + for (i=0 ; i bigio_count) { + if (H5S_mpio_create_large_type (blocklen[i], 0, *elmt_type, &temp_type) < 0) { + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, + "couldn't create a large element datatype in span_hyper selection") + } + } + else { + if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)blocklen[i], + *elmt_type, + &temp_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + } + + /* combine the current datatype that is created with this current block type */ + if (0 == i) { /* first iteration, there is no combined datatype yet */ + *span_type = temp_type; + } + else { + int bl[2] = {1,1}; + MPI_Aint ds[2] = {disp[i-1],disp[i]}; + MPI_Datatype dt[2] = {*span_type, temp_type}; + + if (MPI_SUCCESS != (mpi_code = MPI_Type_create_struct (2, /* count */ + bl, /* blocklength */ + ds, /* stride in bytes*/ + dt, /* old type */ + &outer_type))){ /* new type */ + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct failed", mpi_code) + } + *span_type = outer_type; + } + + if (outer_type != MPI_DATATYPE_NULL) + MPI_Type_free(&outer_type); + /* temp_type shouldn't be freed here... + * Note that we have simply copied it above (not MPI_Type_dup) + * into the 'span_type' argument of the caller. + * The caller needs to deal with it there! + */ + } + } /* end (LARGE_DATATYPE::) */ + } /* end if */ else { size_t u; /* Local index variable */ @@ -1091,5 +1369,139 @@ H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_mpio_space_type() */ + + +/*------------------------------------------------------------------------- + * Function: H5S_mpio_create_large_type + * + * Purpose: Create a large datatype of size larger than what a 32 bit integer + * can hold. + * + * Return: non-negative on success, negative on failure. + * + * *new_type the new datatype created + * + * Programmer: Mohamad Chaarawi + * + *------------------------------------------------------------------------- + */ +static herr_t H5S_mpio_create_large_type (hsize_t num_elements, + MPI_Aint stride_bytes, + MPI_Datatype old_type, + MPI_Datatype *new_type) +{ + int num_big_types; /* num times the 2G datatype will be repeated */ + int remaining_bytes; /* the number of bytes left that can be held in an int value */ + hsize_t leftover; + int block_len[2]; + int mpi_code; /* MPI return code */ + MPI_Datatype inner_type, outer_type, leftover_type, type[2]; + MPI_Aint disp[2], old_extent; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Calculate how many Big MPI datatypes are needed to represent the buffer */ + num_big_types = (int)(num_elements/bigio_count); + leftover = num_elements - num_big_types * (hsize_t)bigio_count; + H5_CHECKED_ASSIGN(remaining_bytes, int, leftover, hsize_t); + + /* Create a contiguous datatype of size equal to the largest + * number that a 32 bit integer can hold x size of old type. + * If the displacement is 0, then the type is contiguous, otherwise + * use type_hvector to create the type with the displacement provided + */ + if (0 == stride_bytes) { + if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(bigio_count, + old_type, + &inner_type))) { + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + } + } + else { + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hvector (bigio_count, + 1, + stride_bytes, + old_type, + &inner_type))) { + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + } + } + + /* Create a contiguous datatype of the buffer (minus the remaining < 2GB part) + * If a stride is present, use hvector type + */ + if (0 == stride_bytes) { + if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(num_big_types, + inner_type, + &outer_type))) { + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + } + } + else { + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hvector (num_big_types, + 1, + stride_bytes, + inner_type, + &outer_type))) { + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + } + } + + MPI_Type_free(&inner_type); + + /* If there is a remaining part create a contiguous/vector datatype and then + * use a struct datatype to encapsulate everything. + */ + if(remaining_bytes) { + if (stride_bytes == 0) { + if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous (remaining_bytes, + old_type, + &leftover_type))) { + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + } + } + else { + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hvector + ((int)(num_elements - (hsize_t)num_big_types*bigio_count), + 1, + stride_bytes, + old_type, + &leftover_type))) { + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + } + } + + MPI_Type_extent (old_type, &old_extent); + + /* Set up the arguments for MPI_Type_struct constructor */ + type[0] = outer_type; + type[1] = leftover_type; + block_len[0] = 1; + block_len[1] = 1; + disp[0] = 0; + disp[1] = (old_extent+stride_bytes)*num_big_types*(MPI_Aint)bigio_count; + + if(MPI_SUCCESS != (mpi_code = + MPI_Type_create_struct(2, block_len, disp, type, new_type))) { + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + } + + MPI_Type_free(&outer_type); + MPI_Type_free(&leftover_type); + } + else { + /* There are no remaining bytes so just set the new type to + * the outer type created */ + *new_type = outer_type; + } + + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5S_mpio_create_large_type */ + #endif /* H5_HAVE_PARALLEL */ -- cgit v0.12 From 610e76c75cbd8a91cc7b8e809bf122a87d182ef7 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 6 Jul 2017 08:02:29 -0500 Subject: Clean up remaining warnings --- src/H5Dmpio.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 942f633..91a730b 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1331,6 +1331,11 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in FUNC_ENTER_STATIC + HDassert(io_info); + HDassert(type_info); + HDassert(fm); + HDassert(dx_plist); + /* Obtain the current rank of the process and the number of processes */ if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") @@ -1772,6 +1777,11 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i FUNC_ENTER_STATIC + HDassert(io_info); + HDassert(type_info); + HDassert(fm); + HDassert(dx_plist); + /* Obtain the current rank of the process and the number of processes */ if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") @@ -2735,6 +2745,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty size_t i, last_assigned_idx; int *send_counts = NULL; int *send_displacements = NULL; + int scatter_recvcount_int; int mpi_rank, mpi_size, mpi_code; herr_t ret_value = SUCCEED; @@ -2742,6 +2753,8 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty HDassert(io_info); HDassert(type_info); + HDassert(fm); + HDassert(local_chunk_array); HDassert(local_chunk_array_num_entries); if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) @@ -2816,9 +2829,9 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty } /* end if */ /* Scatter the segments of the list back to each process */ - if (MPI_SUCCESS != (mpi_code = MPI_Scatterv(shared_chunks_info_array, send_counts, - send_displacements, MPI_BYTE, local_chunk_array, *local_chunk_array_num_entries * (int) sizeof(*local_chunk_array), - MPI_BYTE, 0, io_info->comm))) + H5_CHECKED_ASSIGN(scatter_recvcount_int, int, *local_chunk_array_num_entries * sizeof(*local_chunk_array), size_t); + if (MPI_SUCCESS != (mpi_code = MPI_Scatterv(shared_chunks_info_array, send_counts, send_displacements, + MPI_BYTE, local_chunk_array, scatter_recvcount_int, MPI_BYTE, 0, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "unable to scatter shared chunks info buffer", mpi_code) if (shared_chunks_info_array) { @@ -2898,10 +2911,10 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty size_t j; chunk_entry->async_info.num_receive_requests = (int) chunk_entry->num_writers - 1; - if (NULL == (chunk_entry->async_info.receive_requests_array = (MPI_Request *) H5MM_malloc(chunk_entry->async_info.num_receive_requests * sizeof(MPI_Request)))) + if (NULL == (chunk_entry->async_info.receive_requests_array = (MPI_Request *) H5MM_malloc((size_t) chunk_entry->async_info.num_receive_requests * sizeof(MPI_Request)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate async requests array") - if (NULL == (chunk_entry->async_info.receive_buffer_array = (unsigned char **) H5MM_malloc(chunk_entry->async_info.num_receive_requests * sizeof(unsigned char *)))) + if (NULL == (chunk_entry->async_info.receive_buffer_array = (unsigned char **) H5MM_malloc((size_t) chunk_entry->async_info.num_receive_requests * sizeof(unsigned char *)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate async receive buffers") for (j = 0; j < chunk_entry->num_writers - 1; j++) { @@ -2917,7 +2930,8 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty if (MPI_SUCCESS != (mpi_code = MPI_Get_count(&status, MPI_BYTE, &count))) HMPI_GOTO_ERROR(FAIL, "MPI_Get_count failed", mpi_code) - if (NULL == (chunk_entry->async_info.receive_buffer_array[j] = (unsigned char *) H5MM_malloc(count * sizeof(char *)))) + HDassert(count >= 0); + if (NULL == (chunk_entry->async_info.receive_buffer_array[j] = (unsigned char *) H5MM_malloc((size_t) count * sizeof(char *)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate modification data receive buffer") if (MPI_SUCCESS != (mpi_code = MPI_Imrecv(chunk_entry->async_info.receive_buffer_array[j], count, MPI_BYTE, @@ -3100,6 +3114,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HDassert(chunk_entry); HDassert(io_info); HDassert(type_info); + HDassert(fm); /* Look up the chunk and get its file and memory dataspaces */ if (NULL == (chunk_info = (H5D_chunk_info_t *) H5SL_search(fm->sel_chunks, &chunk_entry->index))) -- cgit v0.12 From 104047e13b2a1b726af3a907caef947d359fa34a Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 6 Jul 2017 14:21:26 -0500 Subject: Amend header comment error Suggested fix for allocating too small of a buffer for the chunk data --- src/H5Dmpio.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 91a730b..e70f51e 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -2223,7 +2223,8 @@ H5D__cmp_filtered_collective_io_info_entry(const void *filtered_collective_io_in * Description: Callback for qsort() to compare filtered collective chunk * io info entries's original owner fields * - * Return: -1, 0, 1 + * Return: The difference between the two + * H5D_filtered_collective_io_info_t's original owner fields * * Programmer: Jordan Henderson * Monday, Apr. 10th, 2017 @@ -2754,7 +2755,6 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty HDassert(io_info); HDassert(type_info); HDassert(fm); - HDassert(local_chunk_array); HDassert(local_chunk_array_num_entries); if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) @@ -3100,6 +3100,8 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk unsigned char *mod_data = NULL; /* Chunk modification data sent by a process to a chunk's owner */ unsigned filter_mask = 0; hssize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */ + hssize_t extent_npoints; + hsize_t true_chunk_size; hbool_t mem_iter_init = FALSE; size_t buf_size; size_t i; @@ -3120,24 +3122,16 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk if (NULL == (chunk_info = (H5D_chunk_info_t *) H5SL_search(fm->sel_chunks, &chunk_entry->index))) HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, FAIL, "can't locate chunk in skip list") - /* If this is a read operation or a write operation where the chunk is not being fully - * overwritten, enough memory must be allocated to read the filtered chunk from the file. - * If this is a write operation where the chunk is being fully overwritten, enough memory - * must be allocated for the size of the unfiltered chunk. - */ - if (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) { - buf_size = chunk_entry->chunk_states.chunk_current.length; - } /* end if */ - else { - hssize_t extent_npoints; - - if ((extent_npoints = H5S_GET_EXTENT_NPOINTS(chunk_info->fspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") - - buf_size = (hsize_t) extent_npoints * type_info->src_type_size; - } /* end else */ + if ((extent_npoints = H5S_GET_EXTENT_NPOINTS(chunk_info->fspace)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + true_chunk_size = (hsize_t) extent_npoints * type_info->src_type_size; - chunk_entry->chunk_states.new_chunk.length = buf_size; + /* If the size of the filtered chunk is larger than the number of points in the + * chunk file space extent times the datatype size, allocate enough space to hold the + * whole filtered chunk. Otherwise, allocate a buffer equal to the size of the + * chunk so that the unfiltering operation doesn't have to grow the buffer. + */ + buf_size = MAX(chunk_entry->chunk_states.chunk_current.length, true_chunk_size); if (NULL == (chunk_entry->buf = H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk data buffer") @@ -3146,6 +3140,8 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk * read from the file and unfiltered. */ if (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) { + chunk_entry->chunk_states.new_chunk.length = chunk_entry->chunk_states.chunk_current.length; + /* XXX: Test with MPI types and collective read to improve performance */ if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_entry->chunk_states.chunk_current.offset, buf_size, H5AC_rawdata_dxpl_id, chunk_entry->buf) < 0) @@ -3156,6 +3152,9 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk (size_t *) &chunk_entry->chunk_states.new_chunk.length, &buf_size, &chunk_entry->buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "couldn't unfilter chunk for modifying") } /* end if */ + else { + chunk_entry->chunk_states.new_chunk.length = true_chunk_size; + } /* end else */ /* Initialize iterator for memory selection */ if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) -- cgit v0.12 From bd79a782b42f8f689e223e8e34c6f788dc7dd0c4 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 7 Jul 2017 13:31:43 -0500 Subject: Suggested changes from code review --- src/H5Dio.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- src/H5Dmpio.c | 3 +-- src/H5Dpkg.h | 3 +-- src/H5Ppublic.h | 2 +- src/H5trace.c | 4 ---- 5 files changed, 60 insertions(+), 12 deletions(-) diff --git a/src/H5Dio.c b/src/H5Dio.c index 8d41960..470520e 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -1190,7 +1190,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve MPI communicator") /* Check if we can set direct MPI-IO read/write functions */ - if((opt = H5D__mpio_opt_possible(io_info, file_space, mem_space, type_info, fm, dx_plist)) < 0) + if((opt = H5D__mpio_opt_possible(io_info, file_space, mem_space, type_info, dx_plist)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "invalid check for direct IO dataspace ") /* Check if we can use the optimized parallel I/O routines */ @@ -1206,8 +1206,62 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, * we cannot break to independent I/O if this is a write operation; * otherwise there will be metadata inconsistencies in the file. */ - if (io_info->op_type == H5D_IO_OP_WRITE && io_info->dset->shared->dcpl_cache.pline.nused > 0) - HGOTO_ERROR(H5E_IO, H5E_NO_INDEPENDENT, FAIL, "can't perform independent write with filters in pipeline") + if (io_info->op_type == H5D_IO_OP_WRITE && io_info->dset->shared->dcpl_cache.pline.nused > 0) { + H5D_mpio_no_collective_cause_t cause; + uint32_t local_no_collective_cause; + uint32_t global_no_collective_cause; + hbool_t local_error_message_previously_written = FALSE; + hbool_t global_error_message_previously_written = FALSE; + size_t index; + char local_no_collective_cause_string[256] = ""; + char global_no_collective_cause_string[256] = ""; + const char *cause_strings[] = { "independent I/O was requested", + "datatype conversions were required", + "data transforms needed to be applied", + "optimized MPI types flag wasn't set", + "one of the dataspaces was neither simple nor scalar", + "dataset was not contiguous or chunked" }; + + if (H5P_get(dx_plist, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &local_no_collective_cause) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get local no collective cause value") + if (H5P_get(dx_plist, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, &global_no_collective_cause) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get global no collective cause value") + + /* Append each of the reason for breaking collective I/O error messages to the + * local and global no collective cause strings */ + for (cause = 1, index = 0; cause < H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE; cause <<= 1, index++) { + size_t cause_strlen = strlen(cause_strings[index]); + + if (cause & local_no_collective_cause) { + /* Check if there were any previous error messages included. If so, prepend a semicolon + * to separate the messages. + */ + if (local_error_message_previously_written) strncat(local_no_collective_cause_string, "; ", 2); + + strncat(local_no_collective_cause_string, cause_strings[index], cause_strlen); + + local_error_message_previously_written = TRUE; + } /* end if */ + + if (cause & global_no_collective_cause) { + /* Check if there were any previous error messages included. If so, prepend a semicolon + * to separate the messages. + */ + if (global_error_message_previously_written) strncat(global_no_collective_cause_string, "; ", 2); + + strncat(global_no_collective_cause_string, cause_strings[index], cause_strlen); + + global_error_message_previously_written = TRUE; + } /* end if */ + } /* end for */ + + HGOTO_ERROR(H5E_IO, H5E_NO_INDEPENDENT, FAIL, "Can't perform independent write with filters in pipeline.\n" + " The following caused a break from collective I/O:\n" + " Local causes: %s\n" + " Global causes: %s", + local_no_collective_cause_string, + global_no_collective_cause_string); + } /* end if */ /* If we won't be doing collective I/O, but the user asked for * collective I/O, change the request to use independent I/O, but diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index e70f51e..393e155 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -202,8 +202,7 @@ static int H5D__cmp_filtered_collective_io_info_entry_owner(const void *filtered */ htri_t H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, - const H5S_t *mem_space, const H5D_type_info_t *type_info, - const H5D_chunk_map_t H5_ATTR_UNUSED *fm, H5P_genplist_t *dx_plist) + const H5S_t *mem_space, const H5D_type_info_t *type_info, H5P_genplist_t *dx_plist) { int local_cause = 0; /* Local reason(s) for breaking collective mode */ int global_cause = 0; /* Global reason(s) for breaking collective mode */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 5e3a70d..097fab7 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -773,8 +773,7 @@ H5_DLL herr_t H5D__chunk_collective_write(H5D_io_info_t *io_info, * memory and the file */ H5_DLL htri_t H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, const H5S_t *mem_space, - const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm, - H5P_genplist_t *dx_plist); + const H5D_type_info_t *type_info, H5P_genplist_t *dx_plist); #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 55b3877..854b1ef 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -166,7 +166,7 @@ typedef enum H5D_mpio_no_collective_cause_t { H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED = 0x08, H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES = 0x10, H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET = 0x20, - H5D_MPIO_FILTERS = 0x40 + H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE = 0x40 } H5D_mpio_no_collective_cause_t; /********************/ diff --git a/src/H5trace.c b/src/H5trace.c index 9fb8a72..930002f 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -621,10 +621,6 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ - if(nocol_cause_mode & H5D_MPIO_FILTERS) { - fprintf(out, "%sH5D_MPIO_FILTERS", flag_already_displayed ? " | " : ""); - flag_already_displayed = TRUE; - } /* end if */ /* Display '' if there's no flags set */ if(!flag_already_displayed) -- cgit v0.12 From 8935c921f7e50607cd91c86b2237ac39a9b600af Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 10 Jul 2017 03:22:48 -0500 Subject: Fix for HDFFV-10217 infinite loop in H5VM_power2up(). The function H5VM_power2up() returns the next power of 2 for n. When n exceeds 2^63, it overflows and becomes 0 causing the infinite looping. The fix ensures that the function checks for n >= 2^63 and returns 0. --- src/H5Dchunk.c | 7 +++- src/H5Ddeprec.c | 5 ++- src/H5Dint.c | 14 ++++++-- src/H5VMprivate.h | 6 +++- test/dsets.c | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 121 insertions(+), 8 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index d693466..b7b8b03 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -1019,11 +1019,16 @@ H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) unsigned u; /* Local index value */ for(u = 0; u < dset->shared->ndims; u++) { + hsize_t scaled_power2up; /* Scaled value, rounded to next power of 2 */ + /* Initial scaled dimension sizes */ rdcc->scaled_dims[u] = dset->shared->curr_dims[u] / dset->shared->layout.u.chunk.dim[u]; + if( !(scaled_power2up = H5VM_power2up(rdcc->scaled_dims[u])) ) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") + /* Inital 'power2up' values for scaled dimensions */ - rdcc->scaled_power2up[u] = H5VM_power2up(rdcc->scaled_dims[u]); + rdcc->scaled_power2up[u] = scaled_power2up; /* Number of bits required to encode scaled dimension size */ rdcc->scaled_encode_bits[u] = H5VM_log2_gen(rdcc->scaled_power2up[u]); diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 8d9461c..0807048 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -329,8 +329,11 @@ H5D__extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) dataset->shared->cache.chunk.scaled_dims[u] > dataset->shared->cache.chunk.nslots)) update_chunks = TRUE; + if( !(scaled_power2up = H5VM_power2up(scaled)) ) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") + /* Check if the number of bits required to encode the scaled size value changed */ - if(dataset->shared->cache.chunk.scaled_power2up[u] != (scaled_power2up = H5VM_power2up(scaled))) { + if(dataset->shared->cache.chunk.scaled_power2up[u] != scaled_power2up) { /* Update the 'power2up' & 'encode_bits' values for the current dimension */ dataset->shared->cache.chunk.scaled_power2up[u] = scaled_power2up; dataset->shared->cache.chunk.scaled_encode_bits[u] = H5VM_log2_gen(scaled_power2up); diff --git a/src/H5Dint.c b/src/H5Dint.c index 08b3eb8..3b938e2 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -745,8 +745,13 @@ H5D__cache_dataspace_info(const H5D_t *dset) dset->shared->ndims = (unsigned)sndims; /* Compute the inital 'power2up' values */ - for(u = 0; u < dset->shared->ndims; u++) - dset->shared->curr_power2up[u] = H5VM_power2up(dset->shared->curr_dims[u]); + for(u = 0; u < dset->shared->ndims; u++) { + hsize_t scaled_power2up; /* Scaled value, rounded to next power of 2 */ + + if( !(scaled_power2up = H5VM_power2up(dset->shared->curr_dims[u])) ) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") + dset->shared->curr_power2up[u] = scaled_power2up; + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -2809,8 +2814,11 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) dset->shared->cache.chunk.scaled_dims[u] > dset->shared->cache.chunk.nslots)) update_chunks = TRUE; + if( !(scaled_power2up = H5VM_power2up(scaled)) ) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") + /* Check if the number of bits required to encode the scaled size value changed */ - if(dset->shared->cache.chunk.scaled_power2up[u] != (scaled_power2up = H5VM_power2up(scaled))) { + if(dset->shared->cache.chunk.scaled_power2up[u] != scaled_power2up) { /* Update the 'power2up' & 'encode_bits' values for the current dimension */ dset->shared->cache.chunk.scaled_power2up[u] = scaled_power2up; dset->shared->cache.chunk.scaled_encode_bits[u] = H5VM_log2_gen(scaled_power2up); diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index 4d71b29..decac7e 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -460,7 +460,11 @@ H5VM_power2up(hsize_t n) { hsize_t ret_value = 1; /* Return value */ - while(ret_value < n) + /* Returns 0 when n exceeds 2^63 */ + if(n >= (hsize_t)1 << ((sizeof(hsize_t) * CHAR_BIT) - 1)) + ret_value = 0; + + while(ret_value && ret_value < n) ret_value <<= 1; return(ret_value); diff --git a/test/dsets.c b/test/dsets.c index c29d18e..0ca08e4 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -51,14 +51,15 @@ const char *FILENAME[] = { "copy_dcpl_newfile",/* 13 */ "partial_chunks", /* 14 */ "layout_extend", /* 15 */ - "zero_chunk", /* 16 */ + "zero_chunk", /* 16 */ "chunk_single", /* 17 */ "swmr_non_latest", /* 18 */ "earray_hdr_fd", /* 19 */ "farray_hdr_fd", /* 20 */ "bt2_hdr_fd", /* 21 */ - "storage_size", /* 22 */ + "storage_size", /* 22 */ "dls_01_strings", /* 23 */ + "power2up", /* 24 */ NULL }; #define FILENAME_BUF_SIZE 1024 @@ -11345,6 +11346,97 @@ error: /*------------------------------------------------------------------------- + * Function: test_power2up + * + * Purpose: Tests that the H5VM_power2up(n) function does not result in an + * infinite loop when input n exceeds 2^63. (HDFFV-10217) + * H5VM_power2up() is used to calculate the next power of 2 for + * a dataset's scaled dimension sizes. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Vailin Choi; June 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_power2up(hid_t fapl) +{ + char filename[FILENAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hsize_t dims[2]; /* Dataset dimension sizes */ + hsize_t max_dims[2]; /* Maximum dimension sizes */ + hsize_t chunk_dims[2]; /* Chunk dimensions */ + hsize_t ext_dims[2]; /* Extended dimension sizes */ + herr_t status; /* Error status */ + + TESTING("the next power of 2"); + + h5_fixname(FILENAME[24], fapl, filename, sizeof filename); + + /* Create file */ + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR + + /* Set dims[1] to ((2^63) -1) */ + dims[0] = 0; + dims[1] = ((hsize_t)1 << ((sizeof(hsize_t) * CHAR_BIT) -1)) - 1; + max_dims[0] = max_dims[1] = H5S_UNLIMITED; + sid = H5Screate_simple(2, dims, max_dims); + + /* Create dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + + /* Set chunk size */ + chunk_dims[0] = chunk_dims[1] = 1; + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + TEST_ERROR + + /* Create chunked dataset */ + if((did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT64, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + + ext_dims[0] = 1; + ext_dims[1] = dims[1] + 5; + + /* Extend to (2^63)+ */ + H5E_BEGIN_TRY { + status = H5Dset_extent(did, ext_dims); + } H5E_END_TRY; + if(status >= 0) + TEST_ERROR + + /* Closing */ + if(H5Dclose(did) < 0) + TEST_ERROR + if(H5Sclose(sid) < 0) + TEST_ERROR + if(H5Pclose(dcpl) < 0) + TEST_ERROR + if(H5Fclose(fid) < 0) + TEST_ERROR + + PASSED(); + + return 0; + +error: + H5E_BEGIN_TRY { + H5Pclose(dcpl); + H5Dclose(did); + H5Sclose(sid); + H5Pclose(dcpl); + H5Fclose(fid); + } H5E_END_TRY; + return -1; +} /* end test_power2up() */ + + +/*------------------------------------------------------------------------- * Function: test_scatter * * Purpose: Tests H5Dscatter with a variety of different selections @@ -12928,6 +13020,7 @@ main(void) nerrors += (test_large_chunk_shrink(my_fapl) < 0 ? 1 : 0); nerrors += (test_zero_dim_dset(my_fapl) < 0 ? 1 : 0); nerrors += (test_storage_size(my_fapl) < 0 ? 1 : 0); + nerrors += (test_power2up(my_fapl) < 0 ? 1 : 0); nerrors += (test_swmr_non_latest(envval, my_fapl) < 0 ? 1 : 0); nerrors += (test_earray_hdr_fd(envval, my_fapl) < 0 ? 1 : 0); -- cgit v0.12 From 0c4c562cc583fd814f26ba652cbcf82dc6d33cac Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Mon, 10 Jul 2017 16:17:26 -0400 Subject: Include code fixes and additional modifications pointed out by code reviewers --- MANIFEST | 1 + src/H5Smpio.c | 12 ++++----- testpar/CMakeLists.txt | 1 + testpar/Makefile.am | 2 +- testpar/t_bigio.c | 72 ++++++++++++++++++++++++++++++++++++++++++++------ 5 files changed, 73 insertions(+), 15 deletions(-) diff --git a/MANIFEST b/MANIFEST index 475b674..27f38be 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1222,6 +1222,7 @@ ./testpar/COPYING ./testpar/Makefile.am +./testpar/t_bigio.c ./testpar/t_cache.c ./testpar/t_cache_image.c ./testpar/t_chunk_alloc.c diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 7319a80..46f7a59 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -232,7 +232,7 @@ H5S_mpio_create_point_datatype (size_t elmt_size, hsize_t num_points, /* Create an MPI datatype for the whole point selection */ if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)num_points, blocks, disp, elmt_type, new_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_indexed_block failed", mpi_code) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) #endif /* Commit MPI datatype for later use */ @@ -871,7 +871,7 @@ H5S_mpio_hyper_type(const H5S_t *space, size_t elmt_size, block_type, /* old type */ &outer_type); /* new type */ if(MPI_SUCCESS != mpi_code) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code) } MPI_Type_free(&block_type); MPI_Type_free(&inner_type); @@ -1424,7 +1424,7 @@ static herr_t H5S_mpio_create_large_type (hsize_t num_elements, stride_bytes, old_type, &inner_type))) { - HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code) } } @@ -1444,7 +1444,7 @@ static herr_t H5S_mpio_create_large_type (hsize_t num_elements, stride_bytes, inner_type, &outer_type))) { - HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code) } } @@ -1468,7 +1468,7 @@ static herr_t H5S_mpio_create_large_type (hsize_t num_elements, stride_bytes, old_type, &leftover_type))) { - HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code) } } @@ -1484,7 +1484,7 @@ static herr_t H5S_mpio_create_large_type (hsize_t num_elements, if(MPI_SUCCESS != (mpi_code = MPI_Type_create_struct(2, block_len, disp, type, new_type))) { - HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct failed", mpi_code) } MPI_Type_free(&outer_type); diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 298d326..e994b65 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -43,6 +43,7 @@ ENDMACRO (ADD_H5P_EXE file) set (H5P_TESTS t_mpi + t_bigio t_cache t_pflush1 t_pflush2 diff --git a/testpar/Makefile.am b/testpar/Makefile.am index b87c1df..7029bd5 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -23,7 +23,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test # Test programs. These are our main targets. # -TEST_PROG_PARA=t_mpi testphdf5 t_cache t_cache_image t_pflush1 t_pflush2 t_pshutdown t_prestart t_init_term t_shapesame +TEST_PROG_PARA=t_mpi t_bigio testphdf5 t_cache t_cache_image t_pflush1 t_pflush2 t_pshutdown t_prestart t_init_term t_shapesame check_PROGRAMS = $(TEST_PROG_PARA) diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index 2f80e45..830ea54 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -2060,13 +2060,62 @@ coll_chunktest(const char* filename, +/***************************************************************************** + * + * Function: do_express_test() + * + * Purpose: Do an MPI_Allreduce to obtain the maximum value returned + * by GetTestExpress() across all processes. Return this + * value. + * + * Envirmoment variables can be different across different + * processes. This function ensures that all processes agree + * on whether to do an express test. + * + * Return: Success: Maximum of the values returned by + * GetTestExpress() across all processes. + * + * Failure: -1 + * + * Programmer: JRM -- 4/25/06 + * + *****************************************************************************/ +static int +do_express_test(int world_mpi_rank) +{ + int express_test; + int max_express_test; + int result; + + express_test = GetTestExpress(); + + result = MPI_Allreduce((void *)&express_test, + (void *)&max_express_test, + 1, + MPI_INT, + MPI_MAX, + MPI_COMM_WORLD); + + if ( result != MPI_SUCCESS ) { + nerrors++; + max_express_test = -1; + if ( VERBOSE_MED && (world_mpi_rank == 0)) { + HDfprintf(stdout, "%d:%s: MPI_Allreduce() failed.\n", + world_mpi_rank, FUNC ); + } + } + + return(max_express_test); + +} /* do_express_test() */ int main(int argc, char **argv) { - + int ExpressMode = 0; hsize_t newsize = 1048576; hsize_t oldsize = H5S_mpio_set_bigio_count(newsize); + if (newsize != oldsize) { bigcount = newsize * 2; } @@ -2075,20 +2124,27 @@ int main(int argc, char **argv) MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + ExpressMode = do_express_test(mpi_rank); + dataset_big_write(); MPI_Barrier(MPI_COMM_WORLD); dataset_big_read(); MPI_Barrier(MPI_COMM_WORLD); - oldsize = H5S_mpio_set_bigio_count(16384); + if (ExpressMode > 1) { + printf("***Express test mode on. Several tests are skipped\n"); + } + else { + coll_chunk1(); + MPI_Barrier(MPI_COMM_WORLD); + coll_chunk2(); + MPI_Barrier(MPI_COMM_WORLD); + coll_chunk3(); + } - coll_chunk1(); - MPI_Barrier(MPI_COMM_WORLD); - coll_chunk2(); - MPI_Barrier(MPI_COMM_WORLD); - coll_chunk3(); - MPI_Barrier(MPI_COMM_WORLD); + /* close HDF5 library */ + H5close(); MPI_Finalize(); -- cgit v0.12 From 32b0d6ca9f95fe46c2e52b58cabd4f5af4c107d3 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Mon, 10 Jul 2017 18:20:39 -0400 Subject: Fix up the ExpressMode check for skipping slow running tests. --- testpar/t_bigio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index 830ea54..a4a1323 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -2132,7 +2132,7 @@ int main(int argc, char **argv) dataset_big_read(); MPI_Barrier(MPI_COMM_WORLD); - if (ExpressMode > 1) { + if (ExpressMode > 0) { printf("***Express test mode on. Several tests are skipped\n"); } else { -- cgit v0.12 From 78d1de482ebc91348cfb673ba584db96ce127aeb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 12 Jul 2017 14:18:01 -0500 Subject: HDFF-10254 - Copy test files with macro to avoid POST_BUILD failure --- hl/tools/h5watch/CMakeTests.cmake | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/hl/tools/h5watch/CMakeTests.cmake b/hl/tools/h5watch/CMakeTests.cmake index 35e7829..0b7b4d4 100644 --- a/hl/tools/h5watch/CMakeTests.cmake +++ b/hl/tools/h5watch/CMakeTests.cmake @@ -56,18 +56,11 @@ set (H5WATCH_TEST_FILES # make test dir file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") -add_custom_target(h5watch-files ALL COMMENT "Copying files needed by h5watch tests") foreach (h5watch_file ${H5WATCH_TEST_FILES}) - set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5watch_file}") - #message (STATUS " Copying ${h5watch_file}") - add_custom_command ( - TARGET h5watch-files - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_HL_TOOLS_DIR}/testfiles/${h5watch_file} ${dest} - ) + HDFTEST_COPY_FILE("${HDF5_HL_TOOLS_DIR}/testfiles/${h5watch_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5watch_file}" "H5WATCH_files") endforeach () +add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tests" DEPENDS ${H5WATCH_files_list}) ############################################################################## ############################################################################## -- cgit v0.12 From c22678f3fde05641ae00003272d9d1add600ba24 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 12 Jul 2017 14:23:00 -0500 Subject: HDFFV-10254 release note --- release_docs/RELEASE.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 20d58b3..c53f926 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -105,7 +105,15 @@ Bug Fixes since HDF5-1.10.1 release Configuration ------------- - - + - cmake + + To many commands for POST_BUILD step caused command line to be + too big on windows. + + Changed foreach of copy command to use a custom command with the + use of the HDFTEST_COPY_FILE macro. + + (ADB - 2017/07/12, HDFFV-10254) Performance ------------- @@ -127,7 +135,7 @@ Bug Fixes since HDF5-1.10.1 release The import from h5dump function expects the binary files to use native types (FILE '-b' option) in the binary file. - (ADB - 2017/06/15, HDFFV-102191) + (ADB - 2017/06/15, HDFFV-10219) - h5repack -- cgit v0.12 From 6a5aa46e936340ed540359290374fa909f9213a6 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Thu, 13 Jul 2017 10:12:08 -0400 Subject: Added a brief outline for Large MPI-IO transfers into RELEASE.txt --- release_docs/RELEASE.txt | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 20d58b3..4335b37 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -62,7 +62,29 @@ New Features Parallel Library: ----------------- - - + - Large MPI-IO transfers + + Previous releases of PHDF5 would fail when attempting to + read or write greater than 2GB of data in a single IO operation. + This issue stems principally from an MPI API whose definitions + utilize 32 bit integers to describe the number of data elements + and datatype that MPI should use to effect a data transfer. + Historically, HDF5 has invoked MPI-IO with the number of + elements in a contiguous buffer represented as the length + of that buffer in bytes. + + Resolving the issue and thus enabling larger MPI-IO transfers + is accomplished first, by detecting when a user IO request would + exceed the 2GB limit as described above. Once a transfer request + is identified as requiring special handling, PHDF5 now creates a + derived datatype consisting of a vector of fixed sized blocks + which is in turn wrapped within a single MPI_Type_struct to + contain the vector and any remaining data. The newly created + datatype is then used in place of MPI_BYTE and can be used to + fulfill the original user request without encountering API + errors. + + (RAW – 2017/07/11, HDFFV-8839) Fortran Library: ---------------- -- cgit v0.12 From b3a212e54b86e15ea059d856db8685f43cc00829 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 13 Jul 2017 13:36:48 -0500 Subject: HDFFV-10254 Fix spelling --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index c53f926..f83d3f4 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -107,7 +107,7 @@ Bug Fixes since HDF5-1.10.1 release ------------- - cmake - To many commands for POST_BUILD step caused command line to be + Too many commands for POST_BUILD step caused command line to be too big on windows. Changed foreach of copy command to use a custom command with the -- cgit v0.12 From d4234d0a98ff68eb55b3fa0d2246e61e53308e41 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 14 Jul 2017 09:18:33 -0700 Subject: Major rework of H5PL package code before bringing VOL changes over. Brings coding standards in line with the rest of the library, enforces better software engineering principles, and makes everything more maintainable. --- MANIFEST | 3 + bin/trace | 4 +- src/CMakeLists.txt | 3 + src/H5PL.c | 987 ++++++++++--------------------------------------- src/H5PLextern.h | 4 +- src/H5PLint.c | 381 +++++++++++++++++++ src/H5PLmodule.h | 10 +- src/H5PLpath.c | 776 ++++++++++++++++++++++++++++++++++++++ src/H5PLpkg.h | 113 +++++- src/H5PLplugin_cache.c | 308 +++++++++++++++ src/H5PLprivate.h | 4 +- src/H5PLpublic.h | 34 +- src/H5system.c | 50 +++ src/H5win32defs.h | 1 + src/Makefile.am | 2 +- test/plugin.c | 426 +++++++++++++-------- 16 files changed, 2131 insertions(+), 975 deletions(-) create mode 100644 src/H5PLint.c create mode 100644 src/H5PLpath.c create mode 100644 src/H5PLplugin_cache.c diff --git a/MANIFEST b/MANIFEST index 27f38be..739db4a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -799,8 +799,11 @@ ./src/H5PBpkg.h ./src/H5PBprivate.h ./src/H5PL.c +./src/H5PLint.c ./src/H5PLmodule.h +./src/H5PLpath.c ./src/H5PLpkg.h +./src/H5PLplugin_cache.c ./src/H5PLprivate.h ./src/H5PLpublic.h ./src/H5PLextern.h diff --git a/bin/trace b/bin/trace index 3f532ab..cf41238 100755 --- a/bin/trace +++ b/bin/trace @@ -76,7 +76,7 @@ $Source = ""; "off_t" => "o", "H5O_type_t" => "Ot", "H5P_class_t" => "p", - "hobj_ref_t" => "r", + "hobj_ref_t" => "r", "H5R_type_t" => "Rt", "char" => "s", "unsigned char" => "s", @@ -124,7 +124,7 @@ $Source = ""; "H5G_iterate_t" => "x", "H5G_info_t" => "x", "H5I_free_t" => "x", - "H5I_search_func_t" => "x", + "H5I_search_func_t" => "x", "H5L_class_t" => "x", "H5L_elink_traverse_t" => "x", "H5L_iterate_t" => "x", diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 178c954..96ea589 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -516,6 +516,9 @@ IDE_GENERATED_PROPERTIES ("H5PB" "${H5PB_HDRS}" "${H5PB_SOURCES}" ) set (H5PL_SOURCES ${HDF5_SRC_DIR}/H5PL.c + ${HDF5_SRC_DIR}/H5PLint.c + ${HDF5_SRC_DIR}/H5PLpath.c + ${HDF5_SRC_DIR}/H5PLplugin_cache.c ) set (H5PL_HDRS diff --git a/src/H5PL.c b/src/H5PL.c index 65d6c91..fc42554 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -22,135 +22,28 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5MMprivate.h" /* Memory management */ #include "H5PLpkg.h" /* Plugin */ -#include "H5Zprivate.h" /* Filter pipeline */ /****************/ /* Local Macros */ /****************/ -#ifdef H5_HAVE_WIN32_API -#define H5PL_EXPAND_ENV_VAR { \ - long bufCharCount; \ - char *tempbuf; \ - if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) \ - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") \ - if((bufCharCount = ExpandEnvironmentStringsA(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { \ - tempbuf = (char *)H5MM_xfree(tempbuf); \ - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") \ - } \ - if(bufCharCount == 0) { \ - tempbuf = (char *)H5MM_xfree(tempbuf); \ - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") \ - } \ - dl_path = (char *)H5MM_xfree(dl_path); \ - dl_path = tempbuf; \ - } -#else -#define H5PL_EXPAND_ENV_VAR -#endif /* H5_HAVE_WIN32_API */ - -/****************************/ -/* Macros for supporting - * both Windows and Unix */ -/****************************/ -/* Windows support - * - * SPECIAL WINDOWS NOTE - * - * Some of the Win32 API functions expand to fooA or fooW depending on - * whether UNICODE or _UNICODE are defined. You MUST explicitly use - * the A version of the functions to force char * behavior until we - * work out a scheme for proper Windows Unicode support. - * - * If you do not do this, people will be unable to incorporate our - * source code into their own CMake builds if they define UNICODE. - */ -#ifdef H5_HAVE_WIN32_API - -#define H5PL_PATH_SEPARATOR ";" - -/* Handle for dynamic library */ -#define H5PL_HANDLE HINSTANCE - -/* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ -#define H5PL_OPEN_DLIB(S) LoadLibraryExA(S, NULL, LOAD_WITH_ALTERED_SEARCH_PATH) - -/* Get the address of a symbol in dynamic library */ -#define H5PL_GET_LIB_FUNC(H,N) GetProcAddress(H,N) - -/* Close dynamic library */ -#define H5PL_CLOSE_LIB(H) FreeLibrary(H) - -/* Clear error - nothing to do */ -#define H5PL_CLR_ERROR - -/* maximum size for expanding env vars */ -#define H5PL_EXPAND_BUFFER_SIZE 32767 - -typedef const void *(__cdecl *H5PL_get_plugin_info_t)(void); - -/* Unix support */ -#else /* H5_HAVE_WIN32_API */ - -#define H5PL_PATH_SEPARATOR ":" - -/* Handle for dynamic library */ -#define H5PL_HANDLE void * - -/* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ -#define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY) - -/* Get the address of a symbol in dynamic library */ -#define H5PL_GET_LIB_FUNC(H,N) dlsym(H,N) - -/* Close dynamic library */ -#define H5PL_CLOSE_LIB(H) dlclose(H) - -/* Clear error */ -#define H5PL_CLR_ERROR HERROR(H5E_PLUGIN, H5E_CANTGET, "can't dlopen:%s", dlerror()) - -typedef const void *(*H5PL_get_plugin_info_t)(void); -#endif /* H5_HAVE_WIN32_API */ - -/* Whether to preload pathnames for plugin libraries */ -#define H5PL_DEFAULT_PATH H5_DEFAULT_PLUGINDIR - -/* Special symbol to indicate no plugin loading */ -#define H5PL_NO_PLUGIN "::" /******************/ /* Local Typedefs */ /******************/ -/* Type for the list of info for opened plugin libraries */ -typedef struct H5PL_table_t { - H5PL_type_t pl_type; /* plugin type */ - int pl_id; /* ID for the plugin */ - H5PL_HANDLE handle; /* plugin handle */ -} H5PL_table_t; - /********************/ /* Local Prototypes */ /********************/ -static herr_t H5PL__init_path_table(void); -static htri_t H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info); -static htri_t H5PL__open(H5PL_type_t pl_type, char *libname, int plugin_id, const void **pl_info); -static htri_t H5PL__search_table(H5PL_type_t plugin_type, int type_id, const void **info); -static herr_t H5PL__close(H5PL_HANDLE handle); - /*********************/ /* Package Variables */ /*********************/ -/* Package initialization variable */ -hbool_t H5_PKG_INIT_VAR = FALSE; - /*****************************/ /* Library Private Variables */ @@ -161,145 +54,43 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /* Local Variables */ /*******************/ -/* Table for opened plugin libraries */ -static size_t H5PL_table_alloc_g = 0; -static size_t H5PL_table_used_g = 0; -static H5PL_table_t *H5PL_table_g = NULL; - -/* Table of location paths for plugin libraries */ -static char *H5PL_path_table_g[H5PL_MAX_PATH_NUM]; -static size_t H5PL_num_paths_g = 0; -static hbool_t H5PL_path_found_g = FALSE; - -/* Enable all plugin libraries */ -static unsigned int H5PL_plugin_g = H5PL_ALL_PLUGIN; - - - -/*-------------------------------------------------------------------------- -NAME - H5PL__init_package -- Initialize interface-specific information -USAGE - herr_t H5PL__init_package() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. - ---------------------------------------------------------------------------*/ -herr_t -H5PL__init_package(void) -{ - char *preload_path; - - FUNC_ENTER_PACKAGE_NOERR - - /* Retrieve pathnames from HDF5_PLUGIN_PRELOAD if the user sets it - * to tell the library to load plugin libraries without search. - */ - if(NULL != (preload_path = HDgetenv("HDF5_PLUGIN_PRELOAD"))) - /* Special symbol "::" means no plugin during data reading. */ - if(!HDstrcmp(preload_path, H5PL_NO_PLUGIN)) - H5PL_plugin_g = 0; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5PL__init_package() */ /*------------------------------------------------------------------------- - * Function: H5PL_term_package - * - * Purpose: Terminate the H5PL interface: release all memory, reset all - * global variables to initial values. This only happens if all - * types have been destroyed from other interfaces. + * Function: H5PLset_loading_state * - * Return: Success: Positive if any action was taken that might - * affect some other interface; zero otherwise. - * Failure: Negative. - * - * Programmer: Raymond Lu - * 20 February 2013 - * - *------------------------------------------------------------------------- - */ -int -H5PL_term_package(void) -{ - int n = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if(H5_PKG_INIT_VAR) { - size_t u; /* Local index variable */ - - /* Close opened dynamic libraries */ - if(H5PL_table_g) { - for(u = 0; u < H5PL_table_used_g; u++) - H5PL__close((H5PL_table_g[u]).handle); - - /* Free the table of dynamic libraries */ - H5PL_table_g = (H5PL_table_t *)H5MM_xfree(H5PL_table_g); - H5PL_table_used_g = H5PL_table_alloc_g = 0; - - n++; - } /* end if */ - - /* Free the table of search paths */ - if(H5PL_num_paths_g > 0) { - for(u = 0; u < H5PL_num_paths_g; u++) - if(H5PL_path_table_g[u]) - H5PL_path_table_g[u] = (char *)H5MM_xfree(H5PL_path_table_g[u]); - H5PL_num_paths_g = 0; - H5PL_path_found_g = FALSE; - - n++; - } /* end if */ - - /* Mark the interface as uninitialized */ - if(0 == n) - H5_PKG_INIT_VAR = FALSE; - } /* end if */ - - FUNC_LEAVE_NOAPI(n) -} /* end H5PL_term_package() */ - - -/*------------------------------------------------------------------------- - * Function: H5PLset_loading_state + * Purpose: Control the loading of dynamic plugin types. * - * Purpose: Control the loading of dynamic plugin types. + * The plugin_control_mask parameter is a bitfield that controls + * whether certain classes of plugins (e.g.: filters, + * VOL drivers) will be loaded by the library. * - * This function will not allow plugin types if the pathname from the HDF5_PLUGIN_PRELOAD - * environment variable is set to the special "::" string. + * plugin bit = 0, will prevent the use of that dynamic plugin type. + * plugin bit = 1, will allow the use of that dynamic plugin type. * - * plugin bit = 0, will prevent the use of that dynamic plugin type. - * plugin bit = 1, will allow the use of that dynamic plugin type. + * A list of pre-defined masks can be found in H5PLpublic.h. + * Set the mask to 0 to disable all plugins. * - * H5PL_TYPE_FILTER changes just dynamic filters - * A H5PL_ALL_PLUGIN will enable all dynamic plugin types - * A zero value will disable all dynamic plugin types + * This function will not allow plugin types if the pathname + * from the HDF5_PLUGIN_PRELOAD environment variable is set to + * the special "::" string. * - * Return: Non-negative or success + * Return: Success: Non-negative + * Failture: Negative * *------------------------------------------------------------------------- */ herr_t -H5PLset_loading_state(unsigned int plugin_type) +H5PLset_loading_state(unsigned int plugin_control_mask) { - char *preload_path; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "Iu", plugin_type); - - /* change the bit value of the requested plugin type(s) */ - H5PL_plugin_g = plugin_type; + H5TRACE1("e", "Iu", plugin_control_mask); - /* check if special ENV variable is set and disable all plugin types */ - if(NULL != (preload_path = HDgetenv("HDF5_PLUGIN_PRELOAD"))) - /* Special symbol "::" means no plugin during data reading. */ - if(!HDstrcmp(preload_path, H5PL_NO_PLUGIN)) - H5PL_plugin_g = 0; + /* Set the plugin control mask */ + if(H5PL__set_plugin_control_mask(plugin_control_mask) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "error setting plugin control mask") done: FUNC_LEAVE_API(ret_value) @@ -307,27 +98,35 @@ done: /*------------------------------------------------------------------------- - * Function: H5PLget_loading_state + * Function: H5PLget_loading_state * - * Purpose: Query state of the loading of dynamic plugin types. + * Purpose: Get the bitmask that controls whether certain classes + * of plugins (e.g.: filters, VOL drivers) will be loaded + * by the library. * - * This function will return the state of the global flag. + * Zero if all plugin types are disabled + * Negative if all plugin types are enabled + * Positive if one or more of the plugin types are enabled * - * Return: Zero if all plugin types are disabled, negative if all - * plugin types are enabled, positive if one or more of the plugin types are enabled. + * Return: Success: Non-negative + * Failture: Negative * *------------------------------------------------------------------------- */ herr_t -H5PLget_loading_state(unsigned int *plugin_type) +H5PLget_loading_state(unsigned int *plugin_control_mask) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*Iu", plugin_type); + H5TRACE1("e", "*Iu", plugin_control_mask); + + if (NULL == plugin_control_mask) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plugin_control_mask parameter cannot be NULL") - if(plugin_type) - *plugin_type = H5PL_plugin_g; + /* Set the plugin control mask */ + if(H5PL__get_plugin_control_mask(plugin_control_mask) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "error getting plugin control mask") done: FUNC_LEAVE_API(ret_value) @@ -335,674 +134,282 @@ done: /*------------------------------------------------------------------------- - * Function: H5PL_load - * - * Purpose: Given the plugin type and identifier, this function searches - * and/or loads a dynamic plugin library first among the already - * opened libraries then in the designated location paths. - * - * Return: Non-NULL on success/NULL on failure - * - * Programmer: Raymond Lu - * 13 February 2013 - * - *------------------------------------------------------------------------- - */ -const void * -H5PL_load(H5PL_type_t type, int id) -{ - htri_t found; /* Whether the plugin was found */ - const void *plugin_info = NULL; - const void *ret_value = NULL; - - FUNC_ENTER_NOAPI(NULL) - - switch(type) { - case H5PL_TYPE_FILTER: - if((H5PL_plugin_g & H5PL_FILTER_PLUGIN) == 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin filter '%d' is not available", id) - break; - - case H5PL_TYPE_ERROR: - case H5PL_TYPE_NONE: - default: - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin '%d' is not valid", id) - } /* end switch */ - - /* Initialize the location paths for dynamic libraries, if they aren't - * already set up. - */ - if(FALSE == H5PL_path_found_g) - if(H5PL__init_path_table() < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINIT, NULL, "can't initialize search path table") - - /* Search in the table of already loaded plugin libraries */ - if((found = H5PL__search_table(type, id, &plugin_info)) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, NULL, "search in table failed") - - /* If not found, iterate through the path table to find the right dynamic library */ - if(!found) { - size_t i; /* Local index variable */ - - for(i = 0; i < H5PL_num_paths_g; i++) { - if((found = H5PL__find(type, id, H5PL_path_table_g[i], &plugin_info)) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, NULL, "search in paths failed") - - /* Break out if found */ - if(found) { - HDassert(plugin_info); - break; - } /* end if */ - } /* end for */ - } /* end if */ - - /* Check if we found the plugin */ - if(found) - ret_value = plugin_info; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5PL_load() */ - - -/*------------------------------------------------------------------------- - * Function: H5PLappend + * Function: H5PLappend * - * Purpose: Insert a plugin path at the end of the list. + * Purpose: Insert a plugin search path at the end of the list. * - * Return: Non-negative or success. + * Return: Success: Non-negative + * Failture: Negative * *------------------------------------------------------------------------- */ herr_t -H5PLappend(const char *plugin_path) +H5PLappend(const char *search_path) { herr_t ret_value = SUCCEED; /* Return value */ - char *dl_path = NULL; FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*s", plugin_path); - if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") - if(NULL == plugin_path) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") - if(NULL == (dl_path = H5MM_strdup(plugin_path))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5TRACE1("e", "*s", search_path); - H5PL_EXPAND_ENV_VAR + /* Check args */ + if (NULL == search_path) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plugin_path parameter cannot be NULL") + if (0 == HDstrlen(search_path)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plugin_path parameter cannot have length zero") - H5PL_path_table_g[H5PL_num_paths_g] = dl_path; - H5PL_num_paths_g++; + /* Append the search path to the path table */ + if (H5PL__append_path(search_path) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTAPPEND, FAIL, "unable to append search path") done: FUNC_LEAVE_API(ret_value) } /* end H5PLappend() */ - + /*------------------------------------------------------------------------- - * Function: H5PLprepend + * Function: H5PLprepend * - * Purpose: Insert a plugin path at the beginning of the list. + * Purpose: Insert a plugin search path at the beginning of the list. * - * Return: Non-negative or success. + * Return: Success: Non-negative + * Failture: Negative * *------------------------------------------------------------------------- */ herr_t -H5PLprepend(const char *plugin_path) +H5PLprepend(const char *search_path) { herr_t ret_value = SUCCEED; /* Return value */ - char *dl_path = NULL; - unsigned int plindex; FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*s", plugin_path); - if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") - if(NULL == plugin_path) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") - if(NULL == (dl_path = H5MM_strdup(plugin_path))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5TRACE1("e", "*s", search_path); - H5PL_EXPAND_ENV_VAR + /* Check args */ + if (NULL == search_path) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plugin_path parameter cannot be NULL") + if (0 == HDstrlen(search_path)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plugin_path parameter cannot have length zero") - for (plindex = (unsigned int)H5PL_num_paths_g; plindex > 0; plindex--) - H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; - H5PL_path_table_g[0] = dl_path; - H5PL_num_paths_g++; + /* Prepend the search path to the path table */ + if (H5PL__prepend_path(search_path) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to prepend search path") done: FUNC_LEAVE_API(ret_value) } /* end H5PLprepend() */ - + /*------------------------------------------------------------------------- - * Function: H5PLreplace + * Function: H5PLreplace * - * Purpose: Replace the path at the specified index. + * Purpose: Replace the path at the specified index. The path at the + * index must exist. * - * Return: Non-negative or success. + * Return: Non-negative or success. * *------------------------------------------------------------------------- */ herr_t -H5PLreplace(const char *plugin_path, unsigned int index) +H5PLreplace(const char *search_path, unsigned int index) { - herr_t ret_value = SUCCEED; /* Return value */ - char *dl_path = NULL; + unsigned num_paths; /* Current number of stored paths */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "*sIu", plugin_path, index); - if(NULL == plugin_path) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") - if(index >= H5PL_MAX_PATH_NUM) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table") - if(NULL == (dl_path = H5MM_strdup(plugin_path))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5TRACE2("e", "*sIu", search_path, index); - H5PL_EXPAND_ENV_VAR + /* Check args */ + if (NULL == search_path) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plugin_path parameter cannot be NULL") + if (0 == HDstrlen(search_path)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plugin_path parameter cannot have length zero") - if(H5PL_path_table_g[index]) - H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]); - H5PL_path_table_g[index] = dl_path; + /* Check index */ + num_paths = H5PL__get_num_paths(); + if (0 == num_paths) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "path table is empty") + else if (index >= num_paths) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index path out of bounds for table - can't be more than %u", (num_paths - 1)) + + /* Insert the search path into the path table */ + if (H5PL__replace_path(search_path, index) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to replace search path") done: FUNC_LEAVE_API(ret_value) } /* end H5PLreplace() */ - + /*------------------------------------------------------------------------- - * Function: H5PLinsert + * Function: H5PLinsert * - * Purpose: Insert a plugin path at the specified index, moving other paths after the index. + * Purpose: Insert a plugin search path at the specified index, moving + * other paths after the index. * - * Return: Non-negative or success. + * Return: Success: Non-negative + * Failture: Negative * *------------------------------------------------------------------------- */ herr_t -H5PLinsert(const char *plugin_path, unsigned int index) +H5PLinsert(const char *search_path, unsigned int index) { - herr_t ret_value = SUCCEED; /* Return value */ - char *dl_path = NULL; - unsigned int plindex; + unsigned num_paths; /* Current number of stored paths */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "*sIu", plugin_path, index); - if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") - if(NULL == plugin_path) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") - if(index >= H5PL_MAX_PATH_NUM) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table") - if(NULL == (dl_path = H5MM_strdup(plugin_path))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") - - H5PL_EXPAND_ENV_VAR - - for(plindex = (unsigned int)H5PL_num_paths_g; plindex > index; plindex--) - H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; - H5PL_path_table_g[index] = dl_path; - H5PL_num_paths_g++; + H5TRACE2("e", "*sIu", search_path, index); + + /* Check args */ + if (NULL == search_path) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plugin_path parameter cannot be NULL") + if (0 == HDstrlen(search_path)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plugin_path parameter cannot have length zero") + + /* Check index */ + num_paths = H5PL__get_num_paths(); + if ((0 != num_paths) && (index >= num_paths)) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index path out of bounds for table - can't be more than %u", (num_paths - 1)) + + /* Insert the search path into the path table */ + if (H5PL__insert_path(search_path, index) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to insert search path") done: FUNC_LEAVE_API(ret_value) } /* end H5PLinsert() */ - + /*------------------------------------------------------------------------- - * Function: H5PLremove + * Function: H5PLremove + * + * Purpose: Remove the plugin path at the specifed index and compact + * the list. * - * Purpose: Remove the plugin path at the specifed index and compacting the list. + * Return: Success: Non-negative + * Failture: Negative * - * Return: Non-negative or success. + * Return: Non-negative or success. * *------------------------------------------------------------------------- */ herr_t H5PLremove(unsigned int index) { - herr_t ret_value = SUCCEED; /* Return value */ - unsigned int plindex; + unsigned num_paths; /* Current number of stored paths */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "Iu", index); - if(H5PL_num_paths_g == 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") - if(index >= H5PL_MAX_PATH_NUM) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table") - if(NULL == H5PL_path_table_g[index]) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") - H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]); - - H5PL_num_paths_g--; - for(plindex = index; plindex < (unsigned int)H5PL_num_paths_g; plindex++) - H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex + 1]; - H5PL_path_table_g[H5PL_num_paths_g] = NULL; + + /* Check index */ + num_paths = H5PL__get_num_paths(); + if (0 == num_paths) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "path table is empty") + else if (index >= num_paths) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index path out of bounds for table - can't be more than %u", (num_paths - 1)) + + /* Delete the search path from the path table */ + if (H5PL__remove_path(index) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTDELETE, FAIL, "unable to remove search path") done: FUNC_LEAVE_API(ret_value) } /* end H5PLremove() */ - + /*------------------------------------------------------------------------- - * Function: H5PLget + * Function: H5PLget + * + * Purpose: Query the plugin path at a specified index. + * + * If 'path_buf' is non-NULL then up to 'buf_size' bytes will be written into + * that buffer and the length of the path name will be returned. * - * Purpose: Query the plugin path at the specified index. + * If 'path_buf' is NULL, this function will simply return the number of + * characters required to store the path name, ignoring 'path_buf' and + * 'buf_size' * - * Return: Success: The length of path. + * If an error occurs then the buffer pointed to by 'path_buf' + * (NULL or non-NULL) will be unchanged and the function will return a + * negative value. * - * If `pathname' is non-NULL then write up to `size' bytes into that - * buffer and always return the length of the pathname. - * Otherwise `size' is ignored and the function does not store the pathname, - * just returning the number of characters required to store the pathname. - * If an error occurs then the buffer pointed to by `pathname' (NULL or non-NULL) - * is unchanged and the function returns a negative value. - * If a zero is returned for the name's length, then there is no pathname - * associated with the index. + * If a zero is returned for the name's length, then there is no path name + * associated with the index and the 'path_buf' buffer will be unchanged. + * + * Return: Success: The length of path + * Failure: A negative value * *------------------------------------------------------------------------- */ ssize_t -H5PLget(unsigned int index, char *pathname/*out*/, size_t size) +H5PLget(unsigned int index, char *path_buf, size_t buf_size) { - ssize_t ret_value = 0; /* Return value */ - size_t len = 0; /* Length of pathname */ - char *dl_path = NULL; + unsigned num_paths; /* Current number of stored paths */ + const char *path = NULL; /* path from table */ + size_t path_len = 0; /* Length of path */ + ssize_t ret_value = 0; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("Zs", "Iuxz", index, pathname, size); - if(H5PL_num_paths_g == 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") - if(index >= H5PL_MAX_PATH_NUM) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table") - if(NULL == (dl_path = H5PL_path_table_g[index])) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") - len = HDstrlen(dl_path); - if(pathname) { - HDstrncpy(pathname, dl_path, MIN((size_t)(len + 1), size)); - if((size_t)len >= size) - pathname[size - 1] = '\0'; + H5TRACE3("Zs", "Iu*sz", index, path_buf, buf_size); + + /* Check index */ + num_paths = H5PL__get_num_paths(); + if (0 == num_paths) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "path table is empty") + else if (index >= num_paths) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index path out of bounds for table - can't be more than %u", (num_paths - 1)) + + /* Check if the search table is empty */ + if (H5PL__get_num_paths() == 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, (-1), "plugin search path table is empty") + + /* Get the path at the specified index and its length */ + if (NULL == (path = H5PL__get_path(index))) + HGOTO_ERROR(H5E_PLUGIN, H5E_BADVALUE, (-1), "no path stored at that index") + path_len = HDstrlen(path); + + /* If the path buffer is not NULL, copy the path to the buffer */ + if (path_buf) { + HDstrncpy(path_buf, path, MIN((size_t)(path_len + 1), buf_size)); + if ((size_t)path_len >= buf_size) + path_buf[buf_size - 1] = '\0'; } /* end if */ /* Set return value */ - ret_value = (ssize_t)len; + ret_value = (ssize_t)path_len; done: FUNC_LEAVE_API(ret_value) } /* end H5PLget() */ - + /*------------------------------------------------------------------------- - * Function: H5PLsize + * Function: H5PLsize * - * Purpose: Query the size of the current list of plugin paths. + * Purpose: Get the number of stored plugin paths. + * XXX: This is a terrible name. Can it be changed? * - * Return: Plugin path size + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t -H5PLsize(unsigned int *listsize) +H5PLsize(unsigned int *num_paths) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*Iu", listsize); + H5TRACE1("e", "*Iu", num_paths); - *listsize = (unsigned int)H5PL_num_paths_g; + /* Check arguments */ + if (!num_paths) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "num_paths parameter cannot be NULL") + + /* Get the number of stored plugin paths */ + *num_paths = H5PL__get_num_paths(); done: FUNC_LEAVE_API(ret_value) } /* end H5PLsize() */ - -/*------------------------------------------------------------------------- - * Function: H5PL__init_path_table - * - * Purpose: Initialize the path table. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * 18 March 2013 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5PL__init_path_table(void) -{ - char *dl_path = NULL; - char *origin_dl_path; - char *dir; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Retrieve paths from HDF5_PLUGIN_PATH if the user sets it - * or from the default paths if it isn't set. - */ - origin_dl_path = HDgetenv("HDF5_PLUGIN_PATH"); - if(NULL == origin_dl_path) - dl_path = H5MM_strdup(H5PL_DEFAULT_PATH); - else - dl_path = H5MM_strdup(origin_dl_path); - if(NULL == dl_path) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") - - H5PL_EXPAND_ENV_VAR - - /* Put paths in the path table. They are separated by ":" */ - dir = HDstrtok(dl_path, H5PL_PATH_SEPARATOR); - while(dir) { - /* Check for too many directories in path */ - if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") - if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = H5MM_strdup(dir))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") - H5PL_num_paths_g++; - dir = HDstrtok(NULL, H5PL_PATH_SEPARATOR); - } /* end while */ - - H5PL_path_found_g = TRUE; - -done: - if(dl_path) - dl_path = (char *)H5MM_xfree(dl_path); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5PL__init_path_table() */ - - -/*------------------------------------------------------------------------- - * Function: H5PL__find - * - * Purpose: Given a path, this function opens the directory and envokes - * another function to go through all files to find the right - * plugin library. Two function definitions are for Unix and - * Windows. - * - * Return: TRUE on success, - * FALSE on not found, - * negative on failure - * - * Programmer: Raymond Lu - * 13 February 2013 - * - *------------------------------------------------------------------------- - */ -#ifndef H5_HAVE_WIN32_API -static htri_t -H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info) -{ - char *pathname = NULL; - DIR *dirp = NULL; - struct dirent *dp; - htri_t ret_value = FALSE; - - FUNC_ENTER_STATIC - - /* Open the directory */ - if(!(dirp = HDopendir(dir))) - HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory: %s", dir) - - /* Iterates through all entries in the directory to find the right plugin library */ - while(NULL != (dp = HDreaddir(dirp))) { - /* The library we are looking for should be called libxxx.so... on Unix - * or libxxx.xxx.dylib on Mac. - */ -#ifndef __CYGWIN__ - if(!HDstrncmp(dp->d_name, "lib", (size_t)3) && - (HDstrstr(dp->d_name, ".so") || HDstrstr(dp->d_name, ".dylib"))) { -#else - if(!HDstrncmp(dp->d_name, "cyg", (size_t)3) && - HDstrstr(dp->d_name, ".dll") ) { - -#endif - h5_stat_t my_stat; - size_t pathname_len; - htri_t found_in_dir; - - /* Allocate & initialize the path name */ - pathname_len = HDstrlen(dir) + HDstrlen(dp->d_name) + 2; - if(NULL == (pathname = (char *)H5MM_malloc(pathname_len))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") - HDsnprintf(pathname, pathname_len, "%s/%s", dir, dp->d_name); - - /* Get info for directory entry */ - if(HDstat(pathname, &my_stat) == -1) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file: %s", HDstrerror(errno)) - - /* If it is a directory, skip it */ - if(S_ISDIR(my_stat.st_mode)) - continue; - - /* Attempt to open the dynamic library as a filter library */ - if((found_in_dir = H5PL__open(plugin_type, pathname, type_id, info)) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") - if(found_in_dir) - HGOTO_DONE(TRUE) /* Indicate success */ - pathname = (char *)H5MM_xfree(pathname); - } /* end if */ - } /* end while */ - -done: - if(dirp) - if(HDclosedir(dirp) < 0) - HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", HDstrerror(errno)) - pathname = (char *)H5MM_xfree(pathname); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5PL__find() */ -#else /* H5_HAVE_WIN32_API */ -static htri_t -H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info) -{ - WIN32_FIND_DATAA fdFile; - HANDLE hFind; - char *pathname = NULL; - char service[2048]; - htri_t ret_value = FALSE; - - FUNC_ENTER_STATIC - - /* Specify a file mask. *.* = We want everything! */ - sprintf(service, "%s\\*.dll", dir); - if((hFind = FindFirstFileA(service, &fdFile)) == INVALID_HANDLE_VALUE) - HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory") - - do { - /* Find first file will always return "." - * and ".." as the first two directories. - */ - if(HDstrcmp(fdFile.cFileName, ".") != 0 && HDstrcmp(fdFile.cFileName, "..") != 0) { - size_t pathname_len; - htri_t found_in_dir; - - /* Allocate & initialize the path name */ - pathname_len = HDstrlen(dir) + HDstrlen(fdFile.cFileName) + 2; - if(NULL == (pathname = (char *)H5MM_malloc(pathname_len))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") - HDsnprintf(pathname, pathname_len, "%s\\%s", dir, fdFile.cFileName); - - /* Is the entity a File or Folder? */ - if(fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - continue; - - if((found_in_dir = H5PL__open(plugin_type, pathname, type_id, info)) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") - if(found_in_dir) - HGOTO_DONE(TRUE) /* Indicate success */ - pathname = (char *)H5MM_xfree(pathname); - } /* end if */ - } while(FindNextFileA(hFind, &fdFile)); /* Find the next file. */ - -done: - if(hFind) - FindClose(hFind); - if(pathname) - pathname = (char *)H5MM_xfree(pathname); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5PL__find() */ -#endif /* H5_HAVE_WIN32_API */ - - -/*------------------------------------------------------------------------- - * Function: H5PL__open - * - * Purpose: Iterates through all files to find the right plugin library. - * It loads the dynamic plugin library and keeps it on the list - * of loaded libraries. - * - * Return: TRUE on success, - * FALSE on not found, - * negative on failure - * - * Programmer: Raymond Lu - * 13 February 2013 - * - *------------------------------------------------------------------------- - */ -static htri_t -H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, const void **pl_info) -{ - H5PL_HANDLE handle = NULL; - htri_t ret_value = FALSE; - - FUNC_ENTER_STATIC - - /* There are different reasons why a library can't be open, e.g. wrong architecture. - * simply continue if we can't open it. - */ - if(NULL == (handle = H5PL_OPEN_DLIB(libname))) { - H5PL_CLR_ERROR; /* clear error */ - } /* end if */ - else { - H5PL_get_plugin_info_t get_plugin_info = NULL; - - /* Return a handle for the function H5PLget_plugin_info in the dynamic library. - * The plugin library is suppose to define this function. - */ - if(NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) { - if(H5PL__close(handle) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") - } /* end if */ - else { - const H5Z_class2_t *plugin_info; - - /* Invoke H5PLget_plugin_info to verify this is the right library we are looking for. - * Move on if it isn't. - */ - if(NULL == (plugin_info = (const H5Z_class2_t *)(*get_plugin_info)())) { - if(H5PL__close(handle) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") - } /* end if */ - - /* Successfully found plugin library, check if it's the right one */ - if(plugin_info->id == pl_id) { - /* Expand the table if it is too small */ - if(H5PL_table_used_g >= H5PL_table_alloc_g) { - size_t n = MAX(H5Z_MAX_NFILTERS, 2 * H5PL_table_alloc_g); - H5PL_table_t *table = (H5PL_table_t *)H5MM_realloc(H5PL_table_g, n * sizeof(H5PL_table_t)); - - if(!table) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "unable to extend dynamic library table") - - H5PL_table_g = table; - H5PL_table_alloc_g = n; - } /* end if */ - - (H5PL_table_g[H5PL_table_used_g]).handle = handle; - (H5PL_table_g[H5PL_table_used_g]).pl_type = pl_type; - (H5PL_table_g[H5PL_table_used_g]).pl_id = plugin_info->id; - H5PL_table_used_g++; - - /* Set the plugin info to return */ - *pl_info = (const void *)plugin_info; - - /* Indicate success */ - ret_value = TRUE; - } /* end if */ - else - if(H5PL__close(handle) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") - } /* end if */ - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5PL__open() */ - - -/*------------------------------------------------------------------------- - * Function: H5PL__search_table - * - * Purpose: Search in the list of already opened dynamic libraries - * to see if the one we are looking for is already opened. - * - * Return: TRUE on success, - * FALSE on not found, - * Negative on failure - * - * Programmer: Raymond Lu - * 13 February 2013 - * - *------------------------------------------------------------------------- - */ -static htri_t -H5PL__search_table(H5PL_type_t plugin_type, int type_id, const void **info) -{ - htri_t ret_value = FALSE; - - FUNC_ENTER_STATIC - - /* Search in the table of already opened dynamic libraries */ - if(H5PL_table_used_g > 0) { - size_t i; - - for(i = 0; i < H5PL_table_used_g; i++) { - if((plugin_type == (H5PL_table_g[i]).pl_type) && (type_id == (H5PL_table_g[i]).pl_id)) { - H5PL_get_plugin_info_t get_plugin_info; - const H5Z_class2_t *plugin_info; - - if(NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PLget_plugin_info"))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info") - - if(NULL == (plugin_info = (const H5Z_class2_t *)(*get_plugin_info)())) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") - - *info = plugin_info; - HGOTO_DONE(TRUE) - } /* end if */ - } /* end for */ - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5PL__search_table() */ - - -/*------------------------------------------------------------------------- - * Function: H5PL__close - * - * Purpose: Closes the handle for dynamic library - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Raymond Lu - * 13 February 2013 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5PL__close(H5PL_HANDLE handle) -{ - FUNC_ENTER_STATIC_NOERR - - H5PL_CLOSE_LIB(handle); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5PL__close() */ - diff --git a/src/H5PLextern.h b/src/H5PLextern.h index 7547ad7..cd5464d 100644 --- a/src/H5PLextern.h +++ b/src/H5PLextern.h @@ -11,9 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu - * 13 February 2013 + * Purpose: Header file for writing external HDF5 plugins. */ + #ifndef _H5PLextern_H #define _H5PLextern_H diff --git a/src/H5PLint.c b/src/H5PLint.c new file mode 100644 index 0000000..bd6bf7d --- /dev/null +++ b/src/H5PLint.c @@ -0,0 +1,381 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: Internal routines for managing plugins. + * + */ + + +/****************/ +/* Module Setup */ +/****************/ + +#include "H5PLmodule.h" /* This source code file is part of the H5PL module */ + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5PLpkg.h" /* Plugin */ +#include "H5Zprivate.h" /* Filter pipeline */ + + +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + + +/*********************/ +/* Package Variables */ +/*********************/ + +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + +/* Bitmask that controls whether classes of plugins + * (e.g.: filters, VOL drivers) can be loaded. + */ +static unsigned int H5PL_plugin_control_mask_g = H5PL_ALL_PLUGIN; + +/* This flag will be set to FALSE if the HDF5_PLUGIN_PRELOAD + * environment variable was set to H5PL_NO_PLUGIN at + * package initialization. + */ +static hbool_t H5PL_allow_plugins_g = TRUE; + + + +/*------------------------------------------------------------------------- + * Function: H5PL__get_plugin_control_mask + * + * Purpose: Gets the internal plugin control mask value. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__get_plugin_control_mask(unsigned int *mask /*out*/) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_NOERR + + /* Check args - Just assert on package functions */ + HDassert(mask); + + /* Return the mask */ + *mask = H5PL_plugin_control_mask_g; + + FUNC_LEAVE_NOAPI(ret_value) + +} /* end H5PL__get_plugin_control_mask() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__set_plugin_control_mask + * + * Purpose: Sets the internal plugin control mask value. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__set_plugin_control_mask(unsigned int mask) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_NOERR + + /* Only allow setting this if plugins have not been disabled. + * XXX: Note that we don't consider this an error, but instead + * silently ignore it. We may want to consider this behavior + * more carefully. + */ + if (H5PL_allow_plugins_g) + H5PL_plugin_control_mask_g = mask; + + FUNC_LEAVE_NOAPI(ret_value) + +} /* end H5PL__set_plugin_control_mask() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__init_package + * + * Purpose: Initialize any package-specific data and call any init + * routines for the package. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__init_package(void) +{ + char *env_var = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_PACKAGE + + /* Check the environment variable to determine if the user wants + * to ignore plugins. The special symbol H5PL_NO_PLUGIN (defined in + * H5PLpublic.h) means we don't want to load plugins. + */ + if (NULL != (env_var = HDgetenv("HDF5_PLUGIN_PRELOAD"))) + if (!HDstrcmp(env_var, H5PL_NO_PLUGIN)) { + H5PL_plugin_control_mask_g = 0; + H5PL_allow_plugins_g = FALSE; + } + + /* Create the table of previously-loaded plugins */ + if (H5PL__create_plugin_cache() < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINIT, FAIL, "can't create plugin cache") + + /* Create the table of search paths for dynamic libraries */ + if (H5PL__create_path_table() < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINIT, FAIL, "can't create plugin search path table") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__init_package() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL_term_package + * + * Purpose: Terminate the H5PL interface: release all memory, reset all + * global variables to initial values. This only happens if all + * types have been destroyed from other interfaces. + * + * Return: Success: Positive if any action was taken that might + * affect some other interface; zero otherwise + * Failure: Negative + * + *------------------------------------------------------------------------- + */ +int +H5PL_term_package(void) +{ + hbool_t already_closed = FALSE; + int ret_value = 0; + + FUNC_ENTER_NOAPI_NOINIT + + if (H5_PKG_INIT_VAR) { + + /* Close the plugin cache. + * We need to bump the return value if we did any real work here. + */ + if (H5PL__close_plugin_cache(&already_closed) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTFREE, (-1), "problem closing plugin cache") + if (!already_closed) + ret_value++; + + /* Close the search path table and free the paths */ + if (H5PL__close_path_table() < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTFREE, (-1), "problem closing search path table") + + /* Mark the interface as uninitialized */ + if (0 == ret_value) + H5_PKG_INIT_VAR = FALSE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL_term_package() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL_load + * + * Purpose: Given the plugin type and identifier, this function searches + * for and, if found, loads a dynamic plugin library. + * + * The function searches first in the cached plugins and then + * in the paths listed in the path table. + * + * Return: Success: A pointer to the plugin info + * Failure: NULL + * + *------------------------------------------------------------------------- + */ +const void * +H5PL_load(H5PL_type_t type, int id) +{ + H5PL_search_params_t search_params; + hbool_t found = FALSE; /* Whether the plugin was found */ + const void *plugin_info = NULL; + const void *ret_value = NULL; + + FUNC_ENTER_NOAPI(NULL) + + /* Check if plugins can be loaded for this plugin type */ + switch (type) { + case H5PL_TYPE_FILTER: + if ((H5PL_plugin_control_mask_g & H5PL_FILTER_PLUGIN) == 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin filter '%d' is not available", id) + break; + + case H5PL_TYPE_ERROR: + case H5PL_TYPE_NONE: + default: + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin '%d' is not valid", id) + } + + /* Set up the search parameters */ + search_params.type = type; + search_params.id = id; + + /* Search in the table of already loaded plugin libraries */ + if(H5PL__find_plugin_in_cache(&search_params, &found, &plugin_info) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, NULL, "search in plugin cache failed") + + /* If not found, try iterating through the path table to find an appropriate plugin */ + if (!found) + if (H5PL__find_plugin_in_path_table(&search_params, &found, &plugin_info) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, NULL, "search in path table failed") + + /* Set the return value we found the plugin */ + if (found) + ret_value = plugin_info; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL_load() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__open + * + * Purpose: Opens a plugin. + * + * The success parameter will be set to TRUE and the plugin_info + * parameter will be filled in on success. Otherwise, they + * will be FALSE and NULL, respectively. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const void **plugin_info) +{ + H5PL_HANDLE handle = NULL; + H5PL_get_plugin_info_t get_plugin_info = NULL; + htri_t ret_value = SUCCEED; + + FUNC_ENTER_PACKAGE + + /* Check args - Just assert on package functions */ + HDassert(path); + HDassert(success); + HDassert(plugin_info); + + /* Initialize out parameters */ + *success = FALSE; + *plugin_info = NULL; + + /* There are different reasons why a library can't be open, e.g. wrong architecture. + * If we can't open the library, just return. + */ + if (NULL == (handle = H5PL_OPEN_DLIB(path))) { + H5PL_CLR_ERROR; /* clear error */ + HGOTO_DONE(SUCCEED); + } + + + /* Return a handle for the function H5PLget_plugin_info in the dynamic library. + * The plugin library is suppose to define this function. + * + * NOTE: We turn off -Wpedantic in gcc to quiet a warning about converting + * object pointers to function pointers, which is undefined in ANSI C. + * This is basically unavoidable due to the nature of dlsym() and *is* + * defined in POSIX, so it's fine. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" + if (NULL != (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) { +#pragma GCC diagnostic pop + + const H5Z_class2_t *info; + + /* Get the plugin info */ + if (NULL == (info = (const H5Z_class2_t *)(*get_plugin_info)())) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") + + /* Check if the filter IDs match */ + if (info->id == id) { + + /* Store the plugin in the cache */ + if (H5PL__add_plugin(type, id, handle)) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to add new plugin to plugin cache") + + /* Set output parameters */ + *success = TRUE; + *plugin_info = (const void *)info; + } + } + +done: + if (!success && handle) + if (H5PL__close(handle) < 0) + HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__open() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__close + * + * Purpose: Closes the handle for dynamic library + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__close(H5PL_HANDLE handle) +{ + FUNC_ENTER_PACKAGE_NOERR + + H5PL_CLOSE_LIB(handle); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5PL__close() */ + diff --git a/src/H5PLmodule.h b/src/H5PLmodule.h index b441aed..945441e 100644 --- a/src/H5PLmodule.h +++ b/src/H5PLmodule.h @@ -11,13 +11,11 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5PL package. Including this header means that the source file - * is part of the H5PL package. + * Purpose: This file contains declarations which define macros for the + * H5PL package. Including this header means that the source file + * is part of the H5PL package. */ + #ifndef _H5PLmodule_H #define _H5PLmodule_H diff --git a/src/H5PLpath.c b/src/H5PLpath.c new file mode 100644 index 0000000..435802a --- /dev/null +++ b/src/H5PLpath.c @@ -0,0 +1,776 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: Code to implement a path table which stores plugin search paths. + * + * The path table is implemented as a dynamic, global array which + * will grow as new paths are inserted. The capacity of the path + * table never shrinks (though given the low number of paths + * expected and the low likelihood of paths being removed, this + * seems unlikely to be a problem). Inserts and removals rework + * the array so that there are no 'holes' in the in-use part + * of the array. + * + * Note that it's basically up to the user to manage the indexes + * when a complicated series of insert, overwrite, and, remove + * operations take place. + */ + +/****************/ +/* Module Setup */ +/****************/ + +#include "H5PLmodule.h" /* This source code file is part of the H5PL module */ + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5PLpkg.h" /* Plugin */ + + +/****************/ +/* Local Macros */ +/****************/ + +/* Initial capacity of the path table */ +#define H5PL_INITIAL_PATH_CAPACITY 16 + +/* The amount to add to the capacity when the table is full */ +#define H5PL_PATH_CAPACITY_ADD 16 + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + +static herr_t H5PL__insert_at(const char *path, unsigned int index); +static herr_t H5PL__make_space_at(unsigned int index); +static herr_t H5PL__replace_at(const char *path, unsigned int index); +static herr_t H5PL__expand_path_table(void); +static herr_t H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *found, const char *dir, const void **plugin_info); + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + +/* Stored plugin paths to search */ +static char **H5PL_paths_g = NULL; + +/* The number of stored paths */ +static unsigned H5PL_num_paths_g = 0; + +/* The capacity of the path table */ +static unsigned H5PL_path_capacity_g = H5PL_INITIAL_PATH_CAPACITY; + + + +/*------------------------------------------------------------------------- + * Function: H5PL__insert_at() + * + * Purpose: Insert a path at a particular index in the path table. + * Does not clobber! Will move existing paths up to make + * room. Use H5PL__replace_at(index) if you want to clobber. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +H5PL__insert_at(const char *path, unsigned int index) +{ + char *path_copy = NULL; /* copy of path string (for storing) */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Check args - Just assert on package functions */ + HDassert(path); + HDassert(HDstrlen(path)); + + /* Expand the table if it is full */ + if (H5PL_num_paths_g == H5PL_path_capacity_g) + if (H5PL__expand_path_table() < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't expand path table") + + /* Copy the path for storage so the caller can dispose of theirs */ + if (NULL == (path_copy = H5MM_strdup(path))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't make internal copy of path") + +#ifdef H5_HAVE_WIN32_API + /* Clean up Microsoft Windows environment variables in the path string */ + if(H5_expand_windows_env_vars(&path_copy)) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTCONVERT, FAIL, "can't expand environment variable string") +#endif /* H5_HAVE_WIN32_API */ + + /* If the table entry is in use, make some space */ + if (H5PL_paths_g[index]) + if (H5PL__make_space_at(index) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "unable to make space in the table for the new entry") + + /* Insert the copy of the search path into the table at the specified index */ + H5PL_paths_g[index] = path_copy; + H5PL_num_paths_g++; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__insert_at() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__make_space_at() + * + * Purpose: Free up a slot in the path table, moving existing path + * entries as necessary. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +H5PL__make_space_at(unsigned int index) +{ + unsigned u; /* iterator */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_NOERR + + /* Check args - Just assert on package functions */ + HDassert(index < H5PL_path_capacity_g); + + /* Copy the paths back to make a space */ + for (u = H5PL_num_paths_g; u > index; u--) + H5PL_paths_g[u] = H5PL_paths_g[u-1]; + + H5PL_paths_g[index] = NULL; + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__make_space_at() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__replace_at() + * + * Purpose: Replace a path at a particular index in the path table. + * The path in the table must exist and will be freed by this + * function. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +H5PL__replace_at(const char *path, unsigned int index) +{ + char *path_copy = NULL; /* copy of path string (for storing) */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Check args - Just assert on package functions */ + HDassert(path); + HDassert(HDstrlen(path)); + + /* Check that the table entry is in use */ + if (!H5PL_paths_g[index]) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTFREE, FAIL, "path entry at index %u in the table is NULL", index) + + /* Copy the path for storage so the caller can dispose of theirs */ + if (NULL == (path_copy = H5MM_strdup(path))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't make internal copy of path") + +#ifdef H5_HAVE_WIN32_API + /* Clean up Microsoft Windows environment variables in the path string */ + if (H5_expand_windows_env_vars(&path_copy)) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTCONVERT, FAIL, "can't expand environment variable string") +#endif /* H5_HAVE_WIN32_API */ + + /* Free the existing path entry */ + H5PL_paths_g[index] = (char *)H5MM_xfree(H5PL_paths_g[index]); + + /* Copy the search path into the table at the specified index */ + H5PL_paths_g[index] = path_copy; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__replace_at() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__create_path_table + * + * Purpose: Create the collection of paths that will be searched + * when loading plugins. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__create_path_table(void) +{ + char *env_var= NULL; /* Path string from environment variable */ + char *paths = NULL; /* Delimited paths string. Either from the + * environment variable or the default. + */ + char *next_path = NULL; /* A path tokenized from the paths string */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Allocate memory for the path table */ + H5PL_num_paths_g = 0; + H5PL_path_capacity_g = H5PL_INITIAL_PATH_CAPACITY; + if (NULL == (H5PL_paths_g = (char **)H5MM_calloc((size_t)H5PL_path_capacity_g * sizeof(char *)))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path table") + + /* Retrieve paths from HDF5_PLUGIN_PATH if the user sets it + * or from the default paths if it isn't set. + */ + env_var = HDgetenv("HDF5_PLUGIN_PATH"); + if (NULL == env_var) + paths = H5MM_strdup(H5PL_DEFAULT_PATH); + else + paths = H5MM_strdup(env_var); + + if (NULL == paths) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path copy") + + /* Separate the paths and store them */ + /* XXX: strtok() is not thread-safe */ + next_path = HDstrtok(paths, H5PL_PATH_SEPARATOR); + while (next_path) { + + /* Insert the path into the table */ + if (H5PL__append_path(next_path) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't insert path: %s", next_path) + + /* Get the next path from the environment string */ + next_path = HDstrtok(NULL, H5PL_PATH_SEPARATOR); + } /* end while */ + +done: + if (paths) + paths = (char *)H5MM_xfree(paths); + + /* Try to clean up on errors */ + if (FAIL == ret_value) { + if (H5PL_paths_g) + H5PL_paths_g = (char **)H5MM_xfree(H5PL_paths_g); + H5PL_path_capacity_g = 0; + } + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__create_path_table() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__close_path_table + * + * Purpose: Close the collection of paths that will be searched + * when loading plugins. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__close_path_table(void) +{ + unsigned u; /* iterator */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_NOERR + + /* Free paths */ + for (u = 0; u < H5PL_num_paths_g; u++) + if (H5PL_paths_g[u]) + H5PL_paths_g[u] = (char *)H5MM_xfree(H5PL_paths_g[u]); + + /* Free path table */ + H5PL_paths_g = (char **)H5MM_xfree(H5PL_paths_g); + + /* Reset values */ + H5PL_num_paths_g = 0; + + FUNC_LEAVE_NOAPI(ret_value) + +} /* end H5PL__close_path_table() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__get_num_paths + * + * Purpose: Gets the number of plugin paths that have been stored. + * + * Return: Success: The number of paths + * Failture: Can't fail + *------------------------------------------------------------------------- + */ +unsigned +H5PL__get_num_paths(void) +{ + FUNC_ENTER_PACKAGE_NOERR + + FUNC_LEAVE_NOAPI(H5PL_num_paths_g) + +} /* end H5PL__get_num_paths() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__expand_path_table + * + * Purpose: Expand the path table when it's full. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +H5PL__expand_path_table(void) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + /* Update the capacity */ + H5PL_path_capacity_g += H5PL_PATH_CAPACITY_ADD; + + /* Resize the array */ + if(NULL == (H5PL_paths_g = (char **)H5MM_realloc(H5PL_paths_g, (size_t)H5PL_path_capacity_g * sizeof(char *)))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "allocating additional memory for path table failed") + + /* Initialize the new memory */ + HDmemset(H5PL_paths_g + H5PL_num_paths_g, 0, (size_t)H5PL_PATH_CAPACITY_ADD * sizeof(char *)); + +done: + /* Set the path capacity back if there were problems */ + if (FAIL == ret_value) + H5PL_path_capacity_g -= H5PL_PATH_CAPACITY_ADD; + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__expand_path_table() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__append_path + * + * Purpose: Insert a path at the end of the table. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__append_path(const char *path) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Check args - Just assert on package functions */ + HDassert(path); + HDassert(HDstrlen(path)); + + /* Insert the path at the end of the table */ + if (H5PL__insert_at(path, H5PL_num_paths_g) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to append search path") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__append_path() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__prepend_path + * + * Purpose: Insert a path at the beginning of the table. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__prepend_path(const char *path) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Check args - Just assert on package functions */ + HDassert(path); + HDassert(HDstrlen(path)); + + /* Insert the path at the beginning of the table */ + if (H5PL__insert_at(path, 0) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to prepend search path") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__prepend_path() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__replace_path + * + * Purpose: Replace a path at particular index in the table. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__replace_path(const char *path, unsigned int index) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Check args - Just assert on package functions */ + HDassert(path); + HDassert(HDstrlen(path)); + HDassert(index < H5PL_path_capacity_g); + + /* Insert the path at the requested index */ + if (H5PL__replace_at(path, index) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to replace search path") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__replace_path() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__insert_path + * + * Purpose: Insert a path at particular index in the table, moving + * any existing paths back to make space. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__insert_path(const char *path, unsigned int index) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Check args - Just assert on package functions */ + HDassert(path); + HDassert(HDstrlen(path)); + HDassert(index < H5PL_path_capacity_g); + + /* Insert the path at the requested index */ + if (H5PL__insert_at(path, index) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to insert search path") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__insert_path() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__remove_path + * + * Purpose: Remove a path at particular index in the table, freeing + * the path string and moving the paths down to close the gap. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__remove_path(unsigned int index) +{ + unsigned u; /* iterator */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Check args - Just assert on package functions */ + HDassert(index < H5PL_path_capacity_g); + + /* Check if the path at that index is set */ + if (!H5PL_paths_g[index]) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTDELETE, FAIL, "search path at index %u is NULL", index) + + /* Delete the path */ + H5PL_num_paths_g--; + H5PL_paths_g[index] = (char *)H5MM_xfree(H5PL_paths_g[index]); + + /* Shift the paths down to close the gap */ + for (u = index; u < H5PL_num_paths_g; u++) + H5PL_paths_g[u] = H5PL_paths_g[u+1]; + + /* Set the (former) last path to NULL */ + H5PL_paths_g[H5PL_num_paths_g] = NULL; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__remove_path() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__get_path + * + * Purpose: Get a pointer to a path at particular index in the table. + * + * Return: Success: A pointer to a path string stored in the table + * Failure: NULL + * + *------------------------------------------------------------------------- + */ +const char * +H5PL__get_path(unsigned int index) +{ + char *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Get the path at the requested index */ + if (index >= H5PL_num_paths_g) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "path index %u is out of range in table", index) + + return H5PL_paths_g[index]; +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__replace_path() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__find_plugin_in_path_table + * + * Purpose: Attempts to find a matching plugin in the file system + * using the paths stored in the path table. + *. + * The 'found' parameter will be set appropriately. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__find_plugin_in_path_table(const H5PL_search_params_t *search_params, hbool_t *found, const void **plugin_info) +{ + unsigned int u; /* iterator */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_PACKAGE + + /* Check args - Just assert on package functions */ + HDassert(search_params); + HDassert(found); + HDassert(plugin_info); + + /* Initialize output parameters */ + *found = FALSE; + *plugin_info = NULL; + + /* Loop over the paths in the table, checking for an appropriate plugin */ + for (u = 0; u < H5PL_num_paths_g; u++) { + + /* Search for the plugin in this path */ + if (H5PL__find_plugin_in_path(search_params, found, H5PL_paths_g[u], plugin_info) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in path %s encountered an error", H5PL_paths_g[u]) + + /* Break out if found */ + if (*found) { + if (!plugin_info) + HGOTO_ERROR(H5E_PLUGIN, H5E_BADVALUE, FAIL, "plugin info should not be NULL") + break; + } + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__find_plugin_in_path_table() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__find_plugin_in_path + * + * Purpose: Given a path, this function opens the directory and envokes + * another function to go through all files to find the right + * plugin library. Two function definitions are for Unix and + * Windows. + * + * The found parameter will be set to TRUE and the info + * parameter will be filled in on success. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +#ifndef H5_HAVE_WIN32_API +static herr_t +H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *found, const char *dir, const void **plugin_info) +{ + char *path = NULL; + DIR *dirp = NULL; /* Directory stream */ + struct dirent *dp = NULL; /* Directory entry */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + /* Check args - Just assert on package functions */ + HDassert(search_params); + HDassert(found); + HDassert(dir); + HDassert(plugin_info); + + /* Initialize the found parameter */ + *found = FALSE; + + /* Open the directory */ + if (!(dirp = HDopendir(dir))) + HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory: %s", dir) + + /* Iterate through all entries in the directory */ + while (NULL != (dp = HDreaddir(dirp))) { + + /* The library we are looking for should be called libxxx.so... on Unix + * or libxxx.xxx.dylib on Mac. + */ +#ifndef __CYGWIN__ + if (!HDstrncmp(dp->d_name, "lib", (size_t)3) && + (HDstrstr(dp->d_name, ".so") || HDstrstr(dp->d_name, ".dylib"))) { +#else + if (!HDstrncmp(dp->d_name, "cyg", (size_t)3) && + HDstrstr(dp->d_name, ".dll") ) { +#endif + + h5_stat_t my_stat; + size_t len; + + /* Allocate & initialize the path name */ + len = HDstrlen(dir) + HDstrlen(H5PL_PATH_SEPARATOR) + HDstrlen(dp->d_name) + 1 /*\0*/; + + if (NULL == (path = (char *)H5MM_calloc(len))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + + HDsnprintf(path, len, "%s/%s", dir, dp->d_name); + + /* Get info for directory entry */ + if (HDstat(path, &my_stat) == -1) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file %s -- error was: %s", path, HDstrerror(errno)) + + /* If it is a directory, skip it */ + if (S_ISDIR(my_stat.st_mode)) + continue; + + /* attempt to open the dynamic library as a filter library */ + if (H5PL__open(path, search_params->type, search_params->id, found, plugin_info) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") + if (*found) + HGOTO_DONE(SUCCEED) + + path = (char *)H5MM_xfree(path); + } /* end if */ + } /* end while */ + +done: + if (dirp) + if (HDclosedir(dirp) < 0) + HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", HDstrerror(errno)) + + path = (char *)H5MM_xfree(path); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__find_plugin_in_path() */ +#else /* H5_HAVE_WIN32_API */ +static herr_t +H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *found, const char *dir, const void **plugin_info) +{ + WIN32_FIND_DATAA fdFile; + HANDLE hFind = INVALID_HANDLE_VALUE; + char *path = NULL; + char service[2048]; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + /* Check args - Just assert on package functions */ + HDassert(search_params); + HDassert(found); + HDassert(dir); + HDassert(plugin_info); + + /* Initialize the found parameter */ + *found = FALSE; + + /* Specify a file mask. *.* = We want everything! */ + HDsprintf(service, "%s\\*.dll", dir); + if ((hFind = FindFirstFileA(service, &fdFile)) == INVALID_HANDLE_VALUE) + HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory") + + /* Loop over all the files */ + do { + /* Ignore '.' and '..' */ + if (HDstrcmp(fdFile.cFileName, ".") != 0 && HDstrcmp(fdFile.cFileName, "..") != 0) { + + /* XXX: Probably just continue here and move the code below over one tab */ + + size_t len; + + /* Allocate & initialize the path name */ + len = HDstrlen(dir) + HDstrlen(H5PL_PATH_SEPARATOR) + HDstrlen(fdFile.cFileName) + 1; + + if (NULL == (path = (char *)H5MM_calloc(len))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + + HDsnprintf(path, len, "%s\\%s", dir, fdFile.cFileName); + + /* Ignore directories */ + if (fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + continue; + + /* attempt to open the dynamic library as a filter library */ + if (H5PL__open(path, search_params->type, search_params->id, found, plugin_info) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") + if (*found) + HGOTO_DONE(SUCCEED) + + path = (char *)H5MM_xfree(path); + } + } while (FindNextFileA(hFind, &fdFile)); + +done: + if (hFind != INVALID_HANDLE_VALUE) + FindClose(hFind); + if (path) + path = (char *)H5MM_xfree(path); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__find_plugin_in_path() */ +#endif /* H5_HAVE_WIN32_API */ + diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index e356893..0d1c271 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -11,6 +11,12 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * Purpose: This file contains declarations which are visible only within + * the H5PL package. Source files outside the H5PL package should + * include H5PLprivate.h instead. + */ + #if !(defined H5PL_FRIEND || defined H5PL_MODULE) #error "Do not include this file outside the H5PL package!" #endif @@ -27,13 +33,92 @@ /* Package Private Macros */ /**************************/ -#define H5PL_MAX_PATH_NUM 16 +/* Whether to pre-load pathnames for plugin libraries */ +#define H5PL_DEFAULT_PATH H5_DEFAULT_PLUGINDIR + + +/****************************/ +/* Macros for supporting */ +/* both Windows and POSIX */ +/****************************/ + +/*******************/ +/* Windows support */ +/*******************/ +/* + * SPECIAL WINDOWS NOTE + * + * Some of the Win32 API functions expand to fooA or fooW depending on + * whether UNICODE or _UNICODE are defined. You MUST explicitly use + * the A version of the functions to force char * behavior until we + * work out a scheme for proper Windows Unicode support. + * + * If you do not do this, people will be unable to incorporate our + * source code into their own CMake builds if they define UNICODE. + */ +#ifdef H5_HAVE_WIN32_API + + /* The path separator on this platform */ +# define H5PL_PATH_SEPARATOR ";" + + /* Handle for dynamic library */ +# define H5PL_HANDLE HINSTANCE + + /* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ +# define H5PL_OPEN_DLIB(S) LoadLibraryExA(S, NULL, LOAD_WITH_ALTERED_SEARCH_PATH) + + /* Get the address of a symbol in dynamic library */ +# define H5PL_GET_LIB_FUNC(H,N) GetProcAddress(H,N) + + /* Close dynamic library */ +# define H5PL_CLOSE_LIB(H) FreeLibrary(H) + + /* Clear error - nothing to do */ +# define H5PL_CLR_ERROR + + /* maximum size for expanding env vars */ +# define H5PL_EXPAND_BUFFER_SIZE 32767 + + typedef const void *(__cdecl *H5PL_get_plugin_info_t)(void); + +#else /* H5_HAVE_WIN32_API */ + + /*****************/ + /* POSIX support */ + /*****************/ + + /* The path separator on this platform */ +# define H5PL_PATH_SEPARATOR ":" + + /* Handle for dynamic library */ +# define H5PL_HANDLE void * + + /* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ +# define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY) + + /* Get the address of a symbol in dynamic library */ +# define H5PL_GET_LIB_FUNC(H,N) dlsym(H,N) + + /* Close dynamic library */ +# define H5PL_CLOSE_LIB(H) dlclose(H) + + /* Clear error */ +# define H5PL_CLR_ERROR HERROR(H5E_PLUGIN, H5E_CANTGET, "can't dlopen:%s", dlerror()) + + typedef const void *(*H5PL_get_plugin_info_t)(void); +#endif /* H5_HAVE_WIN32_API */ /****************************/ /* Package Private Typedefs */ /****************************/ +/* Data used to search for plugins */ +typedef struct H5PL_search_params_t { + H5PL_type_t type; + int id; +} H5PL_search_params_t; + /*****************************/ /* Package Private Variables */ @@ -44,5 +129,31 @@ /* Package Private Prototypes */ /******************************/ +/* Accessors to global variables and flags */ +H5_DLL herr_t H5PL__get_plugin_control_mask(unsigned int *mask /*out*/); +H5_DLL herr_t H5PL__set_plugin_control_mask(unsigned int mask); + +/* Plugin search and manipulation */ +H5_DLL herr_t H5PL__open(const char *libname, H5PL_type_t type, int id, hbool_t *success /*out*/, const void **plugin_info /*out*/); +H5_DLL herr_t H5PL__close(H5PL_HANDLE handle); + +/* Plugin cache calls */ +H5_DLL herr_t H5PL__create_plugin_cache(void); +H5_DLL herr_t H5PL__close_plugin_cache(hbool_t *already_closed /*out*/); +H5_DLL herr_t H5PL__add_plugin(H5PL_type_t type, int id, H5PL_HANDLE handle); +H5_DLL herr_t H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *found /*out*/, const void **plugin_info /*out*/); + +/* Plugin search path calls */ +H5_DLL herr_t H5PL__create_path_table(void); +H5_DLL herr_t H5PL__close_path_table(void); +H5_DLL unsigned H5PL__get_num_paths(void); +H5_DLL herr_t H5PL__append_path(const char *path); +H5_DLL herr_t H5PL__prepend_path(const char *path); +H5_DLL herr_t H5PL__replace_path(const char *path, unsigned int index); +H5_DLL herr_t H5PL__insert_path(const char *path, unsigned int index); +H5_DLL herr_t H5PL__remove_path(unsigned int index); +H5_DLL const char *H5PL__get_path(unsigned int index); +H5_DLL herr_t H5PL__find_plugin_in_path_table(const H5PL_search_params_t *search_params, hbool_t *found /*out*/, const void **plugin_info /*out*/); + #endif /* _H5PLpkg_H */ diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c new file mode 100644 index 0000000..30a0798 --- /dev/null +++ b/src/H5PLplugin_cache.c @@ -0,0 +1,308 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: Code to implement a plugin cache which stores information + * about plugins which have already been loaded. + * + * The plugin cache is implemented as a dynamic, global array which + * will grow as new plugins are added. The capacity of the cache + * never shrinks since plugins stay in memory once loaded. + * + * Note that this functionality has absolutely nothing to do with + * the metadata or chunk caches. + */ + +/****************/ +/* Module Setup */ +/****************/ + +#include "H5PLmodule.h" /* This source code file is part of the H5PL module */ + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5PLpkg.h" /* Plugin */ +#include "H5Zprivate.h" /* Filter pipeline */ + + +/****************/ +/* Local Macros */ +/****************/ + +/* Initial capacity of the plugin cache */ +#define H5PL_INITIAL_CACHE_CAPACITY 16 + +/* The amount to add to the capacity when the cache is full */ +#define H5PL_CACHE_CAPACITY_ADD 16 + + +/******************/ +/* Local Typedefs */ +/******************/ + +/* Type for the list of info for opened plugin libraries */ +typedef struct H5PL_plugin_t { + H5PL_type_t type; /* Plugin type */ + int id; /* ID for the plugin */ + H5PL_HANDLE handle; /* Plugin handle */ +} H5PL_plugin_t; + + +/********************/ +/* Local Prototypes */ +/********************/ + +static herr_t H5PL__expand_cache(void); + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + +/* Cache for storing opened plugin libraries */ +static H5PL_plugin_t *H5PL_cache_g = NULL; + +/* The number of stored plugins */ +static unsigned int H5PL_num_plugins_g = 0; + +/* The capacity of the plugin cache */ +static unsigned int H5PL_cache_capacity_g = 0; + + + +/*------------------------------------------------------------------------- + * Function: H5PL__create_plugin_cache + * + * Purpose: Create the cache that will store plugins that have already + * been loaded. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__create_plugin_cache(void) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_PACKAGE + + /* Allocate memory for the plugin cache */ + H5PL_num_plugins_g = 0; + + H5PL_cache_capacity_g = H5PL_INITIAL_CACHE_CAPACITY; + + if (NULL == (H5PL_cache_g = (H5PL_plugin_t *)H5MM_calloc((size_t)H5PL_cache_capacity_g * sizeof(H5PL_plugin_t)))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin cache") + +done: + /* Try to clean up on errors */ + if (FAIL == ret_value) { + if (H5PL_cache_g) + H5PL_cache_g = (H5PL_plugin_t *)H5MM_xfree(H5PL_cache_g); + H5PL_cache_capacity_g = 0; + } + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__create_plugin_cache() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__close_plugin_cache + * + * Purpose: Close the cache of plugins that have already been loaded, + * closing all the plugins contained inside. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__close_plugin_cache(hbool_t *already_closed /*out*/) +{ + unsigned int u; /* iterator */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_PACKAGE_NOERR + + /* Close opened dynamic libraries */ + if (H5PL_cache_g) { + + /* Close any cached plugins */ + for (u = 0; u < H5PL_num_plugins_g; u++) + H5PL__close((H5PL_cache_g[u]).handle); + + /* Free the cache array */ + H5PL_cache_g = (H5PL_plugin_t *)H5MM_xfree(H5PL_cache_g); + H5PL_num_plugins_g = 0; + H5PL_cache_capacity_g = 0; + + /* Note that actually closed the table (needed by package close call) */ + *already_closed = FALSE; + } + else + *already_closed = TRUE; + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__close_plugin_cache() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__expand_cache + * + * Purpose: Expand the plugin cache when it's full. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +H5PL__expand_cache(void) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + /* Update the capacity */ + H5PL_cache_capacity_g += H5PL_CACHE_CAPACITY_ADD; + + /* Resize the array */ + if(NULL == (H5PL_cache_g = (H5PL_plugin_t *)H5MM_realloc(H5PL_cache_g, (size_t)H5PL_cache_capacity_g * sizeof(H5PL_plugin_t)))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "allocating additional memory for plugin cache failed") + + /* Initialize the new memory */ + HDmemset(H5PL_cache_g + H5PL_num_plugins_g, 0, (size_t)H5PL_CACHE_CAPACITY_ADD * sizeof(H5PL_plugin_t)); + +done: + /* Set the cache capacity back if there were problems */ + if (FAIL == ret_value) + H5PL_cache_capacity_g -= H5PL_CACHE_CAPACITY_ADD; + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__expand_cache() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__add_plugin + * + * Purpose: Add a plugin to the plugin cached. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__add_plugin(H5PL_type_t type, int id, H5PL_HANDLE handle) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_PACKAGE + + /* Expand the cache if it is too small */ + if (H5PL_num_plugins_g >= H5PL_cache_capacity_g) + if (H5PL__expand_cache() < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't expand plugin cache") + + /* Store the plugin info and bump the # of plugins */ + H5PL_cache_g[H5PL_num_plugins_g].type = type; + H5PL_cache_g[H5PL_num_plugins_g].id = id; + H5PL_cache_g[H5PL_num_plugins_g].handle = handle; + + H5PL_num_plugins_g++; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__add_plugin() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL__find_plugin_in_cache + * + * Purpose: Attempts to find a matching plugin from the cache. + * + * The 'found' parameter will be set appropriately. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *found, const void **plugin_info) +{ + unsigned int u; /* iterator */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_PACKAGE + + /* Check args - Just assert on package functions */ + HDassert(search_params); + HDassert(found); + HDassert(plugin_info); + + /* Initialize output parameters */ + *found = FALSE; + *plugin_info = NULL; + + /* Loop over all the plugins, looking for one that matches */ + for (u = 0; u < H5PL_num_plugins_g; u++) { + + /* If the plugin type (filter, etc.) and ID match, query the plugin for its info */ + if ((search_params->type == (H5PL_cache_g[u]).type) && (search_params->id == (H5PL_cache_g[u]).id)) { + + H5PL_get_plugin_info_t get_plugin_info_function; + const H5Z_class2_t *filter_info; + + /* Get the "get plugin info" function from the plugin. + * + * See the other use of H5PL_GET_LIB_FUNC() for an explanation + * for why we disable -Wpedantic here. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" + if (NULL == (get_plugin_info_function = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC((H5PL_cache_g[u]).handle, "H5PLget_plugin_info"))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info") +#pragma GCC diagnostic pop + + /* Call the "get plugin info" function */ + if (NULL == (filter_info = (const H5Z_class2_t *)(*get_plugin_info_function)())) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") + + /* Set output parameters */ + *found = TRUE; + *plugin_info = filter_info; + + /* No need to continue processing */ + break; + + } /* end if */ + + } /* end for */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5PL__find_plugin_in_cache() */ + diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index 0ab8f8c..bc12e64 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -10,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Raymond Lu - * 13 February 2013 +/* + * This file contains private information about the H5PL module */ #ifndef _H5PLprivate_H diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 9ce1fca..3b36ccd 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -10,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Raymond Lu - * 13 February 2013 +/* + * This file contains public declarations for the H5PL module. */ #ifndef _H5PLpublic_H @@ -24,31 +24,35 @@ /* Public Typedefs */ /*******************/ +/* Special string to indicate no plugin loading. + */ +#define H5PL_NO_PLUGIN "::" + /* Plugin type used by the plugin library */ typedef enum H5PL_type_t { - H5PL_TYPE_ERROR = -1, /*error */ - H5PL_TYPE_FILTER = 0, /*filter */ - H5PL_TYPE_NONE = 1 /*this must be last! */ + H5PL_TYPE_ERROR = -1, /* Error */ + H5PL_TYPE_FILTER = 0, /* Filter */ + H5PL_TYPE_NONE = 1 /* This must be last! */ } H5PL_type_t; /* Common dynamic plugin type flags used by the set/get_loading_state functions */ -#define H5PL_FILTER_PLUGIN 0x0001 -#define H5PL_ALL_PLUGIN 0xFFFF +#define H5PL_FILTER_PLUGIN 0x0001 +#define H5PL_ALL_PLUGIN 0xFFFF #ifdef __cplusplus extern "C" { #endif /* plugin state */ -H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_type); -H5_DLL herr_t H5PLget_loading_state(unsigned int *plugin_type/*out*/); -H5_DLL herr_t H5PLappend(const char *plugin_path); -H5_DLL herr_t H5PLprepend(const char *plugin_path); -H5_DLL herr_t H5PLreplace(const char *plugin_path, unsigned int index); -H5_DLL herr_t H5PLinsert(const char *plugin_path, unsigned int index); +H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_control_mask); +H5_DLL herr_t H5PLget_loading_state(unsigned int *plugin_control_mask /*out*/); +H5_DLL herr_t H5PLappend(const char *search_path); +H5_DLL herr_t H5PLprepend(const char *search_path); +H5_DLL herr_t H5PLreplace(const char *search_path, unsigned int index); +H5_DLL herr_t H5PLinsert(const char *search_path, unsigned int index); H5_DLL herr_t H5PLremove(unsigned int index); -H5_DLL ssize_t H5PLget(unsigned int index, char *pathname/*out*/, size_t size); -H5_DLL herr_t H5PLsize(unsigned int *listsize/*out*/); +H5_DLL ssize_t H5PLget(unsigned int index, char *path_buf /*out*/, size_t buf_size); +H5_DLL herr_t H5PLsize(unsigned int *num_paths /*out*/); #ifdef __cplusplus } diff --git a/src/H5system.c b/src/H5system.c index 7e25540..1e718e7 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1237,3 +1237,53 @@ H5_get_time(void) } /* end H5_get_time() */ +#ifdef H5_HAVE_WIN32_API + +#define H5_WIN32_ENV_VAR_BUFFER_SIZE 32767 + + +/*------------------------------------------------------------------------- + * Function: H5_expand_windows_env_vars() + * + * Purpose: Replaces windows environment variables of the form %foo% + * with user-specific values. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5_expand_windows_env_vars(char **env_var) +{ + long n_chars = 0; + char *temp_buf = NULL; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Allocate buffer for expanded environment variable string */ + if (NULL == (temp_buf = (char *)H5MM_calloc((size_t)H5_WIN32_ENV_VAR_BUFFER_SIZE))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") + + /* Expand the environment variable string */ + if ((n_chars = ExpandEnvironmentStringsA(*env_var, temp_buf, H5_WIN32_ENV_VAR_BUFFER_SIZE)) > H5_WIN32_ENV_VAR_BUFFER_SIZE) { + temp_buf = (char *)H5MM_xfree(temp_buf); + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") + } + + if (n_chars == 0) { + temp_buf = (char *)H5MM_xfree(temp_buf); + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") + } + + *env_var = (char *)H5MM_xfree(*env_var); + *env_var = temp_buf; + +done: + if (FAIL == ret_value && temp_buf) + temp_buf = (char *)H5MM_xfree(temp_buf); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5_expand_windows_env_vars() */ +#endif /* H5_HAVE_WIN32_API */ + diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 97f7179..4522228 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -119,6 +119,7 @@ extern "C" { H5_DLL int c99_snprintf(char* str, size_t size, const char* format, ...); H5_DLL int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap); H5_DLL int Wnanosleep(const struct timespec *req, struct timespec *rem); + H5_DLL herr_t H5_expand_windows_env_vars(char **env_var); /* Round functions only needed for VS2012 and earlier. * They are always built to ensure they don't go stale and diff --git a/src/Makefile.am b/src/Makefile.am index 0b664a7..9a64717 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -97,7 +97,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5Pgcpl.c H5Pint.c \ H5Plapl.c H5Plcpl.c H5Pocpl.c H5Pocpypl.c H5Pstrcpl.c H5Ptest.c \ H5PB.c \ - H5PL.c \ + H5PL.c H5PLint.c H5PLpath.c H5PLplugin_cache.c \ H5R.c H5Rdeprec.c \ H5UC.c \ H5RS.c \ diff --git a/test/plugin.c b/test/plugin.c index 1254e9a..f536a9e 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -10,9 +10,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu - * 13 February 2013 - * * Purpose: Tests the plugin module (H5PL) */ @@ -660,13 +657,10 @@ error: /*------------------------------------------------------------------------- * Function: test_groups_with_filters * - * Purpose: Tests opening group with dynamically loaded filters - * - * Return: Success: 0 - * Failure: -1 + * Purpose: Tests opening group with dynamically loaded filters * - * Programmer: Raymond Lu - * 1 April 2013 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -710,261 +704,380 @@ error: /*------------------------------------------------------------------------- - * Function: test_filter_path_apis + * Function: test_path_api_calls * - * Purpose: Tests accessing the path table for dynamically loaded filters + * Purpose: Tests the H5PL API calls that manipulate the plugin search + * paths. * - * Return: Success: 0 - * Failure: -1 + * Return: SUCCEED/FAIL + * *------------------------------------------------------------------------- */ static herr_t -test_filter_path_apis(void) +test_path_api_calls(void) { - herr_t ret_value = -1; - unsigned int i; - unsigned int ndx; + unsigned int n_starting_paths; + unsigned int u; + unsigned int n_paths; herr_t ret; - ssize_t pathlen = -1; - char pathname[256]; - char tempname[256]; + ssize_t path_len = -1; + char path[256]; + char temp_name[256]; + herr_t ret_value = -1; HDputs("Testing access to the filter path table"); - if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) TEST_ERROR + if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) + TEST_ERROR + + /* Set the number of paths to create for this test. + * + * This should be set high enough to ensure that at least one array + * expansion will take place. See H5PLpath.c for details. + */ + n_starting_paths = 42; + - H5PLsize(&ndx); + /****************/ + /* H5PLremove() */ + /****************/ + /* Remove all the current paths */ TESTING(" remove"); - /* Remove all existing paths*/ - for(i=ndx; i > 0; i--) - if(H5PLremove(i-1) < 0) { - HDfprintf(stderr," at %d: %s\n", i, pathname); + + /* Get the current size */ + if(H5PLsize(&n_paths) < 0) + TEST_ERROR + + /* Remove all existing paths */ + for(u = n_paths; u > 0; u--) + if(H5PLremove(u-1) < 0) { + HDfprintf(stderr," at %u: %s\n", u, path); TEST_ERROR - } /* end if */ + } + /* Verify the table is empty */ - H5PLsize(&ndx); - if(ndx > 0) TEST_ERROR + if(H5PLsize(&n_paths) < 0) + TEST_ERROR + if(n_paths > 0) + TEST_ERROR + PASSED(); - TESTING(" remove (exceed min)"); - /* Exceed the min path removal */ + + TESTING(" remove (index 0 in empty table)"); + + /* Try to remove index zero in an empty list (SHOULD FAIL) */ H5E_BEGIN_TRY { ret = H5PLremove(0); } H5E_END_TRY - if(ret >= 0) TEST_ERROR + if(ret >= 0) + TEST_ERROR + PASSED(); + + /****************/ + /* H5PLappend() */ + /****************/ + TESTING(" append"); - /* Create multiple paths to fill table */ - for(i=0; i < H5PL_MAX_PATH_NUM; i++) { - HDsprintf(pathname, "a_path_%d", i); - if(H5PLappend(pathname) < 0) { - HDfprintf(stderr," at %d: %s\n", i, pathname); + + /* Add a bunch of paths to the path table */ + for(u = 0; u < n_starting_paths; u++) { + HDsprintf(path, "a_path_%u", u); + if(H5PLappend(path) < 0) { + HDfprintf(stderr," at %u: %s\n", u, path); TEST_ERROR } } - /* Verify the table is full */ - H5PLsize(&ndx); - if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR - PASSED(); - TESTING(" append (exceed)"); - /* Exceed the max path append */ - H5E_BEGIN_TRY { - HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM); - ret = H5PLappend(pathname); - } H5E_END_TRY - if(ret >= 0) TEST_ERROR PASSED(); - TESTING(" remove (exceed max)"); - /* Exceed the max path removal */ + + /**********************/ + /* H5PLremove() again */ + /**********************/ + + TESTING(" remove (index too high)"); + + /* Try to remove a path where the index is beyond the table capacity (SHOULD FAIL) */ H5E_BEGIN_TRY { - ret = H5PLremove(H5PL_MAX_PATH_NUM); + ret = H5PLremove(n_starting_paths); } H5E_END_TRY - if(ret >= 0) TEST_ERROR + + if(ret >= 0) + TEST_ERROR + PASSED(); + + /*************/ + /* H5PLget() */ + /*************/ + TESTING(" get (path name)"); - if((pathlen = H5PLget(0, NULL, 0)) <= 0) { + + /* Get the path length by passing in NULL */ + if((path_len = H5PLget(0, NULL, 0)) <= 0) { HDfprintf(stderr," get path 0 length failed\n"); TEST_ERROR } - if(pathlen != 8) TEST_ERROR + if(path_len != 8) + TEST_ERROR - if((pathlen = H5PLget(0, pathname, 256)) <= 0) { - HDfprintf(stderr," get 0 len: %d : %s\n", pathlen, pathname); + /* Get the path */ + if((path_len = H5PLget(0, path, 256)) <= 0) { + HDfprintf(stderr," get 0 len: %u : %s\n", path_len, path); TEST_ERROR } - if(HDstrcmp(pathname, "a_path_0") != 0) { - HDfprintf(stderr," get 0: %s\n", pathname); + if(HDstrcmp(path, "a_path_0") != 0) { + HDfprintf(stderr," get 0: %s\n", path); TEST_ERROR } + PASSED(); - TESTING(" get (bounds)"); - if((pathlen = H5PLget(1, pathname, 256)) <= 0) TEST_ERROR - if(HDstrcmp(pathname, "a_path_1") != 0) { - HDfprintf(stderr," get 1: %s\n", pathname); + + TESTING(" get (high and low indices)"); + + /* Get path at index 1 */ + if((path_len = H5PLget(1, path, 256)) <= 0) + TEST_ERROR + if(HDstrcmp(path, "a_path_1") != 0) { + HDfprintf(stderr," get 1: %s\n", path); TEST_ERROR } - if((pathlen = H5PLget(H5PL_MAX_PATH_NUM - 1, pathname, 256)) <= 0) TEST_ERROR - HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM - 1); - if(HDstrcmp(pathname, tempname) != 0) { - HDfprintf(stderr," get %d: %s\n", H5PL_MAX_PATH_NUM - 1, pathname); + + /* Get path at the last index */ + if((path_len = H5PLget(n_starting_paths - 1, path, 256)) <= 0) + TEST_ERROR + HDsprintf(temp_name, "a_path_%u", n_starting_paths - 1); + if(HDstrcmp(path, temp_name) != 0) { + HDfprintf(stderr," get %u: %s\n", n_starting_paths - 1, path); TEST_ERROR } + PASSED(); - TESTING(" get (bounds exceed)"); + + TESTING(" get (index too high)"); + + /* Get path at the last + 1 index (SHOULD FAIL) */ H5E_BEGIN_TRY { - pathlen = H5PLget(H5PL_MAX_PATH_NUM, NULL, 0); + path_len = H5PLget(n_starting_paths, NULL, 0); } H5E_END_TRY - if(pathlen > 0) TEST_ERROR + if(path_len > 0) + TEST_ERROR + PASSED(); - TESTING(" remove (verify for prepend)"); - /* Remove one path*/ - if(H5PLremove(8) < 0) TEST_ERROR + + /*****************/ + /* H5PLprepend() */ + /*****************/ + + /* We'll remove a path at an arbitrary index and then + * prepend a new path. + */ + + TESTING(" remove (arbitrary index 1)"); + + /* Remove one path */ + if(H5PLremove(8) < 0) + TEST_ERROR /* Verify that the entries were moved */ - if((pathlen = H5PLget(8, pathname, 256)) <= 0) TEST_ERROR - if(HDstrcmp(pathname, "a_path_9") != 0) { - HDfprintf(stderr," get 8: %s\n", pathname); + if((path_len = H5PLget(8, path, 256)) <= 0) + TEST_ERROR + if(HDstrcmp(path, "a_path_9") != 0) { + HDfprintf(stderr," get 8: %s\n", path); TEST_ERROR } + + /* Verify the table shrank */ + if(H5PLsize(&n_paths) < 0) + TEST_ERROR + if(n_paths != n_starting_paths - 1) + TEST_ERROR + PASSED(); - /* Verify the table is not full */ - H5PLsize(&ndx); - if (ndx != H5PL_MAX_PATH_NUM - 1) TEST_ERROR TESTING(" prepend"); - /* Prepend one path*/ - HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if(H5PLprepend(pathname) < 0) { - HDfprintf(stderr," prepend %d: %s\n", H5PL_MAX_PATH_NUM + 1, pathname); + + /* Prepend one path */ + HDsprintf(path, "a_path_%d", n_starting_paths + 1); + if(H5PLprepend(path) < 0) { + HDfprintf(stderr," prepend %u: %s\n", n_starting_paths + 1, path); TEST_ERROR } - /* Verify the table is full */ - H5PLsize(&ndx); - if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR + /* Verify the table increased */ + if(H5PLsize(&n_paths) < 0) + TEST_ERROR + if(n_paths != n_starting_paths) + TEST_ERROR /* Verify that the entries were moved */ - if(H5PLget(8, pathname, 256) <= 0) TEST_ERROR - if(HDstrcmp(pathname, "a_path_7") != 0) { - HDfprintf(stderr," get 8: %s\n", pathname); + if(H5PLget(8, path, 256) <= 0) + TEST_ERROR + if(HDstrcmp(path, "a_path_7") != 0) { + HDfprintf(stderr," get 8: %s\n", path); TEST_ERROR } - if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR - HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if(HDstrcmp(pathname, tempname) != 0) { - HDfprintf(stderr," get 0: %s\n", pathname); + + /* Verify that the path was inserted at index zero */ + if(H5PLget(0, path, 256) <= 0) + TEST_ERROR + HDsprintf(temp_name, "a_path_%d", n_starting_paths + 1); + if(HDstrcmp(path, temp_name) != 0) { + HDfprintf(stderr," get 0: %s\n", path); TEST_ERROR } - PASSED(); - TESTING(" prepend (exceed)"); - /* Exceed the max path prepend */ - H5E_BEGIN_TRY { - HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 2); - ret = H5PLprepend(pathname); - } H5E_END_TRY - if(ret >= 0) TEST_ERROR PASSED(); + + /*****************/ + /* H5PLreplace() */ + /*****************/ + TESTING(" replace"); - /* Replace one path*/ - HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 4); - if(H5PLreplace(pathname, 1) < 0) { - HDfprintf(stderr," replace 1: %s\n", pathname); + + /* Replace one path at index 1 */ + HDsprintf(path, "a_path_%u", n_starting_paths + 4); + if(H5PLreplace(path, 1) < 0) { + HDfprintf(stderr," replace 1: %s\n", path); TEST_ERROR } - /* Verify the table is full */ - H5PLsize(&ndx); - if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR + /* Verify the table size remained the same */ + if(H5PLsize(&n_paths) < 0) + TEST_ERROR + if(n_paths != n_starting_paths) + TEST_ERROR + + /* Verify that the entries were not moved by + * inspecting the paths at indices +/- 1. + */ - /* Verify that the entries were not moved */ - if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR - HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if(HDstrcmp(pathname, tempname) != 0) { - HDfprintf(stderr," get 0: %s\n", pathname); + /* Check path at index 0 */ + if(H5PLget(0, path, 256) <= 0) + TEST_ERROR + HDsprintf(temp_name, "a_path_%u", n_starting_paths + 1); + if(HDstrcmp(path, temp_name) != 0) { + HDfprintf(stderr," get 0: %s\n", path); TEST_ERROR } - if(H5PLget(2, pathname, 256) <= 0) TEST_ERROR - if(HDstrcmp(pathname, "a_path_1") != 0) { - HDfprintf(stderr," get 2: %s\n", pathname); + + /* Check path at index 2 */ + if(H5PLget(2, path, 256) <= 0) + TEST_ERROR + if(HDstrcmp(path, "a_path_1") != 0) { + HDfprintf(stderr," get 2: %s\n", path); TEST_ERROR } + PASSED(); - TESTING(" remove (verify for insert)"); - /* Remove one path*/ - if(H5PLremove(4) < 0) TEST_ERROR + + /****************/ + /* H5PLinsert() */ + /****************/ + + /* We'll remove a path at an arbitrary index and then + * insert a new path. + */ + + TESTING(" remove (arbitrary index 2)"); + + /* Remove one path */ + if(H5PLremove(4) < 0) + TEST_ERROR /* Verify that the entries were moved */ - if(H5PLget(4, pathname, 256) <= 0) TEST_ERROR - if(HDstrcmp(pathname, "a_path_4") != 0) { - HDfprintf(stderr," get 4: %s\n", pathname); + if(H5PLget(4, path, 256) <= 0) + TEST_ERROR + if(HDstrcmp(path, "a_path_4") != 0) { + HDfprintf(stderr," get 4: %s\n", path); TEST_ERROR } + + /* Verify the table size */ + if(H5PLsize(&n_paths) < 0) + TEST_ERROR + if(n_paths != n_starting_paths - 1) + TEST_ERROR PASSED(); - /* Verify the table is not full */ - H5PLsize(&ndx); - if(ndx != 15) TEST_ERROR TESTING(" insert"); - /* Insert one path*/ - HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 5); - if(H5PLinsert(pathname, 3) < 0) { - HDfprintf(stderr," insert 3: %s\n", pathname); + + /* Insert one path at index 3*/ + HDsprintf(path, "a_path_%d", n_starting_paths + 5); + if(H5PLinsert(path, 3) < 0) { + HDfprintf(stderr," insert 3: %s\n", path); TEST_ERROR } /* Verify that the entries were moved */ - if(H5PLget(4, pathname, 256) <= 0) TEST_ERROR - if(HDstrcmp(pathname, "a_path_2") != 0) { - HDfprintf(stderr," get 4: %s\n", pathname); + if(H5PLget(4, path, 256) <= 0) + TEST_ERROR + if(HDstrcmp(path, "a_path_2") != 0) { + HDfprintf(stderr," get 4: %s\n", path); TEST_ERROR } + + /* Verify the table size increased */ + if(H5PLsize(&n_paths) < 0) + TEST_ERROR + if(n_paths != n_starting_paths) + TEST_ERROR + PASSED(); - /* Verify the table is full */ - H5PLsize(&ndx); - if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR - TESTING(" insert (exceed)"); - /* Exceed the max path insert */ - H5E_BEGIN_TRY { - HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 6); - ret = H5PLinsert(pathname, 12); - } H5E_END_TRY - if(ret >= 0) TEST_ERROR + /****************/ + /* H5PLremove() */ + /****************/ + + /* Remove all the current paths */ + TESTING(" remove (all)"); + + /* Get the current size */ + if(H5PLsize(&n_paths) < 0) + TEST_ERROR + + /* Remove all existing paths */ + for(u = n_paths; u > 0; u--) + if(H5PLremove(u-1) < 0) { + HDfprintf(stderr," at %u: %s\n", u, path); + TEST_ERROR + } + + /* Verify the table is empty */ + if(H5PLsize(&n_paths) < 0) + TEST_ERROR + if(n_paths > 0) + TEST_ERROR PASSED(); - ret_value = 0; + + return SUCCEED; error: - return ret_value; -} + return FAIL; +} /* end test_path_api_calls() */ /*------------------------------------------------------------------------- * Function: main * - * Purpose: Tests the plugin module (H5PL) - * - * Return: Success: exit(EXIT_SUCCESS) + * Purpose: Tests the plugin module (H5PL) * - * Failure: exit(EXIT_FAILURE) - * - * Programmer: Raymond Lu - * 14 March 2013 + * Return: EXIT_SUCCESS/EXIT_FAILURE * *------------------------------------------------------------------------- */ @@ -1063,18 +1176,19 @@ main(void) if(H5Fclose(file) < 0) TEST_ERROR /* Test the APIs for access to the filter plugin path table */ - nerrors += (test_filter_path_apis() < 0 ? 1 : 0); + nerrors += (test_path_api_calls() < 0 ? 1 : 0); - if(nerrors) TEST_ERROR + if(nerrors) + TEST_ERROR HDprintf("All plugin tests passed.\n"); h5_cleanup(FILENAME, fapl); - return 0; + HDexit(EXIT_SUCCESS); error: nerrors = MAX(1, nerrors); HDprintf("***** %d PLUGIN TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - return 1; -} + HDexit(EXIT_FAILURE); +} /* end main() */ -- cgit v0.12 From 274f71be174c431be6e94b1d4f4c100ff090e749 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 14 Jul 2017 12:58:29 -0700 Subject: Fixed a failing Java plugin test. --- java/test/TestH5PL.java | 88 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 68 insertions(+), 20 deletions(-) diff --git a/java/test/TestH5PL.java b/java/test/TestH5PL.java index aa59478..8ce708b 100644 --- a/java/test/TestH5PL.java +++ b/java/test/TestH5PL.java @@ -70,26 +70,74 @@ public class TestH5PL { @Test public void TestH5PLpaths() { try { - int original_entries = H5.H5PLsize(); - H5.H5PLappend("path_one"); - int plugin_entries = H5.H5PLsize(); - assertTrue("H5.H5PLsize: "+plugin_entries, (original_entries+1) == plugin_entries); - H5.H5PLprepend("path_two"); - plugin_entries = H5.H5PLsize(); - assertTrue("H5.H5PLsize: "+plugin_entries, (original_entries+2) == plugin_entries); - H5.H5PLinsert("path_three", original_entries); - plugin_entries = H5.H5PLsize(); - assertTrue("H5.H5PLsize: "+plugin_entries, (original_entries+3) == plugin_entries); - String first_path = H5.H5PLget(original_entries); - assertTrue("First path was : "+first_path + " ",first_path.compareToIgnoreCase("path_three")==0); - H5.H5PLreplace("path_four", original_entries); - first_path = H5.H5PLget(original_entries); - assertTrue("First path changed to : "+first_path + " ",first_path.compareToIgnoreCase("path_four")==0); - H5.H5PLremove(original_entries); - first_path = H5.H5PLget(original_entries); - assertTrue("First path now : "+first_path + " ",first_path.compareToIgnoreCase("path_two")==0); - plugin_entries = H5.H5PLsize(); - assertTrue("H5.H5PLsize: "+plugin_entries, (original_entries+2) == plugin_entries); + // Get the original number of paths + int nStartPaths = H5.H5PLsize(); + + int nPaths; /* # paths from H5PLSize() */ + int nTruePaths = nStartPaths; /* What the # paths should be */ + int index; /* Path table index */ + String path; /* Path from H5PLget() */ + + // APPEND a path and ensure it was added correctly + String pathAppend = "path_append"; + H5.H5PLappend(pathAppend); + + nPaths = H5.H5PLsize(); + nTruePaths++; + assertTrue("# paths should be " + nTruePaths + " but was " + nPaths, nTruePaths == nPaths); + + index = nTruePaths - 1; + path = H5.H5PLget(index); + assertTrue("Path should be " + pathAppend + " but was " + path, path.compareToIgnoreCase(pathAppend) == 0); + + // PREPEND a path and ensure it was added correctly + String pathPrepend = "path_prepend"; + H5.H5PLprepend(pathPrepend); + + nPaths = H5.H5PLsize(); + nTruePaths++; + assertTrue("# paths should be " + nTruePaths + " but was " + nPaths, nTruePaths == nPaths); + + index = 0; + path = H5.H5PLget(index); + assertTrue("Path should be " + pathPrepend + " but was " + path, path.compareToIgnoreCase(pathPrepend) == 0); + + // INSERT a path and ensure it was added correctly + // Inserting at the index == # of start paths ensures we're in the middle + String pathInsert = "path_insert"; + index = nStartPaths; + H5.H5PLinsert(pathInsert, index); + + nPaths = H5.H5PLsize(); + nTruePaths++; + assertTrue("# paths should be " + nTruePaths + " but was " + nPaths, nTruePaths == nPaths); + + path = H5.H5PLget(index); + assertTrue("Path should be " + pathInsert + " but was " + path, path.compareToIgnoreCase(pathInsert) == 0); + + // REPLACE the path we just added and ensure it updated correctly + String pathReplace = "path_replace"; + index = nStartPaths; + H5.H5PLreplace(pathReplace, index); + + nPaths = H5.H5PLsize(); + assertTrue("# paths should be " + nTruePaths + " but was " + nPaths, nTruePaths == nPaths); + + path = H5.H5PLget(index); + assertTrue("Path should be " + pathReplace + " but was " + path, path.compareToIgnoreCase(pathReplace) == 0); + + // REMOVE the path we just replaced and check that the table was compacted + // The (index+1) path should move down to fill the space when the path is removed. + index = nStartPaths; + String pathRemove = H5.H5PLget(index + 1); + H5.H5PLremove(index); + + nPaths = H5.H5PLsize(); + nTruePaths--; + assertTrue("# paths should be " + nTruePaths + " but was " + nPaths, nTruePaths == nPaths); + + path = H5.H5PLget(index); + assertTrue("Path should be " + pathRemove + " but was " + path, path.compareToIgnoreCase(pathRemove) == 0); } catch (Throwable err) { err.printStackTrace(); -- cgit v0.12 From ee7816bbfb3f22d42d5db7d779efe54ae29528cb Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 17 Jul 2017 13:24:01 -0500 Subject: Stripped C standard library headers (and a couple of macros) from the tools code. This is all handled in H5private.h, which should be included in all tools source files. --- tools/lib/h5diff.c | 2 -- tools/lib/h5tools.c | 6 ------ tools/lib/h5tools_dump.c | 6 ------ tools/lib/h5tools_ref.c | 2 -- tools/lib/h5tools_str.c | 8 -------- tools/lib/h5tools_utils.c | 10 ---------- tools/lib/io_timer.c | 3 --- tools/src/h5copy/h5copy.c | 2 -- tools/src/h5diff/h5diff_common.c | 2 -- tools/src/h5diff/h5diff_main.c | 3 --- tools/src/h5diff/ph5diff_main.c | 3 --- tools/src/h5dump/h5dump.c | 2 -- tools/src/h5dump/h5dump_ddl.c | 2 -- tools/src/h5dump/h5dump_xml.c | 2 -- tools/src/h5repack/h5repack.c | 4 ---- tools/src/h5stat/h5stat.c | 2 -- tools/src/misc/h5mkgrp.c | 2 -- tools/src/misc/h5repart.c | 34 ++-------------------------------- 18 files changed, 2 insertions(+), 93 deletions(-) diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index afb36d9..9da5b6b 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include - #include "H5private.h" #include "h5tools.h" #include "h5tools_utils.h" diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 3729cac..5031e44 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -12,16 +12,10 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Thursday, July 23, 1998 - * * Purpose: A library for displaying the values of a dataset in a human * readable format. */ -#include -#include - #include "h5tools.h" #include "h5tools_dump.h" #include "h5tools_ref.h" diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 1a57512..fb79b77 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -12,16 +12,10 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Thursday, July 23, 1998 - * * Purpose: A library for displaying the values of a dataset in a human * readable format. */ -#include -#include - #include "h5tools.h" #include "h5tools_dump.h" #include "h5tools_ref.h" diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 85850e3..e000080 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5tools_ref.h" #include "H5private.h" #include "H5SLprivate.h" diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index fa15785..a66cfe5 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -12,16 +12,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Bill Wendling - * Monday, 19. February 2001 - * * Purpose: These are string functions for us to use and abuse. */ -#include -#include -#include -#include - #include "H5private.h" #include "h5tools.h" /* for h5tool_format_t structure */ #include "h5tools_ref.h" diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index c361e25..08213df 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -12,20 +12,10 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Bill Wendling - * Tuesday, 6. March 2001 - */ - -/* * Portions of this work are derived from _Obfuscated C and Other Mysteries_, * by Don Libes, copyright (c) 1993 by John Wiley & Sons, Inc. */ -#include -#include -#include -#include - #include "h5tools.h" #include "h5tools_utils.h" #include "H5private.h" diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c index e3318e9..4aa2195 100644 --- a/tools/lib/io_timer.c +++ b/tools/lib/io_timer.c @@ -22,9 +22,6 @@ * This is a module of useful timing functions for performance testing. */ -#include -#include - #include "H5private.h" #include "hdf5.h" diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 390b93e..3f91fce 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -14,8 +14,6 @@ #include "H5private.h" #include "h5tools.h" #include "h5tools_utils.h" -#include -#include /* Name of tool */ #define PROGRAMNAME "h5copy" diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 0537b9f..1069a31 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "H5private.h" #include "h5diff.h" #include "h5diff_common.h" diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index 92a1610..66ff71e 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -11,9 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include #include "H5private.h" #include "h5diff.h" #include "h5diff_common.h" diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index bfeb408..192067f 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -11,9 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include #include "H5private.h" #include "h5diff.h" #include "ph5diff.h" diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index b53c212..bf2e127 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -10,8 +10,6 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5dump.h" #include "h5dump_ddl.h" diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c index 8ce6cd6..0a45840 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -10,8 +10,6 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "H5private.h" #include "h5tools.h" diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 1c3978d..bb0fd7a 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -10,8 +10,6 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "H5private.h" #include "h5tools.h" diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index bc8527b..4860d9e 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include - #include "H5private.h" #include "h5repack.h" #include "h5tools.h" diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index 6aee7a8..6f196b4 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "H5private.h" /* Generic Functions */ #include "h5tools.h" #include "h5tools_utils.h" diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index 597b6b3..43d6bfe 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -15,8 +15,6 @@ #include "H5private.h" #include "h5tools.h" #include "h5tools_utils.h" -#include -#include /* Name of tool */ #define PROGRAMNAME "h5mkgrp" diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index 4432621..cdc554f 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -25,39 +25,9 @@ /* See H5private.h for how to include system headers */ #include "hdf5.h" #include "H5private.h" -#ifdef H5_STDC_HEADERS -# include -# include -# include -# include -# include -# include -#endif - -#ifdef H5_HAVE_UNISTD_H -# include -# include -#endif - -#ifdef H5_HAVE_SYS_STAT_H -# include -#endif - -#ifndef FALSE -# define FALSE 0 -#endif -#ifndef TRUE -# define TRUE 1 -#endif -# define NAMELEN 4096 -#define GB *1024*1024*1024 -#ifndef MIN -# define MIN(X,Y) ((X)<(Y)?(X):(Y)) -#endif -#ifndef MIN3 -# define MIN3(X,Y,Z) MIN(MIN(X,Y),Z) -#endif +#define NAMELEN 4096 +#define GB *1024*1024*1024 /*Make these 2 private properties(defined in H5Fprivate.h) available to h5repart. *The first one updates the member file size in the superblock. The second one -- cgit v0.12 From 66efce85e7ad9430d5e58d529d7b7a55b0d4ac5f Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Fri, 9 Jun 2017 14:01:07 -0500 Subject: Changes made based on RFC review comments Test the changes in a branch via daily testing. --- src/H5Fprivate.h | 4 +++- src/H5MF.c | 2 +- src/H5MFsection.c | 32 ++++++++++++++++---------------- src/H5Pfcpl.c | 3 +++ test/tfile.c | 17 +++++++++++++++++ 5 files changed, 40 insertions(+), 18 deletions(-) diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 6f68a62..eba48de 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -549,9 +549,11 @@ #define H5F_FILE_SPACE_PAGE_SIZE_DEF 4096 /* For paged aggregation: minimum value for file space page size */ #define H5F_FILE_SPACE_PAGE_SIZE_MIN 512 +/* For paged aggregation: maxiumum value for file space page size: 1 gigabyte */ +#define H5F_FILE_SPACE_PAGE_SIZE_MAX 1024*1024*1024 /* For paged aggregation: drop free-space with size <= this threshold for small meta section */ -#define H5F_FILE_SPACE_PGEND_META_THRES 10 +#define H5F_FILE_SPACE_PGEND_META_THRES 0 /* Default for threshold for alignment (can be set via H5Pset_alignment()) */ #define H5F_ALIGN_DEF 1 diff --git a/src/H5MF.c b/src/H5MF.c index e54d809..d7af56a 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -1519,7 +1519,7 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr, H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of fsm */ H5F_mem_page_t fs_type; /* Free space type */ hbool_t reset_ring = FALSE; /* Whether the ring was set */ - htri_t ret_value = FAIL; /* Return value */ + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 02fc2d9..14e0ad1 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -130,27 +130,27 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1] = {{ /* Class info for "small" free space sections */ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{ /* Class variables */ - H5MF_FSPACE_SECT_SMALL, /* Section type */ - 0, /* Extra serialized size */ - H5FS_CLS_MERGE_SYM | H5FS_CLS_ADJUST_OK, /* Class flags */ - NULL, /* Class private info */ + H5MF_FSPACE_SECT_SMALL, /* Section type */ + 0, /* Extra serialized size */ + H5FS_CLS_MERGE_SYM | H5FS_CLS_ADJUST_OK, /* Class flags */ + NULL, /* Class private info */ /* Class methods */ - NULL, /* Initialize section class */ - NULL, /* Terminate section class */ + NULL, /* Initialize section class */ + NULL, /* Terminate section class */ /* Object methods */ - H5MF_sect_small_add, /* Add section */ - NULL, /* Serialize section */ + H5MF_sect_small_add, /* Add section */ + NULL, /* Serialize section */ H5MF_sect_deserialize, /* Deserialize section */ - H5MF_sect_small_can_merge, /* Can sections merge? */ - H5MF_sect_small_merge, /* Merge sections */ - H5MF_sect_small_can_shrink, /* Can section shrink container?*/ - H5MF_sect_small_shrink, /* Shrink container w/section */ - H5MF_sect_free, /* Free section */ - H5MF_sect_valid, /* Check validity of section */ - H5MF_sect_split, /* Split section node for alignment */ - NULL, /* Dump debugging for section */ + H5MF_sect_small_can_merge, /* Can sections merge? */ + H5MF_sect_small_merge, /* Merge sections */ + NULL, /* Can section shrink container?*/ + NULL, /* Shrink container w/section */ + H5MF_sect_free, /* Free section */ + H5MF_sect_valid, /* Check validity of section */ + H5MF_sect_split, /* Split section node for alignment */ + NULL, /* Dump debugging for section */ }}; /* Class info for "large" free space sections */ diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 5383aae..6b0d2c0 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -1472,6 +1472,9 @@ H5Pset_file_space_page_size(hid_t plist_id, hsize_t fsp_size) if(fsp_size < H5F_FILE_SPACE_PAGE_SIZE_MIN) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "cannot set file space page size to less than 512") + if(fsp_size > H5F_FILE_SPACE_PAGE_SIZE_MAX) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "cannot set file space page size to more than 1GB") + /* Set the value*/ if(H5P_set(plist, H5F_CRT_FILE_SPACE_PAGE_SIZE_NAME, &fsp_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set file space page size") diff --git a/test/tfile.c b/test/tfile.c index 533bb24..027ad62 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -109,6 +109,7 @@ #define TEST_THRESHOLD10 10 /* Free space section threshold */ #define FSP_SIZE_DEF 4096 /* File space page size default */ #define FSP_SIZE512 512 /* File space page size */ +#define FSP_SIZE1G 1024*1024*1024 /* File space page size */ /* Declaration for test_libver_macros2() */ #define FILE6 "tfile6.h5" /* Test file */ @@ -3581,6 +3582,9 @@ test_filespace_info(const char *env_h5_drvr) * Setting value less than 512 will return an error; * --setting file space page size to 0 * --setting file space page size to 511 + * + * File space page size has a maximum size of 1 gigabyte. + * Setting value greater than 1 gigabyte will return an error. */ /* Create file creation property list template */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3598,6 +3602,12 @@ test_filespace_info(const char *env_h5_drvr) } H5E_END_TRY; VERIFY(ret, FAIL, "H5Pset_file_space_page_size"); + /* Setting to 1GB+1: should fail */ + H5E_BEGIN_TRY { + ret = H5Pset_file_space_page_size(fcpl, FSP_SIZE1G+1); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Pset_file_space_page_size"); + /* Setting to 512: should succeed */ ret = H5Pset_file_space_page_size(fcpl, FSP_SIZE512); CHECK(ret, FAIL, "H5Pset_file_space_page_size"); @@ -3605,6 +3615,13 @@ test_filespace_info(const char *env_h5_drvr) CHECK(ret, FAIL, "H5Pget_file_space_page_size"); VERIFY(fsp_size, FSP_SIZE512, "H5Pget_file_space_page_size"); + /* Setting to 1GB: should succeed */ + ret = H5Pset_file_space_page_size(fcpl, FSP_SIZE1G); + CHECK(ret, FAIL, "H5Pset_file_space_page_size"); + ret = H5Pget_file_space_page_size(fcpl, &fsp_size); + CHECK(ret, FAIL, "H5Pget_file_space_page_size"); + VERIFY(fsp_size, FSP_SIZE1G, "H5Pget_file_space_page_size"); + /* Close property list */ H5Pclose(fcpl); -- cgit v0.12 From ba17f16e4ca2ab92160a40d54f570042a2c9ea14 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 10 Jul 2017 02:40:59 -0500 Subject: Skip test in test/fheap.c when: a) multi/split drivers and b) persisting free-space or using paged aggregation strategy because the library will fail file creation (temporary) for the above conditions. --- src/H5MFsection.c | 2 +- test/fheap.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 14e0ad1..02e3218 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -674,7 +674,7 @@ HDfprintf(stderr, "%s: Entering, section {%a, %Hu}\n", FUNC, (*sect)->sect_info. HDfprintf(stderr, "%s: section is dropped\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ } /* end if */ - /* Adjust the section if it is not at page end but its size + pgend threshold is at page end */ + /* Adjust the section if it is not at page end but its size + prem is at page end */ else if(prem <= H5F_PGEND_META_THRES(udata->f)) { (*sect)->sect_info.size += prem; diff --git a/test/fheap.c b/test/fheap.c index 4be6cb9..6c3a8ac 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -16377,6 +16377,16 @@ main(void) unsigned nerrors = 0; /* Cumulative error count */ unsigned num_pb_fs = 1; /* The number of settings to test for page buffering and file space handling */ int ExpressMode; /* Express testing level */ + const char *envval; /* Environment variable */ + hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ + + /* Don't run this test using certain file drivers */ + envval = HDgetenv("HDF5_DRIVER"); + if(envval == NULL) + envval = "nomatch"; + + /* Current VFD that does not support contigous address space */ + contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi")); /* Reset library */ h5_reset(); @@ -16428,6 +16438,12 @@ main(void) shared_wobj_g[u] = (unsigned char)u; for(v = 0; v < num_pb_fs; v++) { + /* Skip test when: + a) multi/split drivers and + b) persisting free-space or using paged aggregation strategy + because the library will fail file creation (temporary) for the above conditions */ + if(!contig_addr_vfd && v) + break; if((fcpl = H5Pcopy(def_fcpl)) < 0) TEST_ERROR -- cgit v0.12 From ffc9b1d917c88f8c3e51ee1c2cb6924bb07328a7 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 19 Jul 2017 10:46:27 -0500 Subject: Stripped C standard library headers from tools test code. --- tools/lib/io_timer.c | 4 ---- tools/lib/ph5diff.h | 4 ---- tools/test/h5copy/h5copygentest.c | 1 - tools/test/h5dump/h5dumpgentest.c | 1 - tools/test/h5import/h5importtest.c | 1 - tools/test/h5jam/h5jamgentest.c | 2 -- tools/test/h5jam/tellub.c | 6 ------ tools/test/h5repack/testh5repack_detect_szip.c | 1 - tools/test/misc/talign.c | 3 --- 9 files changed, 23 deletions(-) diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c index 4aa2195..a6885df 100644 --- a/tools/lib/io_timer.c +++ b/tools/lib/io_timer.c @@ -25,10 +25,6 @@ #include "H5private.h" #include "hdf5.h" -#ifdef H5_HAVE_PARALLEL -#include -#endif - #include "io_timer.h" /* diff --git a/tools/lib/ph5diff.h b/tools/lib/ph5diff.h index 9628d45..996a611 100644 --- a/tools/lib/ph5diff.h +++ b/tools/lib/ph5diff.h @@ -42,9 +42,5 @@ struct diffs_found int not_cmp; }; -#ifdef H5_HAVE_PARALLEL -#include -#endif - #endif /* _PH5DIFF_H__ */ diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index d4d6a08..35f9132 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -14,7 +14,6 @@ /* * Generate the binary hdf5 file for the h5copy tests */ -#include #include "hdf5.h" #include "H5private.h" diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 44c4369..2128acb 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -20,7 +20,6 @@ * trying it on a new platform, ...), you need to verify the correctness * of the expected output and update the corresponding *.ddl files. */ -#include #include "hdf5.h" #include "H5private.h" diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c index 00ae2e7..489bc01 100644 --- a/tools/test/h5import/h5importtest.c +++ b/tools/test/h5import/h5importtest.c @@ -11,7 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include #include "H5private.h" #ifdef H5_HAVE_WIN32_API diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c index d713bb9..9f3d000 100644 --- a/tools/test/h5jam/h5jamgentest.c +++ b/tools/test/h5jam/h5jamgentest.c @@ -20,8 +20,6 @@ * trying it on a new platform, ...), you need to verify the correctness * of the expected output and update the corresponding *.ddl files. */ -#include -#include #include "hdf5.h" #include "H5private.h" diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c index fad14b7..8e4b3ac 100644 --- a/tools/test/h5jam/tellub.c +++ b/tools/test/h5jam/tellub.c @@ -11,12 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include - -#ifdef H5_HAVE_UNISTD_H -#include -#endif - #include "hdf5.h" #include "H5private.h" #include "h5tools.h" diff --git a/tools/test/h5repack/testh5repack_detect_szip.c b/tools/test/h5repack/testh5repack_detect_szip.c index e08d5ab..6e7a24e 100644 --- a/tools/test/h5repack/testh5repack_detect_szip.c +++ b/tools/test/h5repack/testh5repack_detect_szip.c @@ -11,7 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include #include "h5repack.h" #include "h5tools.h" #include "h5tools_utils.h" diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c index 9a72557..ce866b4 100644 --- a/tools/test/misc/talign.c +++ b/tools/test/misc/talign.c @@ -15,9 +15,6 @@ * Small program to illustrate the "misalignment" of members within a compound * datatype, in a datatype fixed by H5Tget_native_type(). */ -#include -#include -/*#include *//* Required for unlink() */ #include "hdf5.h" #include "H5private.h" -- cgit v0.12 From ec7450c4b4b44a61b282535b981576d888286fca Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 19 Jul 2017 15:26:34 -0500 Subject: Closed a wayward fapl ID in tools/test/misc/repart_test.c and tidied. --- tools/test/misc/repart_test.c | 95 +++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 53 deletions(-) diff --git a/tools/test/misc/repart_test.c b/tools/test/misc/repart_test.c index 372f46a..4016ee8 100644 --- a/tools/test/misc/repart_test.c +++ b/tools/test/misc/repart_test.c @@ -12,19 +12,16 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu - * June 1, 2005 - * * Purpose: This program tests family files after being repartitioned * by h5repart. It simply tries to reopen the files with * correct family driver and member size. */ #include "hdf5.h" +#include "H5private.h" #define KB 1024 #define FAMILY_H5REPART_SIZE1 20000 #define FAMILY_H5REPART_SIZE2 (5*KB) -#define MAX(a,b) (a>b ? a:b) const char *FILENAME[] = { "fst_family%05d.h5", @@ -42,52 +39,54 @@ herr_t test_sec2_h5repart_opens(void); * * Purpose: Tries to reopen family files. * - * Return: Success: exit(0) - * - * Failure: exit(1) + * Return: SUCCEED/FAIL * - * Programmer: Raymond Lu - * June 1, 2005 - * - * Modifications: *------------------------------------------------------------------------- */ herr_t test_family_h5repart_opens(void) { - hid_t file=(-1), fapl=(-1); + hid_t fid = -1; + hid_t fapl_id = -1; /* open 1st file(single member file) with correct family size(20000 byte) */ - if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) + if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error; - if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_H5REPART_SIZE1, H5P_DEFAULT)<0) + if (H5Pset_fapl_family(fapl_id, (hsize_t)FAMILY_H5REPART_SIZE1, H5P_DEFAULT) < 0) goto error; - if((file=H5Fopen(FILENAME[0], H5F_ACC_RDWR, fapl))<0) + if ((fid = H5Fopen(FILENAME[0], H5F_ACC_RDWR, fapl_id))<0) goto error; - if(H5Fclose(file)<0) + if (H5Fclose(fid) < 0) goto error; /* open 2nd file(multiple member files) with correct family size(5KB) */ - if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_H5REPART_SIZE2, H5P_DEFAULT)<0) + if (H5Pset_fapl_family(fapl_id, (hsize_t)FAMILY_H5REPART_SIZE2, H5P_DEFAULT) < 0) + goto error; + + if ((fid = H5Fopen(FILENAME[1], H5F_ACC_RDWR, fapl_id)) < 0) goto error; - if((file=H5Fopen(FILENAME[1], H5F_ACC_RDWR, fapl))<0) + if (H5Pclose(fapl_id) < 0) goto error; - if(H5Fclose(file)<0) + if (H5Fclose(fid) < 0) goto error; - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Pclose(fapl_id); + H5Fclose(fid); } H5E_END_TRY; - return -1; -} + + return FAIL; + +} /* end test_family_h5repart_opens() */ + /*------------------------------------------------------------------------- @@ -95,36 +94,32 @@ error: * * Purpose: Tries to reopen a sec2 file. * - * Return: Success: exit(0) + * Return: SUCCEED/FAIL * - * Failure: exit(1) - * - * Programmer: Raymond Lu - * June 21, 2005 - * - * Modifications: *------------------------------------------------------------------------- */ herr_t test_sec2_h5repart_opens(void) { - hid_t file=(-1); + hid_t fid = -1; /* open the sec2 file */ - if((file=H5Fopen(FILENAME[2], H5F_ACC_RDWR, H5P_DEFAULT))<0) + if ((fid = H5Fopen(FILENAME[2], H5F_ACC_RDWR, H5P_DEFAULT)) < 0) goto error; - if(H5Fclose(file)<0) + if (H5Fclose(fid) < 0) goto error; - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(fid); } H5E_END_TRY; - return -1; -} + + return FAIL; + +} /* end test_sec2_h5repart_opens() */ /*------------------------------------------------------------------------- @@ -132,32 +127,26 @@ error: * * Purpose: Tests h5repart-ed family files * - * Return: Success: exit(0) - * - * Failure: exit(1) - * - * Programmer: Raymond Lu - * June 1, 2005 - * - * Modifications: + * Return: EXIT_SUCCESS/EXIT_FAILURE * *------------------------------------------------------------------------- */ int main(void) { - int nerrors=0; + int nerrors = 0; - nerrors += test_family_h5repart_opens()<0 ?1:0; - nerrors += test_sec2_h5repart_opens()<0 ?1:0; + nerrors += test_family_h5repart_opens() < 0 ? 1 : 0; + nerrors += test_sec2_h5repart_opens() < 0 ? 1 : 0; - if (nerrors) goto error; + if (nerrors) + goto error; - return 0; + HDexit(EXIT_SUCCESS); error: nerrors = MAX(1, nerrors); - printf("***** %d FAMILY FILE TEST%s FAILED! *****\n", + HDprintf("***** %d FAMILY FILE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - return 1; -} + HDexit(EXIT_FAILURE); +} /* end main() */ -- cgit v0.12 From 3a7c5f19c4254046db758e28c32f1e0f305189ee Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Jul 2017 16:33:48 -0500 Subject: Correct case of var --- config/cmake_ext_mod/HDFLibMacros.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index f2e03d7..54e408b 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -74,14 +74,14 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) HDF_IMPORT_SET_LIB_OPTIONS (jpeg-static "jpeg" STATIC "") add_dependencies (JPEG jpeg-static) set (JPEG_STATIC_LIBRARY "jpeg-static") - set (JPEG_LIBRARIES ${JPEG_static_LIBRARY}) + set (JPEG_LIBRARIES ${JPEG_STATIC_LIBRARY}) if (BUILD_SHARED_LIBS) # Create imported target jpeg-shared add_library(jpeg-shared SHARED IMPORTED) HDF_IMPORT_SET_LIB_OPTIONS (jpeg-shared "jpeg" SHARED "") add_dependencies (JPEG jpeg-shared) set (JPEG_SHARED_LIBRARY "jpeg-shared") - set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_shared_LIBRARY}) + set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_SHARED_LIBRARY}) endif () set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") @@ -167,14 +167,14 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) HDF_IMPORT_SET_LIB_OPTIONS (szip-static "szip" STATIC "") add_dependencies (SZIP szip-static) set (SZIP_STATIC_LIBRARY "szip-static") - set (SZIP_LIBRARIES ${SZIP_static_LIBRARY}) + set (SZIP_LIBRARIES ${SZIP_STATIC_LIBRARY}) if (BUILD_SHARED_LIBS) # Create imported target szip-shared add_library(szip-shared SHARED IMPORTED) HDF_IMPORT_SET_LIB_OPTIONS (szip-shared "szip" SHARED "") add_dependencies (SZIP szip-shared) set (SZIP_SHARED_LIBRARY "szip-shared") - set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_shared_LIBRARY}) + set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_SHARED_LIBRARY}) endif () set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") @@ -262,7 +262,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) HDF_IMPORT_SET_LIB_OPTIONS (zlib-static ${ZLIB_LIB_NAME} STATIC "") add_dependencies (ZLIB zlib-static) set (ZLIB_STATIC_LIBRARY "zlib-static") - set (ZLIB_LIBRARIES ${ZLIB_static_LIBRARY}) + set (ZLIB_LIBRARIES ${ZLIB_STATIC_LIBRARY}) if (BUILD_SHARED_LIBS) # Create imported target zlib-shared add_library(zlib-shared SHARED IMPORTED) -- cgit v0.12 From e790a0b42d0552081b6138552ef3955760894e5b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 25 Jul 2017 15:15:20 -0500 Subject: HDFFV-10246 Add check for string not null before use --- MANIFEST | 1 + tools/lib/h5diff_array.c | 20 ++++++++++++++++---- tools/test/h5diff/CMakeTests.cmake | 8 ++++++++ tools/test/h5diff/testfiles/h5diff_vlstr.txt | 16 ++++++++++++++++ tools/test/h5diff/testh5diff.sh.in | 5 +++++ 5 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 tools/test/h5diff/testfiles/h5diff_vlstr.txt diff --git a/MANIFEST b/MANIFEST index 27f38be..e5a038d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2398,6 +2398,7 @@ ./tools/test/h5diff/testfiles/h5diff_udfail.txt ./tools/test/h5diff/testfiles/diff_strings1.h5 ./tools/test/h5diff/testfiles/diff_strings2.h5 +./tools/test/h5diff/testfiles/h5diff_vlstr.txt #vds ./tools/test/h5diff/testfiles/h5diff_v1.txt ./tools/test/h5diff/testfiles/h5diff_v2.txt diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 0b1a96e..7236ad1 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -673,21 +673,33 @@ static hsize_t diff_datum(void *_mem1, h5difftrace("diff_datum H5T_STRING variable\n"); /* Get pointer to first string */ s1 = *(char**) mem1; - size1 = HDstrlen(s1); + if(s1) + size1 = HDstrlen(s1); + else + size1 = 0; /* Get pointer to second string */ s2 = *(char**) mem2; - size2 = HDstrlen(s2); + if(s2) + size2 = HDstrlen(s2); + else + size2 = 0; } else if (H5T_STR_NULLTERM == pad) { h5difftrace("diff_datum H5T_STRING null term\n"); /* Get pointer to first string */ s1 = (char*) mem1; - size1 = HDstrlen(s1); + if(s1) + size1 = HDstrlen(s1); + else + size1 = 0; if (size1 > size_mtype) size1 = size_mtype; /* Get pointer to second string */ s2 = (char*) mem2; - size2 = HDstrlen(s2); + if(s2) + size2 = HDstrlen(s2); + else + size2 = 0; if (size2 > size_mtype) size2 = size_mtype; } diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 72dda6b..02db446 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -95,6 +95,8 @@ ${HDF5_TOOLS_DIR}/testfiles/vds/5_b.h5 ${HDF5_TOOLS_DIR}/testfiles/vds/5_c.h5 ${HDF5_TOOLS_DIR}/testfiles/vds/5_vds.h5 + # tools/testfiles + ${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5 ) set (LIST_OTHER_TEST_FILES @@ -286,6 +288,7 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v1.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v2.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v3.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_vlstr.txt ) set (LIST_WIN_TEST_FILES @@ -311,6 +314,8 @@ HDFTEST_COPY_FILE("${h5_tstfiles}" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}" "h5diff_files") endif () endforeach () + # copy second version of tvlstr.h5 + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5" "${PROJECT_BINARY_DIR}/testfiles/tvlstr2.h5" "h5diff_files") # @@ -888,6 +893,8 @@ h5diff_v2.out.err h5diff_v3.out h5diff_v3.out.err + h5diff_vlstr.out + h5diff_vlstr.out.err ) set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") @@ -1465,6 +1472,7 @@ ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 # # diff various multiple vlen and fixed strings in a compound type dataset # ############################################################################## ADD_H5_TEST (h5diff_530 0 -v ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group /group_copy) +ADD_H5_TEST (h5diff_vlstr 0 -v tvlstr.h5 tvlstr2.h5) # ############################################################################## # # Test container types (array,vlen) with multiple nested compound types diff --git a/tools/test/h5diff/testfiles/h5diff_vlstr.txt b/tools/test/h5diff/testfiles/h5diff_vlstr.txt new file mode 100644 index 0000000..67141f1 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_vlstr.txt @@ -0,0 +1,16 @@ + +file1 file2 +--------------------------------------- + x x / + x x /Dataset1 + x x /vl_string_type + +group : and +0 differences found +attribute: > and > +0 differences found +dataset: and +0 differences found +datatype: and +0 differences found +EXIT CODE: 0 diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index d769c23..3450d30 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -124,6 +124,7 @@ $SRC_H5DIFF_TESTFILES/tmpSingleSiteBethe.reference.h5 $SRC_H5DIFF_TESTFILES/tmpSingleSiteBethe.output.h5 $SRC_H5DIFF_TESTFILES/diff_strings1.h5 $SRC_H5DIFF_TESTFILES/diff_strings2.h5 +$SRC_TOOLS_TESTFILES/tvlstr.h5 " LIST_HDF5_VDS_TEST_FILES=" @@ -341,6 +342,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_tmp2.txt $SRC_H5DIFF_TESTFILES/h5diff_v1.txt $SRC_H5DIFF_TESTFILES/h5diff_v2.txt $SRC_H5DIFF_TESTFILES/h5diff_v3.txt +$SRC_H5DIFF_TESTFILES/h5diff_vlstr.txt " # @@ -566,6 +568,8 @@ SKIP() { ############################################################################## # prepare for test COPY_TESTFILES_TO_TESTDIR +# second copy of tvlstr.h5 +$CP -f $SRC_TOOLS_TESTFILES/tvlstr.h5 $TESTDIR/tvlstr.h5 # ############################################################################ # # Common usage @@ -1141,6 +1145,7 @@ TOOLTEST h5diff_487.txt -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5 # # diff various multiple vlen and fixed strings in a compound type dataset # ############################################################################## TOOLTEST h5diff_530.txt -v h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group /group_copy +TOOLTEST h5diff_vlstr.txt -v tvlstr.h5 tvlstr2.h5 # ############################################################################## # # Test container types (array,vlen) with multiple nested compound types -- cgit v0.12 From 1018256d55516c376204d8f92fcceb0c5e518aba Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 25 Jul 2017 15:44:25 -0500 Subject: Correct copy to file name --- tools/test/h5diff/testh5diff.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 3450d30..df472d4 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -569,7 +569,7 @@ SKIP() { # prepare for test COPY_TESTFILES_TO_TESTDIR # second copy of tvlstr.h5 -$CP -f $SRC_TOOLS_TESTFILES/tvlstr.h5 $TESTDIR/tvlstr.h5 +$CP -f $SRC_TOOLS_TESTFILES/tvlstr.h5 $TESTDIR/tvlstr2.h5 # ############################################################################ # # Common usage -- cgit v0.12 From 08d63d17f9ba80f205d54bc6526cb709a81ff0cb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 25 Jul 2017 16:58:44 -0500 Subject: Add the release note --- release_docs/RELEASE.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7eb70e1..cd29900 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -147,6 +147,15 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5diff + + h5diff segfaulted on compare of a NULL variable length string. + + Improved h5diff compare of strings by adding a check for + NULL strings and setting the lengths to zero. + + (ADB - 2017/07/25, HDFFV-10246) + - h5import h5import crashed trying to import data from a subset of a dataset. -- cgit v0.12 From 373a37da01564a4cb33662ff52d176bf9d5a3b75 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 26 Jul 2017 09:30:27 -0500 Subject: Make sure zip_perf program does not run concurrently --- tools/test/perform/CMakeTests.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake index 2933563..39faa73 100644 --- a/tools/test/perform/CMakeTests.cmake +++ b/tools/test/perform/CMakeTests.cmake @@ -146,6 +146,7 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () +set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS PERFORM_zip_perf_help) if (H5_HAVE_PARALLEL) add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) -- cgit v0.12 From cd0d804611f63a1412a8c8d2a3cc0e7fd047a146 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 26 Jul 2017 09:51:57 -0500 Subject: Verify default paths exist in table --- test/plugin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/plugin.c b/test/plugin.c index 1254e9a..573b72c 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -734,6 +734,8 @@ test_filter_path_apis(void) if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) TEST_ERROR H5PLsize(&ndx); + if(ndx!=2) TEST_ERROR + PASSED(); TESTING(" remove"); /* Remove all existing paths*/ -- cgit v0.12 From 55d82c8f747b3a817a4a0b6b12e506b9c2dc0878 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 26 Jul 2017 10:45:08 -0500 Subject: Add test header for log --- test/plugin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/plugin.c b/test/plugin.c index 573b72c..3034c0b 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -733,6 +733,7 @@ test_filter_path_apis(void) if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) TEST_ERROR + TESTING(" initialize"); H5PLsize(&ndx); if(ndx!=2) TEST_ERROR PASSED(); -- cgit v0.12 From b7f19967d76f50890ff6ef1a7a756dc37c555538 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 27 Jul 2017 08:52:21 -0500 Subject: Removed FCFLAGS when building the examples since they should already be included the h5fc wrapper. NAG complains about doubly declared options. --- fortran/examples/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am index db85c09..6bf2edb 100644 --- a/fortran/examples/Makefile.am +++ b/fortran/examples/Makefile.am @@ -66,10 +66,10 @@ h5_crtatt.chkexe_: h5_rdwt.chkexe_ # Additional dependencies for the examples are listed below if BUILD_PARALLEL_CONDITIONAL $(EXTRA_PROG): $(H5FC_PP) - $(H5FC_PP) $(H5CCFLAGS) $(FCFLAGS) -o $@ $(srcdir)/$@.f90; + $(H5FC_PP) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; else $(EXTRA_PROG): $(H5FC) - $(H5FC) $(H5CCFLAGS) $(FCFLAGS) -o $@ $(srcdir)/$@.f90; + $(H5FC) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; endif # Tell automake how to install examples -- cgit v0.12 From 04d6a3ec3c91cb30dce5dd5abb1b67021527c2fb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 27 Jul 2017 11:18:52 -0500 Subject: if PARALLEL copy seconf file to PAR folder --- tools/test/h5diff/CMakeTests.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 02db446..608795c 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -316,6 +316,9 @@ endforeach () # copy second version of tvlstr.h5 HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5" "${PROJECT_BINARY_DIR}/testfiles/tvlstr2.h5" "h5diff_files") + if (H5_HAVE_PARALLEL) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5" "${PROJECT_BINARY_DIR}/PAR/testfiles/tvlstr2.h5" "h5diff_files") + endif () # -- cgit v0.12 From be5257f8766e5be1ceacee3260b4b52b499983f6 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 27 Jul 2017 11:32:21 -0500 Subject: libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler on Linux (other OSs have not been tested). Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) --- configure.ac | 44 ++++++++++++++++++++++++++++++++------------ fortran/src/h5fc.in | 2 +- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index 163f6d3..fe999ce 100644 --- a/configure.ac +++ b/configure.ac @@ -3338,6 +3338,38 @@ else STATIC_SHARED="none" fi +if test "X$HDF_FORTRAN" = "Xyes"; then + chmod 755 fortran/src/h5fc + ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler + ## on OS X, which is needed when building shared libraries on OS X. This script + ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772) + case "`uname`" in + Darwin*) + cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + ;; + esac + + ### libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler + ### on Linux (other OSs have not been tested). + ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to + ### wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) + case "`uname`" in + Linux*) + + fortran_linux_linker_option="-Wl," + + if (grep -i 'NAG_Fortran' libtool > /dev/null); then + cat libtool | awk '/NAG_Fortran/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + fortran_linux_linker_option="-Wl,-Wl,," + fi + + ## Set the correct linker option for use in h5fc.in markup + AC_SUBST([fortran_linux_linker_option]) + ;; + esac + +fi + ## ---------------------------------------------------------------------- ## Set a macro if shared library is enabled. ## @@ -3474,18 +3506,6 @@ AC_OUTPUT chmod 755 tools/src/misc/h5cc -if test "X$HDF_FORTRAN" = "Xyes"; then - chmod 755 fortran/src/h5fc - ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler - ## on OS X, which is needed when building shared libraries on OS X. This script - ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772) - case "`uname`" in - Darwin*) - cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool - ;; - esac -fi - if test "X$HDF_CXX" = "Xyes"; then chmod 755 c++/src/h5c++ fi diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index 47642c9..29ef83f 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -307,7 +307,7 @@ if test "x$do_link" = "xyes"; then link_args="$link_args -L${libdir}" case "$host_os" in - linux*) flag="-Wl,-rpath -Wl," ;; + linux*) flag="@fortran_linux_linker_option@-rpath -Wl," ;; hpux*) flag="-Wl,+b -Wl," ;; freebsd*|solaris*) flag="-R" ;; rs6000*|aix*) flag="-L" ;; -- cgit v0.12 From d138f164dddb2fd69b7325a861037f4b54406a71 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 27 Jul 2017 12:57:48 -0500 Subject: removed chmod 755 for h5fc --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index fe999ce..1ca7a34 100644 --- a/configure.ac +++ b/configure.ac @@ -3339,7 +3339,6 @@ else fi if test "X$HDF_FORTRAN" = "Xyes"; then - chmod 755 fortran/src/h5fc ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler ## on OS X, which is needed when building shared libraries on OS X. This script ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772) -- cgit v0.12 From 92491aa4b6dc2d4fa3c394e0aa928300379e1ced Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 27 Jul 2017 13:09:36 -0500 Subject: added chmod 755 for h5fc --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1ca7a34..45bd4d1 100644 --- a/configure.ac +++ b/configure.ac @@ -3504,7 +3504,9 @@ AC_CONFIG_COMMANDS([.classes], [], [$MKDIR_P java/src/.classes; AC_OUTPUT chmod 755 tools/src/misc/h5cc - +if test "X$HDF_FORTRAN" = "Xyes"; then + chmod 755 fortran/src/h5fc +fi if test "X$HDF_CXX" = "Xyes"; then chmod 755 c++/src/h5c++ fi -- cgit v0.12 From c08ee778588c9e0752e242c201000f1f11a0b742 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 28 Jul 2017 09:05:39 -0500 Subject: Rearranged where the substitution occurs. libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler on Linux (other OSs have not been tested). Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) --- configure.ac | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 45bd4d1..47f5897 100644 --- a/configure.ac +++ b/configure.ac @@ -3339,14 +3339,6 @@ else fi if test "X$HDF_FORTRAN" = "Xyes"; then - ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler - ## on OS X, which is needed when building shared libraries on OS X. This script - ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772) - case "`uname`" in - Darwin*) - cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool - ;; - esac ### libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler ### on Linux (other OSs have not been tested). @@ -3358,7 +3350,6 @@ if test "X$HDF_FORTRAN" = "Xyes"; then fortran_linux_linker_option="-Wl," if (grep -i 'NAG_Fortran' libtool > /dev/null); then - cat libtool | awk '/NAG_Fortran/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool fortran_linux_linker_option="-Wl,-Wl,," fi @@ -3504,13 +3495,35 @@ AC_CONFIG_COMMANDS([.classes], [], [$MKDIR_P java/src/.classes; AC_OUTPUT chmod 755 tools/src/misc/h5cc -if test "X$HDF_FORTRAN" = "Xyes"; then - chmod 755 fortran/src/h5fc -fi if test "X$HDF_CXX" = "Xyes"; then chmod 755 c++/src/h5c++ fi + +if test "X$HDF_FORTRAN" = "Xyes"; then + chmod 755 fortran/src/h5fc + ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler + ## on OS X, which is needed when building shared libraries on OS X. This script + ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772) + case "`uname`" in + Darwin*) + cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + ;; + esac + + ### libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler + ### on Linux (other OSs have not been tested). + ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to + ### wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) + case "`uname`" in + Linux*) + if (grep -i 'NAG_Fortran' libtool > /dev/null); then + cat libtool | awk '/NAG_Fortran/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + fi + ;; + esac +fi + ## HDF5 configure code created by autotools with gcc 4.9.2 is adding problematic ## linker flags: -l with no library name; -l , specifically gfortran or m. ## This sed script corrects "-l " first and then "-l " with no library name. -- cgit v0.12 From 59e94f5009a1f738d9924be942448f8cf6355b00 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Sat, 29 Jul 2017 01:10:25 -0500 Subject: Add h5repack tests for paged aggregation Add tests to h5repack.sh.in to verify options added for paged aggregation work as expected. --- MANIFEST | 12 +++ tools/test/h5repack/h5repack.sh.in | 103 +++++++++++++++++++++ .../testfiles/GS.h5repack_paged_nopersist.h5.ddl | 15 +++ .../testfiles/S.h5repack_fsm_aggr_persist.h5.ddl | 15 +++ .../SP.h5repack_fsm_aggr_nopersist.h5.ddl | 16 ++++ .../testfiles/SP.h5repack_paged_persist.h5.ddl | 15 +++ .../h5repack/testfiles/SPT.h5repack_aggr.h5.ddl | 16 ++++ .../h5repack/testfiles/STG.h5repack_none.h5.ddl | 15 +++ tools/test/h5repack/testfiles/h5repack_aggr.h5 | Bin 0 -> 2448 bytes .../testfiles/h5repack_fsm_aggr_nopersist.h5 | Bin 0 -> 2448 bytes .../testfiles/h5repack_fsm_aggr_persist.h5 | Bin 0 -> 2565 bytes tools/test/h5repack/testfiles/h5repack_none.h5 | Bin 0 -> 1808 bytes .../h5repack/testfiles/h5repack_paged_nopersist.h5 | Bin 0 -> 8192 bytes .../h5repack/testfiles/h5repack_paged_persist.h5 | Bin 0 -> 16384 bytes 14 files changed, 207 insertions(+) create mode 100644 tools/test/h5repack/testfiles/GS.h5repack_paged_nopersist.h5.ddl create mode 100644 tools/test/h5repack/testfiles/S.h5repack_fsm_aggr_persist.h5.ddl create mode 100644 tools/test/h5repack/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl create mode 100644 tools/test/h5repack/testfiles/SP.h5repack_paged_persist.h5.ddl create mode 100644 tools/test/h5repack/testfiles/SPT.h5repack_aggr.h5.ddl create mode 100644 tools/test/h5repack/testfiles/STG.h5repack_none.h5.ddl create mode 100644 tools/test/h5repack/testfiles/h5repack_aggr.h5 create mode 100644 tools/test/h5repack/testfiles/h5repack_fsm_aggr_nopersist.h5 create mode 100644 tools/test/h5repack/testfiles/h5repack_fsm_aggr_persist.h5 create mode 100644 tools/test/h5repack/testfiles/h5repack_none.h5 create mode 100644 tools/test/h5repack/testfiles/h5repack_paged_nopersist.h5 create mode 100644 tools/test/h5repack/testfiles/h5repack_paged_persist.h5 diff --git a/MANIFEST b/MANIFEST index 27f38be..af4dc7e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2405,6 +2405,7 @@ #test files for h5repack ./tools/test/h5repack/testfiles/README +./tools/test/h5repack/testfiles/h5repack_aggr.h5 ./tools/test/h5repack/testfiles/h5repack_attr.h5 ./tools/test/h5repack/testfiles/h5repack_attr_refs.h5 ./tools/test/h5repack/testfiles/h5repack_deflate.h5 @@ -2414,6 +2415,8 @@ ./tools/test/h5repack/testfiles/h5repack_fill.h5 ./tools/test/h5repack/testfiles/h5repack_filters.h5 ./tools/test/h5repack/testfiles/h5repack_fletcher.h5 +./tools/test/h5repack/testfiles/h5repack_fsm_aggr_nopersist.h5 +./tools/test/h5repack/testfiles/h5repack_fsm_aggr_persist.h5 ./tools/test/h5repack/testfiles/h5repack_hlink.h5 ./tools/test/h5repack/testfiles/h5repack.info ./tools/test/h5repack/testfiles/h5repack_layout.h5 @@ -2425,7 +2428,10 @@ ./tools/test/h5repack/testfiles/h5repack_nested_8bit_enum_deflated.h5 ./tools/test/h5repack/testfiles/h5repack_nested_8bit_enum.h5 ./tools/test/h5repack/testfiles/h5repack_nbit.h5 +./tools/test/h5repack/testfiles/h5repack_none.h5 ./tools/test/h5repack/testfiles/h5repack_objs.h5 +./tools/test/h5repack/testfiles/h5repack_paged_nopersist.h5 +./tools/test/h5repack/testfiles/h5repack_paged_persist.h5 ./tools/test/h5repack/testfiles/h5repack_refs.h5 ./tools/test/h5repack/testfiles/h5repack_shuffle.h5 ./tools/test/h5repack/testfiles/h5repack_soffset.h5 @@ -2444,6 +2450,12 @@ ./tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl ./tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl ./tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst +./tools/test/h5repack/testfiles/GS.h5repack_paged_nopersist.h5.ddl +./tools/test/h5repack/testfiles/S.h5repack_fsm_aggr_persist.h5.ddl +./tools/test/h5repack/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl +./tools/test/h5repack/testfiles/SP.h5repack_paged_persist.h5.ddl +./tools/test/h5repack/testfiles/SPT.h5repack_aggr.h5.ddl +./tools/test/h5repack/testfiles/STG.h5repack_none.h5.ddl ./tools/test/h5repack/testfiles/1_vds.h5-vds_dset_chunk20x10x5-v.ddl ./tools/test/h5repack/testfiles/2_vds.h5-vds_chunk3x6x9-v.ddl ./tools/test/h5repack/testfiles/3_1_vds.h5-vds_chunk2x5x8-v.ddl diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index bc6b527..e474bc3 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -36,6 +36,9 @@ H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary H5DUMP=../../src/h5dump/h5dump # The h5dump tool name H5DUMP_BIN=`pwd`/$H5DUMP # The path of the h5dump tool binary +H5STAT=../../src/h5stat/h5stat # The h5stat tool name +H5STAT_BIN=`pwd`/$H5STAT # The path of the h5stat tool binary + RM='rm -rf' CMP='cmp' DIFF='diff -c' @@ -101,6 +104,12 @@ $SRC_H5REPACK_TESTFILES/h5repack_refs.h5 $SRC_H5REPACK_TESTFILES/h5repack_shuffle.h5 $SRC_H5REPACK_TESTFILES/h5repack_soffset.h5 $SRC_H5REPACK_TESTFILES/h5repack_szip.h5 +$SRC_H5REPACK_TESTFILES/h5repack_aggr.h5 +$SRC_H5REPACK_TESTFILES/h5repack_fsm_aggr_nopersist.h5 +$SRC_H5REPACK_TESTFILES/h5repack_fsm_aggr_persist.h5 +$SRC_H5REPACK_TESTFILES/h5repack_none.h5 +$SRC_H5REPACK_TESTFILES/h5repack_paged_nopersist.h5 +$SRC_H5REPACK_TESTFILES/h5repack_paged_persist.h5 $SRC_H5DIFF_TESTFILES/h5diff_attr1.h5 $SRC_TOOLS_TESTFILES/tfamily00000.h5 $SRC_TOOLS_TESTFILES/tfamily00001.h5 @@ -156,6 +165,12 @@ $SRC_H5REPACK_TESTFILES/2_vds.h5-vds_chunk3x6x9-v.ddl $SRC_H5REPACK_TESTFILES/3_1_vds.h5-vds_chunk2x5x8-v.ddl $SRC_H5REPACK_TESTFILES/4_vds.h5-vds_compa-v.ddl $SRC_H5REPACK_TESTFILES/4_vds.h5-vds_conti-v.ddl +$SRC_H5REPACK_TESTFILES/SP.h5repack_fsm_aggr_nopersist.h5.ddl +$SRC_H5REPACK_TESTFILES/S.h5repack_fsm_aggr_persist.h5.ddl +$SRC_H5REPACK_TESTFILES/STG.h5repack_none.h5.ddl +$SRC_H5REPACK_TESTFILES/GS.h5repack_paged_nopersist.h5.ddl +$SRC_H5REPACK_TESTFILES/SP.h5repack_paged_persist.h5.ddl +$SRC_H5REPACK_TESTFILES/SPT.h5repack_aggr.h5.ddl " # @@ -707,6 +722,58 @@ TOOLTEST_DUMP() rm -f $outfile } +# This is similar to TOOLTEST_DUMP(). +# Test h5repack with options added for paged aggregation. +# h5stat is used on the repacked file and the expected output +# is compared for correctness. +# +TOOLTEST_STAT() +{ + infile=$2 + outfile=out-$1.$2 + expect="$TESTDIR/$1.$2.ddl" + actual="$TESTDIR/out-$1.$2.out" + actual_err="$TESTDIR/out-$1.$2.err" + + shift + shift + + # Run test. + TESTING $H5REPACK $@ + ( + cd $TESTDIR + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) >$actual 2>$actual_err + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + VERIFY h5stat output $@ + ( + cd $TESTDIR + $RUNSERIAL $H5STAT_BIN -S -s $outfile + ) >$actual 2>$actual_err + cat $actual_err >> $actual + + RET=$? + + fi + + if cmp -s $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && diff -c $expect $actual |sed 's/^/ /' + fi + + rm -f $actual $actual_err + rm -f $outfile +} + # TOOLTEST_META: # Test metadata block size option. # Reason to create a function here is to localize all special steps related to @@ -1057,6 +1124,42 @@ fi arg="tordergr.h5 -L" TOOLTEST_DUMP crtorder $arg +################################################################################################### +# Testing paged aggregation related options: +# -G pagesize +# -P 1 or 0 +# -S strategy +# -T threshold +# +# The testfiles used are generated by test/gen_filespace.c and the file names are prepended with "h5repack_": +# (1) "fsm_aggr_nopersist.h5" /* H5F_FSPACE_STRATEGY_FSM_AGGR + not persisting free-space */ +# (2) "fsm_aggr_persist.h5" /* H5F_FSPACE_STRATEGY_FSM_AGGR + persisting free-space */ +# (3) "paged_nopersist.h5" /* H5F_FSPACE_STRATEGY_PAGE + not persisting free-space */ +# (4) "paged_persist.h5" /* H5F_FSPACE_STRATEGY_PAGE + persisting free-space */ +# (5) "aggr.h5" /* H5F_FSPACE_STRATEGY_AGGR */ +# (6) "none.h5" /* H5F_FSPACE_STRATEGY_NONE */ +# +##################################################################################################### +# +arg="h5repack_fsm_aggr_nopersist.h5 -S PAGE -P 1" +TOOLTEST_STAT SP $arg +# +arg="h5repack_fsm_aggr_persist.h5 -S AGGR" +TOOLTEST_STAT S $arg +# +arg="h5repack_none.h5 -S PAGE -T 10 -G 2048" +TOOLTEST_STAT STG $arg +# +arg="h5repack_paged_nopersist.h5 -G 512 -S AGGR" +TOOLTEST_STAT GS $arg +# +arg="h5repack_paged_persist.h5 -S NONE -P 1" +TOOLTEST_STAT SP $arg +# +arg="h5repack_aggr.h5 -S FSM_AGGR -P 1 -T 5" +TOOLTEST_STAT SPT $arg + + ######################################################### # layout options (these files have no filters) ######################################################### diff --git a/tools/test/h5repack/testfiles/GS.h5repack_paged_nopersist.h5.ddl b/tools/test/h5repack/testfiles/GS.h5repack_paged_nopersist.h5.ddl new file mode 100644 index 0000000..d8ca992 --- /dev/null +++ b/tools/test/h5repack/testfiles/GS.h5repack_paged_nopersist.h5.ddl @@ -0,0 +1,15 @@ +Filename: out-GS.h5repack_paged_nopersist.h5 +Free-space persist: FALSE +Free-space section threshold: 1 bytes +Small size free-space sections (< 10 bytes): + Total # of small size sections: 0 +Free-space section bins: + Total # of sections: 0 +File space management strategy: H5F_FSPACE_STRATEGY_AGGR +File space page size: 512 bytes +Summary of file space information: + File metadata: 1272 bytes + Raw data: 400 bytes + Amount/Percent of tracked free space: 0 bytes/0.0% + Unaccounted space: 776 bytes +Total space: 2448 bytes diff --git a/tools/test/h5repack/testfiles/S.h5repack_fsm_aggr_persist.h5.ddl b/tools/test/h5repack/testfiles/S.h5repack_fsm_aggr_persist.h5.ddl new file mode 100644 index 0000000..87ccbc4 --- /dev/null +++ b/tools/test/h5repack/testfiles/S.h5repack_fsm_aggr_persist.h5.ddl @@ -0,0 +1,15 @@ +Filename: out-S.h5repack_fsm_aggr_persist.h5 +Free-space persist: FALSE +Free-space section threshold: 1 bytes +Small size free-space sections (< 10 bytes): + Total # of small size sections: 0 +Free-space section bins: + Total # of sections: 0 +File space management strategy: H5F_FSPACE_STRATEGY_AGGR +File space page size: 4096 bytes +Summary of file space information: + File metadata: 1272 bytes + Raw data: 400 bytes + Amount/Percent of tracked free space: 0 bytes/0.0% + Unaccounted space: 776 bytes +Total space: 2448 bytes diff --git a/tools/test/h5repack/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl b/tools/test/h5repack/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl new file mode 100644 index 0000000..affa93b --- /dev/null +++ b/tools/test/h5repack/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl @@ -0,0 +1,16 @@ +Filename: out-SP.h5repack_fsm_aggr_nopersist.h5 +Free-space persist: TRUE +Free-space section threshold: 1 bytes +Small size free-space sections (< 10 bytes): + Total # of small size sections: 0 +Free-space section bins: + # of sections of size 1000 - 9999: 2 + Total # of sections: 2 +File space management strategy: H5F_FSPACE_STRATEGY_PAGE +File space page size: 4096 bytes +Summary of file space information: + File metadata: 1602 bytes + Raw data: 400 bytes + Amount/Percent of tracked free space: 6307 bytes/38.5% + Unaccounted space: 8075 bytes +Total space: 16384 bytes diff --git a/tools/test/h5repack/testfiles/SP.h5repack_paged_persist.h5.ddl b/tools/test/h5repack/testfiles/SP.h5repack_paged_persist.h5.ddl new file mode 100644 index 0000000..1084090 --- /dev/null +++ b/tools/test/h5repack/testfiles/SP.h5repack_paged_persist.h5.ddl @@ -0,0 +1,15 @@ +Filename: out-SP.h5repack_paged_persist.h5 +Free-space persist: FALSE +Free-space section threshold: 1 bytes +Small size free-space sections (< 10 bytes): + Total # of small size sections: 0 +Free-space section bins: + Total # of sections: 0 +File space management strategy: H5F_FSPACE_STRATEGY_NONE +File space page size: 4096 bytes +Summary of file space information: + File metadata: 1272 bytes + Raw data: 400 bytes + Amount/Percent of tracked free space: 0 bytes/0.0% + Unaccounted space: 0 bytes +Total space: 1672 bytes diff --git a/tools/test/h5repack/testfiles/SPT.h5repack_aggr.h5.ddl b/tools/test/h5repack/testfiles/SPT.h5repack_aggr.h5.ddl new file mode 100644 index 0000000..1ce06b2 --- /dev/null +++ b/tools/test/h5repack/testfiles/SPT.h5repack_aggr.h5.ddl @@ -0,0 +1,16 @@ +Filename: out-SPT.h5repack_aggr.h5 +Free-space persist: TRUE +Free-space section threshold: 5 bytes +Small size free-space sections (< 10 bytes): + Total # of small size sections: 0 +Free-space section bins: + # of sections of size 100 - 999: 1 + Total # of sections: 1 +File space management strategy: H5F_FSPACE_STRATEGY_FSM_AGGR +File space page size: 4096 bytes +Summary of file space information: + File metadata: 1485 bytes + Raw data: 400 bytes + Amount/Percent of tracked free space: 680 bytes/26.5% + Unaccounted space: 0 bytes +Total space: 2565 bytes diff --git a/tools/test/h5repack/testfiles/STG.h5repack_none.h5.ddl b/tools/test/h5repack/testfiles/STG.h5repack_none.h5.ddl new file mode 100644 index 0000000..51cd7e5 --- /dev/null +++ b/tools/test/h5repack/testfiles/STG.h5repack_none.h5.ddl @@ -0,0 +1,15 @@ +Filename: out-STG.h5repack_none.h5 +Free-space persist: FALSE +Free-space section threshold: 10 bytes +Small size free-space sections (< 10 bytes): + Total # of small size sections: 0 +Free-space section bins: + Total # of sections: 0 +File space management strategy: H5F_FSPACE_STRATEGY_PAGE +File space page size: 2048 bytes +Summary of file space information: + File metadata: 1272 bytes + Raw data: 400 bytes + Amount/Percent of tracked free space: 0 bytes/0.0% + Unaccounted space: 2424 bytes +Total space: 4096 bytes diff --git a/tools/test/h5repack/testfiles/h5repack_aggr.h5 b/tools/test/h5repack/testfiles/h5repack_aggr.h5 new file mode 100644 index 0000000..8da0751 Binary files /dev/null and b/tools/test/h5repack/testfiles/h5repack_aggr.h5 differ diff --git a/tools/test/h5repack/testfiles/h5repack_fsm_aggr_nopersist.h5 b/tools/test/h5repack/testfiles/h5repack_fsm_aggr_nopersist.h5 new file mode 100644 index 0000000..1cd5f3f Binary files /dev/null and b/tools/test/h5repack/testfiles/h5repack_fsm_aggr_nopersist.h5 differ diff --git a/tools/test/h5repack/testfiles/h5repack_fsm_aggr_persist.h5 b/tools/test/h5repack/testfiles/h5repack_fsm_aggr_persist.h5 new file mode 100644 index 0000000..469dbce Binary files /dev/null and b/tools/test/h5repack/testfiles/h5repack_fsm_aggr_persist.h5 differ diff --git a/tools/test/h5repack/testfiles/h5repack_none.h5 b/tools/test/h5repack/testfiles/h5repack_none.h5 new file mode 100644 index 0000000..2e4d789 Binary files /dev/null and b/tools/test/h5repack/testfiles/h5repack_none.h5 differ diff --git a/tools/test/h5repack/testfiles/h5repack_paged_nopersist.h5 b/tools/test/h5repack/testfiles/h5repack_paged_nopersist.h5 new file mode 100644 index 0000000..352e586 Binary files /dev/null and b/tools/test/h5repack/testfiles/h5repack_paged_nopersist.h5 differ diff --git a/tools/test/h5repack/testfiles/h5repack_paged_persist.h5 b/tools/test/h5repack/testfiles/h5repack_paged_persist.h5 new file mode 100644 index 0000000..64c3b23 Binary files /dev/null and b/tools/test/h5repack/testfiles/h5repack_paged_persist.h5 differ -- cgit v0.12 From 9bcf8b2f2568083449ae3f9b6c2efbf6ed7f413a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 1 Aug 2017 04:59:36 -0700 Subject: Minor tweaks in response to code review. --- src/H5system.c | 8 ++------ test/plugin.c | 56 +++++++++++++++++++++++++++++++++++--------------------- 2 files changed, 37 insertions(+), 27 deletions(-) diff --git a/src/H5system.c b/src/H5system.c index 1e718e7..a1cdf19 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1266,15 +1266,11 @@ H5_expand_windows_env_vars(char **env_var) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") /* Expand the environment variable string */ - if ((n_chars = ExpandEnvironmentStringsA(*env_var, temp_buf, H5_WIN32_ENV_VAR_BUFFER_SIZE)) > H5_WIN32_ENV_VAR_BUFFER_SIZE) { - temp_buf = (char *)H5MM_xfree(temp_buf); + if ((n_chars = ExpandEnvironmentStringsA(*env_var, temp_buf, H5_WIN32_ENV_VAR_BUFFER_SIZE)) > H5_WIN32_ENV_VAR_BUFFER_SIZE) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") - } - if (n_chars == 0) { - temp_buf = (char *)H5MM_xfree(temp_buf); + if (0 == n_chars) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") - } *env_var = (char *)H5MM_xfree(*env_var); *env_var = temp_buf; diff --git a/test/plugin.c b/test/plugin.c index bcd7348..ea199f6 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -723,7 +723,6 @@ test_path_api_calls(void) ssize_t path_len = -1; char path[256]; char temp_name[256]; - herr_t ret_value = -1; HDputs("Testing access to the filter path table"); @@ -1106,37 +1105,44 @@ main(void) /* Testing setup */ h5_reset(); - fapl = h5_fileaccess(); + + if ((fapl = h5_fileaccess()) < 0) + TEST_ERROR /* Turn off the chunk cache, so all the chunks are immediately written to disk */ - if(H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) TEST_ERROR + if (H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) + TEST_ERROR rdcc_nbytes = 0; - if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) TEST_ERROR + if (H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) + TEST_ERROR /* Copy the file access property list */ - if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR + if ((fapl2 = H5Pcopy(fapl)) < 0) + TEST_ERROR /* Set the "use the latest version of the format" bounds for creating objects in the file */ - if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR + if (H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + TEST_ERROR - h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); /* Test with old & new format groups */ - for(new_format = FALSE; new_format <= TRUE; new_format++) { + for (new_format = FALSE; new_format <= TRUE; new_format++) { hid_t my_fapl; /* Set the FAPL for the type of format */ - if(new_format) { + if (new_format) { HDputs("\nTesting with new file format:"); my_fapl = fapl2; - } /* end if */ + } else { HDputs("Testing with old file format:"); my_fapl = fapl; - } /* end else */ + } /* Create the file for this test */ - if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR + if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) + TEST_ERROR /* Test dynamically loaded filters for chunked dataset */ nerrors += (test_filters_for_datasets(file) < 0 ? 1 : 0); @@ -1144,12 +1150,15 @@ main(void) /* Test dynamically loaded filters for groups */ nerrors += (test_filters_for_groups(file) < 0 ? 1 : 0); - if(H5Fclose(file) < 0) TEST_ERROR + if (H5Fclose(file) < 0) + TEST_ERROR } /* end for */ /* Close FAPL */ - if(H5Pclose(fapl2) < 0) TEST_ERROR - if(H5Pclose(fapl) < 0) TEST_ERROR + if (H5Pclose(fapl2) < 0) + TEST_ERROR + if (H5Pclose(fapl) < 0) + TEST_ERROR /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -1158,10 +1167,12 @@ main(void) /* Close the library so that all loaded plugin libraries are unloaded */ h5_reset(); - fapl = h5_fileaccess(); + if ((fapl = h5_fileaccess()) < 0) + TEST_ERROR /* Reopen the file for testing data reading */ - if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if ((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) + TEST_ERROR /* Read the data with filters */ nerrors += (test_read_with_filters(file) < 0 ? 1 : 0); @@ -1174,20 +1185,23 @@ main(void) /* Close the library so that all loaded plugin libraries are unloaded */ h5_reset(); - fapl = h5_fileaccess(); + if ((fapl = h5_fileaccess()) < 0) + TEST_ERROR /* Reopen the file for testing data reading */ - if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if ((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) + TEST_ERROR /* Read the data with disabled filters */ nerrors += (test_noread_with_filters(file) < 0 ? 1 : 0); - if(H5Fclose(file) < 0) TEST_ERROR + if (H5Fclose(file) < 0) + TEST_ERROR /* Test the APIs for access to the filter plugin path table */ nerrors += (test_path_api_calls() < 0 ? 1 : 0); - if(nerrors) + if (nerrors) TEST_ERROR HDprintf("All plugin tests passed.\n"); -- cgit v0.12 From cf2da9a3d3d608c8763be06e3f036e3d6cb12e72 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 1 Aug 2017 08:46:23 -0500 Subject: Removed extra Fortran flags, (HDFFV-10037) --- hl/fortran/examples/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hl/fortran/examples/Makefile.am b/hl/fortran/examples/Makefile.am index 6709fb7..d383f9a 100644 --- a/hl/fortran/examples/Makefile.am +++ b/hl/fortran/examples/Makefile.am @@ -43,10 +43,10 @@ FORTRAN_API=yes # Tell automake how to build examples using h5fc if BUILD_PARALLEL_CONDITIONAL $(EXTRA_PROG): $(H5FC_PP) - $(H5FC_PP) $(H5CCFLAGS) $(FCFLAGS) -o $@ $(srcdir)/$@.f90; + $(H5FC_PP) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; else $(EXTRA_PROG): $(H5FC) - $(H5FC) $(H5CCFLAGS) $(FCFLAGS) -o $@ $(srcdir)/$@.f90; + $(H5FC) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; endif # Tell automake how to install examples -- cgit v0.12 From 538e9103681290b6a30d14fc94f50e499b2d11d3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 1 Aug 2017 13:36:32 -0500 Subject: HDFFV-10256 correct len of string copy to the len of esc string --- tools/src/h5dump/h5dump_xml.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index bb0fd7a..49d4f96 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -780,20 +780,20 @@ xml_escape_the_string(const char *str, int slen) esc_len = 1; } else if (*cp == '\'') { - HDstrncpy(ncp, apos, ncp_len); esc_len = HDstrlen(apos); + HDstrncpy(ncp, apos, esc_len); } else if (*cp == '<') { - HDstrncpy(ncp, lt, ncp_len); esc_len = HDstrlen(lt); + HDstrncpy(ncp, lt, esc_len); } else if (*cp == '>') { - HDstrncpy(ncp, gt, ncp_len); esc_len = HDstrlen(gt); + HDstrncpy(ncp, gt, esc_len); } else if (*cp == '&') { - HDstrncpy(ncp, amp, ncp_len); esc_len = HDstrlen(amp); + HDstrncpy(ncp, amp, esc_len); } else { *ncp = *cp; -- cgit v0.12 From e1a81b17e027a1f666b53131d6dd1782a3b9704b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 1 Aug 2017 13:52:10 -0500 Subject: HDFFV-10256 Add test --- MANIFEST | 2 ++ tools/test/h5dump/CMakeTestsXML.cmake | 7 +++++++ tools/test/h5dump/testh5dumpxml.sh.in | 5 +++++ tools/testfiles/test35.nc | Bin 0 -> 14297 bytes tools/testfiles/test35.nc.xml | 20 ++++++++++++++++++++ 5 files changed, 34 insertions(+) create mode 100644 tools/testfiles/test35.nc create mode 100644 tools/testfiles/test35.nc.xml diff --git a/MANIFEST b/MANIFEST index c7729e8..2fc5678 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2092,6 +2092,8 @@ ./tools/testfiles/tdset2.h5.xml ./tools/testfiles/tempty.h5.xml ./tools/testfiles/tenum.h5.xml +./tools/testfiles/test35.nc +./tools/testfiles/test35.nc.xml ./tools/testfiles/tfpformat.h5.xml ./tools/testfiles/tgroup.h5.xml ./tools/testfiles/thlink.h5.xml diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index 92e08a0..bdc6755 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -50,6 +50,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tname-quot.h5 ${HDF5_TOOLS_DIR}/testfiles/tname-sp.h5 ${HDF5_TOOLS_DIR}/testfiles/tnamed_dtype_attr.h5 + ${HDF5_TOOLS_DIR}/testfiles/test35.nc ${HDF5_TOOLS_DIR}/testfiles/tnestedcomp.h5 ${HDF5_TOOLS_DIR}/testfiles/tnodata.h5 ${HDF5_TOOLS_DIR}/testfiles/tobjref.h5 @@ -99,6 +100,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tempty-ns.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tempty-ns-2.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tenum.h5.xml + ${HDF5_TOOLS_DIR}/testfiles/test35.nc.xml ${HDF5_TOOLS_DIR}/testfiles/textlink.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tfpformat.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tgroup.h5.xml @@ -258,6 +260,8 @@ tempty.h5.out.err tenum.h5.out tenum.h5.out.err + test35.nc.out + test35.nc.out.err textlink.h5.out textlink.h5.out.err tfpformat.h5.out @@ -430,3 +434,6 @@ # tests for floating point user defined printf format ADD_XML_H5_TEST (tfpformat.h5 0 -u -m %.7f tfpformat.h5) + # test for HDFFV-10256 issue + ADD_XML_H5_TEST (test35.nc 0 test35.nc) + diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index 5f62946..39b1361 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -80,6 +80,7 @@ $SRC_H5DUMP_TESTFILES/tdset.h5 $SRC_H5DUMP_TESTFILES/tdset2.h5 $SRC_H5DUMP_TESTFILES/tempty.h5 $SRC_H5DUMP_TESTFILES/tenum.h5 +$SRC_H5DUMP_TESTFILES/test35.nc $SRC_H5DUMP_TESTFILES/textlink.h5 $SRC_H5DUMP_TESTFILES/tfpformat.h5 $SRC_H5DUMP_TESTFILES/tgroup.h5 @@ -144,6 +145,7 @@ $SRC_H5DUMP_TESTFILES/tempty-nons-uri.h5.xml $SRC_H5DUMP_TESTFILES/tempty-ns.h5.xml $SRC_H5DUMP_TESTFILES/tempty-ns-2.h5.xml $SRC_H5DUMP_TESTFILES/tenum.h5.xml +$SRC_H5DUMP_TESTFILES/test35.nc.xml $SRC_H5DUMP_TESTFILES/textlink.h5.xml $SRC_H5DUMP_TESTFILES/tfpformat.h5.xml $SRC_H5DUMP_TESTFILES/tgroup.h5.xml @@ -383,6 +385,9 @@ TOOLTEST torderattr4.h5.xml --xml -H --sort_by=creation_order --sort_order=desce # tests for floating point user defined printf format TOOLTEST tfpformat.h5.xml -u -m %.7f tfpformat.h5 +# test for HDFFV-10256 issue +TOOLTEST test35.nc --xml test35.nc + # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR diff --git a/tools/testfiles/test35.nc b/tools/testfiles/test35.nc new file mode 100644 index 0000000..4bd5d7f Binary files /dev/null and b/tools/testfiles/test35.nc differ diff --git a/tools/testfiles/test35.nc.xml b/tools/testfiles/test35.nc.xml new file mode 100644 index 0000000..a38ed8a --- /dev/null +++ b/tools/testfiles/test35.nc.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaa>aaaa<aaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>a<aaaaaa>aaaaaaaa<aaaaaa>a<aaaaaa>aaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaa>aaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaa<aaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"aaaaa\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaa<aaaa>aaaa<aaaa>>aaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaa>aaaaaaaaaaaaaaaaaa<aaaa>aaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<a>aaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaa<>aaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaa<aa>aaaaaaaaaaaaaaaaaaa<aaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaa<aa>aaaaaaaaaaaaaaaaaaaa<aaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaa<aa>aaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + + + + -- cgit v0.12 From 2d932366b27af21b9197c882b4bf09f7c7bc973e Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 1 Aug 2017 15:33:43 -0500 Subject: added test for NAG compiler and use the FC_BASENAME for NAG detection, (HDFFV-10037) --- config/linux-gnulibc1 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++--- configure.ac | 3 +-- 2 files changed, 63 insertions(+), 5 deletions(-) diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 1785e0e..7cd1a2a 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -84,7 +84,20 @@ else $RM $tmpfile fc_version_info=`$FC -V | grep Absoft` ;; - + # The NAG compiler + nagfor*|nagftn*) + RM='rm -f' + tmpfile=/tmp/cmpver.$$ + $FC -V >& $tmpfile + if test -s "$tmpfile"; then + if( grep -s 'NAG Fortran' $tmpfile > /dev/null) then + FC_BASENAME=nagfor + fi + fi + fc_version_info=`grep "NAG Fortran" $tmpfile` + echo "compiler '$FC' is $fc_version_info" + $RM $tmpfile + ;; *) ;; esac @@ -108,10 +121,10 @@ case $FC_BASENAME in # f95) # Set required flag for compiling C stubs - H5_CFLAGS="$H5_CFLAGS" + H5_CFLAGS="$H5_CFLAGS" F9XSUFFIXFLAG="" -# We force compiler to use upper case for external names +# We force compiler to use upper case for external names # (just in case since this should be a default EIP) H5_FCFLAGS="$H5_FCFLAGS" FSEARCH_DIRS="" @@ -136,6 +149,39 @@ case $FC_BASENAME in f9x_flags_set=yes ;; +# +# NAG compiler +# + nagfor) + # Set required flag for compiling C stubs + H5_CFLAGS="$H5_CFLAGS" + + F9XSUFFIXFLAG="" +# We force compiler to use upper case for external names +# (just in case since this should be a default EIP) + H5_FCFLAGS="$H5_FCFLAGS" + FSEARCH_DIRS="" + + # Production + PROD_FCFLAGS= + + # Debug + DEBUG_FCFLAGS= + + # Symbols + SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS="" + + # Profiling + PROFILE_FCFLAGS="" + + # Optimization + HIGH_OPT_FCFLAGS="-O" + DEBUG_OPT_FCFLAGS= + NO_OPT_FCFLAGS= + + f9x_flags_set=yes + ;; esac @@ -230,6 +276,19 @@ case $FC in *pgf90*) fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS -V 2>&1 | grep 'pgf90'` ;; + *nagfor*|*nagftn*) + RM='rm -f' + tmpfile=/tmp/cmpver.$$ + $FC -V >& $tmpfile + if test -s "$tmpfile"; then + if( grep -s 'NAG Fortran' $tmpfile > /dev/null) then + FC_BASENAME=nagfor + fi + fi + fc_version_info=`grep "NAG Fortran" $tmpfile` + $RM $tmpfile + echo "compiler '$FC' is $fc_version_info" + ;; *) echo "No match to get fc_version_info for $FC" diff --git a/configure.ac b/configure.ac index 47f5897..cf82a2e 100644 --- a/configure.ac +++ b/configure.ac @@ -3348,8 +3348,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then Linux*) fortran_linux_linker_option="-Wl," - - if (grep -i 'NAG_Fortran' libtool > /dev/null); then + if test "X$FC_BASENAME" = "Xnagfor"; then fortran_linux_linker_option="-Wl,-Wl,," fi -- cgit v0.12 From 00d97d556b3e57129d8c7bbecf8b15497b3f056b Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 1 Aug 2017 15:44:55 -0500 Subject: added test for NAG compiler and use the FC_BASENAME for NAG detection, (HDFFV-10037) --- config/linux-gnulibc1 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 7cd1a2a..39225e7 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -153,8 +153,6 @@ case $FC_BASENAME in # NAG compiler # nagfor) - # Set required flag for compiling C stubs - H5_CFLAGS="$H5_CFLAGS" F9XSUFFIXFLAG="" # We force compiler to use upper case for external names @@ -166,19 +164,19 @@ case $FC_BASENAME in PROD_FCFLAGS= # Debug - DEBUG_FCFLAGS= + DEBUG_FCFLAGS="-C" # Symbols SYMBOLS_FCFLAGS="-g" - NO_SYMBOLS_FCFLAGS="" + NO_SYMBOLS_FCFLAGS="-s" # Profiling - PROFILE_FCFLAGS="" + PROFILE_FCFLAGS="-pg" # Optimization HIGH_OPT_FCFLAGS="-O" - DEBUG_OPT_FCFLAGS= - NO_OPT_FCFLAGS= + DEBUG_OPT_FCFLAGS="-O0" + NO_OPT_FCFLAGS="-O0" f9x_flags_set=yes ;; -- cgit v0.12 From f4e9bc21fa3d3d678ca80083dbd412b34c3ab91b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 1 Aug 2017 15:45:17 -0500 Subject: HDFFV-10256 add release note --- release_docs/RELEASE.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index cd29900..2dbe7e9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -147,6 +147,16 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5dump + + h5dump segfaulted on output of XML file. + + Function that escape'd strings used the full buffer length + instead of just the length of the replacement string in a + strncpy call. Using the correct length fixed the issue. + + (ADB - 2017/08/01, HDFFV-10256) + - h5diff h5diff segfaulted on compare of a NULL variable length string. -- cgit v0.12 From 81340c609ba5049b34845ff2f06b2025ec5d5b22 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 2 Aug 2017 08:32:31 -0700 Subject: Moved H5PL diagnostic pragmas to comply with old gcc requirements that they be outside of functions. --- src/H5PLint.c | 21 ++++++++++++--------- src/H5PLplugin_cache.c | 15 +++++++-------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index bd6bf7d..c887f86 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -292,6 +292,17 @@ done: * *------------------------------------------------------------------------- */ +/* NOTE: We turn off -Wpedantic in gcc to quiet a warning about converting + * object pointers to function pointers, which is undefined in ANSI C. + * This is basically unavoidable due to the nature of dlsym() and *is* + * defined in POSIX, so it's fine. + * + * This pragma only needs to surround the assignment of the + * get_plugin_info function pointer, but early (4.4.7, at least) gcc + * only allows diagnostic pragmas to be toggled outside of functions. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" herr_t H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const void **plugin_info) { @@ -318,19 +329,10 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v HGOTO_DONE(SUCCEED); } - /* Return a handle for the function H5PLget_plugin_info in the dynamic library. * The plugin library is suppose to define this function. - * - * NOTE: We turn off -Wpedantic in gcc to quiet a warning about converting - * object pointers to function pointers, which is undefined in ANSI C. - * This is basically unavoidable due to the nature of dlsym() and *is* - * defined in POSIX, so it's fine. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpedantic" if (NULL != (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) { -#pragma GCC diagnostic pop const H5Z_class2_t *info; @@ -358,6 +360,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__open() */ +#pragma GCC diagnostic pop /*------------------------------------------------------------------------- diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index 30a0798..d826ba0 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -250,6 +250,11 @@ done: * *------------------------------------------------------------------------- */ +/* See the other use of H5PL_GET_LIB_FUNC() for an explanation + * for why we disable -Wpedantic here. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" herr_t H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *found, const void **plugin_info) { @@ -276,16 +281,9 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f H5PL_get_plugin_info_t get_plugin_info_function; const H5Z_class2_t *filter_info; - /* Get the "get plugin info" function from the plugin. - * - * See the other use of H5PL_GET_LIB_FUNC() for an explanation - * for why we disable -Wpedantic here. - */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpedantic" + /* Get the "get plugin info" function from the plugin. */ if (NULL == (get_plugin_info_function = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC((H5PL_cache_g[u]).handle, "H5PLget_plugin_info"))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info") -#pragma GCC diagnostic pop /* Call the "get plugin info" function */ if (NULL == (filter_info = (const H5Z_class2_t *)(*get_plugin_info_function)())) @@ -305,4 +303,5 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find_plugin_in_cache() */ +#pragma GCC diagnostic pop -- cgit v0.12 From 02a56054b0ddbd6a29e2b09ed39aef0b8e7f001d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 2 Aug 2017 10:53:17 -0500 Subject: Add h5repack tests for paged aggregation --- tools/test/h5repack/CMakeTests.cmake | 97 ++++++++++++++++++++++++++++++++++-- 1 file changed, 94 insertions(+), 3 deletions(-) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 897209c..225f6a8 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -76,6 +76,12 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_shuffle.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_soffset.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_szip.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_aggr.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fsm_aggr_nopersist.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fsm_aggr_persist.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_none.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_paged_nopersist.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_paged_persist.h5 # h5diff/testfile ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr1.h5 # tools/testfiles @@ -139,6 +145,12 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/4_vds.h5-vds_conti-v.ddl ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_zero.tst ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/crtorder.tordergr.h5.ddl + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/S.h5repack_fsm_aggr_persist.h5.ddl + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/STG.h5repack_none.h5.ddl + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/GS.h5repack_paged_nopersist.h5.ddl + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/SP.h5repack_paged_persist.h5.ddl + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/SPT.h5repack_aggr.h5.ddl ) foreach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) @@ -238,7 +250,8 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_CMP-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + ) else () add_test ( NAME H5REPACK_CMP-${testname} @@ -272,7 +285,8 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_MASK-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + ) else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_MASK-${testname} @@ -305,7 +319,8 @@ # If using memchecker add tests without using scripts add_test ( NAME H5REPACK_DMP-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS ${last_test}) endif () @@ -326,6 +341,40 @@ endif () endmacro () + macro (ADD_H5_STAT_TEST testname testtype resultcode statarg resultfile) + if ("${testtype}" STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_STAT-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile}" + ) + endif () + else () + # If using memchecker add tests without using scripts + add_test ( + NAME H5REPACK_STAT-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile} + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_STAT-${testname} PROPERTIES DEPENDS ${last_test}) + endif () + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_STAT-h5stat-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-S;-s;out-${statarg}.${resultfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}-${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${statarg}.${resultfile}.ddl" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5REPACK_STAT-h5stat-${testname} PROPERTIES DEPENDS "H5REPACK_STAT-${testname}") + endif () + endif () + endmacro () + macro (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -972,6 +1021,48 @@ set (TESTTYPE "TEST") ADD_H5_DMP_TEST (crtorder ${TESTTYPE} 0 ${arg}) +################################################################################################### +# Testing paged aggregation related options: +# -G pagesize +# -P 1 or 0 +# -S strategy +# -T threshold +# +# The testfiles used are generated by test/gen_filespace.c and the file names are prepended with "h5repack_": +# (1) "fsm_aggr_nopersist.h5" /* H5F_FSPACE_STRATEGY_FSM_AGGR + not persisting free-space */ +# (2) "fsm_aggr_persist.h5" /* H5F_FSPACE_STRATEGY_FSM_AGGR + persisting free-space */ +# (3) "paged_nopersist.h5" /* H5F_FSPACE_STRATEGY_PAGE + not persisting free-space */ +# (4) "paged_persist.h5" /* H5F_FSPACE_STRATEGY_PAGE + persisting free-space */ +# (5) "aggr.h5" /* H5F_FSPACE_STRATEGY_AGGR */ +# (6) "none.h5" /* H5F_FSPACE_STRATEGY_NONE */ +# +##################################################################################################### +# + set (arg h5repack_fsm_aggr_nopersist.h5 -S PAGE -P 1) + set (TESTTYPE "TEST") + ADD_H5_STAT_TEST (SP_PAGE ${TESTTYPE} 0 SP ${arg}) + + set (arg h5repack_fsm_aggr_persist.h5 -S AGGR) + set (TESTTYPE "TEST") + ADD_H5_STAT_TEST (S_AGGR ${TESTTYPE} 0 S ${arg}) + + set (arg h5repack_none.h5 -S PAGE -T 10 -G 2048) + set (TESTTYPE "TEST") + ADD_H5_STAT_TEST (STG_PAGE ${TESTTYPE} 0 STG ${arg}) + + set (arg h5repack_paged_nopersist.h5 -G 512 -S AGGR) + set (TESTTYPE "TEST") + ADD_H5_STAT_TEST (GS_AGGR ${TESTTYPE} 0 GS ${arg}) + + set (arg h5repack_paged_persist.h5 -S NONE -P 1) + set (TESTTYPE "TEST") + ADD_H5_STAT_TEST (SP_NONE ${TESTTYPE} 0 SP ${arg}) + + set (arg h5repack_aggr.h5 -S FSM_AGGR -P 1 -T 5) + set (TESTTYPE "TEST") + ADD_H5_STAT_TEST (SPT_FSM_AGGR ${TESTTYPE} 0 SPT ${arg}) + + ######################################################### # layout options (these files have no filters) ######################################################### -- cgit v0.12 From 5615cc2a694516a02731e4d398870385c9736375 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 2 Aug 2017 12:42:40 -0500 Subject: Fix misnamed file in test script --- tools/test/h5dump/testh5dumpxml.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index 39b1361..b3b9e14 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -386,7 +386,7 @@ TOOLTEST torderattr4.h5.xml --xml -H --sort_by=creation_order --sort_order=desce TOOLTEST tfpformat.h5.xml -u -m %.7f tfpformat.h5 # test for HDFFV-10256 issue -TOOLTEST test35.nc --xml test35.nc +TOOLTEST test35.nc.xml --xml test35.nc # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR -- cgit v0.12 From 2332135332f93bf88909d8ef182281c28a8e1818 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 3 Aug 2017 09:17:24 -0500 Subject: changed the test for NAG fortran compiler, (HDFFV-10037) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index cf82a2e..995d004 100644 --- a/configure.ac +++ b/configure.ac @@ -3516,7 +3516,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ### wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) case "`uname`" in Linux*) - if (grep -i 'NAG_Fortran' libtool > /dev/null); then + if test "X$FC_BASENAME" = "Xnagfor"; then cat libtool | awk '/NAG_Fortran/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool fi ;; -- cgit v0.12 From 2a1e499b0134ed319cd9d60a6521ba83b3a2cfa8 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 3 Aug 2017 09:20:05 -0500 Subject: changed comments, (HDFFV-10037) --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 995d004..91800e7 100644 --- a/configure.ac +++ b/configure.ac @@ -3340,10 +3340,10 @@ fi if test "X$HDF_FORTRAN" = "Xyes"; then - ### libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler + ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler ### on Linux (other OSs have not been tested). ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to - ### wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) + ### wl="-Wl,-Wl,," in the libtool file. (HDFFV-10037) case "`uname`" in Linux*) @@ -3510,10 +3510,10 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ;; esac - ### libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler + ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler ### on Linux (other OSs have not been tested). ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to - ### wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) + ### wl="-Wl,-Wl,," in the libtool file. (HDFFV-10037) case "`uname`" in Linux*) if test "X$FC_BASENAME" = "Xnagfor"; then -- cgit v0.12 From 50c4bc883500846f58ec1c8f55d57eef2b3f147b Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 3 Aug 2017 10:09:47 -0500 Subject: Add test file to build process --- MANIFEST | 2 + src/H5Dio.c | 2 +- test/Makefile.am | 4 +- test/tfilters_parallel.c | 2243 ++++++++++++++++++++++++++++++++++++++++++++++ test/tfilters_parallel.h | 190 ++++ 5 files changed, 2438 insertions(+), 3 deletions(-) create mode 100644 test/tfilters_parallel.c create mode 100644 test/tfilters_parallel.h diff --git a/MANIFEST b/MANIFEST index 475b674..d61d392 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1070,6 +1070,8 @@ ./test/testswmr.sh.in ./test/testvdsswmr.sh.in ./test/tfile.c +./test/tfilters_parallel.c +./test/tfilters_parallel.h ./test/tgenprop.c ./test/th5o.c ./test/th5s.c diff --git a/src/H5Dio.c b/src/H5Dio.c index 470520e..104a632 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -1227,7 +1227,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, if (H5P_get(dx_plist, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, &global_no_collective_cause) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get global no collective cause value") - /* Append each of the reason for breaking collective I/O error messages to the + /* Append each of the "reason for breaking collective I/O" error messages to the * local and global no collective cause strings */ for (cause = 1, index = 0; cause < H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE; cause <<= 1, index++) { size_t cause_strlen = strlen(cause_strings[index]); diff --git a/test/Makefile.am b/test/Makefile.am index f64b6d8..0d80396 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -79,7 +79,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ links_env filenotclosed flushrefresh use_append_chunk use_append_mchunks use_disable_mdc_flushes \ swmr_generator swmr_start_write swmr_reader swmr_writer swmr_remove_reader \ swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer \ - swmr_check_compat_vfd vds_swmr_gen vds_swmr_reader vds_swmr_writer + swmr_check_compat_vfd vds_swmr_gen vds_swmr_reader vds_swmr_writer tfilters_parallel if HAVE_SHARED_CONDITIONAL check_PROGRAMS+= plugin endif @@ -203,7 +203,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse flushrefresh_VERIFICATION_DONE atomic_data accum_swmr_big.h5 ohdr_swmr.h5 \ test_swmr*.h5 cache_logging.h5 cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 \ swmr[0-2].h5 swmr_writer.out swmr_writer.log.* swmr_reader.out.* swmr_reader.log.* \ - tbogus.h5.copy cache_image_test.h5 + tbogus.h5.copy cache_image_test.h5 tfilters_parallel.h5 # Sources for testhdf5 executable testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ diff --git a/test/tfilters_parallel.c b/test/tfilters_parallel.c new file mode 100644 index 0000000..213e939 --- /dev/null +++ b/test/tfilters_parallel.c @@ -0,0 +1,2243 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Jordan Henderson + * 01/31/2017 + * + * This file contains tests for writing to and reading from + * datasets in parallel with filters applied to the data. + */ + +#include "tfilters_parallel.h" + +#define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0]) + +static int test_one_chunk_filtered_dataset(void); +static int test_filtered_dataset_no_overlap(void); +static int test_filtered_dataset_overlap(void); +static int test_filtered_dataset_single_no_selection(void); +static int test_filtered_dataset_all_no_selection(void); +static int test_filtered_dataset_point_selection(void); +static int test_filtered_dataset_interleaved_write(void); +static int test_3d_filtered_dataset_no_overlap_separate_pages(void); +static int test_3d_filtered_dataset_no_overlap_same_pages(void); +static int test_3d_filtered_dataset_overlap(void); +static int test_32d_filtered_dataset_no_overlap_separate_pages(void); +static int test_32d_filtered_dataset_no_overlap_same_pages(void); +static int test_32d_filtered_dataset_overlap(void); +static int test_cmpd_filtered_dataset_no_conversion_unshared(void); +static int test_cmpd_filtered_dataset_no_conversion_shared(void); +static int test_cmpd_filtered_dataset_type_conversion_unshared(void); +static int test_cmpd_filtered_dataset_type_conversion_shared(void); +static int test_write_serial_read_parallel(void); +static int test_write_parallel_read_serial(void); + +static int read_outfile(char* filename, char* datasetname); + +static MPI_Comm comm = MPI_COMM_WORLD; +static MPI_Info info = MPI_INFO_NULL; +static int mpi_rank; +static int mpi_size; + +static int (*tests[])(void) = { + test_one_chunk_filtered_dataset, + test_filtered_dataset_no_overlap, + test_filtered_dataset_overlap, + test_filtered_dataset_single_no_selection, + test_filtered_dataset_all_no_selection, + test_filtered_dataset_point_selection, + test_filtered_dataset_interleaved_write, + test_3d_filtered_dataset_no_overlap_separate_pages, + test_3d_filtered_dataset_no_overlap_same_pages, + test_3d_filtered_dataset_overlap, + test_32d_filtered_dataset_no_overlap_separate_pages, + test_32d_filtered_dataset_no_overlap_same_pages, + test_32d_filtered_dataset_overlap, + test_cmpd_filtered_dataset_no_conversion_unshared, + test_cmpd_filtered_dataset_no_conversion_shared, + test_cmpd_filtered_dataset_type_conversion_unshared, + test_cmpd_filtered_dataset_type_conversion_shared, + test_write_serial_read_parallel, + test_write_parallel_read_serial, +}; + +/* + * Tests parallel write of filtered data in the special + * case where a dataset is composed of a single chunk. + * + * Programmer: Jordan Henderson + * 02/01/2017 + */ +static int +test_one_chunk_filtered_dataset() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[ONE_CHUNK_FILTERED_DATASET_DIMS]; + hsize_t chunk_dims[ONE_CHUNK_FILTERED_DATASET_DIMS]; + hsize_t sel_dims[ONE_CHUNK_FILTERED_DATASET_DIMS]; + hsize_t count[ONE_CHUNK_FILTERED_DATASET_DIMS]; + hsize_t stride[ONE_CHUNK_FILTERED_DATASET_DIMS]; + hsize_t block[ONE_CHUNK_FILTERED_DATASET_DIMS]; + hsize_t offset[ONE_CHUNK_FILTERED_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing one-chunk filtered dataset"); + + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + dataset_dims[0] = ONE_CHUNK_FILTERED_DATASET_NROWS; + dataset_dims[1] = ONE_CHUNK_FILTERED_DATASET_NCOLS; + chunk_dims[0] = ONE_CHUNK_FILTERED_DATASET_CH_NROWS; + chunk_dims[1] = ONE_CHUNK_FILTERED_DATASET_CH_NCOLS; + sel_dims[0] = ONE_CHUNK_FILTERED_DATASET_NROWS / NUM_MPI_RANKS; + sel_dims[1] = ONE_CHUNK_FILTERED_DATASET_NCOLS; + + if ((filespace = H5Screate_simple(ONE_CHUNK_FILTERED_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(ONE_CHUNK_FILTERED_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + if (H5Pset_chunk(plist_id, ONE_CHUNK_FILTERED_DATASET_DIMS, chunk_dims) < 0) + goto error; + + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, ONE_CHUNK_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + count[0] = 1; + count[1] = 1; + stride[0] = ONE_CHUNK_FILTERED_DATASET_CH_NROWS; + stride[1] = ONE_CHUNK_FILTERED_DATASET_CH_NCOLS; + block[0] = sel_dims[0]; + block[1] = sel_dims[1]; + offset[0] = (mpi_rank * sel_dims[0]); + offset[1] = 0; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + data_size = ONE_CHUNK_FILTERED_DATASET_CH_NROWS * ONE_CHUNK_FILTERED_DATASET_NCOLS * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** ONE-CHUNK FILTERED DATASET TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where only + * one process is writing to a particular chunk in the operation. + * In this case, the write operation can be optimized because + * chunks do not have to be redistributed to new owners. + * + * Programmer: Jordan Henderson + * 02/01/2017 + */ +static int +test_filtered_dataset_no_overlap() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t chunk_dims[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t sel_dims[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t count[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t stride[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t block[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t offset[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to unshared filtered chunks"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = UNSHARED_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; + sel_dims[1] = UNSHARED_FILTERED_CHUNKS_NCOLS; + + if ((filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = UNSHARED_FILTERED_CHUNKS_NCOLS / UNSHARED_FILTERED_CHUNKS_CH_NCOLS; + stride[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; + stride[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; + block[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; + block[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; + offset[0] = (mpi_rank * UNSHARED_FILTERED_CHUNKS_CH_NROWS * count[0]); + offset[1] = 0; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** UNSHARED FILTERED CHUNKS WRITE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where + * more than one process is writing to a particular chunk + * in the operation. In this case, the chunks have to be + * redistributed before the operation so that only one process + * writes to a particular chunk. + * + * Programmer: Jordan Henderson + * 02/01/2017 + */ +static int +test_filtered_dataset_overlap() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t chunk_dims[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t sel_dims[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t count[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t stride[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t block[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t offset[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to shared filtered chunks"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = SHARED_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = SHARED_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = SHARED_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = SHARED_FILTERED_CHUNKS_CH_NROWS; + sel_dims[1] = SHARED_FILTERED_CHUNKS_NCOLS; + + if ((filespace = H5Screate_simple(SHARED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(SHARED_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, SHARED_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, SHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = SHARED_FILTERED_CHUNKS_NROWS / SHARED_FILTERED_CHUNKS_CH_NROWS; + count[1] = SHARED_FILTERED_CHUNKS_NCOLS / SHARED_FILTERED_CHUNKS_CH_NCOLS; + stride[0] = SHARED_FILTERED_CHUNKS_CH_NROWS; + stride[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; + block[0] = 1; + block[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; + offset[0] = mpi_rank; + offset[1] = 0; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** SHARED FILTERED CHUNKS WRITE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where + * a single process in the write operation has no selection + * in the datasets dataspace. In this case, the process with + * no selection still has to participate in the collective + * space re-allocation for the filtered chunks and also must + * participate in the re-insertion of the filtered chunks + * into the chunk index. + * + * Programmer: Jordan Henderson + * 02/01/2017 + */ +static int +test_filtered_dataset_single_no_selection() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t chunk_dims[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t sel_dims[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t count[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t stride[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t block[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t offset[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to filtered chunks with a single process having no selection"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + sel_dims[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS; + + if (mpi_rank == SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) + sel_dims[0] = sel_dims[1] = 0; + + if ((filespace = H5Screate_simple(SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS / SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + stride[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + stride[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + block[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + block[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + offset[0] = mpi_rank * SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS * count[0]; + offset[1] = 0; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + + if (mpi_rank == SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) { + if (H5Sselect_none(filespace) < 0) + goto error; + } + else { + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + } + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** SINGLE NO SELECTION FILTERED CHUNKS WRITE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case + * where no process in the write operation has a + * selection in the datasets dataspace. This test is + * to ensure that there are no assertion failures or + * similar issues due to size 0 allocations and the + * like. In this case, the file and dataset are created + * but the dataset is populated with the default fill + * value. + * + * Programmer: Jordan Henderson + * 02/02/2017 + */ +static int +test_filtered_dataset_all_no_selection() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t chunk_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t sel_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to filtered chunks with all processes having no selection"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = sel_dims[1] = 0; + + if ((filespace = H5Screate_simple(ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_none(filespace) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** ALL NO SELECTION FILTERED CHUNKS WRITE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data by using + * point selections instead of hyperslab selections. + * + * Programmer: Jordan Henderson + * 02/02/2017 + */ +static int +test_filtered_dataset_point_selection() +{ + C_DATATYPE *data = NULL; + hsize_t coords[2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS][POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t dataset_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t chunk_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t sel_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + size_t i, j, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to filtered chunks with point selection"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = POINT_SELECTION_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS; + sel_dims[1] = POINT_SELECTION_FILTERED_CHUNKS_NCOLS; + + if ((filespace = H5Screate_simple(POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Set up point selection */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + + for (i = 0; i < 2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS; i++) + for (j = 0; j < POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS; j++) { + if (j > 0) + coords[i][j] = i % POINT_SELECTION_FILTERED_CHUNKS_NCOLS; + else + coords[i][j] = mpi_rank + ((i / POINT_SELECTION_FILTERED_CHUNKS_NCOLS) * POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS); + } + + if (H5Sselect_elements(filespace, H5S_SELECT_SET, 2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS, (const hsize_t *) coords) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** POINT SELECTION FILTERED CHUNKS WRITE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where + * each process writes an equal amount of data to each chunk + * in the dataset. Each chunk is distributed among the + * processes in round-robin fashion by blocks of size 1 until + * the whole chunk is selected, leading to an interleaved + * write pattern. + * + * Programmer: Jordan Henderson + * 02/02/2017 + */ +static int +test_filtered_dataset_interleaved_write() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + hsize_t chunk_dims[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + hsize_t sel_dims[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + hsize_t count[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + hsize_t stride[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + hsize_t block[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + hsize_t offset[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing interleaved write to filtered chunks"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_NROWS; + dataset_dims[1] = INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS; + chunk_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS; + chunk_dims[1] = INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS; + sel_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / 2; + sel_dims[1] = INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / 2; + + if ((filespace = H5Screate_simple(INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, INTERLEAVED_WRITE_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = SHARED_FILTERED_CHUNKS_NROWS / 2; + count[1] = SHARED_FILTERED_CHUNKS_NCOLS / 2; + stride[0] = 2; + stride[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; + block[0] = 1; + block[1] = 1; + offset[0] = mpi_rank / SHARED_FILTERED_CHUNKS_CH_NCOLS; + offset[1] = mpi_rank % SHARED_FILTERED_CHUNKS_CH_NCOLS; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** INTERLEAVED FILTERED CHUNK WRITE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where + * the dataset has 3 dimensions and each process writes + * to its own "page" in the 3rd dimension. + * + * Programmer: Jordan Henderson + * 02/06/2017 + */ +static int +test_3d_filtered_dataset_no_overlap_separate_pages() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + hsize_t chunk_dims[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + hsize_t sel_dims[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + hsize_t count[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + hsize_t stride[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + hsize_t block[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + hsize_t offset[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to unshared filtered chunks on separate pages in 3D dataset"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS; + dataset_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS; + dataset_dims[2] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DEPTH; + chunk_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; + chunk_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; + chunk_dims[2] = 1; + sel_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS; + sel_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS; + sel_dims[2] = 1; + + if ((filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS / UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; + count[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS / UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; + count[2] = 1; + stride[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; + stride[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; + stride[2] = 1; + block[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; + block[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; + block[2] = 1; + offset[0] = 0; + offset[1] = 0; + offset[2] = mpi_rank; + + printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** 3D UNSHARED FILTERED CHUNKS SEPARATE PAGE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where + * the dataset has 3 dimensions and each process writes + * to each "page" in the 3rd dimension. However, no chunk + * on a given "page" is written to by more than one process. + * + * Programmer: Jordan Henderson + * 02/06/2017 + */ +static int +test_3d_filtered_dataset_no_overlap_same_pages() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + hsize_t chunk_dims[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + hsize_t sel_dims[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + hsize_t count[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + hsize_t stride[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + hsize_t block[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + hsize_t offset[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to unshared filtered chunks on the same pages in 3D dataset"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS; + dataset_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS; + dataset_dims[2] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH; + chunk_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; + chunk_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; + chunk_dims[2] = 1; + sel_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; + sel_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS; + sel_dims[2] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH; + + if ((filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS / UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; + count[2] = NUM_MPI_RANKS; + stride[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; + stride[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; + stride[2] = 1; + block[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; + block[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; + block[2] = 1; + offset[0] = (mpi_rank * UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS * count[0]); + offset[1] = 0; + offset[2] = 0; + + printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** 3D UNSHARED FILTERED CHUNKS SAME PAGE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where + * the dataset has 3 dimensions and each process writes + * to each "page" in the 3rd dimension. Further, each chunk + * in each "page" is written to equally by all processes. + * + * Programmer: Jordan Henderson + * 02/06/2017 + */ +static int +test_3d_filtered_dataset_overlap() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + hsize_t chunk_dims[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + hsize_t sel_dims[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + hsize_t count[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + hsize_t stride[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + hsize_t block[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + hsize_t offset[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to shared filtered chunks in 3D dataset"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = SHARED_FILTERED_CHUNKS_3D_NROWS; + dataset_dims[1] = SHARED_FILTERED_CHUNKS_3D_NCOLS; + dataset_dims[2] = SHARED_FILTERED_CHUNKS_3D_DEPTH; + chunk_dims[0] = SHARED_FILTERED_CHUNKS_3D_CH_NROWS; + chunk_dims[1] = SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + chunk_dims[2] = 1; + sel_dims[0] = SHARED_FILTERED_CHUNKS_3D_NROWS / 2; + sel_dims[1] = SHARED_FILTERED_CHUNKS_3D_NCOLS / 2; + sel_dims[2] = SHARED_FILTERED_CHUNKS_3D_DEPTH; + + if ((filespace = H5Screate_simple(SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, SHARED_FILTERED_CHUNKS_3D_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = SHARED_FILTERED_CHUNKS_3D_NROWS / 2; + count[1] = SHARED_FILTERED_CHUNKS_3D_NCOLS / 2; + count[2] = SHARED_FILTERED_CHUNKS_3D_DEPTH; + stride[0] = 2; + stride[1] = SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + stride[2] = 1; + block[0] = 1; + block[1] = 1; + block[2] = 1; + offset[0] = mpi_rank / SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + offset[1] = mpi_rank % SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + offset[2] = 0; + + printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** 3D SHARED FILTERED CHUNKS TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +static int +test_32d_filtered_dataset_no_overlap_separate_pages(void) +{ + return 1; +} + +static int +test_32d_filtered_dataset_no_overlap_same_pages(void) +{ + return 1; +} + +static int +test_32d_filtered_dataset_overlap(void) +{ + return 1; +} + +/* + * Tests parallel write of filtered data to unshared + * chunks using a compound datatype which doesn't + * require a datatype conversion. + * + * Programmer: Jordan Henderson + * 02/10/2017 + */ +static int +test_cmpd_filtered_dataset_no_conversion_unshared() +{ + cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC]; + hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t count[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t stride[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t block[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t offset[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + size_t i; + hid_t file_id, dset_id, plist_id, memtype; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to unshared filtered chunks in Compound Datatype dataset without Datatype conversion"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NROWS; + dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS; + chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; + chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS; + sel_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; + sel_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; + + if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + /* Create the compound type for memory. */ + if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) + goto error; + if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) + goto error; + if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) + goto error; + if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) + goto error; + if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_NAME, memtype, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; + stride[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; + stride[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS; + block[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; + block[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS; + offset[0] = 0; + offset[1] = (mpi_rank * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS); + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC); + for (i = 0; i < COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) + data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS NO CONVERSION UNSHARED TEST FAILED ***"); + + ret_value = 1; + +exit: + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Tclose(memtype) < 0) + fprintf(stderr, "Unable to close mem type\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data to shared + * chunks using a compound datatype which doesn't + * require a datatype conversion. + * + * Programmer: Jordan Henderson + * 02/10/2017 + */ +static int +test_cmpd_filtered_dataset_no_conversion_shared() +{ + cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC]; + hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t count[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t stride[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t block[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t offset[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + size_t i; + hid_t file_id, dset_id, plist_id, memtype; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to shared filtered chunks in Compound Datatype dataset without Datatype conversion"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NROWS; + dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS; + chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS; + chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; + sel_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; + sel_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; + + if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + /* Create the compound type for memory. */ + if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) + goto error; + if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) + goto error; + if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) + goto error; + if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) + goto error; + if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_NAME, memtype, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; + stride[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS; + stride[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; + block[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; + block[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; + offset[0] = mpi_rank; + offset[1] = 0; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC); + for (i = 0; i < COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) + data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS NO CONVERSION SHARED TEST FAILED ***"); + + ret_value = 1; + +exit: + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Tclose(memtype) < 0) + fprintf(stderr, "Unable to close mem type\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data to unshared + * chunks using a compound datatype which requires a + * datatype conversion. + * + * This test currently fails because the datatype + * conversion causes the parallel library to break + * to independent I/O and this isn't allowed when + * there are filters in the pipeline. + * + * Programmer: Jordan Henderson + * 02/07/2017 + */ +static int +test_cmpd_filtered_dataset_type_conversion_unshared() +{ + cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC]; + hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t count[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t stride[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t block[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t offset[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + size_t i; + hid_t file_id, dset_id, plist_id, filetype, memtype; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to unshared filtered chunks in Compound Datatype dataset with Datatype conversion"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NROWS; + dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS; + chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; + chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS; + sel_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; + sel_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; + + if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + /* Create the compound type for memory. */ + if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) + goto error; + if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) + goto error; + if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) + goto error; + if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) + goto error; + if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) + goto error; + + /* Create the compound type for file. */ + if ((filetype = H5Tcreate(H5T_COMPOUND, 32)) < 0) + goto error; + if (H5Tinsert(filetype, "ShortData", 0, H5T_STD_I64BE) < 0) + goto error; + if (H5Tinsert(filetype, "IntData", 8, H5T_STD_I64BE) < 0) + goto error; + if (H5Tinsert(filetype, "LongData", 16, H5T_STD_I64BE) < 0) + goto error; + if (H5Tinsert(filetype, "DoubleData", 24, H5T_IEEE_F64BE) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_NAME, filetype, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; + stride[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; + stride[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS; + block[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; + block[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS; + offset[0] = 0; + offset[1] = (mpi_rank * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS); + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC); + for (i = 0; i < COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) + data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS TYPE CONVERSION UNSHARED TEST FAILED ***"); + + ret_value = 1; + +exit: + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Tclose(filetype) < 0) + fprintf(stderr, "Unable to close file type\n"); + if (H5Tclose(memtype) < 0) + fprintf(stderr, "Unable to close mem type\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data to shared + * chunks using a compound datatype which requires + * a datatype conversion. + * + * This test currently fails because the datatype + * conversion causes the parallel library to break + * to independent I/O and this isn't allowed when + * there are filters in the pipeline. + * + * Programmer: Jordan Henderson + * 02/10/2017 + */ +static int +test_cmpd_filtered_dataset_type_conversion_shared() +{ + cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC]; + hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t count[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t stride[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t block[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t offset[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + size_t i; + hid_t file_id, dset_id, plist_id, filetype, memtype; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to shared filtered chunks in Compound Datatype dataset with Datatype conversion"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NROWS; + dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS; + chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS; + chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; + sel_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; + sel_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; + + if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + /* Create the compound type for memory. */ + if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) + goto error; + if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) + goto error; + if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) + goto error; + if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) + goto error; + if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) + goto error; + + /* Create the compound type for file. */ + if ((filetype = H5Tcreate(H5T_COMPOUND, 32)) < 0) + goto error; + if (H5Tinsert(filetype, "ShortData", 0, H5T_STD_I64BE) < 0) + goto error; + if (H5Tinsert(filetype, "IntData", 8, H5T_STD_I64BE) < 0) + goto error; + if (H5Tinsert(filetype, "LongData", 16, H5T_STD_I64BE) < 0) + goto error; + if (H5Tinsert(filetype, "DoubleData", 24, H5T_IEEE_F64BE) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_NAME, filetype, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; + stride[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS; + stride[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; + block[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; + block[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; + offset[0] = mpi_rank; + offset[1] = 0; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC); + for (i = 0; i < COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) + data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS TYPE CONVERSION SHARED TEST FAILED ***"); + + ret_value = 1; + +exit: + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Tclose(filetype) < 0) + fprintf(stderr, "Unable to close file type\n"); + if (H5Tclose(memtype) < 0) + fprintf(stderr, "Unable to close mem type\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +static int +read_outfile(char* filename, char* datasetname) +{ + H5Z_filter_t filter_type; + C_DATATYPE *rbuf = NULL; + unsigned flags, filter_info; + hsize_t *dims, *maxdims; + size_t i, j, k, nelmts, buf_size; + hid_t file_id, dset_id, plist_id, creation_plist, dspace_id; + int num_filters, ndims; + + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + + if ((file_id = H5Fopen(filename, H5F_ACC_RDONLY, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + if ((dset_id = H5Dopen(file_id, datasetname, H5P_DEFAULT)) < 0) + goto error; + + if ((dspace_id = H5Dget_space(dset_id)) < 0) + goto error; + + if ((creation_plist = H5Dget_create_plist(dset_id)) < 0) + goto error; + + if ((num_filters = H5Pget_nfilters(creation_plist)) < 0) + goto error; + + if (mpi_rank == 0) { + printf("Number of filters: %i\n", num_filters); + + for (i = 0; i < num_filters; i++) { + nelmts = 0; + if ((filter_type = H5Pget_filter2(creation_plist, 0, &flags, &nelmts, NULL, 0, + NULL, &filter_info)) < 0) + goto error; + + printf("Filter Type: "); + switch (filter_type) { + case H5Z_FILTER_DEFLATE: + printf("H5Z_FILTER_DEFLATE\n"); + break; + case H5Z_FILTER_SZIP: + printf("H5Z_FILTER_SZIP\n"); + break; + default: + printf("Other filter type included.\n"); + } + } + } + + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if ((ndims = H5Sget_simple_extent_ndims(dspace_id)) < 0) + goto error; + if (NULL == (dims = malloc(ndims * sizeof(*dims)))) + goto error; + if (NULL == (maxdims = malloc(ndims * sizeof(*dims)))) + goto error; + + if (H5Sget_simple_extent_dims(dspace_id, dims, maxdims) < 0) + goto error; + + buf_size = 0; + for (i = 0; i < ndims; i++) + buf_size += dims[i] * sizeof(*rbuf); + + if (NULL == (rbuf = malloc(buf_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + if (H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, rbuf) < 0) + goto error; + + if (mpi_rank == 0) { + /* Only set up for use in 2D and 3D cases */ + if (ndims > 2) { + for (i = 0; i < dims[0]; i++) + for (j = 0; j < dims[1]; j++) + for (k = 0; k < dims[2]; k++) + printf("(%zu, %zu): %ld\n", i, j, rbuf[(i * dims[1]) + j]); + } + else { + for (i = 0; i < dims[0]; i++) + for (j = 0; j < dims[1]; j++) + printf("(%zu, %zu): %ld\n", i, j, rbuf[(i * dims[1]) + j]); + } + } + + free(rbuf); + if (H5Dclose(dset_id) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Pclose(creation_plist) < 0) + goto error; + if (H5Fclose(file_id) < 0) + goto error; + + return 0; + +error: + if (rbuf) + free(rbuf); + if (dims) + free(dims); + if (maxdims) + free(maxdims); + + return 1; +} + +static int +test_write_serial_read_parallel(void) +{ + return 1; +} + +static int +test_write_parallel_read_serial(void) +{ + return 1; +} + +int +main(int argc, char** argv) +{ + size_t i; + hid_t file_id, fapl; + int mpi_code; + int nerrors = 0; + + /* Initialize MPI */ + MPI_Init(&argc, &argv); + MPI_Comm_size(comm, &mpi_size); + MPI_Comm_rank(comm, &mpi_rank); + + if (mpi_size != NUM_MPI_RANKS) { + printf("These tests are set up to use %d ranks.\n", NUM_MPI_RANKS); + printf("Quitting...\n"); + return 0; + } + + /* Create test file */ + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto exit; + if (H5Pset_fapl_mpio(fapl, comm, info) < 0) + goto exit; + if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + goto exit; + if (H5Fclose(file_id) < 0) + goto exit; + + for (i = 0; i < ARRAY_SIZE(tests); i++) { + if (MPI_SUCCESS == (mpi_code = MPI_Barrier(comm))) { + nerrors += (*tests[i])(); + } else { + if (mpi_rank == 0) fprintf(stderr, "MPI_Barrier failed"); + nerrors++; + } + } + + if (nerrors) goto exit; + + puts("All Parallel Filters tests passed\n"); + +exit: + if (H5Pclose(fapl) < 0) + fprintf(stderr, "Couldn't close fapl.\n"); + + if (nerrors) + if (mpi_rank == 0) printf("*** %d TEST%s FAILED ***\n", nerrors, nerrors > 1 ? "S" : ""); + + MPI_Finalize(); + + exit(EXIT_SUCCESS); +} diff --git a/test/tfilters_parallel.h b/test/tfilters_parallel.h new file mode 100644 index 0000000..631b417 --- /dev/null +++ b/test/tfilters_parallel.h @@ -0,0 +1,190 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Jordan Henderson + * 01/31/2017 + * + * This file contains #defines for tests of the use + * of filters in parallel HDF5, implemented in + * H5Dmpio.c + */ + +#ifndef TEST_PARALLEL_FILTERS_H_ +#define TEST_PARALLEL_FILTERS_H_ + +#include + +#include "stdlib.h" +#include "h5test.h" + +/* Used to load other filters than GZIP */ +/* #define DYNAMIC_FILTER */ /* Uncomment and define the fields below to use a dynamically loaded filter */ +#define FILTER_NUM_CDVALUES 1 +const unsigned int cd_values[FILTER_NUM_CDVALUES]; +H5Z_filter_t filter_id; +unsigned int flags = 0; +size_t cd_nelmts = FILTER_NUM_CDVALUES; + +/* Utility Macros */ +#define STRINGIFY(type) #type + +/* Common defines for all tests */ +#define FILENAME "tfilters_parallel.h5" +#define NUM_MPI_RANKS 4 +#define C_DATATYPE long +#define C_DATATYPE_STR(type) STRINGIFY(type) +#define HDF5_DATATYPE_NAME H5T_NATIVE_LONG +#define GEN_DATA(i) RANK_DATA(i) /* Given an index value i, generates test data based upon selected mode */ +#define RANK_DATA(i) (mpi_rank) /* Generates test data to visibly show which rank wrote to which parts of the dataset */ +#define INCREMENTAL_DATA(i) i /* Generates incremental test data */ +#ifdef DYNAMIC_FILTER +#define SET_FILTER(dcpl) H5Pset_filter(dcpl, filter_id, flags, FILTER_NUM_CDVALUES, cd_values) /* Test other filter in parallel */ +#else +#define SET_FILTER(dcpl) H5Pset_deflate(dcpl, 6) /* Test GZIP filter in parallel */ +#endif + +/* Defines for the one-chunk filtered dataset test */ +#define ONE_CHUNK_FILTERED_DATASET_NAME "one_chunk_filtered_dataset" +#define ONE_CHUNK_FILTERED_DATASET_DIMS 2 +#define ONE_CHUNK_FILTERED_DATASET_NROWS 16 /* Must be an even multiple of the number of ranks to avoid issues */ +#define ONE_CHUNK_FILTERED_DATASET_NCOLS 8 /* Must be an even multiple of the number of ranks to avoid issues */ +#define ONE_CHUNK_FILTERED_DATASET_CH_NROWS ONE_CHUNK_FILTERED_DATASET_NROWS +#define ONE_CHUNK_FILTERED_DATASET_CH_NCOLS ONE_CHUNK_FILTERED_DATASET_NCOLS + +/* Defines for the unshared filtered chunks write test */ +#define UNSHARED_FILTERED_CHUNKS_DATASET_NAME "unshared_filtered_chunks" +#define UNSHARED_FILTERED_CHUNKS_DATASET_DIMS 2 +#define UNSHARED_FILTERED_CHUNKS_NROWS 16 +#define UNSHARED_FILTERED_CHUNKS_NCOLS 8 +#define UNSHARED_FILTERED_CHUNKS_CH_NROWS (UNSHARED_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) +#define UNSHARED_FILTERED_CHUNKS_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) + +/* Defines for the shared filtered chunks write test */ +#define SHARED_FILTERED_CHUNKS_DATASET_NAME "shared_filtered_chunks" +#define SHARED_FILTERED_CHUNKS_DATASET_DIMS 2 +#define SHARED_FILTERED_CHUNKS_NROWS 16 +#define SHARED_FILTERED_CHUNKS_NCOLS 8 +#define SHARED_FILTERED_CHUNKS_CH_NROWS (SHARED_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) +#define SHARED_FILTERED_CHUNKS_CH_NCOLS (SHARED_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) + +/* Defines for the filtered chunks write test where a process has no selection */ +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME "single_no_selection_filtered_chunks" +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS 16 +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS 8 +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS (SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS (SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC 3 + +/* Defines for the filtered chunks write test where no process has a selection */ +#define ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME "all_no_selection_filtered_chunks" +#define ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 +#define ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS 16 +#define ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS 8 +#define ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS (ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) +#define ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS (ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) +#define ALL_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC 3 + +/* Defines for the filtered chunks write test with a point selection */ +#define POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME "point_selection_filtered_chunks" +#define POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 +#define POINT_SELECTION_FILTERED_CHUNKS_NROWS 16 +#define POINT_SELECTION_FILTERED_CHUNKS_NCOLS 8 +#define POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS (POINT_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) +#define POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS (POINT_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) +#define POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS ((POINT_SELECTION_FILTERED_CHUNKS_NROWS / POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS) * (POINT_SELECTION_FILTERED_CHUNKS_NCOLS / POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS)) + +/* Defines for the filtered dataset interleaved write test */ +#define INTERLEAVED_WRITE_FILTERED_DATASET_NAME "interleaved_write_filtered_dataset" +#define INTERLEAVED_WRITE_FILTERED_DATASET_DIMS 2 +#define INTERLEAVED_WRITE_FILTERED_DATASET_NROWS 16 /* Must be an even multiple of the number of ranks to avoid issues */ +#define INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS 8 /* Must be an even multiple of the number of ranks to avoid issues */ +#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS (INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / NUM_MPI_RANKS) +#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS (INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / NUM_MPI_RANKS) +#define INTERLEAVED_WRITE_FILTERED_DATASET_SEL_NPOINTS (INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS * INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS / INTERLEAVED_WRITE_FILTERED_DATASET_NUM_RANKS) + +/* Defines for the 3D unshared filtered dataset separate page write test */ +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME "3d_unshared_filtered_chunks_separate_pages" +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS 3 +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS 16 +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS 8 +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DEPTH NUM_MPI_RANKS +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS (UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS / NUM_MPI_RANKS) +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS / NUM_MPI_RANKS) + +/* Defines for the 3D unshared filtered dataset same page write test */ +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME "3d_unshared_filtered_chunks_same_pages" +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS 3 +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS 16 +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS 8 +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH NUM_MPI_RANKS +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS (UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS / NUM_MPI_RANKS) +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS / NUM_MPI_RANKS) + +/* Defines for the 3d shared filtered dataset write test */ +#define SHARED_FILTERED_CHUNKS_3D_DATASET_NAME "3d_shared_filtered_chunks" +#define SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS 3 +#define SHARED_FILTERED_CHUNKS_3D_NROWS 16 +#define SHARED_FILTERED_CHUNKS_3D_NCOLS 8 +#define SHARED_FILTERED_CHUNKS_3D_DEPTH NUM_MPI_RANKS +#define SHARED_FILTERED_CHUNKS_3D_CH_NROWS (SHARED_FILTERED_CHUNKS_3D_NROWS / NUM_MPI_RANKS) +#define SHARED_FILTERED_CHUNKS_3D_CH_NCOLS (SHARED_FILTERED_CHUNKS_3D_NCOLS / NUM_MPI_RANKS) + +/* Struct type for the compound datatype filtered dataset tests */ +typedef struct { + short field1; + int field2; + long field3; + double field4; +} cmpd_filtered_t; + +/* Defines for the compound datatype filtered dataset no conversion write test with unshared chunks */ +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_NAME "compound_unshared_filtered_chunks_no_conversion" +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS 2 +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NROWS 1 +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS 1 +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS 1 +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS / NUM_MPI_RANKS + +/* Defines for the compound datatype filtered dataset no conversion write test with shared chunks */ +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_NAME "compound_shared_filtered_chunks_no_conversion" +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS 2 +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NROWS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS 1 +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS + +/* Defines for the compound datatype filtered dataset type conversion write test with unshared chunks */ +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_NAME "compound_unshared_filtered_chunks_type_conversion" +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS 2 +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NROWS 1 +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS 1 +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS 1 +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS / NUM_MPI_RANKS + +/* Defines for the compound datatype filtered dataset type conversion write test with shared chunks */ +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_NAME "compound_shared_filtered_chunks_type_conversion" +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS 2 +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NROWS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS 1 +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS + +#endif /* TEST_PARALLEL_FILTERS_H_ */ -- cgit v0.12 From 6abd4e9d1675b211c91be32010e4abca30a7fd8a Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 3 Aug 2017 11:56:05 -0500 Subject: Move test files to testpar directory --- MANIFEST | 4 +- test/Makefile.am | 4 +- test/tfilters_parallel.c | 2243 ----------------------------------------- test/tfilters_parallel.h | 190 ---- testpar/Makefile.am | 2 +- testpar/t_filters_parallel.c | 2250 ++++++++++++++++++++++++++++++++++++++++++ testpar/t_filters_parallel.h | 190 ++++ 7 files changed, 2445 insertions(+), 2438 deletions(-) delete mode 100644 test/tfilters_parallel.c delete mode 100644 test/tfilters_parallel.h create mode 100644 testpar/t_filters_parallel.c create mode 100644 testpar/t_filters_parallel.h diff --git a/MANIFEST b/MANIFEST index d61d392..beaad19 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1070,8 +1070,6 @@ ./test/testswmr.sh.in ./test/testvdsswmr.sh.in ./test/tfile.c -./test/tfilters_parallel.c -./test/tfilters_parallel.h ./test/tgenprop.c ./test/th5o.c ./test/th5s.c @@ -1232,6 +1230,8 @@ ./testpar/t_file.c ./testpar/t_file_image.c ./testpar/t_filter_read.c +./testpar/tfilters_parallel.c +./testpar/tfilters_parallel.h ./testpar/t_mdset.c ./testpar/t_mpi.c ./testpar/t_ph5basic.c diff --git a/test/Makefile.am b/test/Makefile.am index 0d80396..f64b6d8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -79,7 +79,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ links_env filenotclosed flushrefresh use_append_chunk use_append_mchunks use_disable_mdc_flushes \ swmr_generator swmr_start_write swmr_reader swmr_writer swmr_remove_reader \ swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer \ - swmr_check_compat_vfd vds_swmr_gen vds_swmr_reader vds_swmr_writer tfilters_parallel + swmr_check_compat_vfd vds_swmr_gen vds_swmr_reader vds_swmr_writer if HAVE_SHARED_CONDITIONAL check_PROGRAMS+= plugin endif @@ -203,7 +203,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse flushrefresh_VERIFICATION_DONE atomic_data accum_swmr_big.h5 ohdr_swmr.h5 \ test_swmr*.h5 cache_logging.h5 cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 \ swmr[0-2].h5 swmr_writer.out swmr_writer.log.* swmr_reader.out.* swmr_reader.log.* \ - tbogus.h5.copy cache_image_test.h5 tfilters_parallel.h5 + tbogus.h5.copy cache_image_test.h5 # Sources for testhdf5 executable testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ diff --git a/test/tfilters_parallel.c b/test/tfilters_parallel.c deleted file mode 100644 index 213e939..0000000 --- a/test/tfilters_parallel.c +++ /dev/null @@ -1,2243 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * Programmer: Jordan Henderson - * 01/31/2017 - * - * This file contains tests for writing to and reading from - * datasets in parallel with filters applied to the data. - */ - -#include "tfilters_parallel.h" - -#define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0]) - -static int test_one_chunk_filtered_dataset(void); -static int test_filtered_dataset_no_overlap(void); -static int test_filtered_dataset_overlap(void); -static int test_filtered_dataset_single_no_selection(void); -static int test_filtered_dataset_all_no_selection(void); -static int test_filtered_dataset_point_selection(void); -static int test_filtered_dataset_interleaved_write(void); -static int test_3d_filtered_dataset_no_overlap_separate_pages(void); -static int test_3d_filtered_dataset_no_overlap_same_pages(void); -static int test_3d_filtered_dataset_overlap(void); -static int test_32d_filtered_dataset_no_overlap_separate_pages(void); -static int test_32d_filtered_dataset_no_overlap_same_pages(void); -static int test_32d_filtered_dataset_overlap(void); -static int test_cmpd_filtered_dataset_no_conversion_unshared(void); -static int test_cmpd_filtered_dataset_no_conversion_shared(void); -static int test_cmpd_filtered_dataset_type_conversion_unshared(void); -static int test_cmpd_filtered_dataset_type_conversion_shared(void); -static int test_write_serial_read_parallel(void); -static int test_write_parallel_read_serial(void); - -static int read_outfile(char* filename, char* datasetname); - -static MPI_Comm comm = MPI_COMM_WORLD; -static MPI_Info info = MPI_INFO_NULL; -static int mpi_rank; -static int mpi_size; - -static int (*tests[])(void) = { - test_one_chunk_filtered_dataset, - test_filtered_dataset_no_overlap, - test_filtered_dataset_overlap, - test_filtered_dataset_single_no_selection, - test_filtered_dataset_all_no_selection, - test_filtered_dataset_point_selection, - test_filtered_dataset_interleaved_write, - test_3d_filtered_dataset_no_overlap_separate_pages, - test_3d_filtered_dataset_no_overlap_same_pages, - test_3d_filtered_dataset_overlap, - test_32d_filtered_dataset_no_overlap_separate_pages, - test_32d_filtered_dataset_no_overlap_same_pages, - test_32d_filtered_dataset_overlap, - test_cmpd_filtered_dataset_no_conversion_unshared, - test_cmpd_filtered_dataset_no_conversion_shared, - test_cmpd_filtered_dataset_type_conversion_unshared, - test_cmpd_filtered_dataset_type_conversion_shared, - test_write_serial_read_parallel, - test_write_parallel_read_serial, -}; - -/* - * Tests parallel write of filtered data in the special - * case where a dataset is composed of a single chunk. - * - * Programmer: Jordan Henderson - * 02/01/2017 - */ -static int -test_one_chunk_filtered_dataset() -{ - C_DATATYPE *data = NULL; - hsize_t dataset_dims[ONE_CHUNK_FILTERED_DATASET_DIMS]; - hsize_t chunk_dims[ONE_CHUNK_FILTERED_DATASET_DIMS]; - hsize_t sel_dims[ONE_CHUNK_FILTERED_DATASET_DIMS]; - hsize_t count[ONE_CHUNK_FILTERED_DATASET_DIMS]; - hsize_t stride[ONE_CHUNK_FILTERED_DATASET_DIMS]; - hsize_t block[ONE_CHUNK_FILTERED_DATASET_DIMS]; - hsize_t offset[ONE_CHUNK_FILTERED_DATASET_DIMS]; - size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing one-chunk filtered dataset"); - - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - dataset_dims[0] = ONE_CHUNK_FILTERED_DATASET_NROWS; - dataset_dims[1] = ONE_CHUNK_FILTERED_DATASET_NCOLS; - chunk_dims[0] = ONE_CHUNK_FILTERED_DATASET_CH_NROWS; - chunk_dims[1] = ONE_CHUNK_FILTERED_DATASET_CH_NCOLS; - sel_dims[0] = ONE_CHUNK_FILTERED_DATASET_NROWS / NUM_MPI_RANKS; - sel_dims[1] = ONE_CHUNK_FILTERED_DATASET_NCOLS; - - if ((filespace = H5Screate_simple(ONE_CHUNK_FILTERED_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(ONE_CHUNK_FILTERED_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - - if (H5Pset_chunk(plist_id, ONE_CHUNK_FILTERED_DATASET_DIMS, chunk_dims) < 0) - goto error; - - if (SET_FILTER(plist_id) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, ONE_CHUNK_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - count[0] = 1; - count[1] = 1; - stride[0] = ONE_CHUNK_FILTERED_DATASET_CH_NROWS; - stride[1] = ONE_CHUNK_FILTERED_DATASET_CH_NCOLS; - block[0] = sel_dims[0]; - block[1] = sel_dims[1]; - offset[0] = (mpi_rank * sel_dims[0]); - offset[1] = 0; - - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", - mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); - - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; - - data_size = ONE_CHUNK_FILTERED_DATASET_CH_NROWS * ONE_CHUNK_FILTERED_DATASET_NCOLS * sizeof(*data); - - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } - - for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); - - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** ONE-CHUNK FILTERED DATASET TEST FAILED ***"); - - ret_value = 1; - -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -/* - * Tests parallel write of filtered data in the case where only - * one process is writing to a particular chunk in the operation. - * In this case, the write operation can be optimized because - * chunks do not have to be redistributed to new owners. - * - * Programmer: Jordan Henderson - * 02/01/2017 - */ -static int -test_filtered_dataset_no_overlap() -{ - C_DATATYPE *data = NULL; - hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t chunk_dims[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t sel_dims[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t count[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t stride[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t block[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t offset[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; - size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing write to unshared filtered chunks"); - - /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - /* Create the dataspace for the dataset */ - dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_NROWS; - dataset_dims[1] = UNSHARED_FILTERED_CHUNKS_NCOLS; - chunk_dims[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; - chunk_dims[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; - sel_dims[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; - sel_dims[1] = UNSHARED_FILTERED_CHUNKS_NCOLS; - - if ((filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) - goto error; - - /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - /* Each process defines the dataset selection in memory and writes - * it to the hyperslab in the file - */ - count[0] = 1; - count[1] = UNSHARED_FILTERED_CHUNKS_NCOLS / UNSHARED_FILTERED_CHUNKS_CH_NCOLS; - stride[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; - stride[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; - block[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; - block[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; - offset[0] = (mpi_rank * UNSHARED_FILTERED_CHUNKS_CH_NROWS * count[0]); - offset[1] = 0; - - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", - mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); - - /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; - - /* Fill data buffer */ - data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } - - for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); - - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** UNSHARED FILTERED CHUNKS WRITE TEST FAILED ***"); - - ret_value = 1; - -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -/* - * Tests parallel write of filtered data in the case where - * more than one process is writing to a particular chunk - * in the operation. In this case, the chunks have to be - * redistributed before the operation so that only one process - * writes to a particular chunk. - * - * Programmer: Jordan Henderson - * 02/01/2017 - */ -static int -test_filtered_dataset_overlap() -{ - C_DATATYPE *data = NULL; - hsize_t dataset_dims[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t chunk_dims[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t sel_dims[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t count[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t stride[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t block[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t offset[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; - size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing write to shared filtered chunks"); - - /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - /* Create the dataspace for the dataset */ - dataset_dims[0] = SHARED_FILTERED_CHUNKS_NROWS; - dataset_dims[1] = SHARED_FILTERED_CHUNKS_NCOLS; - chunk_dims[0] = SHARED_FILTERED_CHUNKS_CH_NROWS; - chunk_dims[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; - sel_dims[0] = SHARED_FILTERED_CHUNKS_CH_NROWS; - sel_dims[1] = SHARED_FILTERED_CHUNKS_NCOLS; - - if ((filespace = H5Screate_simple(SHARED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(SHARED_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, SHARED_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) - goto error; - - /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, SHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - /* Each process defines the dataset selection in memory and writes - * it to the hyperslab in the file - */ - count[0] = SHARED_FILTERED_CHUNKS_NROWS / SHARED_FILTERED_CHUNKS_CH_NROWS; - count[1] = SHARED_FILTERED_CHUNKS_NCOLS / SHARED_FILTERED_CHUNKS_CH_NCOLS; - stride[0] = SHARED_FILTERED_CHUNKS_CH_NROWS; - stride[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; - block[0] = 1; - block[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; - offset[0] = mpi_rank; - offset[1] = 0; - - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", - mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); - - /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; - - /* Fill data buffer */ - data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } - - for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); - - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** SHARED FILTERED CHUNKS WRITE TEST FAILED ***"); - - ret_value = 1; - -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -/* - * Tests parallel write of filtered data in the case where - * a single process in the write operation has no selection - * in the datasets dataspace. In this case, the process with - * no selection still has to participate in the collective - * space re-allocation for the filtered chunks and also must - * participate in the re-insertion of the filtered chunks - * into the chunk index. - * - * Programmer: Jordan Henderson - * 02/01/2017 - */ -static int -test_filtered_dataset_single_no_selection() -{ - C_DATATYPE *data = NULL; - hsize_t dataset_dims[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t chunk_dims[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t sel_dims[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t count[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t stride[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t block[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t offset[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing write to filtered chunks with a single process having no selection"); - - /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - /* Create the dataspace for the dataset */ - dataset_dims[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS; - dataset_dims[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS; - chunk_dims[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; - chunk_dims[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; - sel_dims[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; - sel_dims[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS; - - if (mpi_rank == SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) - sel_dims[0] = sel_dims[1] = 0; - - if ((filespace = H5Screate_simple(SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) - goto error; - - /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - /* Each process defines the dataset selection in memory and writes - * it to the hyperslab in the file - */ - count[0] = 1; - count[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS / SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; - stride[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; - stride[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; - block[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; - block[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; - offset[0] = mpi_rank * SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS * count[0]; - offset[1] = 0; - - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", - mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); - - /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - - if (mpi_rank == SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) { - if (H5Sselect_none(filespace) < 0) - goto error; - } - else { - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; - } - - /* Fill data buffer */ - data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } - - for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); - - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** SINGLE NO SELECTION FILTERED CHUNKS WRITE TEST FAILED ***"); - - ret_value = 1; - -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -/* - * Tests parallel write of filtered data in the case - * where no process in the write operation has a - * selection in the datasets dataspace. This test is - * to ensure that there are no assertion failures or - * similar issues due to size 0 allocations and the - * like. In this case, the file and dataset are created - * but the dataset is populated with the default fill - * value. - * - * Programmer: Jordan Henderson - * 02/02/2017 - */ -static int -test_filtered_dataset_all_no_selection() -{ - C_DATATYPE *data = NULL; - hsize_t dataset_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t chunk_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t sel_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing write to filtered chunks with all processes having no selection"); - - /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - /* Create the dataspace for the dataset */ - dataset_dims[0] = ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS; - dataset_dims[1] = ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS; - chunk_dims[0] = ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; - chunk_dims[1] = ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; - sel_dims[0] = sel_dims[1] = 0; - - if ((filespace = H5Screate_simple(ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) - goto error; - - /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_none(filespace) < 0) - goto error; - - /* Fill data buffer */ - data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } - - for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); - - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** ALL NO SELECTION FILTERED CHUNKS WRITE TEST FAILED ***"); - - ret_value = 1; - -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -/* - * Tests parallel write of filtered data by using - * point selections instead of hyperslab selections. - * - * Programmer: Jordan Henderson - * 02/02/2017 - */ -static int -test_filtered_dataset_point_selection() -{ - C_DATATYPE *data = NULL; - hsize_t coords[2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS][POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t dataset_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t chunk_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t sel_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - size_t i, j, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing write to filtered chunks with point selection"); - - /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - /* Create the dataspace for the dataset */ - dataset_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_NROWS; - dataset_dims[1] = POINT_SELECTION_FILTERED_CHUNKS_NCOLS; - chunk_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS; - chunk_dims[1] = POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS; - sel_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS; - sel_dims[1] = POINT_SELECTION_FILTERED_CHUNKS_NCOLS; - - if ((filespace = H5Screate_simple(POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) - goto error; - - /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - /* Set up point selection */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - - for (i = 0; i < 2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS; i++) - for (j = 0; j < POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS; j++) { - if (j > 0) - coords[i][j] = i % POINT_SELECTION_FILTERED_CHUNKS_NCOLS; - else - coords[i][j] = mpi_rank + ((i / POINT_SELECTION_FILTERED_CHUNKS_NCOLS) * POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS); - } - - if (H5Sselect_elements(filespace, H5S_SELECT_SET, 2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS, (const hsize_t *) coords) < 0) - goto error; - - /* Fill data buffer */ - data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } - - for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); - - - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** POINT SELECTION FILTERED CHUNKS WRITE TEST FAILED ***"); - - ret_value = 1; - -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -/* - * Tests parallel write of filtered data in the case where - * each process writes an equal amount of data to each chunk - * in the dataset. Each chunk is distributed among the - * processes in round-robin fashion by blocks of size 1 until - * the whole chunk is selected, leading to an interleaved - * write pattern. - * - * Programmer: Jordan Henderson - * 02/02/2017 - */ -static int -test_filtered_dataset_interleaved_write() -{ - C_DATATYPE *data = NULL; - hsize_t dataset_dims[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; - hsize_t chunk_dims[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; - hsize_t sel_dims[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; - hsize_t count[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; - hsize_t stride[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; - hsize_t block[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; - hsize_t offset[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; - size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing interleaved write to filtered chunks"); - - /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - /* Create the dataspace for the dataset */ - dataset_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_NROWS; - dataset_dims[1] = INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS; - chunk_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS; - chunk_dims[1] = INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS; - sel_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / 2; - sel_dims[1] = INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / 2; - - if ((filespace = H5Screate_simple(INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, chunk_dims) < 0) - goto error; - - /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, INTERLEAVED_WRITE_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - /* Each process defines the dataset selection in memory and writes - * it to the hyperslab in the file - */ - count[0] = SHARED_FILTERED_CHUNKS_NROWS / 2; - count[1] = SHARED_FILTERED_CHUNKS_NCOLS / 2; - stride[0] = 2; - stride[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; - block[0] = 1; - block[1] = 1; - offset[0] = mpi_rank / SHARED_FILTERED_CHUNKS_CH_NCOLS; - offset[1] = mpi_rank % SHARED_FILTERED_CHUNKS_CH_NCOLS; - - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", - mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); - - /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; - - /* Fill data buffer */ - data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } - - for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); - - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** INTERLEAVED FILTERED CHUNK WRITE TEST FAILED ***"); - - ret_value = 1; - -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -/* - * Tests parallel write of filtered data in the case where - * the dataset has 3 dimensions and each process writes - * to its own "page" in the 3rd dimension. - * - * Programmer: Jordan Henderson - * 02/06/2017 - */ -static int -test_3d_filtered_dataset_no_overlap_separate_pages() -{ - C_DATATYPE *data = NULL; - hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; - hsize_t chunk_dims[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; - hsize_t sel_dims[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; - hsize_t count[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; - hsize_t stride[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; - hsize_t block[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; - hsize_t offset[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; - size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing write to unshared filtered chunks on separate pages in 3D dataset"); - - /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - /* Create the dataspace for the dataset */ - dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS; - dataset_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS; - dataset_dims[2] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DEPTH; - chunk_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; - chunk_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; - chunk_dims[2] = 1; - sel_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS; - sel_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS; - sel_dims[2] = 1; - - if ((filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, chunk_dims) < 0) - goto error; - - /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - /* Each process defines the dataset selection in memory and writes - * it to the hyperslab in the file - */ - count[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS / UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; - count[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS / UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; - count[2] = 1; - stride[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; - stride[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; - stride[2] = 1; - block[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; - block[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; - block[2] = 1; - offset[0] = 0; - offset[1] = 0; - offset[2] = mpi_rank; - - printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", - mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); - - /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; - - /* Fill data buffer */ - data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); - - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } - - for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); - - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** 3D UNSHARED FILTERED CHUNKS SEPARATE PAGE TEST FAILED ***"); - - ret_value = 1; - -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -/* - * Tests parallel write of filtered data in the case where - * the dataset has 3 dimensions and each process writes - * to each "page" in the 3rd dimension. However, no chunk - * on a given "page" is written to by more than one process. - * - * Programmer: Jordan Henderson - * 02/06/2017 - */ -static int -test_3d_filtered_dataset_no_overlap_same_pages() -{ - C_DATATYPE *data = NULL; - hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; - hsize_t chunk_dims[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; - hsize_t sel_dims[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; - hsize_t count[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; - hsize_t stride[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; - hsize_t block[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; - hsize_t offset[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; - size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing write to unshared filtered chunks on the same pages in 3D dataset"); - - /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - /* Create the dataspace for the dataset */ - dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS; - dataset_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS; - dataset_dims[2] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH; - chunk_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; - chunk_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; - chunk_dims[2] = 1; - sel_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; - sel_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS; - sel_dims[2] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH; - - if ((filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, chunk_dims) < 0) - goto error; - - /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - /* Each process defines the dataset selection in memory and writes - * it to the hyperslab in the file - */ - count[0] = 1; - count[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS / UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; - count[2] = NUM_MPI_RANKS; - stride[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; - stride[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; - stride[2] = 1; - block[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; - block[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; - block[2] = 1; - offset[0] = (mpi_rank * UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS * count[0]); - offset[1] = 0; - offset[2] = 0; - - printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", - mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); - - /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; - - /* Fill data buffer */ - data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); - - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } - - for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); - - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** 3D UNSHARED FILTERED CHUNKS SAME PAGE TEST FAILED ***"); - - ret_value = 1; - -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -/* - * Tests parallel write of filtered data in the case where - * the dataset has 3 dimensions and each process writes - * to each "page" in the 3rd dimension. Further, each chunk - * in each "page" is written to equally by all processes. - * - * Programmer: Jordan Henderson - * 02/06/2017 - */ -static int -test_3d_filtered_dataset_overlap() -{ - C_DATATYPE *data = NULL; - hsize_t dataset_dims[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; - hsize_t chunk_dims[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; - hsize_t sel_dims[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; - hsize_t count[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; - hsize_t stride[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; - hsize_t block[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; - hsize_t offset[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; - size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing write to shared filtered chunks in 3D dataset"); - - /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - /* Create the dataspace for the dataset */ - dataset_dims[0] = SHARED_FILTERED_CHUNKS_3D_NROWS; - dataset_dims[1] = SHARED_FILTERED_CHUNKS_3D_NCOLS; - dataset_dims[2] = SHARED_FILTERED_CHUNKS_3D_DEPTH; - chunk_dims[0] = SHARED_FILTERED_CHUNKS_3D_CH_NROWS; - chunk_dims[1] = SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; - chunk_dims[2] = 1; - sel_dims[0] = SHARED_FILTERED_CHUNKS_3D_NROWS / 2; - sel_dims[1] = SHARED_FILTERED_CHUNKS_3D_NCOLS / 2; - sel_dims[2] = SHARED_FILTERED_CHUNKS_3D_DEPTH; - - if ((filespace = H5Screate_simple(SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, chunk_dims) < 0) - goto error; - - /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, SHARED_FILTERED_CHUNKS_3D_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - /* Each process defines the dataset selection in memory and writes - * it to the hyperslab in the file - */ - count[0] = SHARED_FILTERED_CHUNKS_3D_NROWS / 2; - count[1] = SHARED_FILTERED_CHUNKS_3D_NCOLS / 2; - count[2] = SHARED_FILTERED_CHUNKS_3D_DEPTH; - stride[0] = 2; - stride[1] = SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; - stride[2] = 1; - block[0] = 1; - block[1] = 1; - block[2] = 1; - offset[0] = mpi_rank / SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; - offset[1] = mpi_rank % SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; - offset[2] = 0; - - printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", - mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); - - /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; - - /* Fill data buffer */ - data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); - - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } - - for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); - - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** 3D SHARED FILTERED CHUNKS TEST FAILED ***"); - - ret_value = 1; - -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -static int -test_32d_filtered_dataset_no_overlap_separate_pages(void) -{ - return 1; -} - -static int -test_32d_filtered_dataset_no_overlap_same_pages(void) -{ - return 1; -} - -static int -test_32d_filtered_dataset_overlap(void) -{ - return 1; -} - -/* - * Tests parallel write of filtered data to unshared - * chunks using a compound datatype which doesn't - * require a datatype conversion. - * - * Programmer: Jordan Henderson - * 02/10/2017 - */ -static int -test_cmpd_filtered_dataset_no_conversion_unshared() -{ - cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC]; - hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t count[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t stride[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t block[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t offset[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - size_t i; - hid_t file_id, dset_id, plist_id, memtype; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing write to unshared filtered chunks in Compound Datatype dataset without Datatype conversion"); - - /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - /* Create the dataspace for the dataset */ - dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NROWS; - dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS; - chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; - chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS; - sel_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; - sel_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; - - if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, chunk_dims) < 0) - goto error; - - /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - /* Create the compound type for memory. */ - if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) - goto error; - if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) - goto error; - if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) - goto error; - if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) - goto error; - if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_NAME, memtype, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - /* Each process defines the dataset selection in memory and writes - * it to the hyperslab in the file - */ - count[0] = 1; - count[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; - stride[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; - stride[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS; - block[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; - block[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS; - offset[0] = 0; - offset[1] = (mpi_rank * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS); - - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", - mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); - - /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; - - /* Fill data buffer */ - memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC); - for (i = 0; i < COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) - data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); - - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS NO CONVERSION UNSHARED TEST FAILED ***"); - - ret_value = 1; - -exit: - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Tclose(memtype) < 0) - fprintf(stderr, "Unable to close mem type\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -/* - * Tests parallel write of filtered data to shared - * chunks using a compound datatype which doesn't - * require a datatype conversion. - * - * Programmer: Jordan Henderson - * 02/10/2017 - */ -static int -test_cmpd_filtered_dataset_no_conversion_shared() -{ - cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC]; - hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t count[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t stride[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t block[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t offset[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - size_t i; - hid_t file_id, dset_id, plist_id, memtype; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing write to shared filtered chunks in Compound Datatype dataset without Datatype conversion"); - - /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - /* Create the dataspace for the dataset */ - dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NROWS; - dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS; - chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS; - chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; - sel_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; - sel_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; - - if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, chunk_dims) < 0) - goto error; - - /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - /* Create the compound type for memory. */ - if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) - goto error; - if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) - goto error; - if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) - goto error; - if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) - goto error; - if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_NAME, memtype, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - /* Each process defines the dataset selection in memory and writes - * it to the hyperslab in the file - */ - count[0] = 1; - count[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; - stride[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS; - stride[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; - block[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; - block[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; - offset[0] = mpi_rank; - offset[1] = 0; - - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", - mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); - - /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; - - /* Fill data buffer */ - memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC); - for (i = 0; i < COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) - data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); - - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS NO CONVERSION SHARED TEST FAILED ***"); - - ret_value = 1; - -exit: - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Tclose(memtype) < 0) - fprintf(stderr, "Unable to close mem type\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -/* - * Tests parallel write of filtered data to unshared - * chunks using a compound datatype which requires a - * datatype conversion. - * - * This test currently fails because the datatype - * conversion causes the parallel library to break - * to independent I/O and this isn't allowed when - * there are filters in the pipeline. - * - * Programmer: Jordan Henderson - * 02/07/2017 - */ -static int -test_cmpd_filtered_dataset_type_conversion_unshared() -{ - cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC]; - hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t count[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t stride[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t block[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t offset[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - size_t i; - hid_t file_id, dset_id, plist_id, filetype, memtype; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing write to unshared filtered chunks in Compound Datatype dataset with Datatype conversion"); - - /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - /* Create the dataspace for the dataset */ - dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NROWS; - dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS; - chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; - chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS; - sel_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; - sel_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; - - if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, chunk_dims) < 0) - goto error; - - /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - /* Create the compound type for memory. */ - if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) - goto error; - if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) - goto error; - if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) - goto error; - if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) - goto error; - if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) - goto error; - - /* Create the compound type for file. */ - if ((filetype = H5Tcreate(H5T_COMPOUND, 32)) < 0) - goto error; - if (H5Tinsert(filetype, "ShortData", 0, H5T_STD_I64BE) < 0) - goto error; - if (H5Tinsert(filetype, "IntData", 8, H5T_STD_I64BE) < 0) - goto error; - if (H5Tinsert(filetype, "LongData", 16, H5T_STD_I64BE) < 0) - goto error; - if (H5Tinsert(filetype, "DoubleData", 24, H5T_IEEE_F64BE) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_NAME, filetype, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - /* Each process defines the dataset selection in memory and writes - * it to the hyperslab in the file - */ - count[0] = 1; - count[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; - stride[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; - stride[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS; - block[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; - block[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS; - offset[0] = 0; - offset[1] = (mpi_rank * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS); - - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", - mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); - - /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; - - /* Fill data buffer */ - memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC); - for (i = 0; i < COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) - data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); - - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS TYPE CONVERSION UNSHARED TEST FAILED ***"); - - ret_value = 1; - -exit: - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Tclose(filetype) < 0) - fprintf(stderr, "Unable to close file type\n"); - if (H5Tclose(memtype) < 0) - fprintf(stderr, "Unable to close mem type\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -/* - * Tests parallel write of filtered data to shared - * chunks using a compound datatype which requires - * a datatype conversion. - * - * This test currently fails because the datatype - * conversion causes the parallel library to break - * to independent I/O and this isn't allowed when - * there are filters in the pipeline. - * - * Programmer: Jordan Henderson - * 02/10/2017 - */ -static int -test_cmpd_filtered_dataset_type_conversion_shared() -{ - cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC]; - hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t count[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t stride[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t block[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t offset[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - size_t i; - hid_t file_id, dset_id, plist_id, filetype, memtype; - hid_t filespace, memspace; - int ret_value = 0; - - if (mpi_rank == 0) puts("Testing write to shared filtered chunks in Compound Datatype dataset with Datatype conversion"); - - /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - /* Create the dataspace for the dataset */ - dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NROWS; - dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS; - chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS; - chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; - sel_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; - sel_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; - - if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; - - /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, chunk_dims) < 0) - goto error; - - /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - /* Create the compound type for memory. */ - if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) - goto error; - if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) - goto error; - if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) - goto error; - if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) - goto error; - if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) - goto error; - - /* Create the compound type for file. */ - if ((filetype = H5Tcreate(H5T_COMPOUND, 32)) < 0) - goto error; - if (H5Tinsert(filetype, "ShortData", 0, H5T_STD_I64BE) < 0) - goto error; - if (H5Tinsert(filetype, "IntData", 8, H5T_STD_I64BE) < 0) - goto error; - if (H5Tinsert(filetype, "LongData", 16, H5T_STD_I64BE) < 0) - goto error; - if (H5Tinsert(filetype, "DoubleData", 24, H5T_IEEE_F64BE) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_NAME, filetype, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - /* Each process defines the dataset selection in memory and writes - * it to the hyperslab in the file - */ - count[0] = 1; - count[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; - stride[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS; - stride[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; - block[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; - block[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; - offset[0] = mpi_rank; - offset[1] = 0; - - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", - mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); - - /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; - - /* Fill data buffer */ - memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC); - for (i = 0; i < COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) - data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); - - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) - goto error; - - goto exit; - -error: - if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS TYPE CONVERSION SHARED TEST FAILED ***"); - - ret_value = 1; - -exit: - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Tclose(filetype) < 0) - fprintf(stderr, "Unable to close file type\n"); - if (H5Tclose(memtype) < 0) - fprintf(stderr, "Unable to close mem type\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; -} - -static int -read_outfile(char* filename, char* datasetname) -{ - H5Z_filter_t filter_type; - C_DATATYPE *rbuf = NULL; - unsigned flags, filter_info; - hsize_t *dims, *maxdims; - size_t i, j, k, nelmts, buf_size; - hid_t file_id, dset_id, plist_id, creation_plist, dspace_id; - int num_filters, ndims; - - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - - if ((file_id = H5Fopen(filename, H5F_ACC_RDONLY, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - if ((dset_id = H5Dopen(file_id, datasetname, H5P_DEFAULT)) < 0) - goto error; - - if ((dspace_id = H5Dget_space(dset_id)) < 0) - goto error; - - if ((creation_plist = H5Dget_create_plist(dset_id)) < 0) - goto error; - - if ((num_filters = H5Pget_nfilters(creation_plist)) < 0) - goto error; - - if (mpi_rank == 0) { - printf("Number of filters: %i\n", num_filters); - - for (i = 0; i < num_filters; i++) { - nelmts = 0; - if ((filter_type = H5Pget_filter2(creation_plist, 0, &flags, &nelmts, NULL, 0, - NULL, &filter_info)) < 0) - goto error; - - printf("Filter Type: "); - switch (filter_type) { - case H5Z_FILTER_DEFLATE: - printf("H5Z_FILTER_DEFLATE\n"); - break; - case H5Z_FILTER_SZIP: - printf("H5Z_FILTER_SZIP\n"); - break; - default: - printf("Other filter type included.\n"); - } - } - } - - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if ((ndims = H5Sget_simple_extent_ndims(dspace_id)) < 0) - goto error; - if (NULL == (dims = malloc(ndims * sizeof(*dims)))) - goto error; - if (NULL == (maxdims = malloc(ndims * sizeof(*dims)))) - goto error; - - if (H5Sget_simple_extent_dims(dspace_id, dims, maxdims) < 0) - goto error; - - buf_size = 0; - for (i = 0; i < ndims; i++) - buf_size += dims[i] * sizeof(*rbuf); - - if (NULL == (rbuf = malloc(buf_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } - - if (H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, rbuf) < 0) - goto error; - - if (mpi_rank == 0) { - /* Only set up for use in 2D and 3D cases */ - if (ndims > 2) { - for (i = 0; i < dims[0]; i++) - for (j = 0; j < dims[1]; j++) - for (k = 0; k < dims[2]; k++) - printf("(%zu, %zu): %ld\n", i, j, rbuf[(i * dims[1]) + j]); - } - else { - for (i = 0; i < dims[0]; i++) - for (j = 0; j < dims[1]; j++) - printf("(%zu, %zu): %ld\n", i, j, rbuf[(i * dims[1]) + j]); - } - } - - free(rbuf); - if (H5Dclose(dset_id) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Pclose(creation_plist) < 0) - goto error; - if (H5Fclose(file_id) < 0) - goto error; - - return 0; - -error: - if (rbuf) - free(rbuf); - if (dims) - free(dims); - if (maxdims) - free(maxdims); - - return 1; -} - -static int -test_write_serial_read_parallel(void) -{ - return 1; -} - -static int -test_write_parallel_read_serial(void) -{ - return 1; -} - -int -main(int argc, char** argv) -{ - size_t i; - hid_t file_id, fapl; - int mpi_code; - int nerrors = 0; - - /* Initialize MPI */ - MPI_Init(&argc, &argv); - MPI_Comm_size(comm, &mpi_size); - MPI_Comm_rank(comm, &mpi_rank); - - if (mpi_size != NUM_MPI_RANKS) { - printf("These tests are set up to use %d ranks.\n", NUM_MPI_RANKS); - printf("Quitting...\n"); - return 0; - } - - /* Create test file */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto exit; - if (H5Pset_fapl_mpio(fapl, comm, info) < 0) - goto exit; - if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto exit; - if (H5Fclose(file_id) < 0) - goto exit; - - for (i = 0; i < ARRAY_SIZE(tests); i++) { - if (MPI_SUCCESS == (mpi_code = MPI_Barrier(comm))) { - nerrors += (*tests[i])(); - } else { - if (mpi_rank == 0) fprintf(stderr, "MPI_Barrier failed"); - nerrors++; - } - } - - if (nerrors) goto exit; - - puts("All Parallel Filters tests passed\n"); - -exit: - if (H5Pclose(fapl) < 0) - fprintf(stderr, "Couldn't close fapl.\n"); - - if (nerrors) - if (mpi_rank == 0) printf("*** %d TEST%s FAILED ***\n", nerrors, nerrors > 1 ? "S" : ""); - - MPI_Finalize(); - - exit(EXIT_SUCCESS); -} diff --git a/test/tfilters_parallel.h b/test/tfilters_parallel.h deleted file mode 100644 index 631b417..0000000 --- a/test/tfilters_parallel.h +++ /dev/null @@ -1,190 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * Programmer: Jordan Henderson - * 01/31/2017 - * - * This file contains #defines for tests of the use - * of filters in parallel HDF5, implemented in - * H5Dmpio.c - */ - -#ifndef TEST_PARALLEL_FILTERS_H_ -#define TEST_PARALLEL_FILTERS_H_ - -#include - -#include "stdlib.h" -#include "h5test.h" - -/* Used to load other filters than GZIP */ -/* #define DYNAMIC_FILTER */ /* Uncomment and define the fields below to use a dynamically loaded filter */ -#define FILTER_NUM_CDVALUES 1 -const unsigned int cd_values[FILTER_NUM_CDVALUES]; -H5Z_filter_t filter_id; -unsigned int flags = 0; -size_t cd_nelmts = FILTER_NUM_CDVALUES; - -/* Utility Macros */ -#define STRINGIFY(type) #type - -/* Common defines for all tests */ -#define FILENAME "tfilters_parallel.h5" -#define NUM_MPI_RANKS 4 -#define C_DATATYPE long -#define C_DATATYPE_STR(type) STRINGIFY(type) -#define HDF5_DATATYPE_NAME H5T_NATIVE_LONG -#define GEN_DATA(i) RANK_DATA(i) /* Given an index value i, generates test data based upon selected mode */ -#define RANK_DATA(i) (mpi_rank) /* Generates test data to visibly show which rank wrote to which parts of the dataset */ -#define INCREMENTAL_DATA(i) i /* Generates incremental test data */ -#ifdef DYNAMIC_FILTER -#define SET_FILTER(dcpl) H5Pset_filter(dcpl, filter_id, flags, FILTER_NUM_CDVALUES, cd_values) /* Test other filter in parallel */ -#else -#define SET_FILTER(dcpl) H5Pset_deflate(dcpl, 6) /* Test GZIP filter in parallel */ -#endif - -/* Defines for the one-chunk filtered dataset test */ -#define ONE_CHUNK_FILTERED_DATASET_NAME "one_chunk_filtered_dataset" -#define ONE_CHUNK_FILTERED_DATASET_DIMS 2 -#define ONE_CHUNK_FILTERED_DATASET_NROWS 16 /* Must be an even multiple of the number of ranks to avoid issues */ -#define ONE_CHUNK_FILTERED_DATASET_NCOLS 8 /* Must be an even multiple of the number of ranks to avoid issues */ -#define ONE_CHUNK_FILTERED_DATASET_CH_NROWS ONE_CHUNK_FILTERED_DATASET_NROWS -#define ONE_CHUNK_FILTERED_DATASET_CH_NCOLS ONE_CHUNK_FILTERED_DATASET_NCOLS - -/* Defines for the unshared filtered chunks write test */ -#define UNSHARED_FILTERED_CHUNKS_DATASET_NAME "unshared_filtered_chunks" -#define UNSHARED_FILTERED_CHUNKS_DATASET_DIMS 2 -#define UNSHARED_FILTERED_CHUNKS_NROWS 16 -#define UNSHARED_FILTERED_CHUNKS_NCOLS 8 -#define UNSHARED_FILTERED_CHUNKS_CH_NROWS (UNSHARED_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) -#define UNSHARED_FILTERED_CHUNKS_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) - -/* Defines for the shared filtered chunks write test */ -#define SHARED_FILTERED_CHUNKS_DATASET_NAME "shared_filtered_chunks" -#define SHARED_FILTERED_CHUNKS_DATASET_DIMS 2 -#define SHARED_FILTERED_CHUNKS_NROWS 16 -#define SHARED_FILTERED_CHUNKS_NCOLS 8 -#define SHARED_FILTERED_CHUNKS_CH_NROWS (SHARED_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) -#define SHARED_FILTERED_CHUNKS_CH_NCOLS (SHARED_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) - -/* Defines for the filtered chunks write test where a process has no selection */ -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME "single_no_selection_filtered_chunks" -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS 16 -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS 8 -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS (SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS (SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC 3 - -/* Defines for the filtered chunks write test where no process has a selection */ -#define ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME "all_no_selection_filtered_chunks" -#define ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 -#define ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS 16 -#define ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS 8 -#define ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS (ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) -#define ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS (ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) -#define ALL_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC 3 - -/* Defines for the filtered chunks write test with a point selection */ -#define POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME "point_selection_filtered_chunks" -#define POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 -#define POINT_SELECTION_FILTERED_CHUNKS_NROWS 16 -#define POINT_SELECTION_FILTERED_CHUNKS_NCOLS 8 -#define POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS (POINT_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) -#define POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS (POINT_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) -#define POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS ((POINT_SELECTION_FILTERED_CHUNKS_NROWS / POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS) * (POINT_SELECTION_FILTERED_CHUNKS_NCOLS / POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS)) - -/* Defines for the filtered dataset interleaved write test */ -#define INTERLEAVED_WRITE_FILTERED_DATASET_NAME "interleaved_write_filtered_dataset" -#define INTERLEAVED_WRITE_FILTERED_DATASET_DIMS 2 -#define INTERLEAVED_WRITE_FILTERED_DATASET_NROWS 16 /* Must be an even multiple of the number of ranks to avoid issues */ -#define INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS 8 /* Must be an even multiple of the number of ranks to avoid issues */ -#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS (INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / NUM_MPI_RANKS) -#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS (INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / NUM_MPI_RANKS) -#define INTERLEAVED_WRITE_FILTERED_DATASET_SEL_NPOINTS (INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS * INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS / INTERLEAVED_WRITE_FILTERED_DATASET_NUM_RANKS) - -/* Defines for the 3D unshared filtered dataset separate page write test */ -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME "3d_unshared_filtered_chunks_separate_pages" -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS 3 -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS 16 -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS 8 -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DEPTH NUM_MPI_RANKS -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS (UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS / NUM_MPI_RANKS) -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS / NUM_MPI_RANKS) - -/* Defines for the 3D unshared filtered dataset same page write test */ -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME "3d_unshared_filtered_chunks_same_pages" -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS 3 -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS 16 -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS 8 -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH NUM_MPI_RANKS -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS (UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS / NUM_MPI_RANKS) -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS / NUM_MPI_RANKS) - -/* Defines for the 3d shared filtered dataset write test */ -#define SHARED_FILTERED_CHUNKS_3D_DATASET_NAME "3d_shared_filtered_chunks" -#define SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS 3 -#define SHARED_FILTERED_CHUNKS_3D_NROWS 16 -#define SHARED_FILTERED_CHUNKS_3D_NCOLS 8 -#define SHARED_FILTERED_CHUNKS_3D_DEPTH NUM_MPI_RANKS -#define SHARED_FILTERED_CHUNKS_3D_CH_NROWS (SHARED_FILTERED_CHUNKS_3D_NROWS / NUM_MPI_RANKS) -#define SHARED_FILTERED_CHUNKS_3D_CH_NCOLS (SHARED_FILTERED_CHUNKS_3D_NCOLS / NUM_MPI_RANKS) - -/* Struct type for the compound datatype filtered dataset tests */ -typedef struct { - short field1; - int field2; - long field3; - double field4; -} cmpd_filtered_t; - -/* Defines for the compound datatype filtered dataset no conversion write test with unshared chunks */ -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_NAME "compound_unshared_filtered_chunks_no_conversion" -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS 2 -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NROWS 1 -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS NUM_MPI_RANKS -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS 1 -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS 1 -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS / NUM_MPI_RANKS - -/* Defines for the compound datatype filtered dataset no conversion write test with shared chunks */ -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_NAME "compound_shared_filtered_chunks_no_conversion" -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS 2 -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NROWS NUM_MPI_RANKS -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS NUM_MPI_RANKS -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS NUM_MPI_RANKS -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS 1 -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS - -/* Defines for the compound datatype filtered dataset type conversion write test with unshared chunks */ -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_NAME "compound_unshared_filtered_chunks_type_conversion" -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS 2 -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NROWS 1 -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS NUM_MPI_RANKS -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS 1 -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS 1 -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS / NUM_MPI_RANKS - -/* Defines for the compound datatype filtered dataset type conversion write test with shared chunks */ -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_NAME "compound_shared_filtered_chunks_type_conversion" -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS 2 -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NROWS NUM_MPI_RANKS -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS NUM_MPI_RANKS -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS NUM_MPI_RANKS -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS 1 -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS - -#endif /* TEST_PARALLEL_FILTERS_H_ */ diff --git a/testpar/Makefile.am b/testpar/Makefile.am index b87c1df..90bdd04 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -23,7 +23,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test # Test programs. These are our main targets. # -TEST_PROG_PARA=t_mpi testphdf5 t_cache t_cache_image t_pflush1 t_pflush2 t_pshutdown t_prestart t_init_term t_shapesame +TEST_PROG_PARA=t_mpi testphdf5 t_cache t_cache_image t_pflush1 t_pflush2 t_pshutdown t_prestart t_init_term t_shapesame t_filters_parallel check_PROGRAMS = $(TEST_PROG_PARA) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c new file mode 100644 index 0000000..0de0350 --- /dev/null +++ b/testpar/t_filters_parallel.c @@ -0,0 +1,2250 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Jordan Henderson + * 01/31/2017 + * + * This file contains tests for writing to and reading from + * datasets in parallel with filters applied to the data. + */ + +#include "t_filters_parallel.h" + +#define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0]) + +static int test_one_chunk_filtered_dataset(void); +static int test_filtered_dataset_no_overlap(void); +static int test_filtered_dataset_overlap(void); +static int test_filtered_dataset_single_no_selection(void); +static int test_filtered_dataset_all_no_selection(void); +static int test_filtered_dataset_point_selection(void); +static int test_filtered_dataset_interleaved_write(void); +static int test_3d_filtered_dataset_no_overlap_separate_pages(void); +static int test_3d_filtered_dataset_no_overlap_same_pages(void); +static int test_3d_filtered_dataset_overlap(void); +static int test_32d_filtered_dataset_no_overlap_separate_pages(void); +static int test_32d_filtered_dataset_no_overlap_same_pages(void); +static int test_32d_filtered_dataset_overlap(void); +static int test_cmpd_filtered_dataset_no_conversion_unshared(void); +static int test_cmpd_filtered_dataset_no_conversion_shared(void); +static int test_cmpd_filtered_dataset_type_conversion_unshared(void); +static int test_cmpd_filtered_dataset_type_conversion_shared(void); +static int test_write_serial_read_parallel(void); +static int test_write_parallel_read_serial(void); + +static int read_outfile(char* filename, char* datasetname); + +static MPI_Comm comm = MPI_COMM_WORLD; +static MPI_Info info = MPI_INFO_NULL; +static int mpi_rank; +static int mpi_size; + +static int (*tests[])(void) = { + test_one_chunk_filtered_dataset, + test_filtered_dataset_no_overlap, + test_filtered_dataset_overlap, + test_filtered_dataset_single_no_selection, + test_filtered_dataset_all_no_selection, + test_filtered_dataset_point_selection, + test_filtered_dataset_interleaved_write, + test_3d_filtered_dataset_no_overlap_separate_pages, + test_3d_filtered_dataset_no_overlap_same_pages, + test_3d_filtered_dataset_overlap, + test_32d_filtered_dataset_no_overlap_separate_pages, + test_32d_filtered_dataset_no_overlap_same_pages, + test_32d_filtered_dataset_overlap, + test_cmpd_filtered_dataset_no_conversion_unshared, + test_cmpd_filtered_dataset_no_conversion_shared, + test_cmpd_filtered_dataset_type_conversion_unshared, + test_cmpd_filtered_dataset_type_conversion_shared, + test_write_serial_read_parallel, + test_write_parallel_read_serial, +}; + +/* + * Tests parallel write of filtered data in the special + * case where a dataset is composed of a single chunk. + * + * Programmer: Jordan Henderson + * 02/01/2017 + */ +static int +test_one_chunk_filtered_dataset() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[ONE_CHUNK_FILTERED_DATASET_DIMS]; + hsize_t chunk_dims[ONE_CHUNK_FILTERED_DATASET_DIMS]; + hsize_t sel_dims[ONE_CHUNK_FILTERED_DATASET_DIMS]; + hsize_t count[ONE_CHUNK_FILTERED_DATASET_DIMS]; + hsize_t stride[ONE_CHUNK_FILTERED_DATASET_DIMS]; + hsize_t block[ONE_CHUNK_FILTERED_DATASET_DIMS]; + hsize_t offset[ONE_CHUNK_FILTERED_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id = -1, dset_id = -1, plist_id = -1; + hid_t filespace = -1, memspace = -1; + int ret_value = 0; + + if (mpi_rank == 0) TESTING("one-chunk filtered dataset"); + + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + dataset_dims[0] = ONE_CHUNK_FILTERED_DATASET_NROWS; + dataset_dims[1] = ONE_CHUNK_FILTERED_DATASET_NCOLS; + chunk_dims[0] = ONE_CHUNK_FILTERED_DATASET_CH_NROWS; + chunk_dims[1] = ONE_CHUNK_FILTERED_DATASET_CH_NCOLS; + sel_dims[0] = ONE_CHUNK_FILTERED_DATASET_NROWS / NUM_MPI_RANKS; + sel_dims[1] = ONE_CHUNK_FILTERED_DATASET_NCOLS; + + if ((filespace = H5Screate_simple(ONE_CHUNK_FILTERED_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(ONE_CHUNK_FILTERED_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + + if (H5Pset_chunk(plist_id, ONE_CHUNK_FILTERED_DATASET_DIMS, chunk_dims) < 0) + goto error; + + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, ONE_CHUNK_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + count[0] = 1; + count[1] = 1; + stride[0] = ONE_CHUNK_FILTERED_DATASET_CH_NROWS; + stride[1] = ONE_CHUNK_FILTERED_DATASET_CH_NCOLS; + block[0] = sel_dims[0]; + block[1] = sel_dims[1]; + offset[0] = (mpi_rank * sel_dims[0]); + offset[1] = 0; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + data_size = ONE_CHUNK_FILTERED_DATASET_CH_NROWS * ONE_CHUNK_FILTERED_DATASET_NCOLS * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + H5E_BEGIN_TRY { + free(data); + H5Dclose(dset_id); + H5Sclose(filespace); + H5Sclose(memspace); + H5Pclose(plist_id); + H5Fclose(file_id); + } H5E_END_TRY; + + return 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where only + * one process is writing to a particular chunk in the operation. + * In this case, the write operation can be optimized because + * chunks do not have to be redistributed to new owners. + * + * Programmer: Jordan Henderson + * 02/01/2017 + */ +static int +test_filtered_dataset_no_overlap() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t chunk_dims[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t sel_dims[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t count[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t stride[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t block[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t offset[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to unshared filtered chunks"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = UNSHARED_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; + sel_dims[1] = UNSHARED_FILTERED_CHUNKS_NCOLS; + + if ((filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = UNSHARED_FILTERED_CHUNKS_NCOLS / UNSHARED_FILTERED_CHUNKS_CH_NCOLS; + stride[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; + stride[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; + block[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; + block[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; + offset[0] = (mpi_rank * UNSHARED_FILTERED_CHUNKS_CH_NROWS * count[0]); + offset[1] = 0; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** UNSHARED FILTERED CHUNKS WRITE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where + * more than one process is writing to a particular chunk + * in the operation. In this case, the chunks have to be + * redistributed before the operation so that only one process + * writes to a particular chunk. + * + * Programmer: Jordan Henderson + * 02/01/2017 + */ +static int +test_filtered_dataset_overlap() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t chunk_dims[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t sel_dims[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t count[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t stride[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t block[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t offset[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to shared filtered chunks"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = SHARED_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = SHARED_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = SHARED_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = SHARED_FILTERED_CHUNKS_CH_NROWS; + sel_dims[1] = SHARED_FILTERED_CHUNKS_NCOLS; + + if ((filespace = H5Screate_simple(SHARED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(SHARED_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, SHARED_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, SHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = SHARED_FILTERED_CHUNKS_NROWS / SHARED_FILTERED_CHUNKS_CH_NROWS; + count[1] = SHARED_FILTERED_CHUNKS_NCOLS / SHARED_FILTERED_CHUNKS_CH_NCOLS; + stride[0] = SHARED_FILTERED_CHUNKS_CH_NROWS; + stride[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; + block[0] = 1; + block[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; + offset[0] = mpi_rank; + offset[1] = 0; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** SHARED FILTERED CHUNKS WRITE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where + * a single process in the write operation has no selection + * in the datasets dataspace. In this case, the process with + * no selection still has to participate in the collective + * space re-allocation for the filtered chunks and also must + * participate in the re-insertion of the filtered chunks + * into the chunk index. + * + * Programmer: Jordan Henderson + * 02/01/2017 + */ +static int +test_filtered_dataset_single_no_selection() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t chunk_dims[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t sel_dims[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t count[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t stride[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t block[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t offset[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to filtered chunks with a single process having no selection"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + sel_dims[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS; + + if (mpi_rank == SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) + sel_dims[0] = sel_dims[1] = 0; + + if ((filespace = H5Screate_simple(SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS / SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + stride[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + stride[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + block[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + block[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + offset[0] = mpi_rank * SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS * count[0]; + offset[1] = 0; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + + if (mpi_rank == SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) { + if (H5Sselect_none(filespace) < 0) + goto error; + } + else { + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + } + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** SINGLE NO SELECTION FILTERED CHUNKS WRITE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case + * where no process in the write operation has a + * selection in the datasets dataspace. This test is + * to ensure that there are no assertion failures or + * similar issues due to size 0 allocations and the + * like. In this case, the file and dataset are created + * but the dataset is populated with the default fill + * value. + * + * Programmer: Jordan Henderson + * 02/02/2017 + */ +static int +test_filtered_dataset_all_no_selection() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t chunk_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t sel_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to filtered chunks with all processes having no selection"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = sel_dims[1] = 0; + + if ((filespace = H5Screate_simple(ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_none(filespace) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** ALL NO SELECTION FILTERED CHUNKS WRITE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data by using + * point selections instead of hyperslab selections. + * + * Programmer: Jordan Henderson + * 02/02/2017 + */ +static int +test_filtered_dataset_point_selection() +{ + C_DATATYPE *data = NULL; + hsize_t coords[2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS][POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t dataset_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t chunk_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t sel_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + size_t i, j, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to filtered chunks with point selection"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = POINT_SELECTION_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS; + sel_dims[1] = POINT_SELECTION_FILTERED_CHUNKS_NCOLS; + + if ((filespace = H5Screate_simple(POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Set up point selection */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + + for (i = 0; i < 2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS; i++) + for (j = 0; j < POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS; j++) { + if (j > 0) + coords[i][j] = i % POINT_SELECTION_FILTERED_CHUNKS_NCOLS; + else + coords[i][j] = mpi_rank + ((i / POINT_SELECTION_FILTERED_CHUNKS_NCOLS) * POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS); + } + + if (H5Sselect_elements(filespace, H5S_SELECT_SET, 2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS, (const hsize_t *) coords) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** POINT SELECTION FILTERED CHUNKS WRITE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where + * each process writes an equal amount of data to each chunk + * in the dataset. Each chunk is distributed among the + * processes in round-robin fashion by blocks of size 1 until + * the whole chunk is selected, leading to an interleaved + * write pattern. + * + * Programmer: Jordan Henderson + * 02/02/2017 + */ +static int +test_filtered_dataset_interleaved_write() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + hsize_t chunk_dims[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + hsize_t sel_dims[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + hsize_t count[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + hsize_t stride[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + hsize_t block[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + hsize_t offset[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing interleaved write to filtered chunks"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_NROWS; + dataset_dims[1] = INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS; + chunk_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS; + chunk_dims[1] = INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS; + sel_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / 2; + sel_dims[1] = INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / 2; + + if ((filespace = H5Screate_simple(INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, INTERLEAVED_WRITE_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = SHARED_FILTERED_CHUNKS_NROWS / 2; + count[1] = SHARED_FILTERED_CHUNKS_NCOLS / 2; + stride[0] = 2; + stride[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; + block[0] = 1; + block[1] = 1; + offset[0] = mpi_rank / SHARED_FILTERED_CHUNKS_CH_NCOLS; + offset[1] = mpi_rank % SHARED_FILTERED_CHUNKS_CH_NCOLS; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** INTERLEAVED FILTERED CHUNK WRITE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where + * the dataset has 3 dimensions and each process writes + * to its own "page" in the 3rd dimension. + * + * Programmer: Jordan Henderson + * 02/06/2017 + */ +static int +test_3d_filtered_dataset_no_overlap_separate_pages() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + hsize_t chunk_dims[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + hsize_t sel_dims[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + hsize_t count[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + hsize_t stride[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + hsize_t block[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + hsize_t offset[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to unshared filtered chunks on separate pages in 3D dataset"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS; + dataset_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS; + dataset_dims[2] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DEPTH; + chunk_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; + chunk_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; + chunk_dims[2] = 1; + sel_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS; + sel_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS; + sel_dims[2] = 1; + + if ((filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS / UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; + count[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS / UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; + count[2] = 1; + stride[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; + stride[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; + stride[2] = 1; + block[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; + block[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; + block[2] = 1; + offset[0] = 0; + offset[1] = 0; + offset[2] = mpi_rank; + + printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** 3D UNSHARED FILTERED CHUNKS SEPARATE PAGE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where + * the dataset has 3 dimensions and each process writes + * to each "page" in the 3rd dimension. However, no chunk + * on a given "page" is written to by more than one process. + * + * Programmer: Jordan Henderson + * 02/06/2017 + */ +static int +test_3d_filtered_dataset_no_overlap_same_pages() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + hsize_t chunk_dims[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + hsize_t sel_dims[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + hsize_t count[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + hsize_t stride[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + hsize_t block[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + hsize_t offset[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to unshared filtered chunks on the same pages in 3D dataset"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS; + dataset_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS; + dataset_dims[2] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH; + chunk_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; + chunk_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; + chunk_dims[2] = 1; + sel_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; + sel_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS; + sel_dims[2] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH; + + if ((filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS / UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; + count[2] = NUM_MPI_RANKS; + stride[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; + stride[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; + stride[2] = 1; + block[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; + block[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; + block[2] = 1; + offset[0] = (mpi_rank * UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS * count[0]); + offset[1] = 0; + offset[2] = 0; + + printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** 3D UNSHARED FILTERED CHUNKS SAME PAGE TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data in the case where + * the dataset has 3 dimensions and each process writes + * to each "page" in the 3rd dimension. Further, each chunk + * in each "page" is written to equally by all processes. + * + * Programmer: Jordan Henderson + * 02/06/2017 + */ +static int +test_3d_filtered_dataset_overlap() +{ + C_DATATYPE *data = NULL; + hsize_t dataset_dims[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + hsize_t chunk_dims[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + hsize_t sel_dims[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + hsize_t count[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + hsize_t stride[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + hsize_t block[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + hsize_t offset[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; + size_t i, data_size; + hid_t file_id, dset_id, plist_id; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to shared filtered chunks in 3D dataset"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = SHARED_FILTERED_CHUNKS_3D_NROWS; + dataset_dims[1] = SHARED_FILTERED_CHUNKS_3D_NCOLS; + dataset_dims[2] = SHARED_FILTERED_CHUNKS_3D_DEPTH; + chunk_dims[0] = SHARED_FILTERED_CHUNKS_3D_CH_NROWS; + chunk_dims[1] = SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + chunk_dims[2] = 1; + sel_dims[0] = SHARED_FILTERED_CHUNKS_3D_NROWS / 2; + sel_dims[1] = SHARED_FILTERED_CHUNKS_3D_NCOLS / 2; + sel_dims[2] = SHARED_FILTERED_CHUNKS_3D_DEPTH; + + if ((filespace = H5Screate_simple(SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, SHARED_FILTERED_CHUNKS_3D_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = SHARED_FILTERED_CHUNKS_3D_NROWS / 2; + count[1] = SHARED_FILTERED_CHUNKS_3D_NCOLS / 2; + count[2] = SHARED_FILTERED_CHUNKS_3D_DEPTH; + stride[0] = 2; + stride[1] = SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + stride[2] = 1; + block[0] = 1; + block[1] = 1; + block[2] = 1; + offset[0] = mpi_rank / SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + offset[1] = mpi_rank % SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + offset[2] = 0; + + printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); + + if (NULL == (data = malloc(data_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** 3D SHARED FILTERED CHUNKS TEST FAILED ***"); + + ret_value = 1; + +exit: + if (data) + free(data); + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +static int +test_32d_filtered_dataset_no_overlap_separate_pages(void) +{ + return 1; +} + +static int +test_32d_filtered_dataset_no_overlap_same_pages(void) +{ + return 1; +} + +static int +test_32d_filtered_dataset_overlap(void) +{ + return 1; +} + +/* + * Tests parallel write of filtered data to unshared + * chunks using a compound datatype which doesn't + * require a datatype conversion. + * + * Programmer: Jordan Henderson + * 02/10/2017 + */ +static int +test_cmpd_filtered_dataset_no_conversion_unshared() +{ + cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC]; + hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t count[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t stride[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t block[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t offset[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + size_t i; + hid_t file_id, dset_id, plist_id, memtype; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to unshared filtered chunks in Compound Datatype dataset without Datatype conversion"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NROWS; + dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS; + chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; + chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS; + sel_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; + sel_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; + + if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + /* Create the compound type for memory. */ + if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) + goto error; + if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) + goto error; + if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) + goto error; + if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) + goto error; + if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_NAME, memtype, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; + stride[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; + stride[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS; + block[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; + block[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS; + offset[0] = 0; + offset[1] = (mpi_rank * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS); + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC); + for (i = 0; i < COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) + data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS NO CONVERSION UNSHARED TEST FAILED ***"); + + ret_value = 1; + +exit: + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Tclose(memtype) < 0) + fprintf(stderr, "Unable to close mem type\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data to shared + * chunks using a compound datatype which doesn't + * require a datatype conversion. + * + * Programmer: Jordan Henderson + * 02/10/2017 + */ +static int +test_cmpd_filtered_dataset_no_conversion_shared() +{ + cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC]; + hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t count[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t stride[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t block[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t offset[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + size_t i; + hid_t file_id, dset_id, plist_id, memtype; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to shared filtered chunks in Compound Datatype dataset without Datatype conversion"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NROWS; + dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS; + chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS; + chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; + sel_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; + sel_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; + + if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + /* Create the compound type for memory. */ + if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) + goto error; + if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) + goto error; + if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) + goto error; + if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) + goto error; + if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_NAME, memtype, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; + stride[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS; + stride[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; + block[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; + block[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; + offset[0] = mpi_rank; + offset[1] = 0; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC); + for (i = 0; i < COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) + data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS NO CONVERSION SHARED TEST FAILED ***"); + + ret_value = 1; + +exit: + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Tclose(memtype) < 0) + fprintf(stderr, "Unable to close mem type\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data to unshared + * chunks using a compound datatype which requires a + * datatype conversion. + * + * This test currently fails because the datatype + * conversion causes the parallel library to break + * to independent I/O and this isn't allowed when + * there are filters in the pipeline. + * + * Programmer: Jordan Henderson + * 02/07/2017 + */ +static int +test_cmpd_filtered_dataset_type_conversion_unshared() +{ + cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC]; + hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t count[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t stride[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t block[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t offset[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + size_t i; + hid_t file_id, dset_id, plist_id, filetype, memtype; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to unshared filtered chunks in Compound Datatype dataset with Datatype conversion"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NROWS; + dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS; + chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; + chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS; + sel_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; + sel_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; + + if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + /* Create the compound type for memory. */ + if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) + goto error; + if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) + goto error; + if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) + goto error; + if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) + goto error; + if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) + goto error; + + /* Create the compound type for file. */ + if ((filetype = H5Tcreate(H5T_COMPOUND, 32)) < 0) + goto error; + if (H5Tinsert(filetype, "ShortData", 0, H5T_STD_I64BE) < 0) + goto error; + if (H5Tinsert(filetype, "IntData", 8, H5T_STD_I64BE) < 0) + goto error; + if (H5Tinsert(filetype, "LongData", 16, H5T_STD_I64BE) < 0) + goto error; + if (H5Tinsert(filetype, "DoubleData", 24, H5T_IEEE_F64BE) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_NAME, filetype, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; + stride[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; + stride[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS; + block[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; + block[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS; + offset[0] = 0; + offset[1] = (mpi_rank * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS); + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC); + for (i = 0; i < COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) + data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS TYPE CONVERSION UNSHARED TEST FAILED ***"); + + ret_value = 1; + +exit: + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Tclose(filetype) < 0) + fprintf(stderr, "Unable to close file type\n"); + if (H5Tclose(memtype) < 0) + fprintf(stderr, "Unable to close mem type\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +/* + * Tests parallel write of filtered data to shared + * chunks using a compound datatype which requires + * a datatype conversion. + * + * This test currently fails because the datatype + * conversion causes the parallel library to break + * to independent I/O and this isn't allowed when + * there are filters in the pipeline. + * + * Programmer: Jordan Henderson + * 02/10/2017 + */ +static int +test_cmpd_filtered_dataset_type_conversion_shared() +{ + cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC]; + hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t count[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t stride[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t block[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t offset[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + size_t i; + hid_t file_id, dset_id, plist_id, filetype, memtype; + hid_t filespace, memspace; + int ret_value = 0; + + if (mpi_rank == 0) puts("Testing write to shared filtered chunks in Compound Datatype dataset with Datatype conversion"); + + /* Set up file access property list with parallel I/O access */ + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + /* Create the dataspace for the dataset */ + dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NROWS; + dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS; + chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS; + chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; + sel_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; + sel_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; + + if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) + goto error; + if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, sel_dims, NULL)) < 0) + goto error; + + /* Create chunked dataset */ + if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, chunk_dims) < 0) + goto error; + + /* Add test filter to the pipeline */ + if (SET_FILTER(plist_id) < 0) + goto error; + + /* Create the compound type for memory. */ + if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) + goto error; + if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) + goto error; + if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) + goto error; + if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) + goto error; + if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) + goto error; + + /* Create the compound type for file. */ + if ((filetype = H5Tcreate(H5T_COMPOUND, 32)) < 0) + goto error; + if (H5Tinsert(filetype, "ShortData", 0, H5T_STD_I64BE) < 0) + goto error; + if (H5Tinsert(filetype, "IntData", 8, H5T_STD_I64BE) < 0) + goto error; + if (H5Tinsert(filetype, "LongData", 16, H5T_STD_I64BE) < 0) + goto error; + if (H5Tinsert(filetype, "DoubleData", 24, H5T_IEEE_F64BE) < 0) + goto error; + + if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_NAME, filetype, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Sclose(filespace) < 0) + goto error; + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; + stride[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS; + stride[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; + block[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; + block[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; + offset[0] = mpi_rank; + offset[1] = 0; + + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + + /* Select hyperslab in the file */ + if ((filespace = H5Dget_space(dset_id)) < 0) + goto error; + if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) + goto error; + + /* Fill data buffer */ + memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC); + for (i = 0; i < COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) + data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); + + /* Create property list for collective dataset write */ + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) + goto error; + + goto exit; + +error: + if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS TYPE CONVERSION SHARED TEST FAILED ***"); + + ret_value = 1; + +exit: + if (H5Dclose(dset_id) < 0) + fprintf(stderr, "Unable to close dataset\n"); + if (H5Sclose(filespace) < 0) + fprintf(stderr, "Unable to close filespace\n"); + if (H5Sclose(memspace) < 0) + fprintf(stderr, "Unable to close memspace\n"); + if (H5Tclose(filetype) < 0) + fprintf(stderr, "Unable to close file type\n"); + if (H5Tclose(memtype) < 0) + fprintf(stderr, "Unable to close mem type\n"); + if (H5Pclose(plist_id) < 0) + fprintf(stderr, "Unable to close plist\n"); + if (H5Fclose(file_id) < 0) + fprintf(stderr, "Unable to close file\n"); + + return ret_value; +} + +static int +read_outfile(char* filename, char* datasetname) +{ + H5Z_filter_t filter_type; + C_DATATYPE *rbuf = NULL; + unsigned flags, filter_info; + hsize_t *dims, *maxdims; + size_t i, j, k, nelmts, buf_size; + hid_t file_id, dset_id, plist_id, creation_plist, dspace_id; + int num_filters, ndims; + + if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) + goto error; + + if ((file_id = H5Fopen(filename, H5F_ACC_RDONLY, plist_id)) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + + if ((dset_id = H5Dopen(file_id, datasetname, H5P_DEFAULT)) < 0) + goto error; + + if ((dspace_id = H5Dget_space(dset_id)) < 0) + goto error; + + if ((creation_plist = H5Dget_create_plist(dset_id)) < 0) + goto error; + + if ((num_filters = H5Pget_nfilters(creation_plist)) < 0) + goto error; + + if (mpi_rank == 0) { + printf("Number of filters: %i\n", num_filters); + + for (i = 0; i < num_filters; i++) { + nelmts = 0; + if ((filter_type = H5Pget_filter2(creation_plist, 0, &flags, &nelmts, NULL, 0, + NULL, &filter_info)) < 0) + goto error; + + printf("Filter Type: "); + switch (filter_type) { + case H5Z_FILTER_DEFLATE: + printf("H5Z_FILTER_DEFLATE\n"); + break; + case H5Z_FILTER_SZIP: + printf("H5Z_FILTER_SZIP\n"); + break; + default: + printf("Other filter type included.\n"); + } + } + } + + if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + goto error; + if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) + goto error; + + if ((ndims = H5Sget_simple_extent_ndims(dspace_id)) < 0) + goto error; + if (NULL == (dims = malloc(ndims * sizeof(*dims)))) + goto error; + if (NULL == (maxdims = malloc(ndims * sizeof(*dims)))) + goto error; + + if (H5Sget_simple_extent_dims(dspace_id, dims, maxdims) < 0) + goto error; + + buf_size = 0; + for (i = 0; i < ndims; i++) + buf_size += dims[i] * sizeof(*rbuf); + + if (NULL == (rbuf = malloc(buf_size))) { + fprintf(stderr, "Couldn't allocate memory.\n"); + goto error; + } + + if (H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, rbuf) < 0) + goto error; + + if (mpi_rank == 0) { + /* Only set up for use in 2D and 3D cases */ + if (ndims > 2) { + for (i = 0; i < dims[0]; i++) + for (j = 0; j < dims[1]; j++) + for (k = 0; k < dims[2]; k++) + printf("(%zu, %zu): %ld\n", i, j, rbuf[(i * dims[1]) + j]); + } + else { + for (i = 0; i < dims[0]; i++) + for (j = 0; j < dims[1]; j++) + printf("(%zu, %zu): %ld\n", i, j, rbuf[(i * dims[1]) + j]); + } + } + + free(rbuf); + if (H5Dclose(dset_id) < 0) + goto error; + if (H5Pclose(plist_id) < 0) + goto error; + if (H5Pclose(creation_plist) < 0) + goto error; + if (H5Fclose(file_id) < 0) + goto error; + + return 0; + +error: + if (rbuf) + free(rbuf); + if (dims) + free(dims); + if (maxdims) + free(maxdims); + + return 1; +} + +static int +test_write_serial_read_parallel(void) +{ + return 1; +} + +static int +test_write_parallel_read_serial(void) +{ + return 1; +} + +int +main(int argc, char** argv) +{ + size_t i; + hid_t file_id, fapl; + int mpi_code; + int nerrors = 0; + + /* Initialize MPI */ + MPI_Init(&argc, &argv); + MPI_Comm_size(comm, &mpi_size); + MPI_Comm_rank(comm, &mpi_rank); + + if (mpi_size != NUM_MPI_RANKS) { + printf("These tests are set up to use %d ranks.\n", NUM_MPI_RANKS); + printf("Quitting...\n"); + return 0; + } + + /* Create test file */ + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto exit; + if (H5Pset_fapl_mpio(fapl, comm, info) < 0) + goto exit; + if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto exit; + + if ((file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + goto exit; + if (H5Fclose(file_id) < 0) + goto exit; + + for (i = 0; i < ARRAY_SIZE(tests); i++) { + if (MPI_SUCCESS == (mpi_code = MPI_Barrier(comm))) { + nerrors += (*tests[i])(); + } else { + if (mpi_rank == 0) fprintf(stderr, "MPI_Barrier failed"); + nerrors++; + } + } + + if (nerrors) goto exit; + + puts("All Parallel Filters tests passed\n"); + +exit: + if (H5Pclose(fapl) < 0) + fprintf(stderr, "Couldn't close fapl.\n"); + + if (nerrors) + if (mpi_rank == 0) printf("*** %d TEST%s FAILED ***\n", nerrors, nerrors > 1 ? "S" : ""); + + MPI_Finalize(); + + exit(EXIT_SUCCESS); +} diff --git a/testpar/t_filters_parallel.h b/testpar/t_filters_parallel.h new file mode 100644 index 0000000..5c5f07f --- /dev/null +++ b/testpar/t_filters_parallel.h @@ -0,0 +1,190 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Jordan Henderson + * 01/31/2017 + * + * This file contains #defines for tests of the use + * of filters in parallel HDF5, implemented in + * H5Dmpio.c + */ + +#ifndef TEST_PARALLEL_FILTERS_H_ +#define TEST_PARALLEL_FILTERS_H_ + +#include + +#include "stdlib.h" +#include "testpar.h" + +/* Used to load other filters than GZIP */ +/* #define DYNAMIC_FILTER */ /* Uncomment and define the fields below to use a dynamically loaded filter */ +#define FILTER_NUM_CDVALUES 1 +const unsigned int cd_values[FILTER_NUM_CDVALUES]; +H5Z_filter_t filter_id; +unsigned int flags = 0; +size_t cd_nelmts = FILTER_NUM_CDVALUES; + +/* Utility Macros */ +#define STRINGIFY(type) #type + +/* Common defines for all tests */ +#define FILENAME "tfilters_parallel.h5" +#define NUM_MPI_RANKS 4 +#define C_DATATYPE long +#define C_DATATYPE_STR(type) STRINGIFY(type) +#define HDF5_DATATYPE_NAME H5T_NATIVE_LONG +#define GEN_DATA(i) RANK_DATA(i) /* Given an index value i, generates test data based upon selected mode */ +#define RANK_DATA(i) (mpi_rank) /* Generates test data to visibly show which rank wrote to which parts of the dataset */ +#define INCREMENTAL_DATA(i) i /* Generates incremental test data */ +#ifdef DYNAMIC_FILTER +#define SET_FILTER(dcpl) H5Pset_filter(dcpl, filter_id, flags, FILTER_NUM_CDVALUES, cd_values) /* Test other filter in parallel */ +#else +#define SET_FILTER(dcpl) H5Pset_deflate(dcpl, 6) /* Test GZIP filter in parallel */ +#endif + +/* Defines for the one-chunk filtered dataset test */ +#define ONE_CHUNK_FILTERED_DATASET_NAME "one_chunk_filtered_dataset" +#define ONE_CHUNK_FILTERED_DATASET_DIMS 2 +#define ONE_CHUNK_FILTERED_DATASET_NROWS 16 /* Must be an even multiple of the number of ranks to avoid issues */ +#define ONE_CHUNK_FILTERED_DATASET_NCOLS 8 /* Must be an even multiple of the number of ranks to avoid issues */ +#define ONE_CHUNK_FILTERED_DATASET_CH_NROWS ONE_CHUNK_FILTERED_DATASET_NROWS +#define ONE_CHUNK_FILTERED_DATASET_CH_NCOLS ONE_CHUNK_FILTERED_DATASET_NCOLS + +/* Defines for the unshared filtered chunks write test */ +#define UNSHARED_FILTERED_CHUNKS_DATASET_NAME "unshared_filtered_chunks" +#define UNSHARED_FILTERED_CHUNKS_DATASET_DIMS 2 +#define UNSHARED_FILTERED_CHUNKS_NROWS 16 +#define UNSHARED_FILTERED_CHUNKS_NCOLS 8 +#define UNSHARED_FILTERED_CHUNKS_CH_NROWS (UNSHARED_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) +#define UNSHARED_FILTERED_CHUNKS_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) + +/* Defines for the shared filtered chunks write test */ +#define SHARED_FILTERED_CHUNKS_DATASET_NAME "shared_filtered_chunks" +#define SHARED_FILTERED_CHUNKS_DATASET_DIMS 2 +#define SHARED_FILTERED_CHUNKS_NROWS 16 +#define SHARED_FILTERED_CHUNKS_NCOLS 8 +#define SHARED_FILTERED_CHUNKS_CH_NROWS (SHARED_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) +#define SHARED_FILTERED_CHUNKS_CH_NCOLS (SHARED_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) + +/* Defines for the filtered chunks write test where a process has no selection */ +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME "single_no_selection_filtered_chunks" +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS 16 +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS 8 +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS (SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS (SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC 3 + +/* Defines for the filtered chunks write test where no process has a selection */ +#define ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME "all_no_selection_filtered_chunks" +#define ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 +#define ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS 16 +#define ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS 8 +#define ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS (ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) +#define ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS (ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) +#define ALL_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC 3 + +/* Defines for the filtered chunks write test with a point selection */ +#define POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME "point_selection_filtered_chunks" +#define POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 +#define POINT_SELECTION_FILTERED_CHUNKS_NROWS 16 +#define POINT_SELECTION_FILTERED_CHUNKS_NCOLS 8 +#define POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS (POINT_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) +#define POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS (POINT_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) +#define POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS ((POINT_SELECTION_FILTERED_CHUNKS_NROWS / POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS) * (POINT_SELECTION_FILTERED_CHUNKS_NCOLS / POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS)) + +/* Defines for the filtered dataset interleaved write test */ +#define INTERLEAVED_WRITE_FILTERED_DATASET_NAME "interleaved_write_filtered_dataset" +#define INTERLEAVED_WRITE_FILTERED_DATASET_DIMS 2 +#define INTERLEAVED_WRITE_FILTERED_DATASET_NROWS 16 /* Must be an even multiple of the number of ranks to avoid issues */ +#define INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS 8 /* Must be an even multiple of the number of ranks to avoid issues */ +#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS (INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / NUM_MPI_RANKS) +#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS (INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / NUM_MPI_RANKS) +#define INTERLEAVED_WRITE_FILTERED_DATASET_SEL_NPOINTS (INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS * INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS / INTERLEAVED_WRITE_FILTERED_DATASET_NUM_RANKS) + +/* Defines for the 3D unshared filtered dataset separate page write test */ +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME "3d_unshared_filtered_chunks_separate_pages" +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS 3 +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS 16 +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS 8 +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DEPTH NUM_MPI_RANKS +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS (UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS / NUM_MPI_RANKS) +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS / NUM_MPI_RANKS) + +/* Defines for the 3D unshared filtered dataset same page write test */ +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME "3d_unshared_filtered_chunks_same_pages" +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS 3 +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS 16 +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS 8 +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH NUM_MPI_RANKS +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS (UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS / NUM_MPI_RANKS) +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS / NUM_MPI_RANKS) + +/* Defines for the 3d shared filtered dataset write test */ +#define SHARED_FILTERED_CHUNKS_3D_DATASET_NAME "3d_shared_filtered_chunks" +#define SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS 3 +#define SHARED_FILTERED_CHUNKS_3D_NROWS 16 +#define SHARED_FILTERED_CHUNKS_3D_NCOLS 8 +#define SHARED_FILTERED_CHUNKS_3D_DEPTH NUM_MPI_RANKS +#define SHARED_FILTERED_CHUNKS_3D_CH_NROWS (SHARED_FILTERED_CHUNKS_3D_NROWS / NUM_MPI_RANKS) +#define SHARED_FILTERED_CHUNKS_3D_CH_NCOLS (SHARED_FILTERED_CHUNKS_3D_NCOLS / NUM_MPI_RANKS) + +/* Struct type for the compound datatype filtered dataset tests */ +typedef struct { + short field1; + int field2; + long field3; + double field4; +} cmpd_filtered_t; + +/* Defines for the compound datatype filtered dataset no conversion write test with unshared chunks */ +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_NAME "compound_unshared_filtered_chunks_no_conversion" +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS 2 +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NROWS 1 +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS 1 +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS 1 +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS / NUM_MPI_RANKS + +/* Defines for the compound datatype filtered dataset no conversion write test with shared chunks */ +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_NAME "compound_shared_filtered_chunks_no_conversion" +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS 2 +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NROWS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS 1 +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS + +/* Defines for the compound datatype filtered dataset type conversion write test with unshared chunks */ +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_NAME "compound_unshared_filtered_chunks_type_conversion" +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS 2 +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NROWS 1 +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS 1 +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS 1 +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS / NUM_MPI_RANKS + +/* Defines for the compound datatype filtered dataset type conversion write test with shared chunks */ +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_NAME "compound_shared_filtered_chunks_type_conversion" +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS 2 +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NROWS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS 1 +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS + +#endif /* TEST_PARALLEL_FILTERS_H_ */ -- cgit v0.12 From bf6954f6ba1e2970392a155437b76c3dd26d9670 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 3 Aug 2017 15:01:10 -0500 Subject: Updates to parallel filters tests --- testpar/t_filters_parallel.c | 346 ++++++++++++++++++++++--------------------- testpar/t_filters_parallel.h | 1 - 2 files changed, 175 insertions(+), 172 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 0de0350..cc4a6b6 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -23,6 +23,13 @@ #include "t_filters_parallel.h" +const char *FILENAME[] = { + "t_filters_parallel" +}; +char filenames[1][256]; + +int nerrors = 0; + #define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0]) static int test_one_chunk_filtered_dataset(void); @@ -82,7 +89,7 @@ static int (*tests[])(void) = { * 02/01/2017 */ static int -test_one_chunk_filtered_dataset() +test_one_chunk_filtered_dataset(void) { C_DATATYPE *data = NULL; hsize_t dataset_dims[ONE_CHUNK_FILTERED_DATASET_DIMS]; @@ -95,22 +102,23 @@ test_one_chunk_filtered_dataset() size_t i, data_size; hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - int ret_value = 0; - if (mpi_rank == 0) TESTING("one-chunk filtered dataset"); + if (MAINPROCESS) TESTING("one-chunk filtered dataset"); - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - TEST_ERROR - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; + /* Set up file access property list with parallel I/O access */ + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); + /* Create the dataspace for the dataset */ dataset_dims[0] = ONE_CHUNK_FILTERED_DATASET_NROWS; dataset_dims[1] = ONE_CHUNK_FILTERED_DATASET_NCOLS; chunk_dims[0] = ONE_CHUNK_FILTERED_DATASET_CH_NROWS; @@ -118,92 +126,77 @@ test_one_chunk_filtered_dataset() sel_dims[0] = ONE_CHUNK_FILTERED_DATASET_NROWS / NUM_MPI_RANKS; sel_dims[1] = ONE_CHUNK_FILTERED_DATASET_NCOLS; - if ((filespace = H5Screate_simple(ONE_CHUNK_FILTERED_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(ONE_CHUNK_FILTERED_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(ONE_CHUNK_FILTERED_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; + memspace = H5Screate_simple(ONE_CHUNK_FILTERED_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); - if (H5Pset_chunk(plist_id, ONE_CHUNK_FILTERED_DATASET_DIMS, chunk_dims) < 0) - goto error; + /* Create chunked dataset */ + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); - if (SET_FILTER(plist_id) < 0) - goto error; + VRFY((H5Pset_chunk(plist_id, ONE_CHUNK_FILTERED_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); - if ((dset_id = H5Dcreate(file_id, ONE_CHUNK_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; + /* Add test filter to the pipeline */ + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); + dset_id = H5Dcreate(file_id, ONE_CHUNK_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ count[0] = 1; count[1] = 1; stride[0] = ONE_CHUNK_FILTERED_DATASET_CH_NROWS; stride[1] = ONE_CHUNK_FILTERED_DATASET_CH_NCOLS; block[0] = sel_dims[0]; block[1] = sel_dims[1]; - offset[0] = (mpi_rank * sel_dims[0]); + offset[0] = ((hsize_t) mpi_rank * sel_dims[0]); offset[1] = 0; - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + if (VERBOSE_MED) + printf("Process %d: count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; + /* Select hyperslab in the file */ + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); + + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), + "Hyperslab selection succeeded"); + /* Fill data buffer */ data_size = ONE_CHUNK_FILTERED_DATASET_CH_NROWS * ONE_CHUNK_FILTERED_DATASET_NCOLS * sizeof(*data); - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } + data = (C_DATATYPE *) malloc(data_size); + VRFY((NULL != data), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; + /* Create property list for collective dataset write */ + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - goto exit; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); -error: - H5E_BEGIN_TRY { - free(data); - H5Dclose(dset_id); - H5Sclose(filespace); - H5Sclose(memspace); - H5Pclose(plist_id); - H5Fclose(file_id); - } H5E_END_TRY; + VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); - return 1; + if (data) free(data); -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); - return ret_value; + return 0; } /* @@ -216,7 +209,7 @@ exit: * 02/01/2017 */ static int -test_filtered_dataset_no_overlap() +test_filtered_dataset_no_overlap(void) { C_DATATYPE *data = NULL; hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; @@ -227,24 +220,24 @@ test_filtered_dataset_no_overlap() hsize_t block[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t offset[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; + hid_t file_id = -1, dset_id = -1, plist_id = -1; + hid_t filespace = -1, memspace = -1; int ret_value = 0; - if (mpi_rank == 0) puts("Testing write to unshared filtered chunks"); + if (MAINPROCESS) TESTING("write to unshared filtered chunks"); /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_NROWS; @@ -254,28 +247,27 @@ test_filtered_dataset_no_overlap() sel_dims[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; sel_dims[1] = UNSHARED_FILTERED_CHUNKS_NCOLS; - if ((filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation suceeded"); + + memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - if ((dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; + dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file @@ -286,60 +278,46 @@ test_filtered_dataset_no_overlap() stride[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; block[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; block[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; - offset[0] = (mpi_rank * UNSHARED_FILTERED_CHUNKS_CH_NROWS * count[0]); + offset[0] = ((hsize_t) mpi_rank * UNSHARED_FILTERED_CHUNKS_CH_NROWS * count[0]); offset[1] = 0; - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + if (VERBOSE_MED) + printf("Process %d: count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; + filespace = H5Dget_space(dset_id); + VRFY((dset_id >= 0), "File dataspace retrieval succeeded"); + + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), + "Hyperslab selection succeeded"); /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } + data = (C_DATATYPE *) malloc(data_size); + VRFY((NULL != data), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - goto exit; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); -error: - if (mpi_rank == 0) puts("*** UNSHARED FILTERED CHUNKS WRITE TEST FAILED ***"); + VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); - ret_value = 1; + if (data) free(data); -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); - return ret_value; + return 0; } /* @@ -353,7 +331,7 @@ exit: * 02/01/2017 */ static int -test_filtered_dataset_overlap() +test_filtered_dataset_overlap(void) { C_DATATYPE *data = NULL; hsize_t dataset_dims[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; @@ -492,7 +470,7 @@ exit: * 02/01/2017 */ static int -test_filtered_dataset_single_no_selection() +test_filtered_dataset_single_no_selection(void) { C_DATATYPE *data = NULL; hsize_t dataset_dims[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; @@ -642,7 +620,7 @@ exit: * 02/02/2017 */ static int -test_filtered_dataset_all_no_selection() +test_filtered_dataset_all_no_selection(void) { C_DATATYPE *data = NULL; hsize_t dataset_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; @@ -755,7 +733,7 @@ exit: * 02/02/2017 */ static int -test_filtered_dataset_point_selection() +test_filtered_dataset_point_selection(void) { C_DATATYPE *data = NULL; hsize_t coords[2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS][POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; @@ -885,7 +863,7 @@ exit: * 02/02/2017 */ static int -test_filtered_dataset_interleaved_write() +test_filtered_dataset_interleaved_write(void) { C_DATATYPE *data = NULL; hsize_t dataset_dims[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; @@ -1020,7 +998,7 @@ exit: * 02/06/2017 */ static int -test_3d_filtered_dataset_no_overlap_separate_pages() +test_3d_filtered_dataset_no_overlap_separate_pages(void) { C_DATATYPE *data = NULL; hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; @@ -1163,7 +1141,7 @@ exit: * 02/06/2017 */ static int -test_3d_filtered_dataset_no_overlap_same_pages() +test_3d_filtered_dataset_no_overlap_same_pages(void) { C_DATATYPE *data = NULL; hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; @@ -1306,7 +1284,7 @@ exit: * 02/06/2017 */ static int -test_3d_filtered_dataset_overlap() +test_3d_filtered_dataset_overlap(void) { C_DATATYPE *data = NULL; hsize_t dataset_dims[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; @@ -1466,7 +1444,7 @@ test_32d_filtered_dataset_overlap(void) * 02/10/2017 */ static int -test_cmpd_filtered_dataset_no_conversion_unshared() +test_cmpd_filtered_dataset_no_conversion_unshared(void) { cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC]; hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; @@ -1607,7 +1585,7 @@ exit: * 02/10/2017 */ static int -test_cmpd_filtered_dataset_no_conversion_shared() +test_cmpd_filtered_dataset_no_conversion_shared(void) { cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC]; hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; @@ -1753,7 +1731,7 @@ exit: * 02/07/2017 */ static int -test_cmpd_filtered_dataset_type_conversion_unshared() +test_cmpd_filtered_dataset_type_conversion_unshared(void) { cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC]; hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; @@ -1913,7 +1891,7 @@ exit: * 02/10/2017 */ static int -test_cmpd_filtered_dataset_type_conversion_shared() +test_cmpd_filtered_dataset_type_conversion_shared(void) { cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC]; hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; @@ -2196,9 +2174,8 @@ int main(int argc, char** argv) { size_t i; - hid_t file_id, fapl; + hid_t file_id = -1, fapl = -1; int mpi_code; - int nerrors = 0; /* Initialize MPI */ MPI_Init(&argc, &argv); @@ -2206,29 +2183,50 @@ main(int argc, char** argv) MPI_Comm_rank(comm, &mpi_rank); if (mpi_size != NUM_MPI_RANKS) { - printf("These tests are set up to use %d ranks.\n", NUM_MPI_RANKS); - printf("Quitting...\n"); - return 0; + if (MAINPROCESS) { + printf("These tests are set up to use %d ranks.\n", NUM_MPI_RANKS); + printf("Quitting...\n"); + } + + MPI_Abort(MPI_COMM_WORLD, 1); + } + + if (H5dont_atexit() < 0) { + printf("Failed to turn off atexit processing. Continue.\n"); + } + + H5open(); + + if (MAINPROCESS) { + printf("==========================\n"); + printf("Parallel Filters tests\n"); + printf("==========================\n\n"); } + if (VERBOSE_MED) h5_show_hostname(); + + ALARM_ON; + /* Create test file */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto exit; - if (H5Pset_fapl_mpio(fapl, comm, info) < 0) - goto exit; - if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; + fapl = H5Pcreate(H5P_FILE_ACCESS); + VRFY((fapl >= 0), "FAPL creation succeeded"); - if ((file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto exit; - if (H5Fclose(file_id) < 0) - goto exit; + VRFY((H5Pset_fapl_mpio(fapl, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0), "Set libver bounds succeeded"); + + VRFY((h5_fixname(FILENAME[0], fapl, filenames[0], sizeof(filenames[0])) != NULL), "Test file name created"); + + file_id = H5Fcreate(filenames[0], H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + VRFY((file_id >= 0), "Test file creation succeeded"); + + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); for (i = 0; i < ARRAY_SIZE(tests); i++) { if (MPI_SUCCESS == (mpi_code = MPI_Barrier(comm))) { - nerrors += (*tests[i])(); + (*tests[i])(); } else { - if (mpi_rank == 0) fprintf(stderr, "MPI_Barrier failed"); + if (MAINPROCESS) MESG("MPI_Barrier failed"); nerrors++; } } @@ -2238,13 +2236,19 @@ main(int argc, char** argv) puts("All Parallel Filters tests passed\n"); exit: + if (nerrors) + if (MAINPROCESS) printf("*** %d TEST ERROR%s OCCURRED ***\n", nerrors, nerrors > 1 ? "S" : ""); + + ALARM_OFF; + + h5_clean_files(FILENAME, fapl); + if (H5Pclose(fapl) < 0) - fprintf(stderr, "Couldn't close fapl.\n"); + MESG("Couldn't close FAPL.\n"); - if (nerrors) - if (mpi_rank == 0) printf("*** %d TEST%s FAILED ***\n", nerrors, nerrors > 1 ? "S" : ""); + H5close(); MPI_Finalize(); - exit(EXIT_SUCCESS); + exit((nerrors ? EXIT_FAILURE : EXIT_SUCCESS)); } diff --git a/testpar/t_filters_parallel.h b/testpar/t_filters_parallel.h index 5c5f07f..d627c27 100644 --- a/testpar/t_filters_parallel.h +++ b/testpar/t_filters_parallel.h @@ -42,7 +42,6 @@ size_t cd_nelmts = FILTER_NUM_CDVALUES; #define STRINGIFY(type) #type /* Common defines for all tests */ -#define FILENAME "tfilters_parallel.h5" #define NUM_MPI_RANKS 4 #define C_DATATYPE long #define C_DATATYPE_STR(type) STRINGIFY(type) -- cgit v0.12 From 46f8c941d7394d28befc660a7ab5532fa37a8e0f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 4 Aug 2017 16:45:40 -0500 Subject: HDFFV-10188 error on NULL dataspace --- tools/src/h5dump/h5dump_xml.c | 38 ++++++++++++++------------ tools/src/h5ls/h5ls.c | 62 ++++++++++++++++++++++--------------------- 2 files changed, 53 insertions(+), 47 deletions(-) diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 49d4f96..d731013 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -1959,28 +1959,32 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, H5Tclose(type); space = H5Aget_space(obj_id); + if(space == H5S_NULL || space == H5S_NO_CLASS) { + status = SUCCEED; + } + else { + ndims = H5Sget_simple_extent_dims(space, size, NULL); - ndims = H5Sget_simple_extent_dims(space, size, NULL); + for (i = 0; i < ndims; i++) + nelmts *= size[i]; - for (i = 0; i < ndims; i++) - nelmts *= size[i]; + buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)))); + HDassert(buf); - buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)))); - HDassert(buf); + if (H5Aread(obj_id, p_type, buf) >= 0) { + h5tools_context_t datactx; + HDmemset(&datactx, 0, sizeof(datactx)); + datactx.need_prefix = TRUE; + datactx.indent_level = ctx.indent_level; + datactx.cur_column = ctx.cur_column; + status = h5tools_dump_mem(rawoutstream, outputformat, &datactx, obj_id, p_type, space, buf); + } + /* Reclaim any VL memory, if necessary */ + if (vl_data) + H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); - if (H5Aread(obj_id, p_type, buf) >= 0) { - h5tools_context_t datactx; - HDmemset(&datactx, 0, sizeof(datactx)); - datactx.need_prefix = TRUE; - datactx.indent_level = ctx.indent_level; - datactx.cur_column = ctx.cur_column; - status = h5tools_dump_mem(rawoutstream, outputformat, &datactx, obj_id, p_type, space, buf); + HDfree(buf); } - /* Reclaim any VL memory, if necessary */ - if (vl_data) - H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); - - HDfree(buf); H5Tclose(p_type); H5Sclose(space); H5Tclose(type); diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 8c18794..a181186 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -1617,38 +1617,40 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain info = &outputformat; - if(hexdump_g) - p_type = H5Tcopy(type); - else - p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); - - if(p_type >= 0) { - /* VL data special information */ - unsigned int vl_data = 0; /* contains VL datatypes */ - - /* Check if we have VL data in the dataset's datatype */ - if (h5tools_detect_vlen(p_type) == TRUE) - vl_data = TRUE; - - temp_need= nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); - HDassert(temp_need == (hsize_t)((size_t)temp_need)); - need = (size_t)temp_need; - buf = HDmalloc(need); - HDassert(buf); - if(H5Aread(attr, p_type, buf) >= 0) { - ctx.need_prefix = TRUE; - ctx.indent_level = 2; - ctx.cur_column = (size_t)curr_pos; - h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf); - } + if(space_type != H5S_NULL && space_type != H5S_NO_CLASS) { + if(hexdump_g) + p_type = H5Tcopy(type); + else + p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); + + if(p_type >= 0) { + /* VL data special information */ + unsigned int vl_data = 0; /* contains VL datatypes */ + + /* Check if we have VL data in the dataset's datatype */ + if (h5tools_detect_vlen(p_type) == TRUE) + vl_data = TRUE; + + temp_need= nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); + HDassert(temp_need == (hsize_t)((size_t)temp_need)); + need = (size_t)temp_need; + buf = HDmalloc(need); + HDassert(buf); + if(H5Aread(attr, p_type, buf) >= 0) { + ctx.need_prefix = TRUE; + ctx.indent_level = 2; + ctx.cur_column = (size_t)curr_pos; + h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf); + } - /* Reclaim any VL memory, if necessary */ - if (vl_data) - H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); + /* Reclaim any VL memory, if necessary */ + if (vl_data) + H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); - HDfree(buf); - H5Tclose(p_type); - } /* end if */ + HDfree(buf); + H5Tclose(p_type); + } /* end if */ + } H5Sclose(space); H5Tclose(type); -- cgit v0.12 From d5a70edb5036c6b75ca27ad6b3895d6227d9e5d1 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Mon, 7 Aug 2017 21:48:17 -0500 Subject: Switch tests over to use testing macros --- testpar/t_filters_parallel.c | 1773 +++++++++++++++++------------------------- 1 file changed, 728 insertions(+), 1045 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index cc4a6b6..2dc209c 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -21,10 +21,13 @@ * datasets in parallel with filters applied to the data. */ +/* XXX: Add data verification macro/function and check all data in all tests */ + #include "t_filters_parallel.h" const char *FILENAME[] = { - "t_filters_parallel" + "t_filters_parallel", + NULL }; char filenames[1][256]; @@ -32,34 +35,32 @@ int nerrors = 0; #define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0]) -static int test_one_chunk_filtered_dataset(void); -static int test_filtered_dataset_no_overlap(void); -static int test_filtered_dataset_overlap(void); -static int test_filtered_dataset_single_no_selection(void); -static int test_filtered_dataset_all_no_selection(void); -static int test_filtered_dataset_point_selection(void); -static int test_filtered_dataset_interleaved_write(void); -static int test_3d_filtered_dataset_no_overlap_separate_pages(void); -static int test_3d_filtered_dataset_no_overlap_same_pages(void); -static int test_3d_filtered_dataset_overlap(void); -static int test_32d_filtered_dataset_no_overlap_separate_pages(void); -static int test_32d_filtered_dataset_no_overlap_same_pages(void); -static int test_32d_filtered_dataset_overlap(void); -static int test_cmpd_filtered_dataset_no_conversion_unshared(void); -static int test_cmpd_filtered_dataset_no_conversion_shared(void); -static int test_cmpd_filtered_dataset_type_conversion_unshared(void); -static int test_cmpd_filtered_dataset_type_conversion_shared(void); -static int test_write_serial_read_parallel(void); -static int test_write_parallel_read_serial(void); - -static int read_outfile(char* filename, char* datasetname); +static void test_one_chunk_filtered_dataset(void); +static void test_filtered_dataset_no_overlap(void); +static void test_filtered_dataset_overlap(void); +static void test_filtered_dataset_single_no_selection(void); +static void test_filtered_dataset_all_no_selection(void); +static void test_filtered_dataset_point_selection(void); +static void test_filtered_dataset_interleaved_write(void); +static void test_3d_filtered_dataset_no_overlap_separate_pages(void); +static void test_3d_filtered_dataset_no_overlap_same_pages(void); +static void test_3d_filtered_dataset_overlap(void); +static void test_32d_filtered_dataset_no_overlap_separate_pages(void); +static void test_32d_filtered_dataset_no_overlap_same_pages(void); +static void test_32d_filtered_dataset_overlap(void); +static void test_cmpd_filtered_dataset_no_conversion_unshared(void); +static void test_cmpd_filtered_dataset_no_conversion_shared(void); +static void test_cmpd_filtered_dataset_type_conversion_unshared(void); +static void test_cmpd_filtered_dataset_type_conversion_shared(void); +static void test_write_serial_read_parallel(void); +static void test_write_parallel_read_serial(void); static MPI_Comm comm = MPI_COMM_WORLD; static MPI_Info info = MPI_INFO_NULL; static int mpi_rank; static int mpi_size; -static int (*tests[])(void) = { +static void (*tests[])(void) = { test_one_chunk_filtered_dataset, test_filtered_dataset_no_overlap, test_filtered_dataset_overlap, @@ -88,7 +89,7 @@ static int (*tests[])(void) = { * Programmer: Jordan Henderson * 02/01/2017 */ -static int +static void test_one_chunk_filtered_dataset(void) { C_DATATYPE *data = NULL; @@ -196,7 +197,7 @@ test_one_chunk_filtered_dataset(void) VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); - return 0; + return; } /* @@ -208,7 +209,7 @@ test_one_chunk_filtered_dataset(void) * Programmer: Jordan Henderson * 02/01/2017 */ -static int +static void test_filtered_dataset_no_overlap(void) { C_DATATYPE *data = NULL; @@ -222,7 +223,6 @@ test_filtered_dataset_no_overlap(void) size_t i, data_size; hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - int ret_value = 0; if (MAINPROCESS) TESTING("write to unshared filtered chunks"); @@ -248,7 +248,7 @@ test_filtered_dataset_no_overlap(void) sel_dims[1] = UNSHARED_FILTERED_CHUNKS_NCOLS; filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL); - VRFY((filespace >= 0), "File dataspace creation suceeded"); + VRFY((filespace >= 0), "File dataspace creation succeeded"); memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL); VRFY((memspace >= 0), "Memory dataspace creation succeeded"); @@ -289,8 +289,7 @@ test_filtered_dataset_no_overlap(void) filespace = H5Dget_space(dset_id); VRFY((dset_id >= 0), "File dataspace retrieval succeeded"); - VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), - "Hyperslab selection succeeded"); + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); @@ -317,7 +316,7 @@ test_filtered_dataset_no_overlap(void) VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); - return 0; + return; } /* @@ -330,7 +329,7 @@ test_filtered_dataset_no_overlap(void) * Programmer: Jordan Henderson * 02/01/2017 */ -static int +static void test_filtered_dataset_overlap(void) { C_DATATYPE *data = NULL; @@ -342,24 +341,23 @@ test_filtered_dataset_overlap(void) hsize_t block[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t offset[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; + hid_t file_id = -1, dset_id = -1, plist_id = -1; + hid_t filespace = -1, memspace = -1; - if (mpi_rank == 0) puts("Testing write to shared filtered chunks"); + if (MAINPROCESS) TESTING("write to shared filtered chunks"); /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ dataset_dims[0] = SHARED_FILTERED_CHUNKS_NROWS; @@ -369,28 +367,27 @@ test_filtered_dataset_overlap(void) sel_dims[0] = SHARED_FILTERED_CHUNKS_CH_NROWS; sel_dims[1] = SHARED_FILTERED_CHUNKS_NCOLS; - if ((filespace = H5Screate_simple(SHARED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(SHARED_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(SHARED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + memspace = H5Screate_simple(SHARED_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, SHARED_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, SHARED_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); + + dset_id = H5Dcreate(file_id, SHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); - if ((dset_id = H5Dcreate(file_id, SHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file @@ -401,66 +398,51 @@ test_filtered_dataset_overlap(void) stride[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; block[0] = 1; block[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; - offset[0] = mpi_rank; + offset[0] = (hsize_t) mpi_rank; offset[1] = 0; - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + if (VERBOSE_MED) + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); + + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } + data = (C_DATATYPE *) malloc(data_size); + VRFY((NULL != data), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); - goto exit; + VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); -error: - if (mpi_rank == 0) puts("*** SHARED FILTERED CHUNKS WRITE TEST FAILED ***"); + if (data) free(data); - ret_value = 1; + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; + return; } /* * Tests parallel write of filtered data in the case where * a single process in the write operation has no selection - * in the datasets dataspace. In this case, the process with + * in the dataset's dataspace. In this case, the process with * no selection still has to participate in the collective * space re-allocation for the filtered chunks and also must * participate in the re-insertion of the filtered chunks @@ -469,7 +451,7 @@ exit: * Programmer: Jordan Henderson * 02/01/2017 */ -static int +static void test_filtered_dataset_single_no_selection(void) { C_DATATYPE *data = NULL; @@ -481,24 +463,23 @@ test_filtered_dataset_single_no_selection(void) hsize_t block[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t offset[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; + hid_t file_id = -1, dset_id = -1, plist_id = -1; + hid_t filespace = -1, memspace = -1; - if (mpi_rank == 0) puts("Testing write to filtered chunks with a single process having no selection"); + if (MAINPROCESS) TESTING("write to filtered chunks with a single process having no selection"); /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ dataset_dims[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS; @@ -511,28 +492,27 @@ test_filtered_dataset_single_no_selection(void) if (mpi_rank == SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) sel_dims[0] = sel_dims[1] = 0; - if ((filespace = H5Screate_simple(SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + memspace = H5Screate_simple(SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); + + dset_id = H5Dcreate(file_id, SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); - if ((dset_id = H5Dcreate(file_id, SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file @@ -543,73 +523,54 @@ test_filtered_dataset_single_no_selection(void) stride[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; block[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; block[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; - offset[0] = mpi_rank * SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS * count[0]; + offset[0] = (hsize_t) mpi_rank * SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS * count[0]; offset[1] = 0; - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + if (VERBOSE_MED) + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); - if (mpi_rank == SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) { - if (H5Sselect_none(filespace) < 0) - goto error; - } - else { - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; - } + if (mpi_rank == SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) + VRFY((H5Sselect_none(filespace) >= 0), "Select none succeeded"); + else + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } + data = (C_DATATYPE *) malloc(data_size); + VRFY((NULL != data), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); - goto exit; + VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); -error: - if (mpi_rank == 0) puts("*** SINGLE NO SELECTION FILTERED CHUNKS WRITE TEST FAILED ***"); + if (data) free(data); - ret_value = 1; + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; + return; } /* * Tests parallel write of filtered data in the case * where no process in the write operation has a - * selection in the datasets dataspace. This test is + * selection in the dataset's dataspace. This test is * to ensure that there are no assertion failures or * similar issues due to size 0 allocations and the * like. In this case, the file and dataset are created @@ -619,7 +580,7 @@ exit: * Programmer: Jordan Henderson * 02/02/2017 */ -static int +static void test_filtered_dataset_all_no_selection(void) { C_DATATYPE *data = NULL; @@ -627,24 +588,23 @@ test_filtered_dataset_all_no_selection(void) hsize_t chunk_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t sel_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; + hid_t file_id = -1, dset_id = -1, plist_id = -1; + hid_t filespace = -1, memspace = -1; - if (mpi_rank == 0) puts("Testing write to filtered chunks with all processes having no selection"); + if (MAINPROCESS) TESTING("write to filtered chunks with all processes having no selection"); /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ dataset_dims[0] = ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS; @@ -653,76 +613,59 @@ test_filtered_dataset_all_no_selection(void) chunk_dims[1] = ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; sel_dims[0] = sel_dims[1] = 0; - if ((filespace = H5Screate_simple(ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + memspace = H5Screate_simple(ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; - - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_none(filespace) < 0) - goto error; + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); + + dset_id = H5Dcreate(file_id, ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); + + VRFY((H5Sselect_none(filespace) >= 0), "Select none succeeded"); /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } + data = (C_DATATYPE *) malloc(data_size); + VRFY((NULL != data), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); - goto exit; + VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); -error: - if (mpi_rank == 0) puts("*** ALL NO SELECTION FILTERED CHUNKS WRITE TEST FAILED ***"); + if (data) free(data); - ret_value = 1; + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; + return; } /* @@ -732,7 +675,7 @@ exit: * Programmer: Jordan Henderson * 02/02/2017 */ -static int +static void test_filtered_dataset_point_selection(void) { C_DATATYPE *data = NULL; @@ -741,24 +684,23 @@ test_filtered_dataset_point_selection(void) hsize_t chunk_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t sel_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; size_t i, j, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; + hid_t file_id = -1, dset_id = -1, plist_id = -1; + hid_t filespace = -1, memspace = -1; - if (mpi_rank == 0) puts("Testing write to filtered chunks with point selection"); + if (MAINPROCESS) TESTING("write to filtered chunks with point selection"); /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ dataset_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_NROWS; @@ -768,87 +710,69 @@ test_filtered_dataset_point_selection(void) sel_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS; sel_dims[1] = POINT_SELECTION_FILTERED_CHUNKS_NCOLS; - if ((filespace = H5Screate_simple(POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + memspace = H5Screate_simple(POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - if ((dset_id = H5Dcreate(file_id, POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; + dset_id = H5Dcreate(file_id, POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); /* Set up point selection */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); for (i = 0; i < 2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS; i++) for (j = 0; j < POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS; j++) { if (j > 0) coords[i][j] = i % POINT_SELECTION_FILTERED_CHUNKS_NCOLS; else - coords[i][j] = mpi_rank + ((i / POINT_SELECTION_FILTERED_CHUNKS_NCOLS) * POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS); + coords[i][j] = (hsize_t) mpi_rank + ((i / POINT_SELECTION_FILTERED_CHUNKS_NCOLS) * POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS); } - if (H5Sselect_elements(filespace, H5S_SELECT_SET, 2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS, (const hsize_t *) coords) < 0) - goto error; + VRFY((H5Sselect_elements(filespace, H5S_SELECT_SET, 2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS, (const hsize_t *) coords) >= 0), + "Point selection succeeded"); /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } + data = (C_DATATYPE *) malloc(data_size); + VRFY((NULL != data), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); - /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); - goto exit; + VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); -error: - if (mpi_rank == 0) puts("*** POINT SELECTION FILTERED CHUNKS WRITE TEST FAILED ***"); + if (data) free(data); - ret_value = 1; + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; + return; } /* @@ -862,7 +786,7 @@ exit: * Programmer: Jordan Henderson * 02/02/2017 */ -static int +static void test_filtered_dataset_interleaved_write(void) { C_DATATYPE *data = NULL; @@ -874,24 +798,23 @@ test_filtered_dataset_interleaved_write(void) hsize_t block[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; hsize_t offset[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; + hid_t file_id = -1, dset_id = -1, plist_id = -1; + hid_t filespace = -1, memspace = -1; - if (mpi_rank == 0) puts("Testing interleaved write to filtered chunks"); + if (MAINPROCESS) TESTING("interleaved write to filtered chunks"); /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ dataset_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_NROWS; @@ -901,28 +824,27 @@ test_filtered_dataset_interleaved_write(void) sel_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / 2; sel_dims[1] = INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / 2; - if ((filespace = H5Screate_simple(INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + memspace = H5Screate_simple(INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, chunk_dims) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - if ((dset_id = H5Dcreate(file_id, INTERLEAVED_WRITE_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; + dset_id = H5Dcreate(file_id, INTERLEAVED_WRITE_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file @@ -933,60 +855,45 @@ test_filtered_dataset_interleaved_write(void) stride[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; block[0] = 1; block[1] = 1; - offset[0] = mpi_rank / SHARED_FILTERED_CHUNKS_CH_NCOLS; - offset[1] = mpi_rank % SHARED_FILTERED_CHUNKS_CH_NCOLS; + offset[0] = (hsize_t) mpi_rank / SHARED_FILTERED_CHUNKS_CH_NCOLS; + offset[1] = (hsize_t) mpi_rank % SHARED_FILTERED_CHUNKS_CH_NCOLS; - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + if (VERBOSE_MED) + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); + + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } + data = (C_DATATYPE *) malloc(data_size); + VRFY((NULL != data), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); - goto exit; + VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); -error: - if (mpi_rank == 0) puts("*** INTERLEAVED FILTERED CHUNK WRITE TEST FAILED ***"); + if (data) free(data); - ret_value = 1; + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; + return; } /* @@ -997,7 +904,7 @@ exit: * Programmer: Jordan Henderson * 02/06/2017 */ -static int +static void test_3d_filtered_dataset_no_overlap_separate_pages(void) { C_DATATYPE *data = NULL; @@ -1009,24 +916,23 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) hsize_t block[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; hsize_t offset[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; + hid_t file_id = -1, dset_id = -1, plist_id = -1; + hid_t filespace = -1, memspace = -1; - if (mpi_rank == 0) puts("Testing write to unshared filtered chunks on separate pages in 3D dataset"); + if (MAINPROCESS) TESTING("write to unshared filtered chunks on separate pages in 3D dataset"); /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS; @@ -1039,30 +945,29 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) sel_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS; sel_dims[2] = 1; - if ((filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, chunk_dims) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - if ((dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; + dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); - /* Each process defines the dataset selection in memory and writes + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + + /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file */ count[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS / UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; @@ -1076,59 +981,44 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) block[2] = 1; offset[0] = 0; offset[1] = 0; - offset[2] = mpi_rank; + offset[2] = (hsize_t) mpi_rank; - printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + if (VERBOSE_MED) + printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); + + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } + data = (C_DATATYPE *) malloc(data_size); + VRFY((NULL != data), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); - goto exit; + VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); -error: - if (mpi_rank == 0) puts("*** 3D UNSHARED FILTERED CHUNKS SEPARATE PAGE TEST FAILED ***"); + if (data) free(data); - ret_value = 1; + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; + return; } /* @@ -1140,7 +1030,7 @@ exit: * Programmer: Jordan Henderson * 02/06/2017 */ -static int +static void test_3d_filtered_dataset_no_overlap_same_pages(void) { C_DATATYPE *data = NULL; @@ -1154,22 +1044,21 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) size_t i, data_size; hid_t file_id, dset_id, plist_id; hid_t filespace, memspace; - int ret_value = 0; - if (mpi_rank == 0) puts("Testing write to unshared filtered chunks on the same pages in 3D dataset"); + if (MAINPROCESS) TESTING("write to unshared filtered chunks on the same pages in 3D dataset"); /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS; @@ -1182,28 +1071,27 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) sel_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS; sel_dims[2] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH; - if ((filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + memspace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, chunk_dims) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - if ((dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; + dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file @@ -1217,61 +1105,46 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) block[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; block[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; block[2] = 1; - offset[0] = (mpi_rank * UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS * count[0]); + offset[0] = ((hsize_t) mpi_rank * UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS * count[0]); offset[1] = 0; offset[2] = 0; - printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + if (VERBOSE_MED) + printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); + + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } + data = (C_DATATYPE *) malloc(data_size); + VRFY((NULL != data), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); - goto exit; + VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); -error: - if (mpi_rank == 0) puts("*** 3D UNSHARED FILTERED CHUNKS SAME PAGE TEST FAILED ***"); + if (data) free(data); - ret_value = 1; + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; + return; } /* @@ -1283,7 +1156,7 @@ exit: * Programmer: Jordan Henderson * 02/06/2017 */ -static int +static void test_3d_filtered_dataset_overlap(void) { C_DATATYPE *data = NULL; @@ -1295,24 +1168,23 @@ test_3d_filtered_dataset_overlap(void) hsize_t block[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; hsize_t offset[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; size_t i, data_size; - hid_t file_id, dset_id, plist_id; - hid_t filespace, memspace; - int ret_value = 0; + hid_t file_id = -1, dset_id = -1, plist_id = -1; + hid_t filespace = -1, memspace = -1; - if (mpi_rank == 0) puts("Testing write to shared filtered chunks in 3D dataset"); + if (MAINPROCESS) TESTING("write to shared filtered chunks in 3D dataset"); /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ dataset_dims[0] = SHARED_FILTERED_CHUNKS_3D_NROWS; @@ -1325,28 +1197,27 @@ test_3d_filtered_dataset_overlap(void) sel_dims[1] = SHARED_FILTERED_CHUNKS_3D_NCOLS / 2; sel_dims[2] = SHARED_FILTERED_CHUNKS_3D_DEPTH; - if ((filespace = H5Screate_simple(SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + memspace = H5Screate_simple(SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, chunk_dims) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - if ((dset_id = H5Dcreate(file_id, SHARED_FILTERED_CHUNKS_3D_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; + dset_id = H5Dcreate(file_id, SHARED_FILTERED_CHUNKS_3D_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file @@ -1360,79 +1231,64 @@ test_3d_filtered_dataset_overlap(void) block[0] = 1; block[1] = 1; block[2] = 1; - offset[0] = mpi_rank / SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; - offset[1] = mpi_rank % SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + offset[0] = (hsize_t) mpi_rank / SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + offset[1] = (hsize_t) mpi_rank % SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; offset[2] = 0; - printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + if (VERBOSE_MED) + printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); + + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); - if (NULL == (data = malloc(data_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } + data = (C_DATATYPE *) malloc(data_size); + VRFY((NULL != data), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - if (H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) < 0) - goto error; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); - goto exit; + VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); -error: - if (mpi_rank == 0) puts("*** 3D SHARED FILTERED CHUNKS TEST FAILED ***"); + if (data) free(data); - ret_value = 1; + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); -exit: - if (data) - free(data); - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; + return; } -static int +static void test_32d_filtered_dataset_no_overlap_separate_pages(void) { - return 1; + return; } -static int +static void test_32d_filtered_dataset_no_overlap_same_pages(void) { - return 1; + return; } -static int +static void test_32d_filtered_dataset_overlap(void) { - return 1; + return; } /* @@ -1443,7 +1299,7 @@ test_32d_filtered_dataset_overlap(void) * Programmer: Jordan Henderson * 02/10/2017 */ -static int +static void test_cmpd_filtered_dataset_no_conversion_unshared(void) { cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC]; @@ -1455,24 +1311,23 @@ test_cmpd_filtered_dataset_no_conversion_unshared(void) hsize_t block[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; hsize_t offset[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; size_t i; - hid_t file_id, dset_id, plist_id, memtype; - hid_t filespace, memspace; - int ret_value = 0; + hid_t file_id = -1, dset_id = -1, plist_id = -1, memtype = -1; + hid_t filespace = -1, memspace = -1; - if (mpi_rank == 0) puts("Testing write to unshared filtered chunks in Compound Datatype dataset without Datatype conversion"); + if (MAINPROCESS) TESTING("write to unshared filtered chunks in Compound Datatype dataset without Datatype conversion"); /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NROWS; @@ -1482,40 +1337,36 @@ test_cmpd_filtered_dataset_no_conversion_unshared(void) sel_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; sel_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; - if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, chunk_dims) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); /* Create the compound type for memory. */ - if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) - goto error; - if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) - goto error; - if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) - goto error; - if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) - goto error; - if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_NAME, memtype, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; + memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t)); + VRFY((memtype >= 0), "Datatype creation succeeded"); + + VRFY((H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) >= 0), "Datatype insertion succeeded"); + + dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_NAME, memtype, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file @@ -1527,16 +1378,17 @@ test_cmpd_filtered_dataset_no_conversion_unshared(void) block[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; block[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS; offset[0] = 0; - offset[1] = (mpi_rank * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS); + offset[1] = ((hsize_t) mpi_rank * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS); - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + if (VERBOSE_MED) + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); + + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); /* Fill data buffer */ memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC); @@ -1544,36 +1396,21 @@ test_cmpd_filtered_dataset_no_conversion_unshared(void) data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - goto exit; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); -error: - if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS NO CONVERSION UNSHARED TEST FAILED ***"); + VRFY((H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); - ret_value = 1; + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Tclose(memtype) >= 0), "Datatype close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); -exit: - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Tclose(memtype) < 0) - fprintf(stderr, "Unable to close mem type\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; + return; } /* @@ -1584,7 +1421,7 @@ exit: * Programmer: Jordan Henderson * 02/10/2017 */ -static int +static void test_cmpd_filtered_dataset_no_conversion_shared(void) { cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC]; @@ -1598,22 +1435,21 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) size_t i; hid_t file_id, dset_id, plist_id, memtype; hid_t filespace, memspace; - int ret_value = 0; - if (mpi_rank == 0) puts("Testing write to shared filtered chunks in Compound Datatype dataset without Datatype conversion"); + if (MAINPROCESS) TESTING("write to shared filtered chunks in Compound Datatype dataset without Datatype conversion"); /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id>= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NROWS; @@ -1623,40 +1459,36 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) sel_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; sel_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; - if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, chunk_dims) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); /* Create the compound type for memory. */ - if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) - goto error; - if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) - goto error; - if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) - goto error; - if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) - goto error; - if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_NAME, memtype, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; + memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t)); + VRFY((memtype >= 0), "Datatype creation succeeded"); + + VRFY((H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) >= 0), "Datatype insertion succeeded"); + + dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_NAME, memtype, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file @@ -1667,17 +1499,18 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) stride[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; block[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; block[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; - offset[0] = mpi_rank; + offset[0] = (hsize_t) mpi_rank; offset[1] = 0; - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", - mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + if (VERBOSE_MED) + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); + + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); /* Fill data buffer */ memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC); @@ -1685,36 +1518,21 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - goto exit; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); -error: - if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS NO CONVERSION SHARED TEST FAILED ***"); + VRFY((H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); - ret_value = 1; + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Tclose(memtype) >= 0), "Datatype close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); -exit: - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Tclose(memtype) < 0) - fprintf(stderr, "Unable to close mem type\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; + return; } /* @@ -1730,7 +1548,7 @@ exit: * Programmer: Jordan Henderson * 02/07/2017 */ -static int +static void test_cmpd_filtered_dataset_type_conversion_unshared(void) { cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC]; @@ -1742,24 +1560,23 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) hsize_t block[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; hsize_t offset[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; size_t i; - hid_t file_id, dset_id, plist_id, filetype, memtype; - hid_t filespace, memspace; - int ret_value = 0; + hid_t file_id = -1, dset_id = -1, plist_id = -1, filetype = -1, memtype = -1; + hid_t filespace = -1, memspace = -1; - if (mpi_rank == 0) puts("Testing write to unshared filtered chunks in Compound Datatype dataset with Datatype conversion"); + if (MAINPROCESS) TESTING("write to unshared filtered chunks in Compound Datatype dataset with Datatype conversion"); /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NROWS; @@ -1769,52 +1586,45 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) sel_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; sel_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; - if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, chunk_dims) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); /* Create the compound type for memory. */ - if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) - goto error; - if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) - goto error; - if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) - goto error; - if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) - goto error; - if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) - goto error; + memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t)); + VRFY((memtype >= 0), "Datatype creation succeeded"); + + VRFY((H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) >= 0), "Datatype insertion succeeded"); /* Create the compound type for file. */ - if ((filetype = H5Tcreate(H5T_COMPOUND, 32)) < 0) - goto error; - if (H5Tinsert(filetype, "ShortData", 0, H5T_STD_I64BE) < 0) - goto error; - if (H5Tinsert(filetype, "IntData", 8, H5T_STD_I64BE) < 0) - goto error; - if (H5Tinsert(filetype, "LongData", 16, H5T_STD_I64BE) < 0) - goto error; - if (H5Tinsert(filetype, "DoubleData", 24, H5T_IEEE_F64BE) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_NAME, filetype, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; + filetype = H5Tcreate(H5T_COMPOUND, 32); + VRFY((filetype >= 0), "Datatype creation succeeded"); + + VRFY((H5Tinsert(filetype, "ShortData", 0, H5T_STD_I64BE) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(filetype, "IntData", 8, H5T_STD_I64BE) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(filetype, "LongData", 16, H5T_STD_I64BE) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(filetype, "DoubleData", 24, H5T_IEEE_F64BE) >= 0), "Datatype insertion succeeded"); + + dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_NAME, filetype, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file @@ -1826,16 +1636,17 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) block[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; block[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS; offset[0] = 0; - offset[1] = (mpi_rank * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS); + offset[1] = ((hsize_t) mpi_rank * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS); - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", - mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + if (VERBOSE_MED) + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); + + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); /* Fill data buffer */ memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC); @@ -1843,38 +1654,25 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - goto exit; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); -error: - if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS TYPE CONVERSION UNSHARED TEST FAILED ***"); + /* Ensure that this test currently fails since type conversions break collective mode */ + H5E_BEGIN_TRY { + VRFY((H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0), "Dataset write succeeded"); + } H5E_END_TRY; - ret_value = 1; + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Tclose(filetype) >= 0), "File datatype close succeeded"); + VRFY((H5Tclose(memtype) >= 0), "Memory datatype close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); -exit: - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Tclose(filetype) < 0) - fprintf(stderr, "Unable to close file type\n"); - if (H5Tclose(memtype) < 0) - fprintf(stderr, "Unable to close mem type\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; + return; } /* @@ -1890,7 +1688,7 @@ exit: * Programmer: Jordan Henderson * 02/10/2017 */ -static int +static void test_cmpd_filtered_dataset_type_conversion_shared(void) { cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC]; @@ -1904,22 +1702,21 @@ test_cmpd_filtered_dataset_type_conversion_shared(void) size_t i; hid_t file_id, dset_id, plist_id, filetype, memtype; hid_t filespace, memspace; - int ret_value = 0; - if (mpi_rank == 0) puts("Testing write to shared filtered chunks in Compound Datatype dataset with Datatype conversion"); + if (MAINPROCESS) TESTING("write to shared filtered chunks in Compound Datatype dataset with Datatype conversion"); /* Set up file access property list with parallel I/O access */ - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - if (H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto exit; - - if ((file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NROWS; @@ -1929,52 +1726,45 @@ test_cmpd_filtered_dataset_type_conversion_shared(void) sel_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; sel_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; - if ((filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, dataset_dims, NULL)) < 0) - goto error; - if ((memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, sel_dims, NULL)) < 0) - goto error; + filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + memspace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); /* Create chunked dataset */ - if ((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if (H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, chunk_dims) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); /* Add test filter to the pipeline */ - if (SET_FILTER(plist_id) < 0) - goto error; + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); /* Create the compound type for memory. */ - if ((memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t))) < 0) - goto error; - if (H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) < 0) - goto error; - if (H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) < 0) - goto error; - if (H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) < 0) - goto error; - if (H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) < 0) - goto error; + memtype = H5Tcreate(H5T_COMPOUND, sizeof(cmpd_filtered_t)); + VRFY((memtype >= 0), "Datatype creation succeeded"); + + VRFY((H5Tinsert(memtype, "ShortData", HOFFSET(cmpd_filtered_t, field1), H5T_NATIVE_SHORT) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(memtype, "IntData", HOFFSET(cmpd_filtered_t, field2), H5T_NATIVE_INT) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) >= 0), "Datatype insertion succeeded"); /* Create the compound type for file. */ - if ((filetype = H5Tcreate(H5T_COMPOUND, 32)) < 0) - goto error; - if (H5Tinsert(filetype, "ShortData", 0, H5T_STD_I64BE) < 0) - goto error; - if (H5Tinsert(filetype, "IntData", 8, H5T_STD_I64BE) < 0) - goto error; - if (H5Tinsert(filetype, "LongData", 16, H5T_STD_I64BE) < 0) - goto error; - if (H5Tinsert(filetype, "DoubleData", 24, H5T_IEEE_F64BE) < 0) - goto error; - - if ((dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_NAME, filetype, filespace, - H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Sclose(filespace) < 0) - goto error; + filetype = H5Tcreate(H5T_COMPOUND, 32); + VRFY((filetype >= 0), "Datatype creation succeeded"); + + VRFY((H5Tinsert(filetype, "ShortData", 0, H5T_STD_I64BE) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(filetype, "IntData", 8, H5T_STD_I64BE) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(filetype, "LongData", 16, H5T_STD_I64BE) >= 0), "Datatype insertion succeeded"); + VRFY((H5Tinsert(filetype, "DoubleData", 24, H5T_IEEE_F64BE) >= 0), "Datatype insertion succeeded"); + + dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_NAME, filetype, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file @@ -1985,17 +1775,18 @@ test_cmpd_filtered_dataset_type_conversion_shared(void) stride[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; block[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; block[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; - offset[0] = mpi_rank; + offset[0] = (hsize_t) mpi_rank; offset[1] = 0; - printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", - mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); + if (VERBOSE_MED) + printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", + mpi_rank, count[0], count[1], stride[0], stride[1], offset[0], offset[1], block[0], block[1]); /* Select hyperslab in the file */ - if ((filespace = H5Dget_space(dset_id)) < 0) - goto error; - if (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) < 0) - goto error; + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); + + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); /* Fill data buffer */ memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC); @@ -2003,171 +1794,66 @@ test_cmpd_filtered_dataset_type_conversion_shared(void) data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); /* Create property list for collective dataset write */ - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if (H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0) - goto error; + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); - goto exit; + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); -error: - if (mpi_rank == 0) puts("*** COMPOUND DATATYPE FILTERED CHUNKS TYPE CONVERSION SHARED TEST FAILED ***"); + /* Ensure that this test currently fails since type conversions break collective mode */ + H5E_BEGIN_TRY { + VRFY((H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0), "Dataset write succeeded"); + } H5E_END_TRY; - ret_value = 1; + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Tclose(filetype) >= 0), "File datatype close succeeded"); + VRFY((H5Tclose(memtype) >= 0), "Memory datatype close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); -exit: - if (H5Dclose(dset_id) < 0) - fprintf(stderr, "Unable to close dataset\n"); - if (H5Sclose(filespace) < 0) - fprintf(stderr, "Unable to close filespace\n"); - if (H5Sclose(memspace) < 0) - fprintf(stderr, "Unable to close memspace\n"); - if (H5Tclose(filetype) < 0) - fprintf(stderr, "Unable to close file type\n"); - if (H5Tclose(memtype) < 0) - fprintf(stderr, "Unable to close mem type\n"); - if (H5Pclose(plist_id) < 0) - fprintf(stderr, "Unable to close plist\n"); - if (H5Fclose(file_id) < 0) - fprintf(stderr, "Unable to close file\n"); - - return ret_value; + return; } -static int -read_outfile(char* filename, char* datasetname) +/* + * Tests write of filtered data to a dataset + * by a single process. After the write has + * succeeded, the dataset is closed and then + * re-opened in parallel and read by all + * processes to ensure data correctness. + * + * Programmer: Jordan Henderson + * XXX: 02/10/2017 + */ +static void +test_write_serial_read_parallel(void) { - H5Z_filter_t filter_type; - C_DATATYPE *rbuf = NULL; - unsigned flags, filter_info; - hsize_t *dims, *maxdims; - size_t i, j, k, nelmts, buf_size; - hid_t file_id, dset_id, plist_id, creation_plist, dspace_id; - int num_filters, ndims; - - if ((plist_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if (H5Pset_fapl_mpio(plist_id, comm, info) < 0) - goto error; - - if ((file_id = H5Fopen(filename, H5F_ACC_RDONLY, plist_id)) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - - if ((dset_id = H5Dopen(file_id, datasetname, H5P_DEFAULT)) < 0) - goto error; - - if ((dspace_id = H5Dget_space(dset_id)) < 0) - goto error; - - if ((creation_plist = H5Dget_create_plist(dset_id)) < 0) - goto error; - - if ((num_filters = H5Pget_nfilters(creation_plist)) < 0) - goto error; - - if (mpi_rank == 0) { - printf("Number of filters: %i\n", num_filters); - - for (i = 0; i < num_filters; i++) { - nelmts = 0; - if ((filter_type = H5Pget_filter2(creation_plist, 0, &flags, &nelmts, NULL, 0, - NULL, &filter_info)) < 0) - goto error; - - printf("Filter Type: "); - switch (filter_type) { - case H5Z_FILTER_DEFLATE: - printf("H5Z_FILTER_DEFLATE\n"); - break; - case H5Z_FILTER_SZIP: - printf("H5Z_FILTER_SZIP\n"); - break; - default: - printf("Other filter type included.\n"); - } - } - } - - if ((plist_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; - if (H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) < 0) - goto error; - - if ((ndims = H5Sget_simple_extent_ndims(dspace_id)) < 0) - goto error; - if (NULL == (dims = malloc(ndims * sizeof(*dims)))) - goto error; - if (NULL == (maxdims = malloc(ndims * sizeof(*dims)))) - goto error; - - if (H5Sget_simple_extent_dims(dspace_id, dims, maxdims) < 0) - goto error; - - buf_size = 0; - for (i = 0; i < ndims; i++) - buf_size += dims[i] * sizeof(*rbuf); - - if (NULL == (rbuf = malloc(buf_size))) { - fprintf(stderr, "Couldn't allocate memory.\n"); - goto error; - } - - if (H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, rbuf) < 0) - goto error; + if (MAINPROCESS) { - if (mpi_rank == 0) { - /* Only set up for use in 2D and 3D cases */ - if (ndims > 2) { - for (i = 0; i < dims[0]; i++) - for (j = 0; j < dims[1]; j++) - for (k = 0; k < dims[2]; k++) - printf("(%zu, %zu): %ld\n", i, j, rbuf[(i * dims[1]) + j]); - } - else { - for (i = 0; i < dims[0]; i++) - for (j = 0; j < dims[1]; j++) - printf("(%zu, %zu): %ld\n", i, j, rbuf[(i * dims[1]) + j]); - } } - free(rbuf); - if (H5Dclose(dset_id) < 0) - goto error; - if (H5Pclose(plist_id) < 0) - goto error; - if (H5Pclose(creation_plist) < 0) - goto error; - if (H5Fclose(file_id) < 0) - goto error; - - return 0; - -error: - if (rbuf) - free(rbuf); - if (dims) - free(dims); - if (maxdims) - free(maxdims); - - return 1; + return; } -static int -test_write_serial_read_parallel(void) -{ - return 1; -} - -static int +/* + * Tests parallel write of filtered data + * to a dataset. After the write has + * succeeded, the dataset is closed and + * then re-opened and read by a single + * process to ensure data correctness. + * + * Programmer: Jordan Henderson + * XXX: 02/10/2017 + */ +static void test_write_parallel_read_serial(void) { - return 1; + + if (MAINPROCESS) { + + } + + return; } int @@ -2213,7 +1899,7 @@ main(int argc, char** argv) VRFY((H5Pset_fapl_mpio(fapl, comm, info) >= 0), "Set FAPL MPIO succeeded"); - VRFY((H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0), "Set libver bounds succeeded"); + VRFY((H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); VRFY((h5_fixname(FILENAME[0], fapl, filenames[0], sizeof(filenames[0])) != NULL), "Test file name created"); @@ -2233,7 +1919,7 @@ main(int argc, char** argv) if (nerrors) goto exit; - puts("All Parallel Filters tests passed\n"); + if (MAINPROCESS) puts("All Parallel Filters tests passed\n"); exit: if (nerrors) @@ -2243,9 +1929,6 @@ exit: h5_clean_files(FILENAME, fapl); - if (H5Pclose(fapl) < 0) - MESG("Couldn't close FAPL.\n"); - H5close(); MPI_Finalize(); -- cgit v0.12 From f74dd2adaeb668e1164ae896b7155e9491035ef2 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Tue, 8 Aug 2017 15:04:53 -0500 Subject: Start adding data verification --- testpar/t_filters_parallel.c | 161 ++++++++++++++++++++++++++++++++++++++----- testpar/t_filters_parallel.h | 78 +++++++++++++-------- 2 files changed, 193 insertions(+), 46 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 2dc209c..37a94bb 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -89,10 +89,13 @@ static void (*tests[])(void) = { * Programmer: Jordan Henderson * 02/01/2017 */ +/* XXX: DONE */ static void test_one_chunk_filtered_dataset(void) { C_DATATYPE *data = NULL; + C_DATATYPE *read_buf = NULL; + C_DATATYPE *correct_buf = NULL; hsize_t dataset_dims[ONE_CHUNK_FILTERED_DATASET_DIMS]; hsize_t chunk_dims[ONE_CHUNK_FILTERED_DATASET_DIMS]; hsize_t sel_dims[ONE_CHUNK_FILTERED_DATASET_DIMS]; @@ -100,11 +103,11 @@ test_one_chunk_filtered_dataset(void) hsize_t stride[ONE_CHUNK_FILTERED_DATASET_DIMS]; hsize_t block[ONE_CHUNK_FILTERED_DATASET_DIMS]; hsize_t offset[ONE_CHUNK_FILTERED_DATASET_DIMS]; - size_t i, data_size; + size_t i, data_size, correct_buf_size; hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) TESTING("one-chunk filtered dataset"); + if (MAINPROCESS) puts("Testing one-chunk filtered dataset"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -174,12 +177,20 @@ test_one_chunk_filtered_dataset(void) /* Fill data buffer */ data_size = ONE_CHUNK_FILTERED_DATASET_CH_NROWS * ONE_CHUNK_FILTERED_DATASET_NCOLS * sizeof(*data); + correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); data = (C_DATATYPE *) malloc(data_size); VRFY((NULL != data), "malloc succeeded"); + correct_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != correct_buf), "malloc succeeded"); + for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); + data[i] = (C_DATATYPE) GEN_DATA(i); + + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + correct_buf[i] = ((C_DATATYPE) i % (ONE_CHUNK_FILTERED_DATASET_CH_NROWS / NUM_MPI_RANKS * ONE_CHUNK_FILTERED_DATASET_CH_NCOLS)) + + ((C_DATATYPE) i / (ONE_CHUNK_FILTERED_DATASET_CH_NROWS / NUM_MPI_RANKS * ONE_CHUNK_FILTERED_DATASET_CH_NCOLS)); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -192,6 +203,22 @@ test_one_chunk_filtered_dataset(void) if (data) free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + + /* Verify the correct data was written */ + read_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != read_buf), "malloc succeeded"); + + dset_id = H5Dopen(file_id, "/" ONE_CHUNK_FILTERED_DATASET_NAME, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset open succeeded"); + + VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); + + VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); + + if (correct_buf) free(correct_buf); + if (read_buf) free(read_buf); + + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); @@ -224,7 +251,7 @@ test_filtered_dataset_no_overlap(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) TESTING("write to unshared filtered chunks"); + if (MAINPROCESS) puts("Testing write to unshared filtered chunks"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -344,7 +371,7 @@ test_filtered_dataset_overlap(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) TESTING("write to shared filtered chunks"); + if (MAINPROCESS) puts("Testing write to shared filtered chunks"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -466,7 +493,7 @@ test_filtered_dataset_single_no_selection(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) TESTING("write to filtered chunks with a single process having no selection"); + if (MAINPROCESS) puts("Testing write to filtered chunks with a single process having no selection"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -591,7 +618,7 @@ test_filtered_dataset_all_no_selection(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) TESTING("write to filtered chunks with all processes having no selection"); + if (MAINPROCESS) puts("Testing write to filtered chunks with all processes having no selection"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -675,19 +702,22 @@ test_filtered_dataset_all_no_selection(void) * Programmer: Jordan Henderson * 02/02/2017 */ +/* XXX: DONE */ static void test_filtered_dataset_point_selection(void) { C_DATATYPE *data = NULL; + C_DATATYPE *correct_buf = NULL; + C_DATATYPE *read_buf = NULL; hsize_t coords[2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS][POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t dataset_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t chunk_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t sel_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - size_t i, j, data_size; + size_t i, j, data_size, correct_buf_size; hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) TESTING("write to filtered chunks with point selection"); + if (MAINPROCESS) puts("Testing write to filtered chunks with point selection"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -749,13 +779,20 @@ test_filtered_dataset_point_selection(void) /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); data = (C_DATATYPE *) malloc(data_size); VRFY((NULL != data), "malloc succeeded"); + correct_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != correct_buf), "malloc succeeded"); + for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + correct_buf[i] = (dataset_dims[1] * (i / (NUM_MPI_RANKS * dataset_dims[1]))) + (i % dataset_dims[1]) + (((i % (NUM_MPI_RANKS * dataset_dims[1])) / dataset_dims[1]) % dataset_dims[1]); + /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); VRFY((plist_id >= 0), "DXPL creation succeeded"); @@ -767,6 +804,22 @@ test_filtered_dataset_point_selection(void) if (data) free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + + /* Verify the correct data was written */ + read_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != read_buf), "malloc succeeded"); + + dset_id = H5Dopen(file_id, "/" POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset open succeeded"); + + VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); + + VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); + + if (correct_buf) free(correct_buf); + if (read_buf) free(read_buf); + + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); @@ -801,7 +854,7 @@ test_filtered_dataset_interleaved_write(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) TESTING("interleaved write to filtered chunks"); + if (MAINPROCESS) puts("Testing interleaved write to filtered chunks"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -919,7 +972,7 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) TESTING("write to unshared filtered chunks on separate pages in 3D dataset"); + if (MAINPROCESS) puts("Testing write to unshared filtered chunks on separate pages in 3D dataset"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1045,7 +1098,7 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) hid_t file_id, dset_id, plist_id; hid_t filespace, memspace; - if (MAINPROCESS) TESTING("write to unshared filtered chunks on the same pages in 3D dataset"); + if (MAINPROCESS) puts("Testing write to unshared filtered chunks on the same pages in 3D dataset"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1171,7 +1224,7 @@ test_3d_filtered_dataset_overlap(void) hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) TESTING("write to shared filtered chunks in 3D dataset"); + if (MAINPROCESS) puts("Testing write to shared filtered chunks in 3D dataset"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1314,7 +1367,7 @@ test_cmpd_filtered_dataset_no_conversion_unshared(void) hid_t file_id = -1, dset_id = -1, plist_id = -1, memtype = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) TESTING("write to unshared filtered chunks in Compound Datatype dataset without Datatype conversion"); + if (MAINPROCESS) puts("Testing write to unshared filtered chunks in Compound Datatype dataset without Datatype conversion"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1436,7 +1489,7 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) hid_t file_id, dset_id, plist_id, memtype; hid_t filespace, memspace; - if (MAINPROCESS) TESTING("write to shared filtered chunks in Compound Datatype dataset without Datatype conversion"); + if (MAINPROCESS) puts("Testing write to shared filtered chunks in Compound Datatype dataset without Datatype conversion"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1563,7 +1616,7 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) hid_t file_id = -1, dset_id = -1, plist_id = -1, filetype = -1, memtype = -1; hid_t filespace = -1, memspace = -1; - if (MAINPROCESS) TESTING("write to unshared filtered chunks in Compound Datatype dataset with Datatype conversion"); + if (MAINPROCESS) puts("Testing write to unshared filtered chunks in Compound Datatype dataset with Datatype conversion"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1703,7 +1756,7 @@ test_cmpd_filtered_dataset_type_conversion_shared(void) hid_t file_id, dset_id, plist_id, filetype, memtype; hid_t filespace, memspace; - if (MAINPROCESS) TESTING("write to shared filtered chunks in Compound Datatype dataset with Datatype conversion"); + if (MAINPROCESS) puts("Testing write to shared filtered chunks in Compound Datatype dataset with Datatype conversion"); /* Set up file access property list with parallel I/O access */ plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1828,10 +1881,81 @@ test_cmpd_filtered_dataset_type_conversion_shared(void) static void test_write_serial_read_parallel(void) { + C_DATATYPE *data = NULL; + hsize_t dataset_dims[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; + hsize_t chunk_dims[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; + hsize_t sel_dims[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; + hsize_t count[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; + hsize_t stride[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; + hsize_t block[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; + hsize_t offset[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; + size_t i, j, k, data_size; + hid_t file_id = -1, dset_id = -1, plist_id = -1; + hid_t filespace = -1, memspace = -1; + + if (MAINPROCESS) puts("Testing write file serially; read file in parallel"); + + /* Write the file on the MAINPROCESS rank */ if (MAINPROCESS) { + /* Set up file access property list */ + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); + + /* Create the dataspace for the dataset */ + dataset_dims[0] = WRITE_SERIAL_READ_PARALLEL_NROWS; + dataset_dims[1] = WRITE_SERIAL_READ_PARALLEL_NCOLS; + dataset_dims[2] = WRITE_SERIAL_READ_PARALLEL_DEPTH; + chunk_dims[0] = WRITE_SERIAL_READ_PARALLEL_CH_NROWS; + chunk_dims[1] = WRITE_SERIAL_READ_PARALLEL_CH_NCOLS; + chunk_dims[2] = 1; + sel_dims[0] = WRITE_SERIAL_READ_PARALLEL_NROWS; + sel_dims[1] = WRITE_SERIAL_READ_PARALLEL_NCOLS; + sel_dims[2] = 1; + + filespace = H5Screate_simple(WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + /* Create chunked dataset */ + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + VRFY((H5Pset_chunk(plist_id, WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); + + /* Add test filter to the pipeline */ + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); + + dset_id = H5Dcreate(file_id, WRITE_SERIAL_READ_PARALLEL_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + + data_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*data); + + data = (C_DATATYPE *) malloc(data_size); + VRFY((NULL != data), "malloc succeeded"); + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = GEN_DATA(i); + + VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) >= 0), "Dataset write succeeded"); + + if (data) free(data); + + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); } + /* All ranks open the file and verify their "portion" of the dataset is correct */ + return; } @@ -1927,7 +2051,8 @@ exit: ALARM_OFF; - h5_clean_files(FILENAME, fapl); + /* XXX: Commented for testing */ + /* h5_clean_files(FILENAME, fapl); */ H5close(); diff --git a/testpar/t_filters_parallel.h b/testpar/t_filters_parallel.h index d627c27..d098b66 100644 --- a/testpar/t_filters_parallel.h +++ b/testpar/t_filters_parallel.h @@ -46,9 +46,14 @@ size_t cd_nelmts = FILTER_NUM_CDVALUES; #define C_DATATYPE long #define C_DATATYPE_STR(type) STRINGIFY(type) #define HDF5_DATATYPE_NAME H5T_NATIVE_LONG -#define GEN_DATA(i) RANK_DATA(i) /* Given an index value i, generates test data based upon selected mode */ -#define RANK_DATA(i) (mpi_rank) /* Generates test data to visibly show which rank wrote to which parts of the dataset */ -#define INCREMENTAL_DATA(i) i /* Generates incremental test data */ + +#define GEN_DATA(i) INCREMENTAL_DATA(i) +#define INCREMENTAL_DATA(i) (mpi_rank + i) /* Generates incremental test data */ + +/* XXX: For experimental purposes only, will causes tests to fail data verification phase */ +/* #define GEN_DATA(i) RANK_DATA(i) */ /* Given an index value i, generates test data based upon selected mode */ +#define RANK_DATA(i) (mpi_rank) /* Generates test data to visibly show which rank wrote to which parts of the dataset */ + #ifdef DYNAMIC_FILTER #define SET_FILTER(dcpl) H5Pset_filter(dcpl, filter_id, flags, FILTER_NUM_CDVALUES, cd_values) /* Test other filter in parallel */ #else @@ -58,50 +63,49 @@ size_t cd_nelmts = FILTER_NUM_CDVALUES; /* Defines for the one-chunk filtered dataset test */ #define ONE_CHUNK_FILTERED_DATASET_NAME "one_chunk_filtered_dataset" #define ONE_CHUNK_FILTERED_DATASET_DIMS 2 -#define ONE_CHUNK_FILTERED_DATASET_NROWS 16 /* Must be an even multiple of the number of ranks to avoid issues */ -#define ONE_CHUNK_FILTERED_DATASET_NCOLS 8 /* Must be an even multiple of the number of ranks to avoid issues */ +#define ONE_CHUNK_FILTERED_DATASET_NROWS (NUM_MPI_RANKS * 4) /* Must be an even multiple of the number of ranks to avoid issues */ +#define ONE_CHUNK_FILTERED_DATASET_NCOLS (NUM_MPI_RANKS * 2) /* Must be an even multiple of the number of ranks to avoid issues */ #define ONE_CHUNK_FILTERED_DATASET_CH_NROWS ONE_CHUNK_FILTERED_DATASET_NROWS #define ONE_CHUNK_FILTERED_DATASET_CH_NCOLS ONE_CHUNK_FILTERED_DATASET_NCOLS /* Defines for the unshared filtered chunks write test */ #define UNSHARED_FILTERED_CHUNKS_DATASET_NAME "unshared_filtered_chunks" #define UNSHARED_FILTERED_CHUNKS_DATASET_DIMS 2 -#define UNSHARED_FILTERED_CHUNKS_NROWS 16 -#define UNSHARED_FILTERED_CHUNKS_NCOLS 8 +#define UNSHARED_FILTERED_CHUNKS_NROWS (NUM_MPI_RANKS * 4) +#define UNSHARED_FILTERED_CHUNKS_NCOLS (NUM_MPI_RANKS * 2) #define UNSHARED_FILTERED_CHUNKS_CH_NROWS (UNSHARED_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) #define UNSHARED_FILTERED_CHUNKS_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) /* Defines for the shared filtered chunks write test */ #define SHARED_FILTERED_CHUNKS_DATASET_NAME "shared_filtered_chunks" #define SHARED_FILTERED_CHUNKS_DATASET_DIMS 2 -#define SHARED_FILTERED_CHUNKS_NROWS 16 -#define SHARED_FILTERED_CHUNKS_NCOLS 8 +#define SHARED_FILTERED_CHUNKS_NROWS (NUM_MPI_RANKS * 4) +#define SHARED_FILTERED_CHUNKS_NCOLS (NUM_MPI_RANKS * 2) #define SHARED_FILTERED_CHUNKS_CH_NROWS (SHARED_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) #define SHARED_FILTERED_CHUNKS_CH_NCOLS (SHARED_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) /* Defines for the filtered chunks write test where a process has no selection */ #define SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME "single_no_selection_filtered_chunks" #define SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS 16 -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS 8 +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS (NUM_MPI_RANKS * 4) +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS (NUM_MPI_RANKS * 2) #define SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS (SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) #define SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS (SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC 3 +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC NUM_MPI_RANKS - 1 /* Defines for the filtered chunks write test where no process has a selection */ #define ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME "all_no_selection_filtered_chunks" #define ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 -#define ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS 16 -#define ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS 8 +#define ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS (NUM_MPI_RANKS * 4) +#define ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS (NUM_MPI_RANKS * 2) #define ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS (ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) #define ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS (ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) -#define ALL_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC 3 /* Defines for the filtered chunks write test with a point selection */ #define POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME "point_selection_filtered_chunks" #define POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 -#define POINT_SELECTION_FILTERED_CHUNKS_NROWS 16 -#define POINT_SELECTION_FILTERED_CHUNKS_NCOLS 8 +#define POINT_SELECTION_FILTERED_CHUNKS_NROWS (NUM_MPI_RANKS * 4) +#define POINT_SELECTION_FILTERED_CHUNKS_NCOLS (NUM_MPI_RANKS * 2) #define POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS (POINT_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) #define POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS (POINT_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) #define POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS ((POINT_SELECTION_FILTERED_CHUNKS_NROWS / POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS) * (POINT_SELECTION_FILTERED_CHUNKS_NCOLS / POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS)) @@ -109,8 +113,8 @@ size_t cd_nelmts = FILTER_NUM_CDVALUES; /* Defines for the filtered dataset interleaved write test */ #define INTERLEAVED_WRITE_FILTERED_DATASET_NAME "interleaved_write_filtered_dataset" #define INTERLEAVED_WRITE_FILTERED_DATASET_DIMS 2 -#define INTERLEAVED_WRITE_FILTERED_DATASET_NROWS 16 /* Must be an even multiple of the number of ranks to avoid issues */ -#define INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS 8 /* Must be an even multiple of the number of ranks to avoid issues */ +#define INTERLEAVED_WRITE_FILTERED_DATASET_NROWS (NUM_MPI_RANKS * 4) /* Must be an even multiple of the number of ranks to avoid issues */ +#define INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS (NUM_MPI_RANKS * 2) /* Must be an even multiple of the number of ranks to avoid issues */ #define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS (INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / NUM_MPI_RANKS) #define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS (INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / NUM_MPI_RANKS) #define INTERLEAVED_WRITE_FILTERED_DATASET_SEL_NPOINTS (INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS * INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS / INTERLEAVED_WRITE_FILTERED_DATASET_NUM_RANKS) @@ -118,27 +122,27 @@ size_t cd_nelmts = FILTER_NUM_CDVALUES; /* Defines for the 3D unshared filtered dataset separate page write test */ #define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME "3d_unshared_filtered_chunks_separate_pages" #define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS 3 -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS 16 -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS 8 -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DEPTH NUM_MPI_RANKS +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS (NUM_MPI_RANKS * 4) +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS (NUM_MPI_RANKS * 2) +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DEPTH (NUM_MPI_RANKS) #define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS (UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS / NUM_MPI_RANKS) #define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS / NUM_MPI_RANKS) /* Defines for the 3D unshared filtered dataset same page write test */ #define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME "3d_unshared_filtered_chunks_same_pages" #define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS 3 -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS 16 -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS 8 -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH NUM_MPI_RANKS +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS (NUM_MPI_RANKS * 4) +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS (NUM_MPI_RANKS * 2) +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH (NUM_MPI_RANKS) #define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS (UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS / NUM_MPI_RANKS) #define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS / NUM_MPI_RANKS) /* Defines for the 3d shared filtered dataset write test */ #define SHARED_FILTERED_CHUNKS_3D_DATASET_NAME "3d_shared_filtered_chunks" #define SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS 3 -#define SHARED_FILTERED_CHUNKS_3D_NROWS 16 -#define SHARED_FILTERED_CHUNKS_3D_NCOLS 8 -#define SHARED_FILTERED_CHUNKS_3D_DEPTH NUM_MPI_RANKS +#define SHARED_FILTERED_CHUNKS_3D_NROWS (NUM_MPI_RANKS * 4) +#define SHARED_FILTERED_CHUNKS_3D_NCOLS (NUM_MPI_RANKS * 2) +#define SHARED_FILTERED_CHUNKS_3D_DEPTH (NUM_MPI_RANKS) #define SHARED_FILTERED_CHUNKS_3D_CH_NROWS (SHARED_FILTERED_CHUNKS_3D_NROWS / NUM_MPI_RANKS) #define SHARED_FILTERED_CHUNKS_3D_CH_NCOLS (SHARED_FILTERED_CHUNKS_3D_NCOLS / NUM_MPI_RANKS) @@ -186,4 +190,22 @@ typedef struct { #define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS 1 #define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS +/* Defines for the write file serially/read in parallel test */ +#define WRITE_SERIAL_READ_PARALLEL_DATASET_NAME "write_serial_read_parallel" +#define WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS 3 +#define WRITE_SERIAL_READ_PARALLEL_NROWS (NUM_MPI_RANKS * 4) +#define WRITE_SERIAL_READ_PARALLEL_NCOLS (NUM_MPI_RANKS * 2) +#define WRITE_SERIAL_READ_PARALLEL_DEPTH (NUM_MPI_RANKS) +#define WRITE_SERIAL_READ_PARALLEL_CH_NROWS (WRITE_SERIAL_READ_PARALLEL_NROWS / NUM_MPI_RANKS) +#define WRITE_SERIAL_READ_PARALLEL_CH_NCOLS (WRITE_SERIAL_READ_PARALLEL_NCOLS / NUM_MPI_RANKS) + +/* Defines for the write file in parallel/read serially test */ +#define WRITE_PARALLEL_READ_SERIAL_DATASET_NAME "write_parallel_read_serial" +#define WRITE_PARALLEL_READ_SERIAL_DATASET_DIMS 3 +#define WRITE_PARALLEL_READ_SERIAL_NROWS (NUM_MPI_RANKS * 4) +#define WRITE_PARALLEL_READ_SERIAL_NCOLS (NUM_MPI_RANKS * 2) +#define WRITE_PARALLEL_READ_SERIAL_DEPTH (NUM_MPI_RANKS) +#define WRITE_PARALLEL_READ_SERIAL_CH_NROWS (WRITE_PARALLEL_READ_SERIAL_NROWS / NUM_MPI_RANKS) +#define WRITE_PARALLEL_READ_SERIAL_CH_NCOLS (WRITE_PARALLEL_READ_SERIAL_NCOLS / NUM_MPI_RANKS) + #endif /* TEST_PARALLEL_FILTERS_H_ */ -- cgit v0.12 From 6738d35d8ac86b5591779b635fb6e7a57dcea37b Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 9 Aug 2017 21:21:49 -0500 Subject: Add data verification for first half of tests --- testpar/t_filters_parallel.c | 133 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 105 insertions(+), 28 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 37a94bb..3df5560 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -45,9 +45,6 @@ static void test_filtered_dataset_interleaved_write(void); static void test_3d_filtered_dataset_no_overlap_separate_pages(void); static void test_3d_filtered_dataset_no_overlap_same_pages(void); static void test_3d_filtered_dataset_overlap(void); -static void test_32d_filtered_dataset_no_overlap_separate_pages(void); -static void test_32d_filtered_dataset_no_overlap_same_pages(void); -static void test_32d_filtered_dataset_overlap(void); static void test_cmpd_filtered_dataset_no_conversion_unshared(void); static void test_cmpd_filtered_dataset_no_conversion_shared(void); static void test_cmpd_filtered_dataset_type_conversion_unshared(void); @@ -71,9 +68,6 @@ static void (*tests[])(void) = { test_3d_filtered_dataset_no_overlap_separate_pages, test_3d_filtered_dataset_no_overlap_same_pages, test_3d_filtered_dataset_overlap, - test_32d_filtered_dataset_no_overlap_separate_pages, - test_32d_filtered_dataset_no_overlap_same_pages, - test_32d_filtered_dataset_overlap, test_cmpd_filtered_dataset_no_conversion_unshared, test_cmpd_filtered_dataset_no_conversion_shared, test_cmpd_filtered_dataset_type_conversion_unshared, @@ -236,10 +230,13 @@ test_one_chunk_filtered_dataset(void) * Programmer: Jordan Henderson * 02/01/2017 */ +/* XXX: Done */ static void test_filtered_dataset_no_overlap(void) { C_DATATYPE *data = NULL; + C_DATATYPE *read_buf = NULL; + C_DATATYPE *correct_buf = NULL; hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t chunk_dims[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t sel_dims[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; @@ -247,7 +244,7 @@ test_filtered_dataset_no_overlap(void) hsize_t stride[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t block[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t offset[UNSHARED_FILTERED_CHUNKS_DATASET_DIMS]; - size_t i, data_size; + size_t i, data_size, correct_buf_size; hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; @@ -320,13 +317,20 @@ test_filtered_dataset_no_overlap(void) /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); data = (C_DATATYPE *) malloc(data_size); VRFY((NULL != data), "malloc succeeded"); + correct_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != correct_buf), "malloc succeeded"); + for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + correct_buf[i] = (C_DATATYPE) ((i % (NUM_MPI_RANKS * dataset_dims[1])) + (i / (NUM_MPI_RANKS * dataset_dims[1]))); + /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); VRFY((plist_id >= 0), "DXPL creation succeeded"); @@ -338,6 +342,22 @@ test_filtered_dataset_no_overlap(void) if (data) free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + + /* Verify the correct data was written */ + read_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != read_buf), "malloc succeeded"); + + dset_id = H5Dopen(file_id, "/" UNSHARED_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset open succeeded"); + + VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); + + VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); + + if (correct_buf) free(correct_buf); + if (read_buf) free(read_buf); + + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); @@ -356,10 +376,13 @@ test_filtered_dataset_no_overlap(void) * Programmer: Jordan Henderson * 02/01/2017 */ +/* XXX: Done */ static void test_filtered_dataset_overlap(void) { C_DATATYPE *data = NULL; + C_DATATYPE *read_buf = NULL; + C_DATATYPE *correct_buf = NULL; hsize_t dataset_dims[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t chunk_dims[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t sel_dims[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; @@ -367,7 +390,7 @@ test_filtered_dataset_overlap(void) hsize_t stride[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t block[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t offset[SHARED_FILTERED_CHUNKS_DATASET_DIMS]; - size_t i, data_size; + size_t i, data_size, correct_buf_size; hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; @@ -440,13 +463,20 @@ test_filtered_dataset_overlap(void) /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); data = (C_DATATYPE *) malloc(data_size); VRFY((NULL != data), "malloc succeeded"); + correct_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != correct_buf), "malloc succeeded"); + for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + correct_buf[i] = (dataset_dims[1] * (i / (NUM_MPI_RANKS * dataset_dims[1]))) + (i % dataset_dims[1]) + (((i % (NUM_MPI_RANKS * dataset_dims[1])) / dataset_dims[1]) % dataset_dims[1]); + /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); VRFY((plist_id >= 0), "DXPL creation succeeded"); @@ -458,6 +488,22 @@ test_filtered_dataset_overlap(void) if (data) free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + + /* Verify correct data was written */ + read_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != read_buf), "malloc succeeded"); + + dset_id = H5Dopen(file_id, "/" SHARED_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset open succeeded"); + + VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); + + VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); + + if (correct_buf) free(correct_buf); + if (read_buf) free(read_buf); + + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); @@ -478,10 +524,13 @@ test_filtered_dataset_overlap(void) * Programmer: Jordan Henderson * 02/01/2017 */ +/* XXX: Done */ static void test_filtered_dataset_single_no_selection(void) { C_DATATYPE *data = NULL; + C_DATATYPE *read_buf = NULL; + C_DATATYPE *correct_buf = NULL; hsize_t dataset_dims[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t chunk_dims[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t sel_dims[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; @@ -489,7 +538,7 @@ test_filtered_dataset_single_no_selection(void) hsize_t stride[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t block[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t offset[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - size_t i, data_size; + size_t i, data_size, correct_buf_size; hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; @@ -568,13 +617,20 @@ test_filtered_dataset_single_no_selection(void) /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); data = (C_DATATYPE *) malloc(data_size); VRFY((NULL != data), "malloc succeeded"); + correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "malloc succeeded"); + for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); + for (i = 0; i < (correct_buf_size / sizeof(*correct_buf)) - (NUM_MPI_RANKS * dataset_dims[1]); i++) + correct_buf[i] = (i % (NUM_MPI_RANKS * dataset_dims[1])) + (i / (NUM_MPI_RANKS * dataset_dims[1])); + /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); VRFY((plist_id >= 0), "DXPL creation succeeded"); @@ -586,6 +642,22 @@ test_filtered_dataset_single_no_selection(void) if (data) free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + + /* Verify the correct data was written */ + read_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != read_buf), "malloc succeeded"); + + dset_id = H5Dopen(file_id, "/" SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset open succeeded"); + + VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); + + VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); + + if (correct_buf) free(correct_buf); + if (read_buf) free(read_buf); + + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); @@ -607,14 +679,17 @@ test_filtered_dataset_single_no_selection(void) * Programmer: Jordan Henderson * 02/02/2017 */ +/* XXX: Done */ static void test_filtered_dataset_all_no_selection(void) { C_DATATYPE *data = NULL; + C_DATATYPE *read_buf = NULL; + C_DATATYPE *correct_buf = NULL; hsize_t dataset_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t chunk_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t sel_dims[ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - size_t i, data_size; + size_t i, data_size, correct_buf_size; hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; @@ -669,10 +744,14 @@ test_filtered_dataset_all_no_selection(void) /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); data = (C_DATATYPE *) malloc(data_size); VRFY((NULL != data), "malloc succeeded"); + correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != data), "malloc succeeded"); + for (i = 0; i < data_size / sizeof(*data); i++) data[i] = GEN_DATA(i); @@ -687,6 +766,22 @@ test_filtered_dataset_all_no_selection(void) if (data) free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + + /* Verify the correct data was written */ + read_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != read_buf), "malloc succeeded"); + + dset_id = H5Dopen(file_id, "/" ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset open succeeded"); + + VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); + + VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); + + if (correct_buf) free(correct_buf); + if (read_buf) free(read_buf); + + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); @@ -1326,24 +1421,6 @@ test_3d_filtered_dataset_overlap(void) return; } -static void -test_32d_filtered_dataset_no_overlap_separate_pages(void) -{ - return; -} - -static void -test_32d_filtered_dataset_no_overlap_same_pages(void) -{ - return; -} - -static void -test_32d_filtered_dataset_overlap(void) -{ - return; -} - /* * Tests parallel write of filtered data to unshared * chunks using a compound datatype which doesn't -- cgit v0.12 From 1ce6691a72d8a65febe8fe8ad877e72b28139adb Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 10 Aug 2017 14:12:01 -0500 Subject: Fix bug where incorrect amount of data was being read from the file --- src/H5Dmpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 393e155..5b415c5 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -3143,7 +3143,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk /* XXX: Test with MPI types and collective read to improve performance */ if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_entry->chunk_states.chunk_current.offset, - buf_size, H5AC_rawdata_dxpl_id, chunk_entry->buf) < 0) + chunk_entry->chunk_states.new_chunk.length, H5AC_rawdata_dxpl_id, chunk_entry->buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, -- cgit v0.12 From 9714dc1124547de56eb3ec08282a59b18d89eb15 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 10 Aug 2017 15:30:06 -0500 Subject: Test updates --- testpar/t_filters_parallel.c | 281 ++++++++++++++++++++++++++++++++++++------- testpar/t_filters_parallel.h | 2 +- 2 files changed, 241 insertions(+), 42 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 3df5560..0dc040d 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -21,8 +21,6 @@ * datasets in parallel with filters applied to the data. */ -/* XXX: Add data verification macro/function and check all data in all tests */ - #include "t_filters_parallel.h" const char *FILENAME[] = { @@ -326,7 +324,7 @@ test_filtered_dataset_no_overlap(void) VRFY((NULL != correct_buf), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); + data[i] = (C_DATATYPE) GEN_DATA(i); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = (C_DATATYPE) ((i % (NUM_MPI_RANKS * dataset_dims[1])) + (i / (NUM_MPI_RANKS * dataset_dims[1]))); @@ -472,10 +470,12 @@ test_filtered_dataset_overlap(void) VRFY((NULL != correct_buf), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); + data[i] = (C_DATATYPE) GEN_DATA(i); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) - correct_buf[i] = (dataset_dims[1] * (i / (NUM_MPI_RANKS * dataset_dims[1]))) + (i % dataset_dims[1]) + (((i % (NUM_MPI_RANKS * dataset_dims[1])) / dataset_dims[1]) % dataset_dims[1]); + correct_buf[i] = (C_DATATYPE) ((dataset_dims[1] * (i / (NUM_MPI_RANKS * dataset_dims[1]))) + + (i % dataset_dims[1]) + + (((i % (NUM_MPI_RANKS * dataset_dims[1])) / dataset_dims[1]) % dataset_dims[1])); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -626,10 +626,10 @@ test_filtered_dataset_single_no_selection(void) VRFY((NULL != correct_buf), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); + data[i] = (C_DATATYPE) GEN_DATA(i); for (i = 0; i < (correct_buf_size / sizeof(*correct_buf)) - (NUM_MPI_RANKS * dataset_dims[1]); i++) - correct_buf[i] = (i % (NUM_MPI_RANKS * dataset_dims[1])) + (i / (NUM_MPI_RANKS * dataset_dims[1])); + correct_buf[i] = (C_DATATYPE) ((i % (NUM_MPI_RANKS * dataset_dims[1])) + (i / (NUM_MPI_RANKS * dataset_dims[1]))); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -753,7 +753,7 @@ test_filtered_dataset_all_no_selection(void) VRFY((NULL != data), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); + data[i] = (C_DATATYPE) GEN_DATA(i); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -883,10 +883,12 @@ test_filtered_dataset_point_selection(void) VRFY((NULL != correct_buf), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); + data[i] = (C_DATATYPE) GEN_DATA(i); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) - correct_buf[i] = (dataset_dims[1] * (i / (NUM_MPI_RANKS * dataset_dims[1]))) + (i % dataset_dims[1]) + (((i % (NUM_MPI_RANKS * dataset_dims[1])) / dataset_dims[1]) % dataset_dims[1]); + correct_buf[i] = (C_DATATYPE) ((dataset_dims[1] * (i / (NUM_MPI_RANKS * dataset_dims[1]))) + + (i % dataset_dims[1]) + + (((i % (NUM_MPI_RANKS * dataset_dims[1])) / dataset_dims[1]) % dataset_dims[1])); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -934,10 +936,13 @@ test_filtered_dataset_point_selection(void) * Programmer: Jordan Henderson * 02/02/2017 */ +/* XXX: Done */ static void test_filtered_dataset_interleaved_write(void) { C_DATATYPE *data = NULL; + C_DATATYPE *read_buf = NULL; + C_DATATYPE *correct_buf = NULL; hsize_t dataset_dims[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; hsize_t chunk_dims[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; hsize_t sel_dims[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; @@ -945,7 +950,7 @@ test_filtered_dataset_interleaved_write(void) hsize_t stride[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; hsize_t block[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; hsize_t offset[INTERLEAVED_WRITE_FILTERED_DATASET_DIMS]; - size_t i, data_size; + size_t i, data_size, correct_buf_size; hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; @@ -1018,12 +1023,21 @@ test_filtered_dataset_interleaved_write(void) /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); + correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); data = (C_DATATYPE *) malloc(data_size); VRFY((NULL != data), "malloc succeeded"); + correct_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != correct_buf), "malloc succeeded"); + for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); + data[i] = (C_DATATYPE) GEN_DATA(i); + + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + correct_buf[i] = (C_DATATYPE) (((i % SHARED_FILTERED_CHUNKS_NCOLS) / SHARED_FILTERED_CHUNKS_CH_NCOLS) + + ((i % SHARED_FILTERED_CHUNKS_NCOLS) % SHARED_FILTERED_CHUNKS_CH_NCOLS) + + (SHARED_FILTERED_CHUNKS_CH_NCOLS * (i / SHARED_FILTERED_CHUNKS_NCOLS))); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -1036,6 +1050,22 @@ test_filtered_dataset_interleaved_write(void) if (data) free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + + /* Verify the correct data was written */ + read_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != read_buf), "malloc succeeded"); + + dset_id = H5Dopen(file_id, "/" INTERLEAVED_WRITE_FILTERED_DATASET_NAME, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset open succeeded"); + + VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); + + VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); + + if (correct_buf) free(correct_buf); + if (read_buf) free(read_buf); + + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); @@ -1052,10 +1082,13 @@ test_filtered_dataset_interleaved_write(void) * Programmer: Jordan Henderson * 02/06/2017 */ +/* XXX: Done */ static void test_3d_filtered_dataset_no_overlap_separate_pages(void) { C_DATATYPE *data = NULL; + C_DATATYPE *read_buf = NULL; + C_DATATYPE *correct_buf = NULL; hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; hsize_t chunk_dims[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; hsize_t sel_dims[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; @@ -1063,7 +1096,7 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) hsize_t stride[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; hsize_t block[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; hsize_t offset[UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS]; - size_t i, data_size; + size_t i, data_size, correct_buf_size; hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; @@ -1143,12 +1176,19 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); + correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); data = (C_DATATYPE *) malloc(data_size); VRFY((NULL != data), "malloc succeeded"); + correct_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != correct_buf), "malloc succeeded"); + for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); + data[i] = (C_DATATYPE) GEN_DATA(i); + + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + correct_buf[i] = (C_DATATYPE) ((i % NUM_MPI_RANKS) + (i / NUM_MPI_RANKS)); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -1161,6 +1201,22 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) if (data) free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + + /* Verify the correct data was written */ + read_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != read_buf), "malloc succeeded"); + + dset_id = H5Dopen(file_id, "/" UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset open succeeded"); + + VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); + + VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); + + if (correct_buf) free(correct_buf); + if (read_buf) free(read_buf); + + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); @@ -1178,10 +1234,13 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) * Programmer: Jordan Henderson * 02/06/2017 */ +/* XXX: Done */ static void test_3d_filtered_dataset_no_overlap_same_pages(void) { C_DATATYPE *data = NULL; + C_DATATYPE *read_buf = NULL; + C_DATATYPE *correct_buf = NULL; hsize_t dataset_dims[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; hsize_t chunk_dims[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; hsize_t sel_dims[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; @@ -1189,7 +1248,7 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) hsize_t stride[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; hsize_t block[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; hsize_t offset[UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS]; - size_t i, data_size; + size_t i, data_size, correct_buf_size; hid_t file_id, dset_id, plist_id; hid_t filespace, memspace; @@ -1269,12 +1328,19 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); + correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); data = (C_DATATYPE *) malloc(data_size); VRFY((NULL != data), "malloc succeeded"); + correct_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != correct_buf), "malloc succeeded"); + for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); + data[i] = (C_DATATYPE) GEN_DATA(i); + + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + correct_buf[i] = (C_DATATYPE) ((i % (dataset_dims[0] * dataset_dims[1])) + (i / (dataset_dims[0] * dataset_dims[1]))); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -1287,6 +1353,22 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) if (data) free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + + /* Verify the correct data was written */ + read_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != read_buf), "malloc succeeded"); + + dset_id = H5Dopen(file_id, "/" UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset open succeeded"); + + VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); + + VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); + + if (correct_buf) free(correct_buf); + if (read_buf) free(read_buf); + + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); @@ -1304,10 +1386,13 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) * Programmer: Jordan Henderson * 02/06/2017 */ +/* XXX: Done */ static void test_3d_filtered_dataset_overlap(void) { C_DATATYPE *data = NULL; + C_DATATYPE *read_buf = NULL; + C_DATATYPE *correct_buf = NULL; hsize_t dataset_dims[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; hsize_t chunk_dims[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; hsize_t sel_dims[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; @@ -1315,7 +1400,7 @@ test_3d_filtered_dataset_overlap(void) hsize_t stride[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; hsize_t block[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; hsize_t offset[SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS]; - size_t i, data_size; + size_t i, data_size, correct_buf_size; hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; @@ -1395,12 +1480,34 @@ test_3d_filtered_dataset_overlap(void) /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); + correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); data = (C_DATATYPE *) malloc(data_size); VRFY((NULL != data), "malloc succeeded"); + correct_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != correct_buf), "malloc succeeded"); + for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); + data[i] = (C_DATATYPE) GEN_DATA(i); + + /* This style of data verification is very ugly for cases like this, + * but avoids the problem of needing to have each rank send its data + * plus its selection to a single rank, then have that rank scatter + * all of the data one at a time to a single buffer and finally + * compare that buffer to the read buffer. - JTH + */ + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + /* Start with a base index */ + correct_buf[i] = (C_DATATYPE) ((i % NUM_MPI_RANKS) + /* Add the value for the increasing column index */ + + (NUM_MPI_RANKS * ((i % (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH)) / (NUM_MPI_RANKS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS))) + /* Add the value for the increasing row index */ + + ((SHARED_FILTERED_CHUNKS_3D_NCOLS * (SHARED_FILTERED_CHUNKS_3D_CH_NROWS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS / NUM_MPI_RANKS)) * (i / (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH * (SHARED_FILTERED_CHUNKS_3D_CH_NROWS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS / NUM_MPI_RANKS)))) + /* Add the value for the increasing row index in a particular chunk */ + + (SHARED_FILTERED_CHUNKS_3D_CH_NCOLS * ((i % (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH * (SHARED_FILTERED_CHUNKS_3D_CH_NROWS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS / NUM_MPI_RANKS))) / (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH))) + /* Add the value for the increasing column index in a particular chunk */ + + ((i % (SHARED_FILTERED_CHUNKS_3D_CH_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH)) / NUM_MPI_RANKS)); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -1413,6 +1520,22 @@ test_3d_filtered_dataset_overlap(void) if (data) free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + + /* Verify the correct data was written */ + read_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != read_buf), "malloc succeeded"); + + dset_id = H5Dopen(file_id, "/" SHARED_FILTERED_CHUNKS_3D_DATASET_NAME, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset open succeeded"); + + VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); + + VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); + + if (correct_buf) free(correct_buf); + if (read_buf) free(read_buf); + + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); @@ -1429,6 +1552,7 @@ test_3d_filtered_dataset_overlap(void) * Programmer: Jordan Henderson * 02/10/2017 */ +/* JTH: This test currently cannot be data-verified due to the floating-point data involved */ static void test_cmpd_filtered_dataset_no_conversion_unshared(void) { @@ -1522,8 +1646,12 @@ test_cmpd_filtered_dataset_no_conversion_unshared(void) /* Fill data buffer */ memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC); - for (i = 0; i < COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) - data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); + for (i = 0; i < COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) { + data[i].field1 = (short) GEN_DATA(i); + data[i].field2 = (int) GEN_DATA(i); + data[i].field3 = (long) GEN_DATA(i); + data[i].field4 = (double) GEN_DATA(i); + } /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -1551,6 +1679,7 @@ test_cmpd_filtered_dataset_no_conversion_unshared(void) * Programmer: Jordan Henderson * 02/10/2017 */ +/* JTH: This test currently cannot be data-verified due to the floating-point data involved */ static void test_cmpd_filtered_dataset_no_conversion_shared(void) { @@ -1644,8 +1773,12 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) /* Fill data buffer */ memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC); - for (i = 0; i < COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) - data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); + for (i = 0; i < COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) { + data[i].field1 = (short) GEN_DATA(i); + data[i].field2 = (int) GEN_DATA(i); + data[i].field3 = (long) GEN_DATA(i); + data[i].field4 = (double) GEN_DATA(i); + } /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -1670,7 +1803,7 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) * chunks using a compound datatype which requires a * datatype conversion. * - * This test currently fails because the datatype + * This test currently should fail because the datatype * conversion causes the parallel library to break * to independent I/O and this isn't allowed when * there are filters in the pipeline. @@ -1678,6 +1811,7 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) * Programmer: Jordan Henderson * 02/07/2017 */ +/* JTH: This test currently cannot be data-verified due to the floating-point data involved */ static void test_cmpd_filtered_dataset_type_conversion_unshared(void) { @@ -1780,8 +1914,12 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) /* Fill data buffer */ memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC); - for (i = 0; i < COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) - data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); + for (i = 0; i < COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) { + data[i].field1 = (short) GEN_DATA(i); + data[i].field2 = (int) GEN_DATA(i); + data[i].field3 = (long) GEN_DATA(i); + data[i].field4 = (double) GEN_DATA(i); + } /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -1810,7 +1948,7 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) * chunks using a compound datatype which requires * a datatype conversion. * - * This test currently fails because the datatype + * This test currently should fail because the datatype * conversion causes the parallel library to break * to independent I/O and this isn't allowed when * there are filters in the pipeline. @@ -1818,6 +1956,7 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) * Programmer: Jordan Henderson * 02/10/2017 */ +/* JTH: This test currently cannot be data-verified due to the floating-point data involved */ static void test_cmpd_filtered_dataset_type_conversion_shared(void) { @@ -1920,8 +2059,12 @@ test_cmpd_filtered_dataset_type_conversion_shared(void) /* Fill data buffer */ memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC); - for (i = 0; i < COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) - data[i].field1 = data[i].field2 = data[i].field3 = data[i].field4 = GEN_DATA(i); + for (i = 0; i < COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) { + data[i].field1 = (short) GEN_DATA(i); + data[i].field2 = (int) GEN_DATA(i); + data[i].field3 = (long) GEN_DATA(i); + data[i].field4 = (double) GEN_DATA(i); + } /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -1953,22 +2096,19 @@ test_cmpd_filtered_dataset_type_conversion_shared(void) * processes to ensure data correctness. * * Programmer: Jordan Henderson - * XXX: 02/10/2017 + * 08/03/2017 */ static void test_write_serial_read_parallel(void) { C_DATATYPE *data = NULL; + C_DATATYPE *read_buf = NULL; + C_DATATYPE *correct_buf = NULL; hsize_t dataset_dims[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; hsize_t chunk_dims[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; - hsize_t sel_dims[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; - hsize_t count[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; - hsize_t stride[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; - hsize_t block[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; - hsize_t offset[WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS]; - size_t i, j, k, data_size; + size_t i, data_size, correct_buf_size; hid_t file_id = -1, dset_id = -1, plist_id = -1; - hid_t filespace = -1, memspace = -1; + hid_t filespace = -1; if (MAINPROCESS) puts("Testing write file serially; read file in parallel"); @@ -1992,9 +2132,6 @@ test_write_serial_read_parallel(void) chunk_dims[0] = WRITE_SERIAL_READ_PARALLEL_CH_NROWS; chunk_dims[1] = WRITE_SERIAL_READ_PARALLEL_CH_NCOLS; chunk_dims[2] = 1; - sel_dims[0] = WRITE_SERIAL_READ_PARALLEL_NROWS; - sel_dims[1] = WRITE_SERIAL_READ_PARALLEL_NCOLS; - sel_dims[2] = 1; filespace = H5Screate_simple(WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -2021,7 +2158,7 @@ test_write_serial_read_parallel(void) VRFY((NULL != data), "malloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) - data[i] = GEN_DATA(i); + data[i] = (C_DATATYPE) GEN_DATA(i); VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) >= 0), "Dataset write succeeded"); @@ -2031,7 +2168,69 @@ test_write_serial_read_parallel(void) VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); } + correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); + + correct_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != correct_buf), "malloc succeeded"); + + read_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != read_buf), "malloc succeeded"); + + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + correct_buf[i] = (long) i; + /* All ranks open the file and verify their "portion" of the dataset is correct */ + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); + + dset_id = H5Dopen(file_id, "/" WRITE_SERIAL_READ_PARALLEL_DATASET_NAME, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset open succeeded"); + + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); + + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); + + VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); + + if (MAINPROCESS) { + printf("Correct buf: "); + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + printf("%ld, ", correct_buf[i]); + printf("\n\n"); + + printf("Read buf: "); + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + printf("%ld, ", read_buf[i]); + printf("\n\n"); + + fflush(stdout); + + MPI_Barrier(MPI_COMM_WORLD); + } + else { + fflush(stdout); + + MPI_Barrier(MPI_COMM_WORLD); + } + + /* VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); */ + + if (correct_buf) free(correct_buf); + if (read_buf) free(read_buf); + + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); return; } @@ -2044,7 +2243,7 @@ test_write_serial_read_parallel(void) * process to ensure data correctness. * * Programmer: Jordan Henderson - * XXX: 02/10/2017 + * 08/03/2017 */ static void test_write_parallel_read_serial(void) diff --git a/testpar/t_filters_parallel.h b/testpar/t_filters_parallel.h index d098b66..4666033 100644 --- a/testpar/t_filters_parallel.h +++ b/testpar/t_filters_parallel.h @@ -48,7 +48,7 @@ size_t cd_nelmts = FILTER_NUM_CDVALUES; #define HDF5_DATATYPE_NAME H5T_NATIVE_LONG #define GEN_DATA(i) INCREMENTAL_DATA(i) -#define INCREMENTAL_DATA(i) (mpi_rank + i) /* Generates incremental test data */ +#define INCREMENTAL_DATA(i) ((size_t) mpi_rank + i) /* Generates incremental test data */ /* XXX: For experimental purposes only, will causes tests to fail data verification phase */ /* #define GEN_DATA(i) RANK_DATA(i) */ /* Given an index value i, generates test data based upon selected mode */ -- cgit v0.12 From f59bfd17545e7af35f13a4abddfc75c5875438d5 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 11 Aug 2017 11:22:51 -0500 Subject: Fix uninitialized array issue in test --- testpar/t_filters_parallel.c | 40 +++++----------------------------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 0dc040d..f84c2db 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -81,7 +81,6 @@ static void (*tests[])(void) = { * Programmer: Jordan Henderson * 02/01/2017 */ -/* XXX: DONE */ static void test_one_chunk_filtered_dataset(void) { @@ -228,7 +227,6 @@ test_one_chunk_filtered_dataset(void) * Programmer: Jordan Henderson * 02/01/2017 */ -/* XXX: Done */ static void test_filtered_dataset_no_overlap(void) { @@ -374,7 +372,6 @@ test_filtered_dataset_no_overlap(void) * Programmer: Jordan Henderson * 02/01/2017 */ -/* XXX: Done */ static void test_filtered_dataset_overlap(void) { @@ -524,7 +521,6 @@ test_filtered_dataset_overlap(void) * Programmer: Jordan Henderson * 02/01/2017 */ -/* XXX: Done */ static void test_filtered_dataset_single_no_selection(void) { @@ -679,7 +675,6 @@ test_filtered_dataset_single_no_selection(void) * Programmer: Jordan Henderson * 02/02/2017 */ -/* XXX: Done */ static void test_filtered_dataset_all_no_selection(void) { @@ -797,7 +792,6 @@ test_filtered_dataset_all_no_selection(void) * Programmer: Jordan Henderson * 02/02/2017 */ -/* XXX: DONE */ static void test_filtered_dataset_point_selection(void) { @@ -936,7 +930,6 @@ test_filtered_dataset_point_selection(void) * Programmer: Jordan Henderson * 02/02/2017 */ -/* XXX: Done */ static void test_filtered_dataset_interleaved_write(void) { @@ -1082,7 +1075,6 @@ test_filtered_dataset_interleaved_write(void) * Programmer: Jordan Henderson * 02/06/2017 */ -/* XXX: Done */ static void test_3d_filtered_dataset_no_overlap_separate_pages(void) { @@ -1234,7 +1226,6 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) * Programmer: Jordan Henderson * 02/06/2017 */ -/* XXX: Done */ static void test_3d_filtered_dataset_no_overlap_same_pages(void) { @@ -1386,7 +1377,6 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) * Programmer: Jordan Henderson * 02/06/2017 */ -/* XXX: Done */ static void test_3d_filtered_dataset_overlap(void) { @@ -2112,6 +2102,10 @@ test_write_serial_read_parallel(void) if (MAINPROCESS) puts("Testing write file serially; read file in parallel"); + dataset_dims[0] = WRITE_SERIAL_READ_PARALLEL_NROWS; + dataset_dims[1] = WRITE_SERIAL_READ_PARALLEL_NCOLS; + dataset_dims[2] = WRITE_SERIAL_READ_PARALLEL_DEPTH; + /* Write the file on the MAINPROCESS rank */ if (MAINPROCESS) { /* Set up file access property list */ @@ -2126,9 +2120,6 @@ test_write_serial_read_parallel(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = WRITE_SERIAL_READ_PARALLEL_NROWS; - dataset_dims[1] = WRITE_SERIAL_READ_PARALLEL_NCOLS; - dataset_dims[2] = WRITE_SERIAL_READ_PARALLEL_DEPTH; chunk_dims[0] = WRITE_SERIAL_READ_PARALLEL_CH_NROWS; chunk_dims[1] = WRITE_SERIAL_READ_PARALLEL_CH_NCOLS; chunk_dims[2] = 1; @@ -2202,28 +2193,7 @@ test_write_serial_read_parallel(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - if (MAINPROCESS) { - printf("Correct buf: "); - for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) - printf("%ld, ", correct_buf[i]); - printf("\n\n"); - - printf("Read buf: "); - for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) - printf("%ld, ", read_buf[i]); - printf("\n\n"); - - fflush(stdout); - - MPI_Barrier(MPI_COMM_WORLD); - } - else { - fflush(stdout); - - MPI_Barrier(MPI_COMM_WORLD); - } - - /* VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); */ + VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) free(correct_buf); if (read_buf) free(read_buf); -- cgit v0.12 From 1eb775801535d787c521caaf72d68856eeb3b09c Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 11 Aug 2017 14:09:51 -0500 Subject: Add test for write parallel; read serial case --- testpar/t_filters_parallel.c | 144 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 142 insertions(+), 2 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index f84c2db..186c7c4 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -2218,9 +2218,150 @@ test_write_serial_read_parallel(void) static void test_write_parallel_read_serial(void) { + C_DATATYPE *data = NULL; + C_DATATYPE *read_buf = NULL; + C_DATATYPE *correct_buf = NULL; + hsize_t dataset_dims[WRITE_PARALLEL_READ_SERIAL_DATASET_DIMS]; + hsize_t chunk_dims[WRITE_PARALLEL_READ_SERIAL_DATASET_DIMS]; + hsize_t sel_dims[WRITE_PARALLEL_READ_SERIAL_DATASET_DIMS]; + hsize_t count[WRITE_PARALLEL_READ_SERIAL_DATASET_DIMS]; + hsize_t stride[WRITE_PARALLEL_READ_SERIAL_DATASET_DIMS]; + hsize_t block[WRITE_PARALLEL_READ_SERIAL_DATASET_DIMS]; + hsize_t offset[WRITE_PARALLEL_READ_SERIAL_DATASET_DIMS]; + size_t i, data_size, correct_buf_size; + hid_t file_id = -1, dset_id = -1, plist_id = -1; + hid_t filespace = -1, memspace = -1; + + if (MAINPROCESS) puts("Testing write file in parallel; read serially"); + + /* Set up file access property list with parallel I/O access */ + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); + + /* Create the dataspace for the dataset */ + dataset_dims[0] = WRITE_PARALLEL_READ_SERIAL_NROWS; + dataset_dims[1] = WRITE_PARALLEL_READ_SERIAL_NCOLS; + dataset_dims[2] = WRITE_PARALLEL_READ_SERIAL_DEPTH; + chunk_dims[0] = WRITE_PARALLEL_READ_SERIAL_CH_NROWS; + chunk_dims[1] = WRITE_PARALLEL_READ_SERIAL_CH_NCOLS; + chunk_dims[2] = 1; + sel_dims[0] = WRITE_PARALLEL_READ_SERIAL_CH_NROWS; + sel_dims[1] = WRITE_PARALLEL_READ_SERIAL_NCOLS; + sel_dims[2] = WRITE_PARALLEL_READ_SERIAL_DEPTH; + + filespace = H5Screate_simple(WRITE_PARALLEL_READ_SERIAL_DATASET_DIMS, dataset_dims, NULL); + VRFY((filespace >= 0), "File dataspace creation succeeded"); + + memspace = H5Screate_simple(WRITE_PARALLEL_READ_SERIAL_DATASET_DIMS, sel_dims, NULL); + VRFY((memspace >= 0), "Memory dataspace creation succeeded"); + + /* Create chunked dataset */ + plist_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((plist_id >= 0), "DCPL creation succeeded"); + + VRFY((H5Pset_chunk(plist_id, WRITE_PARALLEL_READ_SERIAL_DATASET_DIMS, chunk_dims) >= 0), "Chunk size set"); + + /* Add test filter to the pipeline */ + VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); + + dset_id = H5Dcreate(file_id, WRITE_PARALLEL_READ_SERIAL_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + H5P_DEFAULT, plist_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset creation succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + + /* Each process defines the dataset selection in memory and writes + * it to the hyperslab in the file + */ + count[0] = 1; + count[1] = WRITE_PARALLEL_READ_SERIAL_NCOLS / WRITE_PARALLEL_READ_SERIAL_CH_NCOLS; + count[2] = NUM_MPI_RANKS; + stride[0] = WRITE_PARALLEL_READ_SERIAL_CH_NROWS; + stride[1] = WRITE_PARALLEL_READ_SERIAL_CH_NCOLS; + stride[2] = 1; + block[0] = WRITE_PARALLEL_READ_SERIAL_CH_NROWS; + block[1] = WRITE_PARALLEL_READ_SERIAL_CH_NCOLS; + block[2] = 1; + offset[0] = ((hsize_t) mpi_rank * WRITE_PARALLEL_READ_SERIAL_CH_NROWS * count[0]); + offset[1] = 0; + offset[2] = 0; + + if (VERBOSE_MED) + printf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ %llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n", + mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0], offset[1], offset[2], block[0], block[1], block[2]); + + /* Select hyperslab in the file */ + filespace = H5Dget_space(dset_id); + VRFY((filespace >= 0), "File dataspace retrieval succeeded"); + + VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); + + /* Fill data buffer */ + data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); + + data = (C_DATATYPE *) malloc(data_size); + VRFY((NULL != data), "malloc succeeded"); + + for (i = 0; i < data_size / sizeof(*data); i++) + data[i] = (C_DATATYPE) GEN_DATA(i); + + /* Create property list for collective dataset write */ + plist_id = H5Pcreate(H5P_DATASET_XFER); + VRFY((plist_id >= 0), "DXPL creation succeeded"); + + VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded"); + + VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); + + if (data) free(data); + + VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); + VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); + VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); if (MAINPROCESS) { + plist_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((plist_id >= 0), "FAPL creation succeeded"); + + VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0), "Set libver bounds succeeded"); + + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id); + VRFY((file_id >= 0), "Test file open succeeded"); + + VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); + + dset_id = H5Dopen(file_id, "/" WRITE_PARALLEL_READ_SERIAL_DATASET_NAME, H5P_DEFAULT); + VRFY((dset_id >= 0), "Dataset open succeeded"); + + correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); + + correct_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != correct_buf), "malloc succeeded"); + read_buf = (C_DATATYPE *) malloc(correct_buf_size); + VRFY((NULL != read_buf), "malloc succeeded"); + + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + correct_buf[i] = (C_DATATYPE) ((i % (dataset_dims[0] * dataset_dims[1])) + (i / (dataset_dims[0] * dataset_dims[1])));; + + VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) >= 0), "Dataset read succeeded"); + + VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); + + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); + VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); } return; @@ -2297,8 +2438,7 @@ exit: ALARM_OFF; - /* XXX: Commented for testing */ - /* h5_clean_files(FILENAME, fapl); */ + h5_clean_files(FILENAME, fapl); H5close(); -- cgit v0.12 From af3474f05e89ecd13fd3e6a3b1fdf0556286c3f5 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 11 Aug 2017 14:32:00 -0500 Subject: Amend MANIFEST --- MANIFEST | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MANIFEST b/MANIFEST index dda7af8..4eadd0d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1234,8 +1234,8 @@ ./testpar/t_file.c ./testpar/t_file_image.c ./testpar/t_filter_read.c -./testpar/tfilters_parallel.c -./testpar/tfilters_parallel.h +./testpar/t_filters_parallel.c +./testpar/t_filters_parallel.h ./testpar/t_mdset.c ./testpar/t_mpi.c ./testpar/t_ph5basic.c -- cgit v0.12 From f84af6ecc6ec547545c167018ea3400f9171c8ab Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Tue, 15 Aug 2017 09:17:04 -0400 Subject: Fix the t_bigio test so that it runs on 32bit machines --- testpar/t_bigio.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index a4a1323..ca2b55d 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -785,7 +785,7 @@ dataset_big_write(void) } /* create a memory dataspace */ - mem_dataspace = H5Screate_simple (1, &bigcount, NULL); + mem_dataspace = H5Screate_simple (1, dims, NULL); VRFY((mem_dataspace >= 0), ""); /* set up the collective transfer properties list */ @@ -903,7 +903,7 @@ dataset_big_write(void) VRFY((ret >= 0), "H5Dclose1 succeeded"); free(wdata); -#endif +#endif H5Fclose(fid); } @@ -1217,7 +1217,7 @@ dataset_big_read(void) if(coords) free(coords); /* create a memory dataspace */ - mem_dataspace = H5Screate_simple (1, &bigcount, NULL); + mem_dataspace = H5Screate_simple (1, dims, NULL); VRFY((mem_dataspace >= 0), ""); /* set up the collective transfer properties list */ @@ -1684,8 +1684,9 @@ coll_chunktest(const char* filename, VRFY((mem_dataspace >= 0), "mem dataspace created succeeded"); } else { + hsize_t dsdims[1] = {num_points}; current_dims = num_points; - mem_dataspace = H5Screate_simple (1, ¤t_dims, NULL); + mem_dataspace = H5Screate_simple (1, dsdims, NULL); VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); } @@ -1962,8 +1963,9 @@ coll_chunktest(const char* filename, VRFY((mem_dataspace >= 0), ""); } else { + hsize_t dsdims[1] = {num_points}; current_dims = num_points; - mem_dataspace = H5Screate_simple (1, ¤t_dims, NULL); + mem_dataspace = H5Screate_simple (1, dsdims, NULL); VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); } -- cgit v0.12 From 85699e41c26e27fa0259a631a04388790b6e82ae Mon Sep 17 00:00:00 2001 From: mainzer Date: Tue, 15 Aug 2017 15:54:34 -0500 Subject: Updated H5C__flush_single_entry() in H5C.c to correct duplicate metadata write bug observed in 1.10.1. Tested parallel/production on jelly parallel/debug & parallel/production on charis (in develop branch) --- src/H5C.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/H5C.c b/src/H5C.c index e6770ec..371fc90 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -6273,17 +6273,27 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "unable to insert skip list item") } /* end if */ else + { #endif /* H5_HAVE_PARALLEL */ - if(entry_ptr->prefetched) { - HDassert(entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); - mem_type = cache_ptr->class_table_ptr[entry_ptr->prefetch_type_id]->mem_type; - } /* end if */ - else - mem_type = entry_ptr->type->mem_type; + if(entry_ptr->prefetched) { + HDassert(entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); + mem_type = cache_ptr-> + class_table_ptr[entry_ptr->prefetch_type_id]-> + mem_type; + } /* end if */ + else + mem_type = entry_ptr->type->mem_type; - if(H5F_block_write(f, mem_type, entry_ptr->addr, entry_ptr->size, dxpl_id, entry_ptr->image_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't write image to file") + if(H5F_block_write(f, mem_type, entry_ptr->addr, + entry_ptr->size, dxpl_id, + entry_ptr->image_ptr) < 0) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "Can't write image to file") +#ifdef H5_HAVE_PARALLEL + } +#endif /* H5_HAVE_PARALLEL */ } /* end if */ /* if the entry has a notify callback, notify it that we have -- cgit v0.12 From 1cf7c7ecc90b408fed818b00153a2d36295da801 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Tue, 15 Aug 2017 16:36:26 -0500 Subject: Modify t_dset.c in lieu of Parallel Compression changes --- testpar/t_dset.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/testpar/t_dset.c b/testpar/t_dset.c index b952bf3..65d1bb4 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -2651,11 +2651,8 @@ compress_readAll(void) nerrors++; } - /* Writing to the compressed, chunked dataset in parallel should fail */ - H5E_BEGIN_TRY { - ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read); - } H5E_END_TRY; - VRFY((ret < 0), "H5Dwrite failed"); + ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read); + VRFY((ret >= 0), "H5Dwrite succeeded"); ret = H5Pclose(xfer_plist); VRFY((ret >= 0), "H5Pclose succeeded"); -- cgit v0.12 From 164eee91cfdf18e870519099fbad388a6ccb85cf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 16 Aug 2017 15:01:29 -0500 Subject: HDFFV-10188 - Check for empty string first --- tools/lib/h5tools_ref.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index e000080..16a949d 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -164,7 +164,8 @@ haddr_t ref_path_table_lookup(const char *thepath) { H5O_info_t oi; - + if((HDstrlen(thepath) == 0) || (thepath == NULL)) + return HADDR_UNDEF; /* Allow lookups on the root group, even though it doesn't have any link info */ if(HDstrcmp(thepath, "/")) { H5L_info_t li; -- cgit v0.12 From 6e8b9dcfd4a0423ec8518a8f9a5107ab7e854414 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 21 Aug 2017 09:33:54 -0500 Subject: HDFFV-10188 add release note --- release_docs/RELEASE.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 2dbe7e9..3f9e9c0 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -147,6 +147,16 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5ls + + h5ls generated error on stack when it encountered a H5S_NULL + dataspace. + + Adding checks for H5S_NULL before calling H5Sis_simple (located + in the h5tools_dump_mem function) fixed the issue. + + (ADB - 2017/08/17, HDFFV-10188) + - h5dump h5dump segfaulted on output of XML file. -- cgit v0.12 From f695491f05ebc6306fc873501174c71e8751a6ce Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 21 Aug 2017 10:35:49 -0500 Subject: HDFFV-10188 enable null space test --- tools/test/h5dump/CMakeTestsXML.cmake | 8 ++++--- tools/test/h5dump/testh5dumpxml.sh.in | 4 +--- tools/testfiles/tnullspace.h5.xml | 39 +++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 tools/testfiles/tnullspace.h5.xml diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index bdc6755..e068c5e 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -53,6 +53,7 @@ ${HDF5_TOOLS_DIR}/testfiles/test35.nc ${HDF5_TOOLS_DIR}/testfiles/tnestedcomp.h5 ${HDF5_TOOLS_DIR}/testfiles/tnodata.h5 + ${HDF5_TOOLS_DIR}/testfiles/tnullspace.h5 ${HDF5_TOOLS_DIR}/testfiles/tobjref.h5 ${HDF5_TOOLS_DIR}/testfiles/topaque.h5 ${HDF5_TOOLS_DIR}/testfiles/torderattr.h5 @@ -117,6 +118,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tname-sp.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tnestedcomp.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tnodata.h5.xml + ${HDF5_TOOLS_DIR}/testfiles/tnullspace.h5.xml ${HDF5_TOOLS_DIR}/testfiles/tobjref.h5.xml ${HDF5_TOOLS_DIR}/testfiles/topaque.h5.xml ${HDF5_TOOLS_DIR}/testfiles/torderattr1.h5.xml @@ -296,6 +298,8 @@ tnodata.h5.out.err tnoname.h5.out tnoname.h5.out.err + tnullspace.h5.out + tnullspace.h5.out.err tobjref.h5.out tobjref.h5.out.err topaque.h5.out @@ -402,9 +406,7 @@ ADD_XML_H5_TEST (tsaf.h5 0 tsaf.h5) ADD_XML_H5_TEST (tempty.h5 0 tempty.h5) ADD_XML_H5_TEST (tnamed_dtype_attr.h5 0 tnamed_dtype_attr.h5) - ##Test dataset and attribute of null space. Commented out: - ## wait until the XML schema is updated for null space. - ## ADD_XML_H5_TEST (tnullspace.h5 0 tnulspace.h5) + ADD_XML_H5_TEST (tnullspace.h5 0 tnullspace.h5) ## So is dataspace with 0 dimension size. ## ADD_XML_H5_TEST (zerodim.h5 0 zerodim.h5) diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index b3b9e14..f740a34 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -355,9 +355,7 @@ TOOLTEST tvlstr.h5.xml --xml tvlstr.h5 TOOLTEST tsaf.h5.xml --xml tsaf.h5 TOOLTEST tempty.h5.xml --xml tempty.h5 TOOLTEST tnamed_dtype_attr.h5.xml --xml tnamed_dtype_attr.h5 -##Test dataset and attribute of null space. Commented out: -## wait until the XML schema is updated for null space. -##TOOLTEST tnullspace.h5.xml --xml tnulspace.h5 +TOOLTEST tnullspace.h5.xml --xml tnullspace.h5 # other options for xml diff --git a/tools/testfiles/tnullspace.h5.xml b/tools/testfiles/tnullspace.h5.xml new file mode 100644 index 0000000..b1c1974 --- /dev/null +++ b/tools/testfiles/tnullspace.h5.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v0.12 From 138c3ee3667f0c6df69ee4dfdc8e4d4dea8ff15a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 21 Aug 2017 11:56:31 -0500 Subject: HDFFV-10188 Add tests and files --- MANIFEST | 4 +++ tools/test/h5dump/CMakeTests.cmake | 5 ++++ tools/test/h5dump/h5dumpgentest.c | 51 ++++++++++++++++++++++++++++++++----- tools/test/h5dump/testh5dump.sh.in | 3 +++ tools/test/h5ls/CMakeTests.cmake | 7 +++++ tools/test/h5ls/testh5ls.sh.in | 5 ++++ tools/testfiles/tgrpnullspace.ddl | 33 ++++++++++++++++++++++++ tools/testfiles/tgrpnullspace.h5 | Bin 0 -> 2504 bytes tools/testfiles/tgrpnullspace.ls | 7 +++++ 9 files changed, 109 insertions(+), 6 deletions(-) create mode 100644 tools/testfiles/tgrpnullspace.ddl create mode 100644 tools/testfiles/tgrpnullspace.h5 create mode 100644 tools/testfiles/tgrpnullspace.ls diff --git a/MANIFEST b/MANIFEST index 2c3659e..bb2dc14 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1712,6 +1712,9 @@ ./tools/testfiles/tgrp_comments.ls ./tools/testfiles/tgrp_comments.ddl ./tools/testfiles/tgrp_comments.h5 +./tools/testfiles/tgrpnullspace.h5 +./tools/testfiles/tgrpnullspace.ddl +./tools/testfiles/tgrpnullspace.ls ./tools/testfiles/thlink-1.ddl ./tools/testfiles/thlink-2.ddl ./tools/testfiles/thlink-3.ddl @@ -1767,6 +1770,7 @@ ./tools/testfiles/tno-subset.h5 ./tools/testfiles/tno-subset.ddl ./tools/testfiles/tnullspace.h5 +./tools/testfiles/tnullspace.h5.xml ./tools/testfiles/tnullspace.ddl ./tools/testfiles/tobjref.h5 ./tools/testfiles/topaque.h5 diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index 0a72709..d3d1c4d 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -104,6 +104,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tgroup-1.ddl ${HDF5_TOOLS_DIR}/testfiles/tgroup-2.ddl ${HDF5_TOOLS_DIR}/testfiles/tgrp_comments.ddl + ${HDF5_TOOLS_DIR}/testfiles/tgrpnullspace.ddl ${HDF5_TOOLS_DIR}/testfiles/thlink-1.ddl ${HDF5_TOOLS_DIR}/testfiles/thlink-2.ddl ${HDF5_TOOLS_DIR}/testfiles/thlink-3.ddl @@ -272,6 +273,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tfvalues.h5 ${HDF5_TOOLS_DIR}/testfiles/tgroup.h5 ${HDF5_TOOLS_DIR}/testfiles/tgrp_comments.h5 + ${HDF5_TOOLS_DIR}/testfiles/tgrpnullspace.h5 ${HDF5_TOOLS_DIR}/testfiles/thlink.h5 ${HDF5_TOOLS_DIR}/testfiles/thyperslab.h5 ${HDF5_TOOLS_DIR}/testfiles/tints4dims.h5 @@ -887,6 +889,8 @@ tgroup-2.out.err tgrp_comments.out tgrp_comments.out.err + tgrpnullspace.out + tgrpnullspace.out.err thlink-1.out thlink-1.out.err thlink-2.out @@ -1394,6 +1398,7 @@ # test for displaying dataset and attribute of null space ADD_H5_TEST (tnullspace 0 --enable-error-stack tnullspace.h5) + ADD_H5_TEST (tgrpnullspace 0 -p --enable-error-stack tgrpnullspace.h5) # test for displaying dataset and attribute of space with 0 dimension size ADD_H5_TEST (zerodim 0 --enable-error-stack zerodim.h5) diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 2128acb..0eaa2d0 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -112,6 +112,7 @@ #define FILE82 "tcompound_complex2.h5" #define FILE83 "tvlenstr_array.h5" #define FILE84 "tudfilter.h5" +#define FILE85 "tgrpnullspace.h5" /*------------------------------------------------------------------------- * prototypes @@ -286,9 +287,9 @@ typedef struct s1_t { #define F64_DIM1 (F64_ARRAY_BUF_LEN / sizeof(int) + 1) /* File 65 macros */ -#define STRATEGY H5F_FSPACE_STRATEGY_NONE /* File space handling strategy */ -#define THRESHOLD10 10 /* Free-space section threshold */ -#define FSPACE_PAGE_SIZE 8192 /* File space page size */ +#define STRATEGY H5F_FSPACE_STRATEGY_NONE /* File space handling strategy */ +#define THRESHOLD10 10 /* Free-space section threshold */ +#define FSPACE_PAGE_SIZE 8192 /* File space page size */ /* "FILE66" macros and for FILE69 */ #define F66_XDIM 8 @@ -7041,8 +7042,8 @@ gent_extlinks(void) * Function: gent_fs_strategy_threshold * * Purpose: Generate a file with non-default file space strategy, - * non-default free-space section threshold, - * non-default file space page size. + * non-default free-space section threshold, + * non-default file space page size. *------------------------------------------------------------------------- */ static void @@ -9721,7 +9722,7 @@ static void gent_bitnopaquefields(void) uint32_t c; uint64_t d; } s_t; - + hid_t file, grp=-1, type=-1, space=-1, dset=-1; size_t i; hsize_t nelmts = F80_DIM32; @@ -10437,6 +10438,43 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, *------------------------------------------------------------------------- */ +/*------------------------------------------------------------------------- + * Function: gent_null_space_group + * + * Purpose: generates dataset and attribute of null dataspace in a group + *------------------------------------------------------------------------- + */ +static void gent_null_space_group(void) +{ + hid_t fid, root, group, dataset, space, attr; + int dset_buf = 10; + int point = 4; + + fid = H5Fcreate(FILE85, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + root = H5Gopen2(fid, "/", H5P_DEFAULT); + + group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* null space */ + space = H5Screate(H5S_NULL); + + /* dataset */ + dataset = H5Dcreate2(group, "dset", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + /* nothing should be written */ + H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dset_buf); + + /* attribute */ + attr = H5Acreate2(group, "attr", H5T_NATIVE_UINT, space, H5P_DEFAULT, H5P_DEFAULT); + H5Awrite(attr, H5T_NATIVE_INT, &point); /* Nothing can be written */ + + H5Dclose(dataset); + H5Aclose(attr); + H5Gclose(group); + H5Gclose(root); + H5Sclose(space); + H5Fclose(fid); +} + int main(void) { gent_group(); @@ -10526,6 +10564,7 @@ int main(void) gent_bitnopaquefields(); gent_intsfourdims(); + gent_null_space_group(); gent_udfilter(); diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index f0c01e6..1935b0d 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -132,6 +132,7 @@ $SRC_H5DUMP_TESTFILES/tfpformat.h5 $SRC_H5DUMP_TESTFILES/tfvalues.h5 $SRC_H5DUMP_TESTFILES/tgroup.h5 $SRC_H5DUMP_TESTFILES/tgrp_comments.h5 +$SRC_H5DUMP_TESTFILES/tgrpnullspace.h5 $SRC_H5DUMP_TESTFILES/thlink.h5 $SRC_H5DUMP_TESTFILES/thyperslab.h5 $SRC_H5DUMP_TESTFILES/tintsattrs.h5 @@ -260,6 +261,7 @@ $SRC_H5DUMP_TESTFILES/tfpformat.ddl $SRC_H5DUMP_TESTFILES/tgroup-1.ddl $SRC_H5DUMP_TESTFILES/tgroup-2.ddl $SRC_H5DUMP_TESTFILES/tgrp_comments.ddl +$SRC_H5DUMP_TESTFILES/tgrpnullspace.ddl $SRC_H5DUMP_TESTFILES/thlink-1.ddl $SRC_H5DUMP_TESTFILES/thlink-2.ddl $SRC_H5DUMP_TESTFILES/thlink-3.ddl @@ -1268,6 +1270,7 @@ TOOLTEST thyperslab.ddl --enable-error-stack thyperslab.h5 # test for displaying dataset and attribute of null space TOOLTEST tnullspace.ddl --enable-error-stack tnullspace.h5 +TOOLTEST tgrpnullspace.ddl -p --enable-error-stack tgrpnullspace.h5 # test for displaying dataset and attribute of space with 0 dimension size TOOLTEST zerodim.ddl --enable-error-stack zerodim.h5 diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index 5f61eab..62ee835 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -33,6 +33,7 @@ ${HDF5_TOOLS_DIR}/testfiles/textlinktar.h5 ${HDF5_TOOLS_DIR}/testfiles/tgroup.h5 ${HDF5_TOOLS_DIR}/testfiles/tgrp_comments.h5 + ${HDF5_TOOLS_DIR}/testfiles/tgrpnullspace.h5 ${HDF5_TOOLS_DIR}/testfiles/thlink.h5 ${HDF5_TOOLS_DIR}/testfiles/tloop.h5 ${HDF5_TOOLS_DIR}/testfiles/tnestedcomp.h5 @@ -89,6 +90,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tgroup-1.ls ${HDF5_TOOLS_DIR}/testfiles/tgroup-2.ls ${HDF5_TOOLS_DIR}/testfiles/tgroup-3.ls + ${HDF5_TOOLS_DIR}/testfiles/tgrpnullspace.ls ${HDF5_TOOLS_DIR}/testfiles/thlink-1.ls ${HDF5_TOOLS_DIR}/testfiles/tloop-1.ls ${HDF5_TOOLS_DIR}/testfiles/tmultifile.ls @@ -241,6 +243,8 @@ textlinksrc-7-old.out.err tgrp_comments.out tgrp_comments.out.err + tgrpnullspace.out + tgrpnullspace.out.err tsoftlinks-1.out tsoftlinks-1.out.err tsoftlinks-2.out @@ -415,6 +419,9 @@ # test for empty data ADD_H5_TEST (tempty 0 -w80 -d tempty.h5) + # test for displaying dataset and attribute of null space + ADD_H5_TEST (tgrpnullspace 0 -w80 -v tgrpnullspace.h5) + # test for all dataset types written to attributes # enable -S for avoiding printing NATIVE types ADD_H5_TEST (tattr2 0 -w80 -v -S tattr2.h5) diff --git a/tools/test/h5ls/testh5ls.sh.in b/tools/test/h5ls/testh5ls.sh.in index a88ae88..6259af8 100644 --- a/tools/test/h5ls/testh5ls.sh.in +++ b/tools/test/h5ls/testh5ls.sh.in @@ -80,6 +80,7 @@ $SRC_H5LS_TESTFILES/textlinksrc.h5 $SRC_H5LS_TESTFILES/textlinktar.h5 $SRC_H5LS_TESTFILES/tgroup.h5 $SRC_H5LS_TESTFILES/tgrp_comments.h5 +$SRC_H5LS_TESTFILES/tgrpnullspace.h5 $SRC_H5LS_TESTFILES/thlink.h5 $SRC_H5LS_TESTFILES/tloop.h5 $SRC_H5LS_TESTFILES/tnestedcomp.h5 @@ -135,6 +136,7 @@ $SRC_H5LS_TESTFILES/tgroup.ls $SRC_H5LS_TESTFILES/tgroup-1.ls $SRC_H5LS_TESTFILES/tgroup-2.ls $SRC_H5LS_TESTFILES/tgroup-3.ls +$SRC_H5LS_TESTFILES/tgrpnullspace.ls $SRC_H5LS_TESTFILES/thlink-1.ls $SRC_H5LS_TESTFILES/tloop-1.ls $SRC_H5LS_TESTFILES/tmultifile.ls @@ -392,6 +394,9 @@ TOOLTEST tarray1.ls 0 -w80 -r -d tarray1.h5 # test for empty data TOOLTEST tempty.ls 0 -w80 -d tempty.h5 +# test for displaying dataset and attribute of null space +TOOLTEST tgrpnullspace.ls 0 -w80 -v tgrpnullspace.h5 + # test for all dataset types written to attributes # enable -S for avoiding printing NATIVE types TOOLTEST tattr2.ls 0 -w80 -v -S tattr2.h5 diff --git a/tools/testfiles/tgrpnullspace.ddl b/tools/testfiles/tgrpnullspace.ddl new file mode 100644 index 0000000..2b91527 --- /dev/null +++ b/tools/testfiles/tgrpnullspace.ddl @@ -0,0 +1,33 @@ +HDF5 "tgrpnullspace.h5" { +GROUP "/" { + GROUP "g1" { + ATTRIBUTE "attr" { + DATATYPE H5T_STD_U32LE + DATASPACE NULL + DATA { + } + } + DATASET "dset" { + DATATYPE H5T_STD_I32BE + DATASPACE NULL + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 0 + OFFSET 18446744073709551615 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + DATA { + } + } + } +} +} diff --git a/tools/testfiles/tgrpnullspace.h5 b/tools/testfiles/tgrpnullspace.h5 new file mode 100644 index 0000000..82a405e Binary files /dev/null and b/tools/testfiles/tgrpnullspace.h5 differ diff --git a/tools/testfiles/tgrpnullspace.ls b/tools/testfiles/tgrpnullspace.ls new file mode 100644 index 0000000..b1a1223 --- /dev/null +++ b/tools/testfiles/tgrpnullspace.ls @@ -0,0 +1,7 @@ +Opened "tgrpnullspace.h5" with sec2 driver. +g1 Group + Attribute: attr null + Type: native unsigned int + + Location: 1:800 + Links: 1 -- cgit v0.12 From 7acbb154d1e5192b7332b9d5b18a784b1b3d92ad Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 21 Aug 2017 12:26:48 -0500 Subject: HDFFV-10188 add missing copy commands --- tools/test/h5dump/testh5dumpxml.sh.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index f740a34..f465570 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -97,6 +97,7 @@ $SRC_H5DUMP_TESTFILES/tname-sp.h5 $SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.h5 $SRC_H5DUMP_TESTFILES/tnestedcomp.h5 $SRC_H5DUMP_TESTFILES/tnodata.h5 +$SRC_H5DUMP_TESTFILES/tnnullspace.h5 $SRC_H5DUMP_TESTFILES/tobjref.h5 $SRC_H5DUMP_TESTFILES/topaque.h5 $SRC_H5DUMP_TESTFILES/torderattr.h5 @@ -162,6 +163,7 @@ $SRC_H5DUMP_TESTFILES/tname-quot.h5.xml $SRC_H5DUMP_TESTFILES/tname-sp.h5.xml $SRC_H5DUMP_TESTFILES/tnestedcomp.h5.xml $SRC_H5DUMP_TESTFILES/tnodata.h5.xml +$SRC_H5DUMP_TESTFILES/tnullspace.h5.xml $SRC_H5DUMP_TESTFILES/tobjref.h5.xml $SRC_H5DUMP_TESTFILES/topaque.h5.xml $SRC_H5DUMP_TESTFILES/torderattr1.h5.xml -- cgit v0.12 From 3dcb1887085678f08c02b64f1a04a77cd607cc4c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 21 Aug 2017 13:06:57 -0500 Subject: HDFFV-10188 fix typo --- tools/test/h5dump/testh5dumpxml.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index f465570..f7af300 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -97,7 +97,7 @@ $SRC_H5DUMP_TESTFILES/tname-sp.h5 $SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.h5 $SRC_H5DUMP_TESTFILES/tnestedcomp.h5 $SRC_H5DUMP_TESTFILES/tnodata.h5 -$SRC_H5DUMP_TESTFILES/tnnullspace.h5 +$SRC_H5DUMP_TESTFILES/tnullspace.h5 $SRC_H5DUMP_TESTFILES/tobjref.h5 $SRC_H5DUMP_TESTFILES/topaque.h5 $SRC_H5DUMP_TESTFILES/torderattr.h5 -- cgit v0.12 From b07eb6efd06bbe44562fe6c93e826f40a56c01d2 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 22 Aug 2017 01:36:20 -0500 Subject: Fix for HDFFV-10216 segfault in H5G_node_cmp3 with corrupt h5 file Fix H5HL_offset_into() to return error when offset exceeds heap data block size. Also fix other places that call this routine to detect error return. --- MANIFEST | 2 + src/H5Gent.c | 20 +- src/H5Glink.c | 12 +- src/H5Gnode.c | 748 +++++++++++++++++++++++++------------------------- src/H5Gstab.c | 16 +- src/H5HL.c | 10 +- src/H5Oefl.c | 47 ++-- test/CMakeTests.cmake | 2 + test/Makefile.am | 2 +- test/bad_offset.h5 | Bin 0 -> 3312 bytes test/gen_bad_offset.c | 112 ++++++++ test/tmisc.c | 55 ++++ 12 files changed, 610 insertions(+), 416 deletions(-) create mode 100644 test/bad_offset.h5 create mode 100644 test/gen_bad_offset.c diff --git a/MANIFEST b/MANIFEST index 2c3659e..58b8952 100644 --- a/MANIFEST +++ b/MANIFEST @@ -909,6 +909,7 @@ ./test/atomic_reader.c ./test/atomic_writer.c ./test/bad_compound.h5 +./test/bad_offset.h5 ./test/be_data.h5 ./test/be_extlink1.h5 ./test/be_extlink2.h5 @@ -972,6 +973,7 @@ ./test/fsm_aggr_persist.h5 ./test/genall5.c ./test/genall5.h +./test/gen_bad_offset.c ./test/gen_bad_ohdr.c ./test/gen_bad_compound.c ./test/gen_bogus.c diff --git a/src/H5Gent.c b/src/H5Gent.c index b781fae..7987850 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -541,8 +541,8 @@ herr_t H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, const H5HL_t *heap) { - const char *lval = NULL; - int nested_indent, nested_fwidth; + const char *lval = NULL; + int nested_indent, nested_fwidth; FUNC_ENTER_PACKAGE_NOERR @@ -551,14 +551,14 @@ H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, nested_fwidth = MAX(0, fwidth - 3); HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, - "Name offset into private heap:", - (unsigned long) (ent->name_off)); + "Name offset into private heap:", + (unsigned long) (ent->name_off)); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, - "Object header address:", ent->header); + "Object header address:", ent->header); HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, - "Cache info type:"); + "Cache info type:"); switch(ent->type) { case H5G_NOTHING_CACHED: HDfprintf(stream, "Nothing Cached\n"); @@ -581,13 +581,13 @@ H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Cached information:"); HDfprintf(stream, "%*s%-*s %lu\n", nested_indent, "", nested_fwidth, - "Link value offset:", - (unsigned long)(ent->cache.slink.lval_offset)); + "Link value offset:", + (unsigned long)(ent->cache.slink.lval_offset)); if(heap) { lval = (const char *)H5HL_offset_into(heap, ent->cache.slink.lval_offset); HDfprintf(stream, "%*s%-*s %s\n", nested_indent, "", nested_fwidth, - "Link value:", - lval); + "Link value:", + (lval == NULL) ? "" : lval); } /* end if */ else HDfprintf(stream, "%*s%-*s\n", nested_indent, "", nested_fwidth, "Warning: Invalid heap address given, name not displayed!"); diff --git a/src/H5Glink.c b/src/H5Glink.c index d246ee7..77b69cb 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -224,7 +224,9 @@ herr_t H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, const H5G_entry_t *ent, const char *name) { - FUNC_ENTER_PACKAGE_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(lnk); @@ -243,7 +245,8 @@ H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, if(ent->type == H5G_CACHED_SLINK) { const char *s; /* Pointer to link value */ - s = (const char *)H5HL_offset_into(heap, ent->cache.slink.lval_offset); + if((s = (const char *)H5HL_offset_into(heap, ent->cache.slink.lval_offset)) == NULL) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link name") HDassert(s); /* Copy the link value */ @@ -260,7 +263,10 @@ H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, lnk->type = H5L_TYPE_HARD; } /* end else */ - FUNC_LEAVE_NOAPI(SUCCEED) +done: + if(ret_value < 0 && lnk->name) + H5MM_xfree(lnk->name); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5G__ent_to_link() */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 20924ee..4ddcf53 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -13,14 +13,14 @@ /*------------------------------------------------------------------------- * - * Created: H5Gnode.c - * Jun 26 1997 - * Robb Matzke + * Created: H5Gnode.c + * Jun 26 1997 + * Robb Matzke * - * Purpose: Functions for handling symbol table nodes. A - * symbol table node is a small collection of symbol - * table entries. A B-tree usually points to the - * symbol table nodes for any given symbol table. + * Purpose: Functions for handling symbol table nodes. A + * symbol table node is a small collection of symbol + * table entries. A B-tree usually points to the + * symbol table nodes for any given symbol table. * *------------------------------------------------------------------------- */ @@ -35,16 +35,16 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Gpkg.h" /* Groups */ -#include "H5HLprivate.h" /* Local Heaps */ -#include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Ppublic.h" /* Property Lists */ +#include "H5private.h" /* Generic Functionsi */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Gpkg.h" /* Groups */ +#include "H5HLprivate.h" /* Local Heaps */ +#include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Ppublic.h" /* Property Lists */ /****************/ @@ -77,20 +77,16 @@ typedef struct H5G_node_key_t { /* B-tree callbacks */ static H5UC_t *H5G_node_get_shared(const H5F_t *f, const void *_udata); static herr_t H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t op, void *_lt_key, - void *_udata, void *_rt_key, - haddr_t *addr_p/*out*/); + void *_udata, void *_rt_key, haddr_t *addr_p/*out*/); static int H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key); static int H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key); static htri_t H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_lt_key, - void *_udata); + void *_udata); static H5B_ins_t H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, - hbool_t *lt_key_changed, void *_md_key, - void *_udata, void *_rt_key, - hbool_t *rt_key_changed, - haddr_t *new_node_p/*out*/); + hbool_t *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, + hbool_t *rt_key_changed, haddr_t *new_node_p/*out*/); static H5B_ins_t H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *lt_key, - hbool_t *lt_key_changed, void *udata, - void *rt_key, hbool_t *rt_key_changed); + hbool_t *lt_key_changed, void *udata, void *rt_key, hbool_t *rt_key_changed); static herr_t H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); static herr_t H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, @@ -103,21 +99,21 @@ static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, /* H5G inherits B-tree like properties from H5B */ H5B_class_t H5B_SNODE[1] = {{ - H5B_SNODE_ID, /*id */ - sizeof(H5G_node_key_t), /*sizeof_nkey */ - H5G_node_get_shared, /*get_shared */ - H5G_node_create, /*new */ - H5G_node_cmp2, /*cmp2 */ - H5G_node_cmp3, /*cmp3 */ - H5G_node_found, /*found */ - H5G_node_insert, /*insert */ - TRUE, /*follow min branch? */ - TRUE, /*follow max branch? */ - H5B_RIGHT, /*critical key */ - H5G_node_remove, /*remove */ - H5G_node_decode_key, /*decode */ - H5G_node_encode_key, /*encode */ - H5G_node_debug_key /*debug */ + H5B_SNODE_ID, /*id */ + sizeof(H5G_node_key_t), /*sizeof_nkey */ + H5G_node_get_shared, /*get_shared */ + H5G_node_create, /*new */ + H5G_node_cmp2, /*cmp2 */ + H5G_node_cmp3, /*cmp3 */ + H5G_node_found, /*found */ + H5G_node_insert, /*insert */ + TRUE, /*follow min branch? */ + TRUE, /*follow max branch? */ + H5B_RIGHT, /*critical key */ + H5G_node_remove, /*remove */ + H5G_node_decode_key, /*decode */ + H5G_node_encode_key, /*encode */ + H5G_node_debug_key /*debug */ }}; /* Declare a free list to manage the H5G_node_t struct */ @@ -138,17 +134,16 @@ H5FL_SEQ_DEFINE(H5G_entry_t); /*------------------------------------------------------------------------- - * Function: H5G_node_get_shared + * Function: H5G_node_get_shared * - * Purpose: Returns the shared B-tree info for the specified UDATA. + * Purpose: Returns the shared B-tree info for the specified UDATA. * - * Return: Success: Pointer to the raw B-tree page for this - file's groups + * Return: Success: Pointer to the raw B-tree page for this file's groups * - * Failure: Can't fail + * Failure: Can't fail * - * Programmer: Robb Matzke - * Wednesday, October 8, 1997 + * Programmer: Robb Matzke + * Wednesday, October 8, 1997 * * Modifications: * @@ -167,22 +162,22 @@ H5G_node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) /*------------------------------------------------------------------------- - * Function: H5G_node_decode_key + * Function: H5G_node_decode_key * - * Purpose: Decodes a raw key into a native key. + * Purpose: Decodes a raw key into a native key. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 8 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jul 8 1997 * *------------------------------------------------------------------------- */ static herr_t H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) { - H5G_node_key_t *key = (H5G_node_key_t *) _key; + H5G_node_key_t *key = (H5G_node_key_t *) _key; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -199,13 +194,13 @@ H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) /*------------------------------------------------------------------------- * Function: H5G_node_encode_key * - * Purpose: Encodes a native key into a raw key. + * Purpose: Encodes a native key into a raw key. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 8 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jul 8 1997 * *------------------------------------------------------------------------- */ @@ -227,13 +222,13 @@ H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) /*------------------------------------------------------------------------- - * Function: H5G_node_debug_key + * Function: H5G_node_debug_key * - * Purpose: Prints a key. + * Purpose: Prints a key. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 28, 2003 * *------------------------------------------------------------------------- @@ -242,7 +237,7 @@ static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const void *_udata) { - const H5G_node_key_t *key = (const H5G_node_key_t *) _key; + const H5G_node_key_t *key = (const H5G_node_key_t *) _key; const H5G_bt_common_t *udata = (const H5G_bt_common_t *) _udata; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -250,15 +245,15 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, HDassert(key); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Heap offset:", - (unsigned)key->offset); + (unsigned)key->offset); if(udata->heap) { const char *s; HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Name:"); - s = (const char *)H5HL_offset_into(udata->heap, key->offset); - HDfprintf(stream, "%s\n", s); + if((s = (const char *)H5HL_offset_into(udata->heap, key->offset)) != NULL) + HDfprintf(stream, "%s\n", s); } /* end if */ else HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Cannot get name; heap address not specified\n"); @@ -270,13 +265,13 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, /*------------------------------------------------------------------------- * Function: H5G__node_free * - * Purpose: Destroy a symbol table node in memory. + * Purpose: Destroy a symbol table node in memory. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Jan 15 2003 * *------------------------------------------------------------------------- */ @@ -305,29 +300,29 @@ H5G__node_free(H5G_node_t *sym) * Function: H5G_node_create * * Purpose: Creates a new empty symbol table node. This function is - * called by the B-tree insert function for an empty tree. It - * is also called internally to split a symbol node with LT_KEY - * and RT_KEY null pointers. + * called by the B-tree insert function for an empty tree. It + * is also called internally to split a symbol node with LT_KEY + * and RT_KEY null pointers. * - * Return: Success: Non-negative. The address of symbol table - * node is returned through the ADDR_P argument. + * Return: Success: Non-negative. The address of symbol table + * node is returned through the ADDR_P argument. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 23 1997 * *------------------------------------------------------------------------- */ static herr_t H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_key, - void H5_ATTR_UNUSED *_udata, void *_rt_key, haddr_t *addr_p/*out*/) + void H5_ATTR_UNUSED *_udata, void *_rt_key, haddr_t *addr_p/*out*/) { - H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key; - H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; - H5G_node_t *sym = NULL; - herr_t ret_value = SUCCEED; /* Return value */ + H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key; + H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; + H5G_node_t *sym = NULL; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -338,15 +333,15 @@ H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_ HDassert(H5B_INS_FIRST == op); if(NULL == (sym = H5FL_CALLOC(H5G_node_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") sym->node_size = H5G_NODE_SIZE(f); if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)sym->node_size))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to allocate file space") + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to allocate file space") if(NULL == (sym->entry = H5FL_SEQ_CALLOC(H5G_entry_t, (size_t)(2 * H5F_SYM_LEAF_K(f))))) - HGOTO_ERROR(H5E_SYM, H5E_CANTALLOC, FAIL, "memory allocation failed") + HGOTO_ERROR(H5E_SYM, H5E_CANTALLOC, FAIL, "memory allocation failed") if(H5AC_insert_entry(f, dxpl_id, H5AC_SNODE, *addr_p, sym, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to cache symbol table leaf node") + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to cache symbol table leaf node") /* * The left and right symbols in an empty tree are both the * empty string stored at offset zero by the H5G functions. This @@ -375,36 +370,36 @@ done: * Function: H5G_node_cmp2 * * Purpose: Compares two keys from a B-tree node (LT_KEY and RT_KEY). - * The UDATA pointer supplies extra data not contained in the - * keys (in this case, the heap address). + * The UDATA pointer supplies extra data not contained in the + * keys (in this case, the heap address). * - * Return: Success: negative if LT_KEY is less than RT_KEY. + * Return: Success: negative if LT_KEY is less than RT_KEY. * - * positive if LT_KEY is greater than RT_KEY. + * positive if LT_KEY is greater than RT_KEY. * - * zero if LT_KEY and RT_KEY are equal. + * zero if LT_KEY and RT_KEY are equal. * - * Failure: FAIL (same as LT_KEYheap); @@ -416,12 +411,15 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) HDassert(base); /* Get pointers to string names */ - s1 = base + lt_key->offset; - s2 = base + rt_key->offset; + if((s1 = (const char *)H5HL_offset_into(udata->heap, lt_key->offset)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get key name") + if((s2 = (const char *)H5HL_offset_into(udata->heap, rt_key->offset)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get key name") /* Set return value */ ret_value = HDstrcmp(s1, s2); +done: FUNC_LEAVE_NOAPI(ret_value) } /* H5G_node_cmp2() */ @@ -430,40 +428,40 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) * Function: H5G_node_cmp3 * * Purpose: Compares two keys from a B-tree node (LT_KEY and RT_KEY) - * against another key (not necessarily the same type) - * pointed to by UDATA. + * against another key (not necessarily the same type) + * pointed to by UDATA. * - * Return: Success: negative if the UDATA key is less than - * or equal to the LT_KEY + * Return: Success: negative if the UDATA key is less than + * or equal to the LT_KEY * - * positive if the UDATA key is greater - * than the RT_KEY. + * positive if the UDATA key is greater + * than the RT_KEY. * - * zero if the UDATA key falls between - * the LT_KEY (exclusive) and the - * RT_KEY (inclusive). + * zero if the UDATA key falls between + * the LT_KEY (exclusive) and the + * RT_KEY (inclusive). * - * Failure: FAIL (same as UDATA < LT_KEY) + * Failure: FAIL (same as UDATA < LT_KEY) * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 23 1997 * * Modifications: * *------------------------------------------------------------------------- */ -static int +static herr_t H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) { - H5G_bt_common_t *udata = (H5G_bt_common_t *) _udata; - H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; - H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; - const char *s; - const char *base; /* Base of heap */ - int ret_value = 0; /* Return value */ + H5G_bt_common_t *udata = (H5G_bt_common_t *) _udata; + H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; + H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; + const char *s; + const char *base; /* Base of heap */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(udata && udata->heap); @@ -475,43 +473,46 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) HDassert(base); /* left side */ - s = base + lt_key->offset; + if((s = (const char *)H5HL_offset_into(udata->heap, lt_key->offset)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get key name") if(HDstrcmp(udata->name, s) <= 0) - ret_value = (-1); + ret_value = (-1); else { /* right side */ - s = base + rt_key->offset; + if((s = (const char *)H5HL_offset_into(udata->heap, rt_key->offset)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get key name") if(HDstrcmp(udata->name, s) > 0) ret_value = 1; } /* end else */ +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_node_cmp3() */ /*------------------------------------------------------------------------- - * Function: H5G_node_found + * Function: H5G_node_found * - * Purpose: The B-tree search engine has found the symbol table node - * which contains the requested symbol if the symbol exists. - * This function should examine that node for the symbol and - * return information about the symbol through the UDATA - * structure which contains the symbol name on function - * entry. + * Purpose: The B-tree search engine has found the symbol table node + * which contains the requested symbol if the symbol exists. + * This function should examine that node for the symbol and + * return information about the symbol through the UDATA + * structure which contains the symbol name on function + * entry. * - * If the operation flag in UDATA is H5G_OPER_FIND, then - * the entry is copied from the symbol table to the UDATA - * entry field. Otherwise the entry is copied from the - * UDATA entry field to the symbol table. + * If the operation flag in UDATA is H5G_OPER_FIND, then + * the entry is copied from the symbol table to the UDATA + * entry field. Otherwise the entry is copied from the + * UDATA entry field to the symbol table. * - * Return: Success: Non-negative (TRUE/FALSE) if found and data - * returned through the UDATA pointer. + * Return: Success: Non-negative (TRUE/FALSE) if found and data + * returned through the UDATA pointer. * - * Failure: Negative if not found. + * Failure: Negative if not found. * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 23 1997 * *------------------------------------------------------------------------- */ @@ -519,13 +520,13 @@ static htri_t H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, void *_udata) { - H5G_bt_lkp_t *udata = (H5G_bt_lkp_t *)_udata; - H5G_node_t *sn = NULL; - unsigned lt = 0, idx = 0, rt; - int cmp = 1; - const char *s; - const char *base; /* Base of heap */ - htri_t ret_value = TRUE; /* Return value */ + H5G_bt_lkp_t *udata = (H5G_bt_lkp_t *)_udata; + H5G_node_t *sn = NULL; + unsigned lt = 0, idx = 0, rt; + int cmp = 1; + const char *s; + const char *base; /* Base of heap */ + htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -540,7 +541,7 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED * Load the symbol table node for exclusive access. */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table node") /* Get base address of heap */ base = (const char *)H5HL_offset_into(udata->common.heap, (size_t)0); @@ -551,14 +552,16 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED */ rt = sn->nsyms; while(lt < rt && cmp) { - idx = (lt + rt) / 2; - s = base + sn->entry[idx].name_off; - cmp = HDstrcmp(udata->common.name, s); - - if (cmp < 0) - rt = idx; - else - lt = idx + 1; + idx = (lt + rt) / 2; + + if((s = (const char *)H5HL_offset_into(udata->common.heap, sn->entry[idx].name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table name") + cmp = HDstrcmp(udata->common.name, s); + + if (cmp < 0) + rt = idx; + else + lt = idx + 1; } /* end while */ if(cmp) @@ -570,43 +573,41 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED done: if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") + HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_node_found() */ /*------------------------------------------------------------------------- - * Function: H5G_node_insert + * Function: H5G_node_insert * - * Purpose: The B-tree insertion engine has found the symbol table node - * which should receive the new symbol/address pair. This - * function adds it to that node unless it already existed. + * Purpose: The B-tree insertion engine has found the symbol table node + * which should receive the new symbol/address pair. This + * function adds it to that node unless it already existed. * - * If the node has no room for the symbol then the node is - * split into two nodes. The original node contains the - * low values and the new node contains the high values. - * The new symbol table entry is added to either node as - * appropriate. When a split occurs, this function will - * write the maximum key of the low node to the MID buffer - * and return the address of the new node. + * If the node has no room for the symbol then the node is + * split into two nodes. The original node contains the + * low values and the new node contains the high values. + * The new symbol table entry is added to either node as + * appropriate. When a split occurs, this function will + * write the maximum key of the low node to the MID buffer + * and return the address of the new node. * - * If the new key is larger than RIGHT then update RIGHT - * with the new key. + * If the new key is larger than RIGHT then update RIGHT + * with the new key. * - * Return: Success: An insertion command for the caller, one of - * the H5B_INS_* constants. The address of the - * new node, if any, is returned through the - * NEW_NODE_P argument. NEW_NODE_P might not be - * initialized if the return value is - * H5B_INS_NOOP. + * Return: Success: An insertion command for the caller, one of + * the H5B_INS_* constants. The address of the + * new node, if any, is returned through the + * NEW_NODE_P argument. NEW_NODE_P might not be + * initialized if the return value is H5B_INS_NOOP. * - * Failure: H5B_INS_ERROR, NEW_NODE_P might not be - * initialized. + * Failure: H5B_INS_ERROR, NEW_NODE_P might not be initialized. * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 24 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 24 1997 * *------------------------------------------------------------------------- */ @@ -617,18 +618,18 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_rt_key, hbool_t *rt_key_changed, haddr_t *new_node_p) { - H5G_node_key_t *md_key = (H5G_node_key_t *) _md_key; - H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; - H5G_bt_ins_t *udata = (H5G_bt_ins_t *) _udata; - H5G_node_t *sn = NULL, *snrt = NULL; - unsigned sn_flags = H5AC__NO_FLAGS_SET, snrt_flags = H5AC__NO_FLAGS_SET; - const char *s; - const char *base; /* Base of heap */ - unsigned lt = 0, rt; /* Binary search cntrs */ - int cmp = 1, idx = -1; - H5G_node_t *insert_into = NULL; /*node that gets new entry*/ - H5G_entry_t ent; /* Entry to insert in node */ - H5B_ins_t ret_value = H5B_INS_ERROR; + H5G_node_key_t *md_key = (H5G_node_key_t *) _md_key; + H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; + H5G_bt_ins_t *udata = (H5G_bt_ins_t *) _udata; + H5G_node_t *sn = NULL, *snrt = NULL; + unsigned sn_flags = H5AC__NO_FLAGS_SET, snrt_flags = H5AC__NO_FLAGS_SET; + const char *s; + const char *base; /* Base of heap */ + unsigned lt = 0, rt; /* Binary search cntrs */ + int cmp = 1, idx = -1; + H5G_node_t *insert_into = NULL; /*node that gets new entry*/ + H5G_entry_t ent; /* Entry to insert in node */ + H5B_ins_t ret_value = H5B_INS_ERROR; FUNC_ENTER_NOAPI_NOINIT @@ -646,7 +647,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, * Load the symbol node. */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__NO_FLAGS_SET))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") /* Get base address of heap */ base = (const char *)H5HL_offset_into(udata->common.heap, (size_t)0); @@ -657,85 +658,86 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, */ rt = sn->nsyms; while(lt < rt) { - idx = (int)((lt + rt) / 2); - s = base + sn->entry[idx].name_off; + idx = (int)((lt + rt) / 2); + if((s = (const char *)H5HL_offset_into(udata->common.heap, sn->entry[idx].name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table name") /* Check if symbol is already present */ - if(0 == (cmp = HDstrcmp(udata->common.name, s))) + if(0 == (cmp = HDstrcmp(udata->common.name, s))) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5B_INS_ERROR, "symbol is already present in symbol table") - if (cmp < 0) - rt = (unsigned)idx; - else - lt = (unsigned)(idx + 1); + if (cmp < 0) + rt = (unsigned)idx; + else + lt = (unsigned)(idx + 1); } /* end while */ idx += cmp > 0 ? 1 : 0; /* Convert link information & name to symbol table entry */ if(H5G__ent_convert(f, dxpl_id, udata->common.heap, udata->common.name, udata->lnk, udata->obj_type, udata->crt_info, &ent) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5B_INS_ERROR, "unable to convert link") + HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5B_INS_ERROR, "unable to convert link") /* Determine where to place entry in node */ if(sn->nsyms >= 2 * H5F_SYM_LEAF_K(f)) { - /* - * The node is full. Split it into a left and right - * node and return the address of the new right node (the - * left node is at the same address as the original node). - */ - ret_value = H5B_INS_RIGHT; - - /* The right node */ - if(H5G_node_create(f, dxpl_id, H5B_INS_FIRST, NULL, NULL, NULL, new_node_p/*out*/) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to split symbol table node") - - if(NULL == (snrt = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, *new_node_p, f, H5AC__NO_FLAGS_SET))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to split symbol table node") - - HDmemcpy(snrt->entry, sn->entry + H5F_SYM_LEAF_K(f), - H5F_SYM_LEAF_K(f) * sizeof(H5G_entry_t)); - snrt->nsyms = H5F_SYM_LEAF_K(f); + /* + * The node is full. Split it into a left and right + * node and return the address of the new right node (the + * left node is at the same address as the original node). + */ + ret_value = H5B_INS_RIGHT; + + /* The right node */ + if(H5G_node_create(f, dxpl_id, H5B_INS_FIRST, NULL, NULL, NULL, new_node_p/*out*/) < 0) + HGOTO_ERROR (H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to split symbol table node") + + if(NULL == (snrt = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, *new_node_p, f, H5AC__NO_FLAGS_SET))) + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to split symbol table node") + + HDmemcpy(snrt->entry, sn->entry + H5F_SYM_LEAF_K(f), + H5F_SYM_LEAF_K(f) * sizeof(H5G_entry_t)); + snrt->nsyms = H5F_SYM_LEAF_K(f); snrt_flags |= H5AC__DIRTIED_FLAG; - /* The left node */ - HDmemset(sn->entry + H5F_SYM_LEAF_K(f), 0, - H5F_SYM_LEAF_K(f) * sizeof(H5G_entry_t)); - sn->nsyms = H5F_SYM_LEAF_K(f); + /* The left node */ + HDmemset(sn->entry + H5F_SYM_LEAF_K(f), 0, + H5F_SYM_LEAF_K(f) * sizeof(H5G_entry_t)); + sn->nsyms = H5F_SYM_LEAF_K(f); sn_flags |= H5AC__DIRTIED_FLAG; - /* The middle key */ - md_key->offset = sn->entry[sn->nsyms - 1].name_off; + /* The middle key */ + md_key->offset = sn->entry[sn->nsyms - 1].name_off; - /* Where to insert the new entry? */ - if(idx <= (int)H5F_SYM_LEAF_K(f)) { - insert_into = sn; - if(idx == (int)H5F_SYM_LEAF_K(f)) - md_key->offset = ent.name_off; - } /* end if */ + /* Where to insert the new entry? */ + if(idx <= (int)H5F_SYM_LEAF_K(f)) { + insert_into = sn; + if(idx == (int)H5F_SYM_LEAF_K(f)) + md_key->offset = ent.name_off; + } /* end if */ else { - idx -= (int)H5F_SYM_LEAF_K(f); - insert_into = snrt; - if(idx == (int)H5F_SYM_LEAF_K(f)) { - rt_key->offset = ent.name_off; - *rt_key_changed = TRUE; - } /* end if */ - } /* end else */ + idx -= (int)H5F_SYM_LEAF_K(f); + insert_into = snrt; + if(idx == (int)H5F_SYM_LEAF_K(f)) { + rt_key->offset = ent.name_off; + *rt_key_changed = TRUE; + } /* end if */ + } /* end else */ } /* end if */ else { - /* Where to insert the new entry? */ - ret_value = H5B_INS_NOOP; + /* Where to insert the new entry? */ + ret_value = H5B_INS_NOOP; sn_flags |= H5AC__DIRTIED_FLAG; - insert_into = sn; - if(idx == (int)sn->nsyms) { - rt_key->offset = ent.name_off; - *rt_key_changed = TRUE; - } /* end if */ + insert_into = sn; + if(idx == (int)sn->nsyms) { + rt_key->offset = ent.name_off; + *rt_key_changed = TRUE; + } /* end if */ } /* end else */ /* Move entries down to make room for new entry */ HDassert(idx >= 0); HDmemmove(insert_into->entry + idx + 1, insert_into->entry + idx, - (insert_into->nsyms - (unsigned)idx) * sizeof(H5G_entry_t)); + (insert_into->nsyms - (unsigned)idx) * sizeof(H5G_entry_t)); /* Copy new entry into table */ H5G__ent_copy(&(insert_into->entry[idx]), &ent, H5_COPY_SHALLOW); @@ -745,56 +747,56 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, done: if(snrt && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, *new_node_p, snrt, snrt_flags) < 0) - HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node") + HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node") if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, sn_flags) < 0) - HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node") + HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_node_insert() */ /*------------------------------------------------------------------------- - * Function: H5G_node_remove + * Function: H5G_node_remove * - * Purpose: The B-tree removal engine has found the symbol table node - * which should contain the name which is being removed. This - * function removes the name from the symbol table and - * decrements the link count on the object to which the name - * points. + * Purpose: The B-tree removal engine has found the symbol table node + * which should contain the name which is being removed. This + * function removes the name from the symbol table and + * decrements the link count on the object to which the name + * points. * - * If the udata->name parameter is set to NULL, then remove - * all entries in this symbol table node. This only occurs - * during the deletion of the entire group, so don't bother - * freeing individual name entries in the local heap, the group's - * symbol table removal code will just free the entire local - * heap eventually. Do reduce the link counts for each object - * however. + * If the udata->name parameter is set to NULL, then remove + * all entries in this symbol table node. This only occurs + * during the deletion of the entire group, so don't bother + * freeing individual name entries in the local heap, the group's + * symbol table removal code will just free the entire local + * heap eventually. Do reduce the link counts for each object + * however. * - * Return: Success: If all names are removed from the symbol - * table node then H5B_INS_REMOVE is returned; - * otherwise H5B_INS_NOOP is returned. + * Return: Success: If all names are removed from the symbol + * table node then H5B_INS_REMOVE is returned; + * otherwise H5B_INS_NOOP is returned. * - * Failure: H5B_INS_ERROR + * Failure: H5B_INS_ERROR * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, September 24, 1998 * *------------------------------------------------------------------------- */ static H5B_ins_t H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, - hbool_t H5_ATTR_UNUSED *lt_key_changed/*out*/, - void *_udata/*in,out*/, void *_rt_key/*in,out*/, - hbool_t *rt_key_changed/*out*/) + hbool_t H5_ATTR_UNUSED *lt_key_changed/*out*/, + void *_udata/*in,out*/, void *_rt_key/*in,out*/, + hbool_t *rt_key_changed/*out*/) { - H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key; - H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; - H5G_bt_rm_t *udata = (H5G_bt_rm_t *)_udata; - H5G_node_t *sn = NULL; - unsigned sn_flags = H5AC__NO_FLAGS_SET; - unsigned lt = 0, rt, idx = 0; - int cmp = 1; - H5B_ins_t ret_value = H5B_INS_ERROR; + H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key; + H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; + H5G_bt_rm_t *udata = (H5G_bt_rm_t *)_udata; + H5G_node_t *sn = NULL; + unsigned sn_flags = H5AC__NO_FLAGS_SET; + unsigned lt = 0, rt, idx = 0; + int cmp = 1; + H5B_ins_t ret_value = H5B_INS_ERROR; FUNC_ENTER_NOAPI_NOINIT @@ -807,7 +809,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, /* Load the symbol table */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__NO_FLAGS_SET))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") /* "Normal" removal of a single entry from the symbol table node */ if(udata->common.name != NULL) { @@ -824,7 +826,8 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, const char *s; /* Pointer to string in local heap */ idx = (lt + rt) / 2; - s = base + sn->entry[idx].name_off; + if((s = H5HL_offset_into(udata->common.heap, sn->entry[idx].name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table name") cmp = HDstrcmp(udata->common.name, s); if(cmp < 0) rt = idx; @@ -846,7 +849,8 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, lnk.cset = H5T_CSET_ASCII; if(sn->entry[idx].type == H5G_CACHED_SLINK) { lnk.type = H5L_TYPE_SOFT; - lnk.u.soft.name = (char *)H5HL_offset_into(udata->common.heap, sn->entry[idx].cache.slink.lval_offset); + if(NULL == (lnk.u.soft.name = (char *)H5HL_offset_into(udata->common.heap, sn->entry[idx].cache.slink.lval_offset))) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_INS_ERROR, "unable to get link name") } /* end if */ else { lnk.type = H5L_TYPE_HARD; @@ -960,22 +964,22 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, done: if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, sn_flags) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release symbol table node") + HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_node_remove() */ /*------------------------------------------------------------------------- - * Function: H5G__node_iterate + * Function: H5G__node_iterate * - * Purpose: This function gets called during a group iterate operation. + * Purpose: This function gets called during a group iterate operation. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 24 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 24 1997 * *------------------------------------------------------------------------- */ @@ -983,11 +987,11 @@ int H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { - H5G_bt_it_it_t *udata = (H5G_bt_it_it_t *)_udata; - H5G_node_t *sn = NULL; - H5G_entry_t *ents; /* Pointer to entries in this node */ - unsigned u; /* Local index variable */ - int ret_value = H5_ITER_CONT; + H5G_bt_it_it_t *udata = (H5G_bt_it_it_t *)_udata; + H5G_node_t *sn = NULL; + H5G_entry_t *ents; /* Pointer to entries in this node */ + unsigned u; /* Local index variable */ + int ret_value = H5_ITER_CONT; FUNC_ENTER_PACKAGE @@ -1000,7 +1004,7 @@ H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, h /* Protect the symbol table node & local heap while we iterate over entries */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* * Iterate over the symbol table node entries. @@ -1013,7 +1017,8 @@ H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, h const char *name; /* Pointer to link name in heap */ /* Get the pointer to the name of the link in the heap */ - name = (const char *)H5HL_offset_into(udata->heap, ents[u].name_off); + if((name = (const char *)H5HL_offset_into(udata->heap, ents[u].name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get symbol table node name") HDassert(name); /* Convert the entry to a link */ @@ -1043,15 +1048,14 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5G__node_iterate() */ - /*------------------------------------------------------------------------- - * Function: H5G__node_sumup + * Function: H5G__node_sumup * - * Purpose: This function gets called during a group iterate operation + * Purpose: This function gets called during a group iterate operation * to return total number of members in the group. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Nov 20, 2002 @@ -1060,11 +1064,11 @@ done: */ int H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, - const void H5_ATTR_UNUSED *_rt_key, void *_udata) + const void H5_ATTR_UNUSED *_rt_key, void *_udata) { hsize_t *num_objs = (hsize_t *)_udata; - H5G_node_t *sn = NULL; - int ret_value = H5_ITER_CONT; + H5G_node_t *sn = NULL; + int ret_value = H5_ITER_CONT; FUNC_ENTER_PACKAGE @@ -1077,7 +1081,7 @@ H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, had /* Find the object node and add the number of symbol entries. */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") *num_objs += sn->nsyms; @@ -1090,12 +1094,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5G__node_by_idx + * Function: H5G__node_by_idx * - * Purpose: This function gets called during a group iterate operation + * Purpose: This function gets called during a group iterate operation * to return object name by giving idx. * - * Return: 0 if object isn't found in this node; 1 if object is found; + * Return: 0 if object isn't found in this node; 1 if object is found; * Negative on failure * * Programmer: Raymond Lu @@ -1105,11 +1109,11 @@ done: */ int H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, - const void H5_ATTR_UNUSED *_rt_key, void *_udata) + const void H5_ATTR_UNUSED *_rt_key, void *_udata) { - H5G_bt_it_idx_common_t *udata = (H5G_bt_it_idx_common_t *)_udata; - H5G_node_t *sn = NULL; - int ret_value = H5_ITER_CONT; + H5G_bt_it_idx_common_t *udata = (H5G_bt_it_idx_common_t *)_udata; + H5G_node_t *sn = NULL; + int ret_value = H5_ITER_CONT; FUNC_ENTER_PACKAGE @@ -1122,7 +1126,7 @@ H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, ha /* Get a pointer to the symbol table node */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node"); + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node"); /* Find the node, locate the object symbol table entry and retrieve the name */ if(udata->idx >= udata->num_objs && udata->idx < (udata->num_objs + sn->nsyms)) { @@ -1151,12 +1155,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5G__node_init + * Function: H5G__node_init * - * Purpose: This function gets called during a file opening to initialize + * Purpose: This function gets called during a file opening to initialize * global information about group B-tree nodes for file. * - * Return: Non-negative on success + * Return: Non-negative on success * Negative on failure * * Programmer: Quincey Koziol @@ -1167,9 +1171,9 @@ done: herr_t H5G__node_init(H5F_t *f) { - H5B_shared_t *shared; /* Shared B-tree node info */ - size_t sizeof_rkey; /* Size of raw (disk) key */ - herr_t ret_value = SUCCEED; /* Return value */ + H5B_shared_t *shared; /* Shared B-tree node info */ + size_t sizeof_rkey; /* Size of raw (disk) key */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1181,14 +1185,14 @@ H5G__node_init(H5F_t *f) /* Allocate & initialize global info for the shared structure */ if(NULL == (shared = H5B_shared_new(f, H5B_SNODE, sizeof_rkey))) - HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, FAIL, "memory allocation failed for shared B-tree info") + HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, FAIL, "memory allocation failed for shared B-tree info") /* Set up the "local" information for this file's groups */ - /* */ + /* */ /* Make shared B-tree info reference counted */ if(H5F_SET_GRP_BTREE_SHARED(f, H5UC_create(shared, H5B_shared_free)) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1196,12 +1200,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_node_close + * Function: H5G_node_close * - * Purpose: This function gets called during a file close to shutdown + * Purpose: This function gets called during a file close to shutdown * global information about group B-tree nodes for file. * - * Return: Non-negative on success + * Return: Non-negative on success * Negative on failure * * Programmer: Quincey Koziol @@ -1227,12 +1231,12 @@ H5G_node_close(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5G__node_copy + * Function: H5G__node_copy * - * Purpose: This function gets called during a group iterate operation + * Purpose: This function gets called during a group iterate operation * to copy objects of this node into a new location. * - * Return: 0(zero) on success/Negative on failure + * Return: 0(zero) on success/Negative on failure * * Programmer: Peter Cao * Sept 10, 2005 @@ -1241,7 +1245,7 @@ H5G_node_close(const H5F_t *f) */ int H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, - const void H5_ATTR_UNUSED *_rt_key, void *_udata) + const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5G_bt_it_cpy_t *udata = (H5G_bt_it_cpy_t *)_udata; const H5O_loc_t *src_oloc = udata->src_oloc; @@ -1260,7 +1264,7 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd /* load the symbol table into memory from the source file */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* get the base address of the heap */ if(NULL == (heap = H5HL_protect(f, dxpl_id, udata->src_heap_addr, H5AC__READ_ONLY_FLAG))) @@ -1292,7 +1296,8 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd grp_loc.oloc = (H5O_loc_t *)src_oloc; /* Get pointer to link value in local heap */ - link_name = (char *)H5HL_offset_into(heap, tmp_src_ent.cache.slink.lval_offset); + if((link_name = (char *)H5HL_offset_into(heap, tmp_src_ent.cache.slink.lval_offset)) == NULL) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get link name") /* Check if the object pointed by the soft link exists in the source file */ if(H5G_loc_info(&grp_loc, link_name, FALSE, &oinfo, H5P_DEFAULT, dxpl_id) >= 0) { @@ -1342,7 +1347,8 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd /* Construct link information for eventual insertion */ lnk.type = H5L_TYPE_SOFT; - lnk.u.soft.name = (char *)H5HL_offset_into(heap, src_ent->cache.slink.lval_offset); + if((lnk.u.soft.name = (char *)H5HL_offset_into(heap, src_ent->cache.slink.lval_offset)) == NULL) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get link name") } /* else if */ else HDassert(0 && "Unknown entry type"); @@ -1354,8 +1360,9 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd /* lnk.name = name; */ /* This will be set in callback */ /* Determine name of source object */ - name = (const char *)H5HL_offset_into(heap, src_ent->name_off); - HDassert(name); + if((name = (const char *)H5HL_offset_into(heap, src_ent->name_off)) == NULL) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get source object name") + HDassert(name); /* Set copied metadata tag */ H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, H5_ITER_ERROR); @@ -1384,15 +1391,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5G__node_build_table + * Function: H5G__node_build_table * - * Purpose: B-link tree callback for building table of links + * Purpose: B-link tree callback for building table of links * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Nov 19 2006 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Nov 19 2006 * *------------------------------------------------------------------------- */ @@ -1400,10 +1407,10 @@ int H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { - H5G_bt_it_bt_t *udata = (H5G_bt_it_bt_t *)_udata; - H5G_node_t *sn = NULL; /* Symbol table node */ - unsigned u; /* Local index variable */ - int ret_value = H5_ITER_CONT; + H5G_bt_it_bt_t *udata = (H5G_bt_it_bt_t *)_udata; + H5G_node_t *sn = NULL; /* Symbol table node */ + unsigned u; /* Local index variable */ + int ret_value = H5_ITER_CONT; FUNC_ENTER_PACKAGE @@ -1419,7 +1426,7 @@ H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_ke * because we're about to call an application function. */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* Check if the link table needs to be extended */ if((udata->ltable->nlinks + sn->nsyms) >= udata->alloc_nlinks) { @@ -1438,7 +1445,8 @@ H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_ke size_t linkno; /* Link allocated */ /* Get pointer to link's name in the heap */ - name = (const char *)H5HL_offset_into(udata->heap, sn->entry[u].name_off); + if((name = (const char *)H5HL_offset_into(udata->heap, sn->entry[u].name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get symbol table link name") HDassert(name); /* Determine the link to operate on in the table */ @@ -1472,8 +1480,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__node_iterate_size(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t H5_ATTR_UNUSED addr, - const void H5_ATTR_UNUSED *_rt_key, void *_udata) +H5G__node_iterate_size(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const void H5_ATTR_UNUSED *_lt_key, + haddr_t H5_ATTR_UNUSED addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { hsize_t *stab_size = (hsize_t *)_udata; /* User data */ @@ -1490,16 +1498,16 @@ H5G__node_iterate_size(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const void H5_ATT /*------------------------------------------------------------------------- - * Function: H5G_node_debug + * Function: H5G_node_debug * - * Purpose: Prints debugging information about a symbol table node - * or a B-tree node for a symbol table B-tree. + * Purpose: Prints debugging information about a symbol table node + * or a B-tree node for a symbol table B-tree. * - * Return: 0(zero) on success/Negative on failure + * Return: 0(zero) on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 4 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Aug 4 1997 * *------------------------------------------------------------------------- */ @@ -1507,10 +1515,10 @@ herr_t H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int fwidth, haddr_t heap_addr) { - H5G_node_t *sn = NULL; - H5HL_t *heap = NULL; - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + H5G_node_t *sn = NULL; + H5HL_t *heap = NULL; + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1537,8 +1545,8 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, H5E_clear_stack(NULL); /* discard that error */ udata.heap = heap; - if(H5B_debug(f, dxpl_id, addr, stream, indent, fwidth, H5B_SNODE, &udata) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to debug B-tree node"); + if(H5B_debug(f, dxpl_id, addr, stream, indent, fwidth, H5B_SNODE, &udata) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to debug B-tree node"); } /* end if */ else { fprintf(stream, "%*sSymbol Table Node...\n", indent, ""); @@ -1571,7 +1579,7 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, done: if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") + HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") diff --git a/src/H5Gstab.c b/src/H5Gstab.c index a239cfe..7750671 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -707,11 +707,12 @@ done: static herr_t H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) { - H5G_bt_it_gnbi_t *udata = (H5G_bt_it_gnbi_t *)_udata; + H5G_bt_it_gnbi_t *udata = (H5G_bt_it_gnbi_t *)_udata; size_t name_off; /* Offset of name in heap */ const char *name; /* Pointer to name string in heap */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(ent); @@ -719,12 +720,16 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) /* Get name offset in heap */ name_off = ent->name_off; - name = (const char *)H5HL_offset_into(udata->heap, name_off); + + if((name = (const char *)H5HL_offset_into(udata->heap, name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table link name") + HDassert(name); udata->name = H5MM_strdup(name); HDassert(udata->name); - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_stab_get_name_by_idx_cb */ @@ -941,7 +946,8 @@ H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) HDassert(udata && udata->heap); /* Get a pointer to the link name */ - name = (const char *)H5HL_offset_into(udata->heap, ent->name_off); + if((name = (const char *)H5HL_offset_into(udata->heap, ent->name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table link name") HDassert(name); /* Convert the entry to a link */ diff --git a/src/H5HL.c b/src/H5HL.c index fa577c3..dd756f5 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -400,18 +400,20 @@ END_FUNC(PRIV) /* end H5HL_protect() */ * *------------------------------------------------------------------------- */ -BEGIN_FUNC(PRIV, NOERR, -void *, NULL, -, +BEGIN_FUNC(PRIV, ERR, +void *, NULL, NULL, H5HL_offset_into(const H5HL_t *heap, size_t offset)) /* Sanity check */ HDassert(heap); - HDassert(offset < heap->dblk_size); + if(offset >= heap->dblk_size) + H5E_THROW(H5E_CANTGET, "unable to offset into local heap data block"); ret_value = heap->dblk_image + offset; +CATCH + /* No special processing on errors */ END_FUNC(PRIV) /* end H5HL_offset_into() */ - /*------------------------------------------------------------------------- * Function: H5HL_unprotect diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 0456b00..2273289 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -67,17 +67,17 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ /*------------------------------------------------------------------------- - * Function: H5O_efl_decode + * Function: H5O_efl_decode * * Purpose: Decode an external file list message and return a pointer to - * the message (and some other data). + * the message (and some other data). * - * Return: Success: Ptr to a new message struct. + * Return: Success: Ptr to a new message struct. * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke - * Tuesday, November 25, 1997 + * Tuesday, November 25, 1997 * * Modification: * Raymond Lu @@ -90,12 +90,12 @@ static void * H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { - H5O_efl_t *mesg = NULL; - int version; - const char *s = NULL; - H5HL_t *heap; - size_t u; /* Local index variable */ - void *ret_value = NULL; /* Return value */ + H5O_efl_t *mesg = NULL; + int version; + const char *s = NULL; + H5HL_t *heap; + size_t u; /* Local index variable */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -104,12 +104,12 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, HDassert(p); if(NULL == (mesg = (H5O_efl_t *)H5MM_calloc(sizeof(H5O_efl_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Version */ version = *p++; if(version != H5O_EFL_VERSION) - HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for external file list message") + HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for external file list message") /* Reserved */ p += 3; @@ -141,24 +141,25 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, /* Decode the file list */ mesg->slot = (H5O_efl_entry_t *)H5MM_calloc(mesg->nalloc * sizeof(H5O_efl_entry_t)); if(NULL == mesg->slot) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if(NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value") for(u = 0; u < mesg->nused; u++) { - /* Name */ - H5F_DECODE_LENGTH (f, p, mesg->slot[u].name_offset); + /* Name */ + H5F_DECODE_LENGTH (f, p, mesg->slot[u].name_offset); - s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset); - HDassert(s && *s); - mesg->slot[u].name = H5MM_xstrdup (s); + if((s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "unable to get external file name") + HDassert(s && *s); + mesg->slot[u].name = H5MM_xstrdup (s); HDassert(mesg->slot[u].name); - /* File offset */ - H5F_DECODE_LENGTH (f, p, mesg->slot[u].offset); + /* File offset */ + H5F_DECODE_LENGTH (f, p, mesg->slot[u].offset); - /* Size */ - H5F_DECODE_LENGTH (f, p, mesg->slot[u].size); + /* Size */ + H5F_DECODE_LENGTH (f, p, mesg->slot[u].size); } /* end for */ if(H5HL_unprotect(heap) < 0) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 5f0d386..5d2f30b 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -183,6 +183,7 @@ endforeach () set (HDF5_REFERENCE_TEST_FILES aggr.h5 bad_compound.h5 + bad_offset.h5 be_data.h5 be_extlink1.h5 be_extlink2.h5 @@ -1336,6 +1337,7 @@ if (HDF5_BUILD_GENERATORS) # generator executables set (H5_GENERATORS + gen_bad_offset gen_bad_ohdr gen_bogus gen_cross diff --git a/test/Makefile.am b/test/Makefile.am index f64b6d8..53dbf0d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -94,7 +94,7 @@ endif BUILD_ALL_PROGS=gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_new_array \ gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \ gen_nullspace gen_udlinks space_overflow gen_filespace gen_specmetaread \ - gen_sizes_lheap gen_file_image gen_plist + gen_sizes_lheap gen_file_image gen_plist gen_bad_offset if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) diff --git a/test/bad_offset.h5 b/test/bad_offset.h5 new file mode 100644 index 0000000..6500ffe Binary files /dev/null and b/test/bad_offset.h5 differ diff --git a/test/gen_bad_offset.c b/test/gen_bad_offset.c new file mode 100644 index 0000000..2be4af1 --- /dev/null +++ b/test/gen_bad_offset.c @@ -0,0 +1,112 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: Generate an HDF5 file for testing H5FFV-10216 + */ +#include "h5test.h" + +#define TESTFILE "bad_offset.h5" +#define GRP1 "group1" +#define GRP2 "group2" +#define DSET "dsetA" +#define SOFT1 "soft_one" +#define SOFT2 "soft_two" + + + +/*------------------------------------------------------------------------- + * Function: main + * Generate an HDF5 file with groups, datasets and symbolic links. + * + * After this file is generated, write bad offset values to + * the heap at 3 locations in the file: + * (A) Open the file: + * fd = HDopen(TESTFILE, O_RDWR, 0663); + * (B) Position the file at: + * (1) HDlseek(fd, (HDoff_t)880, SEEK_SET); + * "/group1/group2": replace heap offset "8" by bad offset + * (2) HDlseek(fd, (HDoff_t)1512, SEEK_SET); + * "/dsetA": replace name offset into private heap "72" by bad offset + * (3) HDlseek(fd, (HDoff_t)1616, SEEK_SET); + * /soft_one: replace link value offset in the scratch pad "32" by bad offset + * (C) Write the bad offset value to the file: + * write(fd, &val, sizeof(val)); + * + * Note: if the groups/datasets/symbolic links are changed in the file, + * the above locations need to be adjusted accordingly. + * + * Return: EXIT_SUCCESS/EXIT_FAILURE + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + hid_t fid = -1, gid1 = -1, gid2 = -1; /* File and group IDs */ + hid_t did = -1, sid = -1; /* Dataset and dataspace IDs */ + + /* Create the test file */ + if((fid = H5Fcreate(TESTFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Create two groups */ + if((gid1 = H5Gcreate2(fid, GRP1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if((gid2 = H5Gcreate2(gid1, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Close the groups */ + if(H5Gclose(gid1) < 0) + FAIL_STACK_ERROR + if(H5Gclose(gid2) < 0) + FAIL_STACK_ERROR + + /* Create soft links to the groups */ + if(H5Lcreate_soft("/group1", fid, SOFT1, H5P_DEFAULT, H5P_DEFAULT) < 0) + FAIL_STACK_ERROR + if(H5Lcreate_soft("/group1/group2", fid, SOFT2, H5P_DEFAULT, H5P_DEFAULT) < 0) + FAIL_STACK_ERROR + + /* Create a dataset */ + if((sid = H5Screate(H5S_SCALAR)) < 0) + FAIL_STACK_ERROR + if((did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + /* Close the dataspace */ + if(H5Sclose(sid) < 0) + FAIL_STACK_ERROR + + /* Close the file */ + if(H5Fclose(fid) < 0) + FAIL_STACK_ERROR + + return EXIT_SUCCESS; + +error: + H5E_BEGIN_TRY { + H5Gclose(gid1); + H5Gclose(gid2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid); + } H5E_END_TRY; + + return EXIT_FAILURE; +} /* end main() */ + diff --git a/test/tmisc.c b/test/tmisc.c index 708ca9b..242e55a 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -318,6 +318,11 @@ typedef struct #define MISC31_PROPNAME "misc31_prop" #define MISC31_DTYPENAME "dtype" +/* Definitions for misc. test #33 */ +/* Note that this test file is generated by "gen_bad_offset.c" */ +/* and bad offset values are written to that file for testing */ +#define MISC33_FILE "bad_offset.h5" + /**************************************************************** ** ** test_misc1(): test unlinking a dataset from a group and immediately @@ -5472,6 +5477,55 @@ test_misc32(void) } /* end test_misc32() */ +/**************************************************************** +** +** test_misc33(): Test for H5FFV-10216 +** --verify that H5HL_offset_into() returns error if the +** input parameter "offset" exceeds heap data block size. +** --case (1), (2), (3) are scenarios that will traverse to the +** the 3 locations in the file having bad offset values to +** the heap. (See description in gen_bad_offset.c) +** +****************************************************************/ +static void +test_misc33(void) +{ + hid_t fid = -1; /* File ID */ + const char *testfile = H5_get_srcdir_filename(MISC33_FILE); /* Corrected test file name */ + H5O_info_t oinfo; /* Structure for object metadata information */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing that bad offset into the heap returns error")); + + /* Open the test file */ + fid = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); + + /* Case (1) */ + H5E_BEGIN_TRY { + ret = H5Oget_info_by_name(fid, "/soft_two", &oinfo, H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Oget_info_by_name"); + + /* Case (2) */ + H5E_BEGIN_TRY { + ret = H5Oget_info_by_name(fid, "/dsetA", &oinfo, H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Oget_info_by_name"); + + /* Case (3) */ + H5E_BEGIN_TRY { + ret = H5Oget_info_by_name(fid, "/soft_one", &oinfo, H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Oget_info_by_name"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(fid, FAIL, "H5Fclose"); + +} /* end test_misc33() */ + /**************************************************************** ** @@ -5520,6 +5574,7 @@ test_misc(void) test_misc30(); /* Exercise local heap loading bug where free lists were getting dropped */ test_misc31(); /* Test Reentering library through deprecated routines after H5close() */ test_misc32(); /* Test filter memory allocation functions */ + test_misc33(); /* ??? */ } /* test_misc() */ -- cgit v0.12 From d200cd31a79ab935808495005060cf53b833b99c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 23 Aug 2017 10:16:49 -0500 Subject: HDFFV-10188 emu insists on printing non-native description --- tools/test/h5ls/CMakeTests.cmake | 2 +- tools/testfiles/tgrpnullspace.ls | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index 62ee835..a04a4b6 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -420,7 +420,7 @@ ADD_H5_TEST (tempty 0 -w80 -d tempty.h5) # test for displaying dataset and attribute of null space - ADD_H5_TEST (tgrpnullspace 0 -w80 -v tgrpnullspace.h5) + ADD_H5_TEST (tgrpnullspace 0 -w80 -v -S tgrpnullspace.h5) # test for all dataset types written to attributes # enable -S for avoiding printing NATIVE types diff --git a/tools/testfiles/tgrpnullspace.ls b/tools/testfiles/tgrpnullspace.ls index b1a1223..439414c 100644 --- a/tools/testfiles/tgrpnullspace.ls +++ b/tools/testfiles/tgrpnullspace.ls @@ -1,7 +1,7 @@ Opened "tgrpnullspace.h5" with sec2 driver. g1 Group Attribute: attr null - Type: native unsigned int + Type: 32-bit little-endian unsigned integer Location: 1:800 Links: 1 -- cgit v0.12 From 678c3ae1535b9b3b9faa53bc48250f1635778dd7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 23 Aug 2017 10:18:08 -0500 Subject: HDFFV-10188 force non-native type description --- tools/test/h5ls/testh5ls.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5ls/testh5ls.sh.in b/tools/test/h5ls/testh5ls.sh.in index 6259af8..8c6551b 100644 --- a/tools/test/h5ls/testh5ls.sh.in +++ b/tools/test/h5ls/testh5ls.sh.in @@ -395,7 +395,7 @@ TOOLTEST tarray1.ls 0 -w80 -r -d tarray1.h5 TOOLTEST tempty.ls 0 -w80 -d tempty.h5 # test for displaying dataset and attribute of null space -TOOLTEST tgrpnullspace.ls 0 -w80 -v tgrpnullspace.h5 +TOOLTEST tgrpnullspace.ls 0 -w80 -v -S tgrpnullspace.h5 # test for all dataset types written to attributes # enable -S for avoiding printing NATIVE types -- cgit v0.12 From b82ba32275f7ed998aafa68a1cecaab3e80323da Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 23 Aug 2017 16:12:40 -0500 Subject: HDFFV-10282 refactor out assert calls in tools --- tools/lib/h5diff_dset.c | 13 +- tools/lib/h5diff_util.c | 7 +- tools/lib/h5tools.c | 33 +-- tools/lib/h5tools_ref.c | 43 ++-- tools/lib/h5tools_type.c | 2 - tools/lib/h5tools_utils.c | 8 +- tools/lib/h5trav.c | 32 ++- tools/src/h5copy/h5copy.c | 96 +++---- tools/src/h5dump/h5dump.c | 182 +++++++------- tools/src/h5dump/h5dump_ddl.c | 210 ++++++++-------- tools/src/h5dump/h5dump_xml.c | 457 +++++++++++++++++----------------- tools/src/h5jam/h5jam.c | 13 +- tools/src/h5jam/h5unjam.c | 54 ++-- tools/src/h5ls/h5ls.c | 33 ++- tools/src/h5repack/h5repack.c | 1 - tools/src/h5repack/h5repack_copy.c | 2 - tools/src/h5repack/h5repack_filters.c | 368 ++++++++++++--------------- tools/src/h5repack/h5repack_refs.c | 8 +- 18 files changed, 754 insertions(+), 808 deletions(-) diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 991ef48..a4f7863 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -358,7 +358,6 @@ hsize_t diff_datasetid( hid_t did1, nelmts2 *= dims2[i]; h5diffdebug3("nelmts: %ld - %ld\n", nelmts1, nelmts2); - HDassert(nelmts1 == nelmts2); if(tclass != H5T_ARRAY) { /*----------------------------------------------------------------- @@ -459,7 +458,7 @@ hsize_t diff_datasetid( hid_t did1, size = 1; sm_size[i - 1] = MIN(dadims[i - 1], size); sm_nbytes *= sm_size[i - 1]; - HDassert(sm_nbytes > 0); + h5diffdebug2("sm_nbytes: %ld\n", sm_nbytes); } /* end for */ /* malloc return code should be verified. @@ -469,10 +468,10 @@ hsize_t diff_datasetid( hid_t did1, * that fails to address freeing other objects created here. * E.g., sm_space. */ - sm_buf1 = HDmalloc((size_t)sm_nbytes); - HDassert(sm_buf1); - sm_buf2 = HDmalloc((size_t)sm_nbytes); - HDassert(sm_buf2); + if((sm_buf1 = HDmalloc((size_t)sm_nbytes)) == NULL) + goto error; + if((sm_buf2 = HDmalloc((size_t)sm_nbytes)) == NULL) + goto error; sm_nelmts = sm_nbytes / p_type_nbytes; sm_space = H5Screate_simple(1, &sm_nelmts, NULL); @@ -682,7 +681,6 @@ int diff_can_type( hid_t f_tid1, /* file data type */ * check for non supported classes *------------------------------------------------------------------------- */ - HDassert(tclass1 == tclass2); switch (tclass1) { case H5T_TIME: if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { @@ -754,7 +752,6 @@ int diff_can_type( hid_t f_tid1, /* file data type */ * check for different dimensions *------------------------------------------------------------------------- */ - HDassert(rank1 == rank2); for(i = 0; indims); - - ctx->acc[ctx->ndims - 1] = 1; - for (i = ((int)ctx->ndims - 2); i >= 0; i--) - ctx->acc[i] = ctx->acc[i + 1] * dims[i + 1]; - for (j = 0; j < ctx->ndims; j++) - ctx->pos[j] = 0; + if(ctx->ndims > 0) { + ctx->acc[ctx->ndims - 1] = 1; + for (i = ((int)ctx->ndims - 2); i >= 0; i--) + ctx->acc[i] = ctx->acc[i + 1] * dims[i + 1]; + for (j = 0; j < ctx->ndims; j++) + ctx->pos[j] = 0; + } } /*------------------------------------------------------------------------- @@ -1410,13 +1410,17 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t memb = H5Tget_super(tid); ndims = H5Tget_array_ndims(tid); H5Tget_array_dims2(tid, dims); - HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); - - /* calculate the number of array elements */ - for (k = 0, nelmts = 1; k < ndims; k++) { - temp_nelmts = nelmts; - temp_nelmts *= dims[k]; - nelmts = (size_t) temp_nelmts; + if(ndims >= 1 && ndims <= H5S_MAX_RANK) { + /* calculate the number of array elements */ + for (k = 0, nelmts = 1; k < ndims; k++) { + temp_nelmts = nelmts; + temp_nelmts *= dims[k]; + nelmts = (size_t) temp_nelmts; + } + } + else { + H5Tclose(memb); + H5E_THROW(FAIL, H5E_tools_min_id_g, "calculate the number of array elements failed"); } for (block_index = 0; block_index < block_nelmts; block_index++) { @@ -1641,7 +1645,6 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, ndims = (unsigned)sndims; alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); - HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL) HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 16a949d..6153f0c 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -107,19 +107,21 @@ static int init_ref_path_table(void) { /* Sanity check */ - HDassert(thefile > 0); - - /* Create skip list to store reference path information */ - if((ref_path_table = H5SL_create(H5SL_TYPE_HADDR, NULL))==NULL) + if(thefile > 0) { + /* Create skip list to store reference path information */ + if((ref_path_table = H5SL_create(H5SL_TYPE_HADDR, NULL))==NULL) + return (-1); + + /* Iterate over objects in this file */ + if(h5trav_visit(thefile, "/", TRUE, TRUE, init_ref_path_cb, NULL, NULL) < 0) { + error_msg("unable to construct reference path table\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + + return(0); + } + else return (-1); - - /* Iterate over objects in this file */ - if(h5trav_visit(thefile, "/", TRUE, TRUE, init_ref_path_cb, NULL, NULL) < 0) { - error_msg("unable to construct reference path table\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - - return(0); } /*------------------------------------------------------------------------- @@ -212,16 +214,17 @@ ref_path_table_put(const char *path, haddr_t objno) { ref_path_node_t *new_node; - HDassert(ref_path_table); - HDassert(path); - - if((new_node = (ref_path_node_t *)HDmalloc(sizeof(ref_path_node_t))) == NULL) - return(-1); + if(ref_path_table && path) { + if((new_node = (ref_path_node_t *)HDmalloc(sizeof(ref_path_node_t))) == NULL) + return(-1); - new_node->objno = objno; - new_node->path = HDstrdup(path); + new_node->objno = objno; + new_node->path = HDstrdup(path); - return(H5SL_insert(ref_path_table, new_node, &(new_node->objno))); + return(H5SL_insert(ref_path_table, new_node, &(new_node->objno))); + } + else + return (-1); } /* diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c index ae7160b..ee58ccb 100644 --- a/tools/lib/h5tools_type.c +++ b/tools/lib/h5tools_type.c @@ -92,7 +92,6 @@ h5tools_get_little_endian_type(hid_t tid) case H5T_NO_CLASS: case H5T_NCLASSES: default: - HDassert(0); break; } /* end switch */ @@ -179,7 +178,6 @@ h5tools_get_big_endian_type(hid_t tid) case H5T_NO_CLASS: case H5T_NCLASSES: default: - HDassert(0); break; } /* end switch */ diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 08213df..8c435b2 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -608,7 +608,6 @@ find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: default: - HDassert(0); break; } /* end switch */ @@ -777,8 +776,11 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_ } /* end if */ /* trg_path must be freed out of this function when finished using */ - link_info->trg_path = (char*)HDcalloc(link_info->linfo.u.val_size, sizeof(char)); - HDassert(link_info->trg_path); + if((link_info->trg_path = (char*)HDcalloc(link_info->linfo.u.val_size, sizeof(char))) == NULL) { + if(link_info->opt.msg_mode == 1) + parallel_print("Warning: unable to allocate buffer for <%s>\n",linkpath); + goto out; + } /* end if */ /* get link value */ if(H5Lget_val(file_id, linkpath, (void *)link_info->trg_path, link_info->linfo.u.val_size, H5P_DEFAULT) < 0) { diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 3d55f2d..ddc0109 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -557,7 +557,7 @@ trav_info_free(trav_info_t *info) if(info) { /* Free visited symbolic links path and file (if alloc) */ - for(u=0; u < info->symlink_visited.nused; u++) + for(u=0; u < info->symlink_visited.nused; u++) { if (info->symlink_visited.objs[u].file) HDfree(info->symlink_visited.objs[u].file); @@ -789,8 +789,6 @@ trav_table_addlink(trav_table_t *table, haddr_t objno, const char *path) return; } /* end for */ } /* end for */ - - HDassert(0 && "object not in table?!?"); } @@ -1017,7 +1015,7 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo, /* Finish printing line about object */ printf("\n"); if(trav_verbosity > 0) - H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, + H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, NULL, trav_attr, &op_data, H5P_DEFAULT); } else @@ -1051,12 +1049,12 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) case H5L_TYPE_SOFT: if(linfo->u.val_size > 0) { char *targbuf = (char*)HDmalloc(linfo->u.val_size + 1); - HDassert(targbuf); - - if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) - targbuf[0] = 0; - printf(" %-10s %s -> %s\n", "link", path, targbuf); - HDfree(targbuf); + if(targbuf) { + if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) + targbuf[0] = 0; + printf(" %-10s %s -> %s\n", "link", path, targbuf); + HDfree(targbuf); + } } /* end if */ else printf(" %-10s %s ->\n", "link", path); @@ -1069,13 +1067,13 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) const char *objname = NULL; targbuf = (char*)HDmalloc(linfo->u.val_size + 1); - HDassert(targbuf); - - if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) - targbuf[0] = 0; - if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname) >= 0) - printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); - HDfree(targbuf); + if(targbuf) { + if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) + targbuf[0] = 0; + if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname) >= 0) + printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); + HDfree(targbuf); + } } /* end if */ else printf(" %-10s %s ->\n", "ext link", path); diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 3f91fce..be84b26 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -159,36 +159,28 @@ static int parse_flag(const char* s_flag, unsigned *flag) { unsigned fla=0; - if (HDstrcmp(s_flag,"shallow")==0) - { + if (HDstrcmp(s_flag, "shallow") == 0) { fla = H5O_COPY_SHALLOW_HIERARCHY_FLAG; } - else if (HDstrcmp(s_flag,"soft")==0) - { + else if (HDstrcmp(s_flag, "soft") == 0) { fla = H5O_COPY_EXPAND_SOFT_LINK_FLAG; } - else if (HDstrcmp(s_flag,"ext")==0) - { + else if (HDstrcmp(s_flag, "ext") == 0) { fla = H5O_COPY_EXPAND_EXT_LINK_FLAG; } - else if (HDstrcmp(s_flag,"ref")==0) - { + else if (HDstrcmp(s_flag, "ref") == 0) { fla = H5O_COPY_EXPAND_REFERENCE_FLAG; } - else if (HDstrcmp(s_flag,"noattr")==0) - { + else if (HDstrcmp(s_flag, "noattr") == 0) { fla = H5O_COPY_WITHOUT_ATTR_FLAG; } - else if (HDstrcmp(s_flag,"allflags")==0) - { + else if (HDstrcmp(s_flag, "allflags") == 0) { fla = H5O_COPY_ALL; } - else if (HDstrcmp(s_flag,"nullmsg")==0) - { + else if (HDstrcmp(s_flag, "nullmsg") == 0) { fla = H5O_COPY_PRESERVE_NULL_FLAG; } - else - { + else { error_msg("Error in input flag\n"); return -1; } @@ -247,25 +239,21 @@ main (int argc, const char *argv[]) HDmemset(&linkinfo, 0, sizeof(h5tool_link_info_t)); /* Check for no command line parameters */ - if(argc == 1) - { + if(argc == 1) { usage(); leave(EXIT_FAILURE); } /* end if */ /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) - { - switch ((char)opt) - { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + switch ((char)opt) { case 'd': oname_dst = HDstrdup(opt_arg); break; case 'f': /* validate flag */ - if (parse_flag(opt_arg,&flag)<0) - { + if (parse_flag(opt_arg, &flag) < 0) { usage(); leave(EXIT_FAILURE); } @@ -316,29 +304,25 @@ main (int argc, const char *argv[]) * check for missing file/object names *-------------------------------------------------------------------------*/ - if (fname_src==NULL) - { + if (fname_src==NULL) { error_msg("Input file name missing\n"); usage(); leave(EXIT_FAILURE); } - if (fname_dst==NULL) - { + if (fname_dst==NULL) { error_msg("Output file name missing\n"); usage(); leave(EXIT_FAILURE); } - if (oname_src==NULL) - { + if (oname_src==NULL) { error_msg("Source object name missing\n"); usage(); leave(EXIT_FAILURE); } - if (oname_dst==NULL) - { + if (oname_dst==NULL) { error_msg("Destination object name missing\n"); usage(); leave(EXIT_FAILURE); @@ -367,8 +351,7 @@ main (int argc, const char *argv[]) /*------------------------------------------------------------------------- * test for error in opening input file *-------------------------------------------------------------------------*/ - if (fid_src==-1) - { + if (fid_src==-1) { error_msg("Could not open input file <%s>...Exiting\n", fname_src); leave(EXIT_FAILURE); } @@ -386,8 +369,7 @@ main (int argc, const char *argv[]) /*------------------------------------------------------------------------- * test for error in opening output file *-------------------------------------------------------------------------*/ - if (fid_dst==-1) - { + if (fid_dst==-1) { error_msg("Could not open output file <%s>...Exiting\n", fname_dst); leave(EXIT_FAILURE); } @@ -396,12 +378,10 @@ main (int argc, const char *argv[]) * print some info *-------------------------------------------------------------------------*/ - if (verbose) - { + if (verbose) { printf("Copying file <%s> and object <%s> to file <%s> and object <%s>\n", fname_src, oname_src, fname_dst, oname_dst); if (flag) { - HDassert(str_flag); printf("Using %s flag\n", str_flag); } } @@ -416,8 +396,7 @@ main (int argc, const char *argv[]) HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pcreate failed"); /* set options for object copy */ - if (flag) - { + if (flag) { if ( H5Pset_copy_object(ocpl_id, flag) < 0) HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pset_copy_object failed"); } @@ -440,24 +419,21 @@ main (int argc, const char *argv[]) if(verbose) printf("%s: Creating parent groups\n", h5tools_getprogname()); } /* end if */ - else /* error, if parent groups doesn't already exist in destination file */ - { + else { + /* error, if parent groups doesn't already exist in destination file */ size_t i, len; len = HDstrlen(oname_dst); /* check if all the parents groups exist. skip root group */ - for (i = 1; i < len; i++) - { - if ('/'==oname_dst[i]) - { + for (i = 1; i < len; i++) { + if ('/'==oname_dst[i]) { char *str_ptr; str_ptr = (char *)HDcalloc(i + 1, sizeof(char)); HDstrncpy(str_ptr, oname_dst, i); str_ptr[i]='\0'; - if (H5Lexists(fid_dst, str_ptr, H5P_DEFAULT) <= 0) - { + if (H5Lexists(fid_dst, str_ptr, H5P_DEFAULT) <= 0) { error_msg("group <%s> doesn't exist. Use -p to create parent groups.\n", str_ptr); HDfree(str_ptr); HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Lexists failed"); @@ -475,15 +451,15 @@ main (int argc, const char *argv[]) linkinfo.opt.msg_mode = 1; li_ret = H5tools_get_symlink_info(fid_src, oname_src, &linkinfo, 1); - if (li_ret == 0) /* dangling link */ - { + if (li_ret == 0) { + /* dangling link */ if(H5Lcopy(fid_src, oname_src, fid_dst, oname_dst, H5P_DEFAULT, H5P_DEFAULT) < 0) HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Lcopy failed"); } - else /* valid link */ - { + else { + /* valid link */ if (H5Ocopy(fid_src, /* Source file or group identifier */ oname_src, /* Name of the source object to be copied */ fid_dst, /* Destination file or group identifier */ @@ -518,13 +494,13 @@ done: if (linkinfo.trg_path) HDfree(linkinfo.trg_path); - H5E_BEGIN_TRY { - H5Pclose(ocpl_id); - H5Pclose(lcpl_id); - H5Fclose(fid_src); - H5Fclose(fid_dst); - } H5E_END_TRY; + H5E_BEGIN_TRY { + H5Pclose(ocpl_id); + H5Pclose(lcpl_id); + H5Fclose(fid_src); + H5Fclose(fid_dst); + } H5E_END_TRY; - leave(ret_value); + leave(ret_value); } diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index bf2e127..b90d60f 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -721,93 +721,100 @@ parse_mask_list(const char *h_list) const char *ptr = NULL; /* sanity check */ - HDassert(h_list); + if(h_list) { + HDmemset(packed_mask,0,sizeof(packed_mask)); + + packed_bits_num = 0; + /* scan in pair of offset,length separated by commas. */ + ptr = h_list; + while (*ptr) { + /* scan for an offset which is an unsigned int */ + if (!HDisdigit(*ptr)) { + error_msg("Bad mask list(%s)\n", h_list); + return FAIL; + } + soffset_value = HDatoi(ptr); + offset_value = (unsigned)soffset_value; + if (soffset_value < 0 || offset_value >= PACKED_BITS_SIZE_MAX) { + error_msg("Packed Bit offset value(%d) must be between 0 and %u\n", + soffset_value, (unsigned)(PACKED_BITS_SIZE_MAX - 1)); + return FAIL; + } - HDmemset(packed_mask,0,sizeof(packed_mask)); + /* skip to end of integer */ + while (HDisdigit(*++ptr)) + ; + /* Look for the common separator */ + if (*ptr++ != ',') { + error_msg("Bad mask list(%s), missing expected comma separator.\n", h_list); + return FAIL; + } - packed_bits_num = 0; - /* scan in pair of offset,length separated by commas. */ - ptr = h_list; - while (*ptr) { - /* scan for an offset which is an unsigned int */ - if (!HDisdigit(*ptr)) { - error_msg("Bad mask list(%s)\n", h_list); - return FAIL; - } - soffset_value = HDatoi(ptr); - offset_value = (unsigned)soffset_value; - if (soffset_value < 0 || offset_value >= PACKED_BITS_SIZE_MAX) { - error_msg("Packed Bit offset value(%d) must be between 0 and %u\n", - soffset_value, (unsigned)(PACKED_BITS_SIZE_MAX - 1)); - return FAIL; - } + /* scan for a length which is a positive int */ + if (!HDisdigit(*ptr)) { + error_msg("Bad mask list(%s)\n", h_list); + return FAIL; + } + slength_value = HDatoi(ptr); + if (slength_value <= 0) { + error_msg("Packed Bit length value(%d) must be positive.\n", slength_value); + return FAIL; + } + length_value = (unsigned)slength_value; + if ((offset_value + length_value) > PACKED_BITS_SIZE_MAX) { + error_msg("Packed Bit offset+length value(%u) too large. Max is %u\n", + offset_value+length_value, (unsigned)PACKED_BITS_SIZE_MAX); + return FAIL; + } - /* skip to end of integer */ - while (HDisdigit(*++ptr)) - ; - /* Look for the common separator */ - if (*ptr++ != ',') { - error_msg("Bad mask list(%s), missing expected comma separator.\n", h_list); - return FAIL; - } + /* skip to end of int */ + while (HDisdigit(*++ptr)) + ; - /* scan for a length which is a positive int */ - if (!HDisdigit(*ptr)) { - error_msg("Bad mask list(%s)\n", h_list); - return FAIL; - } - slength_value = HDatoi(ptr); - if (slength_value <= 0) { - error_msg("Packed Bit length value(%d) must be positive.\n", slength_value); - return FAIL; + /* store the offset,length pair */ + if (packed_bits_num >= PACKED_BITS_MAX) { + /* too many requests */ + error_msg("Too many masks requested (max. %d). Mask list(%s)\n", PACKED_BITS_MAX, h_list); + return FAIL; + } + packed_offset[packed_bits_num] = offset_value; + packed_length[packed_bits_num] = length_value; + /* create the bit mask by left shift 1's by length, then negate it. */ + /* After packed_mask is calculated, packed_length is not needed but */ + /* keep it for debug purpose. */ + temp_mask = ~0ULL; + if(length_value < (int)(8 *sizeof(unsigned long long))) { + temp_mask = temp_mask << length_value; + packed_mask[packed_bits_num] = ~temp_mask; + } + else + packed_mask[packed_bits_num] = temp_mask; + packed_bits_num++; + + /* skip a possible comma separator */ + if (*ptr == ',') { + if (!(*++ptr)) { + /* unexpected end of string */ + error_msg("Bad mask list(%s), unexpected end of string.\n", h_list); + return FAIL; + } + } } - length_value = (unsigned)slength_value; - if ((offset_value + length_value) > PACKED_BITS_SIZE_MAX) { - error_msg("Packed Bit offset+length value(%u) too large. Max is %u\n", - offset_value+length_value, (unsigned)PACKED_BITS_SIZE_MAX); + if(packed_bits_num > PACKED_BITS_MAX) { + error_msg("Maximum number of packed bits exceeded\n"); return FAIL; } - - /* skip to end of int */ - while (HDisdigit(*++ptr)) - ; - - /* store the offset,length pair */ - if (packed_bits_num >= PACKED_BITS_MAX) { - /* too many requests */ - error_msg("Too many masks requested (max. %d). Mask list(%s)\n", PACKED_BITS_MAX, h_list); + if (packed_bits_num == 0) { + /* got no masks! */ + error_msg("Bad mask list(%s)\n", h_list); return FAIL; } - packed_offset[packed_bits_num] = offset_value; - packed_length[packed_bits_num] = length_value; - /* create the bit mask by left shift 1's by length, then negate it. */ - /* After packed_mask is calculated, packed_length is not needed but */ - /* keep it for debug purpose. */ - temp_mask = ~0ULL; - if(length_value < (int)(8 *sizeof(unsigned long long))) { - temp_mask = temp_mask << length_value; - packed_mask[packed_bits_num] = ~temp_mask; - } - else - packed_mask[packed_bits_num] = temp_mask; - packed_bits_num++; - - /* skip a possible comma separator */ - if (*ptr == ',') { - if (!(*++ptr)) { - /* unexpected end of string */ - error_msg("Bad mask list(%s), unexpected end of string.\n", h_list); - return FAIL; - } - } + return SUCCEED; } - HDassert(packed_bits_num <= PACKED_BITS_MAX); - if (packed_bits_num == 0) { - /* got no masks! */ - error_msg("Bad mask list(%s)\n", h_list); + else { + error_msg("Bad mask list argument\n"); return FAIL; } - return SUCCEED; } @@ -1708,13 +1715,18 @@ h5_fileaccess(void) HDmemset(memb_name, 0, sizeof memb_name); HDmemset(memb_addr, 0, sizeof memb_addr); - HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); - for (mt=H5FD_MEM_DEFAULT; mt 0); - *prfx = (char *)HDcalloc(prfx_len, 1); + if(prfx_len > 0) + *prfx = (char *)HDcalloc(prfx_len, 1); + else + error_msg("unable to allocate prefix buffer\n"); } diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c index 0a45840..eecd113 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -248,17 +248,19 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR /* Keep copy of prefix before iterating into group */ old_prefix = HDstrdup(prefix); - HDassert(old_prefix); + if (old_prefix) { + /* Append group name to prefix */ + add_prefix(&prefix, &prefix_len, name); - /* Append group name to prefix */ - add_prefix(&prefix, &prefix_len, name); + /* Iterate into group */ + dump_function_table->dump_group_function(obj, name); - /* Iterate into group */ - dump_function_table->dump_group_function(obj, name); - - /* Restore old prefix name */ - HDstrcpy(prefix, old_prefix); - HDfree(old_prefix); + /* Restore old prefix name */ + HDstrcpy(prefix, old_prefix); + HDfree(old_prefix); + } + else + error_msg("warning: null prefix\n"); /* Close group */ H5Gclose(obj); @@ -408,131 +410,137 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR switch(linfo->type) { case H5L_TYPE_SOFT: - targbuf = (char *)HDmalloc(linfo->u.val_size); - HDassert(targbuf); - - ctx.need_prefix = TRUE; - - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s \"%s\" %s", - h5tools_dump_header_format->softlinkbegin, name, - h5tools_dump_header_format->softlinkblockbegin); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - - ctx.indent_level++; - - if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { - error_msg("unable to get link value\n"); + if((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) { + error_msg("unable to allocate buffer\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } else { - /* print the value of a soft link */ - /* Standard DDL: no modification */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "LINKTARGET \"%s\"", targbuf); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->softlinkbegin, name, + h5tools_dump_header_format->softlinkblockbegin); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } - ctx.indent_level--; + ctx.indent_level++; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { + error_msg("unable to get link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + else { + /* print the value of a soft link */ + /* Standard DDL: no modification */ + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - if(HDstrlen(h5tools_dump_header_format->softlinkblockend)) { - h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkblockend); - if(HDstrlen(h5tools_dump_header_format->softlinkend)) - h5tools_str_append(&buffer, " "); - } - if(HDstrlen(h5tools_dump_header_format->softlinkend)) - h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkend); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "LINKTARGET \"%s\"", targbuf); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + } - HDfree(targbuf); - break; + ctx.indent_level--; - case H5L_TYPE_EXTERNAL: - targbuf = (char *)HDmalloc(linfo->u.val_size); - HDassert(targbuf); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + /* Render the element */ + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->softlinkblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkblockend); + if(HDstrlen(h5tools_dump_header_format->softlinkend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->softlinkend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s \"%s\" %s", - h5tools_dump_header_format->extlinkbegin, name, - h5tools_dump_header_format->extlinkblockbegin); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + HDfree(targbuf); + } + break; - if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { - indentation(dump_indent); - error_msg("unable to get external link value\n"); + case H5L_TYPE_EXTERNAL: + if((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) { + error_msg("unable to allocate buffer\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; - } /* end if */ + } else { - const char *filename; - const char *targname; + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &targname) < 0) { + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->extlinkbegin, name, + h5tools_dump_header_format->extlinkblockbegin); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + + if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { indentation(dump_indent); - error_msg("unable to unpack external link value\n"); + error_msg("unable to get external link value\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } /* end if */ else { - ctx.indent_level++; + const char *filename; + const char *targname; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &targname) < 0) { + indentation(dump_indent); + error_msg("unable to unpack external link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } /* end if */ + else { + ctx.indent_level++; - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "TARGETFILE \"%s\"", filename); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "TARGETFILE \"%s\"", filename); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "TARGETPATH \"%s\"", targname); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* dump the external link */ - dump_extlink(group, name, targname); - ctx.indent_level--; + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "TARGETPATH \"%s\"", targname); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + + /* dump the external link */ + dump_extlink(group, name, targname); + ctx.indent_level--; + } /* end else */ } /* end else */ - } /* end else */ - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - if(HDstrlen(h5tools_dump_header_format->extlinkblockend)) { - h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkblockend); + /* Render the element */ + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->extlinkblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkblockend); + if(HDstrlen(h5tools_dump_header_format->extlinkend)) + h5tools_str_append(&buffer, " "); + } if(HDstrlen(h5tools_dump_header_format->extlinkend)) - h5tools_str_append(&buffer, " "); - } - if(HDstrlen(h5tools_dump_header_format->extlinkend)) - h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkend); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(targbuf); + HDfree(targbuf); + } break; case H5L_TYPE_ERROR: case H5L_TYPE_MAX: - HDassert(0); - /* fall through */ case H5L_TYPE_HARD: default: ctx.need_prefix = TRUE; @@ -1082,7 +1090,7 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) case H5T_NO_CLASS: case H5T_NCLASSES: default: - HDassert(0); + error_msg("invalid H5TCLASS type\n"); break; } /* end switch */ } /* for(u=0; uudlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin); diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index d731013..a83ec08 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -198,18 +198,22 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ char *old_prefix; /* Pointer to previous prefix */ /* Keep copy of prefix before iterating into group */ - old_prefix = HDstrdup(prefix); - HDassert(old_prefix); - - /* Append group name to prefix */ - add_prefix(&prefix, &prefix_len, name); + if((old_prefix = HDstrdup(prefix)) == NULL) { + error_msg("unable to allocate buffer\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + else { + /* Append group name to prefix */ + add_prefix(&prefix, &prefix_len, name); - /* Iterate into group */ - dump_function_table->dump_group_function(obj, name); + /* Iterate into group */ + dump_function_table->dump_group_function(obj, name); - /* Restore old prefix name */ - HDstrcpy(prefix, old_prefix); - HDfree(old_prefix); + /* Restore old prefix name */ + HDstrcpy(prefix, old_prefix); + HDfree(old_prefix); + } /* Close group */ H5Gclose(obj); @@ -360,161 +364,167 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ switch(linfo->type) { case H5L_TYPE_SOFT: - targbuf = (char *)HDmalloc(linfo->u.val_size); - HDassert(targbuf); - - if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { - error_msg("unable to get link value\n"); + if((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) { + error_msg("unable to allocate buffer\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } else { - /* print the value of a soft link */ - /* XML */ - char linkxid[100]; - char parentxid[100]; - char targetxid[100]; - char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); - char *t_name = xml_escape_the_name(name); - char *t_targbuf = xml_escape_the_name(targbuf); - char *t_obj_path = xml_escape_the_name(obj_path); - char *t_link_path; - int res; - - t_link_path = (char *)HDmalloc(HDstrlen(prefix) + linfo->u.val_size + 1); - if(targbuf[0] == '/') - HDstrcpy(t_link_path, targbuf); + if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { + error_msg("unable to get link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } else { - HDstrcpy(t_link_path, prefix); - HDstrcat(HDstrcat(t_link_path, "/"), targbuf); - } /* end else */ + /* print the value of a soft link */ + /* XML */ + char linkxid[100]; + char parentxid[100]; + char targetxid[100]; + char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); + char *t_name = xml_escape_the_name(name); + char *t_targbuf = xml_escape_the_name(targbuf); + char *t_obj_path = xml_escape_the_name(obj_path); + char *t_link_path; + int res; - /* Create OBJ-XIDs for the parent and object */ - xml_name_to_XID(t_obj_path, linkxid, (int)sizeof(linkxid), 1); - xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); + t_link_path = (char *)HDmalloc(HDstrlen(prefix) + linfo->u.val_size + 1); + if(targbuf[0] == '/') + HDstrcpy(t_link_path, targbuf); + else { + HDstrcpy(t_link_path, prefix); + HDstrcat(HDstrcat(t_link_path, "/"), targbuf); + } /* end else */ - /* Try to create an OBJ-XID for the object pointed to */ - res = xml_name_to_XID(t_link_path, targetxid, (int)sizeof(targetxid), 0); - if (res == 0) { - /* target obj found */ - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + /* Create OBJ-XIDs for the parent and object */ + xml_name_to_XID(t_obj_path, linkxid, (int)sizeof(linkxid), 1); + xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sSoftLink LinkName=\"%s\" " - "OBJ-XID=\"%s\" " - "H5SourcePath=\"%s\" " - "TargetPath=\"%s\" TargetObj=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" />", - xmlnsprefix, - t_name, /* LinkName */ - linkxid, /* OBJ-XID */ - t_obj_path, /* H5SourcePath */ - t_targbuf, /* TargetPath */ - targetxid, /* TargetObj */ - parentxid, /* Parents */ - t_prefix); /* H5ParentPaths */ - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } - else { - /* dangling link -- omit from xml attributes */ - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + /* Try to create an OBJ-XID for the object pointed to */ + res = xml_name_to_XID(t_link_path, targetxid, (int)sizeof(targetxid), 0); + if (res == 0) { + /* target obj found */ + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sSoftLink LinkName=\"%s\" " - "OBJ-XID=\"%s\" " - "H5SourcePath=\"%s\" " - "TargetPath=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" />", - xmlnsprefix, - t_name, /* LinkName */ - linkxid, /* OBJ-XID */ - t_obj_path, /* H5SourcePath */ - t_targbuf, /* TargetPath */ - parentxid, /* Parents */ - t_prefix); /* H5ParentPaths */ - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sSoftLink LinkName=\"%s\" " + "OBJ-XID=\"%s\" " + "H5SourcePath=\"%s\" " + "TargetPath=\"%s\" TargetObj=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" />", + xmlnsprefix, + t_name, /* LinkName */ + linkxid, /* OBJ-XID */ + t_obj_path, /* H5SourcePath */ + t_targbuf, /* TargetPath */ + targetxid, /* TargetObj */ + parentxid, /* Parents */ + t_prefix); /* H5ParentPaths */ + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + } + else { + /* dangling link -- omit from xml attributes */ + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sSoftLink LinkName=\"%s\" " + "OBJ-XID=\"%s\" " + "H5SourcePath=\"%s\" " + "TargetPath=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" />", + xmlnsprefix, + t_name, /* LinkName */ + linkxid, /* OBJ-XID */ + t_obj_path, /* H5SourcePath */ + t_targbuf, /* TargetPath */ + parentxid, /* Parents */ + t_prefix); /* H5ParentPaths */ + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + } + + HDfree(t_prefix); + HDfree(t_name); + HDfree(t_targbuf); + HDfree(t_obj_path); + HDfree(t_link_path); } - HDfree(t_prefix); - HDfree(t_name); - HDfree(t_targbuf); - HDfree(t_obj_path); - HDfree(t_link_path); + HDfree(targbuf); } - - HDfree(targbuf); break; case H5L_TYPE_EXTERNAL: - targbuf = (char *)HDmalloc(linfo->u.val_size); - HDassert(targbuf); - - if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { - error_msg("unable to get external link value\n"); + if((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) { + error_msg("unable to allocate buffer\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; - } /* end if */ + } else { - const char *filename; - const char *targname; - - if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &targname) < 0) { - error_msg("unable to unpack external link value\n"); + if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { + error_msg("unable to get external link value\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } /* end if */ else { - char linkxid[100]; - char parentxid[100]; - char *t_name = xml_escape_the_name(name); - char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); - char *t_obj_path = xml_escape_the_name(obj_path); - char *t_filename = xml_escape_the_name(filename); - char *t_targname = xml_escape_the_name(targname); + const char *filename; + const char *targname; - /* Create OBJ-XIDs for the parent and object */ - xml_name_to_XID(t_obj_path, linkxid, (int)sizeof(linkxid), 1); - xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); + if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &targname) < 0) { + error_msg("unable to unpack external link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } /* end if */ + else { + char linkxid[100]; + char parentxid[100]; + char *t_name = xml_escape_the_name(name); + char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); + char *t_obj_path = xml_escape_the_name(obj_path); + char *t_filename = xml_escape_the_name(filename); + char *t_targname = xml_escape_the_name(targname); - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + /* Create OBJ-XIDs for the parent and object */ + xml_name_to_XID(t_obj_path, linkxid, (int)sizeof(linkxid), 1); + xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sExternalLink LinkName=\"%s\" " - "OBJ-XID=\"%s\" " - "H5SourcePath=\"%s\" " - "TargetFilename=\"%s\" " - "TargetPath=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" />", - xmlnsprefix, - t_name, /* LinkName */ - linkxid, /* OBJ-XID */ - t_obj_path, /* H5SourcePath */ - filename, /* TargetFilename */ - targname, /* TargetPath*/ - parentxid, /* Parents */ - t_prefix); /* H5ParentPaths */ - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - HDfree(t_prefix); - HDfree(t_name); - HDfree(t_filename); - HDfree(t_targname); - HDfree(t_obj_path); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sExternalLink LinkName=\"%s\" " + "OBJ-XID=\"%s\" " + "H5SourcePath=\"%s\" " + "TargetFilename=\"%s\" " + "TargetPath=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" />", + xmlnsprefix, + t_name, /* LinkName */ + linkxid, /* OBJ-XID */ + t_obj_path, /* H5SourcePath */ + filename, /* TargetFilename */ + targname, /* TargetPath*/ + parentxid, /* Parents */ + t_prefix); /* H5ParentPaths */ + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + + HDfree(t_prefix); + HDfree(t_name); + HDfree(t_filename); + HDfree(t_targname); + HDfree(t_obj_path); + } /* end else */ } /* end else */ - } /* end else */ - HDfree(targbuf); + HDfree(targbuf); + } break; case H5L_TYPE_ERROR: case H5L_TYPE_MAX: - HDassert(0); - /* fall through */ case H5L_TYPE_HARD: default: { @@ -674,7 +684,6 @@ xml_escape_the_name(const char *str) for (i = 0; i < len; i++) { size_t esc_len; - HDassert(ncp_len); if (*cp == '\'') { HDstrncpy(ncp, apos, ncp_len); esc_len = HDstrlen(apos); @@ -768,7 +777,6 @@ xml_escape_the_string(const char *str, int slen) for (i = 0; i < len; i++) { size_t esc_len; - HDassert(ncp_len); if (*cp == '\\') { *ncp++ = '\\'; *ncp = *cp; @@ -1514,8 +1522,6 @@ xml_print_datatype(hid_t type, unsigned in_group) case H5T_NO_CLASS: case H5T_NCLASSES: - HDassert(0); - /* fall through */ default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -1968,22 +1974,26 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, for (i = 0; i < ndims; i++) nelmts *= size[i]; - buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)))); - HDassert(buf); - - if (H5Aread(obj_id, p_type, buf) >= 0) { - h5tools_context_t datactx; - HDmemset(&datactx, 0, sizeof(datactx)); - datactx.need_prefix = TRUE; - datactx.indent_level = ctx.indent_level; - datactx.cur_column = ctx.cur_column; - status = h5tools_dump_mem(rawoutstream, outputformat, &datactx, obj_id, p_type, space, buf); + if((buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type))))) == NULL) { + error_msg("unable to allocate buffer\n"); + h5tools_setstatus(EXIT_FAILURE); + status = FAIL; } - /* Reclaim any VL memory, if necessary */ - if (vl_data) - H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); + else { + if (H5Aread(obj_id, p_type, buf) >= 0) { + h5tools_context_t datactx; + HDmemset(&datactx, 0, sizeof(datactx)); + datactx.need_prefix = TRUE; + datactx.indent_level = ctx.indent_level; + datactx.cur_column = ctx.cur_column; + status = h5tools_dump_mem(rawoutstream, outputformat, &datactx, obj_id, p_type, space, buf); + } + /* Reclaim any VL memory, if necessary */ + if (vl_data) + H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); - HDfree(buf); + HDfree(buf); + } } H5Tclose(p_type); H5Sclose(space); @@ -2239,8 +2249,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED break; case H5T_NO_CLASS: case H5T_NCLASSES: - HDassert(0); - /* fall through */ default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -3672,8 +3680,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_NO_CLASS: case H5T_NCLASSES: - HDassert(0); - /* fall through */ case H5T_STRING: case H5T_REFERENCE: default: @@ -3812,91 +3818,95 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s /* Print information about storage layout */ if (H5D_CHUNKED == H5Pget_layout(dcpl)) { - maxdims = H5Sget_simple_extent_ndims(space); - HDassert(maxdims >= 0); - chsize = (hsize_t *)HDmalloc((size_t)maxdims * sizeof(hsize_t)); - ctx.indent_level++; - dump_indent += COL; + if((maxdims = H5Sget_simple_extent_ndims(space)) < 0) { + error_msg("unable to get maxdims\n"); + h5tools_setstatus(EXIT_FAILURE); + } + else { + chsize = (hsize_t *)HDmalloc((size_t)maxdims * sizeof(hsize_t)); + ctx.indent_level++; + dump_indent += COL; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sStorageLayout>", xmlnsprefix); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - ctx.indent_level++; - dump_indent += COL; + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sStorageLayout>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + ctx.indent_level++; + dump_indent += COL; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sChunkedLayout ", xmlnsprefix); - ndims = H5Pget_chunk(dcpl, maxdims, chsize); - h5tools_str_append(&buffer, "Ndims=\"%d\">", ndims); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sChunkedLayout ", xmlnsprefix); + ndims = H5Pget_chunk(dcpl, maxdims, chsize); + h5tools_str_append(&buffer, "Ndims=\"%d\">", ndims); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - ctx.indent_level++; - dump_indent += COL; + ctx.indent_level++; + dump_indent += COL; - for (i = 0; i < ndims; i++) { + for (i = 0; i < ndims; i++) { + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sChunkDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" />", xmlnsprefix, chsize[i]); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + } ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sChunkDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" />", xmlnsprefix, chsize[i]); + h5tools_str_append(&buffer, "<%sRequiredFilter>", xmlnsprefix); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } - - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sRequiredFilter>", xmlnsprefix); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - ctx.indent_level++; - dump_indent += COL; - check_filters(dcpl); - ctx.indent_level--; - dump_indent -= COL; + ctx.indent_level++; + dump_indent += COL; + check_filters(dcpl); + ctx.indent_level--; + dump_indent -= COL; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - ctx.indent_level--; - dump_indent -= COL; + ctx.indent_level--; + dump_indent -= COL; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - ctx.indent_level--; - dump_indent -= COL; + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + ctx.indent_level--; + dump_indent -= COL; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - ctx.indent_level--; - dump_indent -= COL; - HDfree(chsize); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + ctx.indent_level--; + dump_indent -= COL; + HDfree(chsize); + } } else if (H5D_CONTIGUOUS == H5Pget_layout(dcpl)) { ctx.indent_level++; @@ -3984,8 +3994,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s h5tools_str_append(&buffer, "FillIfSet"); break; case H5D_FILL_TIME_ERROR: - HDassert(0); - /* fall through */ default: h5tools_str_append(&buffer, "?"); break; @@ -4005,8 +4013,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s break; case H5D_ALLOC_TIME_DEFAULT: case H5D_ALLOC_TIME_ERROR: - HDassert(0); - /* fall through */ default: h5tools_str_append(&buffer, "?"); break; @@ -4233,9 +4239,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s break; case H5T_NO_CLASS: case H5T_NCLASSES: - HDassert(0); - /* fall through */ - default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index a403cf1..8c15686 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -73,13 +73,13 @@ usage (const char *prog) HDfprintf (stdout, "Adds user block to front of an HDF5 file and creates a new concatenated file.\n"); HDfprintf (stdout, "\n"); - HDfprintf (stdout, + HDfprintf (stdout, "OPTIONS\n"); - HDfprintf (stdout, + HDfprintf (stdout, " -i in_file.h5 Specifies the input HDF5 file.\n"); - HDfprintf (stdout, + HDfprintf (stdout, " -u in_user_file Specifies the file to be inserted into the user block.\n"); - HDfprintf (stdout, + HDfprintf (stdout, " Can be any file format except an HDF5 format.\n"); HDfprintf (stdout, " -o out_file.h5 Specifies the output HDF5 file.\n"); @@ -392,7 +392,7 @@ main (int argc, const char *argv[]) HDfree (input_file); if(output_file) HDfree (output_file); - + if(ufid >= 0) HDclose (ufid); if(h5fid >= 0) @@ -548,7 +548,8 @@ write_pad(int ofile, hsize_t old_where, hsize_t *new_where) char buf[1]; hsize_t psize; - HDassert(new_where); + if(new_where == NULL) + return FAIL; buf[0] = '\0'; diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index 1cc8cb3..4e9798e 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -133,28 +133,28 @@ static int parse_command_line(int argc, const char *argv[]) { int opt = FALSE; - + /* parse command line options */ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch((char)opt) { case 'o': output_file = HDstrdup(opt_arg); - if (output_file) - h5tools_set_data_output_file(output_file, 1); - break; + if (output_file) + h5tools_set_data_output_file(output_file, 1); + break; case 'i': input_file = HDstrdup(opt_arg); - if (input_file) - h5tools_set_input_file(input_file, 1); - break;; + if (input_file) + h5tools_set_input_file(input_file, 1); + break;; case 'u': ub_file = HDstrdup(opt_arg); - if (ub_file) - h5tools_set_output_file(ub_file, 1); - else - rawoutstream = stdout; + if (ub_file) + h5tools_set_output_file(ub_file, 1); + else + rawoutstream = stdout; break; case 'd': @@ -180,7 +180,7 @@ parse_command_line(int argc, const char *argv[]) } return EXIT_SUCCESS; - + done: if(input_file) HDfree(input_file); @@ -240,7 +240,7 @@ main(int argc, const char *argv[]) h5tools_setstatus(EXIT_FAILURE); goto done; } - + testval = H5Fis_hdf5(input_file); if (testval <= 0) { @@ -272,10 +272,8 @@ main(int argc, const char *argv[]) goto done; } - status = H5Pclose(plist); - HDassert(status >= 0); - status = H5Fclose(ifile); - HDassert(status >= 0); + H5Pclose(plist); + H5Fclose(ifile); if (usize == 0) { /* no user block to remove: message? */ @@ -303,7 +301,7 @@ main(int argc, const char *argv[]) error_msg("unable to open output HDF5 file \"%s\"\n", input_file); h5tools_setstatus(EXIT_FAILURE); goto done; - } + } /* copy from 0 to 'usize - 1' into ufid */ if (!do_delete) { @@ -321,18 +319,18 @@ main(int argc, const char *argv[]) h5tools_setstatus(EXIT_FAILURE); goto done; } - + done: if(input_file) HDfree(input_file); - + if(output_file) HDfree(output_file); - + if(ub_file) { HDfree(ub_file); } - + h5tools_close(); return h5tools_getstatus(); @@ -374,7 +372,7 @@ copy_to_file( FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much ) else bytes_in = how_much; - /* Seek to correct position in input file */ + /* Seek to correct position in input file */ HDfseek(infid, from, SEEK_SET); /* Read data to buffer */ @@ -396,11 +394,11 @@ copy_to_file( FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much ) to += (off_t)bytes_read; /* Write nchars bytes to output file */ - bytes_wrote = HDfwrite(buf, (size_t)1, bytes_read, ofid); - if(bytes_wrote != bytes_read || (0 == bytes_wrote && HDferror(ofid))) { /* error */ - ret_value = -1; - goto done; - } /* end if */ + bytes_wrote = HDfwrite(buf, (size_t)1, bytes_read, ofid); + if(bytes_wrote != bytes_read || (0 == bytes_wrote && HDferror(ofid))) { /* error */ + ret_value = -1; + goto done; + } /* end if */ } /* end while */ done: diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index a181186..d397067 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -1619,9 +1619,9 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain if(space_type != H5S_NULL && space_type != H5S_NO_CLASS) { if(hexdump_g) - p_type = H5Tcopy(type); + p_type = H5Tcopy(type); else - p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); + p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); if(p_type >= 0) { /* VL data special information */ @@ -1631,23 +1631,22 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain if (h5tools_detect_vlen(p_type) == TRUE) vl_data = TRUE; - temp_need= nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); - HDassert(temp_need == (hsize_t)((size_t)temp_need)); + temp_need = nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); need = (size_t)temp_need; - buf = HDmalloc(need); - HDassert(buf); - if(H5Aread(attr, p_type, buf) >= 0) { - ctx.need_prefix = TRUE; - ctx.indent_level = 2; - ctx.cur_column = (size_t)curr_pos; - h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf); - } + if((buf = HDmalloc(need)) != NULL) { + if(H5Aread(attr, p_type, buf) >= 0) { + ctx.need_prefix = TRUE; + ctx.indent_level = 2; + ctx.cur_column = (size_t)curr_pos; + h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf); + } - /* Reclaim any VL memory, if necessary */ - if (vl_data) - H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); + /* Reclaim any VL memory, if necessary */ + if (vl_data) + H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); - HDfree(buf); + HDfree(buf); + } H5Tclose(p_type); } /* end if */ } @@ -1875,7 +1874,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDassert(0); + h5tools_str_append(&buffer, "layout information not available"); break; } /* Print total raw storage size */ diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 4860d9e..76ca117 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -262,7 +262,6 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, /* Check if this type is the one requested */ if (oinfo.addr == dt->addr_in) { - HDassert(!dt_ret); dt_ret = dt; } /* end if */ } /* end if */ diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 946f5ad..501f084 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -782,7 +782,6 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, switch (travt->objs[i].type) { case H5TRAV_TYPE_UNKNOWN: - HDassert(0); break; /*------------------------------------------------------------------------- @@ -1486,7 +1485,6 @@ static int copy_user_block(const char *infile, const char *outfile, hsize_t size int infid = -1, outfid = -1; /* File descriptors */ /* User block must be any power of 2 equal to 512 or greater (512, 1024, 2048, etc.) */ - HDassert(size > 0); /* Open files */ if ((infid = HDopen(infile, O_RDONLY)) < 0) diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index 804727b..c48158c 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -32,37 +32,32 @@ * *------------------------------------------------------------------------- */ -static int -aux_find_obj(const char* name, /* object name from traverse list */ - pack_opt_t *options, /* repack options */ - pack_info_t *obj /*OUT*/) /* info about object to filter */ +static int aux_find_obj(const char* name, /* object name from traverse list */ + pack_opt_t *options, /* repack options */ + pack_info_t *obj /*OUT*/) /* info about object to filter */ { - char *pdest; - int result; - unsigned int i; - - for ( i=0; iop_tbl->nelems; i++) - { - if (HDstrcmp(options->op_tbl->objs[i].path,name)==0) - { - *obj = options->op_tbl->objs[i]; - return (int)i; - } - - pdest = HDstrstr(name,options->op_tbl->objs[i].path); - result = (int)(pdest - name); - - /* found at position 1, meaning without '/' */ - if( pdest != NULL && result==1 ) - { - *obj = options->op_tbl->objs[i]; - return (int)i; - } - }/*i*/ - - return -1; -} + char *pdest; + int result; + unsigned int i; + + for (i = 0; i < options->op_tbl->nelems; i++) { + if (HDstrcmp(options->op_tbl->objs[i].path,name) == 0) { + *obj = options->op_tbl->objs[i]; + return (int) i; + } + pdest = HDstrstr(name, options->op_tbl->objs[i].path); + result = (int) (pdest - name); + + /* found at position 1, meaning without '/' */ + if (pdest != NULL && result == 1) { + *obj = options->op_tbl->objs[i]; + return (int) i; + } + }/*i*/ + + return -1; +} /*------------------------------------------------------------------------- * Function: aux_assign_obj @@ -74,35 +69,31 @@ aux_find_obj(const char* name, /* object name from traverse list */ * *------------------------------------------------------------------------- */ -static int -aux_assign_obj(const char* name, /* object name from traverse list */ - pack_opt_t *options, /* repack options */ - pack_info_t *obj /*OUT*/) /* info about object to filter */ +static int aux_assign_obj(const char* name, /* object name from traverse list */ + pack_opt_t *options, /* repack options */ + pack_info_t *obj /*OUT*/) /* info about object to filter */ { - int idx, i; + int idx, i; pack_info_t tmp; init_packobject(&tmp); - idx = aux_find_obj(name,options,&tmp); + idx = aux_find_obj(name, options, &tmp); /* name was on input */ - if (idx>=0) - { - + if (idx >= 0) { /* applying to all objects */ - if (options->all_layout) - { + if (options->all_layout) { /* assign the global layout info to the OBJ info */ - tmp.layout=options->layout_g; - switch (options->layout_g) - { + tmp.layout = options->layout_g; + switch (options->layout_g) { case H5D_CHUNKED: - tmp.chunk.rank=options->chunk_g.rank; - for ( i=0; ichunk_g.chunk_lengths[i]; + tmp.chunk.rank = options->chunk_g.rank; + for (i = 0; i < tmp.chunk.rank; i++) + tmp.chunk.chunk_lengths[i] = + options->chunk_g.chunk_lengths[i]; break; case H5D_LAYOUT_ERROR: case H5D_COMPACT: @@ -114,15 +105,14 @@ aux_assign_obj(const char* name, /* object name from traverse list */ break; }/*switch*/ } - else - { + else { tmp.layout = options->op_tbl->objs[idx].layout; - switch (tmp.layout) - { + switch (tmp.layout) { case H5D_CHUNKED: tmp.chunk.rank = options->op_tbl->objs[idx].chunk.rank; - for ( i=0; iop_tbl->objs[idx].chunk.chunk_lengths[i]; + for (i = 0; i < tmp.chunk.rank; i++) + tmp.chunk.chunk_lengths[i] = + options->op_tbl->objs[idx].chunk.chunk_lengths[i]; break; case H5D_LAYOUT_ERROR: case H5D_COMPACT: @@ -137,49 +127,37 @@ aux_assign_obj(const char* name, /* object name from traverse list */ } /* applying to all objects */ - if (options->all_filter) - { + if (options->all_filter) { /* assign the global filter */ - tmp.nfilters=1; - tmp.filter[0]=options->filter_g[0]; + tmp.nfilters = 1; + tmp.filter[0] = options->filter_g[0]; } /* if all */ - else - { - tmp.nfilters=options->op_tbl->objs[idx].nfilters; - for ( i=0; iop_tbl->objs[idx].nfilters; + for (i = 0; i < tmp.nfilters; i++) { tmp.filter[i] = options->op_tbl->objs[idx].filter[i]; } } - - } /* if idx */ - - /* no input name */ - - else - { - - if (options->all_filter) - { + else { + if (options->all_filter) { int k; /* assign the global filters */ - tmp.nfilters=options->n_filter_g; - for ( k = 0; k < options->n_filter_g; k++) - tmp.filter[k]=options->filter_g[k]; + tmp.nfilters = options->n_filter_g; + for (k = 0; k < options->n_filter_g; k++) + tmp.filter[k] = options->filter_g[k]; } - if (options->all_layout) - { + if (options->all_layout) { /* assign the global layout info to the OBJ info */ - tmp.layout=options->layout_g; - switch (options->layout_g) - { + tmp.layout = options->layout_g; + switch (options->layout_g) { case H5D_CHUNKED: - tmp.chunk.rank=options->chunk_g.rank; - for ( i=0; ichunk_g.chunk_lengths[i]; + tmp.chunk.rank = options->chunk_g.rank; + for (i = 0; i < tmp.chunk.rank; i++) + tmp.chunk.chunk_lengths[i] = + options->chunk_g.chunk_lengths[i]; break; case H5D_LAYOUT_ERROR: case H5D_COMPACT: @@ -195,10 +173,8 @@ aux_assign_obj(const char* name, /* object name from traverse list */ *obj = tmp; return 1; - } - /*------------------------------------------------------------------------- * Function: apply_filters * @@ -215,74 +191,69 @@ aux_assign_obj(const char* name, /* object name from traverse list */ *------------------------------------------------------------------------- */ -int apply_filters(const char* name, /* object name from traverse list */ - int rank, /* rank of dataset */ - hsize_t *dims, /* dimensions of dataset */ - size_t msize, /* size of type */ - hid_t dcpl_id, /* dataset creation property list */ - pack_opt_t *options, /* repack options */ - int *has_filter) /* (OUT) object NAME has a filter */ - - +int apply_filters(const char* name, /* object name from traverse list */ + int rank, /* rank of dataset */ + hsize_t *dims, /* dimensions of dataset */ + size_t msize, /* size of type */ + hid_t dcpl_id, /* dataset creation property list */ + pack_opt_t *options, /* repack options */ + int *has_filter) /* (OUT) object NAME has a filter */ { - int nfilters; /* number of filters in DCPL */ - hsize_t chsize[64]; /* chunk size in elements */ + int nfilters; /* number of filters in DCPL */ + hsize_t chsize[64]; /* chunk size in elements */ H5D_layout_t layout; - int i; - pack_info_t obj; + int i; + pack_info_t obj; *has_filter = 0; - if (rank==0) /* scalar dataset, do not apply */ + if (rank == 0) /* scalar dataset, do not apply */ return 0; - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * initialize the assigment object *------------------------------------------------------------------------- */ init_packobject(&obj); - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * find options *------------------------------------------------------------------------- */ - if (aux_assign_obj(name,options,&obj)==0) + if (aux_assign_obj(name, options, &obj) == 0) return 0; /* get information about input filters */ - if ((nfilters = H5Pget_nfilters(dcpl_id))<0) + if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) return -1; - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * check if we have filters in the pipeline * we want to replace them with the input filters * only remove if we are inserting new ones *------------------------------------------------------------------------- */ - if (nfilters && obj.nfilters ) - { + if (nfilters && obj.nfilters) { *has_filter = 1; - if (H5Premove_filter(dcpl_id,H5Z_FILTER_ALL)<0) + if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0) return -1; } - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * check if there is an existent chunk * read it only if there is not a requested layout *------------------------------------------------------------------------- */ - if (obj.layout == -1 ) - { - if ((layout = H5Pget_layout(dcpl_id))<0) + if (obj.layout == -1) { + if ((layout = H5Pget_layout(dcpl_id)) < 0) return -1; - if (layout == H5D_CHUNKED) - { - if ((rank = H5Pget_chunk(dcpl_id,NELMTS(chsize),chsize/*out*/))<0) + if (layout == H5D_CHUNKED) { + if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0) return -1; obj.layout = H5D_CHUNKED; obj.chunk.rank = rank; - for ( i = 0; i < rank; i++) + for (i = 0; i < rank; i++) obj.chunk.chunk_lengths[i] = chsize[i]; } } @@ -300,19 +271,15 @@ int apply_filters(const char* name, /* object name from traverse list */ *------------------------------------------------------------------------- */ - if (obj.nfilters) - { - - /*------------------------------------------------------------------------- - * filters require CHUNK layout; if we do not have one define a default - *------------------------------------------------------------------------- - */ - if (obj.layout==-1) - { - + if (obj.nfilters) { + /*------------------------------------------------------------------------- + * filters require CHUNK layout; if we do not have one define a default + *------------------------------------------------------------------------- + */ + if (obj.layout == -1) { /* stripmine info */ hsize_t sm_size[H5S_MAX_RANK]; /*stripmine size */ - hsize_t sm_nbytes; /*bytes per stripmine */ + hsize_t sm_nbytes; /*bytes per stripmine */ obj.chunk.rank = rank; @@ -321,138 +288,129 @@ int apply_filters(const char* name, /* object name from traverse list */ * a hyperslab whose size is manageable. */ - - sm_nbytes = msize; - for ( i = rank; i > 0; --i) - { + for (i = rank; i > 0; --i) { hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; - if ( size == 0) /* datum size > H5TOOLS_BUFSIZE */ + if (size == 0) /* datum size > H5TOOLS_BUFSIZE */ size = 1; sm_size[i - 1] = MIN(dims[i - 1], size); sm_nbytes *= sm_size[i - 1]; HDassert(sm_nbytes > 0); - } - for ( i = 0; i < rank; i++) - { + for (i = 0; i < rank; i++) { obj.chunk.chunk_lengths[i] = sm_size[i]; } - } - for ( i=0; i=0) - { + if (obj.layout >= 0) { /* a layout was defined */ - if (H5Pset_layout(dcpl_id, obj.layout)<0) + if (H5Pset_layout(dcpl_id, obj.layout) < 0) return -1; - if (H5D_CHUNKED == obj.layout) - { - if(H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths)<0) + if (H5D_CHUNKED == obj.layout) { + if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) return -1; } - else if (H5D_COMPACT == obj.layout) - { - if (H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY)<0) + else if (H5D_COMPACT == obj.layout) { + if (H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY) < 0) return -1; } /* remove filters for the H5D_CONTIGUOUS case */ - else if (H5D_CONTIGUOUS == obj.layout) - { - if (H5Premove_filter(dcpl_id,H5Z_FILTER_ALL)<0) + else if (H5D_CONTIGUOUS == obj.layout) { + if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0) return -1; } } - return 0; + return 0; } diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index 408142c..36038b5 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -189,8 +189,7 @@ int do_copy_refobjs(hid_t fidin, /* create the reference, -1 parameter for objects */ if(H5Rcreate(&refbuf[u], fidout, refname, H5R_OBJECT, (hid_t)-1) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed"); - if(options->verbose) - { + if(options->verbose) { printf(FORMAT_OBJ,"dset",travt->objs[i].name ); printf("object <%s> object reference created to <%s>\n", travt->objs[i].name, @@ -278,8 +277,7 @@ int do_copy_refobjs(hid_t fidin, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed"); if(H5Sclose(region_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); - if(options->verbose) - { + if(options->verbose) { printf(FORMAT_OBJ,"dset",travt->objs[i].name ); printf("object <%s> region reference created to <%s>\n", travt->objs[i].name, @@ -320,8 +318,6 @@ int do_copy_refobjs(hid_t fidin, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); } /* end else */ - HDassert(dset_out != FAIL); - /*------------------------------------------------------------------------- * copy referenced objects in attributes *------------------------------------------------------------------------- -- cgit v0.12 From 1ef8577a4aaaa4120a819ff36747fdca99abdc26 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 23 Aug 2017 16:23:09 -0500 Subject: Modifications based on comments from pull request review (1) Remove unnecessary asserts (2) Add code to insert bad offset values to the test file in gen_bad_offset.c --- src/H5Glink.c | 21 ++++++++++++++------- src/H5Gnode.c | 43 ++++++++----------------------------------- src/H5Gstab.c | 6 ++---- src/H5Oefl.c | 3 ++- test/bad_offset.h5 | Bin 3312 -> 3312 bytes test/gen_bad_offset.c | 41 ++++++++++++++++++++++++++++++++++++++--- test/tmisc.c | 2 +- 7 files changed, 65 insertions(+), 51 deletions(-) diff --git a/src/H5Glink.c b/src/H5Glink.c index 77b69cb..e199f89 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -224,6 +224,7 @@ herr_t H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, const H5G_entry_t *ent, const char *name) { + hbool_t dup_soft = FALSE; /* xstrdup the symbolic link name or not */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -238,19 +239,21 @@ H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, lnk->cset = H5F_DEFAULT_CSET; lnk->corder = 0; lnk->corder_valid = FALSE; /* Creation order not valid for this link */ - lnk->name = H5MM_xstrdup(name); - HDassert(lnk->name); + if((lnk->name = H5MM_xstrdup(name)) == NULL) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to duplicate link name") /* Object is a symbolic or hard link */ if(ent->type == H5G_CACHED_SLINK) { const char *s; /* Pointer to link value */ if((s = (const char *)H5HL_offset_into(heap, ent->cache.slink.lval_offset)) == NULL) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link name") - HDassert(s); + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get symbolic link name") /* Copy the link value */ - lnk->u.soft.name = H5MM_xstrdup(s); + if((lnk->u.soft.name = H5MM_xstrdup(s)) == NULL) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to duplicate symbolic link name") + + dup_soft = TRUE; /* Set link type */ lnk->type = H5L_TYPE_SOFT; @@ -264,8 +267,12 @@ H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, } /* end else */ done: - if(ret_value < 0 && lnk->name) - H5MM_xfree(lnk->name); + if(ret_value < 0) { + if(lnk->name) + H5MM_xfree(lnk->name); + if(ent->type == H5G_CACHED_SLINK && dup_soft) + H5MM_xfree(lnk->u.soft.name); + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5G__ent_to_link() */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 4ddcf53..76e2c4b 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -35,7 +35,7 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functionsi */ +#include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ @@ -396,7 +396,6 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; const char *s1, *s2; - const char *base; /* Base of heap */ int ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -406,10 +405,6 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) HDassert(lt_key); HDassert(rt_key); - /* Get base address of heap */ - base = (const char *)H5HL_offset_into(udata->heap, (size_t)0); - HDassert(base); - /* Get pointers to string names */ if((s1 = (const char *)H5HL_offset_into(udata->heap, lt_key->offset)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get key name") @@ -458,7 +453,6 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; const char *s; - const char *base; /* Base of heap */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -468,10 +462,6 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) HDassert(lt_key); HDassert(rt_key); - /* Get base address of heap */ - base = (const char *)H5HL_offset_into(udata->heap, (size_t)0); - HDassert(base); - /* left side */ if((s = (const char *)H5HL_offset_into(udata->heap, lt_key->offset)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get key name") @@ -525,7 +515,6 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED unsigned lt = 0, idx = 0, rt; int cmp = 1; const char *s; - const char *base; /* Base of heap */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -543,10 +532,6 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table node") - /* Get base address of heap */ - base = (const char *)H5HL_offset_into(udata->common.heap, (size_t)0); - HDassert(base); - /* * Binary search. */ @@ -624,7 +609,6 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5G_node_t *sn = NULL, *snrt = NULL; unsigned sn_flags = H5AC__NO_FLAGS_SET, snrt_flags = H5AC__NO_FLAGS_SET; const char *s; - const char *base; /* Base of heap */ unsigned lt = 0, rt; /* Binary search cntrs */ int cmp = 1, idx = -1; H5G_node_t *insert_into = NULL; /*node that gets new entry*/ @@ -649,10 +633,6 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") - /* Get base address of heap */ - base = (const char *)H5HL_offset_into(udata->common.heap, (size_t)0); - HDassert(base); - /* * Where does the new symbol get inserted? We use a binary search. */ @@ -815,10 +795,6 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, if(udata->common.name != NULL) { H5O_link_t lnk; /* Constructed link for replacement */ size_t link_name_len; /* Length of string in local heap */ - const char *base; /* Base of heap */ - - /* Get base address of heap */ - base = (const char *)H5HL_offset_into(udata->common.heap, (size_t)0); /* Find the name with a binary search */ rt = sn->nsyms; @@ -1019,7 +995,6 @@ H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, h /* Get the pointer to the name of the link in the heap */ if((name = (const char *)H5HL_offset_into(udata->heap, ents[u].name_off)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get symbol table node name") - HDassert(name); /* Convert the entry to a link */ if(H5G__ent_to_link(&lnk, udata->heap, &ents[u], name) < 0) @@ -1362,7 +1337,6 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd /* Determine name of source object */ if((name = (const char *)H5HL_offset_into(heap, src_ent->name_off)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get source object name") - HDassert(name); /* Set copied metadata tag */ H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, H5_ITER_ERROR); @@ -1447,7 +1421,6 @@ H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_ke /* Get pointer to link's name in the heap */ if((name = (const char *)H5HL_offset_into(udata->heap, sn->entry[u].name_off)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get symbol table link name") - HDassert(name); /* Determine the link to operate on in the table */ linkno = udata->ltable->nlinks++; @@ -1549,29 +1522,29 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to debug B-tree node"); } /* end if */ else { - fprintf(stream, "%*sSymbol Table Node...\n", indent, ""); - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, + HDfprintf(stream, "%*sSymbol Table Node...\n", indent, ""); + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Dirty:", sn->cache_info.is_dirty ? "Yes" : "No"); - fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of Node (in bytes):", (unsigned)sn->node_size); - fprintf(stream, "%*s%-*s %u of %u\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %u of %u\n", indent, "", fwidth, "Number of Symbols:", sn->nsyms, (unsigned)(2 * H5F_SYM_LEAF_K(f))); indent += 3; fwidth = MAX(0, fwidth - 3); for(u = 0; u < sn->nsyms; u++) { - fprintf(stream, "%*sSymbol %u:\n", indent - 3, "", u); + HDfprintf(stream, "%*sSymbol %u:\n", indent - 3, "", u); if(heap) { const char *s = (const char *)H5HL_offset_into(heap, sn->entry[u].name_off); if(s) - fprintf(stream, "%*s%-*s `%s'\n", indent, "", fwidth, "Name:", s); + HDfprintf(stream, "%*s%-*s `%s'\n", indent, "", fwidth, "Name:", s); } /* end if */ else - fprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Warning: Invalid heap address given, name not displayed!"); + HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Warning: Invalid heap address given, name not displayed!"); H5G__ent_debug(sn->entry + u, stream, indent, fwidth, heap); } /* end for */ diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 7750671..4dc06ca 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -724,9 +724,8 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) if((name = (const char *)H5HL_offset_into(udata->heap, name_off)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table link name") - HDassert(name); - udata->name = H5MM_strdup(name); - HDassert(udata->name); + if((udata->name = H5MM_strdup(name)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to duplicate symbol table link name") done: FUNC_LEAVE_NOAPI(ret_value) @@ -948,7 +947,6 @@ H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) /* Get a pointer to the link name */ if((name = (const char *)H5HL_offset_into(udata->heap, ent->name_off)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table link name") - HDassert(name); /* Convert the entry to a link */ if(H5G__ent_to_link(udata->lnk, udata->heap, ent, name) < 0) diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 2273289..7d78caf 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -151,7 +151,8 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, if((s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "unable to get external file name") - HDassert(s && *s); + if(*s == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "invalid external file name") mesg->slot[u].name = H5MM_xstrdup (s); HDassert(mesg->slot[u].name); diff --git a/test/bad_offset.h5 b/test/bad_offset.h5 index 6500ffe..231dca2 100644 Binary files a/test/bad_offset.h5 and b/test/bad_offset.h5 differ diff --git a/test/gen_bad_offset.c b/test/gen_bad_offset.c index 2be4af1..82e94cd 100644 --- a/test/gen_bad_offset.c +++ b/test/gen_bad_offset.c @@ -27,9 +27,9 @@ /*------------------------------------------------------------------------- * Function: main - * Generate an HDF5 file with groups, datasets and symbolic links. * - * After this file is generated, write bad offset values to + * Generate an HDF5 file with groups, datasets and symbolic links. + * After the file is generated, write bad offset values to * the heap at 3 locations in the file: * (A) Open the file: * fd = HDopen(TESTFILE, O_RDWR, 0663); @@ -40,7 +40,7 @@ * "/dsetA": replace name offset into private heap "72" by bad offset * (3) HDlseek(fd, (HDoff_t)1616, SEEK_SET); * /soft_one: replace link value offset in the scratch pad "32" by bad offset - * (C) Write the bad offset value to the file: + * (C) Write the bad offset value to the file for (1), (2) and (3): * write(fd, &val, sizeof(val)); * * Note: if the groups/datasets/symbolic links are changed in the file, @@ -55,6 +55,8 @@ main(void) { hid_t fid = -1, gid1 = -1, gid2 = -1; /* File and group IDs */ hid_t did = -1, sid = -1; /* Dataset and dataspace IDs */ + int fd = -1; /* File descriptor */ + int64_t val = 999; /* Bad offset value */ /* Create the test file */ if((fid = H5Fcreate(TESTFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -96,6 +98,39 @@ main(void) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR + /* + * Write bad offset values at 3 locations in the file + */ + + /* Open the file */ + if((fd = HDopen(TESTFILE, O_RDWR, 0663)) < 0) + FAIL_STACK_ERROR + + /* Position the file for /group1/group2: replace heap offset "8" by bad offset */ + if(HDlseek(fd, (HDoff_t)880, SEEK_SET) < 0) + FAIL_STACK_ERROR + /* Write the bad offset value to the file */ + if(HDwrite(fd, &val, sizeof(val)) < 0) + FAIL_STACK_ERROR + + /* Position the file for /dsetA: replace name offset into private heap "72" by bad offset */ + if(HDlseek(fd, (HDoff_t)1512, SEEK_SET) < 0) + FAIL_STACK_ERROR + /* Write the bad offset value to the file */ + if(HDwrite(fd, &val, sizeof(val)) < 0) + FAIL_STACK_ERROR + + /* Position the file for /soft_one: replace link value offset in the scratch pad "32" by bad offset */ + if(HDlseek(fd, (HDoff_t)1616, SEEK_SET) < 0) + FAIL_STACK_ERROR + /* Write the bad offset value to the file */ + if(HDwrite(fd, &val, sizeof(val)) < 0) + FAIL_STACK_ERROR + + /* Close the file */ + if(HDclose(fd) < 0) + FAIL_STACK_ERROR + return EXIT_SUCCESS; error: diff --git a/test/tmisc.c b/test/tmisc.c index 242e55a..102325a 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -5574,7 +5574,7 @@ test_misc(void) test_misc30(); /* Exercise local heap loading bug where free lists were getting dropped */ test_misc31(); /* Test Reentering library through deprecated routines after H5close() */ test_misc32(); /* Test filter memory allocation functions */ - test_misc33(); /* ??? */ + test_misc33(); /* Test to verify that H5HL_offset_into() returns error if offset exceeds heap block */ } /* test_misc() */ -- cgit v0.12 From 38b4e97692e34040c9731b6c9b9f9cab49fde7ef Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Thu, 24 Aug 2017 11:42:35 -0500 Subject: Fix for daily test failure Fix for the compilation error from the PGI compiler. --- src/H5Oefl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 7d78caf..49c442f 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -151,7 +151,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, if((s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "unable to get external file name") - if(*s == NULL) + if(*s == (char)NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "invalid external file name") mesg->slot[u].name = H5MM_xstrdup (s); HDassert(mesg->slot[u].name); -- cgit v0.12 From 0e44181bbb9797bdf4c7b2c192a457639a4e5ea1 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 24 Aug 2017 13:46:39 -0500 Subject: Miscellaneous improvements Description: Moved H5Location::getNumObjs to Group::getNumObjs (i.e., H5Gget_info) Switched reinterpret_cast to static_cast in H5Object::iterateAttrs Miscellaneous cleanup Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) --- c++/src/H5CommonFG.cpp | 5 +-- c++/src/H5File.h | 4 +-- c++/src/H5Group.cpp | 93 +++++++++++++++++++++++++++++--------------------- c++/src/H5Group.h | 3 ++ c++/src/H5Location.cpp | 17 --------- c++/src/H5Location.h | 3 -- c++/src/H5Object.cpp | 15 ++++---- 7 files changed, 71 insertions(+), 69 deletions(-) diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index c9c203a..af5ba0e 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -13,8 +13,8 @@ #include -#include "H5Include.h" #include "H5private.h" // for HDstrcpy +#include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" #include "H5DataSpace.h" @@ -64,7 +64,8 @@ DataType CommonFG::openDataType(const char* name) const throwException("openDataType", "H5Topen2 failed"); // No failure, create and return the DataType object - DataType data_type(type_id); + DataType data_type; + f_DataType_setId(&data_type, type_id); return(data_type); } diff --git a/c++/src/H5File.h b/c++/src/H5File.h index b428a40..0f921ae 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -21,7 +21,7 @@ namespace H5 { \brief Class H5File represents an HDF5 file and inherits from class Group as file is a root group. - Inheritance: Group -> H5Object -> H5Location -> IdComponent + Inheritance: Group -> CommonFG/H5Object -> H5Location -> IdComponent */ class H5_DLLCPP H5File : public Group { public: @@ -92,7 +92,7 @@ class H5_DLLCPP H5File : public Group { // Throw file exception. virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const; - // for CommonFG to get the file id. + // For CommonFG to get the file id. virtual hid_t getLocId() const; // Default constructor diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 994d9ff..c0e0dd1 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -62,44 +62,6 @@ Group::Group(const Group& original) : H5Object(), CommonFG(), id(original.id) } //-------------------------------------------------------------------------- -// Function: Group::getObjId -///\brief Opens an object via object header. -///\param obj_name - IN: Path to the object -///\param plist - IN: Access property list for the link pointing to -/// the object -///\exception H5::FileIException or H5::GroupIException -///\par Description -/// This function opens an object in a group or file, using -/// H5Oopen. Thus, an object can be opened without knowing -/// the object's type. -// Programmer Binh-Minh Ribler - March, 2017 -//-------------------------------------------------------------------------- -hid_t Group::getObjId(const char* obj_name, const PropList& plist) const -{ - hid_t ret_value = H5Oopen(getId(), obj_name, plist.getId()); - if (ret_value < 0) - { - throwException("Group::getObjId", "H5Oopen failed"); - } - return(ret_value); -} - -//-------------------------------------------------------------------------- -// Function: Group::getObjId -///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c H5std_string for the object's name. -///\param obj_name - IN: Path to the object -///\param plist - IN: Access property list for the link pointing to -/// the object -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - March, 2017 -//-------------------------------------------------------------------------- -hid_t Group::getObjId(const H5std_string& obj_name, const PropList& plist) const -{ - return(getObjId(obj_name.c_str(), plist)); -} - -//-------------------------------------------------------------------------- // Function: Group::closeObjId ///\brief Closes an object, which was opened with Group::getObjId ///\exception H5::FileIException or H5::GroupIException @@ -181,6 +143,61 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const */ //-------------------------------------------------------------------------- +// Function: Group::getNumObjs +///\brief Returns the number of objects in this group. +///\return Number of objects +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - January, 2003 +//-------------------------------------------------------------------------- +hsize_t Group::getNumObjs() const +{ + H5G_info_t ginfo; // Group information + + herr_t ret_value = H5Gget_info(getId(), &ginfo); + if(ret_value < 0) + throwException("getNumObjs", "H5Gget_info failed"); + return (ginfo.nlinks); +} + +//-------------------------------------------------------------------------- +// Function: Group::getObjId +///\brief Opens an object via object header. +///\param obj_name - IN: Path to the object +///\param plist - IN: Access property list for the link pointing to +/// the object +///\exception H5::FileIException or H5::GroupIException +///\par Description +/// This function opens an object in a group or file, using +/// H5Oopen. Thus, an object can be opened without knowing +/// the object's type. +// Programmer Binh-Minh Ribler - March, 2017 +//-------------------------------------------------------------------------- +hid_t Group::getObjId(const char* obj_name, const PropList& plist) const +{ + hid_t ret_value = H5Oopen(getId(), obj_name, plist.getId()); + if (ret_value < 0) + { + throwException("Group::getObjId", "H5Oopen failed"); + } + return(ret_value); +} + +//-------------------------------------------------------------------------- +// Function: Group::getObjId +///\brief This is an overloaded member function, provided for convenience. +/// It takes a reference to a \c H5std_string for the object's name. +///\param obj_name - IN: Path to the object +///\param plist - IN: Access property list for the link pointing to +/// the object +///\exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - March, 2017 +//-------------------------------------------------------------------------- +hid_t Group::getObjId(const H5std_string& obj_name, const PropList& plist) const +{ + return(getObjId(obj_name.c_str(), plist)); +} + +//-------------------------------------------------------------------------- // Function: Group::getId ///\brief Get the id of this group ///\return Group identifier diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index a7e1f7c..e5fa174 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -53,6 +53,9 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { // Removed in 1.10.1, because H5Location is baseclass // Group(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + // Returns the number of objects in this group. + hsize_t getNumObjs() const; + // Opens an object within a group or a file, i.e., root group. hid_t getObjId(const char* name, const PropList& plist = PropList::DEFAULT) const; hid_t getObjId(const H5std_string& name, const PropList& plist = PropList::DEFAULT) const; diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index e820b0d..a81e300 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -1282,23 +1282,6 @@ int H5Location::iterateElems(const H5std_string& name, int *idx, H5G_iterate_t o #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- -// Function: H5Location::getNumObjs -///\brief Returns the number of objects in this group. -///\return Number of objects -///\exception H5::FileIException or H5::GroupIException -// Programmer Binh-Minh Ribler - January, 2003 -//-------------------------------------------------------------------------- -hsize_t H5Location::getNumObjs() const -{ - H5G_info_t ginfo; // Group information - - herr_t ret_value = H5Gget_info(getId(), &ginfo); - if(ret_value < 0) - throwException("getNumObjs", "H5Gget_info failed"); - return (ginfo.nlinks); -} - -//-------------------------------------------------------------------------- // Function: H5Location::getObjnameByIdx ///\brief Returns the name of an object in this group, given the /// object's index. diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index a57d3ed..41f7ca0 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -113,9 +113,6 @@ class H5_DLLCPP H5Location : public IdComponent { H5std_string getLinkval(const char* link_name, size_t size=0) const; H5std_string getLinkval(const H5std_string& link_name, size_t size=0) const; - // Returns the number of objects in this group. - hsize_t getNumObjs() const; - // Retrieves the name of an object in this group, given the // object's index. H5std_string getObjnameByIdx(hsize_t idx) const; diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 865d04f..81e61e8 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -44,10 +44,10 @@ namespace H5 { extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name, const H5A_info_t *ainfo, void *op_data) { - H5std_string s_attr_name = H5std_string(attr_name); - UserData4Aiterate* myData = reinterpret_cast (op_data); - myData->op(*myData->location, s_attr_name, myData->opData); - return 0; + H5std_string s_attr_name = H5std_string(attr_name); + UserData4Aiterate* myData = reinterpret_cast (op_data); + myData->op(*myData->location, s_attr_name, myData->opData); + return 0; } //-------------------------------------------------------------------------- @@ -81,6 +81,7 @@ H5Object::H5Object() : H5Location() {} // This constructor is no longer appropriate because the data member "id" had // been moved to the sub-classes. It is removed from 1.8.15 because it is // a noop and it can be generated by the compiler if needed. +// Removed in 1.10.1 - Aug 2016 //-------------------------------------------------------------------------- // H5Object::H5Object(const H5Object& original) : H5Location() {} @@ -148,7 +149,7 @@ Attribute H5Object::createAttribute(const char* name, const DataType& data_type, //-------------------------------------------------------------------------- Attribute H5Object::createAttribute(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist) const { - return(createAttribute( name.c_str(), data_type, data_space, create_plist)); + return(createAttribute(name.c_str(), data_type, data_space, create_plist)); } //-------------------------------------------------------------------------- @@ -183,7 +184,7 @@ Attribute H5Object::openAttribute(const char* name) const //-------------------------------------------------------------------------- Attribute H5Object::openAttribute(const H5std_string& name) const { - return(openAttribute( name.c_str())); + return(openAttribute(name.c_str())); } //-------------------------------------------------------------------------- @@ -239,7 +240,7 @@ int H5Object::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_dat // call the C library routine H5Aiterate2 to iterate the attributes hsize_t idx = _idx ? static_cast(*_idx) : 0; int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, - userAttrOpWrpr, reinterpret_cast(userData)); + userAttrOpWrpr, static_cast(userData)); // release memory delete userData; -- cgit v0.12 From 883a235d5ca81770228c5cb5f9d162afda0b411f Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 25 Aug 2017 12:07:04 -0500 Subject: Miscellaneous improvements (cont.) Description: Put back H5Location::getNumObjs and marked as deprecated in favor of Group::getNumObjs. Platforms tested: Linux/32 2.6 (jam) Darwin (osx1010test) --- c++/src/H5Location.cpp | 17 +++++++++++++++++ c++/src/H5Location.h | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index a81e300..9f2d7d5 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -1282,6 +1282,23 @@ int H5Location::iterateElems(const H5std_string& name, int *idx, H5G_iterate_t o #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- +// Function: H5Location::getNumObjs +///\brief Deprecated - moved to H5::Group in 1.10.2. +///\return Deprecated +///\exception Deprecated +// Programmer Binh-Minh Ribler - January, 2003 +//-------------------------------------------------------------------------- +hsize_t H5Location::getNumObjs() const +{ + H5G_info_t ginfo; // Group information + + herr_t ret_value = H5Gget_info(getId(), &ginfo); + if(ret_value < 0) + throwException("getNumObjs", "H5Gget_info failed"); + return (ginfo.nlinks); +} + +//-------------------------------------------------------------------------- // Function: H5Location::getObjnameByIdx ///\brief Returns the name of an object in this group, given the /// object's index. diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 41f7ca0..3dfa5d5 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -113,6 +113,10 @@ class H5_DLLCPP H5Location : public IdComponent { H5std_string getLinkval(const char* link_name, size_t size=0) const; H5std_string getLinkval(const H5std_string& link_name, size_t size=0) const; + // Returns the number of objects in this group. + // Deprecated - moved to H5::Group in 1.10.2. + hsize_t getNumObjs() const; + // Retrieves the name of an object in this group, given the // object's index. H5std_string getObjnameByIdx(hsize_t idx) const; -- cgit v0.12 From 7f8a8a68780b8f1e67d20021c27849018b60286d Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Mon, 28 Aug 2017 15:12:58 -0500 Subject: Partial update for scaling parallel filters tests --- testpar/t_filters_parallel.c | 667 ++++++++++++++++++++++++------------------- testpar/t_filters_parallel.h | 137 ++++----- 2 files changed, 438 insertions(+), 366 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 186c7c4..1641a44 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -114,12 +114,12 @@ test_one_chunk_filtered_dataset(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = ONE_CHUNK_FILTERED_DATASET_NROWS; - dataset_dims[1] = ONE_CHUNK_FILTERED_DATASET_NCOLS; - chunk_dims[0] = ONE_CHUNK_FILTERED_DATASET_CH_NROWS; - chunk_dims[1] = ONE_CHUNK_FILTERED_DATASET_CH_NCOLS; - sel_dims[0] = ONE_CHUNK_FILTERED_DATASET_NROWS / NUM_MPI_RANKS; - sel_dims[1] = ONE_CHUNK_FILTERED_DATASET_NCOLS; + dataset_dims[0] = (hsize_t) ONE_CHUNK_FILTERED_DATASET_NROWS; + dataset_dims[1] = (hsize_t) ONE_CHUNK_FILTERED_DATASET_NCOLS; + chunk_dims[0] = (hsize_t) ONE_CHUNK_FILTERED_DATASET_CH_NROWS; + chunk_dims[1] = (hsize_t) ONE_CHUNK_FILTERED_DATASET_CH_NCOLS; + sel_dims[0] = (hsize_t) ONE_CHUNK_FILTERED_DATASET_NROWS / (hsize_t) mpi_size; + sel_dims[1] = (hsize_t) ONE_CHUNK_FILTERED_DATASET_NCOLS; filespace = H5Screate_simple(ONE_CHUNK_FILTERED_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -148,8 +148,8 @@ test_one_chunk_filtered_dataset(void) */ count[0] = 1; count[1] = 1; - stride[0] = ONE_CHUNK_FILTERED_DATASET_CH_NROWS; - stride[1] = ONE_CHUNK_FILTERED_DATASET_CH_NCOLS; + stride[0] = (hsize_t) ONE_CHUNK_FILTERED_DATASET_CH_NROWS; + stride[1] = (hsize_t) ONE_CHUNK_FILTERED_DATASET_CH_NCOLS; block[0] = sel_dims[0]; block[1] = sel_dims[1]; offset[0] = ((hsize_t) mpi_rank * sel_dims[0]); @@ -167,21 +167,21 @@ test_one_chunk_filtered_dataset(void) "Hyperslab selection succeeded"); /* Fill data buffer */ - data_size = ONE_CHUNK_FILTERED_DATASET_CH_NROWS * ONE_CHUNK_FILTERED_DATASET_NCOLS * sizeof(*data); + data_size = (hsize_t) ONE_CHUNK_FILTERED_DATASET_CH_NROWS * (hsize_t) ONE_CHUNK_FILTERED_DATASET_NCOLS * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *) malloc(data_size); - VRFY((NULL != data), "malloc succeeded"); + data = (C_DATATYPE *) calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != correct_buf), "malloc succeeded"); + correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE) GEN_DATA(i); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) - correct_buf[i] = ((C_DATATYPE) i % (ONE_CHUNK_FILTERED_DATASET_CH_NROWS / NUM_MPI_RANKS * ONE_CHUNK_FILTERED_DATASET_CH_NCOLS)) - + ((C_DATATYPE) i / (ONE_CHUNK_FILTERED_DATASET_CH_NROWS / NUM_MPI_RANKS * ONE_CHUNK_FILTERED_DATASET_CH_NCOLS)); + correct_buf[i] = ((C_DATATYPE) i % (ONE_CHUNK_FILTERED_DATASET_CH_NROWS / mpi_size * ONE_CHUNK_FILTERED_DATASET_CH_NCOLS)) + + ((C_DATATYPE) i / (ONE_CHUNK_FILTERED_DATASET_CH_NROWS / mpi_size * ONE_CHUNK_FILTERED_DATASET_CH_NCOLS)); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -196,8 +196,8 @@ test_one_chunk_filtered_dataset(void) VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != read_buf), "malloc succeeded"); + read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen(file_id, "/" ONE_CHUNK_FILTERED_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -260,12 +260,12 @@ test_filtered_dataset_no_overlap(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_NROWS; - dataset_dims[1] = UNSHARED_FILTERED_CHUNKS_NCOLS; - chunk_dims[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; - chunk_dims[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; - sel_dims[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; - sel_dims[1] = UNSHARED_FILTERED_CHUNKS_NCOLS; + dataset_dims[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_CH_NROWS; + sel_dims[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_NCOLS; filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -293,12 +293,12 @@ test_filtered_dataset_no_overlap(void) * it to the hyperslab in the file */ count[0] = 1; - count[1] = UNSHARED_FILTERED_CHUNKS_NCOLS / UNSHARED_FILTERED_CHUNKS_CH_NCOLS; - stride[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; - stride[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; - block[0] = UNSHARED_FILTERED_CHUNKS_CH_NROWS; - block[1] = UNSHARED_FILTERED_CHUNKS_CH_NCOLS; - offset[0] = ((hsize_t) mpi_rank * UNSHARED_FILTERED_CHUNKS_CH_NROWS * count[0]); + count[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_NCOLS / (hsize_t) UNSHARED_FILTERED_CHUNKS_CH_NCOLS; + stride[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_CH_NROWS; + stride[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_CH_NCOLS; + block[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_CH_NROWS; + block[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_CH_NCOLS; + offset[0] = ((hsize_t) mpi_rank * (hsize_t) UNSHARED_FILTERED_CHUNKS_CH_NROWS * count[0]); offset[1] = 0; if (VERBOSE_MED) @@ -315,17 +315,18 @@ test_filtered_dataset_no_overlap(void) data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *) malloc(data_size); - VRFY((NULL != data), "malloc succeeded"); + data = (C_DATATYPE *) calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != correct_buf), "malloc succeeded"); + correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE) GEN_DATA(i); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) - correct_buf[i] = (C_DATATYPE) ((i % (NUM_MPI_RANKS * dataset_dims[1])) + (i / (NUM_MPI_RANKS * dataset_dims[1]))); + correct_buf[i] = (C_DATATYPE) ( (i % (dataset_dims[0] / (hsize_t) mpi_size * dataset_dims[1])) + + (i / (dataset_dims[0] / (hsize_t) mpi_size * dataset_dims[1]))); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -340,8 +341,8 @@ test_filtered_dataset_no_overlap(void) VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != read_buf), "malloc succeeded"); + read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen(file_id, "/" UNSHARED_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -405,12 +406,12 @@ test_filtered_dataset_overlap(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = SHARED_FILTERED_CHUNKS_NROWS; - dataset_dims[1] = SHARED_FILTERED_CHUNKS_NCOLS; - chunk_dims[0] = SHARED_FILTERED_CHUNKS_CH_NROWS; - chunk_dims[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; - sel_dims[0] = SHARED_FILTERED_CHUNKS_CH_NROWS; - sel_dims[1] = SHARED_FILTERED_CHUNKS_NCOLS; + dataset_dims[0] = (hsize_t) SHARED_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = (hsize_t) SHARED_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = (hsize_t) SHARED_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = (hsize_t) DIM0_SCALE_FACTOR; + sel_dims[1] = (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS * (hsize_t) DIM1_SCALE_FACTOR; filespace = H5Screate_simple(SHARED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -437,13 +438,13 @@ test_filtered_dataset_overlap(void) /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file */ - count[0] = SHARED_FILTERED_CHUNKS_NROWS / SHARED_FILTERED_CHUNKS_CH_NROWS; - count[1] = SHARED_FILTERED_CHUNKS_NCOLS / SHARED_FILTERED_CHUNKS_CH_NCOLS; - stride[0] = SHARED_FILTERED_CHUNKS_CH_NROWS; - stride[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; - block[0] = 1; - block[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; - offset[0] = (hsize_t) mpi_rank; + count[0] = (hsize_t) SHARED_FILTERED_CHUNKS_NROWS / (hsize_t) SHARED_FILTERED_CHUNKS_CH_NROWS; + count[1] = (hsize_t) SHARED_FILTERED_CHUNKS_NCOLS / (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS; + stride[0] = (hsize_t) SHARED_FILTERED_CHUNKS_CH_NROWS; + stride[1] = (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS; + block[0] = (hsize_t) SHARED_FILTERED_CHUNKS_CH_NROWS / (hsize_t) mpi_size; + block[1] = (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS; + offset[0] = (hsize_t) mpi_rank * block[0]; offset[1] = 0; if (VERBOSE_MED) @@ -460,19 +461,19 @@ test_filtered_dataset_overlap(void) data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *) malloc(data_size); - VRFY((NULL != data), "malloc succeeded"); + data = (C_DATATYPE *) calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != correct_buf), "malloc succeeded"); + correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE) GEN_DATA(i); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) - correct_buf[i] = (C_DATATYPE) ((dataset_dims[1] * (i / (NUM_MPI_RANKS * dataset_dims[1]))) + correct_buf[i] = (C_DATATYPE) ((dataset_dims[1] * (i / ((hsize_t) mpi_size * dataset_dims[1]))) + (i % dataset_dims[1]) - + (((i % (NUM_MPI_RANKS * dataset_dims[1])) / dataset_dims[1]) % dataset_dims[1])); + + (((i % ((hsize_t) mpi_size * dataset_dims[1])) / dataset_dims[1]) % dataset_dims[1])); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -487,8 +488,8 @@ test_filtered_dataset_overlap(void) VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify correct data was written */ - read_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != read_buf), "malloc succeeded"); + read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen(file_id, "/" SHARED_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -535,6 +536,7 @@ test_filtered_dataset_single_no_selection(void) hsize_t block[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t offset[SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; size_t i, data_size, correct_buf_size; + size_t segment_length; hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; @@ -554,12 +556,12 @@ test_filtered_dataset_single_no_selection(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS; - dataset_dims[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS; - chunk_dims[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; - chunk_dims[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; - sel_dims[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; - sel_dims[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS; + dataset_dims[0] = (hsize_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = (hsize_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = (hsize_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = (hsize_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = (hsize_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + sel_dims[1] = (hsize_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS; if (mpi_rank == SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) sel_dims[0] = sel_dims[1] = 0; @@ -590,12 +592,12 @@ test_filtered_dataset_single_no_selection(void) * it to the hyperslab in the file */ count[0] = 1; - count[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS / SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; - stride[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; - stride[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; - block[0] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; - block[1] = SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; - offset[0] = (hsize_t) mpi_rank * SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS * count[0]; + count[1] = (hsize_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS / (hsize_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + stride[0] = (hsize_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + stride[1] = (hsize_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + block[0] = (hsize_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + block[1] = (hsize_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + offset[0] = (hsize_t) mpi_rank * (hsize_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS * count[0]; offset[1] = 0; if (VERBOSE_MED) @@ -615,17 +617,22 @@ test_filtered_dataset_single_no_selection(void) data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *) malloc(data_size); - VRFY((NULL != data), "malloc succeeded"); + data = (C_DATATYPE *) calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "malloc succeeded"); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE) GEN_DATA(i); - for (i = 0; i < (correct_buf_size / sizeof(*correct_buf)) - (NUM_MPI_RANKS * dataset_dims[1]); i++) - correct_buf[i] = (C_DATATYPE) ((i % (NUM_MPI_RANKS * dataset_dims[1])) + (i / (NUM_MPI_RANKS * dataset_dims[1]))); + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + correct_buf[i] = (C_DATATYPE) ( (i % (dataset_dims[0] / (hsize_t) mpi_size * dataset_dims[1])) + + (i / (dataset_dims[0] / (hsize_t) mpi_size * dataset_dims[1]))); + + /* Compute the correct offset into the buffer for the process having no selection and clear it */ + segment_length = dataset_dims[0] * dataset_dims[1] / (hsize_t) mpi_size; + HDmemset(correct_buf + ((size_t) SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC * segment_length), 0, segment_length * sizeof(*data)); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -640,8 +647,8 @@ test_filtered_dataset_single_no_selection(void) VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != read_buf), "malloc succeeded"); + read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen(file_id, "/" SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -704,10 +711,10 @@ test_filtered_dataset_all_no_selection(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS; - dataset_dims[1] = ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS; - chunk_dims[0] = ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; - chunk_dims[1] = ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + dataset_dims[0] = (hsize_t) ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = (hsize_t) ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = (hsize_t) ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = (hsize_t) ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS; sel_dims[0] = sel_dims[1] = 0; filespace = H5Screate_simple(ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL); @@ -741,11 +748,11 @@ test_filtered_dataset_all_no_selection(void) data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *) malloc(data_size); - VRFY((NULL != data), "malloc succeeded"); + data = (C_DATATYPE *) calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); - VRFY((NULL != data), "malloc succeeded"); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE) GEN_DATA(i); @@ -763,8 +770,8 @@ test_filtered_dataset_all_no_selection(void) VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != read_buf), "malloc succeeded"); + read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen(file_id, "/" ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -798,11 +805,12 @@ test_filtered_dataset_point_selection(void) C_DATATYPE *data = NULL; C_DATATYPE *correct_buf = NULL; C_DATATYPE *read_buf = NULL; - hsize_t coords[2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS][POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t *coords = NULL; hsize_t dataset_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t chunk_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; hsize_t sel_dims[POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; size_t i, j, data_size, correct_buf_size; + size_t num_points; hid_t file_id = -1, dset_id = -1, plist_id = -1; hid_t filespace = -1, memspace = -1; @@ -822,12 +830,12 @@ test_filtered_dataset_point_selection(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_NROWS; - dataset_dims[1] = POINT_SELECTION_FILTERED_CHUNKS_NCOLS; - chunk_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS; - chunk_dims[1] = POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS; - sel_dims[0] = POINT_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS; - sel_dims[1] = POINT_SELECTION_FILTERED_CHUNKS_NCOLS; + dataset_dims[0] = (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_NROWS; + dataset_dims[1] = (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_NCOLS; + chunk_dims[0] = (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS; + chunk_dims[1] = (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS; + sel_dims[0] = (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_NROWS / (hsize_t) mpi_size; + sel_dims[1] = (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_NCOLS; filespace = H5Screate_simple(POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -855,34 +863,39 @@ test_filtered_dataset_point_selection(void) filespace = H5Dget_space(dset_id); VRFY((filespace >= 0), "File dataspace retrieval succeeded"); - for (i = 0; i < 2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS; i++) + num_points = (hsize_t) (POINT_SELECTION_FILTERED_CHUNKS_NROWS * POINT_SELECTION_FILTERED_CHUNKS_NCOLS / mpi_size); + coords = (hsize_t *) calloc(1, 2 * num_points * sizeof(*coords)); + VRFY((NULL != coords), "Coords calloc succeeded"); + + for (i = 0; i < num_points; i++) for (j = 0; j < POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS; j++) { if (j > 0) - coords[i][j] = i % POINT_SELECTION_FILTERED_CHUNKS_NCOLS; + coords[(i * POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS) + j] = i % (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_NCOLS; else - coords[i][j] = (hsize_t) mpi_rank + ((i / POINT_SELECTION_FILTERED_CHUNKS_NCOLS) * POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS); + coords[(i * POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS) + j] = (hsize_t) mpi_rank + + ((i / (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_NCOLS) * (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS); } - VRFY((H5Sselect_elements(filespace, H5S_SELECT_SET, 2 * POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS, (const hsize_t *) coords) >= 0), + VRFY((H5Sselect_elements(filespace, H5S_SELECT_SET, (hsize_t) num_points, (const hsize_t *) coords) >= 0), "Point selection succeeded"); /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *) malloc(data_size); - VRFY((NULL != data), "malloc succeeded"); + data = (C_DATATYPE *) calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != correct_buf), "malloc succeeded"); + correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE) GEN_DATA(i); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) - correct_buf[i] = (C_DATATYPE) ((dataset_dims[1] * (i / (NUM_MPI_RANKS * dataset_dims[1]))) + correct_buf[i] = (C_DATATYPE) ((dataset_dims[1] * (i / ((hsize_t) mpi_size * dataset_dims[1]))) + (i % dataset_dims[1]) - + (((i % (NUM_MPI_RANKS * dataset_dims[1])) / dataset_dims[1]) % dataset_dims[1])); + + (((i % ((hsize_t) mpi_size * dataset_dims[1])) / dataset_dims[1]) % dataset_dims[1])); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -897,16 +910,35 @@ test_filtered_dataset_point_selection(void) VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != read_buf), "malloc succeeded"); + read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen(file_id, "/" POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); + { + if (MAINPROCESS) { + printf("Read buf: ["); + for (i = 0; i < correct_buf_size / sizeof(*read_buf); i++) + printf("%ld, ", read_buf[i]); + printf("]\n"); + fflush(stdout); + + printf("Correct buf: ["); + for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) + printf("%ld, ", correct_buf[i]); + printf("]\n"); + fflush(stdout); + } + + MPI_Barrier(MPI_COMM_WORLD); + } + VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); + if (coords) free(coords); if (correct_buf) free(correct_buf); if (read_buf) free(read_buf); @@ -963,12 +995,12 @@ test_filtered_dataset_interleaved_write(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_NROWS; - dataset_dims[1] = INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS; - chunk_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS; - chunk_dims[1] = INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS; - sel_dims[0] = INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / 2; - sel_dims[1] = INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / 2; + dataset_dims[0] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_NROWS; + dataset_dims[1] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS; + chunk_dims[0] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS; + chunk_dims[1] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS; + sel_dims[0] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / 2; + sel_dims[1] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / 2; filespace = H5Screate_simple(INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -995,14 +1027,14 @@ test_filtered_dataset_interleaved_write(void) /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file */ - count[0] = SHARED_FILTERED_CHUNKS_NROWS / 2; - count[1] = SHARED_FILTERED_CHUNKS_NCOLS / 2; + count[0] = (hsize_t) SHARED_FILTERED_CHUNKS_NROWS / 2; + count[1] = (hsize_t) SHARED_FILTERED_CHUNKS_NCOLS / 2; stride[0] = 2; - stride[1] = SHARED_FILTERED_CHUNKS_CH_NCOLS; + stride[1] = (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS; block[0] = 1; block[1] = 1; - offset[0] = (hsize_t) mpi_rank / SHARED_FILTERED_CHUNKS_CH_NCOLS; - offset[1] = (hsize_t) mpi_rank % SHARED_FILTERED_CHUNKS_CH_NCOLS; + offset[0] = (hsize_t) mpi_rank / (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS; + offset[1] = (hsize_t) mpi_rank % (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS; if (VERBOSE_MED) printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", @@ -1018,19 +1050,19 @@ test_filtered_dataset_interleaved_write(void) data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *) malloc(data_size); - VRFY((NULL != data), "malloc succeeded"); + data = (C_DATATYPE *) calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != correct_buf), "malloc succeeded"); + correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE) GEN_DATA(i); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) - correct_buf[i] = (C_DATATYPE) (((i % SHARED_FILTERED_CHUNKS_NCOLS) / SHARED_FILTERED_CHUNKS_CH_NCOLS) - + ((i % SHARED_FILTERED_CHUNKS_NCOLS) % SHARED_FILTERED_CHUNKS_CH_NCOLS) - + (SHARED_FILTERED_CHUNKS_CH_NCOLS * (i / SHARED_FILTERED_CHUNKS_NCOLS))); + correct_buf[i] = (C_DATATYPE) (((i % (hsize_t) SHARED_FILTERED_CHUNKS_NCOLS) / (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS) + + ((i % (hsize_t) SHARED_FILTERED_CHUNKS_NCOLS) % (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS) + + ((hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS * (i / (hsize_t) SHARED_FILTERED_CHUNKS_NCOLS))); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -1045,8 +1077,8 @@ test_filtered_dataset_interleaved_write(void) VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != read_buf), "malloc succeeded"); + read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen(file_id, "/" INTERLEAVED_WRITE_FILTERED_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -1108,14 +1140,14 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS; - dataset_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS; - dataset_dims[2] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DEPTH; - chunk_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; - chunk_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; + dataset_dims[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS; + dataset_dims[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS; + dataset_dims[2] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DEPTH; + chunk_dims[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; + chunk_dims[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; chunk_dims[2] = 1; - sel_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS; - sel_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS; + sel_dims[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS; + sel_dims[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS; sel_dims[2] = 1; filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS, dataset_dims, NULL); @@ -1143,14 +1175,14 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file */ - count[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS / UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; - count[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS / UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; + count[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS / (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; + count[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS / (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; count[2] = 1; - stride[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; - stride[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; + stride[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; + stride[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; stride[2] = 1; - block[0] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; - block[1] = UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; + block[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS; + block[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS; block[2] = 1; offset[0] = 0; offset[1] = 0; @@ -1170,17 +1202,17 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); - data = (C_DATATYPE *) malloc(data_size); - VRFY((NULL != data), "malloc succeeded"); + data = (C_DATATYPE *) calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != correct_buf), "malloc succeeded"); + correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE) GEN_DATA(i); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) - correct_buf[i] = (C_DATATYPE) ((i % NUM_MPI_RANKS) + (i / NUM_MPI_RANKS)); + correct_buf[i] = (C_DATATYPE) ((i % (hsize_t) mpi_size) + (i / (hsize_t) mpi_size)); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -1195,8 +1227,8 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != read_buf), "malloc succeeded"); + read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen(file_id, "/" UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -1259,15 +1291,15 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS; - dataset_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS; - dataset_dims[2] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH; - chunk_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; - chunk_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; + dataset_dims[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS; + dataset_dims[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS; + dataset_dims[2] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH; + chunk_dims[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; + chunk_dims[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; chunk_dims[2] = 1; - sel_dims[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; - sel_dims[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS; - sel_dims[2] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH; + sel_dims[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; + sel_dims[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS; + sel_dims[2] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH; filespace = H5Screate_simple(UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -1295,15 +1327,15 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) * it to the hyperslab in the file */ count[0] = 1; - count[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS / UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; - count[2] = NUM_MPI_RANKS; - stride[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; - stride[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; + count[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS / (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; + count[2] = (hsize_t) mpi_size; + stride[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; + stride[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; stride[2] = 1; - block[0] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; - block[1] = UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; + block[0] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS; + block[1] = (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS; block[2] = 1; - offset[0] = ((hsize_t) mpi_rank * UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS * count[0]); + offset[0] = ((hsize_t) mpi_rank * (hsize_t) UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS * count[0]); offset[1] = 0; offset[2] = 0; @@ -1321,11 +1353,11 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); - data = (C_DATATYPE *) malloc(data_size); - VRFY((NULL != data), "malloc succeeded"); + data = (C_DATATYPE *) calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != correct_buf), "malloc succeeded"); + correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE) GEN_DATA(i); @@ -1346,8 +1378,8 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != read_buf), "malloc succeeded"); + read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen(file_id, "/" UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -1410,15 +1442,15 @@ test_3d_filtered_dataset_overlap(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = SHARED_FILTERED_CHUNKS_3D_NROWS; - dataset_dims[1] = SHARED_FILTERED_CHUNKS_3D_NCOLS; - dataset_dims[2] = SHARED_FILTERED_CHUNKS_3D_DEPTH; - chunk_dims[0] = SHARED_FILTERED_CHUNKS_3D_CH_NROWS; - chunk_dims[1] = SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + dataset_dims[0] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_NROWS; + dataset_dims[1] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_NCOLS; + dataset_dims[2] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_DEPTH; + chunk_dims[0] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NROWS; + chunk_dims[1] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; chunk_dims[2] = 1; - sel_dims[0] = SHARED_FILTERED_CHUNKS_3D_NROWS / 2; - sel_dims[1] = SHARED_FILTERED_CHUNKS_3D_NCOLS / 2; - sel_dims[2] = SHARED_FILTERED_CHUNKS_3D_DEPTH; + sel_dims[0] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_NROWS / 2; + sel_dims[1] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_NCOLS / 2; + sel_dims[2] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_DEPTH; filespace = H5Screate_simple(SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -1445,17 +1477,17 @@ test_3d_filtered_dataset_overlap(void) /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file */ - count[0] = SHARED_FILTERED_CHUNKS_3D_NROWS / 2; - count[1] = SHARED_FILTERED_CHUNKS_3D_NCOLS / 2; - count[2] = SHARED_FILTERED_CHUNKS_3D_DEPTH; + count[0] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_NROWS / 2; + count[1] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_NCOLS / 2; + count[2] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_DEPTH; stride[0] = 2; - stride[1] = SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + stride[1] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; stride[2] = 1; block[0] = 1; block[1] = 1; block[2] = 1; - offset[0] = (hsize_t) mpi_rank / SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; - offset[1] = (hsize_t) mpi_rank % SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + offset[0] = (hsize_t) mpi_rank / (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + offset[1] = (hsize_t) mpi_rank % (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; offset[2] = 0; if (VERBOSE_MED) @@ -1472,11 +1504,11 @@ test_3d_filtered_dataset_overlap(void) data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); - data = (C_DATATYPE *) malloc(data_size); - VRFY((NULL != data), "malloc succeeded"); + data = (C_DATATYPE *) calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != correct_buf), "malloc succeeded"); + correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE) GEN_DATA(i); @@ -1489,15 +1521,32 @@ test_3d_filtered_dataset_overlap(void) */ for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) /* Start with a base index */ - correct_buf[i] = (C_DATATYPE) ((i % NUM_MPI_RANKS) + correct_buf[i] = (C_DATATYPE) ((i % (hsize_t) mpi_size) + /* Add the value for the increasing column index */ - + (NUM_MPI_RANKS * ((i % (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH)) / (NUM_MPI_RANKS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS))) + + ( (hsize_t) mpi_size * + ( + (i % (hsize_t) (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH)) + / (hsize_t) (mpi_size * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS) + ) + ) + /* Add the value for the increasing row index */ - + ((SHARED_FILTERED_CHUNKS_3D_NCOLS * (SHARED_FILTERED_CHUNKS_3D_CH_NROWS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS / NUM_MPI_RANKS)) * (i / (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH * (SHARED_FILTERED_CHUNKS_3D_CH_NROWS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS / NUM_MPI_RANKS)))) + + ( + (hsize_t) (SHARED_FILTERED_CHUNKS_3D_NCOLS * (SHARED_FILTERED_CHUNKS_3D_CH_NROWS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS / mpi_size)) + * (i / (hsize_t) (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH * (SHARED_FILTERED_CHUNKS_3D_CH_NROWS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS / mpi_size))) + ) + /* Add the value for the increasing row index in a particular chunk */ - + (SHARED_FILTERED_CHUNKS_3D_CH_NCOLS * ((i % (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH * (SHARED_FILTERED_CHUNKS_3D_CH_NROWS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS / NUM_MPI_RANKS))) / (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH))) + + ( (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NCOLS * + ( + (i % (hsize_t) (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH * (SHARED_FILTERED_CHUNKS_3D_CH_NROWS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS / mpi_size))) + / (hsize_t) (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH) + ) + ) + /* Add the value for the increasing column index in a particular chunk */ - + ((i % (SHARED_FILTERED_CHUNKS_3D_CH_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH)) / NUM_MPI_RANKS)); + + ((i % (hsize_t) (SHARED_FILTERED_CHUNKS_3D_CH_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH)) / (hsize_t) mpi_size)); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -1512,8 +1561,8 @@ test_3d_filtered_dataset_overlap(void) VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != read_buf), "malloc succeeded"); + read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen(file_id, "/" SHARED_FILTERED_CHUNKS_3D_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -1546,17 +1595,17 @@ test_3d_filtered_dataset_overlap(void) static void test_cmpd_filtered_dataset_no_conversion_unshared(void) { - cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC]; - hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t count[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t stride[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t block[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t offset[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; - size_t i; - hid_t file_id = -1, dset_id = -1, plist_id = -1, memtype = -1; - hid_t filespace = -1, memspace = -1; + cmpd_filtered_t *data = NULL; + hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t count[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t stride[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t block[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t offset[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS]; + size_t i; + hid_t file_id = -1, dset_id = -1, plist_id = -1, memtype = -1; + hid_t filespace = -1, memspace = -1; if (MAINPROCESS) puts("Testing write to unshared filtered chunks in Compound Datatype dataset without Datatype conversion"); @@ -1575,11 +1624,11 @@ test_cmpd_filtered_dataset_no_conversion_unshared(void) /* Create the dataspace for the dataset */ dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NROWS; - dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS; + dataset_dims[1] = (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS; chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS; sel_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; - sel_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; + sel_dims[1] = (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -1616,7 +1665,7 @@ test_cmpd_filtered_dataset_no_conversion_unshared(void) * it to the hyperslab in the file */ count[0] = 1; - count[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; + count[1] = (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; stride[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; stride[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS; block[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS; @@ -1634,9 +1683,12 @@ test_cmpd_filtered_dataset_no_conversion_unshared(void) VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); + data = (COMPOUND_C_DATATYPE *) calloc(1, (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC * sizeof(*data)); + VRFY((NULL != data), "calloc succeeded"); + /* Fill data buffer */ - memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC); - for (i = 0; i < COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) { + memset(data, 0, sizeof(cmpd_filtered_t) * (size_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC); + for (i = 0; i < (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) { data[i].field1 = (short) GEN_DATA(i); data[i].field2 = (int) GEN_DATA(i); data[i].field3 = (long) GEN_DATA(i); @@ -1651,6 +1703,8 @@ test_cmpd_filtered_dataset_no_conversion_unshared(void) VRFY((H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); + if (data) free(data); + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); @@ -1673,17 +1727,17 @@ test_cmpd_filtered_dataset_no_conversion_unshared(void) static void test_cmpd_filtered_dataset_no_conversion_shared(void) { - cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC]; - hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t count[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t stride[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t block[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t offset[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; - size_t i; - hid_t file_id, dset_id, plist_id, memtype; - hid_t filespace, memspace; + cmpd_filtered_t *data = NULL; + hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t count[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t stride[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t block[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t offset[COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS]; + size_t i; + hid_t file_id, dset_id, plist_id, memtype; + hid_t filespace, memspace; if (MAINPROCESS) puts("Testing write to shared filtered chunks in Compound Datatype dataset without Datatype conversion"); @@ -1701,12 +1755,12 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NROWS; - dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS; - chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS; + dataset_dims[0] = (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NROWS; + dataset_dims[1] = (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS; + chunk_dims[0] = (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS; chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; - sel_dims[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; - sel_dims[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; + sel_dims[0] = (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS / (hsize_t) mpi_size; + sel_dims[1] = (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -1743,10 +1797,10 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) * it to the hyperslab in the file */ count[0] = 1; - count[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; - stride[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS; + count[1] = (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; + stride[0] = (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS; stride[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; - block[0] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; + block[0] = (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS / (hsize_t) mpi_size; block[1] = COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS; offset[0] = (hsize_t) mpi_rank; offset[1] = 0; @@ -1761,9 +1815,12 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); + data = (COMPOUND_C_DATATYPE *) calloc(1, (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC * sizeof(*data)); + VRFY((NULL != data), "calloc succeeded"); + /* Fill data buffer */ - memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC); - for (i = 0; i < COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) { + memset(data, 0, sizeof(cmpd_filtered_t) * (size_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC); + for (i = 0; i < (hsize_t) COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) { data[i].field1 = (short) GEN_DATA(i); data[i].field2 = (int) GEN_DATA(i); data[i].field3 = (long) GEN_DATA(i); @@ -1778,6 +1835,8 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) VRFY((H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) >= 0), "Dataset write succeeded"); + if (data) free(data); + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); @@ -1805,17 +1864,17 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) static void test_cmpd_filtered_dataset_type_conversion_unshared(void) { - cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC]; - hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t count[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t stride[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t block[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - hsize_t offset[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; - size_t i; - hid_t file_id = -1, dset_id = -1, plist_id = -1, filetype = -1, memtype = -1; - hid_t filespace = -1, memspace = -1; + cmpd_filtered_t *data = NULL; + hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t count[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t stride[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t block[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + hsize_t offset[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS]; + size_t i; + hid_t file_id = -1, dset_id = -1, plist_id = -1, filetype = -1, memtype = -1; + hid_t filespace = -1, memspace = -1; if (MAINPROCESS) puts("Testing write to unshared filtered chunks in Compound Datatype dataset with Datatype conversion"); @@ -1834,11 +1893,11 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) /* Create the dataspace for the dataset */ dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NROWS; - dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS; + dataset_dims[1] = (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS; chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS; sel_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; - sel_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; + sel_dims[1] = (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -1884,7 +1943,7 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) * it to the hyperslab in the file */ count[0] = 1; - count[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; + count[1] = (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; stride[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; stride[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS; block[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS; @@ -1902,9 +1961,12 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); + data = (COMPOUND_C_DATATYPE *) calloc(1, (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC * sizeof(*data)); + VRFY((NULL != data), "calloc succeeded"); + /* Fill data buffer */ - memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC); - for (i = 0; i < COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) { + memset(data, 0, sizeof(cmpd_filtered_t) * (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC); + for (i = 0; i < (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) { data[i].field1 = (short) GEN_DATA(i); data[i].field2 = (int) GEN_DATA(i); data[i].field3 = (long) GEN_DATA(i); @@ -1922,6 +1984,8 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) VRFY((H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0), "Dataset write succeeded"); } H5E_END_TRY; + if (data) free(data); + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); @@ -1950,17 +2014,17 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) static void test_cmpd_filtered_dataset_type_conversion_shared(void) { - cmpd_filtered_t data[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC]; - hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t count[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t stride[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t block[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - hsize_t offset[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; - size_t i; - hid_t file_id, dset_id, plist_id, filetype, memtype; - hid_t filespace, memspace; + cmpd_filtered_t *data = NULL; + hsize_t dataset_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t chunk_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t sel_dims[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t count[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t stride[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t block[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + hsize_t offset[COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS]; + size_t i; + hid_t file_id, dset_id, plist_id, filetype, memtype; + hid_t filespace, memspace; if (MAINPROCESS) puts("Testing write to shared filtered chunks in Compound Datatype dataset with Datatype conversion"); @@ -1978,12 +2042,12 @@ test_cmpd_filtered_dataset_type_conversion_shared(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NROWS; - dataset_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS; - chunk_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS; + dataset_dims[0] = (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NROWS; + dataset_dims[1] = (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS; + chunk_dims[0] = (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS; chunk_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; - sel_dims[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; - sel_dims[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; + sel_dims[0] = (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS / (hsize_t) mpi_size; + sel_dims[1] = (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; filespace = H5Screate_simple(COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -2029,10 +2093,10 @@ test_cmpd_filtered_dataset_type_conversion_shared(void) * it to the hyperslab in the file */ count[0] = 1; - count[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; - stride[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS; + count[1] = (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; + stride[0] = (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS; stride[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; - block[0] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS / NUM_MPI_RANKS; + block[0] = (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS / (hsize_t) mpi_size; block[1] = COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS; offset[0] = (hsize_t) mpi_rank; offset[1] = 0; @@ -2047,9 +2111,12 @@ test_cmpd_filtered_dataset_type_conversion_shared(void) VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, stride, count, block) >= 0), "Hyperslab selection succeeded"); + data = (COMPOUND_C_DATATYPE *) calloc(1, (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC * sizeof(*data)); + VRFY((NULL != data), "calloc succeeded"); + /* Fill data buffer */ - memset(data, 0, sizeof(cmpd_filtered_t) * COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC); - for (i = 0; i < COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) { + memset(data, 0, sizeof(cmpd_filtered_t) * (size_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC); + for (i = 0; i < (hsize_t) COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) { data[i].field1 = (short) GEN_DATA(i); data[i].field2 = (int) GEN_DATA(i); data[i].field3 = (long) GEN_DATA(i); @@ -2067,6 +2134,8 @@ test_cmpd_filtered_dataset_type_conversion_shared(void) VRFY((H5Dwrite(dset_id, memtype, memspace, filespace, plist_id, data) < 0), "Dataset write succeeded"); } H5E_END_TRY; + if (data) free(data); + VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded"); @@ -2102,9 +2171,9 @@ test_write_serial_read_parallel(void) if (MAINPROCESS) puts("Testing write file serially; read file in parallel"); - dataset_dims[0] = WRITE_SERIAL_READ_PARALLEL_NROWS; - dataset_dims[1] = WRITE_SERIAL_READ_PARALLEL_NCOLS; - dataset_dims[2] = WRITE_SERIAL_READ_PARALLEL_DEPTH; + dataset_dims[0] = (hsize_t) WRITE_SERIAL_READ_PARALLEL_NROWS; + dataset_dims[1] = (hsize_t) WRITE_SERIAL_READ_PARALLEL_NCOLS; + dataset_dims[2] = (hsize_t) WRITE_SERIAL_READ_PARALLEL_DEPTH; /* Write the file on the MAINPROCESS rank */ if (MAINPROCESS) { @@ -2120,8 +2189,8 @@ test_write_serial_read_parallel(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - chunk_dims[0] = WRITE_SERIAL_READ_PARALLEL_CH_NROWS; - chunk_dims[1] = WRITE_SERIAL_READ_PARALLEL_CH_NCOLS; + chunk_dims[0] = (hsize_t) WRITE_SERIAL_READ_PARALLEL_CH_NROWS; + chunk_dims[1] = (hsize_t) WRITE_SERIAL_READ_PARALLEL_CH_NCOLS; chunk_dims[2] = 1; filespace = H5Screate_simple(WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS, dataset_dims, NULL); @@ -2145,8 +2214,8 @@ test_write_serial_read_parallel(void) data_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*data); - data = (C_DATATYPE *) malloc(data_size); - VRFY((NULL != data), "malloc succeeded"); + data = (C_DATATYPE *) calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE) GEN_DATA(i); @@ -2161,11 +2230,11 @@ test_write_serial_read_parallel(void) correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != correct_buf), "malloc succeeded"); + correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); - read_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != read_buf), "malloc succeeded"); + read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = (long) i; @@ -2248,15 +2317,15 @@ test_write_parallel_read_serial(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); /* Create the dataspace for the dataset */ - dataset_dims[0] = WRITE_PARALLEL_READ_SERIAL_NROWS; - dataset_dims[1] = WRITE_PARALLEL_READ_SERIAL_NCOLS; - dataset_dims[2] = WRITE_PARALLEL_READ_SERIAL_DEPTH; - chunk_dims[0] = WRITE_PARALLEL_READ_SERIAL_CH_NROWS; - chunk_dims[1] = WRITE_PARALLEL_READ_SERIAL_CH_NCOLS; + dataset_dims[0] = (hsize_t) WRITE_PARALLEL_READ_SERIAL_NROWS; + dataset_dims[1] = (hsize_t) WRITE_PARALLEL_READ_SERIAL_NCOLS; + dataset_dims[2] = (hsize_t) WRITE_PARALLEL_READ_SERIAL_DEPTH; + chunk_dims[0] = (hsize_t) WRITE_PARALLEL_READ_SERIAL_CH_NROWS; + chunk_dims[1] = (hsize_t) WRITE_PARALLEL_READ_SERIAL_CH_NCOLS; chunk_dims[2] = 1; - sel_dims[0] = WRITE_PARALLEL_READ_SERIAL_CH_NROWS; - sel_dims[1] = WRITE_PARALLEL_READ_SERIAL_NCOLS; - sel_dims[2] = WRITE_PARALLEL_READ_SERIAL_DEPTH; + sel_dims[0] = (hsize_t) WRITE_PARALLEL_READ_SERIAL_CH_NROWS; + sel_dims[1] = (hsize_t) WRITE_PARALLEL_READ_SERIAL_NCOLS; + sel_dims[2] = (hsize_t) WRITE_PARALLEL_READ_SERIAL_DEPTH; filespace = H5Screate_simple(WRITE_PARALLEL_READ_SERIAL_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -2284,15 +2353,15 @@ test_write_parallel_read_serial(void) * it to the hyperslab in the file */ count[0] = 1; - count[1] = WRITE_PARALLEL_READ_SERIAL_NCOLS / WRITE_PARALLEL_READ_SERIAL_CH_NCOLS; - count[2] = NUM_MPI_RANKS; - stride[0] = WRITE_PARALLEL_READ_SERIAL_CH_NROWS; - stride[1] = WRITE_PARALLEL_READ_SERIAL_CH_NCOLS; + count[1] = (hsize_t) WRITE_PARALLEL_READ_SERIAL_NCOLS / (hsize_t) WRITE_PARALLEL_READ_SERIAL_CH_NCOLS; + count[2] = (hsize_t) mpi_size; + stride[0] = (hsize_t) WRITE_PARALLEL_READ_SERIAL_CH_NROWS; + stride[1] = (hsize_t) WRITE_PARALLEL_READ_SERIAL_CH_NCOLS; stride[2] = 1; - block[0] = WRITE_PARALLEL_READ_SERIAL_CH_NROWS; - block[1] = WRITE_PARALLEL_READ_SERIAL_CH_NCOLS; + block[0] = (hsize_t) WRITE_PARALLEL_READ_SERIAL_CH_NROWS; + block[1] = (hsize_t) WRITE_PARALLEL_READ_SERIAL_CH_NCOLS; block[2] = 1; - offset[0] = ((hsize_t) mpi_rank * WRITE_PARALLEL_READ_SERIAL_CH_NROWS * count[0]); + offset[0] = ((hsize_t) mpi_rank * (hsize_t) WRITE_PARALLEL_READ_SERIAL_CH_NROWS * count[0]); offset[1] = 0; offset[2] = 0; @@ -2309,8 +2378,8 @@ test_write_parallel_read_serial(void) /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); - data = (C_DATATYPE *) malloc(data_size); - VRFY((NULL != data), "malloc succeeded"); + data = (C_DATATYPE *) calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE) GEN_DATA(i); @@ -2347,11 +2416,11 @@ test_write_parallel_read_serial(void) correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != correct_buf), "malloc succeeded"); + correct_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); - read_buf = (C_DATATYPE *) malloc(correct_buf_size); - VRFY((NULL != read_buf), "malloc succeeded"); + read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = (C_DATATYPE) ((i % (dataset_dims[0] * dataset_dims[1])) + (i / (dataset_dims[0] * dataset_dims[1])));; @@ -2379,9 +2448,9 @@ main(int argc, char** argv) MPI_Comm_size(comm, &mpi_size); MPI_Comm_rank(comm, &mpi_rank); - if (mpi_size != NUM_MPI_RANKS) { + if (mpi_size <= 0) { if (MAINPROCESS) { - printf("These tests are set up to use %d ranks.\n", NUM_MPI_RANKS); + printf("The Parallel Filters tests require at least 1 rank.\n"); printf("Quitting...\n"); } @@ -2438,7 +2507,7 @@ exit: ALARM_OFF; - h5_clean_files(FILENAME, fapl); + /* XXX: h5_clean_files(FILENAME, fapl); */ H5close(); diff --git a/testpar/t_filters_parallel.h b/testpar/t_filters_parallel.h index 4666033..6999c27 100644 --- a/testpar/t_filters_parallel.h +++ b/testpar/t_filters_parallel.h @@ -33,7 +33,7 @@ /* Used to load other filters than GZIP */ /* #define DYNAMIC_FILTER */ /* Uncomment and define the fields below to use a dynamically loaded filter */ #define FILTER_NUM_CDVALUES 1 -const unsigned int cd_values[FILTER_NUM_CDVALUES]; +const unsigned int cd_values[FILTER_NUM_CDVALUES] = { 0 }; H5Z_filter_t filter_id; unsigned int flags = 0; size_t cd_nelmts = FILTER_NUM_CDVALUES; @@ -42,15 +42,15 @@ size_t cd_nelmts = FILTER_NUM_CDVALUES; #define STRINGIFY(type) #type /* Common defines for all tests */ -#define NUM_MPI_RANKS 4 #define C_DATATYPE long +#define COMPOUND_C_DATATYPE cmpd_filtered_t #define C_DATATYPE_STR(type) STRINGIFY(type) #define HDF5_DATATYPE_NAME H5T_NATIVE_LONG #define GEN_DATA(i) INCREMENTAL_DATA(i) #define INCREMENTAL_DATA(i) ((size_t) mpi_rank + i) /* Generates incremental test data */ -/* XXX: For experimental purposes only, will causes tests to fail data verification phase */ +/* XXX: For experimental purposes only, will cause tests to fail data verification phase */ /* #define GEN_DATA(i) RANK_DATA(i) */ /* Given an index value i, generates test data based upon selected mode */ #define RANK_DATA(i) (mpi_rank) /* Generates test data to visibly show which rank wrote to which parts of the dataset */ @@ -60,91 +60,94 @@ size_t cd_nelmts = FILTER_NUM_CDVALUES; #define SET_FILTER(dcpl) H5Pset_deflate(dcpl, 6) /* Test GZIP filter in parallel */ #endif +#define DIM0_SCALE_FACTOR 4 +#define DIM1_SCALE_FACTOR 2 + /* Defines for the one-chunk filtered dataset test */ #define ONE_CHUNK_FILTERED_DATASET_NAME "one_chunk_filtered_dataset" #define ONE_CHUNK_FILTERED_DATASET_DIMS 2 -#define ONE_CHUNK_FILTERED_DATASET_NROWS (NUM_MPI_RANKS * 4) /* Must be an even multiple of the number of ranks to avoid issues */ -#define ONE_CHUNK_FILTERED_DATASET_NCOLS (NUM_MPI_RANKS * 2) /* Must be an even multiple of the number of ranks to avoid issues */ +#define ONE_CHUNK_FILTERED_DATASET_NROWS (mpi_size * DIM0_SCALE_FACTOR) /* Must be an even multiple of the number of ranks to avoid issues */ +#define ONE_CHUNK_FILTERED_DATASET_NCOLS (mpi_size * DIM1_SCALE_FACTOR) /* Must be an even multiple of the number of ranks to avoid issues */ #define ONE_CHUNK_FILTERED_DATASET_CH_NROWS ONE_CHUNK_FILTERED_DATASET_NROWS #define ONE_CHUNK_FILTERED_DATASET_CH_NCOLS ONE_CHUNK_FILTERED_DATASET_NCOLS /* Defines for the unshared filtered chunks write test */ #define UNSHARED_FILTERED_CHUNKS_DATASET_NAME "unshared_filtered_chunks" #define UNSHARED_FILTERED_CHUNKS_DATASET_DIMS 2 -#define UNSHARED_FILTERED_CHUNKS_NROWS (NUM_MPI_RANKS * 4) -#define UNSHARED_FILTERED_CHUNKS_NCOLS (NUM_MPI_RANKS * 2) -#define UNSHARED_FILTERED_CHUNKS_CH_NROWS (UNSHARED_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) -#define UNSHARED_FILTERED_CHUNKS_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) +#define UNSHARED_FILTERED_CHUNKS_NROWS (mpi_size * DIM0_SCALE_FACTOR) +#define UNSHARED_FILTERED_CHUNKS_NCOLS (mpi_size * DIM1_SCALE_FACTOR) +#define UNSHARED_FILTERED_CHUNKS_CH_NROWS (UNSHARED_FILTERED_CHUNKS_NROWS / mpi_size) +#define UNSHARED_FILTERED_CHUNKS_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_NCOLS / mpi_size) /* Defines for the shared filtered chunks write test */ #define SHARED_FILTERED_CHUNKS_DATASET_NAME "shared_filtered_chunks" #define SHARED_FILTERED_CHUNKS_DATASET_DIMS 2 -#define SHARED_FILTERED_CHUNKS_NROWS (NUM_MPI_RANKS * 4) -#define SHARED_FILTERED_CHUNKS_NCOLS (NUM_MPI_RANKS * 2) -#define SHARED_FILTERED_CHUNKS_CH_NROWS (SHARED_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) -#define SHARED_FILTERED_CHUNKS_CH_NCOLS (SHARED_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) +#define SHARED_FILTERED_CHUNKS_CH_NROWS (mpi_size) +#define SHARED_FILTERED_CHUNKS_CH_NCOLS (mpi_size) +#define SHARED_FILTERED_CHUNKS_NROWS (SHARED_FILTERED_CHUNKS_CH_NROWS * DIM0_SCALE_FACTOR) +#define SHARED_FILTERED_CHUNKS_NCOLS (SHARED_FILTERED_CHUNKS_CH_NCOLS * DIM1_SCALE_FACTOR) /* Defines for the filtered chunks write test where a process has no selection */ #define SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME "single_no_selection_filtered_chunks" #define SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS (NUM_MPI_RANKS * 4) -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS (NUM_MPI_RANKS * 2) -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS (SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS (SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) -#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC NUM_MPI_RANKS - 1 +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS (DIM0_SCALE_FACTOR) +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS (DIM1_SCALE_FACTOR) +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NROWS (SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS * mpi_size) +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS (SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS * mpi_size) +#define SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC (mpi_size - 1) /* Defines for the filtered chunks write test where no process has a selection */ #define ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME "all_no_selection_filtered_chunks" #define ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 -#define ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS (NUM_MPI_RANKS * 4) -#define ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS (NUM_MPI_RANKS * 2) -#define ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS (ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) -#define ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS (ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) +#define ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS (DIM0_SCALE_FACTOR) +#define ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS (DIM1_SCALE_FACTOR) +#define ALL_NO_SELECTION_FILTERED_CHUNKS_NROWS (ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS * mpi_size) +#define ALL_NO_SELECTION_FILTERED_CHUNKS_NCOLS (ALL_NO_SELECTION_FILTERED_CHUNKS_CH_NCOLS * mpi_size) /* Defines for the filtered chunks write test with a point selection */ #define POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME "point_selection_filtered_chunks" #define POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS 2 -#define POINT_SELECTION_FILTERED_CHUNKS_NROWS (NUM_MPI_RANKS * 4) -#define POINT_SELECTION_FILTERED_CHUNKS_NCOLS (NUM_MPI_RANKS * 2) -#define POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS (POINT_SELECTION_FILTERED_CHUNKS_NROWS / NUM_MPI_RANKS) -#define POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS (POINT_SELECTION_FILTERED_CHUNKS_NCOLS / NUM_MPI_RANKS) -#define POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS ((POINT_SELECTION_FILTERED_CHUNKS_NROWS / POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS) * (POINT_SELECTION_FILTERED_CHUNKS_NCOLS / POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS)) +#define POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS (DIM0_SCALE_FACTOR) +#define POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS (DIM1_SCALE_FACTOR) +#define POINT_SELECTION_FILTERED_CHUNKS_NROWS (POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS * mpi_size) +#define POINT_SELECTION_FILTERED_CHUNKS_NCOLS (POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS * mpi_size) +#define POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS (mpi_size * mpi_size) /* Defines for the filtered dataset interleaved write test */ #define INTERLEAVED_WRITE_FILTERED_DATASET_NAME "interleaved_write_filtered_dataset" #define INTERLEAVED_WRITE_FILTERED_DATASET_DIMS 2 -#define INTERLEAVED_WRITE_FILTERED_DATASET_NROWS (NUM_MPI_RANKS * 4) /* Must be an even multiple of the number of ranks to avoid issues */ -#define INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS (NUM_MPI_RANKS * 2) /* Must be an even multiple of the number of ranks to avoid issues */ -#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS (INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / NUM_MPI_RANKS) -#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS (INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / NUM_MPI_RANKS) +#define INTERLEAVED_WRITE_FILTERED_DATASET_NROWS (mpi_size * DIM0_SCALE_FACTOR) /* Must be an even multiple of the number of ranks to avoid issues */ +#define INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS (mpi_size * DIM1_SCALE_FACTOR) /* Must be an even multiple of the number of ranks to avoid issues */ +#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS (INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / mpi_size) +#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS (INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / mpi_size) #define INTERLEAVED_WRITE_FILTERED_DATASET_SEL_NPOINTS (INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS * INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS / INTERLEAVED_WRITE_FILTERED_DATASET_NUM_RANKS) /* Defines for the 3D unshared filtered dataset separate page write test */ #define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME "3d_unshared_filtered_chunks_separate_pages" #define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS 3 -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS (NUM_MPI_RANKS * 4) -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS (NUM_MPI_RANKS * 2) -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DEPTH (NUM_MPI_RANKS) -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS (UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS / NUM_MPI_RANKS) -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS / NUM_MPI_RANKS) +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS (mpi_size * DIM0_SCALE_FACTOR) +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS (mpi_size * DIM1_SCALE_FACTOR) +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DEPTH (mpi_size) +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NROWS (UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS / mpi_size) +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS / mpi_size) /* Defines for the 3D unshared filtered dataset same page write test */ #define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME "3d_unshared_filtered_chunks_same_pages" #define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS 3 -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS (NUM_MPI_RANKS * 4) -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS (NUM_MPI_RANKS * 2) -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH (NUM_MPI_RANKS) -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS (UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS / NUM_MPI_RANKS) -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS / NUM_MPI_RANKS) +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS (mpi_size * DIM0_SCALE_FACTOR) +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS (mpi_size * DIM1_SCALE_FACTOR) +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DEPTH (mpi_size) +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NROWS (UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS / mpi_size) +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS / mpi_size) /* Defines for the 3d shared filtered dataset write test */ #define SHARED_FILTERED_CHUNKS_3D_DATASET_NAME "3d_shared_filtered_chunks" #define SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS 3 -#define SHARED_FILTERED_CHUNKS_3D_NROWS (NUM_MPI_RANKS * 4) -#define SHARED_FILTERED_CHUNKS_3D_NCOLS (NUM_MPI_RANKS * 2) -#define SHARED_FILTERED_CHUNKS_3D_DEPTH (NUM_MPI_RANKS) -#define SHARED_FILTERED_CHUNKS_3D_CH_NROWS (SHARED_FILTERED_CHUNKS_3D_NROWS / NUM_MPI_RANKS) -#define SHARED_FILTERED_CHUNKS_3D_CH_NCOLS (SHARED_FILTERED_CHUNKS_3D_NCOLS / NUM_MPI_RANKS) +#define SHARED_FILTERED_CHUNKS_3D_NROWS (mpi_size * DIM0_SCALE_FACTOR) +#define SHARED_FILTERED_CHUNKS_3D_NCOLS (mpi_size * DIM1_SCALE_FACTOR) +#define SHARED_FILTERED_CHUNKS_3D_DEPTH (mpi_size) +#define SHARED_FILTERED_CHUNKS_3D_CH_NROWS (SHARED_FILTERED_CHUNKS_3D_NROWS / mpi_size) +#define SHARED_FILTERED_CHUNKS_3D_CH_NCOLS (SHARED_FILTERED_CHUNKS_3D_NCOLS / mpi_size) /* Struct type for the compound datatype filtered dataset tests */ typedef struct { @@ -152,23 +155,23 @@ typedef struct { int field2; long field3; double field4; -} cmpd_filtered_t; +} COMPOUND_C_DATATYPE; /* Defines for the compound datatype filtered dataset no conversion write test with unshared chunks */ #define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_NAME "compound_unshared_filtered_chunks_no_conversion" #define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_DIMS 2 #define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NROWS 1 -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS mpi_size #define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NROWS 1 #define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS 1 -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS / NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC (COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_NCOLS / mpi_size) /* Defines for the compound datatype filtered dataset no conversion write test with shared chunks */ #define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_NAME "compound_shared_filtered_chunks_no_conversion" #define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_DIMS 2 -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NROWS NUM_MPI_RANKS -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS NUM_MPI_RANKS -#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NROWS mpi_size +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS mpi_size +#define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NROWS mpi_size #define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_CH_NCOLS 1 #define COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_NCOLS @@ -176,36 +179,36 @@ typedef struct { #define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_NAME "compound_unshared_filtered_chunks_type_conversion" #define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_DIMS 2 #define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NROWS 1 -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS mpi_size #define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NROWS 1 #define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS 1 -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS / NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC (COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_NCOLS / mpi_size) /* Defines for the compound datatype filtered dataset type conversion write test with shared chunks */ #define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_NAME "compound_shared_filtered_chunks_type_conversion" #define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_DIMS 2 -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NROWS NUM_MPI_RANKS -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS NUM_MPI_RANKS -#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS NUM_MPI_RANKS +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NROWS mpi_size +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS mpi_size +#define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NROWS mpi_size #define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_CH_NCOLS 1 #define COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_NCOLS /* Defines for the write file serially/read in parallel test */ #define WRITE_SERIAL_READ_PARALLEL_DATASET_NAME "write_serial_read_parallel" #define WRITE_SERIAL_READ_PARALLEL_DATASET_DIMS 3 -#define WRITE_SERIAL_READ_PARALLEL_NROWS (NUM_MPI_RANKS * 4) -#define WRITE_SERIAL_READ_PARALLEL_NCOLS (NUM_MPI_RANKS * 2) -#define WRITE_SERIAL_READ_PARALLEL_DEPTH (NUM_MPI_RANKS) -#define WRITE_SERIAL_READ_PARALLEL_CH_NROWS (WRITE_SERIAL_READ_PARALLEL_NROWS / NUM_MPI_RANKS) -#define WRITE_SERIAL_READ_PARALLEL_CH_NCOLS (WRITE_SERIAL_READ_PARALLEL_NCOLS / NUM_MPI_RANKS) +#define WRITE_SERIAL_READ_PARALLEL_NROWS (mpi_size * DIM0_SCALE_FACTOR) +#define WRITE_SERIAL_READ_PARALLEL_NCOLS (mpi_size * DIM1_SCALE_FACTOR) +#define WRITE_SERIAL_READ_PARALLEL_DEPTH (mpi_size) +#define WRITE_SERIAL_READ_PARALLEL_CH_NROWS (WRITE_SERIAL_READ_PARALLEL_NROWS / mpi_size) +#define WRITE_SERIAL_READ_PARALLEL_CH_NCOLS (WRITE_SERIAL_READ_PARALLEL_NCOLS / mpi_size) /* Defines for the write file in parallel/read serially test */ #define WRITE_PARALLEL_READ_SERIAL_DATASET_NAME "write_parallel_read_serial" #define WRITE_PARALLEL_READ_SERIAL_DATASET_DIMS 3 -#define WRITE_PARALLEL_READ_SERIAL_NROWS (NUM_MPI_RANKS * 4) -#define WRITE_PARALLEL_READ_SERIAL_NCOLS (NUM_MPI_RANKS * 2) -#define WRITE_PARALLEL_READ_SERIAL_DEPTH (NUM_MPI_RANKS) -#define WRITE_PARALLEL_READ_SERIAL_CH_NROWS (WRITE_PARALLEL_READ_SERIAL_NROWS / NUM_MPI_RANKS) -#define WRITE_PARALLEL_READ_SERIAL_CH_NCOLS (WRITE_PARALLEL_READ_SERIAL_NCOLS / NUM_MPI_RANKS) +#define WRITE_PARALLEL_READ_SERIAL_NROWS (mpi_size * DIM0_SCALE_FACTOR) +#define WRITE_PARALLEL_READ_SERIAL_NCOLS (mpi_size * DIM1_SCALE_FACTOR) +#define WRITE_PARALLEL_READ_SERIAL_DEPTH (mpi_size) +#define WRITE_PARALLEL_READ_SERIAL_CH_NROWS (WRITE_PARALLEL_READ_SERIAL_NROWS / mpi_size) +#define WRITE_PARALLEL_READ_SERIAL_CH_NCOLS (WRITE_PARALLEL_READ_SERIAL_NCOLS / mpi_size) #endif /* TEST_PARALLEL_FILTERS_H_ */ -- cgit v0.12 From 22baab211d912f1012057b3a7ae217abd2a44a38 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Mon, 28 Aug 2017 20:05:52 -0400 Subject: Add commentary around calling H5Screate_simple with a single element --- testpar/t_bigio.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index ca2b55d..611ff1a 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -519,6 +519,7 @@ dataset_big_write(void) /* Create a large dataset */ dims[0] = bigcount; dims[1] = mpi_size; + sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate2(fid, DATASET1, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -596,6 +597,7 @@ dataset_big_write(void) /* Create a large dataset */ dims[0] = bigcount; dims[1] = mpi_size; + sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate2(fid, DATASET2, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -673,6 +675,7 @@ dataset_big_write(void) /* Create a large dataset */ dims[0] = bigcount; dims[1] = 1; + sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate2(fid, DATASET3, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -748,6 +751,7 @@ dataset_big_write(void) /* Create a large dataset */ dims[0] = bigcount; dims[1] = mpi_size * 4; + sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate2(fid, DATASET4, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -785,6 +789,10 @@ dataset_big_write(void) } /* create a memory dataspace */ + /* Warning: H5Screate_simple requires an array of hsize_t elements + * even if we only pass only a single value. Attempting anything else + * appears to cause problems with 32 bit compilers. + */ mem_dataspace = H5Screate_simple (1, dims, NULL); VRFY((mem_dataspace >= 0), ""); @@ -821,6 +829,7 @@ dataset_big_write(void) /* Create a large dataset */ dims[0] = bigcount/6; dims[1] = mpi_size * 4; + sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate2(fid, DATASET5, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -841,7 +850,7 @@ dataset_big_write(void) file_dataspace = H5Dget_space (dataset); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - dims[1] = 4; + // dims[1] = 4; /* create a memory dataspace */ mem_dataspace = H5Screate_simple (RANK, dims, NULL); VRFY((mem_dataspace >= 0), ""); @@ -1217,6 +1226,10 @@ dataset_big_read(void) if(coords) free(coords); /* create a memory dataspace */ + /* Warning: H5Screate_simple requires an array of hsize_t elements + * even if we only pass only a single value. Attempting anything else + * appears to cause problems with 32 bit compilers. + */ mem_dataspace = H5Screate_simple (1, dims, NULL); VRFY((mem_dataspace >= 0), ""); @@ -1276,7 +1289,6 @@ dataset_big_read(void) VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); /* create a memory dataspace */ - dims[1] = 4; mem_dataspace = H5Screate_simple (RANK, dims, NULL); VRFY((mem_dataspace >= 0), ""); @@ -1645,7 +1657,6 @@ coll_chunktest(const char* filename, size_t num_points; /* for point selection */ hsize_t *coords = NULL; /* for point selection */ - hsize_t current_dims; /* for point selection */ int i; /* Create the data space */ @@ -1676,6 +1687,10 @@ coll_chunktest(const char* filename, VRFY((coords != NULL), "coords malloc succeeded"); point_set(start, count, stride, block, num_points, coords, mode); + /* Warning: H5Screate_simple requires an array of hsize_t elements + * even if we only pass only a single value. Attempting anything else + * appears to cause problems with 32 bit compilers. + */ file_dataspace = H5Screate_simple(2, dims, NULL); VRFY((file_dataspace >= 0), "file dataspace created succeeded"); @@ -1684,8 +1699,8 @@ coll_chunktest(const char* filename, VRFY((mem_dataspace >= 0), "mem dataspace created succeeded"); } else { - hsize_t dsdims[1] = {num_points}; - current_dims = num_points; + /* Putting the warning about H5Screate_simple (above) into practice... */ + hsize_t dsdims[1] = {num_points}; mem_dataspace = H5Screate_simple (1, dsdims, NULL); VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); } @@ -1963,8 +1978,11 @@ coll_chunktest(const char* filename, VRFY((mem_dataspace >= 0), ""); } else { - hsize_t dsdims[1] = {num_points}; - current_dims = num_points; + /* Warning: H5Screate_simple requires an array of hsize_t elements + * even if we only pass only a single value. Attempting anything else + * appears to cause problems with 32 bit compilers. + */ + hsize_t dsdims[1] = {num_points}; mem_dataspace = H5Screate_simple (1, dsdims, NULL); VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); } -- cgit v0.12 From b5b1dd082752c7f55898422f9c60fbf5f33d9dd4 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Tue, 29 Aug 2017 11:41:52 -0500 Subject: Finish up Parallel Compression test scaling work --- testpar/t_filters_parallel.c | 118 ++++++++++++++----------------------------- testpar/t_filters_parallel.h | 24 ++++----- 2 files changed, 49 insertions(+), 93 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 1641a44..d853043 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -863,18 +863,14 @@ test_filtered_dataset_point_selection(void) filespace = H5Dget_space(dset_id); VRFY((filespace >= 0), "File dataspace retrieval succeeded"); - num_points = (hsize_t) (POINT_SELECTION_FILTERED_CHUNKS_NROWS * POINT_SELECTION_FILTERED_CHUNKS_NCOLS / mpi_size); + num_points = (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_NROWS * (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_NCOLS / (hsize_t) mpi_size; coords = (hsize_t *) calloc(1, 2 * num_points * sizeof(*coords)); VRFY((NULL != coords), "Coords calloc succeeded"); for (i = 0; i < num_points; i++) - for (j = 0; j < POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS; j++) { - if (j > 0) - coords[(i * POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS) + j] = i % (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_NCOLS; - else - coords[(i * POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS) + j] = (hsize_t) mpi_rank - + ((i / (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_NCOLS) * (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS); - } + for (j = 0; j < POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS; j++) + coords[(i * POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS) + j] = (j > 0) ? (i % (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_NCOLS) + : ((hsize_t) mpi_rank + ((hsize_t) mpi_size * (i / (hsize_t) POINT_SELECTION_FILTERED_CHUNKS_NCOLS))); VRFY((H5Sselect_elements(filespace, H5S_SELECT_SET, (hsize_t) num_points, (const hsize_t *) coords) >= 0), "Point selection succeeded"); @@ -918,24 +914,6 @@ test_filtered_dataset_point_selection(void) VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); - { - if (MAINPROCESS) { - printf("Read buf: ["); - for (i = 0; i < correct_buf_size / sizeof(*read_buf); i++) - printf("%ld, ", read_buf[i]); - printf("]\n"); - fflush(stdout); - - printf("Correct buf: ["); - for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) - printf("%ld, ", correct_buf[i]); - printf("]\n"); - fflush(stdout); - } - - MPI_Barrier(MPI_COMM_WORLD); - } - VRFY((0 == memcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (coords) free(coords); @@ -999,8 +977,8 @@ test_filtered_dataset_interleaved_write(void) dataset_dims[1] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS; chunk_dims[0] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS; chunk_dims[1] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS; - sel_dims[0] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / 2; - sel_dims[1] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / 2; + sel_dims[0] = (hsize_t) (INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / mpi_size); + sel_dims[1] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS; filespace = H5Screate_simple(INTERLEAVED_WRITE_FILTERED_DATASET_DIMS, dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); @@ -1027,14 +1005,14 @@ test_filtered_dataset_interleaved_write(void) /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file */ - count[0] = (hsize_t) SHARED_FILTERED_CHUNKS_NROWS / 2; - count[1] = (hsize_t) SHARED_FILTERED_CHUNKS_NCOLS / 2; - stride[0] = 2; - stride[1] = (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS; + count[0] = (hsize_t) (INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS); + count[1] = (hsize_t) (INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS); + stride[0] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS; + stride[1] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS; block[0] = 1; - block[1] = 1; - offset[0] = (hsize_t) mpi_rank / (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS; - offset[1] = (hsize_t) mpi_rank % (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS; + block[1] = (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS; + offset[0] = (hsize_t) mpi_rank; + offset[1] = 0; if (VERBOSE_MED) printf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], offset[ %llu, %llu ], block size[ %llu, %llu ]\n", @@ -1060,9 +1038,14 @@ test_filtered_dataset_interleaved_write(void) data[i] = (C_DATATYPE) GEN_DATA(i); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) - correct_buf[i] = (C_DATATYPE) (((i % (hsize_t) SHARED_FILTERED_CHUNKS_NCOLS) / (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS) - + ((i % (hsize_t) SHARED_FILTERED_CHUNKS_NCOLS) % (hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS) - + ((hsize_t) SHARED_FILTERED_CHUNKS_CH_NCOLS * (i / (hsize_t) SHARED_FILTERED_CHUNKS_NCOLS))); + /* Add Column Index */ + correct_buf[i] = (C_DATATYPE) ( (i % (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS) + + /* Add the Row Index */ + + ((i % (hsize_t) (mpi_size * INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS)) / (hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS) + + /* Add the amount that gets added when a rank moves down to its next section vertically in the dataset */ + + ((hsize_t) INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS * (i / (hsize_t) (mpi_size * INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS)))); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -1448,8 +1431,8 @@ test_3d_filtered_dataset_overlap(void) chunk_dims[0] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NROWS; chunk_dims[1] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; chunk_dims[2] = 1; - sel_dims[0] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_NROWS / 2; - sel_dims[1] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_NCOLS / 2; + sel_dims[0] = (hsize_t) (SHARED_FILTERED_CHUNKS_3D_NROWS / mpi_size); + sel_dims[1] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_NCOLS; sel_dims[2] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_DEPTH; filespace = H5Screate_simple(SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS, dataset_dims, NULL); @@ -1477,17 +1460,17 @@ test_3d_filtered_dataset_overlap(void) /* Each process defines the dataset selection in memory and writes * it to the hyperslab in the file */ - count[0] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_NROWS / 2; - count[1] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_NCOLS / 2; + count[0] = (hsize_t) (SHARED_FILTERED_CHUNKS_3D_NROWS / SHARED_FILTERED_CHUNKS_3D_CH_NROWS); + count[1] = (hsize_t) (SHARED_FILTERED_CHUNKS_3D_NCOLS / SHARED_FILTERED_CHUNKS_3D_CH_NCOLS); count[2] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_DEPTH; - stride[0] = 2; + stride[0] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NROWS; stride[1] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; stride[2] = 1; block[0] = 1; - block[1] = 1; + block[1] = (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; block[2] = 1; - offset[0] = (hsize_t) mpi_rank / (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; - offset[1] = (hsize_t) mpi_rank % (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NCOLS; + offset[0] = (hsize_t) mpi_rank; + offset[1] = 0; offset[2] = 0; if (VERBOSE_MED) @@ -1513,40 +1496,15 @@ test_3d_filtered_dataset_overlap(void) for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE) GEN_DATA(i); - /* This style of data verification is very ugly for cases like this, - * but avoids the problem of needing to have each rank send its data - * plus its selection to a single rank, then have that rank scatter - * all of the data one at a time to a single buffer and finally - * compare that buffer to the read buffer. - JTH - */ for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) - /* Start with a base index */ - correct_buf[i] = (C_DATATYPE) ((i % (hsize_t) mpi_size) - - /* Add the value for the increasing column index */ - + ( (hsize_t) mpi_size * - ( - (i % (hsize_t) (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH)) - / (hsize_t) (mpi_size * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS) - ) - ) - - /* Add the value for the increasing row index */ - + ( - (hsize_t) (SHARED_FILTERED_CHUNKS_3D_NCOLS * (SHARED_FILTERED_CHUNKS_3D_CH_NROWS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS / mpi_size)) - * (i / (hsize_t) (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH * (SHARED_FILTERED_CHUNKS_3D_CH_NROWS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS / mpi_size))) - ) - - /* Add the value for the increasing row index in a particular chunk */ - + ( (hsize_t) SHARED_FILTERED_CHUNKS_3D_CH_NCOLS * - ( - (i % (hsize_t) (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH * (SHARED_FILTERED_CHUNKS_3D_CH_NROWS * SHARED_FILTERED_CHUNKS_3D_CH_NCOLS / mpi_size))) - / (hsize_t) (SHARED_FILTERED_CHUNKS_3D_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH) - ) - ) - - /* Add the value for the increasing column index in a particular chunk */ - + ((i % (hsize_t) (SHARED_FILTERED_CHUNKS_3D_CH_NCOLS * SHARED_FILTERED_CHUNKS_3D_DEPTH)) / (hsize_t) mpi_size)); + /* Add the Column Index */ + correct_buf[i] = (C_DATATYPE) ( (i % (hsize_t) (SHARED_FILTERED_CHUNKS_3D_DEPTH * SHARED_FILTERED_CHUNKS_3D_NCOLS)) + + /* Add the Row Index */ + + ((i % (hsize_t) (mpi_size * SHARED_FILTERED_CHUNKS_3D_DEPTH * SHARED_FILTERED_CHUNKS_3D_NCOLS)) / (hsize_t) (SHARED_FILTERED_CHUNKS_3D_DEPTH * SHARED_FILTERED_CHUNKS_3D_NCOLS)) + + /* Add the amount that gets added when a rank moves down to its next section vertically in the dataset */ + + ((hsize_t) (SHARED_FILTERED_CHUNKS_3D_DEPTH * SHARED_FILTERED_CHUNKS_3D_NCOLS) * (i / (hsize_t) (mpi_size * SHARED_FILTERED_CHUNKS_3D_DEPTH * SHARED_FILTERED_CHUNKS_3D_NCOLS)))); /* Create property list for collective dataset write */ plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -2507,7 +2465,7 @@ exit: ALARM_OFF; - /* XXX: h5_clean_files(FILENAME, fapl); */ + h5_clean_files(FILENAME, fapl); H5close(); diff --git a/testpar/t_filters_parallel.h b/testpar/t_filters_parallel.h index 6999c27..d0f245d 100644 --- a/testpar/t_filters_parallel.h +++ b/testpar/t_filters_parallel.h @@ -111,19 +111,17 @@ size_t cd_nelmts = FILTER_NUM_CDVALUES; #define POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS (DIM1_SCALE_FACTOR) #define POINT_SELECTION_FILTERED_CHUNKS_NROWS (POINT_SELECTION_FILTERED_CHUNKS_CH_NROWS * mpi_size) #define POINT_SELECTION_FILTERED_CHUNKS_NCOLS (POINT_SELECTION_FILTERED_CHUNKS_CH_NCOLS * mpi_size) -#define POINT_SELECTION_FILTERED_CHUNKS_NUM_CHUNKS (mpi_size * mpi_size) /* Defines for the filtered dataset interleaved write test */ #define INTERLEAVED_WRITE_FILTERED_DATASET_NAME "interleaved_write_filtered_dataset" #define INTERLEAVED_WRITE_FILTERED_DATASET_DIMS 2 -#define INTERLEAVED_WRITE_FILTERED_DATASET_NROWS (mpi_size * DIM0_SCALE_FACTOR) /* Must be an even multiple of the number of ranks to avoid issues */ -#define INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS (mpi_size * DIM1_SCALE_FACTOR) /* Must be an even multiple of the number of ranks to avoid issues */ -#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS (INTERLEAVED_WRITE_FILTERED_DATASET_NROWS / mpi_size) -#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS (INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS / mpi_size) -#define INTERLEAVED_WRITE_FILTERED_DATASET_SEL_NPOINTS (INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS * INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS / INTERLEAVED_WRITE_FILTERED_DATASET_NUM_RANKS) +#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS (mpi_size) +#define INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS (DIM1_SCALE_FACTOR) +#define INTERLEAVED_WRITE_FILTERED_DATASET_NROWS (INTERLEAVED_WRITE_FILTERED_DATASET_CH_NROWS * DIM0_SCALE_FACTOR) +#define INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS (INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS * DIM1_SCALE_FACTOR) /* Defines for the 3D unshared filtered dataset separate page write test */ -#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME "3d_unshared_filtered_chunks_separate_pages" +#define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME "3D_unshared_filtered_chunks_separate_pages" #define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_DIMS 3 #define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NROWS (mpi_size * DIM0_SCALE_FACTOR) #define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS (mpi_size * DIM1_SCALE_FACTOR) @@ -132,7 +130,7 @@ size_t cd_nelmts = FILTER_NUM_CDVALUES; #define UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_NCOLS / mpi_size) /* Defines for the 3D unshared filtered dataset same page write test */ -#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME "3d_unshared_filtered_chunks_same_pages" +#define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME "3D_unshared_filtered_chunks_same_pages" #define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_DIMS 3 #define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NROWS (mpi_size * DIM0_SCALE_FACTOR) #define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS (mpi_size * DIM1_SCALE_FACTOR) @@ -141,13 +139,13 @@ size_t cd_nelmts = FILTER_NUM_CDVALUES; #define UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_CH_NCOLS (UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_NCOLS / mpi_size) /* Defines for the 3d shared filtered dataset write test */ -#define SHARED_FILTERED_CHUNKS_3D_DATASET_NAME "3d_shared_filtered_chunks" +#define SHARED_FILTERED_CHUNKS_3D_DATASET_NAME "3D_shared_filtered_chunks" #define SHARED_FILTERED_CHUNKS_3D_DATASET_DIMS 3 -#define SHARED_FILTERED_CHUNKS_3D_NROWS (mpi_size * DIM0_SCALE_FACTOR) -#define SHARED_FILTERED_CHUNKS_3D_NCOLS (mpi_size * DIM1_SCALE_FACTOR) +#define SHARED_FILTERED_CHUNKS_3D_CH_NROWS (mpi_size) +#define SHARED_FILTERED_CHUNKS_3D_CH_NCOLS (DIM1_SCALE_FACTOR) +#define SHARED_FILTERED_CHUNKS_3D_NROWS (SHARED_FILTERED_CHUNKS_3D_CH_NROWS * DIM0_SCALE_FACTOR) +#define SHARED_FILTERED_CHUNKS_3D_NCOLS (SHARED_FILTERED_CHUNKS_3D_CH_NCOLS * DIM1_SCALE_FACTOR) #define SHARED_FILTERED_CHUNKS_3D_DEPTH (mpi_size) -#define SHARED_FILTERED_CHUNKS_3D_CH_NROWS (SHARED_FILTERED_CHUNKS_3D_NROWS / mpi_size) -#define SHARED_FILTERED_CHUNKS_3D_CH_NCOLS (SHARED_FILTERED_CHUNKS_3D_NCOLS / mpi_size) /* Struct type for the compound datatype filtered dataset tests */ typedef struct { -- cgit v0.12 From 073f52424766cc4a8ac9d56966cb58c054ce3801 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 31 Aug 2017 13:37:38 -0500 Subject: HDFFV-10284 Add VS2017 support --- bin/release | 4 +- config/cmake/scripts/HDF5config.cmake | 102 +++++++++++++++++----------------- release_docs/INSTALL_CMake.txt | 67 ++++++++++++---------- 3 files changed, 92 insertions(+), 81 deletions(-) diff --git a/bin/release b/bin/release index 09c033d..6358b0d 100755 --- a/bin/release +++ b/bin/release @@ -214,12 +214,12 @@ tar2cmakezip() fi # step 2: add batch file for building CMake on window - cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2012-32.bat $cmziptmpdir - cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2012-64.bat $cmziptmpdir cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2013-32.bat $cmziptmpdir cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2013-64.bat $cmziptmpdir cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2015-32.bat $cmziptmpdir cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2015-64.bat $cmziptmpdir + cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2017-32.bat $cmziptmpdir + cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2017-64.bat $cmziptmpdir # step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmziptmpdir diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index e500f14..e7b73b3 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -11,8 +11,8 @@ # ############################################################################################# ### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### -### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ### -### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -VV -O hdf5.log ### +### BUILD_GENERATOR required [Unix, VS2017, VS201764, VS2015, VS201564, VS2013, VS201364] ### +### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log ### ############################################################################################# cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) @@ -21,13 +21,13 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log # where valid options for OPTION are: # BUILD_GENERATOR - The cmake build generator: -# Unix * Unix Makefiles +# Unix * Unix Makefiles +# VS2017 * Visual Studio 15 2017 +# VS201764 * Visual Studio 15 2017 Win64 # VS2015 * Visual Studio 14 2015 -# VS201564 * Visual Studio 14 2015 Win64 +# VS201564 * Visual Studio 14 2015 Win64 # VS2013 * Visual Studio 12 2013 -# VS201364 * Visual Studio 12 2013 Win64 -# VS2012 * Visual Studio 11 2012 -# VS201264 * Visual Studio 11 2012 Win64 +# VS201364 * Visual Studio 12 2013 Win64 # # INSTALLDIR - root folder where hdf5 is installed # CTEST_CONFIGURATION_TYPE - Release, Debug, etc @@ -65,25 +65,7 @@ endif () # build generator must be defined if (NOT DEFINED BUILD_GENERATOR) - message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") -else () - if (${BUILD_GENERATOR} STREQUAL "Unix") - set (CTEST_CMAKE_GENERATOR "Unix Makefiles") - elseif (${BUILD_GENERATOR} STREQUAL "VS2015") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") - elseif (${BUILD_GENERATOR} STREQUAL "VS201564") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") - elseif (${BUILD_GENERATOR} STREQUAL "VS2013") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") - elseif (${BUILD_GENERATOR} STREQUAL "VS201364") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") - elseif (${BUILD_GENERATOR} STREQUAL "VS2012") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") - elseif (${BUILD_GENERATOR} STREQUAL "VS201264") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - else () - message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") - endif () + message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") endif () ################################################################### @@ -135,31 +117,49 @@ endif () if (WIN32) set (SITE_OS_NAME "Windows") set (SITE_OS_VERSION "WIN7") - if (${BUILD_GENERATOR} STREQUAL "VS201564") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2015") - set (SITE_COMPILER_VERSION "14") - elseif (${BUILD_GENERATOR} STREQUAL "VS2015") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2015") - set (SITE_COMPILER_VERSION "14") - elseif (${BUILD_GENERATOR} STREQUAL "VS201364") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2013") - set (SITE_COMPILER_VERSION "12") - elseif (${BUILD_GENERATOR} STREQUAL "VS2013") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2013") - set (SITE_COMPILER_VERSION "12") - elseif (${BUILD_GENERATOR} STREQUAL "VS201264") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2012") - set (SITE_COMPILER_VERSION "11") - elseif (${BUILD_GENERATOR} STREQUAL "VS2012") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2012") - set (SITE_COMPILER_VERSION "11") - endif () + if (${BUILD_GENERATOR} STREQUAL "VS201764") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (${BUILD_GENERATOR} STREQUAL "VS2017") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (${BUILD_GENERATOR} STREQUAL "VS201564") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (${BUILD_GENERATOR} STREQUAL "VS2015") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (${BUILD_GENERATOR} STREQUAL "VS201364") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (${BUILD_GENERATOR} STREQUAL "VS2013") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (${BUILD_GENERATOR} STREQUAL "VS201264") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") + elseif (${BUILD_GENERATOR} STREQUAL "VS2012") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") + else () + message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + endif () ## Set the following to unique id your computer ## set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else () diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 7cb0225..e2489f4 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -656,10 +656,21 @@ The same scripts can be used on Linux, Mac OSX or a Windows machine by adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# ############################################################################################# ### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### -### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ### -### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -VV -O hdf5.log ### +### BUILD_GENERATOR required [Unix, VS2017, VS201764, VS2015, VS201564, VS2013, VS201364] ### +### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log ### ############################################################################################# cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) @@ -668,13 +679,13 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log # where valid options for OPTION are: # BUILD_GENERATOR - The cmake build generator: -# Unix * Unix Makefiles +# Unix * Unix Makefiles +# VS2017 * Visual Studio 15 2017 +# VS201764 * Visual Studio 15 2017 Win64 # VS2015 * Visual Studio 14 2015 -# VS201564 * Visual Studio 14 2015 Win64 +# VS201564 * Visual Studio 14 2015 Win64 # VS2013 * Visual Studio 12 2013 -# VS201364 * Visual Studio 12 2013 Win64 -# VS2012 * Visual Studio 11 2012 -# VS201264 * Visual Studio 11 2012 Win64 +# VS201364 * Visual Studio 12 2013 Win64 # # INSTALLDIR - root folder where hdf5 is installed # CTEST_CONFIGURATION_TYPE - Release, Debug, etc @@ -685,7 +696,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## -set (CTEST_SOURCE_VERSION 1.10.1) +set (CTEST_SOURCE_VERSION "1.11.0") set (CTEST_SOURCE_VERSEXT "") ############################################################################## @@ -712,25 +723,7 @@ endif () # build generator must be defined if (NOT DEFINED BUILD_GENERATOR) - message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") -else () - if (${BUILD_GENERATOR} STREQUAL "Unix") - set (CTEST_CMAKE_GENERATOR "Unix Makefiles") - elseif (${BUILD_GENERATOR} STREQUAL "VS2015") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") - elseif (${BUILD_GENERATOR} STREQUAL "VS201564") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") - elseif (${BUILD_GENERATOR} STREQUAL "VS2013") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") - elseif (${BUILD_GENERATOR} STREQUAL "VS201364") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") - elseif (${BUILD_GENERATOR} STREQUAL "VS2012") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") - elseif (${BUILD_GENERATOR} STREQUAL "VS201264") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - else () - message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") - endif () + message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") endif () ################################################################### @@ -782,30 +775,48 @@ endif () if (WIN32) set (SITE_OS_NAME "Windows") set (SITE_OS_VERSION "WIN7") - if (${BUILD_GENERATOR} STREQUAL "VS201564") + if (${BUILD_GENERATOR} STREQUAL "VS201764") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (${BUILD_GENERATOR} STREQUAL "VS2017") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (${BUILD_GENERATOR} STREQUAL "VS201564") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") set (SITE_OS_BITS "64") set (SITE_COMPILER_NAME "vs2015") set (SITE_COMPILER_VERSION "14") elseif (${BUILD_GENERATOR} STREQUAL "VS2015") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") set (SITE_OS_BITS "32") set (SITE_COMPILER_NAME "vs2015") set (SITE_COMPILER_VERSION "14") elseif (${BUILD_GENERATOR} STREQUAL "VS201364") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") set (SITE_OS_BITS "64") set (SITE_COMPILER_NAME "vs2013") set (SITE_COMPILER_VERSION "12") elseif (${BUILD_GENERATOR} STREQUAL "VS2013") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") set (SITE_OS_BITS "32") set (SITE_COMPILER_NAME "vs2013") set (SITE_COMPILER_VERSION "12") elseif (${BUILD_GENERATOR} STREQUAL "VS201264") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") set (SITE_OS_BITS "64") set (SITE_COMPILER_NAME "vs2012") set (SITE_COMPILER_VERSION "11") elseif (${BUILD_GENERATOR} STREQUAL "VS2012") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") set (SITE_OS_BITS "32") set (SITE_COMPILER_NAME "vs2012") set (SITE_COMPILER_VERSION "11") + else () + message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") endif () ## Set the following to unique id your computer ## set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") -- cgit v0.12 From 2959faa5752e4a6985ded94e0160ab32366ebc0c Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 31 Aug 2017 15:05:13 -0500 Subject: Update documentation --- src/H5Dmpio.c | 197 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 158 insertions(+), 39 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 5b415c5..4f839a8 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -93,29 +93,111 @@ typedef struct H5D_chunk_addr_info_t { H5D_chunk_info_t chunk_info; } H5D_chunk_addr_info_t; -/* Information about a single chunk when performing collective filtered I/O */ +/* + * Information about a single chunk when performing collective filtered I/O. All + * of the fields of one of these structs are initialized at the start of collective + * filtered I/O in the function H5D__construct_filtered_io_info_list(). + * + * This struct's fields are as follows: + * + * index - The "Index" of the chunk in the dataset. The index of a chunk is used during + * the collective re-insertion of chunks into the chunk index after the collective + * I/O has been performed. + * + * scaled - The scaled coordinates of the chunk in the dataset's file dataspace. The + * coordinates are used in both the collective re-allocation of space in the file + * and the collective re-insertion of chunks into the chunk index after the collective + * I/O has been performed. + * + * full_overwrite - A flag which determines whether or not a chunk needs to be read from the + * file when being updated. If a chunk is being fully overwritten (the entire + * extent is selected in its file dataspace), then it is not necessary to + * read the chunk from the file. However, if the chunk is not being fully + * overwritten, it has to be read from the file in order to update the chunk + * without trashing the parts of the chunk that are not selected. + * + * num_writers - The total number of processors writing to this chunk. This field is used + * when the new owner of a chunk is receiving messages, which contain selections in + * the chunk and data to update the chunk with, from other processors which have this + * chunk selected in the I/O operation. The new owner must know how many processors it + * should expect messages from so that it can post an equal number of receive calls. + * + * io_size - The total size of I/O to this chunk. This field is an accumulation of the size of + * I/O to the chunk from each processor which has the chunk selected and is used to + * determine the value for the previous full_overwrite flag. + * + * buf - A pointer which serves the dual purpose of holding either the chunk data which is to be + * written to the file or the chunk data which has been read from the file. + * + * chunk_states - In the case of dataset writes only, this struct is used to track a chunk's size and + * address in the file before and after the filtering operation has occurred. + * + * Its fields are as follows: + * + * chunk_current - The address in the file and size of this chunk before the filtering + * operation. When reading a chunk from the file, this field is used to + * read the correct amount of bytes. It is also used when redistributing + * shared chunks among processors and as a parameter to the chunk file + * space reallocation function. + * + * new_chunk - The address in the file and size of this chunk after the filtering + * operation. This field is relevant when collectively re-allocating space + * in the file for all of the chunks written to in the I/O operation, as + * their sizes may have changed after their data has been filtered. + * + * owners - In the case of dataset writes only, this struct is used to manage which single processor + * will ultimately write data out to the chunk. It allows the other processors to act according + * to the decision and send their selection in the chunk, as well as the data they wish + * to update the chunk with, to the processor which is writing to the chunk. + * + * Its fields are as follows: + * + * original_owner - The processor which originally had this chunk selected at the beginning of + * the collective filtered I/O operation. This field is currently used when + * redistributing shared chunks among processors. + * + * new_owner - The processor which has been selected to perform the write to this chunk. + * + * async_info - In the case of dataset writes only, this struct is used by the owning processor of the + * chunk in order to manage the MPI send and receive calls made between it and all of + * the other processors which have this chunk selected in the I/O operation. + * + * Its fields are as follows: + * + * receive_requests_array - An array containing one MPI_Request for each of the + * asynchronous MPI receive calls the owning processor of this + * chunk makes to another processor in order to receive that + * processor's chunk modification data and selection in the chunk. + * + * receive_buffer_array - An array of buffers into which the owning processor of this chunk + * will store chunk modification data and the selection in the chunk + * received from another processor. + * + * num_receive_requests - The number of entries in the receive_request_array and + * receive_buffer_array fields. + */ typedef struct H5D_filtered_collective_io_info_t { - hsize_t index; /* "Index" of chunk in dataset */ - hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Scaled coordinates of chunk (in file dataset's dataspace) */ - hbool_t full_overwrite; /* Whether or not this chunk is being fully overwritten */ - size_t num_writers; /* Total number of processes writing to this chunk */ - size_t io_size; /* Size of the I/O to this chunk */ - void *buf; /* Chunk data to be written to file/that has been read from file*/ + hsize_t index; + hsize_t scaled[H5O_LAYOUT_NDIMS]; + hbool_t full_overwrite; + size_t num_writers; + size_t io_size; + void *buf; struct { - H5F_block_t chunk_current; /* The address in the file and size of this chunk before the I/O and filtering operations */ - H5F_block_t new_chunk; /* The address in the file and size of this chunk after the I/O and filtering operations */ + H5F_block_t chunk_current; + H5F_block_t new_chunk; } chunk_states; struct { - int original_owner; /* The process which originally had this chunk selected in the I/O operation */ - int new_owner; /* The process which the chunk has been re-assigned to */ + int original_owner; + int new_owner; } owners; struct { - MPI_Request *receive_requests_array; /* Array of receive requests posted to receive chunk modification data from other processes */ - unsigned char **receive_buffer_array; /* Array of receive buffers to store chunk modification data from other processes */ - int num_receive_requests; /* Number of entries in the receive_requests_array and receive_buffer_array arrays */ + MPI_Request *receive_requests_array; + unsigned char **receive_buffer_array; + int num_receive_requests; } async_info; } H5D_filtered_collective_io_info_t; @@ -346,16 +428,26 @@ done: /*------------------------------------------------------------------------- * Function: H5D__mpio_array_gatherv * - * Purpose: Given arrays by MPI ranks, gathers them into a single array - * which is either gathered to the rank specified by root when - * allgather is false, or is distributed back to all ranks - * when allgather is true. The number of processes - * participating in the gather operation should be specified - * for nprocs and the MPI communicator to use should be - * specified for comm. If the sort_func argument is - * specified, the list is sorted before being returned. + * Purpose: Given an array, specified in local_array, by each processor + * calling this function, gathers each array into a single + * array which is then either gathered to the processor + * specified by root, when allgather is false, or is + * distributed back to all processors when allgather is true. + * + * The size of each entry and number of entries in the array + * contributed by an individual processor should be specified + * in array_entry_size and local_array_num_entries, + * respectively. * - * If allgather is specified as true, root is ignored. + * The number of processors participating in the gather + * operation should be specified for nprocs. + * + * The MPI communicator to use should be specified for comm. + * + * If the sort_func argument is supplied, the array is sorted + * before the function returns. + * + * Note: if allgather is specified as true, root is ignored. * * Return: Non-negative on success/Negative on failure * @@ -371,9 +463,9 @@ H5D__mpio_array_gatherv(void *local_array, size_t local_array_num_entries, { size_t gathered_array_num_entries = 0; /* The size of the newly-constructed array */ size_t i; - void *gathered_array = NULL; /* The newly-constructed array returned to the caller */ - int *receive_counts_array = NULL; /* Array containing number of entries each process is contributing */ - int *displacements_array = NULL; /* Array of displacements where each process places its data in the final array */ + void *gathered_array = NULL; /* The newly-constructed array returned to the caller */ + int *receive_counts_array = NULL; /* Array containing number of entries each process is contributing */ + int *displacements_array = NULL; /* Array of displacements where each process places its data in the final array */ int mpi_code; int sendcount; herr_t ret_value = SUCCEED; @@ -836,17 +928,17 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf if (io_info->op_type == H5D_IO_OP_READ) { if(H5D__multi_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple filtered chunk MPI-IO") - } + } /* end if */ else { if(H5D__link_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish filtered linked chunk MPI-IO") - } - } + } /* end else */ + } /* end if */ else { /* Perform unfiltered link chunk collective IO */ if(H5D__link_chunk_collective_io(io_info, type_info, fm, sum_chunk, dx_plist) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish linked chunk MPI-IO") - } + } /* end else */ break; case H5D_MULTI_CHUNK_IO: /* direct request to do multi-chunk IO */ @@ -855,12 +947,12 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf if(io_info->dset->shared->dcpl_cache.pline.nused > 0) { if(H5D__multi_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple filtered chunk MPI-IO") - } + } /* end if */ else { /* Perform unfiltered multi chunk collective IO */ if(H5D__multi_chunk_collective_io(io_info, type_info, fm, dx_plist) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple chunk MPI-IO") - } + } /* end else */ break; } /* end switch */ @@ -1703,8 +1795,12 @@ done: /*------------------------------------------------------------------------- * Function: H5D__multi_chunk_filtered_collective_io * - * Purpose: To do filtered collective IO per chunk to save on memory, - * as opposed to collective IO of every chunk at once + * Purpose: To do filtered collective IO iteratively to save on memory. + * While link_chunk_filtered_collective_io will construct and + * work on a list of all of the chunks selected in the IO + * operation at once, this function works iteratively on a set + * of chunks at a time; at most one chunk per rank per + * iteration. * * 1. Construct a list of selected chunks in the collective IO * operation @@ -2716,11 +2812,28 @@ done: * to preserve file integrity after the write by ensuring * that any shared chunks are only modified by one process. * - * The current implementation simply hands the list off to - * rank 0, which then scans the list and for each shared - * chunk, it redistributes the chunk to the process writing - * to the chunk which currently has the least amount of chunks - * assigned to it. + * The current implementation follows this 3-phase process: + * + * - Collect everyone's list of chunks into one large list, + * sort the list in increasing order of chunk offset in the + * file and hand the list off to rank 0 + * + * - Rank 0 scans the list looking for matching runs of chunk + * offset in the file (corresponding to a shared chunk which + * has been selected by more than one rank in the I/O + * operation) and for each shared chunk, it redistributes + * the chunk to the process writing to the chunk which + * currently has the least amount of chunks assigned to it + * by modifying the "new_owner" field in each of the list + * entries corresponding to that chunk + * + * - After the chunks have been redistributed, rank 0 re-sorts + * the list in order of previous owner so that each rank + * will get back exactly the array that they contributed to + * the redistribution operation, with the "new_owner" field + * of each chunk they are modifying having possibly been + * modified. Rank 0 then scatters each segment of the list + * back to its corresponding rank * * Return: Non-negative on success/Negative on failure * @@ -2768,6 +2881,9 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(H5S_sel_iter_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") + /* Gather every rank's list of chunks to rank 0 to allow it to perform the redistribution operation. After this + * call, the gathered list will initially be sorted in increasing order of chunk offset in the file. + */ if (H5D__mpio_array_gatherv(local_chunk_array, *local_chunk_array_num_entries, sizeof(*local_chunk_array), (void **) &shared_chunks_info_array, &shared_chunks_info_array_num_entries, mpi_size, false, 0, io_info->comm, H5D__cmp_filtered_collective_io_info_entry) < 0) @@ -3215,6 +3331,9 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk chunk_entry->async_info.receive_requests_array, MPI_STATUSES_IGNORE))) HMPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code) + /* For each asynchronous receive call previously posted, receive the chunk modification + * buffer from another rank and update the chunk data + */ for (i = 0; i < (size_t) chunk_entry->async_info.num_receive_requests; i++) { const unsigned char *mod_data_p; -- cgit v0.12 From 89f65fc97ee28270ee06978fcab2865dd345140e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 31 Aug 2017 15:58:37 -0500 Subject: HDFFV-9774 Add enable-error-stack argument to h5diff --- MANIFEST | 12 + release_docs/RELEASE.txt | 12 +- tools/lib/h5diff.c | 281 +++++++--------- tools/lib/h5tools_error.h | 8 + tools/src/h5copy/h5copy.c | 2 + tools/src/h5diff/h5diff_common.c | 432 ++++++++++++------------- tools/src/h5diff/h5diff_main.c | 27 +- tools/src/h5diff/ph5diff_main.c | 2 + tools/test/h5diff/CMakeTests.cmake | 106 ++++++ tools/test/h5diff/testfiles/h5diff_10.txt | 2 + tools/test/h5diff/testfiles/h5diff_454_ERR.err | 4 + tools/test/h5diff/testfiles/h5diff_454_ERR.txt | 6 + tools/test/h5diff/testfiles/h5diff_455_ERR.err | 4 + tools/test/h5diff/testfiles/h5diff_455_ERR.txt | 6 + tools/test/h5diff/testfiles/h5diff_457_ERR.err | 4 + tools/test/h5diff/testfiles/h5diff_457_ERR.txt | 6 + tools/test/h5diff/testfiles/h5diff_458_ERR.err | 4 + tools/test/h5diff/testfiles/h5diff_458_ERR.txt | 6 + tools/test/h5diff/testfiles/h5diff_459_ERR.err | 4 + tools/test/h5diff/testfiles/h5diff_459_ERR.txt | 6 + tools/test/h5diff/testfiles/h5diff_600.txt | 2 + tools/test/h5diff/testfiles/h5diff_601_ERR.err | 4 + tools/test/h5diff/testfiles/h5diff_601_ERR.txt | 6 + tools/test/h5diff/testfiles/h5diff_603.txt | 2 + tools/test/h5diff/testfiles/h5diff_606.txt | 2 + tools/test/h5diff/testfiles/h5diff_612.txt | 2 + tools/test/h5diff/testfiles/h5diff_615.txt | 2 + tools/test/h5diff/testfiles/h5diff_621.txt | 2 + tools/test/h5diff/testfiles/h5diff_622.txt | 2 + tools/test/h5diff/testfiles/h5diff_623.txt | 2 + tools/test/h5diff/testfiles/h5diff_624.txt | 2 + 31 files changed, 568 insertions(+), 394 deletions(-) create mode 100644 tools/test/h5diff/testfiles/h5diff_454_ERR.err create mode 100644 tools/test/h5diff/testfiles/h5diff_454_ERR.txt create mode 100644 tools/test/h5diff/testfiles/h5diff_455_ERR.err create mode 100644 tools/test/h5diff/testfiles/h5diff_455_ERR.txt create mode 100644 tools/test/h5diff/testfiles/h5diff_457_ERR.err create mode 100644 tools/test/h5diff/testfiles/h5diff_457_ERR.txt create mode 100644 tools/test/h5diff/testfiles/h5diff_458_ERR.err create mode 100644 tools/test/h5diff/testfiles/h5diff_458_ERR.txt create mode 100644 tools/test/h5diff/testfiles/h5diff_459_ERR.err create mode 100644 tools/test/h5diff/testfiles/h5diff_459_ERR.txt create mode 100644 tools/test/h5diff/testfiles/h5diff_601_ERR.err create mode 100644 tools/test/h5diff/testfiles/h5diff_601_ERR.txt diff --git a/MANIFEST b/MANIFEST index 934ffaa..9f85568 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2203,6 +2203,8 @@ ./tools/test/h5diff/testfiles/h5diff_63.txt ./tools/test/h5diff/testfiles/h5diff_600.txt ./tools/test/h5diff/testfiles/h5diff_601.txt +./tools/test/h5diff/testfiles/h5diff_601_ERR.err +./tools/test/h5diff/testfiles/h5diff_601_ERR.txt ./tools/test/h5diff/testfiles/h5diff_603.txt ./tools/test/h5diff/testfiles/h5diff_604.txt ./tools/test/h5diff/testfiles/h5diff_605.txt @@ -2309,11 +2311,21 @@ ./tools/test/h5diff/testfiles/h5diff_452.txt ./tools/test/h5diff/testfiles/h5diff_453.txt ./tools/test/h5diff/testfiles/h5diff_454.txt +./tools/test/h5diff/testfiles/h5diff_454_ERR.err +./tools/test/h5diff/testfiles/h5diff_454_ERR.txt ./tools/test/h5diff/testfiles/h5diff_455.txt +./tools/test/h5diff/testfiles/h5diff_455_ERR.err +./tools/test/h5diff/testfiles/h5diff_455_ERR.txt ./tools/test/h5diff/testfiles/h5diff_456.txt ./tools/test/h5diff/testfiles/h5diff_457.txt +./tools/test/h5diff/testfiles/h5diff_457_ERR.err +./tools/test/h5diff/testfiles/h5diff_457_ERR.txt ./tools/test/h5diff/testfiles/h5diff_458.txt +./tools/test/h5diff/testfiles/h5diff_458_ERR.err +./tools/test/h5diff/testfiles/h5diff_458_ERR.txt ./tools/test/h5diff/testfiles/h5diff_459.txt +./tools/test/h5diff/testfiles/h5diff_459_ERR.err +./tools/test/h5diff/testfiles/h5diff_459_ERR.txt ./tools/test/h5diff/testfiles/h5diff_465.txt ./tools/test/h5diff/testfiles/h5diff_466.txt ./tools/test/h5diff/testfiles/h5diff_467.txt diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 3f9e9c0..64015ba 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -96,7 +96,17 @@ New Features Tools: ------ - - + - h5diff + + h5diff has new option enable-error-stack. + + Updated h5diff with the --enable-error-stack argument, which + enables the display of the hdf5 error stack. This completes the + improvement to the main tools; h5copy, h5diff, h5dump, h5ls and + h5repack. + + (ADB - 2017/08/30, HDFFV-9774) + High-Level APIs: --------------- diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 9da5b6b..0be6f5c 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -449,32 +449,27 @@ static herr_t trav_grp_objs(const char *path, const H5O_info_t *oinfo, static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, void *udata) { - trav_info_t *tinfo = (trav_info_t *)udata; - diff_opt_t *opts = (diff_opt_t *)tinfo->opts; - int ret; + int ret_value = 0; + trav_info_t *tinfo = (trav_info_t *)udata; + diff_opt_t *opts = (diff_opt_t *)tinfo->opts; h5tool_link_info_t lnk_info; - const char *ext_fname; - const char *ext_path; + const char *ext_fname; + const char *ext_path; /* init linkinfo struct */ HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t)); - if (!opts->follow_links) - { + if (!opts->follow_links) { trav_info_visit_lnk(path, linfo, tinfo); goto done; } - switch(linfo->type) - { + switch(linfo->type) { case H5L_TYPE_SOFT: - ret = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links); - /* error */ - if (ret < 0) + if((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) goto done; /* no dangling link option given and detect dangling link */ - else if (ret == 0) - { + else if (ret_value == 0) { tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) @@ -491,22 +486,18 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, goto done; if(h5trav_visit(tinfo->fid, path, TRUE, TRUE, - trav_grp_objs,trav_grp_symlinks, tinfo) < 0) - { + trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { parallel_print("Error: Could not get file contents\n"); opts->err_stat = 1; - goto done; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); } break; case H5L_TYPE_EXTERNAL: - ret = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links); - /* error */ - if (ret < 0) + if ((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) goto done; /* no dangling link option given and detect dangling link */ - else if (ret == 0) - { + else if (ret_value == 0) { tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) @@ -526,11 +517,10 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, goto done; if(h5trav_visit(tinfo->fid, path, TRUE, TRUE, - trav_grp_objs,trav_grp_symlinks, tinfo) < 0) - { + trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { parallel_print("Error: Could not get file contents\n"); opts->err_stat = 1; - goto done; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents\n"); } break; @@ -540,7 +530,7 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, default: parallel_print("Error: Invalid link type\n"); opts->err_stat = 1; - goto done; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Invalid link type"); break; } /* end of switch */ @@ -569,8 +559,9 @@ hsize_t h5diff(const char *fname1, const char *fname2, const char *objname1, const char *objname2, - diff_opt_t *options) + diff_opt_t *opts) { + int ret_value = 0; hid_t file1_id = (-1); hid_t file2_id = (-1); char filenames[2][MAX_FILENAME]; @@ -612,10 +603,10 @@ hsize_t h5diff(const char *fname1, /*------------------------------------------------------------------------- * check invalid combination of options *-----------------------------------------------------------------------*/ - if(!is_valid_options(options)) - goto out; + if(!is_valid_options(opts)) + goto done; - options->cmn_objs = 1; /* eliminate warning */ + opts->cmn_objs = 1; /* eliminate warning */ /*------------------------------------------------------------------------- * open the files first; if they are not valid, no point in continuing @@ -626,20 +617,18 @@ hsize_t h5diff(const char *fname1, H5E_BEGIN_TRY { /* open file 1 */ - if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) - { + if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname1); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + goto done; } /* end if */ /* open file 2 */ - if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) - { + if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname2); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + goto done; } /* end if */ /* enable error reporting */ } H5E_END_TRY; @@ -653,15 +642,13 @@ hsize_t h5diff(const char *fname1, h5difftrace("trav_info_init initialized\n"); /* if any object is specified */ - if (objname1) - { + if (objname1) { /* make the given object1 fullpath, start with "/" */ - if (HDstrncmp(objname1, "/", 1)) - { + if (HDstrncmp(objname1, "/", 1)) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj1fullname, "/%s", objname1) < 0) - goto out; + goto done; #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ obj1fullname = (char*)HDmalloc(HDstrlen(objname1) + 2); @@ -673,12 +660,11 @@ hsize_t h5diff(const char *fname1, obj1fullname = HDstrdup(objname1); /* make the given object2 fullpath, start with "/" */ - if (HDstrncmp(objname2, "/", 1)) - { + if (HDstrncmp(objname2, "/", 1)) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj2fullname, "/%s", objname2) < 0) - goto out; + goto done; #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ obj2fullname = (char*)HDmalloc(HDstrlen(objname2) + 2); @@ -693,24 +679,21 @@ hsize_t h5diff(const char *fname1, * check if obj1 is root, group, single object or symlink */ h5difftrace("h5diff check if obj1 is root, group, single object or symlink\n"); - if(!HDstrcmp(obj1fullname, "/")) - { + if(!HDstrcmp(obj1fullname, "/")) { obj1type = H5TRAV_TYPE_GROUP; } - else - { + else { /* check if link itself exist */ - if(H5Lexists(file1_id, obj1fullname, H5P_DEFAULT) <= 0) - { + if(H5Lexists(file1_id, obj1fullname, H5P_DEFAULT) <= 0) { parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); } /* get info from link */ - if(H5Lget_info(file1_id, obj1fullname, &src_linfo1, H5P_DEFAULT) < 0) - { + if(H5Lget_info(file1_id, obj1fullname, &src_linfo1, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj1fullname); - goto out; + H5TOOLS_INFO(H5E_tools_min_id_g, "Unable to get link info\n"); + goto done; } info1_lp = info1_obj; @@ -718,18 +701,16 @@ hsize_t h5diff(const char *fname1, /* * check the type of specified path for hard and symbolic links */ - if(src_linfo1.type == H5L_TYPE_HARD) - { + if(src_linfo1.type == H5L_TYPE_HARD) { size_t idx; /* optional data pass */ - info1_obj->opts = (diff_opt_t*)options; + info1_obj->opts = (diff_opt_t*)opts; - if(H5Oget_info_by_name(file1_id, obj1fullname, &oinfo1, H5P_DEFAULT) < 0) - { + if(H5Oget_info_by_name(file1_id, obj1fullname, &oinfo1, H5P_DEFAULT) < 0) { parallel_print("Error: Could not get file contents\n"); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); } obj1type = (h5trav_type_t)oinfo1.type; trav_info_add(info1_obj, obj1fullname, obj1type); @@ -737,13 +718,11 @@ hsize_t h5diff(const char *fname1, info1_obj->paths[idx].objno = oinfo1.addr; info1_obj->paths[idx].fileno = oinfo1.fileno; } - else if (src_linfo1.type == H5L_TYPE_SOFT) - { + else if (src_linfo1.type == H5L_TYPE_SOFT) { obj1type = H5TRAV_TYPE_LINK; trav_info_add(info1_obj, obj1fullname, obj1type); } - else if (src_linfo1.type == H5L_TYPE_EXTERNAL) - { + else if (src_linfo1.type == H5L_TYPE_EXTERNAL) { obj1type = H5TRAV_TYPE_UDLINK; trav_info_add(info1_obj, obj1fullname, obj1type); } @@ -753,24 +732,20 @@ hsize_t h5diff(const char *fname1, * check if obj2 is root, group, single object or symlink */ h5difftrace("h5diff check if obj2 is root, group, single object or symlink\n"); - if(!HDstrcmp(obj2fullname, "/")) - { + if(!HDstrcmp(obj2fullname, "/")) { obj2type = H5TRAV_TYPE_GROUP; } - else - { + else { /* check if link itself exist */ - if(H5Lexists(file2_id, obj2fullname, H5P_DEFAULT) <= 0) - { + if(H5Lexists(file2_id, obj2fullname, H5P_DEFAULT) <= 0) { parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); } /* get info from link */ - if(H5Lget_info(file2_id, obj2fullname, &src_linfo2, H5P_DEFAULT) < 0) - { + if(H5Lget_info(file2_id, obj2fullname, &src_linfo2, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj2fullname); - goto out; + goto done; } info2_lp = info2_obj; @@ -778,18 +753,16 @@ hsize_t h5diff(const char *fname1, /* * check the type of specified path for hard and symbolic links */ - if(src_linfo2.type == H5L_TYPE_HARD) - { + if(src_linfo2.type == H5L_TYPE_HARD) { size_t idx; /* optional data pass */ - info2_obj->opts = (diff_opt_t*)options; + info2_obj->opts = (diff_opt_t*)opts; - if(H5Oget_info_by_name(file2_id, obj2fullname, &oinfo2, H5P_DEFAULT) < 0) - { + if(H5Oget_info_by_name(file2_id, obj2fullname, &oinfo2, H5P_DEFAULT) < 0) { parallel_print("Error: Could not get file contents\n"); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); } obj2type = (h5trav_type_t)oinfo2.type; trav_info_add(info2_obj, obj2fullname, obj2type); @@ -797,21 +770,18 @@ hsize_t h5diff(const char *fname1, info2_obj->paths[idx].objno = oinfo2.addr; info2_obj->paths[idx].fileno = oinfo2.fileno; } - else if (src_linfo2.type == H5L_TYPE_SOFT) - { + else if (src_linfo2.type == H5L_TYPE_SOFT) { obj2type = H5TRAV_TYPE_LINK; trav_info_add(info2_obj, obj2fullname, obj2type); } - else if (src_linfo2.type == H5L_TYPE_EXTERNAL) - { + else if (src_linfo2.type == H5L_TYPE_EXTERNAL) { obj2type = H5TRAV_TYPE_UDLINK; trav_info_add(info2_obj, obj2fullname, obj2type); } } } /* if no object specified */ - else - { + else { h5difftrace("h5diff no object specified\n"); /* set root group */ obj1fullname = (char*)HDstrdup("/"); @@ -822,16 +792,15 @@ hsize_t h5diff(const char *fname1, /* get any symbolic links info */ - l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, options->follow_links); - l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, options->follow_links); + l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, opts->follow_links); + l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, opts->follow_links); /*--------------------------------------------- * check for following symlinks */ - if (options->follow_links) - { + if (opts->follow_links) { /* pass how to handle printing warning to linkinfo option */ - if(print_warn(options)) + if(print_warn(opts)) trg_linfo1.opt.msg_mode = trg_linfo2.opt.msg_mode = 1; /*------------------------------- @@ -839,37 +808,31 @@ hsize_t h5diff(const char *fname1, */ h5difftrace("h5diff check symbolic link (object1)\n"); /* dangling link */ - if (l_ret1 == 0) - { + if (l_ret1 == 0) { h5difftrace("h5diff ... dangling link\n"); - if (options->no_dangle_links) - { - /* treat dangling link is error */ - if(options->m_verbose) + if (opts->no_dangle_links) { + /* treat dangling link as error */ + if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj1fullname); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: treat dangling link as error"); } - else - { - if(options->m_verbose) + else { + if(opts->m_verbose) parallel_print("obj1 <%s> is a dangling link.\n", obj1fullname); - if (l_ret1 != 0 || l_ret2 != 0) - { + if (l_ret1 != 0 || l_ret2 != 0) { nfound++; print_found(nfound); - goto out; + goto done; } } } - else if(l_ret1 < 0) /* fail */ - { + else if(l_ret1 < 0) { /* fail */ parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); } - else if(l_ret1 != 2) /* symbolic link */ - { + else if(l_ret1 != 2) { /* symbolic link */ obj1type = (h5trav_type_t)trg_linfo1.trg_type; h5difftrace("h5diff ... ... trg_linfo1.trg_type == H5L_TYPE_HARD\n"); if (info1_lp != NULL) { @@ -888,37 +851,31 @@ hsize_t h5diff(const char *fname1, */ h5difftrace("h5diff check symbolic link (object2)\n"); /* dangling link */ - if (l_ret2 == 0) - { + if (l_ret2 == 0) { h5difftrace("h5diff ... dangling link\n"); - if (options->no_dangle_links) - { - /* treat dangling link is error */ - if(options->m_verbose) + if (opts->no_dangle_links) { + /* treat dangling link as error */ + if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj2fullname); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: treat dangling link as error"); } - else - { - if(options->m_verbose) + else { + if(opts->m_verbose) parallel_print("obj2 <%s> is a dangling link.\n", obj2fullname); - if (l_ret1 != 0 || l_ret2 != 0) - { + if (l_ret1 != 0 || l_ret2 != 0) { nfound++; print_found(nfound); - goto out; + goto done; } } } - else if(l_ret2 < 0) /* fail */ - { + else if(l_ret2 < 0) { /* fail */ parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); } - else if(l_ret2 != 2) /* symbolic link */ - { + else if(l_ret2 != 2) { /* symbolic link */ obj2type = (h5trav_type_t)trg_linfo2.trg_type; if (info2_lp != NULL) { size_t idx = info2_lp->nused - 1; @@ -939,32 +896,29 @@ hsize_t h5diff(const char *fname1, * comparing details of same objects. */ - if(!(options->m_verbose || options->m_report)) - { - h5difftrace("h5diff NOT (options->m_verbose || options->m_report)\n"); + if(!(opts->m_verbose || opts->m_report)) { + h5difftrace("h5diff NOT (opts->m_verbose || opts->m_report)\n"); /* if no danglink links */ if ( l_ret1 > 0 && l_ret2 > 0 ) if (h5tools_is_obj_same(file1_id, obj1fullname, file2_id, obj2fullname)!=0) - goto out; + goto done; } both_objs_grp = (obj1type == H5TRAV_TYPE_GROUP && obj2type == H5TRAV_TYPE_GROUP); - if (both_objs_grp) - { + if (both_objs_grp) { h5difftrace("h5diff both_objs_grp TRUE\n"); /* * traverse group1 */ trav_info_init(fname1, file1_id, &info1_grp); /* optional data pass */ - info1_grp->opts = (diff_opt_t*)options; + info1_grp->opts = (diff_opt_t*)opts; if(h5trav_visit(file1_id, obj1fullname, TRUE, TRUE, - trav_grp_objs, trav_grp_symlinks, info1_grp) < 0) - { + trav_grp_objs, trav_grp_symlinks, info1_grp) < 0) { parallel_print("Error: Could not get file contents\n"); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); } info1_lp = info1_grp; @@ -973,25 +927,22 @@ hsize_t h5diff(const char *fname1, */ trav_info_init(fname2, file2_id, &info2_grp); /* optional data pass */ - info2_grp->opts = (diff_opt_t*)options; + info2_grp->opts = (diff_opt_t*)opts; if(h5trav_visit(file2_id, obj2fullname, TRUE, TRUE, - trav_grp_objs, trav_grp_symlinks, info2_grp) < 0) - { + trav_grp_objs, trav_grp_symlinks, info2_grp) < 0) { parallel_print("Error: Could not get file contents\n"); - options->err_stat = 1; - goto out; - } /* end if */ + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); + } /* end if */ info2_lp = info2_grp; } #ifdef H5_HAVE_PARALLEL - if(g_Parallel) - { + if(g_Parallel) { int i; - if((HDstrlen(fname1) > MAX_FILENAME) || (HDstrlen(fname2) > MAX_FILENAME)) - { + if((HDstrlen(fname1) > MAX_FILENAME) || (HDstrlen(fname2) > MAX_FILENAME)) { HDfprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME); MPI_Abort(MPI_COMM_WORLD, 0); } /* end if */ @@ -1007,13 +958,12 @@ hsize_t h5diff(const char *fname1, /* process the objects */ build_match_list (obj1fullname, info1_lp, obj2fullname, info2_lp, - &match_list, options); - if (both_objs_grp) - { + &match_list, opts); + if (both_objs_grp) { /*------------------------------------------------------ * print the list */ - if(options->m_verbose) + if(opts->m_verbose) { unsigned u; @@ -1024,8 +974,7 @@ hsize_t h5diff(const char *fname1, else parallel_print("file1 file2\n"); parallel_print("---------------------------------------\n"); - for(u = 0; u < match_list->nobjs; u++) - { + for(u = 0; u < match_list->nobjs; u++) { char c1, c2; c1 = (match_list->objs[u].flags[0]) ? 'x' : ' '; c2 = (match_list->objs[u].flags[1]) ? 'x' : ' '; @@ -1036,9 +985,9 @@ hsize_t h5diff(const char *fname1, } nfound = diff_match(file1_id, obj1fullname, info1_lp, file2_id, obj2fullname, info2_lp, - match_list, options); + match_list, opts); -out: +done: #ifdef H5_HAVE_PARALLEL if(g_Parallel) /* All done at this point, let tasks know that they won't be needed */ diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index 136c5ed..a556b0a 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -62,6 +62,14 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; /* + * H5TOOLS_INFO macro, used to facilitate error reporting . The arguments are the major + * error number, the minor error number, and a description of the error. + */ +#define H5TOOLS_INFO(min_id, str) { \ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, min_id, str); \ +} + +/* * HERROR macro, used to facilitate error reporting . The arguments are the major * error number, the minor error number, and a description of the error. */ diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index be84b26..1d15d12 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -101,6 +101,8 @@ usage (void) PRINTVALSTREAM(rawoutstream, " -p, --parents No error if existing, make parent groups as needed\n"); PRINTVALSTREAM(rawoutstream, " -v, --verbose Print information about OBJECTS and OPTIONS\n"); PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); + PRINTVALSTREAM(rawoutstream, " --enable-error-stack\n"); + PRINTVALSTREAM(rawoutstream, " Prints messages from the HDF5 error stack as they occur.\n"); PRINTVALSTREAM(rawoutstream, " -f, --flag Flag type\n\n"); PRINTVALSTREAM(rawoutstream, " Flag type is one of the following strings:\n\n"); PRINTVALSTREAM(rawoutstream, " shallow Copy only immediate members for groups\n\n"); diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 1069a31..e4696c0 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -17,15 +17,15 @@ #include "h5tools.h" #include "h5tools_utils.h" -static int check_n_input( const char* ); -static int check_p_input( const char* ); -static int check_d_input( const char* ); +static int check_n_input(const char*); +static int check_p_input(const char*); +static int check_d_input(const char*); /* * Command-line options: The user can specify short or long-named * parameters. */ -static const char *s_opts = "hVrv:qn:d:p:Nc"; +static const char *s_opts = "hVrv:qn:d:p:NcelxE:S"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "version", no_arg, 'V' }, @@ -41,6 +41,7 @@ static struct long_options l_opts[] = { { "follow-symlinks", no_arg, 'l' }, { "no-dangling-links", no_arg, 'x' }, { "exclude-path", require_arg, 'E' }, + { "enable-error-stack", no_arg, 'S' }, { NULL, 0, '\0' } }; @@ -60,8 +61,7 @@ static void check_options(diff_opt_t* options) /* check between -d , -p, --use-system-epsilon. * These options are mutually exclusive. */ - if ((options->d + options->p + options->use_system_epsilon) > 1) - { + if ((options->d + options->p + options->use_system_epsilon) > 1) { printf("%s error: -d, -p and --use-system-epsilon options are mutually-exclusive;\n", PROGRAMNAME); printf("use no more than one.\n"); printf("Try '-h' or '--help' option for more information or see the %s entry in the 'HDF5 Reference Manual'.\n", PROGRAMNAME); @@ -110,75 +110,79 @@ void parse_command_line(int argc, exclude_head = NULL; /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) - { - switch ((char)opt) - { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + switch ((char)opt) { default: usage(); h5diff_exit(EXIT_FAILURE); + case 'h': usage(); h5diff_exit(EXIT_SUCCESS); + case 'V': print_version(h5tools_getprogname()); h5diff_exit(EXIT_SUCCESS); + case 'v': options->m_verbose = 1; /* This for loop is for handling style like * -v, -v1, --verbose, --verbose=1. */ - for (i = 1; i < argc; i++) - { + for (i = 1; i < argc; i++) { /* * short opt */ - if (!strcmp (argv[i], "-v")) /* no arg */ - { + if (!strcmp (argv[i], "-v")) { /* no arg */ opt_ind--; options->m_verbose_level = 0; break; - } - else if (!strncmp (argv[i], "-v", (size_t)2)) - { + } + else if (!strncmp (argv[i], "-v", (size_t)2)) { options->m_verbose_level = atoi(&argv[i][2]); break; - } + } /* * long opt */ - if (!strcmp (argv[i], "--verbose")) /* no arg */ - { + if (!strcmp (argv[i], "--verbose")) { /* no arg */ options->m_verbose_level = 0; break; - } - else if ( !strncmp (argv[i], "--verbose", (size_t)9) && argv[i][9]=='=') - { + } + else if ( !strncmp (argv[i], "--verbose", (size_t)9) && argv[i][9]=='=') { options->m_verbose_level = atoi(&argv[i][10]); break; } } break; + case 'q': /* use quiet mode; supress the message "0 differences found" */ options->m_quiet = 1; break; + case 'r': options->m_report = 1; break; + case 'l': options->follow_links = TRUE; break; + case 'x': options->no_dangle_links = 1; break; + + case 'S': + enable_error_stack = TRUE; + break; + case 'E': options->exclude_path = 1; /* create linked list of excluding objects */ - if( (exclude_node = (struct exclude_path_list*) HDmalloc(sizeof(struct exclude_path_list))) == NULL) - { + if( (exclude_node = (struct exclude_path_list*) HDmalloc(sizeof(struct exclude_path_list))) == NULL) { printf("Error: lack of memory!\n"); h5diff_exit(EXIT_FAILURE); } @@ -188,13 +192,11 @@ void parse_command_line(int argc, exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN; exclude_prev = exclude_head; - if (NULL == exclude_head) - { + if (NULL == exclude_head) { exclude_head = exclude_node; exclude_head->next = NULL; } - else - { + else { while(NULL != exclude_prev->next) exclude_prev=exclude_prev->next; @@ -202,46 +204,40 @@ void parse_command_line(int argc, exclude_prev->next = exclude_node; } break; + case 'd': options->d=1; - if ( check_d_input( opt_arg )==-1) - { - printf("<-d %s> is not a valid option\n", opt_arg ); + if (check_d_input(opt_arg) == - 1) { + printf("<-d %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - options->delta = atof( opt_arg ); + options->delta = atof(opt_arg); /* -d 0 is the same as default */ if (H5_DBL_ABS_EQUAL(options->delta, (double)0.0F)) - options->d=0; - + options->d=0; break; case 'p': - options->p=1; - if ( check_p_input( opt_arg )==-1) - { - printf("<-p %s> is not a valid option\n", opt_arg ); + if (check_p_input(opt_arg) == -1) { + printf("<-p %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - options->percent = atof( opt_arg ); + options->percent = atof(opt_arg); /* -p 0 is the same as default */ if (H5_DBL_ABS_EQUAL(options->percent, (double)0.0F)) - options->p = 0; - + options->p = 0; break; case 'n': - options->n=1; - if ( check_n_input( opt_arg )==-1) - { - printf("<-n %s> is not a valid option\n", opt_arg ); + if ( check_n_input(opt_arg) == -1) { + printf("<-n %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } @@ -270,8 +266,7 @@ void parse_command_line(int argc, options->exclude = exclude_head; /* check for file names to be processed */ - if (argc <= opt_ind || argv[ opt_ind + 1 ] == NULL) - { + if (argc <= opt_ind || argv[ opt_ind + 1 ] == NULL) { error_msg("missing file names\n"); usage(); h5diff_exit(EXIT_FAILURE); @@ -281,18 +276,15 @@ void parse_command_line(int argc, *fname2 = argv[ opt_ind + 1 ]; *objname1 = argv[ opt_ind + 2 ]; - if ( *objname1 == NULL ) - { + if (*objname1 == NULL) { *objname2 = NULL; return; } - if ( argv[ opt_ind + 3 ] != NULL) - { + if (argv[ opt_ind + 3 ] != NULL) { *objname2 = argv[ opt_ind + 3 ]; } - else - { + else { *objname2 = *objname1; } @@ -310,20 +302,17 @@ void parse_command_line(int argc, void print_info(diff_opt_t* options) { - if (options->m_quiet || options->err_stat ) + if (options->m_quiet || options->err_stat) return; - if (options->cmn_objs==0) - { + if (options->cmn_objs == 0) { printf("No common objects found. Files are not comparable.\n"); if (!options->m_verbose) printf("Use -v for a list of objects.\n"); } - if (options->not_cmp==1) - { - if ( options->m_list_not_cmp == 0 ) - { + if (options->not_cmp == 1) { + if (options->m_list_not_cmp == 0) { printf("--------------------------------\n"); printf("Some objects are not comparable\n"); printf("--------------------------------\n"); @@ -332,10 +321,7 @@ void parse_command_line(int argc, else printf("Use -c for a list of objects.\n"); } - - } - } /*------------------------------------------------------------------------- @@ -361,16 +347,14 @@ check_n_input( const char *str ) unsigned i; char c; - for ( i = 0; i < strlen(str); i++) - { + for (i = 0; i < strlen(str); i++) { c = str[i]; - if ( i==0 ) - { - if ( c < 49 || c > 57 ) /* ascii values between 1 and 9 */ + if (i == 0) { + if (c < 49 || c > 57) /* ascii values between 1 and 9 */ return -1; } else - if ( c < 48 || c > 57 ) /* 0 also */ + if (c < 48 || c > 57) /* 0 also */ return -1; } return 1; @@ -400,11 +384,11 @@ check_p_input( const char *str ) the atof return value on a hexadecimal input is different on some systems; we do a character check for this */ - if (strlen(str)>2 && str[0]=='0' && str[1]=='x') + if (strlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; - x=atof(str); - if (x<0) + x = atof(str); + if (x < 0) return -1; return 1; @@ -434,11 +418,11 @@ check_d_input( const char *str ) the atof return value on a hexadecimal input is different on some systems; we do a character check for this */ - if (strlen(str)>2 && str[0]=='0' && str[1]=='x') + if (strlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; - x=atof(str); - if (x <0) + x = atof(str); + if (x < 0) return -1; return 1; @@ -456,151 +440,153 @@ check_d_input( const char *str ) void usage(void) { - printf("usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]\n"); - printf(" file1 File name of the first HDF5 file\n"); - printf(" file2 File name of the second HDF5 file\n"); - printf(" [obj1] Name of an HDF5 object, in absolute path\n"); - printf(" [obj2] Name of an HDF5 object, in absolute path\n"); - printf("\n"); - printf(" OPTIONS\n"); - printf(" -h, --help\n"); - printf(" Print a usage message and exit.\n"); - printf(" -V, --version\n"); - printf(" Print version number and exit.\n"); - printf(" -r, --report\n"); - printf(" Report mode. Print differences.\n"); - printf(" -v --verbose\n"); - printf(" Verbose mode. Print differences information and list of objects.\n"); - printf(" -vN --verbose=N\n"); - printf(" Verbose mode with level. Print differences and list of objects.\n"); - printf(" Level of detail depends on value of N:\n"); - printf(" 0 : Identical to '-v' or '--verbose'.\n"); - printf(" 1 : All level 0 information plus one-line attribute\n"); - printf(" status summary.\n"); - printf(" 2 : All level 1 information plus extended attribute\n"); - printf(" status report.\n"); - printf(" -q, --quiet\n"); - printf(" Quiet mode. Do not produce output.\n"); - printf(" --follow-symlinks\n"); - printf(" Follow symbolic links (soft links and external links and compare the)\n"); - printf(" links' target objects.\n"); - printf(" If symbolic link(s) with the same name exist in the files being\n"); - printf(" compared, then determine whether the target of each link is an existing\n"); - printf(" object (dataset, group, or named datatype) or the link is a dangling\n"); - printf(" link (a soft or external link pointing to a target object that does\n"); - printf(" not yet exist).\n"); - printf(" - If both symbolic links are dangling links, they are treated as being\n"); - printf(" the same; by default, h5diff returns an exit code of 0.\n"); - printf(" If, however, --no-dangling-links is used with --follow-symlinks,\n"); - printf(" this situation is treated as an error and h5diff returns an\n"); - printf(" exit code of 2.\n"); - printf(" - If only one of the two links is a dangling link,they are treated as\n"); - printf(" being different and h5diff returns an exit code of 1.\n"); - printf(" If, however, --no-dangling-links is used with --follow-symlinks,\n"); - printf(" this situation is treated as an error and h5diff returns an\n"); - printf(" exit code of 2.\n"); - printf(" - If both symbolic links point to existing objects, h5diff compares the\n"); - printf(" two objects.\n"); - printf(" If any symbolic link specified in the call to h5diff does not exist,\n"); - printf(" h5diff treats it as an error and returns an exit code of 2.\n"); - printf(" --no-dangling-links\n"); - printf(" Must be used with --follow-symlinks option; otherwise, h5diff shows\n"); - printf(" error message and returns an exit code of 2.\n"); - printf(" Check for any symbolic links (soft links or external links) that do not\n"); - printf(" resolve to an existing object (dataset, group, or named datatype).\n"); - printf(" If any dangling link is found, this situation is treated as an error\n"); - printf(" and h5diff returns an exit code of 2.\n"); - printf(" -c, --compare\n"); - printf(" List objects that are not comparable\n"); - printf(" -N, --nan\n"); - printf(" Avoid NaNs detection\n"); - printf(" -n C, --count=C\n"); - printf(" Print differences up to C. C must be a positive integer.\n"); - printf(" -d D, --delta=D\n"); - printf(" Print difference if (|a-b| > D). D must be a positive number. Where a\n"); - printf(" is the data point value in file1 and b is the data point value in file2.\n"); - printf(" Can not use with '-p' or '--use-system-epsilon'.\n"); - printf(" -p R, --relative=R\n"); - printf(" Print difference if (|(a-b)/b| > R). R must be a positive number. Where a\n"); - printf(" is the data point value in file1 and b is the data point value in file2.\n"); - printf(" Can not use with '-d' or '--use-system-epsilon'.\n"); - printf(" --use-system-epsilon\n"); - printf(" Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a\n"); - printf(" is the data point value in file1 and b is the data point value in file2.\n"); - printf(" If the system epsilon is not defined,one of the following predefined\n"); - printf(" values will be used:\n"); - printf(" FLT_EPSILON = 1.19209E-07 for floating-point type\n"); - printf(" DBL_EPSILON = 2.22045E-16 for double precision type\n"); - printf(" Can not use with '-p' or '-d'.\n"); - printf(" --exclude-path \"path\"\n"); - printf(" Exclude the specified path to an object when comparing files or groups.\n"); - printf(" If a group is excluded, all member objects will also be excluded.\n"); - printf(" The specified path is excluded wherever it occurs.\n"); - printf(" This flexibility enables the same option to exclude either objects that\n"); - printf(" exist only in one file or common objects that are known to differ.\n"); - printf("\n"); - printf(" When comparing files, \"path\" is the absolute path to the excluded;\n"); - printf(" object; when comparing groups, \"path\" is similar to the relative\n"); - printf(" path from the group to the excluded object. This \"path\" can be\n"); - printf(" taken from the first section of the output of the --verbose option.\n"); - printf(" For example, if you are comparing the group /groupA in two files and\n"); - printf(" you want to exclude /groupA/groupB/groupC in both files, the exclude\n"); - printf(" option would read as follows:\n"); - printf(" --exclude-path \"/groupB/groupC\"\n"); - printf("\n"); - printf(" If there are multiple paths to an object, only the specified path(s)\n"); - printf(" will be excluded; the comparison will include any path not explicitly\n"); - printf(" excluded.\n"); - printf(" This option can be used repeatedly to exclude multiple paths.\n"); - printf("\n"); - - printf(" Modes of output:\n"); - printf(" Default mode: print the number of differences found and where they occured\n"); - printf(" -r Report mode: print the above plus the differences\n"); - printf(" -v Verbose mode: print the above plus a list of objects and warnings\n"); - printf(" -q Quiet mode: do not print output\n"); - - printf("\n"); - - printf(" File comparison:\n"); - printf(" If no objects [obj1[ obj2]] are specified, the h5diff comparison proceeds as\n"); - printf(" a comparison of the two files' root groups. That is, h5diff first compares\n"); - printf(" the names of root group members, generates a report of root group objects\n"); - printf(" that appear in only one file or in both files, and recursively compares\n"); - printf(" common objects.\n"); - printf("\n"); - - printf(" Object comparison:\n"); - printf(" 1) Groups\n"); - printf(" First compares the names of member objects (relative path, from the\n"); - printf(" specified group) and generates a report of objects that appear in only\n"); - printf(" one group or in both groups. Common objects are then compared recursively.\n"); - printf(" 2) Datasets\n"); - printf(" Array rank and dimensions, datatypes, and data values are compared.\n"); - printf(" 3) Datatypes\n"); - printf(" The comparison is based on the return value of H5Tequal.\n"); - printf(" 4) Symbolic links\n"); - printf(" The paths to the target objects are compared.\n"); - printf(" (The option --follow-symlinks overrides the default behavior when\n"); - printf(" symbolic links are compared.).\n"); - printf("\n"); - - printf(" Exit code:\n"); - printf(" 0 if no differences, 1 if differences found, 2 if error\n"); - printf("\n"); - printf(" Examples of use:\n"); - printf(" 1) h5diff file1 file2 /g1/dset1 /g1/dset2\n"); - printf(" Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2\n"); - printf("\n"); - printf(" 2) h5diff file1 file2 /g1/dset1\n"); - printf(" Compares object '/g1/dset1' in both files\n"); - printf("\n"); - printf(" 3) h5diff file1 file2\n"); - printf(" Compares all objects in both files\n"); - printf("\n"); - printf(" Notes:\n"); - printf(" file1 and file2 can be the same file.\n"); - printf(" Use h5diff file1 file1 /g1/dset1 /g1/dset2 to compare\n"); - printf(" '/g1/dset1' and '/g1/dset2' in the same file\n"); - printf("\n"); + PRINTVALSTREAM(rawoutstream, "usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]\n"); + PRINTVALSTREAM(rawoutstream, " file1 File name of the first HDF5 file\n"); + PRINTVALSTREAM(rawoutstream, " file2 File name of the second HDF5 file\n"); + PRINTVALSTREAM(rawoutstream, " [obj1] Name of an HDF5 object, in absolute path\n"); + PRINTVALSTREAM(rawoutstream, " [obj2] Name of an HDF5 object, in absolute path\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " OPTIONS\n"); + PRINTVALSTREAM(rawoutstream, " -h, --help\n"); + PRINTVALSTREAM(rawoutstream, " Print a usage message and exit.\n"); + PRINTVALSTREAM(rawoutstream, " -V, --version\n"); + PRINTVALSTREAM(rawoutstream, " Print version number and exit.\n"); + PRINTVALSTREAM(rawoutstream, " -r, --report\n"); + PRINTVALSTREAM(rawoutstream, " Report mode. Print differences.\n"); + PRINTVALSTREAM(rawoutstream, " -v --verbose\n"); + PRINTVALSTREAM(rawoutstream, " Verbose mode. Print differences information and list of objects.\n"); + PRINTVALSTREAM(rawoutstream, " -vN --verbose=N\n"); + PRINTVALSTREAM(rawoutstream, " Verbose mode with level. Print differences and list of objects.\n"); + PRINTVALSTREAM(rawoutstream, " Level of detail depends on value of N:\n"); + PRINTVALSTREAM(rawoutstream, " 0 : Identical to '-v' or '--verbose'.\n"); + PRINTVALSTREAM(rawoutstream, " 1 : All level 0 information plus one-line attribute\n"); + PRINTVALSTREAM(rawoutstream, " status summary.\n"); + PRINTVALSTREAM(rawoutstream, " 2 : All level 1 information plus extended attribute\n"); + PRINTVALSTREAM(rawoutstream, " status report.\n"); + PRINTVALSTREAM(rawoutstream, " -q, --quiet\n"); + PRINTVALSTREAM(rawoutstream, " Quiet mode. Do not produce output.\n"); + PRINTVALSTREAM(rawoutstream, " --enable-error-stack\n"); + PRINTVALSTREAM(rawoutstream, " Prints messages from the HDF5 error stack as they occur.\n"); + PRINTVALSTREAM(rawoutstream, " --follow-symlinks\n"); + PRINTVALSTREAM(rawoutstream, " Follow symbolic links (soft links and external links and compare the)\n"); + PRINTVALSTREAM(rawoutstream, " links' target objects.\n"); + PRINTVALSTREAM(rawoutstream, " If symbolic link(s) with the same name exist in the files being\n"); + PRINTVALSTREAM(rawoutstream, " compared, then determine whether the target of each link is an existing\n"); + PRINTVALSTREAM(rawoutstream, " object (dataset, group, or named datatype) or the link is a dangling\n"); + PRINTVALSTREAM(rawoutstream, " link (a soft or external link pointing to a target object that does\n"); + PRINTVALSTREAM(rawoutstream, " not yet exist).\n"); + PRINTVALSTREAM(rawoutstream, " - If both symbolic links are dangling links, they are treated as being\n"); + PRINTVALSTREAM(rawoutstream, " the same; by default, h5diff returns an exit code of 0.\n"); + PRINTVALSTREAM(rawoutstream, " If, however, --no-dangling-links is used with --follow-symlinks,\n"); + PRINTVALSTREAM(rawoutstream, " this situation is treated as an error and h5diff returns an\n"); + PRINTVALSTREAM(rawoutstream, " exit code of 2.\n"); + PRINTVALSTREAM(rawoutstream, " - If only one of the two links is a dangling link,they are treated as\n"); + PRINTVALSTREAM(rawoutstream, " being different and h5diff returns an exit code of 1.\n"); + PRINTVALSTREAM(rawoutstream, " If, however, --no-dangling-links is used with --follow-symlinks,\n"); + PRINTVALSTREAM(rawoutstream, " this situation is treated as an error and h5diff returns an\n"); + PRINTVALSTREAM(rawoutstream, " exit code of 2.\n"); + PRINTVALSTREAM(rawoutstream, " - If both symbolic links point to existing objects, h5diff compares the\n"); + PRINTVALSTREAM(rawoutstream, " two objects.\n"); + PRINTVALSTREAM(rawoutstream, " If any symbolic link specified in the call to h5diff does not exist,\n"); + PRINTVALSTREAM(rawoutstream, " h5diff treats it as an error and returns an exit code of 2.\n"); + PRINTVALSTREAM(rawoutstream, " --no-dangling-links\n"); + PRINTVALSTREAM(rawoutstream, " Must be used with --follow-symlinks option; otherwise, h5diff shows\n"); + PRINTVALSTREAM(rawoutstream, " error message and returns an exit code of 2.\n"); + PRINTVALSTREAM(rawoutstream, " Check for any symbolic links (soft links or external links) that do not\n"); + PRINTVALSTREAM(rawoutstream, " resolve to an existing object (dataset, group, or named datatype).\n"); + PRINTVALSTREAM(rawoutstream, " If any dangling link is found, this situation is treated as an error\n"); + PRINTVALSTREAM(rawoutstream, " and h5diff returns an exit code of 2.\n"); + PRINTVALSTREAM(rawoutstream, " -c, --compare\n"); + PRINTVALSTREAM(rawoutstream, " List objects that are not comparable\n"); + PRINTVALSTREAM(rawoutstream, " -N, --nan\n"); + PRINTVALSTREAM(rawoutstream, " Avoid NaNs detection\n"); + PRINTVALSTREAM(rawoutstream, " -n C, --count=C\n"); + PRINTVALSTREAM(rawoutstream, " Print differences up to C. C must be a positive integer.\n"); + PRINTVALSTREAM(rawoutstream, " -d D, --delta=D\n"); + PRINTVALSTREAM(rawoutstream, " Print difference if (|a-b| > D). D must be a positive number. Where a\n"); + PRINTVALSTREAM(rawoutstream, " is the data point value in file1 and b is the data point value in file2.\n"); + PRINTVALSTREAM(rawoutstream, " Can not use with '-p' or '--use-system-epsilon'.\n"); + PRINTVALSTREAM(rawoutstream, " -p R, --relative=R\n"); + PRINTVALSTREAM(rawoutstream, " Print difference if (|(a-b)/b| > R). R must be a positive number. Where a\n"); + PRINTVALSTREAM(rawoutstream, " is the data point value in file1 and b is the data point value in file2.\n"); + PRINTVALSTREAM(rawoutstream, " Can not use with '-d' or '--use-system-epsilon'.\n"); + PRINTVALSTREAM(rawoutstream, " --use-system-epsilon\n"); + PRINTVALSTREAM(rawoutstream, " Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a\n"); + PRINTVALSTREAM(rawoutstream, " is the data point value in file1 and b is the data point value in file2.\n"); + PRINTVALSTREAM(rawoutstream, " If the system epsilon is not defined,one of the following predefined\n"); + PRINTVALSTREAM(rawoutstream, " values will be used:\n"); + PRINTVALSTREAM(rawoutstream, " FLT_EPSILON = 1.19209E-07 for floating-point type\n"); + PRINTVALSTREAM(rawoutstream, " DBL_EPSILON = 2.22045E-16 for double precision type\n"); + PRINTVALSTREAM(rawoutstream, " Can not use with '-p' or '-d'.\n"); + PRINTVALSTREAM(rawoutstream, " --exclude-path \"path\"\n"); + PRINTVALSTREAM(rawoutstream, " Exclude the specified path to an object when comparing files or groups.\n"); + PRINTVALSTREAM(rawoutstream, " If a group is excluded, all member objects will also be excluded.\n"); + PRINTVALSTREAM(rawoutstream, " The specified path is excluded wherever it occurs.\n"); + PRINTVALSTREAM(rawoutstream, " This flexibility enables the same option to exclude either objects that\n"); + PRINTVALSTREAM(rawoutstream, " exist only in one file or common objects that are known to differ.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " When comparing files, \"path\" is the absolute path to the excluded;\n"); + PRINTVALSTREAM(rawoutstream, " object; when comparing groups, \"path\" is similar to the relative\n"); + PRINTVALSTREAM(rawoutstream, " path from the group to the excluded object. This \"path\" can be\n"); + PRINTVALSTREAM(rawoutstream, " taken from the first section of the output of the --verbose option.\n"); + PRINTVALSTREAM(rawoutstream, " For example, if you are comparing the group /groupA in two files and\n"); + PRINTVALSTREAM(rawoutstream, " you want to exclude /groupA/groupB/groupC in both files, the exclude\n"); + PRINTVALSTREAM(rawoutstream, " option would read as follows:\n"); + PRINTVALSTREAM(rawoutstream, " --exclude-path \"/groupB/groupC\"\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " If there are multiple paths to an object, only the specified path(s)\n"); + PRINTVALSTREAM(rawoutstream, " will be excluded; the comparison will include any path not explicitly\n"); + PRINTVALSTREAM(rawoutstream, " excluded.\n"); + PRINTVALSTREAM(rawoutstream, " This option can be used repeatedly to exclude multiple paths.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + + PRINTVALSTREAM(rawoutstream, " Modes of output:\n"); + PRINTVALSTREAM(rawoutstream, " Default mode: print the number of differences found and where they occured\n"); + PRINTVALSTREAM(rawoutstream, " -r Report mode: print the above plus the differences\n"); + PRINTVALSTREAM(rawoutstream, " -v Verbose mode: print the above plus a list of objects and warnings\n"); + PRINTVALSTREAM(rawoutstream, " -q Quiet mode: do not print output\n"); + + PRINTVALSTREAM(rawoutstream, "\n"); + + PRINTVALSTREAM(rawoutstream, " File comparison:\n"); + PRINTVALSTREAM(rawoutstream, " If no objects [obj1[ obj2]] are specified, the h5diff comparison proceeds as\n"); + PRINTVALSTREAM(rawoutstream, " a comparison of the two files' root groups. That is, h5diff first compares\n"); + PRINTVALSTREAM(rawoutstream, " the names of root group members, generates a report of root group objects\n"); + PRINTVALSTREAM(rawoutstream, " that appear in only one file or in both files, and recursively compares\n"); + PRINTVALSTREAM(rawoutstream, " common objects.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + + PRINTVALSTREAM(rawoutstream, " Object comparison:\n"); + PRINTVALSTREAM(rawoutstream, " 1) Groups\n"); + PRINTVALSTREAM(rawoutstream, " First compares the names of member objects (relative path, from the\n"); + PRINTVALSTREAM(rawoutstream, " specified group) and generates a report of objects that appear in only\n"); + PRINTVALSTREAM(rawoutstream, " one group or in both groups. Common objects are then compared recursively.\n"); + PRINTVALSTREAM(rawoutstream, " 2) Datasets\n"); + PRINTVALSTREAM(rawoutstream, " Array rank and dimensions, datatypes, and data values are compared.\n"); + PRINTVALSTREAM(rawoutstream, " 3) Datatypes\n"); + PRINTVALSTREAM(rawoutstream, " The comparison is based on the return value of H5Tequal.\n"); + PRINTVALSTREAM(rawoutstream, " 4) Symbolic links\n"); + PRINTVALSTREAM(rawoutstream, " The paths to the target objects are compared.\n"); + PRINTVALSTREAM(rawoutstream, " (The option --follow-symlinks overrides the default behavior when\n"); + PRINTVALSTREAM(rawoutstream, " symbolic links are compared.).\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + + PRINTVALSTREAM(rawoutstream, " Exit code:\n"); + PRINTVALSTREAM(rawoutstream, " 0 if no differences, 1 if differences found, 2 if error\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " Examples of use:\n"); + PRINTVALSTREAM(rawoutstream, " 1) h5diff file1 file2 /g1/dset1 /g1/dset2\n"); + PRINTVALSTREAM(rawoutstream, " Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " 2) h5diff file1 file2 /g1/dset1\n"); + PRINTVALSTREAM(rawoutstream, " Compares object '/g1/dset1' in both files\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " 3) h5diff file1 file2\n"); + PRINTVALSTREAM(rawoutstream, " Compares all objects in both files\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " Notes:\n"); + PRINTVALSTREAM(rawoutstream, " file1 and file2 can be the same file.\n"); + PRINTVALSTREAM(rawoutstream, " Use h5diff file1 file1 /g1/dset1 /g1/dset2 to compare\n"); + PRINTVALSTREAM(rawoutstream, " '/g1/dset1' and '/g1/dset2' in the same file\n"); + PRINTVALSTREAM(rawoutstream, "\n"); } diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index 66ff71e..8dab3b4 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -69,6 +69,10 @@ int main(int argc, const char *argv[]) { int ret; + H5E_auto2_t func; + H5E_auto2_t tools_func; + void *edata; + void *tools_edata; const char *fname1 = NULL; const char *fname2 = NULL; const char *objname1 = NULL; @@ -79,21 +83,34 @@ int main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Disable error reporting */ + H5Eget_auto2(H5E_DEFAULT, &func, &edata); + H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + /* Initialize h5tools lib */ h5tools_init(); + /* Disable tools error reporting */ + H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); + H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); + /*------------------------------------------------------------------------- * process the command-line *------------------------------------------------------------------------- */ parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); + if (enable_error_stack) { + H5Eset_auto2(H5E_DEFAULT, func, edata); + H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); + } + /*------------------------------------------------------------------------- * do the diff *------------------------------------------------------------------------- */ - nfound = h5diff(fname1,fname2,objname1,objname2,&options); + nfound = h5diff(fname1, fname2, objname1, objname2, &options); print_info(&options); @@ -103,17 +120,17 @@ int main(int argc, const char *argv[]) *------------------------------------------------------------------------- */ - ret = (nfound == 0 ? 0 : 1 ); + ret = (nfound == 0 ? 0 : 1); /* if graph difference return 1 for differences */ - if ( options.contents == 0 ) + if (options.contents == 0) ret = 1; /* and return 2 for error */ if (options.err_stat) ret = 2; - return ret; + h5diff_exit(ret); } /*------------------------------------------------------------------------- @@ -135,6 +152,8 @@ int main(int argc, const char *argv[]) H5_ATTR_NORETURN void h5diff_exit(int status) { + h5tools_close(); + HDexit(status); } diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index 192067f..89efc39 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -316,6 +316,8 @@ void h5diff_exit(int status) status = EXIT_SUCCESS; /* Reset exit status, since some mpiexec commands generate output on failure status */ } + h5tools_close(); + /* Always exit(0), since MPI implementations do weird stuff when they * receive a non-zero exit value. - QAK */ diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 608795c..a07d3c9 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -171,11 +171,21 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_452.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_453.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_454.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_454_ERR.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_454_ERR.err ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_455.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_455_ERR.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_455_ERR.err ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_456.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_457.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_457_ERR.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_457_ERR.err ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_458.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_458_ERR.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_458_ERR.err ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_459.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_459_ERR.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_459_ERR.err ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_465.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_466.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_467.txt @@ -231,6 +241,8 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_63.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_600.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601_ERR.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601_ERR.err ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_603.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_604.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_605.txt @@ -379,6 +391,37 @@ endif () endmacro () + macro (ADD_H5_ERR_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DIFF_ERR-${resultfile} COMMAND $ --enable-error-stack ${ARGN}) + set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES WILL_FAIL "true") + endif () + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif () + else () + add_test ( + NAME H5DIFF_ERR-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}_ERR.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}_ERR.txt" + -D "TEST_APPEND=EXIT CODE:" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5DIFF_ERR-${resultfile}") + endmacro () + macro (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) @@ -458,6 +501,51 @@ endif () endmacro () + macro (ADD_H5_UD_ERR_TEST testname resultcode resultfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5DIFF_UD_ERR-${testname}-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${resultfile}_ERR.out + testfiles/${resultfile}_ERR.out.err + ) + if (${resultcode} STREQUAL "2") + add_test ( + NAME H5DIFF_UD_ERR-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}_ERR.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}_ERR.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + else () + add_test ( + NAME H5DIFF_UD_ERR-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}_ERR.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}_ERR.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (H5DIFF_UD_ERR-${testname} PROPERTIES DEPENDS H5DIFF_UD_ERR-${testname}-clearall-objects) + endif () + endmacro () + ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -680,16 +768,26 @@ h5diff_453.out.err h5diff_454.out h5diff_454.out.err + h5diff_454_ERR.out + h5diff_454_ERR.out.err h5diff_455.out h5diff_455.out.err + h5diff_455_ERR.out + h5diff_455_ERR.out.err h5diff_456.out h5diff_456.out.err h5diff_457.out h5diff_457.out.err + h5diff_457_ERR.out + h5diff_457_ERR.out.err h5diff_458.out h5diff_458.out.err + h5diff_458_ERR.out + h5diff_458_ERR.out.err h5diff_459.out h5diff_459.out.err + h5diff_459_ERR.out + h5diff_459_ERR.out.err h5diff_465.out h5diff_465.out.err h5diff_466.out @@ -794,6 +892,8 @@ h5diff_600.out.err h5diff_601.out h5diff_601.out.err + h5diff_601_ERR.out + h5diff_601_ERR.out.err h5diff_603.out h5diff_603.out.err h5diff_604.out @@ -1047,6 +1147,7 @@ ADD_H5_TEST (h5diff_600 1 ${FILE1}) # 6.1: Check if non-exist object name is specified ADD_H5_TEST (h5diff_601 2 ${FILE1} ${FILE1} nono_obj) +ADD_H5_ERR_TEST (h5diff_601 2 ${FILE1} ${FILE1} nono_obj) # ############################################################################## # # -d @@ -1350,21 +1451,26 @@ ADD_H5_TEST (h5diff_453 2 --follow-symlinks -v --no-dangling-links ${FILE13} $ # dangling link found for soft links (obj to obj) ADD_H5_TEST (h5diff_454 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) +ADD_H5_ERR_TEST (h5diff_454 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) # dangling link found for soft links (obj to obj) Both dangle links ADD_H5_TEST (h5diff_455 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_noexist /softlink_noexist) +ADD_H5_ERR_TEST (h5diff_455 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_noexist /softlink_noexist) # dangling link found for ext links (FILE to FILE) ADD_H5_TEST (h5diff_456 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15}) # dangling link found for ext links (obj to obj). target file exist ADD_H5_TEST (h5diff_457 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist1) +ADD_H5_ERR_TEST (h5diff_457 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist1) # dangling link found for ext links (obj to obj). target file NOT exist ADD_H5_TEST (h5diff_458 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist2) +ADD_H5_ERR_TEST (h5diff_458 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist2) # dangling link found for ext links (obj to obj). Both dangle links ADD_H5_TEST (h5diff_459 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_noexist2) +ADD_H5_ERR_TEST (h5diff_459 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_noexist2) # dangling link --follow-symlinks (obj vs obj) # (HDFFV-7836) diff --git a/tools/test/h5diff/testfiles/h5diff_10.txt b/tools/test/h5diff/testfiles/h5diff_10.txt index 0a0ee22..11ad800 100644 --- a/tools/test/h5diff/testfiles/h5diff_10.txt +++ b/tools/test/h5diff/testfiles/h5diff_10.txt @@ -23,6 +23,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_454_ERR.err b/tools/test/h5diff/testfiles/h5diff_454_ERR.err new file mode 100644 index 0000000..fcd3cb7 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_454_ERR.err @@ -0,0 +1,4 @@ +H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: + #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 861 in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_454_ERR.txt b/tools/test/h5diff/testfiles/h5diff_454_ERR.txt new file mode 100644 index 0000000..61ae5ed --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_454_ERR.txt @@ -0,0 +1,6 @@ +Warning: is a dangling link. +H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: + #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 861 in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function +EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_455_ERR.err b/tools/test/h5diff/testfiles/h5diff_455_ERR.err new file mode 100644 index 0000000..f82fcc8 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_455_ERR.err @@ -0,0 +1,4 @@ +H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: + #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 818 in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_455_ERR.txt b/tools/test/h5diff/testfiles/h5diff_455_ERR.txt new file mode 100644 index 0000000..dc1b6a1 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_455_ERR.txt @@ -0,0 +1,6 @@ +Warning: is a dangling link. +H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: + #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 818 in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function +EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_457_ERR.err b/tools/test/h5diff/testfiles/h5diff_457_ERR.err new file mode 100644 index 0000000..fcd3cb7 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_457_ERR.err @@ -0,0 +1,4 @@ +H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: + #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 861 in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_457_ERR.txt b/tools/test/h5diff/testfiles/h5diff_457_ERR.txt new file mode 100644 index 0000000..927b301 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_457_ERR.txt @@ -0,0 +1,6 @@ +Warning: is a dangling link. +H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: + #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 861 in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function +EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_458_ERR.err b/tools/test/h5diff/testfiles/h5diff_458_ERR.err new file mode 100644 index 0000000..fcd3cb7 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_458_ERR.err @@ -0,0 +1,4 @@ +H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: + #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 861 in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_458_ERR.txt b/tools/test/h5diff/testfiles/h5diff_458_ERR.txt new file mode 100644 index 0000000..d6cd1b9 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_458_ERR.txt @@ -0,0 +1,6 @@ +Warning: is a dangling link. +H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: + #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 861 in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function +EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_459_ERR.err b/tools/test/h5diff/testfiles/h5diff_459_ERR.err new file mode 100644 index 0000000..f82fcc8 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_459_ERR.err @@ -0,0 +1,4 @@ +H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: + #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 818 in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_459_ERR.txt b/tools/test/h5diff/testfiles/h5diff_459_ERR.txt new file mode 100644 index 0000000..0aacb1f --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_459_ERR.txt @@ -0,0 +1,6 @@ +Warning: is a dangling link. +H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: + #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 818 in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function +EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_600.txt b/tools/test/h5diff/testfiles/h5diff_600.txt index 4362711..f3b346a 100644 --- a/tools/test/h5diff/testfiles/h5diff_600.txt +++ b/tools/test/h5diff/testfiles/h5diff_600.txt @@ -23,6 +23,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_601_ERR.err b/tools/test/h5diff/testfiles/h5diff_601_ERR.err new file mode 100644 index 0000000..b168fe5 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_601_ERR.err @@ -0,0 +1,4 @@ +H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: + #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 690 in h5diff(): Error: Object could not be found + major: Failure in tools library + minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_601_ERR.txt b/tools/test/h5diff/testfiles/h5diff_601_ERR.txt new file mode 100644 index 0000000..d1a50f9 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_601_ERR.txt @@ -0,0 +1,6 @@ +Object could not be found in +H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: + #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 690 in h5diff(): Error: Object could not be found + major: Failure in tools library + minor: error in function +EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_603.txt b/tools/test/h5diff/testfiles/h5diff_603.txt index 9ab3204..0d6b474 100644 --- a/tools/test/h5diff/testfiles/h5diff_603.txt +++ b/tools/test/h5diff/testfiles/h5diff_603.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_606.txt b/tools/test/h5diff/testfiles/h5diff_606.txt index afe0e72..94f44e8 100644 --- a/tools/test/h5diff/testfiles/h5diff_606.txt +++ b/tools/test/h5diff/testfiles/h5diff_606.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_612.txt b/tools/test/h5diff/testfiles/h5diff_612.txt index 97a1747..7f83c64 100644 --- a/tools/test/h5diff/testfiles/h5diff_612.txt +++ b/tools/test/h5diff/testfiles/h5diff_612.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_615.txt b/tools/test/h5diff/testfiles/h5diff_615.txt index 78770f0..3cfe6b9 100644 --- a/tools/test/h5diff/testfiles/h5diff_615.txt +++ b/tools/test/h5diff/testfiles/h5diff_615.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_621.txt b/tools/test/h5diff/testfiles/h5diff_621.txt index b2a5881..9c34945 100644 --- a/tools/test/h5diff/testfiles/h5diff_621.txt +++ b/tools/test/h5diff/testfiles/h5diff_621.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_622.txt b/tools/test/h5diff/testfiles/h5diff_622.txt index 66a3025..2b2df2f 100644 --- a/tools/test/h5diff/testfiles/h5diff_622.txt +++ b/tools/test/h5diff/testfiles/h5diff_622.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_623.txt b/tools/test/h5diff/testfiles/h5diff_623.txt index f9258d1..3e80438 100644 --- a/tools/test/h5diff/testfiles/h5diff_623.txt +++ b/tools/test/h5diff/testfiles/h5diff_623.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_624.txt b/tools/test/h5diff/testfiles/h5diff_624.txt index 57a4ddd..7a2f585 100644 --- a/tools/test/h5diff/testfiles/h5diff_624.txt +++ b/tools/test/h5diff/testfiles/h5diff_624.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. -- cgit v0.12 From ce977db07ea8a3270a1d285d2a4b9c061d3d78bf Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 1 Sep 2017 08:38:17 -0500 Subject: Minor comment refactoring --- src/H5Dmpio.c | 7 ++++--- testpar/t_filters_parallel.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 4f839a8..463b304 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -2005,7 +2005,6 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Collect the new chunk info back to the local copy, since only the record in the * collective array gets updated by the chunk re-allocation */ - /* XXX: This step may no longer be necessary */ HDmemcpy(&chunk_list[i].chunk_states.new_chunk, &collective_chunk_list[offset].chunk_states.new_chunk, sizeof(chunk_list[i].chunk_states.new_chunk)); H5_CHECKED_ASSIGN(mpi_type_count, int, chunk_list[i].chunk_states.new_chunk.length, hsize_t); @@ -2773,7 +2772,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") local_info_array[i].io_size = (size_t) select_npoints * type_info->src_type_size; - /* XXX: Currently the full overwrite status of a chunk is only obtained on a per-process + /* Currently the full overwrite status of a chunk is only obtained on a per-process * basis. This means that if the total selection in the chunk, as determined by the combination * of selections of all of the processes interested in the chunk, covers the entire chunk, * the performance optimization of not reading the chunk from the file is still valid, but @@ -3257,7 +3256,9 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk if (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) { chunk_entry->chunk_states.new_chunk.length = chunk_entry->chunk_states.chunk_current.length; - /* XXX: Test with MPI types and collective read to improve performance */ + /* Currently, these chunk reads are done independently and will likely + * cause issues with collective metadata reads enabled. In the future, + * this should be refactored to use collective chunk reads - JTH */ if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_entry->chunk_states.chunk_current.offset, chunk_entry->chunk_states.new_chunk.length, H5AC_rawdata_dxpl_id, chunk_entry->buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") diff --git a/testpar/t_filters_parallel.h b/testpar/t_filters_parallel.h index d0f245d..cb9a1ab 100644 --- a/testpar/t_filters_parallel.h +++ b/testpar/t_filters_parallel.h @@ -50,7 +50,7 @@ size_t cd_nelmts = FILTER_NUM_CDVALUES; #define GEN_DATA(i) INCREMENTAL_DATA(i) #define INCREMENTAL_DATA(i) ((size_t) mpi_rank + i) /* Generates incremental test data */ -/* XXX: For experimental purposes only, will cause tests to fail data verification phase */ +/* For experimental purposes only, will cause tests to fail data verification phase - JTH */ /* #define GEN_DATA(i) RANK_DATA(i) */ /* Given an index value i, generates test data based upon selected mode */ #define RANK_DATA(i) (mpi_rank) /* Generates test data to visibly show which rank wrote to which parts of the dataset */ -- cgit v0.12 From 17029af344b23b89b64bd5ba14f5fe1870022c16 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 1 Sep 2017 08:58:37 -0500 Subject: Revert malloc's back to using hard-coded type for sizeof --- src/H5Dmpio.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 463b304..79572c0 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -484,10 +484,10 @@ H5D__mpio_array_gatherv(void *local_array, size_t local_array_num_entries, if (NULL == (gathered_array = H5MM_malloc(gathered_array_num_entries * array_entry_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate gathered array") - if (NULL == (receive_counts_array = (int *) H5MM_malloc((size_t) nprocs * sizeof(*receive_counts_array)))) + if (NULL == (receive_counts_array = (int *) H5MM_malloc((size_t) nprocs * sizeof(int)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate receive counts array") - if (NULL == (displacements_array = (int *) H5MM_malloc((size_t) nprocs * sizeof(*displacements_array)))) + if (NULL == (displacements_array = (int *) H5MM_malloc((size_t) nprocs * sizeof(int)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate receive displacements array") /* Inform each process of how many entries each other process is contributing to the resulting array */ @@ -1476,7 +1476,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* Gather the new chunk sizes to all processes for a collective reallocation * of the chunks in the file. */ - if (H5D__mpio_array_gatherv(chunk_list, chunk_list_num_entries, sizeof(*chunk_list), + if (H5D__mpio_array_gatherv(chunk_list, chunk_list_num_entries, sizeof(H5D_filtered_collective_io_info_t), (void **) &collective_chunk_list, &collective_chunk_list_num_entries, mpi_size, true, 0, io_info->comm, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") @@ -1490,7 +1490,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") } /* end for */ - if (NULL == (num_chunks_selected_array = (size_t *) H5MM_malloc((size_t) mpi_size * sizeof(*num_chunks_selected_array)))) + if (NULL == (num_chunks_selected_array = (size_t *) H5MM_malloc((size_t) mpi_size * sizeof(size_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate num chunks selected array") if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&chunk_list_num_entries, 1, MPI_UNSIGNED_LONG_LONG, num_chunks_selected_array, @@ -1943,16 +1943,16 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Allocate arrays for storing MPI file and mem types and whether or not the * types were derived. */ - if (NULL == (file_type_array = (MPI_Datatype *) H5MM_malloc(max_num_chunks * sizeof(*file_type_array)))) + if (NULL == (file_type_array = (MPI_Datatype *) H5MM_malloc(max_num_chunks * sizeof(MPI_Datatype)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate file type array") - if (NULL == (file_type_is_derived_array = (hbool_t *) H5MM_calloc(max_num_chunks * sizeof(*file_type_is_derived_array)))) + if (NULL == (file_type_is_derived_array = (hbool_t *) H5MM_calloc(max_num_chunks * sizeof(hbool_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate file type is derived array") - if (NULL == (mem_type_array = (MPI_Datatype *) H5MM_malloc(max_num_chunks * sizeof(*mem_type_array)))) + if (NULL == (mem_type_array = (MPI_Datatype *) H5MM_malloc(max_num_chunks * sizeof(MPI_Datatype)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate mem type array") - if (NULL == (mem_type_is_derived_array = (hbool_t *) H5MM_calloc(max_num_chunks * sizeof(*mem_type_is_derived_array)))) + if (NULL == (mem_type_is_derived_array = (hbool_t *) H5MM_calloc(max_num_chunks * sizeof(hbool_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate mem type is derived array") /* Iterate over the max number of chunks among all processes, as this process could @@ -1970,7 +1970,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Gather the new chunk sizes to all processes for a collective re-allocation * of the chunks in the file */ - if (H5D__mpio_array_gatherv(&chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(*chunk_list), + if (H5D__mpio_array_gatherv(&chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(H5D_filtered_collective_io_info_t), (void **) &collective_chunk_list, &collective_chunk_list_num_entries, mpi_size, true, 0, io_info->comm, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") @@ -1986,7 +1986,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") } /* end for */ - if (NULL == (has_chunk_selected_array = (hbool_t *) H5MM_malloc((size_t) mpi_size * sizeof(*has_chunk_selected_array)))) + if (NULL == (has_chunk_selected_array = (hbool_t *) H5MM_malloc((size_t) mpi_size * sizeof(hbool_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate num chunks selected array") if (MPI_SUCCESS != (mpi_code = MPI_Allgather(&have_chunk_to_process, 1, MPI_C_BOOL, has_chunk_selected_array, @@ -2601,7 +2601,7 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, /* pre-computing: calculate number of processes and regularity of the selection occupied in each chunk */ - if(NULL == (nproc_per_chunk = (unsigned*)H5MM_calloc(total_chunks * sizeof(*nproc_per_chunk)))) + if(NULL == (nproc_per_chunk = (unsigned*)H5MM_calloc(total_chunks * sizeof(unsigned)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate nproc_per_chunk buffer") /* calculating the chunk address */ @@ -2745,7 +2745,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ hssize_t select_npoints; hssize_t chunk_npoints; - if (NULL == (local_info_array = (H5D_filtered_collective_io_info_t *) H5MM_malloc(num_chunks_selected * sizeof(*local_info_array)))) + if (NULL == (local_info_array = (H5D_filtered_collective_io_info_t *) H5MM_malloc(num_chunks_selected * sizeof(H5D_filtered_collective_io_info_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate local io info array buffer") chunk_node = H5SL_first(fm->sel_chunks); @@ -2874,7 +2874,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") if (*local_chunk_array_num_entries) - if (NULL == (send_requests = (MPI_Request *) H5MM_malloc(*local_chunk_array_num_entries * sizeof(*send_requests)))) + if (NULL == (send_requests = (MPI_Request *) H5MM_malloc(*local_chunk_array_num_entries * sizeof(MPI_Request)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send requests buffer") if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(H5S_sel_iter_t)))) @@ -2883,20 +2883,20 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty /* Gather every rank's list of chunks to rank 0 to allow it to perform the redistribution operation. After this * call, the gathered list will initially be sorted in increasing order of chunk offset in the file. */ - if (H5D__mpio_array_gatherv(local_chunk_array, *local_chunk_array_num_entries, sizeof(*local_chunk_array), + if (H5D__mpio_array_gatherv(local_chunk_array, *local_chunk_array_num_entries, sizeof(H5D_filtered_collective_io_info_t), (void **) &shared_chunks_info_array, &shared_chunks_info_array_num_entries, mpi_size, false, 0, io_info->comm, H5D__cmp_filtered_collective_io_info_entry) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather array") /* Rank 0 redistributes any shared chunks to new owners as necessary */ if (mpi_rank == 0) { - if (NULL == (send_counts = (int *) H5MM_calloc((size_t) mpi_size * sizeof(*send_counts)))) + if (NULL == (send_counts = (int *) H5MM_calloc((size_t) mpi_size * sizeof(int)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate send counts buffer") - if (NULL == (send_displacements = (int *) H5MM_malloc((size_t) mpi_size * sizeof(*send_displacements)))) + if (NULL == (send_displacements = (int *) H5MM_malloc((size_t) mpi_size * sizeof(int)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate send displacements buffer") - if (NULL == (num_assigned_chunks_array = (size_t *) H5MM_calloc((size_t) mpi_size * sizeof(*num_assigned_chunks_array)))) + if (NULL == (num_assigned_chunks_array = (size_t *) H5MM_calloc((size_t) mpi_size * sizeof(size_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate number of assigned chunks array") for (i = 0; i < shared_chunks_info_array_num_entries;) { @@ -2935,7 +2935,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty * entry gets that entry back, with the possibly newly-modified "new_owner" field */ HDqsort(shared_chunks_info_array, shared_chunks_info_array_num_entries, - sizeof(*shared_chunks_info_array), H5D__cmp_filtered_collective_io_info_entry_owner); + sizeof(H5D_filtered_collective_io_info_t), H5D__cmp_filtered_collective_io_info_entry_owner); send_displacements[0] = 0; for (i = 1; i < (size_t) mpi_size; i++) @@ -2943,7 +2943,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty } /* end if */ /* Scatter the segments of the list back to each process */ - H5_CHECKED_ASSIGN(scatter_recvcount_int, int, *local_chunk_array_num_entries * sizeof(*local_chunk_array), size_t); + H5_CHECKED_ASSIGN(scatter_recvcount_int, int, *local_chunk_array_num_entries * sizeof(H5D_filtered_collective_io_info_t), size_t); if (MPI_SUCCESS != (mpi_code = MPI_Scatterv(shared_chunks_info_array, send_counts, send_displacements, MPI_BYTE, local_chunk_array, scatter_recvcount_int, MPI_BYTE, 0, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "unable to scatter shared chunks info buffer", mpi_code) @@ -2959,7 +2959,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty * chunks it is assigned, in order to avoid potential deadlocking issues. */ if (*local_chunk_array_num_entries) - if (NULL == (mod_data = (unsigned char **) H5MM_malloc(*local_chunk_array_num_entries * sizeof(*mod_data)))) + if (NULL == (mod_data = (unsigned char **) H5MM_malloc(*local_chunk_array_num_entries * sizeof(unsigned char *)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate modification data buffer array") for (i = 0, last_assigned_idx = 0; i < *local_chunk_array_num_entries; i++) { @@ -3062,7 +3062,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty /* Wait for all async send requests to complete before returning */ if (num_send_requests) { - if (NULL == (send_statuses = (MPI_Status *) H5MM_malloc(num_send_requests * sizeof(*send_statuses)))) + if (NULL == (send_statuses = (MPI_Status *) H5MM_malloc(num_send_requests * sizeof(MPI_Status)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate send statuses buffer") H5_CHECK_OVERFLOW(num_send_requests, size_t, int); @@ -3151,7 +3151,7 @@ H5D__mpio_filtered_collective_write_type(H5D_filtered_collective_io_info_t *chun HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective write offset array") /* Ensure the list is sorted in ascending order of offset in the file */ - HDqsort(chunk_list, num_entries, sizeof(*chunk_list), H5D__cmp_filtered_collective_io_info_entry); + HDqsort(chunk_list, num_entries, sizeof(H5D_filtered_collective_io_info_t), H5D__cmp_filtered_collective_io_info_entry); base_buf = chunk_list[0].buf; for (i = 0; i < num_entries; i++) { @@ -3273,7 +3273,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk } /* end else */ /* Initialize iterator for memory selection */ - if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(*mem_iter)))) + if (NULL == (mem_iter = (H5S_sel_iter_t *) H5MM_malloc(sizeof(H5S_sel_iter_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate memory iterator") if (H5S_select_iter_init(mem_iter, chunk_info->mspace, type_info->src_type_size) < 0) -- cgit v0.12 From 487e77b19e596fbf092b3fba3d6567d88ca50b11 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 1 Sep 2017 12:45:48 -0500 Subject: Amend tests to explicitly use H5Dcreate2 and H5Dopen2 --- testpar/t_filters_parallel.c | 56 ++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index d853043..21a5ce0 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -136,7 +136,7 @@ test_one_chunk_filtered_dataset(void) /* Add test filter to the pipeline */ VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - dset_id = H5Dcreate(file_id, ONE_CHUNK_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + dset_id = H5Dcreate2(file_id, ONE_CHUNK_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -199,7 +199,7 @@ test_one_chunk_filtered_dataset(void) read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); VRFY((NULL != read_buf), "calloc succeeded"); - dset_id = H5Dopen(file_id, "/" ONE_CHUNK_FILTERED_DATASET_NAME, H5P_DEFAULT); + dset_id = H5Dopen2(file_id, "/" ONE_CHUNK_FILTERED_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); @@ -282,7 +282,7 @@ test_filtered_dataset_no_overlap(void) /* Add test filter to the pipeline */ VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + dset_id = H5Dcreate2(file_id, UNSHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -344,7 +344,7 @@ test_filtered_dataset_no_overlap(void) read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); VRFY((NULL != read_buf), "calloc succeeded"); - dset_id = H5Dopen(file_id, "/" UNSHARED_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); + dset_id = H5Dopen2(file_id, "/" UNSHARED_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); @@ -428,7 +428,7 @@ test_filtered_dataset_overlap(void) /* Add test filter to the pipeline */ VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - dset_id = H5Dcreate(file_id, SHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + dset_id = H5Dcreate2(file_id, SHARED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -491,7 +491,7 @@ test_filtered_dataset_overlap(void) read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); VRFY((NULL != read_buf), "calloc succeeded"); - dset_id = H5Dopen(file_id, "/" SHARED_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); + dset_id = H5Dopen2(file_id, "/" SHARED_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); @@ -581,7 +581,7 @@ test_filtered_dataset_single_no_selection(void) /* Add test filter to the pipeline */ VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - dset_id = H5Dcreate(file_id, SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + dset_id = H5Dcreate2(file_id, SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -650,7 +650,7 @@ test_filtered_dataset_single_no_selection(void) read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); VRFY((NULL != read_buf), "calloc succeeded"); - dset_id = H5Dopen(file_id, "/" SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); + dset_id = H5Dopen2(file_id, "/" SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); @@ -732,7 +732,7 @@ test_filtered_dataset_all_no_selection(void) /* Add test filter to the pipeline */ VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - dset_id = H5Dcreate(file_id, ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + dset_id = H5Dcreate2(file_id, ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -773,7 +773,7 @@ test_filtered_dataset_all_no_selection(void) read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); VRFY((NULL != read_buf), "calloc succeeded"); - dset_id = H5Dopen(file_id, "/" ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); + dset_id = H5Dopen2(file_id, "/" ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); @@ -852,7 +852,7 @@ test_filtered_dataset_point_selection(void) /* Add test filter to the pipeline */ VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - dset_id = H5Dcreate(file_id, POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + dset_id = H5Dcreate2(file_id, POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -909,7 +909,7 @@ test_filtered_dataset_point_selection(void) read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); VRFY((NULL != read_buf), "calloc succeeded"); - dset_id = H5Dopen(file_id, "/" POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); + dset_id = H5Dopen2(file_id, "/" POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); @@ -995,7 +995,7 @@ test_filtered_dataset_interleaved_write(void) /* Add test filter to the pipeline */ VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - dset_id = H5Dcreate(file_id, INTERLEAVED_WRITE_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + dset_id = H5Dcreate2(file_id, INTERLEAVED_WRITE_FILTERED_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -1063,7 +1063,7 @@ test_filtered_dataset_interleaved_write(void) read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); VRFY((NULL != read_buf), "calloc succeeded"); - dset_id = H5Dopen(file_id, "/" INTERLEAVED_WRITE_FILTERED_DATASET_NAME, H5P_DEFAULT); + dset_id = H5Dopen2(file_id, "/" INTERLEAVED_WRITE_FILTERED_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); @@ -1148,7 +1148,7 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) /* Add test filter to the pipeline */ VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + dset_id = H5Dcreate2(file_id, UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -1213,7 +1213,7 @@ test_3d_filtered_dataset_no_overlap_separate_pages(void) read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); VRFY((NULL != read_buf), "calloc succeeded"); - dset_id = H5Dopen(file_id, "/" UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME, H5P_DEFAULT); + dset_id = H5Dopen2(file_id, "/" UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); @@ -1299,7 +1299,7 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) /* Add test filter to the pipeline */ VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - dset_id = H5Dcreate(file_id, UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + dset_id = H5Dcreate2(file_id, UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -1364,7 +1364,7 @@ test_3d_filtered_dataset_no_overlap_same_pages(void) read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); VRFY((NULL != read_buf), "calloc succeeded"); - dset_id = H5Dopen(file_id, "/" UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME, H5P_DEFAULT); + dset_id = H5Dopen2(file_id, "/" UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); @@ -1450,7 +1450,7 @@ test_3d_filtered_dataset_overlap(void) /* Add test filter to the pipeline */ VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - dset_id = H5Dcreate(file_id, SHARED_FILTERED_CHUNKS_3D_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + dset_id = H5Dcreate2(file_id, SHARED_FILTERED_CHUNKS_3D_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -1522,7 +1522,7 @@ test_3d_filtered_dataset_overlap(void) read_buf = (C_DATATYPE *) calloc(1, correct_buf_size); VRFY((NULL != read_buf), "calloc succeeded"); - dset_id = H5Dopen(file_id, "/" SHARED_FILTERED_CHUNKS_3D_DATASET_NAME, H5P_DEFAULT); + dset_id = H5Dopen2(file_id, "/" SHARED_FILTERED_CHUNKS_3D_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0), "Dataset read succeeded"); @@ -1612,7 +1612,7 @@ test_cmpd_filtered_dataset_no_conversion_unshared(void) VRFY((H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) >= 0), "Datatype insertion succeeded"); VRFY((H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) >= 0), "Datatype insertion succeeded"); - dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_NAME, memtype, filespace, + dset_id = H5Dcreate2(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_NAME, memtype, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -1744,7 +1744,7 @@ test_cmpd_filtered_dataset_no_conversion_shared(void) VRFY((H5Tinsert(memtype, "LongData", HOFFSET(cmpd_filtered_t, field3), H5T_NATIVE_LONG) >= 0), "Datatype insertion succeeded"); VRFY((H5Tinsert(memtype, "DoubleData", HOFFSET(cmpd_filtered_t, field4), H5T_NATIVE_DOUBLE) >= 0), "Datatype insertion succeeded"); - dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_NAME, memtype, filespace, + dset_id = H5Dcreate2(file_id, COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_NAME, memtype, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -1890,7 +1890,7 @@ test_cmpd_filtered_dataset_type_conversion_unshared(void) VRFY((H5Tinsert(filetype, "LongData", 16, H5T_STD_I64BE) >= 0), "Datatype insertion succeeded"); VRFY((H5Tinsert(filetype, "DoubleData", 24, H5T_IEEE_F64BE) >= 0), "Datatype insertion succeeded"); - dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_NAME, filetype, filespace, + dset_id = H5Dcreate2(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_NAME, filetype, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -2040,7 +2040,7 @@ test_cmpd_filtered_dataset_type_conversion_shared(void) VRFY((H5Tinsert(filetype, "LongData", 16, H5T_STD_I64BE) >= 0), "Datatype insertion succeeded"); VRFY((H5Tinsert(filetype, "DoubleData", 24, H5T_IEEE_F64BE) >= 0), "Datatype insertion succeeded"); - dset_id = H5Dcreate(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_NAME, filetype, filespace, + dset_id = H5Dcreate2(file_id, COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_NAME, filetype, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -2163,7 +2163,7 @@ test_write_serial_read_parallel(void) /* Add test filter to the pipeline */ VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - dset_id = H5Dcreate(file_id, WRITE_SERIAL_READ_PARALLEL_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + dset_id = H5Dcreate2(file_id, WRITE_SERIAL_READ_PARALLEL_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -2210,7 +2210,7 @@ test_write_serial_read_parallel(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); - dset_id = H5Dopen(file_id, "/" WRITE_SERIAL_READ_PARALLEL_DATASET_NAME, H5P_DEFAULT); + dset_id = H5Dopen2(file_id, "/" WRITE_SERIAL_READ_PARALLEL_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); plist_id = H5Pcreate(H5P_DATASET_XFER); @@ -2300,7 +2300,7 @@ test_write_parallel_read_serial(void) /* Add test filter to the pipeline */ VRFY((SET_FILTER(plist_id) >= 0), "Filter set"); - dset_id = H5Dcreate(file_id, WRITE_PARALLEL_READ_SERIAL_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, + dset_id = H5Dcreate2(file_id, WRITE_PARALLEL_READ_SERIAL_DATASET_NAME, HDF5_DATATYPE_NAME, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); @@ -2369,7 +2369,7 @@ test_write_parallel_read_serial(void) VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded"); - dset_id = H5Dopen(file_id, "/" WRITE_PARALLEL_READ_SERIAL_DATASET_NAME, H5P_DEFAULT); + dset_id = H5Dopen2(file_id, "/" WRITE_PARALLEL_READ_SERIAL_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); -- cgit v0.12 From 9b6f4d4937bd0e196e472e71120d6ed4b17e24f7 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 4 Sep 2017 00:41:47 -0500 Subject: Adding new C++ wrappers Description: Added wrappers for H5Tencode to class DataType and H5Tdecode to classes DataType and its subclasses. // Creates a binary object description of this datatype. void DataType::encode() // Returns the decoded type from the binary object description. virtual DataType* DataType::decode() const; virtual DataType* ArrayType::decode() const; virtual DataType* CompType::decode() const; virtual DataType* DataType::decode() const; virtual DataType* EnumType::decode() const; virtual DataType* FloatType::decode() const; virtual DataType* IntType::decode() const; virtual DataType* StrType::decode() const; virtual DataType* VarLenType::decode() const; Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) --- c++/src/H5ArrayType.cpp | 21 ++++ c++/src/H5ArrayType.h | 4 + c++/src/H5Classes.h | 2 +- c++/src/H5CompType.cpp | 21 ++++ c++/src/H5CompType.h | 4 + c++/src/H5DataType.cpp | 123 +++++++++++++++++++++-- c++/src/H5DataType.h | 19 ++++ c++/src/H5EnumType.cpp | 21 ++++ c++/src/H5EnumType.h | 4 + c++/src/H5FloatType.cpp | 23 ++++- c++/src/H5FloatType.h | 4 + c++/src/H5IntType.cpp | 21 ++++ c++/src/H5IntType.h | 4 + c++/src/H5StrType.cpp | 21 ++++ c++/src/H5StrType.h | 4 + c++/src/H5VarLenType.cpp | 21 ++++ c++/src/H5VarLenType.h | 4 + c++/test/ttypes.cpp | 252 +++++++++++++++++++++++++++++++++++++++++++---- 18 files changed, 543 insertions(+), 30 deletions(-) diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 9d4a973..c39ef35 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -139,6 +139,27 @@ ArrayType& ArrayType::operator=(const ArrayType& rhs) } //-------------------------------------------------------------------------- +// Function: ArrayType::decode +///\brief Returns an ArrayType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Aug 2017 +//-------------------------------------------------------------------------- +DataType* ArrayType::decode() const +{ + hid_t encoded_arrtype_id; + try { + encoded_arrtype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + ArrayType *encoded_arrtype = new ArrayType; + encoded_arrtype->p_setId(encoded_arrtype_id); + return(encoded_arrtype); +} + +//-------------------------------------------------------------------------- // Function: ArrayType::getArrayNDims ///\brief Returns the number of dimensions for an array datatype. ///\return Number of dimensions diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index ffb8712..e3709cd 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -36,6 +36,10 @@ class H5_DLLCPP ArrayType : public DataType { ArrayType(const H5Location& loc, const char* name); ArrayType(const H5Location& loc, const H5std_string& name); + // Returns an ArrayType object via DataType* by decoding the + // binary object description of this type. + virtual DataType* decode() const; + // Returns the number of dimensions of this array datatype. int getArrayNDims() const; //int getArrayNDims(); // removed 1.8.18 and 1.10.1 diff --git a/c++/src/H5Classes.h b/c++/src/H5Classes.h index f0f6359..8b1e6ed 100644 --- a/c++/src/H5Classes.h +++ b/c++/src/H5Classes.h @@ -31,10 +31,10 @@ namespace H5 { class DataSpace; class AtomType; class PredType; - class EnumType; class IntType; class FloatType; class StrType; + class EnumType; class CompType; class AbstractDs; class DataSet; diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index f7862c9..95fddc1 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -124,6 +124,27 @@ CompType::CompType(const H5Location& loc, const H5std_string& dtype_name) : Data } //-------------------------------------------------------------------------- +// Function: CompType::decode +///\brief Returns a CompType object via DataType* by decoding the +/// binary object description of this datatype. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Aug 2017 +//-------------------------------------------------------------------------- +DataType* CompType::decode() const +{ + hid_t encoded_cmptype_id; + try { + encoded_cmptype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + CompType *encoded_cmptype = new CompType; + encoded_cmptype->p_setId(encoded_cmptype_id); + return(encoded_cmptype); +} + +//-------------------------------------------------------------------------- // Function: CompType::getNmembers ///\brief Returns the number of members in this compound datatype. ///\return Number of members diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 018d875..bf687de 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -44,6 +44,10 @@ class H5_DLLCPP CompType : public DataType { CompType(const H5Location& loc, const char* name); CompType(const H5Location& loc, const H5std_string& name); + // Returns a CompType object via DataType* by decoding the binary + // object description of this type. + virtual DataType* decode() const; + // Returns the type class of the specified member of this compound // datatype. It provides to the user a way of knowing what type // to create another datatype of the same class diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 57f9361..11b30cc 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -48,7 +48,7 @@ using std::endl; ///\brief Default constructor: Creates a stub datatype // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType::DataType() : H5Object(), id(H5I_INVALID_HID) {} +DataType::DataType() : H5Object(), id(H5I_INVALID_HID), encoded_buf(NULL), buf_size(0) {} //-------------------------------------------------------------------------- // Function: DataType overloaded constructor @@ -63,7 +63,7 @@ DataType::DataType() : H5Object(), id(H5I_INVALID_HID) {} // Removed second argument, "predefined", after changing to the // new ref counting mechanism that relies on C's ref counting. //-------------------------------------------------------------------------- -DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id) +DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id), encoded_buf(NULL), buf_size(0) { incRefCount(); // increment number of references to this id } @@ -76,7 +76,7 @@ DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id) ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object() +DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object(), encoded_buf(NULL), buf_size(0) { // Call C routine to create the new datatype id = H5Tcreate(type_class, size); @@ -100,7 +100,7 @@ DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object() // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object() +DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), encoded_buf(NULL), buf_size(0) { id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -119,7 +119,7 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- - /* DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) + /* DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID), encoded_buf(NULL), buf_size(0) { id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -130,7 +130,7 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, ///\brief Copy constructor: makes a copy of the original DataType object // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType::DataType(const DataType& original) : H5Object(), id(original.id) +DataType::DataType(const DataType& original) : H5Object(), id(original.id), encoded_buf(NULL), buf_size(0) { incRefCount(); // increment number of references to this id } @@ -148,7 +148,7 @@ DataType::DataType(const DataType& original) : H5Object(), id(original.id) // unnecessarily and will produce undefined behavior. // -BMR, Apr 2015 //-------------------------------------------------------------------------- -DataType::DataType(const PredType& pred_type) : H5Object() +DataType::DataType(const PredType& pred_type) : H5Object(), encoded_buf(NULL), buf_size(0) { // Call C routine to copy the datatype id = H5Tcopy(pred_type.getId()); @@ -170,7 +170,7 @@ DataType::DataType(const PredType& pred_type) : H5Object() // improve usability. // -BMR, Dec 2016 //-------------------------------------------------------------------------- -DataType::DataType(const H5Location& loc, const char *dtype_name) : H5Object() +DataType::DataType(const H5Location& loc, const char *dtype_name) : H5Object(), encoded_buf(NULL), buf_size(0) { id = p_opentype(loc, dtype_name); } @@ -189,7 +189,7 @@ DataType::DataType(const H5Location& loc, const char *dtype_name) : H5Object() // improve usability. // -BMR, Dec 2016 //-------------------------------------------------------------------------- -DataType::DataType(const H5Location& loc, const H5std_string& dtype_name) : H5Object() +DataType::DataType(const H5Location& loc, const H5std_string& dtype_name) : H5Object(), encoded_buf(NULL), buf_size(0) { id = p_opentype(loc, dtype_name.c_str()); } @@ -248,6 +248,102 @@ void DataType::copy(const DataSet& dset) } //-------------------------------------------------------------------------- +// Function: DataType::p_decode +// Purpose Returns an id of a type by decoding the binary object +/// description of this datatype. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Aug 2017 +//-------------------------------------------------------------------------- +hid_t DataType::p_decode() const +{ + // Make sure that the buffer can be decoded + if (encoded_buf == NULL) + { + throw DataTypeIException("DataType::p_decode", "No encoded buffer"); + } + + // Call C function to decode the binary object description + hid_t encoded_dtype_id = H5Tdecode(encoded_buf); + + // If H5Tdecode fails, raise exception + if (encoded_dtype_id < 0) + { + throw DataTypeIException("DataType::p_decode", "H5Tdecode failed"); + } + else + { + return(encoded_dtype_id); + } +} + +//-------------------------------------------------------------------------- +// Function: DataType::decode +///\brief Returns a DataType instance by decoding the binary object +/// description of this datatype. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Aug 2017 +//-------------------------------------------------------------------------- +DataType* DataType::decode() const +{ + hid_t encoded_dtype_id; + try { + encoded_dtype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + DataType *encoded_dtype = new DataType; + encoded_dtype->p_setId(encoded_dtype_id); + return(encoded_dtype); +} + +//-------------------------------------------------------------------------- +// Function: DataType::encode +///\brief Creates a binary object description of this datatype. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Aug 2017 +//-------------------------------------------------------------------------- +void DataType::encode() +{ + // Call H5Tencode passing in null to determine the size of the buffer + herr_t ret_value = H5Tencode(id, NULL, &buf_size); + if (ret_value < 0) + { + throw DataTypeIException("DataType::encode", "Failed to get buf_size"); + } + + // Allocate buffer and call C function again to encode + if (buf_size > 0) + { + encoded_buf = (unsigned char *)HDcalloc((size_t)1, buf_size); + ret_value = H5Tencode(id, encoded_buf, &buf_size); + if (ret_value < 0) + { + throw DataTypeIException("DataType::encode", "H5Tencode failed"); + } + } + else + { + throw DataTypeIException("DataType::encode", "Failed to allocate buffer for encoding"); + } +} + +//-------------------------------------------------------------------------- +// Function: DataType::hasBinaryDesc +///\brief Determines whether this datatype has a binary object +/// description. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Aug 2017 +//-------------------------------------------------------------------------- +bool DataType::hasBinaryDesc() const +{ + if (encoded_buf != NULL) + return true; + else + return false; +} + +//-------------------------------------------------------------------------- // Function: DataType::operator= ///\brief Assignment operator ///\param rhs - IN: Reference to the existing datatype @@ -827,8 +923,15 @@ void DataType::close() { throw DataTypeIException(inMemFunc("close"), "H5Tclose failed"); } - // reset the id + // Reset the id id = H5I_INVALID_HID; + + // Free and reset buffer of encoded object description if it's been used + if (encoded_buf != NULL) + { + HDfree(encoded_buf); + buf_size = 0; + } } } diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 32a79fa..50d2fc1 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -50,6 +50,13 @@ class H5_DLLCPP DataType : public H5Object { // Copies the datatype of dset to this datatype object. void copy(const DataSet& dset); + // Returns a DataType instance by decoding the binary object + // description of this datatype. + virtual DataType* decode() const; + + // Creates a binary object description of this datatype. + void encode(); + // Returns the datatype class identifier. H5T_class_t getClass() const; @@ -130,6 +137,9 @@ class H5_DLLCPP DataType : public H5Object { // Default constructor DataType(); + // Determines whether this datatype has a binary object description. + bool hasBinaryDesc() const; + // Gets the datatype id. virtual hid_t getId() const; @@ -140,6 +150,10 @@ class H5_DLLCPP DataType : public H5Object { #ifndef DOXYGEN_SHOULD_SKIP_THIS hid_t id; // HDF5 datatype id + // Returns an id of a type by decoding the binary object + // description of this datatype. + hid_t p_decode() const; + // Sets the datatype id. virtual void p_setId(const hid_t new_id); @@ -149,6 +163,11 @@ class H5_DLLCPP DataType : public H5Object { #endif // DOXYGEN_SHOULD_SKIP_THIS private: + // Buffer for binary object description of this datatype, allocated + // in DataType::encode and used in DataType::decode + unsigned char *encoded_buf; + size_t buf_size; + // Friend function to set DataType id. For library use only. friend void f_DataType_setId(DataType* dtype, hid_t new_id); diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index a96239c..f9046be 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -146,6 +146,27 @@ EnumType::EnumType(const H5Location& loc, const H5std_string& dtype_name) : Data } //-------------------------------------------------------------------------- +// Function: EnumType::decode +///\brief Returns an EnumType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Aug 2017 +//-------------------------------------------------------------------------- +DataType* EnumType::decode() const +{ + hid_t encoded_cmptype_id; + try { + encoded_cmptype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + EnumType *encoded_cmptype = new EnumType; + encoded_cmptype->p_setId(encoded_cmptype_id); + return(encoded_cmptype); +} + +//-------------------------------------------------------------------------- // Function: EnumType::insert ///\brief Inserts a new member to this enumeration datatype. ///\param name - IN: Name of the new member diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index fc8089e..6468bf7 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -40,6 +40,10 @@ class H5_DLLCPP EnumType : public DataType { EnumType(const H5Location& loc, const char* name); EnumType(const H5Location& loc, const H5std_string& name); + // Returns an EnumType object via DataType* by decoding the + // binary object description of this type. + virtual DataType* decode() const; + // Returns the number of members in this enumeration datatype. int getNmembers () const; diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 6bb3fd6..66a7466 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -71,7 +71,7 @@ FloatType::FloatType(const hid_t existing_id) : AtomType( existing_id ) {} FloatType::FloatType(const FloatType& original) : AtomType( original ){} //-------------------------------------------------------------------------- -// Function: EnumType overloaded constructor +// Function: FloatType overloaded constructor ///\brief Gets the floating-point datatype of the specified dataset ///\param dataset - IN: Dataset that this floating-point datatype /// associates with @@ -128,6 +128,27 @@ FloatType::FloatType(const H5Location& loc, const H5std_string& dtype_name) : At } //-------------------------------------------------------------------------- +// Function: FloatType::decode +///\brief Returns an FloatType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Aug 2017 +//-------------------------------------------------------------------------- +DataType* FloatType::decode() const +{ + hid_t encoded_flttype_id; + try { + encoded_flttype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + FloatType *encoded_flttype = new FloatType; + encoded_flttype->p_setId(encoded_flttype_id); + return(encoded_flttype); +} + +//-------------------------------------------------------------------------- // Function: FloatType::getFields ///\brief Retrieves floating point datatype bit field information. ///\param spos - OUT: Retrieved floating-point sign bit diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index e84f50b..4f277c3 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -35,6 +35,10 @@ class H5_DLLCPP FloatType : public AtomType { FloatType(const H5Location& loc, const char* name); FloatType(const H5Location& loc, const H5std_string& name); + // Returns an FloatType object via DataType* by decoding the + // binary object description of this type. + virtual DataType* decode() const; + // Retrieves the exponent bias of a floating-point type. size_t getEbias() const; diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index fb7e476..8408732 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -127,6 +127,27 @@ IntType::IntType(const H5Location& loc, const H5std_string& dtype_name) : AtomTy } //-------------------------------------------------------------------------- +// Function: IntType::decode +///\brief Returns an IntType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Aug 2017 +//-------------------------------------------------------------------------- +DataType* IntType::decode() const +{ + hid_t encoded_inttype_id; + try { + encoded_inttype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + IntType *encoded_inttype = new IntType; + encoded_inttype->p_setId(encoded_inttype_id); + return(encoded_inttype); +} + +//-------------------------------------------------------------------------- // Function: IntType::getSign ///\brief Retrieves the sign type for an integer type. ///\return Valid sign type diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index 82a7cfd..54a4975 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -35,6 +35,10 @@ class H5_DLLCPP IntType : public AtomType { IntType(const H5Location& loc, const char* name); IntType(const H5Location& loc, const H5std_string& name); + // Returns an IntType object via DataType* by decoding the + // binary object description of this type. + virtual DataType* decode() const; + // Retrieves the sign type for an integer type H5T_sign_t getSign() const; diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index d5fb744..cbb2103 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -181,6 +181,27 @@ StrType::StrType(const H5Location& loc, const H5std_string& dtype_name) : AtomTy } //-------------------------------------------------------------------------- +// Function: StrType::decode +///\brief Returns an StrType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Aug 2017 +//-------------------------------------------------------------------------- +DataType* StrType::decode() const +{ + hid_t encoded_strtype_id; + try { + encoded_strtype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + StrType *encoded_strtype = new StrType; + encoded_strtype->p_setId(encoded_strtype_id); + return(encoded_strtype); +} + +//-------------------------------------------------------------------------- // Function: StrType::getCset ///\brief Retrieves the character set type of this string datatype. ///\return Character set type, which can be: diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index abac8de..fd0402e 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -41,6 +41,10 @@ class H5_DLLCPP StrType : public AtomType { StrType(const H5Location& loc, const char* name); StrType(const H5Location& loc, const H5std_string& name); + // Returns an StrType object via DataType* by decoding the + // binary object description of this type. + virtual DataType* decode() const; + // Retrieves the character set type of this string datatype. H5T_cset_t getCset() const; diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 22e1a66..fcea8cd 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -109,6 +109,27 @@ VarLenType::VarLenType(const H5Location& loc, const H5std_string& dtype_name) : } //-------------------------------------------------------------------------- +// Function: VarLenType::decode +///\brief Returns an VarLenType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Aug 2017 +//-------------------------------------------------------------------------- +DataType* VarLenType::decode() const +{ + hid_t encoded_vltype_id; + try { + encoded_vltype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + VarLenType *encoded_vltype = new VarLenType; + encoded_vltype->p_setId(encoded_vltype_id); + return(encoded_vltype); +} + +//-------------------------------------------------------------------------- // Function: VarLenType destructor ///\brief Properly terminates access to this datatype. // Programmer Binh-Minh Ribler - May, 2004 diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index 4048a4e..17d812f 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -29,6 +29,10 @@ class H5_DLLCPP VarLenType : public DataType { // on the specified base type. VarLenType(const DataType* base_type); + // Returns an VarLenType object via DataType* by decoding the + // binary object description of this type. + virtual DataType* decode() const; + ///\brief Returns this class name. virtual H5std_string fromClass () const { return("VarLenType"); } diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index f76f780..ec644a8 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -80,6 +80,12 @@ typedef enum int_t { INT_LONG, INT_ULONG, INT_LLONG, INT_ULLONG, INT_OTHER } int_t; +typedef struct { + int a; + float b; + long c; + double d; +} src_typ_t; /*------------------------------------------------------------------------- * Function: test_classes @@ -125,9 +131,7 @@ static void test_classes() * * Purpose Test datatype copy functionality * - * Return Success: 0 - * - * Failure: number of errors + * Return None * * Programmer Binh-Minh Ribler (using C version) * January, 2007 @@ -183,9 +187,7 @@ static void test_copy() * * Purpose Tests query functions of compound and enumeration types. * - * Return Success: 0 - * - * Failure: number of errors + * Return None * * Programmer Binh-Minh Ribler (use C version) * January, 2007 @@ -200,12 +202,6 @@ const H5std_string EnumT_NAME("Enum_type"); static void test_query() { - typedef struct { - int a; - float b; - long c; - double d; - } src_typ_t; short enum_val; // Output message about test being performed @@ -317,9 +313,7 @@ static void test_query() * * Purpose Tests transient datatypes. * - * Return Success: 0 - * - * Failure: number of errors + * Return None * * Programmer Binh-Minh Ribler (use C version) * January, 2007 @@ -396,9 +390,7 @@ static void test_transient () * * Purpose Tests named datatypes. * - * Return Success: 0 - * - * Failure: number of errors + * Return None * * Programmer Binh-Minh Ribler (use C version) * January, 2007 @@ -556,6 +548,229 @@ static void test_named () } // test_named +/*------------------------------------------------------------------------- + * Function: test_encode_decode + * + * Purpose Test datatype encode/decode functionality. + * + * Return None + * + * Programmer Binh-Minh Ribler (using C version) + * August, 2017 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +const H5std_string filename3("encode_decode.h5"); +const int ARRAY1_RANK = 1; +const int ARRAY1_DIM = 10; +static void test_encode_decode() +{ + short enum_val; + + SUBTEST("DataType::encode() and DataType::decode()"); + try { + // Create the file. + H5File file(filename3, H5F_ACC_TRUNC); + + // + // Test with CompType + // + + // Create a compound datatype + CompType cmptyp(sizeof(src_typ_t)); + + cmptyp.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + cmptyp.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_FLOAT); + cmptyp.insertMember("c", HOFFSET(src_typ_t, c), PredType::NATIVE_LONG); + cmptyp.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_DOUBLE); + + // Encode compound type in its buffer + cmptyp.encode(); + + // Verify that encoding had been done + verify_val(cmptyp.hasBinaryDesc(), true, "DataType::encode", __LINE__, __FILE__); + + // Decode compound type's buffer to a new CompType + CompType* decoded_cmp_ptr(static_cast(cmptyp.decode())); + + // Verify that the datatype was copied exactly via encoding/decoding + verify_val(cmptyp == *decoded_cmp_ptr, true, "DataType::decode", __LINE__, __FILE__); + + // Verify again via querying member number and member index by name. + verify_val(decoded_cmp_ptr->getNmembers(), 4, "DataType::decode", __LINE__, __FILE__); + verify_val(decoded_cmp_ptr->getMemberIndex("c"), 2, "DataType::decode", __LINE__, __FILE__); + + // Create a CompType instance from the pointer and verify it + CompType cmptyp_clone(*decoded_cmp_ptr); + verify_val(cmptyp == cmptyp_clone, true, "DataType::decode", __LINE__, __FILE__); + verify_val(cmptyp_clone.getNmembers(), 4, "DataType::decode", __LINE__, __FILE__); + verify_val(cmptyp_clone.getMemberIndex("c"), 2, "DataType::decode", __LINE__, __FILE__); + + delete decoded_cmp_ptr; + + // + // Test with EnumType + // + + // Create a enumerate datatype + EnumType enumtyp(sizeof(short)); + + enumtyp.insert("RED", (enum_val=0,&enum_val)); + enumtyp.insert("GREEN", (enum_val=1,&enum_val)); + enumtyp.insert("BLUE", (enum_val=2,&enum_val)); + enumtyp.insert("ORANGE", (enum_val=3,&enum_val)); + enumtyp.insert("YELLOW", (enum_val=4,&enum_val)); + + // Encode compound type in a buffer + enumtyp.encode(); + + // Verify that encoding had been done + verify_val(enumtyp.hasBinaryDesc(), true, "DataType::encode", __LINE__, __FILE__); + + // Decode enumeration type's buffer to a new EnumType + EnumType* decoded_enum_ptr(static_cast(enumtyp.decode())); + + // Verify that the datatype was copied exactly via encoding/decoding + verify_val(enumtyp == *decoded_enum_ptr, true, "DataType::decode", __LINE__, __FILE__); + + // Verify again via querying member number and member index by name. + verify_val(decoded_enum_ptr->getNmembers(), 5, "DataType::decode", __LINE__, __FILE__); + verify_val(decoded_enum_ptr->getMemberIndex("GREEN"), 1, "DataType::decode", __LINE__, __FILE__); + + // Create a EnumType instance from the pointer and verify it + EnumType enumtyp_clone(*decoded_enum_ptr); + verify_val(enumtyp == enumtyp_clone, true, "DataType::decode", __LINE__, __FILE__); + verify_val(enumtyp_clone.getNmembers(), 5, "DataType::decode", __LINE__, __FILE__); + verify_val(enumtyp_clone.getMemberIndex("GREEN"), 1, "DataType::decode", __LINE__, __FILE__); + + delete decoded_enum_ptr; + + // + // Test with variable-length string + // + + // Create a variable-length string type + StrType vlsttyp(PredType::C_S1); + vlsttyp.setSize(H5T_VARIABLE); + + // Encode the variable-length type in its buffer + vlsttyp.encode(); + + // Verify that encoding had been done + verify_val(vlsttyp.hasBinaryDesc(), true, "DataType::encode", __LINE__, __FILE__); + + // Decode the variable-length type's buffer to a new StrType + StrType* decoded_str_ptr(static_cast(vlsttyp.decode())); + + verify_val(vlsttyp == *decoded_str_ptr, true, "DataType::decode", __LINE__, __FILE__); + verify_val(decoded_str_ptr->isVariableStr(), true, "DataType::decode", __LINE__, __FILE__); + + delete decoded_str_ptr; + + // Test decoding the type by way of DataType* + + // Decode variable-length string type to a new DataType + DataType* decoded_vlstr_ptr(vlsttyp.decode()); + + // Create a StrType instance from the DataType object and verify it + StrType decoded_vlsttyp(decoded_vlstr_ptr->getId()); + verify_val(vlsttyp == decoded_vlsttyp, true, "DataType::decode", __LINE__, __FILE__); + verify_val(decoded_vlsttyp.isVariableStr(), true, "DataType::decode", __LINE__, __FILE__); + + delete decoded_vlstr_ptr; + + // + // Test with ArrayType + // + + hsize_t tdims1[] = {ARRAY1_DIM}; + + // Create an array datatype of the compound datatype + ArrayType arrtyp(cmptyp, ARRAY1_RANK, tdims1); + + // Encode the array type in its buffer + arrtyp.encode(); + + // Verify that encoding had been done + verify_val(arrtyp.hasBinaryDesc(), true, "DataType::encode", __LINE__, __FILE__); + + // Create an ArrayType instance from the decoded pointer and verify it + ArrayType* decoded_arr_ptr(static_cast(arrtyp.decode())); + + verify_val(arrtyp == *decoded_arr_ptr, true, "DataType::decode", __LINE__, __FILE__); + + delete decoded_arr_ptr; + + // Test decoding the type by way of DataType* + + // Decode the array type's buffer + DataType *decoded_dt_ptr = arrtyp.decode(); + + // Create a ArrayType instance from the decoded pointer and verify it + ArrayType decoded_arrtyp(decoded_dt_ptr->getId()); + verify_val(arrtyp == decoded_arrtyp, true, "DataType::decode", __LINE__, __FILE__); + verify_val(decoded_arrtyp.getArrayNDims(), ARRAY1_RANK, "DataType::decode", __LINE__, __FILE__); + + delete decoded_dt_ptr; + + // + // Test with IntType + // + + // Create an int datatype + IntType inttyp(PredType::NATIVE_UINT); + + // Encode the array type in its buffer + inttyp.encode(); + + // Verify that encoding had been done + verify_val(inttyp.hasBinaryDesc(), true, "DataType::encode", __LINE__, __FILE__); + + // Create an IntType instance from the decoded pointer and verify it + IntType* decoded_int_ptr(static_cast(inttyp.decode())); + H5T_sign_t int_sign = decoded_int_ptr->getSign(); + verify_val(int_sign, H5T_SGN_NONE, "DataType::decode", __LINE__, __FILE__); + verify_val(inttyp == *decoded_int_ptr, true, "DataType::decode", __LINE__, __FILE__); + + delete decoded_int_ptr; + + // + // Test decoding FloatType by way of DataType* + // + + // Create a float datatype + FloatType flttyp(PredType::NATIVE_FLOAT); + + // Encode the float type in its buffer + flttyp.encode(); + + // Verify that encoding had been done + verify_val(flttyp.hasBinaryDesc(), true, "DataType::encode", __LINE__, __FILE__); + + // Decode the array type's buffer + DataType* decoded_flt_ptr(flttyp.decode()); + + // Create a IntType instance from the decoded pointer and verify it + FloatType decoded_flttyp(decoded_flt_ptr->getId()); + verify_val(flttyp == decoded_flttyp, true, "DataType::decode", __LINE__, __FILE__); + + H5std_string norm_string; + H5T_norm_t mant_norm = decoded_flttyp.getNorm(norm_string); + //verify_val(decoded_flttyp.isVariableStr(), true, "DataType::decode", __LINE__, __FILE__); + + delete decoded_flt_ptr; + + PASSED(); + } + catch (Exception& E) + { + issue_fail_msg("test_encode_decode", __LINE__, __FILE__, E.getCDetailMsg()); + } +} + + /**************************************************************** ** ** test_types(): Main datatypes testing routine. @@ -573,6 +788,7 @@ void test_types() test_query(); test_transient(); test_named(); + test_encode_decode(); } // test_types() -- cgit v0.12 From e271abfb36e59198124cb0d37286ceeb67c90e10 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 Sep 2017 10:18:18 -0500 Subject: HDFFV-10276 Add filter mask for standard err --- tools/test/h5diff/CMakeTests.cmake | 3 +++ tools/test/h5diff/testfiles/h5diff_454_ERR.txt | 4 ++-- tools/test/h5diff/testfiles/h5diff_455_ERR.txt | 4 ++-- tools/test/h5diff/testfiles/h5diff_457_ERR.txt | 4 ++-- tools/test/h5diff/testfiles/h5diff_458_ERR.txt | 4 ++-- tools/test/h5diff/testfiles/h5diff_459_ERR.txt | 4 ++-- tools/test/h5diff/testfiles/h5diff_601_ERR.txt | 4 ++-- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index a07d3c9..0f61539 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -412,6 +412,7 @@ -D "TEST_OUTPUT=${resultfile}_ERR.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}_ERR.txt" + -D "TEST_MASK_ERROR=true" -D "TEST_APPEND=EXIT CODE:" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) @@ -521,6 +522,7 @@ -D "TEST_OUTPUT=${resultfile}_ERR.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}_ERR.txt" + -D "TEST_MASK_ERROR=true" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}" @@ -536,6 +538,7 @@ -D "TEST_OUTPUT=${resultfile}_ERR.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}_ERR.txt" + -D "TEST_MASK_ERROR=true" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" diff --git a/tools/test/h5diff/testfiles/h5diff_454_ERR.txt b/tools/test/h5diff/testfiles/h5diff_454_ERR.txt index 61ae5ed..de25a69 100644 --- a/tools/test/h5diff/testfiles/h5diff_454_ERR.txt +++ b/tools/test/h5diff/testfiles/h5diff_454_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. -H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: - #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 861 in h5diff(): Error: treat dangling link as error +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_455_ERR.txt b/tools/test/h5diff/testfiles/h5diff_455_ERR.txt index dc1b6a1..de25a69 100644 --- a/tools/test/h5diff/testfiles/h5diff_455_ERR.txt +++ b/tools/test/h5diff/testfiles/h5diff_455_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. -H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: - #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 818 in h5diff(): Error: treat dangling link as error +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_457_ERR.txt b/tools/test/h5diff/testfiles/h5diff_457_ERR.txt index 927b301..6594c9a 100644 --- a/tools/test/h5diff/testfiles/h5diff_457_ERR.txt +++ b/tools/test/h5diff/testfiles/h5diff_457_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. -H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: - #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 861 in h5diff(): Error: treat dangling link as error +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_458_ERR.txt b/tools/test/h5diff/testfiles/h5diff_458_ERR.txt index d6cd1b9..9a09c17 100644 --- a/tools/test/h5diff/testfiles/h5diff_458_ERR.txt +++ b/tools/test/h5diff/testfiles/h5diff_458_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. -H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: - #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 861 in h5diff(): Error: treat dangling link as error +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_459_ERR.txt b/tools/test/h5diff/testfiles/h5diff_459_ERR.txt index 0aacb1f..6594c9a 100644 --- a/tools/test/h5diff/testfiles/h5diff_459_ERR.txt +++ b/tools/test/h5diff/testfiles/h5diff_459_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. -H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: - #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 818 in h5diff(): Error: treat dangling link as error +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_601_ERR.txt b/tools/test/h5diff/testfiles/h5diff_601_ERR.txt index d1a50f9..b58124a 100644 --- a/tools/test/h5diff/testfiles/h5diff_601_ERR.txt +++ b/tools/test/h5diff/testfiles/h5diff_601_ERR.txt @@ -1,6 +1,6 @@ Object could not be found in -H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: - #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 690 in h5diff(): Error: Object could not be found +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: Object could not be found major: Failure in tools library minor: error in function EXIT CODE: 2 -- cgit v0.12 From d3e98edab0282be98b9f5ce67e9083fb93b90cda Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 Sep 2017 10:47:18 -0500 Subject: HDFFV-9774 Apply standard mask to .err files --- tools/test/h5diff/testfiles/h5diff_454_ERR.err | 4 ++-- tools/test/h5diff/testfiles/h5diff_455_ERR.err | 4 ++-- tools/test/h5diff/testfiles/h5diff_457_ERR.err | 4 ++-- tools/test/h5diff/testfiles/h5diff_458_ERR.err | 4 ++-- tools/test/h5diff/testfiles/h5diff_459_ERR.err | 4 ++-- tools/test/h5diff/testfiles/h5diff_601_ERR.err | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/test/h5diff/testfiles/h5diff_454_ERR.err b/tools/test/h5diff/testfiles/h5diff_454_ERR.err index fcd3cb7..8fa1718 100644 --- a/tools/test/h5diff/testfiles/h5diff_454_ERR.err +++ b/tools/test/h5diff/testfiles/h5diff_454_ERR.err @@ -1,4 +1,4 @@ -H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: - #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 861 in h5diff(): Error: treat dangling link as error +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_455_ERR.err b/tools/test/h5diff/testfiles/h5diff_455_ERR.err index f82fcc8..8fa1718 100644 --- a/tools/test/h5diff/testfiles/h5diff_455_ERR.err +++ b/tools/test/h5diff/testfiles/h5diff_455_ERR.err @@ -1,4 +1,4 @@ -H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: - #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 818 in h5diff(): Error: treat dangling link as error +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_457_ERR.err b/tools/test/h5diff/testfiles/h5diff_457_ERR.err index fcd3cb7..8fa1718 100644 --- a/tools/test/h5diff/testfiles/h5diff_457_ERR.err +++ b/tools/test/h5diff/testfiles/h5diff_457_ERR.err @@ -1,4 +1,4 @@ -H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: - #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 861 in h5diff(): Error: treat dangling link as error +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_458_ERR.err b/tools/test/h5diff/testfiles/h5diff_458_ERR.err index fcd3cb7..8fa1718 100644 --- a/tools/test/h5diff/testfiles/h5diff_458_ERR.err +++ b/tools/test/h5diff/testfiles/h5diff_458_ERR.err @@ -1,4 +1,4 @@ -H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: - #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 861 in h5diff(): Error: treat dangling link as error +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_459_ERR.err b/tools/test/h5diff/testfiles/h5diff_459_ERR.err index f82fcc8..8fa1718 100644 --- a/tools/test/h5diff/testfiles/h5diff_459_ERR.err +++ b/tools/test/h5diff/testfiles/h5diff_459_ERR.err @@ -1,4 +1,4 @@ -H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: - #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 818 in h5diff(): Error: treat dangling link as error +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_601_ERR.err b/tools/test/h5diff/testfiles/h5diff_601_ERR.err index b168fe5..f9a7212 100644 --- a/tools/test/h5diff/testfiles/h5diff_601_ERR.err +++ b/tools/test/h5diff/testfiles/h5diff_601_ERR.err @@ -1,4 +1,4 @@ -H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: - #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5diff.c line 690 in h5diff(): Error: Object could not be found +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: Object could not be found major: Failure in tools library minor: error in function -- cgit v0.12 From fa8ed205ba074d19c2a66855a6ecdb959ef38e0d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 7 Sep 2017 10:00:19 -0500 Subject: HDFFV-9988 merge findmpi from cmake and add intel path --- config/cmake_ext_mod/FindMPI.cmake | 130 +++++++++++++++++++++++++------------ 1 file changed, 87 insertions(+), 43 deletions(-) diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index ff1ead2..f566ade 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -9,71 +9,78 @@ # The Message Passing Interface (MPI) is a library used to write # high-performance distributed-memory parallel applications, and is # typically deployed on a cluster. MPI is a standard interface (defined -# by the MPI forum) for which many implementations are available. All -# of them have somewhat different include paths, libraries to link -# against, etc., and this module tries to smooth out those differences. +# by the MPI forum) for which many implementations are available. # # Variables # ^^^^^^^^^ # # This module will set the following variables per language in your -# project, where is one of C, CXX, or Fortran: -# -# :: -# -# MPI__FOUND TRUE if FindMPI found MPI flags for -# MPI__COMPILER MPI Compiler wrapper for -# MPI__COMPILE_FLAGS Compilation flags for MPI programs -# MPI__INCLUDE_PATH Include path(s) for MPI header -# MPI__LINK_FLAGS Linking flags for MPI programs -# MPI__LIBRARIES All libraries to link MPI programs against +# project, where ```` is one of C, CXX, or Fortran: +# +# ``MPI__FOUND`` +# Variable indicating the MPI settings for ```` were found. +# ``MPI__COMPILER`` +# MPI Compiler wrapper for ````. +# ``MPI__COMPILE_FLAGS`` +# Compilation flags for MPI programs, separated by spaces. +# This is *not* a :ref:`;-list `. +# ``MPI__INCLUDE_PATH`` +# Include path(s) for MPI header. +# ``MPI__LINK_FLAGS`` +# Linker flags for MPI programs. +# ``MPI__LIBRARIES`` +# All libraries to link MPI programs against. +# +# Additionally, the following :prop_tgt:`IMPORTED` targets are defined: +# +# ``MPI::MPI_`` +# Target for using MPI from ````. # # Additionally, FindMPI sets the following variables for running MPI # programs from the command line: # -# :: -# -# MPIEXEC Executable for running MPI programs -# MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving -# it the number of processors to run on -# MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly -# before the executable to run. -# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags +# ``MPIEXEC`` +# Executable for running MPI programs, if provided. +# ``MPIEXEC_NUMPROC_FLAG`` +# Flag to pass to ``MPIEXEC`` before giving it the number of processors to run on. +# ``MPIEXEC_MAX_NUMPROCS`` +# Number of MPI processors to utilize. Defaults to the number +# of processors detected on the host system. +# ``MPIEXEC_PREFLAGS`` +# Flags to pass to ``MPIEXEC`` directly before the executable to run. +# ``MPIEXEC_POSTFLAGS`` +# Flags to pass to ``MPIEXEC`` after other flags. # # Usage # ^^^^^ # -# To use this module, simply call FindMPI from a CMakeLists.txt file, or -# run ``find_package(MPI)``, then run CMake. If you are happy with the +# To use this module, call ``find_package(MPI)``. If you are happy with the # auto-detected configuration for your language, then you're done. If # not, you have two options: # -# :: -# -# 1. Set MPI__COMPILER to the MPI wrapper (mpicc, etc.) of your -# choice and reconfigure. FindMPI will attempt to determine all the -# necessary variables using THAT compiler's compile and link flags. -# 2. If this fails, or if your MPI implementation does not come with -# a compiler wrapper, then set both MPI__LIBRARIES and -# MPI__INCLUDE_PATH. You may also set any other variables -# listed above, but these two are required. This will circumvent -# autodetection entirely. +# 1. Set ``MPI__COMPILER`` to the MPI wrapper (e.g. ``mpicc``) of your +# choice and reconfigure. FindMPI will attempt to determine all the +# necessary variables using *that* compiler's compile and link flags. +# 2. If this fails, or if your MPI implementation does not come with +# a compiler wrapper, then set both ``MPI__LIBRARIES`` and +# ``MPI__INCLUDE_PATH``. You may also set any other variables +# listed above, but these two are required. This will circumvent +# autodetection entirely. # # When configuration is successful, ``MPI__COMPILER`` will be set to -# the compiler wrapper for , if it was found. ``MPI__FOUND`` +# the compiler wrapper for ````, if it was found. ``MPI__FOUND`` # and other variables above will be set if any MPI implementation was -# found for , regardless of whether a compiler was found. +# found for ````, regardless of whether a compiler was found. # # When using ``MPIEXEC`` to execute MPI applications, you should typically # use all of the ``MPIEXEC`` flags as follows: # # :: # -# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS +# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} # ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS # -# where ``PROCS`` is the number of processors on which to execute the -# program, ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to +# where ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to # pass to the MPI program. # # Backward Compatibility @@ -101,12 +108,12 @@ include(GetPrerequisites) # The compilers are detected in this order: # # 1. Try to find the most generic available MPI compiler, as this is usually set up by -# cluster admins. e.g., if plain old mpicc is available, we'll use it and assume it's +# cluster admins, e.g. if plain old mpicc is available, we'll use it and assume it's # the right compiler. # # 2. If a generic mpicc is NOT found, then we attempt to find one that matches # CMAKE__COMPILER_ID. e.g. if you are using XL compilers, we'll try to find mpixlc -# and company, but not mpiicc. This hopefully prevents toolchain mismatches. +# and company, but not mpiicc. This hopefully prevents toolchain mismatches. # # If you want to force a particular MPI compiler other than what we autodetect (e.g. if you # want to compile regular stuff with GNU and parallel stuff with Intel), you can always set @@ -175,6 +182,9 @@ if(WIN32) list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..") list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]") list(APPEND _MPI_PREFIX_PATH "$ENV{ProgramW6432}/MPICH2/") + # INTEL MPI + list(APPEND _MPI_PREFIX_PATH "$ENV{I_MPI_ROOT}/intel64/") + endif() # Build a list of prefixes to search for MPI. @@ -495,7 +505,7 @@ function (interrogate_mpi_compiler lang try_libs) set(MPI_${lang}_LIBRARIES ${MPI_LIBRARIES_WORK} CACHE STRING "MPI ${lang} libraries to link against" FORCE) mark_as_advanced(MPI_${lang}_COMPILE_FLAGS MPI_${lang}_INCLUDE_PATH MPI_${lang}_LINK_FLAGS MPI_${lang}_LIBRARIES) - # clear out our temporary lib/header detectionv variable here. + # clear out our temporary lib/header detection variable here. set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI lib detection" FORCE) set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI header detection" FORCE) endif() @@ -565,10 +575,21 @@ find_program(MPIEXEC get_filename_component(_MPI_BASE_DIR "${MPIEXEC}" PATH) get_filename_component(_MPI_BASE_DIR "${_MPI_BASE_DIR}" PATH) -set(MPIEXEC_NUMPROC_FLAG "-np" CACHE STRING "Flag used by MPI to specify the number of processes for MPIEXEC; the next option will be the number of processes.") +# According to the MPI standard, section 8.8 -n is a guaranteed, and the only guaranteed way to +# launch an MPI process using mpiexec if such a program exists. +set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "Flag used by MPI to specify the number of processes for MPIEXEC; the next option will be the number of processes.") set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by MPIEXEC.") set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will come after all flags given to MPIEXEC.") -set(MPIEXEC_MAX_NUMPROCS "2" CACHE STRING "Maximum number of processors available to run MPI applications.") + +# Set the number of processes to the processor count and the previous default +# of 2 if that couldn't be determined. +include(${CMAKE_ROOT}/Modules/ProcessorCount.cmake) +ProcessorCount(_MPIEXEC_NUMPROCS) +if("${_MPIEXEC_NUMPROCS}" EQUAL "0") + set(_MPIEXEC_NUMPROCS 2) +endif() +set(MPIEXEC_MAX_NUMPROCS "${_MPIEXEC_NUMPROCS}" CACHE STRING "Maximum number of processors available to run MPI applications.") +unset(_MPIEXEC_NUMPROCS) mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS) @@ -643,6 +664,28 @@ foreach (lang C CXX Fortran) else() find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_LIBRARIES MPI_${lang}_INCLUDE_PATH) endif() + + if(MPI_${lang}_FOUND) + if(NOT TARGET MPI::MPI_${lang}) + add_library(MPI::MPI_${lang} INTERFACE IMPORTED) + endif() + if(MPI_${lang}_COMPILE_FLAGS) + separate_arguments(_MPI_${lang}_COMPILE_OPTIONS NATIVE_COMMAND "${MPI_${lang}_COMPILE_FLAGS}") + set_property(TARGET MPI::MPI_${lang} PROPERTY + INTERFACE_COMPILE_OPTIONS "${_MPI_${lang}_COMPILE_OPTIONS}") + endif() + + unset(_MPI_${lang}_LINK_LINE) + if(MPI_${lang}_LINK_FLAGS) + list(APPEND _MPI_${lang}_LINK_LINE "${MPI_${lang}_LINK_FLAGS}") + endif() + list(APPEND _MPI_${lang}_LINK_LINE "${MPI_${lang}_LIBRARIES}") + set_property(TARGET MPI::MPI_${lang} PROPERTY + INTERFACE_LINK_LIBRARIES "${_MPI_${lang}_LINK_LINE}") + + set_property(TARGET MPI::MPI_${lang} PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${MPI_${lang}_INCLUDE_PATH}") + endif() endif() endforeach() @@ -682,6 +725,7 @@ if (MPI_NUMLIBS GREATER 1) else() set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE) endif() +mark_as_advanced(MPI_LIBRARY MPI_EXTRA_LIBRARY) #============================================================================= # unset these vars to cleanup namespace -- cgit v0.12 From 47a2d5e48f5f3dcfed57c5be01178952030828c2 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 7 Sep 2017 10:12:43 -0500 Subject: Adding variable initialization Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) --- c++/src/H5ArrayType.cpp | 2 +- c++/src/H5CompType.cpp | 2 +- c++/src/H5DataType.cpp | 2 +- c++/src/H5EnumType.cpp | 10 +++++----- c++/src/H5FloatType.cpp | 2 +- c++/src/H5IntType.cpp | 2 +- c++/src/H5StrType.cpp | 2 +- c++/src/H5VarLenType.cpp | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index c39ef35..15ac140 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -147,7 +147,7 @@ ArrayType& ArrayType::operator=(const ArrayType& rhs) //-------------------------------------------------------------------------- DataType* ArrayType::decode() const { - hid_t encoded_arrtype_id; + hid_t encoded_arrtype_id = H5I_INVALID_HID; try { encoded_arrtype_id = p_decode(); } diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 95fddc1..da7e3e2 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -132,7 +132,7 @@ CompType::CompType(const H5Location& loc, const H5std_string& dtype_name) : Data //-------------------------------------------------------------------------- DataType* CompType::decode() const { - hid_t encoded_cmptype_id; + hid_t encoded_cmptype_id = H5I_INVALID_HID; try { encoded_cmptype_id = p_decode(); } diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 11b30cc..28a670e 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -285,7 +285,7 @@ hid_t DataType::p_decode() const //-------------------------------------------------------------------------- DataType* DataType::decode() const { - hid_t encoded_dtype_id; + hid_t encoded_dtype_id = H5I_INVALID_HID; try { encoded_dtype_id = p_decode(); } diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index f9046be..02ae5a3 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -154,16 +154,16 @@ EnumType::EnumType(const H5Location& loc, const H5std_string& dtype_name) : Data //-------------------------------------------------------------------------- DataType* EnumType::decode() const { - hid_t encoded_cmptype_id; + hid_t encoded_enumtype_id = H5I_INVALID_HID; try { - encoded_cmptype_id = p_decode(); + encoded_enumtype_id = p_decode(); } catch (DataTypeIException &err) { throw; } - EnumType *encoded_cmptype = new EnumType; - encoded_cmptype->p_setId(encoded_cmptype_id); - return(encoded_cmptype); + EnumType *encoded_enumtype = new EnumType; + encoded_enumtype->p_setId(encoded_enumtype_id); + return(encoded_enumtype); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 66a7466..794c27d 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -136,7 +136,7 @@ FloatType::FloatType(const H5Location& loc, const H5std_string& dtype_name) : At //-------------------------------------------------------------------------- DataType* FloatType::decode() const { - hid_t encoded_flttype_id; + hid_t encoded_flttype_id = H5I_INVALID_HID; try { encoded_flttype_id = p_decode(); } diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 8408732..ef4e1a9 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -135,7 +135,7 @@ IntType::IntType(const H5Location& loc, const H5std_string& dtype_name) : AtomTy //-------------------------------------------------------------------------- DataType* IntType::decode() const { - hid_t encoded_inttype_id; + hid_t encoded_inttype_id = H5I_INVALID_HID; try { encoded_inttype_id = p_decode(); } diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index cbb2103..d2d87e9 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -189,7 +189,7 @@ StrType::StrType(const H5Location& loc, const H5std_string& dtype_name) : AtomTy //-------------------------------------------------------------------------- DataType* StrType::decode() const { - hid_t encoded_strtype_id; + hid_t encoded_strtype_id = H5I_INVALID_HID; try { encoded_strtype_id = p_decode(); } diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index fcea8cd..b5ca9c4 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -117,7 +117,7 @@ VarLenType::VarLenType(const H5Location& loc, const H5std_string& dtype_name) : //-------------------------------------------------------------------------- DataType* VarLenType::decode() const { - hid_t encoded_vltype_id; + hid_t encoded_vltype_id = H5I_INVALID_HID; try { encoded_vltype_id = p_decode(); } -- cgit v0.12 From 1c7c5a604b449465a76fbaa054c5b125ad75bb56 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 7 Sep 2017 13:28:45 -0500 Subject: HDFFV-10276 Add UD flag option to h5repack --- release_docs/INSTALL_CMake.txt | 11 ----------- release_docs/RELEASE.txt | 10 +++++++++- tools/src/h5repack/h5repack.h | 1 + tools/src/h5repack/h5repack_filters.c | 2 +- tools/src/h5repack/h5repack_main.c | 8 ++++---- tools/src/h5repack/h5repack_parse.c | 17 ++++++++++++++--- tools/test/h5repack/CMakeTests.cmake | 6 +++--- tools/test/h5repack/h5repack_plugin.sh.in | 14 +++++++------- tools/test/h5repack/testfiles/h5repack-help.txt | 12 ++++++------ 9 files changed, 45 insertions(+), 36 deletions(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index e2489f4..9c0c91e 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -656,17 +656,6 @@ The same scripts can be used on Linux, Mac OSX or a Windows machine by adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# ############################################################################################# ### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### ### BUILD_GENERATOR required [Unix, VS2017, VS201764, VS2015, VS201564, VS2013, VS201364] ### diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 64015ba..d0de3ee 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -107,7 +107,6 @@ New Features (ADB - 2017/08/30, HDFFV-9774) - High-Level APIs: --------------- - @@ -157,6 +156,15 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5repack + + h5repack always set the User Defined filter flag to H5Z_FLAG_MANDATORY. + + Added another parameter to the 'UD=' option to set the flag by default + to '0' or H5Z_FLAG_MANDATORY, the other choice is '1' or H5Z_FLAG_OPTIONAL. + + (ADB - 2017/08/31, HDFFV-10276) + - h5ls h5ls generated error on stack when it encountered a H5S_NULL diff --git a/tools/src/h5repack/h5repack.h b/tools/src/h5repack/h5repack.h index e5ae03f..c8c6a0e 100644 --- a/tools/src/h5repack/h5repack.h +++ b/tools/src/h5repack/h5repack.h @@ -61,6 +61,7 @@ typedef struct { typedef struct { H5Z_filter_t filtn; /* filter identification number */ + unsigned filt_flag; /* filter definition flag */ unsigned cd_values[CD_VALUES]; /* filter client data values */ size_t cd_nelmts; /* filter client number of values */ } filter_info_t; diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index c48158c..5ccb2ef 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -402,7 +402,7 @@ int apply_filters(const char* name, /* object name from traverse list */ default: { if (H5Pset_filter(dcpl_id, obj.filter[i].filtn, - H5Z_FLAG_MANDATORY, obj.filter[i].cd_nelmts, + obj.filter[i].filt_flag, obj.filter[i].cd_nelmts, obj.filter[i].cd_values) < 0) return -1; if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 31b1e14..136d550 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -101,7 +101,7 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " -T FS_THRESHOLD, --fs_threshold=FS_THRESHOLD Free-space section threshold for H5Pset_file_space_strategy\n"); PRINTVALSTREAM(rawoutstream, " -G FS_PAGESIZE, --fs_pagesize=FS_PAGESIZE File space page size for H5Pset_file_space_page_size\n"); PRINTVALSTREAM(rawoutstream, "\n"); - PRINTVALSTREAM(rawoutstream, " M - is an integer greater than 1, size of dataset in bytes (default is 0) \n"); + PRINTVALSTREAM(rawoutstream, " M - is an integer greater than 1, size of dataset in bytes (default is 0)\n"); PRINTVALSTREAM(rawoutstream, " E - is a filename.\n"); PRINTVALSTREAM(rawoutstream, " S - is an integer\n"); PRINTVALSTREAM(rawoutstream, " U - is a filename.\n"); @@ -164,8 +164,8 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " NBIT (no parameter)\n"); PRINTVALSTREAM(rawoutstream, " SOFF= scale_factor is an integer and scale_type\n"); PRINTVALSTREAM(rawoutstream, " is either IN or DS\n"); - PRINTVALSTREAM(rawoutstream, " UD=\n"); - PRINTVALSTREAM(rawoutstream, " required values for filter_number,cd_value_count,value_1\n"); + PRINTVALSTREAM(rawoutstream, " UD=\n"); + PRINTVALSTREAM(rawoutstream, " required values for filter_number,filter_flag,cd_value_count,value_1\n"); PRINTVALSTREAM(rawoutstream, " optional values for value_2 to value_N\n"); PRINTVALSTREAM(rawoutstream, " NONE (no parameter)\n"); PRINTVALSTREAM(rawoutstream, "\n"); @@ -209,7 +209,7 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Add both filters SHUF and GZIP in this order to all datasets\n"); PRINTVALSTREAM(rawoutstream, "\n"); - PRINTVALSTREAM(rawoutstream, "6) h5repack -f UD=307,1,9 file1 file2 \n"); + PRINTVALSTREAM(rawoutstream, "6) h5repack -f UD=307,0,1,9 file1 file2 \n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Add bzip2 filter to all datasets\n"); PRINTVALSTREAM(rawoutstream, "\n"); diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index a9a890d..4d62723 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -42,7 +42,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, size_t i, m, u; char c; size_t len = HDstrlen(str); - int k, l, p, q, end_obj = -1, no_param = 0; + int f, k, l, p, q, end_obj = -1, no_param = 0; unsigned j, n; char sobj[MAX_NC_NAME]; char scomp[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -209,13 +209,14 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, /*------------------------------------------------------------------------- * User Defined - * has the format UD= + * has the format UD= * BZIP2 example - * UD=307,1,9 + * UD=307,0,1,9 *------------------------------------------------------------------------- */ else if (HDstrcmp(scomp, "UD") == 0) { l = -1; /* filter number index check */ + f = -1; /* filter flag index check */ p = -1; /* CD_VAL count check */ for (m = 0, q = 0, u = i + 1; u < len; u++, m++, q++) { if (str[u] == ',') { @@ -224,6 +225,10 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, filt->filtn = HDatoi(stype); l = 0; } + else if (f == -1) { + filt->filt_flag = HDstrtoul(stype, NULL, 0); + f = 0; + } else if (p == -1) { filt->cd_nelmts = HDstrtoull(stype, NULL, 0); p = 0; @@ -240,6 +245,12 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, error_msg("filter number parameter is not a digit in <%s>\n", str); HDexit(EXIT_FAILURE); } + else if (!HDisdigit(c) && f == -1) { + if (obj_list) + HDfree(obj_list); + error_msg("filter flag parameter is not a digit in <%s>\n", str); + HDexit(EXIT_FAILURE); + } stype[q] = c; } /* for u */ stype[q] = '\0'; diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 225f6a8..dfdbb14 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -1256,15 +1256,15 @@ ############################################################################## ### P L U G I N T E S T S ############################################################################## - ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) - ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,1,9) + ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,0,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) + ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,0,1,9) ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) # check for no parameters set (TESTRETVAL 255) if (WIN32) set (TESTRETVAL -1) endif () - ADD_H5_CMP_TEST (plugin_zero "" "TEST" ${TESTRETVAL} h5repack_layout.h5 -v -f UD=250,0) + ADD_H5_CMP_TEST (plugin_zero "" "TEST" ${TESTRETVAL} h5repack_layout.h5 -v -f UD=250,0,0) if (HDF5_TEST_VFD) # Run test with different Virtual File Driver diff --git a/tools/test/h5repack/h5repack_plugin.sh.in b/tools/test/h5repack/h5repack_plugin.sh.in index c9fe53c..5efd9e8 100644 --- a/tools/test/h5repack/h5repack_plugin.sh.in +++ b/tools/test/h5repack/h5repack_plugin.sh.in @@ -1,10 +1,10 @@ #! /bin/sh # -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in # the COPYING file, which can be found at the root of the source code # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from @@ -247,10 +247,10 @@ COPY_TESTFILES_TO_TESTDIR version_str=`echo @H5_VERSION@ | awk -F"-" '{print $1}' | sed 's/\./,/g'` # Run the test -arg="h5repack_layout.h5 -v -f UD=260,4,9,$version_str" +arg="h5repack_layout.h5 -v -f UD=260,0,4,9,$version_str" TOOLTEST_DUMP plugin_version_test $arg -arg="h5repack_layout.h5 -v -f UD=257,1,9" +arg="h5repack_layout.h5 -v -f UD=257,0,1,9" TOOLTEST_DUMP plugin_test $arg #arg="h5repack_layout.UD.h5 -v -f NONE" diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt index 65edd89..1ff5b73 100644 --- a/tools/test/h5repack/testfiles/h5repack-help.txt +++ b/tools/test/h5repack/testfiles/h5repack-help.txt @@ -26,7 +26,7 @@ usage: h5repack [OPTIONS] file1 file2 -T FS_THRESHOLD, --fs_threshold=FS_THRESHOLD Free-space section threshold for H5Pset_file_space_strategy -G FS_PAGESIZE, --fs_pagesize=FS_PAGESIZE File space page size for H5Pset_file_space_page_size - M - is an integer greater than 1, size of dataset in bytes (default is 0) + M - is an integer greater than 1, size of dataset in bytes (default is 0) E - is a filename. S - is an integer U - is a filename. @@ -89,8 +89,8 @@ usage: h5repack [OPTIONS] file1 file2 NBIT (no parameter) SOFF= scale_factor is an integer and scale_type is either IN or DS - UD= - required values for filter_number,cd_value_count,value_1 + UD= + required values for filter_number,filter_flag,cd_value_count,value_1 optional values for value_2 to value_N NONE (no parameter) @@ -125,16 +125,16 @@ Examples of use: Chunked layout, with a layout size of 20x10, to objects dset1 and dset2 and remove filters to objects dset3, dset4, dset5 -4) h5repack -L -c 10 -s 20:dtype file1 file2 +4) h5repack -L -c 10 -s 20:dtype file1 file2 Using latest file format with maximum compact group size of 10 and and minimum shared datatype size of 20 -5) h5repack -f SHUF -f GZIP=1 file1 file2 +5) h5repack -f SHUF -f GZIP=1 file1 file2 Add both filters SHUF and GZIP in this order to all datasets -6) h5repack -f UD=307,1,9 file1 file2 +6) h5repack -f UD=307,0,1,9 file1 file2 Add bzip2 filter to all datasets -- cgit v0.12 From b9faa69d8756deb20fcf9c53343600fb5f2308a0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 8 Sep 2017 09:29:39 -0500 Subject: HDFFV-10276 Remove whitespace --- tools/src/h5repack/h5repack_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 136d550..0e28174 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -200,12 +200,12 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " Chunked layout, with a layout size of 20x10, to objects dset1 and dset2\n"); PRINTVALSTREAM(rawoutstream, " and remove filters to objects dset3, dset4, dset5\n"); PRINTVALSTREAM(rawoutstream, "\n"); - PRINTVALSTREAM(rawoutstream, "4) h5repack -L -c 10 -s 20:dtype file1 file2 \n"); + PRINTVALSTREAM(rawoutstream, "4) h5repack -L -c 10 -s 20:dtype file1 file2\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Using latest file format with maximum compact group size of 10 and\n"); PRINTVALSTREAM(rawoutstream, " and minimum shared datatype size of 20\n"); PRINTVALSTREAM(rawoutstream, "\n"); - PRINTVALSTREAM(rawoutstream, "5) h5repack -f SHUF -f GZIP=1 file1 file2 \n"); + PRINTVALSTREAM(rawoutstream, "5) h5repack -f SHUF -f GZIP=1 file1 file2\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Add both filters SHUF and GZIP in this order to all datasets\n"); PRINTVALSTREAM(rawoutstream, "\n"); -- cgit v0.12 From aab6d2466f9640d1e08287b0e407124234f6022b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 8 Sep 2017 09:30:51 -0500 Subject: HDFFV-10276 Remove whitespace --- tools/src/h5repack/h5repack_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 0e28174..a3f5678 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -209,7 +209,7 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Add both filters SHUF and GZIP in this order to all datasets\n"); PRINTVALSTREAM(rawoutstream, "\n"); - PRINTVALSTREAM(rawoutstream, "6) h5repack -f UD=307,0,1,9 file1 file2 \n"); + PRINTVALSTREAM(rawoutstream, "6) h5repack -f UD=307,0,1,9 file1 file2\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Add bzip2 filter to all datasets\n"); PRINTVALSTREAM(rawoutstream, "\n"); -- cgit v0.12 From 77313a1d39a4d08827df9c0186028b63c1ee1fd1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 8 Sep 2017 16:51:48 -0500 Subject: HDFFV-9774 Fix code merge --- tools/lib/h5diff_array.c | 5814 ++++++++++++++++++---------------------------- 1 file changed, 2231 insertions(+), 3583 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 7236ad1..68a9575 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -17,7 +17,6 @@ #include "h5diff.h" #include "ph5diff.h" - /*------------------------------------------------------------------------- * printf formatting *------------------------------------------------------------------------- @@ -66,9 +65,8 @@ #define LLI_FORMAT_P_NOTCOMP "%-15" H5_PRINTF_LL_WIDTH "d %-15" H5_PRINTF_LL_WIDTH "d %-15" H5_PRINTF_LL_WIDTH "d not comparable\n" #define ULLI_FORMAT_P_NOTCOMP "%-15" H5_PRINTF_LL_WIDTH "u %-15" H5_PRINTF_LL_WIDTH "u %-15" H5_PRINTF_LL_WIDTH "d not comparable\n" - /* if system EPSILON is defined, use the system EPSILON; otherwise, use - constants that are close to most EPSILON values */ + constants that are close to most EPSILON values */ #ifndef FLT_EPSILON #define FLT_EPSILON 1.19209E-07 @@ -78,7 +76,6 @@ #define DBL_EPSILON 2.22045E-16 #endif - /*------------------------------------------------------------------------- * -p relative error formula * @@ -108,7 +105,6 @@ static hbool_t not_comparable; not_comparable = TRUE; \ } - #define PER_UNSIGN(TYPE,A,B) { \ per = -1; \ not_comparable = FALSE; \ @@ -121,210 +117,110 @@ static hbool_t not_comparable; not_comparable = TRUE; \ } - #define PDIFF(a,b) (((b) > (a)) ? ((b) - (a)) : ((a) -(b))) -typedef struct mcomp_t -{ - unsigned n; /* number of members */ - hid_t *ids; /* member type id */ - size_t *offsets; - struct mcomp_t **m; /* members */ -}mcomp_t; - +typedef struct mcomp_t { + unsigned n; /* number of members */ + hid_t *ids; /* member type id */ + size_t *offsets; + struct mcomp_t **m; /* members */ +} mcomp_t; /*------------------------------------------------------------------------- * local prototypes *------------------------------------------------------------------------- */ -static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id,hid_t region1_id, hid_t region2_id, diff_opt_t *options); +static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, + hid_t region2_id, diff_opt_t *options); static hbool_t all_zero(const void *_mem, size_t size); -static int ull2float(unsigned long long ull_value, float *f_value); -static hsize_t character_compare(char *mem1,char *mem2,hsize_t i,size_t u,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); -static hsize_t character_compare_opt(unsigned char *mem1,unsigned char *mem2,hsize_t i,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); +static int ull2float(unsigned long long ull_value, float *f_value); +static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u, + int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, + diff_opt_t *options, const char *obj1, const char *obj2, int *ph); +static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, + hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, + diff_opt_t *options, const char *obj1, const char *obj2, int *ph); static hbool_t equal_float(float value, float expected, diff_opt_t *options); static hbool_t equal_double(double value, double expected, diff_opt_t *options); #if H5_SIZEOF_LONG_DOUBLE !=0 static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *options); #endif static int print_data(diff_opt_t *options); -static void print_pos(int *ph,int pp,hsize_t curr_pos,hsize_t *acc,hsize_t *pos,int rank,hsize_t *dims,const char *obj1,const char *obj2 ); -static void print_char_pos(int *ph,int pp,hsize_t curr_pos,size_t u,hsize_t *acc,hsize_t *pos,int rank,hsize_t *dims,const char *obj1,const char *obj2 ); +static void print_pos(int *ph, int pp, hsize_t curr_pos, hsize_t *acc, + hsize_t *pos, int rank, hsize_t *dims, const char *obj1, + const char *obj2); +static void print_char_pos(int *ph, int pp, hsize_t curr_pos, size_t u, + hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, const char *obj1, + const char *obj2); static void h5diff_print_char(char ch); -static hsize_t diff_datum(void *_mem1, - void *_mem2, - hid_t m_type, - hsize_t i, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - hid_t container1_id, - hid_t container2_id, /*where the reference came from*/ - int *ph, /*print header */ - mcomp_t *members); /*compound members */ -static hsize_t diff_float(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_double(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); +static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, + int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, + diff_opt_t *options, const char *obj1, const char *obj2, + hid_t container1_id, hid_t container2_id, /*where the reference came from*/ + int *ph, /*print header */ + mcomp_t *members); /*compound members */ +static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); #if H5_SIZEOF_LONG_DOUBLE !=0 static hsize_t diff_ldouble(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); #endif -static hsize_t diff_schar(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_uchar(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_short(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_ushort(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_int(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_uint(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_long(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_ulong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_llong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_ullong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - +static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); /*------------------------------------------------------------------------- * NaN detection @@ -337,13 +233,11 @@ typedef enum dtype_t FLT_FLOAT, FLT_DOUBLE, FLT_LDOUBLE -} dtype_t; +}dtype_t; #else -typedef enum dtype_t -{ - FLT_FLOAT, - FLT_DOUBLE +typedef enum dtype_t { + FLT_FLOAT, FLT_DOUBLE } dtype_t; #endif @@ -356,8 +250,6 @@ static hbool_t my_isnan(dtype_t type, void *val); static void get_member_types(hid_t tid, mcomp_t *members); static void close_member_types(mcomp_t *members); - - /*------------------------------------------------------------------------- * Function: diff_array * @@ -372,34 +264,35 @@ static void close_member_types(mcomp_t *members); *------------------------------------------------------------------------- */ -hsize_t diff_array( void *_mem1, - void *_mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - diff_opt_t *options, - const char *name1, - const char *name2, - hid_t m_type, - hid_t container1_id, - hid_t container2_id) /* dataset where the reference came from*/ +hsize_t diff_array( + void *_mem1, + void *_mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + diff_opt_t *options, + const char *name1, + const char *name2, + hid_t m_type, + hid_t container1_id, + hid_t container2_id) /* dataset where the reference came from*/ { - hsize_t nfound=0; /* number of differences found */ - size_t size; /* size of datum */ - unsigned char *mem1 = (unsigned char*)_mem1; - unsigned char *mem2 = (unsigned char*)_mem2; - hsize_t acc[32]; /* accumulator position */ - hsize_t pos[32]; /* matrix position */ - int ph=1; /* print header */ - hsize_t i; - int j; - mcomp_t members; - H5T_class_t type_class; + hsize_t nfound = 0; /* number of differences found */ + size_t size; /* size of datum */ + unsigned char *mem1 = (unsigned char*) _mem1; + unsigned char *mem2 = (unsigned char*) _mem2; + hsize_t acc[32]; /* accumulator position */ + hsize_t pos[32]; /* matrix position */ + int ph = 1; /* print header */ + hsize_t i; + int j; + mcomp_t members; + H5T_class_t type_class; h5difftrace("diff_array start\n"); /* get the size. */ - size = H5Tget_size( m_type ); + size = H5Tget_size(m_type); type_class = H5Tget_class(m_type); /* Fast comparison first for atomic type by memcmp(). @@ -407,26 +300,22 @@ hsize_t diff_array( void *_mem1, * by the condition, but it gives more clarity for code planning */ if (type_class != H5T_REFERENCE && - type_class != H5T_COMPOUND && - type_class != H5T_STRING && - type_class != H5T_VLEN && - HDmemcmp(mem1, mem2, size*nelmts)==0) + type_class != H5T_COMPOUND && + type_class != H5T_STRING && + type_class != H5T_VLEN && + HDmemcmp(mem1, mem2, size*nelmts) == 0) return 0; - if ( rank > 0 ) - { - - acc[rank-1]=1; - for(j=(rank-2); j>=0; j--) - { - acc[j]=acc[j+1]*dims[j+1]; + if (rank > 0) { + acc[rank - 1] = 1; + for (j = (rank - 2); j >= 0; j--) { + acc[j] = acc[j + 1] * dims[j + 1]; } - for ( j = 0; j < rank; j++) - pos[j]=0; + for (j = 0; j < rank; j++) + pos[j] = 0; } - switch (type_class) - { + switch (type_class) { case H5T_NO_CLASS: case H5T_TIME: case H5T_NCLASSES: @@ -434,52 +323,48 @@ hsize_t diff_array( void *_mem1, HDassert(0); break; - /*------------------------------------------------------------------------- - * float and integer atomic types - *------------------------------------------------------------------------- - */ - + /*------------------------------------------------------------------------- + * float and integer atomic types + *------------------------------------------------------------------------- + */ case H5T_FLOAT: if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) - nfound=diff_float(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_float(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) - nfound=diff_double(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); -#if H5_SIZEOF_LONG_DOUBLE !=0 + nfound = diff_double(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); +#if H5_SIZEOF_LONG_DOUBLE != 0 else if (H5Tequal(m_type, H5T_NATIVE_LDOUBLE)) - nfound=diff_ldouble(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_ldouble(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); #endif break; case H5T_INTEGER: - if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) - nfound=diff_schar(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_schar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) - nfound=diff_uchar(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_uchar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_SHORT)) - nfound=diff_short(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_short(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_USHORT)) - nfound=diff_ushort(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_ushort(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_INT)) - nfound=diff_int(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_int(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_UINT)) - nfound=diff_uint(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_uint(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_LONG)) - nfound=diff_long(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_long(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_ULONG)) - nfound=diff_ulong(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_ulong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) - nfound=diff_llong(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_llong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) - nfound=diff_ullong(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); - + nfound = diff_ullong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); break; /*------------------------------------------------------------------------- * Other types than float and integer *------------------------------------------------------------------------- */ - case H5T_COMPOUND: case H5T_STRING: case H5T_BITFIELD: @@ -488,27 +373,12 @@ hsize_t diff_array( void *_mem1, case H5T_ARRAY: case H5T_VLEN: case H5T_REFERENCE: - HDmemset(&members, 0, sizeof (mcomp_t)); + HDmemset(&members, 0, sizeof(mcomp_t)); get_member_types(m_type, &members); - for ( i = 0; i < nelmts; i++) - { - nfound+=diff_datum( - mem1 + i * size, - mem2 + i * size, /* offset */ - m_type, - i, - rank, - dims, - acc, - pos, - options, - name1, - name2, - container1_id, - container2_id, - &ph, &members); - if (options->n && nfound>=options->count) - { + for (i = 0; i < nelmts; i++) { + nfound += diff_datum(mem1 + i * size, mem2 + i * size, m_type, i, rank, dims, acc, pos, options, + name1, name2, container1_id, container2_id, &ph, &members); + if (options->n && nfound >= options->count) { close_member_types(&members); return nfound; } @@ -557,45 +427,46 @@ hsize_t diff_array( void *_mem1, * Dereference the object and compare the type (basic object type). *------------------------------------------------------------------------- */ -static hsize_t diff_datum(void *_mem1, - void *_mem2, - hid_t m_type, - hsize_t i, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - hid_t container1_id, - hid_t container2_id, /*where the reference came from*/ - int *ph, /*print header */ - mcomp_t *members) /*compound members */ +static hsize_t diff_datum( + void *_mem1, + void *_mem2, + hid_t m_type, + hsize_t index, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + hid_t container1_id, + hid_t container2_id, /*where the reference came from*/ + int *ph, /*print header */ + mcomp_t *members) /*compound members */ { - unsigned char *mem1 = (unsigned char*)_mem1; - unsigned char *mem2 = (unsigned char*)_mem2; - size_t u; - hid_t memb_type; - size_t type_size; - H5T_sign_t type_sign; - H5T_class_t type_class; - size_t offset; - unsigned nmembs; - unsigned j; - hsize_t nelmts; - size_t size=0; - hbool_t iszero1; - hbool_t iszero2; - hid_t obj1_id; - hid_t obj2_id; - hsize_t nfound=0; /* differences found */ - int ret=0; /* check return error */ - double per; - hbool_t both_zero; + unsigned char *mem1 = (unsigned char*) _mem1; + unsigned char *mem2 = (unsigned char*) _mem2; + size_t u; + hid_t memb_type; + size_t type_size; + H5T_sign_t type_sign; + H5T_class_t type_class; + size_t offset; + unsigned nmembs; + unsigned j; + hsize_t nelmts; + size_t size = 0; + hbool_t iszero1; + hbool_t iszero2; + hid_t obj1_id; + hid_t obj2_id; + hsize_t nfound = 0; /* differences found */ + int ret = 0; /* check return error */ + double per; + hbool_t both_zero; h5difftrace("diff_datum start\n"); - type_size = H5Tget_size( m_type ); + type_size = H5Tget_size(m_type); type_class = H5Tget_class(m_type); /* Fast comparison first for atomic type by memcmp(). @@ -603,14 +474,13 @@ static hsize_t diff_datum(void *_mem1, * by the condition, but it gives more clarity for code planning */ if (type_class != H5T_REFERENCE && - type_class != H5T_COMPOUND && - type_class != H5T_STRING && - type_class != H5T_VLEN && - HDmemcmp(mem1, mem2, type_size)==0) + type_class != H5T_COMPOUND && + type_class != H5T_STRING && + type_class != H5T_VLEN && + HDmemcmp(mem1, mem2, type_size) == 0) return 0; - switch (H5Tget_class(m_type)) - { + switch (H5Tget_class(m_type)) { case H5T_NO_CLASS: case H5T_TIME: case H5T_NCLASSES: @@ -618,68 +488,53 @@ static hsize_t diff_datum(void *_mem1, HDassert(0); break; - /*------------------------------------------------------------------------- - * H5T_COMPOUND - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ case H5T_COMPOUND: h5difftrace("diff_datum H5T_COMPOUND\n"); nmembs = members->n; - - for (j = 0; j < nmembs; j++) - { - offset = members->offsets[j]; + for (j = 0; j < nmembs; j++) { + offset = members->offsets[j]; memb_type = members->ids[j]; - nfound+=diff_datum( - mem1 + offset, - mem2 + offset, - memb_type, - i, - rank, - dims, - acc, - pos, - options, - obj1, - obj2, - container1_id, - container2_id, - ph, members->m[j]); + nfound += diff_datum(mem1 + offset, mem2 + offset, memb_type, index, + rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members->m[j]); } break; - /*------------------------------------------------------------------------- - * H5T_STRING - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ case H5T_STRING: h5difftrace("diff_datum H5T_STRING\n"); { - char *s = NULL; - char *sx = NULL; - char *s1 = NULL; - char *s2 = NULL; - size_t size1; - size_t size2; - size_t sizex; - size_t size_mtype = H5Tget_size(m_type); - H5T_str_t pad = H5Tget_strpad(m_type); + char *s = NULL; + char *sx = NULL; + char *s1 = NULL; + char *s2 = NULL; + size_t size1; + size_t size2; + size_t sizex; + size_t size_mtype = H5Tget_size(m_type); + H5T_str_t pad = H5Tget_strpad(m_type); /* if variable length string */ - if(H5Tis_variable_str(m_type)) { + if (H5Tis_variable_str(m_type)) { h5difftrace("diff_datum H5T_STRING variable\n"); /* Get pointer to first string */ s1 = *(char**) mem1; - if(s1) + if (s1) size1 = HDstrlen(s1); else size1 = 0; /* Get pointer to second string */ s2 = *(char**) mem2; - if(s2) + if (s2) size2 = HDstrlen(s2); else size2 = 0; @@ -688,7 +543,7 @@ static hsize_t diff_datum(void *_mem1, h5difftrace("diff_datum H5T_STRING null term\n"); /* Get pointer to first string */ s1 = (char*) mem1; - if(s1) + if (s1) size1 = HDstrlen(s1); else size1 = 0; @@ -696,7 +551,7 @@ static hsize_t diff_datum(void *_mem1, size1 = size_mtype; /* Get pointer to second string */ s2 = (char*) mem2; - if(s2) + if (s2) size2 = HDstrlen(s2); else size2 = 0; @@ -705,10 +560,10 @@ static hsize_t diff_datum(void *_mem1, } else { /* Get pointer to first string */ - s1 = (char *)mem1; + s1 = (char *) mem1; size1 = size_mtype; /* Get pointer to second string */ - s2 = (char *)mem2; + s2 = (char *) mem2; size2 = size_mtype; } @@ -720,11 +575,11 @@ static hsize_t diff_datum(void *_mem1, */ h5diffdebug2("diff_datum string size:%d\n",size1); h5diffdebug2("diff_datum string size:%d\n",size2); - if(size1 != size2) { + if (size1 != size2) { h5difftrace("diff_datum string sizes\n"); nfound++; } - if(size1 < size2) { + if (size1 < size2) { size = size1; s = s1; sizex = size2; @@ -738,68 +593,30 @@ static hsize_t diff_datum(void *_mem1, } /* check for NULL pointer for string */ - if(s!=NULL) { + if (s != NULL) { /* try fast compare first */ - if(HDmemcmp(s1, s2, size)==0) { - if(size1 != size2) - if(print_data(options)) - for (u=size; u= 1 && ndims <= H5S_MAX_RANK); /* calculate the number of array elements */ - for (u = 0, nelmts = 1; u < (unsigned)ndims; u++) + for (u = 0, nelmts = 1; u < (unsigned) ndims; u++) nelmts *= adims[u]; for (u = 0; u < nelmts; u++) { - nfound += diff_datum( - mem1 + u * size, - mem2 + u * size, /* offset */ - memb_type, - i, /* index position */ - rank, - dims, - acc, - pos, - options, - obj1, - obj2, - container1_id, - container2_id, - ph, members); + nfound += diff_datum(mem1 + u * size, mem2 + u * size, memb_type, index, + rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members); } H5Tclose(memb_type); } break; - - - /*------------------------------------------------------------------------- - * H5T_REFERENCE - *------------------------------------------------------------------------- - */ - + /*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ case H5T_REFERENCE: - - iszero1=all_zero(_mem1, H5Tget_size(m_type)); - iszero2=all_zero(_mem2, H5Tget_size(m_type)); - if (iszero1 != iszero2) - { + iszero1 = all_zero(_mem1, H5Tget_size(m_type)); + iszero2 = all_zero(_mem2, H5Tget_size(m_type)); + if (iszero1 != iszero2) { return 1; } - else if (!iszero1 && !iszero2) - { + else if (!iszero1 && !iszero2) { + /*------------------------------------------------------------------------- + * H5T_STD_REF_DSETREG + * Dataset region reference + *------------------------------------------------------------------------- + */ + if (type_size == H5R_DSET_REG_REF_BUF_SIZE) { + hid_t region1_id; + hid_t region2_id; - /*------------------------------------------------------------------------- - * H5T_STD_REF_DSETREG - * Dataset region reference - *------------------------------------------------------------------------- - */ - if (type_size==H5R_DSET_REG_REF_BUF_SIZE) - { - hid_t region1_id; - hid_t region2_id; - - if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem1))<0) - ret= -1; - if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem2))<0) - ret= -1; - if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1))<0) - ret= -1; - if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2))<0) - ret= -1; - - if (ret==-1) { - options->err_stat=1; + if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem1)) < 0) + ret = -1; + if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem2)) < 0) + ret = -1; + if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1)) < 0) + ret = -1; + if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) < 0) + ret = -1; + + if (ret == -1) { + options->err_stat = 1; return 0; } - nfound = diff_region(obj1_id,obj2_id,region1_id,region2_id,options); - + nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, options); H5Oclose(obj1_id); H5Oclose(obj2_id); H5Sclose(region1_id); H5Sclose(region2_id); - }/*dataset reference*/ + /*------------------------------------------------------------------------- + * H5T_STD_REF_OBJ + * Object references. get the type and OID of the referenced object + *------------------------------------------------------------------------- + */ + else if (type_size == H5R_OBJ_REF_BUF_SIZE) { + H5O_type_t obj1_type; + H5O_type_t obj2_type; - /*------------------------------------------------------------------------- - * H5T_STD_REF_OBJ - * Object references. get the type and OID of the referenced object - *------------------------------------------------------------------------- - */ - else if (type_size == H5R_OBJ_REF_BUF_SIZE) - { - H5O_type_t obj1_type; - H5O_type_t obj2_type; - - if(H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) + if (H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) ret = -1; - if(H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) + if (H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) ret = -1; - if(ret == -1) { + if (ret == -1) { options->err_stat = 1; return 0; } /* end if */ /* check object type */ - if(obj1_type != obj2_type) - { - parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2); + if (obj1_type != obj2_type) { + parallel_print( + "Different object types referenced: <%s> and <%s>", obj1, obj2); options->not_cmp = 1; return 0; } - if((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_OBJECT, _mem1)) < 0) + if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_OBJECT, _mem1)) < 0) ret = -1; - if((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_OBJECT, _mem2)) < 0) + if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_OBJECT, _mem2)) < 0) ret = -1; - if(ret == -1) { + if (ret == -1) { options->err_stat = 1; return 0; - } /* end if */ + } /* compare */ - if(obj1_type == H5O_TYPE_DATASET) - nfound = diff_datasetid(obj1_id, - obj2_id, - NULL, - NULL, - options); + if (obj1_type == H5O_TYPE_DATASET) + nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, options); else { - if(options->m_verbose) - parallel_print("Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", - obj1, obj2); + if (options->m_verbose) + parallel_print( + "Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", + obj1, obj2); options->not_cmp = 1; } H5Oclose(obj1_id); H5Oclose(obj2_id); - }/*object reference*/ - }/*is zero*/ - - break; - /*------------------------------------------------------------------------- - * H5T_VLEN - *------------------------------------------------------------------------- - */ - + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ case H5T_VLEN: - /* get the VL sequences's base datatype for each element */ memb_type = H5Tget_super(m_type); - size = H5Tget_size(memb_type); + size = H5Tget_size(memb_type); /* get the number of sequence elements */ - nelmts = ((hvl_t *)mem1)->len; + nelmts = ((hvl_t *) mem1)->len; for (j = 0; j < nelmts; j++) - nfound += diff_datum( - ((char *)(((hvl_t *)mem1)->p)) + j * size, - ((char *)(((hvl_t *)mem2)->p)) + j * size, /* offset */ - memb_type, - i, /* index position */ - rank, - dims, - acc, - pos, - options, - obj1, - obj2, - container1_id, - container2_id, - ph, members); + nfound += diff_datum(((char *) (((hvl_t *) mem1)->p)) + j * size, ((char *) (((hvl_t *) mem2)->p)) + j * size, memb_type, index, + rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members); H5Tclose(memb_type); - break; - - - /*------------------------------------------------------------------------- - * H5T_INTEGER - *------------------------------------------------------------------------- - */ - + /*------------------------------------------------------------------------- + * H5T_INTEGER + *------------------------------------------------------------------------- + */ case H5T_INTEGER: type_sign = H5Tget_sign(m_type); - - /*------------------------------------------------------------------------- - * H5T_NATIVE_SCHAR - *------------------------------------------------------------------------- - */ - if (type_size==1 && type_sign!=H5T_SGN_NONE) - { - char temp1_char; - char temp2_char; - HDassert(type_size==sizeof(char)); + /*------------------------------------------------------------------------- + * H5T_NATIVE_SCHAR + *------------------------------------------------------------------------- + */ + if (type_size == 1 && type_sign != H5T_SGN_NONE) { + char temp1_char; + char temp2_char; + HDassert(type_size == sizeof(char)); HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); /* -d and !-p */ - if (options->d && !options->p) - { - if (ABS(temp1_char-temp2_char) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (ABS(temp1_char-temp2_char) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_char,temp2_char,ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER(temp1_char,temp2_char); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER(temp1_char, temp2_char); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_char,temp2_char,ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_char,temp2_char,ABS(temp1_char-temp2_char),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER(temp1_char,temp2_char); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER(temp1_char, temp2_char); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_char,temp2_char,ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - - else - - if ( per > options->percent && ABS(temp1_char-temp2_char) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_char,temp2_char,ABS(temp1_char-temp2_char),per); - } - nfound++; + else if (per > options->percent && ABS(temp1_char - temp2_char) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } + nfound++; + } } - else if (temp1_char != temp2_char) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_char != temp2_char) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_char,temp2_char,ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - } /*H5T_NATIVE_SCHAR*/ - /*------------------------------------------------------------------------- - * H5T_NATIVE_UCHAR - *------------------------------------------------------------------------- - */ - else if (type_size==1 && type_sign==H5T_SGN_NONE) - { - unsigned char temp1_uchar; - unsigned char temp2_uchar; - HDassert(type_size==sizeof(unsigned char)); + /*------------------------------------------------------------------------- + * H5T_NATIVE_UCHAR + *------------------------------------------------------------------------- + */ + else if (type_size == 1 && type_sign == H5T_SGN_NONE) { + unsigned char temp1_uchar; + unsigned char temp2_uchar; + HDassert(type_size == sizeof(unsigned char)); HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); /* -d and !-p */ - if (options->d && !options->p) - { - if ( PDIFF(temp1_uchar,temp2_uchar) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (PDIFF(temp1_uchar, temp2_uchar) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - - else - - if ( per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar),per); - } - nfound++; + else if (per > options->percent && PDIFF(temp1_uchar, temp2_uchar) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } + nfound++; + } } - else if (temp1_uchar != temp2_uchar) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_uchar != temp2_uchar) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - } /*H5T_NATIVE_UCHAR*/ - - /*------------------------------------------------------------------------- - * H5T_NATIVE_SHORT - *------------------------------------------------------------------------- - */ - - else if (type_size==2 && type_sign!=H5T_SGN_NONE) - { - short temp1_short; - short temp2_short; - HDassert(type_size==sizeof(short)); + /*------------------------------------------------------------------------- + * H5T_NATIVE_SHORT + *------------------------------------------------------------------------- + */ + else if (type_size == 2 && type_sign != H5T_SGN_NONE) { + short temp1_short; + short temp2_short; + HDassert(type_size == sizeof(short)); HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); /* -d and !-p */ - if (options->d && !options->p) - { - if (ABS(temp1_short-temp2_short) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (ABS(temp1_short - temp2_short) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_short,temp2_short,ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER(temp1_short,temp2_short); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER(temp1_short, temp2_short); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_short,temp2_short,ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_short,temp2_short,ABS(temp1_short-temp2_short),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER(temp1_short,temp2_short); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER(temp1_short, temp2_short); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_short,temp2_short,ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - - else - - if ( per > options->percent && ABS(temp1_short-temp2_short) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_short,temp2_short,ABS(temp1_short-temp2_short),per); - } - nfound++; + else if (per > options->percent && ABS(temp1_short - temp2_short) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } + nfound++; + } } - else if (temp1_short != temp2_short) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_short != temp2_short) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_short,temp2_short,ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - - } /*H5T_NATIVE_SHORT*/ - /*------------------------------------------------------------------------- - * H5T_NATIVE_USHORT - *------------------------------------------------------------------------- - */ - - else if (type_size==2 && type_sign==H5T_SGN_NONE) - { - unsigned short temp1_ushort; - unsigned short temp2_ushort; - HDassert(type_size==sizeof(short)); + /*------------------------------------------------------------------------- + * H5T_NATIVE_USHORT + *------------------------------------------------------------------------- + */ + else if (type_size == 2 && type_sign == H5T_SGN_NONE) { + unsigned short temp1_ushort; + unsigned short temp2_ushort; + HDassert(type_size == sizeof(short)); HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); /* -d and !-p */ - if (options->d && !options->p) - { - if ( PDIFF(temp1_ushort,temp2_ushort) > options->delta) - { - - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (PDIFF(temp1_ushort, temp2_ushort) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_ushort,temp2_ushort, - PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - - else - - if ( per > options->percent && PDIFF(temp1_ushort,temp2_ushort) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort),per); - } - nfound++; + else if (per > options->percent && PDIFF(temp1_ushort, temp2_ushort) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } + nfound++; + } } - else if (temp1_ushort != temp2_ushort) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_ushort != temp2_ushort) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } } /*H5T_NATIVE_USHORT*/ - - /*------------------------------------------------------------------------- - * H5T_NATIVE_INT - *------------------------------------------------------------------------- - */ - - else if (type_size==4 && type_sign!=H5T_SGN_NONE) - { - int temp1_int; - int temp2_int; - HDassert(type_size==sizeof(int)); + /*------------------------------------------------------------------------- + * H5T_NATIVE_INT + *------------------------------------------------------------------------- + */ + else if (type_size == 4 && type_sign != H5T_SGN_NONE) { + int temp1_int; + int temp2_int; + HDassert(type_size == sizeof(int)); HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); /* -d and !-p */ - if (options->d && !options->p) - { - if (ABS(temp1_int-temp2_int) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (ABS(temp1_int-temp2_int) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_int,temp2_int,ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER(temp1_int,temp2_int); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER(temp1_int, temp2_int); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_int,temp2_int,ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_int,temp2_int,ABS(temp1_int-temp2_int),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER(temp1_int,temp2_int); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER(temp1_int, temp2_int); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_int,temp2_int,ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - - else - - if ( per > options->percent && ABS(temp1_int-temp2_int) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_int,temp2_int,ABS(temp1_int-temp2_int),per); - } - nfound++; + else if (per > options->percent && ABS(temp1_int - temp2_int) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } + nfound++; + } } - else if (temp1_int != temp2_int) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_int != temp2_int) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_int,temp2_int,ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } } /*H5T_NATIVE_INT*/ - - /*------------------------------------------------------------------------- - * H5T_NATIVE_UINT - *------------------------------------------------------------------------- - */ - - else if (type_size==4 && type_sign==H5T_SGN_NONE) - { - unsigned int temp1_uint; - unsigned int temp2_uint; - HDassert(type_size==sizeof(int)); + /*------------------------------------------------------------------------- + * H5T_NATIVE_UINT + *------------------------------------------------------------------------- + */ + else if (type_size == 4 && type_sign == H5T_SGN_NONE) { + unsigned int temp1_uint; + unsigned int temp2_uint; + HDassert(type_size == sizeof(int)); HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); /* -d and !-p */ - if (options->d && !options->p) - { - if ( PDIFF(temp1_uint,temp2_uint) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (PDIFF(temp1_uint, temp2_uint) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(UI_FORMAT,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER_UNSIGN(signed int,temp1_uint,temp2_uint); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER_UNSIGN(signed int, temp1_uint, temp2_uint); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(UI_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT_P,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER_UNSIGN(signed int,temp1_uint,temp2_uint); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER_UNSIGN(signed int, temp1_uint, temp2_uint); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(UI_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - - else - - if ( per > options->percent && PDIFF(temp1_uint,temp2_uint) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT_P,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint),per); - } - nfound++; + else if (per > options->percent && PDIFF(temp1_uint,temp2_uint) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } + nfound++; + } } - else if (temp1_uint != temp2_uint) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_uint != temp2_uint) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(UI_FORMAT,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } } /*H5T_NATIVE_UINT*/ - - /*------------------------------------------------------------------------- - * H5T_NATIVE_LONG - *------------------------------------------------------------------------- - */ - - else if (type_size==8 && type_sign!=H5T_SGN_NONE) - { - long temp1_long; - long temp2_long; - HDassert(type_size==sizeof(long)); + /*------------------------------------------------------------------------- + * H5T_NATIVE_LONG + *------------------------------------------------------------------------- + */ + else if (type_size == 8 && type_sign != H5T_SGN_NONE) { + long temp1_long; + long temp2_long; + HDassert(type_size == sizeof(long)); HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); /* -d and !-p */ - if (options->d && !options->p) - { - if (ABS(temp1_long-temp2_long) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (ABS(temp1_long-temp2_long) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT,temp1_long,temp2_long,ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER(temp1_long,temp2_long); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER(temp1_long, temp2_long); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP,temp1_long,temp2_long, - ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P,temp1_long,temp2_long,ABS(temp1_long-temp2_long),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER(temp1_long,temp2_long); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER(temp1_long, temp2_long); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP,temp1_long,temp2_long,ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - - else - - if ( per > options->percent && ABS(temp1_long-temp2_long) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P,temp1_long,temp2_long, - ABS(temp1_long-temp2_long), - per); - } - nfound++; + else if (per > options->percent && ABS(temp1_long-temp2_long) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } + nfound++; + } } - else if (temp1_long != temp2_long) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_long != temp2_long) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT,temp1_long,temp2_long,ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } } /*H5T_NATIVE_LONG*/ - /*------------------------------------------------------------------------- - * H5T_NATIVE_ULONG - *------------------------------------------------------------------------- - */ - - else if (type_size==8 && type_sign==H5T_SGN_NONE) - { - unsigned long temp1_ulong; - unsigned long temp2_ulong; - HDassert(type_size==sizeof(unsigned long)); + /*------------------------------------------------------------------------- + * H5T_NATIVE_ULONG + *------------------------------------------------------------------------- + */ + else if (type_size == 8 && type_sign == H5T_SGN_NONE) { + unsigned long temp1_ulong; + unsigned long temp2_ulong; + HDassert(type_size == sizeof(unsigned long)); HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); /* -d and !-p */ - if (options->d && !options->p) - { - if ( PDIFF(temp1_ulong,temp2_ulong) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (PDIFF(temp1_ulong, temp2_ulong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULI_FORMAT,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - - else - - if ( per > options->percent && PDIFF(temp1_ulong,temp2_ulong) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong),per); - } - nfound++; + else if (per > options->percent && PDIFF(temp1_ulong,temp2_ulong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } + nfound++; + } } - else if (temp1_ulong != temp2_ulong) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_ulong != temp2_ulong) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULI_FORMAT,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - - } /*H5T_NATIVE_ULONG*/ - break; /* H5T_INTEGER class */ - - /*------------------------------------------------------------------------- - * H5T_FLOAT - *------------------------------------------------------------------------- - */ - + /*------------------------------------------------------------------------- + * H5T_FLOAT + *------------------------------------------------------------------------- + */ case H5T_FLOAT: - - - - /*------------------------------------------------------------------------- - * H5T_NATIVE_FLOAT - *------------------------------------------------------------------------- - */ - if (type_size==4) - { + /*------------------------------------------------------------------------- + * H5T_NATIVE_FLOAT + *------------------------------------------------------------------------- + */ + if (type_size == 4) { float temp1_float; float temp2_float; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; - HDassert(type_size==sizeof(float)); + HDassert(type_size == sizeof(float)); HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); /* logic for detecting NaNs is different with options -d, -p and no options */ - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ - if (options->d && !options->p) - { - - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ + if (options->d && !options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_FLOAT, &temp1_float); + isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } - /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - if (ABS(temp1_float-temp2_float) > (float)options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + if (ABS(temp1_float-temp2_float) > (float) options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,(double)temp1_float,(double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; - } } - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!options->d && options->p) - { - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!options->d && options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_FLOAT, &temp1_float); + isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { + if (!isnan1 && !isnan2) { + PER(temp1_float, temp2_float); - PER(temp1_float,temp2_float); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - - else - - if ( per > options->percent && (double)ABS(temp1_float-temp2_float) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float), - (double)ABS(1 - temp2_float / temp1_float)); - } - nfound++; + else if (per > options->percent && (double) ABS(temp1_float - temp2_float) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, + parallel_print(SPACES); + parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, + (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); } - + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; - } } - - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - - else if ( options->d && options->p) - { - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ + else if (options->d && options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_FLOAT, &temp1_float); + isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } - /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - PER(temp1_float,temp2_float); + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + PER(temp1_float, temp2_float); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float), - (double)ABS(1 - temp2_float / temp1_float)); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, + (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); } - + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; - } } - - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else if (equal_float(temp1_float,temp2_float,options)==FALSE) - { - - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ + else if (equal_float(temp1_float, temp2_float, options) == FALSE) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } } /*H5T_NATIVE_FLOAT*/ - /*------------------------------------------------------------------------- - * H5T_NATIVE_DOUBLE - *------------------------------------------------------------------------- - */ - - else if (type_size==8) - { + /*------------------------------------------------------------------------- + * H5T_NATIVE_DOUBLE + *------------------------------------------------------------------------- + */ + else if (type_size == 8) { double temp1_double; double temp2_double; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; - HDassert(type_size==sizeof(double)); + HDassert(type_size == sizeof(double)); HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); - /* logic for detecting NaNs is different with options -d, -p and no options */ - - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ - if (options->d && !options->p) - { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + /* logic for detecting NaNs is different with options -d, -p and no options */ + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ + if (options->d && !options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - if (ABS(temp1_double-temp2_double) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (!isnan1 && !isnan2) { + if (ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; - } } /* options->d && !options->p */ - - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!options->d && options->p) - { - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!options->d && options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - PER(temp1_double,temp2_double); + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } - + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; - } } - - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if ( options->d && options->p) - { - - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ + else if (options->d && options->p) { + /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + if (options->do_nans) { + isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - PER(temp1_double,temp2_double); + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent && - ABS(temp1_double-temp2_double) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent && + ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } - + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } - - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else if (equal_double(temp1_double,temp2_double,options)==FALSE) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ + else if (equal_double(temp1_double, temp2_double, options) == FALSE) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - } /*H5T_NATIVE_DOUBLE*/ + } /*H5T_NATIVE_DOUBLE*/ #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE - - /*------------------------------------------------------------------------- - * H5T_NATIVE_LDOUBLE - *------------------------------------------------------------------------- - */ - - else if (type_size == H5_SIZEOF_LONG_DOUBLE) - { + /*------------------------------------------------------------------------- + * H5T_NATIVE_LDOUBLE + *------------------------------------------------------------------------- + */ + else if (type_size == H5_SIZEOF_LONG_DOUBLE) { long double temp1_double; long double temp2_double; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; - + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; HDassert(type_size == sizeof(long double)); HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); - /* logic for detecting NaNs is different with options -d, -p and no options */ - - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ - if (options->d && !options->p) - { + /* logic for detecting NaNs is different with options -d, -p and no options */ - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ + if (options->d && !options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } - /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - if (ABS(temp1_double-temp2_double) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + if (ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LD_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } /* NaN */ /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } - - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!options->d && options->p) - { - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!options->d && options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } - /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { PER(temp1_double,temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LD_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } - + nfound++; + } } /* NaN */ /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - } - - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if ( options->d && options->p) - { - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + } + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ + else if ( options->d && options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } - /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - + /* both not NaN, do the comparison */ + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LD_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent && - ABS(temp1_double-temp2_double) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent && ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } - + nfound++; + } } /* NaN */ /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } - - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else if (equal_ldouble(temp1_double,temp2_double,options)==FALSE) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ + else if (equal_ldouble(temp1_double, temp2_double, options) == FALSE) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LD_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - } /*H5T_NATIVE_LDOUBLE*/ + } /*H5T_NATIVE_LDOUBLE*/ #endif /* H5_SIZEOF_LONG_DOUBLE */ + break; /* H5T_FLOAT class */ - - break; /* H5T_FLOAT class */ - - } /* switch */ + } /* switch */ h5difftrace("diff_datum finish\n"); - return nfound; + return nfound; } /*------------------------------------------------------------------------- @@ -2569,12 +1926,11 @@ static hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ -static hbool_t all_zero(const void *_mem, size_t size) -{ - const unsigned char *mem = (const unsigned char *)_mem; +static hbool_t all_zero(const void *_mem, size_t size) { + const unsigned char *mem = (const unsigned char *) _mem; - while(size-- > 0) - if(mem[size]) + while (size-- > 0) + if (mem[size]) return FALSE; return TRUE; @@ -2591,22 +1947,18 @@ static hbool_t all_zero(const void *_mem, size_t size) */ static -void print_region_block(int i, hsize_t *ptdata, int ndims) -{ +void print_region_block(int i, hsize_t *ptdata, int ndims) { int j; parallel_print(" "); for (j = 0; j < ndims; j++) - parallel_print("%s%lu", j ? "," : " (", - (unsigned long)ptdata[i * 2 * ndims + j]); + parallel_print("%s%lu", j ? "," : " (", (unsigned long) ptdata[i * 2 * ndims + j]); for (j = 0; j < ndims; j++) - parallel_print("%s%lu", j ? "," : ")-(", - (unsigned long)ptdata[i * 2 * ndims + j + ndims]); + parallel_print("%s%lu", j ? "," : ")-(", (unsigned long) ptdata[i * 2 * ndims + j + ndims]); parallel_print(")"); } - /*------------------------------------------------------------------------- * Function: print_points * @@ -2618,14 +1970,12 @@ void print_region_block(int i, hsize_t *ptdata, int ndims) */ static -void print_points(int i, hsize_t *ptdata, int ndims) -{ +void print_points(int i, hsize_t *ptdata, int ndims) { int j; parallel_print(" "); for (j = 0; j < ndims; j++) - parallel_print("%s%lu", j ? "," : "(", - (unsigned long)(ptdata[i * ndims + j])); + parallel_print("%s%lu", j ? "," : "(", (unsigned long) (ptdata[i * ndims + j])); parallel_print(")"); } @@ -2640,62 +1990,61 @@ void print_points(int i, hsize_t *ptdata, int ndims) *------------------------------------------------------------------------- */ -static -hsize_t diff_region(hid_t obj1_id, - hid_t obj2_id, - hid_t region1_id, - hid_t region2_id, - diff_opt_t *options) +static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *options) { - hssize_t nblocks1, npoints1; - hssize_t nblocks2, npoints2; - hsize_t alloc_size; - hsize_t *ptdata1; - hsize_t *ptdata2; - int ndims1; - int ndims2; - int i, j; - hsize_t nfound_b = 0; /* block differences found */ - hsize_t nfound_p = 0; /* point differences found */ + hssize_t nblocks1, npoints1; + hssize_t nblocks2, npoints2; + hsize_t alloc_size; + hsize_t *ptdata1; + hsize_t *ptdata2; + int ndims1; + int ndims2; + int i, j; + hsize_t nfound_b = 0; /* block differences found */ + hsize_t nfound_p = 0; /* point differences found */ ndims1 = H5Sget_simple_extent_ndims(region1_id); ndims2 = H5Sget_simple_extent_ndims(region2_id); /* - * These two functions fail if the region does not have blocks or points, - * respectively. They do not currently know how to translate from one to - * the other. - */ - H5E_BEGIN_TRY { - nblocks1 = H5Sget_select_hyper_nblocks(region1_id); - nblocks2 = H5Sget_select_hyper_nblocks(region2_id); + * These two functions fail if the region does not have blocks or points, + * respectively. They do not currently know how to translate from one to + * the other. + */ + H5E_BEGIN_TRY + { + nblocks1 = H5Sget_select_hyper_nblocks(region1_id); + nblocks2 = H5Sget_select_hyper_nblocks(region2_id); - npoints1 = H5Sget_select_elem_npoints(region1_id); - npoints2 = H5Sget_select_elem_npoints(region2_id); - } H5E_END_TRY; + npoints1 = H5Sget_select_elem_npoints(region1_id); + npoints2 = H5Sget_select_elem_npoints(region2_id); + }H5E_END_TRY; - if(nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) { + if (nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) { options->not_cmp = 1; return 0; } /*------------------------------------------------------------------------- - * compare block information - *------------------------------------------------------------------------- - */ - if(nblocks1 > 0) { + * compare block information + *------------------------------------------------------------------------- + */ + if (nblocks1 > 0) { HDassert(ndims1 > 0); - alloc_size = (hsize_t)nblocks1 * (unsigned)ndims1 * 2 * sizeof(ptdata1[0]); - HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + alloc_size = (hsize_t) nblocks1 * (unsigned) ndims1 * 2 + * sizeof(ptdata1[0]); + HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/ - ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size); + ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size); H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t); - H5Sget_select_hyper_blocklist(region1_id, (hsize_t)0, (hsize_t)nblocks1, ptdata1); + H5Sget_select_hyper_blocklist(region1_id, (hsize_t) 0, + (hsize_t) nblocks1, ptdata1); - ptdata2 = (hsize_t *)HDmalloc((size_t)alloc_size); + ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size); H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t); - H5Sget_select_hyper_blocklist(region2_id, (hsize_t)0, (hsize_t)nblocks2, ptdata2); + H5Sget_select_hyper_blocklist(region2_id, (hsize_t) 0, + (hsize_t) nblocks2, ptdata2); for (i = 0; i < nblocks1; i++) { /* start coordinates and opposite corner */ @@ -2704,14 +2053,13 @@ hsize_t diff_region(hid_t obj1_id, start1 = ptdata1[i * 2 * ndims1 + j]; start2 = ptdata2[i * 2 * ndims1 + j]; - end1 = ptdata1[i * 2 * ndims1 + j + ndims1]; - end2 = ptdata2[i * 2 * ndims1 + j + ndims1]; + end1 = ptdata1[i * 2 * ndims1 + j + ndims1]; + end2 = ptdata2[i * 2 * ndims1 + j + ndims1]; if (start1 != start2 || end1 != end2) nfound_b++; } } - /* print differences if found */ if (nfound_b && options->m_verbose) { H5O_info_t oi1, oi2; @@ -2720,8 +2068,9 @@ hsize_t diff_region(hid_t obj1_id, H5Oget_info(obj2_id, &oi2); parallel_print("Referenced dataset %lu %lu\n", - (unsigned long)oi1.addr, (unsigned long)oi2.addr); - parallel_print("------------------------------------------------------------\n"); + (unsigned long) oi1.addr, (unsigned long) oi2.addr); + parallel_print( + "------------------------------------------------------------\n"); parallel_print("Region blocks\n"); for (i = 0; i < nblocks1; i++) { @@ -2737,47 +2086,50 @@ hsize_t diff_region(hid_t obj1_id, } /*------------------------------------------------------------------------- - * compare point information - *------------------------------------------------------------------------- - */ - if(npoints1 > 0) { - alloc_size = (hsize_t)npoints1 * (unsigned)ndims1 * sizeof(ptdata1[0]); - HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + * compare point information + *------------------------------------------------------------------------- + */ + if (npoints1 > 0) { + alloc_size = (hsize_t) npoints1 * (unsigned) ndims1 + * sizeof(ptdata1[0]); + HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/ - ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size); - H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); - H5Sget_select_elem_pointlist(region1_id, (hsize_t)0, (hsize_t)npoints1, ptdata1); + ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size); + H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); + H5Sget_select_elem_pointlist(region1_id, (hsize_t) 0, + (hsize_t) npoints1, ptdata1); - ptdata2 = (hsize_t *)HDmalloc((size_t)alloc_size); - H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); - H5Sget_select_elem_pointlist(region2_id, (hsize_t)0, (hsize_t)npoints2, ptdata2); + ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size); + H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); + H5Sget_select_elem_pointlist(region2_id, (hsize_t) 0, + (hsize_t) npoints2, ptdata2); - for(i = 0; i < npoints1; i++) { + for (i = 0; i < npoints1; i++) { hsize_t pt1, pt2; - for(j = 0; j < ndims1; j++) { + for (j = 0; j < ndims1; j++) { pt1 = ptdata1[i * ndims1 + j]; pt2 = ptdata2[i * ndims1 + j]; - if(pt1 != pt2) + if (pt1 != pt2) nfound_p++; } } - if(nfound_p && options->m_verbose) { + if (nfound_p && options->m_verbose) { parallel_print("Region points\n"); - for(i = 0; i < npoints1; i++) { + for (i = 0; i < npoints1; i++) { hsize_t pt1, pt2; - int diff_data = 0; + int diff_data = 0; - for(j = 0; j < ndims1; j++) { + for (j = 0; j < ndims1; j++) { pt1 = ptdata1[i * ndims1 + j]; pt2 = ptdata2[i * ndims1 + j]; - if(pt1 != pt2) { + if (pt1 != pt2) { diff_data = 1; break; } } - if(diff_data) { + if (diff_data) { parallel_print("point #%d", i); print_points(i, ptdata1, ndims1); print_points(i, ptdata2, ndims1); @@ -2786,7 +2138,6 @@ hsize_t diff_region(hid_t obj1_id, } } - #if defined (H5DIFF_DEBUG) for (i = 0; i < npoints1; i++) { int j; @@ -2794,8 +2145,8 @@ hsize_t diff_region(hid_t obj1_id, parallel_print("%sPt%lu: " , i ? "," : "", (unsigned long)i); for (j = 0; j < ndims1; j++) - parallel_print("%s%lu", j ? "," : "(", - (unsigned long)(ptdata1[i * ndims1 + j])); + parallel_print("%s%lu", j ? "," : "(", + (unsigned long)(ptdata1[i * ndims1 + j])); parallel_print(")"); } @@ -2805,12 +2156,11 @@ hsize_t diff_region(hid_t obj1_id, HDfree(ptdata2); } - nfound_b = nfound_b / (unsigned)ndims1; - nfound_p = nfound_p / (unsigned)ndims1; + nfound_b = nfound_b / (unsigned) ndims1; + nfound_p = nfound_p / (unsigned) ndims1; return (nfound_p + nfound_b); } - /*------------------------------------------------------------------------- * Function: character_compare * @@ -2821,33 +2171,18 @@ hsize_t diff_region(hid_t obj1_id, *------------------------------------------------------------------------- */ -static -hsize_t character_compare(char *mem1, - char *mem2, - hsize_t i, - size_t u, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) -{ - hsize_t nfound=0; /* differences found */ - char temp1_uchar; - char temp2_uchar; +static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u, + int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { + hsize_t nfound = 0; /* differences found */ + char temp1_uchar; + char temp2_uchar; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - h5diffdebug3("character_compare start %d=%d\n",temp1_uchar,temp2_uchar); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); h5diffdebug3("character_compare start %d=%d\n",temp1_uchar,temp2_uchar); - if (temp1_uchar != temp2_uchar) - { - if ( print_data(options) ) - { - print_char_pos(ph,0,i,u,acc,pos,rank,dims,obj1,obj2); + if (temp1_uchar != temp2_uchar) { + if (print_data(options)) { + print_char_pos(ph, 0, i, u, acc, pos, rank, dims, obj1, obj2); parallel_print(" "); h5diff_print_char(temp1_uchar); parallel_print(" "); @@ -2861,7 +2196,6 @@ hsize_t character_compare(char *mem1, return nfound; } - /*------------------------------------------------------------------------- * Function: character_compare_opt * @@ -2872,23 +2206,13 @@ hsize_t character_compare(char *mem1, *------------------------------------------------------------------------- */ -static hsize_t character_compare_opt(unsigned char *mem1, - unsigned char *mem2, - hsize_t i, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) -{ - hsize_t nfound=0; /* differences found */ - unsigned char temp1_uchar; - unsigned char temp2_uchar; - double per; - hbool_t both_zero; +static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, + hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { + hsize_t nfound = 0; /* differences found */ + unsigned char temp1_uchar; + unsigned char temp2_uchar; + double per; + hbool_t both_zero; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -2896,66 +2220,52 @@ static hsize_t character_compare_opt(unsigned char *mem1, h5difftrace("character_compare_opt start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - if ( PDIFF(temp1_uchar,temp2_uchar) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (PDIFF(temp1_uchar,temp2_uchar) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); + if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar),per); + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } nfound++; } } /* -d and -p */ - else if ( options->d && options->p) - { - PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); - if ( per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); + if (per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar),per); + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } nfound++; } } - else if (temp1_uchar != temp2_uchar) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_uchar != temp2_uchar) { + if (print_data(options)) { + print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; - } - h5difftrace("character_compare_opt finish\n"); + } h5difftrace("character_compare_opt finish\n"); return nfound; - } - /*------------------------------------------------------------------------- * Function: diff_float * @@ -2965,273 +2275,210 @@ static hsize_t character_compare_opt(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_float(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) +static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - float temp1_float; - float temp2_float; - hsize_t i; - double per; - hbool_t both_zero; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + hsize_t nfound = 0; /* number of differences found */ + float temp1_float; + float temp2_float; + hsize_t i; + double per; + hbool_t both_zero; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; h5difftrace("diff_float start\n"); - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_FLOAT, &temp1_float); + isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - if ((double)ABS(temp1_float-temp2_float) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (!isnan1 && !isnan2) { + if ((double) ABS(temp1_float - temp2_float) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - mem1+=sizeof(float); - mem2+=sizeof(float); - if (options->n && nfound>=options->count) + mem1 += sizeof(float); + mem2 += sizeof(float); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_FLOAT, &temp1_float); + isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } /* both not NaN, do the comparison */ - if ( (!isnan1 && !isnan2)) - { + if ((!isnan1 && !isnan2)) { + PER(temp1_float, temp2_float); - PER(temp1_float,temp2_float); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float), - (double)ABS(1 - temp2_float / temp1_float)); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, + (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); } + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - mem1+=sizeof(float); - mem2+=sizeof(float); - if (options->n && nfound>=options->count) + mem1 += sizeof(float); + mem2 += sizeof(float); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if ( options->d && options->p) - { - - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_FLOAT, &temp1_float); + isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { + if (!isnan1 && !isnan2) { + PER(temp1_float, temp2_float); - PER(temp1_float,temp2_float); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - - else - - if ( per > options->percent && (double)ABS(temp1_float - temp2_float) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float), - (double)ABS(1 - temp2_float / temp1_float)); - } - nfound++; + else if (per > options->percent && (double) ABS(temp1_float - temp2_float) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, + (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); } + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - mem1+=sizeof(float); - mem2+=sizeof(float); - if (options->n && nfound>=options->count) + mem1 += sizeof(float); + mem2 += sizeof(float); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else - { - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); - if (equal_float(temp1_float,temp2_float,options)==FALSE) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (equal_float(temp1_float, temp2_float, options) == FALSE) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - mem1+=sizeof(float); - mem2+=sizeof(float); - if (options->n && nfound>=options->count) + mem1 += sizeof(float); + mem2 += sizeof(float); + if (options->n && nfound >= options->count) return nfound; - } /* nelmts */ - - - - - } h5difftrace("diff_float finish\n"); return nfound; } - /*------------------------------------------------------------------------- * Function: diff_double * @@ -3241,279 +2488,209 @@ static hsize_t diff_float(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_double(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) +static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - double temp1_double; - double temp2_double; - hsize_t i; - double per; - hbool_t both_zero; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + hsize_t nfound = 0; /* number of differences found */ + double temp1_double; + double temp2_double; + hsize_t i; + double per; + hbool_t both_zero; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; h5difftrace("diff_double start\n"); - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - if (ABS(temp1_double-temp2_double) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (!isnan1 && !isnan2) { + if (ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - mem1+=sizeof(double); - mem2+=sizeof(double); - if (options->n && nfound>=options->count) + mem1 += sizeof(double); + mem2 += sizeof(double); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - PER(temp1_double,temp2_double); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, + ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - mem1+=sizeof(double); - mem2+=sizeof(double); - if (options->n && nfound>=options->count) + mem1 += sizeof(double); + mem2 += sizeof(double); + if (options->n && nfound >= options->count) return nfound; } /* i */ } + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ + else if (options->d && options->p) { - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if ( options->d && options->p) - { - - for ( i = 0; i < nelmts; i++) - { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - PER(temp1_double,temp2_double); + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent && ABS(temp1_double-temp2_double) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent && ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, + ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } - + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; - } - mem1+=sizeof(double); - mem2+=sizeof(double); - if (options->n && nfound>=options->count) + mem1 += sizeof(double); + mem2 += sizeof(double); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else - { - - - - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); - - if (equal_double(temp1_double,temp2_double,options)==FALSE) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (equal_double(temp1_double, temp2_double, options) == FALSE) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - mem1+=sizeof(double); - mem2+=sizeof(double); - if (options->n && nfound>=options->count) + mem1 += sizeof(double); + mem2 += sizeof(double); + if (options->n && nfound >= options->count) return nfound; - } /* nelmts */ - - - - - } h5difftrace("diff_double finish\n"); return nfound; } - - - - /*------------------------------------------------------------------------- * Function: diff_ldouble * @@ -3526,20 +2703,20 @@ static hsize_t diff_double(unsigned char *mem1, #if H5_SIZEOF_LONG_DOUBLE !=0 static hsize_t diff_ldouble(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph) { - hsize_t nfound=0; /* number of differences found */ + hsize_t nfound=0; /* number of differences found */ long double temp1_double; long double temp2_double; hsize_t i; @@ -3550,245 +2727,183 @@ static hsize_t diff_ldouble(unsigned char *mem1, h5difftrace("diff_ldouble start\n"); - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for ( i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - if (ABS(temp1_double-temp2_double) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (!isnan1 && !isnan2) { + if (ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - emp2_double)); } nfound++; } - mem1+=sizeof(long double); - mem2+=sizeof(long double); - if (options->n && nfound>=options->count) + mem1 += sizeof(long double); + mem2 += sizeof(long double); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - PER(temp1_double,temp2_double); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, + ABS(temp1_double - temp2_double), ABS(1-temp2_double / temp1_double)); } + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start+i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; - } - mem1+=sizeof(long double); - mem2+=sizeof(long double); - if (options->n && nfound>=options->count) + mem1 += sizeof(long double); + mem2 += sizeof(long double); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if ( options->d && options->p) - { - - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - PER(temp1_double,temp2_double); + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent && ABS(temp1_double-temp2_double) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent && ABS(temp1_double - temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1-temp2_double / temp1_double)); } - + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; - } - mem1+=sizeof(long double); - mem2+=sizeof(long double); - if (options->n && nfound>=options->count) + mem1 += sizeof(long double); + mem2 += sizeof(long double); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else - { - - - - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); - - if (equal_ldouble(temp1_double,temp2_double,options)==FALSE) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (equal_ldouble(temp1_double, temp2_double, options) == FALSE) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - mem1+=sizeof(long double); - mem2+=sizeof(long double); - if (options->n && nfound>=options->count) + mem1 += sizeof(long double); + mem2 += sizeof(long double); + if (options->n && nfound >= options->count) return nfound; - } /* nelmts */ - - - - - } h5difftrace("diff_ldouble finish\n"); @@ -3796,11 +2911,6 @@ static hsize_t diff_ldouble(unsigned char *mem1, } #endif /* H5_SIZEOF_LONG_DOUBLE */ - - - - - /*------------------------------------------------------------------------- * Function: diff_schar * @@ -3810,171 +2920,125 @@ static hsize_t diff_ldouble(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_schar(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) +static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - char temp1_char; - char temp2_char; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + char temp1_char; + char temp2_char; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_schar start\n"); - /* -d and !-p */ - if (options->d && !options->p) - { - - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); - if (ABS(temp1_char-temp2_char) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (ABS(temp1_char-temp2_char) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_char,temp2_char,ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - mem1+=sizeof(char); - mem2+=sizeof(char); - if (options->n && nfound>=options->count) + mem1 += sizeof(char); + mem2 += sizeof(char); + if (options->n && nfound >= options->count) return nfound; } } - /* !-d and -p */ - else if (!options->d && options->p) - { - - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); - PER(temp1_char,temp2_char); + PER(temp1_char, temp2_char); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_char,temp2_char, - ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_char,temp2_char, - ABS(temp1_char-temp2_char), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } - mem1+=sizeof(char); - mem2+=sizeof(char); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(char); + mem2 += sizeof(char); + if (options->n && nfound >= options->count) return nfound; } } - /* -d and -p */ - else if ( options->d && options->p) - { - - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); - PER(temp1_char,temp2_char); + PER(temp1_char, temp2_char); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_char,temp2_char, - ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - else - if ( per > options->percent && ABS(temp1_char-temp2_char) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_char,temp2_char, - ABS(temp1_char-temp2_char), - per); - } - nfound++; + else if (per > options->percent && ABS(temp1_char-temp2_char) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } - mem1+=sizeof(char); - mem2+=sizeof(char); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(char); + mem2 += sizeof(char); + if (options->n && nfound >= options->count) return nfound; } - } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); - if (temp1_char != temp2_char) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_char != temp2_char) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_char,temp2_char,ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - mem1+=sizeof(char); - mem2+=sizeof(char); - if (options->n && nfound>=options->count) + mem1 += sizeof(char); + mem2 += sizeof(char); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ - } h5difftrace("diff_schar finish\n"); return nfound; } - - /*------------------------------------------------------------------------- * Function: diff_uchar * @@ -3984,159 +3048,118 @@ static hsize_t diff_schar(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_uchar(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_uchar start\n"); - /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - if ( PDIFF(temp1_uchar,temp2_uchar) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (PDIFF(temp1_uchar,temp2_uchar) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - mem1+=sizeof(unsigned char); - mem2+=sizeof(unsigned char); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned char); + mem2 += sizeof(unsigned char); + if (options->n && nfound >= options->count) return nfound; } } - /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uchar,temp2_uchar, - PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uchar,temp2_uchar, - PDIFF(temp1_uchar,temp2_uchar), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } - mem1+=sizeof(unsigned char); - mem2+=sizeof(unsigned char); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned char); + mem2 += sizeof(unsigned char); + if (options->n && nfound >= options->count) return nfound; } } - /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uchar,temp2_uchar, - PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - else - if ( per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uchar,temp2_uchar, - PDIFF(temp1_uchar,temp2_uchar), - per); - } - nfound++; + else if (per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } - mem1+=sizeof(unsigned char); - mem2+=sizeof(unsigned char); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned char); + mem2 += sizeof(unsigned char); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - if (temp1_uchar != temp2_uchar) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_uchar != temp2_uchar) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - mem1+=sizeof(unsigned char); - mem2+=sizeof(unsigned char); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned char); + mem2 += sizeof(unsigned char); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ - } h5difftrace("diff_uchar finish\n"); @@ -4152,155 +3175,116 @@ static hsize_t diff_uchar(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_short(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - short temp1_short; - short temp2_short; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + short temp1_short; + short temp2_short; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_short start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); - if (ABS(temp1_short-temp2_short) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (ABS(temp1_short-temp2_short) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_short,temp2_short,ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - mem1+=sizeof(short); - mem2+=sizeof(short); - if (options->n && nfound>=options->count) + mem1 += sizeof(short); + mem2 += sizeof(short); + if (options->n && nfound >= options->count) return nfound; } } - /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); - PER(temp1_short,temp2_short); + PER(temp1_short, temp2_short); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_short,temp2_short, - ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_short,temp2_short, - ABS(temp1_short-temp2_short), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } - mem1+=sizeof(short); - mem2+=sizeof(short); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(short); + mem2 += sizeof(short); + if (options->n && nfound >= options->count) return nfound; } } - /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); - PER(temp1_short,temp2_short); + PER(temp1_short, temp2_short); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_short,temp2_short, - ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - else - if ( per > options->percent && ABS(temp1_short-temp2_short) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_short,temp2_short, - ABS(temp1_short-temp2_short), - per); - } - nfound++; + else if (per > options->percent && ABS(temp1_short-temp2_short) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } - mem1+=sizeof(short); - mem2+=sizeof(short); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(short); + mem2 += sizeof(short); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); - if (temp1_short != temp2_short) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_short != temp2_short) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_short,temp2_short,ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - mem1+=sizeof(short); - mem2+=sizeof(short); - if (options->n && nfound>=options->count) + mem1 += sizeof(short); + mem2 += sizeof(short); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ } @@ -4309,7 +3293,6 @@ static hsize_t diff_short(unsigned char *mem1, return nfound; } - /*------------------------------------------------------------------------- * Function: diff_ushort * @@ -4319,163 +3302,125 @@ static hsize_t diff_short(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_ushort(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) +static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ unsigned short temp1_ushort; unsigned short temp2_ushort; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_ushort start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - if ( PDIFF(temp1_ushort,temp2_ushort) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (PDIFF(temp1_ushort,temp2_ushort) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - mem1+=sizeof(unsigned short); - mem2+=sizeof(unsigned short); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned short); + mem2 += sizeof(unsigned short); + if (options->n && nfound >= options->count) return nfound; } } - /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + /* !-d and -p */ + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); + PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_ushort,temp2_ushort, - PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_ushort,temp2_ushort, - PDIFF(temp1_ushort,temp2_ushort), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } - mem1+=sizeof(unsigned short); - mem2+=sizeof(unsigned short); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned short); + mem2 += sizeof(unsigned short); + if (options->n && nfound >= options->count) return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); + PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_ushort,temp2_ushort, - PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - else - if ( per > options->percent && PDIFF(temp1_ushort,temp2_ushort) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_ushort,temp2_ushort, - PDIFF(temp1_ushort,temp2_ushort), - per); - } - nfound++; + else if (per > options->percent && PDIFF(temp1_ushort,temp2_ushort) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } - mem1+=sizeof(unsigned short); - mem2+=sizeof(unsigned short); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned short); + mem2 += sizeof(unsigned short); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - if (temp1_ushort != temp2_ushort) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_ushort != temp2_ushort) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - mem1+=sizeof(unsigned short); - mem2+=sizeof(unsigned short); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned short); + mem2 += sizeof(unsigned short); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ - } h5difftrace("diff_ushort finish\n"); return nfound; } - /*------------------------------------------------------------------------- * Function: diff_int * @@ -4485,163 +3430,124 @@ static hsize_t diff_ushort(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_int(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - int temp1_int; - int temp2_int; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + int temp1_int; + int temp2_int; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_int start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); - if (ABS(temp1_int-temp2_int) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (ABS(temp1_int-temp2_int) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_int,temp2_int,ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - mem1+=sizeof(int); - mem2+=sizeof(int); - if (options->n && nfound>=options->count) + mem1 += sizeof(int); + mem2 += sizeof(int); + if (options->n && nfound >= options->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); - PER(temp1_int,temp2_int); + PER(temp1_int, temp2_int); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_int,temp2_int, - ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_int,temp2_int, - ABS(temp1_int-temp2_int), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } - mem1+=sizeof(int); - mem2+=sizeof(int); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(int); + mem2 += sizeof(int); + if (options->n && nfound >= options->count) return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); - PER(temp1_int,temp2_int); + PER(temp1_int, temp2_int); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_int,temp2_int, - ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - else - if ( per > options->percent && ABS(temp1_int-temp2_int) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_int,temp2_int, - ABS(temp1_int-temp2_int), - per); - } - nfound++; + else if (per > options->percent && ABS(temp1_int-temp2_int) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } - mem1+=sizeof(int); - mem2+=sizeof(int); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(int); + mem2 += sizeof(int); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); - if (temp1_int != temp2_int) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_int != temp2_int) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_int,temp2_int,ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - mem1+=sizeof(int); - mem2+=sizeof(int); - if (options->n && nfound>=options->count) + mem1 += sizeof(int); + mem2 += sizeof(int); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ } h5difftrace("diff_int finish\n"); - return nfound; } - /*------------------------------------------------------------------------- * Function: diff_uint * @@ -4651,151 +3557,117 @@ static hsize_t diff_int(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_uint(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - unsigned int temp1_uint; - unsigned int temp2_uint; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + unsigned int temp1_uint; + unsigned int temp2_uint; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_uint start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - if ( PDIFF(temp1_uint,temp2_uint) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (PDIFF(temp1_uint,temp2_uint) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - mem1+=sizeof(unsigned int); - mem2+=sizeof(unsigned int); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned int); + mem2 += sizeof(unsigned int); + if (options->n && nfound >= options->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - PER_UNSIGN(signed int,temp1_uint,temp2_uint); + PER_UNSIGN(signed int, temp1_uint, temp2_uint); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uint,temp2_uint, - PDIFF(temp1_uint,temp2_uint), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } - mem1+=sizeof(unsigned int); - mem2+=sizeof(unsigned int); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned int); + mem2 += sizeof(unsigned int); + if (options->n && nfound >= options->count) return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - PER_UNSIGN(signed int,temp1_uint,temp2_uint); + PER_UNSIGN(signed int, temp1_uint, temp2_uint); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - else - if ( per > options->percent && PDIFF(temp1_uint,temp2_uint) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uint,temp2_uint, - PDIFF(temp1_uint,temp2_uint), - per); - } - nfound++; + else if (per > options->percent + && PDIFF(temp1_uint,temp2_uint) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } - mem1+=sizeof(unsigned int); - mem2+=sizeof(unsigned int); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned int); + mem2 += sizeof(unsigned int); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - if (temp1_uint != temp2_uint) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_uint != temp2_uint) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - mem1+=sizeof(unsigned int); - mem2+=sizeof(unsigned int); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned int); + mem2 += sizeof(unsigned int); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ } @@ -4804,7 +3676,6 @@ static hsize_t diff_uint(unsigned char *mem1, return nfound; } - /*------------------------------------------------------------------------- * Function: diff_long * @@ -4814,166 +3685,126 @@ static hsize_t diff_uint(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_long(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - long temp1_long; - long temp2_long; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + long temp1_long; + long temp2_long; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_long start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); - if (ABS(temp1_long-temp2_long) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (ABS(temp1_long-temp2_long) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT,temp1_long,temp2_long,ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - mem1+=sizeof(long); - mem2+=sizeof(long); - if (options->n && nfound>=options->count) + mem1 += sizeof(long); + mem2 += sizeof(long); + if (options->n && nfound >= options->count) return nfound; } } } /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); - PER(temp1_long,temp2_long); + PER(temp1_long, temp2_long); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP,temp1_long,temp2_long, - ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P,temp1_long,temp2_long, - ABS(temp1_long-temp2_long), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } - mem1+=sizeof(long); - mem2+=sizeof(long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(long); + mem2 += sizeof(long); + if (options->n && nfound >= options->count) return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); - PER(temp1_long,temp2_long); + PER(temp1_long, temp2_long); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP,temp1_long,temp2_long, - ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - else - if ( per > options->percent && ABS(temp1_long-temp2_long) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P,temp1_long,temp2_long, - ABS(temp1_long-temp2_long), - per); - } - nfound++; + else if (per > options->percent && ABS(temp1_long-temp2_long) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } - mem1+=sizeof(long); - mem2+=sizeof(long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(long); + mem2 += sizeof(long); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); - if (temp1_long != temp2_long) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_long != temp2_long) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT,temp1_long,temp2_long,ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - mem1+=sizeof(long); - mem2+=sizeof(long); - if (options->n && nfound>=options->count) + mem1 += sizeof(long); + mem2 += sizeof(long); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ - } h5difftrace("diff_long finish\n"); return nfound; } - /*------------------------------------------------------------------------- * Function: diff_ulong * @@ -4983,155 +3814,120 @@ static hsize_t diff_long(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_ulong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - unsigned long temp1_ulong; - unsigned long temp2_ulong; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + unsigned long temp1_ulong; + unsigned long temp2_ulong; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_ulong start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - if ( PDIFF(temp1_ulong,temp2_ulong) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (PDIFF(temp1_ulong,temp2_ulong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - mem1+=sizeof(unsigned long); - mem2+=sizeof(unsigned long); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned long); + mem2 += sizeof(unsigned long); + if (options->n && nfound >= options->count) return nfound; } } } /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); + PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P,temp1_ulong,temp2_ulong, - PDIFF(temp1_ulong,temp2_ulong), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } - mem1+=sizeof(unsigned long); - mem2+=sizeof(unsigned long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned long); + mem2 += sizeof(unsigned long); + if (options->n && nfound >= options->count) return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); + PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - else - if ( per > options->percent && PDIFF(temp1_ulong,temp2_ulong) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P,temp1_ulong,temp2_ulong, - PDIFF(temp1_ulong,temp2_ulong), - per); - } - nfound++; + else if (per > options->percent + && PDIFF(temp1_ulong,temp2_ulong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } - mem1+=sizeof(unsigned long); - mem2+=sizeof(unsigned long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned long); + mem2 += sizeof(unsigned long); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - if (temp1_ulong != temp2_ulong) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_ulong != temp2_ulong) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - mem1+=sizeof(unsigned long); - mem2+=sizeof(unsigned long); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned long); + mem2 += sizeof(unsigned long); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ } @@ -5140,7 +3936,6 @@ static hsize_t diff_ulong(unsigned char *mem1, return nfound; } - /*------------------------------------------------------------------------- * Function: diff_llong * @@ -5150,147 +3945,117 @@ static hsize_t diff_ulong(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_llong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - long long temp1_llong; - long long temp2_llong; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + long long temp1_llong; + long long temp2_llong; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_llong start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); - if (ABS( temp1_llong-temp2_llong) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (ABS( temp1_llong-temp2_llong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LLI_FORMAT,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong)); + parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } - mem1+=sizeof(long long); - mem2+=sizeof(long long); - if (options->n && nfound>=options->count) + mem1 += sizeof(long long); + mem2 += sizeof(long long); + if (options->n && nfound >= options->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); - PER(temp1_llong,temp2_llong); + PER(temp1_llong, temp2_llong); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LLI_FORMAT_P_NOTCOMP,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong)); - } - nfound++; + parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT_P,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong),per); - } - nfound++; - } - mem1+=sizeof(long long); - mem2+=sizeof(long long); - if (options->n && nfound>=options->count) - return nfound; + nfound++; + } + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); + } + nfound++; + } + mem1 += sizeof(long long); + mem2 += sizeof(long long); + if (options->n && nfound >= options->count) + return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); - PER(temp1_llong,temp2_llong); + PER(temp1_llong, temp2_llong); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LLI_FORMAT_P_NOTCOMP,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong)); + parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } - else - if ( per > options->percent && ABS(temp1_llong-temp2_llong) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT_P,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong),per); - } - nfound++; + else if (per > options->percent + && ABS(temp1_llong-temp2_llong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); } - mem1+=sizeof(long long); - mem2+=sizeof(long long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(long long); + mem2 += sizeof(long long); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); - if (temp1_llong != temp2_llong) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_llong != temp2_llong) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LLI_FORMAT,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong)); + parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } - mem1+=sizeof(long long); - mem2+=sizeof(long long); - if (options->n && nfound>=options->count) + mem1 += sizeof(long long); + mem2 += sizeof(long long); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ } @@ -5299,7 +4064,6 @@ static hsize_t diff_llong(unsigned char *mem1, return nfound; } - /*------------------------------------------------------------------------- * Function: diff_ullong * @@ -5309,152 +4073,122 @@ static hsize_t diff_llong(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_ullong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) +static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, + hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - unsigned long long temp1_ullong; - unsigned long long temp2_ullong; - hsize_t i; - float f1, f2; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + unsigned long long temp1_ullong; + unsigned long long temp2_ullong; + hsize_t i; + float f1, f2; + double per; + hbool_t both_zero; h5difftrace("diff_ullong start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); } nfound++; } - mem1+=sizeof(unsigned long long); - mem2+=sizeof(unsigned long long); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned long long); + mem2 += sizeof(unsigned long long); + if (options->n && nfound >= options->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - ull2float(temp1_ullong,&f1); - ull2float(temp2_ullong,&f2); - PER(f1,f2); + ull2float(temp1_ullong, &f1); + ull2float(temp2_ullong, &f2); + PER(f1, f2); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); } - mem1+=sizeof(unsigned long long); - mem2+=sizeof(unsigned long long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned long long); + mem2 += sizeof(unsigned long long); + if (options->n && nfound >= options->count) return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - ull2float(temp1_ullong,&f1); - ull2float(temp2_ullong,&f2); - PER(f1,f2); + ull2float(temp1_ullong, &f1); + ull2float(temp2_ullong, &f2); + PER(f1, f2); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); } nfound++; } - else - if ( per > options->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long)options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); - } - nfound++; + else if (per > options->percent + && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); } - mem1+=sizeof(unsigned long long); - mem2+=sizeof(unsigned long long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned long long); + mem2 += sizeof(unsigned long long); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - if (temp1_ullong != temp2_ullong) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_ullong != temp2_ullong) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); } nfound++; } - mem1+=sizeof(unsigned long long); - mem2+=sizeof(unsigned long long); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned long long); + mem2 += sizeof(unsigned long long); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ } @@ -5463,7 +4197,6 @@ static hsize_t diff_ullong(unsigned char *mem1, return nfound; } - /*------------------------------------------------------------------------- * Function: ull2float * @@ -5477,49 +4210,46 @@ static hsize_t diff_ullong(unsigned char *mem1, *------------------------------------------------------------------------- */ static -int ull2float(unsigned long long ull_value, float *f_value) -{ - hid_t dxpl_id; - unsigned char *buf = NULL; - size_t src_size; - size_t dst_size; +int ull2float(unsigned long long ull_value, float *f_value) { + hid_t dxpl_id; + unsigned char *buf = NULL; + size_t src_size; + size_t dst_size; h5difftrace("ull2float start\n"); - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER))<0) + if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; src_size = H5Tget_size(H5T_NATIVE_ULLONG); dst_size = H5Tget_size(H5T_NATIVE_FLOAT); - buf = (unsigned char*)HDcalloc((size_t)1, MAX(src_size, dst_size)); - if(!buf) + buf = (unsigned char*) HDcalloc((size_t )1, MAX(src_size, dst_size)); + if (!buf) goto error; HDmemcpy(buf, &ull_value, src_size); /* do conversion */ - if(H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, (size_t)1, buf, NULL, dxpl_id)<0) + if (H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, (size_t) 1, buf, NULL, dxpl_id) < 0) goto error; HDmemcpy(f_value, buf, dst_size); - if(buf) - HDfree(buf); - h5difftrace("ull2float finish\n"); + if (buf) + HDfree(buf);h5difftrace("ull2float finish\n"); return 0; error: - H5E_BEGIN_TRY { + H5E_BEGIN_TRY + { H5Pclose(dxpl_id); - } H5E_END_TRY; - if(buf) - HDfree(buf); - h5difftrace("ull2float errored\n"); + }H5E_END_TRY; + if (buf) + HDfree(buf);h5difftrace("ull2float errored\n"); return -1; } - /*------------------------------------------------------------------------- * Function: equal_double * @@ -5531,26 +4261,21 @@ error: * *------------------------------------------------------------------------- */ -static -hbool_t equal_double(double value, double expected, diff_opt_t *options) -{ +static hbool_t equal_double(double value, double expected, diff_opt_t *options) { h5difftrace("equal_double start\n"); - if ( options->do_nans ) - { - + if (options->do_nans) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - hbool_t isnan1 = my_isnan(FLT_DOUBLE,&value); - hbool_t isnan2 = my_isnan(FLT_DOUBLE,&expected); + hbool_t isnan1 = my_isnan(FLT_DOUBLE, &value); + hbool_t isnan2 = my_isnan(FLT_DOUBLE, &expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true *------------------------------------------------------------------------- */ - if ( isnan1 && isnan2 ) - { + if (isnan1 && isnan2) { return TRUE; } @@ -5558,8 +4283,7 @@ hbool_t equal_double(double value, double expected, diff_opt_t *options) * one is a NaN, do not compare but assume difference *------------------------------------------------------------------------- */ - if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) ) - { + if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { return FALSE; } } @@ -5590,31 +4314,27 @@ static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *options) { h5difftrace("equal_ldouble start\n"); - if ( options->do_nans ) - { - + if (options->do_nans) { /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - hbool_t isnan1 = my_isnan(FLT_LDOUBLE,&value); - hbool_t isnan2 = my_isnan(FLT_LDOUBLE,&expected); + * detect NaNs + *------------------------------------------------------------------------- + */ + hbool_t isnan1 = my_isnan(FLT_LDOUBLE, &value); + hbool_t isnan2 = my_isnan(FLT_LDOUBLE, &expected); /*------------------------------------------------------------------------- - * we consider NaN == NaN to be true - *------------------------------------------------------------------------- - */ - if ( isnan1 && isnan2 ) - { + * we consider NaN == NaN to be true + *------------------------------------------------------------------------- + */ + if (isnan1 && isnan2) { return TRUE; } /*------------------------------------------------------------------------- - * one is a NaN, do not compare but assume difference - *------------------------------------------------------------------------- - */ - if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) ) - { + * one is a NaN, do not compare but assume difference + *------------------------------------------------------------------------- + */ + if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { return FALSE; } } @@ -5623,7 +4343,7 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio return TRUE; if (options->use_system_epsilon) { - if ( ABS( (value-expected) ) < DBL_EPSILON) + if (ABS((value-expected)) < DBL_EPSILON) return TRUE; } h5difftrace("equal_ldouble finish\n"); @@ -5633,7 +4353,6 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio #endif /* #if H5_SIZEOF_LONG_DOUBLE !=0 */ - /*------------------------------------------------------------------------- * Function: equal_float * @@ -5645,35 +4364,29 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio * *------------------------------------------------------------------------- */ -static -hbool_t equal_float(float value, float expected, diff_opt_t *options) -{ +static hbool_t equal_float(float value, float expected, diff_opt_t *options) { h5difftrace("equal_float start\n"); - if ( options->do_nans ) - { - + if (options->do_nans) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - hbool_t isnan1 = my_isnan(FLT_FLOAT,&value); - hbool_t isnan2 = my_isnan(FLT_FLOAT,&expected); + hbool_t isnan1 = my_isnan(FLT_FLOAT, &value); + hbool_t isnan2 = my_isnan(FLT_FLOAT, &expected); /*------------------------------------------------------------------------- - * we consider NaN == NaN to be true - *------------------------------------------------------------------------- - */ - if ( isnan1 && isnan2 ) - { + * we consider NaN == NaN to be true + *------------------------------------------------------------------------- + */ + if (isnan1 && isnan2) { return TRUE; } /*------------------------------------------------------------------------- - * one is a NaN, do not compare but assume difference - *------------------------------------------------------------------------- - */ - if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) ) - { + * one is a NaN, do not compare but assume difference + *------------------------------------------------------------------------- + */ + if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { return FALSE; } } @@ -5691,8 +4404,6 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options) } - - /*------------------------------------------------------------------------- * Function: my_isnan * @@ -5709,81 +4420,68 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options) * *------------------------------------------------------------------------- */ -static hbool_t -my_isnan(dtype_t type, void *val) -{ +static hbool_t my_isnan(dtype_t type, void *val) { hbool_t retval = FALSE; char s[256]; h5difftrace("my_isnan start\n"); - if (FLT_FLOAT==type) - { + if (FLT_FLOAT == type) { float x; HDmemcpy(&x, val, sizeof(float)); - retval = (x!=x); + retval = (x != x); } - else if (FLT_DOUBLE==type) - { + else if (FLT_DOUBLE == type) { double x; HDmemcpy(&x, val, sizeof(double)); - retval = (x!=x); + retval = (x != x); } -#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 - else if (FLT_LDOUBLE==type) - { +#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE != 0 + else if (FLT_LDOUBLE == type) { long double x; HDmemcpy(&x, val, sizeof(long double)); retval = (x!=x); } #endif - else - { + else { return FALSE; } - /* + /* * Sometimes NaN==NaN (e.g., DEC Alpha) so we try to print it and see if * the result contains a NaN string. */ - if (!retval) - { - if (FLT_FLOAT==type) - { + if (!retval) { + if (FLT_FLOAT == type) { float x; HDmemcpy(&x, val, sizeof(float)); - HDsnprintf(s, sizeof(s), "%g", (double)x); + HDsnprintf(s, sizeof(s), "%g", (double) x); } - else if (FLT_DOUBLE==type) - { + else if (FLT_DOUBLE == type) { double x; HDmemcpy(&x, val, sizeof(double)); HDsnprintf(s, sizeof(s), "%g", x); } -#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 - else if (FLT_LDOUBLE==type) - { +#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE != 0 + else if (FLT_LDOUBLE == type) { long double x; HDmemcpy(&x, val, sizeof(long double)); HDsnprintf(s, sizeof(s), "%Lg", x); } #endif - else - { + else { return FALSE; } - if ( HDstrstr(s, "NaN") || - HDstrstr(s, "NAN") || - HDstrstr(s, "nan") || - HDstrstr(s, "-1.#IND") /* WIN32 */ - ) - { + if (HDstrstr(s, "NaN") || + HDstrstr(s, "NAN") || + HDstrstr(s, "nan") || + HDstrstr(s, "-1.#IND")) { retval = TRUE; } } @@ -5793,7 +4491,6 @@ my_isnan(dtype_t type, void *val) return retval; } - /*------------------------------------------------------------------------- * * Local functions @@ -5808,9 +4505,8 @@ my_isnan(dtype_t type, void *val) *------------------------------------------------------------------------- */ static -int print_data(diff_opt_t *options) -{ - return ( (options->m_report || options->m_verbose) && !options->m_quiet)?1:0; +int print_data(diff_opt_t *options) { + return ((options->m_report || options->m_verbose) && !options->m_quiet) ? 1 : 0; } /*------------------------------------------------------------------------- @@ -5820,37 +4516,28 @@ int print_data(diff_opt_t *options) * *------------------------------------------------------------------------- */ - static -void print_header(int pp, /* print percentage */ - int rank, - hsize_t *dims, - const char *obj1, - const char *obj2 ) -{ +void print_header(int pp, /* print percentage */ + int rank, hsize_t *dims, const char *obj1, const char *obj2) { /* print header */ - parallel_print("%-16s","size:"); - print_dimensions (rank,dims); - parallel_print("%-11s",""); - print_dimensions (rank,dims); + parallel_print("%-16s", "size:"); + print_dimensions(rank, dims); + parallel_print("%-11s", ""); + print_dimensions(rank, dims); parallel_print("\n"); - if(pp) { - parallel_print("%-15s %-15s %-15s %-15s %-15s\n", - "position", - (obj1!=NULL) ? obj1 : " ", - (obj2!=NULL) ? obj2 : " ", - "difference", - "relative"); - parallel_print("------------------------------------------------------------------------\n"); + if (pp) { + parallel_print("%-15s %-15s %-15s %-15s %-15s\n", "position", + (obj1 != NULL) ? obj1 : " ", (obj2 != NULL) ? obj2 : " ", "difference", + "relative"); + parallel_print( + "------------------------------------------------------------------------\n"); } else { - parallel_print("%-15s %-15s %-15s %-20s\n", - "position", - (obj1!=NULL) ? obj1 : " ", - (obj2!=NULL) ? obj2 : " ", - "difference"); - parallel_print("------------------------------------------------------------\n"); + parallel_print("%-15s %-15s %-15s %-20s\n", "position", + (obj1 != NULL) ? obj1 : " ", (obj2 != NULL) ? obj2 : " ", "difference"); + parallel_print( + "------------------------------------------------------------\n"); } } @@ -5861,48 +4548,36 @@ void print_header(int pp, /* print percentage */ * *------------------------------------------------------------------------- */ - static -void print_pos( int *ph, /* print header */ - int pp, /* print percentage */ - hsize_t curr_pos, - hsize_t *acc, - hsize_t *pos, - int rank, - hsize_t *dims, - const char *obj1, - const char *obj2 ) -{ +void print_pos(int *ph, /* print header */ + int pp, /* print percentage */ + hsize_t curr_pos, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, + const char *obj1, const char *obj2) { int i; /* print header */ - if ( *ph==1 ) - { - *ph=0; + if (*ph == 1) { + *ph = 0; print_header(pp, rank, dims, obj1, obj2); } /* end print header */ - for ( i = 0; i < rank; i++) - { - pos[i] = curr_pos/acc[i]; - curr_pos -= acc[i]*pos[i]; + for (i = 0; i < rank; i++) { + pos[i] = curr_pos / acc[i]; + curr_pos -= acc[i] * pos[i]; } - HDassert( curr_pos == 0 ); + HDassert(curr_pos == 0); - if ( rank > 0 ) - { - parallel_print("[ " ); - for ( i = 0; i < rank; i++) - { + if (rank > 0) { + parallel_print("[ "); + for (i = 0; i < rank; i++) { parallel_print(HSIZE_T_FORMAT, (unsigned long long)pos[i]); parallel_print(" "); } - parallel_print("]" ); + parallel_print("]"); } - else - { - parallel_print(" "); + else { + parallel_print(" "); } } @@ -5913,52 +4588,38 @@ void print_pos( int *ph, /* print header */ * *------------------------------------------------------------------------- */ - static -void print_char_pos( int *ph, /* print header */ - int pp, /* print percentage */ - hsize_t curr_pos, - size_t u, - hsize_t *acc, - hsize_t *pos, - int rank, - hsize_t *dims, - const char *obj1, - const char *obj2 ) -{ +void print_char_pos(int *ph, /* print header */ + int pp, /* print percentage */ + hsize_t curr_pos, size_t u, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, + const char *obj1, const char *obj2) { int i; /* print header */ - if ( *ph==1 ) - { - *ph=0; + if (*ph == 1) { + *ph = 0; print_header(pp, rank, dims, obj1, obj2); } /* end print header */ - for ( i = 0; i < rank; i++) - { - pos[i] = curr_pos/acc[i]; - curr_pos -= acc[i]*pos[i]; + for (i = 0; i < rank; i++) { + pos[i] = curr_pos / acc[i]; + curr_pos -= acc[i] * pos[i]; } - HDassert( curr_pos == 0 ); + HDassert(curr_pos == 0); - parallel_print("[ " ); - if ( rank > 0 ) - { - - for ( i = 0; i < rank; i++) - { + parallel_print("[ "); + if (rank > 0) { + for (i = 0; i < rank; i++) { parallel_print(HSIZE_T_FORMAT, (unsigned long long)pos[i]); parallel_print(" "); } } - else - { + else { parallel_print("%zu", u); } - parallel_print("]" ); + parallel_print("]"); } /*------------------------------------------------------------------------- @@ -5968,16 +4629,13 @@ void print_char_pos( int *ph, /* print header */ * *------------------------------------------------------------------------- */ -static void h5diff_print_char(char ch) -{ - - switch (ch) - { +static void h5diff_print_char(char ch) { + switch (ch) { case '"': parallel_print("\\\""); break; case '\\': - parallel_print( "\\\\"); + parallel_print("\\\\"); break; case '\b': parallel_print("\\b"); @@ -5996,60 +4654,53 @@ static void h5diff_print_char(char ch) break; default: if (isprint(ch)) - parallel_print( "%c", ch); + parallel_print("%c", ch); else - parallel_print( "\\%03o", ch); - + parallel_print("\\%03o", ch); break; } } - /*------------------------------------------------------------------------- * XCAO, 11/10/2010 * added to improve performance for compound datasets * set up compound datatype structures. */ -static void get_member_types(hid_t tid, mcomp_t *members) -{ +static void get_member_types(hid_t tid, mcomp_t *members) { int tclass; unsigned u; - if (tid <=0 || !members) + if (tid <= 0 || !members) return; tclass = H5Tget_class(tid); - if (tclass == H5T_ARRAY || tclass == H5T_VLEN) - { + if (tclass == H5T_ARRAY || tclass == H5T_VLEN) { hid_t base_tid = H5Tget_super(tid); get_member_types(base_tid, members); H5Tclose(base_tid); } - else if (tclass == H5T_COMPOUND) - { - int nmembs; + else if (tclass == H5T_COMPOUND) { + int nmembs; nmembs = H5Tget_nmembers(tid); - if(nmembs <= 0) + if (nmembs <= 0) return; - members->n = (unsigned)nmembs; - - members->ids = (hid_t *)HDcalloc((size_t)members->n, sizeof(hid_t)); - members->offsets = (size_t *)HDcalloc((size_t)members->n, sizeof(size_t)); - members->m = (mcomp_t **)HDcalloc((size_t)members->n, sizeof(mcomp_t *)); - - for(u = 0; u < members->n; u++) - { - members->ids[u] = H5Tget_member_type( tid, u ); - members->offsets[u] = H5Tget_member_offset( tid, u ); - members->m[u] = (mcomp_t *)HDmalloc(sizeof(mcomp_t)); - HDmemset(members->m[u], 0, sizeof(mcomp_t)); - get_member_types(members->ids[u], members->m[u]); + members->n = (unsigned) nmembs; + + members->ids = (hid_t *) HDcalloc((size_t )members->n, sizeof(hid_t)); + members->offsets = (size_t *) HDcalloc((size_t )members->n, sizeof(size_t)); + members->m = (mcomp_t **) HDcalloc((size_t )members->n, sizeof(mcomp_t *)); + + for (u = 0; u < members->n; u++) { + members->ids[u] = H5Tget_member_type(tid, u); + members->offsets[u] = H5Tget_member_offset(tid, u); + members->m[u] = (mcomp_t *) HDmalloc(sizeof(mcomp_t)); + HDmemset(members->m[u], 0, sizeof(mcomp_t)); + get_member_types(members->ids[u], members->m[u]); } } - return; - + return; } @@ -6058,17 +4709,14 @@ static void get_member_types(hid_t tid, mcomp_t *members) * added to improve performance for compound datasets * clean and close compound members. */ -static void close_member_types(mcomp_t *members) -{ +static void close_member_types(mcomp_t *members) { unsigned u; - if (!members || members->n<=0 || !members->ids) + if (!members || members->n <= 0 || !members->ids) return; - for(u = 0; u < members->n; u++) - { - if(members->m[u]) - { + for (u = 0; u < members->n; u++) { + if (members->m[u]) { close_member_types(members->m[u]); HDfree(members->m[u]); } -- cgit v0.12 From 33812aee4c55a406b4e41a06a5ae42a96fa72aa5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 11 Sep 2017 12:44:00 -0500 Subject: Fix merge typos --- tools/lib/h5diff_array.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 68a9575..32ce3db 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -1515,7 +1515,7 @@ static hsize_t diff_datum( } else if (per > options->percent && (double) ABS(temp1_float - temp2_float) > options->delta) { if (print_data(options)) { - print_pos(ph, 1, index, acc, pos, rank, dims, obj1, + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); @@ -2762,7 +2762,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, if (print_data(options)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - emp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; @@ -3196,7 +3196,7 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, if (ABS(temp1_short-temp2_short) > options->delta) { if (print_data(options)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims obj1, obj2); + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } -- cgit v0.12 From 67c91dcd41ceade7902f7002bb9bfe9710d3e5ff Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Sep 2017 09:22:03 -0500 Subject: Generate headers for 1.10 should default off --- CMakeLists.txt | 4 ++-- config/cmake/cacheinit.cmake | 4 +++- release_docs/INSTALL_CMake.txt | 3 +-- src/CMakeLists.txt | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b84cc7c..bcc8e07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -851,8 +851,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for option (SKIP_HDF5_FORTRAN_SHARED "Do not build the fortran shared libraries" OFF) if (HDF5_BUILD_FORTRAN) if (BUILD_SHARED_LIBS AND APPLE) - # Tell cmake to do the right thing with COMMON symbols, this fixes - # corrupt values with COMMON and EQUIVALENCE when building shared + # Tell cmake to do the right thing with COMMON symbols, this fixes + # corrupt values with COMMON and EQUIVALENCE when building shared # Fortran libraries on OSX with gnu and Intel compilers (HDFFV-2772). # *** NOTE: Fix does not work with Cmake. *** # set (HDF5_LINKER_FLAGS "-Wl,-commons,use_dylibs") diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 6a66c8a..98b55b6 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -17,11 +17,13 @@ set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) +set (HDF5_GENERATE_HEADERS ON CACHE BOOL "Rebuild Generated Files" FORCE) + set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) -set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) +set (HDF5_BUILD_GENERATORS ON CACHE BOOL "Build Test Generators" FORCE) set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 9c0c91e..27c7dd0 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -398,7 +398,6 @@ These five steps are described in detail below. set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) - set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) @@ -591,7 +590,7 @@ HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF HDF5_ENABLE_TRACE "Enable API tracing capability" OFF HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF -HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON +HDF5_GENERATE_HEADERS "Rebuild Generated Files" OFF HDF5_JAVA_PACK_JRE "Package a JRE installer directory" OFF HDF5_MEMORY_ALLOC_SANITY_CHECK "Indicate that internal memory allocation sanity checks are enabled" OFF HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 96ea589..6ba72d7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -819,7 +819,7 @@ set (H5_GENERATED_HEADERS ${HDF5_SRC_DIR}/H5overflow.h ) -option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON) +option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" OFF) if (HDF5_GENERATE_HEADERS) set_source_files_properties(${H5_GENERATED_HEADERS} PROPERTIES GENERATED TRUE) find_package (Perl) -- cgit v0.12 From cc2a1e085b983a10c373687504d67a361e45af84 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Sep 2017 09:24:37 -0500 Subject: Test program generation should default off --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bcc8e07..9b54015 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -575,6 +575,9 @@ if (MAKE_SYSTEM) set (CFG_INIT "") endif () +# Do not generate test programs by default +option (HDF5_BUILD_GENERATORS "Build Test Generators" OFF) + #----------------------------------------------------------------------------- # Add some definitions for Debug Builds #----------------------------------------------------------------------------- -- cgit v0.12 From c7b27a76749fa0c299fd33299ac59b36348ada5f Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 12 Sep 2017 14:46:06 -0500 Subject: New overloaded functions and tests Description: - Added VarLenType::VarLenType(const DataType& base_type) - Marked VarLenType::VarLenType(const DataType* base_type) deprecated - Added a static wrapper for H5Tdetect_class for PredType static bool DataType::detectClass(const PredType& pred_type, ...) - Removed the deprecated function Exception::printError() from code - Miscellaneous improvements in comments - Added test functions test_detect_type_class() and test_vltype() Platforms tested: Linux/32 2.6 (jam) Linux/64 (jelly) Darwin (osx1010test) --- c++/src/H5AbstractDs.h | 2 +- c++/src/H5CommonFG.h | 14 ++- c++/src/H5CompType.cpp | 1 - c++/src/H5DataType.cpp | 22 ++++ c++/src/H5DataType.h | 1 + c++/src/H5DcreatProp.h | 1 + c++/src/H5DxferProp.h | 2 +- c++/src/H5Exception.cpp | 9 +- c++/src/H5Exception.h | 4 +- c++/src/H5IdComponent.cpp | 6 +- c++/src/H5Location.cpp | 67 ++++++----- c++/src/H5Location.h | 6 +- c++/src/H5Object.cpp | 2 +- c++/src/H5Object.h | 8 +- c++/src/H5PropList.h | 1 - c++/src/H5VarLenType.cpp | 23 +++- c++/src/H5VarLenType.h | 3 + c++/test/titerate.cpp | 77 ++++--------- c++/test/ttypes.cpp | 276 ++++++++++++++++++++++++++++++++++++++++++++++ 19 files changed, 416 insertions(+), 109 deletions(-) diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index 73a18b8..16bef66 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -31,7 +31,7 @@ class DataSpace; and DataSet. It provides a collection of services that are common to both Attribute - and DataSet. AbstractDs inherits from H5Object. + and DataSet. */ class H5_DLLCPP AbstractDs { public: diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 3cbad76..68e3f19 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -24,10 +24,9 @@ class ArrayType; class VarLenType; /*! \class CommonFG - \brief \a CommonFG is an abstract base class of H5File and H5Group. - - It provides common operations of H5File and H5Group. + \brief \a CommonFG is an abstract base class of H5Group. */ +/* Note: This class is being deprecated gradually. */ class H5_DLLCPP CommonFG { public: // Opens a generic named datatype in this location. @@ -87,3 +86,12 @@ class H5_DLLCPP CommonFG { #endif // __CommonFG_H +/*************************************************************************** + Design Note + =========== + +September 2017: + + This class used to be base class of H5File as well, until the + restructure that moved H5File to be subclass of H5Group. +*/ diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index da7e3e2..d357fbc 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -216,7 +216,6 @@ int CompType::getMemberIndex(const H5std_string& name) const /// respect to the beginning of the compound data type datum. ///\param member_num - IN: Zero-based index of the member ///\return Byte offset -///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 // Description /// Members are stored in no particular order with numbers 0 diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 28a670e..90211b9 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -797,6 +797,28 @@ bool DataType::detectClass(H5T_class_t cls) const } //-------------------------------------------------------------------------- +// Function: DataType::detectClass (static) +///\brief Checks whether a predtype is a certain class of datatype. +///\return true if this predtype is the specified type class, and false, +/// otherwise. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - August, 2017 +//-------------------------------------------------------------------------- +bool DataType::detectClass(const PredType& pred_type, H5T_class_t cls) +{ + htri_t ret_value = H5Tdetect_class(pred_type.getId(), cls); + if (ret_value > 0) + return true; + else if (ret_value == 0) + return false; + else + { + throw DataTypeIException("detectClass on PredType", + "H5Tdetect_class returns negative value"); + } +} + +//-------------------------------------------------------------------------- // Function: DataType::isVariableStr ///\brief Check whether this datatype is a variable-length string. ///\return true if this datatype is a variable-length string, and diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 50d2fc1..6833a06 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -114,6 +114,7 @@ class H5_DLLCPP DataType : public H5Object { // Checks whether this datatype contains (or is) a certain type class. bool detectClass(H5T_class_t cls) const; + static bool detectClass(const PredType& pred_type, H5T_class_t cls); // Checks whether this datatype is a variable-length string. bool isVariableStr() const; diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 5d5714a..ebd2678 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -17,6 +17,7 @@ namespace H5 { +// Class forwarding class DataType; class DataSpace; diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 4a38bd0..4a66671 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -21,7 +21,7 @@ namespace H5 { \brief Class DSetCreatPropList inherits from PropList and provides wrappers for the HDF5 dataset memory and transfer property list. - Inheritance: ObjCreatPropList -> PropList -> IdComponent + Inheritance: PropList -> IdComponent */ class H5_DLLCPP DSetMemXferPropList : public PropList { public: diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index c9a1323..c52a279 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -317,11 +317,12 @@ void Exception::printErrorStack(FILE* stream, hid_t err_stack) // This function can be removed in next major release. // -BMR, 2014/04/24 // Removed from documentation. -BMR, 2016/03/23 +// Removed from code. -BMR, 2017/08/11 1.8.20 and 1.10.2 //-------------------------------------------------------------------------- -void Exception::printError(FILE* stream) const -{ - Exception::printErrorStack(stream, H5E_DEFAULT); -} +//void Exception::printError(FILE* stream) const +//{ +// Exception::printErrorStack(stream, H5E_DEFAULT); +//} //-------------------------------------------------------------------------- // Function: Exception destructor diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 2cc2dd6..cb14a4c 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -70,7 +70,9 @@ class H5_DLLCPP Exception { // Prints the error stack in a default manner. static void printErrorStack(FILE* stream = stderr, hid_t err_stack = H5E_DEFAULT); - virtual void printError(FILE* stream = NULL) const; + // Deprecated in favor of printErrorStack. + // Removed from code. -BMR, 2017/08/11 1.8.20 and 1.10.2 + // virtual void printError(FILE* stream = NULL) const; // Default constructor Exception(); diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 284c6c5..fe2d27e 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -368,8 +368,10 @@ IdComponent::IdComponent() // Exception: H5::IdComponentException // Description: // This function is protected so that the user applications can -// only have access to its code via allowable classes, namely, -// Attribute and H5Location subclasses. +// only have access to its code via H5Location subclasses. +// September 2017 +// This function should be moved to H5Location now that Attribute +// inherits from H5Location. // Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- H5std_string IdComponent::p_get_file_name() const diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 9f2d7d5..35a4828 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -93,7 +93,7 @@ bool H5Location::exists(const char* name, const LinkAccPropList& lapl) const return false; else // Raise exception when H5Lexists returns a negative value { - throwException("exists", "H5Lexists failed"); + throw LocationException(inMemFunc("exists"), "H5Lexists failed"); } } @@ -118,7 +118,7 @@ bool H5Location::exists(const H5std_string& name, const LinkAccPropList& lapl) c /// which can be either of these values: /// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file /// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file -///\exception H5::Exception +///\exception H5::LocationException ///\par Description /// This location is used to identify the file to be flushed. // Programmer Binh-Minh Ribler - 2012 @@ -147,8 +147,8 @@ H5std_string H5Location::getFileName() const try { return(p_get_file_name()); } - catch (LocationException& E) { - throw FileIException(inMemFunc("getFileName"), E.getDetailMsg()); + catch (IdComponentException& E) { + throw LocationException(inMemFunc("getFileName"), E.getDetailMsg()); } } @@ -495,7 +495,7 @@ hid_t H5Location::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_ty hid_t temp_id = H5Rdereference2(loc_id, plist_id, ref_type, ref); if (temp_id < 0) { - throw ReferenceException(inMemFunc(from_func), "H5Rdereference failed"); + throw ReferenceException(inMemFunc(from_func), "H5Rdereference2 failed"); } return(temp_id); @@ -557,7 +557,7 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t /// \li \c H5G_TYPE Object - is a named datatype /// \li \c H5G_LINK - Object is a symbolic link. /// \li \c H5G_UDLINK - Object is a user-defined link. -///\exception H5::ReferenceException +///\exception H5::LocationException // Programmer Binh-Minh Ribler - May, 2004 // Modification // Sep 2012: Moved up from H5File, Group, DataSet, and DataType @@ -717,19 +717,21 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const // ***Updated: after HDFFV-9920, methods in classes H5Location and Group // use throwException to distinguish the FileIException and GroupIException. // CommonFG is no longer used in the library. Aug 18, 2016 -BMR +// H5Location::throwException is changed to throw LocationException for any +// subclass that is not H5File or Group. Aug 14, 2017 -BMR // ***Note: following the changes in HDFFV-9920, some of the methods could // throw different exceptions, but for backward-compatibility, throwException // is kept in those methods as well. Sep 17, 2016 -BMR +// //-------------------------------------------------------------------------- // Function: H5Location::createGroup -///\brief Creates a new group at this location which can be a file -/// or another group. +///\brief Creates a new group at this location. ///\param name - IN: Name of the group to create ///\param size_hint - IN: Indicates the number of bytes to reserve for /// the names that will appear in the group ///\return Group instance -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException ///\par Description /// The optional \a size_hint specifies how much file space to /// reserve for storing the names that will appear in this new @@ -793,7 +795,7 @@ Group H5Location::createGroup(const H5std_string& name, size_t size_hint) const /// or another group. ///\param name - IN: Name of the group to open ///\return Group instance -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group H5Location::openGroup(const char* name) const @@ -834,7 +836,7 @@ Group H5Location::openGroup(const H5std_string& name) const ///\param data_space - IN: Dataspace for the dataset ///\param create_plist - IN: Creation properly list for the dataset ///\return DataSet instance -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet H5Location::createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist) const @@ -874,7 +876,7 @@ DataSet H5Location::createDataSet(const H5std_string& name, const DataType& data ///\brief Opens an existing dataset at this location. ///\param name - IN: Name of the dataset to open ///\return DataSet instance -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet H5Location::openDataSet(const char* name) const @@ -915,7 +917,7 @@ DataSet H5Location::openDataSet(const H5std_string& name) const ///\param curr_name - IN: Name of the existing object if link is a hard /// link; can be anything for the soft link ///\param new_name - IN: New name for the object -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException ///\par Description /// Note that both names are interpreted relative to the /// specified location. @@ -968,7 +970,7 @@ void H5Location::link(H5L_type_t link_type, const H5std_string& curr_name, const // Function: H5Location::unlink ///\brief Removes the specified name at this location. ///\param name - IN: Name of the object to be removed -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException // Programmer Binh-Minh Ribler - 2000 // Modification // 2007: QAK modified to use H5L APIs - BMR @@ -997,7 +999,7 @@ void H5Location::unlink(const H5std_string& name) const ///\brief Renames an object at this location. ///\param src - IN: Object's original name ///\param dst - IN: Object's new name -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException ///\note /// Exercise care in moving groups as it is possible to render /// data in a file inaccessible with H5Location::move. Please refer @@ -1033,7 +1035,7 @@ void H5Location::move(const H5std_string& src, const H5std_string& dst) const ///\param name - IN: Name of the object ///\param follow_link - IN: Link flag ///\param statbuf - OUT: Buffer to return information about the object -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: @@ -1093,7 +1095,7 @@ void H5Location::getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const ///\param name - IN: Symbolic link to the object ///\param size - IN: Maximum number of characters of value to be returned ///\return Name of the object -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string H5Location::getLinkval(const char* name, size_t size) const @@ -1219,7 +1221,7 @@ void H5Location::mount(const H5std_string& name, const H5File& child, const Prop // Function: H5Location::unmount ///\brief Unmounts the specified file. ///\param name - IN: Name of the file to unmount -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Location::unmount(const char* name) const @@ -1255,7 +1257,7 @@ void H5Location::unmount(const H5std_string& name) const ///\return The return value of the first operator that returns non-zero, /// or zero if all members were processed with no operator /// returning non-zero. -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int H5Location::iterateElems(const char* name, int *idx, H5G_iterate_t op , void* op_data) @@ -1304,7 +1306,7 @@ hsize_t H5Location::getNumObjs() const /// object's index. ///\param idx - IN: Transient index of the object ///\return Object name -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException ///\par Description /// The value of idx can be any nonnegative number less than the /// total number of objects in the group, which is returned by @@ -1346,7 +1348,7 @@ H5std_string H5Location::getObjnameByIdx(hsize_t idx) const ///\param name - IN/OUT: Retrieved name of the object ///\param size - IN: Length to retrieve ///\return Actual size of the object name or 0, if object has no name -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException ///\par Description /// The value of idx can be any nonnegative number less than the /// total number of objects in the group, which is returned by @@ -1402,7 +1404,7 @@ ssize_t H5Location::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size /// \li \c H5O_TYPE_NAMED_DATATYPE /// Refer to the C API documentation for more details: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException /// Exception will be thrown when: /// - an error returned by the C API /// - object type is not one of the valid values above @@ -1443,7 +1445,7 @@ H5O_type_t H5Location::childObjType(const char* objname) const ///\brief Returns the type of an object in this group, given the /// object's name. ///\param objname - IN: Name of the object (H5std_string&) -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException // Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- H5O_type_t H5Location::childObjType(const H5std_string& objname) const @@ -1468,7 +1470,7 @@ H5O_type_t H5Location::childObjType(const H5std_string& objname) const /// \li \c H5O_TYPE_NAMED_DATATYPE /// Refer to the C API documentation for more details: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException /// Exception will be thrown when: /// - an error returned by the C API /// - object type is not one of the valid values above @@ -1519,7 +1521,7 @@ H5O_type_t H5Location::childObjType(hsize_t index, H5_index_t index_type, H5_ite ///\return Object version, which can have the following values: /// \li \c H5O_VERSION_1 /// \li \c H5O_VERSION_2 -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException /// Exception will be thrown when: /// - an error returned by the C API /// - version number is not one of the valid values above @@ -1553,7 +1555,7 @@ unsigned H5Location::childObjVersion(const char* objname) const ///\brief Returns the type of an object in this group, given the /// object's name. ///\param objname - IN: Name of the object (H5std_string&) -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException // Programmer Binh-Minh Ribler - April, 2014 //-------------------------------------------------------------------------- unsigned H5Location::childObjVersion(const H5std_string& objname) const @@ -1571,7 +1573,7 @@ unsigned H5Location::childObjVersion(const H5std_string& objname) const /// object's index. ///\param idx - IN: Transient index of the object ///\return Object type -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException // Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx) const @@ -1591,7 +1593,7 @@ H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx) const ///\param idx - IN: Transient index of the object ///\param type_name - OUT: Object type in text ///\return Object type -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException // Programmer Binh-Minh Ribler - May, 2010 // Modification // Modified to use the other function. -BMR, 2016/03/07 @@ -1609,7 +1611,7 @@ H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, char* type_name) const ///\param idx - IN: Transient index of the object ///\param type_name - OUT: Object type in text ///\return Object type -///\exception H5::FileIException or H5::GroupIException +///\exception H5::FileIException/H5::GroupIException/H5::LocationException // Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const @@ -1642,10 +1644,15 @@ H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) cons ///\param msg - Message describing the failure ///\exception H5::GroupIException // Programmer Binh-Minh Ribler - 2000 +// Modification +// August 2017 - BMR +// Keep Group::throwException and H5File::throwException to +// maintain backward compatibility. For other subclasses, throw +// LocationException. //-------------------------------------------------------------------------- void H5Location::throwException(const H5std_string& func_name, const H5std_string& msg) const { - throwException(func_name, msg); + throw LocationException(inMemFunc(func_name.c_str()), msg); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 3dfa5d5..f9c5a47 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -30,9 +30,9 @@ namespace H5 { Inheritance: IdComponent */ // Class forwarding -class H5_DLLCPP ArrayType; -class H5_DLLCPP LinkAccPropList; -class H5_DLLCPP VarLenType; +//class H5_DLLCPP ArrayType; +//class H5_DLLCPP LinkAccPropList; +//class H5_DLLCPP VarLenType; class H5_DLLCPP H5Location : public IdComponent { public: // Checks if a link of a given name exists in a location diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 81e61e8..3eed168 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -391,7 +391,6 @@ void H5Object::renameAttr(const H5std_string& oldname, const H5std_string& newna renameAttr (oldname.c_str(), newname.c_str()); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: getObjName ///\brief Given an id, returns the type of the object. @@ -503,6 +502,7 @@ ssize_t H5Object::getObjName(H5std_string& obj_name, size_t len) const return(name_size); } +#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5Object destructor ///\brief Noop destructor. diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index fdaead2..ba32b3e 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -39,9 +39,6 @@ namespace H5 { Inheritance: H5Location -> IdComponent */ -// Class forwarding -class H5_DLLCPP H5Object; -class H5_DLLCPP Attribute; // Define the operator function pointer for H5Aiterate(). typedef void (*attr_operator_t)(H5Object& loc/*in*/, @@ -96,13 +93,14 @@ class H5_DLLCPP H5Object : public H5Location { // Returns an identifier. virtual hid_t getId() const = 0; -#ifndef DOXYGEN_SHOULD_SKIP_THIS // Gets the name of this HDF5 object, i.e., Group, DataSet, or - // DataType. These should have const but are retiring anyway. + // DataType. ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; ssize_t getObjName(H5std_string& obj_name, size_t len = 0) const; H5std_string getObjName() const; +#ifndef DOXYGEN_SHOULD_SKIP_THIS + protected: // Default constructor H5Object(); diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 154d7b2..e1fe5b8 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -17,7 +17,6 @@ namespace H5 { -//! Class PropList provides operations for generic property lists. /*! \class PropList \brief Class PropList inherits from IdComponent and provides wrappers for the HDF5 generic property list. diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index b5ca9c4..5b29682 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -51,13 +51,14 @@ VarLenType::VarLenType(const VarLenType& original) : DataType(original) {} //-------------------------------------------------------------------------- // Function: VarLenType overloaded constructor -///\brief Creates a new variable-length datatype based on the specified -/// \a base_type. +///\brief Deprecated - will be removed after 1.10.2 ///\param base_type - IN: Pointer to existing datatype ///\exception H5::DataTypeIException // Description // DataType passed by pointer to avoid clashing with copy // constructor. +// Updated: this is unnecessary. +// -BMR, Sep, 2017 // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- VarLenType::VarLenType(const DataType* base_type) : DataType() @@ -72,6 +73,24 @@ VarLenType::VarLenType(const DataType* base_type) : DataType() //-------------------------------------------------------------------------- // Function: VarLenType overloaded constructor +///\brief Creates a new variable-length datatype based on the specified +/// \a base_type. +///\param base_type - IN: An existing datatype +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - May, 2004 +//-------------------------------------------------------------------------- +VarLenType::VarLenType(const DataType& base_type) : DataType() +{ + id = H5Tvlen_create(base_type.getId()); + if (id < 0) + { + throw DataTypeIException("VarLenType constructor", + "H5Tvlen_create returns negative value"); + } +} + +//-------------------------------------------------------------------------- +// Function: VarLenType overloaded constructor ///\brief Creates an VarLenType instance by opening an HDF5 variable /// length datatype given its name, provided as a C char*. ///\param loc - IN: Location of the type diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index 17d812f..2524cf8 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -27,6 +27,9 @@ class H5_DLLCPP VarLenType : public DataType { public: // Constructor that creates a variable-length datatype based // on the specified base type. + VarLenType(const DataType& base_type); + + // Deprecated - will be removed after 1.10.2 VarLenType(const DataType* base_type); // Returns an VarLenType object via DataType* by decoding the diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index f75d92e..5c760f3 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -12,8 +12,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** - FILE - titerate.cpp - HDF5 C++ testing iterate related functionality + FILE + titerate.cpp - HDF5 C++ testing iterate related functionality ***************************************************************************/ #ifdef OLD_HEADER_FILENAME @@ -94,8 +94,7 @@ int iter_strcmp(const void *s1, const void *s2) ** ****************************************************************/ static herr_t -liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_info, - void *op_data) +liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_info, void *op_data) { iter_info *info = (iter_info *)op_data; static int count = 0; @@ -208,7 +207,7 @@ static void test_iter_group(FileAccPropList& fapl) H5std_string obj_name; for (i = 0; i < nobjs; i++) { - //H5O_info_t oinfo; /* Object info */ + //H5O_info_t oinfo; /* Object info */ obj_name = root_group.getObjnameByIdx(i); //ret = (herr_t)H5Lget_name_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, dataset_name, (size_t)NAMELEN, H5P_DEFAULT); @@ -380,23 +379,11 @@ void printelems(const Group& group, const H5std_string& dsname, const H5std_stri a1.close(); } - // catch failure caused by the DataSpace operations - catch( DataSpaceIException error ) - { - error.printError(); - } - - // catch failure caused by the Group operations - catch( GroupIException error ) - { - error.printError(); - } - - // catch failure caused by the DataSet operations - catch( DataSetIException error ) - { - error.printError(); - } + // Catch all exceptions and rethrow so caller can handle + catch (Exception& E) + { + throw; + } } /*------------------------------------------------------------------------- @@ -413,11 +400,11 @@ void printelems(const Group& group, const H5std_string& dsname, const H5std_stri */ static void test_HDFFV_9920() { - int attr_data[2] = { 100, 200}; - hsize_t dims[1] = { DIM1 }; - - try - { + int attr_data[2] = { 100, 200}; + hsize_t dims[1] = { DIM1 }; + + try + { // Create a new file and a group in it H5File file( FILE_NAME, H5F_ACC_TRUNC ); @@ -448,31 +435,13 @@ static void test_HDFFV_9920() printelems(file, FDATASET_NAME, FATTR_NAME); printelems(gr1, GDATASET_NAME, GATTR_NAME); - } // end of try block - - // catch failure caused by the H5File operations - catch( DataSpaceIException error ) - { - error.printError(); - } - - // catch failure caused by the H5File operations - catch( AttributeIException error ) - { - error.printError(); - } - - // catch failure caused by the H5File operations - catch( FileIException error ) - { - error.printError(); - } - - // catch failure caused by the DataSet operations - catch( DataSetIException error ) - { - error.printError(); - } + } // end of try block + + // Catch all failures for handling in the same way + catch (Exception& E) + { + issue_fail_msg("test_HDFFV_9920()", __LINE__, __FILE__, E.getCDetailMsg()); + } } @@ -503,9 +472,9 @@ void test_iterate() test_iter_group(fapl); // Test iterating groups test_HDFFV_9920(); // Test the fix of HDFFV-9920 - //test_iter_attr(fapl); // Test iterating attributes + //test_iter_attr(fapl); // Test iterating attributes -} // test_iterate +} // test_iterate /*------------------------------------------------------------------------- * Function: cleanup_iterate diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index ec644a8..3cf0920 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -60,6 +60,7 @@ const char *FILENAME[] = { "dtypes1.h5", "dtypes2.h5", "dtypes3.h5", + "dtypes4.h5", NULL }; @@ -183,6 +184,279 @@ static void test_copy() /*------------------------------------------------------------------------- + * Function: test_detect_type_class + * + * Purpose Test DataType::detectClass() + * + * Return None + * + * Programmer Binh-Minh Ribler (using C version) + * August, 2017 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +typedef struct { /* Struct with atomic fields */ + int i; + float f; + char c; + double d; + short s; +} atomic_typ_t; + +typedef struct { /* Struct with complex fields */ + hobj_ref_t arr_r[3][3]; + int i; + hvl_t vl_f; + hvl_t vl_s; + char c; + short s; +} complex_typ_t; + +static void test_detect_type_class() +{ + + SUBTEST("DataType::detectClass()"); + try { + bool in_class = false; // indicates whether a datatype is in a class + + /* + * Test class of some atomic types. + */ + + // Native integers should be in the integer class + in_class = DataType::detectClass(PredType::NATIVE_INT, H5T_INTEGER); + verify_val(in_class, true, "DataType::detectClass() with H5T_INTEGER", __LINE__, __FILE__); + + // Native integers should _not_ be in other classes + in_class = DataType::detectClass(PredType::NATIVE_INT, H5T_FLOAT); + verify_val(in_class, false, "DataType::detectClass() with H5T_FLOAT", __LINE__, __FILE__); + in_class = DataType::detectClass(PredType::NATIVE_INT, H5T_ARRAY); + verify_val(in_class, false, "DataType::detectClass() with H5T_ARRAY", __LINE__, __FILE__); + in_class = DataType::detectClass(PredType::NATIVE_INT, H5T_ENUM); + verify_val(in_class, false, "DataType::detectClass() with H5T_ENUM", __LINE__, __FILE__); + + /* + * Test class of a compound type with some atomic types as fields. + */ + + // Create a compound datatype and insert some atomic types + CompType atom_cmpd(sizeof(atomic_typ_t)); + atom_cmpd.insertMember("i", HOFFSET(atomic_typ_t, i), PredType::NATIVE_INT); + atom_cmpd.insertMember("f", HOFFSET(atomic_typ_t, f), PredType::NATIVE_FLOAT); + atom_cmpd.insertMember("c", HOFFSET(atomic_typ_t, c), PredType::NATIVE_CHAR); + atom_cmpd.insertMember("d", HOFFSET(atomic_typ_t, d), PredType::NATIVE_DOUBLE); + atom_cmpd.insertMember("s", HOFFSET(atomic_typ_t, s), PredType::NATIVE_SHORT); + + // Make certain that atom_cmpd is a compound type, + in_class = atom_cmpd.detectClass(H5T_COMPOUND); + verify_val(in_class, true, "CompType::detectClass() with H5T_COMPOUND", __LINE__, __FILE__); + // and that it contains a field of type integer + in_class = atom_cmpd.detectClass(H5T_INTEGER); + verify_val(in_class, true, "CompType::detectClass() with H5T_INTEGER", __LINE__, __FILE__); + // and a field of type float, + in_class = atom_cmpd.detectClass(H5T_FLOAT); + verify_val(in_class, true, "CompType::detectClass() with H5T_FLOAT", __LINE__, __FILE__); + // and that it doesn't contain any field of variable-length + in_class = atom_cmpd.detectClass(H5T_VLEN); + verify_val(in_class, false, "CompType::detectClass() with H5T_VLEN", __LINE__, __FILE__); + + /* + * Test class of array datatype + */ + + // Create an array datatype with an atomic base type + unsigned rank = 2; // Rank for array datatype + hsize_t dims[2] = {3,3}; // Dimensions for array datatype + ArrayType atom_arr(PredType::STD_REF_OBJ, rank, dims); + + // Make certain that the correct classes can be detected + in_class = atom_arr.detectClass(H5T_ARRAY); + verify_val(in_class, true, "CompType::detectClass() with H5T_ARRAY", __LINE__, __FILE__); + in_class = atom_arr.detectClass(H5T_REFERENCE); + verify_val(in_class, true, "CompType::detectClass() with H5T_REFERENCE", __LINE__, __FILE__); + + // Make certain that an incorrect class is not detected + in_class = atom_arr.detectClass(H5T_VLEN); + verify_val(in_class, false, "CompType::detectClass() with H5T_VLEN", __LINE__, __FILE__); + in_class = atom_arr.detectClass(H5T_FLOAT); + verify_val(in_class, false, "CompType::detectClass() with H5T_FLOAT", __LINE__, __FILE__); + in_class = atom_arr.detectClass(H5T_INTEGER); + verify_val(in_class, false, "CompType::detectClass() with H5T_INTEGER", __LINE__, __FILE__); + + /* + * Test class of VL datatype + */ + + // Create a VL datatype with an atomic base type of float + VarLenType atom_vlf(PredType::NATIVE_FLOAT); + + // Make certain that the correct classes can be detected + in_class = atom_vlf.detectClass(H5T_VLEN); + verify_val(in_class, true, "CompType::detectClass() with H5T_VLEN", __LINE__, __FILE__); + in_class = atom_vlf.detectClass(H5T_FLOAT); + verify_val(in_class, true, "CompType::detectClass() with H5T_FLOAT", __LINE__, __FILE__); + + // Make certain that an incorrect class is not detected + in_class = atom_vlf.detectClass(H5T_COMPOUND); + verify_val(in_class, false, "CompType::detectClass() with H5T_COMPOUND", __LINE__, __FILE__); + in_class = atom_vlf.detectClass(H5T_INTEGER); + verify_val(in_class, false, "CompType::detectClass() with H5T_INTEGER", __LINE__, __FILE__); + + /* + * Test class of VL datatype + */ + + // Create a VL datatype with an atomic base type of char. It should be a VL + // but not a string class. + VarLenType atom_vlc(PredType::NATIVE_CHAR); + + // Make certain that the correct classes can be detected + in_class = atom_vlc.detectClass(H5T_VLEN); + verify_val(in_class, true, "CompType::detectClass() with H5T_VLEN", __LINE__, __FILE__); + in_class = atom_vlc.detectClass(H5T_INTEGER); + verify_val(in_class, true, "CompType::detectClass() with H5T_INTEGER", __LINE__, __FILE__); + + // Make certain that an incorrect class is not detected + in_class = atom_vlc.detectClass(H5T_STRING); + verify_val(in_class, false, "CompType::detectClass() with H5T_STRING", __LINE__, __FILE__); + + /* + * Test class of VL string datatype + */ + + // Create a VL string. It should be a string, not a VL class. + StrType atom_vls(0, H5T_VARIABLE); + + // Make certain that the correct classes can be detected + in_class = atom_vls.detectClass(H5T_STRING); + verify_val(in_class, true, "CompType::detectClass() with H5T_STRING", __LINE__, __FILE__); + + // Make certain that an incorrect class is not detected + in_class = atom_vls.detectClass(H5T_VLEN); + verify_val(in_class, false, "CompType::detectClass() with H5T_VLEN", __LINE__, __FILE__); + + /* + * Test class of a compound type with some complex types as fields. + */ + + // Create a compound datatype with complex type fields + CompType cplx_cmpd(sizeof(complex_typ_t)); + cplx_cmpd.insertMember("arr_r", HOFFSET(complex_typ_t, arr_r), atom_arr); + cplx_cmpd.insertMember("i", HOFFSET(complex_typ_t, i), PredType::NATIVE_INT); + cplx_cmpd.insertMember("vl_f", HOFFSET(complex_typ_t, vl_f), atom_vlf); + cplx_cmpd.insertMember("vl_s", HOFFSET(complex_typ_t, vl_s), atom_vls); + cplx_cmpd.insertMember("c", HOFFSET(complex_typ_t, c), PredType::NATIVE_CHAR); + cplx_cmpd.insertMember("s", HOFFSET(complex_typ_t, s), PredType::NATIVE_SHORT); + + // Make certain that the correct classes can be detected + in_class = cplx_cmpd.detectClass(H5T_COMPOUND); + verify_val(in_class, true, "CompType::detectClass() with H5T_COMPOUND", __LINE__, __FILE__); + in_class = cplx_cmpd.detectClass(H5T_ARRAY); + verify_val(in_class, true, "CompType::detectClass() with H5T_ARRAY", __LINE__, __FILE__); + in_class = cplx_cmpd.detectClass(H5T_REFERENCE); + verify_val(in_class, true, "CompType::detectClass() with H5T_REFERENCE", __LINE__, __FILE__); + in_class = cplx_cmpd.detectClass(H5T_INTEGER); + verify_val(in_class, true, "CompType::detectClass() with H5T_INTEGER", __LINE__, __FILE__); + in_class = cplx_cmpd.detectClass(H5T_FLOAT); + verify_val(in_class, true, "CompType::detectClass() with H5T_FLOAT", __LINE__, __FILE__); + in_class = cplx_cmpd.detectClass(H5T_STRING); + verify_val(in_class, true, "CompType::detectClass() with H5T_STRING", __LINE__, __FILE__); + in_class = cplx_cmpd.detectClass(H5T_VLEN); + verify_val(in_class, true, "CompType::detectClass() with H5T_VLEN", __LINE__, __FILE__); + + // Make certain that an incorrect class is not detected + in_class = cplx_cmpd.detectClass(H5T_TIME); + verify_val(in_class, false, "CompType::detectClass() with H5T_TIME", __LINE__, __FILE__); + in_class = cplx_cmpd.detectClass(H5T_ENUM); + verify_val(in_class, false, "CompType::detectClass() with H5T_ENUM", __LINE__, __FILE__); + + PASSED(); + } + catch (Exception& E) + { + issue_fail_msg("test_detect_type_class", __LINE__, __FILE__, E.getCDetailMsg()); + } +} + + +/*------------------------------------------------------------------------- + * Function: test_vltype + * + * Purpose Tests VarLenType class + * + * Return None + * + * Programmer Binh-Minh Ribler (use C version) + * August, 2017 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static void test_vltype() +{ + // Output message about test being performed + SUBTEST("VarLenType functions"); + try + { + VarLenType vltype(PredType::NATIVE_INT); + + bool in_class = vltype.detectClass(H5T_VLEN); + verify_val(in_class, true, "VarLenType::detectClass() with H5T_VLEN", __LINE__, __FILE__); + in_class = vltype.detectClass(H5T_INTEGER); + verify_val(in_class, true, "VarLenType::detectClass() with H5T_INTEGER", __LINE__, __FILE__); + + // Test copy constructor + VarLenType vltype2(vltype); + + // Verify that the copied type has a valid id + bool is_valid = IdComponent::isValid(vltype2.getId()); + verify_val(in_class, true, "isValid on vltype2", __LINE__, __FILE__); + + in_class = vltype2.detectClass(H5T_VLEN); + verify_val(in_class, true, "VarLenType::detectClass() with H5T_VLEN for vltype2", __LINE__, __FILE__); + in_class = vltype2.detectClass(H5T_INTEGER); + verify_val(in_class, true, "VarLenType::detectClass() with H5T_INTEGER for vltype2", __LINE__, __FILE__); + in_class = vltype2.detectClass(H5T_FLOAT); + verify_val(in_class, false, "VarLenType::detectClass() with H5T_FLOAT for vltype2", __LINE__, __FILE__); + + // Create a new file to use in this test + H5File file(FILENAME[3], H5F_ACC_TRUNC); + + // Create a group in the file, to hold some varlentype + Group top_group(file.createGroup("top group")); + + // Create a variable-length type + VarLenType first_vlt(PredType::NATIVE_FLOAT); + + // Commit the type to the group + first_vlt.commit(top_group, "first variable-length type"); + + // Close it + first_vlt.close(); + + // Reopen it + VarLenType first_vlt_again(top_group, "first variable-length type"); + + // Trying to detect H5T_VLEN and H5T_FLOAT classes on this type, + // should both be true + in_class = vltype2.detectClass(H5T_VLEN); + verify_val(in_class, true, "VarLenType::detectClass() with H5T_VLEN for vltype2", __LINE__, __FILE__); + in_class = first_vlt_again.detectClass(H5T_FLOAT); + verify_val(in_class, true, "VarLenType::detectClass() with H5T_FLOAT for first_vlt_again", __LINE__, __FILE__); + + PASSED(); + } // end of try block + catch (Exception& E) + { + issue_fail_msg("test_vltype", __LINE__, __FILE__, E.getCDetailMsg()); + } +} // test_vltype + + +/*------------------------------------------------------------------------- * Function: test_query * * Purpose Tests query functions of compound and enumeration types. @@ -785,6 +1059,8 @@ void test_types() // Test basic datatypes test_classes(); test_copy(); + test_detect_type_class(); + test_vltype(); test_query(); test_transient(); test_named(); -- cgit v0.12 From 05af70b235a4d06a5c441a0728ae8fca6926a72e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Sep 2017 14:57:55 -0500 Subject: Restore GEN_HDRS and remove cache sets for defaults --- CMakeFilters.cmake | 15 ++++++--------- CMakeInstallation.cmake | 2 +- CMakeLists.txt | 2 +- config/cmake/cacheinit.cmake | 38 ++------------------------------------ config/cmake/mccacheinit.cmake | 34 ++-------------------------------- release_docs/INSTALL_CMake.txt | 29 ++++++++--------------------- 6 files changed, 20 insertions(+), 100 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 9b66d95..804b16b 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -11,10 +11,10 @@ # include (ExternalProject) -#option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT SVN TGZ)" "NO") -set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)") -set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT SVN TGZ) -if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") +#option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)" "NO") +set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)") +set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) +if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") option (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1) option (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") @@ -22,9 +22,6 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT set (ZLIB_BRANCH ${ZLIB_GIT_BRANCH}) set (SZIP_URL ${SZIP_GIT_URL} CACHE STRING "Path to szip git repository") set (SZIP_BRANCH ${SZIP_GIT_BRANCH}) - elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - set (ZLIB_URL ${ZLIB_SVN_URL} CACHE STRING "Path to zlib Subversion repository") - set (SZIP_URL ${SZIP_SVN_URL} CACHE STRING "Path to szip Subversion repository") elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (NOT TGZPATH) set (TGZPATH ${HDF5_SOURCE_DIR}) @@ -61,7 +58,7 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) set (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) else () - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) set (H5_HAVE_FILTER_DEFLATE 1) set (H5_HAVE_ZLIB_H 1) @@ -111,7 +108,7 @@ if (HDF5_ENABLE_SZIP_SUPPORT) set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIRS} ${SZIP_INCLUDE_DIR}) else () - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING}) set (H5_HAVE_FILTER_SZIP 1) set (H5_HAVE_SZLIB_H 1) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 70638d6..8804964 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -478,7 +478,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut set (CPACK_INSTALL_CMAKE_PROJECTS "${HDF5_BINARY_DIR};HDF5;ALL;/") if (HDF5_PACKAGE_EXTLIBS) - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) if (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;ALL;/") diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b54015..23452cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -756,7 +756,7 @@ endif () #----------------------------------------------------------------------------- add_subdirectory (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) -if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") +if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) ADD_DEPENDENCIES (${HDF5_LIB_TARGET} ZLIB) if (BUILD_SHARED_LIBS) diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 98b55b6..d37c339 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -17,8 +17,6 @@ set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) -set (HDF5_GENERATE_HEADERS ON CACHE BOOL "Rebuild Generated Files" FORCE) - set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) @@ -31,46 +29,14 @@ set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) -set (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) - -set (ALLOW_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) - -set (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) - -set (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) - -set (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) - set (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) -set (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) - -set (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) - -set (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) - -set (HDF5_MEMORY_ALLOC_SANITY_CHECK OFF CACHE BOOL "Indicate that internal memory allocation sanity checks are enabled" FORCE) - -set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) - set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) -set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) - -set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) - -set (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) - -set (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) - set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" FORCE) -set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) - -set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) - -set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT SVN TGZ)" FORCE) -set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT SVN TGZ) +set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) +set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 3f0dd4f..577144b 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -33,50 +33,20 @@ set (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) set (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) -set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) - set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) -set (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) - -set (ALLOW_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) - -set (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) - -set (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) - -set (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) - set (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) -set (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) - -set (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) - set (HDF5_ENABLE_USING_MEMCHECKER ON CACHE BOOL "Indicate that a memory checker is used" FORCE) -set (HDF5_MEMORY_ALLOC_SANITY_CHECK OFF CACHE BOOL "Indicate that internal memory allocation sanity checks are enabled" FORCE) - -set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) - -set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) - -set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) - -set (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) - -set (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) - -set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) - set (HDF5_NO_PACKAGES ON CACHE BOOL "CPACK - Disable packaging" FORCE) -set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT SVN TGZ)" FORCE) -set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT SVN TGZ) +set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) +set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 27c7dd0..26750b5 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -261,7 +261,7 @@ IV. Further considerations -DSZIP_INCLUDE_DIR:PATH=some_location/include where "some_location" is the full path to the extlibs folder. - B. Use source packages from an SVN server by adding the following CMake + B. Use source packages from an GIT server by adding the following CMake options: HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="GIT" ZLIB_GIT_URL:STRING="http://some_location/zlib" @@ -397,31 +397,16 @@ These five steps are described in detail below. ######################## set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) + set (HDF5_GENERATE_HEADERS ON CACHE BOOL "Rebuild Generated Files" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) - set (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) - set (ALLOW_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) - set (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) - set (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) - set (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) set (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) - set (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) - set (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) - set (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) - set (HDF5_MEMORY_ALLOC_SANITY_CHECK OFF CACHE BOOL "Indicate that internal memory allocation sanity checks are enabled" FORCE) - set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) - set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) - set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) - set (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) - set (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" FORCE) - set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) - set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) - set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT SVN TGZ)" FORCE) - set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT SVN TGZ) + set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) + set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) @@ -578,6 +563,7 @@ HDF5_BUILD_TOOLS "Build HDF5 Tools" ON ---------------- HDF5 Advanced Options --------------------- ALLOW_UNSUPPORTED "Allow unsupported combinations of configure options" OFF HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF +HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF @@ -590,7 +576,8 @@ HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF HDF5_ENABLE_TRACE "Enable API tracing capability" OFF HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF -HDF5_GENERATE_HEADERS "Rebuild Generated Files" OFF +HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON +HDF5_BUILD_GENERATORS "Build Test Generators" OFF HDF5_JAVA_PACK_JRE "Package a JRE installer directory" OFF HDF5_MEMORY_ALLOC_SANITY_CHECK "Indicate that internal memory allocation sanity checks are enabled" OFF HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF @@ -603,7 +590,7 @@ HDF_TEST_EXPRESS "Control testing framework (0-3)" HDF5_TEST_VFD "Execute tests with different VFDs" OFF HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF -HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." OFF +HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF -- cgit v0.12 From 5cf381597dddc2f551a344a102a4975ea0d373af Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 14 Sep 2017 14:33:40 -0500 Subject: Fixed incorrect calls Description: Replaced the calls to the deprecated function printError with printErrorStack in examples. Platforms tested: Linux/32 2.6 (jam) --- c++/examples/chunks.cpp | 6 +++--- c++/examples/compound.cpp | 8 ++++---- c++/examples/create.cpp | 8 ++++---- c++/examples/extend_ds.cpp | 8 ++++---- c++/examples/h5group.cpp | 8 ++++---- c++/examples/h5tutr_cmprss.cpp | 6 +++--- c++/examples/h5tutr_crtatt.cpp | 8 ++++---- c++/examples/h5tutr_crtdat.cpp | 6 +++--- c++/examples/h5tutr_crtgrp.cpp | 4 ++-- c++/examples/h5tutr_crtgrpar.cpp | 4 ++-- c++/examples/h5tutr_crtgrpd.cpp | 8 ++++---- c++/examples/h5tutr_extend.cpp | 6 +++--- c++/examples/h5tutr_rdwt.cpp | 4 ++-- c++/examples/h5tutr_subset.cpp | 6 +++--- c++/examples/readdata.cpp | 8 ++++---- c++/examples/writedata.cpp | 6 +++--- 16 files changed, 52 insertions(+), 52 deletions(-) diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp index 836c86d..142e70f 100644 --- a/c++/examples/chunks.cpp +++ b/c++/examples/chunks.cpp @@ -209,21 +209,21 @@ int main (void) // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch( DataSpaceIException error ) { - error.printError(); + error.printErrorStack(); return -1; } return 0; diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp index 2636d8e..192a1cf 100644 --- a/c++/examples/compound.cpp +++ b/c++/examples/compound.cpp @@ -174,28 +174,28 @@ int main(void) // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch( DataSpaceIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch( DataTypeIException error ) { - error.printError(); + error.printErrorStack(); return -1; } diff --git a/c++/examples/create.cpp b/c++/examples/create.cpp index d4500f9..890fb03 100644 --- a/c++/examples/create.cpp +++ b/c++/examples/create.cpp @@ -99,28 +99,28 @@ int main (void) // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch( DataSpaceIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch( DataTypeIException error ) { - error.printError(); + error.printErrorStack(); return -1; } diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp index 0ecad1f..271100e 100644 --- a/c++/examples/extend_ds.cpp +++ b/c++/examples/extend_ds.cpp @@ -204,28 +204,28 @@ int main (void) // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch( DataSpaceIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch( DataTypeIException error ) { - error.printError(); + error.printErrorStack(); return -1; } return 0; diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp index 3e3ab4d..a8c9953 100644 --- a/c++/examples/h5group.cpp +++ b/c++/examples/h5group.cpp @@ -188,28 +188,28 @@ int main(void) // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch( DataSpaceIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the Attribute operations catch( AttributeIException error ) { - error.printError(); + error.printErrorStack(); return -1; } return 0; diff --git a/c++/examples/h5tutr_cmprss.cpp b/c++/examples/h5tutr_cmprss.cpp index ee2c544..9b1d2bc 100644 --- a/c++/examples/h5tutr_cmprss.cpp +++ b/c++/examples/h5tutr_cmprss.cpp @@ -132,21 +132,21 @@ int main (void) // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch(DataSetIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch(DataSpaceIException error) { - error.printError(); + error.printErrorStack(); return -1; } diff --git a/c++/examples/h5tutr_crtatt.cpp b/c++/examples/h5tutr_crtatt.cpp index db34353..f865501 100644 --- a/c++/examples/h5tutr_crtatt.cpp +++ b/c++/examples/h5tutr_crtatt.cpp @@ -59,28 +59,28 @@ int main (void) // catch failure caused by the H5File operations catch( DataSpaceIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the H5File operations catch( AttributeIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); + error.printErrorStack(); return -1; } diff --git a/c++/examples/h5tutr_crtdat.cpp b/c++/examples/h5tutr_crtdat.cpp index e36a215..7cd49f8 100644 --- a/c++/examples/h5tutr_crtdat.cpp +++ b/c++/examples/h5tutr_crtdat.cpp @@ -53,21 +53,21 @@ int main (void) // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch(DataSetIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch(DataSpaceIException error) { - error.printError(); + error.printErrorStack(); return -1; } diff --git a/c++/examples/h5tutr_crtgrp.cpp b/c++/examples/h5tutr_crtgrp.cpp index 5462cbf..4bdb02c 100644 --- a/c++/examples/h5tutr_crtgrp.cpp +++ b/c++/examples/h5tutr_crtgrp.cpp @@ -48,13 +48,13 @@ int main(void) // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the Group operations catch(GroupIException error) { - error.printError(); + error.printErrorStack(); return -1; } diff --git a/c++/examples/h5tutr_crtgrpar.cpp b/c++/examples/h5tutr_crtgrpar.cpp index 93bd08d..3e175d6 100644 --- a/c++/examples/h5tutr_crtgrpar.cpp +++ b/c++/examples/h5tutr_crtgrpar.cpp @@ -68,14 +68,14 @@ int main(void) // catch failure caused by the File operations catch(FileIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the Group operations catch(GroupIException error) { - error.printError(); + error.printErrorStack(); return -1; } diff --git a/c++/examples/h5tutr_crtgrpd.cpp b/c++/examples/h5tutr_crtgrpd.cpp index 96805a7..318ab1c 100644 --- a/c++/examples/h5tutr_crtgrpd.cpp +++ b/c++/examples/h5tutr_crtgrpd.cpp @@ -106,27 +106,27 @@ int main(void) // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch(DataSetIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch(DataSpaceIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the Group operations catch(GroupIException error) { - error.printError(); + error.printErrorStack(); return -1; } diff --git a/c++/examples/h5tutr_extend.cpp b/c++/examples/h5tutr_extend.cpp index 703068a..8c1bc03 100644 --- a/c++/examples/h5tutr_extend.cpp +++ b/c++/examples/h5tutr_extend.cpp @@ -147,21 +147,21 @@ int main (void) // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch(DataSetIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch(DataSpaceIException error) { - error.printError(); + error.printErrorStack(); return -1; } diff --git a/c++/examples/h5tutr_rdwt.cpp b/c++/examples/h5tutr_rdwt.cpp index 5ab7ccc..4c9d49e 100644 --- a/c++/examples/h5tutr_rdwt.cpp +++ b/c++/examples/h5tutr_rdwt.cpp @@ -58,14 +58,14 @@ int main (void) // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch(DataSetIException error) { - error.printError(); + error.printErrorStack(); return -1; } diff --git a/c++/examples/h5tutr_subset.cpp b/c++/examples/h5tutr_subset.cpp index 9ba2104..14a9ced 100644 --- a/c++/examples/h5tutr_subset.cpp +++ b/c++/examples/h5tutr_subset.cpp @@ -153,21 +153,21 @@ int main (void) // catch failure caused by the H5File operations catch(FileIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch(DataSetIException error) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch(DataSpaceIException error) { - error.printError(); + error.printErrorStack(); return -1; } diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp index fd88776..5a2f3bc 100644 --- a/c++/examples/readdata.cpp +++ b/c++/examples/readdata.cpp @@ -182,28 +182,28 @@ int main (void) // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch( DataSpaceIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch( DataTypeIException error ) { - error.printError(); + error.printErrorStack(); return -1; } diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp index e14e578..f5c06cf 100644 --- a/c++/examples/writedata.cpp +++ b/c++/examples/writedata.cpp @@ -306,21 +306,21 @@ int main (void) // catch failure caused by the H5File operations catch( FileIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSet operations catch( DataSetIException error ) { - error.printError(); + error.printErrorStack(); return -1; } // catch failure caused by the DataSpace operations catch( DataSpaceIException error ) { - error.printError(); + error.printErrorStack(); return -1; } -- cgit v0.12 From b61bb248cdf5ffe3c77a92dba99955390f028f12 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 15 Sep 2017 07:57:40 -0500 Subject: Amend CMakeLists.txt to add t_filters_parallel to CMake --- testpar/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index e994b65..39d23a9 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -51,6 +51,7 @@ set (H5P_TESTS t_prestart t_init_term t_shapesame + t_filters_parallel ) foreach (testp ${H5P_TESTS}) -- cgit v0.12 From 92193e35bb75f0d18319c03d4fdd6a0b7aad7ab5 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 15 Sep 2017 11:46:22 -0500 Subject: Miscellaneous code cleanup Description: - Removed two inadvertently-added Group constructors in the header file. There was no implementation. - Removed deprecated H5Location and H5Object constructors that take an existing ID. - Miscellaneous improvements in comments, including updating URLs. Platforms tested: Linux/32 2.6 (jam) Linux/64 (jelly) Darwin (osx1010test) --- c++/src/H5ArrayType.h | 3 +-- c++/src/H5AtomType.cpp | 6 +++--- c++/src/H5AtomType.h | 3 +-- c++/src/H5Attribute.h | 3 +-- c++/src/H5CompType.h | 3 +-- c++/src/H5CppDoc.h | 8 ++++---- c++/src/H5DataSet.cpp | 2 +- c++/src/H5DataSet.h | 3 +-- c++/src/H5DataSpace.cpp | 8 ++++---- c++/src/H5DataSpace.h | 3 +-- c++/src/H5DataType.cpp | 2 +- c++/src/H5DataType.h | 3 +-- c++/src/H5DcreatProp.cpp | 10 +++++----- c++/src/H5DcreatProp.h | 3 +-- c++/src/H5DxferProp.cpp | 4 ++-- c++/src/H5DxferProp.h | 3 +-- c++/src/H5EnumType.h | 3 +-- c++/src/H5FaccProp.h | 3 +-- c++/src/H5FcreatProp.h | 3 +-- c++/src/H5File.h | 3 +-- c++/src/H5FloatType.h | 3 +-- c++/src/H5Group.h | 15 +-------------- c++/src/H5IntType.h | 3 +-- c++/src/H5LaccProp.h | 3 +-- c++/src/H5Location.cpp | 5 +++-- c++/src/H5Location.h | 9 ++------- c++/src/H5Object.h | 5 ++--- c++/src/H5OcreatProp.h | 5 ++--- c++/src/H5PredType.h | 3 +-- c++/src/H5PropList.h | 3 +-- c++/src/H5StrType.h | 3 +-- c++/src/H5VarLenType.h | 5 ++--- 32 files changed, 51 insertions(+), 90 deletions(-) diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index e3709cd..5443ae6 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -20,9 +20,8 @@ namespace H5 { /*! \class ArrayType \brief Class ArrayType inherits from DataType and provides wrappers for the HDF5's Array Datatypes. - - Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP ArrayType : public DataType { public: // Constructor that creates a new array data type based on the diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 9fe7608..5e709af 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -176,7 +176,7 @@ size_t AtomType::getPrecision() const ///\exception H5::DataTypeIException ///\par Description /// For information, please see C layer Reference Manuat at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetPrecision +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetPrecision // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setPrecision(size_t precision) const @@ -196,7 +196,7 @@ void AtomType::setPrecision(size_t precision) const ///\exception H5::DataTypeIException ///\par Description /// For information, please see C layer Reference Manuat at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetOffset +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetOffset // Programmer Binh-Minh Ribler - 2000 // Modification // 12/05/00: due to C API change @@ -223,7 +223,7 @@ int AtomType::getOffset() const ///\exception H5::DataTypeIException ///\par Description /// For information, please see C layer Reference Manuat at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetOffset +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetOffset // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setOffset(size_t offset) const diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index 0be3cb5..7ce66a0 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -23,9 +23,8 @@ namespace H5 { AtomType provides operations on HDF5 atomic datatypes. It also inherits from DataType. - - Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP AtomType : public DataType { public: // Returns the byte order of an atomic datatype. diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 41e74d9..823947e 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -24,9 +24,8 @@ namespace H5 { Attribute and DataSet are derivatives of AbstractDs. Attribute also inherits from H5Location because an attribute can be used to specify a location. - - Inheritance: multiple H5Location/AbstractDs -> IdComponent */ +// Inheritance: multiple H5Location/AbstractDs -> IdComponent class H5_DLLCPP Attribute : public AbstractDs, public H5Location { public: diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index bf687de..a811b4a 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -20,9 +20,8 @@ namespace H5 { /*! \class CompType \brief CompType is a derivative of a DataType and operates on HDF5 compound datatypes. - - Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP CompType : public DataType { public: // Default constructor diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index 543f49b..0fd3a93 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -27,10 +27,10 @@ * The C++ API provides C++ wrappers for the HDF5 C Library. * * It is assumed that the user has knowledge of the - * + * * HDF5 file format and its components. * For more information on the HDF5 C Library, see the - * + * * HDF5 Software Documentation page. * * Because the HDF5 C Library maps very well to @@ -55,8 +55,8 @@ * * The HDF5 C++ API is included with the HDF5 source code and can * be obtained from - * - * https://www.hdfgroup.org/HDF5/release/obtainsrc.html. + * + * https://support.hdfgroup.org/HDF5/release/obtainsrc.html. * * Please refer to the release_docs/INSTALL file under the top directory * of the HDF5 source code for information about installing, building, diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index dd2fd21..32377bc 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -580,7 +580,7 @@ int DataSet::iterateElems(void* buf, const DataType& type, const DataSpace& spac /// For more information, please see the Description section in /// C layer Reference Manual at: ///\par -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Extend +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Extend // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::extend(const hsize_t* size) const diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index 2f3eebe..f9d2ec3 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -23,9 +23,8 @@ namespace H5 { An datasets has many characteristics similar to an attribute, thus both Attribute and DataSet are derivatives of AbstractDs. DataSet also inherits from H5Object because a dataset is an HDF5 object. - - Inheritance: multiple H5Object/AbstractDs -> H5Location -> IdComponent */ +// Inheritance: multiple H5Object/AbstractDs -> H5Location -> IdComponent class H5_DLLCPP DataSet : public H5Object, public AbstractDs { public: diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 49b8ea3..379de2f 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -468,7 +468,7 @@ hssize_t DataSpace::getSelectElemNpoints () const ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElemPointList +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElemPointList // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize_t numpoints, hsize_t *buf) const @@ -492,7 +492,7 @@ void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize_t numpoints, h ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectBounds +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectBounds // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end) const @@ -518,7 +518,7 @@ void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end) const ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElements +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElements // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectElements (H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const @@ -600,7 +600,7 @@ bool DataSpace::selectValid () const ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectHyperslab(H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block) const diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index c0a1d2b..ed141a3 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -20,9 +20,8 @@ namespace H5 { /*! \class DataSpace \brief Class DataSpace inherits from IdComponent and provides wrappers for the HDF5's dataspaces. - - Inheritance: IdComponent */ +// Inheritance: IdComponent class H5_DLLCPP DataSpace : public IdComponent { public: ///\brief Default DataSpace objects diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 90211b9..d2bfbda 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -654,7 +654,7 @@ DataType DataType::getSuper() const ///\exception H5::DataTypeIException ///\par Description /// For more information, please see: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-Register +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-Register // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 6833a06..5b8f924 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -23,9 +23,8 @@ namespace H5 { DataType inherits from H5Object because a named datatype is an HDF5 object and is a base class of ArrayType, AtomType, CompType, EnumType, and VarLenType. - - Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP DataType : public H5Object { public: // Creates a datatype given its class and size diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 67e4a1c..fd3cd17 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -159,7 +159,7 @@ int DSetCreatPropList::getChunk(int max_ndims, hsize_t* dim) const ///\exception H5::PropListIException ///\par Description /// For information on valid layout types, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLayout +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLayout // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setLayout(H5D_layout_t layout) const @@ -235,7 +235,7 @@ void DSetCreatPropList::setDeflate(int level) const /// H5Z_FILTER_SZIP, for a dataset. For more information about /// SZIP and usage, please refer to the C layer Reference /// Manual at: -/// http://hdfgroup.org/HDF5/doc/RM_H5P.html#Property-SetSzip +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSzip // Programmer Binh-Minh Ribler - Jan, 2007 //-------------------------------------------------------------------------- void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_per_block) const @@ -257,7 +257,7 @@ void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_p /// H5Z_FILTER_NBIT, for a dataset. For more information about /// Nbit compression, please refer to the C layer Reference /// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-setNbit +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-setNbit // Programmer Binh-Minh Ribler - Apr, 2016 //-------------------------------------------------------------------------- void DSetCreatPropList::setNbit() const @@ -285,7 +285,7 @@ void DSetCreatPropList::setNbit() const ///\par /// For information on setting fill value, please refer to the /// C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFillValue +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFillValue // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFillValue(const DataType& fvalue_type, const void* value) const @@ -536,7 +536,7 @@ bool DSetCreatPropList::allFiltersAvail() const ///\par Description /// Please refer to the Reference Manual of \c H5Pset_shuffle for /// details. -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetShuffle +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetShuffle // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setShuffle() const diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index ebd2678..89318e8 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -24,9 +24,8 @@ class DataSpace; /*! \class DSetCreatPropList \brief Class DSetCreatPropList inherits from ObjCreatPropList and provides wrappers for the HDF5 dataset creation property functions. - - Inheritance: ObjCreatPropList -> PropList -> IdComponent */ +// Inheritance: ObjCreatPropList -> PropList -> IdComponent class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { public: ///\brief Default dataset creation property list. diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 4c767cb..3a72b28 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -435,7 +435,7 @@ void DSetMemXferPropList::getVlenMemManager(H5MM_allocate_t& alloc_func, void** ///\exception H5::PropListIException ///\par Description /// For detail, please refer to the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSmallData +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSmallData // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) const @@ -475,7 +475,7 @@ hsize_t DSetMemXferPropList::getSmallDataBlockSize() const ///\par Description /// For information, please refer to the C layer Reference /// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetHyperVectorSize +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetHyperVectorSize // Programmer Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) const diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 4a66671..75205cf 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -20,9 +20,8 @@ namespace H5 { /*! \class DSetMemXferPropList \brief Class DSetCreatPropList inherits from PropList and provides wrappers for the HDF5 dataset memory and transfer property list. - - Inheritance: PropList -> IdComponent */ +// Inheritance: PropList -> IdComponent class H5_DLLCPP DSetMemXferPropList : public PropList { public: ///\brief Default dataset memory and transfer property list. diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index 6468bf7..e0d5b88 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -20,9 +20,8 @@ namespace H5 { /*! \class EnumType \brief EnumType is a derivative of a DataType and operates on HDF5 enum datatypes. - - Inheritance: DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP EnumType : public DataType { public: diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 2563163..1df8fc8 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -20,9 +20,8 @@ namespace H5 { /*! \class FileAccPropList \brief Class FileAccPropList inherits from PropList and provides wrappers for the HDF5 file access property list. - - Inheritance: PropList -> IdComponent */ +// Inheritance: PropList -> IdComponent class H5_DLLCPP FileAccPropList : public PropList { public: ///\brief Default file access property list. diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index da620d4..31a944c 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -20,9 +20,8 @@ namespace H5 { /*! \class FileCreatPropList \brief Class FileCreatPropList inherits from PropList and provides wrappers for the HDF5 file create property list. - - Inheritance: PropList -> IdComponent */ +// Inheritance: PropList -> IdComponent class H5_DLLCPP FileCreatPropList : public PropList { public: ///\brief Default file creation property list. diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 0f921ae..214feb0 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -20,9 +20,8 @@ namespace H5 { /*! \class H5File \brief Class H5File represents an HDF5 file and inherits from class Group as file is a root group. - - Inheritance: Group -> CommonFG/H5Object -> H5Location -> IdComponent */ +// Inheritance: Group -> CommonFG/H5Object -> H5Location -> IdComponent class H5_DLLCPP H5File : public Group { public: // Creates or opens an HDF5 file. diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index 4f277c3..d26df5c 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -20,9 +20,8 @@ namespace H5 { /*! \class FloatType \brief FloatType is a derivative of a DataType and operates on HDF5 floating point datatype. - - Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP FloatType : public AtomType { public: // Creates a floating-point type using a predefined type. diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index e5fa174..b3a9007 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -19,23 +19,10 @@ namespace H5 { /*! \class Group \brief Class Group represents an HDF5 group. - - Inheritance: H5Object -> H5Location -> IdComponent */ -// Class forwarding -class ArrayType; -class VarLenType; - +// Inheritance: CommonFG/H5Object -> H5Location -> IdComponent class H5_DLLCPP Group : public H5Object, public CommonFG { public: - // Group constructor to create a group or file (aka root group). - Group(const char* name, size_t size_hint = 0); - Group(const H5std_string& name, size_t size_hint = 0); - - // Group constructor to open a group or file (aka root group). - Group(const char* name); - Group(const H5std_string& name); - // Close this group. virtual void close(); diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index 54a4975..a9ebad0 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -20,9 +20,8 @@ namespace H5 { /*! \class IntType \brief IntType is a derivative of a DataType and operates on HDF5 integer datatype. - - Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP IntType : public AtomType { public: // Creates an integer type using a predefined type diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h index 9772cde..6c86a85 100644 --- a/c++/src/H5LaccProp.h +++ b/c++/src/H5LaccProp.h @@ -23,9 +23,8 @@ namespace H5 { /*! \class LinkAccPropList \brief Class LinkAccPropList inherits from PropList and provides wrappers for the HDF5 file access property list. - - Inheritance: PropList -> IdComponent */ +// Inheritance: PropList -> IdComponent class H5_DLLCPP LinkAccPropList : public PropList { public: ///\brief Default file access property list. diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 35a4828..a00e181 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -137,7 +137,8 @@ void H5Location::flush(H5F_scope_t scope) const //-------------------------------------------------------------------------- // Function: H5Location::getFileName -///\brief Gets the name of the file, in which this HDF5 object belongs. +///\brief Gets the name of the file, in which an HDF5 object at this +/// location belongs. ///\return File name ///\exception H5::LocationException // Programmer Binh-Minh Ribler - Jul, 2004 @@ -557,7 +558,7 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t /// \li \c H5G_TYPE Object - is a named datatype /// \li \c H5G_LINK - Object is a symbolic link. /// \li \c H5G_UDLINK - Object is a user-defined link. -///\exception H5::LocationException +///\exception H5::ReferenceException // Programmer Binh-Minh Ribler - May, 2004 // Modification // Sep 2012: Moved up from H5File, Group, DataSet, and DataType diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index f9c5a47..2631169 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -26,13 +26,8 @@ namespace H5 { location identifier to specify the HDF5 object. The location identifier can be either file, group, dataset, attribute, or named datatype. Wrappers for H5A functions stay in H5Object. - - Inheritance: IdComponent */ -// Class forwarding -//class H5_DLLCPP ArrayType; -//class H5_DLLCPP LinkAccPropList; -//class H5_DLLCPP VarLenType; +// Inheritance: IdComponent class H5_DLLCPP H5Location : public IdComponent { public: // Checks if a link of a given name exists in a location @@ -195,7 +190,7 @@ class H5_DLLCPP H5Location : public IdComponent { // removal does not raise any problems in two 1.10 releases. // Creates a copy of an existing object giving the location id. - H5Location(const hid_t loc_id); + // H5Location(const hid_t loc_id); // Creates a reference to an HDF5 object or a dataset region. void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const; diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index ba32b3e..3772e08 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -36,9 +36,8 @@ namespace H5 { into H5Object. This way, C functions that takes attribute id can be in H5Location and those that cannot take attribute id can be in H5Object. - - Inheritance: H5Location -> IdComponent */ +// Inheritance: H5Location -> IdComponent // Define the operator function pointer for H5Aiterate(). typedef void (*attr_operator_t)(H5Object& loc/*in*/, @@ -113,7 +112,7 @@ class H5_DLLCPP H5Object : public H5Location { // removal does not raise any problems in two 1.10 releases. // Creates a copy of an existing object giving the object id - H5Object(const hid_t object_id); + // H5Object(const hid_t object_id); // Copy constructor: makes copy of an H5Object object. // H5Object(const H5Object& original); diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index 878c67a..d1eae86 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -19,10 +19,9 @@ namespace H5 { /*! \class ObjCreatPropList \brief Class ObjCreatPropList inherits from PropList and provides - wrappers for the HDF5 file create property list. - - Inheritance: PropList -> IdComponent + wrappers for the HDF5 object create property list. */ +// Inheritance: PropList -> IdComponent class H5_DLLCPP ObjCreatPropList : public PropList { public: ///\brief Default object creation property list. diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 2ffc87f..c631fb9 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -23,9 +23,8 @@ namespace H5 { These types can only be made copy of, not created by H5Tcreate or closed by H5Tclose. They are treated as constants. - - Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP PredType : public AtomType { public: ///\brief Returns this class name. diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index e1fe5b8..6e1e287 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -20,9 +20,8 @@ namespace H5 { /*! \class PropList \brief Class PropList inherits from IdComponent and provides wrappers for the HDF5 generic property list. - - Inheritance: IdComponent */ +// Inheritance: IdComponent class H5_DLLCPP PropList : public IdComponent { public: ///\brief Default property list diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index fd0402e..24c9ca3 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -20,9 +20,8 @@ namespace H5 { /*! \class StrType \brief StrType is a derivative of a DataType and operates on HDF5 string datatype. - - Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent */ +// Inheritance: AtomType -> DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP StrType : public AtomType { public: // Creates a string type using a predefined type diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index 2524cf8..078b534 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -19,10 +19,9 @@ namespace H5 { /*! \class VarLenType \brief VarLenType is a derivative of a DataType and operates on HDF5 - C's Variable-length Datatypes. - - Inheritance: DataType -> H5Object -> H5Location -> IdComponent + Variable-length Datatypes. */ +// Inheritance: DataType -> H5Object -> H5Location -> IdComponent class H5_DLLCPP VarLenType : public DataType { public: // Constructor that creates a variable-length datatype based -- cgit v0.12 From 924421f298b7320234cb6e1e1817a150d50b1951 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sun, 17 Sep 2017 13:28:42 -0500 Subject: Added documentation file Description: Added a single page html file, C2Cppfunction_map.mht, that shows the current mapping of C APIs to C++ member functions. This page can be reached from the main page of the C++ reference manual. --- c++/src/C2Cppfunction_map.mht | 35293 ++++++++++++++++++++++++++++++++++++++++ c++/src/H5CppDoc.h | 3 + 2 files changed, 35296 insertions(+) create mode 100644 c++/src/C2Cppfunction_map.mht diff --git a/c++/src/C2Cppfunction_map.mht b/c++/src/C2Cppfunction_map.mht new file mode 100644 index 0000000..b32848d --- /dev/null +++ b/c++/src/C2Cppfunction_map.mht @@ -0,0 +1,35293 @@ +MIME-Version: 1.0 +Content-Type: multipart/related; boundary="----=_NextPart_01D32FBF.F2FA1110" + +This document is a Single File Web Page, also known as a Web Archive file. If you are seeing this message, your browser or editor doesn't support Web Archive files. Please download a browser that supports Web Archive, such as Windows® Internet Explorer®. + +------=_NextPart_01D32FBF.F2FA1110 +Content-Location: file:///C:/25114090/C2Cppfunction_map.htm +Content-Transfer-Encoding: quoted-printable +Content-Type: text/html; charset="windows-1252" + + + + + + + + + + + + + + + + + + + +
+ +

C++ API Wrappers of HDF5 C Functi= +ons

+ +

 

+ +

Shaded rows are in 1.10 versions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

C Function

+
+

C++ + Wrapper

+
+

1.8

+
+

1.10

+
+

Comment

+
+

H5Acreate2

+
+

Attribute H5Location::createAttribute( const char* name, const + DataType& data_type, const DataSpace& data_space, const PropList&= +amp; + create_plist =3D PropList::DEFAULT)

+
+

x

+
+

 

+
+

Old model kept for backward compatibility

+
+

Attribute H5Location::createAttribute( const H5std_string& na= +me, + const DataType& data_type, const DataSpace& data_space, const + PropList& create_plist =3D PropList::DEFAULT)

+
+

x

+
+

 

+
+

Old model kept for backward compatibility

+
+

Attribute H5Object::createAttribute( const char* name, const + DataType& data_type, const DataSpace& data_space, const PropList&= +amp; + create_plist =3D PropList::DEFAULT)

+
+

 

+
+

x

+
+

Revised model

+
+

Attribute H5Object::createAttribute( const H5std_string& name, + const DataType& data_type, const DataSpace& data_space, const + PropList& create_plist =3D PropList::DEFAULT)

+
+

 

+
+

x

+
+

Revised model

+
+

H5Acreate_by_name

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Aopen

+
+

Attribute H5Location::openAttribute( const char* name )

+
+

x

+
+

 

+
+

 

+
+

Attribute H5Location::openAttribute( const H5std_string& name= + )

+
+

x

+
+

 

+
+

 

+
+

Attribute H5Object::openAttribute( const char* name )

+
+

 

+
+

x

+
+

 

+
+

Attribute H5Object::openAttribute( const H5std_string& name )= +

+
+

 

+
+

x

+
+

 

+
+

H5Aopen_by_idx

+

H5Aopen_by_idx

+
+

Attribute H5Location::openAttribute( const unsigned int idx )

+
+

x

+
+

 

+
+

 

+
+

Attribute H5Object::openAttribute( const unsigned int idx )

+
+

 

+
+

x

+
+

 

+
+

H5Aopen_by_name

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Awrite

+
+

void Attribute::write( const DataType& mem_type, const void *= +buf + )

+
+

 

+
+

 

+
+

 

+
+

void Attribute::write(const DataType& mem_type, const + H5std_string& strg) const

+
+

 

+
+

 

+
+

 

+
+

H5Aread

+
+

void Attribute::read( const DataType& mem_type, void *buf ) +

+

 

+
+

 

+
+

 

+
+

void Attribute::read(const DataType& mem_type, H5std_string&a= +mp; + strg)

+
+

 

+
+

 

+
+

 

+
+

H5Aclose

+
+

void Attribute::close()

+
+

 

+
+

 

+
+

 

+
+

Attribute::~Attribute()

+
+

 

+
+

 

+
+

 

+
+

H5Aget_space

+
+

DataSpace Attribute::getSpace()

+
+

 

+
+

 

+
+

 

+
+

H5Aget_type

+
+

DataType AbstractDs::getDataType()

+
+

 

+
+

 

+
+

 

+
+

ArrayType AbstractDs::getArrayType()

+
+

 

+
+

 

+
+

 

+
+

CompType AbstractDs::getCompType()

+
+

 

+
+

 

+
+

 

+
+

EnumType AbstractDs::getEnumType()

+
+

 

+
+

 

+
+

 

+
+

IntType AbstractDs::getIntType()

+
+

 

+
+

 

+
+

 

+
+

FloatType AbstractDs::getFloatType()

+
+

 

+
+

 

+
+

 

+
+

StrType AbstractDs::getStrType()

+
+

 

+
+

 

+
+

 

+
+

VarLenType AbstractDs::getVarLenType()

+
+

 

+
+

 

+
+

 

+
+

H5Aget_create_plist

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Aget_name

+
+

ssize_t Attribute::getName(char* attr_name, size_t buf_size)

+
+

 

+
+

 

+
+

 

+
+

H5std_string Attribute::getName()

+
+

 

+
+

 

+
+

 

+
+

H5std_string Attribute::getName(size_t len) const

+
+

 

+
+

 

+
+

 

+
+

ssize_t Attribute::getName(H5std_string& attr_name, size_t le= +n)

+
+

 

+
+

 

+
+

 

+
+

ssize_t Attribute::getName( size_t len, H5std_string& attr_na= +me )

+
+

 

+
+

 

+
+

 

+
+

H5Aget_name_by_idx

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Aget_storage_size

+
+

hsize_t Attribute::getStorageSize()

+
+

 

+
+

 

+
+

 

+
+

H5Aget_info

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Aget_info_by_name

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Aget_info_by_idx

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Arename

+
+

void H5Location::renameAttr(const char* oldname, const char* newn= +ame)

+
+

x

+
+

 

+
+

 

+
+

void H5Object::renameAttr(const char* oldname, const char* newnam= +e)

+
+

 

+
+

x

+
+

 

+
+

H5Arename_by_name

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Aiterate2

+
+

int H5Location::iterateAttrs( attr_operator_t user_op, unsigned + *_idx, void *op_data )

+
+

x

+
+

 

+
+

 

+
+

int H5Object::iterateAttrs( attr_operator_t user_op, unsigned *_i= +dx, + void *op_data )

+
+

 

+
+

x

+
+

 

+
+

H5Aiterate_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Adelete

+
+

void H5Location::removeAttr( const char* name )

+
+

x

+
+

 

+
+

 

+
+

void H5Object::removeAttr( const char* name )

+
+

 

+
+

x

+
+

 

+
+

H5Adelete_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Adelete_by_idx

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Aexists

+
+

bool H5Location::attrExists(const char* name)

+
+

x

+
+

 

+
+

 

+
+

bool H5Object::attrExists(const char* name)

+
+

 

+
+

x

+
+

 

+
+

H5Aexists_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Dcreate2

+
+

DataSet CommonFG::createDataSet( const char* name, const + DataType& data_type, const DataSpace& data_space, const + DSetCreatPropList& create_plist )

+
+

x

+
+

 

+
+

 

+
+

DataSet CommonFG::createDataSet( const H5std_string& name, co= +nst + DataType& data_type, const DataSpace& data_space, const + DSetCreatPropList& create_plist )

+
+

x

+
+

 

+
+

 

+
+

DataSet H5Location::createDataSet( const char* name, const + DataType& data_type, const DataSpace& data_space, const + DSetCreatPropList& create_plist )

+
+

 

+
+

x

+
+

 

+
+

DataSet H5Location::createDataSet( const H5std_string& name, + const DataType& data_type, const DataSpace& data_space, const + DSetCreatPropList& create_plist )

+
+

 

+
+

x

+
+

 

+
+

H5Dcreate_anon

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Dopen2

+
+

DataSet CommonFG::openDataSet( const char* name )

+
+

x

+
+

 

+
+

 

+
+

DataSet CommonFG::openDataSet( const H5std_string& name)

+
+

x

+
+

 

+
+

 

+
+

DataSet H5Location::openDataSet( const char* name )

+
+

 

+
+

x

+
+

 

+
+

DataSet H5Location::openDataSet( const H5std_string& name)

+
+

 

+
+

x

+
+

 

+
+

H5Dclose

+
+

void DataSet::close()

+
+

 

+
+

 

+
+

 

+
+

DataSet destructor

+
+

 

+
+

 

+
+

 

+
+

H5Dget_space

+
+

DataSpace DataSet::getSpace()

+
+

 

+
+

 

+
+

 

+
+

H5Dget_space_status

+
+

void DataSet::getSpaceStatus(H5D_space_status_t& status)

+
+

 

+
+

 

+
+

 

+
+

H5Dget_type

+
+

DataType AbstractDs::getDataType()

+
+

 

+
+

 

+
+

 

+
+

ArrayType AbstractDs::getArrayType()

+
+

 

+
+

 

+
+

 

+
+

CompType AbstractDs::getCompType()

+
+

 

+
+

 

+
+

 

+
+

EnumType AbstractDs::getEnumType()

+
+

 

+
+

 

+
+

 

+
+

IntType AbstractDs::getIntType()

+
+

 

+
+

 

+
+

 

+
+

FloatType AbstractDs::getFloatType()

+
+

 

+
+

 

+
+

 

+
+

StrType AbstractDs::getStrType()

+
+

 

+
+

 

+
+

 

+
+

VarLenType AbstractDs::getVarLenType()

+
+

 

+
+

 

+
+

 

+
+

H5Dget_create_plist

+
+

DSetCreatPropList DataSet::getCreatePlist()

+
+

 

+
+

 

+
+

 

+
+

H5Dget_access_plist

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Dget_storage_size

+
+

hsize_t DataSet::getStorageSize()

+
+

 

+
+

 

+
+

 

+
+

H5Dget_offset

+
+

haddr_t DataSet::getOffset()

+
+

 

+
+

 

+
+

 

+
+

H5Dread

+
+

void DataSet::read( void* buf, const DataType& mem_type, const + DataSpace& mem_space, const DataSpace& file_space, const + DSetMemXferPropList& xfer_plist )

+
+

 

+
+

 

+
+

 

+
+

void DataSet::read(H5std_string& strg, const DataType& + mem_type, const DataSpace& mem_space, const DataSpace& file_space, + const DSetMemXferPropList& xfer_plist)

+
+

 

+
+

 

+
+

 

+
+

H5Dwrite

+
+

void DataSet::write( const void* buf, const DataType& mem_typ= +e, + const DataSpace& mem_space, const DataSpace& file_space, const + DSetMemXferPropList& xfer_plist )

+
+

 

+
+

 

+
+

 

+
+

void DataSet::write( const H5std_string& strg, const + DataType& mem_type, const DataSpace& mem_space, const DataSpace&a= +mp; + file_space, const DSetMemXferPropList& xfer_plist )

+
+

 

+
+

 

+
+

 

+
+

H5Diterate

+
+

int DataSet::iterateElems( void* buf, const DataType& type, c= +onst + DataSpace& space, H5D_operator_t op, void* op_data )

+
+

 

+
+

 

+
+

 

+
+

H5Dvlen_reclaim

+
+

void DataSet::vlenReclaim(const DataType& type, const + DataSpace& space, const DSetMemXferPropList& xfer_plist, void* bu= +f )

+
+

 

+
+

 

+
+

Remove this one

+
+

void DataSet::vlenReclaim(void* buf, const DataType& type, co= +nst + DataSpace& space, const DSetMemXferPropList& xfer_plist)

+
+

 

+
+

 

+
+

Better prototype

+
+

H5Dvlen_get_buf_size

+
+

hsize_t DataSet::getVlenBufSize(const DataType& type, const + DataSpace& space)

+
+

 

+
+

 

+
+

 

+
+

H5Dfill

+
+

void DataSet::fillMemBuf(const void *fill, const DataType& + fill_type, void *buf, const DataType& buf_type, const DataSpace& + space)

+
+

 

+
+

 

+
+

 

+
+

void DataSet::fillMemBuf(void *buf, const DataType& buf_type, + const DataSpace& space

+
+

 

+
+

 

+
+

 

+
+

H5Dset_extent

+
+

void DataSet::extend( const hsize_t* size )

+
+

 

+
+

 

+
+

 

+
+

H5Dscatter

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Dgather

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Ddebug

+
+

no

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Eregister_class

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eunregister_class

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eclose_msg

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Ecreate_msg

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Ecreate_stack

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eget_current_stack

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eclose_stack

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eget_class_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eset_current_stack

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Epush2

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Epop

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eprint2

+
+

void Exception::printErrorStack(FILE* stream, hid_t err_stack)

+
+

 

+
+

 

+
+

 

+
+

H5Ewalk2

+
+

void Exception::walkErrorStack( H5E_direction_t direction, + H5E_walk2_t func, void* client_data )

+
+

 

+
+

 

+
+

 

+
+

H5Eget_auto2

+
+

void Exception::getAutoPrint( H5E_auto2_t& func, void** + client_data )

+
+

 

+
+

 

+
+

 

+
+

H5Eset_auto2

+
+

void Exception::setAutoPrint( H5E_auto2_t& func, void* + client_data )

+
+

 

+
+

 

+
+

 

+
+

H5Eclear2

+
+

void Exception::clearErrorStack()

+
+

 

+
+

 

+
+

 

+
+

H5Eauto_is_v2

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Eget_msg

+
+

H5std_string Exception::getMajorString( hid_t err_major )

+
+

 

+
+

 

+
+

 

+
+

H5std_string Exception::getMinorString( hid_t err_minor )

+
+

 

+
+

 

+
+

 

+
+

H5Eget_num

+
+

no

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_core

+
+

void FileAccPropList::setCore (size_t increment, hbool_t + backing_store)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_fapl_core

+
+

void FileAccPropList::getCore (size_t& increment, hbool_t& + backing_store)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_direct

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_fapl_direct

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FD_family_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_family

+
+

void FileAccPropList::setFamily( hsize_t memb_size, const FileAcc= +PropList& + memb_plist)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_fapl_family

+
+

void FileAccPropList::getFamily(hsize_t& memb_size, + FileAccPropList& memb_plist)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_log

+
+

void FileAccPropList::setLog(const char *logfile, unsigned flags, + size_t buf_size)

+
+

 

+
+

 

+
+

 

+
+

H5FD_multi_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_multi

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_fapl_multi

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_split

+
+

void FileAccPropList::setSplit(const FileAccPropList& meta_pl= +ist, + const FileAccPropList& raw_plist, const char* meta_ext, const char* + raw_ext )

+
+

 

+
+

 

+
+

 

+
+

void FileAccPropList::setSplit(FileAccPropList& meta_plist, + FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext= + )

+
+

 

+
+

 

+
+

 

+
+

void FileAccPropList::setSplit(const FileAccPropList& meta_pl= +ist, + const FileAccPropList& raw_plist, const H5std_string& meta_ext, c= +onst + H5std_string& raw_ext )

+
+

 

+
+

 

+
+

 

+
+

void FileAccPropList::setSplit(FileAccPropList& meta_plist, + FileAccPropList& raw_plist, const H5std_string& meta_ext, const + H5std_string& raw_ext )

+
+

 

+
+

 

+
+

 

+
+

H5FD_log_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FD_core_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FD_direct_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5FDregister

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDunregister

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDopen

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDclose

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDcmp

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDquery

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDalloc

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDfree

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDget_eoa

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDset_eoa

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDget_eof

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDget_vfd_handle

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDread

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDwrite

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDflush

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDtruncate

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FD_sec2_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_sec2

+
+

void FileAccPropList::setSec2()

+
+

 

+
+

 

+
+

 

+
+

H5FD_stdio_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_stdio

+
+

void FileAccPropList::setStdio()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_windows

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fis_hdf5

+
+

bool H5File::isHdf5(const char* name)

+
+

 

+
+

 

+
+

 

+
+

H5Fcreate

+
+

H5File::H5File( const char* name, unsigned int flags, const + FileCreatPropList& create_plist, const FileAccPropList& access_pl= +ist + )

+
+

 

+
+

 

+
+

 

+
+

H5File::H5File( const H5std_string& name, unsigned int flags, + const FileCreatPropList& create_plist, const FileAccPropList& + access_plist )

+
+

 

+
+

 

+
+

 

+
+

H5Fopen

+
+

H5File::H5File( const char* name, unsigned int flags, const + FileCreatPropList& create_plist, const FileAccPropList& access_pl= +ist + )

+
+

 

+
+

 

+
+

 

+
+

H5File::H5File( const H5std_string& name, unsigned int flags, + const FileCreatPropList& create_plist, const FileAccPropList& + access_plist )

+
+

 

+
+

 

+
+

 

+
+

void H5File::openFile(const char* name, unsigned int flags, const + FileAccPropList& access_plist)

+
+

 

+
+

 

+
+

 

+
+

H5Freopen

+
+

void H5File::reOpen()

+
+

 

+
+

 

+
+

 

+
+

H5Fflush

+
+

void H5Location::flush(H5F_scope_t scope)

+
+

 

+
+

 

+
+

 

+
+

void Attribute::flush(H5F_scope_t scope)

+
+

 

+
+

 

+
+

 

+
+

H5Fclose

+
+

void H5File::close()

+
+

 

+
+

 

+
+

 

+
+

H5File destructor

+
+

 

+
+

 

+
+

 

+
+

H5Fget_create_plist

+
+

FileCreatPropList H5File::getCreatePlist()

+
+

 

+
+

 

+
+

 

+
+

H5Fget_access_plist

+
+

FileAccPropList H5File::getAccessPlist()

+
+

 

+
+

 

+
+

 

+
+

H5Fget_intent

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fget_obj_count

+
+

ssize_t H5File::getObjCount(unsigned types)

+
+

 

+
+

 

+
+

 

+
+

ssize_t H5File::getObjCount()

+
+

 

+
+

 

+
+

 

+
+

H5Fget_obj_ids

+
+

void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t + *oid_list)

+
+

 

+
+

 

+
+

 

+
+

H5Fget_vfd_handle

+
+

void H5File::getVFDHandle(const FileAccPropList& fapl, void + **file_handle)

+
+

 

+
+

 

+
+

 

+
+

void H5File::getVFDHandle(void **file_handle)

+
+

 

+
+

 

+
+

 

+
+

H5Fmount

+
+

void CommonFG::mount(const char* name, const H5File& child, c= +onst + PropList& plist )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::mount(const char* name, H5File& child, + PropList& plist)

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::mount(const H5std_string& name, const H5File&a= +mp; + child, const PropList& plist)

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::mount(const H5std_string& name, H5File& ch= +ild, + PropList& plist)

+
+

 

+
+

 

+
+

 

+
+

H5Funmount

+
+

void CommonFG::unmount( const char* name )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::unmount( const H5std_string& name )

+
+

 

+
+

 

+
+

 

+
+

H5Fget_freespace

+
+

hssize_t H5File::getFreeSpace()

+
+

 

+
+

 

+
+

 

+
+

H5Fget_filesize

+
+

hsize_t H5File::getFileSize()

+
+

 

+
+

 

+
+

 

+
+

H5Fget_file_image

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fget_mdc_config

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fset_mdc_config

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fget_mdc_hit_rate

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fget_mdc_size

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Freset_mdc_hit_rate_stats

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fget_name

+
+

H5std_string H5Location::getFileName()

+
+

 

+
+

 

+
+

 

+
+

H5std_string Attribute::getFileName()

+
+

 

+
+

 

+
+

Will be retired

+
+

H5Fget_info2

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fget_free_sections

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fclear_elink_file_cache

+
+

no

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Gcreate2

+
+

Group CommonFG::createGroup( const char* name, size_t size_hint )= +

+
+

x

+
+

 

+
+

 

+
+

Group CommonFG::createGroup( const H5std_string& name, size_t + size_hint )

+
+

x

+
+

 

+
+

 

+
+

 

+
+

Group H5Location::createGroup( const char* name, size_t size_hint= + )

+
+

 

+
+

x

+
+

 

+
+

Group H5Location::createGroup( const H5std_string& name, size= +_t + size_hint )

+
+

 

+
+

x

+
+

 

+
+

H5Gcreate_anon

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gopen2

+
+

Group CommonFG::openGroup( const char* name )

+
+

x

+
+

 

+
+

 

+
+

Group CommonFG::openGroup( const H5std_string& name )

+
+

x

+
+

 

+
+

 

+
+

Group H5Location::openGroup( const char* name )

+
+

 

+
+

x

+
+

 

+
+

Group H5Location::openGroup( const H5std_string& name )

+
+

 

+
+

x

+
+

 

+
+

H5Gget_create_plist

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gget_info

+
+

hsize_t CommonFG::getNumObjs()

+
+

x

+
+

 

+
+

 

+
+

hsize_t H5Location::getNumObjs()

+
+

 

+
+

x

+
+

Moved to Group in 1.10.2

+
+

hsize_t Group::getNumObjs()

+
+

 

+
+

x

+
+

 

+
+

H5Gget_info_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gget_info_by_idx

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gclose

+
+

void Group::close()

+
+

 

+
+

 

+
+

 

+
+

Group destructor

+
+

 

+
+

 

+
+

 

+
+

H5Glink

+
+

Deprecated

+
+

 

+
+

 

+
+

 

+
+

H5Glink2

+
+

Deprecated

+
+

 

+
+

 

+
+

 

+
+

H5Gmove

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gmove2

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gunlink

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lcreate_hard

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lcreate_soft

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gget_linkval

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gset_comment

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gget_comment

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Giterate

+
+

int CommonFG::iterateElems( const char* name, int *idx, H5G_itera= +te_t + op , void* op_data )

+
+

 

+
+

 

+
+

 

+
+

int CommonFG::iterateElems( const H5std_string& name, int *id= +x, + H5G_iterate_t op , void* op_data )

+
+

 

+
+

 

+
+

 

+
+

H5Gget_num_objs

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Gg= +et_objinfo

+
+

void CommonFG::getObjinfo( const char* name, hbool_t follow_link, + H5G_stat_t& statbuf )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::getObjinfo( const H5std_string& name, hbool_t + follow_link, H5G_stat_t& statbuf )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::getObjinfo( const char* name, H5G_stat_t& stat= +buf + )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::getObjinfo( const H5std_string& name, + H5G_stat_t& statbuf )

+
+

 

+
+

 

+
+

 

+
+

H5Gget_objname_by_idx

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gg= +et_objtype_by_idx

+
+

H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx)

+
+

 

+
+

 

+
+

 

+
+

H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, char* type_name)= +

+
+

 

+
+

 

+
+

 

+
+

H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, H5std_string& + type_name)

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Iregister

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iobject_verify

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iremove_verify

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iget_type

+
+

H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id)

+
+

 

+
+

 

+
+

 

+
+

H5Iget_file_id

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iget_name

+
+

ssize_t H5Object::getObjName(char *obj_name, size_t buf_size)

+
+

 

+
+

 

+
+

 

+
+

H5std_string H5Object::getObjName()

+
+

 

+
+

 

+
+

 

+
+

ssize_t H5Object::getObjName(H5std_string& obj_name, size_t l= +en)

+
+

 

+
+

 

+
+

 

+
+

H5Iinc_ref

+
+

void IdComponent::incRefCount(const hid_t obj_id)

+
+

 

+
+

 

+
+

 

+
+

void IdComponent::incRefCount()

+
+

 

+
+

 

+
+

 

+
+

H5Idec_ref

+
+

void IdComponent::decRefCount(const hid_t obj_id)

+
+

 

+
+

 

+
+

 

+
+

void IdComponent::decRefCount()

+
+

 

+
+

 

+
+

 

+
+

H5Iget_ref

+
+

int IdComponent::getCounter(const hid_t obj_id)

+
+

 

+
+

 

+
+

 

+
+

int IdComponent::getCounter()

+
+

 

+
+

 

+
+

 

+
+

H5Iregister_type

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iclear_type

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Idestroy_type

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iinc_type_ref

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Idec_type_ref

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iget_type_ref

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Isearch

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Inmembers

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Itype_exists

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iis_valid

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Lmove

+
+

void CommonFG::move( const char* src, const char* dst )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::move( const H5std_string& src, const + H5std_string& dst )

+
+

 

+
+

 

+
+

 

+
+

H5Lcopy

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lcreate_hard

+

H5Lcreate_soft

+
+

void CommonFG::link( H5L_type_t link_type, const char* curr_name, + const char* new_name )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::link( H5L_type_t link_type, const H5std_string& + curr_name, const H5std_string& new_name )

+
+

 

+
+

 

+
+

 

+
+

H5Ldelete

+
+

void CommonFG::unlink( const char* name )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::unlink( const H5std_string& name )

+
+

 

+
+

 

+
+

 

+
+

H5Ldelete_by_idx

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lget_val

+
+

H5std_string CommonFG::getLinkval( const char* name, size_t size = +)

+
+

x

+
+

 

+
+

 

+
+

H5std_string CommonFG::getLinkval( const H5std_string& name, + size_t size )

+
+

x

+
+

 

+
+

 

+
+

H5std_string H5Location::getLinkval( const char* name, size_t siz= +e )

+
+

 

+
+

x

+
+

 

+
+

H5std_string H5Location::getLinkval( const H5std_string& name, + size_t size )

+
+

 

+
+

x

+
+

 

+
+

H5Lget_val_by_idx

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lexists

+
+

bool H5Location::nameExists(const char* name, const + LinkAccPropList& lapl)

+
+

 

+
+

 

+
+

 

+
+

bool H5Location::nameExists(const H5std_string& name, const + LinkAccPropList& lapl)

+
+

 

+
+

 

+
+

 

+
+

H5Lget_info

+
+

Only used in getLinkval; need to replace H5Gget_objinfo occurrenc= +es

+
+

 

+
+

 

+
+

 

+
+

H5Lget_info_by_idx

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Lget_name_by_idx

+
+

H5std_string CommonFG::getObjnameByIdx(hsize_t idx)

+
+

x

+
+

 

+
+

 

+
+

ssize_t CommonFG::getObjnameByIdx(hsize_t idx, char* name, size_t + size)

+
+

x

+
+

 

+
+

 

+
+

ssize_t CommonFG::getObjnameByIdx(hsize_t idx, H5std_string& + name, size_t size)

+
+

x

+
+

 

+
+

 

+
+

H5std_string H5Location::getObjnameByIdx(hsize_t idx)

+
+

 

+
+

x

+
+

 

+
+

ssize_t H5Location::getObjnameByIdx(hsize_t idx, char* name, size= +_t + size)

+
+

 

+
+

x

+
+

 

+
+

ssize_t H5Location::getObjnameByIdx(hsize_t idx, H5std_string& + name, size_t size)

+
+

 

+
+

x

+
+

 

+
+

H5Literate

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Literate_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lvisit

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lvisit_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Lcreate_ud

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lregister

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lunregister

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lis_registered

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lunpack_elink_val

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lcreate_external

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Oopen

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oopen_by_addr

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oopen_by_idx

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oexists_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oget_info

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oget_info_by_name

+
+

H5O_type_t CommonFG::childObjType(const char* objname)

+
+

 

+
+

 

+
+

 

+
+

H5O_type_t CommonFG::childObjType(const H5std_string& objname= +)

+
+

 

+
+

 

+
+

 

+
+

H5O_type_t H5Location::childObjType(const char* objname)

+
+

 

+
+

 

+
+

 

+
+

H5O_type_t H5Location::childObjType(const H5std_string& objna= +me)

+
+

 

+
+

 

+
+

 

+
+

H5Oget_info_by_idx

+
+

H5O_type_t CommonFG::childObjType(hsize_t index, H5_index_t + index_type, H5_iter_order_t order, const char* objname)

+
+

 

+
+

 

+
+

 

+
+

H5O_type_t H5Location::childObjType(hsize_t index, H5_index_t + index_type, H5_iter_order_t order, const char* objname)

+
+

 

+
+

 

+
+

 

+
+

H5Olink

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oincr_refcount

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Odecr_refcount

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Ocopy

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oset_comment

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oset_comment_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oget_comment

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oget_comment_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Ovisit

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Ovisit_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oclose

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5PLset_loading_state

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5PLget_loading_state

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Pcreate_class

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_class_name

+
+

H5std_string PropList::getClassName()

+
+

 

+
+

 

+
+

 

+
+

H5Pcreate

+
+

PropList::PropList(const hid_t plist_id)

+
+

 

+
+

 

+
+

 

+
+

H5Pregister2

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pinsert2

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset

+
+

void PropList::setProperty(const char* name, void* value)

+
+

 

+
+

 

+
+

 

+
+

void PropList::setProperty(const char* name, const char* charptr)= +

+
+

 

+
+

 

+
+

 

+
+

void PropList::setProperty(const char* name, H5std_string& st= +rg)

+
+

 

+
+

 

+
+

 

+
+

void PropList::setProperty(const H5std_string& name, void* va= +lue)

+
+

 

+
+

 

+
+

 

+
+

void PropList::setProperty(const H5std_string& name, + H5std_string& strg)

+
+

 

+
+

 

+
+

 

+
+

H5Pexist

+
+

bool PropList::propExist(const char* name )

+
+

 

+
+

 

+
+

 

+
+

bool PropList::propExist(const H5std_string& name )

+
+

 

+
+

 

+
+

 

+
+

H5Pencode

+
+

void DataType::encode()

+
+

 

+
+

 

+
+

 

+
+

H5Pdecode

+
+

virtual DataType* DataType::decode()

+

virtual DataType* ArrayType::decode()

+

virtual DataType* CompType::decode()

+

virtual DataType* DataType::decode()

+

virtual DataType* EnumType::decode()

+

virtual DataType* FloatType::decode()

+

virtual DataType* IntType::decode()

+

virtual DataType* StrType::decode()

+

virtual DataType* VarLenType::decode()

+
+

 

+
+

 

+
+

 

+
+

H5Pget_size

+
+

size_t PropList::getPropSize(const char *name)

+
+

 

+
+

 

+
+

 

+
+

size_t PropList::getPropSize(const H5std_string& name)

+
+

H5Pget_nprops

+
+

size_t PropList::getNumProps()

+
+

 

+
+

 

+
+

 

+
+

H5Pget_class

+
+

hid_t PropList::getClass()

+
+

 

+
+

 

+
+

 

+
+

H5Pget_class_parent

+
+

PropList PropList::getClassParent()

+
+

 

+
+

 

+
+

 

+
+

H5Pget

+
+

void PropList::getProperty(const char* name, void* value)

+
+

 

+
+

 

+
+

 

+
+

H5std_string PropList::getProperty(const char* name)

+
+

void PropList::getProperty(const H5std_string& name, void* va= +lue)

+
+

H5std_string PropList::getProperty(const H5std_string& name)<= +/p> +

+

H5Pequal

+
+

bool PropList::operator=3D=3D(const PropList& rhs)

+
+

 

+
+

 

+
+

 

+
+

H5Pisa_class

+
+

bool PropList::isAClass(const PropList& prop_class)

+
+

 

+
+

 

+
+

 

+
+

H5Piterate

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pcopy_prop

+
+

void PropList::copyProp(PropList& dest, const char *name)

+
+

 

+
+

 

+
+

 

+
+

void PropList::copyProp( PropList& dest, const H5std_string&a= +mp; + name )

+
+

void PropList::copyProp( PropList& dest, PropList& src, c= +onst + char *name )

+
+

void PropList::copyProp( PropList& dest, PropList& src, c= +onst + H5std_string& name )

+
+

H5Premove

+
+

void PropList::removeProp(const char *name)

+
+

 

+
+

 

+
+

 

+
+

void PropList::removeProp(const H5std_string& name)

+
+

H5Punregister

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pclose_class

+
+

void PropList::closeClass()

+
+

 

+
+

 

+
+

 

+
+

H5Pclose

+
+

void PropList::close()

+
+

 

+
+

 

+
+

 

+
+

PropList destructor

+
+

 

+
+

 

+
+

 

+
+

H5Pcopy

+
+

void PropList::copy( const PropList& like_plist )

+
+

 

+
+

 

+
+

 

+
+

H5Pset_attr_phase_change

+
+

void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact = +=3D 8, + unsigned min_dense =3D 6)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_attr_phase_change

+
+

void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compa= +ct, + unsigned& min_dense)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_attr_creation_order

+
+

void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags)<= +/p> +

+

 

+
+

 

+
+

 

+
+

H5Pget_attr_creation_order

+
+

unsigned ObjCreatPropList::getAttrCrtOrder()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_obj_track_times

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_obj_track_times

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pmodify_filter

+
+

void modifyFilter(H5Z_filter_t filter_id, unsigned int flags, siz= +e_t + cd_nelmts, const unsigned int cd_values[])

+
+

 

+
+

 

+
+

 

+
+

H5Pset_filter

+
+

void DSetCreatPropList::setFilter(H5Z_filter_t filter_id, unsigned + int flags,

+

        size_t cd_nelmts,= + const + unsigned int cd_values[])

+
+

 

+
+

 

+
+

 

+
+

H5Pget_nfilters

+
+

int DSetCreatPropList::getNfilters()

+
+

 

+
+

 

+
+

 

+
+

H5Pget_filter2

+
+

H5Z_filter_t DSetCreatPropList::getFilter(int filter_number,

+

        unsigned int + &flags, size_t &cd_nelmts, unsigned int* cd_values,

+

        size_t namelen, c= +har + name[], unsigned int& filter_config)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_filter_by_id2

+
+

void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id,

+

        unsigned int + &flags, size_t &cd_nelmts, unsigned int* cd_values,

+

        size_t namelen, c= +har + name[], unsigned int &filter_config)

+
+

 

+
+

 

+
+

 

+
+

H5Pall_filters_avail

+
+

bool DSetCreatPropList::allFiltersAvail()

+
+

 

+
+

 

+
+

 

+
+

H5Premove_filter

+
+

void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_deflate

+
+

void DSetCreatPropList::setDeflate(int level)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fletcher32

+
+

void DSetCreatPropList::setFletcher32()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_userblock

+
+

void FileCreatPropList::setUserblock(hsize_t size)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_userblock

+
+

hsize_t FileCreatPropList::getUserblock()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_sizes

+
+

void FileCreatPropList::setSizes(size_t sizeof_addr, size_t + sizeof_size)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_sizes

+
+

void FileCreatPropList::getSizes(size_t& sizeof_addr, size_t&= +amp; + sizeof_size)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_sym_k

+
+

void FileCreatPropList::setSymk(unsigned ik, unsigned lk)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_sym_k

+
+

void FileCreatPropList::getSymk(unsigned& ik, unsigned& l= +k)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_istore_k

+
+

void FileCreatPropList::setIstorek(unsigned ik)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_istore_k

+
+

unsigned FileCreatPropList::getIstorek()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_shared_mesg_nindexes

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_shared_mesg_nindexes

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_shared_mesg_index

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_shared_mesg_index

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_shared_mesg_phase_change

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_shared_mesg_phase_change

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_file_space

+
+

void FileCreatPropList::setFileSpaceStrategy(H5F_fspace_strategy_t + strategy, hbool_t persist, hsize_t threshold)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_file_space

+
+

void + FileCreatPropList::getFileSpaceStrategy(H5F_fspace_strategy_t& strate= +gy, + hbool_t& persist, hsize_t& threshold)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_alignment

+
+

void FileAccPropList::setAlignment(hsize_t threshold, hsize_t + alignment)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_alignment

+
+

void FileAccPropList::getAlignment(hsize_t &threshold, hsize_t + &alignment)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_driver

+
+

void FileAccPropList::setDriver(hid_t new_driver_id, const void + *new_driver_info)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_driver

+
+

hid_t FileAccPropList::getDriver()

+
+

 

+
+

 

+
+

 

+
+

H5Pget_driver_info

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_family_offset

+
+

void FileAccPropList::setFamilyOffset(hsize_t offset)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_family_offset

+
+

hsize_t FileAccPropList::getFamilyOffset()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_multi_type

+
+

void FileAccPropList::setMultiType(H5FD_mem_t dtype)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_multi_type

+
+

H5FD_mem_t FileAccPropList::getMultiType()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_cache

+
+

void FileAccPropList::setCache(int mdc_nelmts, size_t rdcc_nelmts, + size_t rdcc_nbytes, double rdcc_w0)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_cache

+
+

void FileAccPropList::getCache(int& mdc_nelmts, size_t& + rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_mdc_config

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_mdc_config

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_gc_references

+
+

void FileAccPropList::setGcReferences(unsigned gc_ref)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_gc_references

+
+

unsigned FileAccPropList::getGcReferences()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fclose_degree

+
+

void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree)<= +/p> +

+

 

+
+

 

+
+

 

+
+

H5Pget_fclose_degree

+
+

H5F_close_degree_t FileAccPropList::getFcloseDegree()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_meta_block_size

+
+

void FileAccPropList::setMetaBlockSize(hsize_t &block_size) +

+

 

+
+

 

+
+

 

+
+

H5Pget_meta_block_size

+
+

hsize_t FileAccPropList::getMetaBlockSize()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_sieve_buf_size

+
+

void FileAccPropList::setSieveBufSize(size_t bufsize)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_sieve_buf_size

+
+

size_t FileAccPropList::getSieveBufSize()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_small_data_block_size

+
+

void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_small_data_block_size

+
+

hsize_t DSetMemXferPropList::getSmallDataBlockSize()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_libver_bounds

+
+

void FileAccPropList::setLibverBounds(H5F_libver_t libver_low, + H5F_libver_t libver_high)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_libver_bounds

+
+

void FileAccPropList::getLibverBounds(H5F_libver_t& libver_lo= +w, H5F_libver_t& + libver_high)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_elink_file_cache_size

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_elink_file_cache_size

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_elink_file_cache_size

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_file_image

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_file_image

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_file_image_callbacks

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_file_image_callbacks

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Pset_core_write_tracking

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_core_write_tracking

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Pset_layout

+
+

void DSetCreatPropList::setLayout(H5D_layout_t layout)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_layout

+
+

H5D_layout_t DSetCreatPropList::getLayout()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_chunk

+
+

void DSetCreatPropList::setChunk(int ndims, const hsize_t* dim) +

+

 

+
+

 

+
+

 

+
+

H5Pget_chunk

+
+

int DSetCreatPropList::getChunk(int max_ndims, hsize_t* dim)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_external

+
+

void DSetCreatPropList::setExternal(const char* name, off_t offse= +t, + hsize_t size)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_external_count

+
+

int DSetCreatPropList::getExternalCount

+
+

 

+
+

 

+
+

 

+
+

H5Pget_external

+
+

void DSetCreatPropList::getExternal(unsigned idx, size_t name_siz= +e, + char* name, off_t& offset, hsize_t& size)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_szip

+
+

void DSetCreatPropList::setSzip(unsigned int options_mask, unsign= +ed + int pixels_per_block)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_shuffle

+
+

void DSetCreatPropList::setShuffle()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_nbit

+
+

void DSetCreatPropList::setNbit()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_scaleoffset

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fill_value

+
+

void DSetCreatPropList::setFillValue(const DataType& fvalue_t= +ype, + const void* value)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_fill_value

+
+

void DSetCreatPropList::getFillValue(const DataType& fvalue_t= +ype, + void* value)

+
+

 

+
+

 

+
+

 

+
+

H5Pfill_value_defined

+
+

H5D_fill_value_t DSetCreatPropList::isFillValueDefined()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_alloc_time

+
+

void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time)= +

+
+

 

+
+

 

+
+

 

+
+

H5Pget_alloc_time

+
+

H5D_alloc_time_t DSetCreatPropList::getAllocTime()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fill_time

+
+

void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_fill_time

+
+

H5D_fill_time_t DSetCreatPropList::getFillTime()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_chunk_cache

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_chunk_cache

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_data_transform

+
+

void DSetMemXferPropList::setDataTransform(const char* expression= +)

+

void DSetMemXferPropList::setDataTransform(const H5std_string& + expression)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_data_transform

+
+

ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t + buf_size)

+

H5std_string DSetMemXferPropList::getDataTransform()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_buffer

+
+

void DSetMemXferPropList::setBuffer(size_t size, void* tconv, voi= +d* + bkg)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_buffer

+
+

size_t DSetMemXferPropList::getBuffer(void** tconv, void** bkg) +

+

 

+
+

 

+
+

 

+
+

H5Pset_preserve

+
+

void DSetMemXferPropList::setPreserve(bool status)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_preserve

+
+

bool DSetMemXferPropList::getPreserve()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_edc_check

+
+

void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check)

+
+

 

+
+

 

+
+

 

+
+

H5Z_EDC_t H5Pget_edc_check

+
+

H5Z_EDC_t DSetMemXferPropList::getEDCCheck()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_filter_callback

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_btree_ratios

+
+

void DSetMemXferPropList::setBtreeRatios(double left, double midd= +le, + double right)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_btree_ratios

+
+

void DSetMemXferPropList::getBtreeRatios(double& left, + double& middle, double& right)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_vlen_mem_manager

+
+

void DSetMemXferPropList::setVlenMemManager()

+

void DSetMemXferPropList::setVlenMemManager(H5MM_allocate_t + alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_vlen_mem_manager

+
+

void DSetMemXferPropList::getVlenMemManager(H5MM_allocate_t& + alloc_func, void** alloc_info, H5MM_free_t& free_func, void** free_in= +fo)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_hyper_vector_size

+
+

void DSetMemXferPropList::setHyperVectorSize(size_t vector_size)<= +/p> +

+

 

+
+

 

+
+

 

+
+

H5Pget_hyper_vector_size

+
+

size_t DSetMemXferPropList::getHyperVectorSize()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_type_conv_cb

+
+

void DSetMemXferPropList::setTypeConvCB(H5T_conv_except_func_t op, + void *user_data)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_type_conv_cb

+
+

void DSetMemXferPropList::getTypeConvCB(H5T_conv_except_func_t *o= +p, + void **user_data)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_create_intermediate_group

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_create_intermediate_group

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_local_heap_size_hint

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_local_heap_size_hint

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_link_phase_change

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_link_phase_change

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_est_link_info

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_est_link_info

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_link_creation_order

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_link_creation_order

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_char_encoding

+
+

ASAP

+
+

 

+
+

 

+
+

 

+
+

H5Pget_char_encoding

+
+

ASAP

+
+

 

+
+

 

+
+

 

+
+

H5Pset_nlinks

+
+

void LinkAccPropList::setNumLinks(size_t nlinks)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_nlinks

+
+

size_t LinkAccPropList::getNumLinks()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_elink_prefix

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_elink_prefix

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_elink_fapl

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_elink_fapl

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_elink_acc_flags

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_elink_acc_flags

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_elink_cb

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_elink_cb

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Pset_copy_object

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_copy_object

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Padd_merge_committed_dtype_path

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pfree_merge_committed_dtype_paths

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_mcdt_search_cb

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_mcdt_search_cb

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5open

+
+

void H5Library::open()

+
+

 

+
+

 

+
+

 

+
+

H5close

+
+

void H5Library::close()

+
+

 

+
+

 

+
+

 

+
+

H5dont_atexit

+
+

void H5Library::dontAtExit()

+
+

 

+
+

 

+
+

 

+
+

H5garbage_collect

+
+

void H5Library::garbageCollect()

+
+

 

+
+

 

+
+

 

+
+

H5set_free_list_limits

+
+

void H5Library::setFreeListLimits(int reg_global_lim, int reg_lis= +t_lim,

+

        int arr_global_li= +m, int + arr_list_lim, int blk_global_lim,

+

        int blk_list_lim)= +

+
+

 

+
+

 

+
+

 

+
+

H5get_libversion

+
+

void H5Library::getLibVersion(unsigned& majnum, unsigned& + minnum, unsigned& relnum)

+
+

 

+
+

 

+
+

 

+
+

H5check_version

+
+

void H5Library::checkVersion(unsigned majnum, unsigned minnum, + unsigned relnum)

+
+

 

+
+

 

+
+

 

+
+

H5free_memory

+
+

No wrapper

+
+

 

+
+

 

+
+

 

+
+

H5allocate_memory

+
+

No wrapper

+
+

 

+
+

 

+
+

 

+
+

H5resize_memory

+
+

No wrapper

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Rcreate

+
+

void H5Location::reference(void* ref, const char* name, const Dat= +aSpace& + dataspace, H5R_type_t ref_type)

+
+

 

+
+

 

+
+

 

+
+

void H5Location::reference(void* ref, const H5std_string& nam= +e, + const DataSpace& dataspace, H5R_type_t ref_type)

+
+

void H5Location::reference(void* ref, const char* name, H5R_type_t + ref_type)

+
+

void H5Location::reference(void* ref, const H5std_string& nam= +e, + H5R_type_t ref_type)

+
+

H5Rdereference2

+
+

DataSet::DataSet(const H5Location& loc, const void* ref, + H5R_type_t ref_type)

+

 

+
+

 

+
+

 

+
+

 

+
+

H5Rget_region

+
+

DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) +

+

 

+
+

 

+
+

 

+
+

H5Rget_obj_type2

+
+

H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_ty= +pe)

+
+

 

+
+

 

+
+

 

+
+

H5Rget_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Rg= +et_obj_type1

+
+

Should remove from code

+
+

 

+
+

 

+
+

 

+
+

H5Rd= +ereference1

+
+

Removed

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Screate

+
+

DataSpace::DataSpace(H5S_class_t type)

+
+

 

+
+

 

+
+

 

+
+

H5Screate_simple

+
+

DataSpace::DataSpace(int rank, const hsize_t * dims, const hsize_= +t * + maxdims)

+
+

 

+
+

 

+
+

 

+
+

H5Sset_extent_simple

+
+

void DataSpace::setExtentSimple(int rank, const hsize_t + *current_size, const hsize_t *maximum_size)

+
+

 

+
+

 

+
+

 

+
+

H5Scopy

+
+

void DataSpace::copy(const DataSpace& like_space)

+
+

 

+
+

 

+
+

 

+
+

H5Sclose

+
+

void DataSpace::close()

+
+

 

+
+

 

+
+

 

+
+

H5Sencode

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Sdecode

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Sget_simple_extent_npoints

+
+

hssize_t DataSpace::getSimpleExtentNpoints

+
+

 

+
+

 

+
+

 

+
+

H5Sget_simple_extent_ndims

+
+

int DataSpace::getSimpleExtentNdims ()

+
+

 

+
+

 

+
+

 

+
+

H5Sget_simple_extent_dims

+
+

int DataSpace::getSimpleExtentDims (hsize_t *dims, hsize_t *maxdi= +ms)

+
+

 

+
+

 

+
+

 

+
+

H5Sis_simple

+
+

bool DataSpace::isSimple ()

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_npoints

+
+

hssize_t DataSpace::getSelectNpoints ()

+
+

 

+
+

 

+
+

 

+
+

H5Sselect_hyperslab

+
+

void DataSpace::selectHyperslab(H5S_seloper_t op, const hsize_t + *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block= +)

+
+

 

+
+

 

+
+

 

+
+

H5Sselect_elements

+
+

void DataSpace::selectElements (H5S_seloper_t op, const size_t nu= +m_elements, + const hsize_t *coord)

+
+

 

+
+

 

+
+

 

+
+

H5Sget_simple_extent_type

+
+

H5S_class_t DataSpace::getSimpleExtentType ()

+
+

 

+
+

 

+
+

 

+
+

H5Sset_extent_none

+
+

void DataSpace::setExtentNone ()

+
+

 

+
+

 

+
+

 

+
+

H5Sextent_copy

+
+

void DataSpace::extentCopy (const DataSpace& dest_space)

+
+

 

+
+

 

+
+

 

+
+

H5Sextent_equal

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Sselect_all

+
+

void DataSpace::selectAll ()

+
+

 

+
+

 

+
+

 

+
+

H5Sselect_none

+
+

void DataSpace::selectNone ()

+
+

 

+
+

 

+
+

 

+
+

H5Soffset_simple

+
+

void DataSpace::offsetSimple (const hssize_t* offset)

+
+

 

+
+

 

+
+

 

+
+

H5Sselect_valid

+
+

bool DataSpace::selectValid ()

+
+

 

+
+

 

+
+

 

+
+

H5Sis_regular_hyperslab

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Sget_regular_hyperslab

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_hyper_nblocks

+
+

hssize_t DataSpace::getSelectHyperNblocks ()

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_elem_npoints

+
+

hssize_t DataSpace::getSelectElemNpoints ()

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_hyper_blocklist

+
+

void DataSpace::getSelectHyperBlocklist(hsize_t startblock, hsize= +_t + numblocks, hsize_t *buf)

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_elem_pointlist

+
+

void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize= +_t + numpoints, hsize_t *buf)

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_bounds

+
+

void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end)

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_type

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Tcreate

+
+

DataType::DataType(const H5T_class_t type_class, size_t size)

+
+

 

+
+

 

+
+

 

+
+

H5Tcopy

+
+

DataType::DataType(const PredType& pred_type)

+
+

 

+
+

 

+
+

 

+
+

void DataType::copy(const DataType& like_type)

+
+

 

+
+

 

+
+

 

+
+

void DataType::copy(const DataSet& dset)

+
+

 

+
+

 

+
+

 

+
+

H5Tclose

+
+

void DataType::close()

+
+

 

+
+

 

+
+

 

+
+

DataType destructor

+
+

 

+
+

 

+
+

 

+
+

H5Tequal

+
+

bool DataType::operator=3D=3D(const DataType& compared_type)<= +/p> +

+

 

+
+

 

+
+

 

+
+

H5Tlock

+
+

void DataType::lock()

+
+

 

+
+

 

+
+

 

+
+

H5Tcommit2

+
+

void DataType::commit(const H5Location& loc, const char* name= +)

+
+

 

+
+

 

+
+

 

+
+

void DataType::commit(const H5Location& loc, const + H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

H5Topen2

+
+

DataType CommonFG::openDataType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

DataType CommonFG::openDataType(const H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

ArrayType CommonFG::openArrayType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

ArrayType CommonFG::openArrayType(const H5std_string& name) +

+

 

+
+

 

+
+

 

+
+

CompType CommonFG::openCompType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

CompType CommonFG::openCompType(const H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

EnumType CommonFG::openEnumType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

EnumType CommonFG::openEnumType(const H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

IntType CommonFG::openIntType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

IntType CommonFG::openIntType(const H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

FloatType CommonFG::openFloatType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

FloatType CommonFG::openFloatType(const H5std_string& name) +

+

 

+
+

 

+
+

 

+
+

StrType CommonFG::openStrType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

StrType CommonFG::openStrType(const H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

VarLenType CommonFG::openVarLenType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

VarLenType CommonFG::openVarLenType(const H5std_string& name)= +

+
+

 

+
+

 

+
+

 

+
+

H5Tcommit_anon

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Tget_create_plist

+
+

PropList DataType::getCreatePlist()

+
+

 

+
+

 

+
+

 

+
+

H5Tcommitted

+
+

bool DataType::committed()

+
+

 

+
+

 

+
+

 

+
+

H5Tencode

+
+

void DataType::encode()

+
+

 

+
+

 

+
+

 

+
+

H5Tdecode

+
+

virtual DataType* DataType::decode() const;

+

virtual DataType* ArrayType::decode() const;

+

virtual DataType* CompType::decode() const;

+

virtual DataType* DataType::decode() const;

+

virtual DataType* EnumType::decode() const;

+

virtual DataType* FloatType::decode() const;

+

virtual DataType* IntType::decode() const;

+

virtual DataType* StrType::decode() const;

+

virtual DataType* VarLenType::decode() const;

+
+

 

+
+

 

+
+

 

+
+

H5Tinsert

+
+

void CompType::insertMember(const H5std_string& name, size_t + offset, const DataType& new_member)

+
+

 

+
+

 

+
+

 

+
+

H5Tpack

+
+

void CompType::pack()

+
+

 

+
+

 

+
+

 

+
+

H5Tenum_create

+
+

EnumType::EnumType(const IntType& data_type)

+
+

 

+
+

 

+
+

 

+
+

H5Tenum_insert

+
+

void EnumType::insert(const char* name, void *value)

+
+

 

+
+

 

+
+

 

+
+

H5Tenum_nameof

+
+

H5std_string EnumType::nameOf(void *value, size_t size)

+
+

 

+
+

 

+
+

 

+
+

H5Tenum_valueof

+
+

void EnumType::valueOf(const char* name, void *value)

+
+

 

+
+

 

+
+

 

+
+

H5Tvlen_create

+
+

VarLenType::VarLenType(const DataType* base_type)

+
+

 

+
+

 

+
+

 

+
+

H5Tarray_create2

+
+

ArrayType::ArrayType(const DataType& base_type, int ndims, co= +nst + hsize_t* dims)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_array_ndims

+
+

int ArrayType::getArrayNDims()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_array_dims2

+
+

int ArrayType::getArrayDims(hsize_t* dims)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_tag

+
+

void DataType::setTag(const char* tag)

+
+

 

+
+

 

+
+

 

+
+

void DataType::setTag(const H5std_string& tag)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_tag

+
+

H5std_string DataType::getTag()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_super

+
+

DataType DataType::getSuper()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_class

+
+

H5T_class_t DataType::getClass()

+
+

 

+
+

 

+
+

 

+
+

H5Tdetect_class

+
+

bool DataType::detectClass(H5T_class_t cls)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_size

+
+

size_t DataType::getSize()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_order

+
+

H5T_order_t AtomType::getOrder()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_precision

+
+

size_t AtomType::getPrecision()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_offset

+
+

int AtomType::getOffset()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_pad

+
+

void AtomType::getPad(H5T_pad_t& lsb, H5T_pad_t& msb)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_sign

+
+

H5T_sign_t IntType::getSign()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_fields

+
+

void FloatType::getFields(size_t& spos, size_t& epos, + size_t& esize, size_t& mpos, size_t& msize)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_ebias

+
+

size_t FloatType::getEbias()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_norm

+
+

H5T_norm_t FloatType::getNorm(H5std_string& norm_string)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_inpad

+
+

H5T_pad_t FloatType::getInpad(H5std_string& pad_string)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_strpad

+
+

H5T_str_t StrType::getStrpad()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_nmembers

+
+

int CompType::getNmembers()

+
+

 

+
+

 

+
+

 

+
+

int EnumType::getNmembers()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_member_name

+
+

H5std_string CompType::getMemberName(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_member_index

+
+

int CompType::getMemberIndex(const char* name)

+
+

 

+
+

 

+
+

 

+
+

int CompType::getMemberIndex(const H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_member_offset

+
+

size_t CompType::getMemberOffset(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_member_class

+
+

H5T_class_t CompType::getMemberClass(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_member_type

+
+

DataType CompType::getMemberDataType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

ArrayType CompType::getMemberArrayType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

CompType CompType::getMemberCompType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

EnumType CompType::getMemberEnumType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

IntType CompType::getMemberIntType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

FloatType CompType::getMemberFloatType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

StrType CompType::getMemberStrType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

VarLenType CompType::getMemberVarLenType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_member_value

+
+

void EnumType::getMemberValue(unsigned memb_no, void *value)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_cset

+
+

H5T_cset_t StrType::getCset()

+
+

 

+
+

 

+
+

 

+
+

H5Tis_variable_str

+
+

bool DataType::isVariableStr()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_native_type

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Tset_size

+
+

void AtomType::setSize(size_t size)

+
+

 

+
+

 

+
+

 

+
+

void CompType::setSize(size_t size)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_order

+
+

void AtomType::setOrder(H5T_order_t order)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_precision

+
+

void AtomType::setPrecision(size_t precision)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_offset

+
+

void AtomType::setOffset(size_t offset)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_pad

+
+

void AtomType::setPad(H5T_pad_t lsb, H5T_pad_t msb)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_sign

+
+

void IntType::setSign(H5T_sign_t sign)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_fields

+
+

void FloatType::setFields(size_t spos, size_t epos, size_t esize, + size_t mpos, size_t msize)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_ebias

+
+

void FloatType::setEbias(size_t ebias)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_norm

+
+

void FloatType::setNorm(H5T_norm_t norm)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_inpad

+
+

void FloatType::setInpad(H5T_pad_t inpad)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_cset

+
+

void StrType::setCset(H5T_cset_t cset)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_strpad

+
+

void StrType::setStrpad(H5T_str_t strpad)

+
+

 

+
+

 

+
+

 

+
+

H5Tregister

+
+

void DataType::registerFunc(H5T_pers_t pers, const char* name, co= +nst + DataType& dest, H5T_conv_t func)

+
+

 

+
+

 

+
+

 

+
+

H5Tunregister

+
+

void DataType::unregister(H5T_pers_t pers, const char* name, const + DataType& dest, H5T_conv_t func)

+
+

 

+
+

 

+
+

 

+
+

H5Tfind

+
+

H5T_conv_t DataType::find(const DataType& dest, H5T_cdata_t + **pcdata)

+
+

 

+
+

 

+
+

 

+
+

H5Tcompiler_conv

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Tconvert

+
+

void DataType::convert(const DataType& dest, size_t nelmts, v= +oid + *buf, void *background, const PropList& plist)

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+ +

 

+ +

 

+ +
+ + + + + +------=_NextPart_01D32FBF.F2FA1110 +Content-Location: file:///C:/25114090/C2Cppfunction_map_files/themedata.thmx +Content-Transfer-Encoding: base64 +Content-Type: application/vnd.ms-officetheme + +UEsDBBQABgAIAAAAIQDp3g+//wAAABwCAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbKyRy07DMBBF +90j8g+UtSpyyQAgl6YLHjseifMDImSQWydiyp1X790zSVEKoIBZsLNkz954743K9Hwe1w5icp0qv +8kIrJOsbR12l3zdP2a1WiYEaGDxhpQ+Y9Lq+vCg3h4BJiZpSpXvmcGdMsj2OkHIfkKTS+jgCyzV2 +JoD9gA7NdVHcGOuJkTjjyUPX5QO2sB1YPe7l+Zgk4pC0uj82TqxKQwiDs8CS1Oyo+UbJFkIuyrkn +9S6kK4mhzVnCVPkZsOheZTXRNajeIPILjBLDsAyJX89nIBkt5r87nons29ZZbLzdjrKOfDZezE7B +/xRg9T/oE9PMf1t/AgAA//8DAFBLAwQUAAYACAAAACEApdan58AAAAA2AQAACwAAAF9yZWxzLy5y +ZWxzhI/PasMwDIfvhb2D0X1R0sMYJXYvpZBDL6N9AOEof2giG9sb69tPxwYKuwiEpO/3qT3+rov5 +4ZTnIBaaqgbD4kM/y2jhdj2/f4LJhaSnJQhbeHCGo3vbtV+8UNGjPM0xG6VItjCVEg+I2U+8Uq5C +ZNHJENJKRds0YiR/p5FxX9cfmJ4Z4DZM0/UWUtc3YK6PqMn/s8MwzJ5PwX+vLOVFBG43lExp5GKh +qC/jU72QqGWq1B7Qtbj51v0BAAD//wMAUEsDBBQABgAIAAAAIQBreZYWgwAAAIoAAAAcAAAAdGhl +bWUvdGhlbWUvdGhlbWVNYW5hZ2VyLnhtbAzMTQrDIBBA4X2hd5DZN2O7KEVissuuu/YAQ5waQceg +0p/b1+XjgzfO3xTVm0sNWSycBw2KZc0uiLfwfCynG6jaSBzFLGzhxxXm6XgYybSNE99JyHNRfSPV +kIWttd0g1rUr1SHvLN1euSRqPYtHV+jT9yniResrJgoCOP0BAAD//wMAUEsDBBQABgAIAAAAIQCq +UiXfxgYAAIsaAAAWAAAAdGhlbWUvdGhlbWUvdGhlbWUxLnhtbOxZXYvbRhR9L/Q/CL07/pL8scQb +bNnOttlNQuyk5HFsj63JjjRGM96NCYGSPBYKpWnpQwN960NpG0igL+mv2TalTSF/oXdGtjxjj7ub +JYWlZA2LNDr3zpl7r84dSZev3I+oc4QTTljccIuXCq6D4yEbkXjScG/3u7ma63CB4hGiLMYNd465 +e2X3ww8uox0R4gg7YB/zHdRwQyGmO/k8H8Iw4pfYFMdwbcySCAk4TSb5UYKOwW9E86VCoZKPEIld +J0YRuL0xHpMhdvrSpbu7dN6hcBoLLgeGNOlJ19iwUNjRYVEi+JwHNHGOEG24MM+IHffxfeE6FHEB +FxpuQf25+d3LebSzMKJii61m11V/C7uFweiwpOZMJoNsUs/zvUoz868AVGziOtVOpVPJ/CkAGg5h +pSkX3affqrfa/gKrgdJDi+92tV0uGnjNf3mDc9OXPwOvQKl/bwPf7QYQRQOvQCne38B7XrUUeAZe +gVJ8ZQNfLTTbXtXAK1BISXy4gS74lXKwXG0GGTO6Z4XXfa9bLS2cr1BQDVl1ySnGLBbbai1C91jS +BYAEUiRI7Ij5FI/REKo4QJQMEuLsk0kIhTdFMeMwXCgVuoUy/Jc/Tx2piKAdjDRryQuY8I0hycfh +w4RMRcP9GLy6GuTNyx/fvHzunDx6cfLol5PHj08e/Zw6Mqz2UDzRrV5//8XfTz91/nr+3esnX9nx +XMf//tNnv/36pR0IK12F4NXXz/548ezVN5//+cMTC7yZoIEO75MIc+c6PnZusQgWpkJgMseD5O0s ++iEiukUznnAUIzmLxX9HhAb6+hxRZMG1sBnBOwlIjA14dXbPINwLk5kgFo/XwsgAHjBGWyyxRuGa +nEsLc38WT+yTJzMddwuhI9vcAYqN/HZmU9BWYnMZhNigeZOiWKAJjrFw5DV2iLFldXcJMeJ6QIYJ +42wsnLvEaSFiDUmfDIxqWhntkQjyMrcRhHwbsTm447QYta26jY9MJNwViFrI9zE1wngVzQSKbC77 +KKJ6wPeRCG0ke/NkqOM6XECmJ5gypzPCnNtsbiSwXi3p10Be7Gk/oPPIRCaCHNp87iPGdGSbHQYh +iqY2bI/EoY79iB9CiSLnJhM2+AEz7xB5DnlA8dZ03yHYSPfpanAblFWntCoQeWWWWHJ5FTOjfntz +OkZYSQ0Iv6HnEYlPFfc1Wff/W1kHIX317VPLqi6qoDcTYr2j9tZkfBtuXbwDlozIxdfuNprFNzHc +LpsN7L10v5du938v3dvu53cv2CuNBvmWW8V0q6427tHWffuYUNoTc4r3udq6c+hMoy4MSjv1zIqz +57hpCIfyToYJDNwkQcrGSZj4hIiwF6Ip7O+LrnQy4QvXE+5MGYdtvxq2+pZ4OosO2Ch9XC0W5aNp +Kh4cidV4wc/G4VFDpOhKdfUIlrlXbCfqUXlJQNq+DQltMpNE2UKiuhyUQVIP5hA0Cwm1snfCom5h +UZPul6naYAHUsqzA1smBDVfD9T0wASN4okIUj2Se0lQvs6uS+S4zvS2YRgXAPmJZAatM1yXXrcuT +q0tL7QyZNkho5WaSUJFRPYyHaIQX1SlHz0LjbXNdX6XUoCdDoeaD0lrRqNb+jcV5cw1269pAY10p +aOwcN9xK2YeSGaJpwx3DYz8cRlOoHS63vIhO4N3ZUCTpDX8eZZkmXLQRD9OAK9FJ1SAiAicOJVHD +lcvP0kBjpSGKW7EEgnBhydVBVi4aOUi6mWQ8HuOh0NOujchIp6eg8KlWWK8q8/ODpSWbQbp74ejY +GdBZcgtBifnVogzgiHB4+1NMozki8DozE7JV/a01poXs6u8TVQ2l44hOQ7ToKLqYp3Al5RkddZbF +QDtbrBkCqoVk0QgHE9lg9aAa3TTrGimHrV33dCMZOU00Vz3TUBXZNe0qZsywbANrsTxfk9dYLUMM +mqZ3+FS61yW3vtS6tX1C1iUg4Fn8LF33DA1Bo7aazKAmGW/KsNTsxajZO5YLPIXaWZqEpvqVpdu1 +uGU9wjodDJ6r84PdetXC0Hi5r1SRVt899E8TbHAPxKMNL4FnVHCVSvjwkCDYEPXUniSVDbhF7ovF +rQFHziwhDfdBwW96QckPcoWa38l5Za+Qq/nNcq7p++Vixy8W2q3SQ2gsIoyKfvrNpQuvouh88eVF +jW98fYmWb9suDVmUZ+rrSl4RV19fiqXtX18cAqLzoFLq1sv1ViVXLze7Oa/dquXqQaWVa1eCarvb +DvxavfvQdY4U2GuWA6/SqeUqxSDIeZWCpF+r56peqdT0qs1ax2s+XGxjYOWpfCxiAeFVvHb/AQAA +//8DAFBLAwQUAAYACAAAACEADdGQn7YAAAAbAQAAJwAAAHRoZW1lL3RoZW1lL19yZWxzL3RoZW1l +TWFuYWdlci54bWwucmVsc4SPTQrCMBSE94J3CG9v07oQkSbdiNCt1AOE5DUNNj8kUeztDa4sCC6H +Yb6ZabuXnckTYzLeMWiqGgg66ZVxmsFtuOyOQFIWTonZO2SwYIKObzftFWeRSyhNJiRSKC4xmHIO +J0qTnNCKVPmArjijj1bkIqOmQci70Ej3dX2g8ZsBfMUkvWIQe9UAGZZQmv+z/TgaiWcvHxZd/lFB +c9mFBSiixszgI5uqTATKW7q6xN8AAAD//wMAUEsBAi0AFAAGAAgAAAAhAOneD7//AAAAHAIAABMA +AAAAAAAAAAAAAAAAAAAAAFtDb250ZW50X1R5cGVzXS54bWxQSwECLQAUAAYACAAAACEApdan58AA +AAA2AQAACwAAAAAAAAAAAAAAAAAwAQAAX3JlbHMvLnJlbHNQSwECLQAUAAYACAAAACEAa3mWFoMA +AACKAAAAHAAAAAAAAAAAAAAAAAAZAgAAdGhlbWUvdGhlbWUvdGhlbWVNYW5hZ2VyLnhtbFBLAQIt +ABQABgAIAAAAIQCqUiXfxgYAAIsaAAAWAAAAAAAAAAAAAAAAANYCAAB0aGVtZS90aGVtZS90aGVt +ZTEueG1sUEsBAi0AFAAGAAgAAAAhAA3RkJ+2AAAAGwEAACcAAAAAAAAAAAAAAAAA0AkAAHRoZW1l +L3RoZW1lL19yZWxzL3RoZW1lTWFuYWdlci54bWwucmVsc1BLBQYAAAAABQAFAF0BAADLCgAAAAA= + +------=_NextPart_01D32FBF.F2FA1110 +Content-Location: file:///C:/25114090/C2Cppfunction_map_files/colorschememapping.xml +Content-Transfer-Encoding: quoted-printable +Content-Type: text/xml + + + +------=_NextPart_01D32FBF.F2FA1110 +Content-Location: file:///C:/25114090/C2Cppfunction_map_files/filelist.xml +Content-Transfer-Encoding: quoted-printable +Content-Type: text/xml; charset="utf-8" + + + + + + + +------=_NextPart_01D32FBF.F2FA1110-- diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index 0fd3a93..ff07822 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -50,6 +50,9 @@ Dataspace Interface (H5S) DataSpace Datatype Interface (H5T) DataType and subclasses \endverbatim + * + * This + * table provides a map from the C APIs to the C++ member functions. *
* \section install_sec Installation * -- cgit v0.12 From f1871c6ac48db02bd7e66f2c0df64bca50bccd90 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 18 Sep 2017 11:44:53 -0500 Subject: Updated for C2Cppfunction_map.mht --- MANIFEST | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST b/MANIFEST index 3db96cc..25a6075 100644 --- a/MANIFEST +++ b/MANIFEST @@ -392,6 +392,7 @@ ./c++/src/H5VarLenType.h ./c++/src/Makefile.am ./c++/src/RM_stylesheet.css +./c++/src/C2Cppfunction_map.mht ./c++/src/cpp_doc_config ./c++/src/h5c++.in ./c++/src/footer.html -- cgit v0.12 From 4de09ba34dcd778aa44be6fc92f917558bc0d2e1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 19 Sep 2017 10:43:54 -0500 Subject: Add chklog and chexe generation to Java autootools tests --- java/examples/datasets/runExample.sh.in | 72 ++++++++++++++++++++++++--------- java/test/junit.sh.in | 8 +++- 2 files changed, 60 insertions(+), 20 deletions(-) diff --git a/java/examples/datasets/runExample.sh.in b/java/examples/datasets/runExample.sh.in index 21c3439..a0d0e90 100644 --- a/java/examples/datasets/runExample.sh.in +++ b/java/examples/datasets/runExample.sh.in @@ -228,7 +228,9 @@ esac export LD_LIBRARY_PATH echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Alloc" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Alloc > H5Ex_D_Alloc.out) +TESTING examples.datasets.H5Ex_D_Alloc ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Alloc > H5Ex_D_Alloc.out +) if diff H5Ex_D_Alloc.out examples.datasets.H5Ex_D_Alloc.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_Alloc" else @@ -237,7 +239,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Checksum" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Checksum > H5Ex_D_Checksum.out) +TESTING examples.datasets.H5Ex_D_Checksum ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Checksum > H5Ex_D_Checksum.out +) if diff H5Ex_D_Checksum.out examples.datasets.H5Ex_D_Checksum.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_Checksum" else @@ -246,7 +250,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Chunk" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Chunk > H5Ex_D_Chunk.out) +TESTING examples.datasets.H5Ex_D_Chunk ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Chunk > H5Ex_D_Chunk.out +) if diff H5Ex_D_Chunk.out examples.datasets.H5Ex_D_Chunk.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_Chunk" else @@ -255,7 +261,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Compact" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Compact > H5Ex_D_Compact.out) +TESTING examples.datasets.H5Ex_D_Compact ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Compact > H5Ex_D_Compact.out +) if diff H5Ex_D_Compact.out examples.datasets.H5Ex_D_Compact.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_Compact" else @@ -264,7 +272,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_External" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_External > H5Ex_D_External.out) +TESTING examples.datasets.H5Ex_D_External ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_External > H5Ex_D_External.out +) if diff H5Ex_D_External.out examples.datasets.H5Ex_D_External.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_External" else @@ -273,7 +283,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_FillValue" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_FillValue > H5Ex_D_FillValue.out) +TESTING examples.datasets.H5Ex_D_FillValue ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_FillValue > H5Ex_D_FillValue.out +) if diff H5Ex_D_FillValue.out examples.datasets.H5Ex_D_FillValue.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_FillValue" else @@ -282,7 +294,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip > H5Ex_D_Gzip.out) +TESTING examples.datasets.H5Ex_D_Gzip ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip > H5Ex_D_Gzip.out +) if diff H5Ex_D_Gzip.out examples.datasets.H5Ex_D_Gzip.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_Gzip" else @@ -291,7 +305,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Hyperslab" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Hyperslab > H5Ex_D_Hyperslab.out) +TESTING examples.datasets.H5Ex_D_Hyperslab ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Hyperslab > H5Ex_D_Hyperslab.out +) if diff H5Ex_D_Hyperslab.out examples.datasets.H5Ex_D_Hyperslab.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_Hyperslab" else @@ -300,7 +316,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_ReadWrite" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_ReadWrite > H5Ex_D_ReadWrite.out) +TESTING examples.datasets.H5Ex_D_ReadWrite ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_ReadWrite > H5Ex_D_ReadWrite.out +) if diff H5Ex_D_ReadWrite.out examples.datasets.H5Ex_D_ReadWrite.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_ReadWrite" else @@ -309,7 +327,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle > H5Ex_D_Shuffle.out) +TESTING examples.datasets.H5Ex_D_Shuffle ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle > H5Ex_D_Shuffle.out +) if diff H5Ex_D_Shuffle.out examples.datasets.H5Ex_D_Shuffle.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_Shuffle" else @@ -319,7 +339,9 @@ fi if test $USE_FILTER_SZIP = "yes"; then echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Szip" - ($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Szip > H5Ex_D_Szip.out) + TESTING examples.datasets.H5Ex_D_Szip ( + $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Szip > H5Ex_D_Szip.out + ) if diff H5Ex_D_Szip.out examples.datasets.H5Ex_D_Szip.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_Szip" else @@ -329,7 +351,9 @@ if test $USE_FILTER_SZIP = "yes"; then fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedAdd" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedAdd > H5Ex_D_UnlimitedAdd.out) +TESTING examples.datasets.H5Ex_D_UnlimitedAdd ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedAdd > H5Ex_D_UnlimitedAdd.out +) if diff H5Ex_D_UnlimitedAdd.out examples.datasets.H5Ex_D_UnlimitedAdd.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_UnlimitedAdd" else @@ -338,7 +362,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedGzip" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedGzip > H5Ex_D_UnlimitedGzip.out) +TESTING examples.datasets.H5Ex_D_UnlimitedGzip ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedGzip > H5Ex_D_UnlimitedGzip.out +) if diff H5Ex_D_External.out examples.datasets.H5Ex_D_External.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_UnlimitedGzip" else @@ -347,7 +373,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedMod" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedMod > H5Ex_D_UnlimitedMod.out) +TESTING examples.datasets.H5Ex_D_UnlimitedMod ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedMod > H5Ex_D_UnlimitedMod.out +) if diff H5Ex_D_UnlimitedMod.out examples.datasets.H5Ex_D_UnlimitedMod.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_UnlimitedMod" else @@ -356,7 +384,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Nbit" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Nbit > H5Ex_D_Nbit.out) +TESTING examples.datasets.H5Ex_D_Nbit ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Nbit > H5Ex_D_Nbit.out +) if diff H5Ex_D_Nbit.out examples.datasets.H5Ex_D_Nbit.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_Nbit" else @@ -365,7 +395,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Transform" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Transform > H5Ex_D_Transform.out) +TESTING examples.datasets.H5Ex_D_Transform ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Transform > H5Ex_D_Transform.out +) if diff H5Ex_D_Transform.out examples.datasets.H5Ex_D_Transform.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_Transform" else @@ -374,7 +406,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Sofloat" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Sofloat > H5Ex_D_Sofloat.out) +TESTING examples.datasets.H5Ex_D_Sofloat ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Sofloat > H5Ex_D_Sofloat.out +) if diff H5Ex_D_Sofloat.out examples.datasets.H5Ex_D_Sofloat.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_Sofloat" else @@ -383,7 +417,9 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Soint" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Soint > H5Ex_D_Soint.out) +TESTING examples.datasets.H5Ex_D_Soint ( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Soint > H5Ex_D_Soint.out +) if diff H5Ex_D_Soint.out examples.datasets.H5Ex_D_Soint.txt > /dev/null; then echo " PASSED datasets.H5Ex_D_Soint" else diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index 32b0832..77379d0 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -190,7 +190,7 @@ CLEAN_DATAFILES_AND_BLDDIR() if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then $RM $BLDDIR/JUnit-interface.ert $RM $BLDDIR/JUnit-interface.txt - fi + fi } # Print a line-line message left justified in a field of 70 characters @@ -258,7 +258,11 @@ esac export LD_LIBRARY_PATH echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestAll" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestAll 1>$actual_ext 2>$actual_err) + # Run test. + TESTING JUnit + ( + $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestAll + ) >$actual_ext 2>$actual_err # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -- cgit v0.12 From 5eafce2e048f8cfdc7ac008648623849304fcba5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 19 Sep 2017 11:42:04 -0500 Subject: Restore previous --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6ba72d7..96ea589 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -819,7 +819,7 @@ set (H5_GENERATED_HEADERS ${HDF5_SRC_DIR}/H5overflow.h ) -option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" OFF) +option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON) if (HDF5_GENERATE_HEADERS) set_source_files_properties(${H5_GENERATED_HEADERS} PROPERTIES GENERATED TRUE) find_package (Perl) -- cgit v0.12 From 0a9bc574e8d40b51c0c1c16501d3a0365e08df91 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 19 Sep 2017 12:39:45 -0500 Subject: Fix find package process --- config/cmake/hdf5-config.cmake.in | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index 904c083..712dc05 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -158,9 +158,17 @@ foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE) set (hdf5_comp2 "hdf5_hl_f90cstub") set (hdf5_comp "hdf5_hl_fortran") endif () - list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}-${libtype}" HAVE_COMP) + if (${comp} STREQUAL "Java") + list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}" HAVE_COMP) + else () + list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}-${libtype}" HAVE_COMP) + endif () if (${HAVE_COMP} LESS 0) - set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 0) + if (${comp} STREQUAL "Java") + set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 0) + else () + set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 0) + endif () else () if (hdf5_comp2) list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp2}-${libtype}" HAVE_COMP2) @@ -171,6 +179,10 @@ foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE) string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY) set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp2}-${libtype} @HDF5_PACKAGE@::${hdf5_comp}-${libtype}) endif () + elseif (${comp} STREQUAL "Java") + set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 1) + string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_LIBRARY COMP_LIBRARY) + set (${COMP_LIBRARY} ${${COMP_LIBRARY}} hdf5::${hdf5_comp}) else () set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 1) string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY) -- cgit v0.12 From 722dedd49e0e9feedf6a7c0b4fc23044b2fdd56c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Sep 2017 09:16:55 -0500 Subject: Fix call format --- java/examples/datasets/runExample.sh.in | 54 ++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/java/examples/datasets/runExample.sh.in b/java/examples/datasets/runExample.sh.in index a0d0e90..740b07d 100644 --- a/java/examples/datasets/runExample.sh.in +++ b/java/examples/datasets/runExample.sh.in @@ -228,7 +228,8 @@ esac export LD_LIBRARY_PATH echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Alloc" -TESTING examples.datasets.H5Ex_D_Alloc ( +TESTING examples.datasets.H5Ex_D_Alloc +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Alloc > H5Ex_D_Alloc.out ) if diff H5Ex_D_Alloc.out examples.datasets.H5Ex_D_Alloc.txt > /dev/null; then @@ -239,7 +240,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Checksum" -TESTING examples.datasets.H5Ex_D_Checksum ( +TESTING examples.datasets.H5Ex_D_Checksum +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Checksum > H5Ex_D_Checksum.out ) if diff H5Ex_D_Checksum.out examples.datasets.H5Ex_D_Checksum.txt > /dev/null; then @@ -250,7 +252,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Chunk" -TESTING examples.datasets.H5Ex_D_Chunk ( +TESTING examples.datasets.H5Ex_D_Chunk +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Chunk > H5Ex_D_Chunk.out ) if diff H5Ex_D_Chunk.out examples.datasets.H5Ex_D_Chunk.txt > /dev/null; then @@ -261,7 +264,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Compact" -TESTING examples.datasets.H5Ex_D_Compact ( +TESTING examples.datasets.H5Ex_D_Compact +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Compact > H5Ex_D_Compact.out ) if diff H5Ex_D_Compact.out examples.datasets.H5Ex_D_Compact.txt > /dev/null; then @@ -272,7 +276,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_External" -TESTING examples.datasets.H5Ex_D_External ( +TESTING examples.datasets.H5Ex_D_External +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_External > H5Ex_D_External.out ) if diff H5Ex_D_External.out examples.datasets.H5Ex_D_External.txt > /dev/null; then @@ -283,7 +288,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_FillValue" -TESTING examples.datasets.H5Ex_D_FillValue ( +TESTING examples.datasets.H5Ex_D_FillValue +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_FillValue > H5Ex_D_FillValue.out ) if diff H5Ex_D_FillValue.out examples.datasets.H5Ex_D_FillValue.txt > /dev/null; then @@ -294,7 +300,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip" -TESTING examples.datasets.H5Ex_D_Gzip ( +TESTING examples.datasets.H5Ex_D_Gzip +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip > H5Ex_D_Gzip.out ) if diff H5Ex_D_Gzip.out examples.datasets.H5Ex_D_Gzip.txt > /dev/null; then @@ -305,7 +312,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Hyperslab" -TESTING examples.datasets.H5Ex_D_Hyperslab ( +TESTING examples.datasets.H5Ex_D_Hyperslab +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Hyperslab > H5Ex_D_Hyperslab.out ) if diff H5Ex_D_Hyperslab.out examples.datasets.H5Ex_D_Hyperslab.txt > /dev/null; then @@ -316,7 +324,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_ReadWrite" -TESTING examples.datasets.H5Ex_D_ReadWrite ( +TESTING examples.datasets.H5Ex_D_ReadWrite +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_ReadWrite > H5Ex_D_ReadWrite.out ) if diff H5Ex_D_ReadWrite.out examples.datasets.H5Ex_D_ReadWrite.txt > /dev/null; then @@ -327,7 +336,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle" -TESTING examples.datasets.H5Ex_D_Shuffle ( +TESTING examples.datasets.H5Ex_D_Shuffle +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle > H5Ex_D_Shuffle.out ) if diff H5Ex_D_Shuffle.out examples.datasets.H5Ex_D_Shuffle.txt > /dev/null; then @@ -339,7 +349,8 @@ fi if test $USE_FILTER_SZIP = "yes"; then echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Szip" - TESTING examples.datasets.H5Ex_D_Szip ( + TESTING examples.datasets.H5Ex_D_Szip + ( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Szip > H5Ex_D_Szip.out ) if diff H5Ex_D_Szip.out examples.datasets.H5Ex_D_Szip.txt > /dev/null; then @@ -351,7 +362,8 @@ if test $USE_FILTER_SZIP = "yes"; then fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedAdd" -TESTING examples.datasets.H5Ex_D_UnlimitedAdd ( +TESTING examples.datasets.H5Ex_D_UnlimitedAdd +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedAdd > H5Ex_D_UnlimitedAdd.out ) if diff H5Ex_D_UnlimitedAdd.out examples.datasets.H5Ex_D_UnlimitedAdd.txt > /dev/null; then @@ -362,7 +374,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedGzip" -TESTING examples.datasets.H5Ex_D_UnlimitedGzip ( +TESTING examples.datasets.H5Ex_D_UnlimitedGzip +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedGzip > H5Ex_D_UnlimitedGzip.out ) if diff H5Ex_D_External.out examples.datasets.H5Ex_D_External.txt > /dev/null; then @@ -373,7 +386,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedMod" -TESTING examples.datasets.H5Ex_D_UnlimitedMod ( +TESTING examples.datasets.H5Ex_D_UnlimitedMod +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedMod > H5Ex_D_UnlimitedMod.out ) if diff H5Ex_D_UnlimitedMod.out examples.datasets.H5Ex_D_UnlimitedMod.txt > /dev/null; then @@ -384,7 +398,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Nbit" -TESTING examples.datasets.H5Ex_D_Nbit ( +TESTING examples.datasets.H5Ex_D_Nbit +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Nbit > H5Ex_D_Nbit.out ) if diff H5Ex_D_Nbit.out examples.datasets.H5Ex_D_Nbit.txt > /dev/null; then @@ -395,7 +410,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Transform" -TESTING examples.datasets.H5Ex_D_Transform ( +TESTING examples.datasets.H5Ex_D_Transform +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Transform > H5Ex_D_Transform.out ) if diff H5Ex_D_Transform.out examples.datasets.H5Ex_D_Transform.txt > /dev/null; then @@ -406,7 +422,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Sofloat" -TESTING examples.datasets.H5Ex_D_Sofloat ( +TESTING examples.datasets.H5Ex_D_Sofloat +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Sofloat > H5Ex_D_Sofloat.out ) if diff H5Ex_D_Sofloat.out examples.datasets.H5Ex_D_Sofloat.txt > /dev/null; then @@ -417,7 +434,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Soint" -TESTING examples.datasets.H5Ex_D_Soint ( +TESTING examples.datasets.H5Ex_D_Soint +( $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Soint > H5Ex_D_Soint.out ) if diff H5Ex_D_Soint.out examples.datasets.H5Ex_D_Soint.txt > /dev/null; then -- cgit v0.12 From d901d3402ac42cbec82629b6e7436f5fa608f429 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Sep 2017 09:31:32 -0500 Subject: Add chekexe and chklog generation to tests --- java/examples/datatypes/runExample.sh.in | 54 +++++++++++++++++++++----------- java/examples/groups/runExample.sh.in | 23 +++++++++----- 2 files changed, 51 insertions(+), 26 deletions(-) diff --git a/java/examples/datatypes/runExample.sh.in b/java/examples/datatypes/runExample.sh.in index 32e9ade..590a547 100644 --- a/java/examples/datatypes/runExample.sh.in +++ b/java/examples/datatypes/runExample.sh.in @@ -224,7 +224,8 @@ esac export LD_LIBRARY_PATH echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Array" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Array > H5Ex_T_Array.out) +TESTING examples.datatypes.H5Ex_T_Array +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Array > H5Ex_T_Array.out) if diff H5Ex_T_Array.out examples.datatypes.H5Ex_T_Array.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_Array" else @@ -233,7 +234,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ArrayAttribute" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ArrayAttribute > H5Ex_T_ArrayAttribute.out) +TESTING examples.datatypes.H5Ex_T_ArrayAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ArrayAttribute > H5Ex_T_ArrayAttribute.out) if diff H5Ex_T_ArrayAttribute.out examples.datatypes.H5Ex_T_ArrayAttribute.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_ArrayAttribute" else @@ -242,7 +244,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Bit" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Bit > H5Ex_T_Bit.out) +TESTING examples.datatypes.H5Ex_T_Bit +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Bit > H5Ex_T_Bit.out) if diff H5Ex_T_Bit.out examples.datatypes.H5Ex_T_Bit.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_Bit" else @@ -251,7 +254,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_BitAttribute" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_BitAttribute > H5Ex_T_BitAttribute.out) +TESTING examples.datatypes.H5Ex_T_BitAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_BitAttribute > H5Ex_T_BitAttribute.out) if diff H5Ex_T_BitAttribute.out examples.datatypes.H5Ex_T_BitAttribute.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_BitAttribute" else @@ -260,7 +264,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Commit" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Commit > H5Ex_T_Commit.out) +TESTING examples.datasets.H5Ex_T_Commit +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Commit > H5Ex_T_Commit.out) if diff H5Ex_T_Commit.out examples.datatypes.H5Ex_T_Commit.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_Commit" else @@ -269,7 +274,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Compound" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Compound > H5Ex_T_Compound.out) +TESTING examples.datatypes.H5Ex_T_Compound +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Compound > H5Ex_T_Compound.out) if diff H5Ex_T_Compound.out examples.datatypes.H5Ex_T_Compound.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_Compound" else @@ -278,7 +284,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_CompoundAttribute" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_CompoundAttribute > H5Ex_T_CompoundAttribute.out) +TESTING examples.datatypes.H5Ex_T_CompoundAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_CompoundAttribute > H5Ex_T_CompoundAttribute.out) if diff H5Ex_T_CompoundAttribute.out examples.datatypes.H5Ex_T_CompoundAttribute.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_CompoundAttribute" else @@ -287,7 +294,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Float" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Float > H5Ex_T_Float.out) +TESTING examples.datatypes.H5Ex_T_Float +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Float > H5Ex_T_Float.out) if diff H5Ex_T_Float.out examples.datatypes.H5Ex_T_Float.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_Float" else @@ -296,7 +304,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_FloatAttribute" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_FloatAttribute > H5Ex_T_FloatAttribute.out) +TESTING examples.datatypes.H5Ex_T_FloatAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_FloatAttribute > H5Ex_T_FloatAttribute.out) if diff H5Ex_T_FloatAttribute.out examples.datatypes.H5Ex_T_FloatAttribute.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_FloatAttribute" else @@ -305,7 +314,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Integer" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Integer > H5Ex_T_Integer.out) +TESTING examples.datatypes.H5Ex_T_Integer +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Integer > H5Ex_T_Integer.out) if diff H5Ex_T_Integer.out examples.datatypes.H5Ex_T_Integer.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_Integer" else @@ -314,7 +324,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_IntegerAttribute" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_IntegerAttribute > H5Ex_T_IntegerAttribute.out) +TESTING examples.datatypes.H5Ex_T_IntegerAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_IntegerAttribute > H5Ex_T_IntegerAttribute.out) if diff H5Ex_T_IntegerAttribute.out examples.datatypes.H5Ex_T_IntegerAttribute.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_IntegerAttribute" else @@ -323,7 +334,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReference" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReference > H5Ex_T_ObjectReference.out) +TESTING examples.datatypes.H5Ex_T_ObjectReference +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReference > H5Ex_T_ObjectReference.out) if diff H5Ex_T_ObjectReference.out examples.datatypes.H5Ex_T_ObjectReference.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_ObjectReference" else @@ -332,7 +344,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReferenceAttribute" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReferenceAttribute > H5Ex_T_ObjectReferenceAttribute.out) +TESTING examples.datatypes.H5Ex_T_ObjectReferenceAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReferenceAttribute > H5Ex_T_ObjectReferenceAttribute.out) if diff H5Ex_T_ObjectReferenceAttribute.out examples.datatypes.H5Ex_T_ObjectReferenceAttribute.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_ObjectReferenceAttribute" else @@ -341,7 +354,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Opaque" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Opaque > H5Ex_T_Opaque.out) +TESTING examples.datatypes.H5Ex_T_Opaque +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Opaque > H5Ex_T_Opaque.out) if diff H5Ex_T_Opaque.out examples.datatypes.H5Ex_T_Opaque.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_Opaque" else @@ -350,7 +364,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_OpaqueAttribute" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_OpaqueAttribute > H5Ex_T_OpaqueAttribute.out) +TESTING examples.datatypes.H5Ex_T_OpaqueAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_OpaqueAttribute > H5Ex_T_OpaqueAttribute.out) if diff H5Ex_T_OpaqueAttribute.out examples.datatypes.H5Ex_T_OpaqueAttribute.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_OpaqueAttribute" else @@ -359,7 +374,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_String" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_String > H5Ex_T_String.out) +TESTING examples.datatypes.H5Ex_T_String +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_String > H5Ex_T_String.out) if diff H5Ex_T_String.out examples.datatypes.H5Ex_T_String.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_String" else @@ -368,7 +384,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_StringAttribute" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_StringAttribute > H5Ex_T_StringAttribute.out) +TESTING examples.datatypes.H5Ex_T_StringAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_StringAttribute > H5Ex_T_StringAttribute.out) if diff H5Ex_T_StringAttribute.out examples.datatypes.H5Ex_T_StringAttribute.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_StringAttribute" else @@ -377,7 +394,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_VLString" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_VLString > H5Ex_T_VLString.out) +TESTING examples.datatypes.H5Ex_T_VLString +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_VLString > H5Ex_T_VLString.out) if diff H5Ex_T_VLString.out examples.datatypes.H5Ex_T_VLString.txt > /dev/null; then echo " PASSED datatypes.H5Ex_T_VLString" else diff --git a/java/examples/groups/runExample.sh.in b/java/examples/groups/runExample.sh.in index 3732e7f..53c0045 100644 --- a/java/examples/groups/runExample.sh.in +++ b/java/examples/groups/runExample.sh.in @@ -158,7 +158,7 @@ CLEAN_DATAFILES_AND_BLDDIR() if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then SDIR=`$DIRNAME $tstfile` $RM $BLDDIR/h5ex_g_iterate.h5 $RM $BLDDIR/h5ex_g_visit.h5 - fi + fi } COPY_REFFILES="$LIST_REF_FILES" @@ -270,7 +270,8 @@ esac export LD_LIBRARY_PATH echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Create" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Create > H5Ex_G_Create.out) +TESTING examples.groups.H5Ex_G_Create +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Create > H5Ex_G_Create.out) if diff H5Ex_G_Create.out examples.groups.H5Ex_G_Create.txt > /dev/null; then echo " PASSED groups.H5Ex_G_Create" else @@ -279,7 +280,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Iterate" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Iterate > H5Ex_G_Iterate.out) +TESTING examples.groups.H5Ex_G_Iterate +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Iterate > H5Ex_G_Iterate.out) if diff H5Ex_G_Iterate.out examples.groups.H5Ex_G_Iterate.txt > /dev/null; then echo " PASSED groups.H5Ex_G_Iterate" else @@ -288,7 +290,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Compact" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Compact > H5Ex_G_Compact.out) +TESTING examples.groups.H5Ex_G_Compact +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Compact > H5Ex_G_Compact.out) if diff H5Ex_G_Compact.out examples.groups.H5Ex_G_Compact.txt > /dev/null; then echo " PASSED groups.H5Ex_G_Compact" else @@ -297,7 +300,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Corder" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Corder > H5Ex_G_Corder.out) +TESTING examples.groups.H5Ex_G_Corder +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Corder > H5Ex_G_Corder.out) if diff H5Ex_G_Corder.out examples.groups.H5Ex_G_Corder.txt > /dev/null; then echo " PASSED groups.H5Ex_G_Corder" else @@ -306,7 +310,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Intermediate" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Intermediate > H5Ex_G_Intermediate.out) +TESTING examples.groups.H5Ex_G_Intermediate +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Intermediate > H5Ex_G_Intermediate.out) if diff H5Ex_G_Intermediate.out examples.groups.H5Ex_G_Intermediate.txt > /dev/null; then echo " PASSED groups.H5Ex_G_Intermediate" else @@ -315,7 +320,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Phase" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Phase > H5Ex_G_Phase.out) +TESTING examples.groups.H5Ex_G_Phase +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Phase > H5Ex_G_Phase.out) if diff H5Ex_G_Phase.out examples.groups.H5Ex_G_Phase.txt > /dev/null; then echo " PASSED groups.H5Ex_G_Phase" else @@ -324,7 +330,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Visit" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Visit > H5Ex_G_Visit.out) +TESTING examples.groups.H5Ex_G_Visit +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Visit > H5Ex_G_Visit.out) if diff H5Ex_G_Visit.out examples.groups.H5Ex_G_Visit.txt > /dev/null; then echo " PASSED groups.H5Ex_G_Visit" else -- cgit v0.12 From 9e9d2ccd40707ea966bd3e209b33a0c029ada1e4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Sep 2017 09:52:44 -0500 Subject: Fix VS2013 compile error --- tools/test/misc/vds/UC_common.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/test/misc/vds/UC_common.h b/tools/test/misc/vds/UC_common.h index 962a091..c3fdb91 100644 --- a/tools/test/misc/vds/UC_common.h +++ b/tools/test/misc/vds/UC_common.h @@ -14,6 +14,15 @@ #ifndef USE_CASE_COMMON_H #define USE_CASE_COMMON_H +/* Use FUNC to safely handle variations of C99 __func__ keyword handling */ +#ifdef H5_HAVE_C99_FUNC +#define FUNC __func__ +#elif defined(H5_HAVE_FUNCTION) +#define FUNC __FUNCTION__ +#else +#error "We need __func__ or __FUNCTION__ to test function names!" +#endif + /****************************************** * Symbols used across multiple use cases * ******************************************/ -- cgit v0.12 From db157e317ef7386f4fb232688dca0bbb49e852a0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Sep 2017 11:51:21 -0500 Subject: Use define name instead. --- tools/test/misc/vds/UC_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/misc/vds/UC_common.h b/tools/test/misc/vds/UC_common.h index c3fdb91..78d8a11 100644 --- a/tools/test/misc/vds/UC_common.h +++ b/tools/test/misc/vds/UC_common.h @@ -41,7 +41,7 @@ #define FALSE 0 /* Testing macros */ -#define AT() printf (" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); +#define AT() printf (" at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); #define UC_ERROR {puts("*ERROR*"); fflush(stdout); AT(); goto error;} #endif /* USE_CASE_COMMON_H */ -- cgit v0.12 From ab43e3ce9b1a8be5d03fbf5d53eef7ad5e770b74 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Sep 2017 12:43:43 -0500 Subject: Add missing intro folder --- java/examples/intro/runExample.sh.in | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/java/examples/intro/runExample.sh.in b/java/examples/intro/runExample.sh.in index 4533a1b..3c3036a 100644 --- a/java/examples/intro/runExample.sh.in +++ b/java/examples/intro/runExample.sh.in @@ -213,7 +213,8 @@ esac export LD_LIBRARY_PATH echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateDataset" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateDataset > H5_CreateDataset.out) +TESTING examples.intro.H5_CreateDataset +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateDataset > H5_CreateDataset.out) if diff H5_CreateDataset.out examples.intro.H5_CreateDataset.txt > /dev/null; then echo " PASSED intro.H5_CreateDataset" else @@ -222,7 +223,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateAttribute" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateAttribute > H5_CreateAttribute.out) +TESTING examples.intro.H5_CreateAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateAttribute > H5_CreateAttribute.out) if diff H5_CreateAttribute.out examples.intro.H5_CreateAttribute.txt > /dev/null; then echo " PASSED intro.H5_CreateAttribute" else @@ -231,7 +233,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateFile" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateFile > H5_CreateFile.out) +TESTING examples.intro.H5_CreateFile +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateFile > H5_CreateFile.out) if diff H5_CreateFile.out examples.intro.H5_CreateFile.txt > /dev/null; then echo " PASSED intro.H5_CreateFile" else @@ -240,7 +243,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroup" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroup > H5_CreateGroup.out) +TESTING examples.intro.H5_CreateGroup +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroup > H5_CreateGroup.out) if diff H5_CreateGroup.out examples.intro.H5_CreateGroup.txt > /dev/null; then echo " PASSED intro.H5_CreateGroup" else @@ -249,7 +253,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupAbsoluteRelative" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupAbsoluteRelative > H5_CreateGroupAbsoluteRelative.out) +TESTING examples.intro.H5_CreateGroupAbsoluteRelative +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupAbsoluteRelative > H5_CreateGroupAbsoluteRelative.out) if diff H5_CreateGroupAbsoluteRelative.out examples.intro.H5_CreateGroupAbsoluteRelative.txt > /dev/null; then echo " PASSED intro.H5_CreateGroupAbsoluteRelative" else @@ -258,7 +263,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupDataset" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupDataset > H5_CreateGroupDataset.out) +TESTING examples.intro.H5_CreateGroupDataset +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupDataset > H5_CreateGroupDataset.out) if diff H5_CreateGroupDataset.out examples.intro.H5_CreateGroupDataset.txt > /dev/null; then echo " PASSED intro.H5_CreateGroupDataset" else @@ -267,7 +273,8 @@ else fi echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_ReadWrite" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_ReadWrite > H5_ReadWrite.out) +TESTING examples.intro.H5_ReadWrite +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_ReadWrite > H5_ReadWrite.out) if diff H5_ReadWrite.out examples.intro.H5_ReadWrite.txt > /dev/null; then echo " PASSED intro.H5_ReadWrite" else -- cgit v0.12 From 5c5533d7fd99d31d7c563195c9bd5db2a1d5cf39 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Sep 2017 14:16:31 -0500 Subject: Change name for test results table --- MANIFEST | 8 +- java/examples/datasets/JavaDatasetExample.sh.in | 459 ++++++++++++++++++++++ java/examples/datasets/Makefile.am | 4 +- java/examples/datasets/runExample.sh.in | 459 ---------------------- java/examples/datatypes/JavaDatatypeExample.sh.in | 417 ++++++++++++++++++++ java/examples/datatypes/Makefile.am | 4 +- java/examples/datatypes/runExample.sh.in | 417 -------------------- java/examples/groups/JavaGroupExample.sh.in | 354 +++++++++++++++++ java/examples/groups/Makefile.am | 4 +- java/examples/groups/runExample.sh.in | 354 ----------------- java/examples/intro/JavaIntroExample.sh.in | 296 ++++++++++++++ java/examples/intro/Makefile.am | 4 +- java/examples/intro/runExample.sh.in | 296 -------------- 13 files changed, 1538 insertions(+), 1538 deletions(-) create mode 100644 java/examples/datasets/JavaDatasetExample.sh.in delete mode 100644 java/examples/datasets/runExample.sh.in create mode 100644 java/examples/datatypes/JavaDatatypeExample.sh.in delete mode 100644 java/examples/datatypes/runExample.sh.in create mode 100644 java/examples/groups/JavaGroupExample.sh.in delete mode 100644 java/examples/groups/runExample.sh.in create mode 100644 java/examples/intro/JavaIntroExample.sh.in delete mode 100644 java/examples/intro/runExample.sh.in diff --git a/MANIFEST b/MANIFEST index 25a6075..fa3de21 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2881,7 +2881,7 @@ ./java/examples/intro/Makefile.am ./java/examples/intro/CMakeLists.txt -./java/examples/intro/runExample.sh.in +./java/examples/intro/JavaIntroExample.sh.in ./java/examples/intro/H5_CreateAttribute.java ./java/examples/intro/H5_CreateDataset.java ./java/examples/intro/H5_CreateFile.java @@ -2892,7 +2892,7 @@ ./java/examples/groups/Makefile.am ./java/examples/groups/CMakeLists.txt -./java/examples/groups/runExample.sh.in +./java/examples/groups/JavaGroupExample.sh.in ./java/examples/groups/H5Ex_G_Create.java ./java/examples/groups/H5Ex_G_Iterate.java ./java/examples/groups/H5Ex_G_Compact.java @@ -2906,7 +2906,7 @@ ./java/examples/datasets/Makefile.am ./java/examples/datasets/CMakeLists.txt -./java/examples/datasets/runExample.sh.in +./java/examples/datasets/JavaDatasetExample.sh.in ./java/examples/datasets/H5Ex_D_Alloc.java ./java/examples/datasets/H5Ex_D_Checksum.java ./java/examples/datasets/H5Ex_D_Chunk.java @@ -2928,7 +2928,7 @@ ./java/examples/datatypes/Makefile.am ./java/examples/datatypes/CMakeLists.txt -./java/examples/datatypes/runExample.sh.in +./java/examples/datatypes/JavaDatatypeExample.sh.in ./java/examples/datatypes/H5Ex_T_Array.java ./java/examples/datatypes/H5Ex_T_ArrayAttribute.java ./java/examples/datatypes/H5Ex_T_Bit.java diff --git a/java/examples/datasets/JavaDatasetExample.sh.in b/java/examples/datasets/JavaDatasetExample.sh.in new file mode 100644 index 0000000..740b07d --- /dev/null +++ b/java/examples/datasets/JavaDatasetExample.sh.in @@ -0,0 +1,459 @@ +#! /bin/sh +# +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +top_builddir=@top_builddir@ +top_srcdir=@top_srcdir@ +srcdir=@srcdir@ + +USE_FILTER_SZIP="@USE_FILTER_SZIP@" +USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" + +TESTNAME=EX_Datasets +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +# Set up default variable values if not supplied by the user. +RM='rm -rf' +CMP='cmp' +DIFF='diff -c' +CP='cp' +DIRNAME='dirname' +LS='ls' +AWK='awk' + +nerrors=0 + +# where the libs exist +HDFLIB_HOME="$top_srcdir/java/lib" +BLDLIBDIR="$top_builddir/hdf5/lib" +BLDDIR="." +HDFTEST_HOME="$top_srcdir/java/examples/datasets" +JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar +TESTJARFILE=jar@PACKAGE_TARNAME@datasets.jar +test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR + +###################################################################### +# library files +# -------------------------------------------------------------------- +# All the library files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_LIBRARY_FILES=" +$HDFLIB_HOME/slf4j-api-1.7.5.jar +$HDFLIB_HOME/ext/slf4j-simple-1.7.5.jar +$top_builddir/src/.libs/libhdf5.* +$top_builddir/java/src/jni/.libs/libhdf5_java.* +$top_builddir/java/src/$JARFILE +" +LIST_DATA_FILES=" +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Alloc.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Checksum.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Chunk.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Compact.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_External.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_FillValue.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Gzip.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Hyperslab.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_ReadWrite.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Shuffle.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Szip.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_UnlimitedAdd.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_UnlimitedGzip.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_UnlimitedMod.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Nbit.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Transform.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Sofloat.txt +$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Soint.txt +" + +# +# copy files from source dirs to test dir +# +COPY_LIBFILES="$LIST_LIBRARY_FILES" + +COPY_LIBFILES_TO_BLDLIBDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_LIBFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $BLDLIBDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} + +CLEAN_LIBFILES_AND_BLDLIBDIR() +{ + # skip rm if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $HDFLIB_HOME/slf4j-api-1.7.5.jar` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $RM $BLDLIBDIR + fi +} + +COPY_DATAFILES="$LIST_DATA_FILES" + +COPY_DATAFILES_TO_BLDDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_DATAFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $BLDDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} + +CLEAN_DATAFILES_AND_BLDDIR() +{ + $RM $BLDDIR/examples.datasets.H5Ex_D_*.txt + $RM $BLDDIR/H5Ex_D_*.out + $RM $BLDDIR/H5Ex_D_*.h5 + $RM $BLDDIR/H5Ex_D_External.data +} + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Testing". +# +TESTING() { + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +# where Java is installed (requires jdk1.7.x) +JAVAEXE=@JAVA@ +JAVAEXEFLAGS=@H5_JAVAFLAGS@ + +############################################################################### +# DO NOT MODIFY BELOW THIS LINE +############################################################################### + +# prepare for test +COPY_LIBFILES_TO_BLDLIBDIR +COPY_DATAFILES_TO_BLDDIR + +CPATH=".:"$BLDLIBDIR"/"$JARFILE":"$BLDLIBDIR"/slf4j-api-1.7.5.jar:"$BLDLIBDIR"/slf4j-simple-1.7.5.jar:"$TESTJARFILE"" + +TEST=/usr/bin/test +if [ ! -x /usr/bin/test ] +then +TEST=`which test` +fi + +if $TEST -z "$CLASSPATH"; then + CLASSPATH="" +fi +CLASSPATH=$CPATH":"$CLASSPATH +export CLASSPATH + +if $TEST -n "$JAVAPATH" ; then + PATH=$JAVAPATH":"$PATH + export PATH +fi + +if $TEST -e /bin/uname; then + os_name=`/bin/uname -s` +elif $TEST -e /usr/bin/uname; then + os_name=`/usr/bin/uname -s` +else + os_name=unknown +fi + +if $TEST -z "$LD_LIBRARY_PATH" ; then + LD_LIBRARY_PATH="" +fi + +case $os_name in + Darwin) + DYLD_LIBRARY_PATH=$BLDLIBDIR:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH + LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH + ;; + *) + LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH + ;; +esac + +export LD_LIBRARY_PATH + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Alloc" +TESTING examples.datasets.H5Ex_D_Alloc +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Alloc > H5Ex_D_Alloc.out +) +if diff H5Ex_D_Alloc.out examples.datasets.H5Ex_D_Alloc.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Alloc" +else + echo "**FAILED** datasets.H5Ex_D_Alloc" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Checksum" +TESTING examples.datasets.H5Ex_D_Checksum +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Checksum > H5Ex_D_Checksum.out +) +if diff H5Ex_D_Checksum.out examples.datasets.H5Ex_D_Checksum.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Checksum" +else + echo "**FAILED** datasets.H5Ex_D_Checksum" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Chunk" +TESTING examples.datasets.H5Ex_D_Chunk +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Chunk > H5Ex_D_Chunk.out +) +if diff H5Ex_D_Chunk.out examples.datasets.H5Ex_D_Chunk.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Chunk" +else + echo "**FAILED** datasets.H5Ex_D_Chunk" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Compact" +TESTING examples.datasets.H5Ex_D_Compact +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Compact > H5Ex_D_Compact.out +) +if diff H5Ex_D_Compact.out examples.datasets.H5Ex_D_Compact.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Compact" +else + echo "**FAILED** datasets.H5Ex_D_Compact" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_External" +TESTING examples.datasets.H5Ex_D_External +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_External > H5Ex_D_External.out +) +if diff H5Ex_D_External.out examples.datasets.H5Ex_D_External.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_External" +else + echo "**FAILED** datasets.H5Ex_D_External" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_FillValue" +TESTING examples.datasets.H5Ex_D_FillValue +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_FillValue > H5Ex_D_FillValue.out +) +if diff H5Ex_D_FillValue.out examples.datasets.H5Ex_D_FillValue.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_FillValue" +else + echo "**FAILED** datasets.H5Ex_D_FillValue" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip" +TESTING examples.datasets.H5Ex_D_Gzip +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip > H5Ex_D_Gzip.out +) +if diff H5Ex_D_Gzip.out examples.datasets.H5Ex_D_Gzip.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Gzip" +else + echo "**FAILED** datasets.H5Ex_D_Gzip" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Hyperslab" +TESTING examples.datasets.H5Ex_D_Hyperslab +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Hyperslab > H5Ex_D_Hyperslab.out +) +if diff H5Ex_D_Hyperslab.out examples.datasets.H5Ex_D_Hyperslab.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Hyperslab" +else + echo "**FAILED** datasets.H5Ex_D_Hyperslab" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_ReadWrite" +TESTING examples.datasets.H5Ex_D_ReadWrite +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_ReadWrite > H5Ex_D_ReadWrite.out +) +if diff H5Ex_D_ReadWrite.out examples.datasets.H5Ex_D_ReadWrite.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_ReadWrite" +else + echo "**FAILED** datasets.H5Ex_D_ReadWrite" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle" +TESTING examples.datasets.H5Ex_D_Shuffle +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle > H5Ex_D_Shuffle.out +) +if diff H5Ex_D_Shuffle.out examples.datasets.H5Ex_D_Shuffle.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Shuffle" +else + echo "**FAILED** datasets.H5Ex_D_Shuffle" + nerrors="`expr $nerrors + 1`" +fi + +if test $USE_FILTER_SZIP = "yes"; then + echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Szip" + TESTING examples.datasets.H5Ex_D_Szip + ( + $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Szip > H5Ex_D_Szip.out + ) + if diff H5Ex_D_Szip.out examples.datasets.H5Ex_D_Szip.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Szip" + else + echo "**FAILED** datasets.H5Ex_D_Szip" + nerrors="`expr $nerrors + 1`" + fi +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedAdd" +TESTING examples.datasets.H5Ex_D_UnlimitedAdd +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedAdd > H5Ex_D_UnlimitedAdd.out +) +if diff H5Ex_D_UnlimitedAdd.out examples.datasets.H5Ex_D_UnlimitedAdd.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_UnlimitedAdd" +else + echo "**FAILED** datasets.H5Ex_D_UnlimitedAdd" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedGzip" +TESTING examples.datasets.H5Ex_D_UnlimitedGzip +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedGzip > H5Ex_D_UnlimitedGzip.out +) +if diff H5Ex_D_External.out examples.datasets.H5Ex_D_External.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_UnlimitedGzip" +else + echo "**FAILED** datasets.H5Ex_D_UnlimitedGzip" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedMod" +TESTING examples.datasets.H5Ex_D_UnlimitedMod +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedMod > H5Ex_D_UnlimitedMod.out +) +if diff H5Ex_D_UnlimitedMod.out examples.datasets.H5Ex_D_UnlimitedMod.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_UnlimitedMod" +else + echo "**FAILED** datasets.H5Ex_D_UnlimitedMod" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Nbit" +TESTING examples.datasets.H5Ex_D_Nbit +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Nbit > H5Ex_D_Nbit.out +) +if diff H5Ex_D_Nbit.out examples.datasets.H5Ex_D_Nbit.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Nbit" +else + echo "**FAILED** datasets.H5Ex_D_Nbit" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Transform" +TESTING examples.datasets.H5Ex_D_Transform +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Transform > H5Ex_D_Transform.out +) +if diff H5Ex_D_Transform.out examples.datasets.H5Ex_D_Transform.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Transform" +else + echo "**FAILED** datasets.H5Ex_D_Transform" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Sofloat" +TESTING examples.datasets.H5Ex_D_Sofloat +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Sofloat > H5Ex_D_Sofloat.out +) +if diff H5Ex_D_Sofloat.out examples.datasets.H5Ex_D_Sofloat.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Sofloat" +else + echo "**FAILED** datasets.H5Ex_D_Sofloat" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Soint" +TESTING examples.datasets.H5Ex_D_Soint +( +$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Soint > H5Ex_D_Soint.out +) +if diff H5Ex_D_Soint.out examples.datasets.H5Ex_D_Soint.txt > /dev/null; then + echo " PASSED datasets.H5Ex_D_Soint" +else + echo "**FAILED** datasets.H5Ex_D_Soint" + nerrors="`expr $nerrors + 1`" +fi + +# Clean up temporary files/directories +CLEAN_LIBFILES_AND_BLDLIBDIR +CLEAN_DATAFILES_AND_BLDDIR + +# Report test results and exit +if test $nerrors -eq 0 ; then + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE +fi diff --git a/java/examples/datasets/Makefile.am b/java/examples/datasets/Makefile.am index 18100a6..ddd6d39 100644 --- a/java/examples/datasets/Makefile.am +++ b/java/examples/datasets/Makefile.am @@ -63,10 +63,10 @@ noinst_DATA = $(jarfile) .PHONY: classes -check_SCRIPTS = runExample.sh +check_SCRIPTS = JavaDatasetExample.sh TEST_SCRIPT = $(check_SCRIPTS) -CLEANFILES = classnoinst.stamp $(jarfile) $(JAVAROOT)/$(pkgpath)/*.class runExample.sh +CLEANFILES = classnoinst.stamp $(jarfile) $(JAVAROOT)/$(pkgpath)/*.class JavaDatasetExample.sh clean: rm -rf $(JAVAROOT)/* diff --git a/java/examples/datasets/runExample.sh.in b/java/examples/datasets/runExample.sh.in deleted file mode 100644 index 740b07d..0000000 --- a/java/examples/datasets/runExample.sh.in +++ /dev/null @@ -1,459 +0,0 @@ -#! /bin/sh -# -# Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -top_builddir=@top_builddir@ -top_srcdir=@top_srcdir@ -srcdir=@srcdir@ - -USE_FILTER_SZIP="@USE_FILTER_SZIP@" -USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" - -TESTNAME=EX_Datasets -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -# Set up default variable values if not supplied by the user. -RM='rm -rf' -CMP='cmp' -DIFF='diff -c' -CP='cp' -DIRNAME='dirname' -LS='ls' -AWK='awk' - -nerrors=0 - -# where the libs exist -HDFLIB_HOME="$top_srcdir/java/lib" -BLDLIBDIR="$top_builddir/hdf5/lib" -BLDDIR="." -HDFTEST_HOME="$top_srcdir/java/examples/datasets" -JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar -TESTJARFILE=jar@PACKAGE_TARNAME@datasets.jar -test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR - -###################################################################### -# library files -# -------------------------------------------------------------------- -# All the library files copy from source directory to test directory -# NOTE: Keep this framework to add/remove test files. -# This list are also used for checking exist. -# Comment '#' without space can be used. -# -------------------------------------------------------------------- -LIST_LIBRARY_FILES=" -$HDFLIB_HOME/slf4j-api-1.7.5.jar -$HDFLIB_HOME/ext/slf4j-simple-1.7.5.jar -$top_builddir/src/.libs/libhdf5.* -$top_builddir/java/src/jni/.libs/libhdf5_java.* -$top_builddir/java/src/$JARFILE -" -LIST_DATA_FILES=" -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Alloc.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Checksum.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Chunk.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Compact.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_External.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_FillValue.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Gzip.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Hyperslab.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_ReadWrite.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Shuffle.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Szip.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_UnlimitedAdd.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_UnlimitedGzip.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_UnlimitedMod.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Nbit.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Transform.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Sofloat.txt -$HDFTEST_HOME/../testfiles/examples.datasets.H5Ex_D_Soint.txt -" - -# -# copy files from source dirs to test dir -# -COPY_LIBFILES="$LIST_LIBRARY_FILES" - -COPY_LIBFILES_TO_BLDLIBDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_LIBFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $BLDLIBDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_LIBFILES_AND_BLDLIBDIR() -{ - # skip rm if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $HDFLIB_HOME/slf4j-api-1.7.5.jar` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $RM $BLDLIBDIR - fi -} - -COPY_DATAFILES="$LIST_DATA_FILES" - -COPY_DATAFILES_TO_BLDDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_DATAFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $BLDDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_DATAFILES_AND_BLDDIR() -{ - $RM $BLDDIR/examples.datasets.H5Ex_D_*.txt - $RM $BLDDIR/H5Ex_D_*.out - $RM $BLDDIR/H5Ex_D_*.h5 - $RM $BLDDIR/H5Ex_D_External.data -} - -# Print a line-line message left justified in a field of 70 characters -# beginning with the word "Testing". -# -TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# where Java is installed (requires jdk1.7.x) -JAVAEXE=@JAVA@ -JAVAEXEFLAGS=@H5_JAVAFLAGS@ - -############################################################################### -# DO NOT MODIFY BELOW THIS LINE -############################################################################### - -# prepare for test -COPY_LIBFILES_TO_BLDLIBDIR -COPY_DATAFILES_TO_BLDDIR - -CPATH=".:"$BLDLIBDIR"/"$JARFILE":"$BLDLIBDIR"/slf4j-api-1.7.5.jar:"$BLDLIBDIR"/slf4j-simple-1.7.5.jar:"$TESTJARFILE"" - -TEST=/usr/bin/test -if [ ! -x /usr/bin/test ] -then -TEST=`which test` -fi - -if $TEST -z "$CLASSPATH"; then - CLASSPATH="" -fi -CLASSPATH=$CPATH":"$CLASSPATH -export CLASSPATH - -if $TEST -n "$JAVAPATH" ; then - PATH=$JAVAPATH":"$PATH - export PATH -fi - -if $TEST -e /bin/uname; then - os_name=`/bin/uname -s` -elif $TEST -e /usr/bin/uname; then - os_name=`/usr/bin/uname -s` -else - os_name=unknown -fi - -if $TEST -z "$LD_LIBRARY_PATH" ; then - LD_LIBRARY_PATH="" -fi - -case $os_name in - Darwin) - DYLD_LIBRARY_PATH=$BLDLIBDIR:$DYLD_LIBRARY_PATH - export DYLD_LIBRARY_PATH - LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH - ;; - *) - LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH - ;; -esac - -export LD_LIBRARY_PATH - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Alloc" -TESTING examples.datasets.H5Ex_D_Alloc -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Alloc > H5Ex_D_Alloc.out -) -if diff H5Ex_D_Alloc.out examples.datasets.H5Ex_D_Alloc.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Alloc" -else - echo "**FAILED** datasets.H5Ex_D_Alloc" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Checksum" -TESTING examples.datasets.H5Ex_D_Checksum -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Checksum > H5Ex_D_Checksum.out -) -if diff H5Ex_D_Checksum.out examples.datasets.H5Ex_D_Checksum.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Checksum" -else - echo "**FAILED** datasets.H5Ex_D_Checksum" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Chunk" -TESTING examples.datasets.H5Ex_D_Chunk -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Chunk > H5Ex_D_Chunk.out -) -if diff H5Ex_D_Chunk.out examples.datasets.H5Ex_D_Chunk.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Chunk" -else - echo "**FAILED** datasets.H5Ex_D_Chunk" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Compact" -TESTING examples.datasets.H5Ex_D_Compact -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Compact > H5Ex_D_Compact.out -) -if diff H5Ex_D_Compact.out examples.datasets.H5Ex_D_Compact.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Compact" -else - echo "**FAILED** datasets.H5Ex_D_Compact" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_External" -TESTING examples.datasets.H5Ex_D_External -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_External > H5Ex_D_External.out -) -if diff H5Ex_D_External.out examples.datasets.H5Ex_D_External.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_External" -else - echo "**FAILED** datasets.H5Ex_D_External" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_FillValue" -TESTING examples.datasets.H5Ex_D_FillValue -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_FillValue > H5Ex_D_FillValue.out -) -if diff H5Ex_D_FillValue.out examples.datasets.H5Ex_D_FillValue.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_FillValue" -else - echo "**FAILED** datasets.H5Ex_D_FillValue" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip" -TESTING examples.datasets.H5Ex_D_Gzip -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip > H5Ex_D_Gzip.out -) -if diff H5Ex_D_Gzip.out examples.datasets.H5Ex_D_Gzip.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Gzip" -else - echo "**FAILED** datasets.H5Ex_D_Gzip" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Hyperslab" -TESTING examples.datasets.H5Ex_D_Hyperslab -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Hyperslab > H5Ex_D_Hyperslab.out -) -if diff H5Ex_D_Hyperslab.out examples.datasets.H5Ex_D_Hyperslab.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Hyperslab" -else - echo "**FAILED** datasets.H5Ex_D_Hyperslab" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_ReadWrite" -TESTING examples.datasets.H5Ex_D_ReadWrite -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_ReadWrite > H5Ex_D_ReadWrite.out -) -if diff H5Ex_D_ReadWrite.out examples.datasets.H5Ex_D_ReadWrite.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_ReadWrite" -else - echo "**FAILED** datasets.H5Ex_D_ReadWrite" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle" -TESTING examples.datasets.H5Ex_D_Shuffle -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle > H5Ex_D_Shuffle.out -) -if diff H5Ex_D_Shuffle.out examples.datasets.H5Ex_D_Shuffle.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Shuffle" -else - echo "**FAILED** datasets.H5Ex_D_Shuffle" - nerrors="`expr $nerrors + 1`" -fi - -if test $USE_FILTER_SZIP = "yes"; then - echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Szip" - TESTING examples.datasets.H5Ex_D_Szip - ( - $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Szip > H5Ex_D_Szip.out - ) - if diff H5Ex_D_Szip.out examples.datasets.H5Ex_D_Szip.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Szip" - else - echo "**FAILED** datasets.H5Ex_D_Szip" - nerrors="`expr $nerrors + 1`" - fi -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedAdd" -TESTING examples.datasets.H5Ex_D_UnlimitedAdd -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedAdd > H5Ex_D_UnlimitedAdd.out -) -if diff H5Ex_D_UnlimitedAdd.out examples.datasets.H5Ex_D_UnlimitedAdd.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_UnlimitedAdd" -else - echo "**FAILED** datasets.H5Ex_D_UnlimitedAdd" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedGzip" -TESTING examples.datasets.H5Ex_D_UnlimitedGzip -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedGzip > H5Ex_D_UnlimitedGzip.out -) -if diff H5Ex_D_External.out examples.datasets.H5Ex_D_External.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_UnlimitedGzip" -else - echo "**FAILED** datasets.H5Ex_D_UnlimitedGzip" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedMod" -TESTING examples.datasets.H5Ex_D_UnlimitedMod -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_UnlimitedMod > H5Ex_D_UnlimitedMod.out -) -if diff H5Ex_D_UnlimitedMod.out examples.datasets.H5Ex_D_UnlimitedMod.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_UnlimitedMod" -else - echo "**FAILED** datasets.H5Ex_D_UnlimitedMod" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Nbit" -TESTING examples.datasets.H5Ex_D_Nbit -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Nbit > H5Ex_D_Nbit.out -) -if diff H5Ex_D_Nbit.out examples.datasets.H5Ex_D_Nbit.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Nbit" -else - echo "**FAILED** datasets.H5Ex_D_Nbit" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Transform" -TESTING examples.datasets.H5Ex_D_Transform -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Transform > H5Ex_D_Transform.out -) -if diff H5Ex_D_Transform.out examples.datasets.H5Ex_D_Transform.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Transform" -else - echo "**FAILED** datasets.H5Ex_D_Transform" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Sofloat" -TESTING examples.datasets.H5Ex_D_Sofloat -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Sofloat > H5Ex_D_Sofloat.out -) -if diff H5Ex_D_Sofloat.out examples.datasets.H5Ex_D_Sofloat.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Sofloat" -else - echo "**FAILED** datasets.H5Ex_D_Sofloat" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Soint" -TESTING examples.datasets.H5Ex_D_Soint -( -$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Soint > H5Ex_D_Soint.out -) -if diff H5Ex_D_Soint.out examples.datasets.H5Ex_D_Soint.txt > /dev/null; then - echo " PASSED datasets.H5Ex_D_Soint" -else - echo "**FAILED** datasets.H5Ex_D_Soint" - nerrors="`expr $nerrors + 1`" -fi - -# Clean up temporary files/directories -CLEAN_LIBFILES_AND_BLDLIBDIR -CLEAN_DATAFILES_AND_BLDDIR - -# Report test results and exit -if test $nerrors -eq 0 ; then - echo "All $TESTNAME tests passed." - exit $EXIT_SUCCESS -else - echo "$TESTNAME tests failed with $nerrors errors." - exit $EXIT_FAILURE -fi diff --git a/java/examples/datatypes/JavaDatatypeExample.sh.in b/java/examples/datatypes/JavaDatatypeExample.sh.in new file mode 100644 index 0000000..590a547 --- /dev/null +++ b/java/examples/datatypes/JavaDatatypeExample.sh.in @@ -0,0 +1,417 @@ +#! /bin/sh +# +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +top_builddir=@top_builddir@ +top_srcdir=@top_srcdir@ +srcdir=@srcdir@ + +TESTNAME=EX_Datatypes +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +# Set up default variable values if not supplied by the user. +RM='rm -rf' +CMP='cmp' +DIFF='diff -c' +CP='cp' +DIRNAME='dirname' +LS='ls' +AWK='awk' + +nerrors=0 + +# where the libs exist +HDFLIB_HOME="$top_srcdir/java/lib" +BLDLIBDIR="$top_builddir/hdf5/lib" +BLDDIR="." +HDFTEST_HOME="$top_srcdir/java/examples/datatypes" +JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar +TESTJARFILE=jar@PACKAGE_TARNAME@datatypes.jar +test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR + +###################################################################### +# library files +# -------------------------------------------------------------------- +# All the library files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_LIBRARY_FILES=" +$HDFLIB_HOME/slf4j-api-1.7.5.jar +$HDFLIB_HOME/ext/slf4j-simple-1.7.5.jar +$top_builddir/src/.libs/libhdf5.* +$top_builddir/java/src/jni/.libs/libhdf5_java.* +$top_builddir/java/src/$JARFILE +" +LIST_DATA_FILES=" +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Array.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_ArrayAttribute.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Bit.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_BitAttribute.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Commit.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Compound.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_CompoundAttribute.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Float.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_FloatAttribute.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Integer.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_IntegerAttribute.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_ObjectReference.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_ObjectReferenceAttribute.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Opaque.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_OpaqueAttribute.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_String.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_StringAttribute.txt +$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_VLString.txt +" + +# +# copy files from source dirs to test dir +# +COPY_LIBFILES="$LIST_LIBRARY_FILES" + +COPY_LIBFILES_TO_BLDLIBDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_LIBFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $BLDLIBDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} + +CLEAN_LIBFILES_AND_BLDLIBDIR() +{ + # skip rm if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $HDFLIB_HOME/slf4j-api-1.7.5.jar` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $RM $BLDLIBDIR + fi +} + +COPY_DATAFILES="$LIST_DATA_FILES" + +COPY_DATAFILES_TO_BLDDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_DATAFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $BLDDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} + +CLEAN_DATAFILES_AND_BLDDIR() +{ + $RM $BLDDIR/examples.datatypes.H5Ex_T_*.txt + $RM $BLDDIR/H5Ex_T_*.out + $RM $BLDDIR/H5Ex_T_*.h5 +} + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Testing". +# +TESTING() { + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +# where Java is installed (requires jdk1.7.x) +JAVAEXE=@JAVA@ +JAVAEXEFLAGS=@H5_JAVAFLAGS@ + +############################################################################### +# DO NOT MODIFY BELOW THIS LINE +############################################################################### + +# prepare for test +COPY_LIBFILES_TO_BLDLIBDIR +COPY_DATAFILES_TO_BLDDIR + +CPATH=".:"$BLDLIBDIR"/"$JARFILE":"$BLDLIBDIR"/slf4j-api-1.7.5.jar:"$BLDLIBDIR"/slf4j-simple-1.7.5.jar:"$TESTJARFILE"" + +TEST=/usr/bin/test +if [ ! -x /usr/bin/test ] +then +TEST=`which test` +fi + +if $TEST -z "$CLASSPATH"; then + CLASSPATH="" +fi +CLASSPATH=$CPATH":"$CLASSPATH +export CLASSPATH + +if $TEST -n "$JAVAPATH" ; then + PATH=$JAVAPATH":"$PATH + export PATH +fi + +if $TEST -e /bin/uname; then + os_name=`/bin/uname -s` +elif $TEST -e /usr/bin/uname; then + os_name=`/usr/bin/uname -s` +else + os_name=unknown +fi + +if $TEST -z "$LD_LIBRARY_PATH" ; then + LD_LIBRARY_PATH="" +fi + +case $os_name in + Darwin) + DYLD_LIBRARY_PATH=$BLDLIBDIR:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH + LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH + ;; + *) + LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH + ;; +esac + +export LD_LIBRARY_PATH + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Array" +TESTING examples.datatypes.H5Ex_T_Array +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Array > H5Ex_T_Array.out) +if diff H5Ex_T_Array.out examples.datatypes.H5Ex_T_Array.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_Array" +else + echo "**FAILED** datatypes.H5Ex_T_Array" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ArrayAttribute" +TESTING examples.datatypes.H5Ex_T_ArrayAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ArrayAttribute > H5Ex_T_ArrayAttribute.out) +if diff H5Ex_T_ArrayAttribute.out examples.datatypes.H5Ex_T_ArrayAttribute.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_ArrayAttribute" +else + echo "**FAILED** datatypes.H5Ex_T_ArrayAttribute" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Bit" +TESTING examples.datatypes.H5Ex_T_Bit +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Bit > H5Ex_T_Bit.out) +if diff H5Ex_T_Bit.out examples.datatypes.H5Ex_T_Bit.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_Bit" +else + echo "**FAILED** datatypes.H5Ex_T_Bit" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_BitAttribute" +TESTING examples.datatypes.H5Ex_T_BitAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_BitAttribute > H5Ex_T_BitAttribute.out) +if diff H5Ex_T_BitAttribute.out examples.datatypes.H5Ex_T_BitAttribute.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_BitAttribute" +else + echo "**FAILED** datatypes.H5Ex_T_BitAttribute" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Commit" +TESTING examples.datasets.H5Ex_T_Commit +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Commit > H5Ex_T_Commit.out) +if diff H5Ex_T_Commit.out examples.datatypes.H5Ex_T_Commit.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_Commit" +else + echo "**FAILED** datatypes.H5Ex_T_Commit" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Compound" +TESTING examples.datatypes.H5Ex_T_Compound +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Compound > H5Ex_T_Compound.out) +if diff H5Ex_T_Compound.out examples.datatypes.H5Ex_T_Compound.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_Compound" +else + echo "**FAILED** datatypes.H5Ex_T_Compound" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_CompoundAttribute" +TESTING examples.datatypes.H5Ex_T_CompoundAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_CompoundAttribute > H5Ex_T_CompoundAttribute.out) +if diff H5Ex_T_CompoundAttribute.out examples.datatypes.H5Ex_T_CompoundAttribute.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_CompoundAttribute" +else + echo "**FAILED** datatypes.H5Ex_T_CompoundAttribute" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Float" +TESTING examples.datatypes.H5Ex_T_Float +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Float > H5Ex_T_Float.out) +if diff H5Ex_T_Float.out examples.datatypes.H5Ex_T_Float.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_Float" +else + echo "**FAILED** datatypes.H5Ex_T_Float" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_FloatAttribute" +TESTING examples.datatypes.H5Ex_T_FloatAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_FloatAttribute > H5Ex_T_FloatAttribute.out) +if diff H5Ex_T_FloatAttribute.out examples.datatypes.H5Ex_T_FloatAttribute.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_FloatAttribute" +else + echo "**FAILED** datatypes.H5Ex_T_FloatAttribute" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Integer" +TESTING examples.datatypes.H5Ex_T_Integer +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Integer > H5Ex_T_Integer.out) +if diff H5Ex_T_Integer.out examples.datatypes.H5Ex_T_Integer.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_Integer" +else + echo "**FAILED** datatypes.H5Ex_T_Integer" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_IntegerAttribute" +TESTING examples.datatypes.H5Ex_T_IntegerAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_IntegerAttribute > H5Ex_T_IntegerAttribute.out) +if diff H5Ex_T_IntegerAttribute.out examples.datatypes.H5Ex_T_IntegerAttribute.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_IntegerAttribute" +else + echo "**FAILED** datatypes.H5Ex_T_IntegerAttribute" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReference" +TESTING examples.datatypes.H5Ex_T_ObjectReference +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReference > H5Ex_T_ObjectReference.out) +if diff H5Ex_T_ObjectReference.out examples.datatypes.H5Ex_T_ObjectReference.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_ObjectReference" +else + echo "**FAILED** datatypes.H5Ex_T_ObjectReference" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReferenceAttribute" +TESTING examples.datatypes.H5Ex_T_ObjectReferenceAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReferenceAttribute > H5Ex_T_ObjectReferenceAttribute.out) +if diff H5Ex_T_ObjectReferenceAttribute.out examples.datatypes.H5Ex_T_ObjectReferenceAttribute.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_ObjectReferenceAttribute" +else + echo "**FAILED** datatypes.H5Ex_T_ObjectReferenceAttribute" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Opaque" +TESTING examples.datatypes.H5Ex_T_Opaque +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Opaque > H5Ex_T_Opaque.out) +if diff H5Ex_T_Opaque.out examples.datatypes.H5Ex_T_Opaque.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_Opaque" +else + echo "**FAILED** datatypes.H5Ex_T_Opaque" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_OpaqueAttribute" +TESTING examples.datatypes.H5Ex_T_OpaqueAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_OpaqueAttribute > H5Ex_T_OpaqueAttribute.out) +if diff H5Ex_T_OpaqueAttribute.out examples.datatypes.H5Ex_T_OpaqueAttribute.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_OpaqueAttribute" +else + echo "**FAILED** datatypes.H5Ex_T_OpaqueAttribute" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_String" +TESTING examples.datatypes.H5Ex_T_String +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_String > H5Ex_T_String.out) +if diff H5Ex_T_String.out examples.datatypes.H5Ex_T_String.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_String" +else + echo "**FAILED** datatypes.H5Ex_T_String" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_StringAttribute" +TESTING examples.datatypes.H5Ex_T_StringAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_StringAttribute > H5Ex_T_StringAttribute.out) +if diff H5Ex_T_StringAttribute.out examples.datatypes.H5Ex_T_StringAttribute.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_StringAttribute" +else + echo "**FAILED** datatypes.H5Ex_T_StringAttribute" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_VLString" +TESTING examples.datatypes.H5Ex_T_VLString +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_VLString > H5Ex_T_VLString.out) +if diff H5Ex_T_VLString.out examples.datatypes.H5Ex_T_VLString.txt > /dev/null; then + echo " PASSED datatypes.H5Ex_T_VLString" +else + echo "**FAILED** datatypes.H5Ex_T_VLString" + nerrors="`expr $nerrors + 1`" +fi + +# Clean up temporary files/directories +CLEAN_LIBFILES_AND_BLDLIBDIR +CLEAN_DATAFILES_AND_BLDDIR + +# Report test results and exit +if test $nerrors -eq 0 ; then + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE +fi diff --git a/java/examples/datatypes/Makefile.am b/java/examples/datatypes/Makefile.am index 71f7769..f6e58f1 100644 --- a/java/examples/datatypes/Makefile.am +++ b/java/examples/datatypes/Makefile.am @@ -63,10 +63,10 @@ noinst_DATA = $(jarfile) .PHONY: classes -check_SCRIPTS = runExample.sh +check_SCRIPTS = JavaDatatypeExample.sh TEST_SCRIPT = $(check_SCRIPTS) -CLEANFILES = classnoinst.stamp $(jarfile) $(JAVAROOT)/$(pkgpath)/*.class runExample.sh +CLEANFILES = classnoinst.stamp $(jarfile) $(JAVAROOT)/$(pkgpath)/*.class JavaDatatypeExample.sh clean: rm -rf $(JAVAROOT)/* diff --git a/java/examples/datatypes/runExample.sh.in b/java/examples/datatypes/runExample.sh.in deleted file mode 100644 index 590a547..0000000 --- a/java/examples/datatypes/runExample.sh.in +++ /dev/null @@ -1,417 +0,0 @@ -#! /bin/sh -# -# Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -top_builddir=@top_builddir@ -top_srcdir=@top_srcdir@ -srcdir=@srcdir@ - -TESTNAME=EX_Datatypes -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -# Set up default variable values if not supplied by the user. -RM='rm -rf' -CMP='cmp' -DIFF='diff -c' -CP='cp' -DIRNAME='dirname' -LS='ls' -AWK='awk' - -nerrors=0 - -# where the libs exist -HDFLIB_HOME="$top_srcdir/java/lib" -BLDLIBDIR="$top_builddir/hdf5/lib" -BLDDIR="." -HDFTEST_HOME="$top_srcdir/java/examples/datatypes" -JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar -TESTJARFILE=jar@PACKAGE_TARNAME@datatypes.jar -test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR - -###################################################################### -# library files -# -------------------------------------------------------------------- -# All the library files copy from source directory to test directory -# NOTE: Keep this framework to add/remove test files. -# This list are also used for checking exist. -# Comment '#' without space can be used. -# -------------------------------------------------------------------- -LIST_LIBRARY_FILES=" -$HDFLIB_HOME/slf4j-api-1.7.5.jar -$HDFLIB_HOME/ext/slf4j-simple-1.7.5.jar -$top_builddir/src/.libs/libhdf5.* -$top_builddir/java/src/jni/.libs/libhdf5_java.* -$top_builddir/java/src/$JARFILE -" -LIST_DATA_FILES=" -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Array.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_ArrayAttribute.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Bit.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_BitAttribute.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Commit.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Compound.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_CompoundAttribute.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Float.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_FloatAttribute.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Integer.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_IntegerAttribute.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_ObjectReference.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_ObjectReferenceAttribute.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_Opaque.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_OpaqueAttribute.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_String.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_StringAttribute.txt -$HDFTEST_HOME/../testfiles/examples.datatypes.H5Ex_T_VLString.txt -" - -# -# copy files from source dirs to test dir -# -COPY_LIBFILES="$LIST_LIBRARY_FILES" - -COPY_LIBFILES_TO_BLDLIBDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_LIBFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $BLDLIBDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_LIBFILES_AND_BLDLIBDIR() -{ - # skip rm if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $HDFLIB_HOME/slf4j-api-1.7.5.jar` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $RM $BLDLIBDIR - fi -} - -COPY_DATAFILES="$LIST_DATA_FILES" - -COPY_DATAFILES_TO_BLDDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_DATAFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $BLDDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_DATAFILES_AND_BLDDIR() -{ - $RM $BLDDIR/examples.datatypes.H5Ex_T_*.txt - $RM $BLDDIR/H5Ex_T_*.out - $RM $BLDDIR/H5Ex_T_*.h5 -} - -# Print a line-line message left justified in a field of 70 characters -# beginning with the word "Testing". -# -TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# where Java is installed (requires jdk1.7.x) -JAVAEXE=@JAVA@ -JAVAEXEFLAGS=@H5_JAVAFLAGS@ - -############################################################################### -# DO NOT MODIFY BELOW THIS LINE -############################################################################### - -# prepare for test -COPY_LIBFILES_TO_BLDLIBDIR -COPY_DATAFILES_TO_BLDDIR - -CPATH=".:"$BLDLIBDIR"/"$JARFILE":"$BLDLIBDIR"/slf4j-api-1.7.5.jar:"$BLDLIBDIR"/slf4j-simple-1.7.5.jar:"$TESTJARFILE"" - -TEST=/usr/bin/test -if [ ! -x /usr/bin/test ] -then -TEST=`which test` -fi - -if $TEST -z "$CLASSPATH"; then - CLASSPATH="" -fi -CLASSPATH=$CPATH":"$CLASSPATH -export CLASSPATH - -if $TEST -n "$JAVAPATH" ; then - PATH=$JAVAPATH":"$PATH - export PATH -fi - -if $TEST -e /bin/uname; then - os_name=`/bin/uname -s` -elif $TEST -e /usr/bin/uname; then - os_name=`/usr/bin/uname -s` -else - os_name=unknown -fi - -if $TEST -z "$LD_LIBRARY_PATH" ; then - LD_LIBRARY_PATH="" -fi - -case $os_name in - Darwin) - DYLD_LIBRARY_PATH=$BLDLIBDIR:$DYLD_LIBRARY_PATH - export DYLD_LIBRARY_PATH - LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH - ;; - *) - LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH - ;; -esac - -export LD_LIBRARY_PATH - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Array" -TESTING examples.datatypes.H5Ex_T_Array -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Array > H5Ex_T_Array.out) -if diff H5Ex_T_Array.out examples.datatypes.H5Ex_T_Array.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_Array" -else - echo "**FAILED** datatypes.H5Ex_T_Array" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ArrayAttribute" -TESTING examples.datatypes.H5Ex_T_ArrayAttribute -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ArrayAttribute > H5Ex_T_ArrayAttribute.out) -if diff H5Ex_T_ArrayAttribute.out examples.datatypes.H5Ex_T_ArrayAttribute.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_ArrayAttribute" -else - echo "**FAILED** datatypes.H5Ex_T_ArrayAttribute" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Bit" -TESTING examples.datatypes.H5Ex_T_Bit -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Bit > H5Ex_T_Bit.out) -if diff H5Ex_T_Bit.out examples.datatypes.H5Ex_T_Bit.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_Bit" -else - echo "**FAILED** datatypes.H5Ex_T_Bit" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_BitAttribute" -TESTING examples.datatypes.H5Ex_T_BitAttribute -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_BitAttribute > H5Ex_T_BitAttribute.out) -if diff H5Ex_T_BitAttribute.out examples.datatypes.H5Ex_T_BitAttribute.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_BitAttribute" -else - echo "**FAILED** datatypes.H5Ex_T_BitAttribute" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Commit" -TESTING examples.datasets.H5Ex_T_Commit -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Commit > H5Ex_T_Commit.out) -if diff H5Ex_T_Commit.out examples.datatypes.H5Ex_T_Commit.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_Commit" -else - echo "**FAILED** datatypes.H5Ex_T_Commit" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Compound" -TESTING examples.datatypes.H5Ex_T_Compound -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Compound > H5Ex_T_Compound.out) -if diff H5Ex_T_Compound.out examples.datatypes.H5Ex_T_Compound.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_Compound" -else - echo "**FAILED** datatypes.H5Ex_T_Compound" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_CompoundAttribute" -TESTING examples.datatypes.H5Ex_T_CompoundAttribute -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_CompoundAttribute > H5Ex_T_CompoundAttribute.out) -if diff H5Ex_T_CompoundAttribute.out examples.datatypes.H5Ex_T_CompoundAttribute.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_CompoundAttribute" -else - echo "**FAILED** datatypes.H5Ex_T_CompoundAttribute" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Float" -TESTING examples.datatypes.H5Ex_T_Float -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Float > H5Ex_T_Float.out) -if diff H5Ex_T_Float.out examples.datatypes.H5Ex_T_Float.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_Float" -else - echo "**FAILED** datatypes.H5Ex_T_Float" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_FloatAttribute" -TESTING examples.datatypes.H5Ex_T_FloatAttribute -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_FloatAttribute > H5Ex_T_FloatAttribute.out) -if diff H5Ex_T_FloatAttribute.out examples.datatypes.H5Ex_T_FloatAttribute.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_FloatAttribute" -else - echo "**FAILED** datatypes.H5Ex_T_FloatAttribute" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Integer" -TESTING examples.datatypes.H5Ex_T_Integer -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Integer > H5Ex_T_Integer.out) -if diff H5Ex_T_Integer.out examples.datatypes.H5Ex_T_Integer.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_Integer" -else - echo "**FAILED** datatypes.H5Ex_T_Integer" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_IntegerAttribute" -TESTING examples.datatypes.H5Ex_T_IntegerAttribute -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_IntegerAttribute > H5Ex_T_IntegerAttribute.out) -if diff H5Ex_T_IntegerAttribute.out examples.datatypes.H5Ex_T_IntegerAttribute.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_IntegerAttribute" -else - echo "**FAILED** datatypes.H5Ex_T_IntegerAttribute" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReference" -TESTING examples.datatypes.H5Ex_T_ObjectReference -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReference > H5Ex_T_ObjectReference.out) -if diff H5Ex_T_ObjectReference.out examples.datatypes.H5Ex_T_ObjectReference.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_ObjectReference" -else - echo "**FAILED** datatypes.H5Ex_T_ObjectReference" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReferenceAttribute" -TESTING examples.datatypes.H5Ex_T_ObjectReferenceAttribute -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_ObjectReferenceAttribute > H5Ex_T_ObjectReferenceAttribute.out) -if diff H5Ex_T_ObjectReferenceAttribute.out examples.datatypes.H5Ex_T_ObjectReferenceAttribute.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_ObjectReferenceAttribute" -else - echo "**FAILED** datatypes.H5Ex_T_ObjectReferenceAttribute" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Opaque" -TESTING examples.datatypes.H5Ex_T_Opaque -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_Opaque > H5Ex_T_Opaque.out) -if diff H5Ex_T_Opaque.out examples.datatypes.H5Ex_T_Opaque.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_Opaque" -else - echo "**FAILED** datatypes.H5Ex_T_Opaque" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_OpaqueAttribute" -TESTING examples.datatypes.H5Ex_T_OpaqueAttribute -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_OpaqueAttribute > H5Ex_T_OpaqueAttribute.out) -if diff H5Ex_T_OpaqueAttribute.out examples.datatypes.H5Ex_T_OpaqueAttribute.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_OpaqueAttribute" -else - echo "**FAILED** datatypes.H5Ex_T_OpaqueAttribute" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_String" -TESTING examples.datatypes.H5Ex_T_String -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_String > H5Ex_T_String.out) -if diff H5Ex_T_String.out examples.datatypes.H5Ex_T_String.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_String" -else - echo "**FAILED** datatypes.H5Ex_T_String" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_StringAttribute" -TESTING examples.datatypes.H5Ex_T_StringAttribute -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_StringAttribute > H5Ex_T_StringAttribute.out) -if diff H5Ex_T_StringAttribute.out examples.datatypes.H5Ex_T_StringAttribute.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_StringAttribute" -else - echo "**FAILED** datatypes.H5Ex_T_StringAttribute" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_VLString" -TESTING examples.datatypes.H5Ex_T_VLString -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datatypes.H5Ex_T_VLString > H5Ex_T_VLString.out) -if diff H5Ex_T_VLString.out examples.datatypes.H5Ex_T_VLString.txt > /dev/null; then - echo " PASSED datatypes.H5Ex_T_VLString" -else - echo "**FAILED** datatypes.H5Ex_T_VLString" - nerrors="`expr $nerrors + 1`" -fi - -# Clean up temporary files/directories -CLEAN_LIBFILES_AND_BLDLIBDIR -CLEAN_DATAFILES_AND_BLDDIR - -# Report test results and exit -if test $nerrors -eq 0 ; then - echo "All $TESTNAME tests passed." - exit $EXIT_SUCCESS -else - echo "$TESTNAME tests failed with $nerrors errors." - exit $EXIT_FAILURE -fi diff --git a/java/examples/groups/JavaGroupExample.sh.in b/java/examples/groups/JavaGroupExample.sh.in new file mode 100644 index 0000000..53c0045 --- /dev/null +++ b/java/examples/groups/JavaGroupExample.sh.in @@ -0,0 +1,354 @@ +#! /bin/sh +# +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +top_builddir=@top_builddir@ +top_srcdir=@top_srcdir@ +srcdir=@srcdir@ + +TESTNAME=EX_Groups +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +# Set up default variable values if not supplied by the user. +RM='rm -rf' +CMP='cmp' +DIFF='diff -c' +CP='cp' +DIRNAME='dirname' +LS='ls' +AWK='awk' + +nerrors=0 + +# where the libs exist +HDFLIB_HOME="$top_srcdir/java/lib" +BLDLIBDIR="$top_builddir/hdf5/lib" +BLDREFDIR="./groups" +BLDDIR="." +HDFTEST_HOME="$top_srcdir/java/examples/groups" +JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar +TESTJARFILE=jar@PACKAGE_TARNAME@groups.jar +test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR +test -d $BLDREFDIR || mkdir -p $BLDREFDIR + +###################################################################### +# library files +# -------------------------------------------------------------------- +# All the library files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_LIBRARY_FILES=" +$HDFLIB_HOME/slf4j-api-1.7.5.jar +$HDFLIB_HOME/ext/slf4j-simple-1.7.5.jar +$top_builddir/src/.libs/libhdf5.* +$top_builddir/java/src/jni/.libs/libhdf5_java.* +$top_builddir/java/src/$JARFILE +" +LIST_REF_FILES=" +$HDFTEST_HOME/h5ex_g_iterate.h5 +$HDFTEST_HOME/h5ex_g_visit.h5 +" +LIST_DATA_FILES=" +$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Create.txt +$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Iterate.txt +$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Compact.txt +$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Corder.txt +$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Intermediate.txt +$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Phase.txt +$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Visit.txt +" + +# +# copy files from source dirs to test dir +# +COPY_LIBFILES="$LIST_LIBRARY_FILES" + +COPY_LIBFILES_TO_BLDLIBDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_LIBFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $BLDLIBDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} + +CLEAN_LIBFILES_AND_BLDLIBDIR() +{ + # skip rm if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $HDFLIB_HOME/slf4j-api-1.7.5.jar` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $RM $BLDLIBDIR + fi +} + +COPY_DATAFILES="$LIST_DATA_FILES" + +COPY_DATAFILES_TO_BLDDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_DATAFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $BLDDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} + +CLEAN_DATAFILES_AND_BLDDIR() +{ + $RM $BLDDIR/examples.groups.H5Ex_G_*.txt + $RM $BLDDIR/H5Ex_G_*.out + $RM $BLDDIR/H5Ex_G_*.h5 + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then SDIR=`$DIRNAME $tstfile` + $RM $BLDDIR/h5ex_g_iterate.h5 + $RM $BLDDIR/h5ex_g_visit.h5 + fi +} + +COPY_REFFILES="$LIST_REF_FILES" + +COPY_REFFILES_TO_BLDREFDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_REFFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDREFDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $BLDREFDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} + +CLEAN_REFFILES_AND_BLDREFDIR() +{ + # skip rm if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $HDFTEST_HOME/h5ex_g_iterate.h5` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDREFDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $RM $BLDREFDIR + fi +} + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Testing". +# +TESTING() { + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +# where Java is installed (requires jdk1.7.x) +JAVAEXE=@JAVA@ +JAVAEXEFLAGS=@H5_JAVAFLAGS@ + +############################################################################### +# DO NOT MODIFY BELOW THIS LINE +############################################################################### + +# prepare for test +COPY_LIBFILES_TO_BLDLIBDIR +COPY_DATAFILES_TO_BLDDIR +COPY_REFFILES_TO_BLDREFDIR + +CPATH=".:"$BLDLIBDIR"/"$JARFILE":"$BLDLIBDIR"/slf4j-api-1.7.5.jar:"$BLDLIBDIR"/slf4j-simple-1.7.5.jar:"$TESTJARFILE"" + +TEST=/usr/bin/test +if [ ! -x /usr/bin/test ] +then +TEST=`which test` +fi + +if $TEST -z "$CLASSPATH"; then + CLASSPATH="" +fi +CLASSPATH=$CPATH":"$CLASSPATH +export CLASSPATH + +if $TEST -n "$JAVAPATH" ; then + PATH=$JAVAPATH":"$PATH + export PATH +fi + +if $TEST -e /bin/uname; then + os_name=`/bin/uname -s` +elif $TEST -e /usr/bin/uname; then + os_name=`/usr/bin/uname -s` +else + os_name=unknown +fi + +if $TEST -z "$LD_LIBRARY_PATH" ; then + LD_LIBRARY_PATH="" +fi + +case $os_name in + Darwin) + DYLD_LIBRARY_PATH=$BLDLIBDIR:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH + LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH + ;; + *) + LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH + ;; +esac + +export LD_LIBRARY_PATH + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Create" +TESTING examples.groups.H5Ex_G_Create +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Create > H5Ex_G_Create.out) +if diff H5Ex_G_Create.out examples.groups.H5Ex_G_Create.txt > /dev/null; then + echo " PASSED groups.H5Ex_G_Create" +else + echo "**FAILED** groups.H5Ex_G_Create" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Iterate" +TESTING examples.groups.H5Ex_G_Iterate +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Iterate > H5Ex_G_Iterate.out) +if diff H5Ex_G_Iterate.out examples.groups.H5Ex_G_Iterate.txt > /dev/null; then + echo " PASSED groups.H5Ex_G_Iterate" +else + echo "**FAILED** groups.H5Ex_G_Iterate" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Compact" +TESTING examples.groups.H5Ex_G_Compact +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Compact > H5Ex_G_Compact.out) +if diff H5Ex_G_Compact.out examples.groups.H5Ex_G_Compact.txt > /dev/null; then + echo " PASSED groups.H5Ex_G_Compact" +else + echo "**FAILED** groups.H5Ex_G_Compact" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Corder" +TESTING examples.groups.H5Ex_G_Corder +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Corder > H5Ex_G_Corder.out) +if diff H5Ex_G_Corder.out examples.groups.H5Ex_G_Corder.txt > /dev/null; then + echo " PASSED groups.H5Ex_G_Corder" +else + echo "**FAILED** groups.H5Ex_G_Corder" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Intermediate" +TESTING examples.groups.H5Ex_G_Intermediate +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Intermediate > H5Ex_G_Intermediate.out) +if diff H5Ex_G_Intermediate.out examples.groups.H5Ex_G_Intermediate.txt > /dev/null; then + echo " PASSED groups.H5Ex_G_Intermediate" +else + echo "**FAILED** groups.H5Ex_G_Intermediate" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Phase" +TESTING examples.groups.H5Ex_G_Phase +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Phase > H5Ex_G_Phase.out) +if diff H5Ex_G_Phase.out examples.groups.H5Ex_G_Phase.txt > /dev/null; then + echo " PASSED groups.H5Ex_G_Phase" +else + echo "**FAILED** groups.H5Ex_G_Phase" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Visit" +TESTING examples.groups.H5Ex_G_Visit +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Visit > H5Ex_G_Visit.out) +if diff H5Ex_G_Visit.out examples.groups.H5Ex_G_Visit.txt > /dev/null; then + echo " PASSED groups.H5Ex_G_Visit" +else + echo "**FAILED** groups.H5Ex_G_Visit" + nerrors="`expr $nerrors + 1`" +fi + +# Clean up temporary files/directories +CLEAN_LIBFILES_AND_BLDLIBDIR +CLEAN_DATAFILES_AND_BLDDIR +CLEAN_REFFILES_AND_BLDREFDIR + +# Report test results and exit +if test $nerrors -eq 0 ; then + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE +fi diff --git a/java/examples/groups/Makefile.am b/java/examples/groups/Makefile.am index 08721e0..4da17f9 100644 --- a/java/examples/groups/Makefile.am +++ b/java/examples/groups/Makefile.am @@ -53,10 +53,10 @@ noinst_DATA = $(jarfile) .PHONY: classes -check_SCRIPTS = runExample.sh +check_SCRIPTS = JavaGroupExample.sh TEST_SCRIPT = $(check_SCRIPTS) -CLEANFILES = classnoinst.stamp $(jarfile) $(JAVAROOT)/$(pkgpath)/*.class runExample.sh +CLEANFILES = classnoinst.stamp $(jarfile) $(JAVAROOT)/$(pkgpath)/*.class JavaGroupExample.sh clean: rm -rf $(JAVAROOT)/* diff --git a/java/examples/groups/runExample.sh.in b/java/examples/groups/runExample.sh.in deleted file mode 100644 index 53c0045..0000000 --- a/java/examples/groups/runExample.sh.in +++ /dev/null @@ -1,354 +0,0 @@ -#! /bin/sh -# -# Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -top_builddir=@top_builddir@ -top_srcdir=@top_srcdir@ -srcdir=@srcdir@ - -TESTNAME=EX_Groups -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -# Set up default variable values if not supplied by the user. -RM='rm -rf' -CMP='cmp' -DIFF='diff -c' -CP='cp' -DIRNAME='dirname' -LS='ls' -AWK='awk' - -nerrors=0 - -# where the libs exist -HDFLIB_HOME="$top_srcdir/java/lib" -BLDLIBDIR="$top_builddir/hdf5/lib" -BLDREFDIR="./groups" -BLDDIR="." -HDFTEST_HOME="$top_srcdir/java/examples/groups" -JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar -TESTJARFILE=jar@PACKAGE_TARNAME@groups.jar -test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR -test -d $BLDREFDIR || mkdir -p $BLDREFDIR - -###################################################################### -# library files -# -------------------------------------------------------------------- -# All the library files copy from source directory to test directory -# NOTE: Keep this framework to add/remove test files. -# This list are also used for checking exist. -# Comment '#' without space can be used. -# -------------------------------------------------------------------- -LIST_LIBRARY_FILES=" -$HDFLIB_HOME/slf4j-api-1.7.5.jar -$HDFLIB_HOME/ext/slf4j-simple-1.7.5.jar -$top_builddir/src/.libs/libhdf5.* -$top_builddir/java/src/jni/.libs/libhdf5_java.* -$top_builddir/java/src/$JARFILE -" -LIST_REF_FILES=" -$HDFTEST_HOME/h5ex_g_iterate.h5 -$HDFTEST_HOME/h5ex_g_visit.h5 -" -LIST_DATA_FILES=" -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Create.txt -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Iterate.txt -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Compact.txt -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Corder.txt -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Intermediate.txt -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Phase.txt -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Visit.txt -" - -# -# copy files from source dirs to test dir -# -COPY_LIBFILES="$LIST_LIBRARY_FILES" - -COPY_LIBFILES_TO_BLDLIBDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_LIBFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $BLDLIBDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_LIBFILES_AND_BLDLIBDIR() -{ - # skip rm if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $HDFLIB_HOME/slf4j-api-1.7.5.jar` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $RM $BLDLIBDIR - fi -} - -COPY_DATAFILES="$LIST_DATA_FILES" - -COPY_DATAFILES_TO_BLDDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_DATAFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $BLDDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_DATAFILES_AND_BLDDIR() -{ - $RM $BLDDIR/examples.groups.H5Ex_G_*.txt - $RM $BLDDIR/H5Ex_G_*.out - $RM $BLDDIR/H5Ex_G_*.h5 - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then SDIR=`$DIRNAME $tstfile` - $RM $BLDDIR/h5ex_g_iterate.h5 - $RM $BLDDIR/h5ex_g_visit.h5 - fi -} - -COPY_REFFILES="$LIST_REF_FILES" - -COPY_REFFILES_TO_BLDREFDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_REFFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDREFDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $BLDREFDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_REFFILES_AND_BLDREFDIR() -{ - # skip rm if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $HDFTEST_HOME/h5ex_g_iterate.h5` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDREFDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $RM $BLDREFDIR - fi -} - -# Print a line-line message left justified in a field of 70 characters -# beginning with the word "Testing". -# -TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# where Java is installed (requires jdk1.7.x) -JAVAEXE=@JAVA@ -JAVAEXEFLAGS=@H5_JAVAFLAGS@ - -############################################################################### -# DO NOT MODIFY BELOW THIS LINE -############################################################################### - -# prepare for test -COPY_LIBFILES_TO_BLDLIBDIR -COPY_DATAFILES_TO_BLDDIR -COPY_REFFILES_TO_BLDREFDIR - -CPATH=".:"$BLDLIBDIR"/"$JARFILE":"$BLDLIBDIR"/slf4j-api-1.7.5.jar:"$BLDLIBDIR"/slf4j-simple-1.7.5.jar:"$TESTJARFILE"" - -TEST=/usr/bin/test -if [ ! -x /usr/bin/test ] -then -TEST=`which test` -fi - -if $TEST -z "$CLASSPATH"; then - CLASSPATH="" -fi -CLASSPATH=$CPATH":"$CLASSPATH -export CLASSPATH - -if $TEST -n "$JAVAPATH" ; then - PATH=$JAVAPATH":"$PATH - export PATH -fi - -if $TEST -e /bin/uname; then - os_name=`/bin/uname -s` -elif $TEST -e /usr/bin/uname; then - os_name=`/usr/bin/uname -s` -else - os_name=unknown -fi - -if $TEST -z "$LD_LIBRARY_PATH" ; then - LD_LIBRARY_PATH="" -fi - -case $os_name in - Darwin) - DYLD_LIBRARY_PATH=$BLDLIBDIR:$DYLD_LIBRARY_PATH - export DYLD_LIBRARY_PATH - LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH - ;; - *) - LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH - ;; -esac - -export LD_LIBRARY_PATH - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Create" -TESTING examples.groups.H5Ex_G_Create -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Create > H5Ex_G_Create.out) -if diff H5Ex_G_Create.out examples.groups.H5Ex_G_Create.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Create" -else - echo "**FAILED** groups.H5Ex_G_Create" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Iterate" -TESTING examples.groups.H5Ex_G_Iterate -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Iterate > H5Ex_G_Iterate.out) -if diff H5Ex_G_Iterate.out examples.groups.H5Ex_G_Iterate.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Iterate" -else - echo "**FAILED** groups.H5Ex_G_Iterate" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Compact" -TESTING examples.groups.H5Ex_G_Compact -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Compact > H5Ex_G_Compact.out) -if diff H5Ex_G_Compact.out examples.groups.H5Ex_G_Compact.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Compact" -else - echo "**FAILED** groups.H5Ex_G_Compact" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Corder" -TESTING examples.groups.H5Ex_G_Corder -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Corder > H5Ex_G_Corder.out) -if diff H5Ex_G_Corder.out examples.groups.H5Ex_G_Corder.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Corder" -else - echo "**FAILED** groups.H5Ex_G_Corder" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Intermediate" -TESTING examples.groups.H5Ex_G_Intermediate -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Intermediate > H5Ex_G_Intermediate.out) -if diff H5Ex_G_Intermediate.out examples.groups.H5Ex_G_Intermediate.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Intermediate" -else - echo "**FAILED** groups.H5Ex_G_Intermediate" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Phase" -TESTING examples.groups.H5Ex_G_Phase -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Phase > H5Ex_G_Phase.out) -if diff H5Ex_G_Phase.out examples.groups.H5Ex_G_Phase.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Phase" -else - echo "**FAILED** groups.H5Ex_G_Phase" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Visit" -TESTING examples.groups.H5Ex_G_Visit -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Visit > H5Ex_G_Visit.out) -if diff H5Ex_G_Visit.out examples.groups.H5Ex_G_Visit.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Visit" -else - echo "**FAILED** groups.H5Ex_G_Visit" - nerrors="`expr $nerrors + 1`" -fi - -# Clean up temporary files/directories -CLEAN_LIBFILES_AND_BLDLIBDIR -CLEAN_DATAFILES_AND_BLDDIR -CLEAN_REFFILES_AND_BLDREFDIR - -# Report test results and exit -if test $nerrors -eq 0 ; then - echo "All $TESTNAME tests passed." - exit $EXIT_SUCCESS -else - echo "$TESTNAME tests failed with $nerrors errors." - exit $EXIT_FAILURE -fi diff --git a/java/examples/intro/JavaIntroExample.sh.in b/java/examples/intro/JavaIntroExample.sh.in new file mode 100644 index 0000000..3c3036a --- /dev/null +++ b/java/examples/intro/JavaIntroExample.sh.in @@ -0,0 +1,296 @@ +#! /bin/sh +# +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +top_builddir=@top_builddir@ +top_srcdir=@top_srcdir@ +srcdir=@srcdir@ + +TESTNAME=EX_Intro +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +# Set up default variable values if not supplied by the user. +RM='rm -rf' +CMP='cmp' +DIFF='diff -c' +CP='cp' +DIRNAME='dirname' +LS='ls' +AWK='awk' + +nerrors=0 + +# where the libs exist +HDFLIB_HOME="$top_srcdir/java/lib" +BLDLIBDIR="$top_builddir/hdf5/lib" +BLDDIR="." +HDFTEST_HOME="$top_srcdir/java/examples/intro" +JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar +TESTJARFILE=jar@PACKAGE_TARNAME@intro.jar +test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR + +###################################################################### +# library files +# -------------------------------------------------------------------- +# All the library files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_LIBRARY_FILES=" +$HDFLIB_HOME/slf4j-api-1.7.5.jar +$HDFLIB_HOME/ext/slf4j-simple-1.7.5.jar +$top_builddir/src/.libs/libhdf5.* +$top_builddir/java/src/jni/.libs/libhdf5_java.* +$top_builddir/java/src/$JARFILE +" +LIST_DATA_FILES=" +$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateDataset.txt +$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateAttribute.txt +$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateFile.txt +$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateGroup.txt +$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateGroupAbsoluteRelative.txt +$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateGroupDataset.txt +$HDFTEST_HOME/../testfiles/examples.intro.H5_ReadWrite.txt +" + +# +# copy files from source dirs to test dir +# +COPY_LIBFILES="$LIST_LIBRARY_FILES" + +COPY_LIBFILES_TO_BLDLIBDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_LIBFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $BLDLIBDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} + +CLEAN_LIBFILES_AND_BLDLIBDIR() +{ + # skip rm if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $HDFLIB_HOME/slf4j-api-1.7.5.jar` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $RM $BLDLIBDIR + fi +} + +COPY_DATAFILES="$LIST_DATA_FILES" + +COPY_DATAFILES_TO_BLDDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_DATAFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $BLDDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} + +CLEAN_DATAFILES_AND_BLDDIR() +{ + $RM $BLDDIR/examples.intro.H5_*.txt + $RM $BLDDIR/H5_*.out + $RM $BLDDIR/H5_*.h5 +} + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Testing". +# +TESTING() { + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +# where Java is installed (requires jdk1.7.x) +JAVAEXE=@JAVA@ +JAVAEXEFLAGS=@H5_JAVAFLAGS@ + +############################################################################### +# DO NOT MODIFY BELOW THIS LINE +############################################################################### + +# prepare for test +COPY_LIBFILES_TO_BLDLIBDIR +COPY_DATAFILES_TO_BLDDIR + +CPATH=".:"$BLDLIBDIR"/"$JARFILE":"$BLDLIBDIR"/slf4j-api-1.7.5.jar:"$BLDLIBDIR"/slf4j-simple-1.7.5.jar:"$TESTJARFILE"" + +TEST=/usr/bin/test +if [ ! -x /usr/bin/test ] +then +TEST=`which test` +fi + +if $TEST -z "$CLASSPATH"; then + CLASSPATH="" +fi +CLASSPATH=$CPATH":"$CLASSPATH +export CLASSPATH + +if $TEST -n "$JAVAPATH" ; then + PATH=$JAVAPATH":"$PATH + export PATH +fi + +if $TEST -e /bin/uname; then + os_name=`/bin/uname -s` +elif $TEST -e /usr/bin/uname; then + os_name=`/usr/bin/uname -s` +else + os_name=unknown +fi + +if $TEST -z "$LD_LIBRARY_PATH" ; then + LD_LIBRARY_PATH="" +fi + +case $os_name in + Darwin) + DYLD_LIBRARY_PATH=$BLDLIBDIR:$DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH + LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH + ;; + *) + LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH + ;; +esac + +export LD_LIBRARY_PATH + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateDataset" +TESTING examples.intro.H5_CreateDataset +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateDataset > H5_CreateDataset.out) +if diff H5_CreateDataset.out examples.intro.H5_CreateDataset.txt > /dev/null; then + echo " PASSED intro.H5_CreateDataset" +else + echo "**FAILED** intro.H5_CreateDataset" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateAttribute" +TESTING examples.intro.H5_CreateAttribute +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateAttribute > H5_CreateAttribute.out) +if diff H5_CreateAttribute.out examples.intro.H5_CreateAttribute.txt > /dev/null; then + echo " PASSED intro.H5_CreateAttribute" +else + echo "**FAILED** intro.H5_CreateAttribute" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateFile" +TESTING examples.intro.H5_CreateFile +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateFile > H5_CreateFile.out) +if diff H5_CreateFile.out examples.intro.H5_CreateFile.txt > /dev/null; then + echo " PASSED intro.H5_CreateFile" +else + echo "**FAILED** intro.H5_CreateFile" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroup" +TESTING examples.intro.H5_CreateGroup +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroup > H5_CreateGroup.out) +if diff H5_CreateGroup.out examples.intro.H5_CreateGroup.txt > /dev/null; then + echo " PASSED intro.H5_CreateGroup" +else + echo "**FAILED** intro.H5_CreateGroup" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupAbsoluteRelative" +TESTING examples.intro.H5_CreateGroupAbsoluteRelative +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupAbsoluteRelative > H5_CreateGroupAbsoluteRelative.out) +if diff H5_CreateGroupAbsoluteRelative.out examples.intro.H5_CreateGroupAbsoluteRelative.txt > /dev/null; then + echo " PASSED intro.H5_CreateGroupAbsoluteRelative" +else + echo "**FAILED** intro.H5_CreateGroupAbsoluteRelative" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupDataset" +TESTING examples.intro.H5_CreateGroupDataset +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupDataset > H5_CreateGroupDataset.out) +if diff H5_CreateGroupDataset.out examples.intro.H5_CreateGroupDataset.txt > /dev/null; then + echo " PASSED intro.H5_CreateGroupDataset" +else + echo "**FAILED** intro.H5_CreateGroupDataset" + nerrors="`expr $nerrors + 1`" +fi + +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_ReadWrite" +TESTING examples.intro.H5_ReadWrite +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_ReadWrite > H5_ReadWrite.out) +if diff H5_ReadWrite.out examples.intro.H5_ReadWrite.txt > /dev/null; then + echo " PASSED intro.H5_ReadWrite" +else + echo "**FAILED** intro.H5_ReadWrite" + nerrors="`expr $nerrors + 1`" +fi + +# Clean up temporary files/directories +CLEAN_LIBFILES_AND_BLDLIBDIR +CLEAN_DATAFILES_AND_BLDDIR + +# Report test results and exit +if test $nerrors -eq 0 ; then + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE +fi diff --git a/java/examples/intro/Makefile.am b/java/examples/intro/Makefile.am index 95743d9..0df08cb 100644 --- a/java/examples/intro/Makefile.am +++ b/java/examples/intro/Makefile.am @@ -52,10 +52,10 @@ noinst_DATA = $(jarfile) .PHONY: classes -check_SCRIPTS = runExample.sh +check_SCRIPTS = JavaIntroExample.sh TEST_SCRIPT = $(check_SCRIPTS) -CLEANFILES = classnoinst.stamp $(jarfile) $(JAVAROOT)/$(pkgpath)/*.class runExample.sh +CLEANFILES = classnoinst.stamp $(jarfile) $(JAVAROOT)/$(pkgpath)/*.class JavaIntroExample.sh clean: rm -rf $(JAVAROOT)/* diff --git a/java/examples/intro/runExample.sh.in b/java/examples/intro/runExample.sh.in deleted file mode 100644 index 3c3036a..0000000 --- a/java/examples/intro/runExample.sh.in +++ /dev/null @@ -1,296 +0,0 @@ -#! /bin/sh -# -# Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -top_builddir=@top_builddir@ -top_srcdir=@top_srcdir@ -srcdir=@srcdir@ - -TESTNAME=EX_Intro -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -# Set up default variable values if not supplied by the user. -RM='rm -rf' -CMP='cmp' -DIFF='diff -c' -CP='cp' -DIRNAME='dirname' -LS='ls' -AWK='awk' - -nerrors=0 - -# where the libs exist -HDFLIB_HOME="$top_srcdir/java/lib" -BLDLIBDIR="$top_builddir/hdf5/lib" -BLDDIR="." -HDFTEST_HOME="$top_srcdir/java/examples/intro" -JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar -TESTJARFILE=jar@PACKAGE_TARNAME@intro.jar -test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR - -###################################################################### -# library files -# -------------------------------------------------------------------- -# All the library files copy from source directory to test directory -# NOTE: Keep this framework to add/remove test files. -# This list are also used for checking exist. -# Comment '#' without space can be used. -# -------------------------------------------------------------------- -LIST_LIBRARY_FILES=" -$HDFLIB_HOME/slf4j-api-1.7.5.jar -$HDFLIB_HOME/ext/slf4j-simple-1.7.5.jar -$top_builddir/src/.libs/libhdf5.* -$top_builddir/java/src/jni/.libs/libhdf5_java.* -$top_builddir/java/src/$JARFILE -" -LIST_DATA_FILES=" -$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateDataset.txt -$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateAttribute.txt -$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateFile.txt -$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateGroup.txt -$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateGroupAbsoluteRelative.txt -$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateGroupDataset.txt -$HDFTEST_HOME/../testfiles/examples.intro.H5_ReadWrite.txt -" - -# -# copy files from source dirs to test dir -# -COPY_LIBFILES="$LIST_LIBRARY_FILES" - -COPY_LIBFILES_TO_BLDLIBDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_LIBFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $BLDLIBDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_LIBFILES_AND_BLDLIBDIR() -{ - # skip rm if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $HDFLIB_HOME/slf4j-api-1.7.5.jar` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $RM $BLDLIBDIR - fi -} - -COPY_DATAFILES="$LIST_DATA_FILES" - -COPY_DATAFILES_TO_BLDDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_DATAFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $BLDDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_DATAFILES_AND_BLDDIR() -{ - $RM $BLDDIR/examples.intro.H5_*.txt - $RM $BLDDIR/H5_*.out - $RM $BLDDIR/H5_*.h5 -} - -# Print a line-line message left justified in a field of 70 characters -# beginning with the word "Testing". -# -TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# where Java is installed (requires jdk1.7.x) -JAVAEXE=@JAVA@ -JAVAEXEFLAGS=@H5_JAVAFLAGS@ - -############################################################################### -# DO NOT MODIFY BELOW THIS LINE -############################################################################### - -# prepare for test -COPY_LIBFILES_TO_BLDLIBDIR -COPY_DATAFILES_TO_BLDDIR - -CPATH=".:"$BLDLIBDIR"/"$JARFILE":"$BLDLIBDIR"/slf4j-api-1.7.5.jar:"$BLDLIBDIR"/slf4j-simple-1.7.5.jar:"$TESTJARFILE"" - -TEST=/usr/bin/test -if [ ! -x /usr/bin/test ] -then -TEST=`which test` -fi - -if $TEST -z "$CLASSPATH"; then - CLASSPATH="" -fi -CLASSPATH=$CPATH":"$CLASSPATH -export CLASSPATH - -if $TEST -n "$JAVAPATH" ; then - PATH=$JAVAPATH":"$PATH - export PATH -fi - -if $TEST -e /bin/uname; then - os_name=`/bin/uname -s` -elif $TEST -e /usr/bin/uname; then - os_name=`/usr/bin/uname -s` -else - os_name=unknown -fi - -if $TEST -z "$LD_LIBRARY_PATH" ; then - LD_LIBRARY_PATH="" -fi - -case $os_name in - Darwin) - DYLD_LIBRARY_PATH=$BLDLIBDIR:$DYLD_LIBRARY_PATH - export DYLD_LIBRARY_PATH - LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH - ;; - *) - LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH - ;; -esac - -export LD_LIBRARY_PATH - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateDataset" -TESTING examples.intro.H5_CreateDataset -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateDataset > H5_CreateDataset.out) -if diff H5_CreateDataset.out examples.intro.H5_CreateDataset.txt > /dev/null; then - echo " PASSED intro.H5_CreateDataset" -else - echo "**FAILED** intro.H5_CreateDataset" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateAttribute" -TESTING examples.intro.H5_CreateAttribute -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateAttribute > H5_CreateAttribute.out) -if diff H5_CreateAttribute.out examples.intro.H5_CreateAttribute.txt > /dev/null; then - echo " PASSED intro.H5_CreateAttribute" -else - echo "**FAILED** intro.H5_CreateAttribute" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateFile" -TESTING examples.intro.H5_CreateFile -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateFile > H5_CreateFile.out) -if diff H5_CreateFile.out examples.intro.H5_CreateFile.txt > /dev/null; then - echo " PASSED intro.H5_CreateFile" -else - echo "**FAILED** intro.H5_CreateFile" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroup" -TESTING examples.intro.H5_CreateGroup -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroup > H5_CreateGroup.out) -if diff H5_CreateGroup.out examples.intro.H5_CreateGroup.txt > /dev/null; then - echo " PASSED intro.H5_CreateGroup" -else - echo "**FAILED** intro.H5_CreateGroup" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupAbsoluteRelative" -TESTING examples.intro.H5_CreateGroupAbsoluteRelative -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupAbsoluteRelative > H5_CreateGroupAbsoluteRelative.out) -if diff H5_CreateGroupAbsoluteRelative.out examples.intro.H5_CreateGroupAbsoluteRelative.txt > /dev/null; then - echo " PASSED intro.H5_CreateGroupAbsoluteRelative" -else - echo "**FAILED** intro.H5_CreateGroupAbsoluteRelative" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupDataset" -TESTING examples.intro.H5_CreateGroupDataset -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupDataset > H5_CreateGroupDataset.out) -if diff H5_CreateGroupDataset.out examples.intro.H5_CreateGroupDataset.txt > /dev/null; then - echo " PASSED intro.H5_CreateGroupDataset" -else - echo "**FAILED** intro.H5_CreateGroupDataset" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_ReadWrite" -TESTING examples.intro.H5_ReadWrite -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_ReadWrite > H5_ReadWrite.out) -if diff H5_ReadWrite.out examples.intro.H5_ReadWrite.txt > /dev/null; then - echo " PASSED intro.H5_ReadWrite" -else - echo "**FAILED** intro.H5_ReadWrite" - nerrors="`expr $nerrors + 1`" -fi - -# Clean up temporary files/directories -CLEAN_LIBFILES_AND_BLDLIBDIR -CLEAN_DATAFILES_AND_BLDDIR - -# Report test results and exit -if test $nerrors -eq 0 ; then - echo "All $TESTNAME tests passed." - exit $EXIT_SUCCESS -else - echo "$TESTNAME tests failed with $nerrors errors." - exit $EXIT_FAILURE -fi -- cgit v0.12 From 758ce30a94cee0ba91359e682b57529ad00bd0da Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Sep 2017 14:38:00 -0500 Subject: Update configure --- configure.ac | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 91800e7..07d8b15 100644 --- a/configure.ac +++ b/configure.ac @@ -918,8 +918,8 @@ H5_FORTRAN_SHARED="no" if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then AC_MSG_CHECKING([if shared Fortran libraries are supported]) H5_FORTRAN_SHARED="yes" - ## tell libtool to do the right thing with COMMON symbols, this fixes - ## corrupt values with COMMON and EQUIVALENCE when building shared + ## tell libtool to do the right thing with COMMON symbols, this fixes + ## corrupt values with COMMON and EQUIVALENCE when building shared ## Fortran libraries on OSX with gnu and Intel compilers (HDFFV-2772). case "`uname`" in Darwin*) @@ -1251,9 +1251,9 @@ AC_ARG_WITH([fnord], ]) ## ---------------------------------------------------------------------- -## Is dmalloc (debug malloc library) requested? It has a header file +## Is dmalloc (debug malloc library) requested? It has a header file ## `dmalloc.h' and a library `-ldmalloc' and their locations might be -## specified with the `--with-dmalloc' command-line switch. The value +## specified with the `--with-dmalloc' command-line switch. The value ## is an include path and/or a library path. If the library path is ## specified then it must be preceded by a comma. ## @@ -3340,7 +3340,7 @@ fi if test "X$HDF_FORTRAN" = "Xyes"; then - ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler + ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler ### on Linux (other OSs have not been tested). ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to ### wl="-Wl,-Wl,," in the libtool file. (HDFFV-10037) @@ -3455,13 +3455,13 @@ AC_CONFIG_FILES([src/libhdf5.settings java/test/junit.sh java/examples/Makefile java/examples/intro/Makefile - java/examples/intro/runExample.sh + java/examples/intro/JavaIntroExample.sh java/examples/datasets/Makefile - java/examples/datasets/runExample.sh + java/examples/datasets/JavaDatasetExample.sh java/examples/datatypes/Makefile - java/examples/datatypes/runExample.sh + java/examples/datatypes/JavaDatatypeExample.sh java/examples/groups/Makefile - java/examples/groups/runExample.sh + java/examples/groups/JavaGroupExample.sh hl/Makefile hl/src/Makefile hl/test/Makefile @@ -3501,8 +3501,8 @@ fi if test "X$HDF_FORTRAN" = "Xyes"; then chmod 755 fortran/src/h5fc - ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler - ## on OS X, which is needed when building shared libraries on OS X. This script + ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler + ## on OS X, which is needed when building shared libraries on OS X. This script ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772) case "`uname`" in Darwin*) @@ -3510,7 +3510,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ;; esac - ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler + ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler ### on Linux (other OSs have not been tested). ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to ### wl="-Wl,-Wl,," in the libtool file. (HDFFV-10037) -- cgit v0.12 From 8880ec672eeb8f57c023938074d1336dfc82e2ed Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 23 Sep 2017 11:17:47 -0500 Subject: Style cleanups and misc. bugfixes discovered during full SWMR development. --- src/H5ACprivate.h | 3 +-- src/H5C.c | 47 +++++++++++++++++++++++++++++------------------ src/H5F.c | 6 +++++- src/H5Fint.c | 8 ++++++-- src/H5Fpkg.h | 30 +++++++++++++++--------------- src/H5Fsuper.c | 3 +++ src/H5MF.c | 1 + src/H5MFdbg.c | 2 +- src/H5Oefl.c | 2 +- src/H5Otest.c | 2 +- src/H5PB.c | 4 ++-- test/ohdr.c | 5 +++-- tools/lib/h5tools_ref.c | 3 ++- 13 files changed, 70 insertions(+), 46 deletions(-) diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index b9e2a60..083ee5b 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -230,7 +230,7 @@ typedef struct H5AC_proxy_entry_t { /* (Note that this currently duplicates some cache functionality) */ } H5AC_proxy_entry_t; - +/* Name of property for ring info in DXPL */ #define H5AC_RING_NAME "H5AC_ring_type" /* Dataset transfer property lists for metadata calls */ @@ -247,7 +247,6 @@ H5_DLLVAR hid_t H5AC_noio_dxpl_id; H5_DLLVAR hid_t H5AC_rawdata_dxpl_id; /* Default cache configuration. */ - #define H5AC__DEFAULT_METADATA_WRITE_STRATEGY \ H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED diff --git a/src/H5C.c b/src/H5C.c index 371fc90..926d3fd 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -4062,8 +4062,7 @@ H5C_destroy_flush_dependency(void *parent_thing, void * child_thing) child_entry->flush_dep_parent_nalloc = 0; } /* end if */ else if(child_entry->flush_dep_parent_nalloc > H5C_FLUSH_DEP_PARENT_INIT - && child_entry->flush_dep_nparents - <= (child_entry->flush_dep_parent_nalloc / 4)) { + && child_entry->flush_dep_nparents <= (child_entry->flush_dep_parent_nalloc / 4)) { if(NULL == (child_entry->flush_dep_parent = (H5C_cache_entry_t **)H5FL_BLK_REALLOC(parent, child_entry->flush_dep_parent, (child_entry->flush_dep_parent_nalloc / 4) * sizeof(H5C_cache_entry_t *)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for flush dependency parent list") child_entry->flush_dep_parent_nalloc /= 4; @@ -6428,7 +6427,7 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, HDassert(entry_ptr->flush_dep_ndirty_children == 0); if(entry_ptr->flush_dep_nparents > 0) if(H5C__mark_flush_dep_clean(entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Can't propagate flush dep clean flag") + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKCLEAN, FAIL, "Can't propagate flush dep clean flag") } /* end if */ } /* end else */ @@ -7989,7 +7988,7 @@ done: static herr_t H5C__mark_flush_dep_clean(H5C_cache_entry_t * entry) { - unsigned u; /* Local index variable */ + int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -7998,16 +7997,19 @@ H5C__mark_flush_dep_clean(H5C_cache_entry_t * entry) HDassert(entry); /* Iterate over the parent entries, if any */ - for(u = 0; u < entry->flush_dep_nparents; u++) { + /* Note reverse iteration order, in case the callback removes the flush + * dependency - QAK, 2017/08/12 + */ + for(i = ((int)entry->flush_dep_nparents) - 1; i >= 0; i--) { /* Sanity check */ - HDassert(entry->flush_dep_parent[u]->flush_dep_ndirty_children > 0); + HDassert(entry->flush_dep_parent[i]->flush_dep_ndirty_children > 0); /* Adjust the parent's number of dirty children */ - entry->flush_dep_parent[u]->flush_dep_ndirty_children--; + entry->flush_dep_parent[i]->flush_dep_ndirty_children--; /* If the parent has a 'notify' callback, send a 'child entry cleaned' notice */ - if(entry->flush_dep_parent[u]->type->notify && - (entry->flush_dep_parent[u]->type->notify)(H5C_NOTIFY_ACTION_CHILD_CLEANED, entry->flush_dep_parent[u]) < 0) + if(entry->flush_dep_parent[i]->type->notify && + (entry->flush_dep_parent[i]->type->notify)(H5C_NOTIFY_ACTION_CHILD_CLEANED, entry->flush_dep_parent[i]) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify parent about child entry dirty flag reset") } /* end for */ @@ -8033,7 +8035,7 @@ done: herr_t H5C__mark_flush_dep_serialized(H5C_cache_entry_t * entry_ptr) { - unsigned u; /* Local index variable */ + int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -8042,18 +8044,21 @@ H5C__mark_flush_dep_serialized(H5C_cache_entry_t * entry_ptr) HDassert(entry_ptr); /* Iterate over the parent entries, if any */ - for(u = 0; u < entry_ptr->flush_dep_nparents; u++) { - + /* Note reverse iteration order, in case the callback removes the flush + * dependency - QAK, 2017/08/12 + */ + for(i = ((int)entry_ptr->flush_dep_nparents) - 1; i >= 0; i--) { + /* Sanity checks */ HDassert(entry_ptr->flush_dep_parent); - HDassert(entry_ptr->flush_dep_parent[u]->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(entry_ptr->flush_dep_parent[u]->flush_dep_nunser_children > 0); + HDassert(entry_ptr->flush_dep_parent[i]->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(entry_ptr->flush_dep_parent[i]->flush_dep_nunser_children > 0); /* decrement the parents number of unserialized children */ - entry_ptr->flush_dep_parent[u]->flush_dep_nunser_children--; + entry_ptr->flush_dep_parent[i]->flush_dep_nunser_children--; /* If the parent has a 'notify' callback, send a 'child entry serialized' notice */ - if(entry_ptr->flush_dep_parent[u]->type->notify && - (entry_ptr->flush_dep_parent[u]->type->notify)(H5C_NOTIFY_ACTION_CHILD_SERIALIZED, entry_ptr->flush_dep_parent[u]) < 0) + if(entry_ptr->flush_dep_parent[i]->type->notify && + (entry_ptr->flush_dep_parent[i]->type->notify)(H5C_NOTIFY_ACTION_CHILD_SERIALIZED, entry_ptr->flush_dep_parent[i]) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify parent about child entry serialized flag set") } /* end for */ @@ -8065,7 +8070,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__mark_flush_dep_unserialized() * - * Purpose: Decrement the flush_dep_nunser_children fields of all the + * Purpose: Increment the flush_dep_nunser_children fields of all the * target entry's flush dependency parents in response to * the target entry becoming unserialized. * @@ -8872,6 +8877,12 @@ H5C_remove_entry(void *_entry) HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove protected entry from cache") if(entry->is_pinned) HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove pinned entry from cache") + /* NOTE: If these two errors are getting tripped because the entry is + * in a flush dependency with a freedspace entry, move the checks + * after the "before evict" message is sent, and add the + * "child being evicted" message to the "before evict" notify + * section below. QAK - 2017/08/03 + */ if(entry->flush_dep_nparents > 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove entry with flush dependency parents from cache") if(entry->flush_dep_nchildren > 0) diff --git a/src/H5F.c b/src/H5F.c index 78fce2a..211f1aa 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -1633,7 +1633,7 @@ H5Fstart_swmr_write(hid_t file_id) if(file->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file superblock version should be at least 3") - HDassert(file->shared->latest_flags == H5F_LATEST_ALL_FLAGS); + HDassert((file->shared->latest_flags | H5F_LATEST_LAYOUT_MSG) > 0); /* Should not be marked for SWMR writing mode already */ if(file->shared->sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS) @@ -1647,6 +1647,10 @@ H5Fstart_swmr_write(hid_t file_id) if(ci_load || ci_write ) HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "can't have both SWMR and MDC cache image") + /* Flush the superblock extension */ + if(H5F_flush_tagged_metadata(file, file->shared->sblock->ext_addr, H5AC_ind_read_dxpl_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, NULL, "unable to flush superblock extension") + /* Flush data buffers */ if(H5F__flush(file, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") diff --git a/src/H5Fint.c b/src/H5Fint.c index e52d539..4c5e00e 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -678,8 +678,10 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t if(H5P_get(plist, H5F_ACS_LATEST_FORMAT_NAME, &latest_format) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'latest format' flag") /* For latest format or SWMR_WRITE, activate all latest version support */ - if(latest_format || (H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)) + if(latest_format) f->shared->latest_flags |= H5F_LATEST_ALL_FLAGS; + else if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) + f->shared->latest_flags |= H5F_LATEST_LAYOUT_MSG; if(H5P_get(plist, H5F_ACS_USE_MDC_LOGGING_NAME, &(f->shared->use_mdc_logging)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'use mdc logging' flag") if(H5P_get(plist, H5F_ACS_START_MDC_LOG_ON_ACCESS_NAME, &(f->shared->start_mdc_log_on_access)) < 0) @@ -1456,11 +1458,13 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, if(H5F_INTENT(file) & H5F_ACC_SWMR_WRITE) file->shared->sblock->status_flags |= H5F_SUPER_SWMR_WRITE_ACCESS; - /* Flush the superblock */ + /* Flush the superblock & superblock extension */ if(H5F_super_dirty(file) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, NULL, "unable to mark superblock as dirty") if(H5F_flush_tagged_metadata(file, H5AC__SUPERBLOCK_TAG, meta_dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, NULL, "unable to flush superblock") + if(H5F_flush_tagged_metadata(file, file->shared->sblock->ext_addr, meta_dxpl_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, NULL, "unable to flush superblock extension") /* Remove the file lock for SWMR_WRITE */ if(use_file_locking && (H5F_INTENT(file) & H5F_ACC_SWMR_WRITE)) { diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 7a5c126..d702506 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -309,16 +309,16 @@ struct H5F_file_t { H5UC_t *grp_btree_shared; /* Ref-counted group B-tree node info */ /* File space allocation information */ - H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */ + H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */ hsize_t fs_threshold; /* Free space section threshold */ - hbool_t fs_persist; /* Free-space persist or not */ + hbool_t fs_persist; /* Free-space persist or not */ hbool_t use_tmp_space; /* Whether temp. file space allocation is allowed */ haddr_t tmp_addr; /* Next address to use for temp. space in the file */ - hbool_t point_of_no_return; /* flag to indicate that we can't go back and delete a freespace header when it's used up */ + hbool_t point_of_no_return; /* Flag to indicate that we can't go back and delete a freespace header when it's used up */ H5F_fs_state_t fs_state[H5F_MEM_PAGE_NTYPES]; /* State of free space manager for each type */ - haddr_t fs_addr[H5F_MEM_PAGE_NTYPES]; /* Address of free space manager info for each type */ - H5FS_t *fs_man[H5F_MEM_PAGE_NTYPES]; /* Free space manager for each file space type */ + haddr_t fs_addr[H5F_MEM_PAGE_NTYPES]; /* Address of free space manager info for each type */ + H5FS_t *fs_man[H5F_MEM_PAGE_NTYPES]; /* Free space manager for each file space type */ hbool_t first_alloc_dealloc; /* TRUE iff free space managers */ /* are persistant and have not */ /* been used accessed for either */ @@ -333,25 +333,25 @@ struct H5F_file_t { /* HADDR_UNDEF if no cache image. */ /* Free-space aggregation info */ - unsigned fs_aggr_merge[H5FD_MEM_NTYPES]; /* Flags for whether free space can merge with aggregator(s) */ - H5FD_mem_t fs_type_map[H5FD_MEM_NTYPES]; /* Mapping of "real" file space type into tracked type */ - H5F_blk_aggr_t meta_aggr; /* Metadata aggregation info (if aggregating metadata allocations) */ - H5F_blk_aggr_t sdata_aggr; /* "Small data" aggregation info (if aggregating "small data" allocations) */ + unsigned fs_aggr_merge[H5FD_MEM_NTYPES]; /* Flags for whether free space can merge with aggregator(s) */ + H5FD_mem_t fs_type_map[H5FD_MEM_NTYPES]; /* Mapping of "real" file space type into tracked type */ + H5F_blk_aggr_t meta_aggr; /* Metadata aggregation info (if aggregating metadata allocations) */ + H5F_blk_aggr_t sdata_aggr; /* "Small data" aggregation info (if aggregating "small data" allocations) */ /* Paged aggregation info */ - hsize_t fs_page_size; /* File space page size */ - size_t pgend_meta_thres; /* Do not track page end meta section <= this threshold */ + hsize_t fs_page_size; /* File space page size */ + size_t pgend_meta_thres; /* Do not track page end meta section <= this threshold */ /* Metadata accumulator information */ - H5F_meta_accum_t accum; /* Metadata accumulator info */ + H5F_meta_accum_t accum; /* Metadata accumulator info */ /* Metadata retry info */ - unsigned read_attempts; /* The # of reads to try when reading metadata with checksum */ - unsigned retries_nbins; /* # of bins for each retries[] */ + unsigned read_attempts; /* The # of reads to try when reading metadata with checksum */ + unsigned retries_nbins; /* # of bins for each retries[] */ uint32_t *retries[H5AC_NTYPES]; /* Track # of read retries for metdata items with checksum */ /* Object flush info */ - H5F_object_flush_t object_flush; /* Information for object flush callback */ + H5F_object_flush_t object_flush; /* Information for object flush callback */ }; /* diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 7c70a64..942a7ed 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -974,6 +974,9 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) /* Bump superblock version if latest superblock version support is enabled */ if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_SUPERBLOCK)) super_vers = HDF5_SUPERBLOCK_VERSION_LATEST; + /* Bump superblock version to use version 3 superblock for SWMR writing */ + else if((H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)) + super_vers = HDF5_SUPERBLOCK_VERSION_3; /* Bump superblock version to create superblock extension for SOHM info */ else if(f->shared->sohm_nindexes > 0) super_vers = HDF5_SUPERBLOCK_VERSION_2; diff --git a/src/H5MF.c b/src/H5MF.c index d7af56a..49c7b77 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -115,6 +115,7 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /* Local Variables */ /*******************/ + /*------------------------------------------------------------------------- * Function: H5MF_init_merge_flags diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 1ae902f..0b300ba 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -155,8 +155,8 @@ done: herr_t H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, FILE *stream, int indent, int fwidth) { - herr_t ret_value = SUCCEED; /* Return value */ H5F_mem_page_t type; /* Memory type for iteration */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 49c442f..ba7a6ee 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -151,7 +151,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, if((s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "unable to get external file name") - if(*s == (char)NULL) + if(*s == (char)'\0') HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "invalid external file name") mesg->slot[u].name = H5MM_xstrdup (s); HDassert(mesg->slot[u].name); diff --git a/src/H5Otest.c b/src/H5Otest.c index f0deade..68462a1 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -731,7 +731,7 @@ H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) /* Allocate and initialize new chunk in the file, moving the found message */ /* (*new_idx returned from this routine is unused here) */ - if(H5O__alloc_chunk(loc->file, H5AC_ind_read_dxpl_id, oh, 40, oh->nmesgs, &found_msg, &new_idx) < 0) + if(H5O__alloc_chunk(loc->file, H5AC_ind_read_dxpl_id, oh, (curr_msg->raw_size + H5O_SIZEOF_MSGHDR_OH(oh)), oh->nmesgs, &found_msg, &new_idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, FAIL, "can't allocate new object header chunk") /* Break out of loop, the message was found */ diff --git a/src/H5PB.c b/src/H5PB.c index 52576f8..63e5e7a 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -1506,7 +1506,7 @@ H5PB__write_entry(const H5F_io_info2_t *fio_info, H5PB_entry_t *page_entry) HDassert(page_entry); /* Retrieve the 'eoa' for the file */ - if(HADDR_UNDEF == (eoa = H5F_get_eoa(fio_info->f, page_entry->type))) + if(HADDR_UNDEF == (eoa = H5F_get_eoa(fio_info->f, (H5FD_mem_t)page_entry->type))) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "driver get_eoa request failed") /* If the starting address of the page is larger than @@ -1525,7 +1525,7 @@ H5PB__write_entry(const H5F_io_info2_t *fio_info, H5PB_entry_t *page_entry) fdio_info.meta_dxpl = fio_info->meta_dxpl; fdio_info.raw_dxpl = fio_info->raw_dxpl; - if(H5FD_write(&fdio_info, page_entry->type, page_entry->addr, page_size, page_entry->page_buf_ptr) < 0) + if(H5FD_write(&fdio_info, (H5FD_mem_t)page_entry->type, page_entry->addr, page_size, page_entry->page_buf_ptr) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "file write failed") } /* end if */ diff --git a/test/ohdr.c b/test/ohdr.c index faec835..3915b38 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -392,8 +392,9 @@ test_ohdr_swmr(hbool_t new_format) if(H5Oget_info(did, &obj_info) < 0) FAIL_STACK_ERROR - if(obj_info.hdr.version != OBJ_VERSION_LATEST) - FAIL_STACK_ERROR + if(new_format) + if(obj_info.hdr.version != OBJ_VERSION_LATEST) + FAIL_STACK_ERROR /* The size of object header should be greater than the speculative read size of H5O_SPEC_READ_SIZE */ /* This will exercise the coding for the re-read of the object header for SWMR access */ diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 6153f0c..d6e5f01 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -166,7 +166,8 @@ haddr_t ref_path_table_lookup(const char *thepath) { H5O_info_t oi; - if((HDstrlen(thepath) == 0) || (thepath == NULL)) + + if((thepath == NULL) || (HDstrlen(thepath) == 0)) return HADDR_UNDEF; /* Allow lookups on the root group, even though it doesn't have any link info */ if(HDstrcmp(thepath, "/")) { -- cgit v0.12 From 31ec370f4d74716e238971197f9f3bf2969ba1d4 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 25 Sep 2017 13:20:41 -0500 Subject: Fixed typos for document file. --- c++/src/H5CppDoc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index ff07822..bfab9cd 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -51,7 +51,7 @@ Datatype Interface (H5T) DataType and subclasses \endverbatim * - * This + * This * table provides a map from the C APIs to the C++ member functions. *
* \section install_sec Installation -- cgit v0.12 From fded10f0815f593301ac88d08d05343c8077746a Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 26 Sep 2017 09:37:43 -0500 Subject: Add note to bin/release script with hint for situations where files generated by autogen.sh are missing, causing chkmanifest to fail. --- bin/release | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/release b/bin/release index 6358b0d..040711a 100755 --- a/bin/release +++ b/bin/release @@ -445,6 +445,12 @@ fi bin/chkmanifest || fail=yes if [ "X$fail" = "Xyes" ]; then if [ $check = yes ]; then + echo "" + echo "Note! If you are running bin/release in a development branch" + echo "later than v 1.8 the MANIFEST check is expected to fail when" + echo "autogen.sh has not been run successfully. Either run autogen.sh " + echo "with /usr/hdf/bin/AUTOTOOLS at the beginning of PATH or add the" + echo "--nocheck argument to the bin/release command." exit 1 else echo "Continuing anyway..." -- cgit v0.12 From 81094ac3cfbf5785c0006516133d0dc34665b81c Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Thu, 28 Sep 2017 16:27:29 -0400 Subject: The initial coding for the superblock read optization --- src/H5FDmpio.h | 21 ++++++ src/H5Fsuper.c | 30 +++++++- testpar/CMakeLists.txt | 1 + testpar/Makefile.am | 2 +- testpar/t_pread.c | 196 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 247 insertions(+), 3 deletions(-) create mode 100644 testpar/t_pread.c diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h index 6ee0a1a..9bcc182 100644 --- a/src/H5FDmpio.h +++ b/src/H5FDmpio.h @@ -29,6 +29,27 @@ #endif /* H5_HAVE_PARALLEL */ #ifdef H5_HAVE_PARALLEL +#define H5FD_GET_MPI_RANK_AND_SIZE(rank,size, f) { \ + (rank) = 0; (size) = 1; \ + if (H5F_HAS_FEATURE((f), H5FD_FEAT_HAS_MPI)) { \ + (rank) = H5F_mpi_get_rank((f)); \ + (size) = H5F_mpi_get_size((f)); \ + } else { \ + int mpi_initialized = 0, mpi_finalized = 0; \ + MPI_Initialized(&mpi_initialized); \ + MPI_Finalized(&mpi_finalized); \ + if (mpi_initialized && !mpi_finalized) { \ + MPI_Comm_rank(MPI_COMM_WORLD, &(rank)); \ + MPI_Comm_size(MPI_COMM_WORLD, &(size)); \ + } \ + }} + +#define H5FD_GET_MPI_COMM(comm, f) { \ + if (H5F_HAS_FEATURE((f), H5FD_FEAT_HAS_MPI)) \ + (comm) = H5F_mpi_get_comm((f)); \ + else (comm) = MPI_COMM_WORLD; \ + } + /*Turn on H5FDmpio_debug if H5F_DEBUG is on */ #ifdef H5F_DEBUG #ifndef H5FDmpio_DEBUG diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 7c70a64..32051f3 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -333,6 +333,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial unsigned rw_flags; /* Read/write permissions for file */ hbool_t skip_eof_check = FALSE; /* Whether to skip checking the EOF value */ herr_t ret_value = SUCCEED; /* Return value */ + int mpi_rank = 0, mpi_size = 1; FUNC_ENTER_PACKAGE_TAG(meta_dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) @@ -354,8 +355,33 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") /* Find the superblock */ - if(H5FD_locate_signature(&fdio_info, &super_addr) < 0) - HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") +#ifdef H5_HAVE_PARALLEL + H5FD_GET_MPI_RANK_AND_SIZE(mpi_rank, mpi_size, f); + /* If we are an MPI application with at least two processes, the + * following superblock signature location optimization is applicable. + */ + if ( mpi_size > 1 ) { + MPI_Comm this_comm = MPI_COMM_NULL; + + if ( mpi_rank == 0 ) { + if(H5FD_locate_signature(&fdio_info, &super_addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") + } + H5FD_GET_MPI_COMM(this_comm, f); + if (( this_comm == MPI_COMM_NULL ) || + ( MPI_Bcast(&super_addr,sizeof(super_addr), MPI_BYTE, 0, this_comm) != MPI_SUCCESS)) + HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") + } + else { + /* Locate the signature as per per the serial library */ +#endif /* H5_HAVE_PARALLEL */ + + if(H5FD_locate_signature(&fdio_info, &super_addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") + +#ifdef H5_HAVE_PARALLEL + } +#endif if(HADDR_UNDEF == super_addr) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "file signature not found") diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 39d23a9..0c9f70e 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -47,6 +47,7 @@ set (H5P_TESTS t_cache t_pflush1 t_pflush2 + t_pread t_pshutdown t_prestart t_init_term diff --git a/testpar/Makefile.am b/testpar/Makefile.am index b0fe0cd..1f15830 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -23,7 +23,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test # Test programs. These are our main targets. # -TEST_PROG_PARA=t_mpi t_bigio testphdf5 t_cache t_cache_image t_pflush1 t_pflush2 t_pshutdown t_prestart t_init_term t_shapesame t_filters_parallel +TEST_PROG_PARA=t_mpi t_bigio testphdf5 t_cache t_cache_image t_pflush1 t_pflush2 t_pread t_pshutdown t_prestart t_init_term t_shapesame t_filters_parallel check_PROGRAMS = $(TEST_PROG_PARA) diff --git a/testpar/t_pread.c b/testpar/t_pread.c new file mode 100644 index 0000000..4512185 --- /dev/null +++ b/testpar/t_pread.c @@ -0,0 +1,196 @@ +#include +#include +#include + +#include "mpi.h" +#include "hdf5.h" + +static char *random_hdf5_text = + "Now is the time for all first-time-users of HDF5 to read their manual or go thru the tutorials!\n\ +While you\'re at it, now is also the time to read up on MPI-IO."; + +static char *datafile_relocated = "relocated_super.h5"; +hbool_t pass = true; + + +static void +generate_test_file( int mpi_rank, int mpi_size ) +{ + FILE *header; + char *datafile_base = "mytestfile.h5"; + char *prologue_file = "hdf5_readme.txt"; + hid_t file_id, memspace, filespace, attr_id, fapl_id, dxpl_id, dset_id; + hsize_t i, offset, count = 1000; + hsize_t dims[1] = {0}; + float nextValue, data_slice[count]; + + pass = true; + + nextValue = (float)(mpi_rank * count); + for(i=0; i 0 ) return; + + /* ---- mpi_rank 0 ------*/ + header = fopen( prologue_file, "w+"); + if (header == NULL) { + pass = false; + HDfprintf(stderr, "FATAL: Unable to create a simple txt file\n"); + return; + } + else { + size_t bytes_written, bytes_to_write = strlen(random_hdf5_text); + bytes_written = fwrite( random_hdf5_text, 1, bytes_to_write , header); + if (bytes_written == 0) { + pass = false; + HDfprintf(stderr, "FATAL: Unable to write a simple txt file\n"); + } + fclose(header); + } + + if ( pass ) { + char cmd[256]; + sprintf(cmd, "../tools/src/h5jam/h5jam -i %s -u %s -o %s", + datafile_base, prologue_file, datafile_relocated); + system(cmd); + unlink(datafile_base); + unlink(prologue_file); + } +} + + +static void +test_parallel_read( int mpi_rank, int mpi_size ) +{ + int status, errors = 0; + hid_t access_plist = -1, dataset = -1; + hid_t file_id = -1, memspace = -1, dataspace = -1; + hsize_t i, offset, count = 1000; + hsize_t dims[1] = {0}; + float nextValue, data_slice[count]; + herr_t ret; + + access_plist = H5Pcreate(H5P_FILE_ACCESS); + if (access_plist >= 0) { + ret = H5Pset_fapl_mpio(access_plist, MPI_COMM_WORLD, MPI_INFO_NULL); + } else pass = false; + if (ret >= 0) { + file_id = H5Fopen(datafile_relocated,H5F_ACC_RDONLY,access_plist); + } else pass = false; + if (file_id >= 0) { + dataset = H5Dopen2(file_id, "dataset0", H5P_DEFAULT); + } else pass = false; + if (dataset >= 0) { + dims[0] = count; + memspace = H5Screate_simple(1, dims, NULL); + } else pass = false; + if ( memspace >= 0 ) { + dataspace = H5Dget_space(dataset); + } else pass = false; + if ( dataspace >= 0 ) { + offset = mpi_rank * count; + ret = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, &offset, NULL, &count, NULL); + } else pass = false; + if ( ret >= 0 ) { + ret = H5Dread(dataset, H5T_NATIVE_FLOAT, memspace, dataspace, H5P_DEFAULT, data_slice); + } else pass = false; + if (ret >= 0) { + nextValue = (float)(mpi_rank * count); + for (i=0; i < count; i++) { + if (data_slice[i] != nextValue) pass = false; + nextValue += 1; + } + } else pass = false; + + status = ( pass ? 0 : -1 ); + MPI_Allreduce( &status, &errors, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD ); + + if ( mpi_rank == 0) + HDfprintf(stderr, "H5Fopen/H5Dread/data_validation %s\n", ((errors == 0) ? "succeeded" : "FAILED")); + + H5Pclose(access_plist); + H5Dclose(dataset); + H5Fclose(file_id); + + /* Cleanup */ + unlink(datafile_relocated); + + return; +} + + +int +main( int argc, char **argv) +{ + int status, errors, mpi_rank, mpi_size; + + if ((status = MPI_Init(&argc, &argv)) != MPI_SUCCESS) { + HDfprintf(stderr, "FATAL: Unable to initialize MPI\n"); + exit(1); + } + if ((status = MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank)) != MPI_SUCCESS) { + HDfprintf(stderr, "FATAL: MPI_Comm_rank returned an error\n"); + exit(2); + } + if ((status = MPI_Comm_size(MPI_COMM_WORLD, &mpi_size)) != MPI_SUCCESS) { + HDfprintf(stderr, "FATAL: MPI_Comm_size returned an error\n"); + exit(2); + } + + generate_test_file( mpi_rank, mpi_size ); + status = ( pass ? 0 : -1 ); + + /* Synch all ranks before attempting the parallel read */ + if ( MPI_Allreduce( &status, &errors, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD ) != MPI_SUCCESS) { + pass = false; + if (mpi_rank == 0) HDfprintf(stderr, "FATAL: MPI_Allreduce returned an error\n"); + } + + if ( errors == 0 ) { + test_parallel_read( mpi_rank, mpi_size ); + } + + MPI_Finalize(); + return 0; +} -- cgit v0.12 From 744b6b282f087ce23310805dc24ce8f8b351fb61 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 30 Sep 2017 09:50:58 -0500 Subject: Better segregate clean & dirty LRU lists so that they are only defined when the H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS macro is defined. --- src/H5C.c | 8 ++++++++ src/H5Cdbg.c | 2 ++ src/H5Cimage.c | 2 ++ src/H5Cpkg.h | 2 ++ src/H5Cprivate.h | 2 ++ test/cache.c | 9 +++++---- test/cache_common.c | 2 ++ 7 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/H5C.c b/src/H5C.c index 926d3fd..0d8cc75 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -366,6 +366,7 @@ H5C_create(size_t max_cache_size, cache_ptr->coll_write_list = NULL; #endif /* H5_HAVE_PARALLEL */ +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS cache_ptr->cLRU_list_len = 0; cache_ptr->cLRU_list_size = (size_t)0; cache_ptr->cLRU_head_ptr = NULL; @@ -375,6 +376,7 @@ H5C_create(size_t max_cache_size, cache_ptr->dLRU_list_size = (size_t)0; cache_ptr->dLRU_head_ptr = NULL; cache_ptr->dLRU_tail_ptr = NULL; +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ cache_ptr->size_increase_possible = FALSE; cache_ptr->flash_size_increase_possible = FALSE; @@ -1481,8 +1483,10 @@ H5C_insert_entry(H5F_t * f, entry_ptr->next = NULL; entry_ptr->prev = NULL; +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS entry_ptr->aux_next = NULL; entry_ptr->aux_prev = NULL; +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ #ifdef H5_HAVE_PARALLEL entry_ptr->coll_next = NULL; @@ -6949,8 +6953,10 @@ H5C_load_entry(H5F_t * f, entry->next = NULL; entry->prev = NULL; +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS entry->aux_next = NULL; entry->aux_prev = NULL; +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ #ifdef H5_HAVE_PARALLEL entry->coll_next = NULL; @@ -7285,6 +7291,7 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, HDassert( H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS ); +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS initial_list_len = cache_ptr->cLRU_list_len; entry_ptr = cache_ptr->cLRU_tail_ptr; @@ -7329,6 +7336,7 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, entry_ptr = prev_ptr; entries_examined++; } +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ } done: diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index 4a08d9b..08c70d9 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -716,6 +716,7 @@ H5C_stats(H5C_t * cache_ptr, (long)(cache_ptr->LRU_list_size), (unsigned long)(cache_ptr->LRU_list_len)); +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS HDfprintf(stdout, "%s current clean LRU size / length = %ld / %lu\n", cache_ptr->prefix, @@ -727,6 +728,7 @@ H5C_stats(H5C_t * cache_ptr, cache_ptr->prefix, (long)(cache_ptr->dLRU_list_size), (unsigned long)(cache_ptr->dLRU_list_len)); +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ HDfprintf(stdout, "%s Total hits / misses / hit_rate = %ld / %ld / %f\n", diff --git a/src/H5Cimage.c b/src/H5Cimage.c index debd30c..53d1712 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -649,8 +649,10 @@ H5C__deserialize_prefetched_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr, /* Initialize fields supporting replacement policies: */ ds_entry_ptr->next = NULL; ds_entry_ptr->prev = NULL; +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS ds_entry_ptr->aux_next = NULL; ds_entry_ptr->aux_prev = NULL; +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ #ifdef H5_HAVE_PARALLEL pf_entry_ptr->coll_next = NULL; pf_entry_ptr->coll_prev = NULL; diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index fdb14a5..d431887 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -4746,6 +4746,7 @@ struct H5C_t { H5C_cache_entry_t * LRU_head_ptr; H5C_cache_entry_t * LRU_tail_ptr; +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS /* Fields for clean LRU list of entries */ uint32_t cLRU_list_len; size_t cLRU_list_size; @@ -4757,6 +4758,7 @@ struct H5C_t { size_t dLRU_list_size; H5C_cache_entry_t * dLRU_head_ptr; H5C_cache_entry_t * dLRU_tail_ptr; +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ #ifdef H5_HAVE_PARALLEL /* Fields for collective metadata reads */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 5335f80..50732ca 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -1648,8 +1648,10 @@ typedef struct H5C_cache_entry_t { /* fields supporting replacement policies: */ struct H5C_cache_entry_t *next; struct H5C_cache_entry_t *prev; +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS struct H5C_cache_entry_t *aux_next; struct H5C_cache_entry_t *aux_prev; +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ #ifdef H5_HAVE_PARALLEL struct H5C_cache_entry_t *coll_next; struct H5C_cache_entry_t *coll_prev; diff --git a/test/cache.c b/test/cache.c index 3df8156..97a1b91 100644 --- a/test/cache.c +++ b/test/cache.c @@ -3116,13 +3116,14 @@ check_insert_entry(unsigned paged) (cache_ptr->pel_len != 2) || (cache_ptr->pel_size != 2 * entry_sizes[entry_type]) || (cache_ptr->LRU_list_len != 2) || - (cache_ptr->LRU_list_size != 2 * entry_sizes[entry_type]) || + (cache_ptr->LRU_list_size != 2 * entry_sizes[entry_type]) #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - (cache_ptr->dLRU_list_len != 2) || + || (cache_ptr->dLRU_list_len != 2) || (cache_ptr->dLRU_list_size != 2 * entry_sizes[entry_type]) || -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ (cache_ptr->cLRU_list_len != 0) || - (cache_ptr->cLRU_list_size != (size_t)0)) { + (cache_ptr->cLRU_list_size != (size_t)0) +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + ) { pass = FALSE; failure_mssg = "Unexpected insert results 10."; diff --git a/test/cache_common.c b/test/cache_common.c index 69bc26a..cadccec 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -2436,8 +2436,10 @@ reset_entries(void) base_addr[j].header.ro_ref_count = FALSE; base_addr[j].header.next = NULL; base_addr[j].header.prev = NULL; +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS base_addr[j].header.aux_next = NULL; base_addr[j].header.aux_prev = NULL; +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ base_addr[j].self = &(base_addr[j]); base_addr[j].cache_ptr = NULL; -- cgit v0.12 From 38e2f0e7847556ba06ee72e9451a1bab022c472e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 2 Oct 2017 09:53:45 -0500 Subject: Update error handling to support ARGS and tools stack --- tools/lib/h5tools_error.h | 16 +-- tools/src/h5repack/h5repack.c | 161 ++++++++------------------- tools/src/h5repack/h5repack_copy.c | 107 +++++++----------- tools/src/h5repack/h5repack_filters.c | 52 ++++----- tools/src/h5repack/h5repack_main.c | 17 --- tools/src/h5repack/h5repack_opttable.c | 191 +++++++++++++++------------------ tools/src/h5repack/h5repack_verify.c | 177 ++++++++++-------------------- 7 files changed, 262 insertions(+), 459 deletions(-) diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index a556b0a..2cdaf74 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -65,16 +65,16 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; * H5TOOLS_INFO macro, used to facilitate error reporting . The arguments are the major * error number, the minor error number, and a description of the error. */ -#define H5TOOLS_INFO(min_id, str) { \ - H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, min_id, str); \ +#define H5TOOLS_INFO(min_id, ...) { \ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, min_id, __VA_ARGS__); \ } /* * HERROR macro, used to facilitate error reporting . The arguments are the major * error number, the minor error number, and a description of the error. */ -#define HERROR(maj_id, min_id, str) { \ - H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, maj_id, min_id, str); \ +#define HERROR(maj_id, min_id, ...) { \ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, maj_id, min_id, __VA_ARGS__); \ ret_value = FAIL; \ } @@ -103,8 +103,8 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; * The return value is assigned to a variable `ret_value' and control branches * to the `catch_except' label, if we're not already past it. */ -#define H5E_THROW(fail_value, min_id, str) { \ - H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, min_id, str); \ +#define H5E_THROW(fail_value, min_id, ...) { \ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, min_id, __VA_ARGS__); \ H5_LEAVE(fail_value) \ } @@ -114,8 +114,8 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; * error string. The return value is assigned to a variable `ret_value' and * control branches to the `done' label. */ -#define HGOTO_ERROR(fail_value, min_id, str) { \ - HERROR(H5E_tools_g, min_id, str); \ +#define HGOTO_ERROR(fail_value, min_id, ...) { \ + HERROR(H5E_tools_g, min_id, __VA_ARGS__); \ HGOTO_DONE(fail_value) \ } diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 76ca117..7ed9a90 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -39,11 +39,6 @@ static int have_request(pack_opt_t *options); * object name requests * * Return: 0, ok, -1, fail - * - * Programmer: pvn@ncsa.uiuc.edu - * - * Date: September, 22, 2003 - * *------------------------------------------------------------------------- */ int h5repack(const char* infile, const char* outfile, pack_opt_t *options) { @@ -68,7 +63,6 @@ int h5repack(const char* infile, const char* outfile, pack_opt_t *options) { * Purpose: initialize options * * Return: 0, ok, -1, fail - * *------------------------------------------------------------------------- */ int @@ -96,7 +90,6 @@ h5repack_init(pack_opt_t *options, int verbose, hbool_t latest) * Function: h5repack_end * * Purpose: free options table - * *------------------------------------------------------------------------- */ @@ -111,18 +104,17 @@ int h5repack_end(pack_opt_t *options) { * Example: -f dset:GZIP=6 * * Return: 0, ok, -1, fail - * *------------------------------------------------------------------------- */ int -h5repack_addfilter(const char* str, pack_opt_t *options) +h5repack_addfilter(const char *str, pack_opt_t *options) { obj_list_t *obj_list = NULL; /* one object list for the -f and -l option entry */ filter_info_t filter; /* filter info for the current -f option entry */ unsigned n_objs; /* number of objects in the current -f or -l option entry */ int is_glb; /* is the filter global */ - /* parse the -f option */ + /* parse the -f (--filter) option */ if (NULL == (obj_list = parse_filter(str, &n_objs, &filter, options, &is_glb))) return -1; @@ -152,11 +144,10 @@ h5repack_addfilter(const char* str, pack_opt_t *options) * Purpose: add a layout option * * Return: 0, ok, -1, fail - * *------------------------------------------------------------------------- */ int -h5repack_addlayout(const char* str, pack_opt_t *options) +h5repack_addlayout(const char *str, pack_opt_t *options) { obj_list_t *obj_list = NULL; /*one object list for the -t and -c option entry */ unsigned n_objs; /*number of objects in the current -t or -c option entry */ @@ -220,11 +211,6 @@ h5repack_addlayout(const char* str, pack_opt_t *options) * returned must be closed after it is no longer needed. * named_datatype_free must be called before the program exits * to free the stack. - * - * Programmer: Neil Fortner - * - * Date: April 14, 2009 - * *------------------------------------------------------------------------- */ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, @@ -304,18 +290,13 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, ret_value = -1; done: - return (ret_value); + return ret_value; } /* end copy_named_datatype */ /*------------------------------------------------------------------------- * Function: named_datatype_free * * Purpose: Frees the stack of named datatypes. - * - * Programmer: Neil Fortner - * - * Date: April 14, 2009 - * *------------------------------------------------------------------------- */ int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) { @@ -346,11 +327,6 @@ done: * loc_id = H5Topen2( fid, name); * * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October, 28, 2003 - * *------------------------------------------------------------------------- */ int @@ -477,7 +453,6 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, buf = (void *)HDmalloc((size_t)(nelmts * msize)); if (buf == NULL) { - error_msg("h5repack", "cannot read into memory\n"); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ if (H5Aread(attr_id, wtype_id, buf) < 0) @@ -489,7 +464,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, */ if ((attr_out = H5Acreate2(loc_out, name, wtype_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Acreate2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Acreate2 failed on ,%s>", name); if (H5Awrite(attr_out, wtype_id, buf) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Awrite failed"); @@ -553,13 +528,10 @@ done: * Purpose: print options, checks for invalid options * * Return: void, return -1 on error - * - * Programmer: pvn@ncsa.uiuc.edu - * - * Date: September, 22, 2003 *------------------------------------------------------------------------- */ static int check_options(pack_opt_t *options) { + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ unsigned int i; int k, j, has_cp = 0, has_ck = 0; char slayout[30]; @@ -586,11 +558,10 @@ static int check_options(pack_opt_t *options) { break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: - error_msg("invalid layout\n"); - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid layout"); default: strcpy(slayout, "invalid layout\n"); - return -1; + HGOTO_DONE(FAIL); } printf(" Apply %s layout to all\n", slayout); if (H5D_CHUNKED == options->layout_g) { @@ -609,25 +580,20 @@ static int check_options(pack_opt_t *options) { if (options->verbose) { printf(" <%s> with chunk size ", name); for (k = 0; k < options->op_tbl->objs[i].chunk.rank; k++) - printf("%d ", - (int) options->op_tbl->objs[i].chunk.chunk_lengths[k]); + printf("%d ", (int) options->op_tbl->objs[i].chunk.chunk_lengths[k]); printf("\n"); } has_ck = 1; } else if (options->op_tbl->objs[i].chunk.rank == -2) { if (options->verbose) - printf(" <%s> %s\n", name, "NONE (contigous)"); + printf(" <%s> %s\n", name, "NONE (contiguous)"); has_ck = 1; } } - if (options->all_layout == 1 && has_ck) { - error_msg( - "invalid chunking input: 'all' option\ - is present with other objects\n"); - return -1; - } + if (options->all_layout == 1 && has_ck) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid chunking input: 'all' option is present with other objects"); /*------------------------------------------------------------------------- * objects to filter @@ -649,8 +615,7 @@ static int check_options(pack_opt_t *options) { break; case H5Z_FILTER_SZIP: case H5Z_FILTER_DEFLATE: - printf(" All with %s, parameter %d\n", get_sfilter(filtn), - options->filter_g[k].cd_values[0]); + printf(" All with %s, parameter %d\n", get_sfilter(filtn), options->filter_g[k].cd_values[0]); break; default: printf(" User Defined %d\n", filtn); @@ -666,48 +631,29 @@ static int check_options(pack_opt_t *options) { for (j = 0; j < pack.nfilters; j++) { if (options->verbose) { - printf(" <%s> with %s filter\n", name, - get_sfilter(pack.filter[j].filtn)); + printf(" <%s> with %s filter\n", name, get_sfilter(pack.filter[j].filtn)); } - has_cp = 1; - } /* j */ } /* i */ - if (options->all_filter == 1 && has_cp) { - error_msg( - "invalid compression input: 'all' option\ - is present with other objects\n"); - return -1; - } + if (options->all_filter == 1 && has_cp) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid compression input: 'all' option is present with other objects"); /*------------------------------------------------------------------------- * check options for the latest format *------------------------------------------------------------------------- */ - if (options->grp_compact < 0) { - error_msg( - "invalid maximum number of links to store as header messages\n"); - return -1; - } - if (options->grp_indexed < 0) { - error_msg( - "invalid minimum number of links to store in the indexed format\n"); - return -1; - } - if (options->grp_indexed > options->grp_compact) { - error_msg( - "minimum indexed size is greater than the maximum compact size\n"); - return -1; - } - for (i = 0; i < 8; i++) { - if (options->msg_size[i] < 0) { - error_msg("invalid shared message size\n"); - return -1; - } - } + if (options->grp_compact < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid maximum number of links to store as header messages"); + if (options->grp_indexed < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid minimum number of links to store in the indexed format"); + if (options->grp_indexed > options->grp_compact) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "minimum indexed size is greater than the maximum compact size"); + for (i = 0; i < 8; i++) + if (options->msg_size[i] < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid shared message size"); /*-------------------------------------------------------------------------------- * verify new user userblock options; file name must be present @@ -715,30 +661,25 @@ static int check_options(pack_opt_t *options) { */ if (options->ublock_filename != NULL && options->ublock_size == 0) { if (options->verbose) { - printf( - "Warning: user block size missing for file %s. Assigning a default size of 1024...\n", + printf("Warning: user block size missing for file %s. Assigning a default size of 1024...\n", options->ublock_filename); options->ublock_size = 1024; } } - if (options->ublock_filename == NULL && options->ublock_size != 0) { - error_msg("file name missing for user block\n", - options->ublock_filename); - return -1; - } + if (options->ublock_filename == NULL && options->ublock_size != 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file name missing for user block", options->ublock_filename); /*-------------------------------------------------------------------------------- * verify alignment options; threshold is zero default but alignment not *--------------------------------------------------------------------------------- */ - if (options->alignment == 0 && options->threshold != 0) { - error_msg("alignment for H5Pset_alignment missing\n"); - return -1; - } + if (options->alignment == 0 && options->threshold != 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "alignment for H5Pset_alignment missing"); - return 0; +done: + return ret_value; } /*------------------------------------------------------------------------- @@ -748,11 +689,6 @@ static int check_options(pack_opt_t *options) { * supplied list * * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September, 23, 2003 - * *------------------------------------------------------------------------- */ static int check_objects(const char* fname, pack_opt_t *options) { @@ -768,8 +704,7 @@ static int check_objects(const char* fname, pack_opt_t *options) { * open the file *------------------------------------------------------------------------- */ - if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) - < 0) { + if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) < 0) { printf("<%s>: %s\n", fname, H5FOPENERROR); return -1; } @@ -786,7 +721,7 @@ static int check_objects(const char* fname, pack_opt_t *options) { /* get the list of objects in the file */ if (h5trav_gettable(fid, travt) < 0) - goto out; + goto done; /*------------------------------------------------------------------------- * compare with user supplied list @@ -794,8 +729,7 @@ static int check_objects(const char* fname, pack_opt_t *options) { */ if (options->verbose) - printf("Opening file <%s>. Searching for objects to modify...\n", - fname); + printf("Opening file <%s>. Searching for objects to modify...\n", fname); for (i = 0; i < options->op_tbl->nelems; i++) { char* name = options->op_tbl->objs[i].path; @@ -806,7 +740,7 @@ static int check_objects(const char* fname, pack_opt_t *options) { if (h5trav_getindext(name, travt) < 0) { error_msg("%s Could not find <%s> in file <%s>. Exiting...\n", (options->verbose ? "\n" : ""), name, fname); - goto out; + goto done; } if (options->verbose) printf("...Found\n"); @@ -831,26 +765,25 @@ static int check_objects(const char* fname, pack_opt_t *options) { } else { if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) - goto out; + goto done; if ((sid = H5Dget_space(did)) < 0) - goto out; + goto done; if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) - goto out; + goto done; HDmemset(dims, 0, sizeof dims); if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) - goto out; + goto done; for (j = 0; j < rank; j++) csize *= dims[j]; if (H5Sclose(sid) < 0) - goto out; + goto done; if (H5Dclose(did) < 0) - goto out; + goto done; } if (csize < ppb) { - printf( - " \n"); - goto out; + printf(" \n"); + goto done; } } break; @@ -867,7 +800,7 @@ static int check_objects(const char* fname, pack_opt_t *options) { trav_table_free(travt); return 0; -out: +done: H5Fclose(fid); trav_table_free(travt); return -1; @@ -879,9 +812,6 @@ out: * Purpose: check if a filter or layout was requested * * Return: 1 yes, 0 no - * - * Date: May, 24, 2007 - * *------------------------------------------------------------------------- */ static int have_request(pack_opt_t *options) { @@ -899,7 +829,6 @@ static int have_request(pack_opt_t *options) { * Purpose: return the filter as a string name * * Return: name of filter, exit on error - * *------------------------------------------------------------------------- */ diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 501f084..47cad13 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -110,8 +110,7 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) *------------------------------------------------------------------------- */ if ((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t) 0)) < 0) { - error_msg("<%s>: %s\n", fnamein, H5FOPENERROR); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fnamein, H5FOPENERROR); } /* get user block size and file space strategy/persist/threshold */ @@ -121,25 +120,21 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) hid_t gcpl_in = -1; /* group creation property list */ if ((fcpl_in = H5Fget_create_plist(fidin)) < 0) { - error_msg("failed to retrieve file creation property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list"); } if (H5Pget_userblock(fcpl_in, &ub_size) < 0) { - error_msg("failed to retrieve userblock size\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_userblock failed to retrieve userblock size"); } /* If the -S option is not set, get "strategy" from the input file */ if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) { - error_msg("failed to retrieve file space strategy\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_strategy failed to retrieve file space strategy"); } /* If the -G option is not set, get "pagesize" from the input file */ if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) { - error_msg("failed to retrieve file space threshold\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_page_size failed to retrieve file space threshold"); } /* open root group */ if ((grp_in = H5Gopen2(fidin, "/", H5P_DEFAULT)) < 0) @@ -154,8 +149,7 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_link_creation_order failed"); if (H5Pclose(fcpl_in) < 0) { - error_msg("failed to close property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed to close property list"); } } @@ -163,14 +157,12 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) if (options->latest || ub_size > 0) { /* Create file creation property list */ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { - error_msg("fail to create a file creation property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list"); } if (ub_size > 0) { if (H5Pset_userblock(fcpl, ub_size) < 0) { - error_msg("failed to set non-default userblock size\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_userblock failed to set non-default userblock size"); } } @@ -181,8 +173,7 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) /* (So that it is created in "dense storage" form) */ if (H5Pset_link_phase_change(fcpl, (unsigned) options->grp_compact, (unsigned) options->grp_indexed) < 0) { - error_msg("fail to adjust group creation parameters for root group\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_link_phase_change failed to adjust group creation parameters for root group"); } for (i = 0; i < 5; i++) { @@ -219,28 +210,24 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) if (nindex > 0) { if (H5Pset_shared_mesg_nindexes(fcpl, nindex) < 0) { - error_msg("fail to set the number of shared object header message indexes\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shared_mesg_nindexes failed to set the number of shared object header message indexes"); } /* msg_size[0]=dataspace, 1=datatype, 2=file value, 3=filter pipleline, 4=attribute */ for (i = 0; i < (nindex - 1); i++) { if (H5Pset_shared_mesg_index(fcpl, i, mesg_type_flags[i], min_mesg_sizes[i]) < 0) { - error_msg("fail to configure the specified shared object header message index\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shared_mesg_index failed to configure the specified shared object header message index"); } /* end if */ } /* end for */ } /* if (nindex>0) */ /* Create file access property list */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - error_msg("Could not create file access property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list"); } /* end if */ if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { - error_msg("Could not set property for using latest version of the format\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_libver_bounds failed to set property for using latest version of the format"); } /* end if */ } /* end if */ } /* end if */ @@ -257,15 +244,13 @@ print_user_block(fnamein, fidin); if (fcpl == H5P_DEFAULT) { /* create a file creation property list */ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { - error_msg("fail to create a file creation property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list"); } } /* set user block size */ if (H5Pset_userblock(fcpl, options->ublock_size) < 0) { - error_msg("failed to set userblock size\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_userblock failed to set userblock size"); } } @@ -278,14 +263,12 @@ print_user_block(fnamein, fidin); if (fapl == H5P_DEFAULT) { /* create a file access property list */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - error_msg("Could not create file access property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list"); } } if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) { - error_msg("failed to set alignment\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_alignment failed to set alignment"); } } @@ -298,14 +281,12 @@ print_user_block(fnamein, fidin); if (fapl == H5P_DEFAULT) { /* create a file access property list */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - error_msg("Could not create file access property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list"); } } if (H5Pset_meta_block_size(fapl, options->meta_block_size) < 0) { - error_msg("failed to set metadata block size\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_meta_block_size failed to set metadata block size"); } } @@ -318,8 +299,7 @@ print_user_block(fnamein, fidin); if (fcpl == H5P_DEFAULT) { /* create a file creation property list */ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { - error_msg("fail to create a file creation property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list"); } } @@ -349,8 +329,7 @@ print_user_block(fnamein, fidin); /* Set file space information as specified */ if(H5Pset_file_space_strategy(fcpl, set_strategy, set_persist, set_threshold) < 0) { - error_msg("failed to set file space strategy\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_file_space_strategy failed to set file space strategy"); } if(options->fs_pagesize == -1) /* A "0" file space page size is specified by user */ @@ -360,8 +339,7 @@ print_user_block(fnamein, fidin); if(set_pagesize != FS_PAGESIZE_DEF) /* Set non-default file space page size as specified */ if(H5Pset_file_space_page_size(fcpl, set_pagesize) < 0) { - error_msg("failed to set file space page size\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_file_space_page_size failed to set file space page size"); } /*------------------------------------------------------------------------- @@ -372,8 +350,7 @@ print_user_block(fnamein, fidin); printf("Making file <%s>...\n", fnameout); if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, fapl)) < 0) { - error_msg("<%s>: Could not create file\n", fnameout); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fcreate could not create file <%s>:", fnameout); } /*------------------------------------------------------------------------- @@ -382,8 +359,7 @@ print_user_block(fnamein, fidin); */ if (options->ublock_size > 0) { if (copy_user_block(options->ublock_filename, fnameout, options->ublock_size) < 0) { - error_msg("Could not copy user block. Exiting...\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not copy user block. Exiting..."); } } @@ -399,15 +375,14 @@ print_user_block(fnamein, fidin); /* get the list of objects in the file */ if (h5trav_gettable(fidin, travt) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed"); /*------------------------------------------------------------------------- * do the copy *------------------------------------------------------------------------- */ if (do_copy_objects(fidin, fidout, travt, options) < 0) { - error_msg("<%s>: Could not copy data to: %s\n", fnamein, fnameout); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_objects from <%s> could not copy data to <%s>", fnamein, fnameout); } /* end if */ /*------------------------------------------------------------------------- @@ -416,8 +391,7 @@ print_user_block(fnamein, fidin); *------------------------------------------------------------------------- */ if (do_copy_refobjs(fidin, fidout, travt, options) < 0) { - printf("h5repack: <%s>: Could not copy data to: %s\n", fnamein, fnameout); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_refobjs from <%s> could not copy data to <%s>", fnamein, fnameout); } /*------------------------------------------------------------------------- @@ -445,8 +419,7 @@ print_user_block(fnamein, fidin); if (ub_size > 0 && options->ublock_size == 0) { if (copy_user_block(fnamein, fnameout, ub_size) < 0) { - error_msg("Could not copy user block. Exiting...\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not copy user block. Exiting..."); } } @@ -533,7 +506,7 @@ int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], /* get chunk dims */ rank_chunk = H5Pget_chunk(dcpl_id, rank_dset, dims_chunk); if (rank_chunk < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed"); for (k = rank_dset; k > 0; --k) size_chunk *= dims_chunk[k - 1]; @@ -595,7 +568,7 @@ int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], hslab_nbytes *= dims_hslab[k - 1]; if (hslab_nbytes <= 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "calculate total size for the hyperslab failed"); } } } @@ -619,7 +592,7 @@ int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], hslab_nbytes *= dims_hslab[k - 1]; if (hslab_nbytes <= 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "calculate total size for the hyperslab failed"); } } @@ -1488,9 +1461,9 @@ static int copy_user_block(const char *infile, const char *outfile, hsize_t size /* Open files */ if ((infid = HDopen(infile, O_RDONLY)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDopen failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDopen failed input file <%s>", infile); if ((outfid = HDopen(outfile, O_WRONLY)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDopen failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDopen failed output file <%s>", outfile); /* Copy the userblock from the input file to the output file */ while (size > 0) { @@ -1504,7 +1477,7 @@ static int copy_user_block(const char *infile, const char *outfile, hsize_t size else nread = HDread(infid, rbuf, (size_t)size); if (nread < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDread failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDread failed to read userblock"); /* Write buffer to destination file */ /* (compensating for interrupted writes & checking for errors, etc.) */ @@ -1566,24 +1539,20 @@ void print_user_block(const char *filename, hid_t fid) /* get user block size */ if(( fcpl = H5Fget_create_plist(fid)) < 0) { - error_msg("failed to retrieve file creation property list\n"); - HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Fget_create_plist failed"); + HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list"); } if(H5Pget_userblock(fcpl, &ub_size) < 0) { - error_msg("failed to retrieve userblock size\n"); - HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pget_userblock failed"); + HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pget_userblock failed to retrieve userblock size"); } if(H5Pclose(fcpl) < 0) { - error_msg("failed to close property list\n"); - HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pclose failed to close property list"); } /* open file */ if((fh = HDopen(filename, O_RDONLY)) < 0) { - error_msg("failed to open file\n"); - HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed"); + HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed to open file <%s>", filename); } size = ub_size; diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index 5ccb2ef..a74e5f3 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -199,6 +199,7 @@ int apply_filters(const char* name, /* object name from traverse list */ pack_opt_t *options, /* repack options */ int *has_filter) /* (OUT) object NAME has a filter */ { + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ int nfilters; /* number of filters in DCPL */ hsize_t chsize[64]; /* chunk size in elements */ H5D_layout_t layout; @@ -208,7 +209,7 @@ int apply_filters(const char* name, /* object name from traverse list */ *has_filter = 0; if (rank == 0) /* scalar dataset, do not apply */ - return 0; + HGOTO_DONE(0); /*------------------------------------------------------------------------- * initialize the assigment object @@ -221,11 +222,11 @@ int apply_filters(const char* name, /* object name from traverse list */ *------------------------------------------------------------------------- */ if (aux_assign_obj(name, options, &obj) == 0) - return 0; + HGOTO_DONE(0); /* get information about input filters */ if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_nfilters failed"); /*------------------------------------------------------------------------- * check if we have filters in the pipeline @@ -236,7 +237,7 @@ int apply_filters(const char* name, /* object name from traverse list */ if (nfilters && obj.nfilters) { *has_filter = 1; if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed"); } /*------------------------------------------------------------------------- @@ -246,11 +247,11 @@ int apply_filters(const char* name, /* object name from traverse list */ */ if (obj.layout == -1) { if ((layout = H5Pget_layout(dcpl_id)) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); if (layout == H5D_CHUNKED) { if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed"); obj.layout = H5D_CHUNKED; obj.chunk.rank = rank; for (i = 0; i < rank; i++) @@ -323,9 +324,9 @@ int apply_filters(const char* name, /* object name from traverse list */ aggression = obj.filter[i].cd_values[0]; /* set up for deflated data */ if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_deflate(dcpl_id, aggression) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_deflate failed"); } break; @@ -343,9 +344,9 @@ int apply_filters(const char* name, /* object name from traverse list */ /* set up for szip data */ if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_szip(dcpl_id, options_mask, pixels_per_block) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_szip failed"); } break; @@ -355,9 +356,9 @@ int apply_filters(const char* name, /* object name from traverse list */ */ case H5Z_FILTER_SHUFFLE: if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_shuffle(dcpl_id) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shuffle failed"); break; /*------------------------------------------------------------------------- @@ -366,9 +367,9 @@ int apply_filters(const char* name, /* object name from traverse list */ */ case H5Z_FILTER_FLETCHER32: if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_fletcher32(dcpl_id) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fletcher32 failed"); break; /*----------- ------------------------------------------------------------- * H5Z_FILTER_NBIT , NBIT compression @@ -376,9 +377,9 @@ int apply_filters(const char* name, /* object name from traverse list */ */ case H5Z_FILTER_NBIT: if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_nbit(dcpl_id) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_nbit failed"); break; /*----------- ------------------------------------------------------------- * H5Z_FILTER_SCALEOFFSET , scale+offset compression @@ -394,9 +395,9 @@ int apply_filters(const char* name, /* object name from traverse list */ scale_factor = (int) obj.filter[i].cd_values[1]; if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_scaleoffset(dcpl_id, scale_type, scale_factor) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_scaleoffset failed"); } break; default: @@ -404,9 +405,9 @@ int apply_filters(const char* name, /* object name from traverse list */ if (H5Pset_filter(dcpl_id, obj.filter[i].filtn, obj.filter[i].filt_flag, obj.filter[i].cd_nelmts, obj.filter[i].cd_values) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_filter failed"); if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); } break; } /* switch */ @@ -422,24 +423,25 @@ int apply_filters(const char* name, /* object name from traverse list */ if (obj.layout >= 0) { /* a layout was defined */ if (H5Pset_layout(dcpl_id, obj.layout) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_layout failed"); if (H5D_CHUNKED == obj.layout) { if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); } else if (H5D_COMPACT == obj.layout) { if (H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_alloc_time failed"); } /* remove filters for the H5D_CONTIGUOUS case */ else if (H5D_CONTIGUOUS == obj.layout) { if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed"); } } - return 0; +done: + return ret_value; } diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index a3f5678..3860451 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -221,10 +221,6 @@ static void usage(const char *prog) { * Purpose: Shutdown MPI & HDF5 and call exit() * * Return: Does not return - * - * Programmer: Quincey Koziol - * Saturday, 31. January 2004 - * *------------------------------------------------------------------------- */ static void leave(int ret) @@ -239,11 +235,6 @@ static void leave(int ret) * Purpose: read comp and chunk options from a file * * Return: void, exit on error - * - * Programmer: pvn@ncsa.uiuc.edu - * - * Date: September, 22, 2003 - * *------------------------------------------------------------------------- */ static @@ -425,7 +416,6 @@ set_sort_order(const char *form) * Function: parse_command_line * * Purpose: parse command line input - * *------------------------------------------------------------------------- */ static @@ -674,13 +664,6 @@ done: * Return: Success: EXIT_SUCCESS(0) * * Failure: EXIT_FAILURE(1) - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * - * Comments: - * *------------------------------------------------------------------------- */ int main(int argc, const char **argv) diff --git a/tools/src/h5repack/h5repack_opttable.c b/tools/src/h5repack/h5repack_opttable.c index 93e34b3..6c409ec 100644 --- a/tools/src/h5repack/h5repack_opttable.c +++ b/tools/src/h5repack/h5repack_opttable.c @@ -21,23 +21,22 @@ * Purpose: initialize a pack_info_t structure * * Return: void - * - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ void init_packobject(pack_info_t *obj) { - int j, k; - - HDstrcpy(obj->path, "\0"); - for (j = 0; j < H5_REPACK_MAX_NFILTERS; j++) { - obj->filter[j].filtn = -1; - for (k = 0; k < CD_VALUES; k++) - obj->filter[j].cd_values[k] = 0; - } - obj->chunk.rank = -1; - obj->refobj_id = -1; - obj->layout = H5D_LAYOUT_ERROR; - obj->nfilters = 0; + int j, k; + + HDstrcpy(obj->path, "\0"); + for (j = 0; j < H5_REPACK_MAX_NFILTERS; j++) { + obj->filter[j].filtn = -1; + for (k = 0; k < CD_VALUES; k++) + obj->filter[j].cd_values[k] = 0; + } + obj->chunk.rank = -1; + obj->refobj_id = -1; + obj->layout = H5D_LAYOUT_ERROR; + obj->nfilters = 0; } /*------------------------------------------------------------------------- @@ -46,20 +45,14 @@ void init_packobject(pack_info_t *obj) { * Purpose: auxiliary function, inserts the filter in object OBJS[ I ] * * Return: void - * *------------------------------------------------------------------------- */ -static void aux_tblinsert_filter(pack_opttbl_t *table, unsigned int I, - filter_info_t filt) { - if (table->objs[I].nfilters < H5_REPACK_MAX_NFILTERS) { - table->objs[I].filter[table->objs[I].nfilters++] = filt; - } - else { - error_msg( - "cannot insert the filter in this object.\ - Maximum capacity exceeded\n"); - } +static void aux_tblinsert_filter(pack_opttbl_t *table, unsigned int I, filter_info_t filt) { + if (table->objs[I].nfilters < H5_REPACK_MAX_NFILTERS) + table->objs[I].filter[table->objs[I].nfilters++] = filt; + else + H5TOOLS_INFO(H5E_tools_min_id_g, "cannot insert the filter in this object. Maximum capacity exceeded"); } /*------------------------------------------------------------------------- @@ -68,30 +61,27 @@ static void aux_tblinsert_filter(pack_opttbl_t *table, unsigned int I, * Purpose: auxiliary function, inserts the layout in object OBJS[ I ] * * Return: void - * *------------------------------------------------------------------------- */ - -static void aux_tblinsert_layout(pack_opttbl_t *table, unsigned int I, - pack_info_t *pack) { - int k; - - table->objs[I].layout = pack->layout; - if (H5D_CHUNKED == pack->layout) { - /* -2 means the NONE option, remove chunking - and set the layout to contiguous */ - if (pack->chunk.rank == -2) { - table->objs[I].layout = H5D_CONTIGUOUS; - table->objs[I].chunk.rank = -2; - } - /* otherwise set the chunking type */ - else { - table->objs[I].chunk.rank = pack->chunk.rank; - for (k = 0; k < pack->chunk.rank; k++) - table->objs[I].chunk.chunk_lengths[k] = - pack->chunk.chunk_lengths[k]; - } - } +static void aux_tblinsert_layout(pack_opttbl_t *table, unsigned int I, pack_info_t *pack) { + int k; + + table->objs[I].layout = pack->layout; + if (H5D_CHUNKED == pack->layout) { + /* -2 means the NONE option, remove chunking + and set the layout to contiguous */ + if (pack->chunk.rank == -2) { + table->objs[I].layout = H5D_CONTIGUOUS; + table->objs[I].chunk.rank = -2; + } + /* otherwise set the chunking type */ + else { + table->objs[I].chunk.rank = pack->chunk.rank; + for (k = 0; k < pack->chunk.rank; k++) + table->objs[I].chunk.chunk_lengths[k] = + pack->chunk.chunk_lengths[k]; + } + } } /*------------------------------------------------------------------------- @@ -100,7 +90,6 @@ static void aux_tblinsert_layout(pack_opttbl_t *table, unsigned int I, * Purpose: auxiliary function, increases the size of the collection by N_OBJS * * Return: 0, ok, -1, fail - * *------------------------------------------------------------------------- */ static int @@ -111,7 +100,7 @@ aux_inctable(pack_opttbl_t *table, unsigned n_objs) table->size += n_objs; table->objs = (pack_info_t*) HDrealloc(table->objs, table->size * sizeof(pack_info_t)); if (table->objs == NULL) { - error_msg("not enough memory for options table\n"); + H5TOOLS_INFO(H5E_tools_min_id_g, "not enough memory for options table"); return -1; } @@ -128,32 +117,30 @@ aux_inctable(pack_opttbl_t *table, unsigned n_objs) * Purpose: init options table * * Return: 0, ok, -1, fail - * - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ int options_table_init(pack_opttbl_t **tbl) { - unsigned int i; - pack_opttbl_t *table; - - if (NULL == (table = (pack_opttbl_t *) HDmalloc(sizeof(pack_opttbl_t)))) { - error_msg("not enough memory for options table\n"); - return -1; - } - - table->size = 30; - table->nelems = 0; - if (NULL == (table->objs = - (pack_info_t*) HDmalloc(table->size * sizeof(pack_info_t)))) { - error_msg("not enough memory for options table\n"); - HDfree(table); - return -1; - } - - for (i = 0; i < table->size; i++) - init_packobject(&table->objs[i]); - - *tbl = table; - return 0; + unsigned int i; + pack_opttbl_t *table; + + if (NULL == (table = (pack_opttbl_t *) HDmalloc(sizeof(pack_opttbl_t)))) { + H5TOOLS_INFO(H5E_tools_min_id_g, "not enough memory for options table"); + return -1; + } + + table->size = 30; + table->nelems = 0; + if (NULL == (table->objs = (pack_info_t*) HDmalloc(table->size * sizeof(pack_info_t)))) { + H5TOOLS_INFO(H5E_tools_min_id_g, "not enough memory for options table"); + HDfree(table); + return -1; + } + + for (i = 0; i < table->size; i++) + init_packobject(&table->objs[i]); + + *tbl = table; + return 0; } @@ -163,14 +150,13 @@ int options_table_init(pack_opttbl_t **tbl) { * Purpose: free table memory * * Return: 0 - * *------------------------------------------------------------------------- */ int options_table_free(pack_opttbl_t *table) { - HDfree(table->objs); - HDfree(table); - return 0; + HDfree(table->objs); + HDfree(table); + return 0; } /*------------------------------------------------------------------------- @@ -179,12 +165,10 @@ int options_table_free(pack_opttbl_t *table) { * Purpose: add a layout option to the option list * * Return: 0, ok, -1, fail - * - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ int -options_add_layout(obj_list_t *obj_list, unsigned n_objs, pack_info_t *pack, - pack_opttbl_t *table) +options_add_layout(obj_list_t *obj_list, unsigned n_objs, pack_info_t *pack, pack_opttbl_t *table) { unsigned i, j, I; unsigned added = 0; @@ -205,7 +189,7 @@ options_add_layout(obj_list_t *obj_list, unsigned n_objs, pack_info_t *pack, if (HDstrcmp(obj_list[j].obj,table->objs[i].path) == 0) { /* already chunk info inserted for this one; exit */ if (table->objs[i].chunk.rank > 0) { - error_msg("chunk information already inserted for <%s>\n", obj_list[j].obj); + H5TOOLS_INFO(H5E_tools_min_id_g, "chunk information already inserted for <%s>\n", obj_list[j].obj); HDexit(EXIT_FAILURE); } /* insert the layout info */ @@ -261,12 +245,10 @@ options_add_layout(obj_list_t *obj_list, unsigned n_objs, pack_info_t *pack, * Purpose: add a compression -f option to the option list * * Return: 0, ok, -1, fail - * *------------------------------------------------------------------------- */ int -options_add_filter(obj_list_t *obj_list, unsigned n_objs, filter_info_t filt, - pack_opttbl_t *table) +options_add_filter(obj_list_t *obj_list, unsigned n_objs, filter_info_t filt, pack_opttbl_t *table) { unsigned int i, j, I; unsigned added = 0; @@ -337,29 +319,26 @@ options_add_filter(obj_list_t *obj_list, unsigned n_objs, filter_info_t filt, * Purpose: get object from table; "path" is the key * * Return: pack_info_t* OBJECT or NULL if not found; PATH is the key - * *------------------------------------------------------------------------- */ pack_info_t* options_get_object(const char *path, pack_opttbl_t *table) { - unsigned int i; - char tbl_path[MAX_NC_NAME + 1]; /* +1 for start with "/" case */ - - for (i = 0; i < table->nelems; i++) { - /* make full path (start with "/") to compare correctly */ - if (HDstrncmp(table->objs[i].path, "/", 1)) { - HDstrcpy(tbl_path, "/"); - HDstrcat(tbl_path, table->objs[i].path); - } - else - HDstrcpy(tbl_path, table->objs[i].path); - - /* found it */ - if (HDstrcmp(tbl_path, path) == 0) { - return (&table->objs[i]); - } - } - - return NULL; -} + unsigned int i; + char tbl_path[MAX_NC_NAME + 1]; /* +1 for start with "/" case */ + + for (i = 0; i < table->nelems; i++) { + /* make full path (start with "/") to compare correctly */ + if (HDstrncmp(table->objs[i].path, "/", 1)) { + HDstrcpy(tbl_path, "/"); + HDstrcat(tbl_path, table->objs[i].path); + } + else + HDstrcpy(tbl_path, table->objs[i].path); + /* found it */ + if (HDstrcmp(tbl_path, path) == 0) { + return (&table->objs[i]); + } + } + return NULL; +} diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c index 1a0dab7..e276b7b 100644 --- a/tools/src/h5repack/h5repack_verify.c +++ b/tools/src/h5repack/h5repack_verify.c @@ -33,11 +33,6 @@ static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *fil * 1 match * 0 do not match * -1 error - * - * Programmer: Pedro Vicente, pvn@hdfgroup.org - * - * Date: December 19, 2003 - * *------------------------------------------------------------------------- */ @@ -63,11 +58,10 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options /* open the output file */ if((fidout = H5Fopen(out_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fopen failed on <%s>", out_fname); - for(i = 0; i < options->op_tbl->nelems; i++) - { - char* name = options->op_tbl->objs[i].path; + for(i = 0; i < options->op_tbl->nelems; i++) { + char *name = options->op_tbl->objs[i].path; pack_info_t *obj = &options->op_tbl->objs[i]; /*------------------------------------------------------------------------- @@ -75,7 +69,7 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options *------------------------------------------------------------------------- */ if((did = H5Dopen2(fidout, name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed on <%s>", name); if((sid = H5Dget_space(did)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); if((pid = H5Dget_create_plist(did)) < 0) @@ -119,9 +113,7 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options *------------------------------------------------------------------------- */ - if(options->all_filter == 1 || options->all_layout == 1) - { - + if(options->all_filter == 1 || options->all_layout == 1) { /* Initialize indexing options */ h5trav_set_index(sort_by, sort_order); /* init table */ @@ -131,19 +123,16 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options if(h5trav_gettable(fidout, travt) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed"); - for(i = 0; i < travt->nobjs; i++) - { + for(i = 0; i < travt->nobjs; i++) { char *name = travt->objs[i].name; - if(travt->objs[i].type == H5TRAV_TYPE_DATASET) - { - + if(travt->objs[i].type == H5TRAV_TYPE_DATASET) { /*------------------------------------------------------------------------- * open *------------------------------------------------------------------------- */ if((did = H5Dopen2(fidout, name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed on <%s>", name); if((sid = H5Dget_space(did)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); if((pid = H5Dget_create_plist(did)) < 0) @@ -155,8 +144,7 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options * filter check *------------------------------------------------------------------------- */ - if(options->all_filter == 1) - { + if(options->all_filter == 1) { if(verify_filters(pid, tid, options->n_filter_g, options->filter_g) <= 0) ok = 0; } @@ -165,8 +153,7 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options * layout check *------------------------------------------------------------------------- */ - if(options->all_layout == 1) - { + if(options->all_layout == 1) { pack_info_t pack; init_packobject(&pack); @@ -204,43 +191,37 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options /* open the input file */ if((fidin = H5Fopen(in_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fopen failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fopen failed on file <%s>", in_fname); /* Get file creation property list for input file */ if((fcpl_in = H5Fget_create_plist(fidin)) < 0) { - error_msg("failed to retrieve file creation property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list"); } /* Get file space info for input file */ if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) { - error_msg("failed to retrieve file space strategy & threshold\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_strategy failed to retrieve file space strategy & threshold"); } /* Get file space page size for input file */ if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) { - error_msg("failed to retrieve file space page size\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_page_size failed to retrieve file space page size"); } /* Output file is already opened */ /* Get file creation property list for output file */ if((fcpl_out = H5Fget_create_plist(fidout)) < 0) { - error_msg("failed to retrieve file creation property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list"); } /* Get file space info for output file */ if(H5Pget_file_space_strategy(fcpl_out, &out_strategy, &out_persist, &out_threshold) < 0) { - error_msg("failed to retrieve file space strategy & threshold\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_strategy failed to retrieve file space strategy & threshold"); } /* Get file space page size for output file */ if(H5Pget_file_space_page_size(fcpl_out, &out_pagesize) < 0) { - error_msg("failed to retrieve file space page size\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_page_size failed to retrieve file space page size"); } /* @@ -250,12 +231,11 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options */ if(options->fs_strategy) { if(out_strategy != (options->fs_strategy == (H5F_fspace_strategy_t)-1 ? 0 : options->fs_strategy)) { - error_msg("file space strategy not set as unexpected\n"); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected"); } - } else { + } + else { if(out_strategy != in_strategy) { - error_msg("file space strategy not set as unexpected\n"); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected"); } } @@ -267,13 +247,12 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options */ if(options->fs_persist) { if(out_persist != (hbool_t)(options->fs_persist == (-1) ? FALSE : options->fs_persist)) { - error_msg("free-space persist status is not set as unexpected\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "free-space persist status not set as unexpected"); } - } else { + } + else { if(out_persist != in_persist) { - error_msg("free-space persist status is not set as unexpected\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "free-space persist status not set as unexpected"); } } @@ -284,13 +263,12 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options */ if(options->fs_threshold) { if(out_threshold != (hsize_t)(options->fs_threshold == (-1) ? 0 : options->fs_threshold)) { - error_msg("threshold is not set as unexpectec\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "threshold not set as unexpected"); } - } else { + } + else { if(out_threshold != in_threshold) { - error_msg("threshold is not set as unexpected\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "threshold not set as unexpected"); } } @@ -301,13 +279,12 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options */ if(options->fs_pagesize) { if(out_pagesize != (hsize_t)(options->fs_pagesize == (-1) ? 0 : options->fs_pagesize)) { - error_msg("file space page size is not set as unexpected\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space page size not set as unexpected"); } - } else { /* "-G" is not set */ + } + else { /* "-G" is not set */ if(out_pagesize != in_pagesize) { - error_msg("file space page size is not set as unexpected\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space page size not set as unexpected"); } } @@ -339,8 +316,6 @@ done: return ret_value; } /* h5repack_verify() */ - - /*------------------------------------------------------------------------- * Function: verify_layout * @@ -351,16 +326,10 @@ done: * H5D_CHUNKED = 2 * * Return: 1 has, 0 does not, -1 error - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 30, 2003 - * *------------------------------------------------------------------------- */ -int verify_layout(hid_t pid, - pack_info_t *obj) +int verify_layout(hid_t pid, pack_info_t *obj) { hsize_t chsize[64]; /* chunk size in elements */ H5D_layout_t layout; /* layout */ @@ -383,8 +352,7 @@ int verify_layout(hid_t pid, if (obj->layout != layout) return 0; - if (layout==H5D_CHUNKED) - { + if (layout==H5D_CHUNKED) { if ((rank = H5Pget_chunk(pid,NELMTS(chsize),chsize/*out*/)) < 0) return -1; if (obj->chunk.rank != rank) @@ -403,16 +371,10 @@ int verify_layout(hid_t pid, * Purpose: compare 2 files for identical property lists of all objects * * Return: 1=identical, 0=not identical, -1=error - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 31, 2003 - * *------------------------------------------------------------------------- */ -int h5repack_cmp_pl(const char *fname1, - const char *fname2) +int h5repack_cmp_pl(const char *fname1, const char *fname2) { int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hid_t fid1=-1; /* file ID */ @@ -439,13 +401,11 @@ int h5repack_cmp_pl(const char *fname1, { /* Open the files */ - if ((fid1 = H5Fopen(fname1,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) - { + if ((fid1 = H5Fopen(fname1,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) { error_msg("<%s>: %s\n", fname1, H5FOPENERROR ); return -1; } - if ((fid2 = H5Fopen(fname2,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) - { + if ((fid2 = H5Fopen(fname2,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) { error_msg("<%s>: %s\n", fname2, H5FOPENERROR ); H5Fclose(fid1); return -1; @@ -468,14 +428,10 @@ int h5repack_cmp_pl(const char *fname1, * traverse the suppplied object list *------------------------------------------------------------------------- */ - for(i = 0; i < trav->nobjs; i++) - { - - if(trav->objs[i].type == H5TRAV_TYPE_GROUP) - { - + for(i = 0; i < trav->nobjs; i++) { + if(trav->objs[i].type == H5TRAV_TYPE_GROUP) { if ((gid = H5Gopen2(fid1, trav->objs[i].name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed on first <%s>", trav->objs[i].name); if ((gcplid = H5Gget_create_plist(gid)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gget_create_plist failed"); if (H5Pget_link_creation_order(gcplid, &crt_order_flag1) < 0) @@ -486,7 +442,7 @@ int h5repack_cmp_pl(const char *fname1, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); if ((gid = H5Gopen2(fid2, trav->objs[i].name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed on second <%s>", trav->objs[i].name); if ((gcplid = H5Gget_create_plist(gid)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gget_create_plist failed"); if (H5Pget_link_creation_order(gcplid, &crt_order_flag2) < 0) @@ -497,20 +453,14 @@ int h5repack_cmp_pl(const char *fname1, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); if (crt_order_flag1 != crt_order_flag2) { - error_msg("property lists for <%s> are different\n",trav->objs[i].name); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "property lists failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "property lists failed for <%s> are different", trav->objs[i].name); } - } - - - - else if(trav->objs[i].type == H5TRAV_TYPE_DATASET) - { + else if(trav->objs[i].type == H5TRAV_TYPE_DATASET) { if((dset1 = H5Dopen2(fid1, trav->objs[i].name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed on first <%s>", trav->objs[i].name); if((dset2 = H5Dopen2(fid2, trav->objs[i].name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed on second <%s>", trav->objs[i].name); if((dcpl1 = H5Dget_create_plist(dset1)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); if((dcpl2 = H5Dget_create_plist(dset2)) < 0) @@ -524,8 +474,7 @@ int h5repack_cmp_pl(const char *fname1, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pequal failed"); if(ret == 0) { - error_msg("property lists for <%s> are different\n",trav->objs[i].name); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "property lists failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "property lists failed for <%s> are different",trav->objs[i].name); } /*------------------------------------------------------------------------- @@ -593,11 +542,6 @@ done: * 1 match * 0 do not match * -1 error - * - * Programmer: Pedro Vicente, pvn@hdfgroup.org - * - * Date: December 21, 2007 - * *------------------------------------------------------------------------- */ @@ -621,11 +565,11 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) /* if we do not have filters and the requested filter is NONE, return 1 */ if(!nfilters_dcpl && nfilters == 1 && - filter[0].filtn == H5Z_FILTER_NONE ) + filter[0].filtn == H5Z_FILTER_NONE) return 1; /* else the numbers of filters must match */ - if (nfilters_dcpl != nfilters ) + if (nfilters_dcpl != nfilters) return 0; /*------------------------------------------------------------------------- @@ -633,8 +577,7 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) *------------------------------------------------------------------------- */ - for( i = 0; i < nfilters_dcpl; i++) - { + for (i = 0; i < nfilters_dcpl; i++) { cd_nelmts = NELMTS(cd_values); filtn = H5Pget_filter2(pid, (unsigned)i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_name), f_name, NULL); @@ -644,15 +587,13 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) return 0; /* compare client data values. some filters do return local values */ - switch (filtn) - { - + switch (filtn) { case H5Z_FILTER_NONE: break; case H5Z_FILTER_SHUFFLE: /* 1 private client value is returned by DCPL */ - if ( cd_nelmts != H5Z_SHUFFLE_TOTAL_NPARMS && filter[i].cd_nelmts != H5Z_SHUFFLE_USER_NPARMS ) + if (cd_nelmts != H5Z_SHUFFLE_TOTAL_NPARMS && filter[i].cd_nelmts != H5Z_SHUFFLE_USER_NPARMS) return 0; /* get dataset's type size */ @@ -660,31 +601,31 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) return -1; /* the private client value holds the dataset's type size */ - if ( size != cd_values[0] ) + if (size != cd_values[0]) return 0; break; case H5Z_FILTER_SZIP: /* 4 private client values are returned by DCPL */ - if ( cd_nelmts != H5Z_SZIP_TOTAL_NPARMS && filter[i].cd_nelmts != H5Z_SZIP_USER_NPARMS ) + if (cd_nelmts != H5Z_SZIP_TOTAL_NPARMS && filter[i].cd_nelmts != H5Z_SZIP_USER_NPARMS) return 0; /* "User" parameter for pixels-per-block (index 1) */ - if ( cd_values[H5Z_SZIP_PARM_PPB] != filter[i].cd_values[H5Z_SZIP_PARM_PPB] ) + if (cd_values[H5Z_SZIP_PARM_PPB] != filter[i].cd_values[H5Z_SZIP_PARM_PPB]) return 0; break; case H5Z_FILTER_NBIT: /* only client data values number of values checked */ - if ( H5Z_NBIT_USER_NPARMS != filter[i].cd_nelmts) + if (H5Z_NBIT_USER_NPARMS != filter[i].cd_nelmts) return 0; break; case H5Z_FILTER_SCALEOFFSET: /* only client data values checked */ - for( j = 0; j < H5Z_SCALEOFFSET_USER_NPARMS; j++) + for (j = 0; j < H5Z_SCALEOFFSET_USER_NPARMS; j++) if (cd_values[j] != filter[i].cd_values[j]) return 0; break; @@ -693,20 +634,20 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) case H5Z_FILTER_FLETCHER32: case H5Z_FILTER_DEFLATE: - if ( cd_nelmts != filter[i].cd_nelmts) + if (cd_nelmts != filter[i].cd_nelmts) return 0; - for( j = 0; j < cd_nelmts; j++) + for (j = 0; j < cd_nelmts; j++) if (cd_values[j] != filter[i].cd_values[j]) return 0; break; default: - if ( cd_nelmts != filter[i].cd_nelmts) + if (cd_nelmts != filter[i].cd_nelmts) return 0; - for( j = 0; j < cd_nelmts; j++) + for (j = 0; j < cd_nelmts; j++) if (cd_values[j] != filter[i].cd_values[j]) return 0; break; -- cgit v0.12 From 4f9e47650aa98d1048da87be44ff3d28685554b7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 2 Oct 2017 12:39:15 -0500 Subject: Fix STREQUAL if commands. --- config/cmake/jrunTest.cmake | 30 +++++++++++----------- config/cmake/vfdTest.cmake | 6 ++--- config/cmake_ext_mod/grepTest.cmake | 6 ++--- config/cmake_ext_mod/runTest.cmake | 28 ++++++++++---------- java/examples/datasets/CMakeLists.txt | 4 +-- java/examples/groups/CMakeLists.txt | 4 +-- test/CMakeTests.cmake | 10 ++++---- tools/test/h5copy/CMakeTests.cmake | 18 ++++++------- tools/test/h5diff/CMakeTests.cmake | 10 ++++---- tools/test/h5dump/CMakeTests.cmake | 10 ++++---- tools/test/h5dump/CMakeTestsVDS.cmake | 4 +-- tools/test/h5dump/CMakeTestsXML.cmake | 4 +-- tools/test/h5ls/CMakeTests.cmake | 2 +- tools/test/h5ls/CMakeTestsVDS.cmake | 2 +- tools/test/h5repack/CMakeTests.cmake | 2 +- .../testfiles/h5repack_layout.h5-plugin_zero.tst | 25 +++++++++++++----- tools/test/h5stat/CMakeTests.cmake | 2 +- 17 files changed, 89 insertions(+), 78 deletions(-) diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 7af0590..b66f3a8 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -122,7 +122,7 @@ if (TEST_MASK_ERROR) endif () # if the return value is !=0 bail out -if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") message (STATUS "ERROR OUTPUT: ${TEST_STREAM}") message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != 0.\n${TEST_ERROR}") endif () @@ -141,13 +141,13 @@ if (NOT TEST_SKIP_COMPARE) COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} RESULT_VARIABLE TEST_RESULT ) - if (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT "${TEST_RESULT}" STREQUAL "0") set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) list (LENGTH test_ref len_ref) - if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0") + if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) @@ -160,14 +160,14 @@ if (NOT TEST_SKIP_COMPARE) endif () endforeach () else () - if (${len_act} STREQUAL "0") + if ("${len_act}" STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") endif () - if (${len_ref} STREQUAL "0") + if ("${len_ref}" STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") endif () endif () - if (NOT ${len_act} STREQUAL ${len_ref}) + if (NOT "${len_act}" STREQUAL "${len_ref}") set (TEST_RESULT 1) endif () endif () @@ -175,7 +175,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT "${TEST_RESULT}" STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") endif () @@ -191,14 +191,14 @@ if (NOT TEST_SKIP_COMPARE) COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} RESULT_VARIABLE TEST_RESULT ) - if (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT "${TEST_RESULT}" STREQUAL "0") set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) list (LENGTH test_ref len_ref) math (EXPR _FP_LEN "${len_ref} - 1") - if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0") + if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) @@ -211,14 +211,14 @@ if (NOT TEST_SKIP_COMPARE) endif () endforeach () else () - if (${len_act} STREQUAL "0") + if ("${len_act}" STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") endif () - if (${len_ref} STREQUAL "0") + if ("${len_ref}" STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () endif() - if (NOT ${len_act} STREQUAL ${len_ref}) + if (NOT "${len_act}" STREQUAL "${len_ref}") set (TEST_RESULT 1) endif () endif () @@ -239,15 +239,15 @@ if (TEST_GREP_COMPARE) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) - if (${TEST_RESULT} STREQUAL "0") + if ("${TEST_RESULT}" STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) - if (${TEST_EXPECT} STREQUAL "1") + if ("${TEST_EXPECT}" STREQUAL "1") # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (NOT ${TEST_RESULT} STREQUAL "0") + if (NOT "${TEST_RESULT}" STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index 67a2566..66a97c0 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -60,12 +60,12 @@ if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err) endif () # if the return value is !=${TEST_EXPECT} bail out -if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") if (NOT TEST_NOERRDISPLAY) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM) - message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}") - endif () + message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}") + endif () endif () message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") endif () diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index 5b0e8fd..b812d73 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -57,15 +57,15 @@ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) -if (${TEST_RESULT} STREQUAL "0") +if ("${TEST_RESULT}" STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) -if (${TEST_EXPECT} STREQUAL "1") +if ("${TEST_EXPECT}" STREQUAL "1") # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (NOT ${TEST_RESULT} STREQUAL "0") + if (NOT "${TEST_RESULT}" STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 3a02614..2479728 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -87,7 +87,7 @@ if (TEST_REGEX) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT) - if (${REGEX_RESULT} STREQUAL "0") + if ("${REGEX_RESULT}" STREQUAL "0") message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}") endif () endif () @@ -106,7 +106,7 @@ if (TEST_APPEND) endif () # if the return value is !=${TEST_EXPECT} bail out -if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") if (NOT TEST_NOERRDISPLAY) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) @@ -193,13 +193,13 @@ if (NOT TEST_SKIP_COMPARE) endif () endif () - if (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT "${TEST_RESULT}" STREQUAL "0") set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) list (LENGTH test_ref len_ref) - if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0") + if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) @@ -212,14 +212,14 @@ if (NOT TEST_SKIP_COMPARE) endif () endforeach () else () - if (${len_act} STREQUAL "0") + if ("${len_act}" STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") endif () - if (${len_ref} STREQUAL "0") + if ("${len_ref}" STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") endif () endif () - if (NOT ${len_act} STREQUAL ${len_ref}) + if (NOT "${len_act}" STREQUAL "${len_ref}") set (TEST_RESULT 1) endif () endif () @@ -227,7 +227,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT "${TEST_RESULT}" STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") endif () @@ -243,14 +243,14 @@ if (NOT TEST_SKIP_COMPARE) COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} RESULT_VARIABLE TEST_RESULT ) - if (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT "${TEST_RESULT}" STREQUAL "0") set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) list (LENGTH test_ref len_ref) math (EXPR _FP_LEN "${len_ref} - 1") - if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0") + if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) @@ -263,14 +263,14 @@ if (NOT TEST_SKIP_COMPARE) endif () endforeach () else () - if (${len_act} STREQUAL "0") + if ("${len_act}" STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") endif () - if (${len_ref} STREQUAL "0") + if ("${len_ref}" STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () endif () - if (NOT ${len_act} STREQUAL ${len_ref}) + if (NOT "${len_act}" STREQUAL "${len_ref}") set (TEST_RESULT 1) endif () endif () @@ -278,7 +278,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT "${TEST_RESULT}" STREQUAL "0") message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") endif () endif () diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index d698cfd..3972ec8 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -101,7 +101,7 @@ if (BUILD_TESTING) endif (H5_HAVE_FILTER_SZIP) foreach (example ${HDF_JAVA_EXAMPLES}) - if (${example} STREQUAL "H5Ex_D_External") + if ("${example}" STREQUAL "H5Ex_D_External") add_test ( NAME JAVA_datasets-${example}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -129,7 +129,7 @@ if (BUILD_TESTING) ) set_tests_properties (JAVA_datasets-${example}-copy-objects PROPERTIES DEPENDS JAVA_datasets-${example}-clear-objects) set (last_test "JAVA_datasets-${example}-copy-objects") - if (${example} STREQUAL "H5Ex_D_Szip") + if ("${example}" STREQUAL "H5Ex_D_Szip") if (USE_FILTER_SZIP) ADD_H5_TEST (${example} 0) endif () diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index bb5f80f..b912208 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -90,8 +90,8 @@ ENDMACRO () if (BUILD_TESTING) foreach (example ${HDF_JAVA_EXAMPLES}) - if (NOT ${example} STREQUAL "H5Ex_G_Iterate" AND NOT ${example} STREQUAL "H5Ex_G_Visit") - if (${example} STREQUAL "H5Ex_G_Compact") + if (NOT "${example}" STREQUAL "H5Ex_G_Iterate" AND NOT "${example}" STREQUAL "H5Ex_G_Visit") + if ("${example}" STREQUAL "H5Ex_G_Compact") add_test ( NAME JAVA_groups-${example}-clear-h5s COMMAND ${CMAKE_COMMAND} diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 5d2f30b..f4c52b6 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -661,7 +661,7 @@ foreach (test ${H5TEST_TESTS}) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) else () - if (${test} STREQUAL "big" AND CYGWIN) + if ("${test}" STREQUAL "big" AND CYGWIN) add_test (NAME H5TEST-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" ) @@ -702,7 +702,7 @@ if (BUILD_SHARED_LIBS) ) foreach (test ${H5TEST_TESTS}) - if (${test} STREQUAL "big" AND CYGWIN) + if ("${test}" STREQUAL "big" AND CYGWIN) add_test (NAME H5TEST-shared-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" ) @@ -1115,8 +1115,8 @@ if (HDF5_TEST_VFD) # Windows only macro macro (CHECK_VFD_TEST vfdtest vfdname resultcode) - if (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") - if (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") + if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2") + if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split") if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" @@ -1205,7 +1205,7 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS AND NOT ${vfdtest} STREQUAL "cache") + if (BUILD_SHARED_LIBS AND NOT "${vfdtest}" STREQUAL "cache") add_test (NAME VFD-${vfdname}-${vfdtest}-shared COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 2536ef3..58879cf 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -71,13 +71,13 @@ endif () # resultcode=2 will cause the test to skip the diff test - if (NOT ${resultcode} STREQUAL "2") + if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY_F-${testname}-DIFF COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) - if (${resultcode} STREQUAL "1") + if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () @@ -107,13 +107,13 @@ endif () # resultcode=2 will cause the test to skip the diff test - if (NOT ${resultcode} STREQUAL "2") + if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY-${testname}-DIFF COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - if (${resultcode} STREQUAL "1") + if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () @@ -157,13 +157,13 @@ ) set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test - if (NOT ${resultcode} STREQUAL "2") + if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY-${testname}-DIFF COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - if (${resultcode} STREQUAL "1") + if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () @@ -198,13 +198,13 @@ ) set_tests_properties (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test - if (NOT ${resultcode} STREQUAL "2") + if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY_SAME-${testname}-DIFF COMMAND $ -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) - if (${resultcode} STREQUAL "1") + if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () @@ -218,7 +218,7 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5COPY-CMP-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) - if (${resultcode} STREQUAL "1") + if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 0f61539..6dae99d 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -366,7 +366,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DIFF-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") @@ -396,7 +396,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DIFF_ERR-${resultfile} COMMAND $ --enable-error-stack ${ARGN}) set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") @@ -428,7 +428,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME PH5DIFF-${resultfile} COMMAND $ ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") @@ -467,7 +467,7 @@ testfiles/${resultfile}.out testfiles/${resultfile}.out.err ) - if (${resultcode} STREQUAL "2") + if ("${resultcode}" STREQUAL "2") add_test ( NAME H5DIFF_UD-${testname} COMMAND "${CMAKE_COMMAND}" @@ -512,7 +512,7 @@ testfiles/${resultfile}_ERR.out testfiles/${resultfile}_ERR.out.err ) - if (${resultcode} STREQUAL "2") + if ("${resultcode}" STREQUAL "2") add_test ( NAME H5DIFF_UD_ERR-${testname} COMMAND "${CMAKE_COMMAND}" diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index d3d1c4d..4bc33f8 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -422,7 +422,7 @@ endmacro () macro (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) - if (${testtype} STREQUAL "SKIP") + if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${skipresultfile}-SKIPPED @@ -439,7 +439,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") @@ -472,7 +472,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-N-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") @@ -505,7 +505,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") @@ -545,7 +545,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index 310f9ce..1344b9a 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -103,7 +103,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_vds_test}" STREQUAL "") @@ -129,7 +129,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ -p ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_vds_test}" STREQUAL "") diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index e068c5e..18148a1 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -161,7 +161,7 @@ ############################################################################## macro (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) - if (${testtype} STREQUAL "SKIP") + if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-XML-${skipresultfile}-SKIPPED @@ -177,7 +177,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-XML-${resultfile} COMMAND $ --xml ${ARGN}) set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_xml_test}" STREQUAL "") diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index a04a4b6..97b453b 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -129,7 +129,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (${resultcode} STREQUAL "1") + if ("${resultcode}" STREQUAL "1") set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index 4a665a5..c573323 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -74,7 +74,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") - if (${resultcode} STREQUAL "1") + if ("${resultcode}" STREQUAL "1") set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index dfdbb14..ba2670b 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -1264,7 +1264,7 @@ if (WIN32) set (TESTRETVAL -1) endif () - ADD_H5_CMP_TEST (plugin_zero "" "TEST" ${TESTRETVAL} h5repack_layout.h5 -v -f UD=250,0,0) + ADD_H5_MASK_TEST (plugin_zero "TEST" ${TESTRETVAL} h5repack_layout.h5 --enable-error-stack -v -f UD=250,0,0) if (HDF5_TEST_VFD) # Run test with different Virtual File Driver diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst index 0993d5b..03b1915 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst @@ -1,9 +1,20 @@ -Objects to modify layout are... -Objects to apply filter are... - User Defined 250 -Making file ... ------------------------------------------ - Type Filter (Compression) Name +Objects to modify layout areversion (number)) Name ----------------------------------------- group / -h5repack error: : Could not copy data to: out-plugin_zero.h5repack_layout.h5 +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Pset_filter(): failed to call private function + major: Property lists + minor: Can't set value + #001: (file name) line (number) in H5P__set_filter(): failed to load dynamically loaded plugin + major: Data filters + minor: Unable to load metadata into cache +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in copy_objects(): do_copy_objects from could not copy data to + major: Failure in tools library + minor: error in function + #001: (file name) line (number) in do_copy_objects(): apply_filters failed + major: Failure in tools library + minor: error in function + #002: (file name) line (number) in apply_filters(): H5Pset_filter failed + major: Failure in tools library + minor: error in function diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake index cd52886..bab6593 100644 --- a/tools/test/h5stat/CMakeTests.cmake +++ b/tools/test/h5stat/CMakeTests.cmake @@ -78,7 +78,7 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5STAT-${resultfile} COMMAND $ ${ARGN}) - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") -- cgit v0.12 From 5cd93e70c07d4f43c23c215a66e1b04f2f0754bb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 2 Oct 2017 16:41:13 -0500 Subject: Adjust filter available variables --- tools/test/h5repack/CMakeTests.cmake | 54 +++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index ba2670b..852662b 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -807,17 +807,17 @@ # filters are defined. # detect whether the encoder is present. - set (USE_FILTER_SZIP_ENCODER "no") +# set (USE_FILTER_SZIP_ENCODER 0) if (HDF5_ENABLE_SZIP_ENCODING) set (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) endif () if (H5_HAVE_FILTER_DEFLATE) - set (USE_FILTER_DEFLATE "true") + set (USE_FILTER_DEFLATE 1) endif () if (H5_HAVE_FILTER_SZIP) - set (USE_FILTER_SZIP "true") + set (USE_FILTER_SZIP 1) endif () # copy files (these files have no filters) @@ -856,16 +856,20 @@ # szip with individual object set (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) # szip for all set (arg ${FILE4} -f SZIP=8,NN) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) @@ -888,8 +892,10 @@ # all filters set (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) @@ -908,16 +914,20 @@ # szip copy set (arg ${FILE7}) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) # szip remove set (arg ${FILE7} --filter=dset_szip:NONE) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) @@ -980,23 +990,29 @@ # remove all filters set (arg ${FILE11} -f NONE) set (TESTTYPE "TEST") - if (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) #filter conversions set (arg ${FILE8} -f dset_deflate:SZIP=8,NN) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) set (arg ${FILE7} -f dset_szip:GZIP=1) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) -- cgit v0.12 From 27a0c46ec6f1fb843c61421261cb00397f9f6765 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 3 Oct 2017 08:53:04 -0500 Subject: Updated doxygen config file Description: Added C2Cppfunction_map.mht to HTML_EXTRA_FILES. Verified that the file is copied to cpplus_RM after running doxygen on cpp_doc_config. --- c++/src/cpp_doc_config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index ce23041..ae5dd90 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -1139,7 +1139,8 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = ./header_files/help.jpg +HTML_EXTRA_FILES = ./header_files/help.jpg \ + ./C2Cppfunction_map.mht # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the stylesheet and background images according to -- cgit v0.12 From a8f03185ad2d4a7c8afd6dbb2c7c8acb46d789a9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 3 Oct 2017 11:14:35 -0500 Subject: Fix repack plugin test - reorganize test macros --- tools/test/h5repack/CMakeTests.cmake | 632 ++++++++++++--------- .../testfiles/h5repack_layout.h5-plugin_zero.ddl | 4 + .../testfiles/h5repack_layout.h5-plugin_zero.tst | 20 - 3 files changed, 370 insertions(+), 286 deletions(-) create mode 100644 tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl delete mode 100644 tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 852662b..9269bf8 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -76,6 +76,7 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_shuffle.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_soffset.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_szip.h5 + # fsm ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_aggr.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fsm_aggr_nopersist.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fsm_aggr_persist.h5 @@ -124,39 +125,61 @@ ) set (LIST_OTHER_TEST_FILES - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack-help.txt - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.bin - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/ublock.bin - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack.info - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/deflate_limit.h5repack_layout.h5.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_filters.h5-gzip_verbose_filters.tst - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_test.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_test.h5repack_layout.h5.tst - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.UD.h5-plugin_none.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_none.h5repack_layout.UD.h5.tst - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_version_test.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_version_test.h5repack_layout.h5.tst - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/1_vds.h5-vds_dset_chunk20x10x5-v.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/2_vds.h5-vds_chunk3x6x9-v.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/3_1_vds.h5-vds_chunk2x5x8-v.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/4_vds.h5-vds_compa-v.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/4_vds.h5-vds_conti-v.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_zero.tst - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/crtorder.tordergr.h5.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/S.h5repack_fsm_aggr_persist.h5.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/STG.h5repack_none.h5.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/GS.h5repack_paged_nopersist.h5.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/SP.h5repack_paged_persist.h5.ddl - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/SPT.h5repack_aggr.h5.ddl + h5repack-help.txt + h5repack_ext.bin + h5repack.info + ublock.bin ) - foreach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + set (LIST_TST_TEST_FILES + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_filters.h5-gzip_verbose_filters + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_zero + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_test.h5repack_layout.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_none.h5repack_layout.UD.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_version_test.h5repack_layout.h5 + ) + + set (LIST_DDL_TEST_FILES + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/crtorder.tordergr.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/deflate_limit.h5repack_layout.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_test + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_version_test + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.UD.h5-plugin_none + # fsm + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/STG.h5repack_none.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/SPT.h5repack_aggr.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/SP.h5repack_fsm_aggr_nopersist.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/S.h5repack_fsm_aggr_persist.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/GS.h5repack_paged_nopersist.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/SP.h5repack_paged_persist.h5 + # vds + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/1_vds.h5-vds_dset_chunk20x10x5-v + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/2_vds.h5-vds_chunk3x6x9-v + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/3_1_vds.h5-vds_chunk2x5x8-v + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/4_vds.h5-vds_compa-v + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/4_vds.h5-vds_conti-v + ) + + foreach (h5_file ${LIST_HDF5_TEST_FILES}) get_filename_component(fname "${h5_file}" NAME) HDFTEST_COPY_FILE("${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5repack_files") endforeach () + + foreach (h5_file ${LIST_OTHER_TEST_FILES}) + HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5repack_files") + endforeach () + + foreach (h5_file ${LIST_TST_TEST_FILES}) + get_filename_component(fname "${h5_file}" NAME) + HDFTEST_COPY_FILE("${h5_file}.tst" "${PROJECT_BINARY_DIR}/testfiles/${fname}.tst" "h5repack_files") + endforeach () + + foreach (h5_file ${LIST_DDL_TEST_FILES}) + get_filename_component(fname "${h5_file}" NAME) + HDFTEST_COPY_FILE("${h5_file}.ddl" "${PROJECT_BINARY_DIR}/testfiles/${fname}.ddl" "h5repack_files") + endforeach () add_custom_target(h5repack_files ALL COMMENT "Copying files needed by h5repack tests" DEPENDS ${h5repack_files_list}) ############################################################################## @@ -168,14 +191,24 @@ macro (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5REPACK-${testname} COMMAND $ ${ARGN}) - set_tests_properties (H5REPACK-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + add_test (NAME H5REPACK-h5repack-${testname} COMMAND $ ${ARGN}) + set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS ${last_test}) endif () - set (last_test "H5REPACK-${testname}") + set (last_test "H5REPACK-h5repack-${testname}") else () add_test ( + NAME H5REPACK-h5repack-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/h5repack-${testname}.out + testfiles/h5repack-${testname}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( NAME H5REPACK-h5repack-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -186,6 +219,7 @@ -D "TEST_REFERENCE=h5repack-${testname}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS H5REPACK-h5repack-${testname}-clear-objects) endif () endmacro () @@ -199,13 +233,20 @@ endif () else () add_test ( - NAME H5REPACK_OLD-${testname} - COMMAND $ ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + NAME H5REPACK_OLD-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} ) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_OLD-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( + NAME H5REPACK_OLD-${testname} + COMMAND $ ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES DEPENDS H5REPACK_OLD-${testname}-clear-objects) + add_test ( NAME H5REPACK_OLD-${testname}_DFF COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) @@ -223,13 +264,20 @@ endif () else () add_test ( - NAME H5REPACK-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + NAME H5REPACK-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} ) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( + NAME H5REPACK-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS H5REPACK-${testname}-clear-objects) + add_test ( NAME H5REPACK-${testname}_DFF COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) @@ -252,8 +300,22 @@ NAME H5REPACK_CMP-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) + endif () else () add_test ( + NAME H5REPACK_CMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${resultfile} + testfiles/${resultfile}-${testname}.out + testfiles/${resultfile}-${testname}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -265,9 +327,7 @@ -D "TEST_REFERENCE=${resultfile}-${testname}.tst" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS H5REPACK_CMP-${testname}-clear-objects) endif () endif () endmacro () @@ -287,8 +347,22 @@ NAME H5REPACK_MASK-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS ${last_test}) + endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( + NAME H5REPACK_MASK-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${resultfile} + testfiles/${resultfile}-${testname}.out + testfiles/${resultfile}-${testname}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_MASK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( NAME H5REPACK_MASK-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -300,9 +374,7 @@ -D "TEST_REFERENCE=${resultfile}-${testname}.tst" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS H5REPACK_MASK-${testname}-clear-objects) endif () endif () endmacro () @@ -316,14 +388,22 @@ ) endif () else () - # If using memchecker add tests without using scripts add_test ( - NAME H5REPACK_DMP-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + NAME H5REPACK_DMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${resultfile} + testfiles/${resultfile}-${testname}.out + testfiles/${resultfile}-${testname}.out.err ) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_DMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () + add_test ( + NAME H5REPACK_DMP-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + ) + set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS H5REPACK_DMP-${testname}-clear-objects) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_DMP-h5dump-${testname} @@ -350,14 +430,22 @@ ) endif () else () - # If using memchecker add tests without using scripts add_test ( - NAME H5REPACK_STAT-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile} + NAME H5REPACK_STAT-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${statarg}.${resultfile} + testfiles/${resultfile}-${testname}.out + testfiles/${resultfile}-${testname}.out.err ) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_STAT-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_STAT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () + add_test ( + NAME H5REPACK_STAT-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile} + ) + set_tests_properties (H5REPACK_STAT-${testname} PROPERTIES DEPENDS H5REPACK_STAT-${testname}-clear-objects) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_STAT-h5stat-${testname} @@ -386,13 +474,22 @@ else () if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5REPACK_VERIFY_LAYOUT-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + NAME H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} + testfiles/${testfile}-${testname}-v.out + testfiles/${testfile}-${testname}-v.out.err ) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( + NAME H5REPACK_VERIFY_LAYOUT-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects) + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) @@ -449,14 +546,24 @@ endif () else () if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} + testfiles/${testfile}-${testname}-v.out + testfiles/${testfile}-${testname}-v.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES DEPENDS ${last_test}) - endif () + set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-object) add_test ( NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP COMMAND "${CMAKE_COMMAND}" @@ -475,14 +582,23 @@ endmacro () macro (ADD_H5_TEST_META testname testfile) + # Remove any output file left over from previous test run add_test ( - NAME H5REPACK_META-${testname}_N - COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 + NAME H5REPACK_META-${testname}_N-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}_N.${testname}.h5 + testfiles/out-${testname}_M.${testname}.h5 ) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_META-${testname}_N-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( + NAME H5REPACK_META-${testname}_N + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 + ) + set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES DEPENDS H5REPACK_META-${testname}_N-clear-objects) + add_test ( NAME H5REPACK_META-${testname}_M COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 ) @@ -497,11 +613,18 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( - NAME H5REPACK_UD-${testname}-clearall-objects + NAME H5REPACK_UD-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} + testfiles/${testname}.${resultfile}.out + testfiles/${testname}.${resultfile}.out.err + testfiles/${resultfile}-${testname}.out + testfiles/${resultfile}-${testname}.out.err ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_UD-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME H5REPACK_UD-${testname} COMMAND "${CMAKE_COMMAND}" @@ -516,21 +639,21 @@ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clearall-objects) + set_tests_properties (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clear-objects) add_test ( - NAME H5REPACK_UD-h5dump-${testname} + NAME H5REPACK_UD-${testname}-h5dump COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=-pH;out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}-${testname}.out" - -D "TEST_EXPECT=${resultcode}" + -D "TEST_EXPECT=0" -D "TEST_REFERENCE=${resultfile}-${testname}.ddl" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") + set_tests_properties (H5REPACK_UD-${testname}-h5dump PROPERTIES DEPENDS "H5REPACK_UD-${testname}") endif () endmacro () @@ -571,205 +694,182 @@ set (FILEV4 4_vds.h5) set (FILEV5 5_vds.h5) - # Remove any output file left over from previous test run - add_test ( - NAME H5REPACK-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/h5dump-help.out - ./testfiles/h5repack_filters.h5-gzip_verbose_filters.out - ./testfiles/h5repack_filters.h5-gzip_verbose_filters.out.err - ./testfiles/h5repack_layout.h5-chunk_18x13-v.out - ./testfiles/h5repack_layout.h5-chunk_18x13-v.out.err - ./testfiles/h5repack_layout.h5-chunk_20x10-v.out - ./testfiles/h5repack_layout.h5-chunk_20x10-v.out.err - ./testfiles/h5repack_layout.h5-chunk_compa-v.out - ./testfiles/h5repack_layout.h5-chunk_compa-v.out.err - ./testfiles/h5repack_layout.h5-chunk_conti-v.out - ./testfiles/h5repack_layout.h5-chunk_conti-v.out.err - ./testfiles/h5repack_layout.h5-compa-v.out - ./testfiles/h5repack_layout.h5-compa-v.out.err - ./testfiles/h5repack_layout.h5-conti-v.out - ./testfiles/h5repack_layout.h5-conti-v.out.err - ./testfiles/h5repack_layout.h5-deflate_limit.out - ./testfiles/h5repack_layout.h5-deflate_limit.out.err - ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-v.out - ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-v.out.err - ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.out - ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.out.err - ./testfiles/h5repack_layout.h5-dset2_compa-v.out - ./testfiles/h5repack_layout.h5-dset2_compa-v.out.err - ./testfiles/h5repack_layout.h5-dset2_conti-v.out - ./testfiles/h5repack_layout.h5-dset2_conti-v.out.err - ./testfiles/h5repack_layout.h5-dset_compa_chunk-v.out - ./testfiles/h5repack_layout.h5-dset_compa_chunk-v.out.err - ./testfiles/h5repack_layout.h5-dset_compa_compa-v.out - ./testfiles/h5repack_layout.h5-dset_compa_compa-v.out.err - ./testfiles/h5repack_layout.h5-dset_compa_conti-v.out - ./testfiles/h5repack_layout.h5-dset_compa_conti-v.out.err - ./testfiles/h5repack_layout.h5-dset_conti_chunk-v.out - ./testfiles/h5repack_layout.h5-dset_conti_chunk-v.out.err - ./testfiles/h5repack_layout.h5-dset_conti_compa-v.out - ./testfiles/h5repack_layout.h5-dset_conti_compa-v.out.err - ./testfiles/h5repack_layout.h5-dset_conti_conti-v.out - ./testfiles/h5repack_layout.h5-dset_conti_conti-v.out.err - ./testfiles/h5repack_layout.h5-layout_long_switches-v.out - ./testfiles/h5repack_layout.h5-layout_long_switches-v.out.err - ./testfiles/h5repack_layout.h5-layout_short_switches-v.out - ./testfiles/h5repack_layout.h5-layout_short_switches-v.out.err - ./testfiles/h5repack_layout.h5-plugin_test.out - ./testfiles/h5repack_layout.h5-plugin_test.out.err - ./testfiles/h5repack_layout2.h5-contig_small_compa-v.out - ./testfiles/h5repack_layout2.h5-contig_small_compa-v.out.err - ./testfiles/h5repack_layout2.h5-contig_small_fixed_compa-v.out - ./testfiles/h5repack_layout2.h5-contig_small_fixed_compa-v.out.err - ./testfiles/h5repack_layout3.h5-ckdim_biger-v.out - ./testfiles/h5repack_layout3.h5-ckdim_biger-v.out.err - ./testfiles/h5repack_layout3.h5-ckdim_smaller-v.out - ./testfiles/h5repack_layout3.h5-ckdim_smaller-v.out.err - ./testfiles/h5repack_layout3.h5-chunk2chunk-v.out - ./testfiles/h5repack_layout3.h5-chunk2chunk-v.out.err - ./testfiles/h5repack_layout3.h5-chunk2compa-v.out - ./testfiles/h5repack_layout3.h5-chunk2compa-v.out.err - ./testfiles/h5repack_layout3.h5-chunk2conti-v.out - ./testfiles/h5repack_layout3.h5-chunk2conti-v.out.err - ./testfiles/h5repack_layout3.h5-error1-v.out - ./testfiles/h5repack_layout3.h5-error1-v.out.err - ./testfiles/h5repack_layout3.h5-error2-v.out - ./testfiles/h5repack_layout3.h5-error2-v.out.err - ./testfiles/h5repack_layout3.h5-error3-v.out - ./testfiles/h5repack_layout3.h5-error3-v.out.err - ./testfiles/out-family.tfamily%05d.h5 - ./testfiles/out-HDFFV-7840.h5diff_attr1.h5 - ./testfiles/out-attr.h5repack_attr.h5 - ./testfiles/out-native_attr.h5repack_attr.h5 - ./testfiles/out-HDFFV-5932.h5repack_attr_refs.h5 - ./testfiles/out-deflate_copy.h5repack_deflate.h5 - ./testfiles/out-deflate_remove.h5repack_deflate.h5 - ./testfiles/out-early.h5repack_early.h5 - ./testfiles/out-fill.h5repack_fill.h5 - ./testfiles/out-native_fill.h5repack_fill.h5 - ./testfiles/out-gzip_verbose_filters.h5repack_filters.h5 - ./testfiles/out-fletcher_copy.h5repack_fletcher.h5 - ./testfiles/out-fletcher_remove.h5repack_fletcher.h5 - ./testfiles/out-hlink.h5repack_hlink.h5 - ./testfiles/out-chunk_18x13.h5repack_layout.h5 - ./testfiles/out-chunk_20x10.h5repack_layout.h5 - ./testfiles/out-chunk_compa.h5repack_layout.h5 - ./testfiles/out-chunk_conti.h5repack_layout.h5 - ./testfiles/out-compa.h5repack_layout.h5 - ./testfiles/out-conti.h5repack_layout.h5 - ./testfiles/out-deflate_file.h5repack_layout.h5 - ./testfiles/out-deflate_limit.h5repack_layout.h5 - ./testfiles/out-dset2_chunk_20x10.h5repack_layout.h5 - ./testfiles/out-dset2_compa.h5repack_layout.h5 - ./testfiles/out-dset2_conti.h5repack_layout.h5 - ./testfiles/out-dset_compa_chunk.h5repack_layout.h5 - ./testfiles/out-dset_compa_compa.h5repack_layout.h5 - ./testfiles/out-dset_compa_conti.h5repack_layout.h5 - ./testfiles/out-dset_conti_chunk.h5repack_layout.h5 - ./testfiles/out-dset_conti_compa.h5repack_layout.h5 - ./testfiles/out-dset_conti_conti.h5repack_layout.h5 - ./testfiles/out-fletcher_all.h5repack_layout.h5 - ./testfiles/out-fletcher_individual.h5repack_layout.h5 - ./testfiles/out-global_filters.h5repack_layout.h5 - ./testfiles/out-gzip_all.h5repack_layout.h5 - ./testfiles/out-gzip_individual.h5repack_layout.h5 - ./testfiles/out-layout.h5repack_layout.h5 - ./testfiles/out-layout_long_switches.h5repack_layout.h5 - ./testfiles/out-layout_short_switches.h5repack_layout.h5 - ./testfiles/out-old_style_layout_short_switches.h5repack_layout.h5 - ./testfiles/out-plugin_test.h5repack_layout.h5 - ./testfiles/out-shuffle_all.h5repack_layout.h5 - ./testfiles/out-shuffle_individual.h5repack_layout.h5 - ./testfiles/out-upgrade_layout.h5repack_layouto.h5 - ./testfiles/out-contig_small_compa.h5repack_layout2.h5 - ./testfiles/out-contig_small_fixed_compa.h5repack_layout2.h5 - ./testfiles/out-ckdim_biger.h5repack_layout3.h5 - ./testfiles/out-ckdim_smaller.h5repack_layout3.h5 - ./testfiles/out-chunk2chunk.h5repack_layout3.h5 - ./testfiles/out-chunk2compa.h5repack_layout3.h5 - ./testfiles/out-chunk2conti.h5repack_layout3.h5 - ./testfiles/out-error1.h5repack_layout3.h5 - ./testfiles/out-error2.h5repack_layout3.h5 - ./testfiles/out-error3.h5repack_layout3.h5 - ./testfiles/out-error4.h5repack_layout3.h5 - ./testfiles/out-committed_dt.h5repack_named_dtypes.h5 - ./testfiles/out-nbit_add.h5repack_nbit.h5 - ./testfiles/out-nbit_copy.h5repack_nbit.h5 - ./testfiles/out-nbit_remove.h5repack_nbit.h5 - ./testfiles/out-add_alignment.h5repack_objs.h5 - ./testfiles/out-add_userblock.h5repack_objs.h5 - ./testfiles/out-objs.h5repack_objs.h5 - ./testfiles/out-gt_mallocsize.h5repack_objs.h5 - ./testfiles/out-bug1814.h5repack_refs.h5 - ./testfiles/out-shuffle_copy.h5repack_shuffle.h5 - ./testfiles/out-shuffle_remove.h5repack_shuffle.h5 - ./testfiles/out-scale_add.h5repack_soffset.h5 - ./testfiles/out-scale_copy.h5repack_soffset.h5 - ./testfiles/out-scale_remove.h5repack_soffset.h5 - ./testfiles/out-meta_short_M.meta_short.h5 - ./testfiles/out-meta_short_N.meta_short.h5 - ./testfiles/out-meta_long_M.meta_long.h5 - ./testfiles/out-meta_long_N.meta_long.h5 - ./testfiles/1_vds.h5-vds_dset_chunk20x10x5-v.out - ./testfiles/1_vds.h5-vds_dset_chunk20x10x5-v.out.err - ./testfiles/2_vds.h5-vds_chunk3x6x9-v.out - ./testfiles/2_vds.h5-vds_chunk3x6x9-v.out.err - ./testfiles/3_1_vds.h5-vds_chunk2x5x8-v.out - ./testfiles/3_1_vds.h5-vds_chunk2x5x8-v.out.err - ./testfiles/4_vds.h5-vds_compa-v.out - ./testfiles/4_vds.h5-vds_compa-v.out.err - ./testfiles/4_vds.h5-vds_conti-v.out - ./testfiles/4_vds.h5-vds_conti-v.out.err - ./testfiles/out-vds_compa.4_vds.h5 - ./testfiles/out-vds_conti.4_vds.h5 - ./testfiles/out-vds_chunk2x5x8.3_1_vds.h5 - ./testfiles/out-vds_chunk3x6x9.2_vds.h5 - ./testfiles/out-vds_dset_chunk20x10x5.1_vds.h5 - h5repack_attr.h5 - h5repack_attr_out.h5 - h5repack_attr_refs.h5 - h5repack_big.h5 - h5repack_deflate.h5 - h5repack_deflate_out.h5 - h5repack_early2.h5 - h5repack_early.h5 - h5repack_early_out.h5 - h5repack_ext.h5 - h5repack_ext_out.h5 - h5repack_fill.h5 - h5repack_fill_out.h5 - h5repack_filters.h5 - h5repack_filters_out.h5 - h5repack_fletcher.h5 - h5repack_fletcher_out.h5 - h5repack_hlink.h5 - h5repack_hlink_out.h5 - h5repack_layout.h5 - h5repack_layout_out.h5 - h5repack_layout2.h5 - h5repack_layout3.h5 - h5repack_named_dtypes.h5 - h5repack_named_dtypes_out.h5 - h5repack_nbit.h5 - h5repack_nbit_out.h5 - h5repack_objs.h5 - h5repack_objs_out.h5 - h5repack_refs.h5 - h5repack_shuffle.h5 - h5repack_shuffle_out.h5 - h5repack_soffset.h5 - h5repack_soffset_out.h5 - h5repack_szip.h5 - h5repack_szip_out.h5 - h5repack_ub.h5 - h5repack_ub_out.h5 - h5repack_ext.bin - ublock.bin - ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) + if (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + set (LIST_TO_CLEAR + h5dump-help.out + h5repack_layout.h5-chunk_18x13-v.out + h5repack_layout.h5-chunk_18x13-v.out.err + h5repack_layout.h5-chunk_20x10-v.out + h5repack_layout.h5-chunk_20x10-v.out.err + h5repack_layout.h5-chunk_compa-v.out + h5repack_layout.h5-chunk_compa-v.out.err + h5repack_layout.h5-chunk_conti-v.out + h5repack_layout.h5-chunk_conti-v.out.err + h5repack_layout.h5-compa-v.out + h5repack_layout.h5-compa-v.out.err + h5repack_layout.h5-conti-v.out + h5repack_layout.h5-conti-v.out.err + h5repack_layout.h5-deflate_limit.out + h5repack_layout.h5-deflate_limit.out.err + h5repack_layout.h5-dset2_chunk_20x10-v.out + h5repack_layout.h5-dset2_chunk_20x10-v.out.err + h5repack_layout.h5-dset2_chunk_20x10-errstk.out + h5repack_layout.h5-dset2_chunk_20x10-errstk.out.err + h5repack_layout.h5-dset2_compa-v.out + h5repack_layout.h5-dset2_compa-v.out.err + h5repack_layout.h5-dset2_conti-v.out + h5repack_layout.h5-dset2_conti-v.out.err + h5repack_layout.h5-dset_compa_chunk-v.out + h5repack_layout.h5-dset_compa_chunk-v.out.err + h5repack_layout.h5-dset_compa_compa-v.out + h5repack_layout.h5-dset_compa_compa-v.out.err + h5repack_layout.h5-dset_compa_conti-v.out + h5repack_layout.h5-dset_compa_conti-v.out.err + h5repack_layout.h5-dset_conti_chunk-v.out + h5repack_layout.h5-dset_conti_chunk-v.out.err + h5repack_layout.h5-dset_conti_compa-v.out + h5repack_layout.h5-dset_conti_compa-v.out.err + h5repack_layout.h5-dset_conti_conti-v.out + h5repack_layout.h5-dset_conti_conti-v.out.err + h5repack_layout.h5-layout_long_switches-v.out + h5repack_layout.h5-layout_long_switches-v.out.err + h5repack_layout.h5-layout_short_switches-v.out + h5repack_layout.h5-layout_short_switches-v.out.err + h5repack_layout.h5-plugin_test.out + h5repack_layout.h5-plugin_test.out.err + h5repack_layout2.h5-contig_small_compa-v.out + h5repack_layout2.h5-contig_small_compa-v.out.err + h5repack_layout2.h5-contig_small_fixed_compa-v.out + h5repack_layout2.h5-contig_small_fixed_compa-v.out.err + h5repack_layout3.h5-ckdim_biger-v.out + h5repack_layout3.h5-ckdim_biger-v.out.err + h5repack_layout3.h5-ckdim_smaller-v.out + h5repack_layout3.h5-ckdim_smaller-v.out.err + h5repack_layout3.h5-chunk2chunk-v.out + h5repack_layout3.h5-chunk2chunk-v.out.err + h5repack_layout3.h5-chunk2compa-v.out + h5repack_layout3.h5-chunk2compa-v.out.err + h5repack_layout3.h5-chunk2conti-v.out + h5repack_layout3.h5-chunk2conti-v.out.err + h5repack_layout3.h5-error1-v.out + h5repack_layout3.h5-error1-v.out.err + h5repack_layout3.h5-error2-v.out + h5repack_layout3.h5-error2-v.out.err + h5repack_layout3.h5-error3-v.out + h5repack_layout3.h5-error3-v.out.err + out-family.tfamily%05d.h5 + out-HDFFV-7840.h5diff_attr1.h5 + out-attr.h5repack_attr.h5 + out-native_attr.h5repack_attr.h5 + out-HDFFV-5932.h5repack_attr_refs.h5 + out-deflate_copy.h5repack_deflate.h5 + out-deflate_remove.h5repack_deflate.h5 + out-early.h5repack_early.h5 + out-fill.h5repack_fill.h5 + out-native_fill.h5repack_fill.h5 + out-gzip_verbose_filters.h5repack_filters.h5 + out-fletcher_copy.h5repack_fletcher.h5 + out-fletcher_remove.h5repack_fletcher.h5 + out-hlink.h5repack_hlink.h5 + out-chunk_18x13.h5repack_layout.h5 + out-chunk_20x10.h5repack_layout.h5 + out-chunk_compa.h5repack_layout.h5 + out-chunk_conti.h5repack_layout.h5 + out-compa.h5repack_layout.h5 + out-conti.h5repack_layout.h5 + out-deflate_file.h5repack_layout.h5 + out-deflate_limit.h5repack_layout.h5 + out-dset2_chunk_20x10.h5repack_layout.h5 + out-dset2_compa.h5repack_layout.h5 + out-dset2_conti.h5repack_layout.h5 + out-dset_compa_chunk.h5repack_layout.h5 + out-dset_compa_compa.h5repack_layout.h5 + out-dset_compa_conti.h5repack_layout.h5 + out-dset_conti_chunk.h5repack_layout.h5 + out-dset_conti_compa.h5repack_layout.h5 + out-dset_conti_conti.h5repack_layout.h5 + out-fletcher_all.h5repack_layout.h5 + out-fletcher_individual.h5repack_layout.h5 + out-global_filters.h5repack_layout.h5 + out-gzip_all.h5repack_layout.h5 + out-gzip_individual.h5repack_layout.h5 + out-layout.h5repack_layout.h5 + out-layout_long_switches.h5repack_layout.h5 + out-layout_short_switches.h5repack_layout.h5 + out-old_style_layout_short_switches.h5repack_layout.h5 + out-plugin_test.h5repack_layout.h5 + out-shuffle_all.h5repack_layout.h5 + out-shuffle_individual.h5repack_layout.h5 + out-upgrade_layout.h5repack_layouto.h5 + out-contig_small_compa.h5repack_layout2.h5 + out-contig_small_fixed_compa.h5repack_layout2.h5 + out-ckdim_biger.h5repack_layout3.h5 + out-ckdim_smaller.h5repack_layout3.h5 + out-chunk2chunk.h5repack_layout3.h5 + out-chunk2compa.h5repack_layout3.h5 + out-chunk2conti.h5repack_layout3.h5 + out-error1.h5repack_layout3.h5 + out-error2.h5repack_layout3.h5 + out-error3.h5repack_layout3.h5 + out-error4.h5repack_layout3.h5 + out-committed_dt.h5repack_named_dtypes.h5 + out-nbit_add.h5repack_nbit.h5 + out-nbit_copy.h5repack_nbit.h5 + out-nbit_remove.h5repack_nbit.h5 + out-add_alignment.h5repack_objs.h5 + out-add_userblock.h5repack_objs.h5 + out-objs.h5repack_objs.h5 + out-gt_mallocsize.h5repack_objs.h5 + out-bug1814.h5repack_refs.h5 + out-shuffle_copy.h5repack_shuffle.h5 + out-shuffle_remove.h5repack_shuffle.h5 + out-scale_add.h5repack_soffset.h5 + out-scale_copy.h5repack_soffset.h5 + out-scale_remove.h5repack_soffset.h5 + out-meta_short_M.meta_short.h5 + out-meta_short_N.meta_short.h5 + out-meta_long_M.meta_long.h5 + out-meta_long_N.meta_long.h5 + out-vds_compa.4_vds.h5 + out-vds_conti.4_vds.h5 + out-vds_chunk2x5x8.3_1_vds.h5 + out-vds_chunk3x6x9.2_vds.h5 + out-vds_dset_chunk20x10x5.1_vds.h5 + ) + + set (LIST_TO_CLEAR ${LIST_TO_CLEAR} ${LIST_OTHER_TEST_FILES}) + + foreach (h5_file ${LIST_HDF5_TEST_FILES}) + get_filename_component(fname "${h5_file}" NAME) + set (LIST_TO_CLEAR ${LIST_TO_CLEAR} + ${h5_file}.h5 + ) + endforeach () + + foreach (h5_file ${LIST_TST_TEST_FILES}) + get_filename_component(fname "${h5_file}" NAME) + set (LIST_TO_CLEAR ${LIST_TO_CLEAR} + ${h5_file}.tst.out + ${h5_file}.tst.out.err + ) + endforeach () + + foreach (h5_file ${LIST_DDL_TEST_FILES}) + get_filename_component(fname "${h5_file}" NAME) + set (LIST_TO_CLEAR ${LIST_TO_CLEAR} + ${h5_file}.ddl.out + ${h5_file}.ddl.out.err + ) + endforeach () + add_test ( + NAME H5REPACK-clearall-objects + COMMAND ${CMAKE_COMMAND} -E remove ${LIST_TO_CLEAR} + ) + set_tests_properties (H5REPACK-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif () endif () ADD_HELP_TEST(help 0 -h) @@ -1280,7 +1380,7 @@ if (WIN32) set (TESTRETVAL -1) endif () - ADD_H5_MASK_TEST (plugin_zero "TEST" ${TESTRETVAL} h5repack_layout.h5 --enable-error-stack -v -f UD=250,0,0) + ADD_H5_UD_TEST (plugin_zero ${TESTRETVAL} h5repack_layout.h5 -v -f UD=250,0,0) if (HDF5_TEST_VFD) # Run test with different Virtual File Driver diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl new file mode 100644 index 0000000..97cbfc0 --- /dev/null +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl @@ -0,0 +1,4 @@ +HDF5 "out-plugin_zero.h5repack_layout.h5" { +GROUP "/" { +} +} diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst deleted file mode 100644 index 03b1915..0000000 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst +++ /dev/null @@ -1,20 +0,0 @@ -Objects to modify layout areversion (number)) Name ------------------------------------------ - group / -HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Pset_filter(): failed to call private function - major: Property lists - minor: Can't set value - #001: (file name) line (number) in H5P__set_filter(): failed to load dynamically loaded plugin - major: Data filters - minor: Unable to load metadata into cache -H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in copy_objects(): do_copy_objects from could not copy data to - major: Failure in tools library - minor: error in function - #001: (file name) line (number) in do_copy_objects(): apply_filters failed - major: Failure in tools library - minor: error in function - #002: (file name) line (number) in apply_filters(): H5Pset_filter failed - major: Failure in tools library - minor: error in function -- cgit v0.12 From 35861e3d6f363a8b359a7ac04ee6af1af140a26e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 3 Oct 2017 11:15:55 -0500 Subject: new reference file --- tools/test/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tools/test/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst diff --git a/tools/test/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst b/tools/test/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst new file mode 100644 index 0000000..20f8a40 --- /dev/null +++ b/tools/test/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst @@ -0,0 +1,7 @@ +Objects to modify layout are... +Objects to apply filter are... + User Defined 250 +----------------------------------------- + Type Filter (Compression) Name +----------------------------------------- + group / -- cgit v0.12 From 4c0784696bfa8524c59f0b71539f409f053fb06c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 3 Oct 2017 11:26:18 -0500 Subject: Fix list of names --- tools/test/h5repack/CMakeTests.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 9269bf8..aab9310 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -134,10 +134,10 @@ set (LIST_TST_TEST_FILES ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_filters.h5-gzip_verbose_filters ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_zero ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_test.h5repack_layout.h5 - ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_none.h5repack_layout.UD.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_version_test.h5repack_layout.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_zero.h5repack_layout.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_none.h5repack_layout.UD.h5 ) set (LIST_DDL_TEST_FILES @@ -146,6 +146,7 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_test ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_version_test + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_zero ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.UD.h5-plugin_none # fsm ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/STG.h5repack_none.h5 -- cgit v0.12 From 32a1b98a6cbca27d76deb2c9c561b664fb983d7d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 3 Oct 2017 12:26:40 -0500 Subject: Correct depends name --- tools/test/h5repack/CMakeTests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index aab9310..c68f18a 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -564,7 +564,7 @@ COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-object) + set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects) add_test ( NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -- cgit v0.12 From 68a9844991cfaaca2d0f97d7828f1f6f59af1349 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 3 Oct 2017 12:34:54 -0500 Subject: VS2012 and earlier cannot have execute stmnts before declare --- tools/lib/h5diff_array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 32ce3db..09894e6 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -640,8 +640,8 @@ static hsize_t diff_datum( * compared, we convert both bit patterns to their corresponding * enumeration constant and do a string comparison */ + h5difftrace("diff_datum H5T_ENUM\n"); { - h5difftrace("diff_datum H5T_ENUM\n"); char enum_name1[1024]; char enum_name2[1024]; herr_t err1; -- cgit v0.12 From 467f30c410e357ae7a437a0f75ca1f08780785f5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 3 Oct 2017 14:14:21 -0500 Subject: Cleanup cmake clean macros --- tools/test/h5copy/CMakeTests.cmake | 2 + tools/test/h5diff/CMakeTests.cmake | 46 +++++++-- tools/test/h5dump/CMakeTests.cmake | 79 +++++++++++++-- tools/test/h5dump/CMakeTestsPBITS.cmake | 10 ++ tools/test/h5dump/CMakeTestsVDS.cmake | 19 ++++ tools/test/h5dump/CMakeTestsXML.cmake | 16 ++- tools/test/h5format_convert/CMakeTests.cmake | 24 ++++- tools/test/h5jam/CMakeTests.cmake | 28 +++++- tools/test/h5ls/CMakeTests.cmake | 13 ++- tools/test/h5ls/CMakeTestsVDS.cmake | 9 ++ tools/test/h5stat/CMakeTests.cmake | 142 +++++++++------------------ tools/test/misc/CMakeTestsClear.cmake | 102 +++++++++---------- tools/test/misc/CMakeTestsMkgrp.cmake | 4 + tools/test/perform/CMakeTests.cmake | 24 ++++- 14 files changed, 343 insertions(+), 175 deletions(-) diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 58879cf..b60c0e9 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -231,6 +231,8 @@ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 + ./testfiles/${testname}.out.out + ./testfiles/${testname}.out.out.err ) add_test ( NAME H5COPY-CMP-${testname} diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 6dae99d..1c15880 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -373,6 +373,17 @@ set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DIFF-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${resultfile}.out + testfiles/${resultfile}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -385,6 +396,7 @@ -D "TEST_APPEND=EXIT CODE:" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS H5DIFF-${resultfile}-clear-objects) endif () if (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) @@ -403,6 +415,17 @@ set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DIFF_ERR-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${resultfile}_ERR.out + testfiles/${resultfile}_ERR.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF_ERR-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME H5DIFF_ERR-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -416,9 +439,7 @@ -D "TEST_APPEND=EXIT CODE:" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS H5DIFF_ERR-${resultfile}-clear-objects) endif () set (last_test "H5DIFF_ERR-${resultfile}") endmacro () @@ -435,6 +456,17 @@ set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () else () + # Remove any output file left over from previous test run + add_test ( + NAME PH5DIFF-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + PAR/testfiles/${resultfile}.out + PAR/testfiles/${resultfile}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (PH5DIFF-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME PH5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -450,9 +482,7 @@ -D "TEST_SORT_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS PH5DIFF-${resultfile}-clear-objects) set (last_test "PH5DIFF-${resultfile}") endif () endmacro () @@ -461,7 +491,7 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( - NAME H5DIFF_UD-${testname}-clearall-objects + NAME H5DIFF_UD-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/${resultfile}.out @@ -498,7 +528,7 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clearall-objects) + set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clear-objects) endif () endmacro () diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index 4bc33f8..cdd3e6d 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -407,8 +407,19 @@ endif () set (last_test "H5DUMP-${testname}") else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/std/h5dump-${testname}.out + testfiles/std/h5dump-${testname}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( - NAME H5DUMP-h5dump-${testname} + NAME H5DUMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${ARGN}" @@ -418,6 +429,7 @@ -D "TEST_REFERENCE=h5dump-${testname}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS H5DUMP-${testname}-clear-objects) endif () endmacro () @@ -449,7 +461,10 @@ add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.bin + -E remove + ${resultfile}.bin + ${resultfile}.out + ${resultfile}.out.err ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -482,7 +497,10 @@ add_test ( NAME H5DUMP-N-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}-N.bin + -E remove + ${resultfile}-N.bin + ${resultfile}-N.out + ${resultfile}-N.out.err ) set_tests_properties (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -515,7 +533,10 @@ add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.txt + -E remove + ${resultfile}.txt + ${resultfile}.out + ${resultfile}.out.err ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -555,7 +576,11 @@ add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${ddlfile}.txt ${resultfile}.txt + -E remove + ${ddlfile}.txt + ${resultfile}.txt + ${resultfile}.out + ${resultfile}.out.err ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -613,6 +638,15 @@ macro (ADD_H5_MASK_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -625,11 +659,21 @@ -D "TEST_MASK_ERROR=true" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () endmacro () macro (ADD_H5ERR_MASK_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -643,11 +687,21 @@ -D "TEST_MASK_ERROR=true" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () endmacro () macro (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -663,6 +717,7 @@ -D "TEST_ENV_VALUE:STRING=${envval}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () endmacro () @@ -672,7 +727,10 @@ add_test ( NAME H5DUMP-IMPORT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.bin ${resultfile}.h5 + -E remove + ${resultfile}.bin + ${resultfile}.h5 + ${conffile}.out ) set_tests_properties (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -700,12 +758,13 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( - NAME H5DUMP_UD-${testname}-clearall-objects + NAME H5DUMP_UD-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - testfiles/std/${resultfile}.out - testfiles/std/${resultfile}.out.err + ${resultfile}.out + ${resultfile}.out.err ) + set_tests_properties (H5DUMP_UD-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP_UD-${testname} COMMAND "${CMAKE_COMMAND}" @@ -719,7 +778,7 @@ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP_UD-${testname} PROPERTIES DEPENDS H5DUMP_UD-${testname}-clearall-objects) + set_tests_properties (H5DUMP_UD-${testname} PROPERTIES DEPENDS H5DUMP_UD-${testname}-clear-objects) endif () endmacro () diff --git a/tools/test/h5dump/CMakeTestsPBITS.cmake b/tools/test/h5dump/CMakeTestsPBITS.cmake index 986f1a1..4f3ee9f 100644 --- a/tools/test/h5dump/CMakeTestsPBITS.cmake +++ b/tools/test/h5dump/CMakeTestsPBITS.cmake @@ -131,6 +131,15 @@ set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) endif () else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -142,6 +151,7 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS H5DUMP-${resultfile}-clear-objects) endif () endmacro () diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index 1344b9a..3addecf 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -110,6 +110,15 @@ set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) endif () else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -121,6 +130,7 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS H5DUMP-${resultfile}-clear-objects) endif () endmacro () @@ -136,6 +146,15 @@ set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) endif () else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index 18148a1..0f8875f 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -164,7 +164,7 @@ if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5DUMP-XML-${skipresultfile}-SKIPPED + NAME H5DUMP_XML-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}" ) endif () @@ -175,7 +175,7 @@ macro (ADD_XML_H5_TEST resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-XML-${resultfile} COMMAND $ --xml ${ARGN}) + add_test (NAME H5DUMP_XML-${resultfile} COMMAND $ --xml ${ARGN}) set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") @@ -184,8 +184,17 @@ set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) endif () else () + # Remove any output file left over from previous test run add_test ( - NAME H5DUMP-XML-${resultfile} + NAME H5DUMP_XML-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP_XML-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + add_test ( + NAME H5DUMP_XML-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=--xml;${ARGN}" @@ -195,6 +204,7 @@ -D "TEST_REFERENCE=${resultfile}.xml" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES DEPENDS H5DUMP_XML-${resultfile}-clear-objects) endif () endmacro () diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake index 3e423da..4af220b 100644 --- a/tools/test/h5format_convert/CMakeTests.cmake +++ b/tools/test/h5format_convert/CMakeTests.cmake @@ -94,7 +94,10 @@ add_test ( NAME H5FC-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ./testfiles/outtmp.h5 + -E remove + ./testfiles/outtmp.h5 + ./testfiles/${testname}.out + ./testfiles/${testname}.out.err ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) @@ -143,7 +146,10 @@ add_test ( NAME H5FC-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ./testfiles/tmp.h5 + -E remove + ./testfiles/tmp.h5 + ./testfiles/${testname}.out + ./testfiles/${testname}.out.err ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) @@ -187,7 +193,10 @@ add_test ( NAME H5FC-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ./testfiles/chktmp.h5 + -E remove + ./testfiles/chktmp.h5 + ./testfiles/${testname}.out + ./testfiles/${testname}.out.err ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) @@ -225,7 +234,12 @@ add_test ( NAME H5FC-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ./testfiles/dmptmp.h5 + -E remove + ./testfiles/dmptmp.h5 + ./testfiles/${testname}.out + ./testfiles/${testname}.out.err + ./testfiles/${testname}_chk.out + ./testfiles/${testname}_chk.out.err ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) @@ -254,7 +268,7 @@ -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=-BH;./testfiles/dmptmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=testfiles/${testname}.out" + -D "TEST_OUTPUT=testfiles/${testname}_chk.out" -D "TEST_EXPECT=0" -D "TEST_REFERENCE=testfiles/${testname}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" diff --git a/tools/test/h5jam/CMakeTests.cmake b/tools/test/h5jam/CMakeTests.cmake index ae6d440..66ff715 100644 --- a/tools/test/h5jam/CMakeTests.cmake +++ b/tools/test/h5jam/CMakeTests.cmake @@ -60,6 +60,13 @@ endif () else () add_test ( + NAME H5JAM-${expectfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${expectfile}.out + ${expectfile}.out.err + ) + add_test ( NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -70,6 +77,7 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5JAM-${expectfile} PROPERTIES DEPENDS "H5JAM-${expectfile}-clear-objects") endif () endmacro () @@ -86,6 +94,13 @@ endif () else () add_test ( + NAME H5JAM-UNJAM-${expectfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${expectfile}.out + ${expectfile}.out.err + ) + add_test ( NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -96,6 +111,7 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS "H5JAM-UNJAM-${expectfile}-clear-objects") endif () endmacro () @@ -103,6 +119,16 @@ # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( + NAME H5JAM-${testname}-CHECKFILE-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${actual}.new + ${actual}.new.err + ${actual}.out + ${actual}.out.err + ) + set_tests_properties (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) + add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -114,7 +140,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS ${testdepends}) + set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index 97b453b..d03a344 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -136,6 +136,14 @@ set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () else () + # Remove any output file left over from previous test run + add_test ( + NAME H5LS-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${resultfile}.out + testfiles/${resultfile}.out.err + ) add_test ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -147,6 +155,7 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS H5LS-${resultfile}-clear-objects) endif () endmacro () @@ -154,7 +163,7 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( - NAME H5LS_UD-${testname}-clearall-objects + NAME H5LS_UD-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/${resultfile}.out @@ -173,7 +182,7 @@ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5LS_UD-${testname} PROPERTIES DEPENDS H5LS_UD-${testname}-clearall-objects) + set_tests_properties (H5LS_UD-${testname} PROPERTIES DEPENDS H5LS_UD-${testname}-clear-objects) endif () endmacro () diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index c573323..5df61bb 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -82,6 +82,14 @@ endif () else () add_test ( + NAME H5LS-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") + add_test ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -92,6 +100,7 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS H5LS-${resultfile}-clear-objects) endif () endmacro () diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake index bab6593..8d796ad 100644 --- a/tools/test/h5stat/CMakeTests.cmake +++ b/tools/test/h5stat/CMakeTests.cmake @@ -20,37 +20,37 @@ # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- set (HDF5_REFERENCE_FILES - h5stat_help1.ddl - h5stat_help2.ddl - h5stat_notexist.ddl - h5stat_nofile.ddl - h5stat_filters.ddl - h5stat_filters-file.ddl - h5stat_filters-F.ddl - h5stat_filters-d.ddl - h5stat_filters-g.ddl - h5stat_filters-dT.ddl - h5stat_filters-UD.ddl - h5stat_filters-UT.ddl - h5stat_tsohm.ddl - h5stat_newgrat.ddl - h5stat_newgrat-UG.ddl - h5stat_newgrat-UA.ddl - h5stat_err1_links.ddl - h5stat_links1.ddl - h5stat_links2.ddl - h5stat_links3.ddl - h5stat_links4.ddl - h5stat_links5.ddl - h5stat_err1_dims.ddl - h5stat_dims1.ddl - h5stat_dims2.ddl - h5stat_err1_numattrs.ddl - h5stat_err2_numattrs.ddl - h5stat_numattrs1.ddl - h5stat_numattrs2.ddl - h5stat_numattrs3.ddl - h5stat_numattrs4.ddl + h5stat_help1 + h5stat_help2 + h5stat_notexist + h5stat_nofile + h5stat_filters + h5stat_filters-file + h5stat_filters-F + h5stat_filters-d + h5stat_filters-g + h5stat_filters-dT + h5stat_filters-UD + h5stat_filters-UT + h5stat_tsohm + h5stat_newgrat + h5stat_newgrat-UG + h5stat_newgrat-UA + h5stat_err1_links + h5stat_links1 + h5stat_links2 + h5stat_links3 + h5stat_links4 + h5stat_links5 + h5stat_err1_dims + h5stat_dims1 + h5stat_dims2 + h5stat_err1_numattrs + h5stat_err2_numattrs + h5stat_numattrs1 + h5stat_numattrs2 + h5stat_numattrs3 + h5stat_numattrs4 ) set (HDF5_REFERENCE_TEST_FILES h5stat_filters.h5 @@ -60,7 +60,7 @@ ) foreach (ddl_file ${HDF5_REFERENCE_FILES}) - HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/testfiles/${ddl_file}" "${PROJECT_BINARY_DIR}/${ddl_file}" "h5stat_files") + HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/testfiles/${ddl_file}.ddl" "${PROJECT_BINARY_DIR}/${ddl_file}.ddl" "h5stat_files") endforeach () foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) @@ -86,6 +86,16 @@ endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( + NAME H5STAT-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5STAT-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( NAME H5STAT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -96,6 +106,7 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS H5STAT-${resultfile}-clear-objects) endif () endmacro () @@ -107,72 +118,13 @@ if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run + foreach (ddl_file ${HDF5_REFERENCE_FILES}) + set (CLEAR_LIST ${CLEAR_LIST} ${ddl_file}.out ${ddl_file}.out.err) + endforeach () add_test ( NAME H5STAT-clearall-objects COMMAND ${CMAKE_COMMAND} - -E remove - h5stat_help1.out - h5stat_help1.out.err - h5stat_help2.out - h5stat_help2.out.err - h5stat_notexist.out - h5stat_notexist.out.err - h5stat_nofile.out - h5stat_nofile.out.err - h5stat_filters.out - h5stat_filters.out.err - h5stat_filters-file.out - h5stat_filters-file.out.err - h5stat_filters-F.out - h5stat_filters-F.out.err - h5stat_filters-d.out - h5stat_filters-d.out.err - h5stat_filters-g.out - h5stat_filters-g.out.err - h5stat_filters-dT.out - h5stat_filters-dT.out.err - h5stat_filters-UD.out - h5stat_filters-UD.out.err - h5stat_filters-UT.out - h5stat_filters-UT.out.err - h5stat_tsohm.out - h5stat_tsohm.out.err - h5stat_newgrat.out - h5stat_newgrat.out.err - h5stat_newgrat-UG.out - h5stat_newgrat-UG.out.err - h5stat_newgrat-UA.out - h5stat_newgrat-UA.out.err - h5stat_err1_links.out - h5stat_err1_links.out.err - h5stat_links1.out - h5stat_links1.out.err - h5stat_links2.out - h5stat_links2.out.err - h5stat_links3.out - h5stat_links3.out.err - h5stat_links4.out - h5stat_links4.out.err - h5stat_links5.out - h5stat_links5.out.err - h5stat_err1_dims.out - h5stat_err1_dims.out.err - h5stat_dims1.out - h5stat_dims1.out.err - h5stat_dims2.out - h5stat_dims2.out.err - h5stat_err1_numattrs.out - h5stat_err1_numattrs.out.err - h5stat_err2_numattrs.out - h5stat_err2_numattrs.out.err - h5stat_numattrs1.out - h5stat_numattrs1.out.err - h5stat_numattrs2.out - h5stat_numattrs2.out.err - h5stat_numattrs3.out - h5stat_numattrs3.out.err - h5stat_numattrs4.out - h5stat_numattrs4.out.err + -E remove ${CLEAR_LIST} ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index 7eba4a1..b9095fb 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -61,8 +61,8 @@ NAME H5CLEAR_CMP-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - ${testname}.out - ${testname}.out.err + testfiles/${testname}.out + testfiles/${testname}.out.err ) add_test ( NAME H5CLEAR_CMP-${testname} @@ -94,34 +94,36 @@ endif () endmacro () - macro (ADD_H5_TEST testname resultcode) + macro (ADD_H5_TEST testname testfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5CLEAR-clear_open_chk-copy_${testname}.h5 + NAME H5CLEAR-clr_open_chk-copy_${testname}.h5 COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${PROJECT_SOURCE_DIR}/testfiles/${testname}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testname}.h5" + "${PROJECT_SOURCE_DIR}/testfiles/${testfile}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testfile}.h5" ) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5CLEAR-clear_open_chk-copy_${testname}.h5 PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5CLEAR-clr_open_chk-copy_${testname}.h5 PROPERTIES DEPENDS ${last_test}) endif () - set (last_test "H5CLEAR-clear_open_chk-copy_${testname}.h5") + set (last_test "H5CLEAR-clr_open_chk-copy_${testname}.h5") + # Initial file open fails OR # File open succeeds because the library does not check status_flags for file with < v3 superblock - add_test (NAME H5CLEAR-clear_open_chk-${testname}_${resultcode} COMMAND $ ${testname}.h5) - set_tests_properties (H5CLEAR-clear_open_chk-${testname}_${resultcode} PROPERTIES WILL_FAIL "${resultcode}") - set_tests_properties (H5CLEAR-clear_open_chk-${testname}_${resultcode} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + add_test (NAME H5CLEAR-clr_open_chk-${testname}_${resultcode} COMMAND $ ${testfile}.h5) + set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES WILL_FAIL "${resultcode}") + set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5CLEAR-clear_open_chk-${testname}_${resultcode} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES DEPENDS ${last_test}) endif () + # After "h5clear" the file, the subsequent file open succeeds - add_test (NAME H5CLEAR-h5clear-${testname} COMMAND $ -s ${testname}.h5) - set_tests_properties (H5CLEAR-h5clear-${testname} PROPERTIES DEPENDS H5CLEAR-clear_open_chk-${testname}_${resultcode}) - set_tests_properties (H5CLEAR-h5clear-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - add_test (NAME H5CLEAR-clear_open_chk-${testname} COMMAND $ ${testname}.h5) - set_tests_properties (H5CLEAR-clear_open_chk-${testname} PROPERTIES DEPENDS H5CLEAR-h5clear-${testname}) - set_tests_properties (H5CLEAR-clear_open_chk-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - set (last_test "H5CLEAR-clear_open_chk-${testname}") + add_test (NAME H5CLEAR-h5clr-${testname} COMMAND $ -s ${testfile}.h5) + set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES DEPENDS H5CLEAR-clr_open_chk-${testname}_${resultcode}) + set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + add_test (NAME H5CLEAR-clr_open_chk-${testname} COMMAND $ ${testfile}.h5) + set_tests_properties (H5CLEAR-clr_open_chk-${testname} PROPERTIES DEPENDS H5CLEAR-h5clr-${testname}) + set_tests_properties (H5CLEAR-clr_open_chk-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + set (last_test "H5CLEAR-clr_open_chk-${testname}") endif () endmacro () @@ -185,15 +187,15 @@ if (HDF5_ENABLE_USING_MEMCHECKER) endforeach () # make second copy of mod_h5clear_mdc_image.h5 add_test ( - NAME H5CLEAR-copy_mod_h5clear_mdc_image2.h5 + NAME H5CLEAR-copy_mod_h5clr_mdc_image2.h5 COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PROJECT_SOURCE_DIR}/testfiles/mod_h5clear_mdc_image.h5" "${PROJECT_BINARY_DIR}/testfiles/mod_h5clear_mdc_image2.h5" ) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5CLEAR-copy_mod_h5clear_mdc_image2.h5 PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5CLEAR-copy_mod_h5clr_mdc_image2.h5 PROPERTIES DEPENDS ${last_test}) endif () - set (last_test "H5CLEAR-copy_mod_h5clear_mdc_image2.h5") + set (last_test "H5CLEAR-copy_mod_h5clr_mdc_image2.h5") endif() # @@ -210,16 +212,16 @@ endif() # "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) # "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) # "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) - ADD_H5_CMP (h5clear_usage_h h5clear_usage 0 "-h") - ADD_H5_CMP (h5clear_usage h5clear_usage 1 "") - ADD_H5_CMP (h5clear_usage_junk h5clear_usage 1 "" junk.h5) - ADD_H5_CMP (h5clear_usage_none h5clear_usage 1 "" orig_h5clear_sec2_v3.h5) - ADD_H5_CMP (h5clear_missing_file_m h5clear_missing_file 1 "-m") - ADD_H5_CMP (h5clear_open_fail_s h5clear_open_fail 1 "-s" junk.h5) - ADD_H5_CMP (h5clear_missing_file_ms h5clear_missing_file 1 "-m" "-s") - ADD_H5_CMP (h5clear_open_fail_ms h5clear_open_fail 1 "-m" "-s" junk.h5) - ADD_H5_CMP (h5clear_no_mdc_image_m h5clear_no_mdc_image 0 "-m" orig_h5clear_sec2_v2.h5) - ADD_H5_CMP (h5clear_no_mdc_image_ms h5clear_no_mdc_image 0 "-s" "-m" orig_h5clear_sec2_v0.h5) + ADD_H5_CMP (h5clr_usage_h h5clear_usage 0 "-h") + ADD_H5_CMP (h5clr_usage h5clear_usage 1 "") + ADD_H5_CMP (h5clr_usage_junk h5clear_usage 1 "" junk.h5) + ADD_H5_CMP (h5clr_usage_none h5clear_usage 1 "" orig_h5clear_sec2_v3.h5) + ADD_H5_CMP (h5clr_missing_file_m h5clear_missing_file 1 "-m") + ADD_H5_CMP (h5clr_open_fail_s h5clear_open_fail 1 "-s" junk.h5) + ADD_H5_CMP (h5clr_missing_file_ms h5clear_missing_file 1 "-m" "-s") + ADD_H5_CMP (h5clr_open_fail_ms h5clear_open_fail 1 "-m" "-s" junk.h5) + ADD_H5_CMP (h5clr_no_mdc_image_m h5clear_no_mdc_image 0 "-m" orig_h5clear_sec2_v2.h5) + ADD_H5_CMP (h5clr_no_mdc_image_ms h5clear_no_mdc_image 0 "-s" "-m" orig_h5clear_sec2_v0.h5) # # # @@ -235,30 +237,30 @@ endif() # "h5clear -l -m junk.h5" (invalid/valid 2 options, nonexisting file, fail exit code) # "h5clear -m -l h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code) # "h5clear -l -m h5clear_sec2_v0.h5" (invalid/valid 2 options, existing file, fail exit code) - ADD_H5_RETTEST (h5clear_mdc_image "false" "-m" h5clear_mdc_image.h5) - ADD_H5_RETTEST (h5clear_vers "false" "--vers") - ADD_H5_RETTEST (h5clear_k "true" "-k") - ADD_H5_RETTEST (h5clear_k_junk "true" "-k" junk.h5) - ADD_H5_RETTEST (h5clear_l_sec2 "true" "-l" h5clear_sec2_v2.h5) - ADD_H5_RETTEST (h5clear_mk "true" "-m" "-k") - ADD_H5_RETTEST (h5clear_lm "true" "-l" "-m") - ADD_H5_RETTEST (h5clear_ml_junk "true" "-m" "-l" junk.h5) - ADD_H5_RETTEST (h5clear_lm_junk "true" "-l" "-m" junk.h5) - ADD_H5_RETTEST (h5clear_ml_sec2 "true" "-m" "-l" h5clear_sec2_v0.h5) - ADD_H5_RETTEST (h5clear_lm_sec2 "true" "-l" "-m" h5clear_sec2_v0.h5) + ADD_H5_RETTEST (h5clr_mdc_image "false" "-m" h5clear_mdc_image.h5) + ADD_H5_RETTEST (h5clr_vers "false" "--vers") + ADD_H5_RETTEST (h5clr_k "true" "-k") + ADD_H5_RETTEST (h5clr_k_junk "true" "-k" junk.h5) + ADD_H5_RETTEST (h5clr_l_sec2 "true" "-l" h5clear_sec2_v2.h5) + ADD_H5_RETTEST (h5clr_mk "true" "-m" "-k") + ADD_H5_RETTEST (h5clr_lm "true" "-l" "-m") + ADD_H5_RETTEST (h5clr_ml_junk "true" "-m" "-l" junk.h5) + ADD_H5_RETTEST (h5clr_lm_junk "true" "-l" "-m" junk.h5) + ADD_H5_RETTEST (h5clr_ml_sec2 "true" "-m" "-l" h5clear_sec2_v0.h5) + ADD_H5_RETTEST (h5clr_lm_sec2 "true" "-l" "-m" h5clear_sec2_v0.h5) # # # # h5clear_mdc_image.h5 already has cache image removed earlier, verify the expected warning from h5clear: - ADD_H5_CMP (h5clear_mdc_image_m h5clear_no_mdc_image 0 "-m" mod_h5clear_mdc_image.h5) - ADD_H5_CMP (h5clear_mdc_image_sm h5clear_no_mdc_image 0 "-s" "-m" mod_h5clear_mdc_image2.h5) + ADD_H5_CMP (h5clr_mdc_image_m h5clear_no_mdc_image 0 "-m" mod_h5clear_mdc_image.h5) + ADD_H5_CMP (h5clr_mdc_image_sm h5clear_no_mdc_image 0 "-s" "-m" mod_h5clear_mdc_image2.h5) # # # # The following are tests to verify the status_flags field is cleared properly: - ADD_H5_TEST (h5clear_sec2_v3 "true") - ADD_H5_TEST (h5clear_log_v3 "true") - ADD_H5_TEST (latest_h5clear_sec2_v3 "true") - ADD_H5_TEST (latest_h5clear_log_v3 "true") - ADD_H5_TEST (h5clear_sec2_v0 "false") - ADD_H5_TEST (h5clear_sec2_v2 "false") + ADD_H5_TEST (h5clr_sec2_v3 h5clear_sec2_v3 "true") + ADD_H5_TEST (h5clr_log_v3 h5clear_log_v3 "true") + ADD_H5_TEST (latest_h5clr_sec2_v3 latest_h5clear_sec2_v3 "true") + ADD_H5_TEST (latest_h5clr_log_v3 latest_h5clear_log_v3 "true") + ADD_H5_TEST (h5clr_sec2_v0 h5clear_sec2_v0 "false") + ADD_H5_TEST (h5clr_sec2_v2 h5clear_sec2_v2 "false") diff --git a/tools/test/misc/CMakeTestsMkgrp.cmake b/tools/test/misc/CMakeTestsMkgrp.cmake index 7011b19..e99983b 100644 --- a/tools/test/misc/CMakeTestsMkgrp.cmake +++ b/tools/test/misc/CMakeTestsMkgrp.cmake @@ -61,6 +61,8 @@ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5 + ${resultfile}.out + ${resultfile}.out.err ) set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") endif () @@ -101,6 +103,8 @@ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5 + ${resultfile}.out + ${resultfile}.out.err ) set_tests_properties (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") add_test ( diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake index 39faa73..2bd8d46 100644 --- a/tools/test/perform/CMakeTests.cmake +++ b/tools/test/perform/CMakeTests.cmake @@ -25,7 +25,7 @@ add_custom_target(zip_perf_files ALL COMMENT "Copying files needed by zip_perf t # Remove any output file left over from previous test run add_test ( - NAME PERFORM_h5perform-clear-objects + NAME PERFORM_h5perform-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove chunk.h5 @@ -36,6 +36,20 @@ add_test ( x-rowmaj-rd.dat x-rowmaj-wr.dat x-gnuplot + h5perf_serial.txt + h5perf_serial.txt.err + chunk.txt + chunk.txt.err + iopipe.txt + iopipe.txt.err + overhead.txt + overhead.txt.err + perf_meta.txt + perf_meta.txt.err + zip_perf-h.txt + zip_perf-h.txt.err + zip_perf.txt + zip_perf.txt.err ) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -53,6 +67,7 @@ else () ) endif () set_tests_properties (PERFORM_h5perf_serial PROPERTIES TIMEOUT 1800) +set_tests_properties (PERFORM_h5perf_serial PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") if (HDF5_BUILD_PERFORM_STANDALONE) add_test (NAME PERFORM_h5perf_serial_alone COMMAND $) @@ -72,6 +87,7 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () +set_tests_properties (PERFORM_chunk PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME PERFORM_iopipe COMMAND $) @@ -87,6 +103,7 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () +set_tests_properties (PERFORM_iopipe PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME PERFORM_overhead COMMAND $) @@ -102,6 +119,7 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () +set_tests_properties (PERFORM_overhead PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME PERFORM_perf_meta COMMAND $) @@ -117,6 +135,7 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () +set_tests_properties (PERFORM_perf_meta PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME PERFORM_zip_perf_help COMMAND $ "-h") @@ -132,6 +151,8 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () +set_tests_properties (PERFORM_zip_perf_help PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") + if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) else () @@ -147,6 +168,7 @@ else () ) endif () set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS PERFORM_zip_perf_help) +set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") if (H5_HAVE_PARALLEL) add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) -- cgit v0.12 From 12e4d3fd0bc7411a28390bcc9fc00fede807a5cf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 3 Oct 2017 14:37:31 -0500 Subject: Add/remove test files --- MANIFEST | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index fa3de21..f194f72 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2468,6 +2468,7 @@ ./tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl ./tools/test/h5repack/testfiles/plugin_none.h5repack_layout.UD.h5.tst ./tools/test/h5repack/testfiles/plugin_test.h5repack_layout.h5.tst +./tools/test/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst ./tools/test/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst ./tools/test/h5repack/testfiles/h5repack-help.txt ./tools/test/h5repack/testfiles/h5repack_filters.h5-gzip_verbose_filters.tst @@ -2476,7 +2477,7 @@ ./tools/test/h5repack/testfiles/h5repack_layout.UD.h5-plugin_none.ddl ./tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl ./tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl -./tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst +./tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl ./tools/test/h5repack/testfiles/GS.h5repack_paged_nopersist.h5.ddl ./tools/test/h5repack/testfiles/S.h5repack_fsm_aggr_persist.h5.ddl ./tools/test/h5repack/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl -- cgit v0.12 From 865b25849344beb0ef8be64260b18828e5ca2c9f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 4 Oct 2017 08:53:45 -0500 Subject: Whitespace conversions and comment updates --- src/H5Z.c | 917 ++++++++++++++++++++++++++------------------------------------ 1 file changed, 382 insertions(+), 535 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index ef34d7c..1dc93d8 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -14,17 +14,17 @@ #include "H5Zmodule.h" /* This source code file is part of the H5Z module */ -#include "H5private.h" /* Generic Functions */ -#include "H5Dprivate.h" /* Dataset functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Oprivate.h" /* Object headers */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5PLprivate.h" /* Plugins */ -#include "H5Sprivate.h" /* Dataspace functions */ -#include "H5Zpkg.h" /* Data filters */ +#include "H5private.h" /* Generic Functions */ +#include "H5Dprivate.h" /* Dataset functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5PLprivate.h" /* Plugins */ +#include "H5Sprivate.h" /* Dataspace functions */ +#include "H5Zpkg.h" /* Data filters */ #ifdef H5_HAVE_SZLIB_H # include "szlib.h" @@ -34,10 +34,10 @@ #ifdef H5Z_DEBUG typedef struct H5Z_stats_t { struct { - hsize_t total; /*total number of bytes processed */ - hsize_t errors; /*bytes of total attributable to errors */ - H5_timer_t timer; /*execution time including errors */ - } stats[2]; /*0=output, 1=input */ + hsize_t total; /*total number of bytes processed */ + hsize_t errors; /*bytes of total attributable to errors */ + H5_timer_t timer; /*execution time including errors */ + } stats[2]; /*0=output, 1=input */ } H5Z_stats_t; #endif /* H5Z_DEBUG */ @@ -56,11 +56,11 @@ typedef enum { hbool_t H5_PKG_INIT_VAR = FALSE; /* Local variables */ -static size_t H5Z_table_alloc_g = 0; -static size_t H5Z_table_used_g = 0; -static H5Z_class2_t *H5Z_table_g = NULL; +static size_t H5Z_table_alloc_g = 0; +static size_t H5Z_table_used_g = 0; +static H5Z_class2_t *H5Z_table_g = NULL; #ifdef H5Z_DEBUG -static H5Z_stats_t *H5Z_stat_table_g = NULL; +static H5Z_stats_t *H5Z_stat_table_g = NULL; #endif /* H5Z_DEBUG */ /* Local functions */ @@ -71,15 +71,11 @@ static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key); /*------------------------------------------------------------------------- - * Function: H5Z__init_package + * Function: H5Z__init_package * - * Purpose: Initializes the data filter layer. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Thursday, April 16, 1998 + * Purpose: Initializes the data filter layer. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -116,21 +112,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_term_package - * - * Purpose: Terminate the H5Z layer. - * - * Return: void + * Function: H5Z_term_package * - * Programmer: Robb Matzke - * Thursday, April 16, 1998 + * Purpose: Terminate the H5Z layer. * + * Return: void *------------------------------------------------------------------------- */ int H5Z_term_package(void) { - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -140,54 +132,54 @@ H5Z_term_package(void) int dir, nprint = 0; size_t i; - if(H5DEBUG(Z)) { - for(i = 0; i < H5Z_table_used_g; i++) { - for(dir = 0; dir<2; dir++) { - if(0 == H5Z_stat_table_g[i].stats[dir].total) + if(H5DEBUG(Z)) { + for(i = 0; i < H5Z_table_used_g; i++) { + for(dir = 0; dir<2; dir++) { + if(0 == H5Z_stat_table_g[i].stats[dir].total) continue; - if(0 == nprint++) { - /* Print column headers */ - HDfprintf(H5DEBUG(Z), "H5Z: filter statistics " - "accumulated over life of library:\n"); - HDfprintf(H5DEBUG(Z), - " %-16s %10s %10s %8s %8s %8s %10s\n", - "Filter", "Total", "Errors", "User", - "System", "Elapsed", "Bandwidth"); - HDfprintf(H5DEBUG(Z), - " %-16s %10s %10s %8s %8s %8s %10s\n", - "------", "-----", "------", "----", - "------", "-------", "---------"); - } /* end if */ - - /* Truncate the comment to fit in the field */ - HDstrncpy(comment, H5Z_table_g[i].name, sizeof comment); - comment[sizeof(comment) - 1] = '\0'; - - /* - * Format bandwidth to have four significant digits and - * units of `B/s', `kB/s', `MB/s', `GB/s', or `TB/s' or - * the word `Inf' if the elapsed time is zero. - */ - H5_bandwidth(bandwidth, - (double)(H5Z_stat_table_g[i].stats[dir].total), - H5Z_stat_table_g[i].stats[dir].timer.etime); - - /* Print the statistics */ - HDfprintf(H5DEBUG(Z), - " %s%-15s %10Hd %10Hd %8.2f %8.2f %8.2f " - "%10s\n", dir?"<":">", comment, - H5Z_stat_table_g[i].stats[dir].total, - H5Z_stat_table_g[i].stats[dir].errors, - H5Z_stat_table_g[i].stats[dir].timer.utime, - H5Z_stat_table_g[i].stats[dir].timer.stime, - H5Z_stat_table_g[i].stats[dir].timer.etime, - bandwidth); - } /* end for */ - } /* end for */ - } /* end if */ + if(0 == nprint++) { + /* Print column headers */ + HDfprintf(H5DEBUG(Z), "H5Z: filter statistics " + "accumulated over life of library:\n"); + HDfprintf(H5DEBUG(Z), + " %-16s %10s %10s %8s %8s %8s %10s\n", + "Filter", "Total", "Errors", "User", + "System", "Elapsed", "Bandwidth"); + HDfprintf(H5DEBUG(Z), + " %-16s %10s %10s %8s %8s %8s %10s\n", + "------", "-----", "------", "----", + "------", "-------", "---------"); + } /* end if */ + + /* Truncate the comment to fit in the field */ + HDstrncpy(comment, H5Z_table_g[i].name, sizeof comment); + comment[sizeof(comment) - 1] = '\0'; + + /* + * Format bandwidth to have four significant digits and + * units of `B/s', `kB/s', `MB/s', `GB/s', or `TB/s' or + * the word `Inf' if the elapsed time is zero. + */ + H5_bandwidth(bandwidth, + (double)(H5Z_stat_table_g[i].stats[dir].total), + H5Z_stat_table_g[i].stats[dir].timer.etime); + + /* Print the statistics */ + HDfprintf(H5DEBUG(Z), + " %s%-15s %10Hd %10Hd %8.2f %8.2f %8.2f " + "%10s\n", dir?"<":">", comment, + H5Z_stat_table_g[i].stats[dir].total, + H5Z_stat_table_g[i].stats[dir].errors, + H5Z_stat_table_g[i].stats[dir].timer.utime, + H5Z_stat_table_g[i].stats[dir].timer.stime, + H5Z_stat_table_g[i].stats[dir].timer.etime, + bandwidth); + } /* end for */ + } /* end for */ + } /* end if */ #endif /* H5Z_DEBUG */ - /* Free the table of filters */ + /* Free the table of filters */ if(H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); #ifdef H5Z_DEBUG @@ -198,7 +190,7 @@ H5Z_term_package(void) n++; } /* end if */ - /* Mark interface as closed */ + /* Mark interface as closed */ if(0 == n) H5_PKG_INIT_VAR = FALSE; } /* end if */ @@ -208,19 +200,11 @@ H5Z_term_package(void) /*------------------------------------------------------------------------- - * Function: H5Zregister - * - * Purpose: This function registers new filter. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Thursday, April 16, 1998 + * Function: H5Zregister * - * Modifications: - * Changed to pass in H5Z_class_t struct - * Quincey Koziol, April 5, 2003 + * Purpose: This function registers new filter. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -235,7 +219,7 @@ H5Zregister(const void *cls) /* Check args */ if (cls_real==NULL) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter class") + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter class") /* Check H5Z_class_t version number; this is where a function to convert * from an outdated version should be called. @@ -272,15 +256,15 @@ H5Zregister(const void *cls) } /* end if */ if (cls_real->id<0 || cls_real->id>H5Z_FILTER_MAX) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") if (cls_real->idfilter==NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") /* Do it */ if (H5Z_register (cls_real)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") done: FUNC_LEAVE_API(ret_value) @@ -288,24 +272,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_register - * - * Purpose: Same as the public version except this one allows filters - * to be set for predefined method numbers id) + if(H5Z_table_g[i].id == cls->id) break; /* Filter not already registered */ if(i >= H5Z_table_used_g) { - if(H5Z_table_used_g >= H5Z_table_alloc_g) { - size_t n = MAX(H5Z_MAX_NFILTERS, 2*H5Z_table_alloc_g); - H5Z_class2_t *table = (H5Z_class2_t *)H5MM_realloc(H5Z_table_g, n * sizeof(H5Z_class2_t)); + if(H5Z_table_used_g >= H5Z_table_alloc_g) { + size_t n = MAX(H5Z_MAX_NFILTERS, 2*H5Z_table_alloc_g); + H5Z_class2_t *table = (H5Z_class2_t *)H5MM_realloc(H5Z_table_g, n * sizeof(H5Z_class2_t)); #ifdef H5Z_DEBUG - H5Z_stats_t *stat_table = (H5Z_stats_t *)H5MM_realloc(H5Z_stat_table_g, n * sizeof(H5Z_stats_t)); + H5Z_stats_t *stat_table = (H5Z_stats_t *)H5MM_realloc(H5Z_stat_table_g, n * sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ - if(!table) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter table") - H5Z_table_g = table; + if(!table) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter table") + H5Z_table_g = table; #ifdef H5Z_DEBUG - if(!stat_table) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter statistics table") - H5Z_stat_table_g = stat_table; + if(!stat_table) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter statistics table") + H5Z_stat_table_g = stat_table; #endif /* H5Z_DEBUG */ - H5Z_table_alloc_g = n; - } /* end if */ + H5Z_table_alloc_g = n; + } /* end if */ - /* Initialize */ - i = H5Z_table_used_g++; - HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + /* Initialize */ + i = H5Z_table_used_g++; + HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); #ifdef H5Z_DEBUG - HDmemset(H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); + HDmemset(H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ } /* end if */ /* Filter already registered */ else { - /* Replace old contents */ - HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + /* Replace old contents */ + HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); } /* end else */ done: @@ -356,15 +334,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Zunregister - * - * Purpose: This function unregisters a filter. - * - * Return: Non-negative on success/Negative on failure + * Function: H5Zunregister * - * Programmer: Quincey Koziol - * Thursday, November 14, 2002 + * Purpose: This function unregisters a filter. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -377,13 +351,13 @@ H5Zunregister(H5Z_filter_t id) /* Check args */ if(id < 0 || id > H5Z_FILTER_MAX) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") if(id < H5Z_FILTER_RESERVED) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") /* Do it */ if(H5Z_unregister(id) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter") + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter") done: FUNC_LEAVE_API(ret_value) @@ -391,16 +365,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_unregister + * Function: H5Z_unregister * - * Purpose: Same as the public version except this one allows filters - * to be unset for predefined method numbers found = TRUE; ret_value = TRUE; @@ -546,19 +508,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z__check_unregister_dset_cb - * - * Purpose: The callback function for H5Z_unregister. It iterates - * through all opened objects. If the object is a dataset - * or a group and it uses the filter to be unregistered, the - * function returns TRUE. - * - * Return: TRUE if the object uses the filter. - * FALSE otherwise. + * Function: H5Z__check_unregister_dset_cb * - * Programmer: Raymond Lu - * 6 May 2013 + * Purpose: The callback function for H5Z_unregister. It iterates + * through all opened objects. If the object is a dataset + * or a group and it uses the filter to be unregistered, the + * function returns TRUE. * + * Return: TRUE if the object uses the filter. + * FALSE otherwise. *------------------------------------------------------------------------- */ static int @@ -574,7 +532,7 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * HDassert(obj_ptr); /* Get the dataset creation property */ - if((ocpl_id = H5D_get_create_plist((H5D_t *)obj_ptr)) < 0) + if((ocpl_id = H5D_get_create_plist((H5D_t *)obj_ptr)) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get dataset creation property list") /* Check if the filter is in the dataset creation property list */ @@ -583,7 +541,7 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. - */ + */ if(filter_in_pline) { object->found = TRUE; ret_value = TRUE; @@ -599,17 +557,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z__flush_file_cb - * - * Purpose: The callback function for H5Z_unregister. It iterates - * through all opened files and flush them. + * Function: H5Z__flush_file_cb * - * Return: FALSE if finishes flushing and moves on - * FAIL if there is an error - * - * Programmer: Raymond Lu - * 6 May 2013 + * Purpose: The callback function for H5Z_unregister. It iterates + * through all opened files and flush them. * + * Return: FALSE if finishes flushing and moves on + * FAIL if there is an error *------------------------------------------------------------------------- */ static int @@ -621,7 +575,7 @@ H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_UNUS HDassert(obj_ptr); - /* Call the flush routine for mounted file hierarchies. Do a global flush + /* Call the flush routine for mounted file hierarchies. Do a global flush * if the file is opened for write */ if(H5F_ACC_RDWR & H5F_INTENT((H5F_t *)obj_ptr)) { if(H5F_flush_mounts((H5F_t *)obj_ptr, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id) < 0) @@ -634,17 +588,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Zfilter_avail - * - * Purpose: Check if a filter is available + * Function: H5Zfilter_avail * - * Return: Non-negative (TRUE/FALSE) on success/Negative on failure - * - * Programmer: Quincey Koziol - * Thursday, November 14, 2002 - * - * Modifications: + * Purpose: Check if a filter is available * + * Return: Non-negative (TRUE/FALSE) on success/Negative on failure *------------------------------------------------------------------------- */ htri_t @@ -658,14 +606,14 @@ H5Zfilter_avail(H5Z_filter_t id) /* Check args */ if(id<0 || id>H5Z_FILTER_MAX) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - + if((ret_value = H5Z_filter_avail(id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") else if(ret_value == FALSE) { const H5Z_class2_t *filter_info; if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) - ret_value = TRUE; + ret_value = TRUE; } /* end if */ done: @@ -674,15 +622,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_filter_avail + * Function: H5Z_filter_avail * - * Purpose: Private function to check if a filter is available - * - * Return: Non-negative (TRUE/FALSE) on success/Negative on failure - * - * Programmer: Raymond Lu - * 13 February 2013 + * Purpose: Private function to check if a filter is available * + * Return: Non-negative (TRUE/FALSE) on success/Negative on failure *------------------------------------------------------------------------- */ htri_t @@ -695,8 +639,8 @@ H5Z_filter_avail(H5Z_filter_t id) /* Is the filter already registered? */ for(i = 0; i < H5Z_table_used_g; i++) - if(H5Z_table_g[i].id == id) - HGOTO_DONE(TRUE) + if(H5Z_table_g[i].id == id) + HGOTO_DONE(TRUE) done: FUNC_LEAVE_NOAPI(ret_value) @@ -704,21 +648,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_prelude_callback - * - * Purpose: Makes a dataset creation "prelude" callback for the "can_apply" - * or "set_local" routines. + * Function: H5Z_prelude_callback * - * Return: Non-negative on success/Negative on failure + * Purpose: Makes a dataset creation "prelude" callback for the "can_apply" + * or "set_local" routines. * - * Programmer: Quincey Koziol - * Friday, April 4, 2003 - * - * Notes: - * The chunk dimensions are used to create a dataspace, instead - * of passing in the dataset's dataspace, since the chunk - * dimensions are what the I/O filter will actually see + * Return: Non-negative on success/Negative on failure * + * Notes: The chunk dimensions are used to create a dataspace, instead + * of passing in the dataset's dataspace, since the chunk + * dimensions are what the I/O filter will actually see *------------------------------------------------------------------------- */ static herr_t @@ -761,7 +700,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, if(status < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "error during user callback") - /* Indicate filter can't apply to this combination of parameters. + /* Indicate filter can't apply to this combination of parameters. * If the filter is NOT optional, returns failure. */ if(status == FALSE && !(pline->filter[u].flags & H5Z_FLAG_OPTIONAL)) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "filter parameters not appropriate") @@ -791,21 +730,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_prepare_prelude_callback_dcpl - * - * Purpose: Prepares to make a dataset creation "prelude" callback - * for the "can_apply" or "set_local" routines. - * - * Return: Non-negative on success/Negative on failure + * Function: H5Z_prepare_prelude_callback_dcpl * - * Programmer: Quincey Koziol - * Friday, April 4, 2003 + * Purpose: Prepares to make a dataset creation "prelude" callback + * for the "can_apply" or "set_local" routines. * - * Notes: - * The chunk dimensions are used to create a dataspace, instead - * of passing in the dataset's dataspace, since the chunk - * dimensions are what the I/O filter will actually see + * Return: Non-negative on success/Negative on failure * + * Notes: The chunk dimensions are used to create a dataspace, instead + * of passing in the dataset's dataspace, since the chunk + * dimensions are what the I/O filter will actually see *------------------------------------------------------------------------- */ static herr_t @@ -821,7 +755,7 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type /* Check if the property list is non-default */ if(dcpl_id != H5P_DATASET_CREATE_DEFAULT) { - H5P_genplist_t *dc_plist; /* Dataset creation property list object */ + H5P_genplist_t *dc_plist; /* Dataset creation property list object */ H5O_layout_t dcpl_layout; /* Dataset's layout information */ /* Get dataset creation property list object */ @@ -874,22 +808,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_can_apply + * Function: H5Z_can_apply * - * Purpose: Checks if all the filters defined in the dataset creation - * property list can be applied to a particular combination of - * datatype and dataspace for a dataset. + * Purpose: Checks if all the filters defined in the dataset creation + * property list can be applied to a particular combination of + * datatype and dataspace for a dataset. * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Thursday, April 3, 2003 - * - * Notes: - * The chunk dimensions are used to create a dataspace, instead - * of passing in the dataset's dataspace, since the chunk - * dimensions are what the I/O filter will actually see + * Return: Non-negative on success/Negative on failure * + * Notes: The chunk dimensions are used to create a dataspace, instead + * of passing in the dataset's dataspace, since the chunk + * dimensions are what the I/O filter will actually see *------------------------------------------------------------------------- */ herr_t @@ -909,22 +838,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_set_local - * - * Purpose: Makes callbacks to modify dataset creation list property - * settings for filters on a new dataset, based on the datatype - * and dataspace of that dataset (chunk). - * - * Return: Non-negative on success/Negative on failure + * Function: H5Z_set_local * - * Programmer: Quincey Koziol - * Friday, April 4, 2003 + * Purpose: Makes callbacks to modify dataset creation list property + * settings for filters on a new dataset, based on the datatype + * and dataspace of that dataset (chunk). * - * Notes: - * The chunk dimensions are used to create a dataspace, instead - * of passing in the dataset's dataspace, since the chunk - * dimensions are what the I/O filter will actually see + * Return: Non-negative on success/Negative on failure * + * Notes: The chunk dimensions are used to create a dataspace, instead + * of passing in the dataset's dataspace, since the chunk + * dimensions are what the I/O filter will actually see *------------------------------------------------------------------------- */ herr_t @@ -944,17 +868,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_can_apply_direct + * Function: H5Z_can_apply_direct * - * Purpose: Checks if all the filters defined in the pipeline can be - * applied to an opaque byte stream (currently only a group). - * The pipeline is assumed to have at least one filter. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Neil Fortner - * Tuesday, September 22, 2009 + * Purpose: Checks if all the filters defined in the pipeline can be + * applied to an opaque byte stream (currently only a group). + * The pipeline is assumed to have at least one filter. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -976,22 +896,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_set_local_direct - * - * Purpose: Makes callbacks to modify local settings for filters on a - * new opaque object. The pipeline is assumed to have at - * least one filter. + * Function: H5Z_set_local_direct * - * Return: Non-negative on success/Negative on failure + * Purpose: Makes callbacks to modify local settings for filters on a + * new opaque object. The pipeline is assumed to have at + * least one filter. * - * Programmer: Neil Fortner - * Tuesday, September 22, 2009 - * - * Notes: - * This callback will almost certainly not do anything - * useful, other than to make certain that the filter will - * accept opque data. + * Return: Non-negative on success/Negative on failure * + * Notes: This callback will almost certainly not do anything + * useful, other than to make certain that the filter will + * accept opaque data. *------------------------------------------------------------------------- */ herr_t @@ -1013,24 +928,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_modify - * - * Purpose: Modify filter parameters for specified pipeline. - * - * Return: Non-negative on success/Negative on failure + * Function: H5Z_modify * - * Programmer: Quincey Koziol - * Friday, April 5, 2003 - * - * Modifications: + * Purpose: Modify filter parameters for specified pipeline. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, - size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) + size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) { - size_t idx; /* Index of filter in pipeline */ + size_t idx; /* Index of filter in pipeline */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1047,7 +956,7 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, /* Check if the filter was not already in the pipeline */ if(idx > pline->nused) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Change parameters for filter */ pline->filter[idx].flags = flags; @@ -1055,11 +964,11 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, /* Free any existing parameters */ if(pline->filter[idx].cd_values != NULL && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) - H5MM_xfree(pline->filter[idx].cd_values); + H5MM_xfree(pline->filter[idx].cd_values); /* Set parameters */ if(cd_nelmts > 0) { - size_t i; /* Local index variable */ + size_t i; /* Local index variable */ /* Allocate memory or point at internal buffer */ if(cd_nelmts > H5Z_COMMON_CD_VALUES) { @@ -1071,8 +980,8 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, pline->filter[idx].cd_values = pline->filter[idx]._cd_values; /* Copy client data values */ - for(i = 0; i < cd_nelmts; i++) - pline->filter[idx].cd_values[i] = cd_values[i]; + for(i = 0; i < cd_nelmts; i++) + pline->filter[idx].cd_values[i] = cd_values[i]; } /* end if */ else pline->filter[idx].cd_values = NULL; @@ -1083,24 +992,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_append - * - * Purpose: Append another filter to the specified pipeline. - * - * Return: Non-negative on success/Negative on failure + * Function: H5Z_append * - * Programmer: Robb Matzke - * Tuesday, August 4, 1998 - * - * Modifications: + * Purpose: Append another filter to the specified pipeline. * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, - size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) + size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) { - size_t idx; + size_t idx; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1115,7 +1018,7 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, * decide to relax this restriction in the future. */ if(pline->nused >= H5Z_MAX_NFILTERS) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "too many filters in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "too many filters in pipeline") /* Check for freshly allocated filter pipeline */ if(pline->version == 0) @@ -1123,7 +1026,7 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, /* Allocate additional space in the pipeline if it's full */ if(pline->nused >= pline->nalloc) { - H5O_pline_t x; + H5O_pline_t x; size_t n; /* Each filter's data may be stored internally or may be @@ -1137,10 +1040,10 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, if(pline->filter[n].cd_values == pline->filter[n]._cd_values) pline->filter[n].cd_values = (unsigned *)((void *) ~((size_t)NULL)); - x.nalloc = MAX(H5Z_MAX_NFILTERS, 2 * pline->nalloc); - x.filter = (H5Z_filter_info_t *)H5MM_realloc(pline->filter, x.nalloc * sizeof(x.filter[0])); - if(NULL == x.filter) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter pipeline") + x.nalloc = MAX(H5Z_MAX_NFILTERS, 2 * pline->nalloc); + x.filter = (H5Z_filter_info_t *)H5MM_realloc(pline->filter, x.nalloc * sizeof(x.filter[0])); + if(NULL == x.filter) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter pipeline") /* Fix pointers in previous filters that need to point to their own * internal data. @@ -1150,18 +1053,18 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, x.filter[n].cd_values = x.filter[n]._cd_values; /* Point to newly allocated buffer */ - pline->nalloc = x.nalloc; - pline->filter = x.filter; + pline->nalloc = x.nalloc; + pline->filter = x.filter; } /* end if */ /* Add the new filter to the pipeline */ idx = pline->nused; pline->filter[idx].id = filter; pline->filter[idx].flags = flags; - pline->filter[idx].name = NULL; /*we'll pick it up later*/ + pline->filter[idx].name = NULL; /* we'll pick it up later*/ pline->filter[idx].cd_nelmts = cd_nelmts; if(cd_nelmts > 0) { - size_t i; /* Local index variable */ + size_t i; /* Local index variable */ /* Allocate memory or point at internal buffer */ if(cd_nelmts > H5Z_COMMON_CD_VALUES) { @@ -1173,8 +1076,8 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, pline->filter[idx].cd_values = pline->filter[idx]._cd_values; /* Copy client data values */ - for(i = 0; i < cd_nelmts; i++) - pline->filter[idx].cd_values[i] = cd_values[i]; + for(i = 0; i < cd_nelmts; i++) + pline->filter[idx].cd_values[i] = cd_values[i]; } /* end if */ else pline->filter[idx].cd_values = NULL; @@ -1187,32 +1090,26 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_find_idx - * - * Purpose: Given a filter ID return the offset in the global array - * that holds all the registered filters. - * - * Return: Success: Non-negative index of entry in global filter table. - * Failure: Negative - * - * Programmer: Quincey Koziol - * Friday, April 5, 2003 + * Function: H5Z_find_idx * - * Modifications: + * Purpose: Given a filter ID return the offset in the global array + * that holds all the registered filters. * + * Return: Success: Non-negative index of entry in global filter table. + * Failure: Negative *------------------------------------------------------------------------- */ static int H5Z_find_idx(H5Z_filter_t id) { size_t i; /* Local index variable */ - int ret_value=FAIL; /* Return value */ + int ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR for (i=0; ifilter[].flags). The filters are processed in - * definition order unless the H5Z_FLAG_REVERSE is set. The - * FILTER_MASK is a bit-mask to indicate which filters to skip - * and on exit will indicate which filters failed. Each - * filter has an index number in the pipeline and that index - * number is the filter's bit in the FILTER_MASK. NBYTES is the - * number of bytes of data to filter and on exit should be the - * number of resulting bytes while BUF_SIZE holds the total - * allocated size of the buffer, which is pointed to BUF. - * - * If the buffer must grow during processing of the pipeline - * then the pipeline function should free the original buffer - * and return a fresh buffer, adjusting BUF_SIZE accordingly. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Tuesday, August 4, 1998 - * - * Modifications: - * + * Function: H5Z_pipeline + * + * Purpose: Process data through the filter pipeline. The FLAGS argument + * is the filter invocation flags (definition flags come from + * the PLINE->filter[].flags). The filters are processed in + * definition order unless the H5Z_FLAG_REVERSE is set. The + * FILTER_MASK is a bit-mask to indicate which filters to skip + * and on exit will indicate which filters failed. Each + * filter has an index number in the pipeline and that index + * number is the filter's bit in the FILTER_MASK. NBYTES is the + * number of bytes of data to filter and on exit should be the + * number of resulting bytes while BUF_SIZE holds the total + * allocated size of the buffer, which is pointed to BUF. + * + * If the buffer must grow during processing of the pipeline + * then the pipeline function should free the original buffer + * and return a fresh buffer, adjusting BUF_SIZE accordingly. + * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, - unsigned *filter_mask/*in,out*/, H5Z_EDC_t edc_read, - H5Z_cb_t cb_struct, size_t *nbytes/*in,out*/, - size_t *buf_size/*in,out*/, void **buf/*in,out*/) + unsigned *filter_mask/*in,out*/, H5Z_EDC_t edc_read, + H5Z_cb_t cb_struct, size_t *nbytes/*in,out*/, + size_t *buf_size/*in,out*/, void **buf/*in,out*/) { - size_t i, idx, new_nbytes; - int fclass_idx; /* Index of filter class in global table */ - H5Z_class2_t *fclass=NULL; /* Filter class pointer */ + size_t i, idx, new_nbytes; + int fclass_idx; /* Index of filter class in global table */ + H5Z_class2_t *fclass = NULL; /* Filter class pointer */ #ifdef H5Z_DEBUG - H5Z_stats_t *fstats=NULL; /* Filter stats pointer */ - H5_timer_t timer; + H5Z_stats_t *fstats = NULL; /* Filter stats pointer */ + H5_timer_t timer; #endif - unsigned failed = 0; - unsigned tmp_flags; - herr_t ret_value=SUCCEED; /* Return value */ + unsigned failed = 0; + unsigned tmp_flags; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(0==(flags & ~((unsigned)H5Z_FLAG_INVMASK))); + HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_INVMASK))); HDassert(filter_mask); - HDassert(nbytes && *nbytes>0); - HDassert(buf_size && *buf_size>0); + HDassert(nbytes && *nbytes > 0); + HDassert(buf_size && *buf_size > 0); HDassert(buf && *buf); - HDassert(!pline || pline->nusednused < H5Z_MAX_NFILTERS); if (pline && (flags & H5Z_FLAG_REVERSE)) { /* Read */ - for (i=pline->nused; i>0; --i) { - idx = i-1; - - if (*filter_mask & ((unsigned)1<filter[idx].id)) < 0) { + for (i = pline->nused; i > 0; --i) { + idx = i - 1; + + if (*filter_mask & ((unsigned)1 << idx)) { + failed |= (unsigned)1 << idx; + continue;/*filter excluded*/ + } + + /* If the filter isn't registered and the application doesn't + * indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), + * try to load it dynamically and register it. Otherwise, return failure + */ + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; - const H5Z_class2_t *filter_info; + const H5Z_class2_t *filter_info; - /* Try loading the filter */ - if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { - /* Register the filter we loaded */ - if(H5Z_register(filter_info) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + /* Try loading the filter */ + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { + /* Register the filter we loaded */ + if(H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") - /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) - issue_error = TRUE; - } /* end if */ - else - issue_error = TRUE; + /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) + issue_error = TRUE; + } /* end if */ + else + issue_error = TRUE; /* Check for error */ if(issue_error) { - /* Print out the filter name to give more info. But the name is optional for - * the filter */ + /* Print out the filter name to give more info. But the name is optional for + * the filter */ if(pline->filter[idx].name) HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", pline->filter[idx].name) else @@ -1352,65 +1235,65 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, } /* end if */ } /* end if */ - fclass=&H5Z_table_g[fclass_idx]; + fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG - fstats=&H5Z_stat_table_g[fclass_idx]; - H5_timer_begin(&timer); + fstats = &H5Z_stat_table_g[fclass_idx]; + H5_timer_begin(&timer); #endif - tmp_flags=flags|(pline->filter[idx].flags); - tmp_flags|=(edc_read== H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0; - new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); + tmp_flags = flags|(pline->filter[idx].flags); + tmp_flags |= (edc_read== H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0; + new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, + pline->filter[idx].cd_values, *nbytes, buf_size, buf); #ifdef H5Z_DEBUG - H5_timer_end(&(fstats->stats[1].timer), &timer); - fstats->stats[1].total += MAX(*nbytes, new_nbytes); - if (0==new_nbytes) fstats->stats[1].errors += *nbytes; + H5_timer_end(&(fstats->stats[1].timer), &timer); + fstats->stats[1].total += MAX(*nbytes, new_nbytes); + if (0 == new_nbytes) fstats->stats[1].errors += *nbytes; #endif if(0==new_nbytes) { - if((cb_struct.func && (H5Z_CB_FAIL==cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) - || !cb_struct.func) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") + if((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) || !cb_struct.func) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") *nbytes = *buf_size; failed |= (unsigned)1 << idx; H5E_clear_stack(NULL); - } else { + } + else { *nbytes = new_nbytes; } - } - } else if (pline) { /* Write */ - for (idx=0; idxnused; idx++) { - if (*filter_mask & ((unsigned)1<filter[idx].id))<0) { + } + } + else if (pline) { /* Write */ + for (idx = 0; idx < pline->nused; idx++) { + if (*filter_mask & ((unsigned)1 << idx)) { + failed |= (unsigned)1 << idx; + continue; /*filter excluded*/ + } + if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { /* Check if filter is optional -- If it isn't, then error */ - if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") + if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") - failed |= (unsigned)1 << idx; + failed |= (unsigned)1 << idx; H5E_clear_stack(NULL); - continue; /*filter excluded*/ - } - fclass=&H5Z_table_g[fclass_idx]; + continue; /*filter excluded*/ + } + fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG - fstats=&H5Z_stat_table_g[fclass_idx]; - H5_timer_begin(&timer); + fstats = &H5Z_stat_table_g[fclass_idx]; + H5_timer_begin(&timer); #endif - new_nbytes = (fclass->filter)(flags|(pline->filter[idx].flags), pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); + new_nbytes = (fclass->filter)(flags|(pline->filter[idx].flags), pline->filter[idx].cd_nelmts, + pline->filter[idx].cd_values, *nbytes, buf_size, buf); #ifdef H5Z_DEBUG - H5_timer_end(&(fstats->stats[0].timer), &timer); - fstats->stats[0].total += MAX(*nbytes, new_nbytes); - if (0==new_nbytes) fstats->stats[0].errors += *nbytes; + H5_timer_end(&(fstats->stats[0].timer), &timer); + fstats->stats[0].total += MAX(*nbytes, new_nbytes); + if (0 == new_nbytes) fstats->stats[0].errors += *nbytes; #endif - if(0==new_nbytes) { - if (0==(pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { - if((cb_struct.func && (H5Z_CB_FAIL==cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data))) - || !cb_struct.func) + if(0 == new_nbytes) { + if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { + if((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data))) || !cb_struct.func) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") *nbytes = *buf_size; @@ -1418,10 +1301,11 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, failed |= (unsigned)1 << idx; H5E_clear_stack(NULL); - } else { + } + else { *nbytes = new_nbytes; } - } + } } *filter_mask = failed; @@ -1432,41 +1316,35 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_filter_info + * Function: H5Z_filter_info * - * Purpose: Get pointer to filter info for pipeline - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Friday, April 5, 2003 - * - * Modifications: + * Purpose: Get pointer to filter info for pipeline * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ H5Z_filter_info_t * H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) { - size_t idx; /* Index of filter in pipeline */ + size_t idx; /* Index of filter in pipeline */ H5Z_filter_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) HDassert(pline); - HDassert(filter>=0 && filter<=H5Z_FILTER_MAX); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ - for(idx=0; idxnused; idx++) - if(pline->filter[idx].id==filter) + for(idx = 0; idx < pline->nused; idx++) + if(pline->filter[idx].id == filter) break; /* Check if the filter was not already in the pipeline */ - if(idx>=pline->nused) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "filter not in pipeline") + if(idx >= pline->nused) + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "filter not in pipeline") /* Set return value */ - ret_value=&pline->filter[idx]; + ret_value = &pline->filter[idx]; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1474,41 +1352,35 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_filter_in_pline - * - * Purpose: Check wheter a filter is in the filter pipeline using the - * filter ID. This function is very similar to H5Z_filter_info + * Function: H5Z_filter_in_pline * - * Return: TRUE - found filter - * FALSE - not found - * FAIL - error - * - * Programmer: Raymond Lu - * 26 April 2013 - * - * Modifications: + * Purpose: Check wheter a filter is in the filter pipeline using the + * filter ID. This function is very similar to H5Z_filter_info * + * Return: TRUE - found filter + * FALSE - not found + * FAIL - error *------------------------------------------------------------------------- */ htri_t H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) { - size_t idx; /* Index of filter in pipeline */ + size_t idx; /* Index of filter in pipeline */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) HDassert(pline); - HDassert(filter>=0 && filter<=H5Z_FILTER_MAX); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ - for(idx=0; idxnused; idx++) - if(pline->filter[idx].id==filter) + for(idx = 0; idx < pline->nused; idx++) + if(pline->filter[idx].id == filter) break; /* Check if the filter was not already in the pipeline */ - if(idx>=pline->nused) - ret_value = FALSE; + if(idx >= pline->nused) + ret_value = FALSE; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1517,18 +1389,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_all_filters_avail - * - * Purpose: Verify that all the filters in a pipeline are currently - * available (i.e. registered) + * Function: H5Z_all_filters_avail * - * Return: Non-negative (TRUE/FALSE) on success/Negative on failure - * - * Programmer: Quincey Koziol - * Tuesday, April 8, 2003 - * - * Modifications: + * Purpose: Verify that all the filters in a pipeline are currently + * available (i.e. registered) * + * Return: Non-negative (TRUE/FALSE) on success/Negative on failure *------------------------------------------------------------------------- */ htri_t @@ -1543,15 +1409,14 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) HDassert(pline); /* Iterate through all the filters in pipeline */ - for(i=0; inused; i++) { - + for(i = 0; i < pline->nused; i++) { /* Look for each filter in the list of registered filters */ - for(j=0; jfilter[i].id) + for(j = 0; j < H5Z_table_used_g; j++) + if(H5Z_table_g[j].id == pline->filter[i].id) break; /* Check if we didn't find the filter */ - if(j==H5Z_table_used_g) + if(j == H5Z_table_used_g) HGOTO_DONE(FALSE) } /* end for */ @@ -1564,16 +1429,10 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_delete * - * Purpose: Delete filter FILTER from pipeline PLINE; - * deletes all filters if FILTER is H5Z_FILTER_NONE - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Pedro Vicente - * Monday, January 26, 2004 - * - * Modifications: + * Purpose: Delete filter FILTER from pipeline PLINE; + * deletes all filters if FILTER is H5Z_FILTER_NONE * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1588,7 +1447,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* if the pipeline has no filters, just return */ - if(pline->nused==0) + if(pline->nused == 0) HGOTO_DONE(SUCCEED) /* Delete all filters */ @@ -1649,14 +1508,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Zget_filter_info * - * Purpose: Gets information about a pipeline data filter and stores it - * in filter_config_flags. - * - * Return: zero on success / negative on failure - * - * Programmer: James Laird and Nat Furrer - * Monday, June 7, 2004 - * + * Purpose: Gets information about a pipeline data filter and stores it + * in filter_config_flags. *------------------------------------------------------------------------- */ herr_t @@ -1679,21 +1532,15 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_get_filter_info * - * Purpose: Gets information about a pipeline data filter and stores it - * in filter_config_flags. - * - * Return: zero on success / negative on failure - * - * Programmer: Quincey Koziol - * Saturday, May 11, 2013 - * + * Purpose: Gets information about a pipeline data filter and stores it + * in filter_config_flags. *------------------------------------------------------------------------- */ herr_t H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) { H5Z_class2_t *fclass; - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) -- cgit v0.12 From 82986dba722596e4596b4aa85e172087793c6738 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 5 Oct 2017 08:51:32 -0500 Subject: Fix typo in valgrind test name --- tools/test/h5dump/CMakeTestsXML.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index 0f8875f..17d0286b 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -176,7 +176,7 @@ macro (ADD_XML_H5_TEST resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP_XML-${resultfile} COMMAND $ --xml ${ARGN}) - set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") endif () -- cgit v0.12 From a49372724cbf9201c4f1d8c8daab1d56a33dc63e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 5 Oct 2017 08:55:58 -0500 Subject: Fix other test name typos --- tools/test/h5dump/CMakeTestsXML.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index 17d0286b..9c68e5f 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -178,10 +178,10 @@ add_test (NAME H5DUMP_XML-${resultfile} COMMAND $ --xml ${ARGN}) set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") if (NOT "${resultcode}" STREQUAL "0") - set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_xml_test}" STREQUAL "") - set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) + set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) endif () else () # Remove any output file left over from previous test run -- cgit v0.12 From ceab5a51766f3e32d02bc65d59374c79910483bd Mon Sep 17 00:00:00 2001 From: mainzer Date: Thu, 5 Oct 2017 17:25:57 -0500 Subject: Edits to the file open optimization and associated test code to bring them closer to the HDF5 library's unwritten coding standards. Also bug fix to repair a hang in testphdf5. Tested parallel/debug on Charis and Jelly, parallel/production on Jelly. --- src/H5FDmpio.h | 2 + src/H5Fsuper.c | 47 ++- testpar/t_pread.c | 835 +++++++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 704 insertions(+), 180 deletions(-) diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h index 9bcc182..f02afe6 100644 --- a/src/H5FDmpio.h +++ b/src/H5FDmpio.h @@ -29,6 +29,7 @@ #endif /* H5_HAVE_PARALLEL */ #ifdef H5_HAVE_PARALLEL +#if 0 /* delete this eventually */ #define H5FD_GET_MPI_RANK_AND_SIZE(rank,size, f) { \ (rank) = 0; (size) = 1; \ if (H5F_HAS_FEATURE((f), H5FD_FEAT_HAS_MPI)) { \ @@ -49,6 +50,7 @@ (comm) = H5F_mpi_get_comm((f)); \ else (comm) = MPI_COMM_WORLD; \ } +#endif /* delete this eventually */ /*Turn on H5FDmpio_debug if H5F_DEBUG is on */ #ifdef H5F_DEBUG diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 4750223..a34a7fd 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -333,7 +333,10 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial unsigned rw_flags; /* Read/write permissions for file */ hbool_t skip_eof_check = FALSE; /* Whether to skip checking the EOF value */ herr_t ret_value = SUCCEED; /* Return value */ +#ifdef H5_HAVE_PARALLEL int mpi_rank = 0, mpi_size = 1; + int mpi_result; +#endif /* H5_HAVE_PARALLEL */ FUNC_ENTER_PACKAGE_TAG(meta_dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) @@ -356,21 +359,43 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial /* Find the superblock */ #ifdef H5_HAVE_PARALLEL +#if 0 H5FD_GET_MPI_RANK_AND_SIZE(mpi_rank, mpi_size, f); +#else + if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { + + if((mpi_rank = H5F_mpi_get_rank(f)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Can't get MPI rank") + + if((mpi_size = H5F_mpi_get_size(f)) < 0) + HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size") + } +#endif /* If we are an MPI application with at least two processes, the * following superblock signature location optimization is applicable. */ if ( mpi_size > 1 ) { - MPI_Comm this_comm = MPI_COMM_NULL; - - if ( mpi_rank == 0 ) { - if(H5FD_locate_signature(&fdio_info, &super_addr) < 0) - HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") - } - H5FD_GET_MPI_COMM(this_comm, f); - if (( this_comm == MPI_COMM_NULL ) || - ( MPI_Bcast(&super_addr,sizeof(super_addr), MPI_BYTE, 0, this_comm) != MPI_SUCCESS)) - HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") + MPI_Comm this_comm = MPI_COMM_NULL; + + if ( mpi_rank == 0 ) { + if(H5FD_locate_signature(&fdio_info, &super_addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") + } +#if 0 + H5FD_GET_MPI_COMM(this_comm, f); + if (( this_comm == MPI_COMM_NULL ) || + ( MPI_Bcast(&super_addr,sizeof(super_addr), MPI_BYTE, 0, this_comm) != MPI_SUCCESS)) + HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") +#else + HDassert(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)); + + if ( MPI_COMM_NULL == (this_comm = H5F_mpi_get_comm(f)) ) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI communicator") + + if ( MPI_SUCCESS != + (mpi_result = MPI_Bcast(&super_addr,sizeof(super_addr), MPI_BYTE, 0, this_comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) +#endif } else { /* Locate the signature as per per the serial library */ @@ -381,7 +406,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial #ifdef H5_HAVE_PARALLEL } -#endif +#endif /* H5_HAVE_PARALLEL */ if(HADDR_UNDEF == super_addr) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "file signature not found") diff --git a/testpar/t_pread.c b/testpar/t_pread.c index 4512185..ecc7360 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -1,196 +1,693 @@ -#include -#include -#include +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include "mpi.h" -#include "hdf5.h" +/* + * Collective file open optimization tests + * + */ -static char *random_hdf5_text = - "Now is the time for all first-time-users of HDF5 to read their manual or go thru the tutorials!\n\ -While you\'re at it, now is also the time to read up on MPI-IO."; -static char *datafile_relocated = "relocated_super.h5"; +#include "h5test.h" +#include "testpar.h" + +#define NFILENAME 3 +const char *FILENAMES[NFILENAME + 1]={"t_pread_data_file", + "reloc_t_pread_data_file", + "prefix_file", + NULL}; +#define FILENAME_BUF_SIZE 1024 + +#define COUNT 1000 + hbool_t pass = true; +static const char *random_hdf5_text = +"Now is the time for all first-time-users of HDF5 to read their \ +manual or go thru the tutorials!\n\ +While you\'re at it, now is also the time to read up on MPI-IO."; +static int generate_test_file(int mpi_rank, int mpi_size); +static int test_parallel_read(int mpi_rank); -static void + +/*------------------------------------------------------------------------- + * Function: generate_test_file + * + * Purpose: *** Richard -- please fill this in *** + * + * + * Return: Success: 0 + * + * Failure: 1 + * + * Programmer: Richard Warren + * 10/1/17 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static int generate_test_file( int mpi_rank, int mpi_size ) { - FILE *header; - char *datafile_base = "mytestfile.h5"; - char *prologue_file = "hdf5_readme.txt"; - hid_t file_id, memspace, filespace, attr_id, fapl_id, dxpl_id, dset_id; - hsize_t i, offset, count = 1000; - hsize_t dims[1] = {0}; - float nextValue, data_slice[count]; - - pass = true; - - nextValue = (float)(mpi_rank * count); - for(i=0; i 0 ) return; - - /* ---- mpi_rank 0 ------*/ - header = fopen( prologue_file, "w+"); - if (header == NULL) { - pass = false; - HDfprintf(stderr, "FATAL: Unable to create a simple txt file\n"); - return; - } - else { - size_t bytes_written, bytes_to_write = strlen(random_hdf5_text); - bytes_written = fwrite( random_hdf5_text, 1, bytes_to_write , header); - if (bytes_written == 0) { - pass = false; - HDfprintf(stderr, "FATAL: Unable to write a simple txt file\n"); - } - fclose(header); - } + /* setup the file names */ + if ( pass ) { + HDassert(FILENAMES[0]); - if ( pass ) { - char cmd[256]; - sprintf(cmd, "../tools/src/h5jam/h5jam -i %s -u %s -o %s", - datafile_base, prologue_file, datafile_relocated); - system(cmd); - unlink(datafile_base); - unlink(prologue_file); - } -} + if ( h5_fixname(FILENAMES[0], H5P_DEFAULT, data_filename, + sizeof(data_filename)) == NULL ) { + pass = FALSE; + failure_mssg = "h5_fixname(0) failed.\n"; + } + } + + if ( pass ) { + HDassert(FILENAMES[1]); + + if ( h5_fixname(FILENAMES[1], H5P_DEFAULT, reloc_data_filename, + sizeof(reloc_data_filename)) == NULL ) { + + pass = FALSE; + failure_mssg = "h5_fixname(1) failed.\n"; + } + } + + if ( pass ) { + HDassert(FILENAMES[2]); + + if ( h5_fixname(FILENAMES[2], H5P_DEFAULT, prolog_filename, + sizeof(prolog_filename)) == NULL ) { + pass = FALSE; + failure_mssg = "h5_fixname(2) failed.\n"; + } + } + + /* setup data to write */ + if ( pass ) { + if ( (data_slice = (float *)HDmalloc(COUNT * sizeof(float))) == NULL ) { + pass = FALSE; + failure_mssg = "malloc of data_slice failed.\n"; + } + } + + if ( pass ) { + nextValue = (float)(mpi_rank * COUNT); + + for(i=0; i 0 ) ) { + pass = FALSE; + failure_mssg = "One or more processes report failure.\n"; + } + + /* report results */ + if ( mpi_rank == 0 ) { + if ( pass ) { + HDfprintf(stdout, "Done.\n"); + } else { + HDfprintf(stdout, "FAILED.\n"); + HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", + fcn_name, failure_mssg); + } + } + /* free data_slice if it has been allocated */ + if ( data_slice != NULL ) { + HDfree(data_slice); + data_slice = NULL; + } -static void -test_parallel_read( int mpi_rank, int mpi_size ) + return(! pass); + +} /* generate_test_file() */ + + +/*------------------------------------------------------------------------- + * Function: test_parallel_read + * + * Purpose: *** Richard -- please fill this in *** + * + * + * Return: Success: 0 + * + * Failure: 1 + * + * Programmer: Richard Warren + * 10/1/17 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static int +test_parallel_read(int mpi_rank) { - int status, errors = 0; - hid_t access_plist = -1, dataset = -1; - hid_t file_id = -1, memspace = -1, dataspace = -1; - hsize_t i, offset, count = 1000; - hsize_t dims[1] = {0}; - float nextValue, data_slice[count]; - herr_t ret; - - access_plist = H5Pcreate(H5P_FILE_ACCESS); - if (access_plist >= 0) { - ret = H5Pset_fapl_mpio(access_plist, MPI_COMM_WORLD, MPI_INFO_NULL); - } else pass = false; - if (ret >= 0) { - file_id = H5Fopen(datafile_relocated,H5F_ACC_RDONLY,access_plist); - } else pass = false; - if (file_id >= 0) { - dataset = H5Dopen2(file_id, "dataset0", H5P_DEFAULT); - } else pass = false; - if (dataset >= 0) { - dims[0] = count; - memspace = H5Screate_simple(1, dims, NULL); - } else pass = false; - if ( memspace >= 0 ) { - dataspace = H5Dget_space(dataset); - } else pass = false; - if ( dataspace >= 0 ) { - offset = mpi_rank * count; - ret = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, &offset, NULL, &count, NULL); - } else pass = false; - if ( ret >= 0 ) { - ret = H5Dread(dataset, H5T_NATIVE_FLOAT, memspace, dataspace, H5P_DEFAULT, data_slice); - } else pass = false; - if (ret >= 0) { - nextValue = (float)(mpi_rank * count); - for (i=0; i < count; i++) { - if (data_slice[i] != nextValue) pass = false; - nextValue += 1; - } - } else pass = false; - - status = ( pass ? 0 : -1 ); - MPI_Allreduce( &status, &errors, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD ); - - if ( mpi_rank == 0) - HDfprintf(stderr, "H5Fopen/H5Dread/data_validation %s\n", ((errors == 0) ? "succeeded" : "FAILED")); - - H5Pclose(access_plist); - H5Dclose(dataset); - H5Fclose(file_id); - - /* Cleanup */ - unlink(datafile_relocated); - - return; -} + const char *failure_mssg; + const char *fcn_name = "test_parallel_read()"; + char reloc_data_filename[FILENAME_BUF_SIZE]; + int local_failure = 0; + int global_failures = 0; + hid_t fapl_id; + hid_t file_id; + hid_t dset_id; + hid_t memspace = -1; + hid_t filespace = -1; + hsize_t i; + hsize_t offset; + hsize_t count = COUNT; + hsize_t dims[1] = {0}; + float nextValue; + float *data_slice = NULL; + + pass = TRUE; + + if ( mpi_rank == 0 ) { + + TESTING("parallel file open test 1"); + } + + /* allocate space for the data_slice array */ + if ( pass ) { + if ( (data_slice = (float *)HDmalloc(COUNT * sizeof(float))) == NULL ) { + pass = FALSE; + failure_mssg = "malloc of data_slice failed.\n"; + } + } + + + /* construct file file name */ + if ( pass ) { + HDassert(FILENAMES[1]); + + if ( h5_fixname(FILENAMES[1], H5P_DEFAULT, reloc_data_filename, + sizeof(reloc_data_filename)) == NULL ) { + + pass = FALSE; + failure_mssg = "h5_fixname(1) failed.\n"; + } + } + + /* setup FAPL */ + if ( pass ) { + if ( (fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0 ) { + pass = FALSE; + failure_mssg = "H5Pcreate(H5P_FILE_ACCESS) failed.\n"; + } + } + + if ( pass ) { + if ( (H5Pset_fapl_mpio(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL)) < 0 ) { + pass = FALSE; + failure_mssg = "H5Pset_fapl_mpio() failed\n"; + } + } + + /* open the file -- should have user block, exercising the optimization */ + if ( pass ) { + if ( (file_id = H5Fopen(reloc_data_filename, + H5F_ACC_RDONLY, fapl_id)) < 0 ) { + pass = FALSE; + failure_mssg = "H5Fopen() failed\n"; + } + } + + /* open the data set */ + if ( pass ) { + if ( (dset_id = H5Dopen2(file_id, "dataset0", H5P_DEFAULT)) < 0 ) { + pass = FALSE; + failure_mssg = "H5Dopen2() failed\n"; + } + } + + /* setup memspace */ + if ( pass ) { + dims[0] = count; + if ( (memspace = H5Screate_simple(1, dims, NULL)) < 0 ) { + pass = FALSE; + failure_mssg = "H5Screate_simple(1, dims, NULL) failed\n"; + } + } + + /* setup filespace */ + if ( pass ) { + if ( (filespace = H5Dget_space(dset_id)) < 0 ) { + pass = FALSE; + failure_mssg = "H5Dget_space(dataset) failed\n"; + } + } + + if ( pass ) { + offset = (hsize_t)mpi_rank * count; + if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, + &offset, NULL, &count, NULL)) < 0 ) { + pass = FALSE; + failure_mssg = "H5Sselect_hyperslab() failed\n"; + } + } + + /* read this processes section of the data */ + if ( pass ) { + if ( (H5Dread(dset_id, H5T_NATIVE_FLOAT, memspace, + filespace, H5P_DEFAULT, data_slice)) < 0 ) { + pass = FALSE; + failure_mssg = "H5Dread() failed\n"; + } + } + + /* verify the data */ + if ( pass ) { + nextValue = (float)((hsize_t)mpi_rank * count); + i = 0; + while ( ( pass ) && ( i < count ) ) { + /* what we really want is data_slice[i] != nextValue -- + * the following is a circumlocution to shut up the + * the compiler. + */ + if ( ( data_slice[i] > nextValue ) || + ( data_slice[i] < nextValue ) ) { + pass = FALSE; + failure_mssg = "Unexpected dset contents.\n"; + } + nextValue += 1; + i++; + } + } + + /* close file, etc. */ + if ( pass ) { + if ( H5Dclose(dset_id) < 0 ) { + pass = false; + failure_mssg = "H5Dclose(dset_id) failed.\n"; + } + } + + if ( pass ) { + if ( H5Sclose(memspace) < 0 ) { + pass = false; + failure_mssg = "H5Sclose(memspace) failed.\n"; + } + } + + if ( pass ) { + if ( H5Sclose(filespace) < 0 ) { + pass = false; + failure_mssg = "H5Sclose(filespace) failed.\n"; + } + } + + if ( pass ) { + if ( H5Fclose(file_id) < 0 ) { + pass = false; + failure_mssg = "H5Fclose(file_id) failed.\n"; + } + } + + if ( pass ) { + if ( H5Pclose(fapl_id) < 0 ) { + pass = false; + failure_mssg = "H5Pclose(fapl_id) failed.\n"; + } + } + + /* collect results from other processes. + * Only overwrite the failure message if no preveious error + * has been detected + */ + local_failure = ( pass ? 0 : 1 ); + + if ( MPI_Allreduce( &local_failure, &global_failures, 1, + MPI_INT, MPI_SUM, MPI_COMM_WORLD) != MPI_SUCCESS ) { + if ( pass ) { + pass = FALSE; + failure_mssg = "MPI_Allreduce() failed.\n"; + } + } else if ( ( pass ) && ( global_failures > 0 ) ) { + pass = FALSE; + failure_mssg = "One or more processes report failure.\n"; + } + /* report results and finish cleanup */ + if ( mpi_rank == 0 ) { + if ( pass ) { + PASSED(); + } else { + H5_FAILED(); + HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", + fcn_name, failure_mssg); + } + + HDremove(reloc_data_filename); + } + + /* free data_slice if it has been allocated */ + if ( data_slice != NULL ) { + HDfree(data_slice); + data_slice = NULL; + } + + + return( ! pass ); + +} /* test_parallel_read() */ + + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: *** Richard -- please fill this in *** + * + * + * WARNING: This test uses fork() and execve(), and + * therefore will not run on Windows. + * + * Return: Success: 0 + * + * Failure: 1 + * + * Programmer: Richard Warren + * 10/1/17 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ int main( int argc, char **argv) { - int status, errors, mpi_rank, mpi_size; + int nerrs = 0; + int mpi_rank; + int mpi_size; - if ((status = MPI_Init(&argc, &argv)) != MPI_SUCCESS) { - HDfprintf(stderr, "FATAL: Unable to initialize MPI\n"); - exit(1); - } - if ((status = MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank)) != MPI_SUCCESS) { - HDfprintf(stderr, "FATAL: MPI_Comm_rank returned an error\n"); - exit(2); - } - if ((status = MPI_Comm_size(MPI_COMM_WORLD, &mpi_size)) != MPI_SUCCESS) { - HDfprintf(stderr, "FATAL: MPI_Comm_size returned an error\n"); - exit(2); - } + if ( (MPI_Init(&argc, &argv)) != MPI_SUCCESS) { + HDfprintf(stderr, "FATAL: Unable to initialize MPI\n"); + exit(1); + } - generate_test_file( mpi_rank, mpi_size ); - status = ( pass ? 0 : -1 ); + if ( (MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank)) != MPI_SUCCESS) { + HDfprintf(stderr, "FATAL: MPI_Comm_rank returned an error\n"); + exit(2); + } - /* Synch all ranks before attempting the parallel read */ - if ( MPI_Allreduce( &status, &errors, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD ) != MPI_SUCCESS) { - pass = false; - if (mpi_rank == 0) HDfprintf(stderr, "FATAL: MPI_Allreduce returned an error\n"); - } + if ( (MPI_Comm_size(MPI_COMM_WORLD, &mpi_size)) != MPI_SUCCESS) { + HDfprintf(stderr, "FATAL: MPI_Comm_size returned an error\n"); + exit(2); + } + + H5open(); + + if ( mpi_rank == 0 ) { + HDfprintf(stdout, "========================================\n"); + HDfprintf(stdout, "Collective file open optimization tests\n"); + HDfprintf(stdout, " mpi_size = %d\n", mpi_size); + HDfprintf(stdout, "========================================\n"); + } + + if ( mpi_size < 2 ) { - if ( errors == 0 ) { - test_parallel_read( mpi_rank, mpi_size ); + if ( mpi_rank == 0 ) { + + HDprintf(" Need at least 2 processes. Exiting.\n"); + } + goto finish; + } + + /* create the test files & verify that the process + * succeeded. If not, abort the remaining tests as + * they depend on the test files. + */ + + nerrs += generate_test_file( mpi_rank, mpi_size ); + + /* abort tests if there were any errors in test file construction */ + if ( nerrs > 0 ) { + if ( mpi_rank == 0 ) { + HDprintf(" Test file construction failed -- skipping tests.\n"); + } + goto finish; } - MPI_Finalize(); - return 0; -} + /* run the tests */ + nerrs += test_parallel_read(mpi_rank); + +finish: + + /* make sure all processes are finished before final report, cleanup + * and exit. + */ + MPI_Barrier(MPI_COMM_WORLD); + + if ( mpi_rank == 0 ) { /* only process 0 reports */ + const char *header = "Collective file open optimization tests"; + + HDfprintf(stdout, "===================================\n"); + if ( nerrs > 0 ) { + + HDfprintf(stdout, "***%s detected %d failures***\n", header, nerrs); + } + else { + HDfprintf(stdout, "%s finished with no failures\n", header); + } + HDfprintf(stdout, "===================================\n"); + } + + /* close HDF5 library */ + H5close(); + + /* MPI_Finalize must be called AFTER H5close which may use MPI calls */ + MPI_Finalize(); + + /* cannot just return (nerrs) because exit code is limited to 1byte */ + return(nerrs > 0); + +} /* main() */ -- cgit v0.12 From a07d6b52fb0a231c2c6e60b1ae4d7550894c4b58 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 6 Oct 2017 14:36:07 -0500 Subject: HDFFV-10297 - fix repack individual objects includes H5Zfilter_avail() fix --- src/H5Pocpl.c | 440 ++++++++++----------- src/H5Z.c | 15 +- tools/src/h5repack/h5repack.c | 130 +++--- tools/src/h5repack/h5repack.h | 106 ++--- tools/src/h5repack/h5repack_copy.c | 180 ++++----- tools/src/h5repack/h5repack_filters.c | 284 +++++++------ tools/src/h5repack/h5repack_main.c | 10 +- tools/src/h5repack/h5repack_opttable.c | 3 +- tools/src/h5repack/h5repack_parse.c | 13 +- tools/src/h5repack/h5repack_verify.c | 113 ++---- .../h5repack_filters.h5-gzip_verbose_filters.tst | 4 +- 11 files changed, 621 insertions(+), 677 deletions(-) diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index 0393f7f..be41e32 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -13,11 +13,11 @@ /*------------------------------------------------------------------------- * - * Created: H5Pocpl.c - * Nov 28 2006 - * Quincey Koziol + * Created: H5Pocpl.c + * Nov 28 2006 + * Quincey Koziol * - * Purpose: Object creation property list class routines + * Purpose: Object creation property list class routines * *------------------------------------------------------------------------- */ @@ -26,21 +26,21 @@ /* Module Setup */ /****************/ -#define H5O_FRIEND /*suppress error about including H5Opkg */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ #include "H5Pmodule.h" /* This source code file is part of the H5P module */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Opkg.h" /* Object headers */ -#include "H5Ppkg.h" /* Property lists */ -#include "H5PLprivate.h" /* Dynamic plugin */ -#include "H5Zprivate.h" /* Filter pipeline */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Opkg.h" /* Object headers */ +#include "H5Ppkg.h" /* Property lists */ +#include "H5PLprivate.h" /* Dynamic plugin */ +#include "H5Zprivate.h" /* Filter pipeline */ /****************/ @@ -100,7 +100,7 @@ static int H5P__ocrt_pipeline_cmp(const void *value1, const void *value2, size_t static herr_t H5P__ocrt_pipeline_close(const char *name, size_t size, void *value); /* Local routines */ -static herr_t H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, +static herr_t H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]); /*********************/ @@ -109,21 +109,21 @@ static herr_t H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, /* Object creation property list class library initialization object */ const H5P_libclass_t H5P_CLS_OCRT[1] = {{ - "object create", /* Class name for debugging */ - H5P_TYPE_OBJECT_CREATE, /* Class type */ - - &H5P_CLS_ROOT_g, /* Parent class */ - &H5P_CLS_OBJECT_CREATE_g, /* Pointer to class */ - &H5P_CLS_OBJECT_CREATE_ID_g, /* Pointer to class ID */ - NULL, /* Pointer to default property list ID */ - H5P__ocrt_reg_prop, /* Default property registration routine */ - - NULL, /* Class creation callback */ - NULL, /* Class creation callback info */ - NULL, /* Class copy callback */ - NULL, /* Class copy callback info */ - NULL, /* Class close callback */ - NULL /* Class close callback info */ + "object create", /* Class name for debugging */ + H5P_TYPE_OBJECT_CREATE, /* Class type */ + + &H5P_CLS_ROOT_g, /* Parent class */ + &H5P_CLS_OBJECT_CREATE_g, /* Pointer to class */ + &H5P_CLS_OBJECT_CREATE_ID_g, /* Pointer to class ID */ + NULL, /* Pointer to default property list ID */ + H5P__ocrt_reg_prop, /* Default property registration routine */ + + NULL, /* Class creation callback */ + NULL, /* Class creation callback info */ + NULL, /* Class copy callback */ + NULL, /* Class copy callback info */ + NULL, /* Class close callback */ + NULL /* Class close callback info */ }}; @@ -165,25 +165,25 @@ H5P__ocrt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register max. compact attribute storage property */ - if(H5P_register_real(pclass, H5O_CRT_ATTR_MAX_COMPACT_NAME, H5O_CRT_ATTR_MAX_COMPACT_SIZE, &H5O_def_attr_max_compact_g, + if(H5P_register_real(pclass, H5O_CRT_ATTR_MAX_COMPACT_NAME, H5O_CRT_ATTR_MAX_COMPACT_SIZE, &H5O_def_attr_max_compact_g, NULL, NULL, NULL, H5O_CRT_ATTR_MAX_COMPACT_ENC, H5O_CRT_ATTR_MAX_COMPACT_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register min. dense attribute storage property */ - if(H5P_register_real(pclass, H5O_CRT_ATTR_MIN_DENSE_NAME, H5O_CRT_ATTR_MIN_DENSE_SIZE, &H5O_def_attr_min_dense_g, + if(H5P_register_real(pclass, H5O_CRT_ATTR_MIN_DENSE_NAME, H5O_CRT_ATTR_MIN_DENSE_SIZE, &H5O_def_attr_min_dense_g, NULL, NULL, NULL, H5O_CRT_ATTR_MIN_DENSE_ENC, H5O_CRT_ATTR_MIN_DENSE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register object header flags property */ - if(H5P_register_real(pclass, H5O_CRT_OHDR_FLAGS_NAME, H5O_CRT_OHDR_FLAGS_SIZE, &H5O_def_ohdr_flags_g, + if(H5P_register_real(pclass, H5O_CRT_OHDR_FLAGS_NAME, H5O_CRT_OHDR_FLAGS_SIZE, &H5O_def_ohdr_flags_g, NULL, NULL, NULL, H5O_CRT_OHDR_FLAGS_ENC, H5O_CRT_OHDR_FLAGS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the pipeline property */ - if(H5P_register_real(pclass, H5O_CRT_PIPELINE_NAME, H5O_CRT_PIPELINE_SIZE, &H5O_def_pline_g, + if(H5P_register_real(pclass, H5O_CRT_PIPELINE_NAME, H5O_CRT_PIPELINE_SIZE, &H5O_def_pline_g, NULL, H5O_CRT_PIPELINE_SET, H5O_CRT_PIPELINE_GET, H5O_CRT_PIPELINE_ENC, H5O_CRT_PIPELINE_DEC, H5O_CRT_PIPELINE_DEL, H5O_CRT_PIPELINE_COPY, H5O_CRT_PIPELINE_CMP, H5O_CRT_PIPELINE_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -194,9 +194,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_attr_phase_change + * Function: H5Pset_attr_phase_change * - * Purpose: Sets the cutoff values for indexes storing attributes + * Purpose: Sets the cutoff values for indexes storing attributes * in object headers for this file. If more than max_compact * attributes are in an object header, the attributes will be * moved to a heap and indexed with a B-tree. @@ -208,10 +208,10 @@ done: * never be stored in the object header but will be always be * stored in a heap. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, November 28, 2006 + * Programmer: Quincey Koziol + * Tuesday, November 28, 2006 * *------------------------------------------------------------------------- */ @@ -248,14 +248,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_attr_phase_change + * Function: H5Pget_attr_phase_change * - * Purpose: Gets the phase change values for attribute storage + * Purpose: Gets the phase change values for attribute storage * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, November 28, 2006 + * Programmer: Quincey Koziol + * Tuesday, November 28, 2006 * *------------------------------------------------------------------------- */ @@ -486,37 +486,37 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_modify_filter - * - * Purpose: Modifies the specified FILTER in the - * transient or permanent output filter pipeline - * depending on whether PLIST is a dataset creation or dataset - * transfer property list. The FLAGS argument specifies certain - * general properties of the filter and is documented below. - * The CD_VALUES is an array of CD_NELMTS integers which are - * auxiliary data for the filter. The integer vlues will be - * stored in the dataset object header as part of the filter - * information. - * - * The FLAGS argument is a bit vector of the following fields: - * - * H5Z_FLAG_OPTIONAL(0x0001) - * If this bit is set then the filter is optional. If the - * filter fails during an H5Dwrite() operation then the filter - * is just excluded from the pipeline for the chunk for which it - * failed; the filter will not participate in the pipeline - * during an H5Dread() of the chunk. If this bit is clear and - * the filter fails then the entire I/O operation fails. + * Function: H5P_modify_filter + * + * Purpose: Modifies the specified FILTER in the + * transient or permanent output filter pipeline + * depending on whether PLIST is a dataset creation or dataset + * transfer property list. The FLAGS argument specifies certain + * general properties of the filter and is documented below. + * The CD_VALUES is an array of CD_NELMTS integers which are + * auxiliary data for the filter. The integer vlues will be + * stored in the dataset object header as part of the filter + * information. + * + * The FLAGS argument is a bit vector of the following fields: + * + * H5Z_FLAG_OPTIONAL(0x0001) + * If this bit is set then the filter is optional. If the + * filter fails during an H5Dwrite() operation then the filter + * is just excluded from the pipeline for the chunk for which it + * failed; the filter will not participate in the pipeline + * during an H5Dread() of the chunk. If this bit is clear and + * the filter fails then the entire I/O operation fails. * If this bit is set but encoding is disabled for a filter, * attempting to write will generate an error. * - * Note: This function currently supports only the permanent filter - * pipeline. That is, PLIST_ID must be a dataset creation - * property list. + * Note: This function currently supports only the permanent filter + * pipeline. That is, PLIST_ID must be a dataset creation + * property list. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, October 17, 2007 * *------------------------------------------------------------------------- @@ -623,33 +623,33 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_filter - * - * Purpose: Adds the specified FILTER and corresponding properties to the - * end of the data or link output filter pipeline - * depending on whether PLIST is a dataset creation or group - * creation property list. The FLAGS argument specifies certain - * general properties of the filter and is documented below. - * The CD_VALUES is an array of CD_NELMTS integers which are - * auxiliary data for the filter. The integer vlues will be - * stored in the dataset object header as part of the filter - * information. - * - * The FLAGS argument is a bit vector of the following fields: - * - * H5Z_FLAG_OPTIONAL(0x0001) - * If this bit is set then the filter is optional. If the - * filter fails during an H5Dwrite() operation then the filter - * is just excluded from the pipeline for the chunk for which it - * failed; the filter will not participate in the pipeline - * during an H5Dread() of the chunk. If this bit is clear and - * the filter fails then the entire I/O operation fails. + * Function: H5Pset_filter + * + * Purpose: Adds the specified FILTER and corresponding properties to the + * end of the data or link output filter pipeline + * depending on whether PLIST is a dataset creation or group + * creation property list. The FLAGS argument specifies certain + * general properties of the filter and is documented below. + * The CD_VALUES is an array of CD_NELMTS integers which are + * auxiliary data for the filter. The integer vlues will be + * stored in the dataset object header as part of the filter + * information. + * + * The FLAGS argument is a bit vector of the following fields: + * + * H5Z_FLAG_OPTIONAL(0x0001) + * If this bit is set then the filter is optional. If the + * filter fails during an H5Dwrite() operation then the filter + * is just excluded from the pipeline for the chunk for which it + * failed; the filter will not participate in the pipeline + * during an H5Dread() of the chunk. If this bit is clear and + * the filter fails then the entire I/O operation fails. * If this bit is set but encoding is disabled for a filter, * attempting to write will generate an error. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 15, 1998 * * Modifications: @@ -668,7 +668,7 @@ done: */ herr_t H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, - size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) + size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) { H5P_genplist_t *plist; /* Property list */ herr_t ret_value=SUCCEED; /* return value */ @@ -698,43 +698,43 @@ done: /*------------------------------------------------------------------------- - * Function: H5P__set_filter - * - * Purpose: Adds the specified FILTER and corresponding properties to the - * end of the data or link output filter pipeline - * depending on whether PLIST is a dataset creation or group - * creation property list. The FLAGS argument specifies certain - * general properties of the filter and is documented below. - * The CD_VALUES is an array of CD_NELMTS integers which are - * auxiliary data for the filter. The integer vlues will be - * stored in the dataset object header as part of the filter - * information. - * - * The FLAGS argument is a bit vector of the following fields: - * - * H5Z_FLAG_OPTIONAL(0x0001) - * If this bit is set then the filter is optional. If the - * filter fails during an H5Dwrite() operation then the filter - * is just excluded from the pipeline for the chunk for which it - * failed; the filter will not participate in the pipeline - * during an H5Dread() of the chunk. If this bit is clear and - * the filter fails then the entire I/O operation fails. - * If this bit is set but encoding is disabled for a filter, - * attempting to write will generate an error. - * - * If the filter is not registered, this function tries to load + * Function: H5P__set_filter + * + * Purpose: Adds the specified FILTER and corresponding properties to the + * end of the data or link output filter pipeline + * depending on whether PLIST is a dataset creation or group + * creation property list. The FLAGS argument specifies certain + * general properties of the filter and is documented below. + * The CD_VALUES is an array of CD_NELMTS integers which are + * auxiliary data for the filter. The integer vlues will be + * stored in the dataset object header as part of the filter + * information. + * + * The FLAGS argument is a bit vector of the following fields: + * + * H5Z_FLAG_OPTIONAL(0x0001) + * If this bit is set then the filter is optional. If the + * filter fails during an H5Dwrite() operation then the filter + * is just excluded from the pipeline for the chunk for which it + * failed; the filter will not participate in the pipeline + * during an H5Dread() of the chunk. If this bit is clear and + * the filter fails then the entire I/O operation fails. + * If this bit is set but encoding is disabled for a filter, + * attempting to write will generate an error. + * + * If the filter is not registered, this function tries to load * it dynamically during run time. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 15, 1998 * *------------------------------------------------------------------------- */ static herr_t H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, unsigned int flags, - size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) + size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) { H5O_pline_t pline; /* Filter pipeline */ htri_t filter_avail; /* Filter availability */ @@ -746,16 +746,6 @@ H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, unsigned int flags, if((filter_avail = H5Z_filter_avail(filter)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't check filter availability") - /* If filter is not available, try to dynamically load it */ - if(!filter_avail) { - const H5Z_class2_t *filter_info; - - if(NULL == (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)filter))) - HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, FAIL, "failed to load dynamically loaded plugin") - if(H5Z_register(filter_info) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") - } /* end if */ - /* Get the pipeline property to append to */ if(H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline") @@ -774,21 +764,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_nfilters + * Function: H5Pget_nfilters * - * Purpose: Returns the number of filters in the data or link - * pipeline depending on whether PLIST_ID is a dataset creation - * or group creation property list. In each pipeline the - * filters are numbered from zero through N-1 where N is the - * value returned by this function. During output to the file - * the filters of a pipeline are applied in increasing order - * (the inverse is true for input). + * Purpose: Returns the number of filters in the data or link + * pipeline depending on whether PLIST_ID is a dataset creation + * or group creation property list. In each pipeline the + * filters are numbered from zero through N-1 where N is the + * value returned by this function. During output to the file + * the filters of a pipeline are applied in increasing order + * (the inverse is true for input). * - * Return: Success: Number of filters or zero if there are none. + * Return: Success: Number of filters or zero if there are none. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 4, 1998 * * Modifications: @@ -827,25 +817,25 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_filter2 - * - * Purpose: This is the query counterpart of H5Pset_filter() and returns - * information about a particular filter number in a permanent - * or transient pipeline depending on whether PLIST_ID is a - * dataset creation or transfer property list. On input, - * CD_NELMTS indicates the number of entries in the CD_VALUES - * array allocated by the caller while on exit it contains the - * number of values defined by the filter. FILTER_CONFIG is a bit + * Function: H5Pget_filter2 + * + * Purpose: This is the query counterpart of H5Pset_filter() and returns + * information about a particular filter number in a permanent + * or transient pipeline depending on whether PLIST_ID is a + * dataset creation or transfer property list. On input, + * CD_NELMTS indicates the number of entries in the CD_VALUES + * array allocated by the caller while on exit it contains the + * number of values defined by the filter. FILTER_CONFIG is a bit * field contaning encode/decode flags from H5Zpublic.h. The IDX * should be a value between zero and N-1 as described for * H5Pget_nfilters() and the function will return failure if the * filter number is out of range. * - * Return: Success: Filter identification number. + * Return: Success: Filter identification number. * - * Failure: H5Z_FILTER_ERROR (Negative) + * Failure: H5Z_FILTER_ERROR (Negative) * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 15, 1998 * * Modifications: @@ -859,8 +849,8 @@ done: */ H5Z_filter_t H5Pget_filter2(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/, - size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/, - size_t namelen, char name[]/*out*/, + size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/, + size_t namelen, char name[]/*out*/, unsigned *filter_config /*out*/) { H5P_genplist_t *plist; /* Property list */ @@ -921,23 +911,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_get_filter_by_id + * Function: H5P_get_filter_by_id * - * Purpose: This is an additional query counterpart of H5Pset_filter() and + * Purpose: This is an additional query counterpart of H5Pset_filter() and * returns information about a particular filter in a permanent - * or transient pipeline depending on whether PLIST_ID is a - * dataset creation or transfer property list. On input, - * CD_NELMTS indicates the number of entries in the CD_VALUES - * array allocated by the caller while on exit it contains the - * number of values defined by the filter. FILTER_CONFIG is a bit + * or transient pipeline depending on whether PLIST_ID is a + * dataset creation or transfer property list. On input, + * CD_NELMTS indicates the number of entries in the CD_VALUES + * array allocated by the caller while on exit it contains the + * number of values defined by the filter. FILTER_CONFIG is a bit * field contaning encode/decode flags from H5Zpublic.h. The ID * should be the filter ID to retrieve the parameters for. If the * filter is not set for the property list, an error will be returned. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, October 17, 2007 * *------------------------------------------------------------------------- @@ -971,23 +961,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_filter_by_id2 + * Function: H5Pget_filter_by_id2 * - * Purpose: This is an additional query counterpart of H5Pset_filter() and + * Purpose: This is an additional query counterpart of H5Pset_filter() and * returns information about a particular filter in a permanent - * or transient pipeline depending on whether PLIST_ID is a - * dataset creation or transfer property list. On input, - * CD_NELMTS indicates the number of entries in the CD_VALUES - * array allocated by the caller while on exit it contains the - * number of values defined by the filter. FILTER_CONFIG is a bit + * or transient pipeline depending on whether PLIST_ID is a + * dataset creation or transfer property list. On input, + * CD_NELMTS indicates the number of entries in the CD_VALUES + * array allocated by the caller while on exit it contains the + * number of values defined by the filter. FILTER_CONFIG is a bit * field contaning encode/decode flags from H5Zpublic.h. The ID * should be the filter ID to retrieve the parameters for. If the * filter is not set for the property list, an error will be returned. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, April 5, 2003 * * Modifications: @@ -1047,16 +1037,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pall_filters_avail + * Function: H5Pall_filters_avail * - * Purpose: This is a query routine to verify that all the filters set + * Purpose: This is a query routine to verify that all the filters set * in the dataset creation property list are available currently. * - * Return: Success: TRUE if all filters available, FALSE if one or + * Return: Success: TRUE if all filters available, FALSE if one or * more filters not currently available. - * Failure: FAIL on error + * Failure: FAIL on error * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 8, 2003 * * Modifications: @@ -1096,16 +1086,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_filter_in_pline + * Function: H5P_filter_in_pline * - * Purpose: Check whether the filter is in the pipeline of the object - * creation property list. + * Purpose: Check whether the filter is in the pipeline of the object + * creation property list. * - * Return: TRUE: found - * FALSE: not found - * FAIL: error + * Return: TRUE: found + * FALSE: not found + * FAIL: error * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 26 April 2013 * *------------------------------------------------------------------------- @@ -1198,7 +1188,7 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 15, 1998 * * Modifications: @@ -1258,7 +1248,7 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Dec 19, 2002 * * Modifications: @@ -1302,13 +1292,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_get_filter + * Function: H5P_get_filter * - * Purpose: Internal component of H5Pget_filter & H5Pget_filter_id + * Purpose: Internal component of H5Pget_filter & H5Pget_filter_id * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, October 23, 2006 * *------------------------------------------------------------------------- @@ -1330,7 +1320,7 @@ H5P_get_filter(const H5Z_filter_info_t *filter, unsigned int *flags/*out*/, /* Filter parameters */ if(cd_values) { - size_t i; /* Local index variable */ + size_t i; /* Local index variable */ for(i = 0; i < filter->cd_nelmts && i < *cd_nelmts; i++) cd_values[i] = filter->cd_values[i]; @@ -1460,8 +1450,8 @@ done: * property in the dataset access property list is * decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Monday, October 10, 2011 @@ -1553,15 +1543,15 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) * property in the dataset access property list is * decoded. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Mohamad Chaarawi * Monday, October 10, 2011 * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5P__ocrt_pipeline_dec(const void **_pp, void *_value) { H5O_pline_t *pline = (H5O_pline_t *)_value; /* Property to set */ @@ -1637,7 +1627,7 @@ H5P__ocrt_pipeline_dec(const void **_pp, void *_value) filter.cd_values = (unsigned *)H5MM_xfree(filter.cd_values); } /* end for */ -done: +done: FUNC_LEAVE_NOAPI(ret_value) } /* H5P__ocrt_pipeline_dec() */ @@ -1830,32 +1820,32 @@ done: #ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- - * Function: H5Pget_filter1 - * - * Purpose: This is the query counterpart of H5Pset_filter() and returns - * information about a particular filter number in a permanent - * or transient pipeline depending on whether PLIST_ID is a - * dataset creation or transfer property list. On input, - * CD_NELMTS indicates the number of entries in the CD_VALUES - * array allocated by the caller while on exit it contains the - * number of values defined by the filter. The IDX + * Function: H5Pget_filter1 + * + * Purpose: This is the query counterpart of H5Pset_filter() and returns + * information about a particular filter number in a permanent + * or transient pipeline depending on whether PLIST_ID is a + * dataset creation or transfer property list. On input, + * CD_NELMTS indicates the number of entries in the CD_VALUES + * array allocated by the caller while on exit it contains the + * number of values defined by the filter. The IDX * should be a value between zero and N-1 as described for * H5Pget_nfilters() and the function will return failure if the * filter number is out of range. * - * Return: Success: Filter identification number. + * Return: Success: Filter identification number. * - * Failure: H5Z_FILTER_ERROR (Negative) + * Failure: H5Z_FILTER_ERROR (Negative) * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 15, 1998 * *------------------------------------------------------------------------- */ H5Z_filter_t H5Pget_filter1(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/, - size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/, - size_t namelen, char name[]/*out*/) + size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/, + size_t namelen, char name[]/*out*/) { H5O_pline_t pline; /* Filter pipeline */ const H5Z_filter_info_t *filter; /* Pointer to filter information */ @@ -1915,22 +1905,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_filter_by_id1 + * Function: H5Pget_filter_by_id1 * - * Purpose: This is an additional query counterpart of H5Pset_filter() and + * Purpose: This is an additional query counterpart of H5Pset_filter() and * returns information about a particular filter in a permanent - * or transient pipeline depending on whether PLIST_ID is a - * dataset creation or transfer property list. On input, - * CD_NELMTS indicates the number of entries in the CD_VALUES - * array allocated by the caller while on exit it contains the - * number of values defined by the filter. The ID + * or transient pipeline depending on whether PLIST_ID is a + * dataset creation or transfer property list. On input, + * CD_NELMTS indicates the number of entries in the CD_VALUES + * array allocated by the caller while on exit it contains the + * number of values defined by the filter. The ID * should be the filter ID to retrieve the parameters for. If the * filter is not set for the property list, an error will be returned. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, April 5, 2003 * *------------------------------------------------------------------------- diff --git a/src/H5Z.c b/src/H5Z.c index 1dc93d8..8dbbdb0 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -609,12 +609,6 @@ H5Zfilter_avail(H5Z_filter_t id) if((ret_value = H5Z_filter_avail(id)) < 0) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") - else if(ret_value == FALSE) { - const H5Z_class2_t *filter_info; - - if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) - ret_value = TRUE; - } /* end if */ done: FUNC_LEAVE_API(ret_value) @@ -633,6 +627,7 @@ htri_t H5Z_filter_avail(H5Z_filter_t id) { size_t i; /* Local index variable */ + const H5Z_class2_t *filter_info; htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -640,8 +635,12 @@ H5Z_filter_avail(H5Z_filter_t id) /* Is the filter already registered? */ for(i = 0; i < H5Z_table_used_g; i++) if(H5Z_table_g[i].id == id) - HGOTO_DONE(TRUE) + HGOTO_DONE(TRUE) + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) + if(H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") + HGOTO_DONE(TRUE) done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_filter_avail() */ @@ -1136,7 +1135,7 @@ H5Z_find(H5Z_filter_t id) /* Get the index in the global table */ if((idx=H5Z_find_idx(id))<0) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "required filter is not registered") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "required filter %d is not registered", id) /* Set return value */ ret_value=H5Z_table_g+idx; diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 7ed9a90..f34d466 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -284,8 +284,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, /* Set return value */ ret_value = dt_ret->id_out; - /* Increment the ref count on id_out, because the calling function will try - * to close it */ + /* Increment the ref count on id_out, because the calling function will try to close it */ if(H5Iinc_ref(ret_value) < 0) ret_value = -1; @@ -482,24 +481,8 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, if (options->verbose) printf(FORMAT_OBJ_ATTR, "attr", name); - - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - - if (H5Tclose(ftype_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); - if (H5Tclose(wtype_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); - if (H5Sclose(space_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); - if (H5Aclose(attr_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); } /* u */ - return 0; - done: H5E_BEGIN_TRY { if (buf) { @@ -541,8 +524,8 @@ static int check_options(pack_opt_t *options) { *------------------------------------------------------------------------- */ if (options->verbose && have_request(options) /* only print if requested */) { - printf("Objects to modify layout are...\n"); if (options->all_layout == 1) { + printf("All objects to modify layout are...\n"); switch (options->layout_g) { case H5D_COMPACT: strcpy(slayout, "compact"); @@ -563,14 +546,17 @@ static int check_options(pack_opt_t *options) { strcpy(slayout, "invalid layout\n"); HGOTO_DONE(FAIL); } - printf(" Apply %s layout to all\n", slayout); + printf(" Apply %s layout to all", slayout); if (H5D_CHUNKED == options->layout_g) { - printf("with dimension ["); + printf("with dimension [ "); for (j = 0; j < options->chunk_g.rank; j++) printf("%d ", (int) options->chunk_g.chunk_lengths[j]); - printf("]\n"); + printf("]"); } + printf("\n"); } + else + printf("No all objects to modify layout\n"); }/* verbose */ for (i = 0; i < options->op_tbl->nelems; i++) { @@ -601,10 +587,14 @@ static int check_options(pack_opt_t *options) { */ if (options->verbose && have_request(options) /* only print if requested */) { - printf("Objects to apply filter are...\n"); if (options->all_filter == 1) { + printf("All objects to apply filter are...\n"); for (k = 0; k < options->n_filter_g; k++) { H5Z_filter_t filtn = options->filter_g[k].filtn; + if (filtn < 0) { + printf(" Unknown\n"); + continue; + } switch (filtn) { case H5Z_FILTER_NONE: printf(" Uncompress all\n"); @@ -623,6 +613,8 @@ static int check_options(pack_opt_t *options) { } /* k */ }; } + else + printf("No all objects to apply filter\n"); } /* verbose */ for (i = 0; i < options->op_tbl->nelems; i++) { @@ -631,7 +623,12 @@ static int check_options(pack_opt_t *options) { for (j = 0; j < pack.nfilters; j++) { if (options->verbose) { - printf(" <%s> with %s filter\n", name, get_sfilter(pack.filter[j].filtn)); + if(pack.filter[j].filtn >= 0) { + if(pack.filter[j].filtn > H5Z_FILTER_SCALEOFFSET) + printf(" <%s> with %s filter %d\n", name, get_sfilter(pack.filter[j].filtn), pack.filter[j].filtn); + else + printf(" <%s> with %s filter\n", name, get_sfilter(pack.filter[j].filtn)); + } } has_cp = 1; } /* j */ @@ -661,8 +658,7 @@ static int check_options(pack_opt_t *options) { */ if (options->ublock_filename != NULL && options->ublock_size == 0) { if (options->verbose) { - printf("Warning: user block size missing for file %s. Assigning a default size of 1024...\n", - options->ublock_filename); + printf("Warning: user block size missing for file %s. Assigning a default size of 1024...\n", options->ublock_filename); options->ublock_size = 1024; } } @@ -692,27 +688,28 @@ done: *------------------------------------------------------------------------- */ static int check_objects(const char* fname, pack_opt_t *options) { + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hid_t fid; + hid_t did; + hid_t sid; unsigned int i; trav_table_t *travt = NULL; /* nothing to do */ if (options->op_tbl->nelems == 0) - return 0; + HGOTO_DONE(0); /*------------------------------------------------------------------------- - * open the file - *------------------------------------------------------------------------- - */ - if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) < 0) { - printf("<%s>: %s\n", fname, H5FOPENERROR); - return -1; - } + * open the file + *------------------------------------------------------------------------- + */ + if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname, H5FOPENERROR); /*------------------------------------------------------------------------- - * get the list of objects in the file - *------------------------------------------------------------------------- - */ + * get the list of objects in the file + *------------------------------------------------------------------------- + */ /* Initialize indexing options */ h5trav_set_index(sort_by, sort_order); @@ -721,15 +718,15 @@ static int check_objects(const char* fname, pack_opt_t *options) { /* get the list of objects in the file */ if (h5trav_gettable(fid, travt) < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed"); /*------------------------------------------------------------------------- - * compare with user supplied list - *------------------------------------------------------------------------- - */ + * compare with user supplied list + *------------------------------------------------------------------------- + */ if (options->verbose) - printf("Opening file <%s>. Searching for objects to modify...\n", fname); + printf("Opening file. Searching %d objects to modify ...\n", travt->nobjs); for (i = 0; i < options->op_tbl->nelems; i++) { char* name = options->op_tbl->objs[i].path; @@ -737,14 +734,14 @@ static int check_objects(const char* fname, pack_opt_t *options) { printf(" <%s>", name); /* the input object names are present in the file and are valid */ - if (h5trav_getindext(name, travt) < 0) { - error_msg("%s Could not find <%s> in file <%s>. Exiting...\n", + if (h5trav_getindext(name, travt) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "%s Could not find <%s> in file <%s>. Exiting...\n", (options->verbose ? "\n" : ""), name, fname); - goto done; - } if (options->verbose) printf("...Found\n"); + if (options->op_tbl->objs[i].filter->filtn < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter"); /* check for extra filter conditions */ switch (options->op_tbl->objs[i].filter->filtn) { /* chunk size must be smaller than pixels per block */ @@ -755,8 +752,6 @@ static int check_objects(const char* fname, pack_opt_t *options) { unsigned ppb = options->op_tbl->objs[i].filter->cd_values[0]; hsize_t dims[H5S_MAX_RANK]; int rank; - hid_t did; - hid_t sid; if (options->op_tbl->objs[i].chunk.rank > 0) { rank = options->op_tbl->objs[i].chunk.rank; @@ -765,25 +760,25 @@ static int check_objects(const char* fname, pack_opt_t *options) { } else { if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); if ((sid = H5Dget_space(did)) < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); HDmemset(dims, 0, sizeof dims); if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); for (j = 0; j < rank; j++) csize *= dims[j]; if (H5Sclose(sid) < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); if (H5Dclose(did) < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); } if (csize < ppb) { - printf(" \n"); - goto done; + printf(" \n"); + HGOTO_DONE(0); } } break; @@ -792,18 +787,15 @@ static int check_objects(const char* fname, pack_opt_t *options) { } } /* i */ - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - H5Fclose(fid); - trav_table_free(travt); - return 0; - done: - H5Fclose(fid); - trav_table_free(travt); - return -1; + H5E_BEGIN_TRY { + H5Fclose(fid); + H5Sclose(sid); + H5Dclose(did); + } H5E_END_TRY; + if (travt) + trav_table_free(travt); + return ret_value; } /*------------------------------------------------------------------------- @@ -833,7 +825,9 @@ static int have_request(pack_opt_t *options) { */ static const char* get_sfilter(H5Z_filter_t filtn) { - if (filtn == H5Z_FILTER_NONE) + if (filtn < 0) + return NULL; + else if (filtn == H5Z_FILTER_NONE) return "NONE"; else if (filtn == H5Z_FILTER_DEFLATE) return "GZIP"; diff --git a/tools/src/h5repack/h5repack.h b/tools/src/h5repack/h5repack.h index c8c6a0e..0252768 100644 --- a/tools/src/h5repack/h5repack.h +++ b/tools/src/h5repack/h5repack.h @@ -29,7 +29,7 @@ #define MAX_COMPACT_DSIZE 64512 /* max data size for compact layout. -1k for header size */ /* File space default information */ -#define FS_PAGESIZE_DEF 4096 +#define FS_PAGESIZE_DEF 4096 #define FS_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR #define FS_PERSIST_DEF FALSE #define FS_THRESHOLD_DEF 1 @@ -42,7 +42,7 @@ /* a list of names */ typedef struct { - char obj[MAX_NC_NAME]; + char obj[MAX_NC_NAME]; } obj_list_t; /* @@ -60,16 +60,16 @@ typedef struct { #define CD_VALUES 20 typedef struct { - H5Z_filter_t filtn; /* filter identification number */ - unsigned filt_flag; /* filter definition flag */ - unsigned cd_values[CD_VALUES]; /* filter client data values */ - size_t cd_nelmts; /* filter client number of values */ + H5Z_filter_t filtn; /* filter identification number */ + unsigned filt_flag; /* filter definition flag */ + unsigned cd_values[CD_VALUES]; /* filter client data values */ + size_t cd_nelmts; /* filter client number of values */ } filter_info_t; /* chunk lengths along each dimension and rank */ typedef struct { - hsize_t chunk_lengths[MAX_VAR_DIMS]; - int rank; + hsize_t chunk_lengths[MAX_VAR_DIMS]; + int rank; } chunk_info_t; /* we currently define a maximum value for the filters array, @@ -78,19 +78,19 @@ typedef struct { /* information for one object, contains PATH, CHUNK info and FILTER info */ typedef struct { - char path[MAX_NC_NAME]; /* name of object */ - filter_info_t filter[H5_REPACK_MAX_NFILTERS]; /* filter array */ - int nfilters; /* current number of filters */ - H5D_layout_t layout; /* layout information */ - chunk_info_t chunk; /* chunk information */ - hid_t refobj_id; /* object ID, references */ + char path[MAX_NC_NAME]; /* name of object */ + filter_info_t filter[H5_REPACK_MAX_NFILTERS]; /* filter array */ + int nfilters; /* current number of filters */ + H5D_layout_t layout; /* layout information */ + chunk_info_t chunk; /* chunk information */ + hid_t refobj_id; /* object ID, references */ } pack_info_t; /* store a table of all objects */ typedef struct { - unsigned int size; - unsigned int nelems; - pack_info_t *objs; + unsigned int size; + unsigned int nelems; + pack_info_t *objs; } pack_opttbl_t; @@ -101,30 +101,30 @@ typedef struct { /* all the above, ready to go to the hrepack call */ typedef struct { - pack_opttbl_t *op_tbl; /*table with all -c and -f options */ - int all_layout; /*apply the layout to all objects */ - int all_filter; /*apply the filter to all objects */ - filter_info_t filter_g[H5_REPACK_MAX_NFILTERS]; /*global filter array for the ALL case */ - int n_filter_g; /*number of global filters */ - chunk_info_t chunk_g; /*global chunk INFO for the ALL case */ - H5D_layout_t layout_g; /*global layout information for the ALL case */ - int verbose; /*verbose mode */ - hsize_t min_comp; /*minimum size to compress, in bytes */ - int use_native; /*use a native type in write */ - hbool_t latest; /*pack file with the latest file format */ - int grp_compact; /* Set the maximum number of links to store as header messages in the group */ - int grp_indexed; /* Set the minimum number of links to store in the indexed format */ - int msg_size[8]; /* Minimum size of shared messages: dataspace, - datatype, fill value, filter pipleline, attribute */ - const char *ublock_filename; /* user block file name */ - hsize_t ublock_size; /* user block size */ - hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */ - hsize_t threshold; /* alignment threshold for H5Pset_alignment */ - hsize_t alignment; /* alignment for H5Pset_alignment */ - H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */ - int fs_persist; /* Free space section threshold */ - long fs_threshold; /* Free space section threshold */ - long long fs_pagesize; /* File space page size */ + pack_opttbl_t *op_tbl; /*table with all -c and -f options */ + int all_layout; /*apply the layout to all objects */ + int all_filter; /*apply the filter to all objects */ + filter_info_t filter_g[H5_REPACK_MAX_NFILTERS]; /*global filter array for the ALL case */ + int n_filter_g; /*number of global filters */ + chunk_info_t chunk_g; /*global chunk INFO for the ALL case */ + H5D_layout_t layout_g; /*global layout information for the ALL case */ + int verbose; /*verbose mode */ + hsize_t min_comp; /*minimum size to compress, in bytes */ + int use_native; /*use a native type in write */ + hbool_t latest; /*pack file with the latest file format */ + int grp_compact; /* Set the maximum number of links to store as header messages in the group */ + int grp_indexed; /* Set the minimum number of links to store in the indexed format */ + int msg_size[8]; /* Minimum size of shared messages: dataspace, + datatype, fill value, filter pipleline, attribute */ + const char *ublock_filename; /* user block file name */ + hsize_t ublock_size; /* user block size */ + hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */ + hsize_t threshold; /* alignment threshold for H5Pset_alignment */ + hsize_t alignment; /* alignment for H5Pset_alignment */ + H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */ + int fs_persist; /* Free space section threshold */ + long fs_threshold; /* Free space section threshold */ + long long fs_pagesize; /* File space page size */ } pack_opt_t; @@ -214,18 +214,18 @@ int apply_filters(const char* name, /* object name from traverse list */ * options table *------------------------------------------------------------------------- */ -int options_table_init( pack_opttbl_t **tbl ); -int options_table_free( pack_opttbl_t *table ); -int options_add_layout( obj_list_t *obj_list, - unsigned n_objs, - pack_info_t *pack, - pack_opttbl_t *table ); -int options_add_filter ( obj_list_t *obj_list, - unsigned n_objs, - filter_info_t filt, - pack_opttbl_t *table ); -pack_info_t* options_get_object( const char *path, - pack_opttbl_t *table); +int options_table_init(pack_opttbl_t **tbl); +int options_table_free(pack_opttbl_t *table); +int options_add_layout(obj_list_t *obj_list, + unsigned n_objs, + pack_info_t *pack, + pack_opttbl_t *table); +int options_add_filter(obj_list_t *obj_list, + unsigned n_objs, + filter_info_t filt, + pack_opttbl_t *table); +pack_info_t* options_get_object(const char *path, + pack_opttbl_t *table); /*------------------------------------------------------------------------- * parse functions diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 47cad13..08bce60 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -109,9 +109,8 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) * open input file *------------------------------------------------------------------------- */ - if ((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t) 0)) < 0) { + if ((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t) 0)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fnamein, H5FOPENERROR); - } /* get user block size and file space strategy/persist/threshold */ { @@ -119,23 +118,20 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) hid_t grp_in = -1; /* group ID */ hid_t gcpl_in = -1; /* group creation property list */ - if ((fcpl_in = H5Fget_create_plist(fidin)) < 0) { + if ((fcpl_in = H5Fget_create_plist(fidin)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list"); - } - if (H5Pget_userblock(fcpl_in, &ub_size) < 0) { + if (H5Pget_userblock(fcpl_in, &ub_size) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_userblock failed to retrieve userblock size"); - } /* If the -S option is not set, get "strategy" from the input file */ - if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) { + if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_strategy failed to retrieve file space strategy"); - } /* If the -G option is not set, get "pagesize" from the input file */ - if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) { + if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_page_size failed to retrieve file space threshold"); - } + /* open root group */ if ((grp_in = H5Gopen2(fidin, "/", H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); @@ -148,23 +144,19 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) if (H5Pget_link_creation_order(gcpl_in, &crt_order_flags) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_link_creation_order failed"); - if (H5Pclose(fcpl_in) < 0) { + if (H5Pclose(fcpl_in) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed to close property list"); - } } /* Check if we need to create a non-default file creation property list */ if (options->latest || ub_size > 0) { /* Create file creation property list */ - if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { + if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list"); - } - if (ub_size > 0) { - if (H5Pset_userblock(fcpl, ub_size) < 0) { + if (ub_size > 0) + if (H5Pset_userblock(fcpl, ub_size) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_userblock failed to set non-default userblock size"); - } - } if (options->latest) { unsigned i = 0, nindex = 0, mesg_type_flags[5], min_mesg_sizes[5]; @@ -172,9 +164,8 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) /* Adjust group creation parameters for root group */ /* (So that it is created in "dense storage" form) */ if (H5Pset_link_phase_change(fcpl, (unsigned) options->grp_compact, - (unsigned) options->grp_indexed) < 0) { + (unsigned) options->grp_indexed) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_link_phase_change failed to adjust group creation parameters for root group"); - } for (i = 0; i < 5; i++) { if (options->msg_size[i] > 0) { @@ -209,26 +200,21 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) } /* end for */ if (nindex > 0) { - if (H5Pset_shared_mesg_nindexes(fcpl, nindex) < 0) { + if (H5Pset_shared_mesg_nindexes(fcpl, nindex) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shared_mesg_nindexes failed to set the number of shared object header message indexes"); - } /* msg_size[0]=dataspace, 1=datatype, 2=file value, 3=filter pipleline, 4=attribute */ - for (i = 0; i < (nindex - 1); i++) { - if (H5Pset_shared_mesg_index(fcpl, i, mesg_type_flags[i], min_mesg_sizes[i]) < 0) { + for (i = 0; i < (nindex - 1); i++) + if (H5Pset_shared_mesg_index(fcpl, i, mesg_type_flags[i], min_mesg_sizes[i]) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shared_mesg_index failed to configure the specified shared object header message index"); - } /* end if */ - } /* end for */ } /* if (nindex>0) */ /* Create file access property list */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list"); - } /* end if */ - if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { + if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_libver_bounds failed to set property for using latest version of the format"); - } /* end if */ } /* end if */ } /* end if */ #if defined (H5REPACK_DEBUG_USER_BLOCK) @@ -241,17 +227,14 @@ print_user_block(fnamein, fidin); */ if (options->ublock_size > 0) { /* either use the FCPL already created or create a new one */ - if (fcpl == H5P_DEFAULT) { + if (fcpl == H5P_DEFAULT) /* create a file creation property list */ - if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { + if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list"); - } - } /* set user block size */ - if (H5Pset_userblock(fcpl, options->ublock_size) < 0) { + if (H5Pset_userblock(fcpl, options->ublock_size) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_userblock failed to set userblock size"); - } } /*------------------------------------------------------------------------- @@ -260,16 +243,13 @@ print_user_block(fnamein, fidin); */ if (options->alignment > 0) { /* either use the FAPL already created or create a new one */ - if (fapl == H5P_DEFAULT) { + if (fapl == H5P_DEFAULT) /* create a file access property list */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list"); - } - } - if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) { + if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_alignment failed to set alignment"); - } } /*------------------------------------------------------------------------- @@ -278,16 +258,13 @@ print_user_block(fnamein, fidin); */ if (options->meta_block_size > 0) { /* either use the FAPL already created or create a new one */ - if (fapl == H5P_DEFAULT) { + if (fapl == H5P_DEFAULT) /* create a file access property list */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list"); - } - } - if (H5Pset_meta_block_size(fapl, options->meta_block_size) < 0) { + if (H5Pset_meta_block_size(fapl, options->meta_block_size) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_meta_block_size failed to set metadata block size"); - } } /*------------------------------------------------------------------------- @@ -296,12 +273,10 @@ print_user_block(fnamein, fidin); */ /* either use the FCPL already created or create a new one */ - if (fcpl == H5P_DEFAULT) { + if (fcpl == H5P_DEFAULT) /* create a file creation property list */ - if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { + if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list"); - } - } if(H5Pset_link_creation_order(fcpl, crt_order_flags ) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_link_creation_order failed"); @@ -328,9 +303,8 @@ print_user_block(fnamein, fidin); set_threshold = (hsize_t)options->fs_threshold; /* Set file space information as specified */ - if(H5Pset_file_space_strategy(fcpl, set_strategy, set_persist, set_threshold) < 0) { + if(H5Pset_file_space_strategy(fcpl, set_strategy, set_persist, set_threshold) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_file_space_strategy failed to set file space strategy"); - } if(options->fs_pagesize == -1) /* A "0" file space page size is specified by user */ set_pagesize = (hsize_t)0; @@ -338,30 +312,26 @@ print_user_block(fnamein, fidin); set_pagesize = (hsize_t)options->fs_pagesize; if(set_pagesize != FS_PAGESIZE_DEF) /* Set non-default file space page size as specified */ - if(H5Pset_file_space_page_size(fcpl, set_pagesize) < 0) { + if(H5Pset_file_space_page_size(fcpl, set_pagesize) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_file_space_page_size failed to set file space page size"); - } /*------------------------------------------------------------------------- * create the output file *------------------------------------------------------------------------- */ if (options->verbose) - printf("Making file <%s>...\n", fnameout); + printf("Making new file ...\n"); - if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, fapl)) < 0) { + if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, fapl)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fcreate could not create file <%s>:", fnameout); - } /*------------------------------------------------------------------------- * write a new user block if requested *------------------------------------------------------------------------- */ - if (options->ublock_size > 0) { - if (copy_user_block(options->ublock_filename, fnameout, options->ublock_size) < 0) { + if (options->ublock_size > 0) + if (copy_user_block(options->ublock_filename, fnameout, options->ublock_size) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not copy user block. Exiting..."); - } - } /*------------------------------------------------------------------------- * get list of objects @@ -381,18 +351,16 @@ print_user_block(fnamein, fidin); * do the copy *------------------------------------------------------------------------- */ - if (do_copy_objects(fidin, fidout, travt, options) < 0) { + if (do_copy_objects(fidin, fidout, travt, options) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_objects from <%s> could not copy data to <%s>", fnamein, fnameout); - } /* end if */ /*------------------------------------------------------------------------- * do the copy of referenced objects * and create hard links *------------------------------------------------------------------------- */ - if (do_copy_refobjs(fidin, fidout, travt, options) < 0) { + if (do_copy_refobjs(fidin, fidout, travt, options) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_refobjs from <%s> could not copy data to <%s>", fnamein, fnameout); - } /*------------------------------------------------------------------------- * close @@ -417,11 +385,9 @@ print_user_block(fnamein, fidin); *------------------------------------------------------------------------- */ - if (ub_size > 0 && options->ublock_size == 0) { - if (copy_user_block(fnamein, fnameout, ub_size) < 0) { + if (ub_size > 0 && options->ublock_size == 0) + if (copy_user_block(fnamein, fnameout, ub_size) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not copy user block. Exiting..."); - } - } return 0; @@ -738,7 +704,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, hsize_t size_dset; /*------------------------------------------------------------------------- - * copy the suppplied object list + * copy the supplied object list *------------------------------------------------------------------------- */ @@ -748,12 +714,13 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, printf("-----------------------------------------\n"); } - for (i = 0; i < travt->nobjs; i++) { - /* init variables per obj */ - buf = NULL; - limit_maxdims = FALSE; + if (travt->objs) { + for (i = 0; i < travt->nobjs; i++) { + /* init variables per obj */ + buf = NULL; + limit_maxdims = FALSE; - switch (travt->objs[i].type) { + switch (travt->objs[i].type) { case H5TRAV_TYPE_UNKNOWN: break; @@ -833,10 +800,13 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, req_filter = 1; /* check if filters were requested for individual objects */ - for (u = 0; u < options->op_tbl->nelems; u++) - if (HDstrcmp(travt->objs[i].name, options->op_tbl->objs[u].path) == 0) - if (options->op_tbl->objs[u].filter->filtn > 0) - req_filter = 1; + if (options->op_tbl->objs) { + for (u = 0; u < options->op_tbl->nelems; u++) { + if (HDstrcmp(travt->objs[i].name, options->op_tbl->objs[u].path) == 0) + if (options->op_tbl->objs[u].filter->filtn > 0) + req_filter = 1; + } + } /* check if layout change requested individual object */ if (options->layout_g != H5D_LAYOUT_ERROR) { @@ -1012,9 +982,10 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, buf = HDmalloc(need); if (buf != NULL) { - /* read/write: use the macro to check error, e.g. memory allocation error inside the library. */ - CHECK_H5DRW_ERROR(H5Dread, FAIL, dset_in, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - CHECK_H5DRW_ERROR(H5Dwrite, FAIL, dset_out, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if(H5Dread(dset_in, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + if(H5Dwrite(dset_out, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); /* Check if we have VL data in the dataset's * datatype that must be reclaimed */ @@ -1097,9 +1068,10 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, hs_select_nelmts = 1; } /* rank */ - /* read/write: use the macro to check error, e.g. memory allocation error inside the library. */ - CHECK_H5DRW_ERROR(H5Dread, FAIL, dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf); - CHECK_H5DRW_ERROR(H5Dwrite, FAIL, dset_out, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf); + if(H5Dread(dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + if(H5Dwrite(dset_out, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); /* reclaim any VL memory, if necessary */ if (vl_data) @@ -1293,19 +1265,9 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, default: HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Object type not found"); - } /* switch */ - - /* free */ - if (buf != NULL) { - HDfree(buf); - buf = NULL; - } - } /* i */ - - /* Finalize (link) the stack of named datatypes (if any) */ - named_datatype_free(&named_dt_head, 0); - - return ret_value; + } /* switch */ + } /* end for */ + } /* end if */ done: H5E_BEGIN_TRY @@ -1322,8 +1284,7 @@ done: H5Tclose(wtype_id); H5Tclose(type_in); H5Tclose(type_out); - named_datatype_free(&named_dt_head, 1); - }H5E_END_TRY; + } H5E_END_TRY; /* free */ if (buf != NULL) @@ -1331,6 +1292,14 @@ done: if (hslab_buf != NULL) HDfree(hslab_buf); + /* Finalize (link) the stack of named datatypes (if any) */ + if (0 == ret_value) + named_datatype_free(&named_dt_head, 0); + else + H5E_BEGIN_TRY { + named_datatype_free(&named_dt_head, 1); + } H5E_END_TRY; + return ret_value; } @@ -1364,8 +1333,11 @@ static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int p for (i = 0; i < nfilters; i++) { cd_nelmts = NELMTS(cd_values); - filtn = H5Pget_filter2(dcpl_id, (unsigned) i, &filt_flags, &cd_nelmts, - cd_values, sizeof(f_objname), f_objname, NULL); + if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, &filt_flags, &cd_nelmts, + cd_values, sizeof(f_objname), f_objname, NULL)) < 0) { + HDstrcat(strfilter, "ERROR "); + continue; + } switch (filtn) { case H5Z_FILTER_NONE: diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index a74e5f3..ec5d672 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -25,23 +25,71 @@ #define MIN(a,b) (((a)<(b)) ? (a) : (b)) /*------------------------------------------------------------------------- + * Function: aux_copy_obj + * + * Purpose: copy the object filters for object copy + * + * Return: 0 success, -1 failure + *------------------------------------------------------------------------- + */ +static int aux_copy_obj(hid_t dcpl_id, /* dataset creation property list */ + const char* name, /* object name from traverse list */ + pack_info_t *objout /*OUT*/) /* info about object to filter */ +{ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int nfilters; /* number of filters in DCPL */ + char f_objname[256]; /* filter objname */ + H5D_layout_t layout; + int rank; /* rank of dataset */ + hsize_t chsize[64]; /* chunk size in elements */ + unsigned int i, j; + + /* get information about input filters */ + if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_nfilters failed"); + /* copy filter_info_t structure */ + for (i = 0; i < nfilters; i++) { + if ((objout->filter[i].filtn = H5Pget_filter2(dcpl_id, (unsigned) i, &objout->filter[i].filt_flag, &objout->filter[i].cd_nelmts, + objout->filter[i].cd_values, sizeof(f_objname), f_objname, NULL)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_filter2 failed"); + } + + objout->nfilters = nfilters; + HDstrcpy(objout->path, name); + + if ((layout = H5Pget_layout(dcpl_id)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); + objout->layout = layout; + + if (layout == H5D_CHUNKED) { + if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed"); + objout->chunk.rank = rank; + for (i = 0; i < rank; i++) + objout->chunk.chunk_lengths[i] = chsize[i]; + } + +done: + return ret_value; +} + +/*------------------------------------------------------------------------- * Function: aux_find_obj * * Purpose: find the object name NAME (got from the traverse list) * in the repack options list - * *------------------------------------------------------------------------- */ static int aux_find_obj(const char* name, /* object name from traverse list */ - pack_opt_t *options, /* repack options */ - pack_info_t *obj /*OUT*/) /* info about object to filter */ + pack_opt_t *options, /* repack options */ + pack_info_t *obj /*OUT*/) /* info about object to filter */ { char *pdest; int result; unsigned int i; for (i = 0; i < options->op_tbl->nelems; i++) { - if (HDstrcmp(options->op_tbl->objs[i].path,name) == 0) { + if (HDstrcmp(options->op_tbl->objs[i].path, name) == 0) { *obj = options->op_tbl->objs[i]; return (int) i; } @@ -66,14 +114,12 @@ static int aux_find_obj(const char* name, /* object name from traverse list */ * in the repack options list; assign the filter information OBJ * * Return: 0 not found, 1 found - * *------------------------------------------------------------------------- */ static int aux_assign_obj(const char* name, /* object name from traverse list */ - pack_opt_t *options, /* repack options */ - pack_info_t *obj /*OUT*/) /* info about object to filter */ + pack_opt_t *options, /* repack options */ + pack_info_t *obj /*OUT*/) /* info about object to filter */ { - int idx, i; pack_info_t tmp; @@ -83,7 +129,6 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */ /* name was on input */ if (idx >= 0) { - /* applying to all objects */ if (options->all_layout) { /* assign the global layout info to the OBJ info */ @@ -92,8 +137,7 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */ case H5D_CHUNKED: tmp.chunk.rank = options->chunk_g.rank; for (i = 0; i < tmp.chunk.rank; i++) - tmp.chunk.chunk_lengths[i] = - options->chunk_g.chunk_lengths[i]; + tmp.chunk.chunk_lengths[i] = options->chunk_g.chunk_lengths[i]; break; case H5D_LAYOUT_ERROR: case H5D_COMPACT: @@ -111,8 +155,7 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */ case H5D_CHUNKED: tmp.chunk.rank = options->op_tbl->objs[idx].chunk.rank; for (i = 0; i < tmp.chunk.rank; i++) - tmp.chunk.chunk_lengths[i] = - options->op_tbl->objs[idx].chunk.chunk_lengths[i]; + tmp.chunk.chunk_lengths[i] = options->op_tbl->objs[idx].chunk.chunk_lengths[i]; break; case H5D_LAYOUT_ERROR: case H5D_COMPACT: @@ -123,7 +166,6 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */ default: break; }/*switch*/ - } /* applying to all objects */ @@ -183,28 +225,24 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */ * of H5Z_FILTER_NONE present in the PACK_INFO_T filter array * * Return: 0 success, -1 an error occured - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 19, 2003 - * *------------------------------------------------------------------------- */ int apply_filters(const char* name, /* object name from traverse list */ - int rank, /* rank of dataset */ - hsize_t *dims, /* dimensions of dataset */ - size_t msize, /* size of type */ - hid_t dcpl_id, /* dataset creation property list */ - pack_opt_t *options, /* repack options */ - int *has_filter) /* (OUT) object NAME has a filter */ + int rank, /* rank of dataset */ + hsize_t *dims, /* dimensions of dataset */ + size_t msize, /* size of type */ + hid_t dcpl_id, /* dataset creation property list */ + pack_opt_t *options, /* repack options */ + int *has_filter) /* (OUT) object NAME has a filter */ { int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - int nfilters; /* number of filters in DCPL */ - hsize_t chsize[64]; /* chunk size in elements */ + int nfilters; /* number of filters in DCPL */ + hsize_t chsize[64]; /* chunk size in elements */ H5D_layout_t layout; - int i; + int i, j; pack_info_t obj; + pack_info_t filtobj; *has_filter = 0; @@ -212,15 +250,16 @@ int apply_filters(const char* name, /* object name from traverse list */ HGOTO_DONE(0); /*------------------------------------------------------------------------- - * initialize the assigment object - *------------------------------------------------------------------------- - */ + * initialize the assigment object + *------------------------------------------------------------------------- + */ init_packobject(&obj); + init_packobject(&filtobj); /*------------------------------------------------------------------------- - * find options - *------------------------------------------------------------------------- - */ + * find options + *------------------------------------------------------------------------- + */ if (aux_assign_obj(name, options, &obj) == 0) HGOTO_DONE(0); @@ -228,55 +267,61 @@ int apply_filters(const char* name, /* object name from traverse list */ if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_nfilters failed"); + /*------------------------------------------------------------------------- - * check if we have filters in the pipeline - * we want to replace them with the input filters - * only remove if we are inserting new ones - *------------------------------------------------------------------------- - */ + * check if we have filters in the pipeline + * we want to replace them with the input filters + * only remove if we are inserting new ones + *------------------------------------------------------------------------- + */ if (nfilters && obj.nfilters) { *has_filter = 1; if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed"); - } - /*------------------------------------------------------------------------- - * check if there is an existent chunk - * read it only if there is not a requested layout - *------------------------------------------------------------------------- - */ - if (obj.layout == -1) { - if ((layout = H5Pget_layout(dcpl_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); - - if (layout == H5D_CHUNKED) { - if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed"); - obj.layout = H5D_CHUNKED; - obj.chunk.rank = rank; - for (i = 0; i < rank; i++) - obj.chunk.chunk_lengths[i] = chsize[i]; + /*------------------------------------------------------------------------- + * check if there is an existent chunk + * read it only if there is not a requested layout + *------------------------------------------------------------------------- + */ + if (obj.layout == -1) { + if ((layout = H5Pget_layout(dcpl_id)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); + + if (layout == H5D_CHUNKED) { + if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed"); + obj.layout = H5D_CHUNKED; + obj.chunk.rank = rank; + for (i = 0; i < rank; i++) + obj.chunk.chunk_lengths[i] = chsize[i]; + } } } + else if(nfilters) { + *has_filter = 1; + if (aux_copy_obj(dcpl_id, name, &filtobj) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "aux_copy_obj failed"); + } /*------------------------------------------------------------------------- - * the type of filter and additional parameter - * type can be one of the filters - * H5Z_FILTER_NONE 0 , uncompress if compressed - * H5Z_FILTER_DEFLATE 1 , deflation like gzip - * H5Z_FILTER_SHUFFLE 2 , shuffle the data - * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC - * H5Z_FILTER_SZIP 4 , szip compression - * H5Z_FILTER_NBIT 5 , nbit compression - * H5Z_FILTER_SCALEOFFSET 6 , scaleoffset compression - *------------------------------------------------------------------------- - */ + * the type of filter and additional parameter + * type can be one of the filters + * H5Z_FILTER_NONE 0 , uncompress if compressed + * H5Z_FILTER_DEFLATE 1 , deflation like gzip + * H5Z_FILTER_SHUFFLE 2 , shuffle the data + * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC + * H5Z_FILTER_SZIP 4 , szip compression + * H5Z_FILTER_NBIT 5 , nbit compression + * H5Z_FILTER_SCALEOFFSET 6 , scaleoffset compression + *------------------------------------------------------------------------- + */ if (obj.nfilters) { /*------------------------------------------------------------------------- - * filters require CHUNK layout; if we do not have one define a default - *------------------------------------------------------------------------- - */ + * filters require CHUNK layout; if we do not have one define a default + *------------------------------------------------------------------------- + */ if (obj.layout == -1) { /* stripmine info */ hsize_t sm_size[H5S_MAX_RANK]; /*stripmine size */ @@ -285,9 +330,9 @@ int apply_filters(const char* name, /* object name from traverse list */ obj.chunk.rank = rank; /* - * determine the strip mine size. The strip mine is - * a hyperslab whose size is manageable. - */ + * determine the strip mine size. The strip mine is + * a hyperslab whose size is manageable. + */ sm_nbytes = msize; for (i = rank; i > 0; --i) { @@ -305,18 +350,21 @@ int apply_filters(const char* name, /* object name from traverse list */ } for (i = 0; i < obj.nfilters; i++) { + if (obj.filter[i].filtn < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter"); + switch (obj.filter[i].filtn) { /*------------------------------------------------------------------------- - * H5Z_FILTER_NONE 0 , uncompress if compressed - *------------------------------------------------------------------------- - */ + * H5Z_FILTER_NONE 0 , uncompress if compressed + *------------------------------------------------------------------------- + */ case H5Z_FILTER_NONE: break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_DEFLATE 1 , deflation like gzip - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5Z_FILTER_DEFLATE 1 , deflation like gzip + *------------------------------------------------------------------------- + */ case H5Z_FILTER_DEFLATE: { unsigned aggression; /* the deflate level */ @@ -330,10 +378,10 @@ int apply_filters(const char* name, /* object name from traverse list */ } break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_SZIP 4 , szip compression - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5Z_FILTER_SZIP 4 , szip compression + *------------------------------------------------------------------------- + */ case H5Z_FILTER_SZIP: { unsigned options_mask; @@ -350,10 +398,10 @@ int apply_filters(const char* name, /* object name from traverse list */ } break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_SHUFFLE 2 , shuffle the data - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5Z_FILTER_SHUFFLE 2 , shuffle the data + *------------------------------------------------------------------------- + */ case H5Z_FILTER_SHUFFLE: if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); @@ -361,31 +409,30 @@ int apply_filters(const char* name, /* object name from traverse list */ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shuffle failed"); break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC + *------------------------------------------------------------------------- + */ case H5Z_FILTER_FLETCHER32: if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_fletcher32(dcpl_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fletcher32 failed"); break; - /*----------- ------------------------------------------------------------- - * H5Z_FILTER_NBIT , NBIT compression - *------------------------------------------------------------------------- - */ + /*----------- ------------------------------------------------------------- + * H5Z_FILTER_NBIT , NBIT compression + *------------------------------------------------------------------------- + */ case H5Z_FILTER_NBIT: if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_nbit(dcpl_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_nbit failed"); break; - /*----------- ------------------------------------------------------------- - * H5Z_FILTER_SCALEOFFSET , scale+offset compression - *------------------------------------------------------------------------- - */ - + /*----------- ------------------------------------------------------------- + * H5Z_FILTER_SCALEOFFSET , scale+offset compression + *------------------------------------------------------------------------- + */ case H5Z_FILTER_SCALEOFFSET: { H5Z_SO_scale_type_t scale_type; @@ -402,12 +449,12 @@ int apply_filters(const char* name, /* object name from traverse list */ break; default: { + if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_filter(dcpl_id, obj.filter[i].filtn, obj.filter[i].filt_flag, obj.filter[i].cd_nelmts, obj.filter[i].cd_values) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_filter failed"); - if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); } break; } /* switch */ @@ -415,31 +462,16 @@ int apply_filters(const char* name, /* object name from traverse list */ } /*obj.nfilters*/ - /*------------------------------------------------------------------------- - * layout - *------------------------------------------------------------------------- - */ - - if (obj.layout >= 0) { - /* a layout was defined */ - if (H5Pset_layout(dcpl_id, obj.layout) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_layout failed"); - - if (H5D_CHUNKED == obj.layout) { - if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); - } - else if (H5D_COMPACT == obj.layout) { - if (H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_alloc_time failed"); - } - /* remove filters for the H5D_CONTIGUOUS case */ - else if (H5D_CONTIGUOUS == obj.layout) { - if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed"); - } + if (filtobj.nfilters) { + for (i = 0; i < filtobj.nfilters; i++) { + if (filtobj.filter[i].filtn < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter"); + if (H5Zfilter_avail(filtobj.filter[i].filtn) <= 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "%d filter unavailable", filtobj.filter[i].filtn); + }/*for*/ } + /*nfilters*/ done: return ret_value; diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 3860451..d34c394 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -428,13 +428,13 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) { - /* -i for backward compability */ + /* -i for backward compatibility */ case 'i': infile = opt_arg; has_i_o = 1; break; - /* -o for backward compability */ + /* -o for backward compatibility */ case 'o': outfile = opt_arg; has_i_o = 1; @@ -695,8 +695,10 @@ int main(int argc, const char **argv) } /* initialize options */ - h5repack_init(&options, 0, FALSE); - + if (h5repack_init(&options, 0, FALSE) < 0) { + h5tools_setstatus(EXIT_FAILURE); + goto done; + } /* Initialize default indexing options */ sort_by = H5_INDEX_CRT_ORDER; diff --git a/tools/src/h5repack/h5repack_opttable.c b/tools/src/h5repack/h5repack_opttable.c index 6c409ec..7ab8c6e 100644 --- a/tools/src/h5repack/h5repack_opttable.c +++ b/tools/src/h5repack/h5repack_opttable.c @@ -30,6 +30,7 @@ void init_packobject(pack_info_t *obj) { HDstrcpy(obj->path, "\0"); for (j = 0; j < H5_REPACK_MAX_NFILTERS; j++) { obj->filter[j].filtn = -1; + obj->filter[j].cd_nelmts = CD_VALUES; for (k = 0; k < CD_VALUES; k++) obj->filter[j].cd_values[k] = 0; } @@ -261,7 +262,7 @@ options_add_filter(obj_list_t *obj_list, unsigned n_objs, filter_info_t filt, pa /* search if this object is already in the table; "path" is the key */ if (table->nelems > 0) { - /* go tru the supplied list of names */ + /* go through the supplied list of names */ for (j = 0; j < n_objs; j++) { /* linear table search */ for (i = 0; i < table->nelems; i++) { diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index 4d62723..05af197 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -58,26 +58,30 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, /* check for the end of object list and number of objects */ for (i = 0, n = 0; i < len; i++) { c = str[i]; - if (c == ':') + if (c == ':') { end_obj = (int) i; + break; + } if (c == ',') n++; } + n++; /* Check for missing : */ if (end_obj == -1) { /* apply to all objects */ options->all_filter = 1; *is_glb = 1; + *n_objs = 1; } + else + *n_objs = n; - n++; obj_list = (obj_list_t *) HDmalloc(n * sizeof(obj_list_t)); if (obj_list == NULL) { error_msg("could not allocate object list\n"); return NULL; } - *n_objs = n; /* get object list */ if (end_obj > 0) @@ -89,6 +93,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, sobj[k] = '\0'; else sobj[k + 1] = '\0'; + HDstrcpy(obj_list[n].obj, sobj); HDmemset(sobj, 0, sizeof(sobj)); n++; @@ -142,7 +147,6 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, if (l == 2) { smask[l] = '\0'; i = len - 1; /* end */ - (*n_objs)--; /* we counted an extra ',' */ if (HDstrcmp(smask,"NN") == 0) filt->cd_values[j++] = H5_SZIP_NN_OPTION_MASK; else if (HDstrcmp(smask,"EC") == 0) @@ -193,7 +197,6 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, if (l == 2) { smask[l] = '\0'; i = len - 1; /* end */ - (*n_objs)--; /* we counted an extra ',' */ if (HDstrcmp(smask,"IN") == 0) filt->cd_values[j++] = H5Z_SO_INT; else if (HDstrcmp(smask, "DS") == H5Z_SO_FLOAT_DSCALE) diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c index e276b7b..bf53bf9 100644 --- a/tools/src/h5repack/h5repack_verify.c +++ b/tools/src/h5repack/h5repack_verify.c @@ -39,22 +39,22 @@ static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *fil int h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hid_t fidin = -1; /* file ID for input file*/ hid_t fidout = -1; /* file ID for output file*/ hid_t did = -1; /* dataset ID */ hid_t pid = -1; /* dataset creation property list ID */ hid_t sid = -1; /* space ID */ hid_t tid = -1; /* type ID */ + int ok = 1; /* step results */ unsigned int i; trav_table_t *travt = NULL; - int ok = 1; - hid_t fcpl_in = -1; /* file creation property for input file */ - hid_t fcpl_out = -1; /* file creation property for output file */ + hid_t fcpl_in = -1; /* file creation property for input file */ + hid_t fcpl_out = -1; /* file creation property for output file */ H5F_fspace_strategy_t in_strategy, out_strategy; /* file space handling strategy for in/output file */ - hbool_t in_persist, out_persist; /* free-space persist status for in/output file */ - hsize_t in_threshold, out_threshold; /* free-space section threshold for in/output file */ - hsize_t in_pagesize, out_pagesize; /* file space page size for input/output file */ + hbool_t in_persist, out_persist; /* free-space persist status for in/output file */ + hsize_t in_threshold, out_threshold; /* free-space section threshold for in/output file */ + hsize_t in_pagesize, out_pagesize; /* file space page size for input/output file */ /* open the output file */ if((fidout = H5Fopen(out_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) @@ -84,7 +84,6 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options if(verify_filters(pid, tid, obj->nfilters, obj->filter) <= 0) ok = 0; - /*------------------------------------------------------------------------- * layout check *------------------------------------------------------------------------- @@ -104,10 +103,8 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); if (H5Tclose(tid) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); - } - /*------------------------------------------------------------------------- * check for the "all" objects option *------------------------------------------------------------------------- @@ -163,7 +160,6 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options ok = 0; } - /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- @@ -177,7 +173,6 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options if (H5Tclose(tid) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); } /* if */ - } /* i */ /* free table */ @@ -288,17 +283,7 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options } } - /* Closing */ - if (H5Pclose(fcpl_in) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - if (H5Pclose(fcpl_out) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - if (H5Fclose(fidin) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fclose failed"); - if (H5Fclose(fidout) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fclose failed"); - - return ok; + ret_value = ok; done: H5E_BEGIN_TRY { @@ -376,42 +361,29 @@ int verify_layout(hid_t pid, pack_info_t *obj) int h5repack_cmp_pl(const char *fname1, const char *fname2) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t fid1=-1; /* file ID */ - hid_t fid2=-1; /* file ID */ - hid_t dset1=-1; /* dataset ID */ - hid_t dset2=-1; /* dataset ID */ - hid_t gid=-1; /* group ID */ - hid_t dcpl1=-1; /* dataset creation property list ID */ - hid_t dcpl2=-1; /* dataset creation property list ID */ - hid_t gcplid=-1; /* group creation property list */ - unsigned crt_order_flag1; /* group creation order flag */ - unsigned crt_order_flag2; /* group creation order flag */ - trav_table_t *trav=NULL; - int ret=1; + int ret_value = 1; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t fid1 =-1; /* file ID */ + hid_t fid2 =-1; /* file ID */ + hid_t dset1 =-1; /* dataset ID */ + hid_t dset2 =-1; /* dataset ID */ + hid_t gid =-1; /* group ID */ + hid_t dcpl1 =-1; /* dataset creation property list ID */ + hid_t dcpl2 =-1; /* dataset creation property list ID */ + hid_t gcplid =-1; /* group creation property list */ + unsigned crt_order_flag1; /* group creation order flag */ + unsigned crt_order_flag2; /* group creation order flag */ + trav_table_t *trav = NULL; unsigned int i; /*------------------------------------------------------------------------- * open the files *------------------------------------------------------------------------- */ - - /* disable error reporting */ - H5E_BEGIN_TRY - { - - /* Open the files */ - if ((fid1 = H5Fopen(fname1,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) { - error_msg("<%s>: %s\n", fname1, H5FOPENERROR ); - return -1; - } - if ((fid2 = H5Fopen(fname2,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) { - error_msg("<%s>: %s\n", fname2, H5FOPENERROR ); - H5Fclose(fid1); - return -1; - } - /* enable error reporting */ - } H5E_END_TRY; + /* Open the files */ + if ((fid1 = H5Fopen(fname1,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname1, H5FOPENERROR); + if ((fid2 = H5Fopen(fname2,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname2, H5FOPENERROR); /*------------------------------------------------------------------------- * get file table list of objects @@ -453,7 +425,7 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); if (crt_order_flag1 != crt_order_flag2) { - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "property lists failed for <%s> are different", trav->objs[i].name); + HGOTO_ERROR(0, H5E_tools_min_id_g, "property lists failed for <%s> are different", trav->objs[i].name); } } else if(trav->objs[i].type == H5TRAV_TYPE_DATASET) { @@ -470,12 +442,11 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2) * compare the property lists *------------------------------------------------------------------------- */ - if((ret = H5Pequal(dcpl1, dcpl2)) < 0) + if((ret_value = H5Pequal(dcpl1, dcpl2)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pequal failed"); - if(ret == 0) { - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "property lists failed for <%s> are different",trav->objs[i].name); - } + if(ret_value == 0) + HGOTO_ERROR(0, H5E_tools_min_id_g, "property lists failed for <%s> are different",trav->objs[i].name); /*------------------------------------------------------------------------- * close @@ -490,29 +461,8 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2) if(H5Dclose(dset2) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); } /*if*/ - } /*i*/ - - /*------------------------------------------------------------------------- - * free - *------------------------------------------------------------------------- - */ - - trav_table_free(trav); + } /*for*/ - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - - H5Fclose(fid1); - H5Fclose(fid2); - - return ret; - -/*------------------------------------------------------------------------- -* error -*------------------------------------------------------------------------- -*/ done: H5E_BEGIN_TRY { @@ -583,6 +533,8 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) cd_values, sizeof(f_name), f_name, NULL); /* filter ID */ + if (filtn < 0) + return -1; if (filtn != filter[i].filtn) return 0; @@ -657,4 +609,3 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) return 1; } - diff --git a/tools/test/h5repack/testfiles/h5repack_filters.h5-gzip_verbose_filters.tst b/tools/test/h5repack/testfiles/h5repack_filters.h5-gzip_verbose_filters.tst index 36e65b9..5a91a28 100644 --- a/tools/test/h5repack/testfiles/h5repack_filters.h5-gzip_verbose_filters.tst +++ b/tools/test/h5repack/testfiles/h5repack_filters.h5-gzip_verbose_filters.tst @@ -1,5 +1,5 @@ -Objects to modify layout are... -Objects to apply filter are... +No all objects to modify layout +No all objects to apply filter with GZIP filter ...Found ----------------------------------------- -- cgit v0.12 From c643b135940f60d9dd53c982d278c2ef6d2958e8 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 9 Oct 2017 11:19:20 -0500 Subject: removed always true ifdef --- testpar/t_shapesame.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index d81d2be..0375710 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -5074,7 +5074,6 @@ int main(int argc, char **argv) TestInit(argv[0], usage, parse_options); /* Shape Same tests using contigous hyperslab */ -#if 1 AddTest("sscontig1", sscontig1, NULL, "Cntg hslab, ind IO, cntg dsets", PARATESTFILE); AddTest("sscontig2", sscontig2, NULL, @@ -5083,7 +5082,6 @@ int main(int argc, char **argv) "Cntg hslab, ind IO, chnk dsets", PARATESTFILE); AddTest("sscontig4", sscontig4, NULL, "Cntg hslab, col IO, chnk dsets", PARATESTFILE); -#endif /* Shape Same tests using checker board hyperslab */ AddTest("sschecker1", sschecker1, NULL, -- cgit v0.12 From 45192768add5daf1086e85f4083fa1157008a715 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 9 Oct 2017 11:30:10 -0500 Subject: fixed missing prototype warning --- testpar/t_shapesame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index 0375710..1052a69 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -2229,7 +2229,7 @@ contig_hs_dr_pio_test__run_test(const int test_num, #define CONTIG_HS_DR_PIO_TEST__DEBUG 0 -void +static void contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) { int express_test; -- cgit v0.12 From daddf169b078f2c3982af513416e7f0f9208a211 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 9 Oct 2017 12:59:28 -0500 Subject: HDFFV-10297 - Fix test errors - five remaining --- tools/lib/h5diff_attr.c | 4 +- tools/lib/h5tools_filters.c | 200 ++++++++++----------- tools/src/h5repack/h5repack.c | 91 +++++----- tools/src/h5repack/h5repack_copy.c | 9 +- tools/src/h5repack/h5repack_filters.c | 28 ++- .../testfiles/deflate_limit.h5repack_layout.h5.ddl | 4 +- .../h5repack_filters.h5-gzip_verbose_filters.tst | 1 + .../testfiles/h5repack_layout.h5-plugin_test.ddl | 2 +- .../h5repack_layout.h5-plugin_version_test.ddl | 2 +- .../testfiles/h5repack_layout.h5-plugin_zero.ddl | 131 ++++++++++++++ .../plugin_none.h5repack_layout.UD.h5.tst | 5 +- .../testfiles/plugin_test.h5repack_layout.h5.tst | 5 +- .../plugin_version_test.h5repack_layout.h5.tst | 5 +- .../testfiles/plugin_zero.h5repack_layout.h5.tst | 19 +- 14 files changed, 338 insertions(+), 168 deletions(-) diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 74607da..9bebcbe 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -472,8 +472,8 @@ hsize_t diff_attr(hid_t loc1_id, for(j = 0; j < rank1; j++) nelmts1 *= dims1[j]; - buf1 = (void *)HDmalloc((size_t)(nelmts1 * msize1)); - buf2 = (void *)HDmalloc((size_t)(nelmts1 * msize2)); + buf1 = (void *)HDcalloc((size_t)(nelmts1), msize1); + buf2 = (void *)HDcalloc((size_t)(nelmts1), msize2); if(buf1 == NULL || buf2 == NULL) { parallel_print("cannot read into memory\n"); goto error; diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 6ee58c5..28c123f 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -20,9 +20,9 @@ */ static void print_warning(const char *dname, const char *fname) { - fprintf(stderr, - "warning: dataset <%s> cannot be read, %s filter is not available\n", - dname, fname); + fprintf(stderr, + "warning: dataset <%s> cannot be read, %s filter is not available\n", + dname, fname); } /*------------------------------------------------------------------------- @@ -34,100 +34,95 @@ static void print_warning(const char *dname, const char *fname) * 2) the internal filters might be turned off * * Return: 1, can read, 0, cannot, -1 error - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: March 1, 2004 - * *------------------------------------------------------------------------- */ int h5tools_canreadf(const char* name, /* object name, serves also as boolean print */ hid_t dcpl_id) /* dataset creation property list */ { - int nfilters; /* number of filters */ - H5Z_filter_t filtn; /* filter identification number */ - int i; /* index */ - int udfilter_avail; /* index */ - - /* get information about filters */ - if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) - return -1; - - /* if we do not have filters, we can read the dataset safely */ - if (!nfilters) - return 1; - - /* check availability of filters */ - for (i = 0; i < nfilters; i++) { - if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, 0, 0, 0, (size_t) 0, 0, NULL)) < 0) - return -1; - - switch (filtn) { - /*------------------------------------------------------------------------- - * user defined filter - *------------------------------------------------------------------------- - */ - default: - if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0) - return -1; - else if (udfilter_avail == 0) { - if (name) - print_warning(name, "user defined"); - return 0; - } - break; - - /*------------------------------------------------------------------------- - * H5Z_FILTER_DEFLATE 1 , deflation like gzip - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_DEFLATE: + int nfilters; /* number of filters */ + H5Z_filter_t filtn; /* filter identification number */ + int i; /* index */ + int udfilter_avail; /* index */ + + /* get information about filters */ + if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) + return -1; + + /* if we do not have filters, we can read the dataset safely */ + if (!nfilters) + return 1; + + /* check availability of filters */ + for (i = 0; i < nfilters; i++) { + if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, 0, 0, 0, (size_t) 0, 0, NULL)) < 0) + return -1; + + switch (filtn) { + /*------------------------------------------------------------------------- + * user defined filter + *------------------------------------------------------------------------- + */ + default: + if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0) + return -1; + else if (udfilter_avail == 0) { + if (name) + print_warning(name, "user defined"); + return 0; + } + break; + + /*------------------------------------------------------------------------- + * H5Z_FILTER_DEFLATE 1 , deflation like gzip + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE - if (name) - print_warning(name,"deflate"); - return 0; + if (name) + print_warning(name,"deflate"); + return 0; #endif - break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_SZIP 4 , szip compression - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SZIP: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SZIP 4 , szip compression + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP - if (name) - print_warning(name,"SZIP"); - return 0; + if (name) + print_warning(name,"SZIP"); + return 0; #endif - break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_SHUFFLE 2 , shuffle the data - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SHUFFLE: - break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_FLETCHER32: - break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_NBIT - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_NBIT: - break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_SCALEOFFSET - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SCALEOFFSET: - break; - }/*switch*/ - }/*for*/ - - return 1; + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SHUFFLE 2 , shuffle the data + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SHUFFLE: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_FLETCHER32: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_NBIT + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_NBIT: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SCALEOFFSET + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SCALEOFFSET: + break; + }/*switch*/ + }/*for*/ + + return 1; } /*------------------------------------------------------------------------- @@ -138,31 +133,26 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr * except SZIP, which may be configured decoder-only. * * Return: 1, can write, 0, cannot, -1 error - * - * Programmer: - * - * Date: October 5, 2004 - * *------------------------------------------------------------------------- */ H5_ATTR_CONST int h5tools_can_encode(H5Z_filter_t filtn) { switch (filtn) { - /* user defined filter */ - default: + /* user defined filter */ + default: return 0; - case H5Z_FILTER_DEFLATE: + case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE return 0; #endif break; - case H5Z_FILTER_SZIP: + case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP return 0; #else - { + { unsigned int filter_config_flags; if (H5Zget_filter_info(filtn, &filter_config_flags) < 0) @@ -171,36 +161,36 @@ h5tools_can_encode(H5Z_filter_t filtn) { & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) { /* filter present but neither encode nor decode is supported (???) */ return -1; - } + } else if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_DECODE_ENABLED) { /* decoder only: read but not write */ return 0; - } + } else if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_ENCODE_ENABLED) { /* encoder only: write but not read (???) */ return -1; - } + } else if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) { return 1; } - } + } #endif break; - case H5Z_FILTER_SHUFFLE: + case H5Z_FILTER_SHUFFLE: break; - case H5Z_FILTER_FLETCHER32: + case H5Z_FILTER_FLETCHER32: break; - case H5Z_FILTER_NBIT: + case H5Z_FILTER_NBIT: break; - case H5Z_FILTER_SCALEOFFSET: + case H5Z_FILTER_SCALEOFFSET: break; }/*switch*/ diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index f34d466..6b8cf8a 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -693,6 +693,7 @@ static int check_objects(const char* fname, pack_opt_t *options) { hid_t did; hid_t sid; unsigned int i; + unsigned int uf; trav_table_t *travt = NULL; /* nothing to do */ @@ -740,52 +741,54 @@ static int check_objects(const char* fname, pack_opt_t *options) { if (options->verbose) printf("...Found\n"); - if (options->op_tbl->objs[i].filter->filtn < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter"); - /* check for extra filter conditions */ - switch (options->op_tbl->objs[i].filter->filtn) { - /* chunk size must be smaller than pixels per block */ - case H5Z_FILTER_SZIP: - { - int j; - hsize_t csize = 1; - unsigned ppb = options->op_tbl->objs[i].filter->cd_values[0]; - hsize_t dims[H5S_MAX_RANK]; - int rank; - - if (options->op_tbl->objs[i].chunk.rank > 0) { - rank = options->op_tbl->objs[i].chunk.rank; - for (j = 0; j < rank; j++) - csize *= options->op_tbl->objs[i].chunk.chunk_lengths[j]; - } - else { - if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); - if ((sid = H5Dget_space(did)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); - if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); - HDmemset(dims, 0, sizeof dims); - if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); - for (j = 0; j < rank; j++) - csize *= dims[j]; - if (H5Sclose(sid) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); - if (H5Dclose(did) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); - } - - if (csize < ppb) { - printf(" \n"); - HGOTO_DONE(0); + for (uf = 0; uf < options->op_tbl->objs[i].nfilters; uf++) { + if (options->op_tbl->objs[i].filter[uf].filtn < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter"); + /* check for extra filter conditions */ + switch (options->op_tbl->objs[i].filter[uf].filtn) { + /* chunk size must be smaller than pixels per block */ + case H5Z_FILTER_SZIP: + { + int j; + hsize_t csize = 1; + unsigned ppb = options->op_tbl->objs[i].filter[uf].cd_values[0]; + hsize_t dims[H5S_MAX_RANK]; + int rank; + + if (options->op_tbl->objs[i].chunk.rank > 0) { + rank = options->op_tbl->objs[i].chunk.rank; + for (j = 0; j < rank; j++) + csize *= options->op_tbl->objs[i].chunk.chunk_lengths[j]; + } + else { + if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + if ((sid = H5Dget_space(did)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); + if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + HDmemset(dims, 0, sizeof dims); + if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); + for (j = 0; j < rank; j++) + csize *= dims[j]; + if (H5Sclose(sid) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); + if (H5Dclose(did) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); + } + + if (csize < ppb) { + printf(" \n"); + HGOTO_DONE(0); + } } + break; + default: + break; } - break; - default: - break; - } - } /* i */ + } /* for uf */ + } /* for i */ done: H5E_BEGIN_TRY { diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 08bce60..9fcf218 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -698,6 +698,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, unsigned crt_order_flags; /* group creation order flag */ unsigned i; unsigned u; + unsigned uf; int is_ref = 0; htri_t is_named; hbool_t limit_maxdims; @@ -803,8 +804,10 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, if (options->op_tbl->objs) { for (u = 0; u < options->op_tbl->nelems; u++) { if (HDstrcmp(travt->objs[i].name, options->op_tbl->objs[u].path) == 0) - if (options->op_tbl->objs[u].filter->filtn > 0) - req_filter = 1; + for (uf = 0; uf < options->op_tbl->objs[uf].nfilters; uf++) { + if (options->op_tbl->objs[u].filter[uf].filtn > 0) + req_filter = 1; + } } } @@ -1293,7 +1296,7 @@ done: HDfree(hslab_buf); /* Finalize (link) the stack of named datatypes (if any) */ - if (0 == ret_value) + if (0 == ret_value && named_dt_head != NULL) named_datatype_free(&named_dt_head, 0); else H5E_BEGIN_TRY { diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index ec5d672..e968b3c 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -469,9 +469,33 @@ int apply_filters(const char* name, /* object name from traverse list */ if (H5Zfilter_avail(filtobj.filter[i].filtn) <= 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "%d filter unavailable", filtobj.filter[i].filtn); - }/*for*/ + } /* for */ + } /* nfilters */ + + /*------------------------------------------------------------------------- + * layout + *------------------------------------------------------------------------- + */ + + if (obj.layout >= 0) { + /* a layout was defined */ + if (H5Pset_layout(dcpl_id, obj.layout) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_layout failed"); + + if (H5D_CHUNKED == obj.layout) { + if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); + } + else if (H5D_COMPACT == obj.layout) { + if (H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_alloc_time failed"); + } + /* remove filters for the H5D_CONTIGUOUS case */ + else if (H5D_CONTIGUOUS == obj.layout) { + if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed"); + } } - /*nfilters*/ done: return ret_value; diff --git a/tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl b/tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl index 75f54fa..1dcc742 100644 --- a/tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl +++ b/tools/test/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl @@ -76,8 +76,8 @@ GROUP "/" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { - CHUNKED ( 20, 10 ) - SIZE 1283 (2.494:1 COMPRESSION) + CHUNKED ( 40, 20 ) + SIZE 1150 (2.783:1 COMPRESSION) } FILTERS { COMPRESSION DEFLATE { LEVEL 1 } diff --git a/tools/test/h5repack/testfiles/h5repack_filters.h5-gzip_verbose_filters.tst b/tools/test/h5repack/testfiles/h5repack_filters.h5-gzip_verbose_filters.tst index 5a91a28..cb12172 100644 --- a/tools/test/h5repack/testfiles/h5repack_filters.h5-gzip_verbose_filters.tst +++ b/tools/test/h5repack/testfiles/h5repack_filters.h5-gzip_verbose_filters.tst @@ -2,6 +2,7 @@ No all objects to modify layout No all objects to apply filter with GZIP filter ...Found +Making new file ... ----------------------------------------- Type Filter (Compression) Name ----------------------------------------- diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl index a8b4562..4856f84 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl @@ -92,7 +92,7 @@ GROUP "/" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { - CHUNKED ( 20, 10 ) + CHUNKED ( 40, 20 ) SIZE 3200 (1.000:1 COMPRESSION) } FILTERS { diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl index a951638..283b44c 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl @@ -92,7 +92,7 @@ GROUP "/" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } STORAGE_LAYOUT { - CHUNKED ( 20, 10 ) + CHUNKED ( 40, 20 ) SIZE 3200 (1.000:1 COMPRESSION) } FILTERS { diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl index 97cbfc0..e4ffaf1 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl @@ -1,4 +1,135 @@ HDF5 "out-plugin_zero.h5repack_layout.h5" { GROUP "/" { + DATASET "dset1" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 3200 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 3200 + OFFSET 5248 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset3" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 3200 + OFFSET 8448 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset4" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 3200 + OFFSET 13696 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset_chunk" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } + STORAGE_LAYOUT { + CHUNKED ( 20, 10 ) + SIZE 3200 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_INCR + } + } + DATASET "dset_compact" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } + STORAGE_LAYOUT { + COMPACT + SIZE 3200 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_EARLY + } + } + DATASET "dset_contiguous" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 3200 + OFFSET 26184 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } } } diff --git a/tools/test/h5repack/testfiles/plugin_none.h5repack_layout.UD.h5.tst b/tools/test/h5repack/testfiles/plugin_none.h5repack_layout.UD.h5.tst index 4fb6906..30aa8ad 100644 --- a/tools/test/h5repack/testfiles/plugin_none.h5repack_layout.UD.h5.tst +++ b/tools/test/h5repack/testfiles/plugin_none.h5repack_layout.UD.h5.tst @@ -1,6 +1,7 @@ -Objects to modify layout are... -Objects to apply filter are... +No all objects to modify layout +All objects to apply filter are... Uncompress all +Making new file ... ----------------------------------------- Type Filter (Compression) Name ----------------------------------------- diff --git a/tools/test/h5repack/testfiles/plugin_test.h5repack_layout.h5.tst b/tools/test/h5repack/testfiles/plugin_test.h5repack_layout.h5.tst index 7f9bd6e..62ea1cc 100644 --- a/tools/test/h5repack/testfiles/plugin_test.h5repack_layout.h5.tst +++ b/tools/test/h5repack/testfiles/plugin_test.h5repack_layout.h5.tst @@ -1,6 +1,7 @@ -Objects to modify layout are... -Objects to apply filter are... +No all objects to modify layout +All objects to apply filter are... User Defined 257 +Making new file ... ----------------------------------------- Type Filter (Compression) Name ----------------------------------------- diff --git a/tools/test/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst b/tools/test/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst index 1a496c6..f5c4736 100644 --- a/tools/test/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst +++ b/tools/test/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst @@ -1,6 +1,7 @@ -Objects to modify layout are... -Objects to apply filter are... +No all objects to modify layout +All objects to apply filter are... User Defined 260 +Making new file ... ----------------------------------------- Type Filter (Compression) Name ----------------------------------------- diff --git a/tools/test/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst b/tools/test/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst index 20f8a40..54c873c 100644 --- a/tools/test/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst +++ b/tools/test/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst @@ -1,7 +1,22 @@ -Objects to modify layout are... -Objects to apply filter are... +No all objects to modify layout +All objects to apply filter are... User Defined 250 +Making new file ... ----------------------------------------- Type Filter (Compression) Name ----------------------------------------- group / + warning: could not create dataset . Applying original settings + dset /dset1 + warning: could not create dataset . Applying original settings + dset /dset2 + warning: could not create dataset . Applying original settings + dset /dset3 + warning: could not create dataset . Applying original settings + dset /dset4 + warning: could not create dataset . Applying original settings + dset /dset_chunk + warning: could not create dataset . Applying original settings + dset /dset_compact + warning: could not create dataset . Applying original settings + dset /dset_contiguous -- cgit v0.12 From 66990bc90fe83c0d32e96694918e67928dadb9d0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 9 Oct 2017 13:23:02 -0500 Subject: HDFFV-10297 - code changes nullify error --- tools/test/h5repack/CMakeTests.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index c68f18a..559dd88 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -1377,11 +1377,7 @@ ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,0,1,9) ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) # check for no parameters - set (TESTRETVAL 255) - if (WIN32) - set (TESTRETVAL -1) - endif () - ADD_H5_UD_TEST (plugin_zero ${TESTRETVAL} h5repack_layout.h5 -v -f UD=250,0,0) + ADD_H5_UD_TEST (plugin_zero 0 h5repack_layout.h5 -v -f UD=250,0,0) if (HDF5_TEST_VFD) # Run test with different Virtual File Driver -- cgit v0.12 From 726d7d3af55e29430c3bda89b5d260d73d258ca1 Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 9 Oct 2017 15:33:09 -0500 Subject: Add "-rpath /nowhere" to *_la_LDFLAGS for plugin test libraries. This allows them to be successfully linked but not installed. The change was added for the HDF5 1.8.20 release, but is also needed for all other HDF5 branches. --- configure.ac | 1 + test/Makefile.am | 30 ++++++++++++++---------------- tools/test/h5diff/Makefile.am | 7 ++----- tools/test/h5dump/Makefile.am | 9 +++------ tools/test/h5ls/Makefile.am | 9 +++------ tools/test/h5repack/Makefile.am | 13 +++++-------- 6 files changed, 28 insertions(+), 41 deletions(-) diff --git a/configure.ac b/configure.ac index 07d8b15..ed7727b 100644 --- a/configure.ac +++ b/configure.ac @@ -1062,6 +1062,7 @@ esac case "`uname`" in CYGWIN*) AC_CHECK_HEADERS([io.h sys/timeb.h]) + UNAME_CYGWIN="yes" ;; MINGW*) AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h]) diff --git a/test/Makefile.am b/test/Makefile.am index 53dbf0d..ba2d79b 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -100,36 +100,34 @@ if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) endif -# The libh5test library provides common support code for the tests. -noinst_LTLIBRARIES=libh5test.la - if HAVE_SHARED_CONDITIONAL + # The libh5test library provides common support code for the tests. # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. - # Build it as shared library if configure is enabled for shared library. - dyn_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la + # Build them as shared libraries if configure is enabled for shared library. + noinst_LTLIBRARIES=libh5test.la libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c libdynlib4_la_SOURCES=dynlib4.c - libdynlib1_la_LDFLAGS = -avoid-version -module -shared -export-dynamic - libdynlib2_la_LDFLAGS = -avoid-version -module -shared -export-dynamic - libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic - libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlib1_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libdynlib2_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere -libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) + libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) -libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) + libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) -libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) + libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) -libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) + libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD) - -#install-exec-hook: -# $(RM) $(DESTDIR)$(dyndir)/*dynlib* +else + # The libh5test library provides common support code for the tests. + noinst_LTLIBRARIES=libh5test.la endif libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c diff --git a/tools/test/h5diff/Makefile.am b/tools/test/h5diff/Makefile.am index 5721aaa..68c310b 100644 --- a/tools/test/h5diff/Makefile.am +++ b/tools/test/h5diff/Makefile.am @@ -50,15 +50,12 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - dyn_LTLIBRARIES=libdynlibdiff.la + noinst_LTLIBRARIES=libdynlibdiff.la libdynlibdiff_la_SOURCES=dynlib_diff.c - libdynlibdiff_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlibdiff_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere libdynlibdiff.la: $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_DEPENDENCIES) $(EXTRA_libdynlibdiff_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibdiff_la_LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD) - -#install-exec-hook: -# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif # Temporary files. *.h5 are generated by h5diff. They should diff --git a/tools/test/h5dump/Makefile.am b/tools/test/h5dump/Makefile.am index df97396..1454987 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -39,15 +39,12 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - dyn_LTLIBRARIES=libdynlibdump.la + noinst_LTLIBRARIES=libdynlibdump.la libdynlibdump_la_SOURCES=dynlib_dump.c - libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere -libdynlibdump.la: $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_DEPENDENCIES) $(EXTRA_libdynlibdump_la_DEPENDENCIES) + libdynlibdump.la: $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_DEPENDENCIES) $(EXTRA_libdynlibdump_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibdump_la_LINK) $(am_libdynlibdump_la_rpath) $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_LIBADD) - -#install-exec-hook: -# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif # Temporary files. *.h5 are generated by h5dumpgentest. They should diff --git a/tools/test/h5ls/Makefile.am b/tools/test/h5ls/Makefile.am index 8ace14d..ec8b8c3 100644 --- a/tools/test/h5ls/Makefile.am +++ b/tools/test/h5ls/Makefile.am @@ -36,15 +36,12 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - dyn_LTLIBRARIES=libdynlibls.la + noinst_LTLIBRARIES=libdynlibls.la libdynlibls_la_SOURCES=dynlib_ls.c - libdynlibls_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlibls_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere -libdynlibls.la: $(libdynlibls_la_OBJECTS) $(libdynlibls_la_DEPENDENCIES) $(EXTRA_libdynlibls_la_DEPENDENCIES) + libdynlibls.la: $(libdynlibls_la_OBJECTS) $(libdynlibls_la_DEPENDENCIES) $(EXTRA_libdynlibls_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibls_la_LINK) $(am_libdynlibls_la_rpath) $(libdynlibls_la_OBJECTS) $(libdynlibls_la_LIBADD) - -#install-exec-hook: -# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index da2a3c3..d4dc843 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -45,19 +45,16 @@ h5repacktst_SOURCES=h5repacktst.c if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - dyn_LTLIBRARIES=libdynlibadd.la libdynlibvers.la + noinst_LTLIBRARIES=libdynlibadd.la libdynlibvers.la libdynlibadd_la_SOURCES=dynlib_rpk.c libdynlibvers_la_SOURCES=dynlib_vrpk.c - libdynlibadd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic - libdynlibvers_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlibadd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libdynlibvers_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere -libdynlibadd.la: $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_DEPENDENCIES) $(EXTRA_libdynlibadd_la_DEPENDENCIES) + libdynlibadd.la: $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_DEPENDENCIES) $(EXTRA_libdynlibadd_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibadd_la_LINK) $(am_libdynlibadd_la_rpath) $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_LIBADD) -libdynlibvers.la: $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_DEPENDENCIES) $(EXTRA_libdynlibvers_la_DEPENDENCIES) + libdynlibvers.la: $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_DEPENDENCIES) $(EXTRA_libdynlibvers_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibvers_la_LINK) $(am_libdynlibvers_la_rpath) $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_LIBADD) - -#install-exec-hook: -# $(RM) $(DESTDIR)$(dyndir)/*dynlib* endif -- cgit v0.12 From 4a3998ac308c2bf24201e470c0b23f7f83f063e1 Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 9 Oct 2017 15:45:33 -0500 Subject: Correct indentation in h5diff/Makefile.am. --- tools/test/h5diff/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5diff/Makefile.am b/tools/test/h5diff/Makefile.am index 68c310b..d2b5ebb 100644 --- a/tools/test/h5diff/Makefile.am +++ b/tools/test/h5diff/Makefile.am @@ -54,7 +54,7 @@ if HAVE_SHARED_CONDITIONAL libdynlibdiff_la_SOURCES=dynlib_diff.c libdynlibdiff_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere -libdynlibdiff.la: $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_DEPENDENCIES) $(EXTRA_libdynlibdiff_la_DEPENDENCIES) + libdynlibdiff.la: $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_DEPENDENCIES) $(EXTRA_libdynlibdiff_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibdiff_la_LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD) endif -- cgit v0.12 From 837624b9cd33e95560377659aede1d065a858726 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Mon, 9 Oct 2017 16:47:21 -0400 Subject: Add a test for parallel reads of independent files using MPI subgroups --- src/H5FDmpio.h | 23 ------- src/H5Fsuper.c | 18 +++--- testpar/t_pread.c | 183 +++++++++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 159 insertions(+), 65 deletions(-) diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h index f02afe6..6ee0a1a 100644 --- a/src/H5FDmpio.h +++ b/src/H5FDmpio.h @@ -29,29 +29,6 @@ #endif /* H5_HAVE_PARALLEL */ #ifdef H5_HAVE_PARALLEL -#if 0 /* delete this eventually */ -#define H5FD_GET_MPI_RANK_AND_SIZE(rank,size, f) { \ - (rank) = 0; (size) = 1; \ - if (H5F_HAS_FEATURE((f), H5FD_FEAT_HAS_MPI)) { \ - (rank) = H5F_mpi_get_rank((f)); \ - (size) = H5F_mpi_get_size((f)); \ - } else { \ - int mpi_initialized = 0, mpi_finalized = 0; \ - MPI_Initialized(&mpi_initialized); \ - MPI_Finalized(&mpi_finalized); \ - if (mpi_initialized && !mpi_finalized) { \ - MPI_Comm_rank(MPI_COMM_WORLD, &(rank)); \ - MPI_Comm_size(MPI_COMM_WORLD, &(size)); \ - } \ - }} - -#define H5FD_GET_MPI_COMM(comm, f) { \ - if (H5F_HAS_FEATURE((f), H5FD_FEAT_HAS_MPI)) \ - (comm) = H5F_mpi_get_comm((f)); \ - else (comm) = MPI_COMM_WORLD; \ - } -#endif /* delete this eventually */ - /*Turn on H5FDmpio_debug if H5F_DEBUG is on */ #ifdef H5F_DEBUG #ifndef H5FDmpio_DEBUG diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index a34a7fd..a3b1fed 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -359,9 +359,6 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial /* Find the superblock */ #ifdef H5_HAVE_PARALLEL -#if 0 - H5FD_GET_MPI_RANK_AND_SIZE(mpi_rank, mpi_size, f); -#else if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { if((mpi_rank = H5F_mpi_get_rank(f)) < 0) @@ -370,9 +367,15 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial if((mpi_size = H5F_mpi_get_size(f)) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size") } -#endif + /* If we are an MPI application with at least two processes, the * following superblock signature location optimization is applicable. + * + * Note:: For parallel applications which don't setup for using the + * HDF5 MPIO driver, we will arrive here with mpi_size == 1. + * This occurs because of the variable initialization (above) and the + * fact that we have skipped actually calling MPI functions to determine + * our MPI rank and size. */ if ( mpi_size > 1 ) { MPI_Comm this_comm = MPI_COMM_NULL; @@ -381,12 +384,6 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial if(H5FD_locate_signature(&fdio_info, &super_addr) < 0) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") } -#if 0 - H5FD_GET_MPI_COMM(this_comm, f); - if (( this_comm == MPI_COMM_NULL ) || - ( MPI_Bcast(&super_addr,sizeof(super_addr), MPI_BYTE, 0, this_comm) != MPI_SUCCESS)) - HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") -#else HDassert(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)); if ( MPI_COMM_NULL == (this_comm = H5F_mpi_get_comm(f)) ) @@ -395,7 +392,6 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial if ( MPI_SUCCESS != (mpi_result = MPI_Bcast(&super_addr,sizeof(super_addr), MPI_BYTE, 0, this_comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) -#endif } else { /* Locate the signature as per per the serial library */ diff --git a/testpar/t_pread.c b/testpar/t_pread.c index ecc7360..48c14a9 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -35,15 +35,36 @@ static const char *random_hdf5_text = manual or go thru the tutorials!\n\ While you\'re at it, now is also the time to read up on MPI-IO."; -static int generate_test_file(int mpi_rank, int mpi_size); -static int test_parallel_read(int mpi_rank); +static const char *hitchhiker_quote = +"A common mistake that people make when trying to design something\n\ +completely foolproof is to underestimate the ingenuity of complete\n\ +fools.\n"; + +static int generate_test_file(MPI_Comm comm, int mpi_rank, int group); +static int test_parallel_read(MPI_Comm comm, int mpi_rank, int group); /*------------------------------------------------------------------------- * Function: generate_test_file * - * Purpose: *** Richard -- please fill this in *** + * Purpose: This function is called to produce an HDF5 data file + * whose superblock is relocated to a non-zero offset by + * utilizing the 'h5jam' utility to write random text + * at the start of the file. Unlike simple concatenation + * of files, h5jam is used to place the superblock on a + * power-of-2 boundary. + * + * Since data will be read back and validated, we generate + * data in a predictable manner rather than randomly. + * For now, we simply use the mpi_rank of the writing + * process as a starting component of the data generation. + * Subsequent writes are increments from the initial start + * value. * + * In the overall scheme of running the test, we'll call + * this function twice so as to create two seperate files. + * Each file will serve as the input data for two + * independent parallel reads. * * Return: Success: 0 * @@ -57,14 +78,17 @@ static int test_parallel_read(int mpi_rank); *------------------------------------------------------------------------- */ static int -generate_test_file( int mpi_rank, int mpi_size ) +generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) { FILE *header; const char *fcn_name = "generate_test_file()"; const char *failure_mssg = NULL; + char group_file[FILENAME_BUF_SIZE]; char data_filename[FILENAME_BUF_SIZE]; char reloc_data_filename[FILENAME_BUF_SIZE]; char prolog_filename[FILENAME_BUF_SIZE]; + int group_size; + int group_rank; int local_failure = 0; int global_failures = 0; hsize_t count = COUNT; @@ -82,6 +106,18 @@ generate_test_file( int mpi_rank, int mpi_size ) pass = true; + HDassert(comm != MPI_COMM_NULL); + + if ( (MPI_Comm_rank(comm, &group_rank)) != MPI_SUCCESS) { + pass = FALSE; + failure_mssg = "generate_test_file: MPI_Comm_rank failed.\n"; + } + + if ( (MPI_Comm_size(comm, &group_size)) != MPI_SUCCESS) { + pass = FALSE; + failure_mssg = "generate_test_file: MPI_Comm_size failed.\n"; + } + if ( mpi_rank == 0 ) { HDfprintf(stdout, "Constructing test files..."); @@ -90,8 +126,11 @@ generate_test_file( int mpi_rank, int mpi_size ) /* setup the file names */ if ( pass ) { HDassert(FILENAMES[0]); - - if ( h5_fixname(FILENAMES[0], H5P_DEFAULT, data_filename, + if ( HDsprintf(group_file, "%s_%d", FILENAMES[0], group_id) < 0) { + pass = FALSE; + failure_mssg = "HDsprintf(0) failed.\n"; + } + else if ( h5_fixname(group_file, H5P_DEFAULT, data_filename, sizeof(data_filename)) == NULL ) { pass = FALSE; failure_mssg = "h5_fixname(0) failed.\n"; @@ -100,8 +139,11 @@ generate_test_file( int mpi_rank, int mpi_size ) if ( pass ) { HDassert(FILENAMES[1]); - - if ( h5_fixname(FILENAMES[1], H5P_DEFAULT, reloc_data_filename, + if ( HDsprintf(group_file, "%s_%d", FILENAMES[1], group_id) < 0) { + pass = FALSE; + failure_mssg = "HDsprintf(1) failed.\n"; + } + else if ( h5_fixname(group_file, H5P_DEFAULT, reloc_data_filename, sizeof(reloc_data_filename)) == NULL ) { pass = FALSE; @@ -111,8 +153,11 @@ generate_test_file( int mpi_rank, int mpi_size ) if ( pass ) { HDassert(FILENAMES[2]); - - if ( h5_fixname(FILENAMES[2], H5P_DEFAULT, prolog_filename, + if ( HDsprintf(group_file, "%s_%d", FILENAMES[2], group_id) < 0) { + pass = FALSE; + failure_mssg = "HDsprintf(2) failed.\n"; + } + else if ( h5_fixname(group_file, H5P_DEFAULT, prolog_filename, sizeof(prolog_filename)) == NULL ) { pass = FALSE; failure_mssg = "h5_fixname(2) failed.\n"; @@ -145,7 +190,7 @@ generate_test_file( int mpi_rank, int mpi_size ) } if ( pass ) { - if ( (H5Pset_fapl_mpio(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL)) < 0 ) { + if ( (H5Pset_fapl_mpio(fapl_id, comm, MPI_INFO_NULL)) < 0 ) { pass = FALSE; failure_mssg = "H5Pset_fapl_mpio() failed\n"; } @@ -184,7 +229,7 @@ generate_test_file( int mpi_rank, int mpi_size ) } if ( pass ) { - dims[0] *= (hsize_t)mpi_size; + dims[0] *= (hsize_t)group_size; if ( (filespace = H5Screate_simple(1, dims, NULL)) < 0 ) { pass = FALSE; failure_mssg = "H5Screate_simple(1, dims, NULL) failed (2).\n"; @@ -192,7 +237,7 @@ generate_test_file( int mpi_rank, int mpi_size ) } if ( pass ) { - offset = (hsize_t)mpi_rank * (hsize_t)COUNT; + offset = (hsize_t)group_rank * (hsize_t)COUNT; if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, &offset, NULL, &count, NULL)) < 0 ) { pass = FALSE; @@ -266,11 +311,17 @@ generate_test_file( int mpi_rank, int mpi_size ) * * Also delete files that are no longer needed. */ - if ( mpi_rank == 0 ) { + if ( group_rank == 0 ) { + const char *text_to_write; size_t bytes_to_write; - bytes_to_write = strlen(random_hdf5_text); + if (group_id == 0) + text_to_write = random_hdf5_text; + else + text_to_write = hitchhiker_quote; + + bytes_to_write = strlen(text_to_write); if ( pass ) { if ( (header = HDfopen(prolog_filename, "w+")) == NULL ) { @@ -280,8 +331,8 @@ generate_test_file( int mpi_rank, int mpi_size ) } if ( pass ) { - bytes_to_write = strlen(random_hdf5_text); - if ( HDfwrite(random_hdf5_text, 1, bytes_to_write, header) != + + if ( HDfwrite(text_to_write, 1, bytes_to_write, header) != bytes_to_write ) { pass = FALSE; failure_mssg = "Unable to write header file.\n"; @@ -319,6 +370,7 @@ generate_test_file( int mpi_rank, int mpi_size ) */ local_failure = ( pass ? 0 : 1 ); + /* This is a global all reduce (NOT group specific) */ if ( MPI_Allreduce(&local_failure, &global_failures, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD) != MPI_SUCCESS ) { if ( pass ) { @@ -355,8 +407,25 @@ generate_test_file( int mpi_rank, int mpi_size ) /*------------------------------------------------------------------------- * Function: test_parallel_read * - * Purpose: *** Richard -- please fill this in *** + * Purpose: This actually tests the superblock optimization + * and covers the two primary cases we're interested in. + * 1). That HDF5 files can be opened in parallel by + * the rank 0 process and that the superblock + * offset is correctly broadcast to the other + * parallel file readers. + * 2). That a parallel application can correctly + * handle reading multiple files by using + * subgroups of MPI_COMM_WORLD and that each + * subgroup operates as described in (1) to + * collectively read the data. * + * The global MPI rank is used for reading and + * writing data for process specific data in the + * dataset. We do this rather simplisticly, i.e. + * rank 0: writes/reads 0-9999 + * rank 1: writes/reads 1000-1999 + * rank 2: writes/reads 2000-2999 + * ... * * Return: Success: 0 * @@ -370,13 +439,16 @@ generate_test_file( int mpi_rank, int mpi_size ) *------------------------------------------------------------------------- */ static int -test_parallel_read(int mpi_rank) +test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) { const char *failure_mssg; const char *fcn_name = "test_parallel_read()"; + char group_file[FILENAME_BUF_SIZE]; char reloc_data_filename[FILENAME_BUF_SIZE]; int local_failure = 0; int global_failures = 0; + int group_size; + int group_rank; hid_t fapl_id; hid_t file_id; hid_t dset_id; @@ -391,6 +463,18 @@ test_parallel_read(int mpi_rank) pass = TRUE; + HDassert(comm != MPI_COMM_NULL); + + if ( (MPI_Comm_rank(comm, &group_rank)) != MPI_SUCCESS) { + pass = FALSE; + failure_mssg = "test_parallel_read: MPI_Comm_rank failed.\n"; + } + + if ( (MPI_Comm_size(comm, &group_size)) != MPI_SUCCESS) { + pass = FALSE; + failure_mssg = "test_parallel_read: MPI_Comm_size failed.\n"; + } + if ( mpi_rank == 0 ) { TESTING("parallel file open test 1"); @@ -408,8 +492,11 @@ test_parallel_read(int mpi_rank) /* construct file file name */ if ( pass ) { HDassert(FILENAMES[1]); - - if ( h5_fixname(FILENAMES[1], H5P_DEFAULT, reloc_data_filename, + if ( HDsprintf(group_file, "%s_%d", FILENAMES[1], group_id) < 0) { + pass = FALSE; + failure_mssg = "HDsprintf(0) failed.\n"; + } + else if ( h5_fixname(group_file, H5P_DEFAULT, reloc_data_filename, sizeof(reloc_data_filename)) == NULL ) { pass = FALSE; @@ -426,7 +513,7 @@ test_parallel_read(int mpi_rank) } if ( pass ) { - if ( (H5Pset_fapl_mpio(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL)) < 0 ) { + if ( (H5Pset_fapl_mpio(fapl_id, comm, MPI_INFO_NULL)) < 0 ) { pass = FALSE; failure_mssg = "H5Pset_fapl_mpio() failed\n"; } @@ -467,7 +554,7 @@ test_parallel_read(int mpi_rank) } if ( pass ) { - offset = (hsize_t)mpi_rank * count; + offset = (hsize_t)group_rank * count; if ( (H5Sselect_hyperslab(filespace, H5S_SELECT_SET, &offset, NULL, &count, NULL)) < 0 ) { pass = FALSE; @@ -557,7 +644,7 @@ test_parallel_read(int mpi_rank) } /* report results and finish cleanup */ - if ( mpi_rank == 0 ) { + if ( group_rank == 0 ) { if ( pass ) { PASSED(); } else { @@ -584,8 +671,17 @@ test_parallel_read(int mpi_rank) /*------------------------------------------------------------------------- * Function: main * - * Purpose: *** Richard -- please fill this in *** + * Purpose: To implement a parallel test which validates whether the + * new superblock lookup functionality is working correctly. * + * The test consists of creating two seperate HDF datasets + * in which random text is inserted at the start of each + * file using the 'j5jam' application. This forces the + * HDF5 file superblock to a non-zero offset. + * Having created the two independant files, we create two + * non-overlapping MPI groups, each of which is then tasked + * with the opening and validation of the data contained + * therein. * * WARNING: This test uses fork() and execve(), and * therefore will not run on Windows. @@ -606,8 +702,11 @@ int main( int argc, char **argv) { int nerrs = 0; + int which_group; int mpi_rank; int mpi_size; + int split_size; + MPI_Comm group_comm = MPI_COMM_NULL; if ( (MPI_Init(&argc, &argv)) != MPI_SUCCESS) { HDfprintf(stderr, "FATAL: Unable to initialize MPI\n"); @@ -633,21 +732,37 @@ main( int argc, char **argv) HDfprintf(stdout, "========================================\n"); } - if ( mpi_size < 2 ) { + if ( mpi_size < 4 ) { if ( mpi_rank == 0 ) { - HDprintf(" Need at least 2 processes. Exiting.\n"); + HDprintf(" Need at least 4 processes. Exiting.\n"); } goto finish; } + /* Divide the available processes into two groups + * that are the same size (plus or minus). + */ + split_size = mpi_size / 2; + which_group = (mpi_rank < split_size ? 0 : 1); + + if ( (MPI_Comm_split(MPI_COMM_WORLD, + which_group, + 0, + &group_comm)) != MPI_SUCCESS) { + + HDfprintf(stderr, "FATAL: MPI_Comm_split returned an error\n"); + exit(2); + } + + /* create the test files & verify that the process * succeeded. If not, abort the remaining tests as * they depend on the test files. */ - nerrs += generate_test_file( mpi_rank, mpi_size ); + nerrs += generate_test_file( group_comm, mpi_rank, which_group ); /* abort tests if there were any errors in test file construction */ if ( nerrs > 0 ) { @@ -655,13 +770,19 @@ main( int argc, char **argv) HDprintf(" Test file construction failed -- skipping tests.\n"); } goto finish; - } + } - /* run the tests */ - nerrs += test_parallel_read(mpi_rank); + /* run the tests */ + nerrs += test_parallel_read(group_comm, mpi_rank, which_group); finish: + if ((group_comm != MPI_COMM_NULL) && + (MPI_Comm_free(&group_comm)) != MPI_SUCCESS) { + HDfprintf(stderr, "MPI_Comm_free failed!\n"); + } + + /* make sure all processes are finished before final report, cleanup * and exit. */ -- cgit v0.12 From c577a5e995bf339f4760e3b8fa30763e6aa4e4ae Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 9 Oct 2017 17:00:15 -0500 Subject: HDFFV-10297 update calls to H5Zfilter_avail --- src/H5Z.c | 3 +- test/dsets.c | 2879 +++++++++++++++++------------------- tools/lib/h5tools_filters.c | 24 +- tools/test/h5diff/CMakeLists.txt | 10 +- tools/test/h5diff/CMakeTests.cmake | 14 +- 5 files changed, 1409 insertions(+), 1521 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index 8dbbdb0..1d023b5 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -637,10 +637,11 @@ H5Z_filter_avail(H5Z_filter_t id) if(H5Z_table_g[i].id == id) HGOTO_DONE(TRUE) - if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) { if(H5Z_register(filter_info) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") HGOTO_DONE(TRUE) + } done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_filter_avail() */ diff --git a/test/dsets.c b/test/dsets.c index 0ca08e4..4088304 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -12,17 +12,17 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 * - * Purpose: Tests the dataset interface (H5D) + * Purpose: Tests the dataset interface (H5D) */ -#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ #define H5D_TESTING -#define H5FD_FRIEND /*suppress error about including H5FDpkg */ +#define H5FD_FRIEND /*suppress error about including H5FDpkg */ #define H5FD_TESTING -#define H5Z_FRIEND /*suppress error about including H5Zpkg */ +#define H5Z_FRIEND /*suppress error about including H5Zpkg */ #include "h5test.h" #include "H5srcdir.h" @@ -35,29 +35,29 @@ #endif const char *FILENAME[] = { - "dataset", /* 0 */ - "compact_dataset", /* 1 */ - "dset_offset", /* 2 */ - "max_compact_dataset", /* 3 */ - "simple", /* 4 */ - "set_local", /* 5 */ - "random_chunks", /* 6 */ - "huge_chunks", /* 7 */ - "chunk_cache", /* 8 */ - "big_chunk", /* 9 */ - "chunk_fast", /* 10 */ - "chunk_expand", /* 11 */ - "chunk_fixed", /* 12 */ + "dataset", /* 0 */ + "compact_dataset", /* 1 */ + "dset_offset", /* 2 */ + "max_compact_dataset", /* 3 */ + "simple", /* 4 */ + "set_local", /* 5 */ + "random_chunks", /* 6 */ + "huge_chunks", /* 7 */ + "chunk_cache", /* 8 */ + "big_chunk", /* 9 */ + "chunk_fast", /* 10 */ + "chunk_expand", /* 11 */ + "chunk_fixed", /* 12 */ "copy_dcpl_newfile",/* 13 */ "partial_chunks", /* 14 */ "layout_extend", /* 15 */ - "zero_chunk", /* 16 */ + "zero_chunk", /* 16 */ "chunk_single", /* 17 */ "swmr_non_latest", /* 18 */ "earray_hdr_fd", /* 19 */ "farray_hdr_fd", /* 20 */ "bt2_hdr_fd", /* 21 */ - "storage_size", /* 22 */ + "storage_size", /* 22 */ "dls_01_strings", /* 23 */ "power2up", /* 24 */ NULL @@ -68,39 +68,39 @@ const char *FILENAME[] = { #define FILE_DEFLATE_NAME "deflate.h5" /* Dataset names for testing filters */ -#define DSET_DEFAULT_NAME "default" -#define DSET_CHUNKED_NAME "chunked" -#define DSET_COMPACT_NAME "compact" -#define DSET_SIMPLE_IO_NAME "simple_io" -#define DSET_USERBLOCK_IO_NAME "userblock_io" -#define DSET_COMPACT_IO_NAME "compact_io" -#define DSET_COMPACT_MAX_NAME "max_compact" -#define DSET_COMPACT_MAX2_NAME "max_compact_2" -#define DSET_CONV_BUF_NAME "conv_buf" -#define DSET_TCONV_NAME "tconv" -#define DSET_DEFLATE_NAME "deflate" -#define DSET_SHUFFLE_NAME "shuffle" -#define DSET_FLETCHER32_NAME "fletcher32" -#define DSET_FLETCHER32_NAME_2 "fletcher32_2" -#define DSET_FLETCHER32_NAME_3 "fletcher32_3" -#define DSET_SHUF_DEF_FLET_NAME "shuffle+deflate+fletcher32" -#define DSET_SHUF_DEF_FLET_NAME_2 "shuffle+deflate+fletcher32_2" +#define DSET_DEFAULT_NAME "default" +#define DSET_CHUNKED_NAME "chunked" +#define DSET_COMPACT_NAME "compact" +#define DSET_SIMPLE_IO_NAME "simple_io" +#define DSET_USERBLOCK_IO_NAME "userblock_io" +#define DSET_COMPACT_IO_NAME "compact_io" +#define DSET_COMPACT_MAX_NAME "max_compact" +#define DSET_COMPACT_MAX2_NAME "max_compact_2" +#define DSET_CONV_BUF_NAME "conv_buf" +#define DSET_TCONV_NAME "tconv" +#define DSET_DEFLATE_NAME "deflate" +#define DSET_SHUFFLE_NAME "shuffle" +#define DSET_FLETCHER32_NAME "fletcher32" +#define DSET_FLETCHER32_NAME_2 "fletcher32_2" +#define DSET_FLETCHER32_NAME_3 "fletcher32_3" +#define DSET_SHUF_DEF_FLET_NAME "shuffle+deflate+fletcher32" +#define DSET_SHUF_DEF_FLET_NAME_2 "shuffle+deflate+fletcher32_2" #ifdef H5_HAVE_FILTER_SZIP -#define DSET_SZIP_NAME "szip" -#define DSET_SHUF_SZIP_FLET_NAME "shuffle+szip+fletcher32" -#define DSET_SHUF_SZIP_FLET_NAME_2 "shuffle+szip+fletcher32_2" +#define DSET_SZIP_NAME "szip" +#define DSET_SHUF_SZIP_FLET_NAME "shuffle+szip+fletcher32" +#define DSET_SHUF_SZIP_FLET_NAME_2 "shuffle+szip+fletcher32_2" #endif /* H5_HAVE_FILTER_SZIP */ -#define DSET_BOGUS_NAME "bogus" -#define DSET_MISSING_NAME "missing" -#define DSET_CAN_APPLY_NAME "can_apply" -#define DSET_CAN_APPLY_NAME2 "can_apply2" +#define DSET_BOGUS_NAME "bogus" +#define DSET_MISSING_NAME "missing" +#define DSET_CAN_APPLY_NAME "can_apply" +#define DSET_CAN_APPLY_NAME2 "can_apply2" #ifdef H5_HAVE_FILTER_SZIP -#define DSET_CAN_APPLY_SZIP_NAME "can_apply_szip" +#define DSET_CAN_APPLY_SZIP_NAME "can_apply_szip" #endif /* H5_HAVE_FILTER_SZIP */ -#define DSET_SET_LOCAL_NAME "set_local" -#define DSET_SET_LOCAL_NAME_2 "set_local_2" -#define DSET_ONEBYTE_SHUF_NAME "onebyte_shuffle" +#define DSET_SET_LOCAL_NAME "set_local" +#define DSET_SET_LOCAL_NAME_2 "set_local_2" +#define DSET_ONEBYTE_SHUF_NAME "onebyte_shuffle" #define DSET_NBIT_INT_NAME "nbit_int" #define DSET_NBIT_FLOAT_NAME "nbit_float" #define DSET_NBIT_DOUBLE_NAME "nbit_double" @@ -116,27 +116,27 @@ const char *FILENAME[] = { #define DSET_SCALEOFFSET_FLOAT_NAME_2 "scaleoffset_float_2" #define DSET_SCALEOFFSET_DOUBLE_NAME "scaleoffset_double" #define DSET_SCALEOFFSET_DOUBLE_NAME_2 "scaleoffset_double_2" -#define DSET_COMPARE_DCPL_NAME "compare_dcpl" -#define DSET_COMPARE_DCPL_NAME_2 "compare_dcpl_2" -#define DSET_COPY_DCPL_NAME_1 "copy_dcpl_1" -#define DSET_COPY_DCPL_NAME_2 "copy_dcpl_2" -#define COPY_DCPL_EXTFILE_NAME "ext_file" -#define DSET_DEPREC_NAME "deprecated" -#define DSET_DEPREC_NAME_CHUNKED "deprecated_chunked" -#define DSET_DEPREC_NAME_COMPACT "deprecated_compact" -#define DSET_DEPREC_NAME_FILTER "deprecated_filter" +#define DSET_COMPARE_DCPL_NAME "compare_dcpl" +#define DSET_COMPARE_DCPL_NAME_2 "compare_dcpl_2" +#define DSET_COPY_DCPL_NAME_1 "copy_dcpl_1" +#define DSET_COPY_DCPL_NAME_2 "copy_dcpl_2" +#define COPY_DCPL_EXTFILE_NAME "ext_file" +#define DSET_DEPREC_NAME "deprecated" +#define DSET_DEPREC_NAME_CHUNKED "deprecated_chunked" +#define DSET_DEPREC_NAME_COMPACT "deprecated_compact" +#define DSET_DEPREC_NAME_FILTER "deprecated_filter" /* Dataset names for testing Fixed Array Indexing */ -#define DSET_FIXED_MAX "DSET_FIXED_MAX" -#define DSET_FIXED_NOMAX "DSET_FIXED_NOMAX" -#define DSET_FIXED_BIG "DSET_FIXED_BIG" -#define POINTS 72 -#define POINTS_BIG 2500 +#define DSET_FIXED_MAX "DSET_FIXED_MAX" +#define DSET_FIXED_NOMAX "DSET_FIXED_NOMAX" +#define DSET_FIXED_BIG "DSET_FIXED_BIG" +#define POINTS 72 +#define POINTS_BIG 2500 /* Dataset names used for testing header flush dependencies */ #define DSET_EARRAY_HDR_FD "earray_hdr_fd" #define DSET_FARRAY_HDR_FD "farray_hdr_fd" -#define DSET_BT2_HDR_FD "bt2_hdr_fd" +#define DSET_BT2_HDR_FD "bt2_hdr_fd" /* Dataset names for testing Implicit Indexing */ #define DSET_SINGLE_MAX "DSET_SINGLE_MAX" @@ -146,14 +146,14 @@ const char *FILENAME[] = { #define SIXTY_FOUR_KB 65536 /* Temporary filter IDs used for testing */ -#define H5Z_FILTER_BOGUS 305 -#define H5Z_FILTER_CORRUPT 306 -#define H5Z_FILTER_CAN_APPLY_TEST 307 -#define H5Z_FILTER_SET_LOCAL_TEST 308 -#define H5Z_FILTER_DEPREC 309 -#define H5Z_FILTER_EXPAND 310 -#define H5Z_FILTER_CAN_APPLY_TEST2 311 -#define H5Z_FILTER_COUNT 312 +#define H5Z_FILTER_BOGUS 305 +#define H5Z_FILTER_CORRUPT 306 +#define H5Z_FILTER_CAN_APPLY_TEST 307 +#define H5Z_FILTER_SET_LOCAL_TEST 308 +#define H5Z_FILTER_DEPREC 309 +#define H5Z_FILTER_EXPAND 310 +#define H5Z_FILTER_CAN_APPLY_TEST2 311 +#define H5Z_FILTER_COUNT 312 /* Flags for testing filters */ #define DISABLE_FLETCHER32 0 @@ -182,15 +182,15 @@ const char *FILENAME[] = { /* Names for noencoder test */ #ifdef H5_HAVE_FILTER_SZIP -#define NOENCODER_FILENAME "noencoder.h5" +#define NOENCODER_FILENAME "noencoder.h5" #define NOENCODER_COPY_FILENAME "noencoder.h5.copy" -#define NOENCODER_TEST_DATASET "noencoder_tdset.h5" -#define NOENCODER_SZIP_DATASET "noencoder_szip_dset.h5" +#define NOENCODER_TEST_DATASET "noencoder_tdset.h5" +#define NOENCODER_SZIP_DATASET "noencoder_szip_dset.h5" #define NOENCODER_SZIP_SHUFF_FLETCH_DATASET "noencoder_szip_shuffle_fletcher_dset.h5" #endif /* H5_HAVE_FILTER_SZIP */ /* Names for zero-dim test */ -#define ZERODIM_DATASET "zerodim" +#define ZERODIM_DATASET "zerodim" #define ZERODIM_DATASET2 "zerodim2" /* Parameters for zero-dim test */ @@ -221,8 +221,8 @@ const char *FILENAME[] = { #define BYPASS_DATASET1 "Dset1" #define BYPASS_DATASET2 "Dset2" -#define T_BYPASS_DATASET1 "T_Dset1" -#define T_BYPASS_DATASET2 "T_Dset2" +#define T_BYPASS_DATASET1 "T_Dset1" +#define T_BYPASS_DATASET2 "T_Dset2" #define BYPASS_DIM 1000 #define BYPASS_CHUNK_DIM 500 @@ -234,7 +234,7 @@ const char *FILENAME[] = { #define EARRAY_CHUNK_DIM 3 #define EARRAY_EXTEND_INCR 15 #define EARRAY_MAX_EXTEND 75 - + /* Parameters for datasets in query storage size tests */ #define STORAGE_SIZE_DIM1 12 #define STORAGE_SIZE_DIM2 6 @@ -246,8 +246,8 @@ const char *FILENAME[] = { /* Shared global arrays */ #define DSET_DIM1 100 #define DSET_DIM2 200 -int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; -double points_dbl[DSET_DIM1][DSET_DIM2], check_dbl[DSET_DIM1][DSET_DIM2]; +int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; +double points_dbl[DSET_DIM1][DSET_DIM2], check_dbl[DSET_DIM1][DSET_DIM2]; size_t count_nbytes_read = 0; size_t count_nbytes_written = 0; @@ -266,29 +266,29 @@ const char *OLD_FILENAME[] = { /* Files created under 1.6 branch and 1.8 branch /* Local prototypes for filter functions */ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); static htri_t can_apply_bogus(hid_t dcpl_id, hid_t type_id, hid_t space_id); static herr_t set_local_bogus2(hid_t dcpl_id, hid_t type_id, hid_t space_id); static size_t filter_bogus2(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); static size_t filter_bogus3(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); static size_t filter_corrupt(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); static size_t filter_expand(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); static size_t filter_count(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ const H5Z_class2_t H5Z_COUNT[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_COUNT, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "count", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - filter_count, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_COUNT, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "count", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + filter_count, /* The actual filter function */ }}; @@ -300,12 +300,7 @@ const H5Z_class2_t H5Z_COUNT[1] = {{ * appropriate. * * Return: Success: Data chunk size - * * Failure: 0 - * - * Programmer: Neil Fortner - * Wednesday, March 17, 2010 - * *------------------------------------------------------------------------- */ static size_t @@ -323,26 +318,21 @@ filter_count(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, /*------------------------------------------------------------------------- - * Function: test_create - * - * Purpose: Attempts to create a dataset. + * Function: test_create * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 + * Purpose: Attempts to create a dataset. * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t test_create(hid_t file) { - hid_t dataset, space, small_space, create_parms; - hsize_t dims[2], small_dims[2]; - herr_t status; - hsize_t csize[2]; + hid_t dataset, space, small_space, create_parms; + hsize_t dims[2], small_dims[2]; + herr_t status; + hsize_t csize[2]; TESTING("create, open, close"); @@ -359,11 +349,11 @@ test_create(hid_t file) assert(space>=0); /* - * Create a dataset using the default dataset creation properties. We're + * Create a dataset using the default dataset creation properties. We're * not sure what they are, so we won't check. */ dataset = H5Dcreate2(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if(dataset < 0) goto error; /* Close the dataset */ @@ -379,13 +369,13 @@ test_create(hid_t file) * reporting. */ H5E_BEGIN_TRY { - dataset = H5Dcreate2(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + dataset = H5Dcreate2(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; if(dataset >= 0) { - H5_FAILED(); - puts(" Library allowed overwrite of existing dataset."); - goto error; + H5_FAILED(); + puts(" Library allowed overwrite of existing dataset."); + goto error; } /* @@ -402,12 +392,12 @@ test_create(hid_t file) * reporting. */ H5E_BEGIN_TRY { - dataset = H5Dopen2(file, "does_not_exist", H5P_DEFAULT); + dataset = H5Dopen2(file, "does_not_exist", H5P_DEFAULT); } H5E_END_TRY; if(dataset >= 0) { - H5_FAILED(); - puts(" Opened a non-existent dataset."); - goto error; + H5_FAILED(); + puts(" Opened a non-existent dataset."); + goto error; } /* @@ -424,12 +414,12 @@ test_create(hid_t file) assert(status >= 0); H5E_BEGIN_TRY { dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, - H5P_DEFAULT, create_parms, H5P_DEFAULT); + H5P_DEFAULT, create_parms, H5P_DEFAULT); } H5E_END_TRY; if(dataset >= 0) { - H5_FAILED(); - puts(" Opened a dataset with incorrect chunking parameters."); - goto error; + H5_FAILED(); + puts(" Opened a dataset with incorrect chunking parameters."); + goto error; } csize[0] = 5; @@ -438,7 +428,7 @@ test_create(hid_t file) assert(status >= 0); dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, - H5P_DEFAULT, create_parms, H5P_DEFAULT); + H5P_DEFAULT, create_parms, H5P_DEFAULT); if(dataset < 0) goto error; H5Pclose(create_parms); @@ -475,19 +465,14 @@ test_create(hid_t file) /*------------------------------------------------------------------------- - * Function: test_simple_io - * - * Purpose: Tests simple I/O. That is, reading and writing a complete - * multi-dimensional array without data type or data space - * conversions, without compression, and stored contiguously. + * Function: test_simple_io * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Robb Matzke - * Wednesday, December 10, 1997 + * Purpose: Tests simple I/O. That is, reading and writing a complete + * multi-dimensional array without data type or data space + * conversions, without compression, and stored contiguously. * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t @@ -592,8 +577,8 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support continuous address space"); + SKIPPED(); + puts(" Current VFD doesn't support continuous address space"); } /* end else */ return 0; @@ -616,26 +601,21 @@ error: /*------------------------------------------------------------------------- - * Function: test_userblock_offset - * - * Purpose: Tests H5Dget_offset when user block exists. + * Function: test_userblock_offset * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * Wednesday, November 27, 2002 + * Purpose: Tests H5Dget_offset when user block exists. * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) { char filename[FILENAME_BUF_SIZE]; - hid_t file = -1, fcpl = -1, dataset = -1, space = -1; - int i, j; - hsize_t dims[2]; + hid_t file = -1, fcpl = -1, dataset = -1, space = -1; + int i, j; + hsize_t dims[2]; int f = -1; haddr_t offset; int rdata[DSET_DIM1][DSET_DIM2]; @@ -648,9 +628,9 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) if((fcpl=H5Pcreate(H5P_FILE_CREATE)) < 0) goto error; if(H5Pset_userblock(fcpl, (hsize_t)USER_BLOCK) < 0) goto error; - if(new_format) - if(H5Pset_file_space_page_size(fcpl, (hsize_t)USER_BLOCK) < 0) - goto error; + if(new_format) + if(H5Pset_file_space_page_size(fcpl, (hsize_t)USER_BLOCK) < 0) + goto error; if((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) goto error; @@ -705,8 +685,8 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support continuous address space"); + SKIPPED(); + puts(" Current VFD doesn't support continuous address space"); } /* end else */ return 0; @@ -735,12 +715,7 @@ error: * compact dataset. * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Raymond Lu - * August 8, 2002 - * *------------------------------------------------------------------------- */ static herr_t @@ -749,7 +724,7 @@ test_compact_io(hid_t fapl) hid_t file, dataset, space, plist; hsize_t dims[2]; int wbuf[16][8], rbuf[16][8]; - char filename[FILENAME_BUF_SIZE]; + char filename[FILENAME_BUF_SIZE]; int i, j, n; TESTING("compact dataset I/O"); @@ -834,10 +809,6 @@ test_compact_io(hid_t fapl) * * Return: Success: 0 * Failure: -1 - * - * Programmer: Raymond Lu - * August 8, 2002 - * *------------------------------------------------------------------------- */ static herr_t @@ -851,7 +822,7 @@ test_max_compact(hid_t fapl) size_t compact_size; int *wbuf = NULL; int *rbuf = NULL; - char filename[FILENAME_BUF_SIZE]; + char filename[FILENAME_BUF_SIZE]; int n; size_t u; @@ -988,31 +959,28 @@ error: * Function: test_layout_extend * * Purpose: Verify that the creation of extendible dataset with dataspace: - * cur_dims < max_dims (max_dims can be fixed size or H5S_UNLIMITED) - * will behave as follows: - * H5D_COMPACT layout: fail - * H5D_CONTIGUOUS layout: fail - * H5D_CHUNKED layout: succeed + * cur_dims < max_dims (max_dims can be fixed size or H5S_UNLIMITED) + * will behave as follows: + * H5D_COMPACT layout: fail + * H5D_CONTIGUOUS layout: fail + * H5D_CHUNKED layout: succeed * * Return: Success: 0 * Failure: -1 - * - * Programmer: Vailin Choi; August 2010 - * *------------------------------------------------------------------------- */ static herr_t test_layout_extend(hid_t fapl) { - char filename[FILENAME_BUF_SIZE]; /* File name */ - hid_t fid = -1; /* File id */ - hid_t sid_fix = -1, sid_unlim = -1; /* Dataspace id */ + char filename[FILENAME_BUF_SIZE]; /* File name */ + hid_t fid = -1; /* File id */ + hid_t sid_fix = -1, sid_unlim = -1; /* Dataspace id */ hid_t dcpl_compact = -1, dcpl_contig = -1, dcpl_chunked = -1; /* Dataset creation property list id */ - hid_t did_fixed = -1, did_unlim = -1; /* Dataset id */ - hsize_t cur_size[1] = {10}; /* Current size of dataspace */ - hsize_t max_unlim[1] = {H5S_UNLIMITED}; /* Maximum size of dataspace (unlimited) */ - hsize_t max_fix[1] = {100}; /* Maximum size of dataspace (fixed) */ - hsize_t chunk_dim[1] = {10}; /* Chunk size */ + hid_t did_fixed = -1, did_unlim = -1; /* Dataset id */ + hsize_t cur_size[1] = {10}; /* Current size of dataspace */ + hsize_t max_unlim[1] = {H5S_UNLIMITED}; /* Maximum size of dataspace (unlimited) */ + hsize_t max_fix[1] = {100}; /* Maximum size of dataspace (fixed) */ + hsize_t chunk_dim[1] = {10}; /* Chunk size */ TESTING("extendible dataset with various layout"); @@ -1035,14 +1003,14 @@ test_layout_extend(hid_t fapl) /* Create dataset with extendible dataspace (fixed max_dims) should fail */ H5E_BEGIN_TRY { - if(H5Dcreate2(fid, "compact", H5T_NATIVE_INT, sid_fix, H5P_DEFAULT, dcpl_compact, H5P_DEFAULT) != FAIL) - TEST_ERROR + if(H5Dcreate2(fid, "compact", H5T_NATIVE_INT, sid_fix, H5P_DEFAULT, dcpl_compact, H5P_DEFAULT) != FAIL) + TEST_ERROR } H5E_END_TRY; /* Create dataset with extendible dataspace (unlimited max_dims) should fail */ H5E_BEGIN_TRY { - if(H5Dcreate2(fid, "compact", H5T_NATIVE_INT, sid_unlim, H5P_DEFAULT, dcpl_compact, H5P_DEFAULT) != FAIL) - TEST_ERROR + if(H5Dcreate2(fid, "compact", H5T_NATIVE_INT, sid_unlim, H5P_DEFAULT, dcpl_compact, H5P_DEFAULT) != FAIL) + TEST_ERROR } H5E_END_TRY; /* Create property list for contiguous dataset creation */ @@ -1053,14 +1021,14 @@ test_layout_extend(hid_t fapl) /* Create dataset with extendible dataspace (fixed max_dims) should fail */ H5E_BEGIN_TRY { - if(H5Dcreate2(fid, "contig", H5T_NATIVE_INT, sid_fix, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT) != FAIL) - TEST_ERROR + if(H5Dcreate2(fid, "contig", H5T_NATIVE_INT, sid_fix, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT) != FAIL) + TEST_ERROR } H5E_END_TRY; /* Create dataset with extendible dataspace (unlimited max_dims) should fail*/ H5E_BEGIN_TRY { - if(H5Dcreate2(fid, "contig", H5T_NATIVE_INT, sid_unlim, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT) != FAIL) - TEST_ERROR + if(H5Dcreate2(fid, "contig", H5T_NATIVE_INT, sid_unlim, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT) != FAIL) + TEST_ERROR } H5E_END_TRY; /* Create property list for chunked dataset creation */ @@ -1072,11 +1040,11 @@ test_layout_extend(hid_t fapl) /* Create dataset with extendible dataspace (fixed max_dims) should succeed */ if((did_fixed = H5Dcreate2(fid, "chunked_fixed", H5T_NATIVE_INT, sid_fix, H5P_DEFAULT, dcpl_chunked, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Create dataset with extendible dataspace (unlimited max_dims) should succeed */ if((did_unlim = H5Dcreate2(fid, "chunked_unlim", H5T_NATIVE_INT, sid_unlim, H5P_DEFAULT, dcpl_chunked, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Closing */ if(H5Sclose(sid_fix) < 0) FAIL_STACK_ERROR @@ -1111,17 +1079,12 @@ error: /*------------------------------------------------------------------------- - * Function: test_conv_buffer - * - * Purpose: Test size of data type conversion buffer. - * - * Return: Success: 0 + * Function: test_conv_buffer * - * Failure: -1 - * - * Programmer: Raymond Lu - * Monday, May 12, 2003 + * Purpose: Test size of data type conversion buffer. * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t @@ -1255,26 +1218,21 @@ error: /*------------------------------------------------------------------------- - * Function: test_tconv - * - * Purpose: Test some simple data type conversion stuff. - * - * Return: Success: 0 + * Function: test_tconv * - * Failure: -1 - * - * Programmer: Robb Matzke - * Wednesday, January 14, 1998 + * Purpose: Test some simple data type conversion stuff. * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t test_tconv(hid_t file) { - char *out = NULL, *in = NULL; - hsize_t dims[1]; - hid_t space = -1, dataset = -1; - int i; + char *out = NULL, *in = NULL; + hsize_t dims[1]; + hid_t space = -1, dataset = -1; + int i; if ((out = (char *)HDmalloc((size_t)(4 * 1000 * 1000))) == NULL) goto error; @@ -1297,7 +1255,7 @@ test_tconv(hid_t file) /* Create the data set */ if((dataset = H5Dcreate2(file, DSET_TCONV_NAME, H5T_STD_I32LE, space, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* Write the data to the dataset */ @@ -1345,27 +1303,23 @@ error: /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS, /* Filter id number */ + H5Z_FILTER_BOGUS, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "bogus", /* Filter name for debugging */ + "bogus", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - filter_bogus, /* The actual filter function */ + filter_bogus, /* The actual filter function */ }}; /*------------------------------------------------------------------------- - * Function: can_apply_bogus - * - * Purpose: A bogus 'can apply' callback that returns 0 for H5T_NATIVE_DOUBLE - * dataype, but returns 1 for all other datatypes + * Function: can_apply_bogus * - * Return: Success: Described above - * Failure: 0 - * - * Programmer: Quincey Koziol - * Friday, April 5, 2003 + * Purpose: A bogus 'can apply' callback that returns 0 for H5T_NATIVE_DOUBLE + * dataype, but returns 1 for all other datatypes * + * Return: Success: Described above + * Failure: 0 *------------------------------------------------------------------------- */ static htri_t @@ -1381,17 +1335,12 @@ can_apply_bogus(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSE /*------------------------------------------------------------------------- - * Function: filter_bogus - * - * Purpose: A bogus compression method that doesn't do anything. - * - * Return: Success: Data chunk size - * - * Failure: 0 + * Function: filter_bogus * - * Programmer: Robb Matzke - * Tuesday, April 21, 1998 + * Purpose: A bogus compression method that doesn't do anything. * + * Return: Success: Data chunk size + * Failure: 0 *------------------------------------------------------------------------- */ static size_t @@ -1404,18 +1353,14 @@ filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, /*------------------------------------------------------------------------- - * Function: set_local_bogus2 + * Function: set_local_bogus2 * - * Purpose: A 'set local' callback that stores the size of the datatype - * and adds it to all the H5T_NATIVE_INT values during - * filter operation. - * - * Return: Success: non-negative - * Failure: negative - * - * Programmer: Quincey Koziol - * Friday, April 5, 2003 + * Purpose: A 'set local' callback that stores the size of the datatype + * and adds it to all the H5T_NATIVE_INT values during + * filter operation. * + * Return: Success: non-negative + * Failure: negative *------------------------------------------------------------------------- */ static herr_t @@ -1454,19 +1399,15 @@ set_local_bogus2(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) /*------------------------------------------------------------------------- - * Function: filter_bogus2 - * - * Purpose: A filter method that adds a value to data values on writing - * (if the parameter is set), but does not modify data values on - * reading (so that correct operation of the filter can be - * checked). + * Function: filter_bogus2 * - * Return: Success: Data chunk size - * Failure: 0 - * - * Programmer: Quincey Koziol - * Monday, April 7, 2003 + * Purpose: A filter method that adds a value to data values on writing + * (if the parameter is set), but does not modify data values on + * reading (so that correct operation of the filter can be + * checked). * + * Return: Success: Data chunk size + * Failure: 0 *------------------------------------------------------------------------- */ static size_t @@ -1512,17 +1453,12 @@ filter_bogus2(unsigned int flags, size_t cd_nelmts, /*------------------------------------------------------------------------- - * Function: filter_bogus3 - * - * Purpose: A bogus compression method that returns a failure. + * Function: filter_bogus3 * - * Return: Success: Data chunk size - * - * Failure: 0 - * - * Programmer: Raymond Lu - * 4 August 2010 + * Purpose: A bogus compression method that returns a failure. * + * Return: Success: Data chunk size + * Failure: 0 *------------------------------------------------------------------------- */ static size_t @@ -1536,29 +1472,24 @@ filter_bogus3(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts /* This message derives from H5Z */ const H5Z_class2_t H5Z_CORRUPT[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_CORRUPT, /* Filter id number */ + H5Z_FILTER_CORRUPT, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "corrupt", /* Filter name for debugging */ + "corrupt", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - filter_corrupt, /* The actual filter function */ + filter_corrupt, /* The actual filter function */ }}; /*------------------------------------------------------------------------- - * Function: filter_corrupt - * - * Purpose: For testing Fletcher32 checksum. modify data slightly during - * writing so that when data is read back, the checksum should - * fail. + * Function: filter_corrupt * - * Return: Success: Data chunk size - * - * Failure: 0 - * - * Programmer: Raymond Lu - * Jan 14, 2003 + * Purpose: For testing Fletcher32 checksum. modify data slightly during + * writing so that when data is read back, the checksum should + * fail. * + * Return: Success: Data chunk size + * Failure: 0 *------------------------------------------------------------------------- */ static size_t @@ -1581,7 +1512,7 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts, if(offset > nbytes || (offset + length) > nbytes || length < sizeof(unsigned int)) TEST_ERROR - if(NULL == (data = HDmalloc((size_t)length))) + if(NULL == (data = HDmalloc((size_t)length))) TEST_ERROR HDmemset(data, (int)value, (size_t)length); @@ -1615,10 +1546,6 @@ error: * Purpose: Callback function to handle checksum failure. Let it continue. * * Return: continue - * - * Programmer: Raymond Lu - * Jan 14, 2003 - * *------------------------------------------------------------------------- */ static H5Z_cb_return_t @@ -1638,10 +1565,6 @@ filter_cb_cont(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNU * Purpose: Callback function to handle checksum failure. Let it fail. * * Return: fail - * - * Programmer: Raymond Lu - * Jan 14, 2003 - * *------------------------------------------------------------------------- */ static H5Z_cb_return_t @@ -1656,35 +1579,31 @@ filter_cb_fail(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNU /*------------------------------------------------------------------------- - * Function: test_filter_internal - * - * Purpose: Tests dataset compression. If compression is requested when - * it hasn't been compiled into the library (such as when - * updating an existing compressed dataset) then data is sent to - * the file uncompressed but no errors are returned. + * Function: test_filter_internal * - * Return: Success: 0 - * Failure: -1 - * - * Programmer: Robb Matzke - * Wednesday, April 15, 1998 + * Purpose: Tests dataset compression. If compression is requested when + * it hasn't been compiled into the library (such as when + * updating an existing compressed dataset) then data is sent to + * the file uncompressed but no errors are returned. * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, int corrupted, hsize_t *dset_size) { - hid_t dataset; /* Dataset ID */ - hid_t dxpl; /* Dataset xfer property list ID */ - hid_t write_dxpl; /* Dataset xfer property list ID for writing */ - hid_t sid; /* Dataspace ID */ - const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ - const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */ - const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ - void *tconv_buf = NULL; /* Temporary conversion buffer */ - size_t i, j, n; /* Local index variables */ - herr_t status; /* Error status */ + hid_t dataset; /* Dataset ID */ + hid_t dxpl; /* Dataset xfer property list ID */ + hid_t write_dxpl; /* Dataset xfer property list ID for writing */ + hid_t sid; /* Dataspace ID */ + const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ + const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */ + const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ + void *tconv_buf = NULL; /* Temporary conversion buffer */ + size_t i, j, n; /* Local index variables */ + herr_t status; /* Error status */ /* Create the data space */ if((sid = H5Screate_simple(2, size, NULL)) < 0) goto error; @@ -1716,7 +1635,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, /* Create the dataset */ if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, - dcpl, H5P_DEFAULT)) < 0) goto error; + dcpl, H5P_DEFAULT)) < 0) goto error; PASSED(); @@ -1727,18 +1646,18 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, TESTING(" filters (uninitialized read)"); if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) - TEST_ERROR; + TEST_ERROR; for(i=0; i<(size_t)size[0]; i++) { - for(j=0; j<(size_t)size[1]; j++) { - if(0!=check[i][j]) { - H5_FAILED(); - printf(" Read a non-zero value.\n"); - printf(" At index %lu,%lu\n", - (unsigned long)i, (unsigned long)j); - goto error; - } - } + for(j=0; j<(size_t)size[1]; j++) { + if(0!=check[i][j]) { + H5_FAILED(); + printf(" Read a non-zero value.\n"); + printf(" At index %lu,%lu\n", + (unsigned long)i, (unsigned long)j); + goto error; + } + } } PASSED(); @@ -1750,13 +1669,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, TESTING(" filters (write)"); for(i=n=0; i=0) TEST_ERROR; - } else { + } + else { if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) - TEST_ERROR; + TEST_ERROR; /* Check that the values read are the same as the values written */ for(i=0; i=0) TEST_ERROR; - } else { + } + else { /* Read the dataset back and check it */ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) - TEST_ERROR; + TEST_ERROR; /* Check that the values read are the same as the values written */ for(i=0; i=0) TEST_ERROR; - } else { + } + else { if(H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0) - TEST_ERROR; + TEST_ERROR; /* Check that the values read are the same as the values written */ for(i=0; i<(size_t)hs_size[0]; i++) { - for(j=0; j<(size_t)hs_size[1]; j++) { - if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] != - check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) { - H5_FAILED(); - fprintf(stderr," Read different values than written.\n"); - fprintf(stderr," At index %lu,%lu\n", - (unsigned long)((size_t)hs_offset[0]+i), - (unsigned long)((size_t)hs_offset[1]+j)); - fprintf(stderr," At original: %d\n", - (int)points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]); - fprintf(stderr," At returned: %d\n", - (int)check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]); - goto error; - } - } + for(j=0; j<(size_t)hs_size[1]; j++) { + if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] != + check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) { + H5_FAILED(); + fprintf(stderr," Read different values than written.\n"); + fprintf(stderr," At index %lu,%lu\n", + (unsigned long)((size_t)hs_offset[0]+i), + (unsigned long)((size_t)hs_offset[1]+j)); + fprintf(stderr," At original: %d\n", + (int)points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]); + fprintf(stderr," At returned: %d\n", + (int)check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]); + goto error; + } + } } } @@ -2004,18 +1926,14 @@ error: } /*------------------------------------------------------------------------- - * Function: test_filter_noencoder - * - * Purpose: Tests filters with no encoder present. Ensures that data - * can still be decoded correctly and that errors are thrown - * when the application tries to write. - * - * Return: Success: 0 - * Failure: -1 + * Function: test_filter_noencoder * - * Programmer: Nat Furrer and James Laird - * Monday, June 7, 2004 + * Purpose: Tests filters with no encoder present. Ensures that data + * can still be decoded correctly and that errors are thrown + * when the application tries to write. * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ #ifdef H5_HAVE_FILTER_SZIP @@ -2086,7 +2004,7 @@ test_filter_noencoder(const char *dset_name) */ dims = 20; /* Dataset is originally of size 10 */ H5E_BEGIN_TRY{ - err = H5Dset_extent(dset_id, &dims); + err = H5Dset_extent(dset_id, &dims); }H5E_END_TRY if(err >= 0) goto error; @@ -2095,7 +2013,7 @@ test_filter_noencoder(const char *dset_name) * the filter does not have an encoder. */ H5E_BEGIN_TRY{ - err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, test_ints); + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, test_ints); }H5E_END_TRY if(err >= 0) goto error; @@ -2133,10 +2051,6 @@ error: * * Return: Success: 0 * Failure: -1 - * - * Programmer: Nat Furrer and James Laird - * Thursday, June 10, 2004 - * *------------------------------------------------------------------------- */ static herr_t @@ -2200,16 +2114,12 @@ error: } /*------------------------------------------------------------------------- - * Function: test_filters - * - * Purpose: Tests dataset filter. - * - * Return: Success: 0 - * Failure: -1 + * Function: test_filters * - * Programmer: Robb Matzke - * Wednesday, April 15, 1998 + * Purpose: Tests dataset filter. * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t @@ -2219,27 +2129,27 @@ H5_ATTR_UNUSED #endif /* H5_HAVE_FILTER_SZIP */ fapl) { - hid_t dc; /* Dataset creation property list ID */ + hid_t dc; /* Dataset creation property list ID */ const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */ - hsize_t null_size; /* Size of dataset with null filter */ + hsize_t null_size; /* Size of dataset with null filter */ - hsize_t fletcher32_size; /* Size of dataset with Fletcher32 checksum */ + hsize_t fletcher32_size; /* Size of dataset with Fletcher32 checksum */ unsigned data_corrupt[3]; /* position and length of data to be corrupted */ #ifdef H5_HAVE_FILTER_DEFLATE - hsize_t deflate_size; /* Size of dataset with deflate filter */ + hsize_t deflate_size; /* Size of dataset with deflate filter */ #endif /* H5_HAVE_FILTER_DEFLATE */ #ifdef H5_HAVE_FILTER_SZIP - hsize_t szip_size; /* Size of dataset with szip filter */ - unsigned szip_options_mask=H5_SZIP_NN_OPTION_MASK; - unsigned szip_pixels_per_block=4; + hsize_t szip_size; /* Size of dataset with szip filter */ + unsigned szip_options_mask = H5_SZIP_NN_OPTION_MASK; + unsigned szip_pixels_per_block = 4; #endif /* H5_HAVE_FILTER_SZIP */ hsize_t shuffle_size; /* Size of dataset with shuffle filter */ #if(defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) - hsize_t combo_size; /* Size of dataset with multiple filters */ + hsize_t combo_size; /* Size of dataset with multiple filters */ #endif /* defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP */ /* test the H5Zget_filter_info function */ @@ -2334,21 +2244,23 @@ H5_ATTR_UNUSED if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - puts(""); - if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; - if(test_filter_internal(file,DSET_SZIP_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&szip_size) < 0) goto error; + puts(""); + if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; + if(test_filter_internal(file,DSET_SZIP_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&szip_size) < 0) goto error; if(H5Pclose (dc) < 0) goto error; - } else { - SKIPPED(); + } + else { + SKIPPED(); } TESTING("szip filter (without encoder)"); if( h5_szip_can_encode() != 1) { - puts(""); - if(test_filter_noencoder(NOENCODER_SZIP_DATASET) < 0) goto error; - } else { - SKIPPED(); + puts(""); + if(test_filter_noencoder(NOENCODER_SZIP_DATASET) < 0) goto error; + } + else { + SKIPPED(); } #else /* H5_HAVE_FILTER_SZIP */ @@ -2422,22 +2334,24 @@ H5_ATTR_UNUSED if(H5Pset_fletcher32 (dc) < 0) goto error; if(H5Pset_shuffle (dc) < 0) goto error; - /* Make sure encoding is enabled */ + /* Make sure encoding is enabled */ if( h5_szip_can_encode() == 1) { - puts(""); - if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; - if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error; - } else { - SKIPPED(); + puts(""); + if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; + if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error; + } + else { + SKIPPED(); } TESTING("shuffle+szip+checksum filters(checksum first, without encoder)"); if( h5_szip_can_encode() != 1) { - puts(""); - if(test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET) < 0) goto error; - } else { - SKIPPED(); + puts(""); + if(test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET) < 0) goto error; + } + else { + SKIPPED(); } /* Clean up objects used for this test */ @@ -2447,20 +2361,20 @@ H5_ATTR_UNUSED /* Make sure encoding is enabled */ if( h5_szip_can_encode() == 1) { - puts(""); - if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - if(H5Pset_shuffle (dc) < 0) goto error; - if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; - if(H5Pset_fletcher32 (dc) < 0) goto error; - - if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error; + puts(""); + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if(H5Pset_shuffle (dc) < 0) goto error; + if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; + if(H5Pset_fletcher32 (dc) < 0) goto error; - /* Clean up objects used for this test */ - if(H5Pclose (dc) < 0) goto error; + if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error; - } else { - SKIPPED(); + /* Clean up objects used for this test */ + if(H5Pclose (dc) < 0) goto error; + } + else { + SKIPPED(); } #else /* H5_HAVE_FILTER_SZIP */ @@ -2476,16 +2390,12 @@ error: /*------------------------------------------------------------------------- - * Function: test_missing_filter - * - * Purpose: Tests library behavior when filter is missing + * Function: test_missing_filter * - * Return: Success: 0 - * Failure: -1 - * - * Programmer: Quincey Koziol - * Thursday, November 14, 2002 + * Purpose: Tests library behavior when filter is missing * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t @@ -2610,16 +2520,16 @@ test_missing_filter(hid_t file) /* Compare data */ /* Check that the values read are the same as the values written */ for(i=0; i<(size_t)dims[0]; i++) { - for(j=0; j<(size_t)dims[1]; j++) { - if(points[i][j] != check[i][j]) { - H5_FAILED(); - printf(" Line %d: Read different values than written.\n",__LINE__); - printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j)); - printf(" At original: %d\n",points[i][j]); - printf(" At returned: %d\n",check[i][j]); - goto error; - } /* end if */ - } /* end for */ + for(j=0; j<(size_t)dims[1]; j++) { + if(points[i][j] != check[i][j]) { + H5_FAILED(); + printf(" Line %d: Read different values than written.\n",__LINE__); + printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j)); + printf(" At original: %d\n",points[i][j]); + printf(" At returned: %d\n",check[i][j]); + goto error; + } /* end if */ + } /* end for */ } /* end for */ /* Close dataset */ @@ -2716,30 +2626,25 @@ error: /*------------------------------------------------------------------------- - * Function: test_onebyte_shuffle - * - * Purpose: Tests the 8-bit array with shuffling algorithm. - * The shuffled array should be the same result as - * that before the shuffling. - * - * Return: Success: 0 + * Function: test_onebyte_shuffle * - * Failure: -1 - * - * Programmer: Kent Yang - * Wednesday, Nov. 13th, 2002 + * Purpose: Tests the 8-bit array with shuffling algorithm. + * The shuffled array should be the same result as + * that before the shuffling. * + * Return: Success: 0 + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t test_onebyte_shuffle(hid_t file) { - hid_t dataset, space,dc; - const hsize_t size[2] = {10, 20}; - const hsize_t chunk_size[2] = {10, 20}; - unsigned char orig_data[10][20]; - unsigned char new_data[10][20]; - size_t i, j; + hid_t dataset, space,dc; + const hsize_t size[2] = {10, 20}; + const hsize_t chunk_size[2] = {10, 20}; + unsigned char orig_data[10][20]; + unsigned char new_data[10][20]; + size_t i, j; TESTING("8-bit shuffling (setup)"); @@ -2753,11 +2658,11 @@ test_onebyte_shuffle(hid_t file) /* Create the dataset */ if((dataset = H5Dcreate2(file, DSET_ONEBYTE_SHUF_NAME, H5T_NATIVE_UCHAR, - space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; + space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; for(i= 0;i< 10; i++) - for(j = 0; j < 20; j++) - orig_data[i][j] = (unsigned char)HDrandom(); + for(j = 0; j < 20; j++) + orig_data[i][j] = (unsigned char)HDrandom(); PASSED(); @@ -2768,9 +2673,8 @@ test_onebyte_shuffle(hid_t file) */ TESTING("8-bit shuffling (write)"); - if(H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, - orig_data) < 0) - goto error; + if(H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) + goto error; PASSED(); @@ -2781,21 +2685,20 @@ test_onebyte_shuffle(hid_t file) TESTING("8-bit shuffling (read)"); /* Read the dataset back */ - if(H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, - new_data) < 0) - goto error; + if(H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) + goto error; /* Check that the values read are the same as the values written */ for(i=0; i<(size_t)size[0]; i++) { - for(j=0; j<(size_t)size[1]; j++) { - if(new_data[i][j] != orig_data[i][j]) { - H5_FAILED(); - printf(" Read different values than written.\n"); - printf(" At index %lu,%lu\n", - (unsigned long)i, (unsigned long)j); - goto error; - } - } + for(j=0; j<(size_t)size[1]; j++) { + if(new_data[i][j] != orig_data[i][j]) { + H5_FAILED(); + printf(" Read different values than written.\n"); + printf(" At index %lu,%lu\n", + (unsigned long)i, (unsigned long)j); + goto error; + } + } } /*---------------------------------------------------------------------- @@ -2820,12 +2723,7 @@ error: * Purpose: Tests the integer datatype for nbit filter * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Xiaowen Wu - * Wednesday, Dec. 23th, 2004 - * *------------------------------------------------------------------------- */ static herr_t @@ -2871,14 +2769,14 @@ test_nbit_int(hid_t file) /* Initialize data, assuming size of long long >= size of int */ for(i= 0;i< (size_t)size[0]; i++) - for(j = 0; j < (size_t)size[1]; j++) { - power = HDpow(2.0f, (double)(precision - 1)); - orig_data[i][j] = (int)(((long long)HDrandom() % (long long)power) << offset); + for(j = 0; j < (size_t)size[1]; j++) { + power = HDpow(2.0f, (double)(precision - 1)); + orig_data[i][j] = (int)(((long long)HDrandom() % (long long)power) << offset); - /* even-numbered values are negtive */ - if((i*size[1]+j+1)%2 == 0) - orig_data[i][j] = -orig_data[i][j]; - } + /* even-numbered values are negtive */ + if((i*size[1]+j+1)%2 == 0) + orig_data[i][j] = -orig_data[i][j]; + } PASSED(); @@ -2889,8 +2787,7 @@ test_nbit_int(hid_t file) */ TESTING(" nbit int (write)"); - if(H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, - orig_data) < 0) + if(H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); @@ -2901,8 +2798,7 @@ test_nbit_int(hid_t file) TESTING(" nbit int (read)"); /* Read the dataset back */ - if(H5Dread(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, - new_data) < 0) + if(H5Dread(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; /* Check that the values read are the same as the values written @@ -2945,12 +2841,7 @@ error: * Purpose: Tests the float datatype of nbit filter * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Xiaowen Wu - * Friday, Jan. 21th, 2005 - * *------------------------------------------------------------------------- */ static herr_t @@ -2966,7 +2857,7 @@ test_nbit_float(hid_t file) {-49140.0f, 2350.25f, -3.2110596e-1f, 6.4998865e-5f, -0.0f}}; float new_data[2][5]; size_t precision, offset; - size_t i, j; + size_t i, j; TESTING(" nbit float (setup)"); @@ -3068,12 +2959,7 @@ error: * Purpose: Tests the double datatype of nbit filter * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Xiaowen Wu - * Wednesday, Jan. 26th, 2005 - * *------------------------------------------------------------------------- */ static herr_t @@ -3093,12 +2979,12 @@ test_nbit_double(hid_t file) H5_DOUBLE(1.2677579992621376e-61), H5_DOUBLE(64568.289448797700), H5_DOUBLE(-1.0619721778839084e-75) - }, + }, { H5_DOUBLE(2.1499497833454840e+56), - H5_DOUBLE(6.6562295504670740e-3), - H5_DOUBLE(-1.5747263393432150), - H5_DOUBLE(1.0711093225222612), + H5_DOUBLE(6.6562295504670740e-3), + H5_DOUBLE(-1.5747263393432150), + H5_DOUBLE(1.0711093225222612), H5_DOUBLE(-9.8971679387636870e-1) }}; double new_data[2][5]; @@ -3205,12 +3091,7 @@ error: * Purpose: Tests the simple version array datatype for nbit filter * * Return: Success: 0 - * * Failure: -1 - * - * Programmer: Xiaowen Wu - * Tuesday, Jan. 18th, 2005 - * *------------------------------------------------------------------------- */ static herr_t @@ -3362,7 +3243,7 @@ test_nbit_compound(hid_t file) hid_t dataset, space, dc; const hsize_t size[2] = {2, 5}; const hsize_t chunk_size[2] = {2, 5}; - const float float_val[2][5] = {{188384.0F, 19.103516F, -1.0831790e9F, -84.242188F, 5.2045898F}, + const float float_val[2][5] = {{188384.0F, 19.103516F, -1.0831790e9F, -84.242188F, 5.2045898F}, {-49140.0F, 2350.25F, -3.2110596e-1F, 6.4998865e-5F, -0.0F}}; atomic orig_data[2][5]; atomic new_data[2][5]; @@ -3796,7 +3677,7 @@ test_nbit_compound_2(hid_t file) /* Check that the values read are the same as the values written * Use mask for checking the significant bits, ignoring the padding bits */ - /* The original code + /* The original code * i_mask = ~((unsigned)~0 << (precision[0] + offset[0])) & ((unsigned)~0 << offset[0]); * left shift a 32-bit integer for 32-bit. The result is undefined by C language. A user * discovered it using clang compiler with -fcatch-undefined-behavior option (see Issue 7674 @@ -4134,7 +4015,7 @@ test_nbit_int_size(hid_t file) printf(" line %d: H5Pset_order failed\n",__LINE__); goto error; } /* end if */ - + if(H5Tset_size(datatype, 4)<0) { H5_FAILED(); printf(" line %d: H5Pset_size failed\n",__LINE__); @@ -4190,7 +4071,7 @@ test_nbit_int_size(hid_t file) * Create a new dataset within the file. */ if((dataset = H5Dcreate2 (file, DSET_NBIT_INT_SIZE_NAME, datatype, - dataspace, H5P_DEFAULT, + dataspace, H5P_DEFAULT, dset_create_props, H5P_DEFAULT))<0) { H5_FAILED(); printf(" line %d: H5dwrite failed\n",__LINE__); @@ -4207,7 +4088,7 @@ test_nbit_int_size(hid_t file) goto error; } /* end if */ - /* + /* * Get the precision of the data type */ if((precision = H5Tget_precision(datatype)) == 0) { @@ -4216,10 +4097,10 @@ test_nbit_int_size(hid_t file) goto error; } /* end if */ - /* + /* * The size of the dataset after compression should around 2 * DSET_DIM1 * DSET_DIM2 */ - if((dset_size = H5Dget_storage_size(dataset)) < DSET_DIM1*DSET_DIM2*(precision/8) || + if((dset_size = H5Dget_storage_size(dataset)) < DSET_DIM1*DSET_DIM2*(precision/8) || dset_size > DSET_DIM1*DSET_DIM2*(precision/8) + 1*KB) { H5_FAILED(); HDfprintf(stdout, " Line %d: wrong dataset size: %Hu\n",__LINE__, dset_size); @@ -4243,7 +4124,7 @@ error: /*------------------------------------------------------------------------- * Function: test_nbit_flt_size * - * Purpose: Tests the correct size of the floating-number datatype for + * Purpose: Tests the correct size of the floating-number datatype for * nbit filter * * Return: Success: 0 @@ -4334,15 +4215,15 @@ test_nbit_flt_size(hid_t file) printf(" line %d: H5Pset_order failed\n",__LINE__); goto error; } /* end if */ - + if(H5Tset_ebias(datatype, 31)<0) { H5_FAILED(); printf(" line %d: H5Pset_size failed\n",__LINE__); goto error; } /* end if */ - /* - * Initiliaze data buffer with random data + /* + * Initiliaze data buffer with random data */ for (i=0; i < DSET_DIM1; i++) for (j=0; j < DSET_DIM2; j++) @@ -4388,7 +4269,7 @@ test_nbit_flt_size(hid_t file) * Create a new dataset within the file. */ if((dataset = H5Dcreate2 (file, DSET_NBIT_FLT_SIZE_NAME, datatype, - dataspace, H5P_DEFAULT, + dataspace, H5P_DEFAULT, dset_create_props, H5P_DEFAULT))<0) { H5_FAILED(); printf(" line %d: H5dwrite failed\n",__LINE__); @@ -4405,7 +4286,7 @@ test_nbit_flt_size(hid_t file) goto error; } /* end if */ - /* + /* * Get the precision of the data type */ if((precision = H5Tget_precision(datatype)) == 0) { @@ -4414,10 +4295,10 @@ test_nbit_flt_size(hid_t file) goto error; } /* end if */ - /* + /* * The size of the dataset after compression should around 2 * DSET_DIM1 * DSET_DIM2 */ - if((dset_size = H5Dget_storage_size(dataset)) < DSET_DIM1*DSET_DIM2*(precision/8) || + if((dset_size = H5Dget_storage_size(dataset)) < DSET_DIM1*DSET_DIM2*(precision/8) || dset_size > DSET_DIM1*DSET_DIM2*(precision/8) + 1*KB) { H5_FAILED(); HDfprintf(stdout, " Line %d: wrong dataset size: %Hu\n",__LINE__, dset_size); @@ -5162,18 +5043,18 @@ error: /*------------------------------------------------------------------------- - * Function: test_multiopen + * Function: test_multiopen * - * Purpose: Tests that a bug no longer exists. If a dataset is opened - * twice and one of the handles is used to extend the dataset, - * then the other handle should return the new size when - * queried. + * Purpose: Tests that a bug no longer exists. If a dataset is opened + * twice and one of the handles is used to extend the dataset, + * then the other handle should return the new size when + * queried. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 9, 1998 * *------------------------------------------------------------------------- @@ -5181,10 +5062,10 @@ error: static herr_t test_multiopen (hid_t file) { - hid_t dcpl = -1, space = -1, dset1 = -1, dset2 = -1; - hsize_t cur_size[1] = {10}; - static hsize_t max_size[1] = {H5S_UNLIMITED}; - hsize_t tmp_size[1]; + hid_t dcpl = -1, space = -1, dset1 = -1, dset2 = -1; + hsize_t cur_size[1] = {10}; + static hsize_t max_size[1] = {H5S_UNLIMITED}; + hsize_t tmp_size[1]; TESTING("multi-open with extending"); @@ -5204,9 +5085,9 @@ test_multiopen (hid_t file) if((space = H5Dget_space(dset2)) < 0) goto error; if(H5Sget_simple_extent_dims(space, tmp_size, NULL) < 0) goto error; if(cur_size[0] != tmp_size[0]) { - H5_FAILED(); - printf(" Got %d instead of %d!\n", (int)tmp_size[0], (int)cur_size[0]); - goto error; + H5_FAILED(); + printf(" Got %d instead of %d!\n", (int)tmp_size[0], (int)cur_size[0]); + goto error; } /* end if */ if(H5Dclose(dset1) < 0) goto error; @@ -5219,25 +5100,25 @@ test_multiopen (hid_t file) error: H5E_BEGIN_TRY { - H5Dclose(dset1); - H5Dclose(dset2); - H5Sclose(space); - H5Pclose(dcpl); + H5Dclose(dset1); + H5Dclose(dset2); + H5Sclose(space); + H5Pclose(dcpl); } H5E_END_TRY; return -1; } /*------------------------------------------------------------------------- - * Function: test_types + * Function: test_types * - * Purpose: Make some datasets with various types so we can test h5ls. + * Purpose: Make some datasets with various types so we can test h5ls. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, June 7, 1999 * *------------------------------------------------------------------------- @@ -5245,10 +5126,10 @@ test_multiopen (hid_t file) static herr_t test_types(hid_t file) { - hid_t grp=-1, type=-1, space=-1, dset=-1; - size_t i; - hsize_t nelmts; - unsigned char buf[32]; + hid_t grp=-1, type=-1, space=-1, dset=-1; + size_t i; + hsize_t nelmts; + unsigned char buf[32]; TESTING("various datatypes"); if((grp = H5Gcreate2(file, "typetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; @@ -5256,12 +5137,12 @@ test_types(hid_t file) /* bitfield_1 */ nelmts = sizeof(buf); if((type=H5Tcopy(H5T_STD_B8LE)) < 0 || - (space=H5Screate_simple(1, &nelmts, NULL)) < 0 || - (dset=H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + (space=H5Screate_simple(1, &nelmts, NULL)) < 0 || + (dset=H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; for(i=0; i= 5 || (j % 10) >= 5) { - if(rdata2[i][j] != 911) { - printf(" Line %d: Incorrect value, rdata2[%u][%u] = %d\n", - __LINE__,(unsigned)i, (unsigned)j, rdata2[i][j]); - TEST_ERROR; - } /* end if */ - } /* end if */ - else { - if(rdata2[i][j] != wdata2[i][j]) { - printf(" Line %d: Incorrect value, wdata2[%u][%u] = %d, rdata2[%u][%u] = %d\n", - __LINE__,(unsigned)i, (unsigned)j, wdata2[i][j],(unsigned)i, (unsigned)j, rdata2[i][j]); - TEST_ERROR; - } /* end if */ - } /* end else */ - } /* end for */ + for(j = 0; j < MISSING_CHUNK_DIM; j++) { + + if((i % 10) >= 5 || (j % 10) >= 5) { + if(rdata2[i][j] != 911) { + printf(" Line %d: Incorrect value, rdata2[%u][%u] = %d\n", + __LINE__,(unsigned)i, (unsigned)j, rdata2[i][j]); + TEST_ERROR; + } /* end if */ + } /* end if */ + else { + if(rdata2[i][j] != wdata2[i][j]) { + printf(" Line %d: Incorrect value, wdata2[%u][%u] = %d, rdata2[%u][%u] = %d\n", + __LINE__,(unsigned)i, (unsigned)j, wdata2[i][j],(unsigned)i, (unsigned)j, rdata2[i][j]); + TEST_ERROR; + } /* end if */ + } /* end else */ + } /* end for */ } /* end for */ /* Close everything */ @@ -6992,7 +6873,7 @@ error: /*------------------------------------------------------------------------- * Function: test_random_chunks_real * - * Purpose: Tests that write/read on randomly selected chunks + * Purpose: Tests that write/read on randomly selected chunks * * * Return: Success: 0 @@ -7013,7 +6894,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) check2[20][20]; hsize_t coord[NPOINTS][2]; hsize_t dsize[2]={100,100}, dmax[2]={H5S_UNLIMITED, H5S_UNLIMITED}, csize[2]={10,10}, nsize[2]={200,200}; - hsize_t fixed_dmax[2] = {1000, 1000}; + hsize_t fixed_dmax[2] = {1000, 1000}; hsize_t msize[1]={NPOINTS}; const char dname[]="dataset"; int chunk_row, chunk_col; @@ -7101,8 +6982,8 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) if(idx_type != H5D_CHUNK_IDX_FARRAY) FAIL_PUTS_ERROR("should be using Fixed Array as index"); } /* end else */ - } else if(idx_type != H5D_CHUNK_IDX_BTREE) - FAIL_PUTS_ERROR("should be using v1 B-tree as index"); + } else if(idx_type != H5D_CHUNK_IDX_BTREE) + FAIL_PUTS_ERROR("should be using v1 B-tree as index"); /* Get dataset dataspace */ if((s = H5Dget_space(d)) < 0) TEST_ERROR; @@ -7136,9 +7017,9 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) /* Create dataspace with unlimited maximum dimensions */ if(early_alloc) { - if((s = H5Screate_simple(2, dsize, fixed_dmax)) < 0) TEST_ERROR; + if((s = H5Screate_simple(2, dsize, fixed_dmax)) < 0) TEST_ERROR; } else - if((s = H5Screate_simple(2, dsize, dmax)) < 0) TEST_ERROR; + if((s = H5Screate_simple(2, dsize, dmax)) < 0) TEST_ERROR; /* Create dataset creation property list */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; @@ -7158,13 +7039,13 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) /* Verify index type */ if(low == H5F_LIBVER_LATEST) { - if(early_alloc) { - if(idx_type != H5D_CHUNK_IDX_NONE) - FAIL_PUTS_ERROR("should be using implicit indexing"); - } else if(idx_type != H5D_CHUNK_IDX_BT2) - FAIL_PUTS_ERROR("should be using v2 B-tree as index"); - } else if(idx_type != H5D_CHUNK_IDX_BTREE) - FAIL_PUTS_ERROR("should be using v1 B-tree as index"); + if(early_alloc) { + if(idx_type != H5D_CHUNK_IDX_NONE) + FAIL_PUTS_ERROR("should be using implicit indexing"); + } else if(idx_type != H5D_CHUNK_IDX_BT2) + FAIL_PUTS_ERROR("should be using v2 B-tree as index"); + } else if(idx_type != H5D_CHUNK_IDX_BTREE) + FAIL_PUTS_ERROR("should be using v1 B-tree as index"); /* Extend both dimensions of the dataset */ if(H5Dset_extent(d, nsize) < 0) TEST_ERROR; @@ -7269,8 +7150,8 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) if(idx_type != H5D_CHUNK_IDX_FARRAY) FAIL_PUTS_ERROR("should be using Fixed Array as index"); } /* end else */ - } else if(idx_type != H5D_CHUNK_IDX_BTREE) - FAIL_PUTS_ERROR("should be using v1 B-tree as index"); + } else if(idx_type != H5D_CHUNK_IDX_BTREE) + FAIL_PUTS_ERROR("should be using v1 B-tree as index"); /* Extend both dimensions of the dataset */ if(H5Dset_extent(d, nsize) < 0) TEST_ERROR; @@ -7360,16 +7241,16 @@ error: /*------------------------------------------------------------------------- * Function: test_random_chunks * - * Purpose: Tests that write/read on randomly selected chunks + * Purpose: Tests that write/read on randomly selected chunks * First file: * One dataset has fixed dimensions without max. dims & H5D_ALLOC_TIME_EARLY * One dataset has fixed dimensions without max. dims & default alloc time - * Second file: - * One extendible dataset with unlimited max. dims & H5D_ALLOC_TIME_EARLY - * One extendible dataset with unlimited max. dims & default alloc time - * third file: - * one extendible dataset with fixed max. dims & H5D_ALLOC_TIME_EARLY - * one extendible dataset with fixed max. dims & default alloc time + * Second file: + * One extendible dataset with unlimited max. dims & H5D_ALLOC_TIME_EARLY + * One extendible dataset with unlimited max. dims & default alloc time + * third file: + * one extendible dataset with fixed max. dims & H5D_ALLOC_TIME_EARLY + * one extendible dataset with fixed max. dims & default alloc time * * All the datasets in second & third files are extended before write/read operations * @@ -7409,11 +7290,11 @@ set_local_deprec(hid_t H5_ATTR_UNUSED dcpl_id, hid_t H5_ATTR_UNUSED type_id, hid /* Old style H5Z_class_t, essentially a copy of the "bogus" filter */ const H5Z_class1_t H5Z_DEPREC[1] = {{ - H5Z_FILTER_DEPREC, /* Filter id number */ - "deprec", /* Filter name for debugging */ + H5Z_FILTER_DEPREC, /* Filter id number */ + "deprec", /* Filter name for debugging */ can_apply_deprec, /* The "can apply" callback */ set_local_deprec, /* The "set local" callback */ - filter_bogus, /* The actual filter function */ + filter_bogus, /* The actual filter function */ }}; @@ -7433,11 +7314,11 @@ const H5Z_class1_t H5Z_DEPREC[1] = {{ static herr_t test_deprec(hid_t file) { - hid_t dataset, space, small_space, create_parms, dcpl; - hsize_t dims[2], small_dims[2]; + hid_t dataset, space, small_space, create_parms, dcpl; + hsize_t dims[2], small_dims[2]; hsize_t deprec_size; - herr_t status; - hsize_t csize[2]; + herr_t status; + hsize_t csize[2]; TESTING("deprecated API routines"); @@ -7454,7 +7335,7 @@ test_deprec(hid_t file) assert(space>=0); /* - * Create a dataset using the default dataset creation properties. We're + * Create a dataset using the default dataset creation properties. We're * not sure what they are, so we won't check. */ if((dataset = H5Dcreate1(file, DSET_DEPREC_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT)) < 0) goto error; @@ -7468,13 +7349,13 @@ test_deprec(hid_t file) * reporting. */ H5E_BEGIN_TRY { - dataset = H5Dcreate1(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space, - H5P_DEFAULT); + dataset = H5Dcreate1(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space, + H5P_DEFAULT); } H5E_END_TRY; if(dataset >= 0) { - H5_FAILED(); - puts(" Library allowed overwrite of existing dataset."); - goto error; + H5_FAILED(); + puts(" Library allowed overwrite of existing dataset."); + goto error; } /* @@ -7490,12 +7371,12 @@ test_deprec(hid_t file) * reporting. */ H5E_BEGIN_TRY { - dataset = H5Dopen1(file, "does_not_exist"); + dataset = H5Dopen1(file, "does_not_exist"); } H5E_END_TRY; if(dataset >= 0) { - H5_FAILED(); - puts(" Opened a non-existent dataset."); - goto error; + H5_FAILED(); + puts(" Opened a non-existent dataset."); + goto error; } /* @@ -7539,12 +7420,12 @@ test_deprec(hid_t file) assert(status >= 0); H5E_BEGIN_TRY { dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, - create_parms); + create_parms); } H5E_END_TRY; if(dataset >= 0) { - H5_FAILED(); - puts(" Opened a dataset with incorrect chunking parameters."); - goto error; + H5_FAILED(); + puts(" Opened a dataset with incorrect chunking parameters."); + goto error; } csize[0] = 5; @@ -7649,7 +7530,7 @@ test_huge_chunks(hid_t fapl) ret = H5Pset_chunk(dcpl, 1, &chunk_dim); } H5E_END_TRY; if(ret >= 0) - FAIL_PUTS_ERROR(" Set chunk size with too large of chunk dimensions.") + FAIL_PUTS_ERROR(" Set chunk size with too large of chunk dimensions.") /* Try to set too large of a chunk for n-D dataset (# of elements) */ chunk_dim2[0] = TOO_HUGE_CHUNK_DIM2_0; @@ -7659,7 +7540,7 @@ test_huge_chunks(hid_t fapl) ret = H5Pset_chunk(dcpl, 3, chunk_dim2); } H5E_END_TRY; if(ret >= 0) - FAIL_PUTS_ERROR(" Set chunk size with too large of chunk dimensions.") + FAIL_PUTS_ERROR(" Set chunk size with too large of chunk dimensions.") /* Set 1-D chunk size */ chunk_dim = HUGE_CHUNK_DIM; @@ -7674,7 +7555,7 @@ test_huge_chunks(hid_t fapl) dsid = H5Dcreate2(fid, HUGE_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); } H5E_END_TRY; if(dsid >= 0) - FAIL_PUTS_ERROR(" 1-D Dataset with too large of chunk dimensions created.") + FAIL_PUTS_ERROR(" 1-D Dataset with too large of chunk dimensions created.") /* Close 1-D dataspace */ if(H5Sclose(sid) < 0) FAIL_STACK_ERROR @@ -7697,7 +7578,7 @@ test_huge_chunks(hid_t fapl) dsid = H5Dcreate2(fid, HUGE_DATASET2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); } H5E_END_TRY; if(dsid >= 0) - FAIL_PUTS_ERROR(" n-D Dataset with too large of chunk dimensions created.") + FAIL_PUTS_ERROR(" n-D Dataset with too large of chunk dimensions created.") /* Close n-D dataspace */ if(H5Sclose(sid) < 0) FAIL_STACK_ERROR @@ -7950,24 +7831,24 @@ static herr_t test_big_chunks_bypass_cache(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t fapl_local = -1; /* File access property list ID */ - hid_t dcpl = -1, t_dcpl = -1; /* Dataset creation property list ID */ - hid_t sid = -1, t_sid = -1; /* Dataspace ID */ - hid_t mid; /* Memory space ID */ - hid_t dsid = -1, t_dsid = -1; /* Dataset ID */ - hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */ + hid_t fid = -1; /* File ID */ + hid_t fapl_local = -1; /* File access property list ID */ + hid_t dcpl = -1, t_dcpl = -1; /* Dataset creation property list ID */ + hid_t sid = -1, t_sid = -1; /* Dataspace ID */ + hid_t mid; /* Memory space ID */ + hid_t dsid = -1, t_dsid = -1; /* Dataset ID */ + hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */ hsize_t t_dim[2], t_max[2], t_chunk_dim[2]; /* Dataset and chunk dimensions */ - size_t rdcc_nelmts, rdcc_nbytes; /* Chunk cache parameters */ - int fvalue = BYPASS_FILL_VALUE; /* Fill value */ - hsize_t count, stride, offset, block; /* Setting for hyperslab (1-D) */ + size_t rdcc_nelmts, rdcc_nbytes; /* Chunk cache parameters */ + int fvalue = BYPASS_FILL_VALUE; /* Fill value */ + hsize_t count, stride, offset, block; /* Setting for hyperslab (1-D) */ hsize_t t_count[2], t_stride[2], t_offset[2], t_block[2]; /* Setting for hyperslab (2-D) */ - /* Buffers for reading and writing data (1-D) */ - int *wdata = NULL, *rdata1 = NULL, *rdata2 = NULL; - /* Buffer for reading and writing data (2-D) */ + /* Buffers for reading and writing data (1-D) */ + int *wdata = NULL, *rdata1 = NULL, *rdata2 = NULL; + /* Buffer for reading and writing data (2-D) */ static int t_wdata[BYPASS_CHUNK_DIM/2][BYPASS_CHUNK_DIM/2], t_rdata1[BYPASS_DIM][BYPASS_DIM], t_rdata2[BYPASS_CHUNK_DIM/2][BYPASS_CHUNK_DIM/2]; - int i, j; /* Local index variables */ + int i, j; /* Local index variables */ H5F_libver_t low; /* File format low bound */ H5D_chunk_index_t idx_type, t_idx_type; /* Dataset chunk index types */ @@ -8030,13 +7911,13 @@ test_big_chunks_bypass_cache(hid_t fapl) /* Chunk index type expected depends on whether we are using the latest version of the format */ if(low == H5F_LIBVER_LATEST) { - /* Verify index type */ - if(idx_type != H5D_CHUNK_IDX_FARRAY) FAIL_PUTS_ERROR("should be using Fixed Array as index"); - if(t_idx_type != H5D_CHUNK_IDX_BT2) FAIL_PUTS_ERROR("should be using v2 B-tree as index"); + /* Verify index type */ + if(idx_type != H5D_CHUNK_IDX_FARRAY) FAIL_PUTS_ERROR("should be using Fixed Array as index"); + if(t_idx_type != H5D_CHUNK_IDX_BT2) FAIL_PUTS_ERROR("should be using v2 B-tree as index"); } else { - /* Verify index type */ - if(idx_type != H5D_CHUNK_IDX_BTREE) FAIL_PUTS_ERROR("should be using v1 B-tree as index"); - if(t_idx_type != H5D_CHUNK_IDX_BTREE) FAIL_PUTS_ERROR("should be using v1 B-tree as index"); + /* Verify index type */ + if(idx_type != H5D_CHUNK_IDX_BTREE) FAIL_PUTS_ERROR("should be using v1 B-tree as index"); + if(t_idx_type != H5D_CHUNK_IDX_BTREE) FAIL_PUTS_ERROR("should be using v1 B-tree as index"); } /* end else */ /* Select first chunk to write the data */ @@ -8064,8 +7945,8 @@ test_big_chunks_bypass_cache(hid_t fapl) /* Initialize data to write for 2-D dataset */ for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++) - for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++) - t_wdata[i][j] = j; + for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++) + t_wdata[i][j] = j; /* Set up memory space for the 2-D dataset */ mid = H5Screate_simple(2, t_block, NULL); @@ -8109,22 +7990,22 @@ test_big_chunks_bypass_cache(hid_t fapl) /* Verify data for the first 2-D dataset */ for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++) - for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++) - if(t_rdata1[i][j] != j) { - printf(" Read different values than written in the 1st chunk.\n"); - printf(" At line %d and index (%d, %d), t_rdata1 = %d. It should be %d.\n", - __LINE__, i, j, t_rdata1[i][j], j); - TEST_ERROR - } /* end if */ + for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++) + if(t_rdata1[i][j] != j) { + printf(" Read different values than written in the 1st chunk.\n"); + printf(" At line %d and index (%d, %d), t_rdata1 = %d. It should be %d.\n", + __LINE__, i, j, t_rdata1[i][j], j); + TEST_ERROR + } /* end if */ for(i = BYPASS_CHUNK_DIM / 2; i < BYPASS_DIM; i++) - for(j = BYPASS_CHUNK_DIM / 2; j < BYPASS_DIM; j++) - if(t_rdata1[i][j] != fvalue) { - printf(" Read different values than written in the 2nd chunk.\n"); - printf(" At line %d and index (%d, %d), t_rdata1 = %d. It should be %d.\n", - __LINE__, i, j, t_rdata1[i][j], fvalue); + for(j = BYPASS_CHUNK_DIM / 2; j < BYPASS_DIM; j++) + if(t_rdata1[i][j] != fvalue) { + printf(" Read different values than written in the 2nd chunk.\n"); + printf(" At line %d and index (%d, %d), t_rdata1 = %d. It should be %d.\n", + __LINE__, i, j, t_rdata1[i][j], fvalue); TEST_ERROR - } /* end if */ + } /* end if */ /* Close the first 1-D & 2-D datasets */ if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR @@ -8160,13 +8041,13 @@ test_big_chunks_bypass_cache(hid_t fapl) * half chunk should bypass the cache because the chunk is bigger than * the cache size. */ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, rdata2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Dread(t_dsid, H5T_NATIVE_INT, mid, t_sid, H5P_DEFAULT, t_rdata2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Verify data for the second 1-D dataset */ for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++) - if(rdata2[i] != i) { + if(rdata2[i] != i) { printf(" Read different values than written in the chunk.\n"); printf(" At line %d and index %d, rdata2 = %d. It should be %d.\n", __LINE__, i, rdata2[i], i); TEST_ERROR @@ -8174,13 +8055,13 @@ test_big_chunks_bypass_cache(hid_t fapl) /* Verify data for the second 2-D dataset */ for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++) - for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++) - if(t_rdata2[i][j] != j) { - printf(" Read different values than written in the chunk.\n"); - printf(" At line %d and index (%d, %d), t_rdata2 = %d. It should be %d.\n", - __LINE__, i, j, t_rdata2[i][j], j); - TEST_ERROR - } /* end if */ + for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++) + if(t_rdata2[i][j] != j) { + printf(" Read different values than written in the chunk.\n"); + printf(" At line %d and index (%d, %d), t_rdata2 = %d. It should be %d.\n", + __LINE__, i, j, t_rdata2[i][j], j); + TEST_ERROR + } /* end if */ /* Close IDs */ if(H5Sclose(sid) < 0) FAIL_STACK_ERROR @@ -8285,10 +8166,10 @@ test_chunk_fast(const char *env_h5_driver, hid_t fapl) /* Loop over using SWMR access to write */ for(swmr = 0; swmr <= 1; swmr++) { - int compress; /* Whether chunks should be compressed */ + int compress; /* Whether chunks should be compressed */ /* SWMR is now supported with/without latest format: */ - /* (1) write+latest-format (2) SWMR-write+non-latest-format */ + /* (1) write+latest-format (2) SWMR-write+non-latest-format */ /* Skip this iteration if SWMR I/O is not supported for the VFD specified * by the environment variable. @@ -8300,10 +8181,10 @@ test_chunk_fast(const char *env_h5_driver, hid_t fapl) /* Loop over compressing chunks */ for(compress = 0; compress <= 1; compress++) #else - /* Loop over without compression */ + /* Loop over without compression */ for(compress = 0; compress <= 0; compress++) #endif /* H5_HAVE_FILTER_DEFLATE */ - { + { H5D_alloc_time_t alloc_time; /* Storage allocation time */ /* Loop over storage allocation time */ @@ -8572,11 +8453,11 @@ error: * Function: test_reopen_chunk_fast * * Purpose: To verify a bug in extensible arrays as chunk index. - * When the dataset is closed in H5D_close(), the pointer - * to the extensible array struct in the layout message - * is copied via H5D_flush_real() before H5D_chunk_dest(). - * This causes an abort from "Assertion `ea->hdr' failed." - * later when the dataset is re-opened and read. + * When the dataset is closed in H5D_close(), the pointer + * to the extensible array struct in the layout message + * is copied via H5D_flush_real() before H5D_chunk_dest(). + * This causes an abort from "Assertion `ea->hdr' failed." + * later when the dataset is re-opened and read. * * Return: Success: 0 * Failure: -1 @@ -8596,8 +8477,8 @@ test_reopen_chunk_fast(hid_t fapl) hid_t scalar_sid = -1;/* Scalar dataspace ID */ hid_t dsid = -1; /* Dataset ID */ hsize_t dim, max_dim, chunk_dim; /* Dataset and chunk dimensions */ - hsize_t hs_offset; /* Hyperslab offset */ - hsize_t hs_size; /* Hyperslab size */ + hsize_t hs_offset; /* Hyperslab offset */ + hsize_t hs_size; /* Hyperslab size */ H5D_alloc_time_t alloc_time; /* Storage allocation time */ unsigned write_elem, read_elem; /* Element written/read */ unsigned u; /* Local index variable */ @@ -8608,71 +8489,71 @@ test_reopen_chunk_fast(hid_t fapl) /* Loop over storage allocation time */ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) { - /* Create file */ - if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR - - /* Create dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR - - /* Set chunking */ - chunk_dim = 10; - if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR - - /* Set fill time */ - if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) FAIL_STACK_ERROR - - /* Set allocation time */ - if(H5Pset_alloc_time(dcpl, alloc_time) < 0) FAIL_STACK_ERROR - - /* Create scalar dataspace */ - if((scalar_sid = H5Screate(H5S_SCALAR)) < 0) FAIL_STACK_ERROR - - /* Create 1-D dataspace */ - dim = 100; - max_dim = H5S_UNLIMITED; - if((sid = H5Screate_simple(1, &dim, &max_dim)) < 0) FAIL_STACK_ERROR - - /* Create chunked dataset */ - if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_UINT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR - - /* Fill existing elements */ - hs_size = 1; - for(u = 0; u < 100; u++) { - /* Select a single element in the dataset */ - hs_offset = u; - if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, &hs_offset, NULL, &hs_size, NULL) < 0) - FAIL_STACK_ERROR - /* Write element to dataset */ - write_elem = u; - if(H5Dwrite(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &write_elem) < 0) - FAIL_STACK_ERROR - } /* end for */ - - /* Close everything */ - if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR - - /* Reopen the dataset */ - if((dsid = H5Dopen2(fid, "dset", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - hs_size = 1; - - /* Read from dataset */ - for(u = 0; u < 100; u++) { - /* Select a single element in the dataset */ - hs_offset = u; - if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, &hs_offset, NULL, &hs_size, NULL) < 0) - FAIL_STACK_ERROR - - /* Read element from dataset */ - if(H5Dread(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &read_elem) < 0) - FAIL_STACK_ERROR - } /* end for */ - - if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR - if(H5Sclose(sid) < 0) FAIL_STACK_ERROR - if(H5Sclose(scalar_sid) < 0) FAIL_STACK_ERROR - if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR - if(H5Fclose(fid) < 0) FAIL_STACK_ERROR + /* Create file */ + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR + + /* Create dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR + + /* Set chunking */ + chunk_dim = 10; + if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR + + /* Set fill time */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) FAIL_STACK_ERROR + + /* Set allocation time */ + if(H5Pset_alloc_time(dcpl, alloc_time) < 0) FAIL_STACK_ERROR + + /* Create scalar dataspace */ + if((scalar_sid = H5Screate(H5S_SCALAR)) < 0) FAIL_STACK_ERROR + + /* Create 1-D dataspace */ + dim = 100; + max_dim = H5S_UNLIMITED; + if((sid = H5Screate_simple(1, &dim, &max_dim)) < 0) FAIL_STACK_ERROR + + /* Create chunked dataset */ + if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_UINT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Fill existing elements */ + hs_size = 1; + for(u = 0; u < 100; u++) { + /* Select a single element in the dataset */ + hs_offset = u; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, &hs_offset, NULL, &hs_size, NULL) < 0) + FAIL_STACK_ERROR + /* Write element to dataset */ + write_elem = u; + if(H5Dwrite(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &write_elem) < 0) + FAIL_STACK_ERROR + } /* end for */ + + /* Close everything */ + if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR + + /* Reopen the dataset */ + if((dsid = H5Dopen2(fid, "dset", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + hs_size = 1; + + /* Read from dataset */ + for(u = 0; u < 100; u++) { + /* Select a single element in the dataset */ + hs_offset = u; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, &hs_offset, NULL, &hs_size, NULL) < 0) + FAIL_STACK_ERROR + + /* Read element from dataset */ + if(H5Dread(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &read_elem) < 0) + FAIL_STACK_ERROR + } /* end for */ + + if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR + if(H5Sclose(sid) < 0) FAIL_STACK_ERROR + if(H5Sclose(scalar_sid) < 0) FAIL_STACK_ERROR + if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR + if(H5Fclose(fid) < 0) FAIL_STACK_ERROR } /* end for */ @@ -8801,12 +8682,12 @@ error: /* This message derives from H5Z */ const H5Z_class2_t H5Z_EXPAND[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_EXPAND, /* Filter id number */ + H5Z_FILTER_EXPAND, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ - "expand", /* Filter name for debugging */ + "expand", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - filter_expand, /* The actual filter function */ + filter_expand, /* The actual filter function */ }}; /* Global "expansion factor" for filter_expand() routine */ @@ -8819,15 +8700,15 @@ static size_t filter_expand_factor_g = 0; * Purpose: For testing library's behavior when a filter expands a chunk * too much. * - * Note: This filter doesn't actually re-allocate the buffer to be - * larger, it just changes the buffer size to a value that's too - * large. The library should throw an error before using the - * incorrect buffer information. + * Note: This filter doesn't actually re-allocate the buffer to be + * larger, it just changes the buffer size to a value that's too + * large. The library should throw an error before using the + * incorrect buffer information. * - * Return: Success: Data chunk size - * Failure: 0 + * Return: Success: Data chunk size + * Failure: 0 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Mar 31, 2009 * *------------------------------------------------------------------------- @@ -8880,22 +8761,22 @@ static herr_t test_chunk_expand(hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t dcpl = -1, dcpl2 = -1; /* Dataset creation property list ID */ - hid_t sid = -1, sid2 = -1; /* Dataspace ID */ - hid_t scalar_sid = -1; /* Scalar dataspace ID */ - hid_t dsid = -1, dsid2 = -1; /* Dataset ID */ - hsize_t dim, max_dim, chunk_dim; /* Dataset and chunk dimensions */ - hsize_t dim2[2], max_dim2[2], chunk_dim2[2]; /* Dataset and chunk dimensions */ - H5D_chunk_index_t idx_type, idx_type2; /* Dataset chunk index type */ - H5F_libver_t low, high; /* File format bounds */ - hsize_t hs_offset, hs_offset2[2]; /* Hyperslab offset */ - hsize_t hs_size, hs_size2[2]; /* Hyperslab size */ - H5D_alloc_time_t alloc_time; /* Storage allocation time */ - unsigned write_elem, read_elem; /* Element written/read */ - unsigned write_elem2, read_elem2; /* Element written/read */ - unsigned u; /* Local index variable */ - herr_t status; /* Generic return value */ + hid_t fid = -1; /* File ID */ + hid_t dcpl = -1, dcpl2 = -1; /* Dataset creation property list ID */ + hid_t sid = -1, sid2 = -1; /* Dataspace ID */ + hid_t scalar_sid = -1; /* Scalar dataspace ID */ + hid_t dsid = -1, dsid2 = -1; /* Dataset ID */ + hsize_t dim, max_dim, chunk_dim; /* Dataset and chunk dimensions */ + hsize_t dim2[2], max_dim2[2], chunk_dim2[2]; /* Dataset and chunk dimensions */ + H5D_chunk_index_t idx_type, idx_type2; /* Dataset chunk index type */ + H5F_libver_t low, high; /* File format bounds */ + hsize_t hs_offset, hs_offset2[2]; /* Hyperslab offset */ + hsize_t hs_size, hs_size2[2]; /* Hyperslab size */ + H5D_alloc_time_t alloc_time; /* Storage allocation time */ + unsigned write_elem, read_elem; /* Element written/read */ + unsigned write_elem2, read_elem2; /* Element written/read */ + unsigned u; /* Local index variable */ + herr_t status; /* Generic return value */ TESTING("filter expanding chunks too much"); @@ -8905,8 +8786,8 @@ test_chunk_expand(hid_t fapl) if(H5Pget_libver_bounds(fapl, &low, &high) < 0) FAIL_STACK_ERROR if(sizeof(size_t) <= 4 && low != H5F_LIBVER_LATEST) { - SKIPPED(); - puts(" Current machine can't test for error w/old file format"); + SKIPPED(); + puts(" Current machine can't test for error w/old file format"); } /* end if */ else { /* Register "expansion" filter */ @@ -9261,25 +9142,25 @@ error: /*------------------------------------------------------------------------- * Function: test_fixed_array * - * Purpose: Tests support for Fixed Array and Implicit Indexing + * Purpose: Tests support for Fixed Array and Implicit Indexing * - * Create the following 3 datasets: - * 1) extendible chunked dataset with fixed max. dims - * 2) extendible chunked dataset with NULL max. dims - * 3) extendible chunked dataset with same max. dims - * (Note that the third dataset is created with bigger size for curr & max. dims - * so that Fixed Array Indexing with paging is exercised) + * Create the following 3 datasets: + * 1) extendible chunked dataset with fixed max. dims + * 2) extendible chunked dataset with NULL max. dims + * 3) extendible chunked dataset with same max. dims + * (Note that the third dataset is created with bigger size for curr & max. dims + * so that Fixed Array Indexing with paging is exercised) * * Repeat the following test with/without compression filter * Repeat the following test with H5D_ALLOC_TIME_EARLY/H5D_ALLOC_TIME_LATE/H5D_ALLOC_TIME_INCR - * For the old format, - * verify that v1 btree indexing type is used for - * all 3 datasets with all settings + * For the old format, + * verify that v1 btree indexing type is used for + * all 3 datasets with all settings * For the new format: - * Verify that Implicit Index type is used for - * #1, #2, #3 datasets when ALLOC_TIME_EARLY and compression are true - * Verify Fixed Array indexing type is used for - * #1, #2, #3 datasets with all other settings + * Verify that Implicit Index type is used for + * #1, #2, #3 datasets when ALLOC_TIME_EARLY and compression are true + * Verify Fixed Array indexing type is used for + * #1, #2, #3 datasets with all other settings * * Return: Success: 0 * Failure: -1 @@ -9291,7 +9172,7 @@ error: static herr_t test_fixed_array(hid_t fapl) { - char filename[FILENAME_BUF_SIZE]; /* File name */ + char filename[FILENAME_BUF_SIZE]; /* File name */ hid_t fid = -1; /* File ID */ hid_t dcpl = -1; /* Dataset creation property list ID */ @@ -9300,23 +9181,23 @@ test_fixed_array(hid_t fapl) hid_t sid_max = -1; /* Dataspace ID for dataset with maximum dimensions set */ hid_t dsid = -1; /* Dataset ID for dataset with fixed dimensions */ - hid_t dsid_big = -1; /* Dataset ID for big dataset with fixed dimensions */ - hid_t dsid_max = -1; /* Dataset ID for dataset with maximum dimensions set */ + hid_t dsid_big = -1; /* Dataset ID for big dataset with fixed dimensions */ + hid_t dsid_max = -1; /* Dataset ID for dataset with maximum dimensions set */ - hsize_t dim2[2] = {48, 18}; /* Dataset dimensions */ - hsize_t dim2_big[2] = {500, 60}; /* Big dataset dimensions */ - hsize_t dim2_max[2] = {120, 50}; /* Maximum dataset dimensions */ + hsize_t dim2[2] = {48, 18}; /* Dataset dimensions */ + hsize_t dim2_big[2] = {500, 60}; /* Big dataset dimensions */ + hsize_t dim2_max[2] = {120, 50}; /* Maximum dataset dimensions */ - hid_t mem_id; /* Memory space ID */ - hid_t big_mem_id; /* Memory space ID for big dataset */ + hid_t mem_id; /* Memory space ID */ + hid_t big_mem_id; /* Memory space ID for big dataset */ - hsize_t msize[1] = {POINTS}; /* Size of memory space */ + hsize_t msize[1] = {POINTS}; /* Size of memory space */ hsize_t msize_big[1] = {POINTS_BIG}; /* Size of memory space for big dataset */ int wbuf[POINTS]; /* write buffer */ - int *wbuf_big = NULL; /* write buffer for big dataset */ - int rbuf[POINTS]; /* read buffer */ - int *rbuf_big = NULL; /* read buffer for big dataset */ + int *wbuf_big = NULL; /* write buffer for big dataset */ + int rbuf[POINTS]; /* read buffer */ + int *rbuf_big = NULL; /* read buffer for big dataset */ hsize_t chunk_dim2[2] = {4, 3}; /* Chunk dimensions */ int chunks[12][6]; /* # of chunks for dataset dimensions */ @@ -9324,22 +9205,22 @@ test_fixed_array(hid_t fapl) int chunk_row; /* chunk row index */ int chunk_col; /* chunk column index */ - hsize_t coord[POINTS][2]; /* datdaset coordinates */ + hsize_t coord[POINTS][2]; /* datdaset coordinates */ hsize_t coord_big[POINTS_BIG][2]; /* big dataset coordinates */ - H5D_chunk_index_t idx_type; /* Dataset chunk index type */ - H5F_libver_t low, high; /* File format bounds */ + H5D_chunk_index_t idx_type; /* Dataset chunk index type */ + H5F_libver_t low, high; /* File format bounds */ H5D_alloc_time_t alloc_time; /* Storage allocation time */ #ifdef H5_HAVE_FILTER_DEFLATE - unsigned compress; /* Whether chunks should be compressed */ + unsigned compress; /* Whether chunks should be compressed */ #endif /* H5_HAVE_FILTER_DEFLATE */ - h5_stat_size_t empty_size; /* Size of an empty file */ - h5_stat_size_t file_size; /* Size of each file created */ + h5_stat_size_t empty_size; /* Size of an empty file */ + h5_stat_size_t file_size; /* Size of each file created */ - size_t i, j; /* local index variables */ - herr_t ret; /* Generic return value */ + size_t i, j; /* local index variables */ + herr_t ret; /* Generic return value */ TESTING("datasets w/fixed array as chunk index"); @@ -9378,8 +9259,8 @@ test_fixed_array(hid_t fapl) if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR /* Set chunking */ - if((ret = H5Pset_chunk(dcpl, 2, chunk_dim2)) < 0) - FAIL_PUTS_ERROR(" Problem with setting chunk.") + if((ret = H5Pset_chunk(dcpl, 2, chunk_dim2)) < 0) + FAIL_PUTS_ERROR(" Problem with setting chunk.") #ifdef H5_HAVE_FILTER_DEFLATE /* Check if we should compress the chunks */ @@ -9393,243 +9274,243 @@ test_fixed_array(hid_t fapl) /* Set allocation time */ if(H5Pset_alloc_time(dcpl, alloc_time) < 0) FAIL_STACK_ERROR - /* Initialization of chunk array for repeated coordinates */ - for(i = 0; i < dim2[0]/chunk_dim2[0]; i++) - for(j = 0; j < dim2[1]/chunk_dim2[1]; j++) - chunks[i][j] = 0; - - /* Generate random point coordinates. Only one point is selected per chunk */ - for(i = 0; i < POINTS; i++){ - do { - chunk_row = (int)HDrandom () % (int)(dim2[0]/chunk_dim2[0]); - chunk_col = (int)HDrandom () % (int)(dim2[1]/chunk_dim2[1]); - } while (chunks[chunk_row][chunk_col]); - - wbuf[i] = chunks[chunk_row][chunk_col] = chunk_row+chunk_col+1; - coord[i][0] = (hsize_t)chunk_row * chunk_dim2[0]; - coord[i][1] = (hsize_t)chunk_col * chunk_dim2[1]; - } /* end for */ - - /* Create first dataset with cur and max dimensions */ - if((sid_max = H5Screate_simple(2, dim2, dim2_max)) < 0) FAIL_STACK_ERROR - dsid_max = H5Dcreate2(fid, DSET_FIXED_MAX, H5T_NATIVE_INT, sid_max, H5P_DEFAULT, dcpl, H5P_DEFAULT); - if(dsid_max < 0) - FAIL_PUTS_ERROR(" Creating Chunked Dataset with maximum dimensions.") - - /* Get the chunk index type */ - if(H5D__layout_idx_type_test(dsid_max, &idx_type) < 0) FAIL_STACK_ERROR - - /* Chunk index type depends on whether we are using the latest version of the format */ - if(low == H5F_LIBVER_LATEST) { - if(alloc_time == H5D_ALLOC_TIME_EARLY + /* Initialization of chunk array for repeated coordinates */ + for(i = 0; i < dim2[0]/chunk_dim2[0]; i++) + for(j = 0; j < dim2[1]/chunk_dim2[1]; j++) + chunks[i][j] = 0; + + /* Generate random point coordinates. Only one point is selected per chunk */ + for(i = 0; i < POINTS; i++){ + do { + chunk_row = (int)HDrandom () % (int)(dim2[0]/chunk_dim2[0]); + chunk_col = (int)HDrandom () % (int)(dim2[1]/chunk_dim2[1]); + } while (chunks[chunk_row][chunk_col]); + + wbuf[i] = chunks[chunk_row][chunk_col] = chunk_row+chunk_col+1; + coord[i][0] = (hsize_t)chunk_row * chunk_dim2[0]; + coord[i][1] = (hsize_t)chunk_col * chunk_dim2[1]; + } /* end for */ + + /* Create first dataset with cur and max dimensions */ + if((sid_max = H5Screate_simple(2, dim2, dim2_max)) < 0) FAIL_STACK_ERROR + dsid_max = H5Dcreate2(fid, DSET_FIXED_MAX, H5T_NATIVE_INT, sid_max, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if(dsid_max < 0) + FAIL_PUTS_ERROR(" Creating Chunked Dataset with maximum dimensions.") + + /* Get the chunk index type */ + if(H5D__layout_idx_type_test(dsid_max, &idx_type) < 0) FAIL_STACK_ERROR + + /* Chunk index type depends on whether we are using the latest version of the format */ + if(low == H5F_LIBVER_LATEST) { + if(alloc_time == H5D_ALLOC_TIME_EARLY #ifdef H5_HAVE_FILTER_DEFLATE - && !compress + && !compress #endif /* H5_HAVE_FILTER_DEFLATE */ - ) { - if(idx_type != H5D_CHUNK_IDX_NONE) - FAIL_PUTS_ERROR("should be using Non Index as index"); - } else if (idx_type != H5D_CHUNK_IDX_FARRAY) - FAIL_PUTS_ERROR("should be using Fixed Array as index"); - } /* end if */ - else { - if(idx_type != H5D_CHUNK_IDX_BTREE) - FAIL_PUTS_ERROR("should be using v1 B-tree as index"); - } /* end else */ - - /* Create dataspace for write buffer */ - if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR; - - /* Select the random points for writing */ - if(H5Sselect_elements(sid_max, H5S_SELECT_SET, POINTS, (const hsize_t *)coord) < 0) - TEST_ERROR; - - /* Write into dataset */ - if(H5Dwrite(dsid_max, H5T_NATIVE_INT, mem_id, sid_max, H5P_DEFAULT, wbuf) < 0) TEST_ERROR; - - /* Closing */ - if(H5Dclose(dsid_max) < 0) FAIL_STACK_ERROR - if(H5Sclose(sid_max) < 0) FAIL_STACK_ERROR - if(H5Sclose(mem_id) < 0) FAIL_STACK_ERROR - - - /* Create second dataset with curr dim but NULL max dim */ - if((sid = H5Screate_simple(2, dim2, NULL)) < 0) FAIL_STACK_ERROR - dsid = H5Dcreate2(fid, DSET_FIXED_NOMAX, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - if(dsid < 0) - FAIL_PUTS_ERROR(" Creating Chunked Dataset.") - - /* Get the chunk index type */ - if(H5D__layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR - - /* Chunk index type depends on whether we are using the latest version of the format */ - if(low == H5F_LIBVER_LATEST) { - if(alloc_time == H5D_ALLOC_TIME_EARLY + ) { + if(idx_type != H5D_CHUNK_IDX_NONE) + FAIL_PUTS_ERROR("should be using Non Index as index"); + } else if (idx_type != H5D_CHUNK_IDX_FARRAY) + FAIL_PUTS_ERROR("should be using Fixed Array as index"); + } /* end if */ + else { + if(idx_type != H5D_CHUNK_IDX_BTREE) + FAIL_PUTS_ERROR("should be using v1 B-tree as index"); + } /* end else */ + + /* Create dataspace for write buffer */ + if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR; + + /* Select the random points for writing */ + if(H5Sselect_elements(sid_max, H5S_SELECT_SET, POINTS, (const hsize_t *)coord) < 0) + TEST_ERROR; + + /* Write into dataset */ + if(H5Dwrite(dsid_max, H5T_NATIVE_INT, mem_id, sid_max, H5P_DEFAULT, wbuf) < 0) TEST_ERROR; + + /* Closing */ + if(H5Dclose(dsid_max) < 0) FAIL_STACK_ERROR + if(H5Sclose(sid_max) < 0) FAIL_STACK_ERROR + if(H5Sclose(mem_id) < 0) FAIL_STACK_ERROR + + + /* Create second dataset with curr dim but NULL max dim */ + if((sid = H5Screate_simple(2, dim2, NULL)) < 0) FAIL_STACK_ERROR + dsid = H5Dcreate2(fid, DSET_FIXED_NOMAX, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if(dsid < 0) + FAIL_PUTS_ERROR(" Creating Chunked Dataset.") + + /* Get the chunk index type */ + if(H5D__layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR + + /* Chunk index type depends on whether we are using the latest version of the format */ + if(low == H5F_LIBVER_LATEST) { + if(alloc_time == H5D_ALLOC_TIME_EARLY #ifdef H5_HAVE_FILTER_DEFLATE - && !compress + && !compress #endif /* H5_HAVE_FILTER_DEFLATE */ - ) { - if(idx_type != H5D_CHUNK_IDX_NONE) - FAIL_PUTS_ERROR("should be using Non Index as index"); - } else if(idx_type != H5D_CHUNK_IDX_FARRAY) - FAIL_PUTS_ERROR("should be using Fixed Array as index"); - } else { - if(idx_type != H5D_CHUNK_IDX_BTREE) - FAIL_PUTS_ERROR("should be using v1 B-tree as index"); - } /* end else */ - - /* Create dataspace for write buffer */ - if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR; - - /* Select the random points for writing */ - if(H5Sselect_elements(sid, H5S_SELECT_SET, POINTS, (const hsize_t *)coord) < 0) - TEST_ERROR; - - /* Write into dataset */ - if(H5Dwrite(dsid, H5T_NATIVE_INT, mem_id, sid, H5P_DEFAULT, wbuf) < 0) TEST_ERROR; - - /* Closing */ - if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR - if(H5Sclose(sid) < 0) FAIL_STACK_ERROR - if(H5Sclose(mem_id) < 0) FAIL_STACK_ERROR - - /* Create the third dataset with bigger size and both curr & max dimensions are the same */ - if((sid_big = H5Screate_simple(2, dim2_big, dim2_big)) < 0) FAIL_STACK_ERROR - dsid_big = H5Dcreate2(fid, DSET_FIXED_BIG, H5T_NATIVE_INT, sid_big, H5P_DEFAULT, dcpl, H5P_DEFAULT); - if(dsid_big < 0) - FAIL_PUTS_ERROR(" Creating Big Chunked Dataset.") - - /* Get the chunk index type */ - if(H5D__layout_idx_type_test(dsid_big, &idx_type) < 0) FAIL_STACK_ERROR - - /* Chunk index type depends on whether we are using the latest version of the format */ - if(low == H5F_LIBVER_LATEST) { - if(alloc_time == H5D_ALLOC_TIME_EARLY + ) { + if(idx_type != H5D_CHUNK_IDX_NONE) + FAIL_PUTS_ERROR("should be using Non Index as index"); + } else if(idx_type != H5D_CHUNK_IDX_FARRAY) + FAIL_PUTS_ERROR("should be using Fixed Array as index"); + } else { + if(idx_type != H5D_CHUNK_IDX_BTREE) + FAIL_PUTS_ERROR("should be using v1 B-tree as index"); + } /* end else */ + + /* Create dataspace for write buffer */ + if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR; + + /* Select the random points for writing */ + if(H5Sselect_elements(sid, H5S_SELECT_SET, POINTS, (const hsize_t *)coord) < 0) + TEST_ERROR; + + /* Write into dataset */ + if(H5Dwrite(dsid, H5T_NATIVE_INT, mem_id, sid, H5P_DEFAULT, wbuf) < 0) TEST_ERROR; + + /* Closing */ + if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR + if(H5Sclose(sid) < 0) FAIL_STACK_ERROR + if(H5Sclose(mem_id) < 0) FAIL_STACK_ERROR + + /* Create the third dataset with bigger size and both curr & max dimensions are the same */ + if((sid_big = H5Screate_simple(2, dim2_big, dim2_big)) < 0) FAIL_STACK_ERROR + dsid_big = H5Dcreate2(fid, DSET_FIXED_BIG, H5T_NATIVE_INT, sid_big, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if(dsid_big < 0) + FAIL_PUTS_ERROR(" Creating Big Chunked Dataset.") + + /* Get the chunk index type */ + if(H5D__layout_idx_type_test(dsid_big, &idx_type) < 0) FAIL_STACK_ERROR + + /* Chunk index type depends on whether we are using the latest version of the format */ + if(low == H5F_LIBVER_LATEST) { + if(alloc_time == H5D_ALLOC_TIME_EARLY #ifdef H5_HAVE_FILTER_DEFLATE - && !compress + && !compress #endif /* H5_HAVE_FILTER_DEFLATE */ - ) { - if(idx_type != H5D_CHUNK_IDX_NONE) - FAIL_PUTS_ERROR("should be using Non Index as index"); - } else if(idx_type != H5D_CHUNK_IDX_FARRAY) - FAIL_PUTS_ERROR("should be using Fixed Array as index"); - } /* end if */ - else { - if(idx_type != H5D_CHUNK_IDX_BTREE) - FAIL_PUTS_ERROR("should be using v1 B-tree as index"); - } /* end else */ - - /* Initialization of chunk array for repeated coordinates */ - for(i = 0; i < dim2_big[0]/chunk_dim2[0]; i++) - for(j = 0; j < dim2_big[1]/chunk_dim2[1]; j++) - chunks_big[i][j] = 0; - - /* Generate random point coordinates. Only one point is selected per chunk */ - for(i = 0; i < POINTS_BIG; i++){ - do { - chunk_row = (int)HDrandom () % (int)(dim2_big[0]/chunk_dim2[0]); - chunk_col = (int)HDrandom () % (int)(dim2_big[1]/chunk_dim2[1]); - } while (chunks_big[chunk_row][chunk_col]); - - wbuf_big[i] = chunks_big[chunk_row][chunk_col] = chunk_row+chunk_col+1; - coord_big[i][0] = (hsize_t)chunk_row * chunk_dim2[0]; - coord_big[i][1] = (hsize_t)chunk_col * chunk_dim2[1]; - } /* end for */ - - /* Create dataspace for write buffer */ - if((big_mem_id = H5Screate_simple(1, msize_big, NULL)) < 0) TEST_ERROR; - - /* Select the random points for writing */ - if(H5Sselect_elements(sid_big, H5S_SELECT_SET, POINTS_BIG, (const hsize_t *)coord_big) < 0) - TEST_ERROR; - - /* Write into dataset */ - if(H5Dwrite(dsid_big, H5T_NATIVE_INT, big_mem_id, sid_big, H5P_DEFAULT, wbuf_big) < 0) TEST_ERROR; - - /* Closing */ - if(H5Dclose(dsid_big) < 0) FAIL_STACK_ERROR - if(H5Sclose(sid_big) < 0) FAIL_STACK_ERROR - if(H5Sclose(big_mem_id) < 0) FAIL_STACK_ERROR - if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR - - /* Open the first dataset */ - if((dsid = H5Dopen2(fid, DSET_FIXED_MAX, H5P_DEFAULT)) < 0) TEST_ERROR; - - /* Get dataset dataspace */ - if((sid = H5Dget_space(dsid)) < 0) TEST_ERROR; - - /* Create dataspace for read buffer */ - if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR; - - /* Select the random points for reading */ - if(H5Sselect_elements (sid, H5S_SELECT_SET, POINTS, (const hsize_t *)coord) < 0) TEST_ERROR; - - /* Read from dataset */ - if(H5Dread(dsid, H5T_NATIVE_INT, mem_id, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR; - - /* Verify that written and read data are the same */ - for(i = 0; i < POINTS; i++) - if(rbuf[i] != wbuf[i]){ - printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n", - __LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); - TEST_ERROR; - } /* end if */ - - /* Closing */ - if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR + ) { + if(idx_type != H5D_CHUNK_IDX_NONE) + FAIL_PUTS_ERROR("should be using Non Index as index"); + } else if(idx_type != H5D_CHUNK_IDX_FARRAY) + FAIL_PUTS_ERROR("should be using Fixed Array as index"); + } /* end if */ + else { + if(idx_type != H5D_CHUNK_IDX_BTREE) + FAIL_PUTS_ERROR("should be using v1 B-tree as index"); + } /* end else */ + + /* Initialization of chunk array for repeated coordinates */ + for(i = 0; i < dim2_big[0]/chunk_dim2[0]; i++) + for(j = 0; j < dim2_big[1]/chunk_dim2[1]; j++) + chunks_big[i][j] = 0; + + /* Generate random point coordinates. Only one point is selected per chunk */ + for(i = 0; i < POINTS_BIG; i++){ + do { + chunk_row = (int)HDrandom () % (int)(dim2_big[0]/chunk_dim2[0]); + chunk_col = (int)HDrandom () % (int)(dim2_big[1]/chunk_dim2[1]); + } while (chunks_big[chunk_row][chunk_col]); + + wbuf_big[i] = chunks_big[chunk_row][chunk_col] = chunk_row+chunk_col+1; + coord_big[i][0] = (hsize_t)chunk_row * chunk_dim2[0]; + coord_big[i][1] = (hsize_t)chunk_col * chunk_dim2[1]; + } /* end for */ + + /* Create dataspace for write buffer */ + if((big_mem_id = H5Screate_simple(1, msize_big, NULL)) < 0) TEST_ERROR; + + /* Select the random points for writing */ + if(H5Sselect_elements(sid_big, H5S_SELECT_SET, POINTS_BIG, (const hsize_t *)coord_big) < 0) + TEST_ERROR; + + /* Write into dataset */ + if(H5Dwrite(dsid_big, H5T_NATIVE_INT, big_mem_id, sid_big, H5P_DEFAULT, wbuf_big) < 0) TEST_ERROR; + + /* Closing */ + if(H5Dclose(dsid_big) < 0) FAIL_STACK_ERROR + if(H5Sclose(sid_big) < 0) FAIL_STACK_ERROR + if(H5Sclose(big_mem_id) < 0) FAIL_STACK_ERROR + if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR + + /* Open the first dataset */ + if((dsid = H5Dopen2(fid, DSET_FIXED_MAX, H5P_DEFAULT)) < 0) TEST_ERROR; + + /* Get dataset dataspace */ + if((sid = H5Dget_space(dsid)) < 0) TEST_ERROR; + + /* Create dataspace for read buffer */ + if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR; + + /* Select the random points for reading */ + if(H5Sselect_elements (sid, H5S_SELECT_SET, POINTS, (const hsize_t *)coord) < 0) TEST_ERROR; + + /* Read from dataset */ + if(H5Dread(dsid, H5T_NATIVE_INT, mem_id, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR; + + /* Verify that written and read data are the same */ + for(i = 0; i < POINTS; i++) + if(rbuf[i] != wbuf[i]){ + printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n", + __LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); + TEST_ERROR; + } /* end if */ + + /* Closing */ + if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR if(H5Sclose(sid) < 0) FAIL_STACK_ERROR if(H5Sclose(mem_id) < 0) FAIL_STACK_ERROR - /* Open the second dataset */ - if((dsid = H5Dopen2(fid, DSET_FIXED_NOMAX, H5P_DEFAULT)) < 0) TEST_ERROR; + /* Open the second dataset */ + if((dsid = H5Dopen2(fid, DSET_FIXED_NOMAX, H5P_DEFAULT)) < 0) TEST_ERROR; - /* Get dataset dataspace */ - if((sid = H5Dget_space(dsid)) < 0) TEST_ERROR; + /* Get dataset dataspace */ + if((sid = H5Dget_space(dsid)) < 0) TEST_ERROR; - /* Create dataspace for read buffer */ - if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR; + /* Create dataspace for read buffer */ + if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR; - /* Select the random points for reading */ - if(H5Sselect_elements (sid, H5S_SELECT_SET, POINTS, (const hsize_t *)coord) < 0) TEST_ERROR; + /* Select the random points for reading */ + if(H5Sselect_elements (sid, H5S_SELECT_SET, POINTS, (const hsize_t *)coord) < 0) TEST_ERROR; - /* Read from dataset */ - if(H5Dread(dsid, H5T_NATIVE_INT, mem_id, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR; + /* Read from dataset */ + if(H5Dread(dsid, H5T_NATIVE_INT, mem_id, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR; - /* Verify that written and read data are the same */ - for(i = 0; i < POINTS; i++) - if(rbuf[i] != wbuf[i]){ - printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n", - __LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); - TEST_ERROR; - } /* end if */ + /* Verify that written and read data are the same */ + for(i = 0; i < POINTS; i++) + if(rbuf[i] != wbuf[i]){ + printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n", + __LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); + TEST_ERROR; + } /* end if */ - /* Closing */ - if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR + /* Closing */ + if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR if(H5Sclose(sid) < 0) FAIL_STACK_ERROR if(H5Sclose(mem_id) < 0) FAIL_STACK_ERROR - /* Open the third dataset */ - if((dsid_big = H5Dopen2(fid, DSET_FIXED_BIG, H5P_DEFAULT)) < 0) TEST_ERROR; - /* Get dataset dataspace */ - if((sid_big = H5Dget_space(dsid_big)) < 0) TEST_ERROR; - - /* Create dataspace for read buffer */ - if((big_mem_id = H5Screate_simple(1, msize_big, NULL)) < 0) TEST_ERROR; - - /* Select the random points for reading */ - if(H5Sselect_elements (sid_big, H5S_SELECT_SET, POINTS_BIG, (const hsize_t *)coord_big) < 0) TEST_ERROR; - /* Read from dataset */ - if(H5Dread(dsid_big, H5T_NATIVE_INT, big_mem_id, sid_big, H5P_DEFAULT, rbuf_big) < 0) TEST_ERROR; - - /* Verify that written and read data are the same */ - for(i = 0; i < POINTS_BIG; i++) - if(rbuf_big[i] != wbuf_big[i]) { - printf(" Line %d: Incorrect value, wbuf_bif[%u]=%d, rbuf_big[%u]=%d\n", - __LINE__,(unsigned)i,wbuf_big[i],(unsigned)i,rbuf_big[i]); - TEST_ERROR; - } /* end if */ - - /* Closing */ - if(H5Dclose(dsid_big) < 0) FAIL_STACK_ERROR + /* Open the third dataset */ + if((dsid_big = H5Dopen2(fid, DSET_FIXED_BIG, H5P_DEFAULT)) < 0) TEST_ERROR; + /* Get dataset dataspace */ + if((sid_big = H5Dget_space(dsid_big)) < 0) TEST_ERROR; + + /* Create dataspace for read buffer */ + if((big_mem_id = H5Screate_simple(1, msize_big, NULL)) < 0) TEST_ERROR; + + /* Select the random points for reading */ + if(H5Sselect_elements (sid_big, H5S_SELECT_SET, POINTS_BIG, (const hsize_t *)coord_big) < 0) TEST_ERROR; + /* Read from dataset */ + if(H5Dread(dsid_big, H5T_NATIVE_INT, big_mem_id, sid_big, H5P_DEFAULT, rbuf_big) < 0) TEST_ERROR; + + /* Verify that written and read data are the same */ + for(i = 0; i < POINTS_BIG; i++) + if(rbuf_big[i] != wbuf_big[i]) { + printf(" Line %d: Incorrect value, wbuf_bif[%u]=%d, rbuf_big[%u]=%d\n", + __LINE__,(unsigned)i,wbuf_big[i],(unsigned)i,rbuf_big[i]); + TEST_ERROR; + } /* end if */ + + /* Closing */ + if(H5Dclose(dsid_big) < 0) FAIL_STACK_ERROR if(H5Sclose(sid_big) < 0) FAIL_STACK_ERROR if(H5Sclose(big_mem_id) < 0) FAIL_STACK_ERROR @@ -9641,13 +9522,13 @@ test_fixed_array(hid_t fapl) /* Close everything */ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR - /* Get the size of the file */ - if((file_size = h5_get_file_size(filename, fapl)) < 0) - TEST_ERROR + /* Get the size of the file */ + if((file_size = h5_get_file_size(filename, fapl)) < 0) + TEST_ERROR - /* Verify the file is correct size */ - if(file_size != empty_size) - TEST_ERROR + /* Verify the file is correct size */ + if(file_size != empty_size) + TEST_ERROR } /* end for */ #ifdef H5_HAVE_FILTER_DEFLATE @@ -9682,18 +9563,18 @@ error: * * Purpose: Tests support for Single Chunk indexing type * - * Create the following 2 datasets: - * 1) chunked dataset with NULL max dims and cur_dims = chunk_dims - * 2) chunked dataset with cur_dims = max_dims = chunk_dims + * Create the following 2 datasets: + * 1) chunked dataset with NULL max dims and cur_dims = chunk_dims + * 2) chunked dataset with cur_dims = max_dims = chunk_dims * * Repeat the following test with/without compression filter * Repeat the following test with H5D_ALLOC_TIME_EARLY/H5D_ALLOC_TIME_LATE/H5D_ALLOC_TIME_INCR - * For the old format, - * verify that v1 btree indexing type is used for - * all datasets with all settings + * For the old format, + * verify that v1 btree indexing type is used for + * all datasets with all settings * For the new format: - * Verify that Single Chunk indexing type is used for - * all datasets with all settings + * Verify that Single Chunk indexing type is used for + * all datasets with all settings * * Return: Success: 0 * Failure: -1 @@ -9705,30 +9586,30 @@ error: static herr_t test_single_chunk(hid_t fapl) { - char filename[FILENAME_BUF_SIZE]; /* File name */ + char filename[FILENAME_BUF_SIZE]; /* File name */ hid_t fid = -1; /* File ID */ hid_t dcpl = -1; /* Dataset creation property list ID */ hid_t t_dcpl = -1; /* Dataset creation property list ID */ - hid_t sid = -1, sid_max = -1; /* Dataspace ID for dataset with fixed dimensions */ - hid_t did = -1, did_max = -1; /* Dataset ID for dataset with fixed dimensions */ - hsize_t dim2[2] = {DSET_DIM1, DSET_DIM2}; /* Dataset dimensions */ + hid_t sid = -1, sid_max = -1; /* Dataspace ID for dataset with fixed dimensions */ + hid_t did = -1, did_max = -1; /* Dataset ID for dataset with fixed dimensions */ + hsize_t dim2[2] = {DSET_DIM1, DSET_DIM2}; /* Dataset dimensions */ hsize_t t_dim2[2] = {DSET_TMP_DIM1, DSET_TMP_DIM2}; /* Dataset dimensions */ int *wbuf = NULL; /* write buffer */ int *t_wbuf = NULL; /* write buffer */ - int *rbuf = NULL; /* read buffer */ + int *rbuf = NULL; /* read buffer */ int *t_rbuf = NULL; /* read buffer */ - H5D_chunk_index_t idx_type; /* Dataset chunk index type */ - H5F_libver_t low, high; /* File format bounds */ + H5D_chunk_index_t idx_type; /* Dataset chunk index type */ + H5F_libver_t low, high; /* File format bounds */ H5D_alloc_time_t alloc_time; /* Storage allocation time */ #ifdef H5_HAVE_FILTER_DEFLATE - unsigned compress; /* Whether chunks should be compressed */ + unsigned compress; /* Whether chunks should be compressed */ #endif /* H5_HAVE_FILTER_DEFLATE */ - size_t n, i; /* local index variables */ - herr_t ret; /* Generic return value */ + size_t n, i; /* local index variables */ + herr_t ret; /* Generic return value */ h5_stat_size_t empty_size; /* Size of an empty file */ h5_stat_size_t file_size; /* Size of each file created */ @@ -9760,10 +9641,10 @@ test_single_chunk(hid_t fapl) TEST_ERROR for(i = n = 0; i < (DSET_DIM1 * DSET_DIM2); i++) - wbuf[i] = (int)n++; + wbuf[i] = (int)n++; for(i = n = 0; i < (DSET_TMP_DIM1* DSET_TMP_DIM2); i++) - t_wbuf[i] = (int)n++; + t_wbuf[i] = (int)n++; #ifdef H5_HAVE_FILTER_DEFLATE /* Loop over compressing chunks */ @@ -9780,18 +9661,18 @@ test_single_chunk(hid_t fapl) if((t_dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR /* Set chunking */ - if((ret = H5Pset_chunk(dcpl, 2, dim2)) < 0) - FAIL_PUTS_ERROR(" Problem with setting chunk.") + if((ret = H5Pset_chunk(dcpl, 2, dim2)) < 0) + FAIL_PUTS_ERROR(" Problem with setting chunk.") - if((ret = H5Pset_chunk(t_dcpl, 2, t_dim2)) < 0) - FAIL_PUTS_ERROR(" Problem with setting chunk.") + if((ret = H5Pset_chunk(t_dcpl, 2, t_dim2)) < 0) + FAIL_PUTS_ERROR(" Problem with setting chunk.") #ifdef H5_HAVE_FILTER_DEFLATE /* Check if we should compress the chunks */ if(compress) { if(H5Pset_deflate(dcpl, 9) < 0) FAIL_STACK_ERROR if(H5Pset_deflate(t_dcpl, 9) < 0) FAIL_STACK_ERROR - } + } #endif /* H5_HAVE_FILTER_DEFLATE */ /* Set fill time */ @@ -9802,94 +9683,94 @@ test_single_chunk(hid_t fapl) if(H5Pset_alloc_time(dcpl, alloc_time) < 0) FAIL_STACK_ERROR if(H5Pset_alloc_time(t_dcpl, alloc_time) < 0) FAIL_STACK_ERROR - /* Create first dataset with cur and max dimensions */ - if((sid_max = H5Screate_simple(2, dim2, dim2)) < 0) FAIL_STACK_ERROR - did_max = H5Dcreate2(fid, DSET_SINGLE_MAX, H5T_NATIVE_INT, sid_max, H5P_DEFAULT, dcpl, H5P_DEFAULT); - if(did_max < 0) - FAIL_PUTS_ERROR(" Creating Chunked Dataset with maximum dimensions.") - - /* Get the chunk index type */ - if(H5D__layout_idx_type_test(did_max, &idx_type) < 0) FAIL_STACK_ERROR - - /* Chunk index type depends on whether we are using the latest version of the format */ - if(low == H5F_LIBVER_LATEST) { - if(idx_type != H5D_CHUNK_IDX_SINGLE) - FAIL_PUTS_ERROR("should be using Single Chunk indexing"); - } /* end if */ - else { - if(idx_type != H5D_CHUNK_IDX_BTREE) - FAIL_PUTS_ERROR("should be using v1 B-tree as index"); - } /* end else */ - - /* Write into dataset */ - if(H5Dwrite(did_max, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) TEST_ERROR; - - /* Closing */ - if(H5Dclose(did_max) < 0) FAIL_STACK_ERROR - if(H5Sclose(sid_max) < 0) FAIL_STACK_ERROR - - /* Create second dataset with curr dim but NULL max dim */ - if((sid = H5Screate_simple(2, t_dim2, NULL)) < 0) FAIL_STACK_ERROR - did = H5Dcreate2(fid, DSET_SINGLE_NOMAX, H5T_NATIVE_INT, sid, H5P_DEFAULT, t_dcpl, H5P_DEFAULT); - if(did < 0) - FAIL_PUTS_ERROR(" Creating Chunked Dataset.") - - /* Get the chunk index type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR - - /* Chunk index type depends on whether we are using the latest version of the format */ - if(low == H5F_LIBVER_LATEST) { - if(idx_type != H5D_CHUNK_IDX_SINGLE) - FAIL_PUTS_ERROR("should be using Single Chunk indexing"); - } else { - if(idx_type != H5D_CHUNK_IDX_BTREE) - FAIL_PUTS_ERROR("should be using v1 B-tree as index"); - } /* end else */ - - /* Write into dataset */ - if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, t_wbuf) < 0) TEST_ERROR; - - /* Closing */ - if(H5Dclose(did) < 0) FAIL_STACK_ERROR - if(H5Sclose(sid) < 0) FAIL_STACK_ERROR - - /* Open the first dataset */ - if((did_max = H5Dopen2(fid, DSET_SINGLE_MAX, H5P_DEFAULT)) < 0) TEST_ERROR; - - /* Read from dataset */ - if(H5Dread(did_max, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) TEST_ERROR; - - /* Verify that written and read data are the same */ - for(i = 0; i < (DSET_DIM1 * DSET_DIM2); i++) - if(rbuf[i] != wbuf[i]){ - printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n", - __LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); - TEST_ERROR; - } /* end if */ - - /* Closing */ - if(H5Dclose(did_max) < 0) FAIL_STACK_ERROR - - /* Open the second dataset */ - if((did = H5Dopen2(fid, DSET_SINGLE_NOMAX, H5P_DEFAULT)) < 0) TEST_ERROR; - - HDmemset(rbuf, 0, sizeof(int) * (DSET_DIM1 * DSET_DIM2)); - - /* Read from dataset */ - if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, t_rbuf) < 0) TEST_ERROR; - - /* Verify that written and read data are the same */ - for(i = 0; i < (DSET_TMP_DIM1* DSET_TMP_DIM2); i++) - if(t_rbuf[i] != t_wbuf[i]) { - printf(" Line %d: Incorrect value, t_wbuf[%u]=%d, t_rbuf[%u]=%d\n", - __LINE__,(unsigned)i,t_wbuf[i],(unsigned)i,t_rbuf[i]); - TEST_ERROR; - } /* end if */ - - /* Closing */ - if(H5Dclose(did) < 0) FAIL_STACK_ERROR - - /* Delete datasets */ + /* Create first dataset with cur and max dimensions */ + if((sid_max = H5Screate_simple(2, dim2, dim2)) < 0) FAIL_STACK_ERROR + did_max = H5Dcreate2(fid, DSET_SINGLE_MAX, H5T_NATIVE_INT, sid_max, H5P_DEFAULT, dcpl, H5P_DEFAULT); + if(did_max < 0) + FAIL_PUTS_ERROR(" Creating Chunked Dataset with maximum dimensions.") + + /* Get the chunk index type */ + if(H5D__layout_idx_type_test(did_max, &idx_type) < 0) FAIL_STACK_ERROR + + /* Chunk index type depends on whether we are using the latest version of the format */ + if(low == H5F_LIBVER_LATEST) { + if(idx_type != H5D_CHUNK_IDX_SINGLE) + FAIL_PUTS_ERROR("should be using Single Chunk indexing"); + } /* end if */ + else { + if(idx_type != H5D_CHUNK_IDX_BTREE) + FAIL_PUTS_ERROR("should be using v1 B-tree as index"); + } /* end else */ + + /* Write into dataset */ + if(H5Dwrite(did_max, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) TEST_ERROR; + + /* Closing */ + if(H5Dclose(did_max) < 0) FAIL_STACK_ERROR + if(H5Sclose(sid_max) < 0) FAIL_STACK_ERROR + + /* Create second dataset with curr dim but NULL max dim */ + if((sid = H5Screate_simple(2, t_dim2, NULL)) < 0) FAIL_STACK_ERROR + did = H5Dcreate2(fid, DSET_SINGLE_NOMAX, H5T_NATIVE_INT, sid, H5P_DEFAULT, t_dcpl, H5P_DEFAULT); + if(did < 0) + FAIL_PUTS_ERROR(" Creating Chunked Dataset.") + + /* Get the chunk index type */ + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR + + /* Chunk index type depends on whether we are using the latest version of the format */ + if(low == H5F_LIBVER_LATEST) { + if(idx_type != H5D_CHUNK_IDX_SINGLE) + FAIL_PUTS_ERROR("should be using Single Chunk indexing"); + } else { + if(idx_type != H5D_CHUNK_IDX_BTREE) + FAIL_PUTS_ERROR("should be using v1 B-tree as index"); + } /* end else */ + + /* Write into dataset */ + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, t_wbuf) < 0) TEST_ERROR; + + /* Closing */ + if(H5Dclose(did) < 0) FAIL_STACK_ERROR + if(H5Sclose(sid) < 0) FAIL_STACK_ERROR + + /* Open the first dataset */ + if((did_max = H5Dopen2(fid, DSET_SINGLE_MAX, H5P_DEFAULT)) < 0) TEST_ERROR; + + /* Read from dataset */ + if(H5Dread(did_max, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) TEST_ERROR; + + /* Verify that written and read data are the same */ + for(i = 0; i < (DSET_DIM1 * DSET_DIM2); i++) + if(rbuf[i] != wbuf[i]){ + printf(" Line %d: Incorrect value, wbuf[%u]=%d, rbuf[%u]=%d\n", + __LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]); + TEST_ERROR; + } /* end if */ + + /* Closing */ + if(H5Dclose(did_max) < 0) FAIL_STACK_ERROR + + /* Open the second dataset */ + if((did = H5Dopen2(fid, DSET_SINGLE_NOMAX, H5P_DEFAULT)) < 0) TEST_ERROR; + + HDmemset(rbuf, 0, sizeof(int) * (DSET_DIM1 * DSET_DIM2)); + + /* Read from dataset */ + if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, t_rbuf) < 0) TEST_ERROR; + + /* Verify that written and read data are the same */ + for(i = 0; i < (DSET_TMP_DIM1* DSET_TMP_DIM2); i++) + if(t_rbuf[i] != t_wbuf[i]) { + printf(" Line %d: Incorrect value, t_wbuf[%u]=%d, t_rbuf[%u]=%d\n", + __LINE__,(unsigned)i,t_wbuf[i],(unsigned)i,t_rbuf[i]); + TEST_ERROR; + } /* end if */ + + /* Closing */ + if(H5Dclose(did) < 0) FAIL_STACK_ERROR + + /* Delete datasets */ if(H5Ldelete(fid, DSET_SINGLE_NOMAX, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5Ldelete(fid, DSET_SINGLE_MAX, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -9942,19 +9823,19 @@ error: /*------------------------------------------------------------------------- * - * test_idx_compatible(): - * Verify that the library can read datasets created with - * 1.6/1.8 library that use the B-tree indexing method. + * test_idx_compatible(): + * Verify that the library can read datasets created with + * 1.6/1.8 library that use the B-tree indexing method. * * Programmer: Vailin Choi; 26th August, 2009 * *------------------------------------------------------------------------- */ -static herr_t +static herr_t test_idx_compatible(void) { - hid_t fid = -1; /* File id */ - hid_t did = -1; /* Dataset id */ + hid_t fid = -1; /* File id */ + hid_t did = -1; /* Dataset id */ const char *filename = NULL; /* old test file name */ unsigned j; /* Local index variable */ H5D_chunk_index_t idx_type; /* Chunked dataset index type */ @@ -9964,41 +9845,41 @@ test_idx_compatible(void) for(j = 0; j < NELMTS(OLD_FILENAME); j++) { - /* Generate correct name for test file by prepending the source path */ - filename = H5_get_srcdir_filename(OLD_FILENAME[j]); + /* Generate correct name for test file by prepending the source path */ + filename = H5_get_srcdir_filename(OLD_FILENAME[j]); - /* Open the file */ - if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) - TEST_ERROR + /* Open the file */ + if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + TEST_ERROR - /* Should be able to read the dataset w/o filter created under 1.8/1.6 */ - if((did = H5Dopen2(fid, DSET, H5P_DEFAULT)) < 0) - TEST_ERROR + /* Should be able to read the dataset w/o filter created under 1.8/1.6 */ + if((did = H5Dopen2(fid, DSET, H5P_DEFAULT)) < 0) + TEST_ERROR - /* Get the chunk index type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR + /* Get the chunk index type */ + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR - /* Verify index type */ - if(idx_type != H5D_CHUNK_IDX_BTREE) - FAIL_PUTS_ERROR("should be using v1 B-tree as index") + /* Verify index type */ + if(idx_type != H5D_CHUNK_IDX_BTREE) + FAIL_PUTS_ERROR("should be using v1 B-tree as index") - if(H5Dclose(did) < 0) FAIL_STACK_ERROR + if(H5Dclose(did) < 0) FAIL_STACK_ERROR - /* Should be able to read the dataset w/ filter created under 1.8/1.6 */ - if((did = H5Dopen2(fid, DSET_FILTER, H5P_DEFAULT)) < 0) - TEST_ERROR + /* Should be able to read the dataset w/ filter created under 1.8/1.6 */ + if((did = H5Dopen2(fid, DSET_FILTER, H5P_DEFAULT)) < 0) + TEST_ERROR - /* Get the chunk index type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR + /* Get the chunk index type */ + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR - /* Verify index type */ - if(idx_type != H5D_CHUNK_IDX_BTREE) - FAIL_PUTS_ERROR("should be using v1 B-tree as index") + /* Verify index type */ + if(idx_type != H5D_CHUNK_IDX_BTREE) + FAIL_PUTS_ERROR("should be using v1 B-tree as index") - if(H5Dclose(did) < 0) FAIL_STACK_ERROR + if(H5Dclose(did) < 0) FAIL_STACK_ERROR - /* Close the file */ - if(H5Fclose(fid) < 0) FAIL_STACK_ERROR + /* Close the file */ + if(H5Fclose(fid) < 0) FAIL_STACK_ERROR } PASSED(); @@ -10007,7 +9888,7 @@ test_idx_compatible(void) error: H5E_BEGIN_TRY { H5Dclose(did); - H5Fclose(fid); + H5Fclose(fid); } H5E_END_TRY; return -1; } /* test_idx_compatible */ @@ -10271,7 +10152,7 @@ error: /*------------------------------------------------------------------------- * Function: test_zero_dim_dset * - * Purpose: Tests support for reading a 1D chunled dataset with + * Purpose: Tests support for reading a 1D chunled dataset with * dimension size = 0. * * Return: Success: 0 @@ -10346,9 +10227,9 @@ error: * Function: test_swmr_non_latest * * Purpose: Checks that a file created with either: - * (a) SWMR-write + non-latest-format - * (b) write + latest format - * will generate datset with latest chunk indexing type. + * (a) SWMR-write + non-latest-format + * (b) write + latest format + * will generate datset with latest chunk indexing type. * * Return: Success: 0 * Failure: -1 @@ -10359,17 +10240,17 @@ static herr_t test_swmr_non_latest(const char *env_h5_driver, hid_t fapl) { char filename[FILENAME_BUF_SIZE]; - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group ID */ - hid_t dcpl = -1; /* Dataset creation property list ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t did = -1; /* Dataset ID */ - hsize_t dim[1], dims2[2]; /* Size of dataset */ - hsize_t max_dim[1], max_dims2[2]; /* Maximum size of dataset */ - hsize_t chunk_dim[1], chunk_dims2[2]; /* Chunk dimensions */ - H5D_chunk_index_t idx_type; /* Chunk index type */ - int data; /* Data to be written to the dataset */ - H5F_libver_t low; /* File format low bound */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hsize_t dim[1], dims2[2]; /* Size of dataset */ + hsize_t max_dim[1], max_dims2[2]; /* Maximum size of dataset */ + hsize_t chunk_dim[1], chunk_dims2[2]; /* Chunk dimensions */ + H5D_chunk_index_t idx_type; /* Chunk index type */ + int data; /* Data to be written to the dataset */ + H5F_libver_t low; /* File format low bound */ TESTING("File created with write+latest-format/SWMR-write+non-latest-format: dataset with latest chunk index"); @@ -10383,35 +10264,35 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl) } /* end if */ /* Check if we are using the latest version of the format */ - if(H5Pget_libver_bounds(fapl, &low, NULL) < 0) + if(H5Pget_libver_bounds(fapl, &low, NULL) < 0) FAIL_STACK_ERROR h5_fixname(FILENAME[18], fapl, filename, sizeof filename); if(low == H5F_LIBVER_LATEST) { /* Create file with write+latest-format */ - if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR } else { /* Create file with SWMR-write+non-latest-format */ - if((fid = H5Fcreate(filename, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0) + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR } /* end else */ /* Create a chunked dataset: this will use extensible array chunk indexing */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR chunk_dim[0] = 6; - if(H5Pset_chunk(dcpl, 1, chunk_dim) < 0) + if(H5Pset_chunk(dcpl, 1, chunk_dim) < 0) FAIL_STACK_ERROR dim[0] = 1; max_dim[0] = H5S_UNLIMITED; - if((sid = H5Screate_simple(1, dim, max_dim)) < 0) + if((sid = H5Screate_simple(1, dim, max_dim)) < 0) FAIL_STACK_ERROR - if((did = H5Dcreate2(fid, DSET_CHUNKED_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if((did = H5Dcreate2(fid, DSET_CHUNKED_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Write to the dataset */ @@ -10420,9 +10301,9 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl) FAIL_STACK_ERROR /* Verify the dataset's indexing type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR - if(idx_type != H5D_CHUNK_IDX_EARRAY) + if(idx_type != H5D_CHUNK_IDX_EARRAY) FAIL_PUTS_ERROR("created dataset not indexed by extensible array") /* Closing */ @@ -10432,7 +10313,7 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR /* Open the file again */ - if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR /* Open the dataset in the file */ @@ -10440,9 +10321,9 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl) FAIL_STACK_ERROR /* Verify the dataset's indexing type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR - if(idx_type != H5D_CHUNK_IDX_EARRAY) + if(idx_type != H5D_CHUNK_IDX_EARRAY) FAIL_PUTS_ERROR("created dataset not indexed by extensible array") /* Read from the dataset and verify data read is correct */ @@ -10459,25 +10340,25 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl) FAIL_STACK_ERROR /* Create a chunked dataset in the group: this will use v2 B-tree chunk indexing */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR chunk_dims2[0] = chunk_dims2[1] = 10; - if(H5Pset_chunk(dcpl, 2, chunk_dims2) < 0) + if(H5Pset_chunk(dcpl, 2, chunk_dims2) < 0) FAIL_STACK_ERROR dims2[0] = dims2[1] = 1; max_dims2[0] = max_dims2[1] = H5S_UNLIMITED; - if((sid = H5Screate_simple(2, dims2, max_dims2)) < 0) + if((sid = H5Screate_simple(2, dims2, max_dims2)) < 0) FAIL_STACK_ERROR - if((did = H5Dcreate2(gid, DSET_CHUNKED_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if((did = H5Dcreate2(gid, DSET_CHUNKED_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify the dataset's indexing type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR - if(idx_type != H5D_CHUNK_IDX_BT2) + if(idx_type != H5D_CHUNK_IDX_BT2) FAIL_PUTS_ERROR("created dataset not indexed by v2 B-tree") /* Closing */ @@ -10500,9 +10381,9 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl) FAIL_STACK_ERROR /* Verify the dataset's indexing type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR - if(idx_type != H5D_CHUNK_IDX_BT2) + if(idx_type != H5D_CHUNK_IDX_BT2) FAIL_PUTS_ERROR("created dataset not indexed by v2 B-tree") /* Closing */ @@ -10520,9 +10401,9 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl) FAIL_STACK_ERROR /* Verify the dataset's indexing type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR - if(idx_type != H5D_CHUNK_IDX_EARRAY) + if(idx_type != H5D_CHUNK_IDX_EARRAY) FAIL_PUTS_ERROR("created dataset not indexed by extensible array") /* Close the dataset */ @@ -10537,9 +10418,9 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl) FAIL_STACK_ERROR /* Verify the dataset's indexing type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR - if(idx_type != H5D_CHUNK_IDX_BT2) + if(idx_type != H5D_CHUNK_IDX_BT2) FAIL_PUTS_ERROR("created dataset not indexed by v2 B-tree") /* Write to the dataset in the group */ @@ -10553,7 +10434,7 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR /* Open the file again with SWMR read access */ - if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0) + if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0) FAIL_STACK_ERROR if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) @@ -10653,7 +10534,7 @@ test_earray_hdr_fd(const char *env_h5_driver, hid_t fapl) FAIL_STACK_ERROR; /* Verify the chunk index type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR; if(idx_type != H5D_CHUNK_IDX_EARRAY) FAIL_PUTS_ERROR("should be using extensible array as index"); @@ -10773,7 +10654,7 @@ test_farray_hdr_fd(const char *env_h5_driver, hid_t fapl) FAIL_STACK_ERROR; /* Verify the chunk index type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR; if(idx_type != H5D_CHUNK_IDX_FARRAY) FAIL_PUTS_ERROR("should be using fixed array as index"); @@ -10893,7 +10774,7 @@ test_bt2_hdr_fd(const char *env_h5_driver, hid_t fapl) FAIL_STACK_ERROR; /* Verify the chunk index type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR; if(idx_type != H5D_CHUNK_IDX_BT2) FAIL_PUTS_ERROR("should be using fixed array as index"); @@ -11348,7 +11229,7 @@ error: /*------------------------------------------------------------------------- * Function: test_power2up * - * Purpose: Tests that the H5VM_power2up(n) function does not result in an + * Purpose: Tests that the H5VM_power2up(n) function does not result in an * infinite loop when input n exceeds 2^63. (HDFFV-10217) * H5VM_power2up() is used to calculate the next power of 2 for * a dataset's scaled dimension sizes. @@ -11388,12 +11269,12 @@ test_power2up(hid_t fapl) sid = H5Screate_simple(2, dims, max_dims); /* Create dataset creation property list */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR /* Set chunk size */ chunk_dims[0] = chunk_dims[1] = 1; - if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR /* Create chunked dataset */ @@ -11411,13 +11292,13 @@ test_power2up(hid_t fapl) TEST_ERROR /* Closing */ - if(H5Dclose(did) < 0) + if(H5Dclose(did) < 0) TEST_ERROR - if(H5Sclose(sid) < 0) + if(H5Sclose(sid) < 0) TEST_ERROR - if(H5Pclose(dcpl) < 0) + if(H5Pclose(dcpl) < 0) TEST_ERROR - if(H5Fclose(fid) < 0) + if(H5Fclose(fid) < 0) TEST_ERROR PASSED(); @@ -12460,33 +12341,33 @@ error: /*------------------------------------------------------------------------- * DLS bug -- HDFFV-9672 * - * The following functions replicate the test code provided by DLS to + * The following functions replicate the test code provided by DLS to * expose bug hdffv-9672. All functions associated with this test * have the prefix DLS_01_ * * The note documenting the bug is reproduced below: * * ------------------------------------------------------ - * + * * Hi, * We've found an issue regarding fixed length strings. * - * If we create a chunked dataset of large fixed length strings - * (up to 1kb per string) with small chunk sizes (~8 elements per + * If we create a chunked dataset of large fixed length strings + * (up to 1kb per string) with small chunk sizes (~8 elements per * chunk) then the resulting dataset may not be read later. - * This only happens if the file is created with LIBVER_LATEST + * This only happens if the file is created with LIBVER_LATEST * for the version bounds. * * Calling H5Oget_info(...) on the dataset results in the following: - * - * H5Dearray.c:250: H5D__earray_crt_context: Assertion + * + * H5Dearray.c:250: H5D__earray_crt_context: Assertion * `udata->chunk_size > 0' failed. - * + * * Example: - * void create_data(...) + * void create_data(...) * { * ... - * + * * hsize_t chunks[1] = {8} ; * * err = H5Tset_size( tid, 256 ); @@ -12494,45 +12375,45 @@ error: * err = H5Pset_chunk( dcpl, 1, chunks ); * * H5Dcreate2( fid, "data", tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT ); - * + * * // write data - * } - * - * void read_data(...) - * { - * ... - * + * } + * + * void read_data(...) + * { + * ... + * * H5O_into_t info; status = H5Oget_info( did, &info ) // crash - * ... - * } - * - * If the size of the chunk is increased (usually matching the - * string length) then this problem disappears. - * - * A full program that produces such a file (and crashes trying to + * ... + * } + * + * If the size of the chunk is increased (usually matching the + * string length) then this problem disappears. + * + * A full program that produces such a file (and crashes trying to * read it) is attached. - * + * * Tested with 1.10.0-alpha1. - * + * * Regards, - * + * * Charles Mita * Software Engineer * Diamond Light Source Ltd. * +44 1235 778029 * * ------------------------------------------------------ - * + * * The bug in question turned out to be caused by a failure to update - * the enc_bytes_per_dim field in the layout if the size of the - * underlying type required more bytes to encode than any of the + * the enc_bytes_per_dim field in the layout if the size of the + * underlying type required more bytes to encode than any of the * chunk dimensions. * - * At least in debug builds, the following test code exposes the + * At least in debug builds, the following test code exposes the * failure via an assertion failure. * - * Note that the test code make no attempt to run with different - * file drivers, as the bug is in the actual on disk encoding of + * Note that the test code make no attempt to run with different + * file drivers, as the bug is in the actual on disk encoding of * the chunk layout. * * JRM -- 2/5/16 @@ -12540,10 +12421,10 @@ error: *------------------------------------------------------------------------- */ -#define DLS_01_DATASET "data" -#define DLS_01_STR_SIZE 256 -#define DLS_01_CHUNK_SIZE 8 -#define DLS_01_DIMS 4 +#define DLS_01_DATASET "data" +#define DLS_01_STR_SIZE 256 +#define DLS_01_CHUNK_SIZE 8 +#define DLS_01_DIMS 4 static herr_t dls_01_setup_file( hid_t fid ); static herr_t dls_01_write_data( hid_t fid, char* buffer ); @@ -12664,18 +12545,18 @@ dls_01_main( void ) { char filename[512]; int status = 0; hid_t fapl = 0, fid = 0; - const char* strings[DLS_01_DIMS] = - { "String 1", "Test string 2", "Another string", "Final String" }; + const char* strings[DLS_01_DIMS] = + { "String 1", "Test string 2", "Another string", "Final String" }; char* buffer = NULL; TESTING("Testing DLS bugfix 1"); - if ( NULL == h5_fixname(FILENAME[23], H5P_DEFAULT, filename, + if ( NULL == h5_fixname(FILENAME[23], H5P_DEFAULT, filename, sizeof(filename)) ) - TEST_ERROR + TEST_ERROR buffer = (char *)HDcalloc( DLS_01_DIMS, DLS_01_STR_SIZE ); - if ( NULL == buffer ) + if ( NULL == buffer ) TEST_ERROR HDstrcpy( buffer, strings[0] ); @@ -12693,10 +12574,10 @@ dls_01_main( void ) { if ( fid <= 0 ) TEST_ERROR if ( 0 != dls_01_setup_file( fid ) ) - goto error; + goto error; if ( 0 != dls_01_write_data( fid, buffer ) ) - goto error; + goto error; status = H5Fclose( fid ); if ( status != 0 ) TEST_ERROR @@ -12705,7 +12586,7 @@ dls_01_main( void ) { if ( fid <= 0 ) TEST_ERROR if ( 0 != dls_01_read_stuff( fid ) ) - goto error; + goto error; status = H5Fclose( fid ); if ( status != 0 ) TEST_ERROR @@ -12754,7 +12635,7 @@ test_compact_open_close_dirty(hid_t fapl) hid_t dcpl = -1; /* Dataset creation property list */ hsize_t dims[1] = {10}; /* Dimension */ int wbuf[10]; /* Data buffer */ - char filename[FILENAME_BUF_SIZE]; /* Filename */ + char filename[FILENAME_BUF_SIZE]; /* Filename */ int i; /* Local index variable */ hbool_t dirty; /* The dirty flag */ @@ -12770,15 +12651,15 @@ test_compact_open_close_dirty(hid_t fapl) wbuf[i] = i; /* Create dataspace */ - if((sid = H5Screate_simple(1, dims, NULL)) < 0) + if((sid = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR /* Set compact layout */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR - if(H5Pset_layout(dcpl, H5D_COMPACT) < 0) + if(H5Pset_layout(dcpl, H5D_COMPACT) < 0) TEST_ERROR - if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR /* Create a compact dataset */ @@ -12790,7 +12671,7 @@ test_compact_open_close_dirty(hid_t fapl) TEST_ERROR /* Close the dataset */ - if(H5Dclose(did) < 0) + if(H5Dclose(did) < 0) TEST_ERROR /* Verify the repeated open/close of the dataset will not fail */ @@ -12802,7 +12683,7 @@ test_compact_open_close_dirty(hid_t fapl) TEST_ERROR if(H5Dclose(did) < 0) TEST_ERROR - } + } /* Open the dataset */ if((did = H5Dopen2(fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT)) < 0) @@ -12817,11 +12698,11 @@ test_compact_open_close_dirty(hid_t fapl) TEST_ERROR /* Close the dataset */ - if(H5Dclose(did) < 0) + if(H5Dclose(did) < 0) TEST_ERROR /* Close the dataspace */ - if(H5Sclose(sid) < 0) + if(H5Sclose(sid) < 0) TEST_ERROR /* Close the dataset creation property list */ @@ -12847,24 +12728,24 @@ error: /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Tests the dataset interface (H5D) + * Purpose: Tests the dataset interface (H5D) * - * Return: Success: exit(EXIT_SUCCESS) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(EXIT_FAILURE) + * Failure: exit(EXIT_FAILURE) * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 * *------------------------------------------------------------------------- */ int main(void) { - char filename[FILENAME_BUF_SIZE]; - hid_t file, grp, fapl, fapl2; + char filename[FILENAME_BUF_SIZE]; + hid_t file, grp, fapl, fapl2; hid_t fcpl = -1, fcpl2 = -1; unsigned new_format; unsigned paged; @@ -12872,7 +12753,7 @@ main(void) size_t rdcc_nelmts; size_t rdcc_nbytes; double rdcc_w0; - int nerrors = 0; + int nerrors = 0; const char *envval; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ @@ -12961,62 +12842,62 @@ main(void) if(H5Gclose(grp) < 0) goto error; - nerrors += (test_create(file) < 0 ? 1 : 0); - nerrors += (test_simple_io(envval, my_fapl) < 0 ? 1 : 0); - nerrors += (test_compact_io(my_fapl) < 0 ? 1 : 0); - nerrors += (test_max_compact(my_fapl) < 0 ? 1 : 0); + nerrors += (test_create(file) < 0 ? 1 : 0); + nerrors += (test_simple_io(envval, my_fapl) < 0 ? 1 : 0); + nerrors += (test_compact_io(my_fapl) < 0 ? 1 : 0); + nerrors += (test_max_compact(my_fapl) < 0 ? 1 : 0); nerrors += (test_compact_open_close_dirty(my_fapl) < 0 ? 1 : 0); - nerrors += (test_conv_buffer(file) < 0 ? 1 : 0); - nerrors += (test_tconv(file) < 0 ? 1 : 0); - nerrors += (test_filters(file, my_fapl) < 0 ? 1 : 0); - nerrors += (test_onebyte_shuffle(file) < 0 ? 1 : 0); - nerrors += (test_nbit_int(file) < 0 ? 1 : 0); - nerrors += (test_nbit_float(file) < 0 ? 1 : 0); - nerrors += (test_nbit_double(file) < 0 ? 1 : 0); - nerrors += (test_nbit_array(file) < 0 ? 1 : 0); - nerrors += (test_nbit_compound(file) < 0 ? 1 : 0); - nerrors += (test_nbit_compound_2(file) < 0 ? 1 : 0); - nerrors += (test_nbit_compound_3(file) < 0 ? 1 : 0); - nerrors += (test_nbit_int_size(file) < 0 ? 1 : 0); - nerrors += (test_nbit_flt_size(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_int(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_int_2(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_float(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_float_2(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_double(file) < 0 ? 1 : 0); - nerrors += (test_scaleoffset_double_2(file) < 0 ? 1 : 0); - nerrors += (test_multiopen (file) < 0 ? 1 : 0); - nerrors += (test_types(file) < 0 ? 1 : 0); + nerrors += (test_conv_buffer(file) < 0 ? 1 : 0); + nerrors += (test_tconv(file) < 0 ? 1 : 0); + nerrors += (test_filters(file, my_fapl) < 0 ? 1 : 0); + nerrors += (test_onebyte_shuffle(file) < 0 ? 1 : 0); + nerrors += (test_nbit_int(file) < 0 ? 1 : 0); + nerrors += (test_nbit_float(file) < 0 ? 1 : 0); + nerrors += (test_nbit_double(file) < 0 ? 1 : 0); + nerrors += (test_nbit_array(file) < 0 ? 1 : 0); + nerrors += (test_nbit_compound(file) < 0 ? 1 : 0); + nerrors += (test_nbit_compound_2(file) < 0 ? 1 : 0); + nerrors += (test_nbit_compound_3(file) < 0 ? 1 : 0); + nerrors += (test_nbit_int_size(file) < 0 ? 1 : 0); + nerrors += (test_nbit_flt_size(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_int(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_int_2(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_float(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_float_2(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_double(file) < 0 ? 1 : 0); + nerrors += (test_scaleoffset_double_2(file) < 0 ? 1 : 0); + nerrors += (test_multiopen (file) < 0 ? 1 : 0); + nerrors += (test_types(file) < 0 ? 1 : 0); nerrors += (test_userblock_offset(envval, my_fapl, new_format) < 0 ? 1 : 0); - nerrors += (test_missing_filter(file) < 0 ? 1 : 0); - nerrors += (test_can_apply(file) < 0 ? 1 : 0); - nerrors += (test_can_apply2(file) < 0 ? 1 : 0); - nerrors += (test_set_local(my_fapl) < 0 ? 1 : 0); - nerrors += (test_can_apply_szip(file) < 0 ? 1 : 0); - nerrors += (test_compare_dcpl(file) < 0 ? 1 : 0); - nerrors += (test_copy_dcpl(file, my_fapl) < 0 ? 1 : 0); - nerrors += (test_filter_delete(file) < 0 ? 1 : 0); - nerrors += (test_filters_endianess() < 0 ? 1 : 0); - nerrors += (test_zero_dims(file) < 0 ? 1 : 0); - nerrors += (test_missing_chunk(file) < 0 ? 1 : 0); - nerrors += (test_random_chunks(my_fapl) < 0 ? 1 : 0); + nerrors += (test_missing_filter(file) < 0 ? 1 : 0); + nerrors += (test_can_apply(file) < 0 ? 1 : 0); + nerrors += (test_can_apply2(file) < 0 ? 1 : 0); + nerrors += (test_set_local(my_fapl) < 0 ? 1 : 0); + nerrors += (test_can_apply_szip(file) < 0 ? 1 : 0); + nerrors += (test_compare_dcpl(file) < 0 ? 1 : 0); + nerrors += (test_copy_dcpl(file, my_fapl) < 0 ? 1 : 0); + nerrors += (test_filter_delete(file) < 0 ? 1 : 0); + nerrors += (test_filters_endianess() < 0 ? 1 : 0); + nerrors += (test_zero_dims(file) < 0 ? 1 : 0); + nerrors += (test_missing_chunk(file) < 0 ? 1 : 0); + nerrors += (test_random_chunks(my_fapl) < 0 ? 1 : 0); #ifndef H5_NO_DEPRECATED_SYMBOLS - nerrors += (test_deprec(file) < 0 ? 1 : 0); + nerrors += (test_deprec(file) < 0 ? 1 : 0); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - nerrors += (test_huge_chunks(my_fapl) < 0 ? 1 : 0); - nerrors += (test_chunk_cache(my_fapl) < 0 ? 1 : 0); + nerrors += (test_huge_chunks(my_fapl) < 0 ? 1 : 0); + nerrors += (test_chunk_cache(my_fapl) < 0 ? 1 : 0); nerrors += (test_big_chunks_bypass_cache(my_fapl) < 0 ? 1 : 0); - nerrors += (test_chunk_fast(envval, my_fapl) < 0 ? 1 : 0); - nerrors += (test_reopen_chunk_fast(my_fapl) < 0 ? 1 : 0); + nerrors += (test_chunk_fast(envval, my_fapl) < 0 ? 1 : 0); + nerrors += (test_reopen_chunk_fast(my_fapl) < 0 ? 1 : 0); nerrors += (test_chunk_fast_bug1(my_fapl) < 0 ? 1 : 0); - nerrors += (test_chunk_expand(my_fapl) < 0 ? 1 : 0); - nerrors += (test_layout_extend(my_fapl) < 0 ? 1 : 0); - nerrors += (test_fixed_array(my_fapl) < 0 ? 1 : 0); - nerrors += (test_idx_compatible() < 0 ? 1 : 0); + nerrors += (test_chunk_expand(my_fapl) < 0 ? 1 : 0); + nerrors += (test_layout_extend(my_fapl) < 0 ? 1 : 0); + nerrors += (test_fixed_array(my_fapl) < 0 ? 1 : 0); + nerrors += (test_idx_compatible() < 0 ? 1 : 0); nerrors += (test_unfiltered_edge_chunks(my_fapl) < 0 ? 1 : 0); - nerrors += (test_single_chunk(my_fapl) < 0 ? 1 : 0); + nerrors += (test_single_chunk(my_fapl) < 0 ? 1 : 0); nerrors += (test_large_chunk_shrink(my_fapl) < 0 ? 1 : 0); nerrors += (test_zero_dim_dset(my_fapl) < 0 ? 1 : 0); nerrors += (test_storage_size(my_fapl) < 0 ? 1 : 0); diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 28c123f..abd55db 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -39,7 +39,7 @@ static void print_warning(const char *dname, const char *fname) int h5tools_canreadf(const char* name, /* object name, serves also as boolean print */ hid_t dcpl_id) /* dataset creation property list */ { - + int ret_value = 1; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ int nfilters; /* number of filters */ H5Z_filter_t filtn; /* filter identification number */ int i; /* index */ @@ -47,16 +47,16 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr /* get information about filters */ if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_nfilters failed"); /* if we do not have filters, we can read the dataset safely */ if (!nfilters) - return 1; + HGOTO_DONE(1); /* check availability of filters */ for (i = 0; i < nfilters; i++) { if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, 0, 0, 0, (size_t) 0, 0, NULL)) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_filter2 failed"); switch (filtn) { /*------------------------------------------------------------------------- @@ -64,12 +64,13 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr *------------------------------------------------------------------------- */ default: - if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0) - return -1; - else if (udfilter_avail == 0) { + if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0) { + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Zfilter_avail failed"); + } + else if (!udfilter_avail) { if (name) print_warning(name, "user defined"); - return 0; + ret_value = 0; } break; @@ -81,7 +82,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr #ifndef H5_HAVE_FILTER_DEFLATE if (name) print_warning(name,"deflate"); - return 0; + ret_value = 0; #endif break; /*------------------------------------------------------------------------- @@ -92,7 +93,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr #ifndef H5_HAVE_FILTER_SZIP if (name) print_warning(name,"SZIP"); - return 0; + ret_value = 0; #endif break; /*------------------------------------------------------------------------- @@ -122,7 +123,8 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr }/*switch*/ }/*for*/ - return 1; +done: + return ret_value; } /*------------------------------------------------------------------------- diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index f6951a3..9a41fb3 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -19,9 +19,10 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) #add_test (NAME h5diffgentest COMMAND $) endif () - #----------------------------------------------------------------------------- - # If plugin library tests can be tested - #----------------------------------------------------------------------------- +#----------------------------------------------------------------------------- +# If plugin library tests can be tested +#----------------------------------------------------------------------------- +if (BUILD_SHARED_LIBS) set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff") set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) @@ -46,5 +47,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) "$" "${CMAKE_BINARY_DIR}/plugins/$" ) +endif () - include (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 1c15880..d87a47f 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -501,7 +501,7 @@ add_test ( NAME H5DIFF_UD-${testname} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -516,7 +516,7 @@ add_test ( NAME H5DIFF_UD-${testname} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -546,7 +546,7 @@ add_test ( NAME H5DIFF_UD_ERR-${testname} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}_ERR.out" @@ -562,7 +562,7 @@ add_test ( NAME H5DIFF_UD_ERR-${testname} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}_ERR.out" @@ -1653,8 +1653,10 @@ ADD_H5_TEST (h5diff_v3 0 -c ${FILEV1} ${FILEV2}) ############################################################################## ### P L U G I N T E S T S ############################################################################## -ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5) -ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5) +if (BUILD_SHARED_LIBS) + ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5) + ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5) +endif () # ############################################################################## # # END -- cgit v0.12 From 1f0194fb641ff348a6415f56596f17dcb7e223b5 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Tue, 10 Oct 2017 09:47:22 -0400 Subject: Update the MANIFEST and release_docs/RELEASE files --- MANIFEST | 1 + release_docs/RELEASE.txt | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/MANIFEST b/MANIFEST index fa3de21..9dca971 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1244,6 +1244,7 @@ ./testpar/t_ph5basic.c ./testpar/t_pflush1.c ./testpar/t_pflush2.c +./testpar/t_pread.c ./testpar/t_prop.c ./testpar/t_shapesame.c ./testpar/t_pshutdown.c diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d0de3ee..ed1b6cc 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -62,6 +62,31 @@ New Features Parallel Library: ----------------- + - Optimize parallel open/location of the HDF5 super-block + + Previous releases of PHDF5 allow all parallel ranks to + read the starting elements in a file to validate and process + the HDF5 super-block. As this is accomplished more or less as + a synchronous operation, a large number of processes will + likely experience a slowdown due to filesystem contention. + + As a first step in improving the startup/file-open performance, + we allow MPI rank 0 of the associated MPI communicator to locate + the base offset of the super-block and then broadcast that result + to the remaining ranks in the parallel group. Note that this + approach is utilized ONLY during file opens which employ the MPIO + file driver in HDF5 by previously having called H5Pset_fapl_mpio(). + + HDF5 parallel file operations which do not employ multiple ranks + e.g. specifiying MPI_COMM_SELF (whose MPI_Comm_size == 1) + as opposed to MPI_COMM_WORLD, will not be affected by this + optimization. Conversely, parallel file operations on subgroups + of MPI_COMM_WORLD are allowed to be run in parallel with each + subgroup operating as an independant collection of processes. + + (RAW – 2017/10/10, HDFFV-10294) + + - Large MPI-IO transfers Previous releases of PHDF5 would fail when attempting to -- cgit v0.12 From 2f636b5d4a067465d458f825823728cd4a9e568e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 10 Oct 2017 10:28:53 -0500 Subject: HDFFV-10297 fix vl buffer error --- tools/lib/h5diff_dset.c | 108 ++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 58 deletions(-) diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index a4f7863..998a8ca 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -170,6 +170,7 @@ hsize_t diff_datasetid( hid_t did1, const char *obj2_name, diff_opt_t *options) { + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hid_t sid1=-1; hid_t sid2=-1; hid_t f_tid1=-1; @@ -211,30 +212,31 @@ hsize_t diff_datasetid( hid_t did1, int i; unsigned int vl_data = 0; /*contains VL datatypes */ + options->err_stat = 1; h5difftrace("diff_datasetid start\n"); /* Get the dataspace handle */ if((sid1 = H5Dget_space(did1)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); /* Get rank */ if((rank1 = H5Sget_simple_extent_ndims(sid1)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); /* Get the dataspace handle */ if((sid2 = H5Dget_space(did2)) < 0 ) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); /* Get rank */ if((rank2 = H5Sget_simple_extent_ndims(sid2)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); /* Get dimensions */ if(H5Sget_simple_extent_dims(sid1, dims1, maxdim1) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); /* Get dimensions */ if(H5Sget_simple_extent_dims(sid2, dims2, maxdim2) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); h5diffdebug3("rank: %ld - %ld\n", rank1, rank2); /*------------------------------------------------------------------------- @@ -244,25 +246,25 @@ hsize_t diff_datasetid( hid_t did1, /* Get the data type */ if((f_tid1 = H5Dget_type(did1)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed"); /* Get the data type */ if((f_tid2 = H5Dget_type(did2)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed"); /*------------------------------------------------------------------------- * get the storage layout type *------------------------------------------------------------------------- */ if((dcpl1 = H5Dget_create_plist(did1)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); if((dcpl2 = H5Dget_create_plist(did2)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); if((stl1 = H5Pget_layout(dcpl1)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); if((stl2 = H5Pget_layout(dcpl2)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); /*------------------------------------------------------------------------- * check for empty datasets @@ -303,10 +305,10 @@ hsize_t diff_datasetid( hid_t did1, */ h5difftrace("check for memory type and sizes\n"); if((m_tid1 = H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); if((m_tid2 = H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); m_size1 = H5Tget_size(m_tid1); m_size2 = H5Tget_size(m_tid2); @@ -368,14 +370,14 @@ hsize_t diff_datasetid( hid_t did1, if (FAIL == match_up_memsize (f_tid1, f_tid2, &m_tid1, &m_tid2, &m_size1, &m_size2)) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "match_up_memsize failed"); h5diffdebug3("m_size: %ld - %ld\n", m_size1, m_size2); dadims = dims1; dam_size = m_size1; dam_tid = m_tid1; danelmts = nelmts1; need = (size_t)(nelmts1 * m_size1); /* bytes needed */ - } + } else { h5diffdebug3("Array dims: %d - %d\n", dims1[0], dims2[0]); /* Compare the smallest array, but create the largest buffer */ @@ -399,6 +401,7 @@ hsize_t diff_datasetid( hid_t did1, name1 = diff_basename(obj1_name); if(obj2_name) name2 = diff_basename(obj2_name); + h5diffdebug3("obj_names: %s - %s\n", name1, name2); /*---------------------------------------------------------------- @@ -413,20 +416,30 @@ hsize_t diff_datasetid( hid_t did1, if(buf1 != NULL && buf2 != NULL) { h5difftrace("buf1 != NULL && buf2 != NULL\n"); if(H5Dread(did1, m_tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); h5difftrace("H5Dread did2\n"); if(H5Dread(did2, m_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); /* array diff */ nfound = diff_array(buf1, buf2, danelmts, (hsize_t)0, rank1, dadims, options, name1, name2, dam_tid, did1, did2); + h5diffdebug2("diff_array nfound:%d\n", nfound); /* reclaim any VL memory, if necessary */ if(vl_data) { + h5difftrace("check vl_data\n"); H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); } /* end if */ + if(buf1 != NULL) { + HDfree(buf1); + buf1 = NULL; + } + if(buf2 != NULL) { + HDfree(buf2); + buf2 = NULL; + } } /* end if */ else { /* possibly not enough memory, read/compare by hyperslabs */ size_t p_type_nbytes = dam_size; /*size of memory type */ @@ -469,9 +482,9 @@ hsize_t diff_datasetid( hid_t did1, * E.g., sm_space. */ if((sm_buf1 = HDmalloc((size_t)sm_nbytes)) == NULL) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); if((sm_buf2 = HDmalloc((size_t)sm_nbytes)) == NULL) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); sm_nelmts = sm_nbytes / p_type_nbytes; sm_space = H5Screate_simple(1, &sm_nelmts, NULL); @@ -488,19 +501,19 @@ hsize_t diff_datasetid( hid_t did1, hs_nelmts *= hs_size[i]; } /* end for */ if(H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); if(H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); if(H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); } /* end if */ else hs_nelmts = 1; if(H5Dread(did1, m_tid1, sm_space, sid1, H5P_DEFAULT, sm_buf1) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); if(H5Dread(did2, m_tid2, sm_space, sid2, H5P_DEFAULT, sm_buf2) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); /* get array differences. in the case of hyperslab read, increment the number of differences found in each hyperslab and pass the position at the beginning for printing */ @@ -522,6 +535,14 @@ hsize_t diff_datasetid( hid_t did1, carry = 0; } /* i */ } /* elmtno */ + if(sm_buf1 != NULL) { + HDfree(sm_buf1); + sm_buf1 = NULL; + } + if(sm_buf2 != NULL) { + HDfree(sm_buf2); + sm_buf2 = NULL; + } H5Sclose(sm_space); } /* hyperslab read */ @@ -532,40 +553,11 @@ hsize_t diff_datasetid( hid_t did1, * close *------------------------------------------------------------------------- */ - h5difftrace("compare attributes?\n"); - - /* free */ - if(buf1 != NULL) { - HDfree(buf1); - buf1 = NULL; - } /* end if */ - if(buf2 != NULL) { - HDfree(buf2); - buf2 = NULL; - } /* end if */ - if(sm_buf1 != NULL) { - HDfree(sm_buf1); - sm_buf1 = NULL; - } /* end if */ - if(sm_buf2 != NULL) { - HDfree(sm_buf2); - sm_buf2 = NULL; - } /* end if */ + h5difftrace("reclaim any VL memory\n"); - H5E_BEGIN_TRY { - H5Sclose(sid1); - H5Sclose(sid2); - H5Tclose(f_tid1); - H5Tclose(f_tid2); - H5Tclose(m_tid1); - H5Tclose(m_tid2); - } H5E_END_TRY; - h5difftrace("diff_datasetid finish\n"); - - return nfound; +done: -error: - options->err_stat=1; + options->err_stat = ret_value; /* free */ if(buf1 != NULL) { @@ -607,7 +599,7 @@ error: H5Tclose(m_tid2); /* enable error reporting */ } H5E_END_TRY; - h5difftrace("diff_datasetid errored\n"); + h5diffdebug3("diff_datasetid return:%d with nfound:%d\n", ret_value, nfound); return nfound; } -- cgit v0.12 From 0c07376431a6882ee6b6d437a462796d758cb42c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 10 Oct 2017 13:06:12 -0500 Subject: HDFFV-10297 Fix resource errors and cleanup whitespace --- tools/src/h5repack/h5repack_refs.c | 259 +++--- tools/src/h5repack/h5repack_verify.c | 98 +- tools/test/h5repack/h5repacktst.c | 1692 +++++++++++++++++----------------- 3 files changed, 991 insertions(+), 1058 deletions(-) diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index 36038b5..376ab92 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -30,15 +30,10 @@ static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, /*------------------------------------------------------------------------- * Function: do_copy_refobjs * - * Purpose: duplicate all referenced HDF5 objects in the file - * and create hard links - * - * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December, 10, 2003 + * Purpose: duplicate all referenced HDF5 objects in the file + * and create hard links * + * Return: 0, ok, -1 no *------------------------------------------------------------------------- */ @@ -47,41 +42,39 @@ int do_copy_refobjs(hid_t fidin, trav_table_t *travt, pack_opt_t *options) /* repack options */ { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t grp_in = (-1); /* read group ID */ - hid_t grp_out = (-1); /* write group ID */ - hid_t dset_in = (-1); /* read dataset ID */ - hid_t dset_out = (-1); /* write dataset ID */ - hid_t type_in = (-1); /* named type ID */ - hid_t dcpl_id = (-1); /* dataset creation property list ID */ - hid_t space_id = (-1); /* space ID */ - hid_t ftype_id = (-1); /* file data type ID */ - hid_t mtype_id = (-1); /* memory data type ID */ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t grp_in = -1; /* read group ID */ + hid_t grp_out = -1; /* write group ID */ + hid_t dset_in = -1; /* read dataset ID */ + hid_t dset_out = -1; /* write dataset ID */ + hid_t type_in = -1; /* named type ID */ + hid_t dcpl_id = -1; /* dataset creation property list ID */ + hid_t space_id = -1; /* space ID */ + hid_t ftype_id = -1; /* file data type ID */ + hid_t mtype_id = -1; /* memory data type ID */ size_t msize; /* memory size of memory type */ hsize_t nelmts; /* number of elements in dataset */ int rank; /* rank of dataset */ hsize_t dims[H5S_MAX_RANK]; /* dimensions of dataset */ unsigned int i, j; int k; - named_dt_t *named_dt_head=NULL; /* Pointer to the stack of named datatypes - copied */ + named_dt_t *named_dt_head = NULL; /* Pointer to the stack of named datatypes copied */ /*------------------------------------------------------------------------- * browse *------------------------------------------------------------------------- */ for(i = 0; i < travt->nobjs; i++) { - switch(travt->objs[i].type) - { + switch(travt->objs[i].type) { /*------------------------------------------------------------------------- - * H5TRAV_TYPE_GROUP - *------------------------------------------------------------------------- - */ + * H5TRAV_TYPE_GROUP + *------------------------------------------------------------------------- + */ case H5TRAV_TYPE_GROUP: /*------------------------------------------------------------------------- - * copy referenced objects in attributes - *------------------------------------------------------------------------- - */ + * copy referenced objects in attributes + *------------------------------------------------------------------------- + */ if((grp_out = H5Gopen2(fidout, travt->objs[i].name, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); @@ -97,18 +90,18 @@ int do_copy_refobjs(hid_t fidin, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); /*------------------------------------------------------------------------- - * check for hard links - *------------------------------------------------------------------------- - */ + * check for hard links + *------------------------------------------------------------------------- + */ if(travt->objs[i].nlinks) for(j = 0; j < travt->objs[i].nlinks; j++) H5Lcreate_hard(fidout, travt->objs[i].name, H5L_SAME_LOC, travt->objs[i].links[j].new_name, H5P_DEFAULT, H5P_DEFAULT); break; /*------------------------------------------------------------------------- - * H5TRAV_TYPE_DATASET - *------------------------------------------------------------------------- - */ + * H5TRAV_TYPE_DATASET + *------------------------------------------------------------------------- + */ case H5TRAV_TYPE_DATASET: if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); @@ -141,16 +134,16 @@ int do_copy_refobjs(hid_t fidin, */ if(h5tools_canreadf(NULL, dcpl_id) == 1) { /*------------------------------------------------------------------------- - * test for a valid output dataset - *------------------------------------------------------------------------- - */ + * test for a valid output dataset + *------------------------------------------------------------------------- + */ dset_out = FAIL; /*------------------------------------------------------------------------- - * object references are a special case - * we cannot just copy the buffers, but instead we recreate the reference - *------------------------------------------------------------------------- - */ + * object references are a special case + * we cannot just copy the buffers, but instead we recreate the reference + *------------------------------------------------------------------------- + */ if(H5Tequal(mtype_id, H5T_STD_REF_OBJ)) { hid_t refobj_id; hobj_ref_t *refbuf = NULL; /* buffer for object references */ @@ -159,9 +152,9 @@ int do_copy_refobjs(hid_t fidin, unsigned u; /*------------------------------------------------------------------------- - * read to memory - *------------------------------------------------------------------------- - */ + * read to memory + *------------------------------------------------------------------------- + */ if(nelmts) { buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf==NULL) { @@ -201,9 +194,9 @@ int do_copy_refobjs(hid_t fidin, } /*nelmts*/ /*------------------------------------------------------------------------- - * create/write dataset/close - *------------------------------------------------------------------------- - */ + * create/write dataset/close + *------------------------------------------------------------------------- + */ if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed"); if(nelmts) @@ -223,11 +216,10 @@ int do_copy_refobjs(hid_t fidin, } /*H5T_STD_REF_OBJ*/ /*------------------------------------------------------------------------- - * dataset region references - *------------------------------------------------------------------------- - */ - else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) - { + * dataset region references + *------------------------------------------------------------------------- + */ + else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) { hid_t refobj_id; hdset_reg_ref_t *refbuf = NULL; /* input buffer for region references */ hdset_reg_ref_t *buf = NULL; /* output buffer */ @@ -235,9 +227,9 @@ int do_copy_refobjs(hid_t fidin, unsigned u; /*------------------------------------------------------------------------- - * read input to memory - *------------------------------------------------------------------------- - */ + * read input to memory + *------------------------------------------------------------------------- + */ if(nelmts) { buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf == NULL) { @@ -248,9 +240,9 @@ int do_copy_refobjs(hid_t fidin, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); /*------------------------------------------------------------------------- - * create output - *------------------------------------------------------------------------- - */ + * create output + *------------------------------------------------------------------------- + */ refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ if(refbuf == NULL) { printf("cannot allocate memory\n"); @@ -289,9 +281,9 @@ int do_copy_refobjs(hid_t fidin, } /*nelmts*/ /*------------------------------------------------------------------------- - * create/write dataset/close - *------------------------------------------------------------------------- - */ + * create/write dataset/close + *------------------------------------------------------------------------- + */ if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed"); if(nelmts) @@ -310,25 +302,25 @@ int do_copy_refobjs(hid_t fidin, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_attr failed"); } /* H5T_STD_REF_DSETREG */ /*------------------------------------------------------------------------- - * not references, open previously created object in 1st traversal - *------------------------------------------------------------------------- - */ + * not references, open previously created object in 1st traversal + *------------------------------------------------------------------------- + */ else { if((dset_out = H5Dopen2(fidout, travt->objs[i].name, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); } /* end else */ /*------------------------------------------------------------------------- - * copy referenced objects in attributes - *------------------------------------------------------------------------- - */ + * copy referenced objects in attributes + *------------------------------------------------------------------------- + */ if(copy_refs_attr(dset_in, dset_out, options, travt, fidout) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed"); /*------------------------------------------------------------------------- - * check for hard links - *------------------------------------------------------------------------- - */ + * check for hard links + *------------------------------------------------------------------------- + */ if(travt->objs[i].nlinks) for(j = 0; j < travt->objs[i].nlinks; j++) H5Lcreate_hard(fidout, travt->objs[i].name, H5L_SAME_LOC, travt->objs[i].links[j].new_name, H5P_DEFAULT, H5P_DEFAULT); @@ -338,9 +330,9 @@ int do_copy_refobjs(hid_t fidin, } /*can_read*/ /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ + * close + *------------------------------------------------------------------------- + */ if(H5Tclose(ftype_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); if(H5Tclose(mtype_id) < 0) @@ -354,9 +346,9 @@ int do_copy_refobjs(hid_t fidin, break; /*------------------------------------------------------------------------- - * H5TRAV_TYPE_NAMED_DATATYPE - *------------------------------------------------------------------------- - */ + * H5TRAV_TYPE_NAMED_DATATYPE + *------------------------------------------------------------------------- + */ case H5TRAV_TYPE_NAMED_DATATYPE: if((type_in = H5Topen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Topen2 failed"); @@ -365,9 +357,9 @@ int do_copy_refobjs(hid_t fidin, break; /*------------------------------------------------------------------------- - * H5TRAV_TYPE_LINK - *------------------------------------------------------------------------- - */ + * H5TRAV_TYPE_LINK + *------------------------------------------------------------------------- + */ case H5TRAV_TYPE_LINK: /*nothing to do */ break; @@ -410,27 +402,22 @@ done: /*------------------------------------------------------------------------- * Function: copy_refs_attr * - * Purpose: duplicate all referenced HDF5 located in attributes - * relative to LOC_IN, which is obtained either from - * loc_id = H5Gopen2(fid, name, H5P_DEFAULT); - * loc_id = H5Dopen2(fid, name, H5P_DEFAULT); - * loc_id = H5Topen2(fid, name, H5P_DEFAULT); - * - * Return: 0, ok, -1 no + * Purpose: duplicate all referenced HDF5 located in attributes + * relative to LOC_IN, which is obtained either from + * loc_id = H5Gopen2(fid, name, H5P_DEFAULT); + * loc_id = H5Dopen2(fid, name, H5P_DEFAULT); + * loc_id = H5Topen2(fid, name, H5P_DEFAULT); * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Return: 0, ok, -1 no * - * Modifier: xcao@hdfgroup.org, 9/12/2011 - * Update values of references(object and region) for the following types: + * Modified: + * Update values of references(object and region) for the following types: * 1) References, * 2) ARRAY of reference, * 3) VLEN of references. * 4) COMPOUND of references. - * This function does not handle references in other complicated structures, - * such as references in nested compound datatypes. - * - * Date: October, 28, 2003 - * + * This function does not handle references in other complicated structures, + * such as references in nested compound datatypes. *------------------------------------------------------------------------- */ @@ -438,30 +425,32 @@ static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options, trav_table_t *travt, - hid_t fidout /* for saving references */ - ) + hid_t fidout) /* for saving references */ { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t attr_id = -1; /* attr ID */ - hid_t attr_out = -1; /* attr ID */ - hid_t space_id = -1; /* space ID */ - hid_t ftype_id = -1; /* file data type ID */ - hid_t mtype_id = -1; /* memory data type ID */ - size_t msize; /* memory size of type */ - hsize_t nelmts; /* number of elements in dataset */ - hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ - char name[255]; - H5O_info_t oinfo; /* Object info */ - unsigned u, i, j; - int rank; + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t attr_id = -1; /* attr ID */ + hid_t attr_out = -1; /* attr ID */ + hid_t space_id = -1; /* space ID */ + hid_t ftype_id = -1; /* file data type ID */ + hid_t mtype_id = -1; /* memory data type ID */ + size_t msize; /* memory size of type */ + hsize_t nelmts; /* number of elements in dataset */ + hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ + char name[255]; + H5O_info_t oinfo; /* Object info */ + unsigned u, i, j; + int rank; H5T_class_t type_class = -1; - hbool_t is_ref=0, is_ref_vlen=0, is_ref_array=0, is_ref_comp=0; - void *refbuf = NULL; - void *buf = NULL; - const char* refname = NULL; - unsigned *ref_comp_index = NULL; - size_t *ref_comp_size = NULL; - int ref_comp_field_n = 0; + hbool_t is_ref = 0, + is_ref_vlen = 0, + is_ref_array = 0, + is_ref_comp = 0; + void *refbuf = NULL; + void *buf = NULL; + const char *refname = NULL; + unsigned *ref_comp_index = NULL; + size_t *ref_comp_size = NULL; + int ref_comp_field_n = 0; if(H5Oget_info(loc_in, &oinfo) < 0) @@ -492,7 +481,7 @@ static int copy_refs_attr(hid_t loc_in, hid_t base_type; base_type = H5Tget_super(ftype_id); - is_ref_vlen = (H5Tget_class(base_type)==H5T_REFERENCE); + is_ref_vlen = (H5Tget_class(base_type) == H5T_REFERENCE); msize = H5Tget_size(base_type); H5Tclose(base_type); } @@ -500,7 +489,7 @@ static int copy_refs_attr(hid_t loc_in, hid_t base_type; base_type = H5Tget_super(ftype_id); - is_ref_array = (H5Tget_class(base_type)==H5T_REFERENCE); + is_ref_array = (H5Tget_class(base_type) == H5T_REFERENCE); msize = H5Tget_size(base_type); H5Tclose(base_type); } @@ -515,9 +504,9 @@ static int copy_refs_attr(hid_t loc_in, ref_comp_field_n = 0; for (i=0; i<(unsigned)nmembers; i++) { - hid_t mtid = H5Tget_member_type( ftype_id, i ); + hid_t mtid = H5Tget_member_type(ftype_id, i); - if ((H5Tget_class(mtid)==H5T_REFERENCE)) { + if ((H5Tget_class(mtid) == H5T_REFERENCE)) { ref_comp_index[ref_comp_field_n] = i; ref_comp_size[ref_comp_field_n] = H5Tget_size(mtid); ref_comp_field_n++; @@ -627,9 +616,9 @@ static int copy_refs_attr(hid_t loc_in, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed"); /*------------------------------------------------------------------------- - * create output - *------------------------------------------------------------------------- - */ + * create output + *------------------------------------------------------------------------- + */ refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ if(refbuf == NULL) { printf( "cannot allocate memory\n" ); @@ -669,7 +658,8 @@ static int copy_refs_attr(hid_t loc_in, HDmemcpy(&(ptr[j]), &ref_out, msize); } } /* for (i=0; inobjs; u++) { @@ -830,18 +817,16 @@ out: /*------------------------------------------------------------------------- * Function: Update_Ref_value * - * Purpose: Update a reference value - * - * Programmer: xcao@hdfgroup.org 9/12/2011 - * + * Purpose: Update a reference value *------------------------------------------------------------------------- */ static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, hid_t fid_out, void *ref_out, trav_table_t *travt) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - const char* ref_obj_name; - hid_t space_id=-1, ref_obj_id=-1; + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + const char *ref_obj_name; + hid_t space_id = -1; + hid_t ref_obj_id = -1; ref_obj_id = H5Rdereference2(obj_id, H5P_DEFAULT, ref_type, ref_in); if (ref_obj_id < 0) diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c index bf53bf9..dbe8e1a 100644 --- a/tools/src/h5repack/h5repack_verify.c +++ b/tools/src/h5repack/h5repack_verify.c @@ -177,6 +177,7 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options /* free table */ trav_table_free(travt); + travt = NULL; } /*------------------------------------------------------------------------- @@ -185,39 +186,33 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options */ /* open the input file */ - if((fidin = H5Fopen(in_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) + if((fidin = H5Fopen(in_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fopen failed on file <%s>", in_fname); /* Get file creation property list for input file */ - if((fcpl_in = H5Fget_create_plist(fidin)) < 0) { + if((fcpl_in = H5Fget_create_plist(fidin)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list"); - } /* Get file space info for input file */ - if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) { + if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_strategy failed to retrieve file space strategy & threshold"); - } /* Get file space page size for input file */ - if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) { + if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_page_size failed to retrieve file space page size"); - } /* Output file is already opened */ /* Get file creation property list for output file */ - if((fcpl_out = H5Fget_create_plist(fidout)) < 0) { + if((fcpl_out = H5Fget_create_plist(fidout)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list"); - } /* Get file space info for output file */ - if(H5Pget_file_space_strategy(fcpl_out, &out_strategy, &out_persist, &out_threshold) < 0) { + if(H5Pget_file_space_strategy(fcpl_out, &out_strategy, &out_persist, &out_threshold) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_strategy failed to retrieve file space strategy & threshold"); - } /* Get file space page size for output file */ - if(H5Pget_file_space_page_size(fcpl_out, &out_pagesize) < 0) { + if(H5Pget_file_space_page_size(fcpl_out, &out_pagesize) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_page_size failed to retrieve file space page size"); - } /* * If -S option is set, the file space handling strategy should be set as specified. @@ -225,14 +220,12 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options * the same as the input file's strategy. */ if(options->fs_strategy) { - if(out_strategy != (options->fs_strategy == (H5F_fspace_strategy_t)-1 ? 0 : options->fs_strategy)) { + if(out_strategy != (options->fs_strategy == (H5F_fspace_strategy_t)-1 ? 0 : options->fs_strategy)) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected"); - } } else { - if(out_strategy != in_strategy) { + if(out_strategy != in_strategy) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected"); - } } /* @@ -241,14 +234,12 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options * the same as the input file's free-space persist status */ if(options->fs_persist) { - if(out_persist != (hbool_t)(options->fs_persist == (-1) ? FALSE : options->fs_persist)) { + if(out_persist != (hbool_t)(options->fs_persist == (-1) ? FALSE : options->fs_persist)) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "free-space persist status not set as unexpected"); - } } else { - if(out_persist != in_persist) { + if(out_persist != in_persist) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "free-space persist status not set as unexpected"); - } } /* @@ -257,14 +248,12 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options * input file's threshold size. */ if(options->fs_threshold) { - if(out_threshold != (hsize_t)(options->fs_threshold == (-1) ? 0 : options->fs_threshold)) { + if(out_threshold != (hsize_t)(options->fs_threshold == (-1) ? 0 : options->fs_threshold)) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "threshold not set as unexpected"); - } } else { - if(out_threshold != in_threshold) { + if(out_threshold != in_threshold) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "threshold not set as unexpected"); - } } /* @@ -273,14 +262,13 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options * the same as the input file's file space page size. */ if(options->fs_pagesize) { - if(out_pagesize != (hsize_t)(options->fs_pagesize == (-1) ? 0 : options->fs_pagesize)) { + if(out_pagesize != (hsize_t)(options->fs_pagesize == (-1) ? 0 : options->fs_pagesize)) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space page size not set as unexpected"); - } } else { /* "-G" is not set */ - if(out_pagesize != in_pagesize) { + if(out_pagesize != in_pagesize) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space page size not set as unexpected"); - } + } ret_value = ok; @@ -292,6 +280,7 @@ done: H5Pclose(pid); H5Sclose(sid); H5Dclose(did); + H5Tclose(tid); H5Fclose(fidin); H5Fclose(fidout); if (travt) @@ -304,13 +293,15 @@ done: /*------------------------------------------------------------------------- * Function: verify_layout * - * Purpose: verify which layout is present in the property list DCPL_ID - * - * H5D_COMPACT = 0 - * H5D_CONTIGUOUS = 1 - * H5D_CHUNKED = 2 + * Purpose: verify which layout is present in the property list DCPL_ID + * H5D_COMPACT = 0 + * H5D_CONTIGUOUS = 1 + * H5D_CHUNKED = 2 * - * Return: 1 has, 0 does not, -1 error + * Return: + * 1 has, + * 0 does not, + * -1 error *------------------------------------------------------------------------- */ @@ -327,7 +318,7 @@ int verify_layout(hid_t pid, pack_info_t *obj) return -1; /* a non chunked layout was requested on a filtered object */ - if (nfilters && obj->layout!=H5D_CHUNKED) + if (nfilters && obj->layout != H5D_CHUNKED) return 0; /* get layout */ @@ -338,11 +329,11 @@ int verify_layout(hid_t pid, pack_info_t *obj) return 0; if (layout==H5D_CHUNKED) { - if ((rank = H5Pget_chunk(pid,NELMTS(chsize),chsize/*out*/)) < 0) + if ((rank = H5Pget_chunk(pid, NELMTS(chsize), chsize/*out*/)) < 0) return -1; if (obj->chunk.rank != rank) return 0; - for ( i=0; ichunk.chunk_lengths[i]) return 0; } @@ -353,9 +344,12 @@ int verify_layout(hid_t pid, pack_info_t *obj) /*------------------------------------------------------------------------- * Function: h5repack_cmp_pl * - * Purpose: compare 2 files for identical property lists of all objects + * Purpose: compare 2 files for identical property lists of all objects * - * Return: 1=identical, 0=not identical, -1=error + * Return: + * 1 = identical, + * 0 = not identical, + * -1 = error *------------------------------------------------------------------------- */ @@ -380,9 +374,9 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2) *------------------------------------------------------------------------- */ /* Open the files */ - if ((fid1 = H5Fopen(fname1,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) + if ((fid1 = H5Fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname1, H5FOPENERROR); - if ((fid2 = H5Fopen(fname2,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) + if ((fid2 = H5Fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname2, H5FOPENERROR); /*------------------------------------------------------------------------- @@ -424,9 +418,8 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2) if (H5Gclose(gid) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); - if (crt_order_flag1 != crt_order_flag2) { + if (crt_order_flag1 != crt_order_flag2) HGOTO_ERROR(0, H5E_tools_min_id_g, "property lists failed for <%s> are different", trav->objs[i].name); - } } else if(trav->objs[i].type == H5TRAV_TYPE_DATASET) { if((dset1 = H5Dopen2(fid1, trav->objs[i].name, H5P_DEFAULT)) < 0) @@ -446,7 +439,7 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pequal failed"); if(ret_value == 0) - HGOTO_ERROR(0, H5E_tools_min_id_g, "property lists failed for <%s> are different",trav->objs[i].name); + HGOTO_ERROR(0, H5E_tools_min_id_g, "property lists failed for <%s> are different", trav->objs[i].name); /*------------------------------------------------------------------------- * close @@ -474,7 +467,8 @@ done: H5Fclose(fid2); H5Pclose(gcplid); H5Gclose(gid); - trav_table_free(trav); + if(trav) + trav_table_free(trav); } H5E_END_TRY; return ret_value; @@ -484,14 +478,14 @@ done: /*------------------------------------------------------------------------- * Function: verify_filters * - * Purpose: verify if all requested filters in the array FILTER obtained - * from user input are present in the property list PID obtained from - * the output file + * Purpose: verify if all requested filters in the array FILTER obtained + * from user input are present in the property list PID obtained from + * the output file * * Return: - * 1 match - * 0 do not match - * -1 error + * 1 match + * 0 do not match + * -1 error *------------------------------------------------------------------------- */ diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index 6449844..264550e 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* Copyright by The HDF Group. * -* Copyright by the Board of Trustees of the University of Illinois. * -* All rights reserved. * -* * -* This file is part of HDF5. The full HDF5 copyright notice, including * -* terms governing use, modification, and redistribution, is contained in * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" #include "h5test.h" @@ -78,15 +78,15 @@ #define FNAME18 "h5repack_layout2.h5" /* Files for testing file space paging */ -#define FSPACE_OUT "h5repack_fspace_OUT.h5" /* The output file */ +#define FSPACE_OUT "h5repack_fspace_OUT.h5" /* The output file */ #define NELMTS(X) (sizeof(X)/sizeof(X[0])) /* # of elements */ const char *H5REPACK_FSPACE_FNAMES[] = { "h5repack_latest.h5", /* 0 */ "h5repack_default.h5", /* 1 */ - "h5repack_page_persist.h5", /* 2 */ - "h5repack_fsm_aggr_persist.h5", /* 3 */ + "h5repack_page_persist.h5", /* 2 */ + "h5repack_fsm_aggr_persist.h5", /* 3 */ "h5repack_page_threshold.h5", /* 4 */ - "h5repack_fsm_aggr_threshold.h5", /* 5 */ + "h5repack_fsm_aggr_threshold.h5", /* 5 */ "h5repack_aggr.h5", /* 6 */ "h5repack_none.h5" /* 7 */ }; @@ -126,9 +126,9 @@ const char *H5REPACK_FILENAMES[] = { #define REG_REF_DS1 "Dset_REGREF" /*------------------------------------------------------------------------- -* prototypes -*------------------------------------------------------------------------- -*/ + * prototypes + *------------------------------------------------------------------------- + */ static int make_all_objects(hid_t loc_id); static int make_attributes(hid_t loc_id); static int make_hlinks(hid_t loc_id); @@ -164,31 +164,27 @@ static int make_complex_attr_references(hid_t loc_id); /*------------------------------------------------------------------------- -* Function: main -* -* Purpose: Executes h5repack tests -* -* Return: Success: zero -* Failure: 1 -* -* Programmer: Pedro Vicente -* January, 6, 2004 -* -*------------------------------------------------------------------------- -*/ + * Function: main + * + * Purpose: Executes h5repack tests + * + * Return: Success: zero + * Failure: 1 + *------------------------------------------------------------------------- + */ int main (void) { pack_opt_t pack_options; diff_opt_t diff_options; - unsigned j; /* Local index variable for testing file space */ - const char *fname; /* File name for testing file space */ + unsigned j; /* Local index variable for testing file space */ + const char *fname; /* File name for testing file space */ - h5_stat_t file_stat; - h5_stat_size_t fsize1, fsize2; /* file sizes */ + h5_stat_t file_stat; + h5_stat_size_t fsize1, fsize2; /* file sizes */ #if defined (H5_HAVE_FILTER_SZIP) - int szip_can_encode = 0; + int szip_can_encode = 0; #endif h5tools_setprogname(PROGRAMNAME); @@ -211,28 +207,28 @@ int main (void) PASSED(); /*------------------------------------------------------------------------- - * Format of the tests: - * - * 1) make a copy of the file with h5repack - * 2) use the h5diff function to compare the input and output file - *------------------------------------------------------------------------- - */ + * Format of the tests: + * + * 1) make a copy of the file with h5repack + * 2) use the h5diff function to compare the input and output file + *------------------------------------------------------------------------- + */ /*------------------------------------------------------------------------- - * Testing file space info setting - *------------------------------------------------------------------------- - */ + * Testing file space info setting + *------------------------------------------------------------------------- + */ TESTING(" files with file space info setting--no options (-S, -P, -T, -G) are set"); - j = 0; /* #0 */ + j = 0; /* #0 */ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if(h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - + if(h5repack(fname, FSPACE_OUT, &pack_options) < 0) GOERROR; if(h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(fname, FSPACE_OUT, &pack_options)<=0) + if(h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0) GOERROR; if(h5repack_end(&pack_options) < 0) GOERROR; @@ -240,20 +236,20 @@ int main (void) TESTING(" files with file space info setting--all options -S, -P, -T, -G are set"); - ++j; /* #1 */ + ++j; /* #1 */ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); - fname = H5REPACK_FSPACE_FNAMES[j]; + fname = H5REPACK_FSPACE_FNAMES[j]; if(h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; pack_options.fs_strategy = H5F_FSPACE_STRATEGY_NONE; pack_options.fs_persist = -1; /* "FALSE" is set via -P 0 */ - pack_options.fs_threshold = 1; + pack_options.fs_threshold = 1; pack_options.fs_pagesize = 8192; if(h5repack(fname, FSPACE_OUT, &pack_options) < 0) GOERROR; if(h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(fname, FSPACE_OUT, &pack_options)<=0) + if(h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0) GOERROR; if(h5repack_end(&pack_options) < 0) GOERROR; @@ -261,18 +257,18 @@ int main (void) TESTING(" files with file space info setting--options -S and -T are set"); - ++j; /* #2 */ + ++j; /* #2 */ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if(h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - pack_options.fs_strategy = (H5F_fspace_strategy_t)-1; /* "FSM_AGGR" specified via -S FSM_AGGR */ - pack_options.fs_threshold = -1; /* "0" specified via -T 0 */ + pack_options.fs_strategy = (H5F_fspace_strategy_t)-1; /* "FSM_AGGR" specified via -S FSM_AGGR */ + pack_options.fs_threshold = -1; /* "0" specified via -T 0 */ if(h5repack(fname, FSPACE_OUT, &pack_options) < 0) GOERROR; if(h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(fname, FSPACE_OUT, &pack_options)<=0) + if(h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0) GOERROR; if(h5repack_end(&pack_options) < 0) GOERROR; @@ -280,7 +276,7 @@ int main (void) TESTING(" files with file space info setting-- options -S and -P are set & -L"); - ++j; /* #3 */ + ++j; /* #3 */ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if(h5repack_init(&pack_options, 0, TRUE) < 0) @@ -291,32 +287,32 @@ int main (void) GOERROR; if(h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(fname, FSPACE_OUT, &pack_options)<=0) + if(h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0) GOERROR; if(h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" files with file space info setting-- options -P and -T are set & -L"); - ++j; /* #4 */ + ++j; /* #4 */ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if(h5repack_init(&pack_options, 0, TRUE) < 0) GOERROR; - pack_options.fs_persist = -1; /* "FALSE" is set via -P 0 */ - pack_options.fs_threshold = 2; + pack_options.fs_persist = -1; /* "FALSE" is set via -P 0 */ + pack_options.fs_threshold = 2; if(h5repack(fname, FSPACE_OUT, &pack_options) < 0) GOERROR; if(h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(fname, FSPACE_OUT, &pack_options)<=0) + if(h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0) GOERROR; if(h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" files with file space info setting-- options -S and -G are set & -L"); - ++j; /* #5 */ + ++j; /* #5 */ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if(h5repack_init(&pack_options, 0, TRUE) < 0) @@ -327,180 +323,179 @@ int main (void) GOERROR; if(h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(fname, FSPACE_OUT, &pack_options)<=0) + if(h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0) GOERROR; if(h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" files with file space info setting-- options -S, -P, -T, -G are set"); - ++j; /* #6 */ + ++j; /* #6 */ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if(h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; pack_options.fs_strategy = H5F_FSPACE_STRATEGY_NONE; - pack_options.fs_persist = -1; /* "FALSE" is set via -P 0 */ - pack_options.fs_threshold = 1; + pack_options.fs_persist = -1; /* "FALSE" is set via -P 0 */ + pack_options.fs_threshold = 1; pack_options.fs_pagesize = 8192; if(h5repack(fname, FSPACE_OUT, &pack_options) < 0) GOERROR; if(h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(fname, FSPACE_OUT, &pack_options)<=0) + if(h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0) GOERROR; if(h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" files with file space info setting-- options -S, -T, -G are set & -L"); - ++j; /* #7 */ + ++j; /* #7 */ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if(h5repack_init(&pack_options, 0, TRUE) < 0) GOERROR; pack_options.fs_strategy = H5F_FSPACE_STRATEGY_AGGR; - pack_options.fs_threshold = 1; + pack_options.fs_threshold = 1; pack_options.fs_pagesize = 4096; if(h5repack(fname, FSPACE_OUT, &pack_options) < 0) GOERROR; if(h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(fname, FSPACE_OUT, &pack_options)<=0) + if(h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0) GOERROR; if(h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * file with fill values - *------------------------------------------------------------------------- - */ - + * file with fill values + *------------------------------------------------------------------------- + */ TESTING(" copy of datasets (fill values)"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME0,FNAME0OUT,&pack_options) < 0) + if (h5repack(FNAME0, FNAME0OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME0,FNAME0OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME0, FNAME0OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME0, FNAME0OUT,&pack_options)<=0) + if (h5repack_verify(FNAME0, FNAME0OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME0,FNAME0OUT)<=0) + if (h5repack_cmp_pl(FNAME0, FNAME0OUT) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * file with all kinds of dataset datatypes - *------------------------------------------------------------------------- - */ + * file with all kinds of dataset datatypes + *------------------------------------------------------------------------- + */ TESTING(" copy of datasets (all datatypes)"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME1,FNAME1OUT,&pack_options) < 0) + if (h5repack(FNAME1, FNAME1OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME1,FNAME1OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME1, FNAME1OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME1, FNAME1OUT,&pack_options)<=0) + if (h5repack_verify(FNAME1, FNAME1OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME1,FNAME1OUT)<=0) + if (h5repack_cmp_pl(FNAME1, FNAME1OUT) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * file with attributes - *------------------------------------------------------------------------- - */ + * file with attributes + *------------------------------------------------------------------------- + */ TESTING(" copy of datasets (attributes)"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME2,FNAME2OUT,&pack_options) < 0) + if (h5repack(FNAME2, FNAME2OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME2,FNAME2OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME2, FNAME2OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME2, FNAME2OUT,&pack_options)<=0) + if (h5repack_verify(FNAME2, FNAME2OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME2,FNAME2OUT)<=0) + if (h5repack_cmp_pl(FNAME2, FNAME2OUT) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * file with hardlinks - *------------------------------------------------------------------------- - */ + * file with hardlinks + *------------------------------------------------------------------------- + */ TESTING(" copy of datasets (hardlinks)"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME3,FNAME3OUT,&pack_options) < 0) + if (h5repack(FNAME3, FNAME3OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME3,FNAME3OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME3, FNAME3OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME3, FNAME3OUT,&pack_options)<=0) + if (h5repack_verify(FNAME3, FNAME3OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME3,FNAME3OUT)<=0) + if (h5repack_cmp_pl(FNAME3, FNAME3OUT) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * alloc early test - *------------------------------------------------------------------------- - */ + * alloc early test + *------------------------------------------------------------------------- + */ TESTING(" copy of allocation early file"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME5,FNAME5OUT,&pack_options) < 0) + if (h5repack(FNAME5, FNAME5OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME5,FNAME5OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME5, FNAME5OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME5, FNAME5OUT, &pack_options)<=0) + if (h5repack_verify(FNAME5, FNAME5OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * the remaining files differ in the dcpl's - *------------------------------------------------------------------------- - */ + * the remaining files differ in the dcpl's + *------------------------------------------------------------------------- + */ /*------------------------------------------------------------------------- - * deflate - *------------------------------------------------------------------------- - */ + * deflate + *------------------------------------------------------------------------- + */ TESTING(" adding deflate filter (old_format)"); #ifdef H5_HAVE_FILTER_DEFLATE /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ + * test an individual object option + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset1:GZIP=9",&pack_options) < 0) + if (h5repack_addfilter("dset1:GZIP=9", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("dset1:CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); #else @@ -510,24 +505,24 @@ int main (void) TESTING(" adding deflate filter (new format)"); #ifdef H5_HAVE_FILTER_DEFLATE /*------------------------------------------------------------------------- - * test an individual object option - * For new format, "dset1" should be using Fixed Array indexing - *------------------------------------------------------------------------- - */ + * test an individual object option + * For new format, "dset1" should be using Fixed Array indexing + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0, TRUE) < 0) + if (h5repack_init(&pack_options, 0, TRUE) < 0) GOERROR; - if (h5repack_addfilter("dset1:GZIP=9",&pack_options) < 0) + if (h5repack_addfilter("dset1:GZIP=9", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("dset1:CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); #else @@ -535,27 +530,27 @@ int main (void) #endif /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ + * test all objects option + *------------------------------------------------------------------------- + */ TESTING(" adding deflate filter to all"); #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("GZIP=1",&pack_options) < 0) + if (h5repack_addfilter("GZIP=1", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -564,40 +559,40 @@ int main (void) #endif /*------------------------------------------------------------------------- - * SZIP - *------------------------------------------------------------------------- - */ + * SZIP + *------------------------------------------------------------------------- + */ TESTING(" adding szip filter"); #if defined (H5_HAVE_FILTER_SZIP) - if (h5tools_can_encode(H5Z_FILTER_SZIP) >0) { + if (h5tools_can_encode(H5Z_FILTER_SZIP) > 0) szip_can_encode = 1; - } /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ + * test an individual object option + *------------------------------------------------------------------------- + */ if (szip_can_encode) { if (h5repack_init (&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset2:SZIP=8,EC",&pack_options) < 0) + if (h5repack_addfilter("dset2:SZIP=8,EC", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("dset2:CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("dset2:CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - } else { + } + else { SKIPPED(); } #else @@ -606,28 +601,29 @@ int main (void) /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ + * test all objects option + *------------------------------------------------------------------------- + */ TESTING(" adding szip filter to all"); #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("SZIP=8,NN",&pack_options) < 0) + if (h5repack_addfilter("SZIP=8,NN", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); - } else { + } + else { SKIPPED(); } #else @@ -638,47 +634,47 @@ int main (void) TESTING(" addding shuffle filter"); /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ + * test an individual object option + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset1:SHUF",&pack_options) < 0) + if (h5repack_addfilter("dset1:SHUF", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("dset1:CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ + * test all objects option + *------------------------------------------------------------------------- + */ TESTING(" addding shuffle filter to all"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("SHUF",&pack_options) < 0) + if (h5repack_addfilter("SHUF", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -687,48 +683,45 @@ int main (void) TESTING(" adding checksum filter"); /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ - - if (h5repack_init (&pack_options, 0, FALSE) < 0) + * test an individual object option + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset1:FLET",&pack_options) < 0) + if (h5repack_addfilter("dset1:FLET", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("dset1:CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ - - + * test all objects option + *------------------------------------------------------------------------- + */ TESTING(" adding checksum filter to all"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("FLET",&pack_options) < 0) + if (h5repack_addfilter("FLET", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -737,38 +730,38 @@ int main (void) TESTING(" filter queue fletcher, shuffle, deflate, szip"); /*------------------------------------------------------------------------- - * add some filters - *------------------------------------------------------------------------- - */ + * add some filters + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset1:CHUNK 20x10",&pack_options) < 0) + if (h5repack_addlayout("dset1:CHUNK 20x10", &pack_options) < 0) GOERROR; - if (h5repack_addfilter("dset1:FLET",&pack_options) < 0) + if (h5repack_addfilter("dset1:FLET", &pack_options) < 0) GOERROR; - if (h5repack_addfilter("dset1:SHUF",&pack_options) < 0) + if (h5repack_addfilter("dset1:SHUF", &pack_options) < 0) GOERROR; #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - if (h5repack_addfilter("dset1:SZIP=8,NN",&pack_options) < 0) + if (h5repack_addfilter("dset1:SZIP=8,NN", &pack_options) < 0) GOERROR; } #endif #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_addfilter("dset1:GZIP=1",&pack_options) < 0) + if (h5repack_addfilter("dset1:GZIP=1", &pack_options) < 0) GOERROR; #endif - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -777,63 +770,63 @@ int main (void) TESTING(" adding layout chunked (old format)"); /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ + * test an individual object option + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("dset1:CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options )<= 0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options ) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" adding layout chunked (new format)"); /*------------------------------------------------------------------------- - * test an individual object option - * For new format, "dset1" should be using Fixed Array indexing - *------------------------------------------------------------------------- - */ + * test an individual object option + * For new format, "dset1" should be using Fixed Array indexing + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0, TRUE) < 0) + if (h5repack_init(&pack_options, 0, TRUE) < 0) GOERROR; - if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("dset1:CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options )<= 0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options ) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ + * test all objects option + *------------------------------------------------------------------------- + */ TESTING(" adding layout chunked to all"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -841,20 +834,20 @@ int main (void) TESTING(" adding layout contiguous"); /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + * test an individual object option + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset1:CONTI",&pack_options) < 0) + if (h5repack_addlayout("dset1:CONTI", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -862,37 +855,37 @@ int main (void) TESTING(" adding layout contiguous to all"); /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + * test all objects option + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("CONTI",&pack_options) < 0) + if (h5repack_addlayout("CONTI", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; /*------------------------------------------------------------------------- - * do the same test for a file with filters (chunked) - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + * do the same test for a file with filters (chunked) + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("CONTI",&pack_options) < 0) + if (h5repack_addlayout("CONTI", &pack_options) < 0) GOERROR; - if (h5repack(FNAME8,FNAME8OUT,&pack_options) < 0) + if (h5repack(FNAME8, FNAME8OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME8,FNAME8OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME8, FNAME8OUT,&pack_options)<=0) + if (h5repack_verify(FNAME8, FNAME8OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -900,42 +893,42 @@ int main (void) TESTING(" adding layout compact"); /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ + * test an individual object option + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset1:COMPA",&pack_options) < 0) + if (h5repack_addlayout("dset1:COMPA", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" adding layout compact to all"); /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ + * test all objects option + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("COMPA",&pack_options) < 0) + if (h5repack_addlayout("COMPA", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -944,210 +937,209 @@ int main (void) TESTING(" layout compact to contiguous conversion"); /*------------------------------------------------------------------------- - * layout compact to contiguous conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + * layout compact to contiguous conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_compact:CONTI",&pack_options) < 0) + if (h5repack_addlayout("dset_compact:CONTI", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout compact to chunk conversion"); /*------------------------------------------------------------------------- - * layout compact to chunk conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + * layout compact to chunk conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_compact:CHUNK=2x5",&pack_options) < 0) + if (h5repack_addlayout("dset_compact:CHUNK=2x5", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout compact to compact conversion"); /*------------------------------------------------------------------------- - * layout compact to compact conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + * layout compact to compact conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_compact:COMPA",&pack_options) < 0) + if (h5repack_addlayout("dset_compact:COMPA", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options)<= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout contiguous to compact conversion"); /*------------------------------------------------------------------------- - * layout contiguous to compact conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + * layout contiguous to compact conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_contiguous:COMPA",&pack_options) < 0) + if (h5repack_addlayout("dset_contiguous:COMPA", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout contiguous to chunk conversion"); /*------------------------------------------------------------------------- - * layout contiguous to chunk conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + * layout contiguous to chunk conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_contiguous:CHUNK=3x6",&pack_options) < 0) + if (h5repack_addlayout("dset_contiguous:CHUNK=3x6", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout contiguous to contiguous conversion"); /*------------------------------------------------------------------------- - * layout contiguous to contiguous conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + * layout contiguous to contiguous conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_contiguous:CONTI",&pack_options) < 0) + if (h5repack_addlayout("dset_contiguous:CONTI", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout chunked to compact conversion"); /*------------------------------------------------------------------------- - * layout chunked to compact conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + * layout chunked to compact conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_chunk:COMPA",&pack_options) < 0) + if (h5repack_addlayout("dset_chunk:COMPA", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout chunked to contiguous conversion"); /*------------------------------------------------------------------------- - * layout chunked to contiguous conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + * layout chunked to contiguous conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_chunk:CONTI",&pack_options) < 0) + if (h5repack_addlayout("dset_chunk:CONTI", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout chunked to chunk conversion"); /*------------------------------------------------------------------------- - * layout chunked to chunked conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0, FALSE) < 0) + * layout chunked to chunked conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_chunk:CHUNK=18x13",&pack_options) < 0) + if (h5repack_addlayout("dset_chunk:CHUNK=18x13", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * the following tests assume the input files have filters - * FNAME7 - * FNAME8 - * FNAME9 - * FNAME10 - * FNAME11 - *------------------------------------------------------------------------- - */ - - + * the following tests assume the input files have filters + * FNAME7 + * FNAME8 + * FNAME9 + * FNAME10 + * FNAME11 + *------------------------------------------------------------------------- + */ TESTING(" copy of szip filter"); #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME7,FNAME7OUT,&pack_options) < 0) + if (h5repack(FNAME7, FNAME7OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME7,FNAME7OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME7, FNAME7OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME7, FNAME7OUT,&pack_options)<=0) + if (h5repack_verify(FNAME7, FNAME7OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME7,FNAME7OUT)<=0) + if (h5repack_cmp_pl(FNAME7, FNAME7OUT) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); - } else { + } + else { SKIPPED(); } #else @@ -1158,21 +1150,22 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_szip:NONE",&pack_options) < 0) + if (h5repack_addfilter("dset_szip:NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME7,FNAME7OUT,&pack_options) < 0) + if (h5repack(FNAME7, FNAME7OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME7,FNAME7OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME7, FNAME7OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME7, FNAME7OUT,&pack_options)<=0) + if (h5repack_verify(FNAME7, FNAME7OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); - } else { + } + else { SKIPPED(); } #else @@ -1183,15 +1176,15 @@ int main (void) TESTING(" copy of deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME8,FNAME8OUT,&pack_options) < 0) + if (h5repack(FNAME8, FNAME8OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME8,FNAME8OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME8, FNAME8OUT,&pack_options)<=0) + if (h5repack_verify(FNAME8, FNAME8OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1203,17 +1196,17 @@ int main (void) TESTING(" removing deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_deflate:NONE",&pack_options) < 0) + if (h5repack_addfilter("dset_deflate:NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME8,FNAME8OUT,&pack_options) < 0) + if (h5repack(FNAME8, FNAME8OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME8,FNAME8OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME8, FNAME8OUT,&pack_options)<=0) + if (h5repack_verify(FNAME8, FNAME8OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1225,15 +1218,15 @@ int main (void) TESTING(" copy of shuffle filter"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME9,FNAME9OUT,&pack_options) < 0) + if (h5repack(FNAME9, FNAME9OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME9,FNAME9OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME9, FNAME9OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME9, FNAME9OUT,&pack_options)<=0) + if (h5repack_verify(FNAME9, FNAME9OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1241,17 +1234,17 @@ int main (void) TESTING(" removing shuffle filter"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_shuffle:NONE",&pack_options) < 0) + if (h5repack_addfilter("dset_shuffle:NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME9,FNAME9OUT,&pack_options) < 0) + if (h5repack(FNAME9, FNAME9OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME9,FNAME9OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME9, FNAME9OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME9, FNAME9OUT,&pack_options)<=0) + if (h5repack_verify(FNAME9, FNAME9OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1259,15 +1252,15 @@ int main (void) TESTING(" copy of fletcher filter"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME10,FNAME10OUT,&pack_options) < 0) + if (h5repack(FNAME10, FNAME10OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME10,FNAME10OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME10, FNAME10OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME10, FNAME10OUT,&pack_options)<=0) + if (h5repack_verify(FNAME10, FNAME10OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1275,17 +1268,17 @@ int main (void) TESTING(" removing fletcher filter"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_fletcher32:NONE",&pack_options) < 0) + if (h5repack_addfilter("dset_fletcher32:NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME10,FNAME10OUT,&pack_options) < 0) + if (h5repack(FNAME10, FNAME10OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME10,FNAME10OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME10, FNAME10OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME10, FNAME10OUT,&pack_options)<=0) + if (h5repack_verify(FNAME10, FNAME10OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1293,15 +1286,15 @@ int main (void) TESTING(" copy of nbit filter"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME12,FNAME12OUT,&pack_options) < 0) + if (h5repack(FNAME12, FNAME12OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME12,FNAME12OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME12, FNAME12OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME12, FNAME12OUT,&pack_options)<=0) + if (h5repack_verify(FNAME12, FNAME12OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1309,17 +1302,17 @@ int main (void) TESTING(" removing nbit filter"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_nbit:NONE",&pack_options) < 0) + if (h5repack_addfilter("dset_nbit:NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME12,FNAME12OUT,&pack_options) < 0) + if (h5repack(FNAME12, FNAME12OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME12,FNAME12OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME12, FNAME12OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME12, FNAME12OUT,&pack_options)<=0) + if (h5repack_verify(FNAME12, FNAME12OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1327,17 +1320,17 @@ int main (void) TESTING(" adding nbit filter"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_int31:NBIT",&pack_options) < 0) + if (h5repack_addfilter("dset_int31:NBIT", &pack_options) < 0) GOERROR; - if (h5repack(FNAME12,FNAME12OUT,&pack_options) < 0) + if (h5repack(FNAME12, FNAME12OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME12,FNAME12OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME12, FNAME12OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME12, FNAME12OUT,&pack_options)<=0) + if (h5repack_verify(FNAME12, FNAME12OUT, &pack_options)<= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1345,15 +1338,15 @@ int main (void) TESTING(" copy of scaleoffset filter"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME13,FNAME13OUT,&pack_options) < 0) + if (h5repack(FNAME13, FNAME13OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME13,FNAME13OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME13, FNAME13OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME13, FNAME13OUT,&pack_options)<=0) + if (h5repack_verify(FNAME13, FNAME13OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1361,17 +1354,17 @@ int main (void) TESTING(" removing scaleoffset filter"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_scaleoffset:NONE",&pack_options) < 0) + if (h5repack_addfilter("dset_scaleoffset:NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME13,FNAME13OUT,&pack_options) < 0) + if (h5repack(FNAME13, FNAME13OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME13,FNAME13OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME13, FNAME13OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME13, FNAME13OUT,&pack_options)<=0) + if (h5repack_verify(FNAME13, FNAME13OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1379,53 +1372,52 @@ int main (void) TESTING(" adding scaleoffset filter"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_none:SOFF=31,IN",&pack_options) < 0) + if (h5repack_addfilter("dset_none:SOFF=31,IN", &pack_options) < 0) GOERROR; - if (h5repack(FNAME13,FNAME13OUT,&pack_options) < 0) + if (h5repack(FNAME13, FNAME13OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME13,FNAME13OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME13, FNAME13OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME13, FNAME13OUT,&pack_options)<=0) + if (h5repack_verify(FNAME13, FNAME13OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * file with all filters - * dset_all - * dset_deflate - * dset_szip - * dset_shuffle - * dset_fletcher32 - *------------------------------------------------------------------------- - */ - - + * file with all filters + * dset_all + * dset_deflate + * dset_szip + * dset_shuffle + * dset_fletcher32 + *------------------------------------------------------------------------- + */ TESTING(" filter conversion from deflate to szip"); #if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_deflate:SZIP=8,NN",&pack_options) < 0) + if (h5repack_addfilter("dset_deflate:SZIP=8,NN", &pack_options) < 0) GOERROR; - if (h5repack(FNAME11,FNAME11OUT,&pack_options) < 0) + if (h5repack(FNAME11, FNAME11OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME11, FNAME11OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME11, FNAME11OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11, FNAME11OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); - } else { + } + else { SKIPPED(); } #else @@ -1437,21 +1429,22 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_szip:GZIP=1",&pack_options) < 0) + if (h5repack_addfilter("dset_szip:GZIP=1", &pack_options) < 0) GOERROR; - if (h5repack(FNAME11,FNAME11OUT,&pack_options) < 0) + if (h5repack(FNAME11, FNAME11OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME11, FNAME11OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME11, FNAME11OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11, FNAME11OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); - } else { + } + else { SKIPPED(); } #else @@ -1460,25 +1453,25 @@ int main (void) /*------------------------------------------------------------------------- - * test the NONE global option - *------------------------------------------------------------------------- - */ + * test the NONE global option + *------------------------------------------------------------------------- + */ TESTING(" removing all filters"); #if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("NONE",&pack_options) < 0) + if (h5repack_addfilter("NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME11,FNAME11OUT,&pack_options) < 0) + if (h5repack(FNAME11, FNAME11OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME11, FNAME11OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME11, FNAME11OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11, FNAME11OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1487,44 +1480,44 @@ int main (void) #endif /*------------------------------------------------------------------------- - * test a big file - *------------------------------------------------------------------------- - */ + * test a big file + *------------------------------------------------------------------------- + */ TESTING(" big file"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME14,FNAME14OUT,&pack_options) < 0) + if (h5repack(FNAME14, FNAME14OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME14,FNAME14OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME14, FNAME14OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME14, FNAME14OUT,&pack_options)<=0) + if (h5repack_verify(FNAME14, FNAME14OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * test external dataset - *------------------------------------------------------------------------- - */ + * test external dataset + *------------------------------------------------------------------------- + */ TESTING(" external datasets"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME15,FNAME15OUT,&pack_options) < 0) + if (h5repack(FNAME15, FNAME15OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME15,FNAME15OUT,NULL,NULL,&diff_options) > 0) + if (h5diff(FNAME15, FNAME15OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME15, FNAME15OUT,&pack_options)<=0) + if (h5repack_verify(FNAME15, FNAME15OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * test file with userblock - *------------------------------------------------------------------------- - */ + * test file with userblock + *------------------------------------------------------------------------- + */ TESTING(" file with userblock"); if(h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; @@ -1541,53 +1534,53 @@ int main (void) PASSED(); /*------------------------------------------------------------------------- - * test --latest options - *------------------------------------------------------------------------- - */ + * test --latest options + *------------------------------------------------------------------------- + */ TESTING(" latest file format options"); - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - pack_options.latest=1; - pack_options.grp_compact=10; - pack_options.grp_indexed=5; + pack_options.latest = 1; + pack_options.grp_compact = 10; + pack_options.grp_indexed = 5; pack_options.msg_size[0] = 10; pack_options.msg_size[1] = 20; pack_options.msg_size[2] = 30; pack_options.msg_size[3] = 40; pack_options.msg_size[4] = 50; - if (h5repack(FNAME1,FNAME1OUT,&pack_options) < 0) + if (h5repack(FNAME1, FNAME1OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME1,FNAME1OUT,NULL,NULL,&diff_options) > 0) + if (h5diff(FNAME1, FNAME1OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME1, FNAME1OUT,&pack_options)<=0) + if (h5repack_verify(FNAME1, FNAME1OUT, &pack_options)<=0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * test several global filters - *------------------------------------------------------------------------- - */ + * test several global filters + *------------------------------------------------------------------------- + */ TESTING(" several global filters"); #if defined (H5_HAVE_FILTER_DEFLATE) - if (h5repack_init (&pack_options, 0, FALSE) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("GZIP=1",&pack_options) < 0) + if (h5repack_addfilter("GZIP=1", &pack_options) < 0) GOERROR; - if (h5repack_addfilter("SHUF",&pack_options) < 0) + if (h5repack_addfilter("SHUF", &pack_options) < 0) GOERROR; - if (h5repack(FNAME11,FNAME11OUT,&pack_options) < 0) + if (h5repack(FNAME11, FNAME11OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME11, FNAME11OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME11, FNAME11OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11, FNAME11OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1597,9 +1590,9 @@ int main (void) /*------------------------------------------------------------------------- - * test file with userblock - *------------------------------------------------------------------------- - */ + * test file with userblock + *------------------------------------------------------------------------- + */ TESTING(" file with added userblock"); #ifdef H5_HAVE_FILTER_DEFLATE @@ -1630,9 +1623,9 @@ int main (void) /*------------------------------------------------------------------------- - * test file with aligment - *------------------------------------------------------------------------- - */ + * test file with aligment + *------------------------------------------------------------------------- + */ TESTING(" file with aligment"); #ifdef H5_HAVE_FILTER_DEFLATE @@ -1655,20 +1648,20 @@ int main (void) { hsize_t threshold; hsize_t alignment; - hid_t fapl; - hid_t fid; + hid_t fapl; + hid_t fid; - if (( fid = H5Fopen(FNAME8OUT, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) + if ((fid = H5Fopen(FNAME8OUT, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) GOERROR; if ((fapl = H5Fget_access_plist(fid)) < 0) GOERROR; - if ( H5Pget_alignment(fapl, &threshold, &alignment ) < 0) + if (H5Pget_alignment(fapl, &threshold, &alignment) < 0) GOERROR; - if ( threshold != 1 ) + if (threshold != 1) GOERROR; - if ( alignment != 1 ) + if (alignment != 1) GOERROR; - if ( H5Pclose(fapl) < 0) + if (H5Pclose(fapl) < 0) GOERROR; if (H5Fclose(fid) < 0) GOERROR; @@ -1686,9 +1679,9 @@ int main (void) #endif /*------------------------------------------------------------------------- - * test file with userblock - *------------------------------------------------------------------------- - */ + * test file with userblock + *------------------------------------------------------------------------- + */ TESTING(" file with committed datatypes"); if(h5repack_init(&pack_options, 0, FALSE) < 0) @@ -1707,13 +1700,13 @@ int main (void) PASSED(); /*------------------------------------------------------------------------- - * test --metadata_block_size option - * Also verify that output file using the metadata_block_size option is - * larger than the output file one not using it. - * FNAME4 is used because it is the same as the test file used for the - * shell script version of this test (h5repack.sh). - *------------------------------------------------------------------------- - */ + * test --metadata_block_size option + * Also verify that output file using the metadata_block_size option is + * larger than the output file one not using it. + * FNAME4 is used because it is the same as the test file used for the + * shell script version of this test (h5repack.sh). + *------------------------------------------------------------------------- + */ TESTING(" metadata block size option"); /* First run without metadata option. No need to verify the correctness */ /* since this has been verified by earlier tests. Just record the file */ @@ -1751,9 +1744,9 @@ int main (void) /*------------------------------------------------------------------------- - * clean temporary test files - *------------------------------------------------------------------------- - */ + * clean temporary test files + *------------------------------------------------------------------------- + */ { hid_t fapl; @@ -1778,24 +1771,24 @@ error: /*------------------------------------------------------------------------- * Function: make_testfiles * -* Purpose: make a test file with all types of HDF5 objects, -* datatypes and filters +* Purpose: make a test file with all types of HDF5 objects, +* datatypes and filters * *------------------------------------------------------------------------- */ static int make_testfiles(void) { - hid_t fid; - hid_t fcpl; /* File creation property list */ - hid_t fapl; /* File access property list */ - unsigned j; /* Local index variable */ + hid_t fid = -1; + hid_t fcpl = -1; /* File creation property list */ + hid_t fapl = -1; /* File access property list */ + unsigned j; /* Local index variable */ /*------------------------------------------------------------------------- - * create a file for general copy test - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME0,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file for general copy test + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME0, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_fill(fid) < 0) goto out; @@ -1803,10 +1796,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create another file for general copy test (all datatypes) - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create another file for general copy test (all datatypes) + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_all_objects(fid) < 0) goto out; @@ -1814,10 +1807,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file for attributes copy test - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME2,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file for attributes copy test + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_attributes(fid) < 0) goto out; @@ -1825,10 +1818,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file for hard links test - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file for hard links test + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_hlinks(fid) < 0) goto out; @@ -1836,10 +1829,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file for layouts test - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME4,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file for layouts test + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME4, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_layout(fid) < 0) goto out; @@ -1847,9 +1840,9 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file for layout conversion test - *------------------------------------------------------------------------- - */ + * create a file for layout conversion test + *------------------------------------------------------------------------- + */ if((fid = H5Fcreate(FNAME18, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; @@ -1860,9 +1853,9 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * for test layout conversions form chunk with unlimited max dims - *------------------------------------------------------------------------- - */ + * for test layout conversions form chunk with unlimited max dims + *------------------------------------------------------------------------- + */ if((fid = H5Fcreate("h5repack_layout3.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; @@ -1873,18 +1866,18 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file for the H5D_ALLOC_TIME_EARLY test - *------------------------------------------------------------------------- - */ + * create a file for the H5D_ALLOC_TIME_EARLY test + *------------------------------------------------------------------------- + */ if (make_early() < 0) goto out; /*------------------------------------------------------------------------- - * create a file with the SZIP filter - *------------------------------------------------------------------------- - */ + * create a file with the SZIP filter + *------------------------------------------------------------------------- + */ #ifdef H5_HAVE_FILTER_SZIP - if((fid = H5Fcreate(FNAME7,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME7, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_szip(fid) < 0) goto out; @@ -1894,10 +1887,10 @@ int make_testfiles(void) /*------------------------------------------------------------------------- - * create a file with the deflate filter - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME8,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with the deflate filter + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME8, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_deflate(fid) < 0) goto out; @@ -1905,10 +1898,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with the shuffle filter - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME9,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with the shuffle filter + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME9, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_shuffle(fid) < 0) goto out; @@ -1916,10 +1909,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with the fletcher32 filter - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME10,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with the fletcher32 filter + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME10, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_fletcher32(fid) < 0) goto out; @@ -1927,10 +1920,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with all the filters - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME11,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with all the filters + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME11, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_all_filters(fid) < 0) goto out; @@ -1938,10 +1931,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with the nbit filter - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME12,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with the nbit filter + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME12, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_nbit(fid) < 0) goto out; @@ -1949,10 +1942,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with the scaleoffset filter - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME13,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with the scaleoffset filter + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME13, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_scaleoffset(fid) < 0) goto out; @@ -1960,10 +1953,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a big dataset - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME14,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a big dataset + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME14, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_big(fid) < 0) goto out; @@ -1971,10 +1964,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with external dataset - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME15,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with external dataset + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME15, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_external(fid) < 0) goto out; @@ -1982,24 +1975,24 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with userblock - *------------------------------------------------------------------------- - */ + * create a file with userblock + *------------------------------------------------------------------------- + */ if(make_userblock() < 0) goto out; /*------------------------------------------------------------------------- - * create a userblock file - *------------------------------------------------------------------------- - */ + * create a userblock file + *------------------------------------------------------------------------- + */ if(make_userblock_file() < 0) goto out; /*------------------------------------------------------------------------- - * create a file with named datatypes - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME17,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with named datatypes + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME17, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_named_dtype(fid) < 0) goto out; @@ -2007,11 +2000,12 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create obj and region reference type datasets (bug1814) - * add attribute with int type (bug1726) - * add attribute with obj and region reference type (bug1726) - *-------------------------------------------------------------------------*/ - if((fid = H5Fcreate(FNAME_REF,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create obj and region reference type datasets (bug1814) + * add attribute with int type (bug1726) + * add attribute with obj and region reference type (bug1726) + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME_REF, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; /* create reference type datasets */ if (make_references(fid) < 0) @@ -2020,10 +2014,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with obj and region references in attribute of compound and - * vlen datatype - *-------------------------------------------------------------------------*/ - if((fid = H5Fcreate(FNAME_ATTR_REF,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with obj and region references in attribute of compound and + * vlen datatype + *-------------------------------------------------------------------------*/ + if((fid = H5Fcreate(FNAME_ATTR_REF, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_complex_attr_references(fid) < 0) goto out; @@ -2042,9 +2036,9 @@ int make_testfiles(void) if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) return -1; - /* - * #0 -- h5repack_latest.h5 - * default: strategy=FSM_AGGR, persist=FALSE, threshold=1 + /* + * #0 -- h5repack_latest.h5 + * default: strategy=FSM_AGGR, persist=FALSE, threshold=1 * default: inpage=4096 */ j = 0; @@ -2053,9 +2047,9 @@ int make_testfiles(void) if(H5Fclose(fid) < 0) return -1; - /* - * #1 -- h5repack_default.h5 - * default: strategy=FSM_AGGR, persist=FALSE, threshold=1 + /* + * #1 -- h5repack_default.h5 + * default: strategy=FSM_AGGR, persist=FALSE, threshold=1 * default: inpage=4096 */ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); @@ -2064,11 +2058,11 @@ int make_testfiles(void) if(H5Fclose(fid) < 0) return -1; - /* + /* * #2 -- h5repack_page_persist.h5 - * Setting: - * strategy=PAGE, persist=TRUE, threshold=1 - * inpage=512 + * Setting: + * strategy=PAGE, persist=TRUE, threshold=1 + * inpage=512 * latest format */ /* Create file creation property list */ @@ -2087,10 +2081,10 @@ int make_testfiles(void) return -1; - /* + /* * #3 -- h5repack_fsm_aggr_persist.h5 * Setting: - * strategy=FSM_AGGR, persist=TRUE, threshold=1 + * strategy=FSM_AGGR, persist=TRUE, threshold=1 * default: inpage=4096 */ /* Create file creation property list */ @@ -2107,10 +2101,10 @@ int make_testfiles(void) return -1; - /* + /* * #4 -- h5repack_page_threshold.h5 * Setting: - * strategy=PAGE, persist=FALSE, threshold=3 + * strategy=PAGE, persist=FALSE, threshold=3 * inpage=8192 * latest format */ @@ -2133,8 +2127,8 @@ int make_testfiles(void) /* * #5 -- h5repack_fsm_aggr_threshold.h5 * Setting: - * strategy=FSM_AGGR, persist=FALSE, threshold=3 - * inpage=4096 + * strategy=FSM_AGGR, persist=FALSE, threshold=3 + * inpage=4096 */ /* Create file creation property list */ @@ -2152,10 +2146,10 @@ int make_testfiles(void) if(H5Pclose(fcpl) < 0) return -1; - /* - * #6 -- h5repack_aggr.h5 + /* + * #6 -- h5repack_aggr.h5 * Setting: - * strategy=AGGR, persist=FALSE, threshold=1 + * strategy=AGGR, persist=FALSE, threshold=1 * latest format */ @@ -2172,11 +2166,11 @@ int make_testfiles(void) if(H5Pclose(fcpl) < 0) return -1; - /* + /* * #7 -- h5repack_none.h5 * Setting: - * strategy=NONE, persist=FALSE, threshold=1 - * inpage=8192 + * strategy=NONE, persist=FALSE, threshold=1 + * inpage=8192 */ /* Create file creation property list */ @@ -2209,20 +2203,20 @@ out: /*------------------------------------------------------------------------- * Function: make_all_objects * -* Purpose: make a test file with all types of HDF5 objects +* Purpose: make a test file with all types of HDF5 objects * *------------------------------------------------------------------------- */ static int make_all_objects(hid_t loc_id) { - hid_t did=-1; - hid_t gid=-1; - hid_t tid=-1; - hid_t rid=-1; - hid_t sid=-1; - hid_t gcplid=-1; - hsize_t dims[1]={2}; + hid_t did = -1; + hid_t gid = -1; + hid_t tid = -1; + hid_t rid = -1; + hid_t sid = -1; + hid_t gcplid = -1; + hsize_t dims[1] = {2}; /* compound datatype */ typedef struct s_t { @@ -2297,7 +2291,7 @@ int make_all_objects(hid_t loc_id) if ((rid = H5Gopen2(loc_id, "/", H5P_DEFAULT)) < 0) goto out; - if (write_dset_in(rid,"dset_referenced",loc_id,0) < 0) + if (write_dset_in(rid, "dset_referenced", loc_id, 0) < 0) goto out; if (H5Gclose(rid) < 0) goto out; @@ -2331,18 +2325,18 @@ out: /*------------------------------------------------------------------------- * Function: make_attributes * -* Purpose: make a test file with all types of attributes +* Purpose: make a test file with all types of attributes * *------------------------------------------------------------------------- */ static int make_attributes(hid_t loc_id) { - hid_t did=-1; - hid_t gid=-1; - hid_t rid=-1; - hid_t sid=-1; - hsize_t dims[1]={2}; + hid_t did = -1; + hid_t gid = -1; + hid_t rid = -1; + hid_t sid = -1; + hsize_t dims[1] = {2}; /*------------------------------------------------------------------------- * H5G_DATASET @@ -2367,11 +2361,11 @@ int make_attributes(hid_t loc_id) *------------------------------------------------------------------------- */ - if ( write_attr_in(did,"dset",loc_id,0) < 0) + if ( write_attr_in(did, "dset", loc_id, 0) < 0) goto out; - if (write_attr_in(gid,"dset",loc_id,0) < 0) + if (write_attr_in(gid, "dset", loc_id, 0) < 0) goto out; - if (write_attr_in(rid,"dset",loc_id,0) < 0) + if (write_attr_in(rid, "dset", loc_id, 0) < 0) goto out; /* close */ @@ -2401,18 +2395,18 @@ out: /*------------------------------------------------------------------------- * Function: make_hlinks * -* Purpose: make a test file with hard links +* Purpose: make a test file with hard links * *------------------------------------------------------------------------- */ static int make_hlinks(hid_t loc_id) { - hid_t g1id=-1; - hid_t g2id=-1; - hid_t g3id=-1; - hsize_t dims[2]={3,2}; - int buf[3][2]= {{1,1},{1,2},{2,2}}; + hid_t g1id =- 1; + hid_t g2id = -1; + hid_t g3id = -1; + hsize_t dims[2] = {3,2}; + int buf[3][2] = {{1,1}, {1,2}, {2,2}}; /*------------------------------------------------------------------------- * create a dataset and some hard links to it @@ -2471,7 +2465,7 @@ out: /*------------------------------------------------------------------------- * Function: make_szip * -* Purpose: make a dataset with the SZIP filter +* Purpose: make a dataset with the SZIP filter * *------------------------------------------------------------------------- */ @@ -2479,21 +2473,19 @@ out: static int make_szip(hid_t loc_id) { - hid_t dcpl; /* dataset creation property list */ - hid_t sid; /* dataspace ID */ - unsigned szip_options_mask=H5_SZIP_ALLOW_K13_OPTION_MASK|H5_SZIP_NN_OPTION_MASK; - unsigned szip_pixels_per_block=8; - hsize_t dims[RANK]={DIM1,DIM2}; - hsize_t chunk_dims[RANK]={CDIM1,CDIM2}; + hid_t dcpl = -1; /* dataset creation property list */ + hid_t sid = -1; /* dataspace ID */ + unsigned szip_options_mask = H5_SZIP_ALLOW_K13_OPTION_MASK | H5_SZIP_NN_OPTION_MASK; + unsigned szip_pixels_per_block = 8; + hsize_t dims[RANK] = {DIM1, DIM2}; + hsize_t chunk_dims[RANK] = {CDIM1, CDIM2}; int buf[DIM1][DIM2]; int i, j, n; int szip_can_encode = 0; - for (i=n=0; i 0) H5Sclose(sid2); return ret; - + } /*------------------------------------------------------------------------- * Function: gen_obj_ref * - * Purpose: + * Purpose: * Generate object references to objects (dataset,group and named datatype) * * Note: - * copied from h5copygentest.c and upate to create named datatype + * copied from h5copygentest.c and upate to create named datatype * * Programmer: Jonathan Kim (March 18, 2010) *------------------------------------------------------------------------*/ @@ -6478,7 +6432,7 @@ static herr_t gen_obj_ref(hid_t loc_id) /* attr with int type */ hsize_t dim_attr_int[1]={2}; - int data_attr_int[2] = {10,20}; + int data_attr_int[2] = {10,20}; /* write buffer for obj reference */ hobj_ref_t objref_buf[3]; @@ -6515,7 +6469,7 @@ static herr_t gen_obj_ref(hid_t loc_id) } /*--------------------------------------------------------- - * create dataset contain references + * create dataset contain references */ sid = H5Screate_simple (1, dims_dset_objref, NULL); if (sid < 0) @@ -6579,7 +6533,7 @@ out: * Purpose: Generate dataset region references * * Note: - * copied from h5copygentest.c + * copied from h5copygentest.c * * Programmer: Jonathan Kim (March 18, 2010) *------------------------------------------------------------------------*/ @@ -6589,11 +6543,11 @@ static herr_t gen_region_ref(hid_t loc_id) herr_t ret = SUCCEED; /* target dataset */ - hid_t sid_trg=0; + hid_t sid_trg=0; hsize_t dims_trg[2] = {3,16}; /* dset with region ref type */ - hid_t sid_ref=0, oid_ref=0; + hid_t sid_ref=0, oid_ref=0; /* region ref to target dataset */ hsize_t coords[4][2] = { {0,1}, {2,11}, {1,0}, {2,4} }; @@ -6606,7 +6560,7 @@ static herr_t gen_region_ref(hid_t loc_id) /* attr with int type */ hsize_t dim_attr_int[1]={2}; - int data_attr_int[2] = {10,20}; + int data_attr_int[2] = {10,20}; sid_trg = H5Screate_simple (2, dims_trg, NULL); if (sid_trg < 0) @@ -6707,7 +6661,7 @@ out: if (sid_ref > 0) H5Sclose (sid_ref); if (sid_trg > 0) - H5Sclose (sid_trg); + H5Sclose (sid_trg); return ret; } @@ -6715,7 +6669,7 @@ out: /*------------------------------------------------------------------------- * Function: make_references * -* Purpose: create a file with obj and region references +* Purpose: create a file with obj and region references * * Programmer: Jonathan Kim (March 18, 2010) *------------------------------------------------------------------------- @@ -6731,7 +6685,7 @@ static herr_t make_references(hid_t loc_id) { fprintf(stderr, "Failed to generate referenced object.\n"); ret = FAIL; - } + } /* add object reference */ status = gen_obj_ref(loc_id); @@ -6755,7 +6709,7 @@ static herr_t make_references(hid_t loc_id) /*------------------------------------------------------------------------- * Function: make_complex_attr_references * -* Purpose: +* Purpose: * create a file with : * 1. obj ref in attribute of compound type * 2. region ref in attribute of compound type @@ -6787,14 +6741,14 @@ static herr_t make_references(hid_t loc_id) /* 4. region references in vlen attr */ #define RANK_VLEN_REGREF 1 #define DIM_VLEN_REGREF 1 /* for element region */ -#define LEN0_VLEN_REGREF 1 /* element region */ +#define LEN0_VLEN_REGREF 1 /* element region */ static herr_t make_complex_attr_references(hid_t loc_id) { herr_t ret = SUCCEED; - herr_t status; - /* - * for objects + herr_t status; + /* + * for objects */ hid_t objgid=0, objdid=0, objtid=0, objsid=0; hsize_t obj_dims[RANK_OBJ] = {DIM0_OBJ, DIM1_OBJ}; @@ -6815,8 +6769,8 @@ static herr_t make_complex_attr_references(hid_t loc_id) */ hsize_t main_dset_dims[RANK_DSET] = {DIM_DSET}; hid_t main_sid=0, main_did=0; - /* - * 1. obj references in compound attr + /* + * 1. obj references in compound attr */ hid_t comp_objref_tid=0, comp_objref_aid=0; typedef struct comp_objref_t { @@ -6827,8 +6781,8 @@ static herr_t make_complex_attr_references(hid_t loc_id) hid_t comp_objref_attr_sid=0; hsize_t comp_objref_dim[RANK_COMP_OBJREF] = {DIM_COMP_OBJREF}; - /* - * 2. region references in compound attr + /* + * 2. region references in compound attr */ hid_t comp_regref_tid=0, comp_regref_aid=0; typedef struct comp_regref_t { @@ -6839,16 +6793,16 @@ static herr_t make_complex_attr_references(hid_t loc_id) hid_t comp_regref_attr_sid=0; hsize_t comp_regref_dim[RANK_COMP_REGREF] = {DIM_COMP_REGREF}; hsize_t coords[4][2] = { {0,1}, {2,3}, {3,4}, {4,5} }; - - /* - * 3. obj references in vlen attr + + /* + * 3. obj references in vlen attr */ hid_t vlen_objref_attr_tid=0, vlen_objref_attr_sid=0; hid_t vlen_objref_attr_id=0; hvl_t vlen_objref_data[DIM_VLEN_OBJREF]; hsize_t vlen_objref_dims[RANK_VLEN_OBJREF] = {DIM_VLEN_OBJREF}; - /* + /* * 4. region references in vlen attr */ hid_t vlen_regref_attr_tid=0, vlen_regref_attr_sid=0; @@ -6858,7 +6812,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) /* --------------------------------------- - * create objects which to be referenced + * create objects which to be referenced */ /* object1 group */ objgid = H5Gcreate2(loc_id, NAME_OBJ_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -6886,7 +6840,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) /* --------------------------------------------- - * Put testing objs in this group + * Put testing objs in this group * create group contain dataset with attribute and the attribute has * compound type which contain obj and region reference */ main_gid = H5Gcreate2(loc_id, "group_main", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -6903,7 +6857,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) main_sid = H5Screate_simple(RANK_DSET, main_dset_dims, NULL); main_did = H5Dcreate2(main_gid, "dset_main", H5T_NATIVE_INT, main_sid, H5P_DEFAULT,H5P_DEFAULT, H5P_DEFAULT); - + status = H5Dwrite(main_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]); if (status < 0) { @@ -6916,8 +6870,8 @@ static herr_t make_complex_attr_references(hid_t loc_id) * 1. create obj references in a attribute of compound type */ - /* - * create compound type for attribute + /* + * create compound type for attribute */ comp_objref_tid = H5Tcreate (H5T_COMPOUND, sizeof(comp_objref_t)); @@ -6956,8 +6910,8 @@ static herr_t make_complex_attr_references(hid_t loc_id) goto out; } comp_objref_data[2].val_int = 20; - - /* + + /* * create attribute and write the object ref */ comp_objref_attr_sid = H5Screate_simple (RANK_COMP_OBJREF, comp_objref_dim, NULL); @@ -6982,7 +6936,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) H5Tinsert(comp_regref_tid, "value_int", HOFFSET(comp_regref_t, val_int), H5T_NATIVE_INT); /* - * create the region reference + * create the region reference */ status = H5Sselect_elements (objsid, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) @@ -7027,8 +6981,8 @@ static herr_t make_complex_attr_references(hid_t loc_id) vlen_objref_data[2].len = LEN2_VLEN_OBJREF; vlen_objref_data[2].p = HDmalloc (vlen_objref_data[2].len * sizeof(hobj_ref_t)); - /* - * create obj references + /* + * create obj references */ /* reference to dataset */ status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1); @@ -7039,7 +6993,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) goto out; } /* reference to group */ - status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[1].p)[0], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); + status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[1].p)[0], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); @@ -7054,15 +7008,15 @@ static herr_t make_complex_attr_references(hid_t loc_id) ret = FAIL; goto out; } - - /* + + /* * create vlen type with obj reference */ vlen_objref_attr_tid = H5Tvlen_create (H5T_STD_REF_OBJ); vlen_objref_attr_sid = H5Screate_simple (RANK_VLEN_OBJREF, vlen_objref_dims, NULL); /* - * create attribute and write the object reference + * create attribute and write the object reference */ vlen_objref_attr_id = H5Acreate2(main_did, "Vlen_OBJREF", vlen_objref_attr_tid, vlen_objref_attr_sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite (vlen_objref_attr_id, vlen_objref_attr_tid, vlen_objref_data); @@ -7085,7 +7039,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) /*------------------------------------------------------------------- * 4. create region references in a attribute of vlen type */ - + /* * prepare vlen data */ @@ -7093,7 +7047,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) vlen_regref_data[0].p = HDmalloc (vlen_regref_data[0].len * sizeof(hdset_reg_ref_t)); /* - * create region reference + * create region reference */ status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) @@ -7109,15 +7063,15 @@ static herr_t make_complex_attr_references(hid_t loc_id) ret = FAIL; goto out; } - - /* + + /* * create vlen type with region reference */ vlen_regref_attr_tid = H5Tvlen_create(H5T_STD_REF_DSETREG); vlen_regref_attr_sid = H5Screate_simple(RANK_VLEN_REGREF, vlen_regref_dim, NULL); - + /* - * create attribute and write the region reference + * create attribute and write the region reference */ vlen_regref_attr_id = H5Acreate2(main_did, "Vlen_REGREF", vlen_regref_attr_tid, vlen_regref_attr_sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(vlen_regref_attr_id, vlen_regref_attr_tid, vlen_regref_data); @@ -7127,7 +7081,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) ret = FAIL; goto out; } - + /* close resource for vlen data */ status = H5Dvlen_reclaim (vlen_regref_attr_tid, vlen_regref_attr_sid, H5P_DEFAULT, vlen_regref_data); if (status < 0) -- cgit v0.12 From 9849d61344faf01f366fff2e67026e468e184f06 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Wed, 11 Oct 2017 10:15:33 -0400 Subject: Made edits suggested by John as part of the code review --- testpar/t_pread.c | 200 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 146 insertions(+), 54 deletions(-) diff --git a/testpar/t_pread.c b/testpar/t_pread.c index 48c14a9..b40fc09 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -20,11 +20,24 @@ #include "h5test.h" #include "testpar.h" -#define NFILENAME 3 -const char *FILENAMES[NFILENAME + 1]={"t_pread_data_file", - "reloc_t_pread_data_file", - "prefix_file", - NULL}; +/* The collection of files is included below to aid + * an external "cleanup" process if required. + * + * Note that the code below relies on the ordering of this array + * since each set of three is used by the tests either to construct + * or to read and validate. + */ +#define NFILENAME 9 +const char *FILENAMES[NFILENAME + 1]={"t_pread_data_file", + "reloc_t_pread_data_file", + "prefix_file", + "t_pread_group_0_file", + "reloc_t_pread_group_0_file", + "prefix_file_0", + "t_pread_group_1_file", + "reloc_t_pread_group_1_file", + "prefix_file_1", + NULL}; #define FILENAME_BUF_SIZE 1024 #define COUNT 1000 @@ -56,15 +69,19 @@ static int test_parallel_read(MPI_Comm comm, int mpi_rank, int group); * * Since data will be read back and validated, we generate * data in a predictable manner rather than randomly. - * For now, we simply use the mpi_rank of the writing - * process as a starting component of the data generation. + * For now, we simply use the global mpi_rank of the writing + * process as a starting component for the data generation. * Subsequent writes are increments from the initial start * value. * * In the overall scheme of running the test, we'll call - * this function twice so as to create two seperate files. - * Each file will serve as the input data for two - * independent parallel reads. + * this function twice: first as a collection of all MPI + * processes and then a second time with the processes split + * more or less in half. Each sub group will operate + * collectively on their assigned file. This split into + * subgroups validates that parallel groups can successfully + * open and read data independantly from the other parallel + * operations taking place. * * Return: Success: 0 * @@ -83,10 +100,11 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) FILE *header; const char *fcn_name = "generate_test_file()"; const char *failure_mssg = NULL; - char group_file[FILENAME_BUF_SIZE]; + const char *group_filename = NULL; char data_filename[FILENAME_BUF_SIZE]; char reloc_data_filename[FILENAME_BUF_SIZE]; char prolog_filename[FILENAME_BUF_SIZE]; + int file_index; int group_size; int group_rank; int local_failure = 0; @@ -123,14 +141,32 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) HDfprintf(stdout, "Constructing test files..."); } - /* setup the file names */ + /* Setup the file names + * The test specfic filenames are stored as consecutive + * array entries in the global 'FILENAMES' array above. + * Here, we simply decide on the starting index for + * file construction. The reading portion of the test + * will have a similar setup process... + */ if ( pass ) { - HDassert(FILENAMES[0]); - if ( HDsprintf(group_file, "%s_%d", FILENAMES[0], group_id) < 0) { - pass = FALSE; - failure_mssg = "HDsprintf(0) failed.\n"; - } - else if ( h5_fixname(group_file, H5P_DEFAULT, data_filename, + if ( comm == MPI_COMM_WORLD ) { /* Test 1 */ + file_index = 0; + } + else if ( group_id == 0 ) { /* Test 2 group 0 */ + file_index = 3; + } + else { /* Test 2 group 1 */ + file_index = 6; + } + + /* The 'group_filename' is just a temp variable and + * is used to call into the h5_fixname function. No + * need to worry that we reassign it for each file! + */ + HDassert((group_filename = FILENAMES[file_index])); + + /* Assign the 'data_filename' */ + if ( h5_fixname(group_filename, H5P_DEFAULT, data_filename, sizeof(data_filename)) == NULL ) { pass = FALSE; failure_mssg = "h5_fixname(0) failed.\n"; @@ -138,12 +174,11 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } if ( pass ) { - HDassert(FILENAMES[1]); - if ( HDsprintf(group_file, "%s_%d", FILENAMES[1], group_id) < 0) { - pass = FALSE; - failure_mssg = "HDsprintf(1) failed.\n"; - } - else if ( h5_fixname(group_file, H5P_DEFAULT, reloc_data_filename, + + HDassert( (group_filename = FILENAMES[file_index+1]) ); + + /* Assign the 'reloc_data_filename' */ + if ( h5_fixname(group_filename, H5P_DEFAULT, reloc_data_filename, sizeof(reloc_data_filename)) == NULL ) { pass = FALSE; @@ -152,12 +187,11 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } if ( pass ) { - HDassert(FILENAMES[2]); - if ( HDsprintf(group_file, "%s_%d", FILENAMES[2], group_id) < 0) { - pass = FALSE; - failure_mssg = "HDsprintf(2) failed.\n"; - } - else if ( h5_fixname(group_file, H5P_DEFAULT, prolog_filename, + + HDassert( (group_filename = FILENAMES[file_index+2]) ); + + /* Assing the 'prolog_filename' */ + if ( h5_fixname(group_filename, H5P_DEFAULT, prolog_filename, sizeof(prolog_filename)) == NULL ) { pass = FALSE; failure_mssg = "h5_fixname(2) failed.\n"; @@ -305,11 +339,20 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } } - /* add a userblock to the head of the datafile. + /* Add a userblock to the head of the datafile. * We will use this to for a functional test of the - * file open optimization. + * file open optimization. This is superblock + * relocation is done by the rank 0 process associated + * with the communicator being used. For test 1, we + * utilize MPI_COMM_WORLD, so group_rank 0 is the + * same as mpi_rank 0. For test 2 which utilizes + * two groups resulting from an MPI_Comm_split, we + * will have parallel groups and hence two + * group_rank(0) processes. Each parallel group + * will create a unique file with different text + * headers and different data. * - * Also delete files that are no longer needed. + * We also delete files that are no longer needed. */ if ( group_rank == 0 ) { @@ -443,7 +486,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) { const char *failure_mssg; const char *fcn_name = "test_parallel_read()"; - char group_file[FILENAME_BUF_SIZE]; + const char *group_filename = NULL; char reloc_data_filename[FILENAME_BUF_SIZE]; int local_failure = 0; int global_failures = 0; @@ -476,8 +519,12 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) } if ( mpi_rank == 0 ) { - - TESTING("parallel file open test 1"); + if ( comm == MPI_COMM_WORLD ) { + TESTING("parallel file open test 1"); + } + else { + TESTING("parallel file open test 2"); + } } /* allocate space for the data_slice array */ @@ -489,14 +536,21 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int group_id) } - /* construct file file name */ + /* Select the file file name to read + * Please see the comments in the 'generate_test_file' function + * for more details... + */ if ( pass ) { - HDassert(FILENAMES[1]); - if ( HDsprintf(group_file, "%s_%d", FILENAMES[1], group_id) < 0) { - pass = FALSE; - failure_mssg = "HDsprintf(0) failed.\n"; - } - else if ( h5_fixname(group_file, H5P_DEFAULT, reloc_data_filename, + + if ( comm == MPI_COMM_WORLD ) /* test 1 */ + group_filename = FILENAMES[1]; + else if ( group_id == 0 ) /* test 2 group 0 */ + group_filename = FILENAMES[4]; + else /* test 2 group 1 */ + group_filename = FILENAMES[7]; + + HDassert(group_filename); + if ( h5_fixname(group_filename, H5P_DEFAULT, reloc_data_filename, sizeof(reloc_data_filename)) == NULL ) { pass = FALSE; @@ -702,11 +756,11 @@ int main( int argc, char **argv) { int nerrs = 0; - int which_group; + int which_group = 0; int mpi_rank; int mpi_size; int split_size; - MPI_Comm group_comm = MPI_COMM_NULL; + MPI_Comm group_comm = MPI_COMM_WORLD; if ( (MPI_Init(&argc, &argv)) != MPI_SUCCESS) { HDfprintf(stderr, "FATAL: Unable to initialize MPI\n"); @@ -741,9 +795,42 @@ main( int argc, char **argv) goto finish; } - /* Divide the available processes into two groups - * that are the same size (plus or minus). + /* ------ Test 1 of 2 ------ + * In this test we utilize all processes which makeup MPI_COMM_WORLD. + * We generate the test file which we'll shortly try to read. */ + nerrs += generate_test_file( group_comm, mpi_rank, which_group ); + + /* abort tests if there were any errors in test file construction */ + if ( nerrs > 0 ) { + if ( mpi_rank == 0 ) { + HDprintf(" Test file construction failed -- skipping tests.\n"); + } + goto finish; + } + + /* Now read the generated test file (stil using MPI_COMM_WORLD) */ + nerrs += test_parallel_read( group_comm, mpi_rank, which_group); + + if ( nerrs > 0 ) { + if ( mpi_rank == 0 ) { + HDprintf(" Parallel read test failed -- skipping tests.\n"); + } + goto finish; + } + + /* Update the user on our progress so far. */ + if ( mpi_rank == 0 ) { + HDprintf(" Test 1 of 2 succeeded\n"); + HDprintf(" -- Starting multi-group parallel read test.\n"); + } + + /* ------ Test 2 of 2 ------ + * Create two more or less equal MPI groups to + * initialize the test files and then verify that parallel + * operations by independent group succeeds. + */ + split_size = mpi_size / 2; which_group = (mpi_rank < split_size ? 0 : 1); @@ -756,12 +843,6 @@ main( int argc, char **argv) exit(2); } - - /* create the test files & verify that the process - * succeeded. If not, abort the remaining tests as - * they depend on the test files. - */ - nerrs += generate_test_file( group_comm, mpi_rank, which_group ); /* abort tests if there were any errors in test file construction */ @@ -772,9 +853,20 @@ main( int argc, char **argv) goto finish; } - /* run the tests */ + /* run the 2nd set of tests */ nerrs += test_parallel_read(group_comm, mpi_rank, which_group); + if ( nerrs > 0 ) { + if ( mpi_rank == 0 ) { + HDprintf(" Multi-group read test failed\n"); + } + goto finish; + } + + if ( mpi_rank == 0 ) { + HDprintf(" Test 2 of 2 succeeded\n"); + } + finish: if ((group_comm != MPI_COMM_NULL) && -- cgit v0.12 From 12e832bd41afa4f000e12c6728b31f412c5b7565 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 11 Oct 2017 10:23:55 -0500 Subject: HDFFV-10297 add release note - fix test step --- release_docs/RELEASE.txt | 23 ++++++++++++++++++++++- test/CMakeTests.cmake | 2 ++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d0de3ee..f924b36 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -132,7 +132,16 @@ Bug Fixes since HDF5-1.10.1 release Library ------- - - + - H5Zfilter_avail in H5Z.c + + The public function checked for plugins, while the private + function did not. + + Modified H5Zfilter_avail and private function, H5Z_filter_avail. + Moved check for plugin from public to private function. Updated + H5P__set_filter due to change in H5Z_filter_avail. Updated tests. + + (ADB - 2017/10/10, HDFFV-10297) Configuration ------------- @@ -158,6 +167,18 @@ Bug Fixes since HDF5-1.10.1 release ----- - h5repack + h5repack failed to copy a dataset with existing filter. + + Reworked code for h5repack and h5diff code in tools library. Added + improved error handling, cleanup of resources and checks of calls. + Modified H5Zfilter_avail and private function, H5Z_filter_avail. + Moved check for plugin from public to private function. Updated + H5P__set_filter due to change in H5Z_filter_avail. Updated tests. + + (ADB - 2017/10/10, HDFFV-10297) + + - h5repack + h5repack always set the User Defined filter flag to H5Z_FLAG_MANDATORY. Added another parameter to the 'UD=' option to set the flag by default diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index f4c52b6..61ac3d2 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -268,6 +268,7 @@ add_test (NAME H5TEST-clear-testhdf5-objects tfile5.h5 tfile6.h5 tfile7.h5 + tfilespace.h5 th5o_file th5s1.h5 tselect.h5 @@ -334,6 +335,7 @@ else () tfile5.h5 tfile6.h5 tfile7.h5 + tfilespace.h5 th5o_file th5s1.h5 tselect.h5 -- cgit v0.12 From 157398107e334e3dafbdcd25f34da391510e45f2 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Wed, 11 Oct 2017 13:40:54 -0400 Subject: Try to address most of the issues raised by Dana in the code review --- src/H5Fsuper.c | 102 ++++++++++++++++++++++++++-------------------------- testpar/t_pread.c | 104 ++++++++++++++++++++++++++---------------------------- 2 files changed, 101 insertions(+), 105 deletions(-) diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index a3b1fed..0c6f9cd 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -21,15 +21,15 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ +#include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ +#include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5Iprivate.h" /* IDs */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Iprivate.h" /* IDs */ #include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ #include "H5SMprivate.h" /* Shared Object Header Messages */ @@ -158,7 +158,7 @@ H5F_super_ext_open(H5F_t *f, haddr_t ext_addr, H5O_loc_t *ext_ptr) /* Open the superblock extension object header */ if(H5O_open(ext_ptr) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open superblock extension") + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open superblock extension") done: FUNC_LEAVE_NOAPI(ret_value) @@ -224,12 +224,12 @@ done: /*------------------------------------------------------------------------- * Function: H5F__update_super_ext_driver_msg * - * Purpose: Update the superblock extension file driver info message if - * we are using a V 2 superblock. Observe that the function - * is a NO-OP if the file driver info message does not exist. + * Purpose: Update the superblock extension file driver info message if + * we are using a V 2 superblock. Observe that the function + * is a NO-OP if the file driver info message does not exist. * This is necessary, as the function is called whenever the - * EOA is updated, and were it to create the file driver info - * message, it would find itself in an infinite recursion. + * EOA is updated, and were it to create the file driver info + * message, it would find itself in an infinite recursion. * * Return: Success: SUCCEED * Failure: FAIL @@ -267,7 +267,7 @@ H5F__update_super_ext_driver_msg(H5F_t *f, hid_t dxpl_id) /* Check for driver info */ H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t); - /* Nothing to do unless there is both driver info and + /* Nothing to do unless there is both driver info and * the driver info superblock extension message has * already been created. */ @@ -330,13 +330,13 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial unsigned sblock_flags = H5AC__NO_FLAGS_SET; /* flags used in superblock unprotect call */ haddr_t super_addr; /* Absolute address of superblock */ haddr_t eof; /* End of file address */ - unsigned rw_flags; /* Read/write permissions for file */ - hbool_t skip_eof_check = FALSE; /* Whether to skip checking the EOF value */ + unsigned rw_flags; /* Read/write permissions for file */ + hbool_t skip_eof_check = FALSE; /* Whether to skip checking the EOF value */ herr_t ret_value = SUCCEED; /* Return value */ #ifdef H5_HAVE_PARALLEL int mpi_rank = 0, mpi_size = 1; int mpi_result; -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ FUNC_ENTER_PACKAGE_TAG(meta_dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) @@ -365,7 +365,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Can't get MPI rank") if((mpi_size = H5F_mpi_get_size(f)) < 0) - HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size") + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size") } /* If we are an MPI application with at least two processes, the @@ -380,14 +380,14 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial if ( mpi_size > 1 ) { MPI_Comm this_comm = MPI_COMM_NULL; - if ( mpi_rank == 0 ) { - if(H5FD_locate_signature(&fdio_info, &super_addr) < 0) - HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") + if ( mpi_rank == 0 ) { + if (H5FD_locate_signature(&fdio_info, &super_addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") } HDassert(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)); if ( MPI_COMM_NULL == (this_comm = H5F_mpi_get_comm(f)) ) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI communicator") + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") if ( MPI_SUCCESS != (mpi_result = MPI_Bcast(&super_addr,sizeof(super_addr), MPI_BYTE, 0, this_comm))) @@ -395,14 +395,14 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial } else { /* Locate the signature as per per the serial library */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ - if(H5FD_locate_signature(&fdio_info, &super_addr) < 0) - HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") + if (H5FD_locate_signature(&fdio_info, &super_addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") #ifdef H5_HAVE_PARALLEL } -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ if(HADDR_UNDEF == super_addr) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "file signature not found") @@ -453,12 +453,12 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load superblock") if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) - if(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3) - HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "invalid superblock version for SWMR_WRITE") + if(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3) + HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "invalid superblock version for SWMR_WRITE") /* Enable all latest version support when file has v3 superblock */ if(sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_3) - f->shared->latest_flags |= H5F_LATEST_ALL_FLAGS; + f->shared->latest_flags |= H5F_LATEST_ALL_FLAGS; /* Pin the superblock in the cache */ if(H5AC_pin_protected_entry(sblock) < 0) @@ -558,15 +558,15 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial * been flushed to disk by the SWMR writer process. */ if(H5F_INTENT(f) & H5F_ACC_SWMR_READ) { - /* - * When the file is opened for SWMR read access, skip the check if: - * --the file is already marked for SWMR writing and - * --the file has version 3 superblock for SWMR support - */ - if((sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS) && + /* + * When the file is opened for SWMR read access, skip the check if: + * --the file is already marked for SWMR writing and + * --the file has version 3 superblock for SWMR support + */ + if((sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS) && (sblock->status_flags & H5F_SUPER_WRITE_ACCESS) && sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_3) - skip_eof_check = TRUE; + skip_eof_check = TRUE; } /* end if */ if(!skip_eof_check && initial_read) { if(HADDR_UNDEF == (eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT))) @@ -640,7 +640,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial H5O_loc_t ext_loc; /* "Object location" for superblock extension */ H5O_btreek_t btreek; /* v1 B-tree 'K' value message from superblock extension */ H5O_drvinfo_t drvinfo; /* Driver info message from superblock extension */ - size_t u; /* Local index variable */ + size_t u; /* Local index variable */ htri_t status; /* Status for message existing */ /* Sanity check - superblock extension should only be defined for @@ -661,7 +661,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial } /* end if */ /* Open the superblock extension */ - if(H5F_super_ext_open(f, sblock->ext_addr, &ext_loc) < 0) + if(H5F_super_ext_open(f, sblock->ext_addr, &ext_loc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "unable to open file's superblock extension") /* Check for the extension having a 'driver info' message */ @@ -684,8 +684,8 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial /* Reset driver info message */ H5O_msg_reset(H5O_DRVINFO_ID, &drvinfo); - HDassert(FALSE == f->shared->drvinfo_sb_msg_exists); - f->shared->drvinfo_sb_msg_exists = TRUE; + HDassert(FALSE == f->shared->drvinfo_sb_msg_exists); + f->shared->drvinfo_sb_msg_exists = TRUE; } /* end else */ } /* end if */ @@ -811,37 +811,37 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial } /* end if not marked "unknown" */ } /* end if */ - /* Check for the extension having a 'metadata cache image' message */ + /* Check for the extension having a 'metadata cache image' message */ if((status = H5O_msg_exists(&ext_loc, H5O_MDCI_MSG_ID, meta_dxpl_id)) < 0) HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header") if(status) { - hbool_t rw = ((rw_flags & H5AC__READ_ONLY_FLAG) == 0); - H5O_mdci_t mdci_msg; + hbool_t rw = ((rw_flags & H5AC__READ_ONLY_FLAG) == 0); + H5O_mdci_t mdci_msg; - /* if the metadata cache image superblock extension message exists, + /* if the metadata cache image superblock extension message exists, * read its contents and pass the data on to the metadata cache. * Given this data, the cache will load and decode the metadata - * cache image block, decoded it and load its contents into the - * the cache on the test protect call. + * cache image block, decoded it and load its contents into the + * the cache on the test protect call. * * Further, if the file is opened R/W, the metadata cache will - * delete the metadata cache image superblock extension and free - * the cache image block. Don't do this now as f->shared - * is not fully setup, which complicates matters. + * delete the metadata cache image superblock extension and free + * the cache image block. Don't do this now as f->shared + * is not fully setup, which complicates matters. */ /* Retrieve the 'metadata cache image message' structure */ - if(NULL == H5O_msg_read(&ext_loc, H5O_MDCI_MSG_ID, &mdci_msg, meta_dxpl_id)) + if(NULL == H5O_msg_read(&ext_loc, H5O_MDCI_MSG_ID, &mdci_msg, meta_dxpl_id)) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get metadata cache image message") /* Indicate to the cache that there's an image to load on first protect call */ if(H5AC_load_cache_image_on_next_protect(f, mdci_msg.addr, mdci_msg.size, rw) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTLOAD, FAIL, "call to H5AC_load_cache_image_on_next_protect failed"); + HGOTO_ERROR(H5E_FILE, H5E_CANTLOAD, FAIL, "call to H5AC_load_cache_image_on_next_protect failed"); } /* end if */ /* Close superblock extension */ if(H5F_super_ext_close(f, &ext_loc, meta_dxpl_id, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close file's superblock extension") + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close file's superblock extension") } /* end if */ /* Update the driver info if VFD indicated to do so */ diff --git a/testpar/t_pread.c b/testpar/t_pread.c index b40fc09..f0cad3d 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -87,17 +87,13 @@ static int test_parallel_read(MPI_Comm comm, int mpi_rank, int group); * * Failure: 1 * - * Programmer: Richard Warren - * 10/1/17 - * - * Modifications: * *------------------------------------------------------------------------- */ static int generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) { - FILE *header; + FILE *header = NULL; const char *fcn_name = "generate_test_file()"; const char *failure_mssg = NULL; const char *group_filename = NULL; @@ -113,12 +109,12 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) hsize_t i; hsize_t offset; hsize_t dims[1] = {0}; - hid_t file_id; - hid_t memspace; - hid_t filespace; - hid_t fapl_id; - hid_t dxpl_id; - hid_t dset_id; + hid_t file_id = -1; + hid_t memspace = -1; + hid_t filespace = -1; + hid_t fapl_id = -1; + hid_t dxpl_id = -1; + hid_t dset_id = -1; float nextValue; float *data_slice = NULL; @@ -155,17 +151,17 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) else if ( group_id == 0 ) { /* Test 2 group 0 */ file_index = 3; } - else { /* Test 2 group 1 */ + else { /* Test 2 group 1 */ file_index = 6; } - /* The 'group_filename' is just a temp variable and + /* The 'group_filename' is just a temp variable and * is used to call into the h5_fixname function. No * need to worry that we reassign it for each file! - */ + */ HDassert((group_filename = FILENAMES[file_index])); - /* Assign the 'data_filename' */ + /* Assign the 'data_filename' */ if ( h5_fixname(group_filename, H5P_DEFAULT, data_filename, sizeof(data_filename)) == NULL ) { pass = FALSE; @@ -177,7 +173,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) HDassert( (group_filename = FILENAMES[file_index+1]) ); - /* Assign the 'reloc_data_filename' */ + /* Assign the 'reloc_data_filename' */ if ( h5_fixname(group_filename, H5P_DEFAULT, reloc_data_filename, sizeof(reloc_data_filename)) == NULL ) { @@ -190,7 +186,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) HDassert( (group_filename = FILENAMES[file_index+2]) ); - /* Assing the 'prolog_filename' */ + /* Assign the 'prolog_filename' */ if ( h5_fixname(group_filename, H5P_DEFAULT, prolog_filename, sizeof(prolog_filename)) == NULL ) { pass = FALSE; @@ -211,7 +207,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) for(i=0; i 0); + return((nerrs > 0) ? FAIL : SUCCEED ); } /* main() */ -- cgit v0.12 From 11df540c92ac284a664be912b0cb045e8d92e7d3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 11 Oct 2017 15:13:55 -0500 Subject: Added older change that was added to last change --- release_docs/RELEASE.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index f924b36..db946a0 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -312,15 +312,20 @@ Supported Platforms Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) Visual Studio 2015 w/ Intel Fortran 16 (cmake) - Cygwin(CYGWIN_NT-6.1 2.2.1(0.289/5/3) gcc(4.9.3) compiler and gfortran) - (cmake and autotools) Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) Visual Studio 2015 w/ Intel Fortran 16 (cmake) - Visual Studio 2015 w/ Intel Parallel Studio 2017 (cmake) + Visual Studio 2015 w/ Intel C, Fortran 2017 (cmake) + Visual Studio 2015 w/ MSMPI 8 (cmake) + Cygwin(CYGWIN_NT-6.1 2.8.0(0.309/5/3) + gcc and gfortran compilers (GCC 5.4.0) + (cmake and autotools) Windows 10 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Cygwin(CYGWIN_NT-6.1 2.8.0(0.309/5/3) + gcc and gfortran compilers (GCC 5.4.0) + (cmake and autotools) Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 16 (cmake) -- cgit v0.12 From 3dde6d0e32461f46630f814a2fdfbd4c813703bf Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Wed, 11 Oct 2017 16:22:50 -0400 Subject: Updated the code and RELEASE.txt note per comments from John Mainzer --- release_docs/RELEASE.txt | 10 +++--- testpar/t_pread.c | 84 +++++++++++++++++++++++++----------------------- 2 files changed, 48 insertions(+), 46 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index ed1b6cc..e561983 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -64,11 +64,11 @@ New Features ----------------- - Optimize parallel open/location of the HDF5 super-block - Previous releases of PHDF5 allow all parallel ranks to - read the starting elements in a file to validate and process - the HDF5 super-block. As this is accomplished more or less as - a synchronous operation, a large number of processes will - likely experience a slowdown due to filesystem contention. + Previous releases of PHDF5 required all parallel ranks to + search for the HDF5 superblock signature when opening the + file. As this is accomplished more or less as a synchronous + operation, a large number of processes can experience a + slowdown in the file open due to filesystem contention. As a first step in improving the startup/file-open performance, we allow MPI rank 0 of the associated MPI communicator to locate diff --git a/testpar/t_pread.c b/testpar/t_pread.c index f0cad3d..7f23b9b 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -16,7 +16,6 @@ * */ - #include "h5test.h" #include "testpar.h" @@ -87,7 +86,11 @@ static int test_parallel_read(MPI_Comm comm, int mpi_rank, int group); * * Failure: 1 * + * Programmer: Richard Warren + * 10/1/17 * + * Modifications: + * *------------------------------------------------------------------------- */ static int @@ -758,17 +761,17 @@ main( int argc, char **argv) if ( (MPI_Init(&argc, &argv)) != MPI_SUCCESS) { HDfprintf(stderr, "FATAL: Unable to initialize MPI\n"); - HDexit(FAIL); + HDexit(EXIT_FAILURE); } if ( (MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank)) != MPI_SUCCESS) { HDfprintf(stderr, "FATAL: MPI_Comm_rank returned an error\n"); - HDexit(FAIL); + HDexit(EXIT_FAILURE); } if ( (MPI_Comm_size(MPI_COMM_WORLD, &mpi_size)) != MPI_SUCCESS) { HDfprintf(stderr, "FATAL: MPI_Comm_size returned an error\n"); - HDexit(FAIL); + HDexit(EXIT_FAILURE); } H5open(); @@ -789,26 +792,53 @@ main( int argc, char **argv) goto finish; } - /* ------ Test 1 of 2 ------ - * In this test we utilize all processes which makeup MPI_COMM_WORLD. - * We generate the test file which we'll shortly try to read. + /* ------ Create two (2) MPI groups ------ + * + * We split MPI_COMM_WORLD into 2 more or less equal sized + * groups. The resulting communicators will be used to generate + * two HDF files which in turn will be opened in parallel and the + * contents verified in the second read test below. */ + split_size = mpi_size / 2; + which_group = (mpi_rank < split_size ? 0 : 1); + + if ( (MPI_Comm_split(MPI_COMM_WORLD, + which_group, + 0, + &group_comm)) != MPI_SUCCESS) { + + HDfprintf(stderr, "FATAL: MPI_Comm_split returned an error\n"); + HDexit(EXIT_FAILURE); + } + + /* ------ Generate all files ------ */ + + /* We generate the file used for test 1 */ + nerrs += generate_test_file( MPI_COMM_WORLD, mpi_rank, which_group ); + + if ( nerrs > 0 ) { + if ( mpi_rank == 0 ) { + HDprintf(" Test(1) file construction failed -- skipping tests.\n"); + } + goto finish; + } + + /* We generate the file used for test 2 */ nerrs += generate_test_file( group_comm, mpi_rank, which_group ); - /* abort tests if there were any errors in test file construction */ if ( nerrs > 0 ) { if ( mpi_rank == 0 ) { - HDprintf(" Test file construction failed -- skipping tests.\n"); + HDprintf(" Test(2) file construction failed -- skipping tests.\n"); } goto finish; } /* Now read the generated test file (stil using MPI_COMM_WORLD) */ - nerrs += test_parallel_read( group_comm, mpi_rank, which_group); + nerrs += test_parallel_read( MPI_COMM_WORLD, mpi_rank, which_group); if ( nerrs > 0 ) { if ( mpi_rank == 0 ) { - HDprintf(" Parallel read test failed -- skipping tests.\n"); + HDprintf(" Parallel read test(1) failed -- skipping tests.\n"); } goto finish; } @@ -819,40 +849,12 @@ main( int argc, char **argv) HDprintf(" -- Starting multi-group parallel read test.\n"); } - /* ------ Test 2 of 2 ------ - * Create two more or less equal MPI groups to - * initialize the test files and then verify that parallel - * operations by independent group succeeds. - */ - - split_size = mpi_size / 2; - which_group = (mpi_rank < split_size ? 0 : 1); - - if ( (MPI_Comm_split(MPI_COMM_WORLD, - which_group, - 0, - &group_comm)) != MPI_SUCCESS) { - - HDfprintf(stderr, "FATAL: MPI_Comm_split returned an error\n"); - HDexit(FAIL); - } - - nerrs += generate_test_file( group_comm, mpi_rank, which_group ); - - /* abort tests if there were any errors in test file construction */ - if ( nerrs > 0 ) { - if ( mpi_rank == 0 ) { - HDprintf(" Test file construction failed -- skipping tests.\n"); - } - goto finish; - } - /* run the 2nd set of tests */ nerrs += test_parallel_read(group_comm, mpi_rank, which_group); if ( nerrs > 0 ) { if ( mpi_rank == 0 ) { - HDprintf(" Multi-group read test failed\n"); + HDprintf(" Multi-group read test(2) failed\n"); } goto finish; } @@ -897,6 +899,6 @@ finish: MPI_Finalize(); /* cannot just return (nerrs) because exit code is limited to 1byte */ - return((nerrs > 0) ? FAIL : SUCCEED ); + return((nerrs > 0) ? EXIT_FAILURE : EXIT_SUCCESS ); } /* main() */ -- cgit v0.12 From fc12672cdbd162f47293ec9ee2185e3efe1d0405 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 12 Oct 2017 14:27:38 -0500 Subject: Close ids in loop --- tools/src/h5repack/h5repack.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 6b8cf8a..2db7fdd 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -481,6 +481,19 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, if (options->verbose) printf(FORMAT_OBJ_ATTR, "attr", name); + + /*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + if (H5Tclose(ftype_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + if (H5Tclose(wtype_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + if (H5Sclose(space_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); + if (H5Aclose(attr_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); } /* u */ done: @@ -792,9 +805,9 @@ static int check_objects(const char* fname, pack_opt_t *options) { done: H5E_BEGIN_TRY { - H5Fclose(fid); - H5Sclose(sid); H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid); } H5E_END_TRY; if (travt) trav_table_free(travt); -- cgit v0.12 From d5c073d406f8d1e1ac3bcb05883bea406c8e9378 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 13 Oct 2017 16:34:01 -0500 Subject: HDFFV-10296 Update tools lib to use the error handling macros. --- tools/lib/h5diff.c | 932 ++++++++++++++++--------------------- tools/lib/h5diff_array.c | 764 +++++++++++++++--------------- tools/lib/h5diff_attr.c | 223 +++++---- tools/lib/h5diff_dset.c | 452 +++++++++--------- tools/lib/h5diff_util.c | 84 +--- tools/lib/h5tools_dump.c | 177 +++---- tools/lib/h5tools_filters.c | 55 ++- tools/lib/h5tools_type.c | 124 +++-- tools/lib/h5tools_utils.c | 231 +++------ tools/lib/h5trav.c | 533 +++++++++------------ tools/src/h5repack/h5repack_copy.c | 188 +++----- 11 files changed, 1593 insertions(+), 2170 deletions(-) diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 0be6f5c..285ec60 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -21,9 +21,9 @@ /*------------------------------------------------------------------------- * Function: print_objname * - * Purpose: check if object name is to be printed, only when: - * 1) verbose mode - * 2) when diff was found (normal mode) + * Purpose: check if object name is to be printed, only when: + * 1) verbose mode + * 2) when diff was found (normal mode) *------------------------------------------------------------------------- */ H5_ATTR_PURE int @@ -35,11 +35,11 @@ print_objname (diff_opt_t * options, hsize_t nfound) /*------------------------------------------------------------------------- * Function: do_print_objname * - * Purpose: print object name - * + * Purpose: print object name *------------------------------------------------------------------------- */ -void do_print_objname (const char *OBJ, const char *path1, const char *path2, diff_opt_t * opts) +void +do_print_objname (const char *OBJ, const char *path1, const char *path2, diff_opt_t * opts) { /* if verbose level is higher than 0, put space line before * displaying any object or symbolic links. This improves @@ -53,8 +53,7 @@ void do_print_objname (const char *OBJ, const char *path1, const char *path2, di /*------------------------------------------------------------------------- * Function: do_print_attrname * - * Purpose: print attribute name - * + * Purpose: print attribute name *------------------------------------------------------------------------- */ void @@ -66,17 +65,16 @@ do_print_attrname (const char *attr, const char *path1, const char *path2) /*------------------------------------------------------------------------- * Function: print_warn * - * Purpose: check print warning condition. + * Purpose: check print warning condition. * Return: - * 1 if verbose mode - * 0 if not verbos mode - * Programmer: Jonathan Kim - * Date: Feb 4, 2010 + * 1 if verbose mode + * 0 if not verbos mode *------------------------------------------------------------------------- */ -static int print_warn(diff_opt_t *options) +static int +print_warn(diff_opt_t *options) { - return ((options->m_verbose))?1:0; + return ((options->m_verbose)) ? 1: 0; } @@ -84,20 +82,16 @@ static int print_warn(diff_opt_t *options) /*------------------------------------------------------------------------- * Function: phdiff_dismiss_workers * - * Purpose: tell all workers to end. - * - * Return: none - * - * Programmer: Albert Cheng - * - * Date: Feb 6, 2005 + * Purpose: tell all workers to end. * + * Return: none *------------------------------------------------------------------------- */ -void phdiff_dismiss_workers(void) +void +phdiff_dismiss_workers(void) { int i; - for(i=1; im_quiet && (options->m_verbose || options->m_report)) - { + if(options->m_quiet && (options->m_verbose || options->m_report)) { parallel_print("Error: -q (quiet mode) cannot be added to verbose or report modes\n"); - options->err_stat=1; - ret = 0; - goto out; + options->err_stat = 1; + HGOTO_DONE(0); } /* ------------------------------------------------------- * only allow --no-dangling-links along with --follow-symlinks */ - if(options->no_dangle_links && !options->follow_links) - { + if(options->no_dangle_links && !options->follow_links) { parallel_print("Error: --no-dangling-links must be used along with --follow-symlinks option.\n"); - options->err_stat=1; - ret = 0; - goto out; + options->err_stat = 1; + HGOTO_DONE(0); } -out: +done: - return ret; + return ret_value; } /*------------------------------------------------------------------------- * Function: is_exclude_path * - * Purpose: check if 'paths' are part of exclude path list + * Purpose: check if 'paths' are part of exclude path list * * Return: - * 1 - excluded path - * 0 - not excluded path - * - * Programmer: Jonathan Kim - * Date: Aug 23, 2010 + * 1 - excluded path + * 0 - not excluded path *------------------------------------------------------------------------*/ -static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options) +static int +is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options) { struct exclude_path_list * exclude_path_ptr; - int ret_cmp; - int ret = 0; + int ret_cmp; + int ret_value = 0; /* check if exclude path option is given */ if (!options->exclude_path) - goto out; + HGOTO_DONE(0); /* assign to local exclude list pointer */ exclude_path_ptr = options->exclude; /* search objects in exclude list */ - while (NULL != exclude_path_ptr) - { + while (NULL != exclude_path_ptr) { /* if exclude path is is group, exclude its members as well */ - if (exclude_path_ptr->obj_type == H5TRAV_TYPE_GROUP) - { + if (exclude_path_ptr->obj_type == H5TRAV_TYPE_GROUP) { ret_cmp = HDstrncmp(exclude_path_ptr->obj_path, path, HDstrlen(exclude_path_ptr->obj_path)); - if (ret_cmp == 0) /* found matching members */ - { + if (ret_cmp == 0) { /* found matching members */ size_t len_grp; /* check if given path belong to an excluding group, if so @@ -223,22 +198,19 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options * not under “/grp1xxx/†group. */ len_grp = HDstrlen(exclude_path_ptr->obj_path); - if (path[len_grp] == '/') - { + if (path[len_grp] == '/') { /* belong to excluded group! */ - ret = 1; + ret_value = 1; break; /* while */ } } } /* exclude target is not group, just exclude the object */ - else - { + else { ret_cmp = HDstrcmp(exclude_path_ptr->obj_path, path); - if (ret_cmp == 0) /* found matching object */ - { + if (ret_cmp == 0) { /* found matching object */ /* excluded non-group object */ - ret = 1; + ret_value = 1; /* remember the type of this maching object. * if it's group, it can be used for excluding its member * objects in this while() loop */ @@ -249,26 +221,23 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options exclude_path_ptr = exclude_path_ptr->next; } -out: - return ret; +done: + return ret_value; } /*------------------------------------------------------------------------- * Function: free_exclude_path_list * - * Purpose: free exclud object list from diff options - * - * Programmer: Jonathan Kim - * Date: Aug 23, 2010 + * Purpose: free exclude object list from diff options *------------------------------------------------------------------------*/ -static void free_exclude_path_list(diff_opt_t *options) +static void +free_exclude_path_list(diff_opt_t *options) { - struct exclude_path_list * curr = options->exclude; - struct exclude_path_list * next; + struct exclude_path_list *curr = options->exclude; + struct exclude_path_list *next; - while (NULL != curr) - { + while (NULL != curr) { next = curr->next; HDfree(curr); curr = next; @@ -278,44 +247,43 @@ static void free_exclude_path_list(diff_opt_t *options) /*------------------------------------------------------------------------- * Function: build_match_list * - * Purpose: get list of matching path_name from info1 and info2 + * Purpose: get list of matching path_name from info1 and info2 * * Note: - * Find common objects; the algorithm used for this search is the - * cosequential match algorithm and is described in - * Folk, Michael; Zoellick, Bill. (1992). File Structures. Addison-Wesley. - * Moved out from diff_match() to make code more flexible. + * Find common objects; the algorithm used for this search is the + * cosequential match algorithm and is described in + * Folk, Michael; Zoellick, Bill. (1992). File Structures. Addison-Wesley. + * Moved out from diff_match() to make code more flexible. * * Parameter: - * table_out [OUT] : return the list - * - * Programmer: Jonathan Kim - * - * Date: Aug 18, 2010 + * table_out [OUT] : return the list *------------------------------------------------------------------------*/ -static void build_match_list (const char *objname1, trav_info_t *info1, const char *objname2, trav_info_t *info2, trav_table_t ** table_out, diff_opt_t *options) +static void +build_match_list (const char *objname1, trav_info_t *info1, const char *objname2, trav_info_t *info2, + trav_table_t ** table_out, diff_opt_t *options) { - size_t curr1 = 0; - size_t curr2 = 0; + size_t curr1 = 0; + size_t curr2 = 0; unsigned infile[2]; - char * path1_lp; - char * path2_lp; + char *path1_lp = NULL; + char *path2_lp = NULL; h5trav_type_t type1_l; h5trav_type_t type2_l; - size_t path1_offset = 0; - size_t path2_offset = 0; - int cmp; - trav_table_t *table; - size_t idx; + size_t path1_offset = 0; + size_t path2_offset = 0; + int cmp; + trav_table_t *table = NULL; + size_t idx; h5difftrace("build_match_list start\n"); /* init */ - trav_table_init( &table ); - + trav_table_init(&table); + if (table == NULL) + H5TOOLS_INFO(H5E_tools_min_id_g, "Cannot create tarverse table"); /* * This is necessary for the case that given objects are group and * have different names (ex: obj1 is /grp1 and obj2 is /grp5). - * All the objects belong to given groups are the cadidates. + * All the objects belong to given groups are the candidates. * So prepare to compare paths without the group names. */ @@ -329,8 +297,7 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch /*-------------------------------------------------- * build the list */ - while(curr1 < info1->nused && curr2 < info2->nused) - { + while(curr1 < info1->nused && curr2 < info2->nused) { path1_lp = (info1->paths[curr1].path) + path1_offset; path2_lp = (info2->paths[curr2].path) + path2_offset; type1_l = info1->paths[curr1].type; @@ -338,19 +305,15 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch /* criteria is string compare */ cmp = HDstrcmp(path1_lp, path2_lp); - - if(cmp == 0) - { - if(!is_exclude_path(path1_lp, type1_l, options)) - { + if(cmp == 0) { + if(!is_exclude_path(path1_lp, type1_l, options)) { infile[0] = 1; infile[1] = 1; trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table); /* if the two point to the same target object, * mark that in table */ if (info1->paths[curr1].fileno == info2->paths[curr2].fileno && - info1->paths[curr1].objno == info2->paths[curr2].objno ) - { + info1->paths[curr1].objno == info2->paths[curr2].objno) { idx = table->nobjs - 1; table->objs[idx].is_same_trgobj = 1; } @@ -358,20 +321,16 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch curr1++; curr2++; } /* end if */ - else if(cmp < 0) - { - if(!is_exclude_path(path1_lp, type1_l, options)) - { + else if(cmp < 0) { + if(!is_exclude_path(path1_lp, type1_l, options)) { infile[0] = 1; infile[1] = 0; trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table); } curr1++; } /* end else-if */ - else - { - if (!is_exclude_path(path2_lp, type2_l, options)) - { + else { + if (!is_exclude_path(path2_lp, type2_l, options)) { infile[0] = 0; infile[1] = 1; trav_table_addflags(infile, path2_lp, info2->paths[curr2].type, table); @@ -383,13 +342,11 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch /* list1 did not end */ infile[0] = 1; infile[1] = 0; - while(curr1 < info1->nused) - { + while(curr1 < info1->nused) { path1_lp = (info1->paths[curr1].path) + path1_offset; type1_l = info1->paths[curr1].type; - if(!is_exclude_path(path1_lp, type1_l, options)) - { + if(!is_exclude_path(path1_lp, type1_l, options)) { trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table); } curr1++; @@ -398,13 +355,11 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch /* list2 did not end */ infile[0] = 0; infile[1] = 1; - while(curr2 < info2->nused) - { + while(curr2 < info2->nused) { path2_lp = (info2->paths[curr2].path) + path2_offset; type2_l = info2->paths[curr2].type; - if (!is_exclude_path(path2_lp, type2_l, options)) - { + if (!is_exclude_path(path2_lp, type2_l, options)) { trav_table_addflags(infile, path2_lp, info2->paths[curr2].type, table); } curr2++; @@ -420,15 +375,11 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch /*------------------------------------------------------------------------- * Function: trav_grp_objs * - * Purpose: - * Call back function from h5trav_visit(). - * - * Programmer: Jonathan Kim - * - * Date: Aug 16, 2010 + * Purpose: Call back function from h5trav_visit(). *------------------------------------------------------------------------*/ -static herr_t trav_grp_objs(const char *path, const H5O_info_t *oinfo, - const char *already_visited, void *udata) +static herr_t +trav_grp_objs(const char *path, const H5O_info_t *oinfo, + const char *already_visited, void *udata) { trav_info_visit_obj(path, oinfo, already_visited, udata); @@ -438,18 +389,14 @@ static herr_t trav_grp_objs(const char *path, const H5O_info_t *oinfo, /*------------------------------------------------------------------------- * Function: trav_grp_symlinks * - * Purpose: - * Call back function from h5trav_visit(). - * Track and extra checkings while visiting all symbolic-links. - * - * Programmer: Jonathan Kim - * - * Date: Aug 16, 2010 + * Purpose: Call back function from h5trav_visit(). + * Track and extra checkings while visiting all symbolic-links. *------------------------------------------------------------------------*/ -static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, +static herr_t +trav_grp_symlinks(const char *path, const H5L_info_t *linfo, void *udata) { - int ret_value = 0; + herr_t ret_value = 0; trav_info_t *tinfo = (trav_info_t *)udata; diff_opt_t *opts = (diff_opt_t *)tinfo->opts; h5tool_link_info_t lnk_info; @@ -461,29 +408,30 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, if (!opts->follow_links) { trav_info_visit_lnk(path, linfo, tinfo); - goto done; + HGOTO_DONE(0); } switch(linfo->type) { case H5L_TYPE_SOFT: - if((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) - goto done; - /* no dangling link option given and detect dangling link */ + if((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) { + HGOTO_DONE(ret_value); + } else if (ret_value == 0) { - tinfo->symlink_visited.dangle_link = TRUE; + /* no dangling link option given and detect dangling link */ + tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) opts->err_stat = 1; /* make dangling link is error */ - goto done; + HGOTO_DONE(0); } /* check if already visit the target object */ if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path)) - goto done; + HGOTO_DONE(0); /* add this link as visited link */ if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path) < 0) - goto done; + HGOTO_DONE(0); if(h5trav_visit(tinfo->fid, path, TRUE, TRUE, trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { @@ -494,27 +442,28 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, break; case H5L_TYPE_EXTERNAL: - if ((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) - goto done; - /* no dangling link option given and detect dangling link */ + if ((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) { + HGOTO_DONE(ret_value); + } else if (ret_value == 0) { + /* no dangling link option given and detect dangling link */ tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) opts->err_stat = 1; /* make dangling link is error */ - goto done; + HGOTO_DONE(0); } if(H5Lunpack_elink_val(lnk_info.trg_path, linfo->u.val_size, NULL, &ext_fname, &ext_path) < 0) - goto done; + HGOTO_DONE(0); /* check if already visit the target object */ if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path)) - goto done; + HGOTO_DONE(0); /* add this link as visited link */ if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path) < 0) - goto done; + HGOTO_DONE(0); if(h5trav_visit(tinfo->fid, path, TRUE, TRUE, trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { @@ -537,45 +486,41 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, done: if (lnk_info.trg_path) HDfree(lnk_info.trg_path); - return 0; + return ret_value; } /*------------------------------------------------------------------------- * Function: h5diff * - * Purpose: public function, can be called in an application program. - * return differences between 2 HDF5 files - * - * Return: Number of differences found. - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October 22, 2003 + * Purpose: public function, can be called in an application program. + * return differences between 2 HDF5 files * + * Return: Number of differences found. *------------------------------------------------------------------------- */ -hsize_t h5diff(const char *fname1, +hsize_t +h5diff(const char *fname1, const char *fname2, const char *objname1, const char *objname2, diff_opt_t *opts) { - int ret_value = 0; - hid_t file1_id = (-1); - hid_t file2_id = (-1); - char filenames[2][MAX_FILENAME]; - hsize_t nfound = 0; - int l_ret1 = -1; - int l_ret2 = -1; - char * obj1fullname = NULL; - char * obj2fullname = NULL; - int both_objs_grp = 0; + int ret_value = 0; + hid_t file1_id = -1; + hid_t file2_id = -1; + char filenames[2][MAX_FILENAME]; + hsize_t nfound = 0; + int l_ret1 = -1; + int l_ret2 = -1; + char *obj1fullname = NULL; + char *obj2fullname = NULL; + int both_objs_grp = 0; /* init to group type */ h5trav_type_t obj1type = H5TRAV_TYPE_GROUP; h5trav_type_t obj2type = H5TRAV_TYPE_GROUP; /* for single object */ - H5O_info_t oinfo1, oinfo2; /* object info */ + H5O_info_t oinfo1, oinfo2; /* object info */ trav_info_t *info1_obj = NULL; trav_info_t *info2_obj = NULL; /* for group object */ @@ -585,8 +530,8 @@ hsize_t h5diff(const char *fname1, trav_info_t *info1_lp = NULL; trav_info_t *info2_lp = NULL; /* link info from specified object */ - H5L_info_t src_linfo1; - H5L_info_t src_linfo2; + H5L_info_t src_linfo1; + H5L_info_t src_linfo2; /* link info from member object */ h5tool_link_info_t trg_linfo1; h5tool_link_info_t trg_linfo2; @@ -604,34 +549,27 @@ hsize_t h5diff(const char *fname1, * check invalid combination of options *-----------------------------------------------------------------------*/ if(!is_valid_options(opts)) - goto done; + HGOTO_DONE(0); opts->cmn_objs = 1; /* eliminate warning */ + opts->err_stat = 1; /* initialize error status to FAIL */ /*------------------------------------------------------------------------- * open the files first; if they are not valid, no point in continuing *------------------------------------------------------------------------- */ - - /* disable error reporting */ - H5E_BEGIN_TRY - { - /* open file 1 */ - if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { - parallel_print("h5diff: <%s>: unable to open file\n", fname1); - opts->err_stat = 1; - goto done; - } /* end if */ + /* open file 1 */ + if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { + parallel_print("h5diff: <%s>: unable to open file\n", fname1); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname1); + } /* end if */ - /* open file 2 */ - if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { - parallel_print("h5diff: <%s>: unable to open file\n", fname2); - opts->err_stat = 1; - goto done; - } /* end if */ - /* enable error reporting */ - } H5E_END_TRY; + /* open file 2 */ + if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { + parallel_print("h5diff: <%s>: unable to open file\n", fname2); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname2); + } /* end if */ /*------------------------------------------------------------------------- * Initialize the info structs @@ -648,10 +586,12 @@ hsize_t h5diff(const char *fname1, #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj1fullname, "/%s", objname1) < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ - obj1fullname = (char*)HDmalloc(HDstrlen(objname1) + 2); + if ((obj1fullname = (char*)HDmalloc(HDstrlen(objname1) + 2)) == NULL) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + HDstrcpy(obj1fullname, "/"); HDstrcat(obj1fullname, objname1); #endif /* H5_HAVE_ASPRINTF */ @@ -664,10 +604,11 @@ hsize_t h5diff(const char *fname1, #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj2fullname, "/%s", objname2) < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ - obj2fullname = (char*)HDmalloc(HDstrlen(objname2) + 2); + if ((obj2fullname = (char*)HDmalloc(HDstrlen(objname2) + 2)) == NULL) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); HDstrcpy(obj2fullname, "/"); HDstrcat(obj2fullname, objname2); #endif /* H5_HAVE_ASPRINTF */ @@ -693,7 +634,7 @@ hsize_t h5diff(const char *fname1, if(H5Lget_info(file1_id, obj1fullname, &src_linfo1, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj1fullname); H5TOOLS_INFO(H5E_tools_min_id_g, "Unable to get link info\n"); - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Lget_info failed"); } info1_lp = info1_obj; @@ -745,7 +686,7 @@ hsize_t h5diff(const char *fname1, /* get info from link */ if(H5Lget_info(file2_id, obj2fullname, &src_linfo2, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj2fullname); - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Lget_info failed"); } info2_lp = info2_obj; @@ -815,7 +756,7 @@ hsize_t h5diff(const char *fname1, if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj1fullname); opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: treat dangling link as error"); + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "treat dangling link as error"); } else { if(opts->m_verbose) @@ -823,14 +764,14 @@ hsize_t h5diff(const char *fname1, if (l_ret1 != 0 || l_ret2 != 0) { nfound++; print_found(nfound); - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5tools_get_symlink_info error"); } } } else if(l_ret1 < 0) { /* fail */ parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1); opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Object could not be found"); } else if(l_ret1 != 2) { /* symbolic link */ obj1type = (h5trav_type_t)trg_linfo1.trg_type; @@ -858,7 +799,7 @@ hsize_t h5diff(const char *fname1, if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj2fullname); opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: treat dangling link as error"); + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "treat dangling link as error"); } else { if(opts->m_verbose) @@ -866,14 +807,14 @@ hsize_t h5diff(const char *fname1, if (l_ret1 != 0 || l_ret2 != 0) { nfound++; print_found(nfound); - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5tools_get_symlink_info error"); } } } else if(l_ret2 < 0) { /* fail */ parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Object could not be found"); } else if(l_ret2 != 2) { /* symbolic link */ obj2type = (h5trav_type_t)trg_linfo2.trg_type; @@ -899,9 +840,9 @@ hsize_t h5diff(const char *fname1, if(!(opts->m_verbose || opts->m_report)) { h5difftrace("h5diff NOT (opts->m_verbose || opts->m_report)\n"); /* if no danglink links */ - if ( l_ret1 > 0 && l_ret2 > 0 ) + if (l_ret1 > 0 && l_ret2 > 0) if (h5tools_is_obj_same(file1_id, obj1fullname, file2_id, obj2fullname)!=0) - goto done; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Same object"); } both_objs_grp = (obj1type == H5TRAV_TYPE_GROUP && obj2type == H5TRAV_TYPE_GROUP); @@ -918,7 +859,7 @@ hsize_t h5diff(const char *fname1, trav_grp_objs, trav_grp_symlinks, info1_grp) < 0) { parallel_print("Error: Could not get file contents\n"); opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Could not get file contents"); } info1_lp = info1_grp; @@ -933,7 +874,7 @@ hsize_t h5diff(const char *fname1, trav_grp_objs, trav_grp_symlinks, info2_grp) < 0) { parallel_print("Error: Could not get file contents\n"); opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Could not get file contents"); } /* end if */ info2_lp = info2_grp; } @@ -957,8 +898,7 @@ hsize_t h5diff(const char *fname1, #endif /* process the objects */ - build_match_list (obj1fullname, info1_lp, obj2fullname, info2_lp, - &match_list, opts); + build_match_list (obj1fullname, info1_lp, obj2fullname, info2_lp, &match_list, opts); if (both_objs_grp) { /*------------------------------------------------------ * print the list @@ -987,6 +927,8 @@ hsize_t h5diff(const char *fname1, file2_id, obj2fullname, info2_lp, match_list, opts); + opts->err_stat = 1; /* success status */ + done: #ifdef H5_HAVE_PARALLEL if(g_Parallel) @@ -1022,6 +964,7 @@ done: H5Fclose(file1_id); H5Fclose(file2_id); } H5E_END_TRY; + h5difftrace("h5diff finish\n"); return nfound; @@ -1032,43 +975,34 @@ done: /*------------------------------------------------------------------------- * Function: diff_match * - * Purpose: - * Compare common objects in given groups according to table structure. - * The table structure has flags which can be used to find common objects - * and will be compared. - * Common object means same name (absolute path) objects in both location. - * - * Return: Number of differences found - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Purpose: Compare common objects in given groups according to table structure. + * The table structure has flags which can be used to find common objects + * and will be compared. + * Common object means same name (absolute path) objects in both location. * - * Date: May 9, 2003 + * Return: Number of differences found * - * Modifications: Jan 2005 Leon Arber, larber@uiuc.edu - * Added support for parallel diffing - * - * Pedro Vicente, pvn@hdfgroup.org, Nov 4, 2008 - * Compare the graph and make h5diff return 1 for difference if - * 1) the number of objects in file1 is not the same as in file2 - * 2) the graph does not match, i.e same names (absolute path) - * 3) objects with the same name are not of the same type + * Modifications: Compare the graph and make h5diff return 1 for difference if + * 1) the number of objects in file1 is not the same as in file2 + * 2) the graph does not match, i.e same names (absolute path) + * 3) objects with the same name are not of the same type *------------------------------------------------------------------------- */ -hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, +hsize_t +diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, const char *grp2, trav_info_t *info2, trav_table_t *table, diff_opt_t *options) { hsize_t nfound = 0; unsigned i; - - const char * grp1_path = ""; - const char * grp2_path = ""; - char * obj1_fullpath = NULL; - char * obj2_fullpath = NULL; - diff_args_t argdata; - size_t idx1 = 0; - size_t idx2 = 0; - + int ret_value = 0; + const char *grp1_path = ""; + const char *grp2_path = ""; + char *obj1_fullpath = NULL; + char *obj2_fullpath = NULL; + diff_args_t argdata; + size_t idx1 = 0; + size_t idx2 = 0; h5difftrace("diff_match start\n"); /* @@ -1081,85 +1015,82 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, grp2_path = grp2; /*------------------------------------------------------------------------- - * regarding the return value of h5diff (0, no difference in files, 1 difference ) - * 1) the number of objects in file1 must be the same as in file2 - * 2) the graph must match, i.e same names (absolute path) - * 3) objects with the same name must be of the same type - *------------------------------------------------------------------------- - */ + * regarding the return value of h5diff (0, no difference in files, 1 difference ) + * 1) the number of objects in file1 must be the same as in file2 + * 2) the graph must match, i.e same names (absolute path) + * 3) objects with the same name must be of the same type + *------------------------------------------------------------------------- + */ /* not valid compare used when --exclude-path option is used */ - if (!options->exclude_path) - { + if (!options->exclude_path) { /* number of different objects */ - if ( info1->nused != info2->nused ) - { + if (info1->nused != info2->nused) { options->contents = 0; } } /* objects in one file and not the other */ - for( i = 0; i < table->nobjs; i++) - { - if( table->objs[i].flags[0] != table->objs[i].flags[1] ) - { + for(i = 0; i < table->nobjs; i++) { + if(table->objs[i].flags[0] != table->objs[i].flags[1]) { options->contents = 0; break; } } - /*------------------------------------------------------------------------- - * do the diff for common objects - *------------------------------------------------------------------------- - */ + * do the diff for common objects + *------------------------------------------------------------------------- + */ #ifdef H5_HAVE_PARALLEL { - char *workerTasks = (char*)HDmalloc((g_nTasks - 1) * sizeof(char)); - int n; - int busyTasks = 0; - struct diffs_found nFoundbyWorker; - struct diff_mpi_args args; - int havePrintToken = 1; - MPI_Status Status; - - /*set all tasks as free */ - HDmemset(workerTasks, 1, (g_nTasks - 1)); + char *workerTasks = (char*)HDmalloc((g_nTasks - 1) * sizeof(char)); + int n; + int busyTasks = 0; + struct diffs_found nFoundbyWorker; + struct diff_mpi_args args; + int havePrintToken = 1; + MPI_Status Status; + + /*set all tasks as free */ + HDmemset(workerTasks, 1, (g_nTasks - 1)); #endif - for(i = 0; i < table->nobjs; i++) - { - if( table->objs[i].flags[0] && table->objs[i].flags[1]) - { + for(i = 0; i < table->nobjs; i++) { + if(table->objs[i].flags[0] && table->objs[i].flags[1]) { /* make full path for obj1 */ #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) - goto out; + HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ - obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1); - HDstrcpy(obj1_fullpath, grp1_path); - HDstrcat(obj1_fullpath, table->objs[i].name); + if((obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) + HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + else { + HDstrcpy(obj1_fullpath, grp1_path); + HDstrcat(obj1_fullpath, table->objs[i].name); + } #endif /* H5_HAVE_ASPRINTF */ /* make full path for obj2 */ #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) - goto out; + HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ - obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1); - HDstrcpy(obj2_fullpath, grp2_path); - HDstrcat(obj2_fullpath, table->objs[i].name); + if((obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) + HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + else { + HDstrcpy(obj2_fullpath, grp2_path); + HDstrcat(obj2_fullpath, table->objs[i].name); + } #endif /* H5_HAVE_ASPRINTF */ /* get index to figure out type of the object in file1 */ - while(info1->paths[idx1].path && - (HDstrcmp(obj1_fullpath, info1->paths[idx1].path) != 0)) + while(info1->paths[idx1].path && (HDstrcmp(obj1_fullpath, info1->paths[idx1].path) != 0)) idx1++; /* get index to figure out type of the object in file2 */ - while(info2->paths[idx2].path && - (HDstrcmp(obj2_fullpath, info2->paths[idx2].path) != 0)) + while(info2->paths[idx2].path && (HDstrcmp(obj2_fullpath, info2->paths[idx2].path) != 0)) idx2++; /* Set argdata to pass other args into diff() */ @@ -1168,15 +1099,13 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, argdata.is_same_trgobj = table->objs[i].is_same_trgobj; options->cmn_objs = 1; - if(!g_Parallel) - { + if(!g_Parallel) { nfound += diff(file1_id, obj1_fullpath, file2_id, obj2_fullpath, options, &argdata); } /* end if */ #ifdef H5_HAVE_PARALLEL - else - { + else { int workerFound = 0; h5difftrace("Beginning of big else block\n"); @@ -1190,8 +1119,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, /*Set up args to pass to worker task. */ if(HDstrlen(obj1_fullpath) > 255 || - HDstrlen(obj2_fullpath) > 255) - { + HDstrlen(obj2_fullpath) > 255) { printf("The parallel diff only supports object names up to 255 characters\n"); MPI_Abort(MPI_COMM_WORLD, 0); } /* end if */ @@ -1205,16 +1133,14 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, args.argdata.is_same_trgobj = table->objs[i].is_same_trgobj; /* if there are any outstanding print requests, let's handle one. */ - if(busyTasks > 0) - { + if(busyTasks > 0) { int incomingMessage; /* check if any tasks freed up, and didn't need to print. */ MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &incomingMessage, &Status); /* first block*/ - if(incomingMessage) - { + if(incomingMessage) { workerTasks[Status.MPI_SOURCE - 1] = 1; MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; @@ -1223,8 +1149,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, } /* end if */ /* check to see if the print token was returned. */ - if(!havePrintToken) - { + if(!havePrintToken) { /* If we don't have the token, someone is probably sending us output */ print_incoming_data(); @@ -1243,12 +1168,10 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, } /* end if */ /* check to see if anyone needs the print token. */ - if(havePrintToken) - { + if(havePrintToken) { /* check incoming queue for print token requests */ MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &incomingMessage, &Status); - if(incomingMessage) - { + if(incomingMessage) { MPI_Recv(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &Status); MPI_Send(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD); havePrintToken = 0; @@ -1259,10 +1182,8 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, /* check array of tasks to see which ones are free. * Manager task never does work, so freeTasks[0] is really * worker task 0. */ - for(n = 1; (n < g_nTasks) && !workerFound; n++) - { - if(workerTasks[n-1]) - { + for(n = 1; (n < g_nTasks) && !workerFound; n++) { + if(workerTasks[n-1]) { /* send file id's and names to first free worker */ MPI_Send(&args, sizeof(args), MPI_BYTE, n, MPI_TAG_ARGS, MPI_COMM_WORLD); @@ -1275,24 +1196,20 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, } /* end if */ } /* end for */ - if(!workerFound) - { + if(!workerFound) { /* if they were all busy, we've got to wait for one free up * before we can move on. If we don't have the token, some * task is currently printing so we'll wait for that task to * return it. */ - if(!havePrintToken) - { - while(!havePrintToken) - { + if(!havePrintToken) { + while(!havePrintToken) { int incomingMessage; print_incoming_data(); MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &incomingMessage, &Status); - if(incomingMessage) - { + if(incomingMessage) { MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); havePrintToken = 1; nfound += nFoundbyWorker.nfound; @@ -1303,27 +1220,23 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, } /* end while */ } /* end if */ /* if we do have the token, check for task to free up, or wait for a task to request it */ - else - { + else { /* But first print all the data in our incoming queue */ print_incoming_data(); MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &Status); - if(Status.MPI_TAG == MPI_TAG_DONE) - { + if(Status.MPI_TAG == MPI_TAG_DONE) { MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD); } /* end if */ - else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST) - { + else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST) { int incomingMessage; MPI_Recv(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &Status); MPI_Send(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD); - do - { + do { MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &incomingMessage, &Status); print_incoming_data(); @@ -1334,8 +1247,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD); } /* end else-if */ - else - { + else { printf("ERROR: Invalid tag (%d) received \n", Status.MPI_TAG); MPI_Abort(MPI_COMM_WORLD, 0); MPI_Finalize(); @@ -1353,24 +1265,19 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, h5difftrace("done with for loop\n"); #ifdef H5_HAVE_PARALLEL - if(g_Parallel) - { + if(g_Parallel) { /* make sure all tasks are done */ - while(busyTasks > 0) - { + while(busyTasks > 0) { MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &Status); - if(Status.MPI_TAG == MPI_TAG_DONE) - { + if(Status.MPI_TAG == MPI_TAG_DONE) { MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; } /* end if */ - else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST) - { + else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST) { MPI_Recv(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &Status); - if(havePrintToken) - { + if(havePrintToken) { int incomingMessage; MPI_Send(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD); @@ -1387,13 +1294,11 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, busyTasks--; } /* end if */ /* someone else must have it...wait for them to return it, then give it to the task that just asked for it. */ - else - { + else { int source = Status.MPI_SOURCE; int incomingMessage; - do - { + do { MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &incomingMessage, &Status); print_incoming_data(); @@ -1407,16 +1312,14 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, MPI_Send(NULL, 0, MPI_BYTE, source, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD); } /* end else */ } /* end else-if */ - else if(Status.MPI_TAG == MPI_TAG_TOK_RETURN) - { + else if(Status.MPI_TAG == MPI_TAG_TOK_RETURN) { MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; havePrintToken = 1; } /* end else-if */ - else if(Status.MPI_TAG == MPI_TAG_PRINT_DATA) - { + else if(Status.MPI_TAG == MPI_TAG_PRINT_DATA) { char data[PRINT_DATA_MAX_SIZE + 1]; HDmemset(data, 0, PRINT_DATA_MAX_SIZE + 1); @@ -1424,8 +1327,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, printf("%s", data); } /* end else-if */ - else - { + else { printf("ph5diff-manager: ERROR!! Invalid tag (%d) received \n", Status.MPI_TAG); MPI_Abort(MPI_COMM_WORLD, 0); } /* end else */ @@ -1456,47 +1358,35 @@ out: /*------------------------------------------------------------------------- * Function: diff * - * Purpose: switch between types and choose the diff function - * TYPE is either - * H5G_GROUP Object is a group - * H5G_DATASET Object is a dataset - * H5G_TYPE Object is a named data type - * H5G_LINK Object is a symbolic link - * - * Return: Number of differences found - * - * Programmer: Jonathan Kim - * - Move follow symlinks code toward top. (March 2812) - * - Add following symlinks feature (Feb 11,2010) - * - Change to use diff_args_t to pass the rest of args. - * Passing through it instead of individual args provides smoother - * extensibility through its members along with MPI code update for ph5diff - * as it doesn't require interface change. - * (May 6,2011) + * Purpose: switch between types and choose the diff function + * TYPE is either + * H5G_GROUP Object is a group + * H5G_DATASET Object is a dataset + * H5G_TYPE Object is a named data type + * H5G_LINK Object is a symbolic link * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * Date: May 9, 2003 + * Return: Number of differences found *------------------------------------------------------------------------- */ - -hsize_t diff(hid_t file1_id, +hsize_t +diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_opt_t * options, diff_args_t *argdata) { - hid_t dset1_id = (-1); - hid_t dset2_id = (-1); - hid_t type1_id = (-1); - hid_t type2_id = (-1); - hid_t grp1_id = (-1); - hid_t grp2_id = (-1); - int ret; - hbool_t is_dangle_link1 = FALSE; - hbool_t is_dangle_link2 = FALSE; - hbool_t is_hard_link = FALSE; - hsize_t nfound = 0; + int ret_value = 0; + hid_t dset1_id = -1; + hid_t dset2_id = -1; + hid_t type1_id = -1; + hid_t type2_id = -1; + hid_t grp1_id = -1; + hid_t grp2_id = -1; + hbool_t is_dangle_link1 = FALSE; + hbool_t is_dangle_link2 = FALSE; + hbool_t is_hard_link = FALSE; + hsize_t nfound = 0; h5trav_type_t object_type; /* to get link info */ @@ -1505,9 +1395,12 @@ hsize_t diff(hid_t file1_id, h5difftrace("diff start\n"); + /*init error status */ + options->err_stat = 1; + /*init link info struct */ - HDmemset(&linkinfo1,0,sizeof(h5tool_link_info_t)); - HDmemset(&linkinfo2,0,sizeof(h5tool_link_info_t)); + HDmemset(&linkinfo1, 0, sizeof(h5tool_link_info_t)); + HDmemset(&linkinfo2, 0, sizeof(h5tool_link_info_t)); /* pass how to handle printing warnings to linkinfo option */ if(print_warn(options)) @@ -1518,78 +1411,71 @@ hsize_t diff(hid_t file1_id, if (argdata->type[0] == H5TRAV_TYPE_LINK || argdata->type[0] == H5TRAV_TYPE_UDLINK || argdata->type[1] == H5TRAV_TYPE_LINK || - argdata->type[1] == H5TRAV_TYPE_UDLINK ) - { + argdata->type[1] == H5TRAV_TYPE_UDLINK) { /* * check dangling links for path1 and path2 */ /* target object1 - get type and name */ - ret = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, options->follow_links); + if ((ret_value = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, options->follow_links)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5tools_get_symlink_info failed"); + /* dangling link */ - if (ret == 0) - { - if (options->no_dangle_links) - { + if (ret_value == 0) { + if (options->no_dangle_links) { /* dangling link is error */ if(options->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path1); - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "dangling link is error"); } else is_dangle_link1 = TRUE; } - else if (ret < 0) - goto out; /* target object2 - get type and name */ - ret = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, options->follow_links ); + if ((ret_value = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, options->follow_links)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5tools_get_symlink_info failed"); /* dangling link */ - if (ret == 0) - { - if (options->no_dangle_links) - { + if (ret_value == 0) { + if (options->no_dangle_links) { /* dangling link is error */ if(options->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path2); - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "dangling link is error"); } else is_dangle_link2 = TRUE; } - else if (ret < 0) - goto out; /* found dangling link */ - if (is_dangle_link1 || is_dangle_link2) - goto out2; + if (is_dangle_link1 || is_dangle_link2) { + options->err_stat = 0; + HGOTO_DONE(0); + } /* follow symbolic link option */ - if (options->follow_links) - { + if (options->follow_links) { if (linkinfo1.linfo.type == H5L_TYPE_SOFT || linkinfo1.linfo.type == H5L_TYPE_EXTERNAL) argdata->type[0] = (h5trav_type_t)linkinfo1.trg_type; - if (linkinfo2.linfo.type == H5L_TYPE_SOFT || - linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) + if (linkinfo2.linfo.type == H5L_TYPE_SOFT || linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) argdata->type[1] = (h5trav_type_t)linkinfo2.trg_type; } } /* if objects are not the same type */ - if (argdata->type[0] != argdata->type[1]) - { - if (options->m_verbose||options->m_list_not_cmp) - { + if (argdata->type[0] != argdata->type[1]) { + if (options->m_verbose||options->m_list_not_cmp) { parallel_print("Not comparable: <%s> is of type %s and <%s> is of type %s\n", path1, get_type(argdata->type[0]), path2, get_type(argdata->type[1])); } - options->not_cmp=1; + options->not_cmp = 1; /* TODO: will need to update non-comparable is different * options->contents = 0; */ - goto out2; + options->err_stat = 0; + HGOTO_DONE(0); } else /* now both object types are same */ object_type = argdata->type[0]; @@ -1602,19 +1488,15 @@ hsize_t diff(hid_t file1_id, * * Perform this to match the outputs as bypassing. */ - if (argdata->is_same_trgobj) - { + if (argdata->is_same_trgobj) { h5difftrace("argdata->is_same_trgobj\n"); is_hard_link = (object_type == H5TRAV_TYPE_DATASET || object_type == H5TRAV_TYPE_NAMED_DATATYPE || object_type == H5TRAV_TYPE_GROUP); - if (options->follow_links || is_hard_link) - { + if (options->follow_links || is_hard_link) { /* print information is only verbose option is used */ - if(options->m_verbose || options->m_report) - { - switch(object_type) - { + if(options->m_verbose || options->m_report) { + switch(object_type) { case H5TRAV_TYPE_DATASET: do_print_objname("dataset", path1, path2, options); break; @@ -1645,46 +1527,41 @@ hsize_t diff(hid_t file1_id, } /* if(options->m_verbose || options->m_report) */ /* exact same, so comparison is done */ - goto out2; + options->err_stat = 0; + HGOTO_DONE(0); } } - switch(object_type) - { + switch(object_type) { /*---------------------------------------------------------------------- * H5TRAV_TYPE_DATASET *---------------------------------------------------------------------- */ case H5TRAV_TYPE_DATASET: if((dset1_id = H5Dopen2(file1_id, path1, H5P_DEFAULT)) < 0) - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); if((dset2_id = H5Dopen2(file2_id, path2, H5P_DEFAULT)) < 0) - goto out; - /* verbose (-v) and report (-r) mode */ - if(options->m_verbose || options->m_report) - { + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + /* verbose (-v) and report (-r) mode */ + if(options->m_verbose || options->m_report) { do_print_objname("dataset", path1, path2, options); nfound = diff_dataset(file1_id, file2_id, path1, path2, options); print_found(nfound); } /* quiet mode (-q), just count differences */ - else if(options->m_quiet) - { + else if(options->m_quiet) { nfound = diff_dataset(file1_id, file2_id, path1, path2, options); } - /* the rest (-c, none, ...) */ - else - { + /* the rest (-c, none, ...) */ + else { nfound = diff_dataset(file1_id, file2_id, path1, path2, options); /* print info if difference found */ - if (nfound) - { + if (nfound) { do_print_objname("dataset", path1, path2, options); print_found(nfound); } } - /*--------------------------------------------------------- * compare attributes * if condition refers to cases when the dataset is a @@ -1696,9 +1573,9 @@ hsize_t diff(hid_t file1_id, if(H5Dclose(dset1_id) < 0) - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); if(H5Dclose(dset2_id) < 0) - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); break; /*---------------------------------------------------------------------- @@ -1707,15 +1584,15 @@ hsize_t diff(hid_t file1_id, */ case H5TRAV_TYPE_NAMED_DATATYPE: if((type1_id = H5Topen2(file1_id, path1, H5P_DEFAULT)) < 0) - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Topen2 failed"); if((type2_id = H5Topen2(file2_id, path2, H5P_DEFAULT)) < 0) - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Topen2 failed"); - if((ret = H5Tequal(type1_id, type2_id)) < 0) - goto out; + if((ret_value = H5Tequal(type1_id, type2_id)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tequal failed"); /* if H5Tequal is > 0 then the datatypes refer to the same datatype */ - nfound = (ret > 0) ? 0 : 1; + nfound = (ret_value > 0) ? 0 : 1; if(print_objname(options,nfound)) do_print_objname("datatype", path1, path2, options); @@ -1734,9 +1611,9 @@ hsize_t diff(hid_t file1_id, nfound += diff_attr(type1_id, type2_id, path1, path2, options); if(H5Tclose(type1_id) < 0) - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); if(H5Tclose(type2_id) < 0) - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); break; /*---------------------------------------------------------------------- @@ -1752,9 +1629,9 @@ hsize_t diff(hid_t file1_id, print_found(nfound); if((grp1_id = H5Gopen2(file1_id, path1, H5P_DEFAULT)) < 0) - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); if((grp2_id = H5Gopen2(file2_id, path2, H5P_DEFAULT)) < 0) - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); /*----------------------------------------------------------------- * compare attributes @@ -1766,9 +1643,9 @@ hsize_t diff(hid_t file1_id, nfound += diff_attr(grp1_id, grp2_id, path1, path2, options); if(H5Gclose(grp1_id) < 0) - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); if(H5Gclose(grp2_id) < 0) - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); break; @@ -1778,19 +1655,19 @@ hsize_t diff(hid_t file1_id, */ case H5TRAV_TYPE_LINK: { - ret = HDstrcmp(linkinfo1.trg_path, linkinfo2.trg_path); + ret_value = HDstrcmp(linkinfo1.trg_path, linkinfo2.trg_path); - /* if the target link name is not same then the links are "different" */ - nfound = (ret != 0) ? 1 : 0; + /* if the target link name is not same then the links are "different" */ + nfound = (ret_value != 0) ? 1 : 0; - if(print_objname(options, nfound)) - do_print_objname("link", path1, path2, options); + if(print_objname(options, nfound)) + do_print_objname("link", path1, path2, options); - /* always print the number of differences found in verbose mode */ - if(options->m_verbose) - print_found(nfound); + /* always print the number of differences found in verbose mode */ + if(options->m_verbose) + print_found(nfound); - } + } break; /*---------------------------------------------------------------------- @@ -1799,49 +1676,46 @@ hsize_t diff(hid_t file1_id, */ case H5TRAV_TYPE_UDLINK: { - /* Only external links will have a query function registered */ - if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) - { - /* If the buffers are the same size, compare them */ - if(linkinfo1.linfo.u.val_size == linkinfo2.linfo.u.val_size) - { - ret = HDmemcmp(linkinfo1.trg_path, linkinfo2.trg_path, linkinfo1.linfo.u.val_size); - } - else - ret = 1; + /* Only external links will have a query function registered */ + if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) { + /* If the buffers are the same size, compare them */ + if(linkinfo1.linfo.u.val_size == linkinfo2.linfo.u.val_size) { + ret_value = HDmemcmp(linkinfo1.trg_path, linkinfo2.trg_path, linkinfo1.linfo.u.val_size); + } + else + ret_value = 1; - /* if "linkinfo1.trg_path" != "linkinfo2.trg_path" then the links - * are "different" extlinkinfo#.path is combination string of - * file_name and obj_name - */ - nfound = (ret != 0) ? 1 : 0; + /* if "linkinfo1.trg_path" != "linkinfo2.trg_path" then the links + * are "different" extlinkinfo#.path is combination string of + * file_name and obj_name + */ + nfound = (ret_value != 0) ? 1 : 0; - if(print_objname(options, nfound)) - do_print_objname("external link", path1, path2, options); + if(print_objname(options, nfound)) + do_print_objname("external link", path1, path2, options); - } /* end if */ - else - { - /* If one or both of these links isn't an external link, we can only - * compare information from H5Lget_info since we don't have a query - * function registered for them. - * - * If the link classes or the buffer length are not the - * same, the links are "different" - */ - if((linkinfo1.linfo.type != linkinfo2.linfo.type) || - (linkinfo1.linfo.u.val_size != linkinfo2.linfo.u.val_size)) - nfound = 1; - else - nfound = 0; - - if (print_objname (options, nfound)) - do_print_objname ("user defined link", path1, path2, options); - } /* end else */ + } /* end if */ + else { + /* If one or both of these links isn't an external link, we can only + * compare information from H5Lget_info since we don't have a query + * function registered for them. + * + * If the link classes or the buffer length are not the + * same, the links are "different" + */ + if((linkinfo1.linfo.type != linkinfo2.linfo.type) || + (linkinfo1.linfo.u.val_size != linkinfo2.linfo.u.val_size)) + nfound = 1; + else + nfound = 0; - /* always print the number of differences found in verbose mode */ - if(options->m_verbose) - print_found(nfound); + if (print_objname (options, nfound)) + do_print_objname ("user defined link", path1, path2, options); + } /* end else */ + + /* always print the number of differences found in verbose mode */ + if(options->m_verbose) + print_found(nfound); } break; @@ -1854,33 +1728,21 @@ hsize_t diff(hid_t file1_id, break; } - /* free link info buffer */ - if (linkinfo1.trg_path) - HDfree(linkinfo1.trg_path); - if (linkinfo2.trg_path) - HDfree(linkinfo2.trg_path); - - return nfound; - -out: - options->err_stat = 1; + options->err_stat = 0; -out2: +done: /*----------------------------------- * handle dangling link(s) */ /* both path1 and path2 are dangling links */ - if(is_dangle_link1 && is_dangle_link2) - { - if(print_objname(options, nfound)) - { + if(is_dangle_link1 && is_dangle_link2) { + if(print_objname(options, nfound)) { do_print_objname("dangling link", path1, path2, options); print_found(nfound); } } /* path1 is dangling link */ - else if (is_dangle_link1) - { + else if (is_dangle_link1) { if(options->m_verbose) parallel_print("obj1 <%s> is a dangling link.\n", path1); nfound++; @@ -1888,8 +1750,7 @@ out2: print_found(nfound); } /* path2 is dangling link */ - else if (is_dangle_link2) - { + else if (is_dangle_link2) { if(options->m_verbose) parallel_print("obj2 <%s> is a dangling link.\n", path2); nfound++; @@ -1906,12 +1767,15 @@ out2: /* close */ /* disable error reporting */ H5E_BEGIN_TRY { + H5Dclose(dset1_id); + H5Dclose(dset2_id); H5Tclose(type1_id); H5Tclose(type2_id); H5Gclose(grp1_id); - H5Tclose(grp2_id); + H5Gclose(grp2_id); /* enable error reporting */ } H5E_END_TRY; + h5difftrace("diff finish\n"); return nfound; diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 09894e6..58a5e09 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -256,11 +256,6 @@ static void close_member_types(mcomp_t *members); * Purpose: compare two memory buffers; * * Return: number of differences found - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 12, 2003 - * *------------------------------------------------------------------------- */ @@ -378,10 +373,8 @@ hsize_t diff_array( for (i = 0; i < nelmts; i++) { nfound += diff_datum(mem1 + i * size, mem2 + i * size, m_type, i, rank, dims, acc, pos, options, name1, name2, container1_id, container2_id, &ph, &members); - if (options->n && nfound >= options->count) { - close_member_types(&members); - return nfound; - } + if (options->n && nfound >= options->count) + break; } /* i */ close_member_types(&members); } /* switch */ @@ -397,10 +390,6 @@ hsize_t diff_array( * * Return: number of differences found * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October 29, 2003 - * * The comparison of the 2 buffers read from the files is made datum by datum. * * H5T_INTEGER and H5T_FLOAT @@ -441,13 +430,12 @@ static hsize_t diff_datum( const char *obj2, hid_t container1_id, hid_t container2_id, /*where the reference came from*/ - int *ph, /*print header */ - mcomp_t *members) /*compound members */ + int *ph, /*print header */ + mcomp_t *members) /*compound members */ { unsigned char *mem1 = (unsigned char*) _mem1; unsigned char *mem2 = (unsigned char*) _mem2; size_t u; - hid_t memb_type; size_t type_size; H5T_sign_t type_sign; H5T_class_t type_class; @@ -458,10 +446,8 @@ static hsize_t diff_datum( size_t size = 0; hbool_t iszero1; hbool_t iszero2; - hid_t obj1_id; - hid_t obj2_id; - hsize_t nfound = 0; /* differences found */ - int ret = 0; /* check return error */ + hsize_t nfound = 0; /* differences found */ + hsize_t ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ double per; hbool_t both_zero; @@ -478,14 +464,14 @@ static hsize_t diff_datum( type_class != H5T_STRING && type_class != H5T_VLEN && HDmemcmp(mem1, mem2, type_size) == 0) - return 0; + HGOTO_DONE(0); switch (H5Tget_class(m_type)) { case H5T_NO_CLASS: case H5T_TIME: case H5T_NCLASSES: default: - HDassert(0); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Invalid type class"); break; /*------------------------------------------------------------------------- @@ -494,15 +480,17 @@ static hsize_t diff_datum( */ case H5T_COMPOUND: h5difftrace("diff_datum H5T_COMPOUND\n"); + { + hid_t memb_type = -1; + nmembs = members->n; - nmembs = members->n; - - for (j = 0; j < nmembs; j++) { - offset = members->offsets[j]; - memb_type = members->ids[j]; + for (j = 0; j < nmembs; j++) { + offset = members->offsets[j]; + memb_type = members->ids[j]; - nfound += diff_datum(mem1 + offset, mem2 + offset, memb_type, index, - rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members->m[j]); + nfound += diff_datum(mem1 + offset, mem2 + offset, memb_type, index, + rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members->m[j]); + } } break; @@ -532,6 +520,7 @@ static hsize_t diff_datum( size1 = HDstrlen(s1); else size1 = 0; + /* Get pointer to second string */ s2 = *(char**) mem2; if (s2) @@ -547,14 +536,17 @@ static hsize_t diff_datum( size1 = HDstrlen(s1); else size1 = 0; + if (size1 > size_mtype) size1 = size_mtype; + /* Get pointer to second string */ s2 = (char*) mem2; if (s2) size2 = HDstrlen(s2); else size2 = 0; + if (size2 > size_mtype) size2 = size_mtype; } @@ -562,6 +554,7 @@ static hsize_t diff_datum( /* Get pointer to first string */ s1 = (char *) mem1; size1 = size_mtype; + /* Get pointer to second string */ s2 = (char *) mem2; size2 = size_mtype; @@ -573,8 +566,8 @@ static hsize_t diff_datum( * of length of strings. * For now mimic the previous way. */ - h5diffdebug2("diff_datum string size:%d\n",size1); - h5diffdebug2("diff_datum string size:%d\n",size2); + h5diffdebug2("diff_datum string size:%d\n", size1); + h5diffdebug2("diff_datum string size:%d\n", size2); if (size1 != size2) { h5difftrace("diff_datum string sizes\n"); nfound++; @@ -595,15 +588,15 @@ static hsize_t diff_datum( /* check for NULL pointer for string */ if (s != NULL) { /* try fast compare first */ - if (HDmemcmp(s1, s2, size) == 0) { + if (HDmemcmp(s, sx, size) == 0) { if (size1 != size2) if (print_data(options)) for (u = size; u < sizex; u++) - character_compare(s1 + u, s2 + u, index, u, rank, dims, acc, pos, options, obj1, obj2, ph); + character_compare(s + u, sx + u, index, u, rank, dims, acc, pos, options, obj1, obj2, ph); } else for (u = 0; u < size; u++) - nfound += character_compare(s1 + u, s2 + u, index, u, rank, dims, acc, pos, options, obj1, obj2, ph); + nfound += character_compare(s + u, sx + u, index, u, rank, dims, acc, pos, options, obj1, obj2, ph); } /* end check for NULL pointer for string */ } break; @@ -699,8 +692,9 @@ static hsize_t diff_datum( */ case H5T_ARRAY: { + hid_t memb_type = -1; hsize_t adims[H5S_MAX_RANK]; - int ndims; + int ndims; /* get the array's base datatype for each element */ memb_type = H5Tget_super(m_type); @@ -728,7 +722,7 @@ static hsize_t diff_datum( iszero1 = all_zero(_mem1, H5Tget_size(m_type)); iszero2 = all_zero(_mem2, H5Tget_size(m_type)); if (iszero1 != iszero2) { - return 1; + HGOTO_DONE (1); } else if (!iszero1 && !iszero2) { /*------------------------------------------------------------------------- @@ -736,29 +730,34 @@ static hsize_t diff_datum( * Dataset region reference *------------------------------------------------------------------------- */ + hid_t obj1_id = -1; + hid_t obj2_id = -1; + if (type_size == H5R_DSET_REG_REF_BUF_SIZE) { - hid_t region1_id; - hid_t region2_id; + hid_t region1_id = -1; + hid_t region2_id = -1; if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem1)) < 0) - ret = -1; + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference2 object 1 failed"); if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem2)) < 0) - ret = -1; + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference2 object 2 failed"); if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1)) < 0) - ret = -1; + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_region object 1 failed"); if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) < 0) - ret = -1; + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_region object 2 failed"); - if (ret == -1) { - options->err_stat = 1; - return 0; - } + if (ret_value >= 0) + nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, options); - nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, options); H5Oclose(obj1_id); H5Oclose(obj2_id); H5Sclose(region1_id); H5Sclose(region2_id); + + if (ret_value == -1) { + options->err_stat = 1; + HGOTO_DONE(0); + } }/*dataset reference*/ /*------------------------------------------------------------------------- @@ -771,44 +770,43 @@ static hsize_t diff_datum( H5O_type_t obj2_type; if (H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) - ret = -1; + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_obj_type2 object 1 failed"); if (H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) - ret = -1; - if (ret == -1) { - options->err_stat = 1; - return 0; - } /* end if */ + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_obj_type2 object 2 failed"); /* check object type */ - if (obj1_type != obj2_type) { - parallel_print( - "Different object types referenced: <%s> and <%s>", obj1, obj2); - options->not_cmp = 1; - return 0; - } + if (ret_value >= 0) + if (obj1_type != obj2_type) { + parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2); + options->not_cmp = 1; + HGOTO_DONE (0); + } if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_OBJECT, _mem1)) < 0) - ret = -1; + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference2 object 1 failed"); if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_OBJECT, _mem2)) < 0) - ret = -1; - if (ret == -1) { - options->err_stat = 1; - return 0; - } + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference2 object 2 failed"); /* compare */ - if (obj1_type == H5O_TYPE_DATASET) - nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, options); - else { - if (options->m_verbose) - parallel_print( - "Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", - obj1, obj2); - options->not_cmp = 1; + if (ret_value >= 0) { + if (obj1_type == H5O_TYPE_DATASET) + nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, options); + else { + if (options->m_verbose) + parallel_print( + "Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", + obj1, obj2); + options->not_cmp = 1; + } } H5Oclose(obj1_id); H5Oclose(obj2_id); + + if (ret_value == -1) { + options->err_stat = 1; + HGOTO_DONE(0); + } }/*object reference*/ }/*is zero*/ break; @@ -818,18 +816,22 @@ static hsize_t diff_datum( *------------------------------------------------------------------------- */ case H5T_VLEN: - /* get the VL sequences's base datatype for each element */ - memb_type = H5Tget_super(m_type); - size = H5Tget_size(memb_type); + { + hid_t memb_type = -1; + + /* get the VL sequences's base datatype for each element */ + memb_type = H5Tget_super(m_type); + size = H5Tget_size(memb_type); - /* get the number of sequence elements */ - nelmts = ((hvl_t *) mem1)->len; + /* get the number of sequence elements */ + nelmts = ((hvl_t *) mem1)->len; - for (j = 0; j < nelmts; j++) - nfound += diff_datum(((char *) (((hvl_t *) mem1)->p)) + j * size, ((char *) (((hvl_t *) mem2)->p)) + j * size, memb_type, index, - rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members); + for (j = 0; j < nelmts; j++) + nfound += diff_datum(((char *) (((hvl_t *) mem1)->p)) + j * size, ((char *) (((hvl_t *) mem2)->p)) + j * size, memb_type, index, + rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members); - H5Tclose(memb_type); + H5Tclose(memb_type); + } break; /*------------------------------------------------------------------------- @@ -845,7 +847,9 @@ static hsize_t diff_datum( if (type_size == 1 && type_sign != H5T_SGN_NONE) { char temp1_char; char temp2_char; - HDassert(type_size == sizeof(char)); + + if(type_size != sizeof(char)) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not char size"); HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); /* -d and !-p */ @@ -918,7 +922,9 @@ static hsize_t diff_datum( else if (type_size == 1 && type_sign == H5T_SGN_NONE) { unsigned char temp1_uchar; unsigned char temp2_uchar; - HDassert(type_size == sizeof(unsigned char)); + + if(type_size != sizeof(unsigned char)) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not unsigned char size"); HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -992,7 +998,9 @@ static hsize_t diff_datum( else if (type_size == 2 && type_sign != H5T_SGN_NONE) { short temp1_short; short temp2_short; - HDassert(type_size == sizeof(short)); + + if(type_size != sizeof(short)) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not short size"); HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); @@ -1066,7 +1074,9 @@ static hsize_t diff_datum( else if (type_size == 2 && type_sign == H5T_SGN_NONE) { unsigned short temp1_ushort; unsigned short temp2_ushort; - HDassert(type_size == sizeof(short)); + + if(type_size != sizeof(unsigned short)) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not unsigned short size"); HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); @@ -1140,7 +1150,9 @@ static hsize_t diff_datum( else if (type_size == 4 && type_sign != H5T_SGN_NONE) { int temp1_int; int temp2_int; - HDassert(type_size == sizeof(int)); + + if(type_size != sizeof(int)) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not int size"); HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); @@ -1214,7 +1226,9 @@ static hsize_t diff_datum( else if (type_size == 4 && type_sign == H5T_SGN_NONE) { unsigned int temp1_uint; unsigned int temp2_uint; - HDassert(type_size == sizeof(int)); + + if(type_size != sizeof(unsigned int)) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not unsigned int size"); HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); @@ -1288,7 +1302,9 @@ static hsize_t diff_datum( else if (type_size == 8 && type_sign != H5T_SGN_NONE) { long temp1_long; long temp2_long; - HDassert(type_size == sizeof(long)); + + if(type_size != sizeof(long)) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not long size"); HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); @@ -1362,7 +1378,9 @@ static hsize_t diff_datum( else if (type_size == 8 && type_sign == H5T_SGN_NONE) { unsigned long temp1_ulong; unsigned long temp2_ulong; - HDassert(type_size == sizeof(unsigned long)); + + if(type_size != sizeof(unsigned long)) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not unsigned long size"); HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); @@ -1445,7 +1463,8 @@ static hsize_t diff_datum( hbool_t isnan1 = FALSE; hbool_t isnan2 = FALSE; - HDassert(type_size == sizeof(float)); + if(type_size != sizeof(float)) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not float size"); HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); @@ -1603,7 +1622,8 @@ static hsize_t diff_datum( hbool_t isnan1 = FALSE; hbool_t isnan2 = FALSE; - HDassert(type_size == sizeof(double)); + if(type_size != sizeof(double)) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not double size"); HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); @@ -1761,7 +1781,8 @@ static hsize_t diff_datum( hbool_t isnan1 = FALSE; hbool_t isnan2 = FALSE; - HDassert(type_size == sizeof(long double)); + if(type_size != sizeof(long double)) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not long double size"); HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); @@ -1852,7 +1873,7 @@ static hsize_t diff_datum( * -d and -p *------------------------------------------------------------------------- */ - else if ( options->d && options->p) { + else if (options->d && options->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- @@ -1863,7 +1884,7 @@ static hsize_t diff_datum( } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) { + if (!isnan1 && !isnan2) { PER(temp1_double,temp2_double); if (not_comparable && !both_zero) { @@ -1911,6 +1932,8 @@ static hsize_t diff_datum( break; /* H5T_FLOAT class */ } /* switch */ + +done: h5difftrace("diff_datum finish\n"); return nfound; @@ -1922,7 +1945,6 @@ static hsize_t diff_datum( * Purpose: Determines if memory is initialized to all zero bytes. * * Return: TRUE if all bytes are zero; FALSE otherwise - * *------------------------------------------------------------------------- */ @@ -1942,7 +1964,6 @@ static hbool_t all_zero(const void *_mem, size_t size) { * Purpose: print start coordinates and opposite corner of a region block * * Return: void - * *------------------------------------------------------------------------- */ @@ -1965,7 +1986,6 @@ void print_region_block(int i, hsize_t *ptdata, int ndims) { * Purpose: print points of a region reference * * Return: void - * *------------------------------------------------------------------------- */ @@ -1986,18 +2006,18 @@ void print_points(int i, hsize_t *ptdata, int ndims) { * Purpose: diff a dataspace region * * Return: number of differences - * *------------------------------------------------------------------------- */ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *options) { + hsize_t ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hssize_t nblocks1, npoints1; hssize_t nblocks2, npoints2; hsize_t alloc_size; - hsize_t *ptdata1; - hsize_t *ptdata2; + hsize_t *ptdata1 = NULL; + hsize_t *ptdata2 = NULL; int ndims1; int ndims2; int i, j; @@ -2012,18 +2032,17 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t * respectively. They do not currently know how to translate from one to * the other. */ - H5E_BEGIN_TRY - { - nblocks1 = H5Sget_select_hyper_nblocks(region1_id); - nblocks2 = H5Sget_select_hyper_nblocks(region2_id); + H5E_BEGIN_TRY { + nblocks1 = H5Sget_select_hyper_nblocks(region1_id); + nblocks2 = H5Sget_select_hyper_nblocks(region2_id); - npoints1 = H5Sget_select_elem_npoints(region1_id); - npoints2 = H5Sget_select_elem_npoints(region2_id); - }H5E_END_TRY; + npoints1 = H5Sget_select_elem_npoints(region1_id); + npoints2 = H5Sget_select_elem_npoints(region2_id); + } H5E_END_TRY; if (nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) { options->not_cmp = 1; - return 0; + HGOTO_DONE (0); } /*------------------------------------------------------------------------- @@ -2032,57 +2051,60 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t */ if (nblocks1 > 0) { HDassert(ndims1 > 0); - alloc_size = (hsize_t) nblocks1 * (unsigned) ndims1 * 2 - * sizeof(ptdata1[0]); + alloc_size = (hsize_t) nblocks1 * (unsigned) ndims1 * 2 * sizeof(ptdata1[0]); HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/ - ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size); - H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t); - H5Sget_select_hyper_blocklist(region1_id, (hsize_t) 0, - (hsize_t) nblocks1, ptdata1); - - ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size); - H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t); - H5Sget_select_hyper_blocklist(region2_id, (hsize_t) 0, - (hsize_t) nblocks2, ptdata2); - - for (i = 0; i < nblocks1; i++) { - /* start coordinates and opposite corner */ - for (j = 0; j < ndims1; j++) { - hsize_t start1, start2, end1, end2; + if((ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) { + HERROR(H5E_tools_g, H5E_tools_min_id_g, "Buffer allocation failed"); + } + else { + H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t); + H5Sget_select_hyper_blocklist(region1_id, (hsize_t) 0, (hsize_t) nblocks1, ptdata1); - start1 = ptdata1[i * 2 * ndims1 + j]; - start2 = ptdata2[i * 2 * ndims1 + j]; - end1 = ptdata1[i * 2 * ndims1 + j + ndims1]; - end2 = ptdata2[i * 2 * ndims1 + j + ndims1]; - if (start1 != start2 || end1 != end2) - nfound_b++; + if((ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) { + HERROR(H5E_tools_g, H5E_tools_min_id_g, "Buffer allocation failed"); } - } + else { + H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t); + H5Sget_select_hyper_blocklist(region2_id, (hsize_t) 0, (hsize_t) nblocks2, ptdata2); + + for (i = 0; i < nblocks1; i++) { + /* start coordinates and opposite corner */ + for (j = 0; j < ndims1; j++) { + hsize_t start1, start2, end1, end2; + + start1 = ptdata1[i * 2 * ndims1 + j]; + start2 = ptdata2[i * 2 * ndims1 + j]; + end1 = ptdata1[i * 2 * ndims1 + j + ndims1]; + end2 = ptdata2[i * 2 * ndims1 + j + ndims1]; + if (start1 != start2 || end1 != end2) + nfound_b++; + } + } - /* print differences if found */ - if (nfound_b && options->m_verbose) { - H5O_info_t oi1, oi2; + /* print differences if found */ + if (nfound_b && options->m_verbose) { + H5O_info_t oi1, oi2; - H5Oget_info(obj1_id, &oi1); - H5Oget_info(obj2_id, &oi2); + H5Oget_info(obj1_id, &oi1); + H5Oget_info(obj2_id, &oi2); - parallel_print("Referenced dataset %lu %lu\n", - (unsigned long) oi1.addr, (unsigned long) oi2.addr); - parallel_print( - "------------------------------------------------------------\n"); + parallel_print("Referenced dataset %lu %lu\n", (unsigned long) oi1.addr, (unsigned long) oi2.addr); + parallel_print( "------------------------------------------------------------\n"); - parallel_print("Region blocks\n"); - for (i = 0; i < nblocks1; i++) { - parallel_print("block #%d", i); - print_region_block(i, ptdata1, ndims1); - print_region_block(i, ptdata2, ndims1); - parallel_print("\n"); - } - } + parallel_print("Region blocks\n"); + for (i = 0; i < nblocks1; i++) { + parallel_print("block #%d", i); + print_region_block(i, ptdata1, ndims1); + print_region_block(i, ptdata2, ndims1); + parallel_print("\n"); + } + } + HDfree(ptdata2); + } /* else ptdata2 */ - HDfree(ptdata1); - HDfree(ptdata2); + HDfree(ptdata1); + } /* else ptdata1 */ } /*------------------------------------------------------------------------- @@ -2090,95 +2112,104 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t *------------------------------------------------------------------------- */ if (npoints1 > 0) { - alloc_size = (hsize_t) npoints1 * (unsigned) ndims1 - * sizeof(ptdata1[0]); + alloc_size = (hsize_t) npoints1 * (unsigned) ndims1 * sizeof(ptdata1[0]); HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/ - ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size); - H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); - H5Sget_select_elem_pointlist(region1_id, (hsize_t) 0, - (hsize_t) npoints1, ptdata1); - - ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size); - H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); - H5Sget_select_elem_pointlist(region2_id, (hsize_t) 0, - (hsize_t) npoints2, ptdata2); - - for (i = 0; i < npoints1; i++) { - hsize_t pt1, pt2; + if((ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) { + HERROR(H5E_tools_g, H5E_tools_min_id_g, "Buffer allocation failed"); + } + else { + H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); + H5Sget_select_elem_pointlist(region1_id, (hsize_t) 0, (hsize_t) npoints1, ptdata1); - for (j = 0; j < ndims1; j++) { - pt1 = ptdata1[i * ndims1 + j]; - pt2 = ptdata2[i * ndims1 + j]; - if (pt1 != pt2) - nfound_p++; + if((ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) { + HERROR(H5E_tools_g, H5E_tools_min_id_g, "Buffer allocation failed"); } - } + else { + H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); + H5Sget_select_elem_pointlist(region2_id, (hsize_t) 0, (hsize_t) npoints2, ptdata2); - if (nfound_p && options->m_verbose) { - parallel_print("Region points\n"); - for (i = 0; i < npoints1; i++) { - hsize_t pt1, pt2; - int diff_data = 0; - - for (j = 0; j < ndims1; j++) { - pt1 = ptdata1[i * ndims1 + j]; - pt2 = ptdata2[i * ndims1 + j]; - if (pt1 != pt2) { - diff_data = 1; - break; + for (i = 0; i < npoints1; i++) { + hsize_t pt1, pt2; + + for (j = 0; j < ndims1; j++) { + pt1 = ptdata1[i * ndims1 + j]; + pt2 = ptdata2[i * ndims1 + j]; + if (pt1 != pt2) + nfound_p++; } } - if (diff_data) { - parallel_print("point #%d", i); - print_points(i, ptdata1, ndims1); - print_points(i, ptdata2, ndims1); - parallel_print("\n"); + + if (nfound_p && options->m_verbose) { + parallel_print("Region points\n"); + for (i = 0; i < npoints1; i++) { + hsize_t pt1, pt2; + int diff_data = 0; + + for (j = 0; j < ndims1; j++) { + pt1 = ptdata1[i * ndims1 + j]; + pt2 = ptdata2[i * ndims1 + j]; + if (pt1 != pt2) { + diff_data = 1; + break; + } + } + if (diff_data) { + parallel_print("point #%d", i); + print_points(i, ptdata1, ndims1); + print_points(i, ptdata2, ndims1); + parallel_print("\n"); + } + } } - } - } + HDfree(ptdata2); + } /* else ptdata2 */ #if defined (H5DIFF_DEBUG) - for (i = 0; i < npoints1; i++) { - int j; + for (i = 0; i < npoints1; i++) { + int j; - parallel_print("%sPt%lu: " , i ? "," : "", (unsigned long)i); + parallel_print("%sPt%lu: " , i ? "," : "", (unsigned long)i); - for (j = 0; j < ndims1; j++) - parallel_print("%s%lu", j ? "," : "(", - (unsigned long)(ptdata1[i * ndims1 + j])); + for (j = 0; j < ndims1; j++) + parallel_print("%s%lu", j ? "," : "(", (unsigned long)(ptdata1[i * ndims1 + j])); - parallel_print(")"); - } + parallel_print(")"); + } #endif - HDfree(ptdata1); - HDfree(ptdata2); + HDfree(ptdata1); + } /* else ptdata1 */ } nfound_b = nfound_b / (unsigned) ndims1; nfound_p = nfound_p / (unsigned) ndims1; - return (nfound_p + nfound_b); + + ret_value = nfound_p + nfound_b; + +done: + return ret_value; } /*------------------------------------------------------------------------- * Function: character_compare * - * Purpose: do a byte-by-byte comparison and print in char format - * - * Return: number of differences found + * Purpose: do a byte-by-byte comparison and print in char format * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { + int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) +{ hsize_t nfound = 0; /* differences found */ char temp1_uchar; char temp2_uchar; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); h5diffdebug3("character_compare start %d=%d\n",temp1_uchar,temp2_uchar); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + h5diffdebug3("character_compare start %d=%d\n",temp1_uchar,temp2_uchar); if (temp1_uchar != temp2_uchar) { if (print_data(options)) { @@ -2199,20 +2230,20 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u, /*------------------------------------------------------------------------- * Function: character_compare_opt * - * Purpose: do a byte-by-byte comparison and print in numerical format - * - * Return: number of differences found + * Purpose: do a byte-by-byte comparison and print in numerical format * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, - hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound = 0; /* differences found */ + hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) +{ + hsize_t nfound = 0; /* differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; - double per; - hbool_t both_zero; + double per; + hbool_t both_zero; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -2269,10 +2300,10 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_float * - * Purpose: diff a H5T_NATIVE_FLOAT type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_FLOAT type * + * Return: number of differences found +* *------------------------------------------------------------------------- */ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, @@ -2482,10 +2513,9 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_double * - * Purpose: diff a H5T_NATIVE_DOUBLE type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_DOUBLE type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, @@ -2495,10 +2525,10 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, { hsize_t nfound = 0; /* number of differences found */ - double temp1_double; - double temp2_double; + double temp1_double; + double temp2_double; hsize_t i; - double per; + double per; hbool_t both_zero; hbool_t isnan1 = FALSE; hbool_t isnan2 = FALSE; @@ -2694,10 +2724,9 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_ldouble * - * Purpose: diff a H5T_NATIVE_LDOUBLE type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_LDOUBLE type * + * Return: number of differences found *------------------------------------------------------------------------- */ #if H5_SIZEOF_LONG_DOUBLE !=0 @@ -2716,7 +2745,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, int *ph) { - hsize_t nfound=0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ long double temp1_double; long double temp2_double; hsize_t i; @@ -2914,10 +2943,9 @@ static hsize_t diff_ldouble(unsigned char *mem1, /*------------------------------------------------------------------------- * Function: diff_schar * - * Purpose: diff a H5T_NATIVE_SCHAR type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_SCHAR type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, @@ -2927,10 +2955,10 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, { hsize_t nfound = 0; /* number of differences found */ - char temp1_char; - char temp2_char; + char temp1_char; + char temp2_char; hsize_t i; - double per; + double per; hbool_t both_zero; h5difftrace("diff_schar start\n"); @@ -3042,10 +3070,9 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_uchar * - * Purpose: diff a H5T_NATIVE_UCHAR type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_UCHAR type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, @@ -3053,12 +3080,12 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound = 0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_uchar start\n"); /* -d and !-p */ @@ -3169,10 +3196,9 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_short * - * Purpose: diff a H5T_NATIVE_SHORT type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_SHORT type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, @@ -3181,10 +3207,10 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ - short temp1_short; - short temp2_short; + short temp1_short; + short temp2_short; hsize_t i; - double per; + double per; hbool_t both_zero; h5difftrace("diff_short start\n"); @@ -3296,10 +3322,9 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_ushort * - * Purpose: diff a H5T_NATIVE_USHORT type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_USHORT type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, @@ -3308,12 +3333,12 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, const char *obj2, int *ph) { - hsize_t nfound = 0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ unsigned short temp1_ushort; unsigned short temp2_ushort; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_ushort start\n"); /* -d and !-p */ @@ -3422,13 +3447,12 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, } /*------------------------------------------------------------------------- - * Function: diff_int + * Function: diff_int * - * Purpose: diff a H5T_NATIVE_INT type + * Purpose: diff a H5T_NATIVE_INT type * - * Return: number of differences found - * - *------------------------------------------------------------------------- + * Return: number of differences found + *------------------------------------------------------------------------- */ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, @@ -3436,10 +3460,10 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ - int temp1_int; - int temp2_int; + int temp1_int; + int temp2_int; hsize_t i; - double per; + double per; hbool_t both_zero; h5difftrace("diff_int start\n"); @@ -3551,10 +3575,9 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_uint * - * Purpose: diff a H5T_NATIVE_UINT type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_UINT type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, @@ -3679,10 +3702,9 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_long * - * Purpose: diff a H5T_NATIVE_LONG type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_LONG type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, @@ -3808,10 +3830,9 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_ulong * - * Purpose: diff a H5T_NATIVE_ULONG type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_ULONG type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, @@ -3819,12 +3840,12 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound = 0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ unsigned long temp1_ulong; unsigned long temp2_ulong; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_ulong start\n"); @@ -3939,10 +3960,9 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_llong * - * Purpose: diff a H5T_NATIVE_LLONG type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_LLONG type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, @@ -3950,12 +3970,12 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound = 0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ long long temp1_llong; long long temp2_llong; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_llong start\n"); /* -d and !-p */ @@ -4067,10 +4087,9 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_ullong * - * Purpose: diff a H5T_NATIVE_ULLONG type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_ULLONG type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, @@ -4078,13 +4097,13 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound = 0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ unsigned long long temp1_ullong; unsigned long long temp2_ullong; - hsize_t i; - float f1, f2; - double per; - hbool_t both_zero; + hsize_t i; + float f1, f2; + double per; + hbool_t both_zero; h5difftrace("diff_ullong start\n"); /* -d and !-p */ @@ -4201,64 +4220,54 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, * Function: ull2float * * Purpose: convert unsigned long long to float - * - * Programmer: pvn - * Mar 22, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ static -int ull2float(unsigned long long ull_value, float *f_value) { - hid_t dxpl_id; +int ull2float(unsigned long long ull_value, float *f_value) +{ + int ret_value = SUCCEED; + hid_t dxpl_id = -1; unsigned char *buf = NULL; - size_t src_size; - size_t dst_size; + size_t src_size; + size_t dst_size; h5difftrace("ull2float start\n"); if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed"); src_size = H5Tget_size(H5T_NATIVE_ULLONG); dst_size = H5Tget_size(H5T_NATIVE_FLOAT); - buf = (unsigned char*) HDcalloc((size_t )1, MAX(src_size, dst_size)); - if (!buf) - goto error; + if((buf = (unsigned char*) HDcalloc((size_t )1, MAX(src_size, dst_size))) == NULL) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for dims"); HDmemcpy(buf, &ull_value, src_size); /* do conversion */ if (H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, (size_t) 1, buf, NULL, dxpl_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tconvert failed"); HDmemcpy(f_value, buf, dst_size); if (buf) - HDfree(buf);h5difftrace("ull2float finish\n"); + HDfree(buf); - return 0; - -error: - H5E_BEGIN_TRY - { +done: + H5E_BEGIN_TRY { H5Pclose(dxpl_id); - }H5E_END_TRY; + } H5E_END_TRY; + if (buf) - HDfree(buf);h5difftrace("ull2float errored\n"); + HDfree(buf); - return -1; + h5difftrace("ull2float finish\n"); + + return ret_value; } /*------------------------------------------------------------------------- * Function: equal_double * - * Purpose: use a absolute error formula to deal with floating point - * uncertainty - * - * Modifications: - * 8/1/2007. handle NaNs - * + * Purpose: use a absolute error formula to deal with floating point uncertainty *------------------------------------------------------------------------- */ static hbool_t equal_double(double value, double expected, diff_opt_t *options) { @@ -4275,26 +4284,24 @@ static hbool_t equal_double(double value, double expected, diff_opt_t *options) * we consider NaN == NaN to be true *------------------------------------------------------------------------- */ - if (isnan1 && isnan2) { + if (isnan1 && isnan2) return TRUE; - } /*------------------------------------------------------------------------- * one is a NaN, do not compare but assume difference *------------------------------------------------------------------------- */ - if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) return FALSE; - } } if (value == expected) return TRUE; - if (options->use_system_epsilon) { - if ( ABS( (value-expected) ) < DBL_EPSILON) + if (options->use_system_epsilon) + if (ABS((value-expected)) < DBL_EPSILON) return TRUE; - } + h5difftrace("equal_double finish\n"); return FALSE; @@ -4303,9 +4310,7 @@ static hbool_t equal_double(double value, double expected, diff_opt_t *options) /*------------------------------------------------------------------------- * Function: equal_ldouble * - * Purpose: use a absolute error formula to deal with floating point - * uncertainty - * + * Purpose: use a absolute error formula to deal with floating point uncertainty *------------------------------------------------------------------------- */ @@ -4326,26 +4331,24 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio * we consider NaN == NaN to be true *------------------------------------------------------------------------- */ - if (isnan1 && isnan2) { + if (isnan1 && isnan2) return TRUE; - } /*------------------------------------------------------------------------- * one is a NaN, do not compare but assume difference *------------------------------------------------------------------------- */ - if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) return FALSE; - } } if (value == expected) return TRUE; - if (options->use_system_epsilon) { + if (options->use_system_epsilon) if (ABS((value-expected)) < DBL_EPSILON) return TRUE; - } + h5difftrace("equal_ldouble finish\n"); return FALSE; @@ -4356,12 +4359,7 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio /*------------------------------------------------------------------------- * Function: equal_float * - * Purpose: use a absolute error formula to deal with floating point - * uncertainty - * - * Modifications: - * 8/1/2007. handle NaNs - * + * Purpose: use a absolute error formula to deal with floating point uncertainty *------------------------------------------------------------------------- */ static hbool_t equal_float(float value, float expected, diff_opt_t *options) { @@ -4378,46 +4376,35 @@ static hbool_t equal_float(float value, float expected, diff_opt_t *options) { * we consider NaN == NaN to be true *------------------------------------------------------------------------- */ - if (isnan1 && isnan2) { + if (isnan1 && isnan2) return TRUE; - } /*------------------------------------------------------------------------- * one is a NaN, do not compare but assume difference *------------------------------------------------------------------------- */ - if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) return FALSE; - } } if (value == expected) return TRUE; - if (options->use_system_epsilon) { + if (options->use_system_epsilon) if ( ABS( (value-expected) ) < FLT_EPSILON) return TRUE; - } + h5difftrace("equal_float finish\n"); return FALSE; - } /*------------------------------------------------------------------------- * Function: my_isnan * - * Purpose: Determines whether VAL points to NaN. - * - * Return: TRUE or FALSE - * - * Programmer: Robb Matzke - * Monday, July 6, 1998 - * - * Modifications: - * Pedro Vicente, 12 October 2007. - * Add a string detection type for WIN32 + * Purpose: Determines whether VAL points to NaN. * + * Return: TRUE or FALSE *------------------------------------------------------------------------- */ static hbool_t my_isnan(dtype_t type, void *val) { @@ -4445,9 +4432,8 @@ static hbool_t my_isnan(dtype_t type, void *val) { retval = (x!=x); } #endif - else { + else return FALSE; - } /* * Sometimes NaN==NaN (e.g., DEC Alpha) so we try to print it and see if @@ -4474,9 +4460,8 @@ static hbool_t my_isnan(dtype_t type, void *val) { HDsnprintf(s, sizeof(s), "%Lg", x); } #endif - else { + else return FALSE; - } if (HDstrstr(s, "NaN") || HDstrstr(s, "NAN") || @@ -4501,24 +4486,25 @@ static hbool_t my_isnan(dtype_t type, void *val) { /*------------------------------------------------------------------------- * Function: print_data * - * Purpose: print data only in report or verbose modes, and do not print in quiet mode + * Purpose: print data only in report or verbose modes, and do not print in quiet mode *------------------------------------------------------------------------- */ static -int print_data(diff_opt_t *options) { +int print_data(diff_opt_t *options) +{ return ((options->m_report || options->m_verbose) && !options->m_quiet) ? 1 : 0; } /*------------------------------------------------------------------------- * Function: print_header * - * Purpose: print header for difference - * + * Purpose: print header for difference *------------------------------------------------------------------------- */ static void print_header(int pp, /* print percentage */ - int rank, hsize_t *dims, const char *obj1, const char *obj2) { + int rank, hsize_t *dims, const char *obj1, const char *obj2) +{ /* print header */ parallel_print("%-16s", "size:"); print_dimensions(rank, dims); @@ -4528,8 +4514,7 @@ void print_header(int pp, /* print percentage */ if (pp) { parallel_print("%-15s %-15s %-15s %-15s %-15s\n", "position", - (obj1 != NULL) ? obj1 : " ", (obj2 != NULL) ? obj2 : " ", "difference", - "relative"); + (obj1 != NULL) ? obj1 : " ", (obj2 != NULL) ? obj2 : " ", "difference", "relative"); parallel_print( "------------------------------------------------------------------------\n"); } @@ -4544,15 +4529,15 @@ void print_header(int pp, /* print percentage */ /*------------------------------------------------------------------------- * Function: print_pos * - * Purpose: print in matrix notation, converting from an array index position - * + * Purpose: print in matrix notation, converting from an array index position *------------------------------------------------------------------------- */ static void print_pos(int *ph, /* print header */ int pp, /* print percentage */ hsize_t curr_pos, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, - const char *obj1, const char *obj2) { + const char *obj1, const char *obj2) +{ int i; /* print header */ @@ -4576,23 +4561,22 @@ void print_pos(int *ph, /* print header */ } parallel_print("]"); } - else { + else parallel_print(" "); - } } /*------------------------------------------------------------------------- * Function: print_char_pos * - * Purpose: print character position in string - * + * Purpose: print character position in string *------------------------------------------------------------------------- */ static void print_char_pos(int *ph, /* print header */ int pp, /* print percentage */ hsize_t curr_pos, size_t u, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, - const char *obj1, const char *obj2) { + const char *obj1, const char *obj2) +{ int i; /* print header */ @@ -4616,20 +4600,20 @@ void print_char_pos(int *ph, /* print header */ } } - else { + else parallel_print("%zu", u); - } + parallel_print("]"); } /*------------------------------------------------------------------------- - * Function: h5diff_print_char. Adapted from h5tools_print_char - * - * Purpose: Print a char + * Function: h5diff_print_char. Adapted from h5tools_print_char * + * Purpose: Print a char *------------------------------------------------------------------------- */ -static void h5diff_print_char(char ch) { +static void h5diff_print_char(char ch) +{ switch (ch) { case '"': parallel_print("\\\""); @@ -4662,12 +4646,13 @@ static void h5diff_print_char(char ch) { } /*------------------------------------------------------------------------- - * XCAO, 11/10/2010 * added to improve performance for compound datasets * set up compound datatype structures. + *------------------------------------------------------------------------- */ -static void get_member_types(hid_t tid, mcomp_t *members) { - int tclass; +static void get_member_types(hid_t tid, mcomp_t *members) +{ + int tclass; unsigned u; if (tid <= 0 || !members) @@ -4682,8 +4667,7 @@ static void get_member_types(hid_t tid, mcomp_t *members) { else if (tclass == H5T_COMPOUND) { int nmembs; - nmembs = H5Tget_nmembers(tid); - if (nmembs <= 0) + if ((nmembs = H5Tget_nmembers(tid)) <= 0) return; members->n = (unsigned) nmembs; @@ -4701,15 +4685,15 @@ static void get_member_types(hid_t tid, mcomp_t *members) { } return; - } /*------------------------------------------------------------------------- - * XCAO, 11/10/2010 * added to improve performance for compound datasets * clean and close compound members. + *------------------------------------------------------------------------- */ -static void close_member_types(mcomp_t *members) { +static void close_member_types(mcomp_t *members) +{ unsigned u; if (!members || members->n <= 0 || !members->ids) diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 9bebcbe..f381393 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -136,32 +136,32 @@ static void table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *ta * * Parameter: * table_out [OUT] : return the list - * - * Programmer: Jonathan Kim - * - * Date: March 15, 2011 *------------------------------------------------------------------------*/ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t ** table_out, diff_opt_t *options) { - H5O_info_t oinfo1, oinfo2; /* Object info */ - hid_t attr1_id=-1; /* attr ID */ - hid_t attr2_id=-1; /* attr ID */ - size_t curr1 = 0; - size_t curr2 = 0; - unsigned infile[2]; - char name1[ATTR_NAME_MAX]; - char name2[ATTR_NAME_MAX]; - int cmp; - unsigned i; + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + H5O_info_t oinfo1, oinfo2; /* Object info */ + hid_t attr1_id = -1; /* attr ID */ + hid_t attr2_id = -1; /* attr ID */ + size_t curr1 = 0; + size_t curr2 = 0; + unsigned infile[2]; + char name1[ATTR_NAME_MAX]; + char name2[ATTR_NAME_MAX]; + int cmp; + unsigned i; table_attrs_t *table_lp = NULL; h5difftrace("build_match_list_attrs start\n"); + if(H5Oget_info(loc1_id, &oinfo1) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info first object failed"); if(H5Oget_info(loc2_id, &oinfo2) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info second object failed"); - table_attrs_init( &table_lp ); + table_attrs_init(&table_lp); + if (table_lp == NULL) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Table allocation failed"); h5diffdebug3("build_match_list_attrs: %ld - %ld\n", curr1 < oinfo1.num_attrs, curr2 < oinfo2.num_attrs); @@ -172,18 +172,18 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t /*------------------ * open attribute1 */ if((attr1_id = H5Aopen_by_idx(loc1_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr1, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx first attribute failed"); /* get name */ if(H5Aget_name(attr1_id, (size_t)ATTR_NAME_MAX, name1) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name first attribute failed"); /*------------------ * open attribute2 */ if((attr2_id = H5Aopen_by_idx(loc2_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr2, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx second attribute failed"); /* get name */ if(H5Aget_name(attr2_id, (size_t)ATTR_NAME_MAX, name2) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name second attribute failed"); /* criteria is string compare */ cmp = HDstrcmp(name1, name2); @@ -224,10 +224,10 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t /*------------------ * open attribute1 */ if((attr1_id = H5Aopen_by_idx(loc1_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr1, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx first attribute failed"); /* get name */ if(H5Aget_name(attr1_id, (size_t)ATTR_NAME_MAX, name1) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name first attribute failed"); h5diffdebug2("build_match_list_attrs #1 name - %s\n", name1); table_attr_mark_exist(infile, name1, table_lp); @@ -246,10 +246,10 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t /*------------------ * open attribute2 */ if((attr2_id = H5Aopen_by_idx(loc2_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr2, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx second attribute failed"); /* get name */ if(H5Aget_name(attr2_id, (size_t)ATTR_NAME_MAX, name2) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name second attribute failed"); h5diffdebug2("build_match_list_attrs #2 name - %s\n", name2); table_attr_mark_exist(infile, name2, table_lp); @@ -258,6 +258,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t /* close for next turn */ H5Aclose(attr2_id); + attr2_id = -1; } /*------------------------------------------------------ @@ -280,39 +281,30 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t table_lp->nattrs - table_lp->nattrs_only1 - table_lp->nattrs_only2, table_lp->nattrs_only1, table_lp->nattrs_only2); +done: *table_out = table_lp; - h5difftrace("build_match_list_attrs end\n"); - return 0; - -error: - if (0 < attr1_id) + /* disable error reporting */ + H5E_BEGIN_TRY { H5Aclose(attr1_id); - if (0 < attr2_id) H5Aclose(attr2_id); + } H5E_END_TRY; + + h5difftrace("build_match_list_attrs end\n"); - h5difftrace("build_match_list_attrs end with error\n"); - return -1; + return ret_value; } /*------------------------------------------------------------------------- * Function: diff_attr * - * Purpose: compare attributes located in LOC1_ID and LOC2_ID, which are - * obtained either from - * loc_id = H5Gopen2(fid, name, H5P_DEFAULT); - * loc_id = H5Dopen2(fid, name); - * loc_id = H5Topen2(fid, name, H5P_DEFAULT); - * - * Return: number of differences found - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November, 03, 2003 - * - * Modifications: - * March, 02, 2007: return the number of differences found + * Purpose: compare attributes located in LOC1_ID and LOC2_ID, which are + * obtained either from + * loc_id = H5Gopen2(fid, name, H5P_DEFAULT); + * loc_id = H5Dopen2(fid, name); + * loc_id = H5Topen2(fid, name, H5P_DEFAULT); * + * Return: number of differences found *------------------------------------------------------------------------- */ @@ -322,41 +314,45 @@ hsize_t diff_attr(hid_t loc1_id, const char *path2, diff_opt_t *options) { - hid_t attr1_id=-1; /* attr ID */ - hid_t attr2_id=-1; /* attr ID */ - hid_t space1_id=-1; /* space ID */ - hid_t space2_id=-1; /* space ID */ - hid_t ftype1_id=-1; /* file data type ID */ - hid_t ftype2_id=-1; /* file data type ID */ - int vstrtype1=0; /* ftype1 is a variable string */ - int vstrtype2=0; /* ftype2 is a variable string */ - hid_t mtype1_id=-1; /* memory data type ID */ - hid_t mtype2_id=-1; /* memory data type ID */ - size_t msize1; /* memory size of memory type */ - size_t msize2; /* memory size of memory type */ - void *buf1=NULL; /* data buffer */ - void *buf2=NULL; /* data buffer */ - hbool_t buf1hasdata=FALSE; /* buffer has data */ - hbool_t buf2hasdata=FALSE; /* buffer has data */ - hsize_t nelmts1; /* number of elements in dataset */ - int rank1; /* rank of dataset */ - int rank2; /* rank of dataset */ - hsize_t dims1[H5S_MAX_RANK];/* dimensions of dataset */ - hsize_t dims2[H5S_MAX_RANK];/* dimensions of dataset */ - char *name1; - char *name2; + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t attr1_id = -1; /* attr ID */ + hid_t attr2_id = -1; /* attr ID */ + hid_t space1_id = -1; /* space ID */ + hid_t space2_id = -1; /* space ID */ + hid_t ftype1_id = -1; /* file data type ID */ + hid_t ftype2_id = -1; /* file data type ID */ + int vstrtype1 = 0; /* ftype1 is a variable string */ + int vstrtype2 = 0; /* ftype2 is a variable string */ + hid_t mtype1_id = -1; /* memory data type ID */ + hid_t mtype2_id = -1; /* memory data type ID */ + size_t msize1; /* memory size of memory type */ + size_t msize2; /* memory size of memory type */ + void *buf1 = NULL; /* data buffer */ + void *buf2 = NULL; /* data buffer */ + hbool_t buf1hasdata = FALSE; /* buffer has data */ + hbool_t buf2hasdata = FALSE; /* buffer has data */ + hsize_t nelmts1; /* number of elements in dataset */ + int rank1; /* rank of dataset */ + int rank2; /* rank of dataset */ + hsize_t dims1[H5S_MAX_RANK]; /* dimensions of dataset */ + hsize_t dims2[H5S_MAX_RANK]; /* dimensions of dataset */ + char *name1 = NULL; + char *name2 = NULL; char np1[512]; char np2[512]; - unsigned u; /* Local index variable */ + unsigned u; /* Local index variable */ hsize_t nfound = 0; hsize_t nfound_total = 0; int j; + /* Initialize error status */ + options->err_stat = 1; + table_attrs_t *match_list_attrs = NULL; h5difftrace("diff_attr start\n"); if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, options) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "build_match_list_attrs failed"); /* if detect any unique extra attr */ if(match_list_attrs->nattrs_only1 || match_list_attrs->nattrs_only2) { @@ -373,21 +369,22 @@ hsize_t diff_attr(hid_t loc1_id, /*-------------- * attribute 1 */ if((attr1_id = H5Aopen(loc1_id, name1, H5P_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen first attribute failed"); /*-------------- * attribute 2 */ if((attr2_id = H5Aopen(loc2_id, name2, H5P_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen second attribute failed"); h5difftrace("diff_attr got attributes\n"); /* get the datatypes */ if((ftype1_id = H5Aget_type(attr1_id)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); vstrtype1 = H5Tis_variable_str(ftype1_id); if((ftype2_id = H5Aget_type(attr2_id)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); vstrtype2 = H5Tis_variable_str(ftype2_id); + /* no compare if either one but not both are variable string type */ if (vstrtype1 != vstrtype2) { if((options->m_verbose || options->m_list_not_cmp)) @@ -395,37 +392,37 @@ hsize_t diff_attr(hid_t loc1_id, path1, name1, path2, name2); options->not_cmp = 1; if (H5Tclose(ftype1_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed"); if (H5Tclose(ftype2_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose second attribute ftype failed"); if (H5Aclose(attr1_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose first attribute failed"); if (H5Aclose(attr2_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose second attribute failed"); continue; } if((mtype1_id = H5Tget_native_type(ftype1_id, H5T_DIR_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type first attribute ftype failed"); if((mtype2_id = H5Tget_native_type(ftype2_id, H5T_DIR_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type second attribute ftype failed"); if((msize1 = H5Tget_size(mtype1_id)) == 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size first attribute mtype failed"); if((msize2 = H5Tget_size(mtype2_id)) == 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size second attribute mtype failed"); /* get the dataspace */ if((space1_id = H5Aget_space(attr1_id)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_space first attribute failed"); if((space2_id = H5Aget_space(attr2_id)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_space second attribute failed"); /* get dimensions */ if((rank1 = H5Sget_simple_extent_dims(space1_id, dims1, NULL)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims first attribute failed"); if((rank2 = H5Sget_simple_extent_dims(space2_id, dims2, NULL)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims second attribute failed"); /*---------------------------------------------------------------------- * check for comparable TYPE and SPACE @@ -437,21 +434,21 @@ hsize_t diff_attr(hid_t loc1_id, if(diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, dims2, dims1, dims2, name1, name2, options, 0) != 1) { if(H5Tclose(ftype1_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed"); if(H5Tclose(ftype2_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose second attribute ftype failed"); if(H5Sclose(space1_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose first attribute failed"); if(H5Sclose(space2_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose second attribute failed"); if(H5Aclose(attr1_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose first attribute failed"); if(H5Aclose(attr2_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose second attribute failed"); if(H5Tclose(mtype1_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose first attribute mtype failed"); if(H5Tclose(mtype2_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose second attribute mtype failed"); continue; } @@ -462,7 +459,7 @@ hsize_t diff_attr(hid_t loc1_id, */ if(FAIL == match_up_memsize(ftype1_id, ftype2_id, &mtype1_id, &mtype2_id, &msize1, &msize2)) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "match_up_memsize failed"); /*--------------------------------------------------------------------- * read @@ -476,18 +473,18 @@ hsize_t diff_attr(hid_t loc1_id, buf2 = (void *)HDcalloc((size_t)(nelmts1), msize2); if(buf1 == NULL || buf2 == NULL) { parallel_print("cannot read into memory\n"); - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "buffer allocation failed"); } if(H5Aread(attr1_id, mtype1_id, buf1) < 0) { parallel_print("Failed reading attribute1 %s/%s\n", path1, name1); - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); } else buf1hasdata = TRUE; if(H5Aread(attr2_id, mtype2_id, buf2) < 0) { parallel_print("Failed reading attribute2 %s/%s\n", path2, name2); - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); } else buf2hasdata = TRUE; @@ -545,32 +542,29 @@ hsize_t diff_attr(hid_t loc1_id, buf2 = NULL; if(H5Tclose(ftype1_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); if(H5Tclose(ftype2_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); if(H5Sclose(space1_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); if(H5Sclose(space2_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); if(H5Aclose(attr1_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); if(H5Aclose(attr2_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); if(H5Tclose(mtype1_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose first attribute mtype failed"); if(H5Tclose(mtype2_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose second attribute mtype failed"); nfound_total += nfound; } } /* u */ - table_attrs_free(match_list_attrs); - - h5difftrace("diff_attr end\n"); - return nfound_total; + options->err_stat = 0; -error: +done: H5E_BEGIN_TRY { if(buf1) { if(buf1hasdata && TRUE == h5tools_detect_vlen(mtype1_id)) @@ -595,8 +589,7 @@ error: H5Aclose(attr2_id); } H5E_END_TRY; - options->err_stat = 1; - h5difftrace("diff_attr end with error\n"); + h5difftrace("diff_attr end\n"); return nfound_total; } diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 998a8ca..16239f5 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* Copyright by The HDF Group. * -* Copyright by the Board of Trustees of the University of Illinois. * -* All rights reserved. * -* * -* This file is part of HDF5. The full HDF5 copyright notice, including * -* terms governing use, modification, and redistribution, is contained in * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5private.h" #include "h5tools.h" @@ -19,25 +19,21 @@ /*------------------------------------------------------------------------- -* Function: diff_dataset -* -* Purpose: check for comparable datasets and read into a compatible -* memory type -* -* Return: Number of differences found -* -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu -* -* Date: May 9, 2003 -* -*------------------------------------------------------------------------- -*/ -hsize_t diff_dataset( hid_t file1_id, - hid_t file2_id, - const char *obj1_name, - const char *obj2_name, - diff_opt_t *options) + * Function: diff_dataset + * + * Purpose: check for comparable datasets and read into a compatible + * memory type + * + * Return: Number of differences found + *------------------------------------------------------------------------- + */ +hsize_t diff_dataset(hid_t file1_id, + hid_t file2_id, + const char *obj1_name, + const char *obj2_name, + diff_opt_t *options) { + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hid_t did1 = -1; hid_t did2 = -1; hid_t dcpl1 = -1; @@ -45,52 +41,40 @@ hsize_t diff_dataset( hid_t file1_id, hsize_t nfound = 0; h5difftrace("diff_dataset start\n"); + options->err_stat = 1; /*------------------------------------------------------------------------- - * open the handles - *------------------------------------------------------------------------- - */ - /* disable error reporting */ - H5E_BEGIN_TRY - { - /* Open the datasets */ - if((did1 = H5Dopen2(file1_id, obj1_name, H5P_DEFAULT)) < 0) { - parallel_print("Cannot open dataset <%s>\n", obj1_name); - goto error; - } - if((did2 = H5Dopen2(file2_id, obj2_name, H5P_DEFAULT)) < 0) { - parallel_print("Cannot open dataset <%s>\n", obj2_name); - goto error; - } - /* enable error reporting */ - } H5E_END_TRY; - + * open the handles + *------------------------------------------------------------------------- + */ + /* Open the datasets */ + if((did1 = H5Dopen2(file1_id, obj1_name, H5P_DEFAULT)) < 0) { + parallel_print("Cannot open dataset <%s>\n", obj1_name); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 first dataset failed"); + } + if((did2 = H5Dopen2(file2_id, obj2_name, H5P_DEFAULT)) < 0) { + parallel_print("Cannot open dataset <%s>\n", obj2_name); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 second dataset failed"); + } if((dcpl1 = H5Dget_create_plist(did1)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist first dataset failed"); if((dcpl2 = H5Dget_create_plist(did2)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist second dataset failed"); /*------------------------------------------------------------------------- - * check if the dataset creation property list has filters that - * are not registered in the current configuration - * 1) the external filters GZIP and SZIP might not be available - * 2) the internal filters might be turned off - *------------------------------------------------------------------------- - */ + * check if the dataset creation property list has filters that + * are not registered in the current configuration + * 1) the external filters GZIP and SZIP might not be available + * 2) the internal filters might be turned off + *------------------------------------------------------------------------- + */ if ((h5tools_canreadf((options->m_verbose ? obj1_name : NULL), dcpl1) == 1) && - (h5tools_canreadf((options->m_verbose ? obj2_name : NULL), dcpl2) == 1)) + (h5tools_canreadf((options->m_verbose ? obj2_name : NULL), dcpl2) == 1)) nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, options); else - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_canreadf failed"); - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - goto done; - -error: - options->err_stat = 1; + options->err_stat = 0; done: /* disable error reporting */ @@ -107,77 +91,70 @@ done: } /*------------------------------------------------------------------------- -* Function: diff_datasetid -* -* Purpose: check for comparable datasets and read into a compatible -* memory type -* -* Return: Number of differences found -* -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu -* -* Date: May 9, 2003 -* -* Modifications: -* -* -* October 2006: Read by hyperslabs for big datasets. -* -* A threshold of H5TOOLS_MALLOCSIZE (128 MB) is the limit upon which I/O hyperslab is done -* i.e., if the memory needed to read a dataset is greater than this limit, -* then hyperslab I/O is done instead of one operation I/O -* For each dataset, the memory needed is calculated according to -* -* memory needed = number of elements * size of each element -* -* if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations -* are done -* -* H5Dread( input_dataset1 ) -* H5Dread( input_dataset2 ) -* -* with all elements in the datasets selected. If the memory needed is greater than -* H5TOOLS_MALLOCSIZE, then the following operations are done instead: -* -* a strip mine is defined for each dimension k (a strip mine is defined as a -* hyperslab whose size is memory manageable) according to the formula -* -* (1) strip_mine_size[k ] = MIN(dimension[k ], H5TOOLS_BUFSIZE / size of memory type) -* -* where H5TOOLS_BUFSIZE is a constant currently defined as 1MB. This formula assures -* that for small datasets (small relative to the H5TOOLS_BUFSIZE constant), the strip -* mine size k is simply defined as its dimension k, but for larger datasets the -* hyperslab size is still memory manageable. -* a cycle is done until the number of elements in the dataset is reached. In each -* iteration, two parameters are defined for the function H5Sselect_hyperslab, -* the start and size of each hyperslab, according to -* -* (2) hyperslab_size [k] = MIN(dimension[k] - hyperslab_offset[k], strip_mine_size [k]) -* -* where hyperslab_offset [k] is initially set to zero, and later incremented in -* hyperslab_size[k] offsets. The reason for the operation -* -* dimension[k] - hyperslab_offset[k] -* -* in (2) is that, when using the strip mine size, it assures that the "remaining" part -* of the dataset that does not fill an entire strip mine is processed. -* -*------------------------------------------------------------------------- -*/ -hsize_t diff_datasetid( hid_t did1, - hid_t did2, - const char *obj1_name, - const char *obj2_name, - diff_opt_t *options) + * Function: diff_datasetid + * + * Purpose: check for comparable datasets and read into a compatible + * memory type + * + * Return: Number of differences found + * + * October 2006: Read by hyperslabs for big datasets. + * + * A threshold of H5TOOLS_MALLOCSIZE (128 MB) is the limit upon which I/O hyperslab is done + * i.e., if the memory needed to read a dataset is greater than this limit, + * then hyperslab I/O is done instead of one operation I/O + * For each dataset, the memory needed is calculated according to + * + * memory needed = number of elements * size of each element + * + * if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations + * are done + * + * H5Dread( input_dataset1 ) + * H5Dread( input_dataset2 ) + * + * with all elements in the datasets selected. If the memory needed is greater than + * H5TOOLS_MALLOCSIZE, then the following operations are done instead: + * + * a strip mine is defined for each dimension k (a strip mine is defined as a + * hyperslab whose size is memory manageable) according to the formula + * + * (1) strip_mine_size[k ] = MIN(dimension[k ], H5TOOLS_BUFSIZE / size of memory type) + * + * where H5TOOLS_BUFSIZE is a constant currently defined as 1MB. This formula assures + * that for small datasets (small relative to the H5TOOLS_BUFSIZE constant), the strip + * mine size k is simply defined as its dimension k, but for larger datasets the + * hyperslab size is still memory manageable. + * a cycle is done until the number of elements in the dataset is reached. In each + * iteration, two parameters are defined for the function H5Sselect_hyperslab, + * the start and size of each hyperslab, according to + * + * (2) hyperslab_size [k] = MIN(dimension[k] - hyperslab_offset[k], strip_mine_size [k]) + * + * where hyperslab_offset [k] is initially set to zero, and later incremented in + * hyperslab_size[k] offsets. The reason for the operation + * + * dimension[k] - hyperslab_offset[k] + * + * in (2) is that, when using the strip mine size, it assures that the "remaining" part + * of the dataset that does not fill an entire strip mine is processed. + * + *------------------------------------------------------------------------- + */ +hsize_t diff_datasetid(hid_t did1, + hid_t did2, + const char *obj1_name, + const char *obj2_name, + diff_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t sid1=-1; - hid_t sid2=-1; - hid_t f_tid1=-1; - hid_t f_tid2=-1; - hid_t dam_tid=-1; /* m_tid for diff_array function */ - hid_t m_tid1=-1; - hid_t m_tid2=-1; + int ret_value = 0; /* no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t sid1 = -1; + hid_t sid2 = -1; + hid_t f_tid1 = -1; + hid_t f_tid2 = -1; + hid_t dam_tid = -1; /* m_tid for diff_array function */ + hid_t m_tid1 = -1; + hid_t m_tid2 = -1; hid_t dcpl1 = -1; hid_t dcpl2 = -1; H5D_layout_t stl1 = -1; @@ -197,20 +174,20 @@ hsize_t diff_datasetid( hid_t did1, hsize_t dims2[H5S_MAX_RANK]; hsize_t maxdim1[H5S_MAX_RANK]; hsize_t maxdim2[H5S_MAX_RANK]; - const char *name1=NULL; /* relative names */ - const char *name2=NULL; + const char *name1 = NULL; /* relative names */ + const char *name2 = NULL; hsize_t storage_size1; hsize_t storage_size2; - hsize_t nfound=0; /* number of differences found */ - int can_compare=1; /* do diff or not */ - void *buf1=NULL; - void *buf2=NULL; - void *sm_buf1=NULL; - void *sm_buf2=NULL; - hid_t sm_space; /*stripmine data space */ - size_t need; /* bytes needed for malloc */ + hsize_t nfound = 0; /* number of differences found */ + int can_compare = 1; /* do diff or not */ + void *buf1 = NULL; + void *buf2 = NULL; + void *sm_buf1 = NULL; + void *sm_buf2 = NULL; + hid_t sm_space; /*stripmine data space */ + size_t need; /* bytes needed for malloc */ int i; - unsigned int vl_data = 0; /*contains VL datatypes */ + unsigned int vl_data = 0; /*contains VL datatypes */ options->err_stat = 1; h5difftrace("diff_datasetid start\n"); @@ -240,9 +217,9 @@ hsize_t diff_datasetid( hid_t did1, h5diffdebug3("rank: %ld - %ld\n", rank1, rank2); /*------------------------------------------------------------------------- - * get the file data type - *------------------------------------------------------------------------- - */ + * get the file data type + *------------------------------------------------------------------------- + */ /* Get the data type */ if((f_tid1 = H5Dget_type(did1)) < 0) @@ -253,9 +230,9 @@ hsize_t diff_datasetid( hid_t did1, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed"); /*------------------------------------------------------------------------- - * get the storage layout type - *------------------------------------------------------------------------- - */ + * get the storage layout type + *------------------------------------------------------------------------- + */ if((dcpl1 = H5Dget_create_plist(did1)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); if((dcpl2 = H5Dget_create_plist(did2)) < 0) @@ -267,9 +244,9 @@ hsize_t diff_datasetid( hid_t did1, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); /*------------------------------------------------------------------------- - * check for empty datasets - *------------------------------------------------------------------------- - */ + * check for empty datasets + *------------------------------------------------------------------------- + */ h5difftrace("check for empty datasets\n"); storage_size1 = H5Dget_storage_size(did1); @@ -290,9 +267,9 @@ hsize_t diff_datasetid( hid_t did1, } /*------------------------------------------------------------------------- - * check for comparable TYPE and SPACE - *------------------------------------------------------------------------- - */ + * check for comparable TYPE and SPACE + *------------------------------------------------------------------------- + */ if (diff_can_type(f_tid1, f_tid2, rank1, rank2, dims1, dims2, maxdim1, maxdim2, obj1_name, obj2_name, @@ -300,9 +277,9 @@ hsize_t diff_datasetid( hid_t did1, can_compare = 0; /*------------------------------------------------------------------------- - * memory type and sizes - *------------------------------------------------------------------------- - */ + * memory type and sizes + *------------------------------------------------------------------------- + */ h5difftrace("check for memory type and sizes\n"); if((m_tid1 = H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); @@ -315,9 +292,9 @@ hsize_t diff_datasetid( hid_t did1, h5diffdebug3("type size: %ld - %ld\n", m_size1, m_size2); /*------------------------------------------------------------------------- - * check for different signed/unsigned types - *------------------------------------------------------------------------- - */ + * check for different signed/unsigned types + *------------------------------------------------------------------------- + */ if(can_compare) { h5difftrace("can_compare for sign\n"); sign1 = H5Tget_sign(m_tid1); @@ -335,14 +312,15 @@ hsize_t diff_datasetid( hid_t did1, } /* Check if type is either VLEN-data or VLEN-string to reclaim any - * VLEN memory buffer later */ + * VLEN memory buffer later + */ if(TRUE == h5tools_detect_vlen(m_tid1)) vl_data = TRUE; /*------------------------------------------------------------------------ - * only attempt to compare if possible - *------------------------------------------------------------------------- - */ + * only attempt to compare if possible + *------------------------------------------------------------------------- + */ if(can_compare) { /* it is possible to compare */ H5T_class_t tclass = H5Tget_class(f_tid1); h5difftrace("can_compare attempt\n"); @@ -363,9 +341,9 @@ hsize_t diff_datasetid( hid_t did1, if(tclass != H5T_ARRAY) { /*----------------------------------------------------------------- - * "upgrade" the smaller memory size - *------------------------------------------------------------------ - */ + * "upgrade" the smaller memory size + *------------------------------------------------------------------ + */ h5difftrace("upgrade the smaller memory size?\n"); if (FAIL == match_up_memsize (f_tid1, f_tid2, &m_tid1, &m_tid2, @@ -405,9 +383,9 @@ hsize_t diff_datasetid( hid_t did1, /*---------------------------------------------------------------- - * read/compare - *----------------------------------------------------------------- - */ + * read/compare + *----------------------------------------------------------------- + */ if(need < H5TOOLS_MALLOCSIZE) { buf1 = HDmalloc(need); buf2 = HDmalloc(need); @@ -605,51 +583,46 @@ done: } /*------------------------------------------------------------------------- -* Function: diff_can_type -* -* Purpose: check for comparable TYPE and SPACE -* -* Return: -* 1, can compare -* 0, cannot compare -* -1, error -* -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu -* -* Date: November 3, 2003 -* -*------------------------------------------------------------------------- -*/ - -int diff_can_type( hid_t f_tid1, /* file data type */ - hid_t f_tid2, /* file data type */ - int rank1, - int rank2, - hsize_t *dims1, - hsize_t *dims2, - hsize_t *maxdim1, - hsize_t *maxdim2, - const char *obj1_name, - const char *obj2_name, - diff_opt_t *options, - int is_compound) + * Function: diff_can_type + * + * Purpose: check for comparable TYPE and SPACE + * + * Return: + * 1, can compare + * 0, cannot compare + * -1, error + *------------------------------------------------------------------------- + */ + +int diff_can_type(hid_t f_tid1, /* file data type */ + hid_t f_tid2, /* file data type */ + int rank1, + int rank2, + hsize_t *dims1, + hsize_t *dims2, + hsize_t *maxdim1, + hsize_t *maxdim2, + const char *obj1_name, + const char *obj2_name, + diff_opt_t *options, + int is_compound) { + int ret_value = 0; /* can_compare value, no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ H5T_class_t tclass1; H5T_class_t tclass2; int maxdim_diff = 0; /* maximum dimensions are different */ int dim_diff = 0; /* current dimensions are different */ int i; - int can_compare = 1; /* return value */ h5difftrace("diff_can_type start\n"); /*------------------------------------------------------------------------- - * check for the same class - *------------------------------------------------------------------------- - */ + * check for the same class + *------------------------------------------------------------------------- + */ if((tclass1 = H5Tget_class(f_tid1)) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_class first object failed"); if((tclass2 = H5Tget_class(f_tid2)) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_class second object failed"); if(tclass1 != tclass2) { if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { @@ -664,24 +637,22 @@ int diff_can_type( hid_t f_tid1, /* file data type */ obj2_name, get_class(tclass2)); } } - can_compare = 0; options->not_cmp = 1; - goto done; + HGOTO_DONE(0); } /*------------------------------------------------------------------------- - * check for non supported classes - *------------------------------------------------------------------------- - */ + * check for non supported classes + *------------------------------------------------------------------------- + */ switch (tclass1) { case H5T_TIME: if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> and <%s> are of class %s\n", obj1_name, obj2_name, get_class(tclass2)); } /* end if */ - can_compare = 0; options->not_cmp = 1; - goto done; + HGOTO_DONE(0); case H5T_INTEGER: case H5T_FLOAT: @@ -701,9 +672,9 @@ int diff_can_type( hid_t f_tid1, /* file data type */ } /* end switch */ /*------------------------------------------------------------------------- - * check for equal file datatype; warning only - *------------------------------------------------------------------------- - */ + * check for equal file datatype; warning only + *------------------------------------------------------------------------- + */ if((H5Tequal(f_tid1, f_tid2) == 0) && (options->m_verbose) && obj1_name && obj2_name) { H5T_class_t cl = H5Tget_class(f_tid1); @@ -719,9 +690,9 @@ int diff_can_type( hid_t f_tid1, /* file data type */ } /*------------------------------------------------------------------------- - * check for the same rank - *------------------------------------------------------------------------- - */ + * check for the same rank + *------------------------------------------------------------------------- + */ if(rank1 != rank2) { if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); @@ -735,15 +706,14 @@ int diff_can_type( hid_t f_tid1, /* file data type */ print_dimensions(rank2, maxdim2); parallel_print("\n"); } - can_compare = 0; options->not_cmp = 1; - goto done; + HGOTO_DONE(0); } /*------------------------------------------------------------------------- - * check for different dimensions - *------------------------------------------------------------------------- - */ + * check for different dimensions + *------------------------------------------------------------------------- + */ for(i = 0; im_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); @@ -772,15 +742,14 @@ int diff_can_type( hid_t f_tid1, /* file data type */ parallel_print("\n"); } } - can_compare = 0; options->not_cmp = 1; - goto done; + HGOTO_DONE(0); } /*------------------------------------------------------------------------- - * maximum dimensions; just give a warning - *------------------------------------------------------------------------- - */ + * maximum dimensions; just give a warning + *------------------------------------------------------------------------- + */ if(maxdim1 && maxdim2 && maxdim_diff == 1 && obj1_name) { if(options->m_verbose) { parallel_print( "Warning: different maximum dimensions\n"); @@ -797,8 +766,8 @@ int diff_can_type( hid_t f_tid1, /* file data type */ int nmembs1; int nmembs2; int j; - hid_t memb_type1; - hid_t memb_type2; + hid_t memb_type1 = -1; + hid_t memb_type2 = -1; nmembs1 = H5Tget_nmembers(f_tid1); nmembs2 = H5Tget_nmembers(f_tid2); @@ -809,9 +778,8 @@ int diff_can_type( hid_t f_tid1, /* file data type */ parallel_print("<%s> has %d members ", obj2_name, nmembs2); parallel_print("\n"); } - can_compare = 0; options->not_cmp = 1; - goto done; + HGOTO_DONE(0); } for (j = 0; j < nmembs1; j++) { @@ -821,11 +789,10 @@ int diff_can_type( hid_t f_tid1, /* file data type */ if (diff_can_type(memb_type1, memb_type2, rank1, rank2, dims1, dims2, maxdim1, maxdim2, obj1_name, obj2_name, options, 1) != 1) { - can_compare = 0; options->not_cmp = 1; H5Tclose(memb_type1); H5Tclose(memb_type2); - goto done; + HGOTO_DONE(0); } H5Tclose(memb_type1); H5Tclose(memb_type2); @@ -833,17 +800,16 @@ int diff_can_type( hid_t f_tid1, /* file data type */ } done: h5diffdebug2("diff_can_type end - %d\n", can_compare); - return can_compare; + return ret_value; } /*------------------------------------------------------------------------- -* Function: print_sizes -* -* Purpose: Print datatype sizes -* -*------------------------------------------------------------------------- -*/ + * Function: print_sizes + * + * Purpose: Print datatype sizes + *------------------------------------------------------------------------- + */ #if defined (H5DIFF_DEBUG) void print_sizes( const char *obj1, const char *obj2, diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index ad23ccf..d4fc3a2 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -24,8 +24,7 @@ int g_nTasks = 1; /*------------------------------------------------------------------------- * Function: print_dimensions * - * Purpose: print dimensions - * + * Purpose: print dimensions *------------------------------------------------------------------------- */ void @@ -33,14 +32,14 @@ print_dimensions (int rank, hsize_t *dims) { int i; - if( rank <= 0 ) + if(rank <= 0) parallel_print("H5S_SCALAR" ); else { if (!dims) parallel_print("dimension is NULL"); else { parallel_print("["); - for ( i = 0; i < rank-1; i++) { + for (i = 0; i < rank-1; i++) { parallel_print(HSIZE_T_FORMAT, dims[i]); parallel_print("x"); } @@ -55,16 +54,11 @@ print_dimensions (int rank, hsize_t *dims) /*------------------------------------------------------------------------- * Function: print_type * - * Purpose: Print name of datatype - * - * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Purpose: Print name of datatype * - * Date: May 9, 2003 - * - * Comments: Adapted from h5dump for H5T_INTEGER and H5T_FLOAT classes only + * Return: void * + * Comments: Adapted from h5dump for H5T_INTEGER and H5T_FLOAT classes only *------------------------------------------------------------------------- */ void print_type(hid_t type) @@ -188,12 +182,7 @@ void print_type(hid_t type) /*------------------------------------------------------------------------- * Function: diff_basename * - * Purpose: Returns a pointer to the last component absolute name - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * + * Purpose: Returns a pointer to the last component absolute name *------------------------------------------------------------------------- */ H5_ATTR_PURE const char* @@ -219,12 +208,7 @@ diff_basename(const char *name) /*------------------------------------------------------------------------- * Function: get_type * - * Purpose: Returns the type as a string - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * + * Purpose: Returns the type as a string *------------------------------------------------------------------------- */ H5_ATTR_PURE H5_ATTR_CONST const char* @@ -255,21 +239,13 @@ get_type(h5trav_type_t type) /*------------------------------------------------------------------------- * Function: get_sign * - * Purpose: Returns the sign as a string - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * - * Comments: - * + * Purpose: Returns the sign as a string *------------------------------------------------------------------------- */ H5_ATTR_PURE const char* get_sign(H5T_sign_t sign) { - switch(sign) - { + switch(sign) { case H5T_SGN_NONE: return "H5T_SGN_NONE"; @@ -291,12 +267,7 @@ get_sign(H5T_sign_t sign) /*------------------------------------------------------------------------- * Function: get_class * - * Purpose: Returns the class as a string - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * + * Purpose: Returns the class as a string *------------------------------------------------------------------------- */ H5_ATTR_PURE const char* @@ -346,8 +317,7 @@ get_class(H5T_class_t tclass) /*------------------------------------------------------------------------- * Function: print_found * - * Purpose: print number of differences found - * + * Purpose: print number of differences found *------------------------------------------------------------------------- */ void print_found(hsize_t nfound) @@ -362,43 +332,37 @@ void print_found(hsize_t nfound) /*----------------------------------------------------------------- * Function: match_up_memsize * - * Purpose: match smaller memory size up to bigger memory size + * Purpose: match smaller memory size up to bigger memory size *------------------------------------------------------------------ */ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, hid_t *m_tid1, hid_t *m_tid2, size_t *m_size1, size_t *m_size2) { - herr_t ret = SUCCEED; + herr_t ret_value = SUCCEED; if((*m_size1) != (*m_size2)) { if((*m_size1) < (*m_size2)) { - H5Tclose( *m_tid1 ); + H5Tclose(*m_tid1); - if(((*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) { - ret = FAIL; - goto out; - } + if(((*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); - *m_size1 = H5Tget_size( *m_tid1 ); + *m_size1 = H5Tget_size(*m_tid1); } /* end if */ else { H5Tclose(*m_tid2); - if(((*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) { - ret = FAIL; - goto out; - } + if(((*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); *m_size2 = H5Tget_size(*m_tid2); } /* end else */ } /* end if */ - if((*m_size1) != (*m_size2)) { - ret = FAIL; - goto out; - } + if((*m_size1) != (*m_size2)) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "native type sizes do not compare"); -out: - return ret; +done: + return ret_value; } diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index fb79b77..7c88151 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -1910,9 +1910,8 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ obj = search_obj(h5dump_type_table, oinfo.addr); if(obj) { - if(!obj->recorded) { + if(!obj->recorded) h5tools_str_append(buffer,"\"/#"H5_PRINTF_HADDR_FMT"\"", obj->objno); - } else h5tools_str_append(buffer, "\"%s\"", obj->objname); } @@ -1929,121 +1928,86 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ switch (type_class) { case H5T_INTEGER: - if (H5Tequal(type, H5T_STD_I8BE) == TRUE) { + if (H5Tequal(type, H5T_STD_I8BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I8BE"); - } - else if (H5Tequal(type, H5T_STD_I8LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I8LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I8LE"); - } - else if (H5Tequal(type, H5T_STD_I16BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I16BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I16BE"); - } - else if (H5Tequal(type, H5T_STD_I16LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I16LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I16LE"); - } - else if (H5Tequal(type, H5T_STD_I32BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I32BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I32BE"); - } - else if (H5Tequal(type, H5T_STD_I32LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I32LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I32LE"); - } - else if (H5Tequal(type, H5T_STD_I64BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I64BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I64BE"); - } - else if (H5Tequal(type, H5T_STD_I64LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I64LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I64LE"); - } - else if (H5Tequal(type, H5T_STD_U8BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U8BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U8BE"); - } - else if (H5Tequal(type, H5T_STD_U8LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U8LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U8LE"); - } - else if (H5Tequal(type, H5T_STD_U16BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U16BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U16BE"); - } - else if (H5Tequal(type, H5T_STD_U16LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U16LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U16LE"); - } - else if (H5Tequal(type, H5T_STD_U32BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U32BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U32BE"); - } - else if (H5Tequal(type, H5T_STD_U32LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U32LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U32LE"); - } - else if (H5Tequal(type, H5T_STD_U64BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U64BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U64BE"); - } - else if (H5Tequal(type, H5T_STD_U64LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U64LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U64LE"); - } - else if (H5Tequal(type, H5T_NATIVE_SCHAR) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_SCHAR) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_SCHAR"); - } - else if (H5Tequal(type, H5T_NATIVE_UCHAR) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_UCHAR) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_UCHAR"); - } - else if (H5Tequal(type, H5T_NATIVE_SHORT) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_SHORT) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_SHORT"); - } - else if (H5Tequal(type, H5T_NATIVE_USHORT) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_USHORT) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_USHORT"); - } - else if (H5Tequal(type, H5T_NATIVE_INT) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_INT) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_INT"); - } - else if (H5Tequal(type, H5T_NATIVE_UINT) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_UINT) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_UINT"); - } - else if (H5Tequal(type, H5T_NATIVE_LONG) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_LONG) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_LONG"); - } - else if (H5Tequal(type, H5T_NATIVE_ULONG) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_ULONG) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_ULONG"); - } - else if (H5Tequal(type, H5T_NATIVE_LLONG) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_LLONG) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_LLONG"); - } - else if (H5Tequal(type, H5T_NATIVE_ULLONG) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_ULLONG) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_ULLONG"); - } else { /* byte order */ if (H5Tget_size(type) > 1) { order = H5Tget_order(type); - if (H5T_ORDER_LE == order) { + if (H5T_ORDER_LE == order) order_s = " little-endian"; - } - else if (H5T_ORDER_BE == order) { + else if (H5T_ORDER_BE == order) order_s = " big-endian"; - } - else if (H5T_ORDER_VAX == order) { + else if (H5T_ORDER_VAX == order) order_s = " mixed-endian"; - } - else { + else order_s = " unknown-byte-order"; - } } - else { + else order_s = ""; - } /* sign */ if ((sign = H5Tget_sign(type)) >= 0) { - if (H5T_SGN_NONE == sign) { + if (H5T_SGN_NONE == sign) sign_s = " unsigned"; - } - else if (H5T_SGN_2 == sign) { + else if (H5T_SGN_2 == sign) sign_s = ""; - } - else { + else sign_s = " unknown-sign"; - } } - else { + else sign_s = " unknown-sign"; - } /* print size, order, and sign */ h5tools_str_append(buffer, "%lu-bit%s%s integer", @@ -2052,56 +2016,42 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ break; case H5T_FLOAT: - if (H5Tequal(type, H5T_IEEE_F32BE) == TRUE) { + if (H5Tequal(type, H5T_IEEE_F32BE) == TRUE) h5tools_str_append(buffer, "H5T_IEEE_F32BE"); - } - else if (H5Tequal(type, H5T_IEEE_F32LE) == TRUE) { + else if (H5Tequal(type, H5T_IEEE_F32LE) == TRUE) h5tools_str_append(buffer, "H5T_IEEE_F32LE"); - } - else if (H5Tequal(type, H5T_IEEE_F64BE) == TRUE) { + else if (H5Tequal(type, H5T_IEEE_F64BE) == TRUE) h5tools_str_append(buffer, "H5T_IEEE_F64BE"); - } - else if (H5Tequal(type, H5T_IEEE_F64LE) == TRUE) { + else if (H5Tequal(type, H5T_IEEE_F64LE) == TRUE) h5tools_str_append(buffer, "H5T_IEEE_F64LE"); - } - else if (H5Tequal(type, H5T_VAX_F32) == TRUE) { + else if (H5Tequal(type, H5T_VAX_F32) == TRUE) h5tools_str_append(buffer, "H5T_VAX_F32"); - } - else if (H5Tequal(type, H5T_VAX_F64) == TRUE) { + else if (H5Tequal(type, H5T_VAX_F64) == TRUE) h5tools_str_append(buffer, "H5T_VAX_F64"); - } - else if (H5Tequal(type, H5T_NATIVE_FLOAT) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_FLOAT) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_FLOAT"); - } - else if (H5Tequal(type, H5T_NATIVE_DOUBLE) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_DOUBLE) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_DOUBLE"); #if H5_SIZEOF_LONG_DOUBLE !=0 - } - else if (H5Tequal(type, H5T_NATIVE_LDOUBLE) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_LDOUBLE) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_LDOUBLE"); #endif - } else { /* byte order */ if (H5Tget_size(type) > 1) { order = H5Tget_order(type); - if (H5T_ORDER_LE == order) { + if (H5T_ORDER_LE == order) order_s = " little-endian"; - } - else if (H5T_ORDER_BE == order) { + else if (H5T_ORDER_BE == order) order_s = " big-endian"; - } - else if (H5T_ORDER_VAX == order) { + else if (H5T_ORDER_VAX == order) order_s = " mixed-endian"; - } - else { + else order_s = " unknown-byte-order"; - } } - else { + else order_s = ""; - } /* print size and byte order */ h5tools_str_append(buffer, "%lu-bit%s floating-point", @@ -2308,33 +2258,24 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ break; case H5T_BITFIELD: - if (H5Tequal(type, H5T_STD_B8BE) == TRUE) { + if (H5Tequal(type, H5T_STD_B8BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B8BE"); - } - else if (H5Tequal(type, H5T_STD_B8LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B8LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B8LE"); - } - else if (H5Tequal(type, H5T_STD_B16BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B16BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B16BE"); - } - else if (H5Tequal(type, H5T_STD_B16LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B16LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B16LE"); - } - else if (H5Tequal(type, H5T_STD_B32BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B32BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B32BE"); - } - else if (H5Tequal(type, H5T_STD_B32LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B32LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B32LE"); - } - else if (H5Tequal(type, H5T_STD_B64BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B64BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B64BE"); - } - else if (H5Tequal(type, H5T_STD_B64LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B64LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B64LE"); - } - else { + else h5tools_str_append(buffer, "undefined bitfield"); - } break; case H5T_OPAQUE: diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index abd55db..a5d0994 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -28,18 +28,22 @@ static void print_warning(const char *dname, const char *fname) /*------------------------------------------------------------------------- * Function: h5tools_canreadf * - * Purpose: check if the dataset creation property list has filters that - * are not registered in the current configuration - * 1) the external filters GZIP and SZIP might not be available - * 2) the internal filters might be turned off + * Purpose: check if the dataset creation property list has filters that + * are not registered in the current configuration + * 1) the external filters GZIP and SZIP might not be available + * 2) the internal filters might be turned off * - * Return: 1, can read, 0, cannot, -1 error + * Return: + * 1 can read, + * 0 cannot, + * -1 error *------------------------------------------------------------------------- */ -int h5tools_canreadf(const char* name, /* object name, serves also as boolean print */ +int +h5tools_canreadf(const char* name, /* object name, serves also as boolean print */ hid_t dcpl_id) /* dataset creation property list */ { - int ret_value = 1; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 1; int nfilters; /* number of filters */ H5Z_filter_t filtn; /* filter identification number */ int i; /* index */ @@ -130,56 +134,58 @@ done: /*------------------------------------------------------------------------- * Function: h5tools_canwritef * - * Purpose: check if the filter is available and can write data. - * At this time, all filters that are available can write data, - * except SZIP, which may be configured decoder-only. + * Purpose: check if the filter is available and can write data. * - * Return: 1, can write, 0, cannot, -1 error + * Return: 1 can write, + * 0 cannot, + * -1 error *------------------------------------------------------------------------- */ H5_ATTR_CONST int -h5tools_can_encode(H5Z_filter_t filtn) { +h5tools_can_encode(H5Z_filter_t filtn) +{ + int ret_value = 1; + switch (filtn) { /* user defined filter */ default: - return 0; - + HGOTO_DONE(0) case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE - return 0; + HGOTO_DONE(0) #endif break; case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP - return 0; + HGOTO_DONE(0) #else - { + { unsigned int filter_config_flags; if (H5Zget_filter_info(filtn, &filter_config_flags) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Zget_filter_info failed"); if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) { /* filter present but neither encode nor decode is supported (???) */ - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "neither encode nor decode is supported"); } else if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_DECODE_ENABLED) { /* decoder only: read but not write */ - return 0; + HGOTO_DONE(0) } else if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_ENCODE_ENABLED) { /* encoder only: write but not read (???) */ - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "encoder only: write but not read"); } else if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) { - return 1; + HGOTO_DONE(1) } - } + } #endif break; @@ -196,6 +202,7 @@ h5tools_can_encode(H5Z_filter_t filtn) { break; }/*switch*/ - return 1; +done: + return ret_value; } diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c index ee58ccb..f63c228 100644 --- a/tools/lib/h5tools_type.c +++ b/tools/lib/h5tools_type.c @@ -21,12 +21,6 @@ * * Return: Success: datatype ID * Failure: FAIL - * - * Programmer: Pedro Vicente Nunes - * Tuesday, July 18, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ hid_t @@ -43,40 +37,40 @@ h5tools_get_little_endian_type(hid_t tid) switch(type_class) { case H5T_INTEGER: - if ( size == 1 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I8LE); - else if ( size == 2 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I16LE); - else if ( size == 4 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I32LE); - else if ( size == 8 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I64LE); - else if ( size == 1 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U8LE); - else if ( size == 2 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U16LE); - else if ( size == 4 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U32LE); - else if ( size == 8 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U64LE); + if (size == 1 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I8LE); + else if (size == 2 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I16LE); + else if (size == 4 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I32LE); + else if (size == 8 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I64LE); + else if (size == 1 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U8LE); + else if (size == 2 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U16LE); + else if (size == 4 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U32LE); + else if (size == 8 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U64LE); break; case H5T_FLOAT: - if ( size == 4) - p_type=H5Tcopy(H5T_IEEE_F32LE); - else if ( size == 8) - p_type=H5Tcopy(H5T_IEEE_F64LE); + if (size == 4) + p_type = H5Tcopy(H5T_IEEE_F32LE); + else if (size == 8) + p_type = H5Tcopy(H5T_IEEE_F64LE); break; case H5T_BITFIELD: - if ( size == 1) - p_type=H5Tcopy(H5T_STD_B8LE); - else if ( size == 2) - p_type=H5Tcopy(H5T_STD_B16LE); - else if ( size == 4) - p_type=H5Tcopy(H5T_STD_B32LE); - else if ( size == 8) - p_type=H5Tcopy(H5T_STD_B64LE); + if (size == 1) + p_type = H5Tcopy(H5T_STD_B8LE); + else if (size == 2) + p_type = H5Tcopy(H5T_STD_B16LE); + else if (size == 4) + p_type = H5Tcopy(H5T_STD_B32LE); + else if (size == 8) + p_type = H5Tcopy(H5T_STD_B64LE); break; case H5T_TIME: @@ -107,18 +101,12 @@ h5tools_get_little_endian_type(hid_t tid) * * Return: Success: datatype ID * Failure: FAIL - * - * Programmer: Pedro Vicente Nunes - * Tuesday, July 18, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ hid_t h5tools_get_big_endian_type(hid_t tid) { - hid_t p_type=-1; + hid_t p_type = -1; H5T_class_t type_class; size_t size; H5T_sign_t sign; @@ -129,39 +117,39 @@ h5tools_get_big_endian_type(hid_t tid) switch(type_class) { case H5T_INTEGER: - if ( size == 1 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I8BE); - else if ( size == 2 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I16BE); - else if ( size == 4 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I32BE); - else if ( size == 8 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I64BE); - else if ( size == 1 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U8BE); - else if ( size == 2 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U16BE); - else if ( size == 4 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U32BE); - else if ( size == 8 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U64BE); + if (size == 1 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I8BE); + else if (size == 2 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I16BE); + else if (size == 4 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I32BE); + else if (size == 8 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I64BE); + else if (size == 1 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U8BE); + else if (size == 2 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U16BE); + else if (size == 4 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U32BE); + else if (size == 8 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U64BE); break; case H5T_FLOAT: - if ( size == 4) - p_type=H5Tcopy(H5T_IEEE_F32BE); - else if ( size == 8) - p_type=H5Tcopy(H5T_IEEE_F64BE); + if (size == 4) + p_type = H5Tcopy(H5T_IEEE_F32BE); + else if (size == 8) + p_type = H5Tcopy(H5T_IEEE_F64BE); break; case H5T_BITFIELD: - if ( size == 1) - p_type=H5Tcopy(H5T_STD_B8BE); - else if ( size == 2) - p_type=H5Tcopy(H5T_STD_B16BE); - else if ( size == 4) - p_type=H5Tcopy(H5T_STD_B32BE); - else if ( size == 8) + if (size == 1) + p_type = H5Tcopy(H5T_STD_B8BE); + else if (size == 2) + p_type = H5Tcopy(H5T_STD_B16BE); + else if (size == 4) + p_type = H5Tcopy(H5T_STD_B32BE); + else if (size == 8) p_type=H5Tcopy(H5T_STD_B64BE); break; diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 8c435b2..1b5911b 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -58,15 +58,11 @@ static void add_obj(table_t *table, haddr_t objno, const char *objname, hbool_t /*------------------------------------------------------------------------- * Function: parallel_print * - * Purpose: wrapper for printf for use in parallel mode. - * - * Programmer: Leon Arber - * - * Date: December 1, 2004 - * + * Purpose: wrapper for printf for use in parallel mode. *------------------------------------------------------------------------- */ -void parallel_print(const char* format, ...) +void +parallel_print(const char* format, ...) { int bytes_written; va_list ap; @@ -103,18 +99,12 @@ void parallel_print(const char* format, ...) /*------------------------------------------------------------------------- - * Function: error_msg + * Function: error_msg * - * Purpose: Print a nicely formatted error message to stderr flushing the + * Purpose: Print a nicely formatted error message to stderr flushing the * stdout stream first. * - * Return: Nothing - * - * Programmer: Bill Wendling - * Tuesday, 20. February 2001 - * - * Modifications: - * + * Return: Nothing *------------------------------------------------------------------------- */ void @@ -134,18 +124,12 @@ error_msg(const char *fmt, ...) /*------------------------------------------------------------------------- - * Function: warn_msg + * Function: warn_msg * - * Purpose: Print a nicely formatted warning message to stderr flushing + * Purpose: Print a nicely formatted warning message to stderr flushing * the stdout stream first. * - * Return: Nothing - * - * Programmer: Bill Wendling - * Tuesday, 20. February 2001 - * - * Modifications: - * + * Return: Nothing *------------------------------------------------------------------------- */ void @@ -163,14 +147,11 @@ warn_msg(const char *fmt, ...) } /*------------------------------------------------------------------------- - * Function: help_ref_msg + * Function: help_ref_msg * - * Purpose: Print a message to refer help page - * - * Return: Nothing - * - * Modifications: + * Purpose: Print a message to refer help page * + * Return: Nothing *------------------------------------------------------------------------- */ void @@ -182,24 +163,16 @@ help_ref_msg(FILE *output) /*------------------------------------------------------------------------- - * Function: get_option + * Function: get_option * - * Purpose: Determine the command-line options a user specified. We can - * accept both short and long type command-lines. + * Purpose: Determine the command-line options a user specified. We can + * accept both short and long type command-lines. * * Return: Success: The short valued "name" of the command line * parameter or EOF if there are no more * parameters to process. * - * Failure: A question mark. - * - * Programmer: Bill Wendling - * Friday, 5. January 2001 - * - * Modifications: Pedro Vicente - * October, 27 2008 - * Wilcard "*" argument type - * + * Failure: A question mark. *------------------------------------------------------------------------- */ int @@ -232,9 +205,8 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti opt_opt = l_opts[i].shortval; if (l_opts[i].has_arg != no_arg) { - if (arg[len] == '=') { + if (arg[len] == '=') opt_arg = &arg[len + 1]; - } else if (l_opts[i].has_arg != optional_arg) { if (opt_ind < (argc - 1)) if (argv[opt_ind + 1][0] != '-') @@ -323,16 +295,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti opt_ind++; /* we do have an extra argument, check if not last */ if ( (opt_ind+1) < argc ) { - if ( argv[opt_ind][0] != '-' ) { + if ( argv[opt_ind][0] != '-' ) opt_arg = argv[opt_ind++]; - } - else { + else opt_arg = NULL; - } } - else { + else opt_arg = NULL; - } } else { /* set up to look at next char in token, next time */ @@ -351,16 +320,11 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti /*------------------------------------------------------------------------- - * Function: indentation + * Function: indentation * - * Purpose: Print spaces for indentation - * - * Return: void - * - * Programmer: Ruey-Hsia Li - * - * Modifications: + * Purpose: Print spaces for indentation * + * Return: void *------------------------------------------------------------------------- */ void @@ -378,17 +342,12 @@ indentation(unsigned x) /*------------------------------------------------------------------------- - * Function: print_version + * Function: print_version * - * Purpose: Print the program name and the version information which is - * defined the same as the HDF5 library version. - * - * Return: void - * - * Programmer: unknown - * - * Modifications: + * Purpose: Print the program name and the version information which is + * defined the same as the HDF5 library version. * + * Return: void *------------------------------------------------------------------------- */ void @@ -407,11 +366,6 @@ print_version(const char *progname) * and committed types * * Return: void - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -434,11 +388,6 @@ init_table(table_t **tbl) * and committed types * * Return: void - * - * Programmer: Paul Harten - * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -462,11 +411,6 @@ free_table(table_t *table) * Purpose: display the contents of tables for debugging purposes * * Return: void - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -488,11 +432,6 @@ dump_table(char* tablename, table_t *table) * Purpose: display the contents of tables for debugging purposes * * Return: void - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -513,11 +452,6 @@ dump_tables(find_objs_t *info) * Return: Success: an integer, the location of the object * * Failure: FAIL if object is not found - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ H5_ATTR_PURE obj_t * @@ -541,11 +475,6 @@ search_obj(table_t *table, haddr_t objno) * Return: Success: SUCCEED * * Failure: FAIL - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -623,11 +552,6 @@ find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen * Return: Success: SUCCEED * * Failure: FAIL - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -657,11 +581,6 @@ init_objs(hid_t fid, find_objs_t *info, table_t **group_table, * realloc the table if necessary * * Return: void - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -695,11 +614,6 @@ add_obj(table_t *table, haddr_t objno, const char *objname, hbool_t record) * * Return: a stream description when succeeds. * NULL if fails. - * - * Programmer: Albert Cheng, 2005/8/9 - * - * Modifications: - * *------------------------------------------------------------------------- */ FILE * @@ -723,70 +637,61 @@ tmpfile(void) * * Return: * 2 : given pathname is object - * 1 : Succed to get link info. + * 1 : Succeed to get link info. * 0 : Detected as a dangling link * -1 : H5 API failed. * * NOTE: * link_info->trg_path must be freed out of this function - * - * Programmer: Jonathan Kim - * - * Date: Feb 8, 2010 *-------------------------------------------------------------------------*/ int -H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_t *link_info, - hbool_t get_obj_type) +H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_t *link_info, hbool_t get_obj_type) { htri_t l_ret; H5O_info_t trg_oinfo; hid_t fapl = H5P_DEFAULT; hid_t lapl = H5P_DEFAULT; - int ret = -1; /* init to fail */ + int ret_value = -1; /* init to fail */ /* init */ link_info->trg_type = H5O_TYPE_UNKNOWN; /* if path is root, return group type */ - if(!HDstrcmp(linkpath,"/")) - { + if(!HDstrcmp(linkpath,"/")) { link_info->trg_type = H5O_TYPE_GROUP; - ret = 2; - goto out; + HGOTO_DONE(2); } /* check if link itself exist */ if(H5Lexists(file_id, linkpath, H5P_DEFAULT) <= 0) { if(link_info->opt.msg_mode == 1) parallel_print("Warning: link <%s> doesn't exist \n",linkpath); - goto out; + HGOTO_DONE(FAIL); } /* end if */ /* get info from link */ if(H5Lget_info(file_id, linkpath, &(link_info->linfo), H5P_DEFAULT) < 0) { if(link_info->opt.msg_mode == 1) parallel_print("Warning: unable to get link info from <%s>\n",linkpath); - goto out; + HGOTO_DONE(FAIL); } /* end if */ /* given path is hard link (object) */ - if(link_info->linfo.type == H5L_TYPE_HARD) { - ret = 2; - goto out; - } /* end if */ + if(link_info->linfo.type == H5L_TYPE_HARD) + HGOTO_DONE(2); /* trg_path must be freed out of this function when finished using */ if((link_info->trg_path = (char*)HDcalloc(link_info->linfo.u.val_size, sizeof(char))) == NULL) { if(link_info->opt.msg_mode == 1) parallel_print("Warning: unable to allocate buffer for <%s>\n",linkpath); - goto out; + HGOTO_DONE(FAIL); } /* end if */ /* get link value */ if(H5Lget_val(file_id, linkpath, (void *)link_info->trg_path, link_info->linfo.u.val_size, H5P_DEFAULT) < 0) { if(link_info->opt.msg_mode == 1) parallel_print("Warning: unable to get link value from <%s>\n",linkpath); - goto out; + HGOTO_DONE(FAIL); } /* end if */ /*----------------------------------------------------- @@ -795,13 +700,13 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_ */ if(link_info->linfo.type == H5L_TYPE_EXTERNAL) { if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto out; + HGOTO_DONE(FAIL); if(H5Pset_fapl_sec2(fapl) < 0) - goto out; + HGOTO_DONE(FAIL); if((lapl = H5Pcreate(H5P_LINK_ACCESS)) < 0) - goto out; + HGOTO_DONE(FAIL); if(H5Pset_elink_fapl(lapl, fapl) < 0) - goto out; + HGOTO_DONE(FAIL); } /* end if */ /* Check for retrieving object info */ @@ -814,25 +719,24 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_ /* detect dangling link */ if(l_ret == FALSE) { - ret = 0; - goto out; - } /* end if */ - /* function failed */ - else if(l_ret < 0) - goto out; + HGOTO_DONE(0); + } + else if(l_ret < 0) { /* function failed */ + HGOTO_DONE(FAIL); + } /* get target object info */ if(H5Oget_info_by_name(file_id, linkpath, &trg_oinfo, lapl) < 0) { if(link_info->opt.msg_mode == 1) parallel_print("Warning: unable to get object information for <%s>\n", linkpath); - goto out; + HGOTO_DONE(FAIL); } /* end if */ /* check unknown type */ if(trg_oinfo.type < H5O_TYPE_GROUP || trg_oinfo.type >=H5O_TYPE_NTYPES) { if(link_info->opt.msg_mode == 1) parallel_print("Warning: target object of <%s> is unknown type\n", linkpath); - goto out; + HGOTO_DONE(FAIL); } /* end if */ /* set target obj type to return */ @@ -844,31 +748,34 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_ link_info->trg_type = H5O_TYPE_UNKNOWN; /* succeed */ - ret = 1; + ret_value = 1; -out: +done: if(fapl != H5P_DEFAULT) H5Pclose(fapl); if(lapl != H5P_DEFAULT) H5Pclose(lapl); - return ret; + return ret_value; } /* end H5tools_get_symlink_info() */ /*------------------------------------------------------------------------- * Audience: Public - * Chapter: H5Tools Library + * * Purpose: Initialize the name and operation status of the H5 Tools library + * * Description: * These are utility functions to set/get the program name and operation status. *------------------------------------------------------------------------- */ -void h5tools_setprogname(const char *Progname) +void +h5tools_setprogname(const char *Progname) { h5tools_progname = Progname; } -void h5tools_setstatus(int D_status) +void +h5tools_setstatus(int D_status) { h5tools_d_status = D_status; } @@ -892,25 +799,19 @@ h5tools_getstatus(void) * This can be called from each tools main() as part of initial act. * Note: this is more of debugging purpose for now. */ -int h5tools_getenv_update_hyperslab_bufsize(void) +int +h5tools_getenv_update_hyperslab_bufsize(void) { const char *env_str = NULL; long hyperslab_bufsize_mb; + int ret_value = 1; /* check if environment variable is set for the hyperslab buffer size */ - if (NULL != (env_str = HDgetenv ("H5TOOLS_BUFSIZE"))) - { + if (NULL != (env_str = HDgetenv ("H5TOOLS_BUFSIZE"))) { errno = 0; hyperslab_bufsize_mb = HDstrtol(env_str, (char**)NULL, 10); if (errno != 0 || hyperslab_bufsize_mb <= 0) - { - /* TODO: later when pubilshed - HDfprintf(rawerrorstream,"Error: Invalid environment variable \"H5TOOLS_BUFSIZE\" : %s\n", env_str); - */ - - goto error; - } - + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "hyperslab buffer size failed"); /* convert MB to byte */ H5TOOLS_BUFSIZE = (hsize_t)hyperslab_bufsize_mb * 1024 * 1024; @@ -918,9 +819,7 @@ int h5tools_getenv_update_hyperslab_bufsize(void) H5TOOLS_MALLOCSIZE = MAX(H5TOOLS_BUFSIZE, H5TOOLS_MALLOCSIZE); } - return (1); - -error: - return (-1); +done: + return ret_value; } diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index ddc0109..b6d32f7 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -13,6 +13,7 @@ #include "h5trav.h" +#include "h5tools.h" #include "H5private.h" /*------------------------------------------------------------------------- @@ -81,10 +82,9 @@ static int trav_verbosity = 0; /*------------------------------------------------------------------------- * Function: h5trav_set_index * - * Purpose: Set indexing properties for the objects & links in the file - * - * Return: none + * Purpose: Set indexing properties for the objects & links in the file * + * Return: none *------------------------------------------------------------------------- */ void @@ -97,10 +97,9 @@ h5trav_set_index(H5_index_t print_index_by, H5_iter_order_t print_index_order) /*------------------------------------------------------------------------- * Function: h5trav_set_verbose * - * Purpose: Set verbosity of file contents 1=>attributes - * - * Return: none + * Purpose: Set verbosity of file contents 1=>attributes * + * Return: none *------------------------------------------------------------------------- */ void @@ -118,14 +117,9 @@ h5trav_set_verbose(int print_verbose) /*------------------------------------------------------------------------- * Function: trav_addr_add * - * Purpose: Add a hardlink address to visited data structure - * - * Return: void - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Add a hardlink address to visited data structure * + * Return: void *------------------------------------------------------------------------- */ static void @@ -149,14 +143,9 @@ trav_addr_add(trav_addr_t *visited, haddr_t addr, const char *path) /*------------------------------------------------------------------------- * Function: trav_addr_visited * - * Purpose: Check if an address has already been visited - * - * Return: TRUE/FALSE - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Check if an address has already been visited * + * Return: TRUE/FALSE *------------------------------------------------------------------------- */ H5_ATTR_PURE static const char * @@ -178,12 +167,7 @@ trav_addr_visited(trav_addr_t *visited, haddr_t addr) /*------------------------------------------------------------------------- * Function: traverse_cb * - * Purpose: Iterator callback for traversing objects in file - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 - * + * Purpose: Iterator callback for traversing objects in file *------------------------------------------------------------------------- */ static herr_t @@ -258,26 +242,23 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info_t *linfo, /*------------------------------------------------------------------------- * Function: traverse * - * Purpose: Iterate over all the objects/links in a file. Conforms to the - * "visitor" pattern. - * - * Return: 0 on success, -1 on failure - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Iterate over all the objects/links in a file. Conforms to the + * "visitor" pattern. * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ static int traverse(hid_t file_id, const char *grp_name, hbool_t visit_start, - hbool_t recurse, const trav_visitor_t *visitor) + hbool_t recurse, const trav_visitor_t *visitor) { H5O_info_t oinfo; /* Object info for starting group */ + int ret_value = SUCCEED; /* Get info for starting object */ if(H5Oget_info_by_name(file_id, grp_name, &oinfo, H5P_DEFAULT) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info_by_name failed"); /* Visit the starting object */ if(visit_start && visitor->visit_obj) @@ -306,12 +287,12 @@ traverse(hid_t file_id, const char *grp_name, hbool_t visit_start, if(recurse) { /* Visit all links in group, recursively */ if(H5Lvisit_by_name(file_id, grp_name, trav_index_by, trav_index_order, traverse_cb, &udata, H5P_DEFAULT) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Lvisit_by_name failed"); } /* end if */ else { /* Iterate over links in group */ if(H5Literate_by_name(file_id, grp_name, trav_index_by, trav_index_order, NULL, traverse_cb, &udata, H5P_DEFAULT) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Literate_by_name failed"); } /* end else */ /* Free visited addresses table */ @@ -325,21 +306,17 @@ traverse(hid_t file_id, const char *grp_name, hbool_t visit_start, } /* end if */ } /* end if */ - return 0; +done: + return ret_value; } /*------------------------------------------------------------------------- * Function: trav_info_add * - * Purpose: Add a link path & type to info struct - * - * Return: void - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Add a link path & type to info struct * + * Return: void *------------------------------------------------------------------------- */ void @@ -347,18 +324,20 @@ trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type) { size_t idx; /* Index of address to use */ - /* Allocate space if necessary */ - if(info->nused == info->nalloc) { - info->nalloc = MAX(1, info->nalloc * 2);; - info->paths = (trav_path_t *)HDrealloc(info->paths, info->nalloc * sizeof(trav_path_t)); - } /* end if */ + if (info) { + /* Allocate space if necessary */ + if(info->nused == info->nalloc) { + info->nalloc = MAX(1, info->nalloc * 2);; + info->paths = (trav_path_t *)HDrealloc(info->paths, info->nalloc * sizeof(trav_path_t)); + } /* end if */ - /* Append it */ - idx = info->nused++; - info->paths[idx].path = HDstrdup(path); - info->paths[idx].type = obj_type; - info->paths[idx].fileno = 0; - info->paths[idx].objno = HADDR_UNDEF; + /* Append it */ + idx = info->nused++; + info->paths[idx].path = HDstrdup(path); + info->paths[idx].type = obj_type; + info->paths[idx].fileno = 0; + info->paths[idx].objno = HADDR_UNDEF; + } } /* end trav_info_add() */ @@ -368,7 +347,6 @@ trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type) * Purpose: Add a file addr & fileno to info struct * * Return: void - * *------------------------------------------------------------------------- */ void @@ -390,22 +368,19 @@ trav_fileinfo_add(trav_info_t *info, hid_t loc_id) /*------------------------------------------------------------------------- * Function: trav_info_visit_obj * - * Purpose: Callback for visiting object, with 'info' structure - * - * Return: 0 on success, -1 on failure - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Callback for visiting object, with 'info' structure * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ int trav_info_visit_obj(const char *path, const H5O_info_t *oinfo, - const char H5_ATTR_UNUSED *already_visited, void *udata) + const char H5_ATTR_UNUSED *already_visited, void *udata) { size_t idx; trav_info_t *info_p; + /* Add the object to the 'info' struct */ /* (object types map directly to "traversal" types) */ trav_info_add((trav_info_t *)udata, path, (h5trav_type_t)oinfo->type); @@ -423,14 +398,10 @@ trav_info_visit_obj(const char *path, const H5O_info_t *oinfo, /*------------------------------------------------------------------------- * Function: trav_info_visit_lnk * - * Purpose: Callback for visiting link, with 'info' structure - * - * Return: 0 on success, -1 on failure - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Callback for visiting link, with 'info' structure * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ int @@ -446,21 +417,18 @@ trav_info_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) /*------------------------------------------------------------------------- * Function: h5trav_getinfo * - * Purpose: get an array of "trav_info_t" , containing the name and type of - * objects in the file - * - * Return: number of object names in file - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 6, 2002 + * Purpose: get an array of "trav_info_t" , containing the name and type of + * objects in the file * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ int h5trav_getinfo(hid_t file_id, trav_info_t *info) { trav_visitor_t info_visitor; /* Visitor structure for trav_info_t's */ + int ret_value = SUCCEED; /* Init visitor structure */ info_visitor.visit_obj = trav_info_visit_obj; @@ -469,25 +437,21 @@ h5trav_getinfo(hid_t file_id, trav_info_t *info) /* Traverse all objects in the file, visiting each object & link */ if(traverse(file_id, "/", TRUE, TRUE, &info_visitor) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "traverse failed"); - return 0; +done: + return ret_value; } /*------------------------------------------------------------------------- * Function: h5trav_getindex * - * Purpose: get index of OBJ in list - * - * Return: index, -1 if not found - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 + * Purpose: get index of OBJ in list * + * Return: index on success, + * -1 if not found *------------------------------------------------------------------------- */ - H5_ATTR_PURE ssize_t h5trav_getindex(const trav_info_t *info, const char *obj) { @@ -511,17 +475,11 @@ h5trav_getindex(const trav_info_t *info, const char *obj) /*------------------------------------------------------------------------- * Function: trav_info_init * - * Purpose: Initialize the info - * - * Return: void - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 6, 2007 + * Purpose: Initialize the info * + * Return: void *------------------------------------------------------------------------- */ - void trav_info_init(const char *filename, hid_t fileid, trav_info_t **_info) { @@ -545,11 +503,9 @@ trav_info_init(const char *filename, hid_t fileid, trav_info_t **_info) /*------------------------------------------------------------------------- * Function: trav_info_free * - * Purpose: free info memory - * + * Purpose: free info memory *------------------------------------------------------------------------- */ - void trav_info_free(trav_info_t *info) { @@ -557,11 +513,9 @@ trav_info_free(trav_info_t *info) if(info) { /* Free visited symbolic links path and file (if alloc) */ - for(u=0; u < info->symlink_visited.nused; u++) - { + for(u = 0; u < info->symlink_visited.nused; u++) { if (info->symlink_visited.objs[u].file) HDfree(info->symlink_visited.objs[u].file); - HDfree(info->symlink_visited.objs[u].path); } HDfree(info->symlink_visited.objs); @@ -586,12 +540,8 @@ trav_info_free(trav_info_t *info) * * Purpose: Callback for visiting object, with 'table' sructure * - * Return: 0 on success, -1 on failure - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 - * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ static int @@ -608,21 +558,17 @@ trav_table_visit_obj(const char *path, const H5O_info_t *oinfo, /* Add alias for object to table */ trav_table_addlink(table, oinfo->addr, path); - return(0); + return 0; } /* end trav_table_visit_obj() */ /*------------------------------------------------------------------------- * Function: trav_table_visit_lnk * - * Purpose: Callback for visiting link, with 'table' sructure - * - * Return: 0 on success, -1 on failure - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Callback for visiting link, with 'table' sructure * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ static int @@ -631,28 +577,24 @@ trav_table_visit_lnk(const char *path, const H5L_info_t H5_ATTR_UNUSED *linfo, v /* Add the link to the 'table' struct */ trav_table_add((trav_table_t *)udata, path, NULL); - return(0); + return 0; } /* end trav_table_visit_lnk() */ /*------------------------------------------------------------------------- * Function: h5trav_gettable * - * Purpose: get the trav_table_t struct - * - * Return: 0, -1 on error - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 17, 2003 + * Purpose: get the trav_table_t struct * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ - int h5trav_gettable(hid_t fid, trav_table_t *table) { trav_visitor_t table_visitor; /* Visitor structure for trav_table_t's */ + int ret_value = SUCCEED; /* Init visitor structure */ table_visitor.visit_obj = trav_table_visit_obj; @@ -661,71 +603,63 @@ h5trav_gettable(hid_t fid, trav_table_t *table) /* Traverse all objects in the file, visiting each object & link */ if(traverse(fid, "/", TRUE, TRUE, &table_visitor) < 0) - return -1; - return 0; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "traverse failed"); + +done: + return ret_value; } /*------------------------------------------------------------------------- * Function: h5trav_getindext * - * Purpose: get index of NAME in list - * - * Return: index, -1 if not found - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 18, 2003 + * Purpose: get index of NAME in list * + * Return: index on success, + * -1 if not found *------------------------------------------------------------------------- */ - H5_ATTR_PURE int h5trav_getindext(const char *name, const trav_table_t *table) { unsigned int i; - for(i = 0; i < table->nobjs; i++) { - /* Check for object name having full path (with leading '/') */ - if(HDstrcmp(name, table->objs[i].name) == 0) - return((int)i); - - /* Check for object name without leading '/' */ - if(HDstrcmp(name, table->objs[i].name + 1) == 0) - return((int)i); + if(table) { + for(i = 0; i < table->nobjs; i++) { + /* Check for object name having full path (with leading '/') */ + if(HDstrcmp(name, table->objs[i].name) == 0) + return((int)i); - /* search also in the list of links */ - if(table->objs[i].nlinks) { - unsigned int j; + /* Check for object name without leading '/' */ + if(HDstrcmp(name, table->objs[i].name + 1) == 0) + return((int)i); - for ( j=0; jobjs[i].nlinks; j++) { - /* Check for object name having full path (with leading '/') */ - if(HDstrcmp(name, table->objs[i].links[j].new_name) == 0) - return((int)i); + /* search also in the list of links */ + if(table->objs[i].nlinks) { + unsigned int j; - /* Check for object name without leading '/' */ - if(HDstrcmp(name, table->objs[i].links[j].new_name + 1) == 0) - return((int)i); - } /* end for */ - } /* end if */ - } /* end for */ + for ( j=0; jobjs[i].nlinks; j++) { + /* Check for object name having full path (with leading '/') */ + if(HDstrcmp(name, table->objs[i].links[j].new_name) == 0) + return((int)i); + /* Check for object name without leading '/' */ + if(HDstrcmp(name, table->objs[i].links[j].new_name + 1) == 0) + return((int)i); + } /* end for */ + } /* end if */ + } /* end for */ + } return -1; } /*------------------------------------------------------------------------- * Function: trav_table_add * - * Purpose: Add OBJNO, NAME and TYPE of object to table - * - * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 4, 2002 + * Purpose: Add OBJNO, NAME and TYPE of object to table * + * Return: void *------------------------------------------------------------------------- */ - static void trav_table_add(trav_table_t *table, const char *path, @@ -733,20 +667,22 @@ trav_table_add(trav_table_t *table, { size_t new_obj; - if(table->nobjs == table->size) { - table->size = MAX(1, table->size * 2); - table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); - } /* end if */ + if(table) { + if(table->nobjs == table->size) { + table->size = MAX(1, table->size * 2); + table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); + } /* end if */ - new_obj = table->nobjs++; - table->objs[new_obj].objno = oinfo ? oinfo->addr : HADDR_UNDEF; - table->objs[new_obj].flags[0] = table->objs[new_obj].flags[1] = 0; - table->objs[new_obj].is_same_trgobj = 0; - table->objs[new_obj].name = (char *)HDstrdup(path); - table->objs[new_obj].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK; - table->objs[new_obj].nlinks = 0; - table->objs[new_obj].sizelinks = 0; - table->objs[new_obj].links = NULL; + new_obj = table->nobjs++; + table->objs[new_obj].objno = oinfo ? oinfo->addr : HADDR_UNDEF; + table->objs[new_obj].flags[0] = table->objs[new_obj].flags[1] = 0; + table->objs[new_obj].is_same_trgobj = 0; + table->objs[new_obj].name = (char *)HDstrdup(path); + table->objs[new_obj].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK; + table->objs[new_obj].nlinks = 0; + table->objs[new_obj].sizelinks = 0; + table->objs[new_obj].links = NULL; + } } /*------------------------------------------------------------------------- @@ -755,58 +691,47 @@ trav_table_add(trav_table_t *table, * Purpose: Add a hardlink name to the object * * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 17, 2003 - * *------------------------------------------------------------------------- */ - static void trav_table_addlink(trav_table_t *table, haddr_t objno, const char *path) { size_t i; /* Local index variable */ - for(i = 0; i < table->nobjs; i++) { - if(table->objs[i].objno == objno) { - size_t n; + if(table) { + for(i = 0; i < table->nobjs; i++) { + if(table->objs[i].objno == objno) { + size_t n; - /* already inserted? */ - if(HDstrcmp(table->objs[i].name, path) == 0) - return; + /* already inserted? */ + if(HDstrcmp(table->objs[i].name, path) == 0) + return; - /* allocate space if necessary */ - if(table->objs[i].nlinks == (unsigned)table->objs[i].sizelinks) { - table->objs[i].sizelinks = MAX(1, table->objs[i].sizelinks * 2); - table->objs[i].links = (trav_link_t *)HDrealloc(table->objs[i].links, table->objs[i].sizelinks * sizeof(trav_link_t)); - } /* end if */ + /* allocate space if necessary */ + if(table->objs[i].nlinks == (unsigned)table->objs[i].sizelinks) { + table->objs[i].sizelinks = MAX(1, table->objs[i].sizelinks * 2); + table->objs[i].links = (trav_link_t *)HDrealloc(table->objs[i].links, table->objs[i].sizelinks * sizeof(trav_link_t)); + } /* end if */ - /* insert it */ - n = table->objs[i].nlinks++; - table->objs[i].links[n].new_name = (char *)HDstrdup(path); + /* insert it */ + n = table->objs[i].nlinks++; + table->objs[i].links[n].new_name = (char *)HDstrdup(path); - return; + return; + } /* end for */ } /* end for */ - } /* end for */ + } } - /*------------------------------------------------------------------------- * Function: trav_table_addflags * - * Purpose: Add FLAGS, NAME and TYPE of object to table - * - * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 4, 2002 + * Purpose: Add FLAGS, NAME and TYPE of object to table * + * Return: void *------------------------------------------------------------------------- */ - void trav_table_addflags(unsigned *flags, char *name, h5trav_type_t type, @@ -814,92 +739,83 @@ void trav_table_addflags(unsigned *flags, { size_t new_obj; - if(table->nobjs == table->size) { - table->size = MAX(1, table->size * 2); - table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); - } /* end if */ + if(table) { + if(table->nobjs == table->size) { + table->size = MAX(1, table->size * 2); + table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); + } /* end if */ - new_obj = table->nobjs++; - table->objs[new_obj].objno = 0; - table->objs[new_obj].flags[0] = flags[0]; - table->objs[new_obj].flags[1] = flags[1]; - table->objs[new_obj].is_same_trgobj = 0; - table->objs[new_obj].name = (char *)HDstrdup(name); - table->objs[new_obj].type = type; - table->objs[new_obj].nlinks = 0; - table->objs[new_obj].sizelinks = 0; - table->objs[new_obj].links = NULL; + new_obj = table->nobjs++; + table->objs[new_obj].objno = 0; + table->objs[new_obj].flags[0] = flags[0]; + table->objs[new_obj].flags[1] = flags[1]; + table->objs[new_obj].is_same_trgobj = 0; + table->objs[new_obj].name = (char *)HDstrdup(name); + table->objs[new_obj].type = type; + table->objs[new_obj].nlinks = 0; + table->objs[new_obj].sizelinks = 0; + table->objs[new_obj].links = NULL; + } } /*------------------------------------------------------------------------- * Function: trav_table_init * - * Purpose: Initialize the table - * - * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 4, 2002 + * Purpose: Initialize the table * + * Return: void *------------------------------------------------------------------------- */ - void trav_table_init(trav_table_t **tbl) { trav_table_t* table = (trav_table_t*) HDmalloc(sizeof(trav_table_t)); - - table->size = 0; - table->nobjs = 0; - table->objs = NULL; - + if(table) { + table->size = 0; + table->nobjs = 0; + table->objs = NULL; + } *tbl = table; } - /*------------------------------------------------------------------------- * Function: trav_table_free * - * Purpose: free table memory - * - * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 4, 2002 + * Purpose: free table memory * + * Return: void *------------------------------------------------------------------------- */ - -void trav_table_free( trav_table_t *table ) +void trav_table_free(trav_table_t *table) { - if(table->objs) { - unsigned int i; + if(table) { + if(table->objs) { + unsigned int i; - for(i = 0; i < table->nobjs; i++) { - HDfree(table->objs[i].name ); - if(table->objs[i].nlinks) { - unsigned int j; + for(i = 0; i < table->nobjs; i++) { + HDfree(table->objs[i].name ); + if(table->objs[i].nlinks) { + unsigned int j; - for(j = 0; j < table->objs[i].nlinks; j++) - HDfree(table->objs[i].links[j].new_name); + for(j = 0; j < table->objs[i].nlinks; j++) + HDfree(table->objs[i].links[j].new_name); - HDfree(table->objs[i].links); - } /* end if */ - } /* end for */ - HDfree(table->objs); - } /* end if */ - HDfree(table); + HDfree(table->objs[i].links); + } /* end if */ + } /* end for */ + HDfree(table->objs); + } /* end if */ + HDfree(table); + } } static herr_t trav_attr(hid_t #ifndef H5TRAV_PRINT_SPACE -H5_ATTR_UNUSED + H5_ATTR_UNUSED #endif /* H5TRAV_PRINT_SPACE */ -obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *_op_data) + obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *_op_data) { trav_path_op_data_t *op_data = (trav_path_op_data_t *)_op_data; const char *buf = op_data->path; @@ -938,7 +854,7 @@ obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *_op_da case H5S_SIMPLE: /* simple dataspace */ printf(" {"); - for (i=0; iu.val_size > 0) { - char *targbuf; + char *targbuf = NULL; const char *filename = NULL; const char *objname = NULL; @@ -1097,22 +1005,18 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) /*------------------------------------------------------------------------- * Function: h5trav_print * - * Purpose: Print information about the objects & links in the file - * - * Return: 0, -1 on error - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 6, 2007 + * Purpose: Print information about the objects & links in the file * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ - int h5trav_print(hid_t fid) { trav_print_udata_t print_udata; /* User data for traversal */ trav_visitor_t print_visitor; /* Visitor structure for printing objects */ + int ret_value = SUCCEED; /* Init user data for printing */ print_udata.fid = fid; @@ -1124,9 +1028,10 @@ h5trav_print(hid_t fid) /* Traverse all objects in the file, visiting each object & link */ if(traverse(fid, "/", TRUE, TRUE, &print_visitor) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "traverse failed"); - return 0; +done: + return ret_value; } @@ -1135,21 +1040,17 @@ h5trav_print(hid_t fid) * * Purpose: Generic traversal routine for visiting objects and links * - * Return: 0, -1 on error - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: November 6, 2007 - * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ - int h5trav_visit(hid_t fid, const char *grp_name, hbool_t visit_start, hbool_t recurse, h5trav_obj_func_t visit_obj, h5trav_lnk_func_t visit_lnk, void *udata) { trav_visitor_t visitor; /* Visitor structure for objects */ + int ret_value = SUCCEED; /* Init visitor structure */ visitor.visit_obj = visit_obj; @@ -1158,9 +1059,10 @@ h5trav_visit(hid_t fid, const char *grp_name, hbool_t visit_start, /* Traverse all objects in the file, visiting each object & link */ if(traverse(fid, grp_name, visit_start, recurse, &visitor) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "traverse failed"); - return 0; +done: + return ret_value; } /*------------------------------------------------------------------------- @@ -1168,19 +1070,15 @@ h5trav_visit(hid_t fid, const char *grp_name, hbool_t visit_start, * * Purpose: Add an symbolic link to visited data structure * - * Return: 0 on success, -1 on failure - * - * Programmer: Neil Fortner, nfortne2@hdfgroup.org - * Adapted from trav_addr_add in h5trav.c by Quincey Koziol - * - * Date: September 5, 2008 - * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ herr_t symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path) { - size_t idx; /* Index of address to use */ + herr_t ret_value = SUCCEED; + size_t idx; /* Index of address to use */ /* Allocate space if necessary */ if(visited->nused == visited->nalloc) { @@ -1188,7 +1086,7 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co visited->nalloc = MAX(1, visited->nalloc * 2); if(NULL == (tmp_ptr = HDrealloc(visited->objs, visited->nalloc * sizeof(symlink_trav_path_t)))) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "visited data structure realloc failed"); visited->objs = (symlink_trav_path_t *)tmp_ptr; } /* end if */ @@ -1202,7 +1100,7 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co if(type == H5L_TYPE_EXTERNAL) { if(NULL == (visited->objs[idx].file = HDstrdup(file))) { visited->nused--; - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "visited data structure name allocation failed"); } /* end if */ } /* end if */ @@ -1210,25 +1108,20 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co visited->nused--; if(visited->objs[idx].file) HDfree (visited->objs[idx].file); - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "visited data structure path allocation failed"); } /* end if */ - return 0; +done: + return ret_value; } /* end symlink_visit_add() */ /*------------------------------------------------------------------------- * Function: symlink_is_visited * - * Purpose: Check if an symbolic link has already been visited - * - * Return: TRUE/FALSE - * - * Programmer: Neil Fortner, nfortne2@hdfgroup.org - * Adapted from trav_addr_visited in h5trav.c by Quincey Koziol - * - * Date: September 5, 2008 + * Purpose: Check if an symbolic link has already been visited * + * Return: TRUE/FALSE *------------------------------------------------------------------------- */ H5_ATTR_PURE hbool_t diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 9fcf218..7c3dfa5 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -78,23 +78,21 @@ static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t * * Return: 0, ok, * -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October, 23, 2003 - * *------------------------------------------------------------------------- */ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) { - int ret_value = 0; /* no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t fidin; + int ret_value = 0; + hid_t fidin = -1; hid_t fidout = -1; - trav_table_t *travt = NULL; - hsize_t ub_size = 0; /* size of user block */ + hid_t fcpl_in = -1; /* file creation property list ID for input file */ + hid_t grp_in = -1; /* group ID */ + hid_t gcpl_in = -1; /* group creation property list */ hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */ hid_t fapl = H5P_DEFAULT; /* file access property list ID */ + trav_table_t *travt = NULL; + hsize_t ub_size = 0; /* size of user block */ H5F_fspace_strategy_t set_strategy; /* Strategy to be set in outupt file */ hbool_t set_persist; /* Persist free-space status to be set in output file */ hsize_t set_threshold; /* Free-space section threshold to be set in output file */ @@ -114,10 +112,6 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) /* get user block size and file space strategy/persist/threshold */ { - hid_t fcpl_in; /* file creation property list ID for input file */ - hid_t grp_in = -1; /* group ID */ - hid_t gcpl_in = -1; /* group creation property list */ - if ((fcpl_in = H5Fget_create_plist(fidin)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list"); @@ -343,42 +337,26 @@ print_user_block(fnamein, fidin); /* init table */ trav_table_init(&travt); - /* get the list of objects in the file */ - if (h5trav_gettable(fidin, travt) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed"); - - /*------------------------------------------------------------------------- - * do the copy - *------------------------------------------------------------------------- - */ - if (do_copy_objects(fidin, fidout, travt, options) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_objects from <%s> could not copy data to <%s>", fnamein, fnameout); - - /*------------------------------------------------------------------------- - * do the copy of referenced objects - * and create hard links - *------------------------------------------------------------------------- - */ - if (do_copy_refobjs(fidin, fidout, travt, options) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_refobjs from <%s> could not copy data to <%s>", fnamein, fnameout); - - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - - if (fapl > 0) - H5Pclose(fapl); - - if (fcpl > 0) - H5Pclose(fcpl); - - H5Fclose(fidin); - H5Fclose(fidout); - - /* free table */ - trav_table_free(travt); - travt = NULL; + if (travt) { + /* get the list of objects in the file */ + if (h5trav_gettable(fidin, travt) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed"); + + /*------------------------------------------------------------------------- + * do the copy + *------------------------------------------------------------------------- + */ + if (do_copy_objects(fidin, fidout, travt, options) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_objects from <%s> could not copy data to <%s>", fnamein, fnameout); + + /*------------------------------------------------------------------------- + * do the copy of referenced objects + * and create hard links + *------------------------------------------------------------------------- + */ + if (do_copy_refobjs(fidin, fidout, travt, options) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_refobjs from <%s> could not copy data to <%s>", fnamein, fnameout); + } /*------------------------------------------------------------------------- * write only the input file user block if there is no user block file input @@ -389,17 +367,15 @@ print_user_block(fnamein, fidin); if (copy_user_block(fnamein, fnameout, ub_size) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not copy user block. Exiting..."); - return 0; - - /*------------------------------------------------------------------------- - * out - *------------------------------------------------------------------------- - */ - done: H5E_BEGIN_TRY { + H5Pclose(fcpl_in); + H5Pclose(gcpl_in); H5Pclose(fapl); H5Pclose(fcpl); + H5Gclose(grp_in); + H5Fclose(fidin); + H5Fclose(fidout); H5Fclose(fidin); H5Fclose(fidout); } H5E_END_TRY; @@ -416,7 +392,7 @@ done: * The size of hyperslab is limitted by H5TOOLS_BUFSIZE. * Return the hyperslab dimentions and size in byte. * - * Return: 0 - SUCCEED, -1 FAILED + * Return: 0 - SUCCEED, -1 FAILED * * Parameters: * dcpl_id : [IN] dataset creation property. @@ -426,8 +402,6 @@ done: * dims_hslab[] : [OUT] calculated hyperslab dimentions * * hslab_nbytes_p : [OUT] total byte of the hyperslab * - * Programmer: Jonathan Kim - * Date: Feburary, 2012 * Update: * The hyperslab calucation would be depend on if the dataset is chunked * or not. @@ -441,25 +415,23 @@ done: * the boundary would be dataset's dims. * * The calulation starts from the last dimention (h5dump dims output). - * - * Note: - * Added for JIRA HDFFV-7862. *-----------------------------------------*/ -int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], +int +Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; int k; H5D_layout_t dset_layout; int rank_chunk; hsize_t dims_chunk[H5S_MAX_RANK]; hsize_t size_chunk = 1; - hsize_t nchunk_fit; /* number of chunks that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ - hsize_t ndatum_fit; /* number of dataum that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ + hsize_t nchunk_fit; /* number of chunks that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ + hsize_t ndatum_fit; /* number of dataum that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ hsize_t chunk_dims_map[H5S_MAX_RANK]; /* mapped chunk dimentions */ - hsize_t hs_dims_map[H5S_MAX_RANK]; /* mapped hyperslab dimentions */ - hsize_t hslab_nbytes; /* size of hyperslab in byte */ + hsize_t hs_dims_map[H5S_MAX_RANK]; /* mapped hyperslab dimentions */ + hsize_t hslab_nbytes; /* size of hyperslab in byte */ /* init to set as size of a data element */ hslab_nbytes = size_datum; @@ -572,24 +544,9 @@ done: /*------------------------------------------------------------------------- * Function: do_copy_objects * - * Purpose: duplicate all HDF5 objects in the file - * - * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October, 23, 2003 - * - * Modifications: - * - * July 2004: Introduced the extra EC or NN option for SZIP - * - * December 2004: Added a check for H5Dcreate; if the dataset cannot be created - * with the requested filter, use the input one - * - * October 2006: Read/write using the file type by default. + * Purpose: duplicate all HDF5 objects in the file * - * October 2006: Read by hyperslabs for big datasets. + * Return: 0, ok, -1 no * * A threshold of H5TOOLS_MALLOCSIZE (128 MB) is the limit upon which I/O hyperslab is done * i.e., if the memory needed to read a dataset is greater than this limit, @@ -630,31 +587,6 @@ done: * in (2) is that, when using the strip mine size, it assures that the "remaining" part * of the dataset that does not fill an entire strip mine is processed. * - * November 2006: Use H5Ocopy in the copy of objects. The logic for using - * H5Ocopy or not is if a change of filters or layout is requested by the user - * then use read/write else use H5Ocopy. - * - * May, 1, 2008: Add a printing of the compression ratio of old size / new size - * - * Feburary 2012: improve Read/Write by hyperslabs for big datasets. - * Programmer: Jonathan Kim - * - * A threshold of H5TOOLS_MALLOCSIZE is the limit upon which I/O hyperslab is done - * i.e., if the memory needed to read a dataset is greater than this limit, - * then hyperslab I/O is done instead of one operation I/O - * For each dataset, the memory needed is calculated according to - * - * memory needed = number of elements * size of each element - * - * if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations - * are done - * - * H5Dread( input_dataset ) - * H5Dwrite( output_dataset ) - * - * with all elements in the datasets selected. If the memory needed is greater than - * H5TOOLS_MALLOCSIZE, then the following operations are done instead: - * * 1. figure out a hyperslab (dimentions) and size (refer to Get_hyperslab()). * 2. Calculate the hyperslab selections as the selection is moving forward. * Selection would be same as the hyperslab except for the remaining edge portion @@ -666,7 +598,7 @@ done: int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *options) /* repack options */ { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; hid_t grp_in = -1; /* group ID */ hid_t grp_out = -1; /* group ID */ hid_t dset_in = -1; /* read dataset ID */ @@ -1310,10 +1242,10 @@ done: * Function: print_dataset_info * * Purpose: print name, filters, percentage compression of a dataset - * *------------------------------------------------------------------------- */ -static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr) +static void +print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr) { char strfilter[255]; #if defined (PRINT_DEBUG ) @@ -1325,7 +1257,7 @@ static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int p unsigned cd_values[20]; /* filter client data values */ size_t cd_nelmts; /* filter client number of values */ char f_objname[256]; /* filter objname */ - int i; + int i; HDstrcpy(strfilter, "\0"); @@ -1417,19 +1349,15 @@ static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int p /*------------------------------------------------------------------------- * Function: copy_user_block * - * Purpose: copy user block from one file to another - * - * Return: 0, ok, -1 no - * - * Programmer: Peter Cao - * - * Date: October, 25, 2007 + * Purpose: copy user block from one file to another * + * Return: 0, ok, -1 no *------------------------------------------------------------------------- */ -static int copy_user_block(const char *infile, const char *outfile, hsize_t size) +static int +copy_user_block(const char *infile, const char *outfile, hsize_t size) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; int infid = -1, outfid = -1; /* File descriptors */ /* User block must be any power of 2 equal to 512 or greater (512, 1024, 2048, etc.) */ @@ -1491,21 +1419,17 @@ done: /*------------------------------------------------------------------------- * Function: print_user_block * - * Purpose: print user block - * - * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente - * - * Date: August, 20, 2008 + * Purpose: print user block * + * Return: 0, ok, -1 no *------------------------------------------------------------------------- */ #if defined (H5REPACK_DEBUG_USER_BLOCK) static -void print_user_block(const char *filename, hid_t fid) +void +print_user_block(const char *filename, hid_t fid) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; int fh; /* file handle */ hsize_t ub_size; /* user block size */ hsize_t size; /* size read */ -- cgit v0.12 From 448217e7e3f15ed6aee5595a6f8bbe7db0abcb56 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 16 Oct 2017 09:19:41 -0500 Subject: HDFFV-10297 Fix compiler compaliants --- tools/lib/h5diff.c | 12 ++++++++---- tools/lib/h5tools_dump.c | 3 +-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 285ec60..a584bf2 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -1061,11 +1061,13 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, /* make full path for obj1 */ #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ - if(HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) + if(HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) { HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + } #else /* H5_HAVE_ASPRINTF */ - if((obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) + if((obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) { HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + } else { HDstrcpy(obj1_fullpath, grp1_path); HDstrcat(obj1_fullpath, table->objs[i].name); @@ -1075,11 +1077,13 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, /* make full path for obj2 */ #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ - if(HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) + if(HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) { HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + } #else /* H5_HAVE_ASPRINTF */ - if((obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) + if((obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) { HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + } else { HDstrcpy(obj2_fullpath, grp2_path); HDstrcat(obj2_fullpath, table->objs[i].name); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 7c88151..f987296 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -642,8 +642,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ - if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL) - { + if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL) { HERROR(H5E_tools_g, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); HGOTO_DONE(dimension_break); } -- cgit v0.12 From e0bbff9d46eabbbc3a6d63f5b2f5e2f7ca0ed217 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 16 Oct 2017 10:56:54 -0500 Subject: Fix VS2012 declaration error --- tools/lib/h5diff_attr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index f381393..64038f3 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -345,12 +345,12 @@ hsize_t diff_attr(hid_t loc1_id, hsize_t nfound_total = 0; int j; - /* Initialize error status */ - options->err_stat = 1; - table_attrs_t *match_list_attrs = NULL; h5difftrace("diff_attr start\n"); + /* Initialize error status */ + options->err_stat = 1; + if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, options) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "build_match_list_attrs failed"); -- cgit v0.12 From 2cbdf46cb9ecd93803aaf5dca22f1f847e505bee Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 16 Oct 2017 17:26:23 -0500 Subject: HDFFV-10297 add h5copy test and fix h5diff errors --- MANIFEST | 5 + tools/lib/h5diff.c | 212 ++--- tools/lib/h5diff.h | 22 +- tools/lib/h5diff_array.c | 1005 +++++++++++----------- tools/lib/h5diff_attr.c | 32 +- tools/lib/h5diff_dset.c | 77 +- tools/lib/h5tools_filters.c | 2 +- tools/lib/ph5diff.h | 2 +- tools/src/h5diff/h5diff_common.c | 82 +- tools/src/h5diff/h5diff_common.h | 4 +- tools/src/h5diff/h5diff_main.c | 12 +- tools/src/h5diff/ph5diff_main.c | 18 +- tools/src/h5repack/h5repack.c | 12 +- tools/test/h5copy/CMakeLists.txt | 48 +- tools/test/h5copy/CMakeTests.cmake | 122 ++- tools/test/h5copy/dynlib_copy.c | 89 ++ tools/test/h5copy/testfiles/tudfilter.h5 | Bin 0 -> 4816 bytes tools/test/h5copy/testfiles/tudfilter.h5.txt | 2 + tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt | 2 + tools/test/h5copy/testfiles/tudfilter2.h5 | Bin 0 -> 4816 bytes tools/test/h5diff/testfiles/h5diff_454_ERR.err | 2 +- tools/test/h5diff/testfiles/h5diff_454_ERR.txt | 2 +- tools/test/h5diff/testfiles/h5diff_455_ERR.err | 2 +- tools/test/h5diff/testfiles/h5diff_455_ERR.txt | 2 +- tools/test/h5diff/testfiles/h5diff_457_ERR.err | 2 +- tools/test/h5diff/testfiles/h5diff_457_ERR.txt | 2 +- tools/test/h5diff/testfiles/h5diff_458_ERR.err | 2 +- tools/test/h5diff/testfiles/h5diff_458_ERR.txt | 2 +- tools/test/h5diff/testfiles/h5diff_459_ERR.err | 2 +- tools/test/h5diff/testfiles/h5diff_459_ERR.txt | 2 +- 30 files changed, 1002 insertions(+), 766 deletions(-) create mode 100644 tools/test/h5copy/dynlib_copy.c create mode 100644 tools/test/h5copy/testfiles/tudfilter.h5 create mode 100644 tools/test/h5copy/testfiles/tudfilter.h5.txt create mode 100644 tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt create mode 100644 tools/test/h5copy/testfiles/tudfilter2.h5 diff --git a/MANIFEST b/MANIFEST index f194f72..0e59ba0 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1433,6 +1433,7 @@ ./tools/test/h5copy/Makefile.am ./tools/test/h5copy/h5copygentest.c ./tools/test/h5copy/testh5copy.sh.in +./tools/test/h5copy/dynlib_copy.c ./tools/lib/Makefile.am @@ -2523,6 +2524,10 @@ ./tools/test/h5copy/testfiles/h5copy_misc1.out ./tools/test/h5copy/testfiles/h5copytst_new.h5 ./tools/test/h5copy/testfiles/h5copytst_new.out.ls +./tools/test/h5diff/testfiles/tudfilter.h5 +./tools/test/h5diff/testfiles/tudfilter2.h5 +./tools/test/h5diff/testfiles/tudfilter.h5.txt +./tools/test/h5diff/testfiles/tudfilter.h5_ERR.txt # test files for h5mkgrp ./tools/testfiles/h5mkgrp_nested_p.ls diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index a584bf2..ab5d125 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -27,9 +27,9 @@ *------------------------------------------------------------------------- */ H5_ATTR_PURE int -print_objname (diff_opt_t * options, hsize_t nfound) +print_objname (diff_opt_t * opts, hsize_t nfound) { - return ((options->m_verbose || nfound) && !options->m_quiet) ? 1 : 0; + return ((opts->m_verbose || nfound) && !opts->m_quiet) ? 1 : 0; } /*------------------------------------------------------------------------- @@ -72,9 +72,9 @@ do_print_attrname (const char *attr, const char *path1, const char *path2) *------------------------------------------------------------------------- */ static int -print_warn(diff_opt_t *options) +print_warn(diff_opt_t *opts) { - return ((options->m_verbose)) ? 1: 0; + return ((opts->m_verbose)) ? 1: 0; } @@ -135,23 +135,23 @@ print_incoming_data(void) * 0 : Not valid *------------------------------------------------------------------------*/ static int -is_valid_options(diff_opt_t *options) +is_valid_options(diff_opt_t *opts) { int ret_value = 1; /* init to valid */ /*----------------------------------------------- * no -q(quiet) with -v (verbose) or -r (report) */ - if(options->m_quiet && (options->m_verbose || options->m_report)) { + if(opts->m_quiet && (opts->m_verbose || opts->m_report)) { parallel_print("Error: -q (quiet mode) cannot be added to verbose or report modes\n"); - options->err_stat = 1; + opts->err_stat = 1; HGOTO_DONE(0); } /* ------------------------------------------------------- * only allow --no-dangling-links along with --follow-symlinks */ - if(options->no_dangle_links && !options->follow_links) { + if(opts->no_dangle_links && !opts->follow_links) { parallel_print("Error: --no-dangling-links must be used along with --follow-symlinks option.\n"); - options->err_stat = 1; + opts->err_stat = 1; HGOTO_DONE(0); } @@ -170,18 +170,18 @@ done: * 0 - not excluded path *------------------------------------------------------------------------*/ static int -is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options) +is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *opts) { struct exclude_path_list * exclude_path_ptr; int ret_cmp; int ret_value = 0; /* check if exclude path option is given */ - if (!options->exclude_path) + if (!opts->exclude_path) HGOTO_DONE(0); /* assign to local exclude list pointer */ - exclude_path_ptr = options->exclude; + exclude_path_ptr = opts->exclude; /* search objects in exclude list */ while (NULL != exclude_path_ptr) { @@ -232,9 +232,9 @@ done: * Purpose: free exclude object list from diff options *------------------------------------------------------------------------*/ static void -free_exclude_path_list(diff_opt_t *options) +free_exclude_path_list(diff_opt_t *opts) { - struct exclude_path_list *curr = options->exclude; + struct exclude_path_list *curr = opts->exclude; struct exclude_path_list *next; while (NULL != curr) { @@ -260,7 +260,7 @@ free_exclude_path_list(diff_opt_t *options) *------------------------------------------------------------------------*/ static void build_match_list (const char *objname1, trav_info_t *info1, const char *objname2, trav_info_t *info2, - trav_table_t ** table_out, diff_opt_t *options) + trav_table_t ** table_out, diff_opt_t *opts) { size_t curr1 = 0; size_t curr2 = 0; @@ -306,7 +306,7 @@ build_match_list (const char *objname1, trav_info_t *info1, const char *objname2 /* criteria is string compare */ cmp = HDstrcmp(path1_lp, path2_lp); if(cmp == 0) { - if(!is_exclude_path(path1_lp, type1_l, options)) { + if(!is_exclude_path(path1_lp, type1_l, opts)) { infile[0] = 1; infile[1] = 1; trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table); @@ -322,7 +322,7 @@ build_match_list (const char *objname1, trav_info_t *info1, const char *objname2 curr2++; } /* end if */ else if(cmp < 0) { - if(!is_exclude_path(path1_lp, type1_l, options)) { + if(!is_exclude_path(path1_lp, type1_l, opts)) { infile[0] = 1; infile[1] = 0; trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table); @@ -330,7 +330,7 @@ build_match_list (const char *objname1, trav_info_t *info1, const char *objname2 curr1++; } /* end else-if */ else { - if (!is_exclude_path(path2_lp, type2_l, options)) { + if (!is_exclude_path(path2_lp, type2_l, opts)) { infile[0] = 0; infile[1] = 1; trav_table_addflags(infile, path2_lp, info2->paths[curr2].type, table); @@ -346,7 +346,7 @@ build_match_list (const char *objname1, trav_info_t *info1, const char *objname2 path1_lp = (info1->paths[curr1].path) + path1_offset; type1_l = info1->paths[curr1].type; - if(!is_exclude_path(path1_lp, type1_l, options)) { + if(!is_exclude_path(path1_lp, type1_l, opts)) { trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table); } curr1++; @@ -359,13 +359,13 @@ build_match_list (const char *objname1, trav_info_t *info1, const char *objname2 path2_lp = (info2->paths[curr2].path) + path2_offset; type2_l = info2->paths[curr2].type; - if (!is_exclude_path(path2_lp, type2_l, options)) { + if (!is_exclude_path(path2_lp, type2_l, opts)) { trav_table_addflags(infile, path2_lp, info2->paths[curr2].type, table); } curr2++; } /* end while */ - free_exclude_path_list (options); + free_exclude_path_list (opts); *table_out = table; h5difftrace("build_match_list finish\n"); @@ -764,7 +764,7 @@ h5diff(const char *fname1, if (l_ret1 != 0 || l_ret2 != 0) { nfound++; print_found(nfound); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5tools_get_symlink_info error"); + HGOTO_DONE(0); } } } @@ -804,10 +804,10 @@ h5diff(const char *fname1, else { if(opts->m_verbose) parallel_print("obj2 <%s> is a dangling link.\n", obj2fullname); - if (l_ret1 != 0 || l_ret2 != 0) { + if (l_ret1 != 0 || l_ret2 != 0) { nfound++; print_found(nfound); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5tools_get_symlink_info error"); + HGOTO_DONE(0); } } } @@ -842,7 +842,7 @@ h5diff(const char *fname1, /* if no danglink links */ if (l_ret1 > 0 && l_ret2 > 0) if (h5tools_is_obj_same(file1_id, obj1fullname, file2_id, obj2fullname)!=0) - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Same object"); + HGOTO_DONE(0); } both_objs_grp = (obj1type == H5TRAV_TYPE_GROUP && obj2type == H5TRAV_TYPE_GROUP); @@ -903,8 +903,7 @@ h5diff(const char *fname1, /*------------------------------------------------------ * print the list */ - if(opts->m_verbose) - { + if(opts->m_verbose) { unsigned u; parallel_print("\n"); @@ -927,7 +926,7 @@ h5diff(const char *fname1, file2_id, obj2fullname, info2_lp, match_list, opts); - opts->err_stat = 1; /* success status */ + opts->err_stat = 0; /* success status */ done: #ifdef H5_HAVE_PARALLEL @@ -991,7 +990,7 @@ done: hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, const char *grp2, trav_info_t *info2, - trav_table_t *table, diff_opt_t *options) + trav_table_t *table, diff_opt_t *opts) { hsize_t nfound = 0; unsigned i; @@ -1023,17 +1022,17 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, */ /* not valid compare used when --exclude-path option is used */ - if (!options->exclude_path) { + if (!opts->exclude_path) { /* number of different objects */ if (info1->nused != info2->nused) { - options->contents = 0; + opts->contents = 0; } } /* objects in one file and not the other */ for(i = 0; i < table->nobjs; i++) { if(table->objs[i].flags[0] != table->objs[i].flags[1]) { - options->contents = 0; + opts->contents = 0; break; } } @@ -1073,6 +1072,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, HDstrcat(obj1_fullpath, table->objs[i].name); } #endif /* H5_HAVE_ASPRINTF */ + h5diffdebug2("diff_match path1 - %s\n", obj1_fullpath); /* make full path for obj2 */ #ifdef H5_HAVE_ASPRINTF @@ -1089,6 +1089,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, HDstrcat(obj2_fullpath, table->objs[i].name); } #endif /* H5_HAVE_ASPRINTF */ + h5diffdebug2("diff_match path2 - %s\n", obj2_fullpath); /* get index to figure out type of the object in file1 */ while(info1->paths[idx1].path && (HDstrcmp(obj1_fullpath, info1->paths[idx1].path) != 0)) @@ -1102,11 +1103,11 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, argdata.type[1] = info2->paths[idx2].type; argdata.is_same_trgobj = table->objs[i].is_same_trgobj; - options->cmn_objs = 1; + opts->cmn_objs = 1; if(!g_Parallel) { nfound += diff(file1_id, obj1_fullpath, file2_id, obj2_fullpath, - options, &argdata); + opts, &argdata); } /* end if */ #ifdef H5_HAVE_PARALLEL else { @@ -1131,7 +1132,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, /* set args struct to pass */ HDstrcpy(args.name1, obj1_fullpath); HDstrcpy(args.name2, obj2_fullpath); - args.options = *options; + args.opts = *opts; args.argdata.type[0] = info1->paths[idx1].type; args.argdata.type[1] = info2->paths[idx2].type; args.argdata.is_same_trgobj = table->objs[i].is_same_trgobj; @@ -1148,7 +1149,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, workerTasks[Status.MPI_SOURCE - 1] = 1; MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; } /* end if */ @@ -1165,7 +1166,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, workerTasks[Status.MPI_SOURCE - 1] = 1; MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; havePrintToken = 1; } /* end if */ @@ -1217,7 +1218,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); havePrintToken = 1; nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; /* send this task the work unit. */ MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD); } /* end if */ @@ -1231,7 +1232,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, if(Status.MPI_TAG == MPI_TAG_DONE) { MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD); } /* end if */ else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST) { @@ -1248,7 +1249,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD); } /* end else-if */ else { @@ -1276,7 +1277,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, if(Status.MPI_TAG == MPI_TAG_DONE) { MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; } /* end if */ else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST) { @@ -1294,7 +1295,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; } /* end if */ /* someone else must have it...wait for them to return it, then give it to the task that just asked for it. */ @@ -1311,7 +1312,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; MPI_Send(NULL, 0, MPI_BYTE, source, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD); } /* end else */ @@ -1319,7 +1320,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, else if(Status.MPI_TAG == MPI_TAG_TOK_RETURN) { MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; havePrintToken = 1; } /* end else-if */ @@ -1353,7 +1354,7 @@ out: /* free table */ if (table) trav_table_free(table); - h5difftrace("diff_match finish\n"); + h5diffdebug2("diff_match finish:%d\n", nfound); return nfound; } @@ -1377,7 +1378,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, - diff_opt_t * options, + diff_opt_t * opts, diff_args_t *argdata) { int ret_value = 0; @@ -1400,14 +1401,14 @@ diff(hid_t file1_id, h5difftrace("diff start\n"); /*init error status */ - options->err_stat = 1; + opts->err_stat = 1; /*init link info struct */ HDmemset(&linkinfo1, 0, sizeof(h5tool_link_info_t)); HDmemset(&linkinfo2, 0, sizeof(h5tool_link_info_t)); /* pass how to handle printing warnings to linkinfo option */ - if(print_warn(options)) + if(print_warn(opts)) linkinfo1.opt.msg_mode = linkinfo2.opt.msg_mode = 1; /* for symbolic links, take care follow symlink and no dangling link @@ -1421,14 +1422,14 @@ diff(hid_t file1_id, */ /* target object1 - get type and name */ - if ((ret_value = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, options->follow_links)) < 0) + if ((ret_value = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, opts->follow_links)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5tools_get_symlink_info failed"); /* dangling link */ if (ret_value == 0) { - if (options->no_dangle_links) { + if (opts->no_dangle_links) { /* dangling link is error */ - if(options->m_verbose) + if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path1); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "dangling link is error"); } @@ -1437,13 +1438,13 @@ diff(hid_t file1_id, } /* target object2 - get type and name */ - if ((ret_value = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, options->follow_links)) < 0) + if ((ret_value = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, opts->follow_links)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5tools_get_symlink_info failed"); /* dangling link */ if (ret_value == 0) { - if (options->no_dangle_links) { + if (opts->no_dangle_links) { /* dangling link is error */ - if(options->m_verbose) + if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path2); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "dangling link is error"); } @@ -1453,12 +1454,12 @@ diff(hid_t file1_id, /* found dangling link */ if (is_dangle_link1 || is_dangle_link2) { - options->err_stat = 0; + opts->err_stat = 0; HGOTO_DONE(0); } /* follow symbolic link option */ - if (options->follow_links) { + if (opts->follow_links) { if (linkinfo1.linfo.type == H5L_TYPE_SOFT || linkinfo1.linfo.type == H5L_TYPE_EXTERNAL) argdata->type[0] = (h5trav_type_t)linkinfo1.trg_type; @@ -1469,16 +1470,16 @@ diff(hid_t file1_id, } /* if objects are not the same type */ if (argdata->type[0] != argdata->type[1]) { - if (options->m_verbose||options->m_list_not_cmp) { + if (opts->m_verbose||opts->m_list_not_cmp) { parallel_print("Not comparable: <%s> is of type %s and <%s> is of type %s\n", path1, get_type(argdata->type[0]), path2, get_type(argdata->type[1])); } - options->not_cmp = 1; + opts->not_cmp = 1; /* TODO: will need to update non-comparable is different - * options->contents = 0; + * opts->contents = 0; */ - options->err_stat = 0; + opts->err_stat = 0; HGOTO_DONE(0); } else /* now both object types are same */ @@ -1497,41 +1498,41 @@ diff(hid_t file1_id, is_hard_link = (object_type == H5TRAV_TYPE_DATASET || object_type == H5TRAV_TYPE_NAMED_DATATYPE || object_type == H5TRAV_TYPE_GROUP); - if (options->follow_links || is_hard_link) { + if (opts->follow_links || is_hard_link) { /* print information is only verbose option is used */ - if(options->m_verbose || options->m_report) { + if(opts->m_verbose || opts->m_report) { switch(object_type) { case H5TRAV_TYPE_DATASET: - do_print_objname("dataset", path1, path2, options); + do_print_objname("dataset", path1, path2, opts); break; case H5TRAV_TYPE_NAMED_DATATYPE: - do_print_objname("datatype", path1, path2, options); + do_print_objname("datatype", path1, path2, opts); break; case H5TRAV_TYPE_GROUP: - do_print_objname("group", path1, path2, options); + do_print_objname("group", path1, path2, opts); break; case H5TRAV_TYPE_LINK: - do_print_objname("link", path1, path2, options); + do_print_objname("link", path1, path2, opts); break; case H5TRAV_TYPE_UDLINK: if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) - do_print_objname("external link", path1, path2, options); + do_print_objname("external link", path1, path2, opts); else - do_print_objname ("user defined link", path1, path2, options); + do_print_objname ("user defined link", path1, path2, opts); break; case H5TRAV_TYPE_UNKNOWN: default: parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n", path1, path2, get_type(object_type) ); - options->not_cmp = 1; + opts->not_cmp = 1; break; } /* switch(type)*/ print_found(nfound); - } /* if(options->m_verbose || options->m_report) */ + } /* if(opts->m_verbose || opts->m_report) */ /* exact same, so comparison is done */ - options->err_stat = 0; + opts->err_stat = 0; HGOTO_DONE(0); } } @@ -1547,24 +1548,25 @@ diff(hid_t file1_id, if((dset2_id = H5Dopen2(file2_id, path2, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); /* verbose (-v) and report (-r) mode */ - if(options->m_verbose || options->m_report) { - do_print_objname("dataset", path1, path2, options); - nfound = diff_dataset(file1_id, file2_id, path1, path2, options); + if(opts->m_verbose || opts->m_report) { + do_print_objname("dataset", path1, path2, opts); + nfound = diff_dataset(file1_id, file2_id, path1, path2, opts); print_found(nfound); } /* quiet mode (-q), just count differences */ - else if(options->m_quiet) { - nfound = diff_dataset(file1_id, file2_id, path1, path2, options); + else if(opts->m_quiet) { + nfound = diff_dataset(file1_id, file2_id, path1, path2, opts); } /* the rest (-c, none, ...) */ else { - nfound = diff_dataset(file1_id, file2_id, path1, path2, options); + nfound = diff_dataset(file1_id, file2_id, path1, path2, opts); /* print info if difference found */ if (nfound) { - do_print_objname("dataset", path1, path2, options); + do_print_objname("dataset", path1, path2, opts); print_found(nfound); } } + h5diffdebug2("diff after dataset:%d\n", nfound); /*--------------------------------------------------------- * compare attributes @@ -1573,7 +1575,7 @@ diff(hid_t file1_id, *--------------------------------------------------------- */ if(path1) - nfound += diff_attr(dset1_id, dset2_id, path1, path2, options); + nfound += diff_attr(dset1_id, dset2_id, path1, path2, opts); if(H5Dclose(dset1_id) < 0) @@ -1598,11 +1600,11 @@ diff(hid_t file1_id, /* if H5Tequal is > 0 then the datatypes refer to the same datatype */ nfound = (ret_value > 0) ? 0 : 1; - if(print_objname(options,nfound)) - do_print_objname("datatype", path1, path2, options); + if(print_objname(opts, nfound)) + do_print_objname("datatype", path1, path2, opts); /* always print the number of differences found in verbose mode */ - if(options->m_verbose) + if(opts->m_verbose) print_found(nfound); /*----------------------------------------------------------------- @@ -1612,7 +1614,7 @@ diff(hid_t file1_id, *----------------------------------------------------------------- */ if(path1) - nfound += diff_attr(type1_id, type2_id, path1, path2, options); + nfound += diff_attr(type1_id, type2_id, path1, path2, opts); if(H5Tclose(type1_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); @@ -1625,11 +1627,11 @@ diff(hid_t file1_id, *---------------------------------------------------------------------- */ case H5TRAV_TYPE_GROUP: - if(print_objname(options, nfound)) - do_print_objname("group", path1, path2, options); + if(print_objname(opts, nfound)) + do_print_objname("group", path1, path2, opts); /* always print the number of differences found in verbose mode */ - if(options->m_verbose) + if(opts->m_verbose) print_found(nfound); if((grp1_id = H5Gopen2(file1_id, path1, H5P_DEFAULT)) < 0) @@ -1644,7 +1646,7 @@ diff(hid_t file1_id, *----------------------------------------------------------------- */ if(path1) - nfound += diff_attr(grp1_id, grp2_id, path1, path2, options); + nfound += diff_attr(grp1_id, grp2_id, path1, path2, opts); if(H5Gclose(grp1_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); @@ -1664,11 +1666,11 @@ diff(hid_t file1_id, /* if the target link name is not same then the links are "different" */ nfound = (ret_value != 0) ? 1 : 0; - if(print_objname(options, nfound)) - do_print_objname("link", path1, path2, options); + if(print_objname(opts, nfound)) + do_print_objname("link", path1, path2, opts); /* always print the number of differences found in verbose mode */ - if(options->m_verbose) + if(opts->m_verbose) print_found(nfound); } @@ -1695,8 +1697,8 @@ diff(hid_t file1_id, */ nfound = (ret_value != 0) ? 1 : 0; - if(print_objname(options, nfound)) - do_print_objname("external link", path1, path2, options); + if(print_objname(opts, nfound)) + do_print_objname("external link", path1, path2, opts); } /* end if */ else { @@ -1713,26 +1715,26 @@ diff(hid_t file1_id, else nfound = 0; - if (print_objname (options, nfound)) - do_print_objname ("user defined link", path1, path2, options); + if (print_objname (opts, nfound)) + do_print_objname ("user defined link", path1, path2, opts); } /* end else */ /* always print the number of differences found in verbose mode */ - if(options->m_verbose) + if(opts->m_verbose) print_found(nfound); } break; case H5TRAV_TYPE_UNKNOWN: default: - if(options->m_verbose) + if(opts->m_verbose) parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n", path1, path2, get_type(object_type) ); - options->not_cmp = 1; + opts->not_cmp = 1; break; } - options->err_stat = 0; + opts->err_stat = 0; done: /*----------------------------------- @@ -1740,25 +1742,25 @@ done: */ /* both path1 and path2 are dangling links */ if(is_dangle_link1 && is_dangle_link2) { - if(print_objname(options, nfound)) { - do_print_objname("dangling link", path1, path2, options); + if(print_objname(opts, nfound)) { + do_print_objname("dangling link", path1, path2, opts); print_found(nfound); } } /* path1 is dangling link */ else if (is_dangle_link1) { - if(options->m_verbose) + if(opts->m_verbose) parallel_print("obj1 <%s> is a dangling link.\n", path1); nfound++; - if(print_objname(options, nfound)) + if(print_objname(opts, nfound)) print_found(nfound); } /* path2 is dangling link */ else if (is_dangle_link2) { - if(options->m_verbose) + if(opts->m_verbose) parallel_print("obj2 <%s> is a dangling link.\n", path2); nfound++; - if(print_objname(options, nfound)) + if(print_objname(opts, nfound)) print_found(nfound); } @@ -1780,7 +1782,7 @@ done: /* enable error reporting */ } H5E_END_TRY; - h5difftrace("diff finish\n"); + h5diffdebug2("diff finish:%d\n", nfound); return nfound; } diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 0226e83..26bcd95 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -38,7 +38,7 @@ /*------------------------------------------------------------------------- * This is used to pass multiple args into diff(). - * Passing this instead of several each arg provides smoother extensibility + * Passing this instead of several each arg provides smoother extensibility * through its members along with MPI code for ph5diff * as it doesn't require interface change. *------------------------------------------------------------------------*/ @@ -95,13 +95,13 @@ H5TOOLS_DLL hsize_t h5diff(const char *fname1, const char *fname2, const char *objname1, const char *objname2, - diff_opt_t *options); + diff_opt_t *opts); H5TOOLS_DLL hsize_t diff( hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, - diff_opt_t *options, + diff_opt_t *opts, diff_args_t *argdata); #ifdef H5_HAVE_PARALLEL @@ -125,18 +125,18 @@ hsize_t diff_dataset( hid_t file1_id, hid_t file2_id, const char *obj1_name, const char *obj2_name, - diff_opt_t *options); + diff_opt_t *opts); hsize_t diff_datasetid( hid_t dset1_id, hid_t dset2_id, const char *obj1_name, const char *obj2_name, - diff_opt_t *options); + diff_opt_t *opts); hsize_t diff_match( hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, const char *grp2, trav_info_t *info2, - trav_table_t *table, diff_opt_t *options ); + trav_table_t *table, diff_opt_t *opts ); hsize_t diff_array( void *_mem1, void *_mem2, @@ -144,7 +144,7 @@ hsize_t diff_array( void *_mem1, hsize_t hyper_start, int rank, hsize_t *dims, - diff_opt_t *options, + diff_opt_t *opts, const char *name1, const char *name2, hid_t m_type, @@ -162,7 +162,7 @@ int diff_can_type( hid_t f_type1, /* file data type */ hsize_t *maxdim2, const char *obj1_name, const char *obj2_name, - diff_opt_t *options, + diff_opt_t *opts, int is_compound); @@ -170,7 +170,7 @@ hsize_t diff_attr(hid_t loc1_id, hid_t loc2_id, const char *path1, const char *path2, - diff_opt_t *options); + diff_opt_t *opts); /*------------------------------------------------------------------------- @@ -187,10 +187,10 @@ const char* get_class(H5T_class_t tclass); const char* get_sign(H5T_sign_t sign); void print_dimensions (int rank, hsize_t *dims); herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, - hid_t *m_tid1, hid_t *m_tid2, + hid_t *m_tid1, hid_t *m_tid2, size_t *m_size1, size_t *m_size2); /* in h5diff.c */ -int print_objname(diff_opt_t *options, hsize_t nfound); +int print_objname(diff_opt_t *opts, hsize_t nfound); void do_print_objname (const char *OBJ, const char *path1, const char *path2, diff_opt_t * opts); void do_print_attrname (const char *attr, const char *path1, const char *path2); diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 58a5e09..5d77de3 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -131,21 +131,21 @@ typedef struct mcomp_t { *------------------------------------------------------------------------- */ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, - hid_t region2_id, diff_opt_t *options); + hid_t region2_id, diff_opt_t *opts); static hbool_t all_zero(const void *_mem, size_t size); static int ull2float(unsigned long long ull_value, float *f_value); static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *options, const char *obj1, const char *obj2, int *ph); + diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *options, const char *obj1, const char *obj2, int *ph); -static hbool_t equal_float(float value, float expected, diff_opt_t *options); -static hbool_t equal_double(double value, double expected, diff_opt_t *options); + diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); +static hbool_t equal_float(float value, float expected, diff_opt_t *opts); +static hbool_t equal_double(double value, double expected, diff_opt_t *opts); #if H5_SIZEOF_LONG_DOUBLE !=0 -static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *options); +static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts); #endif -static int print_data(diff_opt_t *options); +static int print_data(diff_opt_t *opts); static void print_pos(int *ph, int pp, hsize_t curr_pos, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, const char *obj1, const char *obj2); @@ -155,17 +155,17 @@ static void print_char_pos(int *ph, int pp, hsize_t curr_pos, size_t u, static void h5diff_print_char(char ch); static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *options, const char *obj1, const char *obj2, + diff_opt_t *opts, const char *obj1, const char *obj2, hid_t container1_id, hid_t container2_id, /*where the reference came from*/ int *ph, /*print header */ mcomp_t *members); /*compound members */ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); #if H5_SIZEOF_LONG_DOUBLE !=0 static hsize_t diff_ldouble(unsigned char *mem1, @@ -176,50 +176,50 @@ static hsize_t diff_ldouble(unsigned char *mem1, hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *options, + diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); #endif static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); /*------------------------------------------------------------------------- @@ -266,7 +266,7 @@ hsize_t diff_array( hsize_t hyper_start, int rank, hsize_t *dims, - diff_opt_t *options, + diff_opt_t *opts, const char *name1, const char *name2, hid_t m_type, @@ -324,36 +324,36 @@ hsize_t diff_array( */ case H5T_FLOAT: if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) - nfound = diff_float(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_float(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) - nfound = diff_double(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_double(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); #if H5_SIZEOF_LONG_DOUBLE != 0 else if (H5Tequal(m_type, H5T_NATIVE_LDOUBLE)) - nfound = diff_ldouble(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_ldouble(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); #endif break; case H5T_INTEGER: if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) - nfound = diff_schar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_schar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) - nfound = diff_uchar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_uchar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_SHORT)) - nfound = diff_short(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_short(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_USHORT)) - nfound = diff_ushort(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_ushort(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_INT)) - nfound = diff_int(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_int(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_UINT)) - nfound = diff_uint(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_uint(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_LONG)) - nfound = diff_long(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_long(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_ULONG)) - nfound = diff_ulong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_ulong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) - nfound = diff_llong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_llong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) - nfound = diff_ullong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_ullong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); break; /*------------------------------------------------------------------------- @@ -371,14 +371,14 @@ hsize_t diff_array( HDmemset(&members, 0, sizeof(mcomp_t)); get_member_types(m_type, &members); for (i = 0; i < nelmts; i++) { - nfound += diff_datum(mem1 + i * size, mem2 + i * size, m_type, i, rank, dims, acc, pos, options, + nfound += diff_datum(mem1 + i * size, mem2 + i * size, m_type, i, rank, dims, acc, pos, opts, name1, name2, container1_id, container2_id, &ph, &members); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) break; } /* i */ close_member_types(&members); } /* switch */ - h5difftrace("diff_array finish\n"); + h5diffdebug2("diff_array finish:%d\n", nfound); return nfound; } @@ -425,7 +425,7 @@ static hsize_t diff_datum( hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *options, + diff_opt_t *opts, const char *obj1, const char *obj2, hid_t container1_id, @@ -447,11 +447,14 @@ static hsize_t diff_datum( hbool_t iszero1; hbool_t iszero2; hsize_t nfound = 0; /* differences found */ - hsize_t ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hsize_t ret_value = 0; double per; hbool_t both_zero; h5difftrace("diff_datum start\n"); + /* default error sttaus */ + opts->err_stat = 1; + type_size = H5Tget_size(m_type); type_class = H5Tget_class(m_type); @@ -489,7 +492,7 @@ static hsize_t diff_datum( memb_type = members->ids[j]; nfound += diff_datum(mem1 + offset, mem2 + offset, memb_type, index, - rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members->m[j]); + rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members->m[j]); } } break; @@ -590,13 +593,13 @@ static hsize_t diff_datum( /* try fast compare first */ if (HDmemcmp(s, sx, size) == 0) { if (size1 != size2) - if (print_data(options)) + if (print_data(opts)) for (u = size; u < sizex; u++) - character_compare(s + u, sx + u, index, u, rank, dims, acc, pos, options, obj1, obj2, ph); + character_compare(s + u, sx + u, index, u, rank, dims, acc, pos, opts, obj1, obj2, ph); } else for (u = 0; u < size; u++) - nfound += character_compare(s + u, sx + u, index, u, rank, dims, acc, pos, options, obj1, obj2, ph); + nfound += character_compare(s + u, sx + u, index, u, rank, dims, acc, pos, opts, obj1, obj2, ph); } /* end check for NULL pointer for string */ } break; @@ -609,7 +612,7 @@ static hsize_t diff_datum( h5difftrace("diff_datum H5T_BITFIELD\n"); /* byte-by-byte comparison */ for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, options, obj1, obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph); break; /*------------------------------------------------------------------------- @@ -620,7 +623,7 @@ static hsize_t diff_datum( h5difftrace("diff_datum H5T_OPAQUE\n"); /* byte-by-byte comparison */ for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, options, obj1, obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph); break; /*------------------------------------------------------------------------- @@ -660,7 +663,7 @@ static hsize_t diff_datum( * don't attempt to convert them - just report errors. */ nfound += 1; - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(S_FORMAT, enum_name1, enum_name2); @@ -670,7 +673,7 @@ static hsize_t diff_datum( /* Both enum values were valid */ if (HDstrcmp(enum_name1, enum_name2) != 0) { nfound = 1; - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(S_FORMAT, enum_name1, enum_name2); @@ -678,7 +681,7 @@ static hsize_t diff_datum( } else { for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, options, obj1, obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph); } } /* enable error reporting */ @@ -708,7 +711,7 @@ static hsize_t diff_datum( nelmts *= adims[u]; for (u = 0; u < nelmts; u++) { nfound += diff_datum(mem1 + u * size, mem2 + u * size, memb_type, index, - rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members); + rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members); } H5Tclose(memb_type); } @@ -746,18 +749,12 @@ static hsize_t diff_datum( if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_region object 2 failed"); - if (ret_value >= 0) - nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, options); + nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, opts); H5Oclose(obj1_id); H5Oclose(obj2_id); H5Sclose(region1_id); H5Sclose(region2_id); - - if (ret_value == -1) { - options->err_stat = 1; - HGOTO_DONE(0); - } }/*dataset reference*/ /*------------------------------------------------------------------------- @@ -778,7 +775,7 @@ static hsize_t diff_datum( if (ret_value >= 0) if (obj1_type != obj2_type) { parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2); - options->not_cmp = 1; + opts->not_cmp = 1; HGOTO_DONE (0); } @@ -788,25 +785,18 @@ static hsize_t diff_datum( HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference2 object 2 failed"); /* compare */ - if (ret_value >= 0) { - if (obj1_type == H5O_TYPE_DATASET) - nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, options); - else { - if (options->m_verbose) - parallel_print( - "Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", - obj1, obj2); - options->not_cmp = 1; - } + if (obj1_type == H5O_TYPE_DATASET) + nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, opts); + else { + if (opts->m_verbose) + parallel_print( + "Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", + obj1, obj2); + opts->not_cmp = 1; } H5Oclose(obj1_id); H5Oclose(obj2_id); - - if (ret_value == -1) { - options->err_stat = 1; - HGOTO_DONE(0); - } }/*object reference*/ }/*is zero*/ break; @@ -828,7 +818,7 @@ static hsize_t diff_datum( for (j = 0; j < nelmts; j++) nfound += diff_datum(((char *) (((hvl_t *) mem1)->p)) + j * size, ((char *) (((hvl_t *) mem2)->p)) + j * size, memb_type, index, - rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members); + rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members); H5Tclose(memb_type); } @@ -853,9 +843,9 @@ static hsize_t diff_datum( HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); /* -d and !-p */ - if (options->d && !options->p) { - if (ABS(temp1_char-temp2_char) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (ABS(temp1_char-temp2_char) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); @@ -864,19 +854,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER(temp1_char, temp2_char); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); @@ -885,19 +875,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER(temp1_char, temp2_char); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - else if (per > options->percent && ABS(temp1_char - temp2_char) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_char - temp2_char) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); @@ -906,7 +896,7 @@ static hsize_t diff_datum( } } else if (temp1_char != temp2_char) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); @@ -929,9 +919,9 @@ static hsize_t diff_datum( HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); /* -d and !-p */ - if (options->d && !options->p) { - if (PDIFF(temp1_uchar, temp2_uchar) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); @@ -940,19 +930,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); @@ -961,19 +951,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - else if (per > options->percent && PDIFF(temp1_uchar, temp2_uchar) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); @@ -982,7 +972,7 @@ static hsize_t diff_datum( } } else if (temp1_uchar != temp2_uchar) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); @@ -1005,9 +995,9 @@ static hsize_t diff_datum( HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); /* -d and !-p */ - if (options->d && !options->p) { - if (ABS(temp1_short - temp2_short) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (ABS(temp1_short - temp2_short) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); @@ -1016,19 +1006,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER(temp1_short, temp2_short); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); @@ -1037,19 +1027,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER(temp1_short, temp2_short); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - else if (per > options->percent && ABS(temp1_short - temp2_short) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_short - temp2_short) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); @@ -1058,7 +1048,7 @@ static hsize_t diff_datum( } } else if (temp1_short != temp2_short) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); @@ -1081,9 +1071,9 @@ static hsize_t diff_datum( HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); /* -d and !-p */ - if (options->d && !options->p) { - if (PDIFF(temp1_ushort, temp2_ushort) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); @@ -1092,19 +1082,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); @@ -1113,19 +1103,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - else if (per > options->percent && PDIFF(temp1_ushort, temp2_ushort) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); @@ -1134,7 +1124,7 @@ static hsize_t diff_datum( } } else if (temp1_ushort != temp2_ushort) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); @@ -1157,9 +1147,9 @@ static hsize_t diff_datum( HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); /* -d and !-p */ - if (options->d && !options->p) { - if (ABS(temp1_int-temp2_int) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (ABS(temp1_int-temp2_int) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); @@ -1168,19 +1158,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER(temp1_int, temp2_int); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); @@ -1189,19 +1179,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER(temp1_int, temp2_int); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - else if (per > options->percent && ABS(temp1_int - temp2_int) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_int - temp2_int) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); @@ -1210,7 +1200,7 @@ static hsize_t diff_datum( } } else if (temp1_int != temp2_int) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); @@ -1233,9 +1223,9 @@ static hsize_t diff_datum( HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); /* -d and !-p */ - if (options->d && !options->p) { - if (PDIFF(temp1_uint, temp2_uint) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (PDIFF(temp1_uint, temp2_uint) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); @@ -1244,19 +1234,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER_UNSIGN(signed int, temp1_uint, temp2_uint); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); @@ -1265,19 +1255,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER_UNSIGN(signed int, temp1_uint, temp2_uint); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - else if (per > options->percent && PDIFF(temp1_uint,temp2_uint) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && PDIFF(temp1_uint,temp2_uint) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); @@ -1286,7 +1276,7 @@ static hsize_t diff_datum( } } else if (temp1_uint != temp2_uint) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); @@ -1309,9 +1299,9 @@ static hsize_t diff_datum( HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); /* -d and !-p */ - if (options->d && !options->p) { - if (ABS(temp1_long-temp2_long) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (ABS(temp1_long-temp2_long) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); @@ -1320,19 +1310,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER(temp1_long, temp2_long); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); @@ -1341,19 +1331,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER(temp1_long, temp2_long); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - else if (per > options->percent && ABS(temp1_long-temp2_long) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_long-temp2_long) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); @@ -1362,7 +1352,7 @@ static hsize_t diff_datum( } } else if (temp1_long != temp2_long) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); @@ -1385,9 +1375,9 @@ static hsize_t diff_datum( HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); /* -d and !-p */ - if (options->d && !options->p) { - if (PDIFF(temp1_ulong, temp2_ulong) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (PDIFF(temp1_ulong, temp2_ulong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); @@ -1396,19 +1386,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); @@ -1417,19 +1407,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - else if (per > options->percent && PDIFF(temp1_ulong,temp2_ulong) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && PDIFF(temp1_ulong,temp2_ulong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); @@ -1438,7 +1428,7 @@ static hsize_t diff_datum( } } else if (temp1_ulong != temp2_ulong) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); @@ -1469,26 +1459,26 @@ static hsize_t diff_datum( HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); - /* logic for detecting NaNs is different with options -d, -p and no options */ + /* logic for detecting NaNs is different with opts -d, -p and no opts */ /*------------------------------------------------------------------------- * -d and !-p *------------------------------------------------------------------------- */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_FLOAT, &temp1_float); isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { - if (ABS(temp1_float-temp2_float) > (float) options->delta) { - if (print_data(options)) { + if (ABS(temp1_float-temp2_float) > (float) opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -1498,7 +1488,7 @@ static hsize_t diff_datum( } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -1510,12 +1500,12 @@ static hsize_t diff_datum( * !-d and -p *------------------------------------------------------------------------- */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_FLOAT, &temp1_float); isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } @@ -1525,15 +1515,15 @@ static hsize_t diff_datum( PER(temp1_float, temp2_float); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - else if (per > options->percent && (double) ABS(temp1_float - temp2_float) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && (double) ABS(temp1_float - temp2_float) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, @@ -1544,7 +1534,7 @@ static hsize_t diff_datum( } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -1556,12 +1546,12 @@ static hsize_t diff_datum( * -d and -p *------------------------------------------------------------------------- */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_FLOAT, &temp1_float); isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } @@ -1571,15 +1561,15 @@ static hsize_t diff_datum( PER(temp1_float, temp2_float); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, @@ -1590,7 +1580,7 @@ static hsize_t diff_datum( } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -1602,8 +1592,8 @@ static hsize_t diff_datum( * no -d and -p *------------------------------------------------------------------------- */ - else if (equal_float(temp1_float, temp2_float, options) == FALSE) { - if (print_data(options)) { + else if (equal_float(temp1_float, temp2_float, opts) == FALSE) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -1628,25 +1618,25 @@ static hsize_t diff_datum( HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); - /* logic for detecting NaNs is different with options -d, -p and no options */ + /* logic for detecting NaNs is different with opts -d, -p and no opts */ /*------------------------------------------------------------------------- * -d and !-p *------------------------------------------------------------------------- */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { - if (ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1656,24 +1646,24 @@ static hsize_t diff_datum( } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - } /* options->d && !options->p */ + } /* opts->d && !opts->p */ /*------------------------------------------------------------------------- * !-d and -p *------------------------------------------------------------------------- */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } @@ -1683,15 +1673,15 @@ static hsize_t diff_datum( PER(temp1_double, temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); @@ -1701,7 +1691,7 @@ static hsize_t diff_datum( } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1713,12 +1703,12 @@ static hsize_t diff_datum( * -d and -p *------------------------------------------------------------------------- */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } @@ -1728,16 +1718,16 @@ static hsize_t diff_datum( PER(temp1_double, temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent && - ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && + ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); @@ -1747,7 +1737,7 @@ static hsize_t diff_datum( } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1759,8 +1749,8 @@ static hsize_t diff_datum( * no -d and -p *------------------------------------------------------------------------- */ - else if (equal_double(temp1_double, temp2_double, options) == FALSE) { - if (print_data(options)) { + else if (equal_double(temp1_double, temp2_double, opts) == FALSE) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1793,20 +1783,20 @@ static hsize_t diff_datum( * -d and !-p *------------------------------------------------------------------------- */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { - if (ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1816,7 +1806,7 @@ static hsize_t diff_datum( } /* NaN */ /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1828,12 +1818,12 @@ static hsize_t diff_datum( * !-d and -p *------------------------------------------------------------------------- */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } @@ -1843,15 +1833,15 @@ static hsize_t diff_datum( PER(temp1_double,temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); @@ -1861,7 +1851,7 @@ static hsize_t diff_datum( } /* NaN */ /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1873,12 +1863,12 @@ static hsize_t diff_datum( * -d and -p *------------------------------------------------------------------------- */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } @@ -1888,15 +1878,15 @@ static hsize_t diff_datum( PER(temp1_double,temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent && ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); @@ -1906,7 +1896,7 @@ static hsize_t diff_datum( } /* NaN */ /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1918,8 +1908,8 @@ static hsize_t diff_datum( * no -d and -p *------------------------------------------------------------------------- */ - else if (equal_ldouble(temp1_double, temp2_double, options) == FALSE) { - if (print_data(options)) { + else if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1932,9 +1922,10 @@ static hsize_t diff_datum( break; /* H5T_FLOAT class */ } /* switch */ + opts->err_stat = 0; done: - h5difftrace("diff_datum finish\n"); + h5diffdebug2("diff_datum finish:%d\n", nfound); return nfound; } @@ -2009,7 +2000,7 @@ void print_points(int i, hsize_t *ptdata, int ndims) { *------------------------------------------------------------------------- */ -static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *options) +static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *opts) { hsize_t ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ @@ -2041,7 +2032,7 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t } H5E_END_TRY; if (nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) { - options->not_cmp = 1; + opts->not_cmp = 1; HGOTO_DONE (0); } @@ -2083,7 +2074,7 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t } /* print differences if found */ - if (nfound_b && options->m_verbose) { + if (nfound_b && opts->m_verbose) { H5O_info_t oi1, oi2; H5Oget_info(obj1_id, &oi1); @@ -2140,7 +2131,7 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t } } - if (nfound_p && options->m_verbose) { + if (nfound_p && opts->m_verbose) { parallel_print("Region points\n"); for (i = 0; i < npoints1; i++) { hsize_t pt1, pt2; @@ -2167,8 +2158,6 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t #if defined (H5DIFF_DEBUG) for (i = 0; i < npoints1; i++) { - int j; - parallel_print("%sPt%lu: " , i ? "," : "", (unsigned long)i); for (j = 0; j < ndims1; j++) @@ -2201,7 +2190,7 @@ done: */ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) + int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* differences found */ char temp1_uchar; @@ -2212,7 +2201,7 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u, h5diffdebug3("character_compare start %d=%d\n",temp1_uchar,temp2_uchar); if (temp1_uchar != temp2_uchar) { - if (print_data(options)) { + if (print_data(opts)) { print_char_pos(ph, 0, i, u, acc, pos, rank, dims, obj1, obj2); parallel_print(" "); h5diff_print_char(temp1_uchar); @@ -2237,7 +2226,7 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u, */ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, - hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) + hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* differences found */ unsigned char temp1_uchar; @@ -2251,9 +2240,9 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, h5difftrace("character_compare_opt start\n"); /* -d and !-p */ - if (options->d && !options->p) { - if (PDIFF(temp1_uchar,temp2_uchar) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); @@ -2262,10 +2251,10 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - if (per > options->percent) { - if (print_data(options)) { + if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); @@ -2274,10 +2263,10 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - if (per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta) { - if (print_data(options)) { + if (per > opts->percent && PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); @@ -2286,7 +2275,7 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, } } else if (temp1_uchar != temp2_uchar) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); @@ -2307,7 +2296,7 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, *------------------------------------------------------------------------- */ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { @@ -2327,7 +2316,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, *------------------------------------------------------------------------- */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); @@ -2336,15 +2325,15 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_FLOAT, &temp1_float); isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { - if ((double) ABS(temp1_float - temp2_float) > options->delta) { - if (print_data(options)) { + if ((double) ABS(temp1_float - temp2_float) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -2354,7 +2343,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -2364,7 +2353,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(float); mem2 += sizeof(float); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2372,7 +2361,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, * !-d and -p *------------------------------------------------------------------------- */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); @@ -2381,7 +2370,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_FLOAT, &temp1_float); isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } @@ -2390,15 +2379,15 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, PER(temp1_float, temp2_float); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, @@ -2409,7 +2398,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -2419,7 +2408,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(float); mem2 += sizeof(float); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2427,7 +2416,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, * -d and -p *------------------------------------------------------------------------- */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); @@ -2436,7 +2425,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_FLOAT, &temp1_float); isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } @@ -2446,15 +2435,15 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, PER(temp1_float, temp2_float); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - else if (per > options->percent && (double) ABS(temp1_float - temp2_float) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && (double) ABS(temp1_float - temp2_float) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, @@ -2466,7 +2455,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -2476,7 +2465,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(float); mem2 += sizeof(float); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2490,8 +2479,8 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); - if (equal_float(temp1_float, temp2_float, options) == FALSE) { - if (print_data(options)) { + if (equal_float(temp1_float, temp2_float, opts) == FALSE) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -2501,7 +2490,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(float); mem2 += sizeof(float); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -2520,7 +2509,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, */ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { @@ -2539,7 +2528,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, *------------------------------------------------------------------------- */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); @@ -2548,15 +2537,15 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { - if (ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2566,7 +2555,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2576,7 +2565,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(double); mem2 += sizeof(double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2585,7 +2574,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, * !-d and -p *------------------------------------------------------------------------- */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); @@ -2594,7 +2583,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } @@ -2603,15 +2592,15 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, PER(temp1_double, temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, @@ -2622,7 +2611,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2632,7 +2621,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(double); mem2 += sizeof(double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2640,7 +2629,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, * -d and -p *------------------------------------------------------------------------- */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); @@ -2650,7 +2639,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } @@ -2660,15 +2649,15 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, PER(temp1_double, temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent && ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, @@ -2679,7 +2668,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2688,7 +2677,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(double); mem2 += sizeof(double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2701,8 +2690,8 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); - if (equal_double(temp1_double, temp2_double, options) == FALSE) { - if (print_data(options)) { + if (equal_double(temp1_double, temp2_double, opts) == FALSE) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2712,7 +2701,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(double); mem2 += sizeof(double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -2739,7 +2728,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *options, + diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) @@ -2761,7 +2750,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, *------------------------------------------------------------------------- */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for ( i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); @@ -2770,15 +2759,15 @@ static hsize_t diff_ldouble(unsigned char *mem1, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { - if (ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2788,7 +2777,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2798,7 +2787,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, } mem1 += sizeof(long double); mem2 += sizeof(long double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2807,7 +2796,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, * !-d and -p *------------------------------------------------------------------------- */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); @@ -2816,7 +2805,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } @@ -2825,15 +2814,15 @@ static hsize_t diff_ldouble(unsigned char *mem1, PER(temp1_double, temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, @@ -2844,7 +2833,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start+i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2853,7 +2842,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, } mem1 += sizeof(long double); mem2 += sizeof(long double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2861,7 +2850,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, * -d and -p *------------------------------------------------------------------------- */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); @@ -2870,7 +2859,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } @@ -2880,15 +2869,15 @@ static hsize_t diff_ldouble(unsigned char *mem1, PER(temp1_double, temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent && ABS(temp1_double - temp2_double) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_double - temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1-temp2_double / temp1_double)); @@ -2898,7 +2887,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2907,7 +2896,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, } mem1 += sizeof(long double); mem2 += sizeof(long double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2920,8 +2909,8 @@ static hsize_t diff_ldouble(unsigned char *mem1, HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); - if (equal_ldouble(temp1_double, temp2_double, options) == FALSE) { - if (print_data(options)) { + if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2930,7 +2919,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, } mem1 += sizeof(long double); mem2 += sizeof(long double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -2950,7 +2939,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, */ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { @@ -2963,13 +2952,13 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, h5difftrace("diff_schar start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); - if (ABS(temp1_char-temp2_char) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_char-temp2_char) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); @@ -2978,12 +2967,12 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(char); mem2 += sizeof(char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); @@ -2991,15 +2980,15 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, PER(temp1_char, temp2_char); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); @@ -3008,12 +2997,12 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(char); mem2 += sizeof(char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); @@ -3021,15 +3010,15 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, PER(temp1_char, temp2_char); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - else if (per > options->percent && ABS(temp1_char-temp2_char) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_char-temp2_char) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); @@ -3038,7 +3027,7 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(char); mem2 += sizeof(char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3048,7 +3037,7 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_char, mem2, sizeof(char)); if (temp1_char != temp2_char) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); @@ -3058,7 +3047,7 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(char); mem2 += sizeof(char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3077,7 +3066,7 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, */ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ @@ -3089,13 +3078,13 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, h5difftrace("diff_uchar start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - if (PDIFF(temp1_uchar,temp2_uchar) > options->delta) { - if (print_data(options)) { + if (PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); @@ -3104,12 +3093,12 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned char); mem2 += sizeof(unsigned char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -3117,15 +3106,15 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); @@ -3134,12 +3123,12 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned char); mem2 += sizeof(unsigned char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -3147,15 +3136,15 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - else if (per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); @@ -3164,7 +3153,7 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned char); mem2 += sizeof(unsigned char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3174,7 +3163,7 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); if (temp1_uchar != temp2_uchar) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); @@ -3184,7 +3173,7 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(unsigned char); mem2 += sizeof(unsigned char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3203,7 +3192,7 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, */ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ @@ -3215,13 +3204,13 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, h5difftrace("diff_short start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); - if (ABS(temp1_short-temp2_short) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_short-temp2_short) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); @@ -3230,12 +3219,12 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(short); mem2 += sizeof(short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); @@ -3243,15 +3232,15 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, PER(temp1_short, temp2_short); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); @@ -3260,12 +3249,12 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(short); mem2 += sizeof(short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); @@ -3273,15 +3262,15 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, PER(temp1_short, temp2_short); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - else if (per > options->percent && ABS(temp1_short-temp2_short) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_short-temp2_short) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); @@ -3290,7 +3279,7 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(short); mem2 += sizeof(short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3300,7 +3289,7 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_short, mem2, sizeof(short)); if (temp1_short != temp2_short) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); @@ -3310,7 +3299,7 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(short); mem2 += sizeof(short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3329,7 +3318,7 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, */ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { @@ -3342,13 +3331,13 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, h5difftrace("diff_ushort start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - if (PDIFF(temp1_ushort,temp2_ushort) > options->delta) { - if (print_data(options)) { + if (PDIFF(temp1_ushort,temp2_ushort) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); @@ -3357,12 +3346,12 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned short); mem2 += sizeof(unsigned short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); @@ -3370,15 +3359,15 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); @@ -3387,12 +3376,12 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned short); mem2 += sizeof(unsigned short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); @@ -3400,15 +3389,15 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - else if (per > options->percent && PDIFF(temp1_ushort,temp2_ushort) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && PDIFF(temp1_ushort,temp2_ushort) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); @@ -3417,7 +3406,7 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned short); mem2 += sizeof(unsigned short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3427,7 +3416,7 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); if (temp1_ushort != temp2_ushort) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); @@ -3437,7 +3426,7 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(unsigned short); mem2 += sizeof(unsigned short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3456,7 +3445,7 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, */ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ @@ -3468,13 +3457,13 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, h5difftrace("diff_int start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); - if (ABS(temp1_int-temp2_int) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_int-temp2_int) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); @@ -3483,12 +3472,12 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(int); mem2 += sizeof(int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); @@ -3496,15 +3485,15 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, PER(temp1_int, temp2_int); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); @@ -3513,12 +3502,12 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(int); mem2 += sizeof(int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); @@ -3526,15 +3515,15 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, PER(temp1_int, temp2_int); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - else if (per > options->percent && ABS(temp1_int-temp2_int) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_int-temp2_int) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); @@ -3543,7 +3532,7 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(int); mem2 += sizeof(int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3553,7 +3542,7 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_int, mem2, sizeof(int)); if (temp1_int != temp2_int) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); @@ -3563,7 +3552,7 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(int); mem2 += sizeof(int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ @@ -3582,7 +3571,7 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, */ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ @@ -3594,13 +3583,13 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, h5difftrace("diff_uint start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - if (PDIFF(temp1_uint,temp2_uint) > options->delta) { - if (print_data(options)) { + if (PDIFF(temp1_uint,temp2_uint) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); @@ -3609,12 +3598,12 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned int); mem2 += sizeof(unsigned int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); @@ -3622,15 +3611,15 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed int, temp1_uint, temp2_uint); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); @@ -3639,12 +3628,12 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned int); mem2 += sizeof(unsigned int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); @@ -3652,16 +3641,16 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed int, temp1_uint, temp2_uint); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - else if (per > options->percent - && PDIFF(temp1_uint,temp2_uint) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent + && PDIFF(temp1_uint,temp2_uint) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); @@ -3670,7 +3659,7 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned int); mem2 += sizeof(unsigned int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3680,7 +3669,7 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); if (temp1_uint != temp2_uint) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); @@ -3690,7 +3679,7 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(unsigned int); mem2 += sizeof(unsigned int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3709,7 +3698,7 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, */ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ @@ -3721,14 +3710,14 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, h5difftrace("diff_long start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); - if (ABS(temp1_long-temp2_long) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_long-temp2_long) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); @@ -3737,13 +3726,13 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(long); mem2 += sizeof(long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); @@ -3751,15 +3740,15 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, PER(temp1_long, temp2_long); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); @@ -3768,12 +3757,12 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(long); mem2 += sizeof(long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); @@ -3781,15 +3770,15 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, PER(temp1_long, temp2_long); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - else if (per > options->percent && ABS(temp1_long-temp2_long) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_long-temp2_long) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); @@ -3798,7 +3787,7 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(long); mem2 += sizeof(long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3808,7 +3797,7 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_long, mem2, sizeof(long)); if (temp1_long != temp2_long) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); @@ -3818,7 +3807,7 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(long); mem2 += sizeof(long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3837,7 +3826,7 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, */ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ @@ -3850,14 +3839,14 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, h5difftrace("diff_ulong start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - if (PDIFF(temp1_ulong,temp2_ulong) > options->delta) { - if (print_data(options)) { + if (PDIFF(temp1_ulong,temp2_ulong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); @@ -3866,13 +3855,13 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned long); mem2 += sizeof(unsigned long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); @@ -3880,15 +3869,15 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); @@ -3897,12 +3886,12 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned long); mem2 += sizeof(unsigned long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); @@ -3910,16 +3899,16 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - else if (per > options->percent - && PDIFF(temp1_ulong,temp2_ulong) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent + && PDIFF(temp1_ulong,temp2_ulong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); @@ -3928,7 +3917,7 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned long); mem2 += sizeof(unsigned long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3938,7 +3927,7 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); if (temp1_ulong != temp2_ulong) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); @@ -3948,7 +3937,7 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(unsigned long); mem2 += sizeof(unsigned long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3967,7 +3956,7 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, */ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ @@ -3979,13 +3968,13 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, h5difftrace("diff_llong start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); - if (ABS( temp1_llong-temp2_llong) > options->delta) { - if (print_data(options)) { + if (ABS( temp1_llong-temp2_llong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); @@ -3994,12 +3983,12 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(long long); mem2 += sizeof(long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); @@ -4007,15 +3996,15 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, PER(temp1_llong, temp2_llong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); @@ -4024,12 +4013,12 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(long long); mem2 += sizeof(long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); @@ -4037,16 +4026,16 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, PER(temp1_llong, temp2_llong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } - else if (per > options->percent - && ABS(temp1_llong-temp2_llong) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent + && ABS(temp1_llong-temp2_llong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); @@ -4055,7 +4044,7 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(long long); mem2 += sizeof(long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -4065,7 +4054,7 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_llong, mem2, sizeof(long long)); if (temp1_llong != temp2_llong) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); @@ -4075,7 +4064,7 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(long long); mem2 += sizeof(long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -4094,7 +4083,7 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, */ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, - hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) + hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ @@ -4107,13 +4096,13 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, h5difftrace("diff_ullong start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - if (PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { - if (print_data(options)) { + if (PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); @@ -4122,12 +4111,12 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned long long); mem2 += sizeof(unsigned long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); @@ -4137,15 +4126,15 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, PER(f1, f2); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); @@ -4154,12 +4143,12 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned long long); mem2 += sizeof(unsigned long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); @@ -4169,16 +4158,16 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, PER(f1, f2); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); } nfound++; } - else if (per > options->percent - && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { - if (print_data(options)) { + else if (per > opts->percent + && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); @@ -4187,7 +4176,7 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned long long); mem2 += sizeof(unsigned long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -4197,7 +4186,7 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); if (temp1_ullong != temp2_ullong) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); @@ -4207,7 +4196,7 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(unsigned long long); mem2 += sizeof(unsigned long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -4270,9 +4259,9 @@ done: * Purpose: use a absolute error formula to deal with floating point uncertainty *------------------------------------------------------------------------- */ -static hbool_t equal_double(double value, double expected, diff_opt_t *options) { +static hbool_t equal_double(double value, double expected, diff_opt_t *opts) { h5difftrace("equal_double start\n"); - if (options->do_nans) { + if (opts->do_nans) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- @@ -4298,7 +4287,7 @@ static hbool_t equal_double(double value, double expected, diff_opt_t *options) if (value == expected) return TRUE; - if (options->use_system_epsilon) + if (opts->use_system_epsilon) if (ABS((value-expected)) < DBL_EPSILON) return TRUE; @@ -4316,10 +4305,10 @@ static hbool_t equal_double(double value, double expected, diff_opt_t *options) #if H5_SIZEOF_LONG_DOUBLE !=0 static -hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *options) +hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts) { h5difftrace("equal_ldouble start\n"); - if (options->do_nans) { + if (opts->do_nans) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- @@ -4345,7 +4334,7 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio if (value == expected) return TRUE; - if (options->use_system_epsilon) + if (opts->use_system_epsilon) if (ABS((value-expected)) < DBL_EPSILON) return TRUE; @@ -4362,9 +4351,9 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio * Purpose: use a absolute error formula to deal with floating point uncertainty *------------------------------------------------------------------------- */ -static hbool_t equal_float(float value, float expected, diff_opt_t *options) { +static hbool_t equal_float(float value, float expected, diff_opt_t *opts) { h5difftrace("equal_float start\n"); - if (options->do_nans) { + if (opts->do_nans) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- @@ -4390,7 +4379,7 @@ static hbool_t equal_float(float value, float expected, diff_opt_t *options) { if (value == expected) return TRUE; - if (options->use_system_epsilon) + if (opts->use_system_epsilon) if ( ABS( (value-expected) ) < FLT_EPSILON) return TRUE; @@ -4490,9 +4479,9 @@ static hbool_t my_isnan(dtype_t type, void *val) { *------------------------------------------------------------------------- */ static -int print_data(diff_opt_t *options) +int print_data(diff_opt_t *opts) { - return ((options->m_report || options->m_verbose) && !options->m_quiet) ? 1 : 0; + return ((opts->m_report || opts->m_verbose) && !opts->m_quiet) ? 1 : 0; } /*------------------------------------------------------------------------- diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 64038f3..d671449 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -137,7 +137,7 @@ static void table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *ta * Parameter: * table_out [OUT] : return the list *------------------------------------------------------------------------*/ -static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t ** table_out, diff_opt_t *options) +static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t ** table_out, diff_opt_t *opts) { int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ H5O_info_t oinfo1, oinfo2; /* Object info */ @@ -264,7 +264,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t /*------------------------------------------------------ * print the list */ - if(options->m_verbose_level == 2) { + if(opts->m_verbose_level == 2) { /* if '-v2' is detected */ parallel_print(" obj1 obj2\n"); parallel_print(" --------------------------------------\n"); @@ -276,7 +276,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t } /* end for */ } - if(options->m_verbose_level >= 1) + if(opts->m_verbose_level >= 1) parallel_print("Attributes status: %d common, %d only in obj1, %d only in obj2\n", table_lp->nattrs - table_lp->nattrs_only1 - table_lp->nattrs_only2, table_lp->nattrs_only1, table_lp->nattrs_only2); @@ -312,7 +312,7 @@ hsize_t diff_attr(hid_t loc1_id, hid_t loc2_id, const char *path1, const char *path2, - diff_opt_t *options) + diff_opt_t *opts) { int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hid_t attr1_id = -1; /* attr ID */ @@ -349,16 +349,16 @@ hsize_t diff_attr(hid_t loc1_id, h5difftrace("diff_attr start\n"); /* Initialize error status */ - options->err_stat = 1; + opts->err_stat = 1; - if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, options) < 0) + if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, opts) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "build_match_list_attrs failed"); /* if detect any unique extra attr */ if(match_list_attrs->nattrs_only1 || match_list_attrs->nattrs_only2) { h5difftrace("diff_attr attributes only in one file\n"); /* exit will be 1 */ - options->contents = 0; + opts->contents = 0; } for(u = 0; u < (unsigned)match_list_attrs->nattrs; u++) { @@ -387,10 +387,10 @@ hsize_t diff_attr(hid_t loc1_id, /* no compare if either one but not both are variable string type */ if (vstrtype1 != vstrtype2) { - if((options->m_verbose || options->m_list_not_cmp)) + if((opts->m_verbose || opts->m_list_not_cmp)) parallel_print("Not comparable: one of attribute <%s/%s> or <%s/%s> is of variable length type\n", path1, name1, path2, name2); - options->not_cmp = 1; + opts->not_cmp = 1; if (H5Tclose(ftype1_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed"); if (H5Tclose(ftype2_id) < 0) @@ -432,7 +432,7 @@ hsize_t diff_attr(hid_t loc1_id, /* pass dims1 and dims2 for maxdims as well since attribute's maxdims * are always same */ if(diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, dims2, - dims1, dims2, name1, name2, options, 0) != 1) { + dims1, dims2, name1, name2, opts, 0) != 1) { if(H5Tclose(ftype1_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed"); if(H5Tclose(ftype2_id) < 0) @@ -500,22 +500,22 @@ hsize_t diff_attr(hid_t loc1_id, /* always print name */ /* verbose (-v) and report (-r) mode */ - if(options->m_verbose || options->m_report) { + if(opts->m_verbose || opts->m_report) { do_print_attrname("attribute", np1, np2); nfound = diff_array(buf1, buf2, nelmts1, (hsize_t) 0, rank1, - dims1, options, np1, np2, mtype1_id, attr1_id, attr2_id); + dims1, opts, np1, np2, mtype1_id, attr1_id, attr2_id); print_found(nfound); } /* quiet mode (-q), just count differences */ - else if(options->m_quiet) { + else if(opts->m_quiet) { nfound = diff_array(buf1, buf2, nelmts1, (hsize_t) 0, rank1, - dims1, options, np1, np2, mtype1_id, attr1_id, attr2_id); + dims1, opts, np1, np2, mtype1_id, attr1_id, attr2_id); } /* the rest (-c, none, ...) */ else { nfound = diff_array(buf1, buf2, nelmts1, (hsize_t) 0, rank1, - dims1, options, np1, np2, mtype1_id, attr1_id, attr2_id); + dims1, opts, np1, np2, mtype1_id, attr1_id, attr2_id); /* print info if compatible and difference found */ if (nfound) { @@ -562,7 +562,7 @@ hsize_t diff_attr(hid_t loc1_id, } } /* u */ - options->err_stat = 0; + opts->err_stat = 0; done: H5E_BEGIN_TRY { diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 16239f5..768caff 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -31,7 +31,7 @@ hsize_t diff_dataset(hid_t file1_id, hid_t file2_id, const char *obj1_name, const char *obj2_name, - diff_opt_t *options) + diff_opt_t *opts) { int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hid_t did1 = -1; @@ -41,7 +41,7 @@ hsize_t diff_dataset(hid_t file1_id, hsize_t nfound = 0; h5difftrace("diff_dataset start\n"); - options->err_stat = 1; + opts->err_stat = 1; /*------------------------------------------------------------------------- * open the handles *------------------------------------------------------------------------- @@ -68,13 +68,16 @@ hsize_t diff_dataset(hid_t file1_id, * 2) the internal filters might be turned off *------------------------------------------------------------------------- */ - if ((h5tools_canreadf((options->m_verbose ? obj1_name : NULL), dcpl1) == 1) && - (h5tools_canreadf((options->m_verbose ? obj2_name : NULL), dcpl2) == 1)) - nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, options); - else + if ((ret_value = h5tools_canreadf((opts->m_verbose ? obj1_name : NULL), dcpl1) == 1) && + (ret_value = h5tools_canreadf((opts->m_verbose ? obj2_name : NULL), dcpl2) == 1)) + nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, opts); + else if (ret_value < 0) { HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_canreadf failed"); + } + else + opts->not_cmp = 1; - options->err_stat = 0; + opts->err_stat = 0; done: /* disable error reporting */ @@ -86,7 +89,7 @@ done: /* enable error reporting */ } H5E_END_TRY; - h5difftrace("diff_dataset end\n"); + h5diffdebug2("diff_dataset finish:%d\n", nfound); return nfound; } @@ -145,7 +148,7 @@ hsize_t diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_name, - diff_opt_t *options) + diff_opt_t *opts) { int ret_value = 0; /* no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hid_t sid1 = -1; @@ -189,7 +192,7 @@ hsize_t diff_datasetid(hid_t did1, int i; unsigned int vl_data = 0; /*contains VL datatypes */ - options->err_stat = 1; + opts->err_stat = 1; h5difftrace("diff_datasetid start\n"); /* Get the dataspace handle */ if((sid1 = H5Dget_space(did1)) < 0) @@ -255,14 +258,14 @@ hsize_t diff_datasetid(hid_t did1, if(storage_size1 == 0 || storage_size2 == 0) { if(stl1 == H5D_VIRTUAL || stl2 == H5D_VIRTUAL) { - if((options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) + if((opts->m_verbose||opts->m_list_not_cmp) && obj1_name && obj2_name) parallel_print("Warning: <%s> or <%s> is a virtual dataset\n", obj1_name, obj2_name); } else { - if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) parallel_print("Not comparable: <%s> or <%s> is an empty dataset\n", obj1_name, obj2_name); can_compare = 0; - options->not_cmp = 1; + opts->not_cmp = 1; } } @@ -273,7 +276,7 @@ hsize_t diff_datasetid(hid_t did1, if (diff_can_type(f_tid1, f_tid2, rank1, rank2, dims1, dims2, maxdim1, maxdim2, obj1_name, obj2_name, - options, 0) != 1) + opts, 0) != 1) can_compare = 0; /*------------------------------------------------------------------------- @@ -301,13 +304,13 @@ hsize_t diff_datasetid(hid_t did1, sign2 = H5Tget_sign(m_tid2); if(sign1 != sign2) { h5difftrace("sign1 != sign2\n"); - if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1)); parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2)); } can_compare = 0; - options->not_cmp = 1; + opts->not_cmp = 1; } } @@ -401,7 +404,7 @@ hsize_t diff_datasetid(hid_t did1, /* array diff */ nfound = diff_array(buf1, buf2, danelmts, (hsize_t)0, rank1, dadims, - options, name1, name2, dam_tid, did1, did2); + opts, name1, name2, dam_tid, did1, did2); h5diffdebug2("diff_array nfound:%d\n", nfound); /* reclaim any VL memory, if necessary */ @@ -496,7 +499,7 @@ hsize_t diff_datasetid(hid_t did1, /* get array differences. in the case of hyperslab read, increment the number of differences found in each hyperslab and pass the position at the beginning for printing */ nfound += diff_array(sm_buf1, sm_buf2, hs_nelmts, elmtno, rank1, - dadims, options, name1, name2, dam_tid, did1, did2); + dadims, opts, name1, name2, dam_tid, did1, did2); /* reclaim any VL memory, if necessary */ if(vl_data) { @@ -535,7 +538,7 @@ hsize_t diff_datasetid(hid_t did1, done: - options->err_stat = ret_value; + opts->err_stat = ret_value; /* free */ if(buf1 != NULL) { @@ -577,8 +580,8 @@ done: H5Tclose(m_tid2); /* enable error reporting */ } H5E_END_TRY; - h5diffdebug3("diff_datasetid return:%d with nfound:%d\n", ret_value, nfound); + h5diffdebug3("diff_datasetid return:%d with nfound:%d\n", ret_value, nfound); return nfound; } @@ -604,10 +607,10 @@ int diff_can_type(hid_t f_tid1, /* file data type */ hsize_t *maxdim2, const char *obj1_name, const char *obj2_name, - diff_opt_t *options, + diff_opt_t *opts, int is_compound) { - int ret_value = 0; /* can_compare value, no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 1; /* can_compare value */ H5T_class_t tclass1; H5T_class_t tclass2; int maxdim_diff = 0; /* maximum dimensions are different */ @@ -625,7 +628,7 @@ int diff_can_type(hid_t f_tid1, /* file data type */ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_class second object failed"); if(tclass1 != tclass2) { - if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { if(is_compound) { parallel_print("Not comparable: <%s> has a class %s and <%s> has a class %s\n", obj1_name, get_class(tclass1), @@ -637,7 +640,7 @@ int diff_can_type(hid_t f_tid1, /* file data type */ obj2_name, get_class(tclass2)); } } - options->not_cmp = 1; + opts->not_cmp = 1; HGOTO_DONE(0); } @@ -647,11 +650,11 @@ int diff_can_type(hid_t f_tid1, /* file data type */ */ switch (tclass1) { case H5T_TIME: - if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> and <%s> are of class %s\n", obj1_name, obj2_name, get_class(tclass2)); } /* end if */ - options->not_cmp = 1; + opts->not_cmp = 1; HGOTO_DONE(0); case H5T_INTEGER: @@ -675,7 +678,7 @@ int diff_can_type(hid_t f_tid1, /* file data type */ * check for equal file datatype; warning only *------------------------------------------------------------------------- */ - if((H5Tequal(f_tid1, f_tid2) == 0) && (options->m_verbose) && obj1_name && obj2_name) { + if((H5Tequal(f_tid1, f_tid2) == 0) && (opts->m_verbose) && obj1_name && obj2_name) { H5T_class_t cl = H5Tget_class(f_tid1); parallel_print("Warning: different storage datatype\n"); @@ -694,7 +697,7 @@ int diff_can_type(hid_t f_tid1, /* file data type */ *------------------------------------------------------------------------- */ if(rank1 != rank2) { - if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); print_dimensions(rank1, dims1); parallel_print(", max dimensions "); @@ -706,7 +709,7 @@ int diff_can_type(hid_t f_tid1, /* file data type */ print_dimensions(rank2, maxdim2); parallel_print("\n"); } - options->not_cmp = 1; + opts->not_cmp = 1; HGOTO_DONE(0); } @@ -728,7 +731,7 @@ int diff_can_type(hid_t f_tid1, /* file data type */ *------------------------------------------------------------------------- */ if(dim_diff == 1) { - if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); print_dimensions(rank1, dims1); if(maxdim1 && maxdim2) { @@ -742,7 +745,7 @@ int diff_can_type(hid_t f_tid1, /* file data type */ parallel_print("\n"); } } - options->not_cmp = 1; + opts->not_cmp = 1; HGOTO_DONE(0); } @@ -751,7 +754,7 @@ int diff_can_type(hid_t f_tid1, /* file data type */ *------------------------------------------------------------------------- */ if(maxdim1 && maxdim2 && maxdim_diff == 1 && obj1_name) { - if(options->m_verbose) { + if(opts->m_verbose) { parallel_print( "Warning: different maximum dimensions\n"); parallel_print("<%s> has max dimensions ", obj1_name); print_dimensions(rank1, maxdim1); @@ -773,12 +776,12 @@ int diff_can_type(hid_t f_tid1, /* file data type */ nmembs2 = H5Tget_nmembers(f_tid2); if(nmembs1 != nmembs2) { - if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has %d members ", obj1_name, nmembs1); parallel_print("<%s> has %d members ", obj2_name, nmembs2); parallel_print("\n"); } - options->not_cmp = 1; + opts->not_cmp = 1; HGOTO_DONE(0); } @@ -788,8 +791,8 @@ int diff_can_type(hid_t f_tid1, /* file data type */ if (diff_can_type(memb_type1, memb_type2, rank1, rank2, dims1, dims2, maxdim1, maxdim2, obj1_name, obj2_name, - options, 1) != 1) { - options->not_cmp = 1; + opts, 1) != 1) { + opts->not_cmp = 1; H5Tclose(memb_type1); H5Tclose(memb_type2); HGOTO_DONE(0); @@ -799,7 +802,7 @@ int diff_can_type(hid_t f_tid1, /* file data type */ } } done: - h5diffdebug2("diff_can_type end - %d\n", can_compare); + h5diffdebug2("diff_can_type end - %d\n", ret_value); return ret_value; } diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index a5d0994..132e69a 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -21,7 +21,7 @@ static void print_warning(const char *dname, const char *fname) { fprintf(stderr, - "warning: dataset <%s> cannot be read, %s filter is not available\n", + "Warning: dataset <%s> cannot be read, %s filter is not available\n", dname, fname); } diff --git a/tools/lib/ph5diff.h b/tools/lib/ph5diff.h index 996a611..2189e31 100644 --- a/tools/lib/ph5diff.h +++ b/tools/lib/ph5diff.h @@ -32,7 +32,7 @@ struct diff_mpi_args { char name1[256]; char name2[256]; - diff_opt_t options; + diff_opt_t opts; diff_args_t argdata; /* rest args */ }; diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index e4696c0..532169f 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -52,7 +52,7 @@ static struct long_options l_opts[] = { * *------------------------------------------------------------------------- */ -static void check_options(diff_opt_t* options) +static void check_options(diff_opt_t* opts) { /*-------------------------------------------------------------- * check for mutually exclusive options @@ -61,7 +61,7 @@ static void check_options(diff_opt_t* options) /* check between -d , -p, --use-system-epsilon. * These options are mutually exclusive. */ - if ((options->d + options->p + options->use_system_epsilon) > 1) { + if ((opts->d + opts->p + opts->use_system_epsilon) > 1) { printf("%s error: -d, -p and --use-system-epsilon options are mutually-exclusive;\n", PROGRAMNAME); printf("use no more than one.\n"); printf("Try '-h' or '--help' option for more information or see the %s entry in the 'HDF5 Reference Manual'.\n", PROGRAMNAME); @@ -84,27 +84,27 @@ void parse_command_line(int argc, const char** fname2, const char** objname1, const char** objname2, - diff_opt_t* options) + diff_opt_t* opts) { int i; int opt; struct exclude_path_list *exclude_head, *exclude_prev, *exclude_node; /* process the command-line */ - memset(options, 0, sizeof (diff_opt_t)); + memset(opts, 0, sizeof (diff_opt_t)); /* assume equal contents initially */ - options->contents = 1; + opts->contents = 1; /* NaNs are handled by default */ - options->do_nans = 1; + opts->do_nans = 1; /* not Listing objects that are not comparable */ - options->m_list_not_cmp = 0; + opts->m_list_not_cmp = 0; /* initially no not-comparable. */ /**this is bad in mixing option with results**/ - options->not_cmp=0; + opts->not_cmp=0; /* init for exclude-path option */ exclude_head = NULL; @@ -125,7 +125,7 @@ void parse_command_line(int argc, h5diff_exit(EXIT_SUCCESS); case 'v': - options->m_verbose = 1; + opts->m_verbose = 1; /* This for loop is for handling style like * -v, -v1, --verbose, --verbose=1. */ @@ -135,11 +135,11 @@ void parse_command_line(int argc, */ if (!strcmp (argv[i], "-v")) { /* no arg */ opt_ind--; - options->m_verbose_level = 0; + opts->m_verbose_level = 0; break; } else if (!strncmp (argv[i], "-v", (size_t)2)) { - options->m_verbose_level = atoi(&argv[i][2]); + opts->m_verbose_level = atoi(&argv[i][2]); break; } @@ -147,11 +147,11 @@ void parse_command_line(int argc, * long opt */ if (!strcmp (argv[i], "--verbose")) { /* no arg */ - options->m_verbose_level = 0; + opts->m_verbose_level = 0; break; } else if ( !strncmp (argv[i], "--verbose", (size_t)9) && argv[i][9]=='=') { - options->m_verbose_level = atoi(&argv[i][10]); + opts->m_verbose_level = atoi(&argv[i][10]); break; } } @@ -159,19 +159,19 @@ void parse_command_line(int argc, case 'q': /* use quiet mode; supress the message "0 differences found" */ - options->m_quiet = 1; + opts->m_quiet = 1; break; case 'r': - options->m_report = 1; + opts->m_report = 1; break; case 'l': - options->follow_links = TRUE; + opts->follow_links = TRUE; break; case 'x': - options->no_dangle_links = 1; + opts->no_dangle_links = 1; break; case 'S': @@ -179,7 +179,7 @@ void parse_command_line(int argc, break; case 'E': - options->exclude_path = 1; + opts->exclude_path = 1; /* create linked list of excluding objects */ if( (exclude_node = (struct exclude_path_list*) HDmalloc(sizeof(struct exclude_path_list))) == NULL) { @@ -206,64 +206,64 @@ void parse_command_line(int argc, break; case 'd': - options->d=1; + opts->d=1; if (check_d_input(opt_arg) == - 1) { printf("<-d %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - options->delta = atof(opt_arg); + opts->delta = atof(opt_arg); /* -d 0 is the same as default */ - if (H5_DBL_ABS_EQUAL(options->delta, (double)0.0F)) - options->d=0; + if (H5_DBL_ABS_EQUAL(opts->delta, (double)0.0F)) + opts->d=0; break; case 'p': - options->p=1; + opts->p=1; if (check_p_input(opt_arg) == -1) { printf("<-p %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - options->percent = atof(opt_arg); + opts->percent = atof(opt_arg); /* -p 0 is the same as default */ - if (H5_DBL_ABS_EQUAL(options->percent, (double)0.0F)) - options->p = 0; + if (H5_DBL_ABS_EQUAL(opts->percent, (double)0.0F)) + opts->p = 0; break; case 'n': - options->n=1; + opts->n=1; if ( check_n_input(opt_arg) == -1) { printf("<-n %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - options->count = HDstrtoull(opt_arg, NULL, 0); + opts->count = HDstrtoull(opt_arg, NULL, 0); break; case 'N': - options->do_nans = 0; + opts->do_nans = 0; break; case 'c': - options->m_list_not_cmp = 1; + opts->m_list_not_cmp = 1; break; case 'e': - options->use_system_epsilon = 1; + opts->use_system_epsilon = 1; break; } } /* check options */ - check_options(options); + check_options(opts); /* if exclude-path option is used, keep the exclude path list */ - if (options->exclude_path) - options->exclude = exclude_head; + if (opts->exclude_path) + opts->exclude = exclude_head; /* check for file names to be processed */ if (argc <= opt_ind || argv[ opt_ind + 1 ] == NULL) { @@ -300,23 +300,23 @@ void parse_command_line(int argc, *------------------------------------------------------------------------- */ - void print_info(diff_opt_t* options) + void print_info(diff_opt_t* opts) { - if (options->m_quiet || options->err_stat) + if (opts->m_quiet || opts->err_stat) return; - if (options->cmn_objs == 0) { + if (opts->cmn_objs == 0) { printf("No common objects found. Files are not comparable.\n"); - if (!options->m_verbose) + if (!opts->m_verbose) printf("Use -v for a list of objects.\n"); } - if (options->not_cmp == 1) { - if (options->m_list_not_cmp == 0) { + if (opts->not_cmp == 1) { + if (opts->m_list_not_cmp == 0) { printf("--------------------------------\n"); printf("Some objects are not comparable\n"); printf("--------------------------------\n"); - if (options->m_verbose) + if (opts->m_verbose) printf("Use -c for a list of objects without details of differences.\n"); else printf("Use -c for a list of objects.\n"); diff --git a/tools/src/h5diff/h5diff_common.h b/tools/src/h5diff/h5diff_common.h index e5dfe3f..dc0676c 100644 --- a/tools/src/h5diff/h5diff_common.h +++ b/tools/src/h5diff/h5diff_common.h @@ -23,9 +23,9 @@ extern "C" { #endif void usage(void); -void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* options); +void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* opts); void h5diff_exit(int status); -void print_info(diff_opt_t* options); +void print_info(diff_opt_t* opts); #ifdef __cplusplus } diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index 8dab3b4..ad488a4 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -78,7 +78,7 @@ int main(int argc, const char *argv[]) const char *objname1 = NULL; const char *objname2 = NULL; hsize_t nfound=0; - diff_opt_t options; + diff_opt_t opts; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -98,7 +98,7 @@ int main(int argc, const char *argv[]) * process the command-line *------------------------------------------------------------------------- */ - parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); + parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts); if (enable_error_stack) { H5Eset_auto2(H5E_DEFAULT, func, edata); @@ -110,9 +110,9 @@ int main(int argc, const char *argv[]) *------------------------------------------------------------------------- */ - nfound = h5diff(fname1, fname2, objname1, objname2, &options); + nfound = h5diff(fname1, fname2, objname1, objname2, &opts); - print_info(&options); + print_info(&opts); /*------------------------------------------------------------------------- * exit code @@ -123,11 +123,11 @@ int main(int argc, const char *argv[]) ret = (nfound == 0 ? 0 : 1); /* if graph difference return 1 for differences */ - if (options.contents == 0) + if (opts.contents == 0) ret = 1; /* and return 2 for error */ - if (options.err_stat) + if (opts.err_stat) ret = 2; h5diff_exit(ret); diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index 89efc39..83240cb 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -50,7 +50,7 @@ int main(int argc, const char *argv[]) const char *fname2 = NULL; const char *objname1 = NULL; const char *objname2 = NULL; - diff_opt_t options; + diff_opt_t opts; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -72,11 +72,11 @@ int main(int argc, const char *argv[]) g_Parallel = 0; - parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); + parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts); - h5diff(fname1, fname2, objname1, objname2, &options); + h5diff(fname1, fname2, objname1, objname2, &opts); - print_info(&options); + print_info(&opts); } /* Parallel h5diff */ else { @@ -84,13 +84,13 @@ int main(int argc, const char *argv[]) /* Have the manager process the command-line */ if(nID == 0) { - parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); + parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts); - h5diff(fname1, fname2, objname1, objname2, &options); + h5diff(fname1, fname2, objname1, objname2, &opts); MPI_Barrier(MPI_COMM_WORLD); - print_info(&options); + print_info(&opts); print_manager_output(); } /* All other tasks become workers and wait for assignments. */ @@ -178,8 +178,8 @@ ph5diff_worker(int nID) MPI_Recv(&args, sizeof(args), MPI_BYTE, 0, MPI_TAG_ARGS, MPI_COMM_WORLD, &Status); /* Do the diff */ - diffs.nfound = diff(file1_id, args.name1, file2_id, args.name2, &(args.options), &(args.argdata)); - diffs.not_cmp = args.options.not_cmp; + diffs.nfound = diff(file1_id, args.name1, file2_id, args.name2, &(args.opts), &(args.argdata)); + diffs.not_cmp = args.opts.not_cmp; /* If print buffer has something in it, request print token.*/ if(outBuffOffset>0) diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 2db7fdd..d570d02 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -221,7 +221,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, hid_t ret_value = -1; /* The identifier of the named dtype in the out file */ if (H5Oget_info(type_in, &oinfo) < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info failed"); if (*named_dt_head_p) { /* Stack already exists, search for the datatype */ @@ -238,7 +238,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, if (travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) { /* Push onto the stack */ if (NULL == (dt = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "buffer allocation failed failed"); dt->next = *named_dt_head_p; *named_dt_head_p = dt; @@ -259,7 +259,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, if (!dt_ret) { /* Push the new datatype onto the stack */ if (NULL == (dt_ret = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "buffer allocation failed failed"); dt_ret->next = *named_dt_head_p; *named_dt_head_p = dt_ret; @@ -276,9 +276,9 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, else dt_ret->id_out = H5Tcopy(type_in); if (dt_ret->id_out < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type-H5Tcopy failed"); if (H5Tcommit_anon(fidout, dt_ret->id_out, H5P_DEFAULT, H5P_DEFAULT) < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tcommit_anon failed"); } /* end if */ /* Set return value */ @@ -305,7 +305,7 @@ int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) { while (dt) { /* Pop the datatype off the stack and free it */ if (H5Tclose(dt->id_out) < 0 && !ignore_err) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); dt = dt->next; HDfree(*named_dt_head_p); *named_dt_head_p = dt; diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index 4a519ab..c57cd5e 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -10,14 +10,44 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) # Add the h5copy test executables # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS) - add_executable (h5copygentest ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/h5copygentest.c) - TARGET_NAMING (h5copygentest STATIC) - TARGET_C_PROPERTIES (h5copygentest STATIC " " " ") - target_link_libraries (h5copygentest ${HDF5_LIB_TARGET}) - set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) +if (HDF5_BUILD_GENERATORS) + add_executable (h5copygentest ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/h5copygentest.c) + TARGET_NAMING (h5copygentest STATIC) + TARGET_C_PROPERTIES (h5copygentest STATIC " " " ") + target_link_libraries (h5copygentest ${HDF5_LIB_TARGET}) + set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) - #add_test (NAME h5copygentest COMMAND $) - endif () + #add_test (NAME h5copygentest COMMAND $) +endif () - include (CMakeTests.cmake) +#----------------------------------------------------------------------------- +# If plugin library tests can be tested +#----------------------------------------------------------------------------- +if (BUILD_SHARED_LIBS) + set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibcopy") + set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") + set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_copy.c) + TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") + target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + + # make plugins dir + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$" + "${CMAKE_BINARY_DIR}/plugins/$" + ) +endif () + +include (CMakeTests.cmake) diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index b60c0e9..f9733cf 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -24,10 +24,14 @@ ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5 ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.h5 ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5 + ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5 + ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter2.h5 ) set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out + ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5.txt + ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5_ERR.txt ) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") @@ -74,7 +78,7 @@ if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY_F-${testname}-DIFF - COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) if ("${resultcode}" STREQUAL "1") @@ -110,7 +114,7 @@ if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY-${testname}-DIFF - COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if ("${resultcode}" STREQUAL "1") @@ -160,7 +164,7 @@ if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY-${testname}-DIFF - COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if ("${resultcode}" STREQUAL "1") @@ -201,7 +205,7 @@ if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY_SAME-${testname}-DIFF - COMMAND $ -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND $ -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) if ("${resultcode}" STREQUAL "1") @@ -250,6 +254,108 @@ endif () endmacro () + macro (ADD_H5_UD_TEST testname resultcode infile sparam srcname dparam dstname cmpfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5COPY_UD-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${testname}.out.h5 + testfiles/${infile}.out + testfiles/${infile}.out.err + ) + if ("${resultcode}" STREQUAL "2") + add_test ( + NAME H5COPY_UD-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${sparam};${srcname};${dparam};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${infile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=./testfiles/${infile}.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + else () + add_test ( + NAME H5COPY_UD-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${sparam};${srcname};${dparam};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${infile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=./testfiles/${infile}.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + add_test ( + NAME H5COPY_UD-${testname}-DIFF + COMMAND $ -v ./testfiles/${cmpfile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + ) + SET_TESTS_PROPERTIES(H5COPY_UD-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD-${testname}) + if ("${resultcode}" STREQUAL "1") + set_tests_properties (H5COPY_UD-${testname}-DIFF PROPERTIES WILL_FAIL "true") + endif () + endif () + set_tests_properties (H5COPY_UD-${testname} PROPERTIES DEPENDS H5COPY_UD-${testname}-clear-objects) + endif () + endmacro () + + macro (ADD_H5_UD_ERR_TEST testname resultcode infile sparam srcname dparam dstname cmpfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5COPY_UD_ERR-${testname}-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${testname}_ERR.out.h5 + testfiles/${infile}_ERR.out + testfiles/${infile}_ERR.out.err + ) + if ("${resultcode}" STREQUAL "2") + add_test ( + NAME H5COPY_UD_ERR-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;--enable-error-stack;-i;./testfiles/${infile};-o;./testfiles/${testname}_ERR.out.h5;${sparam};${srcname};${dparam};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${infile}_ERR.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=./testfiles/${infile}_ERR.txt" + -D "TEST_MASK_ERROR=true" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + else () + add_test ( + NAME H5COPY_UD_ERR-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;--enable-error-stack;-i;./testfiles/${infile};-o;./testfiles/${testname}_ERR.out.h5;${sparam};${srcname};${dparam};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${infile}_ERR.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=./testfiles/${infile}_ERR.txt" + -D "TEST_MASK_ERROR=true" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (H5COPY_UD_ERR-${testname} PROPERTIES DEPENDS H5COPY_UD_ERR-${testname}-clearall-objects) + endif () + endmacro () + ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -434,3 +540,11 @@ else () ADD_H5_TEST_SAME (samefile2 2 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) endif () + +############################################################################## +### P L U G I N T E S T S +############################################################################## +if (BUILD_SHARED_LIBS) + ADD_H5_UD_TEST (h5copy_plugin_test 0 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5 ) + ADD_H5_UD_TEST (h5copy_plugin_fail 2 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5) +endif () diff --git a/tools/test/h5copy/dynlib_copy.c b/tools/test/h5copy/dynlib_copy.c new file mode 100644 index 0000000..571452e --- /dev/null +++ b/tools/test/h5copy/dynlib_copy.c @@ -0,0 +1,89 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * Purpose: Tests the plugin module (H5PL) + */ + +#include +#include +#include "H5PLextern.h" + +#define H5Z_FILTER_DYNLIBUD 300 +#define MULTIPLIER 3 + +static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIBUD, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlibud", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIBUD;} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlibud + * + * Purpose: A dynlib2 filter method that multiplies the original value + * during write and divide the original value during read. It + * will be built as a shared library. plugin.c test will load + * and use this filter library. + * + * Return: Success: Data chunk size + * + * Failure: 0 + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + char *int_ptr = (char *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ + + /* Check for the correct number of parameters */ + if(cd_nelmts > 0) + return(0); + + /* Assignment to eliminate unused parameter warning. */ + cd_values = cd_values; + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + /* Subtract the original value with MULTIPLIER */ + while(buf_left > 0) { + char temp = *int_ptr; + *int_ptr = temp - MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); + } /* end while */ + } /* end if */ + else { /*write*/ + /* Add the original value with MULTIPLIER */ + while(buf_left > 0) { + char temp = *int_ptr; + *int_ptr = temp + MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); + } /* end while */ + } /* end else */ + + return nbytes; +} /* end H5Z_filter_dynlibud() */ + diff --git a/tools/test/h5copy/testfiles/tudfilter.h5 b/tools/test/h5copy/testfiles/tudfilter.h5 new file mode 100644 index 0000000..081b000 Binary files /dev/null and b/tools/test/h5copy/testfiles/tudfilter.h5 differ diff --git a/tools/test/h5copy/testfiles/tudfilter.h5.txt b/tools/test/h5copy/testfiles/tudfilter.h5.txt new file mode 100644 index 0000000..8f3d0b5 --- /dev/null +++ b/tools/test/h5copy/testfiles/tudfilter.h5.txt @@ -0,0 +1,2 @@ +Copying file <./testfiles/tudfilter.h5> and object to file <./testfiles/h5copy_plugin_fail.out.h5> and object +EXIT CODE: 0 diff --git a/tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt b/tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt new file mode 100644 index 0000000..8f3d0b5 --- /dev/null +++ b/tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt @@ -0,0 +1,2 @@ +Copying file <./testfiles/tudfilter.h5> and object to file <./testfiles/h5copy_plugin_fail.out.h5> and object +EXIT CODE: 0 diff --git a/tools/test/h5copy/testfiles/tudfilter2.h5 b/tools/test/h5copy/testfiles/tudfilter2.h5 new file mode 100644 index 0000000..081b000 Binary files /dev/null and b/tools/test/h5copy/testfiles/tudfilter2.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_454_ERR.err b/tools/test/h5diff/testfiles/h5diff_454_ERR.err index 8fa1718..82802a1 100644 --- a/tools/test/h5diff/testfiles/h5diff_454_ERR.err +++ b/tools/test/h5diff/testfiles/h5diff_454_ERR.err @@ -1,4 +1,4 @@ H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_454_ERR.txt b/tools/test/h5diff/testfiles/h5diff_454_ERR.txt index de25a69..4501071 100644 --- a/tools/test/h5diff/testfiles/h5diff_454_ERR.txt +++ b/tools/test/h5diff/testfiles/h5diff_454_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_455_ERR.err b/tools/test/h5diff/testfiles/h5diff_455_ERR.err index 8fa1718..82802a1 100644 --- a/tools/test/h5diff/testfiles/h5diff_455_ERR.err +++ b/tools/test/h5diff/testfiles/h5diff_455_ERR.err @@ -1,4 +1,4 @@ H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_455_ERR.txt b/tools/test/h5diff/testfiles/h5diff_455_ERR.txt index de25a69..4501071 100644 --- a/tools/test/h5diff/testfiles/h5diff_455_ERR.txt +++ b/tools/test/h5diff/testfiles/h5diff_455_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_457_ERR.err b/tools/test/h5diff/testfiles/h5diff_457_ERR.err index 8fa1718..82802a1 100644 --- a/tools/test/h5diff/testfiles/h5diff_457_ERR.err +++ b/tools/test/h5diff/testfiles/h5diff_457_ERR.err @@ -1,4 +1,4 @@ H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_457_ERR.txt b/tools/test/h5diff/testfiles/h5diff_457_ERR.txt index 6594c9a..9d73750 100644 --- a/tools/test/h5diff/testfiles/h5diff_457_ERR.txt +++ b/tools/test/h5diff/testfiles/h5diff_457_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_458_ERR.err b/tools/test/h5diff/testfiles/h5diff_458_ERR.err index 8fa1718..82802a1 100644 --- a/tools/test/h5diff/testfiles/h5diff_458_ERR.err +++ b/tools/test/h5diff/testfiles/h5diff_458_ERR.err @@ -1,4 +1,4 @@ H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_458_ERR.txt b/tools/test/h5diff/testfiles/h5diff_458_ERR.txt index 9a09c17..b084914 100644 --- a/tools/test/h5diff/testfiles/h5diff_458_ERR.txt +++ b/tools/test/h5diff/testfiles/h5diff_458_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_459_ERR.err b/tools/test/h5diff/testfiles/h5diff_459_ERR.err index 8fa1718..82802a1 100644 --- a/tools/test/h5diff/testfiles/h5diff_459_ERR.err +++ b/tools/test/h5diff/testfiles/h5diff_459_ERR.err @@ -1,4 +1,4 @@ H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/test/h5diff/testfiles/h5diff_459_ERR.txt b/tools/test/h5diff/testfiles/h5diff_459_ERR.txt index 6594c9a..9d73750 100644 --- a/tools/test/h5diff/testfiles/h5diff_459_ERR.txt +++ b/tools/test/h5diff/testfiles/h5diff_459_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 -- cgit v0.12 From e071e746f86c2ab13f8a93b9680b20ee8a557b29 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 16 Oct 2017 17:39:56 -0500 Subject: HDFFV-1097 Changed file columns --- tools/test/h5diff/testfiles/h5diff_417.txt | 2 +- tools/test/h5diff/testfiles/h5diff_418.txt | 2 +- tools/test/h5diff/testfiles/h5diff_419.txt | 2 +- tools/test/h5diff/testfiles/h5diff_420.txt | 2 +- tools/test/h5diff/testfiles/h5diff_421.txt | 2 +- tools/test/h5diff/testfiles/h5diff_422.txt | 2 +- tools/test/h5diff/testfiles/h5diff_60.txt | 4 +- tools/test/h5diff/testfiles/h5diff_61.txt | 48 +- tools/test/h5diff/testfiles/h5diff_62.txt | 62 +-- tools/test/h5diff/testfiles/h5diff_63.txt | 8 +- tools/test/h5diff/testfiles/h5diff_70.txt | 756 ++++++++++++++--------------- tools/test/h5diff/testfiles/h5diff_700.txt | 756 ++++++++++++++--------------- tools/test/h5diff/testfiles/h5diff_701.txt | 756 ++++++++++++++--------------- tools/test/h5diff/testfiles/h5diff_702.txt | 756 ++++++++++++++--------------- tools/test/h5diff/testfiles/h5diff_703.txt | 756 ++++++++++++++--------------- tools/test/h5diff/testfiles/h5diff_80.txt | 252 +++++----- 16 files changed, 2083 insertions(+), 2083 deletions(-) diff --git a/tools/test/h5diff/testfiles/h5diff_417.txt b/tools/test/h5diff/testfiles/h5diff_417.txt index 0ea2542..29d467a 100644 --- a/tools/test/h5diff/testfiles/h5diff_417.txt +++ b/tools/test/h5diff/testfiles/h5diff_417.txt @@ -1,3 +1,3 @@ obj1 is a dangling link. 1 differences found -EXIT CODE: 1 +EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_418.txt b/tools/test/h5diff/testfiles/h5diff_418.txt index 46222bb..b6173d9 100644 --- a/tools/test/h5diff/testfiles/h5diff_418.txt +++ b/tools/test/h5diff/testfiles/h5diff_418.txt @@ -1,3 +1,3 @@ obj2 is a dangling link. 1 differences found -EXIT CODE: 1 +EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_419.txt b/tools/test/h5diff/testfiles/h5diff_419.txt index 387c600..ee6e831 100644 --- a/tools/test/h5diff/testfiles/h5diff_419.txt +++ b/tools/test/h5diff/testfiles/h5diff_419.txt @@ -1,3 +1,3 @@ obj1 is a dangling link. 1 differences found -EXIT CODE: 1 +EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_420.txt b/tools/test/h5diff/testfiles/h5diff_420.txt index f3e65d9..67c22ba 100644 --- a/tools/test/h5diff/testfiles/h5diff_420.txt +++ b/tools/test/h5diff/testfiles/h5diff_420.txt @@ -1,3 +1,3 @@ obj2 is a dangling link. 1 differences found -EXIT CODE: 1 +EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_421.txt b/tools/test/h5diff/testfiles/h5diff_421.txt index 833c60c..7fd70ee 100644 --- a/tools/test/h5diff/testfiles/h5diff_421.txt +++ b/tools/test/h5diff/testfiles/h5diff_421.txt @@ -1,3 +1,3 @@ obj2 is a dangling link. 1 differences found -EXIT CODE: 1 +EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_422.txt b/tools/test/h5diff/testfiles/h5diff_422.txt index 3e675d5..d1114af 100644 --- a/tools/test/h5diff/testfiles/h5diff_422.txt +++ b/tools/test/h5diff/testfiles/h5diff_422.txt @@ -1,3 +1,3 @@ obj1 is a dangling link. 1 differences found -EXIT CODE: 1 +EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_60.txt b/tools/test/h5diff/testfiles/h5diff_60.txt index 938f279..dde17f6 100644 --- a/tools/test/h5diff/testfiles/h5diff_60.txt +++ b/tools/test/h5diff/testfiles/h5diff_60.txt @@ -2,8 +2,8 @@ dataset: and size: [3x4] [3x4] position string1 string1 difference ------------------------------------------------------------ -[ 1 0 ] 5 \000 -[ 1 1 ] 6 \000 +[ 1 0 ] \000 5 +[ 1 1 ] \000 6 [ 1 2 ] \000 7 [ 1 3 ] \000 8 4 differences found diff --git a/tools/test/h5diff/testfiles/h5diff_61.txt b/tools/test/h5diff/testfiles/h5diff_61.txt index 1f238b1..5553d63 100644 --- a/tools/test/h5diff/testfiles/h5diff_61.txt +++ b/tools/test/h5diff/testfiles/h5diff_61.txt @@ -2,29 +2,29 @@ dataset: and size: [20] [20] position string2 string2 difference ------------------------------------------------------------ -[ 8 ] 9 e -[ 8 ] f -[ 8 ] 9 -[ 9 ] 0 e -[ 9 ] f -[ 9 ] 0 -[ 10 ] 1 e -[ 10 ] f -[ 10 ] 1 -[ 11 ] 2 e -[ 11 ] f -[ 11 ] 2 -[ 12 ] e 3 -[ 12 ] f -[ 12 ] 3 -[ 13 ] e 4 -[ 13 ] f -[ 13 ] 4 -[ 14 ] e 5 -[ 14 ] f -[ 14 ] 5 -[ 15 ] e 6 -[ 15 ] f -[ 15 ] 6 +[ 8 ] e 9 +[ 8 ] f +[ 8 ] 9 +[ 9 ] e 0 +[ 9 ] f +[ 9 ] 0 +[ 10 ] e 1 +[ 10 ] f +[ 10 ] 1 +[ 11 ] e 2 +[ 11 ] f +[ 11 ] 2 +[ 12 ] 3 e +[ 12 ] f +[ 12 ] 3 +[ 13 ] 4 e +[ 13 ] f +[ 13 ] 4 +[ 14 ] 5 e +[ 14 ] f +[ 14 ] 5 +[ 15 ] 6 e +[ 15 ] f +[ 15 ] 6 24 differences found EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_62.txt b/tools/test/h5diff/testfiles/h5diff_62.txt index 0cc0947..934f61e 100644 --- a/tools/test/h5diff/testfiles/h5diff_62.txt +++ b/tools/test/h5diff/testfiles/h5diff_62.txt @@ -2,36 +2,36 @@ dataset: and size: [27] [27] position string3 string3 difference ------------------------------------------------------------ -[ 12 ] d c -[ 12 ] 2 d -[ 12 ] \000 2 -[ 13 ] 3 d -[ 13 ] \000 3 -[ 14 ] b a -[ 14 ] c b -[ 14 ] d c -[ 14 ] 4 d -[ 14 ] \000 4 -[ 15 ] c b -[ 15 ] d c -[ 15 ] 5 d -[ 15 ] \000 5 -[ 16 ] c d -[ 16 ] d 6 -[ 16 ] 6 \000 -[ 17 ] d 7 -[ 17 ] 7 \000 -[ 18 ] a b -[ 18 ] b c -[ 18 ] c d -[ 18 ] d 8 -[ 18 ] 8 \000 -[ 19 ] b c -[ 19 ] c d -[ 19 ] d 9 -[ 19 ] 9 \000 -[ 24 ] c d -[ 25 ] c d -[ 26 ] c d +[ 12 ] c d +[ 12 ] d 2 +[ 12 ] 2 \000 +[ 13 ] d 3 +[ 13 ] 3 \000 +[ 14 ] a b +[ 14 ] b c +[ 14 ] c d +[ 14 ] d 4 +[ 14 ] 4 \000 +[ 15 ] b c +[ 15 ] c d +[ 15 ] d 5 +[ 15 ] 5 \000 +[ 16 ] d c +[ 16 ] 6 d +[ 16 ] \000 6 +[ 17 ] 7 d +[ 17 ] \000 7 +[ 18 ] b a +[ 18 ] c b +[ 18 ] d c +[ 18 ] 8 d +[ 18 ] \000 8 +[ 19 ] c b +[ 19 ] d c +[ 19 ] 9 d +[ 19 ] \000 9 +[ 24 ] d c +[ 25 ] d c +[ 26 ] d c 31 differences found EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_63.txt b/tools/test/h5diff/testfiles/h5diff_63.txt index 043da16..6b46c18 100644 --- a/tools/test/h5diff/testfiles/h5diff_63.txt +++ b/tools/test/h5diff/testfiles/h5diff_63.txt @@ -2,9 +2,9 @@ dataset: and size: [3] [3] position string4 string4 difference ------------------------------------------------------------ -[ 1 ] 8 -[ 1 ] 9 -[ 2 ] 8 -[ 2 ] 9 +[ 1 ] 8 +[ 1 ] 9 +[ 2 ] 8 +[ 2 ] 9 4 differences found EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_70.txt b/tools/test/h5diff/testfiles/h5diff_70.txt index 0a6b0c0..efa34ea 100644 --- a/tools/test/h5diff/testfiles/h5diff_70.txt +++ b/tools/test/h5diff/testfiles/h5diff_70.txt @@ -11,79 +11,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -514,79 +514,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -683,79 +683,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1192,79 +1192,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1360,79 +1360,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1863,79 +1863,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] diff --git a/tools/test/h5diff/testfiles/h5diff_700.txt b/tools/test/h5diff/testfiles/h5diff_700.txt index 1cf71dd..851a407 100644 --- a/tools/test/h5diff/testfiles/h5diff_700.txt +++ b/tools/test/h5diff/testfiles/h5diff_700.txt @@ -13,79 +13,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -516,79 +516,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -687,79 +687,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1196,79 +1196,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1366,79 +1366,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1869,79 +1869,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] diff --git a/tools/test/h5diff/testfiles/h5diff_701.txt b/tools/test/h5diff/testfiles/h5diff_701.txt index 405ab2f..33f1a0f 100644 --- a/tools/test/h5diff/testfiles/h5diff_701.txt +++ b/tools/test/h5diff/testfiles/h5diff_701.txt @@ -45,79 +45,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -548,79 +548,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -754,79 +754,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1263,79 +1263,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1465,79 +1465,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1968,79 +1968,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] diff --git a/tools/test/h5diff/testfiles/h5diff_702.txt b/tools/test/h5diff/testfiles/h5diff_702.txt index 1cf71dd..851a407 100644 --- a/tools/test/h5diff/testfiles/h5diff_702.txt +++ b/tools/test/h5diff/testfiles/h5diff_702.txt @@ -13,79 +13,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -516,79 +516,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -687,79 +687,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1196,79 +1196,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1366,79 +1366,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1869,79 +1869,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] diff --git a/tools/test/h5diff/testfiles/h5diff_703.txt b/tools/test/h5diff/testfiles/h5diff_703.txt index 405ab2f..33f1a0f 100644 --- a/tools/test/h5diff/testfiles/h5diff_703.txt +++ b/tools/test/h5diff/testfiles/h5diff_703.txt @@ -45,79 +45,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -548,79 +548,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -754,79 +754,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1263,79 +1263,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1465,79 +1465,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1968,79 +1968,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] diff --git a/tools/test/h5diff/testfiles/h5diff_80.txt b/tools/test/h5diff/testfiles/h5diff_80.txt index 836e073..b223eed 100644 --- a/tools/test/h5diff/testfiles/h5diff_80.txt +++ b/tools/test/h5diff/testfiles/h5diff_80.txt @@ -59,79 +59,79 @@ dataset: and size: [2] [2] position VLstring VLstring difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found dataset: and size: [3x2] [3x2] position VLstring2D VLstring2D difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found dataset: and size: [4x3x2] [4x3x2] position VLstring3D VLstring3D difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found dataset: and size: [2] [2] @@ -702,79 +702,79 @@ dataset: and size: [2] [2] position string string difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found dataset: and size: [3x2] [3x2] position string2D string2D difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found dataset: and size: [4x3x2] [4x3x2] position string3D string3D difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found dataset: and size: [2] [2] -- cgit v0.12 From c83e11d436e3fdfa16d6fd196fc2416f798003c3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 17 Oct 2017 12:15:02 -0500 Subject: Cleanup valgrind issues --- tools/src/h5repack/h5repack.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index d570d02..eaca0a5 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -332,7 +332,7 @@ int copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; hid_t attr_id = -1; /* attr ID */ hid_t attr_out = -1; /* attr ID */ hid_t space_id = -1; /* space ID */ @@ -486,12 +486,14 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, * close *------------------------------------------------------------------------- */ - if (H5Tclose(ftype_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); - if (H5Tclose(wtype_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + if (H5Aclose(attr_out) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); if (H5Sclose(space_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); + if (H5Tclose(wtype_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + if (H5Tclose(ftype_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); if (H5Aclose(attr_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); } /* u */ @@ -508,11 +510,11 @@ done: HDfree(buf); } /* end if */ - H5Tclose(ftype_id); - H5Tclose(wtype_id); + H5Aclose(attr_out); H5Sclose(space_id); + H5Tclose(wtype_id); + H5Tclose(ftype_id); H5Aclose(attr_id); - H5Aclose(attr_out); } H5E_END_TRY; return ret_value; @@ -805,8 +807,8 @@ static int check_objects(const char* fname, pack_opt_t *options) { done: H5E_BEGIN_TRY { - H5Dclose(did); H5Sclose(sid); + H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; if (travt) -- cgit v0.12 From d9bfebc1db91f7313df179661ccadbcca277fc91 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 17 Oct 2017 12:23:05 -0500 Subject: Correct test results --- tools/test/h5diff/CMakeTests.cmake | 16 ++++++++-------- tools/test/h5diff/testfiles/h5diff_467.txt | 2 +- tools/test/h5diff/testfiles/h5diff_469.txt | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index d87a47f..165c29a 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -1441,22 +1441,22 @@ ADD_H5_TEST (h5diff_415 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink3_to ADD_H5_TEST (h5diff_416 0 --follow-symlinks -v ${FILE14} ${FILE14} /softlink3_to_slink2 /softlink4_to_slink2) # non-exist-softlink vs softlink" -ADD_H5_TEST (h5diff_417 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_noexist /softlink_dset2) +ADD_H5_TEST (h5diff_417 2 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_noexist /softlink_dset2) # softlink vs non-exist-softlink" -ADD_H5_TEST (h5diff_418 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) +ADD_H5_TEST (h5diff_418 2 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) # non-exist-extlink_file vs extlink" -ADD_H5_TEST (h5diff_419 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist2 /ext_link_dset2) +ADD_H5_TEST (h5diff_419 2 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist2 /ext_link_dset2) # exlink vs non-exist-extlink_file" -ADD_H5_TEST (h5diff_420 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist2) +ADD_H5_TEST (h5diff_420 2 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist2) # extlink vs non-exist-extlink_obj" -ADD_H5_TEST (h5diff_421 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist1) +ADD_H5_TEST (h5diff_421 2 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist1) # non-exist-extlink_obj vs extlink" -ADD_H5_TEST (h5diff_422 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_dset2) +ADD_H5_TEST (h5diff_422 2 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_dset2) # extlink_to_softlink_to_dset1 vs dset2" ADD_H5_TEST (h5diff_423 1 --follow-symlinks -v ${FILE17} ${FILE18} /ext_link_to_slink1 /dset2) @@ -1512,11 +1512,11 @@ ADD_H5_TEST (h5diff_465 0 --follow-symlinks h5diff_danglelinks1.h5 h5diff_dangle # soft dangling vs. soft dangling ADD_H5_TEST (h5diff_466 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) # soft link vs. soft dangling -ADD_H5_TEST (h5diff_467 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2) +ADD_H5_TEST (h5diff_467 2 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2) # ext dangling vs. ext dangling ADD_H5_TEST (h5diff_468 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4) # ext link vs. ext dangling -ADD_H5_TEST (h5diff_469 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2) +ADD_H5_TEST (h5diff_469 2 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2) #--------------------------------------------------- # dangling links without follow symlink diff --git a/tools/test/h5diff/testfiles/h5diff_467.txt b/tools/test/h5diff/testfiles/h5diff_467.txt index f5195c0..35d3b74 100644 --- a/tools/test/h5diff/testfiles/h5diff_467.txt +++ b/tools/test/h5diff/testfiles/h5diff_467.txt @@ -1,3 +1,3 @@ obj2 is a dangling link. 1 differences found -EXIT CODE: 1 +EXIT CODE: 2 diff --git a/tools/test/h5diff/testfiles/h5diff_469.txt b/tools/test/h5diff/testfiles/h5diff_469.txt index 594fd80..23cb62f 100644 --- a/tools/test/h5diff/testfiles/h5diff_469.txt +++ b/tools/test/h5diff/testfiles/h5diff_469.txt @@ -1,3 +1,3 @@ obj2 is a dangling link. 1 differences found -EXIT CODE: 1 +EXIT CODE: 2 -- cgit v0.12 From c230ffa26873f256092d68de854de5c7f09bf1ee Mon Sep 17 00:00:00 2001 From: "Richard.Warren" Date: Tue, 17 Oct 2017 15:23:54 -0500 Subject: Make fixes to avoid test failures in 'production' mode builds --- testpar/t_pread.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/testpar/t_pread.c b/testpar/t_pread.c index 7f23b9b..b2eec97 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -99,11 +99,11 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) FILE *header = NULL; const char *fcn_name = "generate_test_file()"; const char *failure_mssg = NULL; - const char *group_filename = NULL; + char *group_filename = NULL; char data_filename[FILENAME_BUF_SIZE]; char reloc_data_filename[FILENAME_BUF_SIZE]; char prolog_filename[FILENAME_BUF_SIZE]; - int file_index; + int file_index = 0; int group_size; int group_rank; int local_failure = 0; @@ -162,10 +162,11 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) * is used to call into the h5_fixname function. No * need to worry that we reassign it for each file! */ - HDassert((group_filename = FILENAMES[file_index])); + group_filename = FILENAMES[file_index]; + HDassert( group_filename ); /* Assign the 'data_filename' */ - if ( h5_fixname(group_filename, H5P_DEFAULT, data_filename, + if ( h5_fixname((const char *)group_filename, H5P_DEFAULT, data_filename, sizeof(data_filename)) == NULL ) { pass = FALSE; failure_mssg = "h5_fixname(0) failed.\n"; @@ -174,7 +175,8 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) if ( pass ) { - HDassert( (group_filename = FILENAMES[file_index+1]) ); + group_filename = FILENAMES[file_index+1]; + HDassert( group_filename ); /* Assign the 'reloc_data_filename' */ if ( h5_fixname(group_filename, H5P_DEFAULT, reloc_data_filename, @@ -186,8 +188,8 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) } if ( pass ) { - - HDassert( (group_filename = FILENAMES[file_index+2]) ); + group_filename = FILENAMES[file_index+2]; + HDassert( group_filename ); /* Assign the 'prolog_filename' */ if ( h5_fixname(group_filename, H5P_DEFAULT, prolog_filename, -- cgit v0.12 From 9aada2bdb51f1c235e483f2bce109262bfbe22fa Mon Sep 17 00:00:00 2001 From: "Richard.Warren" Date: Tue, 17 Oct 2017 15:34:36 -0500 Subject: in 'production' mode builds --- testpar/t_pread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testpar/t_pread.c b/testpar/t_pread.c index b2eec97..b5a84f2 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -162,11 +162,11 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) * is used to call into the h5_fixname function. No * need to worry that we reassign it for each file! */ - group_filename = FILENAMES[file_index]; + group_filename = FILENAMES[file_index]; HDassert( group_filename ); /* Assign the 'data_filename' */ - if ( h5_fixname((const char *)group_filename, H5P_DEFAULT, data_filename, + if ( h5_fixname(group_filename, H5P_DEFAULT, data_filename, sizeof(data_filename)) == NULL ) { pass = FALSE; failure_mssg = "h5_fixname(0) failed.\n"; -- cgit v0.12 From 78a5870680770a8827c0e1e805688be30d1a33a7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 17 Oct 2017 16:13:12 -0500 Subject: Fix error handling issues --- tools/lib/h5diff.c | 157 ++++++++++++-------------- tools/lib/h5diff_array.c | 111 ++++++++++-------- tools/lib/h5diff_attr.c | 103 +++++++++-------- tools/lib/h5diff_dset.c | 85 +++++++------- tools/test/h5diff/CMakeTests.cmake | 18 +-- tools/test/h5diff/testfiles/h5diff_417.txt | 2 +- tools/test/h5diff/testfiles/h5diff_418.txt | 2 +- tools/test/h5diff/testfiles/h5diff_419.txt | 2 +- tools/test/h5diff/testfiles/h5diff_420.txt | 2 +- tools/test/h5diff/testfiles/h5diff_421.txt | 2 +- tools/test/h5diff/testfiles/h5diff_422.txt | 2 +- tools/test/h5diff/testfiles/h5diff_467.txt | 2 +- tools/test/h5diff/testfiles/h5diff_469.txt | 2 +- tools/test/h5diff/testfiles/h5diff_udfail.txt | 12 +- 14 files changed, 261 insertions(+), 241 deletions(-) diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index ab5d125..94cca58 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -393,8 +393,7 @@ trav_grp_objs(const char *path, const H5O_info_t *oinfo, * Track and extra checkings while visiting all symbolic-links. *------------------------------------------------------------------------*/ static herr_t -trav_grp_symlinks(const char *path, const H5L_info_t *linfo, - void *udata) +trav_grp_symlinks(const char *path, const H5L_info_t *linfo, void *udata) { herr_t ret_value = 0; trav_info_t *tinfo = (trav_info_t *)udata; @@ -414,7 +413,7 @@ trav_grp_symlinks(const char *path, const H5L_info_t *linfo, switch(linfo->type) { case H5L_TYPE_SOFT: if((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) { - HGOTO_DONE(ret_value); + HGOTO_DONE(FAIL); } else if (ret_value == 0) { /* no dangling link option given and detect dangling link */ @@ -437,13 +436,13 @@ trav_grp_symlinks(const char *path, const H5L_info_t *linfo, trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { parallel_print("Error: Could not get file contents\n"); opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Could not get file contents"); } break; case H5L_TYPE_EXTERNAL: if ((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) { - HGOTO_DONE(ret_value); + HGOTO_DONE(FAIL); } else if (ret_value == 0) { /* no dangling link option given and detect dangling link */ @@ -469,7 +468,7 @@ trav_grp_symlinks(const char *path, const H5L_info_t *linfo, trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { parallel_print("Error: Could not get file contents\n"); opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents\n"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Could not get file contents\n"); } break; @@ -479,7 +478,7 @@ trav_grp_symlinks(const char *path, const H5L_info_t *linfo, default: parallel_print("Error: Invalid link type\n"); opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Invalid link type"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Invalid link type"); break; } /* end of switch */ @@ -552,7 +551,7 @@ h5diff(const char *fname1, HGOTO_DONE(0); opts->cmn_objs = 1; /* eliminate warning */ - opts->err_stat = 1; /* initialize error status to FAIL */ + opts->err_stat = 0; /* initialize error status */ /*------------------------------------------------------------------------- * open the files first; if they are not valid, no point in continuing @@ -561,14 +560,14 @@ h5diff(const char *fname1, /* open file 1 */ if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname1); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname1); + HGOTO_ERROR(1, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname1); } /* end if */ /* open file 2 */ if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname2); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname2); + HGOTO_ERROR(1, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname2); } /* end if */ /*------------------------------------------------------------------------- @@ -586,11 +585,11 @@ h5diff(const char *fname1, #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj1fullname, "/%s", objname1) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ if ((obj1fullname = (char*)HDmalloc(HDstrlen(objname1) + 2)) == NULL) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); HDstrcpy(obj1fullname, "/"); HDstrcat(obj1fullname, objname1); @@ -604,11 +603,11 @@ h5diff(const char *fname1, #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj2fullname, "/%s", objname2) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ if ((obj2fullname = (char*)HDmalloc(HDstrlen(objname2) + 2)) == NULL) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); HDstrcpy(obj2fullname, "/"); HDstrcat(obj2fullname, objname2); #endif /* H5_HAVE_ASPRINTF */ @@ -627,14 +626,12 @@ h5diff(const char *fname1, /* check if link itself exist */ if(H5Lexists(file1_id, obj1fullname, H5P_DEFAULT) <= 0) { parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Object could not be found"); } /* get info from link */ if(H5Lget_info(file1_id, obj1fullname, &src_linfo1, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj1fullname); - H5TOOLS_INFO(H5E_tools_min_id_g, "Unable to get link info\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Lget_info failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Lget_info failed"); } info1_lp = info1_obj; @@ -650,8 +647,7 @@ h5diff(const char *fname1, if(H5Oget_info_by_name(file1_id, obj1fullname, &oinfo1, H5P_DEFAULT) < 0) { parallel_print("Error: Could not get file contents\n"); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Could not get file contents"); } obj1type = (h5trav_type_t)oinfo1.type; trav_info_add(info1_obj, obj1fullname, obj1type); @@ -680,13 +676,12 @@ h5diff(const char *fname1, /* check if link itself exist */ if(H5Lexists(file2_id, obj2fullname, H5P_DEFAULT) <= 0) { parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Object could not be found"); } /* get info from link */ if(H5Lget_info(file2_id, obj2fullname, &src_linfo2, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj2fullname); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Lget_info failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Lget_info failed"); } info2_lp = info2_obj; @@ -702,8 +697,7 @@ h5diff(const char *fname1, if(H5Oget_info_by_name(file2_id, obj2fullname, &oinfo2, H5P_DEFAULT) < 0) { parallel_print("Error: Could not get file contents\n"); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Could not get file contents"); } obj2type = (h5trav_type_t)oinfo2.type; trav_info_add(info2_obj, obj2fullname, obj2type); @@ -731,7 +725,7 @@ h5diff(const char *fname1, obj2type = H5TRAV_TYPE_GROUP; } - + h5diffdebug2("get any symbolic links info - errstat:%d\n", opts->err_stat); /* get any symbolic links info */ l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, opts->follow_links); l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, opts->follow_links); @@ -755,8 +749,7 @@ h5diff(const char *fname1, /* treat dangling link as error */ if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj1fullname); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "treat dangling link as error"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "treat dangling link as error"); } else { if(opts->m_verbose) @@ -770,8 +763,7 @@ h5diff(const char *fname1, } else if(l_ret1 < 0) { /* fail */ parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Object could not be found"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Object could not be found"); } else if(l_ret1 != 2) { /* symbolic link */ obj1type = (h5trav_type_t)trg_linfo1.trg_type; @@ -798,8 +790,7 @@ h5diff(const char *fname1, /* treat dangling link as error */ if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj2fullname); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "treat dangling link as error"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "treat dangling link as error"); } else { if(opts->m_verbose) @@ -813,8 +804,7 @@ h5diff(const char *fname1, } else if(l_ret2 < 0) { /* fail */ parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Object could not be found"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Object could not be found"); } else if(l_ret2 != 2) { /* symbolic link */ obj2type = (h5trav_type_t)trg_linfo2.trg_type; @@ -841,7 +831,7 @@ h5diff(const char *fname1, h5difftrace("h5diff NOT (opts->m_verbose || opts->m_report)\n"); /* if no danglink links */ if (l_ret1 > 0 && l_ret2 > 0) - if (h5tools_is_obj_same(file1_id, obj1fullname, file2_id, obj2fullname)!=0) + if (h5tools_is_obj_same(file1_id, obj1fullname, file2_id, obj2fullname) != 0) HGOTO_DONE(0); } @@ -858,8 +848,7 @@ h5diff(const char *fname1, if(h5trav_visit(file1_id, obj1fullname, TRUE, TRUE, trav_grp_objs, trav_grp_symlinks, info1_grp) < 0) { parallel_print("Error: Could not get file contents\n"); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Could not get file contents"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Could not get file contents"); } info1_lp = info1_grp; @@ -873,11 +862,11 @@ h5diff(const char *fname1, if(h5trav_visit(file2_id, obj2fullname, TRUE, TRUE, trav_grp_objs, trav_grp_symlinks, info2_grp) < 0) { parallel_print("Error: Could not get file contents\n"); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Could not get file contents"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Could not get file contents"); } /* end if */ info2_lp = info2_grp; } + h5diffdebug2("groups traversed - errstat:%d\n", opts->err_stat); #ifdef H5_HAVE_PARALLEL if(g_Parallel) { @@ -926,9 +915,9 @@ h5diff(const char *fname1, file2_id, obj2fullname, info2_lp, match_list, opts); - opts->err_stat = 0; /* success status */ - done: + opts->err_stat = opts->err_stat | ret_value; + #ifdef H5_HAVE_PARALLEL if(g_Parallel) /* All done at this point, let tasks know that they won't be needed */ @@ -994,7 +983,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, { hsize_t nfound = 0; unsigned i; - int ret_value = 0; + int ret_value = opts->err_stat; const char *grp1_path = ""; const char *grp2_path = ""; char *obj1_fullpath = NULL; @@ -1056,16 +1045,17 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, #endif for(i = 0; i < table->nobjs; i++) { + h5diffdebug3("diff for common objects[%d] - errstat:%d\n", i, opts->err_stat); if(table->objs[i].flags[0] && table->objs[i].flags[1]) { /* make full path for obj1 */ #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) { - HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); } #else /* H5_HAVE_ASPRINTF */ if((obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) { - HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); } else { HDstrcpy(obj1_fullpath, grp1_path); @@ -1078,11 +1068,11 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) { - HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); } #else /* H5_HAVE_ASPRINTF */ if((obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) { - HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed"); + HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); } else { HDstrcpy(obj2_fullpath, grp2_path); @@ -1267,7 +1257,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, HDfree(obj2_fullpath); } /* end if */ } /* end for */ - h5difftrace("done with for loop\n"); + h5diffdebug2("done with for loop - errstat:%d\n", opts->err_stat); #ifdef H5_HAVE_PARALLEL if(g_Parallel) { @@ -1351,7 +1341,9 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, #endif /* H5_HAVE_PARALLEL */ out: - /* free table */ + opts->err_stat = opts->err_stat | ret_value; + +/* free table */ if (table) trav_table_free(table); h5diffdebug2("diff_match finish:%d\n", nfound); @@ -1381,7 +1373,8 @@ diff(hid_t file1_id, diff_opt_t * opts, diff_args_t *argdata) { - int ret_value = 0; + int ret_value = opts->err_stat; + int status = -1; hid_t dset1_id = -1; hid_t dset2_id = -1; hid_t type1_id = -1; @@ -1400,9 +1393,6 @@ diff(hid_t file1_id, h5difftrace("diff start\n"); - /*init error status */ - opts->err_stat = 1; - /*init link info struct */ HDmemset(&linkinfo1, 0, sizeof(h5tool_link_info_t)); HDmemset(&linkinfo2, 0, sizeof(h5tool_link_info_t)); @@ -1422,26 +1412,26 @@ diff(hid_t file1_id, */ /* target object1 - get type and name */ - if ((ret_value = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, opts->follow_links)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5tools_get_symlink_info failed"); + if ((status = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, opts->follow_links)) < 0) + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5tools_get_symlink_info failed"); /* dangling link */ - if (ret_value == 0) { + if (status == 0) { if (opts->no_dangle_links) { /* dangling link is error */ if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path1); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "dangling link is error"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "dangling link is error"); } else is_dangle_link1 = TRUE; } /* target object2 - get type and name */ - if ((ret_value = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, opts->follow_links)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5tools_get_symlink_info failed"); + if ((status = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, opts->follow_links)) < 0) + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5tools_get_symlink_info failed"); /* dangling link */ - if (ret_value == 0) { + if (status == 0) { if (opts->no_dangle_links) { /* dangling link is error */ if(opts->m_verbose) @@ -1454,7 +1444,6 @@ diff(hid_t file1_id, /* found dangling link */ if (is_dangle_link1 || is_dangle_link2) { - opts->err_stat = 0; HGOTO_DONE(0); } @@ -1479,7 +1468,6 @@ diff(hid_t file1_id, /* TODO: will need to update non-comparable is different * opts->contents = 0; */ - opts->err_stat = 0; HGOTO_DONE(0); } else /* now both object types are same */ @@ -1532,7 +1520,6 @@ diff(hid_t file1_id, } /* if(opts->m_verbose || opts->m_report) */ /* exact same, so comparison is done */ - opts->err_stat = 0; HGOTO_DONE(0); } } @@ -1544,9 +1531,9 @@ diff(hid_t file1_id, */ case H5TRAV_TYPE_DATASET: if((dset1_id = H5Dopen2(file1_id, path1, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 failed"); if((dset2_id = H5Dopen2(file2_id, path2, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 failed"); /* verbose (-v) and report (-r) mode */ if(opts->m_verbose || opts->m_report) { do_print_objname("dataset", path1, path2, opts); @@ -1579,9 +1566,9 @@ diff(hid_t file1_id, if(H5Dclose(dset1_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dclose failed"); if(H5Dclose(dset2_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dclose failed"); break; /*---------------------------------------------------------------------- @@ -1590,15 +1577,15 @@ diff(hid_t file1_id, */ case H5TRAV_TYPE_NAMED_DATATYPE: if((type1_id = H5Topen2(file1_id, path1, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Topen2 failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Topen2 failed"); if((type2_id = H5Topen2(file2_id, path2, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Topen2 failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Topen2 failed"); - if((ret_value = H5Tequal(type1_id, type2_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tequal failed"); + if((status = H5Tequal(type1_id, type2_id)) < 0) + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tequal failed"); /* if H5Tequal is > 0 then the datatypes refer to the same datatype */ - nfound = (ret_value > 0) ? 0 : 1; + nfound = (status > 0) ? 0 : 1; if(print_objname(opts, nfound)) do_print_objname("datatype", path1, path2, opts); @@ -1617,9 +1604,9 @@ diff(hid_t file1_id, nfound += diff_attr(type1_id, type2_id, path1, path2, opts); if(H5Tclose(type1_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose failed"); if(H5Tclose(type2_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose failed"); break; /*---------------------------------------------------------------------- @@ -1635,9 +1622,9 @@ diff(hid_t file1_id, print_found(nfound); if((grp1_id = H5Gopen2(file1_id, path1, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed"); if((grp2_id = H5Gopen2(file2_id, path2, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed"); /*----------------------------------------------------------------- * compare attributes @@ -1649,9 +1636,9 @@ diff(hid_t file1_id, nfound += diff_attr(grp1_id, grp2_id, path1, path2, opts); if(H5Gclose(grp1_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed"); if(H5Gclose(grp2_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed"); break; @@ -1661,10 +1648,10 @@ diff(hid_t file1_id, */ case H5TRAV_TYPE_LINK: { - ret_value = HDstrcmp(linkinfo1.trg_path, linkinfo2.trg_path); + status = HDstrcmp(linkinfo1.trg_path, linkinfo2.trg_path); /* if the target link name is not same then the links are "different" */ - nfound = (ret_value != 0) ? 1 : 0; + nfound = (status != 0) ? 1 : 0; if(print_objname(opts, nfound)) do_print_objname("link", path1, path2, opts); @@ -1686,16 +1673,16 @@ diff(hid_t file1_id, if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) { /* If the buffers are the same size, compare them */ if(linkinfo1.linfo.u.val_size == linkinfo2.linfo.u.val_size) { - ret_value = HDmemcmp(linkinfo1.trg_path, linkinfo2.trg_path, linkinfo1.linfo.u.val_size); + status = HDmemcmp(linkinfo1.trg_path, linkinfo2.trg_path, linkinfo1.linfo.u.val_size); } else - ret_value = 1; + status = 1; /* if "linkinfo1.trg_path" != "linkinfo2.trg_path" then the links * are "different" extlinkinfo#.path is combination string of * file_name and obj_name */ - nfound = (ret_value != 0) ? 1 : 0; + nfound = (status != 0) ? 1 : 0; if(print_objname(opts, nfound)) do_print_objname("external link", path1, path2, opts); @@ -1734,9 +1721,9 @@ diff(hid_t file1_id, break; } - opts->err_stat = 0; - done: + opts->err_stat = opts->err_stat | ret_value; + /*----------------------------------- * handle dangling link(s) */ @@ -1782,7 +1769,7 @@ done: /* enable error reporting */ } H5E_END_TRY; - h5diffdebug2("diff finish:%d\n", nfound); + h5diffdebug3("diff finish:%d - errstat:%d\n", nfound, opts->err_stat); return nfound; } diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 5d77de3..54b9109 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -285,7 +285,7 @@ hsize_t diff_array( mcomp_t members; H5T_class_t type_class; - h5difftrace("diff_array start\n"); + h5diffdebug2("diff_array start - errstat:%d\n", opts->err_stat); /* get the size. */ size = H5Tget_size(m_type); type_class = H5Tget_class(m_type); @@ -378,7 +378,7 @@ hsize_t diff_array( } /* i */ close_member_types(&members); } /* switch */ - h5diffdebug2("diff_array finish:%d\n", nfound); + h5diffdebug3("diff_array finish:%d - errstat:%d\n", nfound, opts->err_stat); return nfound; } @@ -447,13 +447,11 @@ static hsize_t diff_datum( hbool_t iszero1; hbool_t iszero2; hsize_t nfound = 0; /* differences found */ - hsize_t ret_value = 0; + hsize_t ret_value = opts->err_stat; double per; hbool_t both_zero; h5difftrace("diff_datum start\n"); - /* default error sttaus */ - opts->err_stat = 1; type_size = H5Tget_size(m_type); type_class = H5Tget_class(m_type); @@ -467,14 +465,14 @@ static hsize_t diff_datum( type_class != H5T_STRING && type_class != H5T_VLEN && HDmemcmp(mem1, mem2, type_size) == 0) - HGOTO_DONE(0); + HGOTO_DONE(opts->err_stat); switch (H5Tget_class(m_type)) { case H5T_NO_CLASS: case H5T_TIME: case H5T_NCLASSES: default: - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Invalid type class"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Invalid type class"); break; /*------------------------------------------------------------------------- @@ -725,7 +723,8 @@ static hsize_t diff_datum( iszero1 = all_zero(_mem1, H5Tget_size(m_type)); iszero2 = all_zero(_mem2, H5Tget_size(m_type)); if (iszero1 != iszero2) { - HGOTO_DONE (1); + nfound++; + HGOTO_DONE (opts->err_stat); } else if (!iszero1 && !iszero2) { /*------------------------------------------------------------------------- @@ -740,14 +739,22 @@ static hsize_t diff_datum( hid_t region1_id = -1; hid_t region2_id = -1; - if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem1)) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference2 object 1 failed"); - if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem2)) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference2 object 2 failed"); - if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1)) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_region object 1 failed"); - if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_region object 2 failed"); + if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem1)) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference2 object 1 failed"); + } + if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem2)) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference2 object 2 failed"); + } + if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1)) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_region object 1 failed"); + } + if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_region object 2 failed"); + } nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, opts); @@ -766,23 +773,31 @@ static hsize_t diff_datum( H5O_type_t obj1_type; H5O_type_t obj2_type; - if (H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_obj_type2 object 1 failed"); - if (H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_obj_type2 object 2 failed"); + if (H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_obj_type2 object 1 failed"); + } + if (H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_obj_type2 object 2 failed"); + } /* check object type */ if (ret_value >= 0) if (obj1_type != obj2_type) { parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2); opts->not_cmp = 1; - HGOTO_DONE (0); + HGOTO_DONE (opts->err_stat); } - if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_OBJECT, _mem1)) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference2 object 1 failed"); - if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_OBJECT, _mem2)) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference2 object 2 failed"); + if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_OBJECT, _mem1)) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference2 object 1 failed"); + } + if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_OBJECT, _mem2)) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference2 object 2 failed"); + } /* compare */ if (obj1_type == H5O_TYPE_DATASET) @@ -839,7 +854,7 @@ static hsize_t diff_datum( char temp2_char; if(type_size != sizeof(char)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not char size"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not char size"); HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); /* -d and !-p */ @@ -914,7 +929,7 @@ static hsize_t diff_datum( unsigned char temp2_uchar; if(type_size != sizeof(unsigned char)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not unsigned char size"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned char size"); HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -990,7 +1005,7 @@ static hsize_t diff_datum( short temp2_short; if(type_size != sizeof(short)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not short size"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not short size"); HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); @@ -1066,7 +1081,7 @@ static hsize_t diff_datum( unsigned short temp2_ushort; if(type_size != sizeof(unsigned short)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not unsigned short size"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned short size"); HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); @@ -1142,7 +1157,7 @@ static hsize_t diff_datum( int temp2_int; if(type_size != sizeof(int)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not int size"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not int size"); HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); @@ -1218,7 +1233,7 @@ static hsize_t diff_datum( unsigned int temp2_uint; if(type_size != sizeof(unsigned int)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not unsigned int size"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned int size"); HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); @@ -1294,7 +1309,7 @@ static hsize_t diff_datum( long temp2_long; if(type_size != sizeof(long)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not long size"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not long size"); HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); @@ -1370,7 +1385,7 @@ static hsize_t diff_datum( unsigned long temp2_ulong; if(type_size != sizeof(unsigned long)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not unsigned long size"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned long size"); HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); @@ -1454,7 +1469,7 @@ static hsize_t diff_datum( hbool_t isnan2 = FALSE; if(type_size != sizeof(float)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not float size"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not float size"); HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); @@ -1613,7 +1628,7 @@ static hsize_t diff_datum( hbool_t isnan2 = FALSE; if(type_size != sizeof(double)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not double size"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not double size"); HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); @@ -1771,8 +1786,9 @@ static hsize_t diff_datum( hbool_t isnan1 = FALSE; hbool_t isnan2 = FALSE; - if(type_size != sizeof(long double)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Type size is not long double size"); + if(type_size != sizeof(long double)) { + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not long double size"); + } HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); @@ -1922,10 +1938,11 @@ static hsize_t diff_datum( break; /* H5T_FLOAT class */ } /* switch */ - opts->err_stat = 0; done: - h5diffdebug2("diff_datum finish:%d\n", nfound); + opts->err_stat = opts->err_stat | ret_value; + + h5diffdebug3("diff_datum finish:%d - errstat:%d\n", nfound, opts->err_stat); return nfound; } @@ -2003,7 +2020,7 @@ void print_points(int i, hsize_t *ptdata, int ndims) { static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *opts) { - hsize_t ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hsize_t ret_value = 0; hssize_t nblocks1, npoints1; hssize_t nblocks2, npoints2; hsize_t alloc_size; @@ -2046,14 +2063,16 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/ if((ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) { - HERROR(H5E_tools_g, H5E_tools_min_id_g, "Buffer allocation failed"); + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed"); } else { H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region1_id, (hsize_t) 0, (hsize_t) nblocks1, ptdata1); if((ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) { - HERROR(H5E_tools_g, H5E_tools_min_id_g, "Buffer allocation failed"); + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed"); } else { H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t); @@ -2107,14 +2126,16 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/ if((ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) { - HERROR(H5E_tools_g, H5E_tools_min_id_g, "Buffer allocation failed"); + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed"); } else { H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); H5Sget_select_elem_pointlist(region1_id, (hsize_t) 0, (hsize_t) npoints1, ptdata1); if((ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) { - HERROR(H5E_tools_g, H5E_tools_min_id_g, "Buffer allocation failed"); + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed"); } else { H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); @@ -4380,7 +4401,7 @@ static hbool_t equal_float(float value, float expected, diff_opt_t *opts) { return TRUE; if (opts->use_system_epsilon) - if ( ABS( (value-expected) ) < FLT_EPSILON) + if (ABS( (value-expected) ) < FLT_EPSILON) return TRUE; h5difftrace("equal_float finish\n"); diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index d671449..6019738 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -139,7 +139,7 @@ static void table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *ta *------------------------------------------------------------------------*/ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t ** table_out, diff_opt_t *opts) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; H5O_info_t oinfo1, oinfo2; /* Object info */ hid_t attr1_id = -1; /* attr ID */ hid_t attr2_id = -1; /* attr ID */ @@ -163,12 +163,13 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t if (table_lp == NULL) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Table allocation failed"); - h5diffdebug3("build_match_list_attrs: %ld - %ld\n", curr1 < oinfo1.num_attrs, curr2 < oinfo2.num_attrs); - /*-------------------------------------------------- * build the list */ while(curr1 < oinfo1.num_attrs && curr2 < oinfo2.num_attrs) { + h5diffdebug3("build_match_list_attrs 1: %ld - %ld\n", curr1, oinfo1.num_attrs); + h5diffdebug3("build_match_list_attrs 2: %ld - %ld\n", curr2, oinfo2.num_attrs); + /*------------------ * open attribute1 */ if((attr1_id = H5Aopen_by_idx(loc1_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr1, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -221,6 +222,8 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t infile[0] = 1; infile[1] = 0; while(curr1 < oinfo1.num_attrs) { + h5diffdebug3("build_match_list_attrs 1: %ld - %ld\n", curr1, oinfo1.num_attrs); + /*------------------ * open attribute1 */ if((attr1_id = H5Aopen_by_idx(loc1_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr1, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -243,6 +246,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t infile[0] = 0; infile[1] = 1; while(curr2 < oinfo2.num_attrs) { + h5diffdebug3("build_match_list_attrs 2: %ld - %ld\n", curr2, oinfo2.num_attrs); /*------------------ * open attribute2 */ if((attr2_id = H5Aopen_by_idx(loc2_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr2, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -290,7 +294,7 @@ done: H5Aclose(attr2_id); } H5E_END_TRY; - h5difftrace("build_match_list_attrs end\n"); + h5diffdebug2("build_match_list_attrs end - errstat:%d\n", opts->err_stat); return ret_value; } @@ -314,7 +318,7 @@ hsize_t diff_attr(hid_t loc1_id, const char *path2, diff_opt_t *opts) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = opts->err_stat; hid_t attr1_id = -1; /* attr ID */ hid_t attr2_id = -1; /* attr ID */ hid_t space1_id = -1; /* space ID */ @@ -348,11 +352,10 @@ hsize_t diff_attr(hid_t loc1_id, table_attrs_t *match_list_attrs = NULL; h5difftrace("diff_attr start\n"); - /* Initialize error status */ - opts->err_stat = 1; - - if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, opts) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "build_match_list_attrs failed"); + if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, opts) < 0) { + HGOTO_ERROR(1, H5E_tools_min_id_g, "build_match_list_attrs failed"); + } + h5diffdebug2("build_match_list_attrs - errstat:%d\n", opts->err_stat); /* if detect any unique extra attr */ if(match_list_attrs->nattrs_only1 || match_list_attrs->nattrs_only2) { @@ -360,8 +363,10 @@ hsize_t diff_attr(hid_t loc1_id, /* exit will be 1 */ opts->contents = 0; } + h5diffdebug2("match_list_attrs info - errstat:%d\n", opts->err_stat); for(u = 0; u < (unsigned)match_list_attrs->nattrs; u++) { + h5diffdebug3("match_list_attrs loop[%d] - errstat:%d\n", u, opts->err_stat); if((match_list_attrs->attrs[u].exist[0]) && (match_list_attrs->attrs[u].exist[1])) { name1 = name2 = match_list_attrs->attrs[u].name; h5diffdebug2("diff_attr name - %s\n", name1); @@ -369,20 +374,20 @@ hsize_t diff_attr(hid_t loc1_id, /*-------------- * attribute 1 */ if((attr1_id = H5Aopen(loc1_id, name1, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen first attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aopen first attribute failed"); /*-------------- * attribute 2 */ if((attr2_id = H5Aopen(loc2_id, name2, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen second attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aopen second attribute failed"); h5difftrace("diff_attr got attributes\n"); /* get the datatypes */ if((ftype1_id = H5Aget_type(attr1_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); vstrtype1 = H5Tis_variable_str(ftype1_id); if((ftype2_id = H5Aget_type(attr2_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); vstrtype2 = H5Tis_variable_str(ftype2_id); /* no compare if either one but not both are variable string type */ @@ -392,37 +397,37 @@ hsize_t diff_attr(hid_t loc1_id, path1, name1, path2, name2); opts->not_cmp = 1; if (H5Tclose(ftype1_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed"); if (H5Tclose(ftype2_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose second attribute ftype failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute ftype failed"); if (H5Aclose(attr1_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose first attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose first attribute failed"); if (H5Aclose(attr2_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose second attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose second attribute failed"); continue; } if((mtype1_id = H5Tget_native_type(ftype1_id, H5T_DIR_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type first attribute ftype failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_native_type first attribute ftype failed"); if((mtype2_id = H5Tget_native_type(ftype2_id, H5T_DIR_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type second attribute ftype failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_native_type second attribute ftype failed"); if((msize1 = H5Tget_size(mtype1_id)) == 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size first attribute mtype failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_size first attribute mtype failed"); if((msize2 = H5Tget_size(mtype2_id)) == 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size second attribute mtype failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_size second attribute mtype failed"); /* get the dataspace */ if((space1_id = H5Aget_space(attr1_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_space first attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_space first attribute failed"); if((space2_id = H5Aget_space(attr2_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_space second attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_space second attribute failed"); /* get dimensions */ if((rank1 = H5Sget_simple_extent_dims(space1_id, dims1, NULL)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims first attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_dims first attribute failed"); if((rank2 = H5Sget_simple_extent_dims(space2_id, dims2, NULL)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims second attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_dims second attribute failed"); /*---------------------------------------------------------------------- * check for comparable TYPE and SPACE @@ -434,21 +439,21 @@ hsize_t diff_attr(hid_t loc1_id, if(diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, dims2, dims1, dims2, name1, name2, opts, 0) != 1) { if(H5Tclose(ftype1_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed"); if(H5Tclose(ftype2_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose second attribute ftype failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute ftype failed"); if(H5Sclose(space1_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose first attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sclose first attribute failed"); if(H5Sclose(space2_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose second attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sclose second attribute failed"); if(H5Aclose(attr1_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose first attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose first attribute failed"); if(H5Aclose(attr2_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose second attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose second attribute failed"); if(H5Tclose(mtype1_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose first attribute mtype failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute mtype failed"); if(H5Tclose(mtype2_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose second attribute mtype failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute mtype failed"); continue; } @@ -459,7 +464,7 @@ hsize_t diff_attr(hid_t loc1_id, */ if(FAIL == match_up_memsize(ftype1_id, ftype2_id, &mtype1_id, &mtype2_id, &msize1, &msize2)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "match_up_memsize failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "match_up_memsize failed"); /*--------------------------------------------------------------------- * read @@ -473,18 +478,18 @@ hsize_t diff_attr(hid_t loc1_id, buf2 = (void *)HDcalloc((size_t)(nelmts1), msize2); if(buf1 == NULL || buf2 == NULL) { parallel_print("cannot read into memory\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "buffer allocation failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "buffer allocation failed"); } if(H5Aread(attr1_id, mtype1_id, buf1) < 0) { parallel_print("Failed reading attribute1 %s/%s\n", path1, name1); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); } else buf1hasdata = TRUE; if(H5Aread(attr2_id, mtype2_id, buf2) < 0) { parallel_print("Failed reading attribute2 %s/%s\n", path2, name2); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); } else buf2hasdata = TRUE; @@ -542,29 +547,29 @@ hsize_t diff_attr(hid_t loc1_id, buf2 = NULL; if(H5Tclose(ftype1_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); if(H5Tclose(ftype2_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); if(H5Sclose(space1_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); if(H5Sclose(space2_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); if(H5Aclose(attr1_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); if(H5Aclose(attr2_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); if(H5Tclose(mtype1_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose first attribute mtype failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute mtype failed"); if(H5Tclose(mtype2_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose second attribute mtype failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute mtype failed"); nfound_total += nfound; } } /* u */ - opts->err_stat = 0; - done: + opts->err_stat = opts->err_stat | ret_value; + H5E_BEGIN_TRY { if(buf1) { if(buf1hasdata && TRUE == h5tools_detect_vlen(mtype1_id)) @@ -589,7 +594,7 @@ done: H5Aclose(attr2_id); } H5E_END_TRY; - h5difftrace("diff_attr end\n"); + h5diffdebug2("diff_attr end - errstat:%d\n", opts->err_stat); return nfound_total; } diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 768caff..bea008c 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -33,7 +33,8 @@ hsize_t diff_dataset(hid_t file1_id, const char *obj2_name, diff_opt_t *opts) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = opts->err_stat; + int status = -1; hid_t did1 = -1; hid_t did2 = -1; hid_t dcpl1 = -1; @@ -41,7 +42,6 @@ hsize_t diff_dataset(hid_t file1_id, hsize_t nfound = 0; h5difftrace("diff_dataset start\n"); - opts->err_stat = 1; /*------------------------------------------------------------------------- * open the handles *------------------------------------------------------------------------- @@ -49,17 +49,17 @@ hsize_t diff_dataset(hid_t file1_id, /* Open the datasets */ if((did1 = H5Dopen2(file1_id, obj1_name, H5P_DEFAULT)) < 0) { parallel_print("Cannot open dataset <%s>\n", obj1_name); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 first dataset failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 first dataset failed"); } if((did2 = H5Dopen2(file2_id, obj2_name, H5P_DEFAULT)) < 0) { parallel_print("Cannot open dataset <%s>\n", obj2_name); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 second dataset failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 second dataset failed"); } if((dcpl1 = H5Dget_create_plist(did1)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist first dataset failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_create_plist first dataset failed"); if((dcpl2 = H5Dget_create_plist(did2)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist second dataset failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_create_plist second dataset failed"); /*------------------------------------------------------------------------- * check if the dataset creation property list has filters that @@ -68,18 +68,18 @@ hsize_t diff_dataset(hid_t file1_id, * 2) the internal filters might be turned off *------------------------------------------------------------------------- */ - if ((ret_value = h5tools_canreadf((opts->m_verbose ? obj1_name : NULL), dcpl1) == 1) && - (ret_value = h5tools_canreadf((opts->m_verbose ? obj2_name : NULL), dcpl2) == 1)) + if ((status = h5tools_canreadf((opts->m_verbose ? obj1_name : NULL), dcpl1) == 1) && + (status = h5tools_canreadf((opts->m_verbose ? obj2_name : NULL), dcpl2) == 1)) nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, opts); - else if (ret_value < 0) { - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_canreadf failed"); + else if (status < 0) { + HGOTO_ERROR(1, H5E_tools_min_id_g, "h5tools_canreadf failed"); } else opts->not_cmp = 1; - opts->err_stat = 0; - done: + opts->err_stat = opts->err_stat | ret_value; + /* disable error reporting */ H5E_BEGIN_TRY { H5Pclose(dcpl1); @@ -89,7 +89,7 @@ done: /* enable error reporting */ } H5E_END_TRY; - h5diffdebug2("diff_dataset finish:%d\n", nfound); + h5diffdebug3("diff_dataset finish:%d - errstat:%d\n", nfound, opts->err_stat); return nfound; } @@ -150,7 +150,7 @@ hsize_t diff_datasetid(hid_t did1, const char *obj2_name, diff_opt_t *opts) { - int ret_value = 0; /* no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = opts->err_stat; hid_t sid1 = -1; hid_t sid2 = -1; hid_t f_tid1 = -1; @@ -192,27 +192,26 @@ hsize_t diff_datasetid(hid_t did1, int i; unsigned int vl_data = 0; /*contains VL datatypes */ - opts->err_stat = 1; h5difftrace("diff_datasetid start\n"); /* Get the dataspace handle */ if((sid1 = H5Dget_space(did1)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_space failed"); /* Get rank */ if((rank1 = H5Sget_simple_extent_ndims(sid1)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); /* Get the dataspace handle */ if((sid2 = H5Dget_space(did2)) < 0 ) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_space failed"); /* Get rank */ if((rank2 = H5Sget_simple_extent_ndims(sid2)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); /* Get dimensions */ if(H5Sget_simple_extent_dims(sid1, dims1, maxdim1) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); /* Get dimensions */ if(H5Sget_simple_extent_dims(sid2, dims2, maxdim2) < 0) @@ -226,25 +225,25 @@ hsize_t diff_datasetid(hid_t did1, /* Get the data type */ if((f_tid1 = H5Dget_type(did1)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_type failed"); /* Get the data type */ if((f_tid2 = H5Dget_type(did2)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_type failed"); /*------------------------------------------------------------------------- * get the storage layout type *------------------------------------------------------------------------- */ if((dcpl1 = H5Dget_create_plist(did1)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_create_plist failed"); if((dcpl2 = H5Dget_create_plist(did2)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_create_plist failed"); if((stl1 = H5Pget_layout(dcpl1)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Pget_layout failed"); if((stl2 = H5Pget_layout(dcpl2)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Pget_layout failed"); /*------------------------------------------------------------------------- * check for empty datasets @@ -278,6 +277,7 @@ hsize_t diff_datasetid(hid_t did1, obj1_name, obj2_name, opts, 0) != 1) can_compare = 0; + h5diffdebug2("diff_can_type - errstat:%d\n", opts->err_stat); /*------------------------------------------------------------------------- * memory type and sizes @@ -285,10 +285,10 @@ hsize_t diff_datasetid(hid_t did1, */ h5difftrace("check for memory type and sizes\n"); if((m_tid1 = H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_native_type failed"); if((m_tid2 = H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_native_type failed"); m_size1 = H5Tget_size(m_tid1); m_size2 = H5Tget_size(m_tid2); @@ -319,6 +319,7 @@ hsize_t diff_datasetid(hid_t did1, */ if(TRUE == h5tools_detect_vlen(m_tid1)) vl_data = TRUE; + h5diffdebug2("h5tools_detect_vlen - errstat:%d\n", opts->err_stat); /*------------------------------------------------------------------------ * only attempt to compare if possible @@ -351,7 +352,7 @@ hsize_t diff_datasetid(hid_t did1, if (FAIL == match_up_memsize (f_tid1, f_tid2, &m_tid1, &m_tid2, &m_size1, &m_size2)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "match_up_memsize failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "match_up_memsize failed"); h5diffdebug3("m_size: %ld - %ld\n", m_size1, m_size2); dadims = dims1; dam_size = m_size1; @@ -397,10 +398,10 @@ hsize_t diff_datasetid(hid_t did1, if(buf1 != NULL && buf2 != NULL) { h5difftrace("buf1 != NULL && buf2 != NULL\n"); if(H5Dread(did1, m_tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dread failed"); h5difftrace("H5Dread did2\n"); if(H5Dread(did2, m_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dread failed"); /* array diff */ nfound = diff_array(buf1, buf2, danelmts, (hsize_t)0, rank1, dadims, @@ -463,9 +464,9 @@ hsize_t diff_datasetid(hid_t did1, * E.g., sm_space. */ if((sm_buf1 = HDmalloc((size_t)sm_nbytes)) == NULL) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "HDmalloc failed"); if((sm_buf2 = HDmalloc((size_t)sm_nbytes)) == NULL) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "HDmalloc failed"); sm_nelmts = sm_nbytes / p_type_nbytes; sm_space = H5Screate_simple(1, &sm_nelmts, NULL); @@ -482,19 +483,19 @@ hsize_t diff_datasetid(hid_t did1, hs_nelmts *= hs_size[i]; } /* end for */ if(H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); if(H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); if(H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); } /* end if */ else hs_nelmts = 1; if(H5Dread(did1, m_tid1, sm_space, sid1, H5P_DEFAULT, sm_buf1) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dread failed"); if(H5Dread(did2, m_tid2, sm_space, sid2, H5P_DEFAULT, sm_buf2) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dread failed"); /* get array differences. in the case of hyperslab read, increment the number of differences found in each hyperslab and pass the position at the beginning for printing */ @@ -534,11 +535,10 @@ hsize_t diff_datasetid(hid_t did1, * close *------------------------------------------------------------------------- */ - h5difftrace("reclaim any VL memory\n"); + h5diffdebug2("reclaim any VL memory - errstat:%d\n", opts->err_stat); done: - - opts->err_stat = ret_value; + opts->err_stat = opts->err_stat | ret_value; /* free */ if(buf1 != NULL) { @@ -802,6 +802,9 @@ int diff_can_type(hid_t f_tid1, /* file data type */ } } done: + if (ret_value < 0) + opts->err_stat = 1; + h5diffdebug2("diff_can_type end - %d\n", ret_value); return ret_value; } diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 165c29a..b5dd820 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -1441,22 +1441,22 @@ ADD_H5_TEST (h5diff_415 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink3_to ADD_H5_TEST (h5diff_416 0 --follow-symlinks -v ${FILE14} ${FILE14} /softlink3_to_slink2 /softlink4_to_slink2) # non-exist-softlink vs softlink" -ADD_H5_TEST (h5diff_417 2 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_noexist /softlink_dset2) +ADD_H5_TEST (h5diff_417 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_noexist /softlink_dset2) # softlink vs non-exist-softlink" -ADD_H5_TEST (h5diff_418 2 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) +ADD_H5_TEST (h5diff_418 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) # non-exist-extlink_file vs extlink" -ADD_H5_TEST (h5diff_419 2 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist2 /ext_link_dset2) +ADD_H5_TEST (h5diff_419 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist2 /ext_link_dset2) # exlink vs non-exist-extlink_file" -ADD_H5_TEST (h5diff_420 2 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist2) +ADD_H5_TEST (h5diff_420 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist2) # extlink vs non-exist-extlink_obj" -ADD_H5_TEST (h5diff_421 2 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist1) +ADD_H5_TEST (h5diff_421 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist1) # non-exist-extlink_obj vs extlink" -ADD_H5_TEST (h5diff_422 2 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_dset2) +ADD_H5_TEST (h5diff_422 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_dset2) # extlink_to_softlink_to_dset1 vs dset2" ADD_H5_TEST (h5diff_423 1 --follow-symlinks -v ${FILE17} ${FILE18} /ext_link_to_slink1 /dset2) @@ -1512,11 +1512,11 @@ ADD_H5_TEST (h5diff_465 0 --follow-symlinks h5diff_danglelinks1.h5 h5diff_dangle # soft dangling vs. soft dangling ADD_H5_TEST (h5diff_466 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) # soft link vs. soft dangling -ADD_H5_TEST (h5diff_467 2 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2) +ADD_H5_TEST (h5diff_467 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2) # ext dangling vs. ext dangling ADD_H5_TEST (h5diff_468 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4) # ext link vs. ext dangling -ADD_H5_TEST (h5diff_469 2 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2) +ADD_H5_TEST (h5diff_469 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2) #--------------------------------------------------- # dangling links without follow symlink @@ -1655,7 +1655,7 @@ ADD_H5_TEST (h5diff_v3 0 -c ${FILEV1} ${FILEV2}) ############################################################################## if (BUILD_SHARED_LIBS) ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5) - ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5) + ADD_H5_UD_TEST (h5diff_plugin_fail 0 h5diff_udfail -v tudfilter.h5 tudfilter2.h5) endif () # ############################################################################## diff --git a/tools/test/h5diff/testfiles/h5diff_417.txt b/tools/test/h5diff/testfiles/h5diff_417.txt index 29d467a..0ea2542 100644 --- a/tools/test/h5diff/testfiles/h5diff_417.txt +++ b/tools/test/h5diff/testfiles/h5diff_417.txt @@ -1,3 +1,3 @@ obj1 is a dangling link. 1 differences found -EXIT CODE: 2 +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_418.txt b/tools/test/h5diff/testfiles/h5diff_418.txt index b6173d9..46222bb 100644 --- a/tools/test/h5diff/testfiles/h5diff_418.txt +++ b/tools/test/h5diff/testfiles/h5diff_418.txt @@ -1,3 +1,3 @@ obj2 is a dangling link. 1 differences found -EXIT CODE: 2 +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_419.txt b/tools/test/h5diff/testfiles/h5diff_419.txt index ee6e831..387c600 100644 --- a/tools/test/h5diff/testfiles/h5diff_419.txt +++ b/tools/test/h5diff/testfiles/h5diff_419.txt @@ -1,3 +1,3 @@ obj1 is a dangling link. 1 differences found -EXIT CODE: 2 +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_420.txt b/tools/test/h5diff/testfiles/h5diff_420.txt index 67c22ba..f3e65d9 100644 --- a/tools/test/h5diff/testfiles/h5diff_420.txt +++ b/tools/test/h5diff/testfiles/h5diff_420.txt @@ -1,3 +1,3 @@ obj2 is a dangling link. 1 differences found -EXIT CODE: 2 +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_421.txt b/tools/test/h5diff/testfiles/h5diff_421.txt index 7fd70ee..833c60c 100644 --- a/tools/test/h5diff/testfiles/h5diff_421.txt +++ b/tools/test/h5diff/testfiles/h5diff_421.txt @@ -1,3 +1,3 @@ obj2 is a dangling link. 1 differences found -EXIT CODE: 2 +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_422.txt b/tools/test/h5diff/testfiles/h5diff_422.txt index d1114af..3e675d5 100644 --- a/tools/test/h5diff/testfiles/h5diff_422.txt +++ b/tools/test/h5diff/testfiles/h5diff_422.txt @@ -1,3 +1,3 @@ obj1 is a dangling link. 1 differences found -EXIT CODE: 2 +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_467.txt b/tools/test/h5diff/testfiles/h5diff_467.txt index 35d3b74..f5195c0 100644 --- a/tools/test/h5diff/testfiles/h5diff_467.txt +++ b/tools/test/h5diff/testfiles/h5diff_467.txt @@ -1,3 +1,3 @@ obj2 is a dangling link. 1 differences found -EXIT CODE: 2 +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_469.txt b/tools/test/h5diff/testfiles/h5diff_469.txt index 23cb62f..594fd80 100644 --- a/tools/test/h5diff/testfiles/h5diff_469.txt +++ b/tools/test/h5diff/testfiles/h5diff_469.txt @@ -1,3 +1,3 @@ obj2 is a dangling link. 1 differences found -EXIT CODE: 2 +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_udfail.txt b/tools/test/h5diff/testfiles/h5diff_udfail.txt index c154c6b..aac5528 100644 --- a/tools/test/h5diff/testfiles/h5diff_udfail.txt +++ b/tools/test/h5diff/testfiles/h5diff_udfail.txt @@ -1,12 +1,16 @@ file1 file2 --------------------------------------- - x x / - x x /dynlibud + x x / + x x /dynlibud group : and 0 differences found dataset: and 0 differences found -warning: dataset cannot be read, user defined filter is not available -EXIT CODE: 2 +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. +Warning: dataset cannot be read, user defined filter is not available +EXIT CODE: 0 -- cgit v0.12 From cf3342f8fc53108e831b208d8ccb48628fb23e51 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 18 Oct 2017 14:03:27 -0500 Subject: Fix tools error handling and valgrind issues --- MANIFEST | 10 +++-- tools/lib/h5diff_dset.c | 4 +- tools/lib/h5tools_filters.c | 8 ++-- tools/src/h5repack/h5repack.c | 17 ++++--- tools/src/h5repack/h5repack_copy.c | 21 +++++---- tools/src/h5repack/h5repack_refs.c | 32 ++++++++----- tools/test/h5copy/CMakeTests.cmake | 52 ++++++++++++++++------ .../h5copy/testfiles/h5copy_plugin_fail.out.h5.txt | 3 ++ .../h5copy/testfiles/h5copy_plugin_test.out.h5.txt | 3 ++ tools/test/h5copy/testfiles/tudfilter.h5.txt | 2 +- tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt | 2 +- tools/test/h5diff/CMakeTests.cmake | 2 +- tools/test/h5diff/testfiles/h5diff_udfail.txt | 10 ++--- .../test/h5format_convert/testfiles/h5fc_v_err.ddl | 7 +++ tools/test/h5repack/CMakeTests.cmake | 4 +- tools/test/h5repack/h5repacktst.c | 6 ++- 16 files changed, 120 insertions(+), 63 deletions(-) create mode 100644 tools/test/h5copy/testfiles/h5copy_plugin_fail.out.h5.txt create mode 100644 tools/test/h5copy/testfiles/h5copy_plugin_test.out.h5.txt diff --git a/MANIFEST b/MANIFEST index 0e59ba0..39b3432 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2524,10 +2524,12 @@ ./tools/test/h5copy/testfiles/h5copy_misc1.out ./tools/test/h5copy/testfiles/h5copytst_new.h5 ./tools/test/h5copy/testfiles/h5copytst_new.out.ls -./tools/test/h5diff/testfiles/tudfilter.h5 -./tools/test/h5diff/testfiles/tudfilter2.h5 -./tools/test/h5diff/testfiles/tudfilter.h5.txt -./tools/test/h5diff/testfiles/tudfilter.h5_ERR.txt +./tools/test/h5copy/testfiles/h5copy_plugin_fail.out.h5.txt +./tools/test/h5copy/testfiles/h5copy_plugin_test.out.h5.txt +./tools/test/h5copy/testfiles/tudfilter.h5 +./tools/test/h5copy/testfiles/tudfilter2.h5 +./tools/test/h5copy/testfiles/tudfilter.h5.txt +./tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt # test files for h5mkgrp ./tools/testfiles/h5mkgrp_nested_p.ls diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index bea008c..b03295b 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -74,8 +74,10 @@ hsize_t diff_dataset(hid_t file1_id, else if (status < 0) { HGOTO_ERROR(1, H5E_tools_min_id_g, "h5tools_canreadf failed"); } - else + else { + ret_value = 1; opts->not_cmp = 1; + } done: opts->err_stat = opts->err_stat | ret_value; diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 132e69a..db61d51 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -18,7 +18,7 @@ * print a warning message *------------------------------------------------------------------------- */ -static void print_warning(const char *dname, const char *fname) +static void print_filter_warning(const char *dname, const char *fname) { fprintf(stderr, "Warning: dataset <%s> cannot be read, %s filter is not available\n", @@ -73,7 +73,7 @@ h5tools_canreadf(const char* name, /* object name, serves also as boolean pr } else if (!udfilter_avail) { if (name) - print_warning(name, "user defined"); + print_filter_warning(name, "user defined"); ret_value = 0; } break; @@ -85,7 +85,7 @@ h5tools_canreadf(const char* name, /* object name, serves also as boolean pr case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE if (name) - print_warning(name,"deflate"); + print_filter_warning(name,"deflate"); ret_value = 0; #endif break; @@ -96,7 +96,7 @@ h5tools_canreadf(const char* name, /* object name, serves also as boolean pr case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP if (name) - print_warning(name,"SZIP"); + print_filter_warning(name,"SZIP"); ret_value = 0; #endif break; diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index eaca0a5..14b9461 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -227,7 +227,6 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, /* Stack already exists, search for the datatype */ while (dt && dt->addr_in != oinfo.addr) dt = dt->next; - dt_ret = dt; } else { @@ -286,7 +285,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, /* Increment the ref count on id_out, because the calling function will try to close it */ if(H5Iinc_ref(ret_value) < 0) - ret_value = -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Iinc_ref failed"); done: return ret_value; @@ -426,7 +425,8 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, base_type = H5Tget_super(ftype_id); is_ref = (is_ref || (H5Tget_class(base_type) == H5T_REFERENCE)); - H5Tclose(base_type); + if (H5Tclose(base_type) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed"); } if (type_class == H5T_COMPOUND) { @@ -435,7 +435,8 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, for (j = 0; j < nmembers; j++) { hid_t mtid = H5Tget_member_type(wtype_id, (unsigned)j); H5T_class_t mtclass = H5Tget_class(mtid); - H5Tclose(mtid); + if (H5Tclose(mtid) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose mtid failed"); if (mtclass == H5T_REFERENCE) { is_ref = 1; @@ -486,17 +487,19 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, * close *------------------------------------------------------------------------- */ - if (H5Aclose(attr_out) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); if (H5Sclose(space_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); + space_id = -1; if (H5Tclose(wtype_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + wtype_id = -1; if (H5Tclose(ftype_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + ftype_id = -1; if (H5Aclose(attr_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); - } /* u */ + attr_id = -1; + } /* for u */ done: H5E_BEGIN_TRY { diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 7c3dfa5..b043047 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -1175,6 +1175,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); if (H5Tclose(type_out) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + type_out = -1; /* named datatypes stack, named_dt_head, manages allocation */ break; @@ -1205,6 +1206,18 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, } /* end if */ done: + + /* Finalize (link) the stack of named datatypes (if any) first + * because of reference counting */ + if (0 == ret_value && named_dt_head != NULL) { + if (named_datatype_free(&named_dt_head, 0) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "named_datatype_free failed"); + } + else + H5E_BEGIN_TRY { + named_datatype_free(&named_dt_head, 1); + } H5E_END_TRY; + H5E_BEGIN_TRY { H5Gclose(grp_in); @@ -1227,14 +1240,6 @@ done: if (hslab_buf != NULL) HDfree(hslab_buf); - /* Finalize (link) the stack of named datatypes (if any) */ - if (0 == ret_value && named_dt_head != NULL) - named_datatype_free(&named_dt_head, 0); - else - H5E_BEGIN_TRY { - named_datatype_free(&named_dt_head, 1); - } H5E_END_TRY; - return ret_value; } diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index 376ab92..14294ea 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -189,7 +189,8 @@ int do_copy_refobjs(hid_t fidin, refname); } } /*refname*/ - H5Oclose(refobj_id); + if (H5Oclose(refobj_id) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Oclose refob failed"); } /* u */ } /*nelmts*/ @@ -276,7 +277,8 @@ int do_copy_refobjs(hid_t fidin, refname); } } /*refname*/ - H5Oclose(refobj_id); + if (H5Oclose(refobj_id) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Oclose refobj_id failed"); } /* u */ } /*nelmts*/ @@ -377,7 +379,8 @@ int do_copy_refobjs(hid_t fidin, * This function is paired with copy_named_datatype() which is called * in copy_attr(), so need to free. */ - named_datatype_free(&named_dt_head, 0); + if (named_datatype_free(&named_dt_head, 0) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "named_datatype_free failed"); return ret_value; @@ -392,7 +395,7 @@ done: H5Tclose(ftype_id); H5Tclose(mtype_id); H5Tclose(type_in); - named_datatype_free(&named_dt_head, 0); + named_datatype_free(&named_dt_head, 1); } H5E_END_TRY; return ret_value; @@ -483,7 +486,8 @@ static int copy_refs_attr(hid_t loc_in, base_type = H5Tget_super(ftype_id); is_ref_vlen = (H5Tget_class(base_type) == H5T_REFERENCE); msize = H5Tget_size(base_type); - H5Tclose(base_type); + if (H5Tclose(base_type) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed"); } else if(type_class == H5T_ARRAY ) { hid_t base_type; @@ -491,7 +495,8 @@ static int copy_refs_attr(hid_t loc_in, base_type = H5Tget_super(ftype_id); is_ref_array = (H5Tget_class(base_type) == H5T_REFERENCE); msize = H5Tget_size(base_type); - H5Tclose(base_type); + if (H5Tclose(base_type) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed"); } else if(type_class == H5T_COMPOUND) { int nmembers = H5Tget_nmembers(ftype_id) ; @@ -511,7 +516,8 @@ static int copy_refs_attr(hid_t loc_in, ref_comp_size[ref_comp_field_n] = H5Tget_size(mtid); ref_comp_field_n++; } - H5Tclose(mtid); + if (H5Tclose(mtid) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose mtid failed"); } /* if compound don't contain reference type member, free the above @@ -533,9 +539,12 @@ static int copy_refs_attr(hid_t loc_in, is_ref_comp = (ref_comp_field_n > 0); if (!(is_ref || is_ref_vlen || is_ref_array || is_ref_comp)) { - H5Tclose(mtype_id); - H5Tclose(ftype_id); - H5Aclose(attr_id); + if (H5Tclose(mtype_id) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose mtype_id failed"); + if (H5Tclose(ftype_id) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose ftype_id failed"); + if (H5Aclose(attr_id) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Aclose attr_id failed"); continue; } @@ -568,7 +577,8 @@ static int copy_refs_attr(hid_t loc_in, base_type = H5Tget_super(ftype_id); msize = H5Tget_size(base_type); - H5Tclose(base_type); + if (H5Tclose(base_type) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed"); array_rank = (unsigned)H5Tget_array_ndims(mtype_id); H5Tget_array_dims2(mtype_id, array_dims); diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index f9733cf..616a459 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -32,6 +32,8 @@ ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5.txt ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5_ERR.txt + ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_plugin_fail.out.h5.txt + ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_plugin_test.out.h5.txt ) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") @@ -80,7 +82,7 @@ NAME H5COPY_F-${testname}-DIFF COMMAND $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) + set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () @@ -116,7 +118,7 @@ NAME H5COPY-${testname}-DIFF COMMAND $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) + set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () @@ -166,7 +168,7 @@ NAME H5COPY-${testname}-DIFF COMMAND $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) + set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () @@ -207,7 +209,7 @@ NAME H5COPY_SAME-${testname}-DIFF COMMAND $ -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) + set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () @@ -295,16 +297,23 @@ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - add_test ( - NAME H5COPY_UD-${testname}-DIFF - COMMAND $ -v ./testfiles/${cmpfile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} - ) - SET_TESTS_PROPERTIES(H5COPY_UD-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD-${testname}) - if ("${resultcode}" STREQUAL "1") - set_tests_properties (H5COPY_UD-${testname}-DIFF PROPERTIES WILL_FAIL "true") - endif () endif () set_tests_properties (H5COPY_UD-${testname} PROPERTIES DEPENDS H5COPY_UD-${testname}-clear-objects) + add_test ( + NAME H5COPY_UD-${testname}-DIFF + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}.out.h5;${srcname};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${testname}.out.h5.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=./testfiles/${testname}.out.h5.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5COPY_UD-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD-${testname}) endif () endmacro () @@ -327,7 +336,7 @@ -D "TEST_ARGS:STRING=-v;--enable-error-stack;-i;./testfiles/${infile};-o;./testfiles/${testname}_ERR.out.h5;${sparam};${srcname};${dparam};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=./testfiles/${infile}_ERR.out" - -D "TEST_EXPECT=${resultcode}" + -D "TEST_EXPECT=0" -D "TEST_REFERENCE=./testfiles/${infile}_ERR.txt" -D "TEST_MASK_ERROR=true" -D "TEST_APPEND=EXIT CODE:" @@ -353,6 +362,21 @@ ) endif () set_tests_properties (H5COPY_UD_ERR-${testname} PROPERTIES DEPENDS H5COPY_UD_ERR-${testname}-clearall-objects) + add_test ( + NAME H5COPY_UD_ERR-${testname}-DIFF + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}.out.h5;${srcname};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${testname}.out.h5.out" + -D "TEST_EXPECT=0" + -D "TEST_REFERENCE=./testfiles/${testname}.out.h5.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5COPY_UD_ERR-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD_ERR-${testname}) endif () endmacro () @@ -546,5 +570,5 @@ ############################################################################## if (BUILD_SHARED_LIBS) ADD_H5_UD_TEST (h5copy_plugin_test 0 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5 ) - ADD_H5_UD_TEST (h5copy_plugin_fail 2 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5) + ADD_H5_UD_ERR_TEST (h5copy_plugin_fail 2 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5) endif () diff --git a/tools/test/h5copy/testfiles/h5copy_plugin_fail.out.h5.txt b/tools/test/h5copy/testfiles/h5copy_plugin_fail.out.h5.txt new file mode 100644 index 0000000..66e9eb2 --- /dev/null +++ b/tools/test/h5copy/testfiles/h5copy_plugin_fail.out.h5.txt @@ -0,0 +1,3 @@ +dataset: and +0 differences found +EXIT CODE: 0 diff --git a/tools/test/h5copy/testfiles/h5copy_plugin_test.out.h5.txt b/tools/test/h5copy/testfiles/h5copy_plugin_test.out.h5.txt new file mode 100644 index 0000000..66e9eb2 --- /dev/null +++ b/tools/test/h5copy/testfiles/h5copy_plugin_test.out.h5.txt @@ -0,0 +1,3 @@ +dataset: and +0 differences found +EXIT CODE: 0 diff --git a/tools/test/h5copy/testfiles/tudfilter.h5.txt b/tools/test/h5copy/testfiles/tudfilter.h5.txt index 8f3d0b5..eabe407 100644 --- a/tools/test/h5copy/testfiles/tudfilter.h5.txt +++ b/tools/test/h5copy/testfiles/tudfilter.h5.txt @@ -1,2 +1,2 @@ -Copying file <./testfiles/tudfilter.h5> and object to file <./testfiles/h5copy_plugin_fail.out.h5> and object +Copying file <./testfiles/tudfilter.h5> and object to file <./testfiles/h5copy_plugin_test.out.h5> and object EXIT CODE: 0 diff --git a/tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt b/tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt index 8f3d0b5..3c5b3ca 100644 --- a/tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt +++ b/tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt @@ -1,2 +1,2 @@ -Copying file <./testfiles/tudfilter.h5> and object to file <./testfiles/h5copy_plugin_fail.out.h5> and object +Copying file <./testfiles/tudfilter.h5> and object to file <./testfiles/h5copy_plugin_fail_ERR.out.h5> and object EXIT CODE: 0 diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index b5dd820..d87a47f 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -1655,7 +1655,7 @@ ADD_H5_TEST (h5diff_v3 0 -c ${FILEV1} ${FILEV2}) ############################################################################## if (BUILD_SHARED_LIBS) ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5) - ADD_H5_UD_TEST (h5diff_plugin_fail 0 h5diff_udfail -v tudfilter.h5 tudfilter2.h5) + ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5) endif () # ############################################################################## diff --git a/tools/test/h5diff/testfiles/h5diff_udfail.txt b/tools/test/h5diff/testfiles/h5diff_udfail.txt index aac5528..d51de38 100644 --- a/tools/test/h5diff/testfiles/h5diff_udfail.txt +++ b/tools/test/h5diff/testfiles/h5diff_udfail.txt @@ -1,16 +1,12 @@ file1 file2 --------------------------------------- - x x / - x x /dynlibud + x x / + x x /dynlibud group : and 0 differences found dataset: and 0 differences found --------------------------------- -Some objects are not comparable --------------------------------- -Use -c for a list of objects without details of differences. Warning: dataset cannot be read, user defined filter is not available -EXIT CODE: 0 +EXIT CODE: 2 diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl index b671db0..fa2f078 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl @@ -11,3 +11,10 @@ Converting the dataset... Error encountered Close the file h5format_convert error: unable to downgrade dataset "/DSET_ERR" +H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: + #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5trav.c line 1062 in h5trav_visit(): traverse failed + major: Failure in tools library + minor: error in function + #001: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5trav.c line 290 in traverse(): H5Lvisit_by_name failed + major: Failure in tools library + minor: error in function diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 559dd88..13ebd17 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -275,12 +275,12 @@ endif () add_test ( NAME H5REPACK-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND $ --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS H5REPACK-${testname}-clear-objects) add_test ( NAME H5REPACK-${testname}_DFF - COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND $ --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) endif () diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index 264550e..f6166da 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -3041,9 +3041,9 @@ int make_all_filters(hid_t loc_id) /* close */ if(H5Tclose(dtid) < 0) - return -1; + goto out; if(H5Dclose(dsid) < 0) - return -1; + goto out; if(H5Sclose(sid) < 0) goto out; @@ -3055,6 +3055,8 @@ int make_all_filters(hid_t loc_id) out: H5E_BEGIN_TRY { + H5Tclose(dtid); + H5Dclose(dsid); H5Pclose(dcpl); H5Sclose(sid); } H5E_END_TRY; -- cgit v0.12 From d68de1621c98cc0b5d8d82af01ffcb608603366d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 18 Oct 2017 15:06:14 -0500 Subject: Fix format convert error mask test --- MANIFEST | 1 + tools/test/h5format_convert/CMakeTests.cmake | 58 +++++++++++++++++++++- .../test/h5format_convert/testfiles/h5fc_v_err.ddl | 8 --- .../test/h5format_convert/testfiles/h5fc_v_err.err | 8 +++ 4 files changed, 66 insertions(+), 9 deletions(-) create mode 100644 tools/test/h5format_convert/testfiles/h5fc_v_err.err diff --git a/MANIFEST b/MANIFEST index 39b3432..24ab056 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1354,6 +1354,7 @@ ./tools/test/h5format_convert/testfiles/h5fc_v_n_all.ddl ./tools/test/h5format_convert/testfiles/h5fc_v_bt1.ddl ./tools/test/h5format_convert/testfiles/h5fc_v_err.ddl +./tools/test/h5format_convert/testfiles/h5fc_v_err.err ./tools/test/h5format_convert/testfiles/h5fc_v_non_chunked.ddl ./tools/test/h5format_convert/testfiles/h5fc_d_file.ddl ./tools/test/h5format_convert/testfiles/h5fc_v_ndata_bt1.ddl diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake index 4af220b..c2b2d3a 100644 --- a/tools/test/h5format_convert/CMakeTests.cmake +++ b/tools/test/h5format_convert/CMakeTests.cmake @@ -140,6 +140,62 @@ endif () endmacro () + macro (ADD_H5_MASK_OUTPUT testname resultfile resultcode testfile) + # If using memchecker add tests without using scripts + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5FC-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/outtmp.h5 + ./testfiles/${testname}.out + ./testfiles/${testname}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + if (NOT "${testfile}" STREQUAL "") + add_test ( + NAME H5FC-${testname}-${testfile}-tmpfile + COMMAND ${CMAKE_COMMAND} + -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5 + ) + set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") + add_test ( + NAME H5FC-${testname}-${testfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN};outtmp.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}" + -D "TEST_ERRREF=${resultfile}.err" + -D "TEST_MASK_ERROR=true" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile") + set (last_test "H5FC-${testname}-${testfile}") + else () + add_test ( + NAME H5FC-${testname}-NA + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}" + -D "TEST_ERRREF=${resultfile}.err" + -D "TEST_MASK_ERROR=true" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5FC-${testname}-NA PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") + set (last_test "H5FC-${testname}-NA") + endif () + endif () + endmacro () + macro (ADD_H5_TEST testname resultcode testfile) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -391,7 +447,7 @@ # # # h5format_convert -v h5fc_err_level.h5 (error encountered in converting the dataset) - ADD_H5_OUTPUT (h5fc_v_err h5fc_v_err.ddl 1 h5fc_err_level.h5 -v) + ADD_H5_MASK_OUTPUT (h5fc_v_err h5fc_v_err.ddl 1 h5fc_err_level.h5 -v) # # # diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl index fa2f078..0b7d0ac 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl @@ -10,11 +10,3 @@ Dataset's chunk indexing type is not version 1 B-tree Converting the dataset... Error encountered Close the file -h5format_convert error: unable to downgrade dataset "/DSET_ERR" -H5tools-DIAG: Error detected in HDF5:tools (1.11.0) thread 0: - #000: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5trav.c line 1062 in h5trav_visit(): traverse failed - major: Failure in tools library - minor: error in function - #001: /home/byrn/HDF_Projects/hdf5/dev/tools/lib/h5trav.c line 290 in traverse(): H5Lvisit_by_name failed - major: Failure in tools library - minor: error in function diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_err.err b/tools/test/h5format_convert/testfiles/h5fc_v_err.err new file mode 100644 index 0000000..d85a999 --- /dev/null +++ b/tools/test/h5format_convert/testfiles/h5fc_v_err.err @@ -0,0 +1,8 @@ +h5format_convert error: unable to downgrade dataset "/DSET_ERR" +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5trav_visit(): traverse failed + major: Failure in tools library + minor: error in function + #001: (file name) line (number) in traverse(): H5Lvisit_by_name failed + major: Failure in tools library + minor: error in function -- cgit v0.12 From 49c21ebcf22380e6c402b05d981a539c8c85a5b7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 18 Oct 2017 15:14:46 -0500 Subject: Fix name of output files --- MANIFEST | 2 +- tools/test/h5copy/CMakeTests.cmake | 8 ++++---- tools/test/h5copy/testfiles/h5copy_plugin_fail.out.h5.txt | 3 --- tools/test/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt | 3 +++ 4 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 tools/test/h5copy/testfiles/h5copy_plugin_fail.out.h5.txt create mode 100644 tools/test/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt diff --git a/MANIFEST b/MANIFEST index 24ab056..261de1d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2525,7 +2525,7 @@ ./tools/test/h5copy/testfiles/h5copy_misc1.out ./tools/test/h5copy/testfiles/h5copytst_new.h5 ./tools/test/h5copy/testfiles/h5copytst_new.out.ls -./tools/test/h5copy/testfiles/h5copy_plugin_fail.out.h5.txt +./tools/test/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt ./tools/test/h5copy/testfiles/h5copy_plugin_test.out.h5.txt ./tools/test/h5copy/testfiles/tudfilter.h5 ./tools/test/h5copy/testfiles/tudfilter2.h5 diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 616a459..270d546 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -32,7 +32,7 @@ ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5.txt ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5_ERR.txt - ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_plugin_fail.out.h5.txt + ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_plugin_fail_ERR.out.h5.txt ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_plugin_test.out.h5.txt ) @@ -366,11 +366,11 @@ NAME H5COPY_UD_ERR-${testname}-DIFF COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}.out.h5;${srcname};${dstname}" + -D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}_ERR.out.h5;${srcname};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${testname}.out.h5.out" + -D "TEST_OUTPUT=./testfiles/${testname}_ERR.out.h5.out" -D "TEST_EXPECT=0" - -D "TEST_REFERENCE=./testfiles/${testname}.out.h5.txt" + -D "TEST_REFERENCE=./testfiles/${testname}_ERR.out.h5.txt" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" diff --git a/tools/test/h5copy/testfiles/h5copy_plugin_fail.out.h5.txt b/tools/test/h5copy/testfiles/h5copy_plugin_fail.out.h5.txt deleted file mode 100644 index 66e9eb2..0000000 --- a/tools/test/h5copy/testfiles/h5copy_plugin_fail.out.h5.txt +++ /dev/null @@ -1,3 +0,0 @@ -dataset: and -0 differences found -EXIT CODE: 0 diff --git a/tools/test/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt b/tools/test/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt new file mode 100644 index 0000000..66e9eb2 --- /dev/null +++ b/tools/test/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt @@ -0,0 +1,3 @@ +dataset: and +0 differences found +EXIT CODE: 0 -- cgit v0.12 From c475dd05a6b20e19da5b6fdf5000ba63120c1301 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 18 Oct 2017 15:45:07 -0500 Subject: Correct name of err file --- MANIFEST | 2 +- tools/test/h5format_convert/CMakeTests.cmake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index 261de1d..4a62884 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1354,7 +1354,7 @@ ./tools/test/h5format_convert/testfiles/h5fc_v_n_all.ddl ./tools/test/h5format_convert/testfiles/h5fc_v_bt1.ddl ./tools/test/h5format_convert/testfiles/h5fc_v_err.ddl -./tools/test/h5format_convert/testfiles/h5fc_v_err.err +./tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err ./tools/test/h5format_convert/testfiles/h5fc_v_non_chunked.ddl ./tools/test/h5format_convert/testfiles/h5fc_d_file.ddl ./tools/test/h5format_convert/testfiles/h5fc_v_ndata_bt1.ddl diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake index c2b2d3a..2240813 100644 --- a/tools/test/h5format_convert/CMakeTests.cmake +++ b/tools/test/h5format_convert/CMakeTests.cmake @@ -47,6 +47,7 @@ old_h5fc_ext2_sf.ddl old_h5fc_ext3_isf.ddl h5fc_v_err.ddl + h5fc_v_err.ddl.err ) set (HDF5_REFERENCE_TEST_FILES h5fc_non_v3.h5 -- cgit v0.12 From cfad6bf6f8a678dc03c52b7474a6f04a4a69b030 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 18 Oct 2017 15:51:56 -0500 Subject: Add new output files to clear test --- tools/test/h5copy/CMakeTests.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 270d546..1bdefa6 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -266,6 +266,8 @@ testfiles/${testname}.out.h5 testfiles/${infile}.out testfiles/${infile}.out.err + testfiles/${testname}.out.h5.out + testfiles/${testname}.out.h5.out.err ) if ("${resultcode}" STREQUAL "2") add_test ( @@ -327,6 +329,8 @@ testfiles/${testname}_ERR.out.h5 testfiles/${infile}_ERR.out testfiles/${infile}_ERR.out.err + testfiles/${testname}_ERR.out.h5.out + testfiles/${testname}_ERR.out.h5.out.err ) if ("${resultcode}" STREQUAL "2") add_test ( -- cgit v0.12 From f071b2ff97699f2981715fa038e34777ac1d5dd8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 18 Oct 2017 16:07:42 -0500 Subject: Add Mask test to script --- tools/test/h5format_convert/testh5fc.sh.in | 137 +++++++++++++++++++++-------- 1 file changed, 100 insertions(+), 37 deletions(-) diff --git a/tools/test/h5format_convert/testh5fc.sh.in b/tools/test/h5format_convert/testh5fc.sh.in index c3056e8..9250df3 100644 --- a/tools/test/h5format_convert/testh5fc.sh.in +++ b/tools/test/h5format_convert/testh5fc.sh.in @@ -32,8 +32,8 @@ EXIT_FAILURE=1 FORMCONV=../../src/h5format_convert/h5format_convert # The tool name FORMCONV_BIN=`pwd`/$FORMCONV # The path of the tool binary -CHK_IDX=h5fc_chk_idx # The program name -CHK_IDX_BIN=`pwd`/$CHK_IDX # The program to verify the chunk indexing type is v1 B-tree +CHK_IDX=h5fc_chk_idx # The program name +CHK_IDX_BIN=`pwd`/$CHK_IDX # The program to verify the chunk indexing type is v1 B-tree RM='rm -rf' CMP='cmp -s' @@ -131,6 +131,7 @@ $SRC_H5FORMCONV_TESTFILES/old_h5fc_ext2_is.ddl $SRC_H5FORMCONV_TESTFILES/old_h5fc_ext2_sf.ddl $SRC_H5FORMCONV_TESTFILES/old_h5fc_ext3_isf.ddl $SRC_H5FORMCONV_TESTFILES/h5fc_v_err.ddl +$SRC_H5FORMCONV_TESTFILES/h5fc_v_err.ddl.err " # @@ -154,10 +155,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 @@ -177,7 +178,7 @@ CLEAN_TESTFILES_AND_TESTDIR() if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then $RM $TESTDIR else - $RM $TESTDIR/$TMPFILE + $RM $TESTDIR/$TMPFILE $RM $TESTDIR/$TMPOUTFILE $RM $TESTDIR/$TMPCHKFILE $RM $TESTDIR/$TMPDMPFILE @@ -201,13 +202,13 @@ TESTING() { # non-zero value. # # $1: expected output -# $2: the test file name -# --fname might be empty or fname does not exist -# --fname is copied to a temporary file for testing +# $2: the test file name +# --fname might be empty or fname does not exist +# --fname is copied to a temporary file for testing # $3 to at most $6--options to the tool such as: -# -d dname or --dname=dname -# -v or --verbose -# -n or --noop +# -d dname or --dname=dname +# -v or --verbose +# -n or --noop TOOLTEST_OUT() { # Prepare expected and actual output expect="$TESTDIR/$1" @@ -220,15 +221,15 @@ TOOLTEST_OUT() { $RM $TESTDIR/$TMPOUTFILE TFILE=$2 if [ ! -z "$2" ] && [ -e $TESTDIR/$2 ] ; then - $CP $TESTDIR/$2 $TESTDIR/$TMPOUTFILE - TFILE=$TMPOUTFILE + $CP $TESTDIR/$2 $TESTDIR/$TMPOUTFILE + TFILE=$TMPOUTFILE fi # Run test. TESTING $FORMCONV $3 $4 $5 $6 $2 ( - cd $TESTDIR - $RUNSERIAL $FORMCONV_BIN $3 $4 $5 $6 $TFILE + cd $TESTDIR + $RUNSERIAL $FORMCONV_BIN $3 $4 $5 $6 $TFILE ) >$actual 2>$actual_err cp $actual $actual_sav cp $actual_err $actual_err_sav @@ -239,20 +240,82 @@ TOOLTEST_OUT() { # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - $RM $actual $actual_err - $RM $actual $actual_err $actual_sav $actual_err_sav + $RM $actual $actual_err + $RM $actual $actual_err $actual_sav $actual_err_sav + fi +} +# Same as TOOLTEST_OUT but filters error stack output and compares to an error file +TOOLTEST_MASK_OUT() { + # Prepare expected and actual output + expect="$TESTDIR/$1" + expect_err="$TESTDIR/$1.err" + actual_ext="$TESTDIR/$1.ext" + actual="$TESTDIR/`basename $1 .ddl`.out" + actual_err="$TESTDIR/`basename $1 .ddl`.err" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + + # Prepare the test file + $RM $TESTDIR/$TMPOUTFILE + TFILE=$2 + if [ ! -z "$2" ] && [ -e $TESTDIR/$2 ] ; then + $CP $TESTDIR/$2 $TESTDIR/$TMPOUTFILE + TFILE=$TMPOUTFILE + fi + + # Run test. + TESTING $FORMCONV $3 $4 $5 $6 $2 + ( + cd $TESTDIR + $RUNSERIAL $FORMCONV_BIN $3 $4 $5 $6 $TFILE + ) >$actual 2>$actual_err + cp $actual $actual_sav + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + + # Extract file name, line number, version and thread IDs because they may be different + sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ + -e 's/line [0-9]*/line (number)/' \ + -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ + -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ + -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ + -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ + $actual_err > $actual_ext + + # Compare output + if $CMP $expect $actual; then + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + COMPARE_OUT $expect_err $actual_err + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + $RM $actual $actual_err + $RM $actual $actual_err $actual_sav $actual_err_sav fi } -# To check that the tool exits success, no output +# To check that the tool exits success, no output # Assume all short options -# $1 is the test file name -# --fname exists -# --fname is copied to a temporary file for testing -# $2 is the temporary file name +# $1 is the test file name +# --fname exists +# --fname is copied to a temporary file for testing +# $2 is the temporary file name # $3 to at most $5--options to the tool such as: -# -d dname -# -n +# -d dname +# -n TOOLTEST() { TESTING $FORMCONV $3 $4 $5 $1 $RM $TESTDIR/$2 @@ -260,11 +323,11 @@ TOOLTEST() { $RUNSERIAL $FORMCONV_BIN $3 $4 $5 $TESTDIR/$2 exitcode=$? if [ $exitcode -ne 0 ]; then - echo "*FAILED*" - echo " The tool exits failure" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + echo " The tool exits failure" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" + echo " PASSED" fi } @@ -280,11 +343,11 @@ IDX_CHECK() { $RUNSERIAL $CHK_IDX_BIN $TESTDIR/$TMPCHKFILE $1 ret=$? if [ $ret -eq 0 ]; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " The chunk indexing type is not correct" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + echo " The chunk indexing type is not correct" + nerrors="`expr $nerrors + 1`" fi } @@ -317,7 +380,7 @@ H5DUMP_CHECK() { # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - $RM $actual $actual_err + $RM $actual $actual_err fi } @@ -326,12 +389,12 @@ SKIP() { TESTING $STAT $@ echo " -SKIP-" } - + ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test @@ -377,7 +440,7 @@ TOOLTEST_OUT h5fc_v_n_all.ddl h5fc_non_v3.h5 -v -n # # # h5format_convert -v h5fc_err_level.h5 (error encountered in converting the dataset) -TOOLTEST_OUT h5fc_v_err.ddl h5fc_err_level.h5 -v +TOOLTEST_MASK_OUT h5fc_v_err.ddl h5fc_err_level.h5 -v # # # @@ -436,7 +499,7 @@ TOOLTEST h5fc_non_v3.h5 $TMPFILE -n # # No output from tests: just check exit code # h5format_convert h5fc_non_v3.h5 -# 1) convert all datasets +# 1) convert all datasets # 2) verify indexing types TOOLTEST h5fc_non_v3.h5 $TMPCHKFILE IDX_CHECK /DSET_NDATA_EA -- cgit v0.12 From 4ab2d9f010e7cf76ae81122a627c10c03e8cd00c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 18 Oct 2017 16:19:32 -0500 Subject: Correct name of file --- tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err | 8 ++++++++ tools/test/h5format_convert/testfiles/h5fc_v_err.err | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err delete mode 100644 tools/test/h5format_convert/testfiles/h5fc_v_err.err diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err new file mode 100644 index 0000000..d85a999 --- /dev/null +++ b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err @@ -0,0 +1,8 @@ +h5format_convert error: unable to downgrade dataset "/DSET_ERR" +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5trav_visit(): traverse failed + major: Failure in tools library + minor: error in function + #001: (file name) line (number) in traverse(): H5Lvisit_by_name failed + major: Failure in tools library + minor: error in function diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_err.err b/tools/test/h5format_convert/testfiles/h5fc_v_err.err deleted file mode 100644 index d85a999..0000000 --- a/tools/test/h5format_convert/testfiles/h5fc_v_err.err +++ /dev/null @@ -1,8 +0,0 @@ -h5format_convert error: unable to downgrade dataset "/DSET_ERR" -H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5trav_visit(): traverse failed - major: Failure in tools library - minor: error in function - #001: (file name) line (number) in traverse(): H5Lvisit_by_name failed - major: Failure in tools library - minor: error in function -- cgit v0.12 From d9e7aad64b590280ac73842c45400210d0755110 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 18 Oct 2017 16:33:00 -0500 Subject: Remove extra command line --- tools/test/h5format_convert/testh5fc.sh.in | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/test/h5format_convert/testh5fc.sh.in b/tools/test/h5format_convert/testh5fc.sh.in index 9250df3..585d389 100644 --- a/tools/test/h5format_convert/testh5fc.sh.in +++ b/tools/test/h5format_convert/testh5fc.sh.in @@ -298,7 +298,6 @@ TOOLTEST_MASK_OUT() { nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi - COMPARE_OUT $expect_err $actual_err # Clean up output file if test -z "$HDF5_NOCLEANUP"; then -- cgit v0.12 From afeaceef5fe47a82cf7dbf536dbbe45cbda72500 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 19 Oct 2017 12:45:17 -0500 Subject: Windows had issues - revert code changes for get_option --- tools/lib/h5tools_utils.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 1b5911b..a081c7e 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -205,8 +205,9 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti opt_opt = l_opts[i].shortval; if (l_opts[i].has_arg != no_arg) { - if (arg[len] == '=') + if (arg[len] == '=') { opt_arg = &arg[len + 1]; + } else if (l_opts[i].has_arg != optional_arg) { if (opt_ind < (argc - 1)) if (argv[opt_ind + 1][0] != '-') @@ -295,13 +296,16 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti opt_ind++; /* we do have an extra argument, check if not last */ if ( (opt_ind+1) < argc ) { - if ( argv[opt_ind][0] != '-' ) + if ( argv[opt_ind][0] != '-' ) { opt_arg = argv[opt_ind++]; - else + } + else { opt_arg = NULL; + } } - else + else { opt_arg = NULL; + } } else { /* set up to look at next char in token, next time */ -- cgit v0.12 From 8e30e7eb19d251089e44256ec5d409badbaf4b39 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 19 Oct 2017 16:51:43 -0500 Subject: Avoid double free --- tools/lib/h5diff_array.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 54b9109..11f5e41 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -4258,9 +4258,6 @@ int ull2float(unsigned long long ull_value, float *f_value) HDmemcpy(f_value, buf, dst_size); - if (buf) - HDfree(buf); - done: H5E_BEGIN_TRY { H5Pclose(dxpl_id); -- cgit v0.12 From 1d3b4f6ac9075a2f6ee0c7055e7b5763c346eb78 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 19 Oct 2017 15:30:57 -0700 Subject: Moved the 'cache image + SWMR' check from H5Fcreate/open to H5F_open. Prep for the VOL merge. --- src/H5F.c | 18 +----------------- src/H5Fint.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/H5F.c b/src/H5F.c index 211f1aa..39eca13 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -443,8 +443,6 @@ done: hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { - hbool_t ci_load = FALSE; /* whether MDC ci load requested */ - hbool_t ci_write = FALSE; /* whether MDC CI write requested */ H5F_t *new_file = NULL; /*file struct for new file */ hid_t dxpl_id = H5AC_ind_read_dxpl_id; /*dxpl used by library */ hid_t ret_value; /*return value */ @@ -490,12 +488,6 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) if(NULL == (new_file = H5F_open(filename, flags, fcpl_id, fapl_id, dxpl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to create file") - /* Check to see if both SWMR and cache image are requested. Fail if so */ - if(H5C_cache_image_status(new_file, &ci_load, &ci_write) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MDC cache image status") - if((ci_load || ci_write) && (flags & (H5F_ACC_SWMR_READ | H5F_ACC_SWMR_WRITE))) - HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "can't have both SWMR and cache image") - /* Get an atom for the file */ if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file") @@ -554,8 +546,6 @@ done: hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) { - hbool_t ci_load = FALSE; /* whether MDC ci load requested */ - hbool_t ci_write = FALSE; /* whether MDC CI write requested */ H5F_t *new_file = NULL; /*file struct for new file */ hid_t dxpl_id = H5AC_ind_read_dxpl_id; /*dxpl used by library */ hid_t ret_value; /*return value */ @@ -585,12 +575,6 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) if(NULL == (new_file = H5F_open(filename, flags, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to open file") - /* Check to see if both SWMR and cache image are requested. Fail if so */ - if(H5C_cache_image_status(new_file, &ci_load, &ci_write) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MDC cache image status") - if((ci_load || ci_write) && (flags & (H5F_ACC_SWMR_READ | H5F_ACC_SWMR_WRITE))) - HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "can't have both SWMR and cache image") - /* Get an atom for the file */ if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") @@ -1649,7 +1633,7 @@ H5Fstart_swmr_write(hid_t file_id) /* Flush the superblock extension */ if(H5F_flush_tagged_metadata(file, file->shared->sblock->ext_addr, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, NULL, "unable to flush superblock extension") + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock extension") /* Flush data buffers */ if(H5F__flush(file, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) diff --git a/src/H5Fint.c b/src/H5Fint.c index 4c5e00e..4333e93 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1186,6 +1186,9 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5F_t *ret_value = NULL; /*actual return value */ char *lock_env_var = NULL;/*env var pointer */ hbool_t use_file_locking; /*read from env var */ + hbool_t ci_load = FALSE; /* whether MDC ci load requested */ + hbool_t ci_write = FALSE; /* whether MDC CI write requested */ + hbool_t ci_swmr_fail = FALSE; /* set w/ SWMR + cache image */ FUNC_ENTER_NOAPI(NULL) @@ -1490,13 +1493,26 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, } /* end else */ } /* end if set_flag */ + /* Check to see if both SWMR and cache image are requested. Fail if so */ + if(H5C_cache_image_status(file, &ci_load, &ci_write) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get MDC cache image status") + if((ci_load || ci_write) && (flags & (H5F_ACC_SWMR_READ | H5F_ACC_SWMR_WRITE))) { + ci_swmr_fail = TRUE; + HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, NULL, "can't have both SWMR and cache image") + } + /* Success */ ret_value = file; done: - if((NULL == ret_value) && file) + if(ci_swmr_fail) { + if(H5F_try_close(file, NULL) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file") + } + else if((NULL == ret_value) && file) { if(H5F__dest(file, meta_dxpl_id, raw_dxpl_id, FALSE) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file") + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_open() */ -- cgit v0.12 From 18ba8cb7d247cc2f535e53d66c2a47740724de6a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 20 Oct 2017 08:29:31 -0500 Subject: Windows cannot share files easily --- tools/test/misc/CMakeTestsClear.cmake | 38 +++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index b9095fb..fb4826b 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -55,6 +55,36 @@ ############################################################################## ############################################################################## + # Need special dependencies for tests that use the same reference file + # This is an issue on Windows + macro (ADD_H5_USAGE testname resultfile resultcode) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5CLEAR_USAGE-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${testname}.out + testfiles/${testname}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR_USAGE-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME H5CLEAR_USAGE-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5CLEAR_USAGE-${testname} PROPERTIES DEPENDS H5CLEAR_USAGE-${testname}-clear-objects) + set (last_test "H5CLEAR_USAGE-${testname}") + endif () + endmacro () + macro (ADD_H5_CMP testname resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -212,10 +242,10 @@ endif() # "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) # "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) # "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) - ADD_H5_CMP (h5clr_usage_h h5clear_usage 0 "-h") - ADD_H5_CMP (h5clr_usage h5clear_usage 1 "") - ADD_H5_CMP (h5clr_usage_junk h5clear_usage 1 "" junk.h5) - ADD_H5_CMP (h5clr_usage_none h5clear_usage 1 "" orig_h5clear_sec2_v3.h5) + ADD_H5_USAGE (h5clr_usage_h h5clear_usage 0 "-h") + ADD_H5_USAGE (h5clr_usage h5clear_usage 1 "") + ADD_H5_USAGE (h5clr_usage_junk h5clear_usage 1 "" junk.h5) + ADD_H5_USAGE (h5clr_usage_none h5clear_usage 1 "" orig_h5clear_sec2_v3.h5) ADD_H5_CMP (h5clr_missing_file_m h5clear_missing_file 1 "-m") ADD_H5_CMP (h5clr_open_fail_s h5clear_open_fail 1 "-s" junk.h5) ADD_H5_CMP (h5clr_missing_file_ms h5clear_missing_file 1 "-m" "-s") -- cgit v0.12 From c2be993f325813e711ee7cc97bb02b7b482a8290 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 20 Oct 2017 09:37:12 -0500 Subject: HDFFV-10297 Windows issues fixed --- tools/test/misc/CMakeTestsClear.cmake | 40 +++++++---------------------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index fb4826b..942ae7a 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -57,34 +57,6 @@ # Need special dependencies for tests that use the same reference file # This is an issue on Windows - macro (ADD_H5_USAGE testname resultfile resultcode) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - add_test ( - NAME H5CLEAR_USAGE-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${testname}.out - testfiles/${testname}.out.err - ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5CLEAR_USAGE-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - add_test ( - NAME H5CLEAR_USAGE-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testname}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ddl" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - set_tests_properties (H5CLEAR_USAGE-${testname} PROPERTIES DEPENDS H5CLEAR_USAGE-${testname}-clear-objects) - set (last_test "H5CLEAR_USAGE-${testname}") - endif () - endmacro () - macro (ADD_H5_CMP testname resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -94,6 +66,9 @@ testfiles/${testname}.out testfiles/${testname}.out.err ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME H5CLEAR_CMP-${testname} COMMAND "${CMAKE_COMMAND}" @@ -106,6 +81,7 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects) + set (last_test "H5CLEAR_CMP-${testname}") endif () endmacro () @@ -242,10 +218,10 @@ endif() # "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) # "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) # "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) - ADD_H5_USAGE (h5clr_usage_h h5clear_usage 0 "-h") - ADD_H5_USAGE (h5clr_usage h5clear_usage 1 "") - ADD_H5_USAGE (h5clr_usage_junk h5clear_usage 1 "" junk.h5) - ADD_H5_USAGE (h5clr_usage_none h5clear_usage 1 "" orig_h5clear_sec2_v3.h5) + ADD_H5_CMP (h5clr_usage_h h5clear_usage 0 "-h") + ADD_H5_CMP (h5clr_usage h5clear_usage 1 "") + ADD_H5_CMP (h5clr_usage_junk h5clear_usage 1 "" junk.h5) + ADD_H5_CMP (h5clr_usage_none h5clear_usage 1 "" orig_h5clear_sec2_v3.h5) ADD_H5_CMP (h5clr_missing_file_m h5clear_missing_file 1 "-m") ADD_H5_CMP (h5clr_open_fail_s h5clear_open_fail 1 "-s" junk.h5) ADD_H5_CMP (h5clr_missing_file_ms h5clear_missing_file 1 "-m" "-s") -- cgit v0.12 From d8a3782ce49d537d96020dfa250a253d90f4c14f Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 20 Oct 2017 17:25:18 -0700 Subject: Moved the SWMR + cache image check up before the root group is constructed to avoid the special case close. --- src/H5Fint.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/H5Fint.c b/src/H5Fint.c index 4333e93..7371c46 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1188,7 +1188,6 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hbool_t use_file_locking; /*read from env var */ hbool_t ci_load = FALSE; /* whether MDC ci load requested */ hbool_t ci_write = FALSE; /* whether MDC CI write requested */ - hbool_t ci_swmr_fail = FALSE; /* set w/ SWMR + cache image */ FUNC_ENTER_NOAPI(NULL) @@ -1322,6 +1321,12 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, set_flag = TRUE; } /* end else */ + /* Check to see if both SWMR and cache image are requested. Fail if so */ + if(H5C_cache_image_status(file, &ci_load, &ci_write) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get MDC cache image status") + if((ci_load || ci_write) && (flags & (H5F_ACC_SWMR_READ | H5F_ACC_SWMR_WRITE))) + HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, NULL, "can't have both SWMR and cache image") + /* Retain the name the file was opened with */ file->open_name = H5MM_xstrdup(name); @@ -1493,26 +1498,14 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, } /* end else */ } /* end if set_flag */ - /* Check to see if both SWMR and cache image are requested. Fail if so */ - if(H5C_cache_image_status(file, &ci_load, &ci_write) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get MDC cache image status") - if((ci_load || ci_write) && (flags & (H5F_ACC_SWMR_READ | H5F_ACC_SWMR_WRITE))) { - ci_swmr_fail = TRUE; - HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, NULL, "can't have both SWMR and cache image") - } - /* Success */ ret_value = file; done: - if(ci_swmr_fail) { - if(H5F_try_close(file, NULL) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file") - } - else if((NULL == ret_value) && file) { + if((NULL == ret_value) && file) if(H5F__dest(file, meta_dxpl_id, raw_dxpl_id, FALSE) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file") - } + FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_open() */ -- cgit v0.12 From 8e2cedd066e4569bf36b530495bd2f811d95f808 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 23 Oct 2017 09:26:15 -0500 Subject: HDFFV-10297 Cleanup, Initialize variables --- tools/lib/h5diff_dset.c | 2 +- tools/lib/h5tools.c | 464 +++++++++++++++---------------------- tools/lib/h5tools_dump.c | 11 +- tools/lib/h5tools_str.c | 8 +- tools/lib/h5tools_utils.c | 5 +- tools/src/h5repack/h5repack.c | 8 +- tools/src/h5repack/h5repack_copy.c | 28 +-- tools/src/h5repack/h5repack_refs.c | 15 +- 8 files changed, 224 insertions(+), 317 deletions(-) diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index b03295b..ee42b99 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -189,7 +189,7 @@ hsize_t diff_datasetid(hid_t did1, void *buf2 = NULL; void *sm_buf1 = NULL; void *sm_buf2 = NULL; - hid_t sm_space; /*stripmine data space */ + hid_t sm_space = -1; /*stripmine data space */ size_t need; /* bytes needed for malloc */ int i; unsigned int vl_data = 0; /*contains VL datatypes */ diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 344913a..6ea5e47 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -23,10 +23,10 @@ #include "H5private.h" /* global variables */ -hid_t H5tools_ERR_STACK_g = 0; -hid_t H5tools_ERR_CLS_g = -1; -hid_t H5E_tools_g = -1; -hid_t H5E_tools_min_id_g = -1; +hid_t H5tools_ERR_STACK_g = 0; +hid_t H5tools_ERR_CLS_g = -1; +hid_t H5E_tools_g = -1; +hid_t H5E_tools_min_id_g = -1; int compound_data; FILE *rawattrstream = NULL; /* should initialize to stdout but gcc moans about it */ FILE *rawdatastream = NULL; /* should initialize to stdout but gcc moans about it */ @@ -77,18 +77,13 @@ typedef enum { #define NUM_DRIVERS (sizeof(drivernames) / sizeof(drivernames[0])) /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Initialize the H5 Tools library - * Description: - * This should be called before any other h5tools function is called. - * Effect of any h5tools function called before this has been called is - * undetermined. - * Return: - * None - * Programmer: - * Albert Cheng, 2000-10-31 - * Modifications: + * Function: h5tools_init + * + * Purpose: This should be called before any other h5tools function is called. + * Effect of any h5tools function called before this has been called is + * undetermined. + * + * Return None *------------------------------------------------------------------------- */ void @@ -121,19 +116,14 @@ h5tools_init(void) } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Close the H5 Tools library - * Description: - * Close or release resources such as files opened by the library. This - * should be called after all other h5tools functions have been called. - * Effect of any h5tools function called after this has been called is - * undetermined. - * Return: - * None - * Programmer: - * Albert Cheng, 2000-10-31 - * Modifications: + * Function: h5tools_close + * + * Purpose: Close or release resources such as files opened by the library. This + * should be called after all other h5tools functions have been called. + * Effect of any h5tools function called after this has been called is + * undetermined. + * + * Return: None *------------------------------------------------------------------------- */ void @@ -193,19 +183,13 @@ h5tools_close(void) } /*------------------------------------------------------------------------- - * Function: h5tools_set_data_output_file - * - * Purpose: Open fname as the output file for dataset raw data. - * Set rawdatastream as its file stream. + * Function: h5tools_set_data_output_file * - * Return: 0 -- succeeded - * negative -- failed - * - * Programmer: Albert Cheng, 2000/09/30 - * - * Modifications: - * pvn June, 1, 2006. Add a switch for binary output + * Purpose: Open fname as the output file for dataset raw data. + * Set rawdatastream as its file stream. * + * Return: 0 -- succeeded + * negative -- failed *------------------------------------------------------------------------- */ int @@ -247,14 +231,13 @@ h5tools_set_data_output_file(const char *fname, int is_bin) } /*------------------------------------------------------------------------- - * Function: h5tools_set_attr_output_file + * Function: h5tools_set_attr_output_file * - * Purpose: Open fname as the output file for attribute raw data. - * Set rawattrstream as its file stream. - * - * Return: 0 -- succeeded - * negative -- failed + * Purpose: Open fname as the output file for attribute raw data. + * Set rawattrstream as its file stream. * + * Return: 0 -- succeeded + * negative -- failed *------------------------------------------------------------------------- */ int @@ -296,13 +279,13 @@ h5tools_set_attr_output_file(const char *fname, int is_bin) } /*------------------------------------------------------------------------- - * Function: h5tools_set_input_file + * Function: h5tools_set_input_file * - * Purpose: Open fname as the input file for raw input. - * Set rawinstream as its file stream. + * Purpose: Open fname as the input file for raw input. + * Set rawinstream as its file stream. * - * Return: 0 -- succeeded - * negative -- failed + * Return: 0 -- succeeded + * negative -- failed * *------------------------------------------------------------------------- */ @@ -344,13 +327,13 @@ h5tools_set_input_file(const char *fname, int is_bin) } /*------------------------------------------------------------------------- - * Function: h5tools_set_output_file + * Function: h5tools_set_output_file * - * Purpose: Open fname as the output file for raw output. - * Set rawoutstream as its file stream. + * Purpose: Open fname as the output file for raw output. + * Set rawoutstream as its file stream. * - * Return: 0 -- succeeded - * negative -- failed + * Return: 0 -- succeeded + * negative -- failed * *------------------------------------------------------------------------- */ @@ -392,14 +375,13 @@ h5tools_set_output_file(const char *fname, int is_bin) } /*------------------------------------------------------------------------- - * Function: h5tools_set_error_file - * - * Purpose: Open fname as the error output file for dataset raw error. - * Set rawerrorstream as its file stream. + * Function: h5tools_set_error_file * - * Return: 0 -- succeeded - * negative -- failed + * Purpose: Open fname as the error output file for dataset raw error. + * Set rawerrorstream as its file stream. * + * Return: 0 -- succeeded + * negative -- failed *------------------------------------------------------------------------- */ int @@ -441,33 +423,28 @@ h5tools_set_error_file(const char *fname, int is_bin) } /*------------------------------------------------------------------------- - * Audience: Private - * Chapter: H5Tools Library - * Purpose: Get a FAPL for a driver - * Description: - * Get a FAPL for a given VFL driver name. - * Return: - * None - * Programmer: - * Quincey Koziol, 2004-02-04 - * Modifications: - * Pedro Vicente Nunes, Thursday, July 27, 2006 - * Added error return conditions for the H5Pset_fapl calls + * Function: h5tools_get_fapl + * + * Purpose: Get a FAPL for a given VFL driver name. + * + * Return: positive - succeeded + * negative - failed *------------------------------------------------------------------------- */ static hid_t h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) { - hid_t new_fapl; /* Copy of file access property list passed in, or new property list */ + hid_t new_fapl = -1; /* Copy of file access property list passed in, or new property list */ + int ret_value = SUCCEED; /* Make a copy of the FAPL, for the file open call to use, eventually */ if (fapl == H5P_DEFAULT) { if ((new_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed"); } /* end if */ else { if ((new_fapl = H5Pcopy(fapl)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcopy failed"); } /* end else */ /* Determine which driver the user wants to open the file with. Try @@ -475,7 +452,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) if (!HDstrcmp(driver, drivernames[SEC2_IDX])) { /* SEC2 driver */ if (H5Pset_fapl_sec2(new_fapl) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_sec2 failed"); if (drivernum) *drivernum = SEC2_IDX; @@ -487,7 +464,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) * is the member size. */ if (H5Pset_fapl_family(new_fapl, (hsize_t) 0, H5P_DEFAULT) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_family failed"); if (drivernum) *drivernum = FAMILY_IDX; @@ -495,7 +472,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) else if (!HDstrcmp(driver, drivernames[SPLIT_IDX])) { /* SPLIT Driver */ if (H5Pset_fapl_split(new_fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_split failed"); if (drivernum) *drivernum = SPLIT_IDX; @@ -503,7 +480,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) else if (!HDstrcmp(driver, drivernames[MULTI_IDX])) { /* MULTI Driver */ if (H5Pset_fapl_multi(new_fapl, NULL, NULL, NULL, NULL, TRUE) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_multi failed"); if(drivernum) *drivernum = MULTI_IDX; @@ -519,29 +496,28 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) if(mpi_initialized && !mpi_finalized) { if(H5Pset_fapl_mpio(new_fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_mpio failed"); if(drivernum) *drivernum = MPIO_IDX; } /* end if */ } #endif /* H5_HAVE_PARALLEL */ else - goto error; + ret_value = -1; - return(new_fapl); - -error: - if(new_fapl != H5P_DEFAULT) +done: + if((new_fapl != H5P_DEFAULT) && (ret_value < 0)) { H5Pclose(new_fapl); - return -1; + new_fapl = -1; + } + + return(new_fapl); } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Open a file with various VFL drivers. - * Description: - * Loop through the various types of VFL drivers trying to open FNAME. + * Function: h5tools_fopen + * + * Purpose: Loop through the various types of VFL drivers trying to open FNAME. * If the HDF5 library is version 1.2 or less, then we have only the SEC2 * driver to try out. If the HDF5 library is greater than version 1.2, * then we have the FAMILY, SPLIT, and MULTI drivers to play with. @@ -549,6 +525,7 @@ error: * If DRIVER is non-NULL, then it will try to open the file with that * driver first. We assume that the user knows what they are doing so, if * we fail, then we won't try other file drivers. + * * Return: * On success, returns a file id for the opened file. If DRIVERNAME is * non-null then the first DRIVERNAME_SIZE-1 characters of the driver @@ -556,38 +533,6 @@ error: * * Otherwise, the function returns FAIL. If DRIVERNAME is non-null then * the first byte is set to the null terminator. - * Programmer: - * Lost in the mists of time. - * Modifications: - * Robb Matzke, 2000-06-23 - * We only have to initialize driver[] on the first call, thereby - * preventing memory leaks from repeated calls to H5Pcreate(). - * - * Robb Matzke, 2000-06-23 - * Added DRIVERNAME_SIZE arg to prevent overflows when writing to - * DRIVERNAME. - * - * Robb Matzke, 2000-06-23 - * Added test to prevent coredump when the file could not be opened by - * any driver. - * - * Robb Matzke, 2000-06-23 - * Changed name from H5ToolsFopen() so it jives better with the names we - * already have at the top of this source file. - * - * Thomas Radke, 2000-09-12 - * Added Stream VFD to the driver[] array. - * - * Bill Wendling, 2001-01-10 - * Changed macro behavior so that if we have a version other than 1.2.x - * (i.e., > 1.2), then we do the drivers check. - * - * Bill Wendling, 2001-07-30 - * Added DRIVER parameter so that the user can specify "try this driver" - * instead of the default behaviour. If it fails to open the file with - * that driver, this will fail completely (i.e., we won't try the other - * drivers). We're assuming the user knows what they're doing. How UNIX - * of us. *------------------------------------------------------------------------- */ hid_t @@ -652,18 +597,13 @@ done: } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Count the number of columns in a string. - * Description: - * Count the number of columns in a string. This is the number of - * characters in the string not counting line-control characters. - * Return: - * On success, returns the width of the string. Otherwise this function - * returns 0. - * Programmer: - * Robb Matzke, Tuesday, April 27, 1999 - * Modifications: + * Function: h5tools_count_ncols + * + * Purpose: Count the number of columns in a string. This is the number of + * characters in the string not counting line-control characters. + * + * Return: success - returns the width of the string. + * failure - 0. *------------------------------------------------------------------------- */ H5_ATTR_PURE static size_t @@ -681,20 +621,17 @@ h5tools_count_ncols(const char *s) /*------------------------------------------------------------------------- * Function: h5tools_detect_vlen * - * Purpose: Recursive check for any variable length data in given type. + * Purpose: Recursive check for any variable length data in given type. * - * Return: - * TRUE : type conatains any variable length data - * FALSE : type doesn't contain any variable length data - * Negative value: error occur - * - * Programmer: Jonathan Kim March 18, 2011 + * Return: TRUE : type conatains any variable length data + * FALSE : type doesn't contain any variable length data + * Negative value: error occur *------------------------------------------------------------------------- */ htri_t h5tools_detect_vlen(hid_t tid) { - htri_t ret; + htri_t ret = FALSE; /* recursive detect any vlen data values in type (compound, array ...) */ ret = H5Tdetect_class(tid, H5T_VLEN); @@ -713,20 +650,18 @@ done: /*------------------------------------------------------------------------- * Function: h5tools_detect_vlen_str * - * Purpose: Recursive check for variable length string of a datatype. - * - * Return: - * TRUE : type conatains any variable length string - * FALSE : type doesn't contain any variable length string - * Negative value: error occur + * Purpose: Recursive check for variable length string of a datatype. * + * Return: TRUE : type conatains any variable length string + * FALSE : type doesn't contain any variable length string + * Negative value: error occur *------------------------------------------------------------------------- */ htri_t h5tools_detect_vlen_str(hid_t tid) { H5T_class_t tclass = -1; - htri_t ret = FALSE; + htri_t ret = FALSE; ret = H5Tis_variable_str(tid); if((ret == TRUE) || (ret < 0)) @@ -774,25 +709,13 @@ done: } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Emit a simple prefix to STREAM. - * Description: - * If /ctx->need_prefix/ is set then terminate the current line (if - * applicable), calculate the prefix string, and display it at the start - * of a line. - * Return: - * None - * Programmer: - * Robb Matzke, Monday, April 26, 1999 - * Modifications: - * Robb Matzke, 1999-09-29 - * If a new prefix is printed then the current element number is set back - * to zero. - * pvn, 2004-07-08 - * Added support for printing array indices: - * the indentation is printed before the prefix (printed one indentation - * level before) + * Function: h5tools_simple_prefix + * + * Purpose: If /ctx->need_prefix/ is set then terminate the current line (if + * applicable), calculate the prefix string, and display it at the start + * of a line. + * + * Return: None *------------------------------------------------------------------------- */ void @@ -800,7 +723,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hsize_t elmtno, int secnum) { h5tools_str_t prefix; - h5tools_str_t str; /*temporary for indentation */ + h5tools_str_t str; /*temporary for indentation */ size_t templength = 0; unsigned u, indentlevel = 0; @@ -871,15 +794,13 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Emit a simple prefix to STREAM. - * Description: - * If /ctx->need_prefix/ is set then terminate the current line (if - * applicable), calculate the prefix string, and display it at the start - * of a line. Calls region specific function. - * Return: - * None + * Function: h5tools_region_simple_prefix + * + * Purpose: If /ctx->need_prefix/ is set then terminate the current line (if + * applicable), calculate the prefix string, and display it at the start + * of a line. Calls region specific function. + * + * Return: None *------------------------------------------------------------------------- */ void @@ -887,7 +808,7 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hsize_t elmtno, hsize_t *ptdata, int secnum) { h5tools_str_t prefix; - h5tools_str_t str; /*temporary for indentation */ + h5tools_str_t str; /*temporary for indentation */ size_t templength = 0; unsigned u, indentlevel = 0; @@ -958,28 +879,26 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Render an element to output STREAM. - * Description: - * Prints the string buffer to the output STREAM. The string is - * printed according to the format described in INFO. The CTX struct - * contains context information shared between calls to this function. + * Function: h5tools_render_element * - * Return: - * False if a dimension end is reached, otherwise true + * Purpose: Prints the string buffer to the output STREAM. The string is + * printed according to the format described in INFO. The CTX struct + * contains context information shared between calls to this function. + * + * Return: False if a dimension end is reached + * True otherwise * * In/Out: - * h5tools_context_t *ctx - * h5tools_str_t *buffer - * hsize_t *curr_pos + * h5tools_context_t *ctx + * h5tools_str_t *buffer + * hsize_t *curr_pos * * Parameters Description: - * h5tools_str_t *buffer is the string into which to render - * hsize_t curr_pos is the total data element position - * size_t ncols - * hsize_t local_elmt_counter is the local element loop counter - * hsize_t elmt_count is the data element loop counter + * h5tools_str_t *buffer is the string into which to render + * hsize_t curr_pos is the total data element position + * size_t ncols + * hsize_t local_elmt_counter is the local element loop counter + * hsize_t elmt_count is the data element loop counter *------------------------------------------------------------------------- */ hbool_t @@ -988,10 +907,10 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, size_t ncols, hsize_t local_elmt_counter, hsize_t elmt_counter) { hbool_t dimension_break = TRUE; - char *s; - char *section; /*a section of output */ - int secnum; /*section sequence number */ - int multiline; /*datum was multiline */ + char *s = NULL; + char *section = NULL; /* a section of output */ + int secnum; /* section sequence number */ + int multiline; /* datum was multiline */ if (stream == NULL) return dimension_break; @@ -1114,29 +1033,28 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Render a region element to output STREAM. - * Description: - * Prints the string buffer to the output STREAM. The string is - * printed according to the format described in INFO. The CTX struct - * contains context information shared between calls to this function. + * Function: h5tools_render_region_element + * + * Purpose: Prints the string buffer to the output STREAM. The string is + * printed according to the format described in INFO. The CTX struct + * contains context information shared between calls to this function. * * Return: - * False if a dimension end is reached, otherwise true + * False if a dimension end is reached + * True otherwise * * In/Out: - * h5tools_context_t *ctx - * h5tools_str_t *buffer - * hsize_t *curr_pos + * h5tools_context_t *ctx + * h5tools_str_t *buffer + * hsize_t *curr_pos * * Parameters Description: - * h5tools_str_t *buffer is the string into which to render - * hsize_t curr_pos is the total data element position - * size_t ncols - * hsize_t *ptdata - * hsize_t local_elmt_counter is the local element loop counter - * hsize_t elmt_count is the data element loop counter + * h5tools_str_t *buffer is the string into which to render + * hsize_t curr_pos is the total data element position + * size_t ncols + * hsize_t *ptdata + * hsize_t local_elmt_counter is the local element loop counter + * hsize_t elmt_count is the data element loop counter *------------------------------------------------------------------------- */ hbool_t @@ -1145,10 +1063,10 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, size_t ncols, hsize_t *ptdata, hsize_t local_elmt_counter, hsize_t elmt_counter) { hbool_t dimension_break = TRUE; - char *s; - char *section; /*a section of output */ - int secnum; /*section sequence number */ - int multiline; /*datum was multiline */ + char *s = NULL; + char *section = NULL; /* a section of output */ + int secnum; /* section sequence number */ + int multiline; /* datum was multiline */ s = h5tools_str_fmt(buffer, (size_t)0, "%s"); @@ -1270,11 +1188,11 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, } /*------------------------------------------------------------------------- - * Function: init_acc_pos + * Function: init_acc_pos * - * Purpose: initialize accumulator and matrix position + * Purpose: initialize accumulator and matrix position * - * Return: void + * Return: void *------------------------------------------------------------------------- */ void @@ -1295,10 +1213,10 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) /*------------------------------------------------------------------------- * Function: render_bin_output * - * Purpose: Write one element of memory buffer to a binary file stream + * Purpose: Write one element of memory buffer to a binary file stream * - * Return: Success: SUCCEED - * Failure: FAIL + * Return: Success: SUCCEED + * Failure: FAIL *------------------------------------------------------------------------- */ int @@ -1344,7 +1262,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t { unsigned int i; H5T_str_t pad; - char *s; + char *s = NULL; unsigned char tempuchar; pad = H5Tget_strpad(tid); @@ -1372,7 +1290,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t break; case H5T_COMPOUND: { - int snmembs; + int snmembs; unsigned nmembs; if((snmembs = H5Tget_nmembers(tid)) < 0) @@ -1384,7 +1302,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t mem = ((unsigned char*)_mem) + block_index * size; for (j = 0; j < nmembs; j++) { - hid_t memb; + hid_t memb = -1; size_t offset; offset = H5Tget_member_offset(tid, j); @@ -1404,7 +1322,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t { int k, ndims; hsize_t dims[H5S_MAX_RANK], temp_nelmts, nelmts; - hid_t memb; + hid_t memb = -1; /* get the array's base datatype for each element */ memb = H5Tget_super(tid); @@ -1437,7 +1355,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t case H5T_VLEN: { hsize_t nelmts; - hid_t memb; + hid_t memb = -1; /* get the VL sequences's base datatype for each element */ memb = H5Tget_super(tid); @@ -1462,7 +1380,8 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t /* if (H5Tequal(tid, H5T_STD_REF_DSETREG)) */ if (region_output) { /* region data */ - hid_t region_id, region_space; + hid_t region_id = -1; + hid_t region_space = -1; H5S_sel_type region_type; for (block_index = 0; block_index < block_nelmts; block_index++) { @@ -1512,15 +1431,13 @@ CATCH } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Print the data values from a dataset referenced by region blocks. + * Function: render_bin_output_region_data_blocks * - * Description: - * This is a special case subfunction to print the data in a region reference of type blocks. + * Purpose: Print the data values from a dataset referenced by region blocks. + * This is a special case subfunction to print the data in a region reference of type blocks. * - * Return: - * The function returns FAIL if there was an error, otherwise SUCEED + * Return: FAIL if there was an error + * SUCCEED otherwise * *------------------------------------------------------------------------- */ @@ -1609,16 +1526,13 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Print some values from a dataset referenced by region blocks. - * - * Description: - * This is a special case subfunction to dump a region reference using blocks. + * Function: render_bin_output_region_blocks * - * Return: - * The function returns False if ERROR, otherwise True + * Purpose: Print some values from a dataset referenced by region blocks. + * This is a special case subfunction to dump a region reference using blocks. * + * Return: False if ERROR + * True otherwise *------------------------------------------------------------------------- */ hbool_t @@ -1629,7 +1543,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, hssize_t snblocks; hsize_t nblocks; hsize_t alloc_size; - hsize_t *ptdata; + hsize_t *ptdata = NULL; int sndims; unsigned ndims; hid_t dtype = -1; @@ -1675,8 +1589,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library + * Function: H5Tools Library * Purpose: Print the data values from a dataset referenced by region points. * * Description: @@ -1736,16 +1649,13 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id, } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Print some values from a dataset referenced by region points. + * Function: render_bin_output_region_points * - * Description: - * This is a special case subfunction to dump a region reference using points. - * - * Return: - * The function returns False if the last dimension has been reached, otherwise True + * Purpose: Print some values from a dataset referenced by region points. + * This is a special case subfunction to dump a region reference using points. * + * Return: False if the last dimension has been reached + * True otherwise *------------------------------------------------------------------------- */ hbool_t @@ -1791,11 +1701,12 @@ CATCH } /*------------------------------------------------------------------------- - * Function: h5tools_is_zero + * Function: h5tools_is_zero * - * Purpose: Determines if memory is initialized to all zero bytes. + * Purpose: Determines if memory is initialized to all zero bytes. * - * Return: TRUE if all bytes are zero; FALSE otherwise + * Return: TRUE if all bytes are zero + * FALSE otherwise *------------------------------------------------------------------------- */ H5_ATTR_PURE hbool_t @@ -1811,23 +1722,20 @@ h5tools_is_zero(const void *_mem, size_t size) } /*------------------------------------------------------------------------- - * Function: h5tools_is_obj_same + * Function: h5tools_is_obj_same * - * Purpose: Check if two given object IDs or link names point to the same object. + * Purpose: Check if two given object IDs or link names point to the same object. * * Parameters: - * hid_t loc_id1: location of the first object - * char *name1: link name of the first object. - * Use "." or NULL if loc_id1 is the object to be compared. - * hid_t loc_id2: location of the second object - * char *name1: link name of the first object. - * Use "." or NULL if loc_id2 is the object to be compared. - * - * Return: TRUE if it is the same object; FALSE otherwise. + * hid_t loc_id1: location of the first object + * char *name1: link name of the first object. + * Use "." or NULL if loc_id1 is the object to be compared. + * hid_t loc_id2: location of the second object + * char *name1: link name of the first object. + * Use "." or NULL if loc_id2 is the object to be compared. * - * Programmer: Peter Cao - * 4/27/2011 - * + * Return: TRUE if it is the same object + * FALSE otherwise. *------------------------------------------------------------------------- */ hbool_t diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index f987296..ed7d38a 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -2888,7 +2888,7 @@ void h5tools_print_fill_value(h5tools_str_t *buffer/*in,out*/, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t dcpl, hid_t type_id, hid_t obj_id) { size_t size; - hid_t n_type; + hid_t n_type = -1; void *buf = NULL; n_type = H5Tget_native_type(type_id, H5T_DIR_DEFAULT); @@ -3638,7 +3638,8 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, error_msg("unable to open attribute \"%s\"\n", attr_name); } else { - hid_t type, space; + hid_t type = -1; + hid_t space = -1; ctx->indent_level++; @@ -3857,9 +3858,9 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, H5S_class_t space_type; int ndims; int i; - hid_t space; - hid_t type; - hid_t p_type; + hid_t space = -1; + hid_t type = -1; + hid_t p_type = -1; hsize_t size[64]; hsize_t alloc_size; hsize_t nelmts = 1; diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index a66cfe5..a018394 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -715,10 +715,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai { size_t nsize, offset, size=0, nelmts, start; H5T_sign_t nsign; - char *name; + char *name = NULL; unsigned char *ucp_vp = (unsigned char *)vp; char *cp_vp = (char *)vp; - hid_t memb, obj; + hid_t memb = -1; + hid_t obj = -1; static char fmt_llong[8], fmt_ullong[8]; H5T_str_t pad; H5T_class_t type_class; @@ -1306,7 +1307,8 @@ void h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, hid_t container, void *vp) { - hid_t obj, region; + hid_t obj = -1; + hid_t region = -1; char ref_name[1024]; H5S_sel_type region_type; diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index a081c7e..5272e81 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -482,8 +482,7 @@ search_obj(table_t *table, haddr_t objno) *------------------------------------------------------------------------- */ static herr_t -find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen, - void *op_data) +find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen, void *op_data) { find_objs_t *info = (find_objs_t*)op_data; herr_t ret_value = 0; @@ -496,7 +495,7 @@ find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen case H5O_TYPE_DATASET: if(NULL == already_seen) { - hid_t dset; + hid_t dset = -1; /* Add the dataset to the list of objects */ add_obj(info->dset_table, oinfo->addr, name, TRUE); diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 14b9461..c98575c 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -374,7 +374,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, if ((is_named = H5Tcommitted(ftype_id)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tcommitted failed"); if (is_named && travt) { - hid_t fidout; + hid_t fidout = -1; /* Create out file id */ if ((fidout = H5Iget_file_id(loc_out)) < 0) @@ -707,9 +707,9 @@ done: */ static int check_objects(const char* fname, pack_opt_t *options) { int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t fid; - hid_t did; - hid_t sid; + hid_t fid = -1; + hid_t did = -1; + hid_t sid = -1; unsigned int i; unsigned int uf; trav_table_t *travt = NULL; diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index b043047..fa72cfe 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -1097,7 +1097,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, *------------------------------------------------------------------------- */ else { - hid_t pid; + hid_t pid = -1; /* create property to pass copy options */ if ((pid = H5Pcreate(H5P_OBJECT_COPY)) < 0) @@ -1435,51 +1435,51 @@ void print_user_block(const char *filename, hid_t fid) { int ret_value = 0; - int fh; /* file handle */ - hsize_t ub_size; /* user block size */ - hsize_t size; /* size read */ - hid_t fcpl; /* file creation property list ID for HDF5 file */ + hid_t fh = -1; /* file handle */ + hsize_t ub_size; /* user block size */ + hsize_t size; /* size read */ + hid_t fcpl = -1; /* file creation property list ID for HDF5 file */ int i; /* get user block size */ - if(( fcpl = H5Fget_create_plist(fid)) < 0) { + if ((fcpl = H5Fget_create_plist(fid)) < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list"); } - if(H5Pget_userblock(fcpl, &ub_size) < 0) { + if (H5Pget_userblock(fcpl, &ub_size) < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pget_userblock failed to retrieve userblock size"); } - if(H5Pclose(fcpl) < 0) { + if (H5Pclose(fcpl) < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pclose failed to close property list"); } /* open file */ - if((fh = HDopen(filename, O_RDONLY)) < 0) { + if ((fh = HDopen(filename, O_RDONLY)) < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed to open file <%s>", filename); } size = ub_size; /* read file */ - while(size > 0) { + while (size > 0) { ssize_t nread; /* # of bytes read */ char rbuf[USERBLOCK_XFER_SIZE]; /* buffer for reading */ /* read buffer */ - if(size > USERBLOCK_XFER_SIZE) + if (size > USERBLOCK_XFER_SIZE) nread = HDread(fh, rbuf, (size_t)USERBLOCK_XFER_SIZE); else nread = HDread(fh, rbuf, (size_t)size); - for(i = 0; i < nread; i++) { + for (i = 0; i < nread; i++) { printf("%c ", rbuf[i]); } printf("\n"); - if(nread < 0) { + if (nread < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "nread < 0"); } @@ -1488,7 +1488,7 @@ print_user_block(const char *filename, hid_t fid) } done: - if(fh > 0) + if (fh > 0) HDclose(fh); return; diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index 14294ea..7b610a3 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -145,7 +145,7 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ if(H5Tequal(mtype_id, H5T_STD_REF_OBJ)) { - hid_t refobj_id; + hid_t refobj_id = -1; hobj_ref_t *refbuf = NULL; /* buffer for object references */ hobj_ref_t *buf = NULL; const char* refname; @@ -221,7 +221,7 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) { - hid_t refobj_id; + hid_t refobj_id = -1; hdset_reg_ref_t *refbuf = NULL; /* input buffer for region references */ hdset_reg_ref_t *buf = NULL; /* output buffer */ const char* refname; @@ -260,7 +260,7 @@ int do_copy_refobjs(hid_t fidin, * in the second traversal of the file */ if((refname = MapIdToName(refobj_id, travt)) != NULL) { - hid_t region_id; /* region id of the referenced dataset */ + hid_t region_id = -1; /* region id of the referenced dataset */ if((region_id = H5Rget_region(dset_in, H5R_DATASET_REGION, &buf[u])) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rget_region failed"); @@ -481,18 +481,16 @@ static int copy_refs_attr(hid_t loc_in, is_ref = (type_class == H5T_REFERENCE); if(type_class == H5T_VLEN ) { - hid_t base_type; + hid_t base_type = H5Tget_super(ftype_id); - base_type = H5Tget_super(ftype_id); is_ref_vlen = (H5Tget_class(base_type) == H5T_REFERENCE); msize = H5Tget_size(base_type); if (H5Tclose(base_type) < 0) H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed"); } else if(type_class == H5T_ARRAY ) { - hid_t base_type; + hid_t base_type = H5Tget_super(ftype_id); - base_type = H5Tget_super(ftype_id); is_ref_array = (H5Tget_class(base_type) == H5T_REFERENCE); msize = H5Tget_size(base_type); if (H5Tclose(base_type) < 0) @@ -573,9 +571,8 @@ static int copy_refs_attr(hid_t loc_in, unsigned array_rank = 0; hsize_t array_size = 1; hsize_t array_dims[H5S_MAX_RANK]; - hid_t base_type; + hid_t base_type = H5Tget_super(ftype_id); - base_type = H5Tget_super(ftype_id); msize = H5Tget_size(base_type); if (H5Tclose(base_type) < 0) H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed"); -- cgit v0.12 From 1743470502095271be64a20d80dc53f085e75a09 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 23 Oct 2017 12:42:41 -0500 Subject: HDFFV-10297 Free buffer inside loop --- tools/src/h5repack/h5repack_copy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index fa72cfe..a85ef08 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -927,6 +927,11 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, if (TRUE == H5Tdetect_class(wtype_id, H5T_VLEN)) if (H5Dvlen_reclaim(wtype_id, f_space_id, H5P_DEFAULT, buf) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dvlen_reclaim failed"); + /* free */ + if (buf != NULL) { + HDfree(buf); + buf = NULL; + } } else { /* possibly not enough memory, read/write by hyperslabs */ size_t p_type_nbytes = msize; /*size of memory type */ -- cgit v0.12 From 075a32fa0c03beda1cbef88ac7940b75b36454b5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 24 Oct 2017 11:03:00 -0500 Subject: Fix typos --- tools/lib/h5tools.c | 10 +++++----- tools/src/h5repack/h5repack_copy.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 6ea5e47..89cb524 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -623,9 +623,9 @@ h5tools_count_ncols(const char *s) * * Purpose: Recursive check for any variable length data in given type. * - * Return: TRUE : type conatains any variable length data + * Return: TRUE : type contains any variable length data * FALSE : type doesn't contain any variable length data - * Negative value: error occur + * Negative value: failed *------------------------------------------------------------------------- */ htri_t @@ -652,9 +652,9 @@ done: * * Purpose: Recursive check for variable length string of a datatype. * - * Return: TRUE : type conatains any variable length string + * Return: TRUE : type contains any variable length string * FALSE : type doesn't contain any variable length string - * Negative value: error occur + * Negative value: failed *------------------------------------------------------------------------- */ htri_t @@ -1652,7 +1652,7 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id, * Function: render_bin_output_region_points * * Purpose: Print some values from a dataset referenced by region points. - * This is a special case subfunction to dump a region reference using points. + * This is a special case function to dump a region reference using points. * * Return: False if the last dimension has been reached * True otherwise diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index a85ef08..63c26fb 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -1440,7 +1440,7 @@ void print_user_block(const char *filename, hid_t fid) { int ret_value = 0; - hid_t fh = -1; /* file handle */ + int t fh = -1; /* file handle */ hsize_t ub_size; /* user block size */ hsize_t size; /* size read */ hid_t fcpl = -1; /* file creation property list ID for HDF5 file */ -- cgit v0.12 From def0d66aa2db7e3d87f5527b56b512680703418e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 24 Oct 2017 11:04:50 -0500 Subject: fix typo --- tools/src/h5repack/h5repack_copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 63c26fb..5487c27 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -1440,7 +1440,7 @@ void print_user_block(const char *filename, hid_t fid) { int ret_value = 0; - int t fh = -1; /* file handle */ + int fh = -1; /* file handle */ hsize_t ub_size; /* user block size */ hsize_t size; /* size read */ hid_t fcpl = -1; /* file creation property list ID for HDF5 file */ -- cgit v0.12 From 7ee40947e1808e63666f3129c30b3d52ac15d4e8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 24 Oct 2017 14:05:24 -0500 Subject: Correct typo --- tools/src/h5repack/h5repack_copy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 5487c27..e205fba 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -920,7 +920,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, if(H5Dread(dset_in, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); if(H5Dwrite(dset_out, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dwrite failed"); /* Check if we have VL data in the dataset's * datatype that must be reclaimed */ @@ -1011,7 +1011,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, if(H5Dread(dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); if(H5Dwrite(dset_out, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dwrite failed"); /* reclaim any VL memory, if necessary */ if (vl_data) -- cgit v0.12 From 26ae202faa4a761c307bf15eacc28f96bedc7859 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 25 Oct 2017 10:32:33 -0500 Subject: HDFFV-10037: fixed wrong C link flags --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ed7727b..3dbd95c 100644 --- a/configure.ac +++ b/configure.ac @@ -3518,7 +3518,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then case "`uname`" in Linux*) if test "X$FC_BASENAME" = "Xnagfor"; then - cat libtool | awk '/NAG_Fortran/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + cat libtool | awk '/BEGIN LIBTOOL TAG CONFIG: FC/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,-Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool fi ;; esac -- cgit v0.12